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
|
@@ -5,7 +5,6 @@ exports.liftToContrast = liftToContrast;
|
|
|
5
5
|
exports.withOutlineRung = withOutlineRung;
|
|
6
6
|
exports.resolveHoverTint = resolveHoverTint;
|
|
7
7
|
const color_1 = require("./color");
|
|
8
|
-
const accentText_1 = require("./accentText");
|
|
9
8
|
/**
|
|
10
9
|
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
11
10
|
* all — same value the SideBar ladder, Accordion, and NavigationBar hover states are held to.
|
|
@@ -15,23 +14,27 @@ exports.MIN_PERCEPTIBLE_STEP = 1.15;
|
|
|
15
14
|
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
16
15
|
exports.AA_NON_TEXT = 3;
|
|
17
16
|
/**
|
|
18
|
-
* Walks a hex toward `target` contrast against `backdrop`, keeping
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* Walks a hex toward `target` contrast against `backdrop`, keeping hue and saturation.
|
|
18
|
+
* Direction is DERIVED from the backdrop, never passed: a mode argument here was redundant
|
|
19
|
+
* with the backdrop in every call site, and a redundant argument is one that can be wrong.
|
|
20
|
+
* Tries the far side first, falls back to the near side, and stops at the first passing step.
|
|
21
21
|
*/
|
|
22
|
-
function liftToContrast(hex, backdrop,
|
|
22
|
+
function liftToContrast(hex, backdrop, target = exports.AA_NON_TEXT) {
|
|
23
23
|
if ((0, color_1.contrastRatio)(hex, backdrop) >= target)
|
|
24
24
|
return hex;
|
|
25
|
-
const { s } = (0, color_1.hexToHsl)(hex);
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
l
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
const { s, l: start } = (0, color_1.hexToHsl)(hex);
|
|
26
|
+
const away = (0, color_1.relativeLuminance)(backdrop) < 0.5 ? 1 : -1;
|
|
27
|
+
for (const step of [away, -away]) {
|
|
28
|
+
let l = start;
|
|
29
|
+
while (l > 0 && l < 100) {
|
|
30
|
+
l += step;
|
|
31
|
+
const next = (0, color_1.withLightness)(hex, l, s);
|
|
32
|
+
if ((0, color_1.contrastRatio)(next, backdrop) >= target)
|
|
33
|
+
return next;
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
|
-
|
|
36
|
+
const ends = [(0, color_1.withLightness)(hex, 100, s), (0, color_1.withLightness)(hex, 0, s)];
|
|
37
|
+
return (0, color_1.contrastRatio)(ends[0], backdrop) >= (0, color_1.contrastRatio)(ends[1], backdrop) ? ends[0] : ends[1];
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
@@ -42,7 +45,7 @@ function liftToContrast(hex, backdrop, mode, target = exports.AA_NON_TEXT) {
|
|
|
42
45
|
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
43
46
|
* and outside 1.4.11.
|
|
44
47
|
*/
|
|
45
|
-
function withOutlineRung(palette
|
|
48
|
+
function withOutlineRung(palette) {
|
|
46
49
|
const current = palette.boxborder[500];
|
|
47
50
|
// The border sits between the control's fill and the surface behind it; hold it to the
|
|
48
51
|
// harder of the two.
|
|
@@ -50,7 +53,7 @@ function withOutlineRung(palette, mode) {
|
|
|
50
53
|
(0, color_1.contrastRatio)(current, palette.background[50])
|
|
51
54
|
? palette.backgroundColor.main
|
|
52
55
|
: palette.background[50];
|
|
53
|
-
const resolved = liftToContrast(current, backdrop
|
|
56
|
+
const resolved = liftToContrast(current, backdrop);
|
|
54
57
|
if (resolved === current)
|
|
55
58
|
return palette;
|
|
56
59
|
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
@@ -64,6 +67,5 @@ function withOutlineRung(palette, mode) {
|
|
|
64
67
|
* its OWN list background, not necessarily the page canvas.
|
|
65
68
|
*/
|
|
66
69
|
function resolveHoverTint(seed, restSurface) {
|
|
67
|
-
|
|
68
|
-
return liftToContrast(seed, restSurface, mode, exports.MIN_PERCEPTIBLE_STEP);
|
|
70
|
+
return liftToContrast(seed, restSurface, exports.MIN_PERCEPTIBLE_STEP);
|
|
69
71
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AA_NON_TEXT } from "./outlineRung";
|
|
2
|
+
import type { PaletteProps } from "../types";
|
|
3
|
+
/** Placeholder text measured 4.32:1 on a card for 8 of 9 brands — text, so held to 4.5:1. */
|
|
4
|
+
export declare function withPlaceholderRung(palette: PaletteProps): PaletteProps;
|
|
5
|
+
/** The hover row is a SURFACE, so it steps away from the ink rather than the ink moving. */
|
|
6
|
+
export declare function withTableHoverRung(palette: PaletteProps): PaletteProps;
|
|
7
|
+
export { AA_NON_TEXT };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AA_NON_TEXT = void 0;
|
|
4
|
+
exports.withPlaceholderRung = withPlaceholderRung;
|
|
5
|
+
exports.withTableHoverRung = withTableHoverRung;
|
|
6
|
+
const outlineRung_1 = require("./outlineRung");
|
|
7
|
+
Object.defineProperty(exports, "AA_NON_TEXT", { enumerable: true, get: function () { return outlineRung_1.AA_NON_TEXT; } });
|
|
8
|
+
const accentText_1 = require("./accentText");
|
|
9
|
+
/** Placeholder text measured 4.32:1 on a card for 8 of 9 brands — text, so held to 4.5:1. */
|
|
10
|
+
function withPlaceholderRung(palette) {
|
|
11
|
+
const resolved = (0, outlineRung_1.liftToContrast)(palette.placeholder[500], palette.background[50], accentText_1.AA_NORMAL_TEXT);
|
|
12
|
+
if (resolved === palette.placeholder[500])
|
|
13
|
+
return palette;
|
|
14
|
+
return { ...palette, placeholder: { ...palette.placeholder, 500: resolved } };
|
|
15
|
+
}
|
|
16
|
+
/** The hover row is a SURFACE, so it steps away from the ink rather than the ink moving. */
|
|
17
|
+
function withTableHoverRung(palette) {
|
|
18
|
+
const resolved = (0, outlineRung_1.liftToContrast)(palette.table.hover[500], palette.text[500], accentText_1.AA_NORMAL_TEXT);
|
|
19
|
+
if (resolved === palette.table.hover[500])
|
|
20
|
+
return palette;
|
|
21
|
+
return {
|
|
22
|
+
...palette,
|
|
23
|
+
table: { hover: { ...palette.table.hover, 500: resolved } },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SemanticColors, SemanticTextTokens, SemanticTone } from "../types";
|
|
2
|
+
export declare const SEMANTIC_TONES: readonly SemanticTone[];
|
|
3
|
+
/**
|
|
4
|
+
* `semantic[tone][500]` is a FILL rung — as ink on a light canvas it measures 1.84-3.68:1 across
|
|
5
|
+
* every brand. Each tone is stepped here until it clears AA as text, so a call site that wants
|
|
6
|
+
* "error-coloured text" cannot pick the unreadable one.
|
|
7
|
+
*/
|
|
8
|
+
export declare const buildSemanticText: (semantic: SemanticColors, canvas: string) => SemanticTextTokens;
|
|
9
|
+
/** Ink ON the fill, not on the canvas — the pair a CSS module needs but cannot compute. */
|
|
10
|
+
export declare const buildOnSemantic: (semantic: SemanticColors, white: string, black: string) => SemanticTextTokens;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildOnSemantic = exports.buildSemanticText = exports.SEMANTIC_TONES = void 0;
|
|
4
|
+
const outlineRung_1 = require("./outlineRung");
|
|
5
|
+
const accentText_1 = require("./accentText");
|
|
6
|
+
exports.SEMANTIC_TONES = ["success", "error", "warning", "info"];
|
|
7
|
+
/**
|
|
8
|
+
* `semantic[tone][500]` is a FILL rung — as ink on a light canvas it measures 1.84-3.68:1 across
|
|
9
|
+
* every brand. Each tone is stepped here until it clears AA as text, so a call site that wants
|
|
10
|
+
* "error-coloured text" cannot pick the unreadable one.
|
|
11
|
+
*/
|
|
12
|
+
const buildSemanticText = (semantic, canvas) => exports.SEMANTIC_TONES.reduce((acc, tone) => {
|
|
13
|
+
acc[tone] = (0, outlineRung_1.liftToContrast)(semantic[tone][500], canvas, accentText_1.AA_NORMAL_TEXT);
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
16
|
+
exports.buildSemanticText = buildSemanticText;
|
|
17
|
+
/** Ink ON the fill, not on the canvas — the pair a CSS module needs but cannot compute. */
|
|
18
|
+
const buildOnSemantic = (semantic, white, black) => exports.SEMANTIC_TONES.reduce((acc, tone) => {
|
|
19
|
+
acc[tone] = (0, accentText_1.onFilled)(semantic[tone][500], white, black);
|
|
20
|
+
return acc;
|
|
21
|
+
}, {});
|
|
22
|
+
exports.buildOnSemantic = buildOnSemantic;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BrandPaletteSource, ColorScale, SemanticColors, SidebarTokens } from "../types";
|
|
2
|
+
/** WCAG 1.4.3 — the active label is normal-size text. */
|
|
3
|
+
export declare const AA_NORMAL_TEXT = 4.5;
|
|
4
|
+
/** Lightest surface an active row reaches: Chakra `whiteAlpha.400` (0.24) on hover. */
|
|
5
|
+
export declare const ACTIVE_SURFACE_TINT = "#ffffff3d";
|
|
6
|
+
export declare const sidebarActiveSurface: (background: ColorScale) => string;
|
|
7
|
+
/** The rail never inverts, so both modes take the accent from the LIGHT primary. */
|
|
8
|
+
export declare const buildSidebarTokens: (background: ColorScale, lightPrimary: ColorScale, semantic: SemanticColors) => SidebarTokens;
|
|
9
|
+
export declare const withSidebarTokens: (source: BrandPaletteSource) => SidebarTokens;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withSidebarTokens = exports.buildSidebarTokens = exports.sidebarActiveSurface = exports.ACTIVE_SURFACE_TINT = exports.AA_NORMAL_TEXT = void 0;
|
|
4
|
+
const color_1 = require("./color");
|
|
5
|
+
const outlineRung_1 = require("./outlineRung");
|
|
6
|
+
const semanticText_1 = require("./semanticText");
|
|
7
|
+
/** WCAG 1.4.3 — the active label is normal-size text. */
|
|
8
|
+
exports.AA_NORMAL_TEXT = 4.5;
|
|
9
|
+
/** Lightest surface an active row reaches: Chakra `whiteAlpha.400` (0.24) on hover. */
|
|
10
|
+
exports.ACTIVE_SURFACE_TINT = "#ffffff3d";
|
|
11
|
+
const sidebarActiveSurface = (background) => (0, color_1.compositeOver)(exports.ACTIVE_SURFACE_TINT, background[500]);
|
|
12
|
+
exports.sidebarActiveSurface = sidebarActiveSurface;
|
|
13
|
+
/** The rail never inverts, so both modes take the accent from the LIGHT primary. */
|
|
14
|
+
const buildSidebarTokens = (background, lightPrimary, semantic) => {
|
|
15
|
+
const surface = (0, exports.sidebarActiveSurface)(background);
|
|
16
|
+
const elevated = (0, outlineRung_1.resolveHoverTint)(background[500], background[500]);
|
|
17
|
+
return {
|
|
18
|
+
background,
|
|
19
|
+
elevated,
|
|
20
|
+
activeIcon: (0, outlineRung_1.liftToContrast)(lightPrimary[300], surface, outlineRung_1.AA_NON_TEXT),
|
|
21
|
+
activeLabel: (0, outlineRung_1.liftToContrast)(lightPrimary[100], surface, exports.AA_NORMAL_TEXT),
|
|
22
|
+
mutedIcon: (0, outlineRung_1.liftToContrast)(background[300], elevated, outlineRung_1.AA_NON_TEXT),
|
|
23
|
+
mutedLabel: (0, outlineRung_1.liftToContrast)(background[100], elevated, exports.AA_NORMAL_TEXT),
|
|
24
|
+
semanticText: (0, semanticText_1.buildSemanticText)(semantic, elevated),
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.buildSidebarTokens = buildSidebarTokens;
|
|
28
|
+
const withSidebarTokens = (source) => (0, exports.buildSidebarTokens)(source.sidebar.background, source.primary, source.semantic);
|
|
29
|
+
exports.withSidebarTokens = withSidebarTokens;
|
|
@@ -22,8 +22,8 @@ function resolveStatusTone(scale, mode) {
|
|
|
22
22
|
const edgeSeed = mode === "dark" ? scale[400] : scale[300];
|
|
23
23
|
return {
|
|
24
24
|
bg,
|
|
25
|
-
fg: (0, outlineRung_1.liftToContrast)(inkSeed, bg,
|
|
26
|
-
border: (0, outlineRung_1.liftToContrast)(edgeSeed, bg,
|
|
25
|
+
fg: (0, outlineRung_1.liftToContrast)(inkSeed, bg, accentText_1.AA_NORMAL_TEXT),
|
|
26
|
+
border: (0, outlineRung_1.liftToContrast)(edgeSeed, bg, outlineRung_1.AA_NON_TEXT),
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
@@ -32,8 +32,7 @@ function resolveStatusTone(scale, mode) {
|
|
|
32
32
|
* dark. Darkening the fill keeps the intended hue and the white-initials look while clearing AA.
|
|
33
33
|
*/
|
|
34
34
|
function resolveAvatarFill(hex, target = accentText_1.AA_NORMAL_TEXT) {
|
|
35
|
-
|
|
36
|
-
return (0, outlineRung_1.liftToContrast)(hex, "#ffffff", "light", target);
|
|
35
|
+
return (0, outlineRung_1.liftToContrast)(hex, "#ffffff", target);
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
38
|
* Hue set for generated avatars. Values are seeds, not final fills — always pass them through
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PaletteProps } from "../types";
|
|
2
|
+
export declare const namedSurfaces: (palette: PaletteProps) => string[];
|
|
3
|
+
/** The surface an ink is closest to — clearing it clears every other one. */
|
|
4
|
+
export declare const hardestSurface: (ink: string, surfaces: string[]) => string;
|
|
5
|
+
export declare function withSurfaceRungs(palette: PaletteProps): PaletteProps;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hardestSurface = exports.namedSurfaces = void 0;
|
|
4
|
+
exports.withSurfaceRungs = withSurfaceRungs;
|
|
5
|
+
const color_1 = require("./color");
|
|
6
|
+
const outlineRung_1 = require("./outlineRung");
|
|
7
|
+
const accentText_1 = require("./accentText");
|
|
8
|
+
const semanticText_1 = require("./semanticText");
|
|
9
|
+
const namedSurfaces = (palette) => [
|
|
10
|
+
...Object.values(palette.backgroundColor),
|
|
11
|
+
palette.background[50],
|
|
12
|
+
palette.table.hover[500],
|
|
13
|
+
];
|
|
14
|
+
exports.namedSurfaces = namedSurfaces;
|
|
15
|
+
/** The surface an ink is closest to — clearing it clears every other one. */
|
|
16
|
+
const hardestSurface = (ink, surfaces) => surfaces.reduce((worst, s) => (0, color_1.contrastRatio)(ink, s) < (0, color_1.contrastRatio)(ink, worst) ? s : worst);
|
|
17
|
+
exports.hardestSurface = hardestSurface;
|
|
18
|
+
// Runs last: `table.hover` is one of the surfaces, and it settles in its own rung.
|
|
19
|
+
function withSurfaceRungs(palette) {
|
|
20
|
+
const surfaces = (0, exports.namedSurfaces)(palette);
|
|
21
|
+
const lift = (ink, target) => (0, outlineRung_1.liftToContrast)(ink, (0, exports.hardestSurface)(ink, surfaces), target);
|
|
22
|
+
const semanticText = semanticText_1.SEMANTIC_TONES.reduce((acc, tone) => {
|
|
23
|
+
acc[tone] = lift(palette.semanticText[tone], accentText_1.AA_NORMAL_TEXT);
|
|
24
|
+
return acc;
|
|
25
|
+
}, {});
|
|
26
|
+
return {
|
|
27
|
+
...palette,
|
|
28
|
+
textMuted: lift(palette.textMuted, accentText_1.AA_NORMAL_TEXT),
|
|
29
|
+
accentText: (0, accentText_1.pickAccentText)(palette.primary, (0, exports.hardestSurface)(palette.accentText, surfaces)),
|
|
30
|
+
semanticText,
|
|
31
|
+
text: { ...palette.text, 500: lift(palette.text[500], accentText_1.AA_NORMAL_TEXT) },
|
|
32
|
+
header: { ...palette.header, 500: lift(palette.header[500], accentText_1.AA_NORMAL_TEXT) },
|
|
33
|
+
placeholder: {
|
|
34
|
+
...palette.placeholder,
|
|
35
|
+
500: lift(palette.placeholder[500], accentText_1.AA_NORMAL_TEXT),
|
|
36
|
+
},
|
|
37
|
+
boxborder: { ...palette.boxborder, 500: lift(palette.boxborder[500], outlineRung_1.AA_NON_TEXT) },
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -30,12 +30,10 @@ export type OpacityScale = {
|
|
|
30
30
|
export type BrandScale = ColorScale & {
|
|
31
31
|
opacity: OpacityScale;
|
|
32
32
|
};
|
|
33
|
-
export type
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
info: ColorScale;
|
|
38
|
-
};
|
|
33
|
+
export type SemanticTone = "success" | "error" | "warning" | "info";
|
|
34
|
+
export type SemanticColors = Record<SemanticTone, ColorScale>;
|
|
35
|
+
/** Each tone as TEXT on the canvas, resolved to 4.5:1. The `[500]` rung is a fill, never ink. */
|
|
36
|
+
export type SemanticTextTokens = Record<SemanticTone, string>;
|
|
39
37
|
/** Named (non-numeric) surface keys. Elevation order inverts between light and dark. */
|
|
40
38
|
export type NamedSurfaces = {
|
|
41
39
|
main: string;
|
|
@@ -51,6 +49,22 @@ export type NamedSurfaces = {
|
|
|
51
49
|
base: string;
|
|
52
50
|
tableHeader: string;
|
|
53
51
|
};
|
|
52
|
+
/** The permanently-dark rail. Accents are derived from the light primary, never hand-written. */
|
|
53
|
+
export type SidebarTokens = {
|
|
54
|
+
background: ColorScale;
|
|
55
|
+
/** Icon on the active surface, resolved to 3:1. */
|
|
56
|
+
activeIcon: string;
|
|
57
|
+
/** Label on the active surface, resolved to 4.5:1. */
|
|
58
|
+
activeLabel: string;
|
|
59
|
+
/** Flyout/menu surface raised off the rail. `background[200]` is a mid-grey on 6 of 9 brands. */
|
|
60
|
+
elevated: string;
|
|
61
|
+
/** Secondary icon on the rail, resolved to 3:1. Replaces an opacity guess at the call site. */
|
|
62
|
+
mutedIcon: string;
|
|
63
|
+
/** Secondary label on the rail, resolved to 4.5:1. `textMuted` is canvas-relative, not rail. */
|
|
64
|
+
mutedLabel: string;
|
|
65
|
+
/** Status ink resolved against the RAIL. `semanticText` is canvas-relative, not rail. */
|
|
66
|
+
semanticText: SemanticTextTokens;
|
|
67
|
+
};
|
|
54
68
|
export type BoxShadowTokens = {
|
|
55
69
|
primary: string;
|
|
56
70
|
error: string;
|
|
@@ -88,9 +102,7 @@ export type PaletteProps = {
|
|
|
88
102
|
header: ColorScale;
|
|
89
103
|
placeholder: ColorScale;
|
|
90
104
|
boxShadow: BoxShadowTokens;
|
|
91
|
-
sidebar:
|
|
92
|
-
background: ColorScale;
|
|
93
|
-
};
|
|
105
|
+
sidebar: SidebarTokens;
|
|
94
106
|
boxborder: ColorScale;
|
|
95
107
|
border: ColorScale;
|
|
96
108
|
table: {
|
|
@@ -101,12 +113,28 @@ export type PaletteProps = {
|
|
|
101
113
|
* Accent color for accent-COLORED TEXT on the canvas. Distinct from `primary[500]`, which
|
|
102
114
|
* must stay dark enough to carry a white label on a filled button and therefore cannot also
|
|
103
115
|
* be light enough to read as text on a dark canvas. Derived per brand (see `pickAccentText`).
|
|
104
|
-
*
|
|
105
|
-
* Optional so that a consumer who hand-builds a palette object against this type keeps
|
|
106
|
-
* compiling; every shipped brand palette always populates it.
|
|
107
116
|
*/
|
|
108
|
-
accentText
|
|
117
|
+
accentText: string;
|
|
118
|
+
semanticText: SemanticTextTokens;
|
|
119
|
+
/** Secondary text on the canvas, resolved to 4.5:1 in both modes. */
|
|
120
|
+
textMuted: string;
|
|
121
|
+
/** Ink for a `primary[500]`-FILLED surface — never an ink on the canvas. */
|
|
122
|
+
onPrimary: string;
|
|
123
|
+
/** Ink for a `semantic[tone][500]`-FILLED surface — never an ink on the canvas. */
|
|
124
|
+
onSemantic: SemanticTextTokens;
|
|
125
|
+
};
|
|
126
|
+
/** What a brand writes by hand; every token required, so a gap is a compile error. */
|
|
127
|
+
/** Derived tokens are excluded — `finalizeLightPalette` resolves them per brand. */
|
|
128
|
+
export type BrandPaletteSource = Omit<PaletteProps, "accentText" | "textMuted" | "semanticText" | "sidebar" | "onPrimary" | "onSemantic"> & {
|
|
129
|
+
sidebar: {
|
|
130
|
+
background: ColorScale;
|
|
131
|
+
};
|
|
109
132
|
};
|
|
133
|
+
/** Utility scales carrying no brand identity. The only tokens a brand may inherit. */
|
|
134
|
+
export type NeutralPaletteKey = "transparent" | "black" | "white" | "semantic" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
|
|
135
|
+
export type NeutralPaletteTokens = Pick<BrandPaletteSource, NeutralPaletteKey>;
|
|
136
|
+
/** Everything a brand must state itself — never by spreading another brand. */
|
|
137
|
+
export type BrandIdentityTokens = Omit<BrandPaletteSource, NeutralPaletteKey>;
|
|
110
138
|
/** Brand identities shipped by the library. */
|
|
111
139
|
export type ThemeName = "lavender" | "meadow" | "radiant" | "skyline" | "slate" | "emerald" | "rosewood" | "storefront" | "zinc";
|
|
112
140
|
/** User-selectable color mode. `system` follows the OS setting. */
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCustomTheme = void 0;
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
|
+
const assertPalette_1 = require("./assertPalette");
|
|
5
6
|
const useCustomTheme = () => {
|
|
6
|
-
|
|
7
|
+
const theme = (0, react_1.useTheme)();
|
|
8
|
+
(0, assertPalette_1.assertPixelizePalette)(theme);
|
|
9
|
+
return theme;
|
|
7
10
|
};
|
|
8
11
|
exports.useCustomTheme = useCustomTheme;
|
package/dist/Utils/table.d.ts
CHANGED
|
@@ -18,13 +18,7 @@ export type TablePaletteColor = {
|
|
|
18
18
|
};
|
|
19
19
|
/** Deterministic, theme-aware color palette for groups + status pills. */
|
|
20
20
|
export declare function buildTablePalette(theme: CustomThemeProps): TablePaletteColor[];
|
|
21
|
-
/**
|
|
22
|
-
* Pick a deterministic palette color for a value, with optional override hex.
|
|
23
|
-
*
|
|
24
|
-
* `theme` is optional so existing callers that don't have it keep compiling — when omitted,
|
|
25
|
-
* `onSolid` falls back to the mode-stable absolutes ("#FFFFFF"/"#000000", same value
|
|
26
|
-
* `theme.colors.white`/`black` resolve to for every brand) instead of going undefined.
|
|
27
|
-
*/
|
|
21
|
+
/** Pick a deterministic palette color for a value, with optional consumer override hex. */
|
|
28
22
|
export declare function pickTableColor(value: string | number, palette: TablePaletteColor[], override?: string, theme?: CustomThemeProps): TablePaletteColor;
|
|
29
23
|
export type TableGroup = {
|
|
30
24
|
value: string | number;
|
package/dist/Utils/table.js
CHANGED
|
@@ -45,6 +45,7 @@ exports.useDebounce = useDebounce;
|
|
|
45
45
|
exports.globalSearchFilter = globalSearchFilter;
|
|
46
46
|
const react_1 = __importStar(require("react"));
|
|
47
47
|
const accentText_1 = require("../Theme/tokens/builders/accentText");
|
|
48
|
+
const statusTone_1 = require("../Theme/tokens/builders/statusTone");
|
|
48
49
|
// Built once, not per comparison: sorting 10k rows runs this ~130k times, and constructing a
|
|
49
50
|
// collator is orders of magnitude dearer than using one.
|
|
50
51
|
const COLLATOR = new Intl.Collator(undefined, {
|
|
@@ -98,33 +99,31 @@ function SortMultiColumnData(data, sortConfig) {
|
|
|
98
99
|
});
|
|
99
100
|
}
|
|
100
101
|
const withAlpha = (hex, aa) => /^#([0-9a-fA-F]{6})$/.test(hex) ? `${hex}${aa}` : hex;
|
|
101
|
-
const FALLBACK_SOLID = "#8B3FC8";
|
|
102
102
|
/** Deterministic, theme-aware color palette for groups + status pills. */
|
|
103
103
|
function buildTablePalette(theme) {
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(_p = c.orange) === null || _p === void 0 ? void 0 : _p[500],
|
|
118
|
-
(_q = c.purple) === null || _q === void 0 ? void 0 : _q[500],
|
|
104
|
+
const c = theme.colors;
|
|
105
|
+
const mode = (0, accentText_1.isDarkCanvas)(c.backgroundColor.main) ? "dark" : "light";
|
|
106
|
+
const scales = [
|
|
107
|
+
c.primary,
|
|
108
|
+
c.semantic.success,
|
|
109
|
+
c.semantic.info,
|
|
110
|
+
c.semantic.warning,
|
|
111
|
+
c.teal,
|
|
112
|
+
c.blue,
|
|
113
|
+
c.pink,
|
|
114
|
+
c.semantic.error,
|
|
115
|
+
c.orange,
|
|
116
|
+
c.purple,
|
|
119
117
|
];
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
118
|
+
return scales.map((scale) => {
|
|
119
|
+
const tone = (0, statusTone_1.resolveStatusTone)(scale, mode);
|
|
120
|
+
return {
|
|
121
|
+
solid: scale[500],
|
|
122
|
+
soft: tone.bg,
|
|
123
|
+
text: tone.fg,
|
|
124
|
+
onSolid: (0, accentText_1.onFilled)(scale[500], c.white, c.black),
|
|
125
|
+
};
|
|
126
|
+
});
|
|
128
127
|
}
|
|
129
128
|
const hashKey = (value) => {
|
|
130
129
|
const s = String(value);
|
|
@@ -133,22 +132,15 @@ const hashKey = (value) => {
|
|
|
133
132
|
h = (h * 31 + s.charCodeAt(i)) >>> 0;
|
|
134
133
|
return h;
|
|
135
134
|
};
|
|
136
|
-
/**
|
|
137
|
-
* Pick a deterministic palette color for a value, with optional override hex.
|
|
138
|
-
*
|
|
139
|
-
* `theme` is optional so existing callers that don't have it keep compiling — when omitted,
|
|
140
|
-
* `onSolid` falls back to the mode-stable absolutes ("#FFFFFF"/"#000000", same value
|
|
141
|
-
* `theme.colors.white`/`black` resolve to for every brand) instead of going undefined.
|
|
142
|
-
*/
|
|
135
|
+
/** Pick a deterministic palette color for a value, with optional consumer override hex. */
|
|
143
136
|
function pickTableColor(value, palette, override, theme) {
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
const black = ((_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b.black) || "#000000";
|
|
137
|
+
const white = theme ? theme.colors.white : accentText_1.DEFAULT_WHITE;
|
|
138
|
+
const black = theme ? theme.colors.black : accentText_1.DEFAULT_BLACK;
|
|
147
139
|
if (override) {
|
|
148
140
|
return { solid: override, soft: withAlpha(override, "22"), text: override, onSolid: (0, accentText_1.onFilled)(override, white, black) };
|
|
149
141
|
}
|
|
150
142
|
if (!palette.length) {
|
|
151
|
-
|
|
143
|
+
throw new Error("pickTableColor: empty palette — build it with buildTablePalette(theme).");
|
|
152
144
|
}
|
|
153
145
|
return palette[hashKey(value) % palette.length];
|
|
154
146
|
}
|
|
@@ -3,31 +3,29 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { Accordion as ChakraAccordian, AccordionItem, AccordionButton, AccordionPanel, Box, Flex, } from "@chakra-ui/react";
|
|
4
4
|
import { ChevronDown } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
|
-
import {
|
|
6
|
+
import { isDarkCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
7
7
|
import { getAccordionHoverColors } from "./accordionColors.js";
|
|
8
8
|
const Accordion = ({ allowMultiple, allowToggle, index, onChange, reduceMotion, items, ...rest }) => {
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const bodyColor = (_l = (_k = c.text) === null || _k === void 0 ? void 0 : _k[600]) !== null && _l !== void 0 ? _l : (_m = c.gray) === null || _m === void 0 ? void 0 : _m[600];
|
|
16
|
-
const { expandedBg, softHover } = useMemo(() => { var _a; return getAccordionHoverColors((_a = theme.colors) !== null && _a !== void 0 ? _a : {}, isDark); }, [theme.colors, isDark]);
|
|
9
|
+
const { colors } = useCustomTheme();
|
|
10
|
+
const isDark = isDarkCanvas(colors.backgroundColor.main);
|
|
11
|
+
const border = colors.boxborder[300];
|
|
12
|
+
const headingColor = colors.text[800];
|
|
13
|
+
const bodyColor = colors.text[600];
|
|
14
|
+
const { expandedBg, softHover } = useMemo(() => getAccordionHoverColors(colors, isDark), [colors, isDark]);
|
|
17
15
|
return (_jsx(ChakraAccordian, { allowMultiple: allowMultiple, allowToggle: allowToggle, index: index, onChange: onChange, reduceMotion: reduceMotion, ...rest, children: items.map((item, idx) => {
|
|
18
|
-
var _a
|
|
19
|
-
return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg:
|
|
20
|
-
var _a, _b, _c
|
|
16
|
+
var _a;
|
|
17
|
+
return (_jsx(AccordionItem, { border: `0.063rem solid ${border}`, borderRadius: "xl", bg: colors.background[50], mb: 3, overflow: "hidden", transition: "border-color 0.15s ease, box-shadow 0.15s ease", _last: { mb: 0 }, _hover: { borderColor: colors.boxborder[400] }, ...item.itemProps, sx: (_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.itemStyle, children: ({ isExpanded }) => {
|
|
18
|
+
var _a, _b, _c;
|
|
21
19
|
return (_jsxs(_Fragment, { children: [_jsx("h2", { children: _jsxs(AccordionButton, { px: 4, py: 3, gap: 3, fontSize: "0.875rem", fontWeight: 600, color: headingColor, bg: isExpanded ? expandedBg : "transparent", transition: "background 0.15s ease", _hover: { bg: isExpanded ? expandedBg : softHover }, _focusVisible: {
|
|
22
20
|
boxShadow: "none",
|
|
23
|
-
outline: `0.125rem solid ${
|
|
21
|
+
outline: `0.125rem solid ${colors.primary[300]}`,
|
|
24
22
|
outlineOffset: "-0.125rem",
|
|
25
23
|
}, ...item.buttonProps, sx: {
|
|
26
|
-
...(
|
|
24
|
+
...(_a = item.customStyles) === null || _a === void 0 ? void 0 : _a.buttonStyle,
|
|
27
25
|
"&:hover": {
|
|
28
|
-
...(
|
|
26
|
+
...(_b = item.customStyles) === null || _b === void 0 ? void 0 : _b.hoverbuttonStyle,
|
|
29
27
|
},
|
|
30
|
-
}, children: [_jsx(Box, { as: "span", flex: "1", textAlign: "left", children: item.header }), _jsx(Flex, { align: "center", justify: "center", boxSize: "1.5rem", flexShrink: 0, borderRadius: "md", color: isExpanded ?
|
|
28
|
+
}, children: [_jsx(Box, { as: "span", flex: "1", textAlign: "left", children: item.header }), _jsx(Flex, { align: "center", justify: "center", boxSize: "1.5rem", flexShrink: 0, borderRadius: "md", color: isExpanded ? colors.accentText : colors.textMuted, bg: isExpanded ? colors.primary.opacity[16] : "transparent", transform: isExpanded ? "rotate(180deg)" : "rotate(0deg)", transition: "transform 0.2s ease, color 0.2s ease, background 0.2s ease", children: _jsx(ChevronDown, { size: 16 }) })] }) }), _jsx(AccordionPanel, { px: 4, pt: 1, pb: 4, fontSize: "0.875rem", lineHeight: "1.5", color: bodyColor, ...item.panelProps, sx: (_c = item.customStyles) === null || _c === void 0 ? void 0 : _c.panelStyle, children: item.content })] }));
|
|
31
29
|
} }, idx));
|
|
32
30
|
}) }));
|
|
33
31
|
};
|
|
@@ -9,22 +9,19 @@ import { liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
|
9
9
|
*/
|
|
10
10
|
const MIN_HOVER_STEP = 1.15;
|
|
11
11
|
export const getAccordionHoverColors = (colors, isDark) => {
|
|
12
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
13
12
|
if (isDark) {
|
|
14
13
|
// primary.opacity[8] composited over the dark canvas collapses to ~1.07:1 (near-black on
|
|
15
14
|
// near-black) — gray[200] is an opaque rung that stays visibly above canvas (~1.6:1) without
|
|
16
15
|
// being as loud as the gray[300] hover fill FilterSidebar/Table already use.
|
|
17
16
|
return {
|
|
18
|
-
expandedBg:
|
|
19
|
-
softHover:
|
|
17
|
+
expandedBg: colors.gray[200],
|
|
18
|
+
softHover: colors.gray[200],
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
|
-
const rest =
|
|
23
|
-
const expandedTint = (
|
|
24
|
-
? compositeOver(colors.primary.opacity[8], rest)
|
|
25
|
-
: ((_s = (_r = colors.gray) === null || _r === void 0 ? void 0 : _r[50]) !== null && _s !== void 0 ? _s : rest);
|
|
21
|
+
const rest = colors.background[50];
|
|
22
|
+
const expandedTint = compositeOver(colors.primary.opacity[8], rest);
|
|
26
23
|
return {
|
|
27
|
-
expandedBg: liftToContrast(expandedTint, rest,
|
|
28
|
-
softHover: liftToContrast(
|
|
24
|
+
expandedBg: liftToContrast(expandedTint, rest, MIN_HOVER_STEP),
|
|
25
|
+
softHover: liftToContrast(colors.table.hover[100], rest, MIN_HOVER_STEP),
|
|
29
26
|
};
|
|
30
27
|
};
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { AlertDialog as ChakraAlertDialog, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, Button, } from "@chakra-ui/react";
|
|
3
3
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
4
|
const AlertDialog = ({ isOpen, onClose, leastDestructiveRef, content, title, confirmButtonText = "Yes", cancelButtonText = "No", isConfirmLoading, onConfirm, ContentStyle, headerStyle, bodyStyle, footerStyle, closeButtonStyle, button1Style, button2Style, isCentered, key, }) => {
|
|
5
|
-
var _a;
|
|
6
5
|
const { colors } = useCustomTheme();
|
|
7
|
-
return (_jsxs(ChakraAlertDialog, { motionPreset: "slideInBottom", leastDestructiveRef: leastDestructiveRef, onClose: onClose, isOpen: isOpen, isCentered: isCentered, children: [_jsx(AlertDialogOverlay, {}), _jsxs(AlertDialogContent, { bg:
|
|
6
|
+
return (_jsxs(ChakraAlertDialog, { motionPreset: "slideInBottom", leastDestructiveRef: leastDestructiveRef, onClose: onClose, isOpen: isOpen, isCentered: isCentered, children: [_jsx(AlertDialogOverlay, {}), _jsxs(AlertDialogContent, { bg: colors.background[50], sx: ContentStyle, children: [_jsx(AlertDialogHeader, { sx: headerStyle, children: title }), _jsx(AlertDialogCloseButton, { sx: closeButtonStyle }), _jsx(AlertDialogBody, { sx: bodyStyle, children: content }), _jsxs(AlertDialogFooter, { sx: footerStyle, children: [_jsx(Button, { ref: leastDestructiveRef, onClick: onClose, variant: "outline", colorScheme: "red", size: "sm", sx: button1Style, children: cancelButtonText }), _jsx(Button, { colorScheme: "primary", onClick: onConfirm, isLoading: isConfirmLoading, ml: 3, size: "sm", sx: button2Style, children: confirmButtonText })] })] })] }, key));
|
|
8
7
|
};
|
|
9
8
|
export default AlertDialog;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import ReactApexChart from "react-apexcharts";
|
|
4
|
-
import {
|
|
4
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
5
5
|
import { getDefaultSeriesColors, mergeChartTitleStyle, } from "../../../Theme/tokens/builders/chartColorsFromTheme.js";
|
|
6
6
|
import { baseAxisLabels, baseChart, baseGrid, baseLegend, baseTooltip } from "../chartBase.js";
|
|
7
7
|
const ApexAreaChart = ({ variant = "basic", data, series, labels, title, titlePosition = "left", height = 320, width = "100%", colors, showLegend = true, legendPosition = "bottom", yAxisFormatter, }) => {
|
|
8
|
-
const
|
|
9
|
-
const palette = theme.colors;
|
|
8
|
+
const { colors: palette } = useCustomTheme();
|
|
10
9
|
const seriesColors = useMemo(() => colors !== null && colors !== void 0 ? colors : getDefaultSeriesColors(palette), [colors, palette]);
|
|
11
10
|
const resolvedSeries = useMemo(() => series !== null && series !== void 0 ? series : [{ name: title !== null && title !== void 0 ? title : "Series 1", data: data !== null && data !== void 0 ? data : [] }], [series, data, title]);
|
|
12
11
|
const isSpark = variant === "sparkline";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import ReactApexChart from "react-apexcharts";
|
|
4
|
-
import {
|
|
4
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
5
5
|
import { chartInk, chartMode, getDefaultSeriesColors, labelOnSeries, mergeChartTitleStyle, } from "../../../Theme/tokens/builders/chartColorsFromTheme.js";
|
|
6
6
|
import { baseChart, baseLegend, baseTooltip } from "../chartBase.js";
|
|
7
7
|
const getValidLegendPosition = (position) => {
|
|
@@ -14,8 +14,7 @@ const getValidLegendPosition = (position) => {
|
|
|
14
14
|
};
|
|
15
15
|
const ApexPieChart = ({ data, labels, title, height = 400, width = 500, donutColors, chartColor, titlePosition = "center", titleStyle, legendPosition = "bottom", legendStyle, variant = "pie", showDataLabels = true, minLabelPercent = 8, surfaceColor, donutSize = "68%", totalLabel = "Total", labelPlacement = "auto", }) => {
|
|
16
16
|
var _a;
|
|
17
|
-
const
|
|
18
|
-
const palette = theme.colors;
|
|
17
|
+
const { colors: palette } = useCustomTheme();
|
|
19
18
|
const ink = chartInk(palette);
|
|
20
19
|
const gap = surfaceColor !== null && surfaceColor !== void 0 ? surfaceColor : ink.surface;
|
|
21
20
|
const mergedTitleStyle = useMemo(() => mergeChartTitleStyle(palette, titleStyle), [palette, titleStyle]);
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import ReactApexChart from "react-apexcharts";
|
|
4
|
-
import {
|
|
4
|
+
import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
5
5
|
import { chartInk, getDefaultSeriesColors, mergeChartTitleStyle, } from "../../../Theme/tokens/builders/chartColorsFromTheme.js";
|
|
6
6
|
import { baseChart, baseLegend } from "../chartBase.js";
|
|
7
7
|
const ApexRadialChart = ({ variant = "gauge", data, labels, title, titlePosition = "left", height = 320, width = "100%", colors, totalLabel = "Total", trackColor, hollowSize = "62%", }) => {
|
|
8
|
-
const
|
|
9
|
-
const palette = theme.colors;
|
|
8
|
+
const { colors: palette } = useCustomTheme();
|
|
10
9
|
const ink = chartInk(palette);
|
|
11
10
|
const seriesColors = useMemo(() => colors !== null && colors !== void 0 ? colors : getDefaultSeriesColors(palette), [colors, palette]);
|
|
12
11
|
const options = useMemo(() => ({
|