@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,29 @@
|
|
|
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 jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
|
+
var icons_material_1 = require("@mui/icons-material");
|
|
16
|
+
var warnings_1 = require("src/common/warnings");
|
|
17
|
+
var style_1 = require("./style");
|
|
18
|
+
/**
|
|
19
|
+
* @see https://mui.com/material-ui/react-chip/
|
|
20
|
+
*/
|
|
21
|
+
var Chip = function (props) {
|
|
22
|
+
(0, warnings_1.showWarningIfFirstOccurence)(warnings_1.SDSWarningTypes.ChipDeprecated);
|
|
23
|
+
var onDelete = props.onDelete;
|
|
24
|
+
if (onDelete) {
|
|
25
|
+
return (0, jsx_runtime_1.jsx)(style_1.StyledChip, __assign({ deleteIcon: (0, jsx_runtime_1.jsx)(icons_material_1.Clear, {}) }, props));
|
|
26
|
+
}
|
|
27
|
+
return (0, jsx_runtime_1.jsx)(style_1.StyledChip, __assign({}, props));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Chip;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const MediumSquareChip: {
|
|
5
|
+
args: {
|
|
6
|
+
isRounded: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
size: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const Success: {
|
|
12
|
+
args: {
|
|
13
|
+
isRounded: boolean;
|
|
14
|
+
label: string;
|
|
15
|
+
size: string;
|
|
16
|
+
status: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const Error: {
|
|
20
|
+
args: {
|
|
21
|
+
isRounded: boolean;
|
|
22
|
+
label: string;
|
|
23
|
+
size: string;
|
|
24
|
+
status: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const Warning: {
|
|
28
|
+
args: {
|
|
29
|
+
isRounded: boolean;
|
|
30
|
+
label: string;
|
|
31
|
+
size: string;
|
|
32
|
+
status: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export declare const Info: {
|
|
36
|
+
args: {
|
|
37
|
+
isRounded: boolean;
|
|
38
|
+
label: string;
|
|
39
|
+
size: string;
|
|
40
|
+
status: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export declare const Pending: {
|
|
44
|
+
args: {
|
|
45
|
+
isRounded: boolean;
|
|
46
|
+
label: string;
|
|
47
|
+
size: string;
|
|
48
|
+
status: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const Beta: {
|
|
52
|
+
args: {
|
|
53
|
+
isRounded: boolean;
|
|
54
|
+
label: string;
|
|
55
|
+
size: string;
|
|
56
|
+
status: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
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.Beta = exports.Pending = exports.Info = exports.Warning = exports.Error = exports.Success = exports.MediumSquareChip = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var react_1 = __importDefault(require("react"));
|
|
20
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
21
|
+
var index_1 = __importDefault(require("./index"));
|
|
22
|
+
var Demo = function (props) {
|
|
23
|
+
var size = props.size, isRounded = props.isRounded;
|
|
24
|
+
var _a = react_1.default.useState(false), visible = _a[0], setVisible = _a[1];
|
|
25
|
+
var handleShowChip = function () { return setVisible(true); };
|
|
26
|
+
var handleDismissChip = function () { return setVisible(false); };
|
|
27
|
+
if (size === "medium" && !isRounded) {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.default, { onClick: handleShowChip, sdsType: "secondary", sdsStyle: "square", children: "Click me!" }), visible && (0, jsx_runtime_1.jsx)(index_1.default, __assign({ onDelete: handleDismissChip }, props))] }));
|
|
29
|
+
}
|
|
30
|
+
return (0, jsx_runtime_1.jsx)(index_1.default, __assign({}, props));
|
|
31
|
+
};
|
|
32
|
+
exports.default = {
|
|
33
|
+
component: Demo,
|
|
34
|
+
title: "Chip - To Be Depreciated",
|
|
35
|
+
};
|
|
36
|
+
exports.MediumSquareChip = {
|
|
37
|
+
args: {
|
|
38
|
+
isRounded: false,
|
|
39
|
+
label: "Chip",
|
|
40
|
+
size: "medium",
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
exports.Success = {
|
|
44
|
+
args: {
|
|
45
|
+
isRounded: true,
|
|
46
|
+
label: "success",
|
|
47
|
+
size: "small",
|
|
48
|
+
status: "success",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
exports.Error = {
|
|
52
|
+
args: {
|
|
53
|
+
isRounded: true,
|
|
54
|
+
label: "error",
|
|
55
|
+
size: "small",
|
|
56
|
+
status: "error",
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
exports.Warning = {
|
|
60
|
+
args: {
|
|
61
|
+
isRounded: true,
|
|
62
|
+
label: "warning",
|
|
63
|
+
size: "small",
|
|
64
|
+
status: "warning",
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
exports.Info = {
|
|
68
|
+
args: {
|
|
69
|
+
isRounded: true,
|
|
70
|
+
label: "info",
|
|
71
|
+
size: "small",
|
|
72
|
+
status: "info",
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
exports.Pending = {
|
|
76
|
+
args: {
|
|
77
|
+
isRounded: true,
|
|
78
|
+
label: "pending",
|
|
79
|
+
size: "small",
|
|
80
|
+
status: "pending",
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
exports.Beta = {
|
|
84
|
+
args: {
|
|
85
|
+
isRounded: true,
|
|
86
|
+
label: "beta",
|
|
87
|
+
size: "small",
|
|
88
|
+
status: "beta",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonThemeProps } from "../styles";
|
|
3
|
+
export interface ChipExtraProps extends CommonThemeProps {
|
|
4
|
+
size?: "small" | "medium";
|
|
5
|
+
status?: "success" | "error" | "warning" | "info" | "pending" | "beta";
|
|
6
|
+
isRounded?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const StyledChip: import("@emotion/styled").StyledComponent<{
|
|
9
|
+
avatar?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
10
|
+
children?: null | undefined;
|
|
11
|
+
classes?: Partial<import("@mui/material").ChipClasses> | undefined;
|
|
12
|
+
clickable?: boolean | undefined;
|
|
13
|
+
color?: import("@mui/types").OverridableStringUnion<"primary" | "secondary" | "default" | "error" | "info" | "success" | "warning", import("@mui/material").ChipPropsColorOverrides> | undefined;
|
|
14
|
+
deleteIcon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
icon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
17
|
+
label?: import("react").ReactNode;
|
|
18
|
+
onDelete?: ((event: any) => void) | undefined;
|
|
19
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium", import("@mui/material").ChipPropsSizeOverrides> | undefined;
|
|
20
|
+
skipFocusWhenDisabled?: boolean | undefined;
|
|
21
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
variant?: import("@mui/types").OverridableStringUnion<"outlined" | "filled", import("@mui/material").ChipPropsVariantOverrides> | undefined;
|
|
24
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
25
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
26
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "color" | "disabled" | "label" | "tabIndex" | "size" | "icon" | "avatar" | "clickable" | "deleteIcon" | "onDelete" | "skipFocusWhenDisabled"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ChipExtraProps, {}, {}>;
|
|
@@ -0,0 +1,95 @@
|
|
|
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.StyledChip = void 0;
|
|
8
|
+
var react_1 = require("@emotion/react");
|
|
9
|
+
var material_1 = require("@mui/material");
|
|
10
|
+
var styles_1 = require("@mui/material/styles");
|
|
11
|
+
var styles_2 = require("../styles");
|
|
12
|
+
var small = function (props) {
|
|
13
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
14
|
+
return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: ", "px;\n padding: ", "px ", "px;\n\n .MuiChip-label {\n ", "\n padding: 0;\n }\n "], ["\n height: ", "px;\n padding: ", "px ", "px;\n\n .MuiChip-label {\n ", "\n padding: 0;\n }\n "])), spacings === null || spacings === void 0 ? void 0 : spacings.l, spacings === null || spacings === void 0 ? void 0 : spacings.xxs, spacings === null || spacings === void 0 ? void 0 : spacings.xs, (0, styles_2.fontCapsXxxxs)(props));
|
|
15
|
+
};
|
|
16
|
+
var medium = function (props) {
|
|
17
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
18
|
+
var colors = (0, styles_2.getColors)(props);
|
|
19
|
+
return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0 ", "px;\n height: 24px;\n\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n .MuiChip-label {\n ", "\n color: white;\n padding-left: ", "px;\n }\n\n .MuiChip-deleteIcon {\n color: white;\n padding-right: ", "px;\n margin: 0 0 0 -", "px;\n height: ", "px;\n width: ", "px;\n\n &:hover,\n &:focus-visible {\n color: white;\n }\n }\n "], ["\n margin: 0 ", "px;\n height: 24px;\n\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n .MuiChip-label {\n ", "\n color: white;\n padding-left: ", "px;\n }\n\n .MuiChip-deleteIcon {\n color: white;\n padding-right: ", "px;\n margin: 0 0 0 -", "px;\n height: ", "px;\n width: ", "px;\n\n &:hover,\n &:focus-visible {\n color: white;\n }\n }\n "])), spacings === null || spacings === void 0 ? void 0 : spacings.s, colors === null || colors === void 0 ? void 0 : colors.primary[400], colors === null || colors === void 0 ? void 0 : colors.primary[500], colors === null || colors === void 0 ? void 0 : colors.primary[600], (0, styles_2.fontHeaderXs)(props), spacings === null || spacings === void 0 ? void 0 : spacings.s, spacings === null || spacings === void 0 ? void 0 : spacings.xxs, spacings === null || spacings === void 0 ? void 0 : spacings.s, spacings === null || spacings === void 0 ? void 0 : spacings.l, spacings === null || spacings === void 0 ? void 0 : spacings.l);
|
|
20
|
+
};
|
|
21
|
+
var rounded = function (props) {
|
|
22
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
23
|
+
return (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: ", "px;\n "], ["\n border-radius: ", "px;\n "])), corners === null || corners === void 0 ? void 0 : corners.l);
|
|
24
|
+
};
|
|
25
|
+
var square = function (props) {
|
|
26
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
27
|
+
return (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: ", "px;\n "], ["\n border-radius: ", "px;\n "])), corners === null || corners === void 0 ? void 0 : corners.m);
|
|
28
|
+
};
|
|
29
|
+
var success = function (props) {
|
|
30
|
+
return createStatusCss(props, "success");
|
|
31
|
+
};
|
|
32
|
+
var error = function (props) {
|
|
33
|
+
return createStatusCss(props, "error");
|
|
34
|
+
};
|
|
35
|
+
var beta = function (props) {
|
|
36
|
+
return createStatusCss(props, "beta");
|
|
37
|
+
};
|
|
38
|
+
var pending = function (props) {
|
|
39
|
+
return createStatusCss(props, "pending");
|
|
40
|
+
};
|
|
41
|
+
var warning = function (props) {
|
|
42
|
+
return createStatusCss(props, "warning");
|
|
43
|
+
};
|
|
44
|
+
var info = function (props) {
|
|
45
|
+
return createStatusCss(props, "info");
|
|
46
|
+
};
|
|
47
|
+
function createStatusCss(props, status) {
|
|
48
|
+
var colors = (0, styles_2.getColors)(props);
|
|
49
|
+
if (!colors)
|
|
50
|
+
return;
|
|
51
|
+
var statusToColors = {
|
|
52
|
+
beta: {
|
|
53
|
+
dark: colors.beta[600],
|
|
54
|
+
light: colors.beta[200],
|
|
55
|
+
},
|
|
56
|
+
error: {
|
|
57
|
+
dark: colors.error[600],
|
|
58
|
+
light: colors.error[200],
|
|
59
|
+
},
|
|
60
|
+
info: {
|
|
61
|
+
dark: colors.info[600],
|
|
62
|
+
light: colors.info[200],
|
|
63
|
+
},
|
|
64
|
+
pending: {
|
|
65
|
+
dark: colors.gray[600],
|
|
66
|
+
light: colors.gray[200],
|
|
67
|
+
},
|
|
68
|
+
success: {
|
|
69
|
+
dark: colors.success[600],
|
|
70
|
+
light: colors.success[200],
|
|
71
|
+
},
|
|
72
|
+
warning: {
|
|
73
|
+
dark: colors.warning[600],
|
|
74
|
+
light: colors.warning[200],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
var statusColors = statusToColors[status];
|
|
78
|
+
return (0, react_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n\n .MuiChip-label {\n color: ", ";\n }\n "], ["\n background-color: ", ";\n\n .MuiChip-label {\n color: ", ";\n }\n "])), statusColors.light, statusColors.dark);
|
|
79
|
+
}
|
|
80
|
+
var statusToCss = {
|
|
81
|
+
beta: beta,
|
|
82
|
+
error: error,
|
|
83
|
+
info: info,
|
|
84
|
+
pending: pending,
|
|
85
|
+
success: success,
|
|
86
|
+
warning: warning,
|
|
87
|
+
};
|
|
88
|
+
var doNotForwardProps = ["isRounded"];
|
|
89
|
+
exports.StyledChip = (0, styles_1.styled)(material_1.Chip, {
|
|
90
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
91
|
+
})(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border: none;\n\n ", "\n"], ["\n border: none;\n\n ", "\n"])), function (props) {
|
|
92
|
+
var size = props.size, status = props.status, isRounded = props.isRounded;
|
|
93
|
+
return (0, react_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), isRounded && rounded(props), !isRounded && square(props), size === "small" && small(props), size === "medium" && medium(props), status && statusToCss[status](props));
|
|
94
|
+
});
|
|
95
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
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 OPTIONS = [
|
|
7
|
+
{
|
|
8
|
+
color: "#7057ff",
|
|
9
|
+
description: "Good for newcomers",
|
|
10
|
+
name: "good first issue",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
color: "#008672",
|
|
14
|
+
description: "Extra attention is needed",
|
|
15
|
+
name: "help wanted",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
var ComplexFilterNameSpaceTest = function (props) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(components_1.ComplexFilter, { label: "Click Target", onChange: utils_1.noop, multiple: true, search: true, options: OPTIONS, isTriggerChangeOnOptionClick: true }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DefaultDropdownMenuOption } from "src/core/DropdownMenu";
|
|
2
|
+
interface Props {
|
|
3
|
+
value: DefaultDropdownMenuOption | DefaultDropdownMenuOption[] | null;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
onDelete: (option: DefaultDropdownMenuOption) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const Chips: ({ value, multiple, onDelete, }: Props) => JSX.Element | null;
|
|
8
|
+
export default Chips;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var TagFilter_1 = __importDefault(require("src/core/TagFilter"));
|
|
8
|
+
var Chips = function (_a) {
|
|
9
|
+
var value = _a.value, _b = _a.multiple, multiple = _b === void 0 ? false : _b, onDelete = _a.onDelete;
|
|
10
|
+
if (!value)
|
|
11
|
+
return null;
|
|
12
|
+
if (!multiple) {
|
|
13
|
+
var name_1 = value.name;
|
|
14
|
+
return (0, jsx_runtime_1.jsx)(TagFilter_1.default, { label: name_1, onDelete: onDelete });
|
|
15
|
+
}
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: value.map(function (item) {
|
|
17
|
+
var name = item.name;
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(TagFilter_1.default, { label: name, onDelete: function () { return onDelete(item); } }, name));
|
|
19
|
+
}) }));
|
|
20
|
+
};
|
|
21
|
+
exports.default = Chips;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Value } from "../Dropdown";
|
|
3
|
+
import DropdownMenu, { DefaultDropdownMenuOption } from "../DropdownMenu";
|
|
4
|
+
import { StyledPopper } from "../DropdownMenu/style";
|
|
5
|
+
import InputDropdown, { InputDropdownProps as InputDropdownPropsType } from "../InputDropdown";
|
|
6
|
+
export { InputDropdown as ComplexFilterInputDropdown, StyledPopper as ComplexFilterPopper, };
|
|
7
|
+
export interface ComplexFilterProps<Multiple> {
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
options: DefaultDropdownMenuOption[];
|
|
10
|
+
multiple?: Multiple;
|
|
11
|
+
search?: boolean;
|
|
12
|
+
onChange: (options: Value<DefaultDropdownMenuOption, Multiple>) => void;
|
|
13
|
+
DropdownMenuProps?: Partial<typeof DropdownMenu>;
|
|
14
|
+
InputDropdownProps?: Partial<InputDropdownPropsType>;
|
|
15
|
+
value?: Value<DefaultDropdownMenuOption, Multiple>;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
className?: string;
|
|
18
|
+
PopperComponent?: typeof StyledPopper;
|
|
19
|
+
InputDropdownComponent?: typeof InputDropdown;
|
|
20
|
+
isTriggerChangeOnOptionClick?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const ComplexFilter: <Multiple extends boolean | undefined = false>({ options, label, multiple, search, onChange, DropdownMenuProps, InputDropdownProps, value: propValue, PopperComponent, InputDropdownComponent, isTriggerChangeOnOptionClick, ...rest }: ComplexFilterProps<Multiple>) => JSX.Element;
|
|
23
|
+
export default ComplexFilter;
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
exports.ComplexFilterPopper = exports.ComplexFilterInputDropdown = void 0;
|
|
29
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
var react_1 = require("react");
|
|
31
|
+
var DropdownMenu_1 = __importDefault(require("../DropdownMenu"));
|
|
32
|
+
var style_1 = require("../DropdownMenu/style");
|
|
33
|
+
Object.defineProperty(exports, "ComplexFilterPopper", { enumerable: true, get: function () { return style_1.StyledPopper; } });
|
|
34
|
+
var InputDropdown_1 = __importDefault(require("../InputDropdown"));
|
|
35
|
+
exports.ComplexFilterInputDropdown = InputDropdown_1.default;
|
|
36
|
+
var Chips_1 = __importDefault(require("./components/Chips"));
|
|
37
|
+
var style_2 = require("./style");
|
|
38
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
39
|
+
var ComplexFilter = function (_a) {
|
|
40
|
+
var options = _a.options, _b = _a.label, label = _b === void 0 ? "" : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.search, search = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.DropdownMenuProps, DropdownMenuProps = _e === void 0 ? {} : _e, _f = _a.InputDropdownProps, InputDropdownProps = _f === void 0 ? { sdsStyle: "minimal" } : _f, propValue = _a.value, PopperComponent = _a.PopperComponent, _g = _a.InputDropdownComponent, InputDropdownComponent = _g === void 0 ? InputDropdown_1.default : _g, _h = _a.isTriggerChangeOnOptionClick, isTriggerChangeOnOptionClick = _h === void 0 ? false : _h, rest = __rest(_a, ["options", "label", "multiple", "search", "onChange", "DropdownMenuProps", "InputDropdownProps", "value", "PopperComponent", "InputDropdownComponent", "isTriggerChangeOnOptionClick"]);
|
|
41
|
+
var isControlled = propValue !== undefined;
|
|
42
|
+
var _j = (0, react_1.useState)(false), open = _j[0], setOpen = _j[1];
|
|
43
|
+
var _k = (0, react_1.useState)(null), anchorEl = _k[0], setAnchorEl = _k[1];
|
|
44
|
+
var _l = (0, react_1.useState)(getInitialValue()), value = _l[0], setValue = _l[1];
|
|
45
|
+
var _m = (0, react_1.useState)(getInitialValue()), pendingValue = _m[0], setPendingValue = _m[1];
|
|
46
|
+
(0, react_1.useEffect)(function () {
|
|
47
|
+
onChange(value);
|
|
48
|
+
setPendingValue(value);
|
|
49
|
+
}, [value]);
|
|
50
|
+
(0, react_1.useEffect)(function () {
|
|
51
|
+
if (isControlled) {
|
|
52
|
+
setValue(propValue);
|
|
53
|
+
}
|
|
54
|
+
}, [propValue]);
|
|
55
|
+
// * (mlila): likely, this portion on ComplexFilter will need to be replaced with Dropdown (or a
|
|
56
|
+
// * new DropdownFilter) component. As ComplexFilter evolves, there will be more types added,
|
|
57
|
+
// * such as sliders for ranges, inline multi selects, etc.
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(style_2.Wrapper, __assign({}, rest, { children: [(0, jsx_runtime_1.jsx)(InputDropdownComponent, __assign({ label: label, onClick: handleClick, sdsStage: open ? "userInput" : "default" }, InputDropdownProps)), (0, jsx_runtime_1.jsx)(style_2.StyledChipsWrapper, { children: (0, jsx_runtime_1.jsx)(Chips_1.default, { value: value, multiple: multiple, onDelete: handleDelete }) })] })), (0, jsx_runtime_1.jsx)(DropdownMenu_1.default, __assign({ anchorEl: anchorEl, open: open, onClose: handleMenuSelectClose, search: search, multiple: multiple, value: (multiple ? pendingValue : value), onChange: handleChange, disableCloseOnSelect: multiple, options: options, PopperComponent: PopperComponent, PopperBaseProps: { sx: { minWidth: 250 } }, onClickAway: handleClose }, DropdownMenuProps))] }));
|
|
59
|
+
function handleClick(event) {
|
|
60
|
+
if (open) {
|
|
61
|
+
if (multiple) {
|
|
62
|
+
setValue(pendingValue);
|
|
63
|
+
}
|
|
64
|
+
setOpen(false);
|
|
65
|
+
if (anchorEl) {
|
|
66
|
+
anchorEl.focus();
|
|
67
|
+
}
|
|
68
|
+
setAnchorEl(null);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
if (multiple) {
|
|
72
|
+
setPendingValue(value);
|
|
73
|
+
}
|
|
74
|
+
setAnchorEl(event.currentTarget);
|
|
75
|
+
setOpen(true);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function handleClose() {
|
|
79
|
+
if (open) {
|
|
80
|
+
setOpen(false);
|
|
81
|
+
if (multiple) {
|
|
82
|
+
setValue(pendingValue);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function handleMenuSelectClose(event, reason) {
|
|
87
|
+
var reasons = ["escape", "select-option"];
|
|
88
|
+
if (reasons.includes(reason)) {
|
|
89
|
+
handleClose();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function handleChange(_, newValue) {
|
|
93
|
+
if (multiple) {
|
|
94
|
+
if (isTriggerChangeOnOptionClick) {
|
|
95
|
+
setPendingValue(newValue);
|
|
96
|
+
return setValue(newValue);
|
|
97
|
+
}
|
|
98
|
+
return setPendingValue(newValue);
|
|
99
|
+
}
|
|
100
|
+
setValue(newValue);
|
|
101
|
+
setOpen(false);
|
|
102
|
+
}
|
|
103
|
+
function handleDelete(option) {
|
|
104
|
+
if (!multiple) {
|
|
105
|
+
return setValue(null);
|
|
106
|
+
}
|
|
107
|
+
var newValue = (value === null || value === void 0 ? void 0 : value.filter(function (item) { return item !== option; })) || null;
|
|
108
|
+
setValue(newValue);
|
|
109
|
+
}
|
|
110
|
+
function getInitialValue() {
|
|
111
|
+
if (isControlled) {
|
|
112
|
+
return propValue;
|
|
113
|
+
}
|
|
114
|
+
return multiple
|
|
115
|
+
? []
|
|
116
|
+
: null;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.default = ComplexFilter;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: {
|
|
5
|
+
args: {
|
|
6
|
+
isTriggerChangeOnOptionClick: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
multiple: boolean;
|
|
9
|
+
onChange: (value: never) => void;
|
|
10
|
+
search: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare const LivePreview: {
|
|
14
|
+
args: {
|
|
15
|
+
keepSearchOnSelect: boolean;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
search: boolean;
|
|
18
|
+
};
|
|
19
|
+
parameters: {
|
|
20
|
+
snapshot: {
|
|
21
|
+
skip: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
render: (args: Args) => JSX.Element;
|
|
25
|
+
};
|
|
26
|
+
export declare const Test: {
|
|
27
|
+
parameters: {
|
|
28
|
+
snapshot: {
|
|
29
|
+
skip: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
render: (args: Args) => JSX.Element;
|
|
33
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
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 utils_1 = require("src/common/utils");
|
|
20
|
+
var GITHUB_LABELS_1 = require("../DropdownMenu/GITHUB_LABELS");
|
|
21
|
+
var index_1 = __importDefault(require("./index"));
|
|
22
|
+
var ComplexFilter = function (props) {
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(index_1.default, __assign({ label: "Click Target", onChange: utils_1.noop, options: GITHUB_LABELS_1.GITHUB_LABELS, DropdownMenuProps: {
|
|
24
|
+
groupBy: function (option) {
|
|
25
|
+
return option.section;
|
|
26
|
+
},
|
|
27
|
+
} }, props)));
|
|
28
|
+
};
|
|
29
|
+
var onChangeOptions = [
|
|
30
|
+
utils_1.noop,
|
|
31
|
+
function (value) {
|
|
32
|
+
// eslint-disable-next-line no-console
|
|
33
|
+
console.log(value);
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
exports.default = {
|
|
37
|
+
argTypes: {
|
|
38
|
+
isTriggerChangeOnOptionClick: {
|
|
39
|
+
control: {
|
|
40
|
+
type: "boolean",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
label: {
|
|
44
|
+
control: {
|
|
45
|
+
type: "text",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
multiple: {
|
|
49
|
+
control: {
|
|
50
|
+
type: "boolean",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
onChange: {
|
|
54
|
+
control: {
|
|
55
|
+
labels: ["Noop", "console.log(value)"],
|
|
56
|
+
type: "select",
|
|
57
|
+
},
|
|
58
|
+
mapping: onChangeOptions,
|
|
59
|
+
options: Object.keys(onChangeOptions),
|
|
60
|
+
},
|
|
61
|
+
search: {
|
|
62
|
+
control: {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
component: ComplexFilter,
|
|
68
|
+
title: "ComplexFilter",
|
|
69
|
+
};
|
|
70
|
+
// Default
|
|
71
|
+
exports.Default = {
|
|
72
|
+
args: {
|
|
73
|
+
isTriggerChangeOnOptionClick: false,
|
|
74
|
+
label: "Click Target",
|
|
75
|
+
multiple: true,
|
|
76
|
+
onChange: onChangeOptions[1],
|
|
77
|
+
search: true,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
// Live preview
|
|
81
|
+
var livePreviewStyles = {
|
|
82
|
+
display: "grid",
|
|
83
|
+
gridColumnGap: 30,
|
|
84
|
+
gridTemplateColumns: "repeat(3, min-content)",
|
|
85
|
+
};
|
|
86
|
+
var LivePreviewDemo = function () {
|
|
87
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: livePreviewStyles, children: [(0, jsx_runtime_1.jsx)("div", { style: { gridArea: "1/1/2/2" }, children: (0, jsx_runtime_1.jsx)(index_1.default, { DropdownMenuProps: {
|
|
88
|
+
PopperBaseProps: {
|
|
89
|
+
sx: { width: 160 },
|
|
90
|
+
},
|
|
91
|
+
}, label: "Filter Label", multiple: false, search: false, onChange: utils_1.noop, options: LIVE_PREVIEW_OPTIONS }) }), (0, jsx_runtime_1.jsx)("div", { style: { gridArea: "1/2/2/3" }, children: (0, jsx_runtime_1.jsx)(index_1.default, { DropdownMenuProps: {
|
|
92
|
+
PopperBaseProps: {
|
|
93
|
+
sx: { width: 160 },
|
|
94
|
+
},
|
|
95
|
+
}, label: "Filter Label", multiple: true, search: false, onChange: utils_1.noop, options: LIVE_PREVIEW_OPTIONS }) })] }));
|
|
96
|
+
};
|
|
97
|
+
exports.LivePreview = {
|
|
98
|
+
args: {
|
|
99
|
+
keepSearchOnSelect: true,
|
|
100
|
+
multiple: false,
|
|
101
|
+
search: false,
|
|
102
|
+
},
|
|
103
|
+
parameters: {
|
|
104
|
+
snapshot: {
|
|
105
|
+
skip: true,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
109
|
+
};
|
|
110
|
+
var LIVE_PREVIEW_OPTIONS = [
|
|
111
|
+
{ name: "Filter Item 1" },
|
|
112
|
+
{ name: "Filter Item 2" },
|
|
113
|
+
{ name: "Filter Item 3" },
|
|
114
|
+
];
|
|
115
|
+
// Test
|
|
116
|
+
var TestDemo = function (props) {
|
|
117
|
+
return ((0, jsx_runtime_1.jsx)(index_1.default, __assign({ "data-testid": "complex-filter", label: "Click Target", onChange: utils_1.noop, options: GITHUB_LABELS_1.GITHUB_LABELS }, props)));
|
|
118
|
+
};
|
|
119
|
+
exports.Test = {
|
|
120
|
+
parameters: {
|
|
121
|
+
snapshot: {
|
|
122
|
+
skip: true,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(TestDemo, __assign({}, args)); },
|
|
126
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|