@cube-dev/ui-kit 0.138.2 → 0.138.4
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/CHANGELOG.md +16 -0
- package/dist/_internal/hooks/use-chained-callback.js +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +15 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js.map +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/intl.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/extract-field-wrapper-props.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/FileTabs/FileTabs.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/CloudLogo/CloudLogo.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +15 -15
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/colors.js +3 -3
- package/dist/tokens/colors.js.map +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/palette.js +74 -4
- package/dist/tokens/palette.js.map +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.d.ts +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/glaze/api.md +1074 -0
- package/docs/glaze/methodology.md +330 -0
- package/docs/glaze/migration.md +237 -0
- package/package.json +2 -2
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Methodology
|
|
2
|
+
|
|
3
|
+
A practical guide for designing a real, production-grade Glaze palette. Recipe-ordered: the sections follow the same sequence you'd actually build a palette in, and each one ties the choice back to a Glaze behavior.
|
|
4
|
+
|
|
5
|
+
## The mental model
|
|
6
|
+
|
|
7
|
+
A Glaze palette is a **default neutral theme** plus a small fan of **colored sibling themes** (`success`, `danger`, `warning`, `note`, …) created via `extend()`. Most colors live in the default theme as neutrals; brand-tinted colors come from `extend()` swapping the hue.
|
|
8
|
+
|
|
9
|
+
The default theme is what most components consume — its tokens are emitted unprefixed (`#surface`, `#border`). Colored themes are scoped to status surfaces and accent variants, emitted with a theme-name prefix (`#success-surface`, `#danger-accent-surface`).
|
|
10
|
+
|
|
11
|
+
You design the default theme once, and `extend()` propagates that design across every status hue.
|
|
12
|
+
|
|
13
|
+
## Hue / saturation seeds
|
|
14
|
+
|
|
15
|
+
Declare hues as named constants up top, plus a single shared seed saturation:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
const PURPLE_HUE = 280.3;
|
|
19
|
+
const SUCCESS_HUE = 156.9;
|
|
20
|
+
const DANGER_HUE = 23.1;
|
|
21
|
+
const WARNING_HUE = 84.3;
|
|
22
|
+
const NOTE_HUE = 302.3;
|
|
23
|
+
|
|
24
|
+
const SEED_SATURATION = 80;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Hues are design tokens too — keeping them named in one place beats burying numbers in `extend()` calls. The shared `SEED_SATURATION` keeps every status theme on the same saturation budget; per-color `saturation` factors below are 0–1 *of this seed*, not absolute.
|
|
28
|
+
|
|
29
|
+
## Global `glaze.configure()`
|
|
30
|
+
|
|
31
|
+
Configure state aliases and output modes once at module load:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
glaze.configure({
|
|
35
|
+
states: { dark: '@dark', highContrast: '@hc' },
|
|
36
|
+
modes: { dark: true, highContrast: true },
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Match the state alias names to whatever your app wires into the global predefined states (`@dark` / `@hc` is what Tasty expects). Setting `modes.highContrast: true` makes every export emit four variants — HC tokens are then available globally without per-call overrides.
|
|
41
|
+
|
|
42
|
+
## Naming conventions
|
|
43
|
+
|
|
44
|
+
A tight, predictable vocabulary that the rest of the doc relies on:
|
|
45
|
+
|
|
46
|
+
| Pattern | Tokens |
|
|
47
|
+
|---|---|
|
|
48
|
+
| Surface ladder | `surface`, `surface-2`, `surface-3` |
|
|
49
|
+
| Text on surface (decreasing prominence) | `<surface>-text`, `<surface>-text-soft`, `<surface>-text-soft-2` |
|
|
50
|
+
| Misc neutral primitives | `border`, `placeholder`, `focus`, `disabled` |
|
|
51
|
+
| Neutral disabled chip | `disabled-surface`, `disabled-surface-text` |
|
|
52
|
+
| Fixed-mode dark surface | `surface-inverse` |
|
|
53
|
+
| Brand fills | `accent-surface`, `accent-surface-2`, `accent-surface-3`, `accent-surface-hover` |
|
|
54
|
+
| Brand fill anchor | `accent-surface-text` (the fixed white token everything anchors to) |
|
|
55
|
+
| Brand foregrounds on neutrals | `accent-text`, `accent-text-soft`, `accent-icon` |
|
|
56
|
+
| Brand-tinted disabled | `accent-disabled-surface`, `accent-disabled-surface-text` |
|
|
57
|
+
| Code syntax highlighting | `code-comment`, `code-keyword`, `code-string`, `code-number`, … |
|
|
58
|
+
| Loading animation | `loading-face-1`, `loading-face-2`, `loading-face-3` |
|
|
59
|
+
| Shadows | `shadow-sm`, `shadow-md`, `shadow-lg` |
|
|
60
|
+
| Backdrop | `overlay` |
|
|
61
|
+
|
|
62
|
+
**Rule of thumb:** *purpose-name first, variant suffix last* (`-2`, `-text`, `-soft`, `-hover`, `-disabled`).
|
|
63
|
+
|
|
64
|
+
## Surfaces (root colors)
|
|
65
|
+
|
|
66
|
+
`surface` is a root color (absolute `lightness`, no `base`) with a low saturation factor. The ladder chains off it via small relative offsets:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
defaultTheme.colors({
|
|
70
|
+
surface: { lightness: 100, saturation: 0.11 },
|
|
71
|
+
'surface-2': { base: 'surface', lightness: '-2', saturation: 0.15, inherit: false },
|
|
72
|
+
'surface-3': { base: 'surface', lightness: '-4', saturation: 0.19, inherit: false },
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
A factor of `0.11` of the seed gives a barely-noticeable hue shift — enough that light/dark surfaces feel branded, not enough to look tinted. The slight saturation bump on `-2` / `-3` compensates for perceived saturation dropping as lightness drops, so the ladder reads as one consistent surface family.
|
|
77
|
+
|
|
78
|
+
`mode: 'auto'` (the default) feeds these through Glaze's Möbius dark inversion, so an `L=100` light-mode surface lands near `L≈15` in dark mode with proportional deltas across the ladder preserved. `inherit: false` on `-2` / `-3` keeps colored sibling themes lean — they only need a single tinted `surface`, not the whole ladder.
|
|
79
|
+
|
|
80
|
+
## Text on surfaces (anchor at the edge)
|
|
81
|
+
|
|
82
|
+
The headline trick of the whole methodology. Strong text uses an **absolute `lightness` near the edge of the window**; soft variants use a **directional relative hint plus a numeric `contrast`**.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
'surface-text': {
|
|
86
|
+
base: 'surface', lightness: 2, saturation: 0.475,
|
|
87
|
+
},
|
|
88
|
+
'surface-text-soft': {
|
|
89
|
+
base: 'surface', lightness: '-1', saturation: 0.375,
|
|
90
|
+
contrast: [9, 11], inherit: false,
|
|
91
|
+
},
|
|
92
|
+
'surface-text-soft-2': {
|
|
93
|
+
base: 'surface', lightness: '-1', saturation: 0.24,
|
|
94
|
+
contrast: [4.5, 5.5], inherit: false,
|
|
95
|
+
},
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Repeat the same triple anchored to each subordinate surface (`surface-2-text`, `surface-2-text-soft`, `surface-3-text`, …) so the ladder stays self-consistent.
|
|
99
|
+
|
|
100
|
+
The strong-text `lightness: 2` pins the light-mode resolved value to **L≈11.8** (mapped through the default `[10, 100]` window) and inverts to **L≈94** in dark mode (cr≈13.7 vs the dark surface). A `contrast: 'AAA'` solver pass would have stopped at L≈21 — meeting the AAA floor and no further. **Anchoring at the edge** beats the contrast solver because the solver only needs to *meet* the floor, not exceed it.
|
|
101
|
+
|
|
102
|
+
The soft variants use `lightness: '-1'` only as a *directional hint* — the real positioning comes from the numeric `contrast`. Numeric ratios give designers precise perceived weight where presets would only guarantee the AA/AAA floor.
|
|
103
|
+
|
|
104
|
+
In high-contrast mode the lightness window is bypassed entirely, so `lightness: 2` resolves to L=2 in light HC and L≈99 in dark HC (cr≈20.8 / 20.5).
|
|
105
|
+
|
|
106
|
+
## Other neutral primitives
|
|
107
|
+
|
|
108
|
+
Borders, placeholders, focus rings, and the floating "muted text" lightness — all default-only:
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
border: { base: 'surface', lightness: ['-10', '-20'], saturation: 0.175, inherit: false },
|
|
112
|
+
placeholder: { base: 'surface', lightness: 67, saturation: 0.175, inherit: false },
|
|
113
|
+
focus: { base: 'surface', lightness: 71, saturation: 0.8625, inherit: false },
|
|
114
|
+
disabled: { lightness: 80.8, saturation: 0.4, inherit: false },
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`border` uses an HC pair — the border darkens twice as much in high-contrast mode for visibility. `placeholder` and `focus` give a `base` for namespacing but use absolute lightness independently. `disabled` is a root color (no `base`) — it's used as a plain "muted text" token in some places, free of the surface chain.
|
|
118
|
+
|
|
119
|
+
## Disabled chip (contrast-driven for scheme symmetry)
|
|
120
|
+
|
|
121
|
+
The disabled chip + label pair uses `mode: 'auto'` and **explicit numeric contrast** against `surface`, not preset `'AA'` / `'AAA'`:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
'disabled-surface': {
|
|
125
|
+
base: 'surface', lightness: '-1', saturation: 0.2,
|
|
126
|
+
contrast: [1.1, 1.2], inherit: false,
|
|
127
|
+
},
|
|
128
|
+
'disabled-surface-text': {
|
|
129
|
+
base: 'surface', lightness: '-1', saturation: 0.3,
|
|
130
|
+
contrast: [2, 2.5], inherit: false,
|
|
131
|
+
},
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
These tokens *anchor a perceived ratio against `surface`*, so the disabled state resolves to the same numbers in light, dark, and HC (chip ≈ 1.4 vs surface, label ≈ 2.0, text-on-chip ≈ 1.4). An alpha-tinted overlay would have asymmetric behavior — composited alpha against a near-white light surface produces a much weaker chip than the same overlay against a near-dark dark surface, and the disabled state would stop *looking* disabled in one of the schemes.
|
|
135
|
+
|
|
136
|
+
The general rule: when a color needs to *feel the same across schemes*, anchor it with `mode: 'auto'` + a numeric contrast against a surface, not with a preset.
|
|
137
|
+
|
|
138
|
+
## `surface-inverse` (the fixed-mode escape hatch)
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
'surface-inverse': {
|
|
142
|
+
lightness: 12, saturation: 0.475, mode: 'fixed', inherit: false,
|
|
143
|
+
},
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`mode: 'fixed'` skips the dark-scheme Möbius inversion and only does a linear window mapping, so `surface-inverse` reads as a dark surface in *every* scheme — light, dark, and HC. Use it for tooltips, code blocks, popovers with their own dark theme. Pair with `#white` for foreground text.
|
|
147
|
+
|
|
148
|
+
This is the canonical "I want this color to stay recognizable" pattern. The other `mode: 'fixed'` use is the entire accent system below.
|
|
149
|
+
|
|
150
|
+
## Accent system (anchor pattern)
|
|
151
|
+
|
|
152
|
+
The load-bearing trick. Define a single fixed white anchor `accent-surface-text`, then derive every accent surface from it with a small relative lightness offset and a numeric contrast under `mode: 'fixed'`:
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
'accent-surface-text': { lightness: 100, mode: 'fixed' },
|
|
156
|
+
|
|
157
|
+
'accent-surface': { base: 'accent-surface-text', lightness: '-1', contrast: [4.5, 7], mode: 'fixed' },
|
|
158
|
+
'accent-surface-2': { base: 'accent-surface-text', lightness: '-1', contrast: [4.8, 7.5], mode: 'fixed' },
|
|
159
|
+
'accent-surface-3': { base: 'accent-surface-text', lightness: '-1', contrast: [5.2, 8], mode: 'fixed' },
|
|
160
|
+
'accent-surface-hover': { base: 'accent-surface-text', lightness: '-1', contrast: [6, 8.5], mode: 'fixed' },
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Three things make this work:
|
|
164
|
+
|
|
165
|
+
- **One anchor, one chain.** All accent surfaces stay in the same hue family because they all derive from `accent-surface-text`.
|
|
166
|
+
- **`mode: 'fixed'` keeps the brand recognizable.** Without it, the dark-scheme Möbius inversion would turn the brand fill into a lightness-inverted counterpart that may no longer read as the intended brand surface. Fixed maps lightness linearly into the dark window, so a `L=52` brand color resolves to ~L=51.6 in dark mode — still recognizably the same color.
|
|
167
|
+
- **Numeric contrasts, not presets.** `'AA'` / `'AAA'` would let the solver push the color far away from its anchor in dark schemes, breaking the relationship between `accent-surface` and its neighbors. Numeric ratios make the darkening between `accent-surface` (4.5/7), `-2` (4.8/7.5), `-3` (5.2/8), and `-hover` (6/8.5) a tight, designed sequence — a stepped gradient rather than four solver-generated outliers.
|
|
168
|
+
|
|
169
|
+
The hover variant is a dedicated *fixed* token. Reusing `accent-text` (which is `mode: 'auto'` and inverts direction in dark) would break the hover feel.
|
|
170
|
+
|
|
171
|
+
## Adaptive accent foregrounds
|
|
172
|
+
|
|
173
|
+
The opposite of the fills. Brand-colored *foregrounds* are anchored to **`surface`, not `accent-surface`**, with `mode: 'auto'` (default) and full saturation:
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
'accent-text': { base: 'surface', lightness: '-1', saturation: 1, contrast: [6.4, 10] },
|
|
177
|
+
'accent-text-soft': { base: 'surface', lightness: '-1', saturation: 1, contrast: [4.5, 7] },
|
|
178
|
+
'accent-icon': { base: 'surface', lightness: '-1', saturation: 0.9375, contrast: [3.2, 5] },
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Foregrounds need to stay readable on the surface they actually sit on — anchoring to the brand fill would only enforce contrast against that fill, leaving the dark-mode color washed out against the actual surface (e.g. SECONDARY button labels sit on `surface`, not on the brand fill). Anchoring to `surface` + `mode: 'auto'` lets the solver lift the lightness in dark mode so the contrast floor holds in both schemes.
|
|
182
|
+
|
|
183
|
+
`accent-text-soft` shares the anchor and saturation but relaxes the contrast floor for a visibly less prominent secondary foreground (link base color, subdued labels). Critically, it stays `mode: 'auto'` — a fixed version would collapse to cr≈3 against the dark surface and break AA.
|
|
184
|
+
|
|
185
|
+
## Brand-tinted disabled
|
|
186
|
+
|
|
187
|
+
Mirrors the neutral disabled pair from above but with higher saturation so the chip reads as a *muted brand color* rather than fully neutral grey:
|
|
188
|
+
|
|
189
|
+
```ts
|
|
190
|
+
'accent-disabled-surface': {
|
|
191
|
+
base: 'surface', lightness: '-1', saturation: 0.5,
|
|
192
|
+
contrast: [1.4, 1.3],
|
|
193
|
+
},
|
|
194
|
+
'accent-disabled-surface-text': {
|
|
195
|
+
base: 'accent-disabled-surface', lightness: '+1', saturation: 0.4,
|
|
196
|
+
contrast: 1.51, mode: 'fixed',
|
|
197
|
+
},
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
These are inherited (no `inherit: false`), so each colored sibling theme automatically emits `<theme>-accent-disabled-surface` and `<theme>-accent-disabled-surface-text`. PRIMARY-style disabled buttons stay tinted with the active theme's hue (danger-tinted danger button, success-tinted success button), preserving brand identity even in the disabled state.
|
|
201
|
+
|
|
202
|
+
## Per-color hue overrides (code highlighting)
|
|
203
|
+
|
|
204
|
+
The `code-*` tokens use **absolute `hue` numbers** regardless of the seed. Each is `base: 'surface'` with `mode: 'auto'`, a per-token saturation, and a numeric contrast floor:
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
'code-comment': { base: 'surface', hue: 280, saturation: 0.1, lightness: '-1', contrast: [4.5, 7], inherit: false },
|
|
208
|
+
'code-keyword': { base: 'surface', hue: 348, saturation: 1, lightness: '-1', contrast: [5, 7.5], inherit: false },
|
|
209
|
+
'code-string': { base: 'surface', hue: PURPLE_HUE, saturation: 1, lightness: '-1', contrast: [4.5, 7], inherit: false },
|
|
210
|
+
// …code-punctuation, code-number, code-function, code-attribute follow the same shape
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
The canonical pattern for "I want a color from a different hue family but the same adaptive behavior". Absolute `hue` overrides the theme seed for a single color; everything else (contrast against `surface`, dark adaptation, HC tightening) still works. `inherit: false` because syntax highlighting is a default-only concern.
|
|
214
|
+
|
|
215
|
+
## Loading-animation faces
|
|
216
|
+
|
|
217
|
+
A 3-step ramp using *absolute* lightnesses with high saturation factors and tight numeric contrasts:
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
'loading-face-1': { base: 'surface', lightness: 98, saturation: 0.3, contrast: [1.04, 1.5], inherit: false },
|
|
221
|
+
'loading-face-2': { base: 'surface', lightness: 91, saturation: 0.62, contrast: [1.24, 2.5], inherit: false },
|
|
222
|
+
'loading-face-3': { base: 'surface', lightness: 79, saturation: 0.66, contrast: [1.75, 4], inherit: false },
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Combines absolute lightness positioning (so the ramp is deterministic in light mode) with a numeric contrast floor (so the ramp still reads in dark and HC). The HC contrast jumps significantly (`1.04 → 1.5`, `1.24 → 2.5`, `1.75 → 4`) so the animation stays perceivable for low-vision users.
|
|
226
|
+
|
|
227
|
+
## Shadows
|
|
228
|
+
|
|
229
|
+
Three sizes, all sharing `bg: 'surface'` and `fg: 'surface-text'`, varying only `intensity`:
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
'shadow-sm': { type: 'shadow', bg: 'surface', fg: 'surface-text', intensity: 5, inherit: false },
|
|
233
|
+
'shadow-md': { type: 'shadow', bg: 'surface', fg: 'surface-text', intensity: 10, inherit: false },
|
|
234
|
+
'shadow-lg': { type: 'shadow', bg: 'surface', fg: 'surface-text', intensity: 15, inherit: false },
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Including `fg` matters: shadow strength scales with `|l_bg − l_fg|`, so anchoring `fg` to `surface-text` (which is anchored at the edge of the window) makes shadows *automatically deeper* in dark mode where the bg/fg gap is larger. All shadows are `inherit: false` — there's only one shadow system for the whole UI, and colored sibling themes don't carry their own.
|
|
238
|
+
|
|
239
|
+
For HC, pass `intensity: [normal, hc]` (e.g. `[10, 20]`) to deepen shadows in high-contrast mode. The full algorithm and tuning knobs are in [api.md → Shadows](api.md#shadows).
|
|
240
|
+
|
|
241
|
+
## Overlay (fixed opacity)
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
overlay: { lightness: 10, opacity: 0.5, inherit: false },
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
The shortcut for *one solid color with a fixed alpha* — no shadow algorithm, no mix. `opacity` on a regular color attaches an alpha component to every variant. Use it for backdrops, scrims, modal overlays. (Combining `opacity` with `contrast` is not recommended — perceived lightness becomes unpredictable when alpha is fixed; Glaze emits a `console.warn`.)
|
|
248
|
+
|
|
249
|
+
## Mixes for hover / tint
|
|
250
|
+
|
|
251
|
+
Reach for mix tokens when you want one color to "tint through" another:
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
hover: {
|
|
255
|
+
type: 'mix', base: 'surface', target: 'accent-surface',
|
|
256
|
+
value: 8, blend: 'transparent',
|
|
257
|
+
},
|
|
258
|
+
// hover → accent-surface with alpha = 0.08
|
|
259
|
+
|
|
260
|
+
tint: {
|
|
261
|
+
type: 'mix', base: 'surface', target: 'accent-surface',
|
|
262
|
+
value: 20,
|
|
263
|
+
},
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
- **Transparent mix** — *the target color with controlled alpha*. Useful for hover overlays.
|
|
267
|
+
- **Opaque mix** — solid blend of two colors. Good for subtle tints.
|
|
268
|
+
|
|
269
|
+
Choose `space: 'okhsl'` (default) for design tokens — perceptually uniform, consistent with the rest of Glaze. Choose `space: 'srgb'` to match what the browser would render with a plain CSS overlay. Mix colors support the same `contrast` prop as regular colors; the solver adjusts the mix ratio (opaque) or opacity (transparent) to meet the target.
|
|
270
|
+
|
|
271
|
+
## Colored sibling themes via `extend()`
|
|
272
|
+
|
|
273
|
+
One shared `TINTED_SURFACE_OVERRIDE`, applied to every colored theme, with only the `hue` changing per status:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
const TINTED_SURFACE_OVERRIDE: ColorMap = {
|
|
277
|
+
surface: { lightness: 96, saturation: 0.8 },
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const primaryTheme = defaultTheme.extend({ colors: TINTED_SURFACE_OVERRIDE });
|
|
281
|
+
const successTheme = defaultTheme.extend({ hue: SUCCESS_HUE, colors: TINTED_SURFACE_OVERRIDE });
|
|
282
|
+
const dangerTheme = defaultTheme.extend({ hue: DANGER_HUE, colors: TINTED_SURFACE_OVERRIDE });
|
|
283
|
+
const warningTheme = defaultTheme.extend({ hue: WARNING_HUE, colors: TINTED_SURFACE_OVERRIDE });
|
|
284
|
+
const noteTheme = defaultTheme.extend({ hue: NOTE_HUE, colors: TINTED_SURFACE_OVERRIDE });
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Colored themes need a visibly tinted surface for status banners — saturation jumps from the neutral `0.11` (default theme) to `0.8`. The `inherit: false` discipline pays off here: because most neutrals (`surface-2`, `surface-3`, `border`, `placeholder`, `disabled-*`, `code-*`, `loading-*`, `shadow-*`) are flagged default-only, each colored theme inherits *only* the accent + tinted surface chain and emits a small, focused token set.
|
|
288
|
+
|
|
289
|
+
`primaryTheme` keeps the default hue but gets the tinted surface — useful for places that want a brand-tinted banner without semantic status meaning.
|
|
290
|
+
|
|
291
|
+
## Palette composition
|
|
292
|
+
|
|
293
|
+
Compose all themes into a palette so they can be exported as one token set:
|
|
294
|
+
|
|
295
|
+
```ts
|
|
296
|
+
const palette = glaze.palette({
|
|
297
|
+
default: defaultTheme,
|
|
298
|
+
primary: primaryTheme,
|
|
299
|
+
success: successTheme,
|
|
300
|
+
danger: dangerTheme,
|
|
301
|
+
warning: warningTheme,
|
|
302
|
+
note: noteTheme,
|
|
303
|
+
});
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
The default theme is conventionally exported unprefixed (its tokens land as `#surface`, `#border`); colored themes are prefixed with their name. See [migration.md](migration.md) for the prefix map shape, alias patterns, and how to wire the resulting tokens into Tasty / CSS / framework-agnostic JSON.
|
|
307
|
+
|
|
308
|
+
## High-contrast strategy
|
|
309
|
+
|
|
310
|
+
Glaze's high-contrast mode is opt-in per token: anywhere `lightness`, `contrast`, `intensity`, or `value` accepts an HC pair, you can pass `[normal, hc]` to tighten the HC variant. The heuristic is to pair anything that's already contrast-driven:
|
|
311
|
+
|
|
312
|
+
- Text-against-surface contrasts (`[9, 11]`, `[4.5, 5.5]`, `[6.4, 10]`).
|
|
313
|
+
- The accent surface ladder (`[4.5, 7]` → `[5.2, 8]` → `[6, 8.5]`).
|
|
314
|
+
- The loading ramp's contrasts.
|
|
315
|
+
- Shadow `intensity` (e.g. `intensity: [10, 20]`).
|
|
316
|
+
- `border` lightness (e.g. `lightness: ['-10', '-20']`).
|
|
317
|
+
|
|
318
|
+
In HC the lightness window is **bypassed entirely** — light HC and dark HC operate on the full `[0, 100]` range. That's why edge-anchored absolute lightnesses like `surface-text: { lightness: 2 }` blow out to L=2 in light HC and L≈99 in dark HC, exactly what you want for maximum contrast.
|
|
319
|
+
|
|
320
|
+
## Closing checklist
|
|
321
|
+
|
|
322
|
+
Before shipping a palette, verify:
|
|
323
|
+
|
|
324
|
+
- [ ] Every text token has an explicit `contrast` *or* an edge-anchored absolute `lightness`.
|
|
325
|
+
- [ ] Every accent surface uses `mode: 'fixed'` + numeric `contrast` (not preset `'AA'` / `'AAA'`).
|
|
326
|
+
- [ ] Every brand foreground (`accent-text*`, `accent-icon`) is anchored to `surface`, **not** to `accent-surface`.
|
|
327
|
+
- [ ] Every `inherit: false` is intentional — colored sibling themes only carry the tokens they actually need.
|
|
328
|
+
- [ ] HC pairs are present on every contrast-driven token, not just the strong ones.
|
|
329
|
+
- [ ] Shadow `fg` is set when you want shadows to deepen in dark mode.
|
|
330
|
+
- [ ] `glaze.configure({ states, modes })` matches the global predefined states wired in your app's root.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Migration & Integration
|
|
2
|
+
|
|
3
|
+
How to plug a Glaze palette into an existing app — exporting tokens in the right shape, mapping prefixes to the names your components already consume, and migrating off a legacy color system without breaking layout, dark-mode wiring, or muscle-memory tokens.
|
|
4
|
+
|
|
5
|
+
If you're starting from scratch, see [methodology.md](methodology.md) first — that's about *designing* the palette. This doc is about *consuming* it.
|
|
6
|
+
|
|
7
|
+
## Choosing an export
|
|
8
|
+
|
|
9
|
+
Glaze emits the same resolved colors in four shapes. Pick one based on your renderer.
|
|
10
|
+
|
|
11
|
+
| Method | Output shape | Use it for |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `palette.tasty(options?)` | `{ '#name': { '': value, '@dark': value, '@hc': value } }` | The [Tasty](https://tasty.style/docs) style system. Single object, state aliases keyed inside each token. |
|
|
14
|
+
| `palette.tokens(options?)` | `{ light: { name: value }, dark: { name: value }, ... }` | Most CSS-in-JS systems. Per-variant flat maps, easy to feed into a `:root { ... }` selector via your framework's globals. |
|
|
15
|
+
| `palette.css(options?)` | `{ light: '--name-color: rgb(...);', dark: '...', ... }` | Framework-free CSS / static stylesheets. Variant-grouped CSS custom property strings ready to wrap in `:root` and `prefers-color-scheme` queries. |
|
|
16
|
+
| `palette.json(options?)` | `{ themeName: { name: { light, dark, ... } } }` | Tooling, JSON pipelines, design-token exporters (Style Dictionary, etc.). |
|
|
17
|
+
|
|
18
|
+
All four accept `format` (`'okhsl' \| 'rgb' \| 'hsl' \| 'oklch'`). `tokens()`, `tasty()`, and `json()` also accept `modes` (`{ dark, highContrast }`). `css()` always returns all four strings (`light`, `dark`, `lightContrast`, `darkContrast`). See [api.md → Palette](api.md#palette) for full options.
|
|
19
|
+
|
|
20
|
+
## Wiring exports into the app
|
|
21
|
+
|
|
22
|
+
### Tasty
|
|
23
|
+
|
|
24
|
+
Spread the result of `palette.tasty()` into a global style call:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import type { Styles } from '@tenphi/tasty';
|
|
28
|
+
import { useGlobalStyles } from '@tenphi/tasty';
|
|
29
|
+
import { tastyStatic } from '@tenphi/tasty/static';
|
|
30
|
+
|
|
31
|
+
export const PALETTE_TOKENS = palette.tasty({ /* prefix map */ }) as Styles;
|
|
32
|
+
|
|
33
|
+
// In your root component:
|
|
34
|
+
useGlobalStyles('body', PALETTE_TOKENS);
|
|
35
|
+
|
|
36
|
+
// Or, for zero-runtime builds:
|
|
37
|
+
tastyStatic('body', PALETTE_TOKENS);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For the `@dark` / `@hc` state aliases to do anything, your app needs to register what those states *mean*:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { setGlobalPredefinedStates } from '@tenphi/tasty';
|
|
44
|
+
|
|
45
|
+
setGlobalPredefinedStates({
|
|
46
|
+
'@dark':
|
|
47
|
+
'@root(schema=dark) | (!@root(schema) & @media(prefers-color-scheme: dark))',
|
|
48
|
+
'@hc':
|
|
49
|
+
'@root(contrast=high) | (!@root(contrast) & @media(prefers-contrast: more))',
|
|
50
|
+
});
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The state names here must match the `states` you set in [`glaze.configure({ states })`](api.md#configuration).
|
|
54
|
+
|
|
55
|
+
You can also register the tokens as a Tasty recipe instead of spreading them globally:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import { configure, tasty } from '@tenphi/tasty';
|
|
59
|
+
|
|
60
|
+
configure({ recipes: { 'theme-tokens': PALETTE_TOKENS } });
|
|
61
|
+
|
|
62
|
+
const Page = tasty({
|
|
63
|
+
styles: { recipe: 'theme-tokens', fill: '#surface', color: '#surface-text' },
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### CSS custom properties
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const css = palette.css();
|
|
71
|
+
const stylesheet = `
|
|
72
|
+
:root { ${css.light} }
|
|
73
|
+
@media (prefers-color-scheme: dark) { :root { ${css.dark} } }
|
|
74
|
+
@media (prefers-contrast: more) { :root { ${css.lightContrast} } }
|
|
75
|
+
@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
|
|
76
|
+
:root { ${css.darkContrast} }
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Each property name is `--<prefix><name>-color` by default. Override the suffix:
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
palette.css({ suffix: '' }); // → '--surface: rgb(...);'
|
|
85
|
+
palette.css({ format: 'oklch' }); // → '--surface-color: oklch(...);'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Framework-agnostic JSON
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
const data = palette.json();
|
|
92
|
+
// → { primary: { surface: { light: 'okhsl(...)', dark: 'okhsl(...)' } }, ... }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Feed into your tooling pipeline. Each color is grouped by theme name, then by token name, then by variant — no prefix logic to undo.
|
|
96
|
+
|
|
97
|
+
## Prefix map strategies
|
|
98
|
+
|
|
99
|
+
`palette.tokens()` / `tasty()` / `css()` accept a `prefix` option:
|
|
100
|
+
|
|
101
|
+
| Value | Result |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `true` (default) | Every theme prefixes its tokens with `<themeName>-`. |
|
|
104
|
+
| `false` | No prefixes. Colliding keys produce a `console.warn`; first-write wins. |
|
|
105
|
+
| `Record<string, string>` | Per-theme prefix overrides. Themes not listed fall back to `<themeName>-`. |
|
|
106
|
+
|
|
107
|
+
The most common production pattern: **default theme unprefixed, every other theme prefixed with its name**:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
palette.tasty({
|
|
111
|
+
prefix: {
|
|
112
|
+
default: '',
|
|
113
|
+
primary: 'primary-',
|
|
114
|
+
success: 'success-',
|
|
115
|
+
danger: 'danger-',
|
|
116
|
+
warning: 'warning-',
|
|
117
|
+
note: 'note-',
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
This makes neutral tokens consume as `#surface`, `#border`, `#disabled-surface` (no theme namespace) while status colors live under `#danger-surface`, `#success-accent-text`, etc.
|
|
123
|
+
|
|
124
|
+
### Alias themes for legacy names
|
|
125
|
+
|
|
126
|
+
Two aliases for the same theme instance produce identical token values under different prefixes — useful when you want to support a legacy token name without duplicating definitions:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
const palette = glaze.palette({
|
|
130
|
+
default: defaultTheme,
|
|
131
|
+
primary: primaryTheme,
|
|
132
|
+
purple: primaryTheme, // legacy alias — same theme, different prefix
|
|
133
|
+
// ...
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
palette.tasty({
|
|
137
|
+
prefix: {
|
|
138
|
+
default: '',
|
|
139
|
+
primary: 'primary-',
|
|
140
|
+
purple: 'purple-', // emits #purple-surface alongside #primary-surface
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Both `#primary-surface` and `#purple-surface` resolve to the exact same color. Drop the alias when the legacy name is no longer referenced.
|
|
146
|
+
|
|
147
|
+
### `primary` (the unprefixed alias)
|
|
148
|
+
|
|
149
|
+
`glaze.palette(themes, { primary })` and the per-export `primary` option duplicate one theme's tokens *without* prefix on top of any prefix map. Equivalent to listing that theme twice with different prefixes; useful when the "primary" theme is conceptually distinct from `default` and you want both sets of unprefixed tokens.
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
const palette = glaze.palette(
|
|
153
|
+
{ brand, accent },
|
|
154
|
+
{ primary: 'brand' },
|
|
155
|
+
);
|
|
156
|
+
palette.tokens();
|
|
157
|
+
// → { light: { 'brand-surface': '...', 'surface': '...', 'accent-surface': '...' } }
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Override per call: `palette.tokens({ primary: 'accent' })`, or disable with `palette.tokens({ primary: false })`.
|
|
161
|
+
|
|
162
|
+
## Migrating from an existing color system
|
|
163
|
+
|
|
164
|
+
The fastest path: **map first, design second**. Get every existing token name producing a Glaze-resolved color value (even if it's a rough first pass), wire the new palette in, then iterate on the resolved colors without touching component code.
|
|
165
|
+
|
|
166
|
+
### 1. Inventory the existing tokens
|
|
167
|
+
|
|
168
|
+
Walk your current color system and bucket every token into one of these categories:
|
|
169
|
+
|
|
170
|
+
- **Surfaces** — backgrounds, panels, cards, banners.
|
|
171
|
+
- **Surface text** — body text, headings, captions, labels.
|
|
172
|
+
- **Borders / dividers / focus rings** — neutral structural lines.
|
|
173
|
+
- **Brand fills** — solid CTA backgrounds, badges, status banners.
|
|
174
|
+
- **Brand foregrounds** — link text, status text, icon colors on neutral backgrounds.
|
|
175
|
+
- **Disabled** — disabled chip + label.
|
|
176
|
+
- **Shadows / overlays** — elevation, scrims.
|
|
177
|
+
- **One-off colors** — syntax highlighting, charts, illustrations.
|
|
178
|
+
|
|
179
|
+
Each bucket maps cleanly to one of the patterns in [methodology.md](methodology.md). The bucket determines the *shape* of the Glaze definition (root vs dependent, `mode: 'auto'` vs `'fixed'`, contrast-floor vs absolute lightness), not the value.
|
|
180
|
+
|
|
181
|
+
### 2. Reproduce the existing values
|
|
182
|
+
|
|
183
|
+
Pick a Glaze definition shape that lands the new color *close to* the legacy hex in light mode. The methodology doc explains the shape per bucket; the API doc covers the levers (`lightness`, `saturation`, `contrast`, `mode`, `hue`).
|
|
184
|
+
|
|
185
|
+
Two tactics that make matching easier:
|
|
186
|
+
|
|
187
|
+
- **Anchor strong text at the edge** instead of solving for `'AAA'`. The contrast solver stops at the floor (cr=7), which usually leaves text noticeably softer than a legacy hex like `#1a1a1a`. An absolute `lightness: 2` (or wherever the legacy token sits in OKHSL) preserves the look.
|
|
188
|
+
- **Use numeric `contrast` ratios** for soft / accent / disabled tokens. Presets give you the WCAG floor and nothing more — for matching a designed palette you usually want a specific perceived weight, not the floor.
|
|
189
|
+
|
|
190
|
+
### 3. Keep the old token names
|
|
191
|
+
|
|
192
|
+
Use a custom `prefix` map (and theme aliases if needed) so the names your components already consume keep working:
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
// Old: components consume `#dark`, `#dark-02`, `#dark-03`.
|
|
196
|
+
// New: define them in Glaze, map the prefix so they emit unchanged.
|
|
197
|
+
|
|
198
|
+
defaultTheme.colors({
|
|
199
|
+
dark: { base: 'surface', lightness: 2, saturation: 0.475 },
|
|
200
|
+
'dark-02': { base: 'surface', lightness: '-1', saturation: 0.375, contrast: [9, 11] },
|
|
201
|
+
'dark-03': { base: 'surface', lightness: '-1', saturation: 0.24, contrast: [4.5, 5.5] },
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
palette.tasty({ prefix: { default: '' } });
|
|
205
|
+
// → '#dark', '#dark-02', '#dark-03' — components don't change.
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Once consumers are off the legacy names, rename the Glaze tokens to match your conventions.
|
|
209
|
+
|
|
210
|
+
### 4. Verify dark mode and HC before promoting
|
|
211
|
+
|
|
212
|
+
Glaze gives you light/dark/HC for free, but only the light mode is matched against the legacy palette. Before promoting the migration:
|
|
213
|
+
|
|
214
|
+
- Spot-check every surface, text, accent, and disabled pair in dark mode. The Möbius dark inversion plus per-color `mode` choices may produce results that *look right* in light but feel off in dark (typical fix: switch a brand color to `mode: 'fixed'`, or anchor a foreground to `surface` instead of the brand fill — see [methodology.md](methodology.md)).
|
|
215
|
+
- If the legacy system had no high-contrast mode, audit the HC variants Glaze emits. Anywhere the resolved cr is too low or the color blows out, add an HC pair (`lightness: ['-7', '-20']`, `contrast: [4.5, 7]`, etc.).
|
|
216
|
+
- Run real screens, not just the token grid. The interaction of multiple Glaze tokens against each other (text on chip, hover bg vs. fill, disabled label on disabled chip) is where mismatches show up.
|
|
217
|
+
|
|
218
|
+
### 5. Trim what `extend()` doesn't need
|
|
219
|
+
|
|
220
|
+
After migration, mark every default-only token (borders, shadows, disabled chip, code highlighting, etc.) `inherit: false`. Colored sibling themes only need the accent + tinted-surface chain — flagging the rest cuts the emitted token set per theme dramatically.
|
|
221
|
+
|
|
222
|
+
## Common pitfalls
|
|
223
|
+
|
|
224
|
+
| Symptom | Cause | Fix |
|
|
225
|
+
|---|---|---|
|
|
226
|
+
| Disabled state stops looking disabled in dark mode. | Alpha-tinted overlay on `surface-text` (which inverts), giving asymmetric perceived contrast. | Replace with a `mode: 'auto'` color anchored to `surface` with a numeric `contrast` (see [methodology.md → Disabled chip](methodology.md#disabled-chip-contrast-driven-for-scheme-symmetry)). |
|
|
227
|
+
| Brand color flips to its complement in dark mode. | Default `mode: 'auto'` runs the Möbius inversion. | Set `mode: 'fixed'` so the lightness is mapped (not inverted). |
|
|
228
|
+
| Brand text washes out against the dark surface. | Foreground was anchored to `accent-surface` (the brand fill), so contrast was only enforced against that fill — not the actual surface. | Anchor `accent-text` etc. to `surface` with `mode: 'auto'`. |
|
|
229
|
+
| Tokens look right in light, broken in HC. | The HC pass bypasses the lightness window — solver runs over the full `[0, 100]` range. | Add explicit `[normal, hc]` pairs to `lightness` / `contrast` for the affected tokens. |
|
|
230
|
+
| `palette.tokens()` emits unexpected unprefixed names. | A `primary` was set on the palette (or per-call) and is duplicating the theme's tokens without prefix. | Pass `primary: false` to disable for that export, or rename `glaze.palette(themes, { primary })`. |
|
|
231
|
+
| `console.warn: token "foo" collides with theme "bar"`. | Two themes resolved to the same output key under your prefix config. | Adjust the prefix map so each token is unique, or accept the first-write-wins behavior. |
|
|
232
|
+
| `console.warn: color "X" cannot meet contrast`. | The requested contrast target is physically unreachable for the color's hue/saturation against its base. | Lower the floor, change the base, or accept the closest passing variant. Use the `name` override on standalone colors to make the warning identifiable. |
|
|
233
|
+
|
|
234
|
+
## See also
|
|
235
|
+
|
|
236
|
+
- [methodology.md](methodology.md) — how to design the palette in the first place.
|
|
237
|
+
- [api.md](api.md) — full reference for every option mentioned here.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cube-dev/ui-kit",
|
|
3
|
-
"version": "0.138.
|
|
3
|
+
"version": "0.138.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "UIKit for Cube Projects",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@react-types/shared": "^3.32.1",
|
|
46
46
|
"@tabler/icons-react": "^3.31.0",
|
|
47
47
|
"@tanstack/react-virtual": "^3.13.12",
|
|
48
|
-
"@tenphi/glaze": "0.11.
|
|
48
|
+
"@tenphi/glaze": "0.11.1",
|
|
49
49
|
"@tenphi/tasty": "2.6.2",
|
|
50
50
|
"clipboard-copy": "^4.0.1",
|
|
51
51
|
"clsx": "^1.1.1",
|