@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.
- package/dist/build/accordion.entry.js +32 -43
- package/dist/build/accordion.entry.js.map +1 -1
- package/dist/build/base.css +19 -39
- package/dist/build/button.css +7 -8
- package/dist/build/chunks/{Accordion-O-huO4At.js → Accordion-D1HQ0FDq.js} +23 -21
- package/dist/build/chunks/{Accordion-O-huO4At.js.map → Accordion-D1HQ0FDq.js.map} +1 -1
- package/dist/build/chunks/disclosure-widget-CdjCdx7t.js +129 -0
- package/dist/build/chunks/disclosure-widget-CdjCdx7t.js.map +1 -0
- package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js +70 -0
- package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js.map +1 -0
- package/dist/build/chunks/{polyfills-C-B7iqDG.js → polyfills-DnrsypYs.js} +35 -26
- package/dist/build/chunks/polyfills-DnrsypYs.js.map +1 -0
- package/dist/build/chunks/popover.entry-BQvyR0d5.js +38 -0
- package/dist/build/chunks/popover.entry-BQvyR0d5.js.map +1 -0
- package/dist/build/chunks/{utilities-DXELy_An.js → utilities-Ci7wwNeg.js} +9 -106
- package/dist/build/chunks/utilities-Ci7wwNeg.js.map +1 -0
- package/dist/build/constants.css +10 -31
- package/dist/build/dialog.entry.js +23 -31
- package/dist/build/dialog.entry.js.map +1 -1
- package/dist/build/drop-menu.entry.js +1 -1
- package/dist/build/drupal.css +5 -9
- package/dist/build/filters.entry.js +54 -50
- package/dist/build/filters.entry.js.map +1 -1
- package/dist/build/form.css +12 -26
- package/dist/build/global-alert.entry.js +26 -19
- package/dist/build/global-alert.entry.js.map +1 -1
- package/dist/build/grid.css +3 -9
- package/dist/build/header.css +5 -3
- package/dist/build/header.entry.js +93 -88
- package/dist/build/header.entry.js.map +1 -1
- package/dist/build/icon.css +3 -3
- package/dist/build/in-page-navigation.entry.js +16 -12
- package/dist/build/in-page-navigation.entry.js.map +1 -1
- package/dist/build/navigation.css +21 -56
- package/dist/build/navigation.entry.js +148 -50
- package/dist/build/navigation.entry.js.map +1 -1
- package/dist/build/page.css +1 -1
- package/dist/build/popover.css +119 -0
- package/dist/build/popover.entry.js +2 -0
- package/dist/build/popover.entry.js.map +1 -0
- package/dist/build/section.css +1 -1
- package/dist/build/sticky.entry.js +11 -12
- package/dist/build/sticky.entry.js.map +1 -1
- package/dist/build/tabs.entry.js +108 -91
- package/dist/build/tabs.entry.js.map +1 -1
- package/dist/build/utility-list.css +43 -0
- package/dist/build/utility-list.entry.js +80 -0
- package/dist/build/utility-list.entry.js.map +1 -0
- package/package.json +9 -10
- package/src/Atom/{Base.mdx → Atom.mdx} +1 -1
- package/src/Atom/Background/Backgrounds.stories.ts +21 -4
- package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +1 -1
- package/src/Atom/Background/_background.css +1 -2
- package/src/Atom/Blockquote/_blockquote.css +1 -2
- package/src/Atom/Button/Button.stories.ts +128 -19
- package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +75 -11
- package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +1 -1
- package/src/Atom/Button/_buttons.css +5 -5
- package/src/Atom/DefinitionList/DefinitionList.stories.ts +20 -3
- package/src/Atom/DefinitionList/DefinitionList.stories.tsx +3 -9
- package/src/Atom/DefinitionList/DefinitionList.tsx +3 -4
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +1 -1
- package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +1 -1
- package/src/Atom/Heading/Heading.stories.ts +49 -7
- package/src/Atom/Heading/Heading.tsx +1 -6
- package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +9 -1
- package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +1 -1
- package/src/Atom/Heading/_headings.css +1 -2
- package/src/Atom/Icon/Icon.mdx +5 -1
- package/src/Atom/Icon/Icon.stories.ts +76 -6
- package/src/Atom/Icon/Icon.tsx +1 -8
- package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +18 -4
- package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +1 -1
- package/src/Atom/Icon/_icon.css +1 -1
- package/src/Atom/Image/Image.stories.ts +4 -3
- package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +1 -1
- package/src/Atom/Link/Link.stories.ts +74 -7
- package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +4 -4
- package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +1 -1
- package/src/Atom/Media/Media.stories.ts +34 -5
- package/src/Atom/Media/Media.tsx +1 -6
- package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +2 -2
- package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +1 -1
- package/src/Atom/Media/_media.css +2 -10
- package/src/Atom/Spacing/Spacing.stories.ts +45 -31
- package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -4
- package/src/Atom/Spacing/spacing.twig +5 -2
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +1 -1
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
- package/src/Atom/Table/_table.css +1 -2
- package/src/Atom/Text/Text.stories.ts +62 -0
- package/src/Atom/Text/__snapshots__/{TextSizes.stories.ts.snap → Text.stories.ts.snap} +14 -27
- package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +1 -1
- package/src/Atom/Text/_text-sizes.css +2 -4
- package/src/Atom/Text/text-style.twig +11 -1
- package/src/Atom/Text/text-styles-example.twig +2 -16
- package/src/Atom/Video/Video.stories.ts +6 -4
- package/src/Atom/Video/Video.tsx +1 -5
- package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +1 -1
- package/src/Atom/_generic.css +4 -4
- package/src/Atom/_hr.css +1 -2
- package/src/Component/Accordion/Accordion.stories.ts +26 -8
- package/src/Component/Accordion/Accordion.stories.tsx +8 -10
- package/src/Component/Accordion/Accordion.tsx +2 -13
- package/src/Component/Accordion/AccordionItem.stories.ts +90 -0
- package/src/Component/Accordion/Components/AccordionContent.tsx +1 -5
- package/src/Component/Accordion/Components/AccordionTitle.tsx +1 -4
- package/src/Component/Accordion/Elements/Accordion.ts +1 -1
- package/src/Component/Accordion/Elements/AccordionDiv.ts +4 -11
- package/src/Component/Accordion/Elements/AccordionGroup.ts +10 -24
- package/src/Component/Accordion/Elements/AccordionMobile.ts +4 -4
- package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +17 -6
- package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +1 -1
- package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +90 -0
- package/src/Component/Accordion/accordion.css +7 -5
- package/src/Component/Accordion/twig/accordion-div.twig +13 -11
- package/src/Component/Accordion/twig/accordion-mobile.twig +13 -11
- package/src/Component/Breadcrumb/Breadcrumb.stories.ts +14 -0
- package/src/Component/Breadcrumb/Breadcrumb.tsx +2 -12
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +1 -1
- package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +1 -1
- package/src/Component/Breadcrumb/breadcrumb.css +1 -4
- package/src/Component/Callout/Callout.stories.ts +20 -0
- package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +1 -1
- package/src/Component/Callout/callout.css +1 -2
- package/src/Component/Card/Card.stories.ts +129 -14
- package/src/Component/Card/Card.stories.tsx +2 -2
- package/src/Component/Card/Components/CardContent.tsx +1 -5
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +24 -24
- package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +1 -1
- package/src/Component/Card/card.css +2 -6
- package/src/Component/Card/card.twig +1 -1
- package/src/Component/Carousel/Carousel.stories.ts +61 -8
- package/src/Component/Carousel/Elements/Carousel.ts +10 -19
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +321 -35
- package/src/Component/Carousel/carousel.css +1 -2
- package/src/Component/ContentBlock/Components/ContentBlockContent.tsx +1 -5
- package/src/Component/ContentBlock/Components/ContentBlockMedia.tsx +1 -4
- package/src/Component/ContentBlock/ContentBlock.stories.ts +63 -13
- package/src/Component/ContentBlock/ContentBlock.stories.tsx +2 -2
- package/src/Component/ContentBlock/ContentBlock.tsx +1 -5
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +11 -11
- package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +1 -1
- package/src/Component/Dialog/Dialog.stories.ts +78 -21
- package/src/Component/Dialog/Dialog.stories.tsx +2 -3
- package/src/Component/Dialog/Elements/Dialog.ts +7 -16
- package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +8 -11
- package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +1 -1
- package/src/Component/Dialog/dialog.css +1 -2
- package/src/Component/Dialog/dialog.twig +1 -1
- package/src/Component/DropMenu/Components/DropMenuContext.tsx +4 -12
- package/src/Component/DropMenu/DropMenu.stories.ts +60 -1
- package/src/Component/DropMenu/DropMenu.tsx +2 -7
- package/src/Component/DropMenu/Elements/DropMenu.ts +21 -91
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +53 -11
- package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +1 -1
- package/src/Component/DropMenu/drop-menu.css +13 -41
- package/src/Component/DropMenu/drop-menu.twig +8 -6
- package/src/Component/Filters/Elements/Filters.ts +7 -11
- package/src/Component/Filters/FilterItem.stories.ts +180 -0
- package/src/Component/Filters/Filters.stories.ts +83 -8
- package/src/Component/Filters/__snapshots__/FilterItem.stories.ts.snap +135 -0
- package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +43 -41
- package/src/Component/Filters/filter-item.twig +1 -1
- package/src/Component/Filters/filters.css +33 -17
- package/src/Component/GlobalAlert/Elements/ClosableAlert.ts +8 -7
- package/src/Component/GlobalAlert/GlobalAlert.stories.ts +60 -12
- package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +1 -2
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +8 -6
- package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +3 -3
- package/src/Component/HeroBanner/HeroBanner.stories.ts +84 -7
- package/src/Component/HeroBanner/HeroBanner.stories.tsx +4 -4
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +91 -99
- package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +1 -1
- package/src/Component/HeroSearch/HeroSearch.stories.ts +23 -4
- package/src/Component/HeroSearch/HeroSearch.stories.tsx +4 -4
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +10 -10
- package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +1 -1
- package/src/Component/InPageAlert/InPageAlert.stories.ts +76 -8
- package/src/Component/InPageAlert/InPageAlert.stories.tsx +1 -2
- package/src/Component/InPageAlert/InPageAlert.tsx +1 -4
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +80 -2
- package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +1 -1
- package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +7 -9
- package/src/Component/InPageNavigation/Hooks/useInPageNavigation.ts +3 -5
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +44 -9
- package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +32 -40
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +152 -5
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +1 -1
- package/src/Component/LinkList/LinkList.stories.ts +23 -0
- package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +8 -8
- package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +1 -1
- package/src/Component/LinkList/link-list.css +1 -2
- package/src/Component/ListItem/Components/ListItemContent.tsx +1 -5
- package/src/Component/ListItem/Components/ListItemMedia.tsx +1 -4
- package/src/Component/ListItem/ListItem.stories.ts +91 -11
- package/src/Component/ListItem/ListItem.stories.tsx +6 -7
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +1 -1
- package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +1 -1
- package/src/Component/ListItem/list-item.css +1 -2
- package/src/Component/Navigation/Components/DropdownLevel.tsx +5 -13
- package/src/Component/Navigation/Elements/Navigation.ts +6 -13
- package/src/Component/Navigation/Navigation.stories.ts +48 -0
- package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +1 -1
- package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +1 -1
- package/src/Component/Navigation/_navigation-collapsible.css +2 -4
- package/src/Component/Navigation/_navigation-dropdown.css +10 -32
- package/src/Component/Navigation/_navigation-mega.css +1 -4
- package/src/Component/Navigation/_navigation.css +1 -4
- package/src/Component/Pagination/Components/PaginationContext.tsx +5 -19
- package/src/Component/Pagination/Components/PaginationItem.tsx +1 -5
- package/src/Component/Pagination/Pagination.stories.ts +28 -0
- package/src/Component/Pagination/Pagination.tsx +3 -11
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +3 -3
- package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +1 -1
- package/src/Component/Pagination/pagination.css +1 -4
- package/src/Component/Popover/Elements/Popover.ts +55 -0
- package/src/Component/Popover/Popover.stories.ts +259 -0
- package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +508 -0
- package/src/Component/{DropMenu → Popover}/polyfills.js +6 -4
- package/src/Component/Popover/popover.css +113 -0
- package/src/Component/Popover/popover.entry.js +1 -0
- package/src/Component/Popover/popover.twig +27 -0
- package/src/Component/ResultsBar/Components/ResultsBarInfo.tsx +2 -7
- package/src/Component/ResultsBar/Components/ResultsBarSort.tsx +1 -6
- package/src/Component/ResultsBar/ResultsBar.stories.ts +34 -4
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +3 -3
- package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +1 -1
- package/src/Component/SideNavigation/SideNavigation.stories.ts +40 -0
- package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +1 -1
- package/src/Component/SideNavigation/side-navigation.css +3 -6
- package/src/Component/SocialLinks/SocialLinks.stories.ts +20 -0
- package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +5 -5
- package/src/Component/SocialShare/SocialShare.stories.ts +37 -0
- package/src/Component/SocialShare/SocialShare.tsx +2 -4
- package/src/Component/SocialShare/__snapshots__/SocialShare.stories.ts.snap +40 -0
- package/src/Component/SocialShare/__snapshots__/SocialShare.stories.tsx.snap +1 -1
- package/src/Component/SocialShare/social-share.twig +34 -0
- package/src/Component/Steps/StepItem.stories.ts +48 -0
- package/src/Component/Steps/Steps.stories.ts +82 -13
- package/src/Component/Steps/__snapshots__/StepItem.stories.ts.snap +31 -0
- package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +109 -28
- package/src/Component/Steps/step-item.twig +1 -1
- package/src/Component/Steps/steps.css +4 -11
- package/src/Component/Sticky/Elements/Sticky.ts +3 -8
- package/src/Component/Sticky/Sticky.stories.ts +35 -3
- package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +1 -1
- package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +1 -1
- package/src/Component/Sticky/sticky.twig +1 -1
- package/src/Component/Tabs/Components/Tab.tsx +2 -8
- package/src/Component/Tabs/Components/TabPanel.tsx +1 -5
- package/src/Component/Tabs/Elements/Tabs.ts +21 -31
- package/src/Component/Tabs/TabItem.stories.ts +52 -0
- package/src/Component/Tabs/Tabs.stories.ts +51 -8
- package/src/Component/Tabs/Tabs.tsx +6 -22
- package/src/Component/Tabs/__snapshots__/TabItem.stories.ts.snap +12 -0
- package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +127 -11
- package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +1 -1
- package/src/Component/Tabs/tab-item.twig +1 -2
- package/src/Component/Tabs/tabs.css +56 -59
- package/src/Component/Tag/Tag.stories.ts +30 -0
- package/src/Component/Tag/Tag.tsx +1 -5
- package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +1 -1
- package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +1 -1
- package/src/Component/Tag/tag.css +1 -4
- package/src/Component/UtilityList/Elements/UtilityList.ts +110 -0
- package/src/Component/UtilityList/UtilityList.stories.ts +72 -0
- package/src/Component/UtilityList/__snapshots__/UtilityList.stories.ts.snap +274 -0
- package/src/Component/UtilityList/utility-list.css +40 -0
- package/src/Component/UtilityList/utility-list.entry.js +1 -0
- package/src/Component/UtilityList/utility-list.twig +66 -0
- package/src/Form/Checkbox/FormCheckbox.stories.tsx +1 -3
- package/src/Form/Checkbox/FormCheckbox.tsx +4 -25
- package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +3 -3
- package/src/Form/Description/Description.stories.ts +1 -2
- package/src/Form/Description/FormStatus.stories.ts +1 -4
- package/src/Form/Description/__snapshots__/Description.stories.ts.snap +1 -1
- package/src/Form/Description/__snapshots__/FormDescription.stories.tsx.snap +1 -1
- package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +3 -3
- package/src/Form/Form/Form.tsx +1 -3
- package/src/Form/Form/__snapshots__/Form.stories.tsx.snap +1 -1
- package/src/Form/Form/__snapshots__/FormTitle.stories.tsx.snap +1 -1
- package/src/Form/FormItem/FormItem.stories.ts +3 -9
- package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +18 -18
- package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +1 -1
- package/src/Form/Label/FormLabel.tsx +1 -5
- package/src/Form/Label/__snapshots__/FormLabel.stories.tsx.snap +1 -1
- package/src/Form/Label/__snapshots__/Label.stories.ts.snap +3 -3
- package/src/Form/Radio/FormRadio.stories.tsx +1 -3
- package/src/Form/Radio/FormRadio.tsx +4 -25
- package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +9 -9
- package/src/Form/Search/__snapshots__/Search.stories.ts.snap +1 -1
- package/src/Form/Select/FormSelect.tsx +3 -9
- package/src/Form/Select/__snapshots__/FormSelect.stories.tsx.snap +1 -1
- package/src/Form/Select/__snapshots__/Select.stories.ts.snap +2 -2
- package/src/Form/TextInput/FormText.tsx +3 -9
- package/src/Form/TextInput/TextInput.stories.ts +1 -4
- package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +1 -1
- package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +1 -1
- package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +3 -3
- package/src/Form/Textarea/FormTextarea.tsx +3 -9
- package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +1 -1
- package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +2 -2
- package/src/Form/form.css +6 -14
- package/src/Introduction.mdx +1 -2
- package/src/Layout/Footer/Footer.stories.ts +1 -5
- package/src/Layout/Footer/Footer.stories.tsx +2 -3
- package/src/Layout/Footer/Footer.tsx +3 -12
- package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +4 -4
- package/src/Layout/Footer/__snapshots__/Footer.stories.tsx.snap +1 -1
- package/src/Layout/Grid/Grid.stories.ts +40 -8
- package/src/Layout/Grid/Grid.tsx +1 -2
- package/src/Layout/Grid/GridItem.stories.ts +63 -0
- package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +29 -4
- package/src/Layout/Grid/__snapshots__/Grid.stories.tsx.snap +1 -1
- package/src/Layout/Grid/__snapshots__/GridItem.stories.ts.snap +19 -0
- package/src/Layout/Grid/grid-item.twig +3 -9
- package/src/Layout/Grid/grid.css +1 -4
- package/src/Layout/Header/Elements/GlobalToggle.ts +9 -29
- package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +25 -45
- package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +3 -3
- package/src/Layout/Header/_toggles.css +2 -2
- package/src/Layout/Header/header.twig +1 -1
- package/src/Layout/Masthead/Masthead.stories.ts +1 -4
- package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +3 -3
- package/src/Layout/Page/Page.stories.tsx +2 -2
- package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +3 -3
- package/src/Layout/Page/page.css +2 -10
- package/src/Layout/Section/Background.stories.ts +14 -39
- package/src/Layout/Section/Breakouts.stories.ts +3 -0
- package/src/Layout/Section/Flow.stories.ts +3 -0
- package/src/Layout/Section/Section.stories.ts +93 -11
- package/src/Layout/Section/Section.tsx +3 -13
- package/src/Layout/Section/SectionGrid.tsx +2 -9
- package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +4 -4
- package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +1 -1
- package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +1 -1
- package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +93 -3
- package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +1 -1
- package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +1 -1
- package/src/Layout/Section/section.css +2 -5
- package/src/Layout/Section/section.twig +1 -3
- package/src/Layout/Sidebar/Sidebar.stories.ts +46 -4
- package/src/Layout/Sidebar/Sidebar.tsx +1 -3
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +4 -4
- package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +1 -1
- package/src/Utility/Context/ImageComponent.tsx +4 -8
- package/src/Utility/Context/LinkComponent.tsx +1 -5
- package/src/Utility/Drupal/drupal.css +2 -4
- package/src/Utility/Elements/breakpoint-loader.ts +4 -10
- package/src/Utility/Elements/cookie-compliance.ts +2 -8
- package/src/Utility/Elements/disclosure-widget.ts +11 -18
- package/src/Utility/Elements/io-loader.ts +4 -6
- package/src/Utility/Elements/keyboard.ts +4 -14
- package/src/Utility/Hooks/useLocalStorage.ts +5 -18
- package/src/Utility/Hooks/useMediaQuery.ts +1 -4
- package/src/Utility/Hooks/useToggle.ts +1 -3
- package/src/Utility/global.d.ts +1 -5
- package/src/Utility/utilities.ts +20 -45
- package/src/constants.css +7 -28
- package/src/enums.ts +3 -1
- package/src/react.ts +5 -21
- package/src/tokens.js +2 -2
- package/dist/build/chunks/disclosure-widget-DVpnRsTI.js +0 -126
- package/dist/build/chunks/disclosure-widget-DVpnRsTI.js.map +0 -1
- package/dist/build/chunks/drop-menu.entry-B4TtnC50.js +0 -132
- package/dist/build/chunks/drop-menu.entry-B4TtnC50.js.map +0 -1
- package/dist/build/chunks/keyboard-rvZ4dfGF.js +0 -104
- package/dist/build/chunks/keyboard-rvZ4dfGF.js.map +0 -1
- package/dist/build/chunks/polyfills-C-B7iqDG.js.map +0 -1
- package/dist/build/chunks/utilities-DXELy_An.js.map +0 -1
- package/src/Atom/Text/TextSizes.stories.ts +0 -25
- package/src/Atom/Text/text-alignment.twig +0 -5
- package/src/Component/Accordion/twig/accordion-example.twig +0 -36
- package/src/Component/Tile/README.md +0 -3
- package/src/Component/Tile/Tile.stories.ts +0 -49
- package/src/Component/Tile/Tile.stories.tsx +0 -35
- package/src/Component/Tile/__snapshots__/Tile.stories.ts.snap +0 -57
- package/src/Component/Tile/__snapshots__/Tile.stories.tsx.snap +0 -23
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
& li {
|
|
11
11
|
min-block-size: var(--min-height, var(--spacing-xl));
|
|
12
|
-
border-block-end: var(--line-width, 1px) solid
|
|
13
|
-
var(--line-colour, var(--colour-border));
|
|
12
|
+
border-block-end: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
|
|
14
13
|
|
|
15
14
|
&:last-child {
|
|
16
15
|
border-block-end: 0;
|
|
@@ -2,11 +2,7 @@ import { JSX, PropsWithChildren } from "react"
|
|
|
2
2
|
import classNames from "classnames"
|
|
3
3
|
|
|
4
4
|
const ListItemContent = ({ children }: PropsWithChildren): JSX.Element => {
|
|
5
|
-
return (
|
|
6
|
-
<div className={classNames("mx-list-item__content", "mx-vertical-flow")}>
|
|
7
|
-
{children}
|
|
8
|
-
</div>
|
|
9
|
-
)
|
|
5
|
+
return <div className={classNames("mx-list-item__content", "mx-vertical-flow")}>{children}</div>
|
|
10
6
|
}
|
|
11
7
|
|
|
12
8
|
export default ListItemContent
|
|
@@ -5,10 +5,7 @@ type CardProps = PropsWithChildren & {
|
|
|
5
5
|
skeleton?: boolean
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
const ListItemMedia = ({
|
|
9
|
-
children,
|
|
10
|
-
skeleton = false,
|
|
11
|
-
}: CardProps): JSX.Element => {
|
|
8
|
+
const ListItemMedia = ({ children, skeleton = false }: CardProps): JSX.Element => {
|
|
12
9
|
return (
|
|
13
10
|
<figure className={classNames("mx-list-item__media", "stack")}>
|
|
14
11
|
{skeleton && <div className="mx-skeleton mx-skeleton--bg"></div>}
|
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
TagTypes,
|
|
14
14
|
} from "@pnx-mixtape/ids-shape"
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* List Item extends the Card to create a search result type component.
|
|
18
|
+
*/
|
|
16
19
|
const meta: Meta<ListItemType> = {
|
|
17
20
|
tags: ["autodocs", "ids-mvp"],
|
|
18
21
|
component: Component,
|
|
@@ -26,19 +29,78 @@ const meta: Meta<ListItemType> = {
|
|
|
26
29
|
},
|
|
27
30
|
argTypes: {
|
|
28
31
|
modifiers: {
|
|
32
|
+
description:
|
|
33
|
+
"The **block** modifier makes the whole item clickable. The **reverse** modifier positions the image on the right.",
|
|
29
34
|
options: Object.values(ListItemModifiers),
|
|
30
|
-
control: "
|
|
35
|
+
control: "check",
|
|
36
|
+
table: { type: { summary: "enum" } },
|
|
37
|
+
},
|
|
38
|
+
info: {
|
|
39
|
+
description:
|
|
40
|
+
"Optional text, can be displayed before or after the title using the `infoBefore` option.",
|
|
41
|
+
type: "string",
|
|
42
|
+
control: "text",
|
|
43
|
+
table: {
|
|
44
|
+
subcategory: "Info content",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
infoBefore: {
|
|
48
|
+
description: "Display the info field before the title",
|
|
49
|
+
control: "boolean",
|
|
50
|
+
table: {
|
|
51
|
+
defaultValue: { summary: "false" },
|
|
52
|
+
subcategory: "Info content",
|
|
53
|
+
},
|
|
54
|
+
if: { arg: "info", truthy: true },
|
|
55
|
+
},
|
|
56
|
+
image: {
|
|
57
|
+
description: "Optional [Image](/?path=/docs/atom-image--docs) component.",
|
|
58
|
+
control: "text",
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: "Image" },
|
|
61
|
+
subcategory: "Item content",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
content: {
|
|
65
|
+
description: "Content.",
|
|
66
|
+
control: "text",
|
|
67
|
+
type: {
|
|
68
|
+
name: "string",
|
|
69
|
+
required: true,
|
|
70
|
+
},
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: "WysiwygText" },
|
|
73
|
+
subcategory: "Item content",
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
link: {
|
|
77
|
+
description: "[Link](/?path=/docs/atom-link--docs) used as a title.",
|
|
78
|
+
control: "text",
|
|
79
|
+
type: {
|
|
80
|
+
name: "string",
|
|
81
|
+
required: true,
|
|
82
|
+
},
|
|
83
|
+
table: {
|
|
84
|
+
type: { summary: "Link" },
|
|
85
|
+
subcategory: "Item content",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
label: {
|
|
89
|
+
description: "Optional label, displayed above the title.",
|
|
90
|
+
type: "string",
|
|
91
|
+
control: "text",
|
|
92
|
+
table: {
|
|
93
|
+
subcategory: "Item content",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
tags: {
|
|
97
|
+
description: "Optional [Tags](/?path=/docs/component-tags--docs).",
|
|
98
|
+
control: "text",
|
|
99
|
+
table: {
|
|
100
|
+
type: { summary: "Tags" },
|
|
101
|
+
subcategory: "Item content",
|
|
102
|
+
},
|
|
31
103
|
},
|
|
32
|
-
label: { control: "text" },
|
|
33
|
-
info: { control: "text" },
|
|
34
|
-
infoBefore: { control: "boolean" },
|
|
35
|
-
// @ts-expect-error The controls follow the shape
|
|
36
|
-
"image.src": { control: "text" },
|
|
37
|
-
"image.alt": { control: "text" },
|
|
38
|
-
"title.title": { control: "text" },
|
|
39
|
-
"title.as": { options: Object.values(HeadingTypes), control: "select" },
|
|
40
|
-
"link.href": { control: "text" },
|
|
41
|
-
"link.title": { control: "text" },
|
|
42
104
|
},
|
|
43
105
|
}
|
|
44
106
|
|
|
@@ -47,12 +109,18 @@ type Story = StoryObj<ListItemType>
|
|
|
47
109
|
|
|
48
110
|
export const ListItem: Story = {}
|
|
49
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Make the whole item clickable.
|
|
114
|
+
*/
|
|
50
115
|
export const BlockLink: Story = {
|
|
51
116
|
args: {
|
|
52
117
|
modifiers: [ListItemModifiers.BLOCK],
|
|
53
118
|
},
|
|
54
119
|
}
|
|
55
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Information can be added above the title
|
|
123
|
+
*/
|
|
56
124
|
export const WithInfo: Story = {
|
|
57
125
|
args: {
|
|
58
126
|
label: "Publication",
|
|
@@ -61,12 +129,18 @@ export const WithInfo: Story = {
|
|
|
61
129
|
},
|
|
62
130
|
}
|
|
63
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Or below the title.
|
|
134
|
+
*/
|
|
64
135
|
export const WithUrl: Story = {
|
|
65
136
|
args: {
|
|
66
137
|
info: "https://example.com/some-thing",
|
|
67
138
|
},
|
|
68
139
|
}
|
|
69
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Adds a [Tags](/?path=/docs/component-tags--docs) component
|
|
143
|
+
*/
|
|
70
144
|
export const WithTags: Story = {
|
|
71
145
|
args: {
|
|
72
146
|
label: "Resource",
|
|
@@ -77,6 +151,9 @@ export const WithTags: Story = {
|
|
|
77
151
|
},
|
|
78
152
|
}
|
|
79
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Adds a [Image](/?path=/docs/atom-image--docs) component
|
|
156
|
+
*/
|
|
80
157
|
export const WithImage: Story = {
|
|
81
158
|
args: {
|
|
82
159
|
label: "Publication",
|
|
@@ -89,6 +166,9 @@ export const WithImage: Story = {
|
|
|
89
166
|
},
|
|
90
167
|
}
|
|
91
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Reverse the position of the image.
|
|
171
|
+
*/
|
|
92
172
|
export const ImageReverse: Story = {
|
|
93
173
|
args: {
|
|
94
174
|
modifiers: [ListItemModifiers.REVERSE],
|
|
@@ -19,13 +19,12 @@ const meta: Meta<typeof Component> = {
|
|
|
19
19
|
</div>
|
|
20
20
|
<Text modifier={TextStyles.S}>18 May 2040</Text>
|
|
21
21
|
<p>
|
|
22
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
culpa qui officia deserunt mollit anim id est laborum.
|
|
22
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
|
|
23
|
+
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
|
|
24
|
+
ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
25
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
|
|
26
|
+
sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
|
|
27
|
+
est laborum.
|
|
29
28
|
</p>
|
|
30
29
|
</ListItemContent>
|
|
31
30
|
),
|
|
@@ -19,8 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
:is(.mx-list-item, .mx-container:has(> .mx-list-item)) {
|
|
21
21
|
&:where(:not(:first-child)) {
|
|
22
|
-
border-block-start: var(--line-width, 1px) solid
|
|
23
|
-
var(--line-colour, var(--colour-border));
|
|
22
|
+
border-block-start: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
|
|
24
23
|
padding-block-start: var(--gap);
|
|
25
24
|
margin-block-start: var(--gap);
|
|
26
25
|
}
|
|
@@ -76,24 +76,16 @@ const DropdownLevel = ({
|
|
|
76
76
|
onKeyDown={handleKeyDown}
|
|
77
77
|
aria-controls={dropdownId}
|
|
78
78
|
aria-expanded={on}
|
|
79
|
-
className={classNames(
|
|
80
|
-
"mx-
|
|
81
|
-
"mx-icon",
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
"mx-icon--chevron-down": !on,
|
|
85
|
-
"mx-icon--chevron-up": on,
|
|
86
|
-
},
|
|
87
|
-
)}
|
|
79
|
+
className={classNames("mx-nav__toggle", "mx-icon", "mx-icon--only", {
|
|
80
|
+
"mx-icon--chevron-down": !on,
|
|
81
|
+
"mx-icon--chevron-up": on,
|
|
82
|
+
})}
|
|
88
83
|
type="button"
|
|
89
84
|
>
|
|
90
85
|
Sub-navigation
|
|
91
86
|
</button>
|
|
92
87
|
{on && (
|
|
93
|
-
<ul
|
|
94
|
-
id={dropdownId}
|
|
95
|
-
className={classNames("mx-nav__level-2", "mx-nav--open")}
|
|
96
|
-
>
|
|
88
|
+
<ul id={dropdownId} className={classNames("mx-nav__level-2", "mx-nav--open")}>
|
|
97
89
|
{item.items.map(subitem => (
|
|
98
90
|
<li key={subitem.id} className={classNames(subitem.className)}>
|
|
99
91
|
<Link to={subitem.to} className={null}>
|
|
@@ -56,9 +56,7 @@ export default class Navigation extends HTMLElement {
|
|
|
56
56
|
const item: HTMLLIElement = list.closest("li")
|
|
57
57
|
const link: HTMLAnchorElement = item.querySelector(":scope > a")
|
|
58
58
|
const id: string = makeAnchor(`subnav-${index}-${link.textContent}`, 30)
|
|
59
|
-
const trigger: HTMLButtonElement = item.querySelector(
|
|
60
|
-
":scope > button.mx-nav__toggle",
|
|
61
|
-
)
|
|
59
|
+
const trigger: HTMLButtonElement = item.querySelector(":scope > button.mx-nav__toggle")
|
|
62
60
|
if (item && link && trigger) {
|
|
63
61
|
const labelId = `list-label-${id}`
|
|
64
62
|
link.setAttribute("id", labelId)
|
|
@@ -117,9 +115,7 @@ export default class Navigation extends HTMLElement {
|
|
|
117
115
|
})
|
|
118
116
|
}
|
|
119
117
|
|
|
120
|
-
handleBreakpoint = ({
|
|
121
|
-
matches,
|
|
122
|
-
}: MediaQueryList | MediaQueryListEvent): void => {
|
|
118
|
+
handleBreakpoint = ({ matches }: MediaQueryList | MediaQueryListEvent): void => {
|
|
123
119
|
const { signal }: AbortController = this.controller
|
|
124
120
|
if (matches) {
|
|
125
121
|
this.addEventListener("mouseover", this.handleFlyout, { signal })
|
|
@@ -135,22 +131,19 @@ export default class Navigation extends HTMLElement {
|
|
|
135
131
|
const windowInnerWidth: number = window.innerWidth
|
|
136
132
|
const edgeCheck: IntersectionObserver = new IntersectionObserver(
|
|
137
133
|
([{ boundingClientRect, target }], obs) => {
|
|
138
|
-
if (windowInnerWidth < boundingClientRect.right)
|
|
139
|
-
target.classList.add("mx-nav--reverse")
|
|
134
|
+
if (windowInnerWidth < boundingClientRect.right) target.classList.add("mx-nav--reverse")
|
|
140
135
|
obs.disconnect()
|
|
141
136
|
},
|
|
142
137
|
)
|
|
143
138
|
this.subNavs.forEach(({ list }: SubNavType): void => {
|
|
144
139
|
edgeCheck.observe(list)
|
|
145
|
-
const nestedLists: NodeListOf<HTMLUListElement> =
|
|
146
|
-
list.querySelectorAll("ul")
|
|
140
|
+
const nestedLists: NodeListOf<HTMLUListElement> = list.querySelectorAll("ul")
|
|
147
141
|
nestedLists.forEach(nestedList => edgeCheck.observe(nestedList))
|
|
148
142
|
})
|
|
149
143
|
}
|
|
150
144
|
|
|
151
145
|
get links(): NodeListOf<HTMLAnchorElement> | null {
|
|
152
|
-
const links: NodeListOf<HTMLAnchorElement> | null =
|
|
153
|
-
this.querySelectorAll("a")
|
|
146
|
+
const links: NodeListOf<HTMLAnchorElement> | null = this.querySelectorAll("a")
|
|
154
147
|
if (!links.length) {
|
|
155
148
|
throw new Error(`${this.localName} must links`)
|
|
156
149
|
}
|
|
@@ -166,7 +159,7 @@ export default class Navigation extends HTMLElement {
|
|
|
166
159
|
}
|
|
167
160
|
}
|
|
168
161
|
|
|
169
|
-
customElements.define("mx-nav", Navigation)
|
|
162
|
+
if (!customElements.get("mx-nav")) customElements.define("mx-nav", Navigation)
|
|
170
163
|
|
|
171
164
|
declare global {
|
|
172
165
|
interface HTMLElementTagNameMap {
|
|
@@ -8,6 +8,10 @@ type MxNavigationType = NavigationType & {
|
|
|
8
8
|
type?: "collapsible" | "dropdown" | "mega" | "footer"
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Menu navigation components.
|
|
13
|
+
* The `collapsible`, `dropdown` and `mega` types require the `Navigation` element javascript.
|
|
14
|
+
*/
|
|
11
15
|
const meta: Meta<MxNavigationType> = {
|
|
12
16
|
tags: ["autodocs", "ids-mvp"],
|
|
13
17
|
component: Component,
|
|
@@ -35,6 +39,41 @@ const meta: Meta<MxNavigationType> = {
|
|
|
35
39
|
},
|
|
36
40
|
},
|
|
37
41
|
],
|
|
42
|
+
type: null,
|
|
43
|
+
},
|
|
44
|
+
argTypes: {
|
|
45
|
+
items: {
|
|
46
|
+
description:
|
|
47
|
+
"A list of [Link](/?path=/docs/atom-link--docs) objects, that can have nested `items` included. The `current` setting should be used for the current page link.",
|
|
48
|
+
type: {
|
|
49
|
+
name: "other",
|
|
50
|
+
required: true,
|
|
51
|
+
value: "array",
|
|
52
|
+
},
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "Link[]" },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
title: {
|
|
58
|
+
description: "The nav elements `aria-label` value.",
|
|
59
|
+
type: {
|
|
60
|
+
name: "string",
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
id: {
|
|
65
|
+
description: "The unique id for the navigation.",
|
|
66
|
+
type: {
|
|
67
|
+
name: "string",
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
type: {
|
|
72
|
+
description: "Define the type of navigation to change the display and behavior.",
|
|
73
|
+
options: ["collapsible", "dropdown", "mega", "footer"],
|
|
74
|
+
control: "select",
|
|
75
|
+
type: "string",
|
|
76
|
+
},
|
|
38
77
|
},
|
|
39
78
|
}
|
|
40
79
|
|
|
@@ -43,6 +82,9 @@ type Story = StoryObj<MxNavigationType>
|
|
|
43
82
|
|
|
44
83
|
export const Navigation: Story = {}
|
|
45
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Collapsible menu is the base mobile experience for Dropdown and Mega types, but can also be used on its own.
|
|
87
|
+
*/
|
|
46
88
|
export const Collapsible: Story = {
|
|
47
89
|
args: {
|
|
48
90
|
type: "collapsible",
|
|
@@ -122,6 +164,9 @@ export const Collapsible: Story = {
|
|
|
122
164
|
},
|
|
123
165
|
}
|
|
124
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Dropdown is horizontal on desktop and has a flyout submenu on mouse over.
|
|
169
|
+
*/
|
|
125
170
|
export const Dropdown: Story = {
|
|
126
171
|
args: {
|
|
127
172
|
type: "dropdown",
|
|
@@ -180,6 +225,9 @@ export const Dropdown: Story = {
|
|
|
180
225
|
},
|
|
181
226
|
}
|
|
182
227
|
|
|
228
|
+
/**
|
|
229
|
+
* Mega is horizontal on desktop requires click to access submenu, best for more than 2 levels of links.
|
|
230
|
+
*/
|
|
183
231
|
export const Mega: Story = {
|
|
184
232
|
args: {
|
|
185
233
|
type: "mega",
|
|
@@ -24,11 +24,9 @@
|
|
|
24
24
|
& a {
|
|
25
25
|
display: block;
|
|
26
26
|
color: inherit;
|
|
27
|
-
border-block-end: var(--line-width, 1px) solid
|
|
28
|
-
var(--line-colour, var(--colour-border));
|
|
27
|
+
border-block-end: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
|
|
29
28
|
padding-block: var(--item-spacing, var(--spacing-xxs));
|
|
30
|
-
padding-inline: var(--indent, var(--spacing-xxs))
|
|
31
|
-
var(--item-spacing, var(--spacing-xxs));
|
|
29
|
+
padding-inline: var(--indent, var(--spacing-xxs)) var(--item-spacing, var(--spacing-xxs));
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
);
|
|
37
37
|
color: var(--nav-expanded-foreground, inherit);
|
|
38
38
|
|
|
39
|
-
& + .nav__toggle {
|
|
39
|
+
& + .mx-nav__toggle {
|
|
40
40
|
color: var(--nav-expanded-foreground, inherit);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -70,24 +70,12 @@
|
|
|
70
70
|
justify-content: flex-start;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
& > li {
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
& > li > a:where(:not(.mx-button)) {
|
|
74
|
+
padding-block: var(--item-spacing, var(--spacing-xxs));
|
|
75
|
+
padding-inline-end: var(--toggle-gap, var(--item-spacing, var(--spacing-xxs)));
|
|
76
76
|
|
|
77
77
|
@media (--global-nav-up) {
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
& > a:where(:not(.button)) {
|
|
82
|
-
padding-block: var(--item-spacing, var(--spacing-xxs));
|
|
83
|
-
padding-inline-end: var(
|
|
84
|
-
--toggle-gap,
|
|
85
|
-
var(--item-spacing, var(--spacing-xxs))
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
@media (--global-nav-up) {
|
|
89
|
-
padding-inline-start: var(--item-spacing, var(--spacing-xxs));
|
|
90
|
-
}
|
|
78
|
+
padding-inline-start: var(--item-spacing, var(--spacing-xxs));
|
|
91
79
|
}
|
|
92
80
|
}
|
|
93
81
|
}
|
|
@@ -114,20 +102,11 @@
|
|
|
114
102
|
}
|
|
115
103
|
}
|
|
116
104
|
|
|
117
|
-
& > li {
|
|
118
|
-
|
|
119
|
-
border-block-start: var(--line-width, 1px) solid
|
|
120
|
-
var(--line-colour, var(--colour-border));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
& > a {
|
|
124
|
-
&:where(:not(.button)) {
|
|
125
|
-
padding: var(--item-spacing, var(--spacing-xxs));
|
|
105
|
+
& > li > a:where(:not(.mx-button)) {
|
|
106
|
+
padding: var(--item-spacing, var(--spacing-xxs));
|
|
126
107
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
}
|
|
108
|
+
@media (--global-nav-down) {
|
|
109
|
+
padding-inline-start: var(--spacing-l);
|
|
131
110
|
}
|
|
132
111
|
}
|
|
133
112
|
}
|
|
@@ -143,8 +122,7 @@
|
|
|
143
122
|
}
|
|
144
123
|
|
|
145
124
|
& .mx-nav__separator {
|
|
146
|
-
border-block-start: var(--line-width, 1px) solid
|
|
147
|
-
var(--line-colour, var(--colour-border));
|
|
125
|
+
border-block-start: var(--line-width, 1px) solid var(--line-colour, var(--colour-border));
|
|
148
126
|
}
|
|
149
127
|
}
|
|
150
128
|
}
|
|
@@ -25,10 +25,7 @@
|
|
|
25
25
|
padding-inline-start: 0;
|
|
26
26
|
border-block-start: 0;
|
|
27
27
|
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
|
28
|
-
background-color: var(
|
|
29
|
-
--expanded-background,
|
|
30
|
-
var(--colour-background-alt)
|
|
31
|
-
);
|
|
28
|
+
background-color: var(--expanded-background, var(--colour-background-alt));
|
|
32
29
|
color: var(--expanded-foreground, inherit);
|
|
33
30
|
}
|
|
34
31
|
|
|
@@ -39,10 +39,7 @@
|
|
|
39
39
|
border: 0;
|
|
40
40
|
appearance: none;
|
|
41
41
|
position: absolute;
|
|
42
|
-
color: var(
|
|
43
|
-
--toggle-foreground,
|
|
44
|
-
var(--foreground, var(--colour-foreground))
|
|
45
|
-
);
|
|
42
|
+
color: var(--toggle-foreground, var(--foreground, var(--colour-foreground)));
|
|
46
43
|
inline-size: var(--spacing-l);
|
|
47
44
|
block-size: var(--spacing-l);
|
|
48
45
|
inset-block-start: var(--toggle-top, 12px);
|
|
@@ -53,24 +53,12 @@ const PaginationProvider = ({
|
|
|
53
53
|
// Calculate the "from a to b of x" values.
|
|
54
54
|
const startVal = resultsPerPage * (currentPage - 1) + 1
|
|
55
55
|
const endVal = resultsPerPage * currentPage
|
|
56
|
-
const pageStart = useMemo<number>(
|
|
57
|
-
|
|
58
|
-
[currentPage, startVal],
|
|
59
|
-
)
|
|
60
|
-
const pageEnd = useMemo<number>(
|
|
61
|
-
() => (total > endVal ? endVal : total),
|
|
62
|
-
[total, endVal],
|
|
63
|
-
)
|
|
56
|
+
const pageStart = useMemo<number>(() => (currentPage > 1 ? startVal : 1), [currentPage, startVal])
|
|
57
|
+
const pageEnd = useMemo<number>(() => (total > endVal ? endVal : total), [total, endVal])
|
|
64
58
|
|
|
65
|
-
const showPager: boolean = useMemo(
|
|
66
|
-
() => total > resultsPerPage,
|
|
67
|
-
[total, resultsPerPage],
|
|
68
|
-
)
|
|
59
|
+
const showPager: boolean = useMemo(() => total > resultsPerPage, [total, resultsPerPage])
|
|
69
60
|
|
|
70
|
-
const lastPage: number = useMemo(
|
|
71
|
-
() => Math.ceil(total / resultsPerPage),
|
|
72
|
-
[total, resultsPerPage],
|
|
73
|
-
)
|
|
61
|
+
const lastPage: number = useMemo(() => Math.ceil(total / resultsPerPage), [total, resultsPerPage])
|
|
74
62
|
|
|
75
63
|
const visiblePages: number[] = useMemo(() => {
|
|
76
64
|
const pages: number[] = []
|
|
@@ -114,9 +102,7 @@ const PaginationProvider = ({
|
|
|
114
102
|
)
|
|
115
103
|
|
|
116
104
|
const showLastEllipsis: boolean = useMemo(
|
|
117
|
-
() =>
|
|
118
|
-
visiblePages.length !== 0 &&
|
|
119
|
-
visiblePages[visiblePages.length - 1] !== lastPage - 1,
|
|
105
|
+
() => visiblePages.length !== 0 && visiblePages[visiblePages.length - 1] !== lastPage - 1,
|
|
120
106
|
[visiblePages, lastPage],
|
|
121
107
|
)
|
|
122
108
|
|
|
@@ -36,11 +36,7 @@ const PaginationItem = ({
|
|
|
36
36
|
<span className={classNames("mx-icon", "mx-icon--arrow-left")}></span>
|
|
37
37
|
)}
|
|
38
38
|
<span>{as}</span>
|
|
39
|
-
{as === "next" && (
|
|
40
|
-
<span
|
|
41
|
-
className={classNames("mx-icon", "mx-icon--arrow-right")}
|
|
42
|
-
></span>
|
|
43
|
-
)}
|
|
39
|
+
{as === "next" && <span className={classNames("mx-icon", "mx-icon--arrow-right")}></span>}
|
|
44
40
|
</button>
|
|
45
41
|
)}
|
|
46
42
|
</li>
|
|
@@ -56,6 +56,34 @@ const meta: Meta<PaginationType> = {
|
|
|
56
56
|
}),
|
|
57
57
|
],
|
|
58
58
|
},
|
|
59
|
+
argTypes: {
|
|
60
|
+
previous: {
|
|
61
|
+
description: `[Link](/?path=/docs/atom-link--docs) component with the \`${Icons.ARROW_LEFT}\` [Icon](/?path=/docs/atom-icon--docs).`,
|
|
62
|
+
control: "text",
|
|
63
|
+
table: {
|
|
64
|
+
type: { summary: "Link" },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
next: {
|
|
68
|
+
description: `[Link](/?path=/docs/atom-link--docs) component with the \`${Icons.ARROW_RIGHT}\` [Icon](/?path=/docs/atom-icon--docs).`,
|
|
69
|
+
control: "text",
|
|
70
|
+
table: {
|
|
71
|
+
type: { summary: "Link" },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
pages: {
|
|
75
|
+
description:
|
|
76
|
+
"List of `PaginationItem` objects, with either a [Link](/?path=/docs/atom-link--docs) components where `current` is used for the active page, or `ellipsis=true`.",
|
|
77
|
+
type: {
|
|
78
|
+
name: "other",
|
|
79
|
+
required: true,
|
|
80
|
+
value: "array",
|
|
81
|
+
},
|
|
82
|
+
table: {
|
|
83
|
+
type: { summary: "PaginationItem[]" },
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
59
87
|
}
|
|
60
88
|
|
|
61
89
|
export default meta
|
|
@@ -16,9 +16,7 @@ const Pagination = (): JSX.Element => {
|
|
|
16
16
|
|
|
17
17
|
const handleClick: MouseEventHandler = e => {
|
|
18
18
|
const target = e.target as HTMLElement
|
|
19
|
-
const page: string = target
|
|
20
|
-
.closest("[data-page]")
|
|
21
|
-
?.getAttribute("data-page")
|
|
19
|
+
const page: string = target.closest("[data-page]")?.getAttribute("data-page")
|
|
22
20
|
if (!page) return
|
|
23
21
|
onClick(parseInt(page))
|
|
24
22
|
e.preventDefault()
|
|
@@ -27,9 +25,7 @@ const Pagination = (): JSX.Element => {
|
|
|
27
25
|
|
|
28
26
|
const handleMouseOver: MouseEventHandler = e => {
|
|
29
27
|
const target = e.target as HTMLElement
|
|
30
|
-
const page: string = target
|
|
31
|
-
.closest("[data-page]")
|
|
32
|
-
?.getAttribute("data-page")
|
|
28
|
+
const page: string = target.closest("[data-page]")?.getAttribute("data-page")
|
|
33
29
|
if (page) onMouseOver(parseInt(page))
|
|
34
30
|
}
|
|
35
31
|
|
|
@@ -58,11 +54,7 @@ const Pagination = (): JSX.Element => {
|
|
|
58
54
|
/>
|
|
59
55
|
))}
|
|
60
56
|
{showLastEllipsis && <PaginationItem as="ellipsis" />}
|
|
61
|
-
<PaginationItem
|
|
62
|
-
as="item"
|
|
63
|
-
number={lastPage}
|
|
64
|
-
active={currentPage === lastPage}
|
|
65
|
-
/>
|
|
57
|
+
<PaginationItem as="item" number={lastPage} active={currentPage === lastPage} />
|
|
66
58
|
<PaginationItem
|
|
67
59
|
as="next"
|
|
68
60
|
number={currentPage < lastPage ? currentPage + 1 : null}
|