@cube-dev/ui-kit 0.0.0-canary-d195e41 → 0.0.0-canary-13874a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +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 +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.d.ts +2 -4
- package/dist/components/content/Layout/LayoutPanel.js +1 -2
- 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 +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/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/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-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 +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +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 +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/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 +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 +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +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 +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +6 -87
- 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/context.js.map +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/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/programmaticFocus.js.map +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/content/Layout.md +2 -2
- package/docs/components/overlays/Dialog.md +1 -1
- package/docs/components/overlays/DialogContainer.md +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { chainRaf } from "../../../utils/raf.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { _Text } from "../../content/Text.js";
|
|
3
3
|
import { _Title } from "../../content/Title.js";
|
|
4
4
|
import { Card } from "../../content/Card/Card.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { useProviderProps } from "../../../provider.js";
|
|
3
3
|
import { CalendarPanel } from "./CalendarPanel.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { CALENDAR_CELL_STYLES } from "./styled.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { getWeekNumber } from "../../fields/DatePicker/period.js";
|
|
3
3
|
import { CalendarCell } from "./CalendarCell.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { Space } from "../../layout/Space.js";
|
|
4
4
|
import { RightIcon } from "../../../icons/RightIcon.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { CalendarElement } from "./styled.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { useProviderProps } from "../../../provider.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { getQuarter } from "../../fields/DatePicker/period.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { CALENDAR_CELL_STYLES } from "./styled.js";
|
|
3
3
|
import { tasty } from "@tenphi/tasty";
|
|
4
4
|
import { useLayoutEffect, useRef } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { useProviderProps } from "../../../provider.js";
|
|
3
3
|
import { CalendarPanel } from "./CalendarPanel.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { Icon } from "../../../icons/Icon.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { mergeStyles, tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { chain } from "../../../utils/react/chain.js";
|
|
3
3
|
import { Paragraph } from "../../content/Paragraph.js";
|
|
4
4
|
import { _Title } from "../../content/Title.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { EXIT_DURATION } from "../Modal/Overlay.js";
|
|
3
3
|
import { AlertDialogZone } from "./AlertDialogZone.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { Portal } from "../../portal/Portal.js";
|
|
3
3
|
import { DialogContainer } from "../Dialog/DialogContainer.js";
|
|
4
4
|
import { _AlertDialog } from "./AlertDialog.js";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | 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 { SlotProvider } from "../../../utils/react/Slots.js";
|
|
5
|
-
import { focusProgrammatically } from "../../../utils/react/programmaticFocus.js";
|
|
6
5
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
7
6
|
import { useOpenTransitionContext } from "../Modal/OpenTransitionContext.js";
|
|
8
7
|
import { _ItemButton } from "../../actions/ItemButton/ItemButton.js";
|
|
@@ -11,7 +10,7 @@ import { CloseIcon } from "../../../icons/CloseIcon.js";
|
|
|
11
10
|
import { useContentOverflow } from "./use-content-overflow.js";
|
|
12
11
|
import { c } from "react/compiler-runtime";
|
|
13
12
|
import { BASE_STYLES, BLOCK_STYLES, DIMENSION_STYLES, FLOW_STYLES, tasty } from "@tenphi/tasty";
|
|
14
|
-
import { forwardRef, useEffect
|
|
13
|
+
import { forwardRef, useEffect } from "react";
|
|
15
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
16
15
|
import { DismissButton, FocusScope, useDialog } from "react-aria";
|
|
17
16
|
import { createFocusManager } from "@react-aria/focus";
|
|
@@ -109,91 +108,13 @@ const sizePxMap = {
|
|
|
109
108
|
large: 798
|
|
110
109
|
};
|
|
111
110
|
/**
|
|
112
|
-
* The control a dialog focuses when it opens:
|
|
113
|
-
* `data-autofocus
|
|
111
|
+
* The control a dialog focuses when it opens: an input marked
|
|
112
|
+
* `data-autofocus`, or a submit or primary button. In an alert dialog never a
|
|
114
113
|
* destructive (`danger`) button, which a reflexive Enter would run.
|
|
115
114
|
*/
|
|
116
115
|
function findPriorityFocusElement(dialog) {
|
|
117
116
|
const button = dialog.getAttribute("role") === "alertdialog" ? "button:not([data-theme=\"danger\"])" : "button";
|
|
118
|
-
return dialog.querySelector(`input[data-autofocus],
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Returns focus when a retained dialog (`hideOnClose`) closes. `FocusScope`
|
|
122
|
-
* restores only on unmount, which a retained dialog never reaches: it ends its
|
|
123
|
-
* exit in the `unmounted` phase, still mounted. This restores at that moment,
|
|
124
|
-
* by the same rule: only while focus is still in the dialog, lost to `<body>`,
|
|
125
|
-
* or left in another overlay that is closing.
|
|
126
|
-
*
|
|
127
|
-
* Only to the element focused when the dialog opened. When that element is
|
|
128
|
-
* gone by the close, as a menu item goes with its menu, `FocusScope` hands the
|
|
129
|
-
* restore to the menu's own target through its private scope tree; here focus
|
|
130
|
-
* stays where it is.
|
|
131
|
-
*
|
|
132
|
-
* Returns whether the dialog is retained: only a retained dialog renders in
|
|
133
|
-
* the `unmounted` phase.
|
|
134
|
-
*/
|
|
135
|
-
function useRetainedDialogFocusRestore(dialogRef, isOpen, shouldRestoreFocus) {
|
|
136
|
-
const $ = c(10);
|
|
137
|
-
const transitionState = useOpenTransitionContext()?.transitionState;
|
|
138
|
-
const [isRetained, setIsRetained] = useState(false);
|
|
139
|
-
const [wasOpen, setWasOpen] = useState(false);
|
|
140
|
-
const [openedFrom, setOpenedFrom] = useState(null);
|
|
141
|
-
const nodeToRestoreRef = useRef(null);
|
|
142
|
-
if (transitionState === "unmounted" && !isRetained) setIsRetained(true);
|
|
143
|
-
if (isOpen !== wasOpen) {
|
|
144
|
-
setWasOpen(isOpen);
|
|
145
|
-
setOpenedFrom(isOpen && typeof document !== "undefined" ? document.activeElement : null);
|
|
146
|
-
}
|
|
147
|
-
let t0;
|
|
148
|
-
let t1;
|
|
149
|
-
if ($[0] !== dialogRef || $[1] !== isOpen || $[2] !== openedFrom) {
|
|
150
|
-
t0 = () => {
|
|
151
|
-
if (isOpen && openedFrom && openedFrom !== document.body && !dialogRef.current?.contains(openedFrom)) nodeToRestoreRef.current = openedFrom;
|
|
152
|
-
};
|
|
153
|
-
t1 = [
|
|
154
|
-
isOpen,
|
|
155
|
-
dialogRef,
|
|
156
|
-
openedFrom
|
|
157
|
-
];
|
|
158
|
-
$[0] = dialogRef;
|
|
159
|
-
$[1] = isOpen;
|
|
160
|
-
$[2] = openedFrom;
|
|
161
|
-
$[3] = t0;
|
|
162
|
-
$[4] = t1;
|
|
163
|
-
} else {
|
|
164
|
-
t0 = $[3];
|
|
165
|
-
t1 = $[4];
|
|
166
|
-
}
|
|
167
|
-
useLayoutEffect(t0, t1);
|
|
168
|
-
let t2;
|
|
169
|
-
let t3;
|
|
170
|
-
if ($[5] !== dialogRef || $[6] !== shouldRestoreFocus || $[7] !== transitionState) {
|
|
171
|
-
t2 = () => {
|
|
172
|
-
if (transitionState !== "unmounted") return;
|
|
173
|
-
const node = nodeToRestoreRef.current;
|
|
174
|
-
nodeToRestoreRef.current = null;
|
|
175
|
-
const isFocusable = node instanceof HTMLElement || node instanceof SVGElement;
|
|
176
|
-
if (!shouldRestoreFocus || !isFocusable) return;
|
|
177
|
-
if (node === document.body || !node.isConnected) return;
|
|
178
|
-
const activeElement = document.activeElement;
|
|
179
|
-
if (!activeElement || activeElement === document.body || !!dialogRef.current?.contains(activeElement) || !!activeElement.closest("[data-react-aria-top-layer=\"true\"]")) focusProgrammatically(node, { preventScroll: true });
|
|
180
|
-
};
|
|
181
|
-
t3 = [
|
|
182
|
-
transitionState,
|
|
183
|
-
shouldRestoreFocus,
|
|
184
|
-
dialogRef
|
|
185
|
-
];
|
|
186
|
-
$[5] = dialogRef;
|
|
187
|
-
$[6] = shouldRestoreFocus;
|
|
188
|
-
$[7] = transitionState;
|
|
189
|
-
$[8] = t2;
|
|
190
|
-
$[9] = t3;
|
|
191
|
-
} else {
|
|
192
|
-
t2 = $[8];
|
|
193
|
-
t3 = $[9];
|
|
194
|
-
}
|
|
195
|
-
useEffect(t2, t3);
|
|
196
|
-
return isRetained;
|
|
117
|
+
return dialog.querySelector(`input[data-autofocus], ${button}[type="submit"], ${button}[data-type="primary"]`);
|
|
197
118
|
}
|
|
198
119
|
/**
|
|
199
120
|
* Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.
|
|
@@ -239,14 +160,12 @@ const DialogContent = forwardRef(function DialogContent(props, ref) {
|
|
|
239
160
|
const styles = extractStyles(otherProps, STYLES_LIST);
|
|
240
161
|
const { t } = useI18n();
|
|
241
162
|
let domRef = useObjectRef(ref);
|
|
242
|
-
const isRetained = useRetainedDialogFocusRestore(domRef, !!contextProps.isOpen, contextProps.shouldRestoreFocus ?? true);
|
|
243
163
|
let { dialogProps, titleProps, contentProps } = useDialog(mergeProps$1(contextProps, props), domRef);
|
|
244
164
|
let dismissButton;
|
|
245
165
|
if (type === "popover" || type === "tray") dismissButton = /* @__PURE__ */ jsx(DismissButton, { onDismiss });
|
|
246
166
|
useEffect(() => {
|
|
247
167
|
if (contextProps.isOpen) setTimeout(() => {
|
|
248
168
|
if (!domRef.current) return;
|
|
249
|
-
if (isRetained && !domRef.current.contains(document.activeElement)) domRef.current.focus({ preventScroll: true });
|
|
250
169
|
const activeElement = document.activeElement;
|
|
251
170
|
const isFocusOutsideDialog = !domRef.current.contains(activeElement);
|
|
252
171
|
const isFocusOnDialogShell = activeElement === domRef.current;
|
|
@@ -259,7 +178,7 @@ const DialogContent = forwardRef(function DialogContent(props, ref) {
|
|
|
259
178
|
if (!createFocusManager(domRef).focusFirst({ tabbable: true })) domRef.current.focus();
|
|
260
179
|
}
|
|
261
180
|
});
|
|
262
|
-
}, [contextProps.isOpen
|
|
181
|
+
}, [contextProps.isOpen]);
|
|
263
182
|
const contentOverflows = useContentOverflow(domRef);
|
|
264
183
|
let slots = {
|
|
265
184
|
title: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["createFocusManager","useObjectRef","BASE_STYLES","BaseProps","BaseStyleProps","BLOCK_STYLES","BlockStyleProps","DIMENSION_STYLES","DimensionStyleProps","FLOW_STYLES","Styles","tasty","forwardRef","ReactElement","Ref","RefObject","useEffect","useLayoutEffect","useRef","useState","AriaDialogProps","DismissButton","FocusScope","useDialog","useI18n","CloseIcon","mergeProps","SlotProvider","focusProgrammatically","extractStyles","ItemButton","useOpenTransitionContext","useDialogContext","useContentOverflow","STYLES_LIST","DialogElement","as","styles","display","flow","fill","pointerEvents","outline","position","width","height","gap","border","radius","shadow","top","CloseButton","qa","type","right","sizeMap","S","M","L","sizePxMap","small","medium","large","CubeDialogProps","Omit","size","isDismissable","onDismiss","arg","closeIcon","closeButtonStyles","role","findPriorityFocusElement","dialog","HTMLElement","button","getAttribute","querySelector","useRetainedDialogFocusRestore","dialogRef","isOpen","shouldRestoreFocus","$","_c","transitionState","isRetained","setIsRetained","wasOpen","setWasOpen","openedFrom","setOpenedFrom","nodeToRestoreRef","document","activeElement","t0","t1","body","current","contains","t2","t3","node","isFocusable","SVGElement","isConnected","isFocusLost","closest","preventScroll","Dialog","props","ref","isShown","context","content","isNonModalPopover","shouldContainFocus","DialogContent","HTMLDivElement","contextProps","children","undefined","onClose","style","otherProps","toUpperCase","t","domRef","dialogProps","titleProps","contentProps","dismissButton","setTimeout","focus","isFocusOutsideDialog","isFocusOnDialogShell","priorityElement","focusManager","focusFirst","tabbable","contentOverflows","slots","title","level","preset","id","flexGrow","padding","header","ellipsis","placeItems","placeContent","footer","mods","buttonGroup","dismissable"],"sources":["../../../../src/components/overlays/Dialog/Dialog.tsx"],"sourcesContent":["import { createFocusManager } from '@react-aria/focus';\nimport { useObjectRef } from '@react-aria/utils';\nimport {\n BASE_STYLES,\n BaseProps,\n BaseStyleProps,\n BLOCK_STYLES,\n BlockStyleProps,\n DIMENSION_STYLES,\n DimensionStyleProps,\n FLOW_STYLES,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n forwardRef,\n ReactElement,\n Ref,\n RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\nimport {\n AriaDialogProps,\n DismissButton,\n FocusScope,\n useDialog,\n} from 'react-aria';\n\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { mergeProps, SlotProvider } from '../../../utils/react';\nimport { focusProgrammatically } from '../../../utils/react/programmaticFocus';\nimport { extractStyles } from '../../../utils/styles';\nimport { ItemButton } from '../../actions/ItemButton/ItemButton';\nimport { useOpenTransitionContext } from '../Modal/OpenTransitionContext';\n\nimport { useDialogContext } from './context';\nimport { useContentOverflow } from './use-content-overflow';\n\nconst STYLES_LIST = [\n ...BASE_STYLES,\n ...DIMENSION_STYLES,\n ...BLOCK_STYLES,\n ...FLOW_STYLES,\n];\n\nconst DialogElement = tasty({\n as: 'section',\n styles: {\n display: 'flex',\n flow: 'column',\n fill: '#surface',\n pointerEvents: 'auto',\n outline: 0,\n position: {\n '': 'relative',\n 'type=panel': 'absolute',\n },\n width: {\n '': '$min-dialog-size $dialog-size (100dvw - 8x)',\n 'type=fullscreen': '(100dvw - 8x) (100dvw - 8x)',\n 'type=fullscreenTakeover': '100dvw 100dvw',\n 'type=panel': 'auto',\n },\n height: {\n '': 'auto (100dvh - 8x)',\n 'type=fullscreen': '(100dvh - 8x) (100dvh - 8x)',\n 'type=fullscreenTakeover | type=panel': '100dvh 100dvh',\n 'type=popover': 'initial initial (50dvh - 5x)',\n },\n gap: 0,\n border: {\n '': false,\n 'type=popover': true,\n },\n radius: {\n '': '1cr',\n 'type=tray': '1cr top',\n 'type=fullscreenTakeover': '0r',\n },\n shadow: {\n '': '$dialog-shadow',\n 'type=popover | type=panel': '$shadow',\n },\n top: {\n '': false,\n 'type=modal': '((50vh - 50%) / -3)',\n 'type=panel': 'auto',\n },\n '$dialog-title-padding-v': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-content-padding-v': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-padding-h': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-footer-v': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-content-gap': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n\n // A `Form` placed directly here (`Dialog > Form > Content + Footer`) lays\n // itself out as this flex column — see `FormElement`. It is the form's own\n // state rather than a rule here, so the form's `styles` still win.\n },\n});\n\nconst CloseButton = tasty(ItemButton, {\n qa: 'ModalCloseButton',\n type: 'clear',\n styles: {\n position: 'absolute',\n top: '1x',\n right: '1x',\n },\n});\n\nconst sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n};\nconst sizePxMap = {\n small: 360,\n medium: 479,\n large: 798,\n};\n\nexport interface CubeDialogProps\n extends Omit<BaseProps, 'role'>,\n AriaDialogProps,\n BaseStyleProps,\n BlockStyleProps,\n DimensionStyleProps {\n /** The size of the dialog */\n size?: 'S' | 'M' | 'L' | 'small' | 'medium' | 'large';\n /** Whether the dialog is dismissable */\n isDismissable?: boolean;\n /** Trigger when the dialog is dismissed */\n onDismiss?: (arg?: any) => void;\n /** That you can replace the close icon with */\n closeIcon?: ReactElement;\n closeButtonStyles?: Styles;\n role?: 'dialog' | 'alertdialog';\n}\n\n/**\n * The control a dialog focuses when it opens: a text field marked\n * `data-autofocus` (an input or a textarea), or a submit or primary button. In an alert dialog never a\n * destructive (`danger`) button, which a reflexive Enter would run.\n */\nfunction findPriorityFocusElement(dialog: HTMLElement) {\n const button =\n dialog.getAttribute('role') === 'alertdialog'\n ? 'button:not([data-theme=\"danger\"])'\n : 'button';\n\n return dialog.querySelector<HTMLElement>(\n `input[data-autofocus], textarea[data-autofocus], ${button}[type=\"submit\"], ${button}[data-type=\"primary\"]`,\n );\n}\n\n/**\n * Returns focus when a retained dialog (`hideOnClose`) closes. `FocusScope`\n * restores only on unmount, which a retained dialog never reaches: it ends its\n * exit in the `unmounted` phase, still mounted. This restores at that moment,\n * by the same rule: only while focus is still in the dialog, lost to `<body>`,\n * or left in another overlay that is closing.\n *\n * Only to the element focused when the dialog opened. When that element is\n * gone by the close, as a menu item goes with its menu, `FocusScope` hands the\n * restore to the menu's own target through its private scope tree; here focus\n * stays where it is.\n *\n * Returns whether the dialog is retained: only a retained dialog renders in\n * the `unmounted` phase.\n */\nfunction useRetainedDialogFocusRestore(\n dialogRef: RefObject<HTMLElement | null>,\n isOpen: boolean,\n shouldRestoreFocus: boolean,\n) {\n const transitionState = useOpenTransitionContext()?.transitionState;\n const [isRetained, setIsRetained] = useState(false);\n const [wasOpen, setWasOpen] = useState(false);\n const [openedFrom, setOpenedFrom] = useState<Element | null>(null);\n const nodeToRestoreRef = useRef<Element | null>(null);\n\n if (transitionState === 'unmounted' && !isRetained) setIsRetained(true);\n\n // Read in the render that opens it, as `FocusScope` reads it: the commit can\n // move focus before any effect runs, into the dialog (a native `autoFocus`,\n // a child's layout effect) or to `<body>` (an opener it disables).\n // Cleared on close, so a closed dialog holds no removed opener.\n if (isOpen !== wasOpen) {\n setWasOpen(isOpen);\n setOpenedFrom(\n isOpen && typeof document !== 'undefined' ? document.activeElement : null,\n );\n }\n\n useLayoutEffect(() => {\n // A reopen during the exit keeps its opener while focus is still inside\n // or already lost to `<body>`, as `FocusScope` keeps its own.\n if (\n isOpen &&\n openedFrom &&\n openedFrom !== document.body &&\n !dialogRef.current?.contains(openedFrom)\n ) {\n nodeToRestoreRef.current = openedFrom;\n }\n }, [isOpen, dialogRef, openedFrom]);\n\n useEffect(() => {\n if (transitionState !== 'unmounted') return;\n\n const node = nodeToRestoreRef.current;\n\n nodeToRestoreRef.current = null;\n\n // `FocusScope` restores to an SVG opener too, such as a chart mark.\n const isFocusable =\n node instanceof HTMLElement || node instanceof SVGElement;\n\n if (!shouldRestoreFocus || !isFocusable) return;\n if (node === document.body || !node.isConnected) return;\n\n const activeElement = document.activeElement;\n // Also lost when left in another overlay that closes with this one: a\n // nested dialog's own restore target is about to be hidden. `Overlay`,\n // `Select` and `ListBoxPopover` mark a closing overlay `=\"true\"`; the\n // notifications layer carries it empty. React Aria's toast region also\n // carries `\"true\"`, but nothing in the kit renders one.\n const isFocusLost =\n !activeElement ||\n activeElement === document.body ||\n !!dialogRef.current?.contains(activeElement) ||\n !!activeElement.closest('[data-react-aria-top-layer=\"true\"]');\n\n if (isFocusLost) focusProgrammatically(node, { preventScroll: true });\n }, [transitionState, shouldRestoreFocus, dialogRef]);\n\n return isRetained;\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nexport const Dialog = forwardRef(function Dialog(\n props: CubeDialogProps,\n ref: Ref<HTMLDivElement>,\n) {\n const transitionState = useOpenTransitionContext()?.transitionState;\n\n // From the first frame of the enter transition, not only once it has\n // ended: a Tab pressed while the dialog animates in would otherwise land on\n // the page behind it, and nothing would pull it back. Released as soon as\n // the dialog closes, so focus can return to the trigger during the exit.\n const isShown = transitionState === 'enter' || transitionState === 'entered';\n\n const context = useDialogContext();\n\n const content = <DialogContent key=\"content\" {...props} ref={ref} />;\n\n // A popover that is not dismissable leaves the page usable, as a panel\n // does: an outside press reaches its control, and focus has to follow it\n // there, into a text field too.\n const isNonModalPopover =\n context.type === 'popover' && context.isDismissable === false;\n\n const shouldContainFocus =\n isShown &&\n !!context.isOpen &&\n context.type !== 'panel' &&\n !isNonModalPopover;\n\n return (\n // This component traps the focus inside the dialog and restores it when\n // it unmounts (a retained dialog never does, so `DialogContent` restores\n // that one). The restore is the one that matters for popover-type dialogs\n // — `DialogTrigger`'s own restore is a no-op there — so\n // `shouldRestoreFocus` has to reach it. Containment is unaffected either way.\n <FocusScope\n restoreFocus={context.shouldRestoreFocus ?? true}\n contain={shouldContainFocus}\n >\n {content}\n </FocusScope>\n );\n});\n\nconst DialogContent = forwardRef(function DialogContent(\n props: CubeDialogProps,\n ref: Ref<HTMLDivElement>,\n) {\n let { type = 'modal', ...contextProps } = useDialogContext();\n\n let {\n qa,\n children,\n size = 'M',\n // A popover shows a close button only when its `Dialog` asks for one: its\n // trigger's `isDismissable` decides whether an outside press closes it.\n isDismissable = type === 'popover' ? undefined : contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n closeIcon,\n closeButtonStyles,\n style,\n ...otherProps\n } = props;\n\n size = sizeMap[size.toUpperCase()] || size;\n\n const styles: Styles = extractStyles(otherProps, STYLES_LIST);\n\n const { t } = useI18n();\n\n let domRef = useObjectRef(ref);\n\n const isRetained = useRetainedDialogFocusRestore(\n domRef,\n !!contextProps.isOpen,\n contextProps.shouldRestoreFocus ?? true,\n );\n\n // `contentProps` carries an id only for `role=\"alertdialog\"` without an\n // explicit `aria-describedby`: an alert is described by its message, while a\n // plain dialog links nothing, so opening a form does not read it aloud.\n let { dialogProps, titleProps, contentProps } = useDialog(\n mergeProps(contextProps, props),\n domRef,\n );\n\n // If rendered in a popover or tray there won't be a visible dismiss button,\n // so we render a hidden one for screen readers.\n let dismissButton;\n if (type === 'popover' || type === 'tray') {\n dismissButton = <DismissButton onDismiss={onDismiss} />;\n }\n\n // Focus the first focusable element in the dialog when it opens.\n //\n // We also re-run the priority focus logic when the dialog <section>\n // itself is the active element. This recovers from a race that occurs\n // when a popover-based component (FilterPicker, Picker, Select, …) opens\n // inside another contained Dialog: React's native `autoFocus` on the\n // inner control fires during the mutation phase, before the popover's\n // FocusScope registers in react-aria's focus-scope tree, so the outer\n // FocusScope yanks focus back. useDialog then defaults focus to the\n // dialog <section>; without re-promoting it here, the priority element\n // (e.g. the search input) is never focused.\n useEffect(() => {\n if (contextProps.isOpen) {\n setTimeout(() => {\n if (!domRef.current) return;\n\n // `useDialog` focuses the dialog itself when it mounts, without\n // scrolling, unless focus is already inside. A retained dialog opens\n // without remounting, so do the same here: the rules below then run as\n // for a fresh dialog, and kept content keeps its scroll.\n if (isRetained && !domRef.current.contains(document.activeElement)) {\n domRef.current.focus({ preventScroll: true });\n }\n\n const activeElement = document.activeElement;\n const isFocusOutsideDialog = !domRef.current.contains(activeElement);\n const isFocusOnDialogShell = activeElement === domRef.current;\n\n // Priority 1: autofocus input or primary button\n const priorityElement = findPriorityFocusElement(domRef.current);\n\n if (priorityElement && (isFocusOutsideDialog || isFocusOnDialogShell)) {\n priorityElement.focus();\n return;\n }\n\n if (isFocusOutsideDialog) {\n // Fallback: focus first tabbable element, or dialog itself\n const focusManager = createFocusManager(domRef);\n\n if (!focusManager.focusFirst({ tabbable: true })) {\n domRef.current.focus();\n }\n }\n });\n }\n }, [contextProps.isOpen, isRetained]);\n\n // let hasHeader = useHasChild('[data-id=\"Header\"]', domRef);\n // let hasFooter = useHasChild('[data-id=\"Footer\"]', domRef);\n\n const contentOverflows = useContentOverflow(domRef);\n\n let slots = {\n title: {\n level: 2,\n preset: 'h4',\n ...titleProps,\n },\n content: {\n // `null` rather than `undefined` when there is none: slots reach nested\n // slot providers, and `undefined` does not override, so a dialog opened\n // inside an alert dialog would repeat the alert's message id.\n id: contentProps.id ?? null,\n styles: {\n flexGrow: 1,\n padding: '$dialog-content-padding-v $dialog-padding-h',\n gap: '$dialog-content-gap',\n height: {\n '': 'max (100% - (2 * $dialog-content-padding-v))',\n ':last-child': 'max (100% - $dialog-content-padding-v)',\n },\n },\n },\n header: {\n ellipsis: true,\n styles: {\n display: 'flex',\n flow: 'row',\n gap: '1x',\n placeItems: 'center stretch',\n placeContent: 'space-between',\n padding: `$dialog-title-padding-v ${\n isDismissable ? '($dialog-padding-h + 4x)' : '$dialog-padding-h'\n } $dialog-title-padding-v $dialog-padding-h`,\n border: 'bottom',\n },\n },\n footer: {\n mods: { 'content-overflow': contentOverflows },\n styles: {\n display: 'flex',\n gap: '1x',\n flow: 'row-reverse',\n placeItems: 'baseline stretch',\n placeContent: 'space-between',\n padding: '$dialog-footer-v $dialog-padding-h',\n // A line only while the body scrolls: the footer then sits over\n // content that carries on beneath it, and the line is what says so.\n // Under a body that fits, the actions simply end it and a rule there\n // reads as clutter.\n border: {\n '': false,\n 'content-overflow': 'top',\n },\n },\n },\n buttonGroup: {\n styles: {\n flow: 'row-reverse',\n },\n },\n };\n\n return (\n <DialogElement\n ref={domRef}\n data-id=\"Dialog\"\n data-qa={qa || 'Dialog'}\n styles={styles}\n as=\"section\"\n {...dialogProps}\n mods={{ dismissable: isDismissable }}\n style={{\n '--dialog-size': `${sizePxMap[size] || sizePxMap.small}px`,\n ...style,\n }}\n data-type={type}\n data-size={size}\n >\n {dismissButton}\n\n <SlotProvider slots={slots}>\n {isDismissable && (\n <CloseButton\n icon={closeIcon || <CloseIcon size={20} />}\n aria-label={t('dialog.dismiss', 'Dismiss')}\n onPress={() => onDismiss && onDismiss()}\n />\n )}\n {children}\n </SlotProvider>\n </DialogElement>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0CA,MAAMkC,cAAc;CAClB,GAAGhC;CACH,GAAGK;CACH,GAAGF;CACH,GAAGI;CACJ;AAED,MAAM0B,gBAAgBxB,MAAM;CAC1ByB,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,MAAM;EACNC,eAAe;EACfC,SAAS;EACTC,UAAU;GACR,IAAI;GACJ,cAAc;GACf;EACDC,OAAO;GACL,IAAI;GACJ,mBAAmB;GACnB,2BAA2B;GAC3B,cAAc;GACf;EACDC,QAAQ;GACN,IAAI;GACJ,mBAAmB;GACnB,wCAAwC;GACxC,gBAAgB;GACjB;EACDC,KAAK;EACLC,QAAQ;GACN,IAAI;GACJ,gBAAgB;GACjB;EACDC,QAAQ;GACN,IAAI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ACJ;EACDf,SAAS;GAIP+B,IAAIf,aAAae,MAAM;GACvB3G,QAAQ;IACN4G,UAAU;IACVC,SAAS;IACTpG,KAAK;IACLD,QAAQ;KACN,IAAI;KACJ,eAAe;KACjB;IACF;GACD;EACDsG,QAAQ;GACNC,UAAU;GACV/G,QAAQ;IACNC,SAAS;IACTC,MAAM;IACNO,KAAK;IACLuG,YAAY;IACZC,cAAc;IACdJ,SAAS,2BACPhF,gBAAgB,6BAA6B,oBAAmB;IAElEnB,QAAQ;IACV;GACD;EACDwG,QAAQ;GACNC,MAAM,EAAE,oBAAoBb,kBAAkB;GAC9CtG,QAAQ;IACNC,SAAS;IACTQ,KAAK;IACLP,MAAM;IACN8G,YAAY;IACZC,cAAc;IACdJ,SAAS;IAKTnG,QAAQ;KACN,IAAI;KACJ,oBAAoB;KACtB;IACF;GACD;EACD0G,aAAa,EACXpH,QAAQ,EACNE,MAAM,eACR,EACF;EACD;AAED,QACE,qBAAC;EACC,KAAKuF;EACL,WAAQ;EACR,WAAS1E,MAAM;EACPf;EACR,IAAG;EACH,GAAI0F;EACJ,MAAM,EAAE2B,aAAaxF,eAAe;EACpC,OAAO;GACL,iBAAiB,GAAGP,UAAUM,SAASN,UAAUC,MAAK;GACtD,GAAG8D;GACJ;EACD,aAAWrE;EACX,aAAWY;aAEViE,eAED,qBAAC;GAAoBU;cAClB1E,iBACC,oBAAC;IACC,MAAMG,aAAa,oBAAC,aAAU,MAAM,KAAM;IAC1C,cAAYwD,EAAE,kBAAkB,UAAU;IAC1C,eAAe1D,aAAaA,WAAW;KAE1C,EACAoD;IACW;GACA;EAElB"}
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["createFocusManager","useObjectRef","BASE_STYLES","BaseProps","BaseStyleProps","BLOCK_STYLES","BlockStyleProps","DIMENSION_STYLES","DimensionStyleProps","FLOW_STYLES","Styles","tasty","forwardRef","ReactElement","Ref","useEffect","AriaDialogProps","DismissButton","FocusScope","useDialog","useI18n","CloseIcon","mergeProps","SlotProvider","extractStyles","ItemButton","useOpenTransitionContext","useDialogContext","useContentOverflow","STYLES_LIST","DialogElement","as","styles","display","flow","fill","pointerEvents","outline","position","width","height","gap","border","radius","shadow","top","CloseButton","qa","type","right","sizeMap","S","M","L","sizePxMap","small","medium","large","CubeDialogProps","Omit","size","isDismissable","onDismiss","arg","closeIcon","closeButtonStyles","role","findPriorityFocusElement","dialog","HTMLElement","button","getAttribute","querySelector","Dialog","props","ref","$","_c","transitionState","isShown","context","t0","content","isNonModalPopover","shouldContainFocus","isOpen","t1","shouldRestoreFocus","t2","DialogContent","HTMLDivElement","contextProps","children","undefined","onClose","style","otherProps","toUpperCase","t","domRef","dialogProps","titleProps","contentProps","dismissButton","setTimeout","current","activeElement","document","isFocusOutsideDialog","contains","isFocusOnDialogShell","priorityElement","focus","focusManager","focusFirst","tabbable","contentOverflows","slots","title","level","preset","id","flexGrow","padding","header","ellipsis","placeItems","placeContent","footer","mods","buttonGroup","dismissable"],"sources":["../../../../src/components/overlays/Dialog/Dialog.tsx"],"sourcesContent":["import { createFocusManager } from '@react-aria/focus';\nimport { useObjectRef } from '@react-aria/utils';\nimport {\n BASE_STYLES,\n BaseProps,\n BaseStyleProps,\n BLOCK_STYLES,\n BlockStyleProps,\n DIMENSION_STYLES,\n DimensionStyleProps,\n FLOW_STYLES,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport { forwardRef, ReactElement, Ref, useEffect } from 'react';\nimport {\n AriaDialogProps,\n DismissButton,\n FocusScope,\n useDialog,\n} from 'react-aria';\n\nimport { useI18n } from '../../../i18n';\nimport { CloseIcon } from '../../../icons/CloseIcon';\nimport { mergeProps, SlotProvider } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { ItemButton } from '../../actions/ItemButton/ItemButton';\nimport { useOpenTransitionContext } from '../Modal/OpenTransitionContext';\n\nimport { useDialogContext } from './context';\nimport { useContentOverflow } from './use-content-overflow';\n\nconst STYLES_LIST = [\n ...BASE_STYLES,\n ...DIMENSION_STYLES,\n ...BLOCK_STYLES,\n ...FLOW_STYLES,\n];\n\nconst DialogElement = tasty({\n as: 'section',\n styles: {\n display: 'flex',\n flow: 'column',\n fill: '#surface',\n pointerEvents: 'auto',\n outline: 0,\n position: {\n '': 'relative',\n 'type=panel': 'absolute',\n },\n width: {\n '': '$min-dialog-size $dialog-size (100dvw - 8x)',\n 'type=fullscreen': '(100dvw - 8x) (100dvw - 8x)',\n 'type=fullscreenTakeover': '100dvw 100dvw',\n 'type=panel': 'auto',\n },\n height: {\n '': 'auto (100dvh - 8x)',\n 'type=fullscreen': '(100dvh - 8x) (100dvh - 8x)',\n 'type=fullscreenTakeover | type=panel': '100dvh 100dvh',\n 'type=popover': 'initial initial (50dvh - 5x)',\n },\n gap: 0,\n border: {\n '': false,\n 'type=popover': true,\n },\n radius: {\n '': '1cr',\n 'type=tray': '1cr top',\n 'type=fullscreenTakeover': '0r',\n },\n shadow: {\n '': '$dialog-shadow',\n 'type=popover | type=panel': '$shadow',\n },\n top: {\n '': false,\n 'type=modal': '((50vh - 50%) / -3)',\n 'type=panel': 'auto',\n },\n '$dialog-title-padding-v': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-content-padding-v': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-padding-h': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-footer-v': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n '$dialog-content-gap': {\n '': '1.5x',\n 'type=popover': '1x',\n },\n\n // A `Form` placed directly here (`Dialog > Form > Content + Footer`) lays\n // itself out as this flex column — see `FormElement`. It is the form's own\n // state rather than a rule here, so the form's `styles` still win.\n },\n});\n\nconst CloseButton = tasty(ItemButton, {\n qa: 'ModalCloseButton',\n type: 'clear',\n styles: {\n position: 'absolute',\n top: '1x',\n right: '1x',\n },\n});\n\nconst sizeMap = {\n S: 'small',\n M: 'medium',\n L: 'large',\n};\nconst sizePxMap = {\n small: 360,\n medium: 479,\n large: 798,\n};\n\nexport interface CubeDialogProps\n extends Omit<BaseProps, 'role'>,\n AriaDialogProps,\n BaseStyleProps,\n BlockStyleProps,\n DimensionStyleProps {\n /** The size of the dialog */\n size?: 'S' | 'M' | 'L' | 'small' | 'medium' | 'large';\n /** Whether the dialog is dismissable */\n isDismissable?: boolean;\n /** Trigger when the dialog is dismissed */\n onDismiss?: (arg?: any) => void;\n /** That you can replace the close icon with */\n closeIcon?: ReactElement;\n closeButtonStyles?: Styles;\n role?: 'dialog' | 'alertdialog';\n}\n\n/**\n * The control a dialog focuses when it opens: an input marked\n * `data-autofocus`, or a submit or primary button. In an alert dialog never a\n * destructive (`danger`) button, which a reflexive Enter would run.\n */\nfunction findPriorityFocusElement(dialog: HTMLElement) {\n const button =\n dialog.getAttribute('role') === 'alertdialog'\n ? 'button:not([data-theme=\"danger\"])'\n : 'button';\n\n return dialog.querySelector<HTMLElement>(\n `input[data-autofocus], ${button}[type=\"submit\"], ${button}[data-type=\"primary\"]`,\n );\n}\n\n/**\n * Dialogs are windows containing contextual information, tasks, or workflows that appear over the user interface.\n * Depending on the kind of Dialog, further interactions may be blocked until the Dialog is acknowledged.\n */\nexport const Dialog = forwardRef(function Dialog(\n props: CubeDialogProps,\n ref: Ref<HTMLDivElement>,\n) {\n const transitionState = useOpenTransitionContext()?.transitionState;\n\n // From the first frame of the enter transition, not only once it has\n // ended: a Tab pressed while the dialog animates in would otherwise land on\n // the page behind it, and nothing would pull it back. Released as soon as\n // the dialog closes, so focus can return to the trigger during the exit.\n const isShown = transitionState === 'enter' || transitionState === 'entered';\n\n const context = useDialogContext();\n\n const content = <DialogContent key=\"content\" {...props} ref={ref} />;\n\n // A popover that is not dismissable leaves the page usable, as a panel\n // does: an outside press reaches its control, and focus has to follow it\n // there, into a text field too.\n const isNonModalPopover =\n context.type === 'popover' && context.isDismissable === false;\n\n const shouldContainFocus =\n isShown &&\n !!context.isOpen &&\n context.type !== 'panel' &&\n !isNonModalPopover;\n\n return (\n // This component traps the focus inside the dialog and restores it on\n // close. The restore is the one that matters for popover-type dialogs —\n // `DialogTrigger`'s own restore is a no-op there — so `shouldRestoreFocus`\n // has to reach it. Containment is unaffected either way.\n <FocusScope\n restoreFocus={context.shouldRestoreFocus ?? true}\n contain={shouldContainFocus}\n >\n {content}\n </FocusScope>\n );\n});\n\nconst DialogContent = forwardRef(function DialogContent(\n props: CubeDialogProps,\n ref: Ref<HTMLDivElement>,\n) {\n let { type = 'modal', ...contextProps } = useDialogContext();\n\n let {\n qa,\n children,\n size = 'M',\n // A popover shows a close button only when its `Dialog` asks for one: its\n // trigger's `isDismissable` decides whether an outside press closes it.\n isDismissable = type === 'popover' ? undefined : contextProps.isDismissable,\n onDismiss = contextProps.onClose,\n closeIcon,\n closeButtonStyles,\n style,\n ...otherProps\n } = props;\n\n size = sizeMap[size.toUpperCase()] || size;\n\n const styles: Styles = extractStyles(otherProps, STYLES_LIST);\n\n const { t } = useI18n();\n\n let domRef = useObjectRef(ref);\n // `contentProps` carries an id only for `role=\"alertdialog\"` without an\n // explicit `aria-describedby`: an alert is described by its message, while a\n // plain dialog links nothing, so opening a form does not read it aloud.\n let { dialogProps, titleProps, contentProps } = useDialog(\n mergeProps(contextProps, props),\n domRef,\n );\n\n // If rendered in a popover or tray there won't be a visible dismiss button,\n // so we render a hidden one for screen readers.\n let dismissButton;\n if (type === 'popover' || type === 'tray') {\n dismissButton = <DismissButton onDismiss={onDismiss} />;\n }\n\n // Focus the first focusable element in the dialog when it opens.\n //\n // We also re-run the priority focus logic when the dialog <section>\n // itself is the active element. This recovers from a race that occurs\n // when a popover-based component (FilterPicker, Picker, Select, …) opens\n // inside another contained Dialog: React's native `autoFocus` on the\n // inner control fires during the mutation phase, before the popover's\n // FocusScope registers in react-aria's focus-scope tree, so the outer\n // FocusScope yanks focus back. useDialog then defaults focus to the\n // dialog <section>; without re-promoting it here, the priority element\n // (e.g. the search input) is never focused.\n useEffect(() => {\n if (contextProps.isOpen) {\n setTimeout(() => {\n if (!domRef.current) return;\n\n const activeElement = document.activeElement;\n const isFocusOutsideDialog = !domRef.current.contains(activeElement);\n const isFocusOnDialogShell = activeElement === domRef.current;\n\n // Priority 1: autofocus input or primary button\n const priorityElement = findPriorityFocusElement(domRef.current);\n\n if (priorityElement && (isFocusOutsideDialog || isFocusOnDialogShell)) {\n priorityElement.focus();\n return;\n }\n\n if (isFocusOutsideDialog) {\n // Fallback: focus first tabbable element, or dialog itself\n const focusManager = createFocusManager(domRef);\n\n if (!focusManager.focusFirst({ tabbable: true })) {\n domRef.current.focus();\n }\n }\n });\n }\n }, [contextProps.isOpen]);\n\n // let hasHeader = useHasChild('[data-id=\"Header\"]', domRef);\n // let hasFooter = useHasChild('[data-id=\"Footer\"]', domRef);\n\n const contentOverflows = useContentOverflow(domRef);\n\n let slots = {\n title: {\n level: 2,\n preset: 'h4',\n ...titleProps,\n },\n content: {\n // `null` rather than `undefined` when there is none: slots reach nested\n // slot providers, and `undefined` does not override, so a dialog opened\n // inside an alert dialog would repeat the alert's message id.\n id: contentProps.id ?? null,\n styles: {\n flexGrow: 1,\n padding: '$dialog-content-padding-v $dialog-padding-h',\n gap: '$dialog-content-gap',\n height: {\n '': 'max (100% - (2 * $dialog-content-padding-v))',\n ':last-child': 'max (100% - $dialog-content-padding-v)',\n },\n },\n },\n header: {\n ellipsis: true,\n styles: {\n display: 'flex',\n flow: 'row',\n gap: '1x',\n placeItems: 'center stretch',\n placeContent: 'space-between',\n padding: `$dialog-title-padding-v ${\n isDismissable ? '($dialog-padding-h + 4x)' : '$dialog-padding-h'\n } $dialog-title-padding-v $dialog-padding-h`,\n border: 'bottom',\n },\n },\n footer: {\n mods: { 'content-overflow': contentOverflows },\n styles: {\n display: 'flex',\n gap: '1x',\n flow: 'row-reverse',\n placeItems: 'baseline stretch',\n placeContent: 'space-between',\n padding: '$dialog-footer-v $dialog-padding-h',\n // A line only while the body scrolls: the footer then sits over\n // content that carries on beneath it, and the line is what says so.\n // Under a body that fits, the actions simply end it and a rule there\n // reads as clutter.\n border: {\n '': false,\n 'content-overflow': 'top',\n },\n },\n },\n buttonGroup: {\n styles: {\n flow: 'row-reverse',\n },\n },\n };\n\n return (\n <DialogElement\n ref={domRef}\n data-id=\"Dialog\"\n data-qa={qa || 'Dialog'}\n styles={styles}\n as=\"section\"\n {...dialogProps}\n mods={{ dismissable: isDismissable }}\n style={{\n '--dialog-size': `${sizePxMap[size] || sizePxMap.small}px`,\n ...style,\n }}\n data-type={type}\n data-size={size}\n >\n {dismissButton}\n\n <SlotProvider slots={slots}>\n {isDismissable && (\n <CloseButton\n icon={closeIcon || <CloseIcon size={20} />}\n aria-label={t('dialog.dismiss', 'Dismiss')}\n onPress={() => onDismiss && onDismiss()}\n />\n )}\n {children}\n </SlotProvider>\n </DialogElement>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgCA,MAAM6B,cAAc;CAClB,GAAG3B;CACH,GAAGK;CACH,GAAGF;CACH,GAAGI;CACJ;AAED,MAAMqB,gBAAgBnB,MAAM;CAC1BoB,IAAI;CACJC,QAAQ;EACNC,SAAS;EACTC,MAAM;EACNC,MAAM;EACNC,eAAe;EACfC,SAAS;EACTC,UAAU;GACR,IAAI;GACJ,cAAc;GACf;EACDC,OAAO;GACL,IAAI;GACJ,mBAAmB;GACnB,2BAA2B;GAC3B,cAAc;GACf;EACDC,QAAQ;GACN,IAAI;GACJ,mBAAmB;GACnB,wCAAwC;GACxC,gBAAgB;GACjB;EACDC,KAAK;EACLC,QAAQ;GACN,IAAI;GACJ,gBAAgB;GACjB;EACDC,QAAQ;GACN,IAAI;GACJ,aAAa;GACb,2BAA2B;GAC5B;EACDC,QAAQ;GACN,IAAI;GACJ,6BAA6B;GAC9B;EACDC,KAAK;GACH,IAAI;GACJ,cAAc;GACd,cAAc;GACf;EACD,2BAA2B;GACzB,IAAI;GACJ,gBAAgB;GACjB;EACD,6BAA6B;GAC3B,IAAI;GACJ,gBAAgB;GACjB;EACD,qBAAqB;GACnB,IAAI;GACJ,gB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| @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { _Modal } from "../Modal/Modal.js";
|
|
3
3
|
import { _Tray } from "../Modal/Tray.js";
|
|
4
4
|
import { DialogContext } from "./context.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { _Title } from "../../content/Title.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { Button } from "../../actions/Button/Button.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { usePopoverSync } from "../../../utils/react/usePopoverSync.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTrigger.js","names":["PressResponder","useMediaQuery","Styles","Fragment","ReactElement","RefObject","useEffect","useMemo","useRef","OverlayTriggerProps","Placement","PositionProps","useOverlayPosition","useOverlayTrigger","OverlayTriggerState","useOverlayTriggerState","useEvent","generateRandomId","useCombinedRefs","useLayoutEffect","usePopoverSync","isOwnActionsPress","Modal","Popover","Tray","WithCloseBehavior","DialogContext","useDialogOpenSync","CubeDialogClose","close","CubeDialogTriggerProps","Omit","children","state","type","mobileType","placement","hideArrow","targetRef","HTMLElement","isDismissable","isKeyboardDismissDisabled","mobileViewport","styles","shouldCloseOnInteractOutside","element","Element","onDismiss","action","isOpen","onOpenChange","defaultOpen","shouldFlip","shouldUpdatePosition","containerPadding","shouldRestoreFocus","DialogTrigger","props","hideOnClose","positionProps","Array","isArray","length","Error","trigger","content","isMobile","wasOpen","isExiting","onExiting","current","onExited","dialogSyncId","syncTriggerRef","syncOverlayRef","isPopoverFlavored","menuId","onClose","triggerRef","containerRef","dismissOnInnerButtonPress","closeOnPeerOpen","emits","closes","overlayRef","console","warn","fromAction","renderOverlay","PopoverTrigger","allProps","$","_c","keepOpenOnScroll","t0","t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13","t14","triggerType","t15","anchorRef","offset","crossOffset","overlayProps","popoverProps","arrowProps","updatePosition","overlayTriggerState","Symbol","for","triggerProps","undefined","ref","triggerPropsWithRef","el","ownTrigger","popoverTriggerEl","closest","setTimeout","contains","resolveShouldCloseOnInteractOutside","style","overlay","DialogTriggerBase","wasOpenRef","dialogProps","context","hasFocusMovedOutsideDialog","activeElement","document","body","isConnected","focus","triggerExtraProps","toggle"],"sources":["../../../../src/components/overlays/Dialog/DialogTrigger.tsx"],"sourcesContent":["import { PressResponder } from '@react-aria/interactions';\nimport { useMediaQuery } from '@react-spectrum/utils';\nimport { Styles } from '@tenphi/tasty';\nimport {\n Fragment,\n ReactElement,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n OverlayTriggerProps,\n Placement,\n PositionProps,\n useOverlayPosition,\n useOverlayTrigger,\n} from 'react-aria';\nimport { OverlayTriggerState, useOverlayTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { generateRandomId } from '../../../utils/random';\nimport { useCombinedRefs, useLayoutEffect } from '../../../utils/react/index';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { isOwnActionsPress } from '../../actions/actions-run';\nimport { Modal, Popover, Tray, WithCloseBehavior } from '../Modal';\n\nimport { DialogContext } from './context';\nimport { useDialogOpenSync } from './use-dialog-open-sync';\n\nexport type CubeDialogClose = (close: () => void) => ReactElement;\n\nexport interface CubeDialogTriggerProps\n extends Omit<OverlayTriggerProps, 'type'>,\n PositionProps,\n WithCloseBehavior {\n /** The Dialog and its trigger element. See the DialogTrigger [Content section](#content) for more information on what to provide as children. */\n children: [\n ReactElement | ((state: OverlayTriggerState) => ReactElement),\n CubeDialogClose | ReactElement,\n ];\n /**\n * The type of Dialog that should be rendered. See the DialogTrigger [types section](#dialog-types) for an explanation on each.\n * @default 'modal'\n */\n type?:\n | 'modal'\n | 'popover'\n | 'tray'\n | 'fullscreen'\n | 'fullscreenTakeover'\n | 'panel';\n /** The type of Dialog rendered on mobile, defaulting to `type`. See DialogTrigger [types section](#dialog-types) for an explanation on each. */\n mobileType?:\n | 'modal'\n | 'tray'\n | 'fullscreen'\n | 'fullscreenTakeover'\n | 'panel'\n | 'popover';\n placement?: Placement;\n /**\n * Has no effect: popovers render no arrow.\n * @deprecated Popovers never render an arrow, so there is nothing to hide.\n */\n hideArrow?: boolean;\n /** The ref of the element the Dialog should visually attach itself to. Defaults to the trigger button if not defined. A popover closes when this element scrolls, as one attached to its trigger does. */\n targetRef?: RefObject<HTMLElement | null>;\n /**\n * Whether passive dismissal (Escape or an outside click) can close the dialog. Explicit dialog actions can still close it.\n * A popover that is not dismissable lets an outside press through to the control it lands on, including a text field, which can take focus. It stays open when another popover opens, and closes when a modal, tray, fullscreen or panel dialog opens from another `DialogTrigger`.\n */\n isDismissable?: boolean;\n /** Whether pressing the escape key to close the dialog should be disabled. */\n isKeyboardDismissDisabled?: boolean;\n /** The screen breakpoint for the mobile type */\n mobileViewport?: number;\n /** The style map for the overlay **/\n styles?: Styles;\n shouldCloseOnInteractOutside?: (element: Element) => boolean;\n onDismiss?: (action?: string) => void;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n defaultOpen?: boolean;\n shouldFlip?: boolean;\n shouldUpdatePosition?: boolean;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /**\n * Whether focus returns to the trigger when the dialog closes. Defaults to\n * `true`.\n *\n * The restore is skipped automatically whenever the action that closed the\n * dialog has already moved focus somewhere else, so an action that opens a\n * panel/dialog/inline editor and focuses it needs nothing here. Pass `false`\n * for the remaining case: a surface that claims focus *later* than the\n * dialog'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\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\nexport function DialogTrigger(props: CubeDialogTriggerProps) {\n let {\n children,\n type = 'modal',\n mobileType = type,\n hideArrow,\n targetRef,\n onDismiss,\n isDismissable = true,\n isKeyboardDismissDisabled,\n styles,\n mobileViewport = 700,\n hideOnClose,\n shouldCloseOnInteractOutside,\n shouldRestoreFocus = true,\n ...positionProps\n } = props;\n\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('DialogTrigger must have exactly 2 children');\n }\n // if a function is passed as the second child, it won't appear in toArray\n let [trigger, content] = children;\n\n // Apply the mobile type at the configured breakpoint.\n let isMobile = useMediaQuery(`(max-width: ${mobileViewport}px)`);\n if (isMobile) {\n // handle cases where desktop popovers need a close button for the mobile modal view\n if (type !== 'modal' && mobileType === 'modal') {\n isDismissable = true;\n }\n\n type = mobileType;\n }\n\n let state = useOverlayTriggerState(props);\n\n if (typeof trigger === 'function') {\n trigger = trigger(state);\n }\n\n let wasOpen = useRef(false);\n let isExiting = useRef(false);\n let onExiting = () => (isExiting.current = true);\n let onExited = () => (isExiting.current = false);\n\n wasOpen.current = state.isOpen;\n\n // Shared identity + refs for `usePopoverSync`. Allocating here (rather than\n // inside the branch-specific sub-trees) keeps a single sync registration for\n // the lifetime of the trigger, even when `type` flips between popover and\n // modal at the mobile breakpoint. The refs are then threaded into the\n // appropriate branch so existing positioning / useOverlayTrigger hooks keep\n // their original ref targets and `usePopoverSync`'s `contains()` check has a\n // real DOM node to query.\n const dialogSyncId = useMemo(() => generateRandomId(), []);\n const syncTriggerRef = useRef<HTMLElement | null>(null);\n const syncOverlayRef = useRef<HTMLElement | null>(null);\n\n // Only popover-type Dialogs participate in the \"press inside dismisses\n // me\" / \"peer popover opening dismisses me\" behaviours: modals, trays,\n // fullscreen and panel Dialogs are persistent workspaces and must not be\n // yanked closed via the EventBus (which would bypass `isDismissable` and\n // call `state.close()` directly). Non-popover types DO still EMIT\n // `popover:open`, so opening a modal correctly dismisses peer popovers.\n //\n // A popover that is not dismissable does not listen to `popover:open`: a\n // peer popover leaves it open, as any other outside press does. A modal,\n // tray, fullscreen or panel Dialog opening still closes it, through\n // `useDialogOpenSync` below.\n const isPopoverFlavored = type === 'popover';\n usePopoverSync({\n menuId: dialogSyncId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n triggerRef: syncTriggerRef,\n containerRef: syncOverlayRef,\n dismissOnInnerButtonPress: isPopoverFlavored,\n closeOnPeerOpen: isPopoverFlavored && isDismissable,\n });\n useDialogOpenSync({\n emits: !isPopoverFlavored,\n closes: isPopoverFlavored && !isDismissable,\n state,\n triggerRef: syncTriggerRef,\n overlayRef: syncOverlayRef,\n });\n\n useEffect(() => {\n return () => {\n if (\n (wasOpen.current || isExiting.current) &&\n type !== 'popover' &&\n type !== 'tray'\n ) {\n console.warn(\n 'CubeUIKit: A DialogTrigger unmounted while open. This is likely due to being placed within a trigger that unmounts or inside a conditional. Consider using a DialogContainer instead.',\n );\n }\n };\n }, []);\n\n function onClose(action, fromAction = false) {\n if (isDismissable || fromAction) {\n onDismiss && onDismiss(action);\n state.close();\n }\n }\n\n if (type === 'popover') {\n return (\n <PopoverTrigger\n {...positionProps}\n hideOnClose={hideOnClose}\n state={state}\n styles={styles}\n targetRef={targetRef}\n trigger={trigger}\n content={content}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n shouldRestoreFocus={shouldRestoreFocus}\n syncTriggerRef={syncTriggerRef}\n syncOverlayRef={syncOverlayRef}\n triggerType={type}\n onClose={onClose}\n />\n );\n }\n\n let renderOverlay = () => {\n switch (type) {\n case 'panel':\n case 'fullscreen':\n case 'fullscreenTakeover':\n case 'modal':\n return (\n <Modal\n ref={syncOverlayRef}\n hideOnClose={hideOnClose}\n isOpen={state.isOpen}\n isDismissable={isDismissable}\n type={type}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n styles={styles}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={onClose}\n onExiting={onExiting}\n onExited={onExited}\n >\n {typeof content === 'function' ? content(state.close) : content}\n </Modal>\n );\n case 'tray':\n return (\n <Tray\n ref={syncOverlayRef}\n hideOnClose={hideOnClose}\n isOpen={state.isOpen}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n styles={styles}\n onClose={onClose}\n >\n {typeof content === 'function' ? content(state.close) : content}\n </Tray>\n );\n }\n };\n\n return (\n <DialogTriggerBase\n type={type}\n state={state}\n isDismissable={isDismissable}\n trigger={trigger}\n overlay={renderOverlay()}\n hideOnClose={hideOnClose}\n syncTriggerRef={syncTriggerRef}\n overlayRef={syncOverlayRef}\n shouldRestoreFocus={shouldRestoreFocus}\n onClose={onClose}\n />\n );\n}\n\nfunction PopoverTrigger(allProps) {\n let {\n state,\n styles,\n targetRef,\n trigger,\n content,\n hideArrow,\n onClose,\n isDismissable,\n isKeyboardDismissDisabled,\n hideOnClose,\n shouldCloseOnInteractOutside,\n shouldRestoreFocus,\n keepOpenOnScroll,\n syncTriggerRef,\n syncOverlayRef,\n triggerType,\n ...props\n } = allProps;\n\n let triggerRef = useRef<HTMLButtonElement>(null);\n let overlayRef = useRef<HTMLDivElement>(null);\n // What the popover is positioned against, and closes on scroll with.\n let anchorRef = targetRef || triggerRef;\n\n // Mirror the trigger/overlay DOM nodes into the parent-owned sync refs.\n //\n // We deliberately do NOT use `useCombinedRefs` here: that hook returns a\n // brand new internal ref and propagates to the passed refs via a regular\n // `useEffect` (post-commit). `useOverlayPosition` below reads\n // `triggerRef.current` in its own layout effect during the SAME commit, so\n // if `triggerRef` only receives the DOM node via a delayed effect, the\n // first measurement sees `null` and the popover positions at the document\n // origin until something forces a re-measure.\n //\n // Keeping `triggerRef`/`overlayRef` as the direct React refs preserves\n // synchronous assignment for `useOverlayPosition`. The sync refs are only\n // ever read inside `popover:open` handlers, which fire via setTimeout(0),\n // so a layout-effect mirror is more than fast enough.\n useLayoutEffect(() => {\n if (syncTriggerRef) {\n syncTriggerRef.current = targetRef?.current ?? triggerRef.current ?? null;\n }\n if (syncOverlayRef) {\n syncOverlayRef.current = overlayRef.current ?? null;\n }\n });\n\n let {\n overlayProps: popoverProps,\n placement,\n arrowProps,\n updatePosition,\n } = useOverlayPosition({\n targetRef: anchorRef,\n overlayRef: overlayRef,\n placement: props.placement,\n containerPadding: props.containerPadding,\n offset: props.offset ?? 8,\n crossOffset: props.crossOffset,\n shouldFlip: props.shouldFlip,\n shouldUpdatePosition: props.shouldUpdatePosition,\n isOpen: state.isOpen,\n });\n\n let overlayTriggerState = state;\n\n if (keepOpenOnScroll) {\n overlayTriggerState = { ...state, close: updatePosition };\n }\n\n // Registers the close (or, with `keepOpenOnScroll`, the reposition) that\n // `useOverlayPosition` runs when the anchor scrolls. It is looked up by the\n // anchor element, so it has to be registered there: with `targetRef` the\n // trigger ref is never attached, and the popover stayed open while its\n // anchor scrolled away.\n let { triggerProps, overlayProps } = useOverlayTrigger(\n { type: 'dialog' },\n overlayTriggerState,\n anchorRef,\n );\n\n let triggerPropsWithRef = {\n ...triggerProps,\n ref: targetRef ? undefined : triggerRef,\n };\n\n // Mirror the Select/ComboBox/MenuTrigger pattern: when an outside click lands\n // on ANOTHER popover trigger, return `false` so react-aria's `useOverlay`\n // does NOT `stopPropagation()` the click. The click then reaches that trigger,\n // its popover opens, and `usePopoverSync` closes this one via the EventBus.\n // Without this, react-aria swallows every outside click and a single click on\n // a sibling trigger can't open it while this popover is open.\n const resolveShouldCloseOnInteractOutside = useEvent(\n (el: Element): boolean => {\n // The caller's own predicate is asked FIRST, so an explicit \"keep me open\n // for this element\" wins over every automatic behaviour below (CUB-4113).\n // It used to be consulted last, which made the prop inert for every\n // `Button` / `ItemButton`: those carry `data-popover-dismiss`, so the\n // auto-dismiss branch matched and closed the popover before the predicate\n // was ever asked.\n //\n // Asked before every lookup below, not just inside the \"outside any\n // trigger\" branch: a trigger can own interactive controls of its own, and\n // those used to be decided without the predicate ever being asked.\n //\n // React Aria hands over the element the pointer landed on — for a\n // `Button` that is the label inside it, not the `<button>` — so a\n // predicate that guards an element has to use `contains()` rather than an\n // identity check.\n if (shouldCloseOnInteractOutside && !shouldCloseOnInteractOutside(el)) {\n return false;\n }\n\n const ownTrigger = targetRef?.current ?? triggerRef.current;\n\n // A press on our OWN trigger's actions run — an `ItemButton` row's\n // `actions`, a picker's clear button — is not a press outside. The run is\n // rendered as a sibling of the trigger (see `ItemActionsWrapper`), so the\n // `contains` checks below cannot recognise it and we dismissed instead,\n // which cost the action its press: the first press on `Reset` while the\n // popover was open only closed the popover and never ran.\n if (isOwnActionsPress(el, ownTrigger)) return false;\n\n const popoverTriggerEl = el.closest('[data-popover-trigger]');\n if (!popoverTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n // Plain interactive controls (Button, ItemButton) opt in via\n // `data-popover-dismiss`. Schedule the close after the click finishes so\n // the control's `onPress` runs first instead of losing the click to\n // useOverlay's stopPropagation.\n if (el.closest('[data-popover-dismiss]')) {\n setTimeout(() => state.close(), 0);\n return false;\n }\n return true;\n }\n // Clicking our own trigger again should dismiss us.\n if (popoverTriggerEl === ownTrigger || ownTrigger?.contains(el))\n return true;\n // Another popover's trigger: let the click through so it can open.\n return false;\n },\n );\n\n let overlay = (\n <Popover\n ref={overlayRef}\n styles={styles}\n hideOnClose={hideOnClose}\n isOpen={state.isOpen}\n style={popoverProps.style}\n placement={placement ?? undefined}\n arrowProps={arrowProps}\n // Not dismissable: an outside press is left alone entirely, so it\n // reaches the control it landed on and nothing below is asked.\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow}\n shouldCloseOnInteractOutside={resolveShouldCloseOnInteractOutside}\n onClose={onClose}\n >\n {typeof content === 'function' ? content(state.close) : content}\n </Popover>\n );\n\n return (\n <DialogTriggerBase\n type=\"popover\"\n state={state}\n triggerProps={triggerPropsWithRef}\n dialogProps={overlayProps}\n trigger={trigger}\n overlay={overlay}\n overlayRef={overlayRef}\n isDismissable={isDismissable}\n shouldRestoreFocus={shouldRestoreFocus}\n onClose={onClose}\n />\n );\n}\n\nfunction DialogTriggerBase(props: any) {\n const ref = useCombinedRefs<HTMLElement>(props.ref);\n const wasOpenRef = useRef(false);\n const overlayRef: RefObject<HTMLElement | null> | undefined =\n props.overlayRef;\n\n // Mirror the press-responder DOM node into the parent's sync trigger ref.\n // Done via `useLayoutEffect` rather than threading through `useCombinedRefs`\n // for consistency with `PopoverTrigger` (see comment there) — keeps the\n // sync-ref population deterministic regardless of branch.\n useLayoutEffect(() => {\n if (props.syncTriggerRef) {\n props.syncTriggerRef.current = ref.current ?? null;\n }\n });\n\n let {\n type,\n state,\n onClose,\n isDismissable,\n dialogProps = {},\n triggerProps = {},\n overlay,\n trigger,\n shouldRestoreFocus = true,\n } = props;\n\n let context = {\n type,\n // Explicit dialog actions can close even when passive dismissal is disabled.\n onClose: (action?: string) => onClose?.(action, true),\n isDismissable,\n isOpen: state.isOpen,\n // Reaches `Dialog`'s `FocusScope`, which owns the restore for\n // popover-type dialogs (`Dialog` itself, for a retained one). `useDialog`\n // filters it out of the DOM props.\n shouldRestoreFocus,\n ...dialogProps,\n };\n\n // Whether focus has been claimed by something outside the closing dialog —\n // the signal that an action handed focus off and the trigger must not take\n // it back. Same rule as `MenuTrigger` (see CUB-3962): an action that opens\n // a panel, another dialog or an inline editor focuses that surface, and\n // restoring here would undo the hand-off.\n //\n // Focus still inside the overlay means nobody claimed it (the pressed\n // control keeps focus while the overlay plays its ~350ms exit animation),\n // and focus on `<body>` or on a detached node means the focused element\n // went away with the dialog. Both belong back on the trigger.\n const hasFocusMovedOutsideDialog = useEvent(() => {\n const activeElement = document.activeElement;\n\n if (!activeElement || activeElement === document.body) return false;\n if (!activeElement.isConnected) return false;\n\n return !(\n overlayRef?.current?.contains(activeElement) ||\n ref.current?.contains(activeElement)\n );\n });\n\n // Restore focus manually when the dialog closes.\n //\n // Live for modal/tray/fullscreen/panel types only: in the popover branch\n // `triggerProps` carries its own `ref`, which overrides the `ref={ref}` on\n // `PressResponder` below, so `ref.current` stays null and this is a no-op.\n // Popovers get their restore from `Dialog`'s own `<FocusScope restoreFocus>`\n // instead, or from `Dialog` at the end of the exit when `hideOnClose` keeps\n // that scope mounted; both decline to restore when focus moved elsewhere.\n useEffect(() => {\n if (!state.isOpen && wasOpenRef.current) {\n wasOpenRef.current = false;\n if (!shouldRestoreFocus) return;\n if (hasFocusMovedOutsideDialog()) return;\n ref.current?.focus();\n } else if (state.isOpen) {\n wasOpenRef.current = true;\n }\n }, [state.isOpen, shouldRestoreFocus, hasFocusMovedOutsideDialog]);\n\n // Mark popover-type DialogTrigger children with `data-popover-trigger` so\n // `Button` / `ItemButton`'s default dismiss-on-press behaviour treats them\n // as popover triggers (skips the dismiss). Modal/tray/fullscreen children\n // intentionally stay UNMARKED — when a modal-type DialogTrigger lives\n // inside a popover footer, pressing it should dismiss the parent popover\n // (matching the \"modal takes over\" native UX).\n const triggerExtraProps =\n type === 'popover' ? { 'data-popover-trigger': '' } : {};\n\n return (\n <Fragment>\n <PressResponder\n ref={ref}\n {...triggerProps}\n {...triggerExtraProps}\n isPressed={\n state.isOpen &&\n type !== 'modal' &&\n type !== 'fullscreen' &&\n type !== 'fullscreenTakeover'\n }\n onPress={state.toggle}\n >\n {trigger}\n </PressResponder>\n <DialogContext.Provider value={context}>{overlay}</DialogContext.Provider>\n </Fragment>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;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AAU;EACZvG;EAEA2C,UAAU7B,WAAoB6B,UAAU7B,QAAQ,KAAK;EACrDR;EACAS,QAAQhB,MAAMgB;EAIdM;EACA,GAAGiF;EACJ;CAYD,MAAME,6BAA6B1H,eAAe;EAChD,MAAM2H,gBAAgBC,SAASD;AAE/B,MAAI,CAACA,iBAAiBA,kBAAkBC,SAASC,KAAM,QAAO;AAC9D,MAAI,CAACF,cAAcG,YAAa,QAAO;AAEvC,SAAO,EACL1D,YAAYd,SAAS4D,SAASS,cAAc,IAC5ChB,IAAIrD,SAAS4D,SAASS,cAAc;GAEtC;AAUFrI,iBAAgB;AACd,MAAI,CAAC2B,MAAMgB,UAAUsF,WAAWjE,SAAS;AACvCiE,cAAWjE,UAAU;AACrB,OAAI,CAACf,mBAAoB;AACzB,OAAImF,4BAA4B,CAAE;AAClCf,OAAIrD,SAASyE,OAAO;aACX9G,MAAMgB,OACfsF,YAAWjE,UAAU;IAEtB;EAACrC,MAAMgB;EAAQM;EAAoBmF;EAA2B,CAAC;CAQlE,MAAMM,oBACJ9G,SAAS,YAAY,EAAE,wBAAwB,IAAI,GAAG,EAAE;AAE1D,QACE,qBAAC,uBACC,oBAAC;EACMyF;EACL,GAAIF;EACJ,GAAIuB;EACJ,WACE/G,MAAMgB,UACNf,SAAS,WACTA,SAAS,gBACTA,SAAS;EAEX,SAASD,MAAMgH;YAEdjF;GACa,EAChB,oBAAC,cAAc;EAAS,OAAOyE;YAAUJ;GAAgC,IAChE"}
|
|
1
|
+
{"version":3,"file":"DialogTrigger.js","names":["PressResponder","useMediaQuery","Styles","Fragment","ReactElement","RefObject","useEffect","useMemo","useRef","OverlayTriggerProps","Placement","PositionProps","useOverlayPosition","useOverlayTrigger","OverlayTriggerState","useOverlayTriggerState","useEvent","generateRandomId","useCombinedRefs","useLayoutEffect","usePopoverSync","isOwnActionsPress","Modal","Popover","Tray","WithCloseBehavior","DialogContext","useDialogOpenSync","CubeDialogClose","close","CubeDialogTriggerProps","Omit","children","state","type","mobileType","placement","hideArrow","targetRef","HTMLElement","isDismissable","isKeyboardDismissDisabled","mobileViewport","styles","shouldCloseOnInteractOutside","element","Element","onDismiss","action","isOpen","onOpenChange","defaultOpen","shouldFlip","shouldUpdatePosition","containerPadding","shouldRestoreFocus","DialogTrigger","props","hideOnClose","positionProps","Array","isArray","length","Error","trigger","content","isMobile","wasOpen","isExiting","onExiting","current","onExited","dialogSyncId","syncTriggerRef","syncOverlayRef","isPopoverFlavored","menuId","onClose","triggerRef","containerRef","dismissOnInnerButtonPress","closeOnPeerOpen","emits","closes","overlayRef","console","warn","fromAction","renderOverlay","PopoverTrigger","allProps","$","_c","keepOpenOnScroll","t0","t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13","t14","triggerType","t15","anchorRef","offset","crossOffset","overlayProps","popoverProps","arrowProps","updatePosition","overlayTriggerState","Symbol","for","triggerProps","undefined","ref","triggerPropsWithRef","el","ownTrigger","popoverTriggerEl","closest","setTimeout","contains","resolveShouldCloseOnInteractOutside","style","overlay","DialogTriggerBase","wasOpenRef","dialogProps","context","hasFocusMovedOutsideDialog","activeElement","document","body","isConnected","focus","triggerExtraProps","toggle"],"sources":["../../../../src/components/overlays/Dialog/DialogTrigger.tsx"],"sourcesContent":["import { PressResponder } from '@react-aria/interactions';\nimport { useMediaQuery } from '@react-spectrum/utils';\nimport { Styles } from '@tenphi/tasty';\nimport {\n Fragment,\n ReactElement,\n RefObject,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\nimport {\n OverlayTriggerProps,\n Placement,\n PositionProps,\n useOverlayPosition,\n useOverlayTrigger,\n} from 'react-aria';\nimport { OverlayTriggerState, useOverlayTriggerState } from 'react-stately';\n\nimport { useEvent } from '../../../_internal';\nimport { generateRandomId } from '../../../utils/random';\nimport { useCombinedRefs, useLayoutEffect } from '../../../utils/react/index';\nimport { usePopoverSync } from '../../../utils/react/usePopoverSync';\nimport { isOwnActionsPress } from '../../actions/actions-run';\nimport { Modal, Popover, Tray, WithCloseBehavior } from '../Modal';\n\nimport { DialogContext } from './context';\nimport { useDialogOpenSync } from './use-dialog-open-sync';\n\nexport type CubeDialogClose = (close: () => void) => ReactElement;\n\nexport interface CubeDialogTriggerProps\n extends Omit<OverlayTriggerProps, 'type'>,\n PositionProps,\n WithCloseBehavior {\n /** The Dialog and its trigger element. See the DialogTrigger [Content section](#content) for more information on what to provide as children. */\n children: [\n ReactElement | ((state: OverlayTriggerState) => ReactElement),\n CubeDialogClose | ReactElement,\n ];\n /**\n * The type of Dialog that should be rendered. See the DialogTrigger [types section](#dialog-types) for an explanation on each.\n * @default 'modal'\n */\n type?:\n | 'modal'\n | 'popover'\n | 'tray'\n | 'fullscreen'\n | 'fullscreenTakeover'\n | 'panel';\n /** The type of Dialog rendered on mobile, defaulting to `type`. See DialogTrigger [types section](#dialog-types) for an explanation on each. */\n mobileType?:\n | 'modal'\n | 'tray'\n | 'fullscreen'\n | 'fullscreenTakeover'\n | 'panel'\n | 'popover';\n placement?: Placement;\n /**\n * Has no effect: popovers render no arrow.\n * @deprecated Popovers never render an arrow, so there is nothing to hide.\n */\n hideArrow?: boolean;\n /** The ref of the element the Dialog should visually attach itself to. Defaults to the trigger button if not defined. A popover closes when this element scrolls, as one attached to its trigger does. */\n targetRef?: RefObject<HTMLElement | null>;\n /**\n * Whether passive dismissal (Escape or an outside click) can close the dialog. Explicit dialog actions can still close it.\n * A popover that is not dismissable lets an outside press through to the control it lands on, including a text field, which can take focus. It stays open when another popover opens, and closes when a modal, tray, fullscreen or panel dialog opens from another `DialogTrigger`.\n */\n isDismissable?: boolean;\n /** Whether pressing the escape key to close the dialog should be disabled. */\n isKeyboardDismissDisabled?: boolean;\n /** The screen breakpoint for the mobile type */\n mobileViewport?: number;\n /** The style map for the overlay **/\n styles?: Styles;\n shouldCloseOnInteractOutside?: (element: Element) => boolean;\n onDismiss?: (action?: string) => void;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n defaultOpen?: boolean;\n shouldFlip?: boolean;\n shouldUpdatePosition?: boolean;\n /** Minimum padding in pixels between the popover and viewport edges */\n containerPadding?: number;\n /**\n * Whether focus returns to the trigger when the dialog closes. Defaults to\n * `true`.\n *\n * The restore is skipped automatically whenever the action that closed the\n * dialog has already moved focus somewhere else, so an action that opens a\n * panel/dialog/inline editor and focuses it needs nothing here. Pass `false`\n * for the remaining case: a surface that claims focus *later* than the\n * dialog'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\n/**\n * DialogTrigger serves as a wrapper around a Dialog and its associated trigger, linking the Dialog's\n * open state with the trigger's press state. Additionally, it allows you to customize the type and\n * positioning of the Dialog.\n */\nexport function DialogTrigger(props: CubeDialogTriggerProps) {\n let {\n children,\n type = 'modal',\n mobileType = type,\n hideArrow,\n targetRef,\n onDismiss,\n isDismissable = true,\n isKeyboardDismissDisabled,\n styles,\n mobileViewport = 700,\n hideOnClose,\n shouldCloseOnInteractOutside,\n shouldRestoreFocus = true,\n ...positionProps\n } = props;\n\n if (!Array.isArray(children) || children.length > 2) {\n throw new Error('DialogTrigger must have exactly 2 children');\n }\n // if a function is passed as the second child, it won't appear in toArray\n let [trigger, content] = children;\n\n // Apply the mobile type at the configured breakpoint.\n let isMobile = useMediaQuery(`(max-width: ${mobileViewport}px)`);\n if (isMobile) {\n // handle cases where desktop popovers need a close button for the mobile modal view\n if (type !== 'modal' && mobileType === 'modal') {\n isDismissable = true;\n }\n\n type = mobileType;\n }\n\n let state = useOverlayTriggerState(props);\n\n if (typeof trigger === 'function') {\n trigger = trigger(state);\n }\n\n let wasOpen = useRef(false);\n let isExiting = useRef(false);\n let onExiting = () => (isExiting.current = true);\n let onExited = () => (isExiting.current = false);\n\n wasOpen.current = state.isOpen;\n\n // Shared identity + refs for `usePopoverSync`. Allocating here (rather than\n // inside the branch-specific sub-trees) keeps a single sync registration for\n // the lifetime of the trigger, even when `type` flips between popover and\n // modal at the mobile breakpoint. The refs are then threaded into the\n // appropriate branch so existing positioning / useOverlayTrigger hooks keep\n // their original ref targets and `usePopoverSync`'s `contains()` check has a\n // real DOM node to query.\n const dialogSyncId = useMemo(() => generateRandomId(), []);\n const syncTriggerRef = useRef<HTMLElement | null>(null);\n const syncOverlayRef = useRef<HTMLElement | null>(null);\n\n // Only popover-type Dialogs participate in the \"press inside dismisses\n // me\" / \"peer popover opening dismisses me\" behaviours: modals, trays,\n // fullscreen and panel Dialogs are persistent workspaces and must not be\n // yanked closed via the EventBus (which would bypass `isDismissable` and\n // call `state.close()` directly). Non-popover types DO still EMIT\n // `popover:open`, so opening a modal correctly dismisses peer popovers.\n //\n // A popover that is not dismissable does not listen to `popover:open`: a\n // peer popover leaves it open, as any other outside press does. A modal,\n // tray, fullscreen or panel Dialog opening still closes it, through\n // `useDialogOpenSync` below.\n const isPopoverFlavored = type === 'popover';\n usePopoverSync({\n menuId: dialogSyncId,\n isOpen: state.isOpen,\n onClose: () => state.close(),\n triggerRef: syncTriggerRef,\n containerRef: syncOverlayRef,\n dismissOnInnerButtonPress: isPopoverFlavored,\n closeOnPeerOpen: isPopoverFlavored && isDismissable,\n });\n useDialogOpenSync({\n emits: !isPopoverFlavored,\n closes: isPopoverFlavored && !isDismissable,\n state,\n triggerRef: syncTriggerRef,\n overlayRef: syncOverlayRef,\n });\n\n useEffect(() => {\n return () => {\n if (\n (wasOpen.current || isExiting.current) &&\n type !== 'popover' &&\n type !== 'tray'\n ) {\n console.warn(\n 'CubeUIKit: A DialogTrigger unmounted while open. This is likely due to being placed within a trigger that unmounts or inside a conditional. Consider using a DialogContainer instead.',\n );\n }\n };\n }, []);\n\n function onClose(action, fromAction = false) {\n if (isDismissable || fromAction) {\n onDismiss && onDismiss(action);\n state.close();\n }\n }\n\n if (type === 'popover') {\n return (\n <PopoverTrigger\n {...positionProps}\n hideOnClose={hideOnClose}\n state={state}\n styles={styles}\n targetRef={targetRef}\n trigger={trigger}\n content={content}\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n shouldRestoreFocus={shouldRestoreFocus}\n syncTriggerRef={syncTriggerRef}\n syncOverlayRef={syncOverlayRef}\n triggerType={type}\n onClose={onClose}\n />\n );\n }\n\n let renderOverlay = () => {\n switch (type) {\n case 'panel':\n case 'fullscreen':\n case 'fullscreenTakeover':\n case 'modal':\n return (\n <Modal\n ref={syncOverlayRef}\n hideOnClose={hideOnClose}\n isOpen={state.isOpen}\n isDismissable={isDismissable}\n type={type}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n styles={styles}\n shouldCloseOnInteractOutside={shouldCloseOnInteractOutside}\n onClose={onClose}\n onExiting={onExiting}\n onExited={onExited}\n >\n {typeof content === 'function' ? content(state.close) : content}\n </Modal>\n );\n case 'tray':\n return (\n <Tray\n ref={syncOverlayRef}\n hideOnClose={hideOnClose}\n isOpen={state.isOpen}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n styles={styles}\n onClose={onClose}\n >\n {typeof content === 'function' ? content(state.close) : content}\n </Tray>\n );\n }\n };\n\n return (\n <DialogTriggerBase\n type={type}\n state={state}\n isDismissable={isDismissable}\n trigger={trigger}\n overlay={renderOverlay()}\n hideOnClose={hideOnClose}\n syncTriggerRef={syncTriggerRef}\n overlayRef={syncOverlayRef}\n shouldRestoreFocus={shouldRestoreFocus}\n onClose={onClose}\n />\n );\n}\n\nfunction PopoverTrigger(allProps) {\n let {\n state,\n styles,\n targetRef,\n trigger,\n content,\n hideArrow,\n onClose,\n isDismissable,\n isKeyboardDismissDisabled,\n hideOnClose,\n shouldCloseOnInteractOutside,\n shouldRestoreFocus,\n keepOpenOnScroll,\n syncTriggerRef,\n syncOverlayRef,\n triggerType,\n ...props\n } = allProps;\n\n let triggerRef = useRef<HTMLButtonElement>(null);\n let overlayRef = useRef<HTMLDivElement>(null);\n // What the popover is positioned against, and closes on scroll with.\n let anchorRef = targetRef || triggerRef;\n\n // Mirror the trigger/overlay DOM nodes into the parent-owned sync refs.\n //\n // We deliberately do NOT use `useCombinedRefs` here: that hook returns a\n // brand new internal ref and propagates to the passed refs via a regular\n // `useEffect` (post-commit). `useOverlayPosition` below reads\n // `triggerRef.current` in its own layout effect during the SAME commit, so\n // if `triggerRef` only receives the DOM node via a delayed effect, the\n // first measurement sees `null` and the popover positions at the document\n // origin until something forces a re-measure.\n //\n // Keeping `triggerRef`/`overlayRef` as the direct React refs preserves\n // synchronous assignment for `useOverlayPosition`. The sync refs are only\n // ever read inside `popover:open` handlers, which fire via setTimeout(0),\n // so a layout-effect mirror is more than fast enough.\n useLayoutEffect(() => {\n if (syncTriggerRef) {\n syncTriggerRef.current = targetRef?.current ?? triggerRef.current ?? null;\n }\n if (syncOverlayRef) {\n syncOverlayRef.current = overlayRef.current ?? null;\n }\n });\n\n let {\n overlayProps: popoverProps,\n placement,\n arrowProps,\n updatePosition,\n } = useOverlayPosition({\n targetRef: anchorRef,\n overlayRef: overlayRef,\n placement: props.placement,\n containerPadding: props.containerPadding,\n offset: props.offset ?? 8,\n crossOffset: props.crossOffset,\n shouldFlip: props.shouldFlip,\n shouldUpdatePosition: props.shouldUpdatePosition,\n isOpen: state.isOpen,\n });\n\n let overlayTriggerState = state;\n\n if (keepOpenOnScroll) {\n overlayTriggerState = { ...state, close: updatePosition };\n }\n\n // Registers the close (or, with `keepOpenOnScroll`, the reposition) that\n // `useOverlayPosition` runs when the anchor scrolls. It is looked up by the\n // anchor element, so it has to be registered there: with `targetRef` the\n // trigger ref is never attached, and the popover stayed open while its\n // anchor scrolled away.\n let { triggerProps, overlayProps } = useOverlayTrigger(\n { type: 'dialog' },\n overlayTriggerState,\n anchorRef,\n );\n\n let triggerPropsWithRef = {\n ...triggerProps,\n ref: targetRef ? undefined : triggerRef,\n };\n\n // Mirror the Select/ComboBox/MenuTrigger pattern: when an outside click lands\n // on ANOTHER popover trigger, return `false` so react-aria's `useOverlay`\n // does NOT `stopPropagation()` the click. The click then reaches that trigger,\n // its popover opens, and `usePopoverSync` closes this one via the EventBus.\n // Without this, react-aria swallows every outside click and a single click on\n // a sibling trigger can't open it while this popover is open.\n const resolveShouldCloseOnInteractOutside = useEvent(\n (el: Element): boolean => {\n // The caller's own predicate is asked FIRST, so an explicit \"keep me open\n // for this element\" wins over every automatic behaviour below (CUB-4113).\n // It used to be consulted last, which made the prop inert for every\n // `Button` / `ItemButton`: those carry `data-popover-dismiss`, so the\n // auto-dismiss branch matched and closed the popover before the predicate\n // was ever asked.\n //\n // Asked before every lookup below, not just inside the \"outside any\n // trigger\" branch: a trigger can own interactive controls of its own, and\n // those used to be decided without the predicate ever being asked.\n //\n // React Aria hands over the element the pointer landed on — for a\n // `Button` that is the label inside it, not the `<button>` — so a\n // predicate that guards an element has to use `contains()` rather than an\n // identity check.\n if (shouldCloseOnInteractOutside && !shouldCloseOnInteractOutside(el)) {\n return false;\n }\n\n const ownTrigger = targetRef?.current ?? triggerRef.current;\n\n // A press on our OWN trigger's actions run — an `ItemButton` row's\n // `actions`, a picker's clear button — is not a press outside. The run is\n // rendered as a sibling of the trigger (see `ItemActionsWrapper`), so the\n // `contains` checks below cannot recognise it and we dismissed instead,\n // which cost the action its press: the first press on `Reset` while the\n // popover was open only closed the popover and never ran.\n if (isOwnActionsPress(el, ownTrigger)) return false;\n\n const popoverTriggerEl = el.closest('[data-popover-trigger]');\n if (!popoverTriggerEl) {\n if (el.closest('[data-popover-keep]')) return false;\n // Plain interactive controls (Button, ItemButton) opt in via\n // `data-popover-dismiss`. Schedule the close after the click finishes so\n // the control's `onPress` runs first instead of losing the click to\n // useOverlay's stopPropagation.\n if (el.closest('[data-popover-dismiss]')) {\n setTimeout(() => state.close(), 0);\n return false;\n }\n return true;\n }\n // Clicking our own trigger again should dismiss us.\n if (popoverTriggerEl === ownTrigger || ownTrigger?.contains(el))\n return true;\n // Another popover's trigger: let the click through so it can open.\n return false;\n },\n );\n\n let overlay = (\n <Popover\n ref={overlayRef}\n styles={styles}\n hideOnClose={hideOnClose}\n isOpen={state.isOpen}\n style={popoverProps.style}\n placement={placement ?? undefined}\n arrowProps={arrowProps}\n // Not dismissable: an outside press is left alone entirely, so it\n // reaches the control it landed on and nothing below is asked.\n isDismissable={isDismissable}\n isKeyboardDismissDisabled={isKeyboardDismissDisabled}\n hideArrow={hideArrow}\n shouldCloseOnInteractOutside={resolveShouldCloseOnInteractOutside}\n onClose={onClose}\n >\n {typeof content === 'function' ? content(state.close) : content}\n </Popover>\n );\n\n return (\n <DialogTriggerBase\n type=\"popover\"\n state={state}\n triggerProps={triggerPropsWithRef}\n dialogProps={overlayProps}\n trigger={trigger}\n overlay={overlay}\n overlayRef={overlayRef}\n isDismissable={isDismissable}\n shouldRestoreFocus={shouldRestoreFocus}\n onClose={onClose}\n />\n );\n}\n\nfunction DialogTriggerBase(props: any) {\n const ref = useCombinedRefs<HTMLElement>(props.ref);\n const wasOpenRef = useRef(false);\n const overlayRef: RefObject<HTMLElement | null> | undefined =\n props.overlayRef;\n\n // Mirror the press-responder DOM node into the parent's sync trigger ref.\n // Done via `useLayoutEffect` rather than threading through `useCombinedRefs`\n // for consistency with `PopoverTrigger` (see comment there) — keeps the\n // sync-ref population deterministic regardless of branch.\n useLayoutEffect(() => {\n if (props.syncTriggerRef) {\n props.syncTriggerRef.current = ref.current ?? null;\n }\n });\n\n let {\n type,\n state,\n onClose,\n isDismissable,\n dialogProps = {},\n triggerProps = {},\n overlay,\n trigger,\n shouldRestoreFocus = true,\n } = props;\n\n let context = {\n type,\n // Explicit dialog actions can close even when passive dismissal is disabled.\n onClose: (action?: string) => onClose?.(action, true),\n isDismissable,\n isOpen: state.isOpen,\n // Reaches `Dialog`'s `FocusScope`, which owns the restore for\n // popover-type dialogs. `useDialog` filters it out of the DOM props.\n shouldRestoreFocus,\n ...dialogProps,\n };\n\n // Whether focus has been claimed by something outside the closing dialog —\n // the signal that an action handed focus off and the trigger must not take\n // it back. Same rule as `MenuTrigger` (see CUB-3962): an action that opens\n // a panel, another dialog or an inline editor focuses that surface, and\n // restoring here would undo the hand-off.\n //\n // Focus still inside the overlay means nobody claimed it (the pressed\n // control keeps focus while the overlay plays its ~350ms exit animation),\n // and focus on `<body>` or on a detached node means the focused element\n // went away with the dialog. Both belong back on the trigger.\n const hasFocusMovedOutsideDialog = useEvent(() => {\n const activeElement = document.activeElement;\n\n if (!activeElement || activeElement === document.body) return false;\n if (!activeElement.isConnected) return false;\n\n return !(\n overlayRef?.current?.contains(activeElement) ||\n ref.current?.contains(activeElement)\n );\n });\n\n // Restore focus manually when the dialog closes.\n //\n // Live for modal/tray/fullscreen/panel types only: in the popover branch\n // `triggerProps` carries its own `ref`, which overrides the `ref={ref}` on\n // `PressResponder` below, so `ref.current` stays null and this is a no-op.\n // Popovers get their restore from `Dialog`'s own `<FocusScope restoreFocus>`\n // instead, which already declines to restore when focus moved elsewhere.\n useEffect(() => {\n if (!state.isOpen && wasOpenRef.current) {\n wasOpenRef.current = false;\n if (!shouldRestoreFocus) return;\n if (hasFocusMovedOutsideDialog()) return;\n ref.current?.focus();\n } else if (state.isOpen) {\n wasOpenRef.current = true;\n }\n }, [state.isOpen, shouldRestoreFocus, hasFocusMovedOutsideDialog]);\n\n // Mark popover-type DialogTrigger children with `data-popover-trigger` so\n // `Button` / `ItemButton`'s default dismiss-on-press behaviour treats them\n // as popover triggers (skips the dismiss). Modal/tray/fullscreen children\n // intentionally stay UNMARKED — when a modal-type DialogTrigger lives\n // inside a popover footer, pressing it should dismiss the parent popover\n // (matching the \"modal takes over\" native UX).\n const triggerExtraProps =\n type === 'popover' ? { 'data-popover-trigger': '' } : {};\n\n return (\n <Fragment>\n <PressResponder\n ref={ref}\n {...triggerProps}\n {...triggerExtraProps}\n isPressed={\n state.isOpen &&\n type !== 'modal' &&\n type !== 'fullscreen' &&\n type !== 'fullscreenTakeover'\n }\n onPress={state.toggle}\n >\n {trigger}\n </PressResponder>\n <DialogContext.Provider value={context}>{overlay}</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,EAAE,EACjBY,SACArE,SACAT,qBAAqB,SACnBE;CAEJ,IAAIgF,UAAU;EACZvG;EAEA2C,UAAU7B,WAAoB6B,UAAU7B,QAAQ,KAAK;EACrDR;EACAS,QAAQhB,MAAMgB;EAGdM;EACA,GAAGiF;EACJ;CAYD,MAAME,6BAA6B1H,eAAe;EAChD,MAAM2H,gBAAgBC,SAASD;AAE/B,MAAI,CAACA,iBAAiBA,kBAAkBC,SAASC,KAAM,QAAO;AAC9D,MAAI,CAACF,cAAcG,YAAa,QAAO;AAEvC,SAAO,EACL1D,YAAYd,SAAS4D,SAASS,cAAc,IAC5ChB,IAAIrD,SAAS4D,SAASS,cAAc;GAEtC;AASFrI,iBAAgB;AACd,MAAI,CAAC2B,MAAMgB,UAAUsF,WAAWjE,SAAS;AACvCiE,cAAWjE,UAAU;AACrB,OAAI,CAACf,mBAAoB;AACzB,OAAImF,4BAA4B,CAAE;AAClCf,OAAIrD,SAASyE,OAAO;aACX9G,MAAMgB,OACfsF,YAAWjE,UAAU;IAEtB;EAACrC,MAAMgB;EAAQM;EAAoBmF;EAA2B,CAAC;CAQlE,MAAMM,oBACJ9G,SAAS,YAAY,EAAE,wBAAwB,IAAI,GAAG,EAAE;AAE1D,QACE,qBAAC,uBACC,oBAAC;EACMyF;EACL,GAAIF;EACJ,GAAIuB;EACJ,WACE/G,MAAMgB,UACNf,SAAS,WACTA,SAAS,gBACTA,SAAS;EAEX,SAASD,MAAMgH;YAEdjF;GACa,EAChB,oBAAC,cAAc;EAAS,OAAOyE;YAAUJ;GAAgC,IAChE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
import { useLayoutEffect as useLayoutEffect$1 } from "../../../utils/react/useLayoutEffect.js";
|
|
3
3
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
4
4
|
import { _Title } from "../../content/Title.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["createContext","HTMLAttributes","useContext","invariant","DialogContextValue","HTMLElement","type","isDismissable","onClose","arg","isOpen","shouldRestoreFocus","DialogContext","useDialogContext","dialogContext"],"sources":["../../../../src/components/overlays/Dialog/context.tsx"],"sourcesContent":["import { createContext, HTMLAttributes, useContext } from 'react';\nimport invariant from 'tiny-invariant';\n\nexport interface DialogContextValue extends HTMLAttributes<HTMLElement> {\n type?:\n | 'modal'\n | 'popover'\n | 'tray'\n | 'fullscreen'\n | 'fullscreenTakeover'\n | 'panel';\n isDismissable?: boolean;\n onClose?: (arg?: string) => void;\n isOpen?: boolean;\n /**\n * Whether closing the dialog restores focus to its trigger. Set by\n * `DialogTrigger`'s `shouldRestoreFocus` prop; consumed by `Dialog`'s\n * `FocusScope` (which owns the restore for popover-type dialogs)
|
|
1
|
+
{"version":3,"file":"context.js","names":["createContext","HTMLAttributes","useContext","invariant","DialogContextValue","HTMLElement","type","isDismissable","onClose","arg","isOpen","shouldRestoreFocus","DialogContext","useDialogContext","dialogContext"],"sources":["../../../../src/components/overlays/Dialog/context.tsx"],"sourcesContent":["import { createContext, HTMLAttributes, useContext } from 'react';\nimport invariant from 'tiny-invariant';\n\nexport interface DialogContextValue extends HTMLAttributes<HTMLElement> {\n type?:\n | 'modal'\n | 'popover'\n | 'tray'\n | 'fullscreen'\n | 'fullscreenTakeover'\n | 'panel';\n isDismissable?: boolean;\n onClose?: (arg?: string) => void;\n isOpen?: boolean;\n /**\n * Whether closing the dialog restores focus to its trigger. Set by\n * `DialogTrigger`'s `shouldRestoreFocus` prop; consumed by `Dialog`'s\n * `FocusScope` (which owns the restore for popover-type dialogs). Defaults\n * to `true` when absent, so a `Dialog` rendered outside a trigger keeps\n * restoring focus.\n */\n shouldRestoreFocus?: boolean;\n}\n\nexport const DialogContext = createContext<DialogContextValue | null>({});\n\nexport function useDialogContext() {\n const dialogContext = useContext(DialogContext);\n\n invariant(dialogContext !== null, '');\n\n return dialogContext;\n}\n"],"mappings":";;;;;AAwBA,MAAaY,gBAAgBZ,cAAyC,EAAE,CAAC;AAEzE,SAAOa,mBAAA;CACL,MAAAC,gBAAsBZ,WAAWU,cAAc;AAE/CT,WAAUW,kBAAkB,MAAM,GAAG;AAAA,QAE9BA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-13874a9 | Cube Dev Team */
|
|
2
2
|
//#region src/components/overlays/Dialog/default-button-text.ts
|
|
3
3
|
/**
|
|
4
4
|
* Gives a dialog's built-in button its default text without overriding the
|