@cube-dev/ui-kit 0.0.0-canary-900eb1f → 0.0.0-canary-e852864
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/README.md +1 -1
- package/dist/README.md +1 -1
- package/dist/_internal/hooks/use-debounced-value.js +2 -2
- package/dist/_internal/hooks/use-deprecation-warning.js +2 -2
- package/dist/_internal/hooks/use-event.js +4 -16
- package/dist/_internal/hooks/use-event.js.map +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +2 -2
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +2 -2
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +2 -2
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +2 -2
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.d.ts +2 -2
- package/dist/components/Root.js +2 -2
- package/dist/components/actions/Action/Action.js +2 -2
- package/dist/components/actions/Banner/Banner.d.ts +4 -4
- package/dist/components/actions/Banner/Banner.js +2 -2
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +2 -2
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +2 -2
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +2 -2
- package/dist/components/actions/ItemActionContext.d.ts +2 -2
- package/dist/components/actions/ItemActionContext.js +2 -2
- package/dist/components/actions/ItemActionsWrapper.js +2 -2
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +2 -2
- package/dist/components/actions/Menu/Menu.js +2 -2
- package/dist/components/actions/Menu/MenuItem.d.ts +4 -4
- package/dist/components/actions/Menu/MenuItem.js +2 -2
- package/dist/components/actions/Menu/MenuSection.d.ts +2 -2
- package/dist/components/actions/Menu/MenuSection.js +2 -2
- package/dist/components/actions/Menu/MenuTrigger.js +2 -2
- 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 +2 -2
- package/dist/components/content/Alert/Alert.js +2 -2
- package/dist/components/content/Alert/use-alert.js +2 -2
- package/dist/components/content/Avatar/Avatar.js +2 -2
- package/dist/components/content/Badge/Badge.js +2 -2
- package/dist/components/content/Card/Card.js +2 -2
- package/dist/components/content/Content.js +2 -2
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.d.ts +36 -35
- package/dist/components/content/CopySnippet/CopySnippet.js +2 -2
- package/dist/components/content/Disclosure/Disclosure.js +2 -2
- package/dist/components/content/Divider.js +2 -2
- package/dist/components/content/Footer.js +2 -2
- package/dist/components/content/Header.js +2 -2
- package/dist/components/content/HotKeys/HotKeys.js +2 -2
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +2 -2
- package/dist/components/content/Item/Item.js +2 -2
- package/dist/components/content/ItemBadge/ItemBadge.js +2 -2
- package/dist/components/content/ItemCard/ItemCard.js +2 -2
- package/dist/components/content/Layout/GridLayout.js +2 -2
- package/dist/components/content/Layout/Layout.js +16 -7
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +2 -2
- package/dist/components/content/Layout/LayoutCenter.js +2 -2
- package/dist/components/content/Layout/LayoutContainer.js +2 -2
- package/dist/components/content/Layout/LayoutContent.js +2 -2
- package/dist/components/content/Layout/LayoutContext.d.ts +1 -0
- package/dist/components/content/Layout/LayoutContext.js +111 -69
- package/dist/components/content/Layout/LayoutContext.js.map +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +2 -2
- package/dist/components/content/Layout/LayoutFooter.js +2 -2
- package/dist/components/content/Layout/LayoutGrid.js +2 -2
- package/dist/components/content/Layout/LayoutHeader.js +2 -2
- package/dist/components/content/Layout/LayoutPane.js +2 -2
- package/dist/components/content/Layout/LayoutPanel.js +8 -3
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +2 -2
- package/dist/components/content/Layout/LayoutPanelTransition.js +119 -0
- package/dist/components/content/Layout/LayoutPanelTransition.js.map +1 -0
- package/dist/components/content/Layout/LayoutToolbar.js +2 -2
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +2 -2
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +2 -2
- package/dist/components/content/Placeholder/Placeholder.js +2 -2
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.d.ts +2 -2
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +2 -2
- package/dist/components/content/Result/Result.js +2 -2
- package/dist/components/content/Skeleton/Skeleton.d.ts +10 -10
- package/dist/components/content/Skeleton/Skeleton.js +2 -2
- package/dist/components/content/Tag/Tag.js +2 -2
- package/dist/components/content/Text.d.ts +84 -84
- package/dist/components/content/Text.js +2 -2
- package/dist/components/content/TextItem/TextItem.js +2 -2
- package/dist/components/content/Title.js +2 -2
- 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 +2 -2
- package/dist/components/content/Tree/use-load-data.js +2 -2
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.d.ts +1 -0
- package/dist/components/content/use-auto-tooltip.js +2 -2
- package/dist/components/content/use-auto-tooltip.js.map +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +2 -2
- package/dist/components/data/ItemTable/ItemTableBulkBar.d.ts +2 -2
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +2 -2
- package/dist/components/data/ItemTable/ItemTableFooter.js +2 -2
- package/dist/components/data/ItemTable/ItemTableToolbar.d.ts +3 -3
- package/dist/components/data/ItemTable/ItemTableToolbar.js +2 -2
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +2 -2
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +2 -2
- package/dist/components/data/ItemTable/use-item-table-pagination.js +2 -2
- package/dist/components/data/ItemTable/use-item-table-selection.js +2 -2
- package/dist/components/data/ItemTable/use-item-table-sort.js +2 -2
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +2 -2
- package/dist/components/data/TableBase/ColumnResizer.js +2 -2
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +2 -2
- package/dist/components/data/TableBase/TableRow.js +2 -2
- package/dist/components/data/TableBase/TableView.d.ts +1 -0
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +2 -2
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.d.ts +2 -2
- 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 +2 -2
- package/dist/components/data/TableBase/use-column-order.js +2 -2
- package/dist/components/data/TableBase/use-container-width.js +2 -2
- package/dist/components/data/TableBase/use-row-move-animation.js +2 -2
- package/dist/components/data/TableBase/use-scrollability.js +2 -2
- package/dist/components/data/TableBase/use-table-columns.js +2 -2
- package/dist/components/data/TableBase/use-table-search.js +30 -100
- package/dist/components/data/TableBase/use-table-search.js.map +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +2 -2
- package/dist/components/data/TableBase/use-table-sorts.js +2 -2
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +2 -2
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +2 -2
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +2 -2
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +2 -2
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +2 -2
- package/dist/components/fields/ComboBox/ComboBox.js +2 -2
- 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 +2 -2
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +2 -2
- package/dist/components/fields/DatePicker/DatePicker.js +2 -2
- package/dist/components/fields/DatePicker/DatePickerButton.js +2 -2
- 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 +2 -2
- package/dist/components/fields/DatePicker/DateRangePicker.js +2 -2
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +2 -2
- package/dist/components/fields/DatePicker/MonthPicker.js +2 -2
- package/dist/components/fields/DatePicker/PeriodPicker.js +2 -2
- package/dist/components/fields/DatePicker/QuarterPicker.js +2 -2
- package/dist/components/fields/DatePicker/TimeInput.js +2 -2
- package/dist/components/fields/DatePicker/WeekPicker.js +2 -2
- package/dist/components/fields/DatePicker/YearPicker.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/components/fields/ListBox/ListBox.js +2 -2
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.d.ts +1 -0
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +2 -2
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +2 -2
- package/dist/components/fields/NumberInput/NumberInput.js +2 -2
- package/dist/components/fields/NumberInput/StepButton.js +2 -2
- package/dist/components/fields/PasswordInput/PasswordInput.js +2 -2
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.d.ts +8 -8
- package/dist/components/fields/RadioGroup/Radio.js +2 -2
- package/dist/components/fields/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +2 -2
- package/dist/components/fields/SearchInput/SearchInput.js +2 -2
- package/dist/components/fields/Select/Select.d.ts +2 -1
- package/dist/components/fields/Select/Select.js +2 -2
- package/dist/components/fields/Slider/Gradation.js +2 -2
- package/dist/components/fields/Slider/HueSlider.js +2 -2
- package/dist/components/fields/Slider/RangeSlider.js +2 -2
- package/dist/components/fields/Slider/Slider.js +2 -2
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js.map +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +2 -2
- package/dist/components/fields/Slider/SliderTrack.js +2 -2
- 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 +2 -2
- package/dist/components/fields/TagInput/TagInput.js +2 -2
- package/dist/components/fields/TagInput/TagList.js +2 -2
- package/dist/components/fields/TagInput/useActiveOption.js +2 -2
- package/dist/components/fields/TagInput/useTagError.js +2 -2
- package/dist/components/fields/TextArea/TextArea.js +2 -2
- package/dist/components/fields/TextInput/TextInput.js +2 -2
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +2 -2
- package/dist/components/fields/TriggerActions.js +2 -2
- package/dist/components/fields/color/ColorPanel.js +2 -2
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +2 -2
- package/dist/components/form/Form/Field.d.ts +2 -2
- package/dist/components/form/Form/Field.js +2 -2
- package/dist/components/form/Form/Form.d.ts +2 -1
- package/dist/components/form/Form/Form.js +2 -2
- package/dist/components/form/Form/ModernFormRoot.js +2 -2
- package/dist/components/form/Form/ResetButton/ResetButton.js +2 -2
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +2 -2
- package/dist/components/form/Form/SubmitError.js +2 -2
- 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 +2 -2
- 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.d.ts +2 -2
- package/dist/components/form/Form/modern/react.js +2 -2
- 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 +2 -2
- package/dist/components/form/Form/use-field/use-field-props.js +2 -2
- 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.d.ts +2 -1
- package/dist/components/form/Label.js +2 -2
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.d.ts +2 -2
- package/dist/components/form/validation/ValidationIndicator.js +2 -2
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +2 -2
- package/dist/components/form/wrapper.d.ts +2 -2
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +2 -2
- package/dist/components/helpers/IconSwitch/IconSwitch.d.ts +2 -2
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +2 -2
- package/dist/components/layout/Board/BoardProvider.d.ts +2 -2
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +2 -2
- package/dist/components/layout/Board/board-context.d.ts +2 -2
- package/dist/components/layout/Board/board-context.js +2 -2
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +2 -2
- package/dist/components/layout/Flow.js +2 -2
- package/dist/components/layout/Grid.js +2 -2
- package/dist/components/layout/Panel.js +2 -2
- package/dist/components/layout/Prefix.js +2 -2
- package/dist/components/layout/ResizablePanel.js +83 -208
- package/dist/components/layout/ResizablePanel.js.map +1 -1
- package/dist/components/layout/Space.js +2 -2
- package/dist/components/layout/Suffix.js +2 -2
- package/dist/components/navigation/Pagination/Pagination.js +2 -2
- package/dist/components/navigation/Pagination/use-pagination.js +2 -2
- package/dist/components/navigation/Tabs/DraggableTabList.js +2 -2
- package/dist/components/navigation/Tabs/TabButton.js +2 -2
- package/dist/components/navigation/Tabs/TabDropIndicator.js +2 -2
- package/dist/components/navigation/Tabs/TabPanel.js +2 -2
- package/dist/components/navigation/Tabs/TabPicker.js +2 -2
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +2 -2
- package/dist/components/navigation/Tabs/TabsContext.js +2 -2
- 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 +2 -2
- package/dist/components/navigation/Tabs/use-tab-indicator.js +2 -2
- package/dist/components/organisms/StatsCard/StatsCard.d.ts +2 -2
- package/dist/components/organisms/StatsCard/StatsCard.js +2 -2
- package/dist/components/other/Calendar/Calendar.js +2 -2
- package/dist/components/other/Calendar/CalendarCell.js +2 -2
- package/dist/components/other/Calendar/CalendarGrid.js +2 -2
- package/dist/components/other/Calendar/CalendarHeader.js +2 -2
- package/dist/components/other/Calendar/CalendarPanel.js +2 -2
- package/dist/components/other/Calendar/PeriodCalendar.js +2 -2
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +2 -2
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +2 -2
- package/dist/components/other/NoDataIcon/NoDataIcon.d.ts +2 -2
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +2 -2
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.d.ts +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +2 -2
- package/dist/components/overlays/AlertDialog/AlertDialogZone.d.ts +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +2 -2
- package/dist/components/overlays/Dialog/Dialog.js +2 -2
- package/dist/components/overlays/Dialog/DialogContainer.d.ts +2 -2
- package/dist/components/overlays/Dialog/DialogContainer.js +2 -2
- package/dist/components/overlays/Dialog/DialogForm.js +2 -2
- package/dist/components/overlays/Dialog/DialogTrigger.d.ts +2 -2
- package/dist/components/overlays/Dialog/DialogTrigger.js +2 -2
- package/dist/components/overlays/Dialog/ModernDialogForm.js +2 -2
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +2 -2
- package/dist/components/overlays/Dialog/use-dialog-container.d.ts +2 -2
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +2 -2
- 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 +2 -2
- package/dist/components/overlays/Modal/Tray.js +2 -2
- package/dist/components/overlays/Modal/Underlay.js +2 -2
- package/dist/components/overlays/Notifications/Notification.js +2 -2
- package/dist/components/overlays/Notifications/NotificationAction.d.ts +2 -2
- package/dist/components/overlays/Notifications/NotificationAction.js +2 -2
- package/dist/components/overlays/Notifications/NotificationCard.d.ts +2 -2
- package/dist/components/overlays/Notifications/NotificationCard.js +2 -2
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.d.ts +2 -2
- package/dist/components/overlays/Notifications/NotificationItem.js +2 -2
- package/dist/components/overlays/Notifications/OverlayContainer.js +2 -2
- package/dist/components/overlays/Notifications/OverlayProvider.d.ts +2 -2
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.d.ts +2 -2
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +2 -2
- 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 +2 -2
- package/dist/components/overlays/Notifications/use-persistent-state.js +2 -2
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +2 -2
- package/dist/components/overlays/Toast/index.js +2 -2
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +3 -2
- package/dist/components/overlays/Toast/useToast.js.map +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +2 -2
- package/dist/components/overlays/Tooltip/TooltipProvider.js +2 -2
- package/dist/components/overlays/Tooltip/TooltipTrigger.d.ts +2 -2
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +2 -2
- 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.d.ts +2 -2
- package/dist/components/portal/Portal.js +2 -2
- package/dist/components/portal/PortalProvider.js +2 -2
- package/dist/components/portal/usePortal.js +26 -72
- package/dist/components/portal/usePortal.js.map +1 -1
- package/dist/components/shared/DraggableCollection.js +115 -261
- package/dist/components/shared/DraggableCollection.js.map +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.d.ts +2 -2
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +2 -2
- package/dist/components/status/Spin/Cube.js +2 -2
- package/dist/components/status/Spin/InternalSpinner.js +2 -2
- package/dist/components/status/Spin/Spin.d.ts +2 -2
- package/dist/components/status/Spin/Spin.js +2 -2
- package/dist/components/status/Spin/SpinsContainer.js +2 -2
- 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.d.ts +2 -2
- package/dist/i18n/I18nProvider.js +2 -2
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/useFormatter.js +2 -2
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.d.ts +2 -2
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.d.ts +2 -2
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.d.ts +2 -2
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.d.ts +2 -2
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.d.ts +2 -2
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.d.ts +2 -2
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.d.ts +2 -2
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.d.ts +2 -2
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.d.ts +2 -2
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.d.ts +2 -2
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.d.ts +2 -2
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.d.ts +2 -2
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.d.ts +2 -2
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.d.ts +2 -2
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.d.ts +2 -2
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.d.ts +2 -2
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.d.ts +2 -2
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.d.ts +2 -2
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.d.ts +2 -2
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.d.ts +2 -2
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.d.ts +2 -2
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.d.ts +2 -2
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.d.ts +2 -2
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.d.ts +2 -2
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.d.ts +2 -2
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.d.ts +2 -2
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.d.ts +2 -2
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.d.ts +2 -2
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.d.ts +2 -2
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.d.ts +2 -2
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.d.ts +2 -2
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.d.ts +2 -2
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.d.ts +2 -2
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.d.ts +2 -2
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.d.ts +2 -2
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.d.ts +2 -2
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.d.ts +2 -2
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.d.ts +2 -2
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.d.ts +2 -2
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.d.ts +2 -2
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.d.ts +2 -2
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.d.ts +2 -2
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.d.ts +2 -2
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.d.ts +2 -2
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.d.ts +2 -2
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.d.ts +2 -2
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.d.ts +2 -2
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.d.ts +2 -2
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.d.ts +2 -2
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.d.ts +2 -2
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.d.ts +2 -2
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.d.ts +2 -2
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.d.ts +2 -2
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.d.ts +2 -2
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.d.ts +2 -2
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +2 -2
- package/dist/icons/DonutIcon.d.ts +2 -2
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.d.ts +2 -2
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.d.ts +2 -2
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.d.ts +2 -2
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.d.ts +2 -2
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.d.ts +2 -2
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.d.ts +2 -2
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.d.ts +2 -2
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.d.ts +2 -2
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.d.ts +2 -2
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.d.ts +2 -2
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.d.ts +2 -2
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.d.ts +2 -2
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.d.ts +2 -2
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.d.ts +2 -2
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.d.ts +2 -2
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.d.ts +2 -2
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +2 -2
- package/dist/icons/InfoCircleIcon.d.ts +2 -2
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.d.ts +2 -2
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.d.ts +2 -2
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.d.ts +2 -2
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.d.ts +2 -2
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.d.ts +2 -2
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.d.ts +2 -2
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.d.ts +2 -2
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.d.ts +2 -2
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.d.ts +2 -2
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.d.ts +2 -2
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.d.ts +2 -2
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.d.ts +2 -2
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.d.ts +2 -2
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.d.ts +2 -2
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.d.ts +2 -2
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.d.ts +2 -2
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.d.ts +2 -2
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.d.ts +2 -2
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.d.ts +2 -2
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.d.ts +2 -2
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.d.ts +2 -2
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.d.ts +2 -2
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.d.ts +2 -2
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.d.ts +2 -2
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.d.ts +2 -2
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.d.ts +2 -2
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.d.ts +2 -2
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.d.ts +2 -2
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.d.ts +2 -2
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.d.ts +2 -2
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.d.ts +2 -2
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.d.ts +2 -2
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.d.ts +2 -2
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.d.ts +2 -2
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.d.ts +2 -2
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.d.ts +2 -2
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.d.ts +2 -2
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.d.ts +2 -2
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.d.ts +2 -2
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.d.ts +2 -2
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.d.ts +2 -2
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.d.ts +2 -2
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.d.ts +2 -2
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.d.ts +2 -2
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.d.ts +2 -2
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.d.ts +2 -2
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.d.ts +2 -2
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.d.ts +2 -2
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.d.ts +2 -2
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.d.ts +2 -2
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.d.ts +2 -2
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.d.ts +2 -2
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.d.ts +2 -2
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.d.ts +2 -2
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.d.ts +2 -2
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.d.ts +2 -2
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.d.ts +2 -2
- package/dist/icons/wrap-icon.js +2 -2
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +2 -2
- package/dist/probe/canonicalize.js.map +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/provider.js +2 -2
- package/dist/providers/TrackingProvider.d.ts +1 -0
- package/dist/providers/TrackingProvider.js +2 -2
- package/dist/providers/navigationAdapter.default.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 +2 -2
- 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 +2 -2
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +2 -2
- 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.d.ts +3 -3
- package/dist/utils/react/Slots.js +2 -2
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/escapePropagation.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.d.ts +5 -3
- package/dist/utils/react/forwardRefWithGenerics.js +6 -4
- package/dist/utils/react/forwardRefWithGenerics.js.map +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +2 -2
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +2 -2
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +2 -2
- package/dist/utils/react/useControlledFocusVisible.js +2 -2
- package/dist/utils/react/useEventBus.js +2 -2
- package/dist/utils/react/useId.js +2 -2
- package/dist/utils/react/useIsDarwin.js +2 -2
- package/dist/utils/react/useKeySymbols.js +2 -2
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +2 -2
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +2 -2
- package/dist/utils/react/usePopoverSync.d.ts +3 -3
- package/dist/utils/react/usePopoverSync.js +99 -91
- package/dist/utils/react/usePopoverSync.js.map +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +2 -2
- 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/CreateComponent.md +20 -33
- package/docs/Usage.md +1 -1
- package/docs/components/actions/CommandMenu.md +1 -1
- package/docs/components/form/Form.md +1 -1
- package/docs/modern-form-migration.md +2 -2
- package/docs/modern-form-typecheck.md +1 -1
- package/package.json +14 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e852864 | Cube Dev Team */
|
|
2
2
|
import { EventBusContext, useEventBus } from "./useEventBus.js";
|
|
3
|
-
import { c } from "react
|
|
4
|
-
import { useContext, useEffect,
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { useContext, useEffect, useRef } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/utils/react/usePopoverSync.ts
|
|
7
7
|
/**
|
|
@@ -61,9 +61,9 @@ function isLogicalDescendantOf(target, ancestorMenuId, ancestorContainer) {
|
|
|
61
61
|
* race that surfaces only under rapid trigger switching, which is hard to
|
|
62
62
|
* reproduce in tests):
|
|
63
63
|
*
|
|
64
|
-
* 1.
|
|
65
|
-
* subscription effect's dep array
|
|
66
|
-
* keeps the
|
|
64
|
+
* 1. `isOpen` and `onClose` are read through refs inside the listener, so the
|
|
65
|
+
* subscription effect's dep array does NOT include `isOpen`/`onClose`. This
|
|
66
|
+
* keeps the listener identity stable across open/close transitions and
|
|
67
67
|
* avoids the unsubscribe-emit-resubscribe window where an emit can be
|
|
68
68
|
* delivered to a stale listener (or no listener).
|
|
69
69
|
* 2. The emit fires only on the `false -> true` transition, gated by
|
|
@@ -75,21 +75,21 @@ function isLogicalDescendantOf(target, ancestorMenuId, ancestorContainer) {
|
|
|
75
75
|
* `isOpen` is true at that moment.
|
|
76
76
|
*/
|
|
77
77
|
function usePopoverSync(t0) {
|
|
78
|
-
const $ = c(
|
|
78
|
+
const $ = c(28);
|
|
79
79
|
const { menuId, isOpen, onClose, enabled: t1, triggerRef, containerRef, dismissOnInnerButtonPress: t2, closeOnPeerOpen: t3 } = t0;
|
|
80
80
|
const enabled = t1 === void 0 ? true : t1;
|
|
81
81
|
const dismissOnInnerButtonPress = t2 === void 0 ? true : t2;
|
|
82
82
|
const closeOnPeerOpen = t3 === void 0 ? true : t3;
|
|
83
83
|
const { emit, on } = useEventBus();
|
|
84
|
-
const
|
|
84
|
+
const isOpenRef = useRef(isOpen);
|
|
85
85
|
let t4;
|
|
86
86
|
let t5;
|
|
87
|
-
if ($[0] !==
|
|
87
|
+
if ($[0] !== isOpen) {
|
|
88
88
|
t4 = () => {
|
|
89
|
-
|
|
89
|
+
isOpenRef.current = isOpen;
|
|
90
90
|
};
|
|
91
|
-
t5 = [
|
|
92
|
-
$[0] =
|
|
91
|
+
t5 = [isOpen];
|
|
92
|
+
$[0] = isOpen;
|
|
93
93
|
$[1] = t4;
|
|
94
94
|
$[2] = t5;
|
|
95
95
|
} else {
|
|
@@ -97,15 +97,15 @@ function usePopoverSync(t0) {
|
|
|
97
97
|
t5 = $[2];
|
|
98
98
|
}
|
|
99
99
|
useEffect(t4, t5);
|
|
100
|
-
const
|
|
100
|
+
const onCloseRef = useRef(onClose);
|
|
101
101
|
let t6;
|
|
102
102
|
let t7;
|
|
103
|
-
if ($[3] !==
|
|
103
|
+
if ($[3] !== onClose) {
|
|
104
104
|
t6 = () => {
|
|
105
|
-
|
|
105
|
+
onCloseRef.current = onClose;
|
|
106
106
|
};
|
|
107
|
-
t7 = [
|
|
108
|
-
$[3] =
|
|
107
|
+
t7 = [onClose];
|
|
108
|
+
$[3] = onClose;
|
|
109
109
|
$[4] = t6;
|
|
110
110
|
$[5] = t7;
|
|
111
111
|
} else {
|
|
@@ -113,77 +113,85 @@ function usePopoverSync(t0) {
|
|
|
113
113
|
t7 = $[5];
|
|
114
114
|
}
|
|
115
115
|
useEffect(t6, t7);
|
|
116
|
+
const containerRefRef = useRef(containerRef);
|
|
116
117
|
let t8;
|
|
117
|
-
if ($[6] !== containerRef || $[7] !== isOpen || $[8] !== menuId || $[9] !== onClose) {
|
|
118
|
-
t8 = (data) => {
|
|
119
|
-
if (data.menuId === menuId || !isOpen) return;
|
|
120
|
-
const container = containerRef?.current ?? null;
|
|
121
|
-
if (isLogicalDescendantOf(data.triggerEl, menuId, container)) return;
|
|
122
|
-
onClose();
|
|
123
|
-
};
|
|
124
|
-
$[6] = containerRef;
|
|
125
|
-
$[7] = isOpen;
|
|
126
|
-
$[8] = menuId;
|
|
127
|
-
$[9] = onClose;
|
|
128
|
-
$[10] = t8;
|
|
129
|
-
} else t8 = $[10];
|
|
130
|
-
const onPeerOpen = useEffectEvent(t8);
|
|
131
118
|
let t9;
|
|
132
|
-
if ($[
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const container_0 = containerRef?.current;
|
|
136
|
-
const from = data_0?.from;
|
|
137
|
-
if (!container_0 || !from) return;
|
|
138
|
-
if (container_0.contains(from)) onClose();
|
|
119
|
+
if ($[6] !== containerRef) {
|
|
120
|
+
t8 = () => {
|
|
121
|
+
containerRefRef.current = containerRef;
|
|
139
122
|
};
|
|
140
|
-
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
} else
|
|
145
|
-
|
|
123
|
+
t9 = [containerRef];
|
|
124
|
+
$[6] = containerRef;
|
|
125
|
+
$[7] = t8;
|
|
126
|
+
$[8] = t9;
|
|
127
|
+
} else {
|
|
128
|
+
t8 = $[7];
|
|
129
|
+
t9 = $[8];
|
|
130
|
+
}
|
|
131
|
+
useEffect(t8, t9);
|
|
132
|
+
const triggerRefRef = useRef(triggerRef);
|
|
146
133
|
let t10;
|
|
147
|
-
|
|
134
|
+
let t11;
|
|
135
|
+
if ($[9] !== triggerRef) {
|
|
148
136
|
t10 = () => {
|
|
137
|
+
triggerRefRef.current = triggerRef;
|
|
138
|
+
};
|
|
139
|
+
t11 = [triggerRef];
|
|
140
|
+
$[9] = triggerRef;
|
|
141
|
+
$[10] = t10;
|
|
142
|
+
$[11] = t11;
|
|
143
|
+
} else {
|
|
144
|
+
t10 = $[10];
|
|
145
|
+
t11 = $[11];
|
|
146
|
+
}
|
|
147
|
+
useEffect(t10, t11);
|
|
148
|
+
let t12;
|
|
149
|
+
let t13;
|
|
150
|
+
if ($[12] !== closeOnPeerOpen || $[13] !== dismissOnInnerButtonPress || $[14] !== enabled || $[15] !== menuId || $[16] !== on) {
|
|
151
|
+
t12 = () => {
|
|
149
152
|
if (!enabled) return;
|
|
150
|
-
const offOpen = closeOnPeerOpen ? on("popover:open",
|
|
151
|
-
|
|
153
|
+
const offOpen = closeOnPeerOpen ? on("popover:open", (data) => {
|
|
154
|
+
if (data.menuId === menuId || !isOpenRef.current) return;
|
|
155
|
+
const container = containerRefRef.current?.current ?? null;
|
|
156
|
+
if (isLogicalDescendantOf(data.triggerEl, menuId, container)) return;
|
|
157
|
+
onCloseRef.current();
|
|
158
|
+
}) : null;
|
|
159
|
+
const offDismiss = dismissOnInnerButtonPress ? on("popover:dismiss-ancestor", (data_0) => {
|
|
160
|
+
if (!isOpenRef.current) return;
|
|
161
|
+
const container_0 = containerRefRef.current?.current;
|
|
162
|
+
const from = data_0?.from;
|
|
163
|
+
if (!container_0 || !from) return;
|
|
164
|
+
if (container_0.contains(from)) onCloseRef.current();
|
|
165
|
+
}) : null;
|
|
152
166
|
return () => {
|
|
153
167
|
offOpen?.();
|
|
154
168
|
offDismiss?.();
|
|
155
169
|
};
|
|
156
170
|
};
|
|
157
|
-
|
|
158
|
-
$[16] = dismissOnInnerButtonPress;
|
|
159
|
-
$[17] = enabled;
|
|
160
|
-
$[18] = on;
|
|
161
|
-
$[19] = onDismissAncestor;
|
|
162
|
-
$[20] = onPeerOpen;
|
|
163
|
-
$[21] = t10;
|
|
164
|
-
} else t10 = $[21];
|
|
165
|
-
let t11;
|
|
166
|
-
if ($[22] !== closeOnPeerOpen || $[23] !== dismissOnInnerButtonPress || $[24] !== enabled || $[25] !== menuId || $[26] !== on) {
|
|
167
|
-
t11 = [
|
|
171
|
+
t13 = [
|
|
168
172
|
on,
|
|
169
173
|
menuId,
|
|
170
174
|
enabled,
|
|
171
175
|
dismissOnInnerButtonPress,
|
|
172
176
|
closeOnPeerOpen
|
|
173
177
|
];
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
$[12] = closeOnPeerOpen;
|
|
179
|
+
$[13] = dismissOnInnerButtonPress;
|
|
180
|
+
$[14] = enabled;
|
|
181
|
+
$[15] = menuId;
|
|
182
|
+
$[16] = on;
|
|
183
|
+
$[17] = t12;
|
|
184
|
+
$[18] = t13;
|
|
185
|
+
} else {
|
|
186
|
+
t12 = $[17];
|
|
187
|
+
t13 = $[18];
|
|
188
|
+
}
|
|
189
|
+
useEffect(t12, t13);
|
|
182
190
|
const wasOpenRef = useRef(false);
|
|
183
|
-
let
|
|
184
|
-
let
|
|
185
|
-
if ($[
|
|
186
|
-
|
|
191
|
+
let t14;
|
|
192
|
+
let t15;
|
|
193
|
+
if ($[19] !== emit || $[20] !== enabled || $[21] !== isOpen || $[22] !== menuId) {
|
|
194
|
+
t14 = () => {
|
|
187
195
|
if (!enabled) {
|
|
188
196
|
if (wasOpenRef.current) openPopovers.delete(menuId);
|
|
189
197
|
wasOpenRef.current = false;
|
|
@@ -204,38 +212,38 @@ function usePopoverSync(t0) {
|
|
|
204
212
|
openPopovers.delete(menuId);
|
|
205
213
|
}
|
|
206
214
|
};
|
|
207
|
-
|
|
215
|
+
t15 = [
|
|
208
216
|
isOpen,
|
|
209
217
|
emit,
|
|
210
218
|
menuId,
|
|
211
219
|
enabled
|
|
212
220
|
];
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
221
|
+
$[19] = emit;
|
|
222
|
+
$[20] = enabled;
|
|
223
|
+
$[21] = isOpen;
|
|
224
|
+
$[22] = menuId;
|
|
225
|
+
$[23] = t14;
|
|
226
|
+
$[24] = t15;
|
|
219
227
|
} else {
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
t14 = $[23];
|
|
229
|
+
t15 = $[24];
|
|
222
230
|
}
|
|
223
|
-
useEffect(
|
|
224
|
-
let
|
|
225
|
-
let
|
|
226
|
-
if ($[
|
|
227
|
-
|
|
231
|
+
useEffect(t14, t15);
|
|
232
|
+
let t16;
|
|
233
|
+
let t17;
|
|
234
|
+
if ($[25] !== menuId) {
|
|
235
|
+
t16 = () => () => {
|
|
228
236
|
openPopovers.delete(menuId);
|
|
229
237
|
};
|
|
230
|
-
|
|
231
|
-
$[
|
|
232
|
-
$[
|
|
233
|
-
$[
|
|
238
|
+
t17 = [menuId];
|
|
239
|
+
$[25] = menuId;
|
|
240
|
+
$[26] = t16;
|
|
241
|
+
$[27] = t17;
|
|
234
242
|
} else {
|
|
235
|
-
|
|
236
|
-
|
|
243
|
+
t16 = $[26];
|
|
244
|
+
t17 = $[27];
|
|
237
245
|
}
|
|
238
|
-
useEffect(
|
|
246
|
+
useEffect(t16, t17);
|
|
239
247
|
}
|
|
240
248
|
/**
|
|
241
249
|
* Hook that returns a dispatcher to close the popover that contains a given
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopoverSync.js","names":["RefObject","useContext","useEffect","useEffectEvent","useRef","EventBusContext","useEventBus","UsePopoverSyncOptions","menuId","isOpen","onClose","enabled","triggerRef","HTMLElement","containerRef","dismissOnInnerButtonPress","closeOnPeerOpen","PopoverOpenPayload","triggerEl","Element","PopoverDismissAncestorPayload","from","PopoverRegistryEntry","getContainerEl","getTriggerEl","openPopovers","Map","findOwningPopover","target","entry","contains","isLogicalDescendantOf","ancestorMenuId","ancestorContainer","cur","visited","Set","owner","id","has","add","usePopoverSync","t0","$","_c","t1","t2","t3","undefined","emit","on","containerRefRef","t4","t5","current","triggerRefRef","t6","t7","t8","data","container","onPeerOpen","t9","data_0","container_0","onDismissAncestor","t10","offOpen","offDismiss","t11","wasOpenRef","t12","t13","delete","set","t14","t15","useDismissParentPopover","bus"],"sources":["../../../src/utils/react/usePopoverSync.ts"],"sourcesContent":["import {\n RefObject,\n useContext,\n useEffect,\n useEffectEvent,\n useRef,\n} from 'react';\n\nimport { EventBusContext, useEventBus } from './useEventBus';\n\nexport interface UsePopoverSyncOptions {\n /** Stable identifier for this popover instance (typically a generateRandomId() memo). */\n menuId: string;\n /** Current open state of this popover. */\n isOpen: boolean;\n /** Called when another popover opens while this one is open. */\n onClose: () => void;\n /**\n * When `false`, this popover does not participate in the sync (no listening,\n * no emitting). Useful for \"dummy\" triggers that proxy a real one (see\n * `MenuTrigger`'s `isDummy`). Defaults to `true`.\n */\n enabled?: boolean;\n /**\n * Ref to the popover's trigger element. When provided, the element is\n * included in the `popover:open` emit payload so peers can detect whether\n * the new opener is nested inside their own overlay (and skip closing in\n * that case). Optional — omitting it preserves the legacy \"always close on\n * peer open\" behaviour.\n */\n triggerRef?: RefObject<HTMLElement | null>;\n /**\n * Ref to the overlay/container element that hosts this popover's content.\n * When provided, the listener performs a DOM `contains()` check on incoming\n * peer triggers: peers whose trigger lives inside this container are\n * considered nested children and do NOT close us.\n */\n containerRef?: RefObject<HTMLElement | null>;\n /**\n * Whether this overlay closes when a Button/ItemButton inside its container\n * is pressed. Defaults to `true` (popover semantics — popovers are transient\n * surfaces and any action inside them should dismiss them). Set to `false`\n * for modals/trays/fullscreen dialogs — buttons inside a Dialog should not\n * auto-close it. Requires `containerRef` to be set; without it the listener\n * has no way to determine whether the dispatching button is \"inside\" this\n * overlay and is effectively a no-op.\n */\n dismissOnInnerButtonPress?: boolean;\n /**\n * Whether this overlay closes when a peer popover opens. Defaults to `true`\n * (popover semantics — only one popover open at a time). Set to `false` for\n * modals/trays/fullscreen dialogs so a peer popover opening cannot bypass\n * the dialog's own `isDismissable` / `onClose` handling and yank it shut.\n *\n * The host still EMITS `popover:open` regardless of this flag, so opening a\n * modal/tray correctly dismisses any peer popover that was open before.\n */\n closeOnPeerOpen?: boolean;\n}\n\ninterface PopoverOpenPayload {\n menuId: string;\n triggerEl: Element | null;\n}\n\ninterface PopoverDismissAncestorPayload {\n /** The DOM node of the button that requested the dismiss. */\n from: Element | null;\n}\n\ninterface PopoverRegistryEntry {\n getContainerEl: () => Element | null;\n getTriggerEl: () => Element | null;\n}\n\n/**\n * Module-level registry of currently open popovers. Lets us resolve the\n * LOGICAL parent of an arbitrary element across portal boundaries.\n *\n * Popover content is portaled to a shared root (`document.body` by default —\n * see `Overlay.tsx`), so a grandchild popover's trigger lives inside a\n * sibling portal rather than physically inside its grandparent's container.\n * A naive `container.contains(triggerEl)` check therefore misses the\n * relationship and closes the grandparent — the bug that surfaces with 3+\n * levels of `SubMenuTrigger` nesting.\n *\n * The registry stores closures over the host's refs so reads always see the\n * latest `.current` value without forcing a re-register per render.\n */\nconst openPopovers = new Map<string, PopoverRegistryEntry>();\n\n/**\n * Find the open popover whose container directly contains `target`. Returns\n * `null` for elements that live outside every registered popover (e.g. a\n * top-level trigger button rendered next to its overlay root).\n */\nfunction findOwningPopover(\n target: Element | null,\n): [string, PopoverRegistryEntry] | null {\n if (!target) return null;\n for (const entry of openPopovers) {\n if (entry[1].getContainerEl()?.contains(target)) {\n return entry;\n }\n }\n return null;\n}\n\n/**\n * Returns `true` when `target` is nested inside the overlay identified by\n * `ancestorMenuId` — either as a direct DOM descendant of `ancestorContainer`\n * or as a descendant of a chain of popovers whose triggers eventually land\n * inside it. Used by `popover:open` peers to avoid closing themselves when a\n * grand-child overlay opens through a portal.\n */\nfunction isLogicalDescendantOf(\n target: Element | null,\n ancestorMenuId: string,\n ancestorContainer: Element | null,\n): boolean {\n if (ancestorContainer && target && ancestorContainer.contains(target)) {\n return true;\n }\n let cur: Element | null = target;\n const visited = new Set<string>();\n while (cur) {\n const owner = findOwningPopover(cur);\n if (!owner) return false;\n const [id, entry] = owner;\n if (visited.has(id)) return false;\n visited.add(id);\n if (id === ancestorMenuId) return true;\n cur = entry.getTriggerEl();\n }\n return false;\n}\n\n/**\n * Coordinates the \"only one popover open at a time\" invariant via the EventBus.\n *\n * - When `isOpen` flips `false -> true`, emits `popover:open` once.\n * - While open, listens for peers' `popover:open` events and calls `onClose`.\n *\n * Implementation notes (ALL of these matter — losing any one re-introduces a\n * race that surfaces only under rapid trigger switching, which is hard to\n * reproduce in tests):\n *\n * 1. Effect Events read current `isOpen`, `onClose` and container data, so the\n * subscription effect's dep array includes only resource configuration. This\n * keeps the existing subscriptions across open/close transitions and\n * avoids the unsubscribe-emit-resubscribe window where an emit can be\n * delivered to a stale listener (or no listener).\n * 2. The emit fires only on the `false -> true` transition, gated by\n * `wasOpenRef`. A re-render where `isOpen` is still `true` must NOT\n * re-emit, otherwise it could re-trigger listeners on peers that just\n * opened in the same render flush.\n * 3. The `enabled` flag short-circuits both effects symmetrically. When it\n * flips off, `wasOpenRef` is reset so re-enabling later still emits if\n * `isOpen` is true at that moment.\n */\nexport function usePopoverSync({\n menuId,\n isOpen,\n onClose,\n enabled = true,\n triggerRef,\n containerRef,\n dismissOnInnerButtonPress = true,\n closeOnPeerOpen = true,\n}: UsePopoverSyncOptions): void {\n const { emit, on } = useEventBus();\n\n // Track the latest containerRef via a stable ref-of-refs so the\n // registry getters always see newly supplied ref wrappers. These getters\n // are retained outside effects and cannot use Effect Events.\n const containerRefRef = useRef(containerRef);\n useEffect(() => {\n containerRefRef.current = containerRef;\n }, [containerRef]);\n\n const triggerRefRef = useRef(triggerRef);\n useEffect(() => {\n triggerRefRef.current = triggerRef;\n }, [triggerRef]);\n\n const onPeerOpen = useEffectEvent((data: PopoverOpenPayload) => {\n if (data.menuId === menuId || !isOpen) return;\n const container = containerRef?.current ?? null;\n // Logical containment follows registry links across sibling portals.\n if (isLogicalDescendantOf(data.triggerEl, menuId, container)) return;\n onClose();\n });\n\n const onDismissAncestor = useEffectEvent(\n (data: PopoverDismissAncestorPayload) => {\n if (!isOpen) return;\n const container = containerRef?.current;\n const from = data?.from;\n if (!container || !from) return;\n if (container.contains(from)) onClose();\n },\n );\n\n useEffect(() => {\n if (!enabled) return;\n\n const offOpen = closeOnPeerOpen ? on('popover:open', onPeerOpen) : null;\n const offDismiss = dismissOnInnerButtonPress\n ? on('popover:dismiss-ancestor', onDismissAncestor)\n : null;\n\n return () => {\n offOpen?.();\n offDismiss?.();\n };\n }, [on, menuId, enabled, dismissOnInnerButtonPress, closeOnPeerOpen]);\n\n const wasOpenRef = useRef(false);\n useEffect(() => {\n if (!enabled) {\n if (wasOpenRef.current) {\n openPopovers.delete(menuId);\n }\n wasOpenRef.current = false;\n return;\n }\n if (isOpen && !wasOpenRef.current) {\n wasOpenRef.current = true;\n // Register BEFORE emitting so peers' listeners (deferred via the\n // bus's `setTimeout(0)`) can already see us in the registry when\n // they walk the logical chain.\n openPopovers.set(menuId, {\n getContainerEl: () => containerRefRef.current?.current ?? null,\n getTriggerEl: () => triggerRefRef.current?.current ?? null,\n });\n emit<PopoverOpenPayload>('popover:open', {\n menuId,\n triggerEl: triggerRefRef.current?.current ?? null,\n });\n } else if (!isOpen && wasOpenRef.current) {\n wasOpenRef.current = false;\n openPopovers.delete(menuId);\n }\n }, [isOpen, emit, menuId, enabled]);\n\n // Final cleanup on unmount: covers the case where a host unmounts while\n // still flagged open (e.g. a parent unmount tears down a child popover\n // before its close transition runs).\n useEffect(() => {\n return () => {\n openPopovers.delete(menuId);\n };\n }, [menuId]);\n}\n\n/**\n * Hook that returns a dispatcher to close the popover that contains a given\n * DOM element. Used by `Button` / `ItemButton` to implement the default\n * \"press inside a popover closes the popover\" behaviour. Custom (non-Cube)\n * interactive controls can call this directly:\n *\n * ```tsx\n * const dismiss = useDismissParentPopover();\n * <MyCustomPressable onPress={(e) => { doThing(); dismiss(e.currentTarget); }} />\n * ```\n *\n * The actual dismiss is dispatched through the EventBus, which defers via\n * `setTimeout(0)` — so the user's synchronous handler (and any React state\n * updates it triggers) flushes BEFORE the popover closes. This is critical\n * for the \"open a hoisted modal from a popover footer\" case: the modal\n * mounts first, then the popover closes.\n *\n * Only popover-type containers (those that pass `dismissOnInnerButtonPress`\n * as `true`, the default) react to the event. Modal/tray/fullscreen Dialog\n * containers explicitly opt out so a Button inside their content does not\n * auto-close them.\n *\n * When called outside an `EventBusProvider` (e.g. in unit tests that render\n * a Button without wrapping in `<Root>`), the returned function is a no-op —\n * the dismiss flow gracefully degrades rather than throwing.\n */\nexport function useDismissParentPopover() {\n // Read context defensively: `Button` / `ItemButton` use this hook\n // unconditionally, but tests (and standalone usages outside `<Root>`) may\n // mount them without an `EventBusProvider`. A throw would crash every\n // Button render in those cases.\n const bus = useContext(EventBusContext);\n const emit = bus?.emit;\n return (from: Element | null) => {\n if (!from || !emit) return;\n emit<PopoverDismissAncestorPayload>('popover:dismiss-ancestor', { from });\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyFA,MAAMyB,+BAAe,IAAIC,KAAmC;;;;;;AAO5D,SAASC,kBACPC,QACuC;AACvC,KAAI,CAACA,OAAQ,QAAO;AACpB,MAAK,MAAMC,SAASJ,aAClB,KAAII,MAAM,GAAGN,gBAAgB,EAAEO,SAASF,OAAO,CAC7C,QAAOC;AAGX,QAAO;;;;;;;;;AAUT,SAASE,sBACPH,QACAI,gBACAC,mBACS;AACT,KAAIA,qBAAqBL,UAAUK,kBAAkBH,SAASF,OAAO,CACnE,QAAO;CAET,IAAIM,MAAsBN;CAC1B,MAAMO,0BAAU,IAAIC,KAAa;AACjC,QAAOF,KAAK;EACV,MAAMG,QAAQV,kBAAkBO,IAAI;AACpC,MAAI,CAACG,MAAO,QAAO;EACnB,MAAM,CAACC,IAAIT,SAASQ;AACpB,MAAIF,QAAQI,IAAID,GAAG,CAAE,QAAO;AAC5BH,UAAQK,IAAIF,GAAG;AACf,MAAIA,OAAON,eAAgB,QAAO;AAClCE,QAAML,MAAML,cAAc;;AAE5B,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;AA0BT,SAAOiB,eAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,GAAA;CAAwB,MAAA,EAAApC,QAAAC,QAAAC,SAAAC,SAAAkC,IAAAjC,YAAAE,cAAAC,2BAAA+B,IAAA9B,iBAAA+B,OAAAL;CA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E,OAAO;;AAE5BoE,QAAA,CAACpE,OAAO;AAAAmC,IAAA,MAAAnC;AAAAmC,IAAA,MAAAgC;AAAAhC,IAAA,MAAAiC;QAAA;AAAAD,QAAAhC,EAAA;AAAAiC,QAAAjC,EAAA;;AAJXzC,WAAUyE,KAIPC,IAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6Bd,SAAOC,0BAAA;CAAA,MAAAlC,IAAAC,EAAA,EAAA;CAML,MAAAK,OADYhD,WAAWI,gBAAgB,EACvB4C;CAAO,IAAAP;AAAA,KAAAC,EAAA,OAAAM,MAAA;AAChBP,QAAArB,SAAA;AACL,OAAI,CAACA,QAAD,CAAU4B,KAAI;AAClBA,QAAoC,4BAA4B,EAAA5B,MAAQ,CAAC;;AAC1EsB,IAAA,KAAAM;AAAAN,IAAA,KAAAD;OAAAA,MAAAC,EAAA;AAAA,QAHMD"}
|
|
1
|
+
{"version":3,"file":"usePopoverSync.js","names":["RefObject","useContext","useEffect","useRef","EventBusContext","useEventBus","UsePopoverSyncOptions","menuId","isOpen","onClose","enabled","triggerRef","HTMLElement","containerRef","dismissOnInnerButtonPress","closeOnPeerOpen","PopoverOpenPayload","triggerEl","Element","PopoverDismissAncestorPayload","from","PopoverRegistryEntry","getContainerEl","getTriggerEl","openPopovers","Map","findOwningPopover","target","entry","contains","isLogicalDescendantOf","ancestorMenuId","ancestorContainer","cur","visited","Set","owner","id","has","add","usePopoverSync","t0","$","_c","t1","t2","t3","undefined","emit","on","isOpenRef","t4","t5","current","onCloseRef","t6","t7","containerRefRef","t8","t9","triggerRefRef","t10","t11","t12","t13","offOpen","data","container","offDismiss","data_0","container_0","wasOpenRef","t14","t15","delete","set","t16","t17","useDismissParentPopover","bus"],"sources":["../../../src/utils/react/usePopoverSync.ts"],"sourcesContent":["import { RefObject, useContext, useEffect, useRef } from 'react';\n\nimport { EventBusContext, useEventBus } from './useEventBus';\n\nexport interface UsePopoverSyncOptions {\n /** Stable identifier for this popover instance (typically a generateRandomId() memo). */\n menuId: string;\n /** Current open state of this popover. */\n isOpen: boolean;\n /** Called when another popover opens while this one is open. */\n onClose: () => void;\n /**\n * When `false`, this popover does not participate in the sync (no listening,\n * no emitting). Useful for \"dummy\" triggers that proxy a real one (see\n * `MenuTrigger`'s `isDummy`). Defaults to `true`.\n */\n enabled?: boolean;\n /**\n * Ref to the popover's trigger element. When provided, the element is\n * included in the `popover:open` emit payload so peers can detect whether\n * the new opener is nested inside their own overlay (and skip closing in\n * that case). Optional — omitting it preserves the legacy \"always close on\n * peer open\" behaviour.\n */\n triggerRef?: RefObject<HTMLElement | null>;\n /**\n * Ref to the overlay/container element that hosts this popover's content.\n * When provided, the listener performs a DOM `contains()` check on incoming\n * peer triggers: peers whose trigger lives inside this container are\n * considered nested children and do NOT close us.\n */\n containerRef?: RefObject<HTMLElement | null>;\n /**\n * Whether this overlay closes when a Button/ItemButton inside its container\n * is pressed. Defaults to `true` (popover semantics — popovers are transient\n * surfaces and any action inside them should dismiss them). Set to `false`\n * for modals/trays/fullscreen dialogs — buttons inside a Dialog should not\n * auto-close it. Requires `containerRef` to be set; without it the listener\n * has no way to determine whether the dispatching button is \"inside\" this\n * overlay and is effectively a no-op.\n */\n dismissOnInnerButtonPress?: boolean;\n /**\n * Whether this overlay closes when a peer popover opens. Defaults to `true`\n * (popover semantics — only one popover open at a time). Set to `false` for\n * modals/trays/fullscreen dialogs so a peer popover opening cannot bypass\n * the dialog's own `isDismissable` / `onClose` handling and yank it shut.\n *\n * The host still EMITS `popover:open` regardless of this flag, so opening a\n * modal/tray correctly dismisses any peer popover that was open before.\n */\n closeOnPeerOpen?: boolean;\n}\n\ninterface PopoverOpenPayload {\n menuId: string;\n triggerEl: Element | null;\n}\n\ninterface PopoverDismissAncestorPayload {\n /** The DOM node of the button that requested the dismiss. */\n from: Element | null;\n}\n\ninterface PopoverRegistryEntry {\n getContainerEl: () => Element | null;\n getTriggerEl: () => Element | null;\n}\n\n/**\n * Module-level registry of currently open popovers. Lets us resolve the\n * LOGICAL parent of an arbitrary element across portal boundaries.\n *\n * Popover content is portaled to a shared root (`document.body` by default —\n * see `Overlay.tsx`), so a grandchild popover's trigger lives inside a\n * sibling portal rather than physically inside its grandparent's container.\n * A naive `container.contains(triggerEl)` check therefore misses the\n * relationship and closes the grandparent — the bug that surfaces with 3+\n * levels of `SubMenuTrigger` nesting.\n *\n * The registry stores closures over the host's refs so reads always see the\n * latest `.current` value without forcing a re-register per render.\n */\nconst openPopovers = new Map<string, PopoverRegistryEntry>();\n\n/**\n * Find the open popover whose container directly contains `target`. Returns\n * `null` for elements that live outside every registered popover (e.g. a\n * top-level trigger button rendered next to its overlay root).\n */\nfunction findOwningPopover(\n target: Element | null,\n): [string, PopoverRegistryEntry] | null {\n if (!target) return null;\n for (const entry of openPopovers) {\n if (entry[1].getContainerEl()?.contains(target)) {\n return entry;\n }\n }\n return null;\n}\n\n/**\n * Returns `true` when `target` is nested inside the overlay identified by\n * `ancestorMenuId` — either as a direct DOM descendant of `ancestorContainer`\n * or as a descendant of a chain of popovers whose triggers eventually land\n * inside it. Used by `popover:open` peers to avoid closing themselves when a\n * grand-child overlay opens through a portal.\n */\nfunction isLogicalDescendantOf(\n target: Element | null,\n ancestorMenuId: string,\n ancestorContainer: Element | null,\n): boolean {\n if (ancestorContainer && target && ancestorContainer.contains(target)) {\n return true;\n }\n let cur: Element | null = target;\n const visited = new Set<string>();\n while (cur) {\n const owner = findOwningPopover(cur);\n if (!owner) return false;\n const [id, entry] = owner;\n if (visited.has(id)) return false;\n visited.add(id);\n if (id === ancestorMenuId) return true;\n cur = entry.getTriggerEl();\n }\n return false;\n}\n\n/**\n * Coordinates the \"only one popover open at a time\" invariant via the EventBus.\n *\n * - When `isOpen` flips `false -> true`, emits `popover:open` once.\n * - While open, listens for peers' `popover:open` events and calls `onClose`.\n *\n * Implementation notes (ALL of these matter — losing any one re-introduces a\n * race that surfaces only under rapid trigger switching, which is hard to\n * reproduce in tests):\n *\n * 1. `isOpen` and `onClose` are read through refs inside the listener, so the\n * subscription effect's dep array does NOT include `isOpen`/`onClose`. This\n * keeps the listener identity stable across open/close transitions and\n * avoids the unsubscribe-emit-resubscribe window where an emit can be\n * delivered to a stale listener (or no listener).\n * 2. The emit fires only on the `false -> true` transition, gated by\n * `wasOpenRef`. A re-render where `isOpen` is still `true` must NOT\n * re-emit, otherwise it could re-trigger listeners on peers that just\n * opened in the same render flush.\n * 3. The `enabled` flag short-circuits both effects symmetrically. When it\n * flips off, `wasOpenRef` is reset so re-enabling later still emits if\n * `isOpen` is true at that moment.\n */\nexport function usePopoverSync({\n menuId,\n isOpen,\n onClose,\n enabled = true,\n triggerRef,\n containerRef,\n dismissOnInnerButtonPress = true,\n closeOnPeerOpen = true,\n}: UsePopoverSyncOptions): void {\n const { emit, on } = useEventBus();\n\n const isOpenRef = useRef(isOpen);\n useEffect(() => {\n isOpenRef.current = isOpen;\n }, [isOpen]);\n\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n // Track the latest containerRef via a stable ref-of-refs so the listener\n // never resubscribes when callers pass freshly-created ref wrappers across\n // renders. Same pattern as `onCloseRef` above — without this the listener's\n // effect would churn for any caller that doesn't memoize its refs.\n const containerRefRef = useRef(containerRef);\n useEffect(() => {\n containerRefRef.current = containerRef;\n }, [containerRef]);\n\n const triggerRefRef = useRef(triggerRef);\n useEffect(() => {\n triggerRefRef.current = triggerRef;\n }, [triggerRef]);\n\n useEffect(() => {\n if (!enabled) return;\n\n // `popover:open` listener — gated on `closeOnPeerOpen`. Modals/trays opt\n // out so a peer popover opening cannot bypass the dialog's\n // `isDismissable` / `onClose` handling and call `state.close()` directly.\n // Note: the EMIT side (lower in this hook) still fires regardless, so\n // opening a modal still correctly dismisses peer popovers.\n const offOpen = closeOnPeerOpen\n ? on('popover:open', (data: PopoverOpenPayload) => {\n if (data.menuId === menuId || !isOpenRef.current) return;\n const container = containerRefRef.current?.current ?? null;\n // Nested-popover guard: stay open when the opening peer's trigger is\n // a LOGICAL descendant of our overlay. Direct DOM containment only\n // covers the first level — for grand-child popovers the trigger lives\n // in a sibling portal, so we walk the registered popover chain back\n // up via each parent's trigger element. Without this, opening a\n // third-level `SubMenuTrigger` would close every ancestor menu.\n if (isLogicalDescendantOf(data.triggerEl, menuId, container)) return;\n onCloseRef.current();\n })\n : null;\n\n // `popover:dismiss-ancestor` is emitted by `Button` / `ItemButton` (and any\n // consumer using `useDismissParentPopover`) after their `onPress` runs.\n // Only popover-type overlays subscribe; modals/trays opt out via\n // `dismissOnInnerButtonPress: false` so a Button inside a Dialog content\n // does NOT auto-close the Dialog.\n const offDismiss = dismissOnInnerButtonPress\n ? on(\n 'popover:dismiss-ancestor',\n (data: PopoverDismissAncestorPayload) => {\n if (!isOpenRef.current) return;\n const container = containerRefRef.current?.current;\n const from = data?.from;\n // Require both a container and an originating element so we can do\n // the contains-check. Hosts without `containerRef` (e.g.\n // `use-anchored-menu`, `use-context-menu`) are silently no-op.\n if (!container || !from) return;\n if (container.contains(from)) onCloseRef.current();\n },\n )\n : null;\n\n return () => {\n offOpen?.();\n offDismiss?.();\n };\n }, [on, menuId, enabled, dismissOnInnerButtonPress, closeOnPeerOpen]);\n\n const wasOpenRef = useRef(false);\n useEffect(() => {\n if (!enabled) {\n if (wasOpenRef.current) {\n openPopovers.delete(menuId);\n }\n wasOpenRef.current = false;\n return;\n }\n if (isOpen && !wasOpenRef.current) {\n wasOpenRef.current = true;\n // Register BEFORE emitting so peers' listeners (deferred via the\n // bus's `setTimeout(0)`) can already see us in the registry when\n // they walk the logical chain.\n openPopovers.set(menuId, {\n getContainerEl: () => containerRefRef.current?.current ?? null,\n getTriggerEl: () => triggerRefRef.current?.current ?? null,\n });\n emit<PopoverOpenPayload>('popover:open', {\n menuId,\n triggerEl: triggerRefRef.current?.current ?? null,\n });\n } else if (!isOpen && wasOpenRef.current) {\n wasOpenRef.current = false;\n openPopovers.delete(menuId);\n }\n }, [isOpen, emit, menuId, enabled]);\n\n // Final cleanup on unmount: covers the case where a host unmounts while\n // still flagged open (e.g. a parent unmount tears down a child popover\n // before its close transition runs).\n useEffect(() => {\n return () => {\n openPopovers.delete(menuId);\n };\n }, [menuId]);\n}\n\n/**\n * Hook that returns a dispatcher to close the popover that contains a given\n * DOM element. Used by `Button` / `ItemButton` to implement the default\n * \"press inside a popover closes the popover\" behaviour. Custom (non-Cube)\n * interactive controls can call this directly:\n *\n * ```tsx\n * const dismiss = useDismissParentPopover();\n * <MyCustomPressable onPress={(e) => { doThing(); dismiss(e.currentTarget); }} />\n * ```\n *\n * The actual dismiss is dispatched through the EventBus, which defers via\n * `setTimeout(0)` — so the user's synchronous handler (and any React state\n * updates it triggers) flushes BEFORE the popover closes. This is critical\n * for the \"open a hoisted modal from a popover footer\" case: the modal\n * mounts first, then the popover closes.\n *\n * Only popover-type containers (those that pass `dismissOnInnerButtonPress`\n * as `true`, the default) react to the event. Modal/tray/fullscreen Dialog\n * containers explicitly opt out so a Button inside their content does not\n * auto-close them.\n *\n * When called outside an `EventBusProvider` (e.g. in unit tests that render\n * a Button without wrapping in `<Root>`), the returned function is a no-op —\n * the dismiss flow gracefully degrades rather than throwing.\n */\nexport function useDismissParentPopover() {\n // Read context defensively: `Button` / `ItemButton` use this hook\n // unconditionally, but tests (and standalone usages outside `<Root>`) may\n // mount them without an `EventBusProvider`. A throw would crash every\n // Button render in those cases.\n const bus = useContext(EventBusContext);\n const emit = bus?.emit;\n return (from: Element | null) => {\n if (!from || !emit) return;\n emit<PopoverDismissAncestorPayload>('popover:dismiss-ancestor', { from });\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmFA,MAAMwB,+BAAe,IAAIC,KAAmC;;;;;;AAO5D,SAASC,kBACPC,QACuC;AACvC,KAAI,CAACA,OAAQ,QAAO;AACpB,MAAK,MAAMC,SAASJ,aAClB,KAAII,MAAM,GAAGN,gBAAgB,EAAEO,SAASF,OAAO,CAC7C,QAAOC;AAGX,QAAO;;;;;;;;;AAUT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B,SAAQ;AACtCkB,eAAUlB,UAAW;AACrB7B,iBAAYkD,OAAQnE,OAAO;;;AAE5BkE,QAAA;GAACjE;GAAQwC;GAAMzC;GAAQG;GAAQ;AAAAgC,IAAA,MAAAM;AAAAN,IAAA,MAAAhC;AAAAgC,IAAA,MAAAlC;AAAAkC,IAAA,MAAAnC;AAAAmC,IAAA,MAAA8B;AAAA9B,IAAA,MAAA+B;QAAA;AAAAD,QAAA9B,EAAA;AAAA+B,QAAA/B,EAAA;;AAzBlCxC,WAAUsE,KAyBPC,IAAgC;CAAA,IAAAG;CAAA,IAAAC;AAAA,KAAAnC,EAAA,QAAAnC,QAAA;AAKzBqE,oBACD;AACLpD,gBAAYkD,OAAQnE,OAAO;;AAE5BsE,QAAA,CAACtE,OAAO;AAAAmC,IAAA,MAAAnC;AAAAmC,IAAA,MAAAkC;AAAAlC,IAAA,MAAAmC;QAAA;AAAAD,QAAAlC,EAAA;AAAAmC,QAAAnC,EAAA;;AAJXxC,WAAU0E,KAIPC,IAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6Bd,SAAOC,0BAAA;CAAA,MAAApC,IAAAC,EAAA,EAAA;CAML,MAAAK,OADY/C,WAAWG,gBAAgB,EACvB4C;CAAO,IAAAP;AAAA,KAAAC,EAAA,OAAAM,MAAA;AAChBP,QAAArB,SAAA;AACL,OAAI,CAACA,QAAD,CAAU4B,KAAI;AAClBA,QAAoC,4BAA4B,EAAA5B,MAAQ,CAAC;;AAC1EsB,IAAA,KAAAM;AAAAN,IAAA,KAAAD;OAAAA,MAAAC,EAAA;AAAA,QAHMD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
2
|
-
import { c } from "react
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e852864 | Cube Dev Team */
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/react/useViewportSize.ts
|
package/dist/utils/selection.js
CHANGED
package/dist/utils/styles.js
CHANGED
package/dist/utils/tree.js
CHANGED
|
@@ -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-e852864 | Cube Dev Team */
|
|
2
2
|
//#region src/utils/tree.ts
|
|
3
3
|
function toFlatTree(tree, includingFolders) {
|
|
4
4
|
return tree.reduce((result, node) => {
|
package/dist/utils/warnings.js
CHANGED
package/dist/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-e852864 | Cube Dev Team */
|
|
2
2
|
//#region src/version.ts
|
|
3
|
-
const VERSION = "0.0.0-canary-
|
|
3
|
+
const VERSION = "0.0.0-canary-e852864";
|
|
4
4
|
const TASTY_VERSION = "3.9.9";
|
|
5
5
|
if (typeof window !== "undefined") {
|
|
6
6
|
const version = VERSION;
|
package/docs/CreateComponent.md
CHANGED
|
@@ -282,7 +282,7 @@ This demonstrates a basic component with:
|
|
|
282
282
|
- Clean, minimal implementation
|
|
283
283
|
|
|
284
284
|
```tsx
|
|
285
|
-
import
|
|
285
|
+
import { forwardRef } from 'react';
|
|
286
286
|
import {
|
|
287
287
|
AllBaseProps,
|
|
288
288
|
CONTAINER_STYLES,
|
|
@@ -299,12 +299,10 @@ const BlockElement = tasty({
|
|
|
299
299
|
});
|
|
300
300
|
|
|
301
301
|
export interface CubeBlockProps
|
|
302
|
-
extends Omit<AllBaseProps, keyof ContainerStyleProps | 'as'
|
|
303
|
-
ContainerStyleProps {
|
|
304
|
-
ref?: Ref<HTMLDivElement>;
|
|
305
|
-
}
|
|
302
|
+
extends Omit<AllBaseProps, keyof ContainerStyleProps | 'as'>,
|
|
303
|
+
ContainerStyleProps {}
|
|
306
304
|
|
|
307
|
-
export function Block(
|
|
305
|
+
export const Block = forwardRef(function Block(props: CubeBlockProps, ref) {
|
|
308
306
|
const styles = extractStyles(props, CONTAINER_STYLES);
|
|
309
307
|
|
|
310
308
|
return (
|
|
@@ -314,7 +312,7 @@ export function Block({ ref, ...props }: CubeBlockProps) {
|
|
|
314
312
|
styles={styles}
|
|
315
313
|
/>
|
|
316
314
|
);
|
|
317
|
-
}
|
|
315
|
+
});
|
|
318
316
|
```
|
|
319
317
|
|
|
320
318
|
### Example 2: Action Component (Advanced)
|
|
@@ -327,8 +325,8 @@ This demonstrates advanced features:
|
|
|
327
325
|
- Custom behavior logic
|
|
328
326
|
|
|
329
327
|
```tsx
|
|
330
|
-
import
|
|
331
|
-
import {
|
|
328
|
+
import { FocusableRef } from '@react-types/shared';
|
|
329
|
+
import { forwardRef } from 'react';
|
|
332
330
|
import { AriaButtonProps, useButton, useHover } from 'react-aria';
|
|
333
331
|
import {
|
|
334
332
|
AllBaseProps,
|
|
@@ -344,7 +342,7 @@ import {
|
|
|
344
342
|
} from '@tenphi/tasty';
|
|
345
343
|
|
|
346
344
|
export interface CubeActionProps<T extends TagName = 'button'>
|
|
347
|
-
extends Omit<AllBaseProps<T>, 'htmlType'
|
|
345
|
+
extends Omit<AllBaseProps<T>, 'htmlType'>,
|
|
348
346
|
BaseStyleProps,
|
|
349
347
|
ContainerStyleProps,
|
|
350
348
|
TextStyleProps,
|
|
@@ -352,7 +350,6 @@ export interface CubeActionProps<T extends TagName = 'button'>
|
|
|
352
350
|
to?: string;
|
|
353
351
|
label?: string;
|
|
354
352
|
htmlType?: 'button' | 'submit' | 'reset';
|
|
355
|
-
ref?: Ref<HTMLElement>;
|
|
356
353
|
}
|
|
357
354
|
|
|
358
355
|
const DEFAULT_ACTION_STYLES: Styles = {
|
|
@@ -374,7 +371,7 @@ const ActionElement = tasty({
|
|
|
374
371
|
|
|
375
372
|
const STYLE_PROPS = [...CONTAINER_STYLES, ...TEXT_STYLES];
|
|
376
373
|
|
|
377
|
-
export function Action(
|
|
374
|
+
export const Action = forwardRef(function Action(
|
|
378
375
|
{
|
|
379
376
|
to,
|
|
380
377
|
as = 'button',
|
|
@@ -384,11 +381,11 @@ export function Action(
|
|
|
384
381
|
mods,
|
|
385
382
|
onPress,
|
|
386
383
|
isDisabled,
|
|
387
|
-
ref,
|
|
388
384
|
...props
|
|
389
385
|
}: CubeActionProps,
|
|
386
|
+
ref: FocusableRef<HTMLElement>,
|
|
390
387
|
) {
|
|
391
|
-
const domRef =
|
|
388
|
+
const domRef = useRef();
|
|
392
389
|
const { buttonProps, isPressed } = useButton(
|
|
393
390
|
{
|
|
394
391
|
'aria-label': label,
|
|
@@ -420,7 +417,7 @@ export function Action(
|
|
|
420
417
|
styles={styles}
|
|
421
418
|
/>
|
|
422
419
|
);
|
|
423
|
-
}
|
|
420
|
+
});
|
|
424
421
|
```
|
|
425
422
|
|
|
426
423
|
## Form Integration
|
|
@@ -449,28 +446,18 @@ For input components that need to integrate with forms, see the [Field documenta
|
|
|
449
446
|
|
|
450
447
|
7. **Keep it simple when appropriate**: Not every component needs all features - use what makes sense for your use case
|
|
451
448
|
|
|
452
|
-
8. **Use named React imports**: Import `useState`, `useRef`, `
|
|
449
|
+
8. **Use named React imports**: Import `useState`, `useRef`, `forwardRef` etc. directly from `'react'` instead of using `React.useState(...)`.
|
|
453
450
|
|
|
454
|
-
**
|
|
451
|
+
**Skip `useMemo` and `useCallback` for performance.** React Compiler memoizes compiled components and hooks at build time, so derived values, `mods` objects and handlers are plain expressions. Keep a manual memo where identity is part of the contract: callback refs, effect dependencies, `useSyncExternalStore` subscriptions, per-mount values, context provider values and imperative APIs. Tests run uncompiled source, and known compiler bailouts retain their existing memos. See [React Compiler](https://github.com/cube-js/cube-ui-kit/blob/main/AGENTS.md#react-compiler-skip-manual-memoization).
|
|
455
452
|
|
|
456
|
-
9. **
|
|
453
|
+
9. **Use `useEvent` for stable callbacks**: When a callback doesn't need to trigger re-renders, prefer `useEvent` from `src/_internal/hooks/use-event` for a stable identity that always calls the latest implementation:
|
|
457
454
|
|
|
458
455
|
```tsx
|
|
459
|
-
import {
|
|
456
|
+
import { useEvent } from '../_internal/hooks/use-event';
|
|
460
457
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
useEffect(() => {
|
|
466
|
-
const connection = connect(roomId);
|
|
467
|
-
connection.on('connected', onConnected);
|
|
468
|
-
connection.connect();
|
|
469
|
-
return () => connection.disconnect();
|
|
470
|
-
}, [connect, roomId]);
|
|
471
|
-
|
|
472
|
-
return <button onClick={handleClick}>Notify</button>;
|
|
473
|
-
}
|
|
458
|
+
const handleClick = useEvent((e) => {
|
|
459
|
+
// always has latest closure, but stable identity
|
|
460
|
+
});
|
|
474
461
|
```
|
|
475
462
|
|
|
476
463
|
10. **Use `variants` for theming, not sizing**: The `variants` option in `tasty()` defines mutually exclusive visual variations (e.g. `default`, `danger`, `outline`). CSS is only generated for variants actually rendered at runtime. Use modifiers for dimensions like `size`.
|
|
@@ -486,7 +473,7 @@ When creating a new component, consider:
|
|
|
486
473
|
- [ ] Sub-element definitions for targeted styling
|
|
487
474
|
- [ ] React Aria integration for accessibility
|
|
488
475
|
- [ ] TypeScript interfaces following naming conventions
|
|
489
|
-
- [ ]
|
|
476
|
+
- [ ] forwardRef for ref passing
|
|
490
477
|
- [ ] Default styles and theme support
|
|
491
478
|
- [ ] Documentation following UI Kit standards
|
|
492
479
|
|
package/docs/Usage.md
CHANGED
|
@@ -13,7 +13,7 @@ For styling engine internals see the [Tasty documentation](./tasty/usage.md). Ta
|
|
|
13
13
|
|
|
14
14
|
## React Compiler
|
|
15
15
|
|
|
16
|
-
UI Kit ships components optimized with React Compiler and
|
|
16
|
+
UI Kit ships components optimized with React Compiler and supports React 18 and 19. Your application does not need to enable Compiler to use this build. Adoption is incremental: functions with known compatibility diagnostics remain unoptimized, and the legacy form's mutable render paths are explicitly excluded.
|
|
17
17
|
|
|
18
18
|
Compiling UI Kit does not make mutable legacy form reads in your application reactive. When enabling Compiler in an application, migrate those consumers to the modern Form subscriptions (`Form.useValue`, `Form.useSelector`, or `Form.Subscribe`) or keep the affected consumer components uncompiled with `"use no memo"`. Forms without an explicit instance still use the legacy implementation.
|
|
19
19
|
|
|
@@ -453,5 +453,5 @@ The CommandMenu supports enhanced search capabilities:
|
|
|
453
453
|
### Browser Support
|
|
454
454
|
|
|
455
455
|
- Modern browsers with ES2018+ support
|
|
456
|
-
- Requires React
|
|
456
|
+
- Requires React 18+ for concurrent features
|
|
457
457
|
- Uses React Aria for cross-browser accessibility
|
|
@@ -160,7 +160,7 @@ A `Form` placed directly in a `Dialog`, wrapping its `Content` and `Footer`, lay
|
|
|
160
160
|
|
|
161
161
|
## React Compiler
|
|
162
162
|
|
|
163
|
-
The modern controller, subscriptions, input binding, and dialog workflows are tested with React Compiler on React 19.
|
|
163
|
+
The modern controller, subscriptions, input binding, and dialog workflows are tested with React Compiler on React 18 and 19. The published library remains uncompiled. Consumer render code must use `Form.useValue`, `Form.useFieldState`, or selectors to subscribe; imperative getters do not subscribe. This does not make legacy mutable instance reads Compiler-safe.
|
|
164
164
|
|
|
165
165
|
## Accessibility
|
|
166
166
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Modern Form is opt-in per form. Existing `Form.useForm()` calls, roots without a controller, and legacy wrappers continue to use the legacy engine. Start with a leaf form whose defaults, conditional fields, and submission payload are understood. Do not swap the backend of a mounted root: choose one component at a migration boundary and remount when changing that choice.
|
|
4
4
|
|
|
5
|
-
The [compiled consumer examples](https://github.com/cube-js/cube-ui-kit/blob/main/typecheck/consumer/modern-form-examples.tsx) cover creation with a colocated selector, narrow descendant subscriptions, conditional fields, async defaults, a custom control, and cancellable validation. `pnpm build && pnpm test:types:consumer` checks those examples against the declarations consumers receive. The published library is compiled for React
|
|
5
|
+
The [compiled consumer examples](https://github.com/cube-js/cube-ui-kit/blob/main/typecheck/consumer/modern-form-examples.tsx) cover creation with a colocated selector, narrow descendant subscriptions, conditional fields, async defaults, a custom control, and cancellable validation. `pnpm build && pnpm test:types:consumer` checks those examples against the declarations consumers receive. The published library is compiled for React 18 and 19; CI checks adapters and packaged consumers both with and without React Compiler. See [the compiler guide](../scripts/compiler/README.md).
|
|
6
6
|
|
|
7
7
|
## Choose the backend explicitly
|
|
8
8
|
|
|
@@ -60,6 +60,6 @@ The [Modern Form guide](modern-form-guide.md) is the reference for implementing
|
|
|
60
60
|
5. Adapt validators' success values and cancellation. Declare external captured inputs in `deps` and sibling form paths in `dependsOn`.
|
|
61
61
|
6. Decide whether hidden fields are retained and whether submission uses active or all values. Verify the actual payload with conditional sections both visible and hidden.
|
|
62
62
|
7. Test required/async errors, double submit, server failure, reset, unmount during requests, keyboard focus, and navigation guards. Modern Submit stays enabled after validation errors; pass `disableOnInvalid` to retain the legacy disabled-button behavior. Verify this visible change with QA. Confirm unaffected fields and the creator do not rerender on each keystroke.
|
|
63
|
-
8. Run source and built-consumer type checks, the frozen legacy contract suite, React 19
|
|
63
|
+
8. Run source and built-consumer type checks, the frozen legacy contract suite, React 18/19 compiler checks, and relevant browser checks. Review visual changes before merging.
|
|
64
64
|
|
|
65
65
|
To revert a migrated form, render the preserved legacy component again and restore its legacy defaults/callback/validator contracts. Remount the boundary and deliberately transfer serializable draft values if needed. Do not cast the modern controller to a legacy instance or toggle hook implementations in place.
|
|
@@ -8,7 +8,7 @@ The roots are the existing `NarrowForm`, `SAMLOptionsForm`, `LDAPOptionsForm`, `
|
|
|
8
8
|
|
|
9
9
|
Build UI Kit with its pinned Node 24 environment, then run `node scripts/benchmark-cloud-form-types.mjs /path/to/cloud 3` under Cloud's Node 22.14. The script writes configs, candidate declaration copies, logs, and a JSON report to the OS temporary directory. It never installs dependencies, changes Cloud files, or writes Cloud's incremental cache. The script alternates installed/candidate order across three pairs and checks that diagnostics are stable across repeats.
|
|
10
10
|
|
|
11
|
-
Both variants resolve through Cloud's installed dependency graph, including React 19.1.1, its React types, i18next 26.3.2, and Tasty 3.7.0. The candidate declaration copy has a temporary dependency-directory symlink outside the Cloud checkout. Reading UI Kit's `dist` in place would resolve its own React/i18next copies and introduce unrelated identity errors. This controlled comparison measures declaration compatibility and cost; it does not simulate a complete dependency installation or certify a Cloud release with newer Tasty.
|
|
11
|
+
Both variants resolve through Cloud's installed dependency graph, including React 19.1.1, its React types, i18next 26.3.2, and Tasty 3.7.0. The candidate declaration copy has a temporary dependency-directory symlink outside the Cloud checkout. Reading UI Kit's `dist` in place would resolve its own React/i18next copies and introduce unrelated identity errors. This controlled comparison measures declaration compatibility and cost; it does not simulate a complete dependency installation or certify a Cloud release with newer Tasty. UI Kit's own source/consumer, React 18/19, and compiled adapter gates use its actual Tasty 3.9.2 dependency.
|
|
12
12
|
|
|
13
13
|
## Results
|
|
14
14
|
|