pixel-react 1.0.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/.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,101 @@
|
|
1
|
+
@import '../../assets/styles/_fonts';
|
2
|
+
|
3
|
+
.ff-fixed-header-table {
|
4
|
+
overflow-y: auto;
|
5
|
+
}
|
6
|
+
|
7
|
+
.ff-table {
|
8
|
+
th,
|
9
|
+
td {
|
10
|
+
text-align: left;
|
11
|
+
font-size: 12px;
|
12
|
+
padding: 9px 8px;
|
13
|
+
}
|
14
|
+
thead {
|
15
|
+
tr {
|
16
|
+
th {
|
17
|
+
@extend .fontMd;
|
18
|
+
color: var(--text-color);
|
19
|
+
border-bottom: 1px solid var(--slider-table-color);
|
20
|
+
text-transform: uppercase;
|
21
|
+
}
|
22
|
+
th:first-child {
|
23
|
+
div {
|
24
|
+
display: flex;
|
25
|
+
align-items: center;
|
26
|
+
.ff-table-checkbox {
|
27
|
+
padding-right: 8px;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
tbody {
|
34
|
+
tr {
|
35
|
+
.action-column {
|
36
|
+
opacity: 0;
|
37
|
+
}
|
38
|
+
.icon-container {
|
39
|
+
padding-left: 10px;
|
40
|
+
opacity: 0;
|
41
|
+
display: flex;
|
42
|
+
justify-content: flex-end;
|
43
|
+
transition: opacity 0.3s ease, transform 0.3s ease;
|
44
|
+
transform: translateX(20px);
|
45
|
+
}
|
46
|
+
&:hover {
|
47
|
+
background-color: var(--slider-table-color);
|
48
|
+
|
49
|
+
.icon-container {
|
50
|
+
opacity: 1;
|
51
|
+
transform: translateX(0);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
td {
|
55
|
+
position: relative;
|
56
|
+
color: var(--text-color);
|
57
|
+
@extend .fontSm;
|
58
|
+
|
59
|
+
&.clickable-cell {
|
60
|
+
cursor: pointer;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
td:first-child {
|
64
|
+
div {
|
65
|
+
display: flex;
|
66
|
+
align-items: center;
|
67
|
+
.ff-table-checkbox {
|
68
|
+
padding-right: 8px;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
.primary-bg {
|
75
|
+
background-color: var(--brand-color);
|
76
|
+
}
|
77
|
+
.secondary-bg {
|
78
|
+
background-color: var(--primary-icon-color);
|
79
|
+
}
|
80
|
+
.default-bg {
|
81
|
+
background-color: transparent;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
.border-borderRadius {
|
85
|
+
border: 1px solid var(--slider-table-color);
|
86
|
+
border-radius: 5px;
|
87
|
+
border-collapse: none !important;
|
88
|
+
}
|
89
|
+
|
90
|
+
.ff-fixed-header {
|
91
|
+
position: sticky !important;
|
92
|
+
top: 0;
|
93
|
+
z-index: 99;
|
94
|
+
background-color: Var(--file-details-bg);
|
95
|
+
}
|
96
|
+
.no-data-content {
|
97
|
+
display: flex;
|
98
|
+
flex-direction: column;
|
99
|
+
justify-content: center;
|
100
|
+
align-items: center;
|
101
|
+
}
|
@@ -0,0 +1,345 @@
|
|
1
|
+
import { useEffect, useState } from 'react';
|
2
|
+
import { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import Table from './Table';
|
4
|
+
import Icon from '../Icon';
|
5
|
+
|
6
|
+
const meta: Meta<typeof Table> = {
|
7
|
+
title: 'Components/Table',
|
8
|
+
component: Table,
|
9
|
+
parameters: {
|
10
|
+
layout: 'centered',
|
11
|
+
},
|
12
|
+
tags: ['autodocs'],
|
13
|
+
};
|
14
|
+
|
15
|
+
type Story = StoryObj<typeof Table>;
|
16
|
+
const defaultArgs = {
|
17
|
+
data: [],
|
18
|
+
columns: [],
|
19
|
+
};
|
20
|
+
const sampleData = [
|
21
|
+
{
|
22
|
+
project: {
|
23
|
+
modifiedByUname: 'user4',
|
24
|
+
modifiedOn: '18-03-2024 10:47',
|
25
|
+
name: 'Test1',
|
26
|
+
type: 'Web',
|
27
|
+
status: 'Open',
|
28
|
+
checked: false,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
{
|
32
|
+
project: {
|
33
|
+
modifiedByUname: 'user3',
|
34
|
+
modifiedOn: '13-03-2024 15:15',
|
35
|
+
name: 'Test2',
|
36
|
+
type: 'Mobile',
|
37
|
+
status: 'Close',
|
38
|
+
checked: true,
|
39
|
+
},
|
40
|
+
},
|
41
|
+
{
|
42
|
+
project: {
|
43
|
+
modifiedByUname: 'user2',
|
44
|
+
modifiedOn: '13-03-2024 15:30',
|
45
|
+
name: 'Test3',
|
46
|
+
type: 'Web',
|
47
|
+
status: 'Close',
|
48
|
+
checked: true,
|
49
|
+
},
|
50
|
+
},
|
51
|
+
{
|
52
|
+
project: {
|
53
|
+
modifiedByUname: 'user1',
|
54
|
+
modifiedOn: '18-03-2024 15:36',
|
55
|
+
name: 'Test4',
|
56
|
+
type: 'Web & Mobile',
|
57
|
+
status: 'Open',
|
58
|
+
checked: false,
|
59
|
+
},
|
60
|
+
},
|
61
|
+
{
|
62
|
+
project: {
|
63
|
+
modifiedByUname: 'user4',
|
64
|
+
modifiedOn: '18-03-2024 10:47',
|
65
|
+
name: 'Test1',
|
66
|
+
type: 'Web',
|
67
|
+
status: 'Open',
|
68
|
+
checked: false,
|
69
|
+
},
|
70
|
+
},
|
71
|
+
{
|
72
|
+
project: {
|
73
|
+
modifiedByUname: 'user3',
|
74
|
+
modifiedOn: '13-03-2024 15:15',
|
75
|
+
name: 'Test2',
|
76
|
+
type: 'Mobile',
|
77
|
+
status: 'Close',
|
78
|
+
checked: true,
|
79
|
+
},
|
80
|
+
},
|
81
|
+
{
|
82
|
+
project: {
|
83
|
+
modifiedByUname: 'user2',
|
84
|
+
modifiedOn: '13-03-2024 15:30',
|
85
|
+
name: 'Test3',
|
86
|
+
type: 'Web',
|
87
|
+
status: 'Close',
|
88
|
+
checked: true,
|
89
|
+
},
|
90
|
+
},
|
91
|
+
{
|
92
|
+
project: {
|
93
|
+
modifiedByUname: 'user1',
|
94
|
+
modifiedOn: '18-03-2024 15:36',
|
95
|
+
name: 'Test4',
|
96
|
+
type: 'Web & Mobile',
|
97
|
+
status: 'Open',
|
98
|
+
checked: false,
|
99
|
+
},
|
100
|
+
},
|
101
|
+
{
|
102
|
+
project: {
|
103
|
+
modifiedByUname: 'user4',
|
104
|
+
modifiedOn: '18-03-2024 10:47',
|
105
|
+
name: 'Test1',
|
106
|
+
type: 'Web',
|
107
|
+
status: 'Open',
|
108
|
+
checked: false,
|
109
|
+
},
|
110
|
+
},
|
111
|
+
{
|
112
|
+
project: {
|
113
|
+
modifiedByUname: 'user3',
|
114
|
+
modifiedOn: '13-03-2024 15:15',
|
115
|
+
name: 'Test2',
|
116
|
+
type: 'Mobile',
|
117
|
+
status: 'Close',
|
118
|
+
checked: true,
|
119
|
+
},
|
120
|
+
},
|
121
|
+
{
|
122
|
+
project: {
|
123
|
+
modifiedByUname: 'user2',
|
124
|
+
modifiedOn: '13-03-2024 15:30',
|
125
|
+
name: 'Test3',
|
126
|
+
type: 'Web',
|
127
|
+
status: 'Close',
|
128
|
+
checked: true,
|
129
|
+
},
|
130
|
+
},
|
131
|
+
{
|
132
|
+
project: {
|
133
|
+
modifiedByUname: 'user1',
|
134
|
+
modifiedOn: '18-03-2024 15:36',
|
135
|
+
name: 'Test4',
|
136
|
+
type: 'Web & Mobile',
|
137
|
+
status: 'Open',
|
138
|
+
checked: false,
|
139
|
+
},
|
140
|
+
},
|
141
|
+
];
|
142
|
+
const columnsData = [
|
143
|
+
{
|
144
|
+
header: 'Name',
|
145
|
+
accessor: 'name',
|
146
|
+
width: 150,
|
147
|
+
cell: (e: any) => {
|
148
|
+
return (
|
149
|
+
<div title={e.value} style={{ color: 'blue' }}>
|
150
|
+
{e.value}
|
151
|
+
<div style={{ textAlign: 'right' }} className="icon-container">
|
152
|
+
<span>
|
153
|
+
<Icon name="edit_icon" height={12} width={12} />
|
154
|
+
</span>
|
155
|
+
<span>
|
156
|
+
<Icon name="delete" height={12} width={12} />
|
157
|
+
</span>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
);
|
161
|
+
},
|
162
|
+
},
|
163
|
+
{
|
164
|
+
header: 'Type',
|
165
|
+
accessor: 'type',
|
166
|
+
cell: ({ value }: any) => <div>{value}</div>,
|
167
|
+
},
|
168
|
+
{
|
169
|
+
header: 'Status',
|
170
|
+
accessor: 'status',
|
171
|
+
width: 150,
|
172
|
+
cell: ({ value }: any) => <div>{value}</div>,
|
173
|
+
},
|
174
|
+
{
|
175
|
+
header: 'Modified By',
|
176
|
+
accessor: 'modifiedByUname',
|
177
|
+
},
|
178
|
+
{
|
179
|
+
header: 'Modified On',
|
180
|
+
accessor: 'modifiedOn',
|
181
|
+
cell: ({ value }: any) => <div>{value}</div>,
|
182
|
+
},
|
183
|
+
];
|
184
|
+
|
185
|
+
export const Default: Story = {
|
186
|
+
args: {
|
187
|
+
...defaultArgs,
|
188
|
+
data: sampleData.map((x) => x.project),
|
189
|
+
|
190
|
+
columns: columnsData,
|
191
|
+
},
|
192
|
+
};
|
193
|
+
export const PageTable: Story = {
|
194
|
+
args: {
|
195
|
+
...defaultArgs,
|
196
|
+
data: [],
|
197
|
+
columns: [],
|
198
|
+
},
|
199
|
+
render: () => {
|
200
|
+
const [tableData, setTableData] = useState([]);
|
201
|
+
useEffect(() => {
|
202
|
+
let sampleArray: any = [];
|
203
|
+
sampleData.forEach((data) => {
|
204
|
+
sampleArray.push(data.project);
|
205
|
+
});
|
206
|
+
setTableData(sampleArray);
|
207
|
+
}, []);
|
208
|
+
|
209
|
+
return (
|
210
|
+
<>
|
211
|
+
<Table
|
212
|
+
{...defaultArgs}
|
213
|
+
data={tableData}
|
214
|
+
columns={columnsData}
|
215
|
+
headerType="secondary"
|
216
|
+
noDataContent="No data found"
|
217
|
+
/>
|
218
|
+
</>
|
219
|
+
);
|
220
|
+
},
|
221
|
+
};
|
222
|
+
export const PrimaryHeader: Story = {
|
223
|
+
args: {
|
224
|
+
...defaultArgs,
|
225
|
+
data: [],
|
226
|
+
columns: [],
|
227
|
+
},
|
228
|
+
render: () => {
|
229
|
+
const [tableData, setTableData] = useState([]);
|
230
|
+
useEffect(() => {
|
231
|
+
let sampleArray: any = [];
|
232
|
+
sampleData.forEach((data) => {
|
233
|
+
sampleArray.push(data.project);
|
234
|
+
});
|
235
|
+
setTableData(sampleArray);
|
236
|
+
}, []);
|
237
|
+
|
238
|
+
return (
|
239
|
+
<>
|
240
|
+
<Table
|
241
|
+
{...defaultArgs}
|
242
|
+
data={tableData}
|
243
|
+
columns={columnsData}
|
244
|
+
headerType="primary"
|
245
|
+
noDataContent="No data found"
|
246
|
+
/>
|
247
|
+
</>
|
248
|
+
);
|
249
|
+
},
|
250
|
+
};
|
251
|
+
export const FixedHeaderWithBorder: Story = {
|
252
|
+
args: {
|
253
|
+
...defaultArgs,
|
254
|
+
data: [],
|
255
|
+
columns: [],
|
256
|
+
},
|
257
|
+
render: () => {
|
258
|
+
const [tableData, setTableData] = useState([]);
|
259
|
+
useEffect(() => {
|
260
|
+
let sampleArray: any = [];
|
261
|
+
sampleData.forEach((data) => {
|
262
|
+
sampleArray.push(data.project);
|
263
|
+
});
|
264
|
+
setTableData(sampleArray);
|
265
|
+
}, []);
|
266
|
+
|
267
|
+
return (
|
268
|
+
<>
|
269
|
+
<Table
|
270
|
+
{...defaultArgs}
|
271
|
+
data={tableData}
|
272
|
+
columns={columnsData}
|
273
|
+
headerType="primary"
|
274
|
+
withFixedHeader={true}
|
275
|
+
borderWithRadius={true}
|
276
|
+
noDataContent="No data found"
|
277
|
+
/>
|
278
|
+
</>
|
279
|
+
);
|
280
|
+
},
|
281
|
+
};
|
282
|
+
export const WithCheckBox: Story = {
|
283
|
+
args: {
|
284
|
+
...defaultArgs,
|
285
|
+
data: [],
|
286
|
+
columns: [],
|
287
|
+
},
|
288
|
+
render: () => {
|
289
|
+
const [tableData, setTableData] = useState([]);
|
290
|
+
const [allSelected, setAllSelected] = useState(false);
|
291
|
+
useEffect(() => {
|
292
|
+
let sampleArray: any = [];
|
293
|
+
sampleData.forEach((data) => {
|
294
|
+
sampleArray.push(data.project);
|
295
|
+
});
|
296
|
+
setTableData(sampleArray);
|
297
|
+
}, []);
|
298
|
+
|
299
|
+
const onSelectClick = (obj: any) => {
|
300
|
+
if (obj['allSelected'] !== undefined) {
|
301
|
+
setAllSelected(!allSelected);
|
302
|
+
}
|
303
|
+
};
|
304
|
+
|
305
|
+
return (
|
306
|
+
<>
|
307
|
+
<Table
|
308
|
+
{...defaultArgs}
|
309
|
+
data={tableData}
|
310
|
+
columns={columnsData}
|
311
|
+
headerType="primary"
|
312
|
+
withCheckbox={true}
|
313
|
+
onSelect={onSelectClick}
|
314
|
+
allSelected={allSelected}
|
315
|
+
noDataContent="No data found"
|
316
|
+
/>
|
317
|
+
</>
|
318
|
+
);
|
319
|
+
},
|
320
|
+
};
|
321
|
+
export const TableWithNoData: Story = {
|
322
|
+
args: {
|
323
|
+
...defaultArgs,
|
324
|
+
data: [],
|
325
|
+
columns: [],
|
326
|
+
},
|
327
|
+
render: () => {
|
328
|
+
const [tableData] = useState([]);
|
329
|
+
|
330
|
+
return (
|
331
|
+
<>
|
332
|
+
<Table
|
333
|
+
{...defaultArgs}
|
334
|
+
data={tableData}
|
335
|
+
columns={columnsData}
|
336
|
+
headerType="primary"
|
337
|
+
noDataContent="No data found"
|
338
|
+
noDataImageSize="small"
|
339
|
+
height="500px"
|
340
|
+
/>
|
341
|
+
</>
|
342
|
+
);
|
343
|
+
},
|
344
|
+
};
|
345
|
+
export default meta;
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import './Table.scss';
|
2
|
+
// import Checkbox from '../Checkbox';
|
3
|
+
import { isFunction } from '../../assets/utils/functionUtils';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
import { ColumnsProps, DataProps, TableProps } from './Types';
|
6
|
+
import { prepareData } from '../../utils/TableCell/TableCell';
|
7
|
+
|
8
|
+
// import NoData from '../NoData/NoData';
|
9
|
+
|
10
|
+
const Table = ({
|
11
|
+
data = [],
|
12
|
+
columns = [],
|
13
|
+
headerType,
|
14
|
+
// withCheckbox,
|
15
|
+
// onSelect,
|
16
|
+
// allSelected,
|
17
|
+
// partialSelected = false,
|
18
|
+
withFixedHeader = true,
|
19
|
+
borderWithRadius = false,
|
20
|
+
// headerCheckboxDisabled = false,
|
21
|
+
// noDataContent,
|
22
|
+
// noDataImage,
|
23
|
+
// noDataImageSize,
|
24
|
+
height = '100%',
|
25
|
+
className = '',
|
26
|
+
}: TableProps) => {
|
27
|
+
const hanleOnclick = (column: ColumnsProps, row: DataProps) => {
|
28
|
+
let { onClick, accessor } = column;
|
29
|
+
if (onClick && isFunction(onClick)) {
|
30
|
+
onClick(accessor, row);
|
31
|
+
}
|
32
|
+
};
|
33
|
+
if (!(data.length >= 0)) return null;
|
34
|
+
return (
|
35
|
+
<div
|
36
|
+
style={{ height: height }}
|
37
|
+
className={classNames(className, {
|
38
|
+
'ff-fixed-header-table': withFixedHeader,
|
39
|
+
'border-borderRadius': borderWithRadius,
|
40
|
+
})}
|
41
|
+
>
|
42
|
+
<table className={classNames(`ff-table`)} cellSpacing={0}>
|
43
|
+
<thead
|
44
|
+
className={classNames({
|
45
|
+
'ff-fixed-header': withFixedHeader,
|
46
|
+
})}
|
47
|
+
>
|
48
|
+
<tr>
|
49
|
+
{/* columns.map((column, index) */}
|
50
|
+
{columns.map((column) => (
|
51
|
+
<th
|
52
|
+
className={headerType && `${headerType}-bg`}
|
53
|
+
key={column.header}
|
54
|
+
style={{ width: column?.width }}
|
55
|
+
>
|
56
|
+
<div>
|
57
|
+
{/* {index === 0 && withCheckbox && (
|
58
|
+
<span className="ff-table-checkbox">
|
59
|
+
<Checkbox
|
60
|
+
onChange={(e) => {
|
61
|
+
onSelectClick(e, { allSelected: e.target.checked });
|
62
|
+
}}
|
63
|
+
checked={
|
64
|
+
allSelected !== undefined ? allSelected : false
|
65
|
+
}
|
66
|
+
partial={!!partialSelected}
|
67
|
+
disabled={headerCheckboxDisabled}
|
68
|
+
/>
|
69
|
+
</span>
|
70
|
+
)} */}
|
71
|
+
|
72
|
+
{column.header}
|
73
|
+
</div>
|
74
|
+
</th>
|
75
|
+
))}
|
76
|
+
</tr>
|
77
|
+
</thead>
|
78
|
+
<tbody>
|
79
|
+
{data.length > 0 &&
|
80
|
+
data.map((row: any, index: number) => (
|
81
|
+
<tr key={row.id || index}>
|
82
|
+
{columns.map((column, i) => {
|
83
|
+
return (
|
84
|
+
<td
|
85
|
+
key={column.accessor + i}
|
86
|
+
onClick={() => hanleOnclick(column, row)}
|
87
|
+
className={classNames(column.className, {
|
88
|
+
'clickable-cell': column.onClick,
|
89
|
+
})}
|
90
|
+
>
|
91
|
+
<div>
|
92
|
+
{/* {i === 0 && withCheckbox && (
|
93
|
+
<span className="ff-table-checkbox">
|
94
|
+
<Checkbox
|
95
|
+
onChange={(e) => {
|
96
|
+
onSelectClick(e, row);
|
97
|
+
}}
|
98
|
+
checked={row.checked}
|
99
|
+
disabled={!!row.disabled}
|
100
|
+
/>
|
101
|
+
</span>
|
102
|
+
)} */}
|
103
|
+
{prepareData(row, column)}
|
104
|
+
</div>
|
105
|
+
</td>
|
106
|
+
);
|
107
|
+
})}
|
108
|
+
</tr>
|
109
|
+
))}
|
110
|
+
</tbody>
|
111
|
+
</table>
|
112
|
+
{/* {data.length <= 0 && (
|
113
|
+
<div
|
114
|
+
className="no-data-content"
|
115
|
+
style={{ height: `calc(${height} - 50px)` }}
|
116
|
+
>
|
117
|
+
<NoData
|
118
|
+
image={noDataImage ? noDataImage : 'no_data_found'}
|
119
|
+
content={noDataContent}
|
120
|
+
size={noDataImageSize}
|
121
|
+
/>
|
122
|
+
</div>
|
123
|
+
)} */}
|
124
|
+
</div>
|
125
|
+
);
|
126
|
+
};
|
127
|
+
|
128
|
+
export default Table;
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
|
3
|
+
export interface ColumnsProps {
|
4
|
+
/**
|
5
|
+
* column name
|
6
|
+
*/
|
7
|
+
header: string;
|
8
|
+
/**
|
9
|
+
* data key for particular column
|
10
|
+
*/
|
11
|
+
accessor: string;
|
12
|
+
/**
|
13
|
+
* className for a column
|
14
|
+
*/
|
15
|
+
className?: string;
|
16
|
+
/**
|
17
|
+
* width of a column
|
18
|
+
*/
|
19
|
+
width?: number;
|
20
|
+
/**
|
21
|
+
* data for the column
|
22
|
+
*/
|
23
|
+
cell?: (e: any) => JSX.Element | string | ReactNode;
|
24
|
+
|
25
|
+
onClick?: (colum: string, row: DataProps) => void;
|
26
|
+
}
|
27
|
+
export interface DataProps {
|
28
|
+
/**
|
29
|
+
* data for each row
|
30
|
+
*/
|
31
|
+
[key: string]: any;
|
32
|
+
}
|
33
|
+
export interface SelectedItemProps {
|
34
|
+
/**
|
35
|
+
* selected row object | All selected flag
|
36
|
+
*/
|
37
|
+
[key: string]: string | number | boolean;
|
38
|
+
}
|
39
|
+
export interface TableProps {
|
40
|
+
/**
|
41
|
+
* Data for table
|
42
|
+
*/
|
43
|
+
data: Array<number | string | DataProps>;
|
44
|
+
/**
|
45
|
+
* Column details for table
|
46
|
+
*/
|
47
|
+
columns: Array<any>;
|
48
|
+
/**
|
49
|
+
* Header type to have different background color
|
50
|
+
*/
|
51
|
+
headerType: 'default' | 'primary' | 'secondary';
|
52
|
+
/**
|
53
|
+
* withFixedHeader prop to have non-scrollable fixed table header
|
54
|
+
*/
|
55
|
+
withFixedHeader?: boolean;
|
56
|
+
/**
|
57
|
+
* borderWithRadius prop to have table with border 1px and borderRadius 5px
|
58
|
+
*/
|
59
|
+
borderWithRadius?: boolean;
|
60
|
+
/**
|
61
|
+
* Check box feature to select the row
|
62
|
+
*/
|
63
|
+
withCheckbox?: boolean;
|
64
|
+
/**
|
65
|
+
* Event for checkbox onClick
|
66
|
+
*/
|
67
|
+
onSelect?: (e: object, arg: SelectedItemProps) => void;
|
68
|
+
/**
|
69
|
+
* Check box feature to select the row
|
70
|
+
*/
|
71
|
+
allSelected?: boolean;
|
72
|
+
/**
|
73
|
+
* send true to show partial checkbox in the header
|
74
|
+
*/
|
75
|
+
partialSelected?: boolean;
|
76
|
+
/**
|
77
|
+
* send true to disable the checkbox in the header
|
78
|
+
*/
|
79
|
+
headerCheckboxDisabled?: boolean;
|
80
|
+
/**
|
81
|
+
* The content that to be displayed if no data not found
|
82
|
+
*/
|
83
|
+
noDataContent: string | ReactNode;
|
84
|
+
/**
|
85
|
+
* Image that to be displayed if you don't have data
|
86
|
+
*/
|
87
|
+
noDataImage?: string;
|
88
|
+
/**
|
89
|
+
* Size of the image that to be displayed if you don't have data
|
90
|
+
*/
|
91
|
+
noDataImageSize?: 'x-large' | 'large' | 'medium' | 'small' | 'x-small';
|
92
|
+
/**
|
93
|
+
* Height of the table in string
|
94
|
+
*/
|
95
|
+
height?: string;
|
96
|
+
/**
|
97
|
+
* classNames for the table container
|
98
|
+
*/
|
99
|
+
className?: string;
|
100
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Table';
|