@cube-dev/ui-kit 0.199.1 → 0.200.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +47 -0
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +2 -2
- package/dist/components/GlobalStyles.js.map +1 -1
- package/dist/components/GridProvider.d.ts +6 -4
- package/dist/components/GridProvider.js +14 -9
- package/dist/components/GridProvider.js.map +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +17 -17
- package/dist/components/Root.js.map +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +7 -9
- package/dist/components/actions/Button/Button.js.map +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +7 -12
- package/dist/components/actions/ItemAction/ItemAction.js.map +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +35 -37
- package/dist/components/actions/ItemActionsWrapper.js.map +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +116 -127
- package/dist/components/actions/Menu/MenuTrigger.js.map +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +4 -3
- package/dist/components/actions/Menu/SubMenuTrigger.js.map +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +5 -4
- package/dist/components/actions/Menu/styled.js.map +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 +32 -23
- package/dist/components/actions/use-context-menu.js.map +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/Alert.js.map +1 -1
- package/dist/components/content/Alert/use-alert.js +24 -27
- package/dist/components/content/Alert/use-alert.js.map +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +6 -2
- package/dist/components/content/Badge/Badge.js.map +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +3 -3
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js.map +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +83 -87
- package/dist/components/content/CopySnippet/CopySnippet.js.map +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 +6 -13
- package/dist/components/content/InlineInput/InlineInput.js.map +1 -1
- package/dist/components/content/Item/Item.js +18 -18
- package/dist/components/content/Item/Item.js.map +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +10 -14
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js.map +1 -1
- package/dist/components/content/Layout/LayoutContent.js +18 -16
- package/dist/components/content/Layout/LayoutContent.js.map +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +2 -2
- package/dist/components/content/Layout/LayoutHeader.js.map +1 -1
- package/dist/components/content/Layout/LayoutPane.js +35 -31
- package/dist/components/content/Layout/LayoutPane.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanel.js +31 -27
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +23 -25
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js.map +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/Placeholder/Placeholder.js.map +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js.map +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js.map +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/content/Tag/Tag.js +6 -2
- package/dist/components/content/Tag/Tag.js.map +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +2 -5
- package/dist/components/content/TextItem/TextItem.js.map +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +11 -21
- package/dist/components/content/Tree/Tree.js.map +1 -1
- package/dist/components/content/Tree/TreeNode.js +7 -7
- package/dist/components/content/Tree/TreeNode.js.map +1 -1
- package/dist/components/content/Tree/styled.js +31 -12
- package/dist/components/content/Tree/styled.js.map +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +2 -2
- package/dist/components/data/ItemTable/ItemTableToolbar.js.map +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableRow.js.map +1 -1
- package/dist/components/data/TableBase/TableView.js +4 -7
- package/dist/components/data/TableBase/TableView.js.map +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js.map +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +36 -29
- package/dist/components/data/TableBase/styled.js.map +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +3 -3
- package/dist/components/fields/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.d.ts +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +4 -4
- package/dist/components/fields/ColorSwatch/ColorSwatch.js.map +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +12 -15
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js.map +1 -1
- package/dist/components/fields/ComboBox/ComboBox.d.ts +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +174 -183
- package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.d.ts +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js.map +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +5 -9
- package/dist/components/fields/DatePicker/DateInputBase.js.map +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 +49 -39
- package/dist/components/fields/DatePicker/DatePickerSegment.js.map +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 +5 -3
- package/dist/components/fields/DatePicker/PeriodPicker.js.map +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +2 -2
- package/dist/components/fields/FileInput/FileInput.js.map +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +6 -8
- package/dist/components/fields/FilterListBox/FilterListBox.js.map +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +2 -2
- package/dist/components/fields/FilterPicker/FilterPicker.js.map +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.d.ts +1 -1
- package/dist/components/fields/ListBox/ListBox.js +49 -24
- package/dist/components/fields/ListBox/ListBox.js.map +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +2 -2
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +2 -2
- package/dist/components/fields/Picker/Picker.js.map +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +91 -96
- package/dist/components/fields/RadioGroup/Radio.js.map +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/fields/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.d.ts +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -2
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.d.ts +1 -1
- package/dist/components/fields/Select/Select.js +4 -4
- 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 +3 -3
- package/dist/components/fields/Slider/HueSlider.js.map +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 +4 -6
- package/dist/components/fields/Slider/SliderBase.js.map +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +5 -5
- package/dist/components/fields/Slider/SliderTrack.js.map +1 -1
- package/dist/components/fields/Slider/elements.js +7 -6
- package/dist/components/fields/Slider/elements.js.map +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +3 -3
- package/dist/components/fields/Switch/Switch.js.map +1 -1
- package/dist/components/fields/TagInput/TagInput.d.ts +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js.map +1 -1
- package/dist/components/fields/TagInput/TagList.js +3 -3
- package/dist/components/fields/TagInput/TagList.js.map +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +3 -6
- package/dist/components/fields/TextInput/TextInputBase.js.map +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +7 -7
- package/dist/components/fields/color/ColorPanel.js.map +1 -1
- package/dist/components/fields/color/channels.js +4 -4
- package/dist/components/fields/color/channels.js.map +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +11 -8
- package/dist/components/form/Label.js.map +1 -1
- package/dist/components/form/field-chrome.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +13 -38
- package/dist/components/layout/Panel.js.map +1 -1
- package/dist/components/layout/Prefix.js +16 -22
- package/dist/components/layout/Prefix.js.map +1 -1
- package/dist/components/layout/ResizablePanel.js +30 -25
- package/dist/components/layout/ResizablePanel.js.map +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +16 -22
- package/dist/components/layout/Suffix.js.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +2 -2
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +2 -1
- 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 +2 -2
- package/dist/components/navigation/Tabs/TabPanel.js.map +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +62 -68
- package/dist/components/navigation/Tabs/TabPicker.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +6 -9
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +20 -17
- 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 +6 -6
- package/dist/components/other/Calendar/CalendarCell.js.map +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 +3 -3
- package/dist/components/other/Calendar/CalendarPanel.js.map +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +6 -6
- package/dist/components/other/Calendar/PeriodGrid.js.map +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +4 -4
- package/dist/components/other/Calendar/styled.js.map +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +3 -4
- package/dist/components/other/CubeLogo/CubeLogo.js.map +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js.map +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Dialog/use-retained-dialog-focus.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +3 -3
- package/dist/components/overlays/Modal/Modal.js.map +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/Popover.js.map +1 -1
- package/dist/components/overlays/Modal/Tray.js +5 -6
- package/dist/components/overlays/Modal/Tray.js.map +1 -1
- package/dist/components/overlays/Modal/Underlay.js +2 -2
- package/dist/components/overlays/Modal/Underlay.js.map +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +28 -13
- package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +8 -6
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +58 -57
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js.map +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/Cube.js.map +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +153 -188
- package/dist/data/item-themes.js.map +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +2 -2
- package/dist/eslint-plugin/defaults.generated.js.map +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +25 -22
- package/dist/icons/DirectionIcon.js.map +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 +21 -38
- package/dist/icons/Icon.js.map +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 +7 -2
- package/dist/icons/PlayCircleIcon.js.map +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +12 -2
- package/dist/tokens/base.js.map +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +4 -4
- package/dist/tokens/colors.js.map +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/palette.js.map +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/resolve.js.map +1 -1
- package/dist/tokens/shadows.d.ts +0 -1
- package/dist/tokens/shadows.js +2 -3
- package/dist/tokens/shadows.js.map +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +3 -3
- package/docs/BaseProperties.md +2 -0
- package/docs/ComplexLayout.md +1 -1
- package/docs/Usage.md +47 -2
- package/docs/Utilities.md +5 -2
- package/docs/components/GridProvider.md +3 -3
- package/docs/components/content/HotKeys.md +2 -2
- package/docs/components/content/InlineInput.md +2 -2
- package/docs/components/content/Item.md +5 -5
- package/docs/components/content/Layout.md +8 -8
- package/docs/components/content/Text.md +1 -1
- package/docs/components/fields/ComboBox.md +1 -1
- package/docs/components/fields/CommandTextArea.md +1 -1
- package/docs/components/fields/FilterListBox.md +1 -1
- package/docs/components/fields/FilterPicker.md +1 -1
- package/docs/components/fields/ListBox.md +2 -2
- package/docs/components/fields/Picker.md +1 -1
- package/docs/components/fields/SearchComboBox.md +1 -1
- package/docs/components/fields/Select.md +1 -1
- package/docs/components/fields/TagInput.md +1 -1
- package/docs/tasty/react-api.md +1 -1
- package/package.json +3 -3
- package/tasty.config.ts +206 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemActionsWrapper.js","names":["ClearPressResponder","Mods","Styles","tasty","CSSProperties","HTMLAttributes","ReactNode","useLayoutEffect","useRef","useState","useFocusWithin","useHover","ITEM_RESTING_COLOR_VARIANTS","resolveItemVariant","ROW_STATE_ALIASES","CubeItemProps","DisplayTransition","ItemActionProvider","ItemActionsWrapperElement","variants","styles","display","position","placeContent","placeItems","$size","Actions","$","inset","gap","pointerEvents","padding","height","opacity","translate","transition","ActionsChild","ActionIcon","flexShrink","width","preset","ItemActionIcon","props","_c","t0","children","ItemActionsWrapperProps","state","showActions","skipActionsWidthTransition","actions","type","theme","size","isDisabled","disableActionsFocus","autoHideActions","preserveActionsSpace","mods","actionsProps","HTMLDivElement","ItemActionsWrapper","t1","t2","t3","t4","undefined","actionsRef","actionsWidth","setActionsWidth","areActionsVisible","setAreActionsVisible","skipWidthTransition","setSkipWidthTransition","isMountPassRef","t5","el","current","isMountPass","childElementCount","Math","round","offsetWidth","t6","isFocusWithin","setIsFocusWithin","hasPressed","setHasPressed","t7","Symbol","for","hoverProps","isHovered","t8","onFocusWithinChange","focusWithinProps","t9","actionsEl","checkPressed","querySelector","observer","MutationObserver","observe","attributes","attributeFilter","subtree","disconnect","t10","shouldShowActions","t11","t12","t13","disabled","finalMods","t14","t15","t16","t17","t18","t19","t20","phase","t21","ref","transitionRef","node","t22","_c"],"sources":["../../../src/components/actions/ItemActionsWrapper.tsx"],"sourcesContent":["import { ClearPressResponder } from '@react-aria/interactions';\nimport { Mods, Styles, tasty } from '@tenphi/tasty';\nimport {\n CSSProperties,\n HTMLAttributes,\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { useFocusWithin, useHover } from 'react-aria';\n\nimport {\n ITEM_RESTING_COLOR_VARIANTS,\n resolveItemVariant,\n ROW_STATE_ALIASES,\n} from '../../data/item-themes';\nimport { CubeItemProps } from '../content/Item/Item';\nimport { DisplayTransition } from '../helpers/DisplayTransition/DisplayTransition';\n\nimport { ItemActionProvider } from './ItemActionContext';\n\n/**\n * The sibling-actions layout shared by `ItemButton` and the field triggers\n * (`Select` / `Picker` / `FilterPicker`).\n *\n * A row's actions cannot live inside the row when the row is itself a button:\n * that nests a `<button>` in a `<button>`, and a press on an action activates\n * the row. So the run is rendered as a SIBLING, laid over the row's trailing\n * end, and the row reserves the space for it through `--actions-width` — which\n * this file measures — and `Item`'s own `actions` placeholder column.\n *\n * The run is pointer-transparent; only its children take presses. That is what\n * lets a picker put its non-interactive caret in the run and still have a click\n * on the caret reach the trigger underneath, and it stops the run's padding and\n * inter-action gaps from swallowing presses meant for the row.\n *\n * Being a sibling also puts the run OUTSIDE the row for anything that asks\n * \"did this press land on my trigger?\" — an overlay opened by the row would\n * read a press on its own actions as a press outside and dismiss itself,\n * swallowing that press on the way. The run therefore marks itself with\n * `data-trigger-action`, which `isOwnActionsPress` resolves back to the row it\n * belongs to. See `actions-run.ts`.\n */\nconst ItemActionsWrapperElement = tasty({\n // Actions default to the `current` type, which paints from the inherited\n // `currentcolor` — but they are rendered as a SIBLING of the row here, not\n // inside it, so without this they would inherit the page color instead of the\n // row's. Harmless on the default theme (the two match) and plainly wrong on\n // any other: a `special` row would hand its actions the page's dark text to\n // tint with, on a dark purple surface. The variant carries the row's resting\n // color down so `currentcolor` means the same thing it does inside an `Item`.\n variants: ITEM_RESTING_COLOR_VARIANTS,\n styles: {\n // The row is the wrapper's own child, so the wrapper can read the one\n // interaction the row expresses as a COLOR change rather than a fill change.\n // Without it the label darkened under the finger while the caret and the\n // actions laid over the same row — which paint from the color this element\n // hands down — stayed at their resting tint. The variants restate it,\n // because that is where the colors keyed on it live.\n // eslint-disable-next-line tasty/no-style-spread -- shared with ITEM_RESTING_COLOR_VARIANTS, which declare the same states\n ...ROW_STATE_ALIASES,\n\n // The one layout the row does not want its actions centred in. A block\n // description stacks under the label and can make the row arbitrarily tall;\n // there the actions belong in the first line, beside the label, which is\n // what anchoring them to a `$size`-tall box at the top achieves. Every other\n // row — including one with an INLINE description — is a single band, and\n // centring is both what it wants and what survives a caller overriding the\n // height. Read off the row rather than plumbed through as a prop, because\n // `Item` is what decides the placement and it defaults by type.\n '@block-description': ':has(> [data-description=\"block\"])',\n\n display: 'grid',\n position: 'relative',\n placeContent: 'stretch',\n placeItems: 'stretch',\n\n $size: {\n '': '$size-md',\n 'size=xsmall': '$size-xs',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n 'size=xlarge': '$size-xl',\n },\n\n Actions: {\n $: '>',\n position: 'absolute',\n // Both insets set, so the run's BOX spans the row and `placeItems: center`\n // puts the actions on its centre line. What sits in the box does not grow\n // with it — every child is a fixed `$action-size`, which is capped so a\n // large row does not get oversized buttons.\n inset: {\n '': '1bw right dock',\n 'type=card': '(1bw + .5x) right dock',\n '@block-description': '1bw 1bw auto auto',\n 'type=card & @block-description': '(1bw + .5x) (1bw + .5x) auto auto',\n },\n display: 'flex',\n gap: '1bw',\n placeItems: 'center',\n placeContent: 'center end',\n\n // The run lies OVER the row. Left opaque, its padding and the gaps between\n // its actions eat presses that belong to the row behind it, and a\n // non-interactive control inside it (a picker's caret) could never reach\n // its own trigger. The run itself is therefore transparent to the pointer\n // and its children opt back in — see `ActionsChild` — so a child that\n // wants to stay transparent, like that caret, only has to say so.\n pointerEvents: 'none',\n\n padding: '0 $side-padding',\n // Only where the run is top-anchored: there the box has no bottom to\n // measure from, so `$size` is what gives it one. Everywhere else the two\n // insets decide the height, and this floor would force the box back to\n // `$size` and re-anchor it at the top.\n height: {\n '': 'min 0',\n '@block-description': 'min ($size - 2bw)',\n },\n opacity: {\n '': 1,\n '!actions-shown': 0,\n },\n // The run slides in as it fades, but only where it was taking no space to\n // begin with. Where the space is reserved the run has a fixed place in the\n // layout, and sliding it would read as the actions drifting rather than\n // appearing.\n translate: {\n '': '0 0',\n '!actions-shown & !preserve-actions-space': '.5x 0',\n },\n transition: 'theme, translate',\n\n // Size for the action buttons\n '$action-size': 'min(max((2x + 2bw), ($size - 1x - 2bw)), (3x - 2bw))',\n // Side padding for the button\n '$side-padding': '(($size - $action-size - 2bw) / 2)',\n },\n\n // Whatever a caller put in the run: interactive again, so the transparency\n // above applies only to the space BETWEEN and AROUND the actions. `*`\n // because the run's content is the caller's — there is no element name to\n // key on.\n ActionsChild: {\n $: '>Actions>*',\n pointerEvents: {\n '': 'auto',\n '!actions-shown': 'none',\n },\n },\n\n // A non-interactive box in the run, the same size as an action so it lines\n // up with one. `$side-padding + $action-size / 2` collapses to\n // `($size - 2bw) / 2` — the centre of `Item`'s own `rightIcon` square — so a\n // caret moved out of that slot and into the run does not move on screen.\n ActionIcon: {\n $: '>Actions>',\n display: 'grid',\n placeItems: 'center',\n placeContent: 'center',\n flexShrink: 0,\n width: '$action-size',\n height: '$action-size',\n // The run's children are interactive by default; this one is not, and a\n // press on it belongs to the row underneath.\n pointerEvents: 'none',\n // `--icon-size` comes from the preset, and the run is outside the row that\n // sets one — so the box restates the ladder `Item` uses. The `m` weights a\n // non-`item` type picks carry the same icon size as their plain\n // counterparts, so weight is not a factor here.\n preset: {\n '': 't3',\n 'size=xsmall': 't4',\n 'size=xlarge': 't2',\n },\n },\n },\n});\n\n/**\n * A non-interactive box inside an actions run — a dropdown caret, a loading\n * spinner. It occupies an action's footprint so the run stays evenly spaced,\n * and it lets presses through to the row behind it.\n */\nexport function ItemActionIcon(props: { children: ReactNode }) {\n return <div data-element=\"ActionIcon\">{props.children}</div>;\n}\n\nexport interface ItemActionsWrapperProps {\n /**\n * The row or trigger the actions are laid over. Receives the resolved\n * visibility so it can reserve space for the run while it is shown, and\n * whether the reserved width must jump rather than animate (`Item`'s\n * `skipActionsWidthTransition`).\n */\n children: (state: {\n showActions: boolean;\n skipActionsWidthTransition: boolean;\n }) => ReactNode;\n /**\n * The run's content. Rendering the wrapper with an empty run is supported and\n * costs nothing — the measured width is 0 — which is how a trigger keeps its\n * markup stable across states that do and do not have trailing controls.\n */\n actions?: ReactNode;\n type?: string;\n theme?: string;\n /** `Item`'s size token, or a pixel number. */\n size?: CubeItemProps['size'];\n isDisabled?: boolean;\n disableActionsFocus?: boolean;\n /**\n * Hide the actions until the row is hovered, focused, or holds a pressed\n * control.\n * @default false\n */\n autoHideActions?: boolean;\n /**\n * Keep the run's width reserved while it is hidden, so the row does not\n * change size as the actions come and go. Only meaningful with\n * `autoHideActions`.\n *\n * It also keeps the run MOUNTED rather than transitioning it in and out:\n * an unmounted run cannot be measured, so a row that starts hidden would\n * have nothing to reserve.\n * @default false\n */\n preserveActionsSpace?: boolean;\n /** Extra modifiers for the wrapper, merged after the ones it derives itself. */\n mods?: Mods;\n /** Styles for the wrapper element — the one that is the row's layout box. */\n styles?: Styles;\n /** Extra props spread on the run's container, e.g. event handlers. */\n actionsProps?: HTMLAttributes<HTMLDivElement>;\n}\n\n/**\n * Wraps a row in the sibling-actions layout and publishes `--actions-width` so\n * the row can reserve the space the run covers.\n */\nexport function ItemActionsWrapper(props: ItemActionsWrapperProps) {\n const {\n children,\n actions,\n type = 'item',\n theme = 'default',\n size = 'medium',\n isDisabled,\n disableActionsFocus,\n autoHideActions = false,\n preserveActionsSpace = false,\n mods,\n styles,\n actionsProps,\n } = props;\n\n const actionsRef = useRef<HTMLDivElement>(null);\n const [actionsWidth, setActionsWidth] = useState(0);\n const [areActionsVisible, setAreActionsVisible] = useState(false);\n const [skipWidthTransition, setSkipWidthTransition] = useState(false);\n const isMountPassRef = useRef(true);\n\n useLayoutEffect(() => {\n const el = actionsRef.current;\n const isMountPass = isMountPassRef.current;\n\n isMountPassRef.current = false;\n\n if (!el) return;\n\n // An empty run still has the container's side padding, which would reserve\n // space inside the row for nothing. Nothing rendered means nothing to\n // reserve.\n const width = el.childElementCount ? Math.round(el.offsetWidth) : 0;\n\n if (width !== actionsWidth) {\n // The width a run reports on mount is where the row starts, not a change\n // to it. The `offsetWidth` read has already resolved the row at 0px, so\n // publishing with the transition on made every trigger grow by its caret\n // after mounting — and a click in that window sized FilterPicker's popover\n // from a half-grown trigger. A run revealed later still slides open.\n if (isMountPass) setSkipWidthTransition(true);\n setActionsWidth(width);\n } else if (skipWidthTransition) {\n // This pass's read resolved the row at its final width with the\n // transition off, so turning it back on animates nothing.\n setSkipWidthTransition(false);\n }\n }, [actions, areActionsVisible, actionsWidth, skipWidthTransition]);\n\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const [hasPressed, setHasPressed] = useState(false);\n const { hoverProps, isHovered } = useHover({});\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: setIsFocusWithin,\n });\n\n // Watch for data-pressed attribute on any descendant element\n useLayoutEffect(() => {\n const actionsEl = actionsRef.current;\n\n if (!actionsEl || !autoHideActions) return;\n\n const checkPressed = () => {\n setHasPressed(actionsEl.querySelector('[data-pressed]') !== null);\n };\n\n const observer = new MutationObserver(checkPressed);\n\n observer.observe(actionsEl, {\n attributes: true,\n attributeFilter: ['data-pressed'],\n subtree: true,\n });\n\n checkPressed();\n\n return () => observer.disconnect();\n }, [areActionsVisible, autoHideActions]);\n\n const shouldShowActions =\n isHovered || isFocusWithin || hasPressed || !autoHideActions;\n\n // `disabled` is on the wrapper so its variant can paint the row's DISABLED\n // label color, not just the resting one. Actions default to the `current` type\n // and suppress their own fade when the disabled state is inherited — on the\n // grounds that the host already faded the color they paint from — so without\n // this the wrapper would hand them a full-strength color and a disabled button\n // would sit next to full-strength actions. See `ITEM_RESTING_COLOR_VARIANTS`.\n const finalMods = {\n ...mods,\n ...(shouldShowActions ? { 'actions-shown': true } : null),\n ...(preserveActionsSpace ? { 'preserve-actions-space': true } : null),\n disabled: isDisabled,\n };\n\n return (\n <ItemActionsWrapperElement\n {...hoverProps}\n // The same resolver `Item` uses, so the wrapper cannot land on a\n // different variant than the row it wraps.\n variant={resolveItemVariant(theme, type)}\n data-size={size}\n data-type={type}\n data-theme={theme}\n mods={finalMods}\n styles={styles}\n style={\n {\n '--actions-width':\n areActionsVisible || !autoHideActions || preserveActionsSpace\n ? `${actionsWidth}px`\n : '0px',\n ...(typeof size === 'number' && { '--size': `${size}px` }),\n } as CSSProperties\n }\n >\n {children({\n showActions: shouldShowActions,\n skipActionsWidthTransition: skipWidthTransition,\n })}\n {/*\n The run is rendered under whatever press context the row sits in, and a\n `PressResponder` in that context reaches EVERY `usePress` below it — so\n an `ItemButton` / `TabButton` / picker trigger inside a `DialogTrigger`\n or a `MenuTrigger` handed its own actions the trigger's `onPress`, and\n pressing one toggled the overlay on top of running the action. The run\n belongs to the row, not to whatever opened around it: it clears the\n context so each action answers only to its own handler.\n */}\n <ClearPressResponder>\n <ItemActionProvider\n type={type}\n theme={theme}\n disableActionsFocus={disableActionsFocus}\n isDisabled={isDisabled}\n >\n {autoHideActions && !preserveActionsSpace ? (\n <DisplayTransition\n exposeUnmounted\n isShown={shouldShowActions}\n onPhaseChange={(phase) => {\n setAreActionsVisible(phase !== 'unmounted');\n }}\n >\n {({ ref: transitionRef }) => {\n return (\n <div\n {...focusWithinProps}\n {...actionsProps}\n ref={(node: any) => {\n actionsRef.current = node;\n transitionRef(node);\n }}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n );\n }}\n </DisplayTransition>\n ) : (\n <div\n ref={actionsRef}\n {...actionsProps}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n )}\n </ItemActionProvider>\n </ClearPressResponder>\n </ItemActionsWrapperElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMkB,4BAA4Bf,MAAM;CAQtCgB,UAAUP;CACVQ,QAAQ;EAQN,GAAGN;EAUH,sBAAsB;EAEtBO,SAAS;EACTC,UAAU;EACVC,cAAc;EACdC,YAAY;EAEZC,OAAO;GACL,IAAI;GACJ,eAAe;GACf,cAAc;GACd,eAAe;GACf,cAAc;GACd,eAAe;EACjB;EAEAC,SAAS;GACPC,GAAG;GACHL,UAAU;GAKVM,OAAO;IACL,IAAI;IACJ,aAAa;IACb,sBAAsB;IACtB,kCAAkC;GACpC;GACAP,SAAS;GACTQ,KAAK;GACLL,YAAY;GACZD,cAAc;GAQdO,eAAe;GAEfC,SAAS;GAKTC,QAAQ;IACN,IAAI;IACJ,sBAAsB;GACxB;GACAC,SAAS;I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CLuE,MAAA,oBAAC,qBAAD,EAAA,UACE,oBAAC,oBAAD;GACQvE;GACCC;GACcG;GACTD;GAEXkE,UAAAA;EANgB,CAAA,EADD,CAAA;EA2CE7F,EAAA,MAAA4B;EAAA5B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA6F;EAAA7F,EAAA,MAAAyB;EAAAzB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA+F;CAAA,OAAAA,MAAA/F,EAAA;CAAA,IAAAmG;CAAA,IAAAnG,EAAA,QAAAsF,aAAAtF,EAAA,QAAAgE,cAAAhE,EAAA,QAAA0B,QAAA1B,EAAA,QAAAP,UAAAO,EAAA,QAAAuF,OAAAvF,EAAA,QAAA2F,OAAA3F,EAAA,QAAA4F,OAAA5F,EAAA,QAAA+F,OAAA/F,EAAA,QAAAyB,SAAAzB,EAAA,QAAAwB,MAAA;EA5ExB2E,MAAA,qBAAC,2BAAD;GAA0B,GACpBnC;GAGK,SAAAuB;GACE7D,aAAAA;GACAF,aAAAA;GACCC,cAAAA;GACN6D,MAAAA;GACE7F;GAEN,OAAAkG;GAXJ,UAAA,CAoBGC,KAaDG,GAjCwB;;EA6EE/F,EAAA,MAAAsF;EAAAtF,EAAA,MAAAgE;EAAAhE,EAAA,MAAA0B;EAAA1B,EAAA,MAAAP;EAAAO,EAAA,MAAAuF;EAAAvF,EAAA,MAAA2F;EAAA3F,EAAA,MAAA4F;EAAA5F,EAAA,MAAA+F;EAAA/F,EAAA,MAAAyB;EAAAzB,EAAA,MAAAwB;EAAAxB,EAAA,MAAAmG;CAAA,OAAAA,MAAAnG,EAAA;CAAA,OA7E5BmG;AA6E4B"}
|
|
1
|
+
{"version":3,"file":"ItemActionsWrapper.js","names":["ClearPressResponder","mergeStyles","Mods","Styles","tasty","HTMLAttributes","ReactNode","useLayoutEffect","useRef","useState","useFocusWithin","useHover","ITEM_RESTING_COLOR_VARIANTS","resolveItemVariant","ROW_STATE_ALIASES","CubeItemProps","DisplayTransition","ItemActionProvider","ItemActionsWrapperElement","variants","styles","display","position","placeContent","placeItems","$size","Actions","$","inset","gap","pointerEvents","padding","height","opacity","translate","transition","ActionsChild","ActionIcon","flexShrink","width","preset","ItemActionIcon","props","_c","t0","children","ItemActionsWrapperProps","state","showActions","skipActionsWidthTransition","actions","type","theme","size","isDisabled","disableActionsFocus","autoHideActions","preserveActionsSpace","mods","actionsProps","HTMLDivElement","ItemActionsWrapper","t1","t2","t3","t4","undefined","actionsRef","actionsWidth","setActionsWidth","areActionsVisible","setAreActionsVisible","skipWidthTransition","setSkipWidthTransition","isMountPassRef","t5","el","current","isMountPass","childElementCount","Math","round","offsetWidth","t6","isFocusWithin","setIsFocusWithin","hasPressed","setHasPressed","t7","Symbol","for","hoverProps","isHovered","t8","onFocusWithinChange","focusWithinProps","t9","actionsEl","checkPressed","querySelector","observer","MutationObserver","observe","attributes","attributeFilter","subtree","disconnect","t10","shouldShowActions","t11","t12","t13","disabled","finalMods","t14","t15","t16","t17","t18","t19","phase","t20","ref","transitionRef","node","t21","_c"],"sources":["../../../src/components/actions/ItemActionsWrapper.tsx"],"sourcesContent":["import { ClearPressResponder } from '@react-aria/interactions';\nimport { mergeStyles, Mods, Styles, tasty } from '@tenphi/tasty';\nimport {\n HTMLAttributes,\n ReactNode,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport { useFocusWithin, useHover } from 'react-aria';\n\nimport {\n ITEM_RESTING_COLOR_VARIANTS,\n resolveItemVariant,\n ROW_STATE_ALIASES,\n} from '../../data/item-themes';\nimport { CubeItemProps } from '../content/Item/Item';\nimport { DisplayTransition } from '../helpers/DisplayTransition/DisplayTransition';\n\nimport { ItemActionProvider } from './ItemActionContext';\n\n/**\n * The sibling-actions layout shared by `ItemButton` and the field triggers\n * (`Select` / `Picker` / `FilterPicker`).\n *\n * A row's actions cannot live inside the row when the row is itself a button:\n * that nests a `<button>` in a `<button>`, and a press on an action activates\n * the row. So the run is rendered as a SIBLING, laid over the row's trailing\n * end, and the row reserves the space for it through `--actions-width` — which\n * this file measures — and `Item`'s own `actions` placeholder column.\n *\n * The run is pointer-transparent; only its children take presses. That is what\n * lets a picker put its non-interactive caret in the run and still have a click\n * on the caret reach the trigger underneath, and it stops the run's padding and\n * inter-action gaps from swallowing presses meant for the row.\n *\n * Being a sibling also puts the run OUTSIDE the row for anything that asks\n * \"did this press land on my trigger?\" — an overlay opened by the row would\n * read a press on its own actions as a press outside and dismiss itself,\n * swallowing that press on the way. The run therefore marks itself with\n * `data-trigger-action`, which `isOwnActionsPress` resolves back to the row it\n * belongs to. See `actions-run.ts`.\n */\nconst ItemActionsWrapperElement = tasty({\n // Actions default to the `current` type, which paints from the inherited\n // `currentcolor` — but they are rendered as a SIBLING of the row here, not\n // inside it, so without this they would inherit the page color instead of the\n // row's. Harmless on the default theme (the two match) and plainly wrong on\n // any other: a `special` row would hand its actions the page's dark text to\n // tint with, on a dark purple surface. The variant carries the row's resting\n // color down so `currentcolor` means the same thing it does inside an `Item`.\n variants: ITEM_RESTING_COLOR_VARIANTS,\n // `ROW_STATE_ALIASES`: the row is the wrapper's own child, so the wrapper can\n // read the one interaction the row expresses as a COLOR change rather than a\n // fill change. Without it the label darkened under the finger while the caret\n // and the actions laid over the same row — which paint from the color this\n // element hands down — stayed at their resting tint. The variants restate it,\n // because that is where the colors keyed on it live.\n styles: mergeStyles(ROW_STATE_ALIASES, {\n // The one layout the row does not want its actions centred in. A block\n // description stacks under the label and can make the row arbitrarily tall;\n // there the actions belong in the first line, beside the label, which is\n // what anchoring them to a `$size`-tall box at the top achieves. Every other\n // row — including one with an INLINE description — is a single band, and\n // centring is both what it wants and what survives a caller overriding the\n // height. Read off the row rather than plumbed through as a prop, because\n // `Item` is what decides the placement and it defaults by type.\n '@block-description': ':has(> [data-description=\"block\"])',\n\n display: 'grid',\n position: 'relative',\n placeContent: 'stretch',\n placeItems: 'stretch',\n\n $size: {\n '': '$size-md',\n 'size=xsmall': '$size-xs',\n 'size=small': '$size-sm',\n 'size=medium': '$size-md',\n 'size=large': '$size-lg',\n 'size=xlarge': '$size-xl',\n },\n\n Actions: {\n $: '>',\n position: 'absolute',\n // Both insets set, so the run's BOX spans the row and `placeItems: center`\n // puts the actions on its centre line. What sits in the box does not grow\n // with it — every child is a fixed `$action-size`, which is capped so a\n // large row does not get oversized buttons.\n inset: {\n '': '1bw right dock',\n 'type=card': '(1bw + .5x) right dock',\n '@block-description': '1bw 1bw auto auto',\n 'type=card & @block-description': '(1bw + .5x) (1bw + .5x) auto auto',\n },\n display: 'flex',\n gap: '$item-gap',\n placeItems: 'center',\n placeContent: 'center end',\n\n // The run lies OVER the row. Left opaque, its padding and the gaps between\n // its actions eat presses that belong to the row behind it, and a\n // non-interactive control inside it (a picker's caret) could never reach\n // its own trigger. The run itself is therefore transparent to the pointer\n // and its children opt back in — see `ActionsChild` — so a child that\n // wants to stay transparent, like that caret, only has to say so.\n pointerEvents: 'none',\n\n padding: '0 $side-padding',\n // Only where the run is top-anchored: there the box has no bottom to\n // measure from, so `$size` is what gives it one. Everywhere else the two\n // insets decide the height, and this floor would force the box back to\n // `$size` and re-anchor it at the top.\n height: {\n '': 'min 0',\n '@block-description': 'min ($size - 2bw)',\n },\n opacity: {\n '': 1,\n '!actions-shown': 0,\n },\n // The run slides in as it fades, but only where it was taking no space to\n // begin with. Where the space is reserved the run has a fixed place in the\n // layout, and sliding it would read as the actions drifting rather than\n // appearing.\n translate: {\n '': '0 0',\n '!actions-shown & !preserve-actions-space': '.5x 0',\n },\n transition: 'theme, translate',\n\n // Size for the action buttons\n '$action-size': 'min(max((2x + 2bw), ($size - 1x - 2bw)), (3x - 2bw))',\n // Side padding for the button\n '$side-padding': '(($size - $action-size - 2bw) / 2)',\n },\n\n // Whatever a caller put in the run: interactive again, so the transparency\n // above applies only to the space BETWEEN and AROUND the actions. `*`\n // because the run's content is the caller's — there is no element name to\n // key on.\n ActionsChild: {\n $: '>Actions>*',\n pointerEvents: {\n '': 'auto',\n '!actions-shown': 'none',\n },\n },\n\n // A non-interactive box in the run, the same size as an action so it lines\n // up with one. `$side-padding + $action-size / 2` collapses to\n // `($size - 2bw) / 2` — the centre of `Item`'s own `rightIcon` square — so a\n // caret moved out of that slot and into the run does not move on screen.\n ActionIcon: {\n $: '>Actions>',\n display: 'grid',\n placeItems: 'center',\n placeContent: 'center',\n flexShrink: 0,\n width: '$action-size',\n height: '$action-size',\n // The run's children are interactive by default; this one is not, and a\n // press on it belongs to the row underneath.\n pointerEvents: 'none',\n // `--icon-size` comes from the preset, and the run is outside the row that\n // sets one — so the box restates the ladder `Item` uses. The `m` weights a\n // non-`item` type picks carry the same icon size as their plain\n // counterparts, so weight is not a factor here.\n preset: {\n '': 't3',\n 'size=xsmall': 't4',\n 'size=xlarge': 't2',\n },\n },\n }),\n});\n\n/**\n * A non-interactive box inside an actions run — a dropdown caret, a loading\n * spinner. It occupies an action's footprint so the run stays evenly spaced,\n * and it lets presses through to the row behind it.\n */\nexport function ItemActionIcon(props: { children: ReactNode }) {\n return <div data-element=\"ActionIcon\">{props.children}</div>;\n}\n\nexport interface ItemActionsWrapperProps {\n /**\n * The row or trigger the actions are laid over. Receives the resolved\n * visibility so it can reserve space for the run while it is shown, and\n * whether the reserved width must jump rather than animate (`Item`'s\n * `skipActionsWidthTransition`).\n */\n children: (state: {\n showActions: boolean;\n skipActionsWidthTransition: boolean;\n }) => ReactNode;\n /**\n * The run's content. Rendering the wrapper with an empty run is supported and\n * costs nothing — the measured width is 0 — which is how a trigger keeps its\n * markup stable across states that do and do not have trailing controls.\n */\n actions?: ReactNode;\n type?: string;\n theme?: string;\n /** `Item`'s size token, or a pixel number. */\n size?: CubeItemProps['size'];\n isDisabled?: boolean;\n disableActionsFocus?: boolean;\n /**\n * Hide the actions until the row is hovered, focused, or holds a pressed\n * control.\n * @default false\n */\n autoHideActions?: boolean;\n /**\n * Keep the run's width reserved while it is hidden, so the row does not\n * change size as the actions come and go. Only meaningful with\n * `autoHideActions`.\n *\n * It also keeps the run MOUNTED rather than transitioning it in and out:\n * an unmounted run cannot be measured, so a row that starts hidden would\n * have nothing to reserve.\n * @default false\n */\n preserveActionsSpace?: boolean;\n /** Extra modifiers for the wrapper, merged after the ones it derives itself. */\n mods?: Mods;\n /** Styles for the wrapper element — the one that is the row's layout box. */\n styles?: Styles;\n /** Extra props spread on the run's container, e.g. event handlers. */\n actionsProps?: HTMLAttributes<HTMLDivElement>;\n}\n\n/**\n * Wraps a row in the sibling-actions layout and publishes `--actions-width` so\n * the row can reserve the space the run covers.\n */\nexport function ItemActionsWrapper(props: ItemActionsWrapperProps) {\n const {\n children,\n actions,\n type = 'item',\n theme = 'default',\n size = 'medium',\n isDisabled,\n disableActionsFocus,\n autoHideActions = false,\n preserveActionsSpace = false,\n mods,\n styles,\n actionsProps,\n } = props;\n\n const actionsRef = useRef<HTMLDivElement>(null);\n const [actionsWidth, setActionsWidth] = useState(0);\n const [areActionsVisible, setAreActionsVisible] = useState(false);\n const [skipWidthTransition, setSkipWidthTransition] = useState(false);\n const isMountPassRef = useRef(true);\n\n useLayoutEffect(() => {\n const el = actionsRef.current;\n const isMountPass = isMountPassRef.current;\n\n isMountPassRef.current = false;\n\n if (!el) return;\n\n // An empty run still has the container's side padding, which would reserve\n // space inside the row for nothing. Nothing rendered means nothing to\n // reserve.\n const width = el.childElementCount ? Math.round(el.offsetWidth) : 0;\n\n if (width !== actionsWidth) {\n // The width a run reports on mount is where the row starts, not a change\n // to it. The `offsetWidth` read has already resolved the row at 0px, so\n // publishing with the transition on made every trigger grow by its caret\n // after mounting — and a click in that window sized FilterPicker's popover\n // from a half-grown trigger. A run revealed later still slides open.\n if (isMountPass) setSkipWidthTransition(true);\n setActionsWidth(width);\n } else if (skipWidthTransition) {\n // This pass's read resolved the row at its final width with the\n // transition off, so turning it back on animates nothing.\n setSkipWidthTransition(false);\n }\n }, [actions, areActionsVisible, actionsWidth, skipWidthTransition]);\n\n const [isFocusWithin, setIsFocusWithin] = useState(false);\n const [hasPressed, setHasPressed] = useState(false);\n const { hoverProps, isHovered } = useHover({});\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: setIsFocusWithin,\n });\n\n // Watch for data-pressed attribute on any descendant element\n useLayoutEffect(() => {\n const actionsEl = actionsRef.current;\n\n if (!actionsEl || !autoHideActions) return;\n\n const checkPressed = () => {\n setHasPressed(actionsEl.querySelector('[data-pressed]') !== null);\n };\n\n const observer = new MutationObserver(checkPressed);\n\n observer.observe(actionsEl, {\n attributes: true,\n attributeFilter: ['data-pressed'],\n subtree: true,\n });\n\n checkPressed();\n\n return () => observer.disconnect();\n }, [areActionsVisible, autoHideActions]);\n\n const shouldShowActions =\n isHovered || isFocusWithin || hasPressed || !autoHideActions;\n\n // `disabled` is on the wrapper so its variant can paint the row's DISABLED\n // label color, not just the resting one. Actions default to the `current` type\n // and suppress their own fade when the disabled state is inherited — on the\n // grounds that the host already faded the color they paint from — so without\n // this the wrapper would hand them a full-strength color and a disabled button\n // would sit next to full-strength actions. See `ITEM_RESTING_COLOR_VARIANTS`.\n const finalMods = {\n ...mods,\n ...(shouldShowActions ? { 'actions-shown': true } : null),\n ...(preserveActionsSpace ? { 'preserve-actions-space': true } : null),\n disabled: isDisabled,\n };\n\n return (\n <ItemActionsWrapperElement\n {...hoverProps}\n // The same resolver `Item` uses, so the wrapper cannot land on a\n // different variant than the row it wraps.\n variant={resolveItemVariant(theme, type)}\n data-size={size}\n data-type={type}\n data-theme={theme}\n mods={finalMods}\n styles={styles}\n tokens={{\n '$actions-width':\n areActionsVisible || !autoHideActions || preserveActionsSpace\n ? `${actionsWidth}px`\n : '0px',\n ...(typeof size === 'number' && { $size: `${size}px` }),\n }}\n >\n {children({\n showActions: shouldShowActions,\n skipActionsWidthTransition: skipWidthTransition,\n })}\n {/*\n The run is rendered under whatever press context the row sits in, and a\n `PressResponder` in that context reaches EVERY `usePress` below it — so\n an `ItemButton` / `TabButton` / picker trigger inside a `DialogTrigger`\n or a `MenuTrigger` handed its own actions the trigger's `onPress`, and\n pressing one toggled the overlay on top of running the action. The run\n belongs to the row, not to whatever opened around it: it clears the\n context so each action answers only to its own handler.\n */}\n <ClearPressResponder>\n <ItemActionProvider\n type={type}\n theme={theme}\n disableActionsFocus={disableActionsFocus}\n isDisabled={isDisabled}\n >\n {autoHideActions && !preserveActionsSpace ? (\n <DisplayTransition\n exposeUnmounted\n isShown={shouldShowActions}\n onPhaseChange={(phase) => {\n setAreActionsVisible(phase !== 'unmounted');\n }}\n >\n {({ ref: transitionRef }) => {\n return (\n <div\n {...focusWithinProps}\n {...actionsProps}\n ref={(node: any) => {\n actionsRef.current = node;\n transitionRef(node);\n }}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n );\n }}\n </DisplayTransition>\n ) : (\n <div\n ref={actionsRef}\n {...actionsProps}\n data-element=\"Actions\"\n data-trigger-action=\"\"\n >\n {actions}\n </div>\n )}\n </ItemActionProvider>\n </ClearPressResponder>\n </ItemActionsWrapperElement>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAMkB,4BAA4Bd,MAAM;CAQtCe,UAAUP;CAOVQ,QAAQnB,YAAYa,mBAAmB;EASrC,sBAAsB;EAEtBO,SAAS;EACTC,UAAU;EACVC,cAAc;EACdC,YAAY;EAEZC,OAAO;GACL,IAAI;GACJ,eAAe;GACf,cAAc;GACd,eAAe;GACf,cAAc;GACd,eAAe;EACjB;EAEAC,SAAS;GACPC,GAAG;GACHL,UAAU;GAKVM,OAAO;IACL,IAAI;IACJ,aAAa;IACb,sBAAsB;IACtB,kCAAkC;GACpC;GACAP,SAAS;GACTQ,KAAK;GACLL,YAAY;GACZD,cAAc;GAQdO,eAAe;GAEfC,SAAS;GAKTC,QAAQ;IACN,IAAI;IACJ,sBAAsB;GACxB;GACAC,SAAS;IACP,IAAI;IACJ,kBAAkB;GACpB;GAKAC,WAAW;IACT,IAAI;IACJ,4CAA4C;GAC9C;GACAC,YAAY;GAGZ,gBAAgB;GAEhB,iBAAiB;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,MAAA4B;EAAA5B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4F;EAAA5F,EAAA,MAAAyB;EAAAzB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA8F;CAAA,OAAAA,MAAA9F,EAAA;CAAA,IAAAkG;CAAA,IAAAlG,EAAA,QAAAsF,aAAAtF,EAAA,QAAAgE,cAAAhE,EAAA,QAAA0B,QAAA1B,EAAA,QAAAP,UAAAO,EAAA,QAAAuF,OAAAvF,EAAA,QAAA0F,OAAA1F,EAAA,QAAA2F,OAAA3F,EAAA,QAAA8F,OAAA9F,EAAA,QAAAyB,SAAAzB,EAAA,QAAAwB,MAAA;EA1ExB0E,MAAA,qBAAC,2BAAD;GAA0B,GACpBlC;GAGK,SAAAuB;GACE7D,aAAAA;GACAF,aAAAA;GACCC,cAAAA;GACN6D,MAAAA;GACE7F;GACA,QAAAiG;GAVV,UAAA,CAkBGC,KAaDG,GA/BwB;;EA2EE9F,EAAA,MAAAsF;EAAAtF,EAAA,MAAAgE;EAAAhE,EAAA,MAAA0B;EAAA1B,EAAA,MAAAP;EAAAO,EAAA,MAAAuF;EAAAvF,EAAA,MAAA0F;EAAA1F,EAAA,MAAA2F;EAAA3F,EAAA,MAAA8F;EAAA9F,EAAA,MAAAyB;EAAAzB,EAAA,MAAAwB;EAAAxB,EAAA,MAAAkG;CAAA,OAAAA,MAAAlG,EAAA;CAAA,OA3E5BkG;AA2E4B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.200.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { mergeRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { useDismissParentPopover } from "../../../utils/react/usePopoverSync.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.200.0 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useMenuContext } from "./context.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.200.0 | Cube Dev Team */
|
|
2
2
|
import { normalizeNavigationUrl } from "../../../providers/navigation-url.js";
|
|
3
3
|
import { parseTo } from "../use-action.js";
|
|
4
4
|
import { COLLECTION_ITEM_CLICK, CollectionItem as _CollectionItem } from "../../CollectionItem.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.200.0 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { isExternalUrl, normalizeNavigationUrl } from "../../../providers/navigation-url.js";
|
|
4
4
|
import { useNavigation } from "../../../providers/use-navigation.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.200.0 | Cube Dev Team */
|
|
2
2
|
import { getMenuItemReactKey } from "./MenuCollectionItem.js";
|
|
3
3
|
import { MenuItem } from "./MenuItem.js";
|
|
4
4
|
import { StyledMenu, StyledSection, StyledSectionHeading } from "./styled.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.200.0 | 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";
|
|
@@ -17,7 +17,7 @@ import { PressResponder } from "@react-aria/interactions";
|
|
|
17
17
|
import { useObjectRef } from "@react-aria/utils";
|
|
18
18
|
//#region src/components/actions/Menu/MenuTrigger.tsx
|
|
19
19
|
function MenuTrigger(props, ref) {
|
|
20
|
-
const $ = c(
|
|
20
|
+
const $ = c(88);
|
|
21
21
|
const internalPopoverRef = useRef(null);
|
|
22
22
|
const menuPopoverRef = props.popoverRef ?? internalPopoverRef;
|
|
23
23
|
const trayRef = useRef(null);
|
|
@@ -161,81 +161,70 @@ function MenuTrigger(props, ref) {
|
|
|
161
161
|
}
|
|
162
162
|
useEffect(t14, t15);
|
|
163
163
|
const t16 = state.focusStrategy ?? "first";
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
} : void 0;
|
|
170
|
-
$[35] = isTray;
|
|
171
|
-
$[36] = t17;
|
|
172
|
-
} else t17 = $[36];
|
|
173
|
-
const t18 = !isTray;
|
|
174
|
-
let t19;
|
|
175
|
-
if ($[37] !== isTray || $[38] !== t18) {
|
|
176
|
-
t19 = {
|
|
177
|
-
popover: t18,
|
|
164
|
+
const t17 = !isTray;
|
|
165
|
+
let t18;
|
|
166
|
+
if ($[35] !== isTray || $[36] !== t17) {
|
|
167
|
+
t18 = {
|
|
168
|
+
popover: t17,
|
|
178
169
|
tray: isTray
|
|
179
170
|
};
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
} else
|
|
184
|
-
const
|
|
185
|
-
let
|
|
186
|
-
if ($[
|
|
187
|
-
|
|
171
|
+
$[35] = isTray;
|
|
172
|
+
$[36] = t17;
|
|
173
|
+
$[37] = t18;
|
|
174
|
+
} else t18 = $[37];
|
|
175
|
+
const t19 = !state.isOpen;
|
|
176
|
+
let t20;
|
|
177
|
+
if ($[38] !== closeOnSelect || $[39] !== menuProps || $[40] !== state.close || $[41] !== t16 || $[42] !== t18 || $[43] !== t19) {
|
|
178
|
+
t20 = {
|
|
188
179
|
...menuProps,
|
|
189
180
|
ref: menuRef,
|
|
190
181
|
onClose: state.close,
|
|
191
182
|
closeOnSelect,
|
|
192
183
|
autoFocus: t16,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
isClosing: t20
|
|
184
|
+
mods: t18,
|
|
185
|
+
isClosing: t19
|
|
196
186
|
};
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
187
|
+
$[38] = closeOnSelect;
|
|
188
|
+
$[39] = menuProps;
|
|
189
|
+
$[40] = state.close;
|
|
190
|
+
$[41] = t16;
|
|
191
|
+
$[42] = t18;
|
|
192
|
+
$[43] = t19;
|
|
193
|
+
$[44] = t20;
|
|
194
|
+
} else t20 = $[44];
|
|
195
|
+
const menuContext = t20;
|
|
196
|
+
let t21;
|
|
197
|
+
if ($[45] !== state.close) {
|
|
198
|
+
t21 = /* @__PURE__ */ jsx(DismissButton, { onDismiss: state.close });
|
|
199
|
+
$[45] = state.close;
|
|
200
|
+
$[46] = t21;
|
|
201
|
+
} else t21 = $[46];
|
|
207
202
|
let t22;
|
|
208
|
-
if ($[
|
|
203
|
+
if ($[47] !== state.close) {
|
|
209
204
|
t22 = /* @__PURE__ */ jsx(DismissButton, { onDismiss: state.close });
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
} else t22 = $[
|
|
205
|
+
$[47] = state.close;
|
|
206
|
+
$[48] = t22;
|
|
207
|
+
} else t22 = $[48];
|
|
213
208
|
let t23;
|
|
214
|
-
if ($[50] !==
|
|
215
|
-
t23 = /* @__PURE__ */
|
|
216
|
-
$[50] = state.close;
|
|
217
|
-
$[51] = t23;
|
|
218
|
-
} else t23 = $[51];
|
|
219
|
-
let t24;
|
|
220
|
-
if ($[52] !== menu || $[53] !== shouldRestoreFocus || $[54] !== t22 || $[55] !== t23) {
|
|
221
|
-
t24 = /* @__PURE__ */ jsxs(FocusScope, {
|
|
209
|
+
if ($[49] !== menu || $[50] !== shouldRestoreFocus || $[51] !== t21 || $[52] !== t22) {
|
|
210
|
+
t23 = /* @__PURE__ */ jsxs(FocusScope, {
|
|
222
211
|
restoreFocus: shouldRestoreFocus,
|
|
223
212
|
children: [
|
|
224
|
-
|
|
213
|
+
t21,
|
|
225
214
|
menu,
|
|
226
|
-
|
|
215
|
+
t22
|
|
227
216
|
]
|
|
228
217
|
});
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
234
|
-
} else
|
|
235
|
-
const contents =
|
|
236
|
-
let
|
|
237
|
-
if ($[
|
|
238
|
-
|
|
218
|
+
$[49] = menu;
|
|
219
|
+
$[50] = shouldRestoreFocus;
|
|
220
|
+
$[51] = t21;
|
|
221
|
+
$[52] = t22;
|
|
222
|
+
$[53] = t23;
|
|
223
|
+
} else t23 = $[53];
|
|
224
|
+
const contents = t23;
|
|
225
|
+
let t24;
|
|
226
|
+
if ($[54] !== isDummy || $[55] !== menuTriggerRef || $[56] !== state) {
|
|
227
|
+
t24 = (el) => {
|
|
239
228
|
if (!state.isOpen) return false;
|
|
240
229
|
if (isOwnActionsPress(el, menuTriggerRef.current)) return false;
|
|
241
230
|
const menuTriggerEl = el.closest("[data-popover-trigger]");
|
|
@@ -251,107 +240,107 @@ function MenuTrigger(props, ref) {
|
|
|
251
240
|
if (menuTriggerEl === menuTriggerRef.current) return true;
|
|
252
241
|
return false;
|
|
253
242
|
};
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
} else
|
|
259
|
-
const shouldCloseOnInteractOutside = useEvent(
|
|
243
|
+
$[54] = isDummy;
|
|
244
|
+
$[55] = menuTriggerRef;
|
|
245
|
+
$[56] = state;
|
|
246
|
+
$[57] = t24;
|
|
247
|
+
} else t24 = $[57];
|
|
248
|
+
const shouldCloseOnInteractOutside = useEvent(t24);
|
|
260
249
|
let overlay_0;
|
|
261
250
|
if (isTray) {
|
|
262
|
-
let
|
|
263
|
-
if ($[
|
|
264
|
-
|
|
251
|
+
let t25;
|
|
252
|
+
if ($[58] !== contents || $[59] !== shouldCloseOnInteractOutside || $[60] !== state.close || $[61] !== state.isOpen) {
|
|
253
|
+
t25 = /* @__PURE__ */ jsx(_Tray, {
|
|
265
254
|
ref: trayRef,
|
|
266
255
|
isOpen: state.isOpen,
|
|
267
256
|
shouldCloseOnInteractOutside,
|
|
268
257
|
onClose: state.close,
|
|
269
258
|
children: contents
|
|
270
259
|
});
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
} else
|
|
277
|
-
overlay_0 =
|
|
260
|
+
$[58] = contents;
|
|
261
|
+
$[59] = shouldCloseOnInteractOutside;
|
|
262
|
+
$[60] = state.close;
|
|
263
|
+
$[61] = state.isOpen;
|
|
264
|
+
$[62] = t25;
|
|
265
|
+
} else t25 = $[62];
|
|
266
|
+
overlay_0 = t25;
|
|
278
267
|
} else {
|
|
279
|
-
const
|
|
280
|
-
let
|
|
281
|
-
if ($[
|
|
282
|
-
|
|
268
|
+
const t25 = placement ?? void 0;
|
|
269
|
+
let t26;
|
|
270
|
+
if ($[63] !== contents || $[64] !== menuPopoverRef || $[65] !== positionProps.style || $[66] !== shouldCloseOnInteractOutside || $[67] !== state.close || $[68] !== state.isOpen || $[69] !== t25) {
|
|
271
|
+
t26 = /* @__PURE__ */ jsx(_Popover, {
|
|
283
272
|
ref: menuPopoverRef,
|
|
284
273
|
hideArrow: true,
|
|
285
274
|
isNonModal: true,
|
|
286
275
|
isOpen: state.isOpen,
|
|
287
276
|
style: positionProps.style,
|
|
288
|
-
placement:
|
|
277
|
+
placement: t25,
|
|
289
278
|
shouldCloseOnInteractOutside,
|
|
290
279
|
onClose: state.close,
|
|
291
280
|
children: contents
|
|
292
281
|
});
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
} else
|
|
302
|
-
overlay_0 =
|
|
282
|
+
$[63] = contents;
|
|
283
|
+
$[64] = menuPopoverRef;
|
|
284
|
+
$[65] = positionProps.style;
|
|
285
|
+
$[66] = shouldCloseOnInteractOutside;
|
|
286
|
+
$[67] = state.close;
|
|
287
|
+
$[68] = state.isOpen;
|
|
288
|
+
$[69] = t25;
|
|
289
|
+
$[70] = t26;
|
|
290
|
+
} else t26 = $[70];
|
|
291
|
+
overlay_0 = t26;
|
|
303
292
|
}
|
|
304
|
-
const
|
|
293
|
+
const t25 = trigger === "longPress";
|
|
294
|
+
let t26;
|
|
295
|
+
if ($[71] !== t25) {
|
|
296
|
+
t26 = { actionButton: { holdAffordance: t25 } };
|
|
297
|
+
$[71] = t25;
|
|
298
|
+
$[72] = t26;
|
|
299
|
+
} else t26 = $[72];
|
|
305
300
|
let t27;
|
|
306
|
-
if ($[74] !==
|
|
307
|
-
t27 =
|
|
308
|
-
$[74] = t26;
|
|
309
|
-
$[75] = t27;
|
|
310
|
-
} else t27 = $[75];
|
|
311
|
-
let t28;
|
|
312
|
-
if ($[76] !== isDummy || $[77] !== menuTrigger || $[78] !== menuTriggerProps || $[79] !== menuTriggerRef || $[80] !== state.isOpen) {
|
|
313
|
-
t28 = !isDummy ? /* @__PURE__ */ jsx(PressResponder, {
|
|
301
|
+
if ($[73] !== isDummy || $[74] !== menuTrigger || $[75] !== menuTriggerProps || $[76] !== menuTriggerRef || $[77] !== state.isOpen) {
|
|
302
|
+
t27 = !isDummy ? /* @__PURE__ */ jsx(PressResponder, {
|
|
314
303
|
...menuTriggerProps,
|
|
315
304
|
ref: menuTriggerRef,
|
|
316
305
|
"data-popover-trigger": true,
|
|
317
306
|
isPressed: state.isOpen,
|
|
318
307
|
children: menuTrigger
|
|
319
308
|
}) : null;
|
|
320
|
-
$[
|
|
321
|
-
$[
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
$[
|
|
309
|
+
$[73] = isDummy;
|
|
310
|
+
$[74] = menuTrigger;
|
|
311
|
+
$[75] = menuTriggerProps;
|
|
312
|
+
$[76] = menuTriggerRef;
|
|
313
|
+
$[77] = state.isOpen;
|
|
314
|
+
$[78] = t27;
|
|
315
|
+
} else t27 = $[78];
|
|
316
|
+
let t28;
|
|
317
|
+
if ($[79] !== t26 || $[80] !== t27) {
|
|
318
|
+
t28 = /* @__PURE__ */ jsx(SlotProvider, {
|
|
319
|
+
slots: t26,
|
|
320
|
+
children: t27
|
|
321
|
+
});
|
|
322
|
+
$[79] = t26;
|
|
323
|
+
$[80] = t27;
|
|
325
324
|
$[81] = t28;
|
|
326
325
|
} else t28 = $[81];
|
|
327
326
|
let t29;
|
|
328
|
-
if ($[82] !==
|
|
329
|
-
t29 = /* @__PURE__ */ jsx(
|
|
330
|
-
|
|
331
|
-
children:
|
|
327
|
+
if ($[82] !== menuContext || $[83] !== overlay_0) {
|
|
328
|
+
t29 = /* @__PURE__ */ jsx(MenuContext.Provider, {
|
|
329
|
+
value: menuContext,
|
|
330
|
+
children: overlay_0
|
|
332
331
|
});
|
|
333
|
-
$[82] =
|
|
334
|
-
$[83] =
|
|
332
|
+
$[82] = menuContext;
|
|
333
|
+
$[83] = overlay_0;
|
|
335
334
|
$[84] = t29;
|
|
336
335
|
} else t29 = $[84];
|
|
337
336
|
let t30;
|
|
338
|
-
if ($[85] !==
|
|
339
|
-
t30 = /* @__PURE__ */
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
});
|
|
343
|
-
$[85] = menuContext;
|
|
344
|
-
$[86] = overlay_0;
|
|
337
|
+
if ($[85] !== t28 || $[86] !== t29) {
|
|
338
|
+
t30 = /* @__PURE__ */ jsxs(Fragment, { children: [t28, t29] });
|
|
339
|
+
$[85] = t28;
|
|
340
|
+
$[86] = t29;
|
|
345
341
|
$[87] = t30;
|
|
346
342
|
} else t30 = $[87];
|
|
347
|
-
|
|
348
|
-
if ($[88] !== t29 || $[89] !== t30) {
|
|
349
|
-
t31 = /* @__PURE__ */ jsxs(Fragment, { children: [t29, t30] });
|
|
350
|
-
$[88] = t29;
|
|
351
|
-
$[89] = t30;
|
|
352
|
-
$[90] = t31;
|
|
353
|
-
} else t31 = $[90];
|
|
354
|
-
return t31;
|
|
343
|
+
return t30;
|
|
355
344
|
}
|
|
356
345
|
/**
|
|
357
346
|
* The MenuTrigger serves as a wrapper around a Menu and its associated trigger,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuTrigger.js","names":["PressResponder","useObjectRef","useIsMobileDevice","forwardRef","Fragment","MutableRefObject","ReactElement","Ref","RefObject","useEffect","useMemo","useRef","AriaMenuTriggerProps","DismissButton","FocusScope","Placement","PositionProps","useMenuTrigger","useOverlayPosition","MenuTriggerState","useMenuTriggerState","useEvent","generateRandomId","SlotProvider","usePopoverSync","Popover","Tray","isOwnActionsPress","MenuContext","MenuContextValue","CubeMenuTriggerProps","Omit","isDisabled","defaultOpen","onOpenChange","isOpen","targetRef","HTMLElement","children","state","closeOnSelect","isDummy","shouldRestoreFocus","popoverRef","HTMLDivElement","mobileType","MenuTrigger","props","ref","$","_c","internalPopoverRef","menuPopoverRef","trayRef","triggerRef","domRef","menuTriggerRef","menuRef","wasOpenRef","shouldFlip","t0","trigger","t1","t2","t3","undefined","t4","Symbol","for","menuId","Array","isArray","length","Error","menuTrigger","menu","t5","close","t6","t7","onClose","enabled","containerRef","t8","menuTriggerProps","menuProps","initialPlacement","placement","isMobileDevice","isTray","t9","t10","offset","t11","crossOffset","t12","containerPadding","overlayRef","scrollRef","overlayProps","positionProps","t13","activeElement","document","body","isConnected","overlay","current","contains","hasFocusMovedOutsideMenu","t14","t15","setTimeout","focus","t16","focusStrategy","t17","width","maxHeight","t18","t19","popover","tray","t20","t21","autoFocus","style","mods","isClosing","menuContext","t22","t23","t24","contents","t25","el","menuTriggerEl","closest","shouldCloseOnInteractOutside","t26","t27","actionButton","holdAffordance","t28","t29","t30","overlay_0","t31","_MenuTrigger","displayName","_c","Tray","Popover"],"sources":["../../../../src/components/actions/Menu/MenuTrigger.tsx"],"sourcesContent":["import { PressResponder } from '@react-aria/interactions';\nimport { useObjectRef } from '@react-aria/utils';\nimport { useIsMobileDevice } from '@react-spectrum/utils';\nimport {\n forwardRef,\n Fragment,\n MutableRefObject,\n ReactElement,\n Ref,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n FocusScope,\n Placement,\n PositionProps,\n useMenuTrigger,\n useOverlayPosition,\n} from 'react-aria';\nimport { MenuTriggerState, useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { generateRandomId } from '../../../utils/random';\nimport { SlotProvider } from '../../../utils/react';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover, Tray } from '../../overlays/Modal';\nimport { isOwnActionsPress } from '../actions-run';\n\nimport { MenuContext, MenuContextValue } from './context';\n\nexport type { AriaMenuTriggerProps };\n\nexport type CubeMenuTriggerProps = Omit<AriaMenuTriggerProps, 'children'> &\n PositionProps & {\n isDisabled?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n targetRef?: RefObject<HTMLElement | null>;\n children: [\n ReactElement | ((state: MenuTriggerState) => ReactElement),\n ReactElement,\n ];\n\n closeOnSelect?: boolean;\n isDummy?: boolean;\n /**\n * Whether focus returns to the trigger when the menu closes. Defaults to\n * `true`.\n *\n * The restore is skipped automatically whenever the action that closed the\n * menu has already moved focus somewhere else, so an item that opens a\n * panel/dialog/inline editor and focuses it needs nothing here. Pass\n * `false` for the remaining case: a surface that claims focus *later* than\n * the menu's own restore (after an async load, an entry animation, or a\n * `requestAnimationFrame`), where the trigger would otherwise take focus\n * first and produce a visible flash.\n */\n shouldRestoreFocus?: boolean;\n /**\n * External ref to the popover container element. When provided, it is\n * aliased to the internal `menuPopoverRef`, letting consumers (e.g.\n * `useAnchoredMenu` / `useContextMenu`) feed the popover container into\n * their own `usePopoverSync` so the nested-popover guard can recognize\n * submenus opened inside this menu. Optional.\n */\n popoverRef?: MutableRefObject<HTMLDivElement | null>;\n /**\n * Overlay variant to use on mobile screens. Defaults to `'popover'`, which\n * keeps the desktop overlay even on small viewports. Pass `'tray'` to opt\n * into the bottom-sheet `Tray` overlay on mobile (the previous implicit\n * default). Mirrors the `mobileType` API on `DialogTrigger`.\n */\n mobileType?: 'popover' | 'tray';\n };\n\nfunction MenuTrigger(props: CubeMenuTriggerProps, ref: Ref<HTMLElement>) {\n const internalPopoverRef = useRef<HTMLDivElement>(null);\n const menuPopoverRef = props.popoverRef ?? internalPopoverRef;\n const trayRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n const domRef = useObjectRef(ref);\n const menuTriggerRef = props.targetRef || domRef || triggerRef;\n const menuRef = useRef<HTMLUListElement>(null);\n const wasOpenRef = useRef(false);\n const {\n children,\n shouldFlip = true,\n closeOnSelect,\n trigger = 'press',\n isDisabled,\n isDummy,\n mobileType = 'popover',\n shouldRestoreFocus = true,\n } = props;\n\n // Generate a unique ID for this menu instance\n const menuId = useMemo(() => generateRandomId(), []);\n\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('MenuTrigger must have exactly 2 children');\n }\n\n let [menuTrigger, menu] = children;\n const state: MenuTriggerState = useMenuTriggerState(props);\n\n usePopoverSync({\n menuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n enabled: !isDummy,\n triggerRef: menuTriggerRef,\n containerRef: menuPopoverRef,\n });\n\n if (typeof menuTrigger === 'function') {\n menuTrigger = menuTrigger(state);\n }\n\n const { menuTriggerProps, menuProps } = useMenuTrigger(\n { isDisabled },\n state,\n menuTriggerRef,\n );\n\n let initialPlacement: Placement = props.placement ?? 'bottom start';\n\n // Tray rendering is now opt-in via `mobileType=\"tray\"` (matches DialogTrigger).\n // Without that opt-in, MenuTrigger always renders a Popover so that environments\n // like jsdom (where `window.screen.width === 0` makes useIsMobileDevice() true)\n // don't accidentally swap in the tray overlay.\n const isMobileDevice = useIsMobileDevice();\n const isTray = mobileType === 'tray' && isMobileDevice;\n const { overlayProps: positionProps, placement } = useOverlayPosition({\n targetRef: menuTriggerRef,\n overlayRef: menuPopoverRef,\n scrollRef: menuRef,\n placement: initialPlacement,\n shouldFlip: shouldFlip,\n isOpen: state.isOpen && !isTray,\n onClose: state.close,\n containerPadding: props.containerPadding,\n offset: props.offset ?? 8,\n crossOffset: props.crossOffset ?? 0,\n });\n\n // Whether focus has been claimed by something outside the closing menu —\n // the signal that a menu action handed focus off and the trigger must not\n // take it back.\n //\n // Focus still inside the menu overlay means nobody claimed it: the pressed\n // item keeps focus while the popover plays its ~350ms exit animation. Focus\n // on `<body>` (or on a detached element) means the focused node went away\n // with the menu. Both are cases where the trigger is where focus belongs.\n const hasFocusMovedOutsideMenu = useEvent(() => {\n const activeElement = document.activeElement;\n\n if (!activeElement || activeElement === document.body) return false;\n if (!activeElement.isConnected) return false;\n\n // `menuPopoverRef` is only wired to the `Popover` branch, so the overlay\n // container is `trayRef` when `mobileType=\"tray\"` is in effect.\n const overlay = isTray ? trayRef.current : menuPopoverRef.current;\n\n return !(\n overlay?.contains(activeElement) ||\n menuRef.current?.contains(activeElement) ||\n menuTriggerRef.current?.contains(activeElement)\n );\n });\n\n // Restore focus manually when the menu closes\n useEffect(() => {\n if (!state.isOpen && wasOpenRef.current && !isDummy) {\n wasOpenRef.current = false;\n\n if (!shouldRestoreFocus) return;\n\n // Use setTimeout to ensure focus restoration happens after any animations\n setTimeout(() => {\n // An action that opened a panel, a dialog or an inline editor has\n // already focused it by now — taking focus back to the trigger would\n // undo the hand-off, which consumers previously had to out-race by\n // re-focusing on every animation frame (CUB-3962).\n if (hasFocusMovedOutsideMenu()) return;\n\n menuTriggerRef.current?.focus();\n }, 0);\n } else if (state.isOpen) {\n wasOpenRef.current = true;\n }\n }, [\n state.isOpen,\n menuTriggerRef,\n isDummy,\n shouldRestoreFocus,\n hasFocusMovedOutsideMenu,\n ]);\n\n const menuContext = {\n ...menuProps,\n ref: menuRef,\n onClose: state.close,\n closeOnSelect,\n autoFocus: (state.focusStrategy as any) ?? 'first',\n style: isTray\n ? {\n width: '100%',\n maxHeight: 'inherit',\n }\n : undefined,\n mods: {\n popover: !isTray,\n tray: isTray,\n },\n isClosing: !state.isOpen,\n } as MenuContextValue;\n\n // Wrap in a FocusScope so the menu popover registers as a child of any\n // outer contained FocusScope (e.g. a parent Dialog/Popover). Without this,\n // when the menu opens inside an outer contained FocusScope, the outer\n // scope rejects focus moving into the menu items (which live in a portal\n // and would otherwise belong to no scope) and yanks focus back to the\n // menu trigger.\n //\n // `restoreFocus` follows `shouldRestoreFocus`, so opting out silences the\n // scope's own unmount restore too. Scope registration (and therefore the\n // guarantee above) is unaffected — `FocusScope` joins the tree and tracks\n // the active scope regardless of `restoreFocus`.\n const contents = (\n <FocusScope restoreFocus={shouldRestoreFocus}>\n <DismissButton onDismiss={state.close} />\n {menu}\n <DismissButton onDismiss={state.close} />\n </FocusScope>\n );\n\n // Shared between the Popover and Tray branches so both react-aria\n // `useOverlay` calls see the same predicate. Without this, the Tray branch\n // falls back to unconditional dismiss-on-outside-interaction, which\n // `useOverlay` translates into stopPropagation/preventDefault in the\n // capture phase — that swallows clicks on sibling triggers (see Menu\n // rapid-open test).\n //\n // `useEvent` gives us a single stable callback reference for the lifetime\n // of the component while always reading the latest closure values. This\n // matters because `useMenuTriggerState` returns a fresh `state` object on\n // every render, so a vanilla `useCallback([..., state])` would produce a\n // new function every render and defeat any stability guarantees consumers\n // rely on.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n // While `Popover` is animating out, `useInteractOutside`'s capture-phase\n // listener is still attached (jsdom 29+ uses pointerdown/click capture).\n // The animation lasts ~350ms; without this guard, clicks on a sibling\n // trigger during the exit window get stopPropagation()'d and the\n // sibling's `onClick` never runs — breaking rapid-open and \"open menu\n // again with new props\" flows. Reading `state.isOpen` directly is safe\n // because `useEvent` always sees the latest closure.\n if (!state.isOpen) return false;\n\n // A press on our OWN trigger's actions run — an `ItemButton` row's\n // `actions` — is not a press outside. The run is rendered as a sibling of\n // the trigger (see `ItemActionsWrapper`), so the checks below cannot\n // recognise it and we closed instead, which cost the action its press: the\n // first press on it while the menu was open only closed the menu.\n if (isOwnActionsPress(el, menuTriggerRef.current)) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n // Plain interactive controls (Button, ItemButton) opt in via\n // `data-popover-dismiss`. We schedule the close via setTimeout(0) so\n // it lands AFTER the click event finishes — the button's onPress\n // fires first, then the popover closes. Without this, useOverlay\n // would stopPropagation() the click and the user would need a second\n // click to actually press the button.\n if (el.closest('[data-popover-dismiss]')) {\n setTimeout(() => state.close(), 0);\n return false;\n }\n return true;\n }\n if (\n isDummy &&\n (menuTriggerEl === menuTriggerRef.current ||\n menuTriggerRef.current?.contains(el))\n ) {\n return true;\n }\n if (menuTriggerEl === menuTriggerRef.current) return true;\n return false;\n });\n\n let overlay;\n if (isTray) {\n overlay = (\n <Tray\n ref={trayRef}\n isOpen={state.isOpen}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Tray>\n );\n } else {\n overlay = (\n <Popover\n ref={menuPopoverRef}\n hideArrow\n isNonModal\n isOpen={state.isOpen}\n style={positionProps.style}\n placement={placement ?? undefined}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Popover>\n );\n }\n\n return (\n <Fragment>\n <SlotProvider\n slots={{ actionButton: { holdAffordance: trigger === 'longPress' } }}\n >\n {!isDummy ? (\n <PressResponder\n {...menuTriggerProps}\n ref={menuTriggerRef}\n data-popover-trigger\n isPressed={state.isOpen}\n >\n {menuTrigger}\n </PressResponder>\n ) : null}\n </SlotProvider>\n <MenuContext.Provider value={menuContext}>{overlay}</MenuContext.Provider>\n </Fragment>\n );\n}\n\n/**\n * The MenuTrigger serves as a wrapper around a Menu and its associated trigger,\n * linking the Menu's open state with the trigger's press state.\n */\nlet _MenuTrigger = forwardRef(MenuTrigger);\n\n_MenuTrigger.displayName = 'MenuTrigger';\n\nexport { _MenuTrigger as MenuTrigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;AA+EA,SAAA8C,YAAAC,OAAAC,KAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CACE,MAAAC,qBAA2BxC,OAAuB,IAAI;CACtD,MAAAyC,iBAAuBL,MAAKJ,cAALQ;CACvB,MAAAE,UAAgB1C,OAAoB,IAAI;CACxC,MAAA2C,aAAmB3C,OAAoB,IAAI;CAC3C,MAAA4C,SAAetD,aAAa+C,GAAG;CAC/B,MAAAQ,iBAAuBT,MAAKX,aAALmB,UAAAD;CACvB,MAAAG,UAAgB9C,OAAyB,IAAI;CAC7C,MAAA+C,aAAmB/C,OAAO,KAAK;CAC/B,MAAA,EAAA2B,UAAAqB,YAAAC,IAAApB,eAAAqB,SAAAC,IAAA9B,YAAAS,SAAAI,YAAAkB,IAAArB,oBAAAsB,OASIjB;CAPF,MAAAY,aAAAC,OAAAK,KAAAA,IAAA,OAAAL;CAEA,MAAAC,UAAAC,OAAAG,KAAAA,IAAA,UAAAH;CAGA,MAAAjB,aAAAkB,OAAAE,KAAAA,IAAA,YAAAF;CACA,MAAArB,qBAAAsB,OAAAC,KAAAA,IAAA,OAAAD;CAAyB,IAAAE;CAAA,IAAAjB,EAAA,OAAAkB,OAAAC,IAAA,2BAAA,GAAA;EAIEF,KAAA5C,iBAAiB;EAAC2B,EAAA,KAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAA/C,MAAAoB,SAA6BH;CAE7B,IAAI,CAACI,MA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OAAAA,MAAAlG,EAAA;CAAA,OAhBXkG;AAgBW;;;;;AAQf,IAAIC,eAAejJ,WAAW2C,WAAW;AAEzCsG,aAAaC,cAAc"}
|
|
1
|
+
{"version":3,"file":"MenuTrigger.js","names":["PressResponder","useObjectRef","useIsMobileDevice","forwardRef","Fragment","MutableRefObject","ReactElement","Ref","RefObject","useEffect","useMemo","useRef","AriaMenuTriggerProps","DismissButton","FocusScope","Placement","PositionProps","useMenuTrigger","useOverlayPosition","MenuTriggerState","useMenuTriggerState","useEvent","generateRandomId","SlotProvider","usePopoverSync","Popover","Tray","isOwnActionsPress","MenuContext","MenuContextValue","CubeMenuTriggerProps","Omit","isDisabled","defaultOpen","onOpenChange","isOpen","targetRef","HTMLElement","children","state","closeOnSelect","isDummy","shouldRestoreFocus","popoverRef","HTMLDivElement","mobileType","MenuTrigger","props","ref","$","_c","internalPopoverRef","menuPopoverRef","trayRef","triggerRef","domRef","menuTriggerRef","menuRef","wasOpenRef","shouldFlip","t0","trigger","t1","t2","t3","undefined","t4","Symbol","for","menuId","Array","isArray","length","Error","menuTrigger","menu","t5","close","t6","t7","onClose","enabled","containerRef","t8","menuTriggerProps","menuProps","initialPlacement","placement","isMobileDevice","isTray","t9","t10","offset","t11","crossOffset","t12","containerPadding","overlayRef","scrollRef","overlayProps","positionProps","t13","activeElement","document","body","isConnected","overlay","current","contains","hasFocusMovedOutsideMenu","t14","t15","setTimeout","focus","t16","focusStrategy","t17","t18","popover","tray","t19","t20","autoFocus","mods","isClosing","menuContext","t21","t22","t23","contents","t24","el","menuTriggerEl","closest","shouldCloseOnInteractOutside","t25","t26","style","actionButton","holdAffordance","t27","t28","t29","overlay_0","t30","_MenuTrigger","displayName","_c","Tray","Popover"],"sources":["../../../../src/components/actions/Menu/MenuTrigger.tsx"],"sourcesContent":["import { PressResponder } from '@react-aria/interactions';\nimport { useObjectRef } from '@react-aria/utils';\nimport { useIsMobileDevice } from '@react-spectrum/utils';\nimport {\n forwardRef,\n Fragment,\n MutableRefObject,\n ReactElement,\n Ref,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n AriaMenuTriggerProps,\n DismissButton,\n FocusScope,\n Placement,\n PositionProps,\n useMenuTrigger,\n useOverlayPosition,\n} from 'react-aria';\nimport { MenuTriggerState, useMenuTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { generateRandomId } from '../../../utils/random';\nimport { SlotProvider } from '../../../utils/react';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { Popover, Tray } from '../../overlays/Modal';\nimport { isOwnActionsPress } from '../actions-run';\n\nimport { MenuContext, MenuContextValue } from './context';\n\nexport type { AriaMenuTriggerProps };\n\nexport type CubeMenuTriggerProps = Omit<AriaMenuTriggerProps, 'children'> &\n PositionProps & {\n isDisabled?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n targetRef?: RefObject<HTMLElement | null>;\n children: [\n ReactElement | ((state: MenuTriggerState) => ReactElement),\n ReactElement,\n ];\n\n closeOnSelect?: boolean;\n isDummy?: boolean;\n /**\n * Whether focus returns to the trigger when the menu closes. Defaults to\n * `true`.\n *\n * The restore is skipped automatically whenever the action that closed the\n * menu has already moved focus somewhere else, so an item that opens a\n * panel/dialog/inline editor and focuses it needs nothing here. Pass\n * `false` for the remaining case: a surface that claims focus *later* than\n * the menu's own restore (after an async load, an entry animation, or a\n * `requestAnimationFrame`), where the trigger would otherwise take focus\n * first and produce a visible flash.\n */\n shouldRestoreFocus?: boolean;\n /**\n * External ref to the popover container element. When provided, it is\n * aliased to the internal `menuPopoverRef`, letting consumers (e.g.\n * `useAnchoredMenu` / `useContextMenu`) feed the popover container into\n * their own `usePopoverSync` so the nested-popover guard can recognize\n * submenus opened inside this menu. Optional.\n */\n popoverRef?: MutableRefObject<HTMLDivElement | null>;\n /**\n * Overlay variant to use on mobile screens. Defaults to `'popover'`, which\n * keeps the desktop overlay even on small viewports. Pass `'tray'` to opt\n * into the bottom-sheet `Tray` overlay on mobile (the previous implicit\n * default). Mirrors the `mobileType` API on `DialogTrigger`.\n */\n mobileType?: 'popover' | 'tray';\n };\n\nfunction MenuTrigger(props: CubeMenuTriggerProps, ref: Ref<HTMLElement>) {\n const internalPopoverRef = useRef<HTMLDivElement>(null);\n const menuPopoverRef = props.popoverRef ?? internalPopoverRef;\n const trayRef = useRef<HTMLElement>(null);\n const triggerRef = useRef<HTMLElement>(null);\n const domRef = useObjectRef(ref);\n const menuTriggerRef = props.targetRef || domRef || triggerRef;\n const menuRef = useRef<HTMLUListElement>(null);\n const wasOpenRef = useRef(false);\n const {\n children,\n shouldFlip = true,\n closeOnSelect,\n trigger = 'press',\n isDisabled,\n isDummy,\n mobileType = 'popover',\n shouldRestoreFocus = true,\n } = props;\n\n // Generate a unique ID for this menu instance\n const menuId = useMemo(() => generateRandomId(), []);\n\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('MenuTrigger must have exactly 2 children');\n }\n\n let [menuTrigger, menu] = children;\n const state: MenuTriggerState = useMenuTriggerState(props);\n\n usePopoverSync({\n menuId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n enabled: !isDummy,\n triggerRef: menuTriggerRef,\n containerRef: menuPopoverRef,\n });\n\n if (typeof menuTrigger === 'function') {\n menuTrigger = menuTrigger(state);\n }\n\n const { menuTriggerProps, menuProps } = useMenuTrigger(\n { isDisabled },\n state,\n menuTriggerRef,\n );\n\n let initialPlacement: Placement = props.placement ?? 'bottom start';\n\n // Tray rendering is now opt-in via `mobileType=\"tray\"` (matches DialogTrigger).\n // Without that opt-in, MenuTrigger always renders a Popover so that environments\n // like jsdom (where `window.screen.width === 0` makes useIsMobileDevice() true)\n // don't accidentally swap in the tray overlay.\n const isMobileDevice = useIsMobileDevice();\n const isTray = mobileType === 'tray' && isMobileDevice;\n const { overlayProps: positionProps, placement } = useOverlayPosition({\n targetRef: menuTriggerRef,\n overlayRef: menuPopoverRef,\n scrollRef: menuRef,\n placement: initialPlacement,\n shouldFlip: shouldFlip,\n isOpen: state.isOpen && !isTray,\n onClose: state.close,\n containerPadding: props.containerPadding,\n offset: props.offset ?? 8,\n crossOffset: props.crossOffset ?? 0,\n });\n\n // Whether focus has been claimed by something outside the closing menu —\n // the signal that a menu action handed focus off and the trigger must not\n // take it back.\n //\n // Focus still inside the menu overlay means nobody claimed it: the pressed\n // item keeps focus while the popover plays its ~350ms exit animation. Focus\n // on `<body>` (or on a detached element) means the focused node went away\n // with the menu. Both are cases where the trigger is where focus belongs.\n const hasFocusMovedOutsideMenu = useEvent(() => {\n const activeElement = document.activeElement;\n\n if (!activeElement || activeElement === document.body) return false;\n if (!activeElement.isConnected) return false;\n\n // `menuPopoverRef` is only wired to the `Popover` branch, so the overlay\n // container is `trayRef` when `mobileType=\"tray\"` is in effect.\n const overlay = isTray ? trayRef.current : menuPopoverRef.current;\n\n return !(\n overlay?.contains(activeElement) ||\n menuRef.current?.contains(activeElement) ||\n menuTriggerRef.current?.contains(activeElement)\n );\n });\n\n // Restore focus manually when the menu closes\n useEffect(() => {\n if (!state.isOpen && wasOpenRef.current && !isDummy) {\n wasOpenRef.current = false;\n\n if (!shouldRestoreFocus) return;\n\n // Use setTimeout to ensure focus restoration happens after any animations\n setTimeout(() => {\n // An action that opened a panel, a dialog or an inline editor has\n // already focused it by now — taking focus back to the trigger would\n // undo the hand-off, which consumers previously had to out-race by\n // re-focusing on every animation frame (CUB-3962).\n if (hasFocusMovedOutsideMenu()) return;\n\n menuTriggerRef.current?.focus();\n }, 0);\n } else if (state.isOpen) {\n wasOpenRef.current = true;\n }\n }, [\n state.isOpen,\n menuTriggerRef,\n isDummy,\n shouldRestoreFocus,\n hasFocusMovedOutsideMenu,\n ]);\n\n const menuContext = {\n ...menuProps,\n ref: menuRef,\n onClose: state.close,\n closeOnSelect,\n autoFocus: (state.focusStrategy as any) ?? 'first',\n mods: {\n popover: !isTray,\n tray: isTray,\n },\n isClosing: !state.isOpen,\n } as MenuContextValue;\n\n // Wrap in a FocusScope so the menu popover registers as a child of any\n // outer contained FocusScope (e.g. a parent Dialog/Popover). Without this,\n // when the menu opens inside an outer contained FocusScope, the outer\n // scope rejects focus moving into the menu items (which live in a portal\n // and would otherwise belong to no scope) and yanks focus back to the\n // menu trigger.\n //\n // `restoreFocus` follows `shouldRestoreFocus`, so opting out silences the\n // scope's own unmount restore too. Scope registration (and therefore the\n // guarantee above) is unaffected — `FocusScope` joins the tree and tracks\n // the active scope regardless of `restoreFocus`.\n const contents = (\n <FocusScope restoreFocus={shouldRestoreFocus}>\n <DismissButton onDismiss={state.close} />\n {menu}\n <DismissButton onDismiss={state.close} />\n </FocusScope>\n );\n\n // Shared between the Popover and Tray branches so both react-aria\n // `useOverlay` calls see the same predicate. Without this, the Tray branch\n // falls back to unconditional dismiss-on-outside-interaction, which\n // `useOverlay` translates into stopPropagation/preventDefault in the\n // capture phase — that swallows clicks on sibling triggers (see Menu\n // rapid-open test).\n //\n // `useEvent` gives us a single stable callback reference for the lifetime\n // of the component while always reading the latest closure values. This\n // matters because `useMenuTriggerState` returns a fresh `state` object on\n // every render, so a vanilla `useCallback([..., state])` would produce a\n // new function every render and defeat any stability guarantees consumers\n // rely on.\n const shouldCloseOnInteractOutside = useEvent((el: Element) => {\n // While `Popover` is animating out, `useInteractOutside`'s capture-phase\n // listener is still attached (jsdom 29+ uses pointerdown/click capture).\n // The animation lasts ~350ms; without this guard, clicks on a sibling\n // trigger during the exit window get stopPropagation()'d and the\n // sibling's `onClick` never runs — breaking rapid-open and \"open menu\n // again with new props\" flows. Reading `state.isOpen` directly is safe\n // because `useEvent` always sees the latest closure.\n if (!state.isOpen) return false;\n\n // A press on our OWN trigger's actions run — an `ItemButton` row's\n // `actions` — is not a press outside. The run is rendered as a sibling of\n // the trigger (see `ItemActionsWrapper`), so the checks below cannot\n // recognise it and we closed instead, which cost the action its press: the\n // first press on it while the menu was open only closed the menu.\n if (isOwnActionsPress(el, menuTriggerRef.current)) return false;\n\n const menuTriggerEl = el.closest('[data-popover-trigger]');\n if (!menuTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n // Plain interactive controls (Button, ItemButton) opt in via\n // `data-popover-dismiss`. We schedule the close via setTimeout(0) so\n // it lands AFTER the click event finishes — the button's onPress\n // fires first, then the popover closes. Without this, useOverlay\n // would stopPropagation() the click and the user would need a second\n // click to actually press the button.\n if (el.closest('[data-popover-dismiss]')) {\n setTimeout(() => state.close(), 0);\n return false;\n }\n return true;\n }\n if (\n isDummy &&\n (menuTriggerEl === menuTriggerRef.current ||\n menuTriggerRef.current?.contains(el))\n ) {\n return true;\n }\n if (menuTriggerEl === menuTriggerRef.current) return true;\n return false;\n });\n\n let overlay;\n if (isTray) {\n overlay = (\n <Tray\n ref={trayRef}\n isOpen={state.isOpen}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Tray>\n );\n } else {\n overlay = (\n <Popover\n ref={menuPopoverRef}\n hideArrow\n isNonModal\n isOpen={state.isOpen}\n // oxlint-disable-next-line tasty/no-style-prop -- React Aria's overlay positioning computes these coordinates\n style={positionProps.style}\n placement={placement ?? undefined}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={state.close}\n >\n {contents}\n </Popover>\n );\n }\n\n return (\n <Fragment>\n <SlotProvider\n slots={{ actionButton: { holdAffordance: trigger === 'longPress' } }}\n >\n {!isDummy ? (\n <PressResponder\n {...menuTriggerProps}\n ref={menuTriggerRef}\n data-popover-trigger\n isPressed={state.isOpen}\n >\n {menuTrigger}\n </PressResponder>\n ) : null}\n </SlotProvider>\n <MenuContext.Provider value={menuContext}>{overlay}</MenuContext.Provider>\n </Fragment>\n );\n}\n\n/**\n * The MenuTrigger serves as a wrapper around a Menu and its associated trigger,\n * linking the Menu's open state with the trigger's press state.\n */\nlet _MenuTrigger = forwardRef(MenuTrigger);\n\n_MenuTrigger.displayName = 'MenuTrigger';\n\nexport { _MenuTrigger as MenuTrigger };\n"],"mappings":";;;;;;;;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