@cloudscape-design/components 3.0.246 → 3.0.247
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/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/drawer/index.d.ts +3 -21
- package/app-layout/drawer/index.d.ts.map +1 -1
- package/app-layout/drawer/index.js +25 -5
- package/app-layout/drawer/index.js.map +1 -1
- package/app-layout/drawer/interfaces.d.ts +84 -0
- package/app-layout/drawer/interfaces.d.ts.map +1 -0
- package/app-layout/drawer/interfaces.js +2 -0
- package/app-layout/drawer/interfaces.js.map +1 -0
- package/app-layout/drawer/resizable-drawer.d.ts +4 -0
- package/app-layout/drawer/resizable-drawer.d.ts.map +1 -0
- package/app-layout/drawer/resizable-drawer.js +51 -0
- package/app-layout/drawer/resizable-drawer.js.map +1 -0
- package/app-layout/drawer/styles.css.js +10 -5
- package/app-layout/drawer/styles.scoped.css +46 -10
- package/app-layout/drawer/styles.selectors.js +10 -5
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +142 -17
- package/app-layout/index.js.map +1 -1
- package/app-layout/mobile-toolbar/index.d.ts +10 -1
- package/app-layout/mobile-toolbar/index.d.ts.map +1 -1
- package/app-layout/mobile-toolbar/index.js +3 -2
- package/app-layout/mobile-toolbar/index.js.map +1 -1
- package/app-layout/mobile-toolbar/styles.css.js +5 -4
- package/app-layout/mobile-toolbar/styles.scoped.css +11 -7
- package/app-layout/mobile-toolbar/styles.selectors.js +5 -4
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/test-classes/styles.css.js +18 -13
- package/app-layout/test-classes/styles.scoped.css +33 -13
- package/app-layout/test-classes/styles.selectors.js +18 -13
- package/app-layout/toggles/index.d.ts.map +1 -1
- package/app-layout/toggles/index.js +2 -2
- package/app-layout/toggles/index.js.map +1 -1
- package/app-layout/toggles/interfaces.d.ts +3 -1
- package/app-layout/toggles/interfaces.d.ts.map +1 -1
- package/app-layout/toggles/interfaces.js.map +1 -1
- package/app-layout/utils/use-drawer-focus-control.d.ts +21 -0
- package/app-layout/utils/use-drawer-focus-control.d.ts.map +1 -0
- package/app-layout/utils/use-drawer-focus-control.js +65 -0
- package/app-layout/utils/use-drawer-focus-control.js.map +1 -0
- package/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
- package/app-layout/visual-refresh/app-bar.js +8 -6
- package/app-layout/visual-refresh/app-bar.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +13 -5
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +104 -49
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.d.ts +47 -0
- package/app-layout/visual-refresh/drawers.d.ts.map +1 -0
- package/app-layout/visual-refresh/drawers.js +127 -0
- package/app-layout/visual-refresh/drawers.js.map +1 -0
- package/app-layout/visual-refresh/header.js +2 -2
- package/app-layout/visual-refresh/header.js.map +1 -1
- package/app-layout/visual-refresh/index.d.ts.map +1 -1
- package/app-layout/visual-refresh/index.js +3 -1
- package/app-layout/visual-refresh/index.js.map +1 -1
- package/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/app-layout/visual-refresh/layout.js +5 -42
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +2 -3
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/navigation.js +2 -2
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
- package/app-layout/visual-refresh/notifications.js +2 -2
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +2 -2
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +71 -61
- package/app-layout/visual-refresh/styles.scoped.css +437 -229
- package/app-layout/visual-refresh/styles.selectors.js +71 -61
- package/app-layout/visual-refresh/tools.d.ts.map +1 -1
- package/app-layout/visual-refresh/tools.js +7 -3
- package/app-layout/visual-refresh/tools.js.map +1 -1
- package/app-layout/visual-refresh/trigger-button.d.ts +4 -3
- package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
- package/app-layout/visual-refresh/trigger-button.js +5 -4
- package/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/area-chart/internal.js +1 -1
- package/area-chart/internal.js.map +1 -1
- package/flashbar/styles.css.js +45 -45
- package/flashbar/styles.scoped.css +169 -169
- package/flashbar/styles.selectors.js +45 -45
- package/internal/base-component/styles.scoped.css +24 -0
- package/internal/environment.js +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +31 -30
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/generated/styles/tokens.d.ts +2 -0
- package/internal/generated/styles/tokens.js +2 -0
- package/internal/generated/theming/index.cjs +140 -0
- package/internal/generated/theming/index.js +140 -0
- package/internal/manifest.json +1 -1
- package/mixed-line-bar-chart/internal.js +1 -1
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/index.js +1 -1
- package/pie-chart/index.js.map +1 -1
- package/space-between/internal.js +1 -1
- package/space-between/internal.js.map +1 -1
- package/space-between/styles.css.js +20 -28
- package/space-between/styles.scoped.css +37 -101
- package/space-between/styles.selectors.js +20 -28
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import { useAppLayoutInternals } from './context';
|
|
6
5
|
import { InternalButton } from '../../button/internal';
|
|
6
|
+
import { MobileTriggers as DrawersMobileTriggers } from './drawers';
|
|
7
|
+
import { useAppLayoutInternals } from './context';
|
|
7
8
|
import styles from './styles.css.js';
|
|
8
9
|
import testutilStyles from '../test-classes/styles.css.js';
|
|
9
10
|
/**
|
|
@@ -12,24 +13,25 @@ import testutilStyles from '../test-classes/styles.css.js';
|
|
|
12
13
|
*/
|
|
13
14
|
export default function AppBar() {
|
|
14
15
|
var _a, _b, _c;
|
|
15
|
-
const { ariaLabels, breadcrumbs, contentHeader, contentType, dynamicOverlapHeight, handleNavigationClick, handleToolsClick, hasNotificationsContent, hasStickyBackground, isMobile, navigationHide, isNavigationOpen, isToolsOpen, toolsHide,
|
|
16
|
+
const { ariaLabels, breadcrumbs, contentHeader, contentType, drawers, dynamicOverlapHeight, handleNavigationClick, handleToolsClick, hasDrawerViewportOverlay, hasNotificationsContent, hasStickyBackground, isMobile, navigationHide, isNavigationOpen, isToolsOpen, toolsHide, navigationRefs, toolsRefs, } = useAppLayoutInternals();
|
|
16
17
|
if (navigationHide && !breadcrumbs && toolsHide) {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
20
|
return (React.createElement("section", { "aria-hidden": !isMobile && !breadcrumbs ? true : undefined, className: clsx(styles.appbar, {
|
|
20
21
|
[styles['has-breadcrumbs']]: breadcrumbs,
|
|
21
|
-
[styles.unfocusable]:
|
|
22
|
+
[styles.unfocusable]: hasDrawerViewportOverlay,
|
|
22
23
|
[testutilStyles['mobile-bar']]: isMobile,
|
|
23
24
|
}, 'awsui-context-content-header') },
|
|
24
25
|
!navigationHide && isMobile && (React.createElement("nav", { className: clsx(styles['appbar-nav'], { [testutilStyles['drawer-closed']]: !isNavigationOpen }), "aria-hidden": isNavigationOpen },
|
|
25
|
-
React.createElement(InternalButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: isNavigationOpen ? undefined : false, iconName: "menu", formAction: "none", onClick: () => handleNavigationClick(true), variant: "icon", className: testutilStyles['navigation-toggle'], ref: navigationRefs.toggle, disabled:
|
|
26
|
+
React.createElement(InternalButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: isNavigationOpen ? undefined : false, iconName: "menu", formAction: "none", onClick: () => handleNavigationClick(true), variant: "icon", className: testutilStyles['navigation-toggle'], ref: navigationRefs.toggle, disabled: hasDrawerViewportOverlay, __nativeAttributes: { 'aria-haspopup': isNavigationOpen ? undefined : true } }))),
|
|
26
27
|
breadcrumbs && (React.createElement("div", { className: clsx(styles.breadcrumbs, styles[`content-type-${contentType}`], testutilStyles.breadcrumbs, {
|
|
27
28
|
[styles['has-dynamic-overlap-height']]: dynamicOverlapHeight > 0,
|
|
28
29
|
[styles['has-header']]: contentHeader,
|
|
29
30
|
[styles['has-notifications-content']]: hasNotificationsContent,
|
|
30
31
|
[styles['has-sticky-background']]: hasStickyBackground,
|
|
31
32
|
}) }, breadcrumbs)),
|
|
32
|
-
!toolsHide &&
|
|
33
|
-
React.createElement(InternalButton, { className: testutilStyles['tools-toggle'], ariaExpanded: isToolsOpen, disabled:
|
|
33
|
+
isMobile && !toolsHide && !drawers && (React.createElement("aside", { className: clsx(styles['appbar-tools'], { [testutilStyles['drawer-closed']]: !isToolsOpen }), "aria-hidden": isToolsOpen, "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.tools) !== null && _b !== void 0 ? _b : undefined },
|
|
34
|
+
React.createElement(InternalButton, { className: testutilStyles['tools-toggle'], ariaExpanded: isToolsOpen, disabled: hasDrawerViewportOverlay, ariaLabel: (_c = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.toolsToggle) !== null && _c !== void 0 ? _c : undefined, iconName: "status-info", formAction: "none", onClick: () => handleToolsClick(true), variant: "icon", ref: toolsRefs.toggle, __nativeAttributes: { 'aria-haspopup': true } }))),
|
|
35
|
+
React.createElement(DrawersMobileTriggers, null)));
|
|
34
36
|
}
|
|
35
37
|
//# sourceMappingURL=app-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-bar.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/app-bar.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"app-bar.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/app-bar.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM;;IAC5B,MAAM,EACJ,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,OAAO,EACP,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,cAAc,EACd,SAAS,GACV,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,cAAc,IAAI,CAAC,WAAW,IAAI,SAAS,EAAE;QAC/C,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,gDACe,CAAC,QAAQ,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAA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,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,aAAa;gBACrC,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAC,EAAE,uBAAuB;gBAC9D,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,mBAAmB;aACvD,CAAC,IAED,WAAW,CACR,CACP;QAEA,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO,IAAI,CACrC,+BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,iBAC/E,WAAW,gBACZ,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,mCAAI,SAAS;YAE1C,oBAAC,cAAc,IACb,SAAS,EAAE,cAAc,CAAC,cAAc,CAAC,EACzC,YAAY,EAAE,WAAW,EACzB,QAAQ,EAAE,wBAAwB,EAClC,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,mCAAI,SAAS,EAC/C,QAAQ,EAAC,aAAa,EACtB,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EACrC,OAAO,EAAC,MAAM,EACd,GAAG,EAAE,SAAS,CAAC,MAAM,EACrB,kBAAkB,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,GAC7C,CACI,CACT;QAED,oBAAC,qBAAqB,OAAG,CACjB,CACX,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { MobileTriggers as DrawersMobileTriggers } from './drawers';\nimport { useAppLayoutInternals } from './context';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\n\n/**\n * The CSS class 'awsui-context-content-header' needs to be added to the root element so\n * that the design tokens used are overridden with the appropriate values.\n */\nexport default function AppBar() {\n const {\n ariaLabels,\n breadcrumbs,\n contentHeader,\n contentType,\n drawers,\n dynamicOverlapHeight,\n handleNavigationClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n hasNotificationsContent,\n hasStickyBackground,\n isMobile,\n navigationHide,\n isNavigationOpen,\n isToolsOpen,\n toolsHide,\n navigationRefs,\n toolsRefs,\n } = useAppLayoutInternals();\n\n if (navigationHide && !breadcrumbs && toolsHide) {\n return null;\n }\n\n return (\n <section\n aria-hidden={!isMobile && !breadcrumbs ? true : undefined}\n className={clsx(\n styles.appbar,\n {\n [styles['has-breadcrumbs']]: breadcrumbs,\n [styles.unfocusable]: hasDrawerViewportOverlay,\n [testutilStyles['mobile-bar']]: isMobile,\n },\n 'awsui-context-content-header'\n )}\n >\n {!navigationHide && isMobile && (\n <nav\n className={clsx(styles['appbar-nav'], { [testutilStyles['drawer-closed']]: !isNavigationOpen })}\n aria-hidden={isNavigationOpen}\n >\n <InternalButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={isNavigationOpen ? undefined : false}\n iconName=\"menu\"\n formAction=\"none\"\n onClick={() => handleNavigationClick(true)}\n variant=\"icon\"\n className={testutilStyles['navigation-toggle']}\n ref={navigationRefs.toggle}\n disabled={hasDrawerViewportOverlay}\n __nativeAttributes={{ 'aria-haspopup': isNavigationOpen ? undefined : true }}\n />\n </nav>\n )}\n\n {breadcrumbs && (\n <div\n className={clsx(styles.breadcrumbs, styles[`content-type-${contentType}`], testutilStyles.breadcrumbs, {\n [styles['has-dynamic-overlap-height']]: dynamicOverlapHeight > 0,\n [styles['has-header']]: contentHeader,\n [styles['has-notifications-content']]: hasNotificationsContent,\n [styles['has-sticky-background']]: hasStickyBackground,\n })}\n >\n {breadcrumbs}\n </div>\n )}\n\n {isMobile && !toolsHide && !drawers && (\n <aside\n className={clsx(styles['appbar-tools'], { [testutilStyles['drawer-closed']]: !isToolsOpen })}\n aria-hidden={isToolsOpen}\n aria-label={ariaLabels?.tools ?? undefined}\n >\n <InternalButton\n className={testutilStyles['tools-toggle']}\n ariaExpanded={isToolsOpen}\n disabled={hasDrawerViewportOverlay}\n ariaLabel={ariaLabels?.toolsToggle ?? undefined}\n iconName=\"status-info\"\n formAction=\"none\"\n onClick={() => handleToolsClick(true)}\n variant=\"icon\"\n ref={toolsRefs.toggle}\n __nativeAttributes={{ 'aria-haspopup': true }}\n />\n </aside>\n )}\n\n <DrawersMobileTriggers />\n </section>\n );\n}\n"]}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AppLayoutProps } from '../interfaces';
|
|
3
|
+
import { DrawersProps } from './drawers';
|
|
3
4
|
import { FocusControlRefs } from '../utils/use-focus-control';
|
|
4
|
-
import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';
|
|
5
5
|
import { SplitPanelFocusControlRefs } from '../utils/use-split-panel-focus-control';
|
|
6
|
+
import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';
|
|
6
7
|
interface AppLayoutInternals extends AppLayoutProps {
|
|
8
|
+
activeDrawerId: string | null;
|
|
9
|
+
activeDrawerWidth: number;
|
|
10
|
+
drawers: DrawersProps;
|
|
11
|
+
drawersRefs: FocusControlRefs;
|
|
12
|
+
drawersTriggerCount: number;
|
|
7
13
|
dynamicOverlapHeight: number;
|
|
14
|
+
handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;
|
|
8
15
|
handleSplitPanelClick: () => void;
|
|
9
16
|
handleNavigationClick: (isOpen: boolean) => void;
|
|
10
17
|
handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;
|
|
11
18
|
handleSplitPanelResize: (detail: {
|
|
12
19
|
size: number;
|
|
13
20
|
}) => void;
|
|
14
|
-
handleToolsClick: (value: boolean) => void;
|
|
21
|
+
handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;
|
|
15
22
|
hasDefaultToolsWidth: boolean;
|
|
23
|
+
hasDrawerViewportOverlay: boolean;
|
|
16
24
|
hasNotificationsContent: boolean;
|
|
25
|
+
hasOpenDrawer: boolean;
|
|
17
26
|
hasStickyBackground: boolean;
|
|
18
|
-
isAnyPanelOpen: boolean;
|
|
19
27
|
isMobile: boolean;
|
|
20
28
|
isNavigationOpen: boolean;
|
|
21
29
|
isSplitPanelForcedPosition: boolean;
|
|
@@ -23,8 +31,10 @@ interface AppLayoutInternals extends AppLayoutProps {
|
|
|
23
31
|
isToolsOpen: boolean;
|
|
24
32
|
layoutElement: React.Ref<HTMLElement>;
|
|
25
33
|
layoutWidth: number;
|
|
34
|
+
loseToolsFocus: () => void;
|
|
26
35
|
mainElement: React.Ref<HTMLDivElement>;
|
|
27
36
|
mainOffsetLeft: number;
|
|
37
|
+
navigationRefs: FocusControlRefs;
|
|
28
38
|
notificationsElement: React.Ref<HTMLDivElement>;
|
|
29
39
|
notificationsHeight: number;
|
|
30
40
|
offsetBottom: number;
|
|
@@ -43,9 +53,7 @@ interface AppLayoutInternals extends AppLayoutProps {
|
|
|
43
53
|
setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;
|
|
44
54
|
splitPanelDisplayed: boolean;
|
|
45
55
|
splitPanelRefs: SplitPanelFocusControlRefs;
|
|
46
|
-
navigationRefs: FocusControlRefs;
|
|
47
56
|
toolsRefs: FocusControlRefs;
|
|
48
|
-
loseToolsFocus: () => void;
|
|
49
57
|
}
|
|
50
58
|
interface AppLayoutProviderInternalsProps extends AppLayoutProps {
|
|
51
59
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KASN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/context.tsx"],"names":[],"mappings":"A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Q,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,uBAMpC;AAED,eAAO,MAAM,0BAA0B,4GA4hBtC,CAAC"}
|
|
@@ -2,20 +2,20 @@ import { __rest } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React, { createContext, useCallback, useEffect, useLayoutEffect, useImperativeHandle, useRef, useState, useContext, } from 'react';
|
|
5
|
+
import { applyDefaults } from '../defaults';
|
|
6
|
+
import { AppLayoutContext } from '../../internal/context/app-layout-context';
|
|
5
7
|
import { fireNonCancelableEvent } from '../../internal/events';
|
|
8
|
+
import { useFocusControl } from '../utils/use-focus-control';
|
|
9
|
+
import { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';
|
|
10
|
+
import { isDevelopment } from '../../internal/is-development';
|
|
6
11
|
import { getSplitPanelPosition } from './split-panel';
|
|
12
|
+
import { useContainerQuery } from '../../internal/hooks/container-queries';
|
|
7
13
|
import { useControllable } from '../../internal/hooks/use-controllable';
|
|
14
|
+
import { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';
|
|
15
|
+
import { useObservedElement } from '../utils/use-observed-element';
|
|
8
16
|
import { useMobile } from '../../internal/hooks/use-mobile';
|
|
9
|
-
import { useContainerQuery } from '../../internal/hooks/container-queries';
|
|
10
|
-
import { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';
|
|
11
|
-
import styles from './styles.css.js';
|
|
12
|
-
import { isDevelopment } from '../../internal/is-development';
|
|
13
17
|
import { warnOnce } from '../../internal/logging';
|
|
14
|
-
import
|
|
15
|
-
import { useFocusControl } from '../utils/use-focus-control';
|
|
16
|
-
import { useObservedElement } from '../utils/use-observed-element';
|
|
17
|
-
import { AppLayoutContext } from '../../internal/context/app-layout-context';
|
|
18
|
-
import { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';
|
|
18
|
+
import styles from './styles.css.js';
|
|
19
19
|
/**
|
|
20
20
|
* The default values are destructured in the context instantiation to
|
|
21
21
|
* prevent downstream Typescript errors. This could likely be replaced
|
|
@@ -30,7 +30,7 @@ export function useAppLayoutInternals() {
|
|
|
30
30
|
return ctx;
|
|
31
31
|
}
|
|
32
32
|
export const AppLayoutInternalsProvider = React.forwardRef((_a, forwardRef) => {
|
|
33
|
-
var _b, _c, _d;
|
|
33
|
+
var _b, _c, _d, _e;
|
|
34
34
|
var { toolsHide, toolsOpen: controlledToolsOpen, navigationHide, navigationOpen: controlledNavigationOpen, contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #h', children, splitPanel } = _a, props = __rest(_a, ["toolsHide", "toolsOpen", "navigationHide", "navigationOpen", "contentType", "headerSelector", "footerSelector", "children", "splitPanel"]);
|
|
35
35
|
const isMobile = useMobile();
|
|
36
36
|
if (isDevelopment) {
|
|
@@ -98,14 +98,11 @@ export const AppLayoutInternalsProvider = React.forwardRef((_a, forwardRef) => {
|
|
|
98
98
|
const hasDefaultToolsWidth = props.toolsWidth === undefined;
|
|
99
99
|
const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, isMobile ? false : contentTypeDefaults.toolsOpen, { componentName: 'AppLayout', controlledProp: 'toolsOpen', changeHandler: 'onToolsChange' });
|
|
100
100
|
const { refs: toolsRefs, setFocus: focusToolsButtons, loseFocus: loseToolsFocus, } = useFocusControl(isToolsOpen, true);
|
|
101
|
-
const handleToolsClick = useCallback(function handleToolsChange(isOpen) {
|
|
101
|
+
const handleToolsClick = useCallback(function handleToolsChange(isOpen, skipFocusControl) {
|
|
102
102
|
setIsToolsOpen(isOpen);
|
|
103
|
-
focusToolsButtons();
|
|
103
|
+
!skipFocusControl && focusToolsButtons();
|
|
104
104
|
fireNonCancelableEvent(props.onToolsChange, { open: isOpen });
|
|
105
105
|
}, [props.onToolsChange, setIsToolsOpen, focusToolsButtons]);
|
|
106
|
-
const navigationVisible = !navigationHide && isNavigationOpen;
|
|
107
|
-
const toolsVisible = !toolsHide && isToolsOpen;
|
|
108
|
-
const isAnyPanelOpen = navigationVisible || toolsVisible;
|
|
109
106
|
/**
|
|
110
107
|
* On mobile viewports the navigation and tools drawers are adjusted to a fixed position
|
|
111
108
|
* that consumes 100% of the viewport height and width. The body content could potentially
|
|
@@ -231,6 +228,41 @@ export const AppLayoutInternalsProvider = React.forwardRef((_a, forwardRef) => {
|
|
|
231
228
|
setSplitPanelLastInteraction({ type: 'position' });
|
|
232
229
|
fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);
|
|
233
230
|
}, [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]);
|
|
231
|
+
/**
|
|
232
|
+
* The activeDrawerWidth is required in JavaScript to acccurately calculate whether a SplitPanel
|
|
233
|
+
* in the side position should be forced to the bottom based on available horiziontal space.
|
|
234
|
+
*
|
|
235
|
+
* The handleDrawersClick will either open a new drawer or close the currently open drawer by setting
|
|
236
|
+
* the activeDrawerId value. The active drawer can also be closed if a user clicks the Tools trigger
|
|
237
|
+
* button. This will skip the focus handling because the focus should be going to the Tools close
|
|
238
|
+
* button and not one of the drawers trigger buttons.
|
|
239
|
+
*
|
|
240
|
+
* The drawersTriggerCount is computed in order to determine whether the triggers should be persistent
|
|
241
|
+
* in the UI when a drawer is open. The trigger button container is suppressed when a drawer is open
|
|
242
|
+
* and their is only one trigger button.
|
|
243
|
+
*
|
|
244
|
+
* The hasDrawerViewportOverlay property is used to determine if any drawer is obscuring the entire
|
|
245
|
+
* viewport. This currently applies to Navigation, Tools, and Drawers in mobile viewports.
|
|
246
|
+
*/
|
|
247
|
+
const drawers = props.drawers;
|
|
248
|
+
const [activeDrawerId, setActiveDrawerId] = useControllable(drawers === null || drawers === void 0 ? void 0 : drawers.activeDrawerId, drawers === null || drawers === void 0 ? void 0 : drawers.onChange, null, {
|
|
249
|
+
componentName: 'AppLayout',
|
|
250
|
+
controlledProp: 'drawers.activeDrawerId',
|
|
251
|
+
changeHandler: 'onChange',
|
|
252
|
+
});
|
|
253
|
+
const activeDrawerWidth = 290;
|
|
254
|
+
const { refs: drawersRefs, setFocus: focusDrawersButtons } = useFocusControl(activeDrawerId);
|
|
255
|
+
const handleDrawersClick = useCallback(function handleDrawersChange(id, skipFocusControl) {
|
|
256
|
+
const newActiveDrawerId = id !== activeDrawerId ? id : null;
|
|
257
|
+
setActiveDrawerId(newActiveDrawerId);
|
|
258
|
+
!skipFocusControl && focusDrawersButtons();
|
|
259
|
+
fireNonCancelableEvent(drawers === null || drawers === void 0 ? void 0 : drawers.onChange, newActiveDrawerId);
|
|
260
|
+
}, [activeDrawerId, drawers === null || drawers === void 0 ? void 0 : drawers.onChange, focusDrawersButtons, setActiveDrawerId]);
|
|
261
|
+
const drawersTriggerCount = ((_e = drawers === null || drawers === void 0 ? void 0 : drawers.items.length) !== null && _e !== void 0 ? _e : 0) +
|
|
262
|
+
(splitPanelDisplayed && splitPanelPosition === 'side' ? 1 : 0) +
|
|
263
|
+
(!toolsHide ? 1 : 0);
|
|
264
|
+
const hasOpenDrawer = activeDrawerId || isToolsOpen || (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);
|
|
265
|
+
const hasDrawerViewportOverlay = isMobile && (!!activeDrawerId || (!navigationHide && isNavigationOpen) || (!toolsHide && isToolsOpen));
|
|
234
266
|
/**
|
|
235
267
|
* The Layout element is not necessarily synonymous with the client
|
|
236
268
|
* viewport width. There can be content in the horizontal viewport
|
|
@@ -254,35 +286,6 @@ export const AppLayoutInternalsProvider = React.forwardRef((_a, forwardRef) => {
|
|
|
254
286
|
var _a, _b;
|
|
255
287
|
setMainOffsetLeft((_b = (_a = mainElement === null || mainElement === void 0 ? void 0 : mainElement.current) === null || _a === void 0 ? void 0 : _a.offsetLeft) !== null && _b !== void 0 ? _b : 0);
|
|
256
288
|
}, [layoutWidth, isNavigationOpen, isToolsOpen, splitPanelReportedSize]);
|
|
257
|
-
useLayoutEffect(function handleSplitPanelMaxWidth() {
|
|
258
|
-
/**
|
|
259
|
-
* Warning! This is a hack! In order to accurately calculate if there is adequate
|
|
260
|
-
* horizontal space for the Split Panel to be in the side position we need two values
|
|
261
|
-
* that are not available in JavaScript.
|
|
262
|
-
*
|
|
263
|
-
* The first is the the content gap on the right which is stored in a design token
|
|
264
|
-
* and applied in the Layout CSS:
|
|
265
|
-
*
|
|
266
|
-
* $contentGapRight: #{awsui.$space-scaled-2x-xxxl};
|
|
267
|
-
*
|
|
268
|
-
* The second is the width of the element that has the circular buttons for the
|
|
269
|
-
* Tools and Split Panel. This could be suppressed given the state of the Tools
|
|
270
|
-
* drawer returning a zero value. It would, however, be rendered if the Split Panel
|
|
271
|
-
* were to move into the side position. This is calculated in the Tools CSS and
|
|
272
|
-
* the Trigger button CSS with design tokens:
|
|
273
|
-
*
|
|
274
|
-
* padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;
|
|
275
|
-
* width: awsui.$space-layout-toggle-diameter;
|
|
276
|
-
*
|
|
277
|
-
* These values will be defined below as static integers that are rough approximations
|
|
278
|
-
* of their computed width when rendered in the DOM, but doubled to ensure adequate
|
|
279
|
-
* spacing for the Split Panel to be in side position.
|
|
280
|
-
*/
|
|
281
|
-
const contentGapRight = 80; // Approximately 40px when rendered but doubled for safety
|
|
282
|
-
const toolsFormOffsetWidth = 160; // Approximately 80px when rendered but doubled for safety
|
|
283
|
-
const toolsOffsetWidth = isToolsOpen ? toolsWidth : 0;
|
|
284
|
-
setSplitPanelMaxWidth(layoutWidth - mainOffsetLeft - minContentWidth - contentGapRight - toolsOffsetWidth - toolsFormOffsetWidth);
|
|
285
|
-
}, [isNavigationOpen, isToolsOpen, layoutWidth, mainOffsetLeft, minContentWidth, toolsWidth]);
|
|
286
289
|
/**
|
|
287
290
|
* Because the notifications slot does not give us any direction insight into
|
|
288
291
|
* what the state of the child content is we need to have a mechanism for
|
|
@@ -316,29 +319,83 @@ export const AppLayoutInternalsProvider = React.forwardRef((_a, forwardRef) => {
|
|
|
316
319
|
offsetBottom += splitPanelReportedHeaderHeight;
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
|
-
|
|
322
|
+
/**
|
|
323
|
+
* Warning! This is a hack! In order to accurately calculate if there is adequate
|
|
324
|
+
* horizontal space for the Split Panel to be in the side position we need two values
|
|
325
|
+
* that are not available in JavaScript.
|
|
326
|
+
*
|
|
327
|
+
* The first is the the content gap on the right which is stored in a design token
|
|
328
|
+
* and applied in the Layout CSS:
|
|
329
|
+
*
|
|
330
|
+
* $contentGapRight: #{awsui.$space-scaled-2x-xxxl};
|
|
331
|
+
*
|
|
332
|
+
* The second is the width of the element that has the circular buttons for the
|
|
333
|
+
* Tools and Split Panel. This could be suppressed given the state of the Tools
|
|
334
|
+
* drawer returning a zero value. It would, however, be rendered if the Split Panel
|
|
335
|
+
* were to move into the side position. This is calculated in the Tools CSS and
|
|
336
|
+
* the Trigger button CSS with design tokens:
|
|
337
|
+
*
|
|
338
|
+
* padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;
|
|
339
|
+
* width: awsui.$space-layout-toggle-diameter;
|
|
340
|
+
*
|
|
341
|
+
* These values will be defined below as static integers that are rough approximations
|
|
342
|
+
* of their computed width when rendered in the DOM, but doubled to ensure adequate
|
|
343
|
+
* spacing for the Split Panel to be in side position.
|
|
344
|
+
*/
|
|
345
|
+
useLayoutEffect(function handleSplitPanelMaxWidth() {
|
|
346
|
+
const contentGapRight = 80; // Approximately 40px when rendered but doubled for safety
|
|
347
|
+
const toolsFormOffsetWidth = 160; // Approximately 80px when rendered but doubled for safety
|
|
348
|
+
const toolsOffsetWidth = isToolsOpen ? toolsWidth : 0;
|
|
349
|
+
const activeDrawerOffsetWidth = activeDrawerId ? activeDrawerWidth : 0;
|
|
350
|
+
setSplitPanelMaxWidth(layoutWidth -
|
|
351
|
+
mainOffsetLeft -
|
|
352
|
+
minContentWidth -
|
|
353
|
+
contentGapRight -
|
|
354
|
+
toolsOffsetWidth -
|
|
355
|
+
toolsFormOffsetWidth -
|
|
356
|
+
activeDrawerOffsetWidth);
|
|
357
|
+
}, [
|
|
358
|
+
activeDrawerId,
|
|
359
|
+
activeDrawerWidth,
|
|
360
|
+
isNavigationOpen,
|
|
361
|
+
isToolsOpen,
|
|
362
|
+
layoutWidth,
|
|
363
|
+
mainOffsetLeft,
|
|
364
|
+
minContentWidth,
|
|
365
|
+
toolsWidth,
|
|
366
|
+
]);
|
|
367
|
+
return (React.createElement(AppLayoutInternalsContext.Provider, { value: Object.assign(Object.assign({}, props), { activeDrawerId,
|
|
368
|
+
activeDrawerWidth,
|
|
369
|
+
contentType,
|
|
370
|
+
drawers,
|
|
371
|
+
drawersRefs,
|
|
372
|
+
drawersTriggerCount,
|
|
320
373
|
dynamicOverlapHeight,
|
|
321
374
|
headerHeight,
|
|
322
375
|
footerHeight,
|
|
323
376
|
hasDefaultToolsWidth,
|
|
377
|
+
hasDrawerViewportOverlay,
|
|
378
|
+
handleDrawersClick,
|
|
324
379
|
handleNavigationClick,
|
|
325
380
|
handleSplitPanelClick,
|
|
326
381
|
handleSplitPanelPreferencesChange,
|
|
327
382
|
handleSplitPanelResize,
|
|
328
383
|
handleToolsClick,
|
|
329
384
|
hasNotificationsContent,
|
|
385
|
+
hasOpenDrawer,
|
|
330
386
|
hasStickyBackground,
|
|
331
|
-
isAnyPanelOpen,
|
|
332
387
|
isMobile, isNavigationOpen: isNavigationOpen !== null && isNavigationOpen !== void 0 ? isNavigationOpen : false, isSplitPanelForcedPosition,
|
|
333
388
|
isSplitPanelOpen,
|
|
334
389
|
isToolsOpen,
|
|
335
390
|
layoutElement,
|
|
336
391
|
layoutWidth,
|
|
392
|
+
loseToolsFocus,
|
|
337
393
|
mainElement,
|
|
338
394
|
mainOffsetLeft,
|
|
339
395
|
maxContentWidth,
|
|
340
396
|
minContentWidth,
|
|
341
397
|
navigationHide,
|
|
398
|
+
navigationRefs,
|
|
342
399
|
notificationsElement,
|
|
343
400
|
notificationsHeight,
|
|
344
401
|
offsetBottom,
|
|
@@ -359,9 +416,7 @@ export const AppLayoutInternalsProvider = React.forwardRef((_a, forwardRef) => {
|
|
|
359
416
|
setSplitPanelToggle,
|
|
360
417
|
splitPanelRefs,
|
|
361
418
|
toolsHide, toolsOpen: isToolsOpen, toolsWidth,
|
|
362
|
-
toolsRefs,
|
|
363
|
-
navigationRefs,
|
|
364
|
-
loseToolsFocus }) },
|
|
419
|
+
toolsRefs }) },
|
|
365
420
|
React.createElement(AppLayoutContext.Provider, { value: {
|
|
366
421
|
stickyOffsetBottom: offsetBottom,
|
|
367
422
|
stickyOffsetTop: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/context.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,UAAU,GACX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAoB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,E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T,SAAS,EAAE,WAAW,EACtB,UAAU;YACV,SAAS;YACT,cAAc;YACd,cAAc;QAGhB,oBAAC,gBAAgB,CAAC,QAAQ,IACxB,KAAK,EAAE;gBACL,kBAAkB,EAAE,YAAY;gBAChC,eAAe,EAAE,CAAC;gBAClB,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW;gBACnC,sBAAsB;gBACtB,uBAAuB;aACxB,IAEA,QAAQ,CACiB,CACO,CACtC,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, {\n createContext,\n useCallback,\n useEffect,\n useLayoutEffect,\n useImperativeHandle,\n useRef,\n useState,\n useContext,\n} from 'react';\nimport { AppLayoutProps } from '../interfaces';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { getSplitPanelPosition } from './split-panel';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useContainerQuery } from '../../internal/hooks/container-queries';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport styles from './styles.css.js';\nimport { isDevelopment } from '../../internal/is-development';\nimport { warnOnce } from '../../internal/logging';\nimport { applyDefaults } from '../defaults';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport { useObservedElement } from '../utils/use-observed-element';\nimport { AppLayoutContext } from '../../internal/context/app-layout-context';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\n\ninterface AppLayoutInternals extends AppLayoutProps {\n dynamicOverlapHeight: number;\n handleSplitPanelClick: () => void;\n handleNavigationClick: (isOpen: boolean) => void;\n handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;\n handleSplitPanelResize: (detail: { size: number }) => void;\n handleToolsClick: (value: boolean) => void;\n hasDefaultToolsWidth: boolean;\n hasNotificationsContent: boolean;\n hasStickyBackground: boolean;\n isAnyPanelOpen: boolean;\n isMobile: boolean;\n isNavigationOpen: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref<HTMLElement>;\n layoutWidth: number;\n mainElement: React.Ref<HTMLDivElement>;\n mainOffsetLeft: number;\n notificationsElement: React.Ref<HTMLDivElement>;\n notificationsHeight: number;\n offsetBottom: number;\n setDynamicOverlapHeight: (value: number) => void;\n setHasStickyBackground: (value: boolean) => void;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelMaxWidth: number;\n splitPanelMinWidth: number;\n splitPanelPosition: AppLayoutProps.SplitPanelPosition;\n splitPanelReportedSize: number;\n splitPanelReportedHeaderHeight: number;\n splitPanelToggle: SplitPanelSideToggleProps;\n setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;\n splitPanelDisplayed: boolean;\n splitPanelRefs: SplitPanelFocusControlRefs;\n navigationRefs: FocusControlRefs;\n toolsRefs: FocusControlRefs;\n loseToolsFocus: () => void;\n}\n\n/**\n * The default values are destructured in the context instantiation to\n * prevent downstream Typescript errors. This could likely be replaced\n * by a context interface definition that extends the AppLayout interface.\n */\nconst AppLayoutInternalsContext = createContext<AppLayoutInternals | null>(null);\n\ninterface AppLayoutProviderInternalsProps extends AppLayoutProps {\n children: React.ReactNode;\n}\n\nexport function useAppLayoutInternals() {\n const ctx = useContext(AppLayoutInternalsContext);\n if (!ctx) {\n throw new Error('Invariant violation: this context is only available inside app layout');\n }\n return ctx;\n}\n\nexport const AppLayoutInternalsProvider = React.forwardRef(\n (\n {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen: controlledNavigationOpen,\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #h',\n children,\n splitPanel,\n ...props\n }: AppLayoutProviderInternalsProps,\n forwardRef: React.Ref<AppLayoutProps.Ref>\n ) => {\n const isMobile = useMobile();\n\n if (isDevelopment) {\n if (controlledToolsOpen && toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n\n /**\n * The overlap height has a default set in CSS but can also be dynamically overridden\n * for content types (such as Table and Wizard) that have variable size content in the overlap.\n * If a child component utilizes a sticky header the hasStickyBackground property will determine\n * if the background remains in the same vertical position.\n */\n const [dynamicOverlapHeight, setDynamicOverlapHeight] = useState(0);\n const [hasStickyBackground, setHasStickyBackground] = useState(false);\n\n /**\n * Set the default values for minimum and maximum content width.\n */\n const geckoMaxCssLength = ((1 << 30) - 1) / 60;\n const halfGeckoMaxCssLength = geckoMaxCssLength / 2;\n // CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n // Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n const maxContentWidth =\n props.maxContentWidth && props.maxContentWidth > halfGeckoMaxCssLength\n ? halfGeckoMaxCssLength\n : props.maxContentWidth ?? 0;\n const minContentWidth = props.minContentWidth ?? 280;\n\n /**\n * Determine the default state of the Navigation and Tools drawers.\n * Mobile viewports should be closed by default under all circumstances.\n * If the navigationOpen prop has been set then that should take precedence\n * over the contentType prop. Desktop viewports that do not have the\n * navigationOpen or contentType props set will use the default contentType.\n */\n const contentTypeDefaults = applyDefaults(contentType, { maxContentWidth, minContentWidth }, true);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Navigation drawer. The logic\n * for determining the default state is colocated with the Navigation component.\n *\n * The callback that will be passed to the Navigation and AppBar\n * components to handle the click events that will change the state\n * of the Navigation drawer. It will set the Navigation state with the\n * useControllable hook and also fire the onNavigationChange function to\n * emit the state change.\n */\n const [isNavigationOpen = false, setIsNavigationOpen] = useControllable(\n controlledNavigationOpen,\n props.onNavigationChange,\n isMobile ? false : contentTypeDefaults.navigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(isNavigationOpen);\n\n const handleNavigationClick = useCallback(\n function handleNavigationChange(isOpen: boolean) {\n setIsNavigationOpen(isOpen);\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n },\n [props.onNavigationChange, setIsNavigationOpen, focusNavButtons]\n );\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Tools drawer. The logic\n * for determining the default state is colocated with the Tools component.\n *\n * The callback that will be passed to the Navigation and AppBar\n * components to handle the click events that will change the state\n * of the Tools drawer. It will set the Tools state with the\n * useControllable hook and also fire the onToolsChange function to\n * emit the state change.\n */\n const toolsWidth = props.toolsWidth ?? 290;\n const hasDefaultToolsWidth = props.toolsWidth === undefined;\n\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(\n controlledToolsOpen,\n props.onToolsChange,\n isMobile ? false : contentTypeDefaults.toolsOpen,\n { componentName: 'AppLayout', controlledProp: 'toolsOpen', changeHandler: 'onToolsChange' }\n );\n\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(isToolsOpen, true);\n\n const handleToolsClick = useCallback(\n function handleToolsChange(isOpen: boolean) {\n setIsToolsOpen(isOpen);\n focusToolsButtons();\n fireNonCancelableEvent(props.onToolsChange, { open: isOpen });\n },\n [props.onToolsChange, setIsToolsOpen, focusToolsButtons]\n );\n\n const navigationVisible = !navigationHide && isNavigationOpen;\n const toolsVisible = !toolsHide && isToolsOpen;\n const isAnyPanelOpen = navigationVisible || toolsVisible;\n\n /**\n * On mobile viewports the navigation and tools drawers are adjusted to a fixed position\n * that consumes 100% of the viewport height and width. The body content could potentially\n * be scrollable underneath the drawer. In order to prevent this a CSS class needs to be\n * added to the document body that sets overflow to hidden.\n */\n useEffect(\n function handleBodyScroll() {\n if (isMobile && (isNavigationOpen || isToolsOpen)) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n\n // Ensure the CSS class is removed from the body on side effect cleanup\n return function cleanup() {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n },\n [isMobile, isNavigationOpen, isToolsOpen]\n );\n\n /**\n * The useImperativeHandle hook in conjunction with the forwardRef function\n * in the AppLayout component definition expose the following callable\n * functions to component consumers when they put a ref as a property on\n * their component implementation.\n */\n useImperativeHandle(\n forwardRef,\n function createImperativeHandle() {\n return {\n closeNavigationIfNecessary: function () {\n isMobile && handleNavigationClick(false);\n },\n openTools: function () {\n handleToolsClick(true);\n },\n focusToolsClose: () => focusToolsButtons(true),\n };\n },\n [isMobile, handleNavigationClick, handleToolsClick, focusToolsButtons]\n );\n\n /**\n * Query the DOM for the header and footer elements based on the selectors provided\n * by the properties and pass the heights to the custom property definitions.\n */\n const headerHeight = useObservedElement(headerSelector);\n const footerHeight = useObservedElement(footerSelector);\n\n /**\n * Set the default values for the minimum and maximum Split Panel width when it is\n * in the side position. The useLayoutEffect will compute the available space in the\n * DOM for the Split Panel given the current state. The minimum and maximum\n * widths will potentially trigger a side effect that will put the Split Panel into\n * a forced position on the bottom.\n */\n const splitPanelMinWidth = 280;\n const [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(splitPanelMinWidth);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Split Panel. By default\n * the Split Panel should always be closed on page load.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the click events that will change the state of the SplitPanel\n * to open or closed given the current state. It will set the isSplitPanelOpen\n * controlled state and fire the onSplitPanelToggle event.\n */\n const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(\n props.splitPanelOpen,\n props.onSplitPanelToggle,\n false,\n { componentName: 'AppLayout', controlledProp: 'splitPanelOpen', changeHandler: 'onSplitPanelToggle' }\n );\n\n /**\n * The useControllable hook will manage the controlled or uncontrolled\n * state of the splitPanelPreferences. By default the splitPanelPreferences\n * is undefined. When set the object shape should have a single key to indicate\n * either bottom or side position.\n *\n * The callback that will handle changes to the splitPanelPreferences\n * object that will determine if the SplitPanel is rendered either on the\n * bottom of the viewport or within the Tools container.\n */\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n props.splitPanelPreferences,\n props.onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n isSplitPanelOpen,\n ]);\n\n const handleSplitPanelClick = useCallback(\n function handleSplitPanelChange() {\n setIsSplitPanelOpen(!isSplitPanelOpen);\n setSplitPanelLastInteraction({ type: isSplitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(props.onSplitPanelToggle, { open: !isSplitPanelOpen });\n },\n [props.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]\n );\n\n /**\n * The Split Panel will be in forced (bottom) position if the defined minimum width is\n * greater than the maximum width. In other words, the maximum width is the currently\n * available horizontal space based on all other components that are rendered. If the\n * minimum width exceeds this value then there is not enough horizontal space and we must\n * force it to the bottom position.\n */\n const [isSplitPanelForcedPosition, setSplitPanelForcedPosition] = useState(false);\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\n\n useLayoutEffect(\n function handleSplitPanelForcePosition() {\n setSplitPanelForcedPosition(splitPanelMinWidth > splitPanelMaxWidth);\n },\n [splitPanelMaxWidth, splitPanelMinWidth]\n );\n\n /**\n * The useControllable hook will set the default size of the SplitPanel based\n * on the default position set in the splitPanelPreferences. The logic for the\n * default size is contained in the SplitPanel component. The splitPanelControlledSize\n * will be bound to the size property in the SplitPanel context for rendering.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the resize events that will change the size of the SplitPanel.\n * It will set the splitPanelControlledSize controlled state and fire the\n * onSplitPanelResize event.\n */\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n const [splitPanelToggle, setSplitPanelToggle] = useState<SplitPanelSideToggleProps>({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen);\n\n const [splitPanelSize, setSplitPanelSize] = useControllable(\n props.splitPanelSize,\n props.onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPosition),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const handleSplitPanelResize = useCallback(\n function handleSplitPanelChange(detail: { size: number }) {\n setSplitPanelSize(detail.size);\n fireNonCancelableEvent(props.onSplitPanelResize, detail);\n },\n [props.onSplitPanelResize, setSplitPanelSize]\n );\n\n const handleSplitPanelPreferencesChange = useCallback(\n function handleSplitPanelChange(detail: AppLayoutProps.SplitPanelPreferences) {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);\n },\n [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]\n );\n\n /**\n * The Layout element is not necessarily synonymous with the client\n * viewport width. There can be content in the horizontal viewport\n * that exists on either side of the AppLayout. This resize observer\n * will set the custom property of the Layout element width that\n * is used for various horizontal constraints such as the maximum\n * allowed width of the Tools container.\n *\n * The offsetLeft of the Main will return the distance that the\n * Main element has from the left edge of the Layout component.\n * The offsetLeft value can vary based on the presence and state\n * of the Navigation as well as content gaps in the grid definition.\n * This value is used to determine the max width constraint calculation\n * for the Tools container.\n */\n const [layoutContainerQuery, layoutElement] = useContainerQuery(rect => rect.width);\n const layoutWidth = layoutContainerQuery ?? 0;\n\n const mainElement = useRef<HTMLDivElement>(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n setMainOffsetLeft(mainElement?.current?.offsetLeft ?? 0);\n },\n [layoutWidth, isNavigationOpen, isToolsOpen, splitPanelReportedSize]\n );\n\n useLayoutEffect(\n function handleSplitPanelMaxWidth() {\n /**\n * Warning! This is a hack! In order to accurately calculate if there is adequate\n * horizontal space for the Split Panel to be in the side position we need two values\n * that are not available in JavaScript.\n *\n * The first is the the content gap on the right which is stored in a design token\n * and applied in the Layout CSS:\n *\n * $contentGapRight: #{awsui.$space-scaled-2x-xxxl};\n *\n * The second is the width of the element that has the circular buttons for the\n * Tools and Split Panel. This could be suppressed given the state of the Tools\n * drawer returning a zero value. It would, however, be rendered if the Split Panel\n * were to move into the side position. This is calculated in the Tools CSS and\n * the Trigger button CSS with design tokens:\n *\n * padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;\n * width: awsui.$space-layout-toggle-diameter;\n *\n * These values will be defined below as static integers that are rough approximations\n * of their computed width when rendered in the DOM, but doubled to ensure adequate\n * spacing for the Split Panel to be in side position.\n */\n const contentGapRight = 80; // Approximately 40px when rendered but doubled for safety\n const toolsFormOffsetWidth = 160; // Approximately 80px when rendered but doubled for safety\n const toolsOffsetWidth = isToolsOpen ? toolsWidth : 0;\n\n setSplitPanelMaxWidth(\n layoutWidth - mainOffsetLeft - minContentWidth - contentGapRight - toolsOffsetWidth - toolsFormOffsetWidth\n );\n },\n [isNavigationOpen, isToolsOpen, layoutWidth, mainOffsetLeft, minContentWidth, toolsWidth]\n );\n\n /**\n * Because the notifications slot does not give us any direction insight into\n * what the state of the child content is we need to have a mechanism for\n * tracking the height of the notifications and whether or not it has content.\n * The height of the notifications is an integer that will be used as a custom\n * property on the Layout component to determine what the sticky offset should\n * be if there are sticky notifications. This could be any number including\n * zero based on how the child content renders. The hasNotificationsContent boolean\n * is simply centralizing the logic of the notifications height being > 0 such\n * that it is not repeated in various components (such as AppBar) that need to\n * know if the notifications slot is empty.\n */\n const [notificationsContainerQuery, notificationsElement] = useContainerQuery(rect => rect.height);\n const [notificationsHeight, setNotificationsHeight] = useState(0);\n const [hasNotificationsContent, setHasNotificationsContent] = useState(false);\n\n useEffect(\n function handleNotificationsContent() {\n setNotificationsHeight(notificationsContainerQuery ?? 0);\n setHasNotificationsContent(notificationsContainerQuery && notificationsContainerQuery > 0 ? true : false);\n },\n [notificationsContainerQuery]\n );\n\n /**\n * Determine the offsetBottom value based on the presence of a footer element and\n * the SplitPanel component. Ignore the SplitPanel if it is not in the bottom\n * position. Use the size property if it is open and the header height if it is closed.\n */\n let offsetBottom = footerHeight;\n if (splitPanelDisplayed && splitPanelPosition === 'bottom') {\n if (isSplitPanelOpen) {\n offsetBottom += splitPanelReportedSize;\n } else {\n offsetBottom += splitPanelReportedHeaderHeight;\n }\n }\n\n return (\n <AppLayoutInternalsContext.Provider\n value={{\n ...props,\n contentType,\n dynamicOverlapHeight,\n headerHeight,\n footerHeight,\n hasDefaultToolsWidth,\n handleNavigationClick,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n handleToolsClick,\n hasNotificationsContent,\n hasStickyBackground,\n isAnyPanelOpen,\n isMobile,\n isNavigationOpen: isNavigationOpen ?? false,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth,\n mainElement,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n notificationsElement,\n notificationsHeight,\n offsetBottom,\n setDynamicOverlapHeight,\n setHasStickyBackground,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanel,\n splitPanelDisplayed,\n splitPanelMaxWidth,\n splitPanelMinWidth,\n splitPanelPosition,\n splitPanelPreferences,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n splitPanelSize,\n splitPanelToggle,\n setSplitPanelToggle,\n splitPanelRefs,\n toolsHide,\n toolsOpen: isToolsOpen,\n toolsWidth,\n toolsRefs,\n navigationRefs,\n loseToolsFocus,\n }}\n >\n <AppLayoutContext.Provider\n value={{\n stickyOffsetBottom: offsetBottom,\n stickyOffsetTop: 0, // not used in this design. Sticky headers read a CSS-var instead\n hasBreadcrumbs: !!props.breadcrumbs,\n setHasStickyBackground,\n setDynamicOverlapHeight,\n }}\n >\n {children}\n </AppLayoutContext.Provider>\n </AppLayoutInternalsContext.Provider>\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/context.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,MAAM,EACN,QAAQ,EACR,UAAU,GACX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAG7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAoB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAA8B,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAE/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D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AAa;YACb,WAAW;YACX,cAAc;YACd,WAAW;YACX,cAAc;YACd,eAAe;YACf,eAAe;YACf,cAAc;YACd,cAAc;YACd,oBAAoB;YACpB,mBAAmB;YACnB,YAAY;YACZ,uBAAuB;YACvB,sBAAsB;YACtB,yBAAyB;YACzB,iCAAiC;YACjC,UAAU;YACV,mBAAmB;YACnB,kBAAkB;YAClB,kBAAkB;YAClB,kBAAkB;YAClB,qBAAqB;YACrB,sBAAsB;YACtB,8BAA8B;YAC9B,cAAc;YACd,gBAAgB;YAChB,mBAAmB;YACnB,cAAc;YACd,SAAS,EACT,SAAS,EAAE,WAAW,EACtB,UAAU;YACV,SAAS;QAGX,oBAAC,gBAAgB,CAAC,QAAQ,IACxB,KAAK,EAAE;gBACL,kBAAkB,EAAE,YAAY;gBAChC,eAAe,EAAE,CAAC;gBAClB,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW;gBACnC,sBAAsB;gBACtB,uBAAuB;aACxB,IAEA,QAAQ,CACiB,CACO,CACtC,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, {\n createContext,\n useCallback,\n useEffect,\n useLayoutEffect,\n useImperativeHandle,\n useRef,\n useState,\n useContext,\n} from 'react';\nimport { applyDefaults } from '../defaults';\nimport { AppLayoutContext } from '../../internal/context/app-layout-context';\nimport { AppLayoutProps } from '../interfaces';\nimport { DrawersProps } from './drawers';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { isDevelopment } from '../../internal/is-development';\nimport { getSplitPanelPosition } from './split-panel';\nimport { useContainerQuery } from '../../internal/hooks/container-queries';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { useObservedElement } from '../utils/use-observed-element';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { warnOnce } from '../../internal/logging';\nimport styles from './styles.css.js';\n\ninterface AppLayoutInternals extends AppLayoutProps {\n activeDrawerId: string | null;\n activeDrawerWidth: number;\n drawers: DrawersProps;\n drawersRefs: FocusControlRefs;\n drawersTriggerCount: number;\n dynamicOverlapHeight: number;\n handleDrawersClick: (activeDrawerId: string | null, skipFocusControl?: boolean) => void;\n handleSplitPanelClick: () => void;\n handleNavigationClick: (isOpen: boolean) => void;\n handleSplitPanelPreferencesChange: (detail: AppLayoutProps.SplitPanelPreferences) => void;\n handleSplitPanelResize: (detail: { size: number }) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasDefaultToolsWidth: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer: boolean;\n hasStickyBackground: boolean;\n isMobile: boolean;\n isNavigationOpen: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref<HTMLElement>;\n layoutWidth: number;\n loseToolsFocus: () => void;\n mainElement: React.Ref<HTMLDivElement>;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsElement: React.Ref<HTMLDivElement>;\n notificationsHeight: number;\n offsetBottom: number;\n setDynamicOverlapHeight: (value: number) => void;\n setHasStickyBackground: (value: boolean) => void;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelMaxWidth: number;\n splitPanelMinWidth: number;\n splitPanelPosition: AppLayoutProps.SplitPanelPosition;\n splitPanelReportedSize: number;\n splitPanelReportedHeaderHeight: number;\n splitPanelToggle: SplitPanelSideToggleProps;\n setSplitPanelToggle: (toggle: SplitPanelSideToggleProps) => void;\n splitPanelDisplayed: boolean;\n splitPanelRefs: SplitPanelFocusControlRefs;\n toolsRefs: FocusControlRefs;\n}\n\n/**\n * The default values are destructured in the context instantiation to\n * prevent downstream Typescript errors. This could likely be replaced\n * by a context interface definition that extends the AppLayout interface.\n */\nconst AppLayoutInternalsContext = createContext<AppLayoutInternals | null>(null);\n\ninterface AppLayoutProviderInternalsProps extends AppLayoutProps {\n children: React.ReactNode;\n}\n\nexport function useAppLayoutInternals() {\n const ctx = useContext(AppLayoutInternalsContext);\n if (!ctx) {\n throw new Error('Invariant violation: this context is only available inside app layout');\n }\n return ctx;\n}\n\nexport const AppLayoutInternalsProvider = React.forwardRef(\n (\n {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen: controlledNavigationOpen,\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #h',\n children,\n splitPanel,\n ...props\n }: AppLayoutProviderInternalsProps,\n forwardRef: React.Ref<AppLayoutProps.Ref>\n ) => {\n const isMobile = useMobile();\n\n if (isDevelopment) {\n if (controlledToolsOpen && toolsHide) {\n warnOnce(\n 'AppLayout',\n `You have enabled both the \\`toolsOpen\\` prop and the \\`toolsHide\\` prop. This is not supported. Set \\`toolsOpen\\` to \\`false\\` when you set \\`toolsHide\\` to \\`true\\`.`\n );\n }\n }\n\n /**\n * The overlap height has a default set in CSS but can also be dynamically overridden\n * for content types (such as Table and Wizard) that have variable size content in the overlap.\n * If a child component utilizes a sticky header the hasStickyBackground property will determine\n * if the background remains in the same vertical position.\n */\n const [dynamicOverlapHeight, setDynamicOverlapHeight] = useState(0);\n const [hasStickyBackground, setHasStickyBackground] = useState(false);\n\n /**\n * Set the default values for minimum and maximum content width.\n */\n const geckoMaxCssLength = ((1 << 30) - 1) / 60;\n const halfGeckoMaxCssLength = geckoMaxCssLength / 2;\n // CSS lengths in Gecko are limited to at most (1<<30)-1 app units (Gecko uses 60 as app unit).\n // Limit the maxContentWidth to the half of the upper boundary (≈4230^2) to be on the safe side.\n const maxContentWidth =\n props.maxContentWidth && props.maxContentWidth > halfGeckoMaxCssLength\n ? halfGeckoMaxCssLength\n : props.maxContentWidth ?? 0;\n const minContentWidth = props.minContentWidth ?? 280;\n\n /**\n * Determine the default state of the Navigation and Tools drawers.\n * Mobile viewports should be closed by default under all circumstances.\n * If the navigationOpen prop has been set then that should take precedence\n * over the contentType prop. Desktop viewports that do not have the\n * navigationOpen or contentType props set will use the default contentType.\n */\n const contentTypeDefaults = applyDefaults(contentType, { maxContentWidth, minContentWidth }, true);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Navigation drawer. The logic\n * for determining the default state is colocated with the Navigation component.\n *\n * The callback that will be passed to the Navigation and AppBar\n * components to handle the click events that will change the state\n * of the Navigation drawer. It will set the Navigation state with the\n * useControllable hook and also fire the onNavigationChange function to\n * emit the state change.\n */\n const [isNavigationOpen = false, setIsNavigationOpen] = useControllable(\n controlledNavigationOpen,\n props.onNavigationChange,\n isMobile ? false : contentTypeDefaults.navigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n\n const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(isNavigationOpen);\n\n const handleNavigationClick = useCallback(\n function handleNavigationChange(isOpen: boolean) {\n setIsNavigationOpen(isOpen);\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n },\n [props.onNavigationChange, setIsNavigationOpen, focusNavButtons]\n );\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Tools drawer. The logic\n * for determining the default state is colocated with the Tools component.\n *\n * The callback that will be passed to the Navigation and AppBar\n * components to handle the click events that will change the state\n * of the Tools drawer. It will set the Tools state with the\n * useControllable hook and also fire the onToolsChange function to\n * emit the state change.\n */\n const toolsWidth = props.toolsWidth ?? 290;\n const hasDefaultToolsWidth = props.toolsWidth === undefined;\n\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(\n controlledToolsOpen,\n props.onToolsChange,\n isMobile ? false : contentTypeDefaults.toolsOpen,\n { componentName: 'AppLayout', controlledProp: 'toolsOpen', changeHandler: 'onToolsChange' }\n );\n\n const {\n refs: toolsRefs,\n setFocus: focusToolsButtons,\n loseFocus: loseToolsFocus,\n } = useFocusControl(isToolsOpen, true);\n\n const handleToolsClick = useCallback(\n function handleToolsChange(isOpen: boolean, skipFocusControl?: boolean) {\n setIsToolsOpen(isOpen);\n !skipFocusControl && focusToolsButtons();\n fireNonCancelableEvent(props.onToolsChange, { open: isOpen });\n },\n [props.onToolsChange, setIsToolsOpen, focusToolsButtons]\n );\n\n /**\n * On mobile viewports the navigation and tools drawers are adjusted to a fixed position\n * that consumes 100% of the viewport height and width. The body content could potentially\n * be scrollable underneath the drawer. In order to prevent this a CSS class needs to be\n * added to the document body that sets overflow to hidden.\n */\n useEffect(\n function handleBodyScroll() {\n if (isMobile && (isNavigationOpen || isToolsOpen)) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n\n // Ensure the CSS class is removed from the body on side effect cleanup\n return function cleanup() {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n },\n [isMobile, isNavigationOpen, isToolsOpen]\n );\n\n /**\n * The useImperativeHandle hook in conjunction with the forwardRef function\n * in the AppLayout component definition expose the following callable\n * functions to component consumers when they put a ref as a property on\n * their component implementation.\n */\n useImperativeHandle(\n forwardRef,\n function createImperativeHandle() {\n return {\n closeNavigationIfNecessary: function () {\n isMobile && handleNavigationClick(false);\n },\n openTools: function () {\n handleToolsClick(true);\n },\n focusToolsClose: () => focusToolsButtons(true),\n };\n },\n [isMobile, handleNavigationClick, handleToolsClick, focusToolsButtons]\n );\n\n /**\n * Query the DOM for the header and footer elements based on the selectors provided\n * by the properties and pass the heights to the custom property definitions.\n */\n const headerHeight = useObservedElement(headerSelector);\n const footerHeight = useObservedElement(footerSelector);\n\n /**\n * Set the default values for the minimum and maximum Split Panel width when it is\n * in the side position. The useLayoutEffect will compute the available space in the\n * DOM for the Split Panel given the current state. The minimum and maximum\n * widths will potentially trigger a side effect that will put the Split Panel into\n * a forced position on the bottom.\n */\n const splitPanelMinWidth = 280;\n const [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(splitPanelMinWidth);\n\n /**\n * The useControllable hook will set the default value and manage either\n * the controlled or uncontrolled state of the Split Panel. By default\n * the Split Panel should always be closed on page load.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the click events that will change the state of the SplitPanel\n * to open or closed given the current state. It will set the isSplitPanelOpen\n * controlled state and fire the onSplitPanelToggle event.\n */\n const [isSplitPanelOpen, setIsSplitPanelOpen] = useControllable(\n props.splitPanelOpen,\n props.onSplitPanelToggle,\n false,\n { componentName: 'AppLayout', controlledProp: 'splitPanelOpen', changeHandler: 'onSplitPanelToggle' }\n );\n\n /**\n * The useControllable hook will manage the controlled or uncontrolled\n * state of the splitPanelPreferences. By default the splitPanelPreferences\n * is undefined. When set the object shape should have a single key to indicate\n * either bottom or side position.\n *\n * The callback that will handle changes to the splitPanelPreferences\n * object that will determine if the SplitPanel is rendered either on the\n * bottom of the viewport or within the Tools container.\n */\n const [splitPanelPreferences, setSplitPanelPreferences] = useControllable(\n props.splitPanelPreferences,\n props.onSplitPanelPreferencesChange,\n undefined,\n {\n componentName: 'AppLayout',\n controlledProp: 'splitPanelPreferences',\n changeHandler: 'onSplitPanelPreferencesChange',\n }\n );\n\n const { refs: splitPanelRefs, setLastInteraction: setSplitPanelLastInteraction } = useSplitPanelFocusControl([\n splitPanelPreferences,\n isSplitPanelOpen,\n ]);\n\n const handleSplitPanelClick = useCallback(\n function handleSplitPanelChange() {\n setIsSplitPanelOpen(!isSplitPanelOpen);\n setSplitPanelLastInteraction({ type: isSplitPanelOpen ? 'close' : 'open' });\n fireNonCancelableEvent(props.onSplitPanelToggle, { open: !isSplitPanelOpen });\n },\n [props.onSplitPanelToggle, isSplitPanelOpen, setIsSplitPanelOpen, setSplitPanelLastInteraction]\n );\n\n /**\n * The Split Panel will be in forced (bottom) position if the defined minimum width is\n * greater than the maximum width. In other words, the maximum width is the currently\n * available horizontal space based on all other components that are rendered. If the\n * minimum width exceeds this value then there is not enough horizontal space and we must\n * force it to the bottom position.\n */\n const [isSplitPanelForcedPosition, setSplitPanelForcedPosition] = useState(false);\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\n\n useLayoutEffect(\n function handleSplitPanelForcePosition() {\n setSplitPanelForcedPosition(splitPanelMinWidth > splitPanelMaxWidth);\n },\n [splitPanelMaxWidth, splitPanelMinWidth]\n );\n\n /**\n * The useControllable hook will set the default size of the SplitPanel based\n * on the default position set in the splitPanelPreferences. The logic for the\n * default size is contained in the SplitPanel component. The splitPanelControlledSize\n * will be bound to the size property in the SplitPanel context for rendering.\n *\n * The callback that will be passed to the SplitPanel component\n * to handle the resize events that will change the size of the SplitPanel.\n * It will set the splitPanelControlledSize controlled state and fire the\n * onSplitPanelResize event.\n */\n const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);\n const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);\n const [splitPanelToggle, setSplitPanelToggle] = useState<SplitPanelSideToggleProps>({\n displayed: false,\n ariaLabel: undefined,\n });\n const splitPanelDisplayed = !!(splitPanelToggle.displayed || isSplitPanelOpen);\n\n const [splitPanelSize, setSplitPanelSize] = useControllable(\n props.splitPanelSize,\n props.onSplitPanelResize,\n getSplitPanelDefaultSize(splitPanelPosition),\n { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' }\n );\n\n const handleSplitPanelResize = useCallback(\n function handleSplitPanelChange(detail: { size: number }) {\n setSplitPanelSize(detail.size);\n fireNonCancelableEvent(props.onSplitPanelResize, detail);\n },\n [props.onSplitPanelResize, setSplitPanelSize]\n );\n\n const handleSplitPanelPreferencesChange = useCallback(\n function handleSplitPanelChange(detail: AppLayoutProps.SplitPanelPreferences) {\n setSplitPanelPreferences(detail);\n setSplitPanelLastInteraction({ type: 'position' });\n fireNonCancelableEvent(props.onSplitPanelPreferencesChange, detail);\n },\n [props.onSplitPanelPreferencesChange, setSplitPanelPreferences, setSplitPanelLastInteraction]\n );\n\n /**\n * The activeDrawerWidth is required in JavaScript to acccurately calculate whether a SplitPanel\n * in the side position should be forced to the bottom based on available horiziontal space.\n *\n * The handleDrawersClick will either open a new drawer or close the currently open drawer by setting\n * the activeDrawerId value. The active drawer can also be closed if a user clicks the Tools trigger\n * button. This will skip the focus handling because the focus should be going to the Tools close\n * button and not one of the drawers trigger buttons.\n *\n * The drawersTriggerCount is computed in order to determine whether the triggers should be persistent\n * in the UI when a drawer is open. The trigger button container is suppressed when a drawer is open\n * and their is only one trigger button.\n *\n * The hasDrawerViewportOverlay property is used to determine if any drawer is obscuring the entire\n * viewport. This currently applies to Navigation, Tools, and Drawers in mobile viewports.\n */\n const drawers = (props as any).drawers;\n\n const [activeDrawerId, setActiveDrawerId] = useControllable(drawers?.activeDrawerId, drawers?.onChange, null, {\n componentName: 'AppLayout',\n controlledProp: 'drawers.activeDrawerId',\n changeHandler: 'onChange',\n });\n\n const activeDrawerWidth = 290;\n\n const { refs: drawersRefs, setFocus: focusDrawersButtons } = useFocusControl(activeDrawerId);\n\n const handleDrawersClick = useCallback(\n function handleDrawersChange(id: string | null, skipFocusControl?: boolean) {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n setActiveDrawerId(newActiveDrawerId);\n !skipFocusControl && focusDrawersButtons();\n fireNonCancelableEvent(drawers?.onChange, newActiveDrawerId);\n },\n [activeDrawerId, drawers?.onChange, focusDrawersButtons, setActiveDrawerId]\n );\n\n const drawersTriggerCount =\n (drawers?.items.length ?? 0) +\n (splitPanelDisplayed && splitPanelPosition === 'side' ? 1 : 0) +\n (!toolsHide ? 1 : 0);\n const hasOpenDrawer =\n activeDrawerId || isToolsOpen || (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && isNavigationOpen) || (!toolsHide && isToolsOpen));\n\n /**\n * The Layout element is not necessarily synonymous with the client\n * viewport width. There can be content in the horizontal viewport\n * that exists on either side of the AppLayout. This resize observer\n * will set the custom property of the Layout element width that\n * is used for various horizontal constraints such as the maximum\n * allowed width of the Tools container.\n *\n * The offsetLeft of the Main will return the distance that the\n * Main element has from the left edge of the Layout component.\n * The offsetLeft value can vary based on the presence and state\n * of the Navigation as well as content gaps in the grid definition.\n * This value is used to determine the max width constraint calculation\n * for the Tools container.\n */\n const [layoutContainerQuery, layoutElement] = useContainerQuery(rect => rect.width);\n const layoutWidth = layoutContainerQuery ?? 0;\n\n const mainElement = useRef<HTMLDivElement>(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n setMainOffsetLeft(mainElement?.current?.offsetLeft ?? 0);\n },\n [layoutWidth, isNavigationOpen, isToolsOpen, splitPanelReportedSize]\n );\n\n /**\n * Because the notifications slot does not give us any direction insight into\n * what the state of the child content is we need to have a mechanism for\n * tracking the height of the notifications and whether or not it has content.\n * The height of the notifications is an integer that will be used as a custom\n * property on the Layout component to determine what the sticky offset should\n * be if there are sticky notifications. This could be any number including\n * zero based on how the child content renders. The hasNotificationsContent boolean\n * is simply centralizing the logic of the notifications height being > 0 such\n * that it is not repeated in various components (such as AppBar) that need to\n * know if the notifications slot is empty.\n */\n const [notificationsContainerQuery, notificationsElement] = useContainerQuery(rect => rect.height);\n const [notificationsHeight, setNotificationsHeight] = useState(0);\n const [hasNotificationsContent, setHasNotificationsContent] = useState(false);\n\n useEffect(\n function handleNotificationsContent() {\n setNotificationsHeight(notificationsContainerQuery ?? 0);\n setHasNotificationsContent(notificationsContainerQuery && notificationsContainerQuery > 0 ? true : false);\n },\n [notificationsContainerQuery]\n );\n\n /**\n * Determine the offsetBottom value based on the presence of a footer element and\n * the SplitPanel component. Ignore the SplitPanel if it is not in the bottom\n * position. Use the size property if it is open and the header height if it is closed.\n */\n let offsetBottom = footerHeight;\n\n if (splitPanelDisplayed && splitPanelPosition === 'bottom') {\n if (isSplitPanelOpen) {\n offsetBottom += splitPanelReportedSize;\n } else {\n offsetBottom += splitPanelReportedHeaderHeight;\n }\n }\n\n /**\n * Warning! This is a hack! In order to accurately calculate if there is adequate\n * horizontal space for the Split Panel to be in the side position we need two values\n * that are not available in JavaScript.\n *\n * The first is the the content gap on the right which is stored in a design token\n * and applied in the Layout CSS:\n *\n * $contentGapRight: #{awsui.$space-scaled-2x-xxxl};\n *\n * The second is the width of the element that has the circular buttons for the\n * Tools and Split Panel. This could be suppressed given the state of the Tools\n * drawer returning a zero value. It would, however, be rendered if the Split Panel\n * were to move into the side position. This is calculated in the Tools CSS and\n * the Trigger button CSS with design tokens:\n *\n * padding: awsui.$space-scaled-s awsui.$space-layout-toggle-padding;\n * width: awsui.$space-layout-toggle-diameter;\n *\n * These values will be defined below as static integers that are rough approximations\n * of their computed width when rendered in the DOM, but doubled to ensure adequate\n * spacing for the Split Panel to be in side position.\n */\n useLayoutEffect(\n function handleSplitPanelMaxWidth() {\n const contentGapRight = 80; // Approximately 40px when rendered but doubled for safety\n const toolsFormOffsetWidth = 160; // Approximately 80px when rendered but doubled for safety\n const toolsOffsetWidth = isToolsOpen ? toolsWidth : 0;\n const activeDrawerOffsetWidth = activeDrawerId ? activeDrawerWidth : 0;\n\n setSplitPanelMaxWidth(\n layoutWidth -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsOffsetWidth -\n toolsFormOffsetWidth -\n activeDrawerOffsetWidth\n );\n },\n [\n activeDrawerId,\n activeDrawerWidth,\n isNavigationOpen,\n isToolsOpen,\n layoutWidth,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\n );\n\n return (\n <AppLayoutInternalsContext.Provider\n value={{\n ...props,\n activeDrawerId,\n activeDrawerWidth,\n contentType,\n drawers,\n drawersRefs,\n drawersTriggerCount,\n dynamicOverlapHeight,\n headerHeight,\n footerHeight,\n hasDefaultToolsWidth,\n hasDrawerViewportOverlay,\n handleDrawersClick,\n handleNavigationClick,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n handleToolsClick,\n hasNotificationsContent,\n hasOpenDrawer,\n hasStickyBackground,\n isMobile,\n isNavigationOpen: isNavigationOpen ?? false,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth,\n loseToolsFocus,\n mainElement,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n navigationRefs,\n notificationsElement,\n notificationsHeight,\n offsetBottom,\n setDynamicOverlapHeight,\n setHasStickyBackground,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanel,\n splitPanelDisplayed,\n splitPanelMaxWidth,\n splitPanelMinWidth,\n splitPanelPosition,\n splitPanelPreferences,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n splitPanelSize,\n splitPanelToggle,\n setSplitPanelToggle,\n splitPanelRefs,\n toolsHide,\n toolsOpen: isToolsOpen,\n toolsWidth,\n toolsRefs,\n }}\n >\n <AppLayoutContext.Provider\n value={{\n stickyOffsetBottom: offsetBottom,\n stickyOffsetTop: 0, // not used in this design. Sticky headers read a CSS-var instead\n hasBreadcrumbs: !!props.breadcrumbs,\n setHasStickyBackground,\n setDynamicOverlapHeight,\n }}\n >\n {children}\n </AppLayoutContext.Provider>\n </AppLayoutInternalsContext.Provider>\n );\n }\n);\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../icon/interfaces';
|
|
3
|
+
import { NonCancelableEventHandler } from '../../internal/events';
|
|
4
|
+
export interface DrawersProps {
|
|
5
|
+
activeDrawerId?: string;
|
|
6
|
+
items: ReadonlyArray<DrawersProps.Drawer>;
|
|
7
|
+
onChange?: NonCancelableEventHandler<DrawersProps.ChangeDetail>;
|
|
8
|
+
}
|
|
9
|
+
declare namespace DrawersProps {
|
|
10
|
+
export interface Drawer {
|
|
11
|
+
ariaLabels?: Labels;
|
|
12
|
+
content: React.ReactNode;
|
|
13
|
+
id: string;
|
|
14
|
+
trigger: Trigger;
|
|
15
|
+
}
|
|
16
|
+
export interface ChangeDetail {
|
|
17
|
+
activeDrawerId: string | null;
|
|
18
|
+
}
|
|
19
|
+
interface Labels {
|
|
20
|
+
closeButton?: string;
|
|
21
|
+
content?: string;
|
|
22
|
+
triggerButton?: string;
|
|
23
|
+
resizeHandle?: string;
|
|
24
|
+
}
|
|
25
|
+
interface Trigger {
|
|
26
|
+
iconName?: IconProps.Name;
|
|
27
|
+
iconSvg?: React.ReactNode;
|
|
28
|
+
iconUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The Drawers root component is mounted in the AppLayout index file. It will only
|
|
34
|
+
* render if the drawers are defined, and it will take over the mounting of and
|
|
35
|
+
* rendering of the Tools and SplitPanel (side position) if they exist. If drawers
|
|
36
|
+
* do not exist then the Tools and SplitPanel will be handled by the Tools component.
|
|
37
|
+
*/
|
|
38
|
+
export default function Drawers(): JSX.Element | null;
|
|
39
|
+
/**
|
|
40
|
+
* The MobileTriggers will be mounted inside of the AppBar component and
|
|
41
|
+
* only rendered when Drawers are defined in mobile viewports. The same logic
|
|
42
|
+
* will in the AppBar component will suppress the rendering of the legacy
|
|
43
|
+
* trigger button for the Tools drawer.
|
|
44
|
+
*/
|
|
45
|
+
export declare function MobileTriggers(): JSX.Element | null;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=drawers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawers.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAQlE,MAAM,WAAW,YAAY;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,yBAAyB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;CACjE;AAED,kBAAU,YAAY,CAAC;IACrB,MAAM,WAAW,MAAM;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,OAAO,CAAC;KAClB;IAED,MAAM,WAAW,YAAY;QAC3B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;KAC/B;IAED,UAAU,MAAM;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;IACD,UAAU,OAAO;QACf,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;QAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;;CACF;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,uBAsB9B;AAiLD;;;;;GAKG;AACH,wBAAgB,cAAc,uBAsE7B"}
|