pixelize-design-library 2.4.2-beta.0 → 2.4.2-beta.10
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 +7 -12
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +12 -13
- package/dist/Components/Checkbox/Checkbox.js +1 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
- 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 +3 -4
- 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 +19 -33
- package/dist/Components/Editor/Editor.js +10 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +3 -3
- 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 +15 -16
- package/dist/Components/InputTextArea/InputTextArea.d.ts +1 -1
- package/dist/Components/InputTextArea/InputTextArea.style.js +14 -14
- 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 +15 -62
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +5 -18
- 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 +7 -9
- package/dist/Components/Notification/Notification.js +17 -15
- package/dist/Components/NumberInput/NumberInput.styles.js +14 -14
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +7 -8
- 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/PinInput/PinInput.js +1 -1
- package/dist/Components/PinInputs/PinInputs.js +7 -14
- package/dist/Components/PlanPill/PlanPill.js +8 -11
- package/dist/Components/PlanPill/planPillGradient.d.ts +21 -14
- package/dist/Components/PlanPill/planPillGradient.js +33 -16
- 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/RadioButton/RadioButton.js +1 -1
- 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/ScrollbarBox/ScrollbarBox.d.ts +13 -0
- package/dist/Components/ScrollbarBox/ScrollbarBox.js +11 -0
- package/dist/Components/SearchSelect/SearchSelect.js +26 -28
- package/dist/Components/Select/Select.styles.js +34 -37
- package/dist/Components/SelectSearch/SelectSearch.js +10 -10
- package/dist/Components/SelectV2/SelectV2.js +8 -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/StageProgress.js +2 -9
- package/dist/Components/StageProgress/StageProgressProps.js +9 -13
- package/dist/Components/Table/Table.js +19 -30
- 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 -24
- 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 +4 -18
- package/dist/Components/Table/settings/TableSettings.js +13 -21
- 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 +4 -6
- 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/Constants/Sidebar.js +3 -2
- 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/Menu.styles.d.ts +9 -6
- package/dist/Theme/chakra/Menu.styles.js +11 -5
- 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 +9 -6
- package/dist/Theme/chakra/Popover.styles.js +11 -6
- package/dist/Theme/chakra/Slider.styles.d.ts +1 -1
- package/dist/Theme/chakra/Slider.styles.js +7 -9
- package/dist/Theme/chakra/Switch.styles.d.ts +1 -1
- package/dist/Theme/chakra/Switch.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 +69 -30
- package/dist/Theme/chakra/componentStyles.js +52 -43
- package/dist/Theme/chakra/createBrandTheme.js +3 -16
- package/dist/Theme/chakra/paletteFromTheme.d.ts +10 -0
- package/dist/Theme/chakra/paletteFromTheme.js +14 -0
- package/dist/Theme/provider/PixelizeThemeProvider.js +23 -20
- package/dist/Theme/provider/ThemeSwitcher.js +13 -20
- 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 +5 -116
- 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 +7 -13
- 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/chartColorsFromTheme.js +1 -1
- package/dist/Theme/tokens/builders/gradientInk.d.ts +22 -0
- package/dist/Theme/tokens/builders/gradientInk.js +28 -0
- package/dist/Theme/tokens/builders/index.d.ts +3 -0
- package/dist/Theme/tokens/builders/index.js +3 -0
- 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 +39 -9
- package/dist/Theme/tokens/builders/outlineRung.js +92 -21
- package/dist/Theme/tokens/builders/placeholderInk.d.ts +19 -0
- package/dist/Theme/tokens/builders/placeholderInk.js +35 -0
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +11 -0
- package/dist/Theme/tokens/builders/resolvedRungs.js +30 -0
- package/dist/Theme/tokens/builders/scrollbar.d.ts +12 -0
- package/dist/Theme/tokens/builders/scrollbar.js +57 -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 +10 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +54 -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 +8 -13
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +12 -13
- package/dist/esm/Components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/Components/Checkbox/Checkbox.styles.js +2 -0
- 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 +3 -4
- 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 +19 -33
- package/dist/esm/Components/Editor/Editor.js +11 -14
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +3 -3
- 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 +15 -16
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +14 -14
- 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 +15 -62
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +5 -18
- 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 +7 -9
- package/dist/esm/Components/Notification/Notification.js +18 -16
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +14 -14
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +8 -9
- 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/PinInput/PinInput.js +1 -1
- package/dist/esm/Components/PinInputs/PinInputs.js +8 -15
- package/dist/esm/Components/PlanPill/PlanPill.js +9 -12
- package/dist/esm/Components/PlanPill/planPillGradient.js +27 -15
- 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/RadioButton/RadioButton.js +1 -1
- 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/ScrollbarBox/ScrollbarBox.js +9 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +26 -28
- package/dist/esm/Components/Select/Select.styles.js +34 -37
- package/dist/esm/Components/SelectSearch/SelectSearch.js +10 -10
- package/dist/esm/Components/SelectV2/SelectV2.js +8 -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/StageProgress.js +2 -9
- package/dist/esm/Components/StageProgress/StageProgressProps.js +9 -13
- package/dist/esm/Components/Table/Table.js +19 -30
- 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 -24
- 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 +4 -18
- package/dist/esm/Components/Table/settings/TableSettings.js +13 -21
- 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 +4 -6
- 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/Constants/Sidebar.js +3 -2
- 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/Menu.styles.js +11 -5
- package/dist/esm/Theme/chakra/Modal.styles.js +8 -10
- package/dist/esm/Theme/chakra/Popover.styles.js +11 -6
- package/dist/esm/Theme/chakra/Slider.styles.js +7 -9
- package/dist/esm/Theme/chakra/Switch.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/createBrandTheme.js +3 -16
- package/dist/esm/Theme/chakra/paletteFromTheme.js +9 -0
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +23 -20
- package/dist/esm/Theme/provider/ThemeSwitcher.js +13 -20
- 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 +5 -116
- 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 +7 -10
- 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/chartColorsFromTheme.js +1 -1
- package/dist/esm/Theme/tokens/builders/gradientInk.js +22 -0
- package/dist/esm/Theme/tokens/builders/index.js +3 -0
- package/dist/esm/Theme/tokens/builders/mutedText.js +5 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +89 -21
- package/dist/esm/Theme/tokens/builders/placeholderInk.js +29 -0
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +25 -0
- package/dist/esm/Theme/tokens/builders/scrollbar.js +52 -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 +48 -0
- package/dist/esm/Theme/useCustomTheme.js +4 -1
- package/dist/esm/Utils/table.js +28 -36
- package/dist/esm/index.js +6 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +24 -3
- package/package.json +4 -2
|
@@ -3,6 +3,8 @@ import { useMemo, useState } from "react";
|
|
|
3
3
|
import { Avatar, Badge, Box, Flex, Heading, HStack, IconButton, Input, Skeleton, SkeletonText, Spinner, Text, Tooltip, VStack, } from "@chakra-ui/react";
|
|
4
4
|
import { ArrowLeft, Building2, Check, CheckCircle2, Crown, Globe, Mail, Pencil, Plus, Trash2, Users, X, } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
+
import { accentTextOnCanvas, isDarkCanvas, onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
7
|
+
import { resolveStatusTone } from "../../Theme/tokens/builders/statusTone.js";
|
|
6
8
|
import Button from "../Button/Button.js";
|
|
7
9
|
import EmptyState from "../EmptyState/EmptyState.js";
|
|
8
10
|
import Tag from "../Tag/Tag.js";
|
|
@@ -46,7 +48,6 @@ const DEFAULT_LABELS = {
|
|
|
46
48
|
termsOfService: "Terms of Service",
|
|
47
49
|
};
|
|
48
50
|
const OrganizationDetails = ({ activeOrganizations, invitedOrganizations, isLoading = false, switchingOrgIds = [], respondingOrgIds = [], editingOrgIds = [], isCreating = false, userName, userAvatarUrl, onSetDefault, onAcceptInvite, onDeclineInvite, onDeleteOrganization, onDeleteRequest, onCreateOrganization, onEditOrganization, onBack, footerSlot, labels: labelOverrides, }) => {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
50
51
|
const { colors } = useCustomTheme();
|
|
51
52
|
const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides]);
|
|
52
53
|
const [isCreateOpen, setCreateOpen] = useState(false);
|
|
@@ -55,16 +56,19 @@ const OrganizationDetails = ({ activeOrganizations, invitedOrganizations, isLoad
|
|
|
55
56
|
const [editingOrgId, setEditingOrgId] = useState(null);
|
|
56
57
|
const [editValue, setEditValue] = useState("");
|
|
57
58
|
const [editError, setEditError] = useState("");
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
59
|
+
const mode = isDarkCanvas(colors.backgroundColor.main) ? "dark" : "light";
|
|
60
|
+
const errorTone = resolveStatusTone(colors.semantic.error, mode);
|
|
61
|
+
const warningTone = resolveStatusTone(colors.semantic.warning, mode);
|
|
62
|
+
const border = colors.boxborder[200];
|
|
63
|
+
const surface = colors.background[50];
|
|
64
|
+
const muted = colors.textMuted;
|
|
65
|
+
const subtle = colors.text[600];
|
|
66
|
+
const heading = colors.text[900];
|
|
67
|
+
const pageBg = colors.backgroundColor.main;
|
|
68
|
+
const primary50 = colors.primary[50];
|
|
69
|
+
const primary100 = colors.primary[100];
|
|
70
|
+
const primary500 = colors.primary[500];
|
|
71
|
+
const onPrimary50 = accentTextOnCanvas(colors.primary, colors.primary[50]);
|
|
68
72
|
const cardSx = {
|
|
69
73
|
backgroundColor: surface,
|
|
70
74
|
borderRadius: "xl",
|
|
@@ -99,7 +103,7 @@ const OrganizationDetails = ({ activeOrganizations, invitedOrganizations, isLoad
|
|
|
99
103
|
setEditError("");
|
|
100
104
|
};
|
|
101
105
|
const renderActiveCard = (item) => {
|
|
102
|
-
var _a, _b, _c, _d
|
|
106
|
+
var _a, _b, _c, _d;
|
|
103
107
|
const isSwitching = switchingOrgIds.includes(item.orgId);
|
|
104
108
|
// Role name is a display value, not a permission — apps pass the real rule.
|
|
105
109
|
const canEdit = (_a = item.canRename) !== null && _a !== void 0 ? _a : item.roleName === "Super Admin";
|
|
@@ -109,17 +113,17 @@ const OrganizationDetails = ({ activeOrganizations, invitedOrganizations, isLoad
|
|
|
109
113
|
const isSavingThis = editingOrgIds.includes(item.orgId);
|
|
110
114
|
const roleLabel = (_c = item.roleName) === null || _c === void 0 ? void 0 : _c.trim();
|
|
111
115
|
const deleteButton = (_jsx(IconButton, { "aria-label": labels.deleteOrganization, icon: _jsx(Trash2, { size: 12 }), size: "xs", variant: "ghost", borderRadius: "full", color: muted, isDisabled: isProtected, _hover: {
|
|
112
|
-
bg:
|
|
113
|
-
color:
|
|
116
|
+
bg: errorTone.bg,
|
|
117
|
+
color: errorTone.fg,
|
|
114
118
|
}, onClick: () => onDeleteRequest
|
|
115
119
|
? onDeleteRequest(item.orgId)
|
|
116
120
|
: setDeleteOrgId(item.orgId) }));
|
|
117
121
|
return (_jsxs(Box, { ...cardSx, p: 3, position: "relative", transition: "all 0.2s ease", _hover: {
|
|
118
|
-
borderColor:
|
|
122
|
+
borderColor: colors.primary[300],
|
|
119
123
|
boxShadow: "lg",
|
|
120
124
|
transform: "translateY(-3px)",
|
|
121
|
-
}, children: [_jsxs(Flex, { justifyContent: "space-between", alignItems: "center", mb: 2, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "lg", bg: primary50, color:
|
|
122
|
-
? ((
|
|
125
|
+
}, children: [_jsxs(Flex, { justifyContent: "space-between", alignItems: "center", mb: 2, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "lg", bg: primary50, color: onPrimary50, children: _jsx(Building2, { size: 18 }) }), _jsxs(HStack, { spacing: 1, children: [item.default === 1 ? (_jsxs(Badge, { colorScheme: "green", borderRadius: "full", px: 2, py: 0.5, display: "flex", alignItems: "center", gap: 1, fontSize: "0.7rem", fontWeight: 600, children: [_jsx(CheckCircle2, { size: 12 }), labels.default] })) : isSwitching ? (_jsxs(Flex, { align: "center", gap: 2, color: colors.accentText, children: [_jsx(Spinner, { size: "sm" }), _jsx(Text, { fontSize: "xs", children: labels.settingDefault })] })) : (_jsxs(Flex, { align: "center", gap: 1, fontSize: "xs", color: colors.accentText, fontWeight: 600, cursor: "pointer", _hover: { color: colors.primary[700], gap: 2 }, transition: "all 0.2s ease", onClick: () => onSetDefault === null || onSetDefault === void 0 ? void 0 : onSetDefault(item.orgId), children: [_jsx(CheckCircle2, { size: 12 }), _jsx(Text, { children: labels.setAsDefault })] })), canEdit && (_jsx(Tooltip, { label: labels.editOrganization, hasArrow: true, children: _jsx(IconButton, { "aria-label": labels.editOrganization, icon: _jsx(Pencil, { size: 12 }), size: "xs", variant: "ghost", color: muted, borderRadius: "full", _hover: { color: onPrimary50, bg: primary50 }, onClick: () => startEditing(item) }) })), _jsx(Tooltip, { label: isProtected
|
|
126
|
+
? ((_d = item.deleteDisabledReason) !== null && _d !== void 0 ? _d : labels.protectedOrganization)
|
|
123
127
|
: labels.deleteOrganization, hasArrow: true, children: isProtected ? (_jsx(Box, { as: "span", display: "inline-flex", children: deleteButton })) : (deleteButton) })] })] }), isEditingThis ? (_jsxs(Box, { children: [_jsxs(HStack, { spacing: 1, children: [_jsx(Input, { value: editValue, onChange: (e) => {
|
|
124
128
|
setEditValue(e.target.value);
|
|
125
129
|
if (editError)
|
|
@@ -129,15 +133,14 @@ const OrganizationDetails = ({ activeOrganizations, invitedOrganizations, isLoad
|
|
|
129
133
|
submitEditing(item);
|
|
130
134
|
if (e.key === "Escape")
|
|
131
135
|
cancelEditing();
|
|
132
|
-
} }), _jsx(IconButton, { "aria-label": labels.save, icon: isSavingThis ? _jsx(Spinner, { size: "xs" }) : _jsx(Check, { size: 14 }), size: "xs", colorScheme: "green", isDisabled: isSavingThis, onClick: () => submitEditing(item), variant: "ghost" }), _jsx(IconButton, { "aria-label": labels.cancel, icon: _jsx(X, { size: 14 }), size: "xs", variant: "ghost", isDisabled: isSavingThis, onClick: cancelEditing })] }), editError && (_jsx(Text, { fontSize: "0.7rem", color:
|
|
136
|
+
} }), _jsx(IconButton, { "aria-label": labels.save, icon: isSavingThis ? _jsx(Spinner, { size: "xs" }) : _jsx(Check, { size: 14 }), size: "xs", colorScheme: "green", isDisabled: isSavingThis, onClick: () => submitEditing(item), variant: "ghost" }), _jsx(IconButton, { "aria-label": labels.cancel, icon: _jsx(X, { size: 14 }), size: "xs", variant: "ghost", isDisabled: isSavingThis, onClick: cancelEditing })] }), editError && (_jsx(Text, { fontSize: "0.7rem", color: colors.semanticText.error, mt: 1, children: editError }))] })) : (_jsxs(Box, { children: [_jsx(Text, { fontSize: "sm", fontWeight: 700, color: heading, noOfLines: 1, children: item.company_name }), (item.isOwner || roleLabel) && (_jsxs(HStack, { spacing: 1, mt: 1, children: [item.isOwner && (_jsx(Tag, { label: labels.owner, icon: Crown, colorScheme: "primary", variant: "subtle", size: "xs" })), roleLabel && (_jsx(Tag, { label: roleLabel, colorScheme: "gray", variant: "subtle", size: "xs" }))] }))] }))] }, item.orgId));
|
|
133
137
|
};
|
|
134
138
|
const renderInvitedCard = (item) => {
|
|
135
|
-
var _a, _b;
|
|
136
139
|
const isResponding = respondingOrgIds.includes(item.orgId);
|
|
137
140
|
return (_jsxs(Box, { ...cardSx, p: 3, position: "relative", transition: "all 0.2s ease", _hover: {
|
|
138
141
|
boxShadow: "lg",
|
|
139
142
|
transform: "translateY(-3px)",
|
|
140
|
-
}, children: [_jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", mb: 2, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "lg", bg:
|
|
143
|
+
}, children: [_jsxs(Flex, { justifyContent: "space-between", alignItems: "flex-start", mb: 2, children: [_jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "lg", bg: warningTone.bg, color: warningTone.fg, children: _jsx(Building2, { size: 18 }) }), _jsx(Badge, { colorScheme: "yellow", borderRadius: "full", px: 2, py: 0.5, fontSize: "0.7rem", fontWeight: 600, children: labels.pending })] }), _jsx(Text, { fontSize: "sm", fontWeight: 700, color: heading, noOfLines: 1, mb: 1, children: item.company_name }), item.company_url && (_jsxs(Flex, { align: "center", gap: 2, color: subtle, fontSize: "xs", mb: 2, children: [_jsx(Globe, { size: 13 }), _jsx(Text, { noOfLines: 1, title: item.company_url, children: item.company_url })] })), _jsxs(HStack, { spacing: 2, pt: 2, borderTop: "1px solid", borderColor: border, children: [_jsx(Box, { flex: 1, children: _jsx(Button, { label: labels.accept, colorScheme: "green", size: "sm", width: "100%", isLoading: isResponding, loadingText: labels.accepting, onClick: () => onAcceptInvite === null || onAcceptInvite === void 0 ? void 0 : onAcceptInvite(item.orgId) }) }), _jsx(Box, { flex: 1, children: _jsx(Button, { label: labels.decline, colorScheme: "red", size: "sm", width: "100%", onClick: () => onDeclineInvite === null || onDeclineInvite === void 0 ? void 0 : onDeclineInvite(item.orgId) }) })] })] }, item.orgId));
|
|
141
144
|
};
|
|
142
145
|
const gridSx = {
|
|
143
146
|
display: "grid",
|
|
@@ -150,9 +153,9 @@ const OrganizationDetails = ({ activeOrganizations, invitedOrganizations, isLoad
|
|
|
150
153
|
width: "100%",
|
|
151
154
|
};
|
|
152
155
|
const hasOrganizations = activeOrganizations.length > 0 || invitedOrganizations.length > 0;
|
|
153
|
-
return (_jsxs(Box, { backgroundColor: pageBg, minHeight: "100%", p: { base: 2, md: 3 }, children: [_jsxs(Flex, { ...cardSx, px: 3, py: 2.5, mb: 3, alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", gap: 3, bgGradient: `linear(135deg, ${primary50} 0%, ${primary100} 100%)`, children: [_jsxs(Flex, { alignItems: "center", gap: 3, children: [onBack && (_jsx(IconButton, { "aria-label": "Go back", icon: _jsx(ArrowLeft, { size: 18 }), variant: "ghost", size: "sm", color: subtle, onClick: onBack })), _jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: primary500, color:
|
|
156
|
+
return (_jsxs(Box, { backgroundColor: pageBg, minHeight: "100%", p: { base: 2, md: 3 }, children: [_jsxs(Flex, { ...cardSx, px: 3, py: 2.5, mb: 3, alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", gap: 3, bgGradient: `linear(135deg, ${primary50} 0%, ${primary100} 100%)`, children: [_jsxs(Flex, { alignItems: "center", gap: 3, children: [onBack && (_jsx(IconButton, { "aria-label": "Go back", icon: _jsx(ArrowLeft, { size: 18 }), variant: "ghost", size: "sm", color: subtle, onClick: onBack })), _jsx(Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: primary500, color: onFilled(primary500, colors.white, colors.black), children: _jsx(Building2, { size: 18 }) }), _jsxs(Box, { children: [_jsxs(HStack, { spacing: 2, children: [_jsx(Heading, { size: "sm", color: heading, fontWeight: 700, children: userName
|
|
154
157
|
? `${labels.greeting.replace(/User!?/, "")}${userName}!`.trim()
|
|
155
|
-
: labels.greeting }), _jsx(Avatar, { size: "xs", name: userName, src: userAvatarUrl })] }), _jsx(Text, { fontSize: "xs", color: subtle, mt: 0.5, children: labels.manageSubtitle })] })] }), _jsx(Button, { label: labels.createNewOrganization, onClick: () => setCreateOpen(true), leftIcon: _jsx(Plus, { size: 16 }), colorScheme: "primary", size: "sm" })] }), isLoading ? (_jsx(Box, { ...gridSx, children: Array.from({ length: 6 }).map((_, idx) => (_jsxs(Box, { ...cardSx, p: 3, children: [_jsx(Skeleton, { boxSize: "36px", borderRadius: "lg", mb: 2 }), _jsx(SkeletonText, { noOfLines: 2, spacing: 2 })] }, idx))) })) : !hasOrganizations ? (_jsx(EmptyState, { icon: Building2, title: labels.noOrganizationsTitle, description: labels.noOrganizationsDescription, minH: "40vh", action: _jsx(Button, { label: labels.createOrganization, onClick: () => setCreateOpen(true), leftIcon: _jsx(Plus, { size: 16 }), colorScheme: "primary", size: "sm" }) })) : (_jsxs(VStack, { align: "stretch", spacing: 4, children: [activeOrganizations.length > 0 && (_jsxs(Box, { children: [_jsxs(Flex, { align: "center", gap: 2, mb: 2, children: [_jsx(Users, { size: 16, color:
|
|
158
|
+
: labels.greeting }), _jsx(Avatar, { size: "xs", name: userName, src: userAvatarUrl })] }), _jsx(Text, { fontSize: "xs", color: subtle, mt: 0.5, children: labels.manageSubtitle })] })] }), _jsx(Button, { label: labels.createNewOrganization, onClick: () => setCreateOpen(true), leftIcon: _jsx(Plus, { size: 16 }), colorScheme: "primary", size: "sm" })] }), isLoading ? (_jsx(Box, { ...gridSx, children: Array.from({ length: 6 }).map((_, idx) => (_jsxs(Box, { ...cardSx, p: 3, children: [_jsx(Skeleton, { boxSize: "36px", borderRadius: "lg", mb: 2 }), _jsx(SkeletonText, { noOfLines: 2, spacing: 2 })] }, idx))) })) : !hasOrganizations ? (_jsx(EmptyState, { icon: Building2, title: labels.noOrganizationsTitle, description: labels.noOrganizationsDescription, minH: "40vh", action: _jsx(Button, { label: labels.createOrganization, onClick: () => setCreateOpen(true), leftIcon: _jsx(Plus, { size: 16 }), colorScheme: "primary", size: "sm" }) })) : (_jsxs(VStack, { align: "stretch", spacing: 4, children: [activeOrganizations.length > 0 && (_jsxs(Box, { children: [_jsxs(Flex, { align: "center", gap: 2, mb: 2, children: [_jsx(Users, { size: 16, color: colors.accentText }), _jsx(Heading, { size: "sm", color: heading, fontWeight: 600, children: labels.activeOrganizations }), sectionBadge(activeOrganizations.length, "blue")] }), _jsx(Box, { ...gridSx, children: activeOrganizations.map(renderActiveCard) })] })), invitedOrganizations.length > 0 && (_jsxs(Box, { children: [_jsxs(Flex, { align: "center", gap: 2, mb: 2, children: [_jsx(Mail, { size: 16, color: colors.semanticText.warning }), _jsx(Heading, { size: "sm", color: heading, fontWeight: 600, children: labels.invitedOrganizations }), sectionBadge(invitedOrganizations.length, "yellow")] }), _jsx(Box, { ...gridSx, children: invitedOrganizations.map(renderInvitedCard) })] }))] })), footerSlot, _jsx(CreateOrgModal, { isOpen: isCreateOpen, onClose: () => setCreateOpen(false), isLoading: isCreating, onSubmit: async (values) => {
|
|
156
159
|
await (onCreateOrganization === null || onCreateOrganization === void 0 ? void 0 : onCreateOrganization(values));
|
|
157
160
|
setCreateOpen(false);
|
|
158
161
|
}, labels: labels }), _jsx(DeleteOrgModal, { isOpen: deleteOrgId !== null, onClose: () => setDeleteOrgId(null), onConfirm: async () => {
|
|
@@ -5,6 +5,6 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
|
5
5
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
6
6
|
const PdfViewer = ({ pdfUrl, fileName = "Document.pdf", height = "480px", showToolbar = true, borderRadius = "xl", }) => {
|
|
7
7
|
const theme = useCustomTheme();
|
|
8
|
-
return (_jsxs(Box, { border: "1px solid", borderColor: theme.colors.gray[200], borderRadius: borderRadius, overflow: "hidden", bg: theme.colors.background[50], children: [showToolbar && (_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 2.5, borderBottom: "1px solid", borderColor: theme.colors.gray[100], bg: theme.colors.gray[50], children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(FileText, { size: 18, color: theme.colors.
|
|
8
|
+
return (_jsxs(Box, { border: "1px solid", borderColor: theme.colors.gray[200], borderRadius: borderRadius, overflow: "hidden", bg: theme.colors.background[50], children: [showToolbar && (_jsxs(Flex, { align: "center", justify: "space-between", px: 4, py: 2.5, borderBottom: "1px solid", borderColor: theme.colors.gray[100], bg: theme.colors.gray[50], children: [_jsxs(Flex, { align: "center", gap: 2, minW: 0, children: [_jsx(FileText, { size: 18, color: theme.colors.accentText }), _jsx(Text, { fontSize: "sm", fontWeight: 500, color: theme.colors.gray[700], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: fileName })] }), _jsxs(Flex, { align: "center", gap: 1, children: [_jsx(ToolTip, { label: "Open in new tab", placement: "top", children: _jsx(Box, { as: "a", href: pdfUrl, target: "_blank", rel: "noopener noreferrer", p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: theme.colors.primary[50], color: theme.colors.primary[500] }, children: _jsx(ExternalLink, { size: 16 }) }) }), _jsx(ToolTip, { label: "Download", placement: "top", children: _jsx(Box, { as: "a", href: pdfUrl, download: fileName, p: 2, borderRadius: "lg", color: theme.colors.gray[600], _hover: { bg: theme.colors.primary[50], color: theme.colors.primary[500] }, children: _jsx(Download, { size: 16 }) }) })] })] })), _jsx(Box, { as: "embed", src: pdfUrl, type: "application/pdf", width: "100%", height: height, display: "block" })] }));
|
|
9
9
|
};
|
|
10
10
|
export default PdfViewer;
|
|
@@ -8,7 +8,7 @@ export default function PinInputs({ otp, mask, defaultValue, placeholder, manage
|
|
|
8
8
|
// [800], not [300]/[700]: WCAG 1.4.11 needs >=3.0 for a control boundary, measured
|
|
9
9
|
// against the parent surface — up to `muted` (lightest). [700] fails there (2.41-2.72);
|
|
10
10
|
// [800] clears all named surfaces with margin (3.44-3.90).
|
|
11
|
-
borderColor: theme.colors.boxborder[
|
|
11
|
+
borderColor: theme.colors.boxborder[500], _focus: {
|
|
12
12
|
borderColor: theme.colors.primary[500],
|
|
13
13
|
boxShadow: `0 0 0 0.063rem ${theme.colors.primary[500]}`,
|
|
14
14
|
} }, index))) }) })] }));
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
|
-
import { Box, HStack, Input
|
|
3
|
+
import { Box, HStack, Input } from "@chakra-ui/react";
|
|
4
4
|
import Label from "../Common/Label.js";
|
|
5
5
|
import ErrorComponent from "../Common/ErrorComponent.js";
|
|
6
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
7
|
const PinInputs = ({ length = 3, label, error, onChange, onComplete, mask = false, placeholder = "*", }) => {
|
|
7
|
-
|
|
8
|
-
const theme = useTheme();
|
|
9
|
-
const { colors } = theme;
|
|
8
|
+
const { colors } = useCustomTheme();
|
|
10
9
|
const [values, setValues] = useState(Array(length).fill(""));
|
|
11
10
|
const inputsRef = useRef([]);
|
|
12
|
-
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named surface
|
|
13
|
-
// up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
14
11
|
const borderColor = error
|
|
15
|
-
?
|
|
16
|
-
:
|
|
17
|
-
const focusRing = error ?
|
|
18
|
-
const focusShadow = focusRing
|
|
19
|
-
? `0 0 0 0.125rem ${focusRing}`
|
|
20
|
-
: undefined;
|
|
12
|
+
? colors.semanticText.error
|
|
13
|
+
: colors.boxborder[500];
|
|
14
|
+
const focusRing = error ? colors.boxShadow.error : colors.boxShadow.primary;
|
|
15
|
+
const focusShadow = `0 0 0 0.125rem ${focusRing}`;
|
|
21
16
|
const handleChange = (index, value) => {
|
|
22
17
|
var _a;
|
|
23
18
|
if (!/^[0-9]?$/.test(value))
|
|
@@ -41,8 +36,6 @@ const PinInputs = ({ length = 3, label, error, onChange, onComplete, mask = fals
|
|
|
41
36
|
};
|
|
42
37
|
return (_jsxs(Box, { children: [label && _jsx(Label, { label: label }), _jsx(HStack, { spacing: 2, children: Array.from({ length }).map((_, index) => (_jsx(Input, { ref: (el) => {
|
|
43
38
|
inputsRef.current[index] = el;
|
|
44
|
-
}, type: mask ? "password" : "text", inputMode: "numeric", maxLength: 1, placeholder: placeholder, value: values[index], onChange: (e) => handleChange(index, e.target.value), onKeyDown: (e) => handleKeyDown(e, index), w: 12, h: 12, textAlign: "center", fontSize: "lg", borderWidth: "1px", borderColor: borderColor, borderRadius: "md", _focus: focusShadow
|
|
45
|
-
? { boxShadow: focusShadow, outline: "none" }
|
|
46
|
-
: { outline: "none" } }, index))) }), error && _jsx(ErrorComponent, { error: error })] }));
|
|
39
|
+
}, type: mask ? "password" : "text", inputMode: "numeric", maxLength: 1, placeholder: placeholder, value: values[index], onChange: (e) => handleChange(index, e.target.value), onKeyDown: (e) => handleKeyDown(e, index), w: 12, h: 12, textAlign: "center", fontSize: "lg", borderWidth: "1px", borderColor: borderColor, borderRadius: "md", _focus: { boxShadow: focusShadow, outline: "none" } }, index))) }), error && _jsx(ErrorComponent, { error: error })] }));
|
|
47
40
|
};
|
|
48
41
|
export default PinInputs;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Flex, Text } from "@chakra-ui/react";
|
|
3
3
|
import { AlertCircle, Clock, Sparkles } from "lucide-react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
6
|
+
import { chipBorder, chipFill, statusGradient, } from "./planPillGradient.js";
|
|
7
7
|
const TONE_ICON = {
|
|
8
8
|
normal: Sparkles,
|
|
9
9
|
warning: Clock,
|
|
@@ -13,18 +13,15 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
|
|
|
13
13
|
const theme = useCustomTheme();
|
|
14
14
|
const c = theme.colors;
|
|
15
15
|
const toneGradient = {
|
|
16
|
-
normal:
|
|
17
|
-
warning:
|
|
18
|
-
danger:
|
|
16
|
+
normal: c.gradient,
|
|
17
|
+
warning: statusGradient(c.semantic.warning),
|
|
18
|
+
danger: statusGradient(c.semantic.error),
|
|
19
19
|
};
|
|
20
|
-
const resolved = gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone];
|
|
21
|
-
const ink =
|
|
22
|
-
// The chip is a translucent inset of the pill itself, so it tints with whichever
|
|
23
|
-
// ink won — a white wash under black text would wash the chip out entirely.
|
|
24
|
-
const onDark = ink === c.white;
|
|
20
|
+
const resolved = resolveGradient(gradient !== null && gradient !== void 0 ? gradient : toneGradient[tone], c.white, c.black);
|
|
21
|
+
const ink = resolved.ink;
|
|
25
22
|
const Icon = icon === undefined ? TONE_ICON[tone] : icon;
|
|
26
23
|
const hasMobile = !!mobileLabel && mobileLabel !== label;
|
|
27
|
-
return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage:
|
|
24
|
+
return (_jsxs(Box, { as: "button", type: "button", "aria-label": ariaLabel || (status ? `${label} — ${status}` : label), onClick: onClick, display: "inline-flex", alignItems: "center", gap: "7px", pl: "12px", pr: status ? "5px" : "12px", py: "3px", bgImage: gradientCss(resolved), color: ink, borderRadius: "full", whiteSpace: "nowrap", cursor: "pointer", transition: "transform 0.2s ease, box-shadow 0.2s ease", _hover: {
|
|
28
25
|
transform: "translateY(-1px)",
|
|
29
26
|
boxShadow: `0 6px 18px ${resolved.from}59`,
|
|
30
27
|
}, _focusVisible: {
|
|
@@ -35,6 +32,6 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
|
|
|
35
32
|
transition: "none",
|
|
36
33
|
_hover: { transform: "none" },
|
|
37
34
|
},
|
|
38
|
-
}, children: [Icon ? _jsx(Icon, { size: 12, strokeWidth: 2.5, "aria-hidden": true }) : null, _jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", overflow: "hidden", textOverflow: "ellipsis", maxW: maxLabelWidth, display: hasMobile ? { base: "none", md: "block" } : "block", children: label }), hasMobile ? (_jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", display: { base: "block", md: "none" }, children: mobileLabel })) : null, status ? (_jsx(Flex, { as: "span", align: "center", px: "8px", borderRadius: "full", bg:
|
|
35
|
+
}, children: [Icon ? _jsx(Icon, { size: 12, strokeWidth: 2.5, "aria-hidden": true }) : null, _jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", overflow: "hidden", textOverflow: "ellipsis", maxW: maxLabelWidth, display: hasMobile ? { base: "none", md: "block" } : "block", children: label }), hasMobile ? (_jsx(Text, { as: "span", fontSize: "12.5px", fontWeight: "600", lineHeight: "18px", display: { base: "block", md: "none" }, children: mobileLabel })) : null, status ? (_jsx(Flex, { as: "span", align: "center", px: "8px", borderRadius: "full", bg: chipFill(resolved), border: "1px solid", borderColor: chipBorder(resolved), fontSize: "11px", fontWeight: "700", lineHeight: "18px", sx: { fontVariantNumeric: "tabular-nums" }, children: status })) : null] }));
|
|
39
36
|
};
|
|
40
37
|
export default PlanPill;
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
+
import { resolveAvatarFill } from "../../Theme/tokens/builders/statusTone.js";
|
|
2
|
+
import { relativeLuminance } from "../../Theme/tokens/builders/color.js";
|
|
3
|
+
export const STATUS_INK = "#ffffff";
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* not
|
|
4
|
-
*
|
|
5
|
-
* Its tone carries meaning (normal / warning / danger), and a brand gradient can
|
|
6
|
-
* collide with that: rosewood's `#c74962 → #ea0727` is red, so a healthy plan
|
|
7
|
-
* rendered as if it had expired. Greyscale brands failed the other way, sinking
|
|
8
|
-
* the badge into the header chrome.
|
|
9
|
-
*
|
|
10
|
-
* One accent for both color modes is deliberate: a lighter dark-mode variant was
|
|
11
|
-
* tried and flipped `onGradient`'s ink to black, which read as a washed-out candy
|
|
12
|
-
* pill on dark chrome. These stops keep white ink in both modes, so the badge looks
|
|
13
|
-
* like the same component everywhere. Verified at AA (>= 4.5:1) on both stops.
|
|
14
|
-
*
|
|
15
|
-
* Consumers who genuinely want another colour still pass `gradient`.
|
|
5
|
+
* Opt-in accent for consumers who want a fixed badge colour instead of the brand `gradient`.
|
|
6
|
+
* One hue, like every brand gradient — a second hue reads as a status change, not a style.
|
|
16
7
|
*/
|
|
17
|
-
export const ACCENT_GRADIENT = { from: "#
|
|
8
|
+
export const ACCENT_GRADIENT = { from: "#8b3fc8", to: "#762d9d" };
|
|
9
|
+
/**
|
|
10
|
+
* Sinks both stops until WHITE ink clears AA, keeping each stop's hue. Any mid-tone gradient —
|
|
11
|
+
* a brand `gradient` token, a status scale — otherwise flips `onGradient` to black ink, so the
|
|
12
|
+
* same badge reads white-on-colour in one brand and black-on-pastel in the next.
|
|
13
|
+
*/
|
|
14
|
+
export const inkSafeGradient = (gradient) => ({
|
|
15
|
+
from: resolveAvatarFill(gradient.from),
|
|
16
|
+
to: resolveAvatarFill(gradient.to),
|
|
17
|
+
});
|
|
18
|
+
/** Status tones are semantic scales, not designed as label backdrops. */
|
|
19
|
+
export const statusGradient = (scale) => inkSafeGradient({ from: scale[400], to: scale[600] });
|
|
20
|
+
const CHIP_INK_CONTRAST = 7;
|
|
21
|
+
export const darkerStop = (g) => relativeLuminance(g.from) <= relativeLuminance(g.to) ? g.from : g.to;
|
|
22
|
+
/**
|
|
23
|
+
* Solid inset chip in the pill's own hue. A translucent scrim was a guessed alpha that
|
|
24
|
+
* composited into a muddy dark lozenge on every mid-tone gradient; a derived rung reads as
|
|
25
|
+
* one step down from the pill in every brand and both modes.
|
|
26
|
+
*/
|
|
27
|
+
export const chipFill = (g) => resolveAvatarFill(darkerStop(g), CHIP_INK_CONTRAST);
|
|
28
|
+
/** The pill's lighter stop — guaranteed lighter than `chipFill`, so it draws the inset edge. */
|
|
29
|
+
export const chipBorder = (g) => relativeLuminance(g.from) > relativeLuminance(g.to) ? g.from : g.to;
|
|
@@ -91,20 +91,20 @@ const ProductPrice = ({ options, size, onSelect, rightSlot }) => {
|
|
|
91
91
|
useEffect(() => {
|
|
92
92
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selected);
|
|
93
93
|
}, [selected, onSelect]);
|
|
94
|
-
return (_jsxs(_Fragment, { children: [isSingleOption ? (_jsx(Box, { border: "0.063rem solid", borderColor:
|
|
94
|
+
return (_jsxs(_Fragment, { children: [isSingleOption ? (_jsx(Box, { border: "0.063rem solid", borderColor: theme.colors.red[300], bg: theme.colors.red[50], px: cfg.px,
|
|
95
95
|
// py={cfg.py}
|
|
96
|
-
rounded: "md", display: "inline-block", w: "100%", children: _jsx(Text, { fontSize: cfg.label, fontWeight: "medium", children: options[0].label }) })) : (_jsxs(Box, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), border: "0.063rem solid", borderColor:
|
|
96
|
+
rounded: "md", display: "inline-block", w: "100%", children: _jsx(Text, { fontSize: cfg.label, fontWeight: "medium", children: options[0].label }) })) : (_jsxs(Box, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), border: "0.063rem solid", borderColor: theme.colors.red[300], bg: theme.colors.red[50], px: cfg.px,
|
|
97
97
|
// py={cfg.py}
|
|
98
|
-
rounded: "md", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", w: "100%", children: [_jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: cfg.label, fontWeight: "medium", whiteSpace: "nowrap", children: selected.label }) }), _jsx(Text, { fontSize: cfg.font, color: accentTextOnCanvas(theme.colors.red, theme.colors.red[50]), transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: "\u25BE" })] })), !isSingleOption && isOpen && (_jsx(Portal, { children: _jsx(Box, { ref: dropdownRef, position: "fixed", top: `${dropdownPosition.top}px`, left: `${dropdownPosition.left}px`, width: `${dropdownPosition.width}px`, bg: theme.colors.background[50], border: "0.063rem solid", borderColor:
|
|
98
|
+
rounded: "md", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", w: "100%", children: [_jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: cfg.label, fontWeight: "medium", whiteSpace: "nowrap", children: selected.label }) }), _jsx(Text, { fontSize: cfg.font, color: accentTextOnCanvas(theme.colors.red, theme.colors.red[50]), transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)', transition: "transform 0.2s", children: "\u25BE" })] })), !isSingleOption && isOpen && (_jsx(Portal, { children: _jsx(Box, { ref: dropdownRef, position: "fixed", top: `${dropdownPosition.top}px`, left: `${dropdownPosition.left}px`, width: `${dropdownPosition.width}px`, bg: theme.colors.background[50], border: "0.063rem solid", borderColor: theme.colors.red[300], borderRadius: "md", overflow: "hidden", maxH: "13rem", overflowY: "auto", shadow: "md", zIndex: 100000, children: options.map((option) => {
|
|
99
99
|
const discounted = getDiscountedPrice(option);
|
|
100
100
|
const isSelected = selected.var_id === option.var_id;
|
|
101
|
-
return (_jsxs(Grid, { px: 1, py: 0.5, cursor: "pointer", bg: isSelected ?
|
|
101
|
+
return (_jsxs(Grid, { px: 1, py: 0.5, cursor: "pointer", bg: isSelected ? theme.colors.red[50] : theme.colors.background[50], borderLeft: isSelected ? '0.25rem solid' : '0.25rem solid transparent', borderLeftColor: isSelected ? theme.colors.red[300] : "transparent", _hover: { bg: theme.colors.red[100] }, onClick: () => {
|
|
102
102
|
setSelected(option);
|
|
103
103
|
setIsOpen(false);
|
|
104
104
|
}, templateColumns: { base: '1fr auto', md: '1fr auto' },
|
|
105
105
|
// columnGap={{ base: 2, md: 3 }}
|
|
106
106
|
// rowGap={{ base: 1.5, md: 2 }}
|
|
107
|
-
alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg:
|
|
108
|
-
}) }) })), _jsxs(Flex, { mt: 2, w: "full", gap: 3, direction: { base: "column", md: "row" }, align: { base: "flex-start", md: "center" }, justify: { base: "flex-start", md: rightSlot ? "space-between" : "flex-start" }, children: [_jsxs(Box, { display: "flex", alignItems: "center", fontSize: cfg.price, gap: 2, minW: 0, children: [selected.offer > 0 && (_jsxs(Text, { color:
|
|
107
|
+
alignItems: "center", children: [_jsx(HStack, { gridColumn: 1, gridRow: 1, spacing: 2, align: "center", minW: 0, mb: 0, children: _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "top", maxWidth: "100%", fontSize: { base: "xs", md: "sm" }, fontWeight: "medium", whiteSpace: "nowrap", children: option.label }) }) }), _jsx(Box, { gridColumn: 1, gridRow: 2, mt: 0, textAlign: "left", children: _jsxs(HStack, { spacing: 2, align: "center", children: [option.offer > 0 && (_jsx(Badge, { bg: theme.colors.green[100], color: accentTextOnCanvas(theme.colors.green, theme.colors.green[100]), borderRadius: "md", px: { base: 0, md: 0.5 }, py: { base: 0, md: 0.25 }, fontWeight: "bold", fontSize: "10px", flexShrink: 0, children: isMobile ? `${option.offer}%` : `${option.offer}% OFF` })), _jsxs(Text, { fontSize: "sm", fontWeight: "bold", color: accentTextOnCanvas(theme.colors.red, isSelected ? theme.colors.red[50] : theme.colors.background[50]), whiteSpace: "nowrap", children: ["\u20B9", discounted] }), option.offer > 0 && (_jsxs(Text, { fontSize: "xs", color: theme.colors.textMuted, textDecoration: "line-through", whiteSpace: "nowrap", children: ["\u20B9", option.price] }))] }) }), _jsx(Box, { gridColumn: 2, gridRow: 1, ml: { base: 0, md: 0 }, justifySelf: "end", w: { base: "0.625rem", md: "0.75rem" }, h: { base: "0.625rem", md: "0.75rem" }, minW: { base: "0.625rem", md: "0.75rem" }, borderRadius: "full", border: "0.125rem solid", borderColor: isSelected ? theme.colors.red[500] : theme.colors.boxborder[500], bg: theme.colors.background[50], display: "flex", alignItems: "center", justifyContent: "center", boxShadow: "none", children: isSelected && (_jsx(Box, { w: { base: "0.25rem", md: "0.3125rem" }, h: { base: "0.25rem", md: "0.3125rem" }, bg: theme.colors.red[500], borderRadius: "full" })) })] }, option.var_id));
|
|
108
|
+
}) }) })), _jsxs(Flex, { mt: 2, w: "full", gap: 3, direction: { base: "column", md: "row" }, align: { base: "flex-start", md: "center" }, justify: { base: "flex-start", md: rightSlot ? "space-between" : "flex-start" }, children: [_jsxs(Box, { display: "flex", alignItems: "center", fontSize: cfg.price, gap: 2, minW: 0, children: [selected.offer > 0 && (_jsxs(Text, { color: theme.colors.textMuted, textDecoration: "line-through", children: ["\u20B9", selected.price] })), _jsxs(Text, { color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "semibold", children: ["\u20B9", getDiscountedPrice(selected)] })] }), rightSlot && (_jsx(Box, { flexShrink: 0, mt: { base: 2, md: 0 }, children: rightSlot }))] })] }));
|
|
109
109
|
};
|
|
110
110
|
export default ProductPrice;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Flex, Text, Icon } from '@chakra-ui/react';
|
|
3
3
|
import { BookCheck, Star } from 'lucide-react';
|
|
4
|
+
import { useCustomTheme } from '../../Theme/useCustomTheme.js';
|
|
5
|
+
import { accentTextOnCanvas } from '../../Theme/tokens/builders/accentText.js';
|
|
4
6
|
// The theme's `yellow` scale reverses index roles in dark mode (like every utility hue), so
|
|
5
7
|
// pulling it through the theme would silently flip this decorative "filled star" from gold to
|
|
6
8
|
// pale. A rating star is a universal, brand-independent gold — not something that should follow
|
|
@@ -8,12 +10,13 @@ import { BookCheck, Star } from 'lucide-react';
|
|
|
8
10
|
// "rating gold") to pixelize-design-library if this pattern is needed elsewhere.
|
|
9
11
|
const RATING_STAR_FILL = "#ECC94B";
|
|
10
12
|
const ProductReview = ({ rating, reviewCount, mb = 0 }) => {
|
|
13
|
+
const { colors } = useCustomTheme();
|
|
11
14
|
const hasRating = rating !== undefined && rating !== null;
|
|
12
15
|
const hasReviewCount = reviewCount !== undefined && reviewCount !== null;
|
|
13
16
|
// Convert rating to number and ensure it's between 0 and 5
|
|
14
17
|
// Calculate fill percentage: (rating / 5) * 100%
|
|
15
18
|
const numericRating = hasRating ? Math.min(Math.max(Number(rating), 0), 5) : 0;
|
|
16
19
|
const fillPercentage = (numericRating / 6) * 100;
|
|
17
|
-
return (_jsxs(Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && (_jsxs(Flex, { align: "center", gap: 1, bg:
|
|
20
|
+
return (_jsxs(Flex, { align: "center", gap: 2, mb: mb, children: [hasRating && (_jsxs(Flex, { align: "center", gap: 1, bg: colors.teal[50], color: accentTextOnCanvas(colors.teal, colors.teal[50]), px: 2, borderRadius: "md", children: [_jsxs(Box, { position: "relative", flexShrink: 0, display: "inline-block", width: "14px", height: "14px", lineHeight: 0, children: [_jsx(Box, { position: "absolute", top: 0, left: 0, width: "14px", height: "14px", children: _jsx(Star, { size: 14, fill: "none", strokeWidth: 1.5 }) }), fillPercentage > 0 && (_jsx(Box, { position: "absolute", top: 0, left: 0, width: `${fillPercentage}%`, height: "100%", overflow: "hidden", children: _jsx(Star, { size: 14, color: RATING_STAR_FILL, fill: RATING_STAR_FILL }) }))] }), _jsx(Text, { fontSize: "sm", fontWeight: "bold", children: numericRating })] })), hasRating && hasReviewCount && _jsx(Box, { h: "4", w: "0.063rem", bg: colors.boxborder[500] }), hasReviewCount && (_jsxs(Flex, { align: "center", gap: "1", children: [_jsx(Icon, { as: BookCheck, boxSize: 3.5 }), _jsxs(Text, { fontSize: "sm", color: colors.textMuted, children: ["(", reviewCount, ")"] })] }))] }));
|
|
18
21
|
};
|
|
19
22
|
export default ProductReview;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { Box, Flex
|
|
3
|
+
import { Box, Flex } from '@chakra-ui/react';
|
|
4
4
|
import ToolTip from '../ToolTip/ToolTip.js';
|
|
5
|
+
import { useCustomTheme } from '../../Theme/useCustomTheme.js';
|
|
5
6
|
const ProductTags = ({ tags, className, size = 'sm' }) => {
|
|
6
7
|
const getRows = (tags) => {
|
|
7
8
|
const count = tags.length;
|
|
@@ -18,10 +19,9 @@ const ProductTags = ({ tags, className, size = 'sm' }) => {
|
|
|
18
19
|
return (_jsx(Flex, { direction: "column", gap: "1", className: className, w: "full", children: getRows(tags).map((row, rowIndex) => (_jsx(Flex, { gap: "1", children: row.map((tag, tagIndex) => (_jsx(Tag, { fullWidth: row.length === 1, size: size, children: tag }, tagIndex))) }, rowIndex))) }));
|
|
19
20
|
};
|
|
20
21
|
const Tag = ({ children, fullWidth = false, size = 'sm', }) => {
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const tagText = theme.colors.text[900];
|
|
22
|
+
const { colors } = useCustomTheme();
|
|
23
|
+
const tagBorder = colors.semanticText.error;
|
|
24
|
+
const tagText = colors.text[900];
|
|
25
25
|
// Size map for tags
|
|
26
26
|
const tagSizes = {
|
|
27
27
|
xs: { fontSize: '0.625rem', px: '0.5rem', py: '0.125rem' },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Box, Flex, Text, HStack, IconButton, useBreakpointValue } from "@chakra-ui/react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
5
|
import ProductImageSlider from "./ProductImageSlider.js";
|
|
5
6
|
import ProductLabel from "../ProductCard/ProductLabel.js";
|
|
6
7
|
import ProductTags from "../ProductCard/ProductTags.js";
|
|
@@ -11,6 +12,7 @@ import ProductReview from "../ProductCard/ProductReview.js";
|
|
|
11
12
|
import FormattedDescription from "../Common/FormattedDescription.js";
|
|
12
13
|
const ProductDetails = ({ id, price, label, shortdesc, tags, images, batch, onAddToCart, onNotifyMe, onOptionChange, addToCart, goToCart, OnGoToCart, rating, reviews, notifyMe, isQtyEditable = false, displayRating = true, }) => {
|
|
13
14
|
var _a, _b, _c, _d, _e;
|
|
15
|
+
const { colors } = useCustomTheme();
|
|
14
16
|
const isMobile = useBreakpointValue({ base: true, md: false });
|
|
15
17
|
const [selectedOption, setSelectedOption] = React.useState(price === null || price === void 0 ? void 0 : price[0]);
|
|
16
18
|
const [qty, setQty] = React.useState(1);
|
|
@@ -29,7 +31,7 @@ const ProductDetails = ({ id, price, label, shortdesc, tags, images, batch, onAd
|
|
|
29
31
|
const handleDecrement = () => {
|
|
30
32
|
setQty((prev) => (prev > 1 ? prev - 1 : 1));
|
|
31
33
|
};
|
|
32
|
-
return (_jsxs(Flex, { direction: ["column", "row"], maxW: "6xl", mx: "auto", align: "start", gap: 5, children: [_jsx(Box, { position: "relative", color:
|
|
34
|
+
return (_jsxs(Flex, { direction: ["column", "row"], maxW: "6xl", mx: "auto", align: "start", gap: 5, children: [_jsx(Box, { position: "relative", color: colors.text[500], borderRadius: "md", flex: "1", minH: isMobile ? undefined : "31.25rem", children: _jsx(ProductImageSlider, { images: images, thumbHeight: isMobile ? 48 : 80, imageSize: isMobile ? 360 : 480, thumbnailsToShow: isMobile ? 4 : 6, batch: batch }) }), _jsxs(Box, { flex: "1", children: [label && _jsx(ProductLabel, { label: label, size: "sm" }), shortdesc && _jsx(Box, { my: 3, children: _jsx(FormattedDescription, { content: shortdesc }) }), ((rating !== undefined && rating !== null) || (reviews !== undefined && reviews !== null)) && displayRating && (_jsx(ProductReview, { rating: rating, reviewCount: reviews, mb: 3 })), tags && _jsx(ProductTags, { tags: tags, size: "sm" }), price && (_jsx(ProductDtlPrice, { price: price, onSelect: (option) => {
|
|
33
35
|
setSelectedOption(option);
|
|
34
36
|
onOptionChange === null || onOptionChange === void 0 ? void 0 : onOptionChange(option);
|
|
35
37
|
} })), typeof (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) === "number" && ((_a = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.stocks) !== null && _a !== void 0 ? _a : 0) <= 0 && (_jsx(Box, { sx: { ml: "1.1rem", mt: "0.5rem", mb: "0.5rem" }, children: _jsx(Button, { colorScheme: "gray", size: "sm",
|
|
@@ -11,12 +11,12 @@ const ProductDtlPrice = ({ price, onSelect }) => {
|
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(selected);
|
|
13
13
|
}, [selected, onSelect]);
|
|
14
|
-
return (_jsxs(VStack, { align: "start", spacing: 3, p: 4, borderRadius: "md", w: "full", children: [_jsxs(HStack, { spacing: 2, align: "center", children: [selected.offer > 0 && (_jsxs(Text, { fontSize: "lg", color: theme.colors.
|
|
14
|
+
return (_jsxs(VStack, { align: "start", spacing: 3, p: 4, borderRadius: "md", w: "full", children: [_jsxs(HStack, { spacing: 2, align: "center", children: [selected.offer > 0 && (_jsxs(Text, { fontSize: "lg", color: theme.colors.textMuted, as: "s", children: ["\u20B9", selected.price] })), _jsxs(Text, { fontSize: "xl", color: accentTextOnCanvas(theme.colors.red, theme.colors.backgroundColor.main), fontWeight: "bold", children: ["\u20B9", discounted] }), selected.offer > 0 && (_jsxs(Badge, { colorScheme: "pink", fontSize: "xs", borderRadius: "sm", px: 2, py: 0.5, children: ["SAVE ", selected.offer, "%"] }))] }), _jsx(Text, { fontSize: "sm", color: theme.colors.textMuted, children: "(Incl. of all taxes)" }), _jsxs(Box, { children: [_jsxs(Text, { fontSize: "sm", fontWeight: "bold", textTransform: "uppercase", mb: 1, children: ["Packs : ", selected.label] }), _jsx(HStack, { spacing: 2, children: price.map((pack, idx) => (_jsx(Button, { size: "xs", variant: "outline", borderColor: idx === selectedIndex ? theme.colors.orange[400] : theme.colors.orange[200], bg: idx === selectedIndex ? theme.colors.orange[50] : theme.colors.background[50],
|
|
15
15
|
// orange.600 fails AA against both possible bg states — walk the scale per canvas
|
|
16
16
|
color: accentTextOnCanvas(theme.colors.orange, idx === selectedIndex ? theme.colors.orange[50] : theme.colors.background[50]), borderRadius: "md", fontWeight: "medium", _hover: {
|
|
17
|
-
bg:
|
|
17
|
+
bg: theme.colors.orange[100],
|
|
18
18
|
}, _active: {
|
|
19
|
-
bg:
|
|
19
|
+
bg: theme.colors.orange[100],
|
|
20
20
|
}, onClick: () => setSelectedIndex(idx), children: pack.label }, pack.var_id))) })] })] }));
|
|
21
21
|
};
|
|
22
22
|
export default ProductDtlPrice;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Card as ChakraCard, CardBody, CardFooter, CardHeader, Divider,
|
|
3
|
+
import { Card as ChakraCard, CardBody, CardFooter, CardHeader, Divider, } from "@chakra-ui/react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
5
|
export const ProfileCardHeader = ({ children, }) => {
|
|
5
6
|
return _jsx(_Fragment, { children: children });
|
|
6
7
|
};
|
|
@@ -11,10 +12,9 @@ export const ProfileCardFooter = ({ children, }) => {
|
|
|
11
12
|
return _jsx(_Fragment, { children: children });
|
|
12
13
|
};
|
|
13
14
|
export default function ProfileCard({ maxW, align, variant, direction, justify, children, size, color, overflow, dividercolor, dividersize = "0.5px", dividervariant = "solid", CardStyle, CardHeaderStyle, CardBodyStyle, borderTopColor, borderLeftColor, }) {
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const accentBorder = `2px solid ${(_d = theme.colors.primary) === null || _d === void 0 ? void 0 : _d[500]}`;
|
|
15
|
+
const { colors } = useCustomTheme();
|
|
16
|
+
const resolvedDividerColor = dividercolor !== null && dividercolor !== void 0 ? dividercolor : colors.boxborder[200];
|
|
17
|
+
const accentBorder = `2px solid ${colors.primary[500]}`;
|
|
18
18
|
const isReactElement = (child) => {
|
|
19
19
|
return child !== null && typeof child === "object" && "type" in child;
|
|
20
20
|
};
|
|
@@ -3,13 +3,13 @@ import { useRef, useState } from "react";
|
|
|
3
3
|
import { Box, Image, IconButton, Input, Text, Tooltip, HStack, } from "@chakra-ui/react";
|
|
4
4
|
import { Eye, FileText, SquarePen, User } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
-
import {
|
|
6
|
+
import { accentTextOnCanvas, onFilled } from "../../Theme/tokens/builders/accentText.js";
|
|
7
7
|
export default function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth = "100px", imageAlt = "Profile Photo", imageObjectFit = "cover", imageBorderRadius = "full", editIconSize = "sm", editIconPositionRight = "0px", editIconPositionBottom = "0px", isRound = true, boxStyle, isEditable = false, isView = false, style, handleIsView, fallbackText, revealOnHover = true, }) {
|
|
8
|
-
var _a, _b, _c, _d, _e
|
|
8
|
+
var _a, _b, _c, _d, _e;
|
|
9
9
|
const [photo, setPhoto] = useState(photoUrl);
|
|
10
10
|
const fileInputRef = useRef(null);
|
|
11
11
|
const theme = useCustomTheme();
|
|
12
|
-
const c =
|
|
12
|
+
const c = theme.colors;
|
|
13
13
|
const handlePhotoChange = (event) => {
|
|
14
14
|
var _a;
|
|
15
15
|
if (!isEditable)
|
|
@@ -35,37 +35,40 @@ export default function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth
|
|
|
35
35
|
// [800], not [300]: the edit IconButton's border is a control boundary — WCAG 1.4.11 needs
|
|
36
36
|
// >=3.0 against any named surface up to `muted` (lightest); [300] fails there, [800] clears
|
|
37
37
|
// all with margin.
|
|
38
|
-
const border =
|
|
38
|
+
const border = c.boxborder[500];
|
|
39
39
|
// Shared modern frame for whichever media we render (photo / pdf / fallback).
|
|
40
40
|
const mediaFrame = {
|
|
41
41
|
boxSize: imageWidth,
|
|
42
42
|
borderRadius: imageBorderRadius,
|
|
43
43
|
border: `0.063rem solid ${border}`,
|
|
44
|
-
boxShadow: (
|
|
44
|
+
boxShadow: (_a = theme.shadows) === null || _a === void 0 ? void 0 : _a.sm,
|
|
45
45
|
};
|
|
46
46
|
const renderMedia = () => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
48
47
|
if (photo) {
|
|
49
|
-
return isPdf ? (_jsx(Box, { ...mediaFrame, bg:
|
|
48
|
+
return isPdf ? (_jsx(Box, { ...mediaFrame, bg: c.gray[100], color: accentTextOnCanvas(c.gray, c.gray[100]), display: "flex", alignItems: "center", justifyContent: "center", overflow: "hidden", children: _jsx(FileText, { size: "45%" }) })) : (_jsx(Image, { src: photo, alt: imageAlt, objectFit: imageObjectFit, ...mediaFrame }));
|
|
50
49
|
}
|
|
51
50
|
// Fallback: branded tinted avatar (initials or user glyph).
|
|
52
|
-
return (_jsx(Box, { ...mediaFrame, display: "flex", alignItems: "center", justifyContent: "center", bg:
|
|
51
|
+
return (_jsx(Box, { ...mediaFrame, display: "flex", alignItems: "center", justifyContent: "center", bg: c.primary.opacity[16], color: accentTextOnCanvas(c.primary, c.backgroundColor.main), children: fallbackText ? (_jsx(Text, { fontSize: "1.75rem", fontWeight: 700, lineHeight: "1", children: fallbackText })) : (_jsx(User, { size: "48%" })) }));
|
|
53
52
|
};
|
|
54
53
|
const hasActions = isEditable || isView;
|
|
55
54
|
return (_jsxs(Box, { position: "relative", display: "inline-block", style: boxStyle, borderRadius: imageBorderRadius, transition: "box-shadow 0.2s ease", sx: {
|
|
56
55
|
"&:hover .ppv-overlay": { opacity: 1 },
|
|
57
56
|
"&:hover .ppv-actions": { opacity: 1 },
|
|
58
57
|
"&:hover .ppv-media": {
|
|
59
|
-
boxShadow: `0 0 0 0.1875rem ${
|
|
58
|
+
boxShadow: `0 0 0 0.1875rem ${c.primary.opacity[24]}`,
|
|
60
59
|
},
|
|
61
|
-
}, children: [_jsx(Box, { className: "ppv-media", borderRadius: imageBorderRadius, transition: "box-shadow 0.2s ease", children: renderMedia() }), hasActions && (_jsxs(_Fragment, { children: [_jsx(Box, { className: "ppv-overlay", position: "absolute", inset: 0, borderRadius: imageBorderRadius, bg: "blackAlpha.300", opacity: 0, transition: "opacity 0.2s ease", pointerEvents: "none" }), _jsxs(HStack, { className: "ppv-actions", position: "absolute", right: editIconPositionRight, bottom: editIconPositionBottom, transform: "translate(-15%, -15%)", spacing: 1.5, opacity: revealOnHover ? 0 : 1, transition: "opacity 0.2s ease", children: [isEditable && (_jsx(Tooltip, { label: "Edit", "aria-label": "Edit", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(SquarePen, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleClick, "aria-label": "Edit photo", bg:
|
|
62
|
-
bg:
|
|
60
|
+
}, children: [_jsx(Box, { className: "ppv-media", borderRadius: imageBorderRadius, transition: "box-shadow 0.2s ease", children: renderMedia() }), hasActions && (_jsxs(_Fragment, { children: [_jsx(Box, { className: "ppv-overlay", position: "absolute", inset: 0, borderRadius: imageBorderRadius, bg: "blackAlpha.300", opacity: 0, transition: "opacity 0.2s ease", pointerEvents: "none" }), _jsxs(HStack, { className: "ppv-actions", position: "absolute", right: editIconPositionRight, bottom: editIconPositionBottom, transform: "translate(-15%, -15%)", spacing: 1.5, opacity: revealOnHover ? 0 : 1, transition: "opacity 0.2s ease", children: [isEditable && (_jsx(Tooltip, { label: "Edit", "aria-label": "Edit", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(SquarePen, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleClick, "aria-label": "Edit photo", bg: c.primary[500], color: onFilled(c.primary[500], c.white, c.black), border: `0.125rem solid ${c.background[50]}`, boxShadow: (_b = theme.shadows) === null || _b === void 0 ? void 0 : _b.md, style: style, transition: "transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease", _hover: {
|
|
61
|
+
bg: c.primary[600],
|
|
62
|
+
color: onFilled(c.primary[600], c.white, c.black),
|
|
63
63
|
transform: "scale(1.1)",
|
|
64
|
-
boxShadow: (
|
|
65
|
-
}, _active: {
|
|
66
|
-
bg:
|
|
67
|
-
color: (
|
|
64
|
+
boxShadow: (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.lg,
|
|
65
|
+
}, _active: {
|
|
66
|
+
bg: c.primary[700],
|
|
67
|
+
color: onFilled(c.primary[700], c.white, c.black),
|
|
68
|
+
} }) })), isView && (_jsx(Tooltip, { label: "View", "aria-label": "View", hasArrow: true, children: _jsx(IconButton, { icon: _jsx(Eye, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleIsView, "aria-label": "View photo", bg: c.background[50], color: c.text[700], border: `0.063rem solid ${border}`, boxShadow: (_d = theme.shadows) === null || _d === void 0 ? void 0 : _d.md, style: style, transition: "transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease", _hover: {
|
|
69
|
+
bg: c.gray[50],
|
|
70
|
+
color: accentTextOnCanvas(c.primary, c.gray[50]),
|
|
68
71
|
transform: "scale(1.1)",
|
|
69
|
-
boxShadow: (
|
|
70
|
-
}, _active: { bg:
|
|
72
|
+
boxShadow: (_e = theme.shadows) === null || _e === void 0 ? void 0 : _e.lg,
|
|
73
|
+
}, _active: { bg: c.gray[100] } }) }))] }), isEditable && (_jsx(Input, { type: "file", accept: "image/*", onChange: handlePhotoChange, hidden: true, ref: fileInputRef }))] }))] }));
|
|
71
74
|
}
|
|
@@ -4,7 +4,7 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
|
4
4
|
import { TextLabel } from "../Common/FormLabel.js";
|
|
5
5
|
const RadioButton = ({ label, colorScheme, isChecked, onChange, isDisabled, size, value, defaultChecked, labelFontSize = "0.75rem", labelClampLines = 2, showLabelTooltip = (label || "").length > 18, labelTooltip = label, }) => {
|
|
6
6
|
const theme = useCustomTheme();
|
|
7
|
-
return (_jsx(ChakraRadio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.
|
|
7
|
+
return (_jsx(ChakraRadio, { colorScheme: colorScheme, isChecked: isChecked, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], borderWidth: "1.6px", _hover: {
|
|
8
8
|
borderColor: theme.colors.primary[500],
|
|
9
9
|
backgroundColor: theme.colors.background[100],
|
|
10
10
|
}, sx: {
|