@cloudscape-design/components 3.0.732 → 3.0.734
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/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +2 -2
- package/app-layout/index.js.map +1 -1
- package/app-layout/interfaces.d.ts +13 -0
- package/app-layout/interfaces.d.ts.map +1 -1
- package/app-layout/interfaces.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts +1 -1
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/drawers.d.ts +8 -0
- package/app-layout/visual-refresh/drawers.d.ts.map +1 -1
- package/app-layout/visual-refresh/drawers.js +12 -4
- package/app-layout/visual-refresh/drawers.js.map +1 -1
- package/app-layout/visual-refresh/trigger-button.d.ts +8 -1
- package/app-layout/visual-refresh/trigger-button.d.ts.map +1 -1
- package/app-layout/visual-refresh/trigger-button.js +10 -6
- package/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/index.js +7 -3
- package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/index.js +2 -2
- package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts +8 -2
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +3 -4
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
- package/container/index.d.ts.map +1 -1
- package/container/index.js +9 -1
- package/container/index.js.map +1 -1
- package/expandable-section/index.d.ts.map +1 -1
- package/expandable-section/index.js +6 -1
- package/expandable-section/index.js.map +1 -1
- package/file-upload/internal.d.ts.map +1 -1
- package/file-upload/internal.js +15 -8
- package/file-upload/internal.js.map +1 -1
- package/form/index.d.ts.map +1 -1
- package/form/index.js +11 -2
- package/form/index.js.map +1 -1
- package/form/interfaces.d.ts +2 -0
- package/form/interfaces.d.ts.map +1 -1
- package/form/interfaces.js.map +1 -1
- package/form-field/index.d.ts.map +1 -1
- package/form-field/index.js +8 -1
- package/form-field/index.js.map +1 -1
- package/internal/analytics/components/analytics-funnel.d.ts +1 -0
- package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +1 -1
- package/internal/analytics/interfaces.d.ts +2 -1
- package/internal/analytics/interfaces.d.ts.map +1 -1
- package/internal/analytics/interfaces.js.map +1 -1
- package/internal/base-component/index.d.ts +2 -1
- package/internal/base-component/index.d.ts.map +1 -1
- package/internal/components/focus-lock/utils.d.ts +1 -0
- package/internal/components/focus-lock/utils.d.ts.map +1 -1
- package/internal/components/focus-lock/utils.js +3 -0
- package/internal/components/focus-lock/utils.js.map +1 -1
- package/internal/components/token-list/index.d.ts +1 -1
- package/internal/components/token-list/index.d.ts.map +1 -1
- package/internal/components/token-list/index.js +3 -5
- package/internal/components/token-list/index.js.map +1 -1
- package/internal/components/token-list/interfaces.d.ts +0 -1
- package/internal/components/token-list/interfaces.d.ts.map +1 -1
- package/internal/components/token-list/interfaces.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/hooks/use-list-focus-controller.d.ts +11 -0
- package/internal/hooks/use-list-focus-controller.d.ts.map +1 -0
- package/internal/hooks/use-list-focus-controller.js +62 -0
- package/internal/hooks/use-list-focus-controller.js.map +1 -0
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/property-filter/filtering-token/index.d.ts.map +1 -1
- package/property-filter/filtering-token/index.js +20 -6
- package/property-filter/filtering-token/index.js.map +1 -1
- package/property-filter/internal.d.ts.map +1 -1
- package/property-filter/internal.js +16 -6
- package/property-filter/internal.js.map +1 -1
- package/property-filter/token-editor.d.ts.map +1 -1
- package/property-filter/token-editor.js +18 -3
- package/property-filter/token-editor.js.map +1 -1
- package/space-between/internal.d.ts +3 -4
- package/space-between/internal.d.ts.map +1 -1
- package/space-between/internal.js +9 -6
- package/space-between/internal.js.map +1 -1
- package/table/body-cell/styles.css.js +47 -47
- package/table/body-cell/styles.scoped.css +394 -311
- package/table/body-cell/styles.selectors.js +47 -47
- package/table/header-cell/styles.css.js +26 -26
- package/table/header-cell/styles.scoped.css +72 -72
- package/table/header-cell/styles.selectors.js +26 -26
- package/table/index.d.ts.map +1 -1
- package/table/index.js +4 -1
- package/table/index.js.map +1 -1
- package/token-group/internal.d.ts.map +1 -1
- package/token-group/internal.js +17 -6
- package/token-group/internal.js.map +1 -1
- package/wizard/index.d.ts.map +1 -1
- package/wizard/index.js +11 -2
- package/wizard/index.js.map +1 -1
- package/wizard/interfaces.d.ts +2 -0
- package/wizard/interfaces.d.ts.map +1 -1
- package/wizard/interfaces.js.map +1 -1
- package/internal/components/token-list/token-focus-controller.d.ts +0 -5
- package/internal/components/token-list/token-focus-controller.d.ts.map +0 -1
- package/internal/components/token-list/token-focus-controller.js +0 -43
- package/internal/components/token-list/token-focus-controller.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAwGd,CAAC;AAGF,eAAe,SAAS,CAAC"}
|
package/app-layout/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import { AppLayoutInternal } from './internal';
|
|
|
17
17
|
import { useAppLayoutPlacement } from './utils/use-app-layout-placement';
|
|
18
18
|
const AppLayout = React.forwardRef((_a, ref) => {
|
|
19
19
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
20
|
-
var { contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f', navigationWidth = 280, toolsWidth = 290, maxContentWidth, minContentWidth, navigationOpen: controlledNavigationOpen, onNavigationChange: controlledOnNavigationChange } = _a, rest = __rest(_a, ["contentType", "headerSelector", "footerSelector", "navigationWidth", "toolsWidth", "maxContentWidth", "minContentWidth", "navigationOpen", "onNavigationChange"]);
|
|
20
|
+
var { contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f', navigationWidth = 280, toolsWidth = 290, maxContentWidth, minContentWidth, navigationOpen: controlledNavigationOpen, onNavigationChange: controlledOnNavigationChange, analyticsMetadata } = _a, rest = __rest(_a, ["contentType", "headerSelector", "footerSelector", "navigationWidth", "toolsWidth", "maxContentWidth", "minContentWidth", "navigationOpen", "onNavigationChange", "analyticsMetadata"]);
|
|
21
21
|
if (isDevelopment) {
|
|
22
22
|
if (rest.toolsOpen && rest.toolsHide) {
|
|
23
23
|
warnOnce('AppLayout', `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\`.`);
|
|
@@ -41,7 +41,7 @@ const AppLayout = React.forwardRef((_a, ref) => {
|
|
|
41
41
|
drawersCount: (_c = (_b = rest.drawers) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : null,
|
|
42
42
|
hasContentHeader: !!rest.contentHeader,
|
|
43
43
|
},
|
|
44
|
-
});
|
|
44
|
+
}, analyticsMetadata);
|
|
45
45
|
const isRefresh = useVisualRefresh();
|
|
46
46
|
const isMobile = useMobile();
|
|
47
47
|
const i18n = useInternalI18n('app-layout');
|
package/app-layout/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAIzE,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app-layout/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EA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AAC,GAAG,EAAE,GAAG,IAAM,KAAK,EAAI,CACtC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { NonCancelableCustomEvent } from '../internal/events';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { isDevelopment } from '../internal/is-development';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { applyDefaults } from './defaults';\nimport { AppLayoutProps } from './interfaces';\nimport { AppLayoutInternal } from './internal';\nimport { useAppLayoutPlacement } from './utils/use-app-layout-placement';\n\nexport { AppLayoutProps };\n\nconst AppLayout = React.forwardRef(\n (\n {\n contentType = 'default',\n headerSelector = '#b #h',\n footerSelector = '#b #f',\n navigationWidth = 280,\n toolsWidth = 290,\n maxContentWidth,\n minContentWidth,\n navigationOpen: controlledNavigationOpen,\n onNavigationChange: controlledOnNavigationChange,\n analyticsMetadata,\n ...rest\n }: AppLayoutProps,\n ref: React.Ref<AppLayoutProps.Ref>\n ) => {\n if (isDevelopment) {\n if (rest.toolsOpen && rest.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 const { __internalRootRef } = useBaseComponent<HTMLDivElement>(\n 'AppLayout',\n {\n props: {\n contentType,\n disableContentPaddings: rest.disableContentPaddings,\n disableBodyScroll: rest.disableBodyScroll,\n navigationWidth,\n navigationHide: rest.navigationHide,\n toolsHide: rest.toolsHide,\n toolsWidth,\n maxContentWidth,\n minContentWidth,\n stickyNotifications: rest.stickyNotifications,\n disableContentHeaderOverlap: rest.disableContentHeaderOverlap,\n },\n metadata: {\n drawersCount: rest.drawers?.length ?? null,\n hasContentHeader: !!rest.contentHeader,\n },\n },\n analyticsMetadata\n );\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const i18n = useInternalI18n('app-layout');\n const ariaLabels = {\n navigation: i18n('ariaLabels.navigation', rest.ariaLabels?.navigation),\n navigationClose: i18n('ariaLabels.navigationClose', rest.ariaLabels?.navigationClose),\n navigationToggle: i18n('ariaLabels.navigationToggle', rest.ariaLabels?.navigationToggle),\n notifications: i18n('ariaLabels.notifications', rest.ariaLabels?.notifications),\n tools: i18n('ariaLabels.tools', rest.ariaLabels?.tools),\n toolsClose: i18n('ariaLabels.toolsClose', rest.ariaLabels?.toolsClose),\n toolsToggle: i18n('ariaLabels.toolsToggle', rest.ariaLabels?.toolsToggle),\n drawers: i18n('ariaLabels.drawers', rest.ariaLabels?.drawers),\n drawersOverflow: i18n('ariaLabels.drawersOverflow', rest.ariaLabels?.drawersOverflow),\n drawersOverflowWithBadge: i18n('ariaLabels.drawersOverflowWithBadge', rest.ariaLabels?.drawersOverflowWithBadge),\n };\n const { navigationOpen: defaultNavigationOpen, ...restDefaults } = applyDefaults(\n contentType,\n { maxContentWidth, minContentWidth },\n isRefresh\n );\n\n const [navigationOpen = false, setNavigationOpen] = useControllable(\n controlledNavigationOpen,\n controlledOnNavigationChange,\n isMobile ? false : defaultNavigationOpen,\n { componentName: 'AppLayout', controlledProp: 'navigationOpen', changeHandler: 'onNavigationChange' }\n );\n const onNavigationChange = (event: NonCancelableCustomEvent<AppLayoutProps.ChangeDetail>) => {\n setNavigationOpen(event.detail.open);\n controlledOnNavigationChange?.(event);\n };\n\n const [rootRef, placement] = useAppLayoutPlacement(headerSelector, footerSelector);\n\n // This re-builds the props including the default values\n const props = {\n contentType,\n navigationWidth,\n toolsWidth,\n navigationOpen,\n onNavigationChange,\n ...restDefaults,\n ...rest,\n ariaLabels,\n placement,\n };\n\n const baseProps = getBaseProps(rest);\n\n return (\n <div ref={useMergeRefs(__internalRootRef, rootRef)} {...baseProps}>\n <AppLayoutInternal ref={ref} {...props} />\n </div>\n );\n }\n);\n\napplyDisplayName(AppLayout, 'AppLayout');\nexport default AppLayout;\n"]}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IconProps } from '../icon/interfaces';
|
|
3
|
+
import { FlowType } from '../internal/analytics/interfaces';
|
|
3
4
|
import { BaseComponentProps } from '../internal/base-component';
|
|
4
5
|
import { NonCancelableEventHandler } from '../internal/events';
|
|
5
6
|
import { SomeRequired } from '../internal/types';
|
|
6
7
|
export interface AppLayoutProps extends BaseComponentProps {
|
|
8
|
+
/**
|
|
9
|
+
* Specifies additional analytics-related metadata.
|
|
10
|
+
* * `instanceIdentifier` - A unique string that identifies this component instance in your application.
|
|
11
|
+
* * `flowType` - Identifies the type of flow represented by the component.
|
|
12
|
+
* **Note:** This API is currently experimental.
|
|
13
|
+
* @analytics
|
|
14
|
+
*/
|
|
15
|
+
analyticsMetadata?: AppLayoutProps.AnalyticsMetadata;
|
|
7
16
|
/**
|
|
8
17
|
* Determines the default behavior of the component based on some predefined page layouts.
|
|
9
18
|
* Individual properties will always take precedence over the default coming from the content type.
|
|
@@ -212,6 +221,10 @@ export interface AppLayoutProps extends BaseComponentProps {
|
|
|
212
221
|
onSplitPanelPreferencesChange?: NonCancelableEventHandler<AppLayoutProps.SplitPanelPreferences>;
|
|
213
222
|
}
|
|
214
223
|
export declare namespace AppLayoutProps {
|
|
224
|
+
interface AnalyticsMetadata {
|
|
225
|
+
instanceIdentifier?: string;
|
|
226
|
+
flowType?: FlowType;
|
|
227
|
+
}
|
|
215
228
|
type ContentType = 'default' | 'form' | 'table' | 'cards' | 'wizard' | 'dashboard';
|
|
216
229
|
interface Ref {
|
|
217
230
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/app-layout/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;OAEG;IACH,cAAc,CAAC,EAAE,yBAAyB,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IAE9E;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,eAAe,C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M,CAAC;QAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;QAEzB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;KACnC;IAED,UAAiB,YAAY;QAC3B,IAAI,EAAE,OAAO,CAAC;KACf;IAED,UAAiB,sBAAsB;QACrC,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,qBAAqB;QACpC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;KAC7B;IAGD,KAAY,kBAAkB,GAAG,MAAM,GAAG,QAAQ,CAAC;IAEnD,UAAiB,kBAAkB;QACjC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;KAC/B;CACF;AAED,MAAM,MAAM,0BAA0B,GAAG,YAAY,CACnD,IAAI,CAAC,cAAc,EAAE,gBAAgB,GAAG,gBAAgB,CAAC,EACzD,aAAa,GAAG,iBAAiB,GAAG,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,oBAAoB,CAC/G,GAAG;IACF,SAAS,EAAE;QACT,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/app-layout/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { SomeRequired } from '../internal/types';\n\nexport interface AppLayoutProps extends BaseComponentProps {\n /**\n * Determines the default behavior of the component based on some predefined page layouts.\n * Individual properties will always take precedence over the default coming from the content type.\n */\n contentType?: AppLayoutProps.ContentType;\n\n /**\n * Drawers property. If you set both `drawers` and `tools`, `drawers` will take precedence.\n\n * Each Drawer is an item in the drawers wrapper with the following properties:\n * * id (string) - the id of the drawer.\n * * content (React.ReactNode) - the content in the drawer.\n * * trigger (DrawerTrigger) - the button that opens and closes the active drawer.\n * * ariaLabels (DrawerAriaLabels) - the labels for the interactive elements of the drawer.\n * * badge (boolean) - Adds a badge to the corner of the icon to indicate a state change. For example: Unread notifications.\n * * resizable (boolean) - if the drawer is resizable or not.\n * * defaultSize (number) - starting size of the drawer. if not set, defaults to 290.\n * * onResize (({ size: number }) => void) - Fired when the active drawer is resized.\n *\n * #### DrawerTrigger\n * - `iconName` (IconProps.Name) - (Optional) Specifies the icon to be displayed.\n * - `iconSvg` (React.ReactNode) - (Optional) Specifies the SVG of a custom icon. For more information, see [SVG icon guidelines](/components/icon/?tabId=api#slots)\n *\n * #### DrawerAriaLabels\n * - `drawerName` (string) - Label for the drawer itself.\n * - `closeButton` (string) - (Optional) Label for the close button.\n * - `triggerButton` (string) - (Optional) Label for the trigger button.\n * - `resizeHandle` (string) - (Optional) Label for the resize handle.\n */\n drawers?: Array<AppLayoutProps.Drawer>;\n\n /**\n * The active drawer id. If you want to clear the active drawer, use `null`.\n */\n activeDrawerId?: string | null;\n\n /**\n * Fired when the active drawer is toggled.\n */\n onDrawerChange?: NonCancelableEventHandler<AppLayoutProps.DrawerChangeDetail>;\n\n /**\n * If `true`, disables outer paddings for the content slot.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Activates a backwards-compatibility mode for applications with non-fixed headers and footers.\n * @deprecated This layout is being phased out and may miss some features.\n */\n disableBodyScroll?: boolean;\n\n /**\n * State of the navigation drawer.\n */\n navigationOpen?: boolean;\n\n /**\n * Navigation drawer width in pixels.\n */\n navigationWidth?: number;\n\n /**\n * If `true`, the navigation drawer is not displayed at all.\n */\n navigationHide?: boolean;\n\n /**\n * State of the tools drawer.\n */\n toolsOpen?: boolean;\n\n /**\n * If `true`, the tools drawer is not displayed at all.\n */\n toolsHide?: boolean;\n\n /**\n * Tools drawer width in pixels.\n */\n toolsWidth?: number;\n\n /**\n * Maximum main content panel width in pixels.\n *\n * If set to `Number.MAX_VALUE`, the main content panel will occupy the full available width.\n */\n maxContentWidth?: number;\n\n /**\n * Minimum main content panel width in pixels.\n */\n minContentWidth?: number;\n\n /**\n * If true, the notification slot is rendered above the scrollable\n * content area so it is always visible.\n */\n stickyNotifications?: boolean;\n\n /**\n * CSS selector for the application header.\n */\n headerSelector?: string;\n\n /**\n * CSS selector for the application footer.\n */\n footerSelector?: string;\n\n /**\n * Aria labels for the drawer operating buttons. Use this property to ensure accessibility.\n *\n * * `navigation` (string) - Label for the landmark that wraps the navigation drawer.\n * * `navigationClose` (string) - Label for the button that closes the navigation drawer.\n * * `navigationToggle` (string) - Label for the button that opens the navigation drawer.\n * * `notification` (string) - Label for the region that contains notification messages.\n * * `tools` (string) - Label for the landmark that wraps the tools drawer.\n * * `toolsClose` (string) - Label for the button that closes the tools drawer.\n * * `toolsToggle` (string) - Label for the button that opens the tools drawer.\n * * `drawers` (string) - Label for the landmark that wraps the active drawer.\n * * `drawersOverflow` (string) - Label for the ellipsis button with any overflow drawers.\n * * `drawersOverflowWithBadge` (string) - Label for the ellipsis button with any overflow drawers, with a badge.\n *\n * Example:\n * ```\n * {\n * navigation: \"Navigation drawer\",\n * navigationClose: \"Close navigation drawer\",\n * navigationToggle: \"Open navigation drawer\",\n * notifications: \"Notifications\",\n * tools: \"Help panel\",\n * toolsClose: \"Close help panel\",\n * toolsToggle: \"Open help panel\",\n * drawers: \"Drawers\",\n * drawersOverflow: \"Overflow drawers\",\n * drawersOverflowWithBadge: \"Overflow drawers (Unread notifications)\"\n * }\n * ```\n * @i18n\n */\n ariaLabels?: AppLayoutProps.Labels;\n\n /**\n * Navigation drawer.\n */\n navigation?: React.ReactNode;\n\n /**\n * Top area of the page content.\n * @deprecated Replaced by the `header` slot of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n contentHeader?: React.ReactNode;\n\n /**\n * Disables overlap between `contentHeader` and `content` slots.\n * @deprecated Replaced by the `disableOverlap` property of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n disableContentHeaderOverlap?: boolean;\n\n /**\n * Determines the visual treatment for the breadcrumbs and notifications slots. Specifically:\n * * `default` - Does not apply any visual treatment.\n * * `high-contrast` - Applies high-contrast to both slots. Use in conjunction with `headerVariant=\"high-contrast\"` in ContentLayout.\n * @visualrefresh\n */\n headerVariant?: 'default' | 'high-contrast';\n\n /**\n * Main content.\n */\n content?: React.ReactNode;\n\n /**\n * Tools drawer.\n */\n tools?: React.ReactNode;\n\n /**\n * Displayed on top of the main content in the scrollable area.\n *\n * Conceived to contain notifications (flash messages).\n */\n notifications?: React.ReactNode;\n\n /**\n * Use this slot to add the [breadcrumb group component](/components/breadcrumb-group/) to the app layout.\n */\n breadcrumbs?: React.ReactNode;\n\n /**\n * Fired when the navigation drawer is toggled.\n */\n onNavigationChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n\n /**\n * Fired when the tools drawer is toggled.\n */\n onToolsChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n\n /**\n * Use this slot to add the [split panel component](/components/split-panel/) to the app layout.\n *\n * Note: If provided, this property should be set to `null` or `undefined` if a split panel should not be rendered.\n */\n splitPanel?: React.ReactNode;\n\n /**\n * The size of the split panel in pixels.\n */\n splitPanelSize?: number;\n\n /**\n * State of the split panel.\n */\n splitPanelOpen?: boolean;\n /**\n * Controls the split panel preferences.\n *\n * By default, the preference is `{ position: 'bottom' }`\n */\n splitPanelPreferences?: AppLayoutProps.SplitPanelPreferences;\n /**\n * Fired when the split panel is resized.\n */\n onSplitPanelResize?: NonCancelableEventHandler<AppLayoutProps.SplitPanelResizeDetail>;\n /**\n * Fired when the split panel is toggled.\n */\n onSplitPanelToggle?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n /**\n * Fired when the split panel preferences change.\n */\n onSplitPanelPreferencesChange?: NonCancelableEventHandler<AppLayoutProps.SplitPanelPreferences>;\n}\n\nexport namespace AppLayoutProps {\n export type ContentType = 'default' | 'form' | 'table' | 'cards' | 'wizard' | 'dashboard';\n\n export interface Ref {\n /**\n * Manually closes the navigation drawer if it is necessary for the current\n * viewport size.\n */\n closeNavigationIfNecessary(): void;\n\n /**\n * Opens the tools panel if it is not already open. Note that it is preferable\n * to control the state by listening to `toolsChange` and providing `toolsOpen`.\n */\n openTools(): void;\n\n /**\n * Focuses the tools panel if it is open. Use this to focus the tools panel\n * after changing the content, for example when clicking on an 'info' link while\n * the panel is already open.\n */\n focusToolsClose(): void;\n\n /**\n * Focuses the active drawer. Use this to focus the active drawer after opening it programmatically.\n */\n focusActiveDrawer(): void;\n\n /**\n * Focuses the split panel if it is open.\n */\n focusSplitPanel(): void;\n }\n\n export interface Drawer {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerAriaLabels;\n badge?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number }>;\n }\n\n export interface DrawerAriaLabels {\n drawerName: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n }\n\n export interface Labels {\n notifications?: string;\n\n navigation?: string;\n navigationToggle?: string;\n navigationClose?: string;\n\n tools?: string;\n toolsToggle?: string;\n toolsClose?: string;\n\n drawers?: string;\n drawersOverflow?: string;\n drawersOverflowWithBadge?: string;\n }\n\n export interface ChangeDetail {\n open: boolean;\n }\n\n export interface SplitPanelResizeDetail {\n size: number;\n }\n\n export interface SplitPanelPreferences {\n position: 'side' | 'bottom';\n }\n // Duplicated the positions because using this definition in SplitPanelPreferences would display\n // 'AppLayoutProps.SplitPanelPosition' on the API docs instead of the string values.\n export type SplitPanelPosition = 'side' | 'bottom';\n\n export interface DrawerChangeDetail {\n activeDrawerId: string | null;\n }\n}\n\nexport type AppLayoutPropsWithDefaults = SomeRequired<\n Omit<AppLayoutProps, 'headerSelector' | 'footerSelector'>,\n 'contentType' | 'navigationWidth' | 'toolsWidth' | 'minContentWidth' | 'navigationOpen' | 'onNavigationChange'\n> & {\n placement: {\n insetBlockStart: number;\n insetBlockEnd: number;\n insetInlineStart: number;\n insetInlineEnd: number;\n inlineSize: number;\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/app-layout/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { IconProps } from '../icon/interfaces';\nimport { FlowType } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { SomeRequired } from '../internal/types';\n\nexport interface AppLayoutProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: AppLayoutProps.AnalyticsMetadata;\n\n /**\n * Determines the default behavior of the component based on some predefined page layouts.\n * Individual properties will always take precedence over the default coming from the content type.\n */\n contentType?: AppLayoutProps.ContentType;\n\n /**\n * Drawers property. If you set both `drawers` and `tools`, `drawers` will take precedence.\n\n * Each Drawer is an item in the drawers wrapper with the following properties:\n * * id (string) - the id of the drawer.\n * * content (React.ReactNode) - the content in the drawer.\n * * trigger (DrawerTrigger) - the button that opens and closes the active drawer.\n * * ariaLabels (DrawerAriaLabels) - the labels for the interactive elements of the drawer.\n * * badge (boolean) - Adds a badge to the corner of the icon to indicate a state change. For example: Unread notifications.\n * * resizable (boolean) - if the drawer is resizable or not.\n * * defaultSize (number) - starting size of the drawer. if not set, defaults to 290.\n * * onResize (({ size: number }) => void) - Fired when the active drawer is resized.\n *\n * #### DrawerTrigger\n * - `iconName` (IconProps.Name) - (Optional) Specifies the icon to be displayed.\n * - `iconSvg` (React.ReactNode) - (Optional) Specifies the SVG of a custom icon. For more information, see [SVG icon guidelines](/components/icon/?tabId=api#slots)\n *\n * #### DrawerAriaLabels\n * - `drawerName` (string) - Label for the drawer itself.\n * - `closeButton` (string) - (Optional) Label for the close button.\n * - `triggerButton` (string) - (Optional) Label for the trigger button.\n * - `resizeHandle` (string) - (Optional) Label for the resize handle.\n */\n drawers?: Array<AppLayoutProps.Drawer>;\n\n /**\n * The active drawer id. If you want to clear the active drawer, use `null`.\n */\n activeDrawerId?: string | null;\n\n /**\n * Fired when the active drawer is toggled.\n */\n onDrawerChange?: NonCancelableEventHandler<AppLayoutProps.DrawerChangeDetail>;\n\n /**\n * If `true`, disables outer paddings for the content slot.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Activates a backwards-compatibility mode for applications with non-fixed headers and footers.\n * @deprecated This layout is being phased out and may miss some features.\n */\n disableBodyScroll?: boolean;\n\n /**\n * State of the navigation drawer.\n */\n navigationOpen?: boolean;\n\n /**\n * Navigation drawer width in pixels.\n */\n navigationWidth?: number;\n\n /**\n * If `true`, the navigation drawer is not displayed at all.\n */\n navigationHide?: boolean;\n\n /**\n * State of the tools drawer.\n */\n toolsOpen?: boolean;\n\n /**\n * If `true`, the tools drawer is not displayed at all.\n */\n toolsHide?: boolean;\n\n /**\n * Tools drawer width in pixels.\n */\n toolsWidth?: number;\n\n /**\n * Maximum main content panel width in pixels.\n *\n * If set to `Number.MAX_VALUE`, the main content panel will occupy the full available width.\n */\n maxContentWidth?: number;\n\n /**\n * Minimum main content panel width in pixels.\n */\n minContentWidth?: number;\n\n /**\n * If true, the notification slot is rendered above the scrollable\n * content area so it is always visible.\n */\n stickyNotifications?: boolean;\n\n /**\n * CSS selector for the application header.\n */\n headerSelector?: string;\n\n /**\n * CSS selector for the application footer.\n */\n footerSelector?: string;\n\n /**\n * Aria labels for the drawer operating buttons. Use this property to ensure accessibility.\n *\n * * `navigation` (string) - Label for the landmark that wraps the navigation drawer.\n * * `navigationClose` (string) - Label for the button that closes the navigation drawer.\n * * `navigationToggle` (string) - Label for the button that opens the navigation drawer.\n * * `notification` (string) - Label for the region that contains notification messages.\n * * `tools` (string) - Label for the landmark that wraps the tools drawer.\n * * `toolsClose` (string) - Label for the button that closes the tools drawer.\n * * `toolsToggle` (string) - Label for the button that opens the tools drawer.\n * * `drawers` (string) - Label for the landmark that wraps the active drawer.\n * * `drawersOverflow` (string) - Label for the ellipsis button with any overflow drawers.\n * * `drawersOverflowWithBadge` (string) - Label for the ellipsis button with any overflow drawers, with a badge.\n *\n * Example:\n * ```\n * {\n * navigation: \"Navigation drawer\",\n * navigationClose: \"Close navigation drawer\",\n * navigationToggle: \"Open navigation drawer\",\n * notifications: \"Notifications\",\n * tools: \"Help panel\",\n * toolsClose: \"Close help panel\",\n * toolsToggle: \"Open help panel\",\n * drawers: \"Drawers\",\n * drawersOverflow: \"Overflow drawers\",\n * drawersOverflowWithBadge: \"Overflow drawers (Unread notifications)\"\n * }\n * ```\n * @i18n\n */\n ariaLabels?: AppLayoutProps.Labels;\n\n /**\n * Navigation drawer.\n */\n navigation?: React.ReactNode;\n\n /**\n * Top area of the page content.\n * @deprecated Replaced by the `header` slot of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n contentHeader?: React.ReactNode;\n\n /**\n * Disables overlap between `contentHeader` and `content` slots.\n * @deprecated Replaced by the `disableOverlap` property of the [content layout](/components/content-layout/) component.\n * @visualrefresh\n */\n disableContentHeaderOverlap?: boolean;\n\n /**\n * Determines the visual treatment for the breadcrumbs and notifications slots. Specifically:\n * * `default` - Does not apply any visual treatment.\n * * `high-contrast` - Applies high-contrast to both slots. Use in conjunction with `headerVariant=\"high-contrast\"` in ContentLayout.\n * @visualrefresh\n */\n headerVariant?: 'default' | 'high-contrast';\n\n /**\n * Main content.\n */\n content?: React.ReactNode;\n\n /**\n * Tools drawer.\n */\n tools?: React.ReactNode;\n\n /**\n * Displayed on top of the main content in the scrollable area.\n *\n * Conceived to contain notifications (flash messages).\n */\n notifications?: React.ReactNode;\n\n /**\n * Use this slot to add the [breadcrumb group component](/components/breadcrumb-group/) to the app layout.\n */\n breadcrumbs?: React.ReactNode;\n\n /**\n * Fired when the navigation drawer is toggled.\n */\n onNavigationChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n\n /**\n * Fired when the tools drawer is toggled.\n */\n onToolsChange?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n\n /**\n * Use this slot to add the [split panel component](/components/split-panel/) to the app layout.\n *\n * Note: If provided, this property should be set to `null` or `undefined` if a split panel should not be rendered.\n */\n splitPanel?: React.ReactNode;\n\n /**\n * The size of the split panel in pixels.\n */\n splitPanelSize?: number;\n\n /**\n * State of the split panel.\n */\n splitPanelOpen?: boolean;\n /**\n * Controls the split panel preferences.\n *\n * By default, the preference is `{ position: 'bottom' }`\n */\n splitPanelPreferences?: AppLayoutProps.SplitPanelPreferences;\n /**\n * Fired when the split panel is resized.\n */\n onSplitPanelResize?: NonCancelableEventHandler<AppLayoutProps.SplitPanelResizeDetail>;\n /**\n * Fired when the split panel is toggled.\n */\n onSplitPanelToggle?: NonCancelableEventHandler<AppLayoutProps.ChangeDetail>;\n /**\n * Fired when the split panel preferences change.\n */\n onSplitPanelPreferencesChange?: NonCancelableEventHandler<AppLayoutProps.SplitPanelPreferences>;\n}\n\nexport namespace AppLayoutProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n }\n\n export type ContentType = 'default' | 'form' | 'table' | 'cards' | 'wizard' | 'dashboard';\n\n export interface Ref {\n /**\n * Manually closes the navigation drawer if it is necessary for the current\n * viewport size.\n */\n closeNavigationIfNecessary(): void;\n\n /**\n * Opens the tools panel if it is not already open. Note that it is preferable\n * to control the state by listening to `toolsChange` and providing `toolsOpen`.\n */\n openTools(): void;\n\n /**\n * Focuses the tools panel if it is open. Use this to focus the tools panel\n * after changing the content, for example when clicking on an 'info' link while\n * the panel is already open.\n */\n focusToolsClose(): void;\n\n /**\n * Focuses the active drawer. Use this to focus the active drawer after opening it programmatically.\n */\n focusActiveDrawer(): void;\n\n /**\n * Focuses the split panel if it is open.\n */\n focusSplitPanel(): void;\n }\n\n export interface Drawer {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: DrawerAriaLabels;\n badge?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number }>;\n }\n\n export interface DrawerAriaLabels {\n drawerName: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n }\n\n export interface Labels {\n notifications?: string;\n\n navigation?: string;\n navigationToggle?: string;\n navigationClose?: string;\n\n tools?: string;\n toolsToggle?: string;\n toolsClose?: string;\n\n drawers?: string;\n drawersOverflow?: string;\n drawersOverflowWithBadge?: string;\n }\n\n export interface ChangeDetail {\n open: boolean;\n }\n\n export interface SplitPanelResizeDetail {\n size: number;\n }\n\n export interface SplitPanelPreferences {\n position: 'side' | 'bottom';\n }\n // Duplicated the positions because using this definition in SplitPanelPreferences would display\n // 'AppLayoutProps.SplitPanelPosition' on the API docs instead of the string values.\n export type SplitPanelPosition = 'side' | 'bottom';\n\n export interface DrawerChangeDetail {\n activeDrawerId: string | null;\n }\n}\n\nexport type AppLayoutPropsWithDefaults = SomeRequired<\n Omit<AppLayoutProps, 'headerSelector' | 'footerSelector'>,\n 'contentType' | 'navigationWidth' | 'toolsWidth' | 'minContentWidth' | 'navigationOpen' | 'onNavigationChange'\n> & {\n placement: {\n insetBlockStart: number;\n insetBlockEnd: number;\n insetInlineStart: number;\n insetInlineEnd: number;\n inlineSize: number;\n };\n};\n"]}
|
|
@@ -3,7 +3,7 @@ import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-co
|
|
|
3
3
|
import { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';
|
|
4
4
|
import { FocusControlRefs } from '../utils/use-focus-control';
|
|
5
5
|
import { SplitPanelFocusControlRefs } from '../utils/use-split-panel-focus-control';
|
|
6
|
-
interface AppLayoutInternals extends AppLayoutPropsWithDefaults {
|
|
6
|
+
export interface AppLayoutInternals extends AppLayoutPropsWithDefaults {
|
|
7
7
|
activeDrawerId: string | null;
|
|
8
8
|
drawers: Array<AppLayoutProps.Drawer> | undefined;
|
|
9
9
|
drawersAriaLabel: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAMvF,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,0BAA0B,EAA6B,MAAM,wCAAwC,CAAC;AAM/G,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAMvF,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,gBAAgB,EAAmB,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,0BAA0B,EAA6B,MAAM,wC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SAAS;YACT,kBAAkB;QAGpB,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,6BAA6B,IACjE,QAAQ,CACsB,CACE,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 useContext,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport { getOffsetInlineStart } from '@cloudscape-design/component-toolkit/internal';\n\nimport { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\nimport { useDrawers } from '../utils/use-drawers';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport useResize from '../utils/use-resize';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { getSplitPanelPosition } from './split-panel';\nimport useBackgroundOverlap from './use-background-overlap';\n\nimport styles from './styles.css.js';\n\ninterface AppLayoutInternals extends AppLayoutPropsWithDefaults {\n activeDrawerId: string | null;\n drawers: Array<AppLayoutProps.Drawer> | undefined;\n drawersAriaLabel: string | undefined;\n drawersOverflowAriaLabel: string | undefined;\n drawersOverflowWithBadgeAriaLabel: string | undefined;\n drawersRefs: FocusControlRefs;\n drawerSize: number;\n drawersMinWidth: number;\n drawersMaxWidth: number;\n drawerRef: React.Ref<HTMLElement>;\n resizeHandle: React.ReactElement;\n drawersTriggerCount: 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: (newSize: number) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasBackgroundOverlap: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer?: boolean;\n isBackgroundOverlapDisabled: boolean;\n isMobile: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref<HTMLElement>;\n layoutWidth: number;\n loseToolsFocus: () => void;\n loseDrawersFocus: () => void;\n mainElement: React.Ref<HTMLDivElement>;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsHeight: number;\n setNotificationsHeight: (height: number) => void;\n offsetBottom: number;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelControlId: string;\n splitPanelMaxWidth: 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 toolsControlId: string;\n toolsRefs: FocusControlRefs;\n __embeddedViewMode?: boolean;\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 AppLayoutPropsWithDefaults {\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 (props: AppLayoutProviderInternalsProps, forwardRef: React.Ref<AppLayoutProps.Ref>) => {\n const {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen,\n contentType,\n placement,\n children,\n splitPanel,\n } = props;\n const isMobile = useMobile();\n\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((props as any).__embeddedViewMode);\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 const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n\n const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen: boolean) {\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n });\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n handleNavigationClick(false);\n }\n }, [isMobile, handleNavigationClick]);\n\n const toolsWidth = props.toolsWidth;\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n 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 * 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 [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(SPLIT_PANEL_MIN_WIDTH);\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 = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth;\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\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) && !!splitPanel;\n const splitPanelControlId = useUniqueId('split-panel-');\n const toolsControlId = useUniqueId('tools-');\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 (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(props.onSplitPanelResize, { size });\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 const {\n drawers,\n activeDrawer,\n activeDrawerId,\n minDrawerSize: drawersMinWidth,\n onActiveDrawerChange,\n onActiveDrawerResize,\n activeDrawerSize,\n ...drawersProps\n } = useDrawers(props, props.ariaLabels, {\n disableDrawersMerge: true,\n ariaLabels: props.ariaLabels,\n toolsHide,\n toolsOpen: isToolsOpen,\n tools: props.tools,\n toolsWidth,\n onToolsToggle: handleToolsClick,\n });\n\n const [drawersMaxWidth, setDrawersMaxWidth] = useState(toolsWidth);\n const hasDrawers = !!drawers && drawers.length > 0;\n\n const {\n refs: drawersRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const drawerRef = useRef<HTMLDivElement>(null);\n const { resizeHandle, drawerSize } = useResize(drawerRef, {\n onActiveDrawerResize,\n activeDrawerSize,\n activeDrawer,\n drawersRefs,\n isToolsOpen,\n drawersMaxWidth,\n drawersMinWidth,\n });\n\n const handleDrawersClick = (id: string | null, skipFocusControl?: boolean) => {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n onActiveDrawerChange(newActiveDrawerId);\n\n !skipFocusControl && focusDrawersButtons();\n };\n\n let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0;\n if (splitPanelDisplayed && splitPanelPosition === 'side') {\n drawersTriggerCount++;\n }\n const hasOpenDrawer =\n !!activeDrawerId ||\n (!toolsHide && isToolsOpen) ||\n (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && navigationOpen) || (!toolsHide && isToolsOpen));\n\n const layoutElement = useRef<HTMLDivElement>(null);\n const mainElement = useRef<HTMLDivElement>(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({\n contentHeader: props.contentHeader,\n disableContentHeaderOverlap: props.disableContentHeaderOverlap,\n layoutElement,\n });\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n const offsetInlineStart = mainElement?.current ? getOffsetInlineStart(mainElement?.current) : 0;\n setMainOffsetLeft(offsetInlineStart);\n },\n [placement.inlineSize, navigationOpen, isToolsOpen, splitPanelReportedSize]\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 && (navigationOpen || isToolsOpen || !!activeDrawer)) {\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, navigationOpen, isToolsOpen, activeDrawer]\n );\n\n const [notificationsHeight, setNotificationsHeight] = useState(0);\n const hasNotificationsContent = notificationsHeight > 0;\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 = placement.insetBlockEnd;\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-layout-content-horizontal};\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 = 50; // Approximately 24px when rendered but doubled for safety\n const toolsFormOffsetWidth = 120; // Approximately 60px when rendered but doubled for safety\n const getPanelOffsetWidth = () => {\n if (drawers) {\n return activeDrawerId ? drawerSize : 0;\n }\n return isToolsOpen ? toolsWidth : 0;\n };\n\n setSplitPanelMaxWidth(\n placement.inlineSize -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsFormOffsetWidth -\n getPanelOffsetWidth()\n );\n\n setDrawersMaxWidth(\n placement.inlineSize - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth\n );\n },\n [\n activeDrawerId,\n drawerSize,\n drawers,\n navigationOpen,\n isToolsOpen,\n placement.inlineSize,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\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, hasDrawers);\n if (hasDrawers) {\n focusDrawersButtons(true);\n }\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n };\n },\n [\n isMobile,\n handleNavigationClick,\n handleToolsClick,\n focusToolsButtons,\n focusDrawersButtons,\n splitPanelRefs.slider,\n hasDrawers,\n ]\n );\n\n return (\n <AppLayoutInternalsContext.Provider\n value={{\n ...props,\n activeDrawerId,\n contentType,\n drawers,\n drawersAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawers,\n drawersOverflowAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflow,\n drawersOverflowWithBadgeAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflowWithBadge,\n drawersRefs,\n drawersMinWidth,\n drawersMaxWidth,\n drawerSize,\n drawerRef,\n resizeHandle,\n drawersTriggerCount,\n headerHeight: placement.insetBlockStart,\n footerHeight: placement.insetBlockEnd,\n hasDrawerViewportOverlay,\n handleDrawersClick,\n handleNavigationClick,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n handleToolsClick,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasOpenDrawer,\n isBackgroundOverlapDisabled: props.disableContentHeaderOverlap || !hasBackgroundOverlap,\n isMobile,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth: placement.inlineSize,\n loseToolsFocus,\n loseDrawersFocus,\n mainElement,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n navigationRefs,\n notificationsHeight,\n setNotificationsHeight,\n offsetBottom,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelMaxWidth,\n splitPanelPosition,\n splitPanelPreferences,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n splitPanelSize,\n splitPanelToggle,\n setSplitPanelToggle,\n splitPanelRefs,\n toolsControlId,\n toolsHide,\n toolsOpen: isToolsOpen,\n toolsWidth,\n toolsRefs,\n __embeddedViewMode,\n }}\n >\n <DynamicOverlapContext.Provider value={updateBackgroundOverlapHeight}>\n {children}\n </DynamicOverlapContext.Provider>\n </AppLayoutInternalsContext.Provider>\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/context.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAEvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAoB,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAA8B,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,oBAAoB,MAAM,0BAA0B,CAAC;AAE5D,OA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YAC9B,cAAc;YACd,gBAAgB;YAChB,mBAAmB;YACnB,cAAc;YACd,cAAc;YACd,SAAS,EACT,SAAS,EAAE,WAAW,EACtB,UAAU;YACV,SAAS;YACT,kBAAkB;QAGpB,oBAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,6BAA6B,IACjE,QAAQ,CACsB,CACE,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 useContext,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\nimport { getOffsetInlineStart } from '@cloudscape-design/component-toolkit/internal';\n\nimport { DynamicOverlapContext } from '../../internal/context/dynamic-overlap-context';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { fireNonCancelableEvent } from '../../internal/events';\nimport { useControllable } from '../../internal/hooks/use-controllable';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SPLIT_PANEL_MIN_WIDTH } from '../split-panel';\nimport { useDrawers } from '../utils/use-drawers';\nimport { FocusControlRefs, useFocusControl } from '../utils/use-focus-control';\nimport useResize from '../utils/use-resize';\nimport { SplitPanelFocusControlRefs, useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control';\nimport { getSplitPanelPosition } from './split-panel';\nimport useBackgroundOverlap from './use-background-overlap';\n\nimport styles from './styles.css.js';\n\nexport interface AppLayoutInternals extends AppLayoutPropsWithDefaults {\n activeDrawerId: string | null;\n drawers: Array<AppLayoutProps.Drawer> | undefined;\n drawersAriaLabel: string | undefined;\n drawersOverflowAriaLabel: string | undefined;\n drawersOverflowWithBadgeAriaLabel: string | undefined;\n drawersRefs: FocusControlRefs;\n drawerSize: number;\n drawersMinWidth: number;\n drawersMaxWidth: number;\n drawerRef: React.Ref<HTMLElement>;\n resizeHandle: React.ReactElement;\n drawersTriggerCount: 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: (newSize: number) => void;\n handleToolsClick: (value: boolean, skipFocusControl?: boolean) => void;\n hasBackgroundOverlap: boolean;\n hasDrawerViewportOverlay: boolean;\n hasNotificationsContent: boolean;\n hasOpenDrawer?: boolean;\n isBackgroundOverlapDisabled: boolean;\n isMobile: boolean;\n isSplitPanelForcedPosition: boolean;\n isSplitPanelOpen?: boolean;\n isToolsOpen: boolean;\n layoutElement: React.Ref<HTMLElement>;\n layoutWidth: number;\n loseToolsFocus: () => void;\n loseDrawersFocus: () => void;\n mainElement: React.Ref<HTMLDivElement>;\n mainOffsetLeft: number;\n navigationRefs: FocusControlRefs;\n notificationsHeight: number;\n setNotificationsHeight: (height: number) => void;\n offsetBottom: number;\n setSplitPanelReportedSize: (value: number) => void;\n setSplitPanelReportedHeaderHeight: (value: number) => void;\n headerHeight: number;\n footerHeight: number;\n splitPanelControlId: string;\n splitPanelMaxWidth: 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 toolsControlId: string;\n toolsRefs: FocusControlRefs;\n __embeddedViewMode?: boolean;\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 AppLayoutPropsWithDefaults {\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 (props: AppLayoutProviderInternalsProps, forwardRef: React.Ref<AppLayoutProps.Ref>) => {\n const {\n toolsHide,\n toolsOpen: controlledToolsOpen,\n navigationHide,\n navigationOpen,\n contentType,\n placement,\n children,\n splitPanel,\n } = props;\n const isMobile = useMobile();\n\n // Private API for embedded view mode\n const __embeddedViewMode = Boolean((props as any).__embeddedViewMode);\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 const { refs: navigationRefs, setFocus: focusNavButtons } = useFocusControl(navigationOpen);\n\n const handleNavigationClick = useStableCallback(function handleNavigationChange(isOpen: boolean) {\n focusNavButtons();\n fireNonCancelableEvent(props.onNavigationChange, { open: isOpen });\n });\n\n useEffect(() => {\n // Close navigation drawer on mobile so that the main content is visible\n if (isMobile) {\n handleNavigationClick(false);\n }\n }, [isMobile, handleNavigationClick]);\n\n const toolsWidth = props.toolsWidth;\n const [isToolsOpen = false, setIsToolsOpen] = useControllable(controlledToolsOpen, props.onToolsChange, false, {\n componentName: 'AppLayout',\n controlledProp: 'toolsOpen',\n 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 * 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 [splitPanelMaxWidth, setSplitPanelMaxWidth] = useState(SPLIT_PANEL_MIN_WIDTH);\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 = isMobile || SPLIT_PANEL_MIN_WIDTH > splitPanelMaxWidth;\n const splitPanelPosition = getSplitPanelPosition(isSplitPanelForcedPosition, splitPanelPreferences);\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) && !!splitPanel;\n const splitPanelControlId = useUniqueId('split-panel-');\n const toolsControlId = useUniqueId('tools-');\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 (size: number) => {\n setSplitPanelSize(size);\n fireNonCancelableEvent(props.onSplitPanelResize, { size });\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 const {\n drawers,\n activeDrawer,\n activeDrawerId,\n minDrawerSize: drawersMinWidth,\n onActiveDrawerChange,\n onActiveDrawerResize,\n activeDrawerSize,\n ...drawersProps\n } = useDrawers(props, props.ariaLabels, {\n disableDrawersMerge: true,\n ariaLabels: props.ariaLabels,\n toolsHide,\n toolsOpen: isToolsOpen,\n tools: props.tools,\n toolsWidth,\n onToolsToggle: handleToolsClick,\n });\n\n const [drawersMaxWidth, setDrawersMaxWidth] = useState(toolsWidth);\n const hasDrawers = !!drawers && drawers.length > 0;\n\n const {\n refs: drawersRefs,\n setFocus: focusDrawersButtons,\n loseFocus: loseDrawersFocus,\n } = useFocusControl(!!activeDrawerId, true, activeDrawerId);\n\n const drawerRef = useRef<HTMLDivElement>(null);\n const { resizeHandle, drawerSize } = useResize(drawerRef, {\n onActiveDrawerResize,\n activeDrawerSize,\n activeDrawer,\n drawersRefs,\n isToolsOpen,\n drawersMaxWidth,\n drawersMinWidth,\n });\n\n const handleDrawersClick = (id: string | null, skipFocusControl?: boolean) => {\n const newActiveDrawerId = id !== activeDrawerId ? id : null;\n\n onActiveDrawerChange(newActiveDrawerId);\n\n !skipFocusControl && focusDrawersButtons();\n };\n\n let drawersTriggerCount = drawers ? drawers.length : !toolsHide ? 1 : 0;\n if (splitPanelDisplayed && splitPanelPosition === 'side') {\n drawersTriggerCount++;\n }\n const hasOpenDrawer =\n !!activeDrawerId ||\n (!toolsHide && isToolsOpen) ||\n (splitPanelDisplayed && splitPanelPosition === 'side' && isSplitPanelOpen);\n const hasDrawerViewportOverlay =\n isMobile && (!!activeDrawerId || (!navigationHide && navigationOpen) || (!toolsHide && isToolsOpen));\n\n const layoutElement = useRef<HTMLDivElement>(null);\n const mainElement = useRef<HTMLDivElement>(null);\n const [mainOffsetLeft, setMainOffsetLeft] = useState(0);\n\n const { hasBackgroundOverlap, updateBackgroundOverlapHeight } = useBackgroundOverlap({\n contentHeader: props.contentHeader,\n disableContentHeaderOverlap: props.disableContentHeaderOverlap,\n layoutElement,\n });\n\n useLayoutEffect(\n function handleMainOffsetLeft() {\n const offsetInlineStart = mainElement?.current ? getOffsetInlineStart(mainElement?.current) : 0;\n setMainOffsetLeft(offsetInlineStart);\n },\n [placement.inlineSize, navigationOpen, isToolsOpen, splitPanelReportedSize]\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 && (navigationOpen || isToolsOpen || !!activeDrawer)) {\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, navigationOpen, isToolsOpen, activeDrawer]\n );\n\n const [notificationsHeight, setNotificationsHeight] = useState(0);\n const hasNotificationsContent = notificationsHeight > 0;\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 = placement.insetBlockEnd;\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-layout-content-horizontal};\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 = 50; // Approximately 24px when rendered but doubled for safety\n const toolsFormOffsetWidth = 120; // Approximately 60px when rendered but doubled for safety\n const getPanelOffsetWidth = () => {\n if (drawers) {\n return activeDrawerId ? drawerSize : 0;\n }\n return isToolsOpen ? toolsWidth : 0;\n };\n\n setSplitPanelMaxWidth(\n placement.inlineSize -\n mainOffsetLeft -\n minContentWidth -\n contentGapRight -\n toolsFormOffsetWidth -\n getPanelOffsetWidth()\n );\n\n setDrawersMaxWidth(\n placement.inlineSize - mainOffsetLeft - minContentWidth - contentGapRight - toolsFormOffsetWidth\n );\n },\n [\n activeDrawerId,\n drawerSize,\n drawers,\n navigationOpen,\n isToolsOpen,\n placement.inlineSize,\n mainOffsetLeft,\n minContentWidth,\n toolsWidth,\n ]\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, hasDrawers);\n if (hasDrawers) {\n focusDrawersButtons(true);\n }\n },\n focusToolsClose: () => {\n if (hasDrawers) {\n focusDrawersButtons(true);\n } else {\n focusToolsButtons(true);\n }\n },\n focusActiveDrawer: () => focusDrawersButtons(true),\n focusSplitPanel: () => splitPanelRefs.slider.current?.focus(),\n };\n },\n [\n isMobile,\n handleNavigationClick,\n handleToolsClick,\n focusToolsButtons,\n focusDrawersButtons,\n splitPanelRefs.slider,\n hasDrawers,\n ]\n );\n\n return (\n <AppLayoutInternalsContext.Provider\n value={{\n ...props,\n activeDrawerId,\n contentType,\n drawers,\n drawersAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawers,\n drawersOverflowAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflow,\n drawersOverflowWithBadgeAriaLabel: drawersProps.ariaLabelsWithDrawers?.drawersOverflowWithBadge,\n drawersRefs,\n drawersMinWidth,\n drawersMaxWidth,\n drawerSize,\n drawerRef,\n resizeHandle,\n drawersTriggerCount,\n headerHeight: placement.insetBlockStart,\n footerHeight: placement.insetBlockEnd,\n hasDrawerViewportOverlay,\n handleDrawersClick,\n handleNavigationClick,\n handleSplitPanelClick,\n handleSplitPanelPreferencesChange,\n handleSplitPanelResize,\n handleToolsClick,\n hasBackgroundOverlap,\n hasNotificationsContent,\n hasOpenDrawer,\n isBackgroundOverlapDisabled: props.disableContentHeaderOverlap || !hasBackgroundOverlap,\n isMobile,\n isSplitPanelForcedPosition,\n isSplitPanelOpen,\n isToolsOpen,\n layoutElement,\n layoutWidth: placement.inlineSize,\n loseToolsFocus,\n loseDrawersFocus,\n mainElement,\n mainOffsetLeft,\n maxContentWidth,\n minContentWidth,\n navigationHide,\n navigationRefs,\n notificationsHeight,\n setNotificationsHeight,\n offsetBottom,\n setSplitPanelReportedSize,\n setSplitPanelReportedHeaderHeight,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelMaxWidth,\n splitPanelPosition,\n splitPanelPreferences,\n splitPanelReportedSize,\n splitPanelReportedHeaderHeight,\n splitPanelSize,\n splitPanelToggle,\n setSplitPanelToggle,\n splitPanelRefs,\n toolsControlId,\n toolsHide,\n toolsOpen: isToolsOpen,\n toolsWidth,\n toolsRefs,\n __embeddedViewMode,\n }}\n >\n <DynamicOverlapContext.Provider value={updateBackgroundOverlapHeight}>\n {children}\n </DynamicOverlapContext.Provider>\n </AppLayoutInternalsContext.Provider>\n );\n }\n);\n"]}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* The VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT is used to reduce the number
|
|
4
|
+
* of triggers that are initially visible on the mobile toolbar, the rest
|
|
5
|
+
* are then placed into an overflow menu
|
|
6
|
+
*
|
|
7
|
+
* Note if one of the triggers is for a split-panel, it would not count that
|
|
8
|
+
*/
|
|
9
|
+
export declare const VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT = 2;
|
|
2
10
|
/**
|
|
3
11
|
* The Drawers root component is mounted in the AppLayout index file. It will only
|
|
4
12
|
* render if the drawers are defined, and it will take over the mounting of and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawers.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":";AAqBA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,uBA+B9B;AAiPD;;;;;GAKG;AACH,wBAAgB,cAAc,
|
|
1
|
+
{"version":3,"file":"drawers.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":";AAqBA;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,IAAI,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,uBA+B9B;AAiPD;;;;;GAKG;AACH,wBAAgB,cAAc,uBAqE7B"}
|
|
@@ -15,6 +15,14 @@ import TriggerButton from './trigger-button';
|
|
|
15
15
|
import splitPanelTestUtilStyles from '../../split-panel/test-classes/styles.css.js';
|
|
16
16
|
import testutilStyles from '../test-classes/styles.css.js';
|
|
17
17
|
import styles from './styles.css.js';
|
|
18
|
+
/**
|
|
19
|
+
* The VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT is used to reduce the number
|
|
20
|
+
* of triggers that are initially visible on the mobile toolbar, the rest
|
|
21
|
+
* are then placed into an overflow menu
|
|
22
|
+
*
|
|
23
|
+
* Note if one of the triggers is for a split-panel, it would not count that
|
|
24
|
+
*/
|
|
25
|
+
export const VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT = 2;
|
|
18
26
|
/**
|
|
19
27
|
* The Drawers root component is mounted in the AppLayout index file. It will only
|
|
20
28
|
* render if the drawers are defined, and it will take over the mounting of and
|
|
@@ -115,7 +123,7 @@ function DesktopTriggers() {
|
|
|
115
123
|
}), role: "toolbar", "aria-orientation": "vertical" },
|
|
116
124
|
visibleItems.map(item => {
|
|
117
125
|
var _a;
|
|
118
|
-
return (React.createElement(TriggerButton, { ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: item.id === activeDrawerId, ariaControls: activeDrawerId === item.id ? item.id : undefined, className: clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => handleDrawersClick(item.id), ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined,
|
|
126
|
+
return (React.createElement(TriggerButton, { ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: item.id === activeDrawerId, ariaControls: activeDrawerId === item.id ? item.id : undefined, className: clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => handleDrawersClick(item.id), ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined, badge: item.badge, testId: `awsui-app-layout-trigger-${item.id}`, highContrastHeader: headerVariant === 'high-contrast', selected: item.id === activeDrawerId }));
|
|
119
127
|
}),
|
|
120
128
|
overflowItems.length > 0 && (React.createElement(OverflowMenu, { items: overflowItems, ariaLabel: overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel, customTriggerBuilder: ({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (React.createElement(TriggerButton, { ref: triggerRef, ariaLabel: ariaLabel, ariaExpanded: ariaExpanded, badge: overflowMenuHasBadge, className: clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], testUtilsClass), iconName: "ellipsis", onClick: onClick, highContrastHeader: headerVariant === 'high-contrast' })), onItemClick: ({ detail }) => {
|
|
121
129
|
handleDrawersClick(detail.id);
|
|
@@ -129,7 +137,7 @@ function DesktopTriggers() {
|
|
|
129
137
|
* trigger button for the Tools drawer.
|
|
130
138
|
*/
|
|
131
139
|
export function MobileTriggers() {
|
|
132
|
-
const { activeDrawerId, drawers, drawersAriaLabel, drawersOverflowAriaLabel, drawersOverflowWithBadgeAriaLabel, drawersRefs, handleDrawersClick, hasDrawerViewportOverlay, } = useAppLayoutInternals();
|
|
140
|
+
const { activeDrawerId, drawers, drawersAriaLabel, drawersOverflowAriaLabel, drawersOverflowWithBadgeAriaLabel, drawersRefs, handleDrawersClick, hasDrawerViewportOverlay, headerVariant, } = useAppLayoutInternals();
|
|
133
141
|
const previousActiveDrawerId = useRef(activeDrawerId);
|
|
134
142
|
if (!drawers) {
|
|
135
143
|
return null;
|
|
@@ -137,7 +145,7 @@ export function MobileTriggers() {
|
|
|
137
145
|
if (activeDrawerId) {
|
|
138
146
|
previousActiveDrawerId.current = activeDrawerId;
|
|
139
147
|
}
|
|
140
|
-
const { visibleItems, overflowItems } = splitItems(drawers,
|
|
148
|
+
const { visibleItems, overflowItems } = splitItems(drawers, VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT, activeDrawerId);
|
|
141
149
|
const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);
|
|
142
150
|
return (React.createElement("aside", { "aria-hidden": hasDrawerViewportOverlay, className: clsx({
|
|
143
151
|
[styles.unfocusable]: hasDrawerViewportOverlay,
|
|
@@ -145,7 +153,7 @@ export function MobileTriggers() {
|
|
|
145
153
|
React.createElement("div", { className: styles['drawers-mobile-triggers-container'], role: "toolbar", "aria-orientation": "horizontal" },
|
|
146
154
|
visibleItems.map(item => {
|
|
147
155
|
var _a;
|
|
148
|
-
return (React.createElement(
|
|
156
|
+
return (React.createElement(TriggerButton, { ariaExpanded: item.id === activeDrawerId, ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaControls: activeDrawerId === item.id ? item.id : undefined, className: clsx(`awsui-app-layout-trigger-${item.id}`, styles['drawers-trigger'], testutilStyles['drawers-trigger'], item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']), disabled: hasDrawerViewportOverlay, ref: item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined, iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, badge: item.badge, key: item.id, onClick: () => handleDrawersClick(item.id), testId: `awsui-app-layout-trigger-${item.id}`, highContrastHeader: headerVariant === 'high-contrast', selected: item.id === activeDrawerId }));
|
|
149
157
|
}),
|
|
150
158
|
overflowItems.length > 0 && (React.createElement(OverflowMenu, { items: overflowItems, ariaLabel: overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel, onItemClick: ({ detail }) => handleDrawersClick(detail.id) })))));
|
|
151
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx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PDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { InternalButton } from '../../button/internal';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { useAppLayoutInternals } from './context';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const {\n disableBodyScroll,\n drawers,\n drawersTriggerCount,\n hasDrawerViewportOverlay,\n hasOpenDrawer,\n navigationOpen,\n navigationHide,\n isMobile,\n } = useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide;\n\n if (!drawers || drawersTriggerCount === 0) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['drawers-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles['has-open-drawer']]: hasOpenDrawer,\n [styles.unfocusable]: isUnfocusable,\n })}\n >\n <SplitPanel.Side />\n <ActiveDrawer />\n {!isMobile && <DesktopTriggers />}\n </div>\n );\n}\n\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n navigationHide,\n loseDrawersFocus,\n resizeHandle,\n drawerSize,\n drawersMinWidth,\n drawersMaxWidth,\n drawerRef,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.find(item => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && navigationOpen && !navigationHide);\n const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n\n const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth);\n\n return (\n <aside\n id={activeDrawerId ?? undefined}\n aria-hidden={isHidden}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [styles['is-drawer-open']]: activeDrawerId,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['active-drawer']]: activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n })}\n style={{\n ...(!isMobile && drawerSize && { [customCssProps.drawerSize]: `${size}px` }),\n }}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseDrawersFocus();\n }\n }}\n >\n {!isMobile && activeDrawer?.resizable && <div className={styles['drawer-slider']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-container']}>\n <div className={styles['drawer-close-button']}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => {\n handleDrawersClick(activeDrawerId);\n handleToolsClick(false);\n }}\n ref={drawersRefs.close}\n variant=\"icon\"\n />\n </div>\n {toolsContent && (\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']}>{activeDrawerId && activeDrawer?.content}</div>\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n hasOpenDrawer,\n isSplitPanelOpen,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n splitPanelReportedHeaderHeight,\n splitPanelReportedSize,\n headerVariant,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side';\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const splitPanelHeight =\n isSplitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : splitPanelReportedHeaderHeight;\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = 48;\n const overflowSpot =\n activeDrawerId && isSplitPanelOpen\n ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5\n : (containerHeight - splitPanelHeight) / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n let splitPanelItem = 0;\n if (hasSplitPanel && splitPanelToggle.displayed) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers ?? undefined, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n className={clsx(styles['drawers-desktop-triggers-container'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n aria-label={drawersAriaLabel}\n ref={triggersContainerRef}\n role=\"region\"\n >\n <div\n className={clsx(styles['drawers-trigger-content'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n >\n {visibleItems.map(item => {\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={item.id === activeDrawerId}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n selected={item.id === activeDrawerId}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n );\n })}\n\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], testUtilsClass)}\n iconName=\"ellipsis\"\n onClick={onClick}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n onItemClick={({ detail }) => {\n handleDrawersClick(detail.id);\n }}\n />\n )}\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n ariaControls={splitPanelControlId}\n ariaExpanded={!!isSplitPanelOpen}\n className={clsx(styles['drawers-trigger'], splitPanelTestUtilStyles['open-button'])}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n handleDrawersClick,\n hasDrawerViewportOverlay,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (!drawers) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const { visibleItems, overflowItems } = splitItems(drawers, 2, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n aria-hidden={hasDrawerViewportOverlay}\n className={clsx({\n [styles.unfocusable]: hasDrawerViewportOverlay,\n })}\n aria-label={drawersAriaLabel}\n role=\"region\"\n >\n <div className={styles['drawers-mobile-triggers-container']} role=\"toolbar\" aria-orientation=\"horizontal\">\n {visibleItems.map(item => (\n <InternalButton\n ariaExpanded={item.id === activeDrawerId}\n ariaLabel={item.ariaLabels?.triggerButton}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n disabled={hasDrawerViewportOverlay}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n formAction=\"none\"\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n badge={item.badge}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n variant=\"icon\"\n __nativeAttributes={{ 'aria-haspopup': true, 'data-testid': `awsui-app-layout-trigger-${item.id}` }}\n />\n ))}\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n onItemClick={({ detail }) => handleDrawersClick(detail.id)}\n />\n )}\n </div>\n </aside>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"drawers.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/drawers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,wBAAwB,MAAM,8CAA8C,CAAC;AACpF,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC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EAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,EAC1C,MAAM,EAAE,4BAA4B,IAAI,CAAC,EAAE,EAAE,EAC7C,kBAAkB,EAAE,aAAa,KAAK,eAAe,EACrD,QAAQ,EAAE,IAAI,CAAC,EAAE,KAAK,cAAc,GACpC,CACH,CAAA;aAAA,CAAC;YACD,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,CAC3B,oBAAC,YAAY,IACX,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,wBAAwB,EAC9F,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,GAC1D,CACH,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { InternalButton } from '../../button/internal';\nimport customCssProps from '../../internal/generated/custom-css-properties';\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { splitItems } from '../drawer/drawers-helpers';\nimport OverflowMenu from '../drawer/overflow-menu';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\nimport { useAppLayoutInternals } from './context';\nimport SplitPanel from './split-panel';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\n/**\n * The VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT is used to reduce the number\n * of triggers that are initially visible on the mobile toolbar, the rest\n * are then placed into an overflow menu\n *\n * Note if one of the triggers is for a split-panel, it would not count that\n */\nexport const VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT = 2;\n\n/**\n * The Drawers root component is mounted in the AppLayout index file. It will only\n * render if the drawers are defined, and it will take over the mounting of and\n * rendering of the Tools and SplitPanel (side position) if they exist. If drawers\n * do not exist then the Tools and SplitPanel will be handled by the Tools component.\n */\nexport default function Drawers() {\n const {\n disableBodyScroll,\n drawers,\n drawersTriggerCount,\n hasDrawerViewportOverlay,\n hasOpenDrawer,\n navigationOpen,\n navigationHide,\n isMobile,\n } = useAppLayoutInternals();\n\n const isUnfocusable = hasDrawerViewportOverlay && navigationOpen && !navigationHide;\n\n if (!drawers || drawersTriggerCount === 0) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['drawers-container'], {\n [styles['disable-body-scroll']]: disableBodyScroll,\n [styles['has-open-drawer']]: hasOpenDrawer,\n [styles.unfocusable]: isUnfocusable,\n })}\n >\n <SplitPanel.Side />\n <ActiveDrawer />\n {!isMobile && <DesktopTriggers />}\n </div>\n );\n}\n\nfunction ActiveDrawer() {\n const {\n activeDrawerId,\n ariaLabels,\n drawers,\n drawersRefs,\n handleDrawersClick,\n handleToolsClick,\n hasDrawerViewportOverlay,\n isMobile,\n navigationOpen,\n navigationHide,\n loseDrawersFocus,\n resizeHandle,\n drawerSize,\n drawersMinWidth,\n drawersMaxWidth,\n drawerRef,\n } = useAppLayoutInternals();\n\n const activeDrawer = drawers?.find(item => item.id === activeDrawerId) ?? null;\n\n const computedAriaLabels = {\n closeButton: activeDrawerId ? activeDrawer?.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawerId ? activeDrawer?.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const isHidden = !activeDrawerId;\n const isUnfocusable = isHidden || (hasDrawerViewportOverlay && navigationOpen && !navigationHide);\n const isToolsDrawer = activeDrawerId === TOOLS_DRAWER_ID;\n const toolsContent = drawers?.find(drawer => drawer.id === TOOLS_DRAWER_ID)?.content;\n\n const size = getLimitedValue(drawersMinWidth, drawerSize, drawersMaxWidth);\n\n return (\n <aside\n id={activeDrawerId ?? undefined}\n aria-hidden={isHidden}\n aria-label={computedAriaLabels.content}\n className={clsx(styles.drawer, {\n [styles['is-drawer-open']]: activeDrawerId,\n [styles.unfocusable]: isUnfocusable,\n [testutilStyles['active-drawer']]: activeDrawerId,\n [testutilStyles.tools]: isToolsDrawer,\n })}\n style={{\n ...(!isMobile && drawerSize && { [customCssProps.drawerSize]: `${size}px` }),\n }}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseDrawersFocus();\n }\n }}\n >\n {!isMobile && activeDrawer?.resizable && <div className={styles['drawer-slider']}>{resizeHandle}</div>}\n <div className={styles['drawer-content-container']}>\n <div className={styles['drawer-close-button']}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n [testutilStyles['tools-close']]: isToolsDrawer,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => {\n handleDrawersClick(activeDrawerId);\n handleToolsClick(false);\n }}\n ref={drawersRefs.close}\n variant=\"icon\"\n />\n </div>\n {toolsContent && (\n <div\n className={clsx(\n styles['drawer-content'],\n activeDrawerId !== TOOLS_DRAWER_ID && styles['drawer-content-hidden']\n )}\n >\n {toolsContent}\n </div>\n )}\n {activeDrawerId !== TOOLS_DRAWER_ID && (\n <div className={styles['drawer-content']}>{activeDrawerId && activeDrawer?.content}</div>\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The DesktopTriggers will render the trigger buttons for Tools, Drawers, and the\n * SplitPanel in non mobile viewports. Changes to the activeDrawerId need to be\n * tracked by the previousActiveDrawerId property in order to appropriately apply\n * the ref required to manage focus control.\n */\nfunction DesktopTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n drawersTriggerCount,\n handleDrawersClick,\n handleSplitPanelClick,\n hasOpenDrawer,\n isSplitPanelOpen,\n splitPanel,\n splitPanelControlId,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n splitPanelReportedHeaderHeight,\n splitPanelReportedSize,\n headerVariant,\n } = useAppLayoutInternals();\n\n const hasMultipleTriggers = drawersTriggerCount > 1;\n const hasSplitPanel = splitPanel && splitPanelDisplayed && splitPanelPosition === 'side';\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n const [containerHeight, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxHeight);\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const splitPanelHeight =\n isSplitPanelOpen && splitPanelPosition === 'bottom' ? splitPanelReportedSize : splitPanelReportedHeaderHeight;\n\n const getIndexOfOverflowItem = () => {\n if (containerHeight) {\n const ITEM_HEIGHT = 48;\n const overflowSpot =\n activeDrawerId && isSplitPanelOpen\n ? (containerHeight - splitPanelReportedHeaderHeight) / 1.5\n : (containerHeight - splitPanelHeight) / 1.5;\n\n const index = Math.floor(overflowSpot / ITEM_HEIGHT);\n\n let splitPanelItem = 0;\n if (hasSplitPanel && splitPanelToggle.displayed) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n\n return 0;\n };\n\n const { visibleItems, overflowItems } = splitItems(drawers ?? undefined, getIndexOfOverflowItem(), activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n className={clsx(styles['drawers-desktop-triggers-container'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n aria-label={drawersAriaLabel}\n ref={triggersContainerRef}\n role=\"region\"\n >\n <div\n className={clsx(styles['drawers-trigger-content'], {\n [styles['has-multiple-triggers']]: hasMultipleTriggers,\n [styles['has-open-drawer']]: hasOpenDrawer,\n })}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n >\n {visibleItems.map(item => {\n return (\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={item.id === activeDrawerId}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n selected={item.id === activeDrawerId}\n />\n );\n })}\n\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], testUtilsClass)}\n iconName=\"ellipsis\"\n onClick={onClick}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n onItemClick={({ detail }) => {\n handleDrawersClick(detail.id);\n }}\n />\n )}\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n ariaControls={splitPanelControlId}\n ariaExpanded={!!isSplitPanelOpen}\n className={clsx(styles['drawers-trigger'], splitPanelTestUtilStyles['open-button'])}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n ref={splitPanelRefs.toggle}\n highContrastHeader={headerVariant === 'high-contrast'}\n />\n )}\n </div>\n </aside>\n );\n}\n\n/**\n * The MobileTriggers will be mounted inside of the AppBar component and\n * only rendered when Drawers are defined in mobile viewports. The same logic\n * will in the AppBar component will suppress the rendering of the legacy\n * trigger button for the Tools drawer.\n */\nexport function MobileTriggers() {\n const {\n activeDrawerId,\n drawers,\n drawersAriaLabel,\n drawersOverflowAriaLabel,\n drawersOverflowWithBadgeAriaLabel,\n drawersRefs,\n handleDrawersClick,\n hasDrawerViewportOverlay,\n headerVariant,\n } = useAppLayoutInternals();\n\n const previousActiveDrawerId = useRef(activeDrawerId);\n\n if (!drawers) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveDrawerId.current = activeDrawerId;\n }\n\n const { visibleItems, overflowItems } = splitItems(drawers, VISIBLE_MOBILE_TOOLBAR_TRIGGERS_LIMIT, activeDrawerId);\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n\n return (\n <aside\n aria-hidden={hasDrawerViewportOverlay}\n className={clsx({\n [styles.unfocusable]: hasDrawerViewportOverlay,\n })}\n aria-label={drawersAriaLabel}\n role=\"region\"\n >\n <div className={styles['drawers-mobile-triggers-container']} role=\"toolbar\" aria-orientation=\"horizontal\">\n {visibleItems.map(item => (\n <TriggerButton\n ariaExpanded={item.id === activeDrawerId}\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n `awsui-app-layout-trigger-${item.id}`,\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n disabled={hasDrawerViewportOverlay}\n ref={item.id === previousActiveDrawerId.current ? drawersRefs.toggle : undefined}\n iconName={item.trigger.iconName}\n iconSvg={item.trigger.iconSvg}\n badge={item.badge}\n key={item.id}\n onClick={() => handleDrawersClick(item.id)}\n testId={`awsui-app-layout-trigger-${item.id}`}\n highContrastHeader={headerVariant === 'high-contrast'}\n selected={item.id === activeDrawerId}\n />\n ))}\n {overflowItems.length > 0 && (\n <OverflowMenu\n items={overflowItems}\n ariaLabel={overflowMenuHasBadge ? drawersOverflowWithBadgeAriaLabel : drawersOverflowAriaLabel}\n onItemClick={({ detail }) => handleDrawersClick(detail.id)}\n />\n )}\n </div>\n </aside>\n );\n}\n"]}
|
|
@@ -8,9 +8,16 @@ export interface TriggerButtonProps {
|
|
|
8
8
|
iconSvg?: React.ReactNode;
|
|
9
9
|
ariaExpanded: boolean | undefined;
|
|
10
10
|
ariaControls?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Ovewrwrites any internal testIds when provided
|
|
14
|
+
*/
|
|
11
15
|
testId?: string;
|
|
12
|
-
|
|
16
|
+
/**
|
|
17
|
+
* If button is selected. Used only for desktop and applies a selected class for desktop. Mobile does not need the class as the trigger buttons are hidden by the open drawer
|
|
18
|
+
*/
|
|
13
19
|
selected?: boolean;
|
|
20
|
+
onClick: () => void;
|
|
14
21
|
badge?: boolean;
|
|
15
22
|
highContrastHeader?: boolean;
|
|
16
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-button.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"trigger-button.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh/trigger-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAc,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMlD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;;AA6ED,wBAA+C"}
|