@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,264 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
+
t[p[i]] = s[p[i]];
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.Test = exports.MinimalLivePreview = exports.SquareLivePreview = exports.RoundLivePreview = exports.Default = void 0;
|
|
33
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
34
|
+
var styles_1 = require("@mui/material/styles");
|
|
35
|
+
var react_1 = require("react");
|
|
36
|
+
var utils_1 = require("src/common/utils");
|
|
37
|
+
var DropdownMenu_1 = __importDefault(require("../DropdownMenu"));
|
|
38
|
+
var index_1 = __importDefault(require("./index"));
|
|
39
|
+
var StyledInputDropdown = (0, styles_1.styled)(index_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
40
|
+
var width = _a.width;
|
|
41
|
+
return "\n width: fit-content;\n max-width: ".concat(width || 250, "px;\n ");
|
|
42
|
+
});
|
|
43
|
+
var InputDropdown = function (props) {
|
|
44
|
+
var disabled = props.disabled, fullWidth = props.fullWidth, label = props.label, sdsStyle = props.sdsStyle, multiple = props.multiple, propValue = props.value, rest = __rest(props, ["disabled", "fullWidth", "label", "sdsStyle", "multiple", "value"]);
|
|
45
|
+
var _a = (0, react_1.useState)(null), anchorEl = _a[0], setAnchorEl = _a[1];
|
|
46
|
+
var _b = (0, react_1.useState)(false), open = _b[0], setOpen = _b[1];
|
|
47
|
+
var _c = (0, react_1.useState)(), details = _c[0], setDetials = _c[1];
|
|
48
|
+
var _d = (0, react_1.useState)(), counter = _d[0], setCounter = _d[1];
|
|
49
|
+
var _e = (0, react_1.useState)(), inputDropdownValue = _e[0], setInputDropdownValue = _e[1];
|
|
50
|
+
var _f = (0, react_1.useState)(getInitialValue()), value = _f[0], setValue = _f[1];
|
|
51
|
+
var _g = (0, react_1.useState)(getInitialValue()), pendingValue = _g[0], setPendingValue = _g[1];
|
|
52
|
+
var isControlled = propValue !== undefined;
|
|
53
|
+
(0, react_1.useEffect)(function () {
|
|
54
|
+
if (isControlled) {
|
|
55
|
+
setValue(propValue);
|
|
56
|
+
}
|
|
57
|
+
}, [propValue]);
|
|
58
|
+
var handleClick = function (event) {
|
|
59
|
+
if (open) {
|
|
60
|
+
setOpen(false);
|
|
61
|
+
if (anchorEl) {
|
|
62
|
+
anchorEl.focus();
|
|
63
|
+
}
|
|
64
|
+
setAnchorEl(null);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
setAnchorEl(event.currentTarget);
|
|
68
|
+
setOpen(true);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var handleChange = function (_, newValue) {
|
|
72
|
+
if (!multiple) {
|
|
73
|
+
setOpen(false);
|
|
74
|
+
setValue(newValue);
|
|
75
|
+
setCounter(undefined);
|
|
76
|
+
if (newValue && !Array.isArray(newValue)) {
|
|
77
|
+
setInputDropdownValue(newValue.name);
|
|
78
|
+
if (newValue === null || newValue === void 0 ? void 0 : newValue.details)
|
|
79
|
+
setDetials(newValue === null || newValue === void 0 ? void 0 : newValue.details);
|
|
80
|
+
else
|
|
81
|
+
setDetials(undefined);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
setDetials(undefined);
|
|
85
|
+
setInputDropdownValue(undefined);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
setPendingValue(newValue);
|
|
90
|
+
setCounter(newValue === null || newValue === void 0 ? void 0 : newValue.length.toString());
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
var handleClose = function () { };
|
|
94
|
+
var handleClickAway = function () {
|
|
95
|
+
if (open) {
|
|
96
|
+
setOpen(false);
|
|
97
|
+
}
|
|
98
|
+
if (multiple) {
|
|
99
|
+
setValue(pendingValue);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
function getInitialValue() {
|
|
103
|
+
if (isControlled) {
|
|
104
|
+
return propValue;
|
|
105
|
+
}
|
|
106
|
+
return multiple ? [] : null;
|
|
107
|
+
}
|
|
108
|
+
var options = [
|
|
109
|
+
{
|
|
110
|
+
details: "Details",
|
|
111
|
+
name: "Menu Item 1",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
details: "A very long Details for the second Menu Item",
|
|
115
|
+
name: "Menu Item 2",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "Menu Item 3",
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["The \"Value\" variant of InputDropdown cannot be set to \"multiple\". ", (0, jsx_runtime_1.jsx)("br", {}), "If you set sdsType=\"value\" and multiple=\"true\", the component will revert to displaying a label and a counter."] }), fullWidth ? ((0, jsx_runtime_1.jsx)(index_1.default, __assign({ disabled: disabled, label: label, onClick: handleClick, sdsStage: open ? "userInput" : "default", sdsStyle: sdsStyle, multiple: multiple, details: details, value: inputDropdownValue, counter: counter, "data-testid": "InputDropdown" }, rest))) : ((0, jsx_runtime_1.jsx)(StyledInputDropdown, __assign({ disabled: disabled, label: label, onClick: handleClick, sdsStage: open ? "userInput" : "default", sdsStyle: sdsStyle, multiple: multiple, details: details, value: inputDropdownValue, counter: counter, "data-testid": "InputDropdown" }, rest))), (0, jsx_runtime_1.jsx)(DropdownMenu_1.default, { open: open, anchorEl: anchorEl, onClose: handleClose, onChange: handleChange, search: false, multiple: multiple, disableCloseOnSelect: multiple, options: options, value: multiple ? pendingValue : value, onClickAway: handleClickAway })] }));
|
|
122
|
+
};
|
|
123
|
+
exports.default = {
|
|
124
|
+
argTypes: {
|
|
125
|
+
counter: {
|
|
126
|
+
control: {
|
|
127
|
+
type: "number",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
details: {
|
|
131
|
+
control: {
|
|
132
|
+
type: "text",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
disabled: {
|
|
136
|
+
control: {
|
|
137
|
+
type: "boolean",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
intent: {
|
|
141
|
+
control: {
|
|
142
|
+
type: "radio",
|
|
143
|
+
},
|
|
144
|
+
options: ["default", "error", "warning"],
|
|
145
|
+
},
|
|
146
|
+
label: {
|
|
147
|
+
control: {
|
|
148
|
+
type: "text",
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
multiple: {
|
|
152
|
+
control: {
|
|
153
|
+
type: "boolean",
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
sdsStage: {
|
|
157
|
+
control: {
|
|
158
|
+
type: "radio",
|
|
159
|
+
},
|
|
160
|
+
options: ["default", "userInput"],
|
|
161
|
+
},
|
|
162
|
+
sdsStyle: {
|
|
163
|
+
control: {
|
|
164
|
+
type: "select",
|
|
165
|
+
},
|
|
166
|
+
options: ["square", "rounded", "minimal"],
|
|
167
|
+
},
|
|
168
|
+
sdsType: {
|
|
169
|
+
control: {
|
|
170
|
+
type: "radio",
|
|
171
|
+
},
|
|
172
|
+
options: ["label", "value"],
|
|
173
|
+
},
|
|
174
|
+
shouldPutAColonAfterLabel: {
|
|
175
|
+
control: {
|
|
176
|
+
type: "boolean",
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
shouldTruncateMinimalDetails: {
|
|
180
|
+
control: {
|
|
181
|
+
type: "boolean",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
width: {
|
|
185
|
+
control: {
|
|
186
|
+
type: "number",
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
component: InputDropdown,
|
|
191
|
+
title: "Inputs/InputDropdown",
|
|
192
|
+
};
|
|
193
|
+
// Default
|
|
194
|
+
exports.Default = {
|
|
195
|
+
args: {
|
|
196
|
+
disabled: false,
|
|
197
|
+
label: "Label",
|
|
198
|
+
sdsStyle: "square",
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
// Live Preview
|
|
202
|
+
var storyRow = {
|
|
203
|
+
// lprins: This prevents InputDropdown component from stretching height in grid
|
|
204
|
+
alignItems: "start",
|
|
205
|
+
display: "flex",
|
|
206
|
+
};
|
|
207
|
+
var LivePreviewDemo = function (props) {
|
|
208
|
+
var sdsStyle = props.sdsStyle;
|
|
209
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: storyRow, children: [(0, jsx_runtime_1.jsx)(StyledInputDropdown, { disabled: false, label: "Label", onClick: utils_1.noop, sdsStage: "default", sdsStyle: sdsStyle, sdsType: "label", multiple: false, "data-testid": "InputDropdown" }), (0, jsx_runtime_1.jsx)(StyledInputDropdown, { disabled: false, label: "Label", onClick: utils_1.noop, sdsStage: "default", sdsStyle: sdsStyle, sdsType: "value", value: "Value", multiple: false, "data-testid": "InputDropdown", style: { marginLeft: 80, marginRight: 16 } }), (0, jsx_runtime_1.jsx)(StyledInputDropdown, { disabled: false, label: "Label", onClick: utils_1.noop, sdsStage: "default", sdsStyle: sdsStyle, sdsType: "value", value: "Value", details: "Details", shouldPutAColonAfterLabel: false, multiple: false, "data-testid": "InputDropdown" })] }));
|
|
210
|
+
};
|
|
211
|
+
exports.RoundLivePreview = {
|
|
212
|
+
args: {
|
|
213
|
+
fullWidth: true,
|
|
214
|
+
sdsStyle: "rounded",
|
|
215
|
+
},
|
|
216
|
+
parameters: {
|
|
217
|
+
snapshot: {
|
|
218
|
+
skip: true,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
222
|
+
};
|
|
223
|
+
exports.SquareLivePreview = {
|
|
224
|
+
args: {
|
|
225
|
+
fullWidth: true,
|
|
226
|
+
sdsStyle: "square",
|
|
227
|
+
},
|
|
228
|
+
parameters: {
|
|
229
|
+
snapshot: {
|
|
230
|
+
skip: true,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(LivePreviewDemo, __assign({}, args)); },
|
|
234
|
+
};
|
|
235
|
+
var MinimalLivePreviewDemo = function () {
|
|
236
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: storyRow, children: [(0, jsx_runtime_1.jsx)(StyledInputDropdown, { disabled: false, label: "Label", onClick: utils_1.noop, sdsStage: "default", sdsStyle: "minimal", sdsType: "label", multiple: false, "data-testid": "InputDropdown" }), (0, jsx_runtime_1.jsx)(StyledInputDropdown, { disabled: false, label: "Label", onClick: utils_1.noop, sdsStage: "default", sdsStyle: "minimal", sdsType: "value", value: "Value", multiple: false, "data-testid": "InputDropdown", style: { marginLeft: 80, marginRight: 16 } })] }));
|
|
237
|
+
};
|
|
238
|
+
exports.MinimalLivePreview = {
|
|
239
|
+
args: {
|
|
240
|
+
sdsStyle: "minimal",
|
|
241
|
+
},
|
|
242
|
+
parameters: {
|
|
243
|
+
snapshot: {
|
|
244
|
+
skip: true,
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(MinimalLivePreviewDemo, __assign({}, args)); },
|
|
248
|
+
};
|
|
249
|
+
// Test
|
|
250
|
+
exports.Test = {
|
|
251
|
+
args: {
|
|
252
|
+
disabled: false,
|
|
253
|
+
label: "Label",
|
|
254
|
+
multiple: false,
|
|
255
|
+
sdsStyle: "square",
|
|
256
|
+
},
|
|
257
|
+
parameters: {
|
|
258
|
+
snapshot: {
|
|
259
|
+
skip: true,
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
render: function (args) { return (0, jsx_runtime_1.jsx)(InputDropdown, __assign({}, args)); },
|
|
263
|
+
};
|
|
264
|
+
var templateObject_1;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var story_utils_1 = require("@chanzuckerberg/story-utils");
|
|
39
|
+
var react_1 = require("@storybook/react");
|
|
40
|
+
var react_2 = require("@testing-library/react");
|
|
41
|
+
var snapshotTestStoryFile = __importStar(require("./index.stories"));
|
|
42
|
+
var index_stories_1 = __importStar(require("./index.stories"));
|
|
43
|
+
// Returns a component that already contain all decorators from story level, meta level and global level.
|
|
44
|
+
var Test = (0, react_1.composeStory)(index_stories_1.Test, index_stories_1.default);
|
|
45
|
+
describe("<InputDropdown />", function () {
|
|
46
|
+
(0, story_utils_1.generateSnapshots)(snapshotTestStoryFile);
|
|
47
|
+
it("renders InputDropdown component", function () {
|
|
48
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args)));
|
|
49
|
+
var InputDropdownElement = react_2.screen.getByTestId("InputDropdown");
|
|
50
|
+
expect(InputDropdownElement).not.toBeNull();
|
|
51
|
+
});
|
|
52
|
+
it("opens the menu on click", function () {
|
|
53
|
+
(0, react_2.render)((0, jsx_runtime_1.jsx)(Test, __assign({}, Test.args)));
|
|
54
|
+
var InputDropdownElement = react_2.screen.getByTestId("InputDropdown");
|
|
55
|
+
react_2.fireEvent.click(InputDropdownElement);
|
|
56
|
+
expect(react_2.screen.getAllByText("Menu Item 1")).not.toBeNull();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { CommonThemeProps } from "../styles";
|
|
3
|
+
export interface InputDropdownProps extends CommonThemeProps {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
intent?: "default" | "error" | "warning";
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
sdsStage: "default" | "userInput";
|
|
10
|
+
sdsStyle?: "minimal" | "square" | "rounded";
|
|
11
|
+
sdsType?: "label" | "value";
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
details?: ReactNode;
|
|
14
|
+
counter?: ReactNode;
|
|
15
|
+
value?: ReactNode;
|
|
16
|
+
shouldTruncateMinimalDetails?: boolean;
|
|
17
|
+
shouldPutAColonAfterLabel?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const StyledInputDropdown: import("@emotion/styled").StyledComponent<Pick<Omit<import("@mui/material").ButtonProps<import("react").ElementType<any>, {
|
|
20
|
+
component?: import("react").ElementType<any> | undefined;
|
|
21
|
+
}>, "content" | "autoFocus" | "nonce" | "rel" | "rev"> & import("../Button").SdsProps, string | number | symbol> & import("react").RefAttributes<HTMLButtonElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & InputDropdownProps, {}, {}>;
|
|
22
|
+
export declare const StyledDetail: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & CommonThemeProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
23
|
+
interface DetailsAndCounter extends CommonThemeProps {
|
|
24
|
+
details?: InputDropdownProps["details"];
|
|
25
|
+
counter?: InputDropdownProps["counter"];
|
|
26
|
+
sdsType: InputDropdownProps["sdsType"];
|
|
27
|
+
}
|
|
28
|
+
export declare const StyledLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & DetailsAndCounter, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
29
|
+
export declare const StyledCounter: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & CommonThemeProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
30
|
+
interface MinimalDetailsProps extends CommonThemeProps {
|
|
31
|
+
shouldTruncateMinimalDetails: InputDropdownProps["shouldTruncateMinimalDetails"];
|
|
32
|
+
}
|
|
33
|
+
export declare const MinimalDetails: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & MinimalDetailsProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
34
|
+
export declare const LabelWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
35
|
+
isMinimal: boolean;
|
|
36
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
37
|
+
export declare const IconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
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.IconWrapper = exports.LabelWrapper = exports.MinimalDetails = exports.StyledCounter = exports.StyledLabel = exports.StyledDetail = exports.StyledInputDropdown = void 0;
|
|
11
|
+
var react_1 = require("@emotion/react");
|
|
12
|
+
var styles_1 = require("@mui/material/styles");
|
|
13
|
+
var Button_1 = __importDefault(require("../Button"));
|
|
14
|
+
var styles_2 = require("../styles");
|
|
15
|
+
var labelFontBodyS = (0, styles_2.fontBody)("s");
|
|
16
|
+
var labelFontBodyXs = (0, styles_2.fontBody)("xs");
|
|
17
|
+
var inputDropdownStyles = function (props) {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
var colors = (0, styles_2.getColors)(props);
|
|
20
|
+
var palette = (0, styles_2.getPalette)(props);
|
|
21
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
22
|
+
var borders = (0, styles_2.getBorders)(props);
|
|
23
|
+
return (0, react_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: ", ";\n color: ", ";\n cursor: pointer;\n padding: ", "px;\n justify-content: start;\n\n &.MuiButton-text {\n &:hover {\n color: #000;\n }\n\n .styled-label {\n margin-left: ", "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n svg {\n margin-right: ", "px;\n margin-left: ", "px;\n }\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: unset;\n border-color: black;\n color: ", ";\n\n path {\n fill: black;\n }\n\n .styled-label {\n color: #000;\n }\n }\n\n &:active {\n border: ", ";\n color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n &:focus {\n outline-offset: -1px;\n }\n "], ["\n border: ", ";\n color: ", ";\n cursor: pointer;\n padding: ", "px;\n justify-content: start;\n\n &.MuiButton-text {\n &:hover {\n color: #000;\n }\n\n .styled-label {\n margin-left: ", "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n\n svg {\n margin-right: ", "px;\n margin-left: ", "px;\n }\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: unset;\n border-color: black;\n color: ", ";\n\n path {\n fill: black;\n }\n\n .styled-label {\n color: #000;\n }\n }\n\n &:active {\n border: ", ";\n color: ", ";\n\n path {\n fill: ", ";\n }\n }\n\n &:focus {\n outline-offset: -1px;\n }\n "])), borders === null || borders === void 0 ? void 0 : borders.gray[400], (_a = palette === null || palette === void 0 ? void 0 : palette.text) === null || _a === void 0 ? void 0 : _a.primary, spacings === null || spacings === void 0 ? void 0 : spacings.xs, spacings === null || spacings === void 0 ? void 0 : spacings.s, spacings === null || spacings === void 0 ? void 0 : spacings.s, spacings === null || spacings === void 0 ? void 0 : spacings.l, colors === null || colors === void 0 ? void 0 : colors.gray[500], (_b = palette === null || palette === void 0 ? void 0 : palette.text) === null || _b === void 0 ? void 0 : _b.primary, borders === null || borders === void 0 ? void 0 : borders.primary[400], (_c = palette === null || palette === void 0 ? void 0 : palette.text) === null || _c === void 0 ? void 0 : _c.primary, colors === null || colors === void 0 ? void 0 : colors.primary[400]);
|
|
24
|
+
};
|
|
25
|
+
var minimal = function (props) {
|
|
26
|
+
var colors = (0, styles_2.getColors)(props);
|
|
27
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
28
|
+
return (0, react_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n\n /* this is needed to left align the label text */\n align-items: flex-start;\n border: none;\n flex-direction: column;\n padding: ", "px ", "px;\n\n /* Nesting to increase CSS specificity for style override */\n &.MuiButton-text {\n .styled-label {\n margin: 0;\n }\n }\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: ", ";\n border: none;\n }\n\n &:active {\n background-color: ", ";\n border: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n &.MuiButton-root.MuiButton-text > span {\n ", "\n margin-left: 0;\n }\n\n &.MuiButton-root.MuiButton-text svg {\n margin-left: ", "px;\n margin-right: 0;\n }\n "], ["\n ", "\n\n /* this is needed to left align the label text */\n align-items: flex-start;\n border: none;\n flex-direction: column;\n padding: ", "px ", "px;\n\n /* Nesting to increase CSS specificity for style override */\n &.MuiButton-text {\n .styled-label {\n margin: 0;\n }\n }\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n\n &:hover {\n background-color: ", ";\n border: none;\n }\n\n &:active {\n background-color: ", ";\n border: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n &.MuiButton-root.MuiButton-text > span {\n ", "\n margin-left: 0;\n }\n\n &.MuiButton-root.MuiButton-text svg {\n margin-left: ", "px;\n margin-right: 0;\n }\n "])), labelStyle(props), spacings === null || spacings === void 0 ? void 0 : spacings.xs, spacings === null || spacings === void 0 ? void 0 : spacings.s, colors === null || colors === void 0 ? void 0 : colors.gray[500], colors === null || colors === void 0 ? void 0 : colors.gray[500], colors === null || colors === void 0 ? void 0 : colors.gray[100], colors === null || colors === void 0 ? void 0 : colors.gray[100], labelFontBodyS(props), spacings === null || spacings === void 0 ? void 0 : spacings.xs);
|
|
29
|
+
};
|
|
30
|
+
var square = function (props) {
|
|
31
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
32
|
+
return (0, react_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: ", "px;\n height: 34px;\n min-width: 90px;\n "], ["\n border-radius: ", "px;\n height: 34px;\n min-width: 90px;\n "])), corners === null || corners === void 0 ? void 0 : corners.m);
|
|
33
|
+
};
|
|
34
|
+
var rounded = function (props) {
|
|
35
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
36
|
+
return (0, react_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: ", "px;\n height: 34px;\n min-width: 90px;\n "], ["\n border-radius: ", "px;\n height: 34px;\n min-width: 90px;\n "])), corners === null || corners === void 0 ? void 0 : corners.l);
|
|
37
|
+
};
|
|
38
|
+
var userInput = function (props) {
|
|
39
|
+
var _a;
|
|
40
|
+
var colors = (0, styles_2.getColors)(props);
|
|
41
|
+
var palette = (0, styles_2.getPalette)(props);
|
|
42
|
+
return (0, react_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n\n &:hover {\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n }\n "], ["\n ", "\n\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n\n &:hover {\n path {\n fill: ", ";\n }\n\n border-color: ", ";\n }\n "])), props.sdsStyle === "minimal"
|
|
43
|
+
? "& > span, &:hover > span { color: ".concat((_a = palette === null || palette === void 0 ? void 0 : palette.text) === null || _a === void 0 ? void 0 : _a.primary, "; }")
|
|
44
|
+
: "", colors === null || colors === void 0 ? void 0 : colors.primary[400], colors === null || colors === void 0 ? void 0 : colors.primary[400], colors === null || colors === void 0 ? void 0 : colors.primary[400], colors === null || colors === void 0 ? void 0 : colors.primary[400]);
|
|
45
|
+
};
|
|
46
|
+
var warning = function (props) {
|
|
47
|
+
var colors = (0, styles_2.getColors)(props);
|
|
48
|
+
var yellow = colors === null || colors === void 0 ? void 0 : colors.warning[400];
|
|
49
|
+
return (0, react_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n\n &:active {\n border-color: ", ";\n }\n "], ["\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n\n &:active {\n border-color: ", ";\n }\n "])), yellow, yellow, yellow);
|
|
50
|
+
};
|
|
51
|
+
var error = function (props) {
|
|
52
|
+
var colors = (0, styles_2.getColors)(props);
|
|
53
|
+
var red = colors === null || colors === void 0 ? void 0 : colors.error[400];
|
|
54
|
+
return (0, react_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n\n &:active {\n border-color: ", ";\n }\n "], ["\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n\n &:active {\n border-color: ", ";\n }\n "])), red, red, red);
|
|
55
|
+
};
|
|
56
|
+
var isDisabled = function (props) {
|
|
57
|
+
var colors = (0, styles_2.getColors)(props);
|
|
58
|
+
var gray = colors === null || colors === void 0 ? void 0 : colors.gray[300];
|
|
59
|
+
return (0, react_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n "], ["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n path {\n fill: ", ";\n }\n "])), gray, colors === null || colors === void 0 ? void 0 : colors.gray[300], colors === null || colors === void 0 ? void 0 : colors.gray[300]);
|
|
60
|
+
};
|
|
61
|
+
var doNotForwardProps = [
|
|
62
|
+
"intent",
|
|
63
|
+
"open",
|
|
64
|
+
"sdsStage",
|
|
65
|
+
"sdsType",
|
|
66
|
+
"isMinimal",
|
|
67
|
+
"shouldTruncateMinimalDetails",
|
|
68
|
+
"shouldPutAColonAfterLabel",
|
|
69
|
+
];
|
|
70
|
+
exports.StyledInputDropdown = (0, styles_1.styled)(Button_1.default, {
|
|
71
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
72
|
+
})(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", "\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"], ["\n ", "\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"])), labelFontBodyXs, function (props) {
|
|
73
|
+
var disabled = props.disabled, intent = props.intent, open = props.open, sdsStage = props.sdsStage, sdsStyle = props.sdsStyle;
|
|
74
|
+
return (0, react_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), inputDropdownStyles(props), sdsStyle === "minimal" && minimal(props), sdsStyle === "square" && square(props), sdsStyle === "rounded" && rounded(props), open && userInput(props), sdsStage === "userInput" && userInput(props), intent === "warning" && warning(props), intent === "error" && error(props), disabled && isDisabled(props));
|
|
75
|
+
});
|
|
76
|
+
exports.StyledDetail = (0, styles_1.styled)("span", {
|
|
77
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
78
|
+
})(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
79
|
+
var colors = (0, styles_2.getColors)(props);
|
|
80
|
+
var spaces = (0, styles_2.getSpaces)(props);
|
|
81
|
+
return "\n color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n ");
|
|
82
|
+
});
|
|
83
|
+
exports.StyledLabel = (0, styles_1.styled)("span", {
|
|
84
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
85
|
+
})(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
86
|
+
var _a;
|
|
87
|
+
var details = props.details, counter = props.counter, sdsType = props.sdsType;
|
|
88
|
+
var colors = (0, styles_2.getColors)(props);
|
|
89
|
+
var palette = (0, styles_2.getPalette)(props);
|
|
90
|
+
var fontWeights = (0, styles_2.getFontWeights)(props);
|
|
91
|
+
var labelColor = details || counter !== undefined
|
|
92
|
+
? (_a = palette === null || palette === void 0 ? void 0 : palette.text) === null || _a === void 0 ? void 0 : _a.primary
|
|
93
|
+
: colors === null || colors === void 0 ? void 0 : colors.gray[500];
|
|
94
|
+
return "\n color: ".concat(labelColor, ";\n\n font-weight: ").concat(sdsType === "label" ? fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.semibold : fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.regular, ";\n ");
|
|
95
|
+
});
|
|
96
|
+
exports.StyledCounter = (0, styles_1.styled)("span", {
|
|
97
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
98
|
+
})(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
99
|
+
var colors = (0, styles_2.getColors)(props);
|
|
100
|
+
var corners = (0, styles_2.getCorners)(props);
|
|
101
|
+
var spacings = (0, styles_2.getSpaces)(props);
|
|
102
|
+
return "\n background-color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.primary[400], ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.l, "px;\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px;\n margin-left: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px;\n ");
|
|
103
|
+
});
|
|
104
|
+
exports.MinimalDetails = (0, styles_1.styled)("div", {
|
|
105
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
106
|
+
})(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", "\n text-align: left;\n width: 100%;\n\n ", "\n"], ["\n ", "\n text-align: left;\n width: 100%;\n\n ", "\n"])), labelFontBodyS, function (_a) {
|
|
107
|
+
var shouldTruncateMinimalDetails = _a.shouldTruncateMinimalDetails;
|
|
108
|
+
if (shouldTruncateMinimalDetails) {
|
|
109
|
+
return "\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ";
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
exports.LabelWrapper = (0, styles_1.styled)("span", {
|
|
113
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
114
|
+
})(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
115
|
+
var isMinimal = _a.isMinimal;
|
|
116
|
+
return "\n align-items: ".concat(isMinimal ? "center" : undefined, ";\n display: ").concat(isMinimal ? "inline-flex" : "contents", ";\n justify-content: ").concat(isMinimal ? "space-between" : undefined, ";\n width: 100%;\n ");
|
|
117
|
+
});
|
|
118
|
+
exports.IconWrapper = (0, styles_1.styled)("span", {
|
|
119
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps.includes(prop); },
|
|
120
|
+
})(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n margin-left: auto;\n display: flex;\n align-items: center;\n"], ["\n margin-left: auto;\n display: flex;\n align-items: center;\n"])));
|
|
121
|
+
function labelStyle(props) {
|
|
122
|
+
var _a;
|
|
123
|
+
var colors = (0, styles_2.getColors)(props);
|
|
124
|
+
var palette = (0, styles_2.getPalette)(props);
|
|
125
|
+
var labelColor = props.disabled
|
|
126
|
+
? colors === null || colors === void 0 ? void 0 : colors.gray[300]
|
|
127
|
+
: (_a = palette === null || palette === void 0 ? void 0 : palette.text) === null || _a === void 0 ? void 0 : _a.primary;
|
|
128
|
+
return (0, react_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n "], ["\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n "])), labelColor);
|
|
129
|
+
}
|
|
130
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17;
|
|
@@ -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 material_1 = require("@mui/material");
|
|
6
|
+
var InputRadioNameSpaceTest = function (props) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(material_1.RadioGroup, { "aria-labelledby": "demo-radio-buttons-group-label", defaultValue: "demo", name: "radio-buttons-group", children: (0, jsx_runtime_1.jsx)(components_1.InputRadio, { label: "Label", value: "demo" }) }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RadioProps as MUIRadioProps } from "@mui/material";
|
|
2
|
+
import { RadioExtraProps } from "./style";
|
|
3
|
+
export interface RadioContentProps extends Omit<MUIRadioProps, "color" | "defaultChecked" | "nonce" | "rev" | "rel" | "autoFocus" | "content"> {
|
|
4
|
+
label?: string;
|
|
5
|
+
radioProps?: Partial<MUIRadioProps>;
|
|
6
|
+
stage?: "checked" | "unchecked";
|
|
7
|
+
value?: string;
|
|
8
|
+
}
|
|
9
|
+
export type RadioProps = RadioContentProps & RadioExtraProps;
|
|
10
|
+
/**
|
|
11
|
+
* @see https://mui.com/material-ui/react-radio-button/
|
|
12
|
+
*/
|
|
13
|
+
declare const InputRadio: (props: RadioProps) => JSX.Element;
|
|
14
|
+
export default InputRadio;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 material_1 = require("@mui/material");
|
|
16
|
+
var IconRadioChecked_svg_1 = require("../../common/svgs/IconRadioChecked.svg");
|
|
17
|
+
var IconRadioUnchecked_svg_1 = require("../../common/svgs/IconRadioUnchecked.svg");
|
|
18
|
+
var style_1 = require("./style");
|
|
19
|
+
/**
|
|
20
|
+
* @see https://mui.com/material-ui/react-radio-button/
|
|
21
|
+
*/
|
|
22
|
+
var InputRadio = function (props) {
|
|
23
|
+
var label = props.label, caption = props.caption, radioProps = props.radioProps, stage = props.stage, value = props.value;
|
|
24
|
+
if (label === undefined || stage !== undefined) {
|
|
25
|
+
var newProps = void 0;
|
|
26
|
+
switch (stage) {
|
|
27
|
+
case "checked":
|
|
28
|
+
newProps = __assign(__assign({}, props), { checked: true, color: "primary" });
|
|
29
|
+
break;
|
|
30
|
+
case "unchecked":
|
|
31
|
+
newProps = __assign(__assign({}, props), { checked: false, color: "default" });
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
newProps = props;
|
|
35
|
+
}
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(style_1.StyledRadioButton, __assign({}, newProps, { checkedIcon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { fillcontrast: "white", component: IconRadioChecked_svg_1.ReactComponent, viewBox: "0 0 16 16" }), icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { fillcontrast: "white", component: IconRadioUnchecked_svg_1.ReactComponent, viewBox: "0 0 16 16" }) })));
|
|
37
|
+
}
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(style_1.StyledFormControlLabel, { caption: caption, control: (0, jsx_runtime_1.jsx)(style_1.StyledRadioButton, __assign({}, props, { checkedIcon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { fillcontrast: "white", component: IconRadioChecked_svg_1.ReactComponent, viewBox: "0 0 16 16" }), icon: (0, jsx_runtime_1.jsx)(material_1.SvgIcon, { fillcontrast: "white", component: IconRadioUnchecked_svg_1.ReactComponent, viewBox: "0 0 16 16" }) }, radioProps)), label: label, value: value }));
|
|
39
|
+
};
|
|
40
|
+
exports.default = InputRadio;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
caption: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const LivePreview: {
|
|
12
|
+
args: {
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
parameters: {
|
|
16
|
+
snapshot: {
|
|
17
|
+
skip: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
render: (args: Args) => JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export declare const Test: {
|
|
23
|
+
args: {
|
|
24
|
+
label: string;
|
|
25
|
+
};
|
|
26
|
+
parameters: {
|
|
27
|
+
snapshot: {
|
|
28
|
+
skip: boolean;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
render: (args: Args) => JSX.Element;
|
|
32
|
+
};
|