@amboss/design-system 4.3.2-canary.1 → 4.3.3

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 (78) hide show
  1. package/build/cjs/components/Content/ContentText/ContentText.js +1 -1
  2. package/build/cjs/components/Internal/Panel/Panel.d.ts +9 -7
  3. package/build/cjs/components/Internal/Panel/Panel.js +1 -1
  4. package/build/cjs/components/Layout/-constants.d.ts +6 -1
  5. package/build/cjs/components/Layout/-constants.js +1 -1
  6. package/build/cjs/components/Layout/-types.d.ts +62 -28
  7. package/build/cjs/components/Layout/Layout.js +1 -1
  8. package/build/cjs/components/Layout/LayoutProvider.js +1 -1
  9. package/build/cjs/components/Layout/LeftPanel/LeftPanel.js +1 -1
  10. package/build/cjs/components/Layout/LeftPanel/LeftPanelDocked.d.ts +2 -2
  11. package/build/cjs/components/Layout/LeftPanel/LeftPanelDocked.js +1 -1
  12. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +2 -1
  13. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  14. package/build/cjs/components/Layout/RightPanel/RightPanelDocked.d.ts +2 -4
  15. package/build/cjs/components/Layout/RightPanel/RightPanelDocked.js +1 -1
  16. package/build/cjs/components/Layout/RightPanel/RightPanelSheet.d.ts +2 -3
  17. package/build/cjs/components/Layout/RightPanel/RightPanelSheet.js +1 -1
  18. package/build/cjs/components/Layout/Split/MobileSplitView/ContentSplitBase.js +1 -1
  19. package/build/cjs/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  20. package/build/cjs/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +3 -1
  21. package/build/cjs/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.js +1 -1
  22. package/build/cjs/components/Layout/Split/Split.d.ts +4 -5
  23. package/build/cjs/components/Layout/Split/Split.js +1 -1
  24. package/build/cjs/components/Layout/Split/SplitDocked.d.ts +1 -1
  25. package/build/cjs/components/Layout/Split/SplitDocked.js +1 -1
  26. package/build/cjs/components/Layout/Split/SplitHeader.d.ts +5 -3
  27. package/build/cjs/components/Layout/Split/SplitHeader.js +1 -1
  28. package/build/cjs/components/Layout/context.d.ts +5 -1
  29. package/build/cjs/components/Layout/context.js +1 -1
  30. package/build/cjs/components/Layout/index.d.ts +0 -1
  31. package/build/cjs/components/Layout/index.js +1 -1
  32. package/build/cjs/components/Layout/useLayout.js +1 -1
  33. package/build/cjs/web-tokens/_sizes.json +53 -53
  34. package/build/cjs/web-tokens/layout-vars.d.ts +1 -0
  35. package/build/cjs/web-tokens/layout-vars.js +1 -1
  36. package/build/cjs/web-tokens/layout-vars.ts +1 -0
  37. package/build/cjs/web-tokens/visualConfig.d.ts +5 -0
  38. package/build/cjs/web-tokens/visualConfig.js +1 -1
  39. package/build/esm/components/Content/ContentText/ContentText.js +1 -1
  40. package/build/esm/components/Internal/Panel/Panel.d.ts +9 -7
  41. package/build/esm/components/Internal/Panel/Panel.js +1 -1
  42. package/build/esm/components/Layout/-constants.d.ts +6 -1
  43. package/build/esm/components/Layout/-constants.js +1 -1
  44. package/build/esm/components/Layout/-types.d.ts +62 -28
  45. package/build/esm/components/Layout/Layout.js +1 -1
  46. package/build/esm/components/Layout/LayoutProvider.js +1 -1
  47. package/build/esm/components/Layout/LeftPanel/LeftPanel.js +1 -1
  48. package/build/esm/components/Layout/LeftPanel/LeftPanelDocked.d.ts +2 -2
  49. package/build/esm/components/Layout/LeftPanel/LeftPanelDocked.js +1 -1
  50. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +2 -1
  51. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  52. package/build/esm/components/Layout/RightPanel/RightPanelDocked.d.ts +2 -4
  53. package/build/esm/components/Layout/RightPanel/RightPanelDocked.js +1 -1
  54. package/build/esm/components/Layout/RightPanel/RightPanelSheet.d.ts +2 -3
  55. package/build/esm/components/Layout/RightPanel/RightPanelSheet.js +1 -1
  56. package/build/esm/components/Layout/Split/MobileSplitView/ContentSplitBase.js +1 -1
  57. package/build/esm/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  58. package/build/esm/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +3 -1
  59. package/build/esm/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.js +1 -1
  60. package/build/esm/components/Layout/Split/Split.d.ts +4 -5
  61. package/build/esm/components/Layout/Split/Split.js +1 -1
  62. package/build/esm/components/Layout/Split/SplitDocked.d.ts +1 -1
  63. package/build/esm/components/Layout/Split/SplitDocked.js +1 -1
  64. package/build/esm/components/Layout/Split/SplitHeader.d.ts +5 -3
  65. package/build/esm/components/Layout/Split/SplitHeader.js +1 -1
  66. package/build/esm/components/Layout/context.d.ts +5 -1
  67. package/build/esm/components/Layout/context.js +1 -1
  68. package/build/esm/components/Layout/index.d.ts +0 -1
  69. package/build/esm/components/Layout/index.js +1 -1
  70. package/build/esm/components/Layout/useLayout.js +1 -1
  71. package/build/esm/web-tokens/_sizes.json +53 -53
  72. package/build/esm/web-tokens/layout-vars.d.ts +1 -0
  73. package/build/esm/web-tokens/layout-vars.js +1 -1
  74. package/build/esm/web-tokens/layout-vars.ts +1 -0
  75. package/build/esm/web-tokens/visualConfig.d.ts +5 -0
  76. package/build/esm/web-tokens/visualConfig.js +1 -1
  77. package/build/scss/_layout.scss +2 -0
  78. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- export type LeftPanelDrawerProps = {
2
+ import type { ForwardedScrollProps } from "../-types";
3
+ export type LeftPanelDrawerProps = ForwardedScrollProps & {
3
4
  children: React.ReactNode;
4
5
  isVisible: boolean;
5
6
  hide: () => void;
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{Drawer}from"../../Internal/Drawer/Drawer";import{PanelContainer}from"../PanelContainer";let StyledLeftPanelBody=styled("div",{target:"e14wbnl40",label:"StyledLeftPanelBody"})({width:"80vw",height:"100dvh"});export const LeftPanelDrawer=({children,isVisible,hide,"aria-label":ariaLabel})=>React.createElement(Drawer,{isVisible:isVisible,positionX:"left",handleClose:hide,"aria-label":ariaLabel},React.createElement(StyledLeftPanelBody,null,React.createElement(PanelContainer,null,children)));
1
+ import React from"react";import styled from"@emotion/styled";import{Drawer}from"../../Internal/Drawer/Drawer";import{PanelContainer}from"../PanelContainer";let StyledLeftPanelBody=styled("div",{target:"e1pciy730",label:"StyledLeftPanelBody"})({width:"80vw",height:"100dvh"});export const LeftPanelDrawer=({children,isVisible,hide,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>React.createElement(Drawer,{isVisible:isVisible,positionX:"left",handleClose:hide,"aria-label":ariaLabel},React.createElement(StyledLeftPanelBody,null,React.createElement(PanelContainer,{scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)));
@@ -1,13 +1,11 @@
1
1
  import React from "react";
2
- import type { RightPanelVariant } from "../-types";
3
- export type RightPanelDockedProps = {
2
+ import type { ForwardedScrollProps, RightPanelVariant } from "../-types";
3
+ export type RightPanelDockedProps = ForwardedScrollProps & {
4
4
  children: React.ReactNode;
5
5
  isVisible: boolean;
6
6
  /** Docked column vs. minimized floating window - only the border differs here. */
7
7
  variant: RightPanelVariant;
8
8
  "aria-label": string;
9
- scrollContainerRef?: React.Ref<HTMLDivElement>;
10
- onScroll?: React.UIEventHandler<HTMLDivElement>;
11
9
  };
12
10
  /**
13
11
  * Docked (desktop) right panel. Portals its content into the `rightPanel` slot's
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{Slot,SUBNAV_OFFSET_VAR}from"../-constants";import{useLayoutPortal}from"../registry";import{PanelContainer}from"../PanelContainer";let StyledRightPanelSlot=styled("div",{target:"eq48lip0",label:"StyledRightPanelSlot"})(({theme})=>({position:"absolute",left:0,right:0,bottom:0,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{Slot,SUBNAV_OFFSET_VAR}from"../-constants";import{useLayoutPortal}from"../registry";import{PanelContainer}from"../PanelContainer";let StyledRightPanelSlot=styled("div",{target:"e19zlvfp0",label:"StyledRightPanelSlot"})(({theme})=>({position:"absolute",left:0,right:0,bottom:0,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,11 +1,10 @@
1
1
  import React from "react";
2
- export type RightPanelSheetProps = {
2
+ import type { ForwardedScrollProps } from "../-types";
3
+ export type RightPanelSheetProps = ForwardedScrollProps & {
3
4
  children: React.ReactNode;
4
5
  isVisible: boolean;
5
6
  hide: () => void;
6
7
  "aria-label": string;
7
- scrollContainerRef?: React.Ref<HTMLDivElement>;
8
- onScroll?: React.UIEventHandler<HTMLDivElement>;
9
8
  };
10
9
  /**
11
10
  * Mobile right panel. Renders its content as a bottom {@link Sheet} instead of an
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{PanelContainer}from"../PanelContainer";import{Sheet,SHEET_MAX_HEIGHT}from"../../Sheet/Sheet";let StyledSheetPanelShell=styled("div",{target:"e1wbhy260",label:"StyledSheetPanelShell"})({height:SHEET_MAX_HEIGHT});export const RightPanelSheet=({children,isVisible,hide,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>React.createElement(Sheet,{isVisible:isVisible,onClose:hide,hasBackdrop:!0,dismissOnOutsideClick:!0,disableInitialFocus:!0},React.createElement(StyledSheetPanelShell,null,React.createElement(PanelContainer,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)));
1
+ import React from"react";import styled from"@emotion/styled";import{PanelContainer}from"../PanelContainer";import{Sheet,SHEET_MAX_HEIGHT}from"../../Sheet/Sheet";let StyledSheetPanelShell=styled("div",{target:"eqso66w0",label:"StyledSheetPanelShell"})({height:SHEET_MAX_HEIGHT});export const RightPanelSheet=({children,isVisible,hide,"aria-label":ariaLabel,scrollContainerRef,onScroll})=>React.createElement(Sheet,{isVisible:isVisible,onClose:hide,hasBackdrop:!0,dismissOnOutsideClick:!0,disableInitialFocus:!0},React.createElement(StyledSheetPanelShell,null,React.createElement(PanelContainer,{"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll},children)));
@@ -1 +1 @@
1
- import React from"react";import{createPortal}from"react-dom";import{StyledMobileSplitSlideLayer}from"./StyledMobileSplitSlideLayer";import{useMobileSplitStack}from"./useMobileSplitStack";import{contentOffsetFor,useMobileSplitView}from"./useMobileSplitView";export const ContentSplitBase=({children})=>{let{isSplitViewActive}=useMobileSplitView(),{host}=useMobileSplitStack();return host?createPortal(React.createElement(StyledMobileSplitSlideLayer,{layer:"base",offset:contentOffsetFor(isSplitViewActive)},children),host):null};
1
+ import React from"react";import{createPortal}from"react-dom";import{StyledMobileSplitSlideLayer}from"./StyledMobileSplitSlideLayer";import{useMobileSplitStack}from"./useMobileSplitStack";import{contentOffsetFor,useMobileSplitView}from"./useMobileSplitView";export const ContentSplitBase=({children})=>{let{isSplitViewActive}=useMobileSplitView(),{host}=useMobileSplitStack();if(!host)return null;let offset=contentOffsetFor(isSplitViewActive);return createPortal(React.createElement(StyledMobileSplitSlideLayer,{layer:"base",offset:offset,inert:0===offset?void 0:""},children),host)};
@@ -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})=>{let enabled=useMobileSplitViewEnabled(),{isSplitViewActive}=useMobileSplitView(),{host,registerSplit}=useMobileSplitStack();return(useLayoutEffect(()=>{if(enabled)return registerSplit()},[enabled,registerSplit]),enabled&&host)?createPortal(React.createElement(StyledMobileSplitSlideLayer,{layer:"overlay",offset:splitViewOffsetFor(isSplitViewActive)},React.createElement(PanelContainer,{"aria-label":ariaLabel},children)),host):null};
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)};
@@ -8,7 +8,9 @@ export type MobileSplitLayer = keyof typeof LAYER_Z_INDEX;
8
8
  * One layer of the two-view mobile split. Slides to `offset` - -1 (parked to the
9
9
  * left), 0 (in view), 1 (parked to the right) - so switching pushes the outgoing
10
10
  * view toward the side it rests on while the incoming one slides in from the
11
- * opposite edge, like a Drawer.
11
+ * opposite edge, like a Drawer. A parked layer is `inert`: besides blocking
12
+ * pointer events, this keeps its controls out of the tab order and hidden from
13
+ * assistive tech while it sits off-screen.
12
14
  */
13
15
  export declare const StyledMobileSplitSlideLayer: import("@emotion/styled").StyledComponent<{
14
16
  theme?: import("@emotion/react").Theme;
@@ -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:"e187cevn0",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:"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,10 +1,9 @@
1
1
  import React from "react";
2
2
  import type { SplitProps } from "../-types";
3
3
  /**
4
- * Split view panel. Picks its presentation by breakpoint: an in-flow resizable
5
- * column on desktop ({@link SplitDocked}) and a full-area {@link MobileSplitView}
6
- * that slides over `content` on mobile. Both are driven by the same state - the
7
- * `splitview` slot's visibility (`useLayout().splitview` / `useMobileSplitView`)
8
- * - so showing or hiding the split behaves identically on either breakpoint.
4
+ * Split view panel. Picks its presentation by breakpoint: an in-flow column
5
+ * beside `Layout.Content` on desktop ({@link SplitDocked}, always half its
6
+ * width) or a full-area {@link MobileSplitView} on mobile - both driven by the
7
+ * same `splitview` slot visibility, so open/close behaves identically either way.
9
8
  */
10
9
  export declare const Split: React.FC<SplitProps>;
@@ -1 +1 @@
1
- import React from"react";import{useBreakpoints}from"../../../shared/useBreakpoints";import{useCanRenderPanel}from"../context";import{MobileSplitView}from"./MobileSplitView/MobileSplitView";import{SplitDocked}from"./SplitDocked";export const Split=({children,"aria-label":ariaLabel,defaultSize,minSize,maxSize,resizable})=>{let{isMobile}=useBreakpoints();return useCanRenderPanel()?isMobile?React.createElement(MobileSplitView,{"aria-label":ariaLabel},children):React.createElement(SplitDocked,{"aria-label":ariaLabel,defaultSize:defaultSize,minSize:minSize,maxSize:maxSize,resizable:resizable},children):null};
1
+ import React from"react";import{useBreakpoints}from"../../../shared/useBreakpoints";import{Slot}from"../-constants";import{useVisibleChange}from"../registry";import{useLayout}from"../useLayout";import{useCanRenderPanel}from"../context";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],canRender=useCanRenderPanel();return(useVisibleChange(isVisible,onVisibleChange),canRender)?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):null};
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import type { SplitProps } from "../-types";
3
3
  /**
4
4
  * Desktop split view. Declares the `splitview` slot and portals its content
5
- * while visible - an in-flow resizable column beside `content`.
5
+ * while visible - the right-hand half of `Layout.Content`'s column.
6
6
  * `Layout.SplitHeader` / `Layout.SplitFooter` children stick to the panel
7
7
  * edges; the remaining content scrolls.
8
8
  */
@@ -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,defaultSize,minSize,maxSize,resizable})=>{let{isVisible}=useLayout()[Slot.splitview],canResize=!1!==resizable;return useDeclarePanel(Slot.splitview,{defaultSize,minSize,maxSize,collapsible:canResize,resizable:canResize}),useLayoutPortal(Slot.splitview,isVisible?React.createElement(PanelContainer,{"aria-label":ariaLabel,showBorderLeft:!0},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,"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,7 +1,9 @@
1
1
  import React from "react";
2
2
  import type { SplitHeaderProps } from "../-types";
3
3
  /**
4
- * Optional sticky header for `Layout.Split` - place it among the panel's
5
- * children; it sticks to the top while the rest of the content scrolls.
4
+ * Optional sticky header for `Layout.Split` - sticks to the top while the rest
5
+ * scrolls. Renders `title` after `leftSlot` and, when `slotProps.closeButton`
6
+ * is supplied, a close button after `rightSlot` that hides the panel - shown
7
+ * on mobile too, since `MobileSplitView` has no other way to dismiss it.
6
8
  */
7
- export declare function SplitHeader({ leftSlot, rightSlot, "data-e2e-test-id": dataE2eTestId, }: SplitHeaderProps): React.ReactElement;
9
+ export declare function SplitHeader({ leftSlot, rightSlot, title, slotProps, showSeparator, "data-e2e-test-id": dataE2eTestId, }: SplitHeaderProps): React.ReactElement;
@@ -1 +1 @@
1
- import React from"react";import{Sandwich}from"../../Internal/Sandwich/Sandwich";import{PanelHeader}from"../../Internal/PanelHeader/PanelHeader";export function SplitHeader({leftSlot,rightSlot,"data-e2e-test-id":dataE2eTestId}){return React.createElement(Sandwich.Header,{"data-e2e-test-id":dataE2eTestId},React.createElement(PanelHeader,{leftSlot:leftSlot,rightSlot:rightSlot}))}
1
+ import React from"react";import{Slot}from"../-constants";import{useLayout}from"../useLayout";import{Sandwich}from"../../Internal/Sandwich/Sandwich";import{PanelHeader}from"../../Internal/PanelHeader/PanelHeader";import{PictogramButton}from"../../PictogramButton/PictogramButton";export function SplitHeader({leftSlot,rightSlot,title,slotProps,showSeparator,"data-e2e-test-id":dataE2eTestId}){let{hide}=useLayout()[Slot.splitview],closeButtonSlotProps=slotProps?.closeButton;return React.createElement(Sandwich.Header,{showSeparator:showSeparator,"data-e2e-test-id":dataE2eTestId},React.createElement(PanelHeader,{leftSlot:leftSlot,title:title,rightSlot:React.createElement(React.Fragment,null,rightSlot,closeButtonSlotProps&&React.createElement(PictogramButton,{icon:"x",size:"s",variant:"tertiary","aria-label":closeButtonSlotProps["aria-label"],onClick:hide}))}))}
@@ -1,4 +1,4 @@
1
- import type { LayoutPanelsMode, LayoutState, LayoutStorage, LayoutStore } from "./-types";
1
+ import type { LayoutPanelsMode, LayoutState, LayoutStorage, LayoutStore, SlotKey } from "./-types";
2
2
  export declare const LayoutStoreProvider: React.Provider<LayoutStore>;
3
3
  /** Get the store from context, or throw if used outside the provider. */
4
4
  export declare function useLayoutStore(): LayoutStore;
@@ -15,6 +15,10 @@ export declare function useLayoutPanelsEnabled(): LayoutPanelsMode;
15
15
  * breakpoint (the overlay presentations - drawer/sheet - which never mount
16
16
  * the resizable row); `false` never allows. */
17
17
  export declare function useCanRenderPanel(): boolean;
18
+ export declare const LayoutReservedSlotsProvider: React.Provider<("content" | "leftPanel" | "splitview" | "rightPanel")[]>;
19
+ /** Slots the nearest `Layout.Provider` reserved for markers that mount later.
20
+ * See `LayoutConfig.reservedSlots`. */
21
+ export declare function useLayoutReservedSlots(): SlotKey[];
18
22
  /**
19
23
  * Persistence config for the layout namespace. Set on `Layout.Provider` (single
20
24
  * external surface) and read by the nested `<Layout>`. The Provider only
@@ -1 +1 @@
1
- import{createContext,useContext,useSyncExternalStore}from"react";import{useBreakpoints}from"../../shared/useBreakpoints";let LayoutStoreContext=createContext(null);export const LayoutStoreProvider=LayoutStoreContext.Provider;export function useLayoutStore(){let store=useContext(LayoutStoreContext);if(!store)throw Error("useLayout must be used within a <LayoutProvider>.");return store}let LayoutPanelsEnabledContext=createContext(!1);export const LayoutPanelsEnabledProvider=LayoutPanelsEnabledContext.Provider;export function useLayoutPanelsEnabled(){return useContext(LayoutPanelsEnabledContext)}export function useCanRenderPanel(){let mode=useLayoutPanelsEnabled(),{isMobile}=useBreakpoints();return!0===mode||"mobile"===mode&&isMobile}let LayoutPersistenceContext=createContext({});export const LayoutPersistenceProvider=LayoutPersistenceContext.Provider;export function useLayoutPersistence(){return useContext(LayoutPersistenceContext)}export function useLayoutSelector(selector){let store=useLayoutStore(),getSnapshot=()=>selector(store.getState());return useSyncExternalStore(store.subscribe,getSnapshot,getSnapshot)}
1
+ import{createContext,useContext,useSyncExternalStore}from"react";import{useBreakpoints}from"../../shared/useBreakpoints";let LayoutStoreContext=createContext(null);export const LayoutStoreProvider=LayoutStoreContext.Provider;export function useLayoutStore(){let store=useContext(LayoutStoreContext);if(!store)throw Error("useLayout must be used within a <LayoutProvider>.");return store}let LayoutPanelsEnabledContext=createContext(!1);export const LayoutPanelsEnabledProvider=LayoutPanelsEnabledContext.Provider;export function useLayoutPanelsEnabled(){return useContext(LayoutPanelsEnabledContext)}export function useCanRenderPanel(){let mode=useLayoutPanelsEnabled(),{isMobile}=useBreakpoints();return!0===mode||"mobile"===mode&&isMobile}let LayoutReservedSlotsContext=createContext([]);export const LayoutReservedSlotsProvider=LayoutReservedSlotsContext.Provider;export function useLayoutReservedSlots(){return useContext(LayoutReservedSlotsContext)}let LayoutPersistenceContext=createContext({});export const LayoutPersistenceProvider=LayoutPersistenceContext.Provider;export function useLayoutPersistence(){return useContext(LayoutPersistenceContext)}export function useLayoutSelector(selector){let store=useLayoutStore(),getSnapshot=()=>selector(store.getState());return useSyncExternalStore(store.subscribe,getSnapshot,getSnapshot)}
@@ -1,4 +1,3 @@
1
- export { SUBNAV_OFFSET_VAR, PANEL_WIDTH_VAR } from "./-constants";
2
1
  export { Layout } from "./Layout";
3
2
  export { LayoutProvider } from "./LayoutProvider";
4
3
  export { useLayoutVar } from "./LayoutCssVars";
@@ -1 +1 @@
1
- export{SUBNAV_OFFSET_VAR,PANEL_WIDTH_VAR}from"./-constants";export{Layout}from"./Layout";export{LayoutProvider}from"./LayoutProvider";export{useLayoutVar}from"./LayoutCssVars";export{useLayout}from"./useLayout";export{DEFAULT_LAYOUT_RULES}from"./rules";export{useMobileSplitView}from"./Split/MobileSplitView/useMobileSplitView";export{useAutoScrollToBottom}from"./useAutoScrollToBottom";export{createLayoutStore}from"./store";export{createInitialState,layoutReducer}from"./reducer";export*from"./-types";
1
+ export{Layout}from"./Layout";export{LayoutProvider}from"./LayoutProvider";export{useLayoutVar}from"./LayoutCssVars";export{useLayout}from"./useLayout";export{DEFAULT_LAYOUT_RULES}from"./rules";export{useMobileSplitView}from"./Split/MobileSplitView/useMobileSplitView";export{useAutoScrollToBottom}from"./useAutoScrollToBottom";export{createLayoutStore}from"./store";export{createInitialState,layoutReducer}from"./reducer";export*from"./-types";
@@ -1 +1 @@
1
- import{useContext}from"react";import{useLayoutSelector,useLayoutStore}from"./context";import{PanelDeclarationsContext}from"./registry";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}),resize:size=>dispatch({type:"resize",slot,size}),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??"sidebar"},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{PanelDeclarationsContext}from"./registry";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??"sidebar"},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})}}}