@pnx-mixtape/mxds 0.1.0-rc.4 → 0.1.0-rc.5

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.
Files changed (199) hide show
  1. package/.claude/skills/create-mxds-component/SKILL.md +77 -0
  2. package/DESIGN.md +595 -0
  3. package/README.md +1 -2
  4. package/dist/build/accordion.entry.js +2 -1
  5. package/dist/build/autocomplete.entry.js +1 -1
  6. package/dist/build/back-to-top.css +1 -0
  7. package/dist/build/back-to-top.entry.js +1 -0
  8. package/dist/build/button.css +1 -1
  9. package/dist/build/card.css +1 -1
  10. package/dist/build/chunks/Accordion-D2wp8hBG.js +44 -0
  11. package/dist/build/chunks/AccordionGroup-BYtoAFxg.js +47 -0
  12. package/dist/build/chunks/AccordionMobile-D3sTeiM5.js +26 -0
  13. package/dist/build/chunks/Autocomplete-kRo8RNbC.js +135 -0
  14. package/dist/build/chunks/BackToTop-4M-Wl7z3.js +64 -0
  15. package/dist/build/chunks/ClosableAlert-yy84gae6.js +55 -0
  16. package/dist/build/chunks/CookieConsent-wd8gQ2Oe.js +18 -0
  17. package/dist/build/chunks/Dialog-DWoXW-7Z.js +48 -0
  18. package/dist/build/chunks/DropMenu-CSTZq0Zt.js +68 -0
  19. package/dist/build/chunks/FeedbackForm-BochXEDx.js +64 -0
  20. package/dist/build/chunks/Gallery-Rkfv7Mbb.js +165 -0
  21. package/dist/build/chunks/GlobalToggle-CzlkpLpc.js +82 -0
  22. package/dist/build/chunks/InPageNavigation-D1Kk-rCm.js +86 -0
  23. package/dist/build/chunks/Navigation-CDQnN61h.js +147 -0
  24. package/dist/build/chunks/Popover-CiTAftNU.js +30 -0
  25. package/dist/build/chunks/Sticky-DoVndENm.js +51 -0
  26. package/dist/build/chunks/Tabs-BDlxCDNh.js +160 -0
  27. package/dist/build/chunks/Translate-bmM38j6z.js +46 -0
  28. package/dist/build/chunks/cookie-compliance-CG6x-TcV.js +119 -0
  29. package/dist/build/chunks/enums-BrHxPZZ_.js +36 -0
  30. package/dist/build/chunks/polyfills-D-qh1a_2.js +33 -0
  31. package/dist/build/chunks/utilities-Dd-08SW6.js +255 -0
  32. package/dist/build/content-block.css +1 -1
  33. package/dist/build/cookie-consent.entry.js +1 -1
  34. package/dist/build/dialog.entry.js +1 -1
  35. package/dist/build/drop-menu.entry.js +1 -1
  36. package/dist/build/elements.js +147 -1
  37. package/dist/build/feedback-form.css +1 -0
  38. package/dist/build/feedback-form.entry.js +1 -0
  39. package/dist/build/filters.entry.js +145 -1
  40. package/dist/build/gallery.entry.js +1 -1
  41. package/dist/build/global-alert.entry.js +1 -1
  42. package/dist/build/header.css +1 -1
  43. package/dist/build/header.entry.js +1 -1
  44. package/dist/build/icon.css +1 -1
  45. package/dist/build/in-page-navigation.entry.js +1 -1
  46. package/dist/build/navigation.entry.js +1 -1
  47. package/dist/build/pagination.css +1 -1
  48. package/dist/build/popover.entry.js +1 -1
  49. package/dist/build/react.js +2270 -1
  50. package/dist/build/sticky.entry.js +1 -1
  51. package/dist/build/tabs.entry.js +1 -1
  52. package/dist/build/translate.css +1 -0
  53. package/dist/build/translate.entry.js +1 -0
  54. package/dist/build/utility-list.entry.js +53 -1
  55. package/dist/types/Component/BackToTop/BackToTop.d.ts +20 -0
  56. package/dist/types/Component/BackToTop/BackToTop.d.ts.map +1 -0
  57. package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts +27 -0
  58. package/dist/types/Component/BackToTop/Elements/BackToTop.d.ts.map +1 -0
  59. package/dist/types/Component/BackToTop/back-to-top.entry.d.ts +2 -0
  60. package/dist/types/Component/BackToTop/back-to-top.entry.d.ts.map +1 -0
  61. package/dist/types/Component/DropMenu/DropMenu.d.ts +2 -1
  62. package/dist/types/Component/DropMenu/DropMenu.d.ts.map +1 -1
  63. package/dist/types/Component/Tabs/Components/TabDropMenu.d.ts.map +1 -1
  64. package/dist/types/Component/Tabs/Elements/Tabs.d.ts.map +1 -1
  65. package/dist/types/Component/Translate/Elements/Translate.d.ts +23 -0
  66. package/dist/types/Component/Translate/Elements/Translate.d.ts.map +1 -0
  67. package/dist/types/Component/Translate/Translate.d.ts +37 -0
  68. package/dist/types/Component/Translate/Translate.d.ts.map +1 -0
  69. package/dist/types/Component/Translate/languages.d.ts +11 -0
  70. package/dist/types/Component/Translate/languages.d.ts.map +1 -0
  71. package/dist/types/Component/Translate/translate.entry.d.ts +2 -0
  72. package/dist/types/Component/Translate/translate.entry.d.ts.map +1 -0
  73. package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts +37 -0
  74. package/dist/types/Form/FeedbackForm/Elements/FeedbackForm.d.ts.map +1 -0
  75. package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts +36 -0
  76. package/dist/types/Form/FeedbackForm/FeedbackForm.d.ts.map +1 -0
  77. package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts +2 -0
  78. package/dist/types/Form/FeedbackForm/feedback-form.entry.d.ts.map +1 -0
  79. package/dist/types/Utility/Elements/google-translate-widget.d.ts +91 -0
  80. package/dist/types/Utility/Elements/google-translate-widget.d.ts.map +1 -0
  81. package/dist/types/Utility/utilities.d.ts +2 -0
  82. package/dist/types/Utility/utilities.d.ts.map +1 -1
  83. package/dist/types/elements.d.ts +3 -0
  84. package/dist/types/elements.d.ts.map +1 -1
  85. package/dist/types/enums.d.ts +3 -1
  86. package/dist/types/enums.d.ts.map +1 -1
  87. package/dist/types/react.d.ts +3 -0
  88. package/dist/types/react.d.ts.map +1 -1
  89. package/docs/API.md +1215 -0
  90. package/docs/CSSGuidelines.md +891 -0
  91. package/docs/CodeQuality.md +940 -0
  92. package/docs/ComponentArchitecture.md +714 -0
  93. package/docs/Contributing.md +626 -0
  94. package/docs/MemoryManagement.md +598 -0
  95. package/docs/Migrations.md +6 -0
  96. package/docs/README.md +100 -0
  97. package/docs/Security.md +444 -0
  98. package/docs/Testing.md +739 -0
  99. package/docs/Troubleshooting.md +674 -0
  100. package/package.json +6 -3
  101. package/src/Atom/Button/Button.tsx +1 -1
  102. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +2 -2
  103. package/src/Atom/Button/_buttons.css +1 -0
  104. package/src/Atom/Icon/README.md +1 -1
  105. package/src/Atom/Icon/_icon.css +1 -0
  106. package/src/Atom/Icon/images/thumb.svg +1 -0
  107. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +4 -9
  108. package/src/Atom/Media/media.twig +4 -5
  109. package/src/Component/BackToTop/BackToTop.stories.ts +127 -0
  110. package/src/Component/BackToTop/BackToTop.stories.tsx +53 -0
  111. package/src/Component/BackToTop/BackToTop.tsx +120 -0
  112. package/src/Component/BackToTop/Elements/BackToTop.ts +119 -0
  113. package/src/Component/BackToTop/README.md +164 -0
  114. package/src/Component/BackToTop/__snapshots__/BackToTop.stories.ts.snap +24 -0
  115. package/src/Component/BackToTop/__snapshots__/BackToTop.stories.tsx.snap +3 -0
  116. package/src/Component/BackToTop/back-to-top.css +70 -0
  117. package/src/Component/BackToTop/back-to-top.entry.js +1 -0
  118. package/src/Component/BackToTop/back-to-top.twig +26 -0
  119. package/src/Component/Card/Components/CardContent.tsx +1 -1
  120. package/src/Component/Card/Components/CardMedia.tsx +1 -1
  121. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +3 -3
  122. package/src/Component/Card/card.css +1 -1
  123. package/src/Component/Carousel/Carousel.stories.ts +66 -36
  124. package/src/Component/Carousel/__snapshots__/Carousel.stories.tsx.snap +5 -5
  125. package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -1
  126. package/src/Component/ContentBlock/content-block.css +1 -1
  127. package/src/Component/DropMenu/DropMenu.stories.ts +21 -2
  128. package/src/Component/DropMenu/DropMenu.tsx +14 -4
  129. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +3 -3
  130. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +2 -2
  131. package/src/Component/DropMenu/drop-menu.twig +7 -1
  132. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
  133. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +48 -13
  134. package/src/Component/InPageNavigation/in-page-navigation.twig +4 -6
  135. package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -1
  136. package/src/Component/Pagination/Pagination.stories.ts +57 -27
  137. package/src/Component/Pagination/pagination.css +16 -7
  138. package/src/Component/Popover/__snapshots__/Popover.stories.tsx.snap +3 -3
  139. package/src/Component/Tabs/Components/TabDropMenu.tsx +7 -1
  140. package/src/Component/Tabs/Elements/Tabs.ts +13 -3
  141. package/src/Component/Tabs/Tabs.stories.ts +33 -12
  142. package/src/Component/Tabs/Tabs.stories.tsx +28 -14
  143. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +3 -3
  144. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -2
  145. package/src/Component/Translate/Elements/Translate.ts +76 -0
  146. package/src/Component/Translate/README.md +283 -0
  147. package/src/Component/Translate/Translate.stories.ts +87 -0
  148. package/src/Component/Translate/Translate.stories.tsx +77 -0
  149. package/src/Component/Translate/Translate.tsx +213 -0
  150. package/src/Component/Translate/__snapshots__/Translate.stories.ts.snap +18 -0
  151. package/src/Component/Translate/__snapshots__/Translate.stories.tsx.snap +3 -0
  152. package/src/Component/Translate/languages.ts +39 -0
  153. package/src/Component/Translate/translate.css +62 -0
  154. package/src/Component/Translate/translate.entry.js +1 -0
  155. package/src/Component/Translate/translate.twig +44 -0
  156. package/src/Form/Autocomplete/Autocomplete.stories.tsx +2 -1
  157. package/src/Form/FeedbackForm/Elements/FeedbackForm.ts +122 -0
  158. package/src/Form/FeedbackForm/FeedbackForm.stories.ts +99 -0
  159. package/src/Form/FeedbackForm/FeedbackForm.stories.tsx +73 -0
  160. package/src/Form/FeedbackForm/FeedbackForm.tsx +196 -0
  161. package/src/Form/FeedbackForm/README.md +233 -0
  162. package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.ts.snap +125 -0
  163. package/src/Form/FeedbackForm/__snapshots__/FeedbackForm.stories.tsx.snap +5 -0
  164. package/src/Form/FeedbackForm/feedback-form.css +74 -0
  165. package/src/Form/FeedbackForm/feedback-form.entry.js +1 -0
  166. package/src/Form/FeedbackForm/feedback-form.twig +80 -0
  167. package/src/Layout/Header/Components/GlobalToggle.tsx +1 -1
  168. package/src/Layout/Header/Header.stories.ts +53 -48
  169. package/src/Layout/Header/Header.stories.tsx +35 -22
  170. package/src/Layout/Header/Header.tsx +2 -2
  171. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +14 -10
  172. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -2
  173. package/src/Layout/Header/_toggles.css +7 -7
  174. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +1 -1
  175. package/src/Utility/Elements/google-translate-widget.ts +293 -0
  176. package/src/Utility/global.d.ts +4 -0
  177. package/src/Utility/utilities.ts +2 -0
  178. package/src/elements.ts +3 -0
  179. package/src/enums.ts +2 -0
  180. package/src/react.ts +3 -0
  181. package/dist/build/chunks/Accordion-GN0sME4W.js +0 -1
  182. package/dist/build/chunks/AccordionGroup-Bzqp5__q.js +0 -1
  183. package/dist/build/chunks/AccordionMobile-DG5jSe8Q.js +0 -1
  184. package/dist/build/chunks/Autocomplete-B4RtkAyh.js +0 -1
  185. package/dist/build/chunks/ClosableAlert-DEhj8Nxm.js +0 -1
  186. package/dist/build/chunks/CookieConsent-BkCMRVST.js +0 -1
  187. package/dist/build/chunks/Dialog-Haahn-Yn.js +0 -1
  188. package/dist/build/chunks/DropMenu-1baQc8Yc.js +0 -1
  189. package/dist/build/chunks/Gallery-D8NGXy2Q.js +0 -1
  190. package/dist/build/chunks/GlobalToggle-B52fdBQu.js +0 -1
  191. package/dist/build/chunks/InPageNavigation-Dyn2TR-N.js +0 -1
  192. package/dist/build/chunks/Navigation-hOrfLq7h.js +0 -1
  193. package/dist/build/chunks/Popover-Cxg-s5Jn.js +0 -1
  194. package/dist/build/chunks/Sticky-BGCuuEJK.js +0 -1
  195. package/dist/build/chunks/Tabs-DYy1YTdU.js +0 -15
  196. package/dist/build/chunks/cookie-compliance-Bbm-0vpj.js +0 -1
  197. package/dist/build/chunks/enums-DLV_1NAf.js +0 -1
  198. package/dist/build/chunks/polyfills-C7pRt54M.js +0 -1
  199. package/dist/build/chunks/utilities-_Bq3TxAQ.js +0 -1
@@ -2,6 +2,6 @@
2
2
 
3
3
  exports[`Hero Banner 1`] = `"<div class="mx-page mx-hero-banner"><div class="mx-hero-banner__inner"><div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl"><h1 class="" id="always-put-your-best">Always put your best foot forward.</h1><p class="mx-text--lede">Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.</p></div></div></div>"`;
4
4
 
5
- exports[`Highlight 1`] = `"<div class="mx-page mx-hero-banner mx-background--primary mx-hero-banner--hero"><div class="mx-hero-banner__inner"><div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl"><h1 class="mx-headline" id="always-put-your-best">Always put your best foot forward.</h1><p class="mx-text--lede">Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.</p><button class="mx-button mx-button--dark" type="button">Button</button></div><div class="mx-hero-banner__aside mx-section--xl"><img alt="Blurry bubbles" src="https://picsum.photos/id/56/558/418?grayscale"></div></div></div>"`;
5
+ exports[`Highlight 1`] = `"<div class="mx-page mx-hero-banner mx-background--primary mx-hero-banner--hero"><div class="mx-hero-banner__inner"><div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl"><h1 class="mx-headline" id="always-put-your-best">Always put your best foot forward.</h1><p class="mx-text--lede">Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.</p><button class="mx-button mx-button--dark" type="button"><span>Button</span></button></div><div class="mx-hero-banner__aside mx-section--xl"><img alt="Blurry bubbles" src="https://picsum.photos/id/56/558/418?grayscale"></div></div></div>"`;
6
6
 
7
7
  exports[`With Link List 1`] = `"<div class="mx-page mx-hero-banner"><div class="mx-hero-banner__inner"><div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl"><h1 class="" id="always-put-your-best">Always put your best foot forward.</h1><p class="mx-text--lede">Make the most of the opportunity by encouraging an action and keeping your copy clear and concise.</p></div><div class="mx-hero-banner__aside mx-section--xl"><h2 class="mx-heading--m" id="popular-links">Popular links</h2><ul class="mx-link-list"><li><a href="#1" class="mx-link">Page link #1<span class="mx-icon mx-icon--chevron-right"></span></a></li><li><a href="#2" class="mx-link">Page link #2<span class="mx-icon mx-icon--chevron-right"></span></a></li><li><a href="#3" class="mx-link">Page link #3<span class="mx-icon mx-icon--chevron-right"></span></a></li></ul></div></div></div>"`;
@@ -2,7 +2,8 @@
2
2
 
3
3
  exports[`Generated Items 1`] = `
4
4
  "<mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
5
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
5
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav>
6
+ </mx-in-page-navigation>
6
7
  <div class="js-content mx-rich-text mx-vertical-flow">
7
8
  <h2 id="section-1">Section 1</h2>
8
9
  <p>In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
@@ -18,7 +19,8 @@ exports[`Generated Items 1`] = `
18
19
 
19
20
  exports[`Identical Headings 1`] = `
20
21
  "<mx-in-page-navigation data-content=".js-content" data-levels="h2,h3" data-title="On this page">
21
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#test-level-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Test level 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#identical-heading"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical heading</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#identical-subheading"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical subheading</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#identical-heading-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical heading</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#identical-subheading-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical subheading</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#identical-heading-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical heading</span></a></li></ul></nav></mx-in-page-navigation>
22
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#test-level-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Test level 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#identical-heading"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical heading</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#identical-subheading"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical subheading</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#identical-heading-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical heading</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#identical-subheading-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical subheading</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#identical-heading-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Identical heading</span></a></li></ul></nav>
23
+ </mx-in-page-navigation>
22
24
  <div class="js-content mx-rich-text mx-vertical-flow">
23
25
  <h2 id="section-1">Section 1</h2>
24
26
  <p>In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
@@ -44,16 +46,31 @@ exports[`Identical Headings 1`] = `
44
46
 
45
47
  exports[`In Page Navigation 1`] = `
46
48
  "<mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
47
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span>
49
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow">
50
+ <h2 class="is-excluded mx-heading--m">On this page</h2>
51
+ <ul>
52
+ <li><a href="#section-1">
53
+
54
+ <span class="mx-icon mx-icon--chevron-right"></span>
48
55
 
49
56
  Section 1
50
- </a></li><li><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span>
57
+ </a>
58
+ </li>
59
+ <li><a href="#section-2">
60
+
61
+ <span class="mx-icon mx-icon--chevron-right"></span>
51
62
 
52
63
  Section 2
53
- </a></li><li><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span>
64
+ </a>
65
+ </li>
66
+ <li><a href="#section-3">
67
+
68
+ <span class="mx-icon mx-icon--chevron-right"></span>
54
69
 
55
70
  Section 3
56
- </a></li></ul></nav></mx-in-page-navigation>
71
+ </a>
72
+ </li></ul></nav>
73
+ </mx-in-page-navigation>
57
74
  <div class="js-content mx-rich-text mx-vertical-flow">
58
75
  <h2 id="section-1">Section 1</h2>
59
76
  <p>In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
@@ -69,7 +86,8 @@ exports[`In Page Navigation 1`] = `
69
86
 
70
87
  exports[`Nested 1`] = `
71
88
  "<mx-in-page-navigation data-content=".js-content" data-levels="h2,h3" data-title="On this page">
72
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#test-level-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Test level 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
89
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h3"><a href="#test-level-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Test level 3</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav>
90
+ </mx-in-page-navigation>
73
91
  <div class="js-content mx-rich-text mx-vertical-flow">
74
92
  <h2 id="section-1">Section 1</h2>
75
93
  <p>In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
@@ -85,7 +103,8 @@ exports[`Nested 1`] = `
85
103
 
86
104
  exports[`No Headings 1`] = `
87
105
  "<mx-in-page-navigation data-content=".js-content" data-levels="h4" data-title="On this page">
88
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"></nav></mx-in-page-navigation>
106
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"></nav>
107
+ </mx-in-page-navigation>
89
108
  <div class="js-content mx-rich-text mx-vertical-flow">
90
109
  <h2 id="section-1">Section 1</h2>
91
110
  <p>In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
@@ -102,7 +121,8 @@ exports[`No Headings 1`] = `
102
121
  exports[`Other Container 1`] = `
103
122
  "<div class="mx-background--box mx-section--m mx-margin--bottom-m">
104
123
  <mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
105
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav></mx-in-page-navigation>
124
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li class="mx-in-page-navigation__level--h2"><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 1</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 2</span></a></li><li class="mx-in-page-navigation__level--h2"><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span><span>Section 3</span></a></li></ul></nav>
125
+ </mx-in-page-navigation>
106
126
  </div>
107
127
  <div class="js-content mx-rich-text mx-vertical-flow">
108
128
  <h2 id="section-1">Section 1</h2>
@@ -119,16 +139,31 @@ exports[`Other Container 1`] = `
119
139
 
120
140
  exports[`Screen Reader Announcements 1`] = `
121
141
  "<mx-in-page-navigation data-content=".js-content" data-levels="" data-title="On this page">
122
- <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow"><h2 class="is-excluded mx-heading--m">On this page</h2><ul><li><a href="#section-1"><span class="mx-icon mx-icon--chevron-right"></span>
142
+ <nav class="mx-nav mx-nav--list mx-in-page-navigation mx-vertical-flow">
143
+ <h2 class="is-excluded mx-heading--m">On this page</h2>
144
+ <ul>
145
+ <li><a href="#section-1">
146
+
147
+ <span class="mx-icon mx-icon--chevron-right"></span>
123
148
 
124
149
  Section 1
125
- </a></li><li><a href="#section-2"><span class="mx-icon mx-icon--chevron-right"></span>
150
+ </a>
151
+ </li>
152
+ <li><a href="#section-2">
153
+
154
+ <span class="mx-icon mx-icon--chevron-right"></span>
126
155
 
127
156
  Section 2
128
- </a></li><li><a href="#section-3"><span class="mx-icon mx-icon--chevron-right"></span>
157
+ </a>
158
+ </li>
159
+ <li><a href="#section-3">
160
+
161
+ <span class="mx-icon mx-icon--chevron-right"></span>
129
162
 
130
163
  Section 3
131
- </a></li></ul></nav></mx-in-page-navigation>
164
+ </a>
165
+ </li></ul></nav>
166
+ </mx-in-page-navigation>
132
167
  <div class="js-content mx-rich-text mx-vertical-flow">
133
168
  <h2 id="section-1">Section 1</h2>
134
169
  <p>In publishing and graphic design, lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document without relying on meaningful content. Replacing the actual content with placeholder text allows designers to design the form of the content before the content itself has been produced.</p>
@@ -6,14 +6,12 @@
6
6
  ] %}
7
7
  {% set attributes = (attributes ?? create_attribute()).addClass(classes) %}
8
8
  <mx-in-page-navigation data-content="{{ contentSelector|default('.js-content') }}" data-levels="{{ levels|join(",") }}" data-title="{{ title|striptags|trim }}">
9
- {% apply spaceless %}
10
9
  <nav{{ attributes }}>
11
- {% if items %}
12
- {{ title }}
10
+ {%- if items -%}
11
+ {{- title -}}
13
12
  <ul>
14
- {{ items }}
13
+ {{- items -}}
15
14
  </ul>
16
- {% endif %}
15
+ {%- endif -%}
17
16
  </nav>
18
- {% endapply %}
19
17
  </mx-in-page-navigation>
@@ -8,7 +8,7 @@ type CardProps = PropsWithChildren & {
8
8
  const ListItemMedia = ({ children, skeleton = false }: CardProps): JSX.Element => {
9
9
  return (
10
10
  <figure className={classNames("mx-list-item__media", "stack")}>
11
- {skeleton && <div className="mx-skeleton mx-skeleton--bg"></div>}
11
+ {skeleton && <div className="skeleton skeleton--bg"></div>}
12
12
  {children}
13
13
  </figure>
14
14
  )
@@ -136,35 +136,65 @@ export const Pagination: Story = {
136
136
 
137
137
  /**
138
138
  * Steps a virtual screen reader through the page and asserts on what it announces.
139
+ *
140
+ * Pagination's narrow/wide layouts are driven by a CSS container query (not
141
+ * `matchMedia`) that swaps the numbered link list for a "Page X of Y" label -
142
+ * see `pagination.css`. Chromatic exercises both `chromatic.modes` (mobile and
143
+ * desktop), so this branches on the container's own rendered state (which of
144
+ * the two is actually visible) rather than hardcoding one shape. Whichever
145
+ * mode a local run happens to render at, only one branch runs meaningfully for
146
+ * that run - the other is exercised by Chromatic's other mode in CI. See
147
+ * "Testing Mobile / matchMedia-Driven Behavior in Play Functions" in
148
+ * docs/Testing.md.
139
149
  */
140
150
  export const ScreenReaderAnnouncements: Story = {
141
- play: async () => {
151
+ play: async ({ canvasElement }) => {
152
+ const label = canvasElement.querySelector(".mx-pagination__label")
153
+ const isNarrow = label !== null && getComputedStyle(label).display !== "none"
142
154
  const log = await runScreenReaderWalkthrough()
143
- await expect(log).toEqual([
144
- "document",
145
- "navigation, Pagination",
146
- "link, Previous",
147
- "Previous",
148
- "end of link, Previous",
149
- "list",
150
- "listitem, level 1, position 1, set size 4",
151
- "link, 1",
152
- "end of listitem, level 1, position 1, set size 4",
153
- "listitem, level 1, position 2, set size 4",
154
- "link, 2, current page",
155
- "end of listitem, level 1, position 2, set size 4",
156
- "listitem, level 1, position 3, set size 4",
157
- "link, 3",
158
- "end of listitem, level 1, position 3, set size 4",
159
- "listitem, level 1, position 4, set size 4",
160
- "link, 10",
161
- "end of listitem, level 1, position 4, set size 4",
162
- "end of list",
163
- "link, Next",
164
- "Next",
165
- "end of link, Next",
166
- "end of navigation, Pagination",
167
- "end of document",
168
- ])
155
+
156
+ if (isNarrow) {
157
+ await expect(log).toEqual([
158
+ "document",
159
+ "navigation, Pagination",
160
+ "link, Previous",
161
+ "Previous",
162
+ "end of link, Previous",
163
+ "Page 2 of 10",
164
+ "list",
165
+ "link, Next",
166
+ "Next",
167
+ "end of link, Next",
168
+ "end of navigation, Pagination",
169
+ "end of document",
170
+ ])
171
+ } else {
172
+ await expect(log).toEqual([
173
+ "document",
174
+ "navigation, Pagination",
175
+ "link, Previous",
176
+ "Previous",
177
+ "end of link, Previous",
178
+ "list",
179
+ "listitem, level 1, position 1, set size 4",
180
+ "link, 1",
181
+ "end of listitem, level 1, position 1, set size 4",
182
+ "listitem, level 1, position 2, set size 4",
183
+ "link, 2, current page",
184
+ "end of listitem, level 1, position 2, set size 4",
185
+ "listitem, level 1, position 3, set size 4",
186
+ "link, 3",
187
+ "end of listitem, level 1, position 3, set size 4",
188
+ "listitem, level 1, position 4, set size 4",
189
+ "link, 10",
190
+ "end of listitem, level 1, position 4, set size 4",
191
+ "end of list",
192
+ "link, Next",
193
+ "Next",
194
+ "end of link, Next",
195
+ "end of navigation, Pagination",
196
+ "end of document",
197
+ ])
198
+ }
169
199
  },
170
200
  }
@@ -2,8 +2,6 @@
2
2
  * Pagination
3
3
  */
4
4
 
5
- @import "../../Utility/_mixins.css";
6
-
7
5
  @layer design-system.components {
8
6
  .mx-pagination {
9
7
  margin-inline: 0;
@@ -102,11 +100,22 @@
102
100
  & :is(.mx-pagination__previous, .mx-pagination__next) {
103
101
  text-transform: capitalize;
104
102
 
105
- & span:where(:not(.mx-icon)) {
106
- @add-mixin sr-only;
107
-
108
- @container pagination (min-width: 25ch) {
109
- @add-mixin sr-undo;
103
+ & :is(a, button) {
104
+ @container pagination (max-width: 32ch) {
105
+ inline-size: var(--button-min-height, var(--spacing-xl));
106
+ block-size: var(--button-min-height, var(--spacing-xl));
107
+ flex-wrap: wrap;
108
+ position: relative;
109
+ padding: 0;
110
+ overflow: hidden;
111
+
112
+ & .mx-icon {
113
+ inline-size: var(--button-min-height, var(--spacing-xl));
114
+ block-size: var(--button-min-height, var(--spacing-xl));
115
+ place-content: center;
116
+ display: flex;
117
+ order: -1;
118
+ }
110
119
  }
111
120
  }
112
121
  }
@@ -1,7 +1,7 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`Content Only 1`] = `"<button class="mx-button mx-icon--end" type="button" id="story-popover-minimal-trigger" popovertarget="story-popover-minimal" style="anchor-name: --story-popover-minimal;">Popover trigger<span class="mx-icon mx-icon--question"></span></button><div class="mx-popover" id="story-popover-minimal" aria-describedby="story-popover-minimal-trigger" data-placement="bottom" popover="" style="position-anchor: --story-popover-minimal;"><div class="mx-rich-text mx-vertical-flow"><p>A simple hint with no heading or action link.</p></div></div>"`;
3
+ exports[`Content Only 1`] = `"<button class="mx-button mx-icon--end" type="button" id="story-popover-minimal-trigger" popovertarget="story-popover-minimal" style="anchor-name: --story-popover-minimal;"><span>Popover trigger</span><span class="mx-icon mx-icon--question"></span></button><div class="mx-popover" id="story-popover-minimal" aria-describedby="story-popover-minimal-trigger" data-placement="bottom" popover="" style="position-anchor: --story-popover-minimal;"><div class="mx-rich-text mx-vertical-flow"><p>A simple hint with no heading or action link.</p></div></div>"`;
4
4
 
5
- exports[`Default 1`] = `"<button class="mx-button mx-icon--end" type="button" id="story-popover-trigger" popovertarget="story-popover" style="anchor-name: --story-popover;">Popover trigger<span class="mx-icon mx-icon--question"></span></button><div class="mx-popover" id="story-popover" aria-describedby="story-popover-trigger" data-placement="bottom" popover="" style="position-anchor: --story-popover;"><div class="mx-rich-text mx-vertical-flow"><h2>Popover heading</h2><p>Short supplementary content. Use Popover for non-interactive hints; for menus use DropMenu, for modal content use Dialog.</p><a href="#" class="mx-link mx-link--more">Learn more</a></div></div>"`;
5
+ exports[`Default 1`] = `"<button class="mx-button mx-icon--end" type="button" id="story-popover-trigger" popovertarget="story-popover" style="anchor-name: --story-popover;"><span>Popover trigger</span><span class="mx-icon mx-icon--question"></span></button><div class="mx-popover" id="story-popover" aria-describedby="story-popover-trigger" data-placement="bottom" popover="" style="position-anchor: --story-popover;"><div class="mx-rich-text mx-vertical-flow"><h2>Popover heading</h2><p>Short supplementary content. Use Popover for non-interactive hints; for menus use DropMenu, for modal content use Dialog.</p><a href="#" class="mx-link mx-link--more">Learn more</a></div></div>"`;
6
6
 
7
- exports[`Placement 1`] = `"<button class="mx-button mx-icon--end" type="button" id="story-popover-placement-trigger" popovertarget="story-popover-placement" style="anchor-name: --story-popover-placement;">Popover trigger<span class="mx-icon mx-icon--question"></span></button><div class="mx-popover" id="story-popover-placement" aria-describedby="story-popover-placement-trigger" data-placement="top" popover="" style="position-anchor: --story-popover-placement;"><div class="mx-rich-text mx-vertical-flow"><h2>Popover heading</h2><p>Short supplementary content. Use Popover for non-interactive hints; for menus use DropMenu, for modal content use Dialog.</p><a href="#" class="mx-link mx-link--more">Learn more</a></div></div>"`;
7
+ exports[`Placement 1`] = `"<button class="mx-button mx-icon--end" type="button" id="story-popover-placement-trigger" popovertarget="story-popover-placement" style="anchor-name: --story-popover-placement;"><span>Popover trigger</span><span class="mx-icon mx-icon--question"></span></button><div class="mx-popover" id="story-popover-placement" aria-describedby="story-popover-placement-trigger" data-placement="top" popover="" style="position-anchor: --story-popover-placement;"><div class="mx-rich-text mx-vertical-flow"><h2>Popover heading</h2><p>Short supplementary content. Use Popover for non-interactive hints; for menus use DropMenu, for modal content use Dialog.</p><a href="#" class="mx-link mx-link--more">Learn more</a></div></div>"`;
@@ -5,7 +5,13 @@ import { useTabContext } from "../Tabs"
5
5
  const TabDropMenu = ({ children }: PropsWithChildren): JSX.Element => {
6
6
  const { activeTabLabel } = useTabContext()
7
7
  return (
8
- <DropMenu label={activeTabLabel} className="mobile-only" role="tablist">
8
+ <DropMenu
9
+ label={activeTabLabel}
10
+ className="mobile-only"
11
+ role="tablist"
12
+ description="Selecting a tab updates the content below. Press escape to close."
13
+ triggerDescription="Select a tab"
14
+ >
9
15
  {children}
10
16
  </DropMenu>
11
17
  )
@@ -150,8 +150,10 @@ export default class Tabs extends HTMLElement {
150
150
  this.dropTriggerClasses =
151
151
  this.getAttribute("dropTriggerClasses") ||
152
152
  "mx-button mx-icon mx-icon--chevron-down mx-icon--end"
153
- this.dropMenuId = this.id || makeAnchor("tab-drop-menu")
153
+ this.dropMenuId = this.id ? `${this.id}-drop-menu` : makeAnchor("tab-drop-menu")
154
154
  const name = `${this.dropMenuId}-target`
155
+ const triggerDescriptionId = `${name}-description`
156
+ const menuDescriptionId = `${this.dropMenuId}-description`
155
157
  const tabDropMenu = new DropMenu()
156
158
  tabDropMenu.setAttribute("closeOnClick", "true")
157
159
  const trigger = createElement(`<button
@@ -159,20 +161,28 @@ export default class Tabs extends HTMLElement {
159
161
  class="mx-popover__trigger ${this.dropTriggerClasses}"
160
162
  popovertarget="${this.dropMenuId}"
161
163
  style="anchor-name: --${this.dropMenuId}"
164
+ aria-describedby="${triggerDescriptionId}"
162
165
  hidden
163
166
  ></button>`)
167
+ const triggerDescription = createElement(
168
+ `<span id="${triggerDescriptionId}" class="sr-only" aria-hidden="true">Select a tab</span>`,
169
+ )
170
+ const menuDescription = createElement(
171
+ `<span id="${menuDescriptionId}" class="sr-only" aria-hidden="true">Selecting a tab updates the content below. Press escape to close.</span>`,
172
+ )
164
173
  const menu = createElement(
165
174
  `<div
166
175
  class="mx-popover mx-drop-menu"
167
176
  id="${this.dropMenuId}"
168
- aria-describedby="${name}"
177
+ aria-labelledby="${name}"
178
+ aria-describedby="${menuDescriptionId}"
169
179
  style="position-anchor: --${this.dropMenuId}"
170
180
  data-placement="${PopoverPlacementModifier.BOTTOM_START}"
171
181
  popover
172
182
  role="tablist"
173
183
  ></div>`,
174
184
  )
175
- tabDropMenu.append(trigger, menu)
185
+ tabDropMenu.append(trigger, triggerDescription, menuDescription, menu)
176
186
  this.prepend(tabDropMenu)
177
187
  return tabDropMenu
178
188
  }
@@ -180,22 +180,43 @@ export const Tabs: Story = {
180
180
 
181
181
  /**
182
182
  * Steps a virtual screen reader through the tab list and asserts on what it announces.
183
+ *
184
+ * Below `Elements/Tabs.ts`'s breakpoint (`mq`, default `(max-width: 720px)`)
185
+ * the tab list collapses into a `DropMenu` popover trigger - see the component
186
+ * doc comment above. This branches on the real `matchMedia(...).matches`,
187
+ * same as the `Tabs` interaction story above, and is paired with
188
+ * `chromatic.modes` on `meta` so both shapes get exercised in CI. See
189
+ * "Testing Mobile / matchMedia-Driven Behavior in Play Functions" in
190
+ * docs/Testing.md.
183
191
  */
184
192
  export const ScreenReaderAnnouncements: Story = {
185
193
  play: async () => {
194
+ const isMobile = matchMedia("(max-width: 767px)").matches
186
195
  const log = await runScreenReaderWalkthrough()
187
- await expect(log).toEqual([
188
- "document",
189
- "tablist, orientated horizontally",
190
- "tab, Funk, selected, 1 control, position 1, set size 3",
191
- "tab, Soul, not selected, 1 control, position 2, set size 3",
192
- "tab, Motown, not selected, 1 control, position 3, set size 3",
193
- "end of tablist, orientated horizontally",
194
- "tabpanel, Funk",
195
- "Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.",
196
- "end of tabpanel, Funk",
197
- "end of document",
198
- ])
196
+
197
+ if (isMobile) {
198
+ await expect(log).toEqual([
199
+ "document",
200
+ "button, Funk, Select a tab",
201
+ "tabpanel, Funk",
202
+ "Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.",
203
+ "end of tabpanel, Funk",
204
+ "end of document",
205
+ ])
206
+ } else {
207
+ await expect(log).toEqual([
208
+ "document",
209
+ "tablist, orientated horizontally",
210
+ "tab, Funk, selected, 1 control, position 1, set size 3",
211
+ "tab, Soul, not selected, 1 control, position 2, set size 3",
212
+ "tab, Motown, not selected, 1 control, position 3, set size 3",
213
+ "end of tablist, orientated horizontally",
214
+ "tabpanel, Funk",
215
+ "Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.",
216
+ "end of tabpanel, Funk",
217
+ "end of document",
218
+ ])
219
+ }
199
220
  },
200
221
  }
201
222
 
@@ -121,20 +121,34 @@ export const Default: StoryObj<typeof meta> = {
121
121
  */
122
122
  export const ScreenReaderAnnouncements: StoryObj<typeof meta> = {
123
123
  play: async () => {
124
+ const isMobile = matchMedia("(max-width: 767px)").matches
124
125
  const log = await runScreenReaderWalkthrough()
125
- await expect(log).toEqual([
126
- "document",
127
- "tablist, orientated horizontally",
128
- "tab, Tab 1, selected, 1 control, position 1, set size 3",
129
- "tab, Tab 2, not selected, 1 control, position 2, set size 3",
130
- "tab, Tab 3, not selected, 1 control, position 3, set size 3",
131
- "end of tablist, orientated horizontally",
132
- "tabpanel, Tab 1",
133
- "paragraph",
134
- "This is tab 1",
135
- "end of paragraph",
136
- "end of tabpanel, Tab 1",
137
- "end of document",
138
- ])
126
+ if (isMobile) {
127
+ await expect(log).toEqual([
128
+ "document",
129
+ "button, Tab 1, Select a tab",
130
+ "tabpanel, Tab 1",
131
+ "paragraph",
132
+ "This is tab 1",
133
+ "end of paragraph",
134
+ "end of tabpanel, Tab 1",
135
+ "end of document",
136
+ ])
137
+ } else {
138
+ await expect(log).toEqual([
139
+ "document",
140
+ "tablist, orientated horizontally",
141
+ "tab, Tab 1, selected, 1 control, position 1, set size 3",
142
+ "tab, Tab 2, not selected, 1 control, position 2, set size 3",
143
+ "tab, Tab 3, not selected, 1 control, position 3, set size 3",
144
+ "end of tablist, orientated horizontally",
145
+ "tabpanel, Tab 1",
146
+ "paragraph",
147
+ "This is tab 1",
148
+ "end of paragraph",
149
+ "end of tabpanel, Tab 1",
150
+ "end of document",
151
+ ])
152
+ }
139
153
  },
140
154
  }
@@ -3,7 +3,7 @@
3
3
  exports[`Screen Reader Announcements 1`] = `
4
4
  "
5
5
 
6
- <mx-tabs class="mx-tabs mx-tabs--lined" id="tab-example"><mx-dropmenu closeonclick="true"><button id="unique-3" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="tab-example" style="anchor-name: --tab-example" hidden="">Funk</button><div class="mx-popover mx-drop-menu" id="tab-example" aria-describedby="unique-0" style="position-anchor: --tab-example" data-placement="bottom-start" popover="" role="tablist"><button type="button" role="tab" aria-controls="unique-1" aria-selected="true">Funk</button><button type="button" role="tab" aria-controls="unique-2" aria-selected="false">Soul</button><button type="button" role="tab" aria-controls="unique-3" aria-selected="false">Motown</button></div></mx-dropmenu><div class="mx-tabs__list" role="tablist"><button type="button" role="tab" aria-controls="unique-4" aria-selected="true" tabindex="0">Funk</button><button type="button" role="tab" aria-controls="unique-5" aria-selected="false" tabindex="-1">Soul</button><button type="button" role="tab" aria-controls="unique-6" aria-selected="false" tabindex="-1">Motown</button></div>
6
+ <mx-tabs class="mx-tabs mx-tabs--lined" id="tab-example"><mx-dropmenu closeonclick="true"><button id="unique-3" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="tab-example-drop-menu" style="anchor-name: --tab-example-drop-menu" aria-describedby="unique-0" hidden="">Funk</button><span id="unique-4" class="sr-only" aria-hidden="true">Select a tab</span><span id="unique-5" class="sr-only" aria-hidden="true">Selecting a tab updates the content below. Press escape to close.</span><div class="mx-popover mx-drop-menu" id="tab-example-drop-menu" aria-labelledby="unique-1" aria-describedby="unique-1" style="position-anchor: --tab-example-drop-menu" data-placement="bottom-start" popover="" role="tablist"><button type="button" role="tab" aria-controls="unique-2" aria-selected="true">Funk</button><button type="button" role="tab" aria-controls="unique-3" aria-selected="false">Soul</button><button type="button" role="tab" aria-controls="unique-4" aria-selected="false">Motown</button></div></mx-dropmenu><div class="mx-tabs__list" role="tablist"><button type="button" role="tab" aria-controls="unique-5" aria-selected="true" tabindex="0">Funk</button><button type="button" role="tab" aria-controls="unique-6" aria-selected="false" tabindex="-1">Soul</button><button type="button" role="tab" aria-controls="unique-7" aria-selected="false" tabindex="-1">Motown</button></div>
7
7
  <div class="mx-tabs__panel mx-vertical-flow mx-container" id="unique-0" data-tab="Funk" role="tabpanel" tabindex="-1" aria-label="Funk">
8
8
  Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
9
9
  </div>
@@ -21,7 +21,7 @@ exports[`Screen Reader Announcements 1`] = `
21
21
  exports[`Tabs 1`] = `
22
22
  "
23
23
 
24
- <mx-tabs class="mx-tabs mx-tabs--lined" id="tab-example"><mx-dropmenu closeonclick="true"><button id="unique-3" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="tab-example" style="anchor-name: --tab-example" hidden="">Funk</button><div class="mx-popover mx-drop-menu" id="tab-example" aria-describedby="unique-0" style="position-anchor: --tab-example" data-placement="bottom-start" popover="" role="tablist"><button type="button" role="tab" aria-controls="unique-1" aria-selected="true">Funk</button><button type="button" role="tab" aria-controls="unique-2" aria-selected="false">Soul</button><button type="button" role="tab" aria-controls="unique-3" aria-selected="false">Motown</button></div></mx-dropmenu><div class="mx-tabs__list" role="tablist"><button type="button" role="tab" aria-controls="unique-4" aria-selected="true" tabindex="0">Funk</button><button type="button" role="tab" aria-controls="unique-5" aria-selected="false" tabindex="-1">Soul</button><button type="button" role="tab" aria-controls="unique-6" aria-selected="false" tabindex="-1">Motown</button></div>
24
+ <mx-tabs class="mx-tabs mx-tabs--lined" id="tab-example"><mx-dropmenu closeonclick="true"><button id="unique-3" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="tab-example-drop-menu" style="anchor-name: --tab-example-drop-menu" aria-describedby="unique-0" hidden="">Funk</button><span id="unique-4" class="sr-only" aria-hidden="true">Select a tab</span><span id="unique-5" class="sr-only" aria-hidden="true">Selecting a tab updates the content below. Press escape to close.</span><div class="mx-popover mx-drop-menu" id="tab-example-drop-menu" aria-labelledby="unique-1" aria-describedby="unique-1" style="position-anchor: --tab-example-drop-menu" data-placement="bottom-start" popover="" role="tablist"><button type="button" role="tab" aria-controls="unique-2" aria-selected="true">Funk</button><button type="button" role="tab" aria-controls="unique-3" aria-selected="false">Soul</button><button type="button" role="tab" aria-controls="unique-4" aria-selected="false">Motown</button></div></mx-dropmenu><div class="mx-tabs__list" role="tablist"><button type="button" role="tab" aria-controls="unique-5" aria-selected="true" tabindex="0">Funk</button><button type="button" role="tab" aria-controls="unique-6" aria-selected="false" tabindex="-1">Soul</button><button type="button" role="tab" aria-controls="unique-7" aria-selected="false" tabindex="-1">Motown</button></div>
25
25
  <div class="mx-tabs__panel mx-vertical-flow mx-container" id="unique-0" data-tab="Funk" role="tabpanel" tabindex="-1" aria-label="Funk">
26
26
  Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
27
27
  </div>
@@ -41,7 +41,7 @@ exports[`With Heading 1`] = `
41
41
 
42
42
  <h2>Tabs heading</h2>
43
43
 
44
- <mx-tabs class="mx-tabs mx-tabs--lined" id="tab-example"><mx-dropmenu closeonclick="true"><button id="unique-3" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="tab-example" style="anchor-name: --tab-example" hidden="">Funk</button><div class="mx-popover mx-drop-menu" id="tab-example" aria-describedby="unique-0" style="position-anchor: --tab-example" data-placement="bottom-start" popover="" role="tablist"><button type="button" role="tab" aria-controls="unique-1" aria-selected="true">Funk</button><button type="button" role="tab" aria-controls="unique-2" aria-selected="false">Soul</button><button type="button" role="tab" aria-controls="unique-3" aria-selected="false">Motown</button></div></mx-dropmenu><div class="mx-tabs__list" role="tablist"><button type="button" role="tab" aria-controls="unique-4" aria-selected="true" tabindex="0">Funk</button><button type="button" role="tab" aria-controls="unique-5" aria-selected="false" tabindex="-1">Soul</button><button type="button" role="tab" aria-controls="unique-6" aria-selected="false" tabindex="-1">Motown</button></div>
44
+ <mx-tabs class="mx-tabs mx-tabs--lined" id="tab-example"><mx-dropmenu closeonclick="true"><button id="unique-3" class="mx-popover__trigger mx-button mx-icon mx-icon--chevron-down mx-icon--end" popovertarget="tab-example-drop-menu" style="anchor-name: --tab-example-drop-menu" aria-describedby="unique-0" hidden="">Funk</button><span id="unique-4" class="sr-only" aria-hidden="true">Select a tab</span><span id="unique-5" class="sr-only" aria-hidden="true">Selecting a tab updates the content below. Press escape to close.</span><div class="mx-popover mx-drop-menu" id="tab-example-drop-menu" aria-labelledby="unique-1" aria-describedby="unique-1" style="position-anchor: --tab-example-drop-menu" data-placement="bottom-start" popover="" role="tablist"><button type="button" role="tab" aria-controls="unique-2" aria-selected="true">Funk</button><button type="button" role="tab" aria-controls="unique-3" aria-selected="false">Soul</button><button type="button" role="tab" aria-controls="unique-4" aria-selected="false">Motown</button></div></mx-dropmenu><div class="mx-tabs__list" role="tablist"><button type="button" role="tab" aria-controls="unique-5" aria-selected="true" tabindex="0">Funk</button><button type="button" role="tab" aria-controls="unique-6" aria-selected="false" tabindex="-1">Soul</button><button type="button" role="tab" aria-controls="unique-7" aria-selected="false" tabindex="-1">Motown</button></div>
45
45
  <div class="mx-tabs__panel mx-vertical-flow mx-container" id="unique-0" data-tab="Funk" role="tabpanel" tabindex="-1" aria-label="Funk">
46
46
  Funk is the ipsum dolor sit amet, consectetur adipiscing elit. Proin at finibus velit. Curabitur consequat, dolor venenatis ullamcorper commodo, quam mi iaculis sem, non varius massa risus et enim. Interdum et malesuada fames ac ante ipsum primis in faucibus. Phasellus non mi lorem. Morbi semper sagittis euismod. Vestibulum non ornare orci.
47
47
  </div>
@@ -1,5 +1,5 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`Default 1`] = `"<div class="mx-tabs"><div class="mobile-only"><button id="tabs-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="tabs-storybook" style="anchor-name: --drop-menu-tabs-storybook;">Tab 1</button><div id="tabs-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="tabs-storybook-target" aria-describedby="tabs-storybook-description" role="tablist" style="position-anchor: --drop-menu-tabs-storybook;"><div id="tabs-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="tab-1" aria-checked="true" role="tab" aria-controls="tab-1" aria-selected="true">Tab 1</button><button type="button" data-id="tab-2" aria-checked="false" role="tab" aria-controls="tab-2" aria-selected="false">Tab 2</button><button type="button" data-id="tab-3" aria-checked="false" role="tab" aria-controls="tab-3" aria-selected="false">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div></div><div class="mx-tabs__list desktop-only" role="tablist"><span data-focus-scope-start="true" hidden=""></span><button id="tab-1-button" aria-controls="tab-1" role="tab" aria-selected="true" tabindex="0" type="button">Tab 1</button><button id="tab-2-button" aria-controls="tab-2" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 2</button><button id="tab-3-button" aria-controls="tab-3" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div><div id="tab-1" class="mx-tabs__panel mx-vertical-flow mx-section--l" aria-labelledby="tab-1-button" role="tabpanel" tabindex="0"><p>This is tab 1</p></div><div id="tab-2" class="mx-tabs__panel mx-vertical-flow mx-section--l" aria-labelledby="tab-2-button" role="tabpanel" tabindex="0" inert=""><p>This is tab 2</p></div><div id="tab-3" class="mx-tabs__panel mx-vertical-flow mx-section--l" inert="" aria-labelledby="tab-3-button" role="tabpanel" tabindex="0"><p>This is tab 3</p></div></div>"`;
3
+ exports[`Default 1`] = `"<div class="mx-tabs"><div class="mobile-only"><button id="tabs-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="tabs-storybook" aria-describedby="tabs-storybook-target-desc" style="anchor-name: --drop-menu-tabs-storybook;">Tab 1</button><span id="tabs-storybook-target-desc" class="sr-only" aria-hidden="true">Select a tab</span><span id="tabs-storybook-description" class="sr-only" aria-hidden="true">Selecting a tab updates the content below. Press escape to close.</span><div id="tabs-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="tabs-storybook-target" aria-describedby="tabs-storybook-description" role="tablist" style="position-anchor: --drop-menu-tabs-storybook;"><span data-focus-scope-start="true" hidden=""></span><button type="button" data-id="tab-1" aria-checked="true" role="tab" aria-controls="tab-1" aria-selected="true">Tab 1</button><button type="button" data-id="tab-2" aria-checked="false" role="tab" aria-controls="tab-2" aria-selected="false">Tab 2</button><button type="button" data-id="tab-3" aria-checked="false" role="tab" aria-controls="tab-3" aria-selected="false">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div></div><div class="mx-tabs__list desktop-only" role="tablist"><span data-focus-scope-start="true" hidden=""></span><button id="tab-1-button" aria-controls="tab-1" role="tab" aria-selected="true" tabindex="0" type="button">Tab 1</button><button id="tab-2-button" aria-controls="tab-2" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 2</button><button id="tab-3-button" aria-controls="tab-3" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div><div id="tab-1" class="mx-tabs__panel mx-vertical-flow mx-section--l" aria-labelledby="tab-1-button" role="tabpanel" tabindex="0"><p>This is tab 1</p></div><div id="tab-2" class="mx-tabs__panel mx-vertical-flow mx-section--l" aria-labelledby="tab-2-button" role="tabpanel" tabindex="0" inert=""><p>This is tab 2</p></div><div id="tab-3" class="mx-tabs__panel mx-vertical-flow mx-section--l" inert="" aria-labelledby="tab-3-button" role="tabpanel" tabindex="0"><p>This is tab 3</p></div></div>"`;
4
4
 
5
- exports[`Screen Reader Announcements 1`] = `"<div class="mx-tabs"><div class="mobile-only"><button id="tabs-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="tabs-storybook" style="anchor-name: --drop-menu-tabs-storybook;">Tab 1</button><div id="tabs-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="tabs-storybook-target" aria-describedby="tabs-storybook-description" role="tablist" style="position-anchor: --drop-menu-tabs-storybook;"><div id="tabs-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="tab-1" aria-checked="true" role="tab" aria-controls="tab-1" aria-selected="true">Tab 1</button><button type="button" data-id="tab-2" aria-checked="false" role="tab" aria-controls="tab-2" aria-selected="false">Tab 2</button><button type="button" data-id="tab-3" aria-checked="false" role="tab" aria-controls="tab-3" aria-selected="false">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div></div><div class="mx-tabs__list desktop-only" role="tablist"><span data-focus-scope-start="true" hidden=""></span><button id="tab-1-button" aria-controls="tab-1" role="tab" aria-selected="true" tabindex="0" type="button">Tab 1</button><button id="tab-2-button" aria-controls="tab-2" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 2</button><button id="tab-3-button" aria-controls="tab-3" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div><div id="tab-1" class="mx-tabs__panel mx-vertical-flow mx-section--l" aria-labelledby="tab-1-button" role="tabpanel" tabindex="0"><p>This is tab 1</p></div><div id="tab-2" class="mx-tabs__panel mx-vertical-flow mx-section--l" inert="" aria-labelledby="tab-2-button" role="tabpanel" tabindex="0"><p>This is tab 2</p></div><div id="tab-3" class="mx-tabs__panel mx-vertical-flow mx-section--l" inert="" aria-labelledby="tab-3-button" role="tabpanel" tabindex="0"><p>This is tab 3</p></div></div>"`;
5
+ exports[`Screen Reader Announcements 1`] = `"<div class="mx-tabs"><div class="mobile-only"><button id="tabs-storybook-target" type="button" class="mx-button mx-icon mx-icon--chevron-down mx-icon--end mx-popover__trigger" popovertarget="tabs-storybook" aria-describedby="tabs-storybook-target-desc" style="anchor-name: --drop-menu-tabs-storybook;">Tab 1</button><span id="tabs-storybook-target-desc" class="sr-only" aria-hidden="true">Select a tab</span><span id="tabs-storybook-description" class="sr-only" aria-hidden="true">Selecting a tab updates the content below. Press escape to close.</span><div id="tabs-storybook" class="mx-popover mx-drop-menu" popover="" aria-labelledby="tabs-storybook-target" aria-describedby="tabs-storybook-description" role="tablist" style="position-anchor: --drop-menu-tabs-storybook;"><span data-focus-scope-start="true" hidden=""></span><button type="button" data-id="tab-1" aria-checked="true" role="tab" aria-controls="tab-1" aria-selected="true">Tab 1</button><button type="button" data-id="tab-2" aria-checked="false" role="tab" aria-controls="tab-2" aria-selected="false">Tab 2</button><button type="button" data-id="tab-3" aria-checked="false" role="tab" aria-controls="tab-3" aria-selected="false">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div></div><div class="mx-tabs__list desktop-only" role="tablist"><span data-focus-scope-start="true" hidden=""></span><button id="tab-1-button" aria-controls="tab-1" role="tab" aria-selected="true" tabindex="0" type="button">Tab 1</button><button id="tab-2-button" aria-controls="tab-2" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 2</button><button id="tab-3-button" aria-controls="tab-3" role="tab" aria-selected="false" tabindex="-1" type="button">Tab 3</button><span data-focus-scope-end="true" hidden=""></span></div><div id="tab-1" class="mx-tabs__panel mx-vertical-flow mx-section--l" aria-labelledby="tab-1-button" role="tabpanel" tabindex="0"><p>This is tab 1</p></div><div id="tab-2" class="mx-tabs__panel mx-vertical-flow mx-section--l" inert="" aria-labelledby="tab-2-button" role="tabpanel" tabindex="0"><p>This is tab 2</p></div><div id="tab-3" class="mx-tabs__panel mx-vertical-flow mx-section--l" inert="" aria-labelledby="tab-3-button" role="tabpanel" tabindex="0"><p>This is tab 3</p></div></div>"`;