@cube-dev/ui-kit 0.222.0 → 0.223.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 +12 -0
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/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.js +15 -14
- 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 +3 -2
- package/dist/components/actions/Menu/Menu.js.map +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +8 -8
- package/dist/components/actions/Menu/MenuItem.js.map +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/touch-context-menu.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 +19 -15
- package/dist/components/actions/use-context-menu.js.map +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.d.ts +9 -0
- package/dist/components/content/Item/Item.js +106 -105
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutResizeHandle.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +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 +20 -9
- package/dist/components/content/Tree/Tree.js.map +1 -1
- package/dist/components/content/Tree/TreeNode.js +8 -5
- package/dist/components/content/Tree/TreeNode.js.map +1 -1
- package/dist/components/content/Tree/checked-keys.js +1 -1
- package/dist/components/content/Tree/rowId.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/item-table-sections.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRowLink.js +1 -1
- package/dist/components/data/TableBase/TableView.js +4 -5
- 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 +4 -3
- package/dist/components/data/TableBase/use-table-selection.js.map +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 +9 -4
- package/dist/components/data/TableBase/use-table-tree-state.js.map +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +14 -12
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +10 -9
- package/dist/components/fields/ComboBox/comboBoxOptions.js.map +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +23 -12
- package/dist/components/fields/CommandTextArea/CommandTextArea.js.map +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 +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +16 -12
- 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.js +1 -1
- package/dist/components/fields/FilterPicker/FilterTree.js +32 -24
- package/dist/components/fields/FilterPicker/FilterTree.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +10 -7
- 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/ListBox/use-disabled-focus-reset.js +66 -0
- package/dist/components/fields/ListBox/use-disabled-focus-reset.js.map +1 -0
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +23 -11
- package/dist/components/fields/ListBoxPopover/listNavigation.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/RadioGroup/joined-styles.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +35 -30
- 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.js +41 -95
- package/dist/components/fields/Select/Select.js.map +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +30 -25
- package/dist/components/fields/TagInput/TagInput.js.map +1 -1
- package/dist/components/fields/TagInput/TagList.js +174 -149
- package/dist/components/fields/TagInput/TagList.js.map +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useSuffixSpace.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/identifier-text-services.js +1 -1
- package/dist/components/fields/TextInput/password-manager-ignore.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.js +1 -1
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js +26 -23
- package/dist/components/fields/ToggleGroup/ToggleGroupItem.js.map +1 -1
- package/dist/components/fields/ToggleGroup/context.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/fields/popover-width.js +1 -1
- package/dist/components/fields/search-text-services.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/FormContext.js +1 -1
- package/dist/components/form/Form/FormElement.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/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.js +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/field-layout.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/NavTabs/NavTabs.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +4 -3
- 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 +60 -46
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +27 -8
- 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/TabsContext.js.map +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/scroll-tab-into-strip.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.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +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.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +104 -96
- package/dist/components/shared/DraggableCollection.js.map +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/shared/disabled-behavior.js +30 -0
- package/dist/components/shared/disabled-behavior.js.map +1 -0
- package/dist/components/shared/virtual-width.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 +21 -8
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/harness/colors-deps.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.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/layout-scale.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/componentBaseProps.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/pickBaseCustomizationProps.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOpenKey.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/useOverlayPosition.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +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/components/actions/CommandMenu.md +1 -1
- package/docs/components/actions/Menu.md +8 -5
- package/docs/components/actions/use-context-menu.md +1 -1
- package/docs/components/content/Tree.md +1 -1
- package/docs/components/data/ItemTable.md +3 -3
- package/docs/components/fields/ComboBox.md +1 -1
- package/docs/components/fields/CommandTextArea.md +1 -1
- package/docs/components/fields/FilterListBox.md +1 -1
- package/docs/components/fields/FilterPicker.md +1 -1
- package/docs/components/fields/ListBox.md +1 -1
- package/docs/components/fields/Picker.md +1 -1
- package/docs/components/fields/SearchComboBox.md +2 -2
- package/docs/components/fields/Select.md +3 -3
- package/docs/components/fields/TagInput.md +6 -6
- package/docs/components/fields/ToggleGroup.md +1 -1
- package/docs/components/navigation/Tabs.md +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableCollection.js","names":["KeyboardEvent","ReactNode","RefObject","useCallback","useEffect","useEffectEvent","useMemo","useRef","DragItem","DragPreview","DragPreviewRenderer","DroppableCollectionReorderEvent","ListDropTargetDelegate","ListKeyboardDelegate","mergeProps","useDraggableCollection","useDroppableCollection","DraggableCollectionState","DroppableCollectionState","MultipleSelectionManager","useDraggableCollectionState","useDroppableCollectionState","useEvent","Collection","DropOperation","Key","Node","getAllowedDropOperations","createMockDragState","collection","selectionManager","isDragging","getKeysForDrag","Set","getItems","draggedKey","draggingKeys","isDisabled","startDrag","moveDrag","endDrag","DraggableCollectionProps","state","disabledKeys","listRef","HTMLElement","orderedKeys","orientation","onReorder","newOrder","onItemDrop","targetKey","draggedKeys","shouldAcceptItemDrop","renderPreview","keys","children","dragState","dropState","collectionProps","Record","DraggableCollection","t0","$","_c","t1","e","target","movableKeys","dropPosition","key","movableKey","movableIndex","indexOf","targetIndex","String","newKeys","reduce","arr","i","push","handleReorder","t2","dragKeysRef","current","map","key_0","item","getItem","textValue","t3","Proxy","get","target_0","prop","_temp","value","Reflect","bind","dragSelectionManager","previewRef","t4","undefined","t5","preview","t6","t7","e_0","keys_0","dropOperation","handleItemDrop","t8","Symbol","for","t9","t10","t11","target_1","t12","t13","ref","keyboardDelegate","t14","dropTargetDelegate","t15","t16","t17","isDragActive","size","t18","type","x","y","isInternal","cancelNativeDrag","t19","handleEscape","e_1","document","addEventListener","removeEventListener","t20","t21","e_2","altKey","target_2","HTMLInputElement","HTMLTextAreaElement","isContentEditable","moveKeys","backward","forward","direction","preventDefault","stopPropagation","focusedKey","idx","targetIdx","length","newKeys_0","t22","t23","handleKeyDownCapture","onKeyDownCapture","t24","_c"],"sources":["../../../src/components/shared/DraggableCollection.tsx"],"sourcesContent":["import {\n KeyboardEvent,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useEffectEvent,\n useMemo,\n useRef,\n} from 'react';\nimport {\n DragItem,\n DragPreview,\n DragPreviewRenderer,\n DroppableCollectionReorderEvent,\n ListDropTargetDelegate,\n ListKeyboardDelegate,\n mergeProps,\n useDraggableCollection,\n useDroppableCollection,\n} from 'react-aria';\nimport {\n DraggableCollectionState,\n DroppableCollectionState,\n MultipleSelectionManager,\n useDraggableCollectionState,\n useDroppableCollectionState,\n} from 'react-stately';\n\nimport { useEvent } from '../../_internal/hooks/use-event';\n\nimport type { Collection, DropOperation, Key, Node } from '@react-types/shared';\n\nconst getAllowedDropOperations = (): DropOperation[] => ['move'];\n\n/**\n * Creates a no-op mock of DraggableCollectionState.\n * Used to satisfy useDraggableItem when drag is disabled (Rules of Hooks).\n */\nexport function createMockDragState(\n collection: Collection<Node<any>>,\n selectionManager: MultipleSelectionManager,\n): DraggableCollectionState {\n return {\n collection,\n selectionManager,\n isDragging: () => false,\n getKeysForDrag: () => new Set<Key>(),\n getItems: () => [],\n draggedKey: null,\n draggingKeys: new Set<Key>(),\n getAllowedDropOperations: () => [],\n isDisabled: false,\n startDrag: () => {},\n moveDrag: () => {},\n endDrag: () => {},\n };\n}\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface DraggableCollectionProps {\n state: {\n collection: Collection<Node<any>>;\n selectionManager: MultipleSelectionManager;\n disabledKeys: Set<Key>;\n };\n listRef: RefObject<HTMLElement | null>;\n orderedKeys: string[];\n orientation: 'horizontal' | 'vertical';\n onReorder?: (newOrder: string[]) => void;\n /**\n * Dropping *onto* an item rather than between items — a row that is a folder,\n * a tab that is a group. Mutually exclusive with reordering in practice: a\n * collection that accepts item drops usually has a meaningful order already.\n */\n onItemDrop?: (targetKey: Key, draggedKeys: Key[]) => void;\n /** Which items may receive a drop. Without it, none may. */\n shouldAcceptItemDrop?: (targetKey: Key) => boolean;\n /**\n * The image dragged under the cursor. Receives the keys being dragged rather\n * than React Aria's serialized `DragItem`s, because a caller that wants to\n * render an icon needs the record, not its `text/plain` form.\n *\n * Without one the browser drags a screenshot of the source element, which for\n * a full-width table row is a page-wide slab.\n */\n renderPreview?: (keys: Key[]) => ReactNode;\n /** Render function receiving drag/drop states and merged collection+keyboard props */\n children: (\n dragState: DraggableCollectionState,\n dropState: DroppableCollectionState,\n collectionProps: Record<string, unknown>,\n ) => ReactNode;\n}\n\n// =============================================================================\n// Component\n// =============================================================================\n\n/**\n * Generic wrapper that enables drag-and-drop reordering for a collection.\n *\n * Used by both DraggableTabList (horizontal) and DraggableListBox (vertical).\n * Encapsulates all drag/drop hook calls so they are only invoked when\n * reordering is actually enabled.\n */\nexport function DraggableCollection({\n state,\n listRef,\n orderedKeys,\n orientation,\n onReorder,\n onItemDrop,\n shouldAcceptItemDrop,\n renderPreview,\n children,\n}: DraggableCollectionProps) {\n const handleReorder = useEvent((e: DroppableCollectionReorderEvent) => {\n if (!onReorder) return;\n\n const { target, keys: movableKeys } = e;\n const { dropPosition, key: targetKey } = target;\n const movableKey = [...movableKeys][0] as string;\n\n const movableIndex = orderedKeys.indexOf(movableKey);\n const targetIndex = orderedKeys.indexOf(String(targetKey));\n\n if (movableIndex === -1 || targetIndex === -1) return;\n\n const newKeys =\n movableIndex !== targetIndex\n ? orderedKeys.reduce((arr, key, i) => {\n if (i === movableIndex) {\n return arr;\n }\n\n if (i === targetIndex) {\n if (dropPosition === 'before') {\n arr.push(movableKey);\n arr.push(key);\n } else {\n arr.push(key);\n arr.push(movableKey);\n }\n } else {\n arr.push(key);\n }\n\n return arr;\n }, [] as string[])\n : orderedKeys;\n\n onReorder(newKeys);\n });\n\n const getItems = useCallback(\n (keys: Set<Key>): DragItem[] => {\n dragKeysRef.current = [...keys];\n\n return [...keys].map((key) => {\n const item = state.collection.getItem(key);\n return {\n 'text/plain': item?.textValue || String(key),\n };\n });\n },\n [state.collection],\n );\n\n // Proxy selectionManager to hide selection from react-aria's drag logic.\n // Without this, react-aria drags ALL selected items when any selected item\n // is grabbed (hardcoded in useDraggableCollectionState → internal getKeys).\n // The proxy intercepts `selectedKeys` and `isSelected` so every item looks\n // unselected for drag, while all other methods (isDisabled, setFocusedKey, …)\n // delegate to the real manager. `bind(target)` preserves `this` for methods\n // that live on the prototype chain.\n const dragSelectionManager = useMemo(\n () =>\n new Proxy(state.selectionManager, {\n get(target, prop) {\n if (prop === 'selectedKeys') return new Set<Key>();\n if (prop === 'isSelected') return () => false;\n const value = Reflect.get(target, prop);\n return typeof value === 'function' ? value.bind(target) : value;\n },\n }),\n [state.selectionManager],\n );\n\n const previewRef = useRef<DragPreviewRenderer>(null);\n\n const dragState = useDraggableCollectionState({\n collection: state.collection,\n selectionManager: dragSelectionManager,\n getItems,\n getAllowedDropOperations,\n preview: renderPreview ? previewRef : undefined,\n });\n\n useDraggableCollection(\n {\n getItems,\n getAllowedDropOperations,\n },\n dragState,\n listRef,\n );\n\n const handleItemDrop = useEvent((e: any) => {\n if (!onItemDrop) return;\n\n const keys = [...(e.dropOperation === 'cancel' ? [] : dragKeysRef.current)];\n\n onItemDrop(e.target.key, keys);\n });\n\n // The keys being dragged, captured at drag start: by the time the drop lands\n // React Aria has already cleared them from the drag state.\n const dragKeysRef = useRef<Key[]>([]);\n\n const dropState = useDroppableCollectionState({\n collection: state.collection,\n selectionManager: state.selectionManager,\n onReorder: onReorder ? handleReorder : undefined,\n onItemDrop: onItemDrop ? handleItemDrop : undefined,\n // `'on'` is only offered for items that accept it; everything else falls\n // back to reordering, or to nothing.\n shouldAcceptItemDrop: shouldAcceptItemDrop\n ? (target: any) => shouldAcceptItemDrop(target.key)\n : undefined,\n });\n\n const keyboardDelegate = useMemo(\n () =>\n new ListKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: listRef,\n orientation,\n }),\n [state.collection, state.disabledKeys, listRef, orientation],\n );\n\n const dropTargetDelegate = useMemo(\n () =>\n new ListDropTargetDelegate(state.collection, listRef, {\n orientation,\n }),\n [state.collection, listRef, orientation],\n );\n\n const { collectionProps } = useDroppableCollection(\n {\n keyboardDelegate,\n dropTargetDelegate,\n onReorder: onReorder ? handleReorder : undefined,\n onItemDrop: onItemDrop ? handleItemDrop : undefined,\n },\n dropState,\n listRef,\n );\n\n // Force-cancel drag on Escape. Native HTML5 drag cancels visually, but some\n // browsers (Safari) don't fire `dragend` synchronously, leaving react-aria's\n // `isDragging` stale until a second keypress.\n const isDragActive = dragState.draggingKeys.size > 0;\n const cancelNativeDrag = useEffectEvent(() => {\n dragState.endDrag({\n type: 'dragend',\n keys: new Set(dragKeysRef.current),\n x: 0,\n y: 0,\n dropOperation: 'cancel',\n isInternal: false,\n });\n });\n\n useEffect(() => {\n if (!isDragActive) return;\n\n const handleEscape = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape') {\n cancelNativeDrag();\n }\n };\n\n document.addEventListener('keydown', handleEscape, true);\n\n return () => document.removeEventListener('keydown', handleEscape, true);\n }, [isDragActive]);\n\n // Alt+Arrow keyboard shortcut for reordering.\n // Uses capture phase so we read focusedKey BEFORE react-aria moves focus.\n // Skip when the event originates from a text input — Alt+Arrow is\n // word-by-word cursor navigation on macOS.\n const handleKeyDownCapture = useEvent((e: KeyboardEvent) => {\n if (!e.altKey || !onReorder) return;\n\n const target = e.target as HTMLElement;\n\n if (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target.isContentEditable\n ) {\n return;\n }\n\n const moveKeys =\n orientation === 'vertical'\n ? { backward: 'ArrowUp', forward: 'ArrowDown' }\n : { backward: 'ArrowLeft', forward: 'ArrowRight' };\n\n const direction =\n e.key === moveKeys.backward ? -1 : e.key === moveKeys.forward ? 1 : 0;\n\n if (direction === 0) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n const focusedKey = String(state.selectionManager.focusedKey);\n const idx = orderedKeys.indexOf(focusedKey);\n\n if (idx === -1) return;\n\n const targetIdx = idx + direction;\n\n if (targetIdx < 0 || targetIdx >= orderedKeys.length) return;\n\n const newKeys = [...orderedKeys];\n [newKeys[idx], newKeys[targetIdx]] = [newKeys[targetIdx], newKeys[idx]];\n onReorder(newKeys);\n });\n\n return (\n <>\n {children(dragState, dropState, {\n ...mergeProps(collectionProps, {\n onKeyDownCapture: handleKeyDownCapture,\n }),\n })}\n {renderPreview ? (\n // Rendered off-screen by React Aria and snapshotted at drag start. The\n // keys come from the ref rather than the `DragItem`s the render\n // function is handed, which only carry `text/plain`.\n <DragPreview ref={previewRef}>\n {() => {\n const preview = renderPreview(dragKeysRef.current);\n return preview ? <>{preview}</> : null;\n }}\n </DragPreview>\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;AAiCA,MAAM2B,iCAAkD,CAAC,MAAM;;;;;AAM/D,SAAgBC,oBACdC,YACAC,kBAC0B;CAC1B,OAAO;EACLD;EACAC;EACAC,kBAAkB;EAClBC,sCAAsB,IAAIC,IAAS;EACnCC,gBAAgB,CAAA;EAChBC,YAAY;EACZC,8BAAc,IAAIH,IAAS;EAC3BN,gCAAgC,CAAA;EAChCU,YAAY;EACZC,iBAAiB,CA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mG,sBAAA;EAIEF,MAAAxG,SAASC,WAAWC,WAAW,EAAA,GAC3B5C,WAAW6C,iBAAiB,EAAAwG,kBACXD,qBACpB,CAAC,EACH,CAAC;EAACnG,EAAA,MAAAP;EAAAO,EAAA,MAAAJ;EAAAI,EAAA,MAAAN;EAAAM,EAAA,MAAAL;EAAAK,EAAA,MAAAmG;EAAAnG,EAAA,MAAAiG;CAAA,OAAAA,MAAAjG,EAAA;CAAA,IAAAkG;CAAA,IAAAlG,EAAA,QAAAT,eAAA;EACD2G,MAAA3G,gBAIC,oBAAC,aAAD;GAAkB8C,KAAAA;GACf,gBAAA;IACC,MAAAI,UAAgBlD,cAAc6B,YAAWC,OAAQ;IAAE,OAC5CoB,UAAA,oBAAA,YAAA,EAAA,UAAaA,QAAO,CAAA,IAApB;GAA+B;EAH9B,CAAA,IAJb;EAUOzC,EAAA,MAAAT;EAAAS,EAAA,MAAAkG;CAAA,OAAAA,MAAAlG,EAAA;CAAA,IAAAqG;CAAA,IAAArG,EAAA,QAAAiG,OAAAjG,EAAA,QAAAkG,KAAA;EAhBVG,MAAA,qBAAA,YAAA,EAAA,UAAA,CACGJ,KAKAC,GAUO,EAAA,CAAA;EACPlG,EAAA,MAAAiG;EAAAjG,EAAA,MAAAkG;EAAAlG,EAAA,MAAAqG;CAAA,OAAAA,MAAArG,EAAA;CAAA,OAjBHqG;AAiBG;AAvPA,SAAArE,QAAA;CAAA,OA2E2C;AAAK"}
|
|
1
|
+
{"version":3,"file":"DraggableCollection.js","names":["KeyboardEvent","ReactNode","RefObject","useCallback","useEffect","useEffectEvent","useMemo","useRef","DragItem","DragPreview","DragPreviewRenderer","DroppableCollectionReorderEvent","ListDropTargetDelegate","ListKeyboardDelegate","mergeProps","useDraggableCollection","useDroppableCollection","DraggableCollectionState","DroppableCollectionState","MultipleSelectionManager","useDraggableCollectionState","useDroppableCollectionState","useEvent","isItemDisabled","Collection","DropOperation","Key","Node","getAllowedDropOperations","createMockDragState","collection","selectionManager","isDragging","getKeysForDrag","Set","getItems","draggedKey","draggingKeys","isDisabled","startDrag","moveDrag","endDrag","DraggableCollectionProps","state","disabledKeys","listRef","HTMLElement","orderedKeys","orientation","onReorder","newOrder","onItemDrop","targetKey","draggedKeys","shouldAcceptItemDrop","renderPreview","keys","children","dragState","dropState","collectionProps","Record","DraggableCollection","t0","$","_c","t1","e","target","movableKeys","dropPosition","key","movableKey","movableIndex","indexOf","targetIndex","String","newKeys","reduce","arr","i","push","handleReorder","t2","dragKeysRef","current","map","key_0","item","getItem","textValue","t3","Proxy","get","target_0","prop","_temp","key_1","value","Reflect","bind","dragSelectionManager","previewRef","t4","undefined","t5","preview","t6","t7","e_0","keys_0","dropOperation","handleItemDrop","t8","Symbol","for","t9","t10","t11","target_1","t12","t13","ref","keyboardDelegate","t14","dropTargetDelegate","t15","t16","t17","isDragActive","size","t18","type","x","y","isInternal","cancelNativeDrag","t19","handleEscape","e_1","document","addEventListener","removeEventListener","t20","t21","e_2","altKey","target_2","HTMLInputElement","HTMLTextAreaElement","isContentEditable","moveKeys","backward","forward","direction","preventDefault","stopPropagation","focusedKey","idx","targetIdx","length","newKeys_0","t22","t23","handleKeyDownCapture","onKeyDownCapture","t24","_c"],"sources":["../../../src/components/shared/DraggableCollection.tsx"],"sourcesContent":["import {\n KeyboardEvent,\n ReactNode,\n RefObject,\n useCallback,\n useEffect,\n useEffectEvent,\n useMemo,\n useRef,\n} from 'react';\nimport {\n DragItem,\n DragPreview,\n DragPreviewRenderer,\n DroppableCollectionReorderEvent,\n ListDropTargetDelegate,\n ListKeyboardDelegate,\n mergeProps,\n useDraggableCollection,\n useDroppableCollection,\n} from 'react-aria';\nimport {\n DraggableCollectionState,\n DroppableCollectionState,\n MultipleSelectionManager,\n useDraggableCollectionState,\n useDroppableCollectionState,\n} from 'react-stately';\n\nimport { useEvent } from '../../_internal/hooks/use-event';\n\nimport { isItemDisabled } from './disabled-behavior';\n\nimport type { Collection, DropOperation, Key, Node } from '@react-types/shared';\n\nconst getAllowedDropOperations = (): DropOperation[] => ['move'];\n\n/**\n * Creates a no-op mock of DraggableCollectionState.\n * Used to satisfy useDraggableItem when drag is disabled (Rules of Hooks).\n */\nexport function createMockDragState(\n collection: Collection<Node<any>>,\n selectionManager: MultipleSelectionManager,\n): DraggableCollectionState {\n return {\n collection,\n selectionManager,\n isDragging: () => false,\n getKeysForDrag: () => new Set<Key>(),\n getItems: () => [],\n draggedKey: null,\n draggingKeys: new Set<Key>(),\n getAllowedDropOperations: () => [],\n isDisabled: false,\n startDrag: () => {},\n moveDrag: () => {},\n endDrag: () => {},\n };\n}\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface DraggableCollectionProps {\n state: {\n collection: Collection<Node<any>>;\n selectionManager: MultipleSelectionManager;\n disabledKeys: Set<Key>;\n };\n listRef: RefObject<HTMLElement | null>;\n orderedKeys: string[];\n orientation: 'horizontal' | 'vertical';\n onReorder?: (newOrder: string[]) => void;\n /**\n * Dropping *onto* an item rather than between items — a row that is a folder,\n * a tab that is a group. Mutually exclusive with reordering in practice: a\n * collection that accepts item drops usually has a meaningful order already.\n */\n onItemDrop?: (targetKey: Key, draggedKeys: Key[]) => void;\n /** Which items may receive a drop. Without it, none may. */\n shouldAcceptItemDrop?: (targetKey: Key) => boolean;\n /**\n * The image dragged under the cursor. Receives the keys being dragged rather\n * than React Aria's serialized `DragItem`s, because a caller that wants to\n * render an icon needs the record, not its `text/plain` form.\n *\n * Without one the browser drags a screenshot of the source element, which for\n * a full-width table row is a page-wide slab.\n */\n renderPreview?: (keys: Key[]) => ReactNode;\n /** Render function receiving drag/drop states and merged collection+keyboard props */\n children: (\n dragState: DraggableCollectionState,\n dropState: DroppableCollectionState,\n collectionProps: Record<string, unknown>,\n ) => ReactNode;\n}\n\n// =============================================================================\n// Component\n// =============================================================================\n\n/**\n * Generic wrapper that enables drag-and-drop reordering for a collection.\n *\n * Used by both DraggableTabList (horizontal) and DraggableListBox (vertical).\n * Encapsulates all drag/drop hook calls so they are only invoked when\n * reordering is actually enabled.\n */\nexport function DraggableCollection({\n state,\n listRef,\n orderedKeys,\n orientation,\n onReorder,\n onItemDrop,\n shouldAcceptItemDrop,\n renderPreview,\n children,\n}: DraggableCollectionProps) {\n const handleReorder = useEvent((e: DroppableCollectionReorderEvent) => {\n if (!onReorder) return;\n\n const { target, keys: movableKeys } = e;\n const { dropPosition, key: targetKey } = target;\n const movableKey = [...movableKeys][0] as string;\n\n const movableIndex = orderedKeys.indexOf(movableKey);\n const targetIndex = orderedKeys.indexOf(String(targetKey));\n\n if (movableIndex === -1 || targetIndex === -1) return;\n\n const newKeys =\n movableIndex !== targetIndex\n ? orderedKeys.reduce((arr, key, i) => {\n if (i === movableIndex) {\n return arr;\n }\n\n if (i === targetIndex) {\n if (dropPosition === 'before') {\n arr.push(movableKey);\n arr.push(key);\n } else {\n arr.push(key);\n arr.push(movableKey);\n }\n } else {\n arr.push(key);\n }\n\n return arr;\n }, [] as string[])\n : orderedKeys;\n\n onReorder(newKeys);\n });\n\n const getItems = useCallback(\n (keys: Set<Key>): DragItem[] => {\n dragKeysRef.current = [...keys];\n\n return [...keys].map((key) => {\n const item = state.collection.getItem(key);\n return {\n 'text/plain': item?.textValue || String(key),\n };\n });\n },\n [state.collection],\n );\n\n // Proxy selectionManager to hide selection from react-aria's drag logic.\n // Without this, react-aria drags ALL selected items when any selected item\n // is grabbed (hardcoded in useDraggableCollectionState → internal getKeys).\n // The proxy intercepts `selectedKeys` and `isSelected` so every item looks\n // unselected for drag. It answers `isDisabled` from the collection: a\n // disabled item stays focusable (`disabledBehavior: 'selection'`), so the\n // real manager no longer reports it, and react-aria would let it be dragged.\n // All other methods (setFocusedKey, …) delegate to the real manager.\n // `bind(target)` preserves `this` for methods on the prototype chain.\n const dragSelectionManager = useMemo(\n () =>\n new Proxy(state.selectionManager, {\n get(target, prop) {\n if (prop === 'selectedKeys') return new Set<Key>();\n if (prop === 'isSelected') return () => false;\n if (prop === 'isDisabled') {\n return (key: Key) =>\n isItemDisabled(\n {\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n },\n key,\n );\n }\n const value = Reflect.get(target, prop);\n return typeof value === 'function' ? value.bind(target) : value;\n },\n }),\n [state.selectionManager, state.collection, state.disabledKeys],\n );\n\n const previewRef = useRef<DragPreviewRenderer>(null);\n\n const dragState = useDraggableCollectionState({\n collection: state.collection,\n selectionManager: dragSelectionManager,\n getItems,\n getAllowedDropOperations,\n preview: renderPreview ? previewRef : undefined,\n });\n\n useDraggableCollection(\n {\n getItems,\n getAllowedDropOperations,\n },\n dragState,\n listRef,\n );\n\n const handleItemDrop = useEvent((e: any) => {\n if (!onItemDrop) return;\n\n const keys = [...(e.dropOperation === 'cancel' ? [] : dragKeysRef.current)];\n\n onItemDrop(e.target.key, keys);\n });\n\n // The keys being dragged, captured at drag start: by the time the drop lands\n // React Aria has already cleared them from the drag state.\n const dragKeysRef = useRef<Key[]>([]);\n\n const dropState = useDroppableCollectionState({\n collection: state.collection,\n selectionManager: state.selectionManager,\n onReorder: onReorder ? handleReorder : undefined,\n onItemDrop: onItemDrop ? handleItemDrop : undefined,\n // `'on'` is only offered for items that accept it; everything else falls\n // back to reordering, or to nothing.\n shouldAcceptItemDrop: shouldAcceptItemDrop\n ? (target: any) => shouldAcceptItemDrop(target.key)\n : undefined,\n });\n\n const keyboardDelegate = useMemo(\n () =>\n new ListKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n ref: listRef,\n orientation,\n }),\n [state.collection, state.disabledKeys, listRef, orientation],\n );\n\n const dropTargetDelegate = useMemo(\n () =>\n new ListDropTargetDelegate(state.collection, listRef, {\n orientation,\n }),\n [state.collection, listRef, orientation],\n );\n\n const { collectionProps } = useDroppableCollection(\n {\n keyboardDelegate,\n dropTargetDelegate,\n onReorder: onReorder ? handleReorder : undefined,\n onItemDrop: onItemDrop ? handleItemDrop : undefined,\n },\n dropState,\n listRef,\n );\n\n // Force-cancel drag on Escape. Native HTML5 drag cancels visually, but some\n // browsers (Safari) don't fire `dragend` synchronously, leaving react-aria's\n // `isDragging` stale until a second keypress.\n const isDragActive = dragState.draggingKeys.size > 0;\n const cancelNativeDrag = useEffectEvent(() => {\n dragState.endDrag({\n type: 'dragend',\n keys: new Set(dragKeysRef.current),\n x: 0,\n y: 0,\n dropOperation: 'cancel',\n isInternal: false,\n });\n });\n\n useEffect(() => {\n if (!isDragActive) return;\n\n const handleEscape = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape') {\n cancelNativeDrag();\n }\n };\n\n document.addEventListener('keydown', handleEscape, true);\n\n return () => document.removeEventListener('keydown', handleEscape, true);\n }, [isDragActive]);\n\n // Alt+Arrow keyboard shortcut for reordering.\n // Uses capture phase so we read focusedKey BEFORE react-aria moves focus.\n // Skip when the event originates from a text input — Alt+Arrow is\n // word-by-word cursor navigation on macOS.\n const handleKeyDownCapture = useEvent((e: KeyboardEvent) => {\n if (!e.altKey || !onReorder) return;\n\n const target = e.target as HTMLElement;\n\n if (\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target.isContentEditable\n ) {\n return;\n }\n\n const moveKeys =\n orientation === 'vertical'\n ? { backward: 'ArrowUp', forward: 'ArrowDown' }\n : { backward: 'ArrowLeft', forward: 'ArrowRight' };\n\n const direction =\n e.key === moveKeys.backward ? -1 : e.key === moveKeys.forward ? 1 : 0;\n\n if (direction === 0) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n const { focusedKey } = state.selectionManager;\n const idx = orderedKeys.indexOf(String(focusedKey));\n\n // The keyboard reaches a disabled item, which stays where it is.\n if (idx === -1 || dragSelectionManager.isDisabled(focusedKey!)) return;\n\n const targetIdx = idx + direction;\n\n if (targetIdx < 0 || targetIdx >= orderedKeys.length) return;\n\n const newKeys = [...orderedKeys];\n [newKeys[idx], newKeys[targetIdx]] = [newKeys[targetIdx], newKeys[idx]];\n onReorder(newKeys);\n });\n\n return (\n <>\n {children(dragState, dropState, {\n ...mergeProps(collectionProps, {\n onKeyDownCapture: handleKeyDownCapture,\n }),\n })}\n {renderPreview ? (\n // Rendered off-screen by React Aria and snapshotted at drag start. The\n // keys come from the ref rather than the `DragItem`s the render\n // function is handed, which only carry `text/plain`.\n <DragPreview ref={previewRef}>\n {() => {\n const preview = renderPreview(dragKeysRef.current);\n return preview ? <>{preview}</> : null;\n }}\n </DragPreview>\n ) : null}\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAmCA,MAAM4B,iCAAkD,CAAC,MAAM;;;;;AAM/D,SAAgBC,oBACdC,YACAC,kBAC0B;CAC1B,OAAO;EACLD;EACAC;EACAC,kBAAkB;EAClBC,sCAAsB,IAAIC,IAAS;EACnCC,gBAAgB,CAAA;EAChBC,YAAY;EACZC,8BAAc,IAAIH,IAAS;EAC3BN,gCAAgC,CAAA;EAChCU,YAAY;EACZC,iBAAiB,CAAC;EAClBC,gBAAgB,CAAC;EACjBC,eAAe,CAAC;CAClB;AACF;;;;;;;;AAoDA,SAAOqB,oBAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAA6B,MAAA,EAAAtB,OAAAE,SAAAE,aAAAC,aAAAC,WAAAE,YAAAG,sBAAAC,eAAAE,aAAAM;CAUT,IAAAG;CAAA,IAAAF,EAAA,OAAAf,aAAAe,EAAA,OAAAjB,aAAA;EACMmB,MAAAC,MAAA;GAC7B,IAAI,CAAClB,WAAS;GAEd,MAAA,EAAAmB,QAAAZ,MAAAa,gBAAsCF;GACtC,MAAA,EAAAG,cAAAC,KAAAnB,cAAyCgB;GACzC,MAAAI,aAAmB,CAAA,GAAIH,WAAW,CAAC,CAAA;GAEnC,MAAAI,eAAqB1B,YAAW2B,QAASF,UAAU;GACnD,MAAAG,cAAoB5B,YAAW2B,QAASE,OAAOxB,SAAS,CAAC;GAEzD,IAAIqB,iBAAiB,MAAME,gBAAgB,IAAE;GAE7C,MAAAE,UACEJ,iBAAiBE,cACb5B,YAAW+B,QAAQC,KAAAR,KAAAS,MAAA;IACjB,IAAIA,MAAMP,cAAY,O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,OAAQ;IAAE,OAC5CqB,UAAA,oBAAA,YAAA,EAAA,UAAaA,QAAO,CAAA,IAApB;GAA+B;EAH9B,CAAA,IAJb;EAUO1C,EAAA,MAAAT;EAAAS,EAAA,MAAAmG;CAAA,OAAAA,MAAAnG,EAAA;CAAA,IAAAsG;CAAA,IAAAtG,EAAA,QAAAkG,OAAAlG,EAAA,QAAAmG,KAAA;EAhBVG,MAAA,qBAAA,YAAA,EAAA,UAAA,CACGJ,KAKAC,GAUO,EAAA,CAAA;EACPnG,EAAA,MAAAkG;EAAAlG,EAAA,MAAAmG;EAAAnG,EAAA,MAAAsG;CAAA,OAAAA,MAAAtG,EAAA;CAAA,OAjBHsG;AAiBG;AApQA,SAAAtE,QAAA;CAAA,OA6E2C;AAAK"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
2
|
import { WarningIcon } from "../../icons/WarningIcon.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/shared/InvalidIcon.tsx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
2
|
import { CheckIcon } from "../../icons/CheckIcon.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/shared/ValidIcon.tsx
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
|
+
//#region src/components/shared/disabled-behavior.ts
|
|
3
|
+
/**
|
|
4
|
+
* How a collection's React Stately state treats its disabled items.
|
|
5
|
+
*
|
|
6
|
+
* A disabled item stays focusable (`'selection'`), as WAI-ARIA keeps a
|
|
7
|
+
* disabled item of a composite widget reachable, so a keyboard or screen
|
|
8
|
+
* reader user hears it and why it is unavailable. The selection manager then
|
|
9
|
+
* no longer reports it as disabled, so the component asks `isItemDisabled`
|
|
10
|
+
* and keeps the item inert itself. A disabled collection keeps every item out
|
|
11
|
+
* of the keyboard (`'all'`), as a disabled field does. So does a collection
|
|
12
|
+
* where focus selects (`selectionBehavior: 'replace'`): focusing a disabled
|
|
13
|
+
* item would clear the selection.
|
|
14
|
+
*/
|
|
15
|
+
function getDisabledBehavior(isCollectionDisabled, selectionBehavior) {
|
|
16
|
+
return isCollectionDisabled || selectionBehavior === "replace" ? "all" : "selection";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whether an item is disabled: listed in `disabledKeys` or marked with its own
|
|
20
|
+
* `isDisabled`. Under `disabledBehavior: 'selection'` React Aria's
|
|
21
|
+
* `selectionManager.isDisabled` no longer says so (see `getDisabledBehavior`).
|
|
22
|
+
*/
|
|
23
|
+
function isItemDisabled(state, key) {
|
|
24
|
+
const collection = state.collection;
|
|
25
|
+
return !!state.disabledKeys?.has(key) || !!collection.getItem?.(key)?.props?.isDisabled;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { getDisabledBehavior, isItemDisabled };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=disabled-behavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disabled-behavior.js","names":["DisabledBehavior","Key","SelectionBehavior","getDisabledBehavior","isCollectionDisabled","selectionBehavior","DisabledItemsState","disabledKeys","Set","collection","isItemDisabled","state","key","getItem","props","isDisabled","has"],"sources":["../../../src/components/shared/disabled-behavior.ts"],"sourcesContent":["import type {\n DisabledBehavior,\n Key,\n SelectionBehavior,\n} from '@react-types/shared';\n\n/**\n * How a collection's React Stately state treats its disabled items.\n *\n * A disabled item stays focusable (`'selection'`), as WAI-ARIA keeps a\n * disabled item of a composite widget reachable, so a keyboard or screen\n * reader user hears it and why it is unavailable. The selection manager then\n * no longer reports it as disabled, so the component asks `isItemDisabled`\n * and keeps the item inert itself. A disabled collection keeps every item out\n * of the keyboard (`'all'`), as a disabled field does. So does a collection\n * where focus selects (`selectionBehavior: 'replace'`): focusing a disabled\n * item would clear the selection.\n */\nexport function getDisabledBehavior(\n isCollectionDisabled: boolean | undefined,\n selectionBehavior?: SelectionBehavior,\n): DisabledBehavior {\n return isCollectionDisabled || selectionBehavior === 'replace'\n ? 'all'\n : 'selection';\n}\n\n/** The parts of a collection state that say which items are disabled. */\nexport interface DisabledItemsState {\n disabledKeys?: Set<Key>;\n collection: object;\n}\n\n/**\n * Whether an item is disabled: listed in `disabledKeys` or marked with its own\n * `isDisabled`. Under `disabledBehavior: 'selection'` React Aria's\n * `selectionManager.isDisabled` no longer says so (see `getDisabledBehavior`).\n */\nexport function isItemDisabled(state: DisabledItemsState, key: Key): boolean {\n const collection = state.collection as {\n getItem?: (key: Key) => { props?: { isDisabled?: unknown } } | null;\n };\n\n return (\n !!state.disabledKeys?.has(key) ||\n !!collection.getItem?.(key)?.props?.isDisabled\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgBG,oBACdC,sBACAC,mBACkB;CAClB,OAAOD,wBAAwBC,sBAAsB,YACjD,QACA;AACN;;;;;;AAaA,SAAgBK,eAAeC,OAA2BC,KAAmB;CAC3E,MAAMH,aAAaE,MAAMF;CAIzB,OACE,CAAC,CAACE,MAAMJ,cAAcS,IAAIJ,GAAG,KAC7B,CAAC,CAACH,WAAWI,UAAUD,GAAG,CAAC,EAAEE,OAAOC;AAExC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { defaultRangeExtractor } from "@tanstack/react-virtual";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { Block } from "../../Block.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
2
|
import { Block } from "../../Block.js";
|
|
3
3
|
import { InternalSpinner } from "./InternalSpinner.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
package/dist/data/item-themes.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.223.0 | Cube Dev Team */
|
|
2
2
|
import { mergeStyles } from "@tenphi/tasty";
|
|
3
3
|
//#region src/data/item-themes.ts
|
|
4
4
|
const VALIDATION_STYLES = { border: {
|
|
@@ -141,7 +141,8 @@ const DEFAULT_ITEM_STYLES = {
|
|
|
141
141
|
selected: "#surface-text.09",
|
|
142
142
|
"selected & (hovered | focused)": "#surface-text.12",
|
|
143
143
|
"selected & pressed": "#surface-text.15",
|
|
144
|
-
disabled: "#clear"
|
|
144
|
+
disabled: "#clear",
|
|
145
|
+
"disabled & focused": "#surface-text.04"
|
|
145
146
|
},
|
|
146
147
|
color: {
|
|
147
148
|
"": "#surface-text-soft",
|
|
@@ -260,7 +261,8 @@ const DANGER_ITEM_STYLES = {
|
|
|
260
261
|
selected: "#danger-accent-text.09",
|
|
261
262
|
"selected & (hovered | focused)": "#danger-accent-text.12",
|
|
262
263
|
pressed: "#danger-accent-text.09",
|
|
263
|
-
disabled: "#clear"
|
|
264
|
+
disabled: "#clear",
|
|
265
|
+
"disabled & focused": "#danger-accent-text.03"
|
|
264
266
|
},
|
|
265
267
|
color: {
|
|
266
268
|
"": "#danger-accent-text",
|
|
@@ -366,7 +368,8 @@ const SUCCESS_ITEM_STYLES = {
|
|
|
366
368
|
selected: "#success-accent-text.09",
|
|
367
369
|
"selected & (hovered | focused)": "#success-accent-text.12",
|
|
368
370
|
pressed: "#success-accent-text.09",
|
|
369
|
-
disabled: "#clear"
|
|
371
|
+
disabled: "#clear",
|
|
372
|
+
"disabled & focused": "#success-accent-text.03"
|
|
370
373
|
},
|
|
371
374
|
color: {
|
|
372
375
|
"": "#success-accent-text",
|
|
@@ -472,7 +475,8 @@ const WARNING_ITEM_STYLES = {
|
|
|
472
475
|
selected: "#warning-accent-text.09",
|
|
473
476
|
"selected & (hovered | focused)": "#warning-accent-text.12",
|
|
474
477
|
pressed: "#warning-accent-text.09",
|
|
475
|
-
disabled: "#clear"
|
|
478
|
+
disabled: "#clear",
|
|
479
|
+
"disabled & focused": "#warning-accent-text.03"
|
|
476
480
|
},
|
|
477
481
|
color: {
|
|
478
482
|
"": "#warning-accent-text",
|
|
@@ -578,7 +582,8 @@ const NOTE_ITEM_STYLES = {
|
|
|
578
582
|
selected: "#note-accent-text.09",
|
|
579
583
|
"selected & (hovered | focused)": "#note-accent-text.12",
|
|
580
584
|
pressed: "#note-accent-text.09",
|
|
581
|
-
disabled: "#clear"
|
|
585
|
+
disabled: "#clear",
|
|
586
|
+
"disabled & focused": "#note-accent-text.03"
|
|
582
587
|
},
|
|
583
588
|
color: {
|
|
584
589
|
"": "#note-accent-text",
|
|
@@ -705,6 +710,10 @@ const CURRENT_FOCUS_RING = { outline: {
|
|
|
705
710
|
focused: "$ring-width #primary-accent-text"
|
|
706
711
|
} };
|
|
707
712
|
const CURRENT_ITEM_STYLES = mergeStyles(CURRENT_ITEM_RAMP, {
|
|
713
|
+
"$current-disabled-focus": {
|
|
714
|
+
"": "#current.1",
|
|
715
|
+
"@dark": "#current.078"
|
|
716
|
+
},
|
|
708
717
|
border: "#clear",
|
|
709
718
|
fill: {
|
|
710
719
|
"": "#current.0",
|
|
@@ -713,14 +722,18 @@ const CURRENT_ITEM_STYLES = mergeStyles(CURRENT_ITEM_RAMP, {
|
|
|
713
722
|
selected: "$current-selected",
|
|
714
723
|
"selected & (hovered | focused)": "$current-selected-hover",
|
|
715
724
|
"selected & pressed": "$current-selected-press",
|
|
716
|
-
disabled: "#clear"
|
|
725
|
+
disabled: "#clear",
|
|
726
|
+
"disabled & focused": "$current-disabled-focus"
|
|
717
727
|
},
|
|
718
728
|
color: {
|
|
719
729
|
"": "#current",
|
|
720
730
|
"disabled & !inherit-disabled & !inside-wrapper": "#current.4"
|
|
721
731
|
}
|
|
722
732
|
});
|
|
723
|
-
const CURRENT_CLEAR_STYLES = mergeStyles(CURRENT_ITEM_STYLES, CURRENT_FOCUS_RING, { fill: {
|
|
733
|
+
const CURRENT_CLEAR_STYLES = mergeStyles(CURRENT_ITEM_STYLES, CURRENT_FOCUS_RING, { fill: {
|
|
734
|
+
"selected & disabled": "#current.18",
|
|
735
|
+
"disabled & focused": "#clear"
|
|
736
|
+
} });
|
|
724
737
|
const CURRENT_OUTLINE_STYLES = mergeStyles(CURRENT_FOCUS_RING, {
|
|
725
738
|
border: {
|
|
726
739
|
"": "#current.08",
|