@amboss/design-system 4.9.4-canary.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.
- package/build/cjs/components/CheckboxCard/CheckboxCard.d.ts +1 -1
- package/build/cjs/components/Content/ContentCheckbox/ContentCheckbox.d.ts +1 -1
- package/build/cjs/components/Content/ContentCitation/ContentCitation.d.ts +3 -3
- package/build/cjs/components/Content/ContentFontResizer/FontSizeOffsetContext.d.ts +1 -1
- package/build/cjs/components/Content/ContentText/ContentText.d.ts +1 -1
- package/build/cjs/components/Content/DosageButton/DosageButton.d.ts +1 -1
- package/build/cjs/components/DataTable/DataTable.d.ts +3 -2
- package/build/cjs/components/DataTable/TableCell.d.ts +1 -1
- package/build/cjs/components/DataTable/internal/tablePrimitives.d.ts +3 -3
- package/build/cjs/components/EntityList/styled-components.d.ts +8 -8
- package/build/cjs/components/Form/Checkbox/Checkbox.d.ts +2 -2
- package/build/cjs/components/Form/Combobox/StyledSelectComponents.d.ts +4 -4
- package/build/cjs/components/Form/DatePicker/DatePicker.d.ts +1 -1
- package/build/cjs/components/Form/MaskedInput/MaskedInput.d.ts +1 -1
- package/build/cjs/components/Form/Radio/Radio.d.ts +2 -2
- package/build/cjs/components/Form/RangeInput/RangeInput.d.ts +1 -1
- package/build/cjs/components/Form/Textarea/Textarea.d.ts +2 -2
- package/build/cjs/components/Form/Toggle/Toggle.d.ts +3 -3
- package/build/cjs/components/Form/ToggleButton/ToggleButton.d.ts +1 -1
- package/build/cjs/components/Grid/Grid.d.ts +1 -1
- package/build/cjs/components/Internal/Drawer/Drawer.js +3 -3
- package/build/cjs/components/Internal/LayoutFloat/LayoutFloat.d.ts +13 -1
- package/build/cjs/components/Internal/LayoutFloat/useLayoutFloatDrag.d.ts +1 -1
- package/build/cjs/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
- package/build/cjs/components/Layout/-types.d.ts +9 -0
- package/build/{esm/components/Layout/BottomBar → cjs/components/Layout/BottomBar/BottomBarItem}/LayoutBottomBarItem.d.ts +1 -1
- package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.d.ts +2 -10
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +1 -1
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +2 -2
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -1
- package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.d.ts +1 -1
- package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.js +1 -1
- package/build/cjs/components/Layout/Layout.d.ts +1 -1
- package/build/cjs/components/Layout/Layout.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/useLeftBarContext.d.ts +1 -1
- package/build/cjs/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +1 -1
- package/build/cjs/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +1 -1
- package/build/cjs/components/Layout/Split/MobileSplitView/useMobileSplitStack.d.ts +1 -1
- package/build/cjs/components/Layout/context.d.ts +2 -2
- package/build/cjs/components/Layout/index.d.ts +0 -1
- package/build/cjs/components/Layout/registry.d.ts +6 -6
- package/build/cjs/components/Layout/useLeftPanelId.d.ts +1 -1
- package/build/cjs/components/Layout/usePanelAnimations.d.ts +1 -1
- package/build/cjs/components/NavBar/NavBar.d.ts +14 -18
- package/build/cjs/components/NavBar/NavBarContext.d.ts +1 -1
- package/build/cjs/components/NavBar/NavBarDropdownTriggerButton.d.ts +1 -1
- package/build/cjs/components/Patterns/Dialog/DialogContext.d.ts +1 -1
- package/build/cjs/components/Patterns/EmptyState/EmptyState.d.ts +2 -2
- package/build/cjs/components/Patterns/Modal/Modal.d.ts +4 -2
- package/build/cjs/components/Patterns/Popover/PopoverContext.d.ts +1 -1
- package/build/cjs/components/PromptInput/PromptInput.d.ts +1 -1
- package/build/cjs/components/RadioCard/RadioCard.d.ts +1 -1
- package/build/cjs/components/SearchResult/SearchResult.d.ts +3 -1
- package/build/cjs/components/Sheet/Sheet.js +1 -1
- package/build/cjs/components/Sheet/useSheetHeightSync.d.ts +26 -0
- package/build/cjs/components/Sheet/useSheetHeightSync.js +1 -0
- package/build/cjs/components/SubThemeProvider/SubThemeContext.d.ts +1 -1
- package/build/cjs/components/Tooltip/FloatingPositionedContext.d.ts +1 -1
- package/build/cjs/components/Utilities/ContainerQuery/ContainerQueryContext.d.ts +1 -1
- package/build/cjs/components/Utilities/ScreenReaderText/ScreenReaderText.d.ts +1 -1
- package/build/cjs/components/VirtualScrollList/VirtualScrollList.js +1 -1
- package/build/cjs/components/VirtualScrollList/VirtualScrollListReducer.d.ts +8 -1
- package/build/cjs/components/VirtualScrollList/VirtualScrollListReducer.js +1 -1
- package/build/cjs/shared/FocusTrapWrapper.d.ts +1 -1
- package/build/cjs/shared/FocusTrapWrapper.js +1 -1
- package/build/cjs/shared/components/SelectableButton.d.ts +1 -1
- package/build/cjs/shared/useExitAnimation.js +1 -0
- package/build/cjs/web-tokens/_sizes.json +55 -55
- package/build/cjs/web-tokens/visualConfig.d.ts +14 -0
- package/build/cjs/web-tokens/visualConfig.js +1 -1
- package/build/esm/components/CheckboxCard/CheckboxCard.d.ts +1 -1
- package/build/esm/components/Content/ContentCheckbox/ContentCheckbox.d.ts +1 -1
- package/build/esm/components/Content/ContentCitation/ContentCitation.d.ts +3 -3
- package/build/esm/components/Content/ContentFontResizer/FontSizeOffsetContext.d.ts +1 -1
- package/build/esm/components/Content/ContentText/ContentText.d.ts +1 -1
- package/build/esm/components/Content/DosageButton/DosageButton.d.ts +1 -1
- package/build/esm/components/DataTable/DataTable.d.ts +3 -2
- package/build/esm/components/DataTable/TableCell.d.ts +1 -1
- package/build/esm/components/DataTable/internal/tablePrimitives.d.ts +3 -3
- package/build/esm/components/EntityList/styled-components.d.ts +8 -8
- package/build/esm/components/Form/Checkbox/Checkbox.d.ts +2 -2
- package/build/esm/components/Form/Combobox/StyledSelectComponents.d.ts +4 -4
- package/build/esm/components/Form/DatePicker/DatePicker.d.ts +1 -1
- package/build/esm/components/Form/MaskedInput/MaskedInput.d.ts +1 -1
- package/build/esm/components/Form/Radio/Radio.d.ts +2 -2
- package/build/esm/components/Form/RangeInput/RangeInput.d.ts +1 -1
- package/build/esm/components/Form/Textarea/Textarea.d.ts +2 -2
- package/build/esm/components/Form/Toggle/Toggle.d.ts +3 -3
- package/build/esm/components/Form/ToggleButton/ToggleButton.d.ts +1 -1
- package/build/esm/components/Grid/Grid.d.ts +1 -1
- package/build/esm/components/Internal/Drawer/Drawer.js +3 -3
- package/build/esm/components/Internal/LayoutFloat/LayoutFloat.d.ts +13 -1
- package/build/esm/components/Internal/LayoutFloat/useLayoutFloatDrag.d.ts +1 -1
- package/build/esm/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
- package/build/esm/components/Layout/-types.d.ts +9 -0
- package/build/{cjs/components/Layout/BottomBar → esm/components/Layout/BottomBar/BottomBarItem}/LayoutBottomBarItem.d.ts +1 -1
- package/build/esm/components/Layout/BottomBar/LayoutBottomBar.d.ts +2 -10
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +1 -1
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +2 -2
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -1
- package/build/esm/components/Layout/BottomBar/getBottomBarLayout.d.ts +1 -1
- package/build/esm/components/Layout/BottomBar/getBottomBarLayout.js +1 -1
- package/build/esm/components/Layout/Layout.d.ts +1 -1
- package/build/esm/components/Layout/Layout.js +1 -1
- package/build/esm/components/Layout/LeftPanel/useLeftBarContext.d.ts +1 -1
- package/build/esm/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +1 -1
- package/build/esm/components/Layout/Split/MobileSplitView/StyledMobileSplitSlideLayer.d.ts +1 -1
- package/build/esm/components/Layout/Split/MobileSplitView/useMobileSplitStack.d.ts +1 -1
- package/build/esm/components/Layout/context.d.ts +2 -2
- package/build/esm/components/Layout/index.d.ts +0 -1
- package/build/esm/components/Layout/registry.d.ts +6 -6
- package/build/esm/components/Layout/useLeftPanelId.d.ts +1 -1
- package/build/esm/components/Layout/usePanelAnimations.d.ts +1 -1
- package/build/esm/components/NavBar/NavBar.d.ts +14 -18
- package/build/esm/components/NavBar/NavBarContext.d.ts +1 -1
- package/build/esm/components/NavBar/NavBarDropdownTriggerButton.d.ts +1 -1
- package/build/esm/components/Patterns/Dialog/DialogContext.d.ts +1 -1
- package/build/esm/components/Patterns/EmptyState/EmptyState.d.ts +2 -2
- package/build/esm/components/Patterns/Modal/Modal.d.ts +4 -2
- package/build/esm/components/Patterns/Popover/PopoverContext.d.ts +1 -1
- package/build/esm/components/PromptInput/PromptInput.d.ts +1 -1
- package/build/esm/components/RadioCard/RadioCard.d.ts +1 -1
- package/build/esm/components/SearchResult/SearchResult.d.ts +3 -1
- package/build/esm/components/Sheet/Sheet.js +1 -1
- package/build/esm/components/Sheet/useSheetHeightSync.d.ts +26 -0
- package/build/esm/components/Sheet/useSheetHeightSync.js +1 -0
- package/build/esm/components/SubThemeProvider/SubThemeContext.d.ts +1 -1
- package/build/esm/components/Tooltip/FloatingPositionedContext.d.ts +1 -1
- package/build/esm/components/Utilities/ContainerQuery/ContainerQueryContext.d.ts +1 -1
- package/build/esm/components/Utilities/ScreenReaderText/ScreenReaderText.d.ts +1 -1
- package/build/esm/components/VirtualScrollList/VirtualScrollList.js +1 -1
- package/build/esm/components/VirtualScrollList/VirtualScrollListReducer.d.ts +8 -1
- package/build/esm/components/VirtualScrollList/VirtualScrollListReducer.js +1 -1
- package/build/esm/shared/FocusTrapWrapper.d.ts +1 -1
- package/build/esm/shared/FocusTrapWrapper.js +1 -1
- package/build/esm/shared/components/SelectableButton.d.ts +1 -1
- package/build/esm/shared/useExitAnimation.js +1 -0
- package/build/esm/web-tokens/_sizes.json +55 -55
- package/build/esm/web-tokens/visualConfig.d.ts +14 -0
- package/build/esm/web-tokens/visualConfig.js +1 -1
- package/build/scss/_variables.scss +6 -0
- package/package.json +9 -10
- package/build/cjs/components/Internal/Drawer/useExitAnimation.js +0 -1
- package/build/cjs/shared/isWithinScrolledElement.d.ts +0 -1
- package/build/cjs/shared/isWithinScrolledElement.js +0 -1
- package/build/cjs/shared/useDragDown.d.ts +0 -14
- package/build/cjs/shared/useDragDown.js +0 -1
- package/build/esm/components/Internal/Drawer/useExitAnimation.js +0 -1
- package/build/esm/shared/isWithinScrolledElement.d.ts +0 -1
- package/build/esm/shared/isWithinScrolledElement.js +0 -1
- package/build/esm/shared/useDragDown.d.ts +0 -14
- package/build/esm/shared/useDragDown.js +0 -1
- /package/build/cjs/components/Layout/BottomBar/{LayoutBottomBarItem.js → BottomBarItem/LayoutBottomBarItem.js} +0 -0
- /package/build/cjs/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
- /package/build/esm/components/Layout/BottomBar/{LayoutBottomBarItem.js → BottomBarItem/LayoutBottomBarItem.js} +0 -0
- /package/build/esm/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
|
@@ -15,4 +15,4 @@ export declare const CheckboxCard: React.ForwardRefExoticComponent<{
|
|
|
15
15
|
renderContent?: (params: {
|
|
16
16
|
isSelected: boolean;
|
|
17
17
|
}) => React.ReactNode;
|
|
18
|
-
} & Omit<CheckboxProps, "errorMessages" | "
|
|
18
|
+
} & Omit<CheckboxProps, "errorMessages" | "hideLabel" | "hint" | "indeterminate"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -16,4 +16,4 @@ export declare const ContentCheckbox: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
/** Adds extra spacing around the checkbox to accomodate a label with larger line height */
|
|
17
17
|
isSpacedOut?: boolean;
|
|
18
18
|
"data-e2e-test-id"?: string;
|
|
19
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, "
|
|
19
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -20,7 +20,7 @@ export type ContentCitationProps = {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function ContentCitation({ children, color, isSpacedOut, as, "data-e2e-test-id": dataE2eTestId, }: ContentCitationProps): React.ReactElement;
|
|
22
22
|
export declare namespace ContentCitation {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export { ContentCitationTitle as Title };
|
|
24
|
+
export { ContentCitationLink as Link };
|
|
25
|
+
export { ContentCitationLookupLink as LookupLink };
|
|
26
26
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type FontSizeOffset = number;
|
|
2
|
-
export declare const FontSizeOffsetContext:
|
|
2
|
+
export declare const FontSizeOffsetContext: import("react").Context<number>;
|
|
@@ -7,6 +7,6 @@ export type ContentTextProps = TypographyTextProps & {
|
|
|
7
7
|
/** Provides additional line-height */
|
|
8
8
|
isSpacedOut?: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare const ContentTextContext: React.Context<Pick<ContentTextProps, "color" | "
|
|
10
|
+
export declare const ContentTextContext: React.Context<Pick<ContentTextProps, "color" | "isSpacedOut" | "size" | "weight"> | null>;
|
|
11
11
|
export declare const CONTENT_TEXT_LINE_HEIGHT_OFFSET = 0.14;
|
|
12
12
|
export declare function ContentText({ size, color, weight, isSpacedOut, children, ...rest }: ContentTextProps): React.ReactElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type DosageButtonProps = React.ComponentPropsWithRef<"button">;
|
|
3
3
|
export declare const DosageButton: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
4
|
-
ref?: ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) |
|
|
4
|
+
ref?: React.RefObject<HTMLButtonElement> | ((instance: HTMLButtonElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | null | undefined;
|
|
5
5
|
}, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { MQ } from "../../types";
|
|
3
3
|
import type { DataTableColumn, DataTableColumnOrGroup, DataTableRow, DataTableRowProps, DataTableSlotProps } from "./types";
|
|
4
|
+
import { defaultSortCompareFn } from "./useDataTableSort";
|
|
4
5
|
import { DataTableToolbar } from "./DataTableToolbar/DataTableToolbar";
|
|
5
6
|
type DataTablePropsBase = {
|
|
6
7
|
/** Screen reader text for table caption */
|
|
@@ -143,7 +144,7 @@ export type DataTableProps = DataTablePropsBase & (DataTableSelectableProps | Da
|
|
|
143
144
|
export declare function BaseDataTable({ caption, columns, rows, footer, currentlySortedByColumn, isFirstColumnSticky, isLastColumnSticky, "data-e2e-test-id": dataE2eTestId, isLoading, loadingStateScreenReaderText, isEmpty, slotProps, children, emptyTableContentHeight, layout, width, bodyCellVerticalPadding, emptyCellContent, maxHeight, isSelectable, selectedRowIds, allRowsSelected, selectAllRowsCheckboxAriaLabel, getRowProps, onRowSelectionChange, onAllRowsSelectionChange, isExpandable, expandedRowIds: expandedRowIdsProp, onRowExpansionChange, expandRowAriaLabel, collapseRowAriaLabel, onSort, ...ariaAttributes }: DataTableProps): ReactElement;
|
|
144
145
|
export declare function DataTable({ children, ...rest }: DataTableProps): ReactElement;
|
|
145
146
|
export declare namespace DataTable {
|
|
146
|
-
|
|
147
|
-
|
|
147
|
+
export { defaultSortCompareFn as sortCompareFn };
|
|
148
|
+
export { DataTableToolbar as Toolbar };
|
|
148
149
|
}
|
|
149
150
|
export {};
|
|
@@ -17,5 +17,5 @@ declare const TableCell: import("@emotion/styled").StyledComponent<{
|
|
|
17
17
|
isTableScrolledToLeft: boolean;
|
|
18
18
|
isTableScrolledToRight: boolean;
|
|
19
19
|
sticky?: "left" | "right" | false;
|
|
20
|
-
} & Pick<DataTableRowProps, "isActive">,
|
|
20
|
+
} & Pick<DataTableRowProps, "isActive">, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
21
21
|
export default TableCell;
|
|
@@ -10,14 +10,14 @@ type StyledTrProps = {
|
|
|
10
10
|
export declare const StyledTr: import("@emotion/styled").StyledComponent<{
|
|
11
11
|
theme?: import("@emotion/react").Theme;
|
|
12
12
|
as?: React.ElementType;
|
|
13
|
-
} & StyledTrProps,
|
|
13
|
+
} & StyledTrProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, {}>;
|
|
14
14
|
type StyledTextProps = {
|
|
15
15
|
alignColumn?: DataTableColumn["align"];
|
|
16
16
|
};
|
|
17
17
|
export declare const StyledText: import("@emotion/styled").StyledComponent<Omit<{
|
|
18
18
|
theme?: import("@emotion/react").Theme;
|
|
19
19
|
as?: React.ElementType;
|
|
20
|
-
} & import("../../Typography/Text/Text").BaseTextProps &
|
|
20
|
+
} & import("../../Typography/Text/Text").BaseTextProps & import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement>, "ref"> & import("react").RefAttributes<HTMLParagraphElement> & {
|
|
21
21
|
theme?: import("@emotion/react").Theme;
|
|
22
22
|
} & StyledTextProps, {}, {}>;
|
|
23
23
|
export declare const StyledTd: import("@emotion/styled").StyledComponent<{
|
|
@@ -30,7 +30,7 @@ export declare const StyledTd: import("@emotion/styled").StyledComponent<{
|
|
|
30
30
|
isTableScrolledToLeft: boolean;
|
|
31
31
|
isTableScrolledToRight: boolean;
|
|
32
32
|
sticky?: "left" | "right" | false;
|
|
33
|
-
} & Pick<import("../types").DataTableRowProps, "isActive"> &
|
|
33
|
+
} & Pick<import("../types").DataTableRowProps, "isActive"> & import("react").ClassAttributes<HTMLTableDataCellElement> & import("react").TdHTMLAttributes<HTMLTableDataCellElement> & {
|
|
34
34
|
theme?: import("@emotion/react").Theme;
|
|
35
35
|
} & {
|
|
36
36
|
bodyCellVerticalPadding?: DataTableProps["bodyCellVerticalPadding"];
|
|
@@ -3,38 +3,38 @@ import type { EntityListItemProps, EntityListItemWrapperProps } from "./types";
|
|
|
3
3
|
import type { ListSize } from "../../types";
|
|
4
4
|
export declare const getOffsetMqStyle: (cssProp: string, { theme, size, }: {
|
|
5
5
|
theme: Theme;
|
|
6
|
-
} & Partial<EntityListItemWrapperProps>) => Record<string,
|
|
6
|
+
} & Partial<EntityListItemWrapperProps>) => Record<string, {
|
|
7
7
|
[x: string]: string | number;
|
|
8
|
-
}>;
|
|
8
|
+
} | (string | number)>;
|
|
9
9
|
export declare const StyledList: import("@emotion/styled").StyledComponent<{
|
|
10
10
|
theme?: Theme;
|
|
11
11
|
as?: React.ElementType;
|
|
12
12
|
} & {
|
|
13
13
|
size: ListSize;
|
|
14
|
-
},
|
|
14
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
15
15
|
export declare const StyledEntityItem: import("@emotion/styled").StyledComponent<{
|
|
16
16
|
theme?: Theme;
|
|
17
17
|
as?: React.ElementType;
|
|
18
|
-
},
|
|
18
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
19
19
|
export declare const StyledShowMore: import("@emotion/styled").StyledComponent<{
|
|
20
20
|
theme?: Theme;
|
|
21
21
|
as?: React.ElementType;
|
|
22
|
-
},
|
|
22
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
23
23
|
export declare const StyledWrapperOffset: import("@emotion/styled").StyledComponent<{
|
|
24
24
|
theme?: Theme;
|
|
25
25
|
as?: React.ElementType;
|
|
26
26
|
} & {
|
|
27
27
|
size: ListSize;
|
|
28
|
-
},
|
|
28
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
29
29
|
export declare const StyledEntityListItemWrapper: import("@emotion/styled").StyledComponent<{
|
|
30
30
|
theme?: Theme;
|
|
31
31
|
as?: React.ElementType;
|
|
32
32
|
} & {
|
|
33
33
|
size: ListSize;
|
|
34
|
-
} &
|
|
34
|
+
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
35
35
|
theme?: Theme;
|
|
36
36
|
} & EntityListItemWrapperProps, {}, {}>;
|
|
37
37
|
export declare const StyledEntityListItemButton: import("@emotion/styled").StyledComponent<{
|
|
38
38
|
theme?: Theme;
|
|
39
39
|
as?: React.ElementType;
|
|
40
|
-
} & Partial<EntityListItemProps>,
|
|
40
|
+
} & Partial<EntityListItemProps>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -35,11 +35,11 @@ export declare const CheckboxRaw: React.ForwardRefExoticComponent<{
|
|
|
35
35
|
label?: string | React.ReactElement;
|
|
36
36
|
indeterminate?: boolean;
|
|
37
37
|
size?: CheckboxSizes;
|
|
38
|
-
} & Omit<FormFieldProps, "
|
|
38
|
+
} & Omit<FormFieldProps, "hideLabel" | "label"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
39
39
|
labelSize?: CheckboxSizes;
|
|
40
40
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
41
41
|
export declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
42
42
|
label?: string | React.ReactElement;
|
|
43
43
|
indeterminate?: boolean;
|
|
44
44
|
size?: CheckboxSizes;
|
|
45
|
-
} & Omit<FormFieldProps, "
|
|
45
|
+
} & Omit<FormFieldProps, "hideLabel" | "label"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const StyledContainer: import("@emotion/styled").StyledComponent<{
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
|
-
},
|
|
4
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
5
|
type StyledOptionProps = {
|
|
6
6
|
active: boolean;
|
|
7
7
|
preSelected: boolean;
|
|
@@ -10,13 +10,13 @@ type StyledOptionProps = {
|
|
|
10
10
|
export declare const StyledOption: import("@emotion/styled").StyledComponent<{
|
|
11
11
|
theme?: import("@emotion/react").Theme;
|
|
12
12
|
as?: React.ElementType;
|
|
13
|
-
} & StyledOptionProps,
|
|
13
|
+
} & StyledOptionProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
14
|
export declare const StyledFakeInputWrap: import("@emotion/styled").StyledComponent<{
|
|
15
15
|
theme?: import("@emotion/react").Theme;
|
|
16
16
|
as?: React.ElementType;
|
|
17
|
-
},
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
18
|
export declare const StyledDropdown: import("@emotion/styled").StyledComponent<{
|
|
19
19
|
theme?: import("@emotion/react").Theme;
|
|
20
20
|
as?: React.ElementType;
|
|
21
|
-
},
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
22
|
export {};
|
|
@@ -27,7 +27,7 @@ export declare const DatePicker: React.ForwardRefExoticComponent<{
|
|
|
27
27
|
formatAriaLabel: (monthName: string, year: number) => string;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
} & import("../FormField/FormField").FormFieldProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
30
|
+
} & import("../FormField/FormField").FormFieldProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "type" | "value"> & {
|
|
31
31
|
value?: string;
|
|
32
32
|
hasError?: boolean;
|
|
33
33
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -20,4 +20,4 @@ export declare const MaskedInput: React.ForwardRefExoticComponent<{
|
|
|
20
20
|
maskOptions: FactoryArg;
|
|
21
21
|
onAccept?: (value: string, unmaskedValue: string, typedValue: string) => void;
|
|
22
22
|
onComplete?: (value: string, unmaskedValue: string, typedValue: string) => void;
|
|
23
|
-
} & Omit<InputProps, "
|
|
23
|
+
} & Omit<InputProps, "onChange" | "size" | "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -18,7 +18,7 @@ export declare const RadioRaw: React.ForwardRefExoticComponent<{
|
|
|
18
18
|
/** Display hint below the label specific for the radio */
|
|
19
19
|
labelHint?: string | React.ReactElement;
|
|
20
20
|
size?: RadioSizes;
|
|
21
|
-
} & Omit<FormFieldProps, "
|
|
21
|
+
} & Omit<FormFieldProps, "hideLabel" | "label" | "labelHint"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
22
22
|
labelSize?: RadioSizes;
|
|
23
23
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
24
24
|
export declare const Radio: React.ForwardRefExoticComponent<{
|
|
@@ -26,5 +26,5 @@ export declare const Radio: React.ForwardRefExoticComponent<{
|
|
|
26
26
|
/** Display hint below the label specific for the radio */
|
|
27
27
|
labelHint?: string | React.ReactElement;
|
|
28
28
|
size?: RadioSizes;
|
|
29
|
-
} & Omit<FormFieldProps, "
|
|
29
|
+
} & Omit<FormFieldProps, "hideLabel" | "label" | "labelHint"> & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
30
30
|
export {};
|
|
@@ -9,4 +9,4 @@ export declare const RangeInput: React.ForwardRefExoticComponent<{
|
|
|
9
9
|
/** The step size for each change in the range input's value. */
|
|
10
10
|
hasError?: boolean;
|
|
11
11
|
onSlideStart?: (e: React.FormEvent<HTMLInputElement>) => void;
|
|
12
|
-
} & FormFieldProps & Omit<
|
|
12
|
+
} & FormFieldProps & Omit<InputHTMLAttributes<HTMLInputElement>, "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -14,12 +14,12 @@ export declare const TextareaRaw: React.ForwardRefExoticComponent<{
|
|
|
14
14
|
*/
|
|
15
15
|
hasError?: boolean;
|
|
16
16
|
resize?: "none" | "horizontal" | "vertical" | "both";
|
|
17
|
-
} &
|
|
17
|
+
} & TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
18
18
|
export declare const Textarea: React.ForwardRefExoticComponent<FormFieldProps & {
|
|
19
19
|
/**
|
|
20
20
|
* Set to true to toggle error state
|
|
21
21
|
*/
|
|
22
22
|
hasError?: boolean;
|
|
23
23
|
resize?: "none" | "horizontal" | "vertical" | "both";
|
|
24
|
-
} &
|
|
24
|
+
} & TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
25
25
|
export {};
|
|
@@ -9,7 +9,7 @@ type ToggleRawProps = {
|
|
|
9
9
|
export declare const ToggleRaw: React.ForwardRefExoticComponent<{
|
|
10
10
|
size?: ToggleSize;
|
|
11
11
|
isHighlighted?: boolean;
|
|
12
|
-
} & Omit<
|
|
12
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
13
13
|
export type ToggleProps = ToggleRawProps & {
|
|
14
14
|
/** Controls label alignment with respect to toggle */
|
|
15
15
|
alignLabel?: "before" | "after";
|
|
@@ -20,11 +20,11 @@ export type ToggleProps = ToggleRawProps & {
|
|
|
20
20
|
export declare const Toggle: React.ForwardRefExoticComponent<{
|
|
21
21
|
size?: ToggleSize;
|
|
22
22
|
isHighlighted?: boolean;
|
|
23
|
-
} & Omit<
|
|
23
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
24
24
|
/** Controls label alignment with respect to toggle */
|
|
25
25
|
alignLabel?: "before" | "after";
|
|
26
26
|
/** Display hint below the label specific for the toggle */
|
|
27
27
|
labelHint?: string | React.ReactElement;
|
|
28
28
|
alignItems?: InlineProps["alignItems"];
|
|
29
|
-
} & Omit<FormFieldProps, "
|
|
29
|
+
} & Omit<FormFieldProps, "hideLabel" | "labelHint"> & React.RefAttributes<HTMLInputElement>>;
|
|
30
30
|
export {};
|
|
@@ -7,4 +7,4 @@ export type ToggleButtonProps = {
|
|
|
7
7
|
export declare const ToggleButton: React.ForwardRefExoticComponent<{
|
|
8
8
|
label: string;
|
|
9
9
|
subLabel?: string;
|
|
10
|
-
} & Omit<FormFieldProps, "
|
|
10
|
+
} & Omit<FormFieldProps, "errorMessages" | "hideLabel" | "hint" | "label" | "labelHint"> & Omit<InputHTMLAttributes<HTMLInputElement>, "type"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -32,5 +32,5 @@ export type GridProps = {
|
|
|
32
32
|
} & HTMLAttributes<HTMLDivElement>;
|
|
33
33
|
export declare function Grid({ columnGap, rowGap, "data-e2e-test-id": dataE2eTestId, children, ...rest }: GridProps): React.ReactElement;
|
|
34
34
|
export declare namespace Grid {
|
|
35
|
-
|
|
35
|
+
export { GridItem as Item };
|
|
36
36
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return Drawer}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react1=require("@emotion/react"),_useOutsideClickDeactivatesWithinPortal=require("../../../shared/useOutsideClickDeactivatesWithinPortal"),_useDocument=require("../../../shared/useDocument"),_focusableSelector=require("../../../shared/focusableSelector"),_Portal=require("../../Portal/Portal"),_FocusTrapWrapper=require("../../../shared/FocusTrapWrapper"),_DialogContext=require("../../Patterns/Dialog/DialogContext"),_Backdrop=require("../../Utilities/Backdrop/Backdrop"),_useExitAnimation=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Drawer",{enumerable:!0,get:function(){return Drawer}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react1=require("@emotion/react"),_useOutsideClickDeactivatesWithinPortal=require("../../../shared/useOutsideClickDeactivatesWithinPortal"),_useDocument=require("../../../shared/useDocument"),_focusableSelector=require("../../../shared/focusableSelector"),_Portal=require("../../Portal/Portal"),_FocusTrapWrapper=require("../../../shared/FocusTrapWrapper"),_DialogContext=require("../../Patterns/Dialog/DialogContext"),_Backdrop=require("../../Utilities/Backdrop/Backdrop"),_useExitAnimation=require("../../../shared/useExitAnimation"),StyledViewportLayer=(0,_styled.default)("div",{target:"e1h3k5750",label:"StyledViewportLayer"})(({theme,isLeaving})=>{let{hidden,visible}=theme.variables.opacity,fadeIn=(0,_react1.keyframes)`
|
|
2
2
|
from { opacity: ${hidden}; }
|
|
3
3
|
to { opacity: ${visible}; }
|
|
4
4
|
`,fadeOut=(0,_react1.keyframes)`
|
|
5
5
|
from { opacity: ${visible}; }
|
|
6
6
|
to { opacity: ${hidden}; }
|
|
7
|
-
`,{duration,timingFunction}=theme.variables.animation.modalBackdrop.open;return{position:"fixed",top:0,left:0,zIndex:theme.variables.zIndex.modal,width:"100%",height:"100dvh",animation:`${isLeaving?fadeOut:fadeIn} ${duration} ${timingFunction} both`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}}),StyledContent=(0,_styled.default)("div",{target:"
|
|
7
|
+
`,{duration,timingFunction}=theme.variables.animation.modalBackdrop.open;return{position:"fixed",top:0,left:0,zIndex:theme.variables.zIndex.modal,width:"100%",height:"100dvh",animation:`${isLeaving?fadeOut:fadeIn} ${duration} ${timingFunction} both`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}}),StyledContent=(0,_styled.default)("div",{target:"e1h3k5751",label:"StyledContent"})(({theme,positionX,positionY,isLeaving})=>{let restX=positionX?"0%":"-50%",restY=positionY?"0%":"-50%",{x:fromX,y:fromY}="left"===positionX?{x:"-100%",y:restY}:"right"===positionX?{x:"100%",y:restY}:"top"===positionY?{x:restX,y:"-100%"}:"bottom"===positionY?{x:restX,y:"100%"}:{x:restX,y:restY},resting=`translate(${restX}, ${restY})`,offscreen=`translate(${fromX}, ${fromY})`,slideIn=(0,_react1.keyframes)`
|
|
8
8
|
from { transform: ${offscreen}; }
|
|
9
9
|
to { transform: ${resting}; }
|
|
10
10
|
`,slideOut=(0,_react1.keyframes)`
|
|
11
11
|
from { transform: ${resting}; }
|
|
12
12
|
to { transform: ${offscreen}; }
|
|
13
|
-
`,{duration,timingFunction}=theme.variables.animation.navSlide.open;return{position:"fixed",...{..."left"===positionX&&{left:0},..."right"===positionX&&{right:0},...!positionX&&{left:"50%"},..."top"===positionY&&{top:0},..."bottom"===positionY&&{bottom:0},...!positionY&&{top:"50%"}},transform:resting,willChange:"transform",animation:`${isLeaving?slideOut:slideIn} ${duration} ${timingFunction} both`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}}),StyledBackdrop=(0,_styled.default)(_Backdrop.Backdrop,{target:"
|
|
13
|
+
`,{duration,timingFunction}=theme.variables.animation.navSlide.open;return{position:"fixed",...{..."left"===positionX&&{left:0},..."right"===positionX&&{right:0},...!positionX&&{left:"50%"},..."top"===positionY&&{top:0},..."bottom"===positionY&&{bottom:0},...!positionY&&{top:"50%"}},transform:resting,willChange:"transform",animation:`${isLeaving?slideOut:slideIn} ${duration} ${timingFunction} both`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}}),StyledBackdrop=(0,_styled.default)(_Backdrop.Backdrop,{target:"e1h3k5752",label:"StyledBackdrop"})({pointerEvents:"none"});function getFocusTarget(container,document){return container?.querySelector(_focusableSelector.FOCUSABLE_SELECTOR)??container??document.body}function Drawer({backdropRef,portalContainer,initialFocus,isDismissible=!0,isVisible=!0,onUnmount,hasBackdrop=!0,positionX,positionY,children,handleClose,privateProps:{skipPortal}={skipPortal:!1},...rest}){let portalContainerElement=(0,_Portal.usePortalContainerElement)(portalContainer),contentRef=(0,_react.useRef)(null),document=(0,_useDocument.useDocument)(),{isMounted,isLeaving,onAnimationEnd}=(0,_useExitAnimation.useExitAnimation)(isVisible),wasMounted=(0,_react.useRef)(isMounted);(0,_react.useEffect)(()=>{wasMounted.current&&!isMounted&&onUnmount?.(),wasMounted.current=isMounted},[isMounted,onUnmount]);let layerRef=(0,_react.useRef)(null),setLayerNode=(0,_react.useCallback)(node=>{layerRef.current=node,backdropRef&&(backdropRef.current=node)},[backdropRef]),handleClickOutsideDeactivates=(0,_useOutsideClickDeactivatesWithinPortal.useOutsideClickDeactivatesWithinPortal)({portalContainerElement,outerRef:layerRef,isDismissible});if(!isMounted)return null;let content=_react.default.createElement(StyledViewportLayer,{ref:setLayerNode,"data-ds-id":"Drawer",isLeaving:isLeaving},hasBackdrop&&_react.default.createElement(StyledBackdrop,{"data-ds-id":"DrawerBackdrop"}),_react.default.createElement(_FocusTrapWrapper.FocusTrapWrapper,{active:isVisible,focusTrapOptions:{allowOutsideClick:!0,clickOutsideDeactivates:handleClickOutsideDeactivates,escapeDeactivates:isDismissible,preventScroll:!0,initialFocus:()=>{var container;return container=contentRef.current,"string"==typeof initialFocus?initialFocus:initialFocus?.current??getFocusTarget(container,document)},fallbackFocus:()=>getFocusTarget(contentRef.current,document),onPostDeactivate:()=>handleClose?.()}},_react.default.createElement(StyledContent,{...rest,ref:contentRef,positionX:positionX,positionY:positionY,isLeaving:isLeaving,onAnimationEnd:onAnimationEnd,role:"dialog","aria-modal":"true"},children)));return skipPortal?content:_react.default.createElement(_DialogContext.DialogContext.Provider,{value:!0},_react.default.createElement(_Portal.Portal,{portalContainer:portalContainer},content))}
|
|
@@ -13,4 +13,16 @@ export type LayoutFloatProps = {
|
|
|
13
13
|
hostRef: (el: HTMLDivElement | null) => void;
|
|
14
14
|
"data-e2e-test-id"?: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The floating shell hosting a layout panel's content while its variant is
|
|
18
|
+
* `"float"`. Pins to the bottom-right viewport corner via the internal
|
|
19
|
+
* `Float` positioner, then becomes freely draggable by its header across the
|
|
20
|
+
* viewport (clamped to `spacing.m` from the edges, matching `Float`'s inset).
|
|
21
|
+
* The header carries the `useMove` handle; this float owns the drag geometry
|
|
22
|
+
* and publishes its move handlers via `useLayoutFloatDrag` for the header to drive.
|
|
23
|
+
* Purely presentational otherwise: the content arrives by the panel's persistent
|
|
24
|
+
* host node being appended into `hostRef`'s element.
|
|
25
|
+
*/
|
|
26
|
+
declare const LayoutFloatBase: ({ width, height, hostRef, "data-e2e-test-id": dataE2eTestId, }: LayoutFloatProps) => React.ReactElement;
|
|
27
|
+
export declare const LayoutFloat: React.MemoExoticComponent<typeof LayoutFloatBase>;
|
|
28
|
+
export {};
|
|
@@ -10,7 +10,7 @@ export type LayoutFloatDragContextValue = {
|
|
|
10
10
|
/** Publish/clear the handlers - for the float. */
|
|
11
11
|
setHandlers: (handlers: LayoutFloatDragHandlers) => void;
|
|
12
12
|
};
|
|
13
|
-
export declare const LayoutFloatDragContext:
|
|
13
|
+
export declare const LayoutFloatDragContext: import("react").Context<LayoutFloatDragContextValue>;
|
|
14
14
|
/** Read the float-drag channel. Outside a `LayoutFloatDragProvider` the handlers are
|
|
15
15
|
* `null` and the setter a no-op, so consumers need no existence checks. */
|
|
16
16
|
export declare const useLayoutFloatDrag: () => LayoutFloatDragContextValue;
|
|
@@ -16,6 +16,6 @@ export type SandwichContextValue = SandwichEdges & {
|
|
|
16
16
|
/** Static host below the scroll body - `Sandwich.Footer` portals into it. */
|
|
17
17
|
footerSlotNode: HTMLElement | null;
|
|
18
18
|
};
|
|
19
|
-
export declare const SandwichProvider:
|
|
19
|
+
export declare const SandwichProvider: import("react").Provider<SandwichContextValue | null>;
|
|
20
20
|
/** Read the Sandwich context, or throw if used outside `<Sandwich>`. */
|
|
21
21
|
export declare function useSandwichContext(): SandwichContextValue;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
+
import type { ConditionalAccessibleName } from "../../types/a11y";
|
|
2
3
|
import type { PanelKey, SidePanelKey, SlotKey } from "./-constants";
|
|
3
4
|
import type { PanelHeaderTitle } from "../Internal/PanelHeader/PanelHeader";
|
|
4
5
|
import type { SandwichSeparator } from "../Internal/Sandwich/-types";
|
|
@@ -496,3 +497,11 @@ export type RightPanelProps = SidePanelProps & {
|
|
|
496
497
|
* floating panel isn't part of the resizable row. */
|
|
497
498
|
collapsible?: boolean;
|
|
498
499
|
};
|
|
500
|
+
export type LayoutBottomBarProps = ConditionalAccessibleName & {
|
|
501
|
+
/** Layout.BottomBarItem declarations for the page's actions. */
|
|
502
|
+
children: React.ReactNode;
|
|
503
|
+
/** Background of each section; gaps stay transparent. Defaults to transparent. */
|
|
504
|
+
background?: "primary" | "secondary" | "transparent";
|
|
505
|
+
/** Identifier applied to the action group. */
|
|
506
|
+
"data-e2e-test-id"?: string;
|
|
507
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FC, ReactNode } from "react";
|
|
2
|
-
import type { SlotKey } from "
|
|
2
|
+
import type { SlotKey } from "../../-types";
|
|
3
3
|
export type LayoutBottomBarFallback = "hide" | "remaining" | "full";
|
|
4
4
|
export type LayoutBottomBarItemProps = {
|
|
5
5
|
/** Layout region whose column the item follows. */
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import { type ReactElement
|
|
2
|
-
import type {
|
|
3
|
-
export type LayoutBottomBarProps = ConditionalAccessibleName & {
|
|
4
|
-
/** Layout.BottomBarItem declarations for the page's actions. */
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
/** Background of each section; gaps stay transparent. Defaults to transparent. */
|
|
7
|
-
background?: "primary" | "secondary" | "transparent";
|
|
8
|
-
/** Identifier applied to the action group. */
|
|
9
|
-
"data-e2e-test-id"?: string;
|
|
10
|
-
};
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import type { LayoutBottomBarProps } from "../-types";
|
|
11
3
|
export declare function LayoutBottomBar({ children, background, "data-e2e-test-id": dataE2eTestId, ...accessibleName }: LayoutBottomBarProps): ReactElement | null;
|
|
@@ -7,5 +7,5 @@ type StyledLayoutBottomBarProps = {
|
|
|
7
7
|
export declare const StyledLayoutBottomBar: import("@emotion/styled").StyledComponent<{
|
|
8
8
|
theme?: import("@emotion/react").Theme;
|
|
9
9
|
as?: React.ElementType;
|
|
10
|
-
} & StyledLayoutBottomBarProps,
|
|
10
|
+
} & StyledLayoutBottomBarProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
11
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayoutBottomBarProps } from "
|
|
1
|
+
import type { LayoutBottomBarProps } from "../-types";
|
|
2
2
|
type StyledLayoutBottomBarSectionProps = {
|
|
3
3
|
background: NonNullable<LayoutBottomBarProps["background"]>;
|
|
4
4
|
columnIndex?: number;
|
|
@@ -9,5 +9,5 @@ type StyledLayoutBottomBarSectionProps = {
|
|
|
9
9
|
export declare const StyledLayoutBottomBarSection: import("@emotion/styled").StyledComponent<{
|
|
10
10
|
theme?: import("@emotion/react").Theme;
|
|
11
11
|
as?: React.ElementType;
|
|
12
|
-
} & StyledLayoutBottomBarSectionProps,
|
|
12
|
+
} & StyledLayoutBottomBarSectionProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
13
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"StyledLayoutBottomBarSection",{enumerable:!0,get:function(){return StyledLayoutBottomBarSection}});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"StyledLayoutBottomBarSection",{enumerable:!0,get:function(){return StyledLayoutBottomBarSection}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_ispropvalid=/*#__PURE__*/_interop_require_default._(require("@emotion/is-prop-valid")),StyledLayoutBottomBarSection=(0,_styled.default)("div",{shouldForwardProp:prop=>"background"!==prop&&(0,_ispropvalid.default)(prop),target:"e1dq38by0",label:"StyledLayoutBottomBarSection"})(({theme,background,columnIndex,rowIndex,fullWidth,hasPanelDivider})=>({gridColumn:fullWidth?"1 / -1":(columnIndex??0)+1,gridRow:rowIndex+1,alignItems:"center",boxSizing:"border-box",backgroundColor:"transparent"===background?"transparent":theme.values.color.background[background].default,display:"flex",minWidth:0,whiteSpace:"nowrap",...hasPanelDivider&&{position:"relative","&::after":{content:'""',position:"absolute",top:0,bottom:0,right:0,width:1,backgroundColor:theme.values.color.border.secondary.default,pointerEvents:"none"}}}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { LayoutValue, SlotKey } from "../-types";
|
|
3
|
-
import { type LayoutBottomBarItemProps, type LayoutBottomBarFallback } from "./LayoutBottomBarItem";
|
|
3
|
+
import { type LayoutBottomBarItemProps, type LayoutBottomBarFallback } from "./BottomBarItem/LayoutBottomBarItem";
|
|
4
4
|
type BottomBarLayout = Pick<LayoutValue, SlotKey>;
|
|
5
5
|
type BottomBarItemMode = "column" | LayoutBottomBarFallback;
|
|
6
6
|
type VisibleSection = LayoutBottomBarItemProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"getBottomBarLayout",{enumerable:!0,get:function(){return getBottomBarLayout}});const _react=require("react"),_constants=require("../-constants"),_LayoutBottomBarItem=require("./LayoutBottomBarItem"),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)=>_react.Children.toArray(children).flatMap(child=>{if(!(0,_react.isValidElement)(child)||child.type!==_LayoutBottomBarItem.LayoutBottomBarItem||null==child.props.children||!1===child.props.children)return[];let{region,fallback="hide"}=child.props,placement=getBottomBarItemMode({region,fallback,layout});return"hide"===placement?[]:[{...child.props,placement,fallback}]}),shouldPreserveSplitColumnWidth=sections=>{let hasLeftFallback=sections.some(({region,fallback})=>"leftPanel"===region&&"remaining"===fallback),hasContentColumn=sections.some(({region,placement})=>"content"===region&&"column"===placement),hasSplitColumn=sections.some(({region,placement})=>"splitview"===region&&"column"===placement),hasRightFallback=sections.some(({region,fallback})=>"rightPanel"===region&&"remaining"===fallback);return hasLeftFallback&&hasContentColumn&&hasSplitColumn&&!hasRightFallback},getSharedRowCells=sections=>{if(!sections.length)return[];let firstSection=sections[0],lastSection=sections[sections.length-1],hasRemainingActions=sections.some(({fallback})=>"remaining"===fallback),preserveSplitColumn=shouldPreserveSplitColumnWidth(sections),flexibleColumns={leftPanel:!1,content:hasRemainingActions,splitview:hasRemainingActions&&!preserveSplitColumn,rightPanel:!1},hasFlexibleColumn=sections.some(({region,placement})=>"column"===placement&&flexibleColumns[region]),needsFlexibleGap=hasRemainingActions&&!hasFlexibleColumn,rightActions=sections.find(({region})=>"rightPanel"===region);return[..."column"===firstSection.placement?[{kind:"leading-gap",region:firstSection.region}]:[],...sections.flatMap((section,index)=>{let previousSection=sections[index-1];return[..."column"===section.placement&&previousSection?.placement==="column"?[{kind:"column-gap",region:section.region,previousRegion:previousSection.region}]:[],...needsFlexibleGap&§ion===rightActions?[{kind:"flexible-gap"}]:[],{kind:"section",section,flexible:flexibleColumns[section.region]}]}),...!hasRemainingActions||preserveSplitColumn?[{kind:"trailing-gap",region:lastSection.region}]:[],...needsFlexibleGap&&!rightActions?[{kind:"flexible-gap"}]:[]]},getBottomBarLayout=({children,layout})=>{let sections=getVisibleSections(children,layout),sharedSections=_constants.PANEL_ORDER.flatMap(region=>sections.filter(section=>section.region===region&&"full"!==section.placement)),fullWidthSections=sections.filter(({placement})=>"full"===placement),sharedRowCount=+!!sharedSections.length,cells=getSharedRowCells(sharedSections);return{cells,sections:[...cells.flatMap((cell,column)=>"section"===cell.kind?[{...cell.section,columnIndex:column,rowIndex:0}]:[]),...fullWidthSections.map((section,row)=>({...section,rowIndex:sharedRowCount+row}))],rowCount:sharedRowCount+fullWidthSections.length,hasRightPanel:sections.some(({region})=>"rightPanel"===region)}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"getBottomBarLayout",{enumerable:!0,get:function(){return getBottomBarLayout}});const _react=require("react"),_constants=require("../-constants"),_LayoutBottomBarItem=require("./BottomBarItem/LayoutBottomBarItem"),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)=>_react.Children.toArray(children).flatMap(child=>{if(!(0,_react.isValidElement)(child)||child.type!==_LayoutBottomBarItem.LayoutBottomBarItem||null==child.props.children||!1===child.props.children)return[];let{region,fallback="hide"}=child.props,placement=getBottomBarItemMode({region,fallback,layout});return"hide"===placement?[]:[{...child.props,placement,fallback}]}),shouldPreserveSplitColumnWidth=sections=>{let hasLeftFallback=sections.some(({region,fallback})=>"leftPanel"===region&&"remaining"===fallback),hasContentColumn=sections.some(({region,placement})=>"content"===region&&"column"===placement),hasSplitColumn=sections.some(({region,placement})=>"splitview"===region&&"column"===placement),hasRightFallback=sections.some(({region,fallback})=>"rightPanel"===region&&"remaining"===fallback);return hasLeftFallback&&hasContentColumn&&hasSplitColumn&&!hasRightFallback},getSharedRowCells=sections=>{if(!sections.length)return[];let firstSection=sections[0],lastSection=sections[sections.length-1],hasRemainingActions=sections.some(({fallback})=>"remaining"===fallback),preserveSplitColumn=shouldPreserveSplitColumnWidth(sections),flexibleColumns={leftPanel:!1,content:hasRemainingActions,splitview:hasRemainingActions&&!preserveSplitColumn,rightPanel:!1},hasFlexibleColumn=sections.some(({region,placement})=>"column"===placement&&flexibleColumns[region]),needsFlexibleGap=hasRemainingActions&&!hasFlexibleColumn,rightActions=sections.find(({region})=>"rightPanel"===region);return[..."column"===firstSection.placement?[{kind:"leading-gap",region:firstSection.region}]:[],...sections.flatMap((section,index)=>{let previousSection=sections[index-1];return[..."column"===section.placement&&previousSection?.placement==="column"?[{kind:"column-gap",region:section.region,previousRegion:previousSection.region}]:[],...needsFlexibleGap&§ion===rightActions?[{kind:"flexible-gap"}]:[],{kind:"section",section,flexible:flexibleColumns[section.region]}]}),...!hasRemainingActions||preserveSplitColumn?[{kind:"trailing-gap",region:lastSection.region}]:[],...needsFlexibleGap&&!rightActions?[{kind:"flexible-gap"}]:[]]},getBottomBarLayout=({children,layout})=>{let sections=getVisibleSections(children,layout),sharedSections=_constants.PANEL_ORDER.flatMap(region=>sections.filter(section=>section.region===region&&"full"!==section.placement)),fullWidthSections=sections.filter(({placement})=>"full"===placement),sharedRowCount=+!!sharedSections.length,cells=getSharedRowCells(sharedSections);return{cells,sections:[...cells.flatMap((cell,column)=>"section"===cell.kind?[{...cell.section,columnIndex:column,rowIndex:0}]:[]),...fullWidthSections.map((section,row)=>({...section,rowIndex:sharedRowCount+row}))],rowCount:sharedRowCount+fullWidthSections.length,hasRightPanel:sections.some(({region})=>"rightPanel"===region)}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { LayoutProvider } from "./LayoutProvider";
|
|
3
3
|
import { LayoutBottomBar } from "./BottomBar/LayoutBottomBar";
|
|
4
|
-
import { LayoutBottomBarItem } from "./BottomBar/LayoutBottomBarItem";
|
|
4
|
+
import { LayoutBottomBarItem } from "./BottomBar/BottomBarItem/LayoutBottomBarItem";
|
|
5
5
|
import { Content } from "./Content/Content";
|
|
6
6
|
import { RightPanel } from "./RightPanel/RightPanel";
|
|
7
7
|
import { RightPanelHeader } from "./RightPanel/RightPanelHeader";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get Layout(){return Layout},get PANEL_HOST_DS_ID(){return PANEL_HOST_DS_ID}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_Panel=require("../Internal/Panel/Panel"),_LayoutFloat=require("../Internal/LayoutFloat/LayoutFloat"),_useBreakpoints=require("../../shared/useBreakpoints"),_constants=require("./-constants"),_context=require("./context"),_useMobileSplitStack=require("./Split/MobileSplitView/useMobileSplitStack"),_useMobileSplitView=require("./Split/MobileSplitView/useMobileSplitView"),_LayoutProvider=require("./LayoutProvider"),_LayoutBottomBar=require("./BottomBar/LayoutBottomBar"),_LayoutBottomBarItem=require("./BottomBar/LayoutBottomBarItem"),_Content=require("./Content/Content"),_RightPanel=require("./RightPanel/RightPanel"),_RightPanelHeader=require("./RightPanel/RightPanelHeader"),_RightPanelFooter=require("./RightPanel/RightPanelFooter"),_LeftPanel=require("./LeftPanel/LeftPanel"),_LeftPanelHeader=require("./LeftPanel/LeftPanelHeader"),_LeftPanelFooter=require("./LeftPanel/LeftPanelFooter"),_LeftNavBar=require("./LeftNavBar/LeftNavBar"),_LeftNavBarFooter=require("./LeftNavBar/LeftNavBarFooter"),_Split=require("./Split/Split"),_SplitHeader=require("./Split/SplitHeader"),_SplitFooter=require("./Split/SplitFooter"),_registry=require("./registry"),_usePortalTargets=require("./usePortalTargets"),_LayoutFloatDragProvider=require("../Internal/LayoutFloat/LayoutFloatDragProvider"),_LayoutCssVars=require("./LayoutCssVars"),_useLayout=require("./useLayout"),_useLayoutRules=require("./useLayoutRules"),_rules=require("./rules"),resizableFromState=slotState=>"sidePanel"===slotState.kind?slotState.resizable:void 0,useGlobalCssVariables=({slotHosts,root,mobileHost})=>{let leftPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.leftPanel),contentWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.content),splitviewWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.splitview),rightPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.rightPanel),leftPanelStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.leftPanel),contentStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.content),splitviewStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.splitview),rightPanelStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.rightPanel),regionsReadyCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.LAYOUT_REGIONS_READY_VAR),publishRegions=(0,_react.useCallback)(()=>{if(!root)return;let targets=[[_constants.Slot.leftPanel,leftPanelWidthCssVar,leftPanelStartCssVar],[_constants.Slot.content,contentWidthCssVar,contentStartCssVar],[_constants.Slot.splitview,splitviewWidthCssVar,splitviewStartCssVar],[_constants.Slot.rightPanel,rightPanelWidthCssVar,rightPanelStartCssVar]],rootRect=root.getBoundingClientRect();targets.forEach(([slot,widthCssVar,startCssVar])=>{let rect=slotHosts[slot]?.getBoundingClientRect(),isMobileRegion=!!mobileHost&&(slot===_constants.Slot.content||slot===_constants.Slot.splitview),width=isMobileRegion?rootRect.width:rect?.width??0,start=isMobileRegion||!rect?0:rect.left-rootRect.left;widthCssVar.set(`${width}px`),startCssVar.set(`${start}px`)}),regionsReadyCssVar.set("1")},[slotHosts,root,mobileHost,leftPanelWidthCssVar,contentWidthCssVar,splitviewWidthCssVar,rightPanelWidthCssVar,leftPanelStartCssVar,contentStartCssVar,splitviewStartCssVar,rightPanelStartCssVar,regionsReadyCssVar]);(0,_react.useLayoutEffect)(()=>{publishRegions()},[publishRegions]),(0,_react.useLayoutEffect)(()=>{if(!root||"undefined"==typeof ResizeObserver)return;let observer=new ResizeObserver(publishRegions);return observer.observe(root),Object.values(slotHosts).forEach(host=>{host&&observer.observe(host)}),()=>observer.disconnect()},[root,slotHosts,publishRegions])},StyledLayout=(0,_styled.default)("div",{target:"e1kh2kot0",label:"StyledLayout"})({position:"relative",height:"100%",width:"100%"}),StyledPanelRow=(0,_styled.default)("div",{target:"e1kh2kot1",label:"StyledPanelRow"})(({theme,hasOffcanvasLeftBar})=>({height:"100%",boxSizing:"border-box",...hasOffcanvasLeftBar&&{paddingLeft:theme.variables.size.dimension.leftNavBar.width}})),StyledPanelHost=(0,_styled.default)("div",{target:"e1kh2kot2",label:"StyledPanelHost"})({position:"relative",height:"100%",width:"100%"}),PANEL_HOST_DS_ID="PanelHost",StyledContentColumn=(0,_styled.default)("div",{shouldForwardProp:prop=>"isSplitOpen"!==prop,target:"e1kh2kot3",label:"StyledContentColumn"})(({isSplitOpen,theme})=>({display:"flex",height:`calc(100% - ${_constants.PAGE_BOTTOM_BAR_INSET})`,width:"100%",...isSplitOpen&&{maxWidth:theme.variables.layout.split.maxWidth.default,marginInline:"auto",gap:theme.variables.size.spacing.xxs}})),StyledContentColumnHalf=(0,_styled.default)("div",{target:"e1kh2kot4",label:"StyledContentColumnHalf"})({position:"relative",height:"100%",flex:"1 1 0",minWidth:0}),StyledMobileSplitStackHost=(0,_styled.default)("div",{target:"e1kh2kot5",label:"StyledMobileSplitStackHost"})({position:"absolute",top:0,left:0,right:0,bottom:_constants.PAGE_BOTTOM_BAR_INSET,overflow:"hidden",pointerEvents:"none"}),isPanelPresent=({slot,declared,present,isShown})=>!!(declared[slot]&&(isShown(slot)||present[slot])),defaultSizeFor=({slot,panel,panelState})=>slot===_constants.Slot.content?void 0:panel?.defaultSize!==void 0?panel.defaultSize:panel?.resizable!==!1?panelState.size:void 0,childFor=(slot,contentColumn,slotHostRefs)=>slot===_constants.Slot.content?contentColumn:_react.default.createElement(StyledPanelHost,{"data-ds-id":PANEL_HOST_DS_ID,ref:slotHostRefs[slot]}),Layout=function({children,persistenceKey,storage,rules=_rules.DEFAULT_LAYOUT_RULES,additionalRulesData}){let[declared,setDeclared]=(0,_react.useState)({}),layout=(0,_useLayout.useLayout)(),{state:layoutState,...panelCallbacks}=layout;(0,_useLayoutRules.useLayoutRules)({layout,declared,rules,additionalData:additionalRulesData});let{dispatch}=(0,_context.useLayoutStore)(),persistence=(0,_context.useLayoutPersistence)(),resolvedKey=persistenceKey??persistence.persistenceKey,resolvedStorage=storage??persistence.storage,{isMobile}=(0,_useBreakpoints.useBreakpoints)(),showMobileSplitStack=(0,_useMobileSplitView.useMobileSplitViewEnabled)(),[mobileSplitStackHost,setMobileSplitStackHost]=(0,_react.useState)(null),[splitCount,setSplitCount]=(0,_react.useState)(0),registerSplit=(0,_react.useCallback)(()=>(setSplitCount(count=>count+1),()=>setSplitCount(count=>count-1)),[]),mobileSplitStack=(0,_react.useMemo)(()=>({host:mobileSplitStackHost,isSplitPresent:splitCount>0,registerSplit}),[mobileSplitStackHost,splitCount,registerSplit]),rightPanelVariant=layoutState[_constants.Slot.rightPanel].variant??declared[_constants.Slot.rightPanel]?.variant??"sidebar",isRightPanelFloating=!isMobile&&"float"===rightPanelVariant,hasOffcanvasLeftBar=!!declared[_constants.Slot.leftPanel]&&"offcanvas"===layoutState[_constants.Slot.leftPanel].variant,isShown=slot=>layoutState[slot].visible&&!(slot===_constants.Slot.rightPanel&&(isRightPanelFloating||isMobile))&&(slot!==_constants.Slot.leftPanel||"sidebar"===layoutState.leftPanel.variant),[present,setPresent]=(0,_react.useState)({}),presence=(0,_react.useMemo)(()=>({setPresent:(slot,isPresent)=>setPresent(prev=>prev[slot]===isPresent?prev:{...prev,[slot]:isPresent})}),[]),panelHandles=(0,_react.useRef)({}),panelElements=(0,_react.useRef)({}),resizeSuppressed=(0,_react.useRef)({}),animationControl=(0,_react.useMemo)(()=>({setHandle:(slot,handle)=>{panelHandles.current[slot]=handle},getHandle:slot=>panelHandles.current[slot]??null,setElement:(slot,element)=>{panelElements.current[slot]=element},getElement:slot=>panelElements.current[slot]??null,setResizeSuppressed:(slot,suppressed)=>{resizeSuppressed.current[slot]=suppressed}}),[]),panelRefCallbacks=(0,_react.useMemo)(()=>{let handleCallbacks=new Map,elementCallbacks=new Map;return{handleFor:id=>{let callback=handleCallbacks.get(id);return callback||(callback=handle=>animationControl.setHandle(id,handle),handleCallbacks.set(id,callback)),callback},elementFor:id=>{let callback=elementCallbacks.get(id);return callback||(callback=element=>animationControl.setElement(id,element),elementCallbacks.set(id,callback)),callback}}},[animationControl]),shouldSuppressLayoutCallback=(0,_react.useCallback)(()=>Object.values(resizeSuppressed.current).some(Boolean),[]),registry=(0,_react.useMemo)(()=>({register:(slot,reg)=>setDeclared(prev=>({...prev,[slot]:reg})),unregister:slot=>setDeclared(prev=>{if(!(slot in prev))return prev;let next={...prev};return delete next[slot],next})}),[]),{portalTargets,slotHosts,slotHostRefs,floatHostRef}=(0,_usePortalTargets.usePortalTargets)({slots:_constants.PANEL_ORDER,floatableSlot:_constants.Slot.rightPanel,isFloating:isRightPanelFloating}),[layoutRoot,setLayoutRoot]=(0,_react.useState)(null),rootPortalTargets=(0,_react.useMemo)(()=>({...portalTargets,root:layoutRoot}),[portalTargets,layoutRoot]);useGlobalCssVariables({slotHosts,root:layoutRoot,mobileHost:mobileSplitStackHost});let rowSlots=_constants.PANEL_ORDER.filter(slot=>slot!==_constants.Slot.splitview),declaredSlots=rowSlots.filter(slot=>declared[slot]),isSolo=declaredSlots.length<=1,soloSlot=declaredSlots[0],isSplitOpen=isPanelPresent({slot:_constants.Slot.splitview,declared,present,isShown})&&isPanelPresent({slot:_constants.Slot.content,declared,present,isShown}),contentColumn=_react.default.createElement(StyledContentColumn,{isSplitOpen:isSplitOpen},_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.content]}),isSplitOpen&&_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.splitview]})),panelItems=rowSlots.filter(slot=>isPanelPresent({slot,declared,present,isShown})).map(slot=>{let panel=declared[slot],panelState=layoutState[slot];return{id:slot,gapBefore:slot===_constants.Slot.rightPanel,child:childFor(slot,contentColumn,slotHostRefs),defaultSize:defaultSizeFor({slot,panel,panelState}),minSize:panel?.minSize,maxSize:panel?.maxSize,collapsible:slot!==_constants.Slot.content&&(panel?.collapsible??!0),lockWidthOnWindowResize:panel?.lockWidthOnWindowResize,resizable:panel?.resizable??resizableFromState(panelState)}}),rowKey=panelItems.map(item=>item.id).join(","),soloHost=soloSlot&&isShown(soloSlot)?childFor(soloSlot,contentColumn,slotHostRefs):null,panelGroup=panelItems.length>0?_react.default.createElement(_Panel.Panel,{key:resolvedKey,panels:panelItems,persistenceKey:resolvedKey,storage:resolvedStorage,onResize:(id,size)=>{isShown(id)&&declared[id]?.resizable!==!1&&dispatch({type:"resize",slot:id,size:declared[id]?.lockWidthOnWindowResize?Math.round(size.inPixels):`${size.asPercentage}%`})},onCollapse:id=>panelCallbacks[id].hide(),panelHandleFor:panelRefCallbacks.handleFor,panelElementFor:panelRefCallbacks.elementFor,shouldSuppressLayoutCallback:shouldSuppressLayoutCallback}):null;return _react.default.createElement(_registry.PanelRegistryContext.Provider,{value:registry},_react.default.createElement(_registry.PanelDeclarationsContext.Provider,{value:declared},_react.default.createElement(_registry.PanelPresenceContext.Provider,{value:presence},_react.default.createElement(_registry.PanelAnimationContext.Provider,{value:animationControl},_react.default.createElement(_registry.PanelRowContext.Provider,{value:rowKey},_react.default.createElement(_registry.LayoutPortalContext.Provider,{value:rootPortalTargets},_react.default.createElement(_LayoutFloatDragProvider.LayoutFloatDragProvider,null,_react.default.createElement(_useMobileSplitStack.MobileSplitStackContext.Provider,{value:mobileSplitStack},_react.default.createElement(StyledLayout,{ref:setLayoutRoot,"data-ds-id":"Layout"},_react.default.createElement(StyledPanelRow,{hasOffcanvasLeftBar:hasOffcanvasLeftBar},isSolo?soloHost:panelGroup),isRightPanelFloating&&layoutState[_constants.Slot.rightPanel].visible&&_react.default.createElement(_LayoutFloat.LayoutFloat,{hostRef:floatHostRef}),children,showMobileSplitStack&&_react.default.createElement(StyledMobileSplitStackHost,{ref:setMobileSplitStackHost}))))))))))};Layout.Provider=_LayoutProvider.LayoutProvider,Layout.BottomBar=_LayoutBottomBar.LayoutBottomBar,Layout.BottomBarItem=_LayoutBottomBarItem.LayoutBottomBarItem,Layout.LeftPanel=_LeftPanel.LeftPanel,Layout.LeftNavBar=_LeftNavBar.LeftNavBar,Layout.LeftNavBarFooter=_LeftNavBarFooter.LeftNavBarFooter,Layout.LeftPanelHeader=_LeftPanelHeader.LeftPanelHeader,Layout.LeftPanelFooter=_LeftPanelFooter.LeftPanelFooter,Layout.RightPanel=_RightPanel.RightPanel,Layout.RightPanelHeader=_RightPanelHeader.RightPanelHeader,Layout.RightPanelFooter=_RightPanelFooter.RightPanelFooter,Layout.Content=_Content.Content,Layout.Split=_Split.Split,Layout.SplitHeader=_SplitHeader.SplitHeader,Layout.SplitFooter=_SplitFooter.SplitFooter;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get Layout(){return Layout},get PANEL_HOST_DS_ID(){return PANEL_HOST_DS_ID}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_Panel=require("../Internal/Panel/Panel"),_LayoutFloat=require("../Internal/LayoutFloat/LayoutFloat"),_useBreakpoints=require("../../shared/useBreakpoints"),_constants=require("./-constants"),_context=require("./context"),_useMobileSplitStack=require("./Split/MobileSplitView/useMobileSplitStack"),_useMobileSplitView=require("./Split/MobileSplitView/useMobileSplitView"),_LayoutProvider=require("./LayoutProvider"),_LayoutBottomBar=require("./BottomBar/LayoutBottomBar"),_LayoutBottomBarItem=require("./BottomBar/BottomBarItem/LayoutBottomBarItem"),_Content=require("./Content/Content"),_RightPanel=require("./RightPanel/RightPanel"),_RightPanelHeader=require("./RightPanel/RightPanelHeader"),_RightPanelFooter=require("./RightPanel/RightPanelFooter"),_LeftPanel=require("./LeftPanel/LeftPanel"),_LeftPanelHeader=require("./LeftPanel/LeftPanelHeader"),_LeftPanelFooter=require("./LeftPanel/LeftPanelFooter"),_LeftNavBar=require("./LeftNavBar/LeftNavBar"),_LeftNavBarFooter=require("./LeftNavBar/LeftNavBarFooter"),_Split=require("./Split/Split"),_SplitHeader=require("./Split/SplitHeader"),_SplitFooter=require("./Split/SplitFooter"),_registry=require("./registry"),_usePortalTargets=require("./usePortalTargets"),_LayoutFloatDragProvider=require("../Internal/LayoutFloat/LayoutFloatDragProvider"),_LayoutCssVars=require("./LayoutCssVars"),_useLayout=require("./useLayout"),_useLayoutRules=require("./useLayoutRules"),_rules=require("./rules"),resizableFromState=slotState=>"sidePanel"===slotState.kind?slotState.resizable:void 0,useGlobalCssVariables=({slotHosts,root,mobileHost})=>{let leftPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.leftPanel),contentWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.content),splitviewWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.splitview),rightPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.rightPanel),leftPanelStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.leftPanel),contentStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.content),splitviewStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.splitview),rightPanelStartCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_START_VAR.rightPanel),regionsReadyCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.LAYOUT_REGIONS_READY_VAR),publishRegions=(0,_react.useCallback)(()=>{if(!root)return;let targets=[[_constants.Slot.leftPanel,leftPanelWidthCssVar,leftPanelStartCssVar],[_constants.Slot.content,contentWidthCssVar,contentStartCssVar],[_constants.Slot.splitview,splitviewWidthCssVar,splitviewStartCssVar],[_constants.Slot.rightPanel,rightPanelWidthCssVar,rightPanelStartCssVar]],rootRect=root.getBoundingClientRect();targets.forEach(([slot,widthCssVar,startCssVar])=>{let rect=slotHosts[slot]?.getBoundingClientRect(),isMobileRegion=!!mobileHost&&(slot===_constants.Slot.content||slot===_constants.Slot.splitview),width=isMobileRegion?rootRect.width:rect?.width??0,start=isMobileRegion||!rect?0:rect.left-rootRect.left;widthCssVar.set(`${width}px`),startCssVar.set(`${start}px`)}),regionsReadyCssVar.set("1")},[slotHosts,root,mobileHost,leftPanelWidthCssVar,contentWidthCssVar,splitviewWidthCssVar,rightPanelWidthCssVar,leftPanelStartCssVar,contentStartCssVar,splitviewStartCssVar,rightPanelStartCssVar,regionsReadyCssVar]);(0,_react.useLayoutEffect)(()=>{publishRegions()},[publishRegions]),(0,_react.useLayoutEffect)(()=>{if(!root||"undefined"==typeof ResizeObserver)return;let observer=new ResizeObserver(publishRegions);return observer.observe(root),Object.values(slotHosts).forEach(host=>{host&&observer.observe(host)}),()=>observer.disconnect()},[root,slotHosts,publishRegions])},StyledLayout=(0,_styled.default)("div",{target:"e1tobjas0",label:"StyledLayout"})({position:"relative",height:"100%",width:"100%"}),StyledPanelRow=(0,_styled.default)("div",{target:"e1tobjas1",label:"StyledPanelRow"})(({theme,hasOffcanvasLeftBar})=>({height:"100%",boxSizing:"border-box",...hasOffcanvasLeftBar&&{paddingLeft:theme.variables.size.dimension.leftNavBar.width}})),StyledPanelHost=(0,_styled.default)("div",{target:"e1tobjas2",label:"StyledPanelHost"})({position:"relative",height:"100%",width:"100%"}),PANEL_HOST_DS_ID="PanelHost",StyledContentColumn=(0,_styled.default)("div",{shouldForwardProp:prop=>"isSplitOpen"!==prop,target:"e1tobjas3",label:"StyledContentColumn"})(({isSplitOpen,theme})=>({display:"flex",height:`calc(100% - ${_constants.PAGE_BOTTOM_BAR_INSET})`,width:"100%",...isSplitOpen&&{maxWidth:theme.variables.layout.split.maxWidth.default,marginInline:"auto",gap:theme.variables.size.spacing.xxs}})),StyledContentColumnHalf=(0,_styled.default)("div",{target:"e1tobjas4",label:"StyledContentColumnHalf"})({position:"relative",height:"100%",flex:"1 1 0",minWidth:0}),StyledMobileSplitStackHost=(0,_styled.default)("div",{target:"e1tobjas5",label:"StyledMobileSplitStackHost"})({position:"absolute",top:0,left:0,right:0,bottom:_constants.PAGE_BOTTOM_BAR_INSET,overflow:"hidden",pointerEvents:"none"}),isPanelPresent=({slot,declared,present,isShown})=>!!(declared[slot]&&(isShown(slot)||present[slot])),defaultSizeFor=({slot,panel,panelState})=>slot===_constants.Slot.content?void 0:panel?.defaultSize!==void 0?panel.defaultSize:panel?.resizable!==!1?panelState.size:void 0,childFor=(slot,contentColumn,slotHostRefs)=>slot===_constants.Slot.content?contentColumn:_react.default.createElement(StyledPanelHost,{"data-ds-id":PANEL_HOST_DS_ID,ref:slotHostRefs[slot]}),Layout=function({children,persistenceKey,storage,rules=_rules.DEFAULT_LAYOUT_RULES,additionalRulesData}){let[declared,setDeclared]=(0,_react.useState)({}),layout=(0,_useLayout.useLayout)(),{state:layoutState,...panelCallbacks}=layout;(0,_useLayoutRules.useLayoutRules)({layout,declared,rules,additionalData:additionalRulesData});let{dispatch}=(0,_context.useLayoutStore)(),persistence=(0,_context.useLayoutPersistence)(),resolvedKey=persistenceKey??persistence.persistenceKey,resolvedStorage=storage??persistence.storage,{isMobile}=(0,_useBreakpoints.useBreakpoints)(),showMobileSplitStack=(0,_useMobileSplitView.useMobileSplitViewEnabled)(),[mobileSplitStackHost,setMobileSplitStackHost]=(0,_react.useState)(null),[splitCount,setSplitCount]=(0,_react.useState)(0),registerSplit=(0,_react.useCallback)(()=>(setSplitCount(count=>count+1),()=>setSplitCount(count=>count-1)),[]),mobileSplitStack=(0,_react.useMemo)(()=>({host:mobileSplitStackHost,isSplitPresent:splitCount>0,registerSplit}),[mobileSplitStackHost,splitCount,registerSplit]),rightPanelVariant=layoutState[_constants.Slot.rightPanel].variant??declared[_constants.Slot.rightPanel]?.variant??"sidebar",isRightPanelFloating=!isMobile&&"float"===rightPanelVariant,hasOffcanvasLeftBar=!!declared[_constants.Slot.leftPanel]&&"offcanvas"===layoutState[_constants.Slot.leftPanel].variant,isShown=slot=>layoutState[slot].visible&&!(slot===_constants.Slot.rightPanel&&(isRightPanelFloating||isMobile))&&(slot!==_constants.Slot.leftPanel||"sidebar"===layoutState.leftPanel.variant),[present,setPresent]=(0,_react.useState)({}),presence=(0,_react.useMemo)(()=>({setPresent:(slot,isPresent)=>setPresent(prev=>prev[slot]===isPresent?prev:{...prev,[slot]:isPresent})}),[]),panelHandles=(0,_react.useRef)({}),panelElements=(0,_react.useRef)({}),resizeSuppressed=(0,_react.useRef)({}),animationControl=(0,_react.useMemo)(()=>({setHandle:(slot,handle)=>{panelHandles.current[slot]=handle},getHandle:slot=>panelHandles.current[slot]??null,setElement:(slot,element)=>{panelElements.current[slot]=element},getElement:slot=>panelElements.current[slot]??null,setResizeSuppressed:(slot,suppressed)=>{resizeSuppressed.current[slot]=suppressed}}),[]),panelRefCallbacks=(0,_react.useMemo)(()=>{let handleCallbacks=new Map,elementCallbacks=new Map;return{handleFor:id=>{let callback=handleCallbacks.get(id);return callback||(callback=handle=>animationControl.setHandle(id,handle),handleCallbacks.set(id,callback)),callback},elementFor:id=>{let callback=elementCallbacks.get(id);return callback||(callback=element=>animationControl.setElement(id,element),elementCallbacks.set(id,callback)),callback}}},[animationControl]),shouldSuppressLayoutCallback=(0,_react.useCallback)(()=>Object.values(resizeSuppressed.current).some(Boolean),[]),registry=(0,_react.useMemo)(()=>({register:(slot,reg)=>setDeclared(prev=>({...prev,[slot]:reg})),unregister:slot=>setDeclared(prev=>{if(!(slot in prev))return prev;let next={...prev};return delete next[slot],next})}),[]),{portalTargets,slotHosts,slotHostRefs,floatHostRef}=(0,_usePortalTargets.usePortalTargets)({slots:_constants.PANEL_ORDER,floatableSlot:_constants.Slot.rightPanel,isFloating:isRightPanelFloating}),[layoutRoot,setLayoutRoot]=(0,_react.useState)(null),rootPortalTargets=(0,_react.useMemo)(()=>({...portalTargets,root:layoutRoot}),[portalTargets,layoutRoot]);useGlobalCssVariables({slotHosts,root:layoutRoot,mobileHost:mobileSplitStackHost});let rowSlots=_constants.PANEL_ORDER.filter(slot=>slot!==_constants.Slot.splitview),declaredSlots=rowSlots.filter(slot=>declared[slot]),isSolo=declaredSlots.length<=1,soloSlot=declaredSlots[0],isSplitOpen=isPanelPresent({slot:_constants.Slot.splitview,declared,present,isShown})&&isPanelPresent({slot:_constants.Slot.content,declared,present,isShown}),contentColumn=_react.default.createElement(StyledContentColumn,{isSplitOpen:isSplitOpen},_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.content]}),isSplitOpen&&_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.splitview]})),panelItems=rowSlots.filter(slot=>isPanelPresent({slot,declared,present,isShown})).map(slot=>{let panel=declared[slot],panelState=layoutState[slot];return{id:slot,gapBefore:slot===_constants.Slot.rightPanel,child:childFor(slot,contentColumn,slotHostRefs),defaultSize:defaultSizeFor({slot,panel,panelState}),minSize:panel?.minSize,maxSize:panel?.maxSize,collapsible:slot!==_constants.Slot.content&&(panel?.collapsible??!0),lockWidthOnWindowResize:panel?.lockWidthOnWindowResize,resizable:panel?.resizable??resizableFromState(panelState)}}),rowKey=panelItems.map(item=>item.id).join(","),soloHost=soloSlot&&isShown(soloSlot)?childFor(soloSlot,contentColumn,slotHostRefs):null,panelGroup=panelItems.length>0?_react.default.createElement(_Panel.Panel,{key:resolvedKey,panels:panelItems,persistenceKey:resolvedKey,storage:resolvedStorage,onResize:(id,size)=>{isShown(id)&&declared[id]?.resizable!==!1&&dispatch({type:"resize",slot:id,size:declared[id]?.lockWidthOnWindowResize?Math.round(size.inPixels):`${size.asPercentage}%`})},onCollapse:id=>panelCallbacks[id].hide(),panelHandleFor:panelRefCallbacks.handleFor,panelElementFor:panelRefCallbacks.elementFor,shouldSuppressLayoutCallback:shouldSuppressLayoutCallback}):null;return _react.default.createElement(_registry.PanelRegistryContext.Provider,{value:registry},_react.default.createElement(_registry.PanelDeclarationsContext.Provider,{value:declared},_react.default.createElement(_registry.PanelPresenceContext.Provider,{value:presence},_react.default.createElement(_registry.PanelAnimationContext.Provider,{value:animationControl},_react.default.createElement(_registry.PanelRowContext.Provider,{value:rowKey},_react.default.createElement(_registry.LayoutPortalContext.Provider,{value:rootPortalTargets},_react.default.createElement(_LayoutFloatDragProvider.LayoutFloatDragProvider,null,_react.default.createElement(_useMobileSplitStack.MobileSplitStackContext.Provider,{value:mobileSplitStack},_react.default.createElement(StyledLayout,{ref:setLayoutRoot,"data-ds-id":"Layout"},_react.default.createElement(StyledPanelRow,{hasOffcanvasLeftBar:hasOffcanvasLeftBar},isSolo?soloHost:panelGroup),isRightPanelFloating&&layoutState[_constants.Slot.rightPanel].visible&&_react.default.createElement(_LayoutFloat.LayoutFloat,{hostRef:floatHostRef}),children,showMobileSplitStack&&_react.default.createElement(StyledMobileSplitStackHost,{ref:setMobileSplitStackHost}))))))))))};Layout.Provider=_LayoutProvider.LayoutProvider,Layout.BottomBar=_LayoutBottomBar.LayoutBottomBar,Layout.BottomBarItem=_LayoutBottomBarItem.LayoutBottomBarItem,Layout.LeftPanel=_LeftPanel.LeftPanel,Layout.LeftNavBar=_LeftNavBar.LeftNavBar,Layout.LeftNavBarFooter=_LeftNavBarFooter.LeftNavBarFooter,Layout.LeftPanelHeader=_LeftPanelHeader.LeftPanelHeader,Layout.LeftPanelFooter=_LeftPanelFooter.LeftPanelFooter,Layout.RightPanel=_RightPanel.RightPanel,Layout.RightPanelHeader=_RightPanelHeader.RightPanelHeader,Layout.RightPanelFooter=_RightPanelFooter.RightPanelFooter,Layout.Content=_Content.Content,Layout.Split=_Split.Split,Layout.SplitHeader=_SplitHeader.SplitHeader,Layout.SplitFooter=_SplitFooter.SplitFooter;
|
|
@@ -6,6 +6,6 @@ export type LeftBarSlot = {
|
|
|
6
6
|
* content alone. */
|
|
7
7
|
slotNode: HTMLElement | null;
|
|
8
8
|
};
|
|
9
|
-
export declare const LeftBarProvider:
|
|
9
|
+
export declare const LeftBarProvider: import("react").Provider<LeftBarSlot>;
|
|
10
10
|
/** The left bar slot behind the left panel, if this presentation has one. */
|
|
11
11
|
export declare const useLeftBarContext: () => LeftBarSlot;
|
|
@@ -6,6 +6,6 @@ export type LeftPanelCollapseState = {
|
|
|
6
6
|
* at the column's edge so nothing inside reflows on the way down. */
|
|
7
7
|
fixedContentWidth?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const LeftPanelCollapseProvider:
|
|
9
|
+
export declare const LeftPanelCollapseProvider: import("react").Provider<LeftPanelCollapseState>;
|
|
10
10
|
/** How the left panel's parts have to behave while its column narrows. */
|
|
11
11
|
export declare const useLeftPanelCollapseContext: () => LeftPanelCollapseState;
|
|
@@ -18,5 +18,5 @@ export declare const StyledMobileSplitSlideLayer: import("@emotion/styled").Styl
|
|
|
18
18
|
} & {
|
|
19
19
|
offset: MobileSplitViewOffset;
|
|
20
20
|
layer: MobileSplitLayer;
|
|
21
|
-
},
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
22
|
export {};
|