@amboss/design-system 4.9.4 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/Panel/Panel.d.ts +5 -3
- package/build/cjs/components/Internal/Panel/Panel.js +1 -1
- package/build/cjs/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
- package/build/cjs/components/Internal/PanelHeader/PanelHeader.js +1 -1
- package/build/cjs/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
- package/build/cjs/components/Layout/-constants.d.ts +10 -0
- package/build/cjs/components/Layout/-constants.js +1 -1
- package/build/cjs/components/Layout/-types.d.ts +35 -11
- package/build/cjs/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.d.ts +18 -0
- package/build/cjs/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.js +1 -0
- package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.d.ts +3 -0
- package/build/cjs/components/Layout/BottomBar/LayoutBottomBar.js +1 -0
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +11 -0
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBar.js +1 -0
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +13 -0
- package/build/cjs/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -0
- package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.d.ts +42 -0
- package/build/cjs/components/Layout/BottomBar/getBottomBarLayout.js +1 -0
- package/build/cjs/components/Layout/Layout.d.ts +4 -0
- package/build/cjs/components/Layout/Layout.js +1 -1
- package/build/cjs/components/Layout/LayoutCssVars.d.ts +1 -1
- package/build/cjs/components/Layout/LayoutCssVars.js +1 -1
- package/build/cjs/components/Layout/LayoutPortal.d.ts +7 -0
- package/build/cjs/components/Layout/LayoutPortal.js +1 -0
- package/build/cjs/components/Layout/LayoutProvider.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +3 -4
- package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.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/PanelContainer.d.ts +1 -1
- package/build/cjs/components/Layout/PanelContainer.js +1 -1
- package/build/cjs/components/Layout/RightPanel/RightPanel.js +1 -1
- package/build/cjs/components/Layout/Split/MobileSplitView/MobileSplitView.js +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/Split/Split.js +1 -1
- package/build/cjs/components/Layout/Split/SplitDocked.js +1 -1
- package/build/cjs/components/Layout/context.d.ts +2 -2
- package/build/cjs/components/Layout/cssVarStore.d.ts +10 -3
- package/build/cjs/components/Layout/cssVarStore.js +1 -1
- package/build/cjs/components/Layout/registry.d.ts +13 -9
- package/build/cjs/components/Layout/useLayout.js +1 -1
- package/build/cjs/components/Layout/useLeftPanelId.d.ts +1 -1
- package/build/cjs/components/Layout/usePanelAnimations.d.ts +12 -0
- package/build/cjs/components/Layout/usePanelAnimations.js +1 -0
- package/build/cjs/components/Layout/usePanelDockedSlide.js +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/shared/components/SelectableButton.d.ts +1 -1
- package/build/cjs/shared/useExitAnimation.js +1 -0
- package/build/cjs/web-tokens/layout-vars.d.ts +7 -0
- package/build/cjs/web-tokens/layout-vars.js +1 -1
- package/build/cjs/web-tokens/layout-vars.ts +7 -0
- package/build/cjs/web-tokens/visualConfig.d.ts +39 -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/Panel/Panel.d.ts +5 -3
- package/build/esm/components/Internal/Panel/Panel.js +1 -1
- package/build/esm/components/Internal/PanelHeader/PanelHeader.d.ts +1 -1
- package/build/esm/components/Internal/PanelHeader/PanelHeader.js +1 -1
- package/build/esm/components/Internal/Sandwich/useSandwichContext.d.ts +1 -1
- package/build/esm/components/Layout/-constants.d.ts +10 -0
- package/build/esm/components/Layout/-constants.js +1 -1
- package/build/esm/components/Layout/-types.d.ts +35 -11
- package/build/esm/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.d.ts +18 -0
- package/build/esm/components/Layout/BottomBar/BottomBarItem/LayoutBottomBarItem.js +1 -0
- package/build/esm/components/Layout/BottomBar/LayoutBottomBar.d.ts +3 -0
- package/build/esm/components/Layout/BottomBar/LayoutBottomBar.js +1 -0
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.d.ts +11 -0
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBar.js +1 -0
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.d.ts +13 -0
- package/build/esm/components/Layout/BottomBar/StyledLayoutBottomBarSection.js +1 -0
- package/build/esm/components/Layout/BottomBar/getBottomBarLayout.d.ts +42 -0
- package/build/esm/components/Layout/BottomBar/getBottomBarLayout.js +1 -0
- package/build/esm/components/Layout/Layout.d.ts +4 -0
- package/build/esm/components/Layout/Layout.js +1 -1
- package/build/esm/components/Layout/LayoutCssVars.d.ts +1 -1
- package/build/esm/components/Layout/LayoutCssVars.js +1 -1
- package/build/esm/components/Layout/LayoutPortal.d.ts +7 -0
- package/build/esm/components/Layout/LayoutPortal.js +1 -0
- package/build/esm/components/Layout/LayoutProvider.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.d.ts +3 -4
- package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.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/PanelContainer.d.ts +1 -1
- package/build/esm/components/Layout/PanelContainer.js +1 -1
- package/build/esm/components/Layout/RightPanel/RightPanel.js +1 -1
- package/build/esm/components/Layout/Split/MobileSplitView/MobileSplitView.js +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/Split/Split.js +1 -1
- package/build/esm/components/Layout/Split/SplitDocked.js +1 -1
- package/build/esm/components/Layout/context.d.ts +2 -2
- package/build/esm/components/Layout/cssVarStore.d.ts +10 -3
- package/build/esm/components/Layout/cssVarStore.js +1 -1
- package/build/esm/components/Layout/registry.d.ts +13 -9
- package/build/esm/components/Layout/useLayout.js +1 -1
- package/build/esm/components/Layout/useLeftPanelId.d.ts +1 -1
- package/build/esm/components/Layout/usePanelAnimations.d.ts +12 -0
- package/build/esm/components/Layout/usePanelAnimations.js +1 -0
- package/build/esm/components/Layout/usePanelDockedSlide.js +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/shared/components/SelectableButton.d.ts +1 -1
- package/build/esm/shared/useExitAnimation.js +1 -0
- package/build/esm/web-tokens/layout-vars.d.ts +7 -0
- package/build/esm/web-tokens/layout-vars.js +1 -1
- package/build/esm/web-tokens/layout-vars.ts +7 -0
- package/build/esm/web-tokens/visualConfig.d.ts +39 -0
- package/build/esm/web-tokens/visualConfig.js +1 -1
- package/build/scss/_layout.scss +14 -0
- 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/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
- /package/build/esm/{components/Internal/Drawer → shared}/useExitAnimation.d.ts +0 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { NavBarSubMenuContainer } from "./NavBarSubMenuContainer";
|
|
3
|
+
import { NavBarDropdownTriggerButton } from "./NavBarDropdownTriggerButton";
|
|
4
|
+
import { NavBarSearchInput } from "./NavBarSearchInput";
|
|
2
5
|
import { NavBarOverlayBar } from "./NavBarOverlayBar";
|
|
6
|
+
import { PrimaryNavContainer, PrimaryNav } from "./NavBarPrimaryNav";
|
|
7
|
+
import { PrimaryNavLinkItem } from "./NavBarPrimaryNavLinkItem";
|
|
8
|
+
import { SecondaryNav } from "./NavBarSecondaryNav";
|
|
3
9
|
import { NavBarName } from "./types";
|
|
4
10
|
type NavBarProps = React.PropsWithChildren<{
|
|
5
11
|
subTheme: NavBarName;
|
|
@@ -7,23 +13,13 @@ type NavBarProps = React.PropsWithChildren<{
|
|
|
7
13
|
}>;
|
|
8
14
|
export declare function NavBar({ children, subTheme, isCompact, }: NavBarProps): React.ReactElement;
|
|
9
15
|
export declare namespace NavBar {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var SubMenuContainer: React.ForwardRefExoticComponent<{
|
|
19
|
-
"data-e2e-test-id"?: string;
|
|
20
|
-
children: React.ReactNode;
|
|
21
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
-
var OverlayBar: typeof NavBarOverlayBar;
|
|
23
|
-
var SecondaryNav: typeof import("./NavBarSecondaryNav").SecondaryNav;
|
|
24
|
-
var DropdownTriggerButton: React.ForwardRefExoticComponent<Pick<import("../..").ButtonProps, "onFocus" | "onBlur" | "onClick" | "disabled"> & {
|
|
25
|
-
children?: React.ReactNode | undefined;
|
|
26
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
27
|
-
var SearchInput: React.ForwardRefExoticComponent<import("./NavBarSearchInput").NavBarSearchInputProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
export { PrimaryNavContainer };
|
|
17
|
+
export { PrimaryNav };
|
|
18
|
+
export { PrimaryNavLinkItem as PrimaryNavItem };
|
|
19
|
+
export { NavBarSubMenuContainer as SubMenuContainer };
|
|
20
|
+
export { NavBarOverlayBar as OverlayBar };
|
|
21
|
+
export { SecondaryNav };
|
|
22
|
+
export { NavBarDropdownTriggerButton as DropdownTriggerButton };
|
|
23
|
+
export { NavBarSearchInput as SearchInput };
|
|
28
24
|
}
|
|
29
25
|
export {};
|
|
@@ -6,6 +6,6 @@ type NavBarContextValue = {
|
|
|
6
6
|
primaryNavRef: RefObject<HTMLElement>;
|
|
7
7
|
secondaryNavRef: RefObject<HTMLElement>;
|
|
8
8
|
};
|
|
9
|
-
export declare const NavBarContext:
|
|
9
|
+
export declare const NavBarContext: import("react").Context<NavBarContextValue>;
|
|
10
10
|
export declare function useNavBarContext(): NavBarContextValue;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { ButtonProps } from "../Button/Button";
|
|
3
|
-
export declare const NavBarDropdownTriggerButton: React.ForwardRefExoticComponent<Pick<ButtonProps, "
|
|
3
|
+
export declare const NavBarDropdownTriggerButton: React.ForwardRefExoticComponent<Pick<ButtonProps, "disabled" | "onBlur" | "onClick" | "onFocus"> & {
|
|
4
4
|
children?: React.ReactNode | undefined;
|
|
5
5
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DialogContext:
|
|
1
|
+
export declare const DialogContext: import("react").Context<boolean>;
|
|
@@ -20,8 +20,8 @@ export type EmptyStateProps = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare function EmptyState({ title, titleAs, description, variant, icon, children, "data-e2e-test-id": dataE2eTestId, ...ariaAttributes }: EmptyStateProps): React.ReactElement;
|
|
22
22
|
export declare namespace EmptyState {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
export { EmptyStateButtonGroup as ButtonGroup };
|
|
24
|
+
export { EmptyStateLink as Link };
|
|
25
25
|
}
|
|
26
26
|
declare function EmptyStateButtonGroup<C extends React.ElementType = "button">({ ...rest }: Omit<ButtonGroupProps<C>, "buttonSize">): React.ReactElement;
|
|
27
27
|
declare function EmptyStateLink({ children, ...rest }: Omit<LinkProps, "size" | "color" | "weight"> & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
@@ -102,9 +102,11 @@ type ImageProps = {
|
|
|
102
102
|
ImageComponent: React.ElementType<any>;
|
|
103
103
|
};
|
|
104
104
|
export type ModalProps = BaseProps & ConditionalRoleProps & LabelProps & ImageProps & Pick<PortalProps, "portalContainer">;
|
|
105
|
+
declare const ModalStack: ({ children, ...rest }: Omit<StackProps, "space">) => React.JSX.Element;
|
|
106
|
+
declare const ModalText: ({ children, ...rest }: Omit<TextProps, "size" | "variant">) => React.JSX.Element;
|
|
105
107
|
export declare function Modal({ header, subHeader, labelHeader, children, imageUrl, ImageComponent, secondaryButton, cancelButtonLabel, isDismissible, isFullScreen, isMaxWidthLimit, actionButton, role, onAction, size, privateProps: { skipPortal, height, zeroPadding, tabbableOptions }, portalContainer, closeButtonAriaLabel, "data-e2e-test-id": dataE2eTestId, imageAlt, initialFocus, ...ariaAttributes }: ModalProps): React.ReactElement;
|
|
106
108
|
export declare namespace Modal {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
export { ModalStack as Stack };
|
|
110
|
+
export { ModalText as Text };
|
|
109
111
|
}
|
|
110
112
|
export {};
|
|
@@ -70,5 +70,5 @@ export declare const PromptInput: React.ForwardRefExoticComponent<{
|
|
|
70
70
|
onEnterKey: () => void;
|
|
71
71
|
/** Renders an icon to the left inside the textarea */
|
|
72
72
|
leftIcon?: IconName;
|
|
73
|
-
} & Omit<PromptTextAreaProps, "
|
|
73
|
+
} & Omit<PromptTextAreaProps, "hasAutocomplete" | "hasLeftIcon" | "isAutocompleteListOpen" | "selectedListItem" | "size"> & Pick<AutocompleteListProps, "autocompleteListFooter" | "autocompleteListItems" | "portalContainer"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
74
74
|
export {};
|
|
@@ -13,4 +13,4 @@ export declare const RadioCard: React.ForwardRefExoticComponent<{
|
|
|
13
13
|
renderContent?: (params: {
|
|
14
14
|
isSelected: boolean;
|
|
15
15
|
}) => React.ReactNode;
|
|
16
|
-
} & Omit<RadioProps, "errorMessages" | "
|
|
16
|
+
} & Omit<RadioProps, "errorMessages" | "hideLabel" | "hint"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -33,7 +33,9 @@ export type SearchResultProps = {
|
|
|
33
33
|
/** The test id for the result's primary target. */
|
|
34
34
|
"data-e2e-test-id"?: string;
|
|
35
35
|
};
|
|
36
|
+
declare const defaultProps: Partial<SearchResultProps>;
|
|
36
37
|
export declare function SearchResult({ title, subtitle, icon, details, body, secondaryTargets, link, labels, "data-e2e-test-id": dataE2eTestId, ...ariaAttributes }: SearchResultProps): React.ReactElement;
|
|
37
38
|
export declare namespace SearchResult {
|
|
38
|
-
|
|
39
|
+
export { defaultProps };
|
|
39
40
|
}
|
|
41
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get SHEET_MAX_HEIGHT(){return SHEET_MAX_HEIGHT},get Sheet(){return Sheet}};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")),_reactdom=require("react-dom"),_react1=require("@emotion/react"),_FocusTrapWrapper=require("../../shared/FocusTrapWrapper"),_Container=require("../Container/Container"),_useDragDown=require("../../shared/useDragDown"),_Lightbox=require("../Lightbox/Lightbox"),_isWithinScrolledElement=require("../../shared/isWithinScrolledElement"),SHEET_MAX_HEIGHT="80svh",StyledContainer=(0,_styled.default)("div",{target:"e137uunh0",label:"StyledContainer"})(({theme,containerHeight,isClosing,isOpening,dragOffset=0})=>{let animation;if(containerHeight){let slideOut=(0,_react1.keyframes)({from:{transform:`translateY(${dragOffset}px)`},to:{transform:`translateY(${containerHeight}px)`}}),slideIn=(0,_react1.keyframes)({from:{transform:`translateY(${containerHeight}px)`},to:{transform:"translateY(0px)"}});animation=isClosing?`200ms ease-out forwards ${slideOut}`:isOpening?`300ms ease-out forwards ${slideIn}`:"none"}return{position:"fixed",left:0,bottom:0,width:"100vw",transformOrigin:"bottom",animation,boxSizing:"border-box",zIndex:theme.variables.zIndex.modal,"> div":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}),StyledContentContainer=(0,_styled.default)("div",{target:"e137uunh1",label:"StyledContentContainer"})(({theme,isClosing,isOpening})=>{let animation,fadeOut=(0,_react1.keyframes)({from:{opacity:theme.variables.opacity.visible},to:{opacity:theme.variables.opacity.hidden}}),fadeIn=(0,_react1.keyframes)({from:{opacity:theme.variables.opacity.hidden},to:{opacity:theme.variables.opacity.visible}}),opacity=theme.variables.opacity.hidden;return isClosing?animation=`50ms ease-out forwards ${fadeOut}`:isOpening?animation=`50ms ease-out 250ms forwards ${fadeIn}`:(animation="none",opacity=theme.variables.opacity.visible),{overflow:"auto",maxHeight:"80svh",boxSizing:"border-box",overscrollBehavior:"none",backgroundColor:theme.values.color.background.elevated.default,opacity,animation}}),StyledHandleContainer=(0,_styled.default)("div",{target:"e137uunh2",label:"StyledHandleContainer"})(({theme,isContentContainerScrolled})=>({padding:`${theme.variables.size.spacing.xs} 0`,display:"flex",justifyContent:"center",backgroundColor:theme.values.color.background.elevated.default,...isContentContainerScrolled&&{boxShadow:theme.values.elevation[1]}})),StyledHandle=(0,_styled.default)("div",{target:"e137uunh3",label:"StyledHandle"})(({theme})=>({width:"80px",height:"4px",borderRadius:theme.variables.size.borderRadius.xs,backgroundColor:theme.values.color.divider.secondary}));function Sheet({id,children,hasBackdrop,isVisible,onClose,onUnmount,portalContainer,dismissOnOutsideClick=!0,disableInitialFocus,disableReturnFocusToTrigger,onClickOutsideDeactivates,"data-e2e-test-id":dataE2eTestId,role,...ariaAttributes}){let[isClosing,setClosing]=(0,_react.useState)(!1),[isOpening,setOpening]=(0,_react.useState)(!1),[containerHeight,setContainerHeight]=(0,_react.useState)(0),[isContentContainerScrolled,setContentContainerScrolled]=(0,_react.useState)(!1),containerRef=(0,_react.useRef)(null),contentContainerRef=(0,_react.useRef)(null),handleContainerRef=(0,_react.useRef)(null),prevVisibleState=(0,_react.useRef)(!1),dragOffset=(0,_react.useRef)(0),isDragStarted=(0,_react.useRef)(!1);(0,_react.useLayoutEffect)(()=>{isVisible&&setOpening(!0)},[isVisible]),(0,_react.useLayoutEffect)(()=>{isVisible&&containerRef.current&&setContainerHeight(containerRef.current.getBoundingClientRect().height)},[isVisible,children]),(0,_react.useEffect)(()=>{!isVisible&&prevVisibleState.current&&setClosing(!0),prevVisibleState.current=isVisible},[isVisible]),(0,_react.useEffect)(()=>{isVisible&&isClosing&&onClose()},[isVisible,isClosing,onClose]);let handleDragStart=(0,_react.useCallback)(()=>{requestAnimationFrame(()=>{contentContainerRef.current?.scrollTop===0&&containerRef.current&&(containerRef.current.style.animation="none",containerRef.current.style.transition="transform 0.1s ease",containerRef.current.style.transform="translateY(0px)",dragOffset.current=0,isDragStarted.current=!0)})},[containerRef,contentContainerRef]),handleDrag=(0,_react.useCallback)((_,offsetFromStart)=>{let containerCurrentHeight=containerRef.current?.getBoundingClientRect()?.height??0;requestAnimationFrame(()=>{isDragStarted.current&&containerRef.current&&contentContainerRef.current?.scrollTop===0&&offsetFromStart<containerCurrentHeight&&(containerRef.current.style.transform=`translateY(${offsetFromStart}px)`,dragOffset.current=offsetFromStart)})},[containerRef,contentContainerRef]),handleDragEnd=(0,_react.useCallback)((_,offsetFromStart)=>{let containerCurrentHeight=containerRef.current?.getBoundingClientRect()?.height??0,minDragDistance=containerCurrentHeight<300?containerCurrentHeight/4:150;requestAnimationFrame(()=>{isDragStarted.current&&(offsetFromStart>=minDragDistance&&contentContainerRef.current?.scrollTop===0?onClose():containerRef.current&&(containerRef.current.style.transform="translateY(0px)",dragOffset.current=0)),isDragStarted.current=!1})},[containerRef,onClose]),handleDragCancel=(0,_react.useCallback)(()=>{requestAnimationFrame(()=>{isDragStarted.current&&containerRef.current&&(containerRef.current.style.transform="translateY(0px)",dragOffset.current=0),isDragStarted.current=!1})},[containerRef]),shouldInitiateDrag=(0,_react.useCallback)(event=>{let target=event.target;return!!handleContainerRef.current?.contains(target)||!((0,_isWithinScrolledElement.isWithinScrolledElement)(target,containerRef.current)||(contentContainerRef.current?.scrollTop??0)>0)},[containerRef,contentContainerRef,handleContainerRef]);(0,_useDragDown.useDragDown)({ref:containerRef,isVisible,onDragStart:handleDragStart,onDrag:handleDrag,onDragEnd:handleDragEnd,onDragCancel:handleDragCancel,shouldInitiateDrag});let handlePostDeactivate=(0,_react.useCallback)(()=>{onClose()},[onClose]);if(!((isVisible||isClosing)&&!(isVisible&&isClosing)))return null;let sheetElm=_react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_react1.Global,{styles:[{html:{overflow:"hidden",overscrollBehavior:"none"}}]}),_react.default.createElement(_FocusTrapWrapper.FocusTrapWrapper,{active:isVisible,focusTrapOptions:{clickOutsideDeactivates:dismissOnOutsideClick&&onClickOutsideDeactivates?onClickOutsideDeactivates:dismissOnOutsideClick,allowOutsideClick:!0,escapeDeactivates:!0,preventScroll:!0,initialFocus:()=>!disableInitialFocus,returnFocusOnDeactivate:!disableReturnFocusToTrigger,fallbackFocus:'[data-ds-id="Sheet"]',onPostDeactivate:handlePostDeactivate}},_react.default.createElement(StyledContainer,{...id?{id}:{},"data-e2e-test-id":dataE2eTestId,"data-ds-id":"Sheet",containerHeight:containerHeight,isClosing:isClosing,isOpening:isOpening,ref:containerRef,dragOffset:dragOffset.current,onAnimationEnd:()=>{isClosing?(setClosing(!1),setContainerHeight(0),dragOffset.current=0,onUnmount&&onUnmount()):isOpening&&setOpening(!1)},role:role,...ariaAttributes},_react.default.createElement(_Container.Container,{elevation:4},_react.default.createElement(StyledHandleContainer,{ref:handleContainerRef,isContentContainerScrolled:isContentContainerScrolled},_react.default.createElement(StyledHandle,null)),_react.default.createElement(StyledContentContainer,{isClosing:isClosing,isOpening:isOpening,ref:contentContainerRef,onScroll:()=>{setContentContainerScrolled(contentContainerRef.current?.scrollTop!==0)},onAnimationEnd:evt=>evt.stopPropagation()},children))))),wrappedSheet=hasBackdrop&&!isClosing?_react.default.createElement(_Lightbox.StyledBackdrop,null,sheetElm):sheetElm,container=portalContainer||!!document&&document.body;return container&&(0,_reactdom.createPortal)(wrappedSheet,container)}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get SHEET_MAX_HEIGHT(){return SHEET_MAX_HEIGHT},get Sheet(){return Sheet}};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")),_reactdom=require("react-dom"),_react1=require("@emotion/react"),_FocusTrapWrapper=require("../../shared/FocusTrapWrapper"),_Container=require("../Container/Container"),_useExitAnimation=require("../../shared/useExitAnimation"),_useDocument=require("../../shared/useDocument"),_useSheetHeightSync=require("./useSheetHeightSync"),SHEET_MAX_HEIGHT="80svh",SCROLL_TIMELINE="--sheet-scroll",supportsScrollDrivenAnimations=()=>"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("animation-timeline: scroll()"),globalStyles={html:{overflow:"hidden",overscrollBehavior:"none"}},slideIn=(0,_react1.keyframes)({from:{transform:"translateY(100%)"},to:{transform:"translateY(0)"}},"label:slideIn"),slideOut=(0,_react1.keyframes)({from:{transform:"translateY(0)"},to:{transform:"translateY(100%)"}},"label:slideOut"),canScrollFurther=({element,direction})=>{if(!(direction<0?element.scrollTop>0:element.scrollTop+element.clientHeight<element.scrollHeight-1))return!1;let overflowY=element.ownerDocument.defaultView?.getComputedStyle(element).overflowY;return!!overflowY&&["auto","scroll","overlay"].includes(overflowY)},canContentTakeScroll=({target,boundary,direction})=>{let element=target instanceof Element?target:null;for(;element&&element!==boundary;){if(canScrollFurther({element,direction}))return!0;element=element.parentElement}return!1},SCROLL_KEY_DIRECTIONS={ArrowUp:-1,PageUp:-1,Home:-1,ArrowDown:1,PageDown:1,End:1},getScrollKeyDirection=({event,scroller})=>{let{target,key,shiftKey}=event;if(!(target instanceof HTMLElement&&(target.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(target.tagName)))){if(" "===key){if(target!==scroller)return;return shiftKey?-1:1}return SCROLL_KEY_DIRECTIONS[key]}},StyledRoot=(0,_styled.default)("div",{target:"e1prhk2x0",label:"StyledRoot"})(({theme})=>({position:"fixed",inset:0,zIndex:theme.variables.zIndex.modal,pointerEvents:"none",timelineScope:SCROLL_TIMELINE})),holdStill=(0,_react1.keyframes)({from:{transform:"translateY(0)"},to:{transform:"translateY(0)"}},"label:holdStill"),getSlideAnimation=({isLeaving,isSwipedAway,theme})=>{let{enter,exit}=theme.variables.animation.sheet;return isLeaving?isSwipedAway?`${holdStill} ${exit.duration} linear forwards`:`${slideOut} ${exit.duration} ${exit.timingFunction} forwards`:`${slideIn} ${enter.duration} ${enter.timingFunction} both`},StyledBackdrop=(0,_styled.default)("div",{target:"e1prhk2x1",label:"StyledBackdrop"})(({theme,isLeaving})=>{let{hidden,visible}=theme.variables.opacity,fadeIn=(0,_react1.keyframes)({from:{opacity:hidden},to:{opacity:visible}}),fadeOut=(0,_react1.keyframes)({from:{opacity:visible},to:{opacity:hidden}}),{enter,exit}=theme.variables.animation.sheet;return{position:"absolute",inset:0,pointerEvents:isLeaving?"none":"auto",animation:isLeaving?`${fadeOut} ${exit.duration} ${enter.timingFunction} forwards`:`${fadeIn} ${enter.duration} ${enter.timingFunction} both`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}}}),StyledBackdropFill=(0,_styled.default)("div",{target:"e1prhk2x2",label:"StyledBackdropFill"})(({theme})=>{let{hidden,visible}=theme.variables.opacity,dimWithSheet=(0,_react1.keyframes)({from:{opacity:hidden},to:{opacity:visible}});return{position:"absolute",inset:0,background:theme.values.color.background.backdrop.default,"@supports (animation-timeline: scroll())":{animation:`${dimWithSheet} linear both`,animationTimeline:SCROLL_TIMELINE}}}),StyledFrame=(0,_styled.default)("div",{target:"e1prhk2x3",label:"StyledFrame"})(({theme})=>({position:"absolute",left:0,right:0,bottom:0,height:`var(${_useSheetHeightSync.SHEET_HEIGHT_VAR}, auto)`,"::after":{content:'""',position:"absolute",top:"calc(100% - 1px)",left:0,right:0,height:SHEET_MAX_HEIGHT,backgroundColor:theme.values.color.background.elevated.default}})),StyledScroller=(0,_styled.default)("div",{target:"e1prhk2x4",label:"StyledScroller"})(({theme,isLeaving,isSwipedAway})=>({position:"absolute",left:0,right:0,bottom:0,height:"calc(100% + 112px)",overflowY:"scroll",scrollSnapType:"y mandatory",overscrollBehavior:"none",scrollbarWidth:"none","::-webkit-scrollbar":{display:"none"},scrollTimeline:`${SCROLL_TIMELINE} y`,pointerEvents:isLeaving?"none":"auto",outline:"none",animation:getSlideAnimation({isLeaving,isSwipedAway,theme}),"@media (prefers-reduced-motion: reduce)":{animation:"none"}})),StyledClosedSnapPoint=(0,_styled.default)("div",{target:"e1prhk2x5",label:"StyledClosedSnapPoint"})({height:"calc(100% + 64px + 1px)",scrollSnapAlign:"start"}),StyledSurface=(0,_styled.default)("div",{target:"e1prhk2x6",label:"StyledSurface"})({scrollSnapAlign:"end","> div":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),StyledContentContainer=(0,_styled.default)("div",{target:"e1prhk2x7",label:"StyledContentContainer"})(({theme})=>({overflow:"auto",maxHeight:SHEET_MAX_HEIGHT,boxSizing:"border-box",backgroundColor:theme.values.color.background.elevated.default})),StyledHandleContainer=(0,_styled.default)("div",{target:"e1prhk2x8",label:"StyledHandleContainer"})(({theme,isContentContainerScrolled})=>({padding:`${theme.variables.size.spacing.xs} 0`,display:"flex",justifyContent:"center",backgroundColor:theme.values.color.background.elevated.default,...isContentContainerScrolled&&{boxShadow:theme.values.elevation[1]}})),StyledHandle=(0,_styled.default)("div",{target:"e1prhk2x9",label:"StyledHandle"})(({theme})=>({width:"80px",height:"4px",borderRadius:theme.variables.size.borderRadius.xs,backgroundColor:theme.values.color.divider.secondary}));function Sheet({id,children,hasBackdrop,isVisible,onClose,onUnmount,portalContainer,dismissOnOutsideClick=!0,disableInitialFocus,disableReturnFocusToTrigger,onClickOutsideDeactivates,"data-e2e-test-id":dataE2eTestId,role,...ariaAttributes}){let theme=(0,_react1.useTheme)(),document=(0,_useDocument.useDocument)(),{isMounted,isLeaving,onAnimationEnd}=(0,_useExitAnimation.useExitAnimation)(isVisible),[isContentContainerScrolled,setContentContainerScrolled]=(0,_react.useState)(!1),[isSwipedAway,setSwipedAway]=(0,_react.useState)(!1),frameRef=(0,_react.useRef)(null),scrollerRef=(0,_react.useRef)(null),surfaceRef=(0,_react.useRef)(null),backdropFillRef=(0,_react.useRef)(null),contentContainerRef=(0,_react.useRef)(null),wasMounted=(0,_react.useRef)(isMounted);(0,_react.useEffect)(()=>{wasMounted.current&&!isMounted&&onUnmount?.(),wasMounted.current=isMounted},[isMounted,onUnmount]),(0,_useSheetHeightSync.useSheetHeightSync)({frameRef,scrollerRef,surfaceRef,isOpen:isVisible,resize:theme.variables.animation.sheet.resize}),(0,_react.useEffect)(()=>{isVisible&&setSwipedAway(!1)},[isVisible]),(0,_react.useEffect)(()=>{let scroller=scrollerRef.current,surface=surfaceRef.current;if(!isVisible||!scroller||!surface||"undefined"==typeof IntersectionObserver)return;let isHidden=!1,isTouching=!1,closeIfHidden=()=>{isHidden&&!isTouching&&(setSwipedAway(!0),onClose())},intersectionObserver=new IntersectionObserver(([entry])=>{isHidden=entry.intersectionRatio<.01,closeIfHidden()},{root:scroller,threshold:[.01]}),handleTouchStart=()=>{isTouching=!0},handleTouchEnd=()=>{isTouching=!1,closeIfHidden()};return intersectionObserver.observe(surface),scroller.addEventListener("touchstart",handleTouchStart,{passive:!0}),scroller.addEventListener("touchend",handleTouchEnd,{passive:!0}),scroller.addEventListener("touchcancel",handleTouchEnd,{passive:!0}),()=>{intersectionObserver.disconnect(),scroller.removeEventListener("touchstart",handleTouchStart),scroller.removeEventListener("touchend",handleTouchEnd),scroller.removeEventListener("touchcancel",handleTouchEnd)}},[isVisible,onClose]),(0,_react.useEffect)(()=>{let scroller=scrollerRef.current;if(!isMounted||!scroller)return;let handleScrollerWheel=event=>{if(event.ctrlKey||0===event.deltaY)return;let direction=event.deltaY<0?-1:1;canContentTakeScroll({target:event.target,boundary:scroller,direction})||event.preventDefault()},handleScrollerKeyDown=event=>{let direction=getScrollKeyDirection({event,scroller});direction&&!canContentTakeScroll({target:event.target,boundary:scroller,direction})&&event.preventDefault()};return scroller.addEventListener("wheel",handleScrollerWheel,{passive:!1}),scroller.addEventListener("keydown",handleScrollerKeyDown),()=>{scroller.removeEventListener("wheel",handleScrollerWheel),scroller.removeEventListener("keydown",handleScrollerKeyDown)}},[isMounted]),(0,_react.useEffect)(()=>{let scroller=scrollerRef.current,backdropFill=backdropFillRef.current;if(!isMounted||!scroller||!backdropFill||supportsScrollDrivenAnimations())return;let handleScrollerScroll=()=>{let maxScrollTop=scroller.scrollHeight-scroller.clientHeight;backdropFill.style.opacity=String(maxScrollTop>0?scroller.scrollTop/maxScrollTop:1)};return handleScrollerScroll(),scroller.addEventListener("scroll",handleScrollerScroll,{passive:!0}),()=>scroller.removeEventListener("scroll",handleScrollerScroll)},[isMounted,hasBackdrop]);let handlePostDeactivate=(0,_react.useCallback)(()=>{onClose()},[onClose]);if(!isMounted)return null;let sheetElm=_react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_react1.Global,{styles:[globalStyles]}),_react.default.createElement(StyledRoot,null,hasBackdrop&&_react.default.createElement(StyledBackdrop,{isLeaving:isLeaving},_react.default.createElement(StyledBackdropFill,{ref:backdropFillRef})),_react.default.createElement(StyledFrame,{ref:frameRef},_react.default.createElement(_FocusTrapWrapper.FocusTrapWrapper,{active:isVisible,focusTrapOptions:{clickOutsideDeactivates:dismissOnOutsideClick&&onClickOutsideDeactivates?onClickOutsideDeactivates:dismissOnOutsideClick,allowOutsideClick:!0,escapeDeactivates:!0,preventScroll:!0,initialFocus:()=>!disableInitialFocus,returnFocusOnDeactivate:!disableReturnFocusToTrigger,fallbackFocus:'[data-ds-id="Sheet"]',onPostDeactivate:handlePostDeactivate}},_react.default.createElement(StyledScroller,{...id?{id}:{},"data-e2e-test-id":dataE2eTestId,"data-ds-id":"Sheet",ref:scrollerRef,isLeaving:isLeaving,isSwipedAway:isSwipedAway,onAnimationEnd:onAnimationEnd,onClick:event=>{!surfaceRef.current?.contains(event.target)&&dismissOnOutsideClick&&onClose()},role:role,...ariaAttributes},_react.default.createElement(StyledClosedSnapPoint,null),_react.default.createElement(StyledSurface,{ref:surfaceRef},_react.default.createElement(_Container.Container,{elevation:4},_react.default.createElement(StyledHandleContainer,{isContentContainerScrolled:isContentContainerScrolled},_react.default.createElement(StyledHandle,null)),_react.default.createElement(StyledContentContainer,{ref:contentContainerRef,onScroll:()=>{setContentContainerScrolled(contentContainerRef.current?.scrollTop!==0)}},children)))))))),container=portalContainer||document?.body;return container?(0,_reactdom.createPortal)(sheetElm,container):null}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
/** CSS variable the scroller reads its height from */
|
|
3
|
+
export declare const SHEET_HEIGHT_VAR = "--sheet-height";
|
|
4
|
+
type Motion = {
|
|
5
|
+
duration: string;
|
|
6
|
+
timingFunction: string;
|
|
7
|
+
};
|
|
8
|
+
type UseSheetHeightSyncOptions = {
|
|
9
|
+
/** Wraps the scroller: sized to the sheet, and moved to glide height changes */
|
|
10
|
+
frameRef: RefObject<HTMLElement | null>;
|
|
11
|
+
/** Snap scroller filling the frame */
|
|
12
|
+
scrollerRef: RefObject<HTMLElement | null>;
|
|
13
|
+
/** The sheet surface inside it */
|
|
14
|
+
surfaceRef: RefObject<HTMLElement | null>;
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
resize: Motion;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Keeps the snap scroller sized to the sheet and parked at the open position,
|
|
20
|
+
* and glides height changes instead of jumping: the sheet takes its new size
|
|
21
|
+
* at once and a compositor transform on the frame plays its top edge from the
|
|
22
|
+
* old position into place (FLIP). The frame sits outside the scroller, where a
|
|
23
|
+
* transform can't stretch the scrollable area and upset the snap position.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useSheetHeightSync({ frameRef, scrollerRef, surfaceRef, isOpen, resize: { duration, timingFunction }, }: UseSheetHeightSyncOptions): void;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get SHEET_HEIGHT_VAR(){return SHEET_HEIGHT_VAR},get useSheetHeightSync(){return useSheetHeightSync}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _react=require("react"),_useWindow=require("../../shared/useWindow"),_prefersReducedMotion=require("../../shared/prefersReducedMotion"),SHEET_HEIGHT_VAR="--sheet-height",sizeFrameToSheet=({frame,sheetHeight})=>frame.style.setProperty(SHEET_HEIGHT_VAR,`${sheetHeight}px`),fitScrollerToSheet=({frame,scroller,sheetHeight})=>{sizeFrameToSheet({frame,sheetHeight}),scroller.scrollTop=scroller.scrollHeight},toMilliseconds=duration=>{let value=parseFloat(duration);return duration.trim().endsWith("ms")?value:duration.trim().endsWith("s")?1e3*value:value},getRenderedTranslateY=(element,window)=>{let{transform}=window.getComputedStyle(element);return"none"===transform?0:new DOMMatrixReadOnly(transform).m42};function useSheetHeightSync({frameRef,scrollerRef,surfaceRef,isOpen,resize:{duration,timingFunction}}){let window=(0,_useWindow.useWindow)();(0,_react.useLayoutEffect)(()=>{let frame=frameRef.current,scroller=scrollerRef.current,surface=surfaceRef.current;isOpen&&frame&&scroller&&surface&&fitScrollerToSheet({frame,scroller,sheetHeight:surface.offsetHeight})},[isOpen,frameRef,scrollerRef,surfaceRef]),(0,_react.useEffect)(()=>{let heightAnimation,frame=frameRef.current,scroller=scrollerRef.current,surface=surfaceRef.current;if(!isOpen||!frame||!scroller||!surface||"undefined"==typeof ResizeObserver)return;let previousHeight=surface.offsetHeight,isTouching=!1,handleTouchStart=()=>{isTouching=!0,heightAnimation?.playState==="running"&&heightAnimation.pause()},handleTouchEnd=()=>{isTouching=!1,heightAnimation?.playState==="paused"&&heightAnimation.play()},resizeObserver=new ResizeObserver(()=>{let sheetHeight=surface.offsetHeight,heightDelta=sheetHeight-previousHeight;if(previousHeight=sheetHeight,0===heightDelta)return;if(isTouching)return void sizeFrameToSheet({frame,sheetHeight});let inFlightOffset=heightAnimation&&"finished"!==heightAnimation.playState?getRenderedTranslateY(frame,window):0;heightAnimation?.cancel(),fitScrollerToSheet({frame,scroller,sheetHeight}),"function"!=typeof frame.animate||(0,_prefersReducedMotion.prefersReducedMotion)(window)||(heightAnimation=frame.animate([{transform:`translateY(${heightDelta+inFlightOffset}px)`},{transform:"none"}],{duration:toMilliseconds(duration),easing:timingFunction}))});return resizeObserver.observe(surface),scroller.addEventListener("touchstart",handleTouchStart,{passive:!0}),scroller.addEventListener("touchend",handleTouchEnd,{passive:!0}),scroller.addEventListener("touchcancel",handleTouchEnd,{passive:!0}),()=>{resizeObserver.disconnect(),heightAnimation?.cancel(),scroller.removeEventListener("touchstart",handleTouchStart),scroller.removeEventListener("touchend",handleTouchEnd),scroller.removeEventListener("touchcancel",handleTouchEnd)}},[isOpen,frameRef,scrollerRef,surfaceRef,window,duration,timingFunction])}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SubThemeContext:
|
|
1
|
+
export declare const SubThemeContext: import("react").Context<import("./SubThemeProvider").SubThemeName | null | undefined>;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* trap scans for focusable elements only once, on activation, and elements
|
|
6
6
|
* under a `visibility: hidden` ancestor never count as focusable.
|
|
7
7
|
*/
|
|
8
|
-
export declare const FloatingPositionedContext:
|
|
8
|
+
export declare const FloatingPositionedContext: import("react").Context<boolean>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ContainerQueryBreakpoints } from "../../../shared/mediaQueries";
|
|
2
|
-
export declare const ContainerQueryContext:
|
|
2
|
+
export declare const ContainerQueryContext: import("react").Context<ContainerQueryBreakpoints | undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const ScreenReaderText: import("@emotion/styled").StyledComponent<{
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
|
-
},
|
|
4
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -15,4 +15,4 @@ export declare const SelectableButton: import("@emotion/styled").StyledComponent
|
|
|
15
15
|
as?: React.ElementType;
|
|
16
16
|
} & {
|
|
17
17
|
isActive?: boolean;
|
|
18
|
-
},
|
|
18
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useExitAnimation",{enumerable:!0,get:function(){return useExitAnimation}});const _react=require("react"),_useWindow=require("./useWindow"),_prefersReducedMotion=require("./prefersReducedMotion");function useExitAnimation(isVisible){let window=(0,_useWindow.useWindow)(),[isClosing,setIsClosing]=(0,_react.useState)(!1),[prevVisible,setPrevVisible]=(0,_react.useState)(isVisible);isVisible!==prevVisible&&(setPrevVisible(isVisible),setIsClosing(!isVisible&&!(0,_prefersReducedMotion.prefersReducedMotion)(window)));let isLeaving=isClosing&&!isVisible,onAnimationEnd=(0,_react.useCallback)(event=>{event.target===event.currentTarget&&isLeaving&&setIsClosing(!1)},[isLeaving]);return{isMounted:isVisible||isClosing,isLeaving,onAnimationEnd}}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export declare const LAYOUT_VARS: {
|
|
2
2
|
readonly contentWidth: "--ds-layout-content-width";
|
|
3
|
+
readonly contentStart: "--ds-layout-content-start";
|
|
3
4
|
readonly leftPanelWidth: "--ds-layout-leftPanel-width";
|
|
5
|
+
readonly leftPanelStart: "--ds-layout-leftPanel-start";
|
|
4
6
|
readonly rightPanelWidth: "--ds-layout-rightPanel-width";
|
|
5
7
|
readonly rightPanelBottomBarHeight: "--ds-layout-rightPanel-bottomBar-height";
|
|
8
|
+
readonly rightPanelStart: "--ds-layout-rightPanel-start";
|
|
6
9
|
readonly splitMaxWidth: "--ds-layout-split-max-width";
|
|
7
10
|
readonly bottomBarHeight: "--ds-layout-bottomBar-height";
|
|
11
|
+
readonly bottomBarContentHeight: "--ds-layout-bottomBar-content-height";
|
|
8
12
|
readonly subnavOffset: "--ds-layout-subnav-offset";
|
|
9
13
|
readonly floatWidth: "--ds-layout-float-width";
|
|
10
14
|
readonly floatHeight: "--ds-layout-float-height";
|
|
15
|
+
readonly splitviewWidth: "--ds-layout-splitview-width";
|
|
16
|
+
readonly splitviewStart: "--ds-layout-splitview-start";
|
|
17
|
+
readonly regionsReady: "--ds-layout-regions-ready";
|
|
11
18
|
};
|
|
12
19
|
export type LayoutVarKey = keyof typeof LAYOUT_VARS;
|
|
13
20
|
export type LayoutVarName = (typeof LAYOUT_VARS)[LayoutVarKey];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"LAYOUT_VARS",{enumerable:!0,get:function(){return LAYOUT_VARS}});const LAYOUT_VARS={contentWidth:"--ds-layout-content-width",leftPanelWidth:"--ds-layout-leftPanel-width",rightPanelWidth:"--ds-layout-rightPanel-width",rightPanelBottomBarHeight:"--ds-layout-rightPanel-bottomBar-height",splitMaxWidth:"--ds-layout-split-max-width",bottomBarHeight:"--ds-layout-bottomBar-height",subnavOffset:"--ds-layout-subnav-offset",floatWidth:"--ds-layout-float-width",floatHeight:"--ds-layout-float-height"};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"LAYOUT_VARS",{enumerable:!0,get:function(){return LAYOUT_VARS}});const LAYOUT_VARS={contentWidth:"--ds-layout-content-width",contentStart:"--ds-layout-content-start",leftPanelWidth:"--ds-layout-leftPanel-width",leftPanelStart:"--ds-layout-leftPanel-start",rightPanelWidth:"--ds-layout-rightPanel-width",rightPanelBottomBarHeight:"--ds-layout-rightPanel-bottomBar-height",rightPanelStart:"--ds-layout-rightPanel-start",splitMaxWidth:"--ds-layout-split-max-width",bottomBarHeight:"--ds-layout-bottomBar-height",bottomBarContentHeight:"--ds-layout-bottomBar-content-height",subnavOffset:"--ds-layout-subnav-offset",floatWidth:"--ds-layout-float-width",floatHeight:"--ds-layout-float-height",splitviewWidth:"--ds-layout-splitview-width",splitviewStart:"--ds-layout-splitview-start",regionsReady:"--ds-layout-regions-ready"};
|
|
@@ -3,14 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
export const LAYOUT_VARS = {
|
|
5
5
|
contentWidth: "--ds-layout-content-width",
|
|
6
|
+
contentStart: "--ds-layout-content-start",
|
|
6
7
|
leftPanelWidth: "--ds-layout-leftPanel-width",
|
|
8
|
+
leftPanelStart: "--ds-layout-leftPanel-start",
|
|
7
9
|
rightPanelWidth: "--ds-layout-rightPanel-width",
|
|
8
10
|
rightPanelBottomBarHeight: "--ds-layout-rightPanel-bottomBar-height",
|
|
11
|
+
rightPanelStart: "--ds-layout-rightPanel-start",
|
|
9
12
|
splitMaxWidth: "--ds-layout-split-max-width",
|
|
10
13
|
bottomBarHeight: "--ds-layout-bottomBar-height",
|
|
14
|
+
bottomBarContentHeight: "--ds-layout-bottomBar-content-height",
|
|
11
15
|
subnavOffset: "--ds-layout-subnav-offset",
|
|
12
16
|
floatWidth: "--ds-layout-float-width",
|
|
13
17
|
floatHeight: "--ds-layout-float-height",
|
|
18
|
+
splitviewWidth: "--ds-layout-splitview-width",
|
|
19
|
+
splitviewStart: "--ds-layout-splitview-start",
|
|
20
|
+
regionsReady: "--ds-layout-regions-ready",
|
|
14
21
|
} as const;
|
|
15
22
|
|
|
16
23
|
export type LayoutVarKey = keyof typeof LAYOUT_VARS;
|
|
@@ -195,6 +195,20 @@ type Variables = {
|
|
|
195
195
|
"timingFunction": string;
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
|
+
"sheet": {
|
|
199
|
+
"enter": {
|
|
200
|
+
"duration": string;
|
|
201
|
+
"timingFunction": string;
|
|
202
|
+
};
|
|
203
|
+
"exit": {
|
|
204
|
+
"duration": string;
|
|
205
|
+
"timingFunction": string;
|
|
206
|
+
};
|
|
207
|
+
"resize": {
|
|
208
|
+
"duration": string;
|
|
209
|
+
"timingFunction": string;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
198
212
|
"promptInput": {
|
|
199
213
|
"focus": {
|
|
200
214
|
"duration": string;
|
|
@@ -230,12 +244,18 @@ type Variables = {
|
|
|
230
244
|
"width": {
|
|
231
245
|
"default": string;
|
|
232
246
|
};
|
|
247
|
+
"start": {
|
|
248
|
+
"default": string;
|
|
249
|
+
};
|
|
233
250
|
};
|
|
234
251
|
"leftPanel": {
|
|
235
252
|
"width": {
|
|
236
253
|
"default": string;
|
|
237
254
|
"open": string;
|
|
238
255
|
};
|
|
256
|
+
"start": {
|
|
257
|
+
"default": string;
|
|
258
|
+
};
|
|
239
259
|
};
|
|
240
260
|
"rightPanel": {
|
|
241
261
|
"width": {
|
|
@@ -252,6 +272,9 @@ type Variables = {
|
|
|
252
272
|
"default": string;
|
|
253
273
|
};
|
|
254
274
|
};
|
|
275
|
+
"start": {
|
|
276
|
+
"default": string;
|
|
277
|
+
};
|
|
255
278
|
};
|
|
256
279
|
"split": {
|
|
257
280
|
"maxWidth": {
|
|
@@ -262,6 +285,9 @@ type Variables = {
|
|
|
262
285
|
"height": {
|
|
263
286
|
"default": string;
|
|
264
287
|
};
|
|
288
|
+
"contentHeight": {
|
|
289
|
+
"default": string;
|
|
290
|
+
};
|
|
265
291
|
};
|
|
266
292
|
"subnav": {
|
|
267
293
|
"offset": {
|
|
@@ -276,6 +302,19 @@ type Variables = {
|
|
|
276
302
|
"default": string;
|
|
277
303
|
};
|
|
278
304
|
};
|
|
305
|
+
"splitview": {
|
|
306
|
+
"width": {
|
|
307
|
+
"default": string;
|
|
308
|
+
};
|
|
309
|
+
"start": {
|
|
310
|
+
"default": string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
"regions": {
|
|
314
|
+
"ready": {
|
|
315
|
+
"default": string;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
279
318
|
};
|
|
280
319
|
"opacity": {
|
|
281
320
|
"hidden": number;
|