pixelize-design-library 2.4.1-beta.1 → 2.4.1-beta.11
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/Assets/defaultLogo.d.ts.map +1 -1
- package/dist/Assets/defaultLogo.js +1 -3
- package/dist/Assets/defaultLogo.tsx +4 -8
- package/dist/Components/Accordion/accordionColors.d.ts.map +1 -1
- package/dist/Components/Accordion/accordionColors.js +17 -3
- package/dist/Components/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/Components/Checkbox/Checkbox.styles.js +13 -2
- package/dist/Components/CustomModulesTable/EditModuleModal.d.ts.map +1 -1
- package/dist/Components/CustomModulesTable/EditModuleModal.js +5 -1
- package/dist/Components/DatePicker/CalendarPanel.d.ts.map +1 -1
- package/dist/Components/DatePicker/CalendarPanel.js +15 -4
- package/dist/Components/DatePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/Components/DatePicker/SingleDatePicker.js +11 -9
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -2
- package/dist/Components/DatePicker/TimePicker.d.ts.map +1 -1
- package/dist/Components/DatePicker/TimePicker.js +14 -2
- package/dist/Components/DatePicker/TimePickerInput.d.ts.map +1 -1
- package/dist/Components/DatePicker/TimePickerInput.js +9 -1
- package/dist/Components/Editor/joditThemeVars.d.ts.map +1 -1
- package/dist/Components/Editor/joditThemeVars.js +9 -0
- package/dist/Components/FilePreview/FilePreview.d.ts.map +1 -1
- package/dist/Components/FilePreview/FilePreview.js +3 -1
- package/dist/Components/FileUploader/FileUploader.js +2 -2
- package/dist/Components/FilterSidebar/FilterSidebar.js +1 -1
- package/dist/Components/LimitReachedModal/LimitReachedModal.d.ts +5 -0
- package/dist/Components/LimitReachedModal/LimitReachedModal.d.ts.map +1 -0
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +45 -0
- package/dist/Components/LimitReachedModal/LimitReachedModalProps.d.ts +16 -0
- package/dist/Components/LimitReachedModal/LimitReachedModalProps.d.ts.map +1 -0
- package/dist/Components/LimitReachedModal/LimitReachedModalProps.js +2 -0
- package/dist/Components/LimitReachedModal/limitReachedCopy.d.ts +7 -0
- package/dist/Components/LimitReachedModal/limitReachedCopy.d.ts.map +1 -0
- package/dist/Components/LimitReachedModal/limitReachedCopy.js +54 -0
- package/dist/Components/Loading/Loading.d.ts +1 -1
- package/dist/Components/Loading/Loading.d.ts.map +1 -1
- package/dist/Components/Loading/Loading.js +2 -2
- package/dist/Components/Loading/LoadingProps.d.ts +2 -0
- package/dist/Components/Loading/LoadingProps.d.ts.map +1 -1
- package/dist/Components/Modal/Modal.d.ts.map +1 -1
- package/dist/Components/Modal/Modal.js +1 -4
- package/dist/Components/NavigationBar/NavigationBar.d.ts.map +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +10 -6
- package/dist/Components/OrgSwitcher/OrgSwitcher.d.ts.map +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +22 -3
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +9 -1
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts.map +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.js +19 -5
- package/dist/Components/OrganizationDetails/CreateOrgModal.js +6 -4
- package/dist/Components/OrganizationDetails/OrganizationDetails.d.ts.map +1 -1
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +66 -9
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts +47 -14
- package/dist/Components/OrganizationDetails/OrganizationDetailsProps.d.ts.map +1 -1
- package/dist/Components/PlanBadge/PlanBadge.d.ts +12 -0
- package/dist/Components/PlanBadge/PlanBadge.d.ts.map +1 -0
- package/dist/Components/PlanBadge/PlanBadge.js +22 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts +11 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.d.ts.map +1 -0
- package/dist/Components/PlanBadge/PlanBadgeProps.js +2 -0
- package/dist/Components/PlanPill/PlanPill.d.ts +5 -0
- package/dist/Components/PlanPill/PlanPill.d.ts.map +1 -0
- package/dist/Components/PlanPill/PlanPill.js +42 -0
- package/dist/Components/PlanPill/PlanPillProps.d.ts +28 -0
- package/dist/Components/PlanPill/PlanPillProps.d.ts.map +1 -0
- package/dist/Components/PlanPill/PlanPillProps.js +2 -0
- package/dist/Components/PlanPill/planPillGradient.d.ts +22 -0
- package/dist/Components/PlanPill/planPillGradient.d.ts.map +1 -0
- package/dist/Components/PlanPill/planPillGradient.js +20 -0
- package/dist/Components/Search/Search.d.ts.map +1 -1
- package/dist/Components/Search/Search.js +4 -2
- package/dist/Components/Select/Select.styles.d.ts.map +1 -1
- package/dist/Components/Select/Select.styles.js +29 -20
- package/dist/Components/SelectSearch/SelectSearch.js +1 -1
- package/dist/Components/SelectV2/SelectV2.d.ts +3 -0
- package/dist/Components/SelectV2/SelectV2.d.ts.map +1 -0
- package/dist/Components/SelectV2/SelectV2.js +185 -0
- package/dist/Components/SelectV2/SelectV2Props.d.ts +67 -0
- package/dist/Components/SelectV2/SelectV2Props.d.ts.map +1 -0
- package/dist/Components/SelectV2/SelectV2Props.js +2 -0
- package/dist/Components/SideBar/SecondaryBar.d.ts.map +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +10 -2
- package/dist/Components/SideBar/SideBar.js +2 -2
- package/dist/Components/SideBar/components/MenuItemBox.d.ts.map +1 -1
- package/dist/Components/SideBar/components/MenuItemBox.js +7 -6
- package/dist/Components/Table/components/tableRowHoverStyle.d.ts +9 -8
- package/dist/Components/Table/components/tableRowHoverStyle.d.ts.map +1 -1
- package/dist/Components/Table/components/tableRowHoverStyle.js +12 -12
- package/dist/Components/Table/settings/ManageColumns.js +2 -2
- package/dist/Components/UpgradeButton/UpgradeButton.d.ts.map +1 -1
- package/dist/Components/UpgradeButton/UpgradeButton.js +25 -7
- package/dist/Components/UserDetails/UserDetails.d.ts.map +1 -1
- package/dist/Components/UserDetails/UserDetails.js +5 -2
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +2 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.d.ts +2 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.d.ts.map +1 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +25 -4
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +18 -0
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts.map +1 -1
- package/dist/Theme/chakra/Avatar.styles.d.ts +33 -0
- package/dist/Theme/chakra/Avatar.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Avatar.styles.js +28 -0
- package/dist/Theme/chakra/Drawer.styles.d.ts +32 -0
- package/dist/Theme/chakra/Drawer.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Drawer.styles.js +26 -0
- package/dist/Theme/chakra/Menu.styles.d.ts +70 -0
- package/dist/Theme/chakra/Menu.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Menu.styles.js +50 -0
- package/dist/Theme/chakra/Modal.styles.d.ts +32 -0
- package/dist/Theme/chakra/Modal.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Modal.styles.js +26 -0
- package/dist/Theme/chakra/Popover.styles.d.ts +37 -0
- package/dist/Theme/chakra/Popover.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Popover.styles.js +30 -0
- package/dist/Theme/chakra/Slider.styles.d.ts +31 -0
- package/dist/Theme/chakra/Slider.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Slider.styles.js +25 -0
- package/dist/Theme/chakra/Switch.styles.d.ts +31 -0
- package/dist/Theme/chakra/Switch.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Switch.styles.js +24 -0
- package/dist/Theme/chakra/Tabs.styles.d.ts +43 -0
- package/dist/Theme/chakra/Tabs.styles.d.ts.map +1 -0
- package/dist/Theme/chakra/Tabs.styles.js +41 -0
- package/dist/Theme/chakra/common.web.d.ts.map +1 -1
- package/dist/Theme/chakra/common.web.js +4 -1
- package/dist/Theme/chakra/componentStyles.d.ts +230 -1
- package/dist/Theme/chakra/componentStyles.d.ts.map +1 -1
- package/dist/Theme/chakra/componentStyles.js +136 -0
- package/dist/Theme/chakra/createBrandTheme.d.ts.map +1 -1
- package/dist/Theme/chakra/createBrandTheme.js +47 -0
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts +22 -3
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts.map +1 -1
- package/dist/Theme/provider/PixelizeThemeProvider.js +115 -5
- package/dist/Theme/provider/ThemeSwitcher.d.ts.map +1 -1
- package/dist/Theme/provider/ThemeSwitcher.js +23 -11
- package/dist/Theme/tokens/brands/index.d.ts.map +1 -1
- package/dist/Theme/tokens/brands/index.js +20 -18
- package/dist/Theme/tokens/brands/lavender/palette.light.d.ts.map +1 -1
- package/dist/Theme/tokens/brands/lavender/palette.light.js +22 -15
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts.map +1 -1
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +5 -2
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts.map +1 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +19 -4
- package/dist/Theme/tokens/builders/outlineRung.d.ts +35 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts.map +1 -0
- package/dist/Theme/tokens/builders/outlineRung.js +69 -0
- package/dist/Theme/tokens/builders/statusTone.d.ts +35 -0
- package/dist/Theme/tokens/builders/statusTone.d.ts.map +1 -0
- package/dist/Theme/tokens/builders/statusTone.js +63 -0
- package/dist/Utils/accountHandoff.d.ts +54 -0
- package/dist/Utils/accountHandoff.d.ts.map +1 -0
- package/dist/Utils/accountHandoff.js +144 -0
- package/dist/Utils/planBadge.d.ts +39 -0
- package/dist/Utils/planBadge.d.ts.map +1 -0
- package/dist/Utils/planBadge.js +108 -0
- package/dist/Utils/planExpiry.d.ts +35 -0
- package/dist/Utils/planExpiry.d.ts.map +1 -0
- package/dist/Utils/planExpiry.js +115 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -3
- package/package.json +6 -2
- package/.claude/settings.local.json +0 -51
- package/.cursor/TASK-SETUP.md +0 -43
- package/.cursor/agents/be-impl.md +0 -37
- package/.cursor/agents/fe-impl.md +0 -39
- package/.cursor/agents/task-plan.md +0 -56
- package/.cursor/agents/test-create.md +0 -31
- package/.cursor/agents/test-exec.md +0 -26
- package/.cursor/hooks/task-hint.env +0 -1
- package/.cursor/hooks/task-skill-nudge.sh +0 -71
- package/.cursor/hooks/task-slash-guard.sh +0 -31
- package/.cursor/hooks.json +0 -13
- package/.cursor/modules/account-management/MODULE.md +0 -34
- package/.cursor/modules/buttons/MODULE.md +0 -47
- package/.cursor/modules/cards/MODULE.md +0 -55
- package/.cursor/modules/charts/MODULE.md +0 -40
- package/.cursor/modules/common/MODULE.md +0 -36
- package/.cursor/modules/contact-auth/MODULE.md +0 -19
- package/.cursor/modules/data-display/MODULE.md +0 -42
- package/.cursor/modules/feedback/MODULE.md +0 -32
- package/.cursor/modules/form/MODULE.md +0 -13
- package/.cursor/modules/inputs-basic/MODULE.md +0 -42
- package/.cursor/modules/inputs-date-file/MODULE.md +0 -56
- package/.cursor/modules/inputs-select/MODULE.md +0 -27
- package/.cursor/modules/inputs-toggle/MODULE.md +0 -18
- package/.cursor/modules/kanban/MODULE.md +0 -22
- package/.cursor/modules/layout-navigation/MODULE.md +0 -269
- package/.cursor/modules/overlays/MODULE.md +0 -69
- package/.cursor/modules/playground/MODULE.md +0 -28
- package/.cursor/modules/table/MODULE.md +0 -78
- package/.cursor/modules/theme/MODULE.md +0 -314
- package/.cursor/modules/types-exports/MODULE.md +0 -17
- package/.cursor/modules/utility-ui/MODULE.md +0 -50
- package/.cursor/modules/utils-hooks/MODULE.md +0 -35
- package/.cursor/pixelize-task-statusline.sh +0 -64
- package/.cursor/plans/blocked/.gitkeep +0 -0
- package/.cursor/plans/current.md +0 -12
- package/.cursor/plans/current.theme-tokens-dark-mode.md +0 -77
- package/.cursor/plans/current.theme-tokens-dark.md +0 -155
- package/.cursor/plans/done/.gitkeep +0 -0
- package/.cursor/rules +0 -31
- package/.cursor/skills/task/SKILL.md +0 -167
- package/CLAUDE.md +0 -148
- package/__mocks__/styleMock.js +0 -8
- package/coverage/clover.xml +0 -405
- package/coverage/coverage-final.json +0 -16
- package/coverage/coverage-summary.json +0 -50
- package/coverage/lcov-report/Button/Button.tsx.html +0 -244
- package/coverage/lcov-report/Button/index.html +0 -116
- package/coverage/lcov-report/Checkbox/Checkbox.tsx.html +0 -433
- package/coverage/lcov-report/Checkbox/index.html +0 -116
- package/coverage/lcov-report/Common/ErrorMessage.tsx.html +0 -148
- package/coverage/lcov-report/Common/FormLabel.tsx.html +0 -331
- package/coverage/lcov-report/Common/HelperText.tsx.html +0 -124
- package/coverage/lcov-report/Common/index.html +0 -146
- package/coverage/lcov-report/Components/Button/Button.tsx.html +0 -244
- package/coverage/lcov-report/Components/Button/index.html +0 -116
- package/coverage/lcov-report/Components/Checkbox/Checkbox.tsx.html +0 -433
- package/coverage/lcov-report/Components/Checkbox/index.html +0 -116
- package/coverage/lcov-report/Components/Common/ErrorMessage.tsx.html +0 -148
- package/coverage/lcov-report/Components/Common/FormLabel.tsx.html +0 -331
- package/coverage/lcov-report/Components/Common/HelperText.tsx.html +0 -124
- package/coverage/lcov-report/Components/Common/index.html +0 -146
- package/coverage/lcov-report/Components/CustomModulesTable/CustomModulesTable.tsx.html +0 -712
- package/coverage/lcov-report/Components/CustomModulesTable/DeleteModuleModal.tsx.html +0 -343
- package/coverage/lcov-report/Components/CustomModulesTable/EditModuleModal.tsx.html +0 -313
- package/coverage/lcov-report/Components/CustomModulesTable/index.html +0 -146
- package/coverage/lcov-report/Components/Divider/Divider.tsx.html +0 -133
- package/coverage/lcov-report/Components/Divider/index.html +0 -116
- package/coverage/lcov-report/Components/Dropdown/DropDown.tsx.html +0 -994
- package/coverage/lcov-report/Components/Dropdown/index.html +0 -116
- package/coverage/lcov-report/Components/EmptyState/EmptyState.tsx.html +0 -466
- package/coverage/lcov-report/Components/EmptyState/index.html +0 -116
- package/coverage/lcov-report/Components/Header/HeaderActions.tsx.html +0 -373
- package/coverage/lcov-report/Components/Header/index.html +0 -116
- package/coverage/lcov-report/Components/Input/TextInput.tsx.html +0 -487
- package/coverage/lcov-report/Components/Input/index.html +0 -116
- package/coverage/lcov-report/Components/Input/textInputIconSize.ts.html +0 -205
- package/coverage/lcov-report/Components/KanbanBoard/AccountCard.tsx.html +0 -547
- package/coverage/lcov-report/Components/KanbanBoard/AccountRow.tsx.html +0 -190
- package/coverage/lcov-report/Components/KanbanBoard/KanbanActions/KanbanActions.tsx.html +0 -247
- package/coverage/lcov-report/Components/KanbanBoard/KanbanActions/index.html +0 -116
- package/coverage/lcov-report/Components/KanbanBoard/KanbanBoard.tsx.html +0 -3598
- package/coverage/lcov-report/Components/KanbanBoard/MeasuredItem.tsx.html +0 -283
- package/coverage/lcov-report/Components/KanbanBoard/index.html +0 -161
- package/coverage/lcov-report/Components/OrganizationDetails/CreateOrgModal.tsx.html +0 -511
- package/coverage/lcov-report/Components/OrganizationDetails/DeleteOrgModal.tsx.html +0 -334
- package/coverage/lcov-report/Components/OrganizationDetails/OrganizationDetails.tsx.html +0 -1519
- package/coverage/lcov-report/Components/OrganizationDetails/index.html +0 -146
- package/coverage/lcov-report/Components/RolesPermission/DeleteRoleModal.tsx.html +0 -328
- package/coverage/lcov-report/Components/RolesPermission/RolesPermission.tsx.html +0 -1732
- package/coverage/lcov-report/Components/RolesPermission/index.html +0 -131
- package/coverage/lcov-report/Components/SearchSelect/SearchSelect.tsx.html +0 -2575
- package/coverage/lcov-report/Components/SearchSelect/SelectTruncatedLabel.tsx.html +0 -202
- package/coverage/lcov-report/Components/SearchSelect/index.html +0 -146
- package/coverage/lcov-report/Components/SearchSelect/searchSelectSize.ts.html +0 -496
- package/coverage/lcov-report/Components/Select/Select.tsx.html +0 -361
- package/coverage/lcov-report/Components/Select/index.html +0 -116
- package/coverage/lcov-report/Components/SideBar/components/OtherApps.tsx.html +0 -562
- package/coverage/lcov-report/Components/SideBar/components/OverflowTooltipText.tsx.html +0 -346
- package/coverage/lcov-report/Components/SideBar/components/index.html +0 -116
- package/coverage/lcov-report/Components/SignInActivityTable/SignInActivityTable.tsx.html +0 -490
- package/coverage/lcov-report/Components/SignInActivityTable/index.html +0 -116
- package/coverage/lcov-report/Components/Table/components/TableActions.tsx.html +0 -595
- package/coverage/lcov-report/Components/Table/components/TableBody.tsx.html +0 -2212
- package/coverage/lcov-report/Components/Table/components/TableGroupRow.tsx.html +0 -358
- package/coverage/lcov-report/Components/Table/components/TableLoading.tsx.html +0 -358
- package/coverage/lcov-report/Components/Table/components/index.html +0 -161
- package/coverage/lcov-report/Components/Table/settings/ManageColumns.tsx.html +0 -856
- package/coverage/lcov-report/Components/Table/settings/index.html +0 -116
- package/coverage/lcov-report/Components/Tag/Tag.styles.tsx.html +0 -331
- package/coverage/lcov-report/Components/Tag/Tag.tsx.html +0 -256
- package/coverage/lcov-report/Components/Tag/index.html +0 -131
- package/coverage/lcov-report/Components/ToolTip/ToolTip.tsx.html +0 -286
- package/coverage/lcov-report/Components/ToolTip/index.html +0 -116
- package/coverage/lcov-report/Components/UserDetails/AddUserModal.tsx.html +0 -709
- package/coverage/lcov-report/Components/UserDetails/ChangeRoleModal.tsx.html +0 -505
- package/coverage/lcov-report/Components/UserDetails/DeactivateConfirmModal.tsx.html +0 -379
- package/coverage/lcov-report/Components/UserDetails/UserDetails.tsx.html +0 -1900
- package/coverage/lcov-report/Components/UserDetails/index.html +0 -161
- package/coverage/lcov-report/EmptyState/EmptyState.tsx.html +0 -466
- package/coverage/lcov-report/EmptyState/index.html +0 -116
- package/coverage/lcov-report/Hooks/index.html +0 -116
- package/coverage/lcov-report/Hooks/usePreferences.ts.html +0 -421
- package/coverage/lcov-report/Input/TextInput.tsx.html +0 -487
- package/coverage/lcov-report/Input/index.html +0 -131
- package/coverage/lcov-report/Input/textInputIconSize.ts.html +0 -205
- package/coverage/lcov-report/KanbanBoard.tsx.html +0 -3481
- package/coverage/lcov-report/OrganizationDetails/CreateOrgModal.tsx.html +0 -511
- package/coverage/lcov-report/OrganizationDetails/DeleteOrgModal.tsx.html +0 -334
- package/coverage/lcov-report/OrganizationDetails/OrganizationDetails.tsx.html +0 -1519
- package/coverage/lcov-report/OrganizationDetails/index.html +0 -146
- package/coverage/lcov-report/RolesPermission/DeleteRoleModal.tsx.html +0 -328
- package/coverage/lcov-report/RolesPermission/RolesPermission.tsx.html +0 -1732
- package/coverage/lcov-report/RolesPermission/index.html +0 -116
- package/coverage/lcov-report/SearchSelect/SearchSelect.tsx.html +0 -2575
- package/coverage/lcov-report/SearchSelect/SelectTruncatedLabel.tsx.html +0 -202
- package/coverage/lcov-report/SearchSelect/index.html +0 -146
- package/coverage/lcov-report/SearchSelect/searchSelectSize.ts.html +0 -496
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +0 -379
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +0 -514
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +0 -373
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +0 -574
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +0 -574
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +0 -1027
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +0 -397
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +0 -1060
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +0 -361
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +0 -337
- package/coverage/lcov-report/Table/Components/index.html +0 -266
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +0 -178
- package/coverage/lcov-report/Table/Components/useTable.ts.html +0 -778
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +0 -1810
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +0 -178
- package/coverage/lcov-report/Table/Table.tsx.html +0 -1567
- package/coverage/lcov-report/Table/TableProps.tsx.html +0 -658
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +0 -619
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +0 -229
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +0 -532
- package/coverage/lcov-report/Table/TableSettings/index.html +0 -146
- package/coverage/lcov-report/Table/TableToDo.tsx.html +0 -973
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +0 -271
- package/coverage/lcov-report/Table/filterTypes.ts.html +0 -97
- package/coverage/lcov-report/Table/index.html +0 -176
- package/coverage/lcov-report/Table/settings/ManageColumns.tsx.html +0 -856
- package/coverage/lcov-report/Table/settings/index.html +0 -116
- package/coverage/lcov-report/Tag/Tag.tsx.html +0 -256
- package/coverage/lcov-report/Tag/index.html +0 -116
- package/coverage/lcov-report/Theme/buildBrandTokens.ts.html +0 -175
- package/coverage/lcov-report/Theme/chartColorsFromTheme.ts.html +0 -214
- package/coverage/lcov-report/Theme/index.html +0 -131
- package/coverage/lcov-report/Theme/useCustomTheme.ts.html +0 -100
- package/coverage/lcov-report/ToolTip/ToolTip.tsx.html +0 -286
- package/coverage/lcov-report/ToolTip/index.html +0 -116
- package/coverage/lcov-report/UserDetails/AddUserModal.tsx.html +0 -709
- package/coverage/lcov-report/UserDetails/ChangeRoleModal.tsx.html +0 -505
- package/coverage/lcov-report/UserDetails/index.html +0 -116
- package/coverage/lcov-report/Utils/functions.ts.html +0 -106
- package/coverage/lcov-report/Utils/index.html +0 -116
- package/coverage/lcov-report/Utils/table.ts.html +0 -1189
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -251
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -981
- package/dist/App.d.ts +0 -4
- package/dist/App.js +0 -95
- package/dist/Layout.d.ts +0 -3
- package/dist/Layout.js +0 -286
- package/dist/Pages/TInput.d.ts +0 -3
- package/dist/Pages/TInput.d.ts.map +0 -1
- package/dist/Pages/TInput.js +0 -20
- package/dist/Pages/accordion.d.ts +0 -3
- package/dist/Pages/accordion.d.ts.map +0 -1
- package/dist/Pages/accordion.js +0 -21
- package/dist/Pages/alertdialog.d.ts +0 -3
- package/dist/Pages/alertdialog.d.ts.map +0 -1
- package/dist/Pages/alertdialog.js +0 -53
- package/dist/Pages/button.d.ts +0 -3
- package/dist/Pages/button.d.ts.map +0 -1
- package/dist/Pages/button.js +0 -32
- package/dist/Pages/card.d.ts +0 -3
- package/dist/Pages/card.d.ts.map +0 -1
- package/dist/Pages/card.js +0 -102
- package/dist/Pages/chart.d.ts +0 -4
- package/dist/Pages/chart.d.ts.map +0 -1
- package/dist/Pages/chart.js +0 -25
- package/dist/Pages/checkbox.d.ts +0 -3
- package/dist/Pages/checkbox.d.ts.map +0 -1
- package/dist/Pages/checkbox.js +0 -11
- package/dist/Pages/contactForm.d.ts +0 -3
- package/dist/Pages/contactForm.d.ts.map +0 -1
- package/dist/Pages/contactForm.js +0 -15
- package/dist/Pages/customModulesTable.d.ts +0 -4
- package/dist/Pages/customModulesTable.d.ts.map +0 -1
- package/dist/Pages/customModulesTable.js +0 -25
- package/dist/Pages/datePick.d.ts +0 -3
- package/dist/Pages/datePick.d.ts.map +0 -1
- package/dist/Pages/datePick.js +0 -49
- package/dist/Pages/drawer.d.ts +0 -3
- package/dist/Pages/drawer.d.ts.map +0 -1
- package/dist/Pages/drawer.js +0 -53
- package/dist/Pages/dropdown.d.ts +0 -3
- package/dist/Pages/dropdown.d.ts.map +0 -1
- package/dist/Pages/dropdown.js +0 -21
- package/dist/Pages/editor.d.ts +0 -3
- package/dist/Pages/editor.d.ts.map +0 -1
- package/dist/Pages/editor.js +0 -13
- package/dist/Pages/feedback.d.ts +0 -2
- package/dist/Pages/feedback.d.ts.map +0 -1
- package/dist/Pages/feedback.js +0 -12
- package/dist/Pages/fileUpload.d.ts +0 -2
- package/dist/Pages/fileUpload.d.ts.map +0 -1
- package/dist/Pages/fileUpload.js +0 -36
- package/dist/Pages/input.d.ts +0 -3
- package/dist/Pages/input.d.ts.map +0 -1
- package/dist/Pages/input.js +0 -48
- package/dist/Pages/kanbanboard.d.ts +0 -3
- package/dist/Pages/kanbanboard.d.ts.map +0 -1
- package/dist/Pages/kanbanboard.js +0 -182
- package/dist/Pages/modal.d.ts +0 -3
- package/dist/Pages/modal.d.ts.map +0 -1
- package/dist/Pages/modal.js +0 -61
- package/dist/Pages/multiSelect.d.ts +0 -3
- package/dist/Pages/multiSelect.d.ts.map +0 -1
- package/dist/Pages/multiSelect.js +0 -22
- package/dist/Pages/noteArea.d.ts +0 -3
- package/dist/Pages/noteArea.d.ts.map +0 -1
- package/dist/Pages/noteArea.js +0 -26
- package/dist/Pages/notification.d.ts +0 -3
- package/dist/Pages/notification.d.ts.map +0 -1
- package/dist/Pages/notification.js +0 -37
- package/dist/Pages/numberInput.d.ts +0 -3
- package/dist/Pages/numberInput.d.ts.map +0 -1
- package/dist/Pages/numberInput.js +0 -16
- package/dist/Pages/orgSwitcher.d.ts +0 -4
- package/dist/Pages/orgSwitcher.d.ts.map +0 -1
- package/dist/Pages/orgSwitcher.js +0 -36
- package/dist/Pages/organizationDetails.d.ts +0 -4
- package/dist/Pages/organizationDetails.d.ts.map +0 -1
- package/dist/Pages/organizationDetails.js +0 -64
- package/dist/Pages/photoViewer.d.ts +0 -3
- package/dist/Pages/photoViewer.d.ts.map +0 -1
- package/dist/Pages/photoViewer.js +0 -12
- package/dist/Pages/pinInputs.d.ts +0 -3
- package/dist/Pages/pinInputs.d.ts.map +0 -1
- package/dist/Pages/pinInputs.js +0 -11
- package/dist/Pages/productCaard.d.ts +0 -3
- package/dist/Pages/productCaard.d.ts.map +0 -1
- package/dist/Pages/productCaard.js +0 -311
- package/dist/Pages/productDetailCard.d.ts +0 -3
- package/dist/Pages/productDetailCard.d.ts.map +0 -1
- package/dist/Pages/productDetailCard.js +0 -78
- package/dist/Pages/productFilter.d.ts +0 -3
- package/dist/Pages/productFilter.d.ts.map +0 -1
- package/dist/Pages/productFilter.js +0 -148
- package/dist/Pages/progressbar.d.ts +0 -3
- package/dist/Pages/progressbar.d.ts.map +0 -1
- package/dist/Pages/progressbar.js +0 -11
- package/dist/Pages/radioButton.d.ts +0 -3
- package/dist/Pages/radioButton.d.ts.map +0 -1
- package/dist/Pages/radioButton.js +0 -18
- package/dist/Pages/rolesPermission.d.ts +0 -4
- package/dist/Pages/rolesPermission.d.ts.map +0 -1
- package/dist/Pages/rolesPermission.js +0 -144
- package/dist/Pages/search.d.ts +0 -3
- package/dist/Pages/search.d.ts.map +0 -1
- package/dist/Pages/search.js +0 -21
- package/dist/Pages/searchSelect.d.ts +0 -3
- package/dist/Pages/searchSelect.d.ts.map +0 -1
- package/dist/Pages/searchSelect.js +0 -97
- package/dist/Pages/select.d.ts +0 -3
- package/dist/Pages/select.d.ts.map +0 -1
- package/dist/Pages/select.js +0 -20
- package/dist/Pages/selectSearch.d.ts +0 -3
- package/dist/Pages/selectSearch.d.ts.map +0 -1
- package/dist/Pages/selectSearch.js +0 -58
- package/dist/Pages/signInActivityTable.d.ts +0 -4
- package/dist/Pages/signInActivityTable.d.ts.map +0 -1
- package/dist/Pages/signInActivityTable.js +0 -17
- package/dist/Pages/skeleton.d.ts +0 -3
- package/dist/Pages/skeleton.d.ts.map +0 -1
- package/dist/Pages/skeleton.js +0 -12
- package/dist/Pages/stageProgress.d.ts +0 -4
- package/dist/Pages/stageProgress.d.ts.map +0 -1
- package/dist/Pages/stageProgress.js +0 -31
- package/dist/Pages/switch.d.ts +0 -3
- package/dist/Pages/switch.d.ts.map +0 -1
- package/dist/Pages/switch.js +0 -17
- package/dist/Pages/table.d.ts +0 -3
- package/dist/Pages/table.d.ts.map +0 -1
- package/dist/Pages/table.js +0 -182
- package/dist/Pages/tag.d.ts +0 -3
- package/dist/Pages/tag.d.ts.map +0 -1
- package/dist/Pages/tag.js +0 -27
- package/dist/Pages/textArea.d.ts +0 -3
- package/dist/Pages/textArea.d.ts.map +0 -1
- package/dist/Pages/textArea.js +0 -14
- package/dist/Pages/tier1.d.ts +0 -4
- package/dist/Pages/tier1.d.ts.map +0 -1
- package/dist/Pages/tier1.js +0 -86
- package/dist/Pages/timeline.d.ts +0 -3
- package/dist/Pages/timeline.d.ts.map +0 -1
- package/dist/Pages/timeline.js +0 -73
- package/dist/Pages/tooltip.d.ts +0 -3
- package/dist/Pages/tooltip.d.ts.map +0 -1
- package/dist/Pages/tooltip.js +0 -11
- package/dist/Pages/toster.d.ts +0 -3
- package/dist/Pages/toster.d.ts.map +0 -1
- package/dist/Pages/toster.js +0 -53
- package/dist/Pages/upgradeButton.d.ts +0 -4
- package/dist/Pages/upgradeButton.d.ts.map +0 -1
- package/dist/Pages/upgradeButton.js +0 -17
- package/dist/Pages/userDetails.d.ts +0 -4
- package/dist/Pages/userDetails.d.ts.map +0 -1
- package/dist/Pages/userDetails.js +0 -79
- package/dist/Pages/verifyEmail.d.ts +0 -3
- package/dist/Pages/verifyEmail.d.ts.map +0 -1
- package/dist/Pages/verifyEmail.js +0 -17
- package/dist/Theme/Dark/theme.d.ts +0 -3
- package/dist/Theme/Dark/theme.d.ts.map +0 -1
- package/dist/Theme/Dark/theme.js +0 -277
- package/dist/Theme/Default/palette.d.ts +0 -375
- package/dist/Theme/Default/palette.d.ts.map +0 -1
- package/dist/Theme/Default/palette.js +0 -306
- package/dist/Theme/Default/theme.d.ts +0 -3
- package/dist/Theme/Default/theme.d.ts.map +0 -1
- package/dist/Theme/Default/theme.js +0 -19
- package/dist/Theme/Emerald/palette.d.ts +0 -375
- package/dist/Theme/Emerald/palette.d.ts.map +0 -1
- package/dist/Theme/Emerald/palette.js +0 -125
- package/dist/Theme/Emerald/theme.d.ts +0 -3
- package/dist/Theme/Emerald/theme.d.ts.map +0 -1
- package/dist/Theme/Emerald/theme.js +0 -19
- package/dist/Theme/Meadow/palette.d.ts +0 -375
- package/dist/Theme/Meadow/palette.d.ts.map +0 -1
- package/dist/Theme/Meadow/palette.js +0 -123
- package/dist/Theme/Meadow/theme.d.ts +0 -3
- package/dist/Theme/Meadow/theme.d.ts.map +0 -1
- package/dist/Theme/Meadow/theme.js +0 -19
- package/dist/Theme/Radiant/palette.d.ts +0 -375
- package/dist/Theme/Radiant/palette.d.ts.map +0 -1
- package/dist/Theme/Radiant/palette.js +0 -125
- package/dist/Theme/Radiant/theme.d.ts +0 -3
- package/dist/Theme/Radiant/theme.d.ts.map +0 -1
- package/dist/Theme/Radiant/theme.js +0 -19
- package/dist/Theme/Rosewood/palette.d.ts +0 -375
- package/dist/Theme/Rosewood/palette.d.ts.map +0 -1
- package/dist/Theme/Rosewood/palette.js +0 -125
- package/dist/Theme/Rosewood/theme.d.ts +0 -3
- package/dist/Theme/Rosewood/theme.d.ts.map +0 -1
- package/dist/Theme/Rosewood/theme.js +0 -19
- package/dist/Theme/Skyline/palette.d.ts +0 -375
- package/dist/Theme/Skyline/palette.d.ts.map +0 -1
- package/dist/Theme/Skyline/palette.js +0 -123
- package/dist/Theme/Skyline/theme.d.ts +0 -3
- package/dist/Theme/Skyline/theme.d.ts.map +0 -1
- package/dist/Theme/Skyline/theme.js +0 -19
- package/dist/Theme/Slate/palette.d.ts +0 -375
- package/dist/Theme/Slate/palette.d.ts.map +0 -1
- package/dist/Theme/Slate/palette.js +0 -123
- package/dist/Theme/Slate/theme.d.ts +0 -3
- package/dist/Theme/Slate/theme.d.ts.map +0 -1
- package/dist/Theme/Slate/theme.js +0 -19
- package/dist/Theme/buildBrandTokens.d.ts +0 -16
- package/dist/Theme/buildBrandTokens.d.ts.map +0 -1
- package/dist/Theme/buildBrandTokens.js +0 -33
- package/dist/Theme/chartColorsFromTheme.d.ts +0 -19
- package/dist/Theme/chartColorsFromTheme.d.ts.map +0 -1
- package/dist/Theme/chartColorsFromTheme.js +0 -34
- package/dist/Theme/common.d.ts +0 -167
- package/dist/Theme/common.d.ts.map +0 -1
- package/dist/Theme/common.js +0 -112
- package/dist/Theme/componentStyles.d.ts +0 -10
- package/dist/Theme/componentStyles.d.ts.map +0 -1
- package/dist/Theme/componentStyles.js +0 -19
- package/dist/Theme/fonts.d.ts +0 -37
- package/dist/Theme/fonts.d.ts.map +0 -1
- package/dist/Theme/fonts.js +0 -41
- package/dist/Theme/space.d.ts +0 -34
- package/dist/Theme/space.d.ts.map +0 -1
- package/dist/Theme/space.js +0 -35
- package/dist/Theme/theme.d.ts +0 -3
- package/dist/Theme/theme.d.ts.map +0 -1
- package/dist/Theme/theme.js +0 -12
- package/dist/bootstrap.d.ts +0 -2
- package/dist/bootstrap.js +0 -16
- package/eslint.config.js +0 -48
- package/index.html +0 -13
- package/vite.config.ts +0 -13
|
@@ -10,12 +10,31 @@ export type ThemeModeContextValue = {
|
|
|
10
10
|
};
|
|
11
11
|
export type PixelizeThemeProviderProps = {
|
|
12
12
|
children: React.ReactNode;
|
|
13
|
-
/** Initial brand. A persisted brand wins over this. */
|
|
13
|
+
/** Initial brand. A persisted brand wins over this. Re-synced if the prop changes after mount. */
|
|
14
14
|
brand?: ThemeName;
|
|
15
|
-
/**
|
|
15
|
+
/** Brand counterpart of `onModeChange`, with the same user-intent-only contract. */
|
|
16
|
+
onBrandChange?: (brand: ThemeName) => void;
|
|
17
|
+
/** Initial color mode. A persisted mode wins over this. Re-synced if the prop changes after mount. */
|
|
16
18
|
defaultMode?: ColorMode;
|
|
19
|
+
/**
|
|
20
|
+
* Fired only when the mode changes through `setMode`/`toggle` — i.e. user intent. It is NOT
|
|
21
|
+
* fired when a changed `defaultMode` prop is synced in, which is what makes it safe to persist
|
|
22
|
+
* from: an app that instead mirrors `mode` in an effect re-persists its own echo, and if that
|
|
23
|
+
* store feeds `defaultMode` back the two ends flip each other forever.
|
|
24
|
+
*/
|
|
25
|
+
onModeChange?: (mode: ColorMode) => void;
|
|
17
26
|
storageKey?: string;
|
|
18
27
|
disablePersistence?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* App-specific theme overrides (fonts, sizes, component defaultProps, zIndices, ...) merged
|
|
30
|
+
* onto the resolved `brandThemes[brand][resolvedMode]` via `extendTheme`. Re-evaluated whenever
|
|
31
|
+
* `brand`/`resolvedMode` change, so overrides always layer onto the CURRENT palette rather than
|
|
32
|
+
* a stale one. Safe to merge post-resolution: `createBrandTheme` already fixes
|
|
33
|
+
* `config.initialColorMode` to `"light"` on every palette, and `extendTheme` is a pure additive
|
|
34
|
+
* merge — it does not re-derive `_dark:` blocks or re-run color-mode resolution, so this cannot
|
|
35
|
+
* reintroduce the double-adaptation bug `forcedLightColorModeManager` avoids (see above).
|
|
36
|
+
*/
|
|
37
|
+
themeOverrides?: Record<string, unknown>;
|
|
19
38
|
};
|
|
20
39
|
export declare const ThemeModeContext: React.Context<ThemeModeContextValue | undefined>;
|
|
21
40
|
/**
|
|
@@ -32,5 +51,5 @@ export declare const ThemeModeContext: React.Context<ThemeModeContextValue | und
|
|
|
32
51
|
* whatever the active palette says. Read the mode from `useThemeMode()` instead. Existing apps are
|
|
33
52
|
* unaffected: they are light-only, where that argument was always the one returned anyway.
|
|
34
53
|
*/
|
|
35
|
-
export declare const PixelizeThemeProvider: ({ children, brand: brandProp, defaultMode, storageKey, disablePersistence, }: PixelizeThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare const PixelizeThemeProvider: ({ children, brand: brandProp, onBrandChange, defaultMode, onModeChange, storageKey, disablePersistence, themeOverrides, }: PixelizeThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
55
|
//# sourceMappingURL=PixelizeThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PixelizeThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/PixelizeThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,iBAAiB,CAAC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"PixelizeThemeProvider.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/PixelizeThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,EAAE,iBAAiB,CAAC;IAChC,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kGAAkG;IAClG,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,oFAAoF;IACpF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC3C,sGAAsG;IACtG,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C,CAAC;AA2BF,eAAO,MAAM,gBAAgB,kDAE5B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,GAAI,2HASnC,0BAA0B,4CA8K5B,CAAC"}
|
|
@@ -48,7 +48,7 @@ exports.ThemeModeContext = (0, react_1.createContext)(undefined);
|
|
|
48
48
|
* whatever the active palette says. Read the mode from `useThemeMode()` instead. Existing apps are
|
|
49
49
|
* unaffected: they are light-only, where that argument was always the one returned anyway.
|
|
50
50
|
*/
|
|
51
|
-
const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, defaultMode = DEFAULT_MODE, storageKey = DEFAULT_STORAGE_KEY, disablePersistence = false, }) => {
|
|
51
|
+
const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, onBrandChange, defaultMode = DEFAULT_MODE, onModeChange, storageKey = DEFAULT_STORAGE_KEY, disablePersistence = false, themeOverrides, }) => {
|
|
52
52
|
const [mode, setModeState] = (0, react_1.useState)(defaultMode);
|
|
53
53
|
const [brand, setBrandState] = (0, react_1.useState)(brandProp);
|
|
54
54
|
// Deterministic on the server and on the first client render — the real OS value lands in
|
|
@@ -67,6 +67,30 @@ const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, def
|
|
|
67
67
|
if (stored.brand)
|
|
68
68
|
setBrandState(stored.brand);
|
|
69
69
|
}, [disablePersistence, storageKey]);
|
|
70
|
+
// `brandProp` only seeds initial state above, so a consumer that re-renders with a new
|
|
71
|
+
// `brand` prop after mount (e.g. persisting the pick through its own store, like tickets'
|
|
72
|
+
// Settings page dispatching Redux instead of calling `setBrand`) would otherwise never see
|
|
73
|
+
// it applied. Sync it here instead so every consumer gets it for free.
|
|
74
|
+
const isFirstBrandPropRun = (0, react_1.useRef)(true);
|
|
75
|
+
(0, react_1.useEffect)(() => {
|
|
76
|
+
if (isFirstBrandPropRun.current) {
|
|
77
|
+
isFirstBrandPropRun.current = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Only re-sync when the prop itself changes — not on every local `setBrand` call (that
|
|
81
|
+
// would fight the user's own in-session brand picking, e.g. via ThemeSwitcher).
|
|
82
|
+
setBrandState(brandProp);
|
|
83
|
+
}, [brandProp]);
|
|
84
|
+
// Same prop-sync for the mode, so an app owning it in its own store no longer needs the
|
|
85
|
+
// `mode` -> store mirror effect that deadlocks against this one.
|
|
86
|
+
const isFirstModePropRun = (0, react_1.useRef)(true);
|
|
87
|
+
(0, react_1.useEffect)(() => {
|
|
88
|
+
if (isFirstModePropRun.current) {
|
|
89
|
+
isFirstModePropRun.current = false;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
setModeState(defaultMode);
|
|
93
|
+
}, [defaultMode]);
|
|
70
94
|
// Skipping the mount run keeps the defaults from being written over a stored value before
|
|
71
95
|
// the rehydrate effect above has applied it.
|
|
72
96
|
const isFirstPersistRun = (0, react_1.useRef)(true);
|
|
@@ -80,12 +104,98 @@ const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRAND, def
|
|
|
80
104
|
(0, colorModeStorage_1.writeStoredTheme)(storageKey, { mode, brand });
|
|
81
105
|
}, [mode, brand, disablePersistence, storageKey]);
|
|
82
106
|
const resolvedMode = mode === "system" ? systemMode : mode;
|
|
83
|
-
|
|
84
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Native browser UI (the `<select>` dropdown popup chrome, the `<input type="date">` calendar
|
|
109
|
+
* picker) is painted by the browser's own UA stylesheet keyed off the CSS `color-scheme`
|
|
110
|
+
* property, entirely separate from Chakra/React theming — no component style or palette swap
|
|
111
|
+
* above can reach it. Without this, that chrome always renders light, even on an otherwise dark
|
|
112
|
+
* page. Scoped to this provider (not a global stylesheet) so `withTheme` consumers — deliberately
|
|
113
|
+
* light-only, see the module doc's "Key rules" — are untouched.
|
|
114
|
+
*/
|
|
115
|
+
(0, react_1.useEffect)(() => {
|
|
116
|
+
document.documentElement.style.colorScheme = resolvedMode;
|
|
117
|
+
}, [resolvedMode]);
|
|
118
|
+
// Held in refs so a caller's inline arrow never re-creates `setMode`/`setBrand`, which would
|
|
119
|
+
// invalidate the context value on every render of the consuming app.
|
|
120
|
+
const onModeChangeRef = (0, react_1.useRef)(onModeChange);
|
|
121
|
+
onModeChangeRef.current = onModeChange;
|
|
122
|
+
const onBrandChangeRef = (0, react_1.useRef)(onBrandChange);
|
|
123
|
+
onBrandChangeRef.current = onBrandChange;
|
|
124
|
+
const setMode = (0, react_1.useCallback)((next) => {
|
|
125
|
+
var _a;
|
|
126
|
+
setModeState(next);
|
|
127
|
+
(_a = onModeChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onModeChangeRef, next);
|
|
128
|
+
}, []);
|
|
129
|
+
const setBrand = (0, react_1.useCallback)((next) => {
|
|
130
|
+
var _a;
|
|
131
|
+
setBrandState(next);
|
|
132
|
+
(_a = onBrandChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onBrandChangeRef, next);
|
|
133
|
+
}, []);
|
|
85
134
|
// From "system", flip to the opposite of what the OS currently gives, so a click always
|
|
86
135
|
// visibly changes the UI.
|
|
87
|
-
const toggle = (0, react_1.useCallback)(() =>
|
|
136
|
+
const toggle = (0, react_1.useCallback)(() => setMode(resolvedMode === "dark" ? "light" : "dark"), [resolvedMode, setMode]);
|
|
88
137
|
const value = (0, react_1.useMemo)(() => ({ mode, resolvedMode, setMode, toggle, brand, setBrand }), [mode, resolvedMode, setMode, toggle, brand, setBrand]);
|
|
89
|
-
|
|
138
|
+
const resolvedTheme = (0, react_1.useMemo)(() => {
|
|
139
|
+
const base = index_1.brandThemes[brand][resolvedMode];
|
|
140
|
+
return themeOverrides
|
|
141
|
+
? (0, react_2.extendTheme)(base, themeOverrides)
|
|
142
|
+
: base;
|
|
143
|
+
}, [brand, resolvedMode, themeOverrides]);
|
|
144
|
+
/**
|
|
145
|
+
* The library ships its `var(--color-*)` tokens light-only on `:root` (global.css), so any
|
|
146
|
+
* consumer that styles with those CSS vars rather than Chakra tokens stays light in dark mode —
|
|
147
|
+
* invisible text on the dark canvas, white panels. In dark, re-point every used var at the
|
|
148
|
+
* already-dark-correct resolved palette; in light, clear them so the static `:root` values apply
|
|
149
|
+
* unchanged (so a light-only app is byte-identical to before). Also mirror the mode to
|
|
150
|
+
* `data-mode` for consumers that want to hook their own dark CSS.
|
|
151
|
+
*/
|
|
152
|
+
(0, react_1.useEffect)(() => {
|
|
153
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
154
|
+
const root = document.documentElement;
|
|
155
|
+
root.dataset.mode = resolvedMode;
|
|
156
|
+
const colors = resolvedTheme.colors;
|
|
157
|
+
const sem = (_a = colors.semantic) !== null && _a !== void 0 ? _a : {};
|
|
158
|
+
const gray = colors.gray;
|
|
159
|
+
const HUE_SCALES = [
|
|
160
|
+
"primary", "gray", "red", "orange", "yellow",
|
|
161
|
+
"green", "teal", "blue", "cyan", "purple", "pink",
|
|
162
|
+
];
|
|
163
|
+
const SEMANTIC_SCALES = ["success", "error", "warning", "info"]; // nested under colors.semantic
|
|
164
|
+
const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
|
165
|
+
// Single-value semantic vars → palette scale+rung. The dark gray ramp runs dark(50) → light(900),
|
|
166
|
+
// so low rungs read as surfaces and high rungs as text — correct in dark, cleared in light.
|
|
167
|
+
const SEMANTIC_VARS = {
|
|
168
|
+
"text-heading": gray === null || gray === void 0 ? void 0 : gray[900], "text-body": gray === null || gray === void 0 ? void 0 : gray[700],
|
|
169
|
+
"text-subtle": gray === null || gray === void 0 ? void 0 : gray[500], "text-input": gray === null || gray === void 0 ? void 0 : gray[500],
|
|
170
|
+
"bg-main": gray === null || gray === void 0 ? void 0 : gray[50], "bg-secondary": gray === null || gray === void 0 ? void 0 : gray[100], "bg-tertiary": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
171
|
+
"bg-quaternary": gray === null || gray === void 0 ? void 0 : gray[200], "bg-light": gray === null || gray === void 0 ? void 0 : gray[50], "bg-medium": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
172
|
+
"bg-accent": gray === null || gray === void 0 ? void 0 : gray[200], "bg-subtle": gray === null || gray === void 0 ? void 0 : gray[100], "bg-muted": gray === null || gray === void 0 ? void 0 : gray[200],
|
|
173
|
+
"bg-neutral": gray === null || gray === void 0 ? void 0 : gray[100], "bg-base": gray === null || gray === void 0 ? void 0 : gray[50], "bg-table-header": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
174
|
+
"border-default": gray === null || gray === void 0 ? void 0 : gray[200], "border-light": gray === null || gray === void 0 ? void 0 : gray[100],
|
|
175
|
+
"border-dark": gray === null || gray === void 0 ? void 0 : gray[300], "border-input": gray === null || gray === void 0 ? void 0 : gray[300],
|
|
176
|
+
"border-error": (_b = sem.error) === null || _b === void 0 ? void 0 : _b[500], "border-success": (_c = sem.success) === null || _c === void 0 ? void 0 : _c[500],
|
|
177
|
+
"border-warning": (_d = sem.warning) === null || _d === void 0 ? void 0 : _d[500], "border-info": (_e = sem.info) === null || _e === void 0 ? void 0 : _e[500],
|
|
178
|
+
};
|
|
179
|
+
const set = (name, val) => val && root.style.setProperty(`--color-${name}`, val);
|
|
180
|
+
const clear = (name) => root.style.removeProperty(`--color-${name}`);
|
|
181
|
+
const allRampNames = [...HUE_SCALES, ...SEMANTIC_SCALES].flatMap((s) => RUNGS.map((r) => `${s}-${r}`));
|
|
182
|
+
if (resolvedMode === "dark") {
|
|
183
|
+
for (const s of HUE_SCALES)
|
|
184
|
+
for (const r of RUNGS)
|
|
185
|
+
set(`${s}-${r}`, (_f = colors[s]) === null || _f === void 0 ? void 0 : _f[r]);
|
|
186
|
+
for (const s of SEMANTIC_SCALES)
|
|
187
|
+
for (const r of RUNGS)
|
|
188
|
+
set(`${s}-${r}`, (_g = sem[s]) === null || _g === void 0 ? void 0 : _g[r]);
|
|
189
|
+
for (const [name, val] of Object.entries(SEMANTIC_VARS))
|
|
190
|
+
set(name, val);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
for (const name of allRampNames)
|
|
194
|
+
clear(name);
|
|
195
|
+
for (const name of Object.keys(SEMANTIC_VARS))
|
|
196
|
+
clear(name);
|
|
197
|
+
}
|
|
198
|
+
}, [resolvedMode, resolvedTheme]);
|
|
199
|
+
return ((0, jsx_runtime_1.jsx)(exports.ThemeModeContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(react_2.ChakraProvider, { theme: resolvedTheme, colorModeManager: forcedLightColorModeManager, children: (0, jsx_runtime_1.jsx)(Toaster_1.default, { children: children }) }) }));
|
|
90
200
|
};
|
|
91
201
|
exports.PixelizeThemeProvider = PixelizeThemeProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSwitcher.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/ThemeSwitcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeSwitcher.d.ts","sourceRoot":"","sources":["../../../src/Theme/provider/ThemeSwitcher.tsx"],"names":[],"mappings":"AAqBA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAkSF,eAAO,MAAM,aAAa,GAAI,8DAK3B,kBAAkB,4CAuBpB,CAAC"}
|
|
@@ -19,13 +19,24 @@ const SIZES = {
|
|
|
19
19
|
lg: { control: "lg", icon: 18 },
|
|
20
20
|
};
|
|
21
21
|
const toBrandLabel = (brand) => brand.charAt(0).toUpperCase() + brand.slice(1);
|
|
22
|
+
/**
|
|
23
|
+
* Same swatch each brand's own theme carries at `colors.primary[500]` (the
|
|
24
|
+
* anchor a filled button reads) — resolved per brand from its OWN palette so
|
|
25
|
+
* the dot always matches what selecting that brand actually looks like,
|
|
26
|
+
* regardless of which brand/mode is currently active.
|
|
27
|
+
*/
|
|
28
|
+
const brandSwatchColor = (brand) => {
|
|
29
|
+
var _a, _b, _c, _d, _e;
|
|
30
|
+
return (_e = (_d = (_c = (_b = (_a = index_1.brandThemes[brand]) === null || _a === void 0 ? void 0 : _a.light) === null || _b === void 0 ? void 0 : _b.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[500]) !== null && _e !== void 0 ? _e : "gray.400";
|
|
31
|
+
};
|
|
32
|
+
const BrandSwatch = ({ brand }) => ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-block", w: "0.625rem", h: "0.625rem", borderRadius: "full", bg: brandSwatchColor(brand), border: "1px solid", borderColor: "whiteAlpha.300", flexShrink: 0 }));
|
|
22
33
|
/**
|
|
23
34
|
* Palette values already differ per color mode (`brandThemes[brand].light|dark`), so tokens
|
|
24
35
|
* are read straight from the active theme — no `useColorModeValue` pairing needed here.
|
|
25
36
|
* Fallbacks are Chakra token names, never literal colors, for themes without a brand palette.
|
|
26
37
|
*/
|
|
27
38
|
const useSwitcherColors = () => {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
29
40
|
const colors = (0, useCustomTheme_1.useCustomTheme)().colors;
|
|
30
41
|
return {
|
|
31
42
|
trackBg: (_d = (_b = (_a = colors === null || colors === void 0 ? void 0 : colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.secondary) !== null && _b !== void 0 ? _b : (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[100]) !== null && _d !== void 0 ? _d : "gray.100",
|
|
@@ -34,19 +45,20 @@ const useSwitcherColors = () => {
|
|
|
34
45
|
mutedColor: (_q = (_o = (_m = colors === null || colors === void 0 ? void 0 : colors.text) === null || _m === void 0 ? void 0 : _m[600]) !== null && _o !== void 0 ? _o : (_p = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _p === void 0 ? void 0 : _p[600]) !== null && _q !== void 0 ? _q : "gray.600",
|
|
35
46
|
hoverBg: (_s = (_r = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _r === void 0 ? void 0 : _r[100]) !== null && _s !== void 0 ? _s : "gray.100",
|
|
36
47
|
borderColor: (_w = (_u = (_t = colors === null || colors === void 0 ? void 0 : colors.border) === null || _t === void 0 ? void 0 : _t[200]) !== null && _u !== void 0 ? _u : (_v = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _v === void 0 ? void 0 : _v[200]) !== null && _w !== void 0 ? _w : "gray.200",
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
// `--menu-bg` (and its hover/focus/active states) is now fixed centrally in the theme's
|
|
49
|
+
// Menu component style (Theme/chakra/Menu.styles.ts) — every MenuList gets it from there.
|
|
50
|
+
// Re-deriving it here too and pushing it back via `sx` on every render caused a redundant
|
|
51
|
+
// Emotion style recompute per render, which showed up as flicker while hovering/scrolling
|
|
52
|
+
// this list. Keep menuColor (Menu.styles.ts doesn't set list `color` per this component's
|
|
53
|
+
// needs) but stop duplicating menuBg.
|
|
54
|
+
menuColor: (_0 = (_y = (_x = colors === null || colors === void 0 ? void 0 : colors.text) === null || _x === void 0 ? void 0 : _x[900]) !== null && _y !== void 0 ? _y : (_z = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _z === void 0 ? void 0 : _z[900]) !== null && _0 !== void 0 ? _0 : "gray.900",
|
|
43
55
|
};
|
|
44
56
|
};
|
|
45
57
|
const BrandMenu = ({ size }) => {
|
|
46
58
|
const { brand, setBrand } = (0, useThemeMode_1.useThemeMode)();
|
|
47
|
-
const { mutedColor,
|
|
59
|
+
const { mutedColor, menuColor } = useSwitcherColors();
|
|
48
60
|
const brands = Object.keys(index_1.brandThemes);
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Menu, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.Button, size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", fontWeight: 500, "aria-label": `Brand theme, current ${toBrandLabel(brand)}`, _focusVisible: { boxShadow: "outline" }, children:
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Menu, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.Button, size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", fontWeight: 500, "aria-label": `Brand theme, current ${toBrandLabel(brand)}`, _focusVisible: { boxShadow: "outline" }, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(BrandSwatch, { brand: brand }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: toBrandLabel(brand) })] }) }), (0, jsx_runtime_1.jsx)(react_2.MenuList, { minW: "9rem", color: menuColor, children: (0, jsx_runtime_1.jsx)(react_2.MenuOptionGroup, { title: "Brand", type: "radio", value: brand, onChange: (value) => setBrand(value), children: brands.map((option) => ((0, jsx_runtime_1.jsx)(react_2.MenuItemOption, { value: option, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(BrandSwatch, { brand: option }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: toBrandLabel(option) })] }) }, option))) }) })] }));
|
|
50
62
|
};
|
|
51
63
|
const IconVariant = ({ size, label, }) => {
|
|
52
64
|
const { resolvedMode, toggle } = (0, useThemeMode_1.useThemeMode)();
|
|
@@ -82,10 +94,10 @@ const SegmentedVariant = ({ size, label, showBrandPicker, }) => {
|
|
|
82
94
|
const MenuVariant = ({ size, label, showBrandPicker, }) => {
|
|
83
95
|
var _a;
|
|
84
96
|
const { mode, brand, setMode, setBrand } = (0, useThemeMode_1.useThemeMode)();
|
|
85
|
-
const { mutedColor, hoverBg,
|
|
97
|
+
const { mutedColor, hoverBg, menuColor } = useSwitcherColors();
|
|
86
98
|
const active = (_a = MODE_OPTIONS.find((option) => option.value === mode)) !== null && _a !== void 0 ? _a : MODE_OPTIONS[0];
|
|
87
99
|
const brands = Object.keys(index_1.brandThemes);
|
|
88
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Menu, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.IconButton, "aria-label": label !== null && label !== void 0 ? label : `Color mode, current ${active.label}`, icon: (0, jsx_runtime_1.jsx)(active.Icon, { size: SIZES[size].icon, "aria-hidden": true }), size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", _hover: { bg: hoverBg }, _focusVisible: { boxShadow: "outline" } }), (0, jsx_runtime_1.jsxs)(react_2.MenuList, { minW: "10rem",
|
|
100
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Menu, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.IconButton, "aria-label": label !== null && label !== void 0 ? label : `Color mode, current ${active.label}`, icon: (0, jsx_runtime_1.jsx)(active.Icon, { size: SIZES[size].icon, "aria-hidden": true }), size: SIZES[size].control, variant: "ghost", color: mutedColor, borderRadius: "full", _hover: { bg: hoverBg }, _focusVisible: { boxShadow: "outline" } }), (0, jsx_runtime_1.jsxs)(react_2.MenuList, { minW: "10rem", color: menuColor, children: [(0, jsx_runtime_1.jsx)(react_2.MenuOptionGroup, { title: "Appearance", type: "radio", value: mode, onChange: (value) => setMode(value), children: MODE_OPTIONS.map(({ value, label: optionLabel, Icon }) => ((0, jsx_runtime_1.jsx)(react_2.MenuItemOption, { value: value, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(Icon, { size: SIZES[size].icon, "aria-hidden": true }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: optionLabel })] }) }, value))) }), showBrandPicker && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuDivider, {}), (0, jsx_runtime_1.jsx)(react_2.MenuOptionGroup, { title: "Brand", type: "radio", value: brand, onChange: (value) => setBrand(value), children: brands.map((option) => ((0, jsx_runtime_1.jsx)(react_2.MenuItemOption, { value: option, children: (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(BrandSwatch, { brand: option }), (0, jsx_runtime_1.jsx)(react_2.Text, { as: "span", children: toBrandLabel(option) })] }) }, option))) })] }))] })] }));
|
|
89
101
|
};
|
|
90
102
|
const ThemeSwitcher = ({ variant = "icon", showBrandPicker = false, size = "md", "aria-label": ariaLabel, }) => {
|
|
91
103
|
if (variant === "segmented") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Theme/tokens/brands/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Theme/tokens/brands/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAC5C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,UAAU,MAAM,4BAA4B,CAAC;AACpD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,OAAO,QAAQ,MAAM,qBAAqB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAgB3E,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC1F,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,GACT,CAAC;AAKF,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CAUzD,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,YAAY,CAUxD,CAAC;AAIF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAU/E,CAAC;AAEF,eAAO,MAAM,UAAU,EAAiC,SAAS,EAAE,CAAC"}
|
|
@@ -41,6 +41,7 @@ exports.storefrontDark = palette_dark_8.default;
|
|
|
41
41
|
const palette_dark_9 = __importDefault(require("./zinc/palette.dark"));
|
|
42
42
|
exports.zincDark = palette_dark_9.default;
|
|
43
43
|
const accentText_1 = require("../builders/accentText");
|
|
44
|
+
const outlineRung_1 = require("../builders/outlineRung");
|
|
44
45
|
/**
|
|
45
46
|
* Derived here rather than hand-written into each brand's literal: it must track that brand's
|
|
46
47
|
* own primary scale and canvas, and a stale hand-copied hex would silently fail AA.
|
|
@@ -53,29 +54,30 @@ const withAccentText = (palette) => {
|
|
|
53
54
|
accentText: (_a = palette.accentText) !== null && _a !== void 0 ? _a : (0, accentText_1.pickAccentText)(palette.primary, palette.backgroundColor.main, "light"),
|
|
54
55
|
});
|
|
55
56
|
};
|
|
57
|
+
const lightBrand = (palette) => (0, outlineRung_1.withOutlineRung)(withAccentText(palette), "light");
|
|
56
58
|
/** Light palette per brand. `lavender` is the base the other six extend. */
|
|
57
59
|
exports.lightPalettes = {
|
|
58
|
-
lavender:
|
|
59
|
-
meadow:
|
|
60
|
-
radiant:
|
|
61
|
-
skyline:
|
|
62
|
-
slate:
|
|
63
|
-
emerald:
|
|
64
|
-
rosewood:
|
|
65
|
-
storefront:
|
|
66
|
-
zinc:
|
|
60
|
+
lavender: lightBrand(palette_light_1.default),
|
|
61
|
+
meadow: lightBrand(palette_light_2.default),
|
|
62
|
+
radiant: lightBrand(palette_light_3.default),
|
|
63
|
+
skyline: lightBrand(palette_light_4.default),
|
|
64
|
+
slate: lightBrand(palette_light_5.default),
|
|
65
|
+
emerald: lightBrand(palette_light_6.default),
|
|
66
|
+
rosewood: lightBrand(palette_light_7.default),
|
|
67
|
+
storefront: lightBrand(palette_light_8.default),
|
|
68
|
+
zinc: lightBrand(palette_light_9.default),
|
|
67
69
|
};
|
|
68
70
|
/** Dark palette per brand, derived from the matching light palette. */
|
|
69
71
|
exports.darkPalettes = {
|
|
70
|
-
lavender: palette_dark_1.default,
|
|
71
|
-
meadow: palette_dark_2.default,
|
|
72
|
-
radiant: palette_dark_3.default,
|
|
73
|
-
skyline: palette_dark_4.default,
|
|
74
|
-
slate: palette_dark_5.default,
|
|
75
|
-
emerald: palette_dark_6.default,
|
|
76
|
-
rosewood: palette_dark_7.default,
|
|
77
|
-
storefront: palette_dark_8.default,
|
|
78
|
-
zinc: palette_dark_9.default,
|
|
72
|
+
lavender: (0, outlineRung_1.withOutlineRung)(palette_dark_1.default, "dark"),
|
|
73
|
+
meadow: (0, outlineRung_1.withOutlineRung)(palette_dark_2.default, "dark"),
|
|
74
|
+
radiant: (0, outlineRung_1.withOutlineRung)(palette_dark_3.default, "dark"),
|
|
75
|
+
skyline: (0, outlineRung_1.withOutlineRung)(palette_dark_4.default, "dark"),
|
|
76
|
+
slate: (0, outlineRung_1.withOutlineRung)(palette_dark_5.default, "dark"),
|
|
77
|
+
emerald: (0, outlineRung_1.withOutlineRung)(palette_dark_6.default, "dark"),
|
|
78
|
+
rosewood: (0, outlineRung_1.withOutlineRung)(palette_dark_7.default, "dark"),
|
|
79
|
+
storefront: (0, outlineRung_1.withOutlineRung)(palette_dark_8.default, "dark"),
|
|
80
|
+
zinc: (0, outlineRung_1.withOutlineRung)(palette_dark_9.default, "dark"),
|
|
79
81
|
};
|
|
80
82
|
// Built from lightPalettes/darkPalettes (not the raw literals) so accentText can never be
|
|
81
83
|
// present on one map and missing on the other.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.light.d.ts","sourceRoot":"","sources":["../../../../../src/Theme/tokens/brands/lavender/palette.light.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"palette.light.d.ts","sourceRoot":"","sources":["../../../../../src/Theme/tokens/brands/lavender/palette.light.ts"],"names":[],"mappings":"AAmTA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -150,7 +150,8 @@ const backgroundColor = {
|
|
|
150
150
|
secondary: "#f2edf8",
|
|
151
151
|
tertiary: "#ebe3f4",
|
|
152
152
|
quaternary: "#e2d8ef",
|
|
153
|
-
|
|
153
|
+
// A card must read as lifted off the tinted canvas; the old #fdfcfe was 2% away from it.
|
|
154
|
+
light: "#ffffff",
|
|
154
155
|
medium: "#e8e0f2",
|
|
155
156
|
accent: "#e0d5ed",
|
|
156
157
|
subtle: "#f5f1fa",
|
|
@@ -227,25 +228,31 @@ const sidebar = {
|
|
|
227
228
|
},
|
|
228
229
|
};
|
|
229
230
|
const boxborder = {
|
|
230
|
-
50: "#
|
|
231
|
-
100: "#
|
|
232
|
-
200: "#
|
|
233
|
-
300: "#
|
|
234
|
-
400: "#
|
|
235
|
-
500: "#
|
|
236
|
-
600: "#
|
|
231
|
+
50: "#f5f3f9",
|
|
232
|
+
100: "#ece8f3",
|
|
233
|
+
200: "#dad4e8",
|
|
234
|
+
300: "#d1c9e2",
|
|
235
|
+
400: "#c7bcda",
|
|
236
|
+
500: "#bcb0d1",
|
|
237
|
+
600: "#a79ac3",
|
|
237
238
|
700: "#918ba1",
|
|
238
239
|
800: "#6d6879",
|
|
239
240
|
900: "#52505b",
|
|
240
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* The low rungs sat two steps too pale to draw anything: `200` — the default hairline for
|
|
244
|
+
* cards, dividers and inputs — was L94 against a L98 canvas, so a card had no visible edge.
|
|
245
|
+
* It now lands at L88, contrast 1.22 against a white card, matching Chakra's gray.200 hairline.
|
|
246
|
+
* Rungs 700+ are unchanged; they were never the problem.
|
|
247
|
+
*/
|
|
241
248
|
const border = {
|
|
242
|
-
50: "#
|
|
243
|
-
100: "#
|
|
244
|
-
200: "#
|
|
245
|
-
300: "#
|
|
246
|
-
400: "#
|
|
247
|
-
500: "#
|
|
248
|
-
600: "#
|
|
249
|
+
50: "#f6f4f9",
|
|
250
|
+
100: "#ede9f4",
|
|
251
|
+
200: "#dcd5e9",
|
|
252
|
+
300: "#d3cbe3",
|
|
253
|
+
400: "#c9bedb",
|
|
254
|
+
500: "#beb2d2",
|
|
255
|
+
600: "#a99cc4",
|
|
249
256
|
700: "#938da3",
|
|
250
257
|
800: "#6f6a7c",
|
|
251
258
|
900: "#54505e",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.dark.d.ts","sourceRoot":"","sources":["../../../../../src/Theme/tokens/brands/zinc/palette.dark.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"palette.dark.d.ts","sourceRoot":"","sources":["../../../../../src/Theme/tokens/brands/zinc/palette.dark.ts"],"names":[],"mappings":"AAwLA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -93,13 +93,16 @@ const header = {
|
|
|
93
93
|
900: "#ffffff",
|
|
94
94
|
};
|
|
95
95
|
// muted-foreground = gray[500] = #a1a1aa (5.81:1 on the #27272a muted surface); it also serves
|
|
96
|
-
// as the focus ring on the #09090b canvas (7.76:1). gray[400] = the
|
|
96
|
+
// as the focus ring on the #09090b canvas (7.76:1). gray[400] = the interactive border/icon rung,
|
|
97
|
+
// and is the one value here NOT ported verbatim: it is pinned to whatever clears the 3:1 non-text
|
|
98
|
+
// bar on the LIGHTEST named surface, which is derived rather than ported. shadcn's own #71717a
|
|
99
|
+
// measures 2.81 there, so this sits two steps lighter (3.19).
|
|
97
100
|
const gray = {
|
|
98
101
|
50: "#18181b",
|
|
99
102
|
100: "#27272a",
|
|
100
103
|
200: "#3f3f46",
|
|
101
104
|
300: "#52525b",
|
|
102
|
-
400: "#
|
|
105
|
+
400: "#7a7a83",
|
|
103
106
|
500: "#a1a1aa",
|
|
104
107
|
600: "#b4b4bb",
|
|
105
108
|
700: "#d4d4d8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDarkPalette.d.ts","sourceRoot":"","sources":["../../../../src/Theme/tokens/builders/buildDarkPalette.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA2CrE,uEAAuE;AACvE,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,KAAG,UAW/C,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,KAAG,UAW/C,CAAC;AAOH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,WAAW,MAAM,EAAE,OAAO,MAAM,KAAG,MAWvE,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,SAAS,GAAI,OAAO,UAAU,EAAE,OAAO,MAAM,KAAG,UAM5D,CAAC;
|
|
1
|
+
{"version":3,"file":"buildDarkPalette.d.ts","sourceRoot":"","sources":["../../../../src/Theme/tokens/builders/buildDarkPalette.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA2CrE,uEAAuE;AACvE,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,KAAG,UAW/C,CAAC;AAEH,sFAAsF;AACtF,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,KAAG,UAW/C,CAAC;AAOH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,WAAW,MAAM,EAAE,OAAO,MAAM,KAAG,MAWvE,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,SAAS,GAAI,OAAO,UAAU,EAAE,OAAO,MAAM,KAAG,UAM5D,CAAC;AAkJF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAwElE;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -169,8 +169,11 @@ const TEXT_TARGETS = {
|
|
|
169
169
|
const PLACEHOLDER_TARGETS = {
|
|
170
170
|
50: 25, 100: 30, 200: 35, 300: 42, 400: 48, 500: 54, 600: 60, 700: 66, 800: 72, 900: 80,
|
|
171
171
|
};
|
|
172
|
+
// Rung 200 is the default hairline. At L18 it sat 5 points off a card at L13 — below the
|
|
173
|
+
// perceptible step, so dark cards read as edgeless. L22 draws the same 1.2x edge the light
|
|
174
|
+
// ramp does, which is what makes a card look like a card in either mode.
|
|
172
175
|
const BORDER_TARGETS = {
|
|
173
|
-
50:
|
|
176
|
+
50: 14, 100: 18, 200: 22, 300: 24, 400: 26, 500: 27, 600: 33, 700: 42, 800: 52, 900: 62,
|
|
174
177
|
};
|
|
175
178
|
const DISABLED_TARGETS = {
|
|
176
179
|
50: 14, 100: 18, 200: 22, 300: 26, 400: 30, 500: 34, 600: 42, 700: 52, 800: 62, 900: 72,
|
|
@@ -215,12 +218,22 @@ const NAMED_SURFACE_L = {
|
|
|
215
218
|
accent: 17,
|
|
216
219
|
muted: 18,
|
|
217
220
|
};
|
|
218
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Surfaces are hue-NEUTRAL in dark: every brand shares one canvas, so switching theme recolors the
|
|
223
|
+
* accents and nothing else. Tinting them instead (this was 14) made a full-screen wash — Meadow's
|
|
224
|
+
* whole app read green — which reads as a different product per brand rather than a different
|
|
225
|
+
* accent. Light mode keeps its tinted canvas; there the tint is a hint on white, not the whole
|
|
226
|
+
* screen. Brand identity in dark lives in `primary`/semantic/text, which stay hued.
|
|
227
|
+
*/
|
|
228
|
+
const SURFACE_SAT = 0;
|
|
219
229
|
const TEXT_SAT = 12;
|
|
220
230
|
const PLACEHOLDER_SAT = 10;
|
|
221
231
|
const BORDER_SAT = 12;
|
|
222
232
|
const DISABLED_SAT = 8;
|
|
223
|
-
|
|
233
|
+
// Neutral for the same reason as SURFACE_SAT — gray's low rungs ARE surfaces, and a tinted ramp
|
|
234
|
+
// on a neutral canvas reads as a mismatch. It also buys back the contrast the neutral canvas
|
|
235
|
+
// cost: `gray[400]` on `muted` was 2.99 on lavender/zinc at sat 6, and is 3.16 at 0.
|
|
236
|
+
const GRAY_SAT = 0;
|
|
224
237
|
function buildDarkPalette(light) {
|
|
225
238
|
const hueSource = light.primary[500];
|
|
226
239
|
const { h } = (0, color_1.hexToHsl)(hueSource);
|
|
@@ -265,7 +278,9 @@ function buildDarkPalette(light) {
|
|
|
265
278
|
placeholder: fromTargets(hueSource, PLACEHOLDER_TARGETS, PLACEHOLDER_SAT),
|
|
266
279
|
border: fromTargets(hueSource, BORDER_TARGETS, BORDER_SAT),
|
|
267
280
|
boxborder: fromTargets(hueSource, BORDER_TARGETS, BORDER_SAT),
|
|
268
|
-
|
|
281
|
+
// Neutral: a row hover is a surface fill, and across a full table its tint is exactly the
|
|
282
|
+
// brand wash the canvas was changed to avoid.
|
|
283
|
+
table: { hover: fromTargets(hueSource, TABLE_HOVER_TARGETS, SURFACE_SAT) },
|
|
269
284
|
disabled: fromTargets(hueSource, DISABLED_TARGETS, DISABLED_SAT),
|
|
270
285
|
// Derived from the LIFTED accent against the dark canvas: the lift stops at the white-label
|
|
271
286
|
// floor (~4.55), which leaves primary[500] short of AA as text, so text needs its own rung.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PaletteProps, ResolvedColorMode } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
4
|
+
* all — same value the SideBar ladder, Accordion, and NavigationBar hover states are held to.
|
|
5
|
+
* A "hover" a user cannot perceive is not a hover.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MIN_PERCEPTIBLE_STEP = 1.15;
|
|
8
|
+
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
9
|
+
export declare const AA_NON_TEXT = 3;
|
|
10
|
+
/**
|
|
11
|
+
* Walks a hex toward `target` contrast against `backdrop`, keeping its hue and saturation so the
|
|
12
|
+
* result still reads as the same colour. Darkens when `mode` is light, lightens when dark, and
|
|
13
|
+
* stops at the FIRST passing step so nothing overshoots to black or white.
|
|
14
|
+
*/
|
|
15
|
+
export declare function liftToContrast(hex: string, backdrop: string, mode: ResolvedColorMode, target?: number): string;
|
|
16
|
+
/**
|
|
17
|
+
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
18
|
+
* pickers, the editor's inputs). It was authored as a decorative value — measured 1.30-2.56:1
|
|
19
|
+
* across brands, so those controls rendered effectively borderless in BOTH modes. Resolved here
|
|
20
|
+
* rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
21
|
+
*
|
|
22
|
+
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
23
|
+
* and outside 1.4.11.
|
|
24
|
+
*/
|
|
25
|
+
export declare function withOutlineRung(palette: PaletteProps, mode: ResolvedColorMode): PaletteProps;
|
|
26
|
+
/**
|
|
27
|
+
* A hover/active tint resolved against the surface it actually sits on, guaranteed to clear
|
|
28
|
+
* `MIN_PERCEPTIBLE_STEP`. Written for the recurring shape found across NavigationBar, UserDetails
|
|
29
|
+
* and Accordion: a pale `primary[50]`/`gray[50]` tint that measures near-1.0 on a near-white
|
|
30
|
+
* surface — invisible — with no dark-mode branch, so the same call site is wrong in both modes at
|
|
31
|
+
* once. `restSurface` is required rather than assumed white/black: a menu item's hover sits on
|
|
32
|
+
* its OWN list background, not necessarily the page canvas.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveHoverTint(seed: string, restSurface: string): string;
|
|
35
|
+
//# sourceMappingURL=outlineRung.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlineRung.d.ts","sourceRoot":"","sources":["../../../../src/Theme/tokens/builders/outlineRung.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,+EAA+E;AAC/E,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,iBAAiB,EACvB,MAAM,GAAE,MAAoB,GAC3B,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,iBAAiB,GAAG,YAAY,CAc5F;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAG1E"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AA_NON_TEXT = exports.MIN_PERCEPTIBLE_STEP = void 0;
|
|
4
|
+
exports.liftToContrast = liftToContrast;
|
|
5
|
+
exports.withOutlineRung = withOutlineRung;
|
|
6
|
+
exports.resolveHoverTint = resolveHoverTint;
|
|
7
|
+
const color_1 = require("./color");
|
|
8
|
+
const accentText_1 = require("./accentText");
|
|
9
|
+
/**
|
|
10
|
+
* The floor a hover/active state's step off its own resting surface must clear to be seen at
|
|
11
|
+
* all — same value the SideBar ladder, Accordion, and NavigationBar hover states are held to.
|
|
12
|
+
* A "hover" a user cannot perceive is not a hover.
|
|
13
|
+
*/
|
|
14
|
+
exports.MIN_PERCEPTIBLE_STEP = 1.15;
|
|
15
|
+
/** WCAG 1.4.11 — a control outline is a UI component boundary, held to 3:1. */
|
|
16
|
+
exports.AA_NON_TEXT = 3;
|
|
17
|
+
/**
|
|
18
|
+
* Walks a hex toward `target` contrast against `backdrop`, keeping its hue and saturation so the
|
|
19
|
+
* result still reads as the same colour. Darkens when `mode` is light, lightens when dark, and
|
|
20
|
+
* stops at the FIRST passing step so nothing overshoots to black or white.
|
|
21
|
+
*/
|
|
22
|
+
function liftToContrast(hex, backdrop, mode, target = exports.AA_NON_TEXT) {
|
|
23
|
+
if ((0, color_1.contrastRatio)(hex, backdrop) >= target)
|
|
24
|
+
return hex;
|
|
25
|
+
const { s } = (0, color_1.hexToHsl)(hex);
|
|
26
|
+
const step = mode === "dark" ? 1 : -1;
|
|
27
|
+
let { l } = (0, color_1.hexToHsl)(hex);
|
|
28
|
+
while (l > 0 && l < 100) {
|
|
29
|
+
l += step;
|
|
30
|
+
const next = (0, color_1.withLightness)(hex, l, s);
|
|
31
|
+
if ((0, color_1.contrastRatio)(next, backdrop) >= target)
|
|
32
|
+
return next;
|
|
33
|
+
}
|
|
34
|
+
return (0, color_1.withLightness)(hex, mode === "dark" ? 100 : 0, s);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `boxborder[500]` is the rung every control outline reads (Checkbox, SearchSelect, the date
|
|
38
|
+
* pickers, the editor's inputs). It was authored as a decorative value — measured 1.30-2.56:1
|
|
39
|
+
* across brands, so those controls rendered effectively borderless in BOTH modes. Resolved here
|
|
40
|
+
* rather than hand-pinned per brand: a copied hex goes stale the moment a canvas moves.
|
|
41
|
+
*
|
|
42
|
+
* `border[*]` is deliberately untouched — that ramp draws table gridlines, which are decorative
|
|
43
|
+
* and outside 1.4.11.
|
|
44
|
+
*/
|
|
45
|
+
function withOutlineRung(palette, mode) {
|
|
46
|
+
const current = palette.boxborder[500];
|
|
47
|
+
// The border sits between the control's fill and the surface behind it; hold it to the
|
|
48
|
+
// harder of the two.
|
|
49
|
+
const backdrop = (0, color_1.contrastRatio)(current, palette.backgroundColor.main) <=
|
|
50
|
+
(0, color_1.contrastRatio)(current, palette.background[50])
|
|
51
|
+
? palette.backgroundColor.main
|
|
52
|
+
: palette.background[50];
|
|
53
|
+
const resolved = liftToContrast(current, backdrop, mode);
|
|
54
|
+
if (resolved === current)
|
|
55
|
+
return palette;
|
|
56
|
+
return { ...palette, boxborder: { ...palette.boxborder, 500: resolved } };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A hover/active tint resolved against the surface it actually sits on, guaranteed to clear
|
|
60
|
+
* `MIN_PERCEPTIBLE_STEP`. Written for the recurring shape found across NavigationBar, UserDetails
|
|
61
|
+
* and Accordion: a pale `primary[50]`/`gray[50]` tint that measures near-1.0 on a near-white
|
|
62
|
+
* surface — invisible — with no dark-mode branch, so the same call site is wrong in both modes at
|
|
63
|
+
* once. `restSurface` is required rather than assumed white/black: a menu item's hover sits on
|
|
64
|
+
* its OWN list background, not necessarily the page canvas.
|
|
65
|
+
*/
|
|
66
|
+
function resolveHoverTint(seed, restSurface) {
|
|
67
|
+
const mode = (0, accentText_1.isDarkCanvas)(restSurface) ? "dark" : "light";
|
|
68
|
+
return liftToContrast(seed, restSurface, mode, exports.MIN_PERCEPTIBLE_STEP);
|
|
69
|
+
}
|