@czi-sds/components 15.1.1 → 15.3.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 +7 -5
- package/dist/index.cjs.js +144 -86
- package/dist/index.esm.d.ts +7 -5
- package/dist/index.esm.js +144 -86
- 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 +122 -0
- package/dist/src/core/NavigationJumpTo/index.stories.d.ts +56 -0
- package/dist/src/core/NavigationJumpTo/index.stories.js +218 -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,229 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
37
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
38
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
39
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
40
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
41
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
42
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
46
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
47
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
49
|
+
function step(op) {
|
|
50
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
51
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
52
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
53
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
54
|
+
switch (op[0]) {
|
|
55
|
+
case 0: case 1: t = op; break;
|
|
56
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
57
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
58
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
59
|
+
default:
|
|
60
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
61
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
62
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
63
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
64
|
+
if (t[2]) _.ops.pop();
|
|
65
|
+
_.trys.pop(); continue;
|
|
66
|
+
}
|
|
67
|
+
op = body.call(thisArg, _);
|
|
68
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
69
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
|
+
};
|
|
75
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
77
|
+
var story_utils_1 = require("@chanzuckerberg/story-utils");
|
|
78
|
+
var react_1 = require("@storybook/react");
|
|
79
|
+
var react_2 = require("@testing-library/react");
|
|
80
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
81
|
+
var LoadingIndicator_1 = __importDefault(require("../LoadingIndicator"));
|
|
82
|
+
var snapshotTestStoryFile = __importStar(require("./index.stories"));
|
|
83
|
+
var index_stories_1 = __importStar(require("./index.stories"));
|
|
84
|
+
var Test = (0, react_1.composeStory)(index_stories_1.Test, index_stories_1.default);
|
|
85
|
+
var STATUS_CANT_FIND_TEXT = "Status: can't reproduce";
|
|
86
|
+
describe("<Dropdown />", function () {
|
|
87
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
88
|
+
it("Dropdown component renders correctly", function () {
|
|
89
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args)));
|
|
90
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
91
|
+
expect(DropdownElement).not.toBeNull();
|
|
92
|
+
});
|
|
93
|
+
it("Upon clicking the button, the dropdown menu closes.", function () {
|
|
94
|
+
var args = __assign({}, Test.args);
|
|
95
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
96
|
+
// Open the dropdown
|
|
97
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
98
|
+
react_2.fireEvent.click(DropdownElement);
|
|
99
|
+
// Click on the button again to close it
|
|
100
|
+
react_2.fireEvent.click(DropdownElement);
|
|
101
|
+
var menuItem = react_2.screen.queryByText(STATUS_CANT_FIND_TEXT);
|
|
102
|
+
expect(menuItem).toEqual(null);
|
|
103
|
+
});
|
|
104
|
+
it("Prop Test (loeading): Loading indicator correctly renders when loading state is true", function () {
|
|
105
|
+
var args = __assign(__assign({}, Test.args), { DropdownMenuProps: {
|
|
106
|
+
loading: true,
|
|
107
|
+
loadingText: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(LoadingIndicator_1.default, { sdsStyle: "minimal" }) })),
|
|
108
|
+
}, multiple: true, options: [] });
|
|
109
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
110
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
111
|
+
expect(DropdownElement).not.toBeNull();
|
|
112
|
+
react_2.fireEvent.click(DropdownElement);
|
|
113
|
+
expect(react_2.screen.getAllByText("Loading")).not.toBeNull();
|
|
114
|
+
});
|
|
115
|
+
it("Prop Test (search): Dropdown component search function correctly maintains searched-for items", function () {
|
|
116
|
+
var args = __assign(__assign({}, Test.args), { search: true });
|
|
117
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
118
|
+
// Open the dropdown
|
|
119
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
120
|
+
react_2.fireEvent.click(DropdownElement);
|
|
121
|
+
// Select the search input by placeholder
|
|
122
|
+
var searchInput = react_2.screen.getByPlaceholderText("Search");
|
|
123
|
+
react_2.fireEvent.change(searchInput, { target: { value: "Status" } });
|
|
124
|
+
// We want to test that there ARE items with "Status: *" in the dropdown menu
|
|
125
|
+
// because we have searched for Status
|
|
126
|
+
var statusItem = react_2.screen.queryByText("Status: confirmed");
|
|
127
|
+
expect(statusItem).not.toBeNull();
|
|
128
|
+
});
|
|
129
|
+
it("Prop Test (search): Dropdown component search function correctly filters out Type items", function () {
|
|
130
|
+
var args = __assign(__assign({}, Test.args), { search: true });
|
|
131
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
132
|
+
// Open the dropdown
|
|
133
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
134
|
+
react_2.fireEvent.click(DropdownElement);
|
|
135
|
+
// Select the search input by placeholder
|
|
136
|
+
var searchInput = react_2.screen.getByPlaceholderText("Search");
|
|
137
|
+
react_2.fireEvent.change(searchInput, { target: { value: "Status" } });
|
|
138
|
+
// We want to test that there are no items with "Type: *" in the dropdown menu
|
|
139
|
+
// because we have searched for Status
|
|
140
|
+
var typeBugItem = react_2.screen.queryByText("Type: bug");
|
|
141
|
+
expect(typeBugItem).toEqual(null);
|
|
142
|
+
});
|
|
143
|
+
it("Prop Test (Label): Dropdown component correctly renders with a new label", function () {
|
|
144
|
+
var args = __assign(__assign({}, Test.args), { label: "Test Label" });
|
|
145
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
146
|
+
expect(react_2.screen.getAllByText("Test Label")).not.toBeNull();
|
|
147
|
+
});
|
|
148
|
+
it("Prop Test (closeOnBlur): Dropdown closes when button is clicked with closeOnBlue set to true", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
var args, DropdownElement, menuItem;
|
|
150
|
+
return __generator(this, function (_a) {
|
|
151
|
+
switch (_a.label) {
|
|
152
|
+
case 0:
|
|
153
|
+
args = __assign(__assign({}, Test.args), { closeOnBlur: true });
|
|
154
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
155
|
+
DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
156
|
+
user_event_1.default.click(DropdownElement);
|
|
157
|
+
// Awaiting to find the STATUS_CANT_FIND_TEXT on the screen to
|
|
158
|
+
// make sure that the dropdown is opened
|
|
159
|
+
return [4 /*yield*/, react_2.screen.findByText(STATUS_CANT_FIND_TEXT)];
|
|
160
|
+
case 1:
|
|
161
|
+
// Awaiting to find the STATUS_CANT_FIND_TEXT on the screen to
|
|
162
|
+
// make sure that the dropdown is opened
|
|
163
|
+
_a.sent();
|
|
164
|
+
// Click on the button again to close it
|
|
165
|
+
user_event_1.default.click(DropdownElement);
|
|
166
|
+
// Wait for 500ms before continuing with the test
|
|
167
|
+
return [4 /*yield*/, (0, story_utils_1.wait)(500)];
|
|
168
|
+
case 2:
|
|
169
|
+
// Wait for 500ms before continuing with the test
|
|
170
|
+
_a.sent();
|
|
171
|
+
menuItem = react_2.screen.queryByText(STATUS_CANT_FIND_TEXT);
|
|
172
|
+
expect(menuItem).toBeNull();
|
|
173
|
+
return [2 /*return*/];
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}); });
|
|
177
|
+
it("Prop Test (closeOnBlur): Dropdown closes when button is clicked with closeOnBlue set to false", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
178
|
+
var args, DropdownElement, menuItem;
|
|
179
|
+
return __generator(this, function (_a) {
|
|
180
|
+
switch (_a.label) {
|
|
181
|
+
case 0:
|
|
182
|
+
args = __assign(__assign({}, Test.args), { closeOnBlur: false });
|
|
183
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
184
|
+
DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
185
|
+
user_event_1.default.click(DropdownElement);
|
|
186
|
+
// Awaiting to find the STATUS_CANT_FIND_TEXT on the screen to
|
|
187
|
+
// make sure that the dropdown is opened
|
|
188
|
+
return [4 /*yield*/, react_2.screen.findByText(STATUS_CANT_FIND_TEXT)];
|
|
189
|
+
case 1:
|
|
190
|
+
// Awaiting to find the STATUS_CANT_FIND_TEXT on the screen to
|
|
191
|
+
// make sure that the dropdown is opened
|
|
192
|
+
_a.sent();
|
|
193
|
+
// Click on the button again to close it
|
|
194
|
+
user_event_1.default.click(DropdownElement);
|
|
195
|
+
// Wait for 500ms before continuing with the test
|
|
196
|
+
return [4 /*yield*/, (0, story_utils_1.wait)(500)];
|
|
197
|
+
case 2:
|
|
198
|
+
// Wait for 500ms before continuing with the test
|
|
199
|
+
_a.sent();
|
|
200
|
+
menuItem = react_2.screen.queryByText(STATUS_CANT_FIND_TEXT);
|
|
201
|
+
expect(menuItem).toBeNull();
|
|
202
|
+
return [2 /*return*/];
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}); });
|
|
206
|
+
it("Prop Test (disabled): Dropdown component doesn't open menu upon click", function () {
|
|
207
|
+
var args = __assign(__assign({}, Test.args), { disabled: true });
|
|
208
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
209
|
+
// (Attempt to) open the dropdown
|
|
210
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
211
|
+
react_2.fireEvent.click(DropdownElement);
|
|
212
|
+
// DropdownMenu should not be found
|
|
213
|
+
var DropdownMenu = react_2.screen.queryByRole("tooltip");
|
|
214
|
+
expect(DropdownMenu).toBeNull();
|
|
215
|
+
});
|
|
216
|
+
it("Prop Test (buttons): Dropdown component renders buttons", function () {
|
|
217
|
+
// The condition for the Dropdown component to show buttons is
|
|
218
|
+
// buttons && !isTriggerChangeOnOptionClick && multiple
|
|
219
|
+
var args = __assign(__assign({}, Test.args), { buttons: true, isTriggerChangeOnOptionClick: false, multiple: true });
|
|
220
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, args)));
|
|
221
|
+
// Open the dropdown
|
|
222
|
+
var DropdownElement = react_2.screen.getByTestId("dropdown");
|
|
223
|
+
react_2.fireEvent.click(DropdownElement);
|
|
224
|
+
// Check for the buttons by text
|
|
225
|
+
var primaryButton = react_2.screen.queryByText("Apply");
|
|
226
|
+
var secondaryButton = react_2.screen.queryByText("Cancel");
|
|
227
|
+
expect(primaryButton && secondaryButton).not.toBeNull();
|
|
228
|
+
});
|
|
229
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
3
|
+
export declare const StyledButton: import("@emotion/styled").StyledComponent<Pick<Omit<import("@mui/material").ButtonProps<import("react").ElementType<any>, {
|
|
4
|
+
component?: import("react").ElementType<any> | undefined;
|
|
5
|
+
}>, "content" | "autoFocus" | "nonce" | "rel" | "rev"> & import("../Button").SdsProps, string | number | symbol> & import("react").RefAttributes<HTMLButtonElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.StyledButton = exports.Wrapper = void 0;
|
|
11
|
+
var styles_1 = require("@mui/material/styles");
|
|
12
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
13
|
+
var styles_2 = require("../styles");
|
|
14
|
+
exports.Wrapper = (0, styles_1.styled)("div")(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 150px;\n"], ["\n width: 150px;\n"])));
|
|
15
|
+
exports.StyledButton = (0, styles_1.styled)(Button_1.default)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
16
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
17
|
+
return "\n margin-top: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n margin-bottom: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n\n &:first-of-type {\n margin-left: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n margin-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n }\n\n &:last-child {\n margin-left: 0;\n margin-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n }\n ");
|
|
18
|
+
});
|
|
19
|
+
var templateObject_1, templateObject_2;
|
|
@@ -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 DropdownMenuNameSpaceTest = function (props) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(components_1.DropdownMenu, { anchorEl: null, disableCloseOnSelect: false, id: "1", multiple: true, onChange: utils_1.noop, open: true, options: OPTIONS, PopperBaseProps: { sx: { width: 300 } }, search: true, title: "Dropdown Menu Title", onClickAway: utils_1.noop, ClickAwayListenerProps: { mouseEvent: false } }));
|
|
20
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
exports.GITHUB_LABELS = void 0;
|
|
7
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
var Tag_1 = __importDefault(require("../Tag"));
|
|
9
|
+
exports.GITHUB_LABELS = [
|
|
10
|
+
{
|
|
11
|
+
name: "Status: can't reproduce",
|
|
12
|
+
section: "name only",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "Status: confirmed",
|
|
16
|
+
section: "name only",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
count: 3,
|
|
20
|
+
name: "Status: duplicate",
|
|
21
|
+
section: "name with count",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
count: 5,
|
|
25
|
+
name: "Status: needs information",
|
|
26
|
+
section: "name with count",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
details: "This will not be worked on",
|
|
30
|
+
name: "Status: wont do/fix",
|
|
31
|
+
section: "name with details",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
details: "This is still in progress",
|
|
35
|
+
name: "Status: work in progress",
|
|
36
|
+
section: "name with details",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
details: "This will not be worked on",
|
|
40
|
+
name: "Type: bug",
|
|
41
|
+
sdsIcon: "bacteria",
|
|
42
|
+
sdsIconProps: {
|
|
43
|
+
className: "custom-class-name",
|
|
44
|
+
},
|
|
45
|
+
section: "With Icon",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
count: 4,
|
|
49
|
+
name: "Type: discussion",
|
|
50
|
+
sdsIcon: "puzzlePiece",
|
|
51
|
+
section: "With Icon",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "Type: documentation",
|
|
55
|
+
sdsIcon: "copy",
|
|
56
|
+
section: "With Icon",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Type: enhancement",
|
|
60
|
+
sdsIcon: "lightBulb",
|
|
61
|
+
section: "With Icon",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "Type: epic",
|
|
65
|
+
sdsIcon: "list",
|
|
66
|
+
section: "With Icon",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Type: feature request",
|
|
70
|
+
sdsIcon: "treeVertical",
|
|
71
|
+
section: "With Icon",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "Type: question",
|
|
75
|
+
sdsIcon: "search",
|
|
76
|
+
section: "With Icon",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
component: ((0, jsx_runtime_1.jsxs)("div", { children: ["Available Labels:", (0, jsx_runtime_1.jsxs)("div", { style: { marginTop: 10 }, children: [(0, jsx_runtime_1.jsx)(Tag_1.default, { label: "bug", sdsStyle: "rounded", sdsType: "secondary", color: "error" }), (0, jsx_runtime_1.jsx)(Tag_1.default, { label: "feature", sdsStyle: "rounded", sdsType: "secondary", color: "warning" }), (0, jsx_runtime_1.jsx)(Tag_1.default, { label: "refactor", sdsStyle: "rounded", sdsType: "secondary", color: "gray" })] })] })),
|
|
80
|
+
name: "custom 2",
|
|
81
|
+
section: "custom component",
|
|
82
|
+
},
|
|
83
|
+
];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AutocompleteInputChangeReason, AutocompleteProps, AutocompleteRenderInputParams, ClickAwayListenerProps as MUIClickAwayListenerProps, PopperProps } from "@mui/material";
|
|
2
|
+
import React, { ReactNode, SyntheticEvent } from "react";
|
|
3
|
+
import { IconProps } from "../Icon";
|
|
4
|
+
import { InputSearchProps } from "../InputSearch";
|
|
5
|
+
import { IconNameToSmallSizes } from "../MenuItem";
|
|
6
|
+
import { StyleProps, StyledPaper, StyledPopper } from "./style";
|
|
7
|
+
interface DropdownMenuOptionGeneral {
|
|
8
|
+
name: string;
|
|
9
|
+
section?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DropdownMenuOptionBasic extends DropdownMenuOptionGeneral {
|
|
12
|
+
count?: number;
|
|
13
|
+
details?: string;
|
|
14
|
+
sdsIcon?: keyof IconNameToSmallSizes;
|
|
15
|
+
sdsIconProps?: Partial<IconProps<keyof IconNameToSmallSizes>>;
|
|
16
|
+
}
|
|
17
|
+
export interface DropdownMenuOptionComponent extends DropdownMenuOptionGeneral {
|
|
18
|
+
component?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
type Exclusive<T, U> = T & {
|
|
21
|
+
[K in Exclude<keyof U, keyof T>]?: undefined;
|
|
22
|
+
};
|
|
23
|
+
export type DefaultDropdownMenuOption = Exclusive<DropdownMenuOptionBasic, DropdownMenuOptionComponent> | Exclusive<DropdownMenuOptionComponent, DropdownMenuOptionBasic>;
|
|
24
|
+
type RenderFunctionType = (props: any) => JSX.Element;
|
|
25
|
+
interface ExtraDropdownMenuProps extends StyleProps {
|
|
26
|
+
keepSearchOnSelect?: boolean;
|
|
27
|
+
renderInput?: (params: AutocompleteRenderInputParams) => React.ReactNode;
|
|
28
|
+
onInputChange?: (event: SyntheticEvent<Element, Event>, value: string, reason: AutocompleteInputChangeReason) => void;
|
|
29
|
+
InputBaseProps?: Partial<InputSearchProps>;
|
|
30
|
+
PopperBaseProps?: Partial<PopperProps>;
|
|
31
|
+
title?: string;
|
|
32
|
+
anchorEl: HTMLElement | null;
|
|
33
|
+
PopperComponent?: typeof StyledPopper | RenderFunctionType;
|
|
34
|
+
PaperComponent?: typeof StyledPaper | RenderFunctionType;
|
|
35
|
+
children?: JSX.Element | null;
|
|
36
|
+
onClickAway: (event: MouseEvent | TouchEvent) => void;
|
|
37
|
+
ClickAwayListenerProps?: Partial<MUIClickAwayListenerProps>;
|
|
38
|
+
}
|
|
39
|
+
type CustomAutocompleteProps<T, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> = Omit<AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>, "renderInput" | "nonce" | "rev" | "rel" | "autoFocus" | "content">;
|
|
40
|
+
export type DropdownMenuProps<T, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined> = CustomAutocompleteProps<T, Multiple, DisableClearable, FreeSolo> & ExtraDropdownMenuProps;
|
|
41
|
+
declare const DropdownMenu: <T extends DefaultDropdownMenuOption, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined>(props: DropdownMenuProps<T, Multiple, DisableClearable, FreeSolo>) => JSX.Element;
|
|
42
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var material_1 = require("@mui/material");
|
|
19
|
+
var react_1 = require("react");
|
|
20
|
+
var utils_1 = require("src/common/utils");
|
|
21
|
+
var ButtonIcon_1 = __importDefault(require("../ButtonIcon"));
|
|
22
|
+
var MenuItem_1 = __importDefault(require("../MenuItem"));
|
|
23
|
+
var style_1 = require("./style");
|
|
24
|
+
var DropdownMenu = function (props) {
|
|
25
|
+
var _a = props.multiple, multiple = _a === void 0 ? false : _a, anchorEl = props.anchorEl, _b = props.disableCloseOnSelect, disableCloseOnSelect = _b === void 0 ? multiple : _b, _c = props.getOptionLabel, getOptionLabel = _c === void 0 ? defaultGetOptionLabel : _c, id = props.id, _d = props.InputBaseProps, InputBaseProps = _d === void 0 ? {} : _d, _e = props.isOptionEqualToValue, isOptionEqualToValue = _e === void 0 ? defaultIsOptionEqualToValue : _e, _f = props.keepSearchOnSelect, keepSearchOnSelect = _f === void 0 ? true : _f, _g = props.loading, loading = _g === void 0 ? false : _g, _h = props.loadingText, loadingText = _h === void 0 ? "" : _h, _j = props.noOptionsText, noOptionsText = _j === void 0 ? "No options" : _j, _k = props.onInputChange, onInputChange = _k === void 0 ? utils_1.noop : _k, _l = props.open, open = _l === void 0 ? false : _l, _m = props.PaperComponent, PaperComponent = _m === void 0 ? style_1.StyledPaper : _m, _o = props.PopperComponent, PopperComponent = _o === void 0 ? style_1.StyledPopper : _o, _p = props.PopperBaseProps, PopperBaseProps = _p === void 0 ? {} : _p, _q = props.renderOption, renderOption = _q === void 0 ? defaultRenderOption : _q, _r = props.renderTags, renderTags = _r === void 0 ? defaultRenderTags : _r, _s = props.search, search = _s === void 0 ? false : _s, title = props.title, children = props.children, onClickAway = props.onClickAway, ClickAwayListenerProps = props.ClickAwayListenerProps;
|
|
26
|
+
var _t = (0, react_1.useState)(""), inputValue = _t[0], setInputValue = _t[1];
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(PopperComponent, __assign({ id: id, modifiers: [
|
|
28
|
+
{
|
|
29
|
+
name: "offset",
|
|
30
|
+
options: {
|
|
31
|
+
offset: [0, 8],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
], open: open, anchorEl: anchorEl, placement: "bottom-start" }, PopperBaseProps, { children: (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: (0, jsx_runtime_1.jsxs)("div", { children: [title && ((0, jsx_runtime_1.jsx)(style_1.StyledHeaderTitle, { search: search, children: title })), (0, jsx_runtime_1.jsx)(style_1.StyledAutocomplete, __assign({ clearOnBlur: false, disableCloseOnSelect: disableCloseOnSelect, disablePortal: true, renderTags: renderTags, loading: loading, loadingText: loadingText, noOptionsText: noOptionsText, PaperComponent: PaperComponent, renderOption: renderOption, getOptionLabel: getOptionLabel, isOptionEqualToValue: isOptionEqualToValue, inputValue: inputValue, renderInput: function (params) { return ((0, jsx_runtime_1.jsx)(style_1.InputBaseWrapper, { search: search, children: (0, jsx_runtime_1.jsx)(style_1.StyledMenuInputSearch, __assign({ id: "location-search", label: "Search for a location", placeholder: "Search", ref: params.InputProps.ref, search: search,
|
|
35
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
36
|
+
autoFocus: true,
|
|
37
|
+
// (masoudmanson): This prevents Backspace from deselecting selected dropdown options.
|
|
38
|
+
onKeyDown: function (event) {
|
|
39
|
+
if (event.key === "Backspace") {
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
}
|
|
42
|
+
}, InputProps: __assign(__assign({
|
|
43
|
+
/**
|
|
44
|
+
* (thuang): Works with css caret-color: "transparent" to hide
|
|
45
|
+
* mobile keyboard
|
|
46
|
+
*/
|
|
47
|
+
inputMode: search ? "text" : "none" }, params.InputProps.ref), { endAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(ButtonIcon_1.default, { sdsType: "secondary", sdsSize: "small", sdsIcon: "search" }) })), inputProps: params.inputProps }) }, InputBaseProps)) })); } }, props, { onInputChange: function (event, value, reason) {
|
|
48
|
+
if (event && event.type === "blur") {
|
|
49
|
+
setInputValue("");
|
|
50
|
+
}
|
|
51
|
+
else if (reason !== "reset" ||
|
|
52
|
+
(reason === "reset" && !keepSearchOnSelect)) {
|
|
53
|
+
setInputValue(value);
|
|
54
|
+
}
|
|
55
|
+
if (onInputChange)
|
|
56
|
+
onInputChange(event, value, reason);
|
|
57
|
+
} })), children] }) })) })));
|
|
58
|
+
function defaultGetOptionLabel(option) {
|
|
59
|
+
if (typeof option === "object" && "name" in option)
|
|
60
|
+
return option.name;
|
|
61
|
+
return option.toString();
|
|
62
|
+
}
|
|
63
|
+
function defaultIsOptionEqualToValue(option, val) {
|
|
64
|
+
return option.name === val.name;
|
|
65
|
+
}
|
|
66
|
+
function defaultRenderTags() {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function defaultRenderOption(optionProps, option, _a) {
|
|
70
|
+
var selected = _a.selected;
|
|
71
|
+
var MenuItemContent;
|
|
72
|
+
var component = option.component, details = option.details, count = option.count, sdsIcon = option.sdsIcon, sdsIconProps = option.sdsIconProps;
|
|
73
|
+
var label = getOptionLabel(option);
|
|
74
|
+
if (component) {
|
|
75
|
+
MenuItemContent = component;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
MenuItemContent = ((0, jsx_runtime_1.jsxs)(style_1.StyledMenuItemText, { children: [label, details && ((0, jsx_runtime_1.jsx)(style_1.StyledMenuItemDetails, { className: "menuItem-details", children: details }))] }));
|
|
79
|
+
}
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(MenuItem_1.default, __assign({ column: count, disabled: optionProps["aria-disabled"] === true, sdsIcon: sdsIcon, sdsIconProps: sdsIconProps, isMultiSelect: multiple, selected: selected }, optionProps, { children: MenuItemContent })));
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.default = DropdownMenu;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
import { DefaultDropdownMenuOption } from "./index";
|
|
3
|
+
export type DropdownOptionValue<T, Multiple> = Multiple extends undefined | false ? T | undefined : Array<T> | undefined;
|
|
4
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const Default: {
|
|
7
|
+
args: {
|
|
8
|
+
groupBy: ((option: DefaultDropdownMenuOption) => string) | undefined;
|
|
9
|
+
keepSearchOnSelect: boolean;
|
|
10
|
+
multiple: boolean;
|
|
11
|
+
search: boolean;
|
|
12
|
+
title: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const LivePreview: {
|
|
16
|
+
args: {
|
|
17
|
+
keepSearchOnSelect: boolean;
|
|
18
|
+
multiple: boolean;
|
|
19
|
+
search: boolean;
|
|
20
|
+
};
|
|
21
|
+
parameters: {
|
|
22
|
+
snapshot: {
|
|
23
|
+
skip: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
render: (args: Args) => JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
export declare const ScreenshotTest: {
|
|
29
|
+
parameters: {
|
|
30
|
+
axe: {
|
|
31
|
+
timeout: number;
|
|
32
|
+
};
|
|
33
|
+
controls: {
|
|
34
|
+
exclude: string[];
|
|
35
|
+
};
|
|
36
|
+
snapshot: {
|
|
37
|
+
skip: boolean;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
render: (args: Args) => JSX.Element;
|
|
41
|
+
};
|
|
42
|
+
export declare const Test: {
|
|
43
|
+
args: {
|
|
44
|
+
keepSearchOnSelect: boolean;
|
|
45
|
+
multiple: boolean;
|
|
46
|
+
search: boolean;
|
|
47
|
+
title: string;
|
|
48
|
+
};
|
|
49
|
+
parameters: {
|
|
50
|
+
snapshot: {
|
|
51
|
+
skip: boolean;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
render: (args: Args) => JSX.Element;
|
|
55
|
+
};
|