@cube-dev/ui-kit 0.0.0-canary-b3fed8f → 0.0.0-canary-77836fa

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.
Files changed (587) hide show
  1. package/dist/_internal/hooks/use-debounced-value.js +1 -1
  2. package/dist/_internal/hooks/use-deprecation-warning.js +1 -1
  3. package/dist/_internal/hooks/use-event.js +1 -1
  4. package/dist/_internal/hooks/use-is-first-render.js +1 -1
  5. package/dist/_internal/hooks/use-sync-ref.js +1 -1
  6. package/dist/_internal/hooks/use-timer/timer.js +1 -1
  7. package/dist/_internal/hooks/use-timer/use-timer.js +1 -1
  8. package/dist/_internal/hooks/use-warn.js +1 -1
  9. package/dist/components/Block.js +1 -1
  10. package/dist/components/CollectionItem.js +1 -1
  11. package/dist/components/GlobalStyles.js +1 -1
  12. package/dist/components/GridProvider.js +1 -1
  13. package/dist/components/HiddenInput.js +1 -1
  14. package/dist/components/Root.js +1 -1
  15. package/dist/components/actions/Action/Action.js +1 -1
  16. package/dist/components/actions/Banner/Banner.js +1 -1
  17. package/dist/components/actions/Button/Button.js +1 -1
  18. package/dist/components/actions/ButtonGroup/ButtonGroup.js +1 -1
  19. package/dist/components/actions/ButtonSplit/ButtonSplit.d.ts +9 -4
  20. package/dist/components/actions/ButtonSplit/ButtonSplit.js +1 -1
  21. package/dist/components/actions/ButtonSplit/ButtonSplit.js.map +1 -1
  22. package/dist/components/actions/ButtonSplit/context.js +1 -1
  23. package/dist/components/actions/CommandMenu/CommandMenu.js +1 -1
  24. package/dist/components/actions/CommandMenu/styled.js +1 -1
  25. package/dist/components/actions/ItemAction/ItemAction.js +1 -1
  26. package/dist/components/actions/ItemActionContext.js +1 -1
  27. package/dist/components/actions/ItemActionsWrapper.js +1 -1
  28. package/dist/components/actions/ItemButton/ItemButton.js +1 -1
  29. package/dist/components/actions/Link/Link.js +1 -1
  30. package/dist/components/actions/Menu/Menu.js +1 -1
  31. package/dist/components/actions/Menu/MenuCollectionItem.js +1 -1
  32. package/dist/components/actions/Menu/MenuItem.js +1 -1
  33. package/dist/components/actions/Menu/MenuSection.js +1 -1
  34. package/dist/components/actions/Menu/MenuTrigger.js +1 -1
  35. package/dist/components/actions/Menu/SubMenuTrigger.js +1 -1
  36. package/dist/components/actions/Menu/SubmenuTriggerContext.js +1 -1
  37. package/dist/components/actions/Menu/context.js +1 -1
  38. package/dist/components/actions/Menu/styled.js +1 -1
  39. package/dist/components/actions/actions-run.js +1 -1
  40. package/dist/components/actions/index.js +1 -1
  41. package/dist/components/actions/use-action.js +1 -1
  42. package/dist/components/actions/use-anchored-menu.js +1 -1
  43. package/dist/components/actions/use-context-menu.js +1 -1
  44. package/dist/components/content/ActiveZone/ActiveZone.js +1 -1
  45. package/dist/components/content/Alert/Alert.js +1 -1
  46. package/dist/components/content/Alert/use-alert.js +1 -1
  47. package/dist/components/content/Avatar/Avatar.js +1 -1
  48. package/dist/components/content/Badge/Badge.js +1 -1
  49. package/dist/components/content/Card/Card.js +1 -1
  50. package/dist/components/content/Content.js +1 -1
  51. package/dist/components/content/CopyPasteBlock/CopyPasteBlock.js +1 -1
  52. package/dist/components/content/CopySnippet/CopySnippet.d.ts +4 -4
  53. package/dist/components/content/CopySnippet/CopySnippet.js +1 -1
  54. package/dist/components/content/Disclosure/Disclosure.js +1 -1
  55. package/dist/components/content/Divider.js +1 -1
  56. package/dist/components/content/Footer.js +1 -1
  57. package/dist/components/content/Header.js +1 -1
  58. package/dist/components/content/HotKeys/HotKeys.js +1 -1
  59. package/dist/components/content/InfoBadge/InfoBadge.js +1 -1
  60. package/dist/components/content/InlineInput/InlineInput.js +1 -1
  61. package/dist/components/content/Item/Item.js +1 -1
  62. package/dist/components/content/Item/ItemWithNativeLinks.js +1 -1
  63. package/dist/components/content/ItemBadge/ItemBadge.js +1 -1
  64. package/dist/components/content/ItemCard/ItemCard.js +1 -1
  65. package/dist/components/content/Layout/GridLayout.js +1 -1
  66. package/dist/components/content/Layout/Layout.js +2 -1
  67. package/dist/components/content/Layout/Layout.js.map +1 -1
  68. package/dist/components/content/Layout/LayoutBlock.js +1 -1
  69. package/dist/components/content/Layout/LayoutCenter.js +1 -1
  70. package/dist/components/content/Layout/LayoutContainer.js +1 -1
  71. package/dist/components/content/Layout/LayoutContent.js +1 -1
  72. package/dist/components/content/Layout/LayoutContext.js +1 -1
  73. package/dist/components/content/Layout/LayoutFlex.js +1 -1
  74. package/dist/components/content/Layout/LayoutFooter.js +1 -1
  75. package/dist/components/content/Layout/LayoutGrid.js +1 -1
  76. package/dist/components/content/Layout/LayoutHeader.js +1 -1
  77. package/dist/components/content/Layout/LayoutPane.js +1 -1
  78. package/dist/components/content/Layout/LayoutPanel.d.ts +4 -2
  79. package/dist/components/content/Layout/LayoutPanel.js +73 -2
  80. package/dist/components/content/Layout/LayoutPanel.js.map +1 -1
  81. package/dist/components/content/Layout/LayoutPanelHeader.js +1 -1
  82. package/dist/components/content/Layout/LayoutPanelTransition.js +1 -1
  83. package/dist/components/content/Layout/LayoutToolbar.js +1 -1
  84. package/dist/components/content/Layout/hooks/useTinyScrollbar.js +1 -1
  85. package/dist/components/content/Layout/index.js +1 -1
  86. package/dist/components/content/Layout/utils.js +1 -1
  87. package/dist/components/content/Paragraph.js +1 -1
  88. package/dist/components/content/Placeholder/Placeholder.js +1 -1
  89. package/dist/components/content/PrismCode/PrismCode.js +1 -1
  90. package/dist/components/content/PrismCode/prismSetup.js +1 -1
  91. package/dist/components/content/PrismDiffCode/PrismDiffCode.js +1 -1
  92. package/dist/components/content/Result/Result.js +1 -1
  93. package/dist/components/content/Skeleton/Skeleton.js +1 -1
  94. package/dist/components/content/Tag/Tag.js +1 -1
  95. package/dist/components/content/Text.js +1 -1
  96. package/dist/components/content/TextItem/TextItem.js +1 -1
  97. package/dist/components/content/Title.js +1 -1
  98. package/dist/components/content/Tree/Tree.js +1 -1
  99. package/dist/components/content/Tree/TreeNode.js +1 -1
  100. package/dist/components/content/Tree/styled.js +1 -1
  101. package/dist/components/content/Tree/tree-index.js +1 -1
  102. package/dist/components/content/Tree/use-checkbox-tree.js +1 -1
  103. package/dist/components/content/Tree/use-load-data.js +1 -1
  104. package/dist/components/content/highlightText.js +1 -1
  105. package/dist/components/content/use-auto-tooltip.js +1 -1
  106. package/dist/components/data/DataTable/DataTable.js +1 -1
  107. package/dist/components/data/ItemTable/ItemTable.js +1 -1
  108. package/dist/components/data/ItemTable/ItemTableBulkBar.js +1 -1
  109. package/dist/components/data/ItemTable/ItemTableDragPreview.js +1 -1
  110. package/dist/components/data/ItemTable/ItemTableFooter.js +1 -1
  111. package/dist/components/data/ItemTable/ItemTableToolbar.js +1 -1
  112. package/dist/components/data/ItemTable/use-item-table-column-widths.js +1 -1
  113. package/dist/components/data/ItemTable/use-item-table-drag-drop.js +1 -1
  114. package/dist/components/data/ItemTable/use-item-table-pagination.js +1 -1
  115. package/dist/components/data/ItemTable/use-item-table-selection.js +1 -1
  116. package/dist/components/data/ItemTable/use-item-table-sort.js +1 -1
  117. package/dist/components/data/ItemTable/use-item-table-tree-model.js +1 -1
  118. package/dist/components/data/TableBase/ColumnResizer.js +1 -1
  119. package/dist/components/data/TableBase/RowCollection.js +1 -1
  120. package/dist/components/data/TableBase/TableHeaderCell.js +1 -1
  121. package/dist/components/data/TableBase/TableRow.js +1 -1
  122. package/dist/components/data/TableBase/TableView.js +1 -1
  123. package/dist/components/data/TableBase/TreeGridTable.js +1 -1
  124. package/dist/components/data/TableBase/column-header.js +1 -1
  125. package/dist/components/data/TableBase/column-menu.js +1 -1
  126. package/dist/components/data/TableBase/column-styles.js +1 -1
  127. package/dist/components/data/TableBase/column-tint.js +1 -1
  128. package/dist/components/data/TableBase/row-menu.js +1 -1
  129. package/dist/components/data/TableBase/styled.js +1 -1
  130. package/dist/components/data/TableBase/table-tree.js +1 -1
  131. package/dist/components/data/TableBase/types.js +1 -1
  132. package/dist/components/data/TableBase/use-cell-selection.js +0 -0
  133. package/dist/components/data/TableBase/use-column-menu.js +1 -1
  134. package/dist/components/data/TableBase/use-column-order.js +1 -1
  135. package/dist/components/data/TableBase/use-column-window.js +1 -1
  136. package/dist/components/data/TableBase/use-container-width.js +1 -1
  137. package/dist/components/data/TableBase/use-row-move-animation.js +1 -1
  138. package/dist/components/data/TableBase/use-scrollability.js +1 -1
  139. package/dist/components/data/TableBase/use-table-columns.js +1 -1
  140. package/dist/components/data/TableBase/use-table-search.js +1 -1
  141. package/dist/components/data/TableBase/use-table-selection.js +1 -1
  142. package/dist/components/data/TableBase/use-table-sort.js +1 -1
  143. package/dist/components/data/TableBase/use-table-sorts.js +1 -1
  144. package/dist/components/data/TableBase/use-table-storage.js +1 -1
  145. package/dist/components/data/TableBase/use-table-tooltip-refresh.js +1 -1
  146. package/dist/components/data/TableBase/use-table-tree-state.js +1 -1
  147. package/dist/components/fields/Checkbox/Checkbox.js +1 -1
  148. package/dist/components/fields/Checkbox/CheckboxGroup.js +1 -1
  149. package/dist/components/fields/Checkbox/context.js +1 -1
  150. package/dist/components/fields/ColorInput/ColorInput.js +1 -1
  151. package/dist/components/fields/ColorPicker/ColorPicker.js +1 -1
  152. package/dist/components/fields/ColorSwatch/ColorSwatch.js +1 -1
  153. package/dist/components/fields/ColorSwatchGroup/ColorSwatchGroup.js +1 -1
  154. package/dist/components/fields/ComboBox/ComboBox.d.ts +1 -1
  155. package/dist/components/fields/ComboBox/ComboBox.js +13 -13
  156. package/dist/components/fields/ComboBox/ComboBox.js.map +1 -1
  157. package/dist/components/fields/CommandTextArea/CommandTextArea.js +1 -1
  158. package/dist/components/fields/CommandTextArea/caretPosition.js +1 -1
  159. package/dist/components/fields/CommandTextArea/useCaretAnchor.js +1 -1
  160. package/dist/components/fields/DatePicker/DateInput.js +1 -1
  161. package/dist/components/fields/DatePicker/DateInputBase.js +1 -1
  162. package/dist/components/fields/DatePicker/DatePicker.js +1 -1
  163. package/dist/components/fields/DatePicker/DatePickerButton.js +1 -1
  164. package/dist/components/fields/DatePicker/DatePickerElement.js +1 -1
  165. package/dist/components/fields/DatePicker/DatePickerInput.js +1 -1
  166. package/dist/components/fields/DatePicker/DatePickerSegment.js +1 -1
  167. package/dist/components/fields/DatePicker/DateRangePicker.js +1 -1
  168. package/dist/components/fields/DatePicker/DateRangeSeparatedPicker.js +1 -1
  169. package/dist/components/fields/DatePicker/MonthPicker.js +1 -1
  170. package/dist/components/fields/DatePicker/PeriodPicker.js +1 -1
  171. package/dist/components/fields/DatePicker/QuarterPicker.js +1 -1
  172. package/dist/components/fields/DatePicker/TimeInput.js +1 -1
  173. package/dist/components/fields/DatePicker/WeekPicker.js +1 -1
  174. package/dist/components/fields/DatePicker/YearPicker.js +1 -1
  175. package/dist/components/fields/DatePicker/parseDate.js +1 -1
  176. package/dist/components/fields/DatePicker/period.js +1 -1
  177. package/dist/components/fields/DatePicker/props.js +1 -1
  178. package/dist/components/fields/DatePicker/utils.js +1 -1
  179. package/dist/components/fields/FileInput/FileInput.js +1 -1
  180. package/dist/components/fields/FilterListBox/FilterListBox.js +1 -1
  181. package/dist/components/fields/FilterPicker/FilterPicker.js +1 -1
  182. package/dist/components/fields/Input/Input.js +1 -1
  183. package/dist/components/fields/ListBox/DraggableListBox.js +1 -1
  184. package/dist/components/fields/ListBox/ListBox.js +1 -1
  185. package/dist/components/fields/ListBox/optionId.js +1 -1
  186. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js +147 -140
  187. package/dist/components/fields/ListBoxPopover/ListBoxPopover.js.map +1 -1
  188. package/dist/components/fields/ListBoxPopover/listNavigation.js +1 -1
  189. package/dist/components/fields/ListBoxPopover/useCompositeFocus.js +1 -1
  190. package/dist/components/fields/NumberInput/NumberInput.js +1 -1
  191. package/dist/components/fields/NumberInput/StepButton.js +1 -1
  192. package/dist/components/fields/PasswordInput/PasswordInput.js +1 -1
  193. package/dist/components/fields/Picker/Picker.js +1 -1
  194. package/dist/components/fields/RadioGroup/Radio.d.ts +4 -4
  195. package/dist/components/fields/RadioGroup/Radio.js +1 -1
  196. package/dist/components/fields/RadioGroup/RadioGroup.js +1 -1
  197. package/dist/components/fields/RadioGroup/context.js +1 -1
  198. package/dist/components/fields/SearchComboBox/SearchComboBox.js +1 -1
  199. package/dist/components/fields/SearchInput/SearchInput.js +1 -1
  200. package/dist/components/fields/Select/Select.js +1 -1
  201. package/dist/components/fields/Slider/Gradation.js +1 -1
  202. package/dist/components/fields/Slider/HueSlider.js +1 -1
  203. package/dist/components/fields/Slider/RangeSlider.js +1 -1
  204. package/dist/components/fields/Slider/Slider.js +1 -1
  205. package/dist/components/fields/Slider/SliderBase.js +1 -1
  206. package/dist/components/fields/Slider/SliderThumb.js +1 -1
  207. package/dist/components/fields/Slider/SliderTrack.js +1 -1
  208. package/dist/components/fields/Slider/elements.js +1 -1
  209. package/dist/components/fields/Slider/index.js +1 -1
  210. package/dist/components/fields/Switch/Switch.js +1 -1
  211. package/dist/components/fields/TagInput/TagInput.js +1 -2
  212. package/dist/components/fields/TagInput/TagInput.js.map +1 -1
  213. package/dist/components/fields/TagInput/TagList.js +1 -1
  214. package/dist/components/fields/TagInput/useActiveOption.js +1 -1
  215. package/dist/components/fields/TagInput/useTagError.js +1 -1
  216. package/dist/components/fields/TextArea/TextArea.js +1 -1
  217. package/dist/components/fields/TextInput/TextInput.js +1 -1
  218. package/dist/components/fields/TextInput/TextInputBase.js +1 -1
  219. package/dist/components/fields/TextInput/useAutoSizeTextArea.js +1 -1
  220. package/dist/components/fields/TextInputMapper/TextInputMapper.js +1 -1
  221. package/dist/components/fields/TriggerActions.js +1 -1
  222. package/dist/components/fields/color/ColorPanel.js +1 -1
  223. package/dist/components/fields/color/channels.js +1 -1
  224. package/dist/components/fields/color/color.js +1 -1
  225. package/dist/components/fields/color/context.js +1 -1
  226. package/dist/components/form/FieldWrapper/FieldWrapper.js +1 -1
  227. package/dist/components/form/FieldWrapper/field-description.js +1 -1
  228. package/dist/components/form/Form/Field.js +1 -1
  229. package/dist/components/form/Form/Form.js +1 -1
  230. package/dist/components/form/Form/ModernFormRoot.js +1 -1
  231. package/dist/components/form/Form/ResetButton/ResetButton.js +1 -1
  232. package/dist/components/form/Form/SubmitButton/SubmitButton.js +1 -1
  233. package/dist/components/form/Form/SubmitError.js +1 -1
  234. package/dist/components/form/Form/backend.js +1 -1
  235. package/dist/components/form/Form/index.js +1 -1
  236. package/dist/components/form/Form/modern/actions.js +1 -1
  237. package/dist/components/form/Form/modern/context.js +1 -1
  238. package/dist/components/form/Form/modern/controller.js +1 -1
  239. package/dist/components/form/Form/modern/field-binding.js +1 -1
  240. package/dist/components/form/Form/modern/field.js +1 -1
  241. package/dist/components/form/Form/modern/react.js +1 -1
  242. package/dist/components/form/Form/modern/store.js +1 -1
  243. package/dist/components/form/Form/modern/validation.js +1 -1
  244. package/dist/components/form/Form/modern/values.js +1 -1
  245. package/dist/components/form/Form/reset-unbound-controls.js +1 -1
  246. package/dist/components/form/Form/use-field/use-field-binding.js +1 -1
  247. package/dist/components/form/Form/use-field/use-field-props.js +1 -1
  248. package/dist/components/form/Form/use-field/use-field.js +1 -1
  249. package/dist/components/form/Form/use-form.js +1 -1
  250. package/dist/components/form/Form/validation.js +1 -1
  251. package/dist/components/form/Label.js +1 -1
  252. package/dist/components/form/field-chrome.js +1 -1
  253. package/dist/components/form/legacy-tooltip.js +1 -1
  254. package/dist/components/form/validation/ValidationIndicator.js +1 -1
  255. package/dist/components/form/validation/resolve-validation-props.js +1 -1
  256. package/dist/components/form/validation/use-validation-props.js +1 -1
  257. package/dist/components/form/wrapper.js +1 -1
  258. package/dist/components/helpers/DisplayTransition/DisplayTransition.js +1 -1
  259. package/dist/components/helpers/IconSwitch/IconSwitch.js +1 -1
  260. package/dist/components/layout/Flex.js +1 -1
  261. package/dist/components/layout/Flow.js +1 -1
  262. package/dist/components/layout/Grid.js +1 -1
  263. package/dist/components/layout/Panel.js +1 -1
  264. package/dist/components/layout/Prefix.js +1 -1
  265. package/dist/components/layout/ResizablePanel.js +1 -1
  266. package/dist/components/layout/Space.js +1 -1
  267. package/dist/components/layout/Suffix.js +1 -1
  268. package/dist/components/navigation/Pagination/Pagination.js +1 -1
  269. package/dist/components/navigation/Pagination/use-pagination.js +1 -1
  270. package/dist/components/navigation/Tabs/BoardDragActiveProvider.js +1 -1
  271. package/dist/components/navigation/Tabs/DraggableTabList.js +1 -1
  272. package/dist/components/navigation/Tabs/TabButton.js +1 -1
  273. package/dist/components/navigation/Tabs/TabDropIndicator.js +1 -1
  274. package/dist/components/navigation/Tabs/TabPanel.js +1 -1
  275. package/dist/components/navigation/Tabs/TabPicker.js +1 -1
  276. package/dist/components/navigation/Tabs/Tabs.js +1 -1
  277. package/dist/components/navigation/Tabs/TabsAction.js +1 -1
  278. package/dist/components/navigation/Tabs/TabsContext.js +1 -1
  279. package/dist/components/navigation/Tabs/popover-placement.js +1 -1
  280. package/dist/components/navigation/Tabs/styled.js +1 -1
  281. package/dist/components/navigation/Tabs/types.js +1 -1
  282. package/dist/components/navigation/Tabs/use-tab-editing.js +1 -1
  283. package/dist/components/navigation/Tabs/use-tab-indicator.js +1 -1
  284. package/dist/components/organisms/StatsCard/StatsCard.js +1 -1
  285. package/dist/components/other/Calendar/Calendar.js +1 -1
  286. package/dist/components/other/Calendar/CalendarCell.js +1 -1
  287. package/dist/components/other/Calendar/CalendarGrid.js +1 -1
  288. package/dist/components/other/Calendar/CalendarHeader.js +1 -1
  289. package/dist/components/other/Calendar/CalendarPanel.js +1 -1
  290. package/dist/components/other/Calendar/PeriodCalendar.js +1 -1
  291. package/dist/components/other/Calendar/PeriodGrid.js +1 -1
  292. package/dist/components/other/Calendar/RangeCalendar.js +1 -1
  293. package/dist/components/other/Calendar/styled.js +1 -1
  294. package/dist/components/other/CubeLogo/CubeLogo.js +1 -1
  295. package/dist/components/other/NoDataIcon/NoDataIcon.js +1 -1
  296. package/dist/components/overlays/AlertDialog/AlertDialog.js +1 -1
  297. package/dist/components/overlays/AlertDialog/AlertDialogApiProvider.js +1 -1
  298. package/dist/components/overlays/AlertDialog/AlertDialogZone.js +1 -1
  299. package/dist/components/overlays/Dialog/Dialog.js +1 -1
  300. package/dist/components/overlays/Dialog/DialogContainer.js +1 -1
  301. package/dist/components/overlays/Dialog/DialogForm.js +1 -1
  302. package/dist/components/overlays/Dialog/DialogTrigger.js +1 -1
  303. package/dist/components/overlays/Dialog/ModernDialogForm.js +1 -1
  304. package/dist/components/overlays/Dialog/context.js +1 -1
  305. package/dist/components/overlays/Dialog/default-button-text.js +1 -1
  306. package/dist/components/overlays/Dialog/use-content-overflow.js +1 -1
  307. package/dist/components/overlays/Dialog/use-dialog-container.js +1 -1
  308. package/dist/components/overlays/Modal/Modal.js +1 -1
  309. package/dist/components/overlays/Modal/OpenTransitionContext.js +1 -1
  310. package/dist/components/overlays/Modal/Overlay.js +7 -2
  311. package/dist/components/overlays/Modal/Overlay.js.map +1 -1
  312. package/dist/components/overlays/Modal/Popover.js +31 -29
  313. package/dist/components/overlays/Modal/Popover.js.map +1 -1
  314. package/dist/components/overlays/Modal/Tray.js +2 -1
  315. package/dist/components/overlays/Modal/Tray.js.map +1 -1
  316. package/dist/components/overlays/Modal/Underlay.js +1 -1
  317. package/dist/components/overlays/Modal/modal-containment.js +1 -1
  318. package/dist/components/overlays/Notifications/Notification.js +1 -1
  319. package/dist/components/overlays/Notifications/NotificationAction.js +1 -1
  320. package/dist/components/overlays/Notifications/NotificationCard.js +1 -1
  321. package/dist/components/overlays/Notifications/NotificationContext.js +1 -1
  322. package/dist/components/overlays/Notifications/NotificationItem.js +1 -1
  323. package/dist/components/overlays/Notifications/OverlayContainer.js +18 -32
  324. package/dist/components/overlays/Notifications/OverlayContainer.js.map +1 -1
  325. package/dist/components/overlays/Notifications/OverlayProvider.js +1 -1
  326. package/dist/components/overlays/Notifications/PersistentNotificationsList.js +1 -1
  327. package/dist/components/overlays/Notifications/dismissed-storage.js +1 -1
  328. package/dist/components/overlays/Notifications/format-relative-time.js +1 -1
  329. package/dist/components/overlays/Notifications/index.js +1 -1
  330. package/dist/components/overlays/Notifications/use-notification-state.js +1 -1
  331. package/dist/components/overlays/Notifications/use-notifications.js +1 -1
  332. package/dist/components/overlays/Notifications/use-overlay-timers.js +1 -1
  333. package/dist/components/overlays/Notifications/use-persistent-notifications.js +1 -1
  334. package/dist/components/overlays/Notifications/use-persistent-state.js +1 -1
  335. package/dist/components/overlays/Notifications/use-toast-state.js +1 -1
  336. package/dist/components/overlays/Toast/ToastItem.js +1 -1
  337. package/dist/components/overlays/Toast/index.js +1 -1
  338. package/dist/components/overlays/Toast/useProgressToast.js +1 -1
  339. package/dist/components/overlays/Toast/useToast.js +1 -1
  340. package/dist/components/overlays/Tooltip/Tooltip.js +1 -1
  341. package/dist/components/overlays/Tooltip/TooltipProvider.js +1 -1
  342. package/dist/components/overlays/Tooltip/TooltipTrigger.js +1 -1
  343. package/dist/components/overlays/Tooltip/context.js +1 -1
  344. package/dist/components/overlays/Tooltip/split-trigger-props.js +1 -1
  345. package/dist/components/portal/Portal.js +1 -1
  346. package/dist/components/portal/PortalProvider.js +1 -1
  347. package/dist/components/portal/usePortal.js +1 -1
  348. package/dist/components/shared/DraggableCollection.js +1 -1
  349. package/dist/components/shared/InvalidIcon.js +1 -1
  350. package/dist/components/shared/ValidIcon.js +1 -1
  351. package/dist/components/status/LoadingAnimation/LoadingAnimation.js +1 -1
  352. package/dist/components/status/Spin/Cube.js +1 -1
  353. package/dist/components/status/Spin/InternalSpinner.js +1 -1
  354. package/dist/components/status/Spin/Spin.js +1 -1
  355. package/dist/components/status/Spin/SpinsContainer.js +1 -1
  356. package/dist/data/item-themes.js +1 -1
  357. package/dist/data/themes.js +1 -1
  358. package/dist/eslint-plugin/defaults.generated.js +1 -1
  359. package/dist/eslint-plugin/index.js +1 -1
  360. package/dist/eslint-plugin/rules/no-redundant-default-prop.js +1 -1
  361. package/dist/i18n/I18nProvider.js +1 -1
  362. package/dist/i18n/createFormatter.js +1 -1
  363. package/dist/i18n/index.js +1 -1
  364. package/dist/i18n/instance.js +1 -1
  365. package/dist/i18n/locales/de-DE/uikit.js +1 -1
  366. package/dist/i18n/locales/en-US/uikit.js +1 -1
  367. package/dist/i18n/locales/es-ES/uikit.js +1 -1
  368. package/dist/i18n/locales/es-MX/uikit.js +1 -1
  369. package/dist/i18n/locales/fr-FR/uikit.js +1 -1
  370. package/dist/i18n/locales/it-IT/uikit.js +1 -1
  371. package/dist/i18n/locales/ja-JP/uikit.js +1 -1
  372. package/dist/i18n/locales/nb-NO/uikit.js +1 -1
  373. package/dist/i18n/locales/pt-BR/uikit.js +1 -1
  374. package/dist/i18n/locales/pt-PT/uikit.js +1 -1
  375. package/dist/i18n/locales/sv-SE/uikit.js +1 -1
  376. package/dist/i18n/locales/vi-VN/uikit.js +1 -1
  377. package/dist/i18n/locales.js +1 -1
  378. package/dist/i18n/namespace.js +1 -1
  379. package/dist/i18n/useFormatter.js +1 -1
  380. package/dist/i18n/useI18n.js +1 -1
  381. package/dist/icons/AdjustmentsHorizontalIcon.js +1 -1
  382. package/dist/icons/AdjustmentsIcon.js +1 -1
  383. package/dist/icons/AiIcon.js +1 -1
  384. package/dist/icons/AreaChartIcon.js +1 -1
  385. package/dist/icons/ArrowNarrowDownIcon.js +1 -1
  386. package/dist/icons/ArrowNarrowUpIcon.js +1 -1
  387. package/dist/icons/BackwardIcon.js +1 -1
  388. package/dist/icons/BarChartIcon.js +1 -1
  389. package/dist/icons/BellFilledIcon.js +1 -1
  390. package/dist/icons/BellIcon.js +1 -1
  391. package/dist/icons/BooleanIcon.js +1 -1
  392. package/dist/icons/CalendarEditIcon.js +1 -1
  393. package/dist/icons/CalendarIcon.js +1 -1
  394. package/dist/icons/CaretDownIcon.js +1 -1
  395. package/dist/icons/CaretUpIcon.js +1 -1
  396. package/dist/icons/ChartAreaStackedIcon.js +1 -1
  397. package/dist/icons/ChartAreaStackedPercentageIcon.js +1 -1
  398. package/dist/icons/ChartBarGroupedHorizontalIcon.js +1 -1
  399. package/dist/icons/ChartBarGroupedIcon.js +1 -1
  400. package/dist/icons/ChartBarHorizontalIcon.js +1 -1
  401. package/dist/icons/ChartBarLineIcon.js +1 -1
  402. package/dist/icons/ChartBarStackedHorizontalIcon.js +1 -1
  403. package/dist/icons/ChartBarStackedIcon.js +1 -1
  404. package/dist/icons/ChartBarStackedPercentageHorizontalIcon.js +1 -1
  405. package/dist/icons/ChartBarStackedPercentageIcon.js +1 -1
  406. package/dist/icons/ChartBoxPlot2Icon.js +1 -1
  407. package/dist/icons/ChartBoxPlotIcon.js +1 -1
  408. package/dist/icons/ChartBubbleIcon.js +1 -1
  409. package/dist/icons/ChartDonut2Icon.js +1 -1
  410. package/dist/icons/ChartFunnelIcon.js +1 -1
  411. package/dist/icons/ChartHeatmapIcon.js +1 -1
  412. package/dist/icons/ChartKPIIcon.js +1 -1
  413. package/dist/icons/ChartPie2Icon.js +1 -1
  414. package/dist/icons/ChartScatterIcon.js +1 -1
  415. package/dist/icons/CheckCircleFilledIcon.js +1 -1
  416. package/dist/icons/CheckCircleIcon.js +1 -1
  417. package/dist/icons/CheckIcon.js +1 -1
  418. package/dist/icons/CircleFilledIcon.js +1 -1
  419. package/dist/icons/ClearIcon.js +1 -1
  420. package/dist/icons/CloseCircleFilledIcon.js +1 -1
  421. package/dist/icons/CloseCircleIcon.js +1 -1
  422. package/dist/icons/CloseIcon.js +1 -1
  423. package/dist/icons/CodeIcon.js +1 -1
  424. package/dist/icons/ColumnTotalIcon.js +1 -1
  425. package/dist/icons/CopyIcon.js +1 -1
  426. package/dist/icons/CountIcon.js +1 -1
  427. package/dist/icons/CubeIcon.js +1 -1
  428. package/dist/icons/CubePauseIcon.js +1 -1
  429. package/dist/icons/CubePlayIcon.js +1 -1
  430. package/dist/icons/CurrencyDollarIcon.js +1 -1
  431. package/dist/icons/DangerIcon.js +1 -1
  432. package/dist/icons/DashboardIcon.js +1 -1
  433. package/dist/icons/DatabaseIcon.js +1 -1
  434. package/dist/icons/DecimalDecreaseIcon.js +1 -1
  435. package/dist/icons/DecimalIncreaseIcon.js +1 -1
  436. package/dist/icons/DirectionIcon.js +1 -1
  437. package/dist/icons/DonutIcon.js +1 -1
  438. package/dist/icons/DownIcon.js +1 -1
  439. package/dist/icons/EditIcon.js +1 -1
  440. package/dist/icons/ExclamationCircleFilledIcon.js +1 -1
  441. package/dist/icons/ExclamationCircleIcon.js +1 -1
  442. package/dist/icons/ExclamationIcon.js +1 -1
  443. package/dist/icons/EyeIcon.js +1 -1
  444. package/dist/icons/EyeInvisibleIcon.js +1 -1
  445. package/dist/icons/FilterIcon.js +1 -1
  446. package/dist/icons/FolderFilledIcon.js +1 -1
  447. package/dist/icons/FolderIcon.js +1 -1
  448. package/dist/icons/FolderOpenFilledIcon.js +1 -1
  449. package/dist/icons/FolderOpenIcon.js +1 -1
  450. package/dist/icons/ForwardIcon.js +1 -1
  451. package/dist/icons/GripVerticalIcon.js +1 -1
  452. package/dist/icons/HierarchyIcon.js +1 -1
  453. package/dist/icons/HierarchyOpenIcon.js +1 -1
  454. package/dist/icons/Icon.js +1 -1
  455. package/dist/icons/InfoCircleIcon.js +1 -1
  456. package/dist/icons/InfoIcon.js +1 -1
  457. package/dist/icons/KeyIcon.js +1 -1
  458. package/dist/icons/LeftIcon.js +1 -1
  459. package/dist/icons/LineChartIcon.js +1 -1
  460. package/dist/icons/LoadingIcon.js +1 -1
  461. package/dist/icons/LockFilledIcon.js +1 -1
  462. package/dist/icons/LockIcon.js +1 -1
  463. package/dist/icons/MoreIcon.js +1 -1
  464. package/dist/icons/NotAllowedIcon.js +1 -1
  465. package/dist/icons/Number123Icon.js +1 -1
  466. package/dist/icons/NumberIcon.js +1 -1
  467. package/dist/icons/PauseCircleFilledIcon.js +1 -1
  468. package/dist/icons/PauseCircleIcon.js +1 -1
  469. package/dist/icons/PauseIcon.js +1 -1
  470. package/dist/icons/PercentageIcon.js +1 -1
  471. package/dist/icons/PieChartIcon.js +1 -1
  472. package/dist/icons/PipetteIcon.js +1 -1
  473. package/dist/icons/PlayCircleIcon.js +1 -1
  474. package/dist/icons/PlayIcon.js +1 -1
  475. package/dist/icons/PlusIcon.js +1 -1
  476. package/dist/icons/ProgressBarIcon.js +1 -1
  477. package/dist/icons/ReloadIcon.js +1 -1
  478. package/dist/icons/ReportIcon.js +1 -1
  479. package/dist/icons/ReturnIcon.js +1 -1
  480. package/dist/icons/RightIcon.js +1 -1
  481. package/dist/icons/RowTotalsIcon.js +1 -1
  482. package/dist/icons/SchemeIcon.js +1 -1
  483. package/dist/icons/SearchIcon.js +1 -1
  484. package/dist/icons/SemanticQueryIcon.js +1 -1
  485. package/dist/icons/SettingsIcon.js +1 -1
  486. package/dist/icons/ShieldFilledIcon.js +1 -1
  487. package/dist/icons/ShieldIcon.js +1 -1
  488. package/dist/icons/SlashIcon.js +1 -1
  489. package/dist/icons/SparklesIcon.js +1 -1
  490. package/dist/icons/SqlIcon.js +1 -1
  491. package/dist/icons/StatsIcon.js +1 -1
  492. package/dist/icons/StopIcon.js +1 -1
  493. package/dist/icons/StringIcon.js +1 -1
  494. package/dist/icons/SubtotalsIcon.js +1 -1
  495. package/dist/icons/SwitchIcon.js +1 -1
  496. package/dist/icons/TableIcon.js +1 -1
  497. package/dist/icons/ThumbsDownIcon.js +1 -1
  498. package/dist/icons/ThumbsUpIcon.js +1 -1
  499. package/dist/icons/ThunderboltCrossedIcon.js +1 -1
  500. package/dist/icons/ThunderboltFilledIcon.js +1 -1
  501. package/dist/icons/ThunderboltIcon.js +1 -1
  502. package/dist/icons/TimeIcon.js +1 -1
  503. package/dist/icons/TrashIcon.js +1 -1
  504. package/dist/icons/UnlockIcon.js +1 -1
  505. package/dist/icons/UpIcon.js +1 -1
  506. package/dist/icons/UserGroupIcon.js +1 -1
  507. package/dist/icons/UserIcon.js +1 -1
  508. package/dist/icons/UserLockIcon.js +1 -1
  509. package/dist/icons/ViewIcon.js +1 -1
  510. package/dist/icons/WarningFilledIcon.js +1 -1
  511. package/dist/icons/WarningIcon.js +1 -1
  512. package/dist/icons/wrap-icon.js +1 -1
  513. package/dist/index.js +1 -1
  514. package/dist/probe/canonicalize.js +1 -1
  515. package/dist/probe/css.js +1 -1
  516. package/dist/probe/index.js +1 -1
  517. package/dist/provider.js +1 -1
  518. package/dist/providers/TrackingProvider.js +1 -1
  519. package/dist/providers/navigation-url.js +1 -1
  520. package/dist/providers/navigationAdapter.default.js +1 -1
  521. package/dist/providers/use-navigation.js +1 -1
  522. package/dist/tokens/all-tokens.js +1 -1
  523. package/dist/tokens/base.js +1 -1
  524. package/dist/tokens/color-seed.js +1 -1
  525. package/dist/tokens/color-theme.js +1 -1
  526. package/dist/tokens/colors.js +1 -1
  527. package/dist/tokens/layout.js +1 -1
  528. package/dist/tokens/lazy-styles.js +1 -1
  529. package/dist/tokens/legacy-color.js +1 -1
  530. package/dist/tokens/palette-config.js +1 -1
  531. package/dist/tokens/palette.js +1 -1
  532. package/dist/tokens/resolve.js +1 -1
  533. package/dist/tokens/shadows.js +1 -1
  534. package/dist/tokens/sizes.js +1 -1
  535. package/dist/tokens/spacing.js +1 -1
  536. package/dist/tokens/typography.js +1 -1
  537. package/dist/utils/ResizeSensor.js +1 -1
  538. package/dist/utils/colors.js +1 -1
  539. package/dist/utils/dotize.js +1 -1
  540. package/dist/utils/is-dev-env.js +1 -1
  541. package/dist/utils/modules.js +1 -1
  542. package/dist/utils/promise.js +1 -1
  543. package/dist/utils/raf.js +1 -1
  544. package/dist/utils/random.js +1 -1
  545. package/dist/utils/range.js +1 -1
  546. package/dist/utils/react/RenderCache.js +1 -1
  547. package/dist/utils/react/Slots.js +1 -1
  548. package/dist/utils/react/chain.js +1 -1
  549. package/dist/utils/react/disabledProps.js +1 -1
  550. package/dist/utils/react/forwardRefWithGenerics.js +1 -1
  551. package/dist/utils/react/index.js +1 -1
  552. package/dist/utils/react/interactions.js +1 -1
  553. package/dist/utils/react/isTextOnly.js +1 -1
  554. package/dist/utils/react/mapProps.js +1 -1
  555. package/dist/utils/react/mergeProps.js +1 -1
  556. package/dist/utils/react/nullableValue.js +1 -1
  557. package/dist/utils/react/overlayKeyPropagation.js +1 -1
  558. package/dist/utils/react/programmaticFocus.js +1 -1
  559. package/dist/utils/react/resolveIcon.js +1 -1
  560. package/dist/utils/react/sharedStore.js +1 -1
  561. package/dist/utils/react/useBufferedValue.js +1 -1
  562. package/dist/utils/react/useCombinedRefs.js +1 -1
  563. package/dist/utils/react/useControlledFocusVisible.js +1 -1
  564. package/dist/utils/react/useEventBus.js +1 -1
  565. package/dist/utils/react/useId.js +1 -1
  566. package/dist/utils/react/useIsDarwin.js +1 -1
  567. package/dist/utils/react/useKeySymbols.js +1 -1
  568. package/dist/utils/react/useLayoutEffect.js +1 -1
  569. package/dist/utils/react/useLocalStorage.js +1 -1
  570. package/dist/utils/react/useMergeStyles.js +1 -1
  571. package/dist/utils/react/useOverlayEscapeGuard.js +1 -1
  572. package/dist/utils/react/usePopoverSync.js +1 -1
  573. package/dist/utils/react/useQaProps.js +1 -1
  574. package/dist/utils/react/useScheme.js +1 -1
  575. package/dist/utils/react/useViewportSize.js +1 -1
  576. package/dist/utils/react/wrapNodeIfPlain.js +1 -1
  577. package/dist/utils/selection.js +1 -1
  578. package/dist/utils/styles.js +1 -1
  579. package/dist/utils/tree.js +1 -1
  580. package/dist/utils/warnings.js +1 -1
  581. package/dist/version.js +2 -2
  582. package/docs/ComplexLayout.md +1 -1
  583. package/docs/components/actions/ButtonSplit.md +27 -1
  584. package/docs/components/content/Layout.md +8 -4
  585. package/docs/components/fields/ComboBox.md +6 -2
  586. package/docs/components/fields/TagInput.md +1 -1
  587. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | Cube Dev Team */
2
2
  import { extractStyles } from "../../../utils/styles.js";
3
3
  import { useCombinedRefs } from "../../../utils/react/useCombinedRefs.js";
4
4
  import { isDevEnv } from "../../../utils/is-dev-env.js";
@@ -174,6 +174,7 @@ function LayoutInner(props) {
174
174
  const handleInnerFocus = useCallback((e) => {
175
175
  if (!hasOverlayPanels) return;
176
176
  const inner = e.currentTarget;
177
+ if (!inner.contains(e.target)) return;
177
178
  const relatedTarget = e.relatedTarget;
178
179
  if (!relatedTarget || !inner.contains(relatedTarget)) dismissOverlayPanels?.();
179
180
  }, [hasOverlayPanels, dismissOverlayPanels]);
@@ -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","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>&lt;Layout/&gt;</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>&lt;Layout/&gt;</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;AAK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AC/ChB;EACN,QAAQ3B;EACR,OAAOqB;EACP,WAAWP,mBAAmByB,gBAAgBK;;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
+ {"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","contains","target","Node","relatedTarget","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 const inner = e.currentTarget;\n\n // Panels portal out of Inner but stay its React children, so focus inside\n // a panel (or a popover opened from it) bubbles here too. Only focus that\n // lands in Inner's own DOM, the main content, can dismiss.\n if (!inner.contains(e.target as Node)) return;\n\n // Check if focus is coming from outside the Inner element\n const relatedTarget = e.relatedTarget as Node | null;\n\n // If relatedTarget is null or not inside the Inner element,\n // focus is entering from outside - dismiss overlay panels\n if (!relatedTarget || !inner.contains(relatedTarget)) {\n dismissOverlayPanels?.();\n }\n },\n [hasOverlayPanels, dismissOverlayPanels],\n );\n\n // Handle Escape key anywhere in the Layout - dismiss overlay panels\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (hasOverlayPanels && e.key === 'Escape') {\n e.preventDefault();\n e.stopPropagation();\n dismissOverlayPanels?.();\n }\n },\n [hasOverlayPanels, dismissOverlayPanels],\n );\n\n return (\n <LayoutElement\n ref={setRefs}\n {...filterBaseProps(otherProps, { eventProps: true })}\n mods={mods}\n styles={finalStyles}\n style={transitionStyle}\n onKeyDown={hasOverlayPanels ? handleKeyDown : undefined}\n >\n {/* All children go inside the Inner element - panels will portal themselves out */}\n <div\n ref={combinedInnerRef}\n data-element=\"Inner\"\n onFocus={handleInnerFocus}\n {...innerProps}\n >\n {children}\n </div>\n {/* Container for panels to portal into - rendered after Inner so panels paint on top via DOM order */}\n <div ref={layoutRefs?.setPanelContainer} data-element=\"PanelContainer\" />\n {/* Overlaid, never substituted for `children`. A zero-height measurement is\n not proof of a mistake - a hidden tab, a collapsed accordion and a\n container mid-animation all measure zero - so unmounting the subtree\n would turn a wrong guess into an outage, and remounting it on the way\n back would drop whatever state it held. */}\n {showDevWarning ? (\n <Alert theme=\"danger\" styles={DEV_WARNING_STYLES}>\n <b>UIKit:</b> <b>&lt;Layout/&gt;</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>&lt;Layout/&gt;</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;CACRf,UAAU;CACX;AAwCD,SAAS8B,YACPC,OACA;CACA,MAAME,gBAAgB1C,yBAAyB;CAC/C,MAAM2C,cAAczC,uBAAuB;CAC3C,MAAM0C,aAAa3C,sBAAsB;CACzC,MAAM4C,WAAWrD,OAAuB,KAAK;CAC7C,MAAM,CAACsD,cAAcC,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Ef,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,SAAA6F,OAAA5E,OAAAe,KAAA;CAAA,MAAAvC,IAAAqG,EAAA,EAAA;CACE,MAAA,EAAAtF,eAAAC,mBAA0CQ;CAAM,IAAA8E;AAAA,KAAAtG,EAAA,OAAAwB,SAAAxB,EAAA,OAAAuC,KAAA;AAO5C+D,OAAA,oBAAC;GAAW,GAAK9E;GAAqBe,cAAAA;IAAO;AAAAvC,IAAA,KAAAwB;AAAAxB,IAAA,KAAAuC;AAAAvC,IAAA,KAAAsG;OAAAA,MAAAtG,EAAA;CAAA,IAAAuG;AAAA,KAAAvG,EAAA,OAAAe,iBAAAf,EAAA,OAAAgB,kBAAAhB,EAAA,OAAAsG,IAAA;AAJ/CC,OAAA,oBAAC;GACgBxF;GACCC;aAEhBsF;IACe;AAAAtG,IAAA,KAAAe;AAAAf,IAAA,KAAAgB;AAAAhB,IAAA,KAAAsG;AAAAtG,IAAA,KAAAuG;OAAAA,MAAAvG,EAAA;AAAA,QALjBuG;;AASJ,MAAMC,UAAUxI,WAAWoI,OAAO;AAElCI,QAAQC,cAAc"}
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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";
@@ -15,7 +15,8 @@ interface CubeLayoutPanelProps extends BaseProps, ContainerStyleProps {
15
15
  * Panel rendering mode:
16
16
  * - `default`: Standard panel that pushes content aside
17
17
  * - `sticky`: Panel floats over content without pushing it
18
- * - `overlay`: Panel with dismissable backdrop overlay
18
+ * - `overlay`: Panel with dismissable backdrop overlay; focus moves into it
19
+ * when it opens and back to the opener when it closes
19
20
  * - `dialog`: Panel renders as a modal dialog
20
21
  */
21
22
  mode?: LayoutPanelMode;
@@ -40,7 +41,8 @@ interface CubeLayoutPanelProps extends BaseProps, ContainerStyleProps {
40
41
  /** Enable slide transition on open/close */
41
42
  hasTransition?: boolean;
42
43
  /**
43
- * Whether the panel can be dismissed by clicking the overlay (overlay mode) or pressing Escape.
44
+ * Whether the panel can be dismissed by clicking the overlay (overlay mode), pressing Escape,
45
+ * or, in overlay mode, moving focus into the main content.
44
46
  * Only applies to `overlay` and `dialog` modes. Default: true
45
47
  */
46
48
  isDismissable?: boolean;
@@ -1,9 +1,10 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | 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";
5
5
  import { useLocalStorage } from "../../../utils/react/useLocalStorage.js";
6
6
  import { useDebouncedValue } from "../../../_internal/hooks/use-debounced-value.js";
7
+ import { focusProgrammatically } from "../../../utils/react/programmaticFocus.js";
7
8
  import { DisplayTransition } from "../../helpers/DisplayTransition/DisplayTransition.js";
8
9
  import { useI18n } from "../../../i18n/useI18n.js";
9
10
  import { DialogContainer } from "../../overlays/Dialog/DialogContainer.js";
@@ -17,6 +18,7 @@ import { forwardRef, useCallback, useEffect, useEffectEvent, useLayoutEffect, us
17
18
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
18
19
  import { createPortal } from "react-dom";
19
20
  import { useFocusRing, useHover, useMove } from "react-aria";
21
+ import { getFocusableTreeWalker } from "@react-aria/focus";
20
22
 
21
23
  //#region src/components/content/Layout/LayoutPanel.tsx
22
24
  const HANDLER_WIDTH = 9;
@@ -461,7 +463,15 @@ function LayoutPanel(props, ref) {
461
463
  effectiveInsetSize,
462
464
  updatePanelSize
463
465
  ]);
466
+ const closeRequestedRef = useRef(false);
464
467
  const handleOpenChange = useCallback((newIsOpen) => {
468
+ if (!newIsOpen) {
469
+ if (closeRequestedRef.current) return;
470
+ closeRequestedRef.current = true;
471
+ queueMicrotask(() => {
472
+ closeRequestedRef.current = false;
473
+ });
474
+ }
465
475
  setInternalIsOpen(newIsOpen);
466
476
  onOpenChange?.(newIsOpen);
467
477
  }, [onOpenChange]);
@@ -478,6 +488,42 @@ function LayoutPanel(props, ref) {
478
488
  registerOverlayPanel,
479
489
  handleOpenChange
480
490
  ]);
491
+ const openerRef = useRef(null);
492
+ const panelNodeRef = useRef(null);
493
+ const mountFocusRef = useRef(null);
494
+ const recordOpener = useEffectEvent(() => {
495
+ const active = mountFocusRef.current ?? panelNodeRef.current?.ownerDocument.activeElement ?? null;
496
+ mountFocusRef.current = null;
497
+ openerRef.current = isOverlayMode && isReady && !panelNodeRef.current?.contains(active) ? active : null;
498
+ });
499
+ const moveFocusIn = useEffectEvent(() => {
500
+ const panel = panelNodeRef.current;
501
+ const opener = openerRef.current;
502
+ const active_0 = panel?.ownerDocument.activeElement;
503
+ if (!panel || !opener || active_0 !== opener && active_0 !== lastReturnedFocus) return;
504
+ focusProgrammatically(getFocusableTreeWalker(panel, { tabbable: true }).nextNode() ?? getFocusableTreeWalker(panel).nextNode(), { preventScroll: true });
505
+ });
506
+ const returnFocus = useEffectEvent(() => {
507
+ const opener_0 = openerRef.current;
508
+ const panel_0 = panelNodeRef.current;
509
+ openerRef.current = null;
510
+ if (!isOverlayMode || !(opener_0 instanceof HTMLElement) || !opener_0.isConnected || opener_0 === opener_0.ownerDocument.body) return;
511
+ const active_1 = opener_0.ownerDocument.activeElement;
512
+ if (active_1 != null && active_1 !== opener_0.ownerDocument.body && !panel_0?.contains(active_1)) return;
513
+ focusProgrammatically(opener_0, { preventScroll: true });
514
+ lastReturnedFocus = opener_0;
515
+ queueMicrotask(() => {
516
+ lastReturnedFocus = null;
517
+ });
518
+ });
519
+ useLayoutEffect(() => {
520
+ if (isOpen) recordOpener();
521
+ }, [isOpen]);
522
+ useEffect(() => {
523
+ if (!isOpen) return;
524
+ moveFocusIn();
525
+ return () => returnFocus();
526
+ }, [isOpen]);
481
527
  const handleDialogOpenChange = useCallback((newIsOpen_0) => {
482
528
  setInternalIsDialogOpen(newIsOpen_0);
483
529
  onDialogOpenChange?.(newIsOpen_0);
@@ -541,6 +587,7 @@ function LayoutPanel(props, ref) {
541
587
  ]);
542
588
  const renderPanelContent = (offscreen = false, transitionRef_0) => {
543
589
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
590
+ isOverlayMode && /* @__PURE__ */ jsx(OpenerProbe, { focusRef: mountFocusRef }),
544
591
  isOverlayMode && /* @__PURE__ */ jsx(OverlayBackdrop, {
545
592
  mods: { visible: isOverlayMode && !offscreen },
546
593
  styles: overlayStyles,
@@ -548,7 +595,10 @@ function LayoutPanel(props, ref) {
548
595
  onClick: handleDismiss
549
596
  }),
550
597
  /* @__PURE__ */ jsx(PanelElement, {
551
- ref: (node_0) => panelRefCallback(node_0, transitionRef_0),
598
+ ref: (node_0) => {
599
+ if (node_0) panelNodeRef.current = node_0;
600
+ panelRefCallback(node_0, transitionRef_0);
601
+ },
552
602
  ...filterBaseProps(otherProps, { eventProps: true }),
553
603
  mods: {
554
604
  ...panelMods,
@@ -607,6 +657,27 @@ function LayoutPanel(props, ref) {
607
657
  if (!isOpen) return null;
608
658
  return createPortal(renderPanelContent(false), portalContainer);
609
659
  }
660
+ let lastReturnedFocus = null;
661
+ function OpenerProbe(t0) {
662
+ const $ = c(3);
663
+ const { focusRef } = t0;
664
+ let t1;
665
+ let t2;
666
+ if ($[0] !== focusRef) {
667
+ t1 = () => {
668
+ focusRef.current = document.activeElement;
669
+ };
670
+ t2 = [focusRef];
671
+ $[0] = focusRef;
672
+ $[1] = t1;
673
+ $[2] = t2;
674
+ } else {
675
+ t1 = $[1];
676
+ t2 = $[2];
677
+ }
678
+ useLayoutEffect(t1, t2);
679
+ return null;
680
+ }
610
681
  const _LayoutPanel = forwardRef(LayoutPanel);
611
682
  _LayoutPanel.displayName = "Layout.Panel";
612
683
 
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutPanel.js","names":["BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","mergeStyles","Styles","tasty","ForwardedRef","forwardRef","HTMLAttributes","ReactNode","RefCallback","useCallback","useEffect","useEffectEvent","useLayoutEffect","useMemo","useRef","useState","useFocusRing","useHover","useMove","createPortal","useDebouncedValue","useI18n","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","isolation","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","t","label","t0","Symbol","for","hoverProps","isHovered","focusProps","isFocusVisible","isHorizontal","localIsHovered","T0","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","applyInlineBounds","prev","clamped","frame","requestAnimationFrame","cancelAnimationFrame","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 useEffectEvent,\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 { useI18n } from '../../../i18n';\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 // The stacking context the transform used to create: z-indexed content\n // stays inside the panel, below its resize handle and an overlay backdrop.\n isolation: 'isolate',\n\n // Transition styles - offscreen mod controls slide animation.\n // `none` at rest, not a zero translate: any transform makes the panel the\n // containing block of its fixed descendants (drag previews, popups), which\n // then position against the panel and are clipped by its overflow. `none`\n // still animates to and from the offscreen translate.\n transform: {\n '': 'none',\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 { t } = useI18n();\n // One key per side: a translated sentence can't take the side as a word.\n const label = {\n left: t('layout.resizeLeftPanel', 'Resize left panel'),\n top: t('layout.resizeTopPanel', 'Resize top panel'),\n right: t('layout.resizeRightPanel', 'Resize right panel'),\n bottom: t('layout.resizeBottomPanel', 'Resize bottom panel'),\n }[side];\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': label,\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 const applyInlineBounds = useEffectEvent(() => {\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 useEffect(() => {\n if (!isDialogMode && !isDragging && containerDimension > 0) {\n // In an iframe ResizeObserver can precede responsive mode delivery.\n // Let that mode settle before shrinking and persisting the inline size.\n const frame = requestAnimationFrame(() => applyInlineBounds());\n return () => cancelAnimationFrame(frame);\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":";;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM2C,gBAAgB;AAEtB,MAAMC,iBAAiB;AAEvB,MAAMC,yBAAyB;AAE/B,MAAMC,eAAexC,MAAM;CACzByC,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,I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":["getFocusableTreeWalker","BaseProps","CONTAINER_STYLES","ContainerStyleProps","filterBaseProps","mergeStyles","Styles","tasty","ForwardedRef","forwardRef","HTMLAttributes","ReactNode","RefCallback","useCallback","useEffect","useEffectEvent","useLayoutEffect","useMemo","useRef","useState","useFocusRing","useHover","useMove","createPortal","useDebouncedValue","useI18n","mergeProps","useCombinedRefs","useLocalStorage","focusProgrammatically","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","isolation","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","t","label","t0","Symbol","for","hoverProps","isHovered","focusProps","isFocusVisible","isHorizontal","localIsHovered","T0","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","applyInlineBounds","prev","clamped","frame","requestAnimationFrame","cancelAnimationFrame","effectivePanelSize","effectiveInsetSize","registerPanel","unregisterPanel","updatePanelSize","isReady","lastSizeRef","closeRequestedRef","handleOpenChange","newIsOpen","queueMicrotask","handleDismiss","registerOverlayPanel","unregister","openerRef","Element","panelNodeRef","mountFocusRef","recordOpener","active","ownerDocument","activeElement","contains","moveFocusIn","panel","opener","lastReturnedFocus","target","tabbable","nextNode","preventScroll","returnFocus","isConnected","body","handleDialogOpenChange","panelContextValue","dialogPanelContextValue","panelMods","drag","maxSizeCss","parts","join","panelStyle","panelRefCallback","node","transitionRef","handleResetSize","resetSize","parseInt","clampedSize","renderPanelContent","offscreen","showOverlay","eventProps","portalContainer","isExiting","OpenerProbe","focusRef","document","_LayoutPanel","displayName"],"sources":["../../../../src/components/content/Layout/LayoutPanel.tsx"],"sourcesContent":["import { getFocusableTreeWalker } from '@react-aria/focus';\nimport {\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 useEffectEvent,\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 { useI18n } from '../../../i18n';\nimport {\n mergeProps,\n useCombinedRefs,\n useLocalStorage,\n} from '../../../utils/react';\nimport { focusProgrammatically } from '../../../utils/react/programmaticFocus';\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 // The stacking context the transform used to create: z-indexed content\n // stays inside the panel, below its resize handle and an overlay backdrop.\n isolation: 'isolate',\n\n // Transition styles - offscreen mod controls slide animation.\n // `none` at rest, not a zero translate: any transform makes the panel the\n // containing block of its fixed descendants (drag previews, popups), which\n // then position against the panel and are clipped by its overflow. `none`\n // still animates to and from the offscreen translate.\n transform: {\n '': 'none',\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 { t } = useI18n();\n // One key per side: a translated sentence can't take the side as a word.\n const label = {\n left: t('layout.resizeLeftPanel', 'Resize left panel'),\n top: t('layout.resizeTopPanel', 'Resize top panel'),\n right: t('layout.resizeRightPanel', 'Resize right panel'),\n bottom: t('layout.resizeBottomPanel', 'Resize bottom panel'),\n }[side];\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': label,\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; focus moves into it\n * when it opens and back to the opener when it closes\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), pressing Escape,\n * or, in overlay mode, moving focus into the main content.\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 const applyInlineBounds = useEffectEvent(() => {\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 useEffect(() => {\n if (!isDialogMode && !isDragging && containerDimension > 0) {\n // In an iframe ResizeObserver can precede responsive mode delivery.\n // Let that mode settle before shrinking and persisting the inline size.\n const frame = requestAnimationFrame(() => applyInlineBounds());\n return () => cancelAnimationFrame(frame);\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 // One close per task: a consumer that moves focus into the main content in\n // `onOpenChange(false)` would otherwise dismiss the still-registered panel\n // a second time.\n const closeRequestedRef = useRef(false);\n\n const handleOpenChange = useCallback(\n (newIsOpen: boolean) => {\n if (!newIsOpen) {\n if (closeRequestedRef.current) return;\n\n closeRequestedRef.current = true;\n queueMicrotask(() => {\n closeRequestedRef.current = false;\n });\n }\n\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 // Overlay focus: move into the panel on open, back to the opener on close.\n // Declared after the registration effect on purpose: its cleanup then runs\n // after the panel unregisters, so a restore into the main content dismisses\n // nothing.\n const openerRef = useRef<Element | null>(null);\n const panelNodeRef = useRef<HTMLDivElement | null>(null);\n // Focus as the panel's contents mount, before a native `autoFocus` inside\n // them moves it (see OpenerProbe).\n const mountFocusRef = useRef<Element | null>(null);\n\n // A panel open on the Layout's first render leaves page focus alone.\n const recordOpener = useEffectEvent(() => {\n const active =\n mountFocusRef.current ??\n panelNodeRef.current?.ownerDocument.activeElement ??\n null;\n\n mountFocusRef.current = null;\n\n openerRef.current =\n isOverlayMode && isReady && !panelNodeRef.current?.contains(active)\n ? active\n : null;\n });\n\n const moveFocusIn = useEffectEvent(() => {\n const panel = panelNodeRef.current;\n const opener = openerRef.current;\n\n const active = panel?.ownerDocument.activeElement;\n\n // Focus already moved elsewhere as the panel opened, such as to a field\n // with `autoFocus` inside it: leave it there. Focus another overlay panel just\n // returned, as it closed in the same commit, does not count.\n if (\n !panel ||\n !opener ||\n (active !== opener && active !== lastReturnedFocus)\n ) {\n return;\n }\n\n const target =\n getFocusableTreeWalker(panel, { tabbable: true }).nextNode() ??\n getFocusableTreeWalker(panel).nextNode();\n\n // The panel enters translated offscreen, so focus must not scroll.\n focusProgrammatically(target as HTMLElement | null, {\n preventScroll: true,\n });\n });\n\n // Return focus only if it is still in the panel or was lost with it; focus\n // the user or the consumer moved elsewhere stays there.\n const returnFocus = useEffectEvent(() => {\n const opener = openerRef.current;\n const panel = panelNodeRef.current;\n\n openerRef.current = null;\n\n if (\n !isOverlayMode ||\n !(opener instanceof HTMLElement) ||\n !opener.isConnected ||\n opener === opener.ownerDocument.body\n ) {\n return;\n }\n\n const active = opener.ownerDocument.activeElement;\n\n if (\n active != null &&\n active !== opener.ownerDocument.body &&\n !panel?.contains(active)\n ) {\n return;\n }\n\n focusProgrammatically(opener, { preventScroll: true });\n lastReturnedFocus = opener;\n queueMicrotask(() => {\n lastReturnedFocus = null;\n });\n });\n\n useLayoutEffect(() => {\n if (isOpen) recordOpener();\n }, [isOpen]);\n\n // Passive, so a menu item that refocuses itself while closing its menu has\n // done so before focus moves in.\n useEffect(() => {\n if (!isOpen) return;\n\n moveFocusIn();\n\n return () => returnFocus();\n }, [isOpen]);\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 {isOverlayMode && <OpenerProbe focusRef={mountFocusRef} />}\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 // Kept after detach: StrictMode detaches refs before it replays\n // the effects that still need the panel.\n if (node) panelNodeRef.current = node;\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\n// Focus another overlay panel returned in the current task.\nlet lastReturnedFocus: Element | null = null;\n\n// Rendered before the panel's contents, so its layout effect reads focus\n// before React applies a native `autoFocus` inside them.\nfunction OpenerProbe({ focusRef }: { focusRef: { current: Element | null } }) {\n useLayoutEffect(() => {\n focusRef.current = document.activeElement;\n }, [focusRef]);\n\n return null;\n}\n\nconst _LayoutPanel = forwardRef(LayoutPanel);\n\n_LayoutPanel.displayName = 'Layout.Panel';\n\nexport { _LayoutPanel as LayoutPanel };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuDA,MAAM6C,gBAAgB;AAEtB,MAAMC,iBAAiB;AAEvB,MAAMC,yBAAyB;AAE/B,MAAMC,eAAezC,MAAM;CACzB0C,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;GAC3B;EAGDC,QAAQ;GACN,IAAI;GACJ,aAAa;GACb,cAAc;GACd,YAAY;GACZ,eA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AAEpB,QAAO9G,aAAa2Q,mBAAmB,MAAM,EAAEI,gBAAgB;;AAIjE,IAAI5B,oBAAoC;AAIxC,SAAA8B,YAAA/L,IAAA;CAAA,MAAAJ,IAAAC,EAAA,EAAA;CAAqB,MAAA,EAAAmM,aAAAhM;CAAuD,IAAAU;CAAA,IAAAM;AAAA,KAAApB,EAAA,OAAAoM,UAAA;AAC1DtL,aAAA;AACdsL,YAAQlE,UAAWmE,SAAQrC;;AAC1B5I,OAAA,CAACgL,SAAS;AAAApM,IAAA,KAAAoM;AAAApM,IAAA,KAAAc;AAAAd,IAAA,KAAAoB;QAAA;AAAAN,OAAAd,EAAA;AAAAoB,OAAApB,EAAA;;AAFbrF,iBAAgBmG,IAEbM,GAAW;AAAA,QAEP;;AAGT,MAAMkL,eAAelS,WAAWgJ,YAAY;AAE5CkJ,aAAaC,cAAc"}
@@ -1,4 +1,4 @@
1
- /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-b3fed8f | Cube Dev Team */
1
+ /** @license MIT | @cube-dev/ui-kit v0.0.0-canary-77836fa | Cube Dev Team */
2
2
  import { extractStyles } from "../../../utils/styles.js";
3
3
  import { ItemAction } from "../../actions/ItemAction/ItemAction.js";
4
4
  import { useI18n } from "../../../i18n/useI18n.js";