pixelize-design-library 2.4.2-beta.0 → 2.4.2-beta.2
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/Components/Accordion/Accordion.js +13 -15
- package/dist/Components/Accordion/accordionColors.js +6 -9
- package/dist/Components/AlertDialog/AlertDialog.js +1 -2
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +2 -3
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +2 -3
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +2 -3
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +9 -7
- package/dist/Components/Button/Button.styles.js +4 -10
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +9 -10
- package/dist/Components/Common/ErrorComponent.js +5 -8
- package/dist/Components/Common/ErrorMessage.js +2 -8
- package/dist/Components/Common/FormLabel.js +1 -3
- package/dist/Components/Common/FormattedDescription.js +3 -1
- package/dist/Components/Common/Label.js +3 -8
- package/dist/Components/Common/fieldStyles.js +6 -7
- package/dist/Components/ContactForm/ContactForm.js +1 -2
- package/dist/Components/CopyButton/CopyButton.js +3 -6
- package/dist/Components/CustomModulesTable/CustomModulesTable.js +7 -10
- package/dist/Components/CustomModulesTable/DeleteModuleModal.js +2 -2
- package/dist/Components/CustomModulesTable/EditModuleModal.js +2 -3
- package/dist/Components/DatePicker/CalendarPanel.js +2 -3
- package/dist/Components/DatePicker/RangeDatePicker.js +9 -9
- package/dist/Components/DatePicker/SingleDatePicker.js +11 -11
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -2
- package/dist/Components/DatePicker/TimePicker.js +6 -7
- package/dist/Components/DatePicker/TimePickerInput.js +6 -7
- package/dist/Components/Divider/Divider.js +1 -2
- package/dist/Components/Drawer/Drawer.js +1 -2
- package/dist/Components/Dropdown/DropDown.js +22 -26
- package/dist/Components/Editor/Editor.js +10 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
- package/dist/Components/EmptyState/EmptyState.js +11 -11
- package/dist/Components/FieldSelectModal/FieldSelectModal.js +1 -1
- package/dist/Components/FilePreview/FilePreview.js +2 -2
- package/dist/Components/FileUpload/FileUpload.js +18 -24
- package/dist/Components/FileUploader/FileUploader.js +5 -6
- package/dist/Components/FilterSidebar/FilterSidebar.js +156 -160
- package/dist/Components/Form/FormWrapper.js +1 -2
- package/dist/Components/Header/Header.js +6 -6
- package/dist/Components/Header/HeaderActions.d.ts +3 -1
- package/dist/Components/Header/HeaderActions.js +8 -4
- package/dist/Components/Header/components/desktopMenu.js +7 -20
- package/dist/Components/Header/components/mobileMenu.js +3 -15
- package/dist/Components/Input/Input/Input.js +13 -17
- package/dist/Components/Input/TextInput.styles.js +10 -13
- package/dist/Components/InputTextArea/InputTextArea.d.ts +1 -1
- package/dist/Components/InputTextArea/InputTextArea.style.js +10 -11
- package/dist/Components/KanbanBoard/AccountCard.js +10 -4
- package/dist/Components/KanbanBoard/AccountRow.js +1 -2
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/Components/KanbanBoard/KanbanBoard.js +21 -28
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +3 -15
- package/dist/Components/Loading/Loading.js +1 -1
- package/dist/Components/Modal/Modal.js +3 -1
- package/dist/Components/MoreItems/MoreItems.js +3 -7
- package/dist/Components/MultiSelect/MultiSelect.js +5 -6
- package/dist/Components/NavigationBar/NavigationBar.d.ts +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +22 -18
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +5 -0
- package/dist/Components/NoteTextArea/NoteTextArea.js +4 -8
- package/dist/Components/Notification/Notification.js +17 -15
- package/dist/Components/NumberInput/NumberInput.styles.js +10 -11
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +6 -7
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +2 -0
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.js +6 -2
- package/dist/Components/OrganizationDetails/CreateOrgModal.js +1 -2
- package/dist/Components/OrganizationDetails/DeleteOrgModal.js +5 -2
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +25 -22
- package/dist/Components/PdfViewer/PdfViewer.js +1 -1
- package/dist/Components/PinInputs/PinInputs.js +7 -14
- package/dist/Components/PlanPill/PlanPill.js +5 -8
- package/dist/Components/PlanPill/planPillGradient.d.ts +19 -0
- package/dist/Components/PlanPill/planPillGradient.js +30 -1
- package/dist/Components/ProductCard/ProductPrice.js +6 -6
- package/dist/Components/ProductCard/ProductReview.js +4 -1
- package/dist/Components/ProductCard/ProductTags.js +4 -4
- package/dist/Components/ProductDetails/ProductDetails.js +3 -1
- package/dist/Components/ProductDetails/ProductDtlPrice.js +3 -3
- package/dist/Components/ProfileCard/ProfileCard.js +4 -4
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +19 -16
- package/dist/Components/Reorder/Reorder.js +3 -4
- package/dist/Components/RolesPermission/DeleteRoleModal.js +5 -4
- package/dist/Components/RolesPermission/RolesPermission.js +12 -14
- package/dist/Components/ScrollToTop/ScrollToTop.js +2 -3
- package/dist/Components/SearchSelect/SearchSelect.js +25 -28
- package/dist/Components/Select/Select.styles.js +33 -37
- package/dist/Components/SelectSearch/SelectSearch.js +8 -8
- package/dist/Components/SelectV2/SelectV2.js +14 -20
- package/dist/Components/SideBar/SecondaryBar.js +10 -15
- package/dist/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/Components/SideBar/SideBar.js +41 -34
- package/dist/Components/SideBar/SideBarProps.d.ts +6 -0
- package/dist/Components/SideBar/components/MenuItemBox.js +10 -12
- package/dist/Components/SideBar/components/MenuItems.js +3 -1
- package/dist/Components/SideBar/components/MenuPopoverContent.js +7 -9
- package/dist/Components/SideBar/components/OtherApps.js +4 -4
- package/dist/Components/SideBar/sidebarAccentColors.d.ts +4 -17
- package/dist/Components/SideBar/sidebarAccentColors.js +6 -33
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +6 -7
- package/dist/Components/Slider/Slider.js +2 -2
- package/dist/Components/StageProgress/StageProgressProps.js +9 -13
- package/dist/Components/Table/Table.js +10 -10
- package/dist/Components/Table/components/HeaderActions.js +6 -7
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/components/TableActions.js +4 -4
- package/dist/Components/Table/components/TableBody.js +18 -20
- package/dist/Components/Table/components/TableGroupRow.js +1 -2
- package/dist/Components/Table/components/TableHeader.js +8 -12
- package/dist/Components/Table/components/TableSearch.js +1 -2
- package/dist/Components/Table/components/tableRowHoverStyle.js +2 -3
- package/dist/Components/Table/filters/ActiveFilters.js +5 -8
- package/dist/Components/Table/filters/CompactSelect.js +4 -5
- package/dist/Components/Table/filters/LeftFilterPane.js +4 -5
- package/dist/Components/Table/filters/TableFilters.js +1 -2
- package/dist/Components/Table/hooks/useTable.js +8 -11
- package/dist/Components/Table/settings/ManageColumns.js +1 -1
- package/dist/Components/Table/settings/TableSettings.js +12 -14
- package/dist/Components/Tag/Tag.styles.js +8 -6
- package/dist/Components/Timeline/Timeline.js +32 -45
- package/dist/Components/Toaster/Toaster.js +43 -44
- package/dist/Components/ToolTip/ToolTip.js +1 -6
- package/dist/Components/Trail/EditableCell.js +4 -1
- package/dist/Components/Trail/TrailWorks.js +3 -3
- package/dist/Components/UpgradeButton/UpgradeButton.js +2 -4
- package/dist/Components/UserDetails/AddUserModal.js +3 -3
- package/dist/Components/UserDetails/ChangeRoleModal.js +2 -2
- package/dist/Components/UserDetails/DeactivateConfirmModal.js +5 -5
- package/dist/Components/UserDetails/UserDetails.js +14 -16
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +1 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +3 -4
- package/dist/Theme/assertPalette.d.ts +11 -0
- package/dist/Theme/assertPalette.js +55 -0
- package/dist/Theme/chakra/Avatar.styles.d.ts +5 -5
- package/dist/Theme/chakra/Avatar.styles.js +2 -2
- package/dist/Theme/chakra/Drawer.styles.d.ts +5 -5
- package/dist/Theme/chakra/Drawer.styles.js +8 -10
- package/dist/Theme/chakra/Modal.styles.d.ts +5 -5
- package/dist/Theme/chakra/Modal.styles.js +8 -10
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -3
- package/dist/Theme/chakra/Slider.styles.d.ts +1 -1
- package/dist/Theme/chakra/Slider.styles.js +7 -9
- package/dist/Theme/chakra/Tabs.styles.d.ts +2 -2
- package/dist/Theme/chakra/Tabs.styles.js +13 -18
- package/dist/Theme/chakra/componentStyles.d.ts +54 -21
- package/dist/Theme/chakra/componentStyles.js +52 -43
- package/dist/Theme/chakra/paletteFromTheme.d.ts +10 -0
- package/dist/Theme/chakra/paletteFromTheme.js +14 -0
- package/dist/Theme/provider/PixelizeThemeProvider.js +5 -0
- package/dist/Theme/testing/testPalette.d.ts +16 -0
- package/dist/Theme/testing/testPalette.js +24 -0
- package/dist/Theme/tokens/brands/emerald/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/emerald/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/index.d.ts +3 -2
- package/dist/Theme/tokens/brands/index.js +29 -23
- package/dist/Theme/tokens/brands/lavender/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/lavender/palette.light.js +3 -110
- package/dist/Theme/tokens/brands/meadow/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
- package/dist/Theme/tokens/brands/neutrals.js +119 -0
- package/dist/Theme/tokens/brands/radiant/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/rosewood/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/skyline/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/slate/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/slate/palette.light.js +6 -8
- package/dist/Theme/tokens/brands/storefront/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +5 -3
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/zinc/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/builders/accentText.d.ts +2 -2
- package/dist/Theme/tokens/builders/accentText.js +8 -27
- package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
- package/dist/Theme/tokens/builders/brandInk.js +106 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -2
- package/dist/Theme/tokens/builders/buildDarkPalette.js +16 -8
- package/dist/Theme/tokens/builders/mutedText.d.ts +5 -0
- package/dist/Theme/tokens/builders/mutedText.js +9 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +7 -6
- package/dist/Theme/tokens/builders/outlineRung.js +20 -18
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +7 -0
- package/dist/Theme/tokens/builders/resolvedRungs.js +25 -0
- package/dist/Theme/tokens/builders/semanticText.d.ts +10 -0
- package/dist/Theme/tokens/builders/semanticText.js +22 -0
- package/dist/Theme/tokens/builders/sidebarAccent.d.ts +9 -0
- package/dist/Theme/tokens/builders/sidebarAccent.js +29 -0
- package/dist/Theme/tokens/builders/statusTone.js +3 -4
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +39 -0
- package/dist/Theme/tokens/types.d.ts +41 -13
- package/dist/Theme/useCustomTheme.js +4 -1
- package/dist/Utils/table.d.ts +1 -7
- package/dist/Utils/table.js +27 -35
- package/dist/esm/Components/Accordion/Accordion.js +14 -16
- package/dist/esm/Components/Accordion/accordionColors.js +6 -9
- package/dist/esm/Components/AlertDialog/AlertDialog.js +1 -2
- package/dist/esm/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +2 -3
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +9 -7
- package/dist/esm/Components/Button/Button.styles.js +4 -10
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +9 -10
- package/dist/esm/Components/Common/ErrorComponent.js +6 -9
- package/dist/esm/Components/Common/ErrorMessage.js +2 -8
- package/dist/esm/Components/Common/FormLabel.js +1 -3
- package/dist/esm/Components/Common/FormattedDescription.js +3 -1
- package/dist/esm/Components/Common/Label.js +3 -8
- package/dist/esm/Components/Common/fieldStyles.js +6 -7
- package/dist/esm/Components/ContactForm/ContactForm.js +1 -2
- package/dist/esm/Components/CopyButton/CopyButton.js +3 -6
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +7 -10
- package/dist/esm/Components/CustomModulesTable/DeleteModuleModal.js +2 -2
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +2 -3
- package/dist/esm/Components/DatePicker/CalendarPanel.js +2 -3
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +9 -9
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +11 -11
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -2
- package/dist/esm/Components/DatePicker/TimePicker.js +6 -7
- package/dist/esm/Components/DatePicker/TimePickerInput.js +6 -7
- package/dist/esm/Components/Divider/Divider.js +1 -2
- package/dist/esm/Components/Drawer/Drawer.js +1 -2
- package/dist/esm/Components/Dropdown/DropDown.js +22 -26
- package/dist/esm/Components/Editor/Editor.js +11 -14
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
- package/dist/esm/Components/EmptyState/EmptyState.js +11 -11
- package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +1 -1
- package/dist/esm/Components/FilePreview/FilePreview.js +2 -2
- package/dist/esm/Components/FileUpload/FileUpload.js +18 -24
- package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +157 -161
- package/dist/esm/Components/Form/FormWrapper.js +1 -2
- package/dist/esm/Components/Header/Header.js +6 -6
- package/dist/esm/Components/Header/HeaderActions.js +9 -5
- package/dist/esm/Components/Header/components/desktopMenu.js +8 -21
- package/dist/esm/Components/Header/components/mobileMenu.js +3 -15
- package/dist/esm/Components/Input/Input/Input.js +14 -18
- package/dist/esm/Components/Input/TextInput.styles.js +10 -13
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +10 -11
- package/dist/esm/Components/KanbanBoard/AccountCard.js +10 -4
- package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -2
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +21 -28
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -16
- package/dist/esm/Components/Loading/Loading.js +1 -1
- package/dist/esm/Components/Modal/Modal.js +3 -1
- package/dist/esm/Components/MoreItems/MoreItems.js +3 -7
- package/dist/esm/Components/MultiSelect/MultiSelect.js +5 -6
- package/dist/esm/Components/NavigationBar/NavigationBar.js +23 -19
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +4 -8
- package/dist/esm/Components/Notification/Notification.js +18 -16
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +10 -11
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +7 -8
- package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +5 -1
- package/dist/esm/Components/OrganizationDetails/CreateOrgModal.js +1 -2
- package/dist/esm/Components/OrganizationDetails/DeleteOrgModal.js +5 -2
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +25 -22
- package/dist/esm/Components/PdfViewer/PdfViewer.js +1 -1
- package/dist/esm/Components/PinInputs/PinInputs.js +8 -15
- package/dist/esm/Components/PlanPill/PlanPill.js +6 -9
- package/dist/esm/Components/PlanPill/planPillGradient.js +24 -0
- package/dist/esm/Components/ProductCard/ProductPrice.js +6 -6
- package/dist/esm/Components/ProductCard/ProductReview.js +4 -1
- package/dist/esm/Components/ProductCard/ProductTags.js +5 -5
- package/dist/esm/Components/ProductDetails/ProductDetails.js +3 -1
- package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +3 -3
- package/dist/esm/Components/ProfileCard/ProfileCard.js +5 -5
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +20 -17
- package/dist/esm/Components/Reorder/Reorder.js +3 -4
- package/dist/esm/Components/RolesPermission/DeleteRoleModal.js +5 -4
- package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -14
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +2 -3
- package/dist/esm/Components/SearchSelect/SearchSelect.js +25 -28
- package/dist/esm/Components/Select/Select.styles.js +33 -37
- package/dist/esm/Components/SelectSearch/SelectSearch.js +8 -8
- package/dist/esm/Components/SelectV2/SelectV2.js +14 -20
- package/dist/esm/Components/SideBar/SecondaryBar.js +11 -16
- package/dist/esm/Components/SideBar/SideBar.js +43 -36
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +11 -13
- package/dist/esm/Components/SideBar/components/MenuItems.js +3 -1
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +8 -10
- package/dist/esm/Components/SideBar/components/OtherApps.js +4 -4
- package/dist/esm/Components/SideBar/sidebarAccentColors.js +5 -31
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +6 -7
- package/dist/esm/Components/Slider/Slider.js +2 -2
- package/dist/esm/Components/StageProgress/StageProgressProps.js +9 -13
- package/dist/esm/Components/Table/Table.js +10 -10
- package/dist/esm/Components/Table/components/HeaderActions.js +6 -7
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/components/TableActions.js +4 -4
- package/dist/esm/Components/Table/components/TableBody.js +18 -20
- package/dist/esm/Components/Table/components/TableGroupRow.js +1 -2
- package/dist/esm/Components/Table/components/TableHeader.js +8 -12
- package/dist/esm/Components/Table/components/TableSearch.js +1 -2
- package/dist/esm/Components/Table/components/tableRowHoverStyle.js +2 -3
- package/dist/esm/Components/Table/filters/ActiveFilters.js +5 -8
- package/dist/esm/Components/Table/filters/CompactSelect.js +4 -5
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +4 -5
- package/dist/esm/Components/Table/filters/TableFilters.js +1 -2
- package/dist/esm/Components/Table/hooks/useTable.js +8 -11
- package/dist/esm/Components/Table/settings/ManageColumns.js +1 -1
- package/dist/esm/Components/Table/settings/TableSettings.js +12 -14
- package/dist/esm/Components/Tag/Tag.styles.js +9 -7
- package/dist/esm/Components/Timeline/Timeline.js +33 -46
- package/dist/esm/Components/Toaster/Toaster.js +44 -45
- package/dist/esm/Components/ToolTip/ToolTip.js +1 -6
- package/dist/esm/Components/Trail/EditableCell.js +4 -1
- package/dist/esm/Components/Trail/TrailWorks.js +4 -4
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +2 -4
- package/dist/esm/Components/UserDetails/AddUserModal.js +3 -3
- package/dist/esm/Components/UserDetails/ChangeRoleModal.js +2 -2
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +5 -5
- package/dist/esm/Components/UserDetails/UserDetails.js +15 -17
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +1 -2
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +3 -4
- package/dist/esm/Theme/assertPalette.js +50 -0
- package/dist/esm/Theme/chakra/Avatar.styles.js +2 -2
- package/dist/esm/Theme/chakra/Drawer.styles.js +8 -10
- package/dist/esm/Theme/chakra/Modal.styles.js +8 -10
- package/dist/esm/Theme/chakra/Slider.styles.js +7 -9
- package/dist/esm/Theme/chakra/Tabs.styles.js +13 -18
- package/dist/esm/Theme/chakra/componentStyles.js +53 -44
- package/dist/esm/Theme/chakra/paletteFromTheme.js +9 -0
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +5 -0
- package/dist/esm/Theme/testing/testPalette.js +19 -0
- package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/index.js +28 -23
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +3 -110
- package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +6 -5
- package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +3 -2
- package/dist/esm/Theme/tokens/builders/accentText.js +8 -27
- package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +17 -9
- package/dist/esm/Theme/tokens/builders/mutedText.js +5 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +21 -19
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +20 -0
- package/dist/esm/Theme/tokens/builders/semanticText.js +17 -0
- package/dist/esm/Theme/tokens/builders/sidebarAccent.js +23 -0
- package/dist/esm/Theme/tokens/builders/statusTone.js +3 -4
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +33 -0
- package/dist/esm/Theme/useCustomTheme.js +4 -1
- package/dist/esm/Utils/table.js +28 -36
- package/dist/esm/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -2
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { TimePickerInput } from "./TimePickerInput.js";
|
|
|
10
10
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
11
11
|
const formatToPlaceholder = (formatStr) => formatStr.replace(/h{1,2}/gi, "HH").replace(/m{1,2}/gi, "mm").replace(/a{1,2}/gi, "AM");
|
|
12
12
|
export const TimeOnlyPicker = (props) => {
|
|
13
|
-
var _a, _b
|
|
13
|
+
var _a, _b;
|
|
14
14
|
const { id, label, isRequired, isInformation, informationMessage, error, errorMessage, helperText, placeholderText, dateFormat = "HH:mm", disabled, width = "100%", disableToday = false, size = "md", } = props;
|
|
15
15
|
const theme = useCustomTheme();
|
|
16
16
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
|
@@ -73,6 +73,6 @@ export const TimeOnlyPicker = (props) => {
|
|
|
73
73
|
onOpen();
|
|
74
74
|
}, error: error, size: sizeKey }) }) }) }), _jsx(PopoverContent, { width: "auto", p: 4, ref: popoverRef, boxShadow: "lg", bg: theme.colors.background[50], children: _jsxs(PopoverBody, { children: [_jsx(TimePicker, { date: resolvedTempDate, dateFormat: dateFormat, onChange: (updatedDate) => {
|
|
75
75
|
handleTimePickerChange(updatedDate);
|
|
76
|
-
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor:
|
|
76
|
+
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[300], children: [_jsx(ChakraButton, { size: "sm", variant: "ghost", onClick: handleClear, children: "Clear" }), _jsx(ChakraButton, { size: "sm", colorScheme: "primary", onClick: handleOk, children: "OK" })] })] }) })] }), error && errorMessage && _jsx(ErrorMessage, { errorMessage: errorMessage }), helperText && !error && _jsx(HelperText, { helperText: helperText })] }));
|
|
77
77
|
};
|
|
78
78
|
export default TimeOnlyPicker;
|
|
@@ -3,7 +3,6 @@ import { useState, useEffect } from "react";
|
|
|
3
3
|
import { Select, HStack } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
5
|
const TimePicker = ({ date, onChange, dateFormat, disabled = false }) => {
|
|
6
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
7
6
|
const theme = useCustomTheme();
|
|
8
7
|
const is12HourFormat = /(hh|h).*a/i.test(dateFormat);
|
|
9
8
|
const deriveDisplayHour = (rawHour) => {
|
|
@@ -53,18 +52,18 @@ const TimePicker = ({ date, onChange, dateFormat, disabled = false }) => {
|
|
|
53
52
|
updateTime(hour, minute, newMeridiem);
|
|
54
53
|
};
|
|
55
54
|
const displayHour = is12HourFormat ? (hour % 12 === 0 ? 12 : hour % 12) : hour;
|
|
56
|
-
return (_jsxs(HStack, { spacing: 1.5, w: "100%", children: [_jsx(Select, { value: displayHour, onChange: handleHourChange, flex: "1", minW: 0, size: "sm", isDisabled: disabled, bg:
|
|
55
|
+
return (_jsxs(HStack, { spacing: 1.5, w: "100%", children: [_jsx(Select, { value: displayHour, onChange: handleHourChange, flex: "1", minW: 0, size: "sm", isDisabled: disabled, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], _focus: {
|
|
57
56
|
borderColor: theme.colors.primary[500],
|
|
58
|
-
boxShadow: `0 0 0 0.125rem ${
|
|
57
|
+
boxShadow: `0 0 0 0.125rem ${theme.colors.boxShadow.primary}`,
|
|
59
58
|
}, _hover: { borderColor: theme.colors.primary[500] }, children: Array.from({ length: is12HourFormat ? 12 : 24 }, (_, i) => {
|
|
60
59
|
const value = is12HourFormat ? i + 1 : i;
|
|
61
60
|
return (_jsx("option", { value: value, children: value.toString().padStart(2, "0") }, value));
|
|
62
|
-
}) }), _jsx(Select, { value: minute, onChange: handleMinuteChange, flex: "1", minW: 0, size: "sm", isDisabled: disabled, bg:
|
|
61
|
+
}) }), _jsx(Select, { value: minute, onChange: handleMinuteChange, flex: "1", minW: 0, size: "sm", isDisabled: disabled, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], _focus: {
|
|
63
62
|
borderColor: theme.colors.primary[500],
|
|
64
|
-
boxShadow: `0 0 0 0.125rem ${
|
|
65
|
-
}, _hover: { borderColor: theme.colors.primary[500] }, children: Array.from({ length: 60 }, (_, i) => (_jsx("option", { value: i, children: i.toString().padStart(2, "0") }, i))) }), is12HourFormat && (_jsxs(Select, { value: ampm, onChange: handleAmpmChange, flex: "1", minW: 0, size: "sm", isDisabled: disabled, bg:
|
|
63
|
+
boxShadow: `0 0 0 0.125rem ${theme.colors.boxShadow.primary}`,
|
|
64
|
+
}, _hover: { borderColor: theme.colors.primary[500] }, children: Array.from({ length: 60 }, (_, i) => (_jsx("option", { value: i, children: i.toString().padStart(2, "0") }, i))) }), is12HourFormat && (_jsxs(Select, { value: ampm, onChange: handleAmpmChange, flex: "1", minW: 0, size: "sm", isDisabled: disabled, bg: theme.colors.gray[50], borderColor: theme.colors.boxborder[500], _focus: {
|
|
66
65
|
borderColor: theme.colors.primary[500],
|
|
67
|
-
boxShadow: `0 0 0 0.125rem ${
|
|
66
|
+
boxShadow: `0 0 0 0.125rem ${theme.colors.boxShadow.primary}`,
|
|
68
67
|
}, _hover: { borderColor: theme.colors.primary[500] }, children: [_jsx("option", { value: "AM", children: "AM" }), _jsx("option", { value: "PM", children: "PM" })] }))] }));
|
|
69
68
|
};
|
|
70
69
|
export default TimePicker;
|
|
@@ -89,7 +89,6 @@ const caretFromDigitIndex = (digitIndex, digitsLen) => {
|
|
|
89
89
|
};
|
|
90
90
|
const formatToPlaceholder = (formatStr) => formatStr.replace(/h{1,2}/gi, "HH").replace(/m{1,2}/gi, "mm").replace(/a{1,2}/gi, "AM");
|
|
91
91
|
export const TimePickerInput = ({ value, onChange, dateFormat, disabled = false, placeholder, onFocus, onBlur, error, size = "md", }) => {
|
|
92
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
93
92
|
const theme = useCustomTheme();
|
|
94
93
|
const sizeKey = typeof size === "string" ? size : "md";
|
|
95
94
|
const iconPx = getTextInputIconSizePx(sizeKey);
|
|
@@ -401,12 +400,12 @@ export const TimePickerInput = ({ value, onChange, dateFormat, disabled = false,
|
|
|
401
400
|
inputRef.current.value = is12Hour && formatted ? `${formatted} ${ampm}` : formatted;
|
|
402
401
|
}
|
|
403
402
|
}, [digits, ampm, is12Hour]);
|
|
404
|
-
return (_jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref: inputRef, defaultValue: "", onChange: handleInput, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, onClick: handleClick, onPaste: handlePaste, placeholder: placeholderText, isDisabled: disabled, autoComplete: "off", isInvalid: error, size: sizeKey, bg:
|
|
405
|
-
borderColor: error ?
|
|
403
|
+
return (_jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref: inputRef, defaultValue: "", onChange: handleInput, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, onClick: handleClick, onPaste: handlePaste, placeholder: placeholderText, isDisabled: disabled, autoComplete: "off", isInvalid: error, size: sizeKey, bg: theme.colors.gray[50], borderColor: error ? theme.colors.semanticText.error : theme.colors.boxborder[500], _focus: {
|
|
404
|
+
borderColor: error ? theme.colors.semanticText.error : theme.colors.primary[500],
|
|
406
405
|
boxShadow: error
|
|
407
|
-
? `0 0 0 0.125rem ${
|
|
408
|
-
: `0 0 0 0.125rem ${
|
|
406
|
+
? `0 0 0 0.125rem ${theme.colors.boxShadow.error}`
|
|
407
|
+
: `0 0 0 0.125rem ${theme.colors.boxShadow.primary}`,
|
|
409
408
|
}, _hover: {
|
|
410
|
-
borderColor: error ?
|
|
411
|
-
} }), _jsx(InputRightElement, { pointerEvents: "none", height: "100%", display: "flex", alignItems: "center", children: _jsx(Box, { as: "span", sx: iconWrapperSx, children: _jsx(ClockIcon, { size: iconPx, color: theme.colors.
|
|
409
|
+
borderColor: error ? theme.colors.semanticText.error : theme.colors.primary[500],
|
|
410
|
+
} }), _jsx(InputRightElement, { pointerEvents: "none", height: "100%", display: "flex", alignItems: "center", children: _jsx(Box, { as: "span", sx: iconWrapperSx, children: _jsx(ClockIcon, { size: iconPx, color: theme.colors.textMuted }) }) })] }));
|
|
412
411
|
};
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Divider as ChakraDivider } from "@chakra-ui/react";
|
|
3
3
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
4
|
const VeritcalDivider = () => {
|
|
5
|
-
var _a;
|
|
6
5
|
const { colors } = useCustomTheme();
|
|
7
|
-
return (_jsx(ChakraDivider, { orientation: "vertical", height: 5, borderWidth: 1.2, borderColor:
|
|
6
|
+
return (_jsx(ChakraDivider, { orientation: "vertical", height: 5, borderWidth: 1.2, borderColor: colors.boxborder[500] }));
|
|
8
7
|
};
|
|
9
8
|
export default VeritcalDivider;
|
|
@@ -12,7 +12,6 @@ export const DrawerFooter = ({ children }) => {
|
|
|
12
12
|
return _jsx(_Fragment, { children: children });
|
|
13
13
|
};
|
|
14
14
|
export default function Drawer({ isOpen, onClose, placement = "right", size = "xl", id, variant = "solid", children, }) {
|
|
15
|
-
var _a;
|
|
16
15
|
const { colors } = useCustomTheme();
|
|
17
16
|
const isReactElement = (child) => {
|
|
18
17
|
return child !== null && typeof child === "object" && "type" in child;
|
|
@@ -20,5 +19,5 @@ export default function Drawer({ isOpen, onClose, placement = "right", size = "x
|
|
|
20
19
|
const header = React.Children.toArray(children).find((child) => isReactElement(child) && child.type === DrawerHeader);
|
|
21
20
|
const body = React.Children.toArray(children).find((child) => isReactElement(child) && child.type === DrawerBody);
|
|
22
21
|
const footer = React.Children.toArray(children).find((child) => isReactElement(child) && child.type === DrawerFooter);
|
|
23
|
-
return (_jsxs(ChakraDrawer, { isOpen: isOpen, placement: placement, onClose: onClose, size: size, variant: variant, id: id, children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerContent, { bg:
|
|
22
|
+
return (_jsxs(ChakraDrawer, { isOpen: isOpen, placement: placement, onClose: onClose, size: size, variant: variant, id: id, children: [_jsx(DrawerOverlay, {}), _jsxs(DrawerContent, { bg: colors.background[50], children: [_jsx(DrawerCloseButton, {}), header && (_jsx(ChakraDrawerHeader, { borderBottomWidth: "1px", children: header })), _jsx(ChakraDrawerBody, { children: body && body }), footer && _jsx(ChakraDrawerFooter, { borderTopWidth: "1px", children: footer })] })] }));
|
|
24
23
|
}
|
|
@@ -205,43 +205,39 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
205
205
|
};
|
|
206
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
207
|
const dropDownToggleOption = () => {
|
|
208
|
-
var _a, _b, _c, _d;
|
|
209
208
|
const ButtonToggle = (_jsx(Button, { ref: buttonTriggerRef, onClick: onToggle, onKeyDown: handleTriggerKeyDown, size: s.btn, colorScheme: "primary", borderRadius: "lg", 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:
|
|
209
|
+
const TextToggle = (_jsxs(Flex, { ref: textTriggerRef, onClick: onToggle, onKeyDown: handleTriggerKeyDown, align: "center", gap: 1.5, cursor: "pointer", fontSize: s.fontSize, fontWeight: 500, color: theme.colors.text[700], transition: "color 0.15s ease", _hover: { color: theme.colors.accentText }, 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
210
|
return dropdownType === "button" ? ButtonToggle : TextToggle;
|
|
212
211
|
};
|
|
213
212
|
const DropdownContentRender = () => {
|
|
214
|
-
var _a
|
|
215
|
-
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg:
|
|
213
|
+
var _a;
|
|
214
|
+
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: {
|
|
216
215
|
scrollbarWidth: "thin",
|
|
217
|
-
scrollbarColor: `${
|
|
216
|
+
scrollbarColor: `${theme.colors.gray[300]} transparent`,
|
|
218
217
|
"&::-webkit-scrollbar": { width: "6px" },
|
|
219
218
|
"&::-webkit-scrollbar-thumb": {
|
|
220
|
-
background:
|
|
219
|
+
background: theme.colors.gray[300],
|
|
221
220
|
borderRadius: "base",
|
|
222
221
|
},
|
|
223
222
|
"&::-webkit-scrollbar-thumb:hover": {
|
|
224
|
-
background:
|
|
223
|
+
background: theme.colors.gray[400],
|
|
225
224
|
},
|
|
226
|
-
}, style: ListStyle, children: options.map((option, index) => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
// fontWeight={400}
|
|
243
|
-
style: LabelStyle, children: option.label })] }, option.id));
|
|
244
|
-
}) }));
|
|
225
|
+
}, style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
|
|
226
|
+
itemRefs.current[index] = node;
|
|
227
|
+
}, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
|
|
228
|
+
handleListItemClick(option.id, option.label);
|
|
229
|
+
focusTrigger();
|
|
230
|
+
}, onKeyDown: (e) => handleItemKeyDown(e, option.id, option.label), mx: 1.5, px: s.px, py: s.py, borderRadius: "md", display: "flex", alignItems: "center", gap: 2, cursor: "pointer", color: theme.colors.text[700], transition: "background 0.12s ease, color 0.12s ease", _hover: {
|
|
231
|
+
bg: theme.colors.primary.opacity[8],
|
|
232
|
+
color: theme.colors.accentText,
|
|
233
|
+
}, _focus: {
|
|
234
|
+
bg: theme.colors.primary.opacity[8],
|
|
235
|
+
color: theme.colors.accentText,
|
|
236
|
+
}, borderBottom: divider
|
|
237
|
+
? `0.063rem solid ${theme.colors.boxborder[100]}`
|
|
238
|
+
: 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: theme.colors.textMuted, style: ImageStyle })), _jsx(Box, { as: "span", fontSize: s.fontSize, isTruncated: true,
|
|
239
|
+
// fontWeight={400}
|
|
240
|
+
style: LabelStyle, children: option.label })] }, option.id))) }));
|
|
245
241
|
};
|
|
246
242
|
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
243
|
});
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { Suspense, useMemo, useState } from "react";
|
|
3
3
|
import { Box } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isDarkCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
6
6
|
import { getJoditThemeVars } from "./joditThemeVars.js";
|
|
7
7
|
// Loaded on render, not on import: jodit-react's browser bundle touches `self` at module
|
|
8
8
|
// scope, which crashes any Node/SSR consumer importing this package's barrel.
|
|
@@ -20,25 +20,22 @@ const Editor = React.memo(function Editor({ value, key, config, editorRef, class
|
|
|
20
20
|
// even in dark mode. Pointing Jodit's own `popupRoot` config at this wrapper keeps popups
|
|
21
21
|
// inside the subtree those variables cascade into.
|
|
22
22
|
const [popupRoot, setPopupRoot] = useState(null);
|
|
23
|
-
const stableConfig = useMemo(() => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...config,
|
|
33
|
-
});
|
|
34
|
-
},
|
|
23
|
+
const stableConfig = useMemo(() => ({
|
|
24
|
+
theme: isDarkCanvas(theme.colors.backgroundColor.main) ? "dark" : "default",
|
|
25
|
+
popupRoot,
|
|
26
|
+
// `config` spread as `Record<string, unknown>`: mixing a literal `popupRoot` key with a
|
|
27
|
+
// spread of the raw `DeepPartial<Config>` type (Jodit's huge recursive config type) blows
|
|
28
|
+
// past TS's type-instantiation depth limit (TS2589) — the cast avoids that without
|
|
29
|
+
// weakening the memo's actual return type, which is still asserted below.
|
|
30
|
+
...config,
|
|
31
|
+
}),
|
|
35
32
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
33
|
[JSON.stringify(config), theme, popupRoot]);
|
|
37
34
|
// Jodit's own `theme: "dark"|"default"` only switches which of ITS selectors apply — those
|
|
38
35
|
// are still driven by Jodit's hardcoded gray/blue CSS variables, not this app's palette. This
|
|
39
36
|
// feeds our actual active colors into those variables, scoped to this instance (see
|
|
40
37
|
// `joditThemeVars.ts`).
|
|
41
|
-
const themeVars = useMemo(() =>
|
|
38
|
+
const themeVars = useMemo(() => getJoditThemeVars(theme.colors, isDarkCanvas(theme.colors.backgroundColor.main)), [theme]);
|
|
42
39
|
return (_jsx(Box, { ref: setPopupRoot, sx: themeVars, children: _jsx(Suspense, { fallback: null, children: _jsx(JoditEditor, { config: stableConfig, value: value, ref: editorRef, className: className, onChange: onChange, onBlur: onBlur }, key) }) }));
|
|
43
40
|
});
|
|
44
41
|
export default Editor;
|
|
@@ -4,12 +4,12 @@ import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
|
4
4
|
import { MailCheck } from "lucide-react";
|
|
5
5
|
export default function VerifyEmailOtp({ resendMail, onChange, onComplete, placeholder = "", pins = 5, description, title, isDisabled = false, isInvalid = false, styles, }) {
|
|
6
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.
|
|
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.accentText }) }), _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
8
|
// [800], not [300]: WCAG 1.4.11 needs >=3.0 for a control boundary against any
|
|
9
9
|
// named surface up to `muted` (lightest); [300] fails there, [800] clears all
|
|
10
10
|
// with margin.
|
|
11
11
|
borderColor: theme.colors.boxborder[800], backgroundColor: theme.colors.background[200], _focus: {
|
|
12
12
|
borderColor: theme.colors.primary[500],
|
|
13
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.
|
|
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.accentText, fontWeight: "semibold", onClick: resendMail, children: "Resend Code" })] }) })] }));
|
|
15
15
|
}
|
|
@@ -12,29 +12,29 @@ const sizeMap = {
|
|
|
12
12
|
md: { badge: "72px", icon: 30, title: "1.1rem", desc: "0.9rem", gap: 3, pad: 10 },
|
|
13
13
|
lg: { badge: "96px", icon: 40, title: "1.35rem", desc: "1rem", gap: 4, pad: 14 },
|
|
14
14
|
};
|
|
15
|
+
const scaleFor = (colors, scheme) => scheme === "primary" || scheme === "secondary" || scheme === "tertiary"
|
|
16
|
+
? colors[scheme]
|
|
17
|
+
: scheme === "gray"
|
|
18
|
+
? colors.gray
|
|
19
|
+
: colors.semantic[scheme];
|
|
15
20
|
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
21
|
const theme = useCustomTheme();
|
|
18
22
|
const s = sizeMap[size];
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
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];
|
|
23
|
+
const palette = scaleFor(theme.colors, colorScheme);
|
|
24
|
+
const accent = palette[500];
|
|
25
|
+
const accentSoft = palette[50];
|
|
26
26
|
const containerStyles = variant === "subtle"
|
|
27
|
-
? { bg:
|
|
27
|
+
? { bg: theme.colors.gray[50], borderRadius: "2xl" }
|
|
28
28
|
: variant === "dashed"
|
|
29
29
|
? {
|
|
30
30
|
border: "2px dashed",
|
|
31
|
-
borderColor:
|
|
31
|
+
borderColor: theme.colors.gray[200],
|
|
32
32
|
borderRadius: "2xl",
|
|
33
33
|
bg: "transparent",
|
|
34
34
|
}
|
|
35
35
|
: {};
|
|
36
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
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:
|
|
38
|
+
}, children: _jsx(IconComp, { size: s.icon, strokeWidth: 1.75 }) })), _jsxs(Box, { children: [_jsx(Text, { fontSize: s.title, fontWeight: 600, color: theme.colors.gray[800], mt: 1, children: title }), description && (_jsx(Text, { fontSize: s.desc, color: theme.colors.gray[500], mt: 1, maxW: "380px", children: description }))] }), action && (_jsx(Flex, { gap: 3, mt: 2, wrap: "wrap", justify: "center", children: action }))] }));
|
|
39
39
|
};
|
|
40
40
|
export default EmptyState;
|
|
@@ -28,6 +28,6 @@ const FieldSelectModal = ({ isOpen, onClose, fields, onConfirm, title = "Select
|
|
|
28
28
|
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, size: "xl", isCentered: true, children: [_jsx(ModalOverlay, { bg: "blackAlpha.400", backdropFilter: "blur(4px)" }), _jsxs(MotionModalContent, { borderRadius: "2xl", overflow: "hidden", maxH: "85vh",
|
|
29
29
|
// Chakra's default dialog bg (`colors.white`, or `gray.700` under `_dark`) resolves to a
|
|
30
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.
|
|
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.textMuted, 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.textMuted }) }), _jsx(Input, { placeholder: "Search fields", value: query, onChange: (e) => setQuery(e.target.value), borderRadius: "lg" })] }))] }), _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.textMuted, 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
32
|
};
|
|
33
33
|
export default FieldSelectModal;
|
|
@@ -56,7 +56,7 @@ export const FilePreview = ({ isOpen, onClose, fileUrl, fileName, fileType, hide
|
|
|
56
56
|
if (kind === "video") {
|
|
57
57
|
return (_jsx(Box, { as: "video", src: fileUrl, controls: true, width: "100%", borderRadius: "lg" }));
|
|
58
58
|
}
|
|
59
|
-
return (_jsxs(Flex, { direction: "column", align: "center", justify: "center", py: 12, gap: 3, children: [_jsx(FileQuestion, { size: 48, color: theme.colors.
|
|
59
|
+
return (_jsxs(Flex, { direction: "column", align: "center", justify: "center", py: 12, gap: 3, children: [_jsx(FileQuestion, { size: 48, color: theme.colors.textMuted }), _jsx(Text, { color: theme.colors.textMuted, fontSize: "sm", children: "Preview isn't available for this file type." }), !hideDownload && (_jsxs(Flex, { as: "button", align: "center", gap: 2, px: 4, py: 2, borderRadius: "lg", bg: theme.colors.primary[500], color: theme.colors.onPrimary, fontSize: "sm", fontWeight: 500, onClick: () => downloadFile(fileUrl, fileName), children: [_jsx(Download, { size: 16 }), " Download file"] }))] }));
|
|
60
60
|
};
|
|
61
61
|
return (_jsxs(Modal, { isOpen: isOpen, onClose: handleClose, size: size, isCentered: true, children: [_jsx(ModalOverlay, { bg: "blackAlpha.600", backdropFilter: "blur(4px)" }), _jsxs(MotionContent
|
|
62
62
|
// Chakra's default Modal drives its bg off `--modal-bg`, which flips to
|
|
@@ -64,7 +64,7 @@ export const FilePreview = ({ isOpen, onClose, fileUrl, fileName, fileType, hide
|
|
|
64
64
|
, {
|
|
65
65
|
// Chakra's default Modal drives its bg off `--modal-bg`, which flips to
|
|
66
66
|
// `colors.gray.700` under `_dark` — a light grey in our derived dark palettes.
|
|
67
|
-
bg: theme.colors.background[50], borderRadius: "2xl", overflow: "hidden", initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 3, borderBottom: "1px solid", borderColor: theme.colors.
|
|
67
|
+
bg: theme.colors.background[50], borderRadius: "2xl", overflow: "hidden", initial: { opacity: 0, scale: 0.96, y: 8 }, animate: { opacity: 1, scale: 1, y: 0 }, transition: { duration: 0.2, ease: "easeOut" }, children: [_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 3, borderBottom: "1px solid", borderColor: theme.colors.boxborder[100], children: [_jsx(ToolTip, { label: fileName || "File", placement: "bottom", children: _jsx(Text, { fontSize: "sm", fontWeight: 600, maxW: "60%", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName || "Preview" }) }), _jsxs(Flex, { align: "center", gap: 1, children: [kind === "image" && (_jsxs(_Fragment, { children: [_jsx(ToolTip, { label: "Zoom out", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom out", size: "sm", variant: "ghost", icon: _jsx(Minus, { size: 16 }), onClick: () => setZoom((z) => Math.max(0.25, z - 0.25)) }) }), _jsx(ToolTip, { label: "Zoom in", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Zoom in", size: "sm", variant: "ghost", icon: _jsx(Plus, { size: 16 }), onClick: () => setZoom((z) => Math.min(4, z + 0.25)) }) }), _jsx(ToolTip, { label: "Rotate", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Rotate", size: "sm", variant: "ghost", icon: _jsx(RotateCw, { size: 16 }), onClick: () => setRotation((r) => (r + 90) % 360) }) })] })), !hideDownload && (_jsx(ToolTip, { label: "Download", placement: "bottom", children: _jsx(IconButton, { "aria-label": "Download", size: "sm", variant: "ghost", color: theme.colors.semanticText.success, icon: _jsx(Download, { size: 18 }), onClick: () => downloadFile(fileUrl, fileName) }) })), _jsx(ModalCloseButton, { position: "static" })] })] }), _jsx(ModalBody, { p: 5, children: renderBody() })] })] }));
|
|
68
68
|
};
|
|
69
69
|
/** Thumbnail with a hover "preview" affordance that opens {@link FilePreview}. */
|
|
70
70
|
export const FilePreviewTrigger = ({ fileUrl, fileName, fileType, thumbWidth = "100px", thumbHeight = "60px", hideDownload = false, }) => {
|
|
@@ -4,17 +4,17 @@ import { Box, Text, VStack, Icon, List, ListItem, ListIcon, CloseButton, HStack,
|
|
|
4
4
|
import { useDropzone } from "react-dropzone";
|
|
5
5
|
import { Upload, FileText, Eye } from "lucide-react";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
|
+
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
7
8
|
import { mimeMap, toMB } from "./constants.js";
|
|
8
9
|
import Modal, { ModalBody, ModalHeader } from "../Modal/Modal.js";
|
|
9
10
|
const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes = [".jpg", ".png"], maxSizeKB = 5, maxFiles = undefined, progress = {}, }) => {
|
|
10
|
-
var _a, _b, _c, _d;
|
|
11
11
|
const { colors, radii } = useCustomTheme();
|
|
12
12
|
const { isOpen, onOpen, onClose } = useDisclosure();
|
|
13
13
|
const [previewUrl, setPreviewUrl] = React.useState(null);
|
|
14
14
|
const [previewTitle, setPreviewTitle] = React.useState(null);
|
|
15
15
|
const [errors, setErrors] = React.useState([]);
|
|
16
|
-
const bg =
|
|
17
|
-
const border =
|
|
16
|
+
const bg = colors.gray[50];
|
|
17
|
+
const border = colors.boxborder[500];
|
|
18
18
|
const mappedAccept = acceptTypes.reduce((acc, ext) => {
|
|
19
19
|
const mime = mimeMap[ext];
|
|
20
20
|
if (mime) {
|
|
@@ -53,27 +53,21 @@ const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes
|
|
|
53
53
|
setErrors(messages);
|
|
54
54
|
},
|
|
55
55
|
});
|
|
56
|
-
return (_jsxs(_Fragment, { children: [_jsxs(VStack, { spacing: 4, align: "stretch", children: [_jsxs(Box, { ...getRootProps(), border: "2px dashed", borderColor: border, borderRadius: "md", p: 10, textAlign: "center", bg: bg, cursor: "pointer", transition: "all 0.2s", _hover: { bg:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
width: "100%",
|
|
72
|
-
height: "100%",
|
|
73
|
-
objectFit: "cover",
|
|
74
|
-
borderRadius: radii.base,
|
|
75
|
-
} }), _jsx(Box, { className: "hover-icon", position: "absolute", top: "0.5rem", left: "0.5rem", opacity: 0, children: _jsx(Eye, { color: (_d = colors === null || colors === void 0 ? void 0 : colors.background) === null || _d === void 0 ? void 0 : _d[100] }) })] })) : (_jsx(ListIcon, { as: FileText, color: (_e = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _e === void 0 ? void 0 : _e[500], boxSize: 8 })), _jsxs(VStack, { align: "start", spacing: 0, flex: "1", children: [_jsx(Text, { fontSize: "sm", noOfLines: 1, children: file.name }), _jsxs(Text, { fontSize: "xs", color: (_f = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _f === void 0 ? void 0 : _f[500], children: [toMB(file.size / 1024), " \u2022", " ", file.type || "Unknown type"] })] })] }), onRemoveFile && (_jsx(CloseButton, { onClick: () => onRemoveFile(file), size: "sm", color: (_g = colors === null || colors === void 0 ? void 0 : colors.red) === null || _g === void 0 ? void 0 : _g[600] }))] }), (progress === null || progress === void 0 ? void 0 : progress[file.name]) !== undefined && (_jsx(Progress, { value: progress === null || progress === void 0 ? void 0 : progress[file.name], size: "xs", mt: 1, hasStripe: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, isAnimated: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, colorScheme: (progress === null || progress === void 0 ? void 0 : progress[file.name]) >= 100 ? "green" : "blue", borderRadius: "md" }))] }, index));
|
|
76
|
-
}) })] }))] }), _jsxs(Modal, { isOpen: isOpen, onClose: () => {
|
|
56
|
+
return (_jsxs(_Fragment, { children: [_jsxs(VStack, { spacing: 4, align: "stretch", children: [_jsxs(Box, { ...getRootProps(), border: "2px dashed", borderColor: border, borderRadius: "md", p: 10, textAlign: "center", bg: bg, cursor: "pointer", transition: "all 0.2s", _hover: { bg: colors.gray[100] }, position: "relative", children: [_jsx("input", { ...getInputProps() }), _jsxs(VStack, { spacing: 2, children: [_jsx(Icon, { as: Upload, boxSize: 6 }), _jsx(Text, { fontWeight: "medium", children: "Drag and drop files here" }), _jsxs(Text, { fontSize: "sm", color: colors.textMuted, children: [acceptTypes.join(", "), " up to ", toMB(maxSizeKB), " ", maxFiles ? `- ${maxFiles} file(s) max` : ""] })] })] }), errors.length > 0 && (_jsx(Box, { children: errors.map((err, idx) => (_jsx(Text, { fontSize: "sm", color: colors.semanticText.error, children: err }, idx))) })), uploadedFiles.length > 0 && (_jsxs(Box, { children: [_jsx(Box, { display: "flex", alignItems: "center", gap: 2, children: _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: 14, lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: "Uploaded Files" }) }), _jsx(List, { spacing: 2, children: uploadedFiles.map((file, index) => (_jsxs(Box, { borderWidth: "0.063rem", borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [_jsxs(ListItem, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(HStack, { spacing: 3, flex: "1", children: [file.type.startsWith("image/") ? (_jsxs(Box, { boxSize: "2.5rem", cursor: "pointer", position: "relative", _hover: {
|
|
57
|
+
".hover-icon": {
|
|
58
|
+
opacity: 1,
|
|
59
|
+
bg: colors.secondary.opacity[16],
|
|
60
|
+
},
|
|
61
|
+
}, onClick: () => {
|
|
62
|
+
setPreviewUrl(URL.createObjectURL(file));
|
|
63
|
+
setPreviewTitle(file.name);
|
|
64
|
+
onOpen();
|
|
65
|
+
}, children: [_jsx("img", { src: URL.createObjectURL(file), alt: file.name, style: {
|
|
66
|
+
width: "100%",
|
|
67
|
+
height: "100%",
|
|
68
|
+
objectFit: "cover",
|
|
69
|
+
borderRadius: radii.base,
|
|
70
|
+
} }), _jsx(Box, { className: "hover-icon", position: "absolute", top: "0.5rem", left: "0.5rem", opacity: 0, children: _jsx(Eye, { color: colors.background[100] }) })] })) : (_jsx(ListIcon, { as: FileText, color: accentTextOnCanvas(colors.blue, colors.background[50]), boxSize: 8 })), _jsxs(VStack, { align: "start", spacing: 0, flex: "1", children: [_jsx(Text, { fontSize: "sm", noOfLines: 1, children: file.name }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: [toMB(file.size / 1024), " \u2022", " ", file.type || "Unknown type"] })] })] }), onRemoveFile && (_jsx(CloseButton, { onClick: () => onRemoveFile(file), size: "sm", color: colors.semanticText.error }))] }), (progress === null || progress === void 0 ? void 0 : progress[file.name]) !== undefined && (_jsx(Progress, { value: progress === null || progress === void 0 ? void 0 : progress[file.name], size: "xs", mt: 1, hasStripe: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, isAnimated: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, colorScheme: (progress === null || progress === void 0 ? void 0 : progress[file.name]) >= 100 ? "green" : "blue", borderRadius: "md" }))] }, index))) })] }))] }), _jsxs(Modal, { isOpen: isOpen, onClose: () => {
|
|
77
71
|
onClose();
|
|
78
72
|
setPreviewUrl(null);
|
|
79
73
|
setPreviewTitle(null);
|
|
@@ -4,12 +4,11 @@ import { Box, Text, Grid, Flex, HStack, Image, IconButton, Tooltip, } from "@cha
|
|
|
4
4
|
import { X } from "lucide-react";
|
|
5
5
|
import { useToaster } from "../Toaster/Toaster.js";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
|
-
import {
|
|
7
|
+
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
8
8
|
const FileUploader = ({ maxFiles = 10, maxTotalSize = 20, onFilesChange, acceptTypes = ["jpeg", "jpg", "png"], }) => {
|
|
9
|
-
var _a, _b;
|
|
10
9
|
const { showToast } = useToaster();
|
|
11
10
|
const { colors } = useCustomTheme();
|
|
12
|
-
const accentColor = accentTextOnCanvas(colors.blue,
|
|
11
|
+
const accentColor = accentTextOnCanvas(colors.blue, colors.backgroundColor.main);
|
|
13
12
|
const [uploadedFiles, setUploadedFiles] = useState([]);
|
|
14
13
|
const [, setIsDragOver] = useState(false);
|
|
15
14
|
// const [error, setError] = useState<string | null>(null);
|
|
@@ -70,9 +69,9 @@ const FileUploader = ({ maxFiles = 10, maxTotalSize = 20, onFilesChange, acceptT
|
|
|
70
69
|
const handleBrowseClick = () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); };
|
|
71
70
|
// ✅ Convert ["png","pdf","zip"] → ".png,.pdf,.zip" for input accept
|
|
72
71
|
const acceptString = acceptTypes.map((ext) => `.${ext}`).join(",");
|
|
73
|
-
return (_jsxs(Box, { maxW: "500px", mx: "auto", p: 6, children: [_jsxs(Text, { fontSize: "sm", color:
|
|
74
|
-
var _a
|
|
75
|
-
return (_jsxs(Flex, { align: "center", justify: "space-between", border: "1px solid", borderColor:
|
|
76
|
-
}) }) })), _jsx("input", { ref: fileInputRef, type: "file", multiple: true, accept: acceptString, onChange: handleFileInput, style: { display: "none" } }), _jsxs(Box, { p: uploadedFiles.length ? 0 : 5, mb: 2, textAlign: uploadedFiles.length ? "left" : "center", pt: uploadedFiles.length ? 5 : 5, transition: "all 0.2s", onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, cursor: "pointer", onClick: handleBrowseClick, children: [_jsx(Box, { children: _jsxs(Text, { fontWeight: "medium", fontSize: "md", children: ["Drag and drop the files here, or", _jsx(Box, { as: "span", color: accentColor, ml: 1, children: "Click here" })] }) }), _jsxs(Text, { fontSize: "xs", color:
|
|
72
|
+
return (_jsxs(Box, { maxW: "500px", mx: "auto", p: 6, children: [_jsxs(Text, { fontSize: "sm", color: colors.textMuted, mb: 4, children: ["Files Uploaded:", " ", _jsxs(Text, { as: "span", fontWeight: "medium", color: accentColor, children: [uploadedFiles.length, " / ", maxFiles] }), " ", "| Total size:", " ", _jsxs(Text, { as: "span", fontWeight: "medium", children: [formatFileSize(totalSize), " / ", maxTotalSize, " MB"] })] }), _jsxs(Box, { border: "1px dashed", borderColor: colors.boxborder[500], borderRadius: "md", p: 1, mt: 1, mb: 1, children: [uploadedFiles.length > 0 && (_jsx(Box, { children: _jsx(Grid, { templateColumns: "repeat(2, 1fr)", gap: 3, children: uploadedFiles.map((file) => {
|
|
73
|
+
var _a;
|
|
74
|
+
return (_jsxs(Flex, { align: "center", justify: "space-between", border: "1px solid", borderColor: colors.boxborder[500], borderRadius: "md", pl: 1, bg: colors.backgroundColor.secondary, children: [_jsxs(HStack, { spacing: 3, flex: "1", minW: "0", children: [file.previewUrl ? (_jsx(Image, { src: file.previewUrl, alt: file.name, boxSize: "28px", borderRadius: "sm", objectFit: "cover" })) : (_jsx(Box, { boxSize: "28px", borderRadius: "sm", bg: colors.gray[200], display: "flex", alignItems: "center", justifyContent: "center", fontSize: "xs", color: colors.textMuted, children: (_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toUpperCase() })), _jsxs(Box, { minW: "0", children: [_jsx(Text, { fontSize: "sm", fontWeight: "medium", noOfLines: 1, children: file.name }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: ["(", formatFileSize(file.size), ")"] })] })] }), _jsx(HStack, { spacing: 1, children: _jsx(Tooltip, { label: "Remove", children: _jsx(IconButton, { "aria-label": "Remove", icon: _jsx(X, { size: 14 }), size: "xs", variant: "ghost", colorScheme: "red", onClick: () => removeFile(file.id) }) }) })] }, file.id));
|
|
75
|
+
}) }) })), _jsx("input", { ref: fileInputRef, type: "file", multiple: true, accept: acceptString, onChange: handleFileInput, style: { display: "none" } }), _jsxs(Box, { p: uploadedFiles.length ? 0 : 5, mb: 2, textAlign: uploadedFiles.length ? "left" : "center", pt: uploadedFiles.length ? 5 : 5, transition: "all 0.2s", onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, cursor: "pointer", onClick: handleBrowseClick, children: [_jsx(Box, { children: _jsxs(Text, { fontWeight: "medium", fontSize: "md", children: ["Drag and drop the files here, or", _jsx(Box, { as: "span", color: accentColor, ml: 1, children: "Click here" })] }) }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: ["Supported formats: ", acceptTypes.map((t) => t.toUpperCase()).join(", "), "."] })] })] })] }));
|
|
77
76
|
};
|
|
78
77
|
export default FileUploader;
|