@amboss/design-system 4.9.4 → 4.11.0

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 (271) hide show
  1. package/build/cjs/components/AIButton/AIButton.js +1 -1
  2. package/build/cjs/components/Badge/Badge.js +1 -1
  3. package/build/cjs/components/Button/Button.js +1 -1
  4. package/build/cjs/components/CheckboxCard/CheckboxCard.d.ts +1 -1
  5. package/build/cjs/components/Collapsible/Collapsible.js +1 -1
  6. package/build/cjs/components/Column/Columns.js +1 -1
  7. package/build/cjs/components/Content/ContentBadge/ContentBadge.js +1 -1
  8. package/build/cjs/components/Content/ContentCheckbox/ContentCheckbox.d.ts +1 -1
  9. package/build/cjs/components/Content/ContentCheckbox/ContentCheckbox.js +1 -1
  10. package/build/cjs/components/Content/ContentCitation/ContentCitation.d.ts +3 -3
  11. package/build/cjs/components/Content/ContentFontResizer/FontSizeOffsetContext.d.ts +1 -1
  12. package/build/cjs/components/Content/ContentLink/ContentLink.js +1 -1
  13. package/build/cjs/components/Content/ContentText/ContentText.d.ts +1 -1
  14. package/build/cjs/components/Content/ContentText/ContentText.js +1 -1
  15. package/build/cjs/components/Content/DosageButton/DosageButton.d.ts +1 -1
  16. package/build/cjs/components/CountButton/CountButton.js +1 -1
  17. package/build/cjs/components/DataTable/DataTable.d.ts +3 -2
  18. package/build/cjs/components/DataTable/DataTable.js +1 -1
  19. package/build/cjs/components/DataTable/TableCell.d.ts +1 -1
  20. package/build/cjs/components/DataTable/internal/tablePrimitives.d.ts +3 -3
  21. package/build/cjs/components/EntityList/styled-components.d.ts +8 -8
  22. package/build/cjs/components/Form/Checkbox/Checkbox.d.ts +2 -2
  23. package/build/cjs/components/Form/Combobox/SingleSelect.js +1 -1
  24. package/build/cjs/components/Form/Combobox/StyledSelectComponents.d.ts +4 -4
  25. package/build/cjs/components/Form/Combobox/StyledSelectComponents.js +1 -1
  26. package/build/cjs/components/Form/DatePicker/DatePicker.d.ts +1 -1
  27. package/build/cjs/components/Form/Input/Input.js +1 -1
  28. package/build/cjs/components/Form/MaskedInput/MaskedInput.d.ts +1 -1
  29. package/build/cjs/components/Form/PasswordInput/PasswordInput.js +1 -1
  30. package/build/cjs/components/Form/Radio/Radio.d.ts +2 -2
  31. package/build/cjs/components/Form/RadioButton/RadioButton.js +1 -1
  32. package/build/cjs/components/Form/RangeInput/RangeInput.d.ts +1 -1
  33. package/build/cjs/components/Form/SegmentedControl/SegmentedControlOption.js +1 -1
  34. package/build/cjs/components/Form/Select/Select.js +1 -1
  35. package/build/cjs/components/Form/Textarea/Textarea.d.ts +2 -2
  36. package/build/cjs/components/Form/Textarea/Textarea.js +1 -1
  37. package/build/cjs/components/Form/Toggle/Toggle.d.ts +3 -3
  38. package/build/cjs/components/Form/ToggleButton/ToggleButton.d.ts +1 -1
  39. package/build/cjs/components/Grid/Grid.d.ts +1 -1
  40. package/build/cjs/components/Grid/Grid.js +1 -1
  41. package/build/cjs/components/IconTile/IconTile.js +1 -1
  42. package/build/cjs/components/Internal/Drawer/Drawer.js +3 -3
  43. package/build/cjs/components/Internal/Float/Float.js +1 -1
  44. package/build/cjs/components/Internal/LayoutFloat/LayoutFloat.d.ts +13 -1
  45. package/build/cjs/components/Internal/LayoutFloat/useLayoutFloatDrag.d.ts +1 -1
  46. package/build/cjs/components/Internal/Panel/Panel.d.ts +5 -3
  47. package/build/cjs/components/Internal/Panel/Panel.js +1 -1
  48. package/build/cjs/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
  49. package/build/cjs/components/Internal/PanelHeader/PanelHeader.js +1 -1
  50. package/build/cjs/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
  51. package/build/cjs/components/Layout/-constants.d.ts +10 -0
  52. package/build/cjs/components/Layout/-constants.js +1 -1
  53. package/build/cjs/components/Layout/-types.d.ts +35 -11
  54. package/build/cjs/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.d.ts +18 -0
  55. package/build/cjs/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.js +1 -0
  56. package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.d.ts +3 -0
  57. package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.js +1 -0
  58. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +11 -0
  59. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.js +1 -0
  60. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +13 -0
  61. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -0
  62. package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.d.ts +42 -0
  63. package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.js +1 -0
  64. package/build/cjs/components/Layout/Layout.d.ts +4 -0
  65. package/build/cjs/components/Layout/Layout.js +1 -1
  66. package/build/cjs/components/Layout/LayoutCssVars.d.ts +1 -1
  67. package/build/cjs/components/Layout/LayoutCssVars.js +1 -1
  68. package/build/cjs/components/Layout/LayoutPortal.d.ts +7 -0
  69. package/build/cjs/components/Layout/LayoutPortal.js +1 -0
  70. package/build/cjs/components/Layout/LayoutProvider.js +1 -1
  71. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +3 -4
  72. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  73. package/build/cjs/components/Layout/LeftPanel/useLeftBarContext.d.ts +1 -1
  74. package/build/cjs/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +1 -1
  75. package/build/cjs/components/Layout/PanelContainer.d.ts +1 -1
  76. package/build/cjs/components/Layout/PanelContainer.js +1 -1
  77. package/build/cjs/components/Layout/RightPanel/RightPanel.js +1 -1
  78. package/build/cjs/components/Layout/RightPanel/RightPanelDocked.d.ts +1 -1
  79. package/build/cjs/components/Layout/RightPanel/RightPanelDocked.js +1 -1
  80. package/build/cjs/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  81. package/build/cjs/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +1 -1
  82. package/build/cjs/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.js +1 -1
  83. package/build/cjs/components/Layout/Split/MobileSplitView/useMobileSplitStack.d.ts +1 -1
  84. package/build/cjs/components/Layout/Split/Split.js +1 -1
  85. package/build/cjs/components/Layout/Split/SplitDocked.js +1 -1
  86. package/build/cjs/components/Layout/context.d.ts +2 -2
  87. package/build/cjs/components/Layout/cssVarStore.d.ts +10 -3
  88. package/build/cjs/components/Layout/cssVarStore.js +1 -1
  89. package/build/cjs/components/Layout/registry.d.ts +13 -9
  90. package/build/cjs/components/Layout/useLayout.js +1 -1
  91. package/build/cjs/components/Layout/useLeftPanelId.d.ts +1 -1
  92. package/build/cjs/components/Layout/usePanelAnimations.d.ts +12 -0
  93. package/build/cjs/components/Layout/usePanelAnimations.js +1 -0
  94. package/build/cjs/components/Layout/usePanelDockedSlide.js +1 -1
  95. package/build/cjs/components/Link/Link.js +1 -1
  96. package/build/cjs/components/MediaItem/MediaItem.js +1 -1
  97. package/build/cjs/components/MediaViewerCarousel/MediaCarousel/MediaCarousel.js +1 -1
  98. package/build/cjs/components/NavBar/NavBar.d.ts +14 -18
  99. package/build/cjs/components/NavBar/NavBarContext.d.ts +1 -1
  100. package/build/cjs/components/NavBar/NavBarDropdownTriggerButton.d.ts +1 -1
  101. package/build/cjs/components/Notification/Notification.js +1 -1
  102. package/build/cjs/components/Patterns/Dialog/DialogContext.d.ts +1 -1
  103. package/build/cjs/components/Patterns/EmptyState/EmptyState.d.ts +2 -2
  104. package/build/cjs/components/Patterns/Modal/Modal.d.ts +4 -2
  105. package/build/cjs/components/Patterns/Popover/PopoverContext.d.ts +1 -1
  106. package/build/cjs/components/PictogramButton/PictogramButton.js +1 -1
  107. package/build/cjs/components/PromptInput/PromptInput.d.ts +1 -1
  108. package/build/cjs/components/RadioCard/RadioCard.d.ts +1 -1
  109. package/build/cjs/components/RoundButton/RoundButton.js +1 -1
  110. package/build/cjs/components/SearchResult/SearchResult.d.ts +3 -1
  111. package/build/cjs/components/SearchResult/SearchResult.js +1 -1
  112. package/build/cjs/components/Sheet/Sheet.js +1 -1
  113. package/build/cjs/components/Sheet/useSheetHeightSync.d.ts +26 -0
  114. package/build/cjs/components/Sheet/useSheetHeightSync.js +1 -0
  115. package/build/cjs/components/StatusIndicator/StatusIndicator.js +1 -1
  116. package/build/cjs/components/SubThemeProvider/SubThemeContext.d.ts +1 -1
  117. package/build/cjs/components/Tooltip/FloatingPositionedContext.d.ts +1 -1
  118. package/build/cjs/components/Typography/Text/Text.js +1 -1
  119. package/build/cjs/components/Utilities/ContainerQuery/ContainerQueryContext.d.ts +1 -1
  120. package/build/cjs/components/Utilities/Expandable/Expandable.js +1 -1
  121. package/build/cjs/components/Utilities/ScreenReaderText/ScreenReaderText.d.ts +1 -1
  122. package/build/cjs/shared/components/SelectableButton.d.ts +1 -1
  123. package/build/cjs/shared/useExitAnimation.js +1 -0
  124. package/build/cjs/web-tokens/layout-vars.d.ts +7 -0
  125. package/build/cjs/web-tokens/layout-vars.js +1 -1
  126. package/build/cjs/web-tokens/layout-vars.ts +7 -0
  127. package/build/cjs/web-tokens/visualConfig.d.ts +40 -0
  128. package/build/cjs/web-tokens/visualConfig.js +1 -1
  129. package/build/esm/components/AIButton/AIButton.js +1 -1
  130. package/build/esm/components/Badge/Badge.js +1 -1
  131. package/build/esm/components/Button/Button.js +1 -1
  132. package/build/esm/components/CheckboxCard/CheckboxCard.d.ts +1 -1
  133. package/build/esm/components/Collapsible/Collapsible.js +1 -1
  134. package/build/esm/components/Column/Columns.js +1 -1
  135. package/build/esm/components/Content/ContentBadge/ContentBadge.js +1 -1
  136. package/build/esm/components/Content/ContentCheckbox/ContentCheckbox.d.ts +1 -1
  137. package/build/esm/components/Content/ContentCheckbox/ContentCheckbox.js +1 -1
  138. package/build/esm/components/Content/ContentCitation/ContentCitation.d.ts +3 -3
  139. package/build/esm/components/Content/ContentFontResizer/FontSizeOffsetContext.d.ts +1 -1
  140. package/build/esm/components/Content/ContentLink/ContentLink.js +1 -1
  141. package/build/esm/components/Content/ContentText/ContentText.d.ts +1 -1
  142. package/build/esm/components/Content/ContentText/ContentText.js +1 -1
  143. package/build/esm/components/Content/DosageButton/DosageButton.d.ts +1 -1
  144. package/build/esm/components/CountButton/CountButton.js +1 -1
  145. package/build/esm/components/DataTable/DataTable.d.ts +3 -2
  146. package/build/esm/components/DataTable/DataTable.js +1 -1
  147. package/build/esm/components/DataTable/TableCell.d.ts +1 -1
  148. package/build/esm/components/DataTable/internal/tablePrimitives.d.ts +3 -3
  149. package/build/esm/components/EntityList/styled-components.d.ts +8 -8
  150. package/build/esm/components/Form/Checkbox/Checkbox.d.ts +2 -2
  151. package/build/esm/components/Form/Combobox/SingleSelect.js +1 -1
  152. package/build/esm/components/Form/Combobox/StyledSelectComponents.d.ts +4 -4
  153. package/build/esm/components/Form/Combobox/StyledSelectComponents.js +1 -1
  154. package/build/esm/components/Form/DatePicker/DatePicker.d.ts +1 -1
  155. package/build/esm/components/Form/Input/Input.js +1 -1
  156. package/build/esm/components/Form/MaskedInput/MaskedInput.d.ts +1 -1
  157. package/build/esm/components/Form/PasswordInput/PasswordInput.js +1 -1
  158. package/build/esm/components/Form/Radio/Radio.d.ts +2 -2
  159. package/build/esm/components/Form/RadioButton/RadioButton.js +1 -1
  160. package/build/esm/components/Form/RangeInput/RangeInput.d.ts +1 -1
  161. package/build/esm/components/Form/SegmentedControl/SegmentedControlOption.js +1 -1
  162. package/build/esm/components/Form/Select/Select.js +1 -1
  163. package/build/esm/components/Form/Textarea/Textarea.d.ts +2 -2
  164. package/build/esm/components/Form/Textarea/Textarea.js +1 -1
  165. package/build/esm/components/Form/Toggle/Toggle.d.ts +3 -3
  166. package/build/esm/components/Form/ToggleButton/ToggleButton.d.ts +1 -1
  167. package/build/esm/components/Grid/Grid.d.ts +1 -1
  168. package/build/esm/components/Grid/Grid.js +1 -1
  169. package/build/esm/components/IconTile/IconTile.js +1 -1
  170. package/build/esm/components/Internal/Drawer/Drawer.js +3 -3
  171. package/build/esm/components/Internal/Float/Float.js +1 -1
  172. package/build/esm/components/Internal/LayoutFloat/LayoutFloat.d.ts +13 -1
  173. package/build/esm/components/Internal/LayoutFloat/useLayoutFloatDrag.d.ts +1 -1
  174. package/build/esm/components/Internal/Panel/Panel.d.ts +5 -3
  175. package/build/esm/components/Internal/Panel/Panel.js +1 -1
  176. package/build/esm/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
  177. package/build/esm/components/Internal/PanelHeader/PanelHeader.js +1 -1
  178. package/build/esm/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
  179. package/build/esm/components/Layout/-constants.d.ts +10 -0
  180. package/build/esm/components/Layout/-constants.js +1 -1
  181. package/build/esm/components/Layout/-types.d.ts +35 -11
  182. package/build/esm/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.d.ts +18 -0
  183. package/build/esm/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.js +1 -0
  184. package/build/esm/components/Layout/BottomBar/LayoutBottomBar.d.ts +3 -0
  185. package/build/esm/components/Layout/BottomBar/LayoutBottomBar.js +1 -0
  186. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +11 -0
  187. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.js +1 -0
  188. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +13 -0
  189. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -0
  190. package/build/esm/components/Layout/BottomBar/getBottomBarLayout.d.ts +42 -0
  191. package/build/esm/components/Layout/BottomBar/getBottomBarLayout.js +1 -0
  192. package/build/esm/components/Layout/Layout.d.ts +4 -0
  193. package/build/esm/components/Layout/Layout.js +1 -1
  194. package/build/esm/components/Layout/LayoutCssVars.d.ts +1 -1
  195. package/build/esm/components/Layout/LayoutCssVars.js +1 -1
  196. package/build/esm/components/Layout/LayoutPortal.d.ts +7 -0
  197. package/build/esm/components/Layout/LayoutPortal.js +1 -0
  198. package/build/esm/components/Layout/LayoutProvider.js +1 -1
  199. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +3 -4
  200. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  201. package/build/esm/components/Layout/LeftPanel/useLeftBarContext.d.ts +1 -1
  202. package/build/esm/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +1 -1
  203. package/build/esm/components/Layout/PanelContainer.d.ts +1 -1
  204. package/build/esm/components/Layout/PanelContainer.js +1 -1
  205. package/build/esm/components/Layout/RightPanel/RightPanel.js +1 -1
  206. package/build/esm/components/Layout/RightPanel/RightPanelDocked.d.ts +1 -1
  207. package/build/esm/components/Layout/RightPanel/RightPanelDocked.js +1 -1
  208. package/build/esm/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  209. package/build/esm/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +1 -1
  210. package/build/esm/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.js +1 -1
  211. package/build/esm/components/Layout/Split/MobileSplitView/useMobileSplitStack.d.ts +1 -1
  212. package/build/esm/components/Layout/Split/Split.js +1 -1
  213. package/build/esm/components/Layout/Split/SplitDocked.js +1 -1
  214. package/build/esm/components/Layout/context.d.ts +2 -2
  215. package/build/esm/components/Layout/cssVarStore.d.ts +10 -3
  216. package/build/esm/components/Layout/cssVarStore.js +1 -1
  217. package/build/esm/components/Layout/registry.d.ts +13 -9
  218. package/build/esm/components/Layout/useLayout.js +1 -1
  219. package/build/esm/components/Layout/useLeftPanelId.d.ts +1 -1
  220. package/build/esm/components/Layout/usePanelAnimations.d.ts +12 -0
  221. package/build/esm/components/Layout/usePanelAnimations.js +1 -0
  222. package/build/esm/components/Layout/usePanelDockedSlide.js +1 -1
  223. package/build/esm/components/Link/Link.js +1 -1
  224. package/build/esm/components/MediaItem/MediaItem.js +1 -1
  225. package/build/esm/components/MediaViewerCarousel/MediaCarousel/MediaCarousel.js +1 -1
  226. package/build/esm/components/NavBar/NavBar.d.ts +14 -18
  227. package/build/esm/components/NavBar/NavBarContext.d.ts +1 -1
  228. package/build/esm/components/NavBar/NavBarDropdownTriggerButton.d.ts +1 -1
  229. package/build/esm/components/Notification/Notification.js +1 -1
  230. package/build/esm/components/Patterns/Dialog/DialogContext.d.ts +1 -1
  231. package/build/esm/components/Patterns/EmptyState/EmptyState.d.ts +2 -2
  232. package/build/esm/components/Patterns/Modal/Modal.d.ts +4 -2
  233. package/build/esm/components/Patterns/Popover/PopoverContext.d.ts +1 -1
  234. package/build/esm/components/PictogramButton/PictogramButton.js +1 -1
  235. package/build/esm/components/PromptInput/PromptInput.d.ts +1 -1
  236. package/build/esm/components/RadioCard/RadioCard.d.ts +1 -1
  237. package/build/esm/components/RoundButton/RoundButton.js +1 -1
  238. package/build/esm/components/SearchResult/SearchResult.d.ts +3 -1
  239. package/build/esm/components/SearchResult/SearchResult.js +1 -1
  240. package/build/esm/components/Sheet/Sheet.js +1 -1
  241. package/build/esm/components/Sheet/useSheetHeightSync.d.ts +26 -0
  242. package/build/esm/components/Sheet/useSheetHeightSync.js +1 -0
  243. package/build/esm/components/StatusIndicator/StatusIndicator.js +1 -1
  244. package/build/esm/components/SubThemeProvider/SubThemeContext.d.ts +1 -1
  245. package/build/esm/components/Tooltip/FloatingPositionedContext.d.ts +1 -1
  246. package/build/esm/components/Typography/Text/Text.js +1 -1
  247. package/build/esm/components/Utilities/ContainerQuery/ContainerQueryContext.d.ts +1 -1
  248. package/build/esm/components/Utilities/Expandable/Expandable.js +1 -1
  249. package/build/esm/components/Utilities/ScreenReaderText/ScreenReaderText.d.ts +1 -1
  250. package/build/esm/shared/components/SelectableButton.d.ts +1 -1
  251. package/build/esm/shared/useExitAnimation.js +1 -0
  252. package/build/esm/web-tokens/layout-vars.d.ts +7 -0
  253. package/build/esm/web-tokens/layout-vars.js +1 -1
  254. package/build/esm/web-tokens/layout-vars.ts +7 -0
  255. package/build/esm/web-tokens/visualConfig.d.ts +40 -0
  256. package/build/esm/web-tokens/visualConfig.js +1 -1
  257. package/build/scss/_layout.scss +14 -0
  258. package/build/scss/_variables.scss +20 -1
  259. package/package.json +16 -13
  260. package/build/cjs/components/Internal/Drawer/useExitAnimation.js +0 -1
  261. package/build/cjs/shared/isWithinScrolledElement.d.ts +0 -1
  262. package/build/cjs/shared/isWithinScrolledElement.js +0 -1
  263. package/build/cjs/shared/useDragDown.d.ts +0 -14
  264. package/build/cjs/shared/useDragDown.js +0 -1
  265. package/build/esm/components/Internal/Drawer/useExitAnimation.js +0 -1
  266. package/build/esm/shared/isWithinScrolledElement.d.ts +0 -1
  267. package/build/esm/shared/isWithinScrolledElement.js +0 -1
  268. package/build/esm/shared/useDragDown.d.ts +0 -14
  269. package/build/esm/shared/useDragDown.js +0 -1
  270. /package/build/cjs/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
  271. /package/build/esm/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
@@ -22,7 +22,7 @@ export type PanelHeaderProps = {
22
22
  leftSlot?: React.ReactNode;
23
23
  /** Title block (icon + heading), rendered after `leftSlot`. */
24
24
  title?: PanelHeaderTitle;
25
- /** Rendered at the header end, aligned to the top of multi-line content. */
25
+ /** Rendered at the header end, vertically centered. */
26
26
  rightSlot?: React.ReactNode;
27
27
  /** Fade the leading group out. `rightSlot` is left solid: it is the control
28
28
  * that travels down onto the left bar's own and has to survive the dissolve. */
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{TextClamped}from"../../../components/Typography/TextClamped/TextClamped";import{LEFT_BAR_BUTTON_INSET}from"../../Layout/-constants";import{getLeftPanelFadeStyles}from"../../../shared/mixins";import{Box}from"../../Box/Box";import{Inline}from"../../Inline/Inline";import{Icon}from"../../Icon/Icon";import{H5}from"../../Typography/Header/Header";let StyledHeaderSurface=styled("div",{target:"e13e79rk0",label:"StyledHeaderSurface"})(({theme})=>({backgroundColor:theme.values.color.background.primary.default})),StyledHeaderRow=styled("div",{target:"e13e79rk1",label:"StyledHeaderRow"})({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),StyledLeadingGroup=styled("div",{target:"e13e79rk2",label:"StyledLeadingGroup"})(({theme,isContentFaded})=>({minWidth:0,overflow:"hidden",...getLeftPanelFadeStyles({theme,isFaded:isContentFaded})})),StyledSlotContent=styled("div",{target:"e13e79rk3",label:"StyledSlotContent"})({width:"max-content"}),StyledLeadingContent=styled("div",{target:"e13e79rk4",label:"StyledLeadingContent"})(({theme,hasTitleInset})=>({paddingLeft:hasTitleInset?theme.variables.size.spacing.xxs:0})),StyledTrailingGroup=styled("div",{target:"e13e79rk5",label:"StyledTrailingGroup"})({alignSelf:"flex-start",flexShrink:0});export function PanelHeader({leftSlot,title,rightSlot,isContentFaded=!1,"data-e2e-test-id":dataE2eTestId}){let colorTitleItems="primary",hasTitle=title&&!1!==title.isVisible,hasIcon=hasTitle&&void 0!==title.icon;return React.createElement(StyledHeaderSurface,{"data-e2e-test-id":dataE2eTestId},React.createElement(Box,{vSpace:LEFT_BAR_BUTTON_INSET.vSpace,lSpace:hasIcon?"xs":"s",rSpace:LEFT_BAR_BUTTON_INSET.hSpace},React.createElement(StyledHeaderRow,null,React.createElement(StyledLeadingGroup,{isContentFaded:isContentFaded},React.createElement(StyledLeadingContent,{hasTitleInset:!!(hasTitle&&!hasIcon)},React.createElement(Inline,{space:"xs",vAlignItems:"center",noWrap:!0},leftSlot&&React.createElement(StyledSlotContent,null,leftSlot),hasTitle&&React.createElement(Inline,{space:"xs",vAlignItems:"center",noWrap:!0},title.icon&&React.createElement(Icon,{...title.icon,color:colorTitleItems,size:"s"}),React.createElement(TextClamped,{as:"span"},React.createElement(H5,{as:title.as,color:colorTitleItems},title.label)))))),React.createElement(StyledTrailingGroup,null,React.createElement(Inline,{space:"xxs",vAlignItems:"center",noWrap:!0},React.createElement(React.Fragment,null,rightSlot))))))}
1
+ import React from"react";import styled from"@emotion/styled";import{TextClamped}from"../../../components/Typography/TextClamped/TextClamped";import{LEFT_BAR_BUTTON_INSET}from"../../Layout/-constants";import{getLeftPanelFadeStyles}from"../../../shared/mixins";import{Box}from"../../Box/Box";import{Inline}from"../../Inline/Inline";import{Icon}from"../../Icon/Icon";import{H5}from"../../Typography/Header/Header";let StyledHeaderSurface=styled("div",{target:"e1fxsx1e0",label:"StyledHeaderSurface"})(({theme})=>({backgroundColor:theme.values.color.background.primary.default})),StyledHeaderRow=styled("div",{target:"e1fxsx1e1",label:"StyledHeaderRow"})({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),StyledLeadingGroup=styled("div",{target:"e1fxsx1e2",label:"StyledLeadingGroup"})(({theme,isContentFaded})=>({minWidth:0,overflow:"hidden",...getLeftPanelFadeStyles({theme,isFaded:isContentFaded})})),StyledSlotContent=styled("div",{target:"e1fxsx1e3",label:"StyledSlotContent"})({width:"max-content"}),StyledLeadingContent=styled("div",{target:"e1fxsx1e4",label:"StyledLeadingContent"})(({theme,hasTitleInset})=>({paddingLeft:hasTitleInset?theme.variables.size.spacing.xxs:0})),StyledTrailingGroup=styled("div",{target:"e1fxsx1e5",label:"StyledTrailingGroup"})({flexShrink:0});export function PanelHeader({leftSlot,title,rightSlot,isContentFaded=!1,"data-e2e-test-id":dataE2eTestId}){let colorTitleItems="primary",hasTitle=title&&!1!==title.isVisible,hasIcon=hasTitle&&void 0!==title.icon;return React.createElement(StyledHeaderSurface,{"data-e2e-test-id":dataE2eTestId},React.createElement(Box,{vSpace:LEFT_BAR_BUTTON_INSET.vSpace,lSpace:hasIcon?"xs":"s",rSpace:LEFT_BAR_BUTTON_INSET.hSpace},React.createElement(StyledHeaderRow,null,React.createElement(StyledLeadingGroup,{isContentFaded:isContentFaded},React.createElement(StyledLeadingContent,{hasTitleInset:!!(hasTitle&&!hasIcon)},React.createElement(Inline,{space:"xs",vAlignItems:"center",noWrap:!0},leftSlot&&React.createElement(StyledSlotContent,null,leftSlot),hasTitle&&React.createElement(Inline,{space:"xs",vAlignItems:"center",noWrap:!0},title.icon&&React.createElement(Icon,{...title.icon,color:colorTitleItems,size:"s"}),React.createElement(TextClamped,{as:"span"},React.createElement(H5,{as:title.as,color:colorTitleItems},title.label)))))),React.createElement(StyledTrailingGroup,null,React.createElement(Inline,{space:"xxs",vAlignItems:"center",noWrap:!0},React.createElement(React.Fragment,null,rightSlot))))))}
@@ -16,6 +16,6 @@ export type SandwichContextValue = SandwichEdges & {
16
16
  /** Static host below the scroll body - `Sandwich.Footer` portals into it. */
17
17
  footerSlotNode: HTMLElement | null;
18
18
  };
19
- export declare const SandwichProvider: React.Provider<SandwichContextValue | null>;
19
+ export declare const SandwichProvider: import("react").Provider<SandwichContextValue | null>;
20
20
  /** Read the Sandwich context, or throw if used outside `<Sandwich>`. */
21
21
  export declare function useSandwichContext(): SandwichContextValue;
@@ -82,6 +82,16 @@ export declare const RIGHT_PANEL_BOTTOM_BAR_INSET: string;
82
82
  export declare const PANEL_WIDTH_VAR: {
83
83
  readonly leftPanel: "--ds-layout-leftPanel-width";
84
84
  readonly content: "--ds-layout-content-width";
85
+ readonly splitview: "--ds-layout-splitview-width";
85
86
  readonly rightPanel: "--ds-layout-rightPanel-width";
86
87
  };
88
+ /** Live start of each column relative to the Layout root. */
89
+ export declare const PANEL_START_VAR: {
90
+ readonly leftPanel: "--ds-layout-leftPanel-start";
91
+ readonly content: "--ds-layout-content-start";
92
+ readonly splitview: "--ds-layout-splitview-start";
93
+ readonly rightPanel: "--ds-layout-rightPanel-start";
94
+ };
95
+ /** Set once column geometry is available to align the bottom bar. */
96
+ export declare const LAYOUT_REGIONS_READY_VAR: "--ds-layout-regions-ready";
87
97
  export {};
@@ -1 +1 @@
1
- import{LAYOUT_VARS}from"../../web-tokens/layout-vars";export const Slot={leftPanel:"leftPanel",content:"content",splitview:"splitview",rightPanel:"rightPanel"};export const SIDE_PANELS=[Slot.leftPanel,Slot.rightPanel];export const PANELS=[Slot.content,Slot.splitview];export const PANEL_ORDER=[Slot.leftPanel,Slot.content,Slot.splitview,Slot.rightPanel];export const DEFAULT_LEFT_PANEL_VARIANT="sidebar";export const LEFT_BAR_BUTTON_INSET={hSpace:"s",vSpace:"xs"};export const TOGGLABLE_SLOTS=PANEL_ORDER.filter(slot=>slot!==Slot.content);export const SUBNAV_OFFSET_VAR=LAYOUT_VARS.subnavOffset;export const SPLIT_MAX_WIDTH_VAR=LAYOUT_VARS.splitMaxWidth;export const BOTTOM_BAR_HEIGHT_VAR=LAYOUT_VARS.bottomBarHeight;export const RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR=LAYOUT_VARS.rightPanelBottomBarHeight;export const PAGE_BOTTOM_BAR_INSET=`var(${BOTTOM_BAR_HEIGHT_VAR}, 0px)`;export const RIGHT_PANEL_BOTTOM_BAR_INSET=`var(${RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR}, ${PAGE_BOTTOM_BAR_INSET})`;export const PANEL_WIDTH_VAR={leftPanel:LAYOUT_VARS.leftPanelWidth,content:LAYOUT_VARS.contentWidth,rightPanel:LAYOUT_VARS.rightPanelWidth};
1
+ import{LAYOUT_VARS}from"../../web-tokens/layout-vars";export const Slot={leftPanel:"leftPanel",content:"content",splitview:"splitview",rightPanel:"rightPanel"};export const SIDE_PANELS=[Slot.leftPanel,Slot.rightPanel];export const PANELS=[Slot.content,Slot.splitview];export const PANEL_ORDER=[Slot.leftPanel,Slot.content,Slot.splitview,Slot.rightPanel];export const DEFAULT_LEFT_PANEL_VARIANT="sidebar";export const LEFT_BAR_BUTTON_INSET={hSpace:"s",vSpace:"xs"};export const TOGGLABLE_SLOTS=PANEL_ORDER.filter(slot=>slot!==Slot.content);export const SUBNAV_OFFSET_VAR=LAYOUT_VARS.subnavOffset;export const SPLIT_MAX_WIDTH_VAR=LAYOUT_VARS.splitMaxWidth;export const BOTTOM_BAR_HEIGHT_VAR=LAYOUT_VARS.bottomBarHeight;export const RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR=LAYOUT_VARS.rightPanelBottomBarHeight;export const PAGE_BOTTOM_BAR_INSET=`var(${BOTTOM_BAR_HEIGHT_VAR}, 0px)`;export const RIGHT_PANEL_BOTTOM_BAR_INSET=`var(${RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR}, ${PAGE_BOTTOM_BAR_INSET})`;export const PANEL_WIDTH_VAR={leftPanel:LAYOUT_VARS.leftPanelWidth,content:LAYOUT_VARS.contentWidth,splitview:LAYOUT_VARS.splitviewWidth,rightPanel:LAYOUT_VARS.rightPanelWidth};export const PANEL_START_VAR={leftPanel:LAYOUT_VARS.leftPanelStart,content:LAYOUT_VARS.contentStart,splitview:LAYOUT_VARS.splitviewStart,rightPanel:LAYOUT_VARS.rightPanelStart};export const LAYOUT_REGIONS_READY_VAR=LAYOUT_VARS.regionsReady;
@@ -1,4 +1,5 @@
1
1
  import type React from "react";
2
+ import type { ConditionalAccessibleName } from "../../types/a11y";
2
3
  import type { PanelKey, SidePanelKey, SlotKey } from "./-constants";
3
4
  import type { PanelHeaderTitle } from "../Internal/PanelHeader/PanelHeader";
4
5
  import type { SandwichSeparator } from "../Internal/Sandwich/-types";
@@ -69,10 +70,21 @@ export type RightPanelState = SidePanelStateBase & {
69
70
  };
70
71
  /** Either side panel, for code that handles both. */
71
72
  export type SidePanelState = LeftPanelState | RightPanelState;
73
+ export type RegionPresentation = "column" | "overlay" | "hidden";
74
+ export type PanelAnimation = Readonly<{
75
+ property: "flex-grow";
76
+ /** Applied transition duration in milliseconds. */
77
+ duration: number;
78
+ easing: string;
79
+ }>;
72
80
  /** Actions every slot handle exposes, whatever its state shape. No `resize`:
73
81
  * sizes are declarative (`defaultSize` on the panel, then drag), and the
74
82
  * content/split pair is CSS-split, so an imperative size wouldn't hold. */
75
83
  export type PanelHandleActions = {
84
+ /** Whether the region occupies a footer-aligned column, an overlay, or neither. */
85
+ readonly presentation: RegionPresentation;
86
+ /** Parameters of the width transition currently applied by Layout. */
87
+ readonly animation: PanelAnimation | null;
76
88
  /** Whether the slot is currently shown. */
77
89
  isVisible: boolean;
78
90
  /** Show the slot. */
@@ -265,18 +277,15 @@ export type SidePanelProps = ForwardedScrollProps & {
265
277
  /** Accessible name; when set, the panel renders as a `region` landmark. */
266
278
  "aria-label"?: string;
267
279
  collapsible?: boolean;
268
- /** Number = pixels, unitless string = percent (e.g. `"30%"`).
269
- *
270
- * Either unit sets the column's starting width only: a docked side panel
271
- * then keeps that width when the window resizes, and `Layout.Content` grows
272
- * and shrinks around it. Drag-resizing is a separate story - see
273
- * `resizable`. */
280
+ /** Number or `"320px"` = pixels; `"30%"` or `"30"` = percentage.
281
+ * Pixel sizes keep their width when the container resizes. Percentage sizes
282
+ * follow the container, subject to the panel's min/max constraints.
283
+ * Independent of whether the user may resize the panel. */
274
284
  defaultSize?: Size;
275
- /** Desktop only: allow drag-resizing the panel's column. Overrides the
276
- * provider config's `resizable`. When `false`, the column is fixed at
277
- * `defaultSize` - neighbours can't resize it either, though they stay
278
- * resizable against each other. Showing and hiding the panel still works. No
279
- * effect on the mobile drawer/sheet. */
285
+ /** Desktop only: allow the user to resize the column by pointer or keyboard.
286
+ * Overrides the provider config's `resizable`. When `false`, dragging a
287
+ * neighbour cannot resize this panel either. Percentage widths still follow
288
+ * the container; showing and hiding still works. No effect on mobile. */
280
289
  resizable?: boolean;
281
290
  /** Called whenever the panel's visibility changes, with the new value. */
282
291
  onVisibleChange?: (visible: boolean) => void;
@@ -310,6 +319,9 @@ export type ContentProps = {
310
319
  * (default: the `xxl` breakpoint) and centred once past it.
311
320
  */
312
321
  export type SplitProps = ForwardedScrollProps & {
322
+ /** Panel surface. Defaults to primary.
323
+ * TODO: Move background ownership to the client-rendered content. */
324
+ background?: "primary" | "transparent";
313
325
  /** Panel content in source order. `<Layout.SplitHeader />` /
314
326
  * `<Layout.SplitFooter />` children stick to the edges; the rest scrolls. */
315
327
  children: React.ReactNode;
@@ -321,6 +333,8 @@ export type SplitProps = ForwardedScrollProps & {
321
333
  };
322
334
  /** Props of the internal mobile presentation of `Layout.Split`. */
323
335
  export type MobileSplitViewProps = ForwardedScrollProps & {
336
+ /** Surface forwarded from Layout.Split. */
337
+ background?: SplitProps["background"];
324
338
  children: React.ReactNode;
325
339
  /** Accessible name; when set, the view renders as a `region` landmark. */
326
340
  "aria-label"?: string;
@@ -452,6 +466,8 @@ export type SplitHeaderProps = PanelSlotHeaderProps & {
452
466
  };
453
467
  export type SplitFooterProps = PanelSlotFooterProps;
454
468
  export type PanelContainerProps = ForwardedScrollProps & {
469
+ /** Panel surface. Defaults to primary. */
470
+ background?: SplitProps["background"];
455
471
  /** Content in source order. Per-panel header/footer components stick to the
456
472
  * edges; everything else scrolls. */
457
473
  children: React.ReactNode;
@@ -481,3 +497,11 @@ export type RightPanelProps = SidePanelProps & {
481
497
  * floating panel isn't part of the resizable row. */
482
498
  collapsible?: boolean;
483
499
  };
500
+ export type LayoutBottomBarProps = ConditionalAccessibleName & {
501
+ /** Layout.BottomBarItem declarations for the page's actions. */
502
+ children: React.ReactNode;
503
+ /** Background of each section; gaps stay transparent. Defaults to transparent. */
504
+ background?: "primary" | "secondary" | "transparent";
505
+ /** Identifier applied to the action group. */
506
+ "data-e2e-test-id"?: string;
507
+ };
@@ -0,0 +1,18 @@
1
+ import type { FC, ReactNode } from "react";
2
+ import type { SlotKey } from "../../-types";
3
+ export type LayoutBottomBarFallback = "hide" | "remaining" | "full";
4
+ export type LayoutBottomBarItemProps = {
5
+ /** Layout region whose column the item follows. */
6
+ region: SlotKey;
7
+ /** Bounds for column actions. Defaults to panel. Available lets content and
8
+ * split actions occupy their outer margins up to the side panels, keeping gaps.
9
+ * The child controls whether it fills these bounds; fallback is unchanged. */
10
+ boundary?: "panel" | "available";
11
+ /** Placement when the region has no column. Defaults to hiding the item. */
12
+ fallback?: LayoutBottomBarFallback;
13
+ /** Actions supplied and styled by the consumer. */
14
+ children: ReactNode;
15
+ /** Identifier applied to the item's action container. */
16
+ "data-e2e-test-id"?: string;
17
+ };
18
+ export declare const LayoutBottomBarItem: FC<LayoutBottomBarItemProps>;
@@ -0,0 +1 @@
1
+ export const LayoutBottomBarItem=()=>null;
@@ -0,0 +1,3 @@
1
+ import { type ReactElement } from "react";
2
+ import type { LayoutBottomBarProps } from "../-types";
3
+ export declare function LayoutBottomBar({ children, background, "data-e2e-test-id": dataE2eTestId, ...accessibleName }: LayoutBottomBarProps): ReactElement | null;
@@ -0,0 +1 @@
1
+ import React,{useLayoutEffect}from"react";import{useTheme}from"@emotion/react";import{LayoutPortal}from"../LayoutPortal";import{useLayoutVar}from"../LayoutCssVars";import{BOTTOM_BAR_HEIGHT_VAR,RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR}from"../-constants";import{useLayout}from"../useLayout";import{getBottomBarLayout}from"./getBottomBarLayout";import{StyledLayoutBottomBar}from"./StyledLayoutBottomBar";import{StyledLayoutBottomBarSection}from"./StyledLayoutBottomBarSection";let useGlobalCssVariables=(rowCount,hasRightPanel)=>{let rowHeight=useTheme().variables.layout.bottomBar.contentHeight.default,bottomBarHeightCssVar=useLayoutVar(BOTTOM_BAR_HEIGHT_VAR),rightPanelBottomBarHeightCssVar=useLayoutVar(RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR);useLayoutEffect(()=>{if(!rowCount){bottomBarHeightCssVar.remove(),rightPanelBottomBarHeightCssVar.remove();return}bottomBarHeightCssVar.set(`calc(${rowCount} * ${rowHeight} + env(safe-area-inset-bottom))`),rightPanelBottomBarHeightCssVar.set(hasRightPanel?`var(${BOTTOM_BAR_HEIGHT_VAR})`:"0px")},[rowCount,rowHeight,hasRightPanel,bottomBarHeightCssVar,rightPanelBottomBarHeightCssVar])};export function LayoutBottomBar({children,background="transparent","data-e2e-test-id":dataE2eTestId,...accessibleName}){let{leftPanel,content,splitview,rightPanel}=useLayout(),{sections,cells,rowCount,hasRightPanel}=getBottomBarLayout({children,layout:{leftPanel,content,splitview,rightPanel}});return(useGlobalCssVariables(rowCount,hasRightPanel),sections.length)?React.createElement(LayoutPortal,null,React.createElement(StyledLayoutBottomBar,{...accessibleName,role:"group",hasRightPanel:hasRightPanel,cells:cells,hasFullWidthSection:sections.some(({placement})=>"full"===placement),"data-ds-id":"LayoutBottomBar","data-e2e-test-id":dataE2eTestId},sections.map(section=>React.createElement(StyledLayoutBottomBarSection,{key:section.region,"data-ds-id":"LayoutBottomBarSection",background:background,"data-e2e-test-id":section["data-e2e-test-id"],columnIndex:section.columnIndex,rowIndex:section.rowIndex,fullWidth:"full"===section.placement,hasPanelDivider:"leftPanel"===section.region},section.children)))):null}
@@ -0,0 +1,11 @@
1
+ import type { BottomBarCell } from "./getBottomBarLayout";
2
+ type StyledLayoutBottomBarProps = {
3
+ hasRightPanel: boolean;
4
+ hasFullWidthSection: boolean;
5
+ cells: BottomBarCell[];
6
+ };
7
+ export declare const StyledLayoutBottomBar: import("@emotion/styled").StyledComponent<{
8
+ theme?: import("@emotion/react").Theme;
9
+ as?: React.ElementType;
10
+ } & StyledLayoutBottomBarProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
+ export {};
@@ -0,0 +1 @@
1
+ import styled from"@emotion/styled";import{LAYOUT_REGIONS_READY_VAR,PAGE_BOTTOM_BAR_INSET,PANEL_WIDTH_VAR,PANEL_START_VAR}from"../-constants";let getRegionStart=region=>`var(${PANEL_START_VAR[region]}, 0px)`,getRegionWidth=region=>`var(${PANEL_WIDTH_VAR[region]}, 0px)`,getPanelBounds=region=>({start:getRegionStart(region),end:`calc(${getRegionStart(region)} + ${getRegionWidth(region)})`}),getBottomBarBounds=({cells,contentAreaEnd})=>{let bounds={leftPanel:getPanelBounds("leftPanel"),content:getPanelBounds("content"),splitview:getPanelBounds("splitview"),rightPanel:getPanelBounds("rightPanel")};return cells.forEach(cell=>{"section"===cell.kind&&"column"===cell.section.placement&&"available"===cell.section.boundary&&("content"===cell.section.region&&(bounds.content.start=`min(${bounds.content.start}, ${bounds.leftPanel.end})`),"splitview"===cell.section.region&&(bounds.splitview.end=`max(${bounds.splitview.end}, ${contentAreaEnd})`))}),bounds},getBottomBarCellWidth=(cell,bounds)=>{switch(cell.kind){case"leading-gap":return bounds[cell.region].start;case"trailing-gap":return`max(0px, calc(100% - ${bounds[cell.region].end}))`;case"column-gap":return`max(0px, calc(${bounds[cell.region].start} - ${bounds[cell.previousRegion].end}))`;case"flexible-gap":return"minmax(0, 1fr)";default:{let{region,placement,fallback}=cell.section;if("remaining"===placement)return"max-content";if(cell.flexible)return"minmax(0, 1fr)";let columnWidth=`max(0px, calc(${bounds[region].end} - ${bounds[region].start}))`;return"remaining"===fallback?`minmax(max-content, ${columnWidth})`:columnWidth}}};export const StyledLayoutBottomBar=styled("div",{target:"eo8tbnx0",label:"StyledLayoutBottomBar"})(({theme,hasRightPanel,hasFullWidthSection,cells})=>{let rightPanelInset=`calc(${getRegionWidth("rightPanel")} + min(${getRegionWidth("rightPanel")}, ${theme.variables.size.spacing.xxs}))`,bounds=getBottomBarBounds({cells,contentAreaEnd:hasRightPanel?`calc(100% - ${rightPanelInset})`:"100%"}),sectionColumns=cells.flatMap((cell,index)=>"section"===cell.kind?[index+1]:[]),shadowColumns=hasFullWidthSection?"1 / -1":`${sectionColumns[0]} / ${sectionColumns[sectionColumns.length-1]+1}`;return{display:"grid",gridTemplateColumns:cells.map(cell=>getBottomBarCellWidth(cell,bounds)).join(" ")||"minmax(0, 1fr)",gridAutoRows:theme.variables.layout.bottomBar.contentHeight.default,alignContent:"start",bottom:0,boxSizing:"border-box",height:PAGE_BOTTOM_BAR_INSET,left:0,opacity:`var(${LAYOUT_REGIONS_READY_VAR}, 0)`,paddingBottom:"env(safe-area-inset-bottom)",position:"absolute",right:hasRightPanel?0:rightPanelInset,zIndex:theme.variables.zIndex.tooltip,"&::before":{content:'""',position:"absolute",inset:0,gridColumn:shadowColumns,boxShadow:theme.values.elevation[2],pointerEvents:"none"}}});
@@ -0,0 +1,13 @@
1
+ import type { LayoutBottomBarProps } from "../-types";
2
+ type StyledLayoutBottomBarSectionProps = {
3
+ background: NonNullable<LayoutBottomBarProps["background"]>;
4
+ columnIndex?: number;
5
+ rowIndex: number;
6
+ fullWidth: boolean;
7
+ hasPanelDivider: boolean;
8
+ };
9
+ export declare const StyledLayoutBottomBarSection: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme;
11
+ as?: React.ElementType;
12
+ } & StyledLayoutBottomBarSectionProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
+ export {};
@@ -0,0 +1 @@
1
+ import styled from"@emotion/styled";import isPropValid from"@emotion/is-prop-valid";export const StyledLayoutBottomBarSection=styled("div",{shouldForwardProp:prop=>"background"!==prop&&isPropValid(prop),target:"e1dq38by0",label:"StyledLayoutBottomBarSection"})(({theme,background,columnIndex,rowIndex,fullWidth,hasPanelDivider})=>({gridColumn:fullWidth?"1 / -1":(columnIndex??0)+1,gridRow:rowIndex+1,alignItems:"center",boxSizing:"border-box",backgroundColor:"transparent"===background?"transparent":theme.values.color.background[background].default,display:"flex",minWidth:0,whiteSpace:"nowrap",...hasPanelDivider&&{position:"relative","&::after":{content:'""',position:"absolute",top:0,bottom:0,right:0,width:1,backgroundColor:theme.values.color.border.secondary.default,pointerEvents:"none"}}}));
@@ -0,0 +1,42 @@
1
+ import { type ReactNode } from "react";
2
+ import type { LayoutValue, SlotKey } from "../-types";
3
+ import { type LayoutBottomBarItemProps, type LayoutBottomBarFallback } from "./BottomBarItem/LayoutBottomBarItem";
4
+ type BottomBarLayout = Pick<LayoutValue, SlotKey>;
5
+ type BottomBarItemMode = "column" | LayoutBottomBarFallback;
6
+ type VisibleSection = LayoutBottomBarItemProps & {
7
+ placement: Exclude<BottomBarItemMode, "hide">;
8
+ fallback: LayoutBottomBarFallback;
9
+ };
10
+ type SharedSection = VisibleSection & {
11
+ placement: "column" | "remaining";
12
+ };
13
+ type ArrangedSection = VisibleSection & {
14
+ columnIndex?: number;
15
+ rowIndex: number;
16
+ };
17
+ export type BottomBarCell = {
18
+ kind: "section";
19
+ section: SharedSection;
20
+ flexible: boolean;
21
+ } | {
22
+ kind: "leading-gap" | "trailing-gap";
23
+ region: SlotKey;
24
+ } | {
25
+ kind: "column-gap";
26
+ region: SlotKey;
27
+ previousRegion: SlotKey;
28
+ } | {
29
+ kind: "flexible-gap";
30
+ };
31
+ type BottomBarArrangement = {
32
+ cells: BottomBarCell[];
33
+ sections: ArrangedSection[];
34
+ rowCount: number;
35
+ hasRightPanel: boolean;
36
+ };
37
+ type BottomBarLayoutOptions = {
38
+ children: ReactNode;
39
+ layout: BottomBarLayout;
40
+ };
41
+ export declare const getBottomBarLayout: ({ children, layout, }: BottomBarLayoutOptions) => BottomBarArrangement;
42
+ export {};
@@ -0,0 +1 @@
1
+ import{Children,isValidElement}from"react";import{PANEL_ORDER}from"../-constants";import{LayoutBottomBarItem}from"./BottomBarItem/LayoutBottomBarItem";let getBottomBarItemMode=({region,fallback,layout})=>{let handle=layout[region];return"column"===handle.presentation?"column":("leftPanel"!==region||"sidebar"!==layout.leftPanel.state.variant)&&("rightPanel"!==region||"sidebar"!==layout.rightPanel.state.variant)||handle.isVisible||null===handle.animation?fallback:"column"},getVisibleSections=(children,layout)=>Children.toArray(children).flatMap(child=>{if(!isValidElement(child)||child.type!==LayoutBottomBarItem||null==child.props.children||!1===child.props.children)return[];let{region,fallback="hide"}=child.props,placement=getBottomBarItemMode({region,fallback,layout});return"hide"===placement?[]:[{...child.props,placement,fallback}]}),shouldPreserveSplitColumnWidth=sections=>{let hasLeftFallback=sections.some(({region,fallback})=>"leftPanel"===region&&"remaining"===fallback),hasContentColumn=sections.some(({region,placement})=>"content"===region&&"column"===placement),hasSplitColumn=sections.some(({region,placement})=>"splitview"===region&&"column"===placement),hasRightFallback=sections.some(({region,fallback})=>"rightPanel"===region&&"remaining"===fallback);return hasLeftFallback&&hasContentColumn&&hasSplitColumn&&!hasRightFallback},getSharedRowCells=sections=>{if(!sections.length)return[];let firstSection=sections[0],lastSection=sections[sections.length-1],hasRemainingActions=sections.some(({fallback})=>"remaining"===fallback),preserveSplitColumn=shouldPreserveSplitColumnWidth(sections),flexibleColumns={leftPanel:!1,content:hasRemainingActions,splitview:hasRemainingActions&&!preserveSplitColumn,rightPanel:!1},hasFlexibleColumn=sections.some(({region,placement})=>"column"===placement&&flexibleColumns[region]),needsFlexibleGap=hasRemainingActions&&!hasFlexibleColumn,rightActions=sections.find(({region})=>"rightPanel"===region);return[..."column"===firstSection.placement?[{kind:"leading-gap",region:firstSection.region}]:[],...sections.flatMap((section,index)=>{let previousSection=sections[index-1];return[..."column"===section.placement&&previousSection?.placement==="column"?[{kind:"column-gap",region:section.region,previousRegion:previousSection.region}]:[],...needsFlexibleGap&&section===rightActions?[{kind:"flexible-gap"}]:[],{kind:"section",section,flexible:flexibleColumns[section.region]}]}),...!hasRemainingActions||preserveSplitColumn?[{kind:"trailing-gap",region:lastSection.region}]:[],...needsFlexibleGap&&!rightActions?[{kind:"flexible-gap"}]:[]]};export const getBottomBarLayout=({children,layout})=>{let sections=getVisibleSections(children,layout),sharedSections=PANEL_ORDER.flatMap(region=>sections.filter(section=>section.region===region&&"full"!==section.placement)),fullWidthSections=sections.filter(({placement})=>"full"===placement),sharedRowCount=+!!sharedSections.length,cells=getSharedRowCells(sharedSections);return{cells,sections:[...cells.flatMap((cell,column)=>"section"===cell.kind?[{...cell.section,columnIndex:column,rowIndex:0}]:[]),...fullWidthSections.map((section,row)=>({...section,rowIndex:sharedRowCount+row}))],rowCount:sharedRowCount+fullWidthSections.length,hasRightPanel:sections.some(({region})=>"rightPanel"===region)}};
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
2
  import { LayoutProvider } from "./LayoutProvider";
3
+ import { LayoutBottomBar } from "./BottomBar/LayoutBottomBar";
4
+ import { LayoutBottomBarItem } from "./BottomBar/BottomBarItem/LayoutBottomBarItem";
3
5
  import { Content } from "./Content/Content";
4
6
  import { RightPanel } from "./RightPanel/RightPanel";
5
7
  import { RightPanelHeader } from "./RightPanel/RightPanelHeader";
@@ -20,6 +22,8 @@ export declare const PANEL_HOST_DS_ID = "PanelHost";
20
22
  declare function LayoutBase({ children, persistenceKey, storage, rules, additionalRulesData, }: LayoutProps): React.ReactElement;
21
23
  type LayoutComponent = typeof LayoutBase & {
22
24
  Provider: typeof LayoutProvider;
25
+ BottomBar: typeof LayoutBottomBar;
26
+ BottomBarItem: typeof LayoutBottomBarItem;
23
27
  LeftPanel: typeof LeftPanel;
24
28
  LeftNavBar: typeof LeftNavBar;
25
29
  LeftNavBarFooter: typeof LeftNavBarFooter;
@@ -1 +1 @@
1
- import React,{useCallback,useEffect,useMemo,useRef,useState}from"react";import styled from"@emotion/styled";import{Panel}from"../Internal/Panel/Panel";import{LayoutFloat}from"../Internal/LayoutFloat/LayoutFloat";import{useBreakpoints}from"../../shared/useBreakpoints";import{PAGE_BOTTOM_BAR_INSET,PANEL_ORDER,PANEL_WIDTH_VAR,Slot}from"./-constants";import{useLayoutPersistence,useLayoutStore}from"./context";import{MobileSplitStackContext}from"./Split/MobileSplitView/useMobileSplitStack";import{useMobileSplitViewEnabled}from"./Split/MobileSplitView/useMobileSplitView";import{LayoutProvider}from"./LayoutProvider";import{Content}from"./Content/Content";import{RightPanel}from"./RightPanel/RightPanel";import{RightPanelHeader}from"./RightPanel/RightPanelHeader";import{RightPanelFooter}from"./RightPanel/RightPanelFooter";import{LeftPanel}from"./LeftPanel/LeftPanel";import{LeftPanelHeader}from"./LeftPanel/LeftPanelHeader";import{LeftPanelFooter}from"./LeftPanel/LeftPanelFooter";import{LeftNavBar}from"./LeftNavBar/LeftNavBar";import{LeftNavBarFooter}from"./LeftNavBar/LeftNavBarFooter";import{Split}from"./Split/Split";import{SplitHeader}from"./Split/SplitHeader";import{SplitFooter}from"./Split/SplitFooter";import{LayoutPortalContext,PanelRegistryContext,PanelDeclarationsContext,PanelPresenceContext,PanelAnimationContext,PanelRowContext}from"./registry";import{usePortalTargets}from"./usePortalTargets";import{LayoutFloatDragProvider}from"../Internal/LayoutFloat/LayoutFloatDragProvider";import{useLayoutVar}from"./LayoutCssVars";import{useLayout}from"./useLayout";import{useLayoutRules}from"./useLayoutRules";import{DEFAULT_LAYOUT_RULES}from"./rules";let resizableFromState=slotState=>"sidePanel"===slotState.kind?slotState.resizable:void 0,useGlobalCssVariables=slotHosts=>{let leftPanelWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.leftPanel),contentWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.content),rightPanelWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.rightPanel);useEffect(()=>{let targets=[[Slot.leftPanel,leftPanelWidthCssVar],[Slot.content,contentWidthCssVar],[Slot.rightPanel,rightPanelWidthCssVar]],observers=[];return targets.forEach(([slot,handle])=>{let node=slotHosts[slot]??null;if(!node)return void handle.set("0px");let publishNodeWidth=()=>handle.set(`${node.getBoundingClientRect().width}px`);if(publishNodeWidth(),"undefined"==typeof ResizeObserver)return;let observer=new ResizeObserver(publishNodeWidth);observer.observe(node),observers.push(observer)}),()=>observers.forEach(observer=>observer.disconnect())},[leftPanelWidthCssVar,contentWidthCssVar,rightPanelWidthCssVar,slotHosts])},StyledLayout=styled("div",{target:"e1izvg960",label:"StyledLayout"})({position:"relative",height:"100%",width:"100%"}),StyledPanelRow=styled("div",{target:"e1izvg961",label:"StyledPanelRow"})(({theme,hasOffcanvasLeftBar})=>({height:"100%",boxSizing:"border-box",...hasOffcanvasLeftBar&&{paddingLeft:theme.variables.size.dimension.leftNavBar.width}})),StyledPanelHost=styled("div",{target:"e1izvg962",label:"StyledPanelHost"})({position:"relative",height:"100%",width:"100%"});export const PANEL_HOST_DS_ID="PanelHost";let StyledContentColumn=styled("div",{shouldForwardProp:prop=>"isSplitOpen"!==prop,target:"e1izvg963",label:"StyledContentColumn"})(({isSplitOpen,theme})=>({display:"flex",height:`calc(100% - ${PAGE_BOTTOM_BAR_INSET})`,width:"100%",...isSplitOpen&&{maxWidth:theme.variables.layout.split.maxWidth.default,marginInline:"auto",gap:theme.variables.size.spacing.xxs}})),StyledContentColumnHalf=styled("div",{target:"e1izvg964",label:"StyledContentColumnHalf"})({position:"relative",height:"100%",flex:"1 1 0",minWidth:0}),StyledMobileSplitStackHost=styled("div",{target:"e1izvg965",label:"StyledMobileSplitStackHost"})({position:"absolute",top:0,left:0,right:0,bottom:PAGE_BOTTOM_BAR_INSET,overflow:"hidden",pointerEvents:"none"}),isPanelPresent=({slot,declared,present,isShown})=>!!(declared[slot]&&(isShown(slot)||present[slot])),defaultSizeFor=({slot,panel,panelState})=>slot===Slot.content?void 0:panel?.defaultSize!==void 0?panel.defaultSize:panel?.resizable!==!1?panelState.size:void 0,childFor=(slot,contentColumn,slotHostRefs)=>slot===Slot.content?contentColumn:React.createElement(StyledPanelHost,{"data-ds-id":"PanelHost",ref:slotHostRefs[slot]});export const Layout=function({children,persistenceKey,storage,rules=DEFAULT_LAYOUT_RULES,additionalRulesData}){let[declared,setDeclared]=useState({}),layout=useLayout(),{state:layoutState,...panelCallbacks}=layout;useLayoutRules({layout,declared,rules,additionalData:additionalRulesData});let{dispatch}=useLayoutStore(),persistence=useLayoutPersistence(),resolvedKey=persistenceKey??persistence.persistenceKey,resolvedStorage=storage??persistence.storage,{isMobile}=useBreakpoints(),showMobileSplitStack=useMobileSplitViewEnabled(),[mobileSplitStackHost,setMobileSplitStackHost]=useState(null),[splitCount,setSplitCount]=useState(0),registerSplit=useCallback(()=>(setSplitCount(count=>count+1),()=>setSplitCount(count=>count-1)),[]),mobileSplitStack=useMemo(()=>({host:mobileSplitStackHost,isSplitPresent:splitCount>0,registerSplit}),[mobileSplitStackHost,splitCount,registerSplit]),rightPanelVariant=layoutState[Slot.rightPanel].variant??declared[Slot.rightPanel]?.variant??"sidebar",isRightPanelFloating=!isMobile&&"float"===rightPanelVariant,hasOffcanvasLeftBar=!!declared[Slot.leftPanel]&&"offcanvas"===layoutState[Slot.leftPanel].variant,isShown=slot=>layoutState[slot].visible&&!(slot===Slot.rightPanel&&(isRightPanelFloating||isMobile))&&!(slot===Slot.leftPanel&&hasOffcanvasLeftBar),[present,setPresent]=useState({}),presence=useMemo(()=>({setPresent:(slot,isPresent)=>setPresent(prev=>prev[slot]===isPresent?prev:{...prev,[slot]:isPresent})}),[]),panelHandles=useRef({}),panelElements=useRef({}),resizeSuppressed=useRef({}),animationControl=useMemo(()=>({setHandle:(slot,handle)=>{panelHandles.current[slot]=handle},getHandle:slot=>panelHandles.current[slot]??null,setElement:(slot,element)=>{panelElements.current[slot]=element},getElement:slot=>panelElements.current[slot]??null,setResizeSuppressed:(slot,suppressed)=>{resizeSuppressed.current[slot]=suppressed}}),[]),panelRefCallbacks=useMemo(()=>{let handleCallbacks=new Map,elementCallbacks=new Map;return{handleFor:id=>{let callback=handleCallbacks.get(id);return callback||(callback=handle=>animationControl.setHandle(id,handle),handleCallbacks.set(id,callback)),callback},elementFor:id=>{let callback=elementCallbacks.get(id);return callback||(callback=element=>animationControl.setElement(id,element),elementCallbacks.set(id,callback)),callback}}},[animationControl]),shouldSuppressLayoutCallback=useCallback(()=>Object.values(resizeSuppressed.current).some(Boolean),[]),registry=useMemo(()=>({register:(slot,reg)=>setDeclared(prev=>({...prev,[slot]:reg})),unregister:slot=>setDeclared(prev=>{if(!(slot in prev))return prev;let next={...prev};return delete next[slot],next})}),[]),{portalTargets,slotHosts,slotHostRefs,floatHostRef}=usePortalTargets({slots:PANEL_ORDER,floatableSlot:Slot.rightPanel,isFloating:isRightPanelFloating});useGlobalCssVariables(slotHosts);let rowSlots=PANEL_ORDER.filter(slot=>slot!==Slot.splitview),declaredSlots=rowSlots.filter(slot=>declared[slot]),isSolo=declaredSlots.length<=1,soloSlot=declaredSlots[0],isSplitOpen=isPanelPresent({slot:Slot.splitview,declared,present,isShown})&&isPanelPresent({slot:Slot.content,declared,present,isShown}),contentColumn=React.createElement(StyledContentColumn,{isSplitOpen:isSplitOpen},React.createElement(StyledContentColumnHalf,{ref:slotHostRefs[Slot.content]}),isSplitOpen&&React.createElement(StyledContentColumnHalf,{ref:slotHostRefs[Slot.splitview]})),panelItems=rowSlots.filter(slot=>isPanelPresent({slot,declared,present,isShown})).map(slot=>{let panel=declared[slot],panelState=layoutState[slot];return{id:slot,child:childFor(slot,contentColumn,slotHostRefs),defaultSize:defaultSizeFor({slot,panel,panelState}),minSize:panel?.minSize,maxSize:panel?.maxSize,collapsible:slot!==Slot.content&&(panel?.collapsible??!0),lockWidthOnWindowResize:panel?.lockWidthOnWindowResize,resizable:panel?.resizable??resizableFromState(panelState)}}),rowKey=panelItems.map(item=>item.id).join(","),soloHost=soloSlot&&isShown(soloSlot)?childFor(soloSlot,contentColumn,slotHostRefs):null,panelGroup=panelItems.length>0?React.createElement(Panel,{key:resolvedKey,panels:panelItems,persistenceKey:resolvedKey,storage:resolvedStorage,onResize:(id,size)=>{isShown(id)&&declared[id]?.resizable!==!1&&dispatch({type:"resize",slot:id,size:declared[id]?.lockWidthOnWindowResize?Math.round(size.inPixels):`${size.asPercentage}%`})},onCollapse:id=>panelCallbacks[id].hide(),panelHandleFor:panelRefCallbacks.handleFor,panelElementFor:panelRefCallbacks.elementFor,shouldSuppressLayoutCallback:shouldSuppressLayoutCallback}):null;return React.createElement(PanelRegistryContext.Provider,{value:registry},React.createElement(PanelDeclarationsContext.Provider,{value:declared},React.createElement(PanelPresenceContext.Provider,{value:presence},React.createElement(PanelAnimationContext.Provider,{value:animationControl},React.createElement(PanelRowContext.Provider,{value:rowKey},React.createElement(LayoutPortalContext.Provider,{value:portalTargets},React.createElement(LayoutFloatDragProvider,null,React.createElement(MobileSplitStackContext.Provider,{value:mobileSplitStack},React.createElement(StyledLayout,{"data-ds-id":"Layout"},React.createElement(StyledPanelRow,{hasOffcanvasLeftBar:hasOffcanvasLeftBar},isSolo?soloHost:panelGroup),isRightPanelFloating&&layoutState[Slot.rightPanel].visible&&React.createElement(LayoutFloat,{hostRef:floatHostRef}),children,showMobileSplitStack&&React.createElement(StyledMobileSplitStackHost,{ref:setMobileSplitStackHost}))))))))))};Layout.Provider=LayoutProvider,Layout.LeftPanel=LeftPanel,Layout.LeftNavBar=LeftNavBar,Layout.LeftNavBarFooter=LeftNavBarFooter,Layout.LeftPanelHeader=LeftPanelHeader,Layout.LeftPanelFooter=LeftPanelFooter,Layout.RightPanel=RightPanel,Layout.RightPanelHeader=RightPanelHeader,Layout.RightPanelFooter=RightPanelFooter,Layout.Content=Content,Layout.Split=Split,Layout.SplitHeader=SplitHeader,Layout.SplitFooter=SplitFooter;
1
+ import React,{useCallback,useLayoutEffect,useMemo,useRef,useState}from"react";import styled from"@emotion/styled";import{Panel}from"../Internal/Panel/Panel";import{LayoutFloat}from"../Internal/LayoutFloat/LayoutFloat";import{useBreakpoints}from"../../shared/useBreakpoints";import{PAGE_BOTTOM_BAR_INSET,PANEL_ORDER,PANEL_WIDTH_VAR,PANEL_START_VAR,LAYOUT_REGIONS_READY_VAR,Slot}from"./-constants";import{useLayoutPersistence,useLayoutStore}from"./context";import{MobileSplitStackContext}from"./Split/MobileSplitView/useMobileSplitStack";import{useMobileSplitViewEnabled}from"./Split/MobileSplitView/useMobileSplitView";import{LayoutProvider}from"./LayoutProvider";import{LayoutBottomBar}from"./BottomBar/LayoutBottomBar";import{LayoutBottomBarItem}from"./BottomBar/BottomBarItem/LayoutBottomBarItem";import{Content}from"./Content/Content";import{RightPanel}from"./RightPanel/RightPanel";import{RightPanelHeader}from"./RightPanel/RightPanelHeader";import{RightPanelFooter}from"./RightPanel/RightPanelFooter";import{LeftPanel}from"./LeftPanel/LeftPanel";import{LeftPanelHeader}from"./LeftPanel/LeftPanelHeader";import{LeftPanelFooter}from"./LeftPanel/LeftPanelFooter";import{LeftNavBar}from"./LeftNavBar/LeftNavBar";import{LeftNavBarFooter}from"./LeftNavBar/LeftNavBarFooter";import{Split}from"./Split/Split";import{SplitHeader}from"./Split/SplitHeader";import{SplitFooter}from"./Split/SplitFooter";import{LayoutPortalContext,PanelRegistryContext,PanelDeclarationsContext,PanelPresenceContext,PanelAnimationContext,PanelRowContext}from"./registry";import{usePortalTargets}from"./usePortalTargets";import{LayoutFloatDragProvider}from"../Internal/LayoutFloat/LayoutFloatDragProvider";import{useLayoutVar}from"./LayoutCssVars";import{useLayout}from"./useLayout";import{useLayoutRules}from"./useLayoutRules";import{DEFAULT_LAYOUT_RULES}from"./rules";let resizableFromState=slotState=>"sidePanel"===slotState.kind?slotState.resizable:void 0,useGlobalCssVariables=({slotHosts,root,mobileHost})=>{let leftPanelWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.leftPanel),contentWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.content),splitviewWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.splitview),rightPanelWidthCssVar=useLayoutVar(PANEL_WIDTH_VAR.rightPanel),leftPanelStartCssVar=useLayoutVar(PANEL_START_VAR.leftPanel),contentStartCssVar=useLayoutVar(PANEL_START_VAR.content),splitviewStartCssVar=useLayoutVar(PANEL_START_VAR.splitview),rightPanelStartCssVar=useLayoutVar(PANEL_START_VAR.rightPanel),regionsReadyCssVar=useLayoutVar(LAYOUT_REGIONS_READY_VAR),publishRegions=useCallback(()=>{if(!root)return;let targets=[[Slot.leftPanel,leftPanelWidthCssVar,leftPanelStartCssVar],[Slot.content,contentWidthCssVar,contentStartCssVar],[Slot.splitview,splitviewWidthCssVar,splitviewStartCssVar],[Slot.rightPanel,rightPanelWidthCssVar,rightPanelStartCssVar]],rootRect=root.getBoundingClientRect();targets.forEach(([slot,widthCssVar,startCssVar])=>{let rect=slotHosts[slot]?.getBoundingClientRect(),isMobileRegion=!!mobileHost&&(slot===Slot.content||slot===Slot.splitview),width=isMobileRegion?rootRect.width:rect?.width??0,start=isMobileRegion||!rect?0:rect.left-rootRect.left;widthCssVar.set(`${width}px`),startCssVar.set(`${start}px`)}),regionsReadyCssVar.set("1")},[slotHosts,root,mobileHost,leftPanelWidthCssVar,contentWidthCssVar,splitviewWidthCssVar,rightPanelWidthCssVar,leftPanelStartCssVar,contentStartCssVar,splitviewStartCssVar,rightPanelStartCssVar,regionsReadyCssVar]);useLayoutEffect(()=>{publishRegions()},[publishRegions]),useLayoutEffect(()=>{if(!root||"undefined"==typeof ResizeObserver)return;let observer=new ResizeObserver(publishRegions);return observer.observe(root),Object.values(slotHosts).forEach(host=>{host&&observer.observe(host)}),()=>observer.disconnect()},[root,slotHosts,publishRegions])},StyledLayout=styled("div",{target:"e101g12t0",label:"StyledLayout"})({position:"relative",height:"100%",width:"100%"}),StyledPanelRow=styled("div",{target:"e101g12t1",label:"StyledPanelRow"})(({theme,hasOffcanvasLeftBar})=>({height:"100%",boxSizing:"border-box",...hasOffcanvasLeftBar&&{paddingLeft:theme.variables.size.dimension.leftNavBar.width}})),StyledPanelHost=styled("div",{target:"e101g12t2",label:"StyledPanelHost"})({position:"relative",height:"100%",width:"100%"});export const PANEL_HOST_DS_ID="PanelHost";let StyledContentColumn=styled("div",{shouldForwardProp:prop=>"isSplitOpen"!==prop,target:"e101g12t3",label:"StyledContentColumn"})(({isSplitOpen,theme})=>({display:"flex",height:`calc(100% - ${PAGE_BOTTOM_BAR_INSET})`,width:"100%",...isSplitOpen&&{maxWidth:theme.variables.layout.split.maxWidth.default,marginInline:"auto",gap:theme.variables.size.spacing.xxs}})),StyledContentColumnHalf=styled("div",{target:"e101g12t4",label:"StyledContentColumnHalf"})({position:"relative",height:"100%",flex:"1 1 0",minWidth:0}),StyledMobileSplitStackHost=styled("div",{target:"e101g12t5",label:"StyledMobileSplitStackHost"})({position:"absolute",top:0,left:0,right:0,bottom:PAGE_BOTTOM_BAR_INSET,overflow:"hidden",pointerEvents:"none"}),isPanelPresent=({slot,declared,present,isShown})=>!!(declared[slot]&&(isShown(slot)||present[slot])),defaultSizeFor=({slot,panel,panelState})=>slot===Slot.content?void 0:panel?.defaultSize!==void 0?panel.defaultSize:panel?.resizable!==!1?panelState.size:void 0,childFor=(slot,contentColumn,slotHostRefs)=>slot===Slot.content?contentColumn:React.createElement(StyledPanelHost,{"data-ds-id":"PanelHost",ref:slotHostRefs[slot]});export const Layout=function({children,persistenceKey,storage,rules=DEFAULT_LAYOUT_RULES,additionalRulesData}){let[declared,setDeclared]=useState({}),layout=useLayout(),{state:layoutState,...panelCallbacks}=layout;useLayoutRules({layout,declared,rules,additionalData:additionalRulesData});let{dispatch}=useLayoutStore(),persistence=useLayoutPersistence(),resolvedKey=persistenceKey??persistence.persistenceKey,resolvedStorage=storage??persistence.storage,{isMobile}=useBreakpoints(),showMobileSplitStack=useMobileSplitViewEnabled(),[mobileSplitStackHost,setMobileSplitStackHost]=useState(null),[splitCount,setSplitCount]=useState(0),registerSplit=useCallback(()=>(setSplitCount(count=>count+1),()=>setSplitCount(count=>count-1)),[]),mobileSplitStack=useMemo(()=>({host:mobileSplitStackHost,isSplitPresent:splitCount>0,registerSplit}),[mobileSplitStackHost,splitCount,registerSplit]),rightPanelVariant=layoutState[Slot.rightPanel].variant??declared[Slot.rightPanel]?.variant??"sidebar",isRightPanelFloating=!isMobile&&"float"===rightPanelVariant,hasOffcanvasLeftBar=!!declared[Slot.leftPanel]&&"offcanvas"===layoutState[Slot.leftPanel].variant,isShown=slot=>layoutState[slot].visible&&!(slot===Slot.rightPanel&&(isRightPanelFloating||isMobile))&&(slot!==Slot.leftPanel||"sidebar"===layoutState.leftPanel.variant),[present,setPresent]=useState({}),presence=useMemo(()=>({setPresent:(slot,isPresent)=>setPresent(prev=>prev[slot]===isPresent?prev:{...prev,[slot]:isPresent})}),[]),panelHandles=useRef({}),panelElements=useRef({}),resizeSuppressed=useRef({}),animationControl=useMemo(()=>({setHandle:(slot,handle)=>{panelHandles.current[slot]=handle},getHandle:slot=>panelHandles.current[slot]??null,setElement:(slot,element)=>{panelElements.current[slot]=element},getElement:slot=>panelElements.current[slot]??null,setResizeSuppressed:(slot,suppressed)=>{resizeSuppressed.current[slot]=suppressed}}),[]),panelRefCallbacks=useMemo(()=>{let handleCallbacks=new Map,elementCallbacks=new Map;return{handleFor:id=>{let callback=handleCallbacks.get(id);return callback||(callback=handle=>animationControl.setHandle(id,handle),handleCallbacks.set(id,callback)),callback},elementFor:id=>{let callback=elementCallbacks.get(id);return callback||(callback=element=>animationControl.setElement(id,element),elementCallbacks.set(id,callback)),callback}}},[animationControl]),shouldSuppressLayoutCallback=useCallback(()=>Object.values(resizeSuppressed.current).some(Boolean),[]),registry=useMemo(()=>({register:(slot,reg)=>setDeclared(prev=>({...prev,[slot]:reg})),unregister:slot=>setDeclared(prev=>{if(!(slot in prev))return prev;let next={...prev};return delete next[slot],next})}),[]),{portalTargets,slotHosts,slotHostRefs,floatHostRef}=usePortalTargets({slots:PANEL_ORDER,floatableSlot:Slot.rightPanel,isFloating:isRightPanelFloating}),[layoutRoot,setLayoutRoot]=useState(null),rootPortalTargets=useMemo(()=>({...portalTargets,root:layoutRoot}),[portalTargets,layoutRoot]);useGlobalCssVariables({slotHosts,root:layoutRoot,mobileHost:mobileSplitStackHost});let rowSlots=PANEL_ORDER.filter(slot=>slot!==Slot.splitview),declaredSlots=rowSlots.filter(slot=>declared[slot]),isSolo=declaredSlots.length<=1,soloSlot=declaredSlots[0],isSplitOpen=isPanelPresent({slot:Slot.splitview,declared,present,isShown})&&isPanelPresent({slot:Slot.content,declared,present,isShown}),contentColumn=React.createElement(StyledContentColumn,{isSplitOpen:isSplitOpen},React.createElement(StyledContentColumnHalf,{ref:slotHostRefs[Slot.content]}),isSplitOpen&&React.createElement(StyledContentColumnHalf,{ref:slotHostRefs[Slot.splitview]})),panelItems=rowSlots.filter(slot=>isPanelPresent({slot,declared,present,isShown})).map(slot=>{let panel=declared[slot],panelState=layoutState[slot];return{id:slot,gapBefore:slot===Slot.rightPanel,child:childFor(slot,contentColumn,slotHostRefs),defaultSize:defaultSizeFor({slot,panel,panelState}),minSize:panel?.minSize,maxSize:panel?.maxSize,collapsible:slot!==Slot.content&&(panel?.collapsible??!0),lockWidthOnWindowResize:panel?.lockWidthOnWindowResize,resizable:panel?.resizable??resizableFromState(panelState)}}),rowKey=panelItems.map(item=>item.id).join(","),soloHost=soloSlot&&isShown(soloSlot)?childFor(soloSlot,contentColumn,slotHostRefs):null,panelGroup=panelItems.length>0?React.createElement(Panel,{key:resolvedKey,panels:panelItems,persistenceKey:resolvedKey,storage:resolvedStorage,onResize:(id,size)=>{isShown(id)&&declared[id]?.resizable!==!1&&dispatch({type:"resize",slot:id,size:declared[id]?.lockWidthOnWindowResize?Math.round(size.inPixels):`${size.asPercentage}%`})},onCollapse:id=>panelCallbacks[id].hide(),panelHandleFor:panelRefCallbacks.handleFor,panelElementFor:panelRefCallbacks.elementFor,shouldSuppressLayoutCallback:shouldSuppressLayoutCallback}):null;return React.createElement(PanelRegistryContext.Provider,{value:registry},React.createElement(PanelDeclarationsContext.Provider,{value:declared},React.createElement(PanelPresenceContext.Provider,{value:presence},React.createElement(PanelAnimationContext.Provider,{value:animationControl},React.createElement(PanelRowContext.Provider,{value:rowKey},React.createElement(LayoutPortalContext.Provider,{value:rootPortalTargets},React.createElement(LayoutFloatDragProvider,null,React.createElement(MobileSplitStackContext.Provider,{value:mobileSplitStack},React.createElement(StyledLayout,{ref:setLayoutRoot,"data-ds-id":"Layout"},React.createElement(StyledPanelRow,{hasOffcanvasLeftBar:hasOffcanvasLeftBar},isSolo?soloHost:panelGroup),isRightPanelFloating&&layoutState[Slot.rightPanel].visible&&React.createElement(LayoutFloat,{hostRef:floatHostRef}),children,showMobileSplitStack&&React.createElement(StyledMobileSplitStackHost,{ref:setMobileSplitStackHost}))))))))))};Layout.Provider=LayoutProvider,Layout.BottomBar=LayoutBottomBar,Layout.BottomBarItem=LayoutBottomBarItem,Layout.LeftPanel=LeftPanel,Layout.LeftNavBar=LeftNavBar,Layout.LeftNavBarFooter=LeftNavBarFooter,Layout.LeftPanelHeader=LeftPanelHeader,Layout.LeftPanelFooter=LeftPanelFooter,Layout.RightPanel=RightPanel,Layout.RightPanelHeader=RightPanelHeader,Layout.RightPanelFooter=RightPanelFooter,Layout.Content=Content,Layout.Split=Split,Layout.SplitHeader=SplitHeader,Layout.SplitFooter=SplitFooter;
@@ -8,7 +8,7 @@ export type LayoutVarHandle = {
8
8
  };
9
9
  /**
10
10
  * Register one layout CSS var; returns a stable imperative handle. The var is
11
- * removed on unmount, so it only exists while its producer is mounted. Call
11
+ * removed on unmount only if this producer still owns the latest write. Call
12
12
  * `.set()` from wherever the value is known — an effect (state-driven vars like
13
13
  * the subnav offset) or a ResizeObserver (measured vars) — so updates publish
14
14
  * straight to the single `<LayoutCssVars>` sink and never re-render the producer.
@@ -1 +1 @@
1
- import React,{createContext,useContext,useEffect,useMemo,useSyncExternalStore}from"react";import{Global}from"@emotion/react";let LayoutCssVarStoreContext=createContext(null);export const LayoutCssVarStoreProvider=LayoutCssVarStoreContext.Provider;let EMPTY_VARS={},NOOP_SUBSCRIBE=()=>()=>{};export const useLayoutVar=name=>{let store=useContext(LayoutCssVarStoreContext);return useEffect(()=>()=>store?.remove(name),[store,name]),useMemo(()=>({set:value=>""===value?store?.remove(name):store?.set(name,value),remove:()=>store?.remove(name)}),[store,name])};export function LayoutCssVars(){let store=useContext(LayoutCssVarStoreContext),vars=useSyncExternalStore(store?.subscribe??NOOP_SUBSCRIBE,store?store.getSnapshot:()=>EMPTY_VARS,()=>EMPTY_VARS);return React.createElement(Global,{styles:[{":root":vars}]})}
1
+ import React,{createContext,useContext,useEffect,useMemo,useSyncExternalStore}from"react";import{Global}from"@emotion/react";let LayoutCssVarStoreContext=createContext(null);export const LayoutCssVarStoreProvider=LayoutCssVarStoreContext.Provider;let EMPTY_VARS={},NOOP_SUBSCRIBE=()=>()=>{};export const useLayoutVar=name=>{let store=useContext(LayoutCssVarStoreContext),handle=useMemo(()=>{let owner=Symbol(name);return{set:value=>""===value?store?.remove(name,owner):store?.set({name,value,owner}),remove:()=>store?.remove(name,owner)}},[store,name]);return useEffect(()=>handle.remove,[handle]),handle};export function LayoutCssVars(){let store=useContext(LayoutCssVarStoreContext),vars=useSyncExternalStore(store?.subscribe??NOOP_SUBSCRIBE,store?store.getSnapshot:()=>EMPTY_VARS,()=>EMPTY_VARS);return React.createElement(Global,{styles:[{":root":vars}]})}
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ type LayoutPortalProps = {
3
+ /** Content rendered at the nearest Layout root. */
4
+ children: ReactNode;
5
+ };
6
+ export declare function LayoutPortal({ children }: LayoutPortalProps): ReactNode;
7
+ export {};
@@ -0,0 +1 @@
1
+ import{useLayoutPortal}from"./registry";export function LayoutPortal({children}){return useLayoutPortal("root",children)}
@@ -1 +1 @@
1
- import React,{useMemo,useRef}from"react";import{LayoutPersistenceProvider,LayoutStoreProvider}from"./context";import{LayoutCssVars,LayoutCssVarStoreProvider}from"./LayoutCssVars";import{createLayoutCssVarStore}from"./cssVarStore";import{createInitialState}from"./reducer";import{createLayoutStore}from"./store";export function LayoutProvider({children,config,store,persistenceKey,storage}){let storeRef=useRef(null);null===storeRef.current&&(storeRef.current=store??createLayoutStore(createInitialState(config)));let cssVarStoreRef=useRef(null);null===cssVarStoreRef.current&&(cssVarStoreRef.current=createLayoutCssVarStore());let persistence=useMemo(()=>({persistenceKey,storage}),[persistenceKey,storage]);return React.createElement(LayoutStoreProvider,{value:storeRef.current},React.createElement(LayoutPersistenceProvider,{value:persistence},React.createElement(LayoutCssVarStoreProvider,{value:cssVarStoreRef.current},React.createElement(LayoutCssVars,null),children)))}
1
+ import React,{useMemo,useRef}from"react";import{LayoutPersistenceProvider,LayoutStoreProvider}from"./context";import{LayoutCssVars,LayoutCssVarStoreProvider}from"./LayoutCssVars";import{createLayoutCssVarStore}from"./cssVarStore";import{createPanelAnimationsStore,PanelAnimationsProvider}from"./usePanelAnimations";import{createInitialState}from"./reducer";import{createLayoutStore}from"./store";export function LayoutProvider({children,config,store,persistenceKey,storage}){let storeRef=useRef(null);null===storeRef.current&&(storeRef.current=store??createLayoutStore(createInitialState(config)));let cssVarStoreRef=useRef(null);null===cssVarStoreRef.current&&(cssVarStoreRef.current=createLayoutCssVarStore());let animations=useMemo(createPanelAnimationsStore,[]),persistence=useMemo(()=>({persistenceKey,storage}),[persistenceKey,storage]);return React.createElement(LayoutStoreProvider,{value:storeRef.current},React.createElement(LayoutPersistenceProvider,{value:persistence},React.createElement(LayoutCssVarStoreProvider,{value:cssVarStoreRef.current},React.createElement(LayoutCssVars,null),React.createElement(PanelAnimationsProvider,{value:animations},children))))}
@@ -8,9 +8,8 @@ export type LeftPanelDrawerProps = ForwardedScrollProps & {
8
8
  };
9
9
  /**
10
10
  * Mobile left panel. Renders its content as a modal {@link Drawer} pinned to the
11
- * left edge instead of an in-flow column - so it does NOT declare a resizable
12
- * slot. Visibility is the shared `leftPanel` layout state, so `useLayout()`
13
- * drives it identically to the docked desktop panel; outside-click / Escape
14
- * routes back through `hide`.
11
+ * left edge. Registers the region so `useLayout()` reports an open drawer as
12
+ * `overlay`; Layout excludes it from the resizable row. Visibility is the shared
13
+ * `leftPanel` state; outside-click / Escape routes back through `hide`.
15
14
  */
16
15
  export declare const LeftPanelDrawer: React.FC<LeftPanelDrawerProps>;
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{Drawer}from"../../Internal/Drawer/Drawer";import{PanelContainer}from"../PanelContainer";import{useLeftPanelId}from"../useLeftPanelId";let StyledLeftPanelBody=styled("div",{target:"e1gnrffs0",label:"StyledLeftPanelBody"})({width:"80vw",height:"100dvh"});export const LeftPanelDrawer=({children,isVisible,hide,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>{let leftPanelId=useLeftPanelId();return React.createElement(Drawer,{isVisible:isVisible,positionX:"left",handleClose:hide,"aria-label":ariaLabel},React.createElement(StyledLeftPanelBody,null,React.createElement(PanelContainer,{id:leftPanelId,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)))};
1
+ import React from"react";import styled from"@emotion/styled";import{Slot}from"../-constants";import{useDeclarePanel}from"../registry";import{Drawer}from"../../Internal/Drawer/Drawer";import{PanelContainer}from"../PanelContainer";import{useLeftPanelId}from"../useLeftPanelId";let StyledLeftPanelBody=styled("div",{target:"e1q5nxh70",label:"StyledLeftPanelBody"})({width:"80vw",height:"100dvh"});export const LeftPanelDrawer=({children,isVisible,hide,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>{let leftPanelId=useLeftPanelId();return useDeclarePanel(Slot.leftPanel,{}),React.createElement(Drawer,{isVisible:isVisible,positionX:"left",handleClose:hide,"aria-label":ariaLabel},React.createElement(StyledLeftPanelBody,null,React.createElement(PanelContainer,{id:leftPanelId,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)))};
@@ -6,6 +6,6 @@ export type LeftBarSlot = {
6
6
  * content alone. */
7
7
  slotNode: HTMLElement | null;
8
8
  };
9
- export declare const LeftBarProvider: React.Provider<LeftBarSlot>;
9
+ export declare const LeftBarProvider: import("react").Provider<LeftBarSlot>;
10
10
  /** The left bar slot behind the left panel, if this presentation has one. */
11
11
  export declare const useLeftBarContext: () => LeftBarSlot;
@@ -6,6 +6,6 @@ export type LeftPanelCollapseState = {
6
6
  * at the column's edge so nothing inside reflows on the way down. */
7
7
  fixedContentWidth?: string;
8
8
  };
9
- export declare const LeftPanelCollapseProvider: React.Provider<LeftPanelCollapseState>;
9
+ export declare const LeftPanelCollapseProvider: import("react").Provider<LeftPanelCollapseState>;
10
10
  /** How the left panel's parts have to behave while its column narrows. */
11
11
  export declare const useLeftPanelCollapseContext: () => LeftPanelCollapseState;
@@ -6,4 +6,4 @@ import type { PanelContainerProps } from "./-types";
6
6
  * (`Layout.LeftPanelHeader` etc.) render anywhere among `children` and stick
7
7
  * to the edges; everything else scrolls.
8
8
  */
9
- export declare function PanelContainer({ children, "aria-label": ariaLabel, scrollContainerRef, onScroll, showBorderLeft, showBorderRight, "data-e2e-test-id": dataE2eTestId, }: PanelContainerProps): React.ReactElement;
9
+ export declare function PanelContainer({ children, background, "aria-label": ariaLabel, scrollContainerRef, onScroll, showBorderLeft, showBorderRight, "data-e2e-test-id": dataE2eTestId, }: PanelContainerProps): React.ReactElement;
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{Sandwich}from"../Internal/Sandwich/Sandwich";import{Container}from"../Container/Container";let CustomContainer=styled(Container,{shouldForwardProp:prop=>"showBorderLeft"!==prop&&"showBorderRight"!==prop,target:"e1ypgo8f0",label:"CustomContainer"})(({theme,showBorderLeft,showBorderRight})=>({height:"100%",borderLeft:showBorderLeft?`1px solid ${theme.values.color.border.secondary.default}`:void 0,borderRight:showBorderRight?`1px solid ${theme.values.color.border.secondary.default}`:void 0}));export function PanelContainer({children,"aria-label":ariaLabel,scrollContainerRef,onScroll,showBorderLeft=!1,showBorderRight=!1,"data-e2e-test-id":dataE2eTestId}){return React.createElement(CustomContainer,{elevation:0,squareCorners:!0,role:ariaLabel?"region":void 0,"aria-label":ariaLabel,showBorderLeft:showBorderLeft,showBorderRight:showBorderRight,"data-ds-id":"PanelContainer","data-e2e-test-id":dataE2eTestId},React.createElement(Sandwich,{scrollRef:scrollContainerRef,onScroll:onScroll},children))}
1
+ import React from"react";import styled from"@emotion/styled";import{Sandwich}from"../Internal/Sandwich/Sandwich";import{Container}from"../Container/Container";let CustomContainer=styled(Container,{shouldForwardProp:prop=>"showBorderLeft"!==prop&&"showBorderRight"!==prop&&"background"!==prop,target:"eetiugt0",label:"CustomContainer"})(({theme,showBorderLeft,showBorderRight,background})=>({height:"100%",backgroundColor:"primary"===background?theme.values.color.background.primary.default:"transparent",borderLeft:showBorderLeft?`1px solid ${theme.values.color.border.secondary.default}`:void 0,borderRight:showBorderRight?`1px solid ${theme.values.color.border.secondary.default}`:void 0}));export function PanelContainer({children,background="primary","aria-label":ariaLabel,scrollContainerRef,onScroll,showBorderLeft=!1,showBorderRight=!1,"data-e2e-test-id":dataE2eTestId}){return React.createElement(CustomContainer,{elevation:0,squareCorners:!0,background:background,role:ariaLabel?"region":void 0,"aria-label":ariaLabel,showBorderLeft:showBorderLeft,showBorderRight:showBorderRight,"data-ds-id":"PanelContainer","data-e2e-test-id":dataE2eTestId},React.createElement(Sandwich,{scrollRef:scrollContainerRef,onScroll:onScroll},children))}
@@ -1 +1 @@
1
- import React from"react";import{useTheme}from"@emotion/react";import{Slot}from"../-constants";import{useDeclarePanel,useRunCallbackOnValueChange}from"../registry";import{useLayout}from"../useLayout";import{useBreakpoints}from"../../../shared/useBreakpoints";import{RightPanelDocked}from"./RightPanelDocked";import{RightPanelSheet}from"./RightPanelSheet";export const RightPanel=({children,defaultSize=378,collapsible=!1,resizable,variant="sidebar",onVisibleChange,onVariantChange,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>{let{state:layoutState,[Slot.rightPanel]:panel}=useLayout(),{isVisible,hide}=panel,{isMobile}=useBreakpoints(),{minWidth,maxWidth}=useTheme().variables.layout.rightPanel;useDeclarePanel(Slot.rightPanel,{defaultSize,minSize:minWidth.default,maxSize:maxWidth.default,collapsible,resizable,lockWidthOnWindowResize:!0,variant});let resolvedVariant=layoutState[Slot.rightPanel].variant??variant;return useRunCallbackOnValueChange(isVisible,onVisibleChange),useRunCallbackOnValueChange(resolvedVariant,onVariantChange),isMobile?React.createElement(RightPanelSheet,{isVisible:isVisible,hide:hide,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children):React.createElement(RightPanelDocked,{isVisible:isVisible,variant:resolvedVariant,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)};
1
+ import React from"react";import{useTheme}from"@emotion/react";import{Slot}from"../-constants";import{useDeclarePanel,useRunCallbackOnValueChange}from"../registry";import{useLayout}from"../useLayout";import{useBreakpoints}from"../../../shared/useBreakpoints";import{RightPanelDocked}from"./RightPanelDocked";import{RightPanelSheet}from"./RightPanelSheet";export const RightPanel=({children,defaultSize,collapsible=!1,resizable,variant="sidebar",onVisibleChange,onVariantChange,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>{let{state:layoutState,[Slot.rightPanel]:panel}=useLayout(),{isVisible,hide}=panel,{isMobile}=useBreakpoints(),{width,minWidth,maxWidth}=useTheme().variables.layout.rightPanel,resolvedDefaultSize=defaultSize??width.open;useDeclarePanel(Slot.rightPanel,{defaultSize:resolvedDefaultSize,minSize:minWidth.default,maxSize:maxWidth.default,collapsible,resizable,lockWidthOnWindowResize:"number"==typeof resolvedDefaultSize||resolvedDefaultSize.trim().endsWith("px"),variant});let resolvedVariant=layoutState[Slot.rightPanel].variant??variant;return useRunCallbackOnValueChange(isVisible,onVisibleChange),useRunCallbackOnValueChange(resolvedVariant,onVariantChange),isMobile?React.createElement(RightPanelSheet,{isVisible:isVisible,hide:hide,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children):React.createElement(RightPanelDocked,{isVisible:isVisible,variant:resolvedVariant,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)};
@@ -3,7 +3,7 @@ import type { ForwardedScrollProps, RightPanelVariant } from "../-types";
3
3
  export type RightPanelDockedProps = ForwardedScrollProps & {
4
4
  children: React.ReactNode;
5
5
  isVisible: boolean;
6
- /** Docked column vs. minimized floating window - only the border differs here. */
6
+ /** Docked column vs. floating window, without page insets or the left border. */
7
7
  variant: RightPanelVariant;
8
8
  "aria-label": string;
9
9
  };
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{RIGHT_PANEL_BOTTOM_BAR_INSET,Slot,SUBNAV_OFFSET_VAR}from"../-constants";import{useLayoutPortal}from"../registry";import{PanelContainer}from"../PanelContainer";let StyledRightPanelSlot=styled("div",{target:"e1usejnr0",label:"StyledRightPanelSlot"})(({theme})=>({position:"absolute",left:0,right:0,bottom:RIGHT_PANEL_BOTTOM_BAR_INSET,top:`var(${SUBNAV_OFFSET_VAR}, 0px)`,overflow:"hidden",transition:`top ${theme.variables.animation.navSlide.open.duration} ${theme.variables.animation.navSlide.open.timingFunction}`}));export const RightPanelDocked=({children,isVisible,variant,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>useLayoutPortal(Slot.rightPanel,isVisible?React.createElement(StyledRightPanelSlot,null,React.createElement(PanelContainer,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,showBorderLeft:"float"!==variant},children)):null);
1
+ import React from"react";import styled from"@emotion/styled";import{RIGHT_PANEL_BOTTOM_BAR_INSET,Slot,SUBNAV_OFFSET_VAR}from"../-constants";import{useLayoutPortal}from"../registry";import{PanelContainer}from"../PanelContainer";let StyledRightPanelSlot=styled("div",{target:"e1qlsvva0",label:"StyledRightPanelSlot"})(({theme,isFloating})=>({position:"absolute",left:0,right:0,bottom:isFloating?0:RIGHT_PANEL_BOTTOM_BAR_INSET,top:isFloating?0:`var(${SUBNAV_OFFSET_VAR}, 0px)`,overflow:"hidden",transition:isFloating?"none":`top ${theme.variables.animation.navSlide.open.duration} ${theme.variables.animation.navSlide.open.timingFunction}`}));export const RightPanelDocked=({children,isVisible,variant,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>useLayoutPortal(Slot.rightPanel,isVisible?React.createElement(StyledRightPanelSlot,{isFloating:"float"===variant},React.createElement(PanelContainer,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,showBorderLeft:"float"!==variant},children)):null);
@@ -1 +1 @@
1
- import React,{useLayoutEffect}from"react";import{createPortal}from"react-dom";import{PanelContainer}from"../../PanelContainer";import{StyledMobileSplitSlideLayer}from"./StyledMobileSplitSlideLayer";import{useMobileSplitStack}from"./useMobileSplitStack";import{splitViewOffsetFor,useMobileSplitView,useMobileSplitViewEnabled}from"./useMobileSplitView";export const MobileSplitView=({children,"aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let enabled=useMobileSplitViewEnabled(),{isSplitViewActive}=useMobileSplitView(),{host,registerSplit}=useMobileSplitStack();if(useLayoutEffect(()=>{if(enabled)return registerSplit()},[enabled,registerSplit]),!enabled||!host)return null;let offset=splitViewOffsetFor(isSplitViewActive);return createPortal(React.createElement(StyledMobileSplitSlideLayer,{layer:"overlay",offset:offset,inert:0===offset?void 0:""},React.createElement(PanelContainer,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children)),host)};
1
+ import React,{useLayoutEffect}from"react";import{createPortal}from"react-dom";import{PanelContainer}from"../../PanelContainer";import{StyledMobileSplitSlideLayer}from"./StyledMobileSplitSlideLayer";import{useMobileSplitStack}from"./useMobileSplitStack";import{splitViewOffsetFor,useMobileSplitView,useMobileSplitViewEnabled}from"./useMobileSplitView";export const MobileSplitView=({children,background,"aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let enabled=useMobileSplitViewEnabled(),{isSplitViewActive}=useMobileSplitView(),{host,registerSplit}=useMobileSplitStack();if(useLayoutEffect(()=>{if(enabled)return registerSplit()},[enabled,registerSplit]),!enabled||!host)return null;let offset=splitViewOffsetFor(isSplitViewActive);return createPortal(React.createElement(StyledMobileSplitSlideLayer,{layer:"overlay",offset:offset,inert:0===offset?void 0:""},React.createElement(PanelContainer,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children)),host)};
@@ -18,5 +18,5 @@ export declare const StyledMobileSplitSlideLayer: import("@emotion/styled").Styl
18
18
  } & {
19
19
  offset: MobileSplitViewOffset;
20
20
  layer: MobileSplitLayer;
21
- }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
22
22
  export {};
@@ -1 +1 @@
1
- import styled from"@emotion/styled";let OFFSET_TRANSFORM={[-1]:"translateX(-100%)",0:"translateX(0)",1:"translateX(100%)"},LAYER_Z_INDEX={base:1,overlay:2};export const StyledMobileSplitSlideLayer=styled("div",{shouldForwardProp:prop=>"offset"!==prop&&"layer"!==prop,target:"et3u54n0",label:"StyledMobileSplitSlideLayer"})(({theme,offset,layer})=>{let{duration,timingFunction}=theme.variables.animation.navSlide.open;return{position:"absolute",inset:0,zIndex:LAYER_Z_INDEX[layer],transform:OFFSET_TRANSFORM[offset],transition:`transform ${duration} ${timingFunction}`,pointerEvents:0===offset?"auto":"none","@media (prefers-reduced-motion: reduce)":{transition:"none"}}});
1
+ import styled from"@emotion/styled";let OFFSET_TRANSFORM={[-1]:"translateX(-100%)",0:"translateX(0)",1:"translateX(100%)"},LAYER_Z_INDEX={base:1,overlay:2};export const StyledMobileSplitSlideLayer=styled("div",{shouldForwardProp:prop=>"offset"!==prop&&"layer"!==prop,target:"e99d5g40",label:"StyledMobileSplitSlideLayer"})(({theme,offset,layer})=>{let{duration,timingFunction}=theme.variables.animation.navSlide.open;return{position:"absolute",inset:0,zIndex:LAYER_Z_INDEX[layer],transform:OFFSET_TRANSFORM[offset],transition:`transform ${duration} ${timingFunction}`,pointerEvents:0===offset?"auto":"none","@media (prefers-reduced-motion: reduce)":{transition:"none"}}});
@@ -16,5 +16,5 @@ export type MobileSplitStackValue = {
16
16
  * front isn't stored here - it derives from the `splitview` slot's visibility
17
17
  * (see {@link useMobileSplitView}).
18
18
  */
19
- export declare const MobileSplitStackContext: React.Context<MobileSplitStackValue | null>;
19
+ export declare const MobileSplitStackContext: import("react").Context<MobileSplitStackValue | null>;
20
20
  export declare const useMobileSplitStack: () => MobileSplitStackValue;
@@ -1 +1 @@
1
- import React from"react";import{useBreakpoints}from"../../../shared/useBreakpoints";import{Slot}from"../-constants";import{useVisibleChange}from"../registry";import{useLayout}from"../useLayout";import{MobileSplitView}from"./MobileSplitView/MobileSplitView";import{SplitDocked}from"./SplitDocked";export const Split=({children,"aria-label":ariaLabel,onVisibleChange,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let{isMobile}=useBreakpoints(),{isVisible}=useLayout()[Slot.splitview];return useVisibleChange(isVisible,onVisibleChange),isMobile?React.createElement(MobileSplitView,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children):React.createElement(SplitDocked,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children)};
1
+ import React from"react";import{useBreakpoints}from"../../../shared/useBreakpoints";import{Slot}from"../-constants";import{useVisibleChange}from"../registry";import{useLayout}from"../useLayout";import{MobileSplitView}from"./MobileSplitView/MobileSplitView";import{SplitDocked}from"./SplitDocked";export const Split=({children,background="primary","aria-label":ariaLabel,onVisibleChange,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let{isMobile}=useBreakpoints(),{isVisible}=useLayout()[Slot.splitview];return useVisibleChange(isVisible,onVisibleChange),isMobile?React.createElement(MobileSplitView,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children):React.createElement(SplitDocked,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children)};
@@ -1 +1 @@
1
- import React from"react";import{Slot}from"../-constants";import{useDeclarePanel,useLayoutPortal}from"../registry";import{useLayout}from"../useLayout";import{PanelContainer}from"../PanelContainer";export const SplitDocked=({children,"aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let{isVisible}=useLayout()[Slot.splitview];return useDeclarePanel(Slot.splitview,{}),useLayoutPortal(Slot.splitview,isVisible?React.createElement(PanelContainer,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children):null)};
1
+ import React from"react";import{Slot}from"../-constants";import{useDeclarePanel,useLayoutPortal}from"../registry";import{useLayout}from"../useLayout";import{PanelContainer}from"../PanelContainer";export const SplitDocked=({children,background,"aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let{isVisible}=useLayout()[Slot.splitview];return useDeclarePanel(Slot.splitview,{}),useLayoutPortal(Slot.splitview,isVisible?React.createElement(PanelContainer,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children):null)};
@@ -1,5 +1,5 @@
1
1
  import type { LayoutState, LayoutStorage, LayoutStore } from "./-types";
2
- export declare const LayoutStoreProvider: React.Provider<LayoutStore | null>;
2
+ export declare const LayoutStoreProvider: import("react").Provider<LayoutStore | null>;
3
3
  /** Get the store from context, or throw if used outside the provider. */
4
4
  export declare function useLayoutStore(): LayoutStore;
5
5
  /**
@@ -11,7 +11,7 @@ export type LayoutPersistence = {
11
11
  persistenceKey?: string;
12
12
  storage?: LayoutStorage;
13
13
  };
14
- export declare const LayoutPersistenceProvider: React.Provider<LayoutPersistence>;
14
+ export declare const LayoutPersistenceProvider: import("react").Provider<LayoutPersistence>;
15
15
  /** Persistence config from the nearest `Layout.Provider` (empty if none). */
16
16
  export declare function useLayoutPersistence(): LayoutPersistence;
17
17
  /**
@@ -1,3 +1,8 @@
1
+ type LayoutCssVarWrite = {
2
+ name: string;
3
+ value: string;
4
+ owner: symbol;
5
+ };
1
6
  /**
2
7
  * Tiny pub/sub registry for the layout's CSS custom properties. Producers
3
8
  * publish a value by name (the component that owns the *why* — e.g. the NavBar
@@ -6,12 +11,14 @@
6
11
  * via the same `useSyncExternalStore` pattern.
7
12
  *
8
13
  * One name = one producer. The registry is keyed by name, so a second writer to
9
- * the same name last-wins; don't share a name across unrelated producers.
14
+ * the same name last-wins. Only that writer may remove it, so an old instance's
15
+ * delayed unmount cleanup cannot erase a replacement's value.
10
16
  */
11
17
  export type LayoutCssVarStore = {
12
18
  getSnapshot: () => Record<string, string>;
13
- set: (name: string, value: string) => void;
14
- remove: (name: string) => void;
19
+ set: (entry: LayoutCssVarWrite) => void;
20
+ remove: (name: string, owner: symbol) => void;
15
21
  subscribe: (listener: () => void) => () => void;
16
22
  };
17
23
  export declare function createLayoutCssVarStore(): LayoutCssVarStore;
24
+ export {};
@@ -1 +1 @@
1
- export function createLayoutCssVarStore(){let vars={},listeners=new Set,notify=()=>listeners.forEach(listener=>listener());return{getSnapshot:()=>vars,set:(name,value)=>{vars[name]!==value&&(vars={...vars,[name]:value},notify())},remove:name=>{if(!(name in vars))return;let next={...vars};delete next[name],vars=next,notify()},subscribe:listener=>(listeners.add(listener),()=>{listeners.delete(listener)})}}
1
+ export function createLayoutCssVarStore(){let vars={},owners=new Map,listeners=new Set,notify=()=>listeners.forEach(listener=>listener());return{getSnapshot:()=>vars,set:({name,value,owner})=>{owners.set(name,owner),vars[name]!==value&&(vars={...vars,[name]:value},notify())},remove:(name,owner)=>{if(owners.get(name)!==owner)return;owners.delete(name);let next={...vars};delete next[name],vars=next,notify()},subscribe:listener=>(listeners.add(listener),()=>{listeners.delete(listener)})}}