@cube-dev/ui-kit 0.204.0 → 0.206.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 +36 -0
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/Root.js.map +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +221 -132
- package/dist/components/actions/ItemActionsWrapper.js.map +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- 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.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.d.ts +2 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +3 -2
- package/dist/components/content/PrismCode/PrismCode.js.map +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +8 -2
- package/dist/components/content/PrismCode/prismSetup.js.map +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.d.ts +5 -2
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/TextItem/TextItem.js.map +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +114 -72
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +21 -20
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-body-sections.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/CalendarPopover.js +281 -0
- package/dist/components/fields/DatePicker/CalendarPopover.js.map +1 -0
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +26 -24
- package/dist/components/fields/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +4 -2
- package/dist/components/fields/DatePicker/DatePickerElement.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.d.ts +10 -0
- package/dist/components/fields/DatePicker/DateRangePicker.js +143 -65
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +172 -165
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +108 -118
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +10 -12
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +198 -174
- package/dist/components/form/Form/ModernFormRoot.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/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +18 -3
- package/dist/components/form/Form/modern/store.js.map +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +190 -187
- package/dist/components/navigation/Tabs/TabButton.js.map +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +2 -1
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/segmented-styles.js +53 -0
- package/dist/components/navigation/Tabs/segmented-styles.js.map +1 -0
- package/dist/components/navigation/Tabs/styled.js +15 -28
- package/dist/components/navigation/Tabs/styled.js.map +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +4 -4
- 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/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.d.ts +3 -3
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.d.ts +4 -4
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +101 -123
- package/dist/components/overlays/Dialog/ModernDialogForm.js.map +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/context.js.map +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js +60 -51
- package/dist/components/overlays/Dialog/use-dismiss-confirmation.js.map +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +6 -3
- package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +2 -2
- package/dist/components/status/Spin/Cube.js.map +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +70 -70
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +3 -2
- package/dist/i18n/locales/en-US/uikit.js +3 -2
- package/dist/i18n/locales/en-US/uikit.json.d.ts +1 -0
- package/dist/i18n/locales/es-ES/uikit.js +3 -2
- package/dist/i18n/locales/es-MX/uikit.js +3 -2
- package/dist/i18n/locales/fr-FR/uikit.js +3 -2
- package/dist/i18n/locales/it-IT/uikit.js +3 -2
- package/dist/i18n/locales/ja-JP/uikit.js +3 -2
- package/dist/i18n/locales/nb-NO/uikit.js +3 -2
- package/dist/i18n/locales/pt-BR/uikit.js +3 -2
- package/dist/i18n/locales/pt-PT/uikit.js +3 -2
- package/dist/i18n/locales/sv-SE/uikit.js +3 -2
- package/dist/i18n/locales/vi-VN/uikit.js +3 -2
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.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/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +7 -5
- package/dist/utils/react/useScheme.js.map +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +3 -3
- package/docs/Theming.md +1 -1
- package/docs/Usage.md +26 -0
- package/docs/components/content/Item.md +1 -1
- package/docs/components/content/TextItem.md +13 -1
- package/docs/components/data/ItemTable.md +1 -1
- package/docs/components/fields/RadioGroup.md +5 -4
- package/docs/components/form/Form.md +2 -0
- package/docs/components/form/ModernForm.md +5 -1
- package/docs/components/navigation/Tabs.md +5 -3
- package/docs/components/overlays/DialogContainer.md +1 -1
- package/docs/components/overlays/DialogTrigger.md +2 -2
- package/docs/components/overlays/Notifications.md +17 -0
- package/docs/components/overlays/Toast.md +1 -1
- package/docs/modern-form-guide.md +5 -1
- package/docs/tasty/ai-agents.md +3 -2
- package/docs/tasty/dsl.md +52 -0
- package/docs/tasty/styles.md +27 -15
- package/package.json +5 -3
- package/tasty.config.generated.ts +526 -0
- package/tasty.config.ts +29 -422
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { getPaletteVersion } from "./palette-config.js";
|
|
3
3
|
import { BASE_TOKENS } from "./base.js";
|
|
4
4
|
import { lazyStyles } from "./lazy-styles.js";
|
package/dist/tokens/base.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { colorSeed } from "./color-seed.js";
|
|
3
3
|
import { DEFAULT_HUE, getPaletteConfig, getPaletteVersion, usePaletteValue } from "./palette-config.js";
|
|
4
4
|
import { tintRecipe } from "./palette.js";
|
package/dist/tokens/colors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { getPaletteVersion } from "./palette-config.js";
|
|
3
3
|
import { BASE_TOKENS } from "./base.js";
|
|
4
4
|
import { lazyStyles } from "./lazy-styles.js";
|
package/dist/tokens/layout.js
CHANGED
package/dist/tokens/palette.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { SURFACE_SATURATION_SHARE, getPaletteConfig, getPaletteVersion, resolvePaletteConfig } from "./palette-config.js";
|
|
3
3
|
import { lazyStyles } from "./lazy-styles.js";
|
|
4
4
|
import { apcaContrast, glaze, okhslToLinearSrgb, variantToOkhsl } from "@tenphi/glaze";
|
package/dist/tokens/resolve.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { subscribeScheme } from "../utils/react/useScheme.js";
|
|
4
4
|
import { warn } from "../utils/warnings.js";
|
package/dist/tokens/shadows.js
CHANGED
package/dist/tokens/sizes.js
CHANGED
package/dist/tokens/spacing.js
CHANGED
package/dist/utils/colors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { hslToSrgb, okhslToOklch, okhslToSrgb, okhstToOkhsl, oklabToOkhsl, parseHexAlpha } from "@tenphi/glaze";
|
|
3
3
|
//#region src/utils/colors.ts
|
|
4
4
|
/**
|
package/dist/utils/dotize.js
CHANGED
package/dist/utils/is-dev-env.js
CHANGED
package/dist/utils/modules.js
CHANGED
package/dist/utils/promise.js
CHANGED
package/dist/utils/raf.js
CHANGED
package/dist/utils/random.js
CHANGED
package/dist/utils/range.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useRef } from "react";
|
|
3
3
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/utils/react/RenderCache.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "./mergeProps.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { Children, cloneElement, createContext, useContext } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { chain } from "./chain.js";
|
|
3
3
|
import { useLayoutEffect } from "./useLayoutEffect.js";
|
|
4
4
|
import { mergeProps } from "./mergeProps.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "./useLayoutEffect.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
//#region src/utils/react/nullableValue.ts
|
|
3
3
|
function castNullableStringValue(props, emptyValue = "") {
|
|
4
4
|
return castNullableField(props, ["value", "defaultValue"], "string", (v) => String(v), emptyValue);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
3
3
|
import { isDevEnv } from "../is-dev-env.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "./useLayoutEffect.js";
|
|
3
3
|
import { useCallback, useRef, useState } from "react";
|
|
4
4
|
//#region src/utils/react/useBufferedValue.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef } from "react";
|
|
4
4
|
//#region src/utils/react/useEventBus.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "./useLayoutEffect.js";
|
|
3
3
|
import "react/compiler-runtime";
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import * as React$1 from "react";
|
|
3
3
|
//#region src/utils/react/useLayoutEffect.tsx
|
|
4
4
|
const useLayoutEffect$1 = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useSyncExternalStore } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { getEventTarget, nodeContains } from "@react-aria/utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { EventBusContext, useEventBus } from "./useEventBus.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useContext, useEffect, useEffectEvent, useRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { useSyncExternalStore } from "react";
|
|
3
3
|
//#region src/utils/react/useScheme.ts
|
|
4
4
|
/**
|
|
@@ -40,10 +40,11 @@ const CONTRAST_ATTR = `data-${CONTRAST_KEY}`;
|
|
|
40
40
|
const DARK_QUERY = "(prefers-color-scheme: dark)";
|
|
41
41
|
const HIGH_CONTRAST_QUERY = "(prefers-contrast: more)";
|
|
42
42
|
/**
|
|
43
|
-
* The `@dark` / `@hc` state aliases, in tasty's DSL —
|
|
44
|
-
* `<Root>` via `setGlobalPredefinedStates()`.
|
|
43
|
+
* The `@dark` / `@hc` / `@reduced-motion` state aliases, in tasty's DSL —
|
|
44
|
+
* registered globally by `<Root>` via `setGlobalPredefinedStates()`.
|
|
45
45
|
*
|
|
46
|
-
*
|
|
46
|
+
* `@reduced-motion` follows the system preference alone. For the two schemes,
|
|
47
|
+
* the attribute opt-in wins over the system preference, and the fallback is
|
|
47
48
|
* gated on the attribute being *absent* (`!@root(scheme)`) rather than on it
|
|
48
49
|
* being some other value — so `<html data-scheme="light">` stays light inside a
|
|
49
50
|
* dark OS, which is the whole point of an opt-in. {@link resolveScheme} and
|
|
@@ -51,7 +52,8 @@ const HIGH_CONTRAST_QUERY = "(prefers-contrast: more)";
|
|
|
51
52
|
*/
|
|
52
53
|
const AMBIENT_PREDEFINED_STATES = {
|
|
53
54
|
"@dark": `@root(${SCHEME_KEY}=dark) | (!@root(${SCHEME_KEY}) & @media${DARK_QUERY})`,
|
|
54
|
-
"@hc": `@root(${CONTRAST_KEY}=high) | (!@root(${CONTRAST_KEY}) & @media${HIGH_CONTRAST_QUERY})
|
|
55
|
+
"@hc": `@root(${CONTRAST_KEY}=high) | (!@root(${CONTRAST_KEY}) & @media${HIGH_CONTRAST_QUERY})`,
|
|
56
|
+
"@reduced-motion": `@media(prefers-reduced-motion: reduce)`
|
|
55
57
|
};
|
|
56
58
|
/**
|
|
57
59
|
* `matchMedia` is called per read rather than cached, so a test that stubs it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScheme.js","names":["useSyncExternalStore","SCHEME_KEY","CONTRAST_KEY","SCHEME_ATTR","CONTRAST_ATTR","DARK_QUERY","HIGH_CONTRAST_QUERY","AMBIENT_PREDEFINED_STATES","const","ColorScheme","mediaMatches","query","window","matchMedia","matches","rootAttribute","name","document","documentElement","getAttribute","resolveScheme","attribute","resolveHighContrast","listeners","Set","stopWatching","notify","forEach","listener","startWatching","teardowns","list","addEventListener","push","removeEventListener","MutationObserver","observer","observe","attributes","attributeFilter","disconnect","teardown","subscribeScheme","add","delete","size","getServerScheme","getServerHighContrast","useScheme","useHighContrast"],"sources":["../../../src/utils/react/useScheme.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\n/**\n * The ambient viewing conditions — the color scheme and the contrast tier the\n * document is showing right now.\n *\n * This module is the single owner of the definition: it builds the `@dark` /\n * `@hc` predefined states that `src/components/Root.tsx` registers with tasty,\n * *and* it answers the same question in JS. One definition, two readers, so the\n * CSS and the JS answers cannot drift apart.\n *\n * **For styling, do not use this.** `{ '': light, '@dark': dark, '@hc': hc }` is\n * the answer, and branching styles in JS gives up the conditionality that lets a\n * scheme flip repaint without a re-render. Two cases the state map cannot serve:\n *\n * 1. **Surfaces the stylesheet does not reach** — a Vega spec, a CodeMirror or\n * Monaco theme, a third-party iframe. They take values, not CSS, so `@dark`\n * never applies and the branch has to happen in JS.\n * 2. **Control state that is not styling** — seeding or labelling a control from\n * the ambient condition, e.g. a Light/Dark or Normal/High-contrast preview\n * selector that starts on whatever the page is already showing.\n *\n * Root-level only, and deliberately not a generic state reader: tasty's state\n * vocabulary mixes element-local states (`hovered`, `pressed`, `disabled`) with\n * ambient ones (`@media(…)`, `@root(…)`), and only the ambient half is\n * answerable without an element. Evaluating the state language in JS would mean\n * a second implementation of the state algebra to keep in agreement with the CSS\n * one, for a question almost every caller asks about the root anyway.\n */\n\n// ============================================================================\n// The definition\n// ============================================================================\n\n/**\n * The `data-*` attribute names the opt-in uses, and the media queries it falls\n * back to. `@root(scheme=dark)` compiles to `:root[data-scheme=\"dark\"]`, hence\n * the `data-` prefix on the DOM side and the bare key on the tasty side.\n */\nconst SCHEME_KEY = 'scheme';\nconst CONTRAST_KEY = 'contrast';\nconst SCHEME_ATTR = `data-${SCHEME_KEY}`;\nconst CONTRAST_ATTR = `data-${CONTRAST_KEY}`;\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\nconst HIGH_CONTRAST_QUERY = '(prefers-contrast: more)';\n\n/**\n * The `@dark` / `@hc` state aliases, in tasty's DSL — registered globally by\n * `<Root>` via `setGlobalPredefinedStates()`.\n *\n * The attribute opt-in wins over the system preference, and the fallback is\n * gated on the attribute being *absent* (`!@root(scheme)`) rather than on it\n * being some other value — so `<html data-scheme=\"light\">` stays light inside a\n * dark OS, which is the whole point of an opt-in. {@link resolveScheme} and\n * {@link resolveHighContrast} read the same way.\n */\nexport const AMBIENT_PREDEFINED_STATES = {\n '@dark': `@root(${SCHEME_KEY}=dark) | (!@root(${SCHEME_KEY}) & @media${DARK_QUERY})`,\n '@hc': `@root(${CONTRAST_KEY}=high) | (!@root(${CONTRAST_KEY}) & @media${HIGH_CONTRAST_QUERY})`,\n} as const;\n\n/** The color scheme the document resolves to — the two arms of the `@dark` state. */\nexport type ColorScheme = 'light' | 'dark';\n\n// ============================================================================\n// Reading\n// ============================================================================\n\n/**\n * `matchMedia` is called per read rather than cached, so a test that stubs it\n * takes effect immediately. Missing (older jsdom, non-DOM runtimes) reads as\n * \"no preference\", which lands on the light / normal-contrast defaults.\n */\nfunction mediaMatches(query: string): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ? window.matchMedia(query).matches\n : false;\n}\n\nfunction rootAttribute(name: string): string | null {\n return typeof document === 'undefined'\n ? null\n : document.documentElement.getAttribute(name);\n}\n\n/**\n * The document's current color scheme, read once — the JS answer to `@dark`.\n *\n * Outside React (a chart spec built in a module, an editor theme registered at\n * import time). In React use {@link useScheme}, which also re-renders on change.\n * Returns `'light'` with no DOM.\n */\nexport function resolveScheme(): ColorScheme {\n const attribute = rootAttribute(SCHEME_ATTR);\n\n if (attribute !== null) {\n return attribute === 'dark' ? 'dark' : 'light';\n }\n\n return mediaMatches(DARK_QUERY) ? 'dark' : 'light';\n}\n\n/**\n * Whether the document is showing the high-contrast tier, read once — the JS\n * answer to `@hc`.\n *\n * Note this is an *ambient* condition, not the theme's `contrastLevel`: the\n * level is a `PaletteConfig` seed the app supplies (read it with\n * `getPaletteConfig()`), while this is the tier the viewer asked for.\n * Returns `false` with no DOM.\n */\nexport function resolveHighContrast(): boolean {\n const attribute = rootAttribute(CONTRAST_ATTR);\n\n if (attribute !== null) {\n return attribute === 'high';\n }\n\n return mediaMatches(HIGH_CONTRAST_QUERY);\n}\n\n// ============================================================================\n// Watching\n// ============================================================================\n\nconst listeners = new Set<() => void>();\n\nlet stopWatching: (() => void) | null = null;\n\nfunction notify() {\n listeners.forEach((listener) => listener());\n}\n\n/**\n * Both inputs have to be watched, because either can decide the answer: the\n * attribute when the opt-in is set, the media query otherwise — an attribute flip\n * is invisible to `matchMedia` and a system flip is invisible to a\n * `MutationObserver`. One observer and one pair of query listeners are shared by\n * every subscriber, and torn down when the last one leaves.\n */\nfunction startWatching(): () => void {\n if (typeof document === 'undefined') {\n return () => {};\n }\n\n const teardowns: (() => void)[] = [];\n\n // Guarded rather than assumed: jsdom ships neither `matchMedia` nor a\n // `MediaQueryList` in every version, and a consumer's unit tests are exactly\n // where a hook like this gets mounted. Losing one source of change is a stale\n // value; throwing is a broken render.\n if (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ) {\n for (const query of [DARK_QUERY, HIGH_CONTRAST_QUERY]) {\n const list = window.matchMedia(query);\n\n if (typeof list?.addEventListener !== 'function') continue;\n\n list.addEventListener('change', notify);\n teardowns.push(() => list.removeEventListener('change', notify));\n }\n }\n\n if (typeof MutationObserver === 'function' && document.documentElement) {\n const observer = new MutationObserver(notify);\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [SCHEME_ATTR, CONTRAST_ATTR],\n });\n\n teardowns.push(() => observer.disconnect());\n }\n\n return () => teardowns.forEach((teardown) => teardown());\n}\n\n/**\n * Subscribe to ambient condition changes — either the scheme or the contrast\n * tier. Returns an unsubscribe function.\n *\n * The listener takes no argument: re-read with {@link resolveScheme} /\n * {@link resolveHighContrast}, which is what the hooks below do. For non-React\n * consumers that own a surface the stylesheet cannot reach — re-theming a Monaco\n * instance, re-rendering a chart.\n */\nexport function subscribeScheme(listener: () => void): () => void {\n listeners.add(listener);\n\n if (!stopWatching) {\n stopWatching = startWatching();\n }\n\n return () => {\n listeners.delete(listener);\n\n if (!listeners.size && stopWatching) {\n stopWatching();\n stopWatching = null;\n }\n };\n}\n\n// ============================================================================\n// React bindings\n// ============================================================================\n\n/**\n * Snapshots are primitives, so React bails out on an unchanged value and no\n * memoization is needed — a contrast change re-runs a `useScheme()` reader's\n * `getSnapshot` and stops there.\n */\nconst getServerScheme = (): ColorScheme => 'light';\nconst getServerHighContrast = () => false;\n\n/**\n * The document's color scheme, kept live — `'light'` or `'dark'`.\n *\n * ```tsx\n * const scheme = useScheme();\n *\n * <VegaChart spec={useMemo(() => buildSpec(scheme), [scheme])} />;\n * ```\n *\n * Follows both the `<html data-scheme>` opt-in and `prefers-color-scheme`,\n * exactly as the `@dark` state does. Under SSR it renders `'light'` and\n * re-renders with the real value after hydration.\n */\nexport function useScheme(): ColorScheme {\n return useSyncExternalStore(subscribeScheme, resolveScheme, getServerScheme);\n}\n\n/**\n * Whether the document is showing the high-contrast tier, kept live — the hook\n * form of {@link resolveHighContrast}, following `<html data-contrast>` and\n * `prefers-contrast` exactly as the `@hc` state does.\n *\n * Under SSR it renders `false` and re-renders with the real value after\n * hydration.\n */\nexport function useHighContrast(): boolean {\n return useSyncExternalStore(\n subscribeScheme,\n resolveHighContrast,\n getServerHighContrast,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAMC,aAAa;AACnB,MAAMC,eAAe;AACrB,MAAMC,cAAc,QAAQF;AAC5B,MAAMG,gBAAgB,QAAQF;AAC9B,MAAMG,aAAa;AACnB,MAAMC,sBAAsB;;;;;;;;;;;AAY5B,MAAaC,4BAA4B;CACvC,SAAS,SAASN,WAAU,mBAAoBA,WAAU,YAAaI,WAAU;CACjF,OAAO,SAASH,aAAY,mBAAoBA,aAAY,YAAaI,oBAAmB;AAC9F;;;;;;AAcA,SAASI,aAAaC,OAAwB;CAC5C,OAAO,OAAOC,WAAW,eACvB,OAAOA,OAAOC,eAAe,aAC3BD,OAAOC,WAAWF,KAAK,CAAC,CAACG,UACzB;AACN;AAEA,SAASC,cAAcC,MAA6B;CAClD,OAAO,OAAOC,aAAa,cACvB,OACAA,SAASC,gBAAgBC,aAAaH,IAAI;AAChD;;;;;;;;AASA,SAAgBI,gBAA6B;CAC3C,MAAMC,YAAYN,cAAcZ,WAAW;CAE3C,IAAIkB,cAAc,MAChB,OAAOA,cAAc,SAAS,SAAS;CAGzC,OAAOX,aAAaL,UAAU,IAAI,SAAS;AAC7C;;;;;;;;;;AAWA,SAAgBiB,sBAA+B;CAC7C,MAAMD,YAAYN,cAAcX,aAAa;CAE7C,IAAIiB,cAAc,MAChB,OAAOA,cAAc;CAGvB,OAAOX,aAAaJ,mBAAmB;AACzC;AAMA,MAAMiB,4BAAY,IAAIC,IAAgB;AAEtC,IAAIC,eAAoC;AAExC,SAASC,SAAS;CAChBH,UAAUI,SAASC,aAAaA,SAAS,CAAC;AAC5C;;;;;;;;AASA,SAASC,gBAA4B;CACnC,IAAI,OAAOZ,aAAa,aACtB,aAAa,CAAC;CAGhB,MAAMa,YAA4B,CAAA;CAMlC,IACE,OAAOlB,WAAW,eAClB,OAAOA,OAAOC,eAAe,YAE7B,KAAK,MAAMF,SAAS,CAACN,YAAYC,mBAAmB,GAAG;EACrD,MAAMyB,OAAOnB,OAAOC,WAAWF,KAAK;EAEpC,IAAI,OAAOoB,MAAMC,qBAAqB,YAAY;EAElDD,KAAKC,iBAAiB,UAAUN,MAAM;EACtCI,UAAUG,WAAWF,KAAKG,oBAAoB,UAAUR,MAAM,CAAC;CACjE;CAGF,IAAI,OAAOS,qBAAqB,cAAclB,SAASC,iBAAiB;EACtE,MAAMkB,WAAW,IAAID,iBAAiBT,MAAM;EAE5CU,SAASC,QAAQpB,SAASC,iBAAiB;GACzCoB,YAAY;GACZC,iBAAiB,CAACpC,aAAaC,aAAa;EAC9C,CAAC;EAED0B,UAAUG,WAAWG,SAASI,WAAW,CAAC;CAC5C;CAEA,aAAaV,UAAUH,SAASc,aAAaA,SAAS,CAAC;AACzD;;;;;;;;;;AAWA,SAAgBC,gBAAgBd,UAAkC;CAChEL,UAAUoB,IAAIf,QAAQ;CAEtB,IAAI,CAACH,cACHA,eAAeI,cAAc;CAG/B,aAAa;EACXN,UAAUqB,OAAOhB,QAAQ;EAEzB,IAAI,CAACL,UAAUsB,QAAQpB,cAAc;GACnCA,aAAa;GACbA,eAAe;EACjB;CACF;AACF;;;;;;AAWA,MAAMqB,wBAAqC;AAC3C,MAAMC,8BAA8B;;;;;;;;;;;;;;AAepC,SAAOC,YAAA;CAAA,OACEhD,qBAAqB0C,iBAAiBtB,eAAe0B,eAAe;AAAC;;;;;;;;;AAW9E,SAAOG,kBAAA;CAAA,OACEjD,qBACL0C,iBACApB,qBACAyB,qBACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"useScheme.js","names":["useSyncExternalStore","SCHEME_KEY","CONTRAST_KEY","SCHEME_ATTR","CONTRAST_ATTR","DARK_QUERY","HIGH_CONTRAST_QUERY","REDUCED_MOTION_QUERY","AMBIENT_PREDEFINED_STATES","const","ColorScheme","mediaMatches","query","window","matchMedia","matches","rootAttribute","name","document","documentElement","getAttribute","resolveScheme","attribute","resolveHighContrast","listeners","Set","stopWatching","notify","forEach","listener","startWatching","teardowns","list","addEventListener","push","removeEventListener","MutationObserver","observer","observe","attributes","attributeFilter","disconnect","teardown","subscribeScheme","add","delete","size","getServerScheme","getServerHighContrast","useScheme","useHighContrast"],"sources":["../../../src/utils/react/useScheme.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react';\n\n/**\n * The ambient viewing conditions — the color scheme and the contrast tier the\n * document is showing right now.\n *\n * This module is the single owner of the definition: it builds the `@dark` /\n * `@hc` predefined states that `src/components/Root.tsx` registers with tasty,\n * *and* it answers the same question in JS. One definition, two readers, so the\n * CSS and the JS answers cannot drift apart.\n *\n * **For styling, do not use this.** `{ '': light, '@dark': dark, '@hc': hc }` is\n * the answer, and branching styles in JS gives up the conditionality that lets a\n * scheme flip repaint without a re-render. Two cases the state map cannot serve:\n *\n * 1. **Surfaces the stylesheet does not reach** — a Vega spec, a CodeMirror or\n * Monaco theme, a third-party iframe. They take values, not CSS, so `@dark`\n * never applies and the branch has to happen in JS.\n * 2. **Control state that is not styling** — seeding or labelling a control from\n * the ambient condition, e.g. a Light/Dark or Normal/High-contrast preview\n * selector that starts on whatever the page is already showing.\n *\n * Root-level only, and deliberately not a generic state reader: tasty's state\n * vocabulary mixes element-local states (`hovered`, `pressed`, `disabled`) with\n * ambient ones (`@media(…)`, `@root(…)`), and only the ambient half is\n * answerable without an element. Evaluating the state language in JS would mean\n * a second implementation of the state algebra to keep in agreement with the CSS\n * one, for a question almost every caller asks about the root anyway.\n */\n\n// ============================================================================\n// The definition\n// ============================================================================\n\n/**\n * The `data-*` attribute names the opt-in uses, and the media queries it falls\n * back to. `@root(scheme=dark)` compiles to `:root[data-scheme=\"dark\"]`, hence\n * the `data-` prefix on the DOM side and the bare key on the tasty side.\n */\nconst SCHEME_KEY = 'scheme';\nconst CONTRAST_KEY = 'contrast';\nconst SCHEME_ATTR = `data-${SCHEME_KEY}`;\nconst CONTRAST_ATTR = `data-${CONTRAST_KEY}`;\nconst DARK_QUERY = '(prefers-color-scheme: dark)';\nconst HIGH_CONTRAST_QUERY = '(prefers-contrast: more)';\nconst REDUCED_MOTION_QUERY = '(prefers-reduced-motion: reduce)';\n\n/**\n * The `@dark` / `@hc` / `@reduced-motion` state aliases, in tasty's DSL —\n * registered globally by `<Root>` via `setGlobalPredefinedStates()`.\n *\n * `@reduced-motion` follows the system preference alone. For the two schemes,\n * the attribute opt-in wins over the system preference, and the fallback is\n * gated on the attribute being *absent* (`!@root(scheme)`) rather than on it\n * being some other value — so `<html data-scheme=\"light\">` stays light inside a\n * dark OS, which is the whole point of an opt-in. {@link resolveScheme} and\n * {@link resolveHighContrast} read the same way.\n */\nexport const AMBIENT_PREDEFINED_STATES = {\n '@dark': `@root(${SCHEME_KEY}=dark) | (!@root(${SCHEME_KEY}) & @media${DARK_QUERY})`,\n '@hc': `@root(${CONTRAST_KEY}=high) | (!@root(${CONTRAST_KEY}) & @media${HIGH_CONTRAST_QUERY})`,\n '@reduced-motion': `@media${REDUCED_MOTION_QUERY}`,\n} as const;\n\n/** The color scheme the document resolves to — the two arms of the `@dark` state. */\nexport type ColorScheme = 'light' | 'dark';\n\n// ============================================================================\n// Reading\n// ============================================================================\n\n/**\n * `matchMedia` is called per read rather than cached, so a test that stubs it\n * takes effect immediately. Missing (older jsdom, non-DOM runtimes) reads as\n * \"no preference\", which lands on the light / normal-contrast defaults.\n */\nfunction mediaMatches(query: string): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ? window.matchMedia(query).matches\n : false;\n}\n\nfunction rootAttribute(name: string): string | null {\n return typeof document === 'undefined'\n ? null\n : document.documentElement.getAttribute(name);\n}\n\n/**\n * The document's current color scheme, read once — the JS answer to `@dark`.\n *\n * Outside React (a chart spec built in a module, an editor theme registered at\n * import time). In React use {@link useScheme}, which also re-renders on change.\n * Returns `'light'` with no DOM.\n */\nexport function resolveScheme(): ColorScheme {\n const attribute = rootAttribute(SCHEME_ATTR);\n\n if (attribute !== null) {\n return attribute === 'dark' ? 'dark' : 'light';\n }\n\n return mediaMatches(DARK_QUERY) ? 'dark' : 'light';\n}\n\n/**\n * Whether the document is showing the high-contrast tier, read once — the JS\n * answer to `@hc`.\n *\n * Note this is an *ambient* condition, not the theme's `contrastLevel`: the\n * level is a `PaletteConfig` seed the app supplies (read it with\n * `getPaletteConfig()`), while this is the tier the viewer asked for.\n * Returns `false` with no DOM.\n */\nexport function resolveHighContrast(): boolean {\n const attribute = rootAttribute(CONTRAST_ATTR);\n\n if (attribute !== null) {\n return attribute === 'high';\n }\n\n return mediaMatches(HIGH_CONTRAST_QUERY);\n}\n\n// ============================================================================\n// Watching\n// ============================================================================\n\nconst listeners = new Set<() => void>();\n\nlet stopWatching: (() => void) | null = null;\n\nfunction notify() {\n listeners.forEach((listener) => listener());\n}\n\n/**\n * Both inputs have to be watched, because either can decide the answer: the\n * attribute when the opt-in is set, the media query otherwise — an attribute flip\n * is invisible to `matchMedia` and a system flip is invisible to a\n * `MutationObserver`. One observer and one pair of query listeners are shared by\n * every subscriber, and torn down when the last one leaves.\n */\nfunction startWatching(): () => void {\n if (typeof document === 'undefined') {\n return () => {};\n }\n\n const teardowns: (() => void)[] = [];\n\n // Guarded rather than assumed: jsdom ships neither `matchMedia` nor a\n // `MediaQueryList` in every version, and a consumer's unit tests are exactly\n // where a hook like this gets mounted. Losing one source of change is a stale\n // value; throwing is a broken render.\n if (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function'\n ) {\n for (const query of [DARK_QUERY, HIGH_CONTRAST_QUERY]) {\n const list = window.matchMedia(query);\n\n if (typeof list?.addEventListener !== 'function') continue;\n\n list.addEventListener('change', notify);\n teardowns.push(() => list.removeEventListener('change', notify));\n }\n }\n\n if (typeof MutationObserver === 'function' && document.documentElement) {\n const observer = new MutationObserver(notify);\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [SCHEME_ATTR, CONTRAST_ATTR],\n });\n\n teardowns.push(() => observer.disconnect());\n }\n\n return () => teardowns.forEach((teardown) => teardown());\n}\n\n/**\n * Subscribe to ambient condition changes — either the scheme or the contrast\n * tier. Returns an unsubscribe function.\n *\n * The listener takes no argument: re-read with {@link resolveScheme} /\n * {@link resolveHighContrast}, which is what the hooks below do. For non-React\n * consumers that own a surface the stylesheet cannot reach — re-theming a Monaco\n * instance, re-rendering a chart.\n */\nexport function subscribeScheme(listener: () => void): () => void {\n listeners.add(listener);\n\n if (!stopWatching) {\n stopWatching = startWatching();\n }\n\n return () => {\n listeners.delete(listener);\n\n if (!listeners.size && stopWatching) {\n stopWatching();\n stopWatching = null;\n }\n };\n}\n\n// ============================================================================\n// React bindings\n// ============================================================================\n\n/**\n * Snapshots are primitives, so React bails out on an unchanged value and no\n * memoization is needed — a contrast change re-runs a `useScheme()` reader's\n * `getSnapshot` and stops there.\n */\nconst getServerScheme = (): ColorScheme => 'light';\nconst getServerHighContrast = () => false;\n\n/**\n * The document's color scheme, kept live — `'light'` or `'dark'`.\n *\n * ```tsx\n * const scheme = useScheme();\n *\n * <VegaChart spec={useMemo(() => buildSpec(scheme), [scheme])} />;\n * ```\n *\n * Follows both the `<html data-scheme>` opt-in and `prefers-color-scheme`,\n * exactly as the `@dark` state does. Under SSR it renders `'light'` and\n * re-renders with the real value after hydration.\n */\nexport function useScheme(): ColorScheme {\n return useSyncExternalStore(subscribeScheme, resolveScheme, getServerScheme);\n}\n\n/**\n * Whether the document is showing the high-contrast tier, kept live — the hook\n * form of {@link resolveHighContrast}, following `<html data-contrast>` and\n * `prefers-contrast` exactly as the `@hc` state does.\n *\n * Under SSR it renders `false` and re-renders with the real value after\n * hydration.\n */\nexport function useHighContrast(): boolean {\n return useSyncExternalStore(\n subscribeScheme,\n resolveHighContrast,\n getServerHighContrast,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAMC,aAAa;AACnB,MAAMC,eAAe;AACrB,MAAMC,cAAc,QAAQF;AAC5B,MAAMG,gBAAgB,QAAQF;AAC9B,MAAMG,aAAa;AACnB,MAAMC,sBAAsB;;;;;;;;;;;;AAc5B,MAAaE,4BAA4B;CACvC,SAAS,SAASP,WAAU,mBAAoBA,WAAU,YAAaI,WAAU;CACjF,OAAO,SAASH,aAAY,mBAAoBA,aAAY,YAAaI,oBAAmB;CAC5F,mBAAmB;AACrB;;;;;;AAcA,SAASK,aAAaC,OAAwB;CAC5C,OAAO,OAAOC,WAAW,eACvB,OAAOA,OAAOC,eAAe,aAC3BD,OAAOC,WAAWF,KAAK,CAAC,CAACG,UACzB;AACN;AAEA,SAASC,cAAcC,MAA6B;CAClD,OAAO,OAAOC,aAAa,cACvB,OACAA,SAASC,gBAAgBC,aAAaH,IAAI;AAChD;;;;;;;;AASA,SAAgBI,gBAA6B;CAC3C,MAAMC,YAAYN,cAAcb,WAAW;CAE3C,IAAImB,cAAc,MAChB,OAAOA,cAAc,SAAS,SAAS;CAGzC,OAAOX,aAAaN,UAAU,IAAI,SAAS;AAC7C;;;;;;;;;;AAWA,SAAgBkB,sBAA+B;CAC7C,MAAMD,YAAYN,cAAcZ,aAAa;CAE7C,IAAIkB,cAAc,MAChB,OAAOA,cAAc;CAGvB,OAAOX,aAAaL,mBAAmB;AACzC;AAMA,MAAMkB,4BAAY,IAAIC,IAAgB;AAEtC,IAAIC,eAAoC;AAExC,SAASC,SAAS;CAChBH,UAAUI,SAASC,aAAaA,SAAS,CAAC;AAC5C;;;;;;;;AASA,SAASC,gBAA4B;CACnC,IAAI,OAAOZ,aAAa,aACtB,aAAa,CAAC;CAGhB,MAAMa,YAA4B,CAAA;CAMlC,IACE,OAAOlB,WAAW,eAClB,OAAOA,OAAOC,eAAe,YAE7B,KAAK,MAAMF,SAAS,CAACP,YAAYC,mBAAmB,GAAG;EACrD,MAAM0B,OAAOnB,OAAOC,WAAWF,KAAK;EAEpC,IAAI,OAAOoB,MAAMC,qBAAqB,YAAY;EAElDD,KAAKC,iBAAiB,UAAUN,MAAM;EACtCI,UAAUG,WAAWF,KAAKG,oBAAoB,UAAUR,MAAM,CAAC;CACjE;CAGF,IAAI,OAAOS,qBAAqB,cAAclB,SAASC,iBAAiB;EACtE,MAAMkB,WAAW,IAAID,iBAAiBT,MAAM;EAE5CU,SAASC,QAAQpB,SAASC,iBAAiB;GACzCoB,YAAY;GACZC,iBAAiB,CAACrC,aAAaC,aAAa;EAC9C,CAAC;EAED2B,UAAUG,WAAWG,SAASI,WAAW,CAAC;CAC5C;CAEA,aAAaV,UAAUH,SAASc,aAAaA,SAAS,CAAC;AACzD;;;;;;;;;;AAWA,SAAgBC,gBAAgBd,UAAkC;CAChEL,UAAUoB,IAAIf,QAAQ;CAEtB,IAAI,CAACH,cACHA,eAAeI,cAAc;CAG/B,aAAa;EACXN,UAAUqB,OAAOhB,QAAQ;EAEzB,IAAI,CAACL,UAAUsB,QAAQpB,cAAc;GACnCA,aAAa;GACbA,eAAe;EACjB;CACF;AACF;;;;;;AAWA,MAAMqB,wBAAqC;AAC3C,MAAMC,8BAA8B;;;;;;;;;;;;;;AAepC,SAAOC,YAAA;CAAA,OACEjD,qBAAqB2C,iBAAiBtB,eAAe0B,eAAe;AAAC;;;;;;;;;AAW9E,SAAOG,kBAAA;CAAA,OACElD,qBACL2C,iBACApB,qBACAyB,qBACF;AAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
import { Fragment, isValidElement } from "react";
|
|
3
3
|
//#region src/utils/react/wrapNodeIfPlain.ts
|
|
4
4
|
function wrapNodeIfPlain(children, render) {
|
package/dist/utils/selection.js
CHANGED
package/dist/utils/styles.js
CHANGED
package/dist/utils/tree.js
CHANGED
package/dist/utils/warnings.js
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.206.0 | Cube Dev Team */
|
|
2
2
|
//#region src/version.ts
|
|
3
|
-
const VERSION = "0.
|
|
4
|
-
const TASTY_VERSION = "3.
|
|
3
|
+
const VERSION = "0.206.0";
|
|
4
|
+
const TASTY_VERSION = "3.17.1";
|
|
5
5
|
if (typeof window !== "undefined") {
|
|
6
6
|
const version = VERSION;
|
|
7
7
|
const tastyVersion = TASTY_VERSION;
|
package/docs/Theming.md
CHANGED
|
@@ -451,7 +451,7 @@ invalidatePaletteTokens(); // only needed once the kit is already mounted
|
|
|
451
451
|
|
|
452
452
|
`contrastLevel` is the one field the kit writes to Glaze's global config, and it only ever does so if you asked for a level. A host that sets its own `glaze.configure({ contrastLevel })` and never passes `contrastLevel` here keeps it.
|
|
453
453
|
|
|
454
|
-
**Some things are not tunable at all.** Tasty locks its configuration on the first style injection, so the `@dark` / `@hc` state definitions (set in `Root`) are fixed for the lifetime of the page. Only token _values_ stay mutable — which is all re-seeding needs.
|
|
454
|
+
**Some things are not tunable at all.** Tasty locks its configuration on the first style injection, so the `@dark` / `@hc` / `@reduced-motion` state definitions (set in `Root`) are fixed for the lifetime of the page. Only token _values_ stay mutable — which is all re-seeding needs.
|
|
455
455
|
|
|
456
456
|
## See also
|
|
457
457
|
|
package/docs/Usage.md
CHANGED
|
@@ -447,6 +447,17 @@ An intended override takes a disable comment with its reason on the line before
|
|
|
447
447
|
|
|
448
448
|
With this rule on, `tasty/no-styles-prop` can stay off, so the primitives keep their `styles`.
|
|
449
449
|
|
|
450
|
+
The same `extends` gives the plugin's other rules the names UI Kit defines: its tokens, presets and recipes, and the `@dark`, `@hc` and `@reduced-motion` state aliases. `tasty/valid-color-token`, `tasty/valid-custom-property`, `tasty/valid-preset`, `tasty/valid-recipe`, `tasty/valid-state-key` and `tasty/no-unknown-state-alias` then report only names that don't exist. List what your app defines itself, in its own `configure()` or `tokens`, in its own config, which adds to the lists it extends:
|
|
451
|
+
|
|
452
|
+
```ts
|
|
453
|
+
// tasty.config.ts
|
|
454
|
+
export default {
|
|
455
|
+
extends: '@cube-dev/ui-kit',
|
|
456
|
+
states: ['@mobile'],
|
|
457
|
+
tokens: ['#brand'],
|
|
458
|
+
};
|
|
459
|
+
```
|
|
460
|
+
|
|
450
461
|
## Recipes
|
|
451
462
|
|
|
452
463
|
Reusable style presets applied via the `recipe` style property. Defined in `src/components/Root.tsx`.
|
|
@@ -499,6 +510,21 @@ fill: {
|
|
|
499
510
|
}
|
|
500
511
|
```
|
|
501
512
|
|
|
513
|
+
### Reduced Motion
|
|
514
|
+
|
|
515
|
+
`<Root>` registers a global `@reduced-motion` state beside [`@dark` and `@hc`](#color-schemes). It matches `@media (prefers-reduced-motion: reduce)`. Use it to stop or shorten motion for users who ask for less:
|
|
516
|
+
|
|
517
|
+
```tsx
|
|
518
|
+
const Spinner = tasty({
|
|
519
|
+
styles: {
|
|
520
|
+
animation: 'spin 1s linear infinite',
|
|
521
|
+
animationPlayState: { '': 'running', '@reduced-motion': 'paused' },
|
|
522
|
+
},
|
|
523
|
+
});
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
It follows the system preference alone, with no attribute opt-in.
|
|
527
|
+
|
|
502
528
|
## Icons
|
|
503
529
|
|
|
504
530
|
Icons live in `src/icons/`. Use existing icons when possible; otherwise use `@tabler/icons-react`.
|
|
@@ -399,7 +399,7 @@ By default, Item shows an auto tooltip when content overflows. The label and a s
|
|
|
399
399
|
- `string` - Shows tooltip with the specified text (always visible, not auto)
|
|
400
400
|
- `object` - Advanced configuration:
|
|
401
401
|
- `title?: string` - Custom tooltip text (when provided, always shows tooltip unless `auto: true`)
|
|
402
|
-
- `auto?: boolean` - Enable/disable auto overflow behavior (defaults to `true` when no `title` is provided)
|
|
402
|
+
- `auto?: boolean` - Enable/disable auto overflow behavior (defaults to `true` when no `title` is provided). The automatic tooltip measures only a string label or description, because it shows the text that is cut off. With a `title`, `auto: true` measures a label or description of any kind, an element one included, and shows the `title` only while one of them is cut off. Only their own boxes are measured, so a child that clips its own text doesn't count. The check reruns when they resize or the `title` text changes, so derive a string `title` from the same text.
|
|
403
403
|
- `placement?: string` - Tooltip position (top, bottom, left, right, etc.)
|
|
404
404
|
- Plus other [TooltipProvider props](../overlays/Tooltip.md)
|
|
405
405
|
|