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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const semantic = {
|
|
2
|
+
success: {
|
|
3
|
+
50: "#e9f8ef",
|
|
4
|
+
100: "#bbe9cc",
|
|
5
|
+
200: "#9adeb4",
|
|
6
|
+
300: "#6ccf92",
|
|
7
|
+
400: "#4fc67d",
|
|
8
|
+
500: "#23b85c",
|
|
9
|
+
600: "#20a754",
|
|
10
|
+
700: "#198341",
|
|
11
|
+
800: "#136533",
|
|
12
|
+
900: "#0f4d27",
|
|
13
|
+
},
|
|
14
|
+
error: {
|
|
15
|
+
50: "#feedeb",
|
|
16
|
+
100: "#fbc6c2",
|
|
17
|
+
200: "#f9aaa4",
|
|
18
|
+
300: "#f6837b",
|
|
19
|
+
400: "#f56b61",
|
|
20
|
+
500: "#f2463a",
|
|
21
|
+
600: "#dc4035",
|
|
22
|
+
700: "#ac3229",
|
|
23
|
+
800: "#852720",
|
|
24
|
+
900: "#661d18",
|
|
25
|
+
},
|
|
26
|
+
warning: {
|
|
27
|
+
50: "#fff4ef",
|
|
28
|
+
100: "#ffddce",
|
|
29
|
+
200: "#ffccb7",
|
|
30
|
+
300: "#ffb596",
|
|
31
|
+
400: "#ffa781",
|
|
32
|
+
500: "#ff9162",
|
|
33
|
+
600: "#e88459",
|
|
34
|
+
700: "#b56746",
|
|
35
|
+
800: "#8c5036",
|
|
36
|
+
900: "#6b3d29",
|
|
37
|
+
},
|
|
38
|
+
info: {
|
|
39
|
+
50: "#eff9fc",
|
|
40
|
+
100: "#cdedf5",
|
|
41
|
+
200: "#b5e4f0",
|
|
42
|
+
300: "#94d7e9",
|
|
43
|
+
400: "#7fd0e5",
|
|
44
|
+
500: "#5fc4de",
|
|
45
|
+
600: "#56b2ea",
|
|
46
|
+
700: "#438b9e",
|
|
47
|
+
800: "#346c78",
|
|
48
|
+
900: "#28525d",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const red = {
|
|
52
|
+
50: "#feedeb", 100: "#fbc6c2", 200: "#f9aaa4", 300: "#f6837b",
|
|
53
|
+
400: "#f56b61", 500: "#f2463a", 600: "#dc4035", 700: "#ac3229",
|
|
54
|
+
800: "#852720", 900: "#661d18",
|
|
55
|
+
};
|
|
56
|
+
const orange = {
|
|
57
|
+
50: "#fff4ef", 100: "#ffddce", 200: "#ffccb7", 300: "#ffb596",
|
|
58
|
+
400: "#ffa781", 500: "#ff9162", 600: "#e88459", 700: "#b56746",
|
|
59
|
+
800: "#8c5036", 900: "#6b3d29",
|
|
60
|
+
};
|
|
61
|
+
const yellow = {
|
|
62
|
+
50: "#fefbec", 100: "#fdf1c5", 200: "#fbeba9", 300: "#fae281",
|
|
63
|
+
400: "#f9dc69", 500: "#f7d343", 600: "#e1c03d", 700: "#af9630",
|
|
64
|
+
800: "#887425", 900: "#68591c",
|
|
65
|
+
};
|
|
66
|
+
const green = {
|
|
67
|
+
50: "#e9f8ef", 100: "#bbe9cc", 200: "#9adeb4", 300: "#6ccf92",
|
|
68
|
+
400: "#4fc67d", 500: "#23b85c", 600: "#20a754", 700: "#198341",
|
|
69
|
+
800: "#136533", 900: "#0f4d27",
|
|
70
|
+
};
|
|
71
|
+
const teal = {
|
|
72
|
+
50: "#eff9fc", 100: "#cdedf5", 200: "#b5e4f0", 300: "#94d7e9",
|
|
73
|
+
400: "#7fd0e5", 500: "#5fc4de", 600: "#56b2ea", 700: "#438b9e",
|
|
74
|
+
800: "#346c78", 900: "#28525d",
|
|
75
|
+
};
|
|
76
|
+
const blue = {
|
|
77
|
+
50: "#ebf8ff", 100: "#bee3f8", 200: "#90cdf4", 300: "#63b3ed",
|
|
78
|
+
400: "#4299e1", 500: "#3182ce", 600: "#2b6cb0", 700: "#2c5282",
|
|
79
|
+
800: "#2a4365", 900: "#1a365d",
|
|
80
|
+
};
|
|
81
|
+
const cyan = {
|
|
82
|
+
50: "#edfdfd", 100: "#c4f1f9", 200: "#9decf9", 300: "#76e4f7",
|
|
83
|
+
400: "#0bc5ea", 500: "#00b5d8", 600: "#00a3c4", 700: "#0987a0",
|
|
84
|
+
800: "#086f83", 900: "#065666",
|
|
85
|
+
};
|
|
86
|
+
const purple = {
|
|
87
|
+
50: "#faf5ff", 100: "#e9d8fd", 200: "#d6bcfa", 300: "#b794f4",
|
|
88
|
+
400: "#9f7aea", 500: "#805ad5", 600: "#6b46c1", 700: "#553c9a",
|
|
89
|
+
800: "#44337a", 900: "#322659",
|
|
90
|
+
};
|
|
91
|
+
const pink = {
|
|
92
|
+
50: "#fff5f7", 100: "#fed7e2", 200: "#fbb6ce", 300: "#f687b3",
|
|
93
|
+
400: "#ed64a6", 500: "#d53f8c", 600: "#b83280", 700: "#97266d",
|
|
94
|
+
800: "#702459", 900: "#521b41",
|
|
95
|
+
};
|
|
96
|
+
/** Non-brand shadow tints. Only `primary` is brand-derived. */
|
|
97
|
+
export const sharedBoxShadow = {
|
|
98
|
+
error: "#F2463A47",
|
|
99
|
+
default: "#00000033",
|
|
100
|
+
};
|
|
101
|
+
/** Utility scales shared by every brand — never theme-specific. */
|
|
102
|
+
export const neutralTokens = {
|
|
103
|
+
transparent: "transparent",
|
|
104
|
+
black: "#000",
|
|
105
|
+
white: "#fff",
|
|
106
|
+
semantic,
|
|
107
|
+
red,
|
|
108
|
+
orange,
|
|
109
|
+
yellow,
|
|
110
|
+
green,
|
|
111
|
+
teal,
|
|
112
|
+
blue,
|
|
113
|
+
cyan,
|
|
114
|
+
purple,
|
|
115
|
+
pink,
|
|
116
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { neutralTokens, sharedBoxShadow } from "../neutrals.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
|
+
import { buildBrandInk } from "../../builders/brandInk.js";
|
|
3
4
|
const PRIMARY_500 = "#cf4e3a"; // warm red (terracotta leaning)
|
|
4
5
|
const primary = {
|
|
5
6
|
50: "#fdf1ee",
|
|
@@ -15,7 +16,8 @@ const primary = {
|
|
|
15
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
16
17
|
};
|
|
17
18
|
const palette = {
|
|
18
|
-
...
|
|
19
|
+
...neutralTokens,
|
|
20
|
+
...buildBrandInk(PRIMARY_500),
|
|
19
21
|
// Stops retuned so white gradient-button text (onGradient, accentText.ts) clears AA at both
|
|
20
22
|
// ends — the original pair let white drop to 4.37/2.15 against from/to. Same hue, darker.
|
|
21
23
|
// Both nudged one step further (4.509/4.502 -> 4.601/4.617): the first pass cleared AA by
|
|
@@ -123,8 +125,7 @@ const palette = {
|
|
|
123
125
|
},
|
|
124
126
|
boxShadow: {
|
|
125
127
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
126
|
-
|
|
127
|
-
default: lavenderPalette.boxShadow.default,
|
|
128
|
+
...sharedBoxShadow,
|
|
128
129
|
},
|
|
129
130
|
};
|
|
130
131
|
export default palette;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { neutralTokens, sharedBoxShadow } from "../neutrals.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
|
+
import { buildBrandInk } from "../../builders/brandInk.js";
|
|
3
4
|
const PRIMARY_500 = "#d16a7e"; // muted warm rose (not neon pink)
|
|
4
5
|
const primary = {
|
|
5
6
|
50: "#fdf2f5",
|
|
@@ -15,7 +16,8 @@ const primary = {
|
|
|
15
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
16
17
|
};
|
|
17
18
|
const palette = {
|
|
18
|
-
...
|
|
19
|
+
...neutralTokens,
|
|
20
|
+
...buildBrandInk(PRIMARY_500),
|
|
19
21
|
// Stops retuned so white gradient-button text (onGradient, accentText.ts) clears AA at both
|
|
20
22
|
// ends — the original pair let white drop to 3.46/2.69 against from/to. Same hue, darker.
|
|
21
23
|
// Both nudged one step further (4.520/4.505 -> 4.609/4.607): the first pass cleared AA by
|
|
@@ -127,8 +129,7 @@ const palette = {
|
|
|
127
129
|
},
|
|
128
130
|
boxShadow: {
|
|
129
131
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
130
|
-
|
|
131
|
-
default: lavenderPalette.boxShadow.default,
|
|
132
|
+
...sharedBoxShadow,
|
|
132
133
|
},
|
|
133
134
|
};
|
|
134
135
|
export default palette;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { neutralTokens, sharedBoxShadow } from "../neutrals.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
|
+
import { buildBrandInk } from "../../builders/brandInk.js";
|
|
3
4
|
const PRIMARY_500 = "#1a3a6b"; // was #0088cc — deep navy
|
|
4
5
|
const primary = {
|
|
5
6
|
50: "#e8ecf4",
|
|
@@ -15,7 +16,8 @@ const primary = {
|
|
|
15
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
16
17
|
};
|
|
17
18
|
const palette = {
|
|
18
|
-
...
|
|
19
|
+
...neutralTokens,
|
|
20
|
+
...buildBrandInk(PRIMARY_500),
|
|
19
21
|
// `to` stop retuned so white gradient-button text (onGradient, accentText.ts) clears AA — the
|
|
20
22
|
// original let white drop to 2.14 there (`from` already passed at 11.28, unchanged).
|
|
21
23
|
// Nudged one step further (4.515 -> 4.600): the first pass cleared AA by <0.02, too thin a
|
|
@@ -121,8 +123,7 @@ const palette = {
|
|
|
121
123
|
},
|
|
122
124
|
boxShadow: {
|
|
123
125
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
124
|
-
|
|
125
|
-
default: lavenderPalette.boxShadow.default,
|
|
126
|
+
...sharedBoxShadow,
|
|
126
127
|
},
|
|
127
128
|
};
|
|
128
129
|
export default palette;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { neutralTokens, sharedBoxShadow } from "../neutrals.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
|
+
import { buildBrandInk } from "../../builders/brandInk.js";
|
|
3
4
|
const PRIMARY_500 = "#6b7280"; // was #475569 — pure neutral gray, no blue cast
|
|
4
5
|
const primary = {
|
|
5
6
|
50: "#f9fafb",
|
|
@@ -15,7 +16,8 @@ const primary = {
|
|
|
15
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
16
17
|
};
|
|
17
18
|
const palette = {
|
|
18
|
-
...
|
|
19
|
+
...neutralTokens,
|
|
20
|
+
...buildBrandInk(PRIMARY_500),
|
|
19
21
|
// `to` stop retuned so white gradient-button text (onGradient, accentText.ts) clears AA — the
|
|
20
22
|
// original let white drop to 2.98 there (`from` already passed at 4.83, unchanged).
|
|
21
23
|
// Nudged one step further (4.520 -> 4.608): the first pass cleared AA by <0.02, too thin a
|
|
@@ -102,7 +104,7 @@ const palette = {
|
|
|
102
104
|
200: "#f1f1f3",
|
|
103
105
|
300: "#ebebed",
|
|
104
106
|
400: "#e5e5e8",
|
|
105
|
-
500: "#
|
|
107
|
+
500: "#dfdfe2",
|
|
106
108
|
600: "#cbcbcf",
|
|
107
109
|
700: "#a0a0a5",
|
|
108
110
|
800: "#787880",
|
|
@@ -125,8 +127,7 @@ const palette = {
|
|
|
125
127
|
},
|
|
126
128
|
boxShadow: {
|
|
127
129
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
128
|
-
|
|
129
|
-
default: lavenderPalette.boxShadow.default,
|
|
130
|
+
...sharedBoxShadow,
|
|
130
131
|
},
|
|
131
132
|
};
|
|
132
133
|
export default palette;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { neutralTokens, sharedBoxShadow } from "../neutrals.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
|
+
import { buildBrandInk } from "../../builders/brandInk.js";
|
|
3
4
|
const PRIMARY_500 = "#004f4b"; // deep spruce teal — storefront/retail brand anchor
|
|
4
5
|
const primary = {
|
|
5
6
|
50: "#eafaf9",
|
|
@@ -15,7 +16,8 @@ const primary = {
|
|
|
15
16
|
opacity: buildPrimaryOpacity(PRIMARY_500),
|
|
16
17
|
};
|
|
17
18
|
const palette = {
|
|
18
|
-
...
|
|
19
|
+
...neutralTokens,
|
|
20
|
+
...buildBrandInk(PRIMARY_500),
|
|
19
21
|
// Same hue as primary, darker stop for the "to" end — mirrors emerald's gradient pattern.
|
|
20
22
|
// White gradient-button text verified AA at both stops (4.98 / 6.96).
|
|
21
23
|
gradient: { from: "#0c7d77", to: "#095e90" }, // spruce teal → deep blue
|
|
@@ -115,8 +117,7 @@ const palette = {
|
|
|
115
117
|
},
|
|
116
118
|
boxShadow: {
|
|
117
119
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
118
|
-
|
|
119
|
-
default: lavenderPalette.boxShadow.default,
|
|
120
|
+
...sharedBoxShadow,
|
|
120
121
|
},
|
|
121
122
|
};
|
|
122
123
|
export default palette;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildDarkPalette } from "../../builders/buildDarkPalette.js";
|
|
2
2
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "../../builders/buildBrandTokens.js";
|
|
3
|
-
import { pickAccentText } from "../../builders/accentText.js";
|
|
3
|
+
import { pickAccentText, onFilled } from "../../builders/accentText.js";
|
|
4
4
|
import light from "./palette.light.js";
|
|
5
5
|
/**
|
|
6
6
|
* zinc dark is the shadcn dark look and INVERTS the primary: the filled button is near-white
|
|
@@ -192,7 +192,8 @@ const palette = {
|
|
|
192
192
|
placeholder,
|
|
193
193
|
disabled,
|
|
194
194
|
table,
|
|
195
|
-
accentText: pickAccentText(primary, derived.backgroundColor.main
|
|
195
|
+
accentText: pickAccentText(primary, derived.backgroundColor.main),
|
|
196
|
+
onPrimary: onFilled(PRIMARY_500, derived.white, derived.black),
|
|
196
197
|
boxShadow: {
|
|
197
198
|
primary: buildPrimaryShadowTint(PRIMARY_500),
|
|
198
199
|
error: derived.boxShadow.error,
|
|
@@ -2,19 +2,11 @@ import { contrastRatio, relativeLuminance } from "./color.js";
|
|
|
2
2
|
/** WCAG AA for normal-size text. Accent-as-text must clear this against the canvas. */
|
|
3
3
|
const AA_NORMAL_TEXT = 4.5;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Light canvases need darker rungs; dark canvases need lighter ones. Both walk 500 -> 900 because
|
|
10
|
-
* BOTH ramps put their light end at 900: light mode runs light -> dark (so 900 is the darkest),
|
|
11
|
-
* while every dark scale runs dark -> light (so 900 is the lightest). Same direction, opposite
|
|
12
|
-
* meaning — walking 500 -> 100 for dark would step toward the canvas and land at ~1.4 contrast.
|
|
5
|
+
* Ordered nearest-to-accent first, so brand identity survives as far as contrast allows.
|
|
6
|
+
* One order serves both modes: light ramps run light -> dark and dark ramps run dark -> light,
|
|
7
|
+
* so 500 -> 900 always steps AWAY from that mode's own canvas.
|
|
13
8
|
*/
|
|
14
|
-
const SEARCH_ORDER =
|
|
15
|
-
light: [500, 600, 700, 800, 900],
|
|
16
|
-
dark: [500, 600, 700, 800, 900],
|
|
17
|
-
};
|
|
9
|
+
const SEARCH_ORDER = [500, 600, 700, 800, 900];
|
|
18
10
|
/**
|
|
19
11
|
* Pick the accent rung to use for accent-COLORED TEXT sitting on the canvas.
|
|
20
12
|
*
|
|
@@ -32,20 +24,9 @@ const SEARCH_ORDER = {
|
|
|
32
24
|
* sparse test theme mock, a hand-built scale) — treat a missing rung as "doesn't clear AA" and
|
|
33
25
|
* keep walking rather than crashing `contrastRatio` on `undefined`.
|
|
34
26
|
*/
|
|
35
|
-
export const pickAccentText = (primary, canvas
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
return safeInk();
|
|
39
|
-
const order = SEARCH_ORDER[mode];
|
|
40
|
-
const found = order.find((rung) => primary[rung] != null && contrastRatio(primary[rung], canvas) >= AA_NORMAL_TEXT);
|
|
41
|
-
if (found !== undefined)
|
|
42
|
-
return primary[found];
|
|
43
|
-
for (let i = order.length - 1; i >= 0; i--) {
|
|
44
|
-
const rung = primary[order[i]];
|
|
45
|
-
if (rung != null)
|
|
46
|
-
return rung;
|
|
47
|
-
}
|
|
48
|
-
return safeInk();
|
|
27
|
+
export const pickAccentText = (primary, canvas) => {
|
|
28
|
+
const found = SEARCH_ORDER.find((rung) => contrastRatio(primary[rung], canvas) >= AA_NORMAL_TEXT);
|
|
29
|
+
return primary[found !== null && found !== void 0 ? found : SEARCH_ORDER[SEARCH_ORDER.length - 1]];
|
|
49
30
|
};
|
|
50
31
|
/** Canvas assumed when no Pixelize theme is mounted. Never painted; only fed to contrast math. */
|
|
51
32
|
export const DEFAULT_CANVAS = "#ffffff";
|
|
@@ -64,7 +45,7 @@ export const isDarkCanvas = (canvas) => relativeLuminance(canvas) < DARK_CANVAS_
|
|
|
64
45
|
* failures (radiant 4.15, emerald 3.24, rosewood 3.29). Those brands now step to the nearest rung
|
|
65
46
|
* that clears AA, which changes their light pixels — the accepted cost of meeting WCAG.
|
|
66
47
|
*/
|
|
67
|
-
export const accentTextOnCanvas = (scale, canvas) => pickAccentText(scale, canvas
|
|
48
|
+
export const accentTextOnCanvas = (scale, canvas) => pickAccentText(scale, canvas);
|
|
68
49
|
/**
|
|
69
50
|
* Ink for text drawn ON a filled swatch (a button/tag/badge fill), not the canvas. `white`/`black`
|
|
70
51
|
* must be the mode-stable absolutes (`theme.colors.white` / `theme.colors.black`) — NOT a
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { buildPrimaryOpacity } from "./buildBrandTokens.js";
|
|
2
|
+
import { hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
3
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
4
|
+
// Lavender's primary saturation. Each brand's ramps scale away from it.
|
|
5
|
+
const REFERENCE_SATURATION = 55.5;
|
|
6
|
+
const SECONDARY = {
|
|
7
|
+
50: [39.4, 0.8231],
|
|
8
|
+
100: [41.0, 0.61132],
|
|
9
|
+
200: [37.7, 0.39479],
|
|
10
|
+
300: [27.4, 0.18614],
|
|
11
|
+
400: [28.4, 0.10269],
|
|
12
|
+
500: [52.4, 0.00831],
|
|
13
|
+
600: [55.1, 0.00573],
|
|
14
|
+
700: [55.6, 0.00386],
|
|
15
|
+
800: [60.0, 0.00245],
|
|
16
|
+
900: [57.1, 0.00141],
|
|
17
|
+
};
|
|
18
|
+
const TEXT = {
|
|
19
|
+
50: [25.9, 0.86267],
|
|
20
|
+
100: [32.4, 0.63853],
|
|
21
|
+
200: [32.7, 0.48344],
|
|
22
|
+
300: [30.6, 0.30607],
|
|
23
|
+
400: [29.2, 0.21515],
|
|
24
|
+
500: [26.3, 0.10787],
|
|
25
|
+
600: [26.6, 0.08786],
|
|
26
|
+
700: [26.7, 0.05281],
|
|
27
|
+
800: [27.4, 0.03145],
|
|
28
|
+
900: [29.0, 0.01826],
|
|
29
|
+
};
|
|
30
|
+
const HEADER = {
|
|
31
|
+
50: [31.3, 0.83382],
|
|
32
|
+
100: [31.0, 0.59779],
|
|
33
|
+
200: [30.6, 0.44729],
|
|
34
|
+
300: [29.3, 0.27622],
|
|
35
|
+
400: [30.0, 0.19238],
|
|
36
|
+
500: [29.9, 0.10467],
|
|
37
|
+
600: [29.9, 0.08682],
|
|
38
|
+
700: [29.7, 0.05281],
|
|
39
|
+
800: [29.1, 0.0319],
|
|
40
|
+
900: [29.9, 0.01915],
|
|
41
|
+
};
|
|
42
|
+
const PLACEHOLDER = {
|
|
43
|
+
50: [30.4, 0.87913],
|
|
44
|
+
100: [35.4, 0.67128],
|
|
45
|
+
200: [36.1, 0.53513],
|
|
46
|
+
300: [34.7, 0.37333],
|
|
47
|
+
400: [31.4, 0.30462],
|
|
48
|
+
500: [28.2, 0.19307],
|
|
49
|
+
600: [22.8, 0.15818],
|
|
50
|
+
700: [22.0, 0.09196],
|
|
51
|
+
800: [21.5, 0.05448],
|
|
52
|
+
900: [22.3, 0.03206],
|
|
53
|
+
};
|
|
54
|
+
const DISABLED = {
|
|
55
|
+
50: [33.3, 0.90353],
|
|
56
|
+
100: [38.9, 0.80618],
|
|
57
|
+
200: [40.7, 0.71546],
|
|
58
|
+
300: [41.0, 0.60545],
|
|
59
|
+
400: [39.6, 0.53328],
|
|
60
|
+
500: [40.5, 0.43688],
|
|
61
|
+
600: [28.2, 0.35566],
|
|
62
|
+
700: [13.4, 0.20289],
|
|
63
|
+
800: [11.4, 0.1171],
|
|
64
|
+
900: [11.2, 0.06724],
|
|
65
|
+
};
|
|
66
|
+
// Lightness is monotonic in luminance for a fixed hue/saturation, so bisection converges.
|
|
67
|
+
const atLuminance = (anchor, saturation, target) => {
|
|
68
|
+
let low = 0;
|
|
69
|
+
let high = 100;
|
|
70
|
+
for (let i = 0; i < 30; i += 1) {
|
|
71
|
+
const mid = (low + high) / 2;
|
|
72
|
+
if (relativeLuminance(withLightness(anchor, mid, saturation)) < target)
|
|
73
|
+
low = mid;
|
|
74
|
+
else
|
|
75
|
+
high = mid;
|
|
76
|
+
}
|
|
77
|
+
return withLightness(anchor, (low + high) / 2, saturation);
|
|
78
|
+
};
|
|
79
|
+
const ramp = (anchor, profile) => {
|
|
80
|
+
const ratio = hexToHsl(anchor).s / REFERENCE_SATURATION;
|
|
81
|
+
const scale = {};
|
|
82
|
+
for (const rung of RUNGS) {
|
|
83
|
+
const [saturation, luminance] = profile[rung];
|
|
84
|
+
scale[rung] = atLuminance(anchor, Math.min(100, saturation * ratio), luminance);
|
|
85
|
+
}
|
|
86
|
+
return scale;
|
|
87
|
+
};
|
|
88
|
+
const brandRamp = (anchor, profile) => {
|
|
89
|
+
const scale = ramp(anchor, profile);
|
|
90
|
+
return { ...scale, opacity: buildPrimaryOpacity(scale[500]) };
|
|
91
|
+
};
|
|
92
|
+
/** Brand-hued ink ramps at lavender's verified luminances, so contrast carries over. */
|
|
93
|
+
export function buildBrandInk(primary500) {
|
|
94
|
+
const secondary = brandRamp(primary500, SECONDARY);
|
|
95
|
+
return {
|
|
96
|
+
secondary,
|
|
97
|
+
tertiary: { ...secondary },
|
|
98
|
+
text: ramp(primary500, TEXT),
|
|
99
|
+
header: ramp(primary500, HEADER),
|
|
100
|
+
placeholder: ramp(primary500, PLACEHOLDER),
|
|
101
|
+
disabled: ramp(primary500, DISABLED),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { buildPrimaryOpacity, buildPrimaryShadowTint } from "./buildBrandTokens.js";
|
|
2
2
|
import { contrastRatio, hexToHsl, hslToHex, withLightness } from "./color.js";
|
|
3
|
-
import { pickAccentText } from "./accentText.js";
|
|
3
|
+
import { pickAccentText, onFilled } from "./accentText.js";
|
|
4
|
+
import { withSidebarTokens } from "./sidebarAccent.js";
|
|
5
|
+
import { buildMutedText } from "./mutedText.js";
|
|
6
|
+
import { buildSemanticText, buildOnSemantic } from "./semanticText.js";
|
|
4
7
|
/**
|
|
5
8
|
* Derives a brand's dark palette from its light palette.
|
|
6
9
|
*
|
|
@@ -235,6 +238,12 @@ export function buildDarkPalette(light) {
|
|
|
235
238
|
]));
|
|
236
239
|
const white = light.white;
|
|
237
240
|
const primary = liftBrand(light.primary, white);
|
|
241
|
+
const semantic = {
|
|
242
|
+
success: liftAccent(light.semantic.success, white),
|
|
243
|
+
error: liftAccent(light.semantic.error, white),
|
|
244
|
+
warning: liftAccent(light.semantic.warning, white),
|
|
245
|
+
info: liftAccent(light.semantic.info, white),
|
|
246
|
+
};
|
|
238
247
|
return {
|
|
239
248
|
...light,
|
|
240
249
|
// Brand identity: hue preserved, accent lifted as far as the white label allows.
|
|
@@ -242,12 +251,7 @@ export function buildDarkPalette(light) {
|
|
|
242
251
|
secondary: liftBrand(light.secondary, white),
|
|
243
252
|
tertiary: liftBrand(light.tertiary, white),
|
|
244
253
|
gradient: light.gradient,
|
|
245
|
-
semantic
|
|
246
|
-
success: liftAccent(light.semantic.success, white),
|
|
247
|
-
error: liftAccent(light.semantic.error, white),
|
|
248
|
-
warning: liftAccent(light.semantic.warning, white),
|
|
249
|
-
info: liftAccent(light.semantic.info, white),
|
|
250
|
-
},
|
|
254
|
+
semantic,
|
|
251
255
|
// `white` stays white on purpose: it is the label color on filled buttons.
|
|
252
256
|
transparent: light.transparent,
|
|
253
257
|
black: light.black,
|
|
@@ -276,9 +280,13 @@ export function buildDarkPalette(light) {
|
|
|
276
280
|
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
277
281
|
// Derived from the LIFTED accent against the dark canvas: the lift stops at the white-label
|
|
278
282
|
// floor (~4.55), which leaves primary[500] short of AA as text, so text needs its own rung.
|
|
279
|
-
accentText: pickAccentText(primary, namedSurfaces.main
|
|
283
|
+
accentText: pickAccentText(primary, namedSurfaces.main),
|
|
284
|
+
textMuted: buildMutedText(fromTargets(hueSource, TEXT_TARGETS, TEXT_SAT), namedSurfaces.main),
|
|
285
|
+
semanticText: buildSemanticText(semantic, namedSurfaces.main),
|
|
286
|
+
onPrimary: onFilled(primary[500], light.white, light.black),
|
|
287
|
+
onSemantic: buildOnSemantic(semantic, light.white, light.black),
|
|
280
288
|
// Sidebar is already near-black in light mode, so it needs no inversion.
|
|
281
|
-
sidebar: light
|
|
289
|
+
sidebar: withSidebarTokens(light),
|
|
282
290
|
boxShadow: {
|
|
283
291
|
primary: buildPrimaryShadowTint(primary[500]),
|
|
284
292
|
error: light.boxShadow.error,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { liftToContrast } from "./outlineRung.js";
|
|
2
|
+
/** WCAG 1.4.3 — muted is still body text. */
|
|
3
|
+
export const AA_NORMAL_TEXT = 4.5;
|
|
4
|
+
/** Seeded from the ramp's muted rung so brand tint survives, then lifted until it clears AA. */
|
|
5
|
+
export const buildMutedText = (text, canvas) => liftToContrast(text[400], canvas, AA_NORMAL_TEXT);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { contrastRatio, hexToHsl, withLightness } from "./color.js";
|
|
2
|
-
import { isDarkCanvas } from "./accentText.js";
|
|
1
|
+
import { contrastRatio, hexToHsl, relativeLuminance, withLightness } from "./color.js";
|
|
3
2
|
/**
|
|
4
3
|
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
5
4
|
* all — same value the SideBar ladder, Accordion, and NavigationBar hover states are held to.
|
|
@@ -9,23 +8,27 @@ export const MIN_PERCEPTIBLE_STEP = 1.15;
|
|
|
9
8
|
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
10
9
|
export const AA_NON_TEXT = 3;
|
|
11
10
|
/**
|
|
12
|
-
* Walks a hex toward `target` contrast against `backdrop`, keeping
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Walks a hex toward `target` contrast against `backdrop`, keeping hue and saturation.
|
|
12
|
+
* Direction is DERIVED from the backdrop, never passed: a mode argument here was redundant
|
|
13
|
+
* with the backdrop in every call site, and a redundant argument is one that can be wrong.
|
|
14
|
+
* Tries the far side first, falls back to the near side, and stops at the first passing step.
|
|
15
15
|
*/
|
|
16
|
-
export function liftToContrast(hex, backdrop,
|
|
16
|
+
export function liftToContrast(hex, backdrop, target = AA_NON_TEXT) {
|
|
17
17
|
if (contrastRatio(hex, backdrop) >= target)
|
|
18
18
|
return hex;
|
|
19
|
-
const { s } = hexToHsl(hex);
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
l
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
const { s, l: start } = hexToHsl(hex);
|
|
20
|
+
const away = relativeLuminance(backdrop) < 0.5 ? 1 : -1;
|
|
21
|
+
for (const step of [away, -away]) {
|
|
22
|
+
let l = start;
|
|
23
|
+
while (l > 0 && l < 100) {
|
|
24
|
+
l += step;
|
|
25
|
+
const next = withLightness(hex, l, s);
|
|
26
|
+
if (contrastRatio(next, backdrop) >= target)
|
|
27
|
+
return next;
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
|
-
|
|
30
|
+
const ends = [withLightness(hex, 100, s), withLightness(hex, 0, s)];
|
|
31
|
+
return contrastRatio(ends[0], backdrop) >= contrastRatio(ends[1], backdrop) ? ends[0] : ends[1];
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
34
|
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
@@ -36,7 +39,7 @@ export function liftToContrast(hex, backdrop, mode, target = AA_NON_TEXT) {
|
|
|
36
39
|
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
37
40
|
* and outside 1.4.11.
|
|
38
41
|
*/
|
|
39
|
-
export function withOutlineRung(palette
|
|
42
|
+
export function withOutlineRung(palette) {
|
|
40
43
|
const current = palette.boxborder[500];
|
|
41
44
|
// The border sits between the control's fill and the surface behind it; hold it to the
|
|
42
45
|
// harder of the two.
|
|
@@ -44,7 +47,7 @@ export function withOutlineRung(palette, mode) {
|
|
|
44
47
|
contrastRatio(current, palette.background[50])
|
|
45
48
|
? palette.backgroundColor.main
|
|
46
49
|
: palette.background[50];
|
|
47
|
-
const resolved = liftToContrast(current, backdrop
|
|
50
|
+
const resolved = liftToContrast(current, backdrop);
|
|
48
51
|
if (resolved === current)
|
|
49
52
|
return palette;
|
|
50
53
|
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
@@ -58,6 +61,5 @@ export function withOutlineRung(palette, mode) {
|
|
|
58
61
|
* its OWN list background, not necessarily the page canvas.
|
|
59
62
|
*/
|
|
60
63
|
export function resolveHoverTint(seed, restSurface) {
|
|
61
|
-
|
|
62
|
-
return liftToContrast(seed, restSurface, mode, MIN_PERCEPTIBLE_STEP);
|
|
64
|
+
return liftToContrast(seed, restSurface, MIN_PERCEPTIBLE_STEP);
|
|
63
65
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { liftToContrast, AA_NON_TEXT } from "./outlineRung.js";
|
|
2
|
+
import { AA_NORMAL_TEXT } from "./accentText.js";
|
|
3
|
+
/** Placeholder text measured 4.32:1 on a card for 8 of 9 brands — text, so held to 4.5:1. */
|
|
4
|
+
export function withPlaceholderRung(palette) {
|
|
5
|
+
const resolved = liftToContrast(palette.placeholder[500], palette.background[50], AA_NORMAL_TEXT);
|
|
6
|
+
if (resolved === palette.placeholder[500])
|
|
7
|
+
return palette;
|
|
8
|
+
return { ...palette, placeholder: { ...palette.placeholder, 500: resolved } };
|
|
9
|
+
}
|
|
10
|
+
/** The hover row is a SURFACE, so it steps away from the ink rather than the ink moving. */
|
|
11
|
+
export function withTableHoverRung(palette) {
|
|
12
|
+
const resolved = liftToContrast(palette.table.hover[500], palette.text[500], AA_NORMAL_TEXT);
|
|
13
|
+
if (resolved === palette.table.hover[500])
|
|
14
|
+
return palette;
|
|
15
|
+
return {
|
|
16
|
+
...palette,
|
|
17
|
+
table: { hover: { ...palette.table.hover, 500: resolved } },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export { AA_NON_TEXT };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { liftToContrast } from "./outlineRung.js";
|
|
2
|
+
import { AA_NORMAL_TEXT, onFilled } from "./accentText.js";
|
|
3
|
+
export const SEMANTIC_TONES = ["success", "error", "warning", "info"];
|
|
4
|
+
/**
|
|
5
|
+
* `semantic[tone][500]` is a FILL rung — as ink on a light canvas it measures 1.84-3.68:1 across
|
|
6
|
+
* every brand. Each tone is stepped here until it clears AA as text, so a call site that wants
|
|
7
|
+
* "error-coloured text" cannot pick the unreadable one.
|
|
8
|
+
*/
|
|
9
|
+
export const buildSemanticText = (semantic, canvas) => SEMANTIC_TONES.reduce((acc, tone) => {
|
|
10
|
+
acc[tone] = liftToContrast(semantic[tone][500], canvas, AA_NORMAL_TEXT);
|
|
11
|
+
return acc;
|
|
12
|
+
}, {});
|
|
13
|
+
/** Ink ON the fill, not on the canvas — the pair a CSS module needs but cannot compute. */
|
|
14
|
+
export const buildOnSemantic = (semantic, white, black) => SEMANTIC_TONES.reduce((acc, tone) => {
|
|
15
|
+
acc[tone] = onFilled(semantic[tone][500], white, black);
|
|
16
|
+
return acc;
|
|
17
|
+
}, {});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { compositeOver } from "./color.js";
|
|
2
|
+
import { liftToContrast, resolveHoverTint, AA_NON_TEXT } from "./outlineRung.js";
|
|
3
|
+
import { buildSemanticText } from "./semanticText.js";
|
|
4
|
+
/** WCAG 1.4.3 — the active label is normal-size text. */
|
|
5
|
+
export const AA_NORMAL_TEXT = 4.5;
|
|
6
|
+
/** Lightest surface an active row reaches: Chakra `whiteAlpha.400` (0.24) on hover. */
|
|
7
|
+
export const ACTIVE_SURFACE_TINT = "#ffffff3d";
|
|
8
|
+
export const sidebarActiveSurface = (background) => compositeOver(ACTIVE_SURFACE_TINT, background[500]);
|
|
9
|
+
/** The rail never inverts, so both modes take the accent from the LIGHT primary. */
|
|
10
|
+
export const buildSidebarTokens = (background, lightPrimary, semantic) => {
|
|
11
|
+
const surface = sidebarActiveSurface(background);
|
|
12
|
+
const elevated = resolveHoverTint(background[500], background[500]);
|
|
13
|
+
return {
|
|
14
|
+
background,
|
|
15
|
+
elevated,
|
|
16
|
+
activeIcon: liftToContrast(lightPrimary[300], surface, AA_NON_TEXT),
|
|
17
|
+
activeLabel: liftToContrast(lightPrimary[100], surface, AA_NORMAL_TEXT),
|
|
18
|
+
mutedIcon: liftToContrast(background[300], elevated, AA_NON_TEXT),
|
|
19
|
+
mutedLabel: liftToContrast(background[100], elevated, AA_NORMAL_TEXT),
|
|
20
|
+
semanticText: buildSemanticText(semantic, elevated),
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export const withSidebarTokens = (source) => buildSidebarTokens(source.sidebar.background, source.primary, source.semantic);
|