@cube-dev/ui-kit 0.211.0 → 0.213.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.d.ts +2 -1
- package/dist/components/GridProvider.js +6 -4
- package/dist/components/GridProvider.js.map +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/AutoCollapseObserver.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/Button/index.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.d.ts +3 -2
- package/dist/components/actions/CommandMenu/CommandMenu.js +128 -131
- package/dist/components/actions/CommandMenu/CommandMenu.js.map +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 +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/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 +4 -3
- package/dist/components/actions/Menu/MenuTrigger.js.map +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +4 -3
- package/dist/components/actions/Menu/SubMenuTrigger.js.map +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/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 +5 -1
- package/dist/components/content/Alert/Alert.js.map +1 -1
- package/dist/components/content/Alert/types.d.ts +8 -0
- package/dist/components/content/Alert/use-alert.js +24 -20
- package/dist/components/content/Alert/use-alert.js.map +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.d.ts +11 -1
- package/dist/components/content/Card/Card.js +52 -22
- package/dist/components/content/Card/Card.js.map +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.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +6 -10
- package/dist/components/content/Item/ItemWithNativeLinks.js.map +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.d.ts +3 -2
- package/dist/components/content/Layout/Layout.js +12 -5
- package/dist/components/content/Layout/Layout.js.map +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.d.ts +3 -2
- package/dist/components/content/Layout/LayoutContainer.js +5 -3
- package/dist/components/content/Layout/LayoutContainer.js.map +1 -1
- package/dist/components/content/Layout/LayoutContent.d.ts +3 -2
- package/dist/components/content/Layout/LayoutContent.js +56 -45
- 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 +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 +3 -3
- package/dist/components/content/Layout/LayoutHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutPane.d.ts +3 -2
- package/dist/components/content/Layout/LayoutPane.js +66 -55
- package/dist/components/content/Layout/LayoutPane.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanel.d.ts +3 -2
- package/dist/components/content/Layout/LayoutPanel.js +15 -8
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.d.ts +3 -2
- package/dist/components/content/Layout/LayoutPanelHeader.js +38 -68
- package/dist/components/content/Layout/LayoutPanelHeader.js.map +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.d.ts +3 -2
- package/dist/components/content/Placeholder/Placeholder.js +16 -37
- package/dist/components/content/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.d.ts +8 -0
- package/dist/components/content/Result/Result.js +8 -3
- package/dist/components/content/Result/Result.js.map +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +11 -3
- package/dist/components/content/Tree/Tree.js.map +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/types.d.ts +3 -2
- 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 +1 -1
- package/dist/components/data/DataTable/DataTable.js +3 -1
- package/dist/components/data/DataTable/DataTable.js.map +1 -1
- package/dist/components/data/DataTable/types.d.ts +3 -2
- package/dist/components/data/ItemTable/ItemTable.js +3 -1
- package/dist/components/data/ItemTable/ItemTable.js.map +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/types.d.ts +3 -2
- 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.d.ts +1 -0
- package/dist/components/data/TableBase/TableView.js +7 -2
- package/dist/components/data/TableBase/TableView.js.map +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 +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.d.ts +3 -2
- package/dist/components/fields/Checkbox/Checkbox.js +5 -6
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.d.ts +3 -2
- package/dist/components/fields/Checkbox/CheckboxGroup.js +38 -31
- package/dist/components/fields/Checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.d.ts +3 -2
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js.map +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +3 -2
- package/dist/components/fields/ColorPicker/ColorPicker.js +150 -137
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.d.ts +3 -2
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +47 -28
- package/dist/components/fields/ColorSwatch/ColorSwatch.js.map +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.d.ts +3 -2
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +157 -135
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +3 -2
- package/dist/components/fields/ComboBox/ComboBox.js +240 -225
- package/dist/components/fields/ComboBox/ComboBox.js.map +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 +4 -3
- package/dist/components/fields/DatePicker/CalendarPopover.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInput.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateInput.js +4 -1
- package/dist/components/fields/DatePicker/DateInput.js.map +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +108 -92
- package/dist/components/fields/DatePicker/DateInputBase.js.map +1 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DatePicker.js +42 -32
- 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 +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 +3 -2
- package/dist/components/fields/DatePicker/DateRangePicker.js +32 -27
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.d.ts +3 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +185 -175
- 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.d.ts +3 -2
- package/dist/components/fields/DatePicker/PeriodPicker.js +97 -86
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.d.ts +3 -2
- package/dist/components/fields/DatePicker/TimeInput.js +4 -1
- package/dist/components/fields/DatePicker/TimeInput.js.map +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.d.ts +3 -2
- package/dist/components/fields/FileInput/FileInput.js +104 -87
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +3 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterListBox/styled.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +2 -2
- package/dist/components/fields/FilterPicker/FilterPicker.js +4 -3
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +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.d.ts +3 -2
- package/dist/components/fields/ListBox/ListBox.js +15 -3
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/empty-row.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +4 -3
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +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.d.ts +2 -2
- package/dist/components/fields/Picker/Picker.js +4 -3
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +6 -5
- package/dist/components/fields/RadioGroup/Radio.js +113 -137
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.d.ts +3 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +67 -79
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/joined-styles.js +100 -0
- package/dist/components/fields/RadioGroup/joined-styles.js.map +1 -0
- package/dist/components/fields/SearchComboBox/SearchComboBox.d.ts +3 -2
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +7 -3
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.d.ts +5 -3
- package/dist/components/fields/Select/Select.js +87 -69
- package/dist/components/fields/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +44 -24
- package/dist/components/fields/Slider/SliderBase.js.map +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/Slider/types.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.d.ts +3 -2
- package/dist/components/fields/Switch/Switch.js +9 -3
- package/dist/components/fields/Switch/Switch.js.map +1 -1
- package/dist/components/fields/TagInput/TagInput.d.ts +3 -2
- package/dist/components/fields/TagInput/TagInput.js +5 -5
- package/dist/components/fields/TagInput/TagInput.js.map +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.d.ts +3 -2
- package/dist/components/fields/TextInput/TextInputBase.js +14 -3
- package/dist/components/fields/TextInput/TextInputBase.js.map +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/ToggleGroup/ToggleGroup.d.ts +53 -0
- package/dist/components/fields/ToggleGroup/ToggleGroup.js +237 -0
- package/dist/components/fields/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.d.ts +29 -0
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +166 -0
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js.map +1 -0
- package/dist/components/fields/ToggleGroup/context.d.ts +8 -0
- package/dist/components/fields/ToggleGroup/context.js +13 -0
- package/dist/components/fields/ToggleGroup/context.js.map +1 -0
- package/dist/components/fields/ToggleGroup/index.d.ts +5 -0
- 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/index.d.ts +5 -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.d.ts +3 -2
- package/dist/components/form/Form/Form.js +6 -4
- package/dist/components/form/Form/Form.js.map +1 -1
- package/dist/components/form/Form/FormContext.js +1 -1
- package/dist/components/form/Form/FormElement.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +43 -40
- 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 +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.d.ts +3 -2
- package/dist/components/form/Label.js +31 -26
- package/dist/components/form/Label.js.map +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 +3 -2
- package/dist/components/layout/Panel.js.map +1 -1
- package/dist/components/layout/Prefix.d.ts +3 -2
- package/dist/components/layout/Prefix.js +22 -17
- package/dist/components/layout/Prefix.js.map +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.d.ts +3 -2
- package/dist/components/layout/Suffix.js +22 -17
- package/dist/components/layout/Suffix.js.map +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 +148 -143
- 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 +15 -5
- 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 +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.d.ts +4 -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 +54 -101
- package/dist/components/navigation/Tabs/use-tab-indicator.js.map +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.d.ts +16 -3
- package/dist/components/overlays/Dialog/Dialog.js +13 -5
- 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.js +8 -4
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +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 +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 +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.d.ts +3 -2
- package/dist/components/overlays/Tooltip/Tooltip.js +60 -28
- package/dist/components/overlays/Tooltip/Tooltip.js.map +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/TooltipTrigger.js.map +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 +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 +3 -3
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +30 -5
- package/dist/eslint-plugin/defaults.generated.js.map +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 +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- 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.d.ts +4 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +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 +2 -2
- package/dist/tokens/base.js.map +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.d.ts +1 -1
- package/dist/tokens/colors.js +2 -2
- package/dist/tokens/colors.js.map +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 +12 -3
- package/dist/tokens/palette.js.map +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/layout-scale.js +25 -0
- package/dist/utils/layout-scale.js.map +1 -0
- 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/componentBaseProps.d.ts +9 -0
- package/dist/utils/react/componentBaseProps.js +15 -0
- package/dist/utils/react/componentBaseProps.js.map +1 -0
- 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.d.ts +2 -0
- package/dist/utils/react/mergeProps.js +4 -2
- package/dist/utils/react/mergeProps.js.map +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/pickBaseCustomizationProps.d.ts +2 -0
- package/dist/utils/react/pickBaseCustomizationProps.js +16 -0
- package/dist/utils/react/pickBaseCustomizationProps.js.map +1 -0
- 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/useOverlayPosition.js +75 -0
- package/dist/utils/react/useOverlayPosition.js.map +1 -0
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +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 +2 -2
- package/docs/BaseProperties.md +9 -4
- package/docs/CreateComponent.md +15 -8
- package/docs/Theming.md +2 -0
- package/docs/Usage.md +18 -0
- package/docs/components/GridProvider.md +1 -1
- package/docs/components/actions/Button.md +1 -1
- package/docs/components/actions/CommandMenu.md +1 -1
- package/docs/components/content/Alert.md +1 -0
- package/docs/components/content/Card.md +15 -1
- package/docs/components/content/Layout.md +21 -2
- package/docs/components/content/Result.md +2 -0
- package/docs/components/fields/ColorSwatchGroup.md +7 -5
- package/docs/components/fields/RadioGroup.md +13 -0
- package/docs/components/fields/ToggleGroup.md +227 -0
- package/docs/components/layout/Panel.md +1 -0
- package/docs/components/organisms/StatsCard.md +1 -0
- package/docs/components/overlays/AlertDialog.md +1 -0
- package/docs/components/overlays/Dialog.md +4 -1
- package/docs/components/overlays/DialogForm.md +1 -0
- package/package.json +5 -4
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles, mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
|
+
import { filterComponentBaseProps } from "../../../utils/react/componentBaseProps.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
|
-
import { CONTAINER_STYLES,
|
|
6
|
+
import { CONTAINER_STYLES, keyframes, tasty } from "@tenphi/tasty";
|
|
6
7
|
import { createContext, forwardRef, useContext } from "react";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/content/Placeholder/Placeholder.tsx
|
|
@@ -54,13 +55,12 @@ const StyledPlaceholder = tasty({ styles: {
|
|
|
54
55
|
*/
|
|
55
56
|
const PlaceholderGroupContext = createContext(false);
|
|
56
57
|
const Placeholder = forwardRef(function Placeholder(allProps, ref) {
|
|
57
|
-
const $ = c(
|
|
58
|
+
const $ = c(3);
|
|
58
59
|
const { size: t0, isStatic, circle, ...props } = allProps;
|
|
59
60
|
const size = t0 === void 0 ? "2x" : t0;
|
|
60
61
|
const { t } = useI18n();
|
|
61
62
|
const isInGroup = useContext(PlaceholderGroupContext);
|
|
62
63
|
const styles = extractStyles(props, CONTAINER_STYLES);
|
|
63
|
-
const T0 = StyledPlaceholder;
|
|
64
64
|
let t1;
|
|
65
65
|
if ($[0] !== isInGroup || $[1] !== t) {
|
|
66
66
|
t1 = isInGroup ? { "aria-hidden": true } : {
|
|
@@ -71,39 +71,18 @@ const Placeholder = forwardRef(function Placeholder(allProps, ref) {
|
|
|
71
71
|
$[1] = t;
|
|
72
72
|
$[2] = t1;
|
|
73
73
|
} else t1 = $[2];
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
animated:
|
|
81
|
-
circle
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} else t5 = $[5];
|
|
87
|
-
const t6 = mergeStyleLayers({ height: size }, styles);
|
|
88
|
-
let t7;
|
|
89
|
-
if ($[6] !== T0 || $[7] !== ref || $[8] !== t1 || $[9] !== t2 || $[10] !== t5 || $[11] !== t6) {
|
|
90
|
-
t7 = /* @__PURE__ */ jsx(T0, {
|
|
91
|
-
...t1,
|
|
92
|
-
...t2,
|
|
93
|
-
"data-loading-placeholder": t3,
|
|
94
|
-
ref,
|
|
95
|
-
mods: t5,
|
|
96
|
-
styles: t6
|
|
97
|
-
});
|
|
98
|
-
$[6] = T0;
|
|
99
|
-
$[7] = ref;
|
|
100
|
-
$[8] = t1;
|
|
101
|
-
$[9] = t2;
|
|
102
|
-
$[10] = t5;
|
|
103
|
-
$[11] = t6;
|
|
104
|
-
$[12] = t7;
|
|
105
|
-
} else t7 = $[12];
|
|
106
|
-
return t7;
|
|
74
|
+
return /* @__PURE__ */ jsx(StyledPlaceholder, {
|
|
75
|
+
...t1,
|
|
76
|
+
...filterComponentBaseProps(props, { eventProps: true }),
|
|
77
|
+
"data-loading-placeholder": "",
|
|
78
|
+
ref,
|
|
79
|
+
mods: {
|
|
80
|
+
animated: !isStatic,
|
|
81
|
+
circle,
|
|
82
|
+
...props.mods
|
|
83
|
+
},
|
|
84
|
+
styles: mergeStyleLayers({ height: size }, styles)
|
|
85
|
+
});
|
|
107
86
|
});
|
|
108
87
|
//#endregion
|
|
109
88
|
export { Placeholder, PlaceholderGroupContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Placeholder.js","names":["
|
|
1
|
+
{"version":3,"file":"Placeholder.js","names":["CONTAINER_STYLES","ContainerStyleProps","keyframes","Styles","tasty","createContext","forwardRef","useContext","useI18n","filterComponentBaseProps","extractStyles","mergeStyleLayers","ComponentBaseProps","placeholderAnimation","StyledPlaceholder","styles","display","height","opacity","aspectRatio","circle","radius","backgroundRepeat","backgroundSize","fill","animation","animated","image","PlaceholderGroupContext","CubePlaceholderProps","size","isStatic","Placeholder","allProps","ref","$","_c","t0","props","undefined","t","isInGroup","t1","role","eventProps","mods","_c"],"sources":["../../../../src/components/content/Placeholder/Placeholder.tsx"],"sourcesContent":["import {\n CONTAINER_STYLES,\n ContainerStyleProps,\n keyframes,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport { createContext, forwardRef, useContext } from 'react';\n\nimport { useI18n } from '../../../i18n/useI18n';\nimport { filterComponentBaseProps } from '../../../utils/react/componentBaseProps';\nimport { extractStyles, mergeStyleLayers } from '../../../utils/styles';\n\nimport type { ComponentBaseProps } from '../../../utils/react/componentBaseProps';\n\n// Create the placeholder animation using keyframes helper\nconst placeholderAnimation = keyframes({\n '0%': {\n 'background-position': '0 0',\n },\n '100%': {\n 'background-position': '$placeholder-animation-size 0',\n },\n});\n\nconst StyledPlaceholder = tasty({\n styles: {\n display: 'block',\n height: '2x',\n opacity: '.35',\n aspectRatio: {\n '': 'initial',\n circle: '1 / 1',\n },\n radius: {\n '': '1r',\n circle: 'round',\n },\n\n // CSS custom properties for animation\n '$placeholder-animation-time': '1.4s',\n '$placeholder-animation-size': 'calc((180rem + 100vw) / 3)',\n\n // Base background styling\n backgroundRepeat: 'repeat',\n backgroundSize: '$placeholder-animation-size',\n fill: '#dark.15',\n\n // Animated state styling\n animation: {\n '': 'none',\n animated: `${placeholderAnimation} $placeholder-animation-time linear infinite`,\n },\n image: {\n '': 'none',\n animated: `linear-gradient(\n 135deg,\n #dark.15 0%,\n #dark.15 5%,\n #dark.0 35%,\n #dark-03.2 50%,\n #dark-03.0 65%,\n #dark.15 95%,\n #dark.15 100%\n )`,\n },\n },\n});\n\n/**\n * Set by a component that says once that a whole group of placeholders is\n * loading — `Skeleton` is one region around all of its bars, and a table's\n * loading row is `aria-busy`. The placeholders inside are then decoration, and\n * stay out of the accessibility tree rather than each being a landmark of its\n * own.\n */\nexport const PlaceholderGroupContext = createContext(false);\n\nexport interface CubePlaceholderProps\n extends ComponentBaseProps, ContainerStyleProps {\n size?: Styles['fontSize'];\n circle?: boolean;\n isStatic?: boolean;\n}\n\nexport const Placeholder = forwardRef(function Placeholder(\n allProps: CubePlaceholderProps,\n ref,\n) {\n let { size = '2x', isStatic, circle, ...props } = allProps;\n\n const { t } = useI18n();\n const isInGroup = useContext(PlaceholderGroupContext);\n\n let styles = extractStyles(props, CONTAINER_STYLES);\n\n return (\n <StyledPlaceholder\n {...(isInGroup\n ? { 'aria-hidden': true }\n : {\n role: 'region',\n 'aria-label': t(\n 'placeholder.contentIsLoading',\n 'Content is loading',\n ),\n })}\n {...filterComponentBaseProps(props, { eventProps: true })}\n // The documented way to detect a loading placeholder. Fixed, so a\n // caller's `qa` or a translated `aria-label` doesn't change it.\n data-loading-placeholder=\"\"\n ref={ref}\n mods={{ animated: !isStatic, circle, ...props.mods }}\n // oxlint-disable-next-line tasty/no-runtime-styles-mutation -- forwards the consumer's `size` prop\n styles={mergeStyleLayers({ height: size }, styles)}\n />\n );\n});\n"],"mappings":";;;;;;;;;AAgBA,MAAMa,uBAAuBX,UAAU;CACrC,MAAM,EACJ,uBAAuB,MACzB;CACA,QAAQ,EACN,uB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,GAAGf,MAAM;CAAC,CAAA;AAClD,CAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { Prism as RendererPrism, ensureSqlDateUnitKeywords, ensureYamlSqlExtensions } from "./prismSetup.js";
|
|
3
3
|
import { CONTAINER_STYLES, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { Prism as RendererPrism } from "prism-react-renderer";
|
|
3
3
|
//#region src/components/content/PrismCode/prismSetup.tsx
|
|
4
4
|
globalThis.Prism = RendererPrism;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { PrismCode as _PrismCode } from "../PrismCode/PrismCode.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -44,6 +44,14 @@ export interface CubeResultProps extends BaseProps, ContainerStyleProps {
|
|
|
44
44
|
layout?: CubeResultLayout;
|
|
45
45
|
/** Whether the result component has a compact presentation. Overrides `size` and `layout` */
|
|
46
46
|
isCompact?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Makes the result the `result` query container (`container: result / inline-size`),
|
|
49
|
+
* so its content can respond to its width: `@(result, w < 400px)`, or
|
|
50
|
+
* `collapseState` on a `Button`. Set it only on a result whose width comes
|
|
51
|
+
* from outside, such as the `stacked` layout: a container ignores its
|
|
52
|
+
* content's width, so a result sized by its content shrinks to its padding.
|
|
53
|
+
*/
|
|
54
|
+
isQueryContainer?: boolean;
|
|
47
55
|
}
|
|
48
56
|
export type CubeResultSize = 'medium' | 'large';
|
|
49
57
|
export type CubeResultLayout = 'default' | 'stacked';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { Title as _Title } from "../Title.js";
|
|
@@ -52,6 +52,10 @@ const Container = tasty({
|
|
|
52
52
|
"": "0 auto",
|
|
53
53
|
compact: "0"
|
|
54
54
|
},
|
|
55
|
+
container: {
|
|
56
|
+
"": false,
|
|
57
|
+
"query-container": "result / inline-size"
|
|
58
|
+
},
|
|
55
59
|
"--icon-size": {
|
|
56
60
|
"": "6x",
|
|
57
61
|
"size=large": "10x"
|
|
@@ -178,7 +182,7 @@ function Result(props, ref) {
|
|
|
178
182
|
let t3;
|
|
179
183
|
let t4;
|
|
180
184
|
if ($[0] !== props || $[1] !== ref) {
|
|
181
|
-
const { children: t5, isCompact, icon, status, subTitle, subtitle: t6, title, actions: t7, size: t8, layout: t9, ...otherProps } = props;
|
|
185
|
+
const { children: t5, isCompact, icon, status, subTitle, subtitle: t6, title, actions: t7, size: t8, layout: t9, isQueryContainer, ...otherProps } = props;
|
|
182
186
|
children = t5;
|
|
183
187
|
actions = t7;
|
|
184
188
|
let subtitle = t6;
|
|
@@ -217,7 +221,8 @@ function Result(props, ref) {
|
|
|
217
221
|
compact: isCompact,
|
|
218
222
|
size,
|
|
219
223
|
layout,
|
|
220
|
-
status: icon ? void 0 : knownStatus
|
|
224
|
+
status: icon ? void 0 : knownStatus,
|
|
225
|
+
"query-container": !!isQueryContainer
|
|
221
226
|
} });
|
|
222
227
|
t1 = ref;
|
|
223
228
|
t2 = styles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Result.js","names":["FocusableRef","IconAlertTriangleFilled","IconCircleCheckFilled","IconCircleXFilled","IconInfoCircleFilled","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","tasty","ComponentType","createContext","forwardRef","ReactNode","useContext","mergeProps","wrapNodeIfPlain","extractStyles","Button","CubeButtonProps","Title","CubeResultProps","children","icon","status","CubeResultStatus","subTitle","subtitle","title","actions","size","CubeResultSize","layout","CubeResultLayout","isCompact","StatusIconMap","Record","Container","qa","as","styles","display","compact","gridAreas","flow","placeContent","placeItems","gap","padding","textAlign","boxSizing","width","margin","Icon","$","gridArea","color","placeSelf","textWrap","Content","Actions","ResultSizeContext","undefined","CubeResultActionProps","ResultAction","t0","ref","_c","props","resultSize","t1","type","t2","statusIconMap","success","error","info","warning","Result","T0","t3","t4","t5","t6","t7","t8","t9","otherProps","console","warn","isLarge","knownStatus","hasOwnProperty","StatusIcon","t10","iconContent","t11","iconNode","eventProps","mods","_Result","Object","assign","Action","displayName","_c","Title"],"sources":["../../../../src/components/content/Result/Result.tsx"],"sourcesContent":["import { FocusableRef } from '@react-types/shared';\nimport {\n IconAlertTriangleFilled,\n IconCircleCheckFilled,\n IconCircleXFilled,\n IconInfoCircleFilled,\n} from '@tabler/icons-react';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ComponentType,\n createContext,\n forwardRef,\n ReactNode,\n useContext,\n} from 'react';\n\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport { wrapNodeIfPlain } from '../../../utils/react/wrapNodeIfPlain';\nimport { extractStyles } from '../../../utils/styles';\nimport { Button, CubeButtonProps } from '../../actions/Button/Button';\nimport { Title } from '../Title';\n\nexport interface CubeResultProps extends BaseProps, ContainerStyleProps {\n /** Free content between the text and the actions, e.g. an alert or details */\n children?: ReactNode;\n /** Custom icon element */\n icon?: ReactNode;\n /**\n * Result status from ready-made templates\n * @default 'info'\n */\n status?: CubeResultStatus;\n /**\n * The subTitle\n * @deprecated The subTitle prop is deprecated and will be removed in next major release. consider using subtitle instead\n */\n subTitle?: ReactNode;\n /**\n * Subtitle of the Result component\n */\n subtitle?: ReactNode;\n /** The title */\n title?: ReactNode;\n /**\n * Action buttons, as `Result.Action` elements so they follow the Result's size.\n * A centered row by default, a full-width column in the `stacked` layout\n */\n actions?: ReactNode;\n /**\n * Visual scale: the icon size and the title and subtitle presets. Does not change the layout.\n * Ignored when `isCompact` is set\n * @default 'medium'\n */\n size?: CubeResultSize;\n /**\n * Arrangement of the block. `stacked` fills the container and stacks the actions to the full width,\n * as in a confirmation or result dialog. Combine with `size=\"large\"` for the dialog card.\n * Ignored when `isCompact` is set\n * @default 'default'\n */\n layout?: CubeResultLayout;\n /** Whether the result component has a compact presentation. Overrides `size` and `layout` */\n isCompact?: boolean;\n}\n\nexport type CubeResultSize = 'medium' | 'large';\n\nexport type CubeResultLayout = 'default' | 'stacked';\n\nexport type CubeResultStatus =\n 'success' | 'error' | 'info' | 'warning' | 404 | 403 | 500;\n\n// `null` for a status without an icon, so no empty slot is rendered\ntype StatusIconMap = Record<CubeResultStatus, ComponentType | null>;\n\nconst Container = tasty({\n qa: 'ResultContainer',\n as: 'section',\n styles: {\n // Any ancestor: the Result sits in the dialog's `Content`, not in `Dialog`\n '@in-dialog': '@parent(id=Dialog)',\n\n display: {\n '': 'flex',\n compact: 'grid',\n },\n gridAreas: '\"icon title\" \"content content\" \"actions actions\"',\n flow: 'column',\n placeContent: {\n '': 'center',\n compact: 'start',\n },\n placeItems: {\n '': 'center',\n compact: 'start',\n },\n // Outside compact the blocks below the title space themselves, so the\n // icon's own room is the whole distance to the title\n gap: {\n '': '0',\n compact: '2x 1x',\n },\n padding: {\n '': '6x 4x',\n // The host pads: a dialog `Content` or the page section the card fills\n compact: '0',\n 'layout=stacked': '1.5x',\n // The dialog's `Content` already pads it\n 'layout=stacked & @in-dialog': '0',\n },\n textAlign: {\n '': 'center',\n compact: 'left',\n },\n boxSizing: 'border-box',\n width: {\n '': 'max 80ch',\n // Fill the container so stacked actions share one width wherever the card sits\n 'layout=stacked': '0 100% 80ch',\n },\n margin: {\n '': '0 auto',\n compact: '0',\n },\n '--icon-size': {\n '': '6x',\n 'size=large': '10x',\n },\n\n Icon: {\n $: '>',\n display: 'grid',\n gridArea: 'icon',\n // At least the 3x between the other blocks; an icon above 12x gets a\n // quarter of its size, so a big one is not crowded\n padding: {\n '': 'max($icon-size / 4, 3x)',\n compact: '0',\n },\n // A custom icon keeps its own color\n color: {\n '': 'inherit',\n 'status=info': '#purple',\n 'status=success': '#success',\n 'status=error': '#danger',\n 'status=warning': '#warning',\n },\n },\n\n Title: {\n $: '>',\n gridArea: 'title',\n display: 'flex',\n flow: 'column',\n placeItems: 'inherit',\n gap: '1x',\n placeSelf: 'center',\n textWrap: 'balance',\n },\n\n Content: {\n $: '>',\n gridArea: 'content',\n display: 'block',\n margin: {\n '': 'top 3x',\n compact: '0',\n },\n placeSelf: {\n '': 'auto',\n 'layout=stacked': 'stretch',\n },\n },\n\n Actions: {\n $: '>',\n gridArea: 'actions',\n display: 'flex',\n margin: {\n '': 'top 3x',\n compact: '0',\n },\n flow: {\n '': 'row wrap',\n 'layout=stacked': 'column',\n },\n gap: '1x',\n placeContent: {\n '': 'center',\n compact: 'start',\n },\n placeItems: {\n '': 'center',\n 'layout=stacked': 'stretch',\n },\n placeSelf: {\n '': 'auto',\n 'layout=stacked': 'stretch',\n },\n },\n },\n});\n\nconst ResultSizeContext = createContext<CubeResultSize | undefined>(undefined);\n\nexport type CubeResultActionProps = CubeButtonProps;\n\n/**\n * A `Button` for the Result `actions` slot. Its size follows the Result's `size` unless set.\n * A link keeps Button's own `inline` size\n */\nconst ResultAction = forwardRef(function ResultAction(\n { size, ...props }: CubeResultActionProps,\n ref: FocusableRef<HTMLElement>,\n) {\n const resultSize = useContext(ResultSizeContext);\n\n return (\n <Button\n ref={ref}\n {...props}\n size={size ?? (props.type === 'link' ? undefined : resultSize)}\n />\n );\n});\n\nconst statusIconMap: StatusIconMap = {\n // Decorative: the title says what happened.\n success: () => <IconCircleCheckFilled aria-hidden=\"true\" />,\n error: () => <IconCircleXFilled aria-hidden=\"true\" />,\n info: () => <IconInfoCircleFilled aria-hidden=\"true\" />,\n warning: () => <IconAlertTriangleFilled aria-hidden=\"true\" />,\n // TODO: Needs to be implemented in the future\n 404: null,\n 403: null,\n 500: null,\n};\n\nfunction Result(props: CubeResultProps, ref) {\n let {\n children,\n isCompact,\n icon,\n status,\n subTitle,\n subtitle,\n title,\n actions,\n size = 'medium',\n layout = 'default',\n ...otherProps\n } = props;\n\n subtitle = subtitle ?? subTitle;\n\n if (icon && status) {\n console.warn(\n 'Don\\'t use \"icon\" and \"status\" together, it can lead to possible errors.',\n );\n }\n\n // The compact grid has its own scale and arrangement; `size` and `layout`\n // describe the centered column only, so they are dropped rather than mixed in\n if (isCompact) {\n size = 'medium';\n layout = 'default';\n }\n\n const isLarge = size === 'large';\n\n // An unknown status falls back to `info` for the color too, not only the icon\n const knownStatus: CubeResultStatus =\n status && statusIconMap.hasOwnProperty(status) ? status : 'info';\n const StatusIcon = statusIconMap[knownStatus];\n\n // A custom icon shares the status icon's wrapper, so it gets the same room\n const iconContent = icon || (StatusIcon && <StatusIcon />);\n const iconNode = iconContent && <div data-element=\"Icon\">{iconContent}</div>;\n\n const styles = extractStyles(otherProps, CONTAINER_STYLES);\n\n return (\n <Container\n {...mergeProps(filterBaseProps(otherProps, { eventProps: true }), {\n mods: {\n compact: isCompact,\n size,\n layout,\n status: icon ? undefined : knownStatus,\n },\n })}\n ref={ref}\n styles={styles}\n >\n {iconNode}\n {(title || subtitle) && (\n <div data-element=\"Title\">\n {wrapNodeIfPlain(title, () => (\n <Title level={2} preset={isCompact ? 'h5' : isLarge ? 'h2' : 'h4'}>\n {title}\n </Title>\n ))}\n {wrapNodeIfPlain(subtitle, () => (\n <Title\n // A name no provider defines: the dialog `title` slot must reach\n // the title only, or both headings get the dialog's label id\n slot=\"subtitle\"\n level={3}\n preset={isCompact ? 't3m' : isLarge ? 't2' : 't2m'}\n >\n {subtitle}\n </Title>\n ))}\n </div>\n )}\n {children && <div data-element=\"Content\">{children}</div>}\n {actions && (\n <div data-element=\"Actions\">\n <ResultSizeContext.Provider value={size}>\n {actions}\n </ResultSizeContext.Provider>\n </div>\n )}\n </Container>\n );\n}\n\nconst _Result = Object.assign(forwardRef(Result), { Action: ResultAction });\n\n_Result.displayName = 'Result';\n\nexport { _Result as Result, ResultAction };\n"],"mappings":";;;;;;;;;;;;AAiFA,MAAMqC,YAAY5B,MAAM;CACtB6B,IAAI;CACJC,IAAI;CACJC,QAAQ;EAEN,cAAc;EAEdC,SAAS;GACP,IAAI;GACJC,SAAS;EACX;EACAC,WAAW;EACXC,MAAM;EACNC,cAAc;GACZ,IAAI;GACJH,SAAS;EACX;EACAI,YAAY;GACV,IAAI;GACJJ,SAAS;EACX;EAGAK,KAAK;GACH,IAAI;GACJL,SAAS;EACX;EACAM,SAAS;GACP,IAAI;GAEJN,SAAS;GACT,kBAAkB;GAElB,+BAA+B;EACjC;EACAO,WAAW;GACT,IAAI;GACJP,SAAS;EACX;EACAQ,WAAW;EACXC,OAAO;GACL,IAAI;GAEJ,kBAAkB;EACpB;EACAC,QAAQ;GACN,IAAI;GACJV,SAAS;EACX;EACA,eAAe;GACb,IAAI;GACJ,cAAc;EAChB;EAEAW,MAAM;GACJC,GAAG;GACHb,SAAS;GACTc,UAAU;GAGVP,SAAS;IACP,IAAI;IACJN,SAAS;GACX;GAEAc,OAAO;IACL,IAAI;IACJ,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;GACpB;EACF;EAEApC,OAAO;GACLkC,GAAG;GACHC,UAAU;GACVd,SAAS;GACTG,MAAM;GACNE,YAAY;GACZC,KAAK;GACLU,WAAW;GACXC,UAAU;EACZ;EAEAC,SAAS;GACPL,GAAG;GACHC,UAAU;GACVd,SAAS;GACTW,QAAQ;IACN,IAAI;IAC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EoC,QAAQI,cAAc"}
|
|
1
|
+
{"version":3,"file":"Result.js","names":["FocusableRef","IconAlertTriangleFilled","IconCircleCheckFilled","IconCircleXFilled","IconInfoCircleFilled","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","tasty","ComponentType","createContext","forwardRef","ReactNode","useContext","mergeProps","wrapNodeIfPlain","extractStyles","Button","CubeButtonProps","Title","CubeResultProps","children","icon","status","CubeResultStatus","subTitle","subtitle","title","actions","size","CubeResultSize","layout","CubeResultLayout","isCompact","isQueryContainer","StatusIconMap","Record","Container","qa","as","styles","display","compact","gridAreas","flow","placeContent","placeItems","gap","padding","textAlign","boxSizing","width","margin","container","Icon","$","gridArea","color","placeSelf","textWrap","Content","Actions","ResultSizeContext","undefined","CubeResultActionProps","ResultAction","t0","ref","_c","props","resultSize","t1","type","t2","statusIconMap","success","error","info","warning","Result","T0","t3","t4","t5","t6","t7","t8","t9","otherProps","console","warn","isLarge","knownStatus","hasOwnProperty","StatusIcon","t10","iconContent","t11","iconNode","eventProps","mods","_Result","Object","assign","Action","displayName","_c","Title"],"sources":["../../../../src/components/content/Result/Result.tsx"],"sourcesContent":["import { FocusableRef } from '@react-types/shared';\nimport {\n IconAlertTriangleFilled,\n IconCircleCheckFilled,\n IconCircleXFilled,\n IconInfoCircleFilled,\n} from '@tabler/icons-react';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ComponentType,\n createContext,\n forwardRef,\n ReactNode,\n useContext,\n} from 'react';\n\nimport { mergeProps } from '../../../utils/react/mergeProps';\nimport { wrapNodeIfPlain } from '../../../utils/react/wrapNodeIfPlain';\nimport { extractStyles } from '../../../utils/styles';\nimport { Button, CubeButtonProps } from '../../actions/Button/Button';\nimport { Title } from '../Title';\n\nexport interface CubeResultProps extends BaseProps, ContainerStyleProps {\n /** Free content between the text and the actions, e.g. an alert or details */\n children?: ReactNode;\n /** Custom icon element */\n icon?: ReactNode;\n /**\n * Result status from ready-made templates\n * @default 'info'\n */\n status?: CubeResultStatus;\n /**\n * The subTitle\n * @deprecated The subTitle prop is deprecated and will be removed in next major release. consider using subtitle instead\n */\n subTitle?: ReactNode;\n /**\n * Subtitle of the Result component\n */\n subtitle?: ReactNode;\n /** The title */\n title?: ReactNode;\n /**\n * Action buttons, as `Result.Action` elements so they follow the Result's size.\n * A centered row by default, a full-width column in the `stacked` layout\n */\n actions?: ReactNode;\n /**\n * Visual scale: the icon size and the title and subtitle presets. Does not change the layout.\n * Ignored when `isCompact` is set\n * @default 'medium'\n */\n size?: CubeResultSize;\n /**\n * Arrangement of the block. `stacked` fills the container and stacks the actions to the full width,\n * as in a confirmation or result dialog. Combine with `size=\"large\"` for the dialog card.\n * Ignored when `isCompact` is set\n * @default 'default'\n */\n layout?: CubeResultLayout;\n /** Whether the result component has a compact presentation. Overrides `size` and `layout` */\n isCompact?: boolean;\n /**\n * Makes the result the `result` query container (`container: result / inline-size`),\n * so its content can respond to its width: `@(result, w < 400px)`, or\n * `collapseState` on a `Button`. Set it only on a result whose width comes\n * from outside, such as the `stacked` layout: a container ignores its\n * content's width, so a result sized by its content shrinks to its padding.\n */\n isQueryContainer?: boolean;\n}\n\nexport type CubeResultSize = 'medium' | 'large';\n\nexport type CubeResultLayout = 'default' | 'stacked';\n\nexport type CubeResultStatus =\n 'success' | 'error' | 'info' | 'warning' | 404 | 403 | 500;\n\n// `null` for a status without an icon, so no empty slot is rendered\ntype StatusIconMap = Record<CubeResultStatus, ComponentType | null>;\n\nconst Container = tasty({\n qa: 'ResultContainer',\n as: 'section',\n styles: {\n // Any ancestor: the Result sits in the dialog's `Content`, not in `Dialog`\n '@in-dialog': '@parent(id=Dialog)',\n\n display: {\n '': 'flex',\n compact: 'grid',\n },\n gridAreas: '\"icon title\" \"content content\" \"actions actions\"',\n flow: 'column',\n placeContent: {\n '': 'center',\n compact: 'start',\n },\n placeItems: {\n '': 'center',\n compact: 'start',\n },\n // Outside compact the blocks below the title space themselves, so the\n // icon's own room is the whole distance to the title\n gap: {\n '': '0',\n compact: '2x 1x',\n },\n padding: {\n '': '6x 4x',\n // The host pads: a dialog `Content` or the page section the card fills\n compact: '0',\n 'layout=stacked': '1.5x',\n // The dialog's `Content` already pads it\n 'layout=stacked & @in-dialog': '0',\n },\n textAlign: {\n '': 'center',\n compact: 'left',\n },\n boxSizing: 'border-box',\n width: {\n '': 'max 80ch',\n // Fill the container so stacked actions share one width wherever the card sits\n 'layout=stacked': '0 100% 80ch',\n },\n margin: {\n '': '0 auto',\n compact: '0',\n },\n // Only on request, as on `Card`: a result sized by its content, such as\n // one centered in a row, would shrink to its padding.\n container: { '': false, 'query-container': 'result / inline-size' },\n '--icon-size': {\n '': '6x',\n 'size=large': '10x',\n },\n\n Icon: {\n $: '>',\n display: 'grid',\n gridArea: 'icon',\n // At least the 3x between the other blocks; an icon above 12x gets a\n // quarter of its size, so a big one is not crowded\n padding: {\n '': 'max($icon-size / 4, 3x)',\n compact: '0',\n },\n // A custom icon keeps its own color\n color: {\n '': 'inherit',\n 'status=info': '#purple',\n 'status=success': '#success',\n 'status=error': '#danger',\n 'status=warning': '#warning',\n },\n },\n\n Title: {\n $: '>',\n gridArea: 'title',\n display: 'flex',\n flow: 'column',\n placeItems: 'inherit',\n gap: '1x',\n placeSelf: 'center',\n textWrap: 'balance',\n },\n\n Content: {\n $: '>',\n gridArea: 'content',\n display: 'block',\n margin: {\n '': 'top 3x',\n compact: '0',\n },\n placeSelf: {\n '': 'auto',\n 'layout=stacked': 'stretch',\n },\n },\n\n Actions: {\n $: '>',\n gridArea: 'actions',\n display: 'flex',\n margin: {\n '': 'top 3x',\n compact: '0',\n },\n flow: {\n '': 'row wrap',\n 'layout=stacked': 'column',\n },\n gap: '1x',\n placeContent: {\n '': 'center',\n compact: 'start',\n },\n placeItems: {\n '': 'center',\n 'layout=stacked': 'stretch',\n },\n placeSelf: {\n '': 'auto',\n 'layout=stacked': 'stretch',\n },\n },\n },\n});\n\nconst ResultSizeContext = createContext<CubeResultSize | undefined>(undefined);\n\nexport type CubeResultActionProps = CubeButtonProps;\n\n/**\n * A `Button` for the Result `actions` slot. Its size follows the Result's `size` unless set.\n * A link keeps Button's own `inline` size\n */\nconst ResultAction = forwardRef(function ResultAction(\n { size, ...props }: CubeResultActionProps,\n ref: FocusableRef<HTMLElement>,\n) {\n const resultSize = useContext(ResultSizeContext);\n\n return (\n <Button\n ref={ref}\n {...props}\n size={size ?? (props.type === 'link' ? undefined : resultSize)}\n />\n );\n});\n\nconst statusIconMap: StatusIconMap = {\n // Decorative: the title says what happened.\n success: () => <IconCircleCheckFilled aria-hidden=\"true\" />,\n error: () => <IconCircleXFilled aria-hidden=\"true\" />,\n info: () => <IconInfoCircleFilled aria-hidden=\"true\" />,\n warning: () => <IconAlertTriangleFilled aria-hidden=\"true\" />,\n // TODO: Needs to be implemented in the future\n 404: null,\n 403: null,\n 500: null,\n};\n\nfunction Result(props: CubeResultProps, ref) {\n let {\n children,\n isCompact,\n icon,\n status,\n subTitle,\n subtitle,\n title,\n actions,\n size = 'medium',\n layout = 'default',\n isQueryContainer,\n ...otherProps\n } = props;\n\n subtitle = subtitle ?? subTitle;\n\n if (icon && status) {\n console.warn(\n 'Don\\'t use \"icon\" and \"status\" together, it can lead to possible errors.',\n );\n }\n\n // The compact grid has its own scale and arrangement; `size` and `layout`\n // describe the centered column only, so they are dropped rather than mixed in\n if (isCompact) {\n size = 'medium';\n layout = 'default';\n }\n\n const isLarge = size === 'large';\n\n // An unknown status falls back to `info` for the color too, not only the icon\n const knownStatus: CubeResultStatus =\n status && statusIconMap.hasOwnProperty(status) ? status : 'info';\n const StatusIcon = statusIconMap[knownStatus];\n\n // A custom icon shares the status icon's wrapper, so it gets the same room\n const iconContent = icon || (StatusIcon && <StatusIcon />);\n const iconNode = iconContent && <div data-element=\"Icon\">{iconContent}</div>;\n\n const styles = extractStyles(otherProps, CONTAINER_STYLES);\n\n return (\n <Container\n {...mergeProps(filterBaseProps(otherProps, { eventProps: true }), {\n mods: {\n compact: isCompact,\n size,\n layout,\n status: icon ? undefined : knownStatus,\n 'query-container': !!isQueryContainer,\n },\n })}\n ref={ref}\n styles={styles}\n >\n {iconNode}\n {(title || subtitle) && (\n <div data-element=\"Title\">\n {wrapNodeIfPlain(title, () => (\n <Title level={2} preset={isCompact ? 'h5' : isLarge ? 'h2' : 'h4'}>\n {title}\n </Title>\n ))}\n {wrapNodeIfPlain(subtitle, () => (\n <Title\n // A name no provider defines: the dialog `title` slot must reach\n // the title only, or both headings get the dialog's label id\n slot=\"subtitle\"\n level={3}\n preset={isCompact ? 't3m' : isLarge ? 't2' : 't2m'}\n >\n {subtitle}\n </Title>\n ))}\n </div>\n )}\n {children && <div data-element=\"Content\">{children}</div>}\n {actions && (\n <div data-element=\"Actions\">\n <ResultSizeContext.Provider value={size}>\n {actions}\n </ResultSizeContext.Provider>\n </div>\n )}\n </Container>\n );\n}\n\nconst _Result = Object.assign(forwardRef(Result), { Action: ResultAction });\n\n_Result.displayName = 'Result';\n\nexport { _Result as Result, ResultAction };\n"],"mappings":";;;;;;;;;;;;AAyFA,MAAMsC,YAAY7B,MAAM;CACtB8B,IAAI;CACJC,IAAI;CACJC,QAAQ;EAEN,cAAc;EAEdC,SAAS;GACP,IAAI;GACJC,SAAS;EACX;EACAC,WAAW;EACXC,MAAM;EACNC,cAAc;GACZ,IAAI;GACJH,SAAS;EACX;EACAI,YAAY;GACV,IAAI;GACJJ,SAAS;EACX;EAGAK,KAAK;GACH,IAAI;GACJL,SAAS;EACX;EACAM,SAAS;GACP,IAAI;GAEJN,SAAS;GACT,kBAAkB;GAElB,+BAA+B;EACjC;EACAO,WAAW;GACT,IAAI;GACJP,SAAS;EACX;EACAQ,WAAW;EACXC,OAAO;GACL,IAAI;GAEJ,kBAAkB;EACpB;EACAC,QAAQ;GACN,IAAI;GACJV,SAAS;EACX;EAGAW,WAAW;GAAE,IAAI;GAAO,mBAAmB;EAAuB;EAClE,eAAe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,GACJnB;GASCC,KAAAA;GACG3B,QAAAA;GAXV,UAAA;IAaG0D;IACAhB;IAoBAC;IACAC;GAnCO;;EA0CE7B,EAAA,MAAAyB;EAAAzB,EAAA,MAAAW;EAAAX,EAAA,MAAAgB;EAAAhB,EAAA,MAAAkB;EAAAlB,EAAA,MAAA0B;EAAA1B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;EAAA5B,EAAA,MAAA6B;EAAA7B,EAAA,MAAA8B;CAAA,OAAAA,KAAA9B,EAAA;CAAA,OA1CZ8B;AA0CY;AAIhB,MAAMgB,UAAUC,OAAOC,OAAO5F,WAAWoE,MAAM,GAAG,EAAEyB,QAAQvC,aAAa,CAAC;AAE1EoC,QAAQI,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
3
3
|
import { Space } from "../../layout/Space.js";
|
|
4
4
|
import { Grid } from "../../layout/Grid.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { Item as _Item } from "../Item/Item.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.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.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { TEXT_DEFAULT_STYLES, TEXT_PROP_MAP, useTextProps } from "../Text.js";
|
|
4
4
|
import { highlightText } from "../highlightText.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { TEXT_PROP_MAP } from "./Text.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
|
+
import { pickBaseCustomizationProps } from "../../../utils/react/pickBaseCustomizationProps.js";
|
|
3
4
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
5
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
5
6
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -323,13 +324,20 @@ function TreeBase(props, ref) {
|
|
|
323
324
|
}), [height, shape]);
|
|
324
325
|
const mergedScrollRef = useMemo(() => mergeRefs(ref, scrollRef), [ref, scrollRef]);
|
|
325
326
|
return /* @__PURE__ */ jsx(TreeElement, {
|
|
327
|
+
...pickBaseCustomizationProps(props),
|
|
326
328
|
...gridProps,
|
|
327
329
|
tabIndex: activeKey === void 0 ? gridProps.tabIndex : -1,
|
|
328
330
|
ref: treeRef,
|
|
329
331
|
qa: qa ?? "Tree",
|
|
330
|
-
mods
|
|
332
|
+
mods: {
|
|
333
|
+
...mods,
|
|
334
|
+
...props.mods
|
|
335
|
+
},
|
|
331
336
|
styles: baseStyles,
|
|
332
|
-
tokens:
|
|
337
|
+
tokens: {
|
|
338
|
+
...treeTokens,
|
|
339
|
+
...props.tokens
|
|
340
|
+
},
|
|
333
341
|
children: /* @__PURE__ */ jsx(TreeScrollContainer, {
|
|
334
342
|
ref: mergedScrollRef,
|
|
335
343
|
children: /* @__PURE__ */ jsx(TreeSizer, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","names":["useVirtualizer","OUTER_STYLES","forwardRef","useLayoutEffect","useMemo","useRef","useTree","Item","useTreeState","useEvent","useI18n","SIZE_NAME_TO_KEY","SIZES","mergeRefs","extractStyles","TreeElement","TreeScrollContainer","TreeSizer","buildTreeIndex","getTreeNodeText","TreeNode","useCheckboxTree","useLoadData","Key","Node","Selection","ForwardedRef","ReactElement","ReactNode","CubeTreeNodeData","CubeTreeProps","TreeOnExpandInfo","TreeOnSelectInfo","TreeSelectionMode","renderItem","node","key","children","title","collectDisabledKeys","treeData","treeIsDisabled","keys","visit","nodes","isDisabled","push","expandWithParents","parentOf","Map","length","set","Set","parent","get","add","Array","from","findToggledKey","previous","next","added","k","has","resolveSelectionMode","selectionMode","isSelectable","TreeBase","props","ref","HTMLDivElement","isCheckable","selectionModeProp","size","shape","containerPadding","defaultExpandedKeys","expandedKeys","autoExpandParent","defaultCheckedKeys","checkedKeys","defaultSelectedKeys","selectedKeys","height","loadData","onExpand","onCheck","onSelect","itemProps","rowStyles","ariaLabel","qa","menu","treeMenu","contextMenu","treeContextMenu","onAction","treeOnAction","menuTriggerProps","menuProps","id","_activeKey","activeKey","_onRowAction","onRowAction","otherProps","baseStyles","treeRef","scrollRef","treeIndex","nodesByKey","byKey","disabledKeys","effectiveExpandedKeys","effectiveDefaultExpandedKeys","checkbox","index","loadDataController","initialExpandedKeys","previousExpandedRef","handleExpandedChange","nextSet","onExpandedChanged","undefined","current","toggled","String","info","expanded","previousSelectionRef","handleSelectionChange","selection","arr","state","collection","getKeys","getItem","type","selectedNodes","map","filter","n","selected","hasOnSelect","t","treeLabel","ariaProps","onSelectionChange","onExpandedChange","disabledBehavior","const","items","baseState","getChildren","patched","Object","create","Iterable","childNodes","gridProps","visibleNodes","out","visibleNodesRef","rowVirtualizer","count","getScrollElement","getItemKey","estimateSize","gap","overscan","paddingStart","paddingEnd","treeTokens","totalSize","getTotalSize","lastFocusedScrollRef","lastSelectedScrollRef","focusedKey","selectionManager","findIndex","scrollToIndex","align","lastActiveScrollRef","target","mods","mergedScrollRef","tabIndex","getVirtualItems","virtualItem","keyStr","data","checkedSet","halfCheckedSet","loadingKeys","start","measureElement","toggle","_Tree","displayName","Tree"],"sources":["../../../../src/components/content/Tree/Tree.tsx"],"sourcesContent":["import { useVirtualizer } from '@tanstack/react-virtual';\nimport { OUTER_STYLES } from '@tenphi/tasty';\nimport { forwardRef, useLayoutEffect, useMemo, useRef } from 'react';\nimport { useTree } from 'react-aria';\nimport { Item, useTreeState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useI18n } from '../../../i18n/useI18n';\nimport { SIZE_NAME_TO_KEY, SIZES } from '../../../tokens/sizes';\nimport { mergeRefs } from '../../../utils/react/useCombinedRefs';\nimport { extractStyles } from '../../../utils/styles';\n\nimport { TreeElement, TreeScrollContainer, TreeSizer } from './styled';\nimport { buildTreeIndex, getTreeNodeText } from './tree-index';\nimport { TreeNode } from './TreeNode';\nimport { useCheckboxTree } from './use-checkbox-tree';\nimport { useLoadData } from './use-load-data';\n\nimport type { Key, Node, Selection } from '@react-types/shared';\nimport type { ForwardedRef, ReactElement, ReactNode } from 'react';\nimport type {\n CubeTreeNodeData,\n CubeTreeProps,\n TreeOnExpandInfo,\n TreeOnSelectInfo,\n TreeSelectionMode,\n} from './types';\n\n/**\n * Render an `<Item>` for React Stately's collection builder.\n *\n * The visible content is rendered by `TreeNode` via `nodesByKey`,\n * so `<Item>`'s body is only used by Stately for the collection\n * (`textValue` for keyboard nav, `childItems` for nested traversal).\n */\nfunction renderItem(node: CubeTreeNodeData): ReactElement {\n return (\n <Item\n key={node.key}\n textValue={getTreeNodeText(node)}\n childItems={node.children as CubeTreeNodeData[] | undefined}\n >\n {node.title as ReactNode}\n </Item>\n );\n}\n\nfunction collectDisabledKeys(\n treeData: CubeTreeNodeData[],\n treeIsDisabled: boolean,\n): string[] {\n const keys: string[] = [];\n const visit = (nodes: CubeTreeNodeData[]) => {\n for (const node of nodes) {\n if (treeIsDisabled || node.isDisabled) keys.push(node.key);\n if (node.children) visit(node.children);\n }\n };\n visit(treeData);\n return keys;\n}\n\n/** Expand the supplied keys with all of their ancestor keys. */\nfunction expandWithParents(\n keys: string[] | undefined,\n parentOf: Map<string, string | null>,\n): string[] | undefined {\n if (!keys || keys.length === 0) return keys;\n const set = new Set<string>(keys);\n for (const key of keys) {\n let parent = parentOf.get(key);\n while (parent) {\n set.add(parent);\n parent = parentOf.get(parent);\n }\n }\n return Array.from(set);\n}\n\n/**\n * Diff two key sets to find the single key that was added or removed.\n * Returns `null` when both sets are equal.\n */\nfunction findToggledKey(\n previous: Set<Key>,\n next: Set<Key>,\n): { key: Key; added: boolean } | null {\n for (const k of next) {\n if (!previous.has(k)) return { key: k, added: true };\n }\n for (const k of previous) {\n if (!next.has(k)) return { key: k, added: false };\n }\n return null;\n}\n\nfunction resolveSelectionMode(\n selectionMode: TreeSelectionMode | undefined,\n isSelectable: boolean | undefined,\n): TreeSelectionMode {\n if (selectionMode != null) return selectionMode;\n if (isSelectable === false) return 'none';\n return 'single';\n}\n\nfunction TreeBase(props: CubeTreeProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n treeData,\n isCheckable = false,\n isSelectable,\n selectionMode: selectionModeProp,\n size = 'medium',\n shape = 'default',\n containerPadding = 4,\n isDisabled = false,\n defaultExpandedKeys,\n expandedKeys,\n autoExpandParent = false,\n defaultCheckedKeys,\n checkedKeys,\n defaultSelectedKeys,\n selectedKeys,\n height,\n loadData,\n onExpand,\n onCheck,\n onSelect,\n itemProps,\n rowStyles,\n ariaLabel,\n qa,\n menu: treeMenu,\n contextMenu: treeContextMenu,\n onAction: treeOnAction,\n menuTriggerProps,\n menuProps,\n id,\n _activeKey: activeKey,\n _onRowAction: onRowAction,\n ...otherProps\n } = props;\n\n const baseStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const treeRef = useRef<HTMLDivElement>(null);\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const treeIndex = useMemo(() => buildTreeIndex(treeData), [treeData]);\n const nodesByKey = treeIndex.byKey;\n const parentOf = treeIndex.parentOf;\n\n const disabledKeys = useMemo(\n () => collectDisabledKeys(treeData, isDisabled),\n [treeData, isDisabled],\n );\n\n const selectionMode = resolveSelectionMode(selectionModeProp, isSelectable);\n\n const effectiveExpandedKeys = useMemo(\n () =>\n autoExpandParent\n ? expandWithParents(expandedKeys, parentOf)\n : expandedKeys,\n [autoExpandParent, expandedKeys, parentOf],\n );\n\n const effectiveDefaultExpandedKeys = useMemo(\n () =>\n autoExpandParent\n ? expandWithParents(defaultExpandedKeys, parentOf)\n : defaultExpandedKeys,\n [autoExpandParent, defaultExpandedKeys, parentOf],\n );\n\n const checkbox = useCheckboxTree({\n treeData,\n index: treeIndex,\n isCheckable,\n defaultCheckedKeys,\n checkedKeys,\n onCheck,\n });\n\n const loadDataController = useLoadData({\n nodesByKey,\n loadData,\n initialExpandedKeys: effectiveExpandedKeys ?? effectiveDefaultExpandedKeys,\n });\n\n /**\n * In controlled mode, `previous` is read from `effectiveExpandedKeys`;\n * in uncontrolled mode this ref is the only source. Initialized from\n * the *effective* (ancestor-expanded) keys so the first toggle diffs\n * correctly.\n */\n const previousExpandedRef = useRef<Set<Key>>(\n new Set<Key>(effectiveExpandedKeys ?? effectiveDefaultExpandedKeys ?? []),\n );\n\n const handleExpandedChange = useEvent((nextSet: Set<Key>) => {\n loadDataController.onExpandedChanged(nextSet);\n\n const previous =\n expandedKeys !== undefined\n ? new Set<Key>(effectiveExpandedKeys ?? [])\n : previousExpandedRef.current;\n previousExpandedRef.current = new Set<Key>(nextSet);\n\n if (!onExpand) return;\n\n const toggled = findToggledKey(previous, nextSet);\n if (!toggled) return;\n\n const node = nodesByKey.get(String(toggled.key));\n if (!node) return;\n\n const info: TreeOnExpandInfo = {\n expanded: toggled.added,\n node,\n };\n onExpand(Array.from(nextSet), info);\n });\n\n /**\n * Same pattern as `previousExpandedRef`: in controlled mode we read\n * from `selectedKeys`; in uncontrolled mode this ref tracks state.\n */\n const previousSelectionRef = useRef<Set<Key>>(\n new Set<Key>(selectedKeys ?? defaultSelectedKeys ?? []),\n );\n\n /**\n * `useEvent` captures the closure lazily, so `state` (declared below\n * `ariaProps` / `useTreeState`) is safely accessible at call time.\n */\n const handleSelectionChange = useEvent((selection: Selection) => {\n if (!onSelect) return;\n let arr: Key[];\n if (selection === 'all') {\n // `nodesByKey` contains the full tree; use the collection's visible\n // keys so we don't leak keys under collapsed parents.\n arr = [];\n for (const key of state.collection.getKeys()) {\n const node = state.collection.getItem(key);\n if (node && node.type === 'item') arr.push(key);\n }\n } else {\n arr = Array.from(selection);\n }\n\n const nextSet = new Set<Key>(arr);\n const previous =\n selectedKeys !== undefined\n ? new Set<Key>(selectedKeys ?? [])\n : previousSelectionRef.current;\n previousSelectionRef.current = nextSet;\n\n const toggled = findToggledKey(previous, nextSet);\n if (!toggled) return;\n\n const node = nodesByKey.get(String(toggled.key));\n if (!node) return;\n\n const selectedNodes = arr\n .map((k) => nodesByKey.get(String(k)))\n .filter((n): n is CubeTreeNodeData => !!n);\n\n const info: TreeOnSelectInfo = {\n selected: toggled.added,\n node,\n selectedNodes,\n };\n\n onSelect(arr, info);\n });\n\n const hasOnSelect = onSelect != null;\n const { t } = useI18n();\n const treeLabel = ariaLabel ?? t('tree.ariaLabel', 'Tree');\n\n const ariaProps = useMemo(\n () => ({\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange:\n hasOnSelect && selectionMode !== 'none'\n ? handleSelectionChange\n : undefined,\n expandedKeys: effectiveExpandedKeys,\n defaultExpandedKeys: effectiveDefaultExpandedKeys,\n onExpandedChange: handleExpandedChange,\n disabledKeys,\n disabledBehavior: 'all' as const,\n items: treeData,\n children: renderItem as any,\n 'aria-label': treeLabel,\n // Row ids derive from it (`<id>-<key>`), which is what lets a control\n // outside the tree point at a row with `aria-activedescendant`.\n id,\n onAction: onRowAction\n ? (key: Key) => onRowAction(String(key))\n : undefined,\n }),\n [\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n hasOnSelect,\n handleSelectionChange,\n effectiveExpandedKeys,\n effectiveDefaultExpandedKeys,\n handleExpandedChange,\n disabledKeys,\n treeData,\n treeLabel,\n id,\n onRowAction,\n ],\n );\n\n const baseState = useTreeState<CubeTreeNodeData>(ariaProps);\n\n // The legacy `TreeCollection` from `useTreeState` lacks `getChildren`,\n // but `useTree` calls it for nested rows. Derive a patched state.\n // TODO: Remove this patch when upgrading to a react-stately version\n // that ships `getChildren` on TreeCollection natively.\n const state = useMemo(() => {\n const collection = baseState.collection;\n if (typeof (collection as any).getChildren === 'function') {\n return baseState;\n }\n const patched = Object.create(collection);\n patched.getChildren = (key: Key): Iterable<Node<CubeTreeNodeData>> => {\n const node = collection.getItem(key);\n return node ? Array.from(node.childNodes) : [];\n };\n return { ...baseState, collection: patched };\n }, [baseState]);\n\n const { gridProps } = useTree(ariaProps, state, treeRef);\n\n const visibleNodes: Node<CubeTreeNodeData>[] = useMemo(() => {\n const out: Node<CubeTreeNodeData>[] = [];\n for (const key of state.collection.getKeys()) {\n const node = state.collection.getItem(key);\n if (node && node.type === 'item') out.push(node);\n }\n return out;\n }, [state.collection]);\n\n const visibleNodesRef = useRef(visibleNodes);\n visibleNodesRef.current = visibleNodes;\n\n // ----- Virtualization -----\n const rowVirtualizer = useVirtualizer({\n count: visibleNodes.length,\n getScrollElement: () => scrollRef.current,\n getItemKey: (index: number) => {\n const node = visibleNodesRef.current[index];\n return node?.key ?? index;\n },\n estimateSize: () => SIZES[SIZE_NAME_TO_KEY[size]],\n gap: 1,\n overscan: 10,\n paddingStart: containerPadding,\n paddingEnd: containerPadding,\n });\n\n const treeTokens = useMemo(\n () => ({\n '$tree-height': height == null ? undefined : `${height}px`,\n '$tree-padding': `${containerPadding}px`,\n }),\n [height, containerPadding],\n );\n\n const totalSize = rowVirtualizer.getTotalSize();\n\n /**\n * Each scroll effect tracks its own \"last scrolled\" target instead\n * of sharing one ref. A shared ref creates a feedback loop: keyboard\n * nav updates the focused-key ref to the new row, and any subsequent\n * `visibleNodes` change OR `selectedKeys` array-identity change\n * (very common — `selectedKeys={[value]}` allocates a fresh array\n * every parent render) re-runs the selectedKeys effect, which sees\n * the ref no longer matches `selectedKeys[0]` and yanks the viewport\n * back to the selected row. Two refs let each effect dedupe against\n * its own intent only; the cost is at most one duplicate\n * `scrollToIndex` call when click updates focus and selection in the\n * same render (idempotent — both target the same index).\n */\n const lastFocusedScrollRef = useRef<Key | null>(null);\n const lastSelectedScrollRef = useRef<string | null>(null);\n\n /**\n * Keep the focused row visible during keyboard navigation.\n *\n * Uses `rowVirtualizer.scrollToIndex` (instead of\n * `querySelector + scrollIntoView`) so the scroll lands even when the\n * target row is outside the virtualizer's currently rendered window.\n * `align: 'auto'` only scrolls when needed, matching the prior\n * `scrollIntoView({ block: 'nearest' })` behavior.\n */\n useLayoutEffect(() => {\n const focusedKey = state.selectionManager.focusedKey;\n if (focusedKey == null) return;\n if (lastFocusedScrollRef.current === focusedKey) return;\n\n const index = visibleNodesRef.current.findIndex(\n (n) => n.key === focusedKey,\n );\n if (index < 0) return;\n\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n lastFocusedScrollRef.current = focusedKey;\n }, [state.selectionManager.focusedKey, rowVirtualizer]);\n\n /**\n * Same for the row an outside control points at (`_activeKey`): that\n * control keeps DOM focus, so `focusedKey` never moves.\n */\n const lastActiveScrollRef = useRef<string | null>(null);\n\n useLayoutEffect(() => {\n if (activeKey == null) {\n lastActiveScrollRef.current = null;\n return;\n }\n if (lastActiveScrollRef.current === activeKey) return;\n\n const index = visibleNodes.findIndex((n) => String(n.key) === activeKey);\n if (index < 0) return;\n\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n lastActiveScrollRef.current = activeKey;\n }, [activeKey, visibleNodes, rowVirtualizer]);\n\n /**\n * Scroll into view when controlled `selectedKeys` changes externally.\n *\n * Selection-manager `focusedKey` only updates on explicit user\n * interaction (click / keyboard) — it does NOT track controlled\n * `selectedKeys` prop changes. So when a parent updates the prop\n * (e.g. opening a file from elsewhere), we need a separate effect\n * to bring the row into view.\n *\n * Re-runs on `visibleNodes` so we retry once parents are expanded\n * (the row is invisible to the virtualizer until then).\n */\n useLayoutEffect(() => {\n if (selectedKeys == null) return;\n const target = selectedKeys[0];\n if (target == null) return;\n if (lastSelectedScrollRef.current === target) return;\n\n const index = visibleNodes.findIndex((n) => String(n.key) === target);\n if (index < 0) return;\n\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n lastSelectedScrollRef.current = target;\n }, [selectedKeys, visibleNodes, rowVirtualizer]);\n\n const mods = useMemo(\n () => ({\n 'has-height': height != null,\n shape,\n }),\n [height, shape],\n );\n\n // The forwarded ref points at the inner scroll container so\n // consumers can drive `scrollTop` directly. `treeRef` (used by\n // `useTree` for keyboard handling and as the role=\"treegrid\"\n // anchor) stays internal on `TreeElement`.\n const mergedScrollRef = useMemo(\n () => mergeRefs(ref, scrollRef),\n [ref, scrollRef],\n );\n\n return (\n <TreeElement\n {...gridProps}\n // Driven from outside (`_activeKey`), the tree is no tab stop: the\n // control that points at its rows keeps focus.\n tabIndex={activeKey === undefined ? gridProps.tabIndex : -1}\n ref={treeRef}\n qa={qa ?? 'Tree'}\n mods={mods}\n styles={baseStyles}\n tokens={treeTokens}\n >\n <TreeScrollContainer ref={mergedScrollRef}>\n <TreeSizer\n role=\"presentation\"\n tokens={{ '$tree-content-height': `${totalSize}px` }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualItem) => {\n const node = visibleNodes[virtualItem.index];\n if (!node) return null;\n const keyStr = String(node.key);\n const data = nodesByKey.get(keyStr);\n if (!data) return null;\n return (\n <TreeNode\n key={node.key}\n node={node}\n data={data}\n state={state}\n isCheckable={isCheckable}\n isExpanded={state.expandedKeys.has(node.key)}\n isChecked={checkbox.checkedSet.has(keyStr)}\n isIndeterminate={checkbox.halfCheckedSet.has(keyStr)}\n isLoading={loadDataController.loadingKeys.has(keyStr)}\n isActive={\n activeKey === undefined ? undefined : activeKey === keyStr\n }\n size={size}\n itemProps={itemProps}\n rowStyles={rowStyles}\n virtualOffset={virtualItem.start}\n virtualRef={rowVirtualizer.measureElement}\n virtualIndex={virtualItem.index}\n menu={treeMenu}\n contextMenu={treeContextMenu}\n menuTriggerProps={menuTriggerProps}\n menuProps={menuProps}\n onToggleChecked={checkbox.toggle}\n onAction={treeOnAction}\n />\n );\n })}\n </TreeSizer>\n </TreeScrollContainer>\n </TreeElement>\n );\n}\n\nconst _Tree = forwardRef(TreeBase);\n_Tree.displayName = 'Tree';\n\n/**\n * Hierarchical data display with optional checkboxes, single/multi\n * selection, async lazy loading, and keyboard navigation.\n *\n * Built on `useTree` / `useTreeState` (React Aria + React Stately) and\n * styled with Tasty.\n *\n * @example\n * ```tsx\n * <Tree\n * treeData={data}\n * isCheckable\n * selectionMode=\"none\"\n * defaultExpandedKeys={['root']}\n * onCheck={(keys) => console.log(keys)}\n * />\n * ```\n */\nexport const Tree = _Tree;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAASkC,WAAWC,MAAsC;CACxD,OACE,oBAAC,MAAD;EAEE,WAAWhB,gBAAgBgB,IAAI;EAC/B,YAAYA,KAAKE;EAEhBF,UAAAA,KAAKG;CACF,GALCH,KAAKC,GAKN;AAEV;AAEA,SAASG,oBACPC,UACAC,gBACU;CACV,MAAMC,OAAiB,CAAA;CACvB,MAAMC,SAASC,UAA8B;EAC3C,KAAK,MAAMT,QAAQS,OAAO;GACxB,IAAIH,kBAAkBN,KAAKU,Y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C,GAAG;KAC9B,MAAM0J,OAAOhF,WAAWxD,IAAIuI,MAAM;KAClC,IAAI,CAACC,MAAM,OAAO;KAClB,OACE,oBAAC,UAAD;MAEE,MAAM3J;MACA2J;MACCzD;MACM9D;MACb,YAAY8D,MAAMxD,aAAad,IAAI5B,OAAKC,GAAG;MAC3C,WAAW+E,SAAS4E,WAAWhI,IAAI8H,MAAM;MACzC,iBAAiB1E,SAAS6E,eAAejI,IAAI8H,MAAM;MACnD,WAAWxE,mBAAmB4E,YAAYlI,IAAI8H,MAAM;MACpD,UACEvF,cAAcqB,KAAAA,IAAYA,KAAAA,IAAYrB,cAAcuF;MAEhDpH;MACKe;MACAC;MACX,eAAemG,YAAYM;MAC3B,YAAY/B,eAAegC;MAC3B,cAAcP,YAAYxE;MAC1B,MAAMvB;MACN,aAAaE;MACKG;MACPC;MACX,iBAAiBgB,SAASiF;MAC1B,UAAUnG;KAAa,GAvBlB9D,OAAKC,GAuBa;IAG7B,CAAC;GACQ,CAAA;EACQ,CAAA;CACV,CAAA;AAEjB;AAEA,MAAMiK,QAAQnM,WAAWiE,QAAQ;AACjCkI,MAAMC,cAAc;;;;;;;;;;;;;;;;;;;AAoBpB,MAAaC,OAAOF"}
|
|
1
|
+
{"version":3,"file":"Tree.js","names":["useVirtualizer","OUTER_STYLES","forwardRef","useLayoutEffect","useMemo","useRef","useTree","Item","useTreeState","useEvent","useI18n","SIZE_NAME_TO_KEY","SIZES","pickBaseCustomizationProps","mergeRefs","extractStyles","TreeElement","TreeScrollContainer","TreeSizer","buildTreeIndex","getTreeNodeText","TreeNode","useCheckboxTree","useLoadData","Key","Node","Selection","ForwardedRef","ReactElement","ReactNode","CubeTreeNodeData","CubeTreeProps","TreeOnExpandInfo","TreeOnSelectInfo","TreeSelectionMode","renderItem","node","key","children","title","collectDisabledKeys","treeData","treeIsDisabled","keys","visit","nodes","isDisabled","push","expandWithParents","parentOf","Map","length","set","Set","parent","get","add","Array","from","findToggledKey","previous","next","added","k","has","resolveSelectionMode","selectionMode","isSelectable","TreeBase","props","ref","HTMLDivElement","isCheckable","selectionModeProp","size","shape","containerPadding","defaultExpandedKeys","expandedKeys","autoExpandParent","defaultCheckedKeys","checkedKeys","defaultSelectedKeys","selectedKeys","height","loadData","onExpand","onCheck","onSelect","itemProps","rowStyles","ariaLabel","qa","menu","treeMenu","contextMenu","treeContextMenu","onAction","treeOnAction","menuTriggerProps","menuProps","id","_activeKey","activeKey","_onRowAction","onRowAction","otherProps","baseStyles","treeRef","scrollRef","treeIndex","nodesByKey","byKey","disabledKeys","effectiveExpandedKeys","effectiveDefaultExpandedKeys","checkbox","index","loadDataController","initialExpandedKeys","previousExpandedRef","handleExpandedChange","nextSet","onExpandedChanged","undefined","current","toggled","String","info","expanded","previousSelectionRef","handleSelectionChange","selection","arr","state","collection","getKeys","getItem","type","selectedNodes","map","filter","n","selected","hasOnSelect","t","treeLabel","ariaProps","onSelectionChange","onExpandedChange","disabledBehavior","const","items","baseState","getChildren","patched","Object","create","Iterable","childNodes","gridProps","visibleNodes","out","visibleNodesRef","rowVirtualizer","count","getScrollElement","getItemKey","estimateSize","gap","overscan","paddingStart","paddingEnd","treeTokens","totalSize","getTotalSize","lastFocusedScrollRef","lastSelectedScrollRef","focusedKey","selectionManager","findIndex","scrollToIndex","align","lastActiveScrollRef","target","mods","mergedScrollRef","tabIndex","tokens","getVirtualItems","virtualItem","keyStr","data","checkedSet","halfCheckedSet","loadingKeys","start","measureElement","toggle","_Tree","displayName","Tree"],"sources":["../../../../src/components/content/Tree/Tree.tsx"],"sourcesContent":["import { useVirtualizer } from '@tanstack/react-virtual';\nimport { OUTER_STYLES } from '@tenphi/tasty';\nimport { forwardRef, useLayoutEffect, useMemo, useRef } from 'react';\nimport { useTree } from 'react-aria';\nimport { Item, useTreeState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal/hooks/use-event';\nimport { useI18n } from '../../../i18n/useI18n';\nimport { SIZE_NAME_TO_KEY, SIZES } from '../../../tokens/sizes';\nimport { pickBaseCustomizationProps } from '../../../utils/react/pickBaseCustomizationProps';\nimport { mergeRefs } from '../../../utils/react/useCombinedRefs';\nimport { extractStyles } from '../../../utils/styles';\n\nimport { TreeElement, TreeScrollContainer, TreeSizer } from './styled';\nimport { buildTreeIndex, getTreeNodeText } from './tree-index';\nimport { TreeNode } from './TreeNode';\nimport { useCheckboxTree } from './use-checkbox-tree';\nimport { useLoadData } from './use-load-data';\n\nimport type { Key, Node, Selection } from '@react-types/shared';\nimport type { ForwardedRef, ReactElement, ReactNode } from 'react';\nimport type {\n CubeTreeNodeData,\n CubeTreeProps,\n TreeOnExpandInfo,\n TreeOnSelectInfo,\n TreeSelectionMode,\n} from './types';\n\n/**\n * Render an `<Item>` for React Stately's collection builder.\n *\n * The visible content is rendered by `TreeNode` via `nodesByKey`,\n * so `<Item>`'s body is only used by Stately for the collection\n * (`textValue` for keyboard nav, `childItems` for nested traversal).\n */\nfunction renderItem(node: CubeTreeNodeData): ReactElement {\n return (\n <Item\n key={node.key}\n textValue={getTreeNodeText(node)}\n childItems={node.children as CubeTreeNodeData[] | undefined}\n >\n {node.title as ReactNode}\n </Item>\n );\n}\n\nfunction collectDisabledKeys(\n treeData: CubeTreeNodeData[],\n treeIsDisabled: boolean,\n): string[] {\n const keys: string[] = [];\n const visit = (nodes: CubeTreeNodeData[]) => {\n for (const node of nodes) {\n if (treeIsDisabled || node.isDisabled) keys.push(node.key);\n if (node.children) visit(node.children);\n }\n };\n visit(treeData);\n return keys;\n}\n\n/** Expand the supplied keys with all of their ancestor keys. */\nfunction expandWithParents(\n keys: string[] | undefined,\n parentOf: Map<string, string | null>,\n): string[] | undefined {\n if (!keys || keys.length === 0) return keys;\n const set = new Set<string>(keys);\n for (const key of keys) {\n let parent = parentOf.get(key);\n while (parent) {\n set.add(parent);\n parent = parentOf.get(parent);\n }\n }\n return Array.from(set);\n}\n\n/**\n * Diff two key sets to find the single key that was added or removed.\n * Returns `null` when both sets are equal.\n */\nfunction findToggledKey(\n previous: Set<Key>,\n next: Set<Key>,\n): { key: Key; added: boolean } | null {\n for (const k of next) {\n if (!previous.has(k)) return { key: k, added: true };\n }\n for (const k of previous) {\n if (!next.has(k)) return { key: k, added: false };\n }\n return null;\n}\n\nfunction resolveSelectionMode(\n selectionMode: TreeSelectionMode | undefined,\n isSelectable: boolean | undefined,\n): TreeSelectionMode {\n if (selectionMode != null) return selectionMode;\n if (isSelectable === false) return 'none';\n return 'single';\n}\n\nfunction TreeBase(props: CubeTreeProps, ref: ForwardedRef<HTMLDivElement>) {\n const {\n treeData,\n isCheckable = false,\n isSelectable,\n selectionMode: selectionModeProp,\n size = 'medium',\n shape = 'default',\n containerPadding = 4,\n isDisabled = false,\n defaultExpandedKeys,\n expandedKeys,\n autoExpandParent = false,\n defaultCheckedKeys,\n checkedKeys,\n defaultSelectedKeys,\n selectedKeys,\n height,\n loadData,\n onExpand,\n onCheck,\n onSelect,\n itemProps,\n rowStyles,\n ariaLabel,\n qa,\n menu: treeMenu,\n contextMenu: treeContextMenu,\n onAction: treeOnAction,\n menuTriggerProps,\n menuProps,\n id,\n _activeKey: activeKey,\n _onRowAction: onRowAction,\n ...otherProps\n } = props;\n\n const baseStyles = extractStyles(otherProps, OUTER_STYLES);\n\n const treeRef = useRef<HTMLDivElement>(null);\n const scrollRef = useRef<HTMLDivElement>(null);\n\n const treeIndex = useMemo(() => buildTreeIndex(treeData), [treeData]);\n const nodesByKey = treeIndex.byKey;\n const parentOf = treeIndex.parentOf;\n\n const disabledKeys = useMemo(\n () => collectDisabledKeys(treeData, isDisabled),\n [treeData, isDisabled],\n );\n\n const selectionMode = resolveSelectionMode(selectionModeProp, isSelectable);\n\n const effectiveExpandedKeys = useMemo(\n () =>\n autoExpandParent\n ? expandWithParents(expandedKeys, parentOf)\n : expandedKeys,\n [autoExpandParent, expandedKeys, parentOf],\n );\n\n const effectiveDefaultExpandedKeys = useMemo(\n () =>\n autoExpandParent\n ? expandWithParents(defaultExpandedKeys, parentOf)\n : defaultExpandedKeys,\n [autoExpandParent, defaultExpandedKeys, parentOf],\n );\n\n const checkbox = useCheckboxTree({\n treeData,\n index: treeIndex,\n isCheckable,\n defaultCheckedKeys,\n checkedKeys,\n onCheck,\n });\n\n const loadDataController = useLoadData({\n nodesByKey,\n loadData,\n initialExpandedKeys: effectiveExpandedKeys ?? effectiveDefaultExpandedKeys,\n });\n\n /**\n * In controlled mode, `previous` is read from `effectiveExpandedKeys`;\n * in uncontrolled mode this ref is the only source. Initialized from\n * the *effective* (ancestor-expanded) keys so the first toggle diffs\n * correctly.\n */\n const previousExpandedRef = useRef<Set<Key>>(\n new Set<Key>(effectiveExpandedKeys ?? effectiveDefaultExpandedKeys ?? []),\n );\n\n const handleExpandedChange = useEvent((nextSet: Set<Key>) => {\n loadDataController.onExpandedChanged(nextSet);\n\n const previous =\n expandedKeys !== undefined\n ? new Set<Key>(effectiveExpandedKeys ?? [])\n : previousExpandedRef.current;\n previousExpandedRef.current = new Set<Key>(nextSet);\n\n if (!onExpand) return;\n\n const toggled = findToggledKey(previous, nextSet);\n if (!toggled) return;\n\n const node = nodesByKey.get(String(toggled.key));\n if (!node) return;\n\n const info: TreeOnExpandInfo = {\n expanded: toggled.added,\n node,\n };\n onExpand(Array.from(nextSet), info);\n });\n\n /**\n * Same pattern as `previousExpandedRef`: in controlled mode we read\n * from `selectedKeys`; in uncontrolled mode this ref tracks state.\n */\n const previousSelectionRef = useRef<Set<Key>>(\n new Set<Key>(selectedKeys ?? defaultSelectedKeys ?? []),\n );\n\n /**\n * `useEvent` captures the closure lazily, so `state` (declared below\n * `ariaProps` / `useTreeState`) is safely accessible at call time.\n */\n const handleSelectionChange = useEvent((selection: Selection) => {\n if (!onSelect) return;\n let arr: Key[];\n if (selection === 'all') {\n // `nodesByKey` contains the full tree; use the collection's visible\n // keys so we don't leak keys under collapsed parents.\n arr = [];\n for (const key of state.collection.getKeys()) {\n const node = state.collection.getItem(key);\n if (node && node.type === 'item') arr.push(key);\n }\n } else {\n arr = Array.from(selection);\n }\n\n const nextSet = new Set<Key>(arr);\n const previous =\n selectedKeys !== undefined\n ? new Set<Key>(selectedKeys ?? [])\n : previousSelectionRef.current;\n previousSelectionRef.current = nextSet;\n\n const toggled = findToggledKey(previous, nextSet);\n if (!toggled) return;\n\n const node = nodesByKey.get(String(toggled.key));\n if (!node) return;\n\n const selectedNodes = arr\n .map((k) => nodesByKey.get(String(k)))\n .filter((n): n is CubeTreeNodeData => !!n);\n\n const info: TreeOnSelectInfo = {\n selected: toggled.added,\n node,\n selectedNodes,\n };\n\n onSelect(arr, info);\n });\n\n const hasOnSelect = onSelect != null;\n const { t } = useI18n();\n const treeLabel = ariaLabel ?? t('tree.ariaLabel', 'Tree');\n\n const ariaProps = useMemo(\n () => ({\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange:\n hasOnSelect && selectionMode !== 'none'\n ? handleSelectionChange\n : undefined,\n expandedKeys: effectiveExpandedKeys,\n defaultExpandedKeys: effectiveDefaultExpandedKeys,\n onExpandedChange: handleExpandedChange,\n disabledKeys,\n disabledBehavior: 'all' as const,\n items: treeData,\n children: renderItem as any,\n 'aria-label': treeLabel,\n // Row ids derive from it (`<id>-<key>`), which is what lets a control\n // outside the tree point at a row with `aria-activedescendant`.\n id,\n onAction: onRowAction\n ? (key: Key) => onRowAction(String(key))\n : undefined,\n }),\n [\n selectionMode,\n selectedKeys,\n defaultSelectedKeys,\n hasOnSelect,\n handleSelectionChange,\n effectiveExpandedKeys,\n effectiveDefaultExpandedKeys,\n handleExpandedChange,\n disabledKeys,\n treeData,\n treeLabel,\n id,\n onRowAction,\n ],\n );\n\n const baseState = useTreeState<CubeTreeNodeData>(ariaProps);\n\n // The legacy `TreeCollection` from `useTreeState` lacks `getChildren`,\n // but `useTree` calls it for nested rows. Derive a patched state.\n // TODO: Remove this patch when upgrading to a react-stately version\n // that ships `getChildren` on TreeCollection natively.\n const state = useMemo(() => {\n const collection = baseState.collection;\n if (typeof (collection as any).getChildren === 'function') {\n return baseState;\n }\n const patched = Object.create(collection);\n patched.getChildren = (key: Key): Iterable<Node<CubeTreeNodeData>> => {\n const node = collection.getItem(key);\n return node ? Array.from(node.childNodes) : [];\n };\n return { ...baseState, collection: patched };\n }, [baseState]);\n\n const { gridProps } = useTree(ariaProps, state, treeRef);\n\n const visibleNodes: Node<CubeTreeNodeData>[] = useMemo(() => {\n const out: Node<CubeTreeNodeData>[] = [];\n for (const key of state.collection.getKeys()) {\n const node = state.collection.getItem(key);\n if (node && node.type === 'item') out.push(node);\n }\n return out;\n }, [state.collection]);\n\n const visibleNodesRef = useRef(visibleNodes);\n visibleNodesRef.current = visibleNodes;\n\n // ----- Virtualization -----\n const rowVirtualizer = useVirtualizer({\n count: visibleNodes.length,\n getScrollElement: () => scrollRef.current,\n getItemKey: (index: number) => {\n const node = visibleNodesRef.current[index];\n return node?.key ?? index;\n },\n estimateSize: () => SIZES[SIZE_NAME_TO_KEY[size]],\n gap: 1,\n overscan: 10,\n paddingStart: containerPadding,\n paddingEnd: containerPadding,\n });\n\n const treeTokens = useMemo(\n () => ({\n '$tree-height': height == null ? undefined : `${height}px`,\n '$tree-padding': `${containerPadding}px`,\n }),\n [height, containerPadding],\n );\n\n const totalSize = rowVirtualizer.getTotalSize();\n\n /**\n * Each scroll effect tracks its own \"last scrolled\" target instead\n * of sharing one ref. A shared ref creates a feedback loop: keyboard\n * nav updates the focused-key ref to the new row, and any subsequent\n * `visibleNodes` change OR `selectedKeys` array-identity change\n * (very common — `selectedKeys={[value]}` allocates a fresh array\n * every parent render) re-runs the selectedKeys effect, which sees\n * the ref no longer matches `selectedKeys[0]` and yanks the viewport\n * back to the selected row. Two refs let each effect dedupe against\n * its own intent only; the cost is at most one duplicate\n * `scrollToIndex` call when click updates focus and selection in the\n * same render (idempotent — both target the same index).\n */\n const lastFocusedScrollRef = useRef<Key | null>(null);\n const lastSelectedScrollRef = useRef<string | null>(null);\n\n /**\n * Keep the focused row visible during keyboard navigation.\n *\n * Uses `rowVirtualizer.scrollToIndex` (instead of\n * `querySelector + scrollIntoView`) so the scroll lands even when the\n * target row is outside the virtualizer's currently rendered window.\n * `align: 'auto'` only scrolls when needed, matching the prior\n * `scrollIntoView({ block: 'nearest' })` behavior.\n */\n useLayoutEffect(() => {\n const focusedKey = state.selectionManager.focusedKey;\n if (focusedKey == null) return;\n if (lastFocusedScrollRef.current === focusedKey) return;\n\n const index = visibleNodesRef.current.findIndex(\n (n) => n.key === focusedKey,\n );\n if (index < 0) return;\n\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n lastFocusedScrollRef.current = focusedKey;\n }, [state.selectionManager.focusedKey, rowVirtualizer]);\n\n /**\n * Same for the row an outside control points at (`_activeKey`): that\n * control keeps DOM focus, so `focusedKey` never moves.\n */\n const lastActiveScrollRef = useRef<string | null>(null);\n\n useLayoutEffect(() => {\n if (activeKey == null) {\n lastActiveScrollRef.current = null;\n return;\n }\n if (lastActiveScrollRef.current === activeKey) return;\n\n const index = visibleNodes.findIndex((n) => String(n.key) === activeKey);\n if (index < 0) return;\n\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n lastActiveScrollRef.current = activeKey;\n }, [activeKey, visibleNodes, rowVirtualizer]);\n\n /**\n * Scroll into view when controlled `selectedKeys` changes externally.\n *\n * Selection-manager `focusedKey` only updates on explicit user\n * interaction (click / keyboard) — it does NOT track controlled\n * `selectedKeys` prop changes. So when a parent updates the prop\n * (e.g. opening a file from elsewhere), we need a separate effect\n * to bring the row into view.\n *\n * Re-runs on `visibleNodes` so we retry once parents are expanded\n * (the row is invisible to the virtualizer until then).\n */\n useLayoutEffect(() => {\n if (selectedKeys == null) return;\n const target = selectedKeys[0];\n if (target == null) return;\n if (lastSelectedScrollRef.current === target) return;\n\n const index = visibleNodes.findIndex((n) => String(n.key) === target);\n if (index < 0) return;\n\n rowVirtualizer.scrollToIndex(index, { align: 'auto' });\n lastSelectedScrollRef.current = target;\n }, [selectedKeys, visibleNodes, rowVirtualizer]);\n\n const mods = useMemo(\n () => ({\n 'has-height': height != null,\n shape,\n }),\n [height, shape],\n );\n\n // The forwarded ref points at the inner scroll container so\n // consumers can drive `scrollTop` directly. `treeRef` (used by\n // `useTree` for keyboard handling and as the role=\"treegrid\"\n // anchor) stays internal on `TreeElement`.\n const mergedScrollRef = useMemo(\n () => mergeRefs(ref, scrollRef),\n [ref, scrollRef],\n );\n\n return (\n <TreeElement\n {...pickBaseCustomizationProps(props)}\n {...gridProps}\n // Driven from outside (`_activeKey`), the tree is no tab stop: the\n // control that points at its rows keeps focus.\n tabIndex={activeKey === undefined ? gridProps.tabIndex : -1}\n ref={treeRef}\n qa={qa ?? 'Tree'}\n mods={{ ...mods, ...props.mods }}\n styles={baseStyles}\n tokens={{ ...treeTokens, ...props.tokens }}\n >\n <TreeScrollContainer ref={mergedScrollRef}>\n <TreeSizer\n role=\"presentation\"\n tokens={{ '$tree-content-height': `${totalSize}px` }}\n >\n {rowVirtualizer.getVirtualItems().map((virtualItem) => {\n const node = visibleNodes[virtualItem.index];\n if (!node) return null;\n const keyStr = String(node.key);\n const data = nodesByKey.get(keyStr);\n if (!data) return null;\n return (\n <TreeNode\n key={node.key}\n node={node}\n data={data}\n state={state}\n isCheckable={isCheckable}\n isExpanded={state.expandedKeys.has(node.key)}\n isChecked={checkbox.checkedSet.has(keyStr)}\n isIndeterminate={checkbox.halfCheckedSet.has(keyStr)}\n isLoading={loadDataController.loadingKeys.has(keyStr)}\n isActive={\n activeKey === undefined ? undefined : activeKey === keyStr\n }\n size={size}\n itemProps={itemProps}\n rowStyles={rowStyles}\n virtualOffset={virtualItem.start}\n virtualRef={rowVirtualizer.measureElement}\n virtualIndex={virtualItem.index}\n menu={treeMenu}\n contextMenu={treeContextMenu}\n menuTriggerProps={menuTriggerProps}\n menuProps={menuProps}\n onToggleChecked={checkbox.toggle}\n onAction={treeOnAction}\n />\n );\n })}\n </TreeSizer>\n </TreeScrollContainer>\n </TreeElement>\n );\n}\n\nconst _Tree = forwardRef(TreeBase);\n_Tree.displayName = 'Tree';\n\n/**\n * Hierarchical data display with optional checkboxes, single/multi\n * selection, async lazy loading, and keyboard navigation.\n *\n * Built on `useTree` / `useTreeState` (React Aria + React Stately) and\n * styled with Tasty.\n *\n * @example\n * ```tsx\n * <Tree\n * treeData={data}\n * isCheckable\n * selectionMode=\"none\"\n * defaultExpandedKeys={['root']}\n * onCheck={(keys) => console.log(keys)}\n * />\n * ```\n */\nexport const Tree = _Tree;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAASmC,WAAWC,MAAsC;CACxD,OACE,oBAAC,MAAD;EAEE,WAAWhB,gBAAgBgB,IAAI;EAC/B,YAAYA,KAAKE;EAEhBF,UAAAA,KAAKG;CACF,GALCH,KAAKC,GAKN;AAEV;AAEA,SAASG,oBACPC,UACAC,gBACU;CACV,MAAMC,OAAiB,CAAA;CACvB,MAAMC,SAASC,UAA8B;EAC3C,KAAK,MAAMT,QAAQS,OAAO;GACxB,IAAIH,kBAAkBN,KAAKU,YAAYH,KAAKI,KAAKX,KAAKC,GAAG;GACzD,IAAID,KAAKE,UAAUM,MAAMR,KAAKE,QAAQ;EACxC;CACF;CACAM,MAAMH,QAAQ;CACd,OAAOE;AACT;;AAGA,SAASK,kBACPL,MACAM,UACsB;CACtB,IAAI,CAACN,QAAQA,KAAKQ,WAAW,GAAG,OAAOR;CACvC,MAAMS,MAAM,IAAIC,IAAYV,IAAI;CAChC,KAAK,MAAMN,OAAOM,MAAM;EACtB,IAAIW,SAASL,SAASM,IAAIlB,GAAG;EAC7B,OAAOiB,QAAQ;GACbF,IAAII,IAAIF,MAAM;GACdA,SAASL,SAASM,IAAID,MAAM;EAC9B;CACF;CACA,OAAOG,MAAMC,KAAKN,GAAG;AACvB;;;;;AAMA,SAASO,eACPC,UACAC,MACqC;CACrC,KAAK,MAAME,KAAKF,MACd,IAAI,CAACD,SAASI,IAAID,CAAC,GAAG,OAAO;EAAE1B,KAAK0B;EAAGD,OAAO;CAAK;CAErD,K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MAC1B,MAAMvB;MACN,aAAaE;MACKG;MACPC;MACX,iBAAiBgB,SAASkF;MAC1B,UAAUpG;KAAa,GAvBlB9D,OAAKC,GAuBa;IAG7B,CAAC;GACQ,CAAA;EACQ,CAAA;CACV,CAAA;AAEjB;AAEA,MAAMkK,QAAQrM,WAAWkE,QAAQ;AACjCmI,MAAMC,cAAc;;;;;;;;;;;;;;;;;;;AAoBpB,MAAaC,OAAOF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { Item as _Item } from "../Item/Item.js";
|
|
3
3
|
import { Action } from "../../actions/Action/Action.js";
|
|
4
4
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
import { ComponentBaseProps } from "../../../utils/react/componentBaseProps.js";
|
|
2
3
|
import { CubeItemActionProps } from "../../actions/ItemAction/ItemAction.js";
|
|
3
4
|
import { CubeMenuProps } from "../../actions/Menu/Menu.js";
|
|
4
5
|
import "../../actions/ItemAction/index.js";
|
|
5
6
|
import "../../actions/Menu/index.js";
|
|
6
7
|
import { CubeItemBaseProps as CubeItemProps } from "../Item/Item.js";
|
|
7
8
|
import { SizeName } from "../../../tokens/sizes.js";
|
|
8
|
-
import {
|
|
9
|
+
import { OuterStyleProps, Styles } from "@tenphi/tasty";
|
|
9
10
|
import { ReactNode } from "react";
|
|
10
11
|
import { Key as Key$1 } from "@react-types/shared";
|
|
11
12
|
//#region src/components/content/Tree/types.d.ts
|
|
@@ -116,7 +117,7 @@ export interface TreeLoadDataNode {
|
|
|
116
117
|
* Designed to be a drop-in (modulo `is*` renames) for the AntD `Tree`
|
|
117
118
|
* `treeData` API, scoped to the v1 feature set.
|
|
118
119
|
*/
|
|
119
|
-
export interface CubeTreeProps extends
|
|
120
|
+
export interface CubeTreeProps extends ComponentBaseProps, OuterStyleProps {
|
|
120
121
|
/** Hierarchical data describing the tree. */
|
|
121
122
|
treeData: CubeTreeNodeData[];
|
|
122
123
|
/** Render a checkbox in front of every (eligible) row. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { deriveCheckedSets, toggleCheckedKey } from "./checked-keys.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.213.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { isDevEnvOrTest } from "../../../utils/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.213.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { useTooltipTriggerBinding } from "../overlays/Tooltip/TooltipTrigger.js";
|
|
4
4
|
import { createProviderTooltip } from "../overlays/Tooltip/TooltipProvider.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.213.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles, mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
|
+
import { pickBaseCustomizationProps } from "../../../utils/react/pickBaseCustomizationProps.js";
|
|
3
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
5
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
5
6
|
import { useWarn } from "../../../_internal/hooks/use-warn.js";
|
|
@@ -348,6 +349,7 @@ function DataTable(props, ref) {
|
|
|
348
349
|
const renderTable = (columnDragState, columnDropState, headCollectionProps) => /* @__PURE__ */ jsx(TableView, {
|
|
349
350
|
...rest,
|
|
350
351
|
rootRef,
|
|
352
|
+
customizationProps: pickBaseCustomizationProps(props),
|
|
351
353
|
qa: qa || "DataTable",
|
|
352
354
|
rows: visibleRows,
|
|
353
355
|
rowKeys: visibleRowKeys,
|