@czi-sds/components 15.1.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.d.ts +89 -200
- package/dist/index.cjs.js +1383 -1413
- package/dist/index.esm.d.ts +89 -200
- package/dist/index.esm.js +1372 -1393
- package/dist/src/common/helpers/scrollStop.d.ts +8 -0
- package/dist/src/common/helpers/scrollStop.js +54 -0
- package/dist/src/common/storybookConstants.d.ts +3 -0
- package/dist/src/common/storybookConstants.js +2 -0
- package/dist/src/common/utils.d.ts +2 -0
- package/dist/src/common/utils.js +9 -0
- package/dist/src/common/warnings.d.ts +10 -0
- package/dist/src/common/warnings.js +60 -0
- package/dist/src/common/warnings.test.d.ts +1 -0
- package/dist/src/common/warnings.test.js +19 -0
- package/dist/src/core/Accordion/Accordion.namespace-test.d.ts +1 -0
- package/dist/src/core/Accordion/Accordion.namespace-test.js +18 -0
- package/dist/src/core/Accordion/__snapshots__/index.test.js.snap +64 -0
- package/dist/src/core/Accordion/components/AccordionDetails/index.d.ts +3 -0
- package/dist/src/core/Accordion/components/AccordionDetails/index.js +9 -0
- package/dist/src/core/Accordion/components/AccordionDetails/style.d.ts +2 -0
- package/dist/src/core/Accordion/components/AccordionDetails/style.js +16 -0
- package/dist/src/core/Accordion/components/AccordionHeader/index.d.ts +7 -0
- package/dist/src/core/Accordion/components/AccordionHeader/index.js +13 -0
- package/dist/src/core/Accordion/components/AccordionHeader/style.d.ts +27 -0
- package/dist/src/core/Accordion/components/AccordionHeader/style.js +21 -0
- package/dist/src/core/Accordion/index.d.ts +12 -0
- package/dist/src/core/Accordion/index.js +38 -0
- package/dist/src/core/Accordion/index.stories.d.ts +28 -0
- package/dist/src/core/Accordion/index.stories.js +82 -0
- package/dist/src/core/Accordion/index.test.d.ts +1 -0
- package/dist/src/core/Accordion/index.test.js +58 -0
- package/dist/src/core/Accordion/style.d.ts +30 -0
- package/dist/src/core/Accordion/style.js +28 -0
- package/dist/src/core/Alert/index.d.ts +7 -0
- package/dist/src/core/Alert/index.js +22 -0
- package/dist/src/core/Alert/index.stories.d.ts +19 -0
- package/dist/src/core/Alert/index.stories.js +70 -0
- package/dist/src/core/Alert/style.d.ts +1 -0
- package/dist/src/core/Alert/style.js +23 -0
- package/dist/src/core/Banner/Banner.namespace-test.d.ts +1 -0
- package/dist/src/core/Banner/Banner.namespace-test.js +18 -0
- package/dist/src/core/Banner/banner.test.d.ts +1 -0
- package/dist/src/core/Banner/banner.test.js +126 -0
- package/dist/src/core/Banner/index.d.ts +11 -0
- package/dist/src/core/Banner/index.js +47 -0
- package/dist/src/core/Banner/index.stories.d.ts +46 -0
- package/dist/src/core/Banner/index.stories.js +106 -0
- package/dist/src/core/Banner/style.d.ts +13 -0
- package/dist/src/core/Banner/style.js +55 -0
- package/dist/src/core/Button/Button.namespace-test.d.ts +1 -0
- package/dist/src/core/Button/Button.namespace-test.js +18 -0
- package/dist/src/core/Button/index.d.ts +18 -0
- package/dist/src/core/Button/index.js +54 -0
- package/dist/src/core/Button/index.stories.d.ts +72 -0
- package/dist/src/core/Button/index.stories.js +215 -0
- package/dist/src/core/Button/index.test.d.ts +1 -0
- package/dist/src/core/Button/index.test.js +40 -0
- package/dist/src/core/Button/style.d.ts +180 -0
- package/dist/src/core/Button/style.js +59 -0
- package/dist/src/core/ButtonDropdown/ButtonDropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/ButtonDropdown/ButtonDropdown.namespace-test.js +18 -0
- package/dist/src/core/ButtonDropdown/index.d.ts +18 -0
- package/dist/src/core/ButtonDropdown/index.js +30 -0
- package/dist/src/core/ButtonDropdown/index.stories.d.ts +35 -0
- package/dist/src/core/ButtonDropdown/index.stories.js +79 -0
- package/dist/src/core/ButtonDropdown/index.test.d.ts +1 -0
- package/dist/src/core/ButtonDropdown/index.test.js +41 -0
- package/dist/src/core/ButtonIcon/ButtonIcon.namespace-test.d.ts +1 -0
- package/dist/src/core/ButtonIcon/ButtonIcon.namespace-test.js +18 -0
- package/dist/src/core/ButtonIcon/index.d.ts +15 -0
- package/dist/src/core/ButtonIcon/index.js +34 -0
- package/dist/src/core/ButtonIcon/index.stories.d.ts +39 -0
- package/dist/src/core/ButtonIcon/index.stories.js +239 -0
- package/dist/src/core/ButtonIcon/index.test.d.ts +1 -0
- package/dist/src/core/ButtonIcon/index.test.js +41 -0
- package/dist/src/core/ButtonIcon/style.d.ts +41 -0
- package/dist/src/core/ButtonIcon/style.js +68 -0
- package/dist/src/core/Callout/Callout.namespace-test.d.ts +1 -0
- package/dist/src/core/Callout/Callout.namespace-test.js +18 -0
- package/dist/src/core/Callout/components/CalloutTitle/index.d.ts +3 -0
- package/dist/src/core/Callout/components/CalloutTitle/index.js +9 -0
- package/dist/src/core/Callout/components/CalloutTitle/style.d.ts +1 -0
- package/dist/src/core/Callout/components/CalloutTitle/style.js +16 -0
- package/dist/src/core/Callout/index.d.ts +18 -0
- package/dist/src/core/Callout/index.js +89 -0
- package/dist/src/core/Callout/index.stories.d.ts +14 -0
- package/dist/src/core/Callout/index.stories.js +80 -0
- package/dist/src/core/Callout/style.d.ts +7 -0
- package/dist/src/core/Callout/style.js +31 -0
- package/dist/src/core/CellBasic/CellBasic.namespace-test.d.ts +1 -0
- package/dist/src/core/CellBasic/CellBasic.namespace-test.js +7 -0
- package/dist/src/core/CellBasic/index.d.ts +21 -0
- package/dist/src/core/CellBasic/index.js +32 -0
- package/dist/src/core/CellBasic/index.stories.d.ts +33 -0
- package/dist/src/core/CellBasic/index.stories.js +143 -0
- package/dist/src/core/CellBasic/index.test.d.ts +1 -0
- package/dist/src/core/CellBasic/index.test.js +124 -0
- package/dist/src/core/CellBasic/style.d.ts +18 -0
- package/dist/src/core/CellBasic/style.js +86 -0
- package/dist/src/core/CellComponent/CellComponent.namespace-test.d.ts +1 -0
- package/dist/src/core/CellComponent/CellComponent.namespace-test.js +7 -0
- package/dist/src/core/CellComponent/index.d.ts +8 -0
- package/dist/src/core/CellComponent/index.js +21 -0
- package/dist/src/core/CellComponent/index.stories.d.ts +21 -0
- package/dist/src/core/CellComponent/index.stories.js +92 -0
- package/dist/src/core/CellComponent/index.test.d.ts +1 -0
- package/dist/src/core/CellComponent/index.test.js +110 -0
- package/dist/src/core/CellComponent/style.d.ts +9 -0
- package/dist/src/core/CellComponent/style.js +32 -0
- package/dist/src/core/CellHeader/CellHeader.namespace-test.d.ts +1 -0
- package/dist/src/core/CellHeader/CellHeader.namespace-test.js +8 -0
- package/dist/src/core/CellHeader/index.d.ts +20 -0
- package/dist/src/core/CellHeader/index.js +47 -0
- package/dist/src/core/CellHeader/index.stories.d.ts +26 -0
- package/dist/src/core/CellHeader/index.stories.js +128 -0
- package/dist/src/core/CellHeader/index.test.d.ts +1 -0
- package/dist/src/core/CellHeader/index.test.js +112 -0
- package/dist/src/core/CellHeader/style.d.ts +9 -0
- package/dist/src/core/CellHeader/style.js +50 -0
- package/dist/src/core/Chip/index.d.ts +9 -0
- package/dist/src/core/Chip/index.js +29 -0
- package/dist/src/core/Chip/index.stories.d.ts +58 -0
- package/dist/src/core/Chip/index.stories.js +90 -0
- package/dist/src/core/Chip/style.d.ts +26 -0
- package/dist/src/core/Chip/style.js +95 -0
- package/dist/src/core/ComplexFilter/ComplexFilter.namespace-test.d.ts +1 -0
- package/dist/src/core/ComplexFilter/ComplexFilter.namespace-test.js +20 -0
- package/dist/src/core/ComplexFilter/components/Chips/index.d.ts +8 -0
- package/dist/src/core/ComplexFilter/components/Chips/index.js +21 -0
- package/dist/src/core/ComplexFilter/index.d.ts +23 -0
- package/dist/src/core/ComplexFilter/index.js +119 -0
- package/dist/src/core/ComplexFilter/index.stories.d.ts +33 -0
- package/dist/src/core/ComplexFilter/index.stories.js +126 -0
- package/dist/src/core/ComplexFilter/index.test.d.ts +1 -0
- package/dist/src/core/ComplexFilter/index.test.js +51 -0
- package/dist/src/core/ComplexFilter/style.d.ts +3 -0
- package/dist/src/core/ComplexFilter/style.js +15 -0
- package/dist/src/core/Dialog/Dialog.namespace-test.d.ts +1 -0
- package/dist/src/core/Dialog/Dialog.namespace-test.js +8 -0
- package/dist/src/core/Dialog/__snapshots__/index.test.js.snap +382 -0
- package/dist/src/core/Dialog/components/common.d.ts +6 -0
- package/dist/src/core/Dialog/components/common.js +5 -0
- package/dist/src/core/Dialog/index.d.ts +18 -0
- package/dist/src/core/Dialog/index.js +50 -0
- package/dist/src/core/Dialog/index.stories.d.ts +46 -0
- package/dist/src/core/Dialog/index.stories.js +147 -0
- package/dist/src/core/Dialog/index.test.d.ts +1 -0
- package/dist/src/core/Dialog/index.test.js +62 -0
- package/dist/src/core/DialogActions/index.d.ts +9 -0
- package/dist/src/core/DialogActions/index.js +23 -0
- package/dist/src/core/DialogActions/style.d.ts +5 -0
- package/dist/src/core/DialogActions/style.js +20 -0
- package/dist/src/core/DialogContent/index.d.ts +5 -0
- package/dist/src/core/DialogContent/index.js +23 -0
- package/dist/src/core/DialogContent/style.d.ts +1 -0
- package/dist/src/core/DialogContent/style.js +11 -0
- package/dist/src/core/DialogPaper/index.d.ts +8 -0
- package/dist/src/core/DialogPaper/index.js +27 -0
- package/dist/src/core/DialogPaper/style.d.ts +16 -0
- package/dist/src/core/DialogPaper/style.js +44 -0
- package/dist/src/core/DialogTitle/components/CloseButton/index.d.ts +5 -0
- package/dist/src/core/DialogTitle/components/CloseButton/index.js +31 -0
- package/dist/src/core/DialogTitle/components/CloseButton/style.d.ts +2 -0
- package/dist/src/core/DialogTitle/components/CloseButton/style.js +18 -0
- package/dist/src/core/DialogTitle/index.d.ts +14 -0
- package/dist/src/core/DialogTitle/index.js +42 -0
- package/dist/src/core/DialogTitle/style.d.ts +46 -0
- package/dist/src/core/DialogTitle/style.js +20 -0
- package/dist/src/core/Dropdown/Dropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/Dropdown/Dropdown.namespace-test.js +20 -0
- package/dist/src/core/Dropdown/index.d.ts +31 -0
- package/dist/src/core/Dropdown/index.js +160 -0
- package/dist/src/core/Dropdown/index.stories.d.ts +68 -0
- package/dist/src/core/Dropdown/index.stories.js +215 -0
- package/dist/src/core/Dropdown/index.test.d.ts +1 -0
- package/dist/src/core/Dropdown/index.test.js +229 -0
- package/dist/src/core/Dropdown/style.d.ts +5 -0
- package/dist/src/core/Dropdown/style.js +19 -0
- package/dist/src/core/DropdownMenu/DropdownMenu.namespace-test.d.ts +1 -0
- package/dist/src/core/DropdownMenu/DropdownMenu.namespace-test.js +20 -0
- package/dist/src/core/DropdownMenu/GITHUB_LABELS.d.ts +2 -0
- package/dist/src/core/DropdownMenu/GITHUB_LABELS.js +83 -0
- package/dist/src/core/DropdownMenu/index.d.ts +42 -0
- package/dist/src/core/DropdownMenu/index.js +83 -0
- package/dist/src/core/DropdownMenu/index.stories.d.ts +55 -0
- package/dist/src/core/DropdownMenu/index.stories.js +438 -0
- package/dist/src/core/DropdownMenu/index.test.d.ts +1 -0
- package/dist/src/core/DropdownMenu/index.test.js +51 -0
- package/dist/src/core/DropdownMenu/style.d.ts +40 -0
- package/dist/src/core/DropdownMenu/style.js +85 -0
- package/dist/src/core/Icon/Icon.namespace-test.d.ts +1 -0
- package/dist/src/core/Icon/Icon.namespace-test.js +7 -0
- package/dist/src/core/Icon/index.d.ts +14 -0
- package/dist/src/core/Icon/index.js +25 -0
- package/dist/src/core/Icon/index.stories.d.ts +34 -0
- package/dist/src/core/Icon/index.stories.js +171 -0
- package/dist/src/core/Icon/map.d.ts +98 -0
- package/dist/src/core/Icon/map.js +476 -0
- package/dist/src/core/Icon/style.d.ts +36 -0
- package/dist/src/core/Icon/style.js +42 -0
- package/dist/src/core/InputCheckbox/InputCheckbox.namespace-test.d.ts +1 -0
- package/dist/src/core/InputCheckbox/InputCheckbox.namespace-test.js +9 -0
- package/dist/src/core/InputCheckbox/index.d.ts +13 -0
- package/dist/src/core/InputCheckbox/index.js +55 -0
- package/dist/src/core/InputCheckbox/index.stories.d.ts +35 -0
- package/dist/src/core/InputCheckbox/index.stories.js +119 -0
- package/dist/src/core/InputCheckbox/index.test.d.ts +1 -0
- package/dist/src/core/InputCheckbox/index.test.js +62 -0
- package/dist/src/core/InputCheckbox/styles.d.ts +6 -0
- package/dist/src/core/InputCheckbox/styles.js +24 -0
- package/dist/src/core/InputDropdown/InputDropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/InputDropdown/InputDropdown.namespace-test.js +8 -0
- package/dist/src/core/InputDropdown/index.d.ts +8 -0
- package/dist/src/core/InputDropdown/index.js +83 -0
- package/dist/src/core/InputDropdown/index.stories.d.ts +59 -0
- package/dist/src/core/InputDropdown/index.stories.js +264 -0
- package/dist/src/core/InputDropdown/index.test.d.ts +1 -0
- package/dist/src/core/InputDropdown/index.test.js +58 -0
- package/dist/src/core/InputDropdown/style.d.ts +38 -0
- package/dist/src/core/InputDropdown/style.js +130 -0
- package/dist/src/core/InputRadio/InputRadio.namespace-test.d.ts +1 -0
- package/dist/src/core/InputRadio/InputRadio.namespace-test.js +8 -0
- package/dist/src/core/InputRadio/index.d.ts +14 -0
- package/dist/src/core/InputRadio/index.js +40 -0
- package/dist/src/core/InputRadio/index.stories.d.ts +32 -0
- package/dist/src/core/InputRadio/index.stories.js +64 -0
- package/dist/src/core/InputRadio/index.test.d.ts +1 -0
- package/dist/src/core/InputRadio/index.test.js +92 -0
- package/dist/src/core/InputRadio/style.d.ts +6 -0
- package/dist/src/core/InputRadio/style.js +24 -0
- package/dist/src/core/InputSearch/InputSearch.namespace-test.d.ts +1 -0
- package/dist/src/core/InputSearch/InputSearch.namespace-test.js +8 -0
- package/dist/src/core/InputSearch/index.d.ts +16 -0
- package/dist/src/core/InputSearch/index.js +75 -0
- package/dist/src/core/InputSearch/index.stories.d.ts +35 -0
- package/dist/src/core/InputSearch/index.stories.js +104 -0
- package/dist/src/core/InputSearch/index.test.d.ts +1 -0
- package/dist/src/core/InputSearch/index.test.js +70 -0
- package/dist/src/core/InputSearch/style.d.ts +12 -0
- package/dist/src/core/InputSearch/style.js +47 -0
- package/dist/src/core/InputSlider/InputSlider.namespace-test.d.ts +1 -0
- package/dist/src/core/InputSlider/InputSlider.namespace-test.js +7 -0
- package/dist/src/core/InputSlider/__snapshots__/index.test.js.snap +124 -0
- package/dist/src/core/InputSlider/index.d.ts +8 -0
- package/dist/src/core/InputSlider/index.js +23 -0
- package/dist/src/core/InputSlider/index.stories.d.ts +43 -0
- package/dist/src/core/InputSlider/index.stories.js +160 -0
- package/dist/src/core/InputSlider/index.test.d.ts +1 -0
- package/dist/src/core/InputSlider/index.test.js +52 -0
- package/dist/src/core/InputSlider/style.d.ts +76 -0
- package/dist/src/core/InputSlider/style.js +34 -0
- package/dist/src/core/InputText/InputText.namespace-test.d.ts +1 -0
- package/dist/src/core/InputText/InputText.namespace-test.js +7 -0
- package/dist/src/core/InputText/__snapshots__/index.test.js.snap +10 -0
- package/dist/src/core/InputText/index.d.ts +14 -0
- package/dist/src/core/InputText/index.js +52 -0
- package/dist/src/core/InputText/index.stories.d.ts +29 -0
- package/dist/src/core/InputText/index.stories.js +100 -0
- package/dist/src/core/InputText/index.test.d.ts +1 -0
- package/dist/src/core/InputText/index.test.js +67 -0
- package/dist/src/core/InputText/style.d.ts +13 -0
- package/dist/src/core/InputText/style.js +45 -0
- package/dist/src/core/InputToggle/InputToggle.namespace-test.d.ts +1 -0
- package/dist/src/core/InputToggle/InputToggle.namespace-test.js +7 -0
- package/dist/src/core/InputToggle/__snapshots__/index.test.js.snap +26 -0
- package/dist/src/core/InputToggle/index.d.ts +7 -0
- package/dist/src/core/InputToggle/index.js +42 -0
- package/dist/src/core/InputToggle/index.stories.d.ts +20 -0
- package/dist/src/core/InputToggle/index.stories.js +63 -0
- package/dist/src/core/InputToggle/index.test.d.ts +1 -0
- package/dist/src/core/InputToggle/index.test.js +52 -0
- package/dist/src/core/InputToggle/style.d.ts +9 -0
- package/dist/src/core/InputToggle/style.js +38 -0
- package/dist/src/core/Link/Link.namespace-test.d.ts +1 -0
- package/dist/src/core/Link/Link.namespace-test.js +7 -0
- package/dist/src/core/Link/index.d.ts +8 -0
- package/dist/src/core/Link/index.js +28 -0
- package/dist/src/core/Link/index.stories.d.ts +27 -0
- package/dist/src/core/Link/index.stories.js +99 -0
- package/dist/src/core/Link/style.d.ts +9 -0
- package/dist/src/core/Link/style.js +30 -0
- package/dist/src/core/List/List.namespace-test.d.ts +1 -0
- package/dist/src/core/List/List.namespace-test.js +7 -0
- package/dist/src/core/List/index.d.ts +8 -0
- package/dist/src/core/List/index.js +23 -0
- package/dist/src/core/List/index.stories.d.ts +4 -0
- package/dist/src/core/List/index.stories.js +30 -0
- package/dist/src/core/List/style.d.ts +17 -0
- package/dist/src/core/List/style.js +33 -0
- package/dist/src/core/ListItem/ListItem.namespace-test.d.ts +1 -0
- package/dist/src/core/ListItem/ListItem.namespace-test.js +7 -0
- package/dist/src/core/ListItem/index.d.ts +9 -0
- package/dist/src/core/ListItem/index.js +24 -0
- package/dist/src/core/ListItem/style.d.ts +26 -0
- package/dist/src/core/ListItem/style.js +56 -0
- package/dist/src/core/ListSubheader/ListSubheader.namespace-test.d.ts +1 -0
- package/dist/src/core/ListSubheader/ListSubheader.namespace-test.js +7 -0
- package/dist/src/core/ListSubheader/index.d.ts +7 -0
- package/dist/src/core/ListSubheader/index.js +22 -0
- package/dist/src/core/ListSubheader/style.d.ts +12 -0
- package/dist/src/core/ListSubheader/style.js +16 -0
- package/dist/src/core/LoadingIndicator/LoadingIndicator.namespace-test.d.ts +1 -0
- package/dist/src/core/LoadingIndicator/LoadingIndicator.namespace-test.js +7 -0
- package/dist/src/core/LoadingIndicator/index.d.ts +4 -0
- package/dist/src/core/LoadingIndicator/index.js +13 -0
- package/dist/src/core/LoadingIndicator/index.stories.d.ts +24 -0
- package/dist/src/core/LoadingIndicator/index.stories.js +77 -0
- package/dist/src/core/LoadingIndicator/index.test.d.ts +1 -0
- package/dist/src/core/LoadingIndicator/index.test.js +41 -0
- package/dist/src/core/LoadingIndicator/style.d.ts +7 -0
- package/dist/src/core/LoadingIndicator/style.js +36 -0
- package/dist/src/core/Menu/Menu.namespace-test.d.ts +1 -0
- package/dist/src/core/Menu/Menu.namespace-test.js +8 -0
- package/dist/src/core/Menu/index.d.ts +7 -0
- package/dist/src/core/Menu/index.js +30 -0
- package/dist/src/core/Menu/index.stories.d.ts +17 -0
- package/dist/src/core/Menu/index.stories.js +55 -0
- package/dist/src/core/Menu/style.d.ts +1 -0
- package/dist/src/core/Menu/style.js +15 -0
- package/dist/src/core/MenuItem/MenuItem.namespace-test.d.ts +1 -0
- package/dist/src/core/MenuItem/MenuItem.namespace-test.js +8 -0
- package/dist/src/core/MenuItem/index.d.ts +21 -0
- package/dist/src/core/MenuItem/index.js +42 -0
- package/dist/src/core/MenuItem/index.stories.d.ts +35 -0
- package/dist/src/core/MenuItem/index.stories.js +188 -0
- package/dist/src/core/MenuItem/index.test.d.ts +1 -0
- package/dist/src/core/MenuItem/index.test.js +41 -0
- package/dist/src/core/MenuItem/style.d.ts +65 -0
- package/dist/src/core/MenuItem/style.js +58 -0
- package/dist/src/core/MenuSelect/index.d.ts +19 -0
- package/dist/src/core/MenuSelect/index.js +70 -0
- package/dist/src/core/MenuSelect/index.stories.d.ts +34 -0
- package/dist/src/core/MenuSelect/index.stories.js +154 -0
- package/dist/src/core/MenuSelect/style.d.ts +12 -0
- package/dist/src/core/MenuSelect/style.js +45 -0
- package/dist/src/core/NavigationJumpTo/NavigationJumpTo.namespace-test.d.ts +1 -0
- package/dist/src/core/NavigationJumpTo/NavigationJumpTo.namespace-test.js +13 -0
- package/dist/src/core/NavigationJumpTo/__snapshots__/index.test.js.snap +319 -0
- package/dist/src/core/NavigationJumpTo/index.d.ts +13 -0
- package/dist/src/core/NavigationJumpTo/index.js +111 -0
- package/dist/src/core/NavigationJumpTo/index.stories.d.ts +56 -0
- package/dist/src/core/NavigationJumpTo/index.stories.js +216 -0
- package/dist/src/core/NavigationJumpTo/index.test.d.ts +1 -0
- package/dist/src/core/NavigationJumpTo/index.test.js +87 -0
- package/dist/src/core/NavigationJumpTo/style.d.ts +106 -0
- package/dist/src/core/NavigationJumpTo/style.js +27 -0
- package/dist/src/core/NavigationJumpTo/useIntersection.d.ts +19 -0
- package/dist/src/core/NavigationJumpTo/useIntersection.js +67 -0
- package/dist/src/core/Notification/Notification.namespace-test.d.ts +1 -0
- package/dist/src/core/Notification/Notification.namespace-test.js +8 -0
- package/dist/src/core/Notification/index.d.ts +17 -0
- package/dist/src/core/Notification/index.js +70 -0
- package/dist/src/core/Notification/index.stories.d.ts +43 -0
- package/dist/src/core/Notification/index.stories.js +186 -0
- package/dist/src/core/Notification/index.test.d.ts +1 -0
- package/dist/src/core/Notification/index.test.js +115 -0
- package/dist/src/core/Notification/style.d.ts +1 -0
- package/dist/src/core/Notification/style.js +26 -0
- package/dist/src/core/Pagination/Pagination.namespace-test.d.ts +1 -0
- package/dist/src/core/Pagination/Pagination.namespace-test.js +8 -0
- package/dist/src/core/Pagination/components/PageListDropdown/index.d.ts +7 -0
- package/dist/src/core/Pagination/components/PageListDropdown/index.js +27 -0
- package/dist/src/core/Pagination/components/PageListDropdown/style.d.ts +1 -0
- package/dist/src/core/Pagination/components/PageListDropdown/style.js +14 -0
- package/dist/src/core/Pagination/index.d.ts +15 -0
- package/dist/src/core/Pagination/index.js +47 -0
- package/dist/src/core/Pagination/index.stories.d.ts +21 -0
- package/dist/src/core/Pagination/index.stories.js +99 -0
- package/dist/src/core/Pagination/index.test.d.ts +1 -0
- package/dist/src/core/Pagination/index.test.js +128 -0
- package/dist/src/core/Pagination/style.d.ts +13 -0
- package/dist/src/core/Pagination/style.js +62 -0
- package/dist/src/core/Pagination/usePagination.d.ts +9 -0
- package/dist/src/core/Pagination/usePagination.js +69 -0
- package/dist/src/core/SegmentedControl/SegmentedControl.namespace-test.d.ts +1 -0
- package/dist/src/core/SegmentedControl/SegmentedControl.namespace-test.js +12 -0
- package/dist/src/core/SegmentedControl/index.d.ts +15 -0
- package/dist/src/core/SegmentedControl/index.js +38 -0
- package/dist/src/core/SegmentedControl/index.stories.d.ts +49 -0
- package/dist/src/core/SegmentedControl/index.stories.js +128 -0
- package/dist/src/core/SegmentedControl/index.test.d.ts +1 -0
- package/dist/src/core/SegmentedControl/index.test.js +41 -0
- package/dist/src/core/SegmentedControl/style.d.ts +2 -0
- package/dist/src/core/SegmentedControl/style.js +23 -0
- package/dist/src/core/Table/Table.namespace-test.d.ts +1 -0
- package/dist/src/core/Table/Table.namespace-test.js +7 -0
- package/dist/src/core/Table/components/common.d.ts +6 -0
- package/dist/src/core/Table/components/common.js +5 -0
- package/dist/src/core/Table/index.d.ts +7 -0
- package/dist/src/core/Table/index.js +21 -0
- package/dist/src/core/Table/index.stories.d.ts +18 -0
- package/dist/src/core/Table/index.stories.js +64 -0
- package/dist/src/core/Table/index.test.d.ts +1 -0
- package/dist/src/core/Table/index.test.js +89 -0
- package/dist/src/core/Table/style.d.ts +2 -0
- package/dist/src/core/Table/style.js +10 -0
- package/dist/src/core/TableHeader/TableHeader.namespace-test.d.ts +1 -0
- package/dist/src/core/TableHeader/TableHeader.namespace-test.js +7 -0
- package/dist/src/core/TableHeader/index.d.ts +6 -0
- package/dist/src/core/TableHeader/index.js +25 -0
- package/dist/src/core/TableHeader/index.stories.d.ts +12 -0
- package/dist/src/core/TableHeader/index.stories.js +38 -0
- package/dist/src/core/TableHeader/index.test.d.ts +1 -0
- package/dist/src/core/TableHeader/index.test.js +41 -0
- package/dist/src/core/TableHeader/style.d.ts +2 -0
- package/dist/src/core/TableHeader/style.js +14 -0
- package/dist/src/core/TableRow/TableRow.namespace-test.d.ts +1 -0
- package/dist/src/core/TableRow/TableRow.namespace-test.js +7 -0
- package/dist/src/core/TableRow/__snapshots__/index.test.js.snap +100 -0
- package/dist/src/core/TableRow/index.d.ts +13 -0
- package/dist/src/core/TableRow/index.js +28 -0
- package/dist/src/core/TableRow/index.stories.d.ts +24 -0
- package/dist/src/core/TableRow/index.stories.js +77 -0
- package/dist/src/core/TableRow/index.test.d.ts +1 -0
- package/dist/src/core/TableRow/index.test.js +92 -0
- package/dist/src/core/TableRow/style.d.ts +10 -0
- package/dist/src/core/TableRow/style.js +34 -0
- package/dist/src/core/Tabs/Tabs.namespace-test.d.ts +1 -0
- package/dist/src/core/Tabs/Tabs.namespace-test.js +8 -0
- package/dist/src/core/Tabs/__snapshots__/index.test.js.snap +46 -0
- package/dist/src/core/Tabs/components/LabelWithCount/index.d.ts +7 -0
- package/dist/src/core/Tabs/components/LabelWithCount/index.js +11 -0
- package/dist/src/core/Tabs/components/LabelWithCount/style.d.ts +10 -0
- package/dist/src/core/Tabs/components/LabelWithCount/style.js +43 -0
- package/dist/src/core/Tabs/components/common.d.ts +5 -0
- package/dist/src/core/Tabs/components/common.js +5 -0
- package/dist/src/core/Tabs/index.d.ts +13 -0
- package/dist/src/core/Tabs/index.js +89 -0
- package/dist/src/core/Tabs/index.stories.d.ts +38 -0
- package/dist/src/core/Tabs/index.stories.js +154 -0
- package/dist/src/core/Tabs/index.test.d.ts +1 -0
- package/dist/src/core/Tabs/index.test.js +48 -0
- package/dist/src/core/Tabs/style.d.ts +115 -0
- package/dist/src/core/Tabs/style.js +53 -0
- package/dist/src/core/Tag/Tag.namespace-test.d.ts +1 -0
- package/dist/src/core/Tag/Tag.namespace-test.js +7 -0
- package/dist/src/core/Tag/index.d.ts +17 -0
- package/dist/src/core/Tag/index.js +27 -0
- package/dist/src/core/Tag/index.stories.d.ts +98 -0
- package/dist/src/core/Tag/index.stories.js +238 -0
- package/dist/src/core/Tag/index.test.d.ts +1 -0
- package/dist/src/core/Tag/index.test.js +40 -0
- package/dist/src/core/Tag/index.testUtils.d.ts +8 -0
- package/dist/src/core/Tag/index.testUtils.js +108 -0
- package/dist/src/core/Tag/style.d.ts +29 -0
- package/dist/src/core/Tag/style.js +100 -0
- package/dist/src/core/TagFilter/TagFilter.namespace-test.d.ts +1 -0
- package/dist/src/core/TagFilter/TagFilter.namespace-test.js +8 -0
- package/dist/src/core/TagFilter/__snapshots__/index.test.js.snap +46 -0
- package/dist/src/core/TagFilter/index.d.ts +12 -0
- package/dist/src/core/TagFilter/index.js +23 -0
- package/dist/src/core/TagFilter/index.stories.d.ts +44 -0
- package/dist/src/core/TagFilter/index.stories.js +121 -0
- package/dist/src/core/TagFilter/index.test.d.ts +1 -0
- package/dist/src/core/TagFilter/index.test.js +40 -0
- package/dist/src/core/TagFilter/style.d.ts +7 -0
- package/dist/src/core/TagFilter/style.js +19 -0
- package/dist/src/core/Tooltip/Tooltip.namespace-test.d.ts +1 -0
- package/dist/src/core/Tooltip/Tooltip.namespace-test.js +7 -0
- package/dist/src/core/Tooltip/index.d.ts +14 -0
- package/dist/src/core/Tooltip/index.js +87 -0
- package/dist/src/core/Tooltip/index.stories.d.ts +48 -0
- package/dist/src/core/Tooltip/index.stories.js +257 -0
- package/dist/src/core/Tooltip/index.test.d.ts +1 -0
- package/dist/src/core/Tooltip/index.test.js +102 -0
- package/dist/src/core/Tooltip/style.d.ts +23 -0
- package/dist/src/core/Tooltip/style.js +47 -0
- package/dist/src/core/TooltipCondensed/TooltipCondensed.namespace-test.d.ts +1 -0
- package/dist/src/core/TooltipCondensed/TooltipCondensed.namespace-test.js +7 -0
- package/dist/src/core/TooltipCondensed/index.d.ts +13 -0
- package/dist/src/core/TooltipCondensed/index.js +43 -0
- package/dist/src/core/TooltipCondensed/index.stories.d.ts +27 -0
- package/dist/src/core/TooltipCondensed/index.stories.js +72 -0
- package/dist/src/core/TooltipCondensed/index.test.d.ts +1 -0
- package/dist/src/core/TooltipCondensed/index.test.js +85 -0
- package/dist/src/core/TooltipCondensed/style.d.ts +6 -0
- package/dist/src/core/TooltipCondensed/style.js +22 -0
- package/dist/src/core/TooltipTable/TooltipTable.namespace-test.d.ts +1 -0
- package/dist/src/core/TooltipTable/TooltipTable.namespace-test.js +23 -0
- package/dist/src/core/TooltipTable/__snapshots__/index.test.js.snap +272 -0
- package/dist/src/core/TooltipTable/index.d.ts +8 -0
- package/dist/src/core/TooltipTable/index.js +35 -0
- package/dist/src/core/TooltipTable/index.stories.d.ts +32 -0
- package/dist/src/core/TooltipTable/index.stories.js +128 -0
- package/dist/src/core/TooltipTable/index.test.d.ts +1 -0
- package/dist/src/core/TooltipTable/index.test.js +109 -0
- package/dist/src/core/TooltipTable/style.d.ts +25 -0
- package/dist/src/core/TooltipTable/style.js +46 -0
- package/dist/src/core/styles/common/constants/black.d.ts +3 -0
- package/dist/src/core/styles/common/constants/black.js +7 -0
- package/dist/src/core/styles/common/constants/boxShadows.d.ts +5 -0
- package/dist/src/core/styles/common/constants/boxShadows.js +9 -0
- package/dist/src/core/styles/common/constants/fontWeights.d.ts +7 -0
- package/dist/src/core/styles/common/constants/fontWeights.js +11 -0
- package/dist/src/core/styles/common/constants/gray.d.ts +8 -0
- package/dist/src/core/styles/common/constants/gray.js +12 -0
- package/dist/src/core/styles/common/constants/spaces.d.ts +11 -0
- package/dist/src/core/styles/common/constants/spaces.js +15 -0
- package/dist/src/core/styles/common/constants/white.d.ts +3 -0
- package/dist/src/core/styles/common/constants/white.js +7 -0
- package/dist/src/core/styles/common/defaultTheme.d.ts +129 -0
- package/dist/src/core/styles/common/defaultTheme.js +414 -0
- package/dist/src/core/styles/common/mixins/fonts.d.ts +27 -0
- package/dist/src/core/styles/common/mixins/fonts.js +60 -0
- package/dist/src/core/styles/common/selectors/theme.d.ts +15 -0
- package/dist/src/core/styles/common/selectors/theme.js +63 -0
- package/dist/src/core/styles/index.d.ts +3 -0
- package/dist/src/core/styles/index.js +19 -0
- package/dist/src/index.d.ts +100 -0
- package/dist/src/index.js +170 -0
- package/dist/tsconfig-namespace-check.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/variables.css +1 -0
- package/package.json +12 -8
|
@@ -0,0 +1,238 @@
|
|
|
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.SuccessWarningScreenshotTest = exports.GrayPrimaryScreenshotTest = exports.ScreenshotTest = exports.LivePreview = exports.Default = void 0;
|
|
18
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
var icons_material_1 = require("@mui/icons-material");
|
|
20
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
21
|
+
var index_1 = __importDefault(require("./index"));
|
|
22
|
+
var index_testUtils_1 = require("./index.testUtils");
|
|
23
|
+
var Tag = function (props) {
|
|
24
|
+
var label = props.label;
|
|
25
|
+
return (0, jsx_runtime_1.jsx)(index_1.default, __assign({ label: label }, props));
|
|
26
|
+
};
|
|
27
|
+
var ICONS = [
|
|
28
|
+
undefined,
|
|
29
|
+
(0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "checkCircle", sdsType: "button" }, "checkCircle"),
|
|
30
|
+
(0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "loading", sdsType: "button" }, "loading"),
|
|
31
|
+
(0, jsx_runtime_1.jsx)(icons_material_1.WbSunny, {}, "WBSunny"),
|
|
32
|
+
(0, jsx_runtime_1.jsx)(icons_material_1.CheckCircleOutline, {}, "CheckCircleOutline"),
|
|
33
|
+
];
|
|
34
|
+
var SDS_STYLES = ["rounded", "square"];
|
|
35
|
+
var PANEL_COLORS = [
|
|
36
|
+
"primary",
|
|
37
|
+
"info",
|
|
38
|
+
"success",
|
|
39
|
+
"warning",
|
|
40
|
+
"error",
|
|
41
|
+
"gray",
|
|
42
|
+
"beta",
|
|
43
|
+
["#000000", "#C65FA7", "#FFD400"],
|
|
44
|
+
];
|
|
45
|
+
// use PANEL_COLORS to generate colors for ScreenshotTest ...
|
|
46
|
+
var colors = PANEL_COLORS.slice(0, 8);
|
|
47
|
+
// ... but for now it can't include "success" or "warning" colors because they fail a11y tests due to known design issues
|
|
48
|
+
colors.splice(2, 2);
|
|
49
|
+
var SDS_TYPES = ["primary", "secondary"];
|
|
50
|
+
exports.default = {
|
|
51
|
+
argTypes: {
|
|
52
|
+
color: {
|
|
53
|
+
control: {
|
|
54
|
+
labels: [
|
|
55
|
+
"primary",
|
|
56
|
+
"info",
|
|
57
|
+
"success",
|
|
58
|
+
"warning",
|
|
59
|
+
"error",
|
|
60
|
+
"gray",
|
|
61
|
+
"beta",
|
|
62
|
+
"Custom colors for Label, Background, Icon",
|
|
63
|
+
],
|
|
64
|
+
type: "select",
|
|
65
|
+
},
|
|
66
|
+
mapping: PANEL_COLORS,
|
|
67
|
+
options: Object.keys(PANEL_COLORS),
|
|
68
|
+
},
|
|
69
|
+
hover: {
|
|
70
|
+
control: { type: "boolean" },
|
|
71
|
+
},
|
|
72
|
+
icon: {
|
|
73
|
+
control: {
|
|
74
|
+
labels: [
|
|
75
|
+
"No Icon",
|
|
76
|
+
"SDS Check Circle",
|
|
77
|
+
"SDS Loading",
|
|
78
|
+
"MUI WbSunny",
|
|
79
|
+
"MUI Check Circle",
|
|
80
|
+
],
|
|
81
|
+
type: "select",
|
|
82
|
+
},
|
|
83
|
+
mapping: ICONS,
|
|
84
|
+
options: Object.keys(ICONS),
|
|
85
|
+
},
|
|
86
|
+
label: {
|
|
87
|
+
control: { type: "text" },
|
|
88
|
+
required: true,
|
|
89
|
+
},
|
|
90
|
+
sdsStyle: {
|
|
91
|
+
control: { type: "radio" },
|
|
92
|
+
options: ["rounded", "square"],
|
|
93
|
+
},
|
|
94
|
+
sdsType: {
|
|
95
|
+
control: { type: "radio" },
|
|
96
|
+
options: ["primary", "secondary"],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
component: Tag,
|
|
100
|
+
title: "Tag",
|
|
101
|
+
};
|
|
102
|
+
// Default
|
|
103
|
+
exports.Default = {
|
|
104
|
+
args: {
|
|
105
|
+
hover: true,
|
|
106
|
+
label: "Label",
|
|
107
|
+
sdsStyle: "square",
|
|
108
|
+
sdsType: "primary",
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
// Live Preview
|
|
112
|
+
var livePreviewStyles = {
|
|
113
|
+
display: "inline-grid",
|
|
114
|
+
gridColumnGap: 24,
|
|
115
|
+
gridRowGap: 24,
|
|
116
|
+
gridTemplateColumns: "repeat(3, auto)",
|
|
117
|
+
gridTemplateRows: "repeat(2, auto)",
|
|
118
|
+
};
|
|
119
|
+
var LivePreviewDemo = function (props) {
|
|
120
|
+
var color = props.color, icon = props.icon, label = props.label;
|
|
121
|
+
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, __assign({}, props, { color: color, icon: undefined, label: label, sdsStyle: "square", sdsType: "primary" })) }), (0, jsx_runtime_1.jsx)("div", { style: { gridArea: "1 / 2 / 2 / 3" }, children: (0, jsx_runtime_1.jsx)(index_1.default, __assign({}, props, { color: color, icon: undefined, label: label, sdsStyle: "square", sdsType: "secondary" })) }), (0, jsx_runtime_1.jsx)("div", { style: { gridArea: "1 / 3 / 2 / 4" }, children: (0, jsx_runtime_1.jsx)(index_1.default, __assign({}, props, { color: color, icon: icon || (0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "checkCircle", sdsType: "button" }), label: label, sdsStyle: "square", sdsType: "secondary" })) }), (0, jsx_runtime_1.jsx)("div", { style: { gridArea: "2 / 1 / 3 / 2" }, children: (0, jsx_runtime_1.jsx)(index_1.default, __assign({}, props, { color: color, icon: undefined, label: label, sdsStyle: "rounded", sdsType: "primary" })) }), (0, jsx_runtime_1.jsx)("div", { style: { gridArea: "2 / 2 / 3 / 3" }, children: (0, jsx_runtime_1.jsx)(index_1.default, __assign({}, props, { color: color, icon: undefined, label: label, sdsStyle: "rounded", sdsType: "secondary" })) }), (0, jsx_runtime_1.jsx)("div", { style: { gridArea: "2 / 3 / 3 / 4" }, children: (0, jsx_runtime_1.jsx)(index_1.default, __assign({}, props, { color: color, icon: icon || (0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "checkCircle", sdsType: "button" }), label: label, sdsStyle: "rounded", sdsType: "secondary" })) })] }));
|
|
122
|
+
};
|
|
123
|
+
exports.LivePreview = {
|
|
124
|
+
args: {
|
|
125
|
+
label: "Label",
|
|
126
|
+
},
|
|
127
|
+
parameters: {
|
|
128
|
+
snapshot: {
|
|
129
|
+
skip: true,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
133
|
+
};
|
|
134
|
+
// Screenshot tests
|
|
135
|
+
var SANS_SERIF_STYLE = { fontFamily: "sans-serif" };
|
|
136
|
+
// Main Screenshot Test
|
|
137
|
+
function ScreenshotTestDemo(props) {
|
|
138
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { style: SANS_SERIF_STYLE, children: "This story currently excludes Tags with both `sdsType` of `primary` and `color` of `gray`, and those with `color` of `success` and `primary`, because they do not pass the a11y tests. They have their own stories wherein the a11y tests are disabled until the a11y tests are updated to accommodate APCA (for gray x primary) or until the Tag colors are updated by design (for success and primary)." }), (0, jsx_runtime_1.jsx)(index_testUtils_1.CommonScreenshotTestDemo, { props: props, colors: colors, types: SDS_TYPES })] }));
|
|
139
|
+
}
|
|
140
|
+
exports.ScreenshotTest = {
|
|
141
|
+
args: {
|
|
142
|
+
color: colors[0],
|
|
143
|
+
hover: index_testUtils_1.HOVER_OPTIONS[0],
|
|
144
|
+
label: "Label",
|
|
145
|
+
sdsStyle: SDS_STYLES[0],
|
|
146
|
+
sdsType: SDS_TYPES[0],
|
|
147
|
+
},
|
|
148
|
+
parameters: {
|
|
149
|
+
axe: {
|
|
150
|
+
timeout: 10 * 1000,
|
|
151
|
+
},
|
|
152
|
+
controls: {
|
|
153
|
+
exclude: ["color", "hover", "label", "sdsStyle", "sdsType", "icon"],
|
|
154
|
+
},
|
|
155
|
+
snapshot: {
|
|
156
|
+
skip: true,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
render: function (props) { return (0, jsx_runtime_1.jsx)(ScreenshotTestDemo, __assign({}, props)); },
|
|
160
|
+
};
|
|
161
|
+
// Gray Primary only
|
|
162
|
+
// Tags with `color` of `gray` and `sdsType` of `primary` have their own story here because they do not currently pass the a11y tests. However, design has manually tested them with APCA, and they are accessible; our tests just do not use APCA yet. In the meantime, the a11y tests are currently disabled for this story, but enabled for the remaining colors in the ScreenshotTest story, so they can be tested properly.
|
|
163
|
+
var GRAY_PRIMARY_COLORS = ["gray"];
|
|
164
|
+
var GRAY_PRIMARY_TYPES = ["primary"];
|
|
165
|
+
function GrayPrimaryScreenshotTestDemo(props) {
|
|
166
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { style: SANS_SERIF_STYLE, children: "Tags with `color` of `gray` and `sdsType` of `primary` have their own story here because they do not currently pass the a11y tests. However, design has manually tested them with APCA, and they are accessible; our tests just do not use APCA yet. In the meantime, the a11y tests are currently disabled for this story, but enabled for the remaining colors in the ScreenshotTest story, so they can be tested properly." }), (0, jsx_runtime_1.jsx)(index_testUtils_1.CommonScreenshotTestDemo, { props: props, colors: GRAY_PRIMARY_COLORS, types: GRAY_PRIMARY_TYPES })] }));
|
|
167
|
+
}
|
|
168
|
+
exports.GrayPrimaryScreenshotTest = {
|
|
169
|
+
args: {
|
|
170
|
+
color: colors[0],
|
|
171
|
+
hover: index_testUtils_1.HOVER_OPTIONS[0],
|
|
172
|
+
label: "Label",
|
|
173
|
+
sdsStyle: SDS_STYLES[0],
|
|
174
|
+
sdsType: SDS_TYPES[0],
|
|
175
|
+
},
|
|
176
|
+
parameters: {
|
|
177
|
+
axe: {
|
|
178
|
+
// `color-contrast` is disabled for this test because design tested it with APCA and determined these colors pass, our test just isn't able to use APCA yet; this color was pulled into its own story so the remaining colors can be tested separately
|
|
179
|
+
disabledRules: ["color-contrast"],
|
|
180
|
+
timeout: 10 * 1000,
|
|
181
|
+
},
|
|
182
|
+
controls: {
|
|
183
|
+
exclude: ["color", "hover", "label", "sdsStyle", "sdsType", "icon"],
|
|
184
|
+
},
|
|
185
|
+
snapshot: {
|
|
186
|
+
skip: true,
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
render: function (props) { return ((0, jsx_runtime_1.jsx)(GrayPrimaryScreenshotTestDemo, __assign({}, props))); },
|
|
190
|
+
};
|
|
191
|
+
// Success + Warning only
|
|
192
|
+
// Tags with `color` of `success` or `warning` have their own story here because they do not currently pass the a11y tests. Design is aware of this and will be updating their colors. In the meantime, the a11y tests are currently disabled for this story, but enabled for the remaining colors in the ScreenshotTest story, so they can be tested properly.
|
|
193
|
+
var SUCCESS_WARNING_PRIMARY_COLORS = [
|
|
194
|
+
"success",
|
|
195
|
+
"warning",
|
|
196
|
+
];
|
|
197
|
+
function SuccessWarningScreenshotTestDemo(props) {
|
|
198
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { style: SANS_SERIF_STYLE, children: "Tags with `color` of `success` or `warning`have their own story here because they do not currently pass the a11y tests. Design is aware of this and will be updating their colors. In the meantime the a11y tests are currently disabled for this story, but enabled for the remaining colors in the ScreenshotTest story, so they can be tested properly." }), (0, jsx_runtime_1.jsx)(index_testUtils_1.CommonScreenshotTestDemo, { props: props, colors: SUCCESS_WARNING_PRIMARY_COLORS, types: SDS_TYPES })] }));
|
|
199
|
+
}
|
|
200
|
+
exports.SuccessWarningScreenshotTest = {
|
|
201
|
+
args: {
|
|
202
|
+
color: colors[0],
|
|
203
|
+
hover: index_testUtils_1.HOVER_OPTIONS[0],
|
|
204
|
+
label: "Label",
|
|
205
|
+
sdsStyle: SDS_STYLES[0],
|
|
206
|
+
sdsType: SDS_TYPES[0],
|
|
207
|
+
},
|
|
208
|
+
parameters: {
|
|
209
|
+
axe: {
|
|
210
|
+
// `color-contrast` is disabled for this test because it is now a known issue and design will work on adjusting the colors so that they pass; these colors were pulled into their own story so the remaining colors can be tested separately
|
|
211
|
+
disabledRules: ["color-contrast"],
|
|
212
|
+
timeout: 10 * 1000,
|
|
213
|
+
},
|
|
214
|
+
controls: {
|
|
215
|
+
exclude: ["color", "hover", "label", "sdsStyle", "sdsType", "icon"],
|
|
216
|
+
},
|
|
217
|
+
snapshot: {
|
|
218
|
+
skip: true,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
render: function (props) { return ((0, jsx_runtime_1.jsx)(SuccessWarningScreenshotTestDemo, __assign({}, props))); },
|
|
222
|
+
};
|
|
223
|
+
// Test
|
|
224
|
+
var TestDemo = function (props) {
|
|
225
|
+
var label = props.label;
|
|
226
|
+
return (0, jsx_runtime_1.jsx)(index_1.default, __assign({ label: label }, props, { "data-testid": "tags" }));
|
|
227
|
+
};
|
|
228
|
+
exports.Test = {
|
|
229
|
+
args: {
|
|
230
|
+
label: "Label",
|
|
231
|
+
},
|
|
232
|
+
parameters: {
|
|
233
|
+
snapshot: {
|
|
234
|
+
skip: true,
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(TestDemo, __assign({}, args)); },
|
|
238
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
var story_utils_1 = require("@chanzuckerberg/story-utils");
|
|
28
|
+
var react_1 = require("@storybook/react");
|
|
29
|
+
var react_2 = require("@testing-library/react");
|
|
30
|
+
var snapshotTestStoryFile = __importStar(require("./index.stories"));
|
|
31
|
+
var index_stories_1 = __importStar(require("./index.stories"));
|
|
32
|
+
var Test = (0, react_1.composeStory)(index_stories_1.Test, index_stories_1.default);
|
|
33
|
+
describe("<Tag />", function () {
|
|
34
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
35
|
+
it("renders Tags component", function () {
|
|
36
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, {}));
|
|
37
|
+
var elements = react_2.screen.getAllByTestId("tags");
|
|
38
|
+
expect(elements.length).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
import { ExtraTagProps } from "./style";
|
|
3
|
+
export declare const HOVER_OPTIONS: boolean[];
|
|
4
|
+
export declare function CommonScreenshotTestDemo({ props, colors, types, }: {
|
|
5
|
+
props: Args;
|
|
6
|
+
colors: ExtraTagProps["tagColor"][];
|
|
7
|
+
types: ExtraTagProps["sdsType"][];
|
|
8
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,108 @@
|
|
|
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.CommonScreenshotTestDemo = exports.HOVER_OPTIONS = void 0;
|
|
18
|
+
var react_1 = require("react");
|
|
19
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
20
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
21
|
+
var index_1 = __importDefault(require("./index"));
|
|
22
|
+
var SDS_STYLES = ["rounded", "square"];
|
|
23
|
+
var DISPLAY_CONTENTS = {
|
|
24
|
+
display: "contents",
|
|
25
|
+
};
|
|
26
|
+
var MID_LABEL = {
|
|
27
|
+
borderStyle: "solid none none none",
|
|
28
|
+
gridColumn: "1 / 6",
|
|
29
|
+
justifySelf: "stretch",
|
|
30
|
+
paddingTop: 10,
|
|
31
|
+
};
|
|
32
|
+
var ICON_OPTIONS = [
|
|
33
|
+
undefined,
|
|
34
|
+
(0, jsx_runtime_1.jsx)(Icon_1.default, { sdsSize: "l", sdsIcon: "checkCircle", sdsType: "button" }, "checkCircle"),
|
|
35
|
+
];
|
|
36
|
+
exports.HOVER_OPTIONS = [true, false];
|
|
37
|
+
function CommonScreenshotTestDemo(_a) {
|
|
38
|
+
var props = _a.props, colors = _a.colors, types = _a.types;
|
|
39
|
+
// loop through all SDS_STYLES
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: SDS_STYLES.map(function (sdsStyle) {
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(TagStyle, { colors: colors, types: types, props: props, sdsStyle: sdsStyle }, sdsStyle));
|
|
42
|
+
}) }));
|
|
43
|
+
}
|
|
44
|
+
exports.CommonScreenshotTestDemo = CommonScreenshotTestDemo;
|
|
45
|
+
// loop through all COLORS + create headers for SDS_STYLES
|
|
46
|
+
function TagStyle(_a) {
|
|
47
|
+
var colors = _a.colors, types = _a.types, sdsStyle = _a.sdsStyle, props = _a.props;
|
|
48
|
+
var LEVEL_STYLE = {
|
|
49
|
+
columnGap: "20px",
|
|
50
|
+
display: "inline-grid",
|
|
51
|
+
fontFamily: "sans-serif",
|
|
52
|
+
marginRight: "50px",
|
|
53
|
+
};
|
|
54
|
+
var LABEL_STYLE = {
|
|
55
|
+
fontSize: "2em",
|
|
56
|
+
gridColumn: "1 / 6",
|
|
57
|
+
marginBottom: 0,
|
|
58
|
+
};
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: LEVEL_STYLE, children: [(0, jsx_runtime_1.jsxs)("p", { style: LABEL_STYLE, children: ["Style: ", (0, jsx_runtime_1.jsx)("b", { children: sdsStyle })] }), colors.map(function (color) {
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(TagColor, { sdsStyle: sdsStyle, color: color, types: types, props: props }, String(color)));
|
|
61
|
+
})] }));
|
|
62
|
+
}
|
|
63
|
+
// loop through all SDS_TYPES + create headers for COLORS
|
|
64
|
+
function TagColor(_a) {
|
|
65
|
+
var sdsStyle = _a.sdsStyle, color = _a.color, types = _a.types, props = _a.props;
|
|
66
|
+
var LABEL_STYLE = __assign(__assign({}, MID_LABEL), { borderWidth: "5px", fontSize: "1.5em", margin: "20px 0 0 0" });
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: DISPLAY_CONTENTS, children: [(0, jsx_runtime_1.jsxs)("p", { style: LABEL_STYLE, children: ["Color: ", (0, jsx_runtime_1.jsx)("b", { children: typeof color === "string" ? color : "custom" })] }), types.map(function (sdsType) {
|
|
68
|
+
// exclude gray primary from rendering in the main ScreenshotTest story (types.includes("secondary")), but allow gray primary to render in GrayPrimaryScreenshotTest story
|
|
69
|
+
return types.includes("secondary") &&
|
|
70
|
+
sdsType === "primary" &&
|
|
71
|
+
color === "gray" ? null : ((0, jsx_runtime_1.jsx)(TagType, { sdsStyle: sdsStyle, color: color, sdsType: sdsType, props: props }, sdsType));
|
|
72
|
+
})] }));
|
|
73
|
+
}
|
|
74
|
+
// loop through all ICON_OPTIONS + create headers for SDS_TYPES
|
|
75
|
+
function TagType(_a) {
|
|
76
|
+
var sdsStyle = _a.sdsStyle, color = _a.color, sdsType = _a.sdsType, props = _a.props;
|
|
77
|
+
var LABEL_STYLE = __assign(__assign({}, MID_LABEL), { borderWidth: "2px", fontSize: "1.17em", margin: "20px 0" });
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: DISPLAY_CONTENTS, children: [(0, jsx_runtime_1.jsxs)("p", { style: LABEL_STYLE, children: ["Type: ", (0, jsx_runtime_1.jsx)("b", { children: sdsType })] }), ICON_OPTIONS.map(function (icon) {
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(TagIcon, { sdsStyle: sdsStyle, color: color, sdsType: sdsType, icon: icon, props: props }, String(icon)));
|
|
80
|
+
})] }));
|
|
81
|
+
}
|
|
82
|
+
// loop through all HOVER_OPTIONS + create headers for ICON_OPTIONS
|
|
83
|
+
function TagIcon(_a) {
|
|
84
|
+
var sdsStyle = _a.sdsStyle, color = _a.color, sdsType = _a.sdsType, icon = _a.icon, props = _a.props;
|
|
85
|
+
var LABEL_STYLE = __assign(__assign({}, MID_LABEL), { alignSelf: "end", borderWidth: "1px", fontSize: "0.83em", margin: "0 0 5px 0" });
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: DISPLAY_CONTENTS, children: [(0, jsx_runtime_1.jsxs)("p", { style: LABEL_STYLE, children: ["Icon: ", (0, jsx_runtime_1.jsx)("b", { children: icon ? "yes" : "no" })] }), exports.HOVER_OPTIONS.map(function (hover) {
|
|
87
|
+
return ((0, react_1.createElement)(TagState, __assign({}, props, { sdsStyle: sdsStyle, color: color, sdsType: sdsType, icon: icon, hover: hover, key: String(hover) })));
|
|
88
|
+
})] }));
|
|
89
|
+
}
|
|
90
|
+
// loop through all PSEUDO_STATES + create headers for HOVER_OPTIONS, PSEUDO_STATES
|
|
91
|
+
function TagState(props) {
|
|
92
|
+
var sdsStyle = props.sdsStyle, color = props.color, sdsType = props.sdsType, icon = props.icon, hover = props.hover;
|
|
93
|
+
var PSEUDO_STATES = ["default", "hover", "active", "focus-visible"];
|
|
94
|
+
var HOVER_LEVEL = {
|
|
95
|
+
display: "contents",
|
|
96
|
+
};
|
|
97
|
+
var STATE_LABEL = {
|
|
98
|
+
fontSize: "0.67em",
|
|
99
|
+
margin: "10px 0",
|
|
100
|
+
};
|
|
101
|
+
var STATE_LEVEL = {
|
|
102
|
+
marginBottom: 10,
|
|
103
|
+
};
|
|
104
|
+
var LABEL = "Label";
|
|
105
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: HOVER_LEVEL, children: PSEUDO_STATES.map(function (state) {
|
|
106
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: STATE_LEVEL, children: (hover === true || (hover === false && state === "default")) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("p", { style: STATE_LABEL, children: [hover ? "State: " : "Hoverable: ", (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("b", { children: hover ? state : "false" })] }), (0, react_1.createElement)(index_1.default, __assign({}, props, { label: LABEL, "data-testid": "tag", sdsStyle: sdsStyle, color: color, sdsType: sdsType, icon: icon, hover: hover, className: hover ? "pseudo-".concat(state) : "pseudo-default", key: state }))] })) }, state));
|
|
107
|
+
}) }));
|
|
108
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CommonThemeProps } from "../styles";
|
|
3
|
+
export type SdsTagColorType = "primary" | "info" | "success" | "warning" | "error" | "gray" | "beta" | [string, string] | [string, string, string];
|
|
4
|
+
export interface ExtraTagProps extends CommonThemeProps {
|
|
5
|
+
hover?: boolean;
|
|
6
|
+
sdsType?: "primary" | "secondary";
|
|
7
|
+
sdsStyle?: "square" | "rounded";
|
|
8
|
+
tagColor?: SdsTagColorType;
|
|
9
|
+
icon?: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
export declare const StyledTag: import("@emotion/styled").StyledComponent<{
|
|
12
|
+
avatar?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
13
|
+
children?: null | undefined;
|
|
14
|
+
classes?: Partial<import("@mui/material").ChipClasses> | undefined;
|
|
15
|
+
clickable?: boolean | undefined;
|
|
16
|
+
color?: import("@mui/types").OverridableStringUnion<"primary" | "secondary" | "default" | "error" | "info" | "success" | "warning", import("@mui/material").ChipPropsColorOverrides> | undefined;
|
|
17
|
+
deleteIcon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
18
|
+
disabled?: boolean | undefined;
|
|
19
|
+
icon?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
20
|
+
label?: import("react").ReactNode;
|
|
21
|
+
onDelete?: ((event: any) => void) | undefined;
|
|
22
|
+
size?: import("@mui/types").OverridableStringUnion<"small" | "medium", import("@mui/material").ChipPropsSizeOverrides> | undefined;
|
|
23
|
+
skipFocusWhenDisabled?: boolean | undefined;
|
|
24
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
25
|
+
tabIndex?: number | undefined;
|
|
26
|
+
variant?: import("@mui/types").OverridableStringUnion<"outlined" | "filled", import("@mui/material").ChipPropsVariantOverrides> | undefined;
|
|
27
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
28
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
29
|
+
}, 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> & ExtraTagProps, {}, {}>;
|
|
@@ -0,0 +1,100 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
7
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
8
|
+
if (ar || !(i in from)) {
|
|
9
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
10
|
+
ar[i] = from[i];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.StyledTag = void 0;
|
|
17
|
+
var react_1 = require("@emotion/react");
|
|
18
|
+
var material_1 = require("@mui/material");
|
|
19
|
+
var styles_1 = require("@mui/material/styles");
|
|
20
|
+
var styles_2 = require("../styles");
|
|
21
|
+
var withoutIcon = function (props) {
|
|
22
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
23
|
+
var iconSizes = (0, styles_2.getIconSizes)(props);
|
|
24
|
+
return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: unset;\n margin: 0 ", "px ", "px 0;\n\n .MuiChip-label {\n ", "\n padding: 0;\n }\n\n .MuiChip-deleteIcon {\n ", "\n color: white;\n margin: 0 0 0 ", "px;\n height: ", "px;\n width: ", "px;\n }\n "], ["\n height: unset;\n margin: 0 ", "px ", "px 0;\n\n .MuiChip-label {\n ", "\n padding: 0;\n }\n\n .MuiChip-deleteIcon {\n ", "\n color: white;\n margin: 0 0 0 ", "px;\n height: ", "px;\n width: ", "px;\n }\n "])), spacings === null || spacings === void 0 ? void 0 : spacings.xxs, spacings === null || spacings === void 0 ? void 0 : spacings.xs, (0, styles_2.fontBodyXxxs)(props), (0, styles_2.fontHeaderXs)(props), spacings === null || spacings === void 0 ? void 0 : spacings.xxs, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.width);
|
|
25
|
+
};
|
|
26
|
+
var withIcon = function (props) {
|
|
27
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
28
|
+
var iconSizes = (0, styles_2.getIconSizes)(props);
|
|
29
|
+
return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: unset;\n margin: 0 ", "px ", "px 0;\n\n .MuiChip-label {\n ", "\n padding: 0;\n }\n\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n padding-right: ", "px;\n margin: 0 0 0 -", "px;\n }\n\n .MuiChip-deleteIcon {\n ", "\n color: white;\n margin: 0 0 0 ", "px;\n height: ", "px;\n width: ", "px;\n }\n "], ["\n height: unset;\n margin: 0 ", "px ", "px 0;\n\n .MuiChip-label {\n ", "\n padding: 0;\n }\n\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n padding-right: ", "px;\n margin: 0 0 0 -", "px;\n }\n\n .MuiChip-deleteIcon {\n ", "\n color: white;\n margin: 0 0 0 ", "px;\n height: ", "px;\n width: ", "px;\n }\n "])), spacings === null || spacings === void 0 ? void 0 : spacings.xxs, spacings === null || spacings === void 0 ? void 0 : spacings.xs, (0, styles_2.fontBodyXs)(props), iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.l.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.l.width, spacings === null || spacings === void 0 ? void 0 : spacings.xxs, spacings === null || spacings === void 0 ? void 0 : spacings.xxxs, (0, styles_2.fontHeaderXs)(props), spacings === null || spacings === void 0 ? void 0 : spacings.xxs, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.width);
|
|
30
|
+
};
|
|
31
|
+
var rounded = function (props) {
|
|
32
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
33
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
34
|
+
var icon = props.icon;
|
|
35
|
+
return (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n\n &:after {\n border-radius: ", "px;\n }\n "], ["\n border-radius: ", "px;\n padding: ", ";\n\n &:after {\n border-radius: ", "px;\n }\n "])), corners === null || corners === void 0 ? void 0 : corners.l, icon
|
|
36
|
+
? "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px")
|
|
37
|
+
: "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px"), corners === null || corners === void 0 ? void 0 : corners.l);
|
|
38
|
+
};
|
|
39
|
+
var square = function (props) {
|
|
40
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
41
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
42
|
+
var icon = props.icon;
|
|
43
|
+
return (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: ", "px;\n padding: ", ";\n\n &:after {\n border-radius: ", "px;\n }\n "], ["\n border-radius: ", "px;\n padding: ", ";\n\n &:after {\n border-radius: ", "px;\n }\n "])), corners === null || corners === void 0 ? void 0 : corners.m, icon
|
|
44
|
+
? "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px")
|
|
45
|
+
: "".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px"), corners === null || corners === void 0 ? void 0 : corners.m);
|
|
46
|
+
};
|
|
47
|
+
var withHover = function () {
|
|
48
|
+
return (0, react_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n &:hover {\n cursor: pointer;\n }\n\n &:hover,\n &:focus-visible {\n color: white;\n }\n "], ["\n &:hover {\n cursor: pointer;\n }\n\n &:hover,\n &:focus-visible {\n color: white;\n }\n "])));
|
|
49
|
+
};
|
|
50
|
+
var primary = function (props) {
|
|
51
|
+
return createTypeCss(props, "primary");
|
|
52
|
+
};
|
|
53
|
+
var secondary = function (props) {
|
|
54
|
+
return createTypeCss(props, "secondary");
|
|
55
|
+
};
|
|
56
|
+
function createTypeCss(props, type) {
|
|
57
|
+
var themeColors = (0, styles_2.getColors)(props);
|
|
58
|
+
var intent = typeof props.tagColor === "string" ? props.tagColor : "primary";
|
|
59
|
+
var colors = Array.isArray(props.tagColor) ? __spreadArray([], props.tagColor, true) : [];
|
|
60
|
+
var typeToColors = {
|
|
61
|
+
primary: {
|
|
62
|
+
background: colors.length >= 2 ? colors[1] : themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][400],
|
|
63
|
+
backgroundClicked: colors.length >= 2
|
|
64
|
+
? (0, material_1.darken)(colors[1], 0.3)
|
|
65
|
+
: themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][600],
|
|
66
|
+
backgroundHover: colors.length >= 2
|
|
67
|
+
? (0, material_1.darken)(colors[1], 0.15)
|
|
68
|
+
: themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][500],
|
|
69
|
+
iconColor: colors.length > 2 ? colors[2] : "white",
|
|
70
|
+
label: colors.length ? colors[0] : "white",
|
|
71
|
+
},
|
|
72
|
+
secondary: {
|
|
73
|
+
background: colors.length >= 2 ? colors[1] : themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][200],
|
|
74
|
+
backgroundClicked: colors.length >= 2
|
|
75
|
+
? (0, material_1.darken)(colors[1], 0.3)
|
|
76
|
+
: themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][600],
|
|
77
|
+
backgroundHover: colors.length >= 2
|
|
78
|
+
? (0, material_1.darken)(colors[1], 0.15)
|
|
79
|
+
: themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][500],
|
|
80
|
+
iconColor: colors.length > 2 ? colors[2] : themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][400],
|
|
81
|
+
label: colors.length ? colors[0] : themeColors === null || themeColors === void 0 ? void 0 : themeColors[intent][600],
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
var typeColors = typeToColors[type];
|
|
85
|
+
return (0, react_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n position: relative;\n\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n\n &:hover,\n &:active,\n &:focus {\n .MuiChip-label {\n color: white;\n }\n\n svg {\n fill: white;\n }\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &:focus {\n background-color: ", ";\n }\n\n &:focus:hover {\n background-color: ", ";\n }\n\n &:focus:active {\n background-color: ", ";\n }\n "], ["\n background-color: ", ";\n position: relative;\n\n .MuiChip-label {\n color: ", ";\n }\n\n svg {\n fill: ", ";\n }\n\n &:hover,\n &:active,\n &:focus {\n .MuiChip-label {\n color: white;\n }\n\n svg {\n fill: white;\n }\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n\n &:focus {\n background-color: ", ";\n }\n\n &:focus:hover {\n background-color: ", ";\n }\n\n &:focus:active {\n background-color: ", ";\n }\n "])), typeColors.background, typeColors.label, typeColors.iconColor, typeColors.backgroundHover, typeColors.backgroundClicked, typeColors.background, typeColors.backgroundHover, typeColors.backgroundClicked);
|
|
86
|
+
}
|
|
87
|
+
var typeToCss = {
|
|
88
|
+
primary: primary,
|
|
89
|
+
secondary: secondary,
|
|
90
|
+
};
|
|
91
|
+
var doNotForwardProps = ["sdsType", "sdsStyle", "tagColor", "hover"];
|
|
92
|
+
exports.StyledTag = (0, styles_1.styled)(material_1.Chip, {
|
|
93
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
94
|
+
})(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border: none;\n\n ", "\n"], ["\n border: none;\n\n ", "\n"])), function (props) {
|
|
95
|
+
var _a = props.hover, hover = _a === void 0 ? true : _a, sdsType = props.sdsType, sdsStyle = props.sdsStyle, icon = props.icon;
|
|
96
|
+
var isRounded = sdsStyle === "rounded";
|
|
97
|
+
var type = sdsType || "primary";
|
|
98
|
+
return (0, react_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n "])), icon ? withIcon(props) : withoutIcon(props), typeToCss[type](props), isRounded ? rounded(props) : square(props), hover ? withHover() : "pointer-events: none;");
|
|
99
|
+
});
|
|
100
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
var components_1 = require("@czi-sds/components");
|
|
5
|
+
var utils_1 = require("src/common/utils");
|
|
6
|
+
var TagFilterNameSpaceTest = function (props) {
|
|
7
|
+
return (0, jsx_runtime_1.jsx)(components_1.TagFilter, { label: "Label", onDelete: utils_1.noop });
|
|
8
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<TagFilter /> Default story renders snapshot 1`] = `
|
|
4
|
+
<div
|
|
5
|
+
style="display: inline-grid; grid-template-columns: repeat(1, 1fr); grid-template-rows: repeat(1, 1fr);"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
style="grid-area: 1 / 1 / 1 / 2;"
|
|
9
|
+
>
|
|
10
|
+
<button
|
|
11
|
+
class="MuiButtonBase-root MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium Mui-disabled MuiButton-root MuiButton-text MuiButton-textPrimary MuiButton-sizeMedium MuiButton-textSizeMedium css-1qnokts-MuiButtonBase-root-MuiButton-root"
|
|
12
|
+
disabled=""
|
|
13
|
+
tabindex="-1"
|
|
14
|
+
type="button"
|
|
15
|
+
>
|
|
16
|
+
Delete the tag by clicking on its icon
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
<div
|
|
20
|
+
style="grid-area: 2 / 1 / 2 / 2;"
|
|
21
|
+
>
|
|
22
|
+
<div
|
|
23
|
+
class="MuiButtonBase-root MuiChip-root MuiChip-filled MuiChip-sizeMedium MuiChip-colorPrimary MuiChip-deletable MuiChip-deletableColorPrimary MuiChip-filledPrimary css-4l3rqc-MuiButtonBase-root-MuiChip-root"
|
|
24
|
+
role="button"
|
|
25
|
+
tabindex="0"
|
|
26
|
+
>
|
|
27
|
+
<span
|
|
28
|
+
class="MuiChip-label MuiChip-labelMedium css-6od3lo-MuiChip-label"
|
|
29
|
+
>
|
|
30
|
+
TagFilter
|
|
31
|
+
</span>
|
|
32
|
+
<svg
|
|
33
|
+
aria-hidden="true"
|
|
34
|
+
class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiChip-deleteIcon MuiChip-deleteIconMedium MuiChip-deleteIconColorPrimary MuiChip-deleteIconFilledColorPrimary css-i4bv87-MuiSvgIcon-root"
|
|
35
|
+
data-testid="ClearIcon"
|
|
36
|
+
focusable="false"
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
>
|
|
39
|
+
<path
|
|
40
|
+
d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
41
|
+
/>
|
|
42
|
+
</svg>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChipProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface SdsTagFilterProps extends Omit<ChipProps, "color" | "variant" | "nonce" | "rev" | "rel" | "autoFocus" | "content"> {
|
|
4
|
+
label: string;
|
|
5
|
+
onDelete: React.EventHandler<any>;
|
|
6
|
+
}
|
|
7
|
+
export type TagFilterProps = SdsTagFilterProps;
|
|
8
|
+
/**
|
|
9
|
+
* @see https://mui.com/material-ui/react-chip/
|
|
10
|
+
*/
|
|
11
|
+
declare const TagFilter: (props: SdsTagFilterProps) => JSX.Element;
|
|
12
|
+
export default TagFilter;
|
|
@@ -0,0 +1,23 @@
|
|
|
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 style_1 = require("./style");
|
|
17
|
+
/**
|
|
18
|
+
* @see https://mui.com/material-ui/react-chip/
|
|
19
|
+
*/
|
|
20
|
+
var TagFilter = function (props) {
|
|
21
|
+
return (0, jsx_runtime_1.jsx)(style_1.StyledTag, __assign({ deleteIcon: (0, jsx_runtime_1.jsx)(icons_material_1.Clear, {}) }, props));
|
|
22
|
+
};
|
|
23
|
+
exports.default = TagFilter;
|