@czi-sds/components 15.1.0 → 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 +89 -200
- package/dist/index.cjs.js +1383 -1413
- package/dist/index.esm.d.ts +89 -200
- package/dist/index.esm.js +1372 -1393
- 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/dist/variables.css +1 -0
- package/package.json +12 -8
|
@@ -0,0 +1,216 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Test = exports.LivePreview = exports.Default = void 0;
|
|
52
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
53
|
+
var material_1 = require("@mui/material");
|
|
54
|
+
var React = __importStar(require("react"));
|
|
55
|
+
var react_1 = require("react");
|
|
56
|
+
var _1 = __importDefault(require("."));
|
|
57
|
+
var InputSlider_1 = __importDefault(require("../InputSlider"));
|
|
58
|
+
var TabPanel = React.forwardRef(function (props, ref) {
|
|
59
|
+
var children = props.children, sdsDemoHeight = props.sdsDemoHeight, other = __rest(props, ["children", "sdsDemoHeight"]);
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)("div", __assign({ ref: ref, role: "tabpanel", style: {
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
backgroundColor: "#f4f4f4",
|
|
63
|
+
color: "black",
|
|
64
|
+
display: "flex",
|
|
65
|
+
fontFamily: "Open Sans, sans-serif",
|
|
66
|
+
fontSize: "36px",
|
|
67
|
+
fontWeight: 100,
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
margin: "0px 22px 22px 6px",
|
|
70
|
+
minHeight: "".concat(sdsDemoHeight, "vh"),
|
|
71
|
+
textAlign: "center",
|
|
72
|
+
} }, other, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { p: 3 }, children: [children, (0, jsx_runtime_1.jsxs)("p", { style: { fontSize: 14, margin: "5px 0 0 0" }, children: ["height: ", sdsDemoHeight, " vh"] })] }) })));
|
|
73
|
+
});
|
|
74
|
+
var NavigationJumpTo = function (props) {
|
|
75
|
+
var _a = (0, react_1.useState)(100), navPanelHeight = _a[0], setNavPanelHeight = _a[1];
|
|
76
|
+
var sectionRef0 = React.useRef(null);
|
|
77
|
+
var sectionRef1 = React.useRef(null);
|
|
78
|
+
var sectionRef2 = React.useRef(null);
|
|
79
|
+
var sectionRef3 = React.useRef(null);
|
|
80
|
+
var sectionRef4 = React.useRef(null);
|
|
81
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
82
|
+
fontFamily: "Open Sans, sans-serif",
|
|
83
|
+
margin: "0 0 30px 6px",
|
|
84
|
+
width: 250,
|
|
85
|
+
}, children: [(0, jsx_runtime_1.jsx)("p", { id: "nav-item-height-slider", style: { marginBottom: "5px" }, children: "Section panel height:" }), (0, jsx_runtime_1.jsx)(InputSlider_1.default, { "aria-labelledby": "nav-item-height-slider", min: 20, max: 120, step: 1, onChange: function (_, value) {
|
|
86
|
+
setNavPanelHeight(value);
|
|
87
|
+
}, defaultValue: 100, marks: [
|
|
88
|
+
{ label: "20", value: 20 },
|
|
89
|
+
{ label: "40", value: 40 },
|
|
90
|
+
{ label: "60", value: 60 },
|
|
91
|
+
{ label: "80", value: 80 },
|
|
92
|
+
{ label: "100", value: 100 },
|
|
93
|
+
{ label: "120", value: 120 },
|
|
94
|
+
] })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
95
|
+
display: "flex",
|
|
96
|
+
flexDirection: "row-reverse",
|
|
97
|
+
position: "relative",
|
|
98
|
+
width: "100%",
|
|
99
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { width: 150 }, children: (0, jsx_runtime_1.jsx)(_1.default, __assign({}, props, { items: [
|
|
100
|
+
{ elementRef: sectionRef0, title: "Section 1" },
|
|
101
|
+
{ elementRef: sectionRef1, title: "Section 2" },
|
|
102
|
+
{ elementRef: sectionRef2, title: "Section 3" },
|
|
103
|
+
{ elementRef: sectionRef3, title: "Section 4" },
|
|
104
|
+
{ elementRef: sectionRef4, title: "Section 5" },
|
|
105
|
+
] })) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
106
|
+
position: "relative",
|
|
107
|
+
width: "100%",
|
|
108
|
+
}, children: [(0, jsx_runtime_1.jsx)(TabPanel, { id: "navigation-panel-1", ref: sectionRef0, sdsDemoHeight: navPanelHeight, children: "Section #1" }), (0, jsx_runtime_1.jsx)(TabPanel, { id: "navigation-panel-2", ref: sectionRef1, sdsDemoHeight: navPanelHeight, children: "Section #2" }), (0, jsx_runtime_1.jsx)(TabPanel, { id: "navigation-panel-3", ref: sectionRef2, sdsDemoHeight: navPanelHeight, children: "Section #3" }), (0, jsx_runtime_1.jsx)(TabPanel, { id: "navigation-panel-4", ref: sectionRef3, sdsDemoHeight: navPanelHeight, children: "Section #4" }), (0, jsx_runtime_1.jsx)(TabPanel, { id: "navigation-panel-5", ref: sectionRef4, sdsDemoHeight: navPanelHeight, children: "Section #5" })] })] })] }));
|
|
109
|
+
};
|
|
110
|
+
var availableColorOptions = [
|
|
111
|
+
"beta",
|
|
112
|
+
"error",
|
|
113
|
+
"gray",
|
|
114
|
+
"info",
|
|
115
|
+
"primary",
|
|
116
|
+
"success",
|
|
117
|
+
"warning",
|
|
118
|
+
];
|
|
119
|
+
exports.default = {
|
|
120
|
+
argTypes: {
|
|
121
|
+
indicatorColor: {
|
|
122
|
+
control: {
|
|
123
|
+
labels: [
|
|
124
|
+
"beta",
|
|
125
|
+
"error",
|
|
126
|
+
"gray",
|
|
127
|
+
"info",
|
|
128
|
+
"primary",
|
|
129
|
+
"success",
|
|
130
|
+
"warning",
|
|
131
|
+
],
|
|
132
|
+
type: "select",
|
|
133
|
+
},
|
|
134
|
+
defaultValue: { summary: "primary" },
|
|
135
|
+
description: "Color of the tab indicator",
|
|
136
|
+
mapping: availableColorOptions,
|
|
137
|
+
options: Object.keys(availableColorOptions),
|
|
138
|
+
},
|
|
139
|
+
items: {
|
|
140
|
+
control: { require: true, type: "object" },
|
|
141
|
+
defaultValue: { summary: "-" },
|
|
142
|
+
description: "An array of object containing a title for the Navigation Tab and a ref to the section div.",
|
|
143
|
+
},
|
|
144
|
+
offsetTop: {
|
|
145
|
+
control: { description: "wew", type: "number" },
|
|
146
|
+
defaultValue: { summary: "0" },
|
|
147
|
+
description: "To apply the offsetTop to the component, please refresh the page.",
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
component: NavigationJumpTo,
|
|
151
|
+
title: "NavigationJumpTo",
|
|
152
|
+
};
|
|
153
|
+
// Default
|
|
154
|
+
exports.Default = {
|
|
155
|
+
args: {
|
|
156
|
+
indicatorColor: "primary",
|
|
157
|
+
items: [],
|
|
158
|
+
offsetTop: 0,
|
|
159
|
+
},
|
|
160
|
+
parameters: {
|
|
161
|
+
controls: { expanded: true },
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
// Live Preview
|
|
165
|
+
var LivePreviewDemo = function (props) {
|
|
166
|
+
var items = props.items, rest = __rest(props, ["items"]);
|
|
167
|
+
return (0, jsx_runtime_1.jsx)(_1.default, __assign({ items: items }, rest));
|
|
168
|
+
};
|
|
169
|
+
exports.LivePreview = {
|
|
170
|
+
args: {
|
|
171
|
+
items: [
|
|
172
|
+
{ elementRef: { current: null }, title: "Item 1" },
|
|
173
|
+
{ elementRef: { current: null }, title: "Item 2" },
|
|
174
|
+
{ elementRef: { current: null }, title: "Item 3" },
|
|
175
|
+
{ elementRef: { current: null }, title: "Item 4" },
|
|
176
|
+
{ elementRef: { current: null }, title: "Item 5" },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
parameters: {
|
|
180
|
+
axe: {
|
|
181
|
+
disabledRules: ["aria-valid-attr-value"],
|
|
182
|
+
},
|
|
183
|
+
snapshot: {
|
|
184
|
+
skip: true,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
188
|
+
};
|
|
189
|
+
// Test
|
|
190
|
+
var TestDemo = function (props) {
|
|
191
|
+
var items = props.items, rest = __rest(props, ["items"]);
|
|
192
|
+
return ((0, jsx_runtime_1.jsx)(_1.default, __assign({ "data-testid": "navigation-jump-to", items: items }, rest)));
|
|
193
|
+
};
|
|
194
|
+
exports.Test = {
|
|
195
|
+
args: {
|
|
196
|
+
items: [
|
|
197
|
+
{ elementRef: { current: null }, title: "Item 1" },
|
|
198
|
+
{ elementRef: { current: null }, title: "Item 2" },
|
|
199
|
+
{ elementRef: { current: null }, title: "Item 3" },
|
|
200
|
+
{ elementRef: { current: null }, title: "Item 4" },
|
|
201
|
+
{ elementRef: { current: null }, title: "Item 5" },
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
parameters: {
|
|
205
|
+
axe: {
|
|
206
|
+
disabledRules: ["aria-valid-attr-value"],
|
|
207
|
+
},
|
|
208
|
+
controls: {
|
|
209
|
+
exclude: ["indicatorColor", "items"],
|
|
210
|
+
},
|
|
211
|
+
snapshot: {
|
|
212
|
+
skip: true,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(TestDemo, __assign({}, args)); },
|
|
216
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
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("<NavigationJumpTo />", function () {
|
|
35
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
36
|
+
it("renders navigation jump to component", function () {
|
|
37
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
38
|
+
var elements = react_2.screen.getAllByTestId("navigation-jump-to");
|
|
39
|
+
expect(elements).toBeTruthy();
|
|
40
|
+
});
|
|
41
|
+
it("renders the correct number of navigation items", function () {
|
|
42
|
+
var items = [
|
|
43
|
+
{ elementRef: { current: null }, title: "Item 1" },
|
|
44
|
+
{ elementRef: { current: null }, title: "Item 2" },
|
|
45
|
+
{ elementRef: { current: null }, title: "Item 3" },
|
|
46
|
+
];
|
|
47
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, { items: items }));
|
|
48
|
+
var navigationItems = react_2.screen.getAllByRole("tab");
|
|
49
|
+
expect(navigationItems).toHaveLength(items.length);
|
|
50
|
+
});
|
|
51
|
+
it("scrolls to the correct section when a navigation item is clicked", function () {
|
|
52
|
+
var items = [
|
|
53
|
+
{
|
|
54
|
+
elementRef: {
|
|
55
|
+
current: {
|
|
56
|
+
getAttribute: function () {
|
|
57
|
+
return "test-item-1";
|
|
58
|
+
},
|
|
59
|
+
scrollIntoView: jest.fn(),
|
|
60
|
+
setAttribute: jest.fn(),
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
title: "Item 1",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
elementRef: {
|
|
67
|
+
current: {
|
|
68
|
+
getAttribute: function () {
|
|
69
|
+
return "test-item-1";
|
|
70
|
+
},
|
|
71
|
+
scrollIntoView: jest.fn(),
|
|
72
|
+
setAttribute: jest.fn(),
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
title: "Item 2",
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, { items: items }));
|
|
79
|
+
var navigationItem = react_2.screen.getByText("Item 2");
|
|
80
|
+
react_2.fireEvent.click(navigationItem);
|
|
81
|
+
expect(items[1].elementRef.current.scrollIntoView).toHaveBeenCalledTimes(1);
|
|
82
|
+
expect(items[1].elementRef.current.scrollIntoView).toHaveBeenCalledWith({
|
|
83
|
+
behavior: "smooth",
|
|
84
|
+
block: "start",
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TabsProps } from "@mui/material";
|
|
3
|
+
import { CommonThemeProps } from "../styles";
|
|
4
|
+
export interface NavigationJumpToExtraProps extends Omit<TabsProps, "indicatorColor" | "nonce" | "rev" | "rel" | "autoFocus" | "content">, CommonThemeProps {
|
|
5
|
+
sdsIndicatorColor?: "primary" | "error" | "info" | "success" | "warning" | "gray" | "beta";
|
|
6
|
+
}
|
|
7
|
+
export declare const StyledTabs: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
action?: import("react").Ref<import("@mui/material").TabsActions> | undefined;
|
|
9
|
+
allowScrollButtonsMobile?: boolean | undefined;
|
|
10
|
+
'aria-label'?: string | undefined;
|
|
11
|
+
'aria-labelledby'?: string | undefined;
|
|
12
|
+
centered?: boolean | undefined;
|
|
13
|
+
children?: import("react").ReactNode;
|
|
14
|
+
classes?: Partial<import("@mui/material").TabsClasses> | undefined;
|
|
15
|
+
slots?: {
|
|
16
|
+
StartScrollButtonIcon?: import("react").ElementType<any> | undefined;
|
|
17
|
+
EndScrollButtonIcon?: import("react").ElementType<any> | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
slotProps?: {
|
|
20
|
+
startScrollButtonIcon?: import("@mui/base").SlotComponentProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
21
|
+
muiName: string;
|
|
22
|
+
}, import("@mui/material").TabsStartScrollButtonIconSlotPropsOverrides, import("@mui/material").TabsOwnerState> | undefined;
|
|
23
|
+
endScrollButtonIcon?: import("@mui/base").SlotComponentProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
24
|
+
muiName: string;
|
|
25
|
+
}, import("@mui/material").TabsEndScrollButtonIconSlotPropsOverrides, import("@mui/material").TabsOwnerState> | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
indicatorColor?: import("@mui/types").OverridableStringUnion<"primary" | "secondary", import("@mui/material").TabsPropsIndicatorColorOverrides> | undefined;
|
|
28
|
+
onChange?: ((event: import("react").SyntheticEvent<Element, Event>, value: any) => void) | undefined;
|
|
29
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
30
|
+
ScrollButtonComponent?: import("react").ElementType<any> | undefined;
|
|
31
|
+
scrollButtons?: boolean | "auto" | undefined;
|
|
32
|
+
selectionFollowsFocus?: boolean | undefined;
|
|
33
|
+
TabIndicatorProps?: (import("react").HTMLAttributes<HTMLDivElement> & {
|
|
34
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
35
|
+
}) | undefined;
|
|
36
|
+
TabScrollButtonProps?: Partial<import("@mui/material").TabScrollButtonProps> | undefined;
|
|
37
|
+
textColor?: "inherit" | "primary" | "secondary" | undefined;
|
|
38
|
+
value?: any;
|
|
39
|
+
variant?: "fullWidth" | "standard" | "scrollable" | undefined;
|
|
40
|
+
visibleScrollbar?: boolean | undefined;
|
|
41
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
42
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<{
|
|
43
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
44
|
+
centerRipple?: boolean | undefined;
|
|
45
|
+
children?: import("react").ReactNode;
|
|
46
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
47
|
+
disabled?: boolean | undefined;
|
|
48
|
+
disableRipple?: boolean | undefined;
|
|
49
|
+
disableTouchRipple?: boolean | undefined;
|
|
50
|
+
focusRipple?: boolean | undefined;
|
|
51
|
+
focusVisibleClassName?: string | undefined;
|
|
52
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
53
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
54
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
55
|
+
tabIndex?: number | undefined;
|
|
56
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
57
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
58
|
+
} & Omit<{
|
|
59
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
60
|
+
centerRipple?: boolean | undefined;
|
|
61
|
+
children?: import("react").ReactNode;
|
|
62
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
63
|
+
disabled?: boolean | undefined;
|
|
64
|
+
disableRipple?: boolean | undefined;
|
|
65
|
+
disableTouchRipple?: boolean | undefined;
|
|
66
|
+
focusRipple?: boolean | undefined;
|
|
67
|
+
focusVisibleClassName?: string | undefined;
|
|
68
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
69
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
70
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
71
|
+
tabIndex?: number | undefined;
|
|
72
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
73
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
74
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
75
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
76
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "disabled" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef">, keyof import("@mui/material/OverridableComponent").CommonProps | "onChange" | "children" | "sx" | "variant" | "aria-label" | "aria-labelledby" | "action" | "orientation" | "value" | "slotProps" | "slots" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & NavigationJumpToExtraProps, {}, {}>;
|
|
77
|
+
export declare const StyledTab: import("@emotion/styled").StyledComponent<{
|
|
78
|
+
children?: null | undefined;
|
|
79
|
+
classes?: Partial<import("@mui/material").TabClasses> | undefined;
|
|
80
|
+
disabled?: boolean | undefined;
|
|
81
|
+
disableFocusRipple?: boolean | undefined;
|
|
82
|
+
icon?: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
83
|
+
iconPosition?: "bottom" | "top" | "end" | "start" | undefined;
|
|
84
|
+
label?: import("react").ReactNode;
|
|
85
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
86
|
+
value?: any;
|
|
87
|
+
wrapped?: boolean | undefined;
|
|
88
|
+
} & Omit<{
|
|
89
|
+
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
90
|
+
centerRipple?: boolean | undefined;
|
|
91
|
+
children?: import("react").ReactNode;
|
|
92
|
+
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
93
|
+
disabled?: boolean | undefined;
|
|
94
|
+
disableRipple?: boolean | undefined;
|
|
95
|
+
disableTouchRipple?: boolean | undefined;
|
|
96
|
+
focusRipple?: boolean | undefined;
|
|
97
|
+
focusVisibleClassName?: string | undefined;
|
|
98
|
+
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
99
|
+
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
100
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
101
|
+
tabIndex?: number | undefined;
|
|
102
|
+
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
103
|
+
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
104
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
105
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
106
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "disabled" | "label" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "value" | "icon" | "iconPosition" | "wrapped"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & CommonThemeProps, {}, {}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StyledTab = exports.StyledTabs = void 0;
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
var styles_1 = require("@mui/material/styles");
|
|
10
|
+
var styles_2 = require("../styles");
|
|
11
|
+
var doNotForwardProps = ["items", "sdsIndicatorColor"];
|
|
12
|
+
exports.StyledTabs = (0, styles_1.styled)(material_1.Tabs, {
|
|
13
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
14
|
+
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
15
|
+
var _a = props.sdsIndicatorColor, sdsIndicatorColor = _a === void 0 ? "primary" : _a;
|
|
16
|
+
var colors = (0, styles_2.getColors)(props);
|
|
17
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
18
|
+
return "\n &:before {\n background-color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n border-radius: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n content: \"\";\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n max-width: 180px;\n top: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xl, "px;\n margin-bottom: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n position: sticky;\n .MuiTabs-indicator {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors[sdsIndicatorColor][400], " !important;\n border-radius: 2px;\n left: 0;\n width: 2px;\n }\n ");
|
|
19
|
+
});
|
|
20
|
+
exports.StyledTab = (0, styles_1.styled)(material_1.Tab, {
|
|
21
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
22
|
+
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), styles_2.fontBodyXs, function (props) {
|
|
23
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
24
|
+
var colors = (0, styles_2.getColors)(props);
|
|
25
|
+
return "\n box-sizing: border-box;\n max-width: 180px;\n padding-left: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n margin: 0 ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n align-items: start;\n min-height: unset;\n max-height: unset;\n text-transform: none;\n &:last-child {\n margin-bottom: 0;\n }\n &:before {\n content: \"\";\n position: absolute;\n left: -").concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n height: 100%;\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[400], ";\n display: none;\n border-radius: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n &:hover {\n color: black;\n &:before {\n display: block;\n }\n }\n &.Mui-selected {\n color: black;\n font-weight: 600;\n }\n &.MuiTabs-indicator {\n backgroundColor: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n width: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xxxs, "px;\n }\n &.MuiButtonBase-root {\n white-space: nowrap;\n padding: 0;\n overflow: visible;\n }\n ");
|
|
26
|
+
});
|
|
27
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook that observes elements to determine if they are in the viewport.
|
|
4
|
+
*
|
|
5
|
+
* @param items - Array of items to observe.
|
|
6
|
+
* @returns Object containing the visibility status of each observed item.
|
|
7
|
+
*/
|
|
8
|
+
export default function useInView(items: Array<{
|
|
9
|
+
title: string;
|
|
10
|
+
elementRef: React.MutableRefObject<HTMLElement | null>;
|
|
11
|
+
}>): {
|
|
12
|
+
el: React.MutableRefObject<HTMLElement | null>;
|
|
13
|
+
isInView: boolean;
|
|
14
|
+
}[] | {
|
|
15
|
+
[key: string]: {
|
|
16
|
+
intersectionEntry: IntersectionObserverEntry;
|
|
17
|
+
isInView: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
var react_1 = require("react");
|
|
15
|
+
/**
|
|
16
|
+
* Custom hook that observes elements to determine if they are in the viewport.
|
|
17
|
+
*
|
|
18
|
+
* @param items - Array of items to observe.
|
|
19
|
+
* @returns Object containing the visibility status of each observed item.
|
|
20
|
+
*/
|
|
21
|
+
function useInView(items) {
|
|
22
|
+
// If the window object is not available (e.g., in a node environment) or
|
|
23
|
+
// If the IntersectionObserver is not available (e.g., in a test environment),
|
|
24
|
+
// return a default result indicating that all elements are not in view
|
|
25
|
+
if (typeof window === "undefined" || !window.IntersectionObserver) {
|
|
26
|
+
return items.map(function (item) {
|
|
27
|
+
return {
|
|
28
|
+
el: item.elementRef,
|
|
29
|
+
isInView: false,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
var _a = (0, react_1.useState)({}), elements = _a[0], setElements = _a[1];
|
|
34
|
+
(0, react_1.useEffect)(function () {
|
|
35
|
+
/**
|
|
36
|
+
* Callback function called by the IntersectionObserver.
|
|
37
|
+
* Updates the visibility status of observed elements.
|
|
38
|
+
*
|
|
39
|
+
* @param entries - IntersectionObserverEntry array containing information about each observed element.
|
|
40
|
+
*/
|
|
41
|
+
var observerCallback = function (entries) {
|
|
42
|
+
entries.forEach(function (entry, index) {
|
|
43
|
+
var name = entry.target.getAttribute("id") || index;
|
|
44
|
+
setElements(function (prev) {
|
|
45
|
+
var _a;
|
|
46
|
+
return __assign(__assign({}, prev), (_a = {}, _a[name] = {
|
|
47
|
+
intersectionEntry: entry,
|
|
48
|
+
isInView: entry.isIntersecting,
|
|
49
|
+
}, _a));
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
var observer = new IntersectionObserver(observerCallback);
|
|
54
|
+
// Observe each item's element
|
|
55
|
+
items.forEach(function (item) {
|
|
56
|
+
if (item.elementRef.current) {
|
|
57
|
+
observer.observe(item.elementRef.current);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
// Cleanup function to disconnect the IntersectionObserver
|
|
61
|
+
return function () {
|
|
62
|
+
observer.disconnect();
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
return elements;
|
|
66
|
+
}
|
|
67
|
+
exports.default = useInView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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 utils_1 = require("src/common/utils");
|
|
6
|
+
var NotificationNameSpaceTest = function (props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Notification, { autoDismiss: true, dismissed: false, slideDirection: "left", intent: "info", onClose: utils_1.noop, buttonOnClick: utils_1.noop, buttonText: "Text", children: "This is a notification!" }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AlertProps } from "@mui/lab";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface NotificationProps {
|
|
4
|
+
autoDismiss?: boolean | number;
|
|
5
|
+
buttonOnClick?: (event: React.SyntheticEvent) => void;
|
|
6
|
+
buttonText?: string;
|
|
7
|
+
dismissed?: boolean;
|
|
8
|
+
slideDirection: "left" | "right";
|
|
9
|
+
extraContent?: boolean;
|
|
10
|
+
intent: "info" | "error" | "success" | "warning";
|
|
11
|
+
}
|
|
12
|
+
export type ExposedNotificationProps = Omit<AlertProps, "nonce" | "rev" | "rel" | "autoFocus" | "content"> & NotificationProps;
|
|
13
|
+
/**
|
|
14
|
+
* @see https://mui.com/material-ui/react-alert/
|
|
15
|
+
*/
|
|
16
|
+
declare const Notification: ({ autoDismiss, children, dismissed, slideDirection, intent, onClose, buttonOnClick, buttonText, ...rest }: ExposedNotificationProps) => JSX.Element;
|
|
17
|
+
export default Notification;
|
|
@@ -0,0 +1,70 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var material_1 = require("@mui/material");
|
|
30
|
+
var react_1 = require("react");
|
|
31
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
32
|
+
var ButtonIcon_1 = __importDefault(require("../ButtonIcon"));
|
|
33
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
34
|
+
var style_1 = require("./style");
|
|
35
|
+
/**
|
|
36
|
+
* @see https://mui.com/material-ui/react-alert/
|
|
37
|
+
*/
|
|
38
|
+
var Notification = function (_a) {
|
|
39
|
+
var autoDismiss = _a.autoDismiss, children = _a.children, dismissed = _a.dismissed, _b = _a.slideDirection, slideDirection = _b === void 0 ? "left" : _b, intent = _a.intent, onClose = _a.onClose, buttonOnClick = _a.buttonOnClick, buttonText = _a.buttonText, rest = __rest(_a, ["autoDismiss", "children", "dismissed", "slideDirection", "intent", "onClose", "buttonOnClick", "buttonText"]);
|
|
40
|
+
var _c = (0, react_1.useState)(dismissed), hide = _c[0], setHide = _c[1];
|
|
41
|
+
// remove prop used only for stories
|
|
42
|
+
var passedProps = __assign({}, rest);
|
|
43
|
+
delete passedProps.extraContent;
|
|
44
|
+
(0, react_1.useEffect)(function () {
|
|
45
|
+
setHide(dismissed);
|
|
46
|
+
if (autoDismiss) {
|
|
47
|
+
var timeout = typeof autoDismiss === "boolean" ? 8000 : autoDismiss;
|
|
48
|
+
setTimeout(function () {
|
|
49
|
+
setHide(true);
|
|
50
|
+
}, timeout);
|
|
51
|
+
}
|
|
52
|
+
}, [dismissed, autoDismiss]);
|
|
53
|
+
var handleClose = function (event) {
|
|
54
|
+
setHide(true);
|
|
55
|
+
if (onClose)
|
|
56
|
+
onClose(event);
|
|
57
|
+
};
|
|
58
|
+
var getIcon = function () {
|
|
59
|
+
switch (intent) {
|
|
60
|
+
case "success":
|
|
61
|
+
return (0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "checkCircle", sdsType: "static" });
|
|
62
|
+
case "info":
|
|
63
|
+
return (0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "infoCircle", sdsType: "static" });
|
|
64
|
+
default:
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "exclamationMarkCircle", sdsType: "static" }));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.Slide, { in: !hide, direction: slideDirection, mountOnEnter: true, unmountOnExit: true, timeout: 250, children: (0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsxs)(style_1.StyledNotification, __assign({ onClose: onClose ? handleClose : undefined, action: onClose ? ((0, jsx_runtime_1.jsx)(ButtonIcon_1.default, { onClick: handleClose, sdsSize: "small", sdsType: "tertiary", "data-testid": "notificationCloseButton", sdsIcon: "xMark" })) : null, icon: getIcon(), className: "elevated", severity: intent }, passedProps, { children: [children, buttonOnClick && ((0, jsx_runtime_1.jsx)(Button_1.default, { sdsStyle: "minimal", sdsType: "secondary", onClick: buttonOnClick, children: buttonText }))] })) }) }) }));
|
|
69
|
+
};
|
|
70
|
+
exports.default = Notification;
|