@amboss/design-system 4.17.0 → 4.19.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.
@@ -33,8 +33,8 @@ export declare const LEFT_BAR_BUTTON_INSET: BarButtonInset;
33
33
  export type TogglableSlotKey = Exclude<SlotKey, typeof Slot.content>;
34
34
  /** Slots the app opens/closes, in `PANEL_ORDER`. */
35
35
  export declare const TOGGLABLE_SLOTS: TogglableSlotKey[];
36
- /** Vertical offset for the right panel — set this (e.g. to a sticky subnav's
37
- * height) and the panel tracks it; defaults to `0` when unset. */
36
+ /** Vertical offset for the docked right panel and split view — set this (e.g.
37
+ * to a sticky subnav's height) and both track it; defaults to `0` when unset. */
38
38
  export declare const SUBNAV_OFFSET_VAR: "--ds-layout-subnav-offset";
39
39
  /** Widest `Layout.Content` and `Layout.Split` may grow to *together* while the
40
40
  * split is open; past it they stay centred with space either side. Defaults
@@ -265,7 +265,7 @@ export type LayoutValue = {
265
265
  };
266
266
  /** Forwarded to a panel's underlying scroll container (scroll restoration,
267
267
  * custom scroll handling). Shared by every panel-like slot backed by a
268
- * {@link PanelContainer} - `leftPanel`, `rightPanel`, `content`, `splitview`. */
268
+ * {@link PanelContainer} - `leftPanel`, `rightPanel`, `splitview`. */
269
269
  export type ForwardedScrollProps = {
270
270
  scrollContainerRef?: React.Ref<HTMLDivElement>;
271
271
  onScroll?: React.UIEventHandler<HTMLDivElement>;
@@ -310,7 +310,10 @@ export type LeftPanelProps = Omit<SidePanelProps, "defaultSize" | "resizable"> &
310
310
  * as on mobile (`role="dialog"`). Ignored by the docked desktop panel. */
311
311
  "aria-label": string;
312
312
  };
313
- export type ContentProps = ForwardedScrollProps & {
313
+ export type ContentProps = {
314
+ children: React.ReactNode;
315
+ };
316
+ export type ContentPanelProps = ForwardedScrollProps & {
314
317
  /** Panel content in source order. `<Layout.ContentHeader />` /
315
318
  * `<Layout.ContentFooter />` children stick to the edges; the rest scrolls. */
316
319
  children: React.ReactNode;
@@ -450,7 +453,7 @@ export type RightPanelHeaderProps = PanelSlotHeaderProps & {
450
453
  export type RightPanelFooterProps = PanelSlotFooterProps;
451
454
  /**
452
455
  * Title shown in the content header, after `leftSlot`. Visual only — the
453
- * panel's accessible name comes from `Layout.Content`'s `aria-label`.
456
+ * panel's accessible name comes from `ContentPanel`'s `aria-label`.
454
457
  */
455
458
  export type ContentHeaderTitle = PanelHeaderTitle;
456
459
  export type ContentHeaderSlotProps = {
@@ -6,8 +6,6 @@ import type { ContentProps } from "../-types";
6
6
  * presentation: in-flow in the `content` slot ({@link ContentDocked}) normally,
7
7
  * and the mobile split's sliding base layer ({@link ContentSplitBase}) when a
8
8
  * `Layout.Split` is stacked over it - so the split pushes content aside instead
9
- * of just covering it. Either way the content sits in a {@link ContentPanel},
10
- * so `Layout.ContentHeader` / `Layout.ContentFooter` children stick to the
11
- * panel edges; the remaining content scrolls.
9
+ * of just covering it.
12
10
  */
13
11
  export declare const Content: React.FC<ContentProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Content",{enumerable:!0,get:function(){return Content}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_constants=require("../-constants"),_registry=require("../registry"),_ContentSplitBase=require("../Split/MobileSplitView/ContentSplitBase"),_useMobileSplitStack=require("../Split/MobileSplitView/useMobileSplitStack"),_useMobileSplitView=require("../Split/MobileSplitView/useMobileSplitView"),_ContentDocked=require("./ContentDocked"),_ContentPanel=require("./ContentPanel"),Content=({children,...panelProps})=>{(0,_registry.useDeclarePanel)(_constants.Slot.content,{collapsible:!1});let enabled=(0,_useMobileSplitView.useMobileSplitViewEnabled)(),{host,isSplitPresent}=(0,_useMobileSplitStack.useMobileSplitStack)(),panel=_react.default.createElement(_ContentPanel.ContentPanel,panelProps,children);return enabled&&isSplitPresent&&null!==host?_react.default.createElement(_ContentSplitBase.ContentSplitBase,null,panel):_react.default.createElement(_ContentDocked.ContentDocked,null,panel)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Content",{enumerable:!0,get:function(){return Content}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_constants=require("../-constants"),_registry=require("../registry"),_ContentSplitBase=require("../Split/MobileSplitView/ContentSplitBase"),_useMobileSplitStack=require("../Split/MobileSplitView/useMobileSplitStack"),_useMobileSplitView=require("../Split/MobileSplitView/useMobileSplitView"),_ContentDocked=require("./ContentDocked"),Content=({children})=>{(0,_registry.useDeclarePanel)(_constants.Slot.content,{collapsible:!1});let enabled=(0,_useMobileSplitView.useMobileSplitViewEnabled)(),{host,isSplitPresent}=(0,_useMobileSplitStack.useMobileSplitStack)();return enabled&&isSplitPresent&&null!==host?_react.default.createElement(_ContentSplitBase.ContentSplitBase,null,children):_react.default.createElement(_ContentDocked.ContentDocked,null,children)};
@@ -1,9 +1,7 @@
1
1
  import React from "react";
2
- import type { ContentProps } from "../-types";
2
+ import type { ContentPanelProps } from "../-types";
3
3
  /**
4
- * Frame shared by both `Layout.Content` presentations: the same `Sandwich` every
5
- * panel scrolls in, so `Layout.ContentHeader` / `Layout.ContentFooter` stick to
6
- * the edges, without `PanelContainer`'s Container - as with the left panel's
7
- * layers - so content keeps the layout and stacking it had without one.
4
+ * Scrollable frame for content headers and footers. Temporarily not mounted by
5
+ * `Layout.Content` while the accessibility regression in #2043 is unresolved.
8
6
  */
9
- export declare function ContentPanel({ children, background, "aria-label": ariaLabel, scrollContainerRef, onScroll, "data-e2e-test-id": dataE2eTestId, }: ContentProps): React.ReactElement;
7
+ export declare function ContentPanel({ children, background, "aria-label": ariaLabel, scrollContainerRef, onScroll, "data-e2e-test-id": dataE2eTestId, }: ContentPanelProps): React.ReactElement;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ContentPanel",{enumerable:!0,get:function(){return ContentPanel}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_Sandwich=require("../../Internal/Sandwich/Sandwich"),StyledContentFrame=(0,_styled.default)("div",{target:"e168plsf0",label:"StyledContentFrame"})(({theme,background})=>({height:"100%",backgroundColor:"primary"===background?theme.values.color.background.primary.default:"transparent"})),StyledContentFill=(0,_styled.default)("div",{target:"e168plsf1",label:"StyledContentFill"})({position:"absolute",inset:0});function ContentPanel({children,background="transparent","aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId}){return _react.default.createElement(StyledContentFrame,{background:background,role:ariaLabel?"region":void 0,"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId},_react.default.createElement(_Sandwich.Sandwich,{scrollRef:scrollContainerRef,onScroll:onScroll},_react.default.createElement(StyledContentFill,null,children)))}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ContentPanel",{enumerable:!0,get:function(){return ContentPanel}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_Sandwich=require("../../Internal/Sandwich/Sandwich"),StyledContentFrame=(0,_styled.default)("div",{target:"e1spy2ji0",label:"StyledContentFrame"})(({theme,background})=>({height:"100%",backgroundColor:"primary"===background?theme.values.color.background.primary.default:"transparent"})),StyledContentFill=(0,_styled.default)("div",{target:"e1spy2ji1",label:"StyledContentFill"})({position:"absolute",inset:0});function ContentPanel({children,background="transparent","aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId}){return _react.default.createElement(StyledContentFrame,{background:background,role:ariaLabel?"region":void 0,"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId},_react.default.createElement(_Sandwich.Sandwich,{scrollRef:scrollContainerRef,onScroll:onScroll},_react.default.createElement(StyledContentFill,null,children)))}
@@ -2,8 +2,9 @@ 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 - the right-hand half of `Layout.Content`'s column.
6
- * `Layout.SplitHeader` / `Layout.SplitFooter` children stick to the panel
7
- * edges; the remaining content scrolls.
5
+ * while visible - the right-hand half of `Layout.Content`'s column. Content
6
+ * tracks the `--ds-layout-subnav-offset` var, so an expanded subnav never
7
+ * covers the panel's top edge. `Layout.SplitHeader` / `Layout.SplitFooter`
8
+ * children stick to the panel edges; the remaining content scrolls.
8
9
  */
9
10
  export declare const SplitDocked: React.FC<SplitProps>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"SplitDocked",{enumerable:!0,get:function(){return SplitDocked}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_constants=require("../-constants"),_registry=require("../registry"),_useLayout=require("../useLayout"),_PanelContainer=require("../PanelContainer"),SplitDocked=({children,background,"aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let{isVisible}=(0,_useLayout.useLayout)()[_constants.Slot.splitview];return(0,_registry.useDeclarePanel)(_constants.Slot.splitview,{}),(0,_registry.useLayoutPortal)(_constants.Slot.splitview,isVisible?_react.default.createElement(_PanelContainer.PanelContainer,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children):null)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"SplitDocked",{enumerable:!0,get:function(){return SplitDocked}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_constants=require("../-constants"),_registry=require("../registry"),_useLayout=require("../useLayout"),_PanelContainer=require("../PanelContainer"),StyledSplitSlot=(0,_styled.default)("div",{target:"e1ldbp5v0",label:"StyledSplitSlot"})(({theme})=>({position:"absolute",right:0,left:0,bottom:0,top:`var(${_constants.SUBNAV_OFFSET_VAR}, 0px)`,overflow:"hidden",transition:`top ${theme.variables.animation.navSlide.open.duration} ${theme.variables.animation.navSlide.open.timingFunction}`})),SplitDocked=({children,background,"aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId})=>{let{isVisible}=(0,_useLayout.useLayout)()[_constants.Slot.splitview];return(0,_registry.useDeclarePanel)(_constants.Slot.splitview,{}),(0,_registry.useLayoutPortal)(_constants.Slot.splitview,isVisible?_react.default.createElement(StyledSplitSlot,null,_react.default.createElement(_PanelContainer.PanelContainer,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children)):null)};
@@ -33,8 +33,8 @@ export declare const LEFT_BAR_BUTTON_INSET: BarButtonInset;
33
33
  export type TogglableSlotKey = Exclude<SlotKey, typeof Slot.content>;
34
34
  /** Slots the app opens/closes, in `PANEL_ORDER`. */
35
35
  export declare const TOGGLABLE_SLOTS: TogglableSlotKey[];
36
- /** Vertical offset for the right panel — set this (e.g. to a sticky subnav's
37
- * height) and the panel tracks it; defaults to `0` when unset. */
36
+ /** Vertical offset for the docked right panel and split view — set this (e.g.
37
+ * to a sticky subnav's height) and both track it; defaults to `0` when unset. */
38
38
  export declare const SUBNAV_OFFSET_VAR: "--ds-layout-subnav-offset";
39
39
  /** Widest `Layout.Content` and `Layout.Split` may grow to *together* while the
40
40
  * split is open; past it they stay centred with space either side. Defaults
@@ -265,7 +265,7 @@ export type LayoutValue = {
265
265
  };
266
266
  /** Forwarded to a panel's underlying scroll container (scroll restoration,
267
267
  * custom scroll handling). Shared by every panel-like slot backed by a
268
- * {@link PanelContainer} - `leftPanel`, `rightPanel`, `content`, `splitview`. */
268
+ * {@link PanelContainer} - `leftPanel`, `rightPanel`, `splitview`. */
269
269
  export type ForwardedScrollProps = {
270
270
  scrollContainerRef?: React.Ref<HTMLDivElement>;
271
271
  onScroll?: React.UIEventHandler<HTMLDivElement>;
@@ -310,7 +310,10 @@ export type LeftPanelProps = Omit<SidePanelProps, "defaultSize" | "resizable"> &
310
310
  * as on mobile (`role="dialog"`). Ignored by the docked desktop panel. */
311
311
  "aria-label": string;
312
312
  };
313
- export type ContentProps = ForwardedScrollProps & {
313
+ export type ContentProps = {
314
+ children: React.ReactNode;
315
+ };
316
+ export type ContentPanelProps = ForwardedScrollProps & {
314
317
  /** Panel content in source order. `<Layout.ContentHeader />` /
315
318
  * `<Layout.ContentFooter />` children stick to the edges; the rest scrolls. */
316
319
  children: React.ReactNode;
@@ -450,7 +453,7 @@ export type RightPanelHeaderProps = PanelSlotHeaderProps & {
450
453
  export type RightPanelFooterProps = PanelSlotFooterProps;
451
454
  /**
452
455
  * Title shown in the content header, after `leftSlot`. Visual only — the
453
- * panel's accessible name comes from `Layout.Content`'s `aria-label`.
456
+ * panel's accessible name comes from `ContentPanel`'s `aria-label`.
454
457
  */
455
458
  export type ContentHeaderTitle = PanelHeaderTitle;
456
459
  export type ContentHeaderSlotProps = {
@@ -6,8 +6,6 @@ import type { ContentProps } from "../-types";
6
6
  * presentation: in-flow in the `content` slot ({@link ContentDocked}) normally,
7
7
  * and the mobile split's sliding base layer ({@link ContentSplitBase}) when a
8
8
  * `Layout.Split` is stacked over it - so the split pushes content aside instead
9
- * of just covering it. Either way the content sits in a {@link ContentPanel},
10
- * so `Layout.ContentHeader` / `Layout.ContentFooter` children stick to the
11
- * panel edges; the remaining content scrolls.
9
+ * of just covering it.
12
10
  */
13
11
  export declare const Content: React.FC<ContentProps>;
@@ -1 +1 @@
1
- import React from"react";import{Slot}from"../-constants";import{useDeclarePanel}from"../registry";import{ContentSplitBase}from"../Split/MobileSplitView/ContentSplitBase";import{useMobileSplitStack}from"../Split/MobileSplitView/useMobileSplitStack";import{useMobileSplitViewEnabled}from"../Split/MobileSplitView/useMobileSplitView";import{ContentDocked}from"./ContentDocked";import{ContentPanel}from"./ContentPanel";export const Content=({children,...panelProps})=>{useDeclarePanel(Slot.content,{collapsible:!1});let enabled=useMobileSplitViewEnabled(),{host,isSplitPresent}=useMobileSplitStack(),panel=React.createElement(ContentPanel,panelProps,children);return enabled&&isSplitPresent&&null!==host?React.createElement(ContentSplitBase,null,panel):React.createElement(ContentDocked,null,panel)};
1
+ import React from"react";import{Slot}from"../-constants";import{useDeclarePanel}from"../registry";import{ContentSplitBase}from"../Split/MobileSplitView/ContentSplitBase";import{useMobileSplitStack}from"../Split/MobileSplitView/useMobileSplitStack";import{useMobileSplitViewEnabled}from"../Split/MobileSplitView/useMobileSplitView";import{ContentDocked}from"./ContentDocked";export const Content=({children})=>{useDeclarePanel(Slot.content,{collapsible:!1});let enabled=useMobileSplitViewEnabled(),{host,isSplitPresent}=useMobileSplitStack();return enabled&&isSplitPresent&&null!==host?React.createElement(ContentSplitBase,null,children):React.createElement(ContentDocked,null,children)};
@@ -1,9 +1,7 @@
1
1
  import React from "react";
2
- import type { ContentProps } from "../-types";
2
+ import type { ContentPanelProps } from "../-types";
3
3
  /**
4
- * Frame shared by both `Layout.Content` presentations: the same `Sandwich` every
5
- * panel scrolls in, so `Layout.ContentHeader` / `Layout.ContentFooter` stick to
6
- * the edges, without `PanelContainer`'s Container - as with the left panel's
7
- * layers - so content keeps the layout and stacking it had without one.
4
+ * Scrollable frame for content headers and footers. Temporarily not mounted by
5
+ * `Layout.Content` while the accessibility regression in #2043 is unresolved.
8
6
  */
9
- export declare function ContentPanel({ children, background, "aria-label": ariaLabel, scrollContainerRef, onScroll, "data-e2e-test-id": dataE2eTestId, }: ContentProps): React.ReactElement;
7
+ export declare function ContentPanel({ children, background, "aria-label": ariaLabel, scrollContainerRef, onScroll, "data-e2e-test-id": dataE2eTestId, }: ContentPanelProps): React.ReactElement;
@@ -1 +1 @@
1
- import React from"react";import styled from"@emotion/styled";import{Sandwich}from"../../Internal/Sandwich/Sandwich";let StyledContentFrame=styled("div",{target:"e168plsf0",label:"StyledContentFrame"})(({theme,background})=>({height:"100%",backgroundColor:"primary"===background?theme.values.color.background.primary.default:"transparent"})),StyledContentFill=styled("div",{target:"e168plsf1",label:"StyledContentFill"})({position:"absolute",inset:0});export function ContentPanel({children,background="transparent","aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId}){return React.createElement(StyledContentFrame,{background:background,role:ariaLabel?"region":void 0,"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId},React.createElement(Sandwich,{scrollRef:scrollContainerRef,onScroll:onScroll},React.createElement(StyledContentFill,null,children)))}
1
+ import React from"react";import styled from"@emotion/styled";import{Sandwich}from"../../Internal/Sandwich/Sandwich";let StyledContentFrame=styled("div",{target:"e1spy2ji0",label:"StyledContentFrame"})(({theme,background})=>({height:"100%",backgroundColor:"primary"===background?theme.values.color.background.primary.default:"transparent"})),StyledContentFill=styled("div",{target:"e1spy2ji1",label:"StyledContentFill"})({position:"absolute",inset:0});export function ContentPanel({children,background="transparent","aria-label":ariaLabel,scrollContainerRef,onScroll,"data-e2e-test-id":dataE2eTestId}){return React.createElement(StyledContentFrame,{background:background,role:ariaLabel?"region":void 0,"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId},React.createElement(Sandwich,{scrollRef:scrollContainerRef,onScroll:onScroll},React.createElement(StyledContentFill,null,children)))}
@@ -2,8 +2,9 @@ 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 - the right-hand half of `Layout.Content`'s column.
6
- * `Layout.SplitHeader` / `Layout.SplitFooter` children stick to the panel
7
- * edges; the remaining content scrolls.
5
+ * while visible - the right-hand half of `Layout.Content`'s column. Content
6
+ * tracks the `--ds-layout-subnav-offset` var, so an expanded subnav never
7
+ * covers the panel's top edge. `Layout.SplitHeader` / `Layout.SplitFooter`
8
+ * children stick to the panel edges; the remaining content scrolls.
8
9
  */
9
10
  export declare const SplitDocked: React.FC<SplitProps>;
@@ -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,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
+ import React from"react";import styled from"@emotion/styled";import{Slot,SUBNAV_OFFSET_VAR}from"../-constants";import{useDeclarePanel,useLayoutPortal}from"../registry";import{useLayout}from"../useLayout";import{PanelContainer}from"../PanelContainer";let StyledSplitSlot=styled("div",{target:"e1ldbp5v0",label:"StyledSplitSlot"})(({theme})=>({position:"absolute",right:0,left: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 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(StyledSplitSlot,null,React.createElement(PanelContainer,{background:background,"aria-label":ariaLabel,scrollContainerRef:scrollContainerRef,onScroll:onScroll,"data-e2e-test-id":dataE2eTestId},children)):null)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amboss/design-system",
3
- "version": "4.17.0",
3
+ "version": "4.19.0",
4
4
  "description": "the design system for AMBOSS products",
5
5
  "author": "AMBOSS",
6
6
  "license": "ISC",