@cube-dev/ui-kit 0.126.0 → 0.127.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +49 -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/CommandMenu.js.map +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/Menu.js.map +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 +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 -2
- package/dist/components/actions/Menu/styled.js.map +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/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 +5 -1
- package/dist/components/content/Layout/LayoutPanel.js.map +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/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +2 -2
- package/dist/components/fields/Checkbox/Checkbox.js.map +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.d.ts +4 -4
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js.map +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.d.ts +4 -4
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +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/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/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +1 -0
- package/dist/components/fields/RadioGroup/Radio.js +5 -8
- package/dist/components/fields/RadioGroup/Radio.js.map +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.d.ts +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/Grid.js.map +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/EditableTitle.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.d.ts +4 -2
- package/dist/components/navigation/Tabs/types.js +3 -2
- package/dist/components/navigation/Tabs/types.js.map +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/OpenTransition.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/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 +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/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.d.ts +2 -2
- 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 +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/layout.js +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.d.ts +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.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.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.d.ts +1 -1
- package/dist/utils/styles.js +5 -4
- package/dist/utils/styles.js.map +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/fields/ComboBox.md +27 -0
- package/docs/components/fields/FilterListBox.md +25 -0
- package/docs/components/fields/FilterPicker.md +34 -0
- package/docs/components/fields/ListBox.md +38 -8
- package/docs/components/fields/Picker.md +25 -0
- package/docs/components/fields/Select.md +2 -0
- package/docs/components/navigation/Tabs.md +2 -2
- package/docs/tasty/README.md +4 -4
- package/docs/tasty/adoption.md +5 -3
- package/docs/tasty/comparison.md +24 -25
- package/docs/tasty/configuration.md +69 -1
- package/docs/tasty/debug.md +11 -9
- package/docs/tasty/design-system.md +22 -10
- package/docs/tasty/dsl.md +23 -8
- package/docs/tasty/getting-started.md +10 -10
- package/docs/tasty/injector.md +41 -25
- package/docs/tasty/methodology.md +52 -3
- package/docs/tasty/{PIPELINE.md → pipeline.md} +204 -50
- package/docs/tasty/{runtime.md → react-api.md} +104 -32
- package/docs/tasty/ssr.md +139 -81
- package/docs/tasty/styles.md +17 -0
- package/docs/tasty/tasty-static.md +101 -2
- package/package.json +2 -2
|
@@ -214,7 +214,7 @@ The array form is simpler but types all values as `ModValue`:
|
|
|
214
214
|
modProps: ['isLoading', 'isSelected'] as const,
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
For the full API reference, see [Runtime — Mod Props](
|
|
217
|
+
For the full API reference, see [Runtime — Mod Props](react-api.md#mod-props).
|
|
218
218
|
|
|
219
219
|
---
|
|
220
220
|
|
|
@@ -256,6 +256,54 @@ The `tokens` prop sets `style="--progress: 75%"` on the DOM element. The `$progr
|
|
|
256
256
|
|
|
257
257
|
Design tokens (via `configure({ tokens })`) are injected as CSS custom properties on `:root`. Replace tokens (via `configure({ replaceTokens })`) are resolved at parse time and baked into the generated CSS. The `tokens` prop on components is resolved at render time via inline CSS custom properties. Use design tokens for design-system constants, replace tokens for value aliases, and the `tokens` prop for truly dynamic per-instance values.
|
|
258
258
|
|
|
259
|
+
### tokenProps
|
|
260
|
+
|
|
261
|
+
`tokenProps` expose token keys as top-level component props — the token equivalent of `styleProps` and `modProps`. Use them when a component has a fixed set of known dynamic token values.
|
|
262
|
+
|
|
263
|
+
#### Array form
|
|
264
|
+
|
|
265
|
+
Prop names are plain camelCase identifiers. Names ending in `Color` map to `#` color tokens; everything else maps to `$` custom property tokens:
|
|
266
|
+
|
|
267
|
+
```tsx
|
|
268
|
+
const ProgressBar = tasty({
|
|
269
|
+
tokenProps: ['progress', 'accentColor'] as const,
|
|
270
|
+
styles: { width: '$progress', fill: '#accent' },
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// Clean prop API — no tokens object needed
|
|
274
|
+
<ProgressBar progress="75%" accentColor="#purple" />
|
|
275
|
+
|
|
276
|
+
// Conversion:
|
|
277
|
+
// 'progress' → $progress → --progress
|
|
278
|
+
// 'accentColor' → #accent → --accent-color + --accent-color-oklch
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### Object form
|
|
282
|
+
|
|
283
|
+
Keys are prop names; values are `$`/`#`-prefixed token keys. No suffix convention needed — the prefix in the value is explicit:
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
const Card = tasty({
|
|
287
|
+
tokenProps: {
|
|
288
|
+
size: '$card-size',
|
|
289
|
+
color: '#card-accent',
|
|
290
|
+
},
|
|
291
|
+
styles: { padding: '$card-size', fill: '#card-accent' },
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
<Card size="4x" color="#purple" />
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
#### Merge order
|
|
298
|
+
|
|
299
|
+
When all three token sources are present, values merge with increasing priority:
|
|
300
|
+
|
|
301
|
+
1. `tokens` option in `tasty({...})` — default tokens (lowest)
|
|
302
|
+
2. `tokens` prop on the component instance — runtime overrides
|
|
303
|
+
3. `tokenProps`-derived values — highest priority (explicit named props win)
|
|
304
|
+
|
|
305
|
+
The `tokens` prop remains available for ad-hoc or dynamic tokens alongside `tokenProps`.
|
|
306
|
+
|
|
259
307
|
---
|
|
260
308
|
|
|
261
309
|
## styles prop vs style prop
|
|
@@ -458,7 +506,8 @@ See [Configuration](configuration.md) for the full `configure()` API.
|
|
|
458
506
|
- **Use `elements` prop** to declare typed sub-components for compound components
|
|
459
507
|
- **Use `styleProps`** to define what product engineers can customize
|
|
460
508
|
- **Use `modProps`** to expose known modifier states as clean component props
|
|
461
|
-
- **Use `
|
|
509
|
+
- **Use `tokenProps`** to expose known token keys as clean component props
|
|
510
|
+
- **Use `tokens` prop** for ad-hoc or dynamic per-instance token values (progress, user color)
|
|
462
511
|
- **Use modifiers** (`mods` or `modProps`) for state-driven style changes instead of runtime `styles` prop changes
|
|
463
512
|
|
|
464
513
|
### Avoid
|
|
@@ -561,7 +610,7 @@ The `elements` prop gives you typed sub-components with automatic `data-element`
|
|
|
561
610
|
- **[Getting Started](getting-started.md)** — Installation, first component, tooling setup
|
|
562
611
|
- **[Building a Design System](design-system.md)** — Practical guide to building a DS layer with Tasty
|
|
563
612
|
- **[Style DSL](dsl.md)** — State maps, tokens, units, extending semantics, keyframes, @property
|
|
564
|
-
- **[
|
|
613
|
+
- **[React API](react-api.md)** — `tasty()` factory, component props, variants, sub-elements, style functions
|
|
565
614
|
- **[Configuration](configuration.md)** — Full `configure()` API: tokens, recipes, custom units, style handlers
|
|
566
615
|
- **[Style Properties](styles.md)** — Complete reference for all enhanced style properties
|
|
567
616
|
- **[Adoption Guide](adoption.md)** — Who should adopt Tasty, incremental phases, what changes for product engineers
|
|
@@ -6,56 +6,109 @@ This document describes the style rendering pipeline that transforms style objec
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
The pipeline takes a `Styles` object and produces an array of `CSSRule` objects ready for injection into the DOM. Entry points include `renderStylesPipeline` (full pipeline + optional class-name prefixing) and `renderStyles` (direct selector/class mode). The per-handler flow
|
|
9
|
+
The pipeline takes a `Styles` object and produces an array of `CSSRule` objects ready for injection into the DOM. Entry points include `renderStylesPipeline` (full pipeline + optional class-name prefixing) and `renderStyles` (direct selector/class mode). The per-handler flow is:
|
|
10
10
|
|
|
11
11
|
```
|
|
12
12
|
Input: Styles Object
|
|
13
13
|
↓
|
|
14
|
-
|
|
15
|
-
│
|
|
16
|
-
│
|
|
17
|
-
|
|
14
|
+
┌──────────────────────────────────────────┐
|
|
15
|
+
│ 0. PRE-PARSE NORMALIZATION │
|
|
16
|
+
│ extractCompoundStates │
|
|
17
|
+
│ (drop don't-care AND atoms) │
|
|
18
|
+
└──────────────────────────────────────────┘
|
|
18
19
|
↓
|
|
19
|
-
|
|
20
|
-
│
|
|
21
|
-
│
|
|
22
|
-
|
|
20
|
+
┌──────────────────────────────────────────┐
|
|
21
|
+
│ 1. PARSE CONDITIONS │
|
|
22
|
+
│ parseStyleEntries + parseStateKey │
|
|
23
|
+
└──────────────────────────────────────────┘
|
|
23
24
|
↓
|
|
24
|
-
|
|
25
|
-
│
|
|
26
|
-
│
|
|
27
|
-
|
|
25
|
+
┌──────────────────────────────────────────┐
|
|
26
|
+
│ 1b. MERGE ENTRIES BY VALUE │
|
|
27
|
+
│ mergeEntriesByValue │
|
|
28
|
+
│ (collapse same-value non-defaults) │
|
|
29
|
+
└──────────────────────────────────────────┘
|
|
28
30
|
↓
|
|
29
|
-
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
|
|
31
|
+
┌──────────────────────────────────────────┐
|
|
32
|
+
│ 2a. EXPAND USER OR BRANCHES │
|
|
33
|
+
│ expandOrConditions │
|
|
34
|
+
│ (A | B | C → A, B&!A, C&!A&!B) │
|
|
35
|
+
└──────────────────────────────────────────┘
|
|
33
36
|
↓
|
|
34
|
-
|
|
35
|
-
│
|
|
36
|
-
│
|
|
37
|
-
|
|
37
|
+
┌──────────────────────────────────────────┐
|
|
38
|
+
│ 2b. BUILD EXCLUSIVE CONDITIONS │
|
|
39
|
+
│ Negate higher-priority entries │
|
|
40
|
+
└──────────────────────────────────────────┘
|
|
38
41
|
↓
|
|
39
|
-
|
|
40
|
-
│
|
|
41
|
-
│
|
|
42
|
-
|
|
42
|
+
┌──────────────────────────────────────────┐
|
|
43
|
+
│ 3. EXPAND DE MORGAN OR BRANCHES │
|
|
44
|
+
│ expandExclusiveOrs │
|
|
45
|
+
│ (only for at-rule ORs from negation) │
|
|
46
|
+
└──────────────────────────────────────────┘
|
|
43
47
|
↓
|
|
44
|
-
|
|
45
|
-
│
|
|
46
|
-
│
|
|
47
|
-
|
|
48
|
+
┌──────────────────────────────────────────┐
|
|
49
|
+
│ 4. COMPUTE STATE COMBINATIONS │
|
|
50
|
+
│ Cartesian product across styles │
|
|
51
|
+
└──────────────────────────────────────────┘
|
|
48
52
|
↓
|
|
49
|
-
|
|
50
|
-
│
|
|
51
|
-
|
|
53
|
+
┌──────────────────────────────────────────┐
|
|
54
|
+
│ 5. CALL HANDLERS │
|
|
55
|
+
│ Compute CSS declarations │
|
|
56
|
+
└──────────────────────────────────────────┘
|
|
57
|
+
↓
|
|
58
|
+
┌──────────────────────────────────────────┐
|
|
59
|
+
│ 6. MERGE BY VALUE │
|
|
60
|
+
│ Combine rules with same output │
|
|
61
|
+
└──────────────────────────────────────────┘
|
|
62
|
+
↓
|
|
63
|
+
┌──────────────────────────────────────────┐
|
|
64
|
+
│ 7. MATERIALIZE CSS │
|
|
65
|
+
│ Condition → selectors + at-rules │
|
|
66
|
+
└──────────────────────────────────────────┘
|
|
67
|
+
↓
|
|
68
|
+
┌──────────────────────────────────────────┐
|
|
69
|
+
│ runPipeline post-pass: │
|
|
70
|
+
│ - dedupe identical rules │
|
|
71
|
+
│ - emit @starting-style rules last │
|
|
72
|
+
└──────────────────────────────────────────┘
|
|
52
73
|
↓
|
|
53
74
|
Output: CSSRule[]
|
|
54
75
|
```
|
|
55
76
|
|
|
56
|
-
**Simplification** (`simplifyCondition` in `simplify.ts`) is not a separate numbered stage. It runs inside exclusive building, `expandExclusiveOrs` branch cleanup, combination ANDs, merge-by-value ORs, and materialization
|
|
77
|
+
**Simplification** (`simplifyCondition` in `simplify.ts`) is not a separate numbered stage. It runs inside OR expansion, exclusive building, `expandExclusiveOrs` branch cleanup, combination ANDs, merge-by-value ORs, and materialization. Every call is cached by condition unique-id, so the repetition is cheap.
|
|
57
78
|
|
|
58
|
-
**Post-pass:** After `processStyles` collects rules from every handler, `runPipeline` filters duplicates using a key of `selector|declarations|atRules|rootPrefix` so
|
|
79
|
+
**Post-pass:** After `processStyles` collects rules from every handler, `runPipeline` (`index.ts:188`) filters duplicates using a key of `selector|declarations|atRules|rootPrefix|startingStyle` and then reorders rules so every `@starting-style` rule is emitted **after** all normal rules. This ordering is cascade-critical: `@starting-style` rules share specificity with their normal counterparts, and source order decides which value wins.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Stage 0: Pre-parse Normalization
|
|
84
|
+
|
|
85
|
+
**File:** `exclusive.ts` (`extractCompoundStates`)
|
|
86
|
+
|
|
87
|
+
### What It Does
|
|
88
|
+
|
|
89
|
+
Runs on each style's value map **before** any parsing. If a compound AND state key shares a value with the "atom absent" variant, the atom is a don't-care and every key is simplified by dropping it. Duplicate keys collapse.
|
|
90
|
+
|
|
91
|
+
### How It Works
|
|
92
|
+
|
|
93
|
+
1. Gather the unique set of top-level AND atoms across all keys.
|
|
94
|
+
2. An atom is **redundant** when every entry that contains it has a same-value partner with the atom absent and the rest of the atoms identical.
|
|
95
|
+
3. Keys containing `|`, `^`, or `,` at top level are treated as opaque single atoms (they don't participate in atom-level extraction).
|
|
96
|
+
4. Drop redundant atoms from every key; collapse duplicates.
|
|
97
|
+
|
|
98
|
+
### Why
|
|
99
|
+
|
|
100
|
+
Removing don't-care dimensions before parsing prevents combinatorial blowup in later stages. `mergeEntriesByValue`, `buildExclusiveConditions`, and materialization all see fewer entries and fewer spurious conditions. Implemented as part of the Apr 2026 fix for overlapping CSS rules (commit 7cd9dbe).
|
|
101
|
+
|
|
102
|
+
### Example
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
// Input (value map)
|
|
106
|
+
{ '': 'A', '@dark': 'B', '@hc': 'A', '@dark & @hc': 'B' }
|
|
107
|
+
// @hc is a don't-care: its presence never changes the value.
|
|
108
|
+
|
|
109
|
+
// Output
|
|
110
|
+
{ '': 'A', '@dark': 'B' }
|
|
111
|
+
```
|
|
59
112
|
|
|
60
113
|
---
|
|
61
114
|
|
|
@@ -120,7 +173,75 @@ The condition tree representation enables:
|
|
|
120
173
|
|
|
121
174
|
---
|
|
122
175
|
|
|
123
|
-
## Stage
|
|
176
|
+
## Stage 1b: Merge Entries By Value
|
|
177
|
+
|
|
178
|
+
**File:** `exclusive.ts` (`mergeEntriesByValue`)
|
|
179
|
+
|
|
180
|
+
### What It Does
|
|
181
|
+
|
|
182
|
+
Collapses parsed entries that share the same value. Only **non-default** entries are merged — an entry with the default state (`''` → `TrueCondition`) is never merged with a non-default entry.
|
|
183
|
+
|
|
184
|
+
### How It Works
|
|
185
|
+
|
|
186
|
+
1. Group entries by serialized value.
|
|
187
|
+
2. Within each group, split out default (TRUE) entries.
|
|
188
|
+
3. Keep default entries as-is; they must retain TRUE so they participate correctly in exclusive building.
|
|
189
|
+
4. Combine non-default entries into a single entry with condition `OR(e1.condition, e2.condition, …)`, simplified via `simplifyCondition`. The merged entry keeps the **highest** priority in the group.
|
|
190
|
+
5. Re-sort by priority (highest first).
|
|
191
|
+
|
|
192
|
+
### Why
|
|
193
|
+
|
|
194
|
+
Without this, a value map like `{ '@dark': 'red', '@dark & @hc': 'red' }` would create two separate entries that later produce two CSS rules with identical output. Merging before exclusive building keeps the exclusive condition algebra small and avoids duplicate CSS.
|
|
195
|
+
|
|
196
|
+
**Why defaults are kept separate:** merging `TRUE | X` collapses to `TRUE`, destroying X's participation in the exclusive cascade. Intermediate-priority states would then lose their `:not(X)` negation, producing overlapping CSS rules. See `exclusive.ts:140-160` for the rationale.
|
|
197
|
+
|
|
198
|
+
### Example
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
// Input entries (highest priority first)
|
|
202
|
+
[
|
|
203
|
+
{ stateKey: '@dark & @hc', value: 'red', condition: dark & hc },
|
|
204
|
+
{ stateKey: '@dark', value: 'red', condition: dark },
|
|
205
|
+
]
|
|
206
|
+
|
|
207
|
+
// Output: one merged entry
|
|
208
|
+
[
|
|
209
|
+
{ stateKey: '@dark & @hc | @dark', value: 'red',
|
|
210
|
+
condition: simplify((dark & hc) | dark) = dark }
|
|
211
|
+
]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Stage 2a: Expand User OR Branches
|
|
217
|
+
|
|
218
|
+
**File:** `exclusive.ts` (`expandOrConditions`)
|
|
219
|
+
|
|
220
|
+
### What It Does
|
|
221
|
+
|
|
222
|
+
Runs **before** `buildExclusiveConditions`. Splits any user-authored OR in a parsed entry's condition into multiple sibling entries, each made exclusive against the OR branches that come before it.
|
|
223
|
+
|
|
224
|
+
### How It Works
|
|
225
|
+
|
|
226
|
+
For an entry with condition `A | B | C`:
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
A (first branch, no prior)
|
|
230
|
+
B & !A (second branch exclusive from first)
|
|
231
|
+
C & !A & !B (third branch exclusive from first two)
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Each expanded branch gets a `stateKey` suffix like `[0]`, `[1]`, `[2]`. Branches that simplify to `FALSE` are dropped. Branches inherit the original entry's priority.
|
|
235
|
+
|
|
236
|
+
This pass does **not** sort branches — user ORs are authored in the natural order they appear and aren't the product of De Morgan negation, so at-rule-aware sorting isn't required here (that's Stage 3's job).
|
|
237
|
+
|
|
238
|
+
### Why
|
|
239
|
+
|
|
240
|
+
Running this before exclusive building means the Stage 2b negation cascade sees one branch per entry and never has to reason about nested ORs while computing `!prior`. It also avoids emitting overlapping CSS rules: `{ 'compact | @media(dark)': 'red' }` becomes two mutually exclusive entries rather than one rule whose two branches could both match simultaneously.
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Stage 2b: Build Exclusive Conditions
|
|
124
245
|
|
|
125
246
|
**File:** `exclusive.ts` (`buildExclusiveConditions`)
|
|
126
247
|
|
|
@@ -167,28 +288,41 @@ This eliminates CSS specificity wars. Instead of relying on cascade order, each
|
|
|
167
288
|
|
|
168
289
|
---
|
|
169
290
|
|
|
170
|
-
## Stage 3: Expand
|
|
291
|
+
## Stage 3: Expand De Morgan OR Branches
|
|
171
292
|
|
|
172
|
-
**File:** `exclusive.ts` (`expandExclusiveOrs`)
|
|
293
|
+
**File:** `exclusive.ts` (`expandExclusiveOrs`, `sortOrBranchesForExpansion`)
|
|
173
294
|
|
|
174
295
|
### What It Does
|
|
175
296
|
|
|
176
|
-
Runs **after** `buildExclusiveConditions`.
|
|
297
|
+
Runs **after** `buildExclusiveConditions`. Handles ORs that arise **during** exclusive building from De Morgan negation — e.g. when a higher-priority condition `A & B` gets negated into the next entry's exclusive as `!(A & B) = !A | !B`. When such an OR mixes **at-rule** context (`media`, `container`, `supports`, `starting`) with other branches, each branch needs to keep its own at-rule wrapping.
|
|
298
|
+
|
|
299
|
+
This is the companion to **Stage 2a** (user-OR expansion). The split exists because the two passes have different data and different correctness needs:
|
|
300
|
+
|
|
301
|
+
| Stage | Runs on | Sees ORs from | Sorts branches? |
|
|
302
|
+
|---|---|---|---|
|
|
303
|
+
| 2a `expandOrConditions` | `ParsedStyleEntry.condition` | User-authored `|` in state keys | No — user order is stable |
|
|
304
|
+
| 3 `expandExclusiveOrs` | `ExclusiveStyleEntry.exclusiveCondition` | De Morgan negation inside `buildExclusiveConditions` | Yes — at-rule branches first |
|
|
177
305
|
|
|
178
306
|
### How It Works
|
|
179
307
|
|
|
180
308
|
1. Collect top-level OR branches of `exclusiveCondition`.
|
|
181
|
-
2. If there is no OR
|
|
182
|
-
3. Otherwise
|
|
183
|
-
4.
|
|
309
|
+
2. If there is no OR (single branch), the entry is unchanged. Pure selector ORs with no at-rule context are also left alone (materialization handles them via `:is()` / variant merging).
|
|
310
|
+
3. Otherwise `sortOrBranchesForExpansion` reorders branches so at-rule-heavy branches come first. This is load-bearing for correctness (see below).
|
|
311
|
+
4. Each branch is made exclusive against prior branches: `branch & !prior[0] & !prior[1] & ...`, then simplified.
|
|
312
|
+
5. Impossible branches are dropped; expanded entries get a synthetic `stateKey` suffix like `[or:0]`.
|
|
184
313
|
|
|
185
|
-
### Why
|
|
314
|
+
### Why the sort matters
|
|
315
|
+
|
|
316
|
+
Consider `!A | !B` where A is an at-rule (e.g. `@supports(grid)`) and B is a modifier (e.g. `:has(foo)`):
|
|
186
317
|
|
|
187
|
-
|
|
318
|
+
- **With at-rule-first sort** (`!A`, then `!B & A`): the first branch emits "outside `@supports`", the second emits "inside `@supports` with `:not(:has(foo))`". Full coverage.
|
|
319
|
+
- **Without the sort** (`!B`, then `!A & B`): the first branch emits `:not(:has(foo))` as a bare selector with no at-rule context — leaking the rule outside `@supports`. The second is incomplete.
|
|
320
|
+
|
|
321
|
+
The pre-build Stage 2a pass doesn't need this because user-authored ORs aren't produced by negation and their branches are expected to apply in each branch's own scope.
|
|
188
322
|
|
|
189
323
|
### Example (conceptual)
|
|
190
324
|
|
|
191
|
-
See the comment block in `exclusive.ts
|
|
325
|
+
See the comment block in `exclusive.ts:500-523`: a default value whose higher-priority sibling is `@supports(...) & :has(...)` gets an exclusive of `!@supports | !:has`. Expansion yields one branch under `@supports (not ...)` and another under `@supports (...) { :not(:has()) }` instead of a bare `:not(:has())` rule.
|
|
192
326
|
|
|
193
327
|
---
|
|
194
328
|
|
|
@@ -402,16 +536,20 @@ Applies boolean algebra rules to reduce condition complexity and detect impossib
|
|
|
402
536
|
- `A & (A | B) = A`
|
|
403
537
|
- `A | (A & B) = A`
|
|
404
538
|
|
|
405
|
-
7. **Range intersection**: For **media and container** dimension queries, impossible ranges simplify to `FALSE` (e.g. `@media(w > 400px) & @media(w < 300px)`).
|
|
539
|
+
7. **Range intersection**: For **media and container** dimension queries, impossible ranges simplify to `FALSE` (e.g. `@media(w > 400px) & @media(w < 300px)`). Ranges with compatible bounds are also merged in place (`w >= 400 & w <= 800` → a single bounded range).
|
|
406
540
|
|
|
407
541
|
8. **Container style queries**: Conflicting or redundant `@container` style conditions on the same property can be reduced (see `simplify.ts` around the container-style conflict pass).
|
|
408
542
|
|
|
409
543
|
9. **Attribute conflict detection**:
|
|
410
544
|
- `[data-theme="dark"] & [data-theme="light"] = FALSE`
|
|
411
545
|
|
|
546
|
+
10. **Complementary factoring** (OR context): `(A & B) | (A & !B) = A`. Also works on **compound complements** — if two AND-clauses differ only by a child that is a compound negation of the other (e.g. `X` vs `!X` where X is itself `(P & Q)`), the clauses factor correctly.
|
|
547
|
+
|
|
548
|
+
11. **Consensus / resolution** (AND context, dual of #10): `(A | B) & (A | !B) = A`. Added in commit f9038bd to eliminate overlapping CSS selectors from compound-state OR branches.
|
|
549
|
+
|
|
412
550
|
### Why
|
|
413
551
|
|
|
414
|
-
Simplification reduces CSS output size and catches impossible combinations early, preventing invalid CSS rules from being generated.
|
|
552
|
+
Simplification reduces CSS output size and catches impossible combinations early, preventing invalid CSS rules from being generated. Every `simplifyCondition` call is memoized by the condition's unique id, so the cost of running it many times across stages is negligible after the first hit.
|
|
415
553
|
|
|
416
554
|
---
|
|
417
555
|
|
|
@@ -452,7 +590,15 @@ const styles = {
|
|
|
452
590
|
'hovered' → ModifierCondition(attribute: 'data-hovered')
|
|
453
591
|
```
|
|
454
592
|
|
|
455
|
-
###
|
|
593
|
+
### Stage 0 + 1b: Normalization
|
|
594
|
+
|
|
595
|
+
No compound AND keys, no same-value duplicates — the value map is unchanged.
|
|
596
|
+
|
|
597
|
+
### Stage 1 + 2a: Parse and expand user ORs
|
|
598
|
+
|
|
599
|
+
No user ORs — three entries pass through unchanged.
|
|
600
|
+
|
|
601
|
+
### Stage 2b + 3: Exclusive conditions + De Morgan expansion
|
|
456
602
|
|
|
457
603
|
Processing order (highest priority first): `hovered`, `@media(dark)`, default.
|
|
458
604
|
|
|
@@ -462,7 +608,7 @@ hovered: [data-hovered]
|
|
|
462
608
|
!hovered & !@media(dark): :not([data-hovered]) & not @media(dark)
|
|
463
609
|
```
|
|
464
610
|
|
|
465
|
-
|
|
611
|
+
The default entry's exclusive is `!hovered & !@media(dark)` — no top-level OR, so Stage 3 expansion does nothing. If a higher-priority entry had been `@media(dark) & :has(foo)`, the default's exclusive would have expanded via De Morgan into two at-rule-aware branches (see Stage 3 for that scenario).
|
|
466
612
|
|
|
467
613
|
### Stages 4–5: Compute combinations and call handler
|
|
468
614
|
|
|
@@ -506,9 +652,17 @@ Using `renderStyles(styles, '.t1')` (single class prefix; `renderStylesPipeline`
|
|
|
506
652
|
|
|
507
653
|
Rather than relying on CSS cascade rules, we generate mutually exclusive selectors. This makes styling predictable and debuggable.
|
|
508
654
|
|
|
509
|
-
### 2. OR Handling
|
|
655
|
+
### 2. OR Handling in Three Layers
|
|
656
|
+
|
|
657
|
+
Boolean OR appears in three different shapes during the pipeline, and each is handled where it's cheapest to get right:
|
|
658
|
+
|
|
659
|
+
1. **User-authored ORs in state keys** (Stage 2a, `expandOrConditions`): A user-authored condition like `'compact | @media(w < 768px)'` is split into multiple exclusive entries **before** exclusive building so the negation cascade doesn't have to reason about nested ORs.
|
|
660
|
+
|
|
661
|
+
2. **De Morgan ORs from negation** (Stage 3, `expandExclusiveOrs`): When `buildExclusiveConditions` negates a higher-priority compound like `A & B`, the result is `!A | !B`. If branches involve at-rules, they're split with `sortOrBranchesForExpansion` so at-rule context is preserved per branch.
|
|
662
|
+
|
|
663
|
+
3. **Pure selector ORs** (materialization): ORs that only mention modifiers/pseudos are kept intact until the `conditionToCSS` layer, where they're merged into `:is()` / `:not()` groups or emitted as comma-separated selectors. There's no gain from expanding these earlier — CSS already has compact syntax for selector-only disjunction.
|
|
510
664
|
|
|
511
|
-
|
|
665
|
+
Ultimately every emitted CSS rule corresponds to one conjunctive clause (DNF), produced by whichever of the three paths handled the OR.
|
|
512
666
|
|
|
513
667
|
### 3. Early Contradiction Detection
|
|
514
668
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React API
|
|
2
2
|
|
|
3
|
-
The React-specific `tasty()` component factory, component props, and
|
|
3
|
+
The React-specific `tasty()` component factory, component props, and style functions. All Tasty style functions — `tasty()` components, `useStyles()`, `useGlobalStyles()`, `useRawCSS()`, `useKeyframes()`, `useProperty()`, `useFontFace()`, and `useCounterStyle()` — are hook-free and compatible with React Server Components. No `'use client'` directive needed. For the shared style language (state maps, tokens, units, extending semantics), see [Style DSL](dsl.md). For global configuration, see [Configuration](configuration.md). For the broader docs map, see the [Docs Hub](README.md).
|
|
4
|
+
|
|
5
|
+
> **Note:** This file was previously named `runtime.md`. All functionality documented here works in both server and client contexts — "runtime" referred to style computation during React rendering, not to client-side JavaScript.
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|
|
@@ -154,6 +156,75 @@ For architecture guidance on when to use modifiers vs `styleProps`, see [Methodo
|
|
|
154
156
|
|
|
155
157
|
---
|
|
156
158
|
|
|
159
|
+
## Token Props
|
|
160
|
+
|
|
161
|
+
Use `tokenProps` to expose token keys as direct component props instead of requiring the `tokens` object:
|
|
162
|
+
|
|
163
|
+
```jsx
|
|
164
|
+
// Before: tokens object
|
|
165
|
+
<ProgressBar tokens={{ $progress: '75%', '#accent': '#purple' }} />
|
|
166
|
+
|
|
167
|
+
// After: token props
|
|
168
|
+
<ProgressBar progress="75%" accentColor="#purple" />
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Array form
|
|
172
|
+
|
|
173
|
+
List prop names. Names ending in `Color` map to `#` color tokens; everything else maps to `$` custom property tokens:
|
|
174
|
+
|
|
175
|
+
```jsx
|
|
176
|
+
const ProgressBar = tasty({
|
|
177
|
+
tokenProps: ['progress', 'accentColor'] as const,
|
|
178
|
+
styles: { width: '$progress', fill: '#accent' },
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
<ProgressBar progress="75%" accentColor="#purple" />
|
|
182
|
+
// 'progress' → $progress → --progress
|
|
183
|
+
// 'accentColor' → #accent → --accent-color + --accent-color-oklch
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Object form
|
|
187
|
+
|
|
188
|
+
Map prop names to explicit `$`/`#`-prefixed token keys:
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
const Card = tasty({
|
|
192
|
+
tokenProps: {
|
|
193
|
+
size: '$card-size',
|
|
194
|
+
color: '#card-accent',
|
|
195
|
+
},
|
|
196
|
+
styles: { padding: '$card-size', fill: '#card-accent' },
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
<Card size="4x" color="#purple" />
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Merge with `tokens`
|
|
203
|
+
|
|
204
|
+
Token props and the `tokens` prop can be used together. Token props take precedence over `tokens`, which takes precedence over default `tokens` in `tasty({...})`:
|
|
205
|
+
|
|
206
|
+
```jsx
|
|
207
|
+
const Bar = tasty({
|
|
208
|
+
tokenProps: ['progress'] as const,
|
|
209
|
+
tokens: { $progress: '0%' }, // default
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
<Bar tokens={{ $progress: '50%' }} progress="90%" />
|
|
213
|
+
// progress="90%" wins (from token prop)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### When to use `tokenProps` vs `tokens`
|
|
217
|
+
|
|
218
|
+
| Use case | Recommendation |
|
|
219
|
+
|---|---|
|
|
220
|
+
| Component has a fixed set of known token keys | `tokenProps` — cleaner API, better TypeScript autocomplete |
|
|
221
|
+
| Component needs arbitrary/dynamic token values | `tokens` — open-ended `Record<string, TokenValue>` |
|
|
222
|
+
| Both fixed and dynamic | Combine: `tokenProps` for known keys, `tokens` for ad-hoc |
|
|
223
|
+
|
|
224
|
+
For architecture guidance, see [Methodology — tokenProps](methodology.md#tokenprops).
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
157
228
|
## Variants
|
|
158
229
|
|
|
159
230
|
Define named style variations. Only CSS for variants actually used at runtime is injected:
|
|
@@ -264,11 +335,33 @@ For the mental model behind sub-elements — how they share root state context a
|
|
|
264
335
|
|
|
265
336
|
---
|
|
266
337
|
|
|
267
|
-
##
|
|
338
|
+
## computeStyles
|
|
339
|
+
|
|
340
|
+
Hook-free, synchronous style computation. Can be used anywhere — including React Server Components, plain functions, and non-React code:
|
|
341
|
+
|
|
342
|
+
```tsx
|
|
343
|
+
import { computeStyles } from '@tenphi/tasty';
|
|
344
|
+
|
|
345
|
+
const { className } = computeStyles({
|
|
346
|
+
padding: '2x',
|
|
347
|
+
fill: '#surface',
|
|
348
|
+
radius: '1r',
|
|
349
|
+
});
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
On the client, CSS is injected synchronously into the DOM (idempotent via the injector cache). On the server, CSS is collected via the SSR collector if one is available. This is the same function that `tasty()` components use internally.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Style Functions
|
|
357
|
+
|
|
358
|
+
All style functions below are plain functions (not React hooks) and can be used in any environment: client components, SSR with a `ServerStyleCollector`, and React Server Components. They retain their `use` prefix for backward compatibility, but do not use any React hooks internally.
|
|
359
|
+
|
|
360
|
+
In server-only contexts (Next.js RSC without `'use client'`, Astro without `client:*` directives, SSG), components that use only Tasty style functions produce zero client JavaScript. Tasty never forces the `'use client'` boundary — that decision belongs to your component when it needs React interactivity (state, effects, event handlers).
|
|
268
361
|
|
|
269
362
|
### useStyles
|
|
270
363
|
|
|
271
|
-
Generate a className from a style object
|
|
364
|
+
Generate a className from a style object. Thin wrapper around `computeStyles()`:
|
|
272
365
|
|
|
273
366
|
```tsx
|
|
274
367
|
import { useStyles } from '@tenphi/tasty';
|
|
@@ -286,7 +379,7 @@ function MyComponent() {
|
|
|
286
379
|
|
|
287
380
|
### useGlobalStyles
|
|
288
381
|
|
|
289
|
-
Inject global styles for a CSS selector:
|
|
382
|
+
Inject global styles for a CSS selector. Accepts an optional third argument with an `id` for update tracking — when the styles change, the previous injection is disposed and the new one is injected:
|
|
290
383
|
|
|
291
384
|
```tsx
|
|
292
385
|
import { useGlobalStyles } from '@tenphi/tasty';
|
|
@@ -304,7 +397,7 @@ function ThemeStyles() {
|
|
|
304
397
|
|
|
305
398
|
### useRawCSS
|
|
306
399
|
|
|
307
|
-
Inject raw CSS strings:
|
|
400
|
+
Inject raw CSS strings. Accepts an optional `id` in the options for update tracking — when the CSS changes for the same id, the previous injection is replaced:
|
|
308
401
|
|
|
309
402
|
```tsx
|
|
310
403
|
import { useRawCSS } from '@tenphi/tasty';
|
|
@@ -338,7 +431,7 @@ function Spinner() {
|
|
|
338
431
|
}
|
|
339
432
|
```
|
|
340
433
|
|
|
341
|
-
`useKeyframes()` also supports a factory function
|
|
434
|
+
`useKeyframes()` also supports a factory function. The deps array is accepted for backward compatibility but the factory is called on every invocation — deduplication is handled internally by content hash:
|
|
342
435
|
|
|
343
436
|
```tsx
|
|
344
437
|
function Pulse({ scale }: { scale: number }) {
|
|
@@ -434,43 +527,22 @@ function EmojiList() {
|
|
|
434
527
|
}
|
|
435
528
|
```
|
|
436
529
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
```tsx
|
|
440
|
-
function DynamicList({ marker }: { marker: string }) {
|
|
441
|
-
const styleName = useCounterStyle(
|
|
442
|
-
() => ({
|
|
443
|
-
system: 'cyclic',
|
|
444
|
-
symbols: `"${marker}"`,
|
|
445
|
-
suffix: '" "',
|
|
446
|
-
}),
|
|
447
|
-
[marker],
|
|
448
|
-
);
|
|
449
|
-
|
|
450
|
-
return <ol style={{ listStyleType: styleName }}>...</ol>;
|
|
451
|
-
}
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
Signatures:
|
|
530
|
+
Signature:
|
|
455
531
|
|
|
456
532
|
```ts
|
|
457
533
|
function useCounterStyle(
|
|
458
534
|
descriptors: CounterStyleDescriptors,
|
|
459
535
|
options?: { name?: string; root?: Document | ShadowRoot },
|
|
460
536
|
): string;
|
|
461
|
-
|
|
462
|
-
function useCounterStyle(
|
|
463
|
-
factory: () => CounterStyleDescriptors,
|
|
464
|
-
deps: readonly unknown[],
|
|
465
|
-
options?: { name?: string; root?: Document | ShadowRoot },
|
|
466
|
-
): string;
|
|
467
537
|
```
|
|
468
538
|
|
|
469
539
|
### Troubleshooting
|
|
470
540
|
|
|
471
541
|
- Styles are not updating: make sure `configure()` runs before first render, and verify the generated class name or global rule with [Debug Utilities](debug.md).
|
|
472
|
-
- SSR output looks wrong: check the [SSR guide](ssr.md)
|
|
542
|
+
- SSR output looks wrong: check the [SSR guide](ssr.md) for collector setup. All style functions discover the SSR collector via `AsyncLocalStorage` or the global getter registered by `TastyRegistry`.
|
|
473
543
|
- Animation/custom property issues: prefer `useKeyframes()` and `useProperty()` over raw CSS when you want Tasty to manage injection and SSR collection for you.
|
|
544
|
+
- For dynamic styles that change over the component lifecycle, use the `id` option in `useGlobalStyles()` and `useRawCSS()` to enable update tracking.
|
|
545
|
+
- RSC inline mode: CSS accumulated by standalone style functions (`useGlobalStyles`, `useRawCSS`, etc.) is flushed into inline `<style>` tags by the next `tasty()` component in the render tree. If your page uses only standalone style functions without any `tasty()` component, the CSS will not be emitted. Ensure at least one `tasty()` component is present in each RSC render tree.
|
|
474
546
|
|
|
475
547
|
---
|
|
476
548
|
|