@pnx-mixtape/mxds 0.0.21 → 0.0.23

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 (380) hide show
  1. package/dist/build/accordion.entry.js +32 -43
  2. package/dist/build/accordion.entry.js.map +1 -1
  3. package/dist/build/base.css +19 -39
  4. package/dist/build/button.css +7 -8
  5. package/dist/build/chunks/{Accordion-O-huO4At.js → Accordion-D1HQ0FDq.js} +23 -21
  6. package/dist/build/chunks/{Accordion-O-huO4At.js.map → Accordion-D1HQ0FDq.js.map} +1 -1
  7. package/dist/build/chunks/disclosure-widget-CdjCdx7t.js +129 -0
  8. package/dist/build/chunks/disclosure-widget-CdjCdx7t.js.map +1 -0
  9. package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js +70 -0
  10. package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js.map +1 -0
  11. package/dist/build/chunks/{polyfills-C-B7iqDG.js → polyfills-DnrsypYs.js} +35 -26
  12. package/dist/build/chunks/polyfills-DnrsypYs.js.map +1 -0
  13. package/dist/build/chunks/popover.entry-BQvyR0d5.js +38 -0
  14. package/dist/build/chunks/popover.entry-BQvyR0d5.js.map +1 -0
  15. package/dist/build/chunks/{utilities-DXELy_An.js → utilities-Ci7wwNeg.js} +9 -106
  16. package/dist/build/chunks/utilities-Ci7wwNeg.js.map +1 -0
  17. package/dist/build/constants.css +10 -31
  18. package/dist/build/dialog.entry.js +23 -31
  19. package/dist/build/dialog.entry.js.map +1 -1
  20. package/dist/build/drop-menu.entry.js +1 -1
  21. package/dist/build/drupal.css +5 -9
  22. package/dist/build/filters.entry.js +54 -50
  23. package/dist/build/filters.entry.js.map +1 -1
  24. package/dist/build/form.css +12 -26
  25. package/dist/build/global-alert.entry.js +26 -19
  26. package/dist/build/global-alert.entry.js.map +1 -1
  27. package/dist/build/grid.css +3 -9
  28. package/dist/build/header.css +5 -3
  29. package/dist/build/header.entry.js +93 -88
  30. package/dist/build/header.entry.js.map +1 -1
  31. package/dist/build/icon.css +3 -3
  32. package/dist/build/in-page-navigation.entry.js +16 -12
  33. package/dist/build/in-page-navigation.entry.js.map +1 -1
  34. package/dist/build/navigation.css +21 -56
  35. package/dist/build/navigation.entry.js +148 -50
  36. package/dist/build/navigation.entry.js.map +1 -1
  37. package/dist/build/page.css +1 -1
  38. package/dist/build/popover.css +119 -0
  39. package/dist/build/popover.entry.js +2 -0
  40. package/dist/build/popover.entry.js.map +1 -0
  41. package/dist/build/section.css +1 -1
  42. package/dist/build/sticky.entry.js +11 -12
  43. package/dist/build/sticky.entry.js.map +1 -1
  44. package/dist/build/tabs.entry.js +108 -91
  45. package/dist/build/tabs.entry.js.map +1 -1
  46. package/dist/build/utility-list.css +43 -0
  47. package/dist/build/utility-list.entry.js +80 -0
  48. package/dist/build/utility-list.entry.js.map +1 -0
  49. package/package.json +9 -10
  50. package/src/Atom/{Base.mdx → Atom.mdx} +1 -1
  51. package/src/Atom/Background/Backgrounds.stories.ts +21 -4
  52. package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +1 -1
  53. package/src/Atom/Background/_background.css +1 -2
  54. package/src/Atom/Blockquote/_blockquote.css +1 -2
  55. package/src/Atom/Button/Button.stories.ts +128 -19
  56. package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +75 -11
  57. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +1 -1
  58. package/src/Atom/Button/_buttons.css +5 -5
  59. package/src/Atom/DefinitionList/DefinitionList.stories.ts +20 -3
  60. package/src/Atom/DefinitionList/DefinitionList.stories.tsx +3 -9
  61. package/src/Atom/DefinitionList/DefinitionList.tsx +3 -4
  62. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +1 -1
  63. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
  64. package/src/Atom/Heading/Heading.stories.ts +49 -7
  65. package/src/Atom/Heading/Heading.tsx +1 -6
  66. package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +9 -1
  67. package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
  68. package/src/Atom/Heading/_headings.css +1 -2
  69. package/src/Atom/Icon/Icon.mdx +5 -1
  70. package/src/Atom/Icon/Icon.stories.ts +76 -6
  71. package/src/Atom/Icon/Icon.tsx +1 -8
  72. package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +18 -4
  73. package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +1 -1
  74. package/src/Atom/Icon/_icon.css +1 -1
  75. package/src/Atom/Image/Image.stories.ts +4 -3
  76. package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
  77. package/src/Atom/Link/Link.stories.ts +74 -7
  78. package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +4 -4
  79. package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +1 -1
  80. package/src/Atom/Media/Media.stories.ts +34 -5
  81. package/src/Atom/Media/Media.tsx +1 -6
  82. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +2 -2
  83. package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +1 -1
  84. package/src/Atom/Media/_media.css +2 -10
  85. package/src/Atom/Spacing/Spacing.stories.ts +45 -31
  86. package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -4
  87. package/src/Atom/Spacing/spacing.twig +5 -2
  88. package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +1 -1
  89. package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
  90. package/src/Atom/Table/_table.css +1 -2
  91. package/src/Atom/Text/Text.stories.ts +62 -0
  92. package/src/Atom/Text/__snapshots__/{TextSizes.stories.ts.snap → Text.stories.ts.snap} +14 -27
  93. package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
  94. package/src/Atom/Text/_text-sizes.css +2 -4
  95. package/src/Atom/Text/text-style.twig +11 -1
  96. package/src/Atom/Text/text-styles-example.twig +2 -16
  97. package/src/Atom/Video/Video.stories.ts +6 -4
  98. package/src/Atom/Video/Video.tsx +1 -5
  99. package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +1 -1
  100. package/src/Atom/_generic.css +4 -4
  101. package/src/Atom/_hr.css +1 -2
  102. package/src/Component/Accordion/Accordion.stories.ts +26 -8
  103. package/src/Component/Accordion/Accordion.stories.tsx +8 -10
  104. package/src/Component/Accordion/Accordion.tsx +2 -13
  105. package/src/Component/Accordion/AccordionItem.stories.ts +90 -0
  106. package/src/Component/Accordion/Components/AccordionContent.tsx +1 -5
  107. package/src/Component/Accordion/Components/AccordionTitle.tsx +1 -4
  108. package/src/Component/Accordion/Elements/Accordion.ts +1 -1
  109. package/src/Component/Accordion/Elements/AccordionDiv.ts +4 -11
  110. package/src/Component/Accordion/Elements/AccordionGroup.ts +10 -24
  111. package/src/Component/Accordion/Elements/AccordionMobile.ts +4 -4
  112. package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +17 -6
  113. package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
  114. package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +90 -0
  115. package/src/Component/Accordion/accordion.css +7 -5
  116. package/src/Component/Accordion/twig/accordion-div.twig +13 -11
  117. package/src/Component/Accordion/twig/accordion-mobile.twig +13 -11
  118. package/src/Component/Breadcrumb/Breadcrumb.stories.ts +14 -0
  119. package/src/Component/Breadcrumb/Breadcrumb.tsx +2 -12
  120. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
  121. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +1 -1
  122. package/src/Component/Breadcrumb/breadcrumb.css +1 -4
  123. package/src/Component/Callout/Callout.stories.ts +20 -0
  124. package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +1 -1
  125. package/src/Component/Callout/callout.css +1 -2
  126. package/src/Component/Card/Card.stories.ts +129 -14
  127. package/src/Component/Card/Card.stories.tsx +2 -2
  128. package/src/Component/Card/Components/CardContent.tsx +1 -5
  129. package/src/Component/Card/__snapshots__/Card.stories.ts.snap +24 -24
  130. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +1 -1
  131. package/src/Component/Card/card.css +2 -6
  132. package/src/Component/Card/card.twig +1 -1
  133. package/src/Component/Carousel/Carousel.stories.ts +61 -8
  134. package/src/Component/Carousel/Elements/Carousel.ts +10 -19
  135. package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +321 -35
  136. package/src/Component/Carousel/carousel.css +1 -2
  137. package/src/Component/ContentBlock/Components/ContentBlockContent.tsx +1 -5
  138. package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -4
  139. package/src/Component/ContentBlock/ContentBlock.stories.ts +63 -13
  140. package/src/Component/ContentBlock/ContentBlock.stories.tsx +2 -2
  141. package/src/Component/ContentBlock/ContentBlock.tsx +1 -5
  142. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +11 -11
  143. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
  144. package/src/Component/Dialog/Dialog.stories.ts +78 -21
  145. package/src/Component/Dialog/Dialog.stories.tsx +2 -3
  146. package/src/Component/Dialog/Elements/Dialog.ts +7 -16
  147. package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +8 -11
  148. package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
  149. package/src/Component/Dialog/dialog.css +1 -2
  150. package/src/Component/Dialog/dialog.twig +1 -1
  151. package/src/Component/DropMenu/Components/DropMenuContext.tsx +4 -12
  152. package/src/Component/DropMenu/DropMenu.stories.ts +60 -1
  153. package/src/Component/DropMenu/DropMenu.tsx +2 -7
  154. package/src/Component/DropMenu/Elements/DropMenu.ts +21 -91
  155. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +53 -11
  156. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
  157. package/src/Component/DropMenu/drop-menu.css +13 -41
  158. package/src/Component/DropMenu/drop-menu.twig +8 -6
  159. package/src/Component/Filters/Elements/Filters.ts +7 -11
  160. package/src/Component/Filters/FilterItem.stories.ts +180 -0
  161. package/src/Component/Filters/Filters.stories.ts +83 -8
  162. package/src/Component/Filters/__snapshots__/FilterItem.stories.ts.snap +135 -0
  163. package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +43 -41
  164. package/src/Component/Filters/filter-item.twig +1 -1
  165. package/src/Component/Filters/filters.css +33 -17
  166. package/src/Component/GlobalAlert/Elements/ClosableAlert.ts +8 -7
  167. package/src/Component/GlobalAlert/GlobalAlert.stories.ts +60 -12
  168. package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +1 -2
  169. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +8 -6
  170. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +3 -3
  171. package/src/Component/HeroBanner/HeroBanner.stories.ts +84 -7
  172. package/src/Component/HeroBanner/HeroBanner.stories.tsx +4 -4
  173. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +91 -99
  174. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
  175. package/src/Component/HeroSearch/HeroSearch.stories.ts +23 -4
  176. package/src/Component/HeroSearch/HeroSearch.stories.tsx +4 -4
  177. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +10 -10
  178. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +1 -1
  179. package/src/Component/InPageAlert/InPageAlert.stories.ts +76 -8
  180. package/src/Component/InPageAlert/InPageAlert.stories.tsx +1 -2
  181. package/src/Component/InPageAlert/InPageAlert.tsx +1 -4
  182. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +80 -2
  183. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +1 -1
  184. package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +7 -9
  185. package/src/Component/InPageNavigation/Hooks/useInPageNavigation.ts +3 -5
  186. package/src/Component/InPageNavigation/InPageNavigation.stories.ts +44 -9
  187. package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +32 -40
  188. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +152 -5
  189. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
  190. package/src/Component/LinkList/LinkList.stories.ts +23 -0
  191. package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +8 -8
  192. package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +1 -1
  193. package/src/Component/LinkList/link-list.css +1 -2
  194. package/src/Component/ListItem/Components/ListItemContent.tsx +1 -5
  195. package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -4
  196. package/src/Component/ListItem/ListItem.stories.ts +91 -11
  197. package/src/Component/ListItem/ListItem.stories.tsx +6 -7
  198. package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +1 -1
  199. package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +1 -1
  200. package/src/Component/ListItem/list-item.css +1 -2
  201. package/src/Component/Navigation/Components/DropdownLevel.tsx +5 -13
  202. package/src/Component/Navigation/Elements/Navigation.ts +6 -13
  203. package/src/Component/Navigation/Navigation.stories.ts +48 -0
  204. package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
  205. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
  206. package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +1 -1
  207. package/src/Component/Navigation/_navigation-collapsible.css +2 -4
  208. package/src/Component/Navigation/_navigation-dropdown.css +10 -32
  209. package/src/Component/Navigation/_navigation-mega.css +1 -4
  210. package/src/Component/Navigation/_navigation.css +1 -4
  211. package/src/Component/Pagination/Components/PaginationContext.tsx +5 -19
  212. package/src/Component/Pagination/Components/PaginationItem.tsx +1 -5
  213. package/src/Component/Pagination/Pagination.stories.ts +28 -0
  214. package/src/Component/Pagination/Pagination.tsx +3 -11
  215. package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +3 -3
  216. package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
  217. package/src/Component/Pagination/pagination.css +1 -4
  218. package/src/Component/Popover/Elements/Popover.ts +55 -0
  219. package/src/Component/Popover/Popover.stories.ts +259 -0
  220. package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +508 -0
  221. package/src/Component/{DropMenu → Popover}/polyfills.js +6 -4
  222. package/src/Component/Popover/popover.css +113 -0
  223. package/src/Component/Popover/popover.entry.js +1 -0
  224. package/src/Component/Popover/popover.twig +27 -0
  225. package/src/Component/ResultsBar/Components/ResultsBarInfo.tsx +2 -7
  226. package/src/Component/ResultsBar/Components/ResultsBarSort.tsx +1 -6
  227. package/src/Component/ResultsBar/ResultsBar.stories.ts +34 -4
  228. package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +3 -3
  229. package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +1 -1
  230. package/src/Component/SideNavigation/SideNavigation.stories.ts +40 -0
  231. package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +1 -1
  232. package/src/Component/SideNavigation/side-navigation.css +3 -6
  233. package/src/Component/SocialLinks/SocialLinks.stories.ts +20 -0
  234. package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +5 -5
  235. package/src/Component/SocialShare/SocialShare.stories.ts +37 -0
  236. package/src/Component/SocialShare/SocialShare.tsx +2 -4
  237. package/src/Component/SocialShare/__snapshots__/SocialShare.stories.ts.snap +40 -0
  238. package/src/Component/SocialShare/__snapshots__/SocialShare.stories.tsx.snap +1 -1
  239. package/src/Component/SocialShare/social-share.twig +34 -0
  240. package/src/Component/Steps/StepItem.stories.ts +48 -0
  241. package/src/Component/Steps/Steps.stories.ts +82 -13
  242. package/src/Component/Steps/__snapshots__/StepItem.stories.ts.snap +31 -0
  243. package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +109 -28
  244. package/src/Component/Steps/step-item.twig +1 -1
  245. package/src/Component/Steps/steps.css +4 -11
  246. package/src/Component/Sticky/Elements/Sticky.ts +3 -8
  247. package/src/Component/Sticky/Sticky.stories.ts +35 -3
  248. package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +1 -1
  249. package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
  250. package/src/Component/Sticky/sticky.twig +1 -1
  251. package/src/Component/Tabs/Components/Tab.tsx +2 -8
  252. package/src/Component/Tabs/Components/TabPanel.tsx +1 -5
  253. package/src/Component/Tabs/Elements/Tabs.ts +21 -31
  254. package/src/Component/Tabs/TabItem.stories.ts +52 -0
  255. package/src/Component/Tabs/Tabs.stories.ts +51 -8
  256. package/src/Component/Tabs/Tabs.tsx +6 -22
  257. package/src/Component/Tabs/__snapshots__/TabItem.stories.ts.snap +12 -0
  258. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +127 -11
  259. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
  260. package/src/Component/Tabs/tab-item.twig +1 -2
  261. package/src/Component/Tabs/tabs.css +56 -59
  262. package/src/Component/Tag/Tag.stories.ts +30 -0
  263. package/src/Component/Tag/Tag.tsx +1 -5
  264. package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +1 -1
  265. package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
  266. package/src/Component/Tag/tag.css +1 -4
  267. package/src/Component/UtilityList/Elements/UtilityList.ts +110 -0
  268. package/src/Component/UtilityList/UtilityList.stories.ts +72 -0
  269. package/src/Component/UtilityList/__snapshots__/UtilityList.stories.ts.snap +274 -0
  270. package/src/Component/UtilityList/utility-list.css +40 -0
  271. package/src/Component/UtilityList/utility-list.entry.js +1 -0
  272. package/src/Component/UtilityList/utility-list.twig +66 -0
  273. package/src/Form/Checkbox/FormCheckbox.stories.tsx +1 -3
  274. package/src/Form/Checkbox/FormCheckbox.tsx +4 -25
  275. package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +3 -3
  276. package/src/Form/Description/Description.stories.ts +1 -2
  277. package/src/Form/Description/FormStatus.stories.ts +1 -4
  278. package/src/Form/Description/__snapshots__/Description.stories.ts.snap +1 -1
  279. package/src/Form/Description/__snapshots__/FormDescription.stories.tsx.snap +1 -1
  280. package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +3 -3
  281. package/src/Form/Form/Form.tsx +1 -3
  282. package/src/Form/Form/__snapshots__/Form.stories.tsx.snap +1 -1
  283. package/src/Form/Form/__snapshots__/FormTitle.stories.tsx.snap +1 -1
  284. package/src/Form/FormItem/FormItem.stories.ts +3 -9
  285. package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +18 -18
  286. package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +1 -1
  287. package/src/Form/Label/FormLabel.tsx +1 -5
  288. package/src/Form/Label/__snapshots__/FormLabel.stories.tsx.snap +1 -1
  289. package/src/Form/Label/__snapshots__/Label.stories.ts.snap +3 -3
  290. package/src/Form/Radio/FormRadio.stories.tsx +1 -3
  291. package/src/Form/Radio/FormRadio.tsx +4 -25
  292. package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +9 -9
  293. package/src/Form/Search/__snapshots__/Search.stories.ts.snap +1 -1
  294. package/src/Form/Select/FormSelect.tsx +3 -9
  295. package/src/Form/Select/__snapshots__/FormSelect.stories.tsx.snap +1 -1
  296. package/src/Form/Select/__snapshots__/Select.stories.ts.snap +2 -2
  297. package/src/Form/TextInput/FormText.tsx +3 -9
  298. package/src/Form/TextInput/TextInput.stories.ts +1 -4
  299. package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +1 -1
  300. package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +1 -1
  301. package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +3 -3
  302. package/src/Form/Textarea/FormTextarea.tsx +3 -9
  303. package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +1 -1
  304. package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +2 -2
  305. package/src/Form/form.css +6 -14
  306. package/src/Introduction.mdx +1 -2
  307. package/src/Layout/Footer/Footer.stories.ts +1 -5
  308. package/src/Layout/Footer/Footer.stories.tsx +2 -3
  309. package/src/Layout/Footer/Footer.tsx +3 -12
  310. package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +4 -4
  311. package/src/Layout/Footer/__snapshots__/Footer.stories.tsx.snap +1 -1
  312. package/src/Layout/Grid/Grid.stories.ts +40 -8
  313. package/src/Layout/Grid/Grid.tsx +1 -2
  314. package/src/Layout/Grid/GridItem.stories.ts +63 -0
  315. package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +29 -4
  316. package/src/Layout/Grid/__snapshots__/Grid.stories.tsx.snap +1 -1
  317. package/src/Layout/Grid/__snapshots__/GridItem.stories.ts.snap +19 -0
  318. package/src/Layout/Grid/grid-item.twig +3 -9
  319. package/src/Layout/Grid/grid.css +1 -4
  320. package/src/Layout/Header/Elements/GlobalToggle.ts +9 -29
  321. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +25 -45
  322. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
  323. package/src/Layout/Header/_toggles.css +2 -2
  324. package/src/Layout/Header/header.twig +1 -1
  325. package/src/Layout/Masthead/Masthead.stories.ts +1 -4
  326. package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +3 -3
  327. package/src/Layout/Page/Page.stories.tsx +2 -2
  328. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +3 -3
  329. package/src/Layout/Page/page.css +2 -10
  330. package/src/Layout/Section/Background.stories.ts +14 -39
  331. package/src/Layout/Section/Breakouts.stories.ts +3 -0
  332. package/src/Layout/Section/Flow.stories.ts +3 -0
  333. package/src/Layout/Section/Section.stories.ts +93 -11
  334. package/src/Layout/Section/Section.tsx +3 -13
  335. package/src/Layout/Section/SectionGrid.tsx +2 -9
  336. package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +4 -4
  337. package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +1 -1
  338. package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +1 -1
  339. package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +93 -3
  340. package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +1 -1
  341. package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +1 -1
  342. package/src/Layout/Section/section.css +2 -5
  343. package/src/Layout/Section/section.twig +1 -3
  344. package/src/Layout/Sidebar/Sidebar.stories.ts +46 -4
  345. package/src/Layout/Sidebar/Sidebar.tsx +1 -3
  346. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +4 -4
  347. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +1 -1
  348. package/src/Utility/Context/ImageComponent.tsx +4 -8
  349. package/src/Utility/Context/LinkComponent.tsx +1 -5
  350. package/src/Utility/Drupal/drupal.css +2 -4
  351. package/src/Utility/Elements/breakpoint-loader.ts +4 -10
  352. package/src/Utility/Elements/cookie-compliance.ts +2 -8
  353. package/src/Utility/Elements/disclosure-widget.ts +11 -18
  354. package/src/Utility/Elements/io-loader.ts +4 -6
  355. package/src/Utility/Elements/keyboard.ts +4 -14
  356. package/src/Utility/Hooks/useLocalStorage.ts +5 -18
  357. package/src/Utility/Hooks/useMediaQuery.ts +1 -4
  358. package/src/Utility/Hooks/useToggle.ts +1 -3
  359. package/src/Utility/global.d.ts +1 -5
  360. package/src/Utility/utilities.ts +20 -45
  361. package/src/constants.css +7 -28
  362. package/src/enums.ts +3 -1
  363. package/src/react.ts +5 -21
  364. package/src/tokens.js +2 -2
  365. package/dist/build/chunks/disclosure-widget-DVpnRsTI.js +0 -126
  366. package/dist/build/chunks/disclosure-widget-DVpnRsTI.js.map +0 -1
  367. package/dist/build/chunks/drop-menu.entry-B4TtnC50.js +0 -132
  368. package/dist/build/chunks/drop-menu.entry-B4TtnC50.js.map +0 -1
  369. package/dist/build/chunks/keyboard-rvZ4dfGF.js +0 -104
  370. package/dist/build/chunks/keyboard-rvZ4dfGF.js.map +0 -1
  371. package/dist/build/chunks/polyfills-C-B7iqDG.js.map +0 -1
  372. package/dist/build/chunks/utilities-DXELy_An.js.map +0 -1
  373. package/src/Atom/Text/TextSizes.stories.ts +0 -25
  374. package/src/Atom/Text/text-alignment.twig +0 -5
  375. package/src/Component/Accordion/twig/accordion-example.twig +0 -36
  376. package/src/Component/Tile/README.md +0 -3
  377. package/src/Component/Tile/Tile.stories.ts +0 -49
  378. package/src/Component/Tile/Tile.stories.tsx +0 -35
  379. package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +0 -57
  380. package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +0 -23
@@ -5,6 +5,7 @@ import {
5
5
  Card as CardType,
6
6
  HeadingTypes,
7
7
  ListItemModifiers,
8
+ PopoverPlacementModifier,
8
9
  TagTypes,
9
10
  } from "@pnx-mixtape/ids-shape"
10
11
  import { Icons, BackgroundStyles } from "../../enums"
@@ -25,36 +26,117 @@ export type MxCardType = Omit<CardType, "modifiers"> & {
25
26
  background?: BackgroundStyles
26
27
  }
27
28
 
29
+ /**
30
+ * A card that uses `@container` queries to be horizontal when there's enough space or vertical when not.
31
+ */
28
32
  const meta: Meta<MxCardType> = {
29
33
  tags: ["autodocs", "ids-mvp"],
30
34
  component: Component,
31
35
  args: {
32
- image: Image({
33
- src: "https://picsum.photos/id/56/558/418?grayscale",
34
- alt: "Blurry bubbles",
35
- width: 558,
36
- height: 418,
37
- }),
38
36
  title: Heading({
39
37
  title: "Card title",
40
38
  as: HeadingTypes.THREE,
41
39
  }),
40
+ content:
41
+ "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>",
42
42
  link: Link({
43
43
  href: "#",
44
44
  title: "Find out more",
45
45
  more: true,
46
46
  }),
47
- content:
48
- "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>",
47
+ image: Image({
48
+ src: "https://picsum.photos/id/56/558/418?grayscale",
49
+ alt: "Blurry bubbles",
50
+ width: 558,
51
+ height: 418,
52
+ }),
49
53
  },
50
54
  argTypes: {
51
55
  modifiers: {
56
+ description:
57
+ "The **block** modifier makes the whole card clickable. The **reverse** modifier positions the image on the left.",
52
58
  options: Object.values(ListItemModifiers),
53
- control: "multi-select",
59
+ control: "check",
60
+ table: { type: { summary: "enum" } },
54
61
  },
55
62
  background: {
63
+ description: "Apply a background colour to the card.",
56
64
  options: Object.values(BackgroundStyles),
57
65
  control: "select",
66
+ table: { type: { summary: "enum" } },
67
+ },
68
+ image: {
69
+ description: "Optional [Image](/?path=/docs/atom-image--docs) component.",
70
+ control: "text",
71
+ table: {
72
+ type: { summary: "Image" },
73
+ subcategory: "Card content",
74
+ },
75
+ },
76
+ title: {
77
+ description: "A [Heading](/?path=/docs/atom-heading--docs) component.",
78
+ control: "text",
79
+ type: {
80
+ name: "string",
81
+ required: true,
82
+ },
83
+ table: {
84
+ type: { summary: "Heading" },
85
+ subcategory: "Card content",
86
+ },
87
+ },
88
+ content: {
89
+ description: "Content.",
90
+ control: "text",
91
+ type: {
92
+ name: "string",
93
+ required: true,
94
+ },
95
+ table: {
96
+ type: { summary: "WysiwygText" },
97
+ subcategory: "Card content",
98
+ },
99
+ },
100
+ link: {
101
+ description: "Optional content [Link](/?path=/docs/atom-link--docs).",
102
+ control: "text",
103
+ table: {
104
+ type: { summary: "Link" },
105
+ subcategory: "Card content",
106
+ },
107
+ },
108
+ date: {
109
+ description: "Optional date value (unformatted)",
110
+ type: "string",
111
+ control: "text",
112
+ table: {
113
+ subcategory: "Card content",
114
+ },
115
+ },
116
+ tags: {
117
+ description: "Optional [Tags](/?path=/docs/component-tags--docs).",
118
+ control: "text",
119
+ table: {
120
+ type: { summary: "Tags" },
121
+ subcategory: "Card content",
122
+ },
123
+ },
124
+ linkList: {
125
+ description: "Optional [LinkList](/?path=/docs/component-linklist--docs).",
126
+ control: "text",
127
+ table: {
128
+ type: { summary: "LinkList" },
129
+ subcategory: "Card content",
130
+ },
131
+ },
132
+ icon: {
133
+ description:
134
+ "Optional [Icon](/?path=/docs/atom-icon--docs), should **not** be used in conjunction with Image.",
135
+ control: "text",
136
+ table: {
137
+ type: { summary: "Icon" },
138
+ subcategory: "Card content",
139
+ },
58
140
  },
59
141
  },
60
142
  }
@@ -64,24 +146,36 @@ type Story = StoryObj<MxCardType>
64
146
 
65
147
  export const Card: Story = {}
66
148
 
149
+ /**
150
+ * Make the whole card clickable.
151
+ */
67
152
  export const BlockLink: Story = {
68
153
  args: {
69
154
  modifiers: [ListItemModifiers.BLOCK],
70
155
  },
71
156
  }
72
157
 
158
+ /**
159
+ * Position the image on the right.
160
+ */
73
161
  export const Reverse: Story = {
74
162
  args: {
75
163
  modifiers: [ListItemModifiers.REVERSE],
76
164
  },
77
165
  }
78
166
 
167
+ /**
168
+ * Add a date or other value.
169
+ */
79
170
  export const Date: Story = {
80
171
  args: {
81
172
  date: "25 May 2025",
82
173
  },
83
174
  }
84
175
 
176
+ /**
177
+ * Adds a [Tags](/?path=/docs/component-tags--docs) component
178
+ */
85
179
  export const WithTags: Story = {
86
180
  args: {
87
181
  tags: Tags({
@@ -91,6 +185,9 @@ export const WithTags: Story = {
91
185
  },
92
186
  }
93
187
 
188
+ /**
189
+ * Adds a [LinkList](/?path=/docs/component-linklist--docs) component
190
+ */
94
191
  export const WithLinkList: Story = {
95
192
  args: {
96
193
  link: null,
@@ -122,17 +219,35 @@ export const WithLinkList: Story = {
122
219
  },
123
220
  }
124
221
 
125
- export const WithIcon: Story = {
222
+ /**
223
+ * The Tile version is a simple card with a `box` background, the `block` modifier and no image.
224
+ */
225
+ export const Tile: Story = {
126
226
  args: {
127
- icon: Icon({
128
- icon: Icons.HEART,
227
+ title: Heading({
228
+ title: "Tile title",
229
+ as: HeadingTypes.THREE,
129
230
  }),
231
+ link: Link({
232
+ href: "#",
233
+ title: "Find out more",
234
+ more: true,
235
+ }),
236
+ content: "<p>Tiles are just block cards without an image.</p>",
237
+ background: BackgroundStyles.BOX,
238
+ modifiers: [ListItemModifiers.BLOCK],
130
239
  image: null,
131
240
  },
132
241
  }
133
242
 
134
- export const NoImage: Story = {
243
+ /**
244
+ * The Tile version often also has an [Icon](/?path=/docs/atom-icon--docs).
245
+ */
246
+ export const IconTile: Story = {
135
247
  args: {
136
- image: null,
248
+ ...Tile.args,
249
+ icon: Icon({
250
+ icon: Icons.HEART,
251
+ }),
137
252
  },
138
253
  }
@@ -25,8 +25,8 @@ const meta: Meta<typeof Component> = {
25
25
  <CardContent>
26
26
  <Heading>Key feature or Section Name</Heading>
27
27
  <Text>
28
- A short description to help explain enough about the subject matter
29
- to encourage visitors to learn more.
28
+ A short description to help explain enough about the subject matter to encourage
29
+ visitors to learn more.
30
30
  </Text>
31
31
  <Link more to="http://example.com">
32
32
  Learn More
@@ -2,11 +2,7 @@ import { JSX, PropsWithChildren } from "react"
2
2
  import classNames from "classnames"
3
3
 
4
4
  const CardContent = ({ children }: PropsWithChildren): JSX.Element => {
5
- return (
6
- <div className={classNames("mx-card__content", "mx-vertical-flow")}>
7
- {children}
8
- </div>
9
- )
5
+ return <div className={classNames("mx-card__content", "mx-vertical-flow")}>{children}</div>
10
6
  }
11
7
 
12
8
  export default CardContent
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`Component/Card BlockLink smoke-test 1`] = `
4
4
  <div class="mx-page default">
@@ -8,7 +8,7 @@ exports[`Component/Card BlockLink smoke-test 1`] = `
8
8
  <h3>
9
9
  Card title
10
10
  </h3>
11
- <div class="mx-text--lede">
11
+ <div class="mx-text--lede mx-vertical-flow-flex">
12
12
  <p>
13
13
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
14
14
  </p>
@@ -43,7 +43,7 @@ exports[`Component/Card Card smoke-test 1`] = `
43
43
  <h3>
44
44
  Card title
45
45
  </h3>
46
- <div class="mx-text--lede">
46
+ <div class="mx-text--lede mx-vertical-flow-flex">
47
47
  <p>
48
48
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
49
49
  </p>
@@ -81,7 +81,7 @@ exports[`Component/Card Date smoke-test 1`] = `
81
81
  <h3>
82
82
  Card title
83
83
  </h3>
84
- <div class="mx-text--lede">
84
+ <div class="mx-text--lede mx-vertical-flow-flex">
85
85
  <p>
86
86
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
87
87
  </p>
@@ -108,17 +108,21 @@ exports[`Component/Card Date smoke-test 1`] = `
108
108
  </div>
109
109
  `;
110
110
 
111
- exports[`Component/Card NoImage smoke-test 1`] = `
111
+ exports[`Component/Card IconTile smoke-test 1`] = `
112
112
  <div class="mx-page default">
113
113
  <div class="mx-container">
114
- <article class="mx-card">
114
+ <article class="mx-card mx-card--block mx-background--box">
115
+ <div class="mx-card__icon">
116
+ <span class="mx-icon mx-icon--heart-selected">
117
+ </span>
118
+ </div>
115
119
  <div class="mx-card__content mx-vertical-flow-flex">
116
120
  <h3>
117
- Card title
121
+ Tile title
118
122
  </h3>
119
- <div class="mx-text--lede">
123
+ <div class="mx-text--lede mx-vertical-flow-flex">
120
124
  <p>
121
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
125
+ Tiles are just block cards without an image.
122
126
  </p>
123
127
  </div>
124
128
  <a class="mx-link--more"
@@ -142,7 +146,7 @@ exports[`Component/Card Reverse smoke-test 1`] = `
142
146
  <h3>
143
147
  Card title
144
148
  </h3>
145
- <div class="mx-text--lede">
149
+ <div class="mx-text--lede mx-vertical-flow-flex">
146
150
  <p>
147
151
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
148
152
  </p>
@@ -169,21 +173,17 @@ exports[`Component/Card Reverse smoke-test 1`] = `
169
173
  </div>
170
174
  `;
171
175
 
172
- exports[`Component/Card WithIcon smoke-test 1`] = `
176
+ exports[`Component/Card Tile smoke-test 1`] = `
173
177
  <div class="mx-page default">
174
178
  <div class="mx-container">
175
- <article class="mx-card">
176
- <div class="mx-card__icon">
177
- <span class="mx-icon mx-icon--heart-selected ">
178
- </span>
179
- </div>
179
+ <article class="mx-card mx-card--block mx-background--box">
180
180
  <div class="mx-card__content mx-vertical-flow-flex">
181
181
  <h3>
182
- Card title
182
+ Tile title
183
183
  </h3>
184
- <div class="mx-text--lede">
184
+ <div class="mx-text--lede mx-vertical-flow-flex">
185
185
  <p>
186
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
186
+ Tiles are just block cards without an image.
187
187
  </p>
188
188
  </div>
189
189
  <a class="mx-link--more"
@@ -207,7 +207,7 @@ exports[`Component/Card WithLinkList smoke-test 1`] = `
207
207
  <h3>
208
208
  Card title
209
209
  </h3>
210
- <div class="mx-text--lede">
210
+ <div class="mx-text--lede mx-vertical-flow-flex">
211
211
  <p>
212
212
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
213
213
  </p>
@@ -218,7 +218,7 @@ exports[`Component/Card WithLinkList smoke-test 1`] = `
218
218
  <span>
219
219
  Link one
220
220
  </span>
221
- <span class="mx-icon mx-icon--chevron-right ">
221
+ <span class="mx-icon mx-icon--chevron-right">
222
222
  </span>
223
223
  </a>
224
224
  </li>
@@ -227,7 +227,7 @@ exports[`Component/Card WithLinkList smoke-test 1`] = `
227
227
  <span>
228
228
  Link two
229
229
  </span>
230
- <span class="mx-icon mx-icon--chevron-right ">
230
+ <span class="mx-icon mx-icon--chevron-right">
231
231
  </span>
232
232
  </a>
233
233
  </li>
@@ -236,7 +236,7 @@ exports[`Component/Card WithLinkList smoke-test 1`] = `
236
236
  <span>
237
237
  Link three
238
238
  </span>
239
- <span class="mx-icon mx-icon--chevron-right ">
239
+ <span class="mx-icon mx-icon--chevron-right">
240
240
  </span>
241
241
  </a>
242
242
  </li>
@@ -276,7 +276,7 @@ exports[`Component/Card WithTags smoke-test 1`] = `
276
276
  </span>
277
277
  </li>
278
278
  </ul>
279
- <div class="mx-text--lede">
279
+ <div class="mx-text--lede mx-vertical-flow-flex">
280
280
  <p>
281
281
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
282
282
  </p>
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`Component/Card BlockLink smoke-test 1`] = `
4
4
  <div class="mx-container">
@@ -41,10 +41,7 @@
41
41
  --card-gap: var(--gap-l);
42
42
  --card-alignment: center;
43
43
 
44
- grid-template: "media content" 1fr / var(--media-col, 1fr) var(
45
- --content-col,
46
- 1fr
47
- );
44
+ grid-template: "media content" 1fr / var(--media-col, 1fr) var(--content-col, 1fr);
48
45
 
49
46
  &.mx-card--reversed {
50
47
  grid-template-areas: "content media";
@@ -114,8 +111,7 @@
114
111
  */
115
112
 
116
113
  @layer design-system.components {
117
- .mx-grid:has(> *:nth-child(2):last-child)
118
- > :is(.mx-card, .mx-container:has(.mx-card)) {
114
+ .mx-grid:has(> *:nth-child(2):last-child) > :is(.mx-card, .mx-container:has(.mx-card)) {
119
115
  inline-size: min(100%, var(--max-card-width, 37ch));
120
116
  margin-inline: auto;
121
117
  }
@@ -31,7 +31,7 @@
31
31
  {{ title }}
32
32
  {{ tags }}
33
33
  {% if content is not empty %}
34
- <div class="mx-text--lede">{{ content }}</div>
34
+ <div class="mx-text--lede mx-vertical-flow-flex">{{ content }}</div>
35
35
  {% endif %}
36
36
  {{ linkList }}
37
37
  {{ link }}
@@ -2,11 +2,7 @@ import { Meta, StoryObj } from "@storybook/html-vite"
2
2
  import Component from "./carousel.twig"
3
3
  import "./carousel.css"
4
4
  import "./Elements/Carousel"
5
- import {
6
- Carousel as CarouselType,
7
- HeadingTypes,
8
- ListItemModifiers,
9
- } from "@pnx-mixtape/ids-shape"
5
+ import { Carousel as CarouselType, HeadingTypes, ListItemModifiers } from "@pnx-mixtape/ids-shape"
10
6
 
11
7
  // Deps.
12
8
  import Card from "../Card/card.twig"
@@ -15,10 +11,20 @@ import Heading from "../../Atom/Heading/heading.twig"
15
11
  import Link from "../../Atom/Link/link.twig"
16
12
  import { BackgroundStyles } from "../../enums"
17
13
 
14
+ /**
15
+ * A carousel of GridItems (usually Cards), that natively scrolls.
16
+ *
17
+ * Extra features like Forward/Back buttons and counters can be added with the `Carousel` element javascript (if items exceed the container)
18
+ *
19
+ * The number if items visible can be controlled with CSS by setting the `--inline-size` property (default to 25ch).
20
+ */
18
21
  const meta: Meta<CarouselType> = {
19
22
  tags: ["autodocs", "ids-mvp"],
20
23
  component: Component,
21
24
  args: {
25
+ counter: false,
26
+ pagination: false,
27
+ loop: false,
22
28
  items: [
23
29
  Card({
24
30
  title: Heading({
@@ -176,9 +182,42 @@ const meta: Meta<CarouselType> = {
176
182
  modifiers: [ListItemModifiers.BLOCK],
177
183
  }),
178
184
  ],
179
- loop: false,
180
- pagination: false,
181
- counter: false,
185
+ },
186
+ argTypes: {
187
+ items: {
188
+ description:
189
+ "A list of `GridItem` objects, usually [Cards](/?path=/docs/component-card--docs) or [ContentBlocks](/?path=/docs/component-contentblock--docs).",
190
+ type: {
191
+ name: "other",
192
+ required: true,
193
+ value: "array",
194
+ },
195
+ table: {
196
+ type: { summary: "GridItem[]" },
197
+ },
198
+ },
199
+ loop: {
200
+ description:
201
+ "Loop back to the start when the end has been reached. Requires the `Carousel` javascript.",
202
+ type: "boolean",
203
+ table: {
204
+ defaultValue: { summary: "false" },
205
+ },
206
+ },
207
+ pagination: {
208
+ description: "Adds numbered pagination. Requires the `Carousel` javascript.",
209
+ type: "boolean",
210
+ table: {
211
+ defaultValue: { summary: "false" },
212
+ },
213
+ },
214
+ counter: {
215
+ description: "Adds counter dot navigation. Requires the `Carousel` javascript.",
216
+ type: "boolean",
217
+ table: {
218
+ defaultValue: { summary: "false" },
219
+ },
220
+ },
182
221
  },
183
222
  }
184
223
 
@@ -187,15 +226,29 @@ type Story = StoryObj<CarouselType>
187
226
 
188
227
  export const Carousel: Story = {}
189
228
 
229
+ /**
230
+ * Display counter dot navigation.
231
+ */
190
232
  export const Counters: Story = {
191
233
  args: {
192
234
  counter: true,
193
235
  },
194
236
  }
195
237
 
238
+ /**
239
+ * Display numbered pagination.
240
+ */
196
241
  export const Paginated: Story = {
197
242
  args: {
198
243
  pagination: true,
244
+ },
245
+ }
246
+
247
+ /**
248
+ * Loop back to start when the end is reached and the next button is clicked.
249
+ */
250
+ export const Loop: Story = {
251
+ args: {
199
252
  loop: true,
200
253
  },
201
254
  }
@@ -32,18 +32,14 @@ export default class Carousel extends HTMLElement {
32
32
  const { signal }: AbortController = this.controller
33
33
  if (this.prev) {
34
34
  this.prev.disabled = true
35
- this.prev.addEventListener(
36
- "click",
37
- () => this.handleNavigation(this.activePage - 1),
38
- { signal },
39
- )
35
+ this.prev.addEventListener("click", () => this.handleNavigation(this.activePage - 1), {
36
+ signal,
37
+ })
40
38
  }
41
39
  if (this.next)
42
- this.next.addEventListener(
43
- "click",
44
- () => this.handleNavigation(this.activePage + 1),
45
- { signal },
46
- )
40
+ this.next.addEventListener("click", () => this.handleNavigation(this.activePage + 1), {
41
+ signal,
42
+ })
47
43
  this.list.addEventListener("scroll", this.handleScroll, { signal })
48
44
 
49
45
  if (this.pagination) {
@@ -56,8 +52,7 @@ export default class Carousel extends HTMLElement {
56
52
  })
57
53
  }
58
54
 
59
- const items: NodeListOf<HTMLLIElement> =
60
- this.list.querySelectorAll(":scope > li")
55
+ const items: NodeListOf<HTMLLIElement> = this.list.querySelectorAll(":scope > li")
61
56
  this.itemMap = new Map()
62
57
  const iO = new IntersectionObserver(
63
58
  entries => {
@@ -116,8 +111,7 @@ export default class Carousel extends HTMLElement {
116
111
  let isEnd = false
117
112
  if (this.prev) this.prev.disabled = this.list.scrollLeft < 1
118
113
  if (this.next || this.pagination) {
119
- isEnd =
120
- this.list.scrollLeft === this.list.scrollWidth - this.list.offsetWidth
114
+ isEnd = this.list.scrollLeft === this.list.scrollWidth - this.list.offsetWidth
121
115
  }
122
116
  if (this.next) {
123
117
  if (!this.loop) {
@@ -150,10 +144,7 @@ export default class Carousel extends HTMLElement {
150
144
 
151
145
  handleScroll = () => {
152
146
  window.clearTimeout(this.debounced)
153
- this.debounced = setTimeout(
154
- this.handleDisabled,
155
- this.pagination ? 100 : 200,
156
- )
147
+ this.debounced = setTimeout(this.handleDisabled, this.pagination ? 100 : 200)
157
148
  }
158
149
 
159
150
  handleOverflow = () => {
@@ -232,7 +223,7 @@ export default class Carousel extends HTMLElement {
232
223
  }
233
224
  }
234
225
 
235
- customElements.define("mx-carousel", Carousel)
226
+ if (!customElements.get("mx-carousel")) customElements.define("mx-carousel", Carousel)
236
227
 
237
228
  declare global {
238
229
  interface HTMLElementTagNameMap {