@amboss/design-system 4.9.4-canary.2 → 4.9.4

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 (100) hide show
  1. package/build/cjs/components/Internal/Panel/Panel.d.ts +3 -5
  2. package/build/cjs/components/Internal/Panel/Panel.js +1 -1
  3. package/build/cjs/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
  4. package/build/cjs/components/Internal/PanelHeader/PanelHeader.js +1 -1
  5. package/build/cjs/components/Layout/-constants.d.ts +0 -10
  6. package/build/cjs/components/Layout/-constants.js +1 -1
  7. package/build/cjs/components/Layout/-types.d.ts +11 -26
  8. package/build/cjs/components/Layout/Layout.d.ts +0 -4
  9. package/build/cjs/components/Layout/Layout.js +1 -1
  10. package/build/cjs/components/Layout/LayoutProvider.js +1 -1
  11. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +4 -3
  12. package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  13. package/build/cjs/components/Layout/PanelContainer.d.ts +1 -1
  14. package/build/cjs/components/Layout/PanelContainer.js +1 -1
  15. package/build/cjs/components/Layout/RightPanel/RightPanel.js +1 -1
  16. package/build/cjs/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  17. package/build/cjs/components/Layout/Split/Split.js +1 -1
  18. package/build/cjs/components/Layout/Split/SplitDocked.js +1 -1
  19. package/build/cjs/components/Layout/index.d.ts +0 -1
  20. package/build/cjs/components/Layout/registry.d.ts +4 -8
  21. package/build/cjs/components/Layout/useLayout.js +1 -1
  22. package/build/cjs/components/Layout/usePanelDockedSlide.js +1 -1
  23. package/build/cjs/components/VirtualScrollList/VirtualScrollList.js +1 -1
  24. package/build/cjs/components/VirtualScrollList/VirtualScrollListReducer.d.ts +8 -1
  25. package/build/cjs/components/VirtualScrollList/VirtualScrollListReducer.js +1 -1
  26. package/build/cjs/shared/FocusTrapWrapper.d.ts +1 -1
  27. package/build/cjs/shared/FocusTrapWrapper.js +1 -1
  28. package/build/cjs/web-tokens/_sizes.json +55 -55
  29. package/build/cjs/web-tokens/layout-vars.d.ts +0 -7
  30. package/build/cjs/web-tokens/layout-vars.js +1 -1
  31. package/build/cjs/web-tokens/layout-vars.ts +0 -7
  32. package/build/cjs/web-tokens/visualConfig.d.ts +0 -25
  33. package/build/cjs/web-tokens/visualConfig.js +1 -1
  34. package/build/esm/components/Internal/Panel/Panel.d.ts +3 -5
  35. package/build/esm/components/Internal/Panel/Panel.js +1 -1
  36. package/build/esm/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
  37. package/build/esm/components/Internal/PanelHeader/PanelHeader.js +1 -1
  38. package/build/esm/components/Layout/-constants.d.ts +0 -10
  39. package/build/esm/components/Layout/-constants.js +1 -1
  40. package/build/esm/components/Layout/-types.d.ts +11 -26
  41. package/build/esm/components/Layout/Layout.d.ts +0 -4
  42. package/build/esm/components/Layout/Layout.js +1 -1
  43. package/build/esm/components/Layout/LayoutProvider.js +1 -1
  44. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +4 -3
  45. package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
  46. package/build/esm/components/Layout/PanelContainer.d.ts +1 -1
  47. package/build/esm/components/Layout/PanelContainer.js +1 -1
  48. package/build/esm/components/Layout/RightPanel/RightPanel.js +1 -1
  49. package/build/esm/components/Layout/Split/MobileSplitView/MobileSplitView.js +1 -1
  50. package/build/esm/components/Layout/Split/Split.js +1 -1
  51. package/build/esm/components/Layout/Split/SplitDocked.js +1 -1
  52. package/build/esm/components/Layout/index.d.ts +0 -1
  53. package/build/esm/components/Layout/registry.d.ts +4 -8
  54. package/build/esm/components/Layout/useLayout.js +1 -1
  55. package/build/esm/components/Layout/usePanelDockedSlide.js +1 -1
  56. package/build/esm/components/VirtualScrollList/VirtualScrollList.js +1 -1
  57. package/build/esm/components/VirtualScrollList/VirtualScrollListReducer.d.ts +8 -1
  58. package/build/esm/components/VirtualScrollList/VirtualScrollListReducer.js +1 -1
  59. package/build/esm/shared/FocusTrapWrapper.d.ts +1 -1
  60. package/build/esm/shared/FocusTrapWrapper.js +1 -1
  61. package/build/esm/web-tokens/_sizes.json +55 -55
  62. package/build/esm/web-tokens/layout-vars.d.ts +0 -7
  63. package/build/esm/web-tokens/layout-vars.js +1 -1
  64. package/build/esm/web-tokens/layout-vars.ts +0 -7
  65. package/build/esm/web-tokens/visualConfig.d.ts +0 -25
  66. package/build/esm/web-tokens/visualConfig.js +1 -1
  67. package/build/scss/_layout.scss +0 -14
  68. package/package.json +1 -1
  69. package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.d.ts +0 -9
  70. package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.js +0 -1
  71. package/build/cjs/components/Layout/BottomBar/LayoutBottomBarItem.d.ts +0 -14
  72. package/build/cjs/components/Layout/BottomBar/LayoutBottomBarItem.js +0 -1
  73. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +0 -11
  74. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.js +0 -1
  75. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +0 -10
  76. package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +0 -1
  77. package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.d.ts +0 -39
  78. package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.js +0 -1
  79. package/build/cjs/components/Layout/BottomBar/getBottomBarOuterSpaceStyles.d.ts +0 -14
  80. package/build/cjs/components/Layout/BottomBar/getBottomBarOuterSpaceStyles.js +0 -1
  81. package/build/cjs/components/Layout/LayoutPortal.d.ts +0 -7
  82. package/build/cjs/components/Layout/LayoutPortal.js +0 -1
  83. package/build/cjs/components/Layout/usePanelAnimations.d.ts +0 -12
  84. package/build/cjs/components/Layout/usePanelAnimations.js +0 -1
  85. package/build/esm/components/Layout/BottomBar/LayoutBottomBar.d.ts +0 -9
  86. package/build/esm/components/Layout/BottomBar/LayoutBottomBar.js +0 -1
  87. package/build/esm/components/Layout/BottomBar/LayoutBottomBarItem.d.ts +0 -14
  88. package/build/esm/components/Layout/BottomBar/LayoutBottomBarItem.js +0 -1
  89. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +0 -11
  90. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.js +0 -1
  91. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +0 -10
  92. package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +0 -1
  93. package/build/esm/components/Layout/BottomBar/getBottomBarLayout.d.ts +0 -39
  94. package/build/esm/components/Layout/BottomBar/getBottomBarLayout.js +0 -1
  95. package/build/esm/components/Layout/BottomBar/getBottomBarOuterSpaceStyles.d.ts +0 -14
  96. package/build/esm/components/Layout/BottomBar/getBottomBarOuterSpaceStyles.js +0 -1
  97. package/build/esm/components/Layout/LayoutPortal.d.ts +0 -7
  98. package/build/esm/components/Layout/LayoutPortal.js +0 -1
  99. package/build/esm/components/Layout/usePanelAnimations.d.ts +0 -12
  100. package/build/esm/components/Layout/usePanelAnimations.js +0 -1
@@ -1,9 +0,0 @@
1
- import { type ReactElement, type ReactNode } from "react";
2
- import type { ConditionalAccessibleName } from "../../../types/a11y";
3
- export type LayoutBottomBarProps = ConditionalAccessibleName & {
4
- /** Layout.BottomBarItem declarations for the page's actions. */
5
- children: ReactNode;
6
- /** Identifier applied to the action group. */
7
- "data-e2e-test-id"?: string;
8
- };
9
- export declare function LayoutBottomBar({ children, "data-e2e-test-id": dataE2eTestId, ...accessibleName }: LayoutBottomBarProps): ReactElement | null;
@@ -1 +0,0 @@
1
- import React,{useLayoutEffect}from"react";import{useTheme}from"@emotion/react";import{LayoutPortal}from"../LayoutPortal";import{useLayoutVar}from"../LayoutCssVars";import{BOTTOM_BAR_HEIGHT_VAR,RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR}from"../-constants";import{useLayout}from"../useLayout";import{getBottomBarLayout}from"./getBottomBarLayout";import{StyledLayoutBottomBar}from"./StyledLayoutBottomBar";import{StyledLayoutBottomBarSection}from"./StyledLayoutBottomBarSection";let useGlobalCssVariables=(rowCount,hasRightPanel)=>{let rowHeight=useTheme().variables.layout.bottomBar.contentHeight.default,bottomBarHeightCssVar=useLayoutVar(BOTTOM_BAR_HEIGHT_VAR),rightPanelBottomBarHeightCssVar=useLayoutVar(RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR);useLayoutEffect(()=>{if(!rowCount){bottomBarHeightCssVar.remove(),rightPanelBottomBarHeightCssVar.remove();return}bottomBarHeightCssVar.set(`calc(${rowCount} * ${rowHeight} + env(safe-area-inset-bottom))`),rightPanelBottomBarHeightCssVar.set(hasRightPanel?`var(${BOTTOM_BAR_HEIGHT_VAR})`:"0px")},[rowCount,rowHeight,hasRightPanel,bottomBarHeightCssVar,rightPanelBottomBarHeightCssVar])};export function LayoutBottomBar({children,"data-e2e-test-id":dataE2eTestId,...accessibleName}){let{leftPanel,content,splitview,rightPanel}=useLayout(),{sections,cells,rowCount,hasRightPanel}=getBottomBarLayout(children,{leftPanel,content,splitview,rightPanel});return(useGlobalCssVariables(rowCount,hasRightPanel),sections.length)?React.createElement(LayoutPortal,null,React.createElement(StyledLayoutBottomBar,{...accessibleName,role:"group",hasRightPanel:hasRightPanel,cells:cells,hasSplitColumns:"column"===content.presentation&&"column"===splitview.presentation,"data-ds-id":"LayoutBottomBar","data-e2e-test-id":dataE2eTestId},sections.map(section=>React.createElement(StyledLayoutBottomBarSection,{key:section.region,"data-e2e-test-id":section["data-e2e-test-id"],columnIndex:section.columnIndex,rowIndex:section.rowIndex,fullWidth:"full"===section.placement},section.children)))):null}
@@ -1,14 +0,0 @@
1
- import type { FC, ReactNode } from "react";
2
- import type { SlotKey } from "../-types";
3
- export type LayoutBottomBarFallback = "hide" | "remaining" | "full";
4
- export type LayoutBottomBarItemProps = {
5
- /** Layout region whose column the item follows. */
6
- region: SlotKey;
7
- /** Placement when the region has no column. Defaults to hiding the item. */
8
- fallback?: LayoutBottomBarFallback;
9
- /** Actions supplied and styled by the consumer. */
10
- children: ReactNode;
11
- /** Identifier applied to the item's action container. */
12
- "data-e2e-test-id"?: string;
13
- };
14
- export declare const LayoutBottomBarItem: FC<LayoutBottomBarItemProps>;
@@ -1 +0,0 @@
1
- export const LayoutBottomBarItem=()=>null;
@@ -1,11 +0,0 @@
1
- import type { BottomBarCell } from "./getBottomBarLayout";
2
- type StyledLayoutBottomBarProps = {
3
- hasRightPanel: boolean;
4
- hasSplitColumns: boolean;
5
- cells: BottomBarCell[];
6
- };
7
- export declare const StyledLayoutBottomBar: import("@emotion/styled").StyledComponent<{
8
- theme?: import("@emotion/react").Theme;
9
- as?: React.ElementType;
10
- } & StyledLayoutBottomBarProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
11
- export {};
@@ -1 +0,0 @@
1
- import styled from"@emotion/styled";import{getBottomBarOuterSpaceStyles}from"./getBottomBarOuterSpaceStyles";import{LAYOUT_REGIONS_READY_VAR,PAGE_BOTTOM_BAR_INSET,PANEL_WIDTH_VAR,PANEL_START_VAR}from"../-constants";let getRegionStart=region=>`var(${PANEL_START_VAR[region]}, 0px)`,getRegionWidth=region=>`var(${PANEL_WIDTH_VAR[region]}, 0px)`,getBottomBarCellWidth=cell=>{switch(cell.kind){case"leading-gap":return getRegionStart(cell.region);case"trailing-gap":return`max(0px, calc(100% - ${getRegionStart(cell.region)} - ${getRegionWidth(cell.region)}))`;case"column-gap":return`max(0px, calc(${getRegionStart(cell.region)} - ${getRegionStart(cell.previousRegion)} - ${getRegionWidth(cell.previousRegion)}))`;case"flexible-gap":return"minmax(0, 1fr)";default:{let{region,placement,fallback}=cell.section;if("remaining"===placement)return"max-content";if(cell.flexible)return"minmax(0, 1fr)";let columnWidth=cell.fillLeadingSpace?`calc(${getRegionWidth(region)} + ${getRegionStart(region)})`:getRegionWidth(region);return"remaining"===fallback?`minmax(max-content, ${columnWidth})`:columnWidth}}};export const StyledLayoutBottomBar=styled("div",{target:"e7hwo8w0",label:"StyledLayoutBottomBar"})(({theme,hasRightPanel,cells})=>({display:"grid",gridTemplateColumns:cells.map(getBottomBarCellWidth).join(" ")||"minmax(0, 1fr)",gridAutoRows:theme.variables.layout.bottomBar.contentHeight.default,alignContent:"start",bottom:0,boxShadow:theme.values.elevation[2],boxSizing:"border-box",height:PAGE_BOTTOM_BAR_INSET,left:0,opacity:`var(${LAYOUT_REGIONS_READY_VAR}, 0)`,paddingBottom:"env(safe-area-inset-bottom)",position:"absolute",right:hasRightPanel?0:`calc(${getRegionWidth("rightPanel")} + min(${getRegionWidth("rightPanel")}, ${theme.variables.size.spacing.xxs}))`,zIndex:theme.variables.zIndex.dropdown}),getBottomBarOuterSpaceStyles);
@@ -1,10 +0,0 @@
1
- type StyledLayoutBottomBarSectionProps = {
2
- columnIndex?: number;
3
- rowIndex: number;
4
- fullWidth: boolean;
5
- };
6
- export declare const StyledLayoutBottomBarSection: import("@emotion/styled").StyledComponent<{
7
- theme?: import("@emotion/react").Theme;
8
- as?: React.ElementType;
9
- } & StyledLayoutBottomBarSectionProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
- export {};
@@ -1 +0,0 @@
1
- import styled from"@emotion/styled";export const StyledLayoutBottomBarSection=styled("div",{target:"e4dy5fk0",label:"StyledLayoutBottomBarSection"})(({columnIndex,rowIndex,fullWidth})=>({gridColumn:fullWidth?"1 / -1":(columnIndex??0)+1,gridRow:rowIndex+1,alignItems:"center",boxSizing:"border-box",display:"flex",minWidth:0,whiteSpace:"nowrap"}));
@@ -1,39 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import type { LayoutValue, SlotKey } from "../-types";
3
- import { type LayoutBottomBarItemProps, type LayoutBottomBarFallback } from "./LayoutBottomBarItem";
4
- type BottomBarLayout = Pick<LayoutValue, SlotKey>;
5
- type BottomBarItemMode = "column" | LayoutBottomBarFallback;
6
- type VisibleSection = LayoutBottomBarItemProps & {
7
- placement: Exclude<BottomBarItemMode, "hide">;
8
- fallback: LayoutBottomBarFallback;
9
- };
10
- type SharedSection = VisibleSection & {
11
- placement: "column" | "remaining";
12
- };
13
- type ArrangedSection = VisibleSection & {
14
- columnIndex?: number;
15
- rowIndex: number;
16
- };
17
- export type BottomBarCell = {
18
- kind: "section";
19
- section: SharedSection;
20
- flexible: boolean;
21
- fillLeadingSpace: boolean;
22
- } | {
23
- kind: "leading-gap" | "trailing-gap";
24
- region: SlotKey;
25
- } | {
26
- kind: "column-gap";
27
- region: SlotKey;
28
- previousRegion: SlotKey;
29
- } | {
30
- kind: "flexible-gap";
31
- };
32
- type BottomBarArrangement = {
33
- cells: BottomBarCell[];
34
- sections: ArrangedSection[];
35
- rowCount: number;
36
- hasRightPanel: boolean;
37
- };
38
- export declare const getBottomBarLayout: (children: ReactNode, layout: BottomBarLayout) => BottomBarArrangement;
39
- export {};
@@ -1 +0,0 @@
1
- import{Children,isValidElement}from"react";import{PANEL_ORDER}from"../-constants";import{LayoutBottomBarItem}from"./LayoutBottomBarItem";let getBottomBarItemMode=({region,fallback,layout})=>{let handle=layout[region];return"column"===handle.presentation?"column":("leftPanel"!==region||"sidebar"!==layout.leftPanel.state.variant)&&("rightPanel"!==region||"sidebar"!==layout.rightPanel.state.variant)||handle.isVisible||null===handle.animation?fallback:"column"},getVisibleSections=(children,layout)=>Children.toArray(children).flatMap(child=>{if(!isValidElement(child)||child.type!==LayoutBottomBarItem||null==child.props.children||!1===child.props.children)return[];let{region,fallback="hide"}=child.props,placement=getBottomBarItemMode({region,fallback,layout});return"hide"===placement?[]:[{...child.props,placement,fallback}]}),shouldPreserveSplitColumnWidth=sections=>{let hasLeftFallback=sections.some(({region,fallback})=>"leftPanel"===region&&"remaining"===fallback),hasContentColumn=sections.some(({region,placement})=>"content"===region&&"column"===placement),hasSplitColumn=sections.some(({region,placement})=>"splitview"===region&&"column"===placement),hasRightFallback=sections.some(({region,fallback})=>"rightPanel"===region&&"remaining"===fallback);return hasLeftFallback&&hasContentColumn&&hasSplitColumn&&!hasRightFallback},getSharedRowCells=(sections,layout)=>{if(!sections.length)return[];let firstSection=sections[0],lastSection=sections[sections.length-1],hasRemainingActions=sections.some(({fallback})=>"remaining"===fallback),preserveSplitColumn=shouldPreserveSplitColumnWidth(sections),fillLeadingSpace="column"===firstSection.placement&&("content"===firstSection.region||"splitview"===firstSection.region)&&"column"!==layout.leftPanel.presentation,flexibleColumns={leftPanel:!1,content:hasRemainingActions,splitview:hasRemainingActions&&!preserveSplitColumn,rightPanel:!1},hasFlexibleColumn=sections.some(({region,placement})=>"column"===placement&&flexibleColumns[region]),needsFlexibleGap=hasRemainingActions&&!hasFlexibleColumn,rightActions=sections.find(({region})=>"rightPanel"===region);return[..."column"!==firstSection.placement||fillLeadingSpace?[]:[{kind:"leading-gap",region:firstSection.region}],...sections.flatMap((section,index)=>{let previousSection=sections[index-1];return[..."column"===section.placement&&previousSection?.placement==="column"?[{kind:"column-gap",region:section.region,previousRegion:previousSection.region}]:[],...needsFlexibleGap&&section===rightActions?[{kind:"flexible-gap"}]:[],{kind:"section",section,flexible:flexibleColumns[section.region],fillLeadingSpace:section===firstSection&&fillLeadingSpace&&!hasRemainingActions}]}),...!hasRemainingActions||preserveSplitColumn?[{kind:"trailing-gap",region:lastSection.region}]:[],...needsFlexibleGap&&!rightActions?[{kind:"flexible-gap"}]:[]]};export const getBottomBarLayout=(children,layout)=>{let sections=getVisibleSections(children,layout),sharedSections=PANEL_ORDER.flatMap(region=>sections.filter(section=>section.region===region&&"full"!==section.placement)),fullWidthSections=sections.filter(({placement})=>"full"===placement),sharedRowCount=+!!sharedSections.length,cells=getSharedRowCells(sharedSections,layout);return{cells,sections:[...cells.flatMap((cell,column)=>"section"===cell.kind?[{...cell.section,columnIndex:column,rowIndex:0}]:[]),...fullWidthSections.map((section,row)=>({...section,rowIndex:sharedRowCount+row}))],rowCount:sharedRowCount+fullWidthSections.length,hasRightPanel:sections.some(({region})=>"rightPanel"===region)}};
@@ -1,14 +0,0 @@
1
- import type { CSSObject, Theme } from "@emotion/react";
2
- import type { BottomBarCell } from "./getBottomBarLayout";
3
- type BottomBarOuterSpaceStylesOptions = {
4
- theme: Theme;
5
- hasRightPanel: boolean;
6
- hasSplitColumns: boolean;
7
- cells: BottomBarCell[];
8
- };
9
- /**
10
- * Fills the side margins left by the content/split max-width in the first row.
11
- * Region gaps stay transparent; action sizing and placement are unaffected.
12
- */
13
- export declare const getBottomBarOuterSpaceStyles: ({ theme, hasRightPanel, hasSplitColumns, cells, }: BottomBarOuterSpaceStylesOptions) => CSSObject;
14
- export {};
@@ -1 +0,0 @@
1
- import{PANEL_START_VAR,PANEL_WIDTH_VAR}from"../-constants";let getRegionEnd=region=>`calc(var(${PANEL_START_VAR[region]}, 0px) + var(${PANEL_WIDTH_VAR[region]}, 0px))`,hasColumnActions=(cells,region)=>cells.some(cell=>"section"===cell.kind&&cell.section.region===region&&"column"===cell.section.placement);export const getBottomBarOuterSpaceStyles=({theme,hasRightPanel,hasSplitColumns,cells})=>{let leftPanelEnd=getRegionEnd("leftPanel"),splitEnd=getRegionEnd("splitview"),rightPanelWidth=`var(${PANEL_WIDTH_VAR.rightPanel}, 0px)`,rightPanelGap=`min(${rightPanelWidth}, ${theme.variables.size.spacing.xxs})`,contentAreaEnd=hasRightPanel?`calc(100% - ${rightPanelWidth} - ${rightPanelGap})`:"100%";return{"&::before, &::after":{position:"absolute",top:0,height:theme.variables.layout.bottomBar.contentHeight.default,backgroundColor:theme.values.color.background.primary.default,pointerEvents:"none",zIndex:-1},"&::before":{content:hasSplitColumns&&hasColumnActions(cells,"content")?'""':"none",left:leftPanelEnd,width:`max(0px, calc(var(${PANEL_START_VAR.content}, 0px) - ${leftPanelEnd}))`},"&::after":{content:hasSplitColumns&&hasColumnActions(cells,"splitview")?'""':"none",left:splitEnd,width:`max(0px, calc(${contentAreaEnd} - ${splitEnd}))`}}};
@@ -1,7 +0,0 @@
1
- import type { ReactNode } from "react";
2
- type LayoutPortalProps = {
3
- /** Content rendered at the nearest Layout root. */
4
- children: ReactNode;
5
- };
6
- export declare function LayoutPortal({ children }: LayoutPortalProps): ReactNode;
7
- export {};
@@ -1 +0,0 @@
1
- import{useLayoutPortal}from"./registry";export function LayoutPortal({children}){return useLayoutPortal("root",children)}
@@ -1,12 +0,0 @@
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: 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 {};
@@ -1 +0,0 @@
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)};