@cube-dev/ui-kit 0.0.0-canary-e75ef64 → 0.0.0-canary-f53c097
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +6 -0
- package/dist/_internal/hooks/use-debounced-value.js +1 -1
- package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
- package/dist/_internal/hooks/use-event.js +1 -1
- package/dist/_internal/hooks/use-is-first-render.js +1 -1
- package/dist/_internal/hooks/use-sync-ref.js +1 -1
- package/dist/_internal/hooks/use-timer/timer.js +1 -1
- package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
- package/dist/_internal/hooks/use-warn.js +1 -1
- package/dist/components/Block.js +1 -1
- package/dist/components/CollectionItem.js +1 -1
- package/dist/components/GlobalStyles.js +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/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/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 +2 -1
- 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.js +36 -16
- package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
- package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
- package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
- package/dist/components/content/Layout/LayoutToolbar.js +1 -1
- package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
- package/dist/components/content/Layout/index.js +1 -1
- package/dist/components/content/Layout/utils.js +1 -1
- package/dist/components/content/Paragraph.js +1 -1
- package/dist/components/content/Placeholder/Placeholder.js +1 -1
- package/dist/components/content/PrismCode/PrismCode.js +1 -1
- package/dist/components/content/PrismCode/prismSetup.js +1 -1
- package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
- package/dist/components/content/Result/Result.js +1 -1
- package/dist/components/content/Skeleton/Skeleton.js +1 -1
- package/dist/components/content/Tag/Tag.js +1 -1
- package/dist/components/content/Text.js +1 -1
- package/dist/components/content/TextItem/TextItem.js +1 -1
- package/dist/components/content/Title.js +1 -1
- package/dist/components/content/Tree/Tree.js +1 -1
- package/dist/components/content/Tree/TreeNode.js +1 -1
- package/dist/components/content/Tree/styled.js +1 -1
- package/dist/components/content/Tree/tree-index.js +1 -1
- package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
- package/dist/components/content/Tree/use-load-data.js +1 -1
- package/dist/components/content/highlightText.js +1 -1
- package/dist/components/content/use-auto-tooltip.js +1 -1
- package/dist/components/data/DataTable/DataTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTable.js +1 -1
- package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
- package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
- package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
- package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
- package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
- package/dist/components/data/TableBase/ColumnResizer.js +1 -1
- package/dist/components/data/TableBase/RowCollection.js +1 -1
- package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
- package/dist/components/data/TableBase/TableRow.js +1 -1
- package/dist/components/data/TableBase/TableView.js +1 -1
- package/dist/components/data/TableBase/TreeGridTable.js +1 -1
- package/dist/components/data/TableBase/column-header.js +1 -1
- package/dist/components/data/TableBase/column-menu.js +1 -1
- package/dist/components/data/TableBase/column-styles.js +1 -1
- package/dist/components/data/TableBase/column-tint.js +1 -1
- package/dist/components/data/TableBase/row-menu.js +1 -1
- package/dist/components/data/TableBase/styled.js +1 -1
- package/dist/components/data/TableBase/table-tree.js +1 -1
- package/dist/components/data/TableBase/types.js +1 -1
- package/dist/components/data/TableBase/use-cell-selection.js +0 -0
- package/dist/components/data/TableBase/use-column-menu.js +1 -1
- package/dist/components/data/TableBase/use-column-order.js +1 -1
- package/dist/components/data/TableBase/use-container-width.js +1 -1
- package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
- package/dist/components/data/TableBase/use-scrollability.js +1 -1
- package/dist/components/data/TableBase/use-table-columns.js +1 -1
- package/dist/components/data/TableBase/use-table-search.js +1 -1
- package/dist/components/data/TableBase/use-table-selection.js +1 -1
- package/dist/components/data/TableBase/use-table-sort.js +1 -1
- package/dist/components/data/TableBase/use-table-sorts.js +1 -1
- package/dist/components/data/TableBase/use-table-storage.js +1 -1
- package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
- package/dist/components/fields/Checkbox/Checkbox.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/CommandTextArea/CommandTextArea.js +1 -1
- package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
- package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
- package/dist/components/fields/DatePicker/DateInput.js +1 -1
- package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
- package/dist/components/fields/DatePicker/DatePicker.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
- package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
- package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
- package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
- package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
- package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
- package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
- package/dist/components/fields/DatePicker/TimeInput.js +1 -1
- package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
- package/dist/components/fields/DatePicker/YearPicker.js +1 -1
- package/dist/components/fields/DatePicker/parseDate.js +1 -1
- package/dist/components/fields/DatePicker/period.js +1 -1
- package/dist/components/fields/DatePicker/props.js +1 -1
- package/dist/components/fields/DatePicker/utils.js +1 -1
- package/dist/components/fields/FileInput/FileInput.js +1 -1
- package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
- package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
- package/dist/components/fields/Input/Input.js +1 -1
- package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
- package/dist/components/fields/ListBox/ListBox.js +1 -1
- package/dist/components/fields/ListBox/optionId.js +1 -1
- package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +1 -1
- package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
- package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
- package/dist/components/fields/NumberInput/NumberInput.js +1 -1
- package/dist/components/fields/NumberInput/StepButton.js +1 -1
- package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/fields/Picker/Picker.js +1 -1
- package/dist/components/fields/RadioGroup/Radio.js +1 -1
- package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/fields/RadioGroup/context.js +1 -1
- package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
- package/dist/components/fields/SearchInput/SearchInput.js +1 -1
- package/dist/components/fields/Select/Select.js +1 -1
- package/dist/components/fields/Slider/Gradation.js +1 -1
- package/dist/components/fields/Slider/HueSlider.js +1 -1
- package/dist/components/fields/Slider/RangeSlider.js +1 -1
- package/dist/components/fields/Slider/Slider.js +1 -1
- package/dist/components/fields/Slider/SliderBase.js +1 -1
- package/dist/components/fields/Slider/SliderThumb.js +1 -1
- package/dist/components/fields/Slider/SliderTrack.js +1 -1
- package/dist/components/fields/Slider/elements.js +1 -1
- package/dist/components/fields/Slider/index.js +1 -1
- package/dist/components/fields/Switch/Switch.js +1 -1
- package/dist/components/fields/TagInput/TagInput.js +1 -1
- package/dist/components/fields/TagInput/TagList.js +1 -1
- package/dist/components/fields/TagInput/useActiveOption.js +1 -1
- package/dist/components/fields/TagInput/useTagError.js +1 -1
- package/dist/components/fields/TextArea/TextArea.js +1 -1
- package/dist/components/fields/TextInput/TextInput.js +1 -1
- package/dist/components/fields/TextInput/TextInputBase.js +1 -1
- package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
- package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
- package/dist/components/fields/TriggerActions.js +1 -1
- package/dist/components/fields/color/ColorPanel.js +1 -1
- package/dist/components/fields/color/channels.js +1 -1
- package/dist/components/fields/color/color.js +1 -1
- package/dist/components/fields/color/context.js +1 -1
- package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
- package/dist/components/form/Form/Field.js +1 -1
- package/dist/components/form/Form/Form.js +1 -1
- package/dist/components/form/Form/ModernFormRoot.js +1 -1
- package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
- package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
- package/dist/components/form/Form/SubmitError.js +1 -1
- package/dist/components/form/Form/backend.js +1 -1
- package/dist/components/form/Form/index.js +1 -1
- package/dist/components/form/Form/modern/actions.js +1 -1
- package/dist/components/form/Form/modern/context.js +1 -1
- package/dist/components/form/Form/modern/controller.js +1 -1
- package/dist/components/form/Form/modern/field-binding.js +1 -1
- package/dist/components/form/Form/modern/field.js +1 -1
- package/dist/components/form/Form/modern/react.js +1 -1
- package/dist/components/form/Form/modern/store.js +1 -1
- package/dist/components/form/Form/modern/validation.js +1 -1
- package/dist/components/form/Form/modern/values.js +1 -1
- package/dist/components/form/Form/reset-unbound-controls.js +1 -1
- package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
- package/dist/components/form/Form/use-field/use-field-props.js +1 -1
- package/dist/components/form/Form/use-field/use-field.js +1 -1
- package/dist/components/form/Form/use-form.js +1 -1
- package/dist/components/form/Form/validation.js +1 -1
- package/dist/components/form/Label.js +1 -1
- package/dist/components/form/legacy-tooltip.js +1 -1
- package/dist/components/form/validation/ValidationIndicator.js +1 -1
- package/dist/components/form/validation/resolve-validation-props.js +1 -1
- package/dist/components/form/validation/use-validation-props.js +1 -1
- package/dist/components/form/wrapper.js +1 -1
- package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
- package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
- package/dist/components/layout/Board/Board.js +1 -1
- package/dist/components/layout/Board/BoardProvider.js +1 -1
- package/dist/components/layout/Board/BoardResponsive.js +1 -1
- package/dist/components/layout/Board/Widget.js +1 -1
- package/dist/components/layout/Board/WidgetHost.js +1 -1
- package/dist/components/layout/Board/board-context.js +1 -1
- package/dist/components/layout/Board/board-store.js +1 -1
- package/dist/components/layout/Board/grid-core/calculate.js +1 -1
- package/dist/components/layout/Board/grid-core/collision-modes.js +1 -1
- package/dist/components/layout/Board/grid-core/collision.js +1 -1
- package/dist/components/layout/Board/grid-core/compactors.js +1 -1
- package/dist/components/layout/Board/grid-core/constraints.js +1 -1
- package/dist/components/layout/Board/grid-core/group-move.js +1 -1
- package/dist/components/layout/Board/grid-core/layout.js +1 -1
- package/dist/components/layout/Board/grid-core/placement.js +1 -1
- package/dist/components/layout/Board/grid-core/sort.js +1 -1
- package/dist/components/layout/Board/index.js +1 -1
- package/dist/components/layout/Board/responsive-utils.js +1 -1
- package/dist/components/layout/Board/use-board-layout.js +1 -1
- package/dist/components/layout/Board/use-board-registry.js +1 -1
- package/dist/components/layout/Board/use-board-select-modifier-key.js +1 -1
- package/dist/components/layout/Board/use-board-selection.js +1 -1
- package/dist/components/layout/Flex.js +1 -1
- package/dist/components/layout/Flow.js +1 -1
- package/dist/components/layout/Grid.js +1 -1
- package/dist/components/layout/Panel.js +1 -1
- package/dist/components/layout/Prefix.js +1 -1
- package/dist/components/layout/ResizablePanel.js +1 -1
- package/dist/components/layout/Space.js +1 -1
- package/dist/components/layout/Suffix.js +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +1 -1
- package/dist/components/navigation/Pagination/use-pagination.js +1 -1
- package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
- package/dist/components/navigation/Tabs/TabButton.js +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/Modal/Modal.js +1 -1
- package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
- package/dist/components/overlays/Modal/Overlay.js +1 -1
- package/dist/components/overlays/Modal/Popover.js +1 -1
- package/dist/components/overlays/Modal/Tray.js +1 -1
- package/dist/components/overlays/Modal/Underlay.js +1 -1
- package/dist/components/overlays/Notifications/Notification.js +1 -1
- package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
- package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
- package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
- package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
- package/dist/components/overlays/Notifications/OverlayContainer.js +1 -1
- package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
- package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
- package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
- package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
- package/dist/components/overlays/Notifications/index.js +1 -1
- package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
- package/dist/components/overlays/Notifications/use-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
- package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
- package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
- package/dist/components/overlays/Toast/ToastItem.js +1 -1
- package/dist/components/overlays/Toast/index.js +1 -1
- package/dist/components/overlays/Toast/useProgressToast.js +1 -1
- package/dist/components/overlays/Toast/useToast.js +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
- package/dist/components/overlays/Tooltip/TooltipTrigger.js +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/useFormatter.js +1 -1
- package/dist/i18n/useI18n.js +1 -1
- package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
- package/dist/icons/AdjustmentsIcon.js +1 -1
- package/dist/icons/AiIcon.js +1 -1
- package/dist/icons/AreaChartIcon.js +1 -1
- package/dist/icons/ArrowNarrowDownIcon.js +1 -1
- package/dist/icons/ArrowNarrowUpIcon.js +1 -1
- package/dist/icons/BackwardIcon.js +1 -1
- package/dist/icons/BarChartIcon.js +1 -1
- package/dist/icons/BellFilledIcon.js +1 -1
- package/dist/icons/BellIcon.js +1 -1
- package/dist/icons/BooleanIcon.js +1 -1
- package/dist/icons/CalendarEditIcon.js +1 -1
- package/dist/icons/CalendarIcon.js +1 -1
- package/dist/icons/CaretDownIcon.js +1 -1
- package/dist/icons/CaretUpIcon.js +1 -1
- package/dist/icons/ChartAreaStackedIcon.js +1 -1
- package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarGroupedIcon.js +1 -1
- package/dist/icons/ChartBarHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarLineIcon.js +1 -1
- package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
- package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
- package/dist/icons/ChartBoxPlot2Icon.js +1 -1
- package/dist/icons/ChartBoxPlotIcon.js +1 -1
- package/dist/icons/ChartBubbleIcon.js +1 -1
- package/dist/icons/ChartDonut2Icon.js +1 -1
- package/dist/icons/ChartFunnelIcon.js +1 -1
- package/dist/icons/ChartHeatmapIcon.js +1 -1
- package/dist/icons/ChartKPIIcon.js +1 -1
- package/dist/icons/ChartPie2Icon.js +1 -1
- package/dist/icons/ChartScatterIcon.js +1 -1
- package/dist/icons/CheckCircleFilledIcon.js +1 -1
- package/dist/icons/CheckCircleIcon.js +1 -1
- package/dist/icons/CheckIcon.js +1 -1
- package/dist/icons/CircleFilledIcon.js +1 -1
- package/dist/icons/ClearIcon.js +1 -1
- package/dist/icons/CloseCircleFilledIcon.js +1 -1
- package/dist/icons/CloseCircleIcon.js +1 -1
- package/dist/icons/CloseIcon.js +1 -1
- package/dist/icons/CodeIcon.js +1 -1
- package/dist/icons/ColumnTotalIcon.js +1 -1
- package/dist/icons/CopyIcon.js +1 -1
- package/dist/icons/CountIcon.js +1 -1
- package/dist/icons/CubeIcon.js +1 -1
- package/dist/icons/CubePauseIcon.js +1 -1
- package/dist/icons/CubePlayIcon.js +1 -1
- package/dist/icons/CurrencyDollarIcon.js +1 -1
- package/dist/icons/DangerIcon.js +1 -1
- package/dist/icons/DashboardIcon.js +1 -1
- package/dist/icons/DatabaseIcon.js +1 -1
- package/dist/icons/DecimalDecreaseIcon.js +1 -1
- package/dist/icons/DecimalIncreaseIcon.js +1 -1
- package/dist/icons/DirectionIcon.js +1 -1
- package/dist/icons/DonutIcon.js +1 -1
- package/dist/icons/DownIcon.js +1 -1
- package/dist/icons/EditIcon.js +1 -1
- package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
- package/dist/icons/ExclamationCircleIcon.js +1 -1
- package/dist/icons/ExclamationIcon.js +1 -1
- package/dist/icons/EyeIcon.js +1 -1
- package/dist/icons/EyeInvisibleIcon.js +1 -1
- package/dist/icons/FilterIcon.js +1 -1
- package/dist/icons/FolderFilledIcon.js +1 -1
- package/dist/icons/FolderIcon.js +1 -1
- package/dist/icons/FolderOpenFilledIcon.js +1 -1
- package/dist/icons/FolderOpenIcon.js +1 -1
- package/dist/icons/ForwardIcon.js +1 -1
- package/dist/icons/GripVerticalIcon.js +1 -1
- package/dist/icons/HierarchyIcon.js +1 -1
- package/dist/icons/HierarchyOpenIcon.js +1 -1
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/InfoCircleIcon.js +1 -1
- package/dist/icons/InfoIcon.js +1 -1
- package/dist/icons/KeyIcon.js +1 -1
- package/dist/icons/LeftIcon.js +1 -1
- package/dist/icons/LineChartIcon.js +1 -1
- package/dist/icons/LoadingIcon.js +1 -1
- package/dist/icons/LockFilledIcon.js +1 -1
- package/dist/icons/LockIcon.js +1 -1
- package/dist/icons/MoreIcon.js +1 -1
- package/dist/icons/NotAllowedIcon.js +1 -1
- package/dist/icons/Number123Icon.js +1 -1
- package/dist/icons/NumberIcon.js +1 -1
- package/dist/icons/PauseCircleFilledIcon.js +1 -1
- package/dist/icons/PauseCircleIcon.js +1 -1
- package/dist/icons/PauseIcon.js +1 -1
- package/dist/icons/PercentageIcon.js +1 -1
- package/dist/icons/PieChartIcon.js +1 -1
- package/dist/icons/PipetteIcon.js +1 -1
- package/dist/icons/PlayCircleIcon.js +1 -1
- package/dist/icons/PlayIcon.js +1 -1
- package/dist/icons/PlusIcon.js +1 -1
- package/dist/icons/ProgressBarIcon.js +1 -1
- package/dist/icons/ReloadIcon.js +1 -1
- package/dist/icons/ReportIcon.js +1 -1
- package/dist/icons/ReturnIcon.js +1 -1
- package/dist/icons/RightIcon.js +1 -1
- package/dist/icons/RowTotalsIcon.js +1 -1
- package/dist/icons/SchemeIcon.js +1 -1
- package/dist/icons/SearchIcon.js +1 -1
- package/dist/icons/SemanticQueryIcon.js +1 -1
- package/dist/icons/SettingsIcon.js +1 -1
- package/dist/icons/ShieldFilledIcon.js +1 -1
- package/dist/icons/ShieldIcon.js +1 -1
- package/dist/icons/SlashIcon.js +1 -1
- package/dist/icons/SparklesIcon.js +1 -1
- package/dist/icons/SqlIcon.js +1 -1
- package/dist/icons/StatsIcon.js +1 -1
- package/dist/icons/StopIcon.js +1 -1
- package/dist/icons/StringIcon.js +1 -1
- package/dist/icons/SubtotalsIcon.js +1 -1
- package/dist/icons/SwitchIcon.js +1 -1
- package/dist/icons/TableIcon.js +1 -1
- package/dist/icons/ThumbsDownIcon.js +1 -1
- package/dist/icons/ThumbsUpIcon.js +1 -1
- package/dist/icons/ThunderboltCrossedIcon.js +1 -1
- package/dist/icons/ThunderboltFilledIcon.js +1 -1
- package/dist/icons/ThunderboltIcon.js +1 -1
- package/dist/icons/TimeIcon.js +1 -1
- package/dist/icons/TrashIcon.js +1 -1
- package/dist/icons/UnlockIcon.js +1 -1
- package/dist/icons/UpIcon.js +1 -1
- package/dist/icons/UserGroupIcon.js +1 -1
- package/dist/icons/UserIcon.js +1 -1
- package/dist/icons/UserLockIcon.js +1 -1
- package/dist/icons/ViewIcon.js +1 -1
- package/dist/icons/WarningFilledIcon.js +1 -1
- package/dist/icons/WarningIcon.js +1 -1
- package/dist/icons/wrap-icon.js +1 -1
- package/dist/index.js +1 -1
- package/dist/probe/canonicalize.js +1 -1
- package/dist/probe/css.js +1 -1
- package/dist/probe/index.js +1 -1
- package/dist/provider.js +1 -1
- package/dist/providers/TrackingProvider.js +1 -1
- package/dist/providers/navigationAdapter.default.js +1 -1
- package/dist/tokens/all-tokens.js +1 -1
- package/dist/tokens/base.js +1 -1
- package/dist/tokens/color-seed.js +1 -1
- package/dist/tokens/color-theme.js +1 -1
- package/dist/tokens/colors.js +1 -1
- package/dist/tokens/layout.js +1 -1
- package/dist/tokens/lazy-styles.js +1 -1
- package/dist/tokens/legacy-color.js +1 -1
- package/dist/tokens/palette-config.js +1 -1
- package/dist/tokens/palette.js +1 -1
- package/dist/tokens/resolve.js +1 -1
- package/dist/tokens/shadows.js +1 -1
- package/dist/tokens/sizes.js +1 -1
- package/dist/tokens/spacing.js +1 -1
- package/dist/tokens/typography.js +1 -1
- package/dist/utils/ResizeSensor.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/dotize.js +1 -1
- package/dist/utils/is-dev-env.js +1 -1
- package/dist/utils/modules.js +1 -1
- package/dist/utils/promise.js +1 -1
- package/dist/utils/raf.js +1 -1
- package/dist/utils/random.js +1 -1
- package/dist/utils/range.js +1 -1
- package/dist/utils/react/RenderCache.js +1 -1
- package/dist/utils/react/Slots.js +1 -1
- package/dist/utils/react/chain.js +1 -1
- package/dist/utils/react/disabledProps.js +1 -1
- package/dist/utils/react/escapePropagation.js +1 -1
- package/dist/utils/react/forwardRefWithGenerics.js +1 -1
- package/dist/utils/react/index.js +1 -1
- package/dist/utils/react/interactions.js +1 -1
- package/dist/utils/react/isTextOnly.js +1 -1
- package/dist/utils/react/mapProps.js +1 -1
- package/dist/utils/react/mergeProps.js +1 -1
- package/dist/utils/react/nullableValue.js +1 -1
- package/dist/utils/react/programmaticFocus.js +1 -1
- package/dist/utils/react/resolveIcon.js +1 -1
- package/dist/utils/react/sharedStore.js +1 -1
- package/dist/utils/react/useBufferedValue.js +1 -1
- package/dist/utils/react/useCombinedRefs.js +1 -1
- package/dist/utils/react/useControlledFocusVisible.js +1 -1
- package/dist/utils/react/useEventBus.js +1 -1
- package/dist/utils/react/useId.js +1 -1
- package/dist/utils/react/useIsDarwin.js +1 -1
- package/dist/utils/react/useKeySymbols.js +1 -1
- package/dist/utils/react/useLayoutEffect.js +1 -1
- package/dist/utils/react/useLocalStorage.js +1 -1
- package/dist/utils/react/useMergeStyles.js +1 -1
- package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
- package/dist/utils/react/usePopoverSync.js +1 -1
- package/dist/utils/react/useQaProps.js +1 -1
- package/dist/utils/react/useScheme.js +1 -1
- package/dist/utils/react/useViewportSize.js +1 -1
- package/dist/utils/react/wrapNodeIfPlain.js +1 -1
- package/dist/utils/selection.js +1 -1
- package/dist/utils/styles.js +1 -1
- package/dist/utils/tree.js +1 -1
- package/dist/utils/warnings.js +1 -1
- package/dist/version.js +2 -2
- package/docs/components/content/Layout.md +2 -0
- package/docs/components/overlays/DialogTrigger.md +1 -1
- package/package.json +1 -1
|
@@ -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","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","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","relatedTarget","Node","contains","handleKeyDown","key","preventDefault","stopPropagation","eventProps","undefined","setPanelContainer","Layout","_c","t0","t1","_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 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 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 // Check if focus is coming from outside the Inner element\n const inner = e.currentTarget;\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\n return (\n <LayoutProvider\n hasTransition={hasTransition}\n minContentSize={minContentSize}\n >\n <LayoutInner {...props} forwardedRef={ref} />\n </LayoutProvider>\n );\n}\n\nconst _Layout = forwardRef(Layout);\n\n_Layout.displayName = 'Layout';\n\nexport { _Layout as Layout };\n"],"mappings":";;;;;;;;;;;;;AA2CA,MAAMkC,gBAAgBvB,MAAM;CAC1BwB,IAAI;CACJC,IAAI;CACJC,QAAQ;EACNC,UAAU;EACVC,SAAS;EACTC,UAAU;GACR,IAAI;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IACe;AAAApG,IAAA,KAAAe;AAAAf,IAAA,KAAAgB;AAAAhB,IAAA,KAAAoG;AAAApG,IAAA,KAAAqG;OAAAA,MAAArG,EAAA;AAAA,QALjBqG;;AASJ,MAAMC,UAAUtI,WAAWkI,OAAO;AAElCI,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","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","relatedTarget","Node","contains","handleKeyDown","key","preventDefault","stopPropagation","eventProps","undefined","setPanelContainer","Layout","_c","t0","t1","_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 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 // Check if focus is coming from outside the Inner element\n const inner = e.currentTarget;\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\n return (\n <LayoutProvider\n hasTransition={hasTransition}\n minContentSize={minContentSize}\n >\n <LayoutInner {...props} forwardedRef={ref} />\n </LayoutProvider>\n );\n}\n\nconst _Layout = forwardRef(Layout);\n\n_Layout.displayName = 'Layout';\n\nexport { _Layout as Layout };\n"],"mappings":";;;;;;;;;;;;;AA2CA,MAAMkC,gBAAgBvB,MAAM;CAC1BwB,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;CACR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AAgBK;;GAG9C,oBAAC;IACC,KAAK5D;IACL,gBAAa;IACb,SAASgD;IACT,GAAIjE;IAEHH;KACE;GAEL,oBAAC;IAAI,KAAKW,YAAYsE;IAAmB,gBAAa;KAAgB;GAMrEd,iBACC,qBAAC;IAAM,OAAM;IAAS,QAAQ7E;;KAC5B,oBAAC,iBAAE,WAAU;;KAAC,oBAAC,iBAAE,cAAmB;;KAAkB,oBAAC,iBAAE,MAAK;;KACF;KAC5D,oBAAC,iBAAE,WAAU;;KAAS,oBAAC,iBAAE,cAAmB;;;KACtC,GACN;;GACU;;;;;;AAQpB,SAAA4F,OAAA3E,OAAAe,KAAA;CAAA,MAAAvC,IAAAoG,EAAA,EAAA;CACE,MAAA,EAAArF,eAAAC,mBAA0CQ;CAAM,IAAA6E;AAAA,KAAArG,EAAA,OAAAwB,SAAAxB,EAAA,OAAAuC,KAAA;AAO5C8D,OAAA,oBAAC;GAAW,GAAK7E;GAAqBe,cAAAA;IAAO;AAAAvC,IAAA,KAAAwB;AAAAxB,IAAA,KAAAuC;AAAAvC,IAAA,KAAAqG;OAAAA,MAAArG,EAAA;CAAA,IAAAsG;AAAA,KAAAtG,EAAA,OAAAe,iBAAAf,EAAA,OAAAgB,kBAAAhB,EAAA,OAAAqG,IAAA;AAJ/CC,OAAA,oBAAC;GACgBvF;GACCC;aAEhBqF;IACe;AAAArG,IAAA,KAAAe;AAAAf,IAAA,KAAAgB;AAAAhB,IAAA,KAAAqG;AAAArG,IAAA,KAAAsG;OAAAA,MAAAtG,EAAA;AAAA,QALjBsG;;AASJ,MAAMC,UAAUvI,WAAWmI,OAAO;AAElCI,QAAQC,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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-f53c097 | 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";
|
|
@@ -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-f53c097 | 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";
|
|
@@ -302,6 +302,9 @@ function ResizeHandler(props) {
|
|
|
302
302
|
} else t4 = $[18];
|
|
303
303
|
return t4;
|
|
304
304
|
}
|
|
305
|
+
function matchesContainerSize(container, isHorizontal, dimension) {
|
|
306
|
+
return (isHorizontal ? container?.offsetWidth : container?.offsetHeight) === dimension;
|
|
307
|
+
}
|
|
305
308
|
function LayoutPanel(props, ref) {
|
|
306
309
|
const layoutActions = useLayoutActionsContext();
|
|
307
310
|
const layoutState = useLayoutStateContext();
|
|
@@ -321,7 +324,8 @@ function LayoutPanel(props, ref) {
|
|
|
321
324
|
const oppositeSide = getOppositeSide(side);
|
|
322
325
|
const oppositePanelSize = layoutState.panelSizes[oppositeSide];
|
|
323
326
|
const ownInsetOffset = isResizable ? RESIZABLE_INSET_OFFSET : 0;
|
|
324
|
-
const naturalMax = useMemo(() => containerDimension > 0 ? Math.max(0, containerDimension - oppositePanelSize - minContentSize - ownInsetOffset) : Infinity, [
|
|
327
|
+
const naturalMax = useMemo(() => !isDialogMode && containerDimension > 0 ? Math.max(0, containerDimension - oppositePanelSize - minContentSize - ownInsetOffset) : Infinity, [
|
|
328
|
+
isDialogMode,
|
|
325
329
|
containerDimension,
|
|
326
330
|
oppositePanelSize,
|
|
327
331
|
minContentSize,
|
|
@@ -354,8 +358,12 @@ function LayoutPanel(props, ref) {
|
|
|
354
358
|
]);
|
|
355
359
|
const resolvedMax = useMemo(() => {
|
|
356
360
|
if (typeof maxSize === "number") return maxSize;
|
|
357
|
-
if (typeof maxSize === "string" && containerDimension > 0) return resolveCssSize(maxSize, containerDimension);
|
|
358
|
-
}, [
|
|
361
|
+
if (typeof maxSize === "string" && containerDimension > 0 && (!isDialogMode || !maxSize.trim().endsWith("%"))) return resolveCssSize(maxSize, containerDimension);
|
|
362
|
+
}, [
|
|
363
|
+
maxSize,
|
|
364
|
+
containerDimension,
|
|
365
|
+
isDialogMode
|
|
366
|
+
]);
|
|
359
367
|
const effectiveMax = useMemo(() => {
|
|
360
368
|
const values = [];
|
|
361
369
|
if (resolvedMax != null) values.push(resolvedMax);
|
|
@@ -366,12 +374,12 @@ function LayoutPanel(props, ref) {
|
|
|
366
374
|
const setContextDragging = layoutActions.setDragging;
|
|
367
375
|
const { moveProps } = useMove({
|
|
368
376
|
onMoveStart() {
|
|
369
|
-
if (!isResizable) return;
|
|
377
|
+
if (!isResizable || isDialogMode) return;
|
|
370
378
|
setIsDragging(true);
|
|
371
379
|
setContextDragging(true);
|
|
372
380
|
},
|
|
373
381
|
onMove(e) {
|
|
374
|
-
if (!isResizable) return;
|
|
382
|
+
if (!isResizable || isDialogMode) return;
|
|
375
383
|
let delta;
|
|
376
384
|
if (e.pointerType === "keyboard") {
|
|
377
385
|
const step = e.shiftKey ? 50 : 10;
|
|
@@ -384,6 +392,7 @@ function LayoutPanel(props, ref) {
|
|
|
384
392
|
onMoveEnd() {
|
|
385
393
|
setIsDragging(false);
|
|
386
394
|
setContextDragging(false);
|
|
395
|
+
if (isDialogMode && !isDragging) return;
|
|
387
396
|
setSize((currentSize_0) => {
|
|
388
397
|
const finalSize = Math.round(clampValue(currentSize_0));
|
|
389
398
|
onSizeChange?.(finalSize);
|
|
@@ -394,27 +403,38 @@ function LayoutPanel(props, ref) {
|
|
|
394
403
|
});
|
|
395
404
|
useEffect(() => {
|
|
396
405
|
if (prevProvidedSizeRef.current !== providedSize) {
|
|
406
|
+
if (!isDialogMode && !matchesContainerSize(layoutRefs.panelContainerRef.current?.parentElement, isHorizontal, containerDimension)) return;
|
|
397
407
|
prevProvidedSizeRef.current = providedSize;
|
|
398
408
|
if (typeof providedSize === "number" && !isDragging) setSize(clampValue(providedSize));
|
|
399
409
|
}
|
|
400
410
|
}, [
|
|
401
411
|
providedSize,
|
|
402
412
|
isDragging,
|
|
403
|
-
clampValue
|
|
413
|
+
clampValue,
|
|
414
|
+
isDialogMode,
|
|
415
|
+
isHorizontal,
|
|
416
|
+
containerDimension,
|
|
417
|
+
layoutRefs.panelContainerRef
|
|
404
418
|
]);
|
|
405
419
|
useEffect(() => {
|
|
406
|
-
if (!isDragging && containerDimension > 0)
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
420
|
+
if (!isDialogMode && !isDragging && containerDimension > 0) {
|
|
421
|
+
if (!matchesContainerSize(layoutRefs.panelContainerRef.current?.parentElement, isHorizontal, containerDimension)) return;
|
|
422
|
+
setSize((prev) => {
|
|
423
|
+
const clamped = clampValue(prev);
|
|
424
|
+
if (clamped !== prev) {
|
|
425
|
+
onSizeChange?.(Math.round(clamped));
|
|
426
|
+
setStoredSize(Math.round(clamped));
|
|
427
|
+
}
|
|
428
|
+
return clamped;
|
|
429
|
+
});
|
|
430
|
+
}
|
|
414
431
|
}, [
|
|
432
|
+
isDialogMode,
|
|
415
433
|
isDragging,
|
|
416
434
|
clampValue,
|
|
417
|
-
containerDimension
|
|
435
|
+
containerDimension,
|
|
436
|
+
isHorizontal,
|
|
437
|
+
layoutRefs.panelContainerRef
|
|
418
438
|
]);
|
|
419
439
|
const effectivePanelSize = isPanelShown && mode === "default" ? size : 0;
|
|
420
440
|
const effectiveInsetSize = Math.round(effectivePanelSize + (isResizable && effectivePanelSize > 0 ? RESIZABLE_INSET_OFFSET : 0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutPanel.js","names":["BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","mergeStyles","Styles","tasty","ForwardedRef","forwardRef","HTMLAttributes","ReactNode","RefCallback","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFocusRing","useHover","useMove","createPortal","useDebouncedValue","mergeProps","useCombinedRefs","useLocalStorage","extractStyles","DisplayTransition","Dialog","CubeDialogContainerProps","DialogContainer","LayoutContextReset","LayoutPanelContext","Side","useLayoutActionsContext","useLayoutRefsContext","useLayoutStateContext","LayoutPanelTransition","clampSize","getOppositeSide","resolveCssSize","HANDLER_WIDTH","HANDLER_OFFSET","RESIZABLE_INSET_OFFSET","PanelElement","as","qa","styles","container","position","display","flow","overflow","boxSizing","top","right","bottom","left","width","height","border","fill","transform","transition","ResizeHandlerElement","horizontal","cursor","disabled","touchAction","padding","outline","Track","inset","outlineOffset","Drag","gap","gridColumns","gridRows","DragPart","radius","OverlayBackdrop","backdropFilter","opacity","visible","pointerEvents","ResizeHandlerProps","side","isDisabled","mods","Record","moveProps","ReturnType","style","onDoubleClick","ResizeHandler","props","$","_c","t0","Symbol","for","hoverProps","isHovered","focusProps","isFocusVisible","isHorizontal","localIsHovered","t1","hovered","focused","tabIndex","undefined","role","t2","t3","t4","LayoutPanelMode","CubeLayoutPanelProps","mode","size","defaultSize","minSize","maxSize","isResizable","onSizeChange","isOpen","defaultIsOpen","onOpenChange","hasTransition","isDismissable","overlayStyles","isDialog","isDialogOpen","defaultIsDialogOpen","onDialogOpenChange","dialogProps","Omit","contentPadding","sizeStorageKey","children","LayoutPanel","ref","HTMLDivElement","layoutActions","layoutState","layoutRefs","Error","modeProp","providedSize","providedIsOpen","hasTransitionProp","providedIsDialogOpen","otherProps","isDialogMode","isOverlayMode","isStickyMode","combinedRef","prevProvidedSizeRef","containerWidth","containerHeight","minContentSize","containerDimension","oppositeSide","oppositePanelSize","panelSizes","ownInsetOffset","naturalMax","Math","max","Infinity","internalIsOpen","setInternalIsOpen","isTransitionActive","isPanelContainerReady","visualState","setVisualState","isShown","isPanelShown","internalIsDialogOpen","setInternalIsDialogOpen","dialogOpen","storedSize","setStoredSize","isDragging","setIsDragging","setSize","initialSize","extractedStyles","finalStyles","resolvedMax","effectiveMax","values","push","Number","isFinite","length","min","clampValue","value","setContextDragging","setDragging","onMoveStart","onMove","e","delta","pointerType","step","shiftKey","rawDelta","deltaX","deltaY","direction","currentSize","onMoveEnd","finalSize","round","current","prev","clamped","effectivePanelSize","effectiveInsetSize","registerPanel","unregisterPanel","updatePanelSize","isReady","lastSizeRef","handleOpenChange","newIsOpen","handleDismiss","registerOverlayPanel","unregister","handleDialogOpenChange","panelContextValue","dialogPanelContextValue","panelMods","drag","maxSizeCss","parts","join","panelStyle","panelRefCallback","node","transitionRef","HTMLElement","handleResetSize","resetSize","parseInt","clampedSize","renderPanelContent","offscreen","showOverlay","eventProps","portalContainer","panelContainerRef","isExiting","_LayoutPanel","displayName"],"sources":["../../../../src/components/content/Layout/LayoutPanel.tsx"],"sourcesContent":["import {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n mergeStyles,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefCallback,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFocusRing, useHover, useMove } from 'react-aria';\nimport { createPortal } from 'react-dom';\n\nimport { useDebouncedValue } from '../../../_internal/hooks';\nimport {\n mergeProps,\n useCombinedRefs,\n useLocalStorage,\n} from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { DisplayTransition } from '../../helpers/DisplayTransition/DisplayTransition';\nimport { Dialog } from '../../overlays/Dialog';\nimport {\n CubeDialogContainerProps,\n DialogContainer,\n} from '../../overlays/Dialog/DialogContainer';\n\nimport {\n LayoutContextReset,\n LayoutPanelContext,\n Side,\n useLayoutActionsContext,\n useLayoutRefsContext,\n useLayoutStateContext,\n} from './LayoutContext';\nimport { LayoutPanelTransition } from './LayoutPanelTransition';\nimport { clampSize, getOppositeSide, resolveCssSize } from './utils';\n\n// Resize handler dimensions\nconst HANDLER_WIDTH = 9;\n// How far from panel edge to position handler's inner edge (centers the 3px track on the edge)\nconst HANDLER_OFFSET = 4;\n// Extra inset added for resizable panels (to accommodate handler grab area)\nconst RESIZABLE_INSET_OFFSET = 2;\n\nconst PanelElement = tasty({\n as: 'div',\n qa: 'LayoutPanel',\n styles: {\n container: 'panel / inline-size',\n position: 'absolute',\n display: 'flex',\n flow: 'column',\n overflow: 'hidden',\n boxSizing: 'border-box',\n\n '$content-padding': '1x',\n // Auto-border size for sub-components (panels are always vertical)\n '$layout-border-size': '1bw',\n\n // Position based on side prop\n top: {\n '': 0,\n 'side=bottom': 'initial',\n },\n right: {\n '': 0,\n 'side=left': 'initial',\n },\n bottom: {\n '': 0,\n 'side=top': 'initial',\n },\n left: {\n '': 0,\n 'side=right': 'initial',\n },\n\n // Size handling with CSS-level min/max clamping\n width: {\n '': '$min-size $panel-size $max-size',\n 'side=top | side=bottom': '100%',\n },\n height: {\n '': '100%',\n 'side=top | side=bottom': '$min-size $panel-size $max-size',\n },\n\n // Visual styling\n border: {\n '': false,\n 'side=left': 'right',\n 'side=right': 'left',\n 'side=top': 'bottom',\n 'side=bottom': 'top',\n },\n fill: '#surface',\n\n // Transition styles - offscreen mod controls slide animation\n transform: {\n '': 'translateX(0) translateY(0)',\n 'offscreen & side=left': 'translateX(-100%)',\n 'offscreen & side=right': 'translateX(100%)',\n 'offscreen & side=top': 'translateY(-100%)',\n 'offscreen & side=bottom': 'translateY(100%)',\n },\n transition: {\n '': 'none',\n 'has-transition': 'transform $transition ease-out',\n },\n },\n});\n\n// Handler is positioned as sibling to panel (in Fragment), relative to Layout\nconst ResizeHandlerElement = tasty({\n qa: 'PanelResizeHandler',\n styles: {\n position: 'absolute',\n\n // Handler size\n width: {\n '': '100%',\n horizontal: `${HANDLER_WIDTH}px`,\n 'disabled & horizontal': '1bw',\n },\n height: {\n '': `${HANDLER_WIDTH}px`,\n horizontal: '100%',\n 'disabled & !horizontal': '1bw',\n },\n\n // Position handler with direct offset (no centering needed)\n top: {\n '': 0,\n 'side=top': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=bottom': 'initial',\n },\n bottom: {\n '': 0,\n 'side=bottom': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=top': 'initial',\n },\n left: {\n '': 0,\n 'side=left': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=right': 'initial',\n },\n right: {\n '': 0,\n 'side=right': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=left': 'initial',\n },\n\n // Offscreen transforms only (no centering needed with direct offset positioning)\n transform: {\n '': 'translateX(0)',\n 'offscreen & side=left': `translateX(calc(-1 * $panel-size - ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n 'offscreen & side=right': `translateX(calc($panel-size + ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n 'offscreen & side=top': `translateY(calc(-1 * $panel-size - ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n 'offscreen & side=bottom': `translateY(calc($panel-size + ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n },\n\n cursor: {\n '': 'row-resize',\n horizontal: 'col-resize',\n disabled: 'not-allowed',\n },\n touchAction: {\n '': 'none',\n disabled: 'auto',\n },\n padding: 0,\n outline: 0,\n boxSizing: 'border-box',\n\n // Transition must match panel for synchronized animation\n transition: {\n '': 'theme',\n 'has-transition': 'transform $transition ease-out, theme',\n },\n\n Track: {\n width: {\n '': 'initial',\n horizontal: '3px',\n 'disabled & horizontal': '1px',\n },\n height: {\n '': '3px',\n horizontal: 'initial',\n 'disabled & !horizontal': '1px',\n },\n position: 'absolute',\n inset: {\n '': '3px 0',\n horizontal: '0 3px',\n disabled: '0 0',\n },\n fill: {\n '': '#border',\n '(hovered | drag | focused) & !disabled': '#purple-03',\n },\n border: 0,\n transition: 'theme',\n outline: {\n '': '1bw #primary-text.0',\n 'drag | focused': '1bw #primary-text',\n },\n outlineOffset: 1,\n },\n\n Drag: {\n display: 'grid',\n gap: '2bw',\n border: 0,\n flow: {\n '': 'row',\n horizontal: 'column',\n },\n gridColumns: {\n '': '3px 3px 3px 3px 3px',\n horizontal: 'auto',\n },\n gridRows: {\n '': 'auto',\n horizontal: '3px 3px 3px 3px 3px',\n },\n width: {\n '': 'auto',\n horizontal: '1px',\n },\n height: {\n '': '1px',\n horizontal: 'auto',\n },\n inset: {\n '': '4px 50% auto auto',\n horizontal: '50% 4px auto auto',\n },\n transform: {\n '': 'translate(-50%, 0)',\n horizontal: 'translate(0, -50%)',\n },\n position: 'absolute',\n transition: 'theme',\n },\n\n DragPart: {\n radius: true,\n fill: {\n '': '#dark-03',\n 'hovered | drag | focused': '#primary-text',\n disabled: '#disabled-surface-text',\n },\n },\n },\n});\n\n// Overlay backdrop for overlay mode - covers the content area behind the panel\nconst OverlayBackdrop = tasty({\n qa: 'PanelOverlay',\n styles: {\n position: 'absolute',\n inset: 0,\n // fill: '#white.2',\n backdropFilter: 'invert(.15)',\n cursor: 'pointer',\n opacity: {\n '': 0,\n visible: 1,\n },\n pointerEvents: {\n '': 'none',\n visible: 'auto',\n },\n transition: 'opacity .15s ease-out',\n },\n});\n\ninterface ResizeHandlerProps {\n side: Side;\n isDisabled?: boolean;\n mods?: Record<string, boolean>;\n moveProps: ReturnType<typeof useMove>['moveProps'];\n style?: Record<string, string | number | null | undefined>;\n onDoubleClick?: () => void;\n}\n\nfunction ResizeHandler(props: ResizeHandlerProps) {\n const { side, isDisabled, mods, moveProps, style, onDoubleClick } = props;\n const { hoverProps, isHovered } = useHover({});\n const { focusProps, isFocusVisible } = useFocusRing();\n const isHorizontal = side === 'left' || side === 'right';\n const localIsHovered = useDebouncedValue(isHovered, 150);\n\n return (\n <ResizeHandlerElement\n {...mergeProps(hoverProps, focusProps, moveProps, {\n mods: {\n hovered: localIsHovered,\n horizontal: isHorizontal,\n disabled: isDisabled,\n focused: isFocusVisible,\n side,\n ...mods,\n },\n style,\n tabIndex: isDisabled ? undefined : 0,\n role: 'separator',\n 'aria-orientation': isHorizontal ? 'vertical' : 'horizontal',\n 'aria-label': `Resize ${side} panel`,\n onDoubleClick: isDisabled ? undefined : onDoubleClick,\n })}\n >\n <div data-element=\"Track\" />\n {!isDisabled && (\n <div data-element=\"Drag\">\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n </div>\n )}\n </ResizeHandlerElement>\n );\n}\n\n/** Panel rendering mode */\nexport type LayoutPanelMode = 'default' | 'sticky' | 'overlay' | 'dialog';\n\nexport interface CubeLayoutPanelProps extends BaseProps, ContainerStyleProps {\n /** Side of the layout where panel is positioned */\n side: Side;\n /**\n * Panel rendering mode:\n * - `default`: Standard panel that pushes content aside\n * - `sticky`: Panel floats over content without pushing it\n * - `overlay`: Panel with dismissable backdrop overlay\n * - `dialog`: Panel renders as a modal dialog\n */\n mode?: LayoutPanelMode;\n /** Panel size (width for left/right, height for top/bottom) - controlled */\n size?: number | string;\n /** Default panel size for uncontrolled state */\n defaultSize?: number | string;\n /** Minimum panel size */\n minSize?: number | string;\n /** Maximum panel size */\n maxSize?: number | string;\n /** Enable resize functionality */\n isResizable?: boolean;\n /** Size change callback */\n onSizeChange?: (size: number) => void;\n /** Controlled open state */\n isOpen?: boolean;\n /** Default open state */\n defaultIsOpen?: boolean;\n /** Open state change callback */\n onOpenChange?: (isOpen: boolean) => void;\n /** Enable slide transition on open/close */\n hasTransition?: boolean;\n /**\n * Whether the panel can be dismissed by clicking the overlay (overlay mode) or pressing Escape.\n * Only applies to `overlay` and `dialog` modes. Default: true\n */\n isDismissable?: boolean;\n /** Styles for the overlay backdrop in overlay mode */\n overlayStyles?: Styles;\n /**\n * @deprecated Use `mode=\"dialog\"` instead. Switch to dialog mode (renders panel inside Dialog)\n */\n isDialog?: boolean;\n /** Controlled dialog open state (used with mode=\"dialog\") */\n isDialogOpen?: boolean;\n /** Default dialog open state */\n defaultIsDialogOpen?: boolean;\n /** Dialog open state change callback */\n onDialogOpenChange?: (isOpen: boolean) => void;\n /** Props passed to Dialog component when in dialog mode */\n dialogProps?: Omit<\n CubeDialogContainerProps,\n 'isDismissable' | 'onDismiss' | 'isOpen'\n >;\n /** Padding for content areas inside the panel. Default: '1x' */\n contentPadding?: Styles['padding'];\n /** localStorage key for persisting panel size. When provided, size is stored and restored across instances. */\n sizeStorageKey?: string;\n /** Styles for the panel */\n styles?: Styles;\n children?: ReactNode;\n}\n\nfunction LayoutPanel(\n props: CubeLayoutPanelProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const layoutActions = useLayoutActionsContext();\n const layoutState = useLayoutStateContext();\n const layoutRefs = useLayoutRefsContext();\n\n if (!layoutActions || !layoutState || !layoutRefs) {\n throw new Error(\n 'Layout.Panel must be used within a Layout component. ' +\n 'Ensure your panel is rendered inside a <Layout> parent.',\n );\n }\n\n const {\n side = 'left',\n mode: modeProp,\n size: providedSize,\n defaultSize = 280,\n minSize = 200,\n maxSize,\n isResizable = false,\n onSizeChange,\n isOpen: providedIsOpen,\n defaultIsOpen = true,\n onOpenChange,\n hasTransition: hasTransitionProp,\n isDismissable = true,\n overlayStyles,\n // Deprecated prop - use mode=\"dialog\" instead\n isDialog = false,\n isDialogOpen: providedIsDialogOpen,\n defaultIsDialogOpen = false,\n onDialogOpenChange,\n dialogProps,\n contentPadding,\n sizeStorageKey,\n children,\n styles,\n mods,\n ...otherProps\n } = props;\n\n // Resolve mode from prop or deprecated isDialog\n const mode: LayoutPanelMode = modeProp ?? (isDialog ? 'dialog' : 'default');\n const isDialogMode = mode === 'dialog';\n const isOverlayMode = mode === 'overlay';\n const isStickyMode = mode === 'sticky';\n\n // Use prop value if provided, otherwise fall back to context value\n const hasTransition = hasTransitionProp ?? layoutActions.hasTransition;\n\n const combinedRef = useCombinedRefs(ref);\n const prevProvidedSizeRef = useRef(providedSize);\n const isHorizontal = side === 'left' || side === 'right';\n\n // Natural boundary computation\n const { containerWidth, containerHeight } = layoutState;\n const { minContentSize } = layoutActions;\n const containerDimension = isHorizontal ? containerWidth : containerHeight;\n const oppositeSide = getOppositeSide(side);\n const oppositePanelSize = layoutState.panelSizes[oppositeSide];\n const ownInsetOffset = isResizable ? RESIZABLE_INSET_OFFSET : 0;\n const naturalMax = useMemo(\n () =>\n containerDimension > 0\n ? Math.max(\n 0,\n containerDimension -\n oppositePanelSize -\n minContentSize -\n ownInsetOffset,\n )\n : Infinity,\n [containerDimension, oppositePanelSize, minContentSize, ownInsetOffset],\n );\n\n // Panel open state\n const [internalIsOpen, setInternalIsOpen] = useState(defaultIsOpen);\n const isOpen = providedIsOpen ?? internalIsOpen;\n const isTransitionActive =\n hasTransition && !isDialogMode && layoutRefs.isPanelContainerReady;\n const [visualState, setVisualState] = useState({\n isShown: isOpen,\n isTransitionActive,\n });\n\n // A newly mounted DisplayTransition starts at the requested visibility.\n if (visualState.isTransitionActive !== isTransitionActive) {\n setVisualState({ isShown: isOpen, isTransitionActive });\n }\n const isPanelShown = isTransitionActive ? visualState.isShown : isOpen;\n\n // Dialog open state\n const [internalIsDialogOpen, setInternalIsDialogOpen] =\n useState(defaultIsDialogOpen);\n const dialogOpen = providedIsDialogOpen ?? internalIsDialogOpen;\n\n // Persistent size storage\n const [storedSize, setStoredSize] = useLocalStorage<number | null>(\n sizeStorageKey ?? null,\n null,\n );\n\n // Resize state\n const [isDragging, setIsDragging] = useState(false);\n const [size, setSize] = useState<number>(() => {\n const initialSize =\n typeof providedSize === 'number'\n ? providedSize\n : storedSize != null\n ? storedSize\n : typeof defaultSize === 'number'\n ? defaultSize\n : 280;\n\n return clampSize(initialSize, minSize, maxSize);\n });\n\n const extractedStyles = extractStyles(otherProps, CONTAINER_STYLES);\n\n // Merge styles with contentPadding support\n const finalStyles = useMemo(\n () =>\n mergeStyles(\n styles,\n contentPadding != null ? { '$content-padding': contentPadding } : null,\n extractedStyles,\n ),\n [extractedStyles, contentPadding, styles],\n );\n\n // Resolve user's maxSize to pixels for JS-level clamping.\n // String values (e.g. \"50%\") can only be resolved once we know the container size.\n const resolvedMax = useMemo(() => {\n if (typeof maxSize === 'number') return maxSize;\n if (typeof maxSize === 'string' && containerDimension > 0) {\n return resolveCssSize(maxSize, containerDimension);\n }\n return undefined;\n }, [maxSize, containerDimension]);\n\n // Effective max combines user's maxSize with natural boundary\n const effectiveMax = useMemo(() => {\n const values: number[] = [];\n if (resolvedMax != null) values.push(resolvedMax);\n if (Number.isFinite(naturalMax)) values.push(naturalMax);\n return values.length > 0 ? Math.min(...values) : undefined;\n }, [resolvedMax, naturalMax]);\n\n // Clamp size to min/max constraints (including natural boundaries)\n const clampValue = useCallback(\n (value: number) => clampSize(value, minSize, undefined, effectiveMax),\n [minSize, effectiveMax],\n );\n\n const setContextDragging = layoutActions.setDragging;\n\n const { moveProps } = useMove({\n onMoveStart() {\n if (!isResizable) return;\n setIsDragging(true);\n setContextDragging(true);\n },\n onMove(e) {\n if (!isResizable) return;\n\n let delta: number;\n\n if (e.pointerType === 'keyboard') {\n // Keyboard resize: 10px per step, 50px with Shift\n const step = e.shiftKey ? 50 : 10;\n // For keyboard, deltaX/deltaY are direction indicators (-1, 0, 1)\n const rawDelta = isHorizontal ? e.deltaX : e.deltaY;\n const direction = side === 'right' || side === 'bottom' ? -1 : 1;\n delta = rawDelta * step * direction;\n } else {\n // Pointer resize: use exact delta values\n delta = isHorizontal\n ? e.deltaX * (side === 'right' ? -1 : 1)\n : e.deltaY * (side === 'bottom' ? -1 : 1);\n }\n\n setSize((currentSize) => clampValue(currentSize + delta));\n },\n onMoveEnd() {\n setIsDragging(false);\n setContextDragging(false);\n // Round to integer on release and notify parent\n setSize((currentSize) => {\n const finalSize = Math.round(clampValue(currentSize));\n // Call onSizeChange synchronously to ensure parent state is updated\n onSizeChange?.(finalSize);\n // Persist to localStorage if key is provided\n setStoredSize(finalSize);\n return finalSize;\n });\n },\n });\n\n // Sync provided size with internal state (only when providedSize actually changes)\n // This prevents resetting size when only isDragging changes (which would cause a flash)\n useEffect(() => {\n if (prevProvidedSizeRef.current !== providedSize) {\n prevProvidedSizeRef.current = providedSize;\n if (typeof providedSize === 'number' && !isDragging) {\n setSize(clampValue(providedSize));\n }\n }\n }, [providedSize, isDragging, clampValue]);\n\n // Auto-shrink: re-clamp when container resizes or opposite panel changes\n useEffect(() => {\n if (!isDragging && containerDimension > 0) {\n setSize((prev) => {\n const clamped = clampValue(prev);\n\n if (clamped !== prev) {\n onSizeChange?.(Math.round(clamped));\n setStoredSize(Math.round(clamped));\n }\n\n return clamped;\n });\n }\n }, [isDragging, clampValue, containerDimension]);\n\n // Register panel with layout context\n // Include handler outside portion (minus border overlap) for proper content inset\n // In sticky, overlay, and dialog modes, panel doesn't push content, so size is 0\n // NOTE: We intentionally use `size` (not `clampValue(size)`) here to avoid a feedback\n // loop. `clampValue` depends on the opposite panel's context size, so clamping here\n // would create a period-2 oscillation through shared context. CSS --max-size handles\n // visual clamping immediately; the auto-shrink effect converges `size` state.\n const effectivePanelSize = isPanelShown && mode === 'default' ? size : 0;\n const effectiveInsetSize = Math.round(\n effectivePanelSize +\n (isResizable && effectivePanelSize > 0 ? RESIZABLE_INSET_OFFSET : 0),\n );\n\n const { registerPanel, unregisterPanel, updatePanelSize } = layoutActions;\n const { isReady } = layoutState;\n\n // Track the last reported size to prevent unnecessary updates\n const lastSizeRef = useRef<number>(effectiveInsetSize);\n\n // Register on mount, unregister on unmount\n // Using useLayoutEffect ensures registration happens before browser paint\n useLayoutEffect(() => {\n registerPanel(side, lastSizeRef.current);\n\n return () => {\n unregisterPanel(side);\n };\n }, [side, registerPanel, unregisterPanel]);\n\n // Update size when it changes (after initial mount)\n // Using useLayoutEffect ensures size updates happen before browser paint\n useLayoutEffect(() => {\n if (lastSizeRef.current !== effectiveInsetSize) {\n lastSizeRef.current = effectiveInsetSize;\n updatePanelSize(side, effectiveInsetSize);\n }\n }, [side, effectiveInsetSize, updatePanelSize]);\n\n const handleOpenChange = useCallback(\n (newIsOpen: boolean) => {\n setInternalIsOpen(newIsOpen);\n onOpenChange?.(newIsOpen);\n },\n [onOpenChange],\n );\n\n // Dismiss handler for overlay mode (click on overlay)\n const handleDismiss = useCallback(() => {\n if (isDismissable) {\n handleOpenChange(false);\n }\n }, [isDismissable, handleOpenChange]);\n\n // Register overlay panel with Layout context for coordinated dismissal\n const { registerOverlayPanel } = layoutActions;\n\n useEffect(() => {\n // Only register if in overlay mode, open, and dismissable\n if (isOverlayMode && isOpen && isDismissable) {\n const unregister = registerOverlayPanel(() => handleOpenChange(false));\n return unregister;\n }\n }, [\n isOverlayMode,\n isOpen,\n isDismissable,\n registerOverlayPanel,\n handleOpenChange,\n ]);\n\n const handleDialogOpenChange = useCallback(\n (newIsOpen: boolean) => {\n setInternalIsDialogOpen(newIsOpen);\n onDialogOpenChange?.(newIsOpen);\n },\n [onDialogOpenChange],\n );\n\n // Panel context value for child components (like LayoutPanelHeader)\n const panelContextValue = useMemo(\n () => ({\n onOpenChange: handleOpenChange,\n isOpen,\n }),\n [handleOpenChange, isOpen],\n );\n\n // Dialog mode context value - uses dialog state instead of panel state\n const dialogPanelContextValue = useMemo(\n () => ({\n onOpenChange: handleDialogOpenChange,\n isOpen: dialogOpen,\n }),\n [handleDialogOpenChange, dialogOpen],\n );\n\n const panelMods = useMemo(\n () => ({\n side,\n drag: isDragging,\n horizontal: isHorizontal,\n // Only enable transition after layout is ready to prevent initial animation\n 'has-transition': hasTransition && isReady,\n ...mods,\n }),\n [side, isDragging, isHorizontal, hasTransition, isReady, mods],\n );\n\n // Build --max-size CSS variable combining user maxSize and natural boundary\n const maxSizeCss = useMemo(() => {\n const parts: string[] = [];\n\n if (maxSize != null) {\n parts.push(typeof maxSize === 'number' ? `${maxSize}px` : maxSize);\n }\n\n if (containerDimension > 0 && Number.isFinite(naturalMax)) {\n parts.push(`${naturalMax}px`);\n }\n\n if (parts.length === 0) return undefined;\n return parts.length === 1 ? parts[0] : `min(${parts.join(', ')})`;\n }, [maxSize, naturalMax, containerDimension]);\n\n const panelStyle = useMemo(\n () => ({\n '--panel-size': `${size}px`,\n '--min-size': typeof minSize === 'number' ? `${minSize}px` : minSize,\n '--max-size': maxSizeCss,\n }),\n [size, minSize, maxSizeCss],\n );\n\n // Combine refs for panel element\n const panelRefCallback = useCallback(\n (node: HTMLDivElement | null, transitionRef?: RefCallback<HTMLElement>) => {\n // Update the combined ref\n (combinedRef as { current: HTMLDivElement | null }).current = node;\n // Call transition ref if provided\n transitionRef?.(node);\n },\n [combinedRef],\n );\n\n // Reset to default size on double-click\n const handleResetSize = useCallback(() => {\n const resetSize =\n typeof defaultSize === 'number' ? defaultSize : parseInt(defaultSize, 10);\n const clampedSize = clampValue(resetSize || 280);\n setSize(clampedSize);\n onSizeChange?.(clampedSize);\n setStoredSize(clampedSize);\n }, [defaultSize, clampValue, onSizeChange, setStoredSize]);\n\n const renderPanelContent = (\n offscreen = false,\n transitionRef?: RefCallback<HTMLElement>,\n ) => {\n const showOverlay = isOverlayMode && !offscreen;\n\n return (\n <>\n {/* Overlay backdrop for overlay mode */}\n {isOverlayMode && (\n <OverlayBackdrop\n mods={{ visible: showOverlay }}\n styles={overlayStyles}\n aria-hidden=\"true\"\n onClick={handleDismiss}\n />\n )}\n <PanelElement\n ref={(node: HTMLDivElement | null) =>\n panelRefCallback(node, transitionRef)\n }\n {...filterBaseProps(otherProps, { eventProps: true })}\n mods={{ ...panelMods, offscreen }}\n styles={finalStyles}\n style={panelStyle}\n data-side={side}\n >\n <LayoutPanelContext.Provider value={panelContextValue}>\n <LayoutContextReset>{children}</LayoutContextReset>\n </LayoutPanelContext.Provider>\n </PanelElement>\n {isResizable && (\n <ResizeHandler\n side={side}\n isDisabled={!isResizable}\n mods={{\n drag: isDragging,\n offscreen,\n 'has-transition': hasTransition && isReady,\n }}\n moveProps={moveProps}\n style={panelStyle}\n onDoubleClick={handleResetSize}\n />\n )}\n </>\n );\n };\n\n // Dialog mode - uses its own portal via DialogContainer\n if (isDialogMode) {\n return (\n <DialogContainer\n isOpen={dialogOpen}\n isDismissable={isDismissable}\n onDismiss={() => handleDialogOpenChange(false)}\n {...dialogProps}\n >\n <Dialog isDismissable={false}>\n <LayoutPanelContext.Provider value={dialogPanelContextValue}>\n <LayoutContextReset>{children}</LayoutContextReset>\n </LayoutPanelContext.Provider>\n </Dialog>\n </DialogContainer>\n );\n }\n\n // Wait for portal container to be ready before rendering\n if (!layoutRefs.isPanelContainerReady) {\n return null;\n }\n\n const portalContainer = layoutRefs.panelContainerRef.current!;\n\n // Panel with transition - portal to panel container\n if (hasTransition) {\n return createPortal(\n <DisplayTransition\n isShown={isOpen}\n animateOnMount={false}\n onToggle={(isShown) => setVisualState({ isShown, isTransitionActive })}\n >\n {({ isShown, isExiting, ref: transitionRef }) => (\n <LayoutPanelTransition isShown={isShown} isExiting={isExiting}>\n {renderPanelContent(!isShown, transitionRef)}\n </LayoutPanelTransition>\n )}\n </DisplayTransition>,\n portalContainer,\n );\n }\n\n // Simple panel (no transition) - portal to panel container\n if (!isOpen) return null;\n\n return createPortal(renderPanelContent(false), portalContainer);\n}\n\nconst _LayoutPanel = forwardRef(LayoutPanel);\n\n_LayoutPanel.displayName = 'Layout.Panel';\n\nexport { _LayoutPanel as LayoutPanel };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmDA,MAAMyC,gBAAgB;AAEtB,MAAMC,iBAAiB;AAEvB,MAAMC,yBAAyB;AAE/B,MAAMC,eAAetC,MAAM;CACzBuC,IAAI;CACJC,IAAI;CACJC,QAAQ;EACNC,WAAW;EACXC,UAAU;EACVC,SAAS;EACTC,MAAM;EACNC,UAAU;EACVC,WAAW;EAEX,oBAAoB;EAEpB,uBAAuB;EAGvBC,KAAK;GACH,IAAI;GACJ,eAAe;GAChB;EACDC,OAAO;GACL,IAAI;GACJ,aAAa;GACd;EACDC,QAAQ;GACN,IAAI;GACJ,YAAY;GACb;EACDC,MAAM;GACJ,IAAI;GACJ,cAAc;GACf;EAGDC,OAAO;GACL,IAAI;GACJ,0BAA0B;GAC3B;EACDC,QAAQ;GACN,IAAI;GACJ,0BAA0B;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ACE,oBAAC;EACC,QAAQ2B;EACOnD;EACf,iBAAiBsG,uBAAuB,MAAM;EAC9C,GAAIhG;YAEJ,oBAAC;GAAO,eAAe;aACrB,oBAAC,mBAAmB;IAAS,OAAOkG;cAClC,oBAAC,sBAAoB9F,WAA6B;KACvB;IACvB;GACQ;AAKtB,KAAI,CAACM,WAAW4B,sBACd,QAAO;CAGT,MAAM+E,kBAAkB3G,WAAW4G,kBAAkBrC;AAGrD,KAAIxF,cACF,QAAO3G,aACL,oBAAC;EACC,SAASwG;EACT,gBAAgB;EAChB,WAAWmD,YAAYD,eAAe;GAAEC;GAASJ;GAAoB,CAAC;aAEpE,EAAEI,SAAAA,WAAS8E,WAAWjH,KAAKqG,sBAC3B,oBAAC;GAAsB,SAASlE;GAAoB8E;aACjDN,mBAAmB,CAACxE,WAASkE,gBAAc;IAE/C;GACiB,EACpBU,gBACD;AAIH,KAAI,CAAC/H,OAAQ,QAAO;AAEpB,QAAOxG,aAAamO,mBAAmB,MAAM,EAAEI,gBAAgB;;AAGjE,MAAMG,eAAevP,WAAWoI,YAAY;AAE5CmH,aAAaC,cAAc"}
|
|
1
|
+
{"version":3,"file":"LayoutPanel.js","names":["BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","mergeStyles","Styles","tasty","ForwardedRef","forwardRef","HTMLAttributes","ReactNode","RefCallback","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFocusRing","useHover","useMove","createPortal","useDebouncedValue","mergeProps","useCombinedRefs","useLocalStorage","extractStyles","DisplayTransition","Dialog","CubeDialogContainerProps","DialogContainer","LayoutContextReset","LayoutPanelContext","Side","useLayoutActionsContext","useLayoutRefsContext","useLayoutStateContext","LayoutPanelTransition","clampSize","getOppositeSide","resolveCssSize","HANDLER_WIDTH","HANDLER_OFFSET","RESIZABLE_INSET_OFFSET","PanelElement","as","qa","styles","container","position","display","flow","overflow","boxSizing","top","right","bottom","left","width","height","border","fill","transform","transition","ResizeHandlerElement","horizontal","cursor","disabled","touchAction","padding","outline","Track","inset","outlineOffset","Drag","gap","gridColumns","gridRows","DragPart","radius","OverlayBackdrop","backdropFilter","opacity","visible","pointerEvents","ResizeHandlerProps","side","isDisabled","mods","Record","moveProps","ReturnType","style","onDoubleClick","ResizeHandler","props","$","_c","t0","Symbol","for","hoverProps","isHovered","focusProps","isFocusVisible","isHorizontal","localIsHovered","t1","hovered","focused","tabIndex","undefined","role","t2","t3","t4","LayoutPanelMode","CubeLayoutPanelProps","mode","size","defaultSize","minSize","maxSize","isResizable","onSizeChange","isOpen","defaultIsOpen","onOpenChange","hasTransition","isDismissable","overlayStyles","isDialog","isDialogOpen","defaultIsDialogOpen","onDialogOpenChange","dialogProps","Omit","contentPadding","sizeStorageKey","children","matchesContainerSize","HTMLElement","dimension","offsetWidth","offsetHeight","LayoutPanel","ref","HTMLDivElement","layoutActions","layoutState","layoutRefs","Error","modeProp","providedSize","providedIsOpen","hasTransitionProp","providedIsDialogOpen","otherProps","isDialogMode","isOverlayMode","isStickyMode","combinedRef","prevProvidedSizeRef","containerWidth","containerHeight","minContentSize","containerDimension","oppositeSide","oppositePanelSize","panelSizes","ownInsetOffset","naturalMax","Math","max","Infinity","internalIsOpen","setInternalIsOpen","isTransitionActive","isPanelContainerReady","visualState","setVisualState","isShown","isPanelShown","internalIsDialogOpen","setInternalIsDialogOpen","dialogOpen","storedSize","setStoredSize","isDragging","setIsDragging","setSize","initialSize","extractedStyles","finalStyles","resolvedMax","trim","endsWith","effectiveMax","values","push","Number","isFinite","length","min","clampValue","value","setContextDragging","setDragging","onMoveStart","onMove","e","delta","pointerType","step","shiftKey","rawDelta","deltaX","deltaY","direction","currentSize","onMoveEnd","finalSize","round","current","panelContainerRef","parentElement","prev","clamped","effectivePanelSize","effectiveInsetSize","registerPanel","unregisterPanel","updatePanelSize","isReady","lastSizeRef","handleOpenChange","newIsOpen","handleDismiss","registerOverlayPanel","unregister","handleDialogOpenChange","panelContextValue","dialogPanelContextValue","panelMods","drag","maxSizeCss","parts","join","panelStyle","panelRefCallback","node","transitionRef","handleResetSize","resetSize","parseInt","clampedSize","renderPanelContent","offscreen","showOverlay","eventProps","portalContainer","isExiting","_LayoutPanel","displayName"],"sources":["../../../../src/components/content/Layout/LayoutPanel.tsx"],"sourcesContent":["import {\n BaseProps,\n CONTAINER_STYLES,\n ContainerStyleProps,\n filterBaseProps,\n mergeStyles,\n Styles,\n tasty,\n} from '@tenphi/tasty';\nimport {\n ForwardedRef,\n forwardRef,\n HTMLAttributes,\n ReactNode,\n RefCallback,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useFocusRing, useHover, useMove } from 'react-aria';\nimport { createPortal } from 'react-dom';\n\nimport { useDebouncedValue } from '../../../_internal/hooks';\nimport {\n mergeProps,\n useCombinedRefs,\n useLocalStorage,\n} from '../../../utils/react';\nimport { extractStyles } from '../../../utils/styles';\nimport { DisplayTransition } from '../../helpers/DisplayTransition/DisplayTransition';\nimport { Dialog } from '../../overlays/Dialog';\nimport {\n CubeDialogContainerProps,\n DialogContainer,\n} from '../../overlays/Dialog/DialogContainer';\n\nimport {\n LayoutContextReset,\n LayoutPanelContext,\n Side,\n useLayoutActionsContext,\n useLayoutRefsContext,\n useLayoutStateContext,\n} from './LayoutContext';\nimport { LayoutPanelTransition } from './LayoutPanelTransition';\nimport { clampSize, getOppositeSide, resolveCssSize } from './utils';\n\n// Resize handler dimensions\nconst HANDLER_WIDTH = 9;\n// How far from panel edge to position handler's inner edge (centers the 3px track on the edge)\nconst HANDLER_OFFSET = 4;\n// Extra inset added for resizable panels (to accommodate handler grab area)\nconst RESIZABLE_INSET_OFFSET = 2;\n\nconst PanelElement = tasty({\n as: 'div',\n qa: 'LayoutPanel',\n styles: {\n container: 'panel / inline-size',\n position: 'absolute',\n display: 'flex',\n flow: 'column',\n overflow: 'hidden',\n boxSizing: 'border-box',\n\n '$content-padding': '1x',\n // Auto-border size for sub-components (panels are always vertical)\n '$layout-border-size': '1bw',\n\n // Position based on side prop\n top: {\n '': 0,\n 'side=bottom': 'initial',\n },\n right: {\n '': 0,\n 'side=left': 'initial',\n },\n bottom: {\n '': 0,\n 'side=top': 'initial',\n },\n left: {\n '': 0,\n 'side=right': 'initial',\n },\n\n // Size handling with CSS-level min/max clamping\n width: {\n '': '$min-size $panel-size $max-size',\n 'side=top | side=bottom': '100%',\n },\n height: {\n '': '100%',\n 'side=top | side=bottom': '$min-size $panel-size $max-size',\n },\n\n // Visual styling\n border: {\n '': false,\n 'side=left': 'right',\n 'side=right': 'left',\n 'side=top': 'bottom',\n 'side=bottom': 'top',\n },\n fill: '#surface',\n\n // Transition styles - offscreen mod controls slide animation\n transform: {\n '': 'translateX(0) translateY(0)',\n 'offscreen & side=left': 'translateX(-100%)',\n 'offscreen & side=right': 'translateX(100%)',\n 'offscreen & side=top': 'translateY(-100%)',\n 'offscreen & side=bottom': 'translateY(100%)',\n },\n transition: {\n '': 'none',\n 'has-transition': 'transform $transition ease-out',\n },\n },\n});\n\n// Handler is positioned as sibling to panel (in Fragment), relative to Layout\nconst ResizeHandlerElement = tasty({\n qa: 'PanelResizeHandler',\n styles: {\n position: 'absolute',\n\n // Handler size\n width: {\n '': '100%',\n horizontal: `${HANDLER_WIDTH}px`,\n 'disabled & horizontal': '1bw',\n },\n height: {\n '': `${HANDLER_WIDTH}px`,\n horizontal: '100%',\n 'disabled & !horizontal': '1bw',\n },\n\n // Position handler with direct offset (no centering needed)\n top: {\n '': 0,\n 'side=top': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=bottom': 'initial',\n },\n bottom: {\n '': 0,\n 'side=bottom': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=top': 'initial',\n },\n left: {\n '': 0,\n 'side=left': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=right': 'initial',\n },\n right: {\n '': 0,\n 'side=right': `calc($panel-size - ${HANDLER_OFFSET}px)`,\n 'side=left': 'initial',\n },\n\n // Offscreen transforms only (no centering needed with direct offset positioning)\n transform: {\n '': 'translateX(0)',\n 'offscreen & side=left': `translateX(calc(-1 * $panel-size - ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n 'offscreen & side=right': `translateX(calc($panel-size + ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n 'offscreen & side=top': `translateY(calc(-1 * $panel-size - ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n 'offscreen & side=bottom': `translateY(calc($panel-size + ${HANDLER_WIDTH - HANDLER_OFFSET}px))`,\n },\n\n cursor: {\n '': 'row-resize',\n horizontal: 'col-resize',\n disabled: 'not-allowed',\n },\n touchAction: {\n '': 'none',\n disabled: 'auto',\n },\n padding: 0,\n outline: 0,\n boxSizing: 'border-box',\n\n // Transition must match panel for synchronized animation\n transition: {\n '': 'theme',\n 'has-transition': 'transform $transition ease-out, theme',\n },\n\n Track: {\n width: {\n '': 'initial',\n horizontal: '3px',\n 'disabled & horizontal': '1px',\n },\n height: {\n '': '3px',\n horizontal: 'initial',\n 'disabled & !horizontal': '1px',\n },\n position: 'absolute',\n inset: {\n '': '3px 0',\n horizontal: '0 3px',\n disabled: '0 0',\n },\n fill: {\n '': '#border',\n '(hovered | drag | focused) & !disabled': '#purple-03',\n },\n border: 0,\n transition: 'theme',\n outline: {\n '': '1bw #primary-text.0',\n 'drag | focused': '1bw #primary-text',\n },\n outlineOffset: 1,\n },\n\n Drag: {\n display: 'grid',\n gap: '2bw',\n border: 0,\n flow: {\n '': 'row',\n horizontal: 'column',\n },\n gridColumns: {\n '': '3px 3px 3px 3px 3px',\n horizontal: 'auto',\n },\n gridRows: {\n '': 'auto',\n horizontal: '3px 3px 3px 3px 3px',\n },\n width: {\n '': 'auto',\n horizontal: '1px',\n },\n height: {\n '': '1px',\n horizontal: 'auto',\n },\n inset: {\n '': '4px 50% auto auto',\n horizontal: '50% 4px auto auto',\n },\n transform: {\n '': 'translate(-50%, 0)',\n horizontal: 'translate(0, -50%)',\n },\n position: 'absolute',\n transition: 'theme',\n },\n\n DragPart: {\n radius: true,\n fill: {\n '': '#dark-03',\n 'hovered | drag | focused': '#primary-text',\n disabled: '#disabled-surface-text',\n },\n },\n },\n});\n\n// Overlay backdrop for overlay mode - covers the content area behind the panel\nconst OverlayBackdrop = tasty({\n qa: 'PanelOverlay',\n styles: {\n position: 'absolute',\n inset: 0,\n // fill: '#white.2',\n backdropFilter: 'invert(.15)',\n cursor: 'pointer',\n opacity: {\n '': 0,\n visible: 1,\n },\n pointerEvents: {\n '': 'none',\n visible: 'auto',\n },\n transition: 'opacity .15s ease-out',\n },\n});\n\ninterface ResizeHandlerProps {\n side: Side;\n isDisabled?: boolean;\n mods?: Record<string, boolean>;\n moveProps: ReturnType<typeof useMove>['moveProps'];\n style?: Record<string, string | number | null | undefined>;\n onDoubleClick?: () => void;\n}\n\nfunction ResizeHandler(props: ResizeHandlerProps) {\n const { side, isDisabled, mods, moveProps, style, onDoubleClick } = props;\n const { hoverProps, isHovered } = useHover({});\n const { focusProps, isFocusVisible } = useFocusRing();\n const isHorizontal = side === 'left' || side === 'right';\n const localIsHovered = useDebouncedValue(isHovered, 150);\n\n return (\n <ResizeHandlerElement\n {...mergeProps(hoverProps, focusProps, moveProps, {\n mods: {\n hovered: localIsHovered,\n horizontal: isHorizontal,\n disabled: isDisabled,\n focused: isFocusVisible,\n side,\n ...mods,\n },\n style,\n tabIndex: isDisabled ? undefined : 0,\n role: 'separator',\n 'aria-orientation': isHorizontal ? 'vertical' : 'horizontal',\n 'aria-label': `Resize ${side} panel`,\n onDoubleClick: isDisabled ? undefined : onDoubleClick,\n })}\n >\n <div data-element=\"Track\" />\n {!isDisabled && (\n <div data-element=\"Drag\">\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n <div data-element=\"DragPart\" />\n </div>\n )}\n </ResizeHandlerElement>\n );\n}\n\n/** Panel rendering mode */\nexport type LayoutPanelMode = 'default' | 'sticky' | 'overlay' | 'dialog';\n\nexport interface CubeLayoutPanelProps extends BaseProps, ContainerStyleProps {\n /** Side of the layout where panel is positioned */\n side: Side;\n /**\n * Panel rendering mode:\n * - `default`: Standard panel that pushes content aside\n * - `sticky`: Panel floats over content without pushing it\n * - `overlay`: Panel with dismissable backdrop overlay\n * - `dialog`: Panel renders as a modal dialog\n */\n mode?: LayoutPanelMode;\n /** Panel size (width for left/right, height for top/bottom) - controlled */\n size?: number | string;\n /** Default panel size for uncontrolled state */\n defaultSize?: number | string;\n /** Minimum panel size */\n minSize?: number | string;\n /** Maximum panel size */\n maxSize?: number | string;\n /** Enable resize functionality */\n isResizable?: boolean;\n /** Size change callback */\n onSizeChange?: (size: number) => void;\n /** Controlled open state */\n isOpen?: boolean;\n /** Default open state */\n defaultIsOpen?: boolean;\n /** Open state change callback */\n onOpenChange?: (isOpen: boolean) => void;\n /** Enable slide transition on open/close */\n hasTransition?: boolean;\n /**\n * Whether the panel can be dismissed by clicking the overlay (overlay mode) or pressing Escape.\n * Only applies to `overlay` and `dialog` modes. Default: true\n */\n isDismissable?: boolean;\n /** Styles for the overlay backdrop in overlay mode */\n overlayStyles?: Styles;\n /**\n * @deprecated Use `mode=\"dialog\"` instead. Switch to dialog mode (renders panel inside Dialog)\n */\n isDialog?: boolean;\n /** Controlled dialog open state (used with mode=\"dialog\") */\n isDialogOpen?: boolean;\n /** Default dialog open state */\n defaultIsDialogOpen?: boolean;\n /** Dialog open state change callback */\n onDialogOpenChange?: (isOpen: boolean) => void;\n /** Props passed to Dialog component when in dialog mode */\n dialogProps?: Omit<\n CubeDialogContainerProps,\n 'isDismissable' | 'onDismiss' | 'isOpen'\n >;\n /** Padding for content areas inside the panel. Default: '1x' */\n contentPadding?: Styles['padding'];\n /** localStorage key for persisting panel size. When provided, size is stored and restored across instances. */\n sizeStorageKey?: string;\n /** Styles for the panel */\n styles?: Styles;\n children?: ReactNode;\n}\n\nfunction matchesContainerSize(\n container: HTMLElement | null | undefined,\n isHorizontal: boolean,\n dimension: number,\n) {\n return (\n (isHorizontal ? container?.offsetWidth : container?.offsetHeight) ===\n dimension\n );\n}\n\nfunction LayoutPanel(\n props: CubeLayoutPanelProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const layoutActions = useLayoutActionsContext();\n const layoutState = useLayoutStateContext();\n const layoutRefs = useLayoutRefsContext();\n\n if (!layoutActions || !layoutState || !layoutRefs) {\n throw new Error(\n 'Layout.Panel must be used within a Layout component. ' +\n 'Ensure your panel is rendered inside a <Layout> parent.',\n );\n }\n\n const {\n side = 'left',\n mode: modeProp,\n size: providedSize,\n defaultSize = 280,\n minSize = 200,\n maxSize,\n isResizable = false,\n onSizeChange,\n isOpen: providedIsOpen,\n defaultIsOpen = true,\n onOpenChange,\n hasTransition: hasTransitionProp,\n isDismissable = true,\n overlayStyles,\n // Deprecated prop - use mode=\"dialog\" instead\n isDialog = false,\n isDialogOpen: providedIsDialogOpen,\n defaultIsDialogOpen = false,\n onDialogOpenChange,\n dialogProps,\n contentPadding,\n sizeStorageKey,\n children,\n styles,\n mods,\n ...otherProps\n } = props;\n\n // Resolve mode from prop or deprecated isDialog\n const mode: LayoutPanelMode = modeProp ?? (isDialog ? 'dialog' : 'default');\n const isDialogMode = mode === 'dialog';\n const isOverlayMode = mode === 'overlay';\n const isStickyMode = mode === 'sticky';\n\n // Use prop value if provided, otherwise fall back to context value\n const hasTransition = hasTransitionProp ?? layoutActions.hasTransition;\n\n const combinedRef = useCombinedRefs(ref);\n const prevProvidedSizeRef = useRef(providedSize);\n const isHorizontal = side === 'left' || side === 'right';\n\n // Natural boundary computation\n const { containerWidth, containerHeight } = layoutState;\n const { minContentSize } = layoutActions;\n const containerDimension = isHorizontal ? containerWidth : containerHeight;\n const oppositeSide = getOppositeSide(side);\n const oppositePanelSize = layoutState.panelSizes[oppositeSide];\n const ownInsetOffset = isResizable ? RESIZABLE_INSET_OFFSET : 0;\n const naturalMax = useMemo(\n () =>\n !isDialogMode && containerDimension > 0\n ? Math.max(\n 0,\n containerDimension -\n oppositePanelSize -\n minContentSize -\n ownInsetOffset,\n )\n : Infinity,\n [\n isDialogMode,\n containerDimension,\n oppositePanelSize,\n minContentSize,\n ownInsetOffset,\n ],\n );\n\n // Panel open state\n const [internalIsOpen, setInternalIsOpen] = useState(defaultIsOpen);\n const isOpen = providedIsOpen ?? internalIsOpen;\n const isTransitionActive =\n hasTransition && !isDialogMode && layoutRefs.isPanelContainerReady;\n const [visualState, setVisualState] = useState({\n isShown: isOpen,\n isTransitionActive,\n });\n\n // A newly mounted DisplayTransition starts at the requested visibility.\n if (visualState.isTransitionActive !== isTransitionActive) {\n setVisualState({ isShown: isOpen, isTransitionActive });\n }\n const isPanelShown = isTransitionActive ? visualState.isShown : isOpen;\n\n // Dialog open state\n const [internalIsDialogOpen, setInternalIsDialogOpen] =\n useState(defaultIsDialogOpen);\n const dialogOpen = providedIsDialogOpen ?? internalIsDialogOpen;\n\n // Persistent size storage\n const [storedSize, setStoredSize] = useLocalStorage<number | null>(\n sizeStorageKey ?? null,\n null,\n );\n\n // Resize state\n const [isDragging, setIsDragging] = useState(false);\n const [size, setSize] = useState<number>(() => {\n const initialSize =\n typeof providedSize === 'number'\n ? providedSize\n : storedSize != null\n ? storedSize\n : typeof defaultSize === 'number'\n ? defaultSize\n : 280;\n\n return clampSize(initialSize, minSize, maxSize);\n });\n\n const extractedStyles = extractStyles(otherProps, CONTAINER_STYLES);\n\n // Merge styles with contentPadding support\n const finalStyles = useMemo(\n () =>\n mergeStyles(\n styles,\n contentPadding != null ? { '$content-padding': contentPadding } : null,\n extractedStyles,\n ),\n [extractedStyles, contentPadding, styles],\n );\n\n // Resolve user's maxSize to pixels for JS-level clamping.\n // Percentage bounds belong to the inline host, not the dialog's host.\n const resolvedMax = useMemo(() => {\n if (typeof maxSize === 'number') return maxSize;\n if (\n typeof maxSize === 'string' &&\n containerDimension > 0 &&\n (!isDialogMode || !maxSize.trim().endsWith('%'))\n ) {\n return resolveCssSize(maxSize, containerDimension);\n }\n return undefined;\n }, [maxSize, containerDimension, isDialogMode]);\n\n // Effective max combines user's maxSize with natural boundary\n const effectiveMax = useMemo(() => {\n const values: number[] = [];\n if (resolvedMax != null) values.push(resolvedMax);\n if (Number.isFinite(naturalMax)) values.push(naturalMax);\n return values.length > 0 ? Math.min(...values) : undefined;\n }, [resolvedMax, naturalMax]);\n\n // Clamp size to min/max constraints (including natural boundaries)\n const clampValue = useCallback(\n (value: number) => clampSize(value, minSize, undefined, effectiveMax),\n [minSize, effectiveMax],\n );\n\n const setContextDragging = layoutActions.setDragging;\n\n const { moveProps } = useMove({\n onMoveStart() {\n if (!isResizable || isDialogMode) return;\n setIsDragging(true);\n setContextDragging(true);\n },\n onMove(e) {\n if (!isResizable || isDialogMode) return;\n\n let delta: number;\n\n if (e.pointerType === 'keyboard') {\n // Keyboard resize: 10px per step, 50px with Shift\n const step = e.shiftKey ? 50 : 10;\n // For keyboard, deltaX/deltaY are direction indicators (-1, 0, 1)\n const rawDelta = isHorizontal ? e.deltaX : e.deltaY;\n const direction = side === 'right' || side === 'bottom' ? -1 : 1;\n delta = rawDelta * step * direction;\n } else {\n // Pointer resize: use exact delta values\n delta = isHorizontal\n ? e.deltaX * (side === 'right' ? -1 : 1)\n : e.deltaY * (side === 'bottom' ? -1 : 1);\n }\n\n setSize((currentSize) => clampValue(currentSize + delta));\n },\n onMoveEnd() {\n setIsDragging(false);\n setContextDragging(false);\n if (isDialogMode && !isDragging) return;\n // Round to integer on release and notify parent\n setSize((currentSize) => {\n const finalSize = Math.round(clampValue(currentSize));\n // Call onSizeChange synchronously to ensure parent state is updated\n onSizeChange?.(finalSize);\n // Persist to localStorage if key is provided\n setStoredSize(finalSize);\n return finalSize;\n });\n },\n });\n\n // Sync provided size with internal state (only when providedSize actually changes)\n // This prevents resetting size when only isDragging changes (which would cause a flash)\n useEffect(() => {\n if (prevProvidedSizeRef.current !== providedSize) {\n if (\n !isDialogMode &&\n !matchesContainerSize(\n layoutRefs.panelContainerRef.current?.parentElement,\n isHorizontal,\n containerDimension,\n )\n ) {\n return;\n }\n\n prevProvidedSizeRef.current = providedSize;\n if (typeof providedSize === 'number' && !isDragging) {\n setSize(clampValue(providedSize));\n }\n }\n }, [\n providedSize,\n isDragging,\n clampValue,\n isDialogMode,\n isHorizontal,\n containerDimension,\n layoutRefs.panelContainerRef,\n ]);\n\n // Dialogs retain inline size; only inline panels follow the host's bounds.\n useEffect(() => {\n if (!isDialogMode && !isDragging && containerDimension > 0) {\n // A responsive mode switch can precede ResizeObserver's new measurement.\n // Wait for matching host bounds before shrinking and persisting size.\n if (\n !matchesContainerSize(\n layoutRefs.panelContainerRef.current?.parentElement,\n isHorizontal,\n containerDimension,\n )\n ) {\n return;\n }\n\n setSize((prev) => {\n const clamped = clampValue(prev);\n\n if (clamped !== prev) {\n onSizeChange?.(Math.round(clamped));\n setStoredSize(Math.round(clamped));\n }\n\n return clamped;\n });\n }\n }, [\n isDialogMode,\n isDragging,\n clampValue,\n containerDimension,\n isHorizontal,\n layoutRefs.panelContainerRef,\n ]);\n\n // Register panel with layout context\n // Include handler outside portion (minus border overlap) for proper content inset\n // In sticky, overlay, and dialog modes, panel doesn't push content, so size is 0\n // NOTE: We intentionally use `size` (not `clampValue(size)`) here to avoid a feedback\n // loop. `clampValue` depends on the opposite panel's context size, so clamping here\n // would create a period-2 oscillation through shared context. CSS --max-size handles\n // visual clamping immediately; the auto-shrink effect converges `size` state.\n const effectivePanelSize = isPanelShown && mode === 'default' ? size : 0;\n const effectiveInsetSize = Math.round(\n effectivePanelSize +\n (isResizable && effectivePanelSize > 0 ? RESIZABLE_INSET_OFFSET : 0),\n );\n\n const { registerPanel, unregisterPanel, updatePanelSize } = layoutActions;\n const { isReady } = layoutState;\n\n // Track the last reported size to prevent unnecessary updates\n const lastSizeRef = useRef<number>(effectiveInsetSize);\n\n // Register on mount, unregister on unmount\n // Using useLayoutEffect ensures registration happens before browser paint\n useLayoutEffect(() => {\n registerPanel(side, lastSizeRef.current);\n\n return () => {\n unregisterPanel(side);\n };\n }, [side, registerPanel, unregisterPanel]);\n\n // Update size when it changes (after initial mount)\n // Using useLayoutEffect ensures size updates happen before browser paint\n useLayoutEffect(() => {\n if (lastSizeRef.current !== effectiveInsetSize) {\n lastSizeRef.current = effectiveInsetSize;\n updatePanelSize(side, effectiveInsetSize);\n }\n }, [side, effectiveInsetSize, updatePanelSize]);\n\n const handleOpenChange = useCallback(\n (newIsOpen: boolean) => {\n setInternalIsOpen(newIsOpen);\n onOpenChange?.(newIsOpen);\n },\n [onOpenChange],\n );\n\n // Dismiss handler for overlay mode (click on overlay)\n const handleDismiss = useCallback(() => {\n if (isDismissable) {\n handleOpenChange(false);\n }\n }, [isDismissable, handleOpenChange]);\n\n // Register overlay panel with Layout context for coordinated dismissal\n const { registerOverlayPanel } = layoutActions;\n\n useEffect(() => {\n // Only register if in overlay mode, open, and dismissable\n if (isOverlayMode && isOpen && isDismissable) {\n const unregister = registerOverlayPanel(() => handleOpenChange(false));\n return unregister;\n }\n }, [\n isOverlayMode,\n isOpen,\n isDismissable,\n registerOverlayPanel,\n handleOpenChange,\n ]);\n\n const handleDialogOpenChange = useCallback(\n (newIsOpen: boolean) => {\n setInternalIsDialogOpen(newIsOpen);\n onDialogOpenChange?.(newIsOpen);\n },\n [onDialogOpenChange],\n );\n\n // Panel context value for child components (like LayoutPanelHeader)\n const panelContextValue = useMemo(\n () => ({\n onOpenChange: handleOpenChange,\n isOpen,\n }),\n [handleOpenChange, isOpen],\n );\n\n // Dialog mode context value - uses dialog state instead of panel state\n const dialogPanelContextValue = useMemo(\n () => ({\n onOpenChange: handleDialogOpenChange,\n isOpen: dialogOpen,\n }),\n [handleDialogOpenChange, dialogOpen],\n );\n\n const panelMods = useMemo(\n () => ({\n side,\n drag: isDragging,\n horizontal: isHorizontal,\n // Only enable transition after layout is ready to prevent initial animation\n 'has-transition': hasTransition && isReady,\n ...mods,\n }),\n [side, isDragging, isHorizontal, hasTransition, isReady, mods],\n );\n\n // Build --max-size CSS variable combining user maxSize and natural boundary\n const maxSizeCss = useMemo(() => {\n const parts: string[] = [];\n\n if (maxSize != null) {\n parts.push(typeof maxSize === 'number' ? `${maxSize}px` : maxSize);\n }\n\n if (containerDimension > 0 && Number.isFinite(naturalMax)) {\n parts.push(`${naturalMax}px`);\n }\n\n if (parts.length === 0) return undefined;\n return parts.length === 1 ? parts[0] : `min(${parts.join(', ')})`;\n }, [maxSize, naturalMax, containerDimension]);\n\n const panelStyle = useMemo(\n () => ({\n '--panel-size': `${size}px`,\n '--min-size': typeof minSize === 'number' ? `${minSize}px` : minSize,\n '--max-size': maxSizeCss,\n }),\n [size, minSize, maxSizeCss],\n );\n\n // Combine refs for panel element\n const panelRefCallback = useCallback(\n (node: HTMLDivElement | null, transitionRef?: RefCallback<HTMLElement>) => {\n // Update the combined ref\n (combinedRef as { current: HTMLDivElement | null }).current = node;\n // Call transition ref if provided\n transitionRef?.(node);\n },\n [combinedRef],\n );\n\n // Reset to default size on double-click\n const handleResetSize = useCallback(() => {\n const resetSize =\n typeof defaultSize === 'number' ? defaultSize : parseInt(defaultSize, 10);\n const clampedSize = clampValue(resetSize || 280);\n setSize(clampedSize);\n onSizeChange?.(clampedSize);\n setStoredSize(clampedSize);\n }, [defaultSize, clampValue, onSizeChange, setStoredSize]);\n\n const renderPanelContent = (\n offscreen = false,\n transitionRef?: RefCallback<HTMLElement>,\n ) => {\n const showOverlay = isOverlayMode && !offscreen;\n\n return (\n <>\n {/* Overlay backdrop for overlay mode */}\n {isOverlayMode && (\n <OverlayBackdrop\n mods={{ visible: showOverlay }}\n styles={overlayStyles}\n aria-hidden=\"true\"\n onClick={handleDismiss}\n />\n )}\n <PanelElement\n ref={(node: HTMLDivElement | null) =>\n panelRefCallback(node, transitionRef)\n }\n {...filterBaseProps(otherProps, { eventProps: true })}\n mods={{ ...panelMods, offscreen }}\n styles={finalStyles}\n style={panelStyle}\n data-side={side}\n >\n <LayoutPanelContext.Provider value={panelContextValue}>\n <LayoutContextReset>{children}</LayoutContextReset>\n </LayoutPanelContext.Provider>\n </PanelElement>\n {isResizable && (\n <ResizeHandler\n side={side}\n isDisabled={!isResizable}\n mods={{\n drag: isDragging,\n offscreen,\n 'has-transition': hasTransition && isReady,\n }}\n moveProps={moveProps}\n style={panelStyle}\n onDoubleClick={handleResetSize}\n />\n )}\n </>\n );\n };\n\n // Dialog mode - uses its own portal via DialogContainer\n if (isDialogMode) {\n return (\n <DialogContainer\n isOpen={dialogOpen}\n isDismissable={isDismissable}\n onDismiss={() => handleDialogOpenChange(false)}\n {...dialogProps}\n >\n <Dialog isDismissable={false}>\n <LayoutPanelContext.Provider value={dialogPanelContextValue}>\n <LayoutContextReset>{children}</LayoutContextReset>\n </LayoutPanelContext.Provider>\n </Dialog>\n </DialogContainer>\n );\n }\n\n // Wait for portal container to be ready before rendering\n if (!layoutRefs.isPanelContainerReady) {\n return null;\n }\n\n const portalContainer = layoutRefs.panelContainerRef.current!;\n\n // Panel with transition - portal to panel container\n if (hasTransition) {\n return createPortal(\n <DisplayTransition\n isShown={isOpen}\n animateOnMount={false}\n onToggle={(isShown) => setVisualState({ isShown, isTransitionActive })}\n >\n {({ isShown, isExiting, ref: transitionRef }) => (\n <LayoutPanelTransition isShown={isShown} isExiting={isExiting}>\n {renderPanelContent(!isShown, transitionRef)}\n </LayoutPanelTransition>\n )}\n </DisplayTransition>,\n portalContainer,\n );\n }\n\n // Simple panel (no transition) - portal to panel container\n if (!isOpen) return null;\n\n return createPortal(renderPanelContent(false), portalContainer);\n}\n\nconst _LayoutPanel = forwardRef(LayoutPanel);\n\n_LayoutPanel.displayName = 'Layout.Panel';\n\nexport { _LayoutPanel as LayoutPanel };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmDA,MAAMyC,gBAAgB;AAEtB,MAAMC,iBAAiB;AAEvB,MAAMC,yBAAyB;AAE/B,MAAMC,eAAetC,MAAM;CACzBuC,IAAI;CACJC,IAAI;CACJC,QAAQ;EACNC,WAAW;EACXC,UAAU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AAAA,WAASgF,WAAWnH,KAAKyG,sBAC3B,oBAAC;GAAsB,SAAStE;GAAoBgF;aACjDL,mBAAmB,CAAC3E,WAASsE,gBAAc;IAE/C;GACiB,EACpBS,gBACD;AAIH,KAAI,CAACvI,OAAQ,QAAO;AAEpB,QAAOxG,aAAa2O,mBAAmB,MAAM,EAAEI,gBAAgB;;AAGjE,MAAME,eAAe9P,WAAWyI,YAAY;AAE5CqH,aAAaC,cAAc"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-
|
|
1
|
+
/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-f53c097 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../../utils/styles.js";
|
|
3
3
|
import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
|
|
4
4
|
import { _Item } from "../Item/Item.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-f53c097 | Cube Dev Team */
|
|
2
2
|
import { LayoutPanelTransitionContext, useLayoutRefsContext } from "./LayoutContext.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useContext, useLayoutEffect, 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-f53c097 | 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-f53c097 | Cube Dev Team */
|
|
2
2
|
import { LayoutActionsContext, LayoutContextReset, LayoutPanelContext, LayoutRefsContext, LayoutStateContext, useLayoutActionsContext, useLayoutPanelContext, useLayoutRefsContext, useLayoutStateContext } from "./LayoutContext.js";
|
|
3
3
|
import { _Layout } from "./Layout.js";
|
|
4
4
|
import { _LayoutContent } from "./LayoutContent.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-f53c097 | Cube Dev Team */
|
|
2
2
|
import { extractStyles } from "../../utils/styles.js";
|
|
3
3
|
import { _Text } from "./Text.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-f53c097 | Cube Dev Team */
|
|
2
2
|
import { extractStyles, mergeStyleLayers } from "../../../utils/styles.js";
|
|
3
3
|
import { useI18n } from "../../../i18n/useI18n.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-f53c097 | Cube Dev Team */
|
|
2
2
|
import { RendererPrism, ensureYamlSqlExtensions } from "./prismSetup.js";
|
|
3
3
|
import { CONTAINER_STYLES, tasty } from "@tenphi/tasty";
|
|
4
4
|
import { forwardRef } 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-f53c097 | Cube Dev Team */
|
|
2
2
|
import { Prism as RendererPrism } from "prism-react-renderer";
|
|
3
3
|
|
|
4
4
|
//#region src/components/content/PrismCode/prismSetup.tsx
|