@cube-dev/ui-kit 0.117.0 → 0.119.0
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 +32 -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 -57
- 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.d.ts +1 -1
- package/dist/components/actions/Banner/Banner.js +5 -5
- package/dist/components/actions/Banner/Banner.js.map +1 -1
- package/dist/components/actions/Button/Button.d.ts +2 -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 +2 -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 +1 -1
- 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.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 +2 -2
- package/dist/components/overlays/Notifications/Notification.js.map +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +10 -4
- package/dist/components/overlays/Notifications/NotificationAction.js.map +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.d.ts +5 -2
- package/dist/components/overlays/Notifications/NotificationCard.js +9 -7
- package/dist/components/overlays/Notifications/NotificationCard.js.map +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.d.ts +3 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +8 -7
- package/dist/components/overlays/Notifications/NotificationItem.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +6 -5
- package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +2 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js.map +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +3 -3
- 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/types.d.ts +4 -2
- package/dist/components/overlays/Notifications/use-notification-state.js +48 -2
- package/dist/components/overlays/Notifications/use-notification-state.js.map +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 +8 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js.map +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/types.d.ts +2 -0
- package/dist/components/overlays/Toast/useProgressToast.js +49 -21
- package/dist/components/overlays/Toast/useProgressToast.js.map +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.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +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.d.ts +0 -2
- 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/index.d.ts +0 -4
- package/dist/tasty/chunks/renderChunk.d.ts +0 -3
- 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/index.d.ts +0 -6
- 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 -38
- 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.d.ts +0 -2
- 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 -54
- 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.d.ts +0 -2
- 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/index.d.ts +0 -3
- 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 -46
- 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 -75
- 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 -937
- 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,378 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.117.0 | Cube Dev Team */
|
|
2
|
-
//#region src/tasty/pipeline/conditions.ts
|
|
3
|
-
/**
|
|
4
|
-
* Create a TRUE condition (matches everything)
|
|
5
|
-
*/
|
|
6
|
-
function trueCondition() {
|
|
7
|
-
return { kind: "true" };
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Create a FALSE condition (matches nothing)
|
|
11
|
-
*/
|
|
12
|
-
function falseCondition() {
|
|
13
|
-
return { kind: "false" };
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Create an AND compound condition
|
|
17
|
-
*/
|
|
18
|
-
function and(...children) {
|
|
19
|
-
const filtered = [];
|
|
20
|
-
for (const child of children) {
|
|
21
|
-
if (child.kind === "false") return falseCondition();
|
|
22
|
-
if (child.kind === "true") continue;
|
|
23
|
-
if (child.kind === "compound" && child.operator === "AND") filtered.push(...child.children);
|
|
24
|
-
else filtered.push(child);
|
|
25
|
-
}
|
|
26
|
-
if (filtered.length === 0) return trueCondition();
|
|
27
|
-
if (filtered.length === 1) return filtered[0];
|
|
28
|
-
return {
|
|
29
|
-
kind: "compound",
|
|
30
|
-
operator: "AND",
|
|
31
|
-
children: filtered
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Create an OR compound condition
|
|
36
|
-
*/
|
|
37
|
-
function or(...children) {
|
|
38
|
-
const filtered = [];
|
|
39
|
-
for (const child of children) {
|
|
40
|
-
if (child.kind === "true") return trueCondition();
|
|
41
|
-
if (child.kind === "false") continue;
|
|
42
|
-
if (child.kind === "compound" && child.operator === "OR") filtered.push(...child.children);
|
|
43
|
-
else filtered.push(child);
|
|
44
|
-
}
|
|
45
|
-
if (filtered.length === 0) return falseCondition();
|
|
46
|
-
if (filtered.length === 1) return filtered[0];
|
|
47
|
-
return {
|
|
48
|
-
kind: "compound",
|
|
49
|
-
operator: "OR",
|
|
50
|
-
children: filtered
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Negate a condition
|
|
55
|
-
*/
|
|
56
|
-
function not(node) {
|
|
57
|
-
if (node.kind === "true") return falseCondition();
|
|
58
|
-
if (node.kind === "false") return trueCondition();
|
|
59
|
-
if (node.kind === "state") return {
|
|
60
|
-
...node,
|
|
61
|
-
negated: !node.negated,
|
|
62
|
-
uniqueId: node.negated ? node.uniqueId.replace(/^!/, "") : `!${node.uniqueId}`
|
|
63
|
-
};
|
|
64
|
-
if (node.kind === "compound" && node.operator === "AND") return or(...node.children.map((c) => not(c)));
|
|
65
|
-
if (node.kind === "compound" && node.operator === "OR") return and(...node.children.map((c) => not(c)));
|
|
66
|
-
return node;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Check if a condition is a compound condition
|
|
70
|
-
*/
|
|
71
|
-
function isCompoundCondition(node) {
|
|
72
|
-
return node.kind === "compound";
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Generate a normalized unique ID for a modifier condition
|
|
76
|
-
*/
|
|
77
|
-
function modifierUniqueId(attribute, value, operator = "=", negated = false) {
|
|
78
|
-
const base = value ? `mod:${attribute}${operator}${value}` : `mod:${attribute}`;
|
|
79
|
-
return negated ? `!${base}` : base;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Generate a normalized unique ID for a pseudo condition
|
|
83
|
-
*/
|
|
84
|
-
function pseudoUniqueId(pseudo, negated = false) {
|
|
85
|
-
const base = `pseudo:${pseudo}`;
|
|
86
|
-
return negated ? `!${base}` : base;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Generate a normalized unique ID for a media condition
|
|
90
|
-
*/
|
|
91
|
-
function mediaUniqueId(subtype, props, negated = false) {
|
|
92
|
-
let base;
|
|
93
|
-
if (subtype === "dimension") {
|
|
94
|
-
const parts = [
|
|
95
|
-
"media",
|
|
96
|
-
"dim",
|
|
97
|
-
props.dimension
|
|
98
|
-
];
|
|
99
|
-
if (props.lowerBound) {
|
|
100
|
-
parts.push(props.lowerBound.inclusive ? ">=" : ">");
|
|
101
|
-
parts.push(props.lowerBound.value);
|
|
102
|
-
}
|
|
103
|
-
if (props.upperBound) {
|
|
104
|
-
parts.push(props.upperBound.inclusive ? "<=" : "<");
|
|
105
|
-
parts.push(props.upperBound.value);
|
|
106
|
-
}
|
|
107
|
-
base = parts.join(":");
|
|
108
|
-
} else if (subtype === "feature") base = props.featureValue ? `media:feat:${props.feature}:${props.featureValue}` : `media:feat:${props.feature}`;
|
|
109
|
-
else base = `media:type:${props.mediaType}`;
|
|
110
|
-
return negated ? `!${base}` : base;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Generate a normalized unique ID for a container condition
|
|
114
|
-
*/
|
|
115
|
-
function containerUniqueId(subtype, props, negated = false) {
|
|
116
|
-
let base;
|
|
117
|
-
const name = props.containerName || "_";
|
|
118
|
-
if (subtype === "dimension") {
|
|
119
|
-
const parts = [
|
|
120
|
-
"container",
|
|
121
|
-
"dim",
|
|
122
|
-
name,
|
|
123
|
-
props.dimension
|
|
124
|
-
];
|
|
125
|
-
if (props.lowerBound) {
|
|
126
|
-
parts.push(props.lowerBound.inclusive ? ">=" : ">");
|
|
127
|
-
parts.push(props.lowerBound.value);
|
|
128
|
-
}
|
|
129
|
-
if (props.upperBound) {
|
|
130
|
-
parts.push(props.upperBound.inclusive ? "<=" : "<");
|
|
131
|
-
parts.push(props.upperBound.value);
|
|
132
|
-
}
|
|
133
|
-
base = parts.join(":");
|
|
134
|
-
} else if (subtype === "raw") base = `container:raw:${name}:${props.rawCondition}`;
|
|
135
|
-
else base = props.propertyValue ? `container:style:${name}:--${props.property}:${props.propertyValue}` : `container:style:${name}:--${props.property}`;
|
|
136
|
-
return negated ? `!${base}` : base;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Generate a normalized unique ID for a root condition
|
|
140
|
-
*/
|
|
141
|
-
function rootUniqueId(selector, negated = false) {
|
|
142
|
-
const base = `root:${selector}`;
|
|
143
|
-
return negated ? `!${base}` : base;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Generate a normalized unique ID for an own condition
|
|
147
|
-
*/
|
|
148
|
-
function ownUniqueId(innerUniqueId, negated = false) {
|
|
149
|
-
const base = `own:${innerUniqueId}`;
|
|
150
|
-
return negated ? `!${base}` : base;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Generate a normalized unique ID for a starting condition
|
|
154
|
-
*/
|
|
155
|
-
function startingUniqueId(negated = false) {
|
|
156
|
-
return negated ? "!starting" : "starting";
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Generate a normalized unique ID for a supports condition
|
|
160
|
-
*/
|
|
161
|
-
function supportsUniqueId(subtype, condition, negated = false) {
|
|
162
|
-
const base = `supports:${subtype}:${condition}`;
|
|
163
|
-
return negated ? `!${base}` : base;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Create a modifier condition
|
|
167
|
-
*/
|
|
168
|
-
function createModifierCondition(attribute, value, operator = "=", negated = false, raw) {
|
|
169
|
-
return {
|
|
170
|
-
kind: "state",
|
|
171
|
-
type: "modifier",
|
|
172
|
-
negated,
|
|
173
|
-
raw: raw || (value ? `${attribute}${operator}${value}` : attribute),
|
|
174
|
-
uniqueId: modifierUniqueId(attribute, value, operator, negated),
|
|
175
|
-
attribute,
|
|
176
|
-
value,
|
|
177
|
-
operator: value ? operator : void 0
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Create a pseudo condition
|
|
182
|
-
*/
|
|
183
|
-
function createPseudoCondition(pseudo, negated = false, raw) {
|
|
184
|
-
return {
|
|
185
|
-
kind: "state",
|
|
186
|
-
type: "pseudo",
|
|
187
|
-
negated,
|
|
188
|
-
raw: raw || pseudo,
|
|
189
|
-
uniqueId: pseudoUniqueId(pseudo, negated),
|
|
190
|
-
pseudo
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Create a media dimension condition
|
|
195
|
-
*/
|
|
196
|
-
function createMediaDimensionCondition(dimension, lowerBound, upperBound, negated = false, raw) {
|
|
197
|
-
return {
|
|
198
|
-
kind: "state",
|
|
199
|
-
type: "media",
|
|
200
|
-
subtype: "dimension",
|
|
201
|
-
negated,
|
|
202
|
-
raw: raw || `@media(${dimension})`,
|
|
203
|
-
uniqueId: mediaUniqueId("dimension", {
|
|
204
|
-
dimension,
|
|
205
|
-
lowerBound,
|
|
206
|
-
upperBound
|
|
207
|
-
}, negated),
|
|
208
|
-
dimension,
|
|
209
|
-
lowerBound,
|
|
210
|
-
upperBound
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Create a media feature condition
|
|
215
|
-
*/
|
|
216
|
-
function createMediaFeatureCondition(feature, featureValue, negated = false, raw) {
|
|
217
|
-
return {
|
|
218
|
-
kind: "state",
|
|
219
|
-
type: "media",
|
|
220
|
-
subtype: "feature",
|
|
221
|
-
negated,
|
|
222
|
-
raw: raw || `@media(${feature}${featureValue ? `: ${featureValue}` : ""})`,
|
|
223
|
-
uniqueId: mediaUniqueId("feature", {
|
|
224
|
-
feature,
|
|
225
|
-
featureValue
|
|
226
|
-
}, negated),
|
|
227
|
-
feature,
|
|
228
|
-
featureValue
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Create a media type condition
|
|
233
|
-
*/
|
|
234
|
-
function createMediaTypeCondition(mediaType, negated = false, raw) {
|
|
235
|
-
return {
|
|
236
|
-
kind: "state",
|
|
237
|
-
type: "media",
|
|
238
|
-
subtype: "type",
|
|
239
|
-
negated,
|
|
240
|
-
raw: raw || `@media:${mediaType}`,
|
|
241
|
-
uniqueId: mediaUniqueId("type", { mediaType }, negated),
|
|
242
|
-
mediaType
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Create a container dimension condition
|
|
247
|
-
*/
|
|
248
|
-
function createContainerDimensionCondition(dimension, lowerBound, upperBound, containerName, negated = false, raw) {
|
|
249
|
-
return {
|
|
250
|
-
kind: "state",
|
|
251
|
-
type: "container",
|
|
252
|
-
subtype: "dimension",
|
|
253
|
-
negated,
|
|
254
|
-
raw: raw || `@(${containerName ? containerName + ", " : ""}${dimension})`,
|
|
255
|
-
uniqueId: containerUniqueId("dimension", {
|
|
256
|
-
containerName,
|
|
257
|
-
dimension,
|
|
258
|
-
lowerBound,
|
|
259
|
-
upperBound
|
|
260
|
-
}, negated),
|
|
261
|
-
containerName,
|
|
262
|
-
dimension,
|
|
263
|
-
lowerBound,
|
|
264
|
-
upperBound
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Create a container style condition
|
|
269
|
-
*/
|
|
270
|
-
function createContainerStyleCondition(property, propertyValue, containerName, negated = false, raw) {
|
|
271
|
-
return {
|
|
272
|
-
kind: "state",
|
|
273
|
-
type: "container",
|
|
274
|
-
subtype: "style",
|
|
275
|
-
negated,
|
|
276
|
-
raw: raw || `@(${containerName ? containerName + ", " : ""}$${property}${propertyValue ? "=" + propertyValue : ""})`,
|
|
277
|
-
uniqueId: containerUniqueId("style", {
|
|
278
|
-
containerName,
|
|
279
|
-
property,
|
|
280
|
-
propertyValue
|
|
281
|
-
}, negated),
|
|
282
|
-
containerName,
|
|
283
|
-
property,
|
|
284
|
-
propertyValue
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Create a container raw function condition (e.g., scroll-state(), style(), etc.)
|
|
289
|
-
* The condition string is passed through to CSS verbatim.
|
|
290
|
-
*/
|
|
291
|
-
function createContainerRawCondition(rawCondition, containerName, negated = false, raw) {
|
|
292
|
-
return {
|
|
293
|
-
kind: "state",
|
|
294
|
-
type: "container",
|
|
295
|
-
subtype: "raw",
|
|
296
|
-
negated,
|
|
297
|
-
raw: raw || `@(${containerName ? containerName + ", " : ""}${rawCondition})`,
|
|
298
|
-
uniqueId: containerUniqueId("raw", {
|
|
299
|
-
containerName,
|
|
300
|
-
rawCondition
|
|
301
|
-
}, negated),
|
|
302
|
-
containerName,
|
|
303
|
-
rawCondition
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Create a root condition
|
|
308
|
-
*/
|
|
309
|
-
function createRootCondition(selector, negated = false, raw) {
|
|
310
|
-
return {
|
|
311
|
-
kind: "state",
|
|
312
|
-
type: "root",
|
|
313
|
-
negated,
|
|
314
|
-
raw: raw || `@root(${selector})`,
|
|
315
|
-
uniqueId: rootUniqueId(selector, negated),
|
|
316
|
-
selector
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Create an own condition
|
|
321
|
-
*/
|
|
322
|
-
function createOwnCondition(innerCondition, negated = false, raw) {
|
|
323
|
-
const innerUniqueId = getConditionUniqueId(innerCondition);
|
|
324
|
-
return {
|
|
325
|
-
kind: "state",
|
|
326
|
-
type: "own",
|
|
327
|
-
negated,
|
|
328
|
-
raw: raw || `@own(...)`,
|
|
329
|
-
uniqueId: ownUniqueId(innerUniqueId, negated),
|
|
330
|
-
innerCondition
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Create a starting condition
|
|
335
|
-
*/
|
|
336
|
-
function createStartingCondition(negated = false, raw) {
|
|
337
|
-
return {
|
|
338
|
-
kind: "state",
|
|
339
|
-
type: "starting",
|
|
340
|
-
negated,
|
|
341
|
-
raw: raw || "@starting",
|
|
342
|
-
uniqueId: startingUniqueId(negated)
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Create a supports condition
|
|
347
|
-
*
|
|
348
|
-
* @param subtype 'feature' for @supports(display: grid), 'selector' for @supports($, :has(*))
|
|
349
|
-
* @param condition The condition string (e.g., "display: grid" or ":has(*)")
|
|
350
|
-
*/
|
|
351
|
-
function createSupportsCondition(subtype, condition, negated = false, raw) {
|
|
352
|
-
return {
|
|
353
|
-
kind: "state",
|
|
354
|
-
type: "supports",
|
|
355
|
-
subtype,
|
|
356
|
-
negated,
|
|
357
|
-
raw: raw || `@supports(${condition})`,
|
|
358
|
-
uniqueId: supportsUniqueId(subtype, condition, negated),
|
|
359
|
-
condition
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Get the unique ID for any condition node
|
|
364
|
-
*/
|
|
365
|
-
function getConditionUniqueId(node) {
|
|
366
|
-
if (node.kind === "true") return "TRUE";
|
|
367
|
-
if (node.kind === "false") return "FALSE";
|
|
368
|
-
if (node.kind === "state") return node.uniqueId;
|
|
369
|
-
if (node.kind === "compound") {
|
|
370
|
-
const childIds = node.children.map(getConditionUniqueId).sort();
|
|
371
|
-
return `${node.operator}(${childIds.join(",")})`;
|
|
372
|
-
}
|
|
373
|
-
return "UNKNOWN";
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
//#endregion
|
|
377
|
-
export { and, createContainerDimensionCondition, createContainerRawCondition, createContainerStyleCondition, createMediaDimensionCondition, createMediaFeatureCondition, createMediaTypeCondition, createModifierCondition, createOwnCondition, createPseudoCondition, createRootCondition, createStartingCondition, createSupportsCondition, falseCondition, getConditionUniqueId, isCompoundCondition, not, or, trueCondition };
|
|
378
|
-
//# sourceMappingURL=conditions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conditions.js","names":[],"sources":["../../src/tasty/pipeline/conditions.ts"],"sourcesContent":["/**\n * ConditionNode Types and Helpers\n *\n * Core data structures for representing style conditions as an abstract syntax tree.\n * Used throughout the pipeline for parsing, simplification, and CSS generation.\n */\n\n// ============================================================================\n// Core ConditionNode Types\n// ============================================================================\n\n/**\n * Base interface for all state conditions (leaf nodes)\n */\ninterface BaseStateCondition {\n kind: 'state';\n negated: boolean;\n raw: string; // Original string for debugging/caching\n uniqueId: string; // Normalized ID for comparison (built from props)\n}\n\n/**\n * Modifier condition: [data-attr] or [data-attr=\"value\"]\n */\nexport interface ModifierCondition extends BaseStateCondition {\n type: 'modifier';\n attribute: string; // e.g., 'data-theme', 'data-size'\n value?: string; // e.g., 'danger', 'large' (undefined = boolean attr)\n operator?: '=' | '^=' | '$=' | '*='; // Attribute match operator\n}\n\n/**\n * Pseudo-class condition: :hover, :focus-visible\n */\nexport interface PseudoCondition extends BaseStateCondition {\n type: 'pseudo';\n pseudo: string; // e.g., ':hover', ':focus-visible', ':nth-child(2n)'\n}\n\n/**\n * Numeric bound for dimension queries\n */\nexport interface NumericBound {\n value: string; // e.g., '768px', 'calc(var(--gap) * 40)'\n valueNumeric: number | null; // Parsed numeric value for comparison\n inclusive: boolean; // true for >=/<= , false for >/<\n}\n\n/**\n * Media query condition\n */\nexport interface MediaCondition extends BaseStateCondition {\n type: 'media';\n subtype: 'dimension' | 'feature' | 'type';\n\n // For dimension queries: @media(w < 768px), @media(600px <= w < 1200px)\n dimension?: 'width' | 'height' | 'inline-size' | 'block-size';\n lowerBound?: NumericBound; // >= or >\n upperBound?: NumericBound; // <= or <\n\n // For feature queries: @media(prefers-contrast: high)\n feature?: string; // e.g., 'prefers-contrast', 'prefers-color-scheme'\n featureValue?: string; // e.g., 'high', 'dark' (undefined = boolean feature)\n\n // For type queries: @media:print\n mediaType?: 'print' | 'screen' | 'all' | 'speech';\n}\n\n/**\n * Container query condition\n */\nexport interface ContainerCondition extends BaseStateCondition {\n type: 'container';\n subtype: 'dimension' | 'style' | 'raw';\n containerName?: string; // e.g., 'layout', 'sidebar' (undefined = nearest)\n\n // For dimension queries: @(w < 600px), @(layout, w < 600px)\n dimension?: 'width' | 'height' | 'inline-size' | 'block-size';\n lowerBound?: NumericBound;\n upperBound?: NumericBound;\n\n // For style queries: @(layout, $variant=danger), @($theme)\n property?: string; // CSS custom property name (without --)\n propertyValue?: string; // e.g., 'danger' (undefined = existence check)\n\n // For raw function queries: @(scroll-state(stuck: top)), @(style(display: flex))\n rawCondition?: string; // Verbatim CSS condition string\n}\n\n/**\n * Root state condition: @root(theme=dark)\n */\nexport interface RootCondition extends BaseStateCondition {\n type: 'root';\n selector: string; // e.g., '[data-theme=\"dark\"]'\n}\n\n/**\n * Own state condition: @own(hovered)\n */\nexport interface OwnCondition extends BaseStateCondition {\n type: 'own';\n innerCondition: ConditionNode; // The parsed inner condition\n}\n\n/**\n * Starting style condition: @starting\n */\nexport interface StartingCondition extends BaseStateCondition {\n type: 'starting';\n}\n\n/**\n * Supports query condition: @supports(display: grid), @supports($, :has(*))\n */\nexport interface SupportsCondition extends BaseStateCondition {\n type: 'supports';\n subtype: 'feature' | 'selector';\n // The raw condition string (e.g., \"display: grid\" or \":has(*)\")\n condition: string;\n}\n\n/**\n * Union of all state condition types\n */\nexport type StateCondition =\n | ModifierCondition\n | PseudoCondition\n | MediaCondition\n | ContainerCondition\n | RootCondition\n | OwnCondition\n | StartingCondition\n | SupportsCondition;\n\n/**\n * Compound node: combines conditions with AND/OR\n */\nexport interface CompoundCondition {\n kind: 'compound';\n operator: 'AND' | 'OR';\n children: ConditionNode[];\n}\n\n/**\n * True condition (matches everything)\n */\nexport interface TrueCondition {\n kind: 'true';\n}\n\n/**\n * False condition (matches nothing - skip this rule)\n */\nexport interface FalseCondition {\n kind: 'false';\n}\n\n/**\n * Union of all condition node types\n */\nexport type ConditionNode =\n | StateCondition\n | CompoundCondition\n | TrueCondition\n | FalseCondition;\n\n// ============================================================================\n// Constructor Functions\n// ============================================================================\n\n/**\n * Create a TRUE condition (matches everything)\n */\nexport function trueCondition(): TrueCondition {\n return { kind: 'true' };\n}\n\n/**\n * Create a FALSE condition (matches nothing)\n */\nexport function falseCondition(): FalseCondition {\n return { kind: 'false' };\n}\n\n/**\n * Create an AND compound condition\n */\nexport function and(...children: ConditionNode[]): ConditionNode {\n const filtered: ConditionNode[] = [];\n\n for (const child of children) {\n // Short-circuit on FALSE\n if (child.kind === 'false') {\n return falseCondition();\n }\n // Skip TRUE (identity for AND)\n if (child.kind === 'true') {\n continue;\n }\n // Flatten nested ANDs\n if (child.kind === 'compound' && child.operator === 'AND') {\n filtered.push(...child.children);\n } else {\n filtered.push(child);\n }\n }\n\n if (filtered.length === 0) {\n return trueCondition();\n }\n if (filtered.length === 1) {\n return filtered[0];\n }\n\n return {\n kind: 'compound',\n operator: 'AND',\n children: filtered,\n };\n}\n\n/**\n * Create an OR compound condition\n */\nexport function or(...children: ConditionNode[]): ConditionNode {\n const filtered: ConditionNode[] = [];\n\n for (const child of children) {\n // Short-circuit on TRUE\n if (child.kind === 'true') {\n return trueCondition();\n }\n // Skip FALSE (identity for OR)\n if (child.kind === 'false') {\n continue;\n }\n // Flatten nested ORs\n if (child.kind === 'compound' && child.operator === 'OR') {\n filtered.push(...child.children);\n } else {\n filtered.push(child);\n }\n }\n\n if (filtered.length === 0) {\n return falseCondition();\n }\n if (filtered.length === 1) {\n return filtered[0];\n }\n\n return {\n kind: 'compound',\n operator: 'OR',\n children: filtered,\n };\n}\n\n/**\n * Negate a condition\n */\nexport function not(node: ConditionNode): ConditionNode {\n // NOT(TRUE) = FALSE\n if (node.kind === 'true') {\n return falseCondition();\n }\n\n // NOT(FALSE) = TRUE\n if (node.kind === 'false') {\n return trueCondition();\n }\n\n // NOT(state) = toggle negated flag\n if (node.kind === 'state') {\n return {\n ...node,\n negated: !node.negated,\n uniqueId: node.negated\n ? node.uniqueId.replace(/^!/, '')\n : `!${node.uniqueId}`,\n };\n }\n\n // NOT(AND(a, b, ...)) = OR(NOT(a), NOT(b), ...) - De Morgan's law\n if (node.kind === 'compound' && node.operator === 'AND') {\n return or(...node.children.map((c) => not(c)));\n }\n\n // NOT(OR(a, b, ...)) = AND(NOT(a), NOT(b), ...) - De Morgan's law\n if (node.kind === 'compound' && node.operator === 'OR') {\n return and(...node.children.map((c) => not(c)));\n }\n\n // Fallback - should not reach here\n return node;\n}\n\n// ============================================================================\n// Condition Type Checking\n// ============================================================================\n\n/**\n * Check if a condition is a compound condition\n */\nexport function isCompoundCondition(\n node: ConditionNode,\n): node is CompoundCondition {\n return node.kind === 'compound';\n}\n\n// ============================================================================\n// UniqueId Generation\n// ============================================================================\n\n/**\n * Generate a normalized unique ID for a modifier condition\n */\nexport function modifierUniqueId(\n attribute: string,\n value?: string,\n operator: string = '=',\n negated: boolean = false,\n): string {\n const base = value\n ? `mod:${attribute}${operator}${value}`\n : `mod:${attribute}`;\n return negated ? `!${base}` : base;\n}\n\n/**\n * Generate a normalized unique ID for a pseudo condition\n */\nexport function pseudoUniqueId(\n pseudo: string,\n negated: boolean = false,\n): string {\n const base = `pseudo:${pseudo}`;\n return negated ? `!${base}` : base;\n}\n\n/**\n * Generate a normalized unique ID for a media condition\n */\nexport function mediaUniqueId(\n subtype: 'dimension' | 'feature' | 'type',\n props: {\n dimension?: string;\n lowerBound?: NumericBound;\n upperBound?: NumericBound;\n feature?: string;\n featureValue?: string;\n mediaType?: string;\n },\n negated: boolean = false,\n): string {\n let base: string;\n\n if (subtype === 'dimension') {\n const parts = ['media', 'dim', props.dimension];\n if (props.lowerBound) {\n parts.push(props.lowerBound.inclusive ? '>=' : '>');\n parts.push(props.lowerBound.value);\n }\n if (props.upperBound) {\n parts.push(props.upperBound.inclusive ? '<=' : '<');\n parts.push(props.upperBound.value);\n }\n base = parts.join(':');\n } else if (subtype === 'feature') {\n base = props.featureValue\n ? `media:feat:${props.feature}:${props.featureValue}`\n : `media:feat:${props.feature}`;\n } else {\n base = `media:type:${props.mediaType}`;\n }\n\n return negated ? `!${base}` : base;\n}\n\n/**\n * Generate a normalized unique ID for a container condition\n */\nexport function containerUniqueId(\n subtype: 'dimension' | 'style' | 'raw',\n props: {\n containerName?: string;\n dimension?: string;\n lowerBound?: NumericBound;\n upperBound?: NumericBound;\n property?: string;\n propertyValue?: string;\n rawCondition?: string;\n },\n negated: boolean = false,\n): string {\n let base: string;\n const name = props.containerName || '_';\n\n if (subtype === 'dimension') {\n const parts = ['container', 'dim', name, props.dimension];\n if (props.lowerBound) {\n parts.push(props.lowerBound.inclusive ? '>=' : '>');\n parts.push(props.lowerBound.value);\n }\n if (props.upperBound) {\n parts.push(props.upperBound.inclusive ? '<=' : '<');\n parts.push(props.upperBound.value);\n }\n base = parts.join(':');\n } else if (subtype === 'raw') {\n base = `container:raw:${name}:${props.rawCondition}`;\n } else {\n base = props.propertyValue\n ? `container:style:${name}:--${props.property}:${props.propertyValue}`\n : `container:style:${name}:--${props.property}`;\n }\n\n return negated ? `!${base}` : base;\n}\n\n/**\n * Generate a normalized unique ID for a root condition\n */\nexport function rootUniqueId(\n selector: string,\n negated: boolean = false,\n): string {\n const base = `root:${selector}`;\n return negated ? `!${base}` : base;\n}\n\n/**\n * Generate a normalized unique ID for an own condition\n */\nexport function ownUniqueId(\n innerUniqueId: string,\n negated: boolean = false,\n): string {\n const base = `own:${innerUniqueId}`;\n return negated ? `!${base}` : base;\n}\n\n/**\n * Generate a normalized unique ID for a starting condition\n */\nexport function startingUniqueId(negated: boolean = false): string {\n return negated ? '!starting' : 'starting';\n}\n\n/**\n * Generate a normalized unique ID for a supports condition\n */\nexport function supportsUniqueId(\n subtype: 'feature' | 'selector',\n condition: string,\n negated: boolean = false,\n): string {\n const base = `supports:${subtype}:${condition}`;\n return negated ? `!${base}` : base;\n}\n\n// ============================================================================\n// Condition Creation Helpers\n// ============================================================================\n\n/**\n * Create a modifier condition\n */\nexport function createModifierCondition(\n attribute: string,\n value?: string,\n operator: '=' | '^=' | '$=' | '*=' = '=',\n negated: boolean = false,\n raw?: string,\n): ModifierCondition {\n return {\n kind: 'state',\n type: 'modifier',\n negated,\n raw: raw || (value ? `${attribute}${operator}${value}` : attribute),\n uniqueId: modifierUniqueId(attribute, value, operator, negated),\n attribute,\n value,\n operator: value ? operator : undefined,\n };\n}\n\n/**\n * Create a pseudo condition\n */\nexport function createPseudoCondition(\n pseudo: string,\n negated: boolean = false,\n raw?: string,\n): PseudoCondition {\n return {\n kind: 'state',\n type: 'pseudo',\n negated,\n raw: raw || pseudo,\n uniqueId: pseudoUniqueId(pseudo, negated),\n pseudo,\n };\n}\n\n/**\n * Create a media dimension condition\n */\nexport function createMediaDimensionCondition(\n dimension: 'width' | 'height' | 'inline-size' | 'block-size',\n lowerBound?: NumericBound,\n upperBound?: NumericBound,\n negated: boolean = false,\n raw?: string,\n): MediaCondition {\n return {\n kind: 'state',\n type: 'media',\n subtype: 'dimension',\n negated,\n raw: raw || `@media(${dimension})`,\n uniqueId: mediaUniqueId(\n 'dimension',\n { dimension, lowerBound, upperBound },\n negated,\n ),\n dimension,\n lowerBound,\n upperBound,\n };\n}\n\n/**\n * Create a media feature condition\n */\nexport function createMediaFeatureCondition(\n feature: string,\n featureValue?: string,\n negated: boolean = false,\n raw?: string,\n): MediaCondition {\n return {\n kind: 'state',\n type: 'media',\n subtype: 'feature',\n negated,\n raw: raw || `@media(${feature}${featureValue ? `: ${featureValue}` : ''})`,\n uniqueId: mediaUniqueId('feature', { feature, featureValue }, negated),\n feature,\n featureValue,\n };\n}\n\n/**\n * Create a media type condition\n */\nexport function createMediaTypeCondition(\n mediaType: 'print' | 'screen' | 'all' | 'speech',\n negated: boolean = false,\n raw?: string,\n): MediaCondition {\n return {\n kind: 'state',\n type: 'media',\n subtype: 'type',\n negated,\n raw: raw || `@media:${mediaType}`,\n uniqueId: mediaUniqueId('type', { mediaType }, negated),\n mediaType,\n };\n}\n\n/**\n * Create a container dimension condition\n */\nexport function createContainerDimensionCondition(\n dimension: 'width' | 'height' | 'inline-size' | 'block-size',\n lowerBound?: NumericBound,\n upperBound?: NumericBound,\n containerName?: string,\n negated: boolean = false,\n raw?: string,\n): ContainerCondition {\n return {\n kind: 'state',\n type: 'container',\n subtype: 'dimension',\n negated,\n raw: raw || `@(${containerName ? containerName + ', ' : ''}${dimension})`,\n uniqueId: containerUniqueId(\n 'dimension',\n { containerName, dimension, lowerBound, upperBound },\n negated,\n ),\n containerName,\n dimension,\n lowerBound,\n upperBound,\n };\n}\n\n/**\n * Create a container style condition\n */\nexport function createContainerStyleCondition(\n property: string,\n propertyValue?: string,\n containerName?: string,\n negated: boolean = false,\n raw?: string,\n): ContainerCondition {\n return {\n kind: 'state',\n type: 'container',\n subtype: 'style',\n negated,\n raw:\n raw ||\n `@(${containerName ? containerName + ', ' : ''}$${property}${propertyValue ? '=' + propertyValue : ''})`,\n uniqueId: containerUniqueId(\n 'style',\n { containerName, property, propertyValue },\n negated,\n ),\n containerName,\n property,\n propertyValue,\n };\n}\n\n/**\n * Create a container raw function condition (e.g., scroll-state(), style(), etc.)\n * The condition string is passed through to CSS verbatim.\n */\nexport function createContainerRawCondition(\n rawCondition: string,\n containerName?: string,\n negated: boolean = false,\n raw?: string,\n): ContainerCondition {\n return {\n kind: 'state',\n type: 'container',\n subtype: 'raw',\n negated,\n raw:\n raw || `@(${containerName ? containerName + ', ' : ''}${rawCondition})`,\n uniqueId: containerUniqueId(\n 'raw',\n { containerName, rawCondition },\n negated,\n ),\n containerName,\n rawCondition,\n };\n}\n\n/**\n * Create a root condition\n */\nexport function createRootCondition(\n selector: string,\n negated: boolean = false,\n raw?: string,\n): RootCondition {\n return {\n kind: 'state',\n type: 'root',\n negated,\n raw: raw || `@root(${selector})`,\n uniqueId: rootUniqueId(selector, negated),\n selector,\n };\n}\n\n/**\n * Create an own condition\n */\nexport function createOwnCondition(\n innerCondition: ConditionNode,\n negated: boolean = false,\n raw?: string,\n): OwnCondition {\n const innerUniqueId = getConditionUniqueId(innerCondition);\n return {\n kind: 'state',\n type: 'own',\n negated,\n raw: raw || `@own(...)`,\n uniqueId: ownUniqueId(innerUniqueId, negated),\n innerCondition,\n };\n}\n\n/**\n * Create a starting condition\n */\nexport function createStartingCondition(\n negated: boolean = false,\n raw?: string,\n): StartingCondition {\n return {\n kind: 'state',\n type: 'starting',\n negated,\n raw: raw || '@starting',\n uniqueId: startingUniqueId(negated),\n };\n}\n\n/**\n * Create a supports condition\n *\n * @param subtype 'feature' for @supports(display: grid), 'selector' for @supports($, :has(*))\n * @param condition The condition string (e.g., \"display: grid\" or \":has(*)\")\n */\nexport function createSupportsCondition(\n subtype: 'feature' | 'selector',\n condition: string,\n negated: boolean = false,\n raw?: string,\n): SupportsCondition {\n return {\n kind: 'state',\n type: 'supports',\n subtype,\n negated,\n raw: raw || `@supports(${condition})`,\n uniqueId: supportsUniqueId(subtype, condition, negated),\n condition,\n };\n}\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\n/**\n * Get the unique ID for any condition node\n */\nexport function getConditionUniqueId(node: ConditionNode): string {\n if (node.kind === 'true') {\n return 'TRUE';\n }\n if (node.kind === 'false') {\n return 'FALSE';\n }\n if (node.kind === 'state') {\n return node.uniqueId;\n }\n if (node.kind === 'compound') {\n const childIds = node.children.map(getConditionUniqueId).sort();\n return `${node.operator}(${childIds.join(',')})`;\n }\n return 'UNKNOWN';\n}\n"],"mappings":"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"}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.117.0 | Cube Dev Team */
|
|
2
|
-
import { and, isCompoundCondition, not, trueCondition } from "./conditions.js";
|
|
3
|
-
import { simplifyCondition } from "./simplify.js";
|
|
4
|
-
|
|
5
|
-
//#region src/tasty/pipeline/exclusive.ts
|
|
6
|
-
/**
|
|
7
|
-
* Build exclusive conditions for a list of parsed style entries.
|
|
8
|
-
*
|
|
9
|
-
* The entries should be ordered by priority (highest priority first).
|
|
10
|
-
*
|
|
11
|
-
* For each entry, we compute:
|
|
12
|
-
* exclusiveCondition = condition & !prior[0] & !prior[1] & ...
|
|
13
|
-
*
|
|
14
|
-
* This ensures exactly one condition matches at any time.
|
|
15
|
-
*
|
|
16
|
-
* Example:
|
|
17
|
-
* Input (ordered highest to lowest priority):
|
|
18
|
-
* A: value1 (priority 2)
|
|
19
|
-
* B: value2 (priority 1)
|
|
20
|
-
* C: value3 (priority 0)
|
|
21
|
-
*
|
|
22
|
-
* Output:
|
|
23
|
-
* A: A
|
|
24
|
-
* B: B & !A
|
|
25
|
-
* C: C & !A & !B
|
|
26
|
-
*
|
|
27
|
-
* @param entries Parsed style entries ordered by priority (highest first)
|
|
28
|
-
* @returns Entries with exclusive conditions, filtered to remove impossible ones
|
|
29
|
-
*/
|
|
30
|
-
function buildExclusiveConditions(entries) {
|
|
31
|
-
const result = [];
|
|
32
|
-
const priorConditions = [];
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
let exclusive = entry.condition;
|
|
35
|
-
for (const prior of priorConditions) if (prior.kind !== "true") exclusive = and(exclusive, not(prior));
|
|
36
|
-
const simplified = simplifyCondition(exclusive);
|
|
37
|
-
if (simplified.kind === "false") continue;
|
|
38
|
-
result.push({
|
|
39
|
-
...entry,
|
|
40
|
-
exclusiveCondition: simplified
|
|
41
|
-
});
|
|
42
|
-
if (entry.condition.kind !== "true") priorConditions.push(entry.condition);
|
|
43
|
-
}
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Parse style entries from a value mapping object.
|
|
48
|
-
*
|
|
49
|
-
* @param styleKey The style key (e.g., 'padding')
|
|
50
|
-
* @param valueMap The value mapping { '': '2x', 'compact': '1x', '@media(w < 768px)': '0.5x' }
|
|
51
|
-
* @param parseCondition Function to parse state keys into conditions
|
|
52
|
-
* @returns Parsed entries ordered by priority (highest first)
|
|
53
|
-
*/
|
|
54
|
-
function parseStyleEntries(styleKey, valueMap, parseCondition) {
|
|
55
|
-
const entries = [];
|
|
56
|
-
Object.keys(valueMap).forEach((stateKey, index) => {
|
|
57
|
-
const value = valueMap[stateKey];
|
|
58
|
-
const condition = stateKey === "" ? trueCondition() : parseCondition(stateKey);
|
|
59
|
-
entries.push({
|
|
60
|
-
styleKey,
|
|
61
|
-
stateKey,
|
|
62
|
-
value,
|
|
63
|
-
condition,
|
|
64
|
-
priority: index
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
entries.reverse();
|
|
68
|
-
return entries;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Check if a value is a style value mapping (object with state keys)
|
|
72
|
-
*/
|
|
73
|
-
function isValueMapping(value) {
|
|
74
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) && !(value instanceof Date);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Expand OR conditions in parsed entries into multiple exclusive entries.
|
|
78
|
-
*
|
|
79
|
-
* For an entry with condition `A | B | C`, this creates 3 entries:
|
|
80
|
-
* - condition: A
|
|
81
|
-
* - condition: B & !A
|
|
82
|
-
* - condition: C & !A & !B
|
|
83
|
-
*
|
|
84
|
-
* This ensures OR branches are mutually exclusive BEFORE the main
|
|
85
|
-
* exclusive condition building pass.
|
|
86
|
-
*
|
|
87
|
-
* @param entries Parsed entries (may contain OR conditions)
|
|
88
|
-
* @returns Expanded entries with OR branches made exclusive
|
|
89
|
-
*/
|
|
90
|
-
function expandOrConditions(entries) {
|
|
91
|
-
const result = [];
|
|
92
|
-
for (const entry of entries) {
|
|
93
|
-
const expanded = expandSingleEntry(entry);
|
|
94
|
-
result.push(...expanded);
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Expand a single entry's OR condition into multiple exclusive entries
|
|
100
|
-
*/
|
|
101
|
-
function expandSingleEntry(entry) {
|
|
102
|
-
const orBranches = collectOrBranches(entry.condition);
|
|
103
|
-
if (orBranches.length <= 1) return [entry];
|
|
104
|
-
const result = [];
|
|
105
|
-
const priorBranches = [];
|
|
106
|
-
for (let i = 0; i < orBranches.length; i++) {
|
|
107
|
-
const branch = orBranches[i];
|
|
108
|
-
let exclusiveBranch = branch;
|
|
109
|
-
for (const prior of priorBranches) exclusiveBranch = and(exclusiveBranch, not(prior));
|
|
110
|
-
const simplified = simplifyCondition(exclusiveBranch);
|
|
111
|
-
if (simplified.kind === "false") {
|
|
112
|
-
priorBranches.push(branch);
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
result.push({
|
|
116
|
-
...entry,
|
|
117
|
-
stateKey: `${entry.stateKey}[${i}]`,
|
|
118
|
-
condition: simplified
|
|
119
|
-
});
|
|
120
|
-
priorBranches.push(branch);
|
|
121
|
-
}
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Collect top-level OR branches from a condition.
|
|
126
|
-
*
|
|
127
|
-
* For `A | B | C`, returns [A, B, C]
|
|
128
|
-
* For `A & B`, returns [A & B] (single branch)
|
|
129
|
-
* For `A | (B & C)`, returns [A, B & C]
|
|
130
|
-
*/
|
|
131
|
-
function collectOrBranches(condition) {
|
|
132
|
-
if (condition.kind === "true" || condition.kind === "false") return [condition];
|
|
133
|
-
if (isCompoundCondition(condition) && condition.operator === "OR") {
|
|
134
|
-
const branches = [];
|
|
135
|
-
for (const child of condition.children) branches.push(...collectOrBranches(child));
|
|
136
|
-
return branches;
|
|
137
|
-
}
|
|
138
|
-
return [condition];
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Expand OR conditions in exclusive entries AFTER buildExclusiveConditions.
|
|
142
|
-
*
|
|
143
|
-
* This handles ORs that arise from De Morgan expansion during negation:
|
|
144
|
-
* !(A & B) = !A | !B
|
|
145
|
-
*
|
|
146
|
-
* These ORs need to be made exclusive to avoid overlapping CSS rules:
|
|
147
|
-
* !A | !B → !A | (A & !B)
|
|
148
|
-
*
|
|
149
|
-
* This is logically equivalent but ensures each branch has proper context.
|
|
150
|
-
*
|
|
151
|
-
* Example:
|
|
152
|
-
* Input: { "": V1, "@supports(...) & :has()": V2 }
|
|
153
|
-
* V2's exclusive = @supports & :has
|
|
154
|
-
* V1's exclusive = !(@supports & :has) = !@supports | !:has
|
|
155
|
-
*
|
|
156
|
-
* Without this fix: V1 gets two rules:
|
|
157
|
-
* - @supports (not ...) → V1 ✓
|
|
158
|
-
* - :not(:has()) → V1 ✗ (missing @supports context!)
|
|
159
|
-
*
|
|
160
|
-
* With this fix: V1 gets two exclusive rules:
|
|
161
|
-
* - @supports (not ...) → V1 ✓
|
|
162
|
-
* - @supports (...) { :not(:has()) } → V1 ✓ (proper context!)
|
|
163
|
-
*/
|
|
164
|
-
function expandExclusiveOrs(entries) {
|
|
165
|
-
const result = [];
|
|
166
|
-
for (const entry of entries) {
|
|
167
|
-
const expanded = expandExclusiveConditionOrs(entry);
|
|
168
|
-
result.push(...expanded);
|
|
169
|
-
}
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Check if a condition involves at-rules (media, container, supports, starting)
|
|
174
|
-
*/
|
|
175
|
-
function hasAtRuleContext(node) {
|
|
176
|
-
if (node.kind === "true" || node.kind === "false") return false;
|
|
177
|
-
if (node.kind === "state") return node.type === "media" || node.type === "container" || node.type === "supports" || node.type === "starting";
|
|
178
|
-
if (node.kind === "compound") return node.children.some(hasAtRuleContext);
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Sort OR branches to prioritize at-rule conditions first.
|
|
183
|
-
*
|
|
184
|
-
* This is critical for correct CSS generation. For `!A | !B` where A is at-rule
|
|
185
|
-
* and B is modifier, we want:
|
|
186
|
-
* - Branch 0: !A (at-rule negation - covers "no @supports/media" case)
|
|
187
|
-
* - Branch 1: A & !B (modifier negation with at-rule context)
|
|
188
|
-
*
|
|
189
|
-
* If we process in wrong order (!B first), we'd get:
|
|
190
|
-
* - Branch 0: !B (modifier negation WITHOUT at-rule context - WRONG!)
|
|
191
|
-
* - Branch 1: B & !A (at-rule negation with modifier - incomplete coverage)
|
|
192
|
-
*/
|
|
193
|
-
function sortOrBranchesForExpansion(branches) {
|
|
194
|
-
return [...branches].sort((a, b) => {
|
|
195
|
-
const aHasAtRule = hasAtRuleContext(a);
|
|
196
|
-
const bHasAtRule = hasAtRuleContext(b);
|
|
197
|
-
if (aHasAtRule && !bHasAtRule) return -1;
|
|
198
|
-
if (!aHasAtRule && bHasAtRule) return 1;
|
|
199
|
-
return 0;
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Expand ORs in a single entry's exclusive condition
|
|
204
|
-
*/
|
|
205
|
-
function expandExclusiveConditionOrs(entry) {
|
|
206
|
-
let orBranches = collectOrBranches(entry.exclusiveCondition);
|
|
207
|
-
if (orBranches.length <= 1) return [entry];
|
|
208
|
-
orBranches = sortOrBranchesForExpansion(orBranches);
|
|
209
|
-
const result = [];
|
|
210
|
-
const priorBranches = [];
|
|
211
|
-
for (let i = 0; i < orBranches.length; i++) {
|
|
212
|
-
const branch = orBranches[i];
|
|
213
|
-
let exclusiveBranch = branch;
|
|
214
|
-
for (const prior of priorBranches) exclusiveBranch = and(exclusiveBranch, not(prior));
|
|
215
|
-
const simplified = simplifyCondition(exclusiveBranch);
|
|
216
|
-
if (simplified.kind === "false") {
|
|
217
|
-
priorBranches.push(branch);
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
result.push({
|
|
221
|
-
...entry,
|
|
222
|
-
stateKey: `${entry.stateKey}[or:${i}]`,
|
|
223
|
-
exclusiveCondition: simplified
|
|
224
|
-
});
|
|
225
|
-
priorBranches.push(branch);
|
|
226
|
-
}
|
|
227
|
-
return result;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
//#endregion
|
|
231
|
-
export { buildExclusiveConditions, expandExclusiveOrs, expandOrConditions, isValueMapping, parseStyleEntries };
|
|
232
|
-
//# sourceMappingURL=exclusive.js.map
|