Skip to content

Commit

Permalink
fix: adjustments to NavJumpMenu (#556)
Browse files Browse the repository at this point in the history
* adjustments to NavJumpMenu

* disabling percy, over quota
  • Loading branch information
stephiescastle authored Aug 21, 2024
1 parent 42410ea commit b475e74
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 42 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,37 +80,37 @@ jobs:
"pnpm --filter @explorer-1/vue-storybook start" \
"pnpm --filter @explorer-1/vue-storybook test:ci"
visual-tests:
needs: [build, a11y-tests]
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Set up Node ⬢
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'

- name: Install dependencies 🧱
run: pnpm i

- name: Download storybook build
uses: actions/download-artifact@v3
with:
name: storybook
path: apps/vue-storybook/storybook_compiled

- name: Run Percy
id: run-percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
run: pnpm --filter @explorer-1/vue-storybook percy
# visual-tests:
# needs: [build, a11y-tests]
# timeout-minutes: 30
# runs-on: ubuntu-latest
# steps:
# - name: Checkout 🛎️
# uses: actions/checkout@v4

# - name: Setup pnpm
# uses: pnpm/action-setup@v4

# - name: Set up Node ⬢
# uses: actions/setup-node@v4
# with:
# node-version-file: '.nvmrc'
# cache: 'pnpm'

# - name: Install dependencies 🧱
# run: pnpm i

# - name: Download storybook build
# uses: actions/download-artifact@v3
# with:
# name: storybook
# path: apps/vue-storybook/storybook_compiled

# - name: Run Percy
# id: run-percy
# env:
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
# run: pnpm --filter @explorer-1/vue-storybook percy

publish:
needs: [build, a11y-tests]
Expand Down
16 changes: 14 additions & 2 deletions packages/vue/src/components/NavJumpMenu/NavJumpMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ interface NavJumpMenuProps {
headingLevel?: string
invert?: boolean
enabled?: boolean
dropdownText?: string
}
const props = withDefaults(defineProps<NavJumpMenuProps>(), {
Expand All @@ -59,7 +60,8 @@ const props = withDefaults(defineProps<NavJumpMenuProps>(), {
headingLevel: 'h2',
enabled: true,
invert: true,
hidden: false
hidden: false,
dropdownText: 'Jump to…'
})
const NavJumpMenuRef = ref()
Expand Down Expand Up @@ -102,7 +104,7 @@ const theBreadcrumbs = computed(() => {
path: '#siteTop'
}
const jumpMenu: BreadcrumbPathObject = {
title: 'Jump to…',
title: props.dropdownText,
path: '#',
children: theJumpLinks.value as BreadcrumbPathObject[]
}
Expand Down Expand Up @@ -139,5 +141,15 @@ watch(
@apply opacity-100 transition-all pointer-events-auto;
}
}
.NavSecondaryLink.secondary-root {
span {
@apply border-primary #{!important};
}
&.-invert {
span {
@apply border-white #{!important};
}
}
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<NavDropdownToggle
:aria-expanded="dropdownVisible ? true : false"
:path="item.path"
class="font-medium border-t-2 border-transparent block px-3 py-2"
class="-t-2 border-transparent block px-3 py-2"
:class="dropdownToggleClasses(index)"
:invert="invert"
@toggle-clicked="toggleDropdown()"
Expand Down Expand Up @@ -69,7 +69,6 @@ export default defineComponent({
type: Object,
required: true
},
invert: {
type: Boolean,
required: false,
Expand Down Expand Up @@ -121,13 +120,13 @@ export default defineComponent({
dropdownToggleClasses(index: number) {
return this.invert
? {
'mr-auto text-white font-semibold secondary-root': index === 0,
'text-white': index !== 0,
'mr-auto text-white font-bold secondary-root': index === 0,
'text-white font-semibold !pt-[.6rem]': index !== 0,
'-open': this.dropdownVisible
}
: {
'mr-auto text-primary font-semibold secondary-root': index === 0,
'text-gray-dark': index !== 0,
'text-gray-dark font-medium !pt-[.6rem]': index !== 0,
'-open': this.dropdownVisible
}
},
Expand Down
10 changes: 6 additions & 4 deletions packages/vue/src/components/NavSecondary/NavSecondaryLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ export default defineComponent({
return false
},
baseLinkClasses(index: number | undefined) {
let rootClasses = 'mr-auto font-semibold secondary-root'
let rootClasses = 'mr-auto secondary-root'
rootClasses = this.invert
? `${rootClasses} text-white -invert`
: `${rootClasses} text-primary`
const regularClasses = this.invert ? 'text-white -invert' : 'text-gray-dark'
? `${rootClasses} text-white font-bold -invert`
: `${rootClasses} text-primary font-semibold`
const regularClasses = this.invert
? 'text-white -invert font-semibold'
: 'text-gray-dark font-medium'
return index === 0 ? rootClasses : regularClasses
},
spanClasses(index: number | undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export default defineComponent({
:title="data.title"
:blocks="data.body"
:enabled="data.showJumpMenu"
dropdown-text="In this article"
/>
<!-- inline hero content -->
<LayoutHelper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ const consolidatedSections = computed((): EduLessonSectionObject[] => {
:title="data.title"
:blocks="consolidatedBlocks"
:enabled="true"
dropdown-text="In this lesson"
/>
<template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ defineExpose({
:title="data.title"
:blocks="data.body"
:enabled="data.showJumpMenu"
dropdown-text="In this news article"
/>

<!-- schema.org -->
Expand Down

0 comments on commit b475e74

Please sign in to comment.