@czi-sds/components 15.1.1 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.d.ts +5 -3
- package/dist/index.cjs.js +73 -31
- package/dist/index.esm.d.ts +5 -3
- package/dist/index.esm.js +73 -31
- package/dist/src/common/helpers/scrollStop.d.ts +8 -0
- package/dist/src/common/helpers/scrollStop.js +54 -0
- package/dist/src/common/storybookConstants.d.ts +3 -0
- package/dist/src/common/storybookConstants.js +2 -0
- package/dist/src/common/utils.d.ts +2 -0
- package/dist/src/common/utils.js +9 -0
- package/dist/src/common/warnings.d.ts +10 -0
- package/dist/src/common/warnings.js +60 -0
- package/dist/src/common/warnings.test.d.ts +1 -0
- package/dist/src/common/warnings.test.js +19 -0
- package/dist/src/core/Accordion/Accordion.namespace-test.d.ts +1 -0
- package/dist/src/core/Accordion/Accordion.namespace-test.js +18 -0
- package/dist/src/core/Accordion/__snapshots__/index.test.js.snap +64 -0
- package/dist/src/core/Accordion/components/AccordionDetails/index.d.ts +3 -0
- package/dist/src/core/Accordion/components/AccordionDetails/index.js +9 -0
- package/dist/src/core/Accordion/components/AccordionDetails/style.d.ts +2 -0
- package/dist/src/core/Accordion/components/AccordionDetails/style.js +16 -0
- package/dist/src/core/Accordion/components/AccordionHeader/index.d.ts +7 -0
- package/dist/src/core/Accordion/components/AccordionHeader/index.js +13 -0
- package/dist/src/core/Accordion/components/AccordionHeader/style.d.ts +27 -0
- package/dist/src/core/Accordion/components/AccordionHeader/style.js +21 -0
- package/dist/src/core/Accordion/index.d.ts +12 -0
- package/dist/src/core/Accordion/index.js +38 -0
- package/dist/src/core/Accordion/index.stories.d.ts +28 -0
- package/dist/src/core/Accordion/index.stories.js +82 -0
- package/dist/src/core/Accordion/index.test.d.ts +1 -0
- package/dist/src/core/Accordion/index.test.js +58 -0
- package/dist/src/core/Accordion/style.d.ts +30 -0
- package/dist/src/core/Accordion/style.js +28 -0
- package/dist/src/core/Alert/index.d.ts +7 -0
- package/dist/src/core/Alert/index.js +22 -0
- package/dist/src/core/Alert/index.stories.d.ts +19 -0
- package/dist/src/core/Alert/index.stories.js +70 -0
- package/dist/src/core/Alert/style.d.ts +1 -0
- package/dist/src/core/Alert/style.js +23 -0
- package/dist/src/core/Banner/Banner.namespace-test.d.ts +1 -0
- package/dist/src/core/Banner/Banner.namespace-test.js +18 -0
- package/dist/src/core/Banner/banner.test.d.ts +1 -0
- package/dist/src/core/Banner/banner.test.js +126 -0
- package/dist/src/core/Banner/index.d.ts +11 -0
- package/dist/src/core/Banner/index.js +47 -0
- package/dist/src/core/Banner/index.stories.d.ts +46 -0
- package/dist/src/core/Banner/index.stories.js +106 -0
- package/dist/src/core/Banner/style.d.ts +13 -0
- package/dist/src/core/Banner/style.js +55 -0
- package/dist/src/core/Button/Button.namespace-test.d.ts +1 -0
- package/dist/src/core/Button/Button.namespace-test.js +18 -0
- package/dist/src/core/Button/index.d.ts +18 -0
- package/dist/src/core/Button/index.js +54 -0
- package/dist/src/core/Button/index.stories.d.ts +72 -0
- package/dist/src/core/Button/index.stories.js +215 -0
- package/dist/src/core/Button/index.test.d.ts +1 -0
- package/dist/src/core/Button/index.test.js +40 -0
- package/dist/src/core/Button/style.d.ts +180 -0
- package/dist/src/core/Button/style.js +59 -0
- package/dist/src/core/ButtonDropdown/ButtonDropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/ButtonDropdown/ButtonDropdown.namespace-test.js +18 -0
- package/dist/src/core/ButtonDropdown/index.d.ts +18 -0
- package/dist/src/core/ButtonDropdown/index.js +30 -0
- package/dist/src/core/ButtonDropdown/index.stories.d.ts +35 -0
- package/dist/src/core/ButtonDropdown/index.stories.js +79 -0
- package/dist/src/core/ButtonDropdown/index.test.d.ts +1 -0
- package/dist/src/core/ButtonDropdown/index.test.js +41 -0
- package/dist/src/core/ButtonIcon/ButtonIcon.namespace-test.d.ts +1 -0
- package/dist/src/core/ButtonIcon/ButtonIcon.namespace-test.js +18 -0
- package/dist/src/core/ButtonIcon/index.d.ts +15 -0
- package/dist/src/core/ButtonIcon/index.js +34 -0
- package/dist/src/core/ButtonIcon/index.stories.d.ts +39 -0
- package/dist/src/core/ButtonIcon/index.stories.js +239 -0
- package/dist/src/core/ButtonIcon/index.test.d.ts +1 -0
- package/dist/src/core/ButtonIcon/index.test.js +41 -0
- package/dist/src/core/ButtonIcon/style.d.ts +41 -0
- package/dist/src/core/ButtonIcon/style.js +68 -0
- package/dist/src/core/Callout/Callout.namespace-test.d.ts +1 -0
- package/dist/src/core/Callout/Callout.namespace-test.js +18 -0
- package/dist/src/core/Callout/components/CalloutTitle/index.d.ts +3 -0
- package/dist/src/core/Callout/components/CalloutTitle/index.js +9 -0
- package/dist/src/core/Callout/components/CalloutTitle/style.d.ts +1 -0
- package/dist/src/core/Callout/components/CalloutTitle/style.js +16 -0
- package/dist/src/core/Callout/index.d.ts +18 -0
- package/dist/src/core/Callout/index.js +89 -0
- package/dist/src/core/Callout/index.stories.d.ts +14 -0
- package/dist/src/core/Callout/index.stories.js +80 -0
- package/dist/src/core/Callout/style.d.ts +7 -0
- package/dist/src/core/Callout/style.js +31 -0
- package/dist/src/core/CellBasic/CellBasic.namespace-test.d.ts +1 -0
- package/dist/src/core/CellBasic/CellBasic.namespace-test.js +7 -0
- package/dist/src/core/CellBasic/index.d.ts +21 -0
- package/dist/src/core/CellBasic/index.js +32 -0
- package/dist/src/core/CellBasic/index.stories.d.ts +33 -0
- package/dist/src/core/CellBasic/index.stories.js +143 -0
- package/dist/src/core/CellBasic/index.test.d.ts +1 -0
- package/dist/src/core/CellBasic/index.test.js +124 -0
- package/dist/src/core/CellBasic/style.d.ts +18 -0
- package/dist/src/core/CellBasic/style.js +86 -0
- package/dist/src/core/CellComponent/CellComponent.namespace-test.d.ts +1 -0
- package/dist/src/core/CellComponent/CellComponent.namespace-test.js +7 -0
- package/dist/src/core/CellComponent/index.d.ts +8 -0
- package/dist/src/core/CellComponent/index.js +21 -0
- package/dist/src/core/CellComponent/index.stories.d.ts +21 -0
- package/dist/src/core/CellComponent/index.stories.js +92 -0
- package/dist/src/core/CellComponent/index.test.d.ts +1 -0
- package/dist/src/core/CellComponent/index.test.js +110 -0
- package/dist/src/core/CellComponent/style.d.ts +9 -0
- package/dist/src/core/CellComponent/style.js +32 -0
- package/dist/src/core/CellHeader/CellHeader.namespace-test.d.ts +1 -0
- package/dist/src/core/CellHeader/CellHeader.namespace-test.js +8 -0
- package/dist/src/core/CellHeader/index.d.ts +20 -0
- package/dist/src/core/CellHeader/index.js +47 -0
- package/dist/src/core/CellHeader/index.stories.d.ts +26 -0
- package/dist/src/core/CellHeader/index.stories.js +128 -0
- package/dist/src/core/CellHeader/index.test.d.ts +1 -0
- package/dist/src/core/CellHeader/index.test.js +112 -0
- package/dist/src/core/CellHeader/style.d.ts +9 -0
- package/dist/src/core/CellHeader/style.js +50 -0
- package/dist/src/core/Chip/index.d.ts +9 -0
- package/dist/src/core/Chip/index.js +29 -0
- package/dist/src/core/Chip/index.stories.d.ts +58 -0
- package/dist/src/core/Chip/index.stories.js +90 -0
- package/dist/src/core/Chip/style.d.ts +26 -0
- package/dist/src/core/Chip/style.js +95 -0
- package/dist/src/core/ComplexFilter/ComplexFilter.namespace-test.d.ts +1 -0
- package/dist/src/core/ComplexFilter/ComplexFilter.namespace-test.js +20 -0
- package/dist/src/core/ComplexFilter/components/Chips/index.d.ts +8 -0
- package/dist/src/core/ComplexFilter/components/Chips/index.js +21 -0
- package/dist/src/core/ComplexFilter/index.d.ts +23 -0
- package/dist/src/core/ComplexFilter/index.js +119 -0
- package/dist/src/core/ComplexFilter/index.stories.d.ts +33 -0
- package/dist/src/core/ComplexFilter/index.stories.js +126 -0
- package/dist/src/core/ComplexFilter/index.test.d.ts +1 -0
- package/dist/src/core/ComplexFilter/index.test.js +51 -0
- package/dist/src/core/ComplexFilter/style.d.ts +3 -0
- package/dist/src/core/ComplexFilter/style.js +15 -0
- package/dist/src/core/Dialog/Dialog.namespace-test.d.ts +1 -0
- package/dist/src/core/Dialog/Dialog.namespace-test.js +8 -0
- package/dist/src/core/Dialog/__snapshots__/index.test.js.snap +382 -0
- package/dist/src/core/Dialog/components/common.d.ts +6 -0
- package/dist/src/core/Dialog/components/common.js +5 -0
- package/dist/src/core/Dialog/index.d.ts +18 -0
- package/dist/src/core/Dialog/index.js +50 -0
- package/dist/src/core/Dialog/index.stories.d.ts +46 -0
- package/dist/src/core/Dialog/index.stories.js +147 -0
- package/dist/src/core/Dialog/index.test.d.ts +1 -0
- package/dist/src/core/Dialog/index.test.js +62 -0
- package/dist/src/core/DialogActions/index.d.ts +9 -0
- package/dist/src/core/DialogActions/index.js +23 -0
- package/dist/src/core/DialogActions/style.d.ts +5 -0
- package/dist/src/core/DialogActions/style.js +20 -0
- package/dist/src/core/DialogContent/index.d.ts +5 -0
- package/dist/src/core/DialogContent/index.js +23 -0
- package/dist/src/core/DialogContent/style.d.ts +1 -0
- package/dist/src/core/DialogContent/style.js +11 -0
- package/dist/src/core/DialogPaper/index.d.ts +8 -0
- package/dist/src/core/DialogPaper/index.js +27 -0
- package/dist/src/core/DialogPaper/style.d.ts +16 -0
- package/dist/src/core/DialogPaper/style.js +44 -0
- package/dist/src/core/DialogTitle/components/CloseButton/index.d.ts +5 -0
- package/dist/src/core/DialogTitle/components/CloseButton/index.js +31 -0
- package/dist/src/core/DialogTitle/components/CloseButton/style.d.ts +2 -0
- package/dist/src/core/DialogTitle/components/CloseButton/style.js +18 -0
- package/dist/src/core/DialogTitle/index.d.ts +14 -0
- package/dist/src/core/DialogTitle/index.js +42 -0
- package/dist/src/core/DialogTitle/style.d.ts +46 -0
- package/dist/src/core/DialogTitle/style.js +20 -0
- package/dist/src/core/Dropdown/Dropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/Dropdown/Dropdown.namespace-test.js +20 -0
- package/dist/src/core/Dropdown/index.d.ts +31 -0
- package/dist/src/core/Dropdown/index.js +160 -0
- package/dist/src/core/Dropdown/index.stories.d.ts +68 -0
- package/dist/src/core/Dropdown/index.stories.js +215 -0
- package/dist/src/core/Dropdown/index.test.d.ts +1 -0
- package/dist/src/core/Dropdown/index.test.js +229 -0
- package/dist/src/core/Dropdown/style.d.ts +5 -0
- package/dist/src/core/Dropdown/style.js +19 -0
- package/dist/src/core/DropdownMenu/DropdownMenu.namespace-test.d.ts +1 -0
- package/dist/src/core/DropdownMenu/DropdownMenu.namespace-test.js +20 -0
- package/dist/src/core/DropdownMenu/GITHUB_LABELS.d.ts +2 -0
- package/dist/src/core/DropdownMenu/GITHUB_LABELS.js +83 -0
- package/dist/src/core/DropdownMenu/index.d.ts +42 -0
- package/dist/src/core/DropdownMenu/index.js +83 -0
- package/dist/src/core/DropdownMenu/index.stories.d.ts +55 -0
- package/dist/src/core/DropdownMenu/index.stories.js +438 -0
- package/dist/src/core/DropdownMenu/index.test.d.ts +1 -0
- package/dist/src/core/DropdownMenu/index.test.js +51 -0
- package/dist/src/core/DropdownMenu/style.d.ts +40 -0
- package/dist/src/core/DropdownMenu/style.js +85 -0
- package/dist/src/core/Icon/Icon.namespace-test.d.ts +1 -0
- package/dist/src/core/Icon/Icon.namespace-test.js +7 -0
- package/dist/src/core/Icon/index.d.ts +14 -0
- package/dist/src/core/Icon/index.js +25 -0
- package/dist/src/core/Icon/index.stories.d.ts +34 -0
- package/dist/src/core/Icon/index.stories.js +171 -0
- package/dist/src/core/Icon/map.d.ts +98 -0
- package/dist/src/core/Icon/map.js +476 -0
- package/dist/src/core/Icon/style.d.ts +36 -0
- package/dist/src/core/Icon/style.js +42 -0
- package/dist/src/core/InputCheckbox/InputCheckbox.namespace-test.d.ts +1 -0
- package/dist/src/core/InputCheckbox/InputCheckbox.namespace-test.js +9 -0
- package/dist/src/core/InputCheckbox/index.d.ts +13 -0
- package/dist/src/core/InputCheckbox/index.js +55 -0
- package/dist/src/core/InputCheckbox/index.stories.d.ts +35 -0
- package/dist/src/core/InputCheckbox/index.stories.js +119 -0
- package/dist/src/core/InputCheckbox/index.test.d.ts +1 -0
- package/dist/src/core/InputCheckbox/index.test.js +62 -0
- package/dist/src/core/InputCheckbox/styles.d.ts +6 -0
- package/dist/src/core/InputCheckbox/styles.js +24 -0
- package/dist/src/core/InputDropdown/InputDropdown.namespace-test.d.ts +1 -0
- package/dist/src/core/InputDropdown/InputDropdown.namespace-test.js +8 -0
- package/dist/src/core/InputDropdown/index.d.ts +8 -0
- package/dist/src/core/InputDropdown/index.js +83 -0
- package/dist/src/core/InputDropdown/index.stories.d.ts +59 -0
- package/dist/src/core/InputDropdown/index.stories.js +264 -0
- package/dist/src/core/InputDropdown/index.test.d.ts +1 -0
- package/dist/src/core/InputDropdown/index.test.js +58 -0
- package/dist/src/core/InputDropdown/style.d.ts +38 -0
- package/dist/src/core/InputDropdown/style.js +130 -0
- package/dist/src/core/InputRadio/InputRadio.namespace-test.d.ts +1 -0
- package/dist/src/core/InputRadio/InputRadio.namespace-test.js +8 -0
- package/dist/src/core/InputRadio/index.d.ts +14 -0
- package/dist/src/core/InputRadio/index.js +40 -0
- package/dist/src/core/InputRadio/index.stories.d.ts +32 -0
- package/dist/src/core/InputRadio/index.stories.js +64 -0
- package/dist/src/core/InputRadio/index.test.d.ts +1 -0
- package/dist/src/core/InputRadio/index.test.js +92 -0
- package/dist/src/core/InputRadio/style.d.ts +6 -0
- package/dist/src/core/InputRadio/style.js +24 -0
- package/dist/src/core/InputSearch/InputSearch.namespace-test.d.ts +1 -0
- package/dist/src/core/InputSearch/InputSearch.namespace-test.js +8 -0
- package/dist/src/core/InputSearch/index.d.ts +16 -0
- package/dist/src/core/InputSearch/index.js +75 -0
- package/dist/src/core/InputSearch/index.stories.d.ts +35 -0
- package/dist/src/core/InputSearch/index.stories.js +104 -0
- package/dist/src/core/InputSearch/index.test.d.ts +1 -0
- package/dist/src/core/InputSearch/index.test.js +70 -0
- package/dist/src/core/InputSearch/style.d.ts +12 -0
- package/dist/src/core/InputSearch/style.js +47 -0
- package/dist/src/core/InputSlider/InputSlider.namespace-test.d.ts +1 -0
- package/dist/src/core/InputSlider/InputSlider.namespace-test.js +7 -0
- package/dist/src/core/InputSlider/__snapshots__/index.test.js.snap +124 -0
- package/dist/src/core/InputSlider/index.d.ts +8 -0
- package/dist/src/core/InputSlider/index.js +23 -0
- package/dist/src/core/InputSlider/index.stories.d.ts +43 -0
- package/dist/src/core/InputSlider/index.stories.js +160 -0
- package/dist/src/core/InputSlider/index.test.d.ts +1 -0
- package/dist/src/core/InputSlider/index.test.js +52 -0
- package/dist/src/core/InputSlider/style.d.ts +76 -0
- package/dist/src/core/InputSlider/style.js +34 -0
- package/dist/src/core/InputText/InputText.namespace-test.d.ts +1 -0
- package/dist/src/core/InputText/InputText.namespace-test.js +7 -0
- package/dist/src/core/InputText/__snapshots__/index.test.js.snap +10 -0
- package/dist/src/core/InputText/index.d.ts +14 -0
- package/dist/src/core/InputText/index.js +52 -0
- package/dist/src/core/InputText/index.stories.d.ts +29 -0
- package/dist/src/core/InputText/index.stories.js +100 -0
- package/dist/src/core/InputText/index.test.d.ts +1 -0
- package/dist/src/core/InputText/index.test.js +67 -0
- package/dist/src/core/InputText/style.d.ts +13 -0
- package/dist/src/core/InputText/style.js +45 -0
- package/dist/src/core/InputToggle/InputToggle.namespace-test.d.ts +1 -0
- package/dist/src/core/InputToggle/InputToggle.namespace-test.js +7 -0
- package/dist/src/core/InputToggle/__snapshots__/index.test.js.snap +26 -0
- package/dist/src/core/InputToggle/index.d.ts +7 -0
- package/dist/src/core/InputToggle/index.js +42 -0
- package/dist/src/core/InputToggle/index.stories.d.ts +20 -0
- package/dist/src/core/InputToggle/index.stories.js +63 -0
- package/dist/src/core/InputToggle/index.test.d.ts +1 -0
- package/dist/src/core/InputToggle/index.test.js +52 -0
- package/dist/src/core/InputToggle/style.d.ts +9 -0
- package/dist/src/core/InputToggle/style.js +38 -0
- package/dist/src/core/Link/Link.namespace-test.d.ts +1 -0
- package/dist/src/core/Link/Link.namespace-test.js +7 -0
- package/dist/src/core/Link/index.d.ts +8 -0
- package/dist/src/core/Link/index.js +28 -0
- package/dist/src/core/Link/index.stories.d.ts +27 -0
- package/dist/src/core/Link/index.stories.js +99 -0
- package/dist/src/core/Link/style.d.ts +9 -0
- package/dist/src/core/Link/style.js +30 -0
- package/dist/src/core/List/List.namespace-test.d.ts +1 -0
- package/dist/src/core/List/List.namespace-test.js +7 -0
- package/dist/src/core/List/index.d.ts +8 -0
- package/dist/src/core/List/index.js +23 -0
- package/dist/src/core/List/index.stories.d.ts +4 -0
- package/dist/src/core/List/index.stories.js +30 -0
- package/dist/src/core/List/style.d.ts +17 -0
- package/dist/src/core/List/style.js +33 -0
- package/dist/src/core/ListItem/ListItem.namespace-test.d.ts +1 -0
- package/dist/src/core/ListItem/ListItem.namespace-test.js +7 -0
- package/dist/src/core/ListItem/index.d.ts +9 -0
- package/dist/src/core/ListItem/index.js +24 -0
- package/dist/src/core/ListItem/style.d.ts +26 -0
- package/dist/src/core/ListItem/style.js +56 -0
- package/dist/src/core/ListSubheader/ListSubheader.namespace-test.d.ts +1 -0
- package/dist/src/core/ListSubheader/ListSubheader.namespace-test.js +7 -0
- package/dist/src/core/ListSubheader/index.d.ts +7 -0
- package/dist/src/core/ListSubheader/index.js +22 -0
- package/dist/src/core/ListSubheader/style.d.ts +12 -0
- package/dist/src/core/ListSubheader/style.js +16 -0
- package/dist/src/core/LoadingIndicator/LoadingIndicator.namespace-test.d.ts +1 -0
- package/dist/src/core/LoadingIndicator/LoadingIndicator.namespace-test.js +7 -0
- package/dist/src/core/LoadingIndicator/index.d.ts +4 -0
- package/dist/src/core/LoadingIndicator/index.js +13 -0
- package/dist/src/core/LoadingIndicator/index.stories.d.ts +24 -0
- package/dist/src/core/LoadingIndicator/index.stories.js +77 -0
- package/dist/src/core/LoadingIndicator/index.test.d.ts +1 -0
- package/dist/src/core/LoadingIndicator/index.test.js +41 -0
- package/dist/src/core/LoadingIndicator/style.d.ts +7 -0
- package/dist/src/core/LoadingIndicator/style.js +36 -0
- package/dist/src/core/Menu/Menu.namespace-test.d.ts +1 -0
- package/dist/src/core/Menu/Menu.namespace-test.js +8 -0
- package/dist/src/core/Menu/index.d.ts +7 -0
- package/dist/src/core/Menu/index.js +30 -0
- package/dist/src/core/Menu/index.stories.d.ts +17 -0
- package/dist/src/core/Menu/index.stories.js +55 -0
- package/dist/src/core/Menu/style.d.ts +1 -0
- package/dist/src/core/Menu/style.js +15 -0
- package/dist/src/core/MenuItem/MenuItem.namespace-test.d.ts +1 -0
- package/dist/src/core/MenuItem/MenuItem.namespace-test.js +8 -0
- package/dist/src/core/MenuItem/index.d.ts +21 -0
- package/dist/src/core/MenuItem/index.js +42 -0
- package/dist/src/core/MenuItem/index.stories.d.ts +35 -0
- package/dist/src/core/MenuItem/index.stories.js +188 -0
- package/dist/src/core/MenuItem/index.test.d.ts +1 -0
- package/dist/src/core/MenuItem/index.test.js +41 -0
- package/dist/src/core/MenuItem/style.d.ts +65 -0
- package/dist/src/core/MenuItem/style.js +58 -0
- package/dist/src/core/MenuSelect/index.d.ts +19 -0
- package/dist/src/core/MenuSelect/index.js +70 -0
- package/dist/src/core/MenuSelect/index.stories.d.ts +34 -0
- package/dist/src/core/MenuSelect/index.stories.js +154 -0
- package/dist/src/core/MenuSelect/style.d.ts +12 -0
- package/dist/src/core/MenuSelect/style.js +45 -0
- package/dist/src/core/NavigationJumpTo/NavigationJumpTo.namespace-test.d.ts +1 -0
- package/dist/src/core/NavigationJumpTo/NavigationJumpTo.namespace-test.js +13 -0
- package/dist/src/core/NavigationJumpTo/__snapshots__/index.test.js.snap +319 -0
- package/dist/src/core/NavigationJumpTo/index.d.ts +13 -0
- package/dist/src/core/NavigationJumpTo/index.js +111 -0
- package/dist/src/core/NavigationJumpTo/index.stories.d.ts +56 -0
- package/dist/src/core/NavigationJumpTo/index.stories.js +216 -0
- package/dist/src/core/NavigationJumpTo/index.test.d.ts +1 -0
- package/dist/src/core/NavigationJumpTo/index.test.js +87 -0
- package/dist/src/core/NavigationJumpTo/style.d.ts +106 -0
- package/dist/src/core/NavigationJumpTo/style.js +27 -0
- package/dist/src/core/NavigationJumpTo/useIntersection.d.ts +19 -0
- package/dist/src/core/NavigationJumpTo/useIntersection.js +67 -0
- package/dist/src/core/Notification/Notification.namespace-test.d.ts +1 -0
- package/dist/src/core/Notification/Notification.namespace-test.js +8 -0
- package/dist/src/core/Notification/index.d.ts +17 -0
- package/dist/src/core/Notification/index.js +70 -0
- package/dist/src/core/Notification/index.stories.d.ts +43 -0
- package/dist/src/core/Notification/index.stories.js +186 -0
- package/dist/src/core/Notification/index.test.d.ts +1 -0
- package/dist/src/core/Notification/index.test.js +115 -0
- package/dist/src/core/Notification/style.d.ts +1 -0
- package/dist/src/core/Notification/style.js +26 -0
- package/dist/src/core/Pagination/Pagination.namespace-test.d.ts +1 -0
- package/dist/src/core/Pagination/Pagination.namespace-test.js +8 -0
- package/dist/src/core/Pagination/components/PageListDropdown/index.d.ts +7 -0
- package/dist/src/core/Pagination/components/PageListDropdown/index.js +27 -0
- package/dist/src/core/Pagination/components/PageListDropdown/style.d.ts +1 -0
- package/dist/src/core/Pagination/components/PageListDropdown/style.js +14 -0
- package/dist/src/core/Pagination/index.d.ts +15 -0
- package/dist/src/core/Pagination/index.js +47 -0
- package/dist/src/core/Pagination/index.stories.d.ts +21 -0
- package/dist/src/core/Pagination/index.stories.js +99 -0
- package/dist/src/core/Pagination/index.test.d.ts +1 -0
- package/dist/src/core/Pagination/index.test.js +128 -0
- package/dist/src/core/Pagination/style.d.ts +13 -0
- package/dist/src/core/Pagination/style.js +62 -0
- package/dist/src/core/Pagination/usePagination.d.ts +9 -0
- package/dist/src/core/Pagination/usePagination.js +69 -0
- package/dist/src/core/SegmentedControl/SegmentedControl.namespace-test.d.ts +1 -0
- package/dist/src/core/SegmentedControl/SegmentedControl.namespace-test.js +12 -0
- package/dist/src/core/SegmentedControl/index.d.ts +15 -0
- package/dist/src/core/SegmentedControl/index.js +38 -0
- package/dist/src/core/SegmentedControl/index.stories.d.ts +49 -0
- package/dist/src/core/SegmentedControl/index.stories.js +128 -0
- package/dist/src/core/SegmentedControl/index.test.d.ts +1 -0
- package/dist/src/core/SegmentedControl/index.test.js +41 -0
- package/dist/src/core/SegmentedControl/style.d.ts +2 -0
- package/dist/src/core/SegmentedControl/style.js +23 -0
- package/dist/src/core/Table/Table.namespace-test.d.ts +1 -0
- package/dist/src/core/Table/Table.namespace-test.js +7 -0
- package/dist/src/core/Table/components/common.d.ts +6 -0
- package/dist/src/core/Table/components/common.js +5 -0
- package/dist/src/core/Table/index.d.ts +7 -0
- package/dist/src/core/Table/index.js +21 -0
- package/dist/src/core/Table/index.stories.d.ts +18 -0
- package/dist/src/core/Table/index.stories.js +64 -0
- package/dist/src/core/Table/index.test.d.ts +1 -0
- package/dist/src/core/Table/index.test.js +89 -0
- package/dist/src/core/Table/style.d.ts +2 -0
- package/dist/src/core/Table/style.js +10 -0
- package/dist/src/core/TableHeader/TableHeader.namespace-test.d.ts +1 -0
- package/dist/src/core/TableHeader/TableHeader.namespace-test.js +7 -0
- package/dist/src/core/TableHeader/index.d.ts +6 -0
- package/dist/src/core/TableHeader/index.js +25 -0
- package/dist/src/core/TableHeader/index.stories.d.ts +12 -0
- package/dist/src/core/TableHeader/index.stories.js +38 -0
- package/dist/src/core/TableHeader/index.test.d.ts +1 -0
- package/dist/src/core/TableHeader/index.test.js +41 -0
- package/dist/src/core/TableHeader/style.d.ts +2 -0
- package/dist/src/core/TableHeader/style.js +14 -0
- package/dist/src/core/TableRow/TableRow.namespace-test.d.ts +1 -0
- package/dist/src/core/TableRow/TableRow.namespace-test.js +7 -0
- package/dist/src/core/TableRow/__snapshots__/index.test.js.snap +100 -0
- package/dist/src/core/TableRow/index.d.ts +13 -0
- package/dist/src/core/TableRow/index.js +28 -0
- package/dist/src/core/TableRow/index.stories.d.ts +24 -0
- package/dist/src/core/TableRow/index.stories.js +77 -0
- package/dist/src/core/TableRow/index.test.d.ts +1 -0
- package/dist/src/core/TableRow/index.test.js +92 -0
- package/dist/src/core/TableRow/style.d.ts +10 -0
- package/dist/src/core/TableRow/style.js +34 -0
- package/dist/src/core/Tabs/Tabs.namespace-test.d.ts +1 -0
- package/dist/src/core/Tabs/Tabs.namespace-test.js +8 -0
- package/dist/src/core/Tabs/__snapshots__/index.test.js.snap +46 -0
- package/dist/src/core/Tabs/components/LabelWithCount/index.d.ts +7 -0
- package/dist/src/core/Tabs/components/LabelWithCount/index.js +11 -0
- package/dist/src/core/Tabs/components/LabelWithCount/style.d.ts +10 -0
- package/dist/src/core/Tabs/components/LabelWithCount/style.js +43 -0
- package/dist/src/core/Tabs/components/common.d.ts +5 -0
- package/dist/src/core/Tabs/components/common.js +5 -0
- package/dist/src/core/Tabs/index.d.ts +13 -0
- package/dist/src/core/Tabs/index.js +89 -0
- package/dist/src/core/Tabs/index.stories.d.ts +38 -0
- package/dist/src/core/Tabs/index.stories.js +154 -0
- package/dist/src/core/Tabs/index.test.d.ts +1 -0
- package/dist/src/core/Tabs/index.test.js +48 -0
- package/dist/src/core/Tabs/style.d.ts +115 -0
- package/dist/src/core/Tabs/style.js +53 -0
- package/dist/src/core/Tag/Tag.namespace-test.d.ts +1 -0
- package/dist/src/core/Tag/Tag.namespace-test.js +7 -0
- package/dist/src/core/Tag/index.d.ts +17 -0
- package/dist/src/core/Tag/index.js +27 -0
- package/dist/src/core/Tag/index.stories.d.ts +98 -0
- package/dist/src/core/Tag/index.stories.js +238 -0
- package/dist/src/core/Tag/index.test.d.ts +1 -0
- package/dist/src/core/Tag/index.test.js +40 -0
- package/dist/src/core/Tag/index.testUtils.d.ts +8 -0
- package/dist/src/core/Tag/index.testUtils.js +108 -0
- package/dist/src/core/Tag/style.d.ts +29 -0
- package/dist/src/core/Tag/style.js +100 -0
- package/dist/src/core/TagFilter/TagFilter.namespace-test.d.ts +1 -0
- package/dist/src/core/TagFilter/TagFilter.namespace-test.js +8 -0
- package/dist/src/core/TagFilter/__snapshots__/index.test.js.snap +46 -0
- package/dist/src/core/TagFilter/index.d.ts +12 -0
- package/dist/src/core/TagFilter/index.js +23 -0
- package/dist/src/core/TagFilter/index.stories.d.ts +44 -0
- package/dist/src/core/TagFilter/index.stories.js +121 -0
- package/dist/src/core/TagFilter/index.test.d.ts +1 -0
- package/dist/src/core/TagFilter/index.test.js +40 -0
- package/dist/src/core/TagFilter/style.d.ts +7 -0
- package/dist/src/core/TagFilter/style.js +19 -0
- package/dist/src/core/Tooltip/Tooltip.namespace-test.d.ts +1 -0
- package/dist/src/core/Tooltip/Tooltip.namespace-test.js +7 -0
- package/dist/src/core/Tooltip/index.d.ts +14 -0
- package/dist/src/core/Tooltip/index.js +87 -0
- package/dist/src/core/Tooltip/index.stories.d.ts +48 -0
- package/dist/src/core/Tooltip/index.stories.js +257 -0
- package/dist/src/core/Tooltip/index.test.d.ts +1 -0
- package/dist/src/core/Tooltip/index.test.js +102 -0
- package/dist/src/core/Tooltip/style.d.ts +23 -0
- package/dist/src/core/Tooltip/style.js +47 -0
- package/dist/src/core/TooltipCondensed/TooltipCondensed.namespace-test.d.ts +1 -0
- package/dist/src/core/TooltipCondensed/TooltipCondensed.namespace-test.js +7 -0
- package/dist/src/core/TooltipCondensed/index.d.ts +13 -0
- package/dist/src/core/TooltipCondensed/index.js +43 -0
- package/dist/src/core/TooltipCondensed/index.stories.d.ts +27 -0
- package/dist/src/core/TooltipCondensed/index.stories.js +72 -0
- package/dist/src/core/TooltipCondensed/index.test.d.ts +1 -0
- package/dist/src/core/TooltipCondensed/index.test.js +85 -0
- package/dist/src/core/TooltipCondensed/style.d.ts +6 -0
- package/dist/src/core/TooltipCondensed/style.js +22 -0
- package/dist/src/core/TooltipTable/TooltipTable.namespace-test.d.ts +1 -0
- package/dist/src/core/TooltipTable/TooltipTable.namespace-test.js +23 -0
- package/dist/src/core/TooltipTable/__snapshots__/index.test.js.snap +272 -0
- package/dist/src/core/TooltipTable/index.d.ts +8 -0
- package/dist/src/core/TooltipTable/index.js +35 -0
- package/dist/src/core/TooltipTable/index.stories.d.ts +32 -0
- package/dist/src/core/TooltipTable/index.stories.js +128 -0
- package/dist/src/core/TooltipTable/index.test.d.ts +1 -0
- package/dist/src/core/TooltipTable/index.test.js +109 -0
- package/dist/src/core/TooltipTable/style.d.ts +25 -0
- package/dist/src/core/TooltipTable/style.js +46 -0
- package/dist/src/core/styles/common/constants/black.d.ts +3 -0
- package/dist/src/core/styles/common/constants/black.js +7 -0
- package/dist/src/core/styles/common/constants/boxShadows.d.ts +5 -0
- package/dist/src/core/styles/common/constants/boxShadows.js +9 -0
- package/dist/src/core/styles/common/constants/fontWeights.d.ts +7 -0
- package/dist/src/core/styles/common/constants/fontWeights.js +11 -0
- package/dist/src/core/styles/common/constants/gray.d.ts +8 -0
- package/dist/src/core/styles/common/constants/gray.js +12 -0
- package/dist/src/core/styles/common/constants/spaces.d.ts +11 -0
- package/dist/src/core/styles/common/constants/spaces.js +15 -0
- package/dist/src/core/styles/common/constants/white.d.ts +3 -0
- package/dist/src/core/styles/common/constants/white.js +7 -0
- package/dist/src/core/styles/common/defaultTheme.d.ts +129 -0
- package/dist/src/core/styles/common/defaultTheme.js +414 -0
- package/dist/src/core/styles/common/mixins/fonts.d.ts +27 -0
- package/dist/src/core/styles/common/mixins/fonts.js +60 -0
- package/dist/src/core/styles/common/selectors/theme.d.ts +15 -0
- package/dist/src/core/styles/common/selectors/theme.js +63 -0
- package/dist/src/core/styles/index.d.ts +3 -0
- package/dist/src/core/styles/index.js +19 -0
- package/dist/src/index.d.ts +100 -0
- package/dist/src/index.js +170 -0
- package/dist/tsconfig-namespace-check.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
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 style_1 = require("./style");
|
|
16
|
+
/**
|
|
17
|
+
* @see https://mui.com/material-ui/react-alert/
|
|
18
|
+
*/
|
|
19
|
+
var Alert = function (props) {
|
|
20
|
+
return (0, jsx_runtime_1.jsx)(style_1.StyledAlert, __assign({}, props));
|
|
21
|
+
};
|
|
22
|
+
exports.default = Alert;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: {
|
|
5
|
+
args: {
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
parameters: {
|
|
9
|
+
snapshot: {
|
|
10
|
+
skip: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const SnackbarAlert: () => JSX.Element;
|
|
15
|
+
export declare const Test: {
|
|
16
|
+
args: {
|
|
17
|
+
text: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.Test = exports.SnackbarAlert = exports.Default = void 0;
|
|
22
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
23
|
+
var icons_material_1 = require("@mui/icons-material");
|
|
24
|
+
var material_1 = require("@mui/material");
|
|
25
|
+
var styles_1 = require("@mui/material/styles");
|
|
26
|
+
var react_1 = __importDefault(require("react"));
|
|
27
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
28
|
+
var defaultTheme_1 = require("../styles/common/defaultTheme");
|
|
29
|
+
var index_1 = __importDefault(require("./index"));
|
|
30
|
+
var DismissButton = (0, styles_1.styled)(Button_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-left: -", "px;\n padding-bottom: 0;\n font-size: 12px;\n line-height: 18px;\n letter-spacing: 1px;\n font-weight: 600;\n &:hover {\n background: none;\n }\n"], ["\n margin-left: -", "px;\n padding-bottom: 0;\n font-size: 12px;\n line-height: 18px;\n letter-spacing: 1px;\n font-weight: 600;\n &:hover {\n background: none;\n }\n"])), defaultTheme_1.defaultTheme.spacing(3));
|
|
31
|
+
var Demo = function (props) {
|
|
32
|
+
var text = props.text;
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(index_1.default, __assign({ icon: (0, jsx_runtime_1.jsx)(icons_material_1.CheckCircleOutline, {}), onClose: function () { } }, props, { children: text })));
|
|
34
|
+
};
|
|
35
|
+
exports.default = {
|
|
36
|
+
argTypes: {
|
|
37
|
+
text: {
|
|
38
|
+
control: { type: "text" },
|
|
39
|
+
required: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
component: Demo,
|
|
43
|
+
title: "Alert - To Be Depreciated",
|
|
44
|
+
};
|
|
45
|
+
exports.Default = {
|
|
46
|
+
args: {
|
|
47
|
+
text: "This is an alert!",
|
|
48
|
+
},
|
|
49
|
+
parameters: {
|
|
50
|
+
snapshot: {
|
|
51
|
+
skip: true,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
var SnackbarAlert = function () {
|
|
56
|
+
var _a = react_1.default.useState(false), open = _a[0], setOpen = _a[1];
|
|
57
|
+
var handleOpen = function () { return setOpen(true); };
|
|
58
|
+
var handleClose = function () { return setOpen(false); };
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Button_1.default, { sdsType: "primary", sdsStyle: "square", onClick: handleOpen, children: "Open alert" }), (0, jsx_runtime_1.jsx)(material_1.Snackbar, { anchorOrigin: {
|
|
60
|
+
horizontal: "right",
|
|
61
|
+
vertical: "top",
|
|
62
|
+
}, open: open, autoHideDuration: 6000, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(index_1.default, { className: "elevated", severity: "info", children: [(0, jsx_runtime_1.jsx)("div", { children: "This is a snackbar alert!" }), (0, jsx_runtime_1.jsx)(DismissButton, { onClick: handleClose, children: "DISMISS" })] }) }) })] }));
|
|
63
|
+
};
|
|
64
|
+
exports.SnackbarAlert = SnackbarAlert;
|
|
65
|
+
exports.Test = {
|
|
66
|
+
args: {
|
|
67
|
+
text: "Test Alert!",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledAlert: import("@emotion/styled").StyledComponent<import("@mui/material").AlertProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StyledAlert = void 0;
|
|
8
|
+
var material_1 = require("@mui/material");
|
|
9
|
+
var styles_1 = require("@mui/material/styles");
|
|
10
|
+
var styles_2 = require("../styles");
|
|
11
|
+
var defaultTheme_1 = require("../styles/common/defaultTheme");
|
|
12
|
+
exports.StyledAlert = (0, styles_1.styled)(material_1.Alert)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
13
|
+
var colors = (0, styles_2.getColors)(props);
|
|
14
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
15
|
+
var shadows = (0, styles_2.getShadows)(props);
|
|
16
|
+
var _a = props.severity, severity = _a === void 0 ? "success" : _a;
|
|
17
|
+
var borderColor = (colors && colors[severity][400]) || "black";
|
|
18
|
+
var alertColor = (colors && colors[severity][100]) || "white";
|
|
19
|
+
var iconColor = (colors && colors[severity][400]) || "black";
|
|
20
|
+
var backgroundColor = colors && colors[severity][100];
|
|
21
|
+
return "\n background-color: ".concat(backgroundColor, ";\n margin: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px 0;\n color: ").concat(defaultTheme_1.defaultTheme.palette.text.primary, ";\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px\n ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px 9px;\n background-color: ").concat(alertColor, ";\n &.elevated {\n border-left: 5px solid;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.s, ";\n border-color: ").concat(borderColor, ";\n }\n .MuiAlert-icon {\n path {\n fill: ").concat(iconColor, ";\n }\n }\n ");
|
|
22
|
+
});
|
|
23
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
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 components_1 = require("@czi-sds/components");
|
|
16
|
+
var BannerNameSpaceTest = function (props) {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Banner, __assign({}, props, { dismissible: true, sdsType: "primary", children: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nesciunt aliquid maxime soluta voluptas expedita molestias neque saepe aperiam amet enim natus placeat, tempore doloribus odio reiciendis repellat? Dolorem, voluptatem tempore." })));
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
74
|
+
var story_utils_1 = require("@chanzuckerberg/story-utils");
|
|
75
|
+
var react_1 = require("@storybook/react");
|
|
76
|
+
var react_2 = require("@testing-library/react");
|
|
77
|
+
var snapshotTestStoryFile = __importStar(require("./index.stories"));
|
|
78
|
+
var index_stories_1 = __importStar(require("./index.stories"));
|
|
79
|
+
// Returns a component that already contain all decorators from story level, meta level and global level.
|
|
80
|
+
var Test = (0, react_1.composeStory)(index_stories_1.Test, index_stories_1.default);
|
|
81
|
+
describe("<Banner />", function () {
|
|
82
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
83
|
+
it("renders banner component", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
+
var banner;
|
|
85
|
+
return __generator(this, function (_a) {
|
|
86
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args)));
|
|
87
|
+
banner = react_2.screen.getByRole("banner");
|
|
88
|
+
expect(banner).not.toBeNull();
|
|
89
|
+
return [2 /*return*/];
|
|
90
|
+
});
|
|
91
|
+
}); });
|
|
92
|
+
it("renders text given to it", function () {
|
|
93
|
+
var text = "this is a test component";
|
|
94
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args, { textChild: text })));
|
|
95
|
+
var bannerText = react_2.screen.getByText(text);
|
|
96
|
+
expect(bannerText).not.toBeNull();
|
|
97
|
+
});
|
|
98
|
+
it("can be dismissed", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
99
|
+
var banner, closeButton, click, banner2;
|
|
100
|
+
return __generator(this, function (_a) {
|
|
101
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args)));
|
|
102
|
+
banner = react_2.screen.getByRole("banner");
|
|
103
|
+
expect(banner).not.toBeNull();
|
|
104
|
+
closeButton = react_2.screen.getByRole("button");
|
|
105
|
+
click = new MouseEvent("click", {
|
|
106
|
+
bubbles: true,
|
|
107
|
+
cancelable: true,
|
|
108
|
+
});
|
|
109
|
+
(0, react_2.fireEvent)(closeButton, click);
|
|
110
|
+
banner2 = react_2.screen.queryByRole("banner");
|
|
111
|
+
expect(banner2).toBeNull();
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
});
|
|
114
|
+
}); });
|
|
115
|
+
it("executes callback on close", function () {
|
|
116
|
+
var onClose = jest.fn();
|
|
117
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args, { onClose: onClose })));
|
|
118
|
+
var closeButton = react_2.screen.getByRole("button");
|
|
119
|
+
var click = new MouseEvent("click", {
|
|
120
|
+
bubbles: true,
|
|
121
|
+
cancelable: true,
|
|
122
|
+
});
|
|
123
|
+
(0, react_2.fireEvent)(closeButton, click);
|
|
124
|
+
expect(onClose).toHaveBeenCalledTimes(1);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonIconSizeToTypes } from "../ButtonIcon";
|
|
3
|
+
import { BannerExtraProps } from "./style";
|
|
4
|
+
export interface BannerProps<ButtonIconSize extends keyof ButtonIconSizeToTypes> extends BannerExtraProps<ButtonIconSize> {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
dismissed?: boolean;
|
|
7
|
+
dismissible?: boolean;
|
|
8
|
+
onClose?: (e: React.MouseEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const Banner: React.ForwardRefExoticComponent<BannerProps<keyof ButtonIconSizeToTypes> & React.RefAttributes<HTMLDivElement | null>>;
|
|
11
|
+
export default Banner;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
29
|
+
var react_1 = require("react");
|
|
30
|
+
var Icon_1 = __importDefault(require("../Icon"));
|
|
31
|
+
var style_1 = require("./style");
|
|
32
|
+
var Banner = (0, react_1.forwardRef)(function Banner(props, ref) {
|
|
33
|
+
var children = props.children, dismissed = props.dismissed, _a = props.dismissible, dismissible = _a === void 0 ? true : _a, onClose = props.onClose, sdsType = props.sdsType, rest = __rest(props, ["children", "dismissed", "dismissible", "onClose", "sdsType"]);
|
|
34
|
+
var _b = (0, react_1.useState)(false), wasDismissed = _b[0], setWasDismissed = _b[1];
|
|
35
|
+
if (dismissed || wasDismissed)
|
|
36
|
+
return null;
|
|
37
|
+
var handleClose = function (e) {
|
|
38
|
+
if (dismissed === undefined) {
|
|
39
|
+
// let the component be uncontrolled
|
|
40
|
+
setWasDismissed(true);
|
|
41
|
+
}
|
|
42
|
+
if (onClose)
|
|
43
|
+
onClose(e);
|
|
44
|
+
};
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(style_1.StyledBanner, __assign({ role: "banner", sdsType: sdsType, ref: ref }, rest, { children: [(0, jsx_runtime_1.jsxs)(style_1.Centered, { children: [(0, jsx_runtime_1.jsx)(style_1.IconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { sdsIcon: "infoCircle", sdsSize: "l", sdsType: "static" }) }), children] }), dismissible && ((0, jsx_runtime_1.jsx)(style_1.StyledButtonIcon, { "aria-label": "Close", bannerType: sdsType, sdsType: "tertiary", sdsSize: "small", onClick: handleClose, sdsIcon: "xMark" }))] })));
|
|
46
|
+
});
|
|
47
|
+
exports.default = Banner;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Args } from "@storybook/react";
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, Args>;
|
|
3
|
+
export default _default;
|
|
4
|
+
export declare const Default: {
|
|
5
|
+
args: {
|
|
6
|
+
dismissed: boolean;
|
|
7
|
+
dismissible: boolean;
|
|
8
|
+
sdsType: string;
|
|
9
|
+
textChild: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const LivePreview: {
|
|
13
|
+
args: {
|
|
14
|
+
dismissible: boolean;
|
|
15
|
+
sdsType: string;
|
|
16
|
+
textChild: string;
|
|
17
|
+
};
|
|
18
|
+
parameters: {
|
|
19
|
+
axe: {
|
|
20
|
+
disabledRules: string[];
|
|
21
|
+
};
|
|
22
|
+
controls: {
|
|
23
|
+
exclude: string[];
|
|
24
|
+
};
|
|
25
|
+
snapshot: {
|
|
26
|
+
skip: boolean;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
render: (args: Args) => JSX.Element;
|
|
30
|
+
};
|
|
31
|
+
export declare const Test: {
|
|
32
|
+
args: {
|
|
33
|
+
dismissible: boolean;
|
|
34
|
+
sdsType: string;
|
|
35
|
+
textChild: string;
|
|
36
|
+
};
|
|
37
|
+
parameters: {
|
|
38
|
+
controls: {
|
|
39
|
+
exclude: string[];
|
|
40
|
+
};
|
|
41
|
+
snapshot: {
|
|
42
|
+
skip: boolean;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
render: (props: Args) => JSX.Element;
|
|
46
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
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 __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.Test = exports.LivePreview = exports.Default = void 0;
|
|
22
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
23
|
+
var styles_1 = require("@mui/material/styles");
|
|
24
|
+
var index_1 = __importDefault(require("./index"));
|
|
25
|
+
var BANNER_TEXT = "Banner text lorem ipsum dolor mit";
|
|
26
|
+
var Banner = function (props) {
|
|
27
|
+
var sdsType = props.sdsType, textChild = props.textChild;
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(index_1.default, __assign({ sdsType: sdsType }, props, { children: textChild })));
|
|
29
|
+
};
|
|
30
|
+
exports.default = {
|
|
31
|
+
argTypes: {
|
|
32
|
+
dismissed: {
|
|
33
|
+
control: { type: "boolean" },
|
|
34
|
+
},
|
|
35
|
+
dismissible: {
|
|
36
|
+
control: { type: "boolean" },
|
|
37
|
+
},
|
|
38
|
+
sdsType: {
|
|
39
|
+
control: { type: "radio" },
|
|
40
|
+
options: ["primary", "secondary"],
|
|
41
|
+
required: true,
|
|
42
|
+
},
|
|
43
|
+
textChild: {
|
|
44
|
+
control: { type: "text" },
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
component: Banner,
|
|
49
|
+
parameters: {
|
|
50
|
+
axe: {
|
|
51
|
+
disabledRules: ["landmark-no-duplicate-banner", "landmark-unique"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
title: "Banner",
|
|
55
|
+
};
|
|
56
|
+
// Default
|
|
57
|
+
exports.Default = {
|
|
58
|
+
args: {
|
|
59
|
+
dismissed: false,
|
|
60
|
+
dismissible: true,
|
|
61
|
+
sdsType: "primary",
|
|
62
|
+
textChild: BANNER_TEXT,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
// Live Preview
|
|
66
|
+
var StyledBanner = (0, styles_1.styled)(index_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: Crimson;\n"], ["\n background-color: Crimson;\n"])));
|
|
67
|
+
var LivePreviewDemo = function () {
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { padding: "24px", width: "600px" }, children: [(0, jsx_runtime_1.jsx)(index_1.default, { dismissible: true, sdsType: "primary", children: BANNER_TEXT }), (0, jsx_runtime_1.jsx)("div", { style: { height: "24px" } }), (0, jsx_runtime_1.jsx)(index_1.default, { dismissible: true, sdsType: "secondary", children: BANNER_TEXT }), (0, jsx_runtime_1.jsx)("div", { style: { height: "24px" } }), (0, jsx_runtime_1.jsx)(StyledBanner, { sdsType: "primary", children: "Stylable. Should have Crimson background color" })] }));
|
|
69
|
+
};
|
|
70
|
+
exports.LivePreview = {
|
|
71
|
+
args: {
|
|
72
|
+
dismissible: true,
|
|
73
|
+
sdsType: "primary",
|
|
74
|
+
textChild: "test text",
|
|
75
|
+
},
|
|
76
|
+
parameters: {
|
|
77
|
+
axe: {
|
|
78
|
+
disabledRules: ["landmark-no-duplicate-banner", "landmark-unique"],
|
|
79
|
+
},
|
|
80
|
+
controls: {
|
|
81
|
+
exclude: ["dismissible", "sdsType", "textChild", "dismissed"],
|
|
82
|
+
},
|
|
83
|
+
snapshot: {
|
|
84
|
+
skip: true,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
88
|
+
};
|
|
89
|
+
// Test
|
|
90
|
+
exports.Test = {
|
|
91
|
+
args: {
|
|
92
|
+
dismissible: true,
|
|
93
|
+
sdsType: "primary",
|
|
94
|
+
textChild: "test text",
|
|
95
|
+
},
|
|
96
|
+
parameters: {
|
|
97
|
+
controls: {
|
|
98
|
+
exclude: ["dismissible", "sdsType", "textChild", "dismissed"],
|
|
99
|
+
},
|
|
100
|
+
snapshot: {
|
|
101
|
+
skip: true,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
render: function (props) { return ((0, jsx_runtime_1.jsx)(Banner, __assign({}, props, { "data-testid": "banner" }))); },
|
|
105
|
+
};
|
|
106
|
+
var templateObject_1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonIconExtraProps, ButtonIconSizeToTypes } from "../ButtonIcon/style";
|
|
3
|
+
import { CommonThemeProps } from "../styles";
|
|
4
|
+
export interface BannerExtraProps<ButtonIconSize extends keyof ButtonIconSizeToTypes> extends CommonThemeProps {
|
|
5
|
+
sdsType: ButtonIconSizeToTypes[ButtonIconSize];
|
|
6
|
+
}
|
|
7
|
+
export declare const Centered: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const IconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & ButtonIconExtraProps<keyof ButtonIconSizeToTypes>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
export declare const StyledButtonIcon: import("@emotion/styled").StyledComponent<Pick<ButtonIconExtraProps<keyof ButtonIconSizeToTypes> & Omit<import("@mui/material").IconButtonProps, "content" | "autoFocus" | "nonce" | "rel" | "rev"> & import("../ButtonIcon").ButtonIconInternalProps<keyof import("../Icon").IconNameToSizes>, keyof import("@mui/material/OverridableComponent").CommonProps | "onChange" | "children" | "sx" | "color" | "translate" | "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "name" | "type" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "edge" | keyof ButtonIconExtraProps<keyof ButtonIconSizeToTypes> | keyof import("../ButtonIcon").ButtonIconInternalProps<keyof import("../Icon").IconNameToSizes>> & import("react").RefAttributes<HTMLButtonElement | null> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & ButtonIconExtraProps<keyof ButtonIconSizeToTypes> & {
|
|
10
|
+
bannerType: string;
|
|
11
|
+
}, {}, {}>;
|
|
12
|
+
export declare const Text: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & CommonThemeProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
|
+
export declare const StyledBanner: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & BannerExtraProps<keyof ButtonIconSizeToTypes>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,55 @@
|
|
|
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.StyledBanner = exports.Text = exports.StyledButtonIcon = exports.IconWrapper = exports.Centered = void 0;
|
|
11
|
+
var styles_1 = require("@mui/material/styles");
|
|
12
|
+
var ButtonIcon_1 = __importDefault(require("../ButtonIcon"));
|
|
13
|
+
var styles_2 = require("../styles");
|
|
14
|
+
exports.Centered = (0, styles_1.styled)("div")(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1 1 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n flex: 1 1 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
|
|
15
|
+
exports.IconWrapper = (0, styles_1.styled)("div")(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
16
|
+
var iconSizes = (0, styles_2.getIconSizes)(props);
|
|
17
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
18
|
+
return "\n height: ".concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.l.height, "px;\n margin-right: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.m, "px;\n ");
|
|
19
|
+
});
|
|
20
|
+
var doNotForwardPropsButtonIcon = ["bannerType", "textChild"];
|
|
21
|
+
exports.StyledButtonIcon = (0, styles_1.styled)(ButtonIcon_1.default, {
|
|
22
|
+
shouldForwardProp: function (prop) {
|
|
23
|
+
return !doNotForwardPropsButtonIcon.includes(prop);
|
|
24
|
+
},
|
|
25
|
+
})(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), function (props) {
|
|
26
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
27
|
+
return "\n flex: 0 0 auto;\n margin: ".concat(spaces === null || spaces === void 0 ? void 0 : spaces.l, "px;\n ");
|
|
28
|
+
}, function (props) {
|
|
29
|
+
var bannerType = props.bannerType;
|
|
30
|
+
var colors = (0, styles_2.getColors)(props);
|
|
31
|
+
if (bannerType !== "primary")
|
|
32
|
+
return "";
|
|
33
|
+
return "\n svg:hover {\n fill: ".concat(colors === null || colors === void 0 ? void 0 : colors.primary[300], ";\n }\n ");
|
|
34
|
+
});
|
|
35
|
+
exports.Text = (0, styles_1.styled)("div")(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), styles_2.fontBodyS, function (props) {
|
|
36
|
+
var typography = (0, styles_2.getTypography)(props);
|
|
37
|
+
return "\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n ");
|
|
38
|
+
});
|
|
39
|
+
var primary = function (props) {
|
|
40
|
+
var colors = (0, styles_2.getColors)(props);
|
|
41
|
+
return "\n background-color: ".concat(colors === null || colors === void 0 ? void 0 : colors.info[400], ";\n color: white;\n svg {\n fill: white;\n }\n ");
|
|
42
|
+
};
|
|
43
|
+
var secondary = function (props) {
|
|
44
|
+
var colors = (0, styles_2.getColors)(props);
|
|
45
|
+
return "\n background-color: ".concat(colors === null || colors === void 0 ? void 0 : colors.info[100], ";\n color: black;\n ");
|
|
46
|
+
};
|
|
47
|
+
var doNotForwardProps = ["sdsType", "textChild"];
|
|
48
|
+
exports.StyledBanner = (0, styles_1.styled)("div", {
|
|
49
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
50
|
+
})(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n height: 40px;\n width: 100%;\n\n ", "\n\n ", "\n"], ["\n display: flex;\n align-items: center;\n height: 40px;\n width: 100%;\n\n ", "\n\n ", "\n"])), styles_2.fontBodyS, function (props) {
|
|
51
|
+
var sdsType = props.sdsType;
|
|
52
|
+
var typography = (0, styles_2.getTypography)(props);
|
|
53
|
+
return "\n ".concat(sdsType === "primary" ? primary(props) : "", "\n ").concat(sdsType === "secondary" ? secondary(props) : "", "\n font-family: ").concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n ");
|
|
54
|
+
});
|
|
55
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
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 components_1 = require("@czi-sds/components");
|
|
16
|
+
var ButtonNameSpaceTest = function (props) {
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(components_1.Button, __assign({ sdsType: "primary", sdsStyle: "rounded" }, props, { children: "Button" })));
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ButtonProps as RawButtonProps } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface SdsProps {
|
|
4
|
+
isAllCaps?: boolean;
|
|
5
|
+
isRounded?: boolean;
|
|
6
|
+
sdsStyle?: "minimal" | "rounded" | "square";
|
|
7
|
+
sdsType?: "primary" | "secondary";
|
|
8
|
+
}
|
|
9
|
+
export type ButtonProps<C extends React.ElementType = "button"> = Omit<RawButtonProps<C, {
|
|
10
|
+
component?: C;
|
|
11
|
+
}>, "nonce" | "rev" | "rel" | "autoFocus" | "content"> & SdsProps;
|
|
12
|
+
/**
|
|
13
|
+
* @see https://mui.com/material-ui/react-button/
|
|
14
|
+
*/
|
|
15
|
+
declare const Button: React.ForwardRefExoticComponent<Pick<Omit<RawButtonProps<React.ElementType<any>, {
|
|
16
|
+
component?: React.ElementType<any> | undefined;
|
|
17
|
+
}>, "content" | "autoFocus" | "nonce" | "rel" | "rev"> & SdsProps, string | number | symbol> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
+
export default Button;
|