@czi-sds/components 15.1.1 → 15.2.0
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/index.cjs.d.ts +5 -3
- package/dist/index.cjs.js +73 -31
- package/dist/index.esm.d.ts +5 -3
- package/dist/index.esm.js +73 -31
- package/dist/src/common/helpers/scrollStop.d.ts +8 -0
- package/dist/src/common/helpers/scrollStop.js +54 -0
- package/dist/src/common/storybookConstants.d.ts +3 -0
- package/dist/src/common/storybookConstants.js +2 -0
- package/dist/src/common/utils.d.ts +2 -0
- package/dist/src/common/utils.js +9 -0
- package/dist/src/common/warnings.d.ts +10 -0
- package/dist/src/common/warnings.js +60 -0
- package/dist/src/common/warnings.test.d.ts +1 -0
- package/dist/src/common/warnings.test.js +19 -0
- package/dist/src/core/Accordion/Accordion.namespace-test.d.ts +1 -0
- package/dist/src/core/Accordion/Accordion.namespace-test.js +18 -0
- package/dist/src/core/Accordion/__snapshots__/index.test.js.snap +64 -0
- package/dist/src/core/Accordion/components/AccordionDetails/index.d.ts +3 -0
- package/dist/src/core/Accordion/components/AccordionDetails/index.js +9 -0
- package/dist/src/core/Accordion/components/AccordionDetails/style.d.ts +2 -0
- package/dist/src/core/Accordion/components/AccordionDetails/style.js +16 -0
- package/dist/src/core/Accordion/components/AccordionHeader/index.d.ts +7 -0
- package/dist/src/core/Accordion/components/AccordionHeader/index.js +13 -0
- package/dist/src/core/Accordion/components/AccordionHeader/style.d.ts +27 -0
- package/dist/src/core/Accordion/components/AccordionHeader/style.js +21 -0
- package/dist/src/core/Accordion/index.d.ts +12 -0
- package/dist/src/core/Accordion/index.js +38 -0
- package/dist/src/core/Accordion/index.stories.d.ts +28 -0
- package/dist/src/core/Accordion/index.stories.js +82 -0
- package/dist/src/core/Accordion/index.test.d.ts +1 -0
- package/dist/src/core/Accordion/index.test.js +58 -0
- package/dist/src/core/Accordion/style.d.ts +30 -0
- package/dist/src/core/Accordion/style.js +28 -0
- package/dist/src/core/Alert/index.d.ts +7 -0
- package/dist/src/core/Alert/index.js +22 -0
- package/dist/src/core/Alert/index.stories.d.ts +19 -0
- package/dist/src/core/Alert/index.stories.js +70 -0
- package/dist/src/core/Alert/style.d.ts +1 -0
- package/dist/src/core/Alert/style.js +23 -0
- package/dist/src/core/Banner/Banner.namespace-test.d.ts +1 -0
- package/dist/src/core/Banner/Banner.namespace-test.js +18 -0
- package/dist/src/core/Banner/banner.test.d.ts +1 -0
- package/dist/src/core/Banner/banner.test.js +126 -0
- package/dist/src/core/Banner/index.d.ts +11 -0
- package/dist/src/core/Banner/index.js +47 -0
- package/dist/src/core/Banner/index.stories.d.ts +46 -0
- package/dist/src/core/Banner/index.stories.js +106 -0
- package/dist/src/core/Banner/style.d.ts +13 -0
- package/dist/src/core/Banner/style.js +55 -0
- package/dist/src/core/Button/Button.namespace-test.d.ts +1 -0
- package/dist/src/core/Button/Button.namespace-test.js +18 -0
- package/dist/src/core/Button/index.d.ts +18 -0
- package/dist/src/core/Button/index.js +54 -0
- package/dist/src/core/Button/index.stories.d.ts +72 -0
- package/dist/src/core/Button/index.stories.js +215 -0
- package/dist/src/core/Button/index.test.d.ts +1 -0
- package/dist/src/core/Button/index.test.js +40 -0
- package/dist/src/core/Button/style.d.ts +180 -0
- package/dist/src/core/Button/style.js +59 -0
- package/dist/src/core/ButtonDropdown/ButtonDropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/ButtonDropdown/ButtonDropdown.namespace-test.js +18 -0
- package/dist/src/core/ButtonDropdown/index.d.ts +18 -0
- package/dist/src/core/ButtonDropdown/index.js +30 -0
- package/dist/src/core/ButtonDropdown/index.stories.d.ts +35 -0
- package/dist/src/core/ButtonDropdown/index.stories.js +79 -0
- package/dist/src/core/ButtonDropdown/index.test.d.ts +1 -0
- package/dist/src/core/ButtonDropdown/index.test.js +41 -0
- package/dist/src/core/ButtonIcon/ButtonIcon.namespace-test.d.ts +1 -0
- package/dist/src/core/ButtonIcon/ButtonIcon.namespace-test.js +18 -0
- package/dist/src/core/ButtonIcon/index.d.ts +15 -0
- package/dist/src/core/ButtonIcon/index.js +34 -0
- package/dist/src/core/ButtonIcon/index.stories.d.ts +39 -0
- package/dist/src/core/ButtonIcon/index.stories.js +239 -0
- package/dist/src/core/ButtonIcon/index.test.d.ts +1 -0
- package/dist/src/core/ButtonIcon/index.test.js +41 -0
- package/dist/src/core/ButtonIcon/style.d.ts +41 -0
- package/dist/src/core/ButtonIcon/style.js +68 -0
- package/dist/src/core/Callout/Callout.namespace-test.d.ts +1 -0
- package/dist/src/core/Callout/Callout.namespace-test.js +18 -0
- package/dist/src/core/Callout/components/CalloutTitle/index.d.ts +3 -0
- package/dist/src/core/Callout/components/CalloutTitle/index.js +9 -0
- package/dist/src/core/Callout/components/CalloutTitle/style.d.ts +1 -0
- package/dist/src/core/Callout/components/CalloutTitle/style.js +16 -0
- package/dist/src/core/Callout/index.d.ts +18 -0
- package/dist/src/core/Callout/index.js +89 -0
- package/dist/src/core/Callout/index.stories.d.ts +14 -0
- package/dist/src/core/Callout/index.stories.js +80 -0
- package/dist/src/core/Callout/style.d.ts +7 -0
- package/dist/src/core/Callout/style.js +31 -0
- package/dist/src/core/CellBasic/CellBasic.namespace-test.d.ts +1 -0
- package/dist/src/core/CellBasic/CellBasic.namespace-test.js +7 -0
- package/dist/src/core/CellBasic/index.d.ts +21 -0
- package/dist/src/core/CellBasic/index.js +32 -0
- package/dist/src/core/CellBasic/index.stories.d.ts +33 -0
- package/dist/src/core/CellBasic/index.stories.js +143 -0
- package/dist/src/core/CellBasic/index.test.d.ts +1 -0
- package/dist/src/core/CellBasic/index.test.js +124 -0
- package/dist/src/core/CellBasic/style.d.ts +18 -0
- package/dist/src/core/CellBasic/style.js +86 -0
- package/dist/src/core/CellComponent/CellComponent.namespace-test.d.ts +1 -0
- package/dist/src/core/CellComponent/CellComponent.namespace-test.js +7 -0
- package/dist/src/core/CellComponent/index.d.ts +8 -0
- package/dist/src/core/CellComponent/index.js +21 -0
- package/dist/src/core/CellComponent/index.stories.d.ts +21 -0
- package/dist/src/core/CellComponent/index.stories.js +92 -0
- package/dist/src/core/CellComponent/index.test.d.ts +1 -0
- package/dist/src/core/CellComponent/index.test.js +110 -0
- package/dist/src/core/CellComponent/style.d.ts +9 -0
- package/dist/src/core/CellComponent/style.js +32 -0
- package/dist/src/core/CellHeader/CellHeader.namespace-test.d.ts +1 -0
- package/dist/src/core/CellHeader/CellHeader.namespace-test.js +8 -0
- package/dist/src/core/CellHeader/index.d.ts +20 -0
- package/dist/src/core/CellHeader/index.js +47 -0
- package/dist/src/core/CellHeader/index.stories.d.ts +26 -0
- package/dist/src/core/CellHeader/index.stories.js +128 -0
- package/dist/src/core/CellHeader/index.test.d.ts +1 -0
- package/dist/src/core/CellHeader/index.test.js +112 -0
- package/dist/src/core/CellHeader/style.d.ts +9 -0
- package/dist/src/core/CellHeader/style.js +50 -0
- package/dist/src/core/Chip/index.d.ts +9 -0
- package/dist/src/core/Chip/index.js +29 -0
- package/dist/src/core/Chip/index.stories.d.ts +58 -0
- package/dist/src/core/Chip/index.stories.js +90 -0
- package/dist/src/core/Chip/style.d.ts +26 -0
- package/dist/src/core/Chip/style.js +95 -0
- package/dist/src/core/ComplexFilter/ComplexFilter.namespace-test.d.ts +1 -0
- package/dist/src/core/ComplexFilter/ComplexFilter.namespace-test.js +20 -0
- package/dist/src/core/ComplexFilter/components/Chips/index.d.ts +8 -0
- package/dist/src/core/ComplexFilter/components/Chips/index.js +21 -0
- package/dist/src/core/ComplexFilter/index.d.ts +23 -0
- package/dist/src/core/ComplexFilter/index.js +119 -0
- package/dist/src/core/ComplexFilter/index.stories.d.ts +33 -0
- package/dist/src/core/ComplexFilter/index.stories.js +126 -0
- package/dist/src/core/ComplexFilter/index.test.d.ts +1 -0
- package/dist/src/core/ComplexFilter/index.test.js +51 -0
- package/dist/src/core/ComplexFilter/style.d.ts +3 -0
- package/dist/src/core/ComplexFilter/style.js +15 -0
- package/dist/src/core/Dialog/Dialog.namespace-test.d.ts +1 -0
- package/dist/src/core/Dialog/Dialog.namespace-test.js +8 -0
- package/dist/src/core/Dialog/__snapshots__/index.test.js.snap +382 -0
- package/dist/src/core/Dialog/components/common.d.ts +6 -0
- package/dist/src/core/Dialog/components/common.js +5 -0
- package/dist/src/core/Dialog/index.d.ts +18 -0
- package/dist/src/core/Dialog/index.js +50 -0
- package/dist/src/core/Dialog/index.stories.d.ts +46 -0
- package/dist/src/core/Dialog/index.stories.js +147 -0
- package/dist/src/core/Dialog/index.test.d.ts +1 -0
- package/dist/src/core/Dialog/index.test.js +62 -0
- package/dist/src/core/DialogActions/index.d.ts +9 -0
- package/dist/src/core/DialogActions/index.js +23 -0
- package/dist/src/core/DialogActions/style.d.ts +5 -0
- package/dist/src/core/DialogActions/style.js +20 -0
- package/dist/src/core/DialogContent/index.d.ts +5 -0
- package/dist/src/core/DialogContent/index.js +23 -0
- package/dist/src/core/DialogContent/style.d.ts +1 -0
- package/dist/src/core/DialogContent/style.js +11 -0
- package/dist/src/core/DialogPaper/index.d.ts +8 -0
- package/dist/src/core/DialogPaper/index.js +27 -0
- package/dist/src/core/DialogPaper/style.d.ts +16 -0
- package/dist/src/core/DialogPaper/style.js +44 -0
- package/dist/src/core/DialogTitle/components/CloseButton/index.d.ts +5 -0
- package/dist/src/core/DialogTitle/components/CloseButton/index.js +31 -0
- package/dist/src/core/DialogTitle/components/CloseButton/style.d.ts +2 -0
- package/dist/src/core/DialogTitle/components/CloseButton/style.js +18 -0
- package/dist/src/core/DialogTitle/index.d.ts +14 -0
- package/dist/src/core/DialogTitle/index.js +42 -0
- package/dist/src/core/DialogTitle/style.d.ts +46 -0
- package/dist/src/core/DialogTitle/style.js +20 -0
- package/dist/src/core/Dropdown/Dropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/Dropdown/Dropdown.namespace-test.js +20 -0
- package/dist/src/core/Dropdown/index.d.ts +31 -0
- package/dist/src/core/Dropdown/index.js +160 -0
- package/dist/src/core/Dropdown/index.stories.d.ts +68 -0
- package/dist/src/core/Dropdown/index.stories.js +215 -0
- package/dist/src/core/Dropdown/index.test.d.ts +1 -0
- package/dist/src/core/Dropdown/index.test.js +229 -0
- package/dist/src/core/Dropdown/style.d.ts +5 -0
- package/dist/src/core/Dropdown/style.js +19 -0
- package/dist/src/core/DropdownMenu/DropdownMenu.namespace-test.d.ts +1 -0
- package/dist/src/core/DropdownMenu/DropdownMenu.namespace-test.js +20 -0
- package/dist/src/core/DropdownMenu/GITHUB_LABELS.d.ts +2 -0
- package/dist/src/core/DropdownMenu/GITHUB_LABELS.js +83 -0
- package/dist/src/core/DropdownMenu/index.d.ts +42 -0
- package/dist/src/core/DropdownMenu/index.js +83 -0
- package/dist/src/core/DropdownMenu/index.stories.d.ts +55 -0
- package/dist/src/core/DropdownMenu/index.stories.js +438 -0
- package/dist/src/core/DropdownMenu/index.test.d.ts +1 -0
- package/dist/src/core/DropdownMenu/index.test.js +51 -0
- package/dist/src/core/DropdownMenu/style.d.ts +40 -0
- package/dist/src/core/DropdownMenu/style.js +85 -0
- package/dist/src/core/Icon/Icon.namespace-test.d.ts +1 -0
- package/dist/src/core/Icon/Icon.namespace-test.js +7 -0
- package/dist/src/core/Icon/index.d.ts +14 -0
- package/dist/src/core/Icon/index.js +25 -0
- package/dist/src/core/Icon/index.stories.d.ts +34 -0
- package/dist/src/core/Icon/index.stories.js +171 -0
- package/dist/src/core/Icon/map.d.ts +98 -0
- package/dist/src/core/Icon/map.js +476 -0
- package/dist/src/core/Icon/style.d.ts +36 -0
- package/dist/src/core/Icon/style.js +42 -0
- package/dist/src/core/InputCheckbox/InputCheckbox.namespace-test.d.ts +1 -0
- package/dist/src/core/InputCheckbox/InputCheckbox.namespace-test.js +9 -0
- package/dist/src/core/InputCheckbox/index.d.ts +13 -0
- package/dist/src/core/InputCheckbox/index.js +55 -0
- package/dist/src/core/InputCheckbox/index.stories.d.ts +35 -0
- package/dist/src/core/InputCheckbox/index.stories.js +119 -0
- package/dist/src/core/InputCheckbox/index.test.d.ts +1 -0
- package/dist/src/core/InputCheckbox/index.test.js +62 -0
- package/dist/src/core/InputCheckbox/styles.d.ts +6 -0
- package/dist/src/core/InputCheckbox/styles.js +24 -0
- package/dist/src/core/InputDropdown/InputDropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/InputDropdown/InputDropdown.namespace-test.js +8 -0
- package/dist/src/core/InputDropdown/index.d.ts +8 -0
- package/dist/src/core/InputDropdown/index.js +83 -0
- package/dist/src/core/InputDropdown/index.stories.d.ts +59 -0
- package/dist/src/core/InputDropdown/index.stories.js +264 -0
- package/dist/src/core/InputDropdown/index.test.d.ts +1 -0
- package/dist/src/core/InputDropdown/index.test.js +58 -0
- package/dist/src/core/InputDropdown/style.d.ts +38 -0
- package/dist/src/core/InputDropdown/style.js +130 -0
- package/dist/src/core/InputRadio/InputRadio.namespace-test.d.ts +1 -0
- package/dist/src/core/InputRadio/InputRadio.namespace-test.js +8 -0
- package/dist/src/core/InputRadio/index.d.ts +14 -0
- package/dist/src/core/InputRadio/index.js +40 -0
- package/dist/src/core/InputRadio/index.stories.d.ts +32 -0
- package/dist/src/core/InputRadio/index.stories.js +64 -0
- package/dist/src/core/InputRadio/index.test.d.ts +1 -0
- package/dist/src/core/InputRadio/index.test.js +92 -0
- package/dist/src/core/InputRadio/style.d.ts +6 -0
- package/dist/src/core/InputRadio/style.js +24 -0
- package/dist/src/core/InputSearch/InputSearch.namespace-test.d.ts +1 -0
- package/dist/src/core/InputSearch/InputSearch.namespace-test.js +8 -0
- package/dist/src/core/InputSearch/index.d.ts +16 -0
- package/dist/src/core/InputSearch/index.js +75 -0
- package/dist/src/core/InputSearch/index.stories.d.ts +35 -0
- package/dist/src/core/InputSearch/index.stories.js +104 -0
- package/dist/src/core/InputSearch/index.test.d.ts +1 -0
- package/dist/src/core/InputSearch/index.test.js +70 -0
- package/dist/src/core/InputSearch/style.d.ts +12 -0
- package/dist/src/core/InputSearch/style.js +47 -0
- package/dist/src/core/InputSlider/InputSlider.namespace-test.d.ts +1 -0
- package/dist/src/core/InputSlider/InputSlider.namespace-test.js +7 -0
- package/dist/src/core/InputSlider/__snapshots__/index.test.js.snap +124 -0
- package/dist/src/core/InputSlider/index.d.ts +8 -0
- package/dist/src/core/InputSlider/index.js +23 -0
- package/dist/src/core/InputSlider/index.stories.d.ts +43 -0
- package/dist/src/core/InputSlider/index.stories.js +160 -0
- package/dist/src/core/InputSlider/index.test.d.ts +1 -0
- package/dist/src/core/InputSlider/index.test.js +52 -0
- package/dist/src/core/InputSlider/style.d.ts +76 -0
- package/dist/src/core/InputSlider/style.js +34 -0
- package/dist/src/core/InputText/InputText.namespace-test.d.ts +1 -0
- package/dist/src/core/InputText/InputText.namespace-test.js +7 -0
- package/dist/src/core/InputText/__snapshots__/index.test.js.snap +10 -0
- package/dist/src/core/InputText/index.d.ts +14 -0
- package/dist/src/core/InputText/index.js +52 -0
- package/dist/src/core/InputText/index.stories.d.ts +29 -0
- package/dist/src/core/InputText/index.stories.js +100 -0
- package/dist/src/core/InputText/index.test.d.ts +1 -0
- package/dist/src/core/InputText/index.test.js +67 -0
- package/dist/src/core/InputText/style.d.ts +13 -0
- package/dist/src/core/InputText/style.js +45 -0
- package/dist/src/core/InputToggle/InputToggle.namespace-test.d.ts +1 -0
- package/dist/src/core/InputToggle/InputToggle.namespace-test.js +7 -0
- package/dist/src/core/InputToggle/__snapshots__/index.test.js.snap +26 -0
- package/dist/src/core/InputToggle/index.d.ts +7 -0
- package/dist/src/core/InputToggle/index.js +42 -0
- package/dist/src/core/InputToggle/index.stories.d.ts +20 -0
- package/dist/src/core/InputToggle/index.stories.js +63 -0
- package/dist/src/core/InputToggle/index.test.d.ts +1 -0
- package/dist/src/core/InputToggle/index.test.js +52 -0
- package/dist/src/core/InputToggle/style.d.ts +9 -0
- package/dist/src/core/InputToggle/style.js +38 -0
- package/dist/src/core/Link/Link.namespace-test.d.ts +1 -0
- package/dist/src/core/Link/Link.namespace-test.js +7 -0
- package/dist/src/core/Link/index.d.ts +8 -0
- package/dist/src/core/Link/index.js +28 -0
- package/dist/src/core/Link/index.stories.d.ts +27 -0
- package/dist/src/core/Link/index.stories.js +99 -0
- package/dist/src/core/Link/style.d.ts +9 -0
- package/dist/src/core/Link/style.js +30 -0
- package/dist/src/core/List/List.namespace-test.d.ts +1 -0
- package/dist/src/core/List/List.namespace-test.js +7 -0
- package/dist/src/core/List/index.d.ts +8 -0
- package/dist/src/core/List/index.js +23 -0
- package/dist/src/core/List/index.stories.d.ts +4 -0
- package/dist/src/core/List/index.stories.js +30 -0
- package/dist/src/core/List/style.d.ts +17 -0
- package/dist/src/core/List/style.js +33 -0
- package/dist/src/core/ListItem/ListItem.namespace-test.d.ts +1 -0
- package/dist/src/core/ListItem/ListItem.namespace-test.js +7 -0
- package/dist/src/core/ListItem/index.d.ts +9 -0
- package/dist/src/core/ListItem/index.js +24 -0
- package/dist/src/core/ListItem/style.d.ts +26 -0
- package/dist/src/core/ListItem/style.js +56 -0
- package/dist/src/core/ListSubheader/ListSubheader.namespace-test.d.ts +1 -0
- package/dist/src/core/ListSubheader/ListSubheader.namespace-test.js +7 -0
- package/dist/src/core/ListSubheader/index.d.ts +7 -0
- package/dist/src/core/ListSubheader/index.js +22 -0
- package/dist/src/core/ListSubheader/style.d.ts +12 -0
- package/dist/src/core/ListSubheader/style.js +16 -0
- package/dist/src/core/LoadingIndicator/LoadingIndicator.namespace-test.d.ts +1 -0
- package/dist/src/core/LoadingIndicator/LoadingIndicator.namespace-test.js +7 -0
- package/dist/src/core/LoadingIndicator/index.d.ts +4 -0
- package/dist/src/core/LoadingIndicator/index.js +13 -0
- package/dist/src/core/LoadingIndicator/index.stories.d.ts +24 -0
- package/dist/src/core/LoadingIndicator/index.stories.js +77 -0
- package/dist/src/core/LoadingIndicator/index.test.d.ts +1 -0
- package/dist/src/core/LoadingIndicator/index.test.js +41 -0
- package/dist/src/core/LoadingIndicator/style.d.ts +7 -0
- package/dist/src/core/LoadingIndicator/style.js +36 -0
- package/dist/src/core/Menu/Menu.namespace-test.d.ts +1 -0
- package/dist/src/core/Menu/Menu.namespace-test.js +8 -0
- package/dist/src/core/Menu/index.d.ts +7 -0
- package/dist/src/core/Menu/index.js +30 -0
- package/dist/src/core/Menu/index.stories.d.ts +17 -0
- package/dist/src/core/Menu/index.stories.js +55 -0
- package/dist/src/core/Menu/style.d.ts +1 -0
- package/dist/src/core/Menu/style.js +15 -0
- package/dist/src/core/MenuItem/MenuItem.namespace-test.d.ts +1 -0
- package/dist/src/core/MenuItem/MenuItem.namespace-test.js +8 -0
- package/dist/src/core/MenuItem/index.d.ts +21 -0
- package/dist/src/core/MenuItem/index.js +42 -0
- package/dist/src/core/MenuItem/index.stories.d.ts +35 -0
- package/dist/src/core/MenuItem/index.stories.js +188 -0
- package/dist/src/core/MenuItem/index.test.d.ts +1 -0
- package/dist/src/core/MenuItem/index.test.js +41 -0
- package/dist/src/core/MenuItem/style.d.ts +65 -0
- package/dist/src/core/MenuItem/style.js +58 -0
- package/dist/src/core/MenuSelect/index.d.ts +19 -0
- package/dist/src/core/MenuSelect/index.js +70 -0
- package/dist/src/core/MenuSelect/index.stories.d.ts +34 -0
- package/dist/src/core/MenuSelect/index.stories.js +154 -0
- package/dist/src/core/MenuSelect/style.d.ts +12 -0
- package/dist/src/core/MenuSelect/style.js +45 -0
- package/dist/src/core/NavigationJumpTo/NavigationJumpTo.namespace-test.d.ts +1 -0
- package/dist/src/core/NavigationJumpTo/NavigationJumpTo.namespace-test.js +13 -0
- package/dist/src/core/NavigationJumpTo/__snapshots__/index.test.js.snap +319 -0
- package/dist/src/core/NavigationJumpTo/index.d.ts +13 -0
- package/dist/src/core/NavigationJumpTo/index.js +111 -0
- package/dist/src/core/NavigationJumpTo/index.stories.d.ts +56 -0
- package/dist/src/core/NavigationJumpTo/index.stories.js +216 -0
- package/dist/src/core/NavigationJumpTo/index.test.d.ts +1 -0
- package/dist/src/core/NavigationJumpTo/index.test.js +87 -0
- package/dist/src/core/NavigationJumpTo/style.d.ts +106 -0
- package/dist/src/core/NavigationJumpTo/style.js +27 -0
- package/dist/src/core/NavigationJumpTo/useIntersection.d.ts +19 -0
- package/dist/src/core/NavigationJumpTo/useIntersection.js +67 -0
- package/dist/src/core/Notification/Notification.namespace-test.d.ts +1 -0
- package/dist/src/core/Notification/Notification.namespace-test.js +8 -0
- package/dist/src/core/Notification/index.d.ts +17 -0
- package/dist/src/core/Notification/index.js +70 -0
- package/dist/src/core/Notification/index.stories.d.ts +43 -0
- package/dist/src/core/Notification/index.stories.js +186 -0
- package/dist/src/core/Notification/index.test.d.ts +1 -0
- package/dist/src/core/Notification/index.test.js +115 -0
- package/dist/src/core/Notification/style.d.ts +1 -0
- package/dist/src/core/Notification/style.js +26 -0
- package/dist/src/core/Pagination/Pagination.namespace-test.d.ts +1 -0
- package/dist/src/core/Pagination/Pagination.namespace-test.js +8 -0
- package/dist/src/core/Pagination/components/PageListDropdown/index.d.ts +7 -0
- package/dist/src/core/Pagination/components/PageListDropdown/index.js +27 -0
- package/dist/src/core/Pagination/components/PageListDropdown/style.d.ts +1 -0
- package/dist/src/core/Pagination/components/PageListDropdown/style.js +14 -0
- package/dist/src/core/Pagination/index.d.ts +15 -0
- package/dist/src/core/Pagination/index.js +47 -0
- package/dist/src/core/Pagination/index.stories.d.ts +21 -0
- package/dist/src/core/Pagination/index.stories.js +99 -0
- package/dist/src/core/Pagination/index.test.d.ts +1 -0
- package/dist/src/core/Pagination/index.test.js +128 -0
- package/dist/src/core/Pagination/style.d.ts +13 -0
- package/dist/src/core/Pagination/style.js +62 -0
- package/dist/src/core/Pagination/usePagination.d.ts +9 -0
- package/dist/src/core/Pagination/usePagination.js +69 -0
- package/dist/src/core/SegmentedControl/SegmentedControl.namespace-test.d.ts +1 -0
- package/dist/src/core/SegmentedControl/SegmentedControl.namespace-test.js +12 -0
- package/dist/src/core/SegmentedControl/index.d.ts +15 -0
- package/dist/src/core/SegmentedControl/index.js +38 -0
- package/dist/src/core/SegmentedControl/index.stories.d.ts +49 -0
- package/dist/src/core/SegmentedControl/index.stories.js +128 -0
- package/dist/src/core/SegmentedControl/index.test.d.ts +1 -0
- package/dist/src/core/SegmentedControl/index.test.js +41 -0
- package/dist/src/core/SegmentedControl/style.d.ts +2 -0
- package/dist/src/core/SegmentedControl/style.js +23 -0
- package/dist/src/core/Table/Table.namespace-test.d.ts +1 -0
- package/dist/src/core/Table/Table.namespace-test.js +7 -0
- package/dist/src/core/Table/components/common.d.ts +6 -0
- package/dist/src/core/Table/components/common.js +5 -0
- package/dist/src/core/Table/index.d.ts +7 -0
- package/dist/src/core/Table/index.js +21 -0
- package/dist/src/core/Table/index.stories.d.ts +18 -0
- package/dist/src/core/Table/index.stories.js +64 -0
- package/dist/src/core/Table/index.test.d.ts +1 -0
- package/dist/src/core/Table/index.test.js +89 -0
- package/dist/src/core/Table/style.d.ts +2 -0
- package/dist/src/core/Table/style.js +10 -0
- package/dist/src/core/TableHeader/TableHeader.namespace-test.d.ts +1 -0
- package/dist/src/core/TableHeader/TableHeader.namespace-test.js +7 -0
- package/dist/src/core/TableHeader/index.d.ts +6 -0
- package/dist/src/core/TableHeader/index.js +25 -0
- package/dist/src/core/TableHeader/index.stories.d.ts +12 -0
- package/dist/src/core/TableHeader/index.stories.js +38 -0
- package/dist/src/core/TableHeader/index.test.d.ts +1 -0
- package/dist/src/core/TableHeader/index.test.js +41 -0
- package/dist/src/core/TableHeader/style.d.ts +2 -0
- package/dist/src/core/TableHeader/style.js +14 -0
- package/dist/src/core/TableRow/TableRow.namespace-test.d.ts +1 -0
- package/dist/src/core/TableRow/TableRow.namespace-test.js +7 -0
- package/dist/src/core/TableRow/__snapshots__/index.test.js.snap +100 -0
- package/dist/src/core/TableRow/index.d.ts +13 -0
- package/dist/src/core/TableRow/index.js +28 -0
- package/dist/src/core/TableRow/index.stories.d.ts +24 -0
- package/dist/src/core/TableRow/index.stories.js +77 -0
- package/dist/src/core/TableRow/index.test.d.ts +1 -0
- package/dist/src/core/TableRow/index.test.js +92 -0
- package/dist/src/core/TableRow/style.d.ts +10 -0
- package/dist/src/core/TableRow/style.js +34 -0
- package/dist/src/core/Tabs/Tabs.namespace-test.d.ts +1 -0
- package/dist/src/core/Tabs/Tabs.namespace-test.js +8 -0
- package/dist/src/core/Tabs/__snapshots__/index.test.js.snap +46 -0
- package/dist/src/core/Tabs/components/LabelWithCount/index.d.ts +7 -0
- package/dist/src/core/Tabs/components/LabelWithCount/index.js +11 -0
- package/dist/src/core/Tabs/components/LabelWithCount/style.d.ts +10 -0
- package/dist/src/core/Tabs/components/LabelWithCount/style.js +43 -0
- package/dist/src/core/Tabs/components/common.d.ts +5 -0
- package/dist/src/core/Tabs/components/common.js +5 -0
- package/dist/src/core/Tabs/index.d.ts +13 -0
- package/dist/src/core/Tabs/index.js +89 -0
- package/dist/src/core/Tabs/index.stories.d.ts +38 -0
- package/dist/src/core/Tabs/index.stories.js +154 -0
- package/dist/src/core/Tabs/index.test.d.ts +1 -0
- package/dist/src/core/Tabs/index.test.js +48 -0
- package/dist/src/core/Tabs/style.d.ts +115 -0
- package/dist/src/core/Tabs/style.js +53 -0
- package/dist/src/core/Tag/Tag.namespace-test.d.ts +1 -0
- package/dist/src/core/Tag/Tag.namespace-test.js +7 -0
- package/dist/src/core/Tag/index.d.ts +17 -0
- package/dist/src/core/Tag/index.js +27 -0
- package/dist/src/core/Tag/index.stories.d.ts +98 -0
- package/dist/src/core/Tag/index.stories.js +238 -0
- package/dist/src/core/Tag/index.test.d.ts +1 -0
- package/dist/src/core/Tag/index.test.js +40 -0
- package/dist/src/core/Tag/index.testUtils.d.ts +8 -0
- package/dist/src/core/Tag/index.testUtils.js +108 -0
- package/dist/src/core/Tag/style.d.ts +29 -0
- package/dist/src/core/Tag/style.js +100 -0
- package/dist/src/core/TagFilter/TagFilter.namespace-test.d.ts +1 -0
- package/dist/src/core/TagFilter/TagFilter.namespace-test.js +8 -0
- package/dist/src/core/TagFilter/__snapshots__/index.test.js.snap +46 -0
- package/dist/src/core/TagFilter/index.d.ts +12 -0
- package/dist/src/core/TagFilter/index.js +23 -0
- package/dist/src/core/TagFilter/index.stories.d.ts +44 -0
- package/dist/src/core/TagFilter/index.stories.js +121 -0
- package/dist/src/core/TagFilter/index.test.d.ts +1 -0
- package/dist/src/core/TagFilter/index.test.js +40 -0
- package/dist/src/core/TagFilter/style.d.ts +7 -0
- package/dist/src/core/TagFilter/style.js +19 -0
- package/dist/src/core/Tooltip/Tooltip.namespace-test.d.ts +1 -0
- package/dist/src/core/Tooltip/Tooltip.namespace-test.js +7 -0
- package/dist/src/core/Tooltip/index.d.ts +14 -0
- package/dist/src/core/Tooltip/index.js +87 -0
- package/dist/src/core/Tooltip/index.stories.d.ts +48 -0
- package/dist/src/core/Tooltip/index.stories.js +257 -0
- package/dist/src/core/Tooltip/index.test.d.ts +1 -0
- package/dist/src/core/Tooltip/index.test.js +102 -0
- package/dist/src/core/Tooltip/style.d.ts +23 -0
- package/dist/src/core/Tooltip/style.js +47 -0
- package/dist/src/core/TooltipCondensed/TooltipCondensed.namespace-test.d.ts +1 -0
- package/dist/src/core/TooltipCondensed/TooltipCondensed.namespace-test.js +7 -0
- package/dist/src/core/TooltipCondensed/index.d.ts +13 -0
- package/dist/src/core/TooltipCondensed/index.js +43 -0
- package/dist/src/core/TooltipCondensed/index.stories.d.ts +27 -0
- package/dist/src/core/TooltipCondensed/index.stories.js +72 -0
- package/dist/src/core/TooltipCondensed/index.test.d.ts +1 -0
- package/dist/src/core/TooltipCondensed/index.test.js +85 -0
- package/dist/src/core/TooltipCondensed/style.d.ts +6 -0
- package/dist/src/core/TooltipCondensed/style.js +22 -0
- package/dist/src/core/TooltipTable/TooltipTable.namespace-test.d.ts +1 -0
- package/dist/src/core/TooltipTable/TooltipTable.namespace-test.js +23 -0
- package/dist/src/core/TooltipTable/__snapshots__/index.test.js.snap +272 -0
- package/dist/src/core/TooltipTable/index.d.ts +8 -0
- package/dist/src/core/TooltipTable/index.js +35 -0
- package/dist/src/core/TooltipTable/index.stories.d.ts +32 -0
- package/dist/src/core/TooltipTable/index.stories.js +128 -0
- package/dist/src/core/TooltipTable/index.test.d.ts +1 -0
- package/dist/src/core/TooltipTable/index.test.js +109 -0
- package/dist/src/core/TooltipTable/style.d.ts +25 -0
- package/dist/src/core/TooltipTable/style.js +46 -0
- package/dist/src/core/styles/common/constants/black.d.ts +3 -0
- package/dist/src/core/styles/common/constants/black.js +7 -0
- package/dist/src/core/styles/common/constants/boxShadows.d.ts +5 -0
- package/dist/src/core/styles/common/constants/boxShadows.js +9 -0
- package/dist/src/core/styles/common/constants/fontWeights.d.ts +7 -0
- package/dist/src/core/styles/common/constants/fontWeights.js +11 -0
- package/dist/src/core/styles/common/constants/gray.d.ts +8 -0
- package/dist/src/core/styles/common/constants/gray.js +12 -0
- package/dist/src/core/styles/common/constants/spaces.d.ts +11 -0
- package/dist/src/core/styles/common/constants/spaces.js +15 -0
- package/dist/src/core/styles/common/constants/white.d.ts +3 -0
- package/dist/src/core/styles/common/constants/white.js +7 -0
- package/dist/src/core/styles/common/defaultTheme.d.ts +129 -0
- package/dist/src/core/styles/common/defaultTheme.js +414 -0
- package/dist/src/core/styles/common/mixins/fonts.d.ts +27 -0
- package/dist/src/core/styles/common/mixins/fonts.js +60 -0
- package/dist/src/core/styles/common/selectors/theme.d.ts +15 -0
- package/dist/src/core/styles/common/selectors/theme.js +63 -0
- package/dist/src/core/styles/index.d.ts +3 -0
- package/dist/src/core/styles/index.js +19 -0
- package/dist/src/index.d.ts +100 -0
- package/dist/src/index.js +170 -0
- package/dist/tsconfig-namespace-check.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
63
|
+
var story_utils_1 = require("@chanzuckerberg/story-utils");
|
|
64
|
+
var react_1 = require("@storybook/react");
|
|
65
|
+
var react_2 = require("@testing-library/react");
|
|
66
|
+
var snapshotTestStoryFile = __importStar(require("./index.stories"));
|
|
67
|
+
var index_stories_1 = __importStar(require("./index.stories"));
|
|
68
|
+
// Returns a component that already contain all decorators from story level, meta level and global level.
|
|
69
|
+
var Test = (0, react_1.composeStory)(index_stories_1.Test, index_stories_1.default);
|
|
70
|
+
describe("<Pagination />", function () {
|
|
71
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
72
|
+
it("renders pagination component", function () {
|
|
73
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
74
|
+
var elements = react_2.screen.getByTestId("Pagination");
|
|
75
|
+
expect(elements).toBeTruthy();
|
|
76
|
+
});
|
|
77
|
+
it("go to previous page is disabled if currentPage === 1", function () {
|
|
78
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
79
|
+
var element = react_2.screen.getByTestId("Pagination-disabled-left-arrow");
|
|
80
|
+
var button = element.getElementsByTagName("button")[0];
|
|
81
|
+
expect(button.disabled).toBeTruthy();
|
|
82
|
+
});
|
|
83
|
+
it("should have a dropdown for left hidden pages list", function () {
|
|
84
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
85
|
+
var element = react_2.screen.getByTestId("Pagination-with-left-dropdown");
|
|
86
|
+
var listItem = element.getElementsByTagName("li")[2];
|
|
87
|
+
var leftMenuButton = listItem.getElementsByTagName("button")[0];
|
|
88
|
+
expect(leftMenuButton).toBeTruthy();
|
|
89
|
+
});
|
|
90
|
+
it("should have a dropdown for right hidden pages list", function () {
|
|
91
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
92
|
+
var element = react_2.screen.getByTestId("Pagination-with-right-dropdown");
|
|
93
|
+
var listItem = element.getElementsByTagName("li")[6];
|
|
94
|
+
var rightMenuButton = listItem.getElementsByTagName("button")[0];
|
|
95
|
+
expect(rightMenuButton).toBeTruthy();
|
|
96
|
+
});
|
|
97
|
+
it("should have a dropdown for both left and right hidden pages list", function () {
|
|
98
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
99
|
+
var element = react_2.screen.getByTestId("Pagination-with-both-dropdowns");
|
|
100
|
+
var listItems = element.getElementsByTagName("li");
|
|
101
|
+
var leftMenuButton = listItems[2].getElementsByTagName("button")[0];
|
|
102
|
+
var rightMenuButton = listItems[6].getElementsByTagName("button")[0];
|
|
103
|
+
expect(leftMenuButton && rightMenuButton).toBeTruthy();
|
|
104
|
+
});
|
|
105
|
+
it("should open right dropdown on click", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
106
|
+
var element, listItem, rightMenuButton;
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
109
|
+
element = react_2.screen.getByTestId("Pagination-with-right-dropdown");
|
|
110
|
+
listItem = element.getElementsByTagName("li")[6];
|
|
111
|
+
rightMenuButton = listItem.getElementsByTagName("button")[0];
|
|
112
|
+
react_2.fireEvent.click(rightMenuButton);
|
|
113
|
+
expect(react_2.screen.getAllByText("13")).not.toBeNull();
|
|
114
|
+
return [2 /*return*/];
|
|
115
|
+
});
|
|
116
|
+
}); });
|
|
117
|
+
it("should not open disabled dropdown on click", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
118
|
+
var element, listItem, leftMenuButton;
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
121
|
+
element = react_2.screen.getByTestId("Pagination-disabled-dropdown");
|
|
122
|
+
listItem = element.getElementsByTagName("li")[2];
|
|
123
|
+
leftMenuButton = listItem.getElementsByTagName("button")[0];
|
|
124
|
+
expect(leftMenuButton.disabled).toBeTruthy();
|
|
125
|
+
return [2 /*return*/];
|
|
126
|
+
});
|
|
127
|
+
}); });
|
|
128
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonThemeProps } from "../styles";
|
|
3
|
+
export interface PaginationExtraProps extends CommonThemeProps {
|
|
4
|
+
sdsStyle?: "round" | "square";
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
truncateDropdown?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const StyledPaginationButtonIcon: import("@emotion/styled").StyledComponent<Pick<import("../ButtonIcon/style").ButtonIconExtraProps<keyof import("../ButtonIcon").ButtonIconSizeToTypes> & Omit<import("@mui/material").IconButtonProps, "content" | "autoFocus" | "nonce" | "rel" | "rev"> & import("../ButtonIcon").ButtonIconInternalProps<keyof import("../Icon").IconNameToSizes>, keyof import("@mui/material/OverridableComponent").CommonProps | "onChange" | "children" | "sx" | "color" | "translate" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "name" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "edge" | keyof import("../ButtonIcon/style").ButtonIconExtraProps<keyof import("../ButtonIcon").ButtonIconSizeToTypes> | keyof import("../ButtonIcon").ButtonIconInternalProps<keyof import("../Icon").IconNameToSizes>> & import("react").RefAttributes<HTMLButtonElement | null> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PaginationExtraProps, {}, {}>;
|
|
10
|
+
export declare const StyledPaginationChevronList: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
11
|
+
export declare const StyledPaginationChevronButton: import("@emotion/styled").StyledComponent<Pick<import("../ButtonIcon/style").ButtonIconExtraProps<keyof import("../ButtonIcon").ButtonIconSizeToTypes> & Omit<import("@mui/material").IconButtonProps, "content" | "autoFocus" | "nonce" | "rel" | "rev"> & import("../ButtonIcon").ButtonIconInternalProps<keyof import("../Icon").IconNameToSizes>, keyof import("@mui/material/OverridableComponent").CommonProps | "onChange" | "children" | "sx" | "color" | "translate" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "name" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "edge" | keyof import("../ButtonIcon/style").ButtonIconExtraProps<keyof import("../ButtonIcon").ButtonIconSizeToTypes> | keyof import("../ButtonIcon").ButtonIconInternalProps<keyof import("../Icon").IconNameToSizes>> & import("react").RefAttributes<HTMLButtonElement | null> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PaginationExtraProps, {}, {}>;
|
|
12
|
+
export declare const StyledPagination: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PaginationExtraProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
13
|
+
export declare const Page: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & PaginationExtraProps, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.Page = exports.StyledPagination = exports.StyledPaginationChevronButton = exports.StyledPaginationChevronList = exports.StyledPaginationButtonIcon = void 0;
|
|
11
|
+
var styles_1 = require("@mui/material/styles");
|
|
12
|
+
var ButtonIcon_1 = __importDefault(require("../ButtonIcon"));
|
|
13
|
+
var styles_2 = require("../styles");
|
|
14
|
+
var doNotForwardProps = [
|
|
15
|
+
"sdsStyle",
|
|
16
|
+
"selected",
|
|
17
|
+
"onPageChange",
|
|
18
|
+
"onNextPage",
|
|
19
|
+
"onPreviousPage",
|
|
20
|
+
"goToPage",
|
|
21
|
+
"totalCount",
|
|
22
|
+
"siblingCount",
|
|
23
|
+
"currentPage",
|
|
24
|
+
"pageSize",
|
|
25
|
+
"truncateDropdown",
|
|
26
|
+
];
|
|
27
|
+
exports.StyledPaginationButtonIcon = (0, styles_1.styled)(ButtonIcon_1.default, {
|
|
28
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
29
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
30
|
+
var disabled = props.disabled;
|
|
31
|
+
var colors = (0, styles_2.getColors)(props);
|
|
32
|
+
return "\n width: 32px;\n height: 32px;\n cursor: ".concat(disabled ? "auto" : "pointer", ";\n &:hover {\n background-color: ").concat(disabled ? "transparent" : colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n }\n & .MuiSvgIcon-root {\n width: 10px;\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[600], "\n }\n ");
|
|
33
|
+
});
|
|
34
|
+
exports.StyledPaginationChevronList = (0, styles_1.styled)("li")(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
|
|
35
|
+
exports.StyledPaginationChevronButton = (0, styles_1.styled)(ButtonIcon_1.default, {
|
|
36
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
37
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
38
|
+
var disabled = props.disabled;
|
|
39
|
+
var colors = (0, styles_2.getColors)(props);
|
|
40
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
41
|
+
return "\n &[data-order=\"first\"] {\n margin-right: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px;\n }\n &[data-order=\"last\"] {\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px;\n }\n cursor: ").concat(disabled ? "auto" : "pointer", ";\n &:hover {\n background-color: transparent;\n }\n & .MuiSvgIcon-root {\n color: ").concat(disabled ? colors === null || colors === void 0 ? void 0 : colors.gray[300] : "black", ";\n }\n ");
|
|
42
|
+
});
|
|
43
|
+
exports.StyledPagination = (0, styles_1.styled)("ul", {
|
|
44
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
45
|
+
})(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), styles_2.fontBodyS, function (props) {
|
|
46
|
+
var typography = (0, styles_2.getTypography)(props);
|
|
47
|
+
return "\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n display: flex;\n flex-wrap: wrap;\n padding: 0;\n margin: 0;\n & li {\n list-style: none;\n }\n ");
|
|
48
|
+
});
|
|
49
|
+
var selectedPageStyle = function () {
|
|
50
|
+
return "\n background-color: black;\n color: white;\n\n &:hover {\n background-color: black;\n }\n ";
|
|
51
|
+
};
|
|
52
|
+
exports.Page = (0, styles_1.styled)("li", {
|
|
53
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
54
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), styles_2.fontBodyS, function (props) {
|
|
55
|
+
var selected = props.selected, sdsStyle = props.sdsStyle;
|
|
56
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
57
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
58
|
+
var colors = (0, styles_2.getColors)(props);
|
|
59
|
+
var fontWeights = (0, styles_2.getFontWeights)(props);
|
|
60
|
+
return "\n font-weight: ".concat(fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.semibold, ";\n cursor: pointer;\n list-style: none;\n width: 32px;\n height: 32px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: ").concat(sdsStyle === "round" ? corners === null || corners === void 0 ? void 0 : corners.l : corners === null || corners === void 0 ? void 0 : corners.m, "px;\n user-select: none;\n &:hover {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n }\n\n &:nth-last-of-type(-n+2) {\n margin-right: 0;\n }\n\n ").concat(selected && selectedPageStyle(), ";\n ");
|
|
61
|
+
});
|
|
62
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DOTS = "...";
|
|
2
|
+
interface UsePaginationProps {
|
|
3
|
+
totalCount: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
siblingCount: number;
|
|
6
|
+
currentPage: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const usePagination: ({ totalCount, pageSize, siblingCount, currentPage, }: UsePaginationProps) => (number | number[])[] | undefined;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.usePagination = exports.DOTS = void 0;
|
|
13
|
+
var react_1 = require("react");
|
|
14
|
+
exports.DOTS = "...";
|
|
15
|
+
var range = function (start, end) {
|
|
16
|
+
var length = end - start + 1;
|
|
17
|
+
return Array.from({ length: length }, function (_, idx) { return idx + start; });
|
|
18
|
+
};
|
|
19
|
+
var usePagination = function (_a) {
|
|
20
|
+
var totalCount = _a.totalCount, pageSize = _a.pageSize, _b = _a.siblingCount, siblingCount = _b === void 0 ? 1 : _b, currentPage = _a.currentPage;
|
|
21
|
+
return (0, react_1.useMemo)(function () {
|
|
22
|
+
var totalPageCount = Math.ceil(totalCount / pageSize);
|
|
23
|
+
// Pages count is determined as siblingCount + firstPage + lastPage + currentPage + 2*DOTS
|
|
24
|
+
var totalPageNumbers = siblingCount + 5;
|
|
25
|
+
/*
|
|
26
|
+
If the number of pages is less than the page numbers we want to show in our
|
|
27
|
+
paginationComponent, we return the range [1..totalPageCount]
|
|
28
|
+
*/
|
|
29
|
+
if (totalPageNumbers >= totalPageCount) {
|
|
30
|
+
return range(1, totalPageCount);
|
|
31
|
+
}
|
|
32
|
+
var leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
33
|
+
var rightSiblingIndex = Math.min(currentPage + siblingCount, totalPageCount);
|
|
34
|
+
/*
|
|
35
|
+
We do not want to show dots if there is only one position left
|
|
36
|
+
after/before the left/right page count as that would lead to a change of our Pagination
|
|
37
|
+
component size which we do not want
|
|
38
|
+
*/
|
|
39
|
+
var shouldShowLeftDots = leftSiblingIndex > 2;
|
|
40
|
+
var shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
|
|
41
|
+
var firstPageIndex = 1;
|
|
42
|
+
var lastPageIndex = totalPageCount;
|
|
43
|
+
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
44
|
+
var leftItemCount = 3 + 2 * siblingCount;
|
|
45
|
+
var leftRange = range(1, leftItemCount);
|
|
46
|
+
var rightDotsRange = range(leftItemCount + 1, totalPageCount - 1);
|
|
47
|
+
return __spreadArray(__spreadArray([], leftRange, true), [rightDotsRange, totalPageCount], false);
|
|
48
|
+
}
|
|
49
|
+
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
50
|
+
var rightItemCount = 3 + 2 * siblingCount;
|
|
51
|
+
var rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
|
|
52
|
+
var leftDotsRange = range(2, totalPageCount - rightItemCount);
|
|
53
|
+
return __spreadArray([firstPageIndex, leftDotsRange], rightRange, true);
|
|
54
|
+
}
|
|
55
|
+
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
56
|
+
var middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
57
|
+
var leftDotsRange = range(2, leftSiblingIndex - 1);
|
|
58
|
+
var rightDotsRange = range(rightSiblingIndex + 1, totalPageCount - 1);
|
|
59
|
+
return __spreadArray(__spreadArray([
|
|
60
|
+
firstPageIndex,
|
|
61
|
+
leftDotsRange
|
|
62
|
+
], middleRange, true), [
|
|
63
|
+
rightDotsRange,
|
|
64
|
+
lastPageIndex,
|
|
65
|
+
], false);
|
|
66
|
+
}
|
|
67
|
+
}, [totalCount, pageSize, siblingCount, currentPage]);
|
|
68
|
+
};
|
|
69
|
+
exports.usePagination = usePagination;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var components_1 = require("@czi-sds/components");
|
|
5
|
+
var SegmentedControlNameSpaceTest = function (props) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)(components_1.SegmentedControl, { buttonDefinition: [
|
|
7
|
+
{ iconName: "list", tooltipText: "List A" },
|
|
8
|
+
{ iconName: "list", tooltipText: "List B" },
|
|
9
|
+
{ iconName: "table", tooltipText: "Table" },
|
|
10
|
+
{ iconName: "people", tooltipText: "People" },
|
|
11
|
+
] }));
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ToggleButtonGroupProps } from "@mui/material/ToggleButtonGroup";
|
|
2
|
+
interface SingleButtonDefinition {
|
|
3
|
+
iconName: string;
|
|
4
|
+
tooltipText: string;
|
|
5
|
+
}
|
|
6
|
+
interface SegmentedControlExtraProps extends Omit<ToggleButtonGroupProps, "color" | "nonce" | "rev" | "rel" | "autoFocus" | "content"> {
|
|
7
|
+
buttonDefinition: SingleButtonDefinition[];
|
|
8
|
+
color?: "primary" | "secondary" | "standard" | "success" | "error" | "info" | "warning" | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @see https://mui.com/material-ui/react-toggle-button/
|
|
12
|
+
*/
|
|
13
|
+
export type SegmentedControlProps = SegmentedControlExtraProps & ToggleButtonGroupProps;
|
|
14
|
+
declare const SegmentedControl: (props: SegmentedControlProps) => JSX.Element;
|
|
15
|
+
export default SegmentedControl;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var ToggleButton_1 = __importDefault(require("@mui/material/ToggleButton"));
|
|
19
|
+
var react_1 = __importDefault(require("react"));
|
|
20
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
21
|
+
var Tooltip_1 = __importDefault(require("../Tooltip"));
|
|
22
|
+
var style_1 = require("./style");
|
|
23
|
+
var SegmentedControl = function (props) {
|
|
24
|
+
var _a;
|
|
25
|
+
var buttonDefinition = props.buttonDefinition;
|
|
26
|
+
var leftmost = (_a = buttonDefinition[0]) === null || _a === void 0 ? void 0 : _a.tooltipText;
|
|
27
|
+
var _b = react_1.default.useState(leftmost), active = _b[0], setActive = _b[1];
|
|
28
|
+
var handleActive = function (event, newActive) {
|
|
29
|
+
if (newActive !== null) {
|
|
30
|
+
setActive(newActive);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(style_1.StyledSegmentedControl, __assign({ color: "primary", size: "small", value: active, exclusive: true, onChange: handleActive }, props, { children: [buttonDefinition.map(function (button) {
|
|
34
|
+
var iconName = button.iconName, tooltipText = button.tooltipText;
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(ToggleButton_1.default, { "aria-label": tooltipText, disableRipple: true, value: tooltipText, children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, { title: tooltipText, sdsStyle: "dark", arrow: true, children: (0, jsx_runtime_1.jsx)("span", { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { sdsIcon: iconName, sdsSize: "s", sdsType: "button" }) }) }) }, tooltipText));
|
|
36
|
+
}), ";"] })));
|
|
37
|
+
};
|
|
38
|
+
exports.default = SegmentedControl;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
import { SegmentedControlProps } from "./index";
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
|
|
4
|
+
export default _default;
|
|
5
|
+
interface SegmentedControlArgs extends SegmentedControlProps {
|
|
6
|
+
segmentOneIcon: string;
|
|
7
|
+
segmentOneTooltipText: string;
|
|
8
|
+
segmentTwoIcon: string;
|
|
9
|
+
segmentTwoTooltipText: string;
|
|
10
|
+
segmentThreeIcon: string;
|
|
11
|
+
segmentThreeTooltipText: string;
|
|
12
|
+
segmentFourIcon: string;
|
|
13
|
+
segmentFourTooltipText: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Default: {
|
|
16
|
+
args: {
|
|
17
|
+
segmentFourIcon: string;
|
|
18
|
+
segmentFourTooltipText: string;
|
|
19
|
+
segmentOneIcon: string;
|
|
20
|
+
segmentOneTooltipText: string;
|
|
21
|
+
segmentThreeIcon: string;
|
|
22
|
+
segmentThreeTooltipText: string;
|
|
23
|
+
segmentTwoIcon: string;
|
|
24
|
+
segmentTwoTooltipText: string;
|
|
25
|
+
};
|
|
26
|
+
render: (props: SegmentedControlArgs) => JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
export declare const LivePreview: {
|
|
29
|
+
parameters: {
|
|
30
|
+
snapshot: {
|
|
31
|
+
skip: boolean;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
render: (args: Args) => JSX.Element;
|
|
35
|
+
};
|
|
36
|
+
export declare const Test: {
|
|
37
|
+
args: {
|
|
38
|
+
buttonDefinition: {
|
|
39
|
+
iconName: string;
|
|
40
|
+
tooltipText: string;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
parameters: {
|
|
44
|
+
snapshot: {
|
|
45
|
+
skip: boolean;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
render: (args: Args) => JSX.Element;
|
|
49
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Test = exports.LivePreview = exports.Default = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var index_1 = __importDefault(require("./index"));
|
|
20
|
+
var SegmentedControl = function (props) {
|
|
21
|
+
var buttonDefinition = props.buttonDefinition;
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(index_1.default, { buttonDefinition: buttonDefinition });
|
|
23
|
+
};
|
|
24
|
+
var iconOptions = ["list", "infoCircle", "table", "globe", "people"];
|
|
25
|
+
exports.default = {
|
|
26
|
+
argTypes: {
|
|
27
|
+
segmentFourIcon: {
|
|
28
|
+
control: { type: "select" },
|
|
29
|
+
options: iconOptions,
|
|
30
|
+
},
|
|
31
|
+
segmentFourTooltipText: {
|
|
32
|
+
control: {
|
|
33
|
+
type: "text",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
segmentOneIcon: {
|
|
37
|
+
control: { type: "select" },
|
|
38
|
+
options: iconOptions,
|
|
39
|
+
},
|
|
40
|
+
segmentOneTooltipText: {
|
|
41
|
+
control: {
|
|
42
|
+
type: "text",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
segmentThreeIcon: {
|
|
46
|
+
control: { type: "select" },
|
|
47
|
+
options: iconOptions,
|
|
48
|
+
},
|
|
49
|
+
segmentThreeTooltipText: {
|
|
50
|
+
control: {
|
|
51
|
+
type: "text",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
segmentTwoIcon: {
|
|
55
|
+
control: { type: "select" },
|
|
56
|
+
options: iconOptions,
|
|
57
|
+
},
|
|
58
|
+
segmentTwoTooltipText: {
|
|
59
|
+
control: {
|
|
60
|
+
type: "text",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
component: SegmentedControl,
|
|
65
|
+
title: "SegmentedControl",
|
|
66
|
+
};
|
|
67
|
+
var Template = function (props) {
|
|
68
|
+
var segmentOneIcon = props.segmentOneIcon, segmentOneTooltipText = props.segmentOneTooltipText, segmentTwoIcon = props.segmentTwoIcon, segmentTwoTooltipText = props.segmentTwoTooltipText, segmentThreeIcon = props.segmentThreeIcon, segmentThreeTooltipText = props.segmentThreeTooltipText, segmentFourIcon = props.segmentFourIcon, segmentFourTooltipText = props.segmentFourTooltipText;
|
|
69
|
+
var buttonDefinition = [
|
|
70
|
+
{ iconName: segmentOneIcon, tooltipText: segmentOneTooltipText },
|
|
71
|
+
{ iconName: segmentTwoIcon, tooltipText: segmentTwoTooltipText },
|
|
72
|
+
{ iconName: segmentThreeIcon, tooltipText: segmentThreeTooltipText },
|
|
73
|
+
{ iconName: segmentFourIcon, tooltipText: segmentFourTooltipText },
|
|
74
|
+
];
|
|
75
|
+
return (0, jsx_runtime_1.jsx)(index_1.default, { buttonDefinition: buttonDefinition });
|
|
76
|
+
};
|
|
77
|
+
// Default
|
|
78
|
+
exports.Default = {
|
|
79
|
+
args: {
|
|
80
|
+
segmentFourIcon: "list",
|
|
81
|
+
segmentFourTooltipText: "List D",
|
|
82
|
+
segmentOneIcon: "list",
|
|
83
|
+
segmentOneTooltipText: "List A",
|
|
84
|
+
segmentThreeIcon: "list",
|
|
85
|
+
segmentThreeTooltipText: "List C",
|
|
86
|
+
segmentTwoIcon: "list",
|
|
87
|
+
segmentTwoTooltipText: "List B",
|
|
88
|
+
},
|
|
89
|
+
render: Template,
|
|
90
|
+
};
|
|
91
|
+
// Live Preview
|
|
92
|
+
var livePreviewStyles = {
|
|
93
|
+
columnGap: "24px",
|
|
94
|
+
display: "flex",
|
|
95
|
+
};
|
|
96
|
+
function LivePreviewDemo(props) {
|
|
97
|
+
var finalProps = __assign(__assign({}, props), { style: { width: "250px" } });
|
|
98
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: livePreviewStyles, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Template, __assign({ segmentOneIcon: "list", segmentOneTooltipText: "List A", segmentTwoIcon: "list", segmentTwoTooltipText: "List B", segmentThreeIcon: "list", segmentThreeTooltipText: "List C", segmentFourIcon: "list", segmentFourTooltipText: "List D", buttonDefinition: [] }, finalProps)) }) }));
|
|
99
|
+
}
|
|
100
|
+
exports.LivePreview = {
|
|
101
|
+
parameters: {
|
|
102
|
+
snapshot: {
|
|
103
|
+
skip: true,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
107
|
+
};
|
|
108
|
+
// Test
|
|
109
|
+
var TestDemo = function (props) {
|
|
110
|
+
var buttonDefinition = props.buttonDefinition;
|
|
111
|
+
return ((0, jsx_runtime_1.jsx)(index_1.default, __assign({ buttonDefinition: buttonDefinition, "data-testid": "segmentedControl" }, props)));
|
|
112
|
+
};
|
|
113
|
+
exports.Test = {
|
|
114
|
+
args: {
|
|
115
|
+
buttonDefinition: [
|
|
116
|
+
{ iconName: "list", tooltipText: "List A" },
|
|
117
|
+
{ iconName: "list", tooltipText: "List B" },
|
|
118
|
+
{ iconName: "table", tooltipText: "Table" },
|
|
119
|
+
{ iconName: "people", tooltipText: "People" },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
parameters: {
|
|
123
|
+
snapshot: {
|
|
124
|
+
skip: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(TestDemo, __assign({}, args)); },
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var story_utils_1 = require("@chanzuckerberg/story-utils");
|
|
28
|
+
var react_1 = require("@storybook/react");
|
|
29
|
+
var react_2 = require("@testing-library/react");
|
|
30
|
+
var snapshotTestStoryFile = __importStar(require("./index.stories"));
|
|
31
|
+
var index_stories_1 = __importStar(require("./index.stories"));
|
|
32
|
+
// Returns a component that already contain all decorators from story level, meta level and global level.
|
|
33
|
+
var Test = (0, react_1.composeStory)(index_stories_1.Test, index_stories_1.default);
|
|
34
|
+
describe("<SegmentedControl />", function () {
|
|
35
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
36
|
+
it("renders Segmented Control component", function () {
|
|
37
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
38
|
+
var elements = react_2.screen.getAllByTestId("segmentedControl");
|
|
39
|
+
expect(elements.length).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CommonThemeProps } from "../styles";
|
|
2
|
+
export declare const StyledSegmentedControl: import("@emotion/styled").StyledComponent<import("@mui/material/ToggleButtonGroup").ToggleButtonGroupProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & CommonThemeProps, {}, {}>;
|