pixel-react 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.prettierrc.js +13 -0
- package/.storybook/main.ts +26 -0
- package/.storybook/preview.ts +26 -0
- package/.yarn/install-state.gz +0 -0
- package/.yarnrc.yml +1 -0
- package/README.md +25 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.scss +0 -0
- package/lib/StyleGuide/ColorPalette/ColorPalette.d.ts +3 -0
- package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
- package/lib/StyleGuide/ColorPalette/colorPaletteList.d.ts +3 -0
- package/lib/StyleGuide/ColorPalette/index.d.ts +1 -0
- package/lib/StyleGuide/ColorPalette/types.d.ts +15 -0
- package/lib/StyleGuide/Typography/Typography.d.ts +3 -0
- package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
- package/lib/StyleGuide/Typography/TypographyList.d.ts +5 -0
- package/lib/StyleGuide/Typography/types.d.ts +8 -0
- package/lib/assets/utils/functionUtils.d.ts +1 -0
- package/lib/components/Accordion/Accordion.d.ts +8 -0
- package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
- package/lib/components/Accordion/index.d.ts +1 -0
- package/lib/components/Accordion/types.d.ts +27 -0
- package/lib/components/AddResourceButton/AddButton.d.ts +4 -0
- package/lib/components/AddResourceButton/AddButton.stories.d.ts +8 -0
- package/lib/components/AddResourceButton/ArrowsButton/ArrowsButton.d.ts +6 -0
- package/lib/components/AddResourceButton/index.d.ts +1 -0
- package/lib/components/AddResourceButton/type.d.ts +65 -0
- package/lib/components/Button/Button.d.ts +5 -0
- package/lib/components/Button/Button.stories.d.ts +12 -0
- package/lib/components/Button/index.d.ts +1 -0
- package/lib/components/Button/types.d.ts +61 -0
- package/lib/components/Charts/DonutChart/DonutChart.d.ts +5 -0
- package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
- package/lib/components/Charts/DonutChart/index.d.ts +1 -0
- package/lib/components/Charts/DonutChart/type.d.ts +13 -0
- package/lib/components/Charts/RadialChart/RadialChart.d.ts +5 -0
- package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
- package/lib/components/Charts/RadialChart/index.d.ts +1 -0
- package/lib/components/Charts/RadialChart/types.d.ts +25 -0
- package/lib/components/Checkbox/Checkbox.d.ts +6 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
- package/lib/components/Checkbox/index.d.ts +1 -0
- package/lib/components/Checkbox/types.d.ts +30 -0
- package/lib/components/Chip/Chip.d.ts +4 -0
- package/lib/components/Chip/Chip.stories.d.ts +14 -0
- package/lib/components/Chip/index.d.ts +1 -0
- package/lib/components/Chip/types.d.ts +18 -0
- package/lib/components/Drawer/Drawer.d.ts +4 -0
- package/lib/components/Drawer/Drawer.stories.d.ts +7 -0
- package/lib/components/Drawer/Types.d.ts +85 -0
- package/lib/components/Drawer/index.d.ts +1 -0
- package/lib/components/ExpandableMenu/ExpandableMenu.d.ts +5 -0
- package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
- package/lib/components/ExpandableMenu/index.d.ts +1 -0
- package/lib/components/ExpandableMenu/types.d.ts +34 -0
- package/lib/components/FileDropzone/Dropzone.d.ts +5 -0
- package/lib/components/FileDropzone/FileDropzone.d.ts +4 -0
- package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
- package/lib/components/FileDropzone/FilePreview.d.ts +4 -0
- package/lib/components/FileDropzone/index.d.ts +1 -0
- package/lib/components/FileDropzone/types.d.ts +103 -0
- package/lib/components/Form/Form.d.ts +16 -0
- package/lib/components/Form/Form.stories.d.ts +6 -0
- package/lib/components/Form/index.d.ts +1 -0
- package/lib/components/Form/types.d.ts +1 -0
- package/lib/components/GridLayout/GridLayout.d.ts +6 -0
- package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
- package/lib/components/GridLayout/index.d.ts +2 -0
- package/lib/components/GridLayout/types.d.ts +57 -0
- package/lib/components/HighlightText/HighlightText.d.ts +4 -0
- package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
- package/lib/components/HighlightText/index.d.ts +1 -0
- package/lib/components/HighlightText/types.d.ts +4 -0
- package/lib/components/Icon/Icon.d.ts +4 -0
- package/lib/components/Icon/Icon.stories.d.ts +7 -0
- package/lib/components/Icon/iconList.d.ts +2 -0
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/types.d.ts +10 -0
- package/lib/components/Input/Input.d.ts +4 -0
- package/lib/components/Input/Input.stories.d.ts +9 -0
- package/lib/components/Input/index.d.ts +1 -0
- package/lib/components/Input/types.d.ts +74 -0
- package/lib/components/InputWithDropdown/InputWithDropdown.d.ts +4 -0
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +8 -0
- package/lib/components/InputWithDropdown/index.d.ts +1 -0
- package/lib/components/InputWithDropdown/types.d.ts +88 -0
- package/lib/components/LazyLoad/LazyLoad.d.ts +2 -0
- package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
- package/lib/components/LazyLoad/LazyLoading.d.ts +2 -0
- package/lib/components/LazyLoad/index.d.ts +1 -0
- package/lib/components/MenuOption/MenuOption.d.ts +4 -0
- package/lib/components/MenuOption/MenuOption.stories.d.ts +15 -0
- package/lib/components/MenuOption/index.d.ts +1 -0
- package/lib/components/MenuOption/types.d.ts +134 -0
- package/lib/components/MiniModal/MiniModal.d.ts +4 -0
- package/lib/components/MiniModal/MiniModal.stories.d.ts +9 -0
- package/lib/components/MiniModal/index.d.ts +1 -0
- package/lib/components/MiniModal/types.d.ts +89 -0
- package/lib/components/MultiSelect/Dropdown.d.ts +4 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +4 -0
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +9 -0
- package/lib/components/MultiSelect/MultiSelectTypes.d.ts +18 -0
- package/lib/components/MultiSelect/dropdownTypes.d.ts +15 -0
- package/lib/components/MultiSelect/index.d.ts +1 -0
- package/lib/components/RadioButton/RadioButton.d.ts +4 -0
- package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
- package/lib/components/RadioButton/index.d.ts +1 -0
- package/lib/components/RadioButton/radioButtonTypes.d.ts +35 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts +4 -0
- package/lib/components/RadioGroup/RadioGroup.stories.d.ts +8 -0
- package/lib/components/RadioGroup/index.d.ts +1 -0
- package/lib/components/RadioGroup/radioGroupTypes.d.ts +47 -0
- package/lib/components/Search/Search.d.ts +4 -0
- package/lib/components/Search/Search.stories.d.ts +6 -0
- package/lib/components/Search/index.d.ts +1 -0
- package/lib/components/Search/types.d.ts +15 -0
- package/lib/components/Select/Select.d.ts +4 -0
- package/lib/components/Select/Select.stories.d.ts +13 -0
- package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
- package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +15 -0
- package/lib/components/Select/index.d.ts +1 -0
- package/lib/components/Select/types.d.ts +68 -0
- package/lib/components/Table/Table.d.ts +4 -0
- package/lib/components/Table/Table.stories.d.ts +11 -0
- package/lib/components/Table/Types.d.ts +98 -0
- package/lib/components/Table/index.d.ts +1 -0
- package/lib/components/TableTree/TableTree.d.ts +21 -0
- package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
- package/lib/components/TableTree/data.d.ts +313 -0
- package/lib/components/TableTree/index.d.ts +1 -0
- package/lib/components/Tabs/Tabs.d.ts +5 -0
- package/lib/components/Tabs/Tabs.stories.d.ts +8 -0
- package/lib/components/Tabs/index.d.ts +1 -0
- package/lib/components/Tabs/types.d.ts +40 -0
- package/lib/components/TextArea/Textarea.d.ts +4 -0
- package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
- package/lib/components/TextArea/Types.d.ts +78 -0
- package/lib/components/TextArea/index.d.ts +1 -0
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +7 -0
- package/lib/components/ThemeProvider/index.d.ts +1 -0
- package/lib/components/ThemeProvider/types.d.ts +11 -0
- package/lib/components/Toast/Toast.d.ts +5 -0
- package/lib/components/Toast/Toast.stories.d.ts +6 -0
- package/lib/components/Toast/index.d.ts +1 -0
- package/lib/components/Toast/types.d.ts +20 -0
- package/lib/components/Toggle/Toggle.d.ts +5 -0
- package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
- package/lib/components/Toggle/index.d.ts +1 -0
- package/lib/components/Toggle/types.d.ts +50 -0
- package/lib/components/Tooltip/Tooltip.d.ts +5 -0
- package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
- package/lib/components/Tooltip/index.d.ts +1 -0
- package/lib/components/Tooltip/types.d.ts +37 -0
- package/lib/components/Typography/Typography.d.ts +5 -0
- package/lib/components/Typography/Typography.stories.d.ts +10 -0
- package/lib/components/Typography/index.d.ts +1 -0
- package/lib/components/Typography/types.d.ts +47 -0
- package/lib/hooks/keyboardevents/useEscKeyEvent.d.ts +2 -0
- package/lib/hooks/useClickOutside.d.ts +2 -0
- package/lib/hooks/useFileDropzone.d.ts +3 -0
- package/lib/hooks/usePortalPosition.d.ts +9 -0
- package/lib/hooks/useTheme.d.ts +3 -0
- package/lib/index.css +404 -0
- package/lib/index.d.ts +1286 -0
- package/lib/index.esm.css +404 -0
- package/lib/index.esm.js +9317 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +9376 -0
- package/lib/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/utils/TableCell/TableCell.d.ts +1 -0
- package/lib/utils/checkEmpty/checkEmpty.d.ts +3 -0
- package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
- package/lib/utils/ffID/ffID.stories.d.ts +6 -0
- package/lib/utils/ffID/ffid.d.ts +2 -0
- package/lib/utils/getExtension/getExtension.d.ts +4 -0
- package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
- package/lib/utils/truncateText/truncateText.d.ts +1 -0
- package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
- package/package.json +62 -0
- package/rollup.config.mjs +57 -0
- package/src/StyleGuide/ColorPalette/ColorPalette.scss +58 -0
- package/src/StyleGuide/ColorPalette/ColorPalette.stories.tsx +16 -0
- package/src/StyleGuide/ColorPalette/ColorPalette.tsx +61 -0
- package/src/StyleGuide/ColorPalette/colorPaletteList.ts +97 -0
- package/src/StyleGuide/ColorPalette/index.ts +1 -0
- package/src/StyleGuide/ColorPalette/types.ts +17 -0
- package/src/StyleGuide/Typography/Typography.scss +100 -0
- package/src/StyleGuide/Typography/Typography.stories.tsx +16 -0
- package/src/StyleGuide/Typography/Typography.tsx +60 -0
- package/src/StyleGuide/Typography/TypographyList.ts +3 -0
- package/src/StyleGuide/Typography/types.ts +9 -0
- package/src/assets/Themes/BaseTheme.scss +130 -0
- package/src/assets/Themes/DarkTheme.scss +131 -0
- package/src/assets/Themes/Theme.scss +200 -0
- package/src/assets/icons/Arrow.svg +5 -0
- package/src/assets/icons/accordion_header_icon.svg +10 -0
- package/src/assets/icons/arrow_down.svg +3 -0
- package/src/assets/icons/arrow_right.svg +5 -0
- package/src/assets/icons/arrow_up.svg +3 -0
- package/src/assets/icons/arrows_down_icon.svg +3 -0
- package/src/assets/icons/arrows_right_icon.svg +10 -0
- package/src/assets/icons/arrows_top_icon.svg +3 -0
- package/src/assets/icons/check_mark.svg +3 -0
- package/src/assets/icons/close_pill.svg +3 -0
- package/src/assets/icons/delete.svg +17 -0
- package/src/assets/icons/dropzone_icon.svg +18 -0
- package/src/assets/icons/error.svg +17 -0
- package/src/assets/icons/file.svg +12 -0
- package/src/assets/icons/info.svg +17 -0
- package/src/assets/icons/logo.svg +18 -0
- package/src/assets/icons/manage_apps.svg +3 -0
- package/src/assets/icons/moon_stars.svg +10 -0
- package/src/assets/icons/more.svg +11 -0
- package/src/assets/icons/plus_icon.svg +11 -0
- package/src/assets/icons/remove.svg +12 -0
- package/src/assets/icons/replace.svg +12 -0
- package/src/assets/icons/search.svg +3 -0
- package/src/assets/icons/success.svg +13 -0
- package/src/assets/icons/sun_icon.svg +10 -0
- package/src/assets/icons/tick_icon.svg +5 -0
- package/src/assets/icons/toast_close.svg +3 -0
- package/src/assets/icons/warning.svg +17 -0
- package/src/assets/icons/wrong_mark.svg +3 -0
- package/src/assets/styles/_colors.scss +145 -0
- package/src/assets/styles/_fonts.scss +68 -0
- package/src/assets/styles/_mixins.scss +20 -0
- package/src/assets/utils/functionUtils.ts +5 -0
- package/src/components/Accordion/Accordion.scss +45 -0
- package/src/components/Accordion/Accordion.stories.tsx +31 -0
- package/src/components/Accordion/Accordion.tsx +62 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/Accordion/types.ts +28 -0
- package/src/components/AddResourceButton/AddButton.scss +36 -0
- package/src/components/AddResourceButton/AddButton.stories.tsx +126 -0
- package/src/components/AddResourceButton/AddButton.tsx +121 -0
- package/src/components/AddResourceButton/ArrowsButton/ArrowsButton.scss +160 -0
- package/src/components/AddResourceButton/ArrowsButton/ArrowsButton.tsx +38 -0
- package/src/components/AddResourceButton/index.ts +1 -0
- package/src/components/AddResourceButton/type.ts +60 -0
- package/src/components/Button/Button.scss +148 -0
- package/src/components/Button/Button.stories.tsx +74 -0
- package/src/components/Button/Button.tsx +66 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Button/types.ts +65 -0
- package/src/components/Charts/DonutChart/DonutChart.scss +76 -0
- package/src/components/Charts/DonutChart/DonutChart.stories.tsx +30 -0
- package/src/components/Charts/DonutChart/DonutChart.tsx +241 -0
- package/src/components/Charts/DonutChart/index.ts +1 -0
- package/src/components/Charts/DonutChart/type.ts +23 -0
- package/src/components/Charts/RadialChart/RadialChart.scss +12 -0
- package/src/components/Charts/RadialChart/RadialChart.stories.tsx +36 -0
- package/src/components/Charts/RadialChart/RadialChart.tsx +174 -0
- package/src/components/Charts/RadialChart/index.ts +1 -0
- package/src/components/Charts/RadialChart/types.ts +32 -0
- package/src/components/Checkbox/Checkbox.scss +89 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +47 -0
- package/src/components/Checkbox/Checkbox.tsx +61 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Checkbox/types.ts +30 -0
- package/src/components/Chip/Chip.scss +70 -0
- package/src/components/Chip/Chip.stories.tsx +88 -0
- package/src/components/Chip/Chip.tsx +35 -0
- package/src/components/Chip/index.ts +1 -0
- package/src/components/Chip/types.ts +19 -0
- package/src/components/Drawer/Drawer.scss +121 -0
- package/src/components/Drawer/Drawer.stories.tsx +88 -0
- package/src/components/Drawer/Drawer.tsx +179 -0
- package/src/components/Drawer/Types.ts +88 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/ExpandableMenu/ExpandableMenu.scss +110 -0
- package/src/components/ExpandableMenu/ExpandableMenu.stories.tsx +67 -0
- package/src/components/ExpandableMenu/ExpandableMenu.tsx +101 -0
- package/src/components/ExpandableMenu/index.ts +1 -0
- package/src/components/ExpandableMenu/types.ts +34 -0
- package/src/components/FileDropzone/Dropzone.tsx +55 -0
- package/src/components/FileDropzone/FileDropzone.scss +134 -0
- package/src/components/FileDropzone/FileDropzone.stories.tsx +83 -0
- package/src/components/FileDropzone/FileDropzone.tsx +98 -0
- package/src/components/FileDropzone/FilePreview.tsx +75 -0
- package/src/components/FileDropzone/index.ts +1 -0
- package/src/components/FileDropzone/types.ts +113 -0
- package/src/components/Form/Form.scss +98 -0
- package/src/components/Form/Form.stories.tsx +177 -0
- package/src/components/Form/Form.tsx +57 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/Form/types.ts +1 -0
- package/src/components/Form/validation.json +29 -0
- package/src/components/GridLayout/GridLayout.scss +71 -0
- package/src/components/GridLayout/GridLayout.stories.tsx +128 -0
- package/src/components/GridLayout/GridLayout.tsx +30 -0
- package/src/components/GridLayout/GridLayoutStory.scss +25 -0
- package/src/components/GridLayout/index.ts +1 -0
- package/src/components/GridLayout/types.ts +64 -0
- package/src/components/HighlightText/HighlightText.scss +3 -0
- package/src/components/HighlightText/HighlightText.stories.tsx +22 -0
- package/src/components/HighlightText/HighlightText.tsx +33 -0
- package/src/components/HighlightText/index.ts +1 -0
- package/src/components/HighlightText/types.ts +4 -0
- package/src/components/Icon/Icon.stories.tsx +37 -0
- package/src/components/Icon/Icon.tsx +43 -0
- package/src/components/Icon/Icons.scss +34 -0
- package/src/components/Icon/iconList.ts +62 -0
- package/src/components/Icon/index.ts +1 -0
- package/src/components/Icon/types.ts +10 -0
- package/src/components/Input/Input.scss +150 -0
- package/src/components/Input/Input.stories.tsx +96 -0
- package/src/components/Input/Input.tsx +93 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Input/types.ts +77 -0
- package/src/components/InputWithDropdown/InputWithDropdown.scss +185 -0
- package/src/components/InputWithDropdown/InputWithDropdown.stories.tsx +114 -0
- package/src/components/InputWithDropdown/InputWithDropdown.tsx +85 -0
- package/src/components/InputWithDropdown/index.ts +1 -0
- package/src/components/InputWithDropdown/types.ts +110 -0
- package/src/components/LazyLoad/LazyLoad.d.ts +3 -0
- package/src/components/LazyLoad/LazyLoad.stories.tsx +33 -0
- package/src/components/LazyLoad/LazyLoad.ts +2 -0
- package/src/components/LazyLoad/LazyLoading.tsx +19 -0
- package/src/components/LazyLoad/index.ts +1 -0
- package/src/components/MenuOption/MenuOption.scss +69 -0
- package/src/components/MenuOption/MenuOption.stories.tsx +259 -0
- package/src/components/MenuOption/MenuOption.tsx +126 -0
- package/src/components/MenuOption/index.ts +1 -0
- package/src/components/MenuOption/types.ts +161 -0
- package/src/components/MiniModal/MiniModal.scss +139 -0
- package/src/components/MiniModal/MiniModal.stories.tsx +475 -0
- package/src/components/MiniModal/MiniModal.tsx +218 -0
- package/src/components/MiniModal/index.ts +1 -0
- package/src/components/MiniModal/types.ts +88 -0
- package/src/components/MultiSelect/Dropdown.scss +66 -0
- package/src/components/MultiSelect/Dropdown.tsx +77 -0
- package/src/components/MultiSelect/MultiSelect.scss +190 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +85 -0
- package/src/components/MultiSelect/MultiSelect.tsx +260 -0
- package/src/components/MultiSelect/MultiSelectTypes.ts +19 -0
- package/src/components/MultiSelect/dropdownTypes.ts +15 -0
- package/src/components/MultiSelect/index.ts +1 -0
- package/src/components/RadioButton/RadioButton.scss +99 -0
- package/src/components/RadioButton/RadioButton.stories.tsx +43 -0
- package/src/components/RadioButton/RadioButton.tsx +32 -0
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/RadioButton/radioButtonTypes.tsx +40 -0
- package/src/components/RadioGroup/RadioGroup.scss +5 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +81 -0
- package/src/components/RadioGroup/RadioGroup.tsx +30 -0
- package/src/components/RadioGroup/index.ts +1 -0
- package/src/components/RadioGroup/radioGroupTypes.tsx +54 -0
- package/src/components/Search/Search.scss +87 -0
- package/src/components/Search/Search.stories.tsx +26 -0
- package/src/components/Search/Search.tsx +103 -0
- package/src/components/Search/index.ts +1 -0
- package/src/components/Search/types.ts +15 -0
- package/src/components/Select/Select.scss +247 -0
- package/src/components/Select/Select.stories.tsx +156 -0
- package/src/components/Select/Select.tsx +368 -0
- package/src/components/Select/components/Dropdown/Dropdown.scss +70 -0
- package/src/components/Select/components/Dropdown/Dropdown.tsx +89 -0
- package/src/components/Select/components/Dropdown/dropdownTypes.ts +19 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/Select/types.ts +122 -0
- package/src/components/Table/Table.scss +101 -0
- package/src/components/Table/Table.stories.tsx +345 -0
- package/src/components/Table/Table.tsx +128 -0
- package/src/components/Table/Types.ts +100 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/TableTree/TableTree.scss +142 -0
- package/src/components/TableTree/TableTree.stories.tsx +121 -0
- package/src/components/TableTree/TableTree.tsx +216 -0
- package/src/components/TableTree/TableTreeStories.scss +22 -0
- package/src/components/TableTree/data.ts +573 -0
- package/src/components/TableTree/index.ts +1 -0
- package/src/components/Tabs/Tabs.scss +76 -0
- package/src/components/Tabs/Tabs.stories.tsx +104 -0
- package/src/components/Tabs/Tabs.tsx +64 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Tabs/types.ts +38 -0
- package/src/components/TextArea/Textarea.scss +145 -0
- package/src/components/TextArea/Textarea.stories.tsx +92 -0
- package/src/components/TextArea/Textarea.tsx +84 -0
- package/src/components/TextArea/Types.ts +82 -0
- package/src/components/TextArea/index.tsx +1 -0
- package/src/components/ThemeProvider/ThemeProvider.tsx +24 -0
- package/src/components/ThemeProvider/index.ts +1 -0
- package/src/components/ThemeProvider/types.ts +14 -0
- package/src/components/Toast/Toast.scss +121 -0
- package/src/components/Toast/Toast.stories.tsx +180 -0
- package/src/components/Toast/Toast.tsx +116 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Toast/types.ts +27 -0
- package/src/components/Toggle/Toggle.scss +132 -0
- package/src/components/Toggle/Toggle.stories.tsx +132 -0
- package/src/components/Toggle/Toggle.tsx +96 -0
- package/src/components/Toggle/index.ts +1 -0
- package/src/components/Toggle/types.ts +43 -0
- package/src/components/Tooltip/Tooltip.scss +27 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +97 -0
- package/src/components/Tooltip/Tooltip.tsx +194 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Tooltip/types.ts +60 -0
- package/src/components/Typography/Typography.scss +49 -0
- package/src/components/Typography/Typography.stories.tsx +57 -0
- package/src/components/Typography/Typography.tsx +39 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/Typography/types.ts +56 -0
- package/src/fonts/Montserrat/Montserrat-Medium.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/src/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Black.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BlackItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Bold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-BoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLight.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ExtraLightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Italic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Light.ttf +0 -0
- package/src/fonts/Poppins/Poppins-LightItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Medium.ttf +0 -0
- package/src/fonts/Poppins/Poppins-MediumItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Regular.ttf +0 -0
- package/src/fonts/Poppins/Poppins-SemiBold.ttf +0 -0
- package/src/fonts/Poppins/Poppins-SemiBoldItalic.ttf +0 -0
- package/src/fonts/Poppins/Poppins-Thin.ttf +0 -0
- package/src/fonts/Poppins/Poppins-ThinItalic.ttf +0 -0
- package/src/hooks/keyboardevents/useEscKeyEvent.tsx +31 -0
- package/src/hooks/useClickOutside.tsx +30 -0
- package/src/hooks/useFileDropzone.tsx +273 -0
- package/src/hooks/usePortalPosition.tsx +53 -0
- package/src/hooks/useTheme.tsx +13 -0
- package/src/index.ts +91 -0
- package/src/utils/TableCell/TableCell.ts +16 -0
- package/src/utils/checkEmpty/checkEmpty.stories.tsx +34 -0
- package/src/utils/checkEmpty/checkEmpty.ts +10 -0
- package/src/utils/ffID/ffID.stories.tsx +35 -0
- package/src/utils/ffID/ffid.ts +9 -0
- package/src/utils/getExtension/getExtension.stories.tsx +23 -0
- package/src/utils/getExtension/getExtension.ts +28 -0
- package/src/utils/truncateText/truncateText.stories.tsx +37 -0
- package/src/utils/truncateText/truncateText.ts +4 -0
- package/tsconfig.json +55 -0
- package/ui-library.zip +0 -0
- package/vite.config.js +30 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
@import '../../assets/styles/fonts';
|
2
|
+
|
3
|
+
|
4
|
+
.ff-search-container {
|
5
|
+
display: flex;
|
6
|
+
align-items: center;
|
7
|
+
justify-content: space-between;
|
8
|
+
.ff-search-icon {
|
9
|
+
display: flex;
|
10
|
+
align-items: center;
|
11
|
+
justify-content: center;
|
12
|
+
cursor: pointer;
|
13
|
+
border: 1px solid var(--border-color);
|
14
|
+
border-radius: 4px;
|
15
|
+
padding: 5px;
|
16
|
+
.ff-icon-container {
|
17
|
+
svg {
|
18
|
+
path {
|
19
|
+
fill: var(--brand-color)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
.ff-search-input {
|
25
|
+
@extend .fontXs;
|
26
|
+
border: none;
|
27
|
+
color: var(--tooltip-bg-color);
|
28
|
+
line-height: 12px;
|
29
|
+
visibility: hidden;
|
30
|
+
transition: width 0.4s ease;
|
31
|
+
&:focus {
|
32
|
+
outline: none;
|
33
|
+
border: none;
|
34
|
+
}
|
35
|
+
|
36
|
+
&:hover {
|
37
|
+
border: none;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
&.disabled {
|
41
|
+
opacity: 0.5;
|
42
|
+
}
|
43
|
+
&.expanded {
|
44
|
+
border: 1px solid var(--border-color);
|
45
|
+
border-radius: 4px;
|
46
|
+
.ff-vertical-line {
|
47
|
+
height: 8px;
|
48
|
+
width: 1px;
|
49
|
+
position: relative;
|
50
|
+
right: 2px;
|
51
|
+
border-radius: 1px;
|
52
|
+
margin: 8px 0px;
|
53
|
+
background-color: var(--border-color);
|
54
|
+
}
|
55
|
+
.ff-search-input {
|
56
|
+
visibility: visible;
|
57
|
+
|
58
|
+
&::placeholder {
|
59
|
+
color: var(--ff-search-filed-placeholder-text);
|
60
|
+
}
|
61
|
+
}
|
62
|
+
.ff-search-icon {
|
63
|
+
padding: 4px;
|
64
|
+
border: none;
|
65
|
+
cursor: default;
|
66
|
+
|
67
|
+
}
|
68
|
+
.ff-search-clear-button {
|
69
|
+
display: grid;
|
70
|
+
place-items: center;
|
71
|
+
cursor: pointer;
|
72
|
+
width: 22px;
|
73
|
+
}
|
74
|
+
.ff-search-close-icon {
|
75
|
+
margin: 4px;
|
76
|
+
cursor: pointer;
|
77
|
+
|
78
|
+
.ff-icon-container {
|
79
|
+
svg {
|
80
|
+
path {
|
81
|
+
fill: var(--ff-search-filed-close-Icon)
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
3
|
+
import Search from './Search';
|
4
|
+
const meta: Meta<typeof Search> = {
|
5
|
+
title: 'Components/Search',
|
6
|
+
component: Search,
|
7
|
+
parameters: {
|
8
|
+
layout: 'centered',
|
9
|
+
},
|
10
|
+
tags: ['autodocs'],
|
11
|
+
};
|
12
|
+
|
13
|
+
type Story = StoryObj<typeof Search>;
|
14
|
+
const defaultArgs = {
|
15
|
+
placeholder: 'Search',
|
16
|
+
onSearch: (query: string) => alert(`Searching for: ${query}`),
|
17
|
+
disabled: false,
|
18
|
+
width: 200,
|
19
|
+
};
|
20
|
+
export const Default: Story = {
|
21
|
+
args: {
|
22
|
+
...defaultArgs,
|
23
|
+
},
|
24
|
+
};
|
25
|
+
|
26
|
+
export default meta;
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import classNames from 'classnames';
|
3
|
+
import './Search.scss';
|
4
|
+
import Icon from '../Icon';
|
5
|
+
import { SearchProps } from './types';
|
6
|
+
import { checkEmpty } from '../../utils/checkEmpty/checkEmpty';
|
7
|
+
import Typography from '../Typography';
|
8
|
+
|
9
|
+
const Search = ({
|
10
|
+
placeholder = 'Search',
|
11
|
+
onSearch,
|
12
|
+
disabled = false,
|
13
|
+
width = 150,
|
14
|
+
}: SearchProps) => {
|
15
|
+
const [isExpanded, setIsExpanded] = useState<boolean>(false);
|
16
|
+
const [searchvalue, setSearchValue] = useState<string>('');
|
17
|
+
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
18
|
+
if (event.key === 'Enter' && !checkEmpty(searchvalue)) {
|
19
|
+
onSearch(searchvalue.trim());
|
20
|
+
} else if (event?.key === 'Escape') {
|
21
|
+
handleSearchClearAndClose('Close');
|
22
|
+
}
|
23
|
+
};
|
24
|
+
const onChange = (value: string) => {
|
25
|
+
setSearchValue(value);
|
26
|
+
if (value === '') {
|
27
|
+
onSearch('');
|
28
|
+
}
|
29
|
+
};
|
30
|
+
const handleIconClick = () => {
|
31
|
+
setIsExpanded(!disabled);
|
32
|
+
};
|
33
|
+
const handleSearchClearAndClose = (label: string) => {
|
34
|
+
setSearchValue('');
|
35
|
+
onSearch('');
|
36
|
+
if (label === 'Close') {
|
37
|
+
setIsExpanded(false);
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
return (
|
42
|
+
<div
|
43
|
+
className={classNames('ff-search-container', {
|
44
|
+
expanded: isExpanded,
|
45
|
+
disabled: disabled,
|
46
|
+
})}
|
47
|
+
>
|
48
|
+
<div className="ff-search-icon" onClick={handleIconClick}>
|
49
|
+
<Icon name="search" height={14} width={14} />
|
50
|
+
</div>
|
51
|
+
<div
|
52
|
+
className={classNames('ff-vertical-line', {
|
53
|
+
expanded: isExpanded,
|
54
|
+
})}
|
55
|
+
></div>
|
56
|
+
<input
|
57
|
+
className="ff-search-input"
|
58
|
+
name="input"
|
59
|
+
style={{ width: isExpanded ? `${width}px` : '0px' }}
|
60
|
+
placeholder={placeholder}
|
61
|
+
type="text"
|
62
|
+
value={searchvalue}
|
63
|
+
disabled={disabled}
|
64
|
+
autoComplete="off"
|
65
|
+
onChange={(e) => {
|
66
|
+
onChange(e.target.value);
|
67
|
+
}}
|
68
|
+
onKeyDown={handleKeyDown}
|
69
|
+
/>
|
70
|
+
|
71
|
+
{isExpanded && (
|
72
|
+
<>
|
73
|
+
<div
|
74
|
+
className="ff-search-clear-button"
|
75
|
+
onClick={() => {
|
76
|
+
handleSearchClearAndClose('Clear');
|
77
|
+
}}
|
78
|
+
>
|
79
|
+
{searchvalue !== '' && (
|
80
|
+
<Typography
|
81
|
+
children={'clear'}
|
82
|
+
fontSize={8}
|
83
|
+
color={'var(--ff-search-filed-clear-text)'}
|
84
|
+
/>
|
85
|
+
)}
|
86
|
+
</div>
|
87
|
+
<div className="ff-search-close-icon">
|
88
|
+
<Icon
|
89
|
+
height={6}
|
90
|
+
width={6}
|
91
|
+
name="close"
|
92
|
+
hoverEffect={true}
|
93
|
+
onClick={() => {
|
94
|
+
handleSearchClearAndClose('Close');
|
95
|
+
}}
|
96
|
+
/>
|
97
|
+
</div>
|
98
|
+
</>
|
99
|
+
)}
|
100
|
+
</div>
|
101
|
+
);
|
102
|
+
};
|
103
|
+
export default Search;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Search';
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export interface SearchProps {
|
2
|
+
/**
|
3
|
+
* Placeholder for the input field
|
4
|
+
*/
|
5
|
+
placeholder?: string;
|
6
|
+
/**
|
7
|
+
* Callback function to be called when the search button is clicked or enter key is pressed
|
8
|
+
*/
|
9
|
+
onSearch: (query: string) => void;
|
10
|
+
/**
|
11
|
+
* Additional styles for the button
|
12
|
+
*/
|
13
|
+
disabled?: boolean;
|
14
|
+
width?: number;
|
15
|
+
}
|
@@ -0,0 +1,247 @@
|
|
1
|
+
@use '../../assets/styles/fonts';
|
2
|
+
|
3
|
+
// todo color need to be add into style guide
|
4
|
+
@mixin transition-all($time: 0.3s) {
|
5
|
+
transition: opacity $time ease-out, transform $time ease-out,
|
6
|
+
font-size $time ease-out, padding $time ease-out;
|
7
|
+
}
|
8
|
+
|
9
|
+
@mixin absolute-position($top: auto, $right: auto, $bottom: auto, $left: auto) {
|
10
|
+
position: absolute;
|
11
|
+
top: $top;
|
12
|
+
right: $right;
|
13
|
+
bottom: $bottom;
|
14
|
+
left: $left;
|
15
|
+
}
|
16
|
+
|
17
|
+
@mixin opacity-style($opacity: 1, $color: null, $border-color-arg: null) {
|
18
|
+
opacity: $opacity;
|
19
|
+
|
20
|
+
@if $color {
|
21
|
+
color: $color;
|
22
|
+
}
|
23
|
+
|
24
|
+
@if $border-color-arg {
|
25
|
+
border-color: $border-color-arg;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
.ff-select-wrapper {
|
30
|
+
position: relative;
|
31
|
+
|
32
|
+
.ff-select {
|
33
|
+
@extend .fontSm;
|
34
|
+
margin: 0;
|
35
|
+
padding: 0;
|
36
|
+
box-sizing: border-box;
|
37
|
+
min-height: 32px;
|
38
|
+
min-width: 100px;
|
39
|
+
display: flex;
|
40
|
+
align-items: end;
|
41
|
+
position: relative;
|
42
|
+
|
43
|
+
&-fieldset {
|
44
|
+
margin: 0;
|
45
|
+
padding: 25px 0px 0px 8px;
|
46
|
+
border: 1px solid transparent;
|
47
|
+
box-sizing: border-box;
|
48
|
+
height: 100%;
|
49
|
+
width: 100%;
|
50
|
+
border-radius: 4px;
|
51
|
+
display: block;
|
52
|
+
|
53
|
+
&--border-radius {
|
54
|
+
border-radius: 0px 4px 4px 0px;
|
55
|
+
}
|
56
|
+
|
57
|
+
&--no-label {
|
58
|
+
padding: 30px 0px 0px 8px;
|
59
|
+
}
|
60
|
+
|
61
|
+
&--default {
|
62
|
+
@include opacity-style(0, null, var(--ff-select-border-color));
|
63
|
+
}
|
64
|
+
|
65
|
+
&--active {
|
66
|
+
@include opacity-style(1, null, var(--ff-select-brand-color));
|
67
|
+
}
|
68
|
+
|
69
|
+
&--option {
|
70
|
+
opacity: 1;
|
71
|
+
}
|
72
|
+
|
73
|
+
&--no-border {
|
74
|
+
border-color: transparent;
|
75
|
+
}
|
76
|
+
|
77
|
+
&--error {
|
78
|
+
border-color: var(--error-light);
|
79
|
+
}
|
80
|
+
|
81
|
+
.ff-select-legend {
|
82
|
+
@extend .font-size-8;
|
83
|
+
padding: 0 2px;
|
84
|
+
letter-spacing: 0.5px;
|
85
|
+
|
86
|
+
&--default {
|
87
|
+
@include transition-all(0.3s);
|
88
|
+
opacity: 0;
|
89
|
+
}
|
90
|
+
|
91
|
+
&--active {
|
92
|
+
@include transition-all(0.25s);
|
93
|
+
@include opacity-style(1, var(--ff-select-brand-color));
|
94
|
+
}
|
95
|
+
|
96
|
+
&--option {
|
97
|
+
@include opacity-style(1, var(--ff-select-default-color));
|
98
|
+
}
|
99
|
+
|
100
|
+
&--error {
|
101
|
+
color: var(--error-light);
|
102
|
+
}
|
103
|
+
|
104
|
+
&--required {
|
105
|
+
margin-right: 2px;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
&-input {
|
111
|
+
@extend .fontSm;
|
112
|
+
@include absolute-position(6px, auto, auto, auto);
|
113
|
+
width: calc(100% - 38px);
|
114
|
+
min-height: calc(100% - 8px);
|
115
|
+
padding: 0 28px 0 8px;
|
116
|
+
border-radius: 4px;
|
117
|
+
border: 1px solid transparent;
|
118
|
+
z-index: 100;
|
119
|
+
background: transparent;
|
120
|
+
outline: none;
|
121
|
+
color: var(--ff-select-text-color);
|
122
|
+
|
123
|
+
&:hover {
|
124
|
+
~ .ff-select-label {
|
125
|
+
color: var(--ff-select-text-hover-color);
|
126
|
+
}
|
127
|
+
}
|
128
|
+
|
129
|
+
&--border-radius {
|
130
|
+
border-radius: 0px 4px 4px 0px;
|
131
|
+
}
|
132
|
+
|
133
|
+
&--default {
|
134
|
+
@include opacity-style(1, null, var(--ff-select-border-color));
|
135
|
+
|
136
|
+
&:hover {
|
137
|
+
border-color: var(--ff-select-text-color);
|
138
|
+
|
139
|
+
~ .ff-select-fieldset--option {
|
140
|
+
border-color: var(--ff-select-text-color);
|
141
|
+
|
142
|
+
.ff-select-legend--option {
|
143
|
+
color: var(--ff-select-text-color);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
}
|
148
|
+
|
149
|
+
&--no-label {
|
150
|
+
min-height: calc(100% - 2px);
|
151
|
+
margin-top: 0px;
|
152
|
+
top: 0px;
|
153
|
+
}
|
154
|
+
|
155
|
+
&--active {
|
156
|
+
border-color: transparent;
|
157
|
+
|
158
|
+
&:hover {
|
159
|
+
border-color: transparent;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
&--no-border {
|
164
|
+
border: none;
|
165
|
+
border-color: transparent;
|
166
|
+
|
167
|
+
&:hover {
|
168
|
+
border-color: transparent;
|
169
|
+
|
170
|
+
~ .ff-select-fieldset--no-border {
|
171
|
+
border-color: transparent;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
&--disable {
|
177
|
+
border-color: var(--ff-select-border-color);
|
178
|
+
|
179
|
+
&:hover {
|
180
|
+
border-color: var(--ff-select-border-color);
|
181
|
+
|
182
|
+
~ .ff-select-label--default {
|
183
|
+
color: var(--ff-select-default-color);
|
184
|
+
}
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
&--error {
|
189
|
+
border-color: var(--error-light);
|
190
|
+
|
191
|
+
&:hover {
|
192
|
+
border-color: var(--error-light);
|
193
|
+
}
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
&-label {
|
198
|
+
@include absolute-position(13px, auto, auto, 8px);
|
199
|
+
z-index: 1;
|
200
|
+
font-size: 12px;
|
201
|
+
top: 60%;
|
202
|
+
padding-left: 8px;
|
203
|
+
|
204
|
+
&--default {
|
205
|
+
@include transition-all;
|
206
|
+
@include opacity-style(1, var(--ff-select-default-color));
|
207
|
+
|
208
|
+
transform: translateY(-50%);
|
209
|
+
}
|
210
|
+
|
211
|
+
&--active {
|
212
|
+
@extend .font-size-8;
|
213
|
+
@include transition-all;
|
214
|
+
opacity: 0;
|
215
|
+
transform: translateY(-150%);
|
216
|
+
padding: 0 6px;
|
217
|
+
}
|
218
|
+
|
219
|
+
&--required {
|
220
|
+
margin-right: 2px;
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
&-arrow {
|
225
|
+
position: absolute;
|
226
|
+
top: 60%;
|
227
|
+
height: 100%;
|
228
|
+
right: 10px;
|
229
|
+
transform: rotateX(180deg) translateY(50%);
|
230
|
+
cursor: pointer;
|
231
|
+
|
232
|
+
&--no-label {
|
233
|
+
top: 50%;
|
234
|
+
}
|
235
|
+
|
236
|
+
&--down {
|
237
|
+
transform: rotateX(0deg) translateY(-50%);
|
238
|
+
z-index: 101;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
&-error-text {
|
244
|
+
@include absolute-position(auto, auto, -14px, 12px);
|
245
|
+
white-space: nowrap;
|
246
|
+
}
|
247
|
+
}
|
@@ -0,0 +1,156 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import Select from './Select';
|
3
|
+
import { useState } from 'react';
|
4
|
+
import { Option } from './types';
|
5
|
+
|
6
|
+
const meta: Meta<typeof Select> = {
|
7
|
+
title: 'Components/Select',
|
8
|
+
component: Select,
|
9
|
+
parameters: {
|
10
|
+
layout: 'centered',
|
11
|
+
},
|
12
|
+
tags: ['autodocs'],
|
13
|
+
};
|
14
|
+
|
15
|
+
type Story = StoryObj<typeof Select>;
|
16
|
+
|
17
|
+
export const Primary: Story = {
|
18
|
+
args: {
|
19
|
+
label: 'Select',
|
20
|
+
optionsList: [
|
21
|
+
{ label: 'Option 1', value: '1' },
|
22
|
+
{ label: 'Option 2', value: '2' },
|
23
|
+
{ label: 'Option 3', value: '3' },
|
24
|
+
],
|
25
|
+
},
|
26
|
+
};
|
27
|
+
|
28
|
+
export const WithError: Story = {
|
29
|
+
args: {
|
30
|
+
label: 'Select',
|
31
|
+
optionsList: [
|
32
|
+
{ label: 'Option 1', value: '1' },
|
33
|
+
{ label: 'Option 2', value: '2' },
|
34
|
+
{ label: 'Option 3', value: '3' },
|
35
|
+
],
|
36
|
+
errorMsg: 'Please select a option',
|
37
|
+
},
|
38
|
+
};
|
39
|
+
|
40
|
+
export const WithoutLabel: Story = {
|
41
|
+
args: {
|
42
|
+
showLabel: false,
|
43
|
+
optionsList: [
|
44
|
+
{ label: 'Option 1', value: '1' },
|
45
|
+
{ label: 'Option 2', value: '2' },
|
46
|
+
{ label: 'Option 3', value: '3' },
|
47
|
+
],
|
48
|
+
},
|
49
|
+
};
|
50
|
+
|
51
|
+
export const EmptyOptions: Story = {
|
52
|
+
args: {
|
53
|
+
label: 'Select',
|
54
|
+
optionsList: [],
|
55
|
+
errorMsg: 'No options available',
|
56
|
+
},
|
57
|
+
};
|
58
|
+
|
59
|
+
export const Disable: Story = {
|
60
|
+
args: {
|
61
|
+
label: 'Select',
|
62
|
+
optionsList: [],
|
63
|
+
disabled: true,
|
64
|
+
},
|
65
|
+
};
|
66
|
+
|
67
|
+
export const WithInitialValue: Story = {
|
68
|
+
args: {
|
69
|
+
label: 'Select',
|
70
|
+
selectedOption: { label: 'Option 2', value: '2' },
|
71
|
+
optionsList: [
|
72
|
+
{ label: 'Option 1', value: 'Option 1' },
|
73
|
+
{ label: 'Option 2', value: 'Option 2' },
|
74
|
+
{ label: 'Option 3', value: 'Option 3' },
|
75
|
+
],
|
76
|
+
},
|
77
|
+
};
|
78
|
+
|
79
|
+
export const OptionSelection: Story = {
|
80
|
+
render: () => {
|
81
|
+
const optionsList = [
|
82
|
+
{ label: 'Option 1', value: 'Option 1' },
|
83
|
+
{ label: 'Option 2', value: 'Option 2' },
|
84
|
+
{ label: 'Option 3', value: 'Option 3' },
|
85
|
+
];
|
86
|
+
|
87
|
+
const [selectedOption, setSelectedOption] = useState<Option>({
|
88
|
+
label: 'Option 2',
|
89
|
+
value: '2',
|
90
|
+
});
|
91
|
+
|
92
|
+
const handleChange = (option: Option) => {
|
93
|
+
setSelectedOption(option);
|
94
|
+
};
|
95
|
+
|
96
|
+
return (
|
97
|
+
<Select
|
98
|
+
label="Option"
|
99
|
+
optionsList={optionsList}
|
100
|
+
selectedOption={selectedOption}
|
101
|
+
onChange={handleChange}
|
102
|
+
/>
|
103
|
+
);
|
104
|
+
},
|
105
|
+
};
|
106
|
+
|
107
|
+
export const CustomJSX: Story = {
|
108
|
+
render: () => {
|
109
|
+
const optionsList: Option[] = [
|
110
|
+
{
|
111
|
+
label: <p style={{ color: 'red' }}>Option 1</p>,
|
112
|
+
value: 'option 1',
|
113
|
+
},
|
114
|
+
{
|
115
|
+
label: <p style={{ color: 'green' }}>Option 2</p>,
|
116
|
+
value: 'option 2',
|
117
|
+
},
|
118
|
+
{
|
119
|
+
label: <p style={{ color: 'beige' }}>Option 3</p>,
|
120
|
+
value: 'option 3',
|
121
|
+
},
|
122
|
+
{
|
123
|
+
label: <p style={{ color: 'crimson' }}>Option 4</p>,
|
124
|
+
value: 'option 4',
|
125
|
+
},
|
126
|
+
{
|
127
|
+
label: <p style={{ color: 'cyan' }}>Option 5</p>,
|
128
|
+
value: 'option 5',
|
129
|
+
},
|
130
|
+
{
|
131
|
+
label: <p style={{ color: 'red' }}>Option 6</p>,
|
132
|
+
value: 'option 6',
|
133
|
+
},
|
134
|
+
];
|
135
|
+
|
136
|
+
const [selectedOption, setSelectedOption] = useState<Option>({
|
137
|
+
label: <p style={{ color: 'red' }}>Option 6</p>,
|
138
|
+
value: 'option 6',
|
139
|
+
});
|
140
|
+
|
141
|
+
const handleChange = (option: Option) => {
|
142
|
+
setSelectedOption(option);
|
143
|
+
};
|
144
|
+
|
145
|
+
return (
|
146
|
+
<Select
|
147
|
+
label="Option"
|
148
|
+
optionsList={optionsList}
|
149
|
+
selectedOption={selectedOption}
|
150
|
+
onChange={handleChange}
|
151
|
+
/>
|
152
|
+
);
|
153
|
+
},
|
154
|
+
};
|
155
|
+
|
156
|
+
export default meta;
|