@cube-dev/ui-kit 0.0.0-canary-05c61de → 0.0.0-canary-5b75dce
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +1 -1
- package/dist/components/GridProvider.js +1 -1
- package/dist/components/HiddenInput.js +1 -1
- package/dist/components/Root.js +1 -1
- package/dist/components/actions/Action/Action.js +1 -1
- package/dist/components/actions/Banner/Banner.js +1 -1
- package/dist/components/actions/Button/Button.js +1 -1
- package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
- package/dist/components/actions/ButtonSplit/context.js +1 -1
- package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
- package/dist/components/actions/CommandMenu/styled.js +1 -1
- package/dist/components/actions/ItemAction/ItemAction.js +1 -1
- package/dist/components/actions/ItemActionContext.js +1 -1
- package/dist/components/actions/ItemActionsWrapper.js +1 -1
- package/dist/components/actions/ItemButton/ItemButton.js +1 -1
- package/dist/components/actions/Link/Link.js +1 -1
- package/dist/components/actions/Menu/Menu.js +1 -1
- package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
- package/dist/components/actions/Menu/MenuItem.js +1 -1
- package/dist/components/actions/Menu/MenuSection.js +1 -1
- package/dist/components/actions/Menu/MenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
- package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
- package/dist/components/actions/Menu/context.js +1 -1
- package/dist/components/actions/Menu/styled.js +1 -1
- package/dist/components/actions/actions-run.js +1 -1
- package/dist/components/actions/index.js +1 -1
- package/dist/components/actions/use-action.js +1 -1
- package/dist/components/actions/use-anchored-menu.js +1 -1
- package/dist/components/actions/use-context-menu.js +1 -1
- package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
- package/dist/components/content/Alert/Alert.js +1 -1
- package/dist/components/content/Alert/use-alert.js +1 -1
- package/dist/components/content/Avatar/Avatar.js +1 -1
- package/dist/components/content/Badge/Badge.js +1 -1
- package/dist/components/content/Card/Card.js +1 -1
- package/dist/components/content/Content.js +1 -1
- package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
- package/dist/components/content/CopySnippet/CopySnippet.d.ts +4 -4
- package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
- package/dist/components/content/Disclosure/Disclosure.js +1 -1
- package/dist/components/content/Divider.js +1 -1
- package/dist/components/content/Footer.js +1 -1
- package/dist/components/content/Header.js +1 -1
- package/dist/components/content/HotKeys/HotKeys.js +1 -1
- package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
- package/dist/components/content/InlineInput/InlineInput.js +1 -1
- package/dist/components/content/Item/Item.js +1 -1
- package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
- package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
- package/dist/components/content/ItemCard/ItemCard.js +1 -1
- package/dist/components/content/Layout/GridLayout.js +1 -1
- package/dist/components/content/Layout/Layout.js +26 -14
- package/dist/components/content/Layout/Layout.js.map +1 -1
- package/dist/components/content/Layout/LayoutBlock.js +1 -1
- package/dist/components/content/Layout/LayoutCenter.js +1 -1
- package/dist/components/content/Layout/LayoutContainer.js +1 -1
- package/dist/components/content/Layout/LayoutContent.js +1 -1
- package/dist/components/content/Layout/LayoutContext.js +1 -1
- package/dist/components/content/Layout/LayoutFlex.js +1 -1
- package/dist/components/content/Layout/LayoutFooter.js +1 -1
- package/dist/components/content/Layout/LayoutGrid.js +1 -1
- package/dist/components/content/Layout/LayoutHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPane.js +1 -1
- package/dist/components/content/Layout/LayoutPanel.d.ts +11 -0
- package/dist/components/content/Layout/LayoutPanel.js +23 -13
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +53 -49
- package/dist/components/content/Layout/LayoutPanelTransition.js.map +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.d.ts +14 -14
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-column-window.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.js +1 -1
- package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
- package/dist/components/fields/Checkbox/context.js +1 -1
- package/dist/components/fields/ColorInput/ColorInput.js +1 -1
- package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
- package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
- package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
- package/dist/components/fields/ComboBox/ComboBox.js +1 -1
- package/dist/components/fields/ComboBox/comboBoxOptions.js +1 -1
- package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +107 -112
- package/dist/components/fields/NumberInput/NumberInput.js.map +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -2
- package/dist/components/fields/PasswordInput/PasswordInput.js.map +1 -1
- 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 +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -3
- package/dist/components/fields/SearchComboBox/SearchComboBox.js.map +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +47 -47
- package/dist/components/fields/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +987 -396
- package/dist/components/fields/TagInput/TagInput.js.map +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -2
- package/dist/components/fields/TextArea/TextArea.js.map +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -2
- package/dist/components/fields/TextInput/TextInput.js.map +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/displayed-validation.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/fields/option-origin-press.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.d.ts +9 -8
- package/dist/components/form/FieldWrapper/FieldWrapper.js +5 -2
- package/dist/components/form/FieldWrapper/FieldWrapper.js.map +1 -1
- package/dist/components/form/FieldWrapper/field-description.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.d.ts +0 -6
- package/dist/components/form/Form/use-field/use-field-props.js +40 -47
- package/dist/components/form/Form/use-field/use-field-props.js.map +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/field-chrome.js +4 -45
- package/dist/components/form/field-chrome.js.map +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.d.ts +5 -10
- package/dist/components/form/wrapper.js +6 -16
- package/dist/components/form/wrapper.js.map +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +1 -1
- package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
- package/dist/components/navigation/Tabs/TabPanel.js +1 -1
- package/dist/components/navigation/Tabs/TabPicker.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/TabsAction.js +1 -1
- package/dist/components/navigation/Tabs/TabsContext.js +1 -1
- package/dist/components/navigation/Tabs/popover-placement.js +1 -1
- package/dist/components/navigation/Tabs/styled.js +1 -1
- package/dist/components/navigation/Tabs/types.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
- package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
- package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
- package/dist/components/other/Calendar/Calendar.js +1 -1
- package/dist/components/other/Calendar/CalendarCell.js +1 -1
- package/dist/components/other/Calendar/CalendarGrid.js +1 -1
- package/dist/components/other/Calendar/CalendarHeader.js +1 -1
- package/dist/components/other/Calendar/CalendarPanel.js +1 -1
- package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
- package/dist/components/other/Calendar/PeriodGrid.js +1 -1
- package/dist/components/other/Calendar/RangeCalendar.js +1 -1
- package/dist/components/other/Calendar/styled.js +1 -1
- package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
- package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
- package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +1 -1
- package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
- package/dist/components/overlays/Dialog/DialogForm.js +1 -1
- package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
- package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
- package/dist/components/overlays/Dialog/context.js +1 -1
- package/dist/components/overlays/Dialog/default-button-text.js +1 -1
- package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
- package/dist/components/overlays/Dialog/use-dialog-open-sync.js +1 -1
- package/dist/components/overlays/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Modal/modal-containment.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
- package/dist/components/overlays/Tooltip/context.js +1 -1
- package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/portal/PortalProvider.js +1 -1
- package/dist/components/portal/usePortal.js +1 -1
- package/dist/components/shared/DraggableCollection.js +1 -1
- package/dist/components/shared/InvalidIcon.js +1 -1
- package/dist/components/shared/ValidIcon.js +1 -1
- package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
- package/dist/components/status/Spin/Cube.js +1 -1
- package/dist/components/status/Spin/InternalSpinner.js +1 -1
- package/dist/components/status/Spin/Spin.js +1 -1
- package/dist/components/status/Spin/SpinsContainer.js +1 -1
- package/dist/data/item-themes.js +1 -1
- package/dist/data/themes.js +1 -1
- package/dist/eslint-plugin/defaults.generated.js +1 -1
- package/dist/eslint-plugin/index.js +1 -1
- package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/createFormatter.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/instance.js +1 -1
- package/dist/i18n/locales/de-DE/uikit.js +1 -1
- package/dist/i18n/locales/en-US/uikit.js +1 -1
- package/dist/i18n/locales/es-ES/uikit.js +1 -1
- package/dist/i18n/locales/es-MX/uikit.js +1 -1
- package/dist/i18n/locales/fr-FR/uikit.js +1 -1
- package/dist/i18n/locales/it-IT/uikit.js +1 -1
- package/dist/i18n/locales/ja-JP/uikit.js +1 -1
- package/dist/i18n/locales/nb-NO/uikit.js +1 -1
- package/dist/i18n/locales/pt-BR/uikit.js +1 -1
- package/dist/i18n/locales/pt-PT/uikit.js +1 -1
- package/dist/i18n/locales/sv-SE/uikit.js +1 -1
- package/dist/i18n/locales/vi-VN/uikit.js +1 -1
- package/dist/i18n/locales.js +1 -1
- package/dist/i18n/namespace.js +1 -1
- package/dist/i18n/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigation-url.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/providers/use-navigation.js +1 -1
- package/dist/shared/form.d.ts +6 -12
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/overlayKeyPropagation.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +3 -3
- package/docs/CreateComponent.md +1 -1
- package/docs/FieldProperties.md +7 -10
- package/docs/Usage.md +1 -1
- package/docs/components/content/Layout.md +47 -0
- package/docs/tasty/configuration.md +1 -1
- package/docs/tasty/dsl.md +0 -2
- package/docs/tasty/pipeline.md +2 -2
- package/docs/tasty/react-api.md +0 -7
- package/docs/tasty/runtime-benchmarks.md +7 -7
- package/docs/tasty/tasty-static.md +0 -33
- package/package.json +2 -2
|
@@ -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-5b75dce | Cube Dev Team */
|
|
2
2
|
import { TooltipProvider } from "../../overlays/Tooltip/TooltipProvider.js";
|
|
3
3
|
import { CURRENT_CLEAR_STYLES, CURRENT_OUTLINE_STYLES, CURRENT_PRIMARY_STYLES, DANGER_CLEAR_STYLES, DANGER_OUTLINE_STYLES, DANGER_PRIMARY_STYLES, DEFAULT_CLEAR_STYLES, DEFAULT_OUTLINE_STYLES, DEFAULT_PRIMARY_STYLES, ITEM_ACTION_BASE_STYLES, SPECIAL_CLEAR_STYLES, SPECIAL_OUTLINE_STYLES, SPECIAL_PRIMARY_STYLES, SUCCESS_CLEAR_STYLES, SUCCESS_OUTLINE_STYLES, SUCCESS_PRIMARY_STYLES } from "../../../data/item-themes.js";
|
|
4
4
|
import { CheckIcon } from "../../../icons/CheckIcon.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
3
3
|
import { _Item } from "../Item/Item.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { _Layout } from "./Layout.js";
|
|
3
3
|
import { _LayoutContent } from "./LayoutContent.js";
|
|
4
4
|
import { _LayoutBlock } from "./LayoutBlock.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { isDevEnv } from "../../../utils/is-dev-env.js";
|
|
@@ -116,17 +116,26 @@ function LayoutInner(props) {
|
|
|
116
116
|
});
|
|
117
117
|
return () => cancelAnimationFrame(frameId);
|
|
118
118
|
}, [markReady]);
|
|
119
|
+
const hasBox = (layoutState?.containerWidth ?? 0) > 0 || (layoutState?.containerHeight ?? 0) > 0;
|
|
120
|
+
const isHeightCheckedRef = useRef(false);
|
|
121
|
+
const isCollapseCheckedRef = useRef(false);
|
|
119
122
|
useEffect(() => {
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
const element = localRef.current;
|
|
124
|
+
if (!isReady || !element || isHeightCheckedRef.current) return;
|
|
125
|
+
if (!isShown(element)) return;
|
|
126
|
+
isHeightCheckedRef.current = true;
|
|
127
|
+
if (element.offsetHeight === 0) setIsAutoHeight(true);
|
|
128
|
+
}, [isReady, hasBox]);
|
|
122
129
|
useEffect(() => {
|
|
123
|
-
if (isAutoHeight
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
if (!isAutoHeight || isCollapseCheckedRef.current) return;
|
|
131
|
+
const frameId_0 = requestAnimationFrame(() => {
|
|
132
|
+
const element_0 = localRef.current;
|
|
133
|
+
if (!element_0 || !isShown(element_0)) return;
|
|
134
|
+
isCollapseCheckedRef.current = true;
|
|
135
|
+
if (element_0.offsetHeight === 0) setIsCollapsed(true);
|
|
136
|
+
});
|
|
137
|
+
return () => cancelAnimationFrame(frameId_0);
|
|
138
|
+
}, [isAutoHeight, hasBox]);
|
|
130
139
|
const transitionStyle = { ...useMemo(() => {
|
|
131
140
|
const baseStyle = {
|
|
132
141
|
"--inset-top": `${panelSizes.top}px`,
|
|
@@ -165,10 +174,10 @@ function LayoutInner(props) {
|
|
|
165
174
|
isVertical,
|
|
166
175
|
doNotOverflow
|
|
167
176
|
]);
|
|
168
|
-
const setRefs = (
|
|
169
|
-
localRef.current =
|
|
170
|
-
if (typeof forwardedRef === "function") forwardedRef(
|
|
171
|
-
else if (forwardedRef) forwardedRef.current =
|
|
177
|
+
const setRefs = (element_1) => {
|
|
178
|
+
localRef.current = element_1;
|
|
179
|
+
if (typeof forwardedRef === "function") forwardedRef(element_1);
|
|
180
|
+
else if (forwardedRef) forwardedRef.current = element_1;
|
|
172
181
|
};
|
|
173
182
|
const showDevWarning = isCollapsed && (_forceShowDevWarning || isDevEnv());
|
|
174
183
|
const handleInnerFocus = useCallback((e) => {
|
|
@@ -224,6 +233,9 @@ function LayoutInner(props) {
|
|
|
224
233
|
]
|
|
225
234
|
});
|
|
226
235
|
}
|
|
236
|
+
function isShown(element) {
|
|
237
|
+
return element.checkVisibility?.() ?? true;
|
|
238
|
+
}
|
|
227
239
|
/**
|
|
228
240
|
* Layout component provides a vertical flex layout with overflow-safe content.
|
|
229
241
|
* Uses a two-element architecture (wrapper + content) to ensure content never overflows.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["useResizeObserver","BaseProps","BlockStyleProps","ColorStyleProps","filterBaseProps","FlowStyleProps","INNER_STYLES","mergeStyles","OUTER_STYLES","OuterStyleProps","Styles","tasty","CSSProperties","FocusEvent","ForwardedRef","forwardRef","HTMLAttributes","KeyboardEvent","ReactNode","useCallback","useContext","useEffect","useMemo","useRef","useState","isDevEnv","useCombinedRefs","extractStyles","Alert","LayoutNestedContext","LayoutPanelTransitionContext","LayoutProvider","useLayoutActionsContext","useLayoutRefsContext","useLayoutStateContext","LayoutElement","as","qa","styles","position","display","overflow","flexGrow","placeSelf","height","collapsed","vertical","Inner","$","container","inset","flow","placeContent","placeItems","transition","DEV_WARNING_STYLES","zIndex","CubeLayoutProps","isGrid","columns","rows","template","contentPadding","hasTransition","minContentSize","children","innerRef","HTMLDivElement","innerProps","_forceShowDevWarning","doNotOverflow","LayoutInner","props","forwardedRef","layoutActions","layoutState","layoutRefs","localRef","isAutoHeight","setIsAutoHeight","isCollapsed","setIsCollapsed","style","innerRefProp","otherProps","combinedInnerRef","updateContainerSize","ref","box","onResize","current","offsetWidth","offsetHeight","outerStyles","innerStyles","isVertical","flowFromProp","flowFromStyles","Record","flowValue","startsWith","finalStyles","gridStyles","gridColumns","gridRows","gridTemplate","panelSizes","left","top","right","bottom","isDragging","isReady","markReady","dismissOverlayPanels","hasOverlayPanels","isClippingPanels","frameId","requestAnimationFrame","cancelAnimationFrame","insetStyle","baseStyle","transitionStyle","overflowX","overflowY","overflowInline","overflowBlock","overflowClipMargin","mods","dragging","setRefs","element","showDevWarning","handleInnerFocus","e","inner","currentTarget","contains","target","Node","relatedTarget","handleKeyDown","key","preventDefault","stopPropagation","eventProps","undefined","setPanelContainer","Layout","_c","isInRegion","isInLayout","t0","t1","t2","t3","_Layout","displayName"],"sources":["../../../../src/components/content/Layout/Layout.tsx"],"sourcesContent":["import { useResizeObserver } from '@react-aria/utils';\nimport {\n BaseProps,\n BlockStyleProps,\n ColorStyleProps,\n filterBaseProps,\n FlowStyleProps,\n INNER_STYLES,\n mergeStyles,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n CSSProperties,\n FocusEvent,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { isDevEnv } from '../../../utils/is-dev-env';\nimport { useCombinedRefs } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { Alert } from '../Alert';\n\nimport {\n LayoutNestedContext,\n LayoutPanelTransitionContext,\n LayoutProvider,\n useLayoutActionsContext,\n useLayoutRefsContext,\n useLayoutStateContext,\n} from './LayoutContext';\n\nconst LayoutElement = tasty({\n as: 'div',\n qa: 'Layout',\n styles: {\n position: 'relative',\n display: 'block',\n overflow: {\n '': 'visible',\n 'do-not-overflow': 'hidden',\n },\n flexGrow: 1,\n placeSelf: 'stretch',\n height: {\n '': 'auto',\n 'auto-height': 'fixed 100%',\n collapsed: '6x',\n },\n\n '$content-padding': '1x',\n // Auto-border size for sub-components (set when layout is vertical)\n '$layout-border-size': {\n '': '0',\n vertical: '1bw',\n },\n\n Inner: {\n // .base-class[data-hover] > [data-element=\"Inner\"] { ...}\n // Direct child selector required for nested layouts\n $: '>',\n container: 'layout / inline-size',\n position: 'absolute',\n inset: '$inset-top $inset-right $inset-bottom $inset-left',\n display: 'flex',\n flow: 'column',\n placeContent: 'stretch',\n placeItems: 'stretch',\n // Disable transition during panel resize for snappy feedback\n // Also disable transition when not ready to prevent initial animation\n // Only animate when has-transition is enabled (and not dragging/not-ready)\n transition: {\n '': 'none',\n 'has-transition': 'inset $transition ease-out',\n 'dragging | not-ready': 'none',\n },\n },\n },\n});\n\n// The collapse warning sits on top of `Inner` rather than in place of it.\n// `Inner` is absolutely positioned, so an in-flow sibling would paint beneath\n// it; match its box and take the layer above.\nconst DEV_WARNING_STYLES: Styles = {\n position: 'absolute',\n inset: '0',\n zIndex: 1,\n overflow: 'auto',\n};\n\nexport interface CubeLayoutProps\n extends BaseProps,\n OuterStyleProps,\n BlockStyleProps,\n ColorStyleProps,\n FlowStyleProps {\n /** Switch to grid display mode */\n isGrid?: boolean;\n /** Grid template columns (when isGrid=true) */\n columns?: Styles['gridColumns'];\n /** Grid template rows (when isGrid=true) */\n rows?: Styles['gridRows'];\n /** Grid template shorthand */\n template?: Styles['gridTemplate'];\n /** Padding for content areas (Layout.Content components). Default: '1x' */\n contentPadding?: Styles['padding'];\n /** Enable transition animation for Inner content when panels open/close */\n hasTransition?: boolean;\n /** Minimum size reserved for the content area between panels. Default: 320 */\n minContentSize?: number;\n /** Styles for wrapper and Inner sub-element */\n styles?: Styles;\n children?: ReactNode;\n /** Ref for the inner content element */\n innerRef?: ForwardedRef<HTMLDivElement>;\n /** Props to spread on the Inner sub-element */\n innerProps?: HTMLAttributes<HTMLDivElement>;\n /**\n * @internal Force show dev warning even in production (for storybook testing)\n */\n _forceShowDevWarning?: boolean;\n /**\n * When true, applies overflow: hidden to the root element.\n * By default, overflow is visible.\n */\n doNotOverflow?: boolean;\n}\n\nfunction LayoutInner(\n props: CubeLayoutProps & { forwardedRef?: ForwardedRef<HTMLDivElement> },\n) {\n const layoutActions = useLayoutActionsContext();\n const layoutState = useLayoutStateContext();\n const layoutRefs = useLayoutRefsContext();\n const localRef = useRef<HTMLDivElement>(null);\n const [isAutoHeight, setIsAutoHeight] = useState(false);\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const {\n isGrid,\n columns,\n rows,\n template,\n contentPadding,\n hasTransition = false,\n minContentSize,\n styles,\n children,\n style,\n forwardedRef,\n innerRef: innerRefProp,\n innerProps,\n _forceShowDevWarning,\n doNotOverflow,\n ...otherProps\n } = props;\n\n const combinedInnerRef = useCombinedRefs(innerRefProp);\n const updateContainerSize = layoutActions?.updateContainerSize;\n\n useResizeObserver({\n ref: localRef,\n box: 'border-box',\n onResize: useCallback(() => {\n if (localRef.current) {\n updateContainerSize?.(\n localRef.current.offsetWidth,\n localRef.current.offsetHeight,\n );\n }\n }, [updateContainerSize]),\n });\n\n // Extract outer wrapper styles and inner content styles\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n const innerStyles = extractStyles(otherProps, INNER_STYLES);\n\n // Calculate if the layout flow is vertical (for auto-border feature)\n // Default flow is 'column' (vertical), only horizontal when explicitly set to 'row'\n const isVertical = useMemo(() => {\n const flowFromProp = innerStyles?.flow;\n const flowFromStyles = (styles?.Inner as Record<string, unknown>)?.flow;\n const flowValue = flowFromProp ?? flowFromStyles;\n\n return typeof flowValue !== 'string' || !flowValue.startsWith('row');\n }, [innerStyles?.flow, styles?.Inner]);\n\n // Merge styles using the same pattern as LayoutPane\n const finalStyles = useMemo(() => {\n // Handle grid mode and grid properties\n const gridStyles: Styles = {};\n\n if (isGrid) {\n gridStyles.display = 'grid';\n }\n\n if (columns) {\n gridStyles.gridColumns = columns;\n }\n\n if (rows) {\n gridStyles.gridRows = rows;\n }\n\n if (template) {\n gridStyles.gridTemplate = template;\n }\n\n return mergeStyles(\n outerStyles,\n contentPadding != null ? { '$content-padding': contentPadding } : null,\n styles,\n { Inner: mergeStyles(innerStyles, gridStyles, styles?.Inner as Styles) },\n );\n }, [\n outerStyles,\n innerStyles,\n contentPadding,\n styles,\n isGrid,\n columns,\n rows,\n template,\n ]);\n\n // Calculate inset values from panel sizes\n const panelSizes = layoutState?.panelSizes ?? {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n };\n\n const isDragging = layoutState?.isDragging ?? false;\n const isReady = layoutState?.isReady ?? true;\n const markReady = layoutActions?.markReady;\n const dismissOverlayPanels = layoutActions?.dismissOverlayPanels;\n const hasOverlayPanels = layoutState?.hasOverlayPanels ?? false;\n const isClippingPanels =\n useContext(LayoutPanelTransitionContext)?.isClippingPanels ?? false;\n\n // Mark layout as ready after first paint\n // Using useEffect + requestAnimationFrame ensures:\n // 1. Panels register in useLayoutEffect → correct insets before first paint\n // 2. First paint with not-ready=true (transition disabled)\n // 3. After paint completes → enables transitions for subsequent changes\n useEffect(() => {\n const frameId = requestAnimationFrame(() => {\n markReady?.();\n });\n\n return () => cancelAnimationFrame(frameId);\n }, [markReady]);\n\n // Auto-height detection: if layout collapses to 0 height after initialization,\n // automatically set height to 100% to prevent invisible layout\n useEffect(() => {\n if (isReady && localRef.current && localRef.current.offsetHeight === 0) {\n setIsAutoHeight(true);\n }\n }, [isReady]);\n\n // Second check: if still 0 height after auto-height was applied,\n // show collapsed state with warning\n useEffect(() => {\n if (isAutoHeight && localRef.current) {\n // Use requestAnimationFrame to check after styles have been applied\n const frameId = requestAnimationFrame(() => {\n if (localRef.current && localRef.current.offsetHeight === 0) {\n setIsCollapsed(true);\n }\n });\n\n return () => cancelAnimationFrame(frameId);\n }\n }, [isAutoHeight]);\n\n const insetStyle = useMemo(() => {\n const baseStyle: Record<string, string> = {\n '--inset-top': `${panelSizes.top}px`,\n '--inset-right': `${panelSizes.right}px`,\n '--inset-bottom': `${panelSizes.bottom}px`,\n '--inset-left': `${panelSizes.left}px`,\n };\n\n if (style) {\n return { ...baseStyle, ...style } as CSSProperties;\n }\n\n return baseStyle as CSSProperties;\n }, [panelSizes, style]);\n\n // Remove consumer longhands while clipping so they cannot override the shorthand.\n // Restoring the original style object also restores the latest consumer values.\n const transitionStyle = { ...insetStyle };\n if (isClippingPanels) {\n delete transitionStyle.overflowX;\n delete transitionStyle.overflowY;\n delete transitionStyle.overflowInline;\n delete transitionStyle.overflowBlock;\n transitionStyle.overflow = 'clip';\n transitionStyle.overflowClipMargin = '0px';\n }\n\n const mods = useMemo(\n () => ({\n dragging: isDragging,\n 'not-ready': !isReady,\n 'has-transition': hasTransition,\n 'auto-height': isAutoHeight && !isCollapsed,\n collapsed: isCollapsed,\n vertical: isVertical,\n 'do-not-overflow': doNotOverflow,\n }),\n [\n isDragging,\n isReady,\n hasTransition,\n isAutoHeight,\n isCollapsed,\n isVertical,\n doNotOverflow,\n ],\n );\n\n // Combine local ref with forwarded ref\n const setRefs = (element: HTMLDivElement | null) => {\n localRef.current = element;\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n };\n\n // Show dev warning when collapsed and in dev mode (or forced for stories)\n const showDevWarning = isCollapsed && (_forceShowDevWarning || isDevEnv());\n\n // Handle focus entering the Inner element - dismiss overlay panels\n const handleInnerFocus = useCallback(\n (e: FocusEvent<HTMLDivElement>) => {\n // Only dismiss if there are overlay panels\n if (!hasOverlayPanels) return;\n\n const inner = e.currentTarget;\n\n // Panels portal out of Inner but stay its React children, so focus inside\n // a panel (or a popover opened from it) bubbles here too. Only focus that\n // lands in Inner's own DOM, the main content, can dismiss.\n if (!inner.contains(e.target as Node)) return;\n\n // Check if focus is coming from outside the Inner element\n const relatedTarget = e.relatedTarget as Node | null;\n\n // If relatedTarget is null or not inside the Inner element,\n // focus is entering from outside - dismiss overlay panels\n if (!relatedTarget || !inner.contains(relatedTarget)) {\n dismissOverlayPanels?.();\n }\n },\n [hasOverlayPanels, dismissOverlayPanels],\n );\n\n // Handle Escape key anywhere in the Layout - dismiss overlay panels\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (hasOverlayPanels && e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n dismissOverlayPanels?.();\n }\n },\n [hasOverlayPanels, dismissOverlayPanels],\n );\n\n return (\n <LayoutElement\n ref={setRefs}\n {...filterBaseProps(otherProps, { eventProps: true })}\n mods={mods}\n styles={finalStyles}\n style={transitionStyle}\n onKeyDown={hasOverlayPanels ? handleKeyDown : undefined}\n >\n {/* All children go inside the Inner element - panels will portal themselves out */}\n <div\n ref={combinedInnerRef}\n data-element=\"Inner\"\n onFocus={handleInnerFocus}\n {...innerProps}\n >\n {children}\n </div>\n {/* Container for panels to portal into - rendered after Inner so panels paint on top via DOM order */}\n <div ref={layoutRefs?.setPanelContainer} data-element=\"PanelContainer\" />\n {/* Overlaid, never substituted for `children`. A zero-height measurement is\n not proof of a mistake - a hidden tab, a collapsed accordion and a\n container mid-animation all measure zero - so unmounting the subtree\n would turn a wrong guess into an outage, and remounting it on the way\n back would drop whatever state it held. */}\n {showDevWarning ? (\n <Alert theme=\"danger\" styles={DEV_WARNING_STYLES}>\n <b>UIKit:</b> <b><Layout/></b> has collapsed to <b>0</b> height.\n Ensure the parent container has a defined height or use the{' '}\n <b>height</b> prop on <b><Layout/></b>.\n </Alert>\n ) : null}\n </LayoutElement>\n );\n}\n\n/**\n * Layout component provides a vertical flex layout with overflow-safe content.\n * Uses a two-element architecture (wrapper + content) to ensure content never overflows.\n */\nfunction Layout(props: CubeLayoutProps, ref: ForwardedRef<HTMLDivElement>) {\n const { hasTransition, minContentSize } = props;\n // Nested inside one of another Layout's regions, or placed straight inside\n // another Layout: either way its footer is not the page's.\n const isInRegion = useContext(LayoutNestedContext);\n const isInLayout = useLayoutStateContext() != null;\n\n return (\n <LayoutNestedContext.Provider value={isInRegion || isInLayout}>\n <LayoutProvider\n hasTransition={hasTransition}\n minContentSize={minContentSize}\n >\n <LayoutInner {...props} forwardedRef={ref} />\n </LayoutProvider>\n </LayoutNestedContext.Provider>\n );\n}\n\nconst _Layout = forwardRef(Layout);\n\n_Layout.displayName = 'Layout';\n\nexport { _Layout as Layout };\n"],"mappings":";;;;;;;;;;;;;AA4CA,MAAMmC,gBAAgBxB,MAAM;CAC1ByB,IAAI;CACJC,IAAI;CACJC,QAAQ;EACNC,UAAU;EACVC,SAAS;EACTC,UAAU;GACR,IAAI;GACJ,mBAAmB;GACpB;EACDC,UAAU;EACVC,WAAW;EACXC,QAAQ;GACN,IAAI;GACJ,eAAe;GACfC,WAAW;GACZ;EAED,oBAAoB;EAEpB,uBAAuB;GACrB,IAAI;GACJC,UAAU;GACX;EAEDC,OAAO;GAGLC,GAAG;GACHC,WAAW;GACXV,UAAU;GACVW,OAAO;GACPV,SAAS;GACTW,MAAM;GACNC,cAAc;GACdC,YAAY;GAIZC,YAAY;IACV,IAAI;IACJ,kBAAkB;IAClB,wBAAwB;IAC1B;GACF;EACF;CACD,CAAC;AAKF,MAAMC,qBAA6B;CACjChB,UAAU;CACVW,OAAO;CACPM,QAAQ;CACRf,UAAU;CACX;AAwCD,SAAS8B,YACPC,OACA;CACA,MAAME,gBAAgB1C,yBAAyB;CAC/C,MAAM2C,cAAczC,uBAAuB;CAC3C,MAAM0C,aAAa3C,sBAAsB;CACzC,MAAM4C,WAAWtD,OAAuB,KAAK;CAC7C,MAAM,CAACuD,cAAcC,mBAAmBvD,SAAS,MAAM;CACvD,MAAM,CAACwD,aAAaC,kBAAkBzD,SAAS,MAAM;CAErD,MAAM,EACJkC,QACAC,SACAC,MACAC,UACAC,gBACAC,gBAAgB,OAChBC,gBACA1B,QACA2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AE,WAAU;;KAAS,oBAAC,iBAAE,cAAmB;;;KACtC,GACN;;GACU;;;;;;AAQpB,SAAA6F,OAAA5E,OAAAe,KAAA;CAAA,MAAAvC,IAAAqG,EAAA,GAAA;CACE,MAAA,EAAAtF,eAAAC,mBAA0CQ;CAG1C,MAAA8E,aAAmBlI,WAAWS,oBAAoB;CAClD,MAAA0H,aAAmBrH,uBAAuB,IAAI;CAGP,MAAAsH,KAAAF,cAAAC;CAAwB,IAAAE;AAAA,KAAAzG,EAAA,OAAAwB,SAAAxB,EAAA,OAAAuC,KAAA;AAKzDkE,OAAA,oBAAC;GAAW,GAAKjF;GAAqBe,cAAAA;IAAO;AAAAvC,IAAA,KAAAwB;AAAAxB,IAAA,KAAAuC;AAAAvC,IAAA,KAAAyG;OAAAA,MAAAzG,EAAA;CAAA,IAAA0G;AAAA,KAAA1G,EAAA,OAAAe,iBAAAf,EAAA,OAAAgB,kBAAAhB,EAAA,OAAAyG,IAAA;AAJ/CC,OAAA,oBAAC;GACgB3F;GACCC;aAEhByF;IACe;AAAAzG,IAAA,KAAAe;AAAAf,IAAA,KAAAgB;AAAAhB,IAAA,KAAAyG;AAAAzG,IAAA,KAAA0G;OAAAA,MAAA1G,EAAA;CAAA,IAAA2G;AAAA,KAAA3G,EAAA,OAAAwG,MAAAxG,EAAA,OAAA0G,IAAA;AANnBC,OAAA,oBAAA,oBAAA;GAAqC,OAAAH;aACnCE;IAM6B;AAAA1G,IAAA,KAAAwG;AAAAxG,IAAA,KAAA0G;AAAA1G,IAAA,KAAA2G;OAAAA,MAAA3G,EAAA;AAAA,QAP/B2G;;AAWJ,MAAMC,UAAU7I,WAAWqI,OAAO;AAElCQ,QAAQC,cAAc"}
|
|
1
|
+
{"version":3,"file":"Layout.js","names":["useResizeObserver","BaseProps","BlockStyleProps","ColorStyleProps","filterBaseProps","FlowStyleProps","INNER_STYLES","mergeStyles","OUTER_STYLES","OuterStyleProps","Styles","tasty","CSSProperties","FocusEvent","ForwardedRef","forwardRef","HTMLAttributes","KeyboardEvent","ReactNode","useCallback","useContext","useEffect","useMemo","useRef","useState","isDevEnv","useCombinedRefs","extractStyles","Alert","LayoutNestedContext","LayoutPanelTransitionContext","LayoutProvider","useLayoutActionsContext","useLayoutRefsContext","useLayoutStateContext","LayoutElement","as","qa","styles","position","display","overflow","flexGrow","placeSelf","height","collapsed","vertical","Inner","$","container","inset","flow","placeContent","placeItems","transition","DEV_WARNING_STYLES","zIndex","CubeLayoutProps","isGrid","columns","rows","template","contentPadding","hasTransition","minContentSize","children","innerRef","HTMLDivElement","innerProps","_forceShowDevWarning","doNotOverflow","LayoutInner","props","forwardedRef","layoutActions","layoutState","layoutRefs","localRef","isAutoHeight","setIsAutoHeight","isCollapsed","setIsCollapsed","style","innerRefProp","otherProps","combinedInnerRef","updateContainerSize","ref","box","onResize","current","offsetWidth","offsetHeight","outerStyles","innerStyles","isVertical","flowFromProp","flowFromStyles","Record","flowValue","startsWith","finalStyles","gridStyles","gridColumns","gridRows","gridTemplate","panelSizes","left","top","right","bottom","isDragging","isReady","markReady","dismissOverlayPanels","hasOverlayPanels","isClippingPanels","frameId","requestAnimationFrame","cancelAnimationFrame","hasBox","containerWidth","containerHeight","isHeightCheckedRef","isCollapseCheckedRef","element","isShown","insetStyle","baseStyle","transitionStyle","overflowX","overflowY","overflowInline","overflowBlock","overflowClipMargin","mods","dragging","setRefs","showDevWarning","handleInnerFocus","e","inner","currentTarget","contains","target","Node","relatedTarget","handleKeyDown","key","preventDefault","stopPropagation","eventProps","undefined","setPanelContainer","HTMLElement","checkVisibility","Layout","_c","isInRegion","isInLayout","t0","t1","t2","t3","_Layout","displayName"],"sources":["../../../../src/components/content/Layout/Layout.tsx"],"sourcesContent":["import { useResizeObserver } from '@react-aria/utils';\nimport {\n BaseProps,\n BlockStyleProps,\n ColorStyleProps,\n filterBaseProps,\n FlowStyleProps,\n INNER_STYLES,\n mergeStyles,\n OUTER_STYLES,\n OuterStyleProps,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n CSSProperties,\n FocusEvent,\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n KeyboardEvent,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { isDevEnv } from '../../../utils/is-dev-env';\nimport { useCombinedRefs } from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { Alert } from '../Alert';\n\nimport {\n LayoutNestedContext,\n LayoutPanelTransitionContext,\n LayoutProvider,\n useLayoutActionsContext,\n useLayoutRefsContext,\n useLayoutStateContext,\n} from './LayoutContext';\n\nconst LayoutElement = tasty({\n as: 'div',\n qa: 'Layout',\n styles: {\n position: 'relative',\n display: 'block',\n overflow: {\n '': 'visible',\n 'do-not-overflow': 'hidden',\n },\n flexGrow: 1,\n placeSelf: 'stretch',\n height: {\n '': 'auto',\n 'auto-height': 'fixed 100%',\n collapsed: '6x',\n },\n\n '$content-padding': '1x',\n // Auto-border size for sub-components (set when layout is vertical)\n '$layout-border-size': {\n '': '0',\n vertical: '1bw',\n },\n\n Inner: {\n // .base-class[data-hover] > [data-element=\"Inner\"] { ...}\n // Direct child selector required for nested layouts\n $: '>',\n container: 'layout / inline-size',\n position: 'absolute',\n inset: '$inset-top $inset-right $inset-bottom $inset-left',\n display: 'flex',\n flow: 'column',\n placeContent: 'stretch',\n placeItems: 'stretch',\n // Disable transition during panel resize for snappy feedback\n // Also disable transition when not ready to prevent initial animation\n // Only animate when has-transition is enabled (and not dragging/not-ready)\n transition: {\n '': 'none',\n 'has-transition': 'inset $transition ease-out',\n 'dragging | not-ready': 'none',\n },\n },\n },\n});\n\n// The collapse warning sits on top of `Inner` rather than in place of it.\n// `Inner` is absolutely positioned, so an in-flow sibling would paint beneath\n// it; match its box and take the layer above.\nconst DEV_WARNING_STYLES: Styles = {\n position: 'absolute',\n inset: '0',\n zIndex: 1,\n overflow: 'auto',\n};\n\nexport interface CubeLayoutProps\n extends BaseProps,\n OuterStyleProps,\n BlockStyleProps,\n ColorStyleProps,\n FlowStyleProps {\n /** Switch to grid display mode */\n isGrid?: boolean;\n /** Grid template columns (when isGrid=true) */\n columns?: Styles['gridColumns'];\n /** Grid template rows (when isGrid=true) */\n rows?: Styles['gridRows'];\n /** Grid template shorthand */\n template?: Styles['gridTemplate'];\n /** Padding for content areas (Layout.Content components). Default: '1x' */\n contentPadding?: Styles['padding'];\n /** Enable transition animation for Inner content when panels open/close */\n hasTransition?: boolean;\n /** Minimum size reserved for the content area between panels. Default: 320 */\n minContentSize?: number;\n /** Styles for wrapper and Inner sub-element */\n styles?: Styles;\n children?: ReactNode;\n /** Ref for the inner content element */\n innerRef?: ForwardedRef<HTMLDivElement>;\n /** Props to spread on the Inner sub-element */\n innerProps?: HTMLAttributes<HTMLDivElement>;\n /**\n * @internal Force show dev warning even in production (for storybook testing)\n */\n _forceShowDevWarning?: boolean;\n /**\n * When true, applies overflow: hidden to the root element.\n * By default, overflow is visible.\n */\n doNotOverflow?: boolean;\n}\n\nfunction LayoutInner(\n props: CubeLayoutProps & { forwardedRef?: ForwardedRef<HTMLDivElement> },\n) {\n const layoutActions = useLayoutActionsContext();\n const layoutState = useLayoutStateContext();\n const layoutRefs = useLayoutRefsContext();\n const localRef = useRef<HTMLDivElement>(null);\n const [isAutoHeight, setIsAutoHeight] = useState(false);\n const [isCollapsed, setIsCollapsed] = useState(false);\n\n const {\n isGrid,\n columns,\n rows,\n template,\n contentPadding,\n hasTransition = false,\n minContentSize,\n styles,\n children,\n style,\n forwardedRef,\n innerRef: innerRefProp,\n innerProps,\n _forceShowDevWarning,\n doNotOverflow,\n ...otherProps\n } = props;\n\n const combinedInnerRef = useCombinedRefs(innerRefProp);\n const updateContainerSize = layoutActions?.updateContainerSize;\n\n useResizeObserver({\n ref: localRef,\n box: 'border-box',\n onResize: useCallback(() => {\n if (localRef.current) {\n updateContainerSize?.(\n localRef.current.offsetWidth,\n localRef.current.offsetHeight,\n );\n }\n }, [updateContainerSize]),\n });\n\n // Extract outer wrapper styles and inner content styles\n const outerStyles = extractStyles(otherProps, OUTER_STYLES);\n const innerStyles = extractStyles(otherProps, INNER_STYLES);\n\n // Calculate if the layout flow is vertical (for auto-border feature)\n // Default flow is 'column' (vertical), only horizontal when explicitly set to 'row'\n const isVertical = useMemo(() => {\n const flowFromProp = innerStyles?.flow;\n const flowFromStyles = (styles?.Inner as Record<string, unknown>)?.flow;\n const flowValue = flowFromProp ?? flowFromStyles;\n\n return typeof flowValue !== 'string' || !flowValue.startsWith('row');\n }, [innerStyles?.flow, styles?.Inner]);\n\n // Merge styles using the same pattern as LayoutPane\n const finalStyles = useMemo(() => {\n // Handle grid mode and grid properties\n const gridStyles: Styles = {};\n\n if (isGrid) {\n gridStyles.display = 'grid';\n }\n\n if (columns) {\n gridStyles.gridColumns = columns;\n }\n\n if (rows) {\n gridStyles.gridRows = rows;\n }\n\n if (template) {\n gridStyles.gridTemplate = template;\n }\n\n return mergeStyles(\n outerStyles,\n contentPadding != null ? { '$content-padding': contentPadding } : null,\n styles,\n { Inner: mergeStyles(innerStyles, gridStyles, styles?.Inner as Styles) },\n );\n }, [\n outerStyles,\n innerStyles,\n contentPadding,\n styles,\n isGrid,\n columns,\n rows,\n template,\n ]);\n\n // Calculate inset values from panel sizes\n const panelSizes = layoutState?.panelSizes ?? {\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n };\n\n const isDragging = layoutState?.isDragging ?? false;\n const isReady = layoutState?.isReady ?? true;\n const markReady = layoutActions?.markReady;\n const dismissOverlayPanels = layoutActions?.dismissOverlayPanels;\n const hasOverlayPanels = layoutState?.hasOverlayPanels ?? false;\n const isClippingPanels =\n useContext(LayoutPanelTransitionContext)?.isClippingPanels ?? false;\n\n // Mark layout as ready after first paint\n // Using useEffect + requestAnimationFrame ensures:\n // 1. Panels register in useLayoutEffect → correct insets before first paint\n // 2. First paint with not-ready=true (transition disabled)\n // 3. After paint completes → enables transitions for subsequent changes\n useEffect(() => {\n const frameId = requestAnimationFrame(() => {\n markReady?.();\n });\n\n return () => cancelAnimationFrame(frameId);\n }, [markReady]);\n\n // A Layout under a `display: none` ancestor, such as a closed `hideOnClose`\n // panel, has no height to judge yet. Each check waits until the Layout is\n // shown, then runs once. Gaining a box re-runs a pending check, so one first\n // shown at 0×0 is never judged.\n const hasBox =\n (layoutState?.containerWidth ?? 0) > 0 ||\n (layoutState?.containerHeight ?? 0) > 0;\n const isHeightCheckedRef = useRef(false);\n const isCollapseCheckedRef = useRef(false);\n\n // Auto-height detection: if layout collapses to 0 height after initialization,\n // automatically set height to 100% to prevent invisible layout\n useEffect(() => {\n const element = localRef.current;\n\n if (!isReady || !element || isHeightCheckedRef.current) return;\n if (!isShown(element)) return;\n\n isHeightCheckedRef.current = true;\n\n if (element.offsetHeight === 0) {\n setIsAutoHeight(true);\n }\n }, [isReady, hasBox]);\n\n // Second check: if still 0 height after auto-height was applied,\n // show collapsed state with warning\n useEffect(() => {\n if (!isAutoHeight || isCollapseCheckedRef.current) return;\n\n // Use requestAnimationFrame to check after styles have been applied\n const frameId = requestAnimationFrame(() => {\n const element = localRef.current;\n\n if (!element || !isShown(element)) return;\n\n isCollapseCheckedRef.current = true;\n\n if (element.offsetHeight === 0) {\n setIsCollapsed(true);\n }\n });\n\n return () => cancelAnimationFrame(frameId);\n }, [isAutoHeight, hasBox]);\n\n const insetStyle = useMemo(() => {\n const baseStyle: Record<string, string> = {\n '--inset-top': `${panelSizes.top}px`,\n '--inset-right': `${panelSizes.right}px`,\n '--inset-bottom': `${panelSizes.bottom}px`,\n '--inset-left': `${panelSizes.left}px`,\n };\n\n if (style) {\n return { ...baseStyle, ...style } as CSSProperties;\n }\n\n return baseStyle as CSSProperties;\n }, [panelSizes, style]);\n\n // Remove consumer longhands while clipping so they cannot override the shorthand.\n // Restoring the original style object also restores the latest consumer values.\n const transitionStyle = { ...insetStyle };\n if (isClippingPanels) {\n delete transitionStyle.overflowX;\n delete transitionStyle.overflowY;\n delete transitionStyle.overflowInline;\n delete transitionStyle.overflowBlock;\n transitionStyle.overflow = 'clip';\n transitionStyle.overflowClipMargin = '0px';\n }\n\n const mods = useMemo(\n () => ({\n dragging: isDragging,\n 'not-ready': !isReady,\n 'has-transition': hasTransition,\n 'auto-height': isAutoHeight && !isCollapsed,\n collapsed: isCollapsed,\n vertical: isVertical,\n 'do-not-overflow': doNotOverflow,\n }),\n [\n isDragging,\n isReady,\n hasTransition,\n isAutoHeight,\n isCollapsed,\n isVertical,\n doNotOverflow,\n ],\n );\n\n // Combine local ref with forwarded ref\n const setRefs = (element: HTMLDivElement | null) => {\n localRef.current = element;\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n };\n\n // Show dev warning when collapsed and in dev mode (or forced for stories)\n const showDevWarning = isCollapsed && (_forceShowDevWarning || isDevEnv());\n\n // Handle focus entering the Inner element - dismiss overlay panels\n const handleInnerFocus = useCallback(\n (e: FocusEvent<HTMLDivElement>) => {\n // Only dismiss if there are overlay panels\n if (!hasOverlayPanels) return;\n\n const inner = e.currentTarget;\n\n // Panels portal out of Inner but stay its React children, so focus inside\n // a panel (or a popover opened from it) bubbles here too. Only focus that\n // lands in Inner's own DOM, the main content, can dismiss.\n if (!inner.contains(e.target as Node)) return;\n\n // Check if focus is coming from outside the Inner element\n const relatedTarget = e.relatedTarget as Node | null;\n\n // If relatedTarget is null or not inside the Inner element,\n // focus is entering from outside - dismiss overlay panels\n if (!relatedTarget || !inner.contains(relatedTarget)) {\n dismissOverlayPanels?.();\n }\n },\n [hasOverlayPanels, dismissOverlayPanels],\n );\n\n // Handle Escape key anywhere in the Layout - dismiss overlay panels\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (hasOverlayPanels && e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n dismissOverlayPanels?.();\n }\n },\n [hasOverlayPanels, dismissOverlayPanels],\n );\n\n return (\n <LayoutElement\n ref={setRefs}\n {...filterBaseProps(otherProps, { eventProps: true })}\n mods={mods}\n styles={finalStyles}\n style={transitionStyle}\n onKeyDown={hasOverlayPanels ? handleKeyDown : undefined}\n >\n {/* All children go inside the Inner element - panels will portal themselves out */}\n <div\n ref={combinedInnerRef}\n data-element=\"Inner\"\n onFocus={handleInnerFocus}\n {...innerProps}\n >\n {children}\n </div>\n {/* Container for panels to portal into - rendered after Inner so panels paint on top via DOM order */}\n <div ref={layoutRefs?.setPanelContainer} data-element=\"PanelContainer\" />\n {/* Overlaid, never substituted for `children`. A zero-height measurement is\n not proof of a mistake - a collapsed accordion and a container\n mid-animation both measure zero - so unmounting the subtree\n would turn a wrong guess into an outage, and remounting it on the way\n back would drop whatever state it held. */}\n {showDevWarning ? (\n <Alert theme=\"danger\" styles={DEV_WARNING_STYLES}>\n <b>UIKit:</b> <b><Layout/></b> has collapsed to <b>0</b> height.\n Ensure the parent container has a defined height or use the{' '}\n <b>height</b> prop on <b><Layout/></b>.\n </Alert>\n ) : null}\n </LayoutElement>\n );\n}\n\n// False under a `display: none` ancestor. jsdom has no `checkVisibility`, so\n// there every Layout counts as shown.\nfunction isShown(element: HTMLElement) {\n return element.checkVisibility?.() ?? true;\n}\n\n/**\n * Layout component provides a vertical flex layout with overflow-safe content.\n * Uses a two-element architecture (wrapper + content) to ensure content never overflows.\n */\nfunction Layout(props: CubeLayoutProps, ref: ForwardedRef<HTMLDivElement>) {\n const { hasTransition, minContentSize } = props;\n // Nested inside one of another Layout's regions, or placed straight inside\n // another Layout: either way its footer is not the page's.\n const isInRegion = useContext(LayoutNestedContext);\n const isInLayout = useLayoutStateContext() != null;\n\n return (\n <LayoutNestedContext.Provider value={isInRegion || isInLayout}>\n <LayoutProvider\n hasTransition={hasTransition}\n minContentSize={minContentSize}\n >\n <LayoutInner {...props} forwardedRef={ref} />\n </LayoutProvider>\n </LayoutNestedContext.Provider>\n );\n}\n\nconst _Layout = forwardRef(Layout);\n\n_Layout.displayName = 'Layout';\n\nexport { _Layout as Layout };\n"],"mappings":";;;;;;;;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canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { _LayoutContent } from "./LayoutContent.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { _LayoutContainer } from "./LayoutContainer.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { LayoutContextReset } from "./LayoutContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
4
4
|
import { LayoutContextReset } from "./LayoutContext.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { useEvent } from "../../../_internal/hooks/use-event.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { createContext, useContext, useRef, useState } from "react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { _LayoutContent } from "./LayoutContent.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { LayoutNestedContext } from "./LayoutContext.js";
|
|
3
3
|
import { _LayoutContent } from "./LayoutContent.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { _LayoutContent } from "./LayoutContent.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { tasty } from "@tenphi/tasty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { useAutoTooltip } from "../use-auto-tooltip.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.js";
|
|
4
4
|
import { Button } from "../../actions/Button/Button.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-5b75dce | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -40,6 +40,17 @@ interface CubeLayoutPanelProps extends BaseProps, ContainerStyleProps {
|
|
|
40
40
|
onOpenChange?: (isOpen: boolean) => void;
|
|
41
41
|
/** Enable slide transition on open/close */
|
|
42
42
|
hasTransition?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Hide the closed panel instead of unmounting its content, so the content
|
|
45
|
+
* keeps its state (an unsent draft, scroll position, a request in flight)
|
|
46
|
+
* until the panel reopens. A hidden panel takes no space and no focus.
|
|
47
|
+
* The content mounts once, even while the panel starts closed, so mount
|
|
48
|
+
* effects and a native `autoFocus` do not run again on reopen. Content that
|
|
49
|
+
* mounts while closed is hidden: `autoFocus` does nothing and measurements
|
|
50
|
+
* read zero until the panel opens. Not used in dialog mode.
|
|
51
|
+
* Default: false
|
|
52
|
+
*/
|
|
53
|
+
hideOnClose?: boolean;
|
|
43
54
|
/**
|
|
44
55
|
* Whether the panel can be dismissed by clicking the overlay (overlay mode), pressing Escape,
|
|
45
56
|
* or, in overlay mode, moving focus into the main content.
|
|
@@ -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-5b75dce | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { mergeProps as mergeProps$1 } from "../../../utils/react/mergeProps.js";
|
|
4
4
|
import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
|
|
@@ -31,6 +31,10 @@ const PanelElement = tasty({
|
|
|
31
31
|
container: "panel / inline-size",
|
|
32
32
|
position: "absolute",
|
|
33
33
|
display: "flex",
|
|
34
|
+
hide: {
|
|
35
|
+
"": false,
|
|
36
|
+
hidden: true
|
|
37
|
+
},
|
|
34
38
|
flow: "column",
|
|
35
39
|
overflow: "hidden",
|
|
36
40
|
boxSizing: "border-box",
|
|
@@ -308,7 +312,7 @@ function LayoutPanel(props, ref) {
|
|
|
308
312
|
const layoutState = useLayoutStateContext();
|
|
309
313
|
const layoutRefs = useLayoutRefsContext();
|
|
310
314
|
if (!layoutActions || !layoutState || !layoutRefs) throw new Error("Layout.Panel must be used within a Layout component. Ensure your panel is rendered inside a <Layout> parent.");
|
|
311
|
-
const { side = "left", mode: modeProp, size: providedSize, defaultSize = 280, minSize = 200, maxSize, isResizable = false, onSizeChange, isOpen: providedIsOpen, defaultIsOpen = true, onOpenChange, hasTransition: hasTransitionProp, isDismissable = true, overlayStyles, isDialog = false, isDialogOpen: providedIsDialogOpen, defaultIsDialogOpen = false, onDialogOpenChange, dialogProps, dialogStyles, contentPadding, sizeStorageKey, children, styles, mods, ...otherProps } = props;
|
|
315
|
+
const { side = "left", mode: modeProp, size: providedSize, defaultSize = 280, minSize = 200, maxSize, isResizable = false, onSizeChange, isOpen: providedIsOpen, defaultIsOpen = true, onOpenChange, hasTransition: hasTransitionProp, hideOnClose = false, isDismissable = true, overlayStyles, isDialog = false, isDialogOpen: providedIsDialogOpen, defaultIsDialogOpen = false, onDialogOpenChange, dialogProps, dialogStyles, contentPadding, sizeStorageKey, children, styles, mods, ...otherProps } = props;
|
|
312
316
|
const mode = modeProp ?? (isDialog ? "dialog" : "default");
|
|
313
317
|
const isDialogMode = mode === "dialog";
|
|
314
318
|
const isOverlayMode = mode === "overlay";
|
|
@@ -585,10 +589,10 @@ function LayoutPanel(props, ref) {
|
|
|
585
589
|
onSizeChange,
|
|
586
590
|
setStoredSize
|
|
587
591
|
]);
|
|
588
|
-
const renderPanelContent = (offscreen = false, transitionRef_0) => {
|
|
592
|
+
const renderPanelContent = (offscreen = false, transitionRef_0, isHidden = !isOpen) => {
|
|
589
593
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
590
|
-
isOverlayMode && /* @__PURE__ */ jsx(OpenerProbe, { focusRef: mountFocusRef }),
|
|
591
|
-
isOverlayMode && /* @__PURE__ */ jsx(OverlayBackdrop, {
|
|
594
|
+
isOverlayMode && !isHidden && /* @__PURE__ */ jsx(OpenerProbe, { focusRef: mountFocusRef }),
|
|
595
|
+
isOverlayMode && !isHidden && /* @__PURE__ */ jsx(OverlayBackdrop, {
|
|
592
596
|
mods: { visible: isOverlayMode && !offscreen },
|
|
593
597
|
styles: overlayStyles,
|
|
594
598
|
"aria-hidden": "true",
|
|
@@ -602,7 +606,8 @@ function LayoutPanel(props, ref) {
|
|
|
602
606
|
...filterBaseProps(otherProps, { eventProps: true }),
|
|
603
607
|
mods: {
|
|
604
608
|
...panelMods,
|
|
605
|
-
offscreen
|
|
609
|
+
offscreen,
|
|
610
|
+
hidden: isHidden
|
|
606
611
|
},
|
|
607
612
|
styles: finalStyles,
|
|
608
613
|
style: panelStyle,
|
|
@@ -612,7 +617,7 @@ function LayoutPanel(props, ref) {
|
|
|
612
617
|
children: /* @__PURE__ */ jsx(LayoutContextReset, { children })
|
|
613
618
|
})
|
|
614
619
|
}),
|
|
615
|
-
isResizable && /* @__PURE__ */ jsx(ResizeHandler, {
|
|
620
|
+
isResizable && !isHidden && /* @__PURE__ */ jsx(ResizeHandler, {
|
|
616
621
|
side,
|
|
617
622
|
isDisabled: !isResizable,
|
|
618
623
|
mods: {
|
|
@@ -645,17 +650,22 @@ function LayoutPanel(props, ref) {
|
|
|
645
650
|
if (hasTransition) return createPortal(/* @__PURE__ */ jsx(DisplayTransition, {
|
|
646
651
|
isShown: isOpen,
|
|
647
652
|
animateOnMount: false,
|
|
653
|
+
exposeUnmounted: hideOnClose,
|
|
648
654
|
onToggle: (isShown) => setVisualState({
|
|
649
655
|
isShown,
|
|
650
656
|
isTransitionActive
|
|
651
657
|
}),
|
|
652
|
-
children: ({ isShown: isShown_0, isExiting, ref: transitionRef_1 }) =>
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
658
|
+
children: ({ phase, isShown: isShown_0, isExiting, ref: transitionRef_1 }) => {
|
|
659
|
+
const isHidden_0 = phase === "unmounted";
|
|
660
|
+
return /* @__PURE__ */ jsx(LayoutPanelTransition, {
|
|
661
|
+
isShown: isShown_0,
|
|
662
|
+
isExiting,
|
|
663
|
+
isHidden: isHidden_0,
|
|
664
|
+
children: renderPanelContent(!isShown_0, transitionRef_1, isHidden_0)
|
|
665
|
+
});
|
|
666
|
+
}
|
|
657
667
|
}), portalContainer);
|
|
658
|
-
if (!isOpen) return null;
|
|
668
|
+
if (!isOpen && !hideOnClose) return null;
|
|
659
669
|
return createPortal(renderPanelContent(false), portalContainer);
|
|
660
670
|
}
|
|
661
671
|
let lastReturnedFocus = null;
|