@cube-dev/ui-kit 0.118.0 → 0.119.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 +24 -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.d.ts +1 -2
- package/dist/components/Block.js +2 -5
- package/dist/components/Block.js.map +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +2 -3
- package/dist/components/GlobalStyles.js.map +1 -1
- package/dist/components/GridProvider.d.ts +1 -2
- package/dist/components/GridProvider.js +2 -3
- package/dist/components/GridProvider.js.map +1 -1
- package/dist/components/HiddenInput.js +2 -2
- package/dist/components/HiddenInput.js.map +1 -1
- package/dist/components/Root.d.ts +1 -2
- package/dist/components/Root.js +2 -6
- package/dist/components/Root.js.map +1 -1
- package/dist/components/actions/Action/Action.d.ts +1 -2
- package/dist/components/actions/Action/Action.js +2 -4
- package/dist/components/actions/Action/Action.js.map +1 -1
- package/dist/components/actions/Banner/Banner.js +2 -2
- package/dist/components/actions/Banner/Banner.js.map +1 -1
- package/dist/components/actions/Button/Button.d.ts +3 -1769
- package/dist/components/actions/Button/Button.js +2 -4
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/components/actions/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.d.ts +1 -3
- package/dist/components/actions/CommandMenu/CommandMenu.js +2 -4
- package/dist/components/actions/CommandMenu/CommandMenu.js.map +1 -1
- package/dist/components/actions/CommandMenu/styled.js +3 -3
- package/dist/components/actions/CommandMenu/styled.js.map +1 -1
- package/dist/components/actions/ItemAction/ItemAction.d.ts +1 -3
- package/dist/components/actions/ItemAction/ItemAction.js +2 -2
- package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.d.ts +1 -2
- package/dist/components/actions/ItemButton/ItemButton.js +2 -2
- package/dist/components/actions/ItemButton/ItemButton.js.map +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.d.ts +1 -3
- package/dist/components/actions/Menu/Menu.js +2 -4
- package/dist/components/actions/Menu/Menu.js.map +1 -1
- package/dist/components/actions/Menu/MenuItem.d.ts +1 -2
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js.map +1 -1
- package/dist/components/actions/Menu/MenuSection.d.ts +1 -2
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js.map +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 +2 -2
- package/dist/components/actions/Menu/styled.js.map +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.d.ts +1 -2
- package/dist/components/actions/use-action.js +2 -2
- 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.d.ts +1 -2
- package/dist/components/content/ActiveZone/ActiveZone.js +2 -5
- package/dist/components/content/ActiveZone/ActiveZone.js.map +1 -1
- package/dist/components/content/Alert/Alert.js +2 -2
- package/dist/components/content/Alert/Alert.js.map +1 -1
- package/dist/components/content/Alert/types.d.ts +1 -2
- package/dist/components/content/Alert/use-alert.js +2 -4
- package/dist/components/content/Alert/use-alert.js.map +1 -1
- package/dist/components/content/Avatar/Avatar.d.ts +1 -3
- package/dist/components/content/Avatar/Avatar.js +2 -5
- package/dist/components/content/Avatar/Avatar.js.map +1 -1
- package/dist/components/content/Badge/Badge.js +2 -2
- package/dist/components/content/Badge/Badge.js.map +1 -1
- package/dist/components/content/Card/Card.d.ts +1 -2
- package/dist/components/content/Card/Card.js +2 -5
- package/dist/components/content/Card/Card.js.map +1 -1
- package/dist/components/content/Content.d.ts +1 -2
- package/dist/components/content/Content.js +2 -5
- package/dist/components/content/Content.js.map +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.d.ts +1 -3
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +2 -4
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js.map +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +2 -2
- package/dist/components/content/CopySnippet/CopySnippet.js.map +1 -1
- package/dist/components/content/Disclosure/Disclosure.d.ts +1 -3
- package/dist/components/content/Disclosure/Disclosure.js +3 -4
- package/dist/components/content/Disclosure/Disclosure.js.map +1 -1
- package/dist/components/content/Divider.d.ts +1 -2
- package/dist/components/content/Divider.js +2 -4
- package/dist/components/content/Divider.js.map +1 -1
- package/dist/components/content/Footer.d.ts +1 -2
- package/dist/components/content/Footer.js +2 -5
- package/dist/components/content/Footer.js.map +1 -1
- package/dist/components/content/Header.d.ts +1 -2
- package/dist/components/content/Header.js +2 -5
- package/dist/components/content/Header.js.map +1 -1
- package/dist/components/content/HotKeys/HotKeys.d.ts +1 -2
- package/dist/components/content/HotKeys/HotKeys.js +2 -5
- package/dist/components/content/HotKeys/HotKeys.js.map +1 -1
- package/dist/components/content/Item/Item.d.ts +1 -3
- package/dist/components/content/Item/Item.js +2 -3
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.d.ts +1 -2
- package/dist/components/content/ItemBadge/ItemBadge.js +2 -2
- package/dist/components/content/ItemBadge/ItemBadge.js.map +1 -1
- package/dist/components/content/Layout/GridLayout.d.ts +1 -2
- package/dist/components/content/Layout/GridLayout.js +2 -2
- package/dist/components/content/Layout/GridLayout.js.map +1 -1
- package/dist/components/content/Layout/Layout.d.ts +1 -3
- package/dist/components/content/Layout/Layout.js +3 -7
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +2 -2
- package/dist/components/content/Layout/LayoutBlock.js.map +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +2 -2
- package/dist/components/content/Layout/LayoutCenter.js.map +1 -1
- package/dist/components/content/Layout/LayoutContainer.d.ts +1 -3
- package/dist/components/content/Layout/LayoutContainer.js +2 -6
- package/dist/components/content/Layout/LayoutContainer.js.map +1 -1
- package/dist/components/content/Layout/LayoutContent.d.ts +1 -2
- package/dist/components/content/Layout/LayoutContent.js +2 -6
- package/dist/components/content/Layout/LayoutContent.js.map +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +2 -2
- package/dist/components/content/Layout/LayoutFlex.js.map +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +2 -2
- package/dist/components/content/Layout/LayoutFooter.js.map +1 -1
- package/dist/components/content/Layout/LayoutGrid.d.ts +1 -2
- package/dist/components/content/Layout/LayoutGrid.js +2 -2
- package/dist/components/content/Layout/LayoutGrid.js.map +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +2 -2
- package/dist/components/content/Layout/LayoutHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutPane.d.ts +1 -3
- package/dist/components/content/Layout/LayoutPane.js +2 -6
- package/dist/components/content/Layout/LayoutPane.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanel.d.ts +1 -3
- package/dist/components/content/Layout/LayoutPanel.js +2 -6
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.d.ts +1 -2
- package/dist/components/content/Layout/LayoutPanelHeader.js +2 -4
- package/dist/components/content/Layout/LayoutPanelHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +2 -2
- package/dist/components/content/Layout/LayoutToolbar.js.map +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.d.ts +1 -2
- package/dist/components/content/Paragraph.js +2 -3
- package/dist/components/content/Paragraph.js.map +1 -1
- package/dist/components/content/Placeholder/Placeholder.d.ts +1 -3
- package/dist/components/content/Placeholder/Placeholder.js +2 -6
- package/dist/components/content/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/content/PrismCode/PrismCode.d.ts +1 -3
- package/dist/components/content/PrismCode/PrismCode.js +2 -3
- package/dist/components/content/PrismCode/PrismCode.js.map +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.d.ts +1 -3
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js.map +1 -1
- package/dist/components/content/Result/Result.d.ts +1 -2
- package/dist/components/content/Result/Result.js +2 -5
- package/dist/components/content/Result/Result.js.map +1 -1
- package/dist/components/content/Skeleton/Skeleton.d.ts +1 -2
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/content/Tag/Tag.d.ts +1 -2
- package/dist/components/content/Tag/Tag.js +2 -2
- package/dist/components/content/Tag/Tag.js.map +1 -1
- package/dist/components/content/Text.d.ts +128 -159
- package/dist/components/content/Text.js +2 -5
- package/dist/components/content/Text.js.map +1 -1
- package/dist/components/content/TextItem/TextItem.d.ts +1 -2
- package/dist/components/content/TextItem/TextItem.js +2 -5
- package/dist/components/content/TextItem/TextItem.js.map +1 -1
- package/dist/components/content/Title.d.ts +1 -2
- package/dist/components/content/Title.js +2 -5
- package/dist/components/content/Title.js.map +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/highlightText.js.map +1 -1
- package/dist/components/content/use-auto-tooltip.d.ts +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/fields/Checkbox/Checkbox.d.ts +1 -3
- package/dist/components/fields/Checkbox/Checkbox.js +2 -5
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.d.ts +1 -3
- package/dist/components/fields/Checkbox/CheckboxGroup.js +2 -4
- package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +1 -3
- package/dist/components/fields/ComboBox/ComboBox.js +2 -4
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInput.d.ts +1 -3
- package/dist/components/fields/DatePicker/DateInput.js +2 -3
- package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +2 -4
- package/dist/components/fields/DatePicker/DateInputBase.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +1 -3
- package/dist/components/fields/DatePicker/DatePicker.js +2 -3
- package/dist/components/fields/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +2 -2
- package/dist/components/fields/DatePicker/DatePickerButton.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +2 -2
- package/dist/components/fields/DatePicker/DatePickerElement.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +2 -2
- package/dist/components/fields/DatePicker/DatePickerInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +2 -2
- package/dist/components/fields/DatePicker/DatePickerSegment.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.d.ts +1 -3
- package/dist/components/fields/DatePicker/DateRangePicker.js +2 -4
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.d.ts +1 -3
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +2 -4
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/TimeInput.d.ts +1 -3
- package/dist/components/fields/DatePicker/TimeInput.js +2 -3
- package/dist/components/fields/DatePicker/TimeInput.js.map +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.d.ts +1 -3
- package/dist/components/fields/FileInput/FileInput.js +2 -4
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.d.ts +1 -2
- package/dist/components/fields/FilterListBox/FilterListBox.js +5 -7
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +1 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js +2 -5
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +1 -3
- package/dist/components/fields/ListBox/ListBox.js +2 -5
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +2 -2
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +2 -2
- package/dist/components/fields/NumberInput/StepButton.js.map +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +1 -3
- package/dist/components/fields/Picker/Picker.js +2 -5
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +1 -2
- package/dist/components/fields/RadioGroup/Radio.js +2 -5
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/fields/RadioGroup/RadioGroup.js +2 -4
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +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 +834 -836
- package/dist/components/fields/Select/Select.js +2 -4
- 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/HueSlider.js.map +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.d.ts +1 -3
- package/dist/components/fields/Slider/Slider.js +2 -3
- package/dist/components/fields/Slider/Slider.js.map +1 -1
- package/dist/components/fields/Slider/SliderBase.js +2 -4
- package/dist/components/fields/Slider/SliderBase.js.map +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js.map +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js.map +1 -1
- package/dist/components/fields/Slider/elements.js +2 -2
- package/dist/components/fields/Slider/elements.js.map +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Slider/types.d.ts +1 -3
- package/dist/components/fields/Switch/Switch.d.ts +1 -3
- package/dist/components/fields/Switch/Switch.js +2 -4
- package/dist/components/fields/Switch/Switch.js.map +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.d.ts +1 -3
- package/dist/components/fields/TextInput/TextInputBase.js +3 -5
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +2 -2
- package/dist/components/form/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/components/form/FieldWrapper/extract-field-wrapper-props.js +1 -1
- package/dist/components/form/FieldWrapper/types.d.ts +1 -3
- package/dist/components/form/Form/Field.d.ts +1 -2
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Field.js.map +1 -1
- package/dist/components/form/Form/Form.d.ts +1 -3
- package/dist/components/form/Form/Form.js +2 -5
- package/dist/components/form/Form/Form.js.map +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 +2 -2
- package/dist/components/form/Form/use-form.js.map +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.d.ts +1 -3
- package/dist/components/form/Label.js +2 -5
- package/dist/components/form/Label.js.map +1 -1
- package/dist/components/form/wrapper.d.ts +1 -2
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/form/wrapper.js.map +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +2 -2
- package/dist/components/helpers/IconSwitch/IconSwitch.js.map +1 -1
- package/dist/components/layout/Flex.d.ts +1 -2
- package/dist/components/layout/Flex.js +2 -5
- package/dist/components/layout/Flex.js.map +1 -1
- package/dist/components/layout/Flow.d.ts +1 -2
- package/dist/components/layout/Flow.js +2 -5
- package/dist/components/layout/Flow.js.map +1 -1
- package/dist/components/layout/Grid.d.ts +1 -2
- package/dist/components/layout/Grid.js +2 -5
- package/dist/components/layout/Grid.js.map +1 -1
- package/dist/components/layout/Panel.d.ts +1 -3
- package/dist/components/layout/Panel.js +2 -3
- package/dist/components/layout/Panel.js.map +1 -1
- package/dist/components/layout/Prefix.d.ts +1 -2
- package/dist/components/layout/Prefix.js +2 -5
- package/dist/components/layout/Prefix.js.map +1 -1
- package/dist/components/layout/ResizablePanel.d.ts +1 -2
- package/dist/components/layout/ResizablePanel.js +2 -2
- package/dist/components/layout/ResizablePanel.js.map +1 -1
- package/dist/components/layout/Space.d.ts +1 -2
- package/dist/components/layout/Space.js +2 -5
- package/dist/components/layout/Space.js.map +1 -1
- package/dist/components/layout/Suffix.d.ts +1 -2
- package/dist/components/layout/Suffix.js +2 -5
- package/dist/components/layout/Suffix.js.map +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/TabPanel.js.map +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +2 -4
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +2 -2
- package/dist/components/navigation/Tabs/TabsAction.js.map +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +2 -2
- package/dist/components/navigation/Tabs/styled.js.map +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +1 -3
- 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.d.ts +1 -2
- package/dist/components/organisms/FileTabs/FileTabs.js +2 -2
- package/dist/components/organisms/FileTabs/FileTabs.js.map +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +2 -2
- package/dist/components/other/Calendar/Calendar.js.map +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +2 -2
- package/dist/components/other/Calendar/CalendarCell.js.map +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +2 -2
- package/dist/components/other/Calendar/CalendarGrid.js.map +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +2 -2
- package/dist/components/other/Calendar/RangeCalendar.js.map +1 -1
- package/dist/components/other/CloudLogo/CloudLogo.js +2 -2
- package/dist/components/other/CloudLogo/CloudLogo.js.map +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/AlertDialog/types.d.ts +1 -1
- package/dist/components/overlays/Dialog/Dialog.d.ts +1 -3
- package/dist/components/overlays/Dialog/Dialog.js +2 -4
- package/dist/components/overlays/Dialog/Dialog.js.map +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.d.ts +1 -2
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +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.d.ts +3 -2
- package/dist/components/overlays/Modal/Modal.js +2 -2
- package/dist/components/overlays/Modal/Modal.js.map +1 -1
- package/dist/components/overlays/Modal/OpenTransition.js +1 -1
- package/dist/components/overlays/Modal/Overlay.d.ts +1 -0
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js.map +1 -1
- package/dist/components/overlays/Modal/Popover.d.ts +1 -1
- package/dist/components/overlays/Modal/Popover.js +2 -2
- package/dist/components/overlays/Modal/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.d.ts +1 -1
- package/dist/components/overlays/Modal/Tray.js +2 -2
- package/dist/components/overlays/Modal/Tray.js.map +1 -1
- package/dist/components/overlays/Modal/Underlay.js +2 -2
- package/dist/components/overlays/Modal/Underlay.js.map +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 +2 -2
- package/dist/components/overlays/Notifications/NotificationCard.js.map +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.d.ts +2 -0
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +2 -2
- package/dist/components/overlays/Notifications/NotificationItem.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +2 -2
- package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +2 -2
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js.map +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 +2 -2
- package/dist/components/overlays/Toast/ToastItem.js.map +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 +2 -2
- package/dist/components/overlays/Tooltip/Tooltip.d.ts +1 -3
- package/dist/components/overlays/Tooltip/Tooltip.js +2 -4
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.d.ts +1 -2
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/context.js.map +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.d.ts +2 -0
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/index.d.ts +1 -0
- 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 +2 -2
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js.map +1 -1
- package/dist/components/status/Spin/Cube.js +2 -2
- package/dist/components/status/Spin/Cube.js.map +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +2 -2
- package/dist/components/status/Spin/InternalSpinner.js.map +1 -1
- package/dist/components/status/Spin/Spin.js +2 -2
- package/dist/components/status/Spin/Spin.js.map +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +2 -2
- package/dist/components/status/Spin/SpinsContainer.js.map +1 -1
- package/dist/components/status/Spin/types.d.ts +1 -2
- package/dist/data/item-themes.d.ts +1 -1
- package/dist/data/item-themes.js +1 -1
- 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 +2 -2
- package/dist/icons/DirectionIcon.js.map +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.d.ts +1 -3
- package/dist/icons/Icon.js +2 -3
- package/dist/icons/Icon.js.map +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 +4 -35
- package/dist/index.js +5 -31
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +1 -2
- package/dist/provider.js +1 -1
- package/dist/provider.js.map +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/shared/form.d.ts +1 -3
- package/dist/tokens/base.d.ts +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/base.js.map +1 -1
- package/dist/tokens/colors.d.ts +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/colors.js.map +1 -1
- package/dist/tokens/index.d.ts +1 -2
- package/dist/tokens/index.js +2 -3
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/layout.d.ts +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/layout.js.map +1 -1
- package/dist/tokens/shadows.d.ts +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/shadows.js.map +1 -1
- package/dist/tokens/sizes.d.ts +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/sizes.js.map +1 -1
- package/dist/tokens/spacing.d.ts +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/spacing.js.map +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/is-dev-env.js +5 -10
- package/dist/utils/is-dev-env.js.map +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.d.ts +3 -3
- package/dist/utils/react/index.js +20 -0
- 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.d.ts +1 -2
- package/dist/utils/react/mergeProps.js +2 -2
- package/dist/utils/react/mergeProps.js.map +1 -1
- package/dist/utils/react/nullableValue.d.ts +1 -2
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/nullableValue.js.map +1 -1
- package/dist/utils/react/resolveIcon.d.ts +1 -2
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/resolveIcon.js.map +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.d.ts +1 -2
- package/dist/utils/react/useMergeStyles.js +2 -2
- package/dist/utils/react/useMergeStyles.js.map +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/package.json +4 -21
- package/dist/_virtual/_rolldown/runtime.js +0 -8
- package/dist/chunks/cacheKey.js +0 -71
- package/dist/chunks/cacheKey.js.map +0 -1
- package/dist/chunks/definitions.js +0 -261
- package/dist/chunks/definitions.js.map +0 -1
- package/dist/chunks/renderChunk.js +0 -68
- package/dist/chunks/renderChunk.js.map +0 -1
- package/dist/config.js +0 -232
- package/dist/config.js.map +0 -1
- package/dist/css-writer.d.ts +0 -46
- package/dist/css-writer.js +0 -75
- package/dist/css-writer.js.map +0 -1
- package/dist/extractor.d.ts +0 -25
- package/dist/extractor.js +0 -151
- package/dist/extractor.js.map +0 -1
- package/dist/injector/injector.js +0 -401
- package/dist/injector/injector.js.map +0 -1
- package/dist/injector/sheet-manager.js +0 -715
- package/dist/injector/sheet-manager.js.map +0 -1
- package/dist/injector/types.d.ts +0 -19
- package/dist/keyframes/index.js +0 -157
- package/dist/keyframes/index.js.map +0 -1
- package/dist/parser/classify.js +0 -320
- package/dist/parser/classify.js.map +0 -1
- package/dist/parser/const.js +0 -34
- package/dist/parser/const.js.map +0 -1
- package/dist/parser/lru.js +0 -110
- package/dist/parser/lru.js.map +0 -1
- package/dist/parser/parser.js +0 -117
- package/dist/parser/parser.js.map +0 -1
- package/dist/parser/tokenizer.js +0 -70
- package/dist/parser/tokenizer.js.map +0 -1
- package/dist/parser/types.d.ts +0 -38
- package/dist/parser/types.js +0 -47
- package/dist/parser/types.js.map +0 -1
- package/dist/pipeline/conditions.js +0 -378
- package/dist/pipeline/conditions.js.map +0 -1
- package/dist/pipeline/exclusive.js +0 -232
- package/dist/pipeline/exclusive.js.map +0 -1
- package/dist/pipeline/index.js +0 -633
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/materialize.js +0 -822
- package/dist/pipeline/materialize.js.map +0 -1
- package/dist/pipeline/parseStateKey.js +0 -422
- package/dist/pipeline/parseStateKey.js.map +0 -1
- package/dist/pipeline/simplify.js +0 -558
- package/dist/pipeline/simplify.js.map +0 -1
- package/dist/plugins/okhsl-plugin.js +0 -346
- package/dist/plugins/okhsl-plugin.js.map +0 -1
- package/dist/plugins/types.d.ts +0 -52
- package/dist/properties/index.js +0 -142
- package/dist/properties/index.js.map +0 -1
- package/dist/states/index.js +0 -162
- package/dist/states/index.js.map +0 -1
- package/dist/styles/align.js +0 -15
- package/dist/styles/align.js.map +0 -1
- package/dist/styles/border.js +0 -115
- package/dist/styles/border.js.map +0 -1
- package/dist/styles/color.js +0 -24
- package/dist/styles/color.js.map +0 -1
- package/dist/styles/createStyle.js +0 -78
- package/dist/styles/createStyle.js.map +0 -1
- package/dist/styles/dimension.js +0 -100
- package/dist/styles/dimension.js.map +0 -1
- package/dist/styles/display.js +0 -68
- package/dist/styles/display.js.map +0 -1
- package/dist/styles/fade.js +0 -58
- package/dist/styles/fade.js.map +0 -1
- package/dist/styles/fill.js +0 -52
- package/dist/styles/fill.js.map +0 -1
- package/dist/styles/flow.js +0 -13
- package/dist/styles/flow.js.map +0 -1
- package/dist/styles/gap.js +0 -37
- package/dist/styles/gap.js.map +0 -1
- package/dist/styles/height.js +0 -21
- package/dist/styles/height.js.map +0 -1
- package/dist/styles/index.js +0 -10
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/inset.js +0 -143
- package/dist/styles/inset.js.map +0 -1
- package/dist/styles/justify.js +0 -15
- package/dist/styles/justify.js.map +0 -1
- package/dist/styles/margin.js +0 -97
- package/dist/styles/margin.js.map +0 -1
- package/dist/styles/outline.js +0 -66
- package/dist/styles/outline.js.map +0 -1
- package/dist/styles/padding.js +0 -97
- package/dist/styles/padding.js.map +0 -1
- package/dist/styles/predefined.js +0 -233
- package/dist/styles/predefined.js.map +0 -1
- package/dist/styles/preset.js +0 -126
- package/dist/styles/preset.js.map +0 -1
- package/dist/styles/radius.js +0 -52
- package/dist/styles/radius.js.map +0 -1
- package/dist/styles/scrollbar.js +0 -109
- package/dist/styles/scrollbar.js.map +0 -1
- package/dist/styles/shadow.js +0 -28
- package/dist/styles/shadow.js.map +0 -1
- package/dist/styles/styledScrollbar.js +0 -39
- package/dist/styles/styledScrollbar.js.map +0 -1
- package/dist/styles/transition.js +0 -139
- package/dist/styles/transition.js.map +0 -1
- package/dist/styles/types.d.ts +0 -495
- package/dist/styles/width.js +0 -21
- package/dist/styles/width.js.map +0 -1
- package/dist/tasty/chunks/cacheKey.js +0 -71
- package/dist/tasty/chunks/cacheKey.js.map +0 -1
- package/dist/tasty/chunks/definitions.d.ts +0 -38
- package/dist/tasty/chunks/definitions.js +0 -261
- package/dist/tasty/chunks/definitions.js.map +0 -1
- package/dist/tasty/chunks/renderChunk.js +0 -68
- package/dist/tasty/chunks/renderChunk.js.map +0 -1
- package/dist/tasty/config.d.ts +0 -283
- package/dist/tasty/config.js +0 -401
- package/dist/tasty/config.js.map +0 -1
- package/dist/tasty/debug.d.ts +0 -200
- package/dist/tasty/debug.js +0 -734
- package/dist/tasty/debug.js.map +0 -1
- package/dist/tasty/hooks/useGlobalStyles.d.ts +0 -28
- package/dist/tasty/hooks/useGlobalStyles.js +0 -57
- package/dist/tasty/hooks/useGlobalStyles.js.map +0 -1
- package/dist/tasty/hooks/useKeyframes.d.ts +0 -57
- package/dist/tasty/hooks/useKeyframes.js +0 -55
- package/dist/tasty/hooks/useKeyframes.js.map +0 -1
- package/dist/tasty/hooks/useProperty.d.ts +0 -80
- package/dist/tasty/hooks/useProperty.js +0 -92
- package/dist/tasty/hooks/useProperty.js.map +0 -1
- package/dist/tasty/hooks/useRawCSS.d.ts +0 -54
- package/dist/tasty/hooks/useRawCSS.js +0 -29
- package/dist/tasty/hooks/useRawCSS.js.map +0 -1
- package/dist/tasty/hooks/useStyles.d.ts +0 -41
- package/dist/tasty/hooks/useStyles.js +0 -170
- package/dist/tasty/hooks/useStyles.js.map +0 -1
- package/dist/tasty/index.d.ts +0 -35
- package/dist/tasty/injector/index.d.ts +0 -158
- package/dist/tasty/injector/index.js +0 -155
- package/dist/tasty/injector/index.js.map +0 -1
- package/dist/tasty/injector/injector.d.ts +0 -137
- package/dist/tasty/injector/injector.js +0 -401
- package/dist/tasty/injector/injector.js.map +0 -1
- package/dist/tasty/injector/sheet-manager.d.ts +0 -128
- package/dist/tasty/injector/sheet-manager.js +0 -715
- package/dist/tasty/injector/sheet-manager.js.map +0 -1
- package/dist/tasty/injector/types.d.ts +0 -136
- package/dist/tasty/keyframes/index.js +0 -207
- package/dist/tasty/keyframes/index.js.map +0 -1
- package/dist/tasty/parser/classify.js +0 -320
- package/dist/tasty/parser/classify.js.map +0 -1
- package/dist/tasty/parser/const.js +0 -34
- package/dist/tasty/parser/const.js.map +0 -1
- package/dist/tasty/parser/lru.js +0 -110
- package/dist/tasty/parser/lru.js.map +0 -1
- package/dist/tasty/parser/parser.d.ts +0 -26
- package/dist/tasty/parser/parser.js +0 -117
- package/dist/tasty/parser/parser.js.map +0 -1
- package/dist/tasty/parser/tokenizer.js +0 -70
- package/dist/tasty/parser/tokenizer.js.map +0 -1
- package/dist/tasty/parser/types.d.ts +0 -47
- package/dist/tasty/parser/types.js +0 -47
- package/dist/tasty/parser/types.js.map +0 -1
- package/dist/tasty/pipeline/conditions.js +0 -378
- package/dist/tasty/pipeline/conditions.js.map +0 -1
- package/dist/tasty/pipeline/exclusive.js +0 -232
- package/dist/tasty/pipeline/exclusive.js.map +0 -1
- package/dist/tasty/pipeline/index.d.ts +0 -52
- package/dist/tasty/pipeline/index.js +0 -639
- package/dist/tasty/pipeline/index.js.map +0 -1
- package/dist/tasty/pipeline/materialize.js +0 -822
- package/dist/tasty/pipeline/materialize.js.map +0 -1
- package/dist/tasty/pipeline/parseStateKey.js +0 -422
- package/dist/tasty/pipeline/parseStateKey.js.map +0 -1
- package/dist/tasty/pipeline/simplify.js +0 -558
- package/dist/tasty/pipeline/simplify.js.map +0 -1
- package/dist/tasty/plugins/okhsl-plugin.d.ts +0 -36
- package/dist/tasty/plugins/okhsl-plugin.js +0 -372
- package/dist/tasty/plugins/okhsl-plugin.js.map +0 -1
- package/dist/tasty/plugins/types.d.ts +0 -72
- package/dist/tasty/properties/index.js +0 -159
- package/dist/tasty/properties/index.js.map +0 -1
- package/dist/tasty/states/index.d.ts +0 -44
- package/dist/tasty/states/index.js +0 -390
- package/dist/tasty/states/index.js.map +0 -1
- package/dist/tasty/static/index.d.ts +0 -6
- package/dist/tasty/static/index.js +0 -6
- package/dist/tasty/static/tastyStatic.d.ts +0 -47
- package/dist/tasty/static/tastyStatic.js +0 -32
- package/dist/tasty/static/tastyStatic.js.map +0 -1
- package/dist/tasty/static/types.d.ts +0 -50
- package/dist/tasty/static/types.js +0 -25
- package/dist/tasty/static/types.js.map +0 -1
- package/dist/tasty/styles/align.d.ts +0 -16
- package/dist/tasty/styles/align.js +0 -15
- package/dist/tasty/styles/align.js.map +0 -1
- package/dist/tasty/styles/border.d.ts +0 -26
- package/dist/tasty/styles/border.js +0 -115
- package/dist/tasty/styles/border.js.map +0 -1
- package/dist/tasty/styles/color.d.ts +0 -15
- package/dist/tasty/styles/color.js +0 -24
- package/dist/tasty/styles/color.js.map +0 -1
- package/dist/tasty/styles/createStyle.js +0 -78
- package/dist/tasty/styles/createStyle.js.map +0 -1
- package/dist/tasty/styles/dimension.js +0 -100
- package/dist/tasty/styles/dimension.js.map +0 -1
- package/dist/tasty/styles/display.d.ts +0 -38
- package/dist/tasty/styles/display.js +0 -68
- package/dist/tasty/styles/display.js.map +0 -1
- package/dist/tasty/styles/fade.d.ts +0 -16
- package/dist/tasty/styles/fade.js +0 -58
- package/dist/tasty/styles/fade.js.map +0 -1
- package/dist/tasty/styles/fill.d.ts +0 -45
- package/dist/tasty/styles/fill.js +0 -52
- package/dist/tasty/styles/fill.js.map +0 -1
- package/dist/tasty/styles/flow.d.ts +0 -17
- package/dist/tasty/styles/flow.js +0 -13
- package/dist/tasty/styles/flow.js.map +0 -1
- package/dist/tasty/styles/gap.d.ts +0 -32
- package/dist/tasty/styles/gap.js +0 -37
- package/dist/tasty/styles/gap.js.map +0 -1
- package/dist/tasty/styles/height.d.ts +0 -18
- package/dist/tasty/styles/height.js +0 -21
- package/dist/tasty/styles/height.js.map +0 -1
- package/dist/tasty/styles/index.d.ts +0 -3
- package/dist/tasty/styles/index.js +0 -10
- package/dist/tasty/styles/index.js.map +0 -1
- package/dist/tasty/styles/inset.d.ts +0 -51
- package/dist/tasty/styles/inset.js +0 -143
- package/dist/tasty/styles/inset.js.map +0 -1
- package/dist/tasty/styles/justify.d.ts +0 -16
- package/dist/tasty/styles/justify.js +0 -15
- package/dist/tasty/styles/justify.js.map +0 -1
- package/dist/tasty/styles/list.d.ts +0 -17
- package/dist/tasty/styles/list.js +0 -99
- package/dist/tasty/styles/list.js.map +0 -1
- package/dist/tasty/styles/margin.d.ts +0 -29
- package/dist/tasty/styles/margin.js +0 -97
- package/dist/tasty/styles/margin.js.map +0 -1
- package/dist/tasty/styles/outline.d.ts +0 -30
- package/dist/tasty/styles/outline.js +0 -66
- package/dist/tasty/styles/outline.js.map +0 -1
- package/dist/tasty/styles/padding.d.ts +0 -29
- package/dist/tasty/styles/padding.js +0 -97
- package/dist/tasty/styles/padding.js.map +0 -1
- package/dist/tasty/styles/predefined.d.ts +0 -74
- package/dist/tasty/styles/predefined.js +0 -242
- package/dist/tasty/styles/predefined.js.map +0 -1
- package/dist/tasty/styles/preset.d.ts +0 -48
- package/dist/tasty/styles/preset.js +0 -126
- package/dist/tasty/styles/preset.js.map +0 -1
- package/dist/tasty/styles/radius.d.ts +0 -15
- package/dist/tasty/styles/radius.js +0 -52
- package/dist/tasty/styles/radius.js.map +0 -1
- package/dist/tasty/styles/scrollbar.d.ts +0 -22
- package/dist/tasty/styles/scrollbar.js +0 -109
- package/dist/tasty/styles/scrollbar.js.map +0 -1
- package/dist/tasty/styles/shadow.d.ts +0 -15
- package/dist/tasty/styles/shadow.js +0 -28
- package/dist/tasty/styles/shadow.js.map +0 -1
- package/dist/tasty/styles/styledScrollbar.d.ts +0 -48
- package/dist/tasty/styles/styledScrollbar.js +0 -39
- package/dist/tasty/styles/styledScrollbar.js.map +0 -1
- package/dist/tasty/styles/transition.d.ts +0 -15
- package/dist/tasty/styles/transition.js +0 -139
- package/dist/tasty/styles/transition.js.map +0 -1
- package/dist/tasty/styles/types.d.ts +0 -499
- package/dist/tasty/styles/width.d.ts +0 -18
- package/dist/tasty/styles/width.js +0 -21
- package/dist/tasty/styles/width.js.map +0 -1
- package/dist/tasty/tasty.d.ts +0 -936
- package/dist/tasty/tasty.js +0 -191
- package/dist/tasty/tasty.js.map +0 -1
- package/dist/tasty/types.d.ts +0 -192
- package/dist/tasty/utils/cache-wrapper.js +0 -25
- package/dist/tasty/utils/cache-wrapper.js.map +0 -1
- package/dist/tasty/utils/case-converter.js +0 -9
- package/dist/tasty/utils/case-converter.js.map +0 -1
- package/dist/tasty/utils/colors.d.ts +0 -6
- package/dist/tasty/utils/colors.js +0 -10
- package/dist/tasty/utils/colors.js.map +0 -1
- package/dist/tasty/utils/dotize.d.ts +0 -27
- package/dist/tasty/utils/dotize.js +0 -123
- package/dist/tasty/utils/dotize.js.map +0 -1
- package/dist/tasty/utils/filter-base-props.d.ts +0 -16
- package/dist/tasty/utils/filter-base-props.js +0 -46
- package/dist/tasty/utils/filter-base-props.js.map +0 -1
- package/dist/tasty/utils/get-display-name.d.ts +0 -8
- package/dist/tasty/utils/get-display-name.js +0 -11
- package/dist/tasty/utils/get-display-name.js.map +0 -1
- package/dist/tasty/utils/hsl-to-rgb.js +0 -39
- package/dist/tasty/utils/hsl-to-rgb.js.map +0 -1
- package/dist/tasty/utils/is-dev-env.js +0 -20
- package/dist/tasty/utils/is-dev-env.js.map +0 -1
- package/dist/tasty/utils/merge-styles.d.ts +0 -8
- package/dist/tasty/utils/merge-styles.js +0 -147
- package/dist/tasty/utils/merge-styles.js.map +0 -1
- package/dist/tasty/utils/mod-attrs.d.ts +0 -9
- package/dist/tasty/utils/mod-attrs.js +0 -22
- package/dist/tasty/utils/mod-attrs.js.map +0 -1
- package/dist/tasty/utils/okhsl-to-rgb.js +0 -297
- package/dist/tasty/utils/okhsl-to-rgb.js.map +0 -1
- package/dist/tasty/utils/process-tokens.d.ts +0 -32
- package/dist/tasty/utils/process-tokens.js +0 -172
- package/dist/tasty/utils/process-tokens.js.map +0 -1
- package/dist/tasty/utils/resolve-recipes.d.ts +0 -18
- package/dist/tasty/utils/resolve-recipes.js +0 -144
- package/dist/tasty/utils/resolve-recipes.js.map +0 -1
- package/dist/tasty/utils/string.js +0 -9
- package/dist/tasty/utils/string.js.map +0 -1
- package/dist/tasty/utils/styles.d.ts +0 -204
- package/dist/tasty/utils/styles.js +0 -577
- package/dist/tasty/utils/styles.js.map +0 -1
- package/dist/tasty/utils/typography.d.ts +0 -37
- package/dist/tasty/utils/typography.js +0 -54
- package/dist/tasty/utils/typography.js.map +0 -1
- package/dist/tasty/utils/warnings.d.ts +0 -17
- package/dist/tasty/utils/warnings.js +0 -17
- package/dist/tasty/utils/warnings.js.map +0 -1
- package/dist/tasty/zero/babel.d.ts +0 -111
- package/dist/tasty/zero/babel.js +0 -283
- package/dist/tasty/zero/babel.js.map +0 -1
- package/dist/tasty/zero/index.d.ts +0 -4
- package/dist/tasty/zero/index.js +0 -5
- package/dist/tasty/zero/next.d.ts +0 -61
- package/dist/tasty/zero/next.js +0 -79
- package/dist/tasty/zero/next.js.map +0 -1
- package/dist/tasty.config.ts +0 -311
- package/dist/tokens/typography.d.ts +0 -35
- package/dist/tokens/typography.js +0 -238
- package/dist/tokens/typography.js.map +0 -1
- package/dist/utils/cache-wrapper.js +0 -25
- package/dist/utils/cache-wrapper.js.map +0 -1
- package/dist/utils/case-converter.js +0 -9
- package/dist/utils/case-converter.js.map +0 -1
- package/dist/utils/hsl-to-rgb.js +0 -39
- package/dist/utils/hsl-to-rgb.js.map +0 -1
- package/dist/utils/merge-styles.js +0 -147
- package/dist/utils/merge-styles.js.map +0 -1
- package/dist/utils/okhsl-to-rgb.js +0 -297
- package/dist/utils/okhsl-to-rgb.js.map +0 -1
- package/dist/utils/process-tokens.js +0 -29
- package/dist/utils/process-tokens.js.map +0 -1
- package/dist/utils/resolve-recipes.js +0 -144
- package/dist/utils/resolve-recipes.js.map +0 -1
- package/dist/utils/string.js +0 -9
- package/dist/utils/string.js.map +0 -1
- package/dist/utils/styles.d.ts +0 -23
- package/dist/utils/styles.js +0 -338
- package/dist/utils/styles.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRawCSS.js","names":[],"sources":["../../../src/tasty/hooks/useRawCSS.ts"],"sourcesContent":["import { useInsertionEffect, useMemo, useRef } from 'react';\n\nimport { injectRawCSS } from '../injector';\n\ntype UseRawCSSOptions = { root?: Document | ShadowRoot };\n\n/**\n * Hook to inject raw CSS text directly without parsing.\n * This is a low-overhead alternative for injecting global CSS that doesn't need tasty processing.\n *\n * The CSS is inserted into a separate style element (data-tasty-raw) to avoid conflicts\n * with tasty's chunked style sheets.\n *\n * @example Static CSS string\n * ```tsx\n * function GlobalStyles() {\n * useRawCSS(`\n * body {\n * margin: 0;\n * padding: 0;\n * font-family: sans-serif;\n * }\n * `);\n *\n * return null;\n * }\n * ```\n *\n * @example Factory function with dependencies (like useMemo)\n * ```tsx\n * function ThemeStyles({ theme }: { theme: 'light' | 'dark' }) {\n * useRawCSS(() => `\n * :root {\n * --bg-color: ${theme === 'dark' ? '#1a1a1a' : '#ffffff'};\n * --text-color: ${theme === 'dark' ? '#ffffff' : '#1a1a1a'};\n * }\n * `, [theme]);\n *\n * return null;\n * }\n * ```\n *\n * @example With options\n * ```tsx\n * function ShadowStyles({ shadowRoot }) {\n * useRawCSS(() => `.scoped { color: red; }`, [], { root: shadowRoot });\n * return null;\n * }\n * ```\n */\n\n// Overload 1: Static CSS string\nexport function useRawCSS(css: string, options?: UseRawCSSOptions): void;\n\n// Overload 2: Factory function with dependencies\nexport function useRawCSS(\n factory: () => string,\n deps: readonly unknown[],\n options?: UseRawCSSOptions,\n): void;\n\n// Implementation\nexport function useRawCSS(\n cssOrFactory: string | (() => string),\n depsOrOptions?: readonly unknown[] | UseRawCSSOptions,\n options?: UseRawCSSOptions,\n): void {\n // Detect which overload is being used\n const isFactory = typeof cssOrFactory === 'function';\n\n // Parse arguments based on overload\n const deps =\n isFactory && Array.isArray(depsOrOptions) ? depsOrOptions : undefined;\n const opts = isFactory\n ? options\n : (depsOrOptions as UseRawCSSOptions | undefined);\n\n // Memoize CSS - for factory functions, use provided deps; for strings, use the string itself\n const css = useMemo(\n () =>\n isFactory ? (cssOrFactory as () => string)() : (cssOrFactory as string),\n\n isFactory ? deps ?? [] : [cssOrFactory],\n );\n\n const disposeRef = useRef<(() => void) | null>(null);\n\n useInsertionEffect(() => {\n // Dispose previous injection if any\n disposeRef.current?.();\n\n if (!css.trim()) {\n disposeRef.current = null;\n return;\n }\n\n // Inject new CSS\n const { dispose } = injectRawCSS(css, opts);\n disposeRef.current = dispose;\n\n // Cleanup on unmount or when css changes\n return () => {\n disposeRef.current?.();\n disposeRef.current = null;\n };\n }, [css, opts?.root]);\n}\n"],"mappings":";;;;;AA8DA,SAAgB,UACd,cACA,eACA,SACM;CAEN,MAAM,YAAY,OAAO,iBAAiB;CAG1C,MAAM,OACJ,aAAa,MAAM,QAAQ,cAAc,GAAG,gBAAgB;CAC9D,MAAM,OAAO,YACT,UACC;CAGL,MAAM,MAAM,cAER,YAAa,cAA+B,GAAI,cAElD,YAAY,QAAQ,EAAE,GAAG,CAAC,aAAa,CACxC;CAED,MAAM,aAAa,OAA4B,KAAK;AAEpD,0BAAyB;AAEvB,aAAW,WAAW;AAEtB,MAAI,CAAC,IAAI,MAAM,EAAE;AACf,cAAW,UAAU;AACrB;;EAIF,MAAM,EAAE,YAAY,aAAa,KAAK,KAAK;AAC3C,aAAW,UAAU;AAGrB,eAAa;AACX,cAAW,WAAW;AACtB,cAAW,UAAU;;IAEtB,CAAC,KAAK,MAAM,KAAK,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Styles } from "../styles/types.js";
|
|
3
|
-
|
|
4
|
-
//#region src/tasty/hooks/useStyles.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Tasty styles object to generate CSS classes for.
|
|
7
|
-
* Can be undefined or empty object for no styles.
|
|
8
|
-
*/
|
|
9
|
-
type UseStylesOptions = Styles | undefined;
|
|
10
|
-
interface UseStylesResult {
|
|
11
|
-
/**
|
|
12
|
-
* Generated className(s) to apply to the element.
|
|
13
|
-
* Can be empty string if no styles are provided.
|
|
14
|
-
* With chunking enabled, may contain multiple space-separated class names.
|
|
15
|
-
*/
|
|
16
|
-
className: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Hook to generate CSS classes from Tasty styles.
|
|
20
|
-
* Handles style rendering, className allocation, and CSS injection.
|
|
21
|
-
*
|
|
22
|
-
* Uses chunking to split styles into logical groups for better caching
|
|
23
|
-
* and CSS reuse across components.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* function MyComponent() {
|
|
28
|
-
* const { className } = useStyles({
|
|
29
|
-
* padding: '2x',
|
|
30
|
-
* fill: '#purple',
|
|
31
|
-
* radius: '1r',
|
|
32
|
-
* });
|
|
33
|
-
*
|
|
34
|
-
* return <div className={className}>Styled content</div>;
|
|
35
|
-
* }
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
declare function useStyles(styles: UseStylesOptions): UseStylesResult;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { UseStylesOptions, UseStylesResult, useStyles };
|
|
41
|
-
//# sourceMappingURL=useStyles.d.ts.map
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.118.0 | Cube Dev Team */
|
|
2
|
-
import { stringifyStyles } from "../utils/styles.js";
|
|
3
|
-
import { extractLocalProperties, hasLocalProperties } from "../properties/index.js";
|
|
4
|
-
import { getGlobalKeyframes, hasGlobalKeyframes } from "../config.js";
|
|
5
|
-
import { CHUNK_NAMES, categorizeStyleKeys } from "../chunks/definitions.js";
|
|
6
|
-
import { generateChunkCacheKey } from "../chunks/cacheKey.js";
|
|
7
|
-
import { renderStylesForChunk } from "../chunks/renderChunk.js";
|
|
8
|
-
import { allocateClassName, inject, keyframes, property } from "../injector/index.js";
|
|
9
|
-
import { extractAnimationNamesFromStyles, extractLocalKeyframes, filterUsedKeyframes, hasLocalKeyframes, mergeKeyframes, replaceAnimationNames } from "../keyframes/index.js";
|
|
10
|
-
import { resolveRecipes } from "../utils/resolve-recipes.js";
|
|
11
|
-
import { useInsertionEffect, useMemo, useRef } from "react";
|
|
12
|
-
|
|
13
|
-
//#region src/tasty/hooks/useStyles.ts
|
|
14
|
-
/**
|
|
15
|
-
* Check if styles contain @starting-style rules.
|
|
16
|
-
*
|
|
17
|
-
* @starting-style CSS cannot be applied via multiple class names because
|
|
18
|
-
* of cascade - later rules override earlier ones. When @starting is detected,
|
|
19
|
-
* we combine top-level styles into a single chunk but keep sub-element styles
|
|
20
|
-
* in their own chunk for better caching.
|
|
21
|
-
*/
|
|
22
|
-
function containsStartingStyle(styleKey) {
|
|
23
|
-
return styleKey.includes("@starting");
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Render, cache-key, and allocate a className for a single chunk.
|
|
27
|
-
* Returns a ProcessedChunk, or null if the chunk produces no CSS rules.
|
|
28
|
-
*/
|
|
29
|
-
function processChunk(styles, chunkName, styleKeys) {
|
|
30
|
-
if (styleKeys.length === 0) return null;
|
|
31
|
-
const renderResult = renderStylesForChunk(styles, chunkName, styleKeys);
|
|
32
|
-
if (renderResult.rules.length === 0) return null;
|
|
33
|
-
const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys);
|
|
34
|
-
const { className } = allocateClassName(cacheKey);
|
|
35
|
-
return {
|
|
36
|
-
name: chunkName,
|
|
37
|
-
styleKeys,
|
|
38
|
-
cacheKey,
|
|
39
|
-
renderResult,
|
|
40
|
-
className
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Merge chunk map entries for @starting-style partial chunking.
|
|
45
|
-
*
|
|
46
|
-
* All non-subcomponent chunks are merged into a single COMBINED entry,
|
|
47
|
-
* while SUBCOMPONENTS stays separate. This preserves CSS cascade for
|
|
48
|
-
* @starting-style while still allowing sub-element styles to cache independently.
|
|
49
|
-
*/
|
|
50
|
-
function mergeChunksForStartingStyle(chunkMap) {
|
|
51
|
-
const merged = /* @__PURE__ */ new Map();
|
|
52
|
-
const combinedKeys = [];
|
|
53
|
-
for (const [chunkName, keys] of chunkMap) if (chunkName === CHUNK_NAMES.SUBCOMPONENTS) merged.set(CHUNK_NAMES.SUBCOMPONENTS, keys);
|
|
54
|
-
else combinedKeys.push(...keys);
|
|
55
|
-
if (combinedKeys.length > 0) {
|
|
56
|
-
const result = /* @__PURE__ */ new Map();
|
|
57
|
-
result.set(CHUNK_NAMES.COMBINED, combinedKeys);
|
|
58
|
-
for (const [k, v] of merged) result.set(k, v);
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
return merged;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Get keyframes that are actually used in styles.
|
|
65
|
-
* Returns null if no keyframes are used (fast path for zero overhead).
|
|
66
|
-
*
|
|
67
|
-
* Optimization order:
|
|
68
|
-
* 1. Check if any keyframes are defined (local or global) - if not, return null
|
|
69
|
-
* 2. Extract animation names from styles - if none, return null
|
|
70
|
-
* 3. Merge and filter keyframes to only used ones
|
|
71
|
-
*/
|
|
72
|
-
function getUsedKeyframes(styles) {
|
|
73
|
-
const hasLocal = hasLocalKeyframes(styles);
|
|
74
|
-
const hasGlobal = hasGlobalKeyframes();
|
|
75
|
-
if (!hasLocal && !hasGlobal) return null;
|
|
76
|
-
const usedNames = extractAnimationNamesFromStyles(styles);
|
|
77
|
-
if (usedNames.size === 0) return null;
|
|
78
|
-
return filterUsedKeyframes(mergeKeyframes(hasLocal ? extractLocalKeyframes(styles) : null, hasGlobal ? getGlobalKeyframes() : null), usedNames);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Hook to generate CSS classes from Tasty styles.
|
|
82
|
-
* Handles style rendering, className allocation, and CSS injection.
|
|
83
|
-
*
|
|
84
|
-
* Uses chunking to split styles into logical groups for better caching
|
|
85
|
-
* and CSS reuse across components.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```tsx
|
|
89
|
-
* function MyComponent() {
|
|
90
|
-
* const { className } = useStyles({
|
|
91
|
-
* padding: '2x',
|
|
92
|
-
* fill: '#purple',
|
|
93
|
-
* radius: '1r',
|
|
94
|
-
* });
|
|
95
|
-
*
|
|
96
|
-
* return <div className={className}>Styled content</div>;
|
|
97
|
-
* }
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
function useStyles(styles) {
|
|
101
|
-
const disposeRef = useRef([]);
|
|
102
|
-
const stylesRef = useRef({
|
|
103
|
-
key: "",
|
|
104
|
-
styles: void 0
|
|
105
|
-
});
|
|
106
|
-
const resolvedStyles = useMemo(() => {
|
|
107
|
-
if (!styles) return styles;
|
|
108
|
-
return resolveRecipes(styles);
|
|
109
|
-
}, [styles]);
|
|
110
|
-
const styleKey = useMemo(() => {
|
|
111
|
-
if (!resolvedStyles || Object.keys(resolvedStyles).length === 0) return "";
|
|
112
|
-
return stringifyStyles(resolvedStyles);
|
|
113
|
-
}, [resolvedStyles]);
|
|
114
|
-
if (stylesRef.current.key !== styleKey) stylesRef.current = {
|
|
115
|
-
key: styleKey,
|
|
116
|
-
styles: resolvedStyles
|
|
117
|
-
};
|
|
118
|
-
const processedChunks = useMemo(() => {
|
|
119
|
-
const currentStyles = stylesRef.current.styles;
|
|
120
|
-
if (!styleKey || !currentStyles) return [];
|
|
121
|
-
let chunkMap = categorizeStyleKeys(currentStyles);
|
|
122
|
-
if (containsStartingStyle(styleKey)) chunkMap = mergeChunksForStartingStyle(chunkMap);
|
|
123
|
-
const chunks = [];
|
|
124
|
-
for (const [chunkName, chunkStyleKeys] of chunkMap) {
|
|
125
|
-
const chunk = processChunk(currentStyles, chunkName, chunkStyleKeys);
|
|
126
|
-
if (chunk) chunks.push(chunk);
|
|
127
|
-
}
|
|
128
|
-
return chunks;
|
|
129
|
-
}, [styleKey]);
|
|
130
|
-
useInsertionEffect(() => {
|
|
131
|
-
disposeRef.current.forEach((dispose) => dispose?.());
|
|
132
|
-
disposeRef.current = [];
|
|
133
|
-
if (processedChunks.length === 0) return;
|
|
134
|
-
const currentStyles = stylesRef.current.styles;
|
|
135
|
-
const usedKeyframes = currentStyles ? getUsedKeyframes(currentStyles) : null;
|
|
136
|
-
let nameMap = null;
|
|
137
|
-
if (usedKeyframes) {
|
|
138
|
-
nameMap = /* @__PURE__ */ new Map();
|
|
139
|
-
for (const [name, steps] of Object.entries(usedKeyframes)) {
|
|
140
|
-
const result = keyframes(steps, { name });
|
|
141
|
-
const injectedName = result.toString();
|
|
142
|
-
if (injectedName !== name) nameMap.set(name, injectedName);
|
|
143
|
-
disposeRef.current.push(result.dispose);
|
|
144
|
-
}
|
|
145
|
-
if (nameMap.size === 0) nameMap = null;
|
|
146
|
-
}
|
|
147
|
-
if (currentStyles && hasLocalProperties(currentStyles)) {
|
|
148
|
-
const localProperties = extractLocalProperties(currentStyles);
|
|
149
|
-
if (localProperties) for (const [token, definition] of Object.entries(localProperties)) property(token, definition);
|
|
150
|
-
}
|
|
151
|
-
for (const chunk of processedChunks) if (chunk.renderResult.rules.length > 0) {
|
|
152
|
-
const { dispose } = inject(nameMap ? chunk.renderResult.rules.map((rule) => ({
|
|
153
|
-
...rule,
|
|
154
|
-
declarations: replaceAnimationNames(rule.declarations, nameMap)
|
|
155
|
-
})) : chunk.renderResult.rules, { cacheKey: chunk.cacheKey });
|
|
156
|
-
disposeRef.current.push(dispose);
|
|
157
|
-
}
|
|
158
|
-
return () => {
|
|
159
|
-
disposeRef.current.forEach((dispose) => dispose?.());
|
|
160
|
-
disposeRef.current = [];
|
|
161
|
-
};
|
|
162
|
-
}, [processedChunks]);
|
|
163
|
-
return { className: useMemo(() => {
|
|
164
|
-
return processedChunks.map((chunk) => chunk.className).join(" ");
|
|
165
|
-
}, [processedChunks]) };
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
//#endregion
|
|
169
|
-
export { useStyles };
|
|
170
|
-
//# sourceMappingURL=useStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStyles.js","names":[],"sources":["../../../src/tasty/hooks/useStyles.ts"],"sourcesContent":["import { useInsertionEffect, useMemo, useRef } from 'react';\n\nimport {\n categorizeStyleKeys,\n CHUNK_NAMES,\n generateChunkCacheKey,\n renderStylesForChunk,\n} from '../chunks';\nimport { getGlobalKeyframes, hasGlobalKeyframes } from '../config';\nimport { allocateClassName, inject, keyframes, property } from '../injector';\nimport { KeyframesSteps, PropertyDefinition } from '../injector/types';\nimport {\n extractAnimationNamesFromStyles,\n extractLocalKeyframes,\n filterUsedKeyframes,\n hasLocalKeyframes,\n mergeKeyframes,\n replaceAnimationNames,\n} from '../keyframes';\nimport { RenderResult } from '../pipeline';\nimport { extractLocalProperties, hasLocalProperties } from '../properties';\nimport { Styles } from '../styles/types';\nimport { resolveRecipes } from '../utils/resolve-recipes';\nimport { stringifyStyles } from '../utils/styles';\n\n/**\n * Check if styles contain @starting-style rules.\n *\n * @starting-style CSS cannot be applied via multiple class names because\n * of cascade - later rules override earlier ones. When @starting is detected,\n * we combine top-level styles into a single chunk but keep sub-element styles\n * in their own chunk for better caching.\n */\nfunction containsStartingStyle(styleKey: string): boolean {\n return styleKey.includes('@starting');\n}\n\n/**\n * Tasty styles object to generate CSS classes for.\n * Can be undefined or empty object for no styles.\n */\nexport type UseStylesOptions = Styles | undefined;\n\nexport interface UseStylesResult {\n /**\n * Generated className(s) to apply to the element.\n * Can be empty string if no styles are provided.\n * With chunking enabled, may contain multiple space-separated class names.\n */\n className: string;\n}\n\n/**\n * Information about a processed chunk\n */\ninterface ProcessedChunk {\n name: string;\n styleKeys: string[];\n cacheKey: string;\n renderResult: RenderResult;\n className: string;\n}\n\n/**\n * Render, cache-key, and allocate a className for a single chunk.\n * Returns a ProcessedChunk, or null if the chunk produces no CSS rules.\n */\nfunction processChunk(\n styles: Styles,\n chunkName: string,\n styleKeys: string[],\n): ProcessedChunk | null {\n if (styleKeys.length === 0) return null;\n\n const renderResult = renderStylesForChunk(styles, chunkName, styleKeys);\n if (renderResult.rules.length === 0) return null;\n\n const cacheKey = generateChunkCacheKey(styles, chunkName, styleKeys);\n const { className } = allocateClassName(cacheKey);\n\n return { name: chunkName, styleKeys, cacheKey, renderResult, className };\n}\n\n/**\n * Merge chunk map entries for @starting-style partial chunking.\n *\n * All non-subcomponent chunks are merged into a single COMBINED entry,\n * while SUBCOMPONENTS stays separate. This preserves CSS cascade for\n * @starting-style while still allowing sub-element styles to cache independently.\n */\nfunction mergeChunksForStartingStyle(\n chunkMap: Map<string, string[]>,\n): Map<string, string[]> {\n const merged = new Map<string, string[]>();\n const combinedKeys: string[] = [];\n\n for (const [chunkName, keys] of chunkMap) {\n if (chunkName === CHUNK_NAMES.SUBCOMPONENTS) {\n merged.set(CHUNK_NAMES.SUBCOMPONENTS, keys);\n } else {\n combinedKeys.push(...keys);\n }\n }\n\n if (combinedKeys.length > 0) {\n // Insert COMBINED first so it appears before SUBCOMPONENTS\n const result = new Map<string, string[]>();\n result.set(CHUNK_NAMES.COMBINED, combinedKeys);\n for (const [k, v] of merged) {\n result.set(k, v);\n }\n return result;\n }\n\n return merged;\n}\n\n/**\n * Get keyframes that are actually used in styles.\n * Returns null if no keyframes are used (fast path for zero overhead).\n *\n * Optimization order:\n * 1. Check if any keyframes are defined (local or global) - if not, return null\n * 2. Extract animation names from styles - if none, return null\n * 3. Merge and filter keyframes to only used ones\n */\nfunction getUsedKeyframes(\n styles: Styles,\n): Record<string, KeyframesSteps> | null {\n // Fast path: no keyframes defined anywhere\n const hasLocal = hasLocalKeyframes(styles);\n const hasGlobal = hasGlobalKeyframes();\n if (!hasLocal && !hasGlobal) return null;\n\n // Extract animation names from styles (not from rendered CSS - faster)\n const usedNames = extractAnimationNamesFromStyles(styles);\n if (usedNames.size === 0) return null;\n\n // Merge local and global keyframes\n const local = hasLocal ? extractLocalKeyframes(styles) : null;\n const global = hasGlobal ? getGlobalKeyframes() : null;\n const allKeyframes = mergeKeyframes(local, global);\n\n // Filter to only used keyframes\n return filterUsedKeyframes(allKeyframes, usedNames);\n}\n\n/**\n * Hook to generate CSS classes from Tasty styles.\n * Handles style rendering, className allocation, and CSS injection.\n *\n * Uses chunking to split styles into logical groups for better caching\n * and CSS reuse across components.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { className } = useStyles({\n * padding: '2x',\n * fill: '#purple',\n * radius: '1r',\n * });\n *\n * return <div className={className}>Styled content</div>;\n * }\n * ```\n */\nexport function useStyles(styles: UseStylesOptions): UseStylesResult {\n // Array of dispose functions for each chunk\n const disposeRef = useRef<(() => void)[]>([]);\n\n // Store styles by their stringified key to avoid recomputing when only reference changes\n const stylesRef = useRef<{ key: string; styles: Styles | undefined }>({\n key: '',\n styles: undefined,\n });\n\n // Resolve recipes before any processing (zero overhead if no recipes configured)\n const resolvedStyles = useMemo(() => {\n if (!styles) return styles;\n return resolveRecipes(styles);\n }, [styles]);\n\n // Compute style key - this is a primitive string that captures style content\n const styleKey = useMemo(() => {\n if (!resolvedStyles || Object.keys(resolvedStyles).length === 0) {\n return '';\n }\n return stringifyStyles(resolvedStyles);\n }, [resolvedStyles]);\n\n // Update ref when styleKey changes (content actually changed)\n if (stylesRef.current.key !== styleKey) {\n stylesRef.current = { key: styleKey, styles: resolvedStyles };\n }\n\n // Process chunks: categorize, generate cache keys, render, and allocate classNames\n // Only depends on styleKey (primitive), not styles object reference\n const processedChunks: ProcessedChunk[] = useMemo(() => {\n const currentStyles = stylesRef.current.styles;\n if (!styleKey || !currentStyles) {\n return [];\n }\n\n // Categorize style keys into chunks\n let chunkMap = categorizeStyleKeys(\n currentStyles as Record<string, unknown>,\n );\n\n // Partial chunking for styles containing @starting-style rules.\n // @starting-style CSS cannot work with multiple class names due to cascade,\n // so we merge all top-level chunks into one but keep sub-element styles separate.\n if (containsStartingStyle(styleKey)) {\n chunkMap = mergeChunksForStartingStyle(chunkMap);\n }\n\n // Process each chunk: render → cache key → allocate className\n const chunks: ProcessedChunk[] = [];\n\n for (const [chunkName, chunkStyleKeys] of chunkMap) {\n const chunk = processChunk(currentStyles, chunkName, chunkStyleKeys);\n if (chunk) {\n chunks.push(chunk);\n }\n }\n\n return chunks;\n }, [styleKey]);\n\n // Inject styles in insertion effect (avoids render phase side effects)\n useInsertionEffect(() => {\n // Cleanup all previous disposals\n disposeRef.current.forEach((dispose) => dispose?.());\n disposeRef.current = [];\n\n // Fast path: no chunks to inject\n if (processedChunks.length === 0) {\n return;\n }\n\n const currentStyles = stylesRef.current.styles;\n\n // Get keyframes that are actually used (returns null if none - zero overhead)\n const usedKeyframes = currentStyles\n ? getUsedKeyframes(currentStyles)\n : null;\n\n // Inject keyframes and build name map (only if we have keyframes)\n let nameMap: Map<string, string> | null = null;\n\n if (usedKeyframes) {\n nameMap = new Map();\n for (const [name, steps] of Object.entries(usedKeyframes)) {\n const result = keyframes(steps, { name });\n const injectedName = result.toString();\n // Only add to map if name differs (optimization for replacement check)\n if (injectedName !== name) {\n nameMap.set(name, injectedName);\n }\n disposeRef.current.push(result.dispose);\n }\n // Clear map if no replacements needed\n if (nameMap.size === 0) {\n nameMap = null;\n }\n }\n\n // Register local @properties if defined (no dispose needed - properties are permanent)\n // Token formats: $name → --name, #name → --name-color (with auto syntax: '<color>')\n // The injector.property() handles token parsing and auto-settings internally\n // Note: Global properties are injected once when styles are first generated (see markStylesGenerated)\n if (currentStyles && hasLocalProperties(currentStyles)) {\n const localProperties = extractLocalProperties(currentStyles);\n if (localProperties) {\n for (const [token, definition] of Object.entries(localProperties)) {\n // Pass the token directly - injector handles parsing\n property(token, definition);\n }\n }\n }\n\n // Inject each chunk\n for (const chunk of processedChunks) {\n if (chunk.renderResult.rules.length > 0) {\n // Replace animation names only if needed\n const rulesToInject = nameMap\n ? chunk.renderResult.rules.map((rule) => ({\n ...rule,\n declarations: replaceAnimationNames(rule.declarations, nameMap!),\n }))\n : chunk.renderResult.rules;\n\n const { dispose } = inject(rulesToInject, {\n cacheKey: chunk.cacheKey,\n });\n disposeRef.current.push(dispose);\n }\n }\n\n return () => {\n disposeRef.current.forEach((dispose) => dispose?.());\n disposeRef.current = [];\n };\n }, [processedChunks]);\n\n // Combine all chunk classNames\n const className = useMemo(() => {\n return processedChunks.map((chunk) => chunk.className).join(' ');\n }, [processedChunks]);\n\n return {\n className,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCA,SAAS,sBAAsB,UAA2B;AACxD,QAAO,SAAS,SAAS,YAAY;;;;;;AAiCvC,SAAS,aACP,QACA,WACA,WACuB;AACvB,KAAI,UAAU,WAAW,EAAG,QAAO;CAEnC,MAAM,eAAe,qBAAqB,QAAQ,WAAW,UAAU;AACvE,KAAI,aAAa,MAAM,WAAW,EAAG,QAAO;CAE5C,MAAM,WAAW,sBAAsB,QAAQ,WAAW,UAAU;CACpE,MAAM,EAAE,cAAc,kBAAkB,SAAS;AAEjD,QAAO;EAAE,MAAM;EAAW;EAAW;EAAU;EAAc;EAAW;;;;;;;;;AAU1E,SAAS,4BACP,UACuB;CACvB,MAAM,yBAAS,IAAI,KAAuB;CAC1C,MAAM,eAAyB,EAAE;AAEjC,MAAK,MAAM,CAAC,WAAW,SAAS,SAC9B,KAAI,cAAc,YAAY,cAC5B,QAAO,IAAI,YAAY,eAAe,KAAK;KAE3C,cAAa,KAAK,GAAG,KAAK;AAI9B,KAAI,aAAa,SAAS,GAAG;EAE3B,MAAM,yBAAS,IAAI,KAAuB;AAC1C,SAAO,IAAI,YAAY,UAAU,aAAa;AAC9C,OAAK,MAAM,CAAC,GAAG,MAAM,OACnB,QAAO,IAAI,GAAG,EAAE;AAElB,SAAO;;AAGT,QAAO;;;;;;;;;;;AAYT,SAAS,iBACP,QACuC;CAEvC,MAAM,WAAW,kBAAkB,OAAO;CAC1C,MAAM,YAAY,oBAAoB;AACtC,KAAI,CAAC,YAAY,CAAC,UAAW,QAAO;CAGpC,MAAM,YAAY,gCAAgC,OAAO;AACzD,KAAI,UAAU,SAAS,EAAG,QAAO;AAQjC,QAAO,oBAHc,eAFP,WAAW,sBAAsB,OAAO,GAAG,MAC1C,YAAY,oBAAoB,GAAG,KACA,EAGT,UAAU;;;;;;;;;;;;;;;;;;;;;;AAuBrD,SAAgB,UAAU,QAA2C;CAEnE,MAAM,aAAa,OAAuB,EAAE,CAAC;CAG7C,MAAM,YAAY,OAAoD;EACpE,KAAK;EACL,QAAQ;EACT,CAAC;CAGF,MAAM,iBAAiB,cAAc;AACnC,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO,eAAe,OAAO;IAC5B,CAAC,OAAO,CAAC;CAGZ,MAAM,WAAW,cAAc;AAC7B,MAAI,CAAC,kBAAkB,OAAO,KAAK,eAAe,CAAC,WAAW,EAC5D,QAAO;AAET,SAAO,gBAAgB,eAAe;IACrC,CAAC,eAAe,CAAC;AAGpB,KAAI,UAAU,QAAQ,QAAQ,SAC5B,WAAU,UAAU;EAAE,KAAK;EAAU,QAAQ;EAAgB;CAK/D,MAAM,kBAAoC,cAAc;EACtD,MAAM,gBAAgB,UAAU,QAAQ;AACxC,MAAI,CAAC,YAAY,CAAC,cAChB,QAAO,EAAE;EAIX,IAAI,WAAW,oBACb,cACD;AAKD,MAAI,sBAAsB,SAAS,CACjC,YAAW,4BAA4B,SAAS;EAIlD,MAAM,SAA2B,EAAE;AAEnC,OAAK,MAAM,CAAC,WAAW,mBAAmB,UAAU;GAClD,MAAM,QAAQ,aAAa,eAAe,WAAW,eAAe;AACpE,OAAI,MACF,QAAO,KAAK,MAAM;;AAItB,SAAO;IACN,CAAC,SAAS,CAAC;AAGd,0BAAyB;AAEvB,aAAW,QAAQ,SAAS,YAAY,WAAW,CAAC;AACpD,aAAW,UAAU,EAAE;AAGvB,MAAI,gBAAgB,WAAW,EAC7B;EAGF,MAAM,gBAAgB,UAAU,QAAQ;EAGxC,MAAM,gBAAgB,gBAClB,iBAAiB,cAAc,GAC/B;EAGJ,IAAI,UAAsC;AAE1C,MAAI,eAAe;AACjB,6BAAU,IAAI,KAAK;AACnB,QAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,cAAc,EAAE;IACzD,MAAM,SAAS,UAAU,OAAO,EAAE,MAAM,CAAC;IACzC,MAAM,eAAe,OAAO,UAAU;AAEtC,QAAI,iBAAiB,KACnB,SAAQ,IAAI,MAAM,aAAa;AAEjC,eAAW,QAAQ,KAAK,OAAO,QAAQ;;AAGzC,OAAI,QAAQ,SAAS,EACnB,WAAU;;AAQd,MAAI,iBAAiB,mBAAmB,cAAc,EAAE;GACtD,MAAM,kBAAkB,uBAAuB,cAAc;AAC7D,OAAI,gBACF,MAAK,MAAM,CAAC,OAAO,eAAe,OAAO,QAAQ,gBAAgB,CAE/D,UAAS,OAAO,WAAW;;AAMjC,OAAK,MAAM,SAAS,gBAClB,KAAI,MAAM,aAAa,MAAM,SAAS,GAAG;GASvC,MAAM,EAAE,YAAY,OAPE,UAClB,MAAM,aAAa,MAAM,KAAK,UAAU;IACtC,GAAG;IACH,cAAc,sBAAsB,KAAK,cAAc,QAAS;IACjE,EAAE,GACH,MAAM,aAAa,OAEmB,EACxC,UAAU,MAAM,UACjB,CAAC;AACF,cAAW,QAAQ,KAAK,QAAQ;;AAIpC,eAAa;AACX,cAAW,QAAQ,SAAS,YAAY,WAAW,CAAC;AACpD,cAAW,UAAU,EAAE;;IAExB,CAAC,gBAAgB,CAAC;AAOrB,QAAO,EACL,WALgB,cAAc;AAC9B,SAAO,gBAAgB,KAAK,UAAU,MAAM,UAAU,CAAC,KAAK,IAAI;IAC/D,CAAC,gBAAgB,CAAC,EAIpB"}
|
package/dist/tasty/index.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { AtRuleContext, ParsedAdvancedState, StateParserContext, getGlobalPredefinedStates, setGlobalPredefinedStates } from "./states/index.js";
|
|
3
|
-
import { COMPUTE_FUNC_MAP, CSSMap, CUSTOM_UNITS, ComputeModel, DIRECTIONS, ParsedColor, RawStyleHandler, STATE_OPERATORS, STATE_OPERATOR_LIST, StyleHandler, StyleHandlerDefinition, StyleHandlerResult, StyleMap, StylePropValue, StyleStateData, StyleStateDataList, StyleStateDataListMap, StyleStateMap, StyleValue, StyleValueStateMap, buildAtRuleContext, computeState, customFunc, extendStyles, extractStyles, filterMods, getGlobalFuncs, getGlobalParser, getGlobalPredefinedTokens, getModSelector, getRgbValuesFromRgbaString, hexToRgb, isAdvancedStateToken, normalizeColorTokenValue, parseColor, parseStateNotation, parseStyle, resetGlobalPredefinedTokens, setGlobalPredefinedTokens, strToRgb, stringifyStyles, styleStateMapToStyleStateDataList } from "./utils/styles.js";
|
|
4
|
-
import { NoType, NotSelector, RecipeStyles, Selector, Styles, StylesInterface, StylesWithoutSelectors, SuffixForSelector, TastyNamedColors, TastyPresetNames } from "./styles/types.js";
|
|
5
|
-
import { RenderResult, StyleResult, isSelector, renderStyles } from "./pipeline/index.js";
|
|
6
|
-
import { CacheMetrics, DisposeFunction, InjectResult, KeyframesCacheEntry, KeyframesInfo, KeyframesResult, KeyframesSteps, PropertyDefinition, RawCSSResult, RootRegistry, RuleInfo, SheetInfo, StyleInjectorConfig, StyleRule } from "./injector/types.js";
|
|
7
|
-
import { StyleInjector } from "./injector/injector.js";
|
|
8
|
-
import { SheetManager } from "./injector/sheet-manager.js";
|
|
9
|
-
import { PropertyOptions, allocateClassName, cleanup, createInjector, destroy, getCssText, getCssTextForNode, getIsTestEnvironment, getRawCSSText, inject, injectGlobal, injectRawCSS, injector, isPropertyDefined, keyframes, property } from "./injector/index.js";
|
|
10
|
-
import { BASE_STYLES, BLOCK_INNER_STYLES, BLOCK_OUTER_STYLES, BLOCK_STYLES, COLOR_STYLES, CONTAINER_STYLES, DIMENSION_STYLES, FLOW_STYLES, INNER_STYLES, OUTER_STYLES, POSITION_STYLES, TEXT_STYLES } from "./styles/list.js";
|
|
11
|
-
import { AllBaseProps, BaseProps, BasePropsWithoutChildren, BaseStyleProps, BlockInnerStyleProps, BlockOuterStyleProps, BlockStyleProps, ColorStyleProps, ContainerStyleProps, DimensionStyleProps, FlowStyleProps, GlobalStyledProps, ModValue, Mods, OuterStyleProps, PositionStyleProps, Props, ShortGridStyles, TagName, TastyExtensionConfig, TastyThemeNames, TextStyleProps, TokenValue, Tokens } from "./types.js";
|
|
12
|
-
import { AllBasePropsWithMods, Element, ElementsDefinition, SubElementDefinition, SubElementProps, TastyElementOptions, TastyElementProps, TastyProps, tasty } from "./tasty.js";
|
|
13
|
-
import { UseStylesOptions, UseStylesResult, useStyles } from "./hooks/useStyles.js";
|
|
14
|
-
import { useGlobalStyles } from "./hooks/useGlobalStyles.js";
|
|
15
|
-
import { useRawCSS } from "./hooks/useRawCSS.js";
|
|
16
|
-
import { useKeyframes } from "./hooks/useKeyframes.js";
|
|
17
|
-
import { UsePropertyOptions, useProperty } from "./hooks/useProperty.js";
|
|
18
|
-
import { TastyPlugin, TastyPluginFactory } from "./plugins/types.js";
|
|
19
|
-
import { TastyConfig, configure, getConfig, getGlobalKeyframes, getGlobalRecipes, hasGlobalKeyframes, hasGlobalRecipes, hasStylesGenerated, isConfigLocked, isTestEnvironment, resetConfig } from "./config.js";
|
|
20
|
-
import { okhslFunc, okhslPlugin } from "./plugins/okhsl-plugin.js";
|
|
21
|
-
import { CHUNK_NAMES, ChunkInfo, ChunkName, STYLE_TO_CHUNK, categorizeStyleKeys } from "./chunks/definitions.js";
|
|
22
|
-
import { filterBaseProps } from "./utils/filter-base-props.js";
|
|
23
|
-
import { color } from "./utils/colors.js";
|
|
24
|
-
import { _modAttrs } from "./utils/mod-attrs.js";
|
|
25
|
-
import { styleHandlers } from "./styles/predefined.js";
|
|
26
|
-
import "./styles/index.js";
|
|
27
|
-
import { dotize } from "./utils/dotize.js";
|
|
28
|
-
import { mergeStyles } from "./utils/merge-styles.js";
|
|
29
|
-
import { resolveRecipes } from "./utils/resolve-recipes.js";
|
|
30
|
-
import { deprecationWarning, warn } from "./utils/warnings.js";
|
|
31
|
-
import { getDisplayName } from "./utils/get-display-name.js";
|
|
32
|
-
import { hslToRgbValues, processTokens, stringifyTokens } from "./utils/process-tokens.js";
|
|
33
|
-
import { TypographyPreset } from "../tokens/typography.js";
|
|
34
|
-
import { generateTypographyTokens } from "./utils/typography.js";
|
|
35
|
-
import { tastyDebug } from "./debug.js";
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { StyleResult } from "../pipeline/index.js";
|
|
3
|
-
import { CacheMetrics, DisposeFunction, GlobalInjectResult, InjectResult, KeyframesCacheEntry, KeyframesInfo, KeyframesResult, KeyframesSteps, PropertyDefinition, RawCSSResult, RootRegistry, RuleInfo, SheetInfo, StyleInjectorConfig, StyleRule } from "./types.js";
|
|
4
|
-
import { StyleInjector } from "./injector.js";
|
|
5
|
-
import { SheetManager } from "./sheet-manager.js";
|
|
6
|
-
|
|
7
|
-
//#region src/tasty/injector/index.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* Allocate a className for a cacheKey without injecting styles yet
|
|
10
|
-
*/
|
|
11
|
-
declare function allocateClassName(cacheKey: string, options?: {
|
|
12
|
-
root?: Document | ShadowRoot;
|
|
13
|
-
}): {
|
|
14
|
-
className: string;
|
|
15
|
-
isNewAllocation: boolean;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Inject styles and return className with dispose function
|
|
19
|
-
*/
|
|
20
|
-
declare function inject(rules: StyleResult[], options?: {
|
|
21
|
-
root?: Document | ShadowRoot;
|
|
22
|
-
cacheKey?: string;
|
|
23
|
-
}): InjectResult;
|
|
24
|
-
/**
|
|
25
|
-
* Inject global rules that should not reserve tasty class names
|
|
26
|
-
*/
|
|
27
|
-
declare function injectGlobal(rules: StyleResult[], options?: {
|
|
28
|
-
root?: Document | ShadowRoot;
|
|
29
|
-
}): GlobalInjectResult;
|
|
30
|
-
/**
|
|
31
|
-
* Inject raw CSS text directly without parsing
|
|
32
|
-
* This is a low-overhead method for injecting raw CSS that doesn't need tasty processing.
|
|
33
|
-
* The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking.
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```tsx
|
|
37
|
-
* // Inject raw CSS
|
|
38
|
-
* const { dispose } = injectRawCSS(`
|
|
39
|
-
* body { margin: 0; padding: 0; }
|
|
40
|
-
* .my-class { color: red; }
|
|
41
|
-
* `);
|
|
42
|
-
*
|
|
43
|
-
* // Later, remove the injected CSS
|
|
44
|
-
* dispose();
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
declare function injectRawCSS(css: string, options?: {
|
|
48
|
-
root?: Document | ShadowRoot;
|
|
49
|
-
}): {
|
|
50
|
-
dispose: () => void;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Get raw CSS text for SSR
|
|
54
|
-
*/
|
|
55
|
-
declare function getRawCSSText(options?: {
|
|
56
|
-
root?: Document | ShadowRoot;
|
|
57
|
-
}): string;
|
|
58
|
-
/**
|
|
59
|
-
* Inject keyframes and return object with toString() and dispose()
|
|
60
|
-
*/
|
|
61
|
-
declare function keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
|
|
62
|
-
root?: Document | ShadowRoot;
|
|
63
|
-
name?: string;
|
|
64
|
-
}): KeyframesResult;
|
|
65
|
-
interface PropertyOptions {
|
|
66
|
-
/**
|
|
67
|
-
* CSS syntax string for the property (e.g., '<color>', '<length>', '<angle>')
|
|
68
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax
|
|
69
|
-
*/
|
|
70
|
-
syntax?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Whether the property inherits from parent elements
|
|
73
|
-
* @default true
|
|
74
|
-
*/
|
|
75
|
-
inherits?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Initial value for the property
|
|
78
|
-
*/
|
|
79
|
-
initialValue?: string | number;
|
|
80
|
-
/**
|
|
81
|
-
* Shadow root or document to inject into
|
|
82
|
-
*/
|
|
83
|
-
root?: Document | ShadowRoot;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Define a CSS @property custom property.
|
|
87
|
-
* This enables advanced features like animating custom properties.
|
|
88
|
-
*
|
|
89
|
-
* Note: @property rules are global and persistent once defined.
|
|
90
|
-
* Re-registering the same property name is a no-op.
|
|
91
|
-
*
|
|
92
|
-
* @param name - The custom property name (must start with --)
|
|
93
|
-
* @param options - Property configuration
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```ts
|
|
97
|
-
* // Define a color property that can be animated
|
|
98
|
-
* property('--my-color', {
|
|
99
|
-
* syntax: '<color>',
|
|
100
|
-
* initialValue: 'red',
|
|
101
|
-
* });
|
|
102
|
-
*
|
|
103
|
-
* // Define an angle property
|
|
104
|
-
* property('--rotation', {
|
|
105
|
-
* syntax: '<angle>',
|
|
106
|
-
* inherits: false,
|
|
107
|
-
* initialValue: '0deg',
|
|
108
|
-
* });
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
declare function property(name: string, options?: PropertyOptions): void;
|
|
112
|
-
/**
|
|
113
|
-
* Check if a CSS @property has already been defined
|
|
114
|
-
*
|
|
115
|
-
* @param name - The custom property name to check
|
|
116
|
-
* @param options - Options including root
|
|
117
|
-
*/
|
|
118
|
-
declare function isPropertyDefined(name: string, options?: {
|
|
119
|
-
root?: Document | ShadowRoot;
|
|
120
|
-
}): boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Get CSS text from all sheets (for SSR)
|
|
123
|
-
*/
|
|
124
|
-
declare function getCssText(options?: {
|
|
125
|
-
root?: Document | ShadowRoot;
|
|
126
|
-
}): string;
|
|
127
|
-
/**
|
|
128
|
-
* Collect only CSS used by a rendered subtree (like jest-styled-components).
|
|
129
|
-
* Pass the container returned by render(...).
|
|
130
|
-
*/
|
|
131
|
-
declare function getCssTextForNode(node: ParentNode | Element | DocumentFragment, options?: {
|
|
132
|
-
root?: Document | ShadowRoot;
|
|
133
|
-
}): string;
|
|
134
|
-
/**
|
|
135
|
-
* Force cleanup of unused rules
|
|
136
|
-
*/
|
|
137
|
-
declare function cleanup(root?: Document | ShadowRoot): void;
|
|
138
|
-
/**
|
|
139
|
-
* Check if we're currently running in a test environment
|
|
140
|
-
*/
|
|
141
|
-
declare function getIsTestEnvironment(): boolean;
|
|
142
|
-
/**
|
|
143
|
-
* Get the global injector instance for debugging
|
|
144
|
-
*/
|
|
145
|
-
declare const injector: {
|
|
146
|
-
readonly instance: StyleInjector;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Destroy all resources and clean up
|
|
150
|
-
*/
|
|
151
|
-
declare function destroy(root?: Document | ShadowRoot): void;
|
|
152
|
-
/**
|
|
153
|
-
* Create a new isolated injector instance
|
|
154
|
-
*/
|
|
155
|
-
declare function createInjector(config?: Partial<StyleInjectorConfig>): StyleInjector;
|
|
156
|
-
//#endregion
|
|
157
|
-
export { PropertyOptions, allocateClassName, cleanup, createInjector, destroy, getCssText, getCssTextForNode, getIsTestEnvironment, getRawCSSText, inject, injectGlobal, injectRawCSS, injector, isPropertyDefined, keyframes, property };
|
|
158
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.118.0 | Cube Dev Team */
|
|
2
|
-
import { SheetManager } from "./sheet-manager.js";
|
|
3
|
-
import { StyleInjector } from "./injector.js";
|
|
4
|
-
import { getConfig, getGlobalInjector, isTestEnvironment, markStylesGenerated } from "../config.js";
|
|
5
|
-
|
|
6
|
-
//#region src/tasty/injector/index.ts
|
|
7
|
-
/**
|
|
8
|
-
* Allocate a className for a cacheKey without injecting styles yet
|
|
9
|
-
*/
|
|
10
|
-
function allocateClassName(cacheKey, options) {
|
|
11
|
-
return getGlobalInjector().allocateClassName(cacheKey, options);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Inject styles and return className with dispose function
|
|
15
|
-
*/
|
|
16
|
-
function inject(rules, options) {
|
|
17
|
-
markStylesGenerated();
|
|
18
|
-
return getGlobalInjector().inject(rules, options);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Inject global rules that should not reserve tasty class names
|
|
22
|
-
*/
|
|
23
|
-
function injectGlobal(rules, options) {
|
|
24
|
-
return getGlobalInjector().injectGlobal(rules, options);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Inject raw CSS text directly without parsing
|
|
28
|
-
* This is a low-overhead method for injecting raw CSS that doesn't need tasty processing.
|
|
29
|
-
* The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* // Inject raw CSS
|
|
34
|
-
* const { dispose } = injectRawCSS(`
|
|
35
|
-
* body { margin: 0; padding: 0; }
|
|
36
|
-
* .my-class { color: red; }
|
|
37
|
-
* `);
|
|
38
|
-
*
|
|
39
|
-
* // Later, remove the injected CSS
|
|
40
|
-
* dispose();
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
function injectRawCSS(css, options) {
|
|
44
|
-
return getGlobalInjector().injectRawCSS(css, options);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Get raw CSS text for SSR
|
|
48
|
-
*/
|
|
49
|
-
function getRawCSSText(options) {
|
|
50
|
-
return getGlobalInjector().getRawCSSText(options);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Inject keyframes and return object with toString() and dispose()
|
|
54
|
-
*/
|
|
55
|
-
function keyframes(steps, nameOrOptions) {
|
|
56
|
-
return getGlobalInjector().keyframes(steps, nameOrOptions);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Define a CSS @property custom property.
|
|
60
|
-
* This enables advanced features like animating custom properties.
|
|
61
|
-
*
|
|
62
|
-
* Note: @property rules are global and persistent once defined.
|
|
63
|
-
* Re-registering the same property name is a no-op.
|
|
64
|
-
*
|
|
65
|
-
* @param name - The custom property name (must start with --)
|
|
66
|
-
* @param options - Property configuration
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* // Define a color property that can be animated
|
|
71
|
-
* property('--my-color', {
|
|
72
|
-
* syntax: '<color>',
|
|
73
|
-
* initialValue: 'red',
|
|
74
|
-
* });
|
|
75
|
-
*
|
|
76
|
-
* // Define an angle property
|
|
77
|
-
* property('--rotation', {
|
|
78
|
-
* syntax: '<angle>',
|
|
79
|
-
* inherits: false,
|
|
80
|
-
* initialValue: '0deg',
|
|
81
|
-
* });
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
function property(name, options) {
|
|
85
|
-
return getGlobalInjector().property(name, options);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Check if a CSS @property has already been defined
|
|
89
|
-
*
|
|
90
|
-
* @param name - The custom property name to check
|
|
91
|
-
* @param options - Options including root
|
|
92
|
-
*/
|
|
93
|
-
function isPropertyDefined(name, options) {
|
|
94
|
-
return getGlobalInjector().isPropertyDefined(name, options);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get CSS text from all sheets (for SSR)
|
|
98
|
-
*/
|
|
99
|
-
function getCssText(options) {
|
|
100
|
-
return getGlobalInjector().getCssText(options);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Collect only CSS used by a rendered subtree (like jest-styled-components).
|
|
104
|
-
* Pass the container returned by render(...).
|
|
105
|
-
*/
|
|
106
|
-
function getCssTextForNode(node, options) {
|
|
107
|
-
const classSet = /* @__PURE__ */ new Set();
|
|
108
|
-
const readClasses = (el) => {
|
|
109
|
-
const cls = el.getAttribute("class");
|
|
110
|
-
if (!cls) return;
|
|
111
|
-
for (const token of cls.split(/\s+/)) if (/^t\d+$/.test(token)) classSet.add(token);
|
|
112
|
-
};
|
|
113
|
-
if (node.getAttribute) readClasses(node);
|
|
114
|
-
const elements = node.querySelectorAll ? node.querySelectorAll("[class]") : [];
|
|
115
|
-
elements && elements.forEach(readClasses);
|
|
116
|
-
return getGlobalInjector().getCssTextForClasses(classSet, options);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Force cleanup of unused rules
|
|
120
|
-
*/
|
|
121
|
-
function cleanup(root) {
|
|
122
|
-
return getGlobalInjector().cleanup(root);
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Check if we're currently running in a test environment
|
|
126
|
-
*/
|
|
127
|
-
function getIsTestEnvironment() {
|
|
128
|
-
return isTestEnvironment();
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Get the global injector instance for debugging
|
|
132
|
-
*/
|
|
133
|
-
const injector = { get instance() {
|
|
134
|
-
return getGlobalInjector();
|
|
135
|
-
} };
|
|
136
|
-
/**
|
|
137
|
-
* Destroy all resources and clean up
|
|
138
|
-
*/
|
|
139
|
-
function destroy(root) {
|
|
140
|
-
return getGlobalInjector().destroy(root);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Create a new isolated injector instance
|
|
144
|
-
*/
|
|
145
|
-
function createInjector(config = {}) {
|
|
146
|
-
return new StyleInjector({
|
|
147
|
-
...getConfig(),
|
|
148
|
-
forceTextInjection: config.forceTextInjection ?? isTestEnvironment(),
|
|
149
|
-
...config
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
//#endregion
|
|
154
|
-
export { allocateClassName, cleanup, createInjector, destroy, getCssText, getCssTextForNode, getIsTestEnvironment, getRawCSSText, inject, injectGlobal, injectRawCSS, injector, isPropertyDefined, keyframes, property };
|
|
155
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/tasty/injector/index.ts"],"sourcesContent":["import {\n getConfig,\n getGlobalInjector,\n isTestEnvironment,\n markStylesGenerated,\n} from '../config';\nimport { StyleResult } from '../pipeline';\n\nimport { StyleInjector } from './injector';\nimport {\n DisposeFunction,\n GlobalInjectResult,\n InjectResult,\n StyleInjectorConfig,\n} from './types';\n\n/**\n * Allocate a className for a cacheKey without injecting styles yet\n */\nexport function allocateClassName(\n cacheKey: string,\n options?: { root?: Document | ShadowRoot },\n): { className: string; isNewAllocation: boolean } {\n return getGlobalInjector().allocateClassName(cacheKey, options);\n}\n\n/**\n * Inject styles and return className with dispose function\n */\nexport function inject(\n rules: StyleResult[],\n options?: { root?: Document | ShadowRoot; cacheKey?: string },\n): InjectResult {\n // Mark that styles have been generated (prevents configuration changes)\n markStylesGenerated();\n\n return getGlobalInjector().inject(rules, options);\n}\n\n/**\n * Inject global rules that should not reserve tasty class names\n */\nexport function injectGlobal(\n rules: StyleResult[],\n options?: { root?: Document | ShadowRoot },\n): GlobalInjectResult {\n return getGlobalInjector().injectGlobal(rules, options);\n}\n\n/**\n * Inject raw CSS text directly without parsing\n * This is a low-overhead method for injecting raw CSS that doesn't need tasty processing.\n * The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking.\n *\n * @example\n * ```tsx\n * // Inject raw CSS\n * const { dispose } = injectRawCSS(`\n * body { margin: 0; padding: 0; }\n * .my-class { color: red; }\n * `);\n *\n * // Later, remove the injected CSS\n * dispose();\n * ```\n */\nexport function injectRawCSS(\n css: string,\n options?: { root?: Document | ShadowRoot },\n): { dispose: () => void } {\n return getGlobalInjector().injectRawCSS(css, options);\n}\n\n/**\n * Get raw CSS text for SSR\n */\nexport function getRawCSSText(options?: {\n root?: Document | ShadowRoot;\n}): string {\n return getGlobalInjector().getRawCSSText(options);\n}\n\n/**\n * Inject keyframes and return object with toString() and dispose()\n */\nexport function keyframes(\n steps: import('./types').KeyframesSteps,\n nameOrOptions?: string | { root?: Document | ShadowRoot; name?: string },\n): import('./types').KeyframesResult {\n return getGlobalInjector().keyframes(steps, nameOrOptions);\n}\n\nexport interface PropertyOptions {\n /**\n * CSS syntax string for the property (e.g., '<color>', '<length>', '<angle>')\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@property/syntax\n */\n syntax?: string;\n /**\n * Whether the property inherits from parent elements\n * @default true\n */\n inherits?: boolean;\n /**\n * Initial value for the property\n */\n initialValue?: string | number;\n /**\n * Shadow root or document to inject into\n */\n root?: Document | ShadowRoot;\n}\n\n/**\n * Define a CSS @property custom property.\n * This enables advanced features like animating custom properties.\n *\n * Note: @property rules are global and persistent once defined.\n * Re-registering the same property name is a no-op.\n *\n * @param name - The custom property name (must start with --)\n * @param options - Property configuration\n *\n * @example\n * ```ts\n * // Define a color property that can be animated\n * property('--my-color', {\n * syntax: '<color>',\n * initialValue: 'red',\n * });\n *\n * // Define an angle property\n * property('--rotation', {\n * syntax: '<angle>',\n * inherits: false,\n * initialValue: '0deg',\n * });\n * ```\n */\nexport function property(name: string, options?: PropertyOptions): void {\n return getGlobalInjector().property(name, options);\n}\n\n/**\n * Check if a CSS @property has already been defined\n *\n * @param name - The custom property name to check\n * @param options - Options including root\n */\nexport function isPropertyDefined(\n name: string,\n options?: { root?: Document | ShadowRoot },\n): boolean {\n return getGlobalInjector().isPropertyDefined(name, options);\n}\n\n/**\n * Get CSS text from all sheets (for SSR)\n */\nexport function getCssText(options?: { root?: Document | ShadowRoot }): string {\n return getGlobalInjector().getCssText(options);\n}\n\n/**\n * Collect only CSS used by a rendered subtree (like jest-styled-components).\n * Pass the container returned by render(...).\n */\nexport function getCssTextForNode(\n node: ParentNode | Element | DocumentFragment,\n options?: { root?: Document | ShadowRoot },\n): string {\n // Collect tasty-generated class names (t<number>) from the subtree\n const classSet = new Set<string>();\n\n const readClasses = (el: Element) => {\n const cls = el.getAttribute('class');\n if (!cls) return;\n for (const token of cls.split(/\\s+/)) {\n if (/^t\\d+$/.test(token)) classSet.add(token);\n }\n };\n\n // Include node itself if it's an Element\n if ((node as Element).getAttribute) {\n readClasses(node as Element);\n }\n // Walk descendants\n const elements = (node as ParentNode).querySelectorAll\n ? (node as ParentNode).querySelectorAll('[class]')\n : ([] as unknown as NodeListOf<Element>);\n elements && elements.forEach(readClasses);\n\n return getGlobalInjector().getCssTextForClasses(classSet, options);\n}\n\n/**\n * Force cleanup of unused rules\n */\nexport function cleanup(root?: Document | ShadowRoot): void {\n return getGlobalInjector().cleanup(root);\n}\n\n/**\n * Check if we're currently running in a test environment\n */\nexport function getIsTestEnvironment(): boolean {\n return isTestEnvironment();\n}\n\n/**\n * Get the global injector instance for debugging\n */\nexport const injector = {\n get instance() {\n return getGlobalInjector();\n },\n};\n\n/**\n * Destroy all resources and clean up\n */\nexport function destroy(root?: Document | ShadowRoot): void {\n return getGlobalInjector().destroy(root);\n}\n\n/**\n * Create a new isolated injector instance\n */\nexport function createInjector(\n config: Partial<StyleInjectorConfig> = {},\n): StyleInjector {\n const defaultConfig = getConfig();\n\n const fullConfig: StyleInjectorConfig = {\n ...defaultConfig,\n // Auto-enable forceTextInjection in test environments\n forceTextInjection: config.forceTextInjection ?? isTestEnvironment(),\n ...config,\n };\n\n return new StyleInjector(fullConfig);\n}\n\n// Re-export types\nexport type {\n StyleInjectorConfig,\n InjectResult,\n DisposeFunction,\n RuleInfo,\n SheetInfo,\n RootRegistry,\n StyleRule,\n KeyframesInfo,\n KeyframesResult,\n KeyframesSteps,\n KeyframesCacheEntry,\n CacheMetrics,\n RawCSSResult,\n PropertyDefinition,\n} from './types';\n\nexport { StyleInjector } from './injector';\nexport { SheetManager } from './sheet-manager';\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,kBACd,UACA,SACiD;AACjD,QAAO,mBAAmB,CAAC,kBAAkB,UAAU,QAAQ;;;;;AAMjE,SAAgB,OACd,OACA,SACc;AAEd,sBAAqB;AAErB,QAAO,mBAAmB,CAAC,OAAO,OAAO,QAAQ;;;;;AAMnD,SAAgB,aACd,OACA,SACoB;AACpB,QAAO,mBAAmB,CAAC,aAAa,OAAO,QAAQ;;;;;;;;;;;;;;;;;;;AAoBzD,SAAgB,aACd,KACA,SACyB;AACzB,QAAO,mBAAmB,CAAC,aAAa,KAAK,QAAQ;;;;;AAMvD,SAAgB,cAAc,SAEnB;AACT,QAAO,mBAAmB,CAAC,cAAc,QAAQ;;;;;AAMnD,SAAgB,UACd,OACA,eACmC;AACnC,QAAO,mBAAmB,CAAC,UAAU,OAAO,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkD5D,SAAgB,SAAS,MAAc,SAAiC;AACtE,QAAO,mBAAmB,CAAC,SAAS,MAAM,QAAQ;;;;;;;;AASpD,SAAgB,kBACd,MACA,SACS;AACT,QAAO,mBAAmB,CAAC,kBAAkB,MAAM,QAAQ;;;;;AAM7D,SAAgB,WAAW,SAAoD;AAC7E,QAAO,mBAAmB,CAAC,WAAW,QAAQ;;;;;;AAOhD,SAAgB,kBACd,MACA,SACQ;CAER,MAAM,2BAAW,IAAI,KAAa;CAElC,MAAM,eAAe,OAAgB;EACnC,MAAM,MAAM,GAAG,aAAa,QAAQ;AACpC,MAAI,CAAC,IAAK;AACV,OAAK,MAAM,SAAS,IAAI,MAAM,MAAM,CAClC,KAAI,SAAS,KAAK,MAAM,CAAE,UAAS,IAAI,MAAM;;AAKjD,KAAK,KAAiB,aACpB,aAAY,KAAgB;CAG9B,MAAM,WAAY,KAAoB,mBACjC,KAAoB,iBAAiB,UAAU,GAC/C,EAAE;AACP,aAAY,SAAS,QAAQ,YAAY;AAEzC,QAAO,mBAAmB,CAAC,qBAAqB,UAAU,QAAQ;;;;;AAMpE,SAAgB,QAAQ,MAAoC;AAC1D,QAAO,mBAAmB,CAAC,QAAQ,KAAK;;;;;AAM1C,SAAgB,uBAAgC;AAC9C,QAAO,mBAAmB;;;;;AAM5B,MAAa,WAAW,EACtB,IAAI,WAAW;AACb,QAAO,mBAAmB;GAE7B;;;;AAKD,SAAgB,QAAQ,MAAoC;AAC1D,QAAO,mBAAmB,CAAC,QAAQ,KAAK;;;;;AAM1C,SAAgB,eACd,SAAuC,EAAE,EAC1B;AAUf,QAAO,IAAI,cAP6B;EACtC,GAHoB,WAAW;EAK/B,oBAAoB,OAAO,sBAAsB,mBAAmB;EACpE,GAAG;EACJ,CAEmC"}
|