pixelize-design-library 2.1.19 → 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,63 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react'
|
|
2
|
+
import { PinInputsProps } from './PinInputsProps'
|
|
3
|
+
import Label from '../Common/Label';
|
|
4
|
+
import ErrorComponent from '../Common/ErrorComponent';
|
|
5
|
+
|
|
6
|
+
const PinInputs = ({ length = 3,
|
|
7
|
+
label,
|
|
8
|
+
error,
|
|
9
|
+
onChange,
|
|
10
|
+
onComplete,
|
|
11
|
+
mask = false,
|
|
12
|
+
placeholder = "*", }: PinInputsProps) => {
|
|
13
|
+
const [values, setValues] = useState<string[]>(Array(length).fill(""));
|
|
14
|
+
const inputsRef = useRef<Array<HTMLInputElement | null>>([]);
|
|
15
|
+
|
|
16
|
+
const handleChange = (index: number, value: string) => {
|
|
17
|
+
if (!/^[0-9]?$/.test(value)) return;
|
|
18
|
+
const newValues = [...values];
|
|
19
|
+
newValues[index] = value;
|
|
20
|
+
setValues(newValues);
|
|
21
|
+
onChange?.(newValues.join(""));
|
|
22
|
+
|
|
23
|
+
if (value && index < length - 1) {
|
|
24
|
+
inputsRef.current[index + 1]?.focus();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (newValues.every((v) => v !== "")) {
|
|
28
|
+
onComplete?.(newValues.join(""));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>, index: number) => {
|
|
33
|
+
if (e.key === "Backspace" && !values[index] && index > 0) {
|
|
34
|
+
inputsRef.current[index - 1]?.focus();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div>
|
|
40
|
+
{label && <Label label={label} />}
|
|
41
|
+
<div className="flex space-x-2">
|
|
42
|
+
{Array.from({ length }).map((_, index) => (
|
|
43
|
+
<input
|
|
44
|
+
key={index}
|
|
45
|
+
ref={(el) => (inputsRef.current[index] = el)}
|
|
46
|
+
type={mask ? "password" : "text"}
|
|
47
|
+
inputMode="numeric"
|
|
48
|
+
maxLength={1}
|
|
49
|
+
placeholder={placeholder}
|
|
50
|
+
value={values[index]}
|
|
51
|
+
onChange={(e) => handleChange(index, e.target.value)}
|
|
52
|
+
onKeyDown={(e) => handleKeyDown(e, index)}
|
|
53
|
+
className={`w-12 h-12 text-center border rounded-md text-lg focus:outline-none focus:ring-2 ${error ? "border-red-500 focus:ring-red-300" : "border-gray-300 focus:ring-blue-500"
|
|
54
|
+
}`}
|
|
55
|
+
/>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
{error && <ErrorComponent error={error} />}
|
|
59
|
+
</div>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default PinInputs
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Image,
|
|
5
|
+
Badge,
|
|
6
|
+
VStack,
|
|
7
|
+
} from '@chakra-ui/react';
|
|
8
|
+
import ProductTags from './ProductTags';
|
|
9
|
+
import ProductReview from './ProductReview';
|
|
10
|
+
import ProductPrice from './ProductPrice';
|
|
11
|
+
import Button from '../Button/Button';
|
|
12
|
+
import ProductLabel from './ProductLabel';
|
|
13
|
+
import { ProductCardProps } from './ProductCardProps';
|
|
14
|
+
|
|
15
|
+
const ProductCard = ({
|
|
16
|
+
label,
|
|
17
|
+
productImage,
|
|
18
|
+
rating,
|
|
19
|
+
reviews,
|
|
20
|
+
tags,
|
|
21
|
+
options,
|
|
22
|
+
onAddToCart,
|
|
23
|
+
bag,
|
|
24
|
+
description,
|
|
25
|
+
}: ProductCardProps) => {
|
|
26
|
+
|
|
27
|
+
const [hover, setHover] = useState(false);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Box
|
|
31
|
+
borderWidth="0.063 rem"
|
|
32
|
+
borderRadius="lg"
|
|
33
|
+
overflow="hidden"
|
|
34
|
+
p={3}
|
|
35
|
+
w="16.25rem"
|
|
36
|
+
position="relative"
|
|
37
|
+
bg={"white"}
|
|
38
|
+
boxShadow={"lg"}
|
|
39
|
+
>
|
|
40
|
+
<Box
|
|
41
|
+
onMouseEnter={() => setHover(true)}
|
|
42
|
+
onMouseLeave={() => setHover(false)}
|
|
43
|
+
h="11.25rem"
|
|
44
|
+
w="full"
|
|
45
|
+
overflow="hidden"
|
|
46
|
+
>
|
|
47
|
+
<Image
|
|
48
|
+
src={hover && productImage.hover ? productImage.hover : productImage.visibile}
|
|
49
|
+
alt={label}
|
|
50
|
+
w="full"
|
|
51
|
+
h="full"
|
|
52
|
+
objectFit="cover"
|
|
53
|
+
/>
|
|
54
|
+
{bag && (
|
|
55
|
+
<Badge colorScheme={bag.color || "red"} position="absolute" top={2} right={2}>
|
|
56
|
+
{bag.label}
|
|
57
|
+
</Badge>
|
|
58
|
+
)}
|
|
59
|
+
</Box>
|
|
60
|
+
|
|
61
|
+
<VStack spacing={2} align="start" mt={3}>
|
|
62
|
+
<ProductLabel label={label} description={description} />
|
|
63
|
+
{tags && <ProductTags tags={tags} />}
|
|
64
|
+
{rating && reviews &&
|
|
65
|
+
<ProductReview rating={rating} reviewCount={reviews} />}
|
|
66
|
+
|
|
67
|
+
{options && <ProductPrice options={options} />}
|
|
68
|
+
|
|
69
|
+
{onAddToCart && <Button colorScheme="orange" size="sm" width={"100%"} onClick={onAddToCart}>
|
|
70
|
+
Add to Cart
|
|
71
|
+
</Button>}
|
|
72
|
+
</VStack>
|
|
73
|
+
</Box>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export default ProductCard;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
export type ProductCardProps = {
|
|
2
|
-
label: string
|
|
3
|
-
description?: string
|
|
4
|
-
productImage: productImage
|
|
5
|
-
tags?: string[]
|
|
6
|
-
rating?: string | number
|
|
7
|
-
reviews?: string | number
|
|
2
|
+
label: string,
|
|
3
|
+
description?: string,
|
|
4
|
+
productImage: productImage,
|
|
5
|
+
tags?: string[],
|
|
6
|
+
rating?: string | number,
|
|
7
|
+
reviews?: string | number,
|
|
8
8
|
options?: options[];
|
|
9
9
|
onClick?: () => void;
|
|
10
10
|
onAddToCart?: () => void;
|
|
11
|
-
bag?: bag
|
|
12
|
-
}
|
|
11
|
+
bag?: bag
|
|
12
|
+
}
|
|
13
|
+
|
|
13
14
|
export type options = {
|
|
14
15
|
label: string;
|
|
15
16
|
weight: number;
|
|
16
17
|
price: number;
|
|
17
18
|
offer: number;
|
|
18
|
-
}
|
|
19
|
+
}
|
|
19
20
|
export type bag = {
|
|
20
21
|
label: string;
|
|
21
|
-
color?: string
|
|
22
|
-
}
|
|
22
|
+
color?: string
|
|
23
|
+
}
|
|
23
24
|
export type productImage = {
|
|
24
|
-
visibile: string
|
|
25
|
-
hover?: string
|
|
26
|
-
}
|
|
25
|
+
visibile: string,
|
|
26
|
+
hover?: string,
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Box, Text } from '@chakra-ui/react'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
const ProductLabel = ({ label, description }: { label: string, description?: string }) => {
|
|
5
|
+
return (
|
|
6
|
+
<Box>
|
|
7
|
+
<Text fontWeight="bold">{label}</Text>
|
|
8
|
+
{description && <Text fontSize="xs" fontStyle={"italic"}>{description}</Text>}
|
|
9
|
+
</Box>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default ProductLabel
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Text,
|
|
5
|
+
Portal,
|
|
6
|
+
useOutsideClick,
|
|
7
|
+
} from '@chakra-ui/react';
|
|
8
|
+
import { options } from './ProductCardProps';
|
|
9
|
+
|
|
10
|
+
type ProductPriceProps = {
|
|
11
|
+
options: options[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const ProductPrice = ({ options }: ProductPriceProps) => {
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
+
const [selected, setSelected] = useState(options[0]);
|
|
17
|
+
const [dropdownPosition, setDropdownPosition] = useState({ top: 0, left: 0, width: 0 });
|
|
18
|
+
const buttonRef = useRef<HTMLDivElement>(null);
|
|
19
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
20
|
+
const isSingleOption = options.length === 1;
|
|
21
|
+
|
|
22
|
+
useOutsideClick({
|
|
23
|
+
ref: dropdownRef,
|
|
24
|
+
handler: () => setIsOpen(false),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const getDiscountedPrice = (option: options) =>
|
|
28
|
+
Math.round(option.price - (option.price * option.offer) / 100);
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (isOpen && buttonRef.current) {
|
|
32
|
+
const rect = buttonRef.current.getBoundingClientRect();
|
|
33
|
+
setDropdownPosition({
|
|
34
|
+
top: rect.bottom + window.scrollY,
|
|
35
|
+
left: rect.left + window.scrollX,
|
|
36
|
+
width: rect.width,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}, [isOpen]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{/* Toggle Button or Static Box for single option */}
|
|
44
|
+
{isSingleOption ? (
|
|
45
|
+
<Box
|
|
46
|
+
border="0.063rem solid"
|
|
47
|
+
borderColor="orange.300"
|
|
48
|
+
bg="#FFFCF5"
|
|
49
|
+
px={3}
|
|
50
|
+
py={1}
|
|
51
|
+
rounded="md"
|
|
52
|
+
display="inline-block"
|
|
53
|
+
w="100%"
|
|
54
|
+
>
|
|
55
|
+
<Text fontSize="sm" fontWeight="medium">{options[0].label}</Text>
|
|
56
|
+
</Box>
|
|
57
|
+
) : (
|
|
58
|
+
<Box
|
|
59
|
+
ref={buttonRef}
|
|
60
|
+
onClick={() => setIsOpen(!isOpen)}
|
|
61
|
+
border="0.063rem solid"
|
|
62
|
+
borderColor="orange.300"
|
|
63
|
+
bg="#FFFCF5"
|
|
64
|
+
px={3}
|
|
65
|
+
py={1}
|
|
66
|
+
rounded="md"
|
|
67
|
+
cursor="pointer"
|
|
68
|
+
display="flex"
|
|
69
|
+
justifyContent="space-between"
|
|
70
|
+
alignItems="center"
|
|
71
|
+
w="100%"
|
|
72
|
+
>
|
|
73
|
+
<Text fontSize="sm" fontWeight="medium">{selected.label}</Text>
|
|
74
|
+
<Text
|
|
75
|
+
fontSize="xs"
|
|
76
|
+
color="orange.400"
|
|
77
|
+
transform={isOpen ? 'rotate(180deg)' : 'rotate(0deg)'}
|
|
78
|
+
transition="transform 0.2s"
|
|
79
|
+
>
|
|
80
|
+
▾
|
|
81
|
+
</Text>
|
|
82
|
+
</Box>
|
|
83
|
+
)}
|
|
84
|
+
|
|
85
|
+
{/* Dropdown (only if multiple options) */}
|
|
86
|
+
{!isSingleOption && isOpen && (
|
|
87
|
+
<Portal>
|
|
88
|
+
<Box
|
|
89
|
+
ref={dropdownRef}
|
|
90
|
+
position="absolute"
|
|
91
|
+
top={`${dropdownPosition.top}px`}
|
|
92
|
+
left={`${dropdownPosition.left}px`}
|
|
93
|
+
width={`${dropdownPosition.width}px`}
|
|
94
|
+
bg="white"
|
|
95
|
+
border="0.063rem solid"
|
|
96
|
+
borderColor="orange.300"
|
|
97
|
+
shadow="md"
|
|
98
|
+
zIndex={9999}
|
|
99
|
+
>
|
|
100
|
+
{options.map((option) => {
|
|
101
|
+
const discounted = getDiscountedPrice(option);
|
|
102
|
+
const isSelected = selected.weight === option.weight;
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<Box
|
|
106
|
+
key={option.weight}
|
|
107
|
+
px={4}
|
|
108
|
+
h="2.5rem"
|
|
109
|
+
cursor="pointer"
|
|
110
|
+
bg={isSelected ? 'orange.50' : 'white'}
|
|
111
|
+
_hover={{ bg: 'orange.100' }}
|
|
112
|
+
onClick={() => {
|
|
113
|
+
setSelected(option);
|
|
114
|
+
setIsOpen(false);
|
|
115
|
+
}}
|
|
116
|
+
display="flex"
|
|
117
|
+
alignItems="center"
|
|
118
|
+
justifyContent="space-between"
|
|
119
|
+
>
|
|
120
|
+
{/* Left: Label and offer */}
|
|
121
|
+
<Box>
|
|
122
|
+
<Text fontSize="sm" fontWeight="medium">{option.label}</Text>
|
|
123
|
+
{option.offer > 0 && (
|
|
124
|
+
<Text fontSize="xs" color="green.600" fontWeight="semibold">
|
|
125
|
+
{option.offer}% OFF
|
|
126
|
+
</Text>
|
|
127
|
+
)}
|
|
128
|
+
</Box>
|
|
129
|
+
|
|
130
|
+
{/* Right: Price and strikethrough */}
|
|
131
|
+
<Box textAlign="right">
|
|
132
|
+
<Text fontSize="sm" fontWeight="semibold" color="orange.500">
|
|
133
|
+
₹{discounted}
|
|
134
|
+
</Text>
|
|
135
|
+
{option.offer > 0 && (
|
|
136
|
+
<Text fontSize="xs" color="gray.400" textDecoration="line-through">
|
|
137
|
+
₹{option.price}
|
|
138
|
+
</Text>
|
|
139
|
+
)}
|
|
140
|
+
</Box>
|
|
141
|
+
|
|
142
|
+
{/* Radio Circle */}
|
|
143
|
+
<Box
|
|
144
|
+
ml={4}
|
|
145
|
+
w="1rem"
|
|
146
|
+
h="1rem"
|
|
147
|
+
minW="1rem"
|
|
148
|
+
borderRadius="full"
|
|
149
|
+
border="0.125rem solid"
|
|
150
|
+
borderColor={isSelected ? 'orange.400' : 'gray.300'}
|
|
151
|
+
display="flex"
|
|
152
|
+
alignItems="center"
|
|
153
|
+
justifyContent="center"
|
|
154
|
+
>
|
|
155
|
+
{isSelected && (
|
|
156
|
+
<Box w="0.5rem" h="0.5rem" bg="orange.400" borderRadius="full" />
|
|
157
|
+
)}
|
|
158
|
+
</Box>
|
|
159
|
+
</Box>
|
|
160
|
+
);
|
|
161
|
+
})}
|
|
162
|
+
</Box>
|
|
163
|
+
</Portal>
|
|
164
|
+
)}
|
|
165
|
+
|
|
166
|
+
{/* Final Price Display */}
|
|
167
|
+
<Box mt={2} display="flex" alignItems="center" fontSize="sm" gap={2}>
|
|
168
|
+
{selected.offer > 0 && (
|
|
169
|
+
<Text color="gray.400" textDecoration="line-through">₹{selected.price}</Text>
|
|
170
|
+
)}
|
|
171
|
+
<Text color="orange.500" fontWeight="semibold">₹{getDiscountedPrice(selected)}</Text>
|
|
172
|
+
</Box>
|
|
173
|
+
</>
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export default ProductPrice;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Flex, Text, Icon } from '@chakra-ui/react';
|
|
3
|
+
import { BookCheck, Star } from 'lucide-react';
|
|
4
|
+
|
|
5
|
+
type ProductReviewProps = {
|
|
6
|
+
rating: string | number;
|
|
7
|
+
reviewCount: string | number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const ProductReview = ({ rating, reviewCount }: ProductReviewProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<Flex align="center" gap={2}>
|
|
13
|
+
<Flex
|
|
14
|
+
align="center"
|
|
15
|
+
gap="1"
|
|
16
|
+
bg="teal.900"
|
|
17
|
+
color="white"
|
|
18
|
+
px={2}
|
|
19
|
+
borderRadius="md"
|
|
20
|
+
fontSize="sm"
|
|
21
|
+
fontWeight="bold"
|
|
22
|
+
>
|
|
23
|
+
<Icon as={Star} boxSize={3.5} />
|
|
24
|
+
<Text>{rating}</Text>
|
|
25
|
+
</Flex>
|
|
26
|
+
|
|
27
|
+
<Box h="4" w="0.063rem" bg="gray.400" />
|
|
28
|
+
|
|
29
|
+
<Flex align="center" gap="1">
|
|
30
|
+
<Icon as={BookCheck} boxSize={3.5} />
|
|
31
|
+
<Text fontSize="sm" color="gray.600">({reviewCount})</Text>
|
|
32
|
+
</Flex>
|
|
33
|
+
</Flex>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default ProductReview;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Flex } from '@chakra-ui/react';
|
|
3
|
+
|
|
4
|
+
type ProductTagsProps = {
|
|
5
|
+
tags: string[];
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ProductTags = ({ tags, className }: ProductTagsProps) => {
|
|
10
|
+
|
|
11
|
+
const getRows = (tags: string[]): string[][] => {
|
|
12
|
+
const count = tags.length;
|
|
13
|
+
if (count === 1) return [tags];
|
|
14
|
+
if (count === 2) return [tags];
|
|
15
|
+
if (count === 3) return [[tags[0]], tags.slice(1)];
|
|
16
|
+
if (count === 4) return [tags.slice(0, 2), tags.slice(2, 4)];
|
|
17
|
+
return [];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Flex direction="column" gap="1" className={className} w="full">
|
|
22
|
+
{getRows(tags).map((row, rowIndex) => (
|
|
23
|
+
<Flex key={rowIndex} gap="1">
|
|
24
|
+
{row.map((tag, tagIndex) => (
|
|
25
|
+
// <></>
|
|
26
|
+
<Tag key={tagIndex} fullWidth={row.length === 1}>
|
|
27
|
+
{tag}
|
|
28
|
+
</Tag>
|
|
29
|
+
))}
|
|
30
|
+
</Flex>
|
|
31
|
+
))}
|
|
32
|
+
</Flex>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const Tag = ({
|
|
37
|
+
children,
|
|
38
|
+
fullWidth = false,
|
|
39
|
+
}: { children: React.ReactNode; fullWidth?: boolean }) => (
|
|
40
|
+
<Box
|
|
41
|
+
flex={fullWidth ? '1' : '1'}
|
|
42
|
+
border="0.063rem solid #f89f24"
|
|
43
|
+
color="black"
|
|
44
|
+
fontSize="0.625rem"
|
|
45
|
+
fontWeight="semibold"
|
|
46
|
+
borderRadius="full"
|
|
47
|
+
px="0.5rem"
|
|
48
|
+
py="0.125rem"
|
|
49
|
+
textAlign="center"
|
|
50
|
+
whiteSpace="nowrap"
|
|
51
|
+
backgroundColor={"orange.100"}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</Box>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export default ProductTags;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
// import ProfileCard from './ProfileCard';
|
|
4
|
+
// import { ProfileCardProps } from './ProfileCardProps';
|
|
5
|
+
|
|
6
|
+
// export default {
|
|
7
|
+
// title: 'Components/ProfileCard/ProfileCard',
|
|
8
|
+
// component: ProfileCard,
|
|
9
|
+
// } as Meta;
|
|
10
|
+
|
|
11
|
+
// const Template: StoryFn<ProfileCardProps> = (args) => <ProfileCard {...args} />;
|
|
12
|
+
|
|
13
|
+
// export const Default = Template.bind({});
|
|
14
|
+
// Default.args = {
|
|
15
|
+
// key: '1',
|
|
16
|
+
// maxW: 'sm',
|
|
17
|
+
// align: 'center',
|
|
18
|
+
// variant: 'filled',
|
|
19
|
+
// direction: 'column',
|
|
20
|
+
// justify: 'center',
|
|
21
|
+
// header: 'Header',
|
|
22
|
+
// footer: 'Footer',
|
|
23
|
+
// children: 'Content',
|
|
24
|
+
// size: 'md',
|
|
25
|
+
// color: 'teal',
|
|
26
|
+
// overflow: 'hidden',
|
|
27
|
+
// dividercolor: 'gray',
|
|
28
|
+
// dividersize: 'md',
|
|
29
|
+
// dividervariant: 'solid',
|
|
30
|
+
// };
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import {
|
|
3
|
+
Card as ChakraCard,
|
|
4
|
+
CardBody,
|
|
5
|
+
CardFooter,
|
|
6
|
+
CardHeader,
|
|
7
|
+
Divider,
|
|
8
|
+
} from "@chakra-ui/react";
|
|
9
|
+
import { ProfileCardProps } from "./ProfileCardProps";
|
|
10
|
+
|
|
11
|
+
export const ProfileCardHeader: React.FC<{ children: React.ReactNode }> = ({
|
|
12
|
+
children,
|
|
13
|
+
}) => {
|
|
14
|
+
return <>{children}</>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const ProfileCardBody: React.FC<{ children: React.ReactNode }> = ({
|
|
18
|
+
children,
|
|
19
|
+
}) => {
|
|
20
|
+
return <>{children}</>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const ProfileCardFooter: React.FC<{ children: React.ReactNode }> = ({
|
|
24
|
+
children,
|
|
25
|
+
}) => {
|
|
26
|
+
return <>{children}</>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default function ProfileCard({
|
|
30
|
+
maxW,
|
|
31
|
+
align,
|
|
32
|
+
variant,
|
|
33
|
+
direction,
|
|
34
|
+
justify,
|
|
35
|
+
children,
|
|
36
|
+
size,
|
|
37
|
+
color,
|
|
38
|
+
overflow,
|
|
39
|
+
dividercolor = "#d5cfcf",
|
|
40
|
+
dividersize = "0.5px",
|
|
41
|
+
dividervariant = "solid",
|
|
42
|
+
CardStyle,
|
|
43
|
+
CardHeaderStyle,
|
|
44
|
+
CardBodyStyle,
|
|
45
|
+
borderTopColor,
|
|
46
|
+
borderLeftColor,
|
|
47
|
+
}: ProfileCardProps) {
|
|
48
|
+
const isReactElement = (child: React.ReactNode): child is ReactElement => {
|
|
49
|
+
return child !== null && typeof child === "object" && "type" in child;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const header = React.Children.toArray(children).find(
|
|
53
|
+
(child) => isReactElement(child) && child.type === ProfileCardHeader
|
|
54
|
+
);
|
|
55
|
+
const body = React.Children.toArray(children).find(
|
|
56
|
+
(child) => isReactElement(child) && child.type === ProfileCardBody
|
|
57
|
+
);
|
|
58
|
+
const footer = React.Children.toArray(children).find(
|
|
59
|
+
(child) => isReactElement(child) && child.type === ProfileCardFooter
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const StylesWithBorder = borderLeftColor
|
|
63
|
+
? { ...CardStyle, borderLeft: "2px solid #3182CE" }
|
|
64
|
+
: borderTopColor
|
|
65
|
+
? { ...CardStyle, borderTop: "2px solid #3182CE" }
|
|
66
|
+
: { ...CardStyle };
|
|
67
|
+
return (
|
|
68
|
+
<ChakraCard
|
|
69
|
+
maxW={maxW}
|
|
70
|
+
align={align}
|
|
71
|
+
variant={variant}
|
|
72
|
+
direction={direction}
|
|
73
|
+
justify={justify}
|
|
74
|
+
size={size}
|
|
75
|
+
overflow={overflow}
|
|
76
|
+
colorScheme={color}
|
|
77
|
+
style={StylesWithBorder}
|
|
78
|
+
>
|
|
79
|
+
{header && (
|
|
80
|
+
<>
|
|
81
|
+
<CardHeader sx={{ ...CardHeaderStyle, fontWeight: "bold" }}>
|
|
82
|
+
{header}
|
|
83
|
+
</CardHeader>
|
|
84
|
+
<Divider
|
|
85
|
+
style={{
|
|
86
|
+
borderColor: dividercolor,
|
|
87
|
+
borderWidth: dividersize,
|
|
88
|
+
borderStyle: dividervariant,
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
</>
|
|
92
|
+
)}
|
|
93
|
+
<CardBody sx={CardBodyStyle}>{body}</CardBody>
|
|
94
|
+
{footer && <CardFooter>{footer}</CardFooter>}
|
|
95
|
+
</ChakraCard>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CardProps } from "@chakra-ui/react";
|
|
2
|
+
|
|
3
|
+
export type ProfileCardProps = Pick<
|
|
4
|
+
CardProps,
|
|
5
|
+
"direction" | "maxW" | "align" | "justify" | "overflow"
|
|
6
|
+
> & {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
variant?: "elevated" | "outlein" | "filled" | "unstyled";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
color?:
|
|
11
|
+
| "whiteAlpha"
|
|
12
|
+
| "blackAlpha"
|
|
13
|
+
| "gray"
|
|
14
|
+
| "red"
|
|
15
|
+
| "orange"
|
|
16
|
+
| "yellow"
|
|
17
|
+
| "green"
|
|
18
|
+
| "teal"
|
|
19
|
+
| "blue"
|
|
20
|
+
| "cyan"
|
|
21
|
+
| "purple"
|
|
22
|
+
| "pink";
|
|
23
|
+
dividercolor?: string;
|
|
24
|
+
dividersize?: string;
|
|
25
|
+
dividervariant?:
|
|
26
|
+
| "solid"
|
|
27
|
+
| "dashed"
|
|
28
|
+
| "dotted"
|
|
29
|
+
| "double"
|
|
30
|
+
| "groove"
|
|
31
|
+
| "ridge"
|
|
32
|
+
| "inset"
|
|
33
|
+
| "outset";
|
|
34
|
+
CardStyle?: React.CSSProperties;
|
|
35
|
+
CardHeaderStyle?: React.CSSProperties;
|
|
36
|
+
CardBodyStyle?: React.CSSProperties;
|
|
37
|
+
borderTopColor?: boolean;
|
|
38
|
+
borderLeftColor?: boolean;
|
|
39
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import { StoryFn, Meta } from '@storybook/react';
|
|
3
|
+
// import ProfilePhotoViewer from './ProfilePhotoViewer';
|
|
4
|
+
// import { ProfilePhotoViewerProps } from './ProfilePhotoViewerProps';
|
|
5
|
+
|
|
6
|
+
// export default {
|
|
7
|
+
// title: 'Components/ProfilePhotoViewer/ProfilePhotoViewer',
|
|
8
|
+
// component: ProfilePhotoViewer,
|
|
9
|
+
// } as Meta;
|
|
10
|
+
|
|
11
|
+
// const Template: StoryFn<ProfilePhotoViewerProps> = (args) => <ProfilePhotoViewer {...args} />;
|
|
12
|
+
|
|
13
|
+
// export const Default = Template.bind({});
|
|
14
|
+
// Default.args = {
|
|
15
|
+
// photoUrl: 'https://via.placeholder.com/150',
|
|
16
|
+
// onPhotoChange: (file: File) => console.log(file.name),
|
|
17
|
+
// imageWidth: "100px",
|
|
18
|
+
// imageAlt: "Profile Photo",
|
|
19
|
+
// imageObjectFit: "cover",
|
|
20
|
+
// imageBorderRadius: "full",
|
|
21
|
+
// editIconSize: "sm",
|
|
22
|
+
// editIconPositionRight: "5px",
|
|
23
|
+
// editIconPositionBottom: "5px",
|
|
24
|
+
// isRound: true,
|
|
25
|
+
// };
|
|
26
|
+
export {};
|