@pnx-mixtape/mxds 0.0.22 → 0.0.24

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 (399) hide show
  1. package/.storybook/decorators.ts +7 -0
  2. package/.storybook/main.ts +21 -0
  3. package/.storybook/manager.ts +6 -0
  4. package/.storybook/preview.ts +60 -0
  5. package/.storybook/public/demo-logo.svg +4 -0
  6. package/.storybook/public/design-system.svg +1 -0
  7. package/.storybook/public/favicon.svg +7 -0
  8. package/.storybook/public/mixtape-logo.png +0 -0
  9. package/.storybook/public/mixtape.webp +0 -0
  10. package/.storybook/public/pinto.png +0 -0
  11. package/.storybook/public/pinto.svg +1 -0
  12. package/.storybook/public/xb.png +0 -0
  13. package/.storybook/public/xb.svg +1 -0
  14. package/.storybook/src/global.d.ts +16 -0
  15. package/.storybook/src/theme.ts +8 -0
  16. package/.storybook/storybook.css +35 -0
  17. package/.storybook/test-runner.ts +77 -0
  18. package/.storybook/theme-demo.css +89 -0
  19. package/dist/build/accordion.entry.js +32 -43
  20. package/dist/build/accordion.entry.js.map +1 -1
  21. package/dist/build/base.css +17 -39
  22. package/dist/build/button.css +9 -10
  23. package/dist/build/chunks/{Accordion-O-huO4At.js → Accordion-D1HQ0FDq.js} +23 -21
  24. package/dist/build/chunks/{Accordion-O-huO4At.js.map → Accordion-D1HQ0FDq.js.map} +1 -1
  25. package/dist/build/chunks/disclosure-widget-CdjCdx7t.js +129 -0
  26. package/dist/build/chunks/disclosure-widget-CdjCdx7t.js.map +1 -0
  27. package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js +70 -0
  28. package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js.map +1 -0
  29. package/dist/build/chunks/{polyfills-C-B7iqDG.js → polyfills-DnrsypYs.js} +35 -26
  30. package/dist/build/chunks/polyfills-DnrsypYs.js.map +1 -0
  31. package/dist/build/chunks/popover.entry-BQvyR0d5.js +38 -0
  32. package/dist/build/chunks/popover.entry-BQvyR0d5.js.map +1 -0
  33. package/dist/build/chunks/{utilities-DXELy_An.js → utilities-Ci7wwNeg.js} +9 -106
  34. package/dist/build/chunks/utilities-Ci7wwNeg.js.map +1 -0
  35. package/dist/build/constants.css +10 -31
  36. package/dist/build/dialog.entry.js +23 -31
  37. package/dist/build/dialog.entry.js.map +1 -1
  38. package/dist/build/drop-menu.entry.js +1 -1
  39. package/dist/build/drupal.css +5 -9
  40. package/dist/build/filters.entry.js +54 -50
  41. package/dist/build/filters.entry.js.map +1 -1
  42. package/dist/build/form.css +12 -26
  43. package/dist/build/global-alert.entry.js +26 -19
  44. package/dist/build/global-alert.entry.js.map +1 -1
  45. package/dist/build/grid.css +3 -9
  46. package/dist/build/header.entry.js +93 -88
  47. package/dist/build/header.entry.js.map +1 -1
  48. package/dist/build/icon.css +3 -3
  49. package/dist/build/in-page-navigation.entry.js +16 -12
  50. package/dist/build/in-page-navigation.entry.js.map +1 -1
  51. package/dist/build/navigation.css +9 -23
  52. package/dist/build/navigation.entry.js +148 -50
  53. package/dist/build/navigation.entry.js.map +1 -1
  54. package/dist/build/page.css +1 -1
  55. package/dist/build/popover.css +119 -0
  56. package/dist/build/popover.entry.js +2 -0
  57. package/dist/build/popover.entry.js.map +1 -0
  58. package/dist/build/section.css +1 -1
  59. package/dist/build/sticky.entry.js +11 -12
  60. package/dist/build/sticky.entry.js.map +1 -1
  61. package/dist/build/tabs.entry.js +108 -91
  62. package/dist/build/tabs.entry.js.map +1 -1
  63. package/dist/build/utility-list.css +43 -0
  64. package/dist/build/utility-list.entry.js +80 -0
  65. package/dist/build/utility-list.entry.js.map +1 -0
  66. package/package.json +13 -12
  67. package/src/Atom/{Base.mdx → Atom.mdx} +19 -19
  68. package/src/Atom/Background/{Backgrounds.stories.ts → Background.stories.ts} +23 -5
  69. package/src/Atom/Background/__snapshots__/{Backgrounds.stories.ts.snap → Background.stories.ts.snap} +86 -26
  70. package/src/Atom/Background/_background.css +9 -12
  71. package/src/Atom/Background/backgrounds.twig +6 -4
  72. package/src/Atom/Blockquote/_blockquote.css +1 -2
  73. package/src/Atom/Button/Button.stories.ts +128 -20
  74. package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +75 -11
  75. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +1 -1
  76. package/src/Atom/Button/_buttons-styles.css +18 -6
  77. package/src/Atom/Button/_buttons.css +4 -5
  78. package/src/Atom/DefinitionList/DefinitionList.stories.ts +20 -3
  79. package/src/Atom/DefinitionList/DefinitionList.stories.tsx +3 -9
  80. package/src/Atom/DefinitionList/DefinitionList.tsx +3 -4
  81. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +1 -1
  82. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
  83. package/src/Atom/Heading/Heading.stories.ts +49 -7
  84. package/src/Atom/Heading/Heading.tsx +1 -6
  85. package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +9 -1
  86. package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
  87. package/src/Atom/Heading/_headings.css +1 -2
  88. package/src/Atom/Icon/Icon.mdx +5 -1
  89. package/src/Atom/Icon/Icon.stories.ts +76 -6
  90. package/src/Atom/Icon/Icon.tsx +1 -8
  91. package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +18 -4
  92. package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +1 -1
  93. package/src/Atom/Icon/_extended-set.css +0 -8
  94. package/src/Atom/Icon/_icon.css +9 -1
  95. package/src/Atom/Image/Image.stories.ts +4 -3
  96. package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
  97. package/src/Atom/Link/Link.stories.ts +74 -7
  98. package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +4 -4
  99. package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +1 -1
  100. package/src/Atom/Link/_links.css +1 -0
  101. package/src/Atom/Media/Media.stories.ts +34 -5
  102. package/src/Atom/Media/Media.tsx +1 -6
  103. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +2 -2
  104. package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +1 -1
  105. package/src/Atom/Media/_media.css +2 -10
  106. package/src/Atom/Spacing/Spacing.stories.ts +45 -31
  107. package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -4
  108. package/src/Atom/Spacing/spacing.twig +5 -2
  109. package/src/Atom/Table/Table.stories.ts +0 -1
  110. package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +1 -1
  111. package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
  112. package/src/Atom/Table/_table.css +1 -2
  113. package/src/Atom/Text/Text.stories.ts +62 -0
  114. package/src/Atom/Text/__snapshots__/{TextSizes.stories.ts.snap → Text.stories.ts.snap} +14 -27
  115. package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
  116. package/src/Atom/Text/_text-sizes.css +2 -4
  117. package/src/Atom/Text/text-style.twig +11 -1
  118. package/src/Atom/Text/text-styles-example.twig +2 -16
  119. package/src/Atom/Video/Video.stories.ts +6 -4
  120. package/src/Atom/Video/Video.tsx +1 -5
  121. package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +1 -1
  122. package/src/Atom/_generic.css +2 -4
  123. package/src/Atom/_hr.css +1 -2
  124. package/src/Component/Accordion/Accordion.stories.ts +26 -8
  125. package/src/Component/Accordion/Accordion.stories.tsx +8 -10
  126. package/src/Component/Accordion/Accordion.tsx +2 -13
  127. package/src/Component/Accordion/AccordionItem.stories.ts +90 -0
  128. package/src/Component/Accordion/Components/AccordionContent.tsx +1 -5
  129. package/src/Component/Accordion/Components/AccordionTitle.tsx +1 -4
  130. package/src/Component/Accordion/Elements/Accordion.ts +1 -1
  131. package/src/Component/Accordion/Elements/AccordionDiv.ts +4 -11
  132. package/src/Component/Accordion/Elements/AccordionGroup.ts +10 -24
  133. package/src/Component/Accordion/Elements/AccordionMobile.ts +4 -4
  134. package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +17 -6
  135. package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
  136. package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +90 -0
  137. package/src/Component/Accordion/accordion.css +7 -5
  138. package/src/Component/Accordion/twig/accordion-div.twig +13 -11
  139. package/src/Component/Accordion/twig/accordion-mobile.twig +13 -11
  140. package/src/Component/Breadcrumb/Breadcrumb.stories.ts +14 -0
  141. package/src/Component/Breadcrumb/Breadcrumb.tsx +2 -12
  142. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
  143. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +1 -1
  144. package/src/Component/Breadcrumb/breadcrumb.css +1 -4
  145. package/src/Component/Callout/Callout.stories.ts +20 -0
  146. package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +1 -1
  147. package/src/Component/Callout/callout.css +1 -2
  148. package/src/Component/Card/Card.stories.ts +129 -14
  149. package/src/Component/Card/Card.stories.tsx +2 -2
  150. package/src/Component/Card/Components/CardContent.tsx +1 -5
  151. package/src/Component/Card/__snapshots__/Card.stories.ts.snap +16 -16
  152. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +1 -1
  153. package/src/Component/Card/card.css +2 -6
  154. package/src/Component/Carousel/Carousel.stories.ts +61 -8
  155. package/src/Component/Carousel/Elements/Carousel.ts +10 -19
  156. package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +288 -2
  157. package/src/Component/Carousel/carousel.css +1 -2
  158. package/src/Component/ContentBlock/Components/ContentBlockContent.tsx +1 -5
  159. package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -4
  160. package/src/Component/ContentBlock/ContentBlock.stories.ts +63 -13
  161. package/src/Component/ContentBlock/ContentBlock.stories.tsx +2 -2
  162. package/src/Component/ContentBlock/ContentBlock.tsx +1 -5
  163. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +11 -11
  164. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
  165. package/src/Component/Dialog/Dialog.stories.ts +78 -21
  166. package/src/Component/Dialog/Dialog.stories.tsx +2 -3
  167. package/src/Component/Dialog/Elements/Dialog.ts +7 -16
  168. package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +8 -11
  169. package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
  170. package/src/Component/Dialog/dialog.css +1 -2
  171. package/src/Component/Dialog/dialog.twig +1 -1
  172. package/src/Component/DropMenu/Components/DropMenuContext.tsx +4 -12
  173. package/src/Component/DropMenu/DropMenu.stories.ts +60 -1
  174. package/src/Component/DropMenu/DropMenu.tsx +2 -7
  175. package/src/Component/DropMenu/Elements/DropMenu.ts +21 -91
  176. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +53 -11
  177. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
  178. package/src/Component/DropMenu/drop-menu.css +13 -41
  179. package/src/Component/DropMenu/drop-menu.twig +8 -6
  180. package/src/Component/Filters/Elements/Filters.ts +7 -11
  181. package/src/Component/Filters/FilterItem.stories.ts +180 -0
  182. package/src/Component/Filters/Filters.stories.ts +83 -8
  183. package/src/Component/Filters/__snapshots__/FilterItem.stories.ts.snap +135 -0
  184. package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +43 -41
  185. package/src/Component/Filters/filter-item.twig +1 -1
  186. package/src/Component/Filters/filters.css +33 -17
  187. package/src/Component/GlobalAlert/Elements/ClosableAlert.ts +8 -7
  188. package/src/Component/GlobalAlert/GlobalAlert.stories.ts +60 -12
  189. package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +1 -2
  190. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +8 -6
  191. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +3 -3
  192. package/src/Component/HeroBanner/HeroBanner.stories.ts +84 -7
  193. package/src/Component/HeroBanner/HeroBanner.stories.tsx +4 -4
  194. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +91 -99
  195. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
  196. package/src/Component/HeroSearch/HeroSearch.stories.ts +23 -6
  197. package/src/Component/HeroSearch/HeroSearch.stories.tsx +4 -4
  198. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +142 -148
  199. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +1 -1
  200. package/src/Component/InPageAlert/InPageAlert.stories.ts +76 -8
  201. package/src/Component/InPageAlert/InPageAlert.stories.tsx +1 -2
  202. package/src/Component/InPageAlert/InPageAlert.tsx +1 -4
  203. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +80 -2
  204. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +1 -1
  205. package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +7 -9
  206. package/src/Component/InPageNavigation/Hooks/useInPageNavigation.ts +3 -5
  207. package/src/Component/InPageNavigation/InPageNavigation.stories.ts +44 -9
  208. package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +32 -40
  209. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +152 -5
  210. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
  211. package/src/Component/LinkList/LinkList.stories.ts +23 -0
  212. package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +8 -8
  213. package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +1 -1
  214. package/src/Component/LinkList/link-list.css +1 -2
  215. package/src/Component/ListItem/Components/ListItemContent.tsx +1 -5
  216. package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -4
  217. package/src/Component/ListItem/ListItem.stories.ts +91 -11
  218. package/src/Component/ListItem/ListItem.stories.tsx +6 -7
  219. package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +1 -1
  220. package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +1 -1
  221. package/src/Component/ListItem/list-item.css +1 -2
  222. package/src/Component/Navigation/Components/DropdownLevel.tsx +5 -13
  223. package/src/Component/Navigation/Elements/Navigation.ts +6 -13
  224. package/src/Component/Navigation/Navigation.stories.ts +48 -0
  225. package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
  226. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
  227. package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +1 -1
  228. package/src/Component/Navigation/_navigation-collapsible.css +2 -4
  229. package/src/Component/Navigation/_navigation-dropdown.css +2 -6
  230. package/src/Component/Navigation/_navigation-mega.css +1 -4
  231. package/src/Component/Navigation/_navigation.css +1 -4
  232. package/src/Component/Pagination/Components/PaginationContext.tsx +5 -19
  233. package/src/Component/Pagination/Components/PaginationItem.tsx +1 -5
  234. package/src/Component/Pagination/Pagination.stories.ts +28 -0
  235. package/src/Component/Pagination/Pagination.tsx +3 -11
  236. package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +3 -3
  237. package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
  238. package/src/Component/Pagination/pagination.css +1 -4
  239. package/src/Component/Popover/Elements/Popover.ts +55 -0
  240. package/src/Component/Popover/Popover.stories.ts +304 -0
  241. package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +534 -0
  242. package/src/Component/{DropMenu → Popover}/polyfills.js +6 -4
  243. package/src/Component/Popover/popover.css +113 -0
  244. package/src/Component/Popover/popover.entry.js +1 -0
  245. package/src/Component/Popover/popover.twig +27 -0
  246. package/src/Component/ResultsBar/Components/ResultsBarInfo.tsx +2 -7
  247. package/src/Component/ResultsBar/Components/ResultsBarSort.tsx +1 -6
  248. package/src/Component/ResultsBar/ResultsBar.stories.ts +34 -4
  249. package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +3 -3
  250. package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +1 -1
  251. package/src/Component/SideNavigation/SideNavigation.stories.ts +40 -0
  252. package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +1 -1
  253. package/src/Component/SideNavigation/side-navigation.css +3 -6
  254. package/src/Component/SocialLinks/SocialLinks.stories.ts +20 -0
  255. package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +5 -5
  256. package/src/Component/SocialShare/SocialShare.stories.ts +37 -0
  257. package/src/Component/SocialShare/SocialShare.tsx +2 -4
  258. package/src/Component/SocialShare/__snapshots__/SocialShare.stories.ts.snap +40 -0
  259. package/src/Component/SocialShare/__snapshots__/SocialShare.stories.tsx.snap +1 -1
  260. package/src/Component/SocialShare/social-share.twig +34 -0
  261. package/src/Component/Steps/StepItem.stories.ts +48 -0
  262. package/src/Component/Steps/Steps.stories.ts +82 -13
  263. package/src/Component/Steps/__snapshots__/StepItem.stories.ts.snap +31 -0
  264. package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +97 -16
  265. package/src/Component/Steps/steps.css +8 -14
  266. package/src/Component/Sticky/Elements/Sticky.ts +3 -8
  267. package/src/Component/Sticky/Sticky.stories.ts +35 -3
  268. package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +1 -1
  269. package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
  270. package/src/Component/Sticky/sticky.twig +1 -1
  271. package/src/Component/Tabs/Components/Tab.tsx +2 -8
  272. package/src/Component/Tabs/Components/TabPanel.tsx +1 -5
  273. package/src/Component/Tabs/Elements/Tabs.ts +21 -31
  274. package/src/Component/Tabs/TabItem.stories.ts +52 -0
  275. package/src/Component/Tabs/Tabs.stories.ts +51 -8
  276. package/src/Component/Tabs/Tabs.tsx +6 -22
  277. package/src/Component/Tabs/__snapshots__/TabItem.stories.ts.snap +12 -0
  278. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +127 -11
  279. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
  280. package/src/Component/Tabs/tab-item.twig +1 -2
  281. package/src/Component/Tabs/tabs.css +56 -59
  282. package/src/Component/Tag/Tag.stories.ts +30 -0
  283. package/src/Component/Tag/Tag.tsx +1 -5
  284. package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +1 -1
  285. package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
  286. package/src/Component/Tag/tag.css +1 -4
  287. package/src/Component/UtilityList/Elements/UtilityList.ts +110 -0
  288. package/src/Component/UtilityList/UtilityList.stories.ts +72 -0
  289. package/src/Component/UtilityList/__snapshots__/UtilityList.stories.ts.snap +274 -0
  290. package/src/Component/UtilityList/utility-list.css +40 -0
  291. package/src/Component/UtilityList/utility-list.entry.js +1 -0
  292. package/src/Component/UtilityList/utility-list.twig +66 -0
  293. package/src/Form/Checkbox/FormCheckbox.stories.tsx +1 -3
  294. package/src/Form/Checkbox/FormCheckbox.tsx +4 -25
  295. package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +3 -3
  296. package/src/Form/Description/Description.stories.ts +1 -2
  297. package/src/Form/Description/FormStatus.stories.ts +1 -4
  298. package/src/Form/Description/__snapshots__/Description.stories.ts.snap +1 -1
  299. package/src/Form/Description/__snapshots__/FormDescription.stories.tsx.snap +1 -1
  300. package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +3 -3
  301. package/src/Form/Form/Form.tsx +1 -3
  302. package/src/Form/Form/__snapshots__/Form.stories.tsx.snap +1 -1
  303. package/src/Form/Form/__snapshots__/FormTitle.stories.tsx.snap +1 -1
  304. package/src/Form/FormItem/FormItem.stories.ts +3 -9
  305. package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +18 -18
  306. package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +1 -1
  307. package/src/Form/Label/FormLabel.tsx +1 -5
  308. package/src/Form/Label/__snapshots__/FormLabel.stories.tsx.snap +1 -1
  309. package/src/Form/Label/__snapshots__/Label.stories.ts.snap +3 -3
  310. package/src/Form/Radio/FormRadio.stories.tsx +1 -3
  311. package/src/Form/Radio/FormRadio.tsx +4 -25
  312. package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +9 -9
  313. package/src/Form/Search/__snapshots__/Search.stories.ts.snap +1 -1
  314. package/src/Form/Select/FormSelect.tsx +3 -9
  315. package/src/Form/Select/__snapshots__/FormSelect.stories.tsx.snap +1 -1
  316. package/src/Form/Select/__snapshots__/Select.stories.ts.snap +2 -2
  317. package/src/Form/TextInput/FormText.tsx +3 -9
  318. package/src/Form/TextInput/InputDivider.stories.ts +0 -1
  319. package/src/Form/TextInput/TextInput.stories.ts +1 -4
  320. package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +1 -1
  321. package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +2 -2
  322. package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +3 -3
  323. package/src/Form/Textarea/FormTextarea.tsx +3 -9
  324. package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +1 -1
  325. package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +2 -2
  326. package/src/Form/form.css +6 -14
  327. package/src/Introduction.mdx +1 -2
  328. package/src/Layout/Footer/Footer.stories.ts +1 -5
  329. package/src/Layout/Footer/Footer.stories.tsx +2 -3
  330. package/src/Layout/Footer/Footer.tsx +3 -12
  331. package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +4 -4
  332. package/src/Layout/Footer/__snapshots__/Footer.stories.tsx.snap +1 -1
  333. package/src/Layout/Grid/Grid.stories.ts +40 -8
  334. package/src/Layout/Grid/Grid.tsx +1 -2
  335. package/src/Layout/Grid/GridItem.stories.ts +63 -0
  336. package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +29 -4
  337. package/src/Layout/Grid/__snapshots__/Grid.stories.tsx.snap +1 -1
  338. package/src/Layout/Grid/__snapshots__/GridItem.stories.ts.snap +19 -0
  339. package/src/Layout/Grid/grid-item.twig +3 -9
  340. package/src/Layout/Grid/grid.css +1 -4
  341. package/src/Layout/Header/Elements/GlobalToggle.ts +9 -29
  342. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +5 -5
  343. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
  344. package/src/Layout/Masthead/Masthead.stories.ts +1 -4
  345. package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +3 -3
  346. package/src/Layout/Page/Page.stories.tsx +2 -2
  347. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +3 -3
  348. package/src/Layout/Page/page.css +2 -10
  349. package/src/Layout/Section/Background.stories.ts +14 -39
  350. package/src/Layout/Section/Breakouts.stories.ts +3 -0
  351. package/src/Layout/Section/Flow.stories.ts +3 -0
  352. package/src/Layout/Section/Section.stories.ts +93 -11
  353. package/src/Layout/Section/Section.tsx +3 -13
  354. package/src/Layout/Section/SectionGrid.tsx +2 -9
  355. package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +4 -4
  356. package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +1 -1
  357. package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +1 -1
  358. package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +93 -3
  359. package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +1 -1
  360. package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +1 -1
  361. package/src/Layout/Section/section.css +2 -5
  362. package/src/Layout/Section/section.twig +1 -3
  363. package/src/Layout/Sidebar/Sidebar.stories.ts +46 -4
  364. package/src/Layout/Sidebar/Sidebar.tsx +1 -3
  365. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +4 -4
  366. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +1 -1
  367. package/src/Utility/Context/ImageComponent.tsx +4 -8
  368. package/src/Utility/Context/LinkComponent.tsx +1 -5
  369. package/src/Utility/Drupal/drupal.css +2 -4
  370. package/src/Utility/Elements/breakpoint-loader.ts +4 -10
  371. package/src/Utility/Elements/cookie-compliance.ts +2 -8
  372. package/src/Utility/Elements/disclosure-widget.ts +11 -18
  373. package/src/Utility/Elements/io-loader.ts +4 -6
  374. package/src/Utility/Elements/keyboard.ts +4 -14
  375. package/src/Utility/Hooks/useLocalStorage.ts +5 -18
  376. package/src/Utility/Hooks/useMediaQuery.ts +1 -4
  377. package/src/Utility/Hooks/useToggle.ts +1 -3
  378. package/src/Utility/global.d.ts +1 -5
  379. package/src/Utility/utilities.ts +20 -45
  380. package/src/constants.css +115 -135
  381. package/src/enums.ts +4 -1
  382. package/src/react.ts +5 -21
  383. package/src/tokens.js +27 -20
  384. package/dist/build/chunks/disclosure-widget-DVpnRsTI.js +0 -126
  385. package/dist/build/chunks/disclosure-widget-DVpnRsTI.js.map +0 -1
  386. package/dist/build/chunks/drop-menu.entry-B4TtnC50.js +0 -132
  387. package/dist/build/chunks/drop-menu.entry-B4TtnC50.js.map +0 -1
  388. package/dist/build/chunks/keyboard-rvZ4dfGF.js +0 -104
  389. package/dist/build/chunks/keyboard-rvZ4dfGF.js.map +0 -1
  390. package/dist/build/chunks/polyfills-C-B7iqDG.js.map +0 -1
  391. package/dist/build/chunks/utilities-DXELy_An.js.map +0 -1
  392. package/src/Atom/Text/TextSizes.stories.ts +0 -25
  393. package/src/Atom/Text/text-alignment.twig +0 -5
  394. package/src/Component/Accordion/twig/accordion-example.twig +0 -36
  395. package/src/Component/Tile/README.md +0 -3
  396. package/src/Component/Tile/Tile.stories.ts +0 -49
  397. package/src/Component/Tile/Tile.stories.tsx +0 -35
  398. package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +0 -57
  399. package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +0 -23
@@ -1,40 +1,38 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
- exports[`Component/HeroSearch HeroBanner smoke-test 1`] = `
3
+ exports[`Component/HeroSearch HeroSearch smoke-test 1`] = `
4
4
  <div class="mx-page default">
5
- <div class="mx-page default">
6
- <div class="mx-hero-banner mx-hero-search ">
7
- <div class="mx-hero-banner__inner">
8
- <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
9
- <h1>
10
- Hero banner title
11
- </h1>
12
- <p class="mx-text--lede">
13
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
14
- </p>
15
- <form class="mx-form mx-form--inline-button"
16
- role="search"
17
- action="#search"
5
+ <div class="mx-hero-banner mx-hero-search">
6
+ <div class="mx-hero-banner__inner">
7
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
8
+ <h1>
9
+ Hero banner title
10
+ </h1>
11
+ <p class="mx-text--lede">
12
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
13
+ </p>
14
+ <form class="mx-form mx-form--inline-button"
15
+ role="search"
16
+ action="#search"
17
+ >
18
+ <input class="mx-input__text "
19
+ id="search-keyword"
20
+ name="search-form"
21
+ type="search"
22
+ value
23
+ aria-label="Search by keywords"
24
+ placeholder="Keywords..."
18
25
  >
19
- <input class="mx-input__text "
20
- id="search-keyword"
21
- name="search-form"
22
- type="search"
23
- value
24
- aria-label="Search by keywords"
25
- placeholder="Keywords..."
26
- >
27
- <button class="mx-button mx-button--icon-only"
28
- type="submit"
29
- >
30
- <span class="mx-icon mx-icon--search">
31
- </span>
32
- <span class="sr-only">
33
- Search
34
- </span>
35
- </button>
36
- </form>
37
- </div>
26
+ <button class="mx-button mx-button--icon-only"
27
+ type="submit"
28
+ >
29
+ <span class="mx-icon mx-icon--search">
30
+ </span>
31
+ <span class="sr-only">
32
+ Search
33
+ </span>
34
+ </button>
35
+ </form>
38
36
  </div>
39
37
  </div>
40
38
  </div>
@@ -43,39 +41,37 @@ exports[`Component/HeroSearch HeroBanner smoke-test 1`] = `
43
41
 
44
42
  exports[`Component/HeroSearch Highlight smoke-test 1`] = `
45
43
  <div class="mx-page default">
46
- <div class="mx-page default">
47
- <div class="mx-hero-banner mx-hero-search mx-hero-banner--hero mx-background--primary">
48
- <div class="mx-hero-banner__inner">
49
- <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
50
- <h1>
51
- Hero banner title
52
- </h1>
53
- <p class="mx-text--lede">
54
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
55
- </p>
56
- <form class="mx-form mx-form--inline-button"
57
- role="search"
58
- action="#search"
44
+ <div class="mx-hero-banner mx-hero-search mx-hero-banner--hero mx-background--primary">
45
+ <div class="mx-hero-banner__inner">
46
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
47
+ <h1>
48
+ Hero banner title
49
+ </h1>
50
+ <p class="mx-text--lede">
51
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
52
+ </p>
53
+ <form class="mx-form mx-form--inline-button"
54
+ role="search"
55
+ action="#search"
56
+ >
57
+ <input class="mx-input__text "
58
+ id="search-keyword"
59
+ name="search-form"
60
+ type="search"
61
+ value
62
+ aria-label="Search by keywords"
63
+ placeholder="Keywords..."
59
64
  >
60
- <input class="mx-input__text "
61
- id="search-keyword"
62
- name="search-form"
63
- type="search"
64
- value
65
- aria-label="Search by keywords"
66
- placeholder="Keywords..."
67
- >
68
- <button class="mx-button mx-button--icon-only"
69
- type="submit"
70
- >
71
- <span class="mx-icon mx-icon--search">
72
- </span>
73
- <span class="sr-only">
74
- Search
75
- </span>
76
- </button>
77
- </form>
78
- </div>
65
+ <button class="mx-button mx-button--icon-only"
66
+ type="submit"
67
+ >
68
+ <span class="mx-icon mx-icon--search">
69
+ </span>
70
+ <span class="sr-only">
71
+ Search
72
+ </span>
73
+ </button>
74
+ </form>
79
75
  </div>
80
76
  </div>
81
77
  </div>
@@ -84,91 +80,89 @@ exports[`Component/HeroSearch Highlight smoke-test 1`] = `
84
80
 
85
81
  exports[`Component/HeroSearch WithLinkList smoke-test 1`] = `
86
82
  <div class="mx-page default">
87
- <div class="mx-page default">
88
- <div class="mx-hero-banner mx-hero-search ">
89
- <div class="mx-hero-banner__inner">
90
- <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
91
- <h1>
92
- Hero banner title
93
- </h1>
94
- <p class="mx-text--lede">
95
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
96
- </p>
97
- <form class="mx-form mx-form--inline-button"
98
- role="search"
99
- action="#search"
83
+ <div class="mx-hero-banner mx-hero-search">
84
+ <div class="mx-hero-banner__inner">
85
+ <div class="mx-hero-banner__content mx-vertical-flow-flex mx-section--xl">
86
+ <h1>
87
+ Hero banner title
88
+ </h1>
89
+ <p class="mx-text--lede">
90
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
91
+ </p>
92
+ <form class="mx-form mx-form--inline-button"
93
+ role="search"
94
+ action="#search"
95
+ >
96
+ <input class="mx-input__text "
97
+ id="search-keyword"
98
+ name="search-form"
99
+ type="search"
100
+ value
101
+ aria-label="Search by keywords"
102
+ placeholder="Keywords..."
100
103
  >
101
- <input class="mx-input__text "
102
- id="search-keyword"
103
- name="search-form"
104
- type="search"
105
- value
106
- aria-label="Search by keywords"
107
- placeholder="Keywords..."
108
- >
109
- <button class="mx-button mx-button--icon-only"
110
- type="submit"
111
- >
112
- <span class="mx-icon mx-icon--search">
104
+ <button class="mx-button mx-button--icon-only"
105
+ type="submit"
106
+ >
107
+ <span class="mx-icon mx-icon--search">
108
+ </span>
109
+ <span class="sr-only">
110
+ Search
111
+ </span>
112
+ </button>
113
+ </form>
114
+ </div>
115
+ <div class="mx-hero-banner__aside mx-section--xl">
116
+ <h2 class="mx-heading--m">
117
+ Popular searches
118
+ </h2>
119
+ <ul class="mx-link-list">
120
+ <li>
121
+ <a href="#">
122
+ <span>
123
+ Link one
124
+ </span>
125
+ <span class="mx-icon mx-icon--chevron-right">
126
+ </span>
127
+ </a>
128
+ </li>
129
+ <li>
130
+ <a href="#">
131
+ <span>
132
+ Link two
133
+ </span>
134
+ <span class="mx-icon mx-icon--chevron-right">
135
+ </span>
136
+ </a>
137
+ </li>
138
+ <li>
139
+ <a href="#">
140
+ <span>
141
+ Link three
142
+ </span>
143
+ <span class="mx-icon mx-icon--chevron-right">
144
+ </span>
145
+ </a>
146
+ </li>
147
+ <li>
148
+ <a href="#">
149
+ <span>
150
+ Link four
151
+ </span>
152
+ <span class="mx-icon mx-icon--chevron-right">
153
+ </span>
154
+ </a>
155
+ </li>
156
+ <li>
157
+ <a href="#">
158
+ <span>
159
+ Link five
113
160
  </span>
114
- <span class="sr-only">
115
- Search
161
+ <span class="mx-icon mx-icon--chevron-right">
116
162
  </span>
117
- </button>
118
- </form>
119
- </div>
120
- <div class="mx-hero-banner__aside mx-section--xl">
121
- <h2 class=" mx-heading--m">
122
- Popular searches
123
- </h2>
124
- <ul class="mx-link-list">
125
- <li>
126
- <a href="#">
127
- <span>
128
- Link one
129
- </span>
130
- <span class="mx-icon mx-icon--chevron-right ">
131
- </span>
132
- </a>
133
- </li>
134
- <li>
135
- <a href="#">
136
- <span>
137
- Link two
138
- </span>
139
- <span class="mx-icon mx-icon--chevron-right ">
140
- </span>
141
- </a>
142
- </li>
143
- <li>
144
- <a href="#">
145
- <span>
146
- Link three
147
- </span>
148
- <span class="mx-icon mx-icon--chevron-right ">
149
- </span>
150
- </a>
151
- </li>
152
- <li>
153
- <a href="#">
154
- <span>
155
- Link four
156
- </span>
157
- <span class="mx-icon mx-icon--chevron-right ">
158
- </span>
159
- </a>
160
- </li>
161
- <li>
162
- <a href="#">
163
- <span>
164
- Link five
165
- </span>
166
- <span class="mx-icon mx-icon--chevron-right ">
167
- </span>
168
- </a>
169
- </li>
170
- </ul>
171
- </div>
163
+ </a>
164
+ </li>
165
+ </ul>
172
166
  </div>
173
167
  </div>
174
168
  </div>
@@ -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/HeroSearch Hero smoke-test 1`] = `
4
4
  <div class="mx-page mx-section--xl">
@@ -7,18 +7,14 @@ import {
7
7
  InPageAlert as InPageAlertType,
8
8
  InPageAlertTypes,
9
9
  } from "@pnx-mixtape/ids-shape"
10
+ import Heading from "../../Atom/Heading/heading.twig"
10
11
 
12
+ /**
13
+ * In Page Alerts to highlight important information or notices.
14
+ */
11
15
  const meta: Meta<InPageAlertType> = {
12
16
  tags: ["autodocs"],
13
17
  component: Component,
14
- argTypes: {
15
- type: { options: Object.values(InPageAlertTypes), control: "radio" },
16
- // @ts-expect-error The controls follow the shape
17
- "title.title": { control: "text" },
18
- "title.as": { options: Object.values(HeadingTypes), control: "select" },
19
- "link.href": { control: "text" },
20
- "link.title": { control: "text" },
21
- },
22
18
  args: {
23
19
  content: "Something happened that requires your attention",
24
20
  link: Link({
@@ -26,9 +22,81 @@ const meta: Meta<InPageAlertType> = {
26
22
  href: "#",
27
23
  }),
28
24
  },
25
+ argTypes: {
26
+ type: {
27
+ options: Object.values(InPageAlertTypes),
28
+ control: "radio",
29
+ table: {
30
+ type: { summary: "enum" },
31
+ },
32
+ },
33
+ title: {
34
+ description:
35
+ "Optional content [Heading](/?path=/docs/atom-heading--docs). It is helpful to use a smaller heading modifier.",
36
+ control: "text",
37
+ table: {
38
+ type: { summary: "Heading" },
39
+ subcategory: "Alert content",
40
+ },
41
+ },
42
+ content: {
43
+ description: "Content.",
44
+ control: "text",
45
+ type: {
46
+ name: "string",
47
+ required: true,
48
+ },
49
+ table: {
50
+ type: { summary: "WysiwygText" },
51
+ subcategory: "Alert content",
52
+ },
53
+ },
54
+ link: {
55
+ description: "Optional content [Link](/?path=/docs/atom-link--docs).",
56
+ control: "text",
57
+ table: {
58
+ type: { summary: "Link" },
59
+ subcategory: "Alert content",
60
+ },
61
+ },
62
+ },
29
63
  }
30
64
 
31
65
  export default meta
32
66
  type Story = StoryObj<InPageAlertType>
33
67
 
34
68
  export const InPageAlert: Story = {}
69
+
70
+ export const WithHeading: Story = {
71
+ args: {
72
+ title: Heading({
73
+ title: "In page alert",
74
+ as: HeadingTypes.TWO,
75
+ modifiers: [HeadingTypes.FOUR],
76
+ }),
77
+ },
78
+ }
79
+
80
+ export const Info: Story = {
81
+ args: {
82
+ type: InPageAlertTypes.INFO,
83
+ },
84
+ }
85
+
86
+ export const Success: Story = {
87
+ args: {
88
+ type: InPageAlertTypes.SUCCESS,
89
+ },
90
+ }
91
+
92
+ export const Warning: Story = {
93
+ args: {
94
+ type: InPageAlertTypes.WARNING,
95
+ },
96
+ }
97
+
98
+ export const Error: Story = {
99
+ args: {
100
+ type: InPageAlertTypes.ERROR,
101
+ },
102
+ }
@@ -9,8 +9,7 @@ const meta: Meta<typeof Component> = {
9
9
  args: {
10
10
  children: (
11
11
  <p>
12
- <b>Something happened.</b> And if you&apos;d like to know what,{" "}
13
- <a href="#">Click here</a>.
12
+ <b>Something happened.</b> And if you&apos;d like to know what, <a href="#">Click here</a>.
14
13
  </p>
15
14
  ),
16
15
  },
@@ -6,10 +6,7 @@ type InPageAlertProps = PropsWithChildren & {
6
6
  type?: InPageAlertTypes
7
7
  }
8
8
 
9
- const InPageAlert = ({
10
- children,
11
- type = InPageAlertTypes.INFO,
12
- }: InPageAlertProps): JSX.Element => (
9
+ const InPageAlert = ({ children, type = InPageAlertTypes.INFO }: InPageAlertProps): JSX.Element => (
13
10
  <div
14
11
  className={classNames("message", {
15
12
  [`message--${type}`]: type,
@@ -1,9 +1,87 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports[`Component/InPageAlert Error smoke-test 1`] = `
4
+ <div class="mx-page default">
5
+ <div class="message message--error mx-icon mx-icon--error">
6
+ <div class="message__content">
7
+ Something happened that requires your attention
8
+ <a href="#">
9
+ <span>
10
+ Click here
11
+ </span>
12
+ </a>
13
+ </div>
14
+ </div>
15
+ </div>
16
+ `;
2
17
 
3
18
  exports[`Component/InPageAlert InPageAlert smoke-test 1`] = `
4
19
  <div class="mx-page default">
5
- <div class="message ">
20
+ <div class="message">
21
+ <div class="message__content">
22
+ Something happened that requires your attention
23
+ <a href="#">
24
+ <span>
25
+ Click here
26
+ </span>
27
+ </a>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ `;
32
+
33
+ exports[`Component/InPageAlert Info smoke-test 1`] = `
34
+ <div class="mx-page default">
35
+ <div class="message message--info mx-icon mx-icon--info">
36
+ <div class="message__content">
37
+ Something happened that requires your attention
38
+ <a href="#">
39
+ <span>
40
+ Click here
41
+ </span>
42
+ </a>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ `;
47
+
48
+ exports[`Component/InPageAlert Success smoke-test 1`] = `
49
+ <div class="mx-page default">
50
+ <div class="message message--success mx-icon mx-icon--success">
51
+ <div class="message__content">
52
+ Something happened that requires your attention
53
+ <a href="#">
54
+ <span>
55
+ Click here
56
+ </span>
57
+ </a>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ `;
62
+
63
+ exports[`Component/InPageAlert Warning smoke-test 1`] = `
64
+ <div class="mx-page default">
65
+ <div class="message message--warning mx-icon mx-icon--warning">
66
+ <div class="message__content">
67
+ Something happened that requires your attention
68
+ <a href="#">
69
+ <span>
70
+ Click here
71
+ </span>
72
+ </a>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ `;
77
+
78
+ exports[`Component/InPageAlert WithHeading smoke-test 1`] = `
79
+ <div class="mx-page default">
80
+ <div class="message">
6
81
  <div class="message__content">
82
+ <h2 class="mx-heading--m">
83
+ In page alert
84
+ </h2>
7
85
  Something happened that requires your attention
8
86
  <a href="#">
9
87
  <span>
@@ -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/InPageAlert Error smoke-test 1`] = `
4
4
  <div class="message message--error icon icon--error">
@@ -1,6 +1,6 @@
1
1
  /**
2
- * DialogBase
3
- * @file Support opening/closing, and adding a scroll lock to the body.
2
+ * InPageNavigation
3
+ * @file Ensure headings have IDs and build the menu if not set.
4
4
  */
5
5
 
6
6
  import { makeAnchor, createElement } from "../../../Utility/utilities"
@@ -33,9 +33,7 @@ export default class InPageNavigation extends HTMLElement {
33
33
  })
34
34
  } else {
35
35
  this.links.forEach((link: HTMLAnchorElement) => {
36
- const heading: HTMLHeadingElement = this.container.querySelector(
37
- link.hash,
38
- )
36
+ const heading: HTMLHeadingElement = this.container.querySelector(link.hash)
39
37
  if (!heading) return
40
38
  this.items.push({ link, heading })
41
39
  })
@@ -72,8 +70,7 @@ export default class InPageNavigation extends HTMLElement {
72
70
  }
73
71
 
74
72
  get menu(): HTMLUListElement | HTMLOListElement | null {
75
- const menu: HTMLUListElement | HTMLOListElement | null =
76
- this.querySelector("ul, ol")
73
+ const menu: HTMLUListElement | HTMLOListElement | null = this.querySelector("ul, ol")
77
74
  if (!menu) {
78
75
  throw new Error(`${this.localName} must contain a <ul> or <ol> element.`)
79
76
  }
@@ -91,7 +88,7 @@ export default class InPageNavigation extends HTMLElement {
91
88
  }
92
89
 
93
90
  get headings(): NodeListOf<HTMLHeadingElement> | undefined {
94
- return this.container?.querySelectorAll(this.headingLevels)
91
+ return this.container?.querySelectorAll(`:is(${this.headingLevels}):not(.is-excluded)`)
95
92
  }
96
93
 
97
94
  get links(): NodeListOf<HTMLAnchorElement> | undefined {
@@ -126,7 +123,8 @@ export default class InPageNavigation extends HTMLElement {
126
123
  }
127
124
  }
128
125
 
129
- customElements.define("mx-in-page-navigation", InPageNavigation)
126
+ if (!customElements.get("mx-in-page-navigation"))
127
+ customElements.define("mx-in-page-navigation", InPageNavigation)
130
128
 
131
129
  declare global {
132
130
  interface HTMLElementTagNameMap {
@@ -32,11 +32,9 @@ const useInPageNavigation = ({
32
32
  }) as HeadingType,
33
33
  )
34
34
  setHeadings([...new Set(values)])
35
- headingElements.forEach(
36
- (heading: HTMLHeadingElement, index: number): void => {
37
- if (!heading.id) heading.id = values[index].id
38
- },
39
- )
35
+ headingElements.forEach((heading: HTMLHeadingElement, index: number): void => {
36
+ if (!heading.id) heading.id = values[index].id
37
+ })
40
38
  }, [ref, levels])
41
39
 
42
40
  return { headings }