pixelize-design-library 2.1.18 → 2.1.20
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/.github/workflows/build.yml +31 -0
- package/dist/index.d.mts +1468 -0
- package/dist/index.d.ts +1468 -55
- package/dist/index.js +263 -148
- package/dist/index.mjs +263 -0
- package/package.json +24 -10
- package/src/Components/Accordion/Accordion.tsx +59 -0
- package/src/Components/Accordion/AccordionProps.tsx +22 -0
- package/src/Components/AlertDialog/AlertDialog.tsx +69 -0
- package/{dist/Components/AlertDialog/AlertDialogProps.d.ts → src/Components/AlertDialog/AlertDialogProps.tsx} +9 -2
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.tsx +42 -0
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChart.tsx +80 -0
- package/src/Components/Apexcharts/ApexBarChart/ApexBarChartProps.tsx +19 -0
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.tsx +34 -0
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChart.tsx +42 -0
- package/src/Components/Apexcharts/ApexPieChart/ApexPieChartProps.tsx +42 -0
- package/src/Components/Breadcrumbs/Breadcrumbs.stories.tsx +27 -0
- package/src/Components/Breadcrumbs/Breadcrumbs.tsx +42 -0
- package/{dist/Components/Breadcrumbs/BreadcrumbsProps.d.ts → src/Components/Breadcrumbs/BreadcrumbsProps.tsx} +2 -1
- package/src/Components/Button/Button.stories.tsx +33 -0
- package/src/Components/Button/Button.styles.ts +104 -0
- package/src/Components/Button/Button.tsx +49 -0
- package/src/Components/Button/ButtonProps.tsx +25 -0
- package/src/Components/ButtonGroupIcon/ButtonGoupIconProps.tsx +46 -0
- package/src/Components/ButtonGroupIcon/ButtonGroupIcon.stories.tsx +37 -0
- package/src/Components/ButtonGroupIcon/ButtonGroupIcon.tsx +159 -0
- package/src/Components/Buttons/Buttons.tsx +16 -0
- package/{dist/Components/Buttons/ButtonsProps.d.ts → src/Components/Buttons/ButtonsProps.ts} +1 -1
- package/src/Components/Card/Card.tsx +35 -0
- package/src/Components/Card/CardProps.tsx +41 -0
- package/src/Components/Checkbox/Checkbox.stories.tsx +46 -0
- package/src/Components/Checkbox/Checkbox.styles.ts +56 -0
- package/src/Components/Checkbox/Checkbox.tsx +68 -0
- package/src/Components/Checkbox/CheckboxProps.tsx +42 -0
- package/src/Components/Common/ErrorComponent.tsx +16 -0
- package/src/Components/Common/ErrorMessage.tsx +22 -0
- package/src/Components/Common/FormLabel.tsx +48 -0
- package/src/Components/Common/HelperText.tsx +14 -0
- package/src/Components/Common/Label.tsx +12 -0
- package/src/Components/ContactForm/ContactForm.tsx +250 -0
- package/src/Components/ContactForm/ContactFormProps.tsx +10 -0
- package/src/Components/DatePicker/DatePicker.tsx +378 -0
- package/src/Components/DatePicker/DatePickerProps.tsx +48 -0
- package/src/Components/DatePicker/TimePicker.tsx +112 -0
- package/src/Components/Divider/Divider.tsx +17 -0
- package/src/Components/Drawer/Drawer.tsx +66 -0
- package/src/Components/Drawer/DrawerProps.tsx +11 -0
- package/src/Components/Dropdown/DropDown.tsx +189 -0
- package/src/Components/Dropdown/DropdownProps.tsx +26 -0
- package/src/Components/Editor/Editor.tsx +23 -0
- package/src/Components/Editor/EditorProps.tsx +8 -0
- package/src/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.tsx +78 -0
- package/src/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.tsx +12 -0
- package/src/Components/FileUpload/FileUpload.tsx +282 -0
- package/src/Components/FileUpload/FileUploadProps.tsx +34 -0
- package/src/Components/FileUpload/constants.ts +30 -0
- package/src/Components/Form/FormWrapper.tsx +47 -0
- package/src/Components/Header/Header.tsx +92 -0
- package/src/Components/Header/HeaderActions.tsx +96 -0
- package/src/Components/Header/HeaderProps.ts +72 -0
- package/src/Components/Header/components/desktopMenu.tsx +116 -0
- package/src/Components/Header/components/mobileMenu.tsx +99 -0
- package/src/Components/Input/Input/Input.tsx +56 -0
- package/{dist/Components/Input/Input/InputProps.d.ts → src/Components/Input/Input/InputProps.tsx} +2 -1
- package/src/Components/Input/TextInput.stories.tsx +46 -0
- package/{dist/Components/Input/TextInput.styles.js → src/Components/Input/TextInput.styles.ts} +20 -19
- package/src/Components/Input/TextInput.tsx +112 -0
- package/{dist/Components/Input/TextInputProps.d.ts → src/Components/Input/TextInputProps.tsx} +21 -2
- package/src/Components/InputTextArea/InputTextArea.stories.tsx +49 -0
- package/src/Components/InputTextArea/InputTextArea.tsx +54 -0
- package/{dist/Components/InputTextArea/InputTextAreaProps.d.ts → src/Components/InputTextArea/InputTextAreaProps.tsx} +2 -1
- package/src/Components/KanbanBoard/AccountCard.tsx +121 -0
- package/src/Components/KanbanBoard/AccountRow.tsx +35 -0
- package/src/Components/KanbanBoard/KanbanActions/KanbanActions.tsx +37 -0
- package/src/Components/KanbanBoard/KanbanBoard.tsx +185 -0
- package/src/Components/KanbanBoard/KanbanBoardProps.ts +34 -0
- package/src/Components/Loading/Loading.stories.tsx +26 -0
- package/src/Components/Loading/Loading.tsx +80 -0
- package/src/Components/Loading/LoadingProps.tsx +5 -0
- package/src/Components/Modal/Modal.stories.tsx +107 -0
- package/src/Components/Modal/Modal.tsx +107 -0
- package/src/Components/Modal/ModalProps.tsx +22 -0
- package/src/Components/MultiSelect/MultiSelect.tsx +154 -0
- package/src/Components/MultiSelect/MultiSelectProps.tsx +20 -0
- package/src/Components/NavigationBar/NavBar.stories.tsx +27 -0
- package/src/Components/NavigationBar/NavigationBar.tsx +125 -0
- package/src/Components/NavigationBar/NavigationBarProps.tsx +19 -0
- package/src/Components/NoteTextArea/NoteTextArea.tsx +409 -0
- package/src/Components/NoteTextArea/NoteTextAreaProps.tsx +22 -0
- package/src/Components/NumberInput/NumberInput.stories.tsx +32 -0
- package/src/Components/NumberInput/NumberInput.tsx +63 -0
- package/src/Components/NumberInput/NumberInputProps.tsx +28 -0
- package/src/Components/PinInput/PinInput.stories.tsx +41 -0
- package/src/Components/PinInput/PinInput.tsx +49 -0
- package/src/Components/PinInput/PinInputProps.tsx +33 -0
- package/src/Components/PinInputs/PinInputs.tsx +63 -0
- package/{dist/Components/PinInputs/PinInputsProps.d.ts → src/Components/PinInputs/PinInputsProps.tsx} +1 -1
- package/src/Components/ProductCard/ProductCard.tsx +77 -0
- package/{dist/Components/ProductCard/ProductCardProps.d.ts → src/Components/ProductCard/ProductCardProps.tsx} +15 -14
- package/src/Components/ProductCard/ProductLabel.tsx +13 -0
- package/src/Components/ProductCard/ProductPrice.tsx +177 -0
- package/src/Components/ProductCard/ProductReview.tsx +37 -0
- package/src/Components/ProductCard/ProductTags.tsx +57 -0
- package/src/Components/ProfileCard/ProfileCard.stories.tsx +31 -0
- package/src/Components/ProfileCard/ProfileCard.tsx +97 -0
- package/src/Components/ProfileCard/ProfileCardProps.tsx +39 -0
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.tsx +26 -0
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewer.tsx +177 -0
- package/src/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.tsx +18 -0
- package/src/Components/ProgressBar/ProgressBar.stories.tsx +48 -0
- package/src/Components/ProgressBar/ProgressBar.tsx +31 -0
- package/{dist/Components/ProgressBar/ProgressBarProps.d.ts → src/Components/ProgressBar/ProgressBarProps.tsx} +6 -5
- package/src/Components/RadioButton/RadioButton.stories.tsx +47 -0
- package/src/Components/RadioButton/RadioButton.tsx +78 -0
- package/src/Components/RadioButton/RadioButtonProps.tsx +10 -0
- package/src/Components/Reorder/Reorder.tsx +121 -0
- package/src/Components/Reorder/ReorderProps.tsx +11 -0
- package/src/Components/Search/Search.tsx +80 -0
- package/src/Components/Search/SearchProps.tsx +7 -0
- package/src/Components/SearchSelect/SearchSelect.tsx +525 -0
- package/src/Components/SearchSelect/SearchSelectProps.tsx +60 -0
- package/src/Components/SearchSelect/SelectTruncatedLabel.tsx +31 -0
- package/src/Components/Select/Select.stories.tsx +59 -0
- package/src/Components/Select/Select.styles.ts +97 -0
- package/src/Components/Select/Select.tsx +89 -0
- package/src/Components/Select/SelectProps.tsx +37 -0
- package/src/Components/SelectSearch/SelectSearch.tsx +447 -0
- package/src/Components/SelectSearch/SelectSearchProps.tsx +43 -0
- package/src/Components/SideBar/SideBar.tsx +206 -0
- package/src/Components/SideBar/SideBarProps.tsx +31 -0
- package/src/Components/SideBar/Sidebar.stories.tsx +80 -0
- package/src/Components/SideBar/components/MenuItemBox.tsx +217 -0
- package/src/Components/SideBar/components/MenuItems.tsx +29 -0
- package/src/Components/SideBar/components/MenuPopoverContent.tsx +98 -0
- package/src/Components/SideBar/components/TextTruncation.tsx +76 -0
- package/src/Components/Skeletons/Skeleton.stories.tsx +65 -0
- package/src/Components/Skeletons/SkeletonProps.tsx +23 -0
- package/src/Components/Skeletons/Skeletons.tsx +51 -0
- package/src/Components/Slider/Slider.tsx +121 -0
- package/src/Components/Switch/Switch.tsx +104 -0
- package/src/Components/Switch/SwitchProps.tsx +28 -0
- package/src/Components/Table/Components/HeaderActions.tsx +79 -0
- package/src/Components/Table/Components/Pagination.tsx +101 -0
- package/src/Components/Table/Components/TableActions.tsx +75 -0
- package/src/Components/Table/Components/TableBody.tsx +299 -0
- package/src/Components/Table/Components/TableFilters.tsx +77 -0
- package/src/Components/Table/Components/TableHeader.tsx +314 -0
- package/src/Components/Table/Components/TableLoading.tsx +83 -0
- package/src/Components/Table/Components/TableSearch.tsx +84 -0
- package/src/Components/Table/Components/useDebounce.ts +31 -0
- package/src/Components/Table/Components/useTable.ts +220 -0
- package/src/Components/Table/Table.stories.tsx +48 -0
- package/src/Components/Table/Table.tsx +258 -0
- package/src/Components/Table/TableProps.tsx +163 -0
- package/src/Components/Table/TableSettings/ManageColumns.tsx +148 -0
- package/src/Components/Table/TableSettings/TableSettings.tsx +153 -0
- package/{dist/Components/Table/TableToDo.js → src/Components/Table/TableToDo.tsx} +105 -100
- package/src/Components/Tag/Tag.styles.tsx +56 -0
- package/src/Components/Tag/Tag.tsx +68 -0
- package/src/Components/Timeline/Timeline.tsx +310 -0
- package/src/Components/Timeline/TimelineProps.tsx +22 -0
- package/src/Components/Toaster/Toaster.stories.tsx +60 -0
- package/src/Components/Toaster/Toaster.tsx +99 -0
- package/{dist/Components/Toaster/ToasterProps.d.ts → src/Components/Toaster/ToasterProps.tsx} +9 -6
- package/src/Components/Toggle/TableToggle.tsx +68 -0
- package/{dist/Components/Toggle/TableToggleProps.d.ts → src/Components/Toggle/TableToggleProps.ts} +3 -2
- package/src/Components/ToolTip/ToolTip.stories.tsx +38 -0
- package/src/Components/ToolTip/ToolTip.tsx +62 -0
- package/src/Components/ToolTip/ToolTipProps.tsx +46 -0
- package/src/Components/Trail/EditableCell.tsx +116 -0
- package/src/Components/Trail/SelectAllCheckbox.tsx +22 -0
- package/{dist/Components/Trail/TrailWorks.js → src/Components/Trail/TrailWorks.tsx} +108 -65
- package/src/Components/Trail/data.ts +42 -0
- package/src/Constants/Sidebar.ts +39 -0
- package/src/Hooks/usePreferences.ts +105 -0
- package/{dist/Theme/Dark/theme.js → src/Theme/Dark/theme.ts} +74 -79
- package/src/Theme/Default/palette.ts +373 -0
- package/src/Theme/Default/theme.ts +16 -0
- package/src/Theme/Meadow/palette.ts +372 -0
- package/src/Theme/Meadow/theme.ts +17 -0
- package/src/Theme/Radiant/palette.ts +372 -0
- package/src/Theme/Radiant/theme.ts +17 -0
- package/src/Theme/Skyline/palette.ts +372 -0
- package/src/Theme/Skyline/theme.ts +17 -0
- package/{dist/Theme/common.js → src/Theme/common.ts} +30 -22
- package/src/Theme/componentStyles.ts +13 -0
- package/src/Theme/fonts.ts +41 -0
- package/{dist/Theme/index.d.ts → src/Theme/index.ts} +8 -6
- package/src/Theme/space.ts +34 -0
- package/src/Theme/theme.ts +9 -0
- package/src/Theme/themeProps.ts +477 -0
- package/src/Theme/useCustomTheme.ts +6 -0
- package/src/Utils/table.ts +200 -0
- package/src/index.ts +146 -0
- package/src/types/pixelize-design-library.d.ts +4 -0
- package/src/withTheme.tsx +20 -0
- package/tsconfig.json +23 -0
- package/dist/App.d.ts +0 -4
- package/dist/App.js +0 -158
- package/dist/Assets/defaultLogo.d.ts +0 -3
- package/dist/Assets/defaultLogo.js +0 -15
- package/dist/Components/Accordion/Accordion.d.ts +0 -4
- package/dist/Components/Accordion/Accordion.js +0 -40
- package/dist/Components/Accordion/AccordionProps.d.ts +0 -17
- package/dist/Components/Accordion/AccordionProps.js +0 -2
- package/dist/Components/AlertDialog/AlertDialog.d.ts +0 -4
- package/dist/Components/AlertDialog/AlertDialog.js +0 -20
- package/dist/Components/AlertDialog/AlertDialogProps.js +0 -2
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.d.ts +0 -3
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.js +0 -64
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.d.ts +0 -1
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChart.stories.js +0 -6
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChartProps.d.ts +0 -19
- package/dist/Components/Apexcharts/ApexBarChart/ApexBarChartProps.js +0 -2
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.d.ts +0 -3
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +0 -29
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.d.ts +0 -1
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.stories.js +0 -6
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.d.ts +0 -41
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChartProps.js +0 -2
- package/dist/Components/Breadcrumbs/Breadcrumbs.d.ts +0 -3
- package/dist/Components/Breadcrumbs/Breadcrumbs.js +0 -17
- package/dist/Components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -1
- package/dist/Components/Breadcrumbs/Breadcrumbs.stories.js +0 -6
- package/dist/Components/Breadcrumbs/BreadcrumbsProps.js +0 -2
- package/dist/Components/Button/Button.d.ts +0 -5
- package/dist/Components/Button/Button.js +0 -32
- package/dist/Components/Button/Button.stories.d.ts +0 -1
- package/dist/Components/Button/Button.stories.js +0 -6
- package/dist/Components/Button/Button.styles.d.ts +0 -2
- package/dist/Components/Button/Button.styles.js +0 -112
- package/dist/Components/Button/ButtonProps.d.ts +0 -13
- package/dist/Components/Button/ButtonProps.js +0 -2
- package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +0 -33
- package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.js +0 -2
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.d.ts +0 -5
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +0 -86
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.stories.d.ts +0 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.stories.js +0 -6
- package/dist/Components/Buttons/Buttons.d.ts +0 -4
- package/dist/Components/Buttons/Buttons.js +0 -11
- package/dist/Components/Buttons/ButtonsProps.js +0 -2
- package/dist/Components/Card/Card.d.ts +0 -3
- package/dist/Components/Card/Card.js +0 -12
- package/dist/Components/Card/CardProps.d.ts +0 -14
- package/dist/Components/Card/CardProps.js +0 -2
- package/dist/Components/Checkbox/Checkbox.d.ts +0 -3
- package/dist/Components/Checkbox/Checkbox.js +0 -20
- package/dist/Components/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/Components/Checkbox/Checkbox.stories.js +0 -7
- package/dist/Components/Checkbox/Checkbox.styles.d.ts +0 -2
- package/dist/Components/Checkbox/Checkbox.styles.js +0 -54
- package/dist/Components/Checkbox/CheckboxProps.d.ts +0 -15
- package/dist/Components/Checkbox/CheckboxProps.js +0 -2
- package/dist/Components/Common/ErrorComponent.d.ts +0 -6
- package/dist/Components/Common/ErrorComponent.js +0 -16
- package/dist/Components/Common/ErrorMessage.d.ts +0 -5
- package/dist/Components/Common/ErrorMessage.js +0 -17
- package/dist/Components/Common/FormLabel.d.ts +0 -8
- package/dist/Components/Common/FormLabel.js +0 -22
- package/dist/Components/Common/HelperText.d.ts +0 -5
- package/dist/Components/Common/HelperText.js +0 -14
- package/dist/Components/Common/Label.d.ts +0 -7
- package/dist/Components/Common/Label.js +0 -13
- package/dist/Components/ContactForm/ContactForm.d.ts +0 -4
- package/dist/Components/ContactForm/ContactForm.js +0 -215
- package/dist/Components/ContactForm/ContactFormProps.d.ts +0 -9
- package/dist/Components/ContactForm/ContactFormProps.js +0 -2
- package/dist/Components/DatePicker/DatePicker.d.ts +0 -3
- package/dist/Components/DatePicker/DatePicker.js +0 -235
- package/dist/Components/DatePicker/DatePickerProps.d.ts +0 -42
- package/dist/Components/DatePicker/DatePickerProps.js +0 -2
- package/dist/Components/DatePicker/TimePicker.d.ts +0 -4
- package/dist/Components/DatePicker/TimePicker.js +0 -101
- package/dist/Components/Divider/Divider.d.ts +0 -3
- package/dist/Components/Divider/Divider.js +0 -14
- package/dist/Components/Drawer/Drawer.d.ts +0 -12
- package/dist/Components/Drawer/Drawer.js +0 -40
- package/dist/Components/Drawer/DrawerProps.d.ts +0 -8
- package/dist/Components/Drawer/DrawerProps.js +0 -2
- package/dist/Components/Dropdown/DropDown.d.ts +0 -4
- package/dist/Components/Dropdown/DropDown.js +0 -97
- package/dist/Components/Dropdown/DropdownProps.d.ts +0 -26
- package/dist/Components/Dropdown/DropdownProps.js +0 -2
- package/dist/Components/Editor/Editor.d.ts +0 -3
- package/dist/Components/Editor/Editor.js +0 -12
- package/dist/Components/Editor/EditorProps.d.ts +0 -5
- package/dist/Components/Editor/EditorProps.js +0 -2
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.d.ts +0 -3
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +0 -44
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.d.ts +0 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.js +0 -2
- package/dist/Components/FileUpload/FileUpload.d.ts +0 -4
- package/dist/Components/FileUpload/FileUpload.js +0 -156
- package/dist/Components/FileUpload/FileUploadProps.d.ts +0 -11
- package/dist/Components/FileUpload/FileUploadProps.js +0 -2
- package/dist/Components/FileUpload/constants.d.ts +0 -3
- package/dist/Components/FileUpload/constants.js +0 -28
- package/dist/Components/Form/FormWrapper.d.ts +0 -7
- package/dist/Components/Form/FormWrapper.js +0 -19
- package/dist/Components/Header/Header.d.ts +0 -4
- package/dist/Components/Header/Header.js +0 -57
- package/dist/Components/Header/HeaderActions.d.ts +0 -23
- package/dist/Components/Header/HeaderActions.js +0 -37
- package/dist/Components/Header/HeaderProps.d.ts +0 -44
- package/dist/Components/Header/HeaderProps.js +0 -2
- package/dist/Components/Header/components/desktopMenu.d.ts +0 -4
- package/dist/Components/Header/components/desktopMenu.js +0 -33
- package/dist/Components/Header/components/mobileMenu.d.ts +0 -4
- package/dist/Components/Header/components/mobileMenu.js +0 -32
- package/dist/Components/Input/Input/Input.d.ts +0 -4
- package/dist/Components/Input/Input/Input.js +0 -45
- package/dist/Components/Input/Input/InputProps.js +0 -2
- package/dist/Components/Input/TextInput.d.ts +0 -4
- package/dist/Components/Input/TextInput.js +0 -68
- package/dist/Components/Input/TextInput.stories.d.ts +0 -1
- package/dist/Components/Input/TextInput.stories.js +0 -8
- package/dist/Components/Input/TextInput.styles.d.ts +0 -2
- package/dist/Components/Input/TextInputProps.js +0 -2
- package/dist/Components/InputTextArea/InputTextArea.d.ts +0 -3
- package/dist/Components/InputTextArea/InputTextArea.js +0 -16
- package/dist/Components/InputTextArea/InputTextArea.stories.d.ts +0 -1
- package/dist/Components/InputTextArea/InputTextArea.stories.js +0 -7
- package/dist/Components/InputTextArea/InputTextAreaProps.js +0 -2
- package/dist/Components/KaTable/CustomHeader.d.ts +0 -14
- package/dist/Components/KaTable/CustomHeader.js +0 -69
- package/dist/Components/KaTable/KaTable.d.ts +0 -13
- package/dist/Components/KaTable/KaTable.js +0 -111
- package/dist/Components/KaTable/KaTableProps.d.ts +0 -23
- package/dist/Components/KaTable/KaTableProps.js +0 -2
- package/dist/Components/KaTable/SelectionCell.d.ts +0 -8
- package/dist/Components/KaTable/SelectionCell.js +0 -38
- package/dist/Components/KaTable/SelectionHeader.d.ts +0 -3
- package/dist/Components/KaTable/SelectionHeader.js +0 -56
- package/dist/Components/KaTable/ka-table.css +0 -27
- package/dist/Components/KaTable/useMergedChildComponents.d.ts +0 -14
- package/dist/Components/KaTable/useMergedChildComponents.js +0 -224
- package/dist/Components/KanbanBoard/AccountCard.d.ts +0 -9
- package/dist/Components/KanbanBoard/AccountCard.js +0 -74
- package/dist/Components/KanbanBoard/AccountRow.d.ts +0 -6
- package/dist/Components/KanbanBoard/AccountRow.js +0 -20
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.d.ts +0 -9
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.js +0 -26
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts +0 -4
- package/dist/Components/KanbanBoard/KanbanBoard.js +0 -120
- package/dist/Components/KanbanBoard/KanbanBoardProps.d.ts +0 -27
- package/dist/Components/KanbanBoard/KanbanBoardProps.js +0 -2
- package/dist/Components/Loading/Loading.d.ts +0 -3
- package/dist/Components/Loading/Loading.js +0 -36
- package/dist/Components/Loading/Loading.stories.d.ts +0 -1
- package/dist/Components/Loading/Loading.stories.js +0 -7
- package/dist/Components/Loading/LoadingProps.d.ts +0 -5
- package/dist/Components/Loading/LoadingProps.js +0 -2
- package/dist/Components/Modal/Modal.d.ts +0 -12
- package/dist/Components/Modal/Modal.js +0 -50
- package/dist/Components/Modal/Modal.stories.d.ts +0 -1
- package/dist/Components/Modal/Modal.stories.js +0 -7
- package/dist/Components/Modal/ModalProps.d.ts +0 -11
- package/dist/Components/Modal/ModalProps.js +0 -2
- package/dist/Components/MultiSelect/MultiSelect.d.ts +0 -3
- package/dist/Components/MultiSelect/MultiSelect.js +0 -115
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +0 -20
- package/dist/Components/MultiSelect/MultiSelectProps.js +0 -2
- package/dist/Components/NavigationBar/NavBar.stories.d.ts +0 -1
- package/dist/Components/NavigationBar/NavBar.stories.js +0 -3
- package/dist/Components/NavigationBar/NavigationBar.d.ts +0 -3
- package/dist/Components/NavigationBar/NavigationBar.js +0 -50
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +0 -19
- package/dist/Components/NavigationBar/NavigationBarProps.js +0 -2
- package/dist/Components/NoteTextArea/NoteTextArea.d.ts +0 -3
- package/dist/Components/NoteTextArea/NoteTextArea.js +0 -274
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +0 -16
- package/dist/Components/NoteTextArea/NoteTextAreaProps.js +0 -2
- package/dist/Components/NumberInput/NumberInput.d.ts +0 -3
- package/dist/Components/NumberInput/NumberInput.js +0 -16
- package/dist/Components/NumberInput/NumberInput.stories.d.ts +0 -1
- package/dist/Components/NumberInput/NumberInput.stories.js +0 -5
- package/dist/Components/NumberInput/NumberInputProps.d.ts +0 -12
- package/dist/Components/NumberInput/NumberInputProps.js +0 -2
- package/dist/Components/PinInput/PinInput.d.ts +0 -3
- package/dist/Components/PinInput/PinInput.js +0 -15
- package/dist/Components/PinInput/PinInput.stories.d.ts +0 -1
- package/dist/Components/PinInput/PinInput.stories.js +0 -6
- package/dist/Components/PinInput/PinInputProps.d.ts +0 -9
- package/dist/Components/PinInput/PinInputProps.js +0 -2
- package/dist/Components/PinInputs/PinInputs.d.ts +0 -4
- package/dist/Components/PinInputs/PinInputs.js +0 -71
- package/dist/Components/PinInputs/PinInputsProps.js +0 -2
- package/dist/Components/ProductCard/ProductCard.d.ts +0 -4
- package/dist/Components/ProductCard/ProductCard.js +0 -51
- package/dist/Components/ProductCard/ProductCardProps.js +0 -2
- package/dist/Components/ProductCard/ProductLabel.d.ts +0 -6
- package/dist/Components/ProductCard/ProductLabel.js +0 -14
- package/dist/Components/ProductCard/ProductPrice.d.ts +0 -7
- package/dist/Components/ProductCard/ProductPrice.js +0 -88
- package/dist/Components/ProductCard/ProductReview.d.ts +0 -7
- package/dist/Components/ProductCard/ProductReview.js +0 -23
- package/dist/Components/ProductCard/ProductTags.d.ts +0 -7
- package/dist/Components/ProductCard/ProductTags.js +0 -30
- package/dist/Components/ProfileCard/ProfileCard.d.ts +0 -12
- package/dist/Components/ProfileCard/ProfileCard.js +0 -57
- package/dist/Components/ProfileCard/ProfileCard.stories.d.ts +0 -1
- package/dist/Components/ProfileCard/ProfileCard.stories.js +0 -6
- package/dist/Components/ProfileCard/ProfileCardProps.d.ts +0 -16
- package/dist/Components/ProfileCard/ProfileCardProps.js +0 -2
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.d.ts +0 -3
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +0 -94
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.d.ts +0 -1
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.js +0 -6
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.d.ts +0 -19
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.js +0 -2
- package/dist/Components/ProgressBar/ProgressBar.d.ts +0 -3
- package/dist/Components/ProgressBar/ProgressBar.js +0 -12
- package/dist/Components/ProgressBar/ProgressBar.stories.d.ts +0 -1
- package/dist/Components/ProgressBar/ProgressBar.stories.js +0 -7
- package/dist/Components/ProgressBar/ProgressBarProps.js +0 -2
- package/dist/Components/RadioButton/RadioButton.d.ts +0 -5
- package/dist/Components/RadioButton/RadioButton.js +0 -31
- package/dist/Components/RadioButton/RadioButton.stories.d.ts +0 -1
- package/dist/Components/RadioButton/RadioButton.stories.js +0 -7
- package/dist/Components/RadioButton/RadioButtonProps.d.ts +0 -11
- package/dist/Components/RadioButton/RadioButtonProps.js +0 -2
- package/dist/Components/Reorder/Reorder.d.ts +0 -4
- package/dist/Components/Reorder/Reorder.js +0 -50
- package/dist/Components/Reorder/ReorderProps.d.ts +0 -10
- package/dist/Components/Reorder/ReorderProps.js +0 -2
- package/dist/Components/Search/Search.d.ts +0 -3
- package/dist/Components/Search/Search.js +0 -66
- package/dist/Components/Search/SearchProps.d.ts +0 -8
- package/dist/Components/Search/SearchProps.js +0 -2
- package/dist/Components/SearchSelect/SearchSelect.d.ts +0 -4
- package/dist/Components/SearchSelect/SearchSelect.js +0 -237
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +0 -60
- package/dist/Components/SearchSelect/SearchSelectProps.js +0 -2
- package/dist/Components/SearchSelect/SelectTruncatedLabel.d.ts +0 -6
- package/dist/Components/SearchSelect/SelectTruncatedLabel.js +0 -45
- package/dist/Components/Select/Select.d.ts +0 -3
- package/dist/Components/Select/Select.js +0 -54
- package/dist/Components/Select/Select.stories.d.ts +0 -1
- package/dist/Components/Select/Select.stories.js +0 -8
- package/dist/Components/Select/Select.styles.d.ts +0 -2
- package/dist/Components/Select/Select.styles.js +0 -98
- package/dist/Components/Select/SelectProps.d.ts +0 -20
- package/dist/Components/Select/SelectProps.js +0 -2
- package/dist/Components/SelectSearch/SelectSearch.d.ts +0 -3
- package/dist/Components/SelectSearch/SelectSearch.js +0 -239
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +0 -42
- package/dist/Components/SelectSearch/SelectSearchProps.js +0 -2
- package/dist/Components/SideBar/SideBar.d.ts +0 -3
- package/dist/Components/SideBar/SideBar.js +0 -55
- package/dist/Components/SideBar/SideBarProps.d.ts +0 -29
- package/dist/Components/SideBar/SideBarProps.js +0 -2
- package/dist/Components/SideBar/Sidebar.stories.d.ts +0 -1
- package/dist/Components/SideBar/Sidebar.stories.js +0 -7
- package/dist/Components/SideBar/components/MenuItemBox.d.ts +0 -11
- package/dist/Components/SideBar/components/MenuItemBox.js +0 -116
- package/dist/Components/SideBar/components/MenuItems.d.ts +0 -4
- package/dist/Components/SideBar/components/MenuItems.js +0 -13
- package/dist/Components/SideBar/components/MenuPopoverContent.d.ts +0 -9
- package/dist/Components/SideBar/components/MenuPopoverContent.js +0 -37
- package/dist/Components/SideBar/components/TextTruncation.d.ts +0 -8
- package/dist/Components/SideBar/components/TextTruncation.js +0 -77
- package/dist/Components/Skeletons/Skeleton.stories.d.ts +0 -1
- package/dist/Components/Skeletons/Skeleton.stories.js +0 -7
- package/dist/Components/Skeletons/SkeletonProps.d.ts +0 -4
- package/dist/Components/Skeletons/SkeletonProps.js +0 -2
- package/dist/Components/Skeletons/Skeletons.d.ts +0 -3
- package/dist/Components/Skeletons/Skeletons.js +0 -15
- package/dist/Components/Slider/Slider.d.ts +0 -8
- package/dist/Components/Slider/Slider.js +0 -57
- package/dist/Components/Switch/Switch.d.ts +0 -3
- package/dist/Components/Switch/Switch.js +0 -39
- package/dist/Components/Switch/SwitchProps.d.ts +0 -9
- package/dist/Components/Switch/SwitchProps.js +0 -2
- package/dist/Components/Table/Components/HeaderActions.d.ts +0 -7
- package/dist/Components/Table/Components/HeaderActions.js +0 -45
- package/dist/Components/Table/Components/Pagination.d.ts +0 -14
- package/dist/Components/Table/Components/Pagination.js +0 -32
- package/dist/Components/Table/Components/TableActions.d.ts +0 -3
- package/dist/Components/Table/Components/TableActions.js +0 -28
- package/dist/Components/Table/Components/TableBody.d.ts +0 -4
- package/dist/Components/Table/Components/TableBody.js +0 -140
- package/dist/Components/Table/Components/TableFilters.d.ts +0 -4
- package/dist/Components/Table/Components/TableFilters.js +0 -59
- package/dist/Components/Table/Components/TableHeader.d.ts +0 -4
- package/dist/Components/Table/Components/TableHeader.js +0 -147
- package/dist/Components/Table/Components/TableLoading.d.ts +0 -7
- package/dist/Components/Table/Components/TableLoading.js +0 -41
- package/dist/Components/Table/Components/TableSearch.d.ts +0 -6
- package/dist/Components/Table/Components/TableSearch.js +0 -60
- package/dist/Components/Table/Components/useDebounce.d.ts +0 -2
- package/dist/Components/Table/Components/useDebounce.js +0 -28
- package/dist/Components/Table/Components/useTable.d.ts +0 -46
- package/dist/Components/Table/Components/useTable.js +0 -168
- package/dist/Components/Table/Table.css +0 -16
- package/dist/Components/Table/Table.d.ts +0 -3
- package/dist/Components/Table/Table.js +0 -129
- package/dist/Components/Table/Table.stories.d.ts +0 -1
- package/dist/Components/Table/Table.stories.js +0 -9
- package/dist/Components/Table/TableProps.d.ts +0 -112
- package/dist/Components/Table/TableProps.js +0 -2
- package/dist/Components/Table/TableSettings/ManageColumns.d.ts +0 -10
- package/dist/Components/Table/TableSettings/ManageColumns.js +0 -107
- package/dist/Components/Table/TableSettings/TableSettings.d.ts +0 -7
- package/dist/Components/Table/TableSettings/TableSettings.js +0 -73
- package/dist/Components/Table/TableToDo.d.ts +0 -2
- package/dist/Components/Tag/Tag.d.ts +0 -12
- package/dist/Components/Tag/Tag.js +0 -21
- package/dist/Components/Tag/Tag.styles.d.ts +0 -2
- package/dist/Components/Tag/Tag.styles.js +0 -63
- package/dist/Components/Timeline/Timeline.d.ts +0 -4
- package/dist/Components/Timeline/Timeline.js +0 -166
- package/dist/Components/Timeline/TimelineProps.d.ts +0 -20
- package/dist/Components/Timeline/TimelineProps.js +0 -2
- package/dist/Components/Toaster/Toaster.d.ts +0 -4
- package/dist/Components/Toaster/Toaster.js +0 -86
- package/dist/Components/Toaster/Toaster.stories.d.ts +0 -1
- package/dist/Components/Toaster/Toaster.stories.js +0 -8
- package/dist/Components/Toaster/ToasterProps.js +0 -2
- package/dist/Components/Toggle/TableToggle.d.ts +0 -4
- package/dist/Components/Toggle/TableToggle.js +0 -60
- package/dist/Components/Toggle/TableToggleProps.js +0 -2
- package/dist/Components/ToolTip/ToolTip.d.ts +0 -3
- package/dist/Components/ToolTip/ToolTip.js +0 -12
- package/dist/Components/ToolTip/ToolTip.stories.d.ts +0 -1
- package/dist/Components/ToolTip/ToolTip.stories.js +0 -7
- package/dist/Components/ToolTip/ToolTipProps.d.ts +0 -7
- package/dist/Components/ToolTip/ToolTipProps.js +0 -2
- package/dist/Components/Trail/EditableCell.d.ts +0 -11
- package/dist/Components/Trail/EditableCell.js +0 -71
- package/dist/Components/Trail/SelectAllCheckbox.d.ts +0 -8
- package/dist/Components/Trail/SelectAllCheckbox.js +0 -13
- package/dist/Components/Trail/TrailWorks.d.ts +0 -3
- package/dist/Components/Trail/data.d.ts +0 -15
- package/dist/Components/Trail/data.js +0 -29
- package/dist/Constants/Sidebar.d.ts +0 -38
- package/dist/Constants/Sidebar.js +0 -42
- package/dist/Hooks/usePreferences.d.ts +0 -24
- package/dist/Hooks/usePreferences.js +0 -73
- package/dist/Layout.d.ts +0 -3
- package/dist/Layout.js +0 -269
- package/dist/Pages/KaTableExample.d.ts +0 -3
- package/dist/Pages/KaTableExample.js +0 -259
- package/dist/Pages/TInput.d.ts +0 -3
- package/dist/Pages/TInput.js +0 -46
- package/dist/Pages/accordion.d.ts +0 -3
- package/dist/Pages/accordion.js +0 -42
- package/dist/Pages/alertdialog.d.ts +0 -3
- package/dist/Pages/alertdialog.js +0 -44
- package/dist/Pages/button.d.ts +0 -3
- package/dist/Pages/button.js +0 -29
- package/dist/Pages/card.d.ts +0 -3
- package/dist/Pages/card.js +0 -48
- package/dist/Pages/chart.d.ts +0 -3
- package/dist/Pages/chart.js +0 -28
- package/dist/Pages/checkbox.d.ts +0 -3
- package/dist/Pages/checkbox.js +0 -12
- package/dist/Pages/contactForm.d.ts +0 -3
- package/dist/Pages/contactForm.js +0 -16
- package/dist/Pages/datePick.d.ts +0 -3
- package/dist/Pages/datePick.js +0 -70
- package/dist/Pages/drawer.d.ts +0 -3
- package/dist/Pages/drawer.js +0 -48
- package/dist/Pages/dropdown.d.ts +0 -3
- package/dist/Pages/dropdown.js +0 -24
- package/dist/Pages/editor.d.ts +0 -3
- package/dist/Pages/editor.js +0 -14
- package/dist/Pages/fileUpload.d.ts +0 -2
- package/dist/Pages/fileUpload.js +0 -65
- package/dist/Pages/input.d.ts +0 -3
- package/dist/Pages/input.js +0 -42
- package/dist/Pages/kanbanboard.d.ts +0 -3
- package/dist/Pages/kanbanboard.js +0 -115
- package/dist/Pages/modal.d.ts +0 -3
- package/dist/Pages/modal.js +0 -55
- package/dist/Pages/multiSelect.d.ts +0 -3
- package/dist/Pages/multiSelect.js +0 -45
- package/dist/Pages/noteArea.d.ts +0 -3
- package/dist/Pages/noteArea.js +0 -49
- package/dist/Pages/numberInput.d.ts +0 -3
- package/dist/Pages/numberInput.js +0 -39
- package/dist/Pages/photoViewer.d.ts +0 -3
- package/dist/Pages/photoViewer.js +0 -12
- package/dist/Pages/pinInputs.d.ts +0 -3
- package/dist/Pages/pinInputs.js +0 -12
- package/dist/Pages/productCaard.d.ts +0 -3
- package/dist/Pages/productCaard.js +0 -32
- package/dist/Pages/progressbar.d.ts +0 -3
- package/dist/Pages/progressbar.js +0 -12
- package/dist/Pages/radioButton.d.ts +0 -3
- package/dist/Pages/radioButton.js +0 -44
- package/dist/Pages/search.d.ts +0 -3
- package/dist/Pages/search.js +0 -44
- package/dist/Pages/searchSelect.d.ts +0 -3
- package/dist/Pages/searchSelect.js +0 -151
- package/dist/Pages/select.d.ts +0 -3
- package/dist/Pages/select.js +0 -43
- package/dist/Pages/selectSearch.d.ts +0 -3
- package/dist/Pages/selectSearch.js +0 -93
- package/dist/Pages/skeleton.d.ts +0 -3
- package/dist/Pages/skeleton.js +0 -22
- package/dist/Pages/switch.d.ts +0 -3
- package/dist/Pages/switch.js +0 -40
- package/dist/Pages/table.d.ts +0 -2
- package/dist/Pages/table.js +0 -144
- package/dist/Pages/textArea.d.ts +0 -3
- package/dist/Pages/textArea.js +0 -12
- package/dist/Pages/timeline.d.ts +0 -3
- package/dist/Pages/timeline.js +0 -74
- package/dist/Pages/tooltip.d.ts +0 -3
- package/dist/Pages/tooltip.js +0 -12
- package/dist/Pages/toster.d.ts +0 -3
- package/dist/Pages/toster.js +0 -63
- package/dist/Pages/verifyEmail.d.ts +0 -3
- package/dist/Pages/verifyEmail.js +0 -18
- package/dist/Theme/Dark/theme.d.ts +0 -2
- package/dist/Theme/Default/fonts.d.ts +0 -35
- package/dist/Theme/Default/fonts.js +0 -37
- package/dist/Theme/Default/palette.d.ts +0 -370
- package/dist/Theme/Default/palette.js +0 -372
- package/dist/Theme/Default/theme.d.ts +0 -2
- package/dist/Theme/Default/theme.js +0 -23
- package/dist/Theme/Meadow/palette.d.ts +0 -368
- package/dist/Theme/Meadow/palette.js +0 -356
- package/dist/Theme/Meadow/theme.d.ts +0 -2
- package/dist/Theme/Meadow/theme.js +0 -23
- package/dist/Theme/Radiant/palette.d.ts +0 -368
- package/dist/Theme/Radiant/palette.js +0 -356
- package/dist/Theme/Radiant/theme.d.ts +0 -2
- package/dist/Theme/Radiant/theme.js +0 -23
- package/dist/Theme/Skyline/palette.d.ts +0 -368
- package/dist/Theme/Skyline/palette.js +0 -356
- package/dist/Theme/Skyline/theme.d.ts +0 -2
- package/dist/Theme/Skyline/theme.js +0 -23
- package/dist/Theme/common.d.ts +0 -166
- package/dist/Theme/componentStyles.d.ts +0 -7
- package/dist/Theme/componentStyles.js +0 -15
- package/dist/Theme/fonts.d.ts +0 -34
- package/dist/Theme/fonts.js +0 -41
- package/dist/Theme/index.js +0 -20
- package/dist/Theme/space.d.ts +0 -33
- package/dist/Theme/space.js +0 -35
- package/dist/Theme/theme.d.ts +0 -2
- package/dist/Theme/theme.js +0 -9
- package/dist/Theme/themeProps.d.ts +0 -475
- package/dist/Theme/themeProps.js +0 -3
- package/dist/Theme/useCustomTheme.d.ts +0 -2
- package/dist/Theme/useCustomTheme.js +0 -8
- package/dist/Utils/table.d.ts +0 -36
- package/dist/Utils/table.js +0 -168
- package/dist/bootstrap.d.ts +0 -1
- package/dist/bootstrap.js +0 -14
- package/dist/withTheme.d.ts +0 -3
- package/dist/withTheme.js +0 -28
- /package/{dist → src}/Assets/defaultLogo.tsx +0 -0
- /package/{dist → src}/global.css +0 -0
- /package/{dist → src}/index.css +0 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { NoteTextAreaProps } from "./NoteTextAreaProps";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { Spinner } from "@chakra-ui/react";
|
|
5
|
+
import { CustomThemeProps } from "../../Theme/themeProps";
|
|
6
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
7
|
+
import { Paperclip, X } from "lucide-react";
|
|
8
|
+
|
|
9
|
+
const Container = styled.div<{ isActive: boolean }>`
|
|
10
|
+
border: ${({ isActive }) =>
|
|
11
|
+
isActive ? "1px solid #3182ce" : "1px solid #c0c6cc"};
|
|
12
|
+
border-radius: 5px;
|
|
13
|
+
box-shadow: ${({ isActive }) =>
|
|
14
|
+
isActive
|
|
15
|
+
? "-1px 1px 8px 4px rgb(49 130 206 / 24%), 0px 2px 6px 0 rgb(49 130 206 / 19%)"
|
|
16
|
+
: "none"};
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
const TextAreaContainer = styled.div<{ isActive: boolean }>`
|
|
20
|
+
width: 100%;
|
|
21
|
+
cursor: text;
|
|
22
|
+
padding: 12px 15px;
|
|
23
|
+
display: ${({ isActive }) => (isActive ? "block" : "none")};
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const PlaceholderText = styled.div<{ isActive: boolean }>`
|
|
27
|
+
color: #c0c6cc;
|
|
28
|
+
width: 100%;
|
|
29
|
+
cursor: text;
|
|
30
|
+
display: ${({ isActive }) => (isActive ? "block" : "none")};
|
|
31
|
+
padding: 12px 15px;
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
const InputTitle = styled.input`
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: auto;
|
|
37
|
+
border: none;
|
|
38
|
+
outline: none;
|
|
39
|
+
background: none;
|
|
40
|
+
color: black;
|
|
41
|
+
fontsize: 1rem;
|
|
42
|
+
fontweight: 500;
|
|
43
|
+
marginbottom: 2px;
|
|
44
|
+
`;
|
|
45
|
+
|
|
46
|
+
const NotesTextArea = styled.textarea<{ isActive: boolean; noteValue: string }>`
|
|
47
|
+
color: ${({ isActive, noteValue }) =>
|
|
48
|
+
isActive && noteValue ? "#000000" : "#c0c6cc"};
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: auto;
|
|
51
|
+
border: none;
|
|
52
|
+
outline: none;
|
|
53
|
+
background: none;
|
|
54
|
+
fontweight: 300;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const FileUploadLabel = styled.label`
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const AddTitleButton = styled.div`
|
|
62
|
+
color: #616e88;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
fontsize: 0.8rem;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const Button = styled.button<{
|
|
68
|
+
noteValue: string;
|
|
69
|
+
isSaveButton: boolean;
|
|
70
|
+
isLoading: boolean;
|
|
71
|
+
theme: CustomThemeProps;
|
|
72
|
+
disabled: boolean;
|
|
73
|
+
}>`
|
|
74
|
+
border: none;
|
|
75
|
+
padding: 3px 15px;
|
|
76
|
+
text-align: center;
|
|
77
|
+
text-decoration: none;
|
|
78
|
+
background: ${({ isSaveButton, noteValue, isLoading, theme }) =>
|
|
79
|
+
isSaveButton
|
|
80
|
+
? noteValue && !isLoading
|
|
81
|
+
? theme.colors.primary[500]
|
|
82
|
+
: theme.colors.primary[500]
|
|
83
|
+
: "white"};
|
|
84
|
+
color: ${({ isSaveButton, isLoading }) =>
|
|
85
|
+
isSaveButton && !isLoading ? "white" : "white"};
|
|
86
|
+
font-size: 1rem;
|
|
87
|
+
margin-right: 5px;
|
|
88
|
+
border-radius: 5px;
|
|
89
|
+
opacity: ${({ isSaveButton, noteValue, isLoading, disabled }) =>
|
|
90
|
+
isSaveButton && (!noteValue || isLoading || disabled) ? "0.5" : "1"};
|
|
91
|
+
cursor: ${({ isSaveButton, noteValue, isLoading, disabled }) =>
|
|
92
|
+
isSaveButton && (!noteValue || isLoading || disabled)
|
|
93
|
+
? "initial"
|
|
94
|
+
: "pointer"};
|
|
95
|
+
pointer-events: ${({ isLoading }) => (isLoading ? "none" : "auto")};
|
|
96
|
+
`;
|
|
97
|
+
|
|
98
|
+
const CancelButton = styled.button`
|
|
99
|
+
border: none;
|
|
100
|
+
color: #5e5c5c;
|
|
101
|
+
padding: 3px 15px;
|
|
102
|
+
text-align: center;
|
|
103
|
+
text-decoration: none;
|
|
104
|
+
background: white;
|
|
105
|
+
font-size: 1rem;
|
|
106
|
+
margin-right: 5px;
|
|
107
|
+
border-radius: 5px;
|
|
108
|
+
`;
|
|
109
|
+
|
|
110
|
+
const FileViewer = styled.div`
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
width: 300px;
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
const FileEdit = styled(X)`
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
color: #ff0000;
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
const ErrorText = styled.div`
|
|
123
|
+
color: #ff0000;
|
|
124
|
+
font-size: 0.8rem;
|
|
125
|
+
margin-top: 8px;
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
const countWords = (text: string) => {
|
|
129
|
+
return text.trim().split(/\s+/).length;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export default function NoteTextArea({
|
|
133
|
+
width = "100%",
|
|
134
|
+
handleSubmit,
|
|
135
|
+
handleCancel,
|
|
136
|
+
value,
|
|
137
|
+
title,
|
|
138
|
+
file,
|
|
139
|
+
isEditable = false,
|
|
140
|
+
saveButtonLoading,
|
|
141
|
+
maxFileSize = 1 * 1024 * 1024,
|
|
142
|
+
maxFilesSizeError = "Some files are too large. Maximum allowed size is",
|
|
143
|
+
maxNoteWordCount = 15,
|
|
144
|
+
onChange,
|
|
145
|
+
ref,
|
|
146
|
+
}: NoteTextAreaProps) {
|
|
147
|
+
const theme = useCustomTheme();
|
|
148
|
+
const noteAreaRef = useRef<HTMLTextAreaElement>(null);
|
|
149
|
+
const [isActive, setIsActive] = useState<boolean>(false);
|
|
150
|
+
const [noteValue, setNoteValue] = useState<string>("");
|
|
151
|
+
const [titleValue, setTitleValue] = useState<string>("");
|
|
152
|
+
const [titleShow, setTitleShow] = useState<boolean>(false);
|
|
153
|
+
const [files, setFiles] = useState<File[]>([]);
|
|
154
|
+
const [fileError, setFileError] = useState<string>("");
|
|
155
|
+
const [isSaveDisabled, setIsSaveDisabled] = useState(false);
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
const titleWordCount = countWords(titleValue);
|
|
158
|
+
setIsSaveDisabled(titleWordCount > maxNoteWordCount);
|
|
159
|
+
}, [titleValue, maxNoteWordCount]);
|
|
160
|
+
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
const noteWordCount = countWords(noteValue);
|
|
163
|
+
setIsSaveDisabled(noteWordCount > maxNoteWordCount);
|
|
164
|
+
}, [noteValue, maxNoteWordCount]);
|
|
165
|
+
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (isEditable) {
|
|
168
|
+
setIsActive(true);
|
|
169
|
+
if (value) {
|
|
170
|
+
setNoteValue(value);
|
|
171
|
+
}
|
|
172
|
+
if (title) {
|
|
173
|
+
setTitleValue(title);
|
|
174
|
+
setTitleShow(true);
|
|
175
|
+
}
|
|
176
|
+
if (file) {
|
|
177
|
+
setFiles(file);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}, [value, title, file, isEditable]);
|
|
181
|
+
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (!saveButtonLoading) {
|
|
184
|
+
setIsActive(false);
|
|
185
|
+
if (!isEditable) {
|
|
186
|
+
setNoteValue("");
|
|
187
|
+
setTitleValue("");
|
|
188
|
+
setTitleShow(false);
|
|
189
|
+
setFiles([]);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (isEditable) {
|
|
193
|
+
setIsActive(true);
|
|
194
|
+
}
|
|
195
|
+
}, [saveButtonLoading, isEditable]);
|
|
196
|
+
|
|
197
|
+
const handleTextArea = () => {
|
|
198
|
+
setIsActive(true);
|
|
199
|
+
if (!isEditable) {
|
|
200
|
+
setNoteValue("");
|
|
201
|
+
setTitleValue("");
|
|
202
|
+
setTitleShow(false);
|
|
203
|
+
setFiles([]);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const handleCloseTextArea = () => {
|
|
207
|
+
setIsActive(false);
|
|
208
|
+
if (handleCancel) {
|
|
209
|
+
handleCancel(!isActive);
|
|
210
|
+
}
|
|
211
|
+
if (!isEditable) {
|
|
212
|
+
setNoteValue("");
|
|
213
|
+
setTitleValue("");
|
|
214
|
+
setTitleShow(false);
|
|
215
|
+
setFiles([]);
|
|
216
|
+
}
|
|
217
|
+
setFileError("");
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const handleNoteChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
221
|
+
setNoteValue(event.target.value);
|
|
222
|
+
onChange?.(event.target.value);
|
|
223
|
+
adjustHeight();
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
if (isActive && noteAreaRef.current) {
|
|
228
|
+
noteAreaRef.current.focus();
|
|
229
|
+
}
|
|
230
|
+
}, [isActive]);
|
|
231
|
+
|
|
232
|
+
const adjustHeight = () => {
|
|
233
|
+
const textarea = noteAreaRef.current;
|
|
234
|
+
if (!textarea) return;
|
|
235
|
+
textarea.style.height = "auto";
|
|
236
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const handleSetTitle = () => {
|
|
240
|
+
setTitleShow(true);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
const handleTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
244
|
+
event.target.value.length === 0 && setTitleShow(false);
|
|
245
|
+
setTitleValue(event.target.value);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const formatBytes = (bytes: any, decimals = 2) => {
|
|
249
|
+
if (bytes === 0) return "0 Bytes";
|
|
250
|
+
const k = 1024;
|
|
251
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
252
|
+
const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
253
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
254
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const shortenFileName = (name: string, maxLength = 20) => {
|
|
258
|
+
const extension = name.substring(name.lastIndexOf("."));
|
|
259
|
+
if (name.length <= maxLength) return name;
|
|
260
|
+
const nameWithoutExtension = name.replace(extension, "");
|
|
261
|
+
const start = nameWithoutExtension.substring(
|
|
262
|
+
0,
|
|
263
|
+
maxLength - extension.length - 3
|
|
264
|
+
);
|
|
265
|
+
return `${start}...${extension} `;
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
<Container style={{ width }} isActive={isActive}>
|
|
270
|
+
<PlaceholderText isActive={!isActive} onClick={handleTextArea}>
|
|
271
|
+
<span>Add a note...</span>
|
|
272
|
+
</PlaceholderText>
|
|
273
|
+
<TextAreaContainer isActive={isActive}>
|
|
274
|
+
{titleShow && (
|
|
275
|
+
<InputTitle
|
|
276
|
+
value={titleValue}
|
|
277
|
+
onChange={handleTitleChange}
|
|
278
|
+
placeholder="Add a title..."
|
|
279
|
+
ref={ref}
|
|
280
|
+
/>
|
|
281
|
+
)}
|
|
282
|
+
<NotesTextArea
|
|
283
|
+
ref={noteAreaRef}
|
|
284
|
+
isActive={isActive}
|
|
285
|
+
noteValue={noteValue}
|
|
286
|
+
value={noteValue}
|
|
287
|
+
onChange={handleNoteChange}
|
|
288
|
+
placeholder="Add a note..."
|
|
289
|
+
/>
|
|
290
|
+
</TextAreaContainer>
|
|
291
|
+
{isActive && (
|
|
292
|
+
<>
|
|
293
|
+
<hr style={{ margin: 0 }} />
|
|
294
|
+
<div style={{ padding: "12px 15px" }}>
|
|
295
|
+
<div style={{ display: "flex", alignItems: "center" }}>
|
|
296
|
+
<FileUploadLabel htmlFor="file-upload">
|
|
297
|
+
<Paperclip size={17} />
|
|
298
|
+
<input
|
|
299
|
+
id="file-upload"
|
|
300
|
+
type="file"
|
|
301
|
+
style={{ display: "none" }}
|
|
302
|
+
onChange={(e) => {
|
|
303
|
+
const newFiles = Array.from(e.target.files || []);
|
|
304
|
+
const validFiles = newFiles.filter(
|
|
305
|
+
(file) => file.size <= maxFileSize
|
|
306
|
+
);
|
|
307
|
+
const invalidFiles = newFiles.filter(
|
|
308
|
+
(file) => file.size > maxFileSize
|
|
309
|
+
);
|
|
310
|
+
|
|
311
|
+
if (invalidFiles.length > 0) {
|
|
312
|
+
setFileError(
|
|
313
|
+
`${maxFilesSizeError} ${formatBytes(maxFileSize)}.`
|
|
314
|
+
);
|
|
315
|
+
} else {
|
|
316
|
+
setFileError("");
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (validFiles.length > 0) {
|
|
320
|
+
setFiles((prevFiles) => [...prevFiles, ...validFiles]);
|
|
321
|
+
}
|
|
322
|
+
}}
|
|
323
|
+
multiple
|
|
324
|
+
// onChange={(event) => {
|
|
325
|
+
// if (event.target.files && event.target.files.length > 0) {
|
|
326
|
+
// const filesArray = Array.from(event.target.files);
|
|
327
|
+
// const validFiles = filesArray.filter(
|
|
328
|
+
// (file) => file.size <= maxFileSize
|
|
329
|
+
// );
|
|
330
|
+
// setFiles([...files, ...validFiles]);
|
|
331
|
+
// }
|
|
332
|
+
// }}
|
|
333
|
+
/>
|
|
334
|
+
</FileUploadLabel>
|
|
335
|
+
{!titleShow && (
|
|
336
|
+
<>
|
|
337
|
+
<div
|
|
338
|
+
style={{
|
|
339
|
+
height: "15px",
|
|
340
|
+
width: "1px",
|
|
341
|
+
backgroundColor: "#c0c6cc",
|
|
342
|
+
marginRight: "5px",
|
|
343
|
+
marginLeft: "5px",
|
|
344
|
+
}}
|
|
345
|
+
></div>
|
|
346
|
+
<AddTitleButton onClick={handleSetTitle}>
|
|
347
|
+
Add a Title
|
|
348
|
+
</AddTitleButton>
|
|
349
|
+
</>
|
|
350
|
+
)}
|
|
351
|
+
<div style={{ marginLeft: "auto" }}>
|
|
352
|
+
<CancelButton onClick={handleCloseTextArea}>
|
|
353
|
+
Cancel
|
|
354
|
+
</CancelButton>
|
|
355
|
+
<Button
|
|
356
|
+
isSaveButton={true}
|
|
357
|
+
noteValue={noteValue}
|
|
358
|
+
isLoading={saveButtonLoading}
|
|
359
|
+
disabled={!noteValue || isSaveDisabled}
|
|
360
|
+
theme={theme}
|
|
361
|
+
onClick={() => {
|
|
362
|
+
handleSubmit(noteValue, titleValue, files);
|
|
363
|
+
// handleCloseTextArea();
|
|
364
|
+
}}
|
|
365
|
+
>
|
|
366
|
+
{saveButtonLoading && (
|
|
367
|
+
<span style={{ marginRight: "6px" }}>
|
|
368
|
+
<Spinner
|
|
369
|
+
thickness="2px"
|
|
370
|
+
speed="0.75s"
|
|
371
|
+
emptyColor="gray.200"
|
|
372
|
+
color="blue.500"
|
|
373
|
+
size="xs"
|
|
374
|
+
/>
|
|
375
|
+
</span>
|
|
376
|
+
)}
|
|
377
|
+
Save
|
|
378
|
+
</Button>
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
<div style={{ display: "flex", gap: "10px" }}>
|
|
382
|
+
<div>Note:</div>
|
|
383
|
+
<div>You can add up to {maxNoteWordCount} words only</div>
|
|
384
|
+
</div>
|
|
385
|
+
{fileError && <ErrorText>{fileError}</ErrorText>}{" "}
|
|
386
|
+
{/* Display file error */}
|
|
387
|
+
{files.length > 0 && (
|
|
388
|
+
<div>
|
|
389
|
+
{files.map((item, index) => (
|
|
390
|
+
<FileViewer key={index}>
|
|
391
|
+
<>
|
|
392
|
+
<span>{shortenFileName(item.name)}</span>
|
|
393
|
+
<span>{formatBytes(item.size)}</span>
|
|
394
|
+
</>
|
|
395
|
+
<FileEdit
|
|
396
|
+
onClick={() =>
|
|
397
|
+
setFiles(files.filter((fileItem) => fileItem !== item))
|
|
398
|
+
}
|
|
399
|
+
/>
|
|
400
|
+
</FileViewer>
|
|
401
|
+
))}
|
|
402
|
+
</div>
|
|
403
|
+
)}
|
|
404
|
+
</div>
|
|
405
|
+
</>
|
|
406
|
+
)}
|
|
407
|
+
</Container>
|
|
408
|
+
);
|
|
409
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LegacyRef } from "react";
|
|
2
|
+
|
|
3
|
+
export type NoteTextAreaProps = {
|
|
4
|
+
width: number | string;
|
|
5
|
+
handleSubmit: (
|
|
6
|
+
noteValue: string,
|
|
7
|
+
titleValue: string,
|
|
8
|
+
file: File[],
|
|
9
|
+
resetState: void
|
|
10
|
+
) => void;
|
|
11
|
+
value?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
file?: File[];
|
|
14
|
+
isEditable?: boolean;
|
|
15
|
+
handleCancel?: (isActive: boolean) => void;
|
|
16
|
+
saveButtonLoading: boolean;
|
|
17
|
+
maxFileSize?: number;
|
|
18
|
+
maxFilesSizeError?: string;
|
|
19
|
+
maxNoteWordCount?: number;
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
ref?: LegacyRef<HTMLInputElement>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
+
// import NumberInputs from './NumberInput';
|
|
4
|
+
|
|
5
|
+
// export default {
|
|
6
|
+
// title: 'Components/NumberInputs/NumberInputs',
|
|
7
|
+
// component: NumberInputs,
|
|
8
|
+
// } as Meta;
|
|
9
|
+
|
|
10
|
+
// const Template: StoryFn = (args) => <NumberInputs {...args} />;
|
|
11
|
+
|
|
12
|
+
// export const Default = Template.bind({});
|
|
13
|
+
// Default.args = {
|
|
14
|
+
// defaultValue: 0,
|
|
15
|
+
// min: 0,
|
|
16
|
+
// max: 100,
|
|
17
|
+
// step: 1,
|
|
18
|
+
// precision: 0,
|
|
19
|
+
// clampValueOnBlur: true,
|
|
20
|
+
// keepWithinRange: true,
|
|
21
|
+
// size: 'md',
|
|
22
|
+
// maxW: 'full',
|
|
23
|
+
// allowMouseWheel: true,
|
|
24
|
+
// NumberIncrementStepperBg: 'blue.200',
|
|
25
|
+
// NumberIncrementStepperActive: { bg: 'blue.400' },
|
|
26
|
+
// NumberIncrementStepperChildren: '+',
|
|
27
|
+
// NumberDecrementStepperBg: 'blue.200',
|
|
28
|
+
// NumberDecrementStepperActive: { bg: 'blue.400' },
|
|
29
|
+
// NumberDecrementStepperChildren: '-',
|
|
30
|
+
// onChange: (value: number) => console.log(value),
|
|
31
|
+
// };
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
NumberDecrementStepper,
|
|
4
|
+
NumberIncrementStepper,
|
|
5
|
+
NumberInput as ChakraNumberInput,
|
|
6
|
+
NumberInputField,
|
|
7
|
+
NumberInputStepper,
|
|
8
|
+
} from "@chakra-ui/react";
|
|
9
|
+
import { NumberInputProps } from "./NumberInputProps";
|
|
10
|
+
|
|
11
|
+
export default function NumberInput({
|
|
12
|
+
defaultValue,
|
|
13
|
+
min,
|
|
14
|
+
max,
|
|
15
|
+
precision,
|
|
16
|
+
step,
|
|
17
|
+
clampValueOnBlur,
|
|
18
|
+
keepWithinRange,
|
|
19
|
+
value,
|
|
20
|
+
onChange,
|
|
21
|
+
size,
|
|
22
|
+
maxW,
|
|
23
|
+
allowMouseWheel,
|
|
24
|
+
NumberIncrementStepperBg,
|
|
25
|
+
NumberIncrementStepperActive,
|
|
26
|
+
NumberIncrementStepperChildren,
|
|
27
|
+
NumberDecrementStepperBg,
|
|
28
|
+
NumberDecrementStepperChildren,
|
|
29
|
+
NumberDecrementStepperActive,
|
|
30
|
+
}: NumberInputProps) {
|
|
31
|
+
return (
|
|
32
|
+
<ChakraNumberInput
|
|
33
|
+
defaultValue={defaultValue}
|
|
34
|
+
min={min}
|
|
35
|
+
max={max}
|
|
36
|
+
step={step}
|
|
37
|
+
precision={precision}
|
|
38
|
+
clampValueOnBlur={clampValueOnBlur}
|
|
39
|
+
keepWithinRange={keepWithinRange}
|
|
40
|
+
value={value}
|
|
41
|
+
onChange={onChange}
|
|
42
|
+
size={size}
|
|
43
|
+
maxW={maxW}
|
|
44
|
+
allowMouseWheel={allowMouseWheel}
|
|
45
|
+
>
|
|
46
|
+
<NumberInputField />
|
|
47
|
+
<NumberInputStepper>
|
|
48
|
+
<NumberIncrementStepper
|
|
49
|
+
bg={NumberIncrementStepperBg}
|
|
50
|
+
_active={NumberIncrementStepperActive}
|
|
51
|
+
>
|
|
52
|
+
{NumberIncrementStepperChildren}
|
|
53
|
+
</NumberIncrementStepper>
|
|
54
|
+
<NumberDecrementStepper
|
|
55
|
+
bg={NumberDecrementStepperBg}
|
|
56
|
+
_active={NumberDecrementStepperActive}
|
|
57
|
+
>
|
|
58
|
+
{NumberDecrementStepperChildren}
|
|
59
|
+
</NumberDecrementStepper>
|
|
60
|
+
</NumberInputStepper>
|
|
61
|
+
</ChakraNumberInput>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NumberInputProps as chakraNumbetInpurProps } from "@chakra-ui/react";
|
|
2
|
+
|
|
3
|
+
export type NumberInputProps = Pick<
|
|
4
|
+
chakraNumbetInpurProps,
|
|
5
|
+
| "defaultValue"
|
|
6
|
+
| "min"
|
|
7
|
+
| "max"
|
|
8
|
+
| "precision"
|
|
9
|
+
| "step"
|
|
10
|
+
| "clampValueOnBlur"
|
|
11
|
+
| "keepWithinRange"
|
|
12
|
+
| "value"
|
|
13
|
+
| "onChange"
|
|
14
|
+
|"size"
|
|
15
|
+
|"maxW"
|
|
16
|
+
|"allowMouseWheel"
|
|
17
|
+
> & {
|
|
18
|
+
NumberIncrementStepperBg?:string,
|
|
19
|
+
NumberIncrementStepperActive?:ActiveStyle,
|
|
20
|
+
NumberIncrementStepperChildren?:string,
|
|
21
|
+
NumberDecrementStepperBg?:string,
|
|
22
|
+
NumberDecrementStepperChildren?:string,
|
|
23
|
+
NumberDecrementStepperActive?:ActiveStyle,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type ActiveStyle = {
|
|
27
|
+
bg: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
+
// import PinInput from './PinInput';
|
|
4
|
+
// import { ChakraPinInputProps } from './PinInputProps';
|
|
5
|
+
|
|
6
|
+
// export default {
|
|
7
|
+
// title: 'Components/PinInput/PinInput',
|
|
8
|
+
// component: PinInput,
|
|
9
|
+
// } as Meta;
|
|
10
|
+
|
|
11
|
+
// const Template: StoryFn<ChakraPinInputProps> = (args) => <PinInput {...args} />;
|
|
12
|
+
|
|
13
|
+
// export const Default = Template.bind({});
|
|
14
|
+
// Default.args = {
|
|
15
|
+
// otp: false,
|
|
16
|
+
// mask: false,
|
|
17
|
+
// defaultValue: '',
|
|
18
|
+
// placeholder: '•',
|
|
19
|
+
// manageFocus: true,
|
|
20
|
+
// errorBorderColor: 'red.500',
|
|
21
|
+
// focusBorderColor: 'blue.500',
|
|
22
|
+
// onChange: (value: string) => console.log(value),
|
|
23
|
+
// onComplete: (value: string) => console.log(`Completed: ${value}`),
|
|
24
|
+
// type: 'alphanumeric',
|
|
25
|
+
// color: 'blue',
|
|
26
|
+
// variant: 'outline',
|
|
27
|
+
// pins: 3,
|
|
28
|
+
// };
|
|
29
|
+
|
|
30
|
+
// export const Masked = Template.bind({});
|
|
31
|
+
// Masked.args = {
|
|
32
|
+
// ...Default.args,
|
|
33
|
+
// mask: true,
|
|
34
|
+
// };
|
|
35
|
+
|
|
36
|
+
// export const SixPins = Template.bind({});
|
|
37
|
+
// SixPins.args = {
|
|
38
|
+
// ...Default.args,
|
|
39
|
+
// pins: 6,
|
|
40
|
+
// };
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HStack, PinInput, PinInputField, Text } from "@chakra-ui/react";
|
|
3
|
+
import { ChakraPinInputProps } from "./PinInputProps";
|
|
4
|
+
export default function PinInputs({
|
|
5
|
+
otp,
|
|
6
|
+
mask,
|
|
7
|
+
defaultValue,
|
|
8
|
+
placeholder,
|
|
9
|
+
manageFocus,
|
|
10
|
+
errorBorderColor,
|
|
11
|
+
focusBorderColor,
|
|
12
|
+
onChange,
|
|
13
|
+
onComplete,
|
|
14
|
+
type,
|
|
15
|
+
color,
|
|
16
|
+
variant,
|
|
17
|
+
pins = 3,
|
|
18
|
+
label,
|
|
19
|
+
}: ChakraPinInputProps) {
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
{label && (
|
|
23
|
+
<Text fontWeight="bold" marginBottom={"8px"}>
|
|
24
|
+
{label}
|
|
25
|
+
</Text>
|
|
26
|
+
)}
|
|
27
|
+
<HStack>
|
|
28
|
+
<PinInput
|
|
29
|
+
otp={otp}
|
|
30
|
+
mask={mask}
|
|
31
|
+
defaultValue={defaultValue}
|
|
32
|
+
placeholder={placeholder}
|
|
33
|
+
manageFocus={manageFocus}
|
|
34
|
+
errorBorderColor={errorBorderColor}
|
|
35
|
+
focusBorderColor={focusBorderColor}
|
|
36
|
+
onChange={onChange}
|
|
37
|
+
onComplete={onComplete}
|
|
38
|
+
type={type}
|
|
39
|
+
colorScheme={color}
|
|
40
|
+
variant={variant}
|
|
41
|
+
>
|
|
42
|
+
{Array.from({ length: pins }).map((_, index) => (
|
|
43
|
+
<PinInputField key={index} />
|
|
44
|
+
))}
|
|
45
|
+
</PinInput>
|
|
46
|
+
</HStack>
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PinInputProps } from "@chakra-ui/react";
|
|
2
|
+
|
|
3
|
+
export type ChakraPinInputProps = Pick<
|
|
4
|
+
PinInputProps,
|
|
5
|
+
| "otp"
|
|
6
|
+
| "mask"
|
|
7
|
+
| "defaultValue"
|
|
8
|
+
| "placeholder"
|
|
9
|
+
| "manageFocus"
|
|
10
|
+
| "errorBorderColor"
|
|
11
|
+
| "focusBorderColor"
|
|
12
|
+
| "onChange"
|
|
13
|
+
| "onComplete"
|
|
14
|
+
> & {
|
|
15
|
+
type?: "alphanumeric" | "number";
|
|
16
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
17
|
+
variant?: "flushed" | "outline" | "filled" | "unstyled";
|
|
18
|
+
color?:
|
|
19
|
+
| "gray"
|
|
20
|
+
| "red"
|
|
21
|
+
| "orange"
|
|
22
|
+
| "yellow"
|
|
23
|
+
| "green"
|
|
24
|
+
| "teal"
|
|
25
|
+
| "blue"
|
|
26
|
+
| "cyan"
|
|
27
|
+
| "purple"
|
|
28
|
+
| "pink"
|
|
29
|
+
| "whiteAlpha"
|
|
30
|
+
| "blackAlpha";
|
|
31
|
+
pins: number;
|
|
32
|
+
label?: string;
|
|
33
|
+
};
|