@cube-dev/ui-kit 0.183.0 → 0.184.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 +30 -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/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +2 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -8
- 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/Menu.js.map +1 -1
- package/dist/components/actions/Menu/MenuItem.js +19 -15
- package/dist/components/actions/Menu/MenuItem.js.map +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -8
- package/dist/components/actions/Menu/MenuSection.js.map +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -7
- 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/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +2 -1
- package/dist/components/content/Content.js.map +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.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 +27 -2
- package/dist/components/content/Item/Item.js +240 -231
- package/dist/components/content/Item/Item.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.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 +123 -118
- package/dist/components/content/Layout/LayoutHeader.js.map +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/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.d.ts +6 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Tag/Tag.js.map +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- 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 +1 -1
- package/dist/components/content/Tree/TreeNode.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.d.ts +1 -1
- package/dist/components/content/use-auto-tooltip.js +231 -125
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/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/TableView.js +1 -1
- package/dist/components/data/TableBase/column-menu.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.d.ts +1 -0
- package/dist/components/data/TableBase/styled.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-order.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-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.d.ts +8 -0
- package/dist/components/fields/Checkbox/Checkbox.js +58 -39
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +2 -2
- 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 +17 -1
- package/dist/components/fields/ColorInput/ColorInput.js +137 -134
- package/dist/components/fields/ColorInput/ColorInput.js.map +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +18 -2
- package/dist/components/fields/ColorPicker/ColorPicker.js +4 -3
- package/dist/components/fields/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/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/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.d.ts +17 -1
- package/dist/components/fields/DatePicker/DatePicker.js +81 -77
- 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 +17 -2
- package/dist/components/fields/DatePicker/DateRangePicker.js +109 -105
- package/dist/components/fields/DatePicker/DateRangePicker.js.map +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.d.ts +17 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +228 -220
- 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 +17 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +89 -85
- 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.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +11 -2
- package/dist/components/fields/FilterPicker/FilterPicker.js +3 -2
- package/dist/components/fields/FilterPicker/FilterPicker.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 +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.d.ts +20 -3
- 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 +10 -2
- package/dist/components/fields/RadioGroup/Radio.js +215 -213
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.d.ts +24 -3
- package/dist/components/fields/Select/Select.js +8 -5
- 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/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +2 -2
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.d.ts +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +11 -9
- package/dist/components/form/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/components/form/FieldWrapper/types.d.ts +1 -1
- package/dist/components/form/Form/Field.js +6 -4
- package/dist/components/form/Form/Field.js.map +1 -1
- package/dist/components/form/Form/Form.js +20 -5
- package/dist/components/form/Form/Form.js.map +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/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/legacy-tooltip.js +28 -0
- package/dist/components/form/legacy-tooltip.js.map +1 -0
- 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 +5 -3
- package/dist/components/form/wrapper.js.map +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +131 -110
- 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 +2 -1
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +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/styled.js +2 -2
- package/dist/components/navigation/Tabs/styled.js.map +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 +18 -9
- 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 +6 -5
- package/dist/components/overlays/Dialog/DialogForm.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +71 -64
- package/dist/components/overlays/Dialog/ModernDialogForm.js.map +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +68 -0
- package/dist/components/overlays/Dialog/use-content-overflow.js.map +1 -0
- package/dist/components/overlays/Dialog/use-dialog-container.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/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 +72 -69
- 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.d.ts +16 -0
- package/dist/components/overlays/Tooltip/split-trigger-props.js +54 -0
- package/dist/components/overlays/Tooltip/split-trigger-props.js.map +1 -0
- 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.d.ts +1 -1
- package/dist/data/item-themes.js +7 -1
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +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/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/navigationAdapter.default.js +1 -1
- package/dist/shared/form.d.ts +9 -2
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/escapePropagation.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/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +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/FieldProperties.md +2 -2
- package/docs/components/actions/ButtonSplit.md +2 -0
- package/docs/components/content/InfoBadge.md +1 -1
- package/docs/components/content/Layout.md +1 -1
- package/docs/components/content/Tag.md +10 -2
- package/docs/components/fields/Checkbox.md +11 -0
- package/docs/components/fields/ColorInput.md +2 -0
- package/docs/components/fields/ColorPicker.md +3 -1
- package/docs/components/fields/DatePicker.md +2 -0
- package/docs/components/fields/FilterPicker.md +3 -1
- package/docs/components/fields/PeriodPicker.md +2 -0
- package/docs/components/fields/Picker.md +3 -1
- package/docs/components/fields/RadioGroup.md +2 -2
- package/docs/components/fields/Select.md +5 -0
- package/docs/components/form/Field.md +2 -2
- package/docs/components/form/Form.md +2 -0
- package/docs/components/navigation/Tabs.md +3 -3
- package/docs/components/overlays/Dialog.md +30 -3
- package/docs/components/overlays/DialogForm.md +1 -0
- package/package.json +1 -1
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @cube-dev/ui-kit
|
|
2
2
|
|
|
3
|
+
## 0.184.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1425](https://github.com/cube-js/cube-ui-kit/pull/1425) [`86ea64d7`](https://github.com/cube-js/cube-ui-kit/commit/86ea64d7a98f836dd6a57076e505312087d6393a) Thanks [@tenphi](https://github.com/tenphi)! - Add `tooltip` to `Checkbox`: a tooltip shown on hover over the box and its inline label, standalone or inside a `Checkbox.Group`, and also while the checkbox is disabled — a place to say why an option is unavailable. It opens on keyboard focus too, and describes the input to screen readers. It takes a string or `TooltipProvider` props. It is separate from `labelTooltip`, the info badge next to a field label.
|
|
8
|
+
|
|
9
|
+
- [#1424](https://github.com/cube-js/cube-ui-kit/pull/1424) [`f0824b25`](https://github.com/cube-js/cube-ui-kit/commit/f0824b25c01c25148a4ca62a99baba2f99b58d73) Thanks [@tenphi](https://github.com/tenphi)! - `Dialog`'s `Footer` now draws a top border while the dialog's `Content` scrolls, and none while it fits. The footer carries a `content-overflow` modifier for as long as the body overflows, tracked through resizes and content changes, so the line separates the actions from a body that continues beneath them without cluttering a short dialog. Set `border` in the footer's own styles to keep the line always or never draw it. `Content` now renders `data-id="Content"`, which is how the dialog finds its body.
|
|
10
|
+
|
|
11
|
+
- [#1424](https://github.com/cube-js/cube-ui-kit/pull/1424) [`f0824b25`](https://github.com/cube-js/cube-ui-kit/commit/f0824b25c01c25148a4ca62a99baba2f99b58d73) Thanks [@tenphi](https://github.com/tenphi)! - `DialogForm` now renders its Submit and Cancel buttons in a pinned `Footer` beside the scrolling `Content`, instead of inside it. A long form scrolls its body while the actions stay visible; previously they scrolled away with the content and a dialog that needed pinned actions could not use `DialogForm` at all. The `<form>` now wraps both slots, so the buttons are still inside it and native submit is unchanged. The actions now sit as far below the last field as in any other dialog footer, 8px further than before.
|
|
12
|
+
|
|
13
|
+
A `Form` placed directly in a `Dialog` now lays itself out as the dialog's slot column, so a hand-composed `Dialog > Form > Content + Footer` scrolls and pins without restating `display: flex`, `flexGrow: 1`, `height: 'min 0'` and `gap: 0` on the form. This is the form's own state, so `styles` passed to the form still override it. A form nested deeper, or a plain `<form>` element, is left alone.
|
|
14
|
+
|
|
15
|
+
- [#1425](https://github.com/cube-js/cube-ui-kit/pull/1425) [`86ea64d7`](https://github.com/cube-js/cube-ui-kit/commit/86ea64d7a98f836dd6a57076e505312087d6393a) Thanks [@tenphi](https://github.com/tenphi)! - **Breaking:** the info badge next to a field's label is now `labelTooltip`, not `tooltip`. This applies to every field component (`TextInput`, `TextArea`, `CommandTextArea`, `NumberInput`, `PasswordInput`, `SearchInput`, `ColorInput`, `ComboBox`, `SearchComboBox`, `Select`, `Picker`, `FilterPicker`, `ListBox`, `FilterListBox`, `Checkbox`, `CheckboxGroup`, `Switch`, `RadioGroup`, `Slider` and its variants, the date and time pickers, `FileInput`, `ColorPicker`, `ColorSwatchGroup`, `TextInputMapper`), to the legacy `Field` / `Form.Item`, and to `FieldWrapper`. `tooltip` now means only the control's own tooltip, as it does on `Item` and `Button`. Previously a component that is both a field and a trigger had one prop meaning two things: a labelled `Select` rendered its `tooltip` on the trigger and again as a label badge, and `tooltip={true}` on a labelled `Picker` or `FilterPicker` rendered an empty badge.
|
|
16
|
+
|
|
17
|
+
Migrating: rename `tooltip` to `labelTooltip` wherever it described the label, whether on the field or on a legacy `Field` / `Form.Item` wrapping it. TypeScript flags the old spelling on every field except `Select` and `Checkbox`, where `tooltip` is valid as the control's own: the `Select` trigger's tooltip, and `Checkbox`'s new hover tooltip over the box and its inline label. Search for `Select` and `Checkbox` elements with both `label` and `tooltip` by hand and move the prop to `labelTooltip` if the label badge is what it was for (on `Select` it previously rendered in both places). JS callers, `as any` and untyped spreads are not flagged either; in development, the first labelled field — other than `Select` and `Checkbox` — that still receives `tooltip` logs a one-time console warning naming `labelTooltip`. The trigger tooltips of `Picker`, `FilterPicker` and `ColorPicker` remain `triggerTooltip`.
|
|
18
|
+
|
|
19
|
+
- [#1422](https://github.com/cube-js/cube-ui-kit/pull/1422) [`565dc93d`](https://github.com/cube-js/cube-ui-kit/commit/565dc93d8b71292218cebb2a96c70de4d7193518) Thanks [@tenphi](https://github.com/tenphi)! - Let popover fields anchor to an element other than their own trigger. `Select`, `Picker`, `FilterPicker`, `ColorPicker`, `ColorInput`, `DatePicker`, `DateRangePicker`, `DateRangeSeparatedPicker` and `PeriodPicker` now accept `targetRef`, matching the prop `DialogTrigger` already had, so adjacent controls of different widths can line their popovers up with one shared container. The same components (except `FilterPicker`, which already had it) also accept `placement`, since anchoring to a wider container is only useful alongside control over the alignment. Both default to the current behaviour, so existing callers are unaffected.
|
|
20
|
+
|
|
21
|
+
- [#1421](https://github.com/cube-js/cube-ui-kit/pull/1421) [`a8295d41`](https://github.com/cube-js/cube-ui-kit/commit/a8295d413cb6a25820937cb94af541e7b14c3079) Thanks [@tenphi](https://github.com/tenphi)! - Add a soft brand-purple `Tag` theme: `<Tag theme="primary">` renders the pale card — tinted border, strong colored text — at the primary hue, alongside the existing `default`, `danger`, `success`, `warning` and `note` cards. Previously the brand hue was reachable only through `theme="special"`, which is a solid fill, so designs calling for a soft purple chip had to borrow `note` one hue over. `special` is unchanged and still renders the solid fill.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#1426](https://github.com/cube-js/cube-ui-kit/pull/1426) [`17416c42`](https://github.com/cube-js/cube-ui-kit/commit/17416c422d8c2f878be168938c132d88fb7dcd94) Thanks [@tenphi](https://github.com/tenphi)! - Fix `Menu` items running their action twice from the keyboard: Enter or Space on a focused item called the menu's `onAction`, and the item's own `onAction`, twice — in a standalone `Menu`, a `Menu.Section`, a `Menu.Trigger` popover and a submenu alike (clicks were unaffected). Enter on a `Menu.SubMenuTrigger` now only opens the submenu, instead of also calling the parent menu's `onAction` with the trigger's key, and a click on a submenu trigger after opening it from the keyboard opens it straight away rather than after the hover delay.
|
|
26
|
+
|
|
27
|
+
- [#1425](https://github.com/cube-js/cube-ui-kit/pull/1425) [`86ea64d7`](https://github.com/cube-js/cube-ui-kit/commit/86ea64d7a98f836dd6a57076e505312087d6393a) Thanks [@tenphi](https://github.com/tenphi)! - A `Radio`'s `tooltip` now opens when the option takes keyboard focus, not only on hover, and the focused input is described by it, so screen readers announce it. It follows arrow-key navigation between options, and any `aria-describedby` the radio already had is kept alongside it.
|
|
28
|
+
|
|
29
|
+
- [#1425](https://github.com/cube-js/cube-ui-kit/pull/1425) [`86ea64d7`](https://github.com/cube-js/cube-ui-kit/commit/86ea64d7a98f836dd6a57076e505312087d6393a) Thanks [@tenphi](https://github.com/tenphi)! - Fix `tooltip` props that were accepted but rendered nothing. A classic (`type="radio"`) `Radio` now shows its `tooltip`, including on a disabled option. A button or tabs `Radio` now truncates a label it has no room for and shows the auto tooltip the docs describe (`tooltip` defaults to `true`); with a `block` description the label keeps its full width, as before. A button `Radio` also supports `highlight` now, and an icon-only one renders as a square icon button matching `ItemButton` instead of carrying an empty, padded label (32px instead of 44px at the default size). Both previously broke because the radio's hidden input was treated as part of the label. `Tabs type="radio"` and `Layout.Header` now truncate a title they have no room for and show it in a tooltip, instead of letting it spill out; `Layout.Header` renders its title text directly in the heading, without the inner `<span>` it used to wrap it in. `labelRef` on `Item`, `ItemButton` and `Radio` (button or classic) now points at the label element instead of leaking to the DOM as a `labelref` attribute, and accepts a callback ref as well as a ref object.
|
|
30
|
+
|
|
31
|
+
- [#1425](https://github.com/cube-js/cube-ui-kit/pull/1425) [`86ea64d7`](https://github.com/cube-js/cube-ui-kit/commit/86ea64d7a98f836dd6a57076e505312087d6393a) Thanks [@tenphi](https://github.com/tenphi)! - Fix tooltips that were accepted but never showed, or showed and vanished. Items inside a `Menu.Section`, and every `CommandMenu` item, no longer get a second tooltip wrapped around their own: the two closed each other, so an object or `tooltip={true}` tooltip flashed and was gone, and the extra wrapper put a `<div>` inside the menu list. An editable `Tab` whose `title` is not a string now shows its `tooltip`. The `Tabs` picker (`showTabPicker`) shows each tab's `tooltip` on its entry. `Button.Split` shows the current action's `tooltip` on the action button, as it already did its `icon` and `label` (`actionProps.tooltip` overrides it). A disabled tooltip no longer opens unseen on hover and swallows `Escape` while the pointer rests on its trigger, which could keep a `Dialog` from closing while the pointer was over an item or tab with actions, or a button radio.
|
|
32
|
+
|
|
3
33
|
## 0.183.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { deprecationWarning } from "../../utils/warnings.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import React, { useEffect } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { useRef } from "react";
|
package/dist/components/Block.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../utils/styles.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { CONTAINER_STYLES, filterBaseProps, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { ItemAction } from "./actions/ItemAction/ItemAction.js";
|
|
3
3
|
import { ItemBadge } from "./content/ItemBadge/ItemBadge.js";
|
|
4
4
|
import { Item } from "react-stately";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { usePaletteVersion } from "../tokens/palette-config.js";
|
|
3
3
|
import { getTokens } from "../tokens/all-tokens.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.184.0 | Cube Dev Team */
|
|
2
2
|
import { useCombinedRefs } from "../utils/react/useCombinedRefs.js";
|
|
3
3
|
import { filterBaseProps, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef, useCallback, useEffect, useState } from "react";
|
package/dist/components/Root.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../utils/styles.js";
|
|
3
3
|
import { AMBIENT_PREDEFINED_STATES } from "../utils/react/useScheme.js";
|
|
4
4
|
import { EventBusProvider } from "../utils/react/useEventBus.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useAction } from "../use-action.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.184.0 | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { _Item } from "../../content/Item/Item.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.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { getDisabledElementProps } from "../../../utils/react/disabledProps.js";
|
|
4
4
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../../utils/react/Slots.js";
|
|
3
3
|
import { Space } from "../../layout/Space.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.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { ButtonSplitContext } from "./context.js";
|
|
@@ -74,6 +74,7 @@ const ButtonSplit = forwardRef(function ButtonSplit(props, ref) {
|
|
|
74
74
|
size,
|
|
75
75
|
isDisabled,
|
|
76
76
|
icon: currentAction?.icon,
|
|
77
|
+
tooltip: currentAction?.tooltip,
|
|
77
78
|
...mergeProps(actionProps, { onPress: handleActionPress }),
|
|
78
79
|
children: currentAction?.label
|
|
79
80
|
}), /* @__PURE__ */ jsxs(__Menu.Trigger, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSplit.js","names":["CONTAINER_STYLES","filterBaseProps","tasty","forwardRef","ReactNode","useCallback","useMemo","useState","DirectionIcon","mergeProps","extractStyles","Button","Menu","ButtonSplitContext","BaseProps","ContainerStyleProps","Styles","CubeCollectionItemProps","CubeButtonProps","CubeMenuProps","ButtonSplitAction","Omit","key","label","CubeButtonSplitProps","actions","actionKey","defaultActionKey","onAction","onActionChange","type","theme","size","isDisabled","actionProps","Partial","triggerProps","menuProps","styles","children","STYLE_PROPS","ButtonSplitElement","as","qa","display","position","verticalAlign","ButtonSplit","HTMLDivElement","props","ref","controlledActionKey","role","rest","isControlled","undefined","uncontrolledKey","setUncontrolledKey","currentKey","currentAction","find","a","handleActionPress","handleSelectionChange","keys","newKey","containerStyles","mergedStyles","contextValue","isCustomMode","eventProps","icon","onPress","pressed","map","textValue","itemProps","displayName"],"sources":["../../../../src/components/actions/ButtonSplit/ButtonSplit.tsx"],"sourcesContent":["import { CONTAINER_STYLES, filterBaseProps, tasty } from '@tenphi/tasty';\nimport { forwardRef, ReactNode, useCallback, useMemo, useState } from 'react';\n\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { Button } from '../Button/Button';\nimport { Menu } from '../Menu/Menu';\n\nimport { ButtonSplitContext } from './context';\n\nimport type { BaseProps, ContainerStyleProps, Styles } from '@tenphi/tasty';\nimport type { CubeCollectionItemProps } from '../../CollectionItem';\nimport type { CubeButtonProps } from '../Button/Button';\nimport type { CubeMenuProps } from '../Menu/Menu';\n\nexport interface ButtonSplitAction\n extends Omit<\n CubeCollectionItemProps<object>,\n 'children' | 'onAction' | 'wrapper'\n > {\n key: string;\n label: ReactNode;\n}\n\nexport interface CubeButtonSplitProps extends BaseProps, ContainerStyleProps {\n /** Actions for strict mode. When provided, renders action + trigger buttons automatically. */\n actions?: ButtonSplitAction[];\n /** Currently selected action key (controlled). */\n actionKey?: string;\n /** Initially selected action key (uncontrolled). */\n defaultActionKey?: string;\n /** Called when the action button is pressed. Receives the current action key. */\n onAction?: (key: string) => void;\n /** Called when the selected action changes via the trigger menu. */\n onActionChange?: (key: string) => void;\n\n /** Button type applied to both action and trigger buttons in strict mode. */\n type?: CubeButtonProps['type'];\n /** Button theme applied to both action and trigger buttons in strict mode. */\n theme?: CubeButtonProps['theme'];\n /** Button size applied to both action and trigger buttons in strict mode. */\n size?: CubeButtonProps['size'];\n /** Disables both buttons in strict mode. */\n isDisabled?: boolean;\n\n /** Additional props for the action button in strict mode. */\n actionProps?: Partial<CubeButtonProps>;\n /** Additional props for the trigger button in strict mode. */\n triggerProps?: Partial<CubeButtonProps>;\n /** Additional props for the dropdown menu in strict mode. */\n menuProps?: Partial<CubeMenuProps<object>>;\n\n /** Custom styles for the wrapper element. */\n styles?: Styles;\n\n /** Custom mode: render arbitrary Button children. */\n children?: ReactNode;\n}\n\nconst STYLE_PROPS = CONTAINER_STYLES;\n\nconst ButtonSplitElement = tasty({\n as: 'div',\n qa: 'ButtonSplit',\n styles: {\n display: 'inline-flex',\n position: 'relative',\n verticalAlign: 'bottom',\n },\n});\n\nexport const ButtonSplit = forwardRef<HTMLDivElement, CubeButtonSplitProps>(\n function ButtonSplit(props, ref) {\n const {\n actions,\n actionKey: controlledActionKey,\n defaultActionKey,\n onAction,\n onActionChange,\n type,\n theme,\n size,\n isDisabled,\n actionProps,\n triggerProps,\n menuProps,\n styles,\n children,\n role,\n ...rest\n } = props;\n\n const isControlled = controlledActionKey !== undefined;\n const [uncontrolledKey, setUncontrolledKey] = useState(\n () => defaultActionKey ?? actions?.[0]?.key,\n );\n\n const currentKey = isControlled ? controlledActionKey : uncontrolledKey;\n\n const currentAction = useMemo(\n () => actions?.find((a) => a.key === currentKey) ?? actions?.[0],\n [actions, currentKey],\n );\n\n const handleActionPress = useCallback(() => {\n if (currentKey) {\n onAction?.(currentKey);\n }\n }, [currentKey, onAction]);\n\n const handleSelectionChange = useCallback(\n (keys: string[]) => {\n const newKey = keys[0];\n\n if (newKey) {\n if (!isControlled) {\n setUncontrolledKey(newKey);\n }\n\n onActionChange?.(newKey);\n }\n },\n [isControlled, onActionChange],\n );\n\n const containerStyles = extractStyles(rest, STYLE_PROPS);\n\n const mergedStyles = useMemo<Styles>(\n () => ({\n ...containerStyles,\n ...styles,\n }),\n [containerStyles, styles],\n );\n\n const contextValue = useMemo(\n () => ({\n currentKey,\n onAction,\n onActionChange,\n type,\n theme,\n size,\n isDisabled,\n }),\n [currentKey, onAction, onActionChange, type, theme, size, isDisabled],\n );\n\n const isCustomMode = children != null;\n\n return (\n <ButtonSplitContext.Provider value={contextValue}>\n <ButtonSplitElement\n {...filterBaseProps(rest, { eventProps: true })}\n ref={ref}\n data-button-split\n styles={mergedStyles}\n qa={rest.qa}\n // Custom mode renders peer buttons with no visible group label, which\n // is exactly when a caller needs `aria-label` to land on something the\n // AT will announce. `role` comes from `BaseProps`, so a caller that\n // wants something else — including `presentation` to opt out — just\n // passes it. Strict mode keeps its previous shape.\n role={role ?? (isCustomMode ? 'group' : undefined)}\n >\n {isCustomMode ? (\n children\n ) : actions ? (\n <>\n <Button\n type={type}\n theme={theme}\n size={size}\n isDisabled={isDisabled}\n icon={currentAction?.icon}\n {...mergeProps(actionProps, { onPress: handleActionPress })}\n >\n {currentAction?.label}\n </Button>\n <Menu.Trigger placement=\"bottom end\">\n <Button\n type={type}\n theme={theme}\n size={size}\n isDisabled={isDisabled}\n aria-label=\"More options\"\n icon={({ pressed }) => (\n <DirectionIcon to={pressed ? 'up' : 'down'} />\n )}\n {...triggerProps}\n />\n <Menu\n selectionMode=\"single\"\n selectedKeys={currentKey ? [currentKey] : []}\n onSelectionChange={handleSelectionChange}\n {...menuProps}\n >\n {actions.map(({ key, label, textValue, ...itemProps }) => (\n <Menu.Item\n key={key}\n textValue={\n textValue ?? (typeof label === 'string' ? label : key)\n }\n {...itemProps}\n >\n {label}\n </Menu.Item>\n ))}\n </Menu>\n </Menu.Trigger>\n </>\n ) : null}\n </ButtonSplitElement>\n </ButtonSplitContext.Provider>\n );\n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AOC;EAAMC;EAC5D,CAAC;CAED,MAAMoC,eAAe9B,YAAY;AAEjC,QACE,oBAAC,mBAAmB;EAAS,OAAO6B;YAClC,oBAAC;GACC,GAAInE,gBAAgBoD,MAAM,EAAEiB,YAAY,MAAM,CAAC;GAC1CpB;GACL;GACA,QAAQiB;GACR,IAAId,KAAKV;GAMT,MAAMS,SAASiB,eAAe,UAAUd;aAEvCc,eACC9B,WACEd,UACF,8CACE,oBAAC;IACOK;IACCC;IACDC;IACMC;IACZ,MAAM0B,eAAeY;IACrB,GAAI9D,WAAWyB,aAAa,EAAEsC,SAASV,mBAAmB,CAAC;cAE1DH,eAAepC;KACV,EACR,qBAAC,OAAK;IAAQ,WAAU;eACtB,oBAAC;KACOO;KACCC;KACDC;KACMC;KACZ,cAAW;KACX,OAAO,EAAEwC,cACP,oBAAC,iBAAc,IAAIA,UAAU,OAAO,SACrC;KACD,GAAIrC;MAAa,EAEnB,oBAAC;KACC,eAAc;KACd,cAAcsB,aAAa,CAACA,WAAW,GAAG,EAAE;KAC5C,mBAAmBK;KACnB,GAAI1B;eAEHZ,QAAQiD,KAAK,EAAEpD,KAAKC,OAAOoD,WAAW,GAAGC,gBACxC,oBAAC,OAAK;MAEJ,WACED,cAAc,OAAOpD,UAAU,WAAWA,QAAQD;MAEpD,GAAIsD;gBAEHrD;QANID,IAQR,CAAC;MACE;KACM,IACb,GACD;IACc;GACQ;EAGnC;AAEDyB,YAAY8B,cAAc"}
|
|
1
|
+
{"version":3,"file":"ButtonSplit.js","names":["CONTAINER_STYLES","filterBaseProps","tasty","forwardRef","ReactNode","useCallback","useMemo","useState","DirectionIcon","mergeProps","extractStyles","Button","Menu","ButtonSplitContext","BaseProps","ContainerStyleProps","Styles","CubeCollectionItemProps","CubeButtonProps","CubeMenuProps","ButtonSplitAction","Omit","key","label","CubeButtonSplitProps","actions","actionKey","defaultActionKey","onAction","onActionChange","type","theme","size","isDisabled","actionProps","Partial","triggerProps","menuProps","styles","children","STYLE_PROPS","ButtonSplitElement","as","qa","display","position","verticalAlign","ButtonSplit","HTMLDivElement","props","ref","controlledActionKey","role","rest","isControlled","undefined","uncontrolledKey","setUncontrolledKey","currentKey","currentAction","find","a","handleActionPress","handleSelectionChange","keys","newKey","containerStyles","mergedStyles","contextValue","isCustomMode","eventProps","icon","tooltip","onPress","pressed","map","textValue","itemProps","displayName"],"sources":["../../../../src/components/actions/ButtonSplit/ButtonSplit.tsx"],"sourcesContent":["import { CONTAINER_STYLES, filterBaseProps, tasty } from '@tenphi/tasty';\nimport { forwardRef, ReactNode, useCallback, useMemo, useState } from 'react';\n\nimport { DirectionIcon } from '../../../icons/DirectionIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { Button } from '../Button/Button';\nimport { Menu } from '../Menu/Menu';\n\nimport { ButtonSplitContext } from './context';\n\nimport type { BaseProps, ContainerStyleProps, Styles } from '@tenphi/tasty';\nimport type { CubeCollectionItemProps } from '../../CollectionItem';\nimport type { CubeButtonProps } from '../Button/Button';\nimport type { CubeMenuProps } from '../Menu/Menu';\n\nexport interface ButtonSplitAction\n extends Omit<\n CubeCollectionItemProps<object>,\n 'children' | 'onAction' | 'wrapper'\n > {\n key: string;\n label: ReactNode;\n}\n\nexport interface CubeButtonSplitProps extends BaseProps, ContainerStyleProps {\n /** Actions for strict mode. When provided, renders action + trigger buttons automatically. */\n actions?: ButtonSplitAction[];\n /** Currently selected action key (controlled). */\n actionKey?: string;\n /** Initially selected action key (uncontrolled). */\n defaultActionKey?: string;\n /** Called when the action button is pressed. Receives the current action key. */\n onAction?: (key: string) => void;\n /** Called when the selected action changes via the trigger menu. */\n onActionChange?: (key: string) => void;\n\n /** Button type applied to both action and trigger buttons in strict mode. */\n type?: CubeButtonProps['type'];\n /** Button theme applied to both action and trigger buttons in strict mode. */\n theme?: CubeButtonProps['theme'];\n /** Button size applied to both action and trigger buttons in strict mode. */\n size?: CubeButtonProps['size'];\n /** Disables both buttons in strict mode. */\n isDisabled?: boolean;\n\n /** Additional props for the action button in strict mode. */\n actionProps?: Partial<CubeButtonProps>;\n /** Additional props for the trigger button in strict mode. */\n triggerProps?: Partial<CubeButtonProps>;\n /** Additional props for the dropdown menu in strict mode. */\n menuProps?: Partial<CubeMenuProps<object>>;\n\n /** Custom styles for the wrapper element. */\n styles?: Styles;\n\n /** Custom mode: render arbitrary Button children. */\n children?: ReactNode;\n}\n\nconst STYLE_PROPS = CONTAINER_STYLES;\n\nconst ButtonSplitElement = tasty({\n as: 'div',\n qa: 'ButtonSplit',\n styles: {\n display: 'inline-flex',\n position: 'relative',\n verticalAlign: 'bottom',\n },\n});\n\nexport const ButtonSplit = forwardRef<HTMLDivElement, CubeButtonSplitProps>(\n function ButtonSplit(props, ref) {\n const {\n actions,\n actionKey: controlledActionKey,\n defaultActionKey,\n onAction,\n onActionChange,\n type,\n theme,\n size,\n isDisabled,\n actionProps,\n triggerProps,\n menuProps,\n styles,\n children,\n role,\n ...rest\n } = props;\n\n const isControlled = controlledActionKey !== undefined;\n const [uncontrolledKey, setUncontrolledKey] = useState(\n () => defaultActionKey ?? actions?.[0]?.key,\n );\n\n const currentKey = isControlled ? controlledActionKey : uncontrolledKey;\n\n const currentAction = useMemo(\n () => actions?.find((a) => a.key === currentKey) ?? actions?.[0],\n [actions, currentKey],\n );\n\n const handleActionPress = useCallback(() => {\n if (currentKey) {\n onAction?.(currentKey);\n }\n }, [currentKey, onAction]);\n\n const handleSelectionChange = useCallback(\n (keys: string[]) => {\n const newKey = keys[0];\n\n if (newKey) {\n if (!isControlled) {\n setUncontrolledKey(newKey);\n }\n\n onActionChange?.(newKey);\n }\n },\n [isControlled, onActionChange],\n );\n\n const containerStyles = extractStyles(rest, STYLE_PROPS);\n\n const mergedStyles = useMemo<Styles>(\n () => ({\n ...containerStyles,\n ...styles,\n }),\n [containerStyles, styles],\n );\n\n const contextValue = useMemo(\n () => ({\n currentKey,\n onAction,\n onActionChange,\n type,\n theme,\n size,\n isDisabled,\n }),\n [currentKey, onAction, onActionChange, type, theme, size, isDisabled],\n );\n\n const isCustomMode = children != null;\n\n return (\n <ButtonSplitContext.Provider value={contextValue}>\n <ButtonSplitElement\n {...filterBaseProps(rest, { eventProps: true })}\n ref={ref}\n data-button-split\n styles={mergedStyles}\n qa={rest.qa}\n // Custom mode renders peer buttons with no visible group label, which\n // is exactly when a caller needs `aria-label` to land on something the\n // AT will announce. `role` comes from `BaseProps`, so a caller that\n // wants something else — including `presentation` to opt out — just\n // passes it. Strict mode keeps its previous shape.\n role={role ?? (isCustomMode ? 'group' : undefined)}\n >\n {isCustomMode ? (\n children\n ) : actions ? (\n <>\n <Button\n type={type}\n theme={theme}\n size={size}\n isDisabled={isDisabled}\n icon={currentAction?.icon}\n tooltip={currentAction?.tooltip}\n {...mergeProps(actionProps, { onPress: handleActionPress })}\n >\n {currentAction?.label}\n </Button>\n <Menu.Trigger placement=\"bottom end\">\n <Button\n type={type}\n theme={theme}\n size={size}\n isDisabled={isDisabled}\n aria-label=\"More options\"\n icon={({ pressed }) => (\n <DirectionIcon to={pressed ? 'up' : 'down'} />\n )}\n {...triggerProps}\n />\n <Menu\n selectionMode=\"single\"\n selectedKeys={currentKey ? [currentKey] : []}\n onSelectionChange={handleSelectionChange}\n {...menuProps}\n >\n {actions.map(({ key, label, textValue, ...itemProps }) => (\n <Menu.Item\n key={key}\n textValue={\n textValue ?? (typeof label === 'string' ? label : key)\n }\n {...itemProps}\n >\n {label}\n </Menu.Item>\n ))}\n </Menu>\n </Menu.Trigger>\n </>\n ) : null}\n </ButtonSplitElement>\n </ButtonSplitContext.Provider>\n );\n },\n);\n\nButtonSplit.displayName = 'ButtonSplit';\n"],"mappings":";;;;;;;;;;;;AA4DA,MAAMwC,cAAcxC;AAEpB,MAAMyC,qBAAqBvC,MAAM;CAC/BwC,IAAI;CACJC,IAAI;CACJL,QAAQ;EACNM,SAAS;EACTC,UAAU;EACVC,eAAe;EACjB;CACD,CAAC;AAEF,MAAaC,cAAc5C,WACzB,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AUd;aAEvCc,eACC9B,WACEd,UACF,8CACE,oBAAC;IACOK;IACCC;IACDC;IACMC;IACZ,MAAM0B,eAAeY;IACrB,SAASZ,eAAea;IACxB,GAAI/D,WAAWyB,aAAa,EAAEuC,SAASX,mBAAmB,CAAC;cAE1DH,eAAepC;KACV,EACR,qBAAC,OAAK;IAAQ,WAAU;eACtB,oBAAC;KACOO;KACCC;KACDC;KACMC;KACZ,cAAW;KACX,OAAO,EAAEyC,cACP,oBAAC,iBAAc,IAAIA,UAAU,OAAO,SACrC;KACD,GAAItC;MAAa,EAEnB,oBAAC;KACC,eAAc;KACd,cAAcsB,aAAa,CAACA,WAAW,GAAG,EAAE;KAC5C,mBAAmBK;KACnB,GAAI1B;eAEHZ,QAAQkD,KAAK,EAAErD,KAAKC,OAAOqD,WAAW,GAAGC,gBACxC,oBAAC,OAAK;MAEJ,WACED,cAAc,OAAOrD,UAAU,WAAWA,QAAQD;MAEpD,GAAIuD;gBAEHtD;QANID,IAQR,CAAC;MACE;KACM,IACb,GACD;IACc;GACQ;EAGnC;AAEDyB,YAAY+B,cAAc"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
|
-
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
5
4
|
import { LoadingIcon } from "../../../icons/LoadingIcon.js";
|
|
6
5
|
import { _CollectionItem } from "../../CollectionItem.js";
|
|
7
6
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -148,12 +147,6 @@ function CommandMenu(props, ref) {
|
|
|
148
147
|
size,
|
|
149
148
|
onAction: item_3.onAction
|
|
150
149
|
}, item_3.key);
|
|
151
|
-
if (item_3.props.tooltip) menuItem = /* @__PURE__ */ jsx(TooltipProvider, {
|
|
152
|
-
activeWrap: true,
|
|
153
|
-
placement: "right",
|
|
154
|
-
...typeof item_3.props.tooltip === "string" ? { title: item_3.props.tooltip } : item_3.props.tooltip,
|
|
155
|
-
children: menuItem
|
|
156
|
-
}, item_3.key);
|
|
157
150
|
if (item_3.props.wrapper) menuItem = item_3.props.wrapper(menuItem);
|
|
158
151
|
items_1.push(React.cloneElement(menuItem, { key: item_3.key }));
|
|
159
152
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandMenu.js","names":["useObjectRef","useSyncRef","FocusStrategy","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","Styles","React","Key","ReactElement","ReactNode","Ref","useCallback","useMemo","useRef","useState","useFilter","useMenu","Section","useTreeState","useI18n","LoadingIcon","mergeProps","extractStyles","CollectionItem","Item","TooltipProvider","useMenuContext","CubeMenuProps","MenuItem","MenuSection","MenuTrigger","StyledDivider","StyledFooter","StyledHeader","StyledMenu","StyledCommandMenu","StyledEmptyState","StyledLoadingWrapper","StyledSearchInput","CommandMenuItem","id","textValue","keywords","forceMount","key","CubeCommandMenuProps","Omit","T","searchPlaceholder","searchValue","onSearchChange","value","filter","inputValue","emptyLabel","searchInputStyles","headerStyles","footerStyles","isLoading","shouldFilter","autoFocus","size","selectedKeys","defaultSelectedKeys","onSelectionChange","keys","CommandMenu","props","ref","HTMLDivElement","t","controlledSearchValue","customFilter","qa","styles","header","footer","restMenuProps","domRef","searchInputRef","HTMLInputElement","contextProps","ariaSelectedKeys","Set","undefined","ariaDefaultSelectedKeys","handleSelectionChange","allKeys","Array","from","treeState","collection","getKeys","map","String","completeProps","internalSearchValue","setInternalSearchValue","handleSearchChange","contains","sensitivity","textFilterFn","enhancedFilter","item","searchWords","trim","toLowerCase","split","word","length","searchableTexts","push","isArray","keyword","every","searchWord","some","text","includes","collectionFilter","nodes","Iterable","term","filterNodes","iter","result","node","type","filteredChildren","childNodes","rendered","treeStateProps","shouldUseVirtualFocus","collectionItems","hasSections","focusedKey","setFocusedKey","focusedKeyRef","filteredCollectionItems","items","forEach","hasFilteredItems","viewHasSections","findFirstSelectableItem","selectionManager","visit","childResult","isDisabled","menuRef","HTMLUListElement","menuProps","renderedItems","isFirstSection","sectionStyles","itemStyles","sectionHeadingStyles","menuItem","onAction","tooltip","tooltipProps","title","wrapper","cloneElement","useEffect","current","timeoutId","setTimeout","focus","clearTimeout","prevSearchValueRef","currentSearchValue","prevSearchValue","firstSelectableKey","extractedStyles","hasSearchTerm","showEmptyState","mods","popoverMod","popover","trayMod","tray","sections","Record","border","e","target","preventDefault","isArrowDown","currentKey","getVisibleItemKeys","findNextSelectableKey","currentIndex","direction","visibleKeys","increment","i","findFirstLastSelectableKey","keysToCheck","reverse","nextKey","indexOf","currentFocusedKey","selectionMode","select","getItem","onClose","closeOnSelect","boxShadow","radius","padding","_CommandMenu","forwardRef","RefAttributes","__CommandMenu","Object","assign","Trigger","displayName"],"sources":["../../../../src/components/actions/CommandMenu/CommandMenu.tsx"],"sourcesContent":["import { useObjectRef, useSyncRef } from '@react-aria/utils';\nimport { FocusStrategy } from '@react-types/shared';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n Styles,\n} from '@tenphi/tasty';\nimport React, {\n Key,\n ReactElement,\n ReactNode,\n Ref,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useMenu } from 'react-aria';\nimport { Section, useTreeState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\n// `CollectionItem` (not react-stately's bare `Item`) is what CommandMenu\n// actually renders through `MenuItem`, so it carries the `Item` props.\nimport { CollectionItem as Item } from '../../CollectionItem';\nimport { TooltipProvider } from '../../overlays/Tooltip/TooltipProvider';\nimport { useMenuContext } from '../Menu';\nimport { CubeMenuProps } from '../Menu/Menu';\nimport { MenuItem } from '../Menu/MenuItem';\nimport { MenuSection } from '../Menu/MenuSection';\nimport { MenuTrigger } from '../Menu/MenuTrigger';\nimport {\n StyledDivider,\n StyledFooter,\n StyledHeader,\n StyledMenu,\n} from '../Menu/styled';\n\nimport {\n StyledCommandMenu,\n StyledEmptyState,\n StyledLoadingWrapper,\n StyledSearchInput,\n} from './styled';\n\nexport interface CommandMenuItem {\n // Standard item props\n id: string;\n textValue: string;\n\n // Enhanced search features\n keywords?: string[];\n forceMount?: boolean;\n\n // Standard Menu item props inherited\n [key: string]: any;\n}\n\nexport interface CubeCommandMenuProps<T>\n extends BaseProps,\n ContainerStyleProps,\n Omit<\n CubeMenuProps<T>,\n 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'\n > {\n // Search-specific props\n searchPlaceholder?: string;\n searchValue?: string;\n onSearchChange?: (value: string) => void;\n filter?: (textValue: string, inputValue: string) => boolean;\n emptyLabel?: ReactNode;\n searchInputStyles?: Styles;\n headerStyles?: Styles;\n footerStyles?: Styles;\n\n // Advanced search features\n isLoading?: boolean;\n shouldFilter?: boolean;\n\n // Focus management - override the autoFocus from CubeMenuProps to allow boolean | FocusStrategy\n autoFocus?: boolean | FocusStrategy;\n\n // Size prop\n size?: 'medium' | 'large' | (string & {});\n\n /** Currently selected keys (controlled) */\n selectedKeys?: string[];\n /** Initially selected keys (uncontrolled) */\n defaultSelectedKeys?: string[];\n /** Handler for selection changes */\n onSelectionChange?: (keys: string[]) => void;\n}\n\nfunction CommandMenu<T extends object>(\n props: CubeCommandMenuProps<T>,\n ref: Ref<HTMLDivElement>,\n) {\n const { t } = useI18n();\n\n const {\n searchPlaceholder = t(\n 'commandMenu.searchPlaceholder',\n 'Search commands...',\n ),\n searchValue: controlledSearchValue,\n onSearchChange,\n filter: customFilter,\n emptyLabel = t('commandMenu.empty', 'No commands found'),\n searchInputStyles,\n headerStyles,\n footerStyles,\n isLoading = false,\n shouldFilter = true,\n autoFocus = true,\n size = 'medium',\n qa,\n styles,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n header,\n footer,\n ...restMenuProps\n } = props;\n\n const domRef = useObjectRef(ref);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const contextProps = useMenuContext();\n\n // Convert string[] to Set<Key> for React Aria compatibility\n const ariaSelectedKeys = selectedKeys ? new Set(selectedKeys) : undefined;\n const ariaDefaultSelectedKeys = defaultSelectedKeys\n ? new Set(defaultSelectedKeys)\n : undefined;\n\n const handleSelectionChange = onSelectionChange\n ? (keys: 'all' | Set<Key>) => {\n if (keys === 'all') {\n // Handle 'all' selection case - collect all available keys\n const allKeys = Array.from(treeState.collection.getKeys()).map(\n (key: any) => String(key),\n );\n onSelectionChange(allKeys);\n } else if (keys instanceof Set) {\n onSelectionChange(Array.from(keys).map((key) => String(key)));\n } else {\n onSelectionChange([]);\n }\n }\n : undefined;\n\n const completeProps = mergeProps(contextProps, restMenuProps, {\n selectedKeys: ariaSelectedKeys,\n defaultSelectedKeys: ariaDefaultSelectedKeys,\n onSelectionChange: handleSelectionChange,\n });\n\n // Search state management\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const searchValue = controlledSearchValue ?? internalSearchValue;\n\n const handleSearchChange = useCallback(\n (value: string) => {\n if (controlledSearchValue === undefined) {\n setInternalSearchValue(value);\n }\n onSearchChange?.(value);\n },\n [controlledSearchValue, onSearchChange],\n );\n\n // Filter setup\n const { contains } = useFilter({ sensitivity: 'base' });\n const textFilterFn = useMemo(\n () => customFilter || contains,\n [customFilter, contains],\n );\n\n // Enhanced filter function that supports keywords and forceMount\n const enhancedFilter = useCallback(\n (textValue: string, inputValue: string, item?: any) => {\n // Always show force-mounted items\n if (item?.forceMount) {\n return true;\n }\n\n // If shouldFilter is false, show all items\n if (!shouldFilter) {\n return true;\n }\n\n // Split input value into individual words and filter out empty strings\n const searchWords = inputValue\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no search words, show all items\n if (searchWords.length === 0) {\n return true;\n }\n\n // Collect all searchable text for this item\n const searchableTexts: string[] = [];\n\n // Add main text value\n searchableTexts.push(textValue.toLowerCase());\n\n // Add keywords if available\n if (item?.keywords && Array.isArray(item.keywords)) {\n searchableTexts.push(\n ...item.keywords.map((keyword: string) => keyword.toLowerCase()),\n );\n }\n\n // Check if ALL search words match at least one of the searchable texts\n return searchWords.every((searchWord) =>\n searchableTexts.some((text) => text.includes(searchWord)),\n );\n },\n [shouldFilter],\n );\n\n // Collection filter for React Stately\n const collectionFilter = useCallback(\n (nodes: Iterable<any>): Iterable<any> => {\n const term = searchValue.trim();\n\n // If no search term, return all nodes\n if (!term) {\n return nodes;\n }\n\n // Split search term into words for multi-word filtering\n const searchWords = term\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no valid search words, return all nodes\n if (searchWords.length === 0) {\n return nodes;\n }\n\n // Recursive helper to filter sections and items\n const filterNodes = (iter: Iterable<any>): any[] => {\n const result: any[] = [];\n\n for (const node of iter) {\n if (node.type === 'section') {\n const filteredChildren = filterNodes(node.childNodes);\n\n if (filteredChildren.length) {\n result.push({\n ...node,\n childNodes: filteredChildren,\n });\n }\n } else {\n const text = node.textValue ?? String(node.rendered ?? '');\n\n if (enhancedFilter(text, term, node.props)) {\n result.push(node);\n }\n }\n }\n\n return result;\n };\n\n return filterNodes(nodes);\n },\n [searchValue, enhancedFilter],\n );\n\n // Create tree state with filter for both keyboard navigation and rendering\n const treeStateProps = {\n ...completeProps,\n filter: collectionFilter,\n shouldUseVirtualFocus: true, // Always use virtual focus for CommandMenu\n };\n\n const treeState = useTreeState(treeStateProps);\n\n const collectionItems = [...treeState.collection];\n const hasSections = collectionItems.some((item) => item.type === 'section');\n\n // Track focused key for aria-activedescendant\n const [focusedKey, setFocusedKey] = React.useState<React.Key | null>(null);\n const focusedKeyRef = useRef<React.Key | null>(null);\n\n // Apply filtering to collection items for rendering and empty state checks\n const filteredCollectionItems = useMemo(() => {\n const term = searchValue.trim();\n if (!term) {\n return collectionItems;\n }\n\n // Split search term into words for multi-word filtering\n const searchWords = term\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no valid search words, return all items\n if (searchWords.length === 0) {\n return collectionItems;\n }\n\n const filterNodes = (items: any[]): any[] => {\n const result: any[] = [];\n\n [...items].forEach((item) => {\n if (item.type === 'section') {\n const filteredChildren = filterNodes(item.childNodes);\n if (filteredChildren.length) {\n result.push({\n ...item,\n childNodes: filteredChildren,\n });\n }\n } else {\n const text = item.textValue ?? String(item.rendered ?? '');\n if (enhancedFilter(text, term, item.props)) {\n result.push(item);\n }\n }\n });\n\n return result;\n };\n\n return filterNodes(collectionItems);\n }, [collectionItems, searchValue, enhancedFilter]);\n\n const hasFilteredItems = filteredCollectionItems.length > 0;\n const viewHasSections = filteredCollectionItems.some(\n (item) => item.type === 'section',\n );\n\n // Helper function to find the first selectable item from filtered results\n const findFirstSelectableItem = useCallback(() => {\n const { selectionManager } = treeState;\n\n const visit = (items: any[]): Key | null => {\n for (const node of items) {\n if (node?.type === 'section') {\n const childResult = visit(Array.from(node.childNodes ?? []));\n if (childResult != null) return childResult;\n } else if (\n node?.type === 'item' &&\n !selectionManager.isDisabled(node.key)\n ) {\n return node.key;\n }\n }\n return null;\n };\n\n return visit(filteredCollectionItems);\n }, [filteredCollectionItems, treeState.selectionManager]);\n\n // Create a ref for the menu container\n const menuRef = useRef<HTMLUListElement>(null);\n\n // Use menu hook for accessibility\n const { menuProps } = useMenu(\n {\n ...completeProps,\n 'aria-label': 'Command palette menu',\n filter: collectionFilter,\n shouldUseVirtualFocus: true,\n },\n treeState,\n menuRef,\n );\n\n // Manual rendering of menu items (similar to Menu component)\n const renderedItems = useMemo(() => {\n const items: React.ReactNode[] = [];\n let isFirstSection = true;\n\n filteredCollectionItems.forEach((item) => {\n if (item.type === 'section') {\n if (!isFirstSection) {\n items.push(\n <StyledDivider\n key={`divider-${String(item.key)}`}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />,\n );\n }\n\n items.push(\n <MenuSection\n key={item.key}\n item={item}\n state={treeState}\n styles={completeProps.sectionStyles}\n itemStyles={completeProps.itemStyles}\n headingStyles={completeProps.sectionHeadingStyles}\n size={size}\n />,\n );\n\n isFirstSection = false;\n return;\n }\n\n let menuItem = (\n <MenuItem\n key={item.key}\n item={item}\n state={treeState}\n styles={completeProps.itemStyles}\n size={size}\n onAction={item.onAction}\n />\n );\n\n // Apply tooltip wrapper if tooltip property is provided\n if (item.props.tooltip) {\n const tooltipProps =\n typeof item.props.tooltip === 'string'\n ? { title: item.props.tooltip }\n : item.props.tooltip;\n\n menuItem = (\n <TooltipProvider\n key={item.key}\n activeWrap\n placement=\"right\"\n {...tooltipProps}\n >\n {menuItem}\n </TooltipProvider>\n );\n }\n\n // Apply custom wrapper if provided\n if (item.props.wrapper) {\n menuItem = item.props.wrapper(menuItem);\n }\n\n // Ensure every child has a stable key, even if the wrapper component didn't set one.\n items.push(React.cloneElement(menuItem, { key: item.key }));\n });\n\n return items;\n }, [\n filteredCollectionItems,\n treeState,\n completeProps.sectionStyles,\n completeProps.itemStyles,\n\n completeProps.sectionHeadingStyles,\n ]);\n\n // Auto-focus search input\n React.useEffect(() => {\n if (autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the element is visible and focusable\n // This is especially important when the CommandMenu is opened in a popover\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus]);\n\n // Also focus when the component becomes visible (for trigger/popover usage)\n React.useEffect(() => {\n // Check if autoFocus is enabled and we're in a trigger context\n if (autoFocus && contextProps.autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the popover is fully rendered\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 50); // Slightly longer timeout for popover context\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus, contextProps.autoFocus]);\n\n // Track the previous search value to only run auto-focus when search actually changes\n const prevSearchValueRef = useRef<string>('');\n\n // Auto-focus first item when search value changes (but not on initial render)\n React.useEffect(() => {\n const currentSearchValue = searchValue.trim();\n const prevSearchValue = prevSearchValueRef.current;\n\n // Only auto-focus when search value actually changes\n if (currentSearchValue !== prevSearchValue && currentSearchValue !== '') {\n const firstSelectableKey = findFirstSelectableItem();\n\n if (firstSelectableKey && hasFilteredItems) {\n // Focus the first item in the selection manager\n treeState.selectionManager.setFocusedKey(firstSelectableKey);\n setFocusedKey(firstSelectableKey);\n focusedKeyRef.current = firstSelectableKey;\n } else {\n // Clear focus if no items are available\n treeState.selectionManager.setFocusedKey(null);\n setFocusedKey(null);\n focusedKeyRef.current = null;\n }\n }\n\n // Update the previous search value\n prevSearchValueRef.current = currentSearchValue;\n }, [searchValue, findFirstSelectableItem, hasFilteredItems]);\n\n // Extract styles\n const extractedStyles = useMemo(\n () => extractStyles(props, CONTAINER_STYLES),\n [props],\n );\n\n // Determine if we should show empty state based on actual filtered collection\n const hasSearchTerm = searchValue.trim().length > 0;\n const showEmptyState = hasSearchTerm && !hasFilteredItems && !isLoading;\n\n // Sync refs\n useSyncRef(contextProps, menuRef);\n\n const mods = useMemo(() => {\n // Determine mods based on menu context\n let popoverMod = completeProps.mods?.popover;\n let trayMod = completeProps.mods?.tray;\n\n return {\n sections: viewHasSections,\n footer: !!footer,\n header: !!header,\n popover: popoverMod,\n tray: trayMod,\n };\n }, [viewHasSections, footer, header, completeProps.mods]);\n\n return (\n <StyledCommandMenu\n {...(filterBaseProps(props) as Record<string, unknown>)}\n ref={domRef}\n qa={qa || 'CommandMenu'}\n data-size={size}\n mods={mods}\n styles={mergeProps(extractedStyles, styles)}\n >\n {/* Header */}\n {header && (\n <StyledHeader\n role=\"presentation\"\n data-size={size}\n styles={{ border: 'none', ...headerStyles }}\n >\n {header}\n </StyledHeader>\n )}\n\n {/* Search Input */}\n <StyledSearchInput\n ref={searchInputRef}\n type=\"search\"\n placeholder={searchPlaceholder}\n value={searchValue}\n styles={searchInputStyles}\n data-size={size}\n aria-controls={`${qa || 'CommandMenu'}-menu`}\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-haspopup=\"listbox\"\n aria-activedescendant={\n focusedKey != null\n ? `${qa || 'CommandMenu'}-menu-option-${focusedKey}`\n : undefined\n }\n onChange={(e) => handleSearchChange(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n\n const isArrowDown = e.key === 'ArrowDown';\n const { selectionManager } = treeState;\n // Use the ref to get the current focused key synchronously\n const currentKey =\n focusedKeyRef.current || selectionManager.focusedKey;\n\n // Helper function to get all visible item keys accounting for sections\n const getVisibleItemKeys = (): Key[] => {\n const keys: Key[] = [];\n\n const visit = (items: any[]) => {\n for (const node of items) {\n if (node?.type === 'section') {\n visit(Array.from(node.childNodes ?? []));\n } else if (node?.type === 'item') {\n keys.push(node.key);\n }\n }\n };\n\n visit(filteredCollectionItems);\n return keys;\n };\n\n // Helper function to find next selectable key in a direction\n const findNextSelectableKey = (\n currentIndex: number,\n direction: 'forward' | 'backward',\n visibleKeys: Key[],\n ) => {\n const increment = direction === 'forward' ? 1 : -1;\n\n for (\n let i = currentIndex + increment;\n i >= 0 && i < visibleKeys.length;\n i += increment\n ) {\n const key = visibleKeys[i];\n if (!selectionManager.isDisabled(key)) {\n return key;\n }\n }\n\n return null;\n };\n\n // Helper function to find first or last selectable key\n const findFirstLastSelectableKey = (\n direction: 'forward' | 'backward',\n visibleKeys: Key[],\n ) => {\n const keysToCheck =\n direction === 'forward'\n ? visibleKeys\n : [...visibleKeys].reverse();\n\n for (const key of keysToCheck) {\n if (!selectionManager.isDisabled(key)) {\n return key;\n }\n }\n\n return null;\n };\n\n const visibleKeys = getVisibleItemKeys();\n\n if (visibleKeys.length === 0) {\n return; // No visible items to navigate\n }\n\n let nextKey;\n const direction = isArrowDown ? 'forward' : 'backward';\n\n if (currentKey == null) {\n // No current focus, start from the first/last item\n nextKey = findFirstLastSelectableKey(direction, visibleKeys);\n } else {\n // Find current position in visible keys\n const currentIndex = visibleKeys.indexOf(currentKey);\n\n if (currentIndex === -1) {\n // Current key not in visible items, start from beginning/end\n nextKey = findFirstLastSelectableKey(direction, visibleKeys);\n } else {\n // Find next selectable item from current position\n nextKey = findNextSelectableKey(\n currentIndex,\n direction,\n visibleKeys,\n );\n\n // If no next key found, wrap to first/last selectable item\n if (nextKey == null) {\n nextKey = findFirstLastSelectableKey(direction, visibleKeys);\n }\n }\n }\n\n if (nextKey != null) {\n selectionManager.setFocusedKey(nextKey);\n setFocusedKey(nextKey);\n focusedKeyRef.current = nextKey; // Update ref immediately\n }\n } else if (\n e.key === 'Enter' ||\n (e.key === ' ' && !searchValue.trim())\n ) {\n const currentFocusedKey =\n focusedKey || treeState.selectionManager.focusedKey;\n if (currentFocusedKey != null) {\n e.preventDefault();\n\n // Trigger action for the focused item (like Menu does)\n // First check if there's a selection mode, if so, handle selection\n if (treeState.selectionManager.selectionMode !== 'none') {\n treeState.selectionManager.select(currentFocusedKey, e);\n } else {\n // Default behavior: trigger action\n const node = treeState.collection.getItem(currentFocusedKey);\n if (node) {\n // Call the tree state's action handler\n const onAction = (completeProps as any).onAction;\n if (onAction) {\n onAction(currentFocusedKey);\n }\n // Also call the item's individual onAction if it exists\n if (node.props?.onAction) {\n node.props.onAction(currentFocusedKey);\n }\n }\n }\n\n // Close the menu if we're in a trigger context and closeOnSelect is enabled (default behavior)\n const { onClose, closeOnSelect } = contextProps;\n if (onClose && closeOnSelect !== false) {\n onClose();\n }\n }\n } else if (e.key === 'Escape') {\n if (searchValue) {\n e.preventDefault();\n handleSearchChange('');\n }\n }\n }}\n />\n\n {/* Loading State */}\n {isLoading && (\n <StyledLoadingWrapper>\n <LoadingIcon\n role=\"progressbar\"\n aria-label=\"Loading commands\"\n aria-hidden={false}\n />\n </StyledLoadingWrapper>\n )}\n\n {/* Menu Content - always render unless loading */}\n {!isLoading && !showEmptyState && (\n <StyledMenu\n {...menuProps}\n ref={menuRef}\n id={`${qa || 'CommandMenu'}-menu`}\n aria-label=\"Command menu\"\n qa=\"Menu\"\n data-size={size}\n mods={mods}\n styles={{\n border: 'none',\n boxShadow: 'none',\n radius: 0,\n padding: '0.5x',\n }}\n >\n {renderedItems}\n </StyledMenu>\n )}\n\n {/* Empty State - show when search term exists but no results */}\n {!isLoading && showEmptyState && (\n <StyledEmptyState>{emptyLabel}</StyledEmptyState>\n )}\n\n {/* Footer */}\n {footer && (\n <StyledFooter\n role=\"presentation\"\n data-size={size}\n styles={footerStyles}\n >\n {footer}\n </StyledFooter>\n )}\n </StyledCommandMenu>\n );\n}\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\nconst _CommandMenu = React.forwardRef(CommandMenu) as <T>(\n props: CubeCommandMenuProps<T> & React.RefAttributes<HTMLDivElement>,\n) => ReactElement;\n\n// Attach Trigger alias from MenuTrigger for consistent API\n// Also attach Item and Section for compound component pattern\nconst __CommandMenu = Object.assign(_CommandMenu, {\n Trigger: MenuTrigger,\n Item,\n Section,\n displayName: 'CommandMenu',\n});\n\nexport { __CommandMenu as CommandMenu };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiGA,SAASoE,YACPC,OACAC,KACA;CACA,MAAM,EAAEE,MAAMnD,SAAS;CAEvB,MAAM,EACJ6B,oBAAoBsB,EAClB,iCACA,qBACD,EACDrB,aAAasB,uBACbrB,gBACAE,QAAQoB,cACRlB,aAAagB,EAAE,qBAAqB,oBAAoB,EACxDf,mBACAC,cACAC,cACAC,YAAY,OACZC,eAAe,MACfC,YAAY,MACZC,OAAO,UACPY,IACAC,QACAZ,cACAC,qBACAC,mBACAW,QACAC,QACA,GAAGC,kBACDV;CAEJ,MAAMW,SAAShF,aAAasE,IAAI;CAChC,MAAMW,iBAAiBlE,OAAyB,KAAK;CACrD,MAAMoE,eAAevD,gBAAgB;CAwBrC,MAAMqE,gBAAgB1E,aAAW4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I3E,QAAM;SAER,MAAM+B,WAAY9D,cAAsB8D;AACxC,aAAIA,SACFA,UAAS4C,kBAAkB;AAG7B,aAAI3E,OAAK3D,OAAO0F,SACd/B,QAAK3D,MAAM0F,SAAS4C,kBAAkB;;;OAM5C,MAAM,EAAEI,SAASC,kBAAkB7H;AACnC,WAAI4H,WAAWC,kBAAkB,MAC/BD,UAAS;;gBAGJrB,IAAE5I,QAAQ,UACnB;UAAIK,aAAa;AACfuI,WAAEE,gBAAgB;AAClBxF,0BAAmB,GAAG;;;;KAG1B;GAIHxC,aACC,oBAAC,kCACC,oBAAC;IACC,MAAK;IACL,cAAW;IACX,eAAa;KAAM,GAGxB;GAGA,CAACA,aAAa,CAACqH,kBACd,oBAAC;IACC,GAAIzB;IACJ,KAAKF;IACL,IAAI,GAAG3E,MAAM,cAAa;IAC1B,cAAW;IACX,IAAG;IACH,aAAWZ;IACLmH;IACN,QAAQ;KACNO,QAAQ;KACRwB,WAAW;KACXC,QAAQ;KACRC,SAAS;KACV;cAEA1D;KAEJ;GAGA,CAAC7F,aAAaqH,kBACb,oBAAC,8BAAkBzH,aACpB;GAGAsB,UACC,oBAAC;IACC,MAAK;IACL,aAAWf;IACX,QAAQJ;cAEPmB;KAEJ;;GACiB;;AAKxB,MAAMsI,eAAe5M,MAAM6M,WAAWjJ,YAAY;AAMlD,MAAMmJ,gBAAgBC,OAAOC,OAAOL,cAAc;CAChDM,SAAS1L;CACTN;CACAP;CACAwM,aAAa;CACd,CAAC"}
|
|
1
|
+
{"version":3,"file":"CommandMenu.js","names":["useObjectRef","useSyncRef","FocusStrategy","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","Styles","React","Key","ReactElement","ReactNode","Ref","useCallback","useMemo","useRef","useState","useFilter","useMenu","Section","useTreeState","useI18n","LoadingIcon","mergeProps","extractStyles","CollectionItem","Item","useMenuContext","CubeMenuProps","MenuItem","MenuSection","MenuTrigger","StyledDivider","StyledFooter","StyledHeader","StyledMenu","StyledCommandMenu","StyledEmptyState","StyledLoadingWrapper","StyledSearchInput","CommandMenuItem","id","textValue","keywords","forceMount","key","CubeCommandMenuProps","Omit","T","searchPlaceholder","searchValue","onSearchChange","value","filter","inputValue","emptyLabel","searchInputStyles","headerStyles","footerStyles","isLoading","shouldFilter","autoFocus","size","selectedKeys","defaultSelectedKeys","onSelectionChange","keys","CommandMenu","props","ref","HTMLDivElement","t","controlledSearchValue","customFilter","qa","styles","header","footer","restMenuProps","domRef","searchInputRef","HTMLInputElement","contextProps","ariaSelectedKeys","Set","undefined","ariaDefaultSelectedKeys","handleSelectionChange","allKeys","Array","from","treeState","collection","getKeys","map","String","completeProps","internalSearchValue","setInternalSearchValue","handleSearchChange","contains","sensitivity","textFilterFn","enhancedFilter","item","searchWords","trim","toLowerCase","split","word","length","searchableTexts","push","isArray","keyword","every","searchWord","some","text","includes","collectionFilter","nodes","Iterable","term","filterNodes","iter","result","node","type","filteredChildren","childNodes","rendered","treeStateProps","shouldUseVirtualFocus","collectionItems","hasSections","focusedKey","setFocusedKey","focusedKeyRef","filteredCollectionItems","items","forEach","hasFilteredItems","viewHasSections","findFirstSelectableItem","selectionManager","visit","childResult","isDisabled","menuRef","HTMLUListElement","menuProps","renderedItems","isFirstSection","sectionStyles","itemStyles","sectionHeadingStyles","menuItem","onAction","wrapper","cloneElement","useEffect","current","timeoutId","setTimeout","focus","clearTimeout","prevSearchValueRef","currentSearchValue","prevSearchValue","firstSelectableKey","extractedStyles","hasSearchTerm","showEmptyState","mods","popoverMod","popover","trayMod","tray","sections","Record","border","e","target","preventDefault","isArrowDown","currentKey","getVisibleItemKeys","findNextSelectableKey","currentIndex","direction","visibleKeys","increment","i","findFirstLastSelectableKey","keysToCheck","reverse","nextKey","indexOf","currentFocusedKey","selectionMode","select","getItem","onClose","closeOnSelect","boxShadow","radius","padding","_CommandMenu","forwardRef","RefAttributes","__CommandMenu","Object","assign","Trigger","displayName"],"sources":["../../../../src/components/actions/CommandMenu/CommandMenu.tsx"],"sourcesContent":["import { useObjectRef, useSyncRef } from '@react-aria/utils';\nimport { FocusStrategy } from '@react-types/shared';\nimport {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n Styles,\n} from '@tenphi/tasty';\nimport React, {\n Key,\n ReactElement,\n ReactNode,\n Ref,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFilter, useMenu } from 'react-aria';\nimport { Section, useTreeState } from 'react-stately';\n\nimport { useI18n } from '../../../i18n';\nimport { LoadingIcon } from '../../../icons/LoadingIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\n// `CollectionItem` (not react-stately's bare `Item`) is what CommandMenu\n// actually renders through `MenuItem`, so it carries the `Item` props.\nimport { CollectionItem as Item } from '../../CollectionItem';\nimport { useMenuContext } from '../Menu';\nimport { CubeMenuProps } from '../Menu/Menu';\nimport { MenuItem } from '../Menu/MenuItem';\nimport { MenuSection } from '../Menu/MenuSection';\nimport { MenuTrigger } from '../Menu/MenuTrigger';\nimport {\n StyledDivider,\n StyledFooter,\n StyledHeader,\n StyledMenu,\n} from '../Menu/styled';\n\nimport {\n StyledCommandMenu,\n StyledEmptyState,\n StyledLoadingWrapper,\n StyledSearchInput,\n} from './styled';\n\nexport interface CommandMenuItem {\n // Standard item props\n id: string;\n textValue: string;\n\n // Enhanced search features\n keywords?: string[];\n forceMount?: boolean;\n\n // Standard Menu item props inherited\n [key: string]: any;\n}\n\nexport interface CubeCommandMenuProps<T>\n extends BaseProps,\n ContainerStyleProps,\n Omit<\n CubeMenuProps<T>,\n 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange'\n > {\n // Search-specific props\n searchPlaceholder?: string;\n searchValue?: string;\n onSearchChange?: (value: string) => void;\n filter?: (textValue: string, inputValue: string) => boolean;\n emptyLabel?: ReactNode;\n searchInputStyles?: Styles;\n headerStyles?: Styles;\n footerStyles?: Styles;\n\n // Advanced search features\n isLoading?: boolean;\n shouldFilter?: boolean;\n\n // Focus management - override the autoFocus from CubeMenuProps to allow boolean | FocusStrategy\n autoFocus?: boolean | FocusStrategy;\n\n // Size prop\n size?: 'medium' | 'large' | (string & {});\n\n /** Currently selected keys (controlled) */\n selectedKeys?: string[];\n /** Initially selected keys (uncontrolled) */\n defaultSelectedKeys?: string[];\n /** Handler for selection changes */\n onSelectionChange?: (keys: string[]) => void;\n}\n\nfunction CommandMenu<T extends object>(\n props: CubeCommandMenuProps<T>,\n ref: Ref<HTMLDivElement>,\n) {\n const { t } = useI18n();\n\n const {\n searchPlaceholder = t(\n 'commandMenu.searchPlaceholder',\n 'Search commands...',\n ),\n searchValue: controlledSearchValue,\n onSearchChange,\n filter: customFilter,\n emptyLabel = t('commandMenu.empty', 'No commands found'),\n searchInputStyles,\n headerStyles,\n footerStyles,\n isLoading = false,\n shouldFilter = true,\n autoFocus = true,\n size = 'medium',\n qa,\n styles,\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n header,\n footer,\n ...restMenuProps\n } = props;\n\n const domRef = useObjectRef(ref);\n const searchInputRef = useRef<HTMLInputElement>(null);\n const contextProps = useMenuContext();\n\n // Convert string[] to Set<Key> for React Aria compatibility\n const ariaSelectedKeys = selectedKeys ? new Set(selectedKeys) : undefined;\n const ariaDefaultSelectedKeys = defaultSelectedKeys\n ? new Set(defaultSelectedKeys)\n : undefined;\n\n const handleSelectionChange = onSelectionChange\n ? (keys: 'all' | Set<Key>) => {\n if (keys === 'all') {\n // Handle 'all' selection case - collect all available keys\n const allKeys = Array.from(treeState.collection.getKeys()).map(\n (key: any) => String(key),\n );\n onSelectionChange(allKeys);\n } else if (keys instanceof Set) {\n onSelectionChange(Array.from(keys).map((key) => String(key)));\n } else {\n onSelectionChange([]);\n }\n }\n : undefined;\n\n const completeProps = mergeProps(contextProps, restMenuProps, {\n selectedKeys: ariaSelectedKeys,\n defaultSelectedKeys: ariaDefaultSelectedKeys,\n onSelectionChange: handleSelectionChange,\n });\n\n // Search state management\n const [internalSearchValue, setInternalSearchValue] = useState('');\n const searchValue = controlledSearchValue ?? internalSearchValue;\n\n const handleSearchChange = useCallback(\n (value: string) => {\n if (controlledSearchValue === undefined) {\n setInternalSearchValue(value);\n }\n onSearchChange?.(value);\n },\n [controlledSearchValue, onSearchChange],\n );\n\n // Filter setup\n const { contains } = useFilter({ sensitivity: 'base' });\n const textFilterFn = useMemo(\n () => customFilter || contains,\n [customFilter, contains],\n );\n\n // Enhanced filter function that supports keywords and forceMount\n const enhancedFilter = useCallback(\n (textValue: string, inputValue: string, item?: any) => {\n // Always show force-mounted items\n if (item?.forceMount) {\n return true;\n }\n\n // If shouldFilter is false, show all items\n if (!shouldFilter) {\n return true;\n }\n\n // Split input value into individual words and filter out empty strings\n const searchWords = inputValue\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no search words, show all items\n if (searchWords.length === 0) {\n return true;\n }\n\n // Collect all searchable text for this item\n const searchableTexts: string[] = [];\n\n // Add main text value\n searchableTexts.push(textValue.toLowerCase());\n\n // Add keywords if available\n if (item?.keywords && Array.isArray(item.keywords)) {\n searchableTexts.push(\n ...item.keywords.map((keyword: string) => keyword.toLowerCase()),\n );\n }\n\n // Check if ALL search words match at least one of the searchable texts\n return searchWords.every((searchWord) =>\n searchableTexts.some((text) => text.includes(searchWord)),\n );\n },\n [shouldFilter],\n );\n\n // Collection filter for React Stately\n const collectionFilter = useCallback(\n (nodes: Iterable<any>): Iterable<any> => {\n const term = searchValue.trim();\n\n // If no search term, return all nodes\n if (!term) {\n return nodes;\n }\n\n // Split search term into words for multi-word filtering\n const searchWords = term\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no valid search words, return all nodes\n if (searchWords.length === 0) {\n return nodes;\n }\n\n // Recursive helper to filter sections and items\n const filterNodes = (iter: Iterable<any>): any[] => {\n const result: any[] = [];\n\n for (const node of iter) {\n if (node.type === 'section') {\n const filteredChildren = filterNodes(node.childNodes);\n\n if (filteredChildren.length) {\n result.push({\n ...node,\n childNodes: filteredChildren,\n });\n }\n } else {\n const text = node.textValue ?? String(node.rendered ?? '');\n\n if (enhancedFilter(text, term, node.props)) {\n result.push(node);\n }\n }\n }\n\n return result;\n };\n\n return filterNodes(nodes);\n },\n [searchValue, enhancedFilter],\n );\n\n // Create tree state with filter for both keyboard navigation and rendering\n const treeStateProps = {\n ...completeProps,\n filter: collectionFilter,\n shouldUseVirtualFocus: true, // Always use virtual focus for CommandMenu\n };\n\n const treeState = useTreeState(treeStateProps);\n\n const collectionItems = [...treeState.collection];\n const hasSections = collectionItems.some((item) => item.type === 'section');\n\n // Track focused key for aria-activedescendant\n const [focusedKey, setFocusedKey] = React.useState<React.Key | null>(null);\n const focusedKeyRef = useRef<React.Key | null>(null);\n\n // Apply filtering to collection items for rendering and empty state checks\n const filteredCollectionItems = useMemo(() => {\n const term = searchValue.trim();\n if (!term) {\n return collectionItems;\n }\n\n // Split search term into words for multi-word filtering\n const searchWords = term\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0);\n\n // If no valid search words, return all items\n if (searchWords.length === 0) {\n return collectionItems;\n }\n\n const filterNodes = (items: any[]): any[] => {\n const result: any[] = [];\n\n [...items].forEach((item) => {\n if (item.type === 'section') {\n const filteredChildren = filterNodes(item.childNodes);\n if (filteredChildren.length) {\n result.push({\n ...item,\n childNodes: filteredChildren,\n });\n }\n } else {\n const text = item.textValue ?? String(item.rendered ?? '');\n if (enhancedFilter(text, term, item.props)) {\n result.push(item);\n }\n }\n });\n\n return result;\n };\n\n return filterNodes(collectionItems);\n }, [collectionItems, searchValue, enhancedFilter]);\n\n const hasFilteredItems = filteredCollectionItems.length > 0;\n const viewHasSections = filteredCollectionItems.some(\n (item) => item.type === 'section',\n );\n\n // Helper function to find the first selectable item from filtered results\n const findFirstSelectableItem = useCallback(() => {\n const { selectionManager } = treeState;\n\n const visit = (items: any[]): Key | null => {\n for (const node of items) {\n if (node?.type === 'section') {\n const childResult = visit(Array.from(node.childNodes ?? []));\n if (childResult != null) return childResult;\n } else if (\n node?.type === 'item' &&\n !selectionManager.isDisabled(node.key)\n ) {\n return node.key;\n }\n }\n return null;\n };\n\n return visit(filteredCollectionItems);\n }, [filteredCollectionItems, treeState.selectionManager]);\n\n // Create a ref for the menu container\n const menuRef = useRef<HTMLUListElement>(null);\n\n // Use menu hook for accessibility\n const { menuProps } = useMenu(\n {\n ...completeProps,\n 'aria-label': 'Command palette menu',\n filter: collectionFilter,\n shouldUseVirtualFocus: true,\n },\n treeState,\n menuRef,\n );\n\n // Manual rendering of menu items (similar to Menu component)\n const renderedItems = useMemo(() => {\n const items: React.ReactNode[] = [];\n let isFirstSection = true;\n\n filteredCollectionItems.forEach((item) => {\n if (item.type === 'section') {\n if (!isFirstSection) {\n items.push(\n <StyledDivider\n key={`divider-${String(item.key)}`}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n />,\n );\n }\n\n items.push(\n <MenuSection\n key={item.key}\n item={item}\n state={treeState}\n styles={completeProps.sectionStyles}\n itemStyles={completeProps.itemStyles}\n headingStyles={completeProps.sectionHeadingStyles}\n size={size}\n />,\n );\n\n isFirstSection = false;\n return;\n }\n\n let menuItem = (\n <MenuItem\n key={item.key}\n item={item}\n state={treeState}\n styles={completeProps.itemStyles}\n size={size}\n onAction={item.onAction}\n />\n );\n\n // Apply custom wrapper if provided\n if (item.props.wrapper) {\n menuItem = item.props.wrapper(menuItem);\n }\n\n // Ensure every child has a stable key, even if the wrapper component didn't set one.\n items.push(React.cloneElement(menuItem, { key: item.key }));\n });\n\n return items;\n }, [\n filteredCollectionItems,\n treeState,\n completeProps.sectionStyles,\n completeProps.itemStyles,\n\n completeProps.sectionHeadingStyles,\n ]);\n\n // Auto-focus search input\n React.useEffect(() => {\n if (autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the element is visible and focusable\n // This is especially important when the CommandMenu is opened in a popover\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus]);\n\n // Also focus when the component becomes visible (for trigger/popover usage)\n React.useEffect(() => {\n // Check if autoFocus is enabled and we're in a trigger context\n if (autoFocus && contextProps.autoFocus && searchInputRef.current) {\n // Use a small timeout to ensure the popover is fully rendered\n const timeoutId = setTimeout(() => {\n if (searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, 50); // Slightly longer timeout for popover context\n\n return () => clearTimeout(timeoutId);\n }\n }, [autoFocus, contextProps.autoFocus]);\n\n // Track the previous search value to only run auto-focus when search actually changes\n const prevSearchValueRef = useRef<string>('');\n\n // Auto-focus first item when search value changes (but not on initial render)\n React.useEffect(() => {\n const currentSearchValue = searchValue.trim();\n const prevSearchValue = prevSearchValueRef.current;\n\n // Only auto-focus when search value actually changes\n if (currentSearchValue !== prevSearchValue && currentSearchValue !== '') {\n const firstSelectableKey = findFirstSelectableItem();\n\n if (firstSelectableKey && hasFilteredItems) {\n // Focus the first item in the selection manager\n treeState.selectionManager.setFocusedKey(firstSelectableKey);\n setFocusedKey(firstSelectableKey);\n focusedKeyRef.current = firstSelectableKey;\n } else {\n // Clear focus if no items are available\n treeState.selectionManager.setFocusedKey(null);\n setFocusedKey(null);\n focusedKeyRef.current = null;\n }\n }\n\n // Update the previous search value\n prevSearchValueRef.current = currentSearchValue;\n }, [searchValue, findFirstSelectableItem, hasFilteredItems]);\n\n // Extract styles\n const extractedStyles = useMemo(\n () => extractStyles(props, CONTAINER_STYLES),\n [props],\n );\n\n // Determine if we should show empty state based on actual filtered collection\n const hasSearchTerm = searchValue.trim().length > 0;\n const showEmptyState = hasSearchTerm && !hasFilteredItems && !isLoading;\n\n // Sync refs\n useSyncRef(contextProps, menuRef);\n\n const mods = useMemo(() => {\n // Determine mods based on menu context\n let popoverMod = completeProps.mods?.popover;\n let trayMod = completeProps.mods?.tray;\n\n return {\n sections: viewHasSections,\n footer: !!footer,\n header: !!header,\n popover: popoverMod,\n tray: trayMod,\n };\n }, [viewHasSections, footer, header, completeProps.mods]);\n\n return (\n <StyledCommandMenu\n {...(filterBaseProps(props) as Record<string, unknown>)}\n ref={domRef}\n qa={qa || 'CommandMenu'}\n data-size={size}\n mods={mods}\n styles={mergeProps(extractedStyles, styles)}\n >\n {/* Header */}\n {header && (\n <StyledHeader\n role=\"presentation\"\n data-size={size}\n styles={{ border: 'none', ...headerStyles }}\n >\n {header}\n </StyledHeader>\n )}\n\n {/* Search Input */}\n <StyledSearchInput\n ref={searchInputRef}\n type=\"search\"\n placeholder={searchPlaceholder}\n value={searchValue}\n styles={searchInputStyles}\n data-size={size}\n aria-controls={`${qa || 'CommandMenu'}-menu`}\n role=\"combobox\"\n aria-expanded=\"true\"\n aria-haspopup=\"listbox\"\n aria-activedescendant={\n focusedKey != null\n ? `${qa || 'CommandMenu'}-menu-option-${focusedKey}`\n : undefined\n }\n onChange={(e) => handleSearchChange(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n\n const isArrowDown = e.key === 'ArrowDown';\n const { selectionManager } = treeState;\n // Use the ref to get the current focused key synchronously\n const currentKey =\n focusedKeyRef.current || selectionManager.focusedKey;\n\n // Helper function to get all visible item keys accounting for sections\n const getVisibleItemKeys = (): Key[] => {\n const keys: Key[] = [];\n\n const visit = (items: any[]) => {\n for (const node of items) {\n if (node?.type === 'section') {\n visit(Array.from(node.childNodes ?? []));\n } else if (node?.type === 'item') {\n keys.push(node.key);\n }\n }\n };\n\n visit(filteredCollectionItems);\n return keys;\n };\n\n // Helper function to find next selectable key in a direction\n const findNextSelectableKey = (\n currentIndex: number,\n direction: 'forward' | 'backward',\n visibleKeys: Key[],\n ) => {\n const increment = direction === 'forward' ? 1 : -1;\n\n for (\n let i = currentIndex + increment;\n i >= 0 && i < visibleKeys.length;\n i += increment\n ) {\n const key = visibleKeys[i];\n if (!selectionManager.isDisabled(key)) {\n return key;\n }\n }\n\n return null;\n };\n\n // Helper function to find first or last selectable key\n const findFirstLastSelectableKey = (\n direction: 'forward' | 'backward',\n visibleKeys: Key[],\n ) => {\n const keysToCheck =\n direction === 'forward'\n ? visibleKeys\n : [...visibleKeys].reverse();\n\n for (const key of keysToCheck) {\n if (!selectionManager.isDisabled(key)) {\n return key;\n }\n }\n\n return null;\n };\n\n const visibleKeys = getVisibleItemKeys();\n\n if (visibleKeys.length === 0) {\n return; // No visible items to navigate\n }\n\n let nextKey;\n const direction = isArrowDown ? 'forward' : 'backward';\n\n if (currentKey == null) {\n // No current focus, start from the first/last item\n nextKey = findFirstLastSelectableKey(direction, visibleKeys);\n } else {\n // Find current position in visible keys\n const currentIndex = visibleKeys.indexOf(currentKey);\n\n if (currentIndex === -1) {\n // Current key not in visible items, start from beginning/end\n nextKey = findFirstLastSelectableKey(direction, visibleKeys);\n } else {\n // Find next selectable item from current position\n nextKey = findNextSelectableKey(\n currentIndex,\n direction,\n visibleKeys,\n );\n\n // If no next key found, wrap to first/last selectable item\n if (nextKey == null) {\n nextKey = findFirstLastSelectableKey(direction, visibleKeys);\n }\n }\n }\n\n if (nextKey != null) {\n selectionManager.setFocusedKey(nextKey);\n setFocusedKey(nextKey);\n focusedKeyRef.current = nextKey; // Update ref immediately\n }\n } else if (\n e.key === 'Enter' ||\n (e.key === ' ' && !searchValue.trim())\n ) {\n const currentFocusedKey =\n focusedKey || treeState.selectionManager.focusedKey;\n if (currentFocusedKey != null) {\n e.preventDefault();\n\n // Trigger action for the focused item (like Menu does)\n // First check if there's a selection mode, if so, handle selection\n if (treeState.selectionManager.selectionMode !== 'none') {\n treeState.selectionManager.select(currentFocusedKey, e);\n } else {\n // Default behavior: trigger action\n const node = treeState.collection.getItem(currentFocusedKey);\n if (node) {\n // Call the tree state's action handler\n const onAction = (completeProps as any).onAction;\n if (onAction) {\n onAction(currentFocusedKey);\n }\n // Also call the item's individual onAction if it exists\n if (node.props?.onAction) {\n node.props.onAction(currentFocusedKey);\n }\n }\n }\n\n // Close the menu if we're in a trigger context and closeOnSelect is enabled (default behavior)\n const { onClose, closeOnSelect } = contextProps;\n if (onClose && closeOnSelect !== false) {\n onClose();\n }\n }\n } else if (e.key === 'Escape') {\n if (searchValue) {\n e.preventDefault();\n handleSearchChange('');\n }\n }\n }}\n />\n\n {/* Loading State */}\n {isLoading && (\n <StyledLoadingWrapper>\n <LoadingIcon\n role=\"progressbar\"\n aria-label=\"Loading commands\"\n aria-hidden={false}\n />\n </StyledLoadingWrapper>\n )}\n\n {/* Menu Content - always render unless loading */}\n {!isLoading && !showEmptyState && (\n <StyledMenu\n {...menuProps}\n ref={menuRef}\n id={`${qa || 'CommandMenu'}-menu`}\n aria-label=\"Command menu\"\n qa=\"Menu\"\n data-size={size}\n mods={mods}\n styles={{\n border: 'none',\n boxShadow: 'none',\n radius: 0,\n padding: '0.5x',\n }}\n >\n {renderedItems}\n </StyledMenu>\n )}\n\n {/* Empty State - show when search term exists but no results */}\n {!isLoading && showEmptyState && (\n <StyledEmptyState>{emptyLabel}</StyledEmptyState>\n )}\n\n {/* Footer */}\n {footer && (\n <StyledFooter\n role=\"presentation\"\n data-size={size}\n styles={footerStyles}\n >\n {footer}\n </StyledFooter>\n )}\n </StyledCommandMenu>\n );\n}\n\n// forwardRef doesn't support generic parameters, so cast the result to the correct type\nconst _CommandMenu = React.forwardRef(CommandMenu) as <T>(\n props: CubeCommandMenuProps<T> & React.RefAttributes<HTMLDivElement>,\n) => ReactElement;\n\n// Attach Trigger alias from MenuTrigger for consistent API\n// Also attach Item and Section for compound component pattern\nconst __CommandMenu = Object.assign(_CommandMenu, {\n Trigger: MenuTrigger,\n Item,\n Section,\n displayName: 'CommandMenu',\n});\n\nexport { __CommandMenu as CommandMenu };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgGA,SAASmE,YACPC,OACAC,KACA;CACA,MAAM,EAAEE,MAAMlD,SAAS;CAEvB,MAAM,EACJ4B,oBAAoBsB,EAClB,iCACA,qBACD,EACDrB,aAAasB,uBACbrB,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OAC/C7G,WAAUsD,iBAAiBwD,OAAOF,mBAAmBjB,IAAE;YAClD;QAEL,MAAMvD,SAAOpC,UAAUC,WAAW8G,QAAQH,kBAAkB;AAC5D,YAAIxE,QAAM;SAER,MAAM+B,WAAY9D,cAAsB8D;AACxC,aAAIA,SACFA,UAASyC,kBAAkB;AAG7B,aAAIxE,OAAK3D,OAAO0F,SACd/B,QAAK3D,MAAM0F,SAASyC,kBAAkB;;;OAM5C,MAAM,EAAEI,SAASC,kBAAkB1H;AACnC,WAAIyH,WAAWC,kBAAkB,MAC/BD,UAAS;;gBAGJrB,IAAEzI,QAAQ,UACnB;UAAIK,aAAa;AACfoI,WAAEE,gBAAgB;AAClBrF,0BAAmB,GAAG;;;;KAG1B;GAIHxC,aACC,oBAAC,kCACC,oBAAC;IACC,MAAK;IACL,cAAW;IACX,eAAa;KAAM,GAGxB;GAGA,CAACA,aAAa,CAACkH,kBACd,oBAAC;IACC,GAAItB;IACJ,KAAKF;IACL,IAAI,GAAG3E,MAAM,cAAa;IAC1B,cAAW;IACX,IAAG;IACH,aAAWZ;IACLgH;IACN,QAAQ;KACNO,QAAQ;KACRwB,WAAW;KACXC,QAAQ;KACRC,SAAS;KACV;cAEAvD;KAEJ;GAGA,CAAC7F,aAAakH,kBACb,oBAAC,8BAAkBtH,aACpB;GAGAsB,UACC,oBAAC;IACC,MAAK;IACL,aAAWf;IACX,QAAQJ;cAEPmB;KAEJ;;GACiB;;AAKxB,MAAMmI,eAAexM,MAAMyM,WAAW9I,YAAY;AAMlD,MAAMgJ,gBAAgBC,OAAOC,OAAOL,cAAc;CAChDM,SAASvL;CACTL;CACAP;CACAoM,aAAa;CACd,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
4
4
|
import { CURRENT_CLEAR_STYLES, CURRENT_OUTLINE_STYLES, CURRENT_PRIMARY_STYLES, DANGER_CLEAR_STYLES, DANGER_OUTLINE_STYLES, DANGER_PRIMARY_STYLES, DEFAULT_CLEAR_STYLES, DEFAULT_OUTLINE_STYLES, DEFAULT_PRIMARY_STYLES, ITEM_ACTION_BASE_STYLES, NOTE_CLEAR_STYLES, NOTE_OUTLINE_STYLES, NOTE_PRIMARY_STYLES, SPECIAL_CLEAR_STYLES, SPECIAL_OUTLINE_STYLES, SPECIAL_PRIMARY_STYLES, SUCCESS_CLEAR_STYLES, SUCCESS_OUTLINE_STYLES, SUCCESS_PRIMARY_STYLES, WARNING_CLEAR_STYLES, WARNING_OUTLINE_STYLES, WARNING_PRIMARY_STYLES } from "../../../data/item-themes.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { DisplayTransition } from "../helpers/DisplayTransition/DisplayTransition.js";
|
|
3
3
|
import { ITEM_RESTING_COLOR_VARIANTS, ROW_STATE_ALIASES, resolveItemVariant } from "../../data/item-themes.js";
|
|
4
4
|
import { ItemActionProvider } from "./ItemActionContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useDismissParentPopover } from "../../../utils/react/usePopoverSync.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.184.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { _CollectionItem } from "../../CollectionItem.js";
|