@amboss/design-system 4.9.4 → 4.10.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 (201) hide show
  1. package/build/cjs/components/CheckboxCard/CheckboxCard.d.ts +1 -1
  2. package/build/cjs/components/Content/ContentCheckbox/ContentCheckbox.d.ts +1 -1
  3. package/build/cjs/components/Content/ContentCitation/ContentCitation.d.ts +3 -3
  4. package/build/cjs/components/Content/ContentFontResizer/FontSizeOffsetContext.d.ts +1 -1
  5. package/build/cjs/components/Content/ContentText/ContentText.d.ts +1 -1
  6. package/build/cjs/components/Content/DosageButton/DosageButton.d.ts +1 -1
  7. package/build/cjs/components/DataTable/DataTable.d.ts +3 -2
  8. package/build/cjs/components/DataTable/TableCell.d.ts +1 -1
  9. package/build/cjs/components/DataTable/internal/tablePrimitives.d.ts +3 -3
  10. package/build/cjs/components/EntityList/styled-components.d.ts +8 -8
  11. package/build/cjs/components/Form/Checkbox/Checkbox.d.ts +2 -2
  12. package/build/cjs/components/Form/Combobox/StyledSelectComponents.d.ts +4 -4
  13. package/build/cjs/components/Form/DatePicker/DatePicker.d.ts +1 -1
  14. package/build/cjs/components/Form/MaskedInput/MaskedInput.d.ts +1 -1
  15. package/build/cjs/components/Form/Radio/Radio.d.ts +2 -2
  16. package/build/cjs/components/Form/RangeInput/RangeInput.d.ts +1 -1
  17. package/build/cjs/components/Form/Textarea/Textarea.d.ts +2 -2
  18. package/build/cjs/components/Form/Toggle/Toggle.d.ts +3 -3
  19. package/build/cjs/components/Form/ToggleButton/ToggleButton.d.ts +1 -1
  20. package/build/cjs/components/Grid/Grid.d.ts +1 -1
  21. package/build/cjs/components/Internal/Drawer/Drawer.js +3 -3
  22. package/build/cjs/components/Internal/LayoutFloat/LayoutFloat.d.ts +13 -1
  23. package/build/cjs/components/Internal/LayoutFloat/useLayoutFloatDrag.d.ts +1 -1
  24. package/build/cjs/components/Internal/Panel/Panel.d.ts +5 -3
  25. package/build/cjs/components/Internal/Panel/Panel.js +1 -1
  26. package/build/cjs/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
  27. package/build/cjs/components/Internal/PanelHeader/PanelHeader.js +1 -1
  28. package/build/cjs/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
  29. package/build/cjs/components/Layout/-constants.d.ts +10 -0
  30. package/build/cjs/components/Layout/-constants.js +1 -1
  31. package/build/cjs/components/Layout/-types.d.ts +35 -11
  32. package/build/cjs/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.d.ts +18 -0
  33. package/build/cjs/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.js +1 -0
  34. package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.d.ts +3 -0
  35. package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.js +1 -0
  36. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +11 -0
  37. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.js +1 -0
  38. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +13 -0
  39. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -0
  40. package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.d.ts +42 -0
  41. package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.js +1 -0
  42. package/build/cjs/components/Layout/Layout.d.ts +4 -0
  43. package/build/cjs/components/Layout/Layout.js +1 -1
  44. package/build/cjs/components/Layout/LayoutCssVars.d.ts +1 -1
  45. package/build/cjs/components/Layout/LayoutCssVars.js +1 -1
  46. package/build/cjs/components/Layout/LayoutPortal.d.ts +7 -0
  47. package/build/cjs/components/Layout/LayoutPortal.js +1 -0
  48. package/build/cjs/components/Layout/LayoutProvider.js +1 -1
  49. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +3 -4
  50. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  51. package/build/cjs/components/Layout/LeftPanel/useLeftBarContext.d.ts +1 -1
  52. package/build/cjs/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +1 -1
  53. package/build/cjs/components/Layout/PanelContainer.d.ts +1 -1
  54. package/build/cjs/components/Layout/PanelContainer.js +1 -1
  55. package/build/cjs/components/Layout/RightPanel/RightPanel.js +1 -1
  56. package/build/cjs/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  57. package/build/cjs/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +1 -1
  58. package/build/cjs/components/Layout/Split/MobileSplitView/useMobileSplitStack.d.ts +1 -1
  59. package/build/cjs/components/Layout/Split/Split.js +1 -1
  60. package/build/cjs/components/Layout/Split/SplitDocked.js +1 -1
  61. package/build/cjs/components/Layout/context.d.ts +2 -2
  62. package/build/cjs/components/Layout/cssVarStore.d.ts +10 -3
  63. package/build/cjs/components/Layout/cssVarStore.js +1 -1
  64. package/build/cjs/components/Layout/registry.d.ts +13 -9
  65. package/build/cjs/components/Layout/useLayout.js +1 -1
  66. package/build/cjs/components/Layout/useLeftPanelId.d.ts +1 -1
  67. package/build/cjs/components/Layout/usePanelAnimations.d.ts +12 -0
  68. package/build/cjs/components/Layout/usePanelAnimations.js +1 -0
  69. package/build/cjs/components/Layout/usePanelDockedSlide.js +1 -1
  70. package/build/cjs/components/NavBar/NavBar.d.ts +14 -18
  71. package/build/cjs/components/NavBar/NavBarContext.d.ts +1 -1
  72. package/build/cjs/components/NavBar/NavBarDropdownTriggerButton.d.ts +1 -1
  73. package/build/cjs/components/Patterns/Dialog/DialogContext.d.ts +1 -1
  74. package/build/cjs/components/Patterns/EmptyState/EmptyState.d.ts +2 -2
  75. package/build/cjs/components/Patterns/Modal/Modal.d.ts +4 -2
  76. package/build/cjs/components/Patterns/Popover/PopoverContext.d.ts +1 -1
  77. package/build/cjs/components/PromptInput/PromptInput.d.ts +1 -1
  78. package/build/cjs/components/RadioCard/RadioCard.d.ts +1 -1
  79. package/build/cjs/components/SearchResult/SearchResult.d.ts +3 -1
  80. package/build/cjs/components/Sheet/Sheet.js +1 -1
  81. package/build/cjs/components/Sheet/useSheetHeightSync.d.ts +26 -0
  82. package/build/cjs/components/Sheet/useSheetHeightSync.js +1 -0
  83. package/build/cjs/components/SubThemeProvider/SubThemeContext.d.ts +1 -1
  84. package/build/cjs/components/Tooltip/FloatingPositionedContext.d.ts +1 -1
  85. package/build/cjs/components/Utilities/ContainerQuery/ContainerQueryContext.d.ts +1 -1
  86. package/build/cjs/components/Utilities/ScreenReaderText/ScreenReaderText.d.ts +1 -1
  87. package/build/cjs/shared/components/SelectableButton.d.ts +1 -1
  88. package/build/cjs/shared/useExitAnimation.js +1 -0
  89. package/build/cjs/web-tokens/layout-vars.d.ts +7 -0
  90. package/build/cjs/web-tokens/layout-vars.js +1 -1
  91. package/build/cjs/web-tokens/layout-vars.ts +7 -0
  92. package/build/cjs/web-tokens/visualConfig.d.ts +39 -0
  93. package/build/cjs/web-tokens/visualConfig.js +1 -1
  94. package/build/esm/components/CheckboxCard/CheckboxCard.d.ts +1 -1
  95. package/build/esm/components/Content/ContentCheckbox/ContentCheckbox.d.ts +1 -1
  96. package/build/esm/components/Content/ContentCitation/ContentCitation.d.ts +3 -3
  97. package/build/esm/components/Content/ContentFontResizer/FontSizeOffsetContext.d.ts +1 -1
  98. package/build/esm/components/Content/ContentText/ContentText.d.ts +1 -1
  99. package/build/esm/components/Content/DosageButton/DosageButton.d.ts +1 -1
  100. package/build/esm/components/DataTable/DataTable.d.ts +3 -2
  101. package/build/esm/components/DataTable/TableCell.d.ts +1 -1
  102. package/build/esm/components/DataTable/internal/tablePrimitives.d.ts +3 -3
  103. package/build/esm/components/EntityList/styled-components.d.ts +8 -8
  104. package/build/esm/components/Form/Checkbox/Checkbox.d.ts +2 -2
  105. package/build/esm/components/Form/Combobox/StyledSelectComponents.d.ts +4 -4
  106. package/build/esm/components/Form/DatePicker/DatePicker.d.ts +1 -1
  107. package/build/esm/components/Form/MaskedInput/MaskedInput.d.ts +1 -1
  108. package/build/esm/components/Form/Radio/Radio.d.ts +2 -2
  109. package/build/esm/components/Form/RangeInput/RangeInput.d.ts +1 -1
  110. package/build/esm/components/Form/Textarea/Textarea.d.ts +2 -2
  111. package/build/esm/components/Form/Toggle/Toggle.d.ts +3 -3
  112. package/build/esm/components/Form/ToggleButton/ToggleButton.d.ts +1 -1
  113. package/build/esm/components/Grid/Grid.d.ts +1 -1
  114. package/build/esm/components/Internal/Drawer/Drawer.js +3 -3
  115. package/build/esm/components/Internal/LayoutFloat/LayoutFloat.d.ts +13 -1
  116. package/build/esm/components/Internal/LayoutFloat/useLayoutFloatDrag.d.ts +1 -1
  117. package/build/esm/components/Internal/Panel/Panel.d.ts +5 -3
  118. package/build/esm/components/Internal/Panel/Panel.js +1 -1
  119. package/build/esm/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
  120. package/build/esm/components/Internal/PanelHeader/PanelHeader.js +1 -1
  121. package/build/esm/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
  122. package/build/esm/components/Layout/-constants.d.ts +10 -0
  123. package/build/esm/components/Layout/-constants.js +1 -1
  124. package/build/esm/components/Layout/-types.d.ts +35 -11
  125. package/build/esm/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.d.ts +18 -0
  126. package/build/esm/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.js +1 -0
  127. package/build/esm/components/Layout/BottomBar/LayoutBottomBar.d.ts +3 -0
  128. package/build/esm/components/Layout/BottomBar/LayoutBottomBar.js +1 -0
  129. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +11 -0
  130. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.js +1 -0
  131. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +13 -0
  132. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -0
  133. package/build/esm/components/Layout/BottomBar/getBottomBarLayout.d.ts +42 -0
  134. package/build/esm/components/Layout/BottomBar/getBottomBarLayout.js +1 -0
  135. package/build/esm/components/Layout/Layout.d.ts +4 -0
  136. package/build/esm/components/Layout/Layout.js +1 -1
  137. package/build/esm/components/Layout/LayoutCssVars.d.ts +1 -1
  138. package/build/esm/components/Layout/LayoutCssVars.js +1 -1
  139. package/build/esm/components/Layout/LayoutPortal.d.ts +7 -0
  140. package/build/esm/components/Layout/LayoutPortal.js +1 -0
  141. package/build/esm/components/Layout/LayoutProvider.js +1 -1
  142. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +3 -4
  143. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  144. package/build/esm/components/Layout/LeftPanel/useLeftBarContext.d.ts +1 -1
  145. package/build/esm/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +1 -1
  146. package/build/esm/components/Layout/PanelContainer.d.ts +1 -1
  147. package/build/esm/components/Layout/PanelContainer.js +1 -1
  148. package/build/esm/components/Layout/RightPanel/RightPanel.js +1 -1
  149. package/build/esm/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  150. package/build/esm/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +1 -1
  151. package/build/esm/components/Layout/Split/MobileSplitView/useMobileSplitStack.d.ts +1 -1
  152. package/build/esm/components/Layout/Split/Split.js +1 -1
  153. package/build/esm/components/Layout/Split/SplitDocked.js +1 -1
  154. package/build/esm/components/Layout/context.d.ts +2 -2
  155. package/build/esm/components/Layout/cssVarStore.d.ts +10 -3
  156. package/build/esm/components/Layout/cssVarStore.js +1 -1
  157. package/build/esm/components/Layout/registry.d.ts +13 -9
  158. package/build/esm/components/Layout/useLayout.js +1 -1
  159. package/build/esm/components/Layout/useLeftPanelId.d.ts +1 -1
  160. package/build/esm/components/Layout/usePanelAnimations.d.ts +12 -0
  161. package/build/esm/components/Layout/usePanelAnimations.js +1 -0
  162. package/build/esm/components/Layout/usePanelDockedSlide.js +1 -1
  163. package/build/esm/components/NavBar/NavBar.d.ts +14 -18
  164. package/build/esm/components/NavBar/NavBarContext.d.ts +1 -1
  165. package/build/esm/components/NavBar/NavBarDropdownTriggerButton.d.ts +1 -1
  166. package/build/esm/components/Patterns/Dialog/DialogContext.d.ts +1 -1
  167. package/build/esm/components/Patterns/EmptyState/EmptyState.d.ts +2 -2
  168. package/build/esm/components/Patterns/Modal/Modal.d.ts +4 -2
  169. package/build/esm/components/Patterns/Popover/PopoverContext.d.ts +1 -1
  170. package/build/esm/components/PromptInput/PromptInput.d.ts +1 -1
  171. package/build/esm/components/RadioCard/RadioCard.d.ts +1 -1
  172. package/build/esm/components/SearchResult/SearchResult.d.ts +3 -1
  173. package/build/esm/components/Sheet/Sheet.js +1 -1
  174. package/build/esm/components/Sheet/useSheetHeightSync.d.ts +26 -0
  175. package/build/esm/components/Sheet/useSheetHeightSync.js +1 -0
  176. package/build/esm/components/SubThemeProvider/SubThemeContext.d.ts +1 -1
  177. package/build/esm/components/Tooltip/FloatingPositionedContext.d.ts +1 -1
  178. package/build/esm/components/Utilities/ContainerQuery/ContainerQueryContext.d.ts +1 -1
  179. package/build/esm/components/Utilities/ScreenReaderText/ScreenReaderText.d.ts +1 -1
  180. package/build/esm/shared/components/SelectableButton.d.ts +1 -1
  181. package/build/esm/shared/useExitAnimation.js +1 -0
  182. package/build/esm/web-tokens/layout-vars.d.ts +7 -0
  183. package/build/esm/web-tokens/layout-vars.js +1 -1
  184. package/build/esm/web-tokens/layout-vars.ts +7 -0
  185. package/build/esm/web-tokens/visualConfig.d.ts +39 -0
  186. package/build/esm/web-tokens/visualConfig.js +1 -1
  187. package/build/scss/_layout.scss +14 -0
  188. package/build/scss/_variables.scss +6 -0
  189. package/package.json +9 -10
  190. package/build/cjs/components/Internal/Drawer/useExitAnimation.js +0 -1
  191. package/build/cjs/shared/isWithinScrolledElement.d.ts +0 -1
  192. package/build/cjs/shared/isWithinScrolledElement.js +0 -1
  193. package/build/cjs/shared/useDragDown.d.ts +0 -14
  194. package/build/cjs/shared/useDragDown.js +0 -1
  195. package/build/esm/components/Internal/Drawer/useExitAnimation.js +0 -1
  196. package/build/esm/shared/isWithinScrolledElement.d.ts +0 -1
  197. package/build/esm/shared/isWithinScrolledElement.js +0 -1
  198. package/build/esm/shared/useDragDown.d.ts +0 -14
  199. package/build/esm/shared/useDragDown.js +0 -1
  200. /package/build/cjs/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
  201. /package/build/esm/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
@@ -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)})}}
@@ -2,13 +2,16 @@ import { type ReactNode } from "react";
2
2
  import type { PanelImperativeHandle } from "react-resizable-panels";
3
3
  import type { RightPanelVariant, Size, SlotKey } from "./-types";
4
4
  export type PortalTargets = Partial<Record<SlotKey, HTMLElement | null>>;
5
- export declare const LayoutPortalContext: React.Context<Partial<Record<"content" | "leftPanel" | "rightPanel" | "splitview", HTMLElement | null>>>;
5
+ type LayoutPortalTargets = PortalTargets & {
6
+ root?: HTMLElement | null;
7
+ };
8
+ export declare const LayoutPortalContext: import("react").Context<LayoutPortalTargets>;
6
9
  /**
7
10
  * Portal `children` into the host DOM node registered for `slot`. Returns the
8
11
  * portal (or `null` if the host isn't mounted yet). Call unconditionally -
9
12
  * gate content by passing `null` as `children`, not by skipping the call.
10
13
  */
11
- export declare function useLayoutPortal(slot: SlotKey, children: ReactNode): ReactNode;
14
+ export declare function useLayoutPortal(slot: SlotKey | "root", children: ReactNode): ReactNode;
12
15
  /**
13
16
  * Panel descriptor a marker contributes. The Group renders one resizable Panel
14
17
  * per *declared* panel that is currently shown - regardless of nesting depth.
@@ -20,8 +23,8 @@ export type PanelReg = {
20
23
  minSize?: Size;
21
24
  maxSize?: Size;
22
25
  collapsible?: boolean;
23
- /** When `false`, the panel is fixed at `defaultSize` and can't be drag-resized
24
- * (directly or via a neighbour). Defaults to resizable. */
26
+ /** When `false`, user input can't resize the panel (directly or via a
27
+ * neighbour). Container resizing still applies. Defaults to resizable. */
25
28
  resizable?: boolean;
26
29
  /** Lock this column's width when the window resizes, leaving the change to
27
30
  * the columns without it. Declared by the docked side panels, which are
@@ -35,11 +38,11 @@ export type PanelRegistry = {
35
38
  register: (slot: SlotKey, reg: PanelReg) => void;
36
39
  unregister: (slot: SlotKey) => void;
37
40
  };
38
- export declare const PanelRegistryContext: React.Context<PanelRegistry | null>;
41
+ export declare const PanelRegistryContext: import("react").Context<PanelRegistry | null>;
39
42
  /** Register this slot as a panel for the marker's lifetime. */
40
43
  export declare function useDeclarePanel(slot: SlotKey, reg: PanelReg): void;
41
44
  export type PanelDeclarations = Partial<Record<SlotKey, PanelReg>>;
42
- export declare const PanelDeclarationsContext: React.Context<Partial<Record<"content" | "leftPanel" | "rightPanel" | "splitview", PanelReg>>>;
45
+ export declare const PanelDeclarationsContext: import("react").Context<Partial<Record<"content" | "leftPanel" | "rightPanel" | "splitview", PanelReg>>>;
43
46
  /**
44
47
  * The ids of the columns in the resizable row, in order, joined with commas.
45
48
  * Changes when a column joins or leaves the row, and only then. A column that
@@ -48,7 +51,7 @@ export declare const PanelDeclarationsContext: React.Context<Partial<Record<"con
48
51
  * had the last time the same set of columns was on screen - re-checks its rest
49
52
  * against it.
50
53
  */
51
- export declare const PanelRowContext: React.Context<string>;
54
+ export declare const PanelRowContext: import("react").Context<string>;
52
55
  /** The row's current column set, as a stable key. Empty outside a Layout. */
53
56
  export declare const usePanelRow: () => string;
54
57
  /**
@@ -60,7 +63,7 @@ export declare const usePanelRow: () => string;
60
63
  export type PanelPresence = {
61
64
  setPresent: (slot: SlotKey, isPresent: boolean) => void;
62
65
  };
63
- export declare const PanelPresenceContext: React.Context<PanelPresence | null>;
66
+ export declare const PanelPresenceContext: import("react").Context<PanelPresence | null>;
64
67
  /** Report this slot's live presence so the Layout keeps its column mounted
65
68
  * through the exit animation. No-op outside a Layout. */
66
69
  export declare function usePanelPresence(slot: SlotKey, isPresent: boolean): void;
@@ -82,10 +85,11 @@ export type PanelAnimationControl = {
82
85
  /** Mute the Group's resize/collapse/persist callbacks for a slot mid-slide. */
83
86
  setResizeSuppressed: (slot: SlotKey, suppressed: boolean) => void;
84
87
  };
85
- export declare const PanelAnimationContext: React.Context<PanelAnimationControl | null>;
88
+ export declare const PanelAnimationContext: import("react").Context<PanelAnimationControl | null>;
86
89
  /** Access the Layout's panel-animation control. Null outside a Layout. */
87
90
  export declare function usePanelAnimationControl(): PanelAnimationControl | null;
88
91
  /** Run `onChange(value)` when `value` transitions (not on initial mount). */
89
92
  export declare function useRunCallbackOnValueChange<T>(value: T, onChange?: (value: T) => void): void;
90
93
  /** Fire `onChange(visible)` when `visible` transitions (not on initial mount). */
91
94
  export declare function useVisibleChange(visible: boolean, onChange?: (visible: boolean) => void): void;
95
+ export {};
@@ -1 +1 @@
1
- import{useContext}from"react";import{useLayoutSelector,useLayoutStore}from"./context";import{PanelDeclarationsContext}from"./registry";import{DEFAULT_LEFT_PANEL_VARIANT}from"./-constants";let selectAll=state=>state;function panelHandleActions({slot,visible,dispatch}){return{isVisible:visible,show:()=>dispatch({type:"setVisible",slot,visible:!0}),hide:()=>dispatch({type:"setVisible",slot,visible:!1}),reset:()=>dispatch({type:"reset",slot})}}export function useLayout(){let store=useLayoutStore(),state=useLayoutSelector(selectAll),declared=useContext(PanelDeclarationsContext),{dispatch}=store;return{state,leftPanel:{state:{...state.leftPanel,variant:state.leftPanel.variant??DEFAULT_LEFT_PANEL_VARIANT},setVariant:variant=>dispatch({type:"setVariant",panel:"leftPanel",variant}),...panelHandleActions({slot:"leftPanel",visible:state.leftPanel.visible,dispatch})},rightPanel:{state:{...state.rightPanel,variant:state.rightPanel.variant??declared.rightPanel?.variant??"sidebar"},setVariant:variant=>dispatch({type:"setVariant",panel:"rightPanel",variant}),...panelHandleActions({slot:"rightPanel",visible:state.rightPanel.visible,dispatch})},content:{state:state.content,...panelHandleActions({slot:"content",visible:state.content.visible,dispatch})},splitview:{state:state.splitview,...panelHandleActions({slot:"splitview",visible:state.splitview.visible,dispatch})}}}
1
+ import{useContext}from"react";import{useLayoutSelector,useLayoutStore}from"./context";import{usePanelAnimations}from"./usePanelAnimations";import{useBreakpoints}from"../../shared/useBreakpoints";import{MobileSplitStackContext}from"./Split/MobileSplitView/useMobileSplitStack";import{PanelDeclarationsContext}from"./registry";import{DEFAULT_LEFT_PANEL_VARIANT}from"./-constants";let selectAll=state=>state;function panelHandleActions({slot,visible,dispatch}){return{isVisible:visible,show:()=>dispatch({type:"setVisible",slot,visible:!0}),hide:()=>dispatch({type:"setVisible",slot,visible:!1}),reset:()=>dispatch({type:"reset",slot})}}export function useLayout(){let store=useLayoutStore(),state=useLayoutSelector(selectAll),declared=useContext(PanelDeclarationsContext),{dispatch}=store,{isMobile}=useBreakpoints(),animations=usePanelAnimations(),mobileStack=useContext(MobileSplitStackContext),presentationFor=slot=>state[slot].visible&&("splitview"===slot&&isMobile?mobileStack?.isSplitPresent:declared[slot])?"content"===slot?isMobile&&mobileStack?.isSplitPresent&&state.splitview.visible?"hidden":"column":"splitview"===slot?"column":"leftPanel"===slot?(state.leftPanel.variant??DEFAULT_LEFT_PANEL_VARIANT)==="sidebar"?"column":"overlay":isMobile||(state.rightPanel.variant??declared.rightPanel?.variant)==="float"?"overlay":"column":"hidden";return{state,leftPanel:{presentation:presentationFor("leftPanel"),animation:animations.leftPanel??null,state:{...state.leftPanel,variant:state.leftPanel.variant??DEFAULT_LEFT_PANEL_VARIANT},setVariant:variant=>dispatch({type:"setVariant",panel:"leftPanel",variant}),...panelHandleActions({slot:"leftPanel",visible:state.leftPanel.visible,dispatch})},rightPanel:{presentation:presentationFor("rightPanel"),animation:animations.rightPanel??null,state:{...state.rightPanel,variant:state.rightPanel.variant??declared.rightPanel?.variant??"sidebar"},setVariant:variant=>dispatch({type:"setVariant",panel:"rightPanel",variant}),...panelHandleActions({slot:"rightPanel",visible:state.rightPanel.visible,dispatch})},content:{presentation:presentationFor("content"),animation:animations.content??null,state:state.content,...panelHandleActions({slot:"content",visible:state.content.visible,dispatch})},splitview:{presentation:presentationFor("splitview"),animation:animations.splitview??null,state:state.splitview,...panelHandleActions({slot:"splitview",visible:state.splitview.visible,dispatch})}}}
@@ -2,5 +2,5 @@
2
2
  * control living OUTSIDE the panel - the nav left bar's open button - point
3
3
  * `aria-controls` at it without the two components knowing each other. Empty
4
4
  * outside a `Layout`, where there is no panel to reference. */
5
- export declare const LeftPanelIdContext: React.Context<string>;
5
+ export declare const LeftPanelIdContext: import("react").Context<string>;
6
6
  export declare const useLeftPanelId: () => string;
@@ -0,0 +1,12 @@
1
+ import type { SlotKey, PanelAnimation } from "./-types";
2
+ type Animations = Partial<Record<SlotKey, PanelAnimation | null>>;
3
+ type PanelAnimationsStore = {
4
+ getSnapshot: () => Animations;
5
+ subscribe: (listener: () => void) => () => void;
6
+ set: (slot: SlotKey, animation: PanelAnimation | null) => void;
7
+ };
8
+ export declare const PanelAnimationsProvider: import("react").Provider<PanelAnimationsStore | null>;
9
+ export declare const usePanelAnimationsStore: () => PanelAnimationsStore | null;
10
+ export declare const createPanelAnimationsStore: () => PanelAnimationsStore;
11
+ export declare const usePanelAnimations: () => Animations;
12
+ export {};
@@ -0,0 +1 @@
1
+ import{createContext,useContext,useSyncExternalStore}from"react";let EMPTY={},NOOP_SUBSCRIBE=()=>()=>{},Context=createContext(null);export const PanelAnimationsProvider=Context.Provider;export const usePanelAnimationsStore=()=>useContext(Context);export const createPanelAnimationsStore=()=>{let snapshot={},listeners=new Set;return{getSnapshot:()=>snapshot,subscribe:listener=>(listeners.add(listener),()=>{listeners.delete(listener)}),set:(slot,animation)=>{(snapshot[slot]??null)!==animation&&(snapshot={...snapshot,[slot]:animation},listeners.forEach(listener=>listener()))}}};export const usePanelAnimations=()=>{let store=usePanelAnimationsStore();return useSyncExternalStore(store?.subscribe??NOOP_SUBSCRIBE,store?.getSnapshot??(()=>EMPTY),()=>EMPTY)};
@@ -1 +1 @@
1
- import{useLayoutEffect,useRef,useState}from"react";import{useTheme}from"@emotion/react";import{useWindow}from"../../shared/useWindow";import{parseDurationMs}from"../../shared/parseDurationMs";import{prefersReducedMotion}from"../../shared/prefersReducedMotion";import{useDeclarePanel,usePanelAnimationControl,usePanelPresence,usePanelRow}from"./registry";import{useLayout}from"./useLayout";let resolveSizePx=(size,groupWidthPx)=>{if("number"==typeof size)return size;if("string"!=typeof size)return null;let parsed=parseFloat(size);return Number.isFinite(parsed)?size.trim().endsWith("px")?parsed:null!=groupWidthPx?parsed/100*groupWidthPx:null:null},groupColumnsOf=element=>{let columns=element.closest("[data-group]")?.querySelectorAll("[data-panel]");return columns?Array.from(columns):[element]},isHandleReady=handle=>{try{return handle.isCollapsed(),!0}catch{return!1}},mountDefaultSizeFor=({collapsedSize,defaultSize,isVisible,isSlidingIn})=>void 0!==collapsedSize?isVisible?defaultSize:collapsedSize:isSlidingIn?0:defaultSize,minSizeFor=({collapsedSize,isVisible,minSize})=>void 0===collapsedSize?minSize:isVisible?minSize??collapsedSize:collapsedSize;export const getMaxSize=({collapsedSize,isVisible,maxSize,openSize,phase})=>void 0===collapsedSize?maxSize:isVisible||"idle"!==phase?maxSize??openSize:collapsedSize;export function usePanelDockedSlide({slot,defaultSize,minSize,maxSize,collapsible,resizable,lockWidthOnWindowResize,collapsedSize}){let{isVisible,state}=useLayout()[slot],theme=useTheme(),window=useWindow(),animation=usePanelAnimationControl(),rowKey=usePanelRow(),reducedMotion=prefersReducedMotion(window),hasCollapsedRest=void 0!==collapsedSize,isCollapsible=collapsible&&!hasCollapsedRest,[isMounted,setIsMounted]=useState(isVisible),[phase,setPhase]=useState("idle"),[fixedWidth,setFixedWidth]=useState(null),[prevVisible,setPrevVisible]=useState(isVisible);isVisible!==prevVisible&&(setPrevVisible(isVisible),setPhase(isVisible?"entering":"exiting"),isVisible&&setIsMounted(!0),animation?.setResizeSuppressed(slot,!0));let openSize=hasCollapsedRest?state.size??defaultSize:defaultSize;useDeclarePanel(slot,{defaultSize:mountDefaultSizeFor({collapsedSize,defaultSize:openSize,isVisible,isSlidingIn:"entering"===phase&&collapsible&&!reducedMotion}),minSize:minSizeFor({collapsedSize,isVisible,minSize}),maxSize:getMaxSize({collapsedSize,isVisible,maxSize,openSize,phase}),collapsible:isCollapsible,resizable,lockWidthOnWindowResize}),usePanelPresence(slot,hasCollapsedRest||isMounted);let latestRest=useRef({isVisible,openSize,phase});return latestRest.current={isVisible,openSize,phase},useLayoutEffect(()=>{if(!hasCollapsedRest)return;let frame=0,cancelled=!1,resizeToRest=attempt=>{if(cancelled)return;let handle=animation?.getHandle(slot)??null;if(handle&&isHandleReady(handle)){let rest=latestRest.current;if("idle"!==rest.phase)return;let restSize=rest.isVisible?rest.openSize??minSize:collapsedSize;try{void 0!==restSize&&handle.resize(restSize)}catch{}return}animation&&!(attempt>=30)&&(frame=window.requestAnimationFrame(()=>resizeToRest(attempt+1)))};return Promise.resolve().then(()=>resizeToRest(0)),()=>{cancelled=!0,window.cancelAnimationFrame(frame)}},[rowKey]),useLayoutEffect(()=>{if("idle"===phase)return;let cancelled=!1,frame=0,settleTimer=0,animatedColumns=[];animation?.setResizeSuppressed(slot,!0);let{duration,timingFunction}=hasCollapsedRest?theme.variables.animation.navSlide.collapse:theme.variables.animation.navSlide.open,durationMs=parseDurationMs(duration),setColumnTransitions=enabled=>{animatedColumns.forEach(column=>{enabled?column.style.setProperty("transition",`flex-grow ${duration} ${timingFunction}`):column.style.removeProperty("transition")})},targetSize=state.size??defaultSize??minSize,openColumn=(handle,targetPx)=>{handle.isCollapsed()&&handle.expand(),handle.resize(targetPx??targetSize??minSize??"20%")},settle=handle=>{if(setColumnTransitions(!1),animation?.setResizeSuppressed(slot,!1),"entering"===phase&&handle&&!hasCollapsedRest)try{handle.getSize().inPixels<1&&openColumn(handle,null)}catch{}setFixedWidth(null),"exiting"!==phase||hasCollapsedRest||setIsMounted(!1),setPhase("idle")},runSlide=(handle,element)=>{animatedColumns=groupColumnsOf(element);let groupWidthPx=element.closest("[data-group]")?.getBoundingClientRect().width??null,targetPx=resolveSizePx(targetSize,groupWidthPx),collapsedPx=resolveSizePx(collapsedSize,groupWidthPx);setFixedWidth("entering"===phase?targetPx:handle.getSize().inPixels),reducedMotion||setColumnTransitions(!0),element.getBoundingClientRect();try{"entering"===phase?openColumn(handle,targetPx):hasCollapsedRest?handle.resize(collapsedPx??collapsedSize):handle.collapse()}catch{settle(handle);return}settleTimer=window.setTimeout(()=>settle(handle),reducedMotion?0:durationMs+80)},waitForColumn=attempt=>{if(cancelled)return;if(0===attempt&&hasCollapsedRest){frame=window.requestAnimationFrame(()=>waitForColumn(attempt+1));return}let handle=animation?.getHandle(slot)??null,element=animation?.getElement(slot)??null;return handle&&element&&isHandleReady(handle)?void runSlide(handle,element):"exiting"===phase||!animation||attempt>=30?void settle(handle):void(frame=window.requestAnimationFrame(()=>waitForColumn(attempt+1)))};return collapsible||hasCollapsedRest?waitForColumn(0):settle(animation?.getHandle(slot)??null),()=>{cancelled=!0,window.cancelAnimationFrame(frame),window.clearTimeout(settleTimer),setColumnTransitions(!1),animation?.setResizeSuppressed(slot,!1)}},[phase,slot,collapsible,hasCollapsedRest,reducedMotion,animation,window,theme]),{isMounted:hasCollapsedRest||isMounted,fixedWidth}}
1
+ import{useLayoutEffect,useMemo,useRef,useState}from"react";import{flushSync}from"react-dom";import{useTheme}from"@emotion/react";import{useWindow}from"../../shared/useWindow";import{parseDurationMs}from"../../shared/parseDurationMs";import{prefersReducedMotion}from"../../shared/prefersReducedMotion";import{useDeclarePanel,usePanelAnimationControl,usePanelPresence,usePanelRow}from"./registry";import{usePanelAnimationsStore}from"./usePanelAnimations";import{useLayout}from"./useLayout";let resolveSizePx=(size,groupWidthPx)=>{if("number"==typeof size)return size;if("string"!=typeof size)return null;let parsed=parseFloat(size);return Number.isFinite(parsed)?size.trim().endsWith("px")?parsed:null!=groupWidthPx?parsed/100*groupWidthPx:null:null},groupColumnsOf=element=>{let columns=element.closest("[data-group]")?.querySelectorAll("[data-panel]");return columns?Array.from(columns):[element]},isHandleReady=handle=>{try{return handle.isCollapsed(),!0}catch{return!1}},mountDefaultSizeFor=({collapsedSize,defaultSize,isVisible,isSlidingIn})=>void 0!==collapsedSize?isVisible?defaultSize:collapsedSize:isSlidingIn?0:defaultSize,minSizeFor=({collapsedSize,isVisible,minSize,phase})=>void 0===collapsedSize?minSize:isVisible&&"idle"===phase?minSize??collapsedSize:collapsedSize;export const getMaxSize=({collapsedSize,isVisible,maxSize,openSize,phase})=>void 0===collapsedSize?maxSize:isVisible||"idle"!==phase?maxSize??openSize:collapsedSize;export function usePanelDockedSlide({slot,defaultSize,minSize,maxSize,collapsible,resizable,lockWidthOnWindowResize,collapsedSize}){let{isVisible,state}=useLayout()[slot],theme=useTheme(),window=useWindow(),animation=usePanelAnimationControl(),rowKey=usePanelRow(),reducedMotion=prefersReducedMotion(window),hasCollapsedRest=void 0!==collapsedSize,isCollapsible=collapsible&&!hasCollapsedRest,[isMounted,setIsMounted]=useState(isVisible),[phase,setPhase]=useState("idle"),[fixedWidth,setFixedWidth]=useState(null),animations=usePanelAnimationsStore(),panelSlideAnimation=useMemo(()=>{let timing=hasCollapsedRest?theme.variables.animation.navSlide.collapse:theme.variables.animation.navSlide.open;return{property:"flex-grow",duration:reducedMotion?0:parseDurationMs(timing.duration),easing:timing.timingFunction}},[theme,hasCollapsedRest,reducedMotion]);useLayoutEffect(()=>{animations?.set(slot,"idle"===phase||reducedMotion||!collapsible&&!hasCollapsedRest?null:panelSlideAnimation)},[animations,slot,phase,panelSlideAnimation,reducedMotion,collapsible,hasCollapsedRest]),useLayoutEffect(()=>()=>animations?.set(slot,null),[animations,slot]);let[prevVisible,setPrevVisible]=useState(isVisible),declaredMountSize=useRef(hasCollapsedRest&&!isVisible?collapsedSize:state.size??defaultSize),chosenOpenSize=useRef(state.size??defaultSize),needsRestCorrection=useRef(!1);isVisible!==prevVisible&&(chosenOpenSize.current=state.size??defaultSize,needsRestCorrection.current=!0,hasCollapsedRest&&setFixedWidth(resolveSizePx(state.size??defaultSize,null)),setPrevVisible(isVisible),setPhase(isVisible?"entering":"exiting"),isVisible&&setIsMounted(!0),animation?.setResizeSuppressed(slot,!0));let openSize=hasCollapsedRest?state.size??defaultSize:defaultSize;useDeclarePanel(slot,{defaultSize:hasCollapsedRest?declaredMountSize.current:mountDefaultSizeFor({defaultSize:openSize,isVisible,isSlidingIn:"entering"===phase&&collapsible&&!reducedMotion}),minSize:minSizeFor({collapsedSize,isVisible,minSize,phase}),maxSize:getMaxSize({collapsedSize,isVisible,maxSize,openSize,phase}),collapsible:isCollapsible,resizable:(!hasCollapsedRest||!!isVisible&&"idle"===phase)&&resizable,lockWidthOnWindowResize}),usePanelPresence(slot,hasCollapsedRest||isMounted),useLayoutEffect(()=>{if(!hasCollapsedRest||"idle"!==phase||!needsRestCorrection.current)return;let restSize=isVisible?chosenOpenSize.current:collapsedSize,cancelled=!1;return animation?.setResizeSuppressed(slot,!0),Promise.resolve().then(()=>{if(cancelled)return;let handle=animation?.getHandle(slot);try{handle&&isHandleReady(handle)&&void 0!==restSize&&flushSync(()=>handle.resize(restSize))}finally{needsRestCorrection.current=!1,animation?.setResizeSuppressed(slot,!1)}}),()=>{cancelled=!0,animation?.setResizeSuppressed(slot,!1)}},[phase,hasCollapsedRest,isVisible,collapsedSize,animation,slot]);let latestRest=useRef({isVisible,openSize,phase});return latestRest.current={isVisible,openSize,phase},useLayoutEffect(()=>{if(!hasCollapsedRest)return;let frame=0,cancelled=!1,resizeToRest=attempt=>{if(cancelled)return;let handle=animation?.getHandle(slot)??null;if(handle&&isHandleReady(handle)){let rest=latestRest.current;if("idle"!==rest.phase)return;let restSize=rest.isVisible?rest.openSize??minSize:collapsedSize;try{void 0!==restSize&&handle.resize(restSize)}catch{}return}animation&&!(attempt>=30)&&(frame=window.requestAnimationFrame(()=>resizeToRest(attempt+1)))};return Promise.resolve().then(()=>resizeToRest(0)),()=>{cancelled=!0,window.cancelAnimationFrame(frame)}},[rowKey]),useLayoutEffect(()=>{if("idle"===phase)return;let cancelled=!1,frame=0,settleTimer=0,animatedColumns=[];animation?.setResizeSuppressed(slot,!0);let durationMs=panelSlideAnimation.duration,setColumnTransitions=enabled=>{animatedColumns.forEach(column=>{enabled?column.style.setProperty("transition",`${panelSlideAnimation.property} ${panelSlideAnimation.duration}ms ${panelSlideAnimation.easing}`):column.style.removeProperty("transition")})},targetSize=state.size??defaultSize??minSize,openColumn=(handle,targetPx)=>{handle.isCollapsed()&&handle.expand(),handle.resize(targetPx??targetSize??minSize??"20%")},settle=handle=>{if(setColumnTransitions(!1),animation?.setResizeSuppressed(slot,!1),"entering"===phase&&handle&&!hasCollapsedRest)try{handle.getSize().inPixels<1&&openColumn(handle,null)}catch{}setFixedWidth(null),"exiting"!==phase||hasCollapsedRest||setIsMounted(!1),setPhase("idle")},runSlide=(handle,element)=>{animatedColumns=groupColumnsOf(element);let groupWidthPx=element.closest("[data-group]")?.getBoundingClientRect().width??null,targetPx=resolveSizePx(targetSize,groupWidthPx),collapsedPx=resolveSizePx(collapsedSize,groupWidthPx);setFixedWidth("entering"===phase||hasCollapsedRest?targetPx:handle.getSize().inPixels),reducedMotion||setColumnTransitions(!0),element.getBoundingClientRect();try{"entering"===phase?openColumn(handle,targetPx):hasCollapsedRest?handle.resize(collapsedPx??collapsedSize):handle.collapse()}catch{settle(handle);return}settleTimer=window.setTimeout(()=>settle(handle),reducedMotion?0:durationMs+80)},waitForColumn=attempt=>{if(cancelled)return;if(0===attempt&&hasCollapsedRest)return void Promise.resolve().then(()=>waitForColumn(attempt+1));let handle=animation?.getHandle(slot)??null,element=animation?.getElement(slot)??null;if(handle&&element&&isHandleReady(handle)){if(hasCollapsedRest){let startSize="entering"===phase?collapsedSize:chosenOpenSize.current;void 0!==startSize&&flushSync(()=>handle.resize(startSize))}runSlide(handle,element);return}if("exiting"===phase||!animation||attempt>=30)return void settle(handle);frame=window.requestAnimationFrame(()=>waitForColumn(attempt+1))};return collapsible||hasCollapsedRest?waitForColumn(0):settle(animation?.getHandle(slot)??null),()=>{cancelled=!0,window.cancelAnimationFrame(frame),window.clearTimeout(settleTimer),setColumnTransitions(!1),animation?.setResizeSuppressed(slot,!1)}},[phase,slot,collapsible,hasCollapsedRest,reducedMotion,animation,window,theme,panelSlideAnimation]),{isMounted:hasCollapsedRest||isMounted,fixedWidth}}
@@ -1,5 +1,11 @@
1
1
  import React from "react";
2
+ import { NavBarSubMenuContainer } from "./NavBarSubMenuContainer";
3
+ import { NavBarDropdownTriggerButton } from "./NavBarDropdownTriggerButton";
4
+ import { NavBarSearchInput } from "./NavBarSearchInput";
2
5
  import { NavBarOverlayBar } from "./NavBarOverlayBar";
6
+ import { PrimaryNavContainer, PrimaryNav } from "./NavBarPrimaryNav";
7
+ import { PrimaryNavLinkItem } from "./NavBarPrimaryNavLinkItem";
8
+ import { SecondaryNav } from "./NavBarSecondaryNav";
3
9
  import { NavBarName } from "./types";
4
10
  type NavBarProps = React.PropsWithChildren<{
5
11
  subTheme: NavBarName;
@@ -7,23 +13,13 @@ type NavBarProps = React.PropsWithChildren<{
7
13
  }>;
8
14
  export declare function NavBar({ children, subTheme, isCompact, }: NavBarProps): React.ReactElement;
9
15
  export declare namespace NavBar {
10
- var PrimaryNavContainer: typeof import("./NavBarPrimaryNav").PrimaryNavContainer;
11
- var PrimaryNav: typeof import("./NavBarPrimaryNav").PrimaryNav;
12
- var PrimaryNavItem: React.ForwardRefExoticComponent<{
13
- label: string;
14
- isActive?: boolean;
15
- as?: React.ElementType;
16
- to?: string;
17
- } & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "children"> & React.RefAttributes<HTMLAnchorElement>>;
18
- var SubMenuContainer: React.ForwardRefExoticComponent<{
19
- "data-e2e-test-id"?: string;
20
- children: React.ReactNode;
21
- } & React.RefAttributes<HTMLDivElement>>;
22
- var OverlayBar: typeof NavBarOverlayBar;
23
- var SecondaryNav: typeof import("./NavBarSecondaryNav").SecondaryNav;
24
- var DropdownTriggerButton: React.ForwardRefExoticComponent<Pick<import("../..").ButtonProps, "onFocus" | "onBlur" | "onClick" | "disabled"> & {
25
- children?: React.ReactNode | undefined;
26
- } & React.RefAttributes<HTMLButtonElement>>;
27
- var SearchInput: React.ForwardRefExoticComponent<import("./NavBarSearchInput").NavBarSearchInputProps & React.RefAttributes<HTMLButtonElement>>;
16
+ export { PrimaryNavContainer };
17
+ export { PrimaryNav };
18
+ export { PrimaryNavLinkItem as PrimaryNavItem };
19
+ export { NavBarSubMenuContainer as SubMenuContainer };
20
+ export { NavBarOverlayBar as OverlayBar };
21
+ export { SecondaryNav };
22
+ export { NavBarDropdownTriggerButton as DropdownTriggerButton };
23
+ export { NavBarSearchInput as SearchInput };
28
24
  }
29
25
  export {};
@@ -6,6 +6,6 @@ type NavBarContextValue = {
6
6
  primaryNavRef: RefObject<HTMLElement>;
7
7
  secondaryNavRef: RefObject<HTMLElement>;
8
8
  };
9
- export declare const NavBarContext: React.Context<NavBarContextValue>;
9
+ export declare const NavBarContext: import("react").Context<NavBarContextValue>;
10
10
  export declare function useNavBarContext(): NavBarContextValue;
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import type { ButtonProps } from "../Button/Button";
3
- export declare const NavBarDropdownTriggerButton: React.ForwardRefExoticComponent<Pick<ButtonProps, "onFocus" | "onBlur" | "onClick" | "disabled"> & {
3
+ export declare const NavBarDropdownTriggerButton: React.ForwardRefExoticComponent<Pick<ButtonProps, "disabled" | "onBlur" | "onClick" | "onFocus"> & {
4
4
  children?: React.ReactNode | undefined;
5
5
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -1 +1 @@
1
- export declare const DialogContext: React.Context<boolean>;
1
+ export declare const DialogContext: import("react").Context<boolean>;
@@ -20,8 +20,8 @@ export type EmptyStateProps = {
20
20
  };
21
21
  export declare function EmptyState({ title, titleAs, description, variant, icon, children, "data-e2e-test-id": dataE2eTestId, ...ariaAttributes }: EmptyStateProps): React.ReactElement;
22
22
  export declare namespace EmptyState {
23
- var ButtonGroup: typeof EmptyStateButtonGroup;
24
- var Link: typeof EmptyStateLink;
23
+ export { EmptyStateButtonGroup as ButtonGroup };
24
+ export { EmptyStateLink as Link };
25
25
  }
26
26
  declare function EmptyStateButtonGroup<C extends React.ElementType = "button">({ ...rest }: Omit<ButtonGroupProps<C>, "buttonSize">): React.ReactElement;
27
27
  declare function EmptyStateLink({ children, ...rest }: Omit<LinkProps, "size" | "color" | "weight"> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
@@ -102,9 +102,11 @@ type ImageProps = {
102
102
  ImageComponent: React.ElementType<any>;
103
103
  };
104
104
  export type ModalProps = BaseProps & ConditionalRoleProps & LabelProps & ImageProps & Pick<PortalProps, "portalContainer">;
105
+ declare const ModalStack: ({ children, ...rest }: Omit<StackProps, "space">) => React.JSX.Element;
106
+ declare const ModalText: ({ children, ...rest }: Omit<TextProps, "size" | "variant">) => React.JSX.Element;
105
107
  export declare function Modal({ header, subHeader, labelHeader, children, imageUrl, ImageComponent, secondaryButton, cancelButtonLabel, isDismissible, isFullScreen, isMaxWidthLimit, actionButton, role, onAction, size, privateProps: { skipPortal, height, zeroPadding, tabbableOptions }, portalContainer, closeButtonAriaLabel, "data-e2e-test-id": dataE2eTestId, imageAlt, initialFocus, ...ariaAttributes }: ModalProps): React.ReactElement;
106
108
  export declare namespace Modal {
107
- var Stack: ({ children, ...rest }: Omit<StackProps, "space">) => React.JSX.Element;
108
- var Text: ({ children, ...rest }: Omit<TextProps, "size" | "variant">) => React.JSX.Element;
109
+ export { ModalStack as Stack };
110
+ export { ModalText as Text };
109
111
  }
110
112
  export {};
@@ -6,4 +6,4 @@ export type PopoverContextValue = {
6
6
  */
7
7
  portalContainer?: HTMLElement | null;
8
8
  };
9
- export declare const PopoverContext: React.Context<PopoverContextValue>;
9
+ export declare const PopoverContext: import("react").Context<PopoverContextValue>;
@@ -70,5 +70,5 @@ export declare const PromptInput: React.ForwardRefExoticComponent<{
70
70
  onEnterKey: () => void;
71
71
  /** Renders an icon to the left inside the textarea */
72
72
  leftIcon?: IconName;
73
- } & Omit<PromptTextAreaProps, "size" | "selectedListItem" | "isAutocompleteListOpen" | "hasAutocomplete" | "hasLeftIcon"> & Pick<AutocompleteListProps, "portalContainer" | "autocompleteListItems" | "autocompleteListFooter"> & React.RefAttributes<HTMLTextAreaElement>>;
73
+ } & Omit<PromptTextAreaProps, "hasAutocomplete" | "hasLeftIcon" | "isAutocompleteListOpen" | "selectedListItem" | "size"> & Pick<AutocompleteListProps, "autocompleteListFooter" | "autocompleteListItems" | "portalContainer"> & React.RefAttributes<HTMLTextAreaElement>>;
74
74
  export {};
@@ -13,4 +13,4 @@ export declare const RadioCard: React.ForwardRefExoticComponent<{
13
13
  renderContent?: (params: {
14
14
  isSelected: boolean;
15
15
  }) => React.ReactNode;
16
- } & Omit<RadioProps, "errorMessages" | "hint" | "hideLabel"> & React.RefAttributes<HTMLInputElement>>;
16
+ } & Omit<RadioProps, "errorMessages" | "hideLabel" | "hint"> & React.RefAttributes<HTMLInputElement>>;
@@ -33,7 +33,9 @@ export type SearchResultProps = {
33
33
  /** The test id for the result's primary target. */
34
34
  "data-e2e-test-id"?: string;
35
35
  };
36
+ declare const defaultProps: Partial<SearchResultProps>;
36
37
  export declare function SearchResult({ title, subtitle, icon, details, body, secondaryTargets, link, labels, "data-e2e-test-id": dataE2eTestId, ...ariaAttributes }: SearchResultProps): React.ReactElement;
37
38
  export declare namespace SearchResult {
38
- var defaultProps: Partial<SearchResultProps>;
39
+ export { defaultProps };
39
40
  }
41
+ export {};
@@ -1 +1 @@
1
- import React,{useRef,useLayoutEffect,useState,useEffect,useCallback}from"react";import styled from"@emotion/styled";import{createPortal}from"react-dom";import{keyframes,Global}from"@emotion/react";import{FocusTrapWrapper}from"../../shared/FocusTrapWrapper";import{Container}from"../Container/Container";import{useDragDown}from"../../shared/useDragDown";import{StyledBackdrop}from"../Lightbox/Lightbox";import{isWithinScrolledElement}from"../../shared/isWithinScrolledElement";export const SHEET_MAX_HEIGHT="80svh";let StyledContainer=styled("div",{target:"e137uunh0",label:"StyledContainer"})(({theme,containerHeight,isClosing,isOpening,dragOffset=0})=>{let animation;if(containerHeight){let slideOut=keyframes({from:{transform:`translateY(${dragOffset}px)`},to:{transform:`translateY(${containerHeight}px)`}}),slideIn=keyframes({from:{transform:`translateY(${containerHeight}px)`},to:{transform:"translateY(0px)"}});animation=isClosing?`200ms ease-out forwards ${slideOut}`:isOpening?`300ms ease-out forwards ${slideIn}`:"none"}return{position:"fixed",left:0,bottom:0,width:"100vw",transformOrigin:"bottom",animation,boxSizing:"border-box",zIndex:theme.variables.zIndex.modal,"> div":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}),StyledContentContainer=styled("div",{target:"e137uunh1",label:"StyledContentContainer"})(({theme,isClosing,isOpening})=>{let animation,fadeOut=keyframes({from:{opacity:theme.variables.opacity.visible},to:{opacity:theme.variables.opacity.hidden}}),fadeIn=keyframes({from:{opacity:theme.variables.opacity.hidden},to:{opacity:theme.variables.opacity.visible}}),opacity=theme.variables.opacity.hidden;return isClosing?animation=`50ms ease-out forwards ${fadeOut}`:isOpening?animation=`50ms ease-out 250ms forwards ${fadeIn}`:(animation="none",opacity=theme.variables.opacity.visible),{overflow:"auto",maxHeight:"80svh",boxSizing:"border-box",overscrollBehavior:"none",backgroundColor:theme.values.color.background.elevated.default,opacity,animation}}),StyledHandleContainer=styled("div",{target:"e137uunh2",label:"StyledHandleContainer"})(({theme,isContentContainerScrolled})=>({padding:`${theme.variables.size.spacing.xs} 0`,display:"flex",justifyContent:"center",backgroundColor:theme.values.color.background.elevated.default,...isContentContainerScrolled&&{boxShadow:theme.values.elevation[1]}})),StyledHandle=styled("div",{target:"e137uunh3",label:"StyledHandle"})(({theme})=>({width:"80px",height:"4px",borderRadius:theme.variables.size.borderRadius.xs,backgroundColor:theme.values.color.divider.secondary}));export function Sheet({id,children,hasBackdrop,isVisible,onClose,onUnmount,portalContainer,dismissOnOutsideClick=!0,disableInitialFocus,disableReturnFocusToTrigger,onClickOutsideDeactivates,"data-e2e-test-id":dataE2eTestId,role,...ariaAttributes}){let[isClosing,setClosing]=useState(!1),[isOpening,setOpening]=useState(!1),[containerHeight,setContainerHeight]=useState(0),[isContentContainerScrolled,setContentContainerScrolled]=useState(!1),containerRef=useRef(null),contentContainerRef=useRef(null),handleContainerRef=useRef(null),prevVisibleState=useRef(!1),dragOffset=useRef(0),isDragStarted=useRef(!1);useLayoutEffect(()=>{isVisible&&setOpening(!0)},[isVisible]),useLayoutEffect(()=>{isVisible&&containerRef.current&&setContainerHeight(containerRef.current.getBoundingClientRect().height)},[isVisible,children]),useEffect(()=>{!isVisible&&prevVisibleState.current&&setClosing(!0),prevVisibleState.current=isVisible},[isVisible]),useEffect(()=>{isVisible&&isClosing&&onClose()},[isVisible,isClosing,onClose]);let handleDragStart=useCallback(()=>{requestAnimationFrame(()=>{contentContainerRef.current?.scrollTop===0&&containerRef.current&&(containerRef.current.style.animation="none",containerRef.current.style.transition="transform 0.1s ease",containerRef.current.style.transform="translateY(0px)",dragOffset.current=0,isDragStarted.current=!0)})},[containerRef,contentContainerRef]),handleDrag=useCallback((_,offsetFromStart)=>{let containerCurrentHeight=containerRef.current?.getBoundingClientRect()?.height??0;requestAnimationFrame(()=>{isDragStarted.current&&containerRef.current&&contentContainerRef.current?.scrollTop===0&&offsetFromStart<containerCurrentHeight&&(containerRef.current.style.transform=`translateY(${offsetFromStart}px)`,dragOffset.current=offsetFromStart)})},[containerRef,contentContainerRef]),handleDragEnd=useCallback((_,offsetFromStart)=>{let containerCurrentHeight=containerRef.current?.getBoundingClientRect()?.height??0,minDragDistance=containerCurrentHeight<300?containerCurrentHeight/4:150;requestAnimationFrame(()=>{isDragStarted.current&&(offsetFromStart>=minDragDistance&&contentContainerRef.current?.scrollTop===0?onClose():containerRef.current&&(containerRef.current.style.transform="translateY(0px)",dragOffset.current=0)),isDragStarted.current=!1})},[containerRef,onClose]),handleDragCancel=useCallback(()=>{requestAnimationFrame(()=>{isDragStarted.current&&containerRef.current&&(containerRef.current.style.transform="translateY(0px)",dragOffset.current=0),isDragStarted.current=!1})},[containerRef]),shouldInitiateDrag=useCallback(event=>{let target=event.target;return!!handleContainerRef.current?.contains(target)||!(isWithinScrolledElement(target,containerRef.current)||(contentContainerRef.current?.scrollTop??0)>0)},[containerRef,contentContainerRef,handleContainerRef]);useDragDown({ref:containerRef,isVisible,onDragStart:handleDragStart,onDrag:handleDrag,onDragEnd:handleDragEnd,onDragCancel:handleDragCancel,shouldInitiateDrag});let handlePostDeactivate=useCallback(()=>{onClose()},[onClose]);if(!((isVisible||isClosing)&&!(isVisible&&isClosing)))return null;let sheetElm=React.createElement(React.Fragment,null,React.createElement(Global,{styles:[{html:{overflow:"hidden",overscrollBehavior:"none"}}]}),React.createElement(FocusTrapWrapper,{active:isVisible,focusTrapOptions:{clickOutsideDeactivates:dismissOnOutsideClick&&onClickOutsideDeactivates?onClickOutsideDeactivates:dismissOnOutsideClick,allowOutsideClick:!0,escapeDeactivates:!0,preventScroll:!0,initialFocus:()=>!disableInitialFocus,returnFocusOnDeactivate:!disableReturnFocusToTrigger,fallbackFocus:'[data-ds-id="Sheet"]',onPostDeactivate:handlePostDeactivate}},React.createElement(StyledContainer,{...id?{id}:{},"data-e2e-test-id":dataE2eTestId,"data-ds-id":"Sheet",containerHeight:containerHeight,isClosing:isClosing,isOpening:isOpening,ref:containerRef,dragOffset:dragOffset.current,onAnimationEnd:()=>{isClosing?(setClosing(!1),setContainerHeight(0),dragOffset.current=0,onUnmount&&onUnmount()):isOpening&&setOpening(!1)},role:role,...ariaAttributes},React.createElement(Container,{elevation:4},React.createElement(StyledHandleContainer,{ref:handleContainerRef,isContentContainerScrolled:isContentContainerScrolled},React.createElement(StyledHandle,null)),React.createElement(StyledContentContainer,{isClosing:isClosing,isOpening:isOpening,ref:contentContainerRef,onScroll:()=>{setContentContainerScrolled(contentContainerRef.current?.scrollTop!==0)},onAnimationEnd:evt=>evt.stopPropagation()},children))))),wrappedSheet=hasBackdrop&&!isClosing?React.createElement(StyledBackdrop,null,sheetElm):sheetElm,container=portalContainer||!!document&&document.body;return container&&createPortal(wrappedSheet,container)}
1
+ import React,{useRef,useState,useEffect,useCallback}from"react";import styled from"@emotion/styled";import{createPortal}from"react-dom";import{keyframes,Global,useTheme}from"@emotion/react";import{FocusTrapWrapper}from"../../shared/FocusTrapWrapper";import{Container}from"../Container/Container";import{useExitAnimation}from"../../shared/useExitAnimation";import{useDocument}from"../../shared/useDocument";import{SHEET_HEIGHT_VAR,useSheetHeightSync}from"./useSheetHeightSync";export const SHEET_MAX_HEIGHT="80svh";let SCROLL_TIMELINE="--sheet-scroll",supportsScrollDrivenAnimations=()=>"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("animation-timeline: scroll()"),globalStyles={html:{overflow:"hidden",overscrollBehavior:"none"}},slideIn=keyframes({from:{transform:"translateY(100%)"},to:{transform:"translateY(0)"}},"label:slideIn"),slideOut=keyframes({from:{transform:"translateY(0)"},to:{transform:"translateY(100%)"}},"label:slideOut"),canScrollFurther=({element,direction})=>{if(!(direction<0?element.scrollTop>0:element.scrollTop+element.clientHeight<element.scrollHeight-1))return!1;let overflowY=element.ownerDocument.defaultView?.getComputedStyle(element).overflowY;return!!overflowY&&["auto","scroll","overlay"].includes(overflowY)},canContentTakeScroll=({target,boundary,direction})=>{let element=target instanceof Element?target:null;for(;element&&element!==boundary;){if(canScrollFurther({element,direction}))return!0;element=element.parentElement}return!1},SCROLL_KEY_DIRECTIONS={ArrowUp:-1,PageUp:-1,Home:-1,ArrowDown:1,PageDown:1,End:1},getScrollKeyDirection=({event,scroller})=>{let{target,key,shiftKey}=event;if(!(target instanceof HTMLElement&&(target.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(target.tagName)))){if(" "===key){if(target!==scroller)return;return shiftKey?-1:1}return SCROLL_KEY_DIRECTIONS[key]}},StyledRoot=styled("div",{target:"e1prhk2x0",label:"StyledRoot"})(({theme})=>({position:"fixed",inset:0,zIndex:theme.variables.zIndex.modal,pointerEvents:"none",timelineScope:SCROLL_TIMELINE})),holdStill=keyframes({from:{transform:"translateY(0)"},to:{transform:"translateY(0)"}},"label:holdStill"),getSlideAnimation=({isLeaving,isSwipedAway,theme})=>{let{enter,exit}=theme.variables.animation.sheet;return isLeaving?isSwipedAway?`${holdStill} ${exit.duration} linear forwards`:`${slideOut} ${exit.duration} ${exit.timingFunction} forwards`:`${slideIn} ${enter.duration} ${enter.timingFunction} both`},StyledBackdrop=styled("div",{target:"e1prhk2x1",label:"StyledBackdrop"})(({theme,isLeaving})=>{let{hidden,visible}=theme.variables.opacity,fadeIn=keyframes({from:{opacity:hidden},to:{opacity:visible}}),fadeOut=keyframes({from:{opacity:visible},to:{opacity:hidden}}),{enter,exit}=theme.variables.animation.sheet;return{position:"absolute",inset:0,pointerEvents:isLeaving?"none":"auto",animation:isLeaving?`${fadeOut} ${exit.duration} ${enter.timingFunction} forwards`:`${fadeIn} ${enter.duration} ${enter.timingFunction} both`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}}),StyledBackdropFill=styled("div",{target:"e1prhk2x2",label:"StyledBackdropFill"})(({theme})=>{let{hidden,visible}=theme.variables.opacity,dimWithSheet=keyframes({from:{opacity:hidden},to:{opacity:visible}});return{position:"absolute",inset:0,background:theme.values.color.background.backdrop.default,"@supports (animation-timeline: scroll())":{animation:`${dimWithSheet} linear both`,animationTimeline:SCROLL_TIMELINE}}}),StyledFrame=styled("div",{target:"e1prhk2x3",label:"StyledFrame"})(({theme})=>({position:"absolute",left:0,right:0,bottom:0,height:`var(${SHEET_HEIGHT_VAR}, auto)`,"::after":{content:'""',position:"absolute",top:"calc(100% - 1px)",left:0,right:0,height:SHEET_MAX_HEIGHT,backgroundColor:theme.values.color.background.elevated.default}})),StyledScroller=styled("div",{target:"e1prhk2x4",label:"StyledScroller"})(({theme,isLeaving,isSwipedAway})=>({position:"absolute",left:0,right:0,bottom:0,height:"calc(100% + 112px)",overflowY:"scroll",scrollSnapType:"y mandatory",overscrollBehavior:"none",scrollbarWidth:"none","::-webkit-scrollbar":{display:"none"},scrollTimeline:`${SCROLL_TIMELINE} y`,pointerEvents:isLeaving?"none":"auto",outline:"none",animation:getSlideAnimation({isLeaving,isSwipedAway,theme}),"@media (prefers-reduced-motion: reduce)":{animation:"none"}})),StyledClosedSnapPoint=styled("div",{target:"e1prhk2x5",label:"StyledClosedSnapPoint"})({height:"calc(100% + 64px + 1px)",scrollSnapAlign:"start"}),StyledSurface=styled("div",{target:"e1prhk2x6",label:"StyledSurface"})({scrollSnapAlign:"end","> div":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),StyledContentContainer=styled("div",{target:"e1prhk2x7",label:"StyledContentContainer"})(({theme})=>({overflow:"auto",maxHeight:SHEET_MAX_HEIGHT,boxSizing:"border-box",backgroundColor:theme.values.color.background.elevated.default})),StyledHandleContainer=styled("div",{target:"e1prhk2x8",label:"StyledHandleContainer"})(({theme,isContentContainerScrolled})=>({padding:`${theme.variables.size.spacing.xs} 0`,display:"flex",justifyContent:"center",backgroundColor:theme.values.color.background.elevated.default,...isContentContainerScrolled&&{boxShadow:theme.values.elevation[1]}})),StyledHandle=styled("div",{target:"e1prhk2x9",label:"StyledHandle"})(({theme})=>({width:"80px",height:"4px",borderRadius:theme.variables.size.borderRadius.xs,backgroundColor:theme.values.color.divider.secondary}));export function Sheet({id,children,hasBackdrop,isVisible,onClose,onUnmount,portalContainer,dismissOnOutsideClick=!0,disableInitialFocus,disableReturnFocusToTrigger,onClickOutsideDeactivates,"data-e2e-test-id":dataE2eTestId,role,...ariaAttributes}){let theme=useTheme(),document=useDocument(),{isMounted,isLeaving,onAnimationEnd}=useExitAnimation(isVisible),[isContentContainerScrolled,setContentContainerScrolled]=useState(!1),[isSwipedAway,setSwipedAway]=useState(!1),frameRef=useRef(null),scrollerRef=useRef(null),surfaceRef=useRef(null),backdropFillRef=useRef(null),contentContainerRef=useRef(null),wasMounted=useRef(isMounted);useEffect(()=>{wasMounted.current&&!isMounted&&onUnmount?.(),wasMounted.current=isMounted},[isMounted,onUnmount]),useSheetHeightSync({frameRef,scrollerRef,surfaceRef,isOpen:isVisible,resize:theme.variables.animation.sheet.resize}),useEffect(()=>{isVisible&&setSwipedAway(!1)},[isVisible]),useEffect(()=>{let scroller=scrollerRef.current,surface=surfaceRef.current;if(!isVisible||!scroller||!surface||"undefined"==typeof IntersectionObserver)return;let isHidden=!1,isTouching=!1,closeIfHidden=()=>{isHidden&&!isTouching&&(setSwipedAway(!0),onClose())},intersectionObserver=new IntersectionObserver(([entry])=>{isHidden=entry.intersectionRatio<.01,closeIfHidden()},{root:scroller,threshold:[.01]}),handleTouchStart=()=>{isTouching=!0},handleTouchEnd=()=>{isTouching=!1,closeIfHidden()};return intersectionObserver.observe(surface),scroller.addEventListener("touchstart",handleTouchStart,{passive:!0}),scroller.addEventListener("touchend",handleTouchEnd,{passive:!0}),scroller.addEventListener("touchcancel",handleTouchEnd,{passive:!0}),()=>{intersectionObserver.disconnect(),scroller.removeEventListener("touchstart",handleTouchStart),scroller.removeEventListener("touchend",handleTouchEnd),scroller.removeEventListener("touchcancel",handleTouchEnd)}},[isVisible,onClose]),useEffect(()=>{let scroller=scrollerRef.current;if(!isMounted||!scroller)return;let handleScrollerWheel=event=>{if(event.ctrlKey||0===event.deltaY)return;let direction=event.deltaY<0?-1:1;canContentTakeScroll({target:event.target,boundary:scroller,direction})||event.preventDefault()},handleScrollerKeyDown=event=>{let direction=getScrollKeyDirection({event,scroller});direction&&!canContentTakeScroll({target:event.target,boundary:scroller,direction})&&event.preventDefault()};return scroller.addEventListener("wheel",handleScrollerWheel,{passive:!1}),scroller.addEventListener("keydown",handleScrollerKeyDown),()=>{scroller.removeEventListener("wheel",handleScrollerWheel),scroller.removeEventListener("keydown",handleScrollerKeyDown)}},[isMounted]),useEffect(()=>{let scroller=scrollerRef.current,backdropFill=backdropFillRef.current;if(!isMounted||!scroller||!backdropFill||supportsScrollDrivenAnimations())return;let handleScrollerScroll=()=>{let maxScrollTop=scroller.scrollHeight-scroller.clientHeight;backdropFill.style.opacity=String(maxScrollTop>0?scroller.scrollTop/maxScrollTop:1)};return handleScrollerScroll(),scroller.addEventListener("scroll",handleScrollerScroll,{passive:!0}),()=>scroller.removeEventListener("scroll",handleScrollerScroll)},[isMounted,hasBackdrop]);let handlePostDeactivate=useCallback(()=>{onClose()},[onClose]);if(!isMounted)return null;let sheetElm=React.createElement(React.Fragment,null,React.createElement(Global,{styles:[globalStyles]}),React.createElement(StyledRoot,null,hasBackdrop&&React.createElement(StyledBackdrop,{isLeaving:isLeaving},React.createElement(StyledBackdropFill,{ref:backdropFillRef})),React.createElement(StyledFrame,{ref:frameRef},React.createElement(FocusTrapWrapper,{active:isVisible,focusTrapOptions:{clickOutsideDeactivates:dismissOnOutsideClick&&onClickOutsideDeactivates?onClickOutsideDeactivates:dismissOnOutsideClick,allowOutsideClick:!0,escapeDeactivates:!0,preventScroll:!0,initialFocus:()=>!disableInitialFocus,returnFocusOnDeactivate:!disableReturnFocusToTrigger,fallbackFocus:'[data-ds-id="Sheet"]',onPostDeactivate:handlePostDeactivate}},React.createElement(StyledScroller,{...id?{id}:{},"data-e2e-test-id":dataE2eTestId,"data-ds-id":"Sheet",ref:scrollerRef,isLeaving:isLeaving,isSwipedAway:isSwipedAway,onAnimationEnd:onAnimationEnd,onClick:event=>{!surfaceRef.current?.contains(event.target)&&dismissOnOutsideClick&&onClose()},role:role,...ariaAttributes},React.createElement(StyledClosedSnapPoint,null),React.createElement(StyledSurface,{ref:surfaceRef},React.createElement(Container,{elevation:4},React.createElement(StyledHandleContainer,{isContentContainerScrolled:isContentContainerScrolled},React.createElement(StyledHandle,null)),React.createElement(StyledContentContainer,{ref:contentContainerRef,onScroll:()=>{setContentContainerScrolled(contentContainerRef.current?.scrollTop!==0)}},children)))))))),container=portalContainer||document?.body;return container?createPortal(sheetElm,container):null}
@@ -0,0 +1,26 @@
1
+ import type { RefObject } from "react";
2
+ /** CSS variable the scroller reads its height from */
3
+ export declare const SHEET_HEIGHT_VAR = "--sheet-height";
4
+ type Motion = {
5
+ duration: string;
6
+ timingFunction: string;
7
+ };
8
+ type UseSheetHeightSyncOptions = {
9
+ /** Wraps the scroller: sized to the sheet, and moved to glide height changes */
10
+ frameRef: RefObject<HTMLElement | null>;
11
+ /** Snap scroller filling the frame */
12
+ scrollerRef: RefObject<HTMLElement | null>;
13
+ /** The sheet surface inside it */
14
+ surfaceRef: RefObject<HTMLElement | null>;
15
+ isOpen: boolean;
16
+ resize: Motion;
17
+ };
18
+ /**
19
+ * Keeps the snap scroller sized to the sheet and parked at the open position,
20
+ * and glides height changes instead of jumping: the sheet takes its new size
21
+ * at once and a compositor transform on the frame plays its top edge from the
22
+ * old position into place (FLIP). The frame sits outside the scroller, where a
23
+ * transform can't stretch the scrollable area and upset the snap position.
24
+ */
25
+ export declare function useSheetHeightSync({ frameRef, scrollerRef, surfaceRef, isOpen, resize: { duration, timingFunction }, }: UseSheetHeightSyncOptions): void;
26
+ export {};
@@ -0,0 +1 @@
1
+ import{useEffect,useLayoutEffect}from"react";import{useWindow}from"../../shared/useWindow";import{prefersReducedMotion}from"../../shared/prefersReducedMotion";export const SHEET_HEIGHT_VAR="--sheet-height";let sizeFrameToSheet=({frame,sheetHeight})=>frame.style.setProperty("--sheet-height",`${sheetHeight}px`),fitScrollerToSheet=({frame,scroller,sheetHeight})=>{sizeFrameToSheet({frame,sheetHeight}),scroller.scrollTop=scroller.scrollHeight},toMilliseconds=duration=>{let value=parseFloat(duration);return duration.trim().endsWith("ms")?value:duration.trim().endsWith("s")?1e3*value:value},getRenderedTranslateY=(element,window)=>{let{transform}=window.getComputedStyle(element);return"none"===transform?0:new DOMMatrixReadOnly(transform).m42};export function useSheetHeightSync({frameRef,scrollerRef,surfaceRef,isOpen,resize:{duration,timingFunction}}){let window=useWindow();useLayoutEffect(()=>{let frame=frameRef.current,scroller=scrollerRef.current,surface=surfaceRef.current;isOpen&&frame&&scroller&&surface&&fitScrollerToSheet({frame,scroller,sheetHeight:surface.offsetHeight})},[isOpen,frameRef,scrollerRef,surfaceRef]),useEffect(()=>{let heightAnimation,frame=frameRef.current,scroller=scrollerRef.current,surface=surfaceRef.current;if(!isOpen||!frame||!scroller||!surface||"undefined"==typeof ResizeObserver)return;let previousHeight=surface.offsetHeight,isTouching=!1,handleTouchStart=()=>{isTouching=!0,heightAnimation?.playState==="running"&&heightAnimation.pause()},handleTouchEnd=()=>{isTouching=!1,heightAnimation?.playState==="paused"&&heightAnimation.play()},resizeObserver=new ResizeObserver(()=>{let sheetHeight=surface.offsetHeight,heightDelta=sheetHeight-previousHeight;if(previousHeight=sheetHeight,0===heightDelta)return;if(isTouching)return void sizeFrameToSheet({frame,sheetHeight});let inFlightOffset=heightAnimation&&"finished"!==heightAnimation.playState?getRenderedTranslateY(frame,window):0;heightAnimation?.cancel(),fitScrollerToSheet({frame,scroller,sheetHeight}),"function"!=typeof frame.animate||prefersReducedMotion(window)||(heightAnimation=frame.animate([{transform:`translateY(${heightDelta+inFlightOffset}px)`},{transform:"none"}],{duration:toMilliseconds(duration),easing:timingFunction}))});return resizeObserver.observe(surface),scroller.addEventListener("touchstart",handleTouchStart,{passive:!0}),scroller.addEventListener("touchend",handleTouchEnd,{passive:!0}),scroller.addEventListener("touchcancel",handleTouchEnd,{passive:!0}),()=>{resizeObserver.disconnect(),heightAnimation?.cancel(),scroller.removeEventListener("touchstart",handleTouchStart),scroller.removeEventListener("touchend",handleTouchEnd),scroller.removeEventListener("touchcancel",handleTouchEnd)}},[isOpen,frameRef,scrollerRef,surfaceRef,window,duration,timingFunction])}
@@ -1 +1 @@
1
- export declare const SubThemeContext: React.Context<import("./SubThemeProvider").SubThemeName | null | undefined>;
1
+ export declare const SubThemeContext: import("react").Context<import("./SubThemeProvider").SubThemeName | null | undefined>;
@@ -5,4 +5,4 @@
5
5
  * trap scans for focusable elements only once, on activation, and elements
6
6
  * under a `visibility: hidden` ancestor never count as focusable.
7
7
  */
8
- export declare const FloatingPositionedContext: React.Context<boolean>;
8
+ export declare const FloatingPositionedContext: import("react").Context<boolean>;
@@ -1,2 +1,2 @@
1
1
  import type { ContainerQueryBreakpoints } from "../../../shared/mediaQueries";
2
- export declare const ContainerQueryContext: React.Context<ContainerQueryBreakpoints | undefined>;
2
+ export declare const ContainerQueryContext: import("react").Context<ContainerQueryBreakpoints | undefined>;
@@ -1,4 +1,4 @@
1
1
  export declare const ScreenReaderText: import("@emotion/styled").StyledComponent<{
2
2
  theme?: import("@emotion/react").Theme;
3
3
  as?: React.ElementType;
4
- }, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -15,4 +15,4 @@ export declare const SelectableButton: import("@emotion/styled").StyledComponent
15
15
  as?: React.ElementType;
16
16
  } & {
17
17
  isActive?: boolean;
18
- }, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
18
+ }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
@@ -0,0 +1 @@
1
+ import{useCallback,useState}from"react";import{useWindow}from"./useWindow";import{prefersReducedMotion}from"./prefersReducedMotion";export function useExitAnimation(isVisible){let window=useWindow(),[isClosing,setIsClosing]=useState(!1),[prevVisible,setPrevVisible]=useState(isVisible);isVisible!==prevVisible&&(setPrevVisible(isVisible),setIsClosing(!isVisible&&!prefersReducedMotion(window)));let isLeaving=isClosing&&!isVisible,onAnimationEnd=useCallback(event=>{event.target===event.currentTarget&&isLeaving&&setIsClosing(!1)},[isLeaving]);return{isMounted:isVisible||isClosing,isLeaving,onAnimationEnd}}
@@ -1,13 +1,20 @@
1
1
  export declare const LAYOUT_VARS: {
2
2
  readonly contentWidth: "--ds-layout-content-width";
3
+ readonly contentStart: "--ds-layout-content-start";
3
4
  readonly leftPanelWidth: "--ds-layout-leftPanel-width";
5
+ readonly leftPanelStart: "--ds-layout-leftPanel-start";
4
6
  readonly rightPanelWidth: "--ds-layout-rightPanel-width";
5
7
  readonly rightPanelBottomBarHeight: "--ds-layout-rightPanel-bottomBar-height";
8
+ readonly rightPanelStart: "--ds-layout-rightPanel-start";
6
9
  readonly splitMaxWidth: "--ds-layout-split-max-width";
7
10
  readonly bottomBarHeight: "--ds-layout-bottomBar-height";
11
+ readonly bottomBarContentHeight: "--ds-layout-bottomBar-content-height";
8
12
  readonly subnavOffset: "--ds-layout-subnav-offset";
9
13
  readonly floatWidth: "--ds-layout-float-width";
10
14
  readonly floatHeight: "--ds-layout-float-height";
15
+ readonly splitviewWidth: "--ds-layout-splitview-width";
16
+ readonly splitviewStart: "--ds-layout-splitview-start";
17
+ readonly regionsReady: "--ds-layout-regions-ready";
11
18
  };
12
19
  export type LayoutVarKey = keyof typeof LAYOUT_VARS;
13
20
  export type LayoutVarName = (typeof LAYOUT_VARS)[LayoutVarKey];
@@ -1 +1 @@
1
- export const LAYOUT_VARS={contentWidth:"--ds-layout-content-width",leftPanelWidth:"--ds-layout-leftPanel-width",rightPanelWidth:"--ds-layout-rightPanel-width",rightPanelBottomBarHeight:"--ds-layout-rightPanel-bottomBar-height",splitMaxWidth:"--ds-layout-split-max-width",bottomBarHeight:"--ds-layout-bottomBar-height",subnavOffset:"--ds-layout-subnav-offset",floatWidth:"--ds-layout-float-width",floatHeight:"--ds-layout-float-height"};
1
+ export const LAYOUT_VARS={contentWidth:"--ds-layout-content-width",contentStart:"--ds-layout-content-start",leftPanelWidth:"--ds-layout-leftPanel-width",leftPanelStart:"--ds-layout-leftPanel-start",rightPanelWidth:"--ds-layout-rightPanel-width",rightPanelBottomBarHeight:"--ds-layout-rightPanel-bottomBar-height",rightPanelStart:"--ds-layout-rightPanel-start",splitMaxWidth:"--ds-layout-split-max-width",bottomBarHeight:"--ds-layout-bottomBar-height",bottomBarContentHeight:"--ds-layout-bottomBar-content-height",subnavOffset:"--ds-layout-subnav-offset",floatWidth:"--ds-layout-float-width",floatHeight:"--ds-layout-float-height",splitviewWidth:"--ds-layout-splitview-width",splitviewStart:"--ds-layout-splitview-start",regionsReady:"--ds-layout-regions-ready"};
@@ -3,14 +3,21 @@
3
3
 
4
4
  export const LAYOUT_VARS = {
5
5
  contentWidth: "--ds-layout-content-width",
6
+ contentStart: "--ds-layout-content-start",
6
7
  leftPanelWidth: "--ds-layout-leftPanel-width",
8
+ leftPanelStart: "--ds-layout-leftPanel-start",
7
9
  rightPanelWidth: "--ds-layout-rightPanel-width",
8
10
  rightPanelBottomBarHeight: "--ds-layout-rightPanel-bottomBar-height",
11
+ rightPanelStart: "--ds-layout-rightPanel-start",
9
12
  splitMaxWidth: "--ds-layout-split-max-width",
10
13
  bottomBarHeight: "--ds-layout-bottomBar-height",
14
+ bottomBarContentHeight: "--ds-layout-bottomBar-content-height",
11
15
  subnavOffset: "--ds-layout-subnav-offset",
12
16
  floatWidth: "--ds-layout-float-width",
13
17
  floatHeight: "--ds-layout-float-height",
18
+ splitviewWidth: "--ds-layout-splitview-width",
19
+ splitviewStart: "--ds-layout-splitview-start",
20
+ regionsReady: "--ds-layout-regions-ready",
14
21
  } as const;
15
22
 
16
23
  export type LayoutVarKey = keyof typeof LAYOUT_VARS;
@@ -195,6 +195,20 @@ type Variables = {
195
195
  "timingFunction": string;
196
196
  };
197
197
  };
198
+ "sheet": {
199
+ "enter": {
200
+ "duration": string;
201
+ "timingFunction": string;
202
+ };
203
+ "exit": {
204
+ "duration": string;
205
+ "timingFunction": string;
206
+ };
207
+ "resize": {
208
+ "duration": string;
209
+ "timingFunction": string;
210
+ };
211
+ };
198
212
  "promptInput": {
199
213
  "focus": {
200
214
  "duration": string;
@@ -230,12 +244,18 @@ type Variables = {
230
244
  "width": {
231
245
  "default": string;
232
246
  };
247
+ "start": {
248
+ "default": string;
249
+ };
233
250
  };
234
251
  "leftPanel": {
235
252
  "width": {
236
253
  "default": string;
237
254
  "open": string;
238
255
  };
256
+ "start": {
257
+ "default": string;
258
+ };
239
259
  };
240
260
  "rightPanel": {
241
261
  "width": {
@@ -252,6 +272,9 @@ type Variables = {
252
272
  "default": string;
253
273
  };
254
274
  };
275
+ "start": {
276
+ "default": string;
277
+ };
255
278
  };
256
279
  "split": {
257
280
  "maxWidth": {
@@ -262,6 +285,9 @@ type Variables = {
262
285
  "height": {
263
286
  "default": string;
264
287
  };
288
+ "contentHeight": {
289
+ "default": string;
290
+ };
265
291
  };
266
292
  "subnav": {
267
293
  "offset": {
@@ -276,6 +302,19 @@ type Variables = {
276
302
  "default": string;
277
303
  };
278
304
  };
305
+ "splitview": {
306
+ "width": {
307
+ "default": string;
308
+ };
309
+ "start": {
310
+ "default": string;
311
+ };
312
+ };
313
+ "regions": {
314
+ "ready": {
315
+ "default": string;
316
+ };
317
+ };
279
318
  };
280
319
  "opacity": {
281
320
  "hidden": number;