@pnx-mixtape/mxds 0.1.0-rc.2 → 0.1.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/{preview.ts → preview.tsx} +4 -0
- package/.storybook/src/docs.tsx +29 -0
- package/dist/build/accordion.entry.js +1 -1
- package/dist/build/autocomplete.css +1 -1
- package/dist/build/autocomplete.entry.js +1 -1
- package/dist/build/base.css +1 -1
- package/dist/build/breadcrumb.css +1 -1
- package/dist/build/button.css +1 -1
- package/dist/build/card.css +1 -1
- package/dist/build/chunks/{Accordion-z-dH6nFH.js → Accordion-GN0sME4W.js} +1 -1
- package/dist/build/chunks/{AccordionMobile-BYPPNyf5.js → AccordionMobile-DG5jSe8Q.js} +1 -1
- package/dist/build/chunks/{Autocomplete-2L6tLLuh.js → Autocomplete-B4RtkAyh.js} +1 -1
- package/dist/build/chunks/{ClosableAlert-DdXbF1J2.js → ClosableAlert-DEhj8Nxm.js} +1 -1
- package/dist/build/chunks/{Dialog-Ds8gzhri.js → Dialog-Haahn-Yn.js} +1 -1
- package/dist/build/chunks/Gallery-D8NGXy2Q.js +1 -0
- package/dist/build/chunks/GlobalToggle-B52fdBQu.js +1 -0
- package/dist/build/chunks/{InPageNavigation-CVieEl9u.js → InPageNavigation-Dyn2TR-N.js} +1 -1
- package/dist/build/chunks/Navigation-hOrfLq7h.js +1 -0
- package/dist/build/chunks/{Sticky-cWUVSOXN.js → Sticky-BGCuuEJK.js} +1 -1
- package/dist/build/chunks/{Tabs-DA_Ez8pv.js → Tabs-DYy1YTdU.js} +1 -1
- package/dist/build/chunks/enums-DLV_1NAf.js +1 -0
- package/dist/build/chunks/utilities-_Bq3TxAQ.js +1 -0
- package/dist/build/cookie-consent.css +1 -1
- package/dist/build/dialog.entry.js +1 -1
- package/dist/build/elements.js +1 -1
- package/dist/build/filters.css +1 -1
- package/dist/build/filters.entry.js +1 -1
- package/dist/build/form.css +1 -1
- package/dist/build/gallery.entry.js +1 -1
- package/dist/build/global-alert.entry.js +1 -1
- package/dist/build/header.entry.js +1 -1
- package/dist/build/icon.css +1 -1
- package/dist/build/in-page-navigation.entry.js +1 -1
- package/dist/build/list-item.css +1 -1
- package/dist/build/navigation.entry.js +1 -1
- package/dist/build/one-time-code.css +1 -0
- package/dist/build/popover.css +1 -1
- package/dist/build/print.css +1 -1
- package/dist/build/react.js +1 -1
- package/dist/build/steps.css +1 -1
- package/dist/build/sticky.entry.js +1 -1
- package/dist/build/tabs.css +1 -1
- package/dist/build/tabs.entry.js +1 -1
- package/dist/build/utilities.css +1 -1
- package/dist/types/Atom/Link/Link.d.ts.map +1 -1
- package/dist/types/Component/Accordion/Accordion.d.ts.map +1 -1
- package/dist/types/Component/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/Component/Filters/Elements/Filters.d.ts +20 -1
- package/dist/types/Component/Filters/Elements/Filters.d.ts.map +1 -1
- package/dist/types/Component/Filters/Filters.d.ts +7 -2
- package/dist/types/Component/Filters/Filters.d.ts.map +1 -1
- package/dist/types/Component/Gallery/Gallery.d.ts.map +1 -1
- package/dist/types/Component/Pagination/Components/PaginationContext.d.ts.map +1 -1
- package/dist/types/Component/Tabs/Tabs.d.ts.map +1 -1
- package/dist/types/Form/Autocomplete/Autocomplete.d.ts +2 -2
- package/dist/types/Form/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/types/Form/Autocomplete/Elements/Autocomplete.d.ts +10 -0
- package/dist/types/Form/Autocomplete/Elements/Autocomplete.d.ts.map +1 -1
- package/dist/types/Form/OneTimeCode/OneTimeCode.d.ts +12 -0
- package/dist/types/Form/OneTimeCode/OneTimeCode.d.ts.map +1 -0
- package/dist/types/Utility/Hooks/useIsomorphicLayoutEffect.d.ts +4 -0
- package/dist/types/Utility/Hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
- package/dist/types/enums.d.ts +4 -0
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/react.d.ts +1 -0
- package/dist/types/react.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +2 -3
- package/src/Atom/Button/_buttons.css +16 -0
- package/src/Atom/Button/button.twig +4 -1
- package/src/Atom/DefinitionList/DefinitionList.stories.ts +3 -0
- package/src/Atom/Icon/_icon.css +3 -0
- package/src/Atom/Link/Link.tsx +16 -3
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +7 -12
- package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +1 -1
- package/src/Atom/Link/_links.css +9 -0
- package/src/Atom/Link/link.twig +8 -2
- package/src/Atom/LinkedImage/linked-image.twig +1 -2
- package/src/Component/Accordion/Accordion.stories.ts +31 -0
- package/src/Component/Accordion/Accordion.tsx +3 -2
- package/src/Component/Accordion/AccordionItem.stories.ts +27 -0
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +36 -0
- package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +16 -0
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +3 -6
- package/src/Component/Breadcrumb/breadcrumb.css +4 -0
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +11 -22
- package/src/Component/Card/card.css +2 -2
- package/src/Component/Carousel/Carousel.stories.ts +55 -0
- package/src/Component/Carousel/Carousel.stories.tsx +74 -0
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +273 -88
- package/src/Component/Carousel/__snapshots__/Carousel.stories.tsx.snap +5 -3
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +12 -24
- package/src/Component/CookieConsent/cookie-consent.css +3 -1
- package/src/Component/Dialog/Dialog.stories.ts +33 -0
- package/src/Component/Dialog/Dialog.stories.tsx +25 -0
- package/src/Component/Dialog/Dialog.tsx +2 -2
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +33 -2
- package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +2 -0
- package/src/Component/DropMenu/DropMenu.stories.ts +39 -1
- package/src/Component/DropMenu/DropMenu.stories.tsx +29 -0
- package/src/Component/DropMenu/DropMenu.tsx +1 -1
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +14 -0
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +3 -1
- package/src/Component/Filters/Elements/Filters.ts +71 -1
- package/src/Component/Filters/FilterItem.stories.ts +2 -1
- package/src/Component/Filters/FilterItem.tsx +1 -1
- package/src/Component/Filters/Filters.figma.ts +1 -1
- package/src/Component/Filters/Filters.stories.ts +95 -3
- package/src/Component/Filters/Filters.stories.tsx +246 -17
- package/src/Component/Filters/Filters.tsx +145 -29
- package/src/Component/Filters/README.md +102 -37
- package/src/Component/Filters/__snapshots__/FilterItem.stories.tsx.snap +3 -3
- package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +82 -4
- package/src/Component/Filters/__snapshots__/Filters.stories.tsx.snap +9 -3
- package/src/Component/Filters/filters.css +11 -0
- package/src/Component/Gallery/Gallery.tsx +2 -2
- package/src/Component/HeroBanner/HeroBanner.stories.ts +1 -1
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +4 -8
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +5 -10
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +6 -12
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +50 -0
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +78 -0
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +35 -1
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +2 -0
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +6 -12
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +7 -14
- package/src/Component/ListItem/list-item.css +1 -1
- package/src/Component/Navigation/Dropdown.stories.tsx +46 -0
- package/src/Component/Navigation/Navigation.stories.ts +56 -0
- package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +2 -0
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +57 -0
- package/src/Component/Pagination/Components/PaginationContext.tsx +2 -1
- package/src/Component/Pagination/Components/PaginationItem.tsx +1 -1
- package/src/Component/Pagination/Pagination.stories.ts +36 -0
- package/src/Component/Pagination/Pagination.stories.tsx +31 -0
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +69 -12
- package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +3 -1
- package/src/Component/Pagination/pagination-item.twig +1 -1
- package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +13 -26
- package/src/Component/Popover/popover.css +1 -1
- package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +1 -2
- package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +6 -9
- package/src/Component/Steps/Steps.stories.ts +1 -1
- package/src/Component/Steps/steps.css +13 -0
- package/src/Component/Tabs/Tabs.stories.ts +22 -0
- package/src/Component/Tabs/Tabs.stories.tsx +24 -0
- package/src/Component/Tabs/Tabs.tsx +2 -2
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +18 -0
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +3 -1
- package/src/Component/Tabs/tabs.css +2 -0
- package/src/Form/Autocomplete/Autocomplete.stories.ts +81 -4
- package/src/Form/Autocomplete/Autocomplete.stories.tsx +85 -1
- package/src/Form/Autocomplete/Autocomplete.tsx +19 -6
- package/src/Form/Autocomplete/Elements/Autocomplete.ts +24 -1
- package/src/Form/Autocomplete/__snapshots__/Autocomplete.stories.ts.snap +38 -4
- package/src/Form/Autocomplete/__snapshots__/Autocomplete.stories.tsx.snap +8 -4
- package/src/Form/Autocomplete/autocomplete.css +12 -1
- package/src/Form/Autocomplete/autocomplete.twig +1 -1
- package/src/Form/OneTimeCode/OneTimeCode.stories.ts +20 -0
- package/src/Form/OneTimeCode/OneTimeCode.stories.tsx +18 -0
- package/src/Form/OneTimeCode/OneTimeCode.tsx +56 -0
- package/src/Form/OneTimeCode/README.md +83 -0
- package/src/Form/OneTimeCode/__snapshots__/OneTimeCode.stories.ts.snap +7 -0
- package/src/Form/OneTimeCode/__snapshots__/OneTimeCode.stories.tsx.snap +3 -0
- package/src/Form/OneTimeCode/one-time-code.css +13 -0
- package/src/Form/OneTimeCode/one-time-code.twig +31 -0
- package/src/Form/__snapshots__/Validation.stories.ts.snap +1 -1
- package/src/Form/form.css +90 -32
- package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +18 -33
- package/src/Layout/Header/Header.stories.ts +33 -0
- package/src/Layout/Header/Header.stories.tsx +31 -0
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +50 -0
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -0
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +8 -16
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +2 -4
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +4 -8
- package/src/Utility/Hooks/useIsomorphicLayoutEffect.ts +8 -0
- package/src/Utility/_mixins.css +24 -0
- package/src/Utility/print.css +1 -1
- package/src/Utility/utilities.css +20 -0
- package/src/_custom-media.css +1 -0
- package/src/enums.ts +5 -0
- package/src/react.ts +1 -0
- package/tools/test-utils/screen-reader.ts +33 -0
- package/dist/build/chunks/Gallery-BT3cxS5m.js +0 -1
- package/dist/build/chunks/GlobalToggle-DQHho97V.js +0 -1
- package/dist/build/chunks/Navigation-B9Wug-ok.js +0 -1
- package/dist/build/chunks/disclosure-widget-BETzOHLO.js +0 -1
- package/dist/build/chunks/utilities-C5dAO2YA.js +0 -1
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Default 1`] = `"<div class="mx-carousel" role="region" aria-roledescription="carousel" id="_r_0_"><div class="mx-carousel__buttons" role="group" aria-label="Quick page controls"><button class="mx-button mx-button--icon-only mx-carousel__prev" type="button" disabled=""><span class="sr-only">previous page</span><span class="mx-icon mx-icon--chevron-left" aria-hidden="true"></span></button><button class="mx-button mx-button--icon-only mx-carousel__next" type="button"><span class="sr-only">next page</span><span class="mx-icon mx-icon--chevron-right" aria-hidden="true"></span></button></div><ul class="mx-carousel__scrollable" aria-live="off" tabindex="0"><li data-index="0" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-1">Tile 1</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="1" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-2">Tile 2</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="2" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-3">Tile 3</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="3" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-4">Tile 4</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="4" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-5">Tile 5</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="5" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-6">Tile 6</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li></ul></div>"`;
|
|
4
4
|
|
|
5
|
-
exports[`
|
|
5
|
+
exports[`Screen Reader Announcements 1`] = `"<div class="mx-carousel" role="region" aria-roledescription="carousel" id="_r_s_"><div class="mx-carousel__buttons" role="group" aria-label="Quick page controls"><button class="mx-button mx-button--icon-only mx-carousel__prev" type="button" disabled=""><span class="sr-only">previous page</span><span class="mx-icon mx-icon--chevron-left" aria-hidden="true"></span></button><button class="mx-button mx-button--icon-only mx-carousel__next" type="button"><span class="sr-only">next page</span><span class="mx-icon mx-icon--chevron-right" aria-hidden="true"></span></button></div><ul class="mx-carousel__scrollable" aria-live="off" tabindex="0"><li data-index="0" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-1">Tile 1</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="1" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-2">Tile 2</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="2" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-3">Tile 3</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="3" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-4">Tile 4</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="4" inert="" aria-hidden="true"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-5">Tile 5</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="5" inert="" aria-hidden="true"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-6">Tile 6</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li></ul></div>"`;
|
|
6
6
|
|
|
7
|
-
exports[`With
|
|
7
|
+
exports[`With Counter 1`] = `"<div class="mx-carousel" role="region" aria-roledescription="carousel" id="_r_e_"><div class="mx-carousel__buttons" role="group" aria-label="Quick page controls"><button class="mx-button mx-button--icon-only mx-carousel__prev" type="button" disabled=""><span class="sr-only">previous page</span><span class="mx-icon mx-icon--chevron-left" aria-hidden="true"></span></button><button class="mx-button mx-button--icon-only mx-carousel__next" type="button"><span class="sr-only">next page</span><span class="mx-icon mx-icon--chevron-right" aria-hidden="true"></span></button></div><ul class="mx-carousel__scrollable" aria-live="off" tabindex="0"><li data-index="0" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-1">Tile 1</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="1" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-2">Tile 2</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="2" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-3">Tile 3</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="3" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-4">Tile 4</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="4" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-5">Tile 5</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="5" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-6">Tile 6</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li></ul><div class="mx-carousel__pagination" data-pagination="counter" role="group" aria-label="Page controls"><button type="button" data-index="0" aria-label="Page 1" disabled="" aria-current="page">1</button><button type="button" data-index="1" aria-label="Page 2">2</button></div></div>"`;
|
|
8
8
|
|
|
9
|
-
exports[`With
|
|
9
|
+
exports[`With Loop 1`] = `"<div class="mx-carousel" role="region" aria-roledescription="carousel" id="_r_l_"><div class="mx-carousel__buttons" role="group" aria-label="Quick page controls"><button class="mx-button mx-button--icon-only mx-carousel__prev" type="button" disabled=""><span class="sr-only">previous page</span><span class="mx-icon mx-icon--chevron-left" aria-hidden="true"></span></button><button class="mx-button mx-button--icon-only mx-carousel__next" type="button"><span class="sr-only">next page</span><span class="mx-icon mx-icon--chevron-right" aria-hidden="true"></span></button></div><ul class="mx-carousel__scrollable" aria-live="off" tabindex="0"><li data-index="0" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-1">Tile 1</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="1" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-2">Tile 2</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="2" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-3">Tile 3</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="3" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-4">Tile 4</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="4" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-5">Tile 5</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="5" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-6">Tile 6</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li></ul></div>"`;
|
|
10
|
+
|
|
11
|
+
exports[`With Pagination 1`] = `"<div class="mx-carousel" role="region" aria-roledescription="carousel" id="_r_7_"><div class="mx-carousel__buttons" role="group" aria-label="Quick page controls"><button class="mx-button mx-button--icon-only mx-carousel__prev" type="button" disabled=""><span class="sr-only">previous page</span><span class="mx-icon mx-icon--chevron-left" aria-hidden="true"></span></button><button class="mx-button mx-button--icon-only mx-carousel__next" type="button"><span class="sr-only">next page</span><span class="mx-icon mx-icon--chevron-right" aria-hidden="true"></span></button></div><ul class="mx-carousel__scrollable" aria-live="off" tabindex="0"><li data-index="0" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-1">Tile 1</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="1" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-2">Tile 2</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="2" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-3">Tile 3</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="3" aria-hidden="false"><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-4">Tile 4</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="4" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-5">Tile 5</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li><li data-index="5" aria-hidden="true" inert=""><div class="mx-container"><article class="mx-card mx-card--block mx-background--box"><div class="mx-card__content mx-vertical-flow-flex"><h3 class="" id="tile-6">Tile 6</h3><p class="mx-text--lede">Tiles are just block cards without an image.</p><a href="#" class="mx-link mx-link--more">Find out more</a></div></article></div></li></ul><div class="mx-carousel__pagination" data-pagination="pagination" role="group" aria-label="Page controls"><button type="button" data-index="0" aria-label="Page 1" disabled="" aria-current="page">1</button><button type="button" data-index="1" aria-label="Page 2">2</button></div></div>"`;
|
|
@@ -14,24 +14,21 @@ exports[`Content Block 1`] = `
|
|
|
14
14
|
|
|
15
15
|
<li><a href="#">
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
Music
|
|
19
18
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
20
19
|
|
|
21
20
|
</a>
|
|
22
21
|
</li>
|
|
23
22
|
<li><a href="#">
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Performances
|
|
27
25
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
28
26
|
|
|
29
27
|
</a>
|
|
30
28
|
</li>
|
|
31
29
|
<li><a href="#">
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
Get involved
|
|
35
32
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
36
33
|
|
|
37
34
|
</a>
|
|
@@ -41,8 +38,7 @@ exports[`Content Block 1`] = `
|
|
|
41
38
|
|
|
42
39
|
<a href="#" class="mx-link--more">
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
Find out more
|
|
46
42
|
</a>
|
|
47
43
|
|
|
48
44
|
</div>
|
|
@@ -70,24 +66,21 @@ exports[`With Icon 1`] = `
|
|
|
70
66
|
|
|
71
67
|
<li><a href="#">
|
|
72
68
|
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
Music
|
|
75
70
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
76
71
|
|
|
77
72
|
</a>
|
|
78
73
|
</li>
|
|
79
74
|
<li><a href="#">
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
Performances
|
|
83
77
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
84
78
|
|
|
85
79
|
</a>
|
|
86
80
|
</li>
|
|
87
81
|
<li><a href="#">
|
|
88
82
|
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
Get involved
|
|
91
84
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
92
85
|
|
|
93
86
|
</a>
|
|
@@ -97,8 +90,7 @@ exports[`With Icon 1`] = `
|
|
|
97
90
|
|
|
98
91
|
<a href="#" class="mx-link--more">
|
|
99
92
|
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
Find out more
|
|
102
94
|
</a>
|
|
103
95
|
|
|
104
96
|
</div>
|
|
@@ -127,24 +119,21 @@ exports[`With Image 1`] = `
|
|
|
127
119
|
|
|
128
120
|
<li><a href="#">
|
|
129
121
|
|
|
130
|
-
|
|
131
|
-
|
|
122
|
+
Music
|
|
132
123
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
133
124
|
|
|
134
125
|
</a>
|
|
135
126
|
</li>
|
|
136
127
|
<li><a href="#">
|
|
137
128
|
|
|
138
|
-
|
|
139
|
-
|
|
129
|
+
Performances
|
|
140
130
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
141
131
|
|
|
142
132
|
</a>
|
|
143
133
|
</li>
|
|
144
134
|
<li><a href="#">
|
|
145
135
|
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
Get involved
|
|
148
137
|
<span class="mx-icon mx-icon--chevron-right"></span>
|
|
149
138
|
|
|
150
139
|
</a>
|
|
@@ -154,8 +143,7 @@ exports[`With Image 1`] = `
|
|
|
154
143
|
|
|
155
144
|
<a href="#" class="mx-link--more">
|
|
156
145
|
|
|
157
|
-
|
|
158
|
-
|
|
146
|
+
Find out more
|
|
159
147
|
</a>
|
|
160
148
|
|
|
161
149
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@layer design-system.components {
|
|
12
|
-
/* @public --cookie-consent-background --cookie-consent-foreground --cookie-consent-shadow --cookie-consent-z-index */
|
|
12
|
+
/* @public --cookie-consent-background --cookie-consent-foreground --cookie-consent-shadow --cookie-consent-z-index --cookie-consent-line-width --cookie-consent-line-colour */
|
|
13
13
|
.mx-cookie-consent {
|
|
14
14
|
position: fixed;
|
|
15
15
|
inset-block-end: 0;
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
background-color: var(--cookie-consent-background, var(--colour-background));
|
|
19
19
|
color: var(--cookie-consent-foreground, var(--colour-foreground));
|
|
20
20
|
box-shadow: var(--cookie-consent-shadow, var(--box-shadow));
|
|
21
|
+
border-block-start: var(--cookie-consent-line-width, 1px) solid
|
|
22
|
+
var(--cookie-consent-line-colour, transparent);
|
|
21
23
|
|
|
22
24
|
&[inert] {
|
|
23
25
|
display: none;
|
|
@@ -5,6 +5,7 @@ import Component from "./dialog.twig"
|
|
|
5
5
|
import "./dialog.css"
|
|
6
6
|
import "./Elements/Dialog"
|
|
7
7
|
import { ButtonModifiers, Dialog as DialogType, HeadingTypes } from "@pnx-mixtape/ids-shape"
|
|
8
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
8
9
|
|
|
9
10
|
// Deps.
|
|
10
11
|
import Heading from "../../Atom/Heading/heading.twig"
|
|
@@ -152,6 +153,38 @@ export const Dialog: Story = {
|
|
|
152
153
|
},
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Steps a virtual screen reader through the page with the dialog open, and asserts on what it announces.
|
|
158
|
+
*/
|
|
159
|
+
export const ScreenReaderAnnouncements: Story = {
|
|
160
|
+
play: async ({ canvas, canvasElement, userEvent }) => {
|
|
161
|
+
const trigger = canvas.getByRole("link", { name: "Open dialog" })
|
|
162
|
+
const dialogEl = canvasElement.querySelector("dialog") as HTMLDialogElement
|
|
163
|
+
|
|
164
|
+
await userEvent.click(trigger)
|
|
165
|
+
await expect(dialogEl.open).toBe(true)
|
|
166
|
+
|
|
167
|
+
const log = await runScreenReaderWalkthrough()
|
|
168
|
+
await expect(log).toEqual([
|
|
169
|
+
"document",
|
|
170
|
+
"link, Open dialog, 1 control, expanded",
|
|
171
|
+
"dialog, Dialog heading",
|
|
172
|
+
"dialog, Dialog heading",
|
|
173
|
+
"button, Close dialog",
|
|
174
|
+
"heading, Dialog heading, level 2",
|
|
175
|
+
"paragraph",
|
|
176
|
+
"I'm baby air plant hashtag letterpress blue bottle. Cloud bread dreamcatcher everyday carry lumbersexual, iceland cardigan swag chicharrones lo-fi fanny pack affogato freegan XOXO shaman. Shoreditch cloud bread waistcoat tbh XOXO. Chillwave pour-over umami pug glossier health goth.",
|
|
177
|
+
"end of paragraph",
|
|
178
|
+
"button, Let's go",
|
|
179
|
+
"end of dialog, Dialog heading",
|
|
180
|
+
"end of document",
|
|
181
|
+
])
|
|
182
|
+
|
|
183
|
+
await userEvent.keyboard("{Escape}")
|
|
184
|
+
await expect(dialogEl.open).toBe(false)
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
|
|
155
188
|
/**
|
|
156
189
|
* Modals display in the top layer and cover all other content (with backdrop). See [showModal()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal)
|
|
157
190
|
*/
|
|
@@ -8,6 +8,7 @@ import Text from "../../Atom/Text/Text"
|
|
|
8
8
|
import "./dialog.css"
|
|
9
9
|
import { HeadingTypes } from "@pnx-mixtape/ids-shape"
|
|
10
10
|
import { Page } from "../../../.storybook-react/decorators"
|
|
11
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
11
12
|
|
|
12
13
|
const meta: Meta<typeof Component> = {
|
|
13
14
|
tags: ["autodocs"],
|
|
@@ -63,3 +64,27 @@ export const Dialog: StoryObj<typeof Component> = {
|
|
|
63
64
|
})
|
|
64
65
|
},
|
|
65
66
|
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Steps a virtual screen reader through the page with the dialog open, and asserts on what it announces.
|
|
70
|
+
*/
|
|
71
|
+
export const ScreenReaderAnnouncements: StoryObj<typeof Component> = {
|
|
72
|
+
play: async () => {
|
|
73
|
+
const log = await runScreenReaderWalkthrough()
|
|
74
|
+
await expect(log).toEqual([
|
|
75
|
+
"document",
|
|
76
|
+
"dialog",
|
|
77
|
+
"dialog",
|
|
78
|
+
"heading, Thanks, you're almost done!, level 3",
|
|
79
|
+
"paragraph",
|
|
80
|
+
"To finish the process, you will need to upload a few more documents. Please have your confirmation email ready before starting. Are you ready?",
|
|
81
|
+
"end of paragraph",
|
|
82
|
+
"form",
|
|
83
|
+
"button, Let's get started",
|
|
84
|
+
"end of form",
|
|
85
|
+
"button, Close dialog",
|
|
86
|
+
"end of dialog",
|
|
87
|
+
"end of document",
|
|
88
|
+
])
|
|
89
|
+
},
|
|
90
|
+
}
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
ComponentPropsWithoutRef,
|
|
5
5
|
RefObject,
|
|
6
6
|
useRef,
|
|
7
|
-
useEffect,
|
|
8
7
|
useCallback,
|
|
9
8
|
createContext,
|
|
10
9
|
use,
|
|
11
10
|
useMemo,
|
|
12
11
|
} from "react"
|
|
13
12
|
import classNames from "classnames"
|
|
13
|
+
import useIsomorphicLayoutEffect from "../../Utility/Hooks/useIsomorphicLayoutEffect"
|
|
14
14
|
|
|
15
15
|
type DialogContextValues = {
|
|
16
16
|
handleClose: () => void
|
|
@@ -45,7 +45,7 @@ const Dialog = ({
|
|
|
45
45
|
dialogRef.current?.close()
|
|
46
46
|
}, [dialogRef])
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
useIsomorphicLayoutEffect(() => {
|
|
49
49
|
if (!dialogRef.current) return
|
|
50
50
|
const isModal: boolean = modal || fullscreen
|
|
51
51
|
|
|
@@ -5,8 +5,7 @@ exports[`Dialog 1`] = `
|
|
|
5
5
|
|
|
6
6
|
<a href="#example-dialog" aria-controls="unique-0" aria-expanded="false">
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
Open dialog
|
|
10
9
|
</a>
|
|
11
10
|
|
|
12
11
|
|
|
@@ -98,3 +97,35 @@ exports[`Modal 1`] = `
|
|
|
98
97
|
|
|
99
98
|
"
|
|
100
99
|
`;
|
|
100
|
+
|
|
101
|
+
exports[`Screen Reader Announcements 1`] = `
|
|
102
|
+
"
|
|
103
|
+
|
|
104
|
+
<a href="#example-dialog" aria-controls="unique-0" aria-expanded="false">
|
|
105
|
+
|
|
106
|
+
Open dialog
|
|
107
|
+
</a>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<mx-dialog id="unique-0">
|
|
111
|
+
<dialog class="mx-dialog" aria-labelledby="unique-1">
|
|
112
|
+
<button autofocus="" class="mx-button mx-button--icon-only mx-icon mx-icon--close" data-close="">Close dialog</button>
|
|
113
|
+
<div class="mx-dialog__content mx-vertical-flow">
|
|
114
|
+
<div id="unique-1">
|
|
115
|
+
<h2>Dialog heading</h2>
|
|
116
|
+
</div>
|
|
117
|
+
<p>I'm baby air plant hashtag letterpress blue bottle. Cloud bread dreamcatcher everyday carry lumbersexual, iceland cardigan swag chicharrones lo-fi fanny pack affogato freegan XOXO shaman. Shoreditch cloud bread waistcoat tbh XOXO. Chillwave pour-over umami pug glossier health goth.</p>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<button data-close="data-close" class="mx-button mx-button--dark" type="button">
|
|
121
|
+
|
|
122
|
+
<span>Let's go</span>
|
|
123
|
+
|
|
124
|
+
</button>
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
</dialog>
|
|
128
|
+
</mx-dialog>
|
|
129
|
+
|
|
130
|
+
"
|
|
131
|
+
`;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`Dialog 1`] = `"<dialog class="mx-dialog" open=""><div class="mx-dialog__content mx-vertical-flow"><h3 class="" id="thanks-youre-almost-">Thanks, you're almost done!</h3><p class="">To finish the process, you will need to upload a few more documents. Please have your confirmation email ready before starting. Are you ready?</p><form method="dialog"><div class="mx-form-actions"><button class="mx-button mx-button--primary" type="submit">Let's get started</button></div></form></div><button class="mx-button mx-button--icon-only mx-icon mx-icon--close" type="button">Close dialog</button></dialog>"`;
|
|
4
|
+
|
|
5
|
+
exports[`Screen Reader Announcements 1`] = `"<dialog class="mx-dialog" open=""><div class="mx-dialog__content mx-vertical-flow"><h3 class="" id="thanks-youre-almost-">Thanks, you're almost done!</h3><p class="">To finish the process, you will need to upload a few more documents. Please have your confirmation email ready before starting. Are you ready?</p><form method="dialog"><div class="mx-form-actions"><button class="mx-button mx-button--primary" type="submit">Let's get started</button></div></form></div><button class="mx-button mx-button--icon-only mx-icon mx-icon--close" type="button">Close dialog</button></dialog>"`;
|
|
@@ -3,6 +3,7 @@ import { expect } from "storybook/test"
|
|
|
3
3
|
import Component from "./drop-menu.twig"
|
|
4
4
|
import "./drop-menu.css"
|
|
5
5
|
import "./Elements/DropMenu"
|
|
6
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
6
7
|
|
|
7
8
|
// Deps.
|
|
8
9
|
import "../Popover/popover.css"
|
|
@@ -70,7 +71,7 @@ const meta: Meta<DropMenuType> = {
|
|
|
70
71
|
role: {
|
|
71
72
|
description:
|
|
72
73
|
"An optional ARIA role attribute for the popover, for use when DropMenuItem is a list of buttons.",
|
|
73
|
-
control: "
|
|
74
|
+
control: "radio",
|
|
74
75
|
options: ["menu", "tablist"],
|
|
75
76
|
type: "string",
|
|
76
77
|
},
|
|
@@ -143,3 +144,40 @@ export const Buttons: Story = {
|
|
|
143
144
|
})
|
|
144
145
|
},
|
|
145
146
|
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Steps a virtual screen reader through the page with the menu open, and asserts on what it announces.
|
|
150
|
+
*/
|
|
151
|
+
export const ScreenReaderAnnouncements: Story = {
|
|
152
|
+
args: {
|
|
153
|
+
role: "menu",
|
|
154
|
+
items: [
|
|
155
|
+
{ label: "News", id: "news" },
|
|
156
|
+
{ label: "Events", id: "events" },
|
|
157
|
+
{ label: "Stories", id: "stories" },
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
play: async ({ canvas, canvasElement, userEvent }) => {
|
|
161
|
+
const trigger = canvas.getByRole("button", { name: "Categories" })
|
|
162
|
+
const menu = canvas.getByRole("menu", { hidden: true })
|
|
163
|
+
|
|
164
|
+
await userEvent.click(trigger)
|
|
165
|
+
await expect(menu.matches(":popover-open")).toBe(true)
|
|
166
|
+
|
|
167
|
+
const log = await runScreenReaderWalkthrough()
|
|
168
|
+
await expect(log).toEqual([
|
|
169
|
+
"document",
|
|
170
|
+
"button, Categories",
|
|
171
|
+
"menu, Categories, orientated vertically",
|
|
172
|
+
"menuitemradio, News, not checked, position 1, set size 3",
|
|
173
|
+
"menuitemradio, Events, not checked, position 2, set size 3",
|
|
174
|
+
"menuitemradio, Stories, not checked, position 3, set size 3",
|
|
175
|
+
"end of menu, Categories, orientated vertically",
|
|
176
|
+
"end of document",
|
|
177
|
+
])
|
|
178
|
+
|
|
179
|
+
await userEvent.click(trigger)
|
|
180
|
+
await expect(menu.matches(":popover-open")).toBe(false)
|
|
181
|
+
await userEvent.click(canvasElement)
|
|
182
|
+
},
|
|
183
|
+
}
|
|
@@ -5,6 +5,7 @@ import DropMenuContainer from "./DropMenu"
|
|
|
5
5
|
import DropMenuItem from "./Components/DropMenuItem"
|
|
6
6
|
import "./drop-menu.css"
|
|
7
7
|
import { Page } from "../../../.storybook-react/decorators"
|
|
8
|
+
import { runScreenReaderWalkthrough } from "../../../tools/test-utils/screen-reader"
|
|
8
9
|
|
|
9
10
|
const meta: Meta<typeof Component> = {
|
|
10
11
|
tags: ["autodocs"],
|
|
@@ -72,3 +73,31 @@ export const DropMenu: StoryObj<typeof Component> = {
|
|
|
72
73
|
})
|
|
73
74
|
},
|
|
74
75
|
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Steps a virtual screen reader through the page with the menu open, and asserts on what it announces.
|
|
79
|
+
*/
|
|
80
|
+
export const ScreenReaderAnnouncements: StoryObj<typeof Component> = {
|
|
81
|
+
play: async ({ canvas, userEvent }) => {
|
|
82
|
+
const trigger = canvas.getByRole("button", { name: "Categories" })
|
|
83
|
+
const menu = canvas.getByRole("menu", { hidden: true })
|
|
84
|
+
|
|
85
|
+
await userEvent.click(trigger)
|
|
86
|
+
await expect(menu.matches(":popover-open")).toBe(true)
|
|
87
|
+
|
|
88
|
+
const log = await runScreenReaderWalkthrough()
|
|
89
|
+
await expect(log).toEqual([
|
|
90
|
+
"document",
|
|
91
|
+
"button, Categories",
|
|
92
|
+
"menu, Categories, Results will update when you make a selection. Press escape to close., orientated vertically",
|
|
93
|
+
"menuitemradio, News, not checked, position 1, set size 3",
|
|
94
|
+
"menuitemradio, Events, not checked, position 2, set size 3",
|
|
95
|
+
"menuitemradio, Stories, not checked, position 3, set size 3",
|
|
96
|
+
"end of menu, Categories, Results will update when you make a selection. Press escape to close., orientated vertically",
|
|
97
|
+
"end of document",
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
await userEvent.click(trigger)
|
|
101
|
+
await expect(menu.matches(":popover-open")).toBe(false)
|
|
102
|
+
},
|
|
103
|
+
}
|
|
@@ -27,3 +27,17 @@ exports[`Drop Menu 1`] = `
|
|
|
27
27
|
</mx-dropmenu>
|
|
28
28
|
"
|
|
29
29
|
`;
|
|
30
|
+
|
|
31
|
+
exports[`Screen Reader Announcements 1`] = `
|
|
32
|
+
"<mx-dropmenu closeonclick="">
|
|
33
|
+
<button id="unique-0" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="dropdown-menu" style="anchor-name: --dropdown-menu">
|
|
34
|
+
Categories
|
|
35
|
+
</button>
|
|
36
|
+
<div class="mx-popover mx-drop-menu" id="dropdown-menu" aria-describedby="unique-0" style="position-anchor: --dropdown-menu" data-placement="bottom-start" popover="" role="menu">
|
|
37
|
+
<button type="button" data-id="news" role="menuitemradio" aria-checked="false">News</button>
|
|
38
|
+
<button type="button" data-id="events" role="menuitemradio" aria-checked="false">Events</button>
|
|
39
|
+
<button type="button" data-id="stories" role="menuitemradio" aria-checked="false">Stories</button>
|
|
40
|
+
</div>
|
|
41
|
+
</mx-dropmenu>
|
|
42
|
+
"
|
|
43
|
+
`;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`Drop Menu 1`] = `"<button id="drop-menu-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="drop-menu-storybook" style="anchor-name: --drop-menu-drop-menu-storybook;">Categories</button><div id="drop-menu-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="drop-menu-storybook-target" aria-describedby="drop-menu-storybook-description" role="menu" style="position-anchor: --drop-menu-drop-menu-storybook;"><div id="drop-menu-storybook-description" class="sr-only">Results will update when you make a selection. Press escape to close.</div><span data-focus-scope-start="true" hidden=""></span><button type="button" data-id="news" aria-checked="false" role="menuitemradio">News</button><button type="button" data-id="events" aria-checked="false" role="menuitemradio">Events</button><button type="button" data-id="stories" aria-checked="false" role="menuitemradio">Stories</button><span data-focus-scope-end="true" hidden=""></span></div>"`;
|
|
3
|
+
exports[`Drop Menu 1`] = `"<button id="drop-menu-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="drop-menu-storybook" style="anchor-name: --drop-menu-drop-menu-storybook;">Categories</button><div id="drop-menu-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="drop-menu-storybook-target" aria-describedby="drop-menu-storybook-description" role="menu" style="position-anchor: --drop-menu-drop-menu-storybook;"><div id="drop-menu-storybook-description" class="sr-only" aria-hidden="true">Results will update when you make a selection. Press escape to close.</div><span data-focus-scope-start="true" hidden=""></span><button type="button" data-id="news" aria-checked="false" role="menuitemradio">News</button><button type="button" data-id="events" aria-checked="false" role="menuitemradio">Events</button><button type="button" data-id="stories" aria-checked="false" role="menuitemradio">Stories</button><span data-focus-scope-end="true" hidden=""></span></div>"`;
|
|
4
|
+
|
|
5
|
+
exports[`Screen Reader Announcements 1`] = `"<button id="drop-menu-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="drop-menu-storybook" style="anchor-name: --drop-menu-drop-menu-storybook;">Categories</button><div id="drop-menu-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="drop-menu-storybook-target" aria-describedby="drop-menu-storybook-description" role="menu" style="position-anchor: --drop-menu-drop-menu-storybook;"><div id="drop-menu-storybook-description" class="sr-only" aria-hidden="true">Results will update when you make a selection. Press escape to close.</div><span data-focus-scope-start="true" hidden=""></span><button type="button" data-id="news" aria-checked="false" role="menuitemradio">News</button><button type="button" data-id="events" aria-checked="false" role="menuitemradio">Events</button><button type="button" data-id="stories" aria-checked="false" role="menuitemradio">Stories</button><span data-focus-scope-end="true" hidden=""></span></div>"`;
|