pixelize-design-library 2.4.1-beta.11 → 2.4.1-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +4 -0
- package/dist/App.js +95 -0
- package/dist/Components/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/Components/AlertDialog/AlertDialog.js +1 -1
- package/dist/Components/Button/Button.d.ts +1 -1
- package/dist/Components/Button/Button.d.ts.map +1 -1
- package/dist/Components/Button/Button.js +2 -2
- package/dist/Components/Button/ButtonProps.d.ts +1 -1
- package/dist/Components/Button/ButtonProps.d.ts.map +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.d.ts.map +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +5 -2
- package/dist/Components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Components/Checkbox/Checkbox.js +2 -2
- package/dist/Components/Checkbox/CheckboxProps.d.ts +1 -1
- package/dist/Components/Checkbox/CheckboxProps.d.ts.map +1 -1
- package/dist/Components/Common/ErrorMessage.d.ts +2 -1
- package/dist/Components/Common/ErrorMessage.d.ts.map +1 -1
- package/dist/Components/Common/ErrorMessage.js +4 -2
- package/dist/Components/Common/FormLabel.d.ts +1 -1
- package/dist/Components/Common/FormLabel.d.ts.map +1 -1
- package/dist/Components/Common/FormLabel.js +15 -2
- package/dist/Components/Common/Label.d.ts +3 -1
- package/dist/Components/Common/Label.d.ts.map +1 -1
- package/dist/Components/Common/Label.js +2 -2
- package/dist/Components/Dropdown/DropDown.d.ts.map +1 -1
- package/dist/Components/Dropdown/DropDown.js +132 -14
- package/dist/Components/Dropdown/DropdownProps.d.ts +2 -0
- package/dist/Components/Dropdown/DropdownProps.d.ts.map +1 -1
- package/dist/Components/Editor/EditorProps.d.ts +1 -1
- package/dist/Components/Editor/EditorProps.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +5 -2
- package/dist/Components/KanbanBoard/MeasuredItem.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/MeasuredItem.js +4 -2
- package/dist/Components/NavigationBar/NavigationBar.d.ts.map +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +3 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.d.ts.map +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +40 -3
- package/dist/Components/ProductCard/ProductPrice.d.ts.map +1 -1
- package/dist/Components/ProductCard/ProductPrice.js +13 -7
- package/dist/Components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/Components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/Components/ProgressBar/ProgressBar.js +2 -2
- package/dist/Components/ProgressBar/ProgressBarProps.d.ts +1 -1
- package/dist/Components/ProgressBar/ProgressBarProps.d.ts.map +1 -1
- package/dist/Components/ScrollToTop/ScrollToTop.d.ts.map +1 -1
- package/dist/Components/ScrollToTop/ScrollToTop.js +8 -3
- package/dist/Components/SearchSelect/SearchSelect.d.ts.map +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +213 -18
- package/dist/Components/SelectSearch/SelectSearch.d.ts.map +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +89 -4
- package/dist/Components/SelectV2/SelectV2.d.ts.map +1 -1
- package/dist/Components/SelectV2/SelectV2.js +116 -29
- package/dist/Components/SideBar/SecondaryBar.d.ts.map +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +15 -7
- package/dist/Components/SideBar/SideBar.d.ts.map +1 -1
- package/dist/Components/SideBar/SideBar.js +36 -5
- package/dist/Components/SideBar/components/MenuItemBox.d.ts.map +1 -1
- package/dist/Components/SideBar/components/MenuItemBox.js +44 -15
- package/dist/Components/SideBar/components/MenuPopoverContent.d.ts.map +1 -1
- package/dist/Components/SideBar/components/MenuPopoverContent.js +9 -3
- package/dist/Components/StageProgress/StageItem.d.ts.map +1 -1
- package/dist/Components/StageProgress/StageItem.js +1 -1
- package/dist/Components/StageProgress/StepperStage.d.ts.map +1 -1
- package/dist/Components/StageProgress/StepperStage.js +1 -1
- package/dist/Components/Table/Table.d.ts.map +1 -1
- package/dist/Components/Table/Table.js +1 -1
- package/dist/Components/Table/components/HeaderActions.d.ts.map +1 -1
- package/dist/Components/Table/components/HeaderActions.js +3 -1
- package/dist/Components/Table/components/TableActions.d.ts.map +1 -1
- package/dist/Components/Table/components/TableActions.js +3 -3
- package/dist/Components/Table/components/TableBody.d.ts.map +1 -1
- package/dist/Components/Table/components/TableBody.js +74 -48
- package/dist/Components/Table/components/TableGroupRow.d.ts +1 -0
- package/dist/Components/Table/components/TableGroupRow.d.ts.map +1 -1
- package/dist/Components/Table/components/TableGroupRow.js +2 -2
- package/dist/Components/Table/components/TableHeader.d.ts.map +1 -1
- package/dist/Components/Table/components/TableHeader.js +35 -42
- package/dist/Components/Table/components/TableSearch.d.ts.map +1 -1
- package/dist/Components/Table/components/TableSearch.js +1 -1
- package/dist/Components/Table/filters/CompactSelect.d.ts.map +1 -1
- package/dist/Components/Table/filters/CompactSelect.js +33 -1
- package/dist/Components/Table/filters/LeftFilterPane.d.ts.map +1 -1
- package/dist/Components/Table/filters/LeftFilterPane.js +1 -1
- package/dist/Components/Table/hooks/useTable.d.ts.map +1 -1
- package/dist/Components/Table/hooks/useTable.js +6 -2
- package/dist/Components/Table/settings/ManageColumns.d.ts.map +1 -1
- package/dist/Components/Table/settings/ManageColumns.js +13 -4
- package/dist/Components/Table/settings/TableSettings.d.ts.map +1 -1
- package/dist/Components/Table/settings/TableSettings.js +2 -2
- package/dist/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/Components/Tag/Tag.js +5 -8
- package/dist/Components/Timeline/Timeline.d.ts.map +1 -1
- package/dist/Components/Timeline/Timeline.js +202 -202
- package/dist/Components/Toaster/Toaster.d.ts.map +1 -1
- package/dist/Components/Toaster/Toaster.js +19 -11
- package/dist/Hooks/usePreferences.d.ts.map +1 -1
- package/dist/Hooks/usePreferences.js +6 -1
- package/dist/Layout.d.ts +3 -0
- package/dist/Layout.js +286 -0
- package/dist/Pages/TInput.d.ts +3 -0
- package/dist/Pages/TInput.d.ts.map +1 -0
- package/dist/Pages/TInput.js +20 -0
- package/dist/Pages/accordion.d.ts +3 -0
- package/dist/Pages/accordion.d.ts.map +1 -0
- package/dist/Pages/accordion.js +21 -0
- package/dist/Pages/alertdialog.d.ts +3 -0
- package/dist/Pages/alertdialog.d.ts.map +1 -0
- package/dist/Pages/alertdialog.js +53 -0
- package/dist/Pages/button.d.ts +3 -0
- package/dist/Pages/button.d.ts.map +1 -0
- package/dist/Pages/button.js +32 -0
- package/dist/Pages/card.d.ts +3 -0
- package/dist/Pages/card.d.ts.map +1 -0
- package/dist/Pages/card.js +102 -0
- package/dist/Pages/chart.d.ts +4 -0
- package/dist/Pages/chart.d.ts.map +1 -0
- package/dist/Pages/chart.js +25 -0
- package/dist/Pages/checkbox.d.ts +3 -0
- package/dist/Pages/checkbox.d.ts.map +1 -0
- package/dist/Pages/checkbox.js +11 -0
- package/dist/Pages/contactForm.d.ts +3 -0
- package/dist/Pages/contactForm.d.ts.map +1 -0
- package/dist/Pages/contactForm.js +15 -0
- package/dist/Pages/customModulesTable.d.ts +4 -0
- package/dist/Pages/customModulesTable.d.ts.map +1 -0
- package/dist/Pages/customModulesTable.js +25 -0
- package/dist/Pages/datePick.d.ts +3 -0
- package/dist/Pages/datePick.d.ts.map +1 -0
- package/dist/Pages/datePick.js +49 -0
- package/dist/Pages/drawer.d.ts +3 -0
- package/dist/Pages/drawer.d.ts.map +1 -0
- package/dist/Pages/drawer.js +53 -0
- package/dist/Pages/dropdown.d.ts +3 -0
- package/dist/Pages/dropdown.d.ts.map +1 -0
- package/dist/Pages/dropdown.js +21 -0
- package/dist/Pages/editor.d.ts +3 -0
- package/dist/Pages/editor.d.ts.map +1 -0
- package/dist/Pages/editor.js +13 -0
- package/dist/Pages/feedback.d.ts +2 -0
- package/dist/Pages/feedback.d.ts.map +1 -0
- package/dist/Pages/feedback.js +12 -0
- package/dist/Pages/fileUpload.d.ts +2 -0
- package/dist/Pages/fileUpload.d.ts.map +1 -0
- package/dist/Pages/fileUpload.js +36 -0
- package/dist/Pages/input.d.ts +3 -0
- package/dist/Pages/input.d.ts.map +1 -0
- package/dist/Pages/input.js +48 -0
- package/dist/Pages/kanbanboard.d.ts +3 -0
- package/dist/Pages/kanbanboard.d.ts.map +1 -0
- package/dist/Pages/kanbanboard.js +182 -0
- package/dist/Pages/modal.d.ts +3 -0
- package/dist/Pages/modal.d.ts.map +1 -0
- package/dist/Pages/modal.js +61 -0
- package/dist/Pages/multiSelect.d.ts +3 -0
- package/dist/Pages/multiSelect.d.ts.map +1 -0
- package/dist/Pages/multiSelect.js +22 -0
- package/dist/Pages/noteArea.d.ts +3 -0
- package/dist/Pages/noteArea.d.ts.map +1 -0
- package/dist/Pages/noteArea.js +26 -0
- package/dist/Pages/notification.d.ts +3 -0
- package/dist/Pages/notification.d.ts.map +1 -0
- package/dist/Pages/notification.js +37 -0
- package/dist/Pages/numberInput.d.ts +3 -0
- package/dist/Pages/numberInput.d.ts.map +1 -0
- package/dist/Pages/numberInput.js +16 -0
- package/dist/Pages/orgSwitcher.d.ts +4 -0
- package/dist/Pages/orgSwitcher.d.ts.map +1 -0
- package/dist/Pages/orgSwitcher.js +36 -0
- package/dist/Pages/organizationDetails.d.ts +4 -0
- package/dist/Pages/organizationDetails.d.ts.map +1 -0
- package/dist/Pages/organizationDetails.js +80 -0
- package/dist/Pages/photoViewer.d.ts +3 -0
- package/dist/Pages/photoViewer.d.ts.map +1 -0
- package/dist/Pages/photoViewer.js +12 -0
- package/dist/Pages/pinInputs.d.ts +3 -0
- package/dist/Pages/pinInputs.d.ts.map +1 -0
- package/dist/Pages/pinInputs.js +11 -0
- package/dist/Pages/productCaard.d.ts +3 -0
- package/dist/Pages/productCaard.d.ts.map +1 -0
- package/dist/Pages/productCaard.js +311 -0
- package/dist/Pages/productDetailCard.d.ts +3 -0
- package/dist/Pages/productDetailCard.d.ts.map +1 -0
- package/dist/Pages/productDetailCard.js +78 -0
- package/dist/Pages/productFilter.d.ts +3 -0
- package/dist/Pages/productFilter.d.ts.map +1 -0
- package/dist/Pages/productFilter.js +148 -0
- package/dist/Pages/progressbar.d.ts +3 -0
- package/dist/Pages/progressbar.d.ts.map +1 -0
- package/dist/Pages/progressbar.js +11 -0
- package/dist/Pages/radioButton.d.ts +3 -0
- package/dist/Pages/radioButton.d.ts.map +1 -0
- package/dist/Pages/radioButton.js +18 -0
- package/dist/Pages/rolesPermission.d.ts +4 -0
- package/dist/Pages/rolesPermission.d.ts.map +1 -0
- package/dist/Pages/rolesPermission.js +144 -0
- package/dist/Pages/search.d.ts +3 -0
- package/dist/Pages/search.d.ts.map +1 -0
- package/dist/Pages/search.js +21 -0
- package/dist/Pages/searchSelect.d.ts +3 -0
- package/dist/Pages/searchSelect.d.ts.map +1 -0
- package/dist/Pages/searchSelect.js +97 -0
- package/dist/Pages/select.d.ts +3 -0
- package/dist/Pages/select.d.ts.map +1 -0
- package/dist/Pages/select.js +20 -0
- package/dist/Pages/selectSearch.d.ts +3 -0
- package/dist/Pages/selectSearch.d.ts.map +1 -0
- package/dist/Pages/selectSearch.js +58 -0
- package/dist/Pages/signInActivityTable.d.ts +4 -0
- package/dist/Pages/signInActivityTable.d.ts.map +1 -0
- package/dist/Pages/signInActivityTable.js +17 -0
- package/dist/Pages/skeleton.d.ts +3 -0
- package/dist/Pages/skeleton.d.ts.map +1 -0
- package/dist/Pages/skeleton.js +12 -0
- package/dist/Pages/stageProgress.d.ts +4 -0
- package/dist/Pages/stageProgress.d.ts.map +1 -0
- package/dist/Pages/stageProgress.js +31 -0
- package/dist/Pages/switch.d.ts +3 -0
- package/dist/Pages/switch.d.ts.map +1 -0
- package/dist/Pages/switch.js +17 -0
- package/dist/Pages/table.d.ts +3 -0
- package/dist/Pages/table.d.ts.map +1 -0
- package/dist/Pages/table.js +182 -0
- package/dist/Pages/tag.d.ts +3 -0
- package/dist/Pages/tag.d.ts.map +1 -0
- package/dist/Pages/tag.js +27 -0
- package/dist/Pages/textArea.d.ts +3 -0
- package/dist/Pages/textArea.d.ts.map +1 -0
- package/dist/Pages/textArea.js +14 -0
- package/dist/Pages/tier1.d.ts +4 -0
- package/dist/Pages/tier1.d.ts.map +1 -0
- package/dist/Pages/tier1.js +86 -0
- package/dist/Pages/timeline.d.ts +3 -0
- package/dist/Pages/timeline.d.ts.map +1 -0
- package/dist/Pages/timeline.js +73 -0
- package/dist/Pages/tooltip.d.ts +3 -0
- package/dist/Pages/tooltip.d.ts.map +1 -0
- package/dist/Pages/tooltip.js +11 -0
- package/dist/Pages/toster.d.ts +3 -0
- package/dist/Pages/toster.d.ts.map +1 -0
- package/dist/Pages/toster.js +53 -0
- package/dist/Pages/upgradeButton.d.ts +4 -0
- package/dist/Pages/upgradeButton.d.ts.map +1 -0
- package/dist/Pages/upgradeButton.js +17 -0
- package/dist/Pages/userDetails.d.ts +4 -0
- package/dist/Pages/userDetails.d.ts.map +1 -0
- package/dist/Pages/userDetails.js +79 -0
- package/dist/Pages/verifyEmail.d.ts +3 -0
- package/dist/Pages/verifyEmail.d.ts.map +1 -0
- package/dist/Pages/verifyEmail.js +17 -0
- package/dist/Theme/index.d.ts.map +1 -1
- package/dist/Theme/index.js +25 -9
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts.map +1 -1
- package/dist/Theme/provider/PixelizeThemeProvider.js +17 -7
- package/dist/Utils/rafThrottle.d.ts +15 -0
- package/dist/Utils/rafThrottle.d.ts.map +1 -0
- package/dist/Utils/rafThrottle.js +34 -0
- package/dist/Utils/table.d.ts.map +1 -1
- package/dist/Utils/table.js +16 -5
- package/dist/bootstrap.d.ts +2 -0
- package/dist/bootstrap.js +16 -0
- package/dist/esm/App.js +90 -0
- package/dist/esm/Assets/defaultLogo.js +5 -0
- package/dist/esm/Components/Accordion/Accordion.js +34 -0
- package/dist/esm/Components/Accordion/AccordionProps.js +1 -0
- package/dist/esm/Components/Accordion/accordionColors.js +30 -0
- package/dist/esm/Components/AlertDialog/AlertDialog.js +9 -0
- package/dist/esm/Components/AlertDialog/AlertDialogProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexBarChart/ApexBarChart.js +71 -0
- package/dist/esm/Components/Apexcharts/ApexBarChart/ApexBarChartProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +149 -0
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChartProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +161 -0
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChartProps.js +1 -0
- package/dist/esm/Components/Apexcharts/ApexPolarCharts/ApexPolarCharts.js +79 -0
- package/dist/esm/Components/Apexcharts/ApexPolarCharts/ApexPolarChartsProps.js +1 -0
- package/dist/esm/Components/Breadcrumbs/Breadcrumbs.js +9 -0
- package/dist/esm/Components/Breadcrumbs/Breadcrumbs.stories.js +5 -0
- package/dist/esm/Components/Breadcrumbs/BreadcrumbsProps.js +1 -0
- package/dist/esm/Components/Button/Button.js +7 -0
- package/dist/esm/Components/Button/Button.stories.js +5 -0
- package/dist/esm/Components/Button/Button.styles.js +204 -0
- package/dist/esm/Components/Button/ButtonProps.js +1 -0
- package/dist/esm/Components/ButtonGroupIcon/ButtonGoupIconProps.js +1 -0
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +98 -0
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.stories.js +5 -0
- package/dist/esm/Components/Buttons/Buttons.js +5 -0
- package/dist/esm/Components/Buttons/ButtonsProps.js +1 -0
- package/dist/esm/Components/Card/Card.js +5 -0
- package/dist/esm/Components/Card/CardProps.js +1 -0
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +65 -0
- package/dist/esm/Components/Card/PaymentCard/PaymentCardProps.js +1 -0
- package/dist/esm/Components/Checkbox/Checkbox.js +28 -0
- package/dist/esm/Components/Checkbox/Checkbox.stories.js +6 -0
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +69 -0
- package/dist/esm/Components/Checkbox/CheckboxProps.js +1 -0
- package/dist/esm/Components/Common/ErrorComponent.js +15 -0
- package/dist/esm/Components/Common/ErrorMessage.js +17 -0
- package/dist/esm/Components/Common/FormLabel.js +32 -0
- package/dist/esm/Components/Common/FormattedDescription.js +57 -0
- package/dist/esm/Components/Common/HelperText.js +8 -0
- package/dist/esm/Components/Common/Label.js +13 -0
- package/dist/esm/Components/Common/fieldStyles.js +34 -0
- package/dist/esm/Components/ContactForm/ContactForm.js +112 -0
- package/dist/esm/Components/ContactForm/ContactFormProps.js +1 -0
- package/dist/esm/Components/CopyButton/CopyButton.js +44 -0
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +63 -0
- package/dist/esm/Components/CustomModulesTable/CustomModulesTableProps.js +1 -0
- package/dist/esm/Components/CustomModulesTable/DeleteModuleModal.js +11 -0
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +20 -0
- package/dist/esm/Components/DatePicker/CalendarPanel.js +133 -0
- package/dist/esm/Components/DatePicker/DatePicker.js +252 -0
- package/dist/esm/Components/DatePicker/DatePickerProps.js +1 -0
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +206 -0
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +972 -0
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +27 -0
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +78 -0
- package/dist/esm/Components/DatePicker/TimePicker.js +70 -0
- package/dist/esm/Components/DatePicker/TimePickerInput.js +412 -0
- package/dist/esm/Components/Divider/Divider.js +9 -0
- package/dist/esm/Components/Drawer/Drawer.js +24 -0
- package/dist/esm/Components/Drawer/DrawerProps.js +1 -0
- package/dist/esm/Components/Dropdown/DropDown.js +249 -0
- package/dist/esm/Components/Dropdown/DropdownProps.js +1 -0
- package/dist/esm/Components/Editor/Editor.js +38 -0
- package/dist/esm/Components/Editor/EditorProps.js +1 -0
- package/dist/esm/Components/Editor/joditThemeVars.js +75 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +15 -0
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtpProps.js +1 -0
- package/dist/esm/Components/EmptyState/EmptyState.js +40 -0
- package/dist/esm/Components/EmptyState/EmptyStateProps.js +1 -0
- package/dist/esm/Components/FeedbackForm/FeedbackForm.js +65 -0
- package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +33 -0
- package/dist/esm/Components/FilePreview/FilePreview.js +79 -0
- package/dist/esm/Components/FilePreview/FilePreviewProps.js +1 -0
- package/dist/esm/Components/FileUpload/FileUpload.js +82 -0
- package/dist/esm/Components/FileUpload/FileUploadProps.js +1 -0
- package/dist/esm/Components/FileUpload/constants.js +24 -0
- package/dist/esm/Components/FileUploader/FileUploader.js +78 -0
- package/dist/esm/Components/FileUploader/FileUploaderProps.js +1 -0
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +258 -0
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +10 -0
- package/dist/esm/Components/Form/FormWrapper.js +9 -0
- package/dist/esm/Components/Header/Header.js +55 -0
- package/dist/esm/Components/Header/HeaderActions.js +24 -0
- package/dist/esm/Components/Header/HeaderProps.js +1 -0
- package/dist/esm/Components/Header/components/desktopMenu.js +43 -0
- package/dist/esm/Components/Header/components/mobileMenu.js +37 -0
- package/dist/esm/Components/Input/Input/Input.js +40 -0
- package/dist/esm/Components/Input/Input/InputProps.js +1 -0
- package/dist/esm/Components/Input/PhoneNumberInput.js +62 -0
- package/dist/esm/Components/Input/PhoneNumberInputProps.js +1 -0
- package/dist/esm/Components/Input/Switch/InputSwitch.js +21 -0
- package/dist/esm/Components/Input/TextInput.js +16 -0
- package/dist/esm/Components/Input/TextInput.stories.js +7 -0
- package/dist/esm/Components/Input/TextInput.styles.js +101 -0
- package/dist/esm/Components/Input/TextInputProps.js +1 -0
- package/dist/esm/Components/Input/textInputIconSize.js +36 -0
- package/dist/esm/Components/InputTextArea/InputTextArea.js +8 -0
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +77 -0
- package/dist/esm/Components/InputTextArea/InputTextAreaProps.js +1 -0
- package/dist/esm/Components/KanbanBoard/AccountCard.js +22 -0
- package/dist/esm/Components/KanbanBoard/AccountRow.js +10 -0
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +13 -0
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +453 -0
- package/dist/esm/Components/KanbanBoard/KanbanBoardProps.js +1 -0
- package/dist/esm/Components/KanbanBoard/MeasuredItem.js +54 -0
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +10 -0
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +40 -0
- package/dist/esm/Components/LimitReachedModal/LimitReachedModalProps.js +1 -0
- package/dist/esm/Components/LimitReachedModal/limitReachedCopy.js +50 -0
- package/dist/esm/Components/Loading/Loading.js +24 -0
- package/dist/esm/Components/Loading/Loading.stories.js +6 -0
- package/dist/esm/Components/Loading/LoadingProps.js +1 -0
- package/dist/esm/Components/Modal/Modal.js +30 -0
- package/dist/esm/Components/Modal/Modal.stories.js +6 -0
- package/dist/esm/Components/Modal/ModalProps.js +1 -0
- package/dist/esm/Components/MoreItems/MoreItems.js +22 -0
- package/dist/esm/Components/MoreItems/MoreItemsProps.js +1 -0
- package/dist/esm/Components/MultiSelect/MultiSelect.js +70 -0
- package/dist/esm/Components/MultiSelect/MultiSelectProps.js +1 -0
- package/dist/esm/Components/NavigationBar/NavBar.stories.js +2 -0
- package/dist/esm/Components/NavigationBar/NavigationBar.js +57 -0
- package/dist/esm/Components/NavigationBar/NavigationBarProps.js +1 -0
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +142 -0
- package/dist/esm/Components/NoteTextArea/NoteTextAreaProps.js +1 -0
- package/dist/esm/Components/Notification/Notification.js +106 -0
- package/dist/esm/Components/Notification/NotificationProps.js +1 -0
- package/dist/esm/Components/NumberInput/NumberInput.js +6 -0
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +85 -0
- package/dist/esm/Components/NumberInput/NumberInputProps.js +1 -0
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +116 -0
- package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +34 -0
- package/dist/esm/Components/OrganizationDetails/CreateOrgModal.js +57 -0
- package/dist/esm/Components/OrganizationDetails/DeleteOrgModal.js +11 -0
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +165 -0
- package/dist/esm/Components/OrganizationDetails/OrganizationDetailsProps.js +1 -0
- package/dist/esm/Components/PdfViewer/PdfViewer.js +10 -0
- package/dist/esm/Components/PinInput/PinInput.js +15 -0
- package/dist/esm/Components/PinInput/PinInput.stories.js +5 -0
- package/dist/esm/Components/PinInput/PinInputProps.js +1 -0
- package/dist/esm/Components/PinInputs/PinInputs.js +48 -0
- package/dist/esm/Components/PinInputs/PinInputsProps.js +1 -0
- package/dist/esm/Components/PlanBadge/PlanBadge.js +17 -0
- package/dist/esm/Components/PlanBadge/PlanBadgeProps.js +1 -0
- package/dist/esm/Components/PlanPill/PlanPill.js +40 -0
- package/dist/esm/Components/PlanPill/PlanPillProps.js +1 -0
- package/dist/esm/Components/PlanPill/planPillGradient.js +17 -0
- package/dist/esm/Components/ProductCard/ProductCard.js +62 -0
- package/dist/esm/Components/ProductCard/ProductCardProps.js +1 -0
- package/dist/esm/Components/ProductCard/ProductLabel.js +18 -0
- package/dist/esm/Components/ProductCard/ProductPrice.js +110 -0
- package/dist/esm/Components/ProductCard/ProductReview.js +19 -0
- package/dist/esm/Components/ProductCard/ProductTags.js +48 -0
- package/dist/esm/Components/ProductDetails/ProductDetails.js +40 -0
- package/dist/esm/Components/ProductDetails/ProductDetailsProps.js +1 -0
- package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +22 -0
- package/dist/esm/Components/ProductDetails/ProductImageSlider.js +188 -0
- package/dist/esm/Components/ProfileCard/ProfileCard.js +34 -0
- package/dist/esm/Components/ProfileCard/ProfileCard.stories.js +5 -0
- package/dist/esm/Components/ProfileCard/ProfileCardProps.js +1 -0
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +70 -0
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.stories.js +5 -0
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewerProps.js +1 -0
- package/dist/esm/Components/ProgressBar/ProgressBar.js +6 -0
- package/dist/esm/Components/ProgressBar/ProgressBar.stories.js +6 -0
- package/dist/esm/Components/ProgressBar/ProgressBarProps.js +1 -0
- package/dist/esm/Components/RadioButton/RadioButton.js +25 -0
- package/dist/esm/Components/RadioButton/RadioButton.stories.js +6 -0
- package/dist/esm/Components/RadioButton/RadioButtonProps.js +1 -0
- package/dist/esm/Components/Reorder/Reorder.js +22 -0
- package/dist/esm/Components/Reorder/ReorderProps.js +1 -0
- package/dist/esm/Components/RolesPermission/DeleteRoleModal.js +13 -0
- package/dist/esm/Components/RolesPermission/RolesPermission.js +121 -0
- package/dist/esm/Components/RolesPermission/RolesPermissionProps.js +1 -0
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +67 -0
- package/dist/esm/Components/Search/Search.js +29 -0
- package/dist/esm/Components/Search/SearchProps.js +1 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +518 -0
- package/dist/esm/Components/SearchSelect/SearchSelectProps.js +1 -0
- package/dist/esm/Components/SearchSelect/SelectTruncatedLabel.js +17 -0
- package/dist/esm/Components/SearchSelect/searchSelectSize.js +93 -0
- package/dist/esm/Components/Select/Select.js +24 -0
- package/dist/esm/Components/Select/Select.stories.js +7 -0
- package/dist/esm/Components/Select/Select.styles.js +108 -0
- package/dist/esm/Components/Select/SelectProps.js +1 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +270 -0
- package/dist/esm/Components/SelectSearch/SelectSearchProps.js +1 -0
- package/dist/esm/Components/SelectV2/SelectV2.js +233 -0
- package/dist/esm/Components/SelectV2/SelectV2Props.js +1 -0
- package/dist/esm/Components/SideBar/SecondaryBar.js +67 -0
- package/dist/esm/Components/SideBar/SideBar.js +237 -0
- package/dist/esm/Components/SideBar/SideBarProps.js +1 -0
- package/dist/esm/Components/SideBar/Sidebar.stories.js +6 -0
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +132 -0
- package/dist/esm/Components/SideBar/components/MenuItems.js +114 -0
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +54 -0
- package/dist/esm/Components/SideBar/components/OtherApps.js +20 -0
- package/dist/esm/Components/SideBar/components/OverflowTooltipText.js +29 -0
- package/dist/esm/Components/SideBar/components/TextTruncation.js +27 -0
- package/dist/esm/Components/SideBar/sidebarAccentColors.js +31 -0
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +34 -0
- package/dist/esm/Components/SignInActivityTable/SignInActivityTableProps.js +1 -0
- package/dist/esm/Components/Skeletons/Skeleton.stories.js +6 -0
- package/dist/esm/Components/Skeletons/SkeletonProps.js +1 -0
- package/dist/esm/Components/Skeletons/Skeletons.js +5 -0
- package/dist/esm/Components/Slider/Slider.js +41 -0
- package/dist/esm/Components/StageProgress/StageItem.js +85 -0
- package/dist/esm/Components/StageProgress/StageProgress.js +47 -0
- package/dist/esm/Components/StageProgress/StageProgressProps.js +29 -0
- package/dist/esm/Components/StageProgress/StepperStage.js +38 -0
- package/dist/esm/Components/Switch/Switch.js +11 -0
- package/dist/esm/Components/Switch/SwitchProps.js +1 -0
- package/dist/esm/Components/Table/Table.js +430 -0
- package/dist/esm/Components/Table/Table.stories.js +8 -0
- package/dist/esm/Components/Table/TableProps.js +1 -0
- package/dist/esm/Components/Table/components/HeaderActions.js +47 -0
- package/dist/esm/Components/Table/components/Pagination.js +19 -0
- package/dist/esm/Components/Table/components/TableActions.js +55 -0
- package/dist/esm/Components/Table/components/TableBody.js +337 -0
- package/dist/esm/Components/Table/components/TableGroupRow.js +11 -0
- package/dist/esm/Components/Table/components/TableHeader.js +100 -0
- package/dist/esm/Components/Table/components/TableLoading.js +11 -0
- package/dist/esm/Components/Table/components/TableSearch.js +31 -0
- package/dist/esm/Components/Table/components/tableRowHoverStyle.js +22 -0
- package/dist/esm/Components/Table/filterTypes.js +1 -0
- package/dist/esm/Components/Table/filters/ActiveFilters.js +63 -0
- package/dist/esm/Components/Table/filters/CompactSelect.js +55 -0
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +174 -0
- package/dist/esm/Components/Table/filters/SelectOperationControls.js +5 -0
- package/dist/esm/Components/Table/filters/TableFilters.js +45 -0
- package/dist/esm/Components/Table/filters/TextOperationControls.js +16 -0
- package/dist/esm/Components/Table/hooks/useDebounce.js +22 -0
- package/dist/esm/Components/Table/hooks/useTable.js +227 -0
- package/dist/esm/Components/Table/settings/ManageColumns.js +105 -0
- package/dist/esm/Components/Table/settings/TableSettings.js +82 -0
- package/dist/esm/Components/Tag/Tag.js +18 -0
- package/dist/esm/Components/Tag/Tag.styles.js +91 -0
- package/dist/esm/Components/Tag/TagProps.js +1 -0
- package/dist/esm/Components/Timeline/Timeline.js +250 -0
- package/dist/esm/Components/Timeline/TimelineProps.js +1 -0
- package/dist/esm/Components/Toaster/Toaster.js +120 -0
- package/dist/esm/Components/Toaster/Toaster.stories.js +7 -0
- package/dist/esm/Components/Toaster/ToasterProps.js +1 -0
- package/dist/esm/Components/Toggle/TableToggle.js +39 -0
- package/dist/esm/Components/Toggle/TableToggleProps.js +1 -0
- package/dist/esm/Components/ToolTip/OverflowToolTip.js +20 -0
- package/dist/esm/Components/ToolTip/ToolTip.js +35 -0
- package/dist/esm/Components/ToolTip/ToolTip.stories.js +6 -0
- package/dist/esm/Components/ToolTip/ToolTipProps.js +1 -0
- package/dist/esm/Components/Trail/EditableCell.js +27 -0
- package/dist/esm/Components/Trail/SelectAllCheckbox.js +5 -0
- package/dist/esm/Components/Trail/TrailWorks.js +54 -0
- package/dist/esm/Components/Trail/data.js +26 -0
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +79 -0
- package/dist/esm/Components/UpgradeButton/UpgradeButtonProps.js +1 -0
- package/dist/esm/Components/UserDetails/AddUserModal.js +101 -0
- package/dist/esm/Components/UserDetails/ChangeRoleModal.js +56 -0
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +14 -0
- package/dist/esm/Components/UserDetails/UserDetails.js +109 -0
- package/dist/esm/Components/UserDetails/UserDetailsProps.js +1 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +83 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +61 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindowProps.js +1 -0
- package/dist/esm/Constants/Sidebar.js +39 -0
- package/dist/esm/Hooks/useIsTruncated.js +54 -0
- package/dist/esm/Hooks/usePreferences.js +74 -0
- package/dist/esm/Hooks/useSidebarPrefs.js +68 -0
- package/dist/esm/Layout.js +281 -0
- package/dist/esm/Pages/TInput.js +15 -0
- package/dist/esm/Pages/accordion.js +16 -0
- package/dist/esm/Pages/alertdialog.js +15 -0
- package/dist/esm/Pages/button.js +27 -0
- package/dist/esm/Pages/card.js +64 -0
- package/dist/esm/Pages/chart.js +20 -0
- package/dist/esm/Pages/checkbox.js +6 -0
- package/dist/esm/Pages/contactForm.js +10 -0
- package/dist/esm/Pages/customModulesTable.js +20 -0
- package/dist/esm/Pages/datePick.js +44 -0
- package/dist/esm/Pages/drawer.js +15 -0
- package/dist/esm/Pages/dropdown.js +16 -0
- package/dist/esm/Pages/editor.js +8 -0
- package/dist/esm/Pages/feedback.js +6 -0
- package/dist/esm/Pages/fileUpload.js +29 -0
- package/dist/esm/Pages/input.js +43 -0
- package/dist/esm/Pages/kanbanboard.js +177 -0
- package/dist/esm/Pages/modal.js +23 -0
- package/dist/esm/Pages/multiSelect.js +17 -0
- package/dist/esm/Pages/noteArea.js +21 -0
- package/dist/esm/Pages/notification.js +32 -0
- package/dist/esm/Pages/numberInput.js +11 -0
- package/dist/esm/Pages/orgSwitcher.js +31 -0
- package/dist/esm/Pages/organizationDetails.js +75 -0
- package/dist/esm/Pages/photoViewer.js +7 -0
- package/dist/esm/Pages/pinInputs.js +6 -0
- package/dist/esm/Pages/productCaard.js +306 -0
- package/dist/esm/Pages/productDetailCard.js +73 -0
- package/dist/esm/Pages/productFilter.js +143 -0
- package/dist/esm/Pages/progressbar.js +6 -0
- package/dist/esm/Pages/radioButton.js +16 -0
- package/dist/esm/Pages/rolesPermission.js +139 -0
- package/dist/esm/Pages/search.js +16 -0
- package/dist/esm/Pages/searchSelect.js +92 -0
- package/dist/esm/Pages/select.js +15 -0
- package/dist/esm/Pages/selectSearch.js +53 -0
- package/dist/esm/Pages/signInActivityTable.js +12 -0
- package/dist/esm/Pages/skeleton.js +7 -0
- package/dist/esm/Pages/stageProgress.js +26 -0
- package/dist/esm/Pages/switch.js +12 -0
- package/dist/esm/Pages/table.js +175 -0
- package/dist/esm/Pages/tag.js +22 -0
- package/dist/esm/Pages/textArea.js +9 -0
- package/dist/esm/Pages/tier1.js +48 -0
- package/dist/esm/Pages/timeline.js +68 -0
- package/dist/esm/Pages/tooltip.js +6 -0
- package/dist/esm/Pages/toster.js +48 -0
- package/dist/esm/Pages/upgradeButton.js +12 -0
- package/dist/esm/Pages/userDetails.js +74 -0
- package/dist/esm/Pages/verifyEmail.js +12 -0
- package/dist/esm/Theme/chakra/Avatar.styles.js +25 -0
- package/dist/esm/Theme/chakra/Drawer.styles.js +23 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +47 -0
- package/dist/esm/Theme/chakra/Modal.styles.js +23 -0
- package/dist/esm/Theme/chakra/Popover.styles.js +27 -0
- package/dist/esm/Theme/chakra/Slider.styles.js +22 -0
- package/dist/esm/Theme/chakra/Switch.styles.js +21 -0
- package/dist/esm/Theme/chakra/Tabs.styles.js +38 -0
- package/dist/esm/Theme/chakra/common.web.js +22 -0
- package/dist/esm/Theme/chakra/componentStyles.js +221 -0
- package/dist/esm/Theme/chakra/createBrandTheme.js +118 -0
- package/dist/esm/Theme/chakra/fonts.web.js +10 -0
- package/dist/esm/Theme/index.js +63 -0
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +204 -0
- package/dist/esm/Theme/provider/ThemeSwitcher.js +107 -0
- package/dist/esm/Theme/provider/colorModeStorage.js +99 -0
- package/dist/esm/Theme/provider/index.js +3 -0
- package/dist/esm/Theme/provider/useThemeMode.js +9 -0
- package/dist/esm/Theme/themeProps.js +1 -0
- package/dist/esm/Theme/tokens/brands/emerald/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +130 -0
- package/dist/esm/Theme/tokens/brands/index.js +73 -0
- package/dist/esm/Theme/tokens/brands/lavender/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +321 -0
- package/dist/esm/Theme/tokens/brands/meadow/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +128 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +130 -0
- package/dist/esm/Theme/tokens/brands/rosewood/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +134 -0
- package/dist/esm/Theme/tokens/brands/skyline/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +128 -0
- package/dist/esm/Theme/tokens/brands/slate/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +132 -0
- package/dist/esm/Theme/tokens/brands/storefront/palette.dark.js +8 -0
- package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +122 -0
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +202 -0
- package/dist/esm/Theme/tokens/brands/zinc/palette.light.js +381 -0
- package/dist/esm/Theme/tokens/builders/accentText.js +83 -0
- package/dist/esm/Theme/tokens/builders/buildBrandTokens.js +28 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +289 -0
- package/dist/esm/Theme/tokens/builders/chartColorsFromTheme.js +21 -0
- package/dist/esm/Theme/tokens/builders/color.js +141 -0
- package/dist/esm/Theme/tokens/builders/index.js +5 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +63 -0
- package/dist/esm/Theme/tokens/builders/statusTone.js +56 -0
- package/dist/esm/Theme/tokens/index.js +14 -0
- package/dist/esm/Theme/tokens/primitives/breakpoints.js +8 -0
- package/dist/esm/Theme/tokens/primitives/index.js +9 -0
- package/dist/esm/Theme/tokens/primitives/letterSpacings.js +9 -0
- package/dist/esm/Theme/tokens/primitives/lineHeights.js +18 -0
- package/dist/esm/Theme/tokens/primitives/radii.js +12 -0
- package/dist/esm/Theme/tokens/primitives/shadows.js +15 -0
- package/dist/esm/Theme/tokens/primitives/sizes.js +34 -0
- package/dist/esm/Theme/tokens/primitives/space.js +33 -0
- package/dist/esm/Theme/tokens/primitives/typography.js +40 -0
- package/dist/esm/Theme/tokens/primitives/zIndices.js +16 -0
- package/dist/esm/Theme/tokens/types.js +7 -0
- package/dist/esm/Theme/useCustomTheme.js +4 -0
- package/dist/esm/Utils/accountHandoff.js +139 -0
- package/dist/esm/Utils/functions.js +7 -0
- package/dist/esm/Utils/mergeRefs.js +16 -0
- package/dist/esm/Utils/planBadge.js +105 -0
- package/dist/esm/Utils/planExpiry.js +109 -0
- package/dist/esm/Utils/rafThrottle.js +30 -0
- package/dist/esm/Utils/table.js +321 -0
- package/dist/esm/bootstrap.js +11 -0
- package/dist/esm/index.js +133 -0
- package/dist/esm/services/feedback.js +15 -0
- package/dist/esm/withTheme.js +9 -0
- package/package.json +13 -6
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useCallback, useEffect, useId, useRef, useState } from "react";
|
|
3
|
+
import { Box, Flex, Button, useDisclosure, List, ListItem, Portal, } from "@chakra-ui/react";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
import { ChevronDown } from "lucide-react";
|
|
7
|
+
import { rafThrottle } from "../../Utils/rafThrottle";
|
|
8
|
+
const MotionBox = motion(forwardRef((props, ref) => (_jsx(Box, { ref: ref, ...props }))));
|
|
9
|
+
// Size scale (mirrors the Button sizes). `btn` is the Chakra Button size.
|
|
10
|
+
const SIZE_MAP = {
|
|
11
|
+
xs: { btn: "xs", fontSize: "0.75rem", py: 1, px: 2.5, img: "1rem", chevron: 13, minW: "8rem", gap: 1.5 },
|
|
12
|
+
sm: { btn: "sm", fontSize: "0.8125rem", py: 1.5, px: 3, img: "1.05rem", chevron: 14, minW: "9rem", gap: 2 },
|
|
13
|
+
md: { btn: "md", fontSize: "0.875rem", py: 2, px: 3, img: "1.15rem", chevron: 16, minW: "11rem", gap: 2 },
|
|
14
|
+
lg: { btn: "lg", fontSize: "0.9375rem", py: 2.5, px: 3.5, img: "1.25rem", chevron: 18, minW: "12rem", gap: 2.5 },
|
|
15
|
+
xl: { btn: "lg", fontSize: "1.0625rem", py: 3, px: 4, img: "1.4rem", chevron: 20, minW: "13rem", gap: 3 },
|
|
16
|
+
};
|
|
17
|
+
const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleOptionSelect, dropdownType = "button", text, DropdownIcon, isVisibleIconShow = true, buttonProps, headStyle, ListStyle, ItemStyle, LabelStyle, ImageStyle, size, optionsSize, divider = false, ariaLabel, }, ref) => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const theme = useCustomTheme();
|
|
20
|
+
const { isOpen, onOpen, onToggle, onClose } = useDisclosure();
|
|
21
|
+
const dropdownRef = useRef(null);
|
|
22
|
+
const menuRef = useRef(null);
|
|
23
|
+
const [menuPos, setMenuPos] = useState({ top: 0, left: 0, width: 0 });
|
|
24
|
+
const s = (_b = SIZE_MAP[(_a = size !== null && size !== void 0 ? size : optionsSize) !== null && _a !== void 0 ? _a : "md"]) !== null && _b !== void 0 ? _b : SIZE_MAP.md;
|
|
25
|
+
const menuId = useId();
|
|
26
|
+
// Roving-tabindex keyboard nav for the menu (ARIA APG menu-button pattern):
|
|
27
|
+
// real DOM focus moves through the items, so no aria-activedescendant is needed.
|
|
28
|
+
const buttonTriggerRef = useRef(null);
|
|
29
|
+
const textTriggerRef = useRef(null);
|
|
30
|
+
const itemRefs = useRef([]);
|
|
31
|
+
const pendingFocusIndex = useRef(null);
|
|
32
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
33
|
+
// The trigger is never unmounted, so — unlike focusing into the portaled
|
|
34
|
+
// menu on open — this can focus synchronously.
|
|
35
|
+
const focusTrigger = () => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
(_b = ((_a = buttonTriggerRef.current) !== null && _a !== void 0 ? _a : textTriggerRef.current)) === null || _b === void 0 ? void 0 : _b.focus();
|
|
38
|
+
};
|
|
39
|
+
const openAndFocus = (index) => {
|
|
40
|
+
var _a;
|
|
41
|
+
if (isOpen) {
|
|
42
|
+
// Already open (trigger still holds focus, e.g. after Enter/Space) — the
|
|
43
|
+
// portal is already mounted, so focus directly; no need to wait a frame,
|
|
44
|
+
// and the effect below only reacts to isOpen *changing* anyway.
|
|
45
|
+
setActiveIndex(index);
|
|
46
|
+
(_a = itemRefs.current[index]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
pendingFocusIndex.current = index;
|
|
50
|
+
onOpen();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (isOpen) {
|
|
55
|
+
const idx = pendingFocusIndex.current;
|
|
56
|
+
pendingFocusIndex.current = null;
|
|
57
|
+
if (idx !== null) {
|
|
58
|
+
setActiveIndex(idx);
|
|
59
|
+
// Chakra's <Portal> mounts its children a tick after this effect runs
|
|
60
|
+
// (it resolves its target node via its own effect first), so the menu
|
|
61
|
+
// item ref isn't attached yet here — a frame gets us past that.
|
|
62
|
+
requestAnimationFrame(() => { var _a; return (_a = itemRefs.current[idx]) === null || _a === void 0 ? void 0 : _a.focus(); });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
setActiveIndex(0);
|
|
67
|
+
}
|
|
68
|
+
}, [isOpen]);
|
|
69
|
+
const handleListItemClick = (optionId, optionLabel) => {
|
|
70
|
+
onClose();
|
|
71
|
+
handleOptionSelect(optionId, optionLabel);
|
|
72
|
+
};
|
|
73
|
+
const handleTriggerKeyDown = (e) => {
|
|
74
|
+
if (e.key === "ArrowDown") {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
openAndFocus(0);
|
|
77
|
+
}
|
|
78
|
+
else if (e.key === "ArrowUp") {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
openAndFocus(options.length - 1);
|
|
81
|
+
}
|
|
82
|
+
else if (e.key === "Escape" && isOpen) {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
onClose();
|
|
85
|
+
}
|
|
86
|
+
else if (e.key === "Enter" || e.key === " ") {
|
|
87
|
+
// Explicit rather than relying on native button activation: the text
|
|
88
|
+
// trigger is a styled Flex (no default action to rely on), and jsdom's
|
|
89
|
+
// `fireEvent` does not simulate a real browser's Enter/Space-activates-
|
|
90
|
+
// button default action either.
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
onToggle();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
const handleMenuKeyDown = (e) => {
|
|
96
|
+
var _a, _b, _c;
|
|
97
|
+
if (options.length === 0)
|
|
98
|
+
return;
|
|
99
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
const step = e.key === "ArrowDown" ? 1 : -1;
|
|
102
|
+
const next = (activeIndex + step + options.length) % options.length;
|
|
103
|
+
setActiveIndex(next);
|
|
104
|
+
(_a = itemRefs.current[next]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
105
|
+
}
|
|
106
|
+
else if (e.key === "Home") {
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
setActiveIndex(0);
|
|
109
|
+
(_b = itemRefs.current[0]) === null || _b === void 0 ? void 0 : _b.focus();
|
|
110
|
+
}
|
|
111
|
+
else if (e.key === "End") {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
const last = options.length - 1;
|
|
114
|
+
setActiveIndex(last);
|
|
115
|
+
(_c = itemRefs.current[last]) === null || _c === void 0 ? void 0 : _c.focus();
|
|
116
|
+
}
|
|
117
|
+
else if (e.key === "Escape") {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
onClose();
|
|
120
|
+
focusTrigger();
|
|
121
|
+
}
|
|
122
|
+
else if (e.key === "Tab") {
|
|
123
|
+
onClose();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const handleItemKeyDown = (e, optionId, optionLabel) => {
|
|
127
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
128
|
+
e.preventDefault();
|
|
129
|
+
handleListItemClick(optionId, optionLabel);
|
|
130
|
+
focusTrigger();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
// The menu is portaled to <body> (so it sits above everything). Anchor it to
|
|
134
|
+
// the trigger, then clamp to the viewport so it never overflows off-screen
|
|
135
|
+
// (e.g. when the trigger sits near the right or bottom edge).
|
|
136
|
+
const updateMenuPos = useCallback(() => {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
if (!dropdownRef.current)
|
|
139
|
+
return;
|
|
140
|
+
const r = dropdownRef.current.getBoundingClientRect();
|
|
141
|
+
const gutter = 8;
|
|
142
|
+
const vw = window.innerWidth;
|
|
143
|
+
const vh = window.innerHeight;
|
|
144
|
+
// Use the rendered menu size when available; fall back to trigger width.
|
|
145
|
+
const menuW = ((_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || r.width;
|
|
146
|
+
const menuH = ((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) || 0;
|
|
147
|
+
// Horizontal: prefer left-aligned to trigger; if it overflows the right
|
|
148
|
+
// edge, right-align to the trigger, then clamp within [gutter, vw-gutter].
|
|
149
|
+
let left = r.left;
|
|
150
|
+
if (left + menuW > vw - gutter)
|
|
151
|
+
left = r.right - menuW;
|
|
152
|
+
left = Math.min(Math.max(left, gutter), Math.max(gutter, vw - menuW - gutter));
|
|
153
|
+
// Vertical: prefer below the trigger; flip above when it would overflow the
|
|
154
|
+
// bottom and there is more room above. Clamp within the viewport.
|
|
155
|
+
let top = r.bottom;
|
|
156
|
+
const spaceBelow = vh - r.bottom;
|
|
157
|
+
const spaceAbove = r.top;
|
|
158
|
+
if (menuH && top + menuH > vh - gutter && spaceAbove > spaceBelow) {
|
|
159
|
+
top = r.top - menuH;
|
|
160
|
+
}
|
|
161
|
+
top = Math.min(Math.max(top, gutter), Math.max(gutter, vh - menuH - gutter));
|
|
162
|
+
setMenuPos({ top, left, width: r.width });
|
|
163
|
+
}, []);
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (!isOpen)
|
|
166
|
+
return;
|
|
167
|
+
updateMenuPos();
|
|
168
|
+
const onReposition = rafThrottle(updateMenuPos);
|
|
169
|
+
window.addEventListener("scroll", onReposition, {
|
|
170
|
+
capture: true,
|
|
171
|
+
passive: true,
|
|
172
|
+
});
|
|
173
|
+
window.addEventListener("resize", onReposition);
|
|
174
|
+
return () => {
|
|
175
|
+
onReposition.cancel();
|
|
176
|
+
window.removeEventListener("scroll", onReposition, true);
|
|
177
|
+
window.removeEventListener("resize", onReposition);
|
|
178
|
+
};
|
|
179
|
+
}, [isOpen, updateMenuPos]);
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
const handleClickOutside = (event) => {
|
|
182
|
+
var _a, _b;
|
|
183
|
+
const target = event.target;
|
|
184
|
+
// Ignore clicks on the trigger or inside the (portaled) menu.
|
|
185
|
+
if ((_a = dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(target))
|
|
186
|
+
return;
|
|
187
|
+
if ((_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.contains(target))
|
|
188
|
+
return;
|
|
189
|
+
onClose();
|
|
190
|
+
};
|
|
191
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
192
|
+
return () => {
|
|
193
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
194
|
+
};
|
|
195
|
+
}, [onClose]);
|
|
196
|
+
const setMenuRef = (node) => {
|
|
197
|
+
menuRef.current = node;
|
|
198
|
+
if (typeof ref === "function")
|
|
199
|
+
ref(node);
|
|
200
|
+
else if (ref)
|
|
201
|
+
ref.current = node;
|
|
202
|
+
// Recompute once the menu has mounted so clamping uses its real size.
|
|
203
|
+
if (node)
|
|
204
|
+
updateMenuPos();
|
|
205
|
+
};
|
|
206
|
+
const Chevron = isVisibleIconShow ? (_jsx(Box, { as: "span", display: "inline-flex", transition: "transform 0.2s ease", transform: isOpen ? "rotate(180deg)" : "rotate(0deg)", children: _jsx(ChevronDown, { size: s.chevron }) })) : undefined;
|
|
207
|
+
const dropDownToggleOption = () => {
|
|
208
|
+
var _a, _b, _c, _d;
|
|
209
|
+
const ButtonToggle = (_jsx(Button, { ref: buttonTriggerRef, onClick: onToggle, onKeyDown: handleTriggerKeyDown, size: s.btn, colorScheme: "primary", borderRadius: "0.5rem", fontWeight: 600, "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": menuId, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (ButtonText ? undefined : "Open menu"), rightIcon: Chevron, sx: { transition: "all 0.15s ease", ...(dropDownButtonStyle) }, ...buttonProps, children: _jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: DropdownIcon && ButtonText ? s.gap : 0, children: [DropdownIcon, ButtonText] }) }));
|
|
210
|
+
const TextToggle = (_jsxs(Flex, { ref: textTriggerRef, onClick: onToggle, onKeyDown: handleTriggerKeyDown, align: "center", gap: 1.5, cursor: "pointer", fontSize: s.fontSize, fontWeight: 500, color: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b[700], transition: "color 0.15s ease", _hover: { color: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[600] }, style: dropDownButtonStyle, role: "button", tabIndex: 0, "aria-haspopup": "menu", "aria-expanded": isOpen, "aria-controls": menuId, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : (text ? undefined : "Open menu"), children: [DropdownIcon, text, Chevron] }));
|
|
211
|
+
return dropdownType === "button" ? ButtonToggle : TextToggle;
|
|
212
|
+
};
|
|
213
|
+
const DropdownContentRender = () => {
|
|
214
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
215
|
+
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.background) === null || _b === void 0 ? void 0 : _b[50]) !== null && _c !== void 0 ? _c : "#fff", border: `0.063rem solid ${(_f = (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.boxborder) === null || _e === void 0 ? void 0 : _e[200]) !== null && _f !== void 0 ? _f : (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.gray[200]}`, borderRadius: "0.625rem", boxShadow: (_h = theme.shadows) === null || _h === void 0 ? void 0 : _h.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: {
|
|
216
|
+
scrollbarWidth: "thin",
|
|
217
|
+
scrollbarColor: `${(_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.gray) === null || _k === void 0 ? void 0 : _k[300]} transparent`,
|
|
218
|
+
"&::-webkit-scrollbar": { width: "6px" },
|
|
219
|
+
"&::-webkit-scrollbar-thumb": {
|
|
220
|
+
background: (_m = (_l = theme.colors) === null || _l === void 0 ? void 0 : _l.gray) === null || _m === void 0 ? void 0 : _m[300],
|
|
221
|
+
borderRadius: "3px",
|
|
222
|
+
},
|
|
223
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
224
|
+
background: (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.gray) === null || _p === void 0 ? void 0 : _p[400],
|
|
225
|
+
},
|
|
226
|
+
}, style: ListStyle, children: options.map((option, index) => {
|
|
227
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
228
|
+
return (_jsxs(ListItem, { ref: (node) => {
|
|
229
|
+
itemRefs.current[index] = node;
|
|
230
|
+
}, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
|
|
231
|
+
handleListItemClick(option.id, option.label);
|
|
232
|
+
focusTrigger();
|
|
233
|
+
}, onKeyDown: (e) => handleItemKeyDown(e, option.id, option.label), mx: 1.5, px: s.px, py: s.py, borderRadius: "0.375rem", display: "flex", alignItems: "center", gap: 2, cursor: "pointer", color: (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b[700]) !== null && _c !== void 0 ? _c : (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray) === null || _e === void 0 ? void 0 : _e[700], transition: "background 0.12s ease, color 0.12s ease", _hover: {
|
|
234
|
+
bg: (_j = (_h = (_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.primary) === null || _g === void 0 ? void 0 : _g.opacity) === null || _h === void 0 ? void 0 : _h[8]) !== null && _j !== void 0 ? _j : (_k = theme.colors) === null || _k === void 0 ? void 0 : _k.gray[100],
|
|
235
|
+
color: (_o = (_m = (_l = theme.colors) === null || _l === void 0 ? void 0 : _l.primary) === null || _m === void 0 ? void 0 : _m[700]) !== null && _o !== void 0 ? _o : (_q = (_p = theme.colors) === null || _p === void 0 ? void 0 : _p.primary) === null || _q === void 0 ? void 0 : _q[600],
|
|
236
|
+
}, _focus: {
|
|
237
|
+
bg: (_u = (_t = (_s = (_r = theme.colors) === null || _r === void 0 ? void 0 : _r.primary) === null || _s === void 0 ? void 0 : _s.opacity) === null || _t === void 0 ? void 0 : _t[8]) !== null && _u !== void 0 ? _u : (_v = theme.colors) === null || _v === void 0 ? void 0 : _v.gray[100],
|
|
238
|
+
color: (_y = (_x = (_w = theme.colors) === null || _w === void 0 ? void 0 : _w.primary) === null || _x === void 0 ? void 0 : _x[700]) !== null && _y !== void 0 ? _y : (_0 = (_z = theme.colors) === null || _z === void 0 ? void 0 : _z.primary) === null || _0 === void 0 ? void 0 : _0[600],
|
|
239
|
+
}, borderBottom: divider
|
|
240
|
+
? `0.063rem solid ${(_3 = (_2 = (_1 = theme.colors) === null || _1 === void 0 ? void 0 : _1.boxborder) === null || _2 === void 0 ? void 0 : _2[100]) !== null && _3 !== void 0 ? _3 : (_4 = theme.colors) === null || _4 === void 0 ? void 0 : _4.gray[200]}`
|
|
241
|
+
: undefined, sx: { "&:last-child": { borderBottom: "none" } }, style: ItemStyle, fontWeight: 500, children: [(option === null || option === void 0 ? void 0 : option.image) && (_jsx(Box, { as: option.image, boxSize: s.img, flexShrink: 0, color: (_6 = (_5 = theme.colors) === null || _5 === void 0 ? void 0 : _5.gray) === null || _6 === void 0 ? void 0 : _6[500], style: ImageStyle })), _jsx(Box, { as: "span", fontSize: s.fontSize, isTruncated: true,
|
|
242
|
+
// fontWeight={400}
|
|
243
|
+
style: LabelStyle, children: option.label })] }, option.id));
|
|
244
|
+
}) }));
|
|
245
|
+
};
|
|
246
|
+
return (_jsxs(Box, { ref: dropdownRef, position: "relative", display: "inline-block", children: [dropDownToggleOption(), isOpen && (_jsx(Portal, { children: _jsx(MotionBox, { ref: setMenuRef, position: "fixed", top: `${menuPos.top}px`, left: `${menuPos.left}px`, minW: `${menuPos.width}px`, zIndex: 1500, initial: { opacity: 0, y: -6 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -6 }, style: headStyle, children: DropdownContentRender() }) }))] }));
|
|
247
|
+
});
|
|
248
|
+
Dropdown.displayName = "Dropdown";
|
|
249
|
+
export default Dropdown;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useMemo, useState } from "react";
|
|
3
|
+
import { Box } from "@chakra-ui/react";
|
|
4
|
+
import JoditEditor from "jodit-react";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
import { isDarkCanvas } from "../../Theme/tokens/builders/accentText";
|
|
7
|
+
import { getJoditThemeVars } from "./joditThemeVars";
|
|
8
|
+
const Editor = React.memo(function Editor({ value, key, config, editorRef, className, onChange, onBlur, }) {
|
|
9
|
+
const theme = useCustomTheme();
|
|
10
|
+
// Jodit portals dialogs/toolbar-dropdown popups (search & replace, image/link properties,
|
|
11
|
+
// font-size list, ...) to `document.body` by default (`Dialog.destination` /
|
|
12
|
+
// `getPopupViewRoot`), outside this wrapper's DOM subtree — so the CSS custom properties
|
|
13
|
+
// `themeVars` sets below never reach them and they render in Jodit's default light styling
|
|
14
|
+
// even in dark mode. Pointing Jodit's own `popupRoot` config at this wrapper keeps popups
|
|
15
|
+
// inside the subtree those variables cascade into.
|
|
16
|
+
const [popupRoot, setPopupRoot] = useState(null);
|
|
17
|
+
const stableConfig = useMemo(() => {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
return ({
|
|
20
|
+
theme: isDarkCanvas((_b = (_a = theme.colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : "#ffffff") ? "dark" : "default",
|
|
21
|
+
popupRoot,
|
|
22
|
+
// `config` spread as `Record<string, unknown>`: mixing a literal `popupRoot` key with a
|
|
23
|
+
// spread of the raw `DeepPartial<Config>` type (Jodit's huge recursive config type) blows
|
|
24
|
+
// past TS's type-instantiation depth limit (TS2589) — the cast avoids that without
|
|
25
|
+
// weakening the memo's actual return type, which is still asserted below.
|
|
26
|
+
...config,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
30
|
+
[JSON.stringify(config), theme, popupRoot]);
|
|
31
|
+
// Jodit's own `theme: "dark"|"default"` only switches which of ITS selectors apply — those
|
|
32
|
+
// are still driven by Jodit's hardcoded gray/blue CSS variables, not this app's palette. This
|
|
33
|
+
// feeds our actual active colors into those variables, scoped to this instance (see
|
|
34
|
+
// `joditThemeVars.ts`).
|
|
35
|
+
const themeVars = useMemo(() => { var _a, _b; return getJoditThemeVars(theme.colors, isDarkCanvas((_b = (_a = theme.colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : "#ffffff")); }, [theme]);
|
|
36
|
+
return (_jsx(Box, { ref: setPopupRoot, sx: themeVars, children: _jsx(JoditEditor, { config: stableConfig, value: value, ref: editorRef, className: className, onChange: onChange, onBlur: onBlur }, key) }));
|
|
37
|
+
});
|
|
38
|
+
export default Editor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps this library's active palette to the CSS custom properties Jodit's own light/dark theme
|
|
3
|
+
* CSS reads (`node_modules/jodit/es2021/jodit.css`). Jodit's `theme: "dark" | "default"` config
|
|
4
|
+
* only toggles which of ITS OWN selectors apply (`.jodit_theme_dark`, `.jodit-ui-input_theme_dark`,
|
|
5
|
+
* …) — those selectors are still driven by Jodit's own hardcoded `--jd-dark-*` / `--jd-color-*`
|
|
6
|
+
* custom properties (a generic mid-gray `#575757` canvas, a blue `#1e88e5` accent, …), so toggling
|
|
7
|
+
* the theme alone renders the editor in Jodit's palette instead of ours. This is what shipped the
|
|
8
|
+
* reported "editor is not black" bug in dark mode.
|
|
9
|
+
*
|
|
10
|
+
* `PaletteProps.background`/`.text` are role-stable ColorScales whose LIGHTNESS (not index)
|
|
11
|
+
* flips between modes — e.g. `background[50]` is `#ffffff` in light and near-black in dark, and
|
|
12
|
+
* `text[900]` is near-black ink in light and near-white ink in dark (see
|
|
13
|
+
* `Theme/tokens/builders/buildDarkPalette.ts`). So the *same* token expression already resolves
|
|
14
|
+
* correctly in both modes; only the Jodit CSS-variable NAME differs (`--jd-dark-*` only takes
|
|
15
|
+
* effect inside `.jodit_theme_dark`, `--jd-color-*` is what the default theme reads), which is why
|
|
16
|
+
* this still branches on `isDark`.
|
|
17
|
+
*/
|
|
18
|
+
export const getJoditThemeVars = (colors, isDark) => {
|
|
19
|
+
const shared = {
|
|
20
|
+
// Not remapped by `.jodit_theme_dark` in Jodit's own CSS, so one declaration covers both modes.
|
|
21
|
+
"--jd-color-border-selected": colors.primary[500],
|
|
22
|
+
// `--jd-color-panel` backs the search & replace box (`.jodit-ui-search__box`) and any other
|
|
23
|
+
// panel that isn't re-themed under `.jodit_theme_dark` (that scope overrides `--jd-color-border`
|
|
24
|
+
// itself to a hardcoded `#6b6b6b`, but never touches `--jd-color-panel`) — unset in dark mode it
|
|
25
|
+
// fell back to Jodit's own `#f9f9f9`, the reported "Search & Replace panel white" bug. Role-stable
|
|
26
|
+
// like `background`/`text`: the SAME expression already resolved correctly for the light branch.
|
|
27
|
+
"--jd-color-panel": colors.backgroundColor.secondary,
|
|
28
|
+
// Dialog/insert-link/insert-image inputs (`.jodit-ui-input__input`, `.jodit-ui-select__input`)
|
|
29
|
+
// read `--jd-color-white` as their OWN background regardless of theme unless Jodit applied its
|
|
30
|
+
// `_theme_dark` modifier class to that specific element (which reads `--jd-color-gray` instead,
|
|
31
|
+
// set below) — leaving either unset is what shipped the "white inputs" bug, since portalled
|
|
32
|
+
// dialog inputs don't reliably get the modifier class. `background[50]` is this library's
|
|
33
|
+
// established "white surface, darkens in dark mode" token (same pattern as the DatePicker
|
|
34
|
+
// month/year `<select>`), so one declaration is correct in both modes.
|
|
35
|
+
"--jd-color-white": colors.background[50],
|
|
36
|
+
};
|
|
37
|
+
if (isDark) {
|
|
38
|
+
return {
|
|
39
|
+
...shared,
|
|
40
|
+
// `.jodit-workplace`'s own background rule in jodit.css (`.jodit-container:not(.jodit_inline)
|
|
41
|
+
// .jodit-workplace { background-color: var(--jd-color-background-default) }`) is NOT scoped
|
|
42
|
+
// under `.jodit_theme_dark` — that scope only re-themes the *border* on this selector, never
|
|
43
|
+
// the background. `--jd-color-background-default` itself is declared once, at `:root`, as
|
|
44
|
+
// `var(--jd-color-white)`, and our `--jd-color-white` override lives on this instance's wrapper
|
|
45
|
+
// (a descendant), so it never reaches `:root`'s own computed value. Left unset here, the
|
|
46
|
+
// workplace canvas fell back to Jodit's own white default even with `.jodit_theme_dark` active
|
|
47
|
+
// — this is the reported "canvas renders white in dark mode" bug.
|
|
48
|
+
"--jd-color-background-default": colors.backgroundColor.main, // .jodit-workplace canvas bg
|
|
49
|
+
"--jd-dark-background-color": colors.backgroundColor.main, // canvas / toolbar-box / wysiwyg bg
|
|
50
|
+
"--jd-dark-toolbar-color": colors.backgroundColor.secondary, // toolbar + status-bar bg
|
|
51
|
+
"--jd-dark-text-color": colors.text[900], // body/button/status-bar ink
|
|
52
|
+
"--jd-dark-icon-color": colors.text[700], // toolbar icon fill/stroke
|
|
53
|
+
// Was `colors.backgroundColor.muted` — computed at ~1.3:1 against the canvas (a near-miss
|
|
54
|
+
// that shipped: both values sit within ~11 lightness points of each other down near L7-18,
|
|
55
|
+
// where WCAG contrast collapses non-linearly). This backs BOTH the toolbar/dialog-button
|
|
56
|
+
// hover fill (paired with `--jd-dark-background-color` as the flipped-to-dark hover text —
|
|
57
|
+
// see `.jodit_theme_dark .jodit-ui-button:hover` in jodit.css) and the `.jodit-select`/
|
|
58
|
+
// `.jodit-input` background (paired with `--jd-dark-border-color` as its text). `background[900]`
|
|
59
|
+
// is this palette's dark-mode "bright highlight" rung (~9.7-10.7:1 against the canvas across
|
|
60
|
+
// brands) — verified numerically before this change, not assumed.
|
|
61
|
+
"--jd-dark-background-ligher": colors.background[900],
|
|
62
|
+
"--jd-dark-border-color": colors.boxborder[500], // select/input/dialog-header border
|
|
63
|
+
// `_theme_dark`-suffixed input/select variants read this instead of `--jd-color-white` above.
|
|
64
|
+
"--jd-color-gray": colors.background[50],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
...shared,
|
|
69
|
+
"--jd-color-background-default": colors.backgroundColor.main, // workplace/popup bg
|
|
70
|
+
"--jd-color-text": colors.text[900], // base button/status-bar ink
|
|
71
|
+
"--jd-color-icon": colors.text[700], // base icon fill/stroke
|
|
72
|
+
"--jd-color-button-background-hover": colors.backgroundColor.muted, // hover bg
|
|
73
|
+
"--jd-color-border": colors.boxborder[500], // container/workplace border
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HStack, PinInput, PinInputField, Box, Text, Button, Flex, } from "@chakra-ui/react";
|
|
3
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme";
|
|
4
|
+
import { MailCheck } from "lucide-react";
|
|
5
|
+
export default function VerifyEmailOtp({ resendMail, onChange, onComplete, placeholder = "", pins = 5, description, title, isDisabled = false, isInvalid = false, styles, }) {
|
|
6
|
+
const theme = useCustomTheme();
|
|
7
|
+
return (_jsxs(Box, { style: styles, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", p: 6, w: "100%", maxW: "25rem", mx: "auto", borderColor: theme.colors.gray[200], borderRadius: "lg", children: [_jsx(Box, { mb: 4, children: _jsx(MailCheck, { size: 80, color: theme.colors.primary[500] }) }), _jsx(Text, { fontSize: "2xl", fontWeight: "bold", mb: 2, textAlign: "center", children: title }), _jsxs(Text, { fontSize: "md", textAlign: "center", color: theme.colors.gray[600], mb: 6, children: [description, _jsx("br", {}), "your new Pixel Account"] }), _jsx(HStack, { spacing: 3, mb: 6, children: _jsx(PinInput, { placeholder: placeholder, onChange: onChange, onComplete: onComplete, isDisabled: isDisabled, isInvalid: isInvalid, size: "lg", focusBorderColor: theme.colors.primary[500], children: Array.from({ length: pins }).map((_, index) => (_jsx(PinInputField, { borderRadius: "md", border: "0.063rem solid",
|
|
8
|
+
// [800], not [300]: WCAG 1.4.11 needs >=3.0 for a control boundary against any
|
|
9
|
+
// named surface up to `muted` (lightest); [300] fails there, [800] clears all
|
|
10
|
+
// with margin.
|
|
11
|
+
borderColor: theme.colors.boxborder[800], backgroundColor: theme.colors.background[200], _focus: {
|
|
12
|
+
borderColor: theme.colors.primary[500],
|
|
13
|
+
boxShadow: `0 0 0 0.063rem ${theme.colors.primary[500]}`,
|
|
14
|
+
} }, index))) }) }), _jsx(Flex, { justify: "center", children: _jsxs(Text, { fontSize: "sm", color: theme.colors.gray[600], children: ["Didn\u2019t receive the code?", " ", _jsx(Button, { variant: "link", color: theme.colors.primary[700], fontWeight: "semibold", onClick: resendMail, children: "Resend Code" })] }) })] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Flex, Image, Text } from "@chakra-ui/react";
|
|
3
|
+
import { Inbox } from "lucide-react";
|
|
4
|
+
import { keyframes } from "@emotion/react";
|
|
5
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
6
|
+
const float = keyframes `
|
|
7
|
+
0%, 100% { transform: translateY(0); }
|
|
8
|
+
50% { transform: translateY(-8px); }
|
|
9
|
+
`;
|
|
10
|
+
const sizeMap = {
|
|
11
|
+
sm: { badge: "48px", icon: 20, title: "0.95rem", desc: "0.8rem", gap: 2, pad: 6 },
|
|
12
|
+
md: { badge: "72px", icon: 30, title: "1.1rem", desc: "0.9rem", gap: 3, pad: 10 },
|
|
13
|
+
lg: { badge: "96px", icon: 40, title: "1.35rem", desc: "1rem", gap: 4, pad: 14 },
|
|
14
|
+
};
|
|
15
|
+
const EmptyState = ({ title = "No data found", description, icon: IconComp = Inbox, image, size = "md", colorScheme = "primary", variant = "default", action, animate = false, minH = "240px", sx, }) => {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
17
|
+
const theme = useCustomTheme();
|
|
18
|
+
const s = sizeMap[size];
|
|
19
|
+
// Resolve accent palette: theme.colors[colorScheme] or theme.colors.semantic[*]
|
|
20
|
+
const semantic = ["success", "error", "warning", "info"];
|
|
21
|
+
const palette = semantic.includes(colorScheme)
|
|
22
|
+
? theme.colors.semantic[colorScheme]
|
|
23
|
+
: theme.colors[colorScheme];
|
|
24
|
+
const accent = (_a = palette === null || palette === void 0 ? void 0 : palette[500]) !== null && _a !== void 0 ? _a : theme.colors.primary[500];
|
|
25
|
+
const accentSoft = (_b = palette === null || palette === void 0 ? void 0 : palette[50]) !== null && _b !== void 0 ? _b : theme.colors.primary[50];
|
|
26
|
+
const containerStyles = variant === "subtle"
|
|
27
|
+
? { bg: (_d = (_c = theme.colors.gray) === null || _c === void 0 ? void 0 : _c[50]) !== null && _d !== void 0 ? _d : theme.colors.backgroundColor.subtle, borderRadius: "16px" }
|
|
28
|
+
: variant === "dashed"
|
|
29
|
+
? {
|
|
30
|
+
border: "2px dashed",
|
|
31
|
+
borderColor: (_f = (_e = theme.colors.gray) === null || _e === void 0 ? void 0 : _e[200]) !== null && _f !== void 0 ? _f : theme.colors.border[500],
|
|
32
|
+
borderRadius: "16px",
|
|
33
|
+
bg: "transparent",
|
|
34
|
+
}
|
|
35
|
+
: {};
|
|
36
|
+
return (_jsxs(Flex, { direction: "column", align: "center", justify: "center", textAlign: "center", minH: minH, px: s.pad, py: s.pad, gap: s.gap, width: "100%", sx: { ...containerStyles, ...sx }, children: [image ? (_jsx(Image, { src: image, alt: title, boxSize: s.badge, objectFit: "contain", animation: animate ? `${float} 3s ease-in-out infinite` : undefined })) : (_jsx(Flex, { align: "center", justify: "center", boxSize: s.badge, borderRadius: "full", bg: accentSoft, color: accent, animation: animate ? `${float} 3s ease-in-out infinite` : undefined, sx: {
|
|
37
|
+
boxShadow: `0 0 0 8px ${accentSoft}55`,
|
|
38
|
+
}, children: _jsx(IconComp, { size: s.icon, strokeWidth: 1.75 }) })), _jsxs(Box, { children: [_jsx(Text, { fontSize: s.title, fontWeight: 600, color: (_h = (_g = theme.colors.gray) === null || _g === void 0 ? void 0 : _g[800]) !== null && _h !== void 0 ? _h : theme.colors.text[900], mt: 1, children: title }), description && (_jsx(Text, { fontSize: s.desc, color: (_k = (_j = theme.colors.gray) === null || _j === void 0 ? void 0 : _j[500]) !== null && _k !== void 0 ? _k : theme.colors.text[400], mt: 1, maxW: "380px", children: description }))] }), action && (_jsx(Flex, { gap: 3, mt: 2, wrap: "wrap", justify: "center", children: action }))] }));
|
|
39
|
+
};
|
|
40
|
+
export default EmptyState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from "react";
|
|
3
|
+
import { Box, Button, FormControl, FormLabel, FormErrorMessage, Grid, Input, Radio, RadioGroup, Stack, Textarea, useToast, } from "@chakra-ui/react";
|
|
4
|
+
// eslint-disable-next-line no-control-regex, no-useless-escape
|
|
5
|
+
const emailRegex = /^(?:[a-zA-Z0-9_'^&\/+{}=?`|~!-]+(?:\.[a-zA-Z0-9_'^&\/+{}=?`|~!-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z-]*[a-zA-Z]:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]+)\])$/;
|
|
6
|
+
export default function FeedbackForm(props) {
|
|
7
|
+
var _a, _b, _c, _d, _e;
|
|
8
|
+
const { onSubmit, submitUrl, isDisabled, defaultValues, submitText = "Submit", isSubmittingText = "Submitting..." } = props;
|
|
9
|
+
const toast = useToast();
|
|
10
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
11
|
+
const [type, setType] = useState((_a = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.type) !== null && _a !== void 0 ? _a : "comments");
|
|
12
|
+
const [message, setMessage] = useState((_b = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.message) !== null && _b !== void 0 ? _b : "");
|
|
13
|
+
const [firstName, setFirstName] = useState((_c = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.firstName) !== null && _c !== void 0 ? _c : "");
|
|
14
|
+
const [lastName, setLastName] = useState((_d = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.lastName) !== null && _d !== void 0 ? _d : "");
|
|
15
|
+
const [email, setEmail] = useState((_e = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.email) !== null && _e !== void 0 ? _e : "");
|
|
16
|
+
const errors = useMemo(() => {
|
|
17
|
+
return {
|
|
18
|
+
message: message.trim().length === 0 ? "Please describe your feedback" : "",
|
|
19
|
+
firstName: firstName.trim().length === 0 ? "First name is required" : "",
|
|
20
|
+
lastName: lastName.trim().length === 0 ? "Last name is required" : "",
|
|
21
|
+
email: email.trim().length === 0 ? "Email is required" : !emailRegex.test(email) ? "Enter a valid email" : "",
|
|
22
|
+
};
|
|
23
|
+
}, [message, firstName, lastName, email]);
|
|
24
|
+
const hasErrors = Object.values(errors).some(Boolean);
|
|
25
|
+
const handleSubmit = async (e) => {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
if (hasErrors) {
|
|
28
|
+
toast({ status: "error", title: "Please fix the errors in the form" });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const payload = { type, message: message.trim(), firstName: firstName.trim(), lastName: lastName.trim(), email: email.trim() };
|
|
32
|
+
try {
|
|
33
|
+
setIsSubmitting(true);
|
|
34
|
+
if (onSubmit) {
|
|
35
|
+
await onSubmit(payload);
|
|
36
|
+
}
|
|
37
|
+
else if (submitUrl) {
|
|
38
|
+
const res = await fetch(submitUrl, {
|
|
39
|
+
method: "POST",
|
|
40
|
+
headers: { "Content-Type": "application/json" },
|
|
41
|
+
body: JSON.stringify(payload),
|
|
42
|
+
});
|
|
43
|
+
if (!res.ok)
|
|
44
|
+
throw new Error(`Request failed: ${res.status}`);
|
|
45
|
+
}
|
|
46
|
+
toast({ status: "success", title: "Thank you for your feedback" });
|
|
47
|
+
setMessage("");
|
|
48
|
+
setFirstName("");
|
|
49
|
+
setLastName("");
|
|
50
|
+
setEmail("");
|
|
51
|
+
setType("comments");
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
toast({
|
|
55
|
+
status: "error",
|
|
56
|
+
title: "Could not submit feedback",
|
|
57
|
+
description: err instanceof Error ? err.message : String(err),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
setIsSubmitting(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return (_jsxs(Box, { as: "form", onSubmit: handleSubmit, width: "100%", children: [_jsxs(FormControl, { as: Box, mb: 6, isDisabled: isDisabled, children: [_jsx(FormLabel, { children: "Feedback Type" }), _jsx(RadioGroup, { value: type, onChange: (v) => setType(v), children: _jsxs(Stack, { direction: "row", spacing: 8, children: [_jsx(Radio, { value: "comments", children: "Comments" }), _jsx(Radio, { value: "suggestions", children: "Suggestions" }), _jsx(Radio, { value: "questions", children: "Questions" })] }) })] }), _jsxs(FormControl, { mb: 6, isInvalid: !!errors.message, isRequired: true, isDisabled: isDisabled, children: [_jsx(FormLabel, { children: "Describe Your Feedback" }), _jsx(Textarea, { value: message, onChange: (e) => setMessage(e.target.value), rows: 6, placeholder: "Tell us more..." }), _jsx(FormErrorMessage, { children: errors.message })] }), _jsxs(Grid, { templateColumns: { base: "1fr", md: "1fr 1fr" }, gap: 4, mb: 6, children: [_jsxs(FormControl, { isInvalid: !!errors.firstName, isRequired: true, isDisabled: isDisabled, children: [_jsx(FormLabel, { children: "First Name" }), _jsx(Input, { value: firstName, onChange: (e) => setFirstName(e.target.value), placeholder: "First name" }), _jsx(FormErrorMessage, { children: errors.firstName })] }), _jsxs(FormControl, { isInvalid: !!errors.lastName, isRequired: true, isDisabled: isDisabled, children: [_jsx(FormLabel, { children: "Last Name" }), _jsx(Input, { value: lastName, onChange: (e) => setLastName(e.target.value), placeholder: "Last name" }), _jsx(FormErrorMessage, { children: errors.lastName })] })] }), _jsxs(FormControl, { mb: 6, isInvalid: !!errors.email, isRequired: true, isDisabled: isDisabled, children: [_jsx(FormLabel, { children: "E-mail" }), _jsx(Input, { type: "email", value: email, onChange: (e) => setEmail(e.target.value), placeholder: "ex: myname@example.com" }), _jsx(FormErrorMessage, { children: errors.email })] }), _jsx(Button, { type: "submit", colorScheme: "primary", isLoading: isSubmitting, loadingText: isSubmittingText, isDisabled: isDisabled, children: submitText })] }));
|
|
65
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { Button, Checkbox, Flex, Input, InputGroup, InputLeftElement, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, SimpleGrid, Text, } from "@chakra-ui/react";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { Search } from "lucide-react";
|
|
6
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme";
|
|
7
|
+
const MotionModalContent = motion(ModalContent);
|
|
8
|
+
const FieldSelectModal = ({ isOpen, onClose, fields, onConfirm, title = "Select Fields", confirmText = "Apply", loadingText = "Applying...", isLoading = false, defaultSelected, columns = 2, searchable, }) => {
|
|
9
|
+
const theme = useCustomTheme();
|
|
10
|
+
const [selected, setSelected] = useState([]);
|
|
11
|
+
const [query, setQuery] = useState("");
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (isOpen) {
|
|
14
|
+
setSelected(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : fields.map((f) => f.field_name));
|
|
15
|
+
setQuery("");
|
|
16
|
+
}
|
|
17
|
+
}, [isOpen, fields, defaultSelected]);
|
|
18
|
+
const showSearch = searchable !== null && searchable !== void 0 ? searchable : fields.length >= 8;
|
|
19
|
+
const visibleFields = useMemo(() => {
|
|
20
|
+
if (!query.trim())
|
|
21
|
+
return fields;
|
|
22
|
+
const q = query.toLowerCase();
|
|
23
|
+
return fields.filter((f) => f.field_label.toLowerCase().includes(q));
|
|
24
|
+
}, [fields, query]);
|
|
25
|
+
const toggle = (name) => setSelected((prev) => prev.includes(name) ? prev.filter((f) => f !== name) : [...prev, name]);
|
|
26
|
+
const isAllSelected = selected.length === fields.length && fields.length > 0;
|
|
27
|
+
const isIndeterminate = selected.length > 0 && selected.length < fields.length;
|
|
28
|
+
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, size: "xl", isCentered: true, children: [_jsx(ModalOverlay, { bg: "blackAlpha.400", backdropFilter: "blur(4px)" }), _jsxs(MotionModalContent, { borderRadius: "16px", overflow: "hidden", maxH: "85vh",
|
|
29
|
+
// Chakra's default dialog bg (`colors.white`, or `gray.700` under `_dark`) resolves to a
|
|
30
|
+
// white/light-grey panel against our palettes, so the surface must be set explicitly.
|
|
31
|
+
bg: theme.colors.background[50], initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(ModalHeader, { pb: 2, children: [_jsx(Text, { fontSize: "lg", fontWeight: 600, children: title }), _jsxs(Text, { fontSize: "sm", color: theme.colors.gray[500], fontWeight: 400, children: [selected.length, " of ", fields.length, " selected"] })] }), _jsx(ModalCloseButton, {}), _jsxs(ModalBody, { overflowY: "auto", children: [_jsxs(Flex, { align: "center", justify: "space-between", mb: 3, gap: 3, wrap: "wrap", children: [_jsx(Checkbox, { isChecked: isAllSelected, isIndeterminate: isIndeterminate, onChange: (e) => setSelected(e.target.checked ? fields.map((f) => f.field_name) : []), fontWeight: 500, children: "Select all" }), showSearch && (_jsxs(InputGroup, { size: "sm", maxW: "220px", children: [_jsx(InputLeftElement, { pointerEvents: "none", children: _jsx(Search, { size: 15, color: theme.colors.gray[400] }) }), _jsx(Input, { placeholder: "Search fields", value: query, onChange: (e) => setQuery(e.target.value), borderRadius: "8px" })] }))] }), _jsx(SimpleGrid, { columns: columns, spacingX: 4, spacingY: 3, children: visibleFields.map((field) => (_jsx(Checkbox, { isChecked: selected.includes(field.field_name), onChange: () => toggle(field.field_name), children: _jsx(Text, { fontSize: "sm", children: field.field_label }) }, field.field_name))) }), visibleFields.length === 0 && (_jsxs(Text, { fontSize: "sm", color: theme.colors.gray[500], textAlign: "center", py: 6, children: ["No fields match \"", query, "\""] }))] }), _jsxs(ModalFooter, { gap: 3, children: [_jsx(Button, { variant: "outline", colorScheme: "gray", size: "sm", onClick: onClose, children: "Cancel" }), _jsx(Button, { colorScheme: "primary", size: "sm", isLoading: isLoading, loadingText: loadingText, isDisabled: selected.length === 0, onClick: () => onConfirm(selected), children: confirmText })] })] })] }));
|
|
32
|
+
};
|
|
33
|
+
export default FieldSelectModal;
|