pixelize-design-library 2.4.2-beta.0 → 2.4.2-beta.1
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.js +3 -3
- 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 +4 -7
- 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/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/meadow/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/radiant/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/rosewood/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/skyline/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/slate/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/slate/palette.light.js +1 -1
- package/dist/Theme/tokens/brands/storefront/palette.light.d.ts +2 -373
- 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/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 +36 -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 +3 -3
- 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 +5 -8
- 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/index.js +28 -23
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +1 -1
- 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/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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paletteOf } from "./paletteFromTheme.js";
|
|
1
2
|
import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react";
|
|
2
3
|
import { sliderAnatomy } from "@chakra-ui/anatomy";
|
|
3
4
|
const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(sliderAnatomy.keys);
|
|
@@ -8,15 +9,12 @@ const $thumbBg = cssVar("slider-thumb-bg");
|
|
|
8
9
|
* every bare `<SliderThumb>` renders a literal white circle on the dark canvas regardless of mode,
|
|
9
10
|
* same bug class as Menu/Modal but without even the dead `_dark` branch.
|
|
10
11
|
*/
|
|
11
|
-
const baseStyle = definePartsStyle(({ theme }) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
});
|
|
12
|
+
const baseStyle = definePartsStyle(({ theme }) => ({
|
|
13
|
+
thumb: {
|
|
14
|
+
[$thumbBg.variable]: paletteOf(theme).backgroundColor.light,
|
|
15
|
+
bg: $thumbBg.reference,
|
|
16
|
+
},
|
|
17
|
+
}));
|
|
20
18
|
export const Slider = defineMultiStyleConfig({
|
|
21
19
|
baseStyle,
|
|
22
20
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { paletteOf } from "./paletteFromTheme.js";
|
|
1
2
|
import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react";
|
|
2
3
|
import { tabsAnatomy } from "@chakra-ui/anatomy";
|
|
3
4
|
const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(tabsAnatomy.keys);
|
|
@@ -10,26 +11,20 @@ const $border = cssVar("tabs-border-color");
|
|
|
10
11
|
* gated behind `_dark`, which this theme-swap app never triggers. Every selected `enclosed`/
|
|
11
12
|
* `enclosed-colored` tab renders a white seam/fill on the dark canvas.
|
|
12
13
|
*/
|
|
13
|
-
const variantEnclosed = definePartsStyle(({ theme }) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_selected: {
|
|
18
|
-
[$border.variable]: (_f = (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.light) !== null && _c !== void 0 ? _c : (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50]) !== null && _f !== void 0 ? _f : "#fff",
|
|
19
|
-
},
|
|
14
|
+
const variantEnclosed = definePartsStyle(({ theme }) => ({
|
|
15
|
+
tab: {
|
|
16
|
+
_selected: {
|
|
17
|
+
[$border.variable]: paletteOf(theme).backgroundColor.light,
|
|
20
18
|
},
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const variantEnclosedColored = definePartsStyle(({ theme }) => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_selected: {
|
|
28
|
-
[$bg.variable]: (_f = (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.light) !== null && _c !== void 0 ? _c : (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50]) !== null && _f !== void 0 ? _f : "#fff",
|
|
29
|
-
},
|
|
19
|
+
},
|
|
20
|
+
}));
|
|
21
|
+
const variantEnclosedColored = definePartsStyle(({ theme }) => ({
|
|
22
|
+
tab: {
|
|
23
|
+
_selected: {
|
|
24
|
+
[$bg.variable]: paletteOf(theme).backgroundColor.light,
|
|
30
25
|
},
|
|
31
|
-
}
|
|
32
|
-
});
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
33
28
|
export const Tabs = defineMultiStyleConfig({
|
|
34
29
|
variants: {
|
|
35
30
|
enclosed: variantEnclosed,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { paletteOf, scaleFor } from "./paletteFromTheme.js";
|
|
2
|
+
import { alertAnatomy } from "@chakra-ui/anatomy";
|
|
3
|
+
import { createMultiStyleConfigHelpers, cssVar, } from "@chakra-ui/react";
|
|
2
4
|
import { Button } from "../../Components/Button/Button.styles.js";
|
|
3
5
|
import { Checkbox } from "../../Components/Checkbox/Checkbox.styles.js";
|
|
4
6
|
import { Input } from "../../Components/Input/TextInput.styles.js";
|
|
@@ -27,14 +29,12 @@ const isHexColor = (color) => typeof color === "string" && /^#([0-9a-f]{3}|[0-9a
|
|
|
27
29
|
const Badge = {
|
|
28
30
|
variants: {
|
|
29
31
|
solid: ({ theme, colorScheme = "gray" }) => {
|
|
30
|
-
|
|
31
|
-
const swatch = (
|
|
32
|
-
const bg = swatch
|
|
33
|
-
const white = (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.white) !== null && _f !== void 0 ? _f : "#fff";
|
|
34
|
-
const black = (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.black) !== null && _h !== void 0 ? _h : "#000";
|
|
32
|
+
const palette = paletteOf(theme);
|
|
33
|
+
const swatch = scaleFor(palette, colorScheme);
|
|
34
|
+
const bg = swatch[500];
|
|
35
35
|
return {
|
|
36
36
|
bg,
|
|
37
|
-
color: isHexColor(bg) ? onFilled(bg, white, black) : swatch
|
|
37
|
+
color: isHexColor(bg) ? onFilled(bg, palette.white, palette.black) : swatch[800],
|
|
38
38
|
};
|
|
39
39
|
},
|
|
40
40
|
// Chakra's stock `subtle` picks its bg/color pair via `mode()`, keyed to Chakra's own
|
|
@@ -42,11 +42,11 @@ const Badge = {
|
|
|
42
42
|
// it always takes the light-mode branch. Applied to our mode-reversed dark scales, that
|
|
43
43
|
// branch's fixed rung pair (100/800) measures 4.06 in dark mode, just under AA.
|
|
44
44
|
subtle: ({ theme, colorScheme = "gray" }) => {
|
|
45
|
-
|
|
46
|
-
const swatch = (
|
|
47
|
-
const bg =
|
|
45
|
+
const palette = paletteOf(theme);
|
|
46
|
+
const swatch = scaleFor(palette, colorScheme);
|
|
47
|
+
const bg = swatch[100];
|
|
48
48
|
if (!isHexColor(bg))
|
|
49
|
-
return { bg, color: swatch
|
|
49
|
+
return { bg, color: swatch[800] };
|
|
50
50
|
// accentTextOnCanvas keeps brand hue by trying this scale's own rungs first, but some
|
|
51
51
|
// narrow-gamut hues (e.g. yellow) don't reach far enough at either end to clear AA against
|
|
52
52
|
// every bg they can land on in dark mode (measured 4.42 for a reversed-yellow badge) — its
|
|
@@ -56,9 +56,7 @@ const Badge = {
|
|
|
56
56
|
const accent = accentTextOnCanvas(swatch, bg);
|
|
57
57
|
if (contrastRatio(accent, bg) >= 4.5)
|
|
58
58
|
return { bg, color: accent };
|
|
59
|
-
|
|
60
|
-
const black = (_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.black) !== null && _j !== void 0 ? _j : "#000";
|
|
61
|
-
return { bg, color: onFilled(bg, white, black) };
|
|
59
|
+
return { bg, color: onFilled(bg, palette.white, palette.black) };
|
|
62
60
|
},
|
|
63
61
|
},
|
|
64
62
|
defaultProps: {
|
|
@@ -72,16 +70,35 @@ const Badge = {
|
|
|
72
70
|
// unfixed.
|
|
73
71
|
const FormError = {
|
|
74
72
|
baseStyle: ({ theme }) => {
|
|
75
|
-
var _a, _b, _c, _d;
|
|
76
73
|
// `icon` (FormErrorIcon) shares the same AA gap as `text` — both must be fixed together or
|
|
77
74
|
// the icon stays on Chakra's raw `red.500`.
|
|
78
|
-
const
|
|
75
|
+
const palette = paletteOf(theme);
|
|
76
|
+
const color = accentTextOnCanvas(palette.red, palette.backgroundColor.main);
|
|
79
77
|
return {
|
|
80
78
|
text: { color },
|
|
81
79
|
icon: { color },
|
|
82
80
|
};
|
|
83
81
|
},
|
|
84
82
|
};
|
|
83
|
+
const $alertFg = cssVar("alert-fg");
|
|
84
|
+
const $alertBg = cssVar("alert-bg");
|
|
85
|
+
const { defineMultiStyleConfig: defineAlertStyles, definePartsStyle: defineAlertParts } = createMultiStyleConfigHelpers(alertAnatomy.keys);
|
|
86
|
+
const Alert = defineAlertStyles({
|
|
87
|
+
variants: {
|
|
88
|
+
solid: defineAlertParts(({ theme, colorScheme = "gray" }) => {
|
|
89
|
+
const palette = paletteOf(theme);
|
|
90
|
+
const bg = scaleFor(palette, colorScheme)[500];
|
|
91
|
+
if (!isHexColor(bg))
|
|
92
|
+
return { container: {} };
|
|
93
|
+
return {
|
|
94
|
+
container: {
|
|
95
|
+
[$alertBg.variable]: bg,
|
|
96
|
+
[$alertFg.variable]: onFilled(bg, palette.white, palette.black),
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}),
|
|
100
|
+
},
|
|
101
|
+
});
|
|
85
102
|
const $tooltipBg = cssVar("tooltip-bg");
|
|
86
103
|
const $tooltipFg = cssVar("tooltip-fg");
|
|
87
104
|
/**
|
|
@@ -95,13 +112,10 @@ const $tooltipFg = cssVar("tooltip-fg");
|
|
|
95
112
|
* deliberately never remaps, so they stay a stable dark-bg/white-text pair in both modes.
|
|
96
113
|
*/
|
|
97
114
|
const Tooltip = {
|
|
98
|
-
baseStyle: ({ theme }) => {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
[$tooltipFg.variable]: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.white) !== null && _d !== void 0 ? _d : "colors.whiteAlpha.900",
|
|
103
|
-
});
|
|
104
|
-
},
|
|
115
|
+
baseStyle: ({ theme }) => ({
|
|
116
|
+
[$tooltipBg.variable]: theme.colors.black,
|
|
117
|
+
[$tooltipFg.variable]: theme.colors.white,
|
|
118
|
+
}),
|
|
105
119
|
};
|
|
106
120
|
const $skeletonStart = cssVar("skeleton-start-color");
|
|
107
121
|
const $skeletonEnd = cssVar("skeleton-end-color");
|
|
@@ -115,15 +129,12 @@ const $skeletonEnd = cssVar("skeleton-end-color");
|
|
|
115
129
|
* prop still wins via that mechanism, this only supplies the default the base style already owns.
|
|
116
130
|
*/
|
|
117
131
|
const Skeleton = {
|
|
118
|
-
baseStyle: ({ theme }) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
borderColor: $skeletonEnd.reference,
|
|
125
|
-
});
|
|
126
|
-
},
|
|
132
|
+
baseStyle: ({ theme }) => ({
|
|
133
|
+
[$skeletonStart.variable]: paletteOf(theme).gray[100],
|
|
134
|
+
[$skeletonEnd.variable]: paletteOf(theme).gray[300],
|
|
135
|
+
background: $skeletonStart.reference,
|
|
136
|
+
borderColor: $skeletonEnd.reference,
|
|
137
|
+
}),
|
|
127
138
|
};
|
|
128
139
|
// Chakra's `extendTheme` does not REPLACE a component's stock baseStyle when ours is also a
|
|
129
140
|
// function — it calls BOTH and deep-merges the two returned plain objects, key by key. Chakra's
|
|
@@ -139,12 +150,9 @@ const Skeleton = {
|
|
|
139
150
|
// behavior directly rather than only the function output).
|
|
140
151
|
const Radio = {
|
|
141
152
|
baseStyle: ({ theme, colorScheme }) => {
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const white = (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.white) !== null && _f !== void 0 ? _f : "#ffffff";
|
|
146
|
-
const black = (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.black) !== null && _h !== void 0 ? _h : "#000000";
|
|
147
|
-
const dot = onFilled(fill, white, black);
|
|
153
|
+
const palette = paletteOf(theme);
|
|
154
|
+
const fill = scaleFor(palette, colorScheme)[500];
|
|
155
|
+
const dot = onFilled(fill, palette.white, palette.black);
|
|
148
156
|
// A browser probe found the checked radio's hover repeating its own resting `fill` —
|
|
149
157
|
// Chakra's stock checked._hover (inherited from checkbox) lands on the SAME `bg`/`borderColor`
|
|
150
158
|
// keys we do, so extendTheme's merge is a scalar overwrite here, not a coexisting selector;
|
|
@@ -153,7 +161,7 @@ const Radio = {
|
|
|
153
161
|
const hoverFill = resolveHoverTint(fill, fill);
|
|
154
162
|
return {
|
|
155
163
|
control: {
|
|
156
|
-
borderColor:
|
|
164
|
+
borderColor: palette.boxborder[500],
|
|
157
165
|
_checked: {
|
|
158
166
|
bg: `${fill} !important`,
|
|
159
167
|
borderColor: `${fill} !important`,
|
|
@@ -187,16 +195,17 @@ const $closeButtonBg = cssVar("close-button-bg");
|
|
|
187
195
|
*/
|
|
188
196
|
const CloseButton = {
|
|
189
197
|
baseStyle: ({ theme }) => {
|
|
190
|
-
|
|
191
|
-
const dark = isDarkCanvas(
|
|
192
|
-
const alpha =
|
|
198
|
+
const palette = paletteOf(theme);
|
|
199
|
+
const dark = isDarkCanvas(palette.backgroundColor.main);
|
|
200
|
+
const alpha = scaleFor(palette, dark ? "whiteAlpha" : "blackAlpha");
|
|
193
201
|
return {
|
|
194
|
-
_hover: { [$closeButtonBg.variable]: alpha
|
|
195
|
-
_active: { [$closeButtonBg.variable]: alpha
|
|
202
|
+
_hover: { [$closeButtonBg.variable]: alpha[200] },
|
|
203
|
+
_active: { [$closeButtonBg.variable]: alpha[300] },
|
|
196
204
|
};
|
|
197
205
|
},
|
|
198
206
|
};
|
|
199
207
|
export const componentStyles = {
|
|
208
|
+
Alert,
|
|
200
209
|
Checkbox,
|
|
201
210
|
Radio,
|
|
202
211
|
Input,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { assertPixelizePalette } from "../assertPalette.js";
|
|
2
|
+
/** Chakra hands style functions an untyped theme; this is the boundary that makes it typed. */
|
|
3
|
+
export const paletteOf = (theme) => assertPixelizePalette(theme);
|
|
4
|
+
const asScale = (value) => typeof value === "object" && value !== null ? value : undefined;
|
|
5
|
+
/**
|
|
6
|
+
* `colorScheme` is a consumer-supplied Chakra scale name, so this lookup is genuinely dynamic —
|
|
7
|
+
* it can name a built-in we never themed. An unknown name resolves to the neutral ramp.
|
|
8
|
+
*/
|
|
9
|
+
export const scaleFor = (palette, colorScheme) => { var _a; return (_a = asScale(palette[colorScheme])) !== null && _a !== void 0 ? _a : palette.gray; };
|
|
@@ -109,6 +109,11 @@ export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRA
|
|
|
109
109
|
useLayoutEffect(() => {
|
|
110
110
|
document.documentElement.style.colorScheme = resolvedMode;
|
|
111
111
|
}, [resolvedMode]);
|
|
112
|
+
// Chakra's ColorModeProvider re-writes color-scheme in a passive effect, after the layout
|
|
113
|
+
// effect above, and forcedLightColorModeManager pins it to "light". Re-assert after it.
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
document.documentElement.style.colorScheme = resolvedMode;
|
|
116
|
+
}, [resolvedMode]);
|
|
112
117
|
// Held in refs so a caller's inline arrow never re-creates `setMode`/`setBrand`, which would
|
|
113
118
|
// invalidate the context value on every render of the consuming app. Written in a layout
|
|
114
119
|
// effect, not during render — a render-phase write is unsafe under StrictMode's double
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { lightPalettes, darkPalettes } from "../tokens/brands/index.js";
|
|
2
|
+
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
const deepMerge = (base, patch) => {
|
|
4
|
+
if (!isPlainObject(base) || !isPlainObject(patch))
|
|
5
|
+
return patch;
|
|
6
|
+
const out = { ...base };
|
|
7
|
+
for (const [key, value] of Object.entries(patch))
|
|
8
|
+
out[key] = deepMerge(base[key], value);
|
|
9
|
+
return out;
|
|
10
|
+
};
|
|
11
|
+
/** A complete palette for tests. Overrides layer onto a real brand, never replace a group. */
|
|
12
|
+
export const testPalette = (options = {}) => {
|
|
13
|
+
const { brand = "lavender", mode = "light", overrides = {} } = options;
|
|
14
|
+
const base = mode === "dark" ? darkPalettes[brand] : lightPalettes[brand];
|
|
15
|
+
return deepMerge(base, overrides);
|
|
16
|
+
};
|
|
17
|
+
export const testTheme = (options = {}) => ({
|
|
18
|
+
colors: testPalette(options),
|
|
19
|
+
});
|
|
@@ -16,23 +16,27 @@ import emeraldDark from "./emerald/palette.dark.js";
|
|
|
16
16
|
import rosewoodDark from "./rosewood/palette.dark.js";
|
|
17
17
|
import storefrontDark from "./storefront/palette.dark.js";
|
|
18
18
|
import zincDark from "./zinc/palette.dark.js";
|
|
19
|
-
import { pickAccentText } from "../builders/accentText.js";
|
|
19
|
+
import { pickAccentText, onFilled } from "../builders/accentText.js";
|
|
20
20
|
import { withOutlineRung } from "../builders/outlineRung.js";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
import { withSidebarTokens } from "../builders/sidebarAccent.js";
|
|
22
|
+
import { buildMutedText } from "../builders/mutedText.js";
|
|
23
|
+
import { buildSemanticText, buildOnSemantic } from "../builders/semanticText.js";
|
|
24
|
+
import { withPlaceholderRung, withTableHoverRung } from "../builders/resolvedRungs.js";
|
|
25
|
+
import { withSurfaceRungs } from "../builders/surfaceRungs.js";
|
|
26
|
+
/** Derived, never hand-written: a copied hex goes stale the moment a canvas moves. */
|
|
27
|
+
export const finalizeLightPalette = (source) => ({
|
|
28
|
+
...source,
|
|
29
|
+
sidebar: withSidebarTokens(source),
|
|
30
|
+
accentText: pickAccentText(source.primary, source.backgroundColor.main),
|
|
31
|
+
textMuted: buildMutedText(source.text, source.backgroundColor.main),
|
|
32
|
+
semanticText: buildSemanticText(source.semantic, source.backgroundColor.main),
|
|
33
|
+
onPrimary: onFilled(source.primary[500], source.white, source.black),
|
|
34
|
+
onSemantic: buildOnSemantic(source.semantic, source.white, source.black),
|
|
35
|
+
});
|
|
33
36
|
export { lavender, meadow, radiant, skyline, slate, emerald, rosewood, storefront, zinc };
|
|
34
37
|
export { lavenderDark, meadowDark, radiantDark, skylineDark, slateDark, emeraldDark, rosewoodDark, storefrontDark, zincDark, };
|
|
35
|
-
const
|
|
38
|
+
const resolveRungs = (palette) => withSurfaceRungs(withTableHoverRung(withPlaceholderRung(withOutlineRung(palette))));
|
|
39
|
+
const lightBrand = (source) => resolveRungs(finalizeLightPalette(source));
|
|
36
40
|
/** Light palette per brand. `lavender` is the base the other six extend. */
|
|
37
41
|
export const lightPalettes = {
|
|
38
42
|
lavender: lightBrand(lavender),
|
|
@@ -46,16 +50,17 @@ export const lightPalettes = {
|
|
|
46
50
|
zinc: lightBrand(zinc),
|
|
47
51
|
};
|
|
48
52
|
/** Dark palette per brand, derived from the matching light palette. */
|
|
53
|
+
const darkBrand = (dark) => resolveRungs(dark);
|
|
49
54
|
export const darkPalettes = {
|
|
50
|
-
lavender:
|
|
51
|
-
meadow:
|
|
52
|
-
radiant:
|
|
53
|
-
skyline:
|
|
54
|
-
slate:
|
|
55
|
-
emerald:
|
|
56
|
-
rosewood:
|
|
57
|
-
storefront:
|
|
58
|
-
zinc:
|
|
55
|
+
lavender: darkBrand(lavenderDark),
|
|
56
|
+
meadow: darkBrand(meadowDark),
|
|
57
|
+
radiant: darkBrand(radiantDark),
|
|
58
|
+
skyline: darkBrand(skylineDark),
|
|
59
|
+
slate: darkBrand(slateDark),
|
|
60
|
+
emerald: darkBrand(emeraldDark),
|
|
61
|
+
rosewood: darkBrand(rosewoodDark),
|
|
62
|
+
storefront: darkBrand(storefrontDark),
|
|
63
|
+
zinc: darkBrand(zincDark),
|
|
59
64
|
};
|
|
60
65
|
// Built from lightPalettes/darkPalettes (not the raw literals) so accentText can never be
|
|
61
66
|
// present on one map and missing on the other.
|
|
@@ -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
|
|
@@ -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
|
+
}, {});
|