@cube-dev/ui-kit 0.0.0-canary-ac46c4b → 0.0.0-canary-9bde021
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/_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 +1 -2
- 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.js +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.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.d.ts +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- 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.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.d.ts +2 -2
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- 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 +2 -2
- package/dist/components/fields/Picker/Picker.js +1 -1
- 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 +3 -2
- package/dist/components/fields/Select/Select.js +5 -2
- 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 +5 -20
- 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 +9 -18
- 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 +5 -6
- 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 +64 -71
- 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-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.js +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/fields/Checkbox.md +11 -0
- package/docs/components/fields/ColorPicker.md +1 -1
- package/docs/components/fields/FilterPicker.md +1 -1
- package/docs/components/fields/Picker.md +1 -1
- package/docs/components/fields/RadioGroup.md +2 -2
- package/docs/components/fields/Select.md +3 -0
- package/docs/components/form/Field.md +2 -2
- package/docs/components/form/Form.md +0 -2
- package/docs/components/navigation/Tabs.md +3 -3
- package/docs/components/overlays/Dialog.md +3 -30
- package/docs/components/overlays/DialogForm.md +0 -1
- package/package.json +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +0 -68
- package/dist/components/overlays/Dialog/use-content-overflow.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { filterCollectionItemProps } from "../../CollectionItem.js";
|
|
4
4
|
import { _Item } from "../../content/Item/Item.js";
|
|
@@ -67,6 +67,18 @@ function MenuItem(props) {
|
|
|
67
67
|
} else t6 = $[15];
|
|
68
68
|
const { menuItemProps, labelProps, descriptionProps, keyboardShortcutProps, isFocused, isSelected, isPressed, isDisabled } = useMenuItem(t6, state, elementRef);
|
|
69
69
|
const isVirtualFocused = state.selectionManager.focusedKey === key;
|
|
70
|
+
const { onKeyDown: itemOnKeyDown, ...itemOwnProps } = menuItemProps;
|
|
71
|
+
let t7;
|
|
72
|
+
if ($[16] !== itemOnKeyDown || $[17] !== submenuContext) {
|
|
73
|
+
t7 = submenuContext?.onKeyDown ? (e) => {
|
|
74
|
+
submenuContext.onKeyDown?.(e);
|
|
75
|
+
if (!e.defaultPrevented) itemOnKeyDown?.(e);
|
|
76
|
+
} : itemOnKeyDown;
|
|
77
|
+
$[16] = itemOnKeyDown;
|
|
78
|
+
$[17] = submenuContext;
|
|
79
|
+
$[18] = t7;
|
|
80
|
+
} else t7 = $[18];
|
|
81
|
+
const onKeyDown = t7;
|
|
70
82
|
const mods = {
|
|
71
83
|
...itemMods,
|
|
72
84
|
focused: isFocused || isVirtualFocused,
|
|
@@ -78,17 +90,10 @@ function MenuItem(props) {
|
|
|
78
90
|
};
|
|
79
91
|
const T0 = FocusRing;
|
|
80
92
|
const T1 = _Item;
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (!e.defaultPrevented && menuItemProps.onKeyDown) menuItemProps.onKeyDown(e);
|
|
86
|
-
} : menuItemProps.onKeyDown;
|
|
87
|
-
$[16] = menuItemProps;
|
|
88
|
-
$[17] = submenuContext;
|
|
89
|
-
$[18] = t7;
|
|
90
|
-
} else t7 = $[18];
|
|
91
|
-
const t8 = mergeProps$1(menuItemProps, filteredItemProps, {
|
|
93
|
+
const t8 = mergeProps$1({
|
|
94
|
+
...itemOwnProps,
|
|
95
|
+
onKeyDown
|
|
96
|
+
}, filteredItemProps, {
|
|
92
97
|
"data-popover-trigger": true,
|
|
93
98
|
qa: itemQa ? itemQa : `MenuItem-${key}`,
|
|
94
99
|
mods,
|
|
@@ -101,9 +106,8 @@ function MenuItem(props) {
|
|
|
101
106
|
"aria-haspopup": submenuContext ? "menu" : void 0,
|
|
102
107
|
"aria-expanded": submenuContext?.isOpen,
|
|
103
108
|
"data-has-submenu": submenuContext ? true : void 0,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
onMouseLeave: submenuContext?.onMouseLeave || menuItemProps.onMouseLeave
|
|
109
|
+
onMouseEnter: submenuContext?.onMouseEnter,
|
|
110
|
+
onMouseLeave: submenuContext?.onMouseLeave
|
|
107
111
|
});
|
|
108
112
|
let t9;
|
|
109
113
|
if ($[19] !== filteredItemProps || $[20] !== submenuContext) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","names":["Key","Node","Styles","KeyboardEvent","useContext","useRef","FocusRing","useMenuItem","TreeState","RightIcon","mergeProps","filterCollectionItemProps","Item","useMenuContext","SubmenuTriggerContext","MenuSelectionType","MenuItemProps","item","T","state","styles","isVirtualized","isDisabled","onAction","key","size","MenuItem","props","$","_c","onClose","closeOnSelect","rendered","itemProps","submenuContext","filteredItemProps","mods","itemMods","qa","itemQa","isSelectable","selectionManager","selectionMode","t0","disabledKeys","has","isDisabledKey","ref","elementRef","triggerRef","t1","isSelected","t2","t3","undefined","t4","t5","t6","menuItemProps","labelProps","descriptionProps","keyboardShortcutProps","isFocused","isPressed","isVirtualFocused","focusedKey","
|
|
1
|
+
{"version":3,"file":"MenuItem.js","names":["Key","Node","Styles","KeyboardEvent","useContext","useRef","FocusRing","useMenuItem","TreeState","RightIcon","mergeProps","filterCollectionItemProps","Item","useMenuContext","SubmenuTriggerContext","MenuSelectionType","MenuItemProps","item","T","state","styles","isVirtualized","isDisabled","onAction","key","size","MenuItem","props","$","_c","onClose","closeOnSelect","rendered","itemProps","submenuContext","filteredItemProps","mods","itemMods","qa","itemQa","isSelectable","selectionManager","selectionMode","t0","disabledKeys","has","isDisabledKey","ref","elementRef","triggerRef","t1","isSelected","t2","t3","undefined","t4","t5","t6","menuItemProps","labelProps","descriptionProps","keyboardShortcutProps","isFocused","isPressed","isVirtualFocused","focusedKey","onKeyDown","itemOnKeyDown","itemOwnProps","t7","e","defaultPrevented","focused","pressed","selected","disabled","submenu","menuitem","T0","T1","t8","as","isOpen","onMouseEnter","onMouseLeave","t9","rightIcon","t10","t11","t12","t13"],"sources":["../../../../src/components/actions/Menu/MenuItem.tsx"],"sourcesContent":["import { Key, Node } from '@react-types/shared';\nimport { Styles } from '@tenphi/tasty';\nimport { KeyboardEvent, useContext, useRef } from 'react';\nimport { FocusRing, useMenuItem } from 'react-aria';\nimport { TreeState } from 'react-stately';\n\nimport { RightIcon } from '../../../icons/RightIcon';\nimport { mergeProps } from '../../../utils/react';\nimport { filterCollectionItemProps } from '../../CollectionItem';\nimport { Item } from '../../content/Item/Item';\n\nimport { useMenuContext } from './context';\nimport { SubmenuTriggerContext } from './SubmenuTriggerContext';\n\nexport type MenuSelectionType = 'checkbox' | 'radio' | 'checkmark';\n\nexport interface MenuItemProps<T> {\n item: Node<T>;\n state: TreeState<T>;\n styles?: Styles;\n isVirtualized?: boolean;\n isDisabled?: boolean;\n onAction?: (key: Key) => void;\n size?: 'small' | 'medium' | (string & {});\n}\n\n/** @private */\nexport function MenuItem<T>(props: MenuItemProps<T>) {\n const { item, state, styles, isVirtualized, onAction, size } = props;\n const { onClose, closeOnSelect } = useMenuContext();\n const { rendered, key, props: itemProps } = item;\n\n // Check if this item is wrapped in a SubmenuTriggerContext\n const submenuContext = useContext(SubmenuTriggerContext);\n\n // Filter out service props (react-stately and parent-handled props)\n // All remaining props are safe to pass to Item component\n const filteredItemProps = filterCollectionItemProps(itemProps);\n\n // Extract specific props that need special handling\n const { hotkeys, mods: itemMods, qa: itemQa } = filteredItemProps;\n\n const isSelectable = state.selectionManager.selectionMode !== 'none';\n const isDisabledKey =\n state.disabledKeys.has(key) || submenuContext?.isDisabled;\n\n const ref = useRef<HTMLLIElement>(null);\n\n // Use the triggerRef from submenu context if present\n const elementRef = (submenuContext?.triggerRef ?? ref) as any;\n\n const {\n menuItemProps,\n labelProps,\n descriptionProps,\n keyboardShortcutProps,\n isFocused,\n isSelected,\n isPressed,\n isDisabled,\n } = useMenuItem(\n {\n isSelected: state.selectionManager.isSelected(key),\n isDisabled: isDisabledKey,\n 'aria-label': item['aria-label'],\n key,\n onClose: submenuContext ? undefined : onClose, // Don't close menu for submenu triggers\n closeOnSelect: submenuContext ? false : closeOnSelect, // Don't close on submenu trigger selection\n isVirtualized,\n onAction: submenuContext?.onAction || onAction,\n },\n state,\n elementRef,\n );\n\n // Selection indicator will be handled by Item component\n const isVirtualFocused = state.selectionManager.focusedKey === key;\n\n // `mergeProps` chains handlers rather than replacing them, so a handler of\n // the item's own passed to it again runs twice. `onKeyDown` used to be: Enter\n // and Space each click the item, so every keyboard activation fired\n // `onAction` twice. It is taken out here and passed once.\n const { onKeyDown: itemOnKeyDown, ...itemOwnProps } = menuItemProps;\n const onKeyDown = submenuContext?.onKeyDown\n ? (e: KeyboardEvent) => {\n // The submenu goes first; a key it handles is not the item's too.\n submenuContext.onKeyDown?.(e);\n if (!e.defaultPrevented) itemOnKeyDown?.(e);\n }\n : itemOnKeyDown;\n\n const mods = {\n ...itemMods,\n focused: isFocused || isVirtualFocused,\n pressed: isPressed,\n selected: isSelected,\n disabled: isDisabled,\n submenu: !!submenuContext,\n menuitem: true,\n };\n\n return (\n <FocusRing>\n <Item\n {...mergeProps({ ...itemOwnProps, onKeyDown }, filteredItemProps, {\n 'data-popover-trigger': true,\n qa: itemQa ? itemQa : `MenuItem-${key}`,\n mods,\n styles,\n 'data-size': size,\n as: 'li',\n labelProps,\n descriptionProps,\n keyboardShortcutProps,\n 'aria-haspopup': submenuContext ? 'menu' : undefined,\n 'aria-expanded': submenuContext?.isOpen,\n 'data-has-submenu': submenuContext ? true : undefined,\n // Chained after the item's own hover handlers.\n onMouseEnter: submenuContext?.onMouseEnter,\n onMouseLeave: submenuContext?.onMouseLeave,\n })}\n ref={elementRef}\n disableActionsFocus={true}\n rightIcon={submenuContext ? <RightIcon /> : filteredItemProps.rightIcon}\n defaultTooltipPlacement=\"right\"\n isSelected={isSelectable ? isSelected : undefined}\n isDisabled={isDisabled}\n size={size === 'small' ? 'small' : 'medium'}\n >\n {rendered}\n </Item>\n </FocusRing>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA2BA,SAAO0B,SAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAC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4BU;AAAA7D,IAAA,MAAAkD;AAAAlD,IAAA,MAAA6D;AAAA7D,IAAA,MAAA8D;OAAAA,OAAA9D,EAAA;AAAA,QA7BZ8D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
2
|
-
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
3
2
|
import { MenuItem } from "./MenuItem.js";
|
|
4
3
|
import { StyledMenu, StyledSection, StyledSectionHeading } from "./styled.js";
|
|
5
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -59,12 +58,6 @@ function MenuSection(props) {
|
|
|
59
58
|
size,
|
|
60
59
|
onAction: node.onAction
|
|
61
60
|
}, node.key);
|
|
62
|
-
if (node.props.tooltip) menuItem = /* @__PURE__ */ jsx(TooltipProvider, {
|
|
63
|
-
activeWrap: true,
|
|
64
|
-
placement: "right",
|
|
65
|
-
...typeof node.props.tooltip === "string" ? { title: node.props.tooltip } : node.props.tooltip,
|
|
66
|
-
children: menuItem
|
|
67
|
-
}, node.key);
|
|
68
61
|
if (node.props.wrapper) menuItem = node.props.wrapper(menuItem);
|
|
69
62
|
return menuItem;
|
|
70
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSection.js","names":["Styles","useMenuSection","
|
|
1
|
+
{"version":3,"file":"MenuSection.js","names":["Styles","useMenuSection","MenuItem","MenuItemProps","StyledMenu","StyledSection","StyledSectionHeading","CubeMenuSectionProps","T","itemStyles","headingStyles","size","MenuSection","props","$","_c","item","state","styles","heading","rendered","t0","t1","itemProps","headingProps","groupProps","t2","t3","Symbol","for","section","t4","childNodes","t5","map","node","menuItem","key","onAction","wrapper","t6","t7"],"sources":["../../../../src/components/actions/Menu/MenuSection.tsx"],"sourcesContent":["import { Styles } from '@tenphi/tasty';\nimport { useMenuSection } from 'react-aria';\n\nimport { MenuItem, MenuItemProps } from './MenuItem';\nimport { StyledMenu, StyledSection, StyledSectionHeading } from './styled';\n\nexport interface CubeMenuSectionProps<T> extends MenuItemProps<T> {\n itemStyles?: Styles;\n headingStyles?: Styles;\n size?: 'small' | 'medium' | (string & {});\n}\n\n/** @private */\nexport function MenuSection<T>(props: CubeMenuSectionProps<T>) {\n const { item, state, styles, itemStyles, headingStyles, size } = props;\n const heading = item.rendered;\n const { itemProps, headingProps, groupProps } = useMenuSection({\n heading,\n 'aria-label': item['aria-label'],\n });\n\n return (\n <>\n <StyledSection {...itemProps} styles={styles}>\n {heading && (\n <StyledSectionHeading\n {...headingProps}\n size={size}\n styles={headingStyles}\n >\n {heading}\n </StyledSectionHeading>\n )}\n <StyledMenu {...groupProps} mods={{ section: true }}>\n {[...item.childNodes].map((node) => {\n let menuItem = (\n <MenuItem\n key={node.key}\n item={node}\n styles={itemStyles}\n state={state}\n size={size}\n onAction={(node as unknown as MenuItemProps<T>).onAction}\n />\n );\n\n // `MenuItem` renders the item's `tooltip` itself, as `Menu` does\n // for items outside a section.\n if (node.props.wrapper) {\n menuItem = node.props.wrapper(menuItem);\n }\n\n return menuItem;\n })}\n </StyledMenu>\n </StyledSection>\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAaA,SAAOY,YAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CACL,MAAA,EAAAC,MAAAC,OAAAC,QAAAT,YAAAC,eAAAC,SAAiEE;CACjE,MAAAM,UAAgBH,KAAII;CAGJ,MAAAC,KAAAL,KAAK;CAAa,IAAAM;AAAA,KAAAR,EAAA,OAAAK,WAAAL,EAAA,OAAAO,IAAA;AAF6BC,OAAA;GAAAH;GAAA,cAE/CE;GACf;AAAAP,IAAA,KAAAK;AAAAL,IAAA,KAAAO;AAAAP,IAAA,KAAAQ;OAAAA,MAAAR,EAAA;CAHD,MAAA,EAAAS,WAAAC,cAAAC,eAAgDxB,eAAeqB,GAG7D;CAAC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IAAA,MAAAW;AAAAX,IAAA,MAAAmB;AAAAnB,IAAA,MAAA0B;OAAAA,MAAA1B,EAAA;CAAA,IAAA2B;AAAA,KAAA3B,EAAA,QAAAS,aAAAT,EAAA,QAAAI,UAAAJ,EAAA,QAAAY,MAAAZ,EAAA,QAAA0B,IAAA;AAhCjBC,OAAA,0CACE,qBAAC;GAAa,GAAKlB;GAAmBL;cACnCQ,IASDc;IAsBc,GACf;AAAA1B,IAAA,MAAAS;AAAAT,IAAA,MAAAI;AAAAJ,IAAA,MAAAY;AAAAZ,IAAA,MAAA0B;AAAA1B,IAAA,MAAA2B;OAAAA,MAAA3B,EAAA;AAAA,QAlCH2B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { SlotProvider } from "../../../utils/react/Slots.js";
|
|
3
3
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
|
|
4
4
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { MenuContext, useMenuContext } from "./context.js";
|
|
@@ -95,7 +95,6 @@ function InternalSubMenuTrigger(props) {
|
|
|
95
95
|
e.stopPropagation();
|
|
96
96
|
e.nativeEvent.stopImmediatePropagation();
|
|
97
97
|
state.open();
|
|
98
|
-
suppressNextActionRef.current = true;
|
|
99
98
|
} else if (e.key === "ArrowLeft" && state.isOpen) {
|
|
100
99
|
e.preventDefault();
|
|
101
100
|
e.stopPropagation();
|
|
@@ -106,7 +105,6 @@ function InternalSubMenuTrigger(props) {
|
|
|
106
105
|
const hoverCloseTimerRef = useRef(null);
|
|
107
106
|
const isHoveringRef = useRef(false);
|
|
108
107
|
const isHoveringSubmenuRef = useRef(false);
|
|
109
|
-
const suppressNextActionRef = useRef(false);
|
|
110
108
|
const checkShouldClose = () => {
|
|
111
109
|
if (!isHoveringRef.current && !isHoveringSubmenuRef.current) hoverCloseTimerRef.current = setTimeout(() => {
|
|
112
110
|
if (!isHoveringRef.current && !isHoveringSubmenuRef.current) state.close();
|
|
@@ -164,10 +162,6 @@ function InternalSubMenuTrigger(props) {
|
|
|
164
162
|
onMouseLeave: handleMouseLeave,
|
|
165
163
|
onKeyDown: handleKeyDown,
|
|
166
164
|
onAction: isDisabled ? void 0 : () => {
|
|
167
|
-
if (suppressNextActionRef.current) {
|
|
168
|
-
suppressNextActionRef.current = false;
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
165
|
state.open();
|
|
172
166
|
}
|
|
173
167
|
}), [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubMenuTrigger.js","names":["useSyncRef","React","Key","ReactElement","ReactNode","useEffect","useMemo","useRef","useState","AriaMenuTriggerProps","DismissButton","Placement","useMenuTrigger","useOverlayPosition","useMenuTriggerState","useEvent","generateRandomId","usePopoverSync","Popover","MenuContext","MenuContextValue","useMenuContext","SubmenuTriggerContext","DEFAULT_PLACEMENT","DEFAULT_OFFSET","DEFAULT_CROSS_OFFSET","CubeSubMenuTriggerProps","placement","offset","crossOffset","shouldFlip","containerPadding","children","isDisabled","onAction","key","autoFocus","InternalSubMenuTriggerProps","targetKey","InternalSubMenuTrigger","props","overlayProps","menuTrigger","menu","Children","toArray","state","submenuId","domTriggerRef","HTMLElement","popoverRef","HTMLDivElement","menuRef","HTMLUListElement","menuId","isOpen","onClose","close","triggerRef","containerRef","menuTriggerProps","rawTriggerProps","menuProps","type","parentContext","onKeyDown","_mtOnKeyDown","onPress","_mtOnPress","onPressStart","_mtOnPressStart","onKeyUp","_mtOnKeyUp","positionProps","targetRef","overlayRef","scrollRef","nestedMenuContext","ctx","ref","closeOnSelect","mods","popover","isClosing","hoverOpenTimerRef","current","clearTimeout","hoverCloseTimerRef","isHoveringRef","isHoveringSubmenuRef","handleKeyDown","e","KeyboardEvent","preventDefault","stopPropagation","open","nativeEvent","stopImmediatePropagation","suppressNextActionRef","ReturnType","setTimeout","checkShouldClose","handleMouseEnter","handleMouseLeave","handlePopoverMouseEnter","handlePopoverMouseLeave","mergeHandler","handler1","handler2","args","shouldCloseOnInteractOutside","el","Element","menuTriggerEl","closest","triggerContextValue","triggerProps","onMouseEnter","onMouseLeave","undefined","style","display","cloneElement","focus","SubMenuTrigger","getCollectionNode","trigger","element","wrapper","displayName"],"sources":["../../../../src/components/actions/Menu/SubMenuTrigger.tsx"],"sourcesContent":["import { useSyncRef } from '@react-aria/utils';\nimport React, {\n Key,\n ReactElement,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n Placement,\n useMenuTrigger,\n useOverlayPosition,\n} from 'react-aria';\nimport { useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { generateRandomId } from '../../../utils/random';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover } from '../../overlays/Modal';\n\nimport { MenuContext, MenuContextValue, useMenuContext } from './context';\nimport { SubmenuTriggerContext } from './SubmenuTriggerContext';\n\n// Default placement & offset for sub-menus (matches Spectrum / Aria)\nconst DEFAULT_PLACEMENT: Placement = 'right top';\nconst DEFAULT_OFFSET = 4;\nconst DEFAULT_CROSS_OFFSET = -5;\n\nexport interface CubeSubMenuTriggerProps extends AriaMenuTriggerProps {\n /** The preferred placement of the sub-menu relative to the trigger */\n placement?: Placement;\n\n /** Distance in pixels between the trigger and sub-menu */\n offset?: number;\n\n /** Distance in pixels along the cross axis from the default alignment */\n crossOffset?: number;\n\n /** Whether the sub-menu should flip to the opposite side when it would overflow */\n shouldFlip?: boolean;\n\n /** Minimum padding in pixels between the sub-menu and viewport edges */\n containerPadding?: number;\n\n /**\n * Sub-menu trigger and the sub-menu itself. Must be exactly two React nodes.\n *\n * 1) Trigger – **must render `<li role=\"menuitem\">`** (usually `Menu.Item`).\n * 2) Sub-menu – a `<Menu>` element.\n */\n children: [ReactNode, ReactElement];\n\n /** Whether the trigger is disabled and cannot be activated */\n isDisabled?: boolean;\n\n /**\n * Callback fired when an action is selected from the sub-menu.\n * Bubbles the `onAction` event from the sub-menu to parent components.\n */\n onAction?: (key: Key) => void;\n\n /**\n * Controls focus behavior when the sub-menu opens.\n * - `true` or `'first'`: Focus the first item\n * - `'last'`: Focus the last item\n * - `false`: Don't auto-focus any item\n * @default 'first'\n */\n autoFocus?: boolean | 'first' | 'last';\n}\n\ninterface InternalSubMenuTriggerProps extends CubeSubMenuTriggerProps {\n targetKey?: Key;\n}\n\n/**\n * Internal SubMenuTrigger that receives the already-rendered trigger element\n * from the collection system and wraps it with submenu behavior.\n */\nfunction InternalSubMenuTrigger(props: InternalSubMenuTriggerProps) {\n const {\n children,\n placement = DEFAULT_PLACEMENT,\n offset = DEFAULT_OFFSET,\n crossOffset = DEFAULT_CROSS_OFFSET,\n shouldFlip = true,\n isDisabled,\n autoFocus = 'first',\n onAction,\n targetKey,\n ...overlayProps\n } = props;\n\n // Children: [menuTrigger (already rendered MenuItem), menu (Menu component)]\n const [menuTrigger, menu] = React.Children.toArray(children) as [\n ReactElement,\n ReactElement,\n ];\n\n const state = useMenuTriggerState(props as AriaMenuTriggerProps);\n\n // Generate a unique ID for this submenu instance\n const submenuId = useMemo(() => generateRandomId(), []);\n\n // Refs – trigger (MenuItem <li>) and overlay (<div> from Popover)\n const domTriggerRef = useRef<HTMLElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLUListElement>(null);\n\n usePopoverSync({\n menuId: submenuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n triggerRef: domTriggerRef,\n containerRef: popoverRef,\n });\n\n // Strip keyboard/press handlers that we will implement ourselves\n const { menuTriggerProps: rawTriggerProps, menuProps } = useMenuTrigger(\n { type: 'submenu', isDisabled },\n state,\n domTriggerRef,\n );\n\n // Get parent context to check if parent menu is closing\n const parentContext = useMenuContext();\n\n // Remove default onKeyDown/onPress handlers from trigger props – we implement custom ones\n const {\n onKeyDown: _mtOnKeyDown,\n onPress: _mtOnPress,\n onPressStart: _mtOnPressStart,\n onKeyUp: _mtOnKeyUp,\n ...menuTriggerProps\n } = rawTriggerProps;\n\n const { overlayProps: positionProps } = useOverlayPosition({\n targetRef: domTriggerRef,\n overlayRef: popoverRef,\n scrollRef: menuRef,\n placement,\n offset: offset as number,\n crossOffset: crossOffset as number,\n shouldFlip,\n isOpen: state.isOpen,\n onClose: state.close,\n });\n\n /**\n * Build a MenuContext for the nested menu so it behaves just like a regular\n * popover-based Menu (selection handling, focus management, etc.).\n */\n const nestedMenuContext = useMemo(() => {\n const ctx: MenuContextValue = {\n ...menuProps,\n ref: menuRef,\n // Pass the parent's onClose to close the entire menu hierarchy\n onClose: () => {\n // Close this submenu state immediately\n state.close();\n\n // Then close the parent menu\n if (parentContext.onClose) {\n parentContext.onClose();\n }\n },\n closeOnSelect: true,\n autoFocus,\n mods: {\n popover: true,\n },\n // Propagate closing state from parent\n isClosing: parentContext.isClosing || !state.isOpen,\n };\n\n return ctx;\n }, [\n menuProps,\n autoFocus,\n state,\n parentContext.onClose,\n parentContext.isClosing,\n ]);\n\n // Sync the parent selection manager focus with DOM ref (for virtual focus scenarios)\n useSyncRef(parentContext, domTriggerRef);\n\n // Cleanup hover timers and reset refs on unmount\n useEffect(() => {\n return () => {\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n }\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n }\n isHoveringRef.current = false;\n isHoveringSubmenuRef.current = false;\n };\n }, []);\n\n // ----- Render -----\n\n // Handle keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (isDisabled) return;\n\n // Arrow right opens submenu\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n e.stopPropagation();\n state.open();\n }\n // Enter or Space opens submenu (suppress subsequent onAction)\n else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n // Stop immediate propagation to prevent React Aria's handlers from running\n e.nativeEvent.stopImmediatePropagation();\n state.open();\n suppressNextActionRef.current = true; // Remember it was keyboard\n }\n // Arrow left closes submenu if open\n else if (e.key === 'ArrowLeft' && state.isOpen) {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n }\n };\n\n // Use refs to store timer IDs\n const hoverOpenTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hoverCloseTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Track if mouse is over trigger or submenu\n const isHoveringRef = useRef(false);\n const isHoveringSubmenuRef = useRef(false);\n\n // Track whether the next onAction comes from a keyboard press\n const suppressNextActionRef = useRef(false);\n\n const checkShouldClose = () => {\n // Only close if mouse is not over trigger OR submenu\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n hoverCloseTimerRef.current = setTimeout(() => {\n // Double check before closing\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n state.close();\n }\n }, 300);\n }\n };\n\n // Handle mouse interactions on trigger\n const handleMouseEnter = () => {\n if (isDisabled) return;\n\n isHoveringRef.current = true;\n\n // Clear any pending close timer\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n\n // Use a small delay to prevent accidental opens\n if (!state.isOpen) {\n hoverOpenTimerRef.current = setTimeout(() => {\n if (isHoveringRef.current) {\n state.open();\n }\n }, 200);\n }\n };\n\n const handleMouseLeave = () => {\n isHoveringRef.current = false;\n\n // Clear open timer if it exists\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n hoverOpenTimerRef.current = null;\n }\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Handle mouse events on the submenu popover\n const handlePopoverMouseEnter = () => {\n isHoveringSubmenuRef.current = true;\n\n // Clear any pending close timer when entering submenu\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n };\n\n const handlePopoverMouseLeave = () => {\n isHoveringSubmenuRef.current = false;\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Merge event handlers\n const mergeHandler = (handler1: any, handler2: any) => {\n return (...args: any[]) => {\n handler1?.(...args);\n handler2?.(...args);\n };\n };\n\n // Outside-click handling for the nested submenu Popover.\n //\n // React Aria's `useOverlay` keeps a module-level `visibleOverlays` stack and\n // only invokes `onClose` for the topmost overlay (`onHide` gates on the\n // stack tail). With root + N nested submenus open, a single outside click\n // would otherwise only close the deepest submenu. Scheduling\n // `parentContext.onClose()` here propagates the close upward; the existing\n // `parentContext.isClosing` cascade (see `nestedMenuContext.isClosing` and\n // the Popover's `isOpen={!parentContext.isClosing}`) collapses every\n // intermediate submenu visually.\n //\n // Mirrors `MenuTrigger`'s predicate so clicks on `[data-popover-trigger]`\n // and `[data-popover-dismiss]` elements behave consistently across nesting\n // levels.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n if (!state.isOpen) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n if (el.closest('[data-popover-dismiss]')) {\n // Let the button's onPress fire first, then collapse the chain.\n setTimeout(() => parentContext.onClose?.(), 0);\n return false;\n }\n // True outside click: schedule parent close so the entire hierarchy\n // cascades. `useOverlay`'s own `onHide` will close this submenu via the\n // topmost-overlay rule.\n setTimeout(() => parentContext.onClose?.(), 0);\n return true;\n }\n // Click landed on a popover trigger (parent menu item, sibling submenu\n // trigger, or a different menu's button). Don't close ourselves here —\n // either the trigger handles it or `usePopoverSync` closes us via\n // `popover:open`.\n return false;\n });\n\n // Provide context to the trigger element (already rendered MenuItem)\n const triggerContextValue = useMemo(\n () => ({\n triggerRef: domTriggerRef,\n triggerProps: menuTriggerProps,\n isOpen: state.isOpen,\n isDisabled,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n onAction: isDisabled\n ? undefined\n : () => {\n // Ignore the synthetic press generated by the same Enter/Space\n if (suppressNextActionRef.current) {\n suppressNextActionRef.current = false;\n return;\n }\n // This is a mouse click, open the submenu\n state.open();\n },\n }),\n [\n state,\n isDisabled,\n handleMouseEnter,\n handleMouseLeave,\n handleKeyDown,\n menuTriggerProps,\n ],\n );\n\n return (\n <>\n <SubmenuTriggerContext.Provider value={triggerContextValue}>\n {menuTrigger}\n </SubmenuTriggerContext.Provider>\n {state.isOpen && (\n <Popover\n ref={popoverRef}\n hideArrow\n isNonModal\n isOpen={!parentContext.isClosing}\n style={positionProps.style}\n placement={placement as Placement}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n // Spread any additional overlay props\n {...overlayProps}\n >\n {/* Wrap content in a div to capture mouse events */}\n <div\n style={{ display: 'contents' }}\n onMouseEnter={handlePopoverMouseEnter}\n onMouseLeave={handlePopoverMouseLeave}\n >\n {/* Dismiss buttons for screen reader / keyboard support */}\n <DismissButton onDismiss={state.close} />\n {/* Provide updated menu context so nested menu behaves correctly */}\n <MenuContext.Provider value={nestedMenuContext}>\n {/* Clone nested menu to inject required props */}\n {React.cloneElement(menu, {\n ...(menu.props as any),\n autoFocus,\n onAction: (key: Key) => {\n // Call original menu onAction first\n (menu.props as any).onAction?.(key);\n onAction?.(key);\n // Don't close here - MenuItem will handle it via context.onClose\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n // Handle keyboard navigation for closing submenu\n if (e.key === 'ArrowLeft' || e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n // Return focus to trigger\n domTriggerRef.current?.focus();\n }\n // Call original handler if exists\n (menu.props as any).onKeyDown?.(e);\n },\n ref: menuRef,\n })}\n </MenuContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n </Popover>\n )}\n </>\n );\n}\n\n/**\n * Public SubMenuTrigger component that users interact with.\n * It just provides the getCollectionNode for the collection system.\n */\nexport function SubMenuTrigger(props: CubeSubMenuTriggerProps) {\n // This component is never actually rendered directly.\n // The collection system uses getCollectionNode to build the menu.\n return null;\n}\n\n// Allow React Stately collection builder to treat SubMenuTrigger as an Item\n(SubMenuTrigger as any).getCollectionNode = function* (\n props: CubeSubMenuTriggerProps,\n) {\n const [trigger, menu] = React.Children.toArray(\n props.children,\n ) as ReactElement[];\n\n // Yield a collection node that tells the Menu to wrap this item with InternalSubMenuTrigger\n yield {\n element: trigger,\n wrapper: (element: ReactElement) => (\n <InternalSubMenuTrigger\n key={element.key || undefined}\n targetKey={element.key || undefined}\n {...props}\n >\n {element}\n {menu}\n </InternalSubMenuTrigger>\n ),\n };\n};\n\nSubMenuTrigger.displayName = 'SubMenuTrigger';\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAMuB,oBAA+B;AACrC,MAAMC,iBAAiB;AACvB,MAAMC,uBAAuB;;;;;AAqD7B,SAASc,uBAAuBC,OAAoC;CAClE,MAAM,EACJR,UACAL,YAAYJ,mBACZK,SAASJ,gBACTK,cAAcJ,sBACdK,aAAa,MACbG,YACAG,YAAY,SACZF,UACAI,WACA,GAAGG,iBACDD;CAGJ,MAAM,CAACE,aAAaC,QAAQ1C,MAAM2C,SAASC,QAAQb,SAAS;CAK5D,MAAMc,QAAQhC,oBAAoB0B,MAA8B;CAGhE,MAAMO,YAAYzC,cAAcU,kBAAkB,EAAE,EAAE,CAAC;CAGvD,MAAMgC,gBAAgBzC,OAAoB,KAAK;CAC/C,MAAM2C,aAAa3C,OAAuB,KAAK;CAC/C,MAAM6C,UAAU7C,OAAyB,KAAK;AAE9CU,gBAAe;EACbqC,QAAQP;EACRQ,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B,YAAY0B,QAA2B;AAErC,WAAIA,IAAExD,QAAQ,eAAewD,IAAExD,QAAQ,UAAU;AAC/CwD,YAAEE,gBAAgB;AAClBF,YAAEG,iBAAiB;AACnBhD,cAAMW,OAAO;AAEbT,sBAAcqC,SAASsC,OAAO;;AAGhC,OAAChF,KAAKH,MAAcyB,YAAY0B,IAAE;;MAEpCZ,KAAK3B;MACN,CAAC;MACkB;IACtB,oBAAC,iBAAc,WAAWN,MAAMW,QAAM;;IACnC;GAER,IACA;;;;;;AAQP,SAAgBmE,eAAepF,OAAgC;AAG7D,QAAO;;AAIT,AAACoF,eAAuBC,oBAAoB,WAC1CrF,OACA;CACA,MAAM,CAACsF,SAASnF,QAAQ1C,MAAM2C,SAASC,QACrCL,MAAMR,SACP;AAGD,OAAM;EACJ+F,SAASD;EACTE,UAAUD,YACR,qBAAC;GAEC,WAAWA,QAAQ5F,OAAOoF;GAC1B,GAAI/E;cAEHuF,SACApF;KALIoF,QAAQ5F,OAAOoF,OAME;EAE3B;;AAGHK,eAAeK,cAAc"}
|
|
1
|
+
{"version":3,"file":"SubMenuTrigger.js","names":["useSyncRef","React","Key","ReactElement","ReactNode","useEffect","useMemo","useRef","useState","AriaMenuTriggerProps","DismissButton","Placement","useMenuTrigger","useOverlayPosition","useMenuTriggerState","useEvent","generateRandomId","usePopoverSync","Popover","MenuContext","MenuContextValue","useMenuContext","SubmenuTriggerContext","DEFAULT_PLACEMENT","DEFAULT_OFFSET","DEFAULT_CROSS_OFFSET","CubeSubMenuTriggerProps","placement","offset","crossOffset","shouldFlip","containerPadding","children","isDisabled","onAction","key","autoFocus","InternalSubMenuTriggerProps","targetKey","InternalSubMenuTrigger","props","overlayProps","menuTrigger","menu","Children","toArray","state","submenuId","domTriggerRef","HTMLElement","popoverRef","HTMLDivElement","menuRef","HTMLUListElement","menuId","isOpen","onClose","close","triggerRef","containerRef","menuTriggerProps","rawTriggerProps","menuProps","type","parentContext","onKeyDown","_mtOnKeyDown","onPress","_mtOnPress","onPressStart","_mtOnPressStart","onKeyUp","_mtOnKeyUp","positionProps","targetRef","overlayRef","scrollRef","nestedMenuContext","ctx","ref","closeOnSelect","mods","popover","isClosing","hoverOpenTimerRef","current","clearTimeout","hoverCloseTimerRef","isHoveringRef","isHoveringSubmenuRef","handleKeyDown","e","KeyboardEvent","preventDefault","stopPropagation","open","nativeEvent","stopImmediatePropagation","ReturnType","setTimeout","checkShouldClose","handleMouseEnter","handleMouseLeave","handlePopoverMouseEnter","handlePopoverMouseLeave","mergeHandler","handler1","handler2","args","shouldCloseOnInteractOutside","el","Element","menuTriggerEl","closest","triggerContextValue","triggerProps","onMouseEnter","onMouseLeave","undefined","style","display","cloneElement","focus","SubMenuTrigger","getCollectionNode","trigger","element","wrapper","displayName"],"sources":["../../../../src/components/actions/Menu/SubMenuTrigger.tsx"],"sourcesContent":["import { useSyncRef } from '@react-aria/utils';\nimport React, {\n Key,\n ReactElement,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n Placement,\n useMenuTrigger,\n useOverlayPosition,\n} from 'react-aria';\nimport { useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { generateRandomId } from '../../../utils/random';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover } from '../../overlays/Modal';\n\nimport { MenuContext, MenuContextValue, useMenuContext } from './context';\nimport { SubmenuTriggerContext } from './SubmenuTriggerContext';\n\n// Default placement & offset for sub-menus (matches Spectrum / Aria)\nconst DEFAULT_PLACEMENT: Placement = 'right top';\nconst DEFAULT_OFFSET = 4;\nconst DEFAULT_CROSS_OFFSET = -5;\n\nexport interface CubeSubMenuTriggerProps extends AriaMenuTriggerProps {\n /** The preferred placement of the sub-menu relative to the trigger */\n placement?: Placement;\n\n /** Distance in pixels between the trigger and sub-menu */\n offset?: number;\n\n /** Distance in pixels along the cross axis from the default alignment */\n crossOffset?: number;\n\n /** Whether the sub-menu should flip to the opposite side when it would overflow */\n shouldFlip?: boolean;\n\n /** Minimum padding in pixels between the sub-menu and viewport edges */\n containerPadding?: number;\n\n /**\n * Sub-menu trigger and the sub-menu itself. Must be exactly two React nodes.\n *\n * 1) Trigger – **must render `<li role=\"menuitem\">`** (usually `Menu.Item`).\n * 2) Sub-menu – a `<Menu>` element.\n */\n children: [ReactNode, ReactElement];\n\n /** Whether the trigger is disabled and cannot be activated */\n isDisabled?: boolean;\n\n /**\n * Callback fired when an action is selected from the sub-menu.\n * Bubbles the `onAction` event from the sub-menu to parent components.\n */\n onAction?: (key: Key) => void;\n\n /**\n * Controls focus behavior when the sub-menu opens.\n * - `true` or `'first'`: Focus the first item\n * - `'last'`: Focus the last item\n * - `false`: Don't auto-focus any item\n * @default 'first'\n */\n autoFocus?: boolean | 'first' | 'last';\n}\n\ninterface InternalSubMenuTriggerProps extends CubeSubMenuTriggerProps {\n targetKey?: Key;\n}\n\n/**\n * Internal SubMenuTrigger that receives the already-rendered trigger element\n * from the collection system and wraps it with submenu behavior.\n */\nfunction InternalSubMenuTrigger(props: InternalSubMenuTriggerProps) {\n const {\n children,\n placement = DEFAULT_PLACEMENT,\n offset = DEFAULT_OFFSET,\n crossOffset = DEFAULT_CROSS_OFFSET,\n shouldFlip = true,\n isDisabled,\n autoFocus = 'first',\n onAction,\n targetKey,\n ...overlayProps\n } = props;\n\n // Children: [menuTrigger (already rendered MenuItem), menu (Menu component)]\n const [menuTrigger, menu] = React.Children.toArray(children) as [\n ReactElement,\n ReactElement,\n ];\n\n const state = useMenuTriggerState(props as AriaMenuTriggerProps);\n\n // Generate a unique ID for this submenu instance\n const submenuId = useMemo(() => generateRandomId(), []);\n\n // Refs – trigger (MenuItem <li>) and overlay (<div> from Popover)\n const domTriggerRef = useRef<HTMLElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLUListElement>(null);\n\n usePopoverSync({\n menuId: submenuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n triggerRef: domTriggerRef,\n containerRef: popoverRef,\n });\n\n // Strip keyboard/press handlers that we will implement ourselves\n const { menuTriggerProps: rawTriggerProps, menuProps } = useMenuTrigger(\n { type: 'submenu', isDisabled },\n state,\n domTriggerRef,\n );\n\n // Get parent context to check if parent menu is closing\n const parentContext = useMenuContext();\n\n // Remove default onKeyDown/onPress handlers from trigger props – we implement custom ones\n const {\n onKeyDown: _mtOnKeyDown,\n onPress: _mtOnPress,\n onPressStart: _mtOnPressStart,\n onKeyUp: _mtOnKeyUp,\n ...menuTriggerProps\n } = rawTriggerProps;\n\n const { overlayProps: positionProps } = useOverlayPosition({\n targetRef: domTriggerRef,\n overlayRef: popoverRef,\n scrollRef: menuRef,\n placement,\n offset: offset as number,\n crossOffset: crossOffset as number,\n shouldFlip,\n isOpen: state.isOpen,\n onClose: state.close,\n });\n\n /**\n * Build a MenuContext for the nested menu so it behaves just like a regular\n * popover-based Menu (selection handling, focus management, etc.).\n */\n const nestedMenuContext = useMemo(() => {\n const ctx: MenuContextValue = {\n ...menuProps,\n ref: menuRef,\n // Pass the parent's onClose to close the entire menu hierarchy\n onClose: () => {\n // Close this submenu state immediately\n state.close();\n\n // Then close the parent menu\n if (parentContext.onClose) {\n parentContext.onClose();\n }\n },\n closeOnSelect: true,\n autoFocus,\n mods: {\n popover: true,\n },\n // Propagate closing state from parent\n isClosing: parentContext.isClosing || !state.isOpen,\n };\n\n return ctx;\n }, [\n menuProps,\n autoFocus,\n state,\n parentContext.onClose,\n parentContext.isClosing,\n ]);\n\n // Sync the parent selection manager focus with DOM ref (for virtual focus scenarios)\n useSyncRef(parentContext, domTriggerRef);\n\n // Cleanup hover timers and reset refs on unmount\n useEffect(() => {\n return () => {\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n }\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n }\n isHoveringRef.current = false;\n isHoveringSubmenuRef.current = false;\n };\n }, []);\n\n // ----- Render -----\n\n // Handle keyboard navigation\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (isDisabled) return;\n\n // Arrow right opens submenu\n if (e.key === 'ArrowRight') {\n e.preventDefault();\n e.stopPropagation();\n state.open();\n }\n // Enter or Space opens submenu. Preventing the default keeps `MenuItem`\n // from passing the key on to React Aria's item handler, which would click\n // the item and run its action as well.\n else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n // Stop immediate propagation to prevent React Aria's handlers from running\n e.nativeEvent.stopImmediatePropagation();\n state.open();\n }\n // Arrow left closes submenu if open\n else if (e.key === 'ArrowLeft' && state.isOpen) {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n }\n };\n\n // Use refs to store timer IDs\n const hoverOpenTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hoverCloseTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n // Track if mouse is over trigger or submenu\n const isHoveringRef = useRef(false);\n const isHoveringSubmenuRef = useRef(false);\n\n const checkShouldClose = () => {\n // Only close if mouse is not over trigger OR submenu\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n hoverCloseTimerRef.current = setTimeout(() => {\n // Double check before closing\n if (!isHoveringRef.current && !isHoveringSubmenuRef.current) {\n state.close();\n }\n }, 300);\n }\n };\n\n // Handle mouse interactions on trigger\n const handleMouseEnter = () => {\n if (isDisabled) return;\n\n isHoveringRef.current = true;\n\n // Clear any pending close timer\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n\n // Use a small delay to prevent accidental opens\n if (!state.isOpen) {\n hoverOpenTimerRef.current = setTimeout(() => {\n if (isHoveringRef.current) {\n state.open();\n }\n }, 200);\n }\n };\n\n const handleMouseLeave = () => {\n isHoveringRef.current = false;\n\n // Clear open timer if it exists\n if (hoverOpenTimerRef.current) {\n clearTimeout(hoverOpenTimerRef.current);\n hoverOpenTimerRef.current = null;\n }\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Handle mouse events on the submenu popover\n const handlePopoverMouseEnter = () => {\n isHoveringSubmenuRef.current = true;\n\n // Clear any pending close timer when entering submenu\n if (hoverCloseTimerRef.current) {\n clearTimeout(hoverCloseTimerRef.current);\n hoverCloseTimerRef.current = null;\n }\n };\n\n const handlePopoverMouseLeave = () => {\n isHoveringSubmenuRef.current = false;\n\n // Check if we should close\n checkShouldClose();\n };\n\n // Merge event handlers\n const mergeHandler = (handler1: any, handler2: any) => {\n return (...args: any[]) => {\n handler1?.(...args);\n handler2?.(...args);\n };\n };\n\n // Outside-click handling for the nested submenu Popover.\n //\n // React Aria's `useOverlay` keeps a module-level `visibleOverlays` stack and\n // only invokes `onClose` for the topmost overlay (`onHide` gates on the\n // stack tail). With root + N nested submenus open, a single outside click\n // would otherwise only close the deepest submenu. Scheduling\n // `parentContext.onClose()` here propagates the close upward; the existing\n // `parentContext.isClosing` cascade (see `nestedMenuContext.isClosing` and\n // the Popover's `isOpen={!parentContext.isClosing}`) collapses every\n // intermediate submenu visually.\n //\n // Mirrors `MenuTrigger`'s predicate so clicks on `[data-popover-trigger]`\n // and `[data-popover-dismiss]` elements behave consistently across nesting\n // levels.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n if (!state.isOpen) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n if (el.closest('[data-popover-dismiss]')) {\n // Let the button's onPress fire first, then collapse the chain.\n setTimeout(() => parentContext.onClose?.(), 0);\n return false;\n }\n // True outside click: schedule parent close so the entire hierarchy\n // cascades. `useOverlay`'s own `onHide` will close this submenu via the\n // topmost-overlay rule.\n setTimeout(() => parentContext.onClose?.(), 0);\n return true;\n }\n // Click landed on a popover trigger (parent menu item, sibling submenu\n // trigger, or a different menu's button). Don't close ourselves here —\n // either the trigger handles it or `usePopoverSync` closes us via\n // `popover:open`.\n return false;\n });\n\n // Provide context to the trigger element (already rendered MenuItem)\n const triggerContextValue = useMemo(\n () => ({\n triggerRef: domTriggerRef,\n triggerProps: menuTriggerProps,\n isOpen: state.isOpen,\n isDisabled,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onKeyDown: handleKeyDown,\n onAction: isDisabled\n ? undefined\n : () => {\n // A pointer press: Enter and Space open the submenu in\n // `handleKeyDown` and never reach the item's action.\n state.open();\n },\n }),\n [\n state,\n isDisabled,\n handleMouseEnter,\n handleMouseLeave,\n handleKeyDown,\n menuTriggerProps,\n ],\n );\n\n return (\n <>\n <SubmenuTriggerContext.Provider value={triggerContextValue}>\n {menuTrigger}\n </SubmenuTriggerContext.Provider>\n {state.isOpen && (\n <Popover\n ref={popoverRef}\n hideArrow\n isNonModal\n isOpen={!parentContext.isClosing}\n style={positionProps.style}\n placement={placement as Placement}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n // Spread any additional overlay props\n {...overlayProps}\n >\n {/* Wrap content in a div to capture mouse events */}\n <div\n style={{ display: 'contents' }}\n onMouseEnter={handlePopoverMouseEnter}\n onMouseLeave={handlePopoverMouseLeave}\n >\n {/* Dismiss buttons for screen reader / keyboard support */}\n <DismissButton onDismiss={state.close} />\n {/* Provide updated menu context so nested menu behaves correctly */}\n <MenuContext.Provider value={nestedMenuContext}>\n {/* Clone nested menu to inject required props */}\n {React.cloneElement(menu, {\n ...(menu.props as any),\n autoFocus,\n onAction: (key: Key) => {\n // Call original menu onAction first\n (menu.props as any).onAction?.(key);\n onAction?.(key);\n // Don't close here - MenuItem will handle it via context.onClose\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n // Handle keyboard navigation for closing submenu\n if (e.key === 'ArrowLeft' || e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n state.close();\n // Return focus to trigger\n domTriggerRef.current?.focus();\n }\n // Call original handler if exists\n (menu.props as any).onKeyDown?.(e);\n },\n ref: menuRef,\n })}\n </MenuContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n </Popover>\n )}\n </>\n );\n}\n\n/**\n * Public SubMenuTrigger component that users interact with.\n * It just provides the getCollectionNode for the collection system.\n */\nexport function SubMenuTrigger(props: CubeSubMenuTriggerProps) {\n // This component is never actually rendered directly.\n // The collection system uses getCollectionNode to build the menu.\n return null;\n}\n\n// Allow React Stately collection builder to treat SubMenuTrigger as an Item\n(SubMenuTrigger as any).getCollectionNode = function* (\n props: CubeSubMenuTriggerProps,\n) {\n const [trigger, menu] = React.Children.toArray(\n props.children,\n ) as ReactElement[];\n\n // Yield a collection node that tells the Menu to wrap this item with InternalSubMenuTrigger\n yield {\n element: trigger,\n wrapper: (element: ReactElement) => (\n <InternalSubMenuTrigger\n key={element.key || undefined}\n targetKey={element.key || undefined}\n {...props}\n >\n {element}\n {menu}\n </InternalSubMenuTrigger>\n ),\n };\n};\n\nSubMenuTrigger.displayName = 'SubMenuTrigger';\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAMuB,oBAA+B;AACrC,MAAMC,iBAAiB;AACvB,MAAMC,uBAAuB;;;;;AAqD7B,SAASc,uBAAuBC,OAAoC;CAClE,MAAM,EACJR,UACAL,YAAYJ,mBACZK,SAASJ,gBACTK,cAAcJ,sBACdK,aAAa,MACbG,YACAG,YAAY,SACZF,UACAI,WACA,GAAGG,iBACDD;CAGJ,MAAM,CAACE,aAAaC,QAAQ1C,MAAM2C,SAASC,QAAQb,SAAS;CAK5D,MAAMc,QAAQhC,oBAAoB0B,MAA8B;CAGhE,MAAMO,YAAYzC,cAAcU,kBAAkB,EAAE,EAAE,CAAC;CAGvD,MAAMgC,gBAAgBzC,OAAoB,KAAK;CAC/C,MAAM2C,aAAa3C,OAAuB,KAAK;CAC/C,MAAM6C,UAAU7C,OAAyB,KAAK;AAE9CU,gBAAe;EACbqC,QAAQP;EACRQ,QAAQT,MAAMS;EACdC,eAAeV,MAAMW,OAAO;EAC5BC,YAAYV;EACZW,cAAcT;EACf,CAAC;CAGF,MAA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IAAE;;MAEpCZ,KAAK3B;MACN,CAAC;MACkB;IACtB,oBAAC,iBAAc,WAAWN,MAAMW,QAAM;;IACnC;GAER,IACA;;;;;;AAQP,SAAgBkE,eAAenF,OAAgC;AAG7D,QAAO;;AAIT,AAACmF,eAAuBC,oBAAoB,WAC1CpF,OACA;CACA,MAAM,CAACqF,SAASlF,QAAQ1C,MAAM2C,SAASC,QACrCL,MAAMR,SACP;AAGD,OAAM;EACJ8F,SAASD;EACTE,UAAUD,YACR,qBAAC;GAEC,WAAWA,QAAQ3F,OAAOmF;GAC1B,GAAI9E;cAEHsF,SACAnF;KALImF,QAAQ3F,OAAOmF,OAME;EAE3B;;AAGHK,eAAeK,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { DEFAULT_CLEAR_STYLES } from "../../../data/item-themes.js";
|
|
3
3
|
import { Space } from "../../layout/Space.js";
|
|
4
4
|
import { DEFAULT_BUTTON_STYLES } from "../Button/Button.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
//#region src/components/actions/actions-run.ts
|
|
3
3
|
/**
|
|
4
4
|
* Whether `element` — the node react-aria hands an overlay's dismiss predicate
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { ItemActionProvider, useItemActionContext } from "./ItemActionContext.js";
|
|
3
3
|
import { openLink, parseTo, performClickHandler, useAction } from "./use-action.js";
|
|
4
4
|
import { ItemAction } from "./ItemAction/ItemAction.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
4
4
|
import { useFocus as useFocus$1 } from "../../utils/react/interactions.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { usePopoverSync } from "../../utils/react/usePopoverSync.js";
|
|
4
4
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../utils/react/mergeProps.js";
|
|
3
3
|
import { usePopoverSync } from "../../utils/react/usePopoverSync.js";
|
|
4
4
|
import { useEvent } from "../../_internal/hooks/use-event.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | 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 { useFocus as useFocus$1 } from "../../../utils/react/interactions.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import themes_default from "../../../data/themes.js";
|
|
3
3
|
import { useAlert } from "./use-alert.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useDeprecationWarning } from "../../../_internal/hooks/use-deprecation-warning.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { CONTAINER_STYLES, Element, filterBaseProps } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { _Item } from "../Item/Item.js";
|
|
3
3
|
import themes_default from "../../../data/themes.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | 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.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -10,7 +10,6 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
10
|
const STYLE_LIST = [...CONTAINER_STYLES, ...TEXT_STYLES];
|
|
11
11
|
const ContentElement = tasty({
|
|
12
12
|
qa: "Content",
|
|
13
|
-
"data-id": "Content",
|
|
14
13
|
as: "section",
|
|
15
14
|
styles: {
|
|
16
15
|
gridArea: "content",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.js","names":["BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","tasty","TEXT_STYLES","TextStyleProps","forwardRef","useSlotProps","extractStyles","STYLE_LIST","ContentElement","qa","as","styles","gridArea","preset","color","display","flow","gap","overflow","scrollbar","CubeContentProps","Content","props","ref","$","_c","t0","t1","eventProps","t2"],"sources":["../../../src/components/content/Content.tsx"],"sourcesContent":["import {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n tasty,\n TEXT_STYLES,\n TextStyleProps,\n} from '@tenphi/tasty';\nimport { forwardRef } from 'react';\n\nimport { useSlotProps } from '../../utils/react';\nimport { extractStyles } from '../../utils/styles';\n\nconst STYLE_LIST = [...CONTAINER_STYLES, ...TEXT_STYLES];\n\nconst ContentElement = tasty({\n qa: 'Content',\n
|
|
1
|
+
{"version":3,"file":"Content.js","names":["BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","tasty","TEXT_STYLES","TextStyleProps","forwardRef","useSlotProps","extractStyles","STYLE_LIST","ContentElement","qa","as","styles","gridArea","preset","color","display","flow","gap","overflow","scrollbar","CubeContentProps","Content","props","ref","$","_c","t0","t1","eventProps","t2"],"sources":["../../../src/components/content/Content.tsx"],"sourcesContent":["import {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n tasty,\n TEXT_STYLES,\n TextStyleProps,\n} from '@tenphi/tasty';\nimport { forwardRef } from 'react';\n\nimport { useSlotProps } from '../../utils/react';\nimport { extractStyles } from '../../utils/styles';\n\nconst STYLE_LIST = [...CONTAINER_STYLES, ...TEXT_STYLES];\n\nconst ContentElement = tasty({\n qa: 'Content',\n as: 'section',\n styles: {\n gridArea: 'content',\n preset: 'p3',\n color: '#dark-02',\n display: 'block',\n flow: 'column',\n gap: '2x',\n overflow: 'auto',\n scrollbar: 'styled',\n },\n});\n\nexport interface CubeContentProps\n extends BaseProps,\n ContainerStyleProps,\n TextStyleProps {}\n\nexport const Content = forwardRef(function Content(\n props: CubeContentProps,\n ref,\n) {\n props = useSlotProps(props, 'content');\n\n const styles = extractStyles(props, STYLE_LIST);\n\n return (\n <ContentElement\n {...filterBaseProps(props, { eventProps: true })}\n ref={ref}\n styles={styles}\n />\n );\n});\n"],"mappings":";;;;;;;;;AAcA,MAAMU,aAAa,CAAC,GAAGT,kBAAkB,GAAGI,YAAY;AAExD,MAAMM,iBAAiBP,MAAM;CAC3BQ,IAAI;CACJC,IAAI;CACJC,QAAQ;EACNC,UAAU;EACVC,QAAQ;EACRC,OAAO;EACPC,SAAS;EACTC,MAAM;EACNC,KAAK;EACLC,UAAU;EACVC,WAAW;EACb;CACD,CAAC;AAOF,MAAaE,UAAUjB,WAAW,SAAAiB,QAAAC,OAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;AAIhCH,SAAQjB,aAAaiB,OAAO,UAAU;CAAjC,IAAAI;AAAA,KAAAF,EAAA,OAAAF,OAAA;AAEUI,OAAApB,cAAcgB,OAAOf,WAAW;AAAAiB,IAAA,KAAAF;AAAAE,IAAA,KAAAE;OAAAA,MAAAF,EAAA;CAA/C,MAAAb,SAAee;CAAiC,IAAAC;AAAA,KAAAH,EAAA,OAAAF,OAAA;AAIxCK,OAAA3B,gBAAgBsB,OAAO,EAAAM,YAAc,MAAM,CAAC;AAAAJ,IAAA,KAAAF;AAAAE,IAAA,KAAAG;OAAAA,MAAAH,EAAA;CAAA,IAAAK;AAAA,KAAAL,EAAA,OAAAD,OAAAC,EAAA,OAAAb,UAAAa,EAAA,OAAAG,IAAA;AADlDE,OAAA,oBAAC;GAAc,GACTF;GACCJ;GACGZ;IACR;AAAAa,IAAA,KAAAD;AAAAC,IAAA,KAAAb;AAAAa,IAAA,KAAAG;AAAAH,IAAA,KAAAK;OAAAA,MAAAL,EAAA;AAAA,QAJFK;EAMF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useTimer } from "../../../_internal/hooks/use-timer/use-timer.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { _Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
3
3
|
import { TooltipTrigger } from "../../overlays/Tooltip/TooltipTrigger.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
3
3
|
import { useCombinedRefs } from "../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { useSlotProps } from "../../utils/react/Slots.js";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { _Text } from "../Text.js";
|
|
4
4
|
import { useKeySymbols } from "../../../utils/react/useKeySymbols.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | Cube Dev Team */
|
|
2
2
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
3
3
|
import { ItemBadge } from "../ItemBadge/ItemBadge.js";
|
|
4
4
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-9bde021 | 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 { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
@@ -6,11 +6,12 @@ import "../../../utils/react/index.js";
|
|
|
6
6
|
import { CubeItemBadgeProps } from "../ItemBadge/ItemBadge.js";
|
|
7
7
|
import "./index.js";
|
|
8
8
|
import { ItemVariant } from "../../../data/item-themes.js";
|
|
9
|
+
import { TooltipFocusProps } from "../../overlays/Tooltip/split-trigger-props.js";
|
|
9
10
|
import { CubeItemActionProps } from "../../actions/ItemAction/ItemAction.js";
|
|
10
11
|
import "../../actions/index.js";
|
|
11
12
|
import { BaseProps, ContainerStyleProps, Mods, Styles } from "@tenphi/tasty";
|
|
12
13
|
import * as react from "react";
|
|
13
|
-
import { ReactNode,
|
|
14
|
+
import { ReactNode, Ref } from "react";
|
|
14
15
|
import { OverlayProps } from "react-aria";
|
|
15
16
|
import * as _react_types_shared0 from "@react-types/shared";
|
|
16
17
|
|
|
@@ -139,10 +140,34 @@ interface CubeItemProps extends BaseProps, ContainerStyleProps {
|
|
|
139
140
|
* the only place deciding how the disabled state reaches the DOM.
|
|
140
141
|
*/
|
|
141
142
|
disabled?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* @private
|
|
145
|
+
* Rendered inside the item's element but outside every slot, before them.
|
|
146
|
+
* For a node that has to live in the element without being part of what it
|
|
147
|
+
* shows — the visually hidden native input a button radio lays over itself.
|
|
148
|
+
* Passing such a node as `children` instead would make it part of the label:
|
|
149
|
+
* the auto tooltip and `highlight` only work on a string label, and
|
|
150
|
+
* `has-label` would render an empty, padded `Label` next to a lone icon.
|
|
151
|
+
*
|
|
152
|
+
* As a function it renders the element that takes focus, and receives the
|
|
153
|
+
* tooltip's focus-side trigger props to put on it (see
|
|
154
|
+
* `splitTooltipTriggerProps`): focus lands on that input, not on the item,
|
|
155
|
+
* so on the item they would never open the tooltip from the keyboard.
|
|
156
|
+
*/
|
|
157
|
+
hiddenContent?: ReactNode | ((tooltipFocusProps: TooltipFocusProps) => ReactNode);
|
|
158
|
+
/**
|
|
159
|
+
* @private
|
|
160
|
+
* The label's room changes over the item's life — a radio tab in a
|
|
161
|
+
* responsive switch, say. The auto tooltip then stays mounted, disabled
|
|
162
|
+
* while the label fits, instead of wrapping the element only once the label
|
|
163
|
+
* truncates: that wrap remounts the element, which takes focus (and, for a
|
|
164
|
+
* radio, the native input it holds) with it.
|
|
165
|
+
*/
|
|
166
|
+
isDynamicLabel?: boolean;
|
|
142
167
|
/**
|
|
143
168
|
* Ref to access the label element directly
|
|
144
169
|
*/
|
|
145
|
-
labelRef?:
|
|
170
|
+
labelRef?: Ref<HTMLElement>;
|
|
146
171
|
/**
|
|
147
172
|
* Heading level for the Label element when type="header" or type="card".
|
|
148
173
|
* Changes the Label's HTML tag to the corresponding heading (h1-h6).
|