@cube-dev/ui-kit 0.120.1 → 0.121.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 +20 -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.d.ts +1 -0
- package/dist/components/actions/Button/Button.js +34 -14
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +47 -0
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +105 -0
- package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -0
- package/dist/components/actions/ButtonSplit/context.d.ts +18 -0
- package/dist/components/actions/ButtonSplit/context.js +12 -0
- package/dist/components/actions/ButtonSplit/context.js.map +1 -0
- package/dist/components/actions/ButtonSplit/index.d.ts +3 -0
- 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.d.ts +2 -2
- 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.d.ts +8 -3
- package/dist/components/actions/index.js +10 -5
- package/dist/components/actions/index.js.map +1 -1
- package/dist/components/actions/use-action.d.ts +1 -0
- package/dist/components/actions/use-action.js +21 -18
- package/dist/components/actions/use-action.js.map +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 +2 -1
- package/dist/components/content/Badge/Badge.js.map +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 +5 -2
- package/dist/components/content/Disclosure/Disclosure.js.map +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 +3 -2
- package/dist/components/content/ItemBadge/ItemBadge.js.map +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 +2 -1
- package/dist/components/content/Tag/Tag.js.map +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 +2 -2
- 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 +2 -2
- package/dist/components/fields/RadioGroup/Radio.js +3 -1
- 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 +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 +2 -1
- package/dist/components/navigation/Tabs/TabPicker.js.map +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 +3 -1
- package/dist/components/navigation/Tabs/styled.js.map +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +2 -2
- package/dist/components/navigation/Tabs/types.js +1 -1
- 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 +2 -2
- 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 +6 -6
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/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 +6 -4
- package/dist/index.js +7 -5
- package/dist/index.js.map +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 +643 -0
- package/package.json +5 -9
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
Configure the Tasty style system before your app renders using the `configure()` function. Configuration must be done **before any styles are generated** (before first render).
|
|
4
|
+
|
|
5
|
+
```jsx
|
|
6
|
+
import { configure } from '@tenphi/tasty';
|
|
7
|
+
|
|
8
|
+
configure({
|
|
9
|
+
// CSP nonce for style elements
|
|
10
|
+
nonce: 'abc123',
|
|
11
|
+
|
|
12
|
+
// Global state aliases
|
|
13
|
+
states: {
|
|
14
|
+
'@mobile': '@media(w < 768px)',
|
|
15
|
+
'@tablet': '@media(768px <= w < 1024px)',
|
|
16
|
+
'@dark': '@root(theme=dark)',
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
// Parser configuration
|
|
20
|
+
parserCacheSize: 2000, // LRU cache size (default: 1000)
|
|
21
|
+
|
|
22
|
+
// Custom units (merged with built-in units)
|
|
23
|
+
units: {
|
|
24
|
+
vh: 'vh',
|
|
25
|
+
vw: 'vw',
|
|
26
|
+
custom: (n) => `${n * 10}px`, // Function-based unit
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
// Custom functions for the parser
|
|
30
|
+
funcs: {
|
|
31
|
+
double: (groups) => {
|
|
32
|
+
const value = parseFloat(groups[0]?.output || '0');
|
|
33
|
+
return `${value * 2}px`;
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Options
|
|
42
|
+
|
|
43
|
+
| Option | Type | Default | Description |
|
|
44
|
+
|--------|------|---------|-------------|
|
|
45
|
+
| `nonce` | `string` | - | CSP nonce for style elements |
|
|
46
|
+
| `states` | `Record<string, string>` | - | Global state aliases for advanced state mapping |
|
|
47
|
+
| `parserCacheSize` | `number` | `1000` | Parser LRU cache size |
|
|
48
|
+
| `units` | `Record<string, string \| Function>` | Built-in | Custom units (merged with built-in). See [built-in units](usage.md#built-in-units) |
|
|
49
|
+
| `funcs` | `Record<string, Function>` | - | Custom parser functions (merged with existing) |
|
|
50
|
+
| `handlers` | `Record<string, StyleHandlerDefinition>` | Built-in | Custom style handlers (replace built-in) |
|
|
51
|
+
| `tokens` | `Record<string, string \| number>` | - | Predefined tokens replaced during parsing |
|
|
52
|
+
| `keyframes` | `Record<string, KeyframesSteps>` | - | Global keyframes for animations |
|
|
53
|
+
| `properties` | `Record<string, PropertyDefinition>` | - | Global CSS @property definitions |
|
|
54
|
+
| `autoPropertyTypes` | `boolean` | `true` | Auto-infer and register `@property` types from values |
|
|
55
|
+
| `recipes` | `Record<string, RecipeStyles>` | - | Predefined style recipes (named style bundles) |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Predefined Tokens
|
|
60
|
+
|
|
61
|
+
Define reusable tokens that are replaced during style parsing. Unlike component-level `tokens` prop (which renders as inline CSS custom properties), predefined tokens are baked into the generated CSS.
|
|
62
|
+
|
|
63
|
+
Use `$name` for custom property tokens and `#name` for color tokens:
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
configure({
|
|
67
|
+
tokens: {
|
|
68
|
+
$spacing: '2x',
|
|
69
|
+
'$card-padding': '4x',
|
|
70
|
+
'$button-height': '40px',
|
|
71
|
+
'#accent': '#purple',
|
|
72
|
+
'#surface': '#white',
|
|
73
|
+
'#surface-hover': '#gray.05',
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Once defined, tokens can be used in any component's styles — see [Using Predefined Tokens](usage.md#predefined-tokens) in the usage guide.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Recipes
|
|
83
|
+
|
|
84
|
+
Recipes are predefined, named style bundles. Define them globally via `configure()`:
|
|
85
|
+
|
|
86
|
+
```jsx
|
|
87
|
+
configure({
|
|
88
|
+
recipes: {
|
|
89
|
+
card: {
|
|
90
|
+
padding: '4x',
|
|
91
|
+
fill: '#surface',
|
|
92
|
+
radius: '1r',
|
|
93
|
+
border: true,
|
|
94
|
+
},
|
|
95
|
+
elevated: {
|
|
96
|
+
shadow: '2x 2x 4x #shadow',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Recipe values are flat tasty styles (no sub-element keys). They may contain base styles, tokens, local states, `@keyframes`, and `@properties`. Recipes cannot reference other recipes.
|
|
103
|
+
|
|
104
|
+
For how to apply, compose, and override recipes in components, see [Using Recipes](usage.md#recipes) in the usage guide.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Auto Property Types
|
|
109
|
+
|
|
110
|
+
CSS cannot transition or animate custom properties unless their type is declared via [`@property`](https://developer.mozilla.org/en-US/docs/Web/CSS/@property). Tasty handles this automatically — when a custom property is assigned a concrete value (e.g. `'$scale': 1`, `'$gap': '10px'`, `'#accent': 'purple'`), the type is inferred and a `@property` rule is registered.
|
|
111
|
+
|
|
112
|
+
This works across all declaration contexts: component styles, `@keyframes`, global config, and the zero-runtime Babel plugin. It also resolves `var()` chains — if `$a` references `var(--b)`, the type propagates once `--b` is resolved.
|
|
113
|
+
|
|
114
|
+
Supported types:
|
|
115
|
+
|
|
116
|
+
| Detection | Inferred syntax |
|
|
117
|
+
|-----------|-----------------|
|
|
118
|
+
| `1`, `0.5`, `-3` (bare numbers) | `<number>` |
|
|
119
|
+
| `10px`, `2rem`, `100vw` (length units) | `<length>` |
|
|
120
|
+
| `50%` | `<percentage>` |
|
|
121
|
+
| `45deg`, `0.5turn` (angle units) | `<angle>` |
|
|
122
|
+
| `300ms`, `1s` (time units) | `<time>` |
|
|
123
|
+
| `#name` tokens (by naming convention) | `<color>` |
|
|
124
|
+
|
|
125
|
+
Auto-inferred properties use `inherits: true` (the CSS default). Use explicit `@properties` when you need different settings:
|
|
126
|
+
|
|
127
|
+
```jsx
|
|
128
|
+
// In component styles
|
|
129
|
+
styles: {
|
|
130
|
+
'@properties': {
|
|
131
|
+
'$scale': { syntax: '<number>', inherits: false, initialValue: 1 },
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Or globally
|
|
136
|
+
configure({
|
|
137
|
+
properties: {
|
|
138
|
+
'$scale': { syntax: '<number>', inherits: false, initialValue: 1 },
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To disable auto-inference entirely (only explicit `@properties` will be used):
|
|
144
|
+
|
|
145
|
+
```jsx
|
|
146
|
+
configure({ autoPropertyTypes: false });
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Custom Style Handlers
|
|
152
|
+
|
|
153
|
+
Override or extend the built-in style property handlers. A handler definition can take three forms:
|
|
154
|
+
|
|
155
|
+
| Form | Syntax | Description |
|
|
156
|
+
|------|--------|-------------|
|
|
157
|
+
| Function only | `handler` | Triggered by its key name; receives only that property |
|
|
158
|
+
| Single dep | `['styleName', handler]` | Triggered by the specified style property |
|
|
159
|
+
| Multi dep | `[['dep1', 'dep2', ...], handler]` | Triggered by any of the listed properties; receives all of them |
|
|
160
|
+
|
|
161
|
+
The multi-dep form is useful when output depends on several style properties together (e.g., `gap` needs to know `display` and `flow` to decide the CSS strategy).
|
|
162
|
+
|
|
163
|
+
```jsx
|
|
164
|
+
import { configure, styleHandlers } from '@tenphi/tasty';
|
|
165
|
+
|
|
166
|
+
configure({
|
|
167
|
+
handlers: {
|
|
168
|
+
// Function only — overrides built-in fill handler
|
|
169
|
+
fill: ({ fill }) => {
|
|
170
|
+
if (fill?.startsWith('gradient:')) {
|
|
171
|
+
return { background: fill.slice(9) };
|
|
172
|
+
}
|
|
173
|
+
return styleHandlers.fill({ fill });
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
// Function only — new single-prop handler
|
|
177
|
+
elevation: ({ elevation }) => {
|
|
178
|
+
const level = parseInt(elevation) || 1;
|
|
179
|
+
return {
|
|
180
|
+
'box-shadow': `0 ${level * 2}px ${level * 4}px rgba(0,0,0,0.1)`,
|
|
181
|
+
'z-index': String(level * 100),
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
// Multi dep — handler reads multiple style properties
|
|
186
|
+
gap: [['display', 'flow', 'gap'], ({ display, flow, gap }) => {
|
|
187
|
+
if (!gap) return;
|
|
188
|
+
const isGrid = display?.includes('grid');
|
|
189
|
+
return { gap: isGrid ? gap : `/* custom logic for ${flow} */` };
|
|
190
|
+
}],
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Extending Style Types (TypeScript)
|
|
198
|
+
|
|
199
|
+
Use module augmentation to extend the `StylesInterface`:
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
// tasty.d.ts
|
|
203
|
+
declare module '@tenphi/tasty' {
|
|
204
|
+
interface StylesInterface {
|
|
205
|
+
elevation?: string;
|
|
206
|
+
gradient?: string;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
See [Usage Guide](usage.md) for component creation, state mappings, sub-elements, variants, and hooks.
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
# Tasty Debug Utilities
|
|
2
|
+
|
|
3
|
+
Runtime CSS inspection and diagnostics for the Tasty styling system. Inspect injected styles, measure cache performance, analyze style chunks, and troubleshoot CSS issues — all from the browser console.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`tastyDebug` is a diagnostic object that exposes every aspect of Tasty's runtime CSS state. It is designed for development use: inspecting which CSS is active, what's cached, how chunks are distributed, and whether cleanup is working as expected.
|
|
10
|
+
|
|
11
|
+
In development mode (`isDevEnv()` returns `true`), `tastyDebug` is automatically installed on `window.tastyDebug`. In production, you can install it manually when needed.
|
|
12
|
+
|
|
13
|
+
> **Note:** This is a development/debugging tool. It does not affect style generation or application behavior.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
// Auto-installed in dev mode. Otherwise:
|
|
21
|
+
import { tastyDebug } from '@tenphi/tasty';
|
|
22
|
+
tastyDebug.install();
|
|
23
|
+
|
|
24
|
+
// Print a quick-start guide
|
|
25
|
+
tastyDebug.help();
|
|
26
|
+
|
|
27
|
+
// Get a comprehensive overview logged to the console
|
|
28
|
+
tastyDebug.summary({ log: true });
|
|
29
|
+
|
|
30
|
+
// See all active CSS (for components currently in the DOM)
|
|
31
|
+
tastyDebug.log('active');
|
|
32
|
+
|
|
33
|
+
// Inspect a specific element
|
|
34
|
+
tastyDebug.inspect('.my-button');
|
|
35
|
+
|
|
36
|
+
// Check cache hit rates
|
|
37
|
+
tastyDebug.metrics();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Core Types
|
|
43
|
+
|
|
44
|
+
### `CSSTarget`
|
|
45
|
+
|
|
46
|
+
The `target` parameter accepted by `css()`, `log()`, and related methods:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
type CSSTarget =
|
|
50
|
+
| 'all' // All tasty CSS (component + global + raw)
|
|
51
|
+
| 'global' // Only global CSS (from injectGlobal)
|
|
52
|
+
| 'active' // CSS for classes currently present in the DOM
|
|
53
|
+
| 'unused' // CSS with refCount = 0 (cached but not actively used)
|
|
54
|
+
| 'page' // ALL CSS on the page, including non-tasty stylesheets
|
|
55
|
+
| string // A tasty class ('t123') or a CSS selector ('.my-class')
|
|
56
|
+
| string[] // Array of tasty classes (['t0', 't5', 't12'])
|
|
57
|
+
| Element; // A DOM element
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### `CssOptions`
|
|
61
|
+
|
|
62
|
+
Common options for CSS retrieval methods:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
interface CssOptions {
|
|
66
|
+
root?: Document | ShadowRoot; // Target root (default: document)
|
|
67
|
+
prettify?: boolean; // Format CSS output (default: true)
|
|
68
|
+
log?: boolean; // Auto-log to console (default: false)
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## API Reference
|
|
75
|
+
|
|
76
|
+
### `css(target, opts?): string`
|
|
77
|
+
|
|
78
|
+
Retrieves CSS text for a given target. This is the primary method for extracting CSS from the runtime.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
// All tasty CSS
|
|
82
|
+
tastyDebug.css('all');
|
|
83
|
+
|
|
84
|
+
// Only CSS for classes currently in the DOM
|
|
85
|
+
tastyDebug.css('active');
|
|
86
|
+
|
|
87
|
+
// CSS for unused classes (refCount = 0, still in cache)
|
|
88
|
+
tastyDebug.css('unused');
|
|
89
|
+
|
|
90
|
+
// Only global CSS (injected via injectGlobal)
|
|
91
|
+
tastyDebug.css('global');
|
|
92
|
+
|
|
93
|
+
// ALL CSS on the page (including non-tasty stylesheets)
|
|
94
|
+
tastyDebug.css('page');
|
|
95
|
+
|
|
96
|
+
// CSS for a specific tasty class
|
|
97
|
+
tastyDebug.css('t42');
|
|
98
|
+
|
|
99
|
+
// CSS for multiple tasty classes
|
|
100
|
+
tastyDebug.css(['t0', 't5', 't12']);
|
|
101
|
+
|
|
102
|
+
// CSS affecting a DOM element (by selector)
|
|
103
|
+
tastyDebug.css('.my-button');
|
|
104
|
+
|
|
105
|
+
// CSS affecting a DOM element (by reference)
|
|
106
|
+
const el = document.querySelector('.my-button');
|
|
107
|
+
tastyDebug.css(el);
|
|
108
|
+
|
|
109
|
+
// With options
|
|
110
|
+
tastyDebug.css('active', { prettify: false, log: true });
|
|
111
|
+
|
|
112
|
+
// Shadow DOM
|
|
113
|
+
const shadowRoot = host.shadowRoot;
|
|
114
|
+
tastyDebug.css('all', { root: shadowRoot });
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### `inspect(target, opts?): InspectResult`
|
|
120
|
+
|
|
121
|
+
Inspects a DOM element and returns detailed information about its tasty styles, including chunk assignments.
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
interface InspectResult {
|
|
125
|
+
element?: Element | null;
|
|
126
|
+
classes: string[]; // Tasty classes found on the element (e.g., ['t0', 't5'])
|
|
127
|
+
chunks: ChunkInfo[]; // Chunk assignment per class
|
|
128
|
+
css: string; // Prettified CSS affecting the element
|
|
129
|
+
size: number; // CSS size in characters
|
|
130
|
+
rules: number; // Number of CSS rule blocks
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface ChunkInfo {
|
|
134
|
+
className: string; // e.g., 't0'
|
|
135
|
+
chunkName: string | null; // e.g., 'appearance', 'font', 'dimension'
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
// By CSS selector
|
|
141
|
+
const result = tastyDebug.inspect('.my-card');
|
|
142
|
+
console.log(result.classes); // ['t3', 't7', 't12']
|
|
143
|
+
console.log(result.chunks); // [{className: 't3', chunkName: 'appearance'}, ...]
|
|
144
|
+
console.log(result.rules); // 5
|
|
145
|
+
console.log(result.css); // prettified CSS
|
|
146
|
+
|
|
147
|
+
// By element reference
|
|
148
|
+
const el = document.querySelector('[data-element="Title"]');
|
|
149
|
+
tastyDebug.inspect(el);
|
|
150
|
+
|
|
151
|
+
// Shadow DOM
|
|
152
|
+
tastyDebug.inspect('.shadow-component', { root: shadowRoot });
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### `cache(opts?): CacheStatus`
|
|
158
|
+
|
|
159
|
+
Returns the current state of the style cache: which classes are active, which are unused, and performance metrics.
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
interface CacheStatus {
|
|
163
|
+
classes: {
|
|
164
|
+
active: string[]; // Classes with refCount > 0 and present in DOM
|
|
165
|
+
unused: string[]; // Classes with refCount = 0 but still in cache
|
|
166
|
+
all: string[]; // Union of active and unused
|
|
167
|
+
};
|
|
168
|
+
metrics: CacheMetrics | null;
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
const status = tastyDebug.cache();
|
|
174
|
+
|
|
175
|
+
console.log(status.classes.active.length); // 42
|
|
176
|
+
console.log(status.classes.unused.length); // 8
|
|
177
|
+
console.log(status.metrics?.hits); // 156
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### `cleanup(opts?): void`
|
|
183
|
+
|
|
184
|
+
Forces immediate cleanup of all unused styles (those with `refCount = 0`).
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
tastyDebug.cleanup();
|
|
188
|
+
|
|
189
|
+
// Shadow DOM
|
|
190
|
+
tastyDebug.cleanup({ root: shadowRoot });
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
### `metrics(opts?): CacheMetrics | null`
|
|
196
|
+
|
|
197
|
+
Returns performance metrics for the style cache. Only available when `devMode` is enabled.
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
interface CacheMetrics {
|
|
201
|
+
hits: number; // Successful cache hits
|
|
202
|
+
misses: number; // New styles injected (cache misses)
|
|
203
|
+
bulkCleanups: number; // Number of bulk cleanup operations
|
|
204
|
+
totalInsertions: number; // Lifetime style insertions
|
|
205
|
+
totalUnused: number; // Total styles marked as unused
|
|
206
|
+
stylesCleanedUp: number; // Total styles removed by cleanup
|
|
207
|
+
startTime: number; // Metrics collection start timestamp
|
|
208
|
+
unusedHits?: number; // Reactivations of cached unused styles
|
|
209
|
+
cleanupHistory: {
|
|
210
|
+
timestamp: number;
|
|
211
|
+
classesDeleted: number;
|
|
212
|
+
cssSize: number;
|
|
213
|
+
rulesDeleted: number;
|
|
214
|
+
}[];
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
const m = tastyDebug.metrics();
|
|
220
|
+
|
|
221
|
+
if (m) {
|
|
222
|
+
const hitRate = ((m.hits + (m.unusedHits || 0)) / (m.hits + m.misses)) * 100;
|
|
223
|
+
console.log(`Cache hit rate: ${hitRate.toFixed(1)}%`);
|
|
224
|
+
console.log(`Total insertions: ${m.totalInsertions}`);
|
|
225
|
+
console.log(`Bulk cleanups: ${m.bulkCleanups}`);
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### `resetMetrics(opts?): void`
|
|
230
|
+
|
|
231
|
+
Resets all performance metrics counters.
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
tastyDebug.resetMetrics();
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### `chunks(opts?): ChunkBreakdown`
|
|
240
|
+
|
|
241
|
+
Returns a breakdown of styles by chunk type. With style chunking enabled, styles are split into logical chunks (appearance, font, dimension, etc.) for better caching and CSS reuse.
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
const breakdown = tastyDebug.chunks();
|
|
245
|
+
|
|
246
|
+
console.log(breakdown.totalChunkTypes); // 6
|
|
247
|
+
console.log(breakdown.totalClasses); // 87
|
|
248
|
+
|
|
249
|
+
for (const [chunkName, data] of Object.entries(breakdown.byChunk)) {
|
|
250
|
+
console.log(`${chunkName}: ${data.classes.length} classes, ${data.cssSize}B`);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Log a formatted breakdown to the console
|
|
254
|
+
tastyDebug.chunks({ log: true });
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Chunk types: `combined` (non-chunked), `appearance`, `font`, `dimension`, `display`, `layout`, `position`, `misc`, `subcomponents`.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
### `getGlobalTypeCSS(type, opts?): { css: string; ruleCount: number; size: number }`
|
|
262
|
+
|
|
263
|
+
Retrieves CSS for a specific global injection type.
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
// CSS injected via injectGlobal()
|
|
267
|
+
const global = tastyDebug.getGlobalTypeCSS('global');
|
|
268
|
+
|
|
269
|
+
// CSS injected via injectRawCSS() / useRawCSS()
|
|
270
|
+
const raw = tastyDebug.getGlobalTypeCSS('raw');
|
|
271
|
+
|
|
272
|
+
// @keyframes CSS
|
|
273
|
+
const keyframes = tastyDebug.getGlobalTypeCSS('keyframes');
|
|
274
|
+
|
|
275
|
+
// @property CSS
|
|
276
|
+
const properties = tastyDebug.getGlobalTypeCSS('property');
|
|
277
|
+
|
|
278
|
+
console.log(`Global: ${global.ruleCount} rules, ${global.size}B`);
|
|
279
|
+
console.log(`Raw: ${raw.ruleCount} rules, ${raw.size}B`);
|
|
280
|
+
console.log(`Keyframes: ${keyframes.ruleCount} rules, ${keyframes.size}B`);
|
|
281
|
+
console.log(`Properties: ${properties.ruleCount} rules, ${properties.size}B`);
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### `defs(opts?): Definitions`
|
|
287
|
+
|
|
288
|
+
Returns all defined `@property` and `@keyframes` entries.
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
interface Definitions {
|
|
292
|
+
properties: string[]; // Defined via @property (e.g., ['--primary-color', '--gap'])
|
|
293
|
+
keyframes: { name: string; refCount: number }[];
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
```typescript
|
|
298
|
+
const defs = tastyDebug.defs();
|
|
299
|
+
|
|
300
|
+
console.log('Properties:', defs.properties);
|
|
301
|
+
// ['--primary-color', '--surface-color', ...]
|
|
302
|
+
|
|
303
|
+
console.log('Keyframes:', defs.keyframes);
|
|
304
|
+
// [{ name: 'fadeIn', refCount: 2 }, { name: 'pulse', refCount: 1 }]
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
### `summary(opts?): Summary`
|
|
310
|
+
|
|
311
|
+
One-shot comprehensive overview of the entire Tasty CSS state. Returns detailed statistics and optionally logs a formatted report.
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
interface SummaryOptions {
|
|
315
|
+
root?: Document | ShadowRoot;
|
|
316
|
+
log?: boolean;
|
|
317
|
+
includePageCSS?:
|
|
318
|
+
| false // Do not include page-level CSS stats (default)
|
|
319
|
+
| true // Include sizes/counts only
|
|
320
|
+
| 'all'; // Include stats and return full page CSS string
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
The returned `Summary` object contains:
|
|
325
|
+
|
|
326
|
+
- **Classes**: `activeClasses`, `unusedClasses`, `totalStyledClasses`
|
|
327
|
+
- **CSS sizes**: `activeCSSSize`, `unusedCSSSize`, `globalCSSSize`, `rawCSSSize`, `keyframesCSSSize`, `propertyCSSSize`, `totalCSSSize`
|
|
328
|
+
- **CSS payloads**: `activeCSS`, `unusedCSS`, `globalCSS`, `rawCSS`, `keyframesCSS`, `propertyCSS`, `allCSS`
|
|
329
|
+
- **Rule counts**: `globalRuleCount`, `rawRuleCount`, `keyframesRuleCount`, `propertyRuleCount`
|
|
330
|
+
- **Page CSS** (when `includePageCSS` is set): `page.cssSize`, `page.ruleCount`, `page.stylesheetCount`, `page.skippedStylesheets`
|
|
331
|
+
- **Metrics & definitions**: `metrics`, `definedProperties`, `definedKeyframes`, `propertyCount`, `keyframeCount`
|
|
332
|
+
- **Cleanup summary**: `cleanupSummary.totalCleanups`, `cleanupSummary.totalClassesDeleted`, `cleanupSummary.lastCleanup`, etc.
|
|
333
|
+
- **Chunk breakdown**: `chunkBreakdown.byChunk`, `chunkBreakdown.totalChunkTypes`
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
// Log a formatted report
|
|
337
|
+
tastyDebug.summary({ log: true });
|
|
338
|
+
|
|
339
|
+
// Get the data programmatically
|
|
340
|
+
const s = tastyDebug.summary();
|
|
341
|
+
console.log(`Active: ${s.activeClasses.length} classes, ${s.activeCSSSize}B`);
|
|
342
|
+
console.log(`Unused: ${s.unusedClasses.length} classes, ${s.unusedCSSSize}B`);
|
|
343
|
+
console.log(`Total CSS: ${s.totalCSSSize}B`);
|
|
344
|
+
|
|
345
|
+
// Include page-level CSS stats
|
|
346
|
+
const withPage = tastyDebug.summary({ includePageCSS: true });
|
|
347
|
+
console.log(`Page CSS: ${withPage.page?.cssSize}B across ${withPage.page?.stylesheetCount} stylesheets`);
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
### `pageCSS(opts?): string`
|
|
353
|
+
|
|
354
|
+
Returns all CSS on the page across all stylesheets (not only tasty-generated CSS).
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
// Get all page CSS
|
|
358
|
+
const css = tastyDebug.pageCSS();
|
|
359
|
+
|
|
360
|
+
// Log it
|
|
361
|
+
tastyDebug.pageCSS({ log: true });
|
|
362
|
+
|
|
363
|
+
// Raw (unformatted)
|
|
364
|
+
tastyDebug.pageCSS({ prettify: false });
|
|
365
|
+
|
|
366
|
+
// Exclude cross-origin stylesheet placeholders
|
|
367
|
+
tastyDebug.pageCSS({ includeCrossOrigin: false });
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### `pageStats(opts?): PageStats`
|
|
371
|
+
|
|
372
|
+
Returns size and rule count statistics for all page CSS without extracting the full text.
|
|
373
|
+
|
|
374
|
+
```typescript
|
|
375
|
+
const stats = tastyDebug.pageStats();
|
|
376
|
+
console.log(`${stats.cssSize}B across ${stats.stylesheetCount} stylesheets`);
|
|
377
|
+
console.log(`${stats.ruleCount} rules, ${stats.skippedStylesheets} skipped (CORS)`);
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
### `log(target, opts?): void`
|
|
383
|
+
|
|
384
|
+
Logs CSS for a target to the console with formatted output, collapsible groups, and sub-element detection.
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
// Log active CSS with stats header
|
|
388
|
+
tastyDebug.log('active');
|
|
389
|
+
|
|
390
|
+
// Log CSS for a specific class
|
|
391
|
+
tastyDebug.log('t42');
|
|
392
|
+
|
|
393
|
+
// Log with custom title
|
|
394
|
+
tastyDebug.log('active', { title: 'Button styles' });
|
|
395
|
+
|
|
396
|
+
// Log CSS for an element
|
|
397
|
+
tastyDebug.log('.my-card');
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
The output includes:
|
|
401
|
+
- Rule count, line count, and byte size
|
|
402
|
+
- Sub-element breakdown (detects `[data-element="..."]` selectors)
|
|
403
|
+
- Full CSS in a collapsible group
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
### `help(): void`
|
|
408
|
+
|
|
409
|
+
Prints a quick-start guide to the console with available commands and common targets.
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
tastyDebug.help();
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
### `install(): void`
|
|
418
|
+
|
|
419
|
+
Attaches `tastyDebug` to `window.tastyDebug` for console access. Called automatically in development mode.
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
import { tastyDebug } from '@tenphi/tasty';
|
|
423
|
+
|
|
424
|
+
// Manual install (e.g., in staging/production for debugging)
|
|
425
|
+
tastyDebug.install();
|
|
426
|
+
|
|
427
|
+
// Then use from the browser console:
|
|
428
|
+
// > tastyDebug.summary({ log: true })
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Common Workflows
|
|
434
|
+
|
|
435
|
+
### Debugging a component's styles
|
|
436
|
+
|
|
437
|
+
```typescript
|
|
438
|
+
// 1. Find the element
|
|
439
|
+
tastyDebug.inspect('.my-button');
|
|
440
|
+
// → { classes: ['t3', 't7'], chunks: [...], css: '...', rules: 4 }
|
|
441
|
+
|
|
442
|
+
// 2. See CSS for a specific class
|
|
443
|
+
tastyDebug.log('t3');
|
|
444
|
+
|
|
445
|
+
// 3. Check which chunk it belongs to
|
|
446
|
+
tastyDebug.inspect('.my-button').chunks;
|
|
447
|
+
// → [{ className: 't3', chunkName: 'appearance' }, { className: 't7', chunkName: 'font' }]
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
### Checking cache efficiency
|
|
451
|
+
|
|
452
|
+
```typescript
|
|
453
|
+
const m = tastyDebug.metrics();
|
|
454
|
+
const hitRate = m ? ((m.hits + (m.unusedHits || 0)) / (m.hits + m.misses)) * 100 : 0;
|
|
455
|
+
console.log(`Hit rate: ${hitRate.toFixed(1)}%`);
|
|
456
|
+
console.log(`Unused style reactivations: ${m?.unusedHits}`);
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### Monitoring CSS growth
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
const s = tastyDebug.summary();
|
|
463
|
+
console.log(`Total tasty CSS: ${(s.totalCSSSize / 1024).toFixed(1)}KB`);
|
|
464
|
+
console.log(`Active: ${(s.activeCSSSize / 1024).toFixed(1)}KB`);
|
|
465
|
+
console.log(`Unused (pending cleanup): ${(s.unusedCSSSize / 1024).toFixed(1)}KB`);
|
|
466
|
+
|
|
467
|
+
// Compare with total page CSS
|
|
468
|
+
const page = tastyDebug.pageStats();
|
|
469
|
+
const ratio = ((s.totalCSSSize / page.cssSize) * 100).toFixed(1);
|
|
470
|
+
console.log(`Tasty is ${ratio}% of total page CSS`);
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Analyzing chunk distribution
|
|
474
|
+
|
|
475
|
+
```typescript
|
|
476
|
+
tastyDebug.chunks({ log: true });
|
|
477
|
+
// → Formatted breakdown:
|
|
478
|
+
// • appearance: 24 classes, 3.2KB, 48 rules
|
|
479
|
+
// • font: 18 classes, 1.1KB, 18 rules
|
|
480
|
+
// • dimension: 31 classes, 2.4KB, 45 rules
|
|
481
|
+
// • ...
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
---
|
|
485
|
+
|
|
486
|
+
## Shadow DOM Support
|
|
487
|
+
|
|
488
|
+
All methods accept a `root` option to target a Shadow DOM instead of the main document:
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
const shadowRoot = host.shadowRoot;
|
|
492
|
+
|
|
493
|
+
tastyDebug.css('all', { root: shadowRoot });
|
|
494
|
+
tastyDebug.inspect('.shadow-component', { root: shadowRoot });
|
|
495
|
+
tastyDebug.summary({ root: shadowRoot, log: true });
|
|
496
|
+
tastyDebug.chunks({ root: shadowRoot, log: true });
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Integration with Tasty
|
|
502
|
+
|
|
503
|
+
`tastyDebug` reads directly from the [Style Injector](./injector.md)'s internal registries. It does not inject, modify, or intercept any styles. The `cleanup()` method is the only method with side effects — it triggers the injector's garbage collection for unused styles.
|
|
504
|
+
|
|
505
|
+
For most development, you'll use the [Tasty style system](./usage.md) to create components and the debug utilities to inspect the resulting CSS at runtime.
|