@cube-dev/ui-kit 0.121.0 → 0.121.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +12 -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 +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/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/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/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.d.ts +8 -2
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Select/Select.js.map +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/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.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/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.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.js +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/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/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/BaseProperties.md +78 -0
- package/docs/ComplexLayout.md +459 -0
- package/docs/CreateComponent.md +410 -0
- package/docs/FieldProperties.md +117 -0
- package/docs/Introduction.md +122 -0
- package/docs/RenderCache.md +177 -0
- package/docs/Result.md +42 -0
- package/docs/SimpleLayout.md +26 -0
- package/docs/Typography.md +38 -0
- package/docs/components/Block.md +33 -0
- package/docs/components/CollectionItem.md +293 -0
- package/docs/components/GridProvider.md +38 -0
- package/docs/components/Root.md +50 -0
- package/docs/components/actions/Action.md +47 -0
- package/docs/components/actions/Banner.md +195 -0
- package/docs/components/actions/Button.md +209 -0
- package/docs/components/actions/ButtonGroup.md +46 -0
- package/docs/components/actions/ButtonSplit.md +199 -0
- package/docs/components/actions/CommandMenu.md +422 -0
- package/docs/components/actions/ItemAction.md +60 -0
- package/docs/components/actions/ItemButton.md +316 -0
- package/docs/components/actions/Link.md +325 -0
- package/docs/components/actions/Menu.md +485 -0
- package/docs/components/actions/MenuTrigger.md +47 -0
- package/docs/components/actions/SubMenuTrigger.md +38 -0
- package/docs/components/actions/use-anchored-menu.md +209 -0
- package/docs/components/actions/use-context-menu.md +218 -0
- package/docs/components/content/ActiveZone.md +37 -0
- package/docs/components/content/Alert.md +40 -0
- package/docs/components/content/Avatar.md +37 -0
- package/docs/components/content/Badge.md +194 -0
- package/docs/components/content/Card.md +40 -0
- package/docs/components/content/Content.md +44 -0
- package/docs/components/content/CopyPasteBlock.md +36 -0
- package/docs/components/content/CopySnippet.md +43 -0
- package/docs/components/content/Disclosure.md +181 -0
- package/docs/components/content/Divider.md +39 -0
- package/docs/components/content/Footer.md +35 -0
- package/docs/components/content/Header.md +35 -0
- package/docs/components/content/HotKeys.md +352 -0
- package/docs/components/content/Item.md +499 -0
- package/docs/components/content/ItemBadge.md +31 -0
- package/docs/components/content/ItemCard.md +131 -0
- package/docs/components/content/Layout.md +843 -0
- package/docs/components/content/Paragraph.md +32 -0
- package/docs/components/content/Placeholder.md +37 -0
- package/docs/components/content/PrismCode.md +36 -0
- package/docs/components/content/PrismDiffCode.md +29 -0
- package/docs/components/content/Result.md +46 -0
- package/docs/components/content/Skeleton.md +35 -0
- package/docs/components/content/Tag.md +165 -0
- package/docs/components/content/Text.md +54 -0
- package/docs/components/content/TextItem.md +217 -0
- package/docs/components/content/Title.md +45 -0
- package/docs/components/fields/Checkbox.md +176 -0
- package/docs/components/fields/ComboBox.md +651 -0
- package/docs/components/fields/DatePicker.md +227 -0
- package/docs/components/fields/FileInput.md +194 -0
- package/docs/components/fields/FilterListBox.md +726 -0
- package/docs/components/fields/FilterPicker.md +776 -0
- package/docs/components/fields/HueSlider.md +175 -0
- package/docs/components/fields/ListBox.md +714 -0
- package/docs/components/fields/NumberInput.md +180 -0
- package/docs/components/fields/PasswordInput.md +214 -0
- package/docs/components/fields/Picker.md +906 -0
- package/docs/components/fields/RadioGroup.md +310 -0
- package/docs/components/fields/SearchInput.md +224 -0
- package/docs/components/fields/Select.md +576 -0
- package/docs/components/fields/Slider.md +53 -0
- package/docs/components/fields/Switch.md +169 -0
- package/docs/components/fields/TextArea.md +61 -0
- package/docs/components/fields/TextInput.md +205 -0
- package/docs/components/fields/TextInputMapper.md +34 -0
- package/docs/components/form/Field.md +333 -0
- package/docs/components/form/Form.md +644 -0
- package/docs/components/form/FormInstance.md +307 -0
- package/docs/components/helpers/DisplayTransition.md +268 -0
- package/docs/components/helpers/IconSwitch.md +160 -0
- package/docs/components/layout/Flex.md +51 -0
- package/docs/components/layout/Flow.md +32 -0
- package/docs/components/layout/Grid.md +46 -0
- package/docs/components/layout/Panel.md +65 -0
- package/docs/components/layout/Prefix.md +37 -0
- package/docs/components/layout/ResizablePanel.md +69 -0
- package/docs/components/layout/Space.md +44 -0
- package/docs/components/layout/Suffix.md +39 -0
- package/docs/components/navigation/Tabs.md +726 -0
- package/docs/components/organisms/FileTabs.md +39 -0
- package/docs/components/organisms/StatsCard.md +40 -0
- package/docs/components/other/CloudLogo.md +33 -0
- package/docs/components/overlays/AlertDialog.md +51 -0
- package/docs/components/overlays/Dialog.md +200 -0
- package/docs/components/overlays/DialogContainer.md +201 -0
- package/docs/components/overlays/DialogForm.md +295 -0
- package/docs/components/overlays/DialogTrigger.md +191 -0
- package/docs/components/overlays/Notifications.md +402 -0
- package/docs/components/overlays/Toast.md +289 -0
- package/docs/components/overlays/Tooltip.md +400 -0
- package/docs/components/overlays/TooltipProvider.md +42 -0
- package/docs/components/overlays/TooltipTrigger.md +42 -0
- package/docs/components/overlays/UseDialogContainer.md +597 -0
- package/docs/components/portal/Portal.md +29 -0
- package/docs/components/status/LoadingAnimation.md +27 -0
- package/docs/components/status/Spin.md +35 -0
- package/docs/tasty/configuration.md +211 -0
- package/docs/tasty/debug.md +505 -0
- package/docs/tasty/injector.md +528 -0
- package/docs/tasty/styles.md +567 -0
- package/docs/tasty/tasty-static.md +376 -0
- package/docs/tasty/usage.md +695 -0
- package/package.json +4 -8
|
@@ -0,0 +1,695 @@
|
|
|
1
|
+
# Usage Guide
|
|
2
|
+
|
|
3
|
+
`tasty` is a powerful utility for creating styled React components with a declarative, design-system-integrated API. It combines the flexibility of CSS-in-JS with the consistency of a design system, enabling you to build maintainable, themeable components quickly.
|
|
4
|
+
|
|
5
|
+
For global configuration (tokens, recipes, custom units, handlers), see **[Configuration](configuration.md)**.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
### Creating Your First Component
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
import { tasty } from '@tenphi/tasty';
|
|
15
|
+
|
|
16
|
+
// Basic styled component
|
|
17
|
+
const Card = tasty({
|
|
18
|
+
as: 'div',
|
|
19
|
+
styles: {
|
|
20
|
+
padding: '4x',
|
|
21
|
+
fill: '#white',
|
|
22
|
+
border: true,
|
|
23
|
+
radius: true,
|
|
24
|
+
},
|
|
25
|
+
styleProps: ['padding', 'fill'], // Expose styles as props
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Usage
|
|
29
|
+
<Card>Hello World</Card>
|
|
30
|
+
<Card padding="6x" fill="#gray.05">Custom Card</Card>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Extending Existing Components
|
|
34
|
+
|
|
35
|
+
> **Best Practice:** Always prefer creating styled wrappers over using the `styles` prop directly.
|
|
36
|
+
|
|
37
|
+
```jsx
|
|
38
|
+
// Recommended
|
|
39
|
+
const PrimaryButton = tasty(Button, {
|
|
40
|
+
styles: {
|
|
41
|
+
fill: '#purple',
|
|
42
|
+
color: '#white',
|
|
43
|
+
padding: '2x 4x',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Avoid
|
|
48
|
+
<Button styles={{ fill: '#purple' }}>Click me</Button>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Extending vs. Replacing State Maps
|
|
52
|
+
|
|
53
|
+
When a style property uses a state map, the merge behavior depends on whether the child provides a `''` (default) key:
|
|
54
|
+
|
|
55
|
+
- **No `''` key** — extend mode: parent states are preserved, child adds/overrides
|
|
56
|
+
- **Has `''` key** — replace mode: child defines everything from scratch
|
|
57
|
+
|
|
58
|
+
```jsx
|
|
59
|
+
// Parent has: fill: { '': '#white', hovered: '#blue', disabled: '#gray' }
|
|
60
|
+
|
|
61
|
+
// Extend — no '' key, parent states preserved
|
|
62
|
+
const MyButton = tasty(Button, {
|
|
63
|
+
styles: {
|
|
64
|
+
fill: {
|
|
65
|
+
'loading': '#yellow', // append new state
|
|
66
|
+
'disabled': '#gray.20', // override existing state in place
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Replace — has '' key, parent states dropped
|
|
72
|
+
const MyButton = tasty(Button, {
|
|
73
|
+
styles: {
|
|
74
|
+
fill: {
|
|
75
|
+
'': '#red',
|
|
76
|
+
'hovered': '#blue',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Use `'@inherit'` to pull a parent state value. In extend mode it repositions the state; in replace mode it cherry-picks it:
|
|
83
|
+
|
|
84
|
+
```jsx
|
|
85
|
+
// Extend mode: reposition disabled to end (highest CSS priority)
|
|
86
|
+
fill: {
|
|
87
|
+
'loading': '#yellow',
|
|
88
|
+
disabled: '@inherit',
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Replace mode: cherry-pick disabled from parent
|
|
92
|
+
fill: {
|
|
93
|
+
'': '#red',
|
|
94
|
+
disabled: '@inherit',
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use `null` inside a state map to remove a state, or `false` to block it entirely (tombstone):
|
|
99
|
+
|
|
100
|
+
```jsx
|
|
101
|
+
fill: { pressed: null } // removes pressed from the result
|
|
102
|
+
fill: { disabled: false } // tombstone — no CSS for disabled, blocks recipe too
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Resetting Properties with `null` and `false`
|
|
106
|
+
|
|
107
|
+
```jsx
|
|
108
|
+
const SimpleButton = tasty(Button, {
|
|
109
|
+
styles: {
|
|
110
|
+
fill: null, // discard parent's fill, let recipe fill in
|
|
111
|
+
border: false, // no border at all (tombstone — blocks recipe too)
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
| Value | Meaning | Recipe fills in? |
|
|
117
|
+
|-------|---------|-----------------|
|
|
118
|
+
| `undefined` | Not provided — parent preserved | N/A |
|
|
119
|
+
| `null` | Intentional unset — parent discarded | Yes |
|
|
120
|
+
| `false` | Tombstone — blocks everything | No |
|
|
121
|
+
|
|
122
|
+
### Essential Patterns
|
|
123
|
+
|
|
124
|
+
```jsx
|
|
125
|
+
// State-based styling
|
|
126
|
+
const InteractiveCard = tasty({
|
|
127
|
+
styles: {
|
|
128
|
+
fill: {
|
|
129
|
+
'': '#white',
|
|
130
|
+
'hovered': '#gray.05',
|
|
131
|
+
'pressed': '#gray.10',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Using design tokens
|
|
137
|
+
const TokenCard = tasty({
|
|
138
|
+
styles: {
|
|
139
|
+
fill: '#surface', // Color token
|
|
140
|
+
color: '#text', // Color token
|
|
141
|
+
padding: '2x', // Custom unit (gap × 2)
|
|
142
|
+
radius: '1r', // Custom unit (border-radius)
|
|
143
|
+
border: '1bw solid #border', // Border width token
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Configuration
|
|
151
|
+
|
|
152
|
+
For tokens, recipes, custom units, style handlers, and other global settings, see **[Configuration](configuration.md)**.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Dictionary
|
|
157
|
+
|
|
158
|
+
### Style Mapping
|
|
159
|
+
|
|
160
|
+
Object where keys represent states and values are the styles to apply:
|
|
161
|
+
|
|
162
|
+
```jsx
|
|
163
|
+
fill: { '': '#white', hovered: '#gray.05', 'theme=danger': '#red' }
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### State Key Types
|
|
167
|
+
|
|
168
|
+
| Syntax | Example | Generated CSS |
|
|
169
|
+
|--------|---------|---------------|
|
|
170
|
+
| Boolean modifier | `hovered` | `[data-hovered]` |
|
|
171
|
+
| Value modifier | `theme=danger` | `[data-theme="danger"]` |
|
|
172
|
+
| Pseudo-class | `:hover` | `:hover` |
|
|
173
|
+
| Class selector | `.active` | `.active` |
|
|
174
|
+
| Attribute selector | `[aria-expanded="true"]` | `[aria-expanded="true"]` |
|
|
175
|
+
| Combined | `hovered & .active` | `[data-hovered].active` |
|
|
176
|
+
|
|
177
|
+
### Sub-element
|
|
178
|
+
|
|
179
|
+
Element styled using a capitalized key. Identified by `data-element` attribute:
|
|
180
|
+
|
|
181
|
+
```jsx
|
|
182
|
+
styles: { Title: { preset: 'h3' } }
|
|
183
|
+
// Targets: <div data-element="Title">
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Color Token
|
|
187
|
+
|
|
188
|
+
Named color prefixed with `#` that maps to CSS custom properties. Supports opacity with `.N` suffix:
|
|
189
|
+
|
|
190
|
+
```jsx
|
|
191
|
+
fill: '#purple.5' // → var(--purple-color) with 50% opacity
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Modifier
|
|
195
|
+
|
|
196
|
+
State value via `mods` prop that generates `data-*` attributes:
|
|
197
|
+
|
|
198
|
+
```jsx
|
|
199
|
+
mods={{ hovered: true, theme: 'danger' }}
|
|
200
|
+
// → data-hovered="" data-theme="danger"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Core Concepts
|
|
206
|
+
|
|
207
|
+
### Component Creation
|
|
208
|
+
|
|
209
|
+
```jsx
|
|
210
|
+
// Create new element
|
|
211
|
+
const Box = tasty({
|
|
212
|
+
as: 'div',
|
|
213
|
+
styles: { /* styles */ },
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Extend existing component
|
|
217
|
+
const StyledButton = tasty(Button, {
|
|
218
|
+
styles: { /* additional styles */ },
|
|
219
|
+
});
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Style Props
|
|
223
|
+
|
|
224
|
+
Use `styleProps` to expose style properties as direct component props:
|
|
225
|
+
|
|
226
|
+
```jsx
|
|
227
|
+
const FlexibleBox = tasty({
|
|
228
|
+
as: 'div',
|
|
229
|
+
styles: {
|
|
230
|
+
display: 'flex',
|
|
231
|
+
padding: '2x',
|
|
232
|
+
},
|
|
233
|
+
styleProps: ['gap', 'align', 'placeContent', 'fill'],
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
<FlexibleBox gap="2x" align="center" fill="#surface">
|
|
237
|
+
Content
|
|
238
|
+
</FlexibleBox>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Color Tokens & Opacity
|
|
242
|
+
|
|
243
|
+
```jsx
|
|
244
|
+
color: '#purple', // Full opacity
|
|
245
|
+
color: '#purple.5', // 50% opacity
|
|
246
|
+
color: '#purple.05', // 5% opacity
|
|
247
|
+
fill: '#current', // → currentcolor
|
|
248
|
+
fill: '#current.5', // → color-mix(in oklab, currentcolor 50%, transparent)
|
|
249
|
+
color: '(#primary, #secondary)', // Fallback syntax
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Built-in Units
|
|
253
|
+
|
|
254
|
+
| Unit | Description | Example | CSS Output |
|
|
255
|
+
|------|-------------|---------|------------|
|
|
256
|
+
| `x` | Gap multiplier | `2x` | `calc(var(--gap) * 2)` |
|
|
257
|
+
| `r` | Border radius | `1r` | `var(--radius)` |
|
|
258
|
+
| `cr` | Card border radius | `1cr` | `var(--card-radius)` |
|
|
259
|
+
| `bw` | Border width | `2bw` | `calc(var(--border-width) * 2)` |
|
|
260
|
+
| `ow` | Outline width | `1ow` | `var(--outline-width)` |
|
|
261
|
+
| `fs` | Font size | `1fs` | `var(--font-size)` |
|
|
262
|
+
| `lh` | Line height | `1lh` | `var(--line-height)` |
|
|
263
|
+
| `sf` | Stable fraction | `1sf` | `minmax(0, 1fr)` |
|
|
264
|
+
|
|
265
|
+
You can register additional custom units via [`configure()`](configuration.md#options).
|
|
266
|
+
|
|
267
|
+
### Predefined Tokens
|
|
268
|
+
|
|
269
|
+
Tokens defined via [`configure({ tokens })`](configuration.md#predefined-tokens) are replaced at parse time and baked into the generated CSS:
|
|
270
|
+
|
|
271
|
+
```jsx
|
|
272
|
+
const Card = tasty({
|
|
273
|
+
styles: {
|
|
274
|
+
padding: '$card-padding',
|
|
275
|
+
fill: '#surface',
|
|
276
|
+
border: '1bw solid #accent',
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Recipes
|
|
282
|
+
|
|
283
|
+
Apply predefined style bundles (defined via [`configure({ recipes })`](configuration.md#recipes)) using the `recipe` style property:
|
|
284
|
+
|
|
285
|
+
```jsx
|
|
286
|
+
const Card = tasty({
|
|
287
|
+
styles: {
|
|
288
|
+
recipe: 'card',
|
|
289
|
+
color: '#text',
|
|
290
|
+
},
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// Compose multiple recipes
|
|
294
|
+
const ElevatedCard = tasty({
|
|
295
|
+
styles: {
|
|
296
|
+
recipe: 'card elevated',
|
|
297
|
+
color: '#text',
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Post-merge recipes (`/` separator):**
|
|
303
|
+
|
|
304
|
+
Recipes listed after `/` are applied *after* component styles using `mergeStyles`:
|
|
305
|
+
|
|
306
|
+
```jsx
|
|
307
|
+
const Input = tasty({
|
|
308
|
+
styles: {
|
|
309
|
+
recipe: 'reset input / input-autofill',
|
|
310
|
+
preset: 't3',
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Use `none` to skip base recipes and apply only post recipes:
|
|
316
|
+
|
|
317
|
+
```jsx
|
|
318
|
+
const Custom = tasty({
|
|
319
|
+
styles: {
|
|
320
|
+
recipe: 'none / disabled',
|
|
321
|
+
padding: '2x',
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Advanced States (`@` prefix)
|
|
327
|
+
|
|
328
|
+
| Prefix | Purpose | Example |
|
|
329
|
+
|--------|---------|---------|
|
|
330
|
+
| `@media` | Media queries | `@media(w < 768px)` |
|
|
331
|
+
| `@(...)` | Container queries | `@(panel, w >= 300px)` |
|
|
332
|
+
| `@supports` | Feature/selector support | `@supports(display: grid)` |
|
|
333
|
+
| `@root` | Root element states | `@root(theme=dark)` |
|
|
334
|
+
| `@parent` | Parent/ancestor element states | `@parent(hovered)` |
|
|
335
|
+
| `@own` | Sub-element's own state | `@own(hovered)` |
|
|
336
|
+
| `@starting` | Entry animation | `@starting` |
|
|
337
|
+
| `:is()` | CSS `:is()` structural pseudo-class | `:is(fieldset > label)` |
|
|
338
|
+
| `:has()` | CSS `:has()` relational pseudo-class | `:has(> Icon)` |
|
|
339
|
+
| `:not()` | CSS `:not()` negation (prefer `!:is()`) | `:not(:first-child)` |
|
|
340
|
+
| `:where()` | CSS `:where()` (zero specificity) | `:where(Section)` |
|
|
341
|
+
|
|
342
|
+
#### `@parent(...)` — Parent Element States
|
|
343
|
+
|
|
344
|
+
Style based on ancestor element attributes. Uses `:is([selector] *)` / `:not([selector] *)` for symmetric, composable parent checks. Boolean logic (`&`, `|`, `!`) is supported inside `@parent()`.
|
|
345
|
+
|
|
346
|
+
```jsx
|
|
347
|
+
const Highlight = tasty({
|
|
348
|
+
styles: {
|
|
349
|
+
fill: {
|
|
350
|
+
'': '#white',
|
|
351
|
+
'@parent(hovered)': '#gray.05', // Any ancestor has [data-hovered]
|
|
352
|
+
'@parent(theme=dark, >)': '#dark-02', // Direct parent has [data-theme="dark"]
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
| Syntax | CSS Output |
|
|
359
|
+
|--------|------------|
|
|
360
|
+
| `@parent(hovered)` | `:is([data-hovered] *)` |
|
|
361
|
+
| `!@parent(hovered)` | `:not([data-hovered] *)` |
|
|
362
|
+
| `@parent(hovered, >)` | `:is([data-hovered] > *)` (direct parent) |
|
|
363
|
+
| `@parent(.active)` | `:is(.active *)` |
|
|
364
|
+
| `@parent(hovered & focused)` | `:is([data-hovered][data-focused] *)` (same ancestor) |
|
|
365
|
+
| `@parent(hovered) & @parent(focused)` | `:is([data-hovered] *):is([data-focused] *)` (independent ancestors) |
|
|
366
|
+
| `@parent(hovered \| focused)` | `:is([data-hovered] *, [data-focused] *)` (OR inside single wrapper) |
|
|
367
|
+
|
|
368
|
+
For sub-elements, the parent check applies to the root element's ancestors:
|
|
369
|
+
|
|
370
|
+
```jsx
|
|
371
|
+
const Card = tasty({
|
|
372
|
+
styles: {
|
|
373
|
+
Label: {
|
|
374
|
+
color: {
|
|
375
|
+
'': '#text',
|
|
376
|
+
'@parent(hovered)': '#primary',
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
});
|
|
381
|
+
// → .t0.t0:is([data-hovered] *) [data-element="Label"]
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
#### `:is()`, `:has()` — CSS Structural Pseudo-classes
|
|
385
|
+
|
|
386
|
+
Use CSS structural pseudo-classes directly in state keys. Capitalized words become `[data-element="..."]` selectors; lowercase words are HTML tags. A trailing combinator (`>`, `+`, `~`) is auto-completed with `*`.
|
|
387
|
+
|
|
388
|
+
`:where()` and `:not()` are also supported but rarely needed — use `:is()` and `!` negation instead.
|
|
389
|
+
|
|
390
|
+
> **Performance warning:** CSS structural pseudo-classes — especially `:has()` — can be costly for the browser to evaluate because they require inspecting the DOM tree beyond the matched element. Tasty already provides a rich, purpose-built state system (`@parent()`, `@own()`, modifiers, boolean logic) that covers the vast majority of use cases without the performance trade-off. **Prefer Tasty's built-in mechanisms and treat `:has()` / `:is()` as a last resort** for conditions that cannot be expressed any other way.
|
|
391
|
+
|
|
392
|
+
```jsx
|
|
393
|
+
const Card = tasty({
|
|
394
|
+
styles: {
|
|
395
|
+
display: {
|
|
396
|
+
'': 'block',
|
|
397
|
+
':has(> Icon)': 'grid', // has Icon as direct child
|
|
398
|
+
':has(+ Icon)': 'grid', // immediately followed by an Icon sibling
|
|
399
|
+
':has(~ Icon)': 'grid', // has an Icon sibling somewhere after
|
|
400
|
+
':has(Icon +)': 'grid', // immediately preceded by an Icon sibling (auto-completes to `Icon + *`)
|
|
401
|
+
':has(Icon ~)': 'grid', // has an Icon sibling somewhere before (auto-completes to `Icon ~ *`)
|
|
402
|
+
':is(fieldset > label)': 'inline', // is a label inside a fieldset (HTML tags)
|
|
403
|
+
'!:has(> Icon)': 'flex', // negation: no Icon child
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
| Syntax | CSS Output | Meaning |
|
|
410
|
+
|--------|------------|---------|
|
|
411
|
+
| `:has(> Icon)` | `:has(> [data-element="Icon"])` | Has Icon as direct child |
|
|
412
|
+
| `:has(+ Icon)` | `:has(+ [data-element="Icon"])` | Immediately followed by an Icon sibling |
|
|
413
|
+
| `:has(~ Icon)` | `:has(~ [data-element="Icon"])` | Has an Icon sibling somewhere after |
|
|
414
|
+
| `:has(Icon +)` | `:has([data-element="Icon"] + *)` | Immediately preceded by an Icon sibling |
|
|
415
|
+
| `:has(Icon ~)` | `:has([data-element="Icon"] ~ *)` | Has an Icon sibling somewhere before |
|
|
416
|
+
| `:has(>)` | `:has(> *)` | Has any direct child |
|
|
417
|
+
| `:is(> Field + input)` | `:is(> [data-element="Field"] + input)` | Structural match |
|
|
418
|
+
| `:has(button)` | `:has(button)` | HTML tag (lowercase, unchanged) |
|
|
419
|
+
| `!:has(> Icon)` | `:not(:has(> [data-element="Icon"]))` | Negation (use `!`) |
|
|
420
|
+
| `!:is(Panel)` | `:not([data-element="Panel"])` | Negation (use `!:is`) |
|
|
421
|
+
|
|
422
|
+
Combine with other states using boolean logic:
|
|
423
|
+
|
|
424
|
+
```jsx
|
|
425
|
+
':has(> Icon) & hovered' // structural + data attribute
|
|
426
|
+
'@parent(hovered) & :has(> Icon)' // parent check + structural
|
|
427
|
+
':has(> Icon) | :has(> Button)' // OR: either sub-element present
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
> **Nesting limit:** The state key parser supports up to 2 levels of nested parentheses inside `:is()`, `:has()`, `:not()`, and `:where()` — e.g. `:has(Input:not(:disabled))` works, but 3+ levels like `:has(:is(:not(:hover)))` will not be tokenized correctly. This covers virtually all practical use cases.
|
|
431
|
+
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## Style Properties
|
|
435
|
+
|
|
436
|
+
For a complete reference of all enhanced style properties — syntax, values, modifiers, and recommendations — see **[Style Properties Reference](styles.md)**.
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Advanced Features
|
|
441
|
+
|
|
442
|
+
### Keyframes
|
|
443
|
+
|
|
444
|
+
```jsx
|
|
445
|
+
const Pulse = tasty({
|
|
446
|
+
styles: {
|
|
447
|
+
animation: 'pulse 2s infinite',
|
|
448
|
+
'@keyframes': {
|
|
449
|
+
pulse: {
|
|
450
|
+
'0%, 100%': { transform: 'scale(1)' },
|
|
451
|
+
'50%': { transform: 'scale(1.05)' },
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
},
|
|
455
|
+
});
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Properties (`@property`)
|
|
459
|
+
|
|
460
|
+
CSS cannot transition or animate custom properties unless the browser knows their type. Tasty solves this automatically — when you assign a concrete value to a custom property, the type is inferred and a CSS `@property` rule is registered behind the scenes:
|
|
461
|
+
|
|
462
|
+
```jsx
|
|
463
|
+
const AnimatedGradient = tasty({
|
|
464
|
+
styles: {
|
|
465
|
+
'$gradient-angle': '0deg',
|
|
466
|
+
'#theme': 'okhsl(280 80% 50%)',
|
|
467
|
+
background: 'linear-gradient($gradient-angle, #theme, transparent)',
|
|
468
|
+
transition: '$$gradient-angle 0.3s, ##theme 0.3s',
|
|
469
|
+
},
|
|
470
|
+
});
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
Here `$gradient-angle: '0deg'` is detected as `<angle>` and `#theme` as `<color>` (via the `#name` naming convention), so both transitions work without any manual `@property` declarations. Numeric types (`<number>`, `<length>`, `<percentage>`, `<angle>`, `<time>`) are inferred from values; `<color>` is inferred from `#name` tokens.
|
|
474
|
+
|
|
475
|
+
Use explicit `@properties` when you need non-default settings like `inherits: false`:
|
|
476
|
+
|
|
477
|
+
```jsx
|
|
478
|
+
'@properties': {
|
|
479
|
+
'$gradient-angle': { syntax: '<angle>', inherits: false, initialValue: '0deg' },
|
|
480
|
+
},
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Variants & Theming
|
|
484
|
+
|
|
485
|
+
```jsx
|
|
486
|
+
const Button = tasty({
|
|
487
|
+
styles: {
|
|
488
|
+
padding: '2x 4x',
|
|
489
|
+
border: true,
|
|
490
|
+
},
|
|
491
|
+
variants: {
|
|
492
|
+
default: { fill: '#blue', color: '#white' },
|
|
493
|
+
danger: { fill: '#red', color: '#white' },
|
|
494
|
+
outline: { fill: 'transparent', color: '#blue', border: '1bw solid #blue' },
|
|
495
|
+
},
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
<Button variant="danger">Delete</Button>
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
#### Extending Variants with Base State Maps
|
|
502
|
+
|
|
503
|
+
When base `styles` contain an extend-mode state map (an object **without** a `''` key), it is applied **after** the variant merge. This lets you add or override states across all variants without repeating yourself:
|
|
504
|
+
|
|
505
|
+
```jsx
|
|
506
|
+
const Badge = tasty({
|
|
507
|
+
styles: {
|
|
508
|
+
padding: '1x 2x',
|
|
509
|
+
// No '' key → extend mode: appended to every variant's border
|
|
510
|
+
border: {
|
|
511
|
+
'type=primary': '#clear',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
variants: {
|
|
515
|
+
primary: {
|
|
516
|
+
border: { '': '#white.2', pressed: '#primary-text', disabled: '#clear' },
|
|
517
|
+
fill: { '': '#white #primary', hovered: '#white #primary-text' },
|
|
518
|
+
},
|
|
519
|
+
secondary: {
|
|
520
|
+
border: { '': '#primary.15', pressed: '#primary.3' },
|
|
521
|
+
fill: '#primary.10',
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
// Both variants get 'type=primary': '#clear' appended to their border map
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Properties that are **not** extend-mode (simple values, state maps with `''`, `null`, `false`, selectors, sub-elements) merge with variants as before — the variant can fully replace them.
|
|
530
|
+
|
|
531
|
+
### Sub-element Styling
|
|
532
|
+
|
|
533
|
+
Sub-elements are inner parts of a compound component, styled via capitalized keys in `styles` and identified by `data-element` attributes in the DOM.
|
|
534
|
+
|
|
535
|
+
> **Best Practice:** Use the `elements` prop to declare sub-element components. This gives you typed, reusable sub-components (`Card.Title`, `Card.Content`) instead of manually writing `data-element` attributes.
|
|
536
|
+
|
|
537
|
+
```jsx
|
|
538
|
+
const Card = tasty({
|
|
539
|
+
styles: {
|
|
540
|
+
padding: '4x',
|
|
541
|
+
Title: { preset: 'h3', color: '#primary' },
|
|
542
|
+
Content: { color: '#text' },
|
|
543
|
+
},
|
|
544
|
+
elements: {
|
|
545
|
+
Title: 'h3',
|
|
546
|
+
Content: 'div',
|
|
547
|
+
},
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
// Sub-components automatically get data-element attributes
|
|
551
|
+
<Card>
|
|
552
|
+
<Card.Title>Card Title</Card.Title>
|
|
553
|
+
<Card.Content>Card content</Card.Content>
|
|
554
|
+
</Card>
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
Each entry in `elements` can be a tag name string or a config object:
|
|
558
|
+
|
|
559
|
+
```jsx
|
|
560
|
+
elements: {
|
|
561
|
+
Title: 'h3', // shorthand: tag name only
|
|
562
|
+
Icon: { as: 'span', qa: 'card-icon' }, // full form: tag + QA attribute
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
The sub-components produced by `elements` support `mods`, `tokens`, `isDisabled`, `isHidden`, and `isChecked` props — the same modifier interface as the root component.
|
|
567
|
+
|
|
568
|
+
If you don't need sub-components (e.g., the inner elements are already rendered by a third-party library), you can still style them by key alone — just omit `elements` and apply `data-element` manually:
|
|
569
|
+
|
|
570
|
+
```jsx
|
|
571
|
+
const Card = tasty({
|
|
572
|
+
styles: {
|
|
573
|
+
padding: '4x',
|
|
574
|
+
Title: { preset: 'h3', color: '#primary' },
|
|
575
|
+
},
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
<Card>
|
|
579
|
+
<div data-element="Title">Card Title</div>
|
|
580
|
+
</Card>
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
#### Selector Affix (`$`)
|
|
584
|
+
|
|
585
|
+
Control how a sub-element selector attaches to the root selector using the `$` property inside the sub-element's styles:
|
|
586
|
+
|
|
587
|
+
| Pattern | Result | Description |
|
|
588
|
+
|---------|--------|-------------|
|
|
589
|
+
| *(none)* | ` [el]` | Descendant (default) |
|
|
590
|
+
| `>` | `> [el]` | Direct child |
|
|
591
|
+
| `>Body>Row>` | `> [Body] > [Row] > [el]` | Chained elements |
|
|
592
|
+
| `::before` | `::before` | Root pseudo (no key) |
|
|
593
|
+
| `@::before` | `[el]::before` | Pseudo on the sub-element |
|
|
594
|
+
| `>@:hover` | `> [el]:hover` | Pseudo-class on the sub-element |
|
|
595
|
+
| `>@.active` | `> [el].active` | Class on the sub-element |
|
|
596
|
+
|
|
597
|
+
The `@` placeholder marks exactly where the `[data-element="..."]` selector is injected, allowing you to attach pseudo-classes, pseudo-elements, or class selectors directly to the sub-element instead of the root:
|
|
598
|
+
|
|
599
|
+
```jsx
|
|
600
|
+
const List = tasty({
|
|
601
|
+
styles: {
|
|
602
|
+
Item: {
|
|
603
|
+
$: '>@:last-child',
|
|
604
|
+
border: 'none',
|
|
605
|
+
},
|
|
606
|
+
},
|
|
607
|
+
});
|
|
608
|
+
// → .t0 > [data-element="Item"]:last-child { border: none }
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
---
|
|
612
|
+
|
|
613
|
+
## Hooks
|
|
614
|
+
|
|
615
|
+
### useStyles
|
|
616
|
+
|
|
617
|
+
```tsx
|
|
618
|
+
import { useStyles } from '@tenphi/tasty';
|
|
619
|
+
|
|
620
|
+
function MyComponent() {
|
|
621
|
+
const { className } = useStyles({
|
|
622
|
+
padding: '2x',
|
|
623
|
+
fill: '#surface',
|
|
624
|
+
radius: '1r',
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
return <div className={className}>Styled content</div>;
|
|
628
|
+
}
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### useGlobalStyles
|
|
632
|
+
|
|
633
|
+
```tsx
|
|
634
|
+
import { useGlobalStyles } from '@tenphi/tasty';
|
|
635
|
+
|
|
636
|
+
function ThemeStyles() {
|
|
637
|
+
useGlobalStyles('.card', {
|
|
638
|
+
padding: '4x',
|
|
639
|
+
fill: '#surface',
|
|
640
|
+
radius: '1r',
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
### useRawCSS
|
|
648
|
+
|
|
649
|
+
```tsx
|
|
650
|
+
import { useRawCSS } from '@tenphi/tasty';
|
|
651
|
+
|
|
652
|
+
function GlobalReset() {
|
|
653
|
+
useRawCSS(`
|
|
654
|
+
body { margin: 0; padding: 0; }
|
|
655
|
+
`);
|
|
656
|
+
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
### useMergeStyles
|
|
662
|
+
|
|
663
|
+
```tsx
|
|
664
|
+
import { useMergeStyles } from '@tenphi/tasty';
|
|
665
|
+
|
|
666
|
+
function MyTabs({ styles, tabListStyles, prefixStyles }) {
|
|
667
|
+
const mergedStyles = useMergeStyles(styles, {
|
|
668
|
+
TabList: tabListStyles,
|
|
669
|
+
Prefix: prefixStyles,
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
return <TabsElement styles={mergedStyles} />;
|
|
673
|
+
}
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
---
|
|
677
|
+
|
|
678
|
+
## Best Practices
|
|
679
|
+
|
|
680
|
+
### Do's
|
|
681
|
+
|
|
682
|
+
- Use styled wrappers instead of `styles` prop directly
|
|
683
|
+
- Use design tokens and custom units (`#text`, `2x`, `1r`)
|
|
684
|
+
- Use semantic transition names (`theme 0.3s`)
|
|
685
|
+
- Use `elements` prop to declare typed sub-components for compound components
|
|
686
|
+
- Use `styleProps` for component APIs
|
|
687
|
+
- Use `tokens` prop for dynamic values
|
|
688
|
+
|
|
689
|
+
### Don'ts
|
|
690
|
+
|
|
691
|
+
- Don't use `styles` prop directly on components
|
|
692
|
+
- Don't use raw CSS values when tokens exist
|
|
693
|
+
- Don't use CSS property names when Tasty alternatives exist — see [recommended props](styles.md#recommended-props)
|
|
694
|
+
- Don't change `styles` prop at runtime (use modifiers or tokens instead)
|
|
695
|
+
- Don't use `style` prop for custom styling (only for third-party library integration)
|