diff --git a/src/components/VButton.vue b/src/components/VButton.vue index fc85a732a8..279d07da85 100644 --- a/src/components/VButton.vue +++ b/src/components/VButton.vue @@ -323,25 +323,43 @@ a.button { .action-menu { @apply border border-tx bg-tx text-dark-charcoal hover:border-dark-charcoal-20; } - -.action-menu-secondary { - @apply border border-tx bg-white text-dark-charcoal hover:border-dark-charcoal-20; +.action-menu-pressed { + @apply border-tx bg-dark-charcoal text-white hover:border-tx hover:bg-dark-charcoal-90; } -.action-menu-secondary-pressed { - @apply border-tx bg-dark-charcoal text-white; +/** +Similar to `action-menu`, but always has a border, not only on hover. +https://www.figma.com/file/GIIQ4sDbaToCfFQyKMvzr8/Openverse-Design-Library?node-id=1684%3A3678 + */ +.action-menu-bordered { + @apply border border-dark-charcoal-20 bg-white text-dark-charcoal focus-visible:border-tx; } - -.action-menu-pressed { - @apply border-tx bg-dark-charcoal text-white hover:border-tx; +.action-menu-bordered-pressed { + @apply border-dark-charcoal bg-dark-charcoal text-white hover:bg-dark-charcoal-80; } .action-menu-muted { @apply border border-tx bg-dark-charcoal-10 text-dark-charcoal hover:border-dark-charcoal-20; } - .action-menu-muted-pressed { - @apply border border-tx bg-dark-charcoal text-white; + @apply border border-tx bg-dark-charcoal text-white hover:border-tx hover:bg-dark-charcoal-90; +} + +.action-menu[disabled='disabled'], +.action-menu[aria-disabled='true'], +.action-menu-muted[disabled='disabled'], +.action-menu-muted[aria-disabled='true'], +.action-menu-bordered[disabled='disabled'], +.action-menu-bordered[aria-disabled='true'] { + @apply border-dark-charcoal-10 bg-dark-charcoal-10 text-dark-charcoal-40; +} + +.action-menu-secondary { + @apply border border-tx bg-white text-dark-charcoal hover:border-dark-charcoal-20; +} + +.action-menu-secondary-pressed { + @apply border-tx bg-dark-charcoal text-white; } .full { diff --git a/src/components/VContentSwitcher/VMobileMenuModal.vue b/src/components/VContentSwitcher/VMobileMenuModal.vue deleted file mode 100644 index 0f57e76ed1..0000000000 --- a/src/components/VContentSwitcher/VMobileMenuModal.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/src/components/VContentSwitcher/VSearchTypeButton.vue b/src/components/VContentSwitcher/VSearchTypeButton.vue index 27eaecd15e..d810fd2729 100644 --- a/src/components/VContentSwitcher/VSearchTypeButton.vue +++ b/src/components/VContentSwitcher/VSearchTypeButton.vue @@ -1,11 +1,7 @@ diff --git a/src/components/VHeader/VHeaderFilter.vue b/src/components/VHeader/VHeaderFilter.vue deleted file mode 100644 index 187441622c..0000000000 --- a/src/components/VHeader/VHeaderFilter.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - diff --git a/src/components/VHeader/VHeaderMenu.vue b/src/components/VHeader/VHeaderMenu.vue deleted file mode 100644 index 1c06608756..0000000000 --- a/src/components/VHeader/VHeaderMenu.vue +++ /dev/null @@ -1,101 +0,0 @@ - diff --git a/src/components/VHeader/VHeader.vue b/src/components/VHeader/VHeaderMobile.vue similarity index 83% rename from src/components/VHeader/VHeader.vue rename to src/components/VHeader/VHeaderMobile.vue index e5834cae55..ec6171e5fb 100644 --- a/src/components/VHeader/VHeader.vue +++ b/src/components/VHeader/VHeaderMobile.vue @@ -1,45 +1,43 @@ @@ -62,10 +60,9 @@ import { useI18nResultsCount } from '~/composables/use-i18n-utilities' import { useMediaStore } from '~/stores/media' import { isSearchTypeSupported, useSearchStore } from '~/stores/search' +import VContentSettingsButton from '~/components/VHeader/VContentSettingsButton.vue' import VLogoButton from '~/components/VHeader/VLogoButton.vue' -import VHeaderFilter from '~/components/VHeader/VHeaderFilter.vue' import VSearchBar from '~/components/VHeader/VSearchBar/VSearchBar.vue' -import VHeaderMenu from '~/components/VHeader/VHeaderMenu.vue' import closeIcon from '~/assets/icons/close.svg' @@ -75,12 +72,14 @@ const menus = { } type HeaderMenu = 'filters' | 'content-switcher' +/** + * The mobile search header component. + */ export default defineComponent({ - name: 'VHeader', + name: 'VHeaderMobile', components: { + VContentSettingsButton, VLogoButton, - VHeaderFilter, - VHeaderMenu, VSearchBar, }, setup() { diff --git a/src/components/VHeader/meta/VFilterButton.stories.mdx b/src/components/VHeader/meta/VFilterButton.stories.mdx index da896ca3d7..c972fe4247 100644 --- a/src/components/VHeader/meta/VFilterButton.stories.mdx +++ b/src/components/VHeader/meta/VFilterButton.stories.mdx @@ -5,7 +5,6 @@ import { Meta, Story, } from '@storybook/addon-docs' -import { provide, ref } from '@nuxtjs/composition-api' import VFilterButton from '~/components/VHeader/VFilterButton.vue' import { useSearchStore } from '~/stores/search' import { filterData, mediaFilterKeys } from '~/constants/filters' @@ -21,23 +20,24 @@ import { IMAGE } from '~/constants/media' appliedFilters: { type: 'number', }, - scrolled: { - type: 'boolean', + toggle: { + action: 'toggle', }, - isMinMd: { - type: 'boolean', + tab: { + action: 'tab', }, }} /> export const Template = (args, { argTypes }) => ({ - template: ``, + template: ``, components: { VFilterButton }, props: Object.keys(argTypes), setup() { const searchStore = useSearchStore() searchStore.setSearchType(IMAGE) function applyNFilters(filterCount) { + searchStore.clearFilters() const filterTypes = [...mediaFilterKeys[IMAGE]] let filterIdx = 0 // Skip license type filters as they can disable license filters @@ -56,12 +56,6 @@ export const Template = (args, { argTypes }) => ({ } } applyNFilters(args.appliedFilters) - if (args.scrolled) { - provide('isHeaderScrolled', ref(true)) - } - if (args.isMinMd) { - provide('isMinScreenMd', ref(true)) - } return { args } }, }) @@ -78,15 +72,24 @@ the field receives an input. It also emits the `search` event when the search button is clicked. - {Template.bind({})} + + {Template.bind({})} + diff --git a/src/components/VHeader/meta/VHeader.stories.mdx b/src/components/VHeader/meta/VHeader.stories.mdx deleted file mode 100644 index f412233e46..0000000000 --- a/src/components/VHeader/meta/VHeader.stories.mdx +++ /dev/null @@ -1,42 +0,0 @@ -import { - ArgsTable, - Canvas, - Description, - Meta, - Story, -} from '@storybook/addon-docs' -import VHeader from '~/components/VHeader/VHeader.vue' - - - -export const Template = (args) => ({ - template: ` - `, - components: { VHeader }, - setup() { - return { args } - }, -}) - -# VHeader - - - - - -The header component. Fixed on scroll, search bar, content switcher, pages menu and filters button. - - - {Template.bind({})} - diff --git a/src/components/VHeader/meta/VHeaderDesktop.stories.mdx b/src/components/VHeader/meta/VHeaderDesktop.stories.mdx new file mode 100644 index 0000000000..c795102186 --- /dev/null +++ b/src/components/VHeader/meta/VHeaderDesktop.stories.mdx @@ -0,0 +1,31 @@ +import { + ArgsTable, + Canvas, + Description, + Meta, + Story, +} from '@storybook/addon-docs' +import VHeaderDesktop from '~/components/VHeader/VHeaderDesktop.vue' + + + +export const Template = (args) => ({ + template: ` + `, + components: { VHeaderDesktop }, + setup() { + return { args } + }, +}) + +# VHeaderDesktop + + + + + +The header component used for screens on breakpoints wider than `lg`. Fixed on scroll, search bar, content switcher, pages menu and filters button. + + + {Template.bind({})} + diff --git a/src/components/VHeader/meta/VHeaderMobile.stories.mdx b/src/components/VHeader/meta/VHeaderMobile.stories.mdx new file mode 100644 index 0000000000..0d14c54440 --- /dev/null +++ b/src/components/VHeader/meta/VHeaderMobile.stories.mdx @@ -0,0 +1,42 @@ +import { + ArgsTable, + Canvas, + Description, + Meta, + Story, +} from '@storybook/addon-docs' +import VHeaderMobile from '~/components/VHeader/VHeaderMobile.vue' + + + +export const Template = (args) => ({ + template: ` + `, + components: { VHeaderMobile }, + setup() { + return { args } + }, +}) + +# VHeaderMobile + + + + + +The header component used for screens up to `lg` breakpoint. Fixed on scroll, search bar, content switcher, pages menu and filters button. + + + {Template.bind({})} + diff --git a/src/components/VHeaderOld/meta/VFilterButton.stories.mdx b/src/components/VHeaderOld/meta/VFilterButtonOld.stories.mdx similarity index 100% rename from src/components/VHeaderOld/meta/VFilterButton.stories.mdx rename to src/components/VHeaderOld/meta/VFilterButtonOld.stories.mdx diff --git a/src/components/VLogoLoader/VLogoLoader.vue b/src/components/VLogoLoader/VLogoLoader.vue index 423e4f59b8..ebb139936e 100644 --- a/src/components/VLogoLoader/VLogoLoader.vue +++ b/src/components/VLogoLoader/VLogoLoader.vue @@ -5,11 +5,12 @@ :class="{ [$style.loading]: status === 'loading' && !prefersReducedMotion, 'h-10 w-10': autoResize, + 'h-12 w-12': !autoResize, }" aria-hidden="true" :data-prefers-reduced-motion="prefersReducedMotion" data-testid="logo-loader" - class="inline-flex h-12 w-12 items-center justify-center rounded p-3 md:h-12 md:w-12" + class="inline-flex items-center justify-center rounded p-3 md:h-12 md:w-12" fill="currentColor" >
-
+