@cloudscape-design/components 3.0.1086 → 3.0.1088

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/app-layout/runtime-drawer/index.d.ts +3 -0
  2. package/app-layout/runtime-drawer/index.d.ts.map +1 -1
  3. package/app-layout/runtime-drawer/index.js +19 -2
  4. package/app-layout/runtime-drawer/index.js.map +1 -1
  5. package/app-layout/utils/use-ai-drawer.d.ts +2 -0
  6. package/app-layout/utils/use-ai-drawer.d.ts.map +1 -1
  7. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  8. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +49 -11
  9. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  10. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +52 -9
  12. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  13. package/app-layout/visual-refresh-toolbar/interfaces.d.ts +4 -0
  14. package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  15. package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  16. package/button/icon-helper.d.ts.map +1 -1
  17. package/button/icon-helper.js +1 -2
  18. package/button/icon-helper.js.map +1 -1
  19. package/button/internal.d.ts +0 -2
  20. package/button/internal.d.ts.map +1 -1
  21. package/button/internal.js +2 -3
  22. package/button/internal.js.map +1 -1
  23. package/button/styles.css.js +22 -21
  24. package/button/styles.scoped.css +72 -68
  25. package/button/styles.selectors.js +22 -21
  26. package/button/test-classes/styles.css.js +2 -5
  27. package/button/test-classes/styles.scoped.css +5 -5
  28. package/button/test-classes/styles.selectors.js +2 -5
  29. package/button-group/icon-button-item.d.ts +2 -2
  30. package/button-group/icon-button-item.d.ts.map +1 -1
  31. package/button-group/icon-button-item.js +1 -1
  32. package/button-group/icon-button-item.js.map +1 -1
  33. package/button-group/interfaces.d.ts +6 -0
  34. package/button-group/interfaces.d.ts.map +1 -1
  35. package/button-group/interfaces.js.map +1 -1
  36. package/internal/base-component/styles.scoped.css +1 -1
  37. package/internal/environment.js +2 -2
  38. package/internal/environment.json +2 -2
  39. package/internal/manifest.json +1 -1
  40. package/internal/plugins/controllers/drawers.d.ts +3 -0
  41. package/internal/plugins/controllers/drawers.d.ts.map +1 -1
  42. package/internal/plugins/controllers/drawers.js +0 -2
  43. package/internal/plugins/controllers/drawers.js.map +1 -1
  44. package/internal/plugins/widget/interfaces.d.ts +3 -0
  45. package/internal/plugins/widget/interfaces.d.ts.map +1 -1
  46. package/internal/plugins/widget/interfaces.js.map +1 -1
  47. package/package.json +1 -1
  48. package/select/parts/filter.d.ts +1 -1
  49. package/test-utils/dom/button/index.js +5 -4
  50. package/test-utils/dom/button/index.js.map +1 -1
  51. package/test-utils/dom/toggle-button/index.js +4 -3
  52. package/test-utils/dom/toggle-button/index.js.map +1 -1
  53. package/test-utils/selectors/button/index.js +5 -4
  54. package/test-utils/selectors/button/index.js.map +1 -1
  55. package/test-utils/selectors/toggle-button/index.js +2 -2
  56. package/test-utils/selectors/toggle-button/index.js.map +1 -1
  57. package/toggle-button/internal.d.ts.map +1 -1
  58. package/toggle-button/internal.js +2 -3
  59. package/toggle-button/internal.js.map +1 -1
  60. package/toggle-button/test-classes/styles.css.js +0 -7
  61. package/toggle-button/test-classes/styles.scoped.css +0 -8
  62. package/toggle-button/test-classes/styles.selectors.js +0 -8
@@ -1,3 +1,4 @@
1
+ import { ButtonGroupProps } from '../../button-group/interfaces';
1
2
  import { NonCancelableEventHandler } from '../../internal/events';
2
3
  import { DrawerConfig as RuntimeDrawerConfig, DrawerStateChangeParams } from '../../internal/plugins/controllers/drawers';
3
4
  import { DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';
@@ -13,9 +14,11 @@ export interface DrawersLayout {
13
14
  export declare const mapRuntimeConfigToDrawer: (runtimeConfig: RuntimeDrawerConfig) => AppLayoutProps.Drawer & {
14
15
  orderPriority?: number;
15
16
  onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;
17
+ headerActions?: ReadonlyArray<ButtonGroupProps.Item>;
16
18
  };
17
19
  export declare const mapRuntimeConfigToAiDrawer: (runtimeConfig: RuntimeAiDrawerConfig) => AppLayoutProps.Drawer & {
18
20
  orderPriority?: number;
19
21
  onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;
22
+ headerActions?: ReadonlyArray<ButtonGroupProps.Item>;
20
23
  };
21
24
  export declare function convertRuntimeDrawers(localDrawers: Array<RuntimeDrawerConfig>, globalDrawers: Array<RuntimeDrawerConfig>): DrawersLayout;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/runtime-drawer/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA0B,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,uBAAuB,EACxB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/C,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,MAAM;IAC1D,QAAQ,CAAC,EAAE,yBAAyB,CAAC,uBAAuB,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAClC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAClC;AAyDD,eAAO,MAAM,wBAAwB,kBACpB,mBAAmB,KACjC,eAAe,MAAM,GAAG;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,0B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C,CAAC;CA8BtD,CAAC;AAEF,eAAO,MAAM,0BAA0B,kBACtB,qBAAqB,KACnC,eAAe,MAAM,GAAG;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,0BAA0B,uBAAuB,CAAC,CAAC;IAC9D,aAAa,CAAC,EAAE,cAAc,iBAAiB,IAAI,CAAC,CAAC;CAqCtD,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,KAAK,CAAC,mBAAmB,CAAC,EACxC,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,GACxC,aAAa,CAQf"}
@@ -2,6 +2,7 @@ import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import React, { useContext, useEffect, useRef } from 'react';
5
+ import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
5
6
  import { fireNonCancelableEvent } from '../../internal/events';
6
7
  import { sortByPriority } from '../../internal/plugins/helpers/utils';
7
8
  import { ActiveDrawersContext } from '../utils/visibility-context';
@@ -42,6 +43,22 @@ function RuntimeDrawerHeader({ mountHeader, unmountHeader }) {
42
43
  }, []);
43
44
  return React.createElement("div", { className: styles['runtime-header-wrapper'], ref: ref });
44
45
  }
46
+ function checkForUnsupportedProps(headerActions) {
47
+ const unsupportedProps = new Set([
48
+ 'iconSvg',
49
+ 'popoverFeedback',
50
+ 'pressedIconSvg',
51
+ 'popoverFeedback',
52
+ 'pressedPopoverFeedback',
53
+ ]);
54
+ for (const item of headerActions) {
55
+ const unsupported = Object.keys(item).filter(key => unsupportedProps.has(key));
56
+ if (unsupported.length > 0) {
57
+ warnOnce('AppLayout', `The headerActions properties are not supported for runtime api: ${unsupported.join(' ')}`);
58
+ }
59
+ }
60
+ return headerActions;
61
+ }
45
62
  export const mapRuntimeConfigToDrawer = (runtimeConfig) => {
46
63
  var _a;
47
64
  const { mountContent, unmountContent, trigger } = runtimeConfig, runtimeDrawer = __rest(runtimeConfig, ["mountContent", "unmountContent", "trigger"]);
@@ -52,7 +69,7 @@ export const mapRuntimeConfigToDrawer = (runtimeConfig) => {
52
69
  React.createElement("span", { dangerouslySetInnerHTML: { __html: trigger.iconSvg } })),
53
70
  })) : undefined, content: (React.createElement(RuntimeDrawerWrapper, { key: runtimeDrawer.id, mountContent: mountContent, unmountContent: unmountContent, id: runtimeDrawer.id })), onResize: event => {
54
71
  fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });
55
- } });
72
+ }, headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined });
56
73
  };
57
74
  export const mapRuntimeConfigToAiDrawer = (runtimeConfig) => {
58
75
  var _a;
@@ -70,7 +87,7 @@ export const mapRuntimeConfigToAiDrawer = (runtimeConfig) => {
70
87
  header: (React.createElement(RuntimeDrawerHeader, { mountHeader: runtimeDrawer.mountHeader, unmountHeader: runtimeDrawer.unmountHeader })),
71
88
  })), { onResize: event => {
72
89
  fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });
73
- } });
90
+ }, headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined });
74
91
  };
75
92
  export function convertRuntimeDrawers(localDrawers, globalDrawers) {
76
93
  const converted = localDrawers.map(mapRuntimeConfigToDrawer);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/runtime-drawer/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAK1F,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,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AAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;QACpG,CAAC,IACD;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,YAAwC,EACxC,aAAyC;IAEzC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO;QACL,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC;QACjE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;KAClE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useRef } from 'react';\n\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../internal/events';\nimport {\n DrawerConfig as RuntimeDrawerConfig,\n DrawerStateChangeParams,\n} from '../../internal/plugins/controllers/drawers';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ActiveDrawersContext } from '../utils/visibility-context';\n\nimport styles from './styles.css.js';\n\nexport interface RuntimeDrawer extends AppLayoutProps.Drawer {\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n}\n\nexport interface DrawersLayout {\n global: Array<RuntimeDrawer>;\n localBefore: Array<RuntimeDrawer>;\n localAfter: Array<RuntimeDrawer>;\n}\n\ntype VisibilityCallback = (isVisible: boolean) => void;\n\ninterface RuntimeContentWrapperProps {\n id?: string;\n mountContent: RuntimeDrawerConfig['mountContent'];\n unmountContent: RuntimeDrawerConfig['unmountContent'];\n}\n\nfunction RuntimeDrawerWrapper({ mountContent, unmountContent, id }: RuntimeContentWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n const visibilityChangeCallback = useRef<VisibilityCallback | null>(null);\n const activeDrawersIds = useContext(ActiveDrawersContext);\n const isVisible = !!id && activeDrawersIds.includes(id);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container, {\n onVisibilityChange: cb => {\n visibilityChangeCallback.current = cb;\n },\n });\n return () => {\n unmountContent(container);\n visibilityChangeCallback.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n visibilityChangeCallback.current?.(isVisible);\n }, [isVisible]);\n\n return <div ref={ref} className={styles['runtime-content-wrapper']} data-awsui-runtime-drawer-root-id={id}></div>;\n}\n\ninterface RuntimeContentHeaderProps {\n mountHeader: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n}\n\nfunction RuntimeDrawerHeader({ mountHeader, unmountHeader }: RuntimeContentHeaderProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountHeader?.(container);\n return () => {\n unmountHeader?.(container);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div className={styles['runtime-header-wrapper']} ref={ref} />;\n}\n\nexport const mapRuntimeConfigToDrawer = (\n runtimeConfig: RuntimeDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n} => {\n const { mountContent, unmountContent, trigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: trigger\n ? {\n ...(trigger.iconSvg && {\n iconSvg: (\n // eslint-disable-next-line react/no-danger\n <span dangerouslySetInnerHTML={{ __html: trigger.iconSvg }} />\n ),\n }),\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n };\n};\n\nexport const mapRuntimeConfigToAiDrawer = (\n runtimeConfig: RuntimeAiDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n} => {\n const { mountContent, unmountContent, trigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: trigger\n ? {\n customIcon: trigger?.customIcon ? (\n // eslint-disable-next-line react/no-danger\n <span style={{ lineHeight: 0 }} dangerouslySetInnerHTML={{ __html: trigger.customIcon }} />\n ) : undefined,\n iconSvg: trigger.iconSvg ? (\n // eslint-disable-next-line react/no-danger\n <span dangerouslySetInnerHTML={{ __html: trigger.iconSvg }} />\n ) : undefined,\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n ...(runtimeDrawer.mountHeader && {\n header: (\n <RuntimeDrawerHeader mountHeader={runtimeDrawer.mountHeader} unmountHeader={runtimeDrawer.unmountHeader} />\n ),\n }),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n };\n};\n\nexport function convertRuntimeDrawers(\n localDrawers: Array<RuntimeDrawerConfig>,\n globalDrawers: Array<RuntimeDrawerConfig>\n): DrawersLayout {\n const converted = localDrawers.map(mapRuntimeConfigToDrawer);\n const sorted = sortByPriority(converted);\n return {\n global: sortByPriority(globalDrawers.map(mapRuntimeConfigToDrawer)),\n localBefore: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n localAfter: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/runtime-drawer/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAK1F,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAoBrC,SAAS,oBAAoB,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,EAA8B;IAC5F,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,wBAAwB,GAAG,MAAM,CAA4B,IAAI,CAAC,CAAC;IACzE,MAAM,gBAAgB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,GAAG,CAAC,OAAQ,CAAC;QAC/B,YAAY,CAAC,SAAS,EAAE;YACtB,kBAAkB,EAAE,EAAE,CAAC,EAAE;gBACvB,wBAAwB,CAAC,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a,CAAC,aAAa,GAAI,CAC5G;KACF,CAAC,KACF,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,sBAAsB,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;QACpG,CAAC,EACD,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAwB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,IAC9G;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,YAAwC,EACxC,aAAyC;IAEzC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO;QACL,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC;QACjE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;KAClE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useRef } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonGroupProps } from '../../button-group/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../internal/events';\nimport {\n DrawerConfig as RuntimeDrawerConfig,\n DrawerStateChangeParams,\n} from '../../internal/plugins/controllers/drawers';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ActiveDrawersContext } from '../utils/visibility-context';\n\nimport styles from './styles.css.js';\n\nexport interface RuntimeDrawer extends AppLayoutProps.Drawer {\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n}\n\nexport interface DrawersLayout {\n global: Array<RuntimeDrawer>;\n localBefore: Array<RuntimeDrawer>;\n localAfter: Array<RuntimeDrawer>;\n}\n\ntype VisibilityCallback = (isVisible: boolean) => void;\n\ninterface RuntimeContentWrapperProps {\n id?: string;\n mountContent: RuntimeDrawerConfig['mountContent'];\n unmountContent: RuntimeDrawerConfig['unmountContent'];\n}\n\nfunction RuntimeDrawerWrapper({ mountContent, unmountContent, id }: RuntimeContentWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n const visibilityChangeCallback = useRef<VisibilityCallback | null>(null);\n const activeDrawersIds = useContext(ActiveDrawersContext);\n const isVisible = !!id && activeDrawersIds.includes(id);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container, {\n onVisibilityChange: cb => {\n visibilityChangeCallback.current = cb;\n },\n });\n return () => {\n unmountContent(container);\n visibilityChangeCallback.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n visibilityChangeCallback.current?.(isVisible);\n }, [isVisible]);\n\n return <div ref={ref} className={styles['runtime-content-wrapper']} data-awsui-runtime-drawer-root-id={id}></div>;\n}\n\ninterface RuntimeContentHeaderProps {\n mountHeader: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n}\n\nfunction RuntimeDrawerHeader({ mountHeader, unmountHeader }: RuntimeContentHeaderProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountHeader?.(container);\n return () => {\n unmountHeader?.(container);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div className={styles['runtime-header-wrapper']} ref={ref} />;\n}\n\nfunction checkForUnsupportedProps(headerActions: ReadonlyArray<ButtonGroupProps.Item>) {\n const unsupportedProps = new Set([\n 'iconSvg',\n 'popoverFeedback',\n 'pressedIconSvg',\n 'popoverFeedback',\n 'pressedPopoverFeedback',\n ]);\n for (const item of headerActions) {\n const unsupported = Object.keys(item).filter(key => unsupportedProps.has(key));\n if (unsupported.length > 0) {\n warnOnce('AppLayout', `The headerActions properties are not supported for runtime api: ${unsupported.join(' ')}`);\n }\n }\n return headerActions;\n}\n\nexport const mapRuntimeConfigToDrawer = (\n runtimeConfig: RuntimeDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n} => {\n const { mountContent, unmountContent, trigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: trigger\n ? {\n ...(trigger.iconSvg && {\n iconSvg: (\n // eslint-disable-next-line react/no-danger\n <span dangerouslySetInnerHTML={{ __html: trigger.iconSvg }} />\n ),\n }),\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,\n };\n};\n\nexport const mapRuntimeConfigToAiDrawer = (\n runtimeConfig: RuntimeAiDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n} => {\n const { mountContent, unmountContent, trigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: trigger\n ? {\n customIcon: trigger?.customIcon ? (\n // eslint-disable-next-line react/no-danger\n <span style={{ lineHeight: 0 }} dangerouslySetInnerHTML={{ __html: trigger.customIcon }} />\n ) : undefined,\n iconSvg: trigger.iconSvg ? (\n // eslint-disable-next-line react/no-danger\n <span dangerouslySetInnerHTML={{ __html: trigger.iconSvg }} />\n ) : undefined,\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n ...(runtimeDrawer.mountHeader && {\n header: (\n <RuntimeDrawerHeader mountHeader={runtimeDrawer.mountHeader} unmountHeader={runtimeDrawer.unmountHeader} />\n ),\n }),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,\n };\n};\n\nexport function convertRuntimeDrawers(\n localDrawers: Array<RuntimeDrawerConfig>,\n globalDrawers: Array<RuntimeDrawerConfig>\n): DrawersLayout {\n const converted = localDrawers.map(mapRuntimeConfigToDrawer);\n const sorted = sortByPriority(converted);\n return {\n global: sortByPriority(globalDrawers.map(mapRuntimeConfigToDrawer)),\n localBefore: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n localAfter: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
@@ -17,6 +17,7 @@ export declare function useAiDrawer({
17
17
  aiDrawer: (import("..").AppLayoutProps.Drawer & {
18
18
  orderPriority?: number | undefined;
19
19
  onToggle?: import("../../internal/events").NonCancelableEventHandler<import("../../internal/plugins/controllers/drawers").DrawerStateChangeParams> | undefined;
20
+ headerActions?: readonly import("../..").ButtonGroupProps.Item[] | undefined;
20
21
  }) | null;
21
22
  onActiveAiDrawerChange: (newDrawerId: string | null, {
22
23
  initiatedByUserAction
@@ -24,6 +25,7 @@ export declare function useAiDrawer({
24
25
  activeAiDrawer: (import("..").AppLayoutProps.Drawer & {
25
26
  orderPriority?: number | undefined;
26
27
  onToggle?: import("../../internal/events").NonCancelableEventHandler<import("../../internal/plugins/controllers/drawers").DrawerStateChangeParams> | undefined;
28
+ headerActions?: readonly import("../..").ButtonGroupProps.Item[] | undefined;
27
29
  }) | null;
28
30
  activeAiDrawerId: string | null;
29
31
  activeAiDrawerSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-ai-drawer.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAsED,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,UAAU,eAAe;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,EAAE,eAAe;;;;;0CAUjG,MAAM,GAAG,IAAI,8BACC,cAAc;;;;;;;;mCAPL,MAAM;EAwC7C"}
1
+ {"version":3,"file":"use-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/utils/use-ai-drawer.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAsED,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,UAAU,eAAe;IACvB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,EAAE,eAAe;;;;;;0CAUjG,MAAM,GAAG,IAAI,8BACC,cAAc;;;;;;;;;mCAPL,MAAM;EAwC7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"global-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAOnE,UAAU,aAAa;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC;IAChB,oBAAoB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACpD,sBAAsB,EAAE,SAAS,GAAG,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC,CAAC;IACpG,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,UAAU,0CAA0C;IAClD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,wBAAgB,qCAAqC,CAAC,EACpD,kBAAkB,EAClB,IAAI,EACJ,cAAc,EACd,aAAa,GACd,EAAE,0CAA0C,eAoK5C"}
1
+ {"version":3,"file":"global-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAOnE,UAAU,aAAa;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC;IAChB,oBAAoB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACpD,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACpD,sBAAsB,EAAE,SAAS,GAAG,CAAC,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC,CAAC;IACpG,oBAAoB,EAAE,CAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,UAAU,0CAA0C;IAClD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,wBAAgB,qCAAqC,CAAC,EACpD,kBAAkB,EAClB,IAAI,EACJ,cAAc,EACd,aAAa,GACd,EAAE,0CAA0C,eAyL5C"}
@@ -3,7 +3,7 @@
3
3
  import React, { useRef } from 'react';
4
4
  import { Transition } from 'react-transition-group';
5
5
  import clsx from 'clsx';
6
- import { InternalButton } from '../../../button/internal';
6
+ import ButtonGroup from '../../../button-group/internal';
7
7
  import PanelResizeHandle from '../../../internal/components/panel-resize-handle';
8
8
  import customCssProps from '../../../internal/generated/custom-css-properties';
9
9
  import { usePrevious } from '../../../internal/hooks/use-previous';
@@ -13,7 +13,7 @@ import sharedStyles from '../../resize/styles.css.js';
13
13
  import testutilStyles from '../../test-classes/styles.css.js';
14
14
  import styles from './styles.css.js';
15
15
  export function AppLayoutGlobalAiDrawerImplementation({ appLayoutInternals, show, activeAiDrawer, aiDrawerProps, }) {
16
- var _a, _b;
16
+ var _a, _b, _c, _d;
17
17
  const { activeAiDrawerSize, minAiDrawerSize, maxAiDrawerSize, ariaLabels, aiDrawerFocusControl, isMobile, drawersOpenQueue, onActiveAiDrawerChange, onActiveDrawerResize, expandedDrawerId, setExpandedDrawerId, } = aiDrawerProps;
18
18
  const { verticalOffsets, placement } = appLayoutInternals;
19
19
  const drawerRef = useRef(null);
@@ -42,9 +42,40 @@ export function AppLayoutGlobalAiDrawerImplementation({ appLayoutInternals, show
42
42
  // (window is between mobile and desktop sizes). At this point, the drawer can't be
43
43
  // resized in either direction, so we disable the resize handler
44
44
  const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;
45
+ let drawerActions = [
46
+ {
47
+ type: 'icon-button',
48
+ id: 'close',
49
+ iconName: isMobile ? 'close' : 'angle-left',
50
+ text: computedAriaLabels.closeButton,
51
+ analyticsAction: 'close',
52
+ },
53
+ ];
54
+ if (!isMobile && (activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.isExpandable)) {
55
+ drawerActions = [
56
+ {
57
+ type: 'icon-button',
58
+ id: 'expand',
59
+ iconName: isExpanded ? 'shrink' : 'expand',
60
+ text: (_d = (_c = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.expandedModeButton) !== null && _d !== void 0 ? _d : '',
61
+ analyticsAction: isExpanded ? 'expand' : 'collapse',
62
+ },
63
+ ...drawerActions,
64
+ ];
65
+ }
66
+ if (activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.headerActions) {
67
+ drawerActions = [
68
+ {
69
+ type: 'group',
70
+ text: 'Actions',
71
+ items: activeAiDrawer.headerActions,
72
+ },
73
+ ...drawerActions,
74
+ ];
75
+ }
45
76
  return (React.createElement(Transition, { nodeRef: drawerRef, in: show, appear: show, mountOnEnter: true, timeout: 250 }, drawerTransitionState => {
46
77
  return (React.createElement(Transition, { nodeRef: drawerRef, in: isExpanded, timeout: 250 }, expandedTransitionState => {
47
- var _a, _b, _c, _d, _e, _f;
78
+ var _a, _b, _c, _d, _e;
48
79
  return (React.createElement("aside", { id: activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.id, "aria-hidden": !activeAiDrawer, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['ai-drawer'], !animationDisabled && isExpanded && styles['with-expanded-motion'], {
49
80
  [sharedStyles['with-motion-horizontal']]: !animationDisabled,
50
81
  [testutilStyles['active-drawer']]: show,
@@ -66,15 +97,22 @@ export function AppLayoutGlobalAiDrawerImplementation({ appLayoutInternals, show
66
97
  React.createElement("header", { className: styles['drawer-content-header'] },
67
98
  React.createElement("div", { className: styles['drawer-content-header-content'] }, (_c = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.header) !== null && _c !== void 0 ? _c : React.createElement("div", null),
68
99
  React.createElement("div", { className: styles['drawer-actions'] },
69
- !isMobile && (activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.isExpandable) && (React.createElement("div", { className: styles['drawer-expanded-mode-button'] },
70
- React.createElement(InternalButton, { ariaLabel: (_d = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.expandedModeButton, className: testutilStyles['active-drawer-expanded-mode-button'], formAction: "none", ariaExpanded: isExpanded, iconName: isExpanded ? 'shrink' : 'expand', onClick: () => setExpandedDrawerId(isExpanded ? null : activeDrawerId), variant: "icon", analyticsAction: isExpanded ? 'expand' : 'collapse' }))),
71
- React.createElement("div", { className: clsx(styles['drawer-close-button']) },
72
- React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
73
- [testutilStyles['active-drawer-close-button']]: activeDrawerId,
74
- }), formAction: "none", iconName: isMobile ? 'close' : 'angle-left', onClick: () => onActiveAiDrawerChange === null || onActiveAiDrawerChange === void 0 ? void 0 : onActiveAiDrawerChange(null, { initiatedByUserAction: true }), ref: aiDrawerFocusControl === null || aiDrawerFocusControl === void 0 ? void 0 : aiDrawerFocusControl.refs.close, variant: "icon", analyticsAction: "close" })))),
75
- !isMobile && isExpanded && ((_e = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.exitExpandedModeButton) && (React.createElement("div", { className: styles['drawer-back-to-console-slot'] },
100
+ React.createElement(ButtonGroup, { dropdownExpandToViewport: false, variant: "icon", onItemClick: event => {
101
+ var _a;
102
+ switch (event.detail.id) {
103
+ case 'close':
104
+ onActiveAiDrawerChange === null || onActiveAiDrawerChange === void 0 ? void 0 : onActiveAiDrawerChange(null, { initiatedByUserAction: true });
105
+ break;
106
+ case 'expand':
107
+ setExpandedDrawerId(isExpanded ? null : activeDrawerId);
108
+ break;
109
+ default:
110
+ (_a = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.onHeaderActionClick) === null || _a === void 0 ? void 0 : _a.call(activeAiDrawer, event);
111
+ }
112
+ }, ariaLabel: "Left panel actions", items: drawerActions }))),
113
+ !isMobile && isExpanded && ((_d = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.exitExpandedModeButton) && (React.createElement("div", { className: styles['drawer-back-to-console-slot'] },
76
114
  React.createElement("div", { className: styles['drawer-back-to-console-button-wrapper'] },
77
- React.createElement("button", { className: clsx(testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'], styles['drawer-back-to-console-button']), formAction: "none", onClick: () => setExpandedDrawerId(null) }, (_f = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _f === void 0 ? void 0 : _f.exitExpandedModeButton))))), activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 :
115
+ React.createElement("button", { className: clsx(testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'], styles['drawer-back-to-console-button']), formAction: "none", onClick: () => setExpandedDrawerId(null) }, (_e = activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 : activeAiDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.exitExpandedModeButton))))), activeAiDrawer === null || activeAiDrawer === void 0 ? void 0 :
78
116
  activeAiDrawer.content))));
79
117
  }));
80
118
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"global-ai-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAKxE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAwBrC,MAAM,UAAU,qCAAqC,CAAC,EACpD,kBAAkB,EAClB,IAAI,EACJ,cAAc,EACd,aAAa,GAC8B;;IAC3C,MAAM,EACJ,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,GACpB,GAAG,aAAa,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,kBAAkB,CAAC;IAC1D,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,EAAE,CAAC;IAE1C,MAAM,kBAAkB,GAAG;QACzB,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,MAA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C,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,EAC3C,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAG,IAAI,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,EAC9E,GAAG,EAAE,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,IAAI,CAAC,KAAK,EACrC,OAAO,EAAC,MAAM,EACd,eAAe,EAAC,OAAO,GACvB,CACE,CACF,CACF;4BACL,CAAC,QAAQ,IAAI,UAAU,KAAI,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,CAAA,IAAI,CAChF,6BAAK,SAAS,EAAE,MAAM,CAAC,6BAA6B,CAAC;gCACnD,6BAAK,SAAS,EAAE,MAAM,CAAC,uCAAuC,CAAC;oCAC7D,gCACE,SAAS,EAAE,IAAI,CACb,cAAc,CAAC,oDAAoD,CAAC,EACpE,MAAM,CAAC,+BAA+B,CAAC,CACxC,EACD,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAEvC,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,CAC5C,CACL,CACF,CACP,CACM,EACR,cAAc,aAAd,cAAc;wBAAd,cAAc,CAAE,OAAO,CACpB,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACd,CAAC;IACJ,CAAC,CACU,CACd,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-ai-drawer';\nimport { FocusControlState } from '../../utils/use-focus-control';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AIDrawerProps {\n activeAiDrawerSize: number;\n minAiDrawerSize: number;\n aiDrawer: AppLayoutProps.Drawer | undefined;\n maxAiDrawerSize: number;\n ariaLabels: any;\n aiDrawerFocusControl: FocusControlState | undefined;\n isMobile: boolean;\n drawersOpenQueue: ReadonlyArray<string> | undefined;\n onActiveAiDrawerChange: undefined | ((newDrawerId: string | null, params?: OnChangeParams) => void);\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\ninterface AppLayoutGlobalAiDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeAiDrawer: InternalDrawer | null;\n aiDrawerProps: AIDrawerProps;\n}\n\nexport function AppLayoutGlobalAiDrawerImplementation({\n appLayoutInternals,\n show,\n activeAiDrawer,\n aiDrawerProps,\n}: AppLayoutGlobalAiDrawerImplementationProps) {\n const {\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize,\n expandedDrawerId,\n setExpandedDrawerId,\n } = aiDrawerProps;\n const { verticalOffsets, placement } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeAiDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeAiDrawer ? activeAiDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeAiDrawer ? activeAiDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const resizeProps = useResize({\n currentWidth: activeAiDrawerSize,\n minWidth: minAiDrawerSize,\n maxWidth: maxAiDrawerSize,\n panelRef: drawerRef,\n handleRef: aiDrawerFocusControl!.refs.slider,\n onResize: size => {\n onActiveDrawerResize({ id: activeDrawerId!, size });\n },\n position: 'side-start',\n });\n const size = getLimitedValue(minAiDrawerSize, activeAiDrawerSize, maxAiDrawerSize);\n const isExpanded = activeAiDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n (activeAiDrawer?.defaultActive && !drawersOpenQueue?.includes(activeAiDrawer.id)) || (wasExpanded && !isExpanded);\n const drawerHeight = `calc(100vh - ${verticalOffsets.toolbar + placement.insetBlockEnd}px)`;\n // disable resizing when the drawer is at its minimum width in a \"squeezed\" state\n // (window is between mobile and desktop sizes). At this point, the drawer can't be\n // resized in either direction, so we disable the resize handler\n const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} mountOnEnter={true} timeout={250}>\n {drawerTransitionState => {\n return (\n <Transition nodeRef={drawerRef} in={isExpanded} timeout={250}>\n {expandedTransitionState => {\n return (\n <aside\n id={activeAiDrawer?.id}\n aria-hidden={!activeAiDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['ai-drawer'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-hidden']]: !show && drawerTransitionState === 'exited',\n [testutilStyles['drawer-closed']]: !activeAiDrawer,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n aiDrawerFocusControl?.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: `${placement.insetBlockStart}px`,\n ...(!isMobile && {\n [customCssProps.drawerMinSize]: `${size}px`,\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(drawerTransitionState) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeAiDrawer?.resizable && (!isExpanded || expandedTransitionState !== 'entered') && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={aiDrawerFocusControl?.refs.slider}\n position=\"side-start\"\n className={clsx(testutilStyles['drawers-slider'], styles['ai-drawer-slider-handle'])}\n ariaLabel={activeAiDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeAiDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n disabled={isResizingDisabled}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={styles['drawer-content']}>\n <header className={styles['drawer-content-header']}>\n <div className={styles['drawer-content-header-content']}>\n {activeAiDrawer?.header ?? <div />}\n <div className={styles['drawer-actions']}>\n {!isMobile && activeAiDrawer?.isExpandable && (\n <div className={styles['drawer-expanded-mode-button']}>\n <InternalButton\n ariaLabel={activeAiDrawer?.ariaLabels?.expandedModeButton}\n className={testutilStyles['active-drawer-expanded-mode-button']}\n formAction=\"none\"\n ariaExpanded={isExpanded}\n iconName={isExpanded ? 'shrink' : 'expand'}\n onClick={() => setExpandedDrawerId(isExpanded ? null : activeDrawerId!)}\n variant=\"icon\"\n analyticsAction={isExpanded ? 'expand' : 'collapse'}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => onActiveAiDrawerChange?.(null, { initiatedByUserAction: true })}\n ref={aiDrawerFocusControl?.refs.close}\n variant=\"icon\"\n analyticsAction=\"close\"\n />\n </div>\n </div>\n </div>\n {!isMobile && isExpanded && activeAiDrawer?.ariaLabels?.exitExpandedModeButton && (\n <div className={styles['drawer-back-to-console-slot']}>\n <div className={styles['drawer-back-to-console-button-wrapper']}>\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n >\n {activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n </button>\n </div>\n </div>\n )}\n </header>\n {activeAiDrawer?.content}\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n }}\n </Transition>\n );\n}\n"]}
1
+ {"version":3,"file":"global-ai-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAKxE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAwBrC,MAAM,UAAU,qCAAqC,CAAC,EACpD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CAAC;gCACnD,6BAAK,SAAS,EAAE,MAAM,CAAC,uCAAuC,CAAC;oCAC7D,gCACE,SAAS,EAAE,IAAI,CACb,cAAc,CAAC,oDAAoD,CAAC,EACpE,MAAM,CAAC,+BAA+B,CAAC,CACxC,EACD,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAEvC,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,0CAAE,sBAAsB,CAC5C,CACL,CACF,CACP,CACM,EACR,cAAc,aAAd,cAAc;wBAAd,cAAc,CAAE,OAAO,CACpB,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACd,CAAC;IACJ,CAAC,CACU,CACd,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-ai-drawer';\nimport { FocusControlState } from '../../utils/use-focus-control';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AIDrawerProps {\n activeAiDrawerSize: number;\n minAiDrawerSize: number;\n aiDrawer: AppLayoutProps.Drawer | undefined;\n maxAiDrawerSize: number;\n ariaLabels: any;\n aiDrawerFocusControl: FocusControlState | undefined;\n isMobile: boolean;\n drawersOpenQueue: ReadonlyArray<string> | undefined;\n onActiveAiDrawerChange: undefined | ((newDrawerId: string | null, params?: OnChangeParams) => void);\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\ninterface AppLayoutGlobalAiDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeAiDrawer: InternalDrawer | null;\n aiDrawerProps: AIDrawerProps;\n}\n\nexport function AppLayoutGlobalAiDrawerImplementation({\n appLayoutInternals,\n show,\n activeAiDrawer,\n aiDrawerProps,\n}: AppLayoutGlobalAiDrawerImplementationProps) {\n const {\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize,\n expandedDrawerId,\n setExpandedDrawerId,\n } = aiDrawerProps;\n const { verticalOffsets, placement } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeAiDrawer?.id;\n\n const computedAriaLabels = {\n closeButton: activeAiDrawer ? activeAiDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeAiDrawer ? activeAiDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const resizeProps = useResize({\n currentWidth: activeAiDrawerSize,\n minWidth: minAiDrawerSize,\n maxWidth: maxAiDrawerSize,\n panelRef: drawerRef,\n handleRef: aiDrawerFocusControl!.refs.slider,\n onResize: size => {\n onActiveDrawerResize({ id: activeDrawerId!, size });\n },\n position: 'side-start',\n });\n const size = getLimitedValue(minAiDrawerSize, activeAiDrawerSize, maxAiDrawerSize);\n const isExpanded = activeAiDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n (activeAiDrawer?.defaultActive && !drawersOpenQueue?.includes(activeAiDrawer.id)) || (wasExpanded && !isExpanded);\n const drawerHeight = `calc(100vh - ${verticalOffsets.toolbar + placement.insetBlockEnd}px)`;\n // disable resizing when the drawer is at its minimum width in a \"squeezed\" state\n // (window is between mobile and desktop sizes). At this point, the drawer can't be\n // resized in either direction, so we disable the resize handler\n const isResizingDisabled = maxAiDrawerSize < activeAiDrawerSize;\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-left',\n text: computedAriaLabels.closeButton,\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeAiDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeAiDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeAiDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeAiDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <Transition nodeRef={drawerRef} in={show} appear={show} mountOnEnter={true} timeout={250}>\n {drawerTransitionState => {\n return (\n <Transition nodeRef={drawerRef} in={isExpanded} timeout={250}>\n {expandedTransitionState => {\n return (\n <aside\n id={activeAiDrawer?.id}\n aria-hidden={!activeAiDrawer}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['ai-drawer'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [sharedStyles['with-motion-horizontal']]: !animationDisabled,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-hidden']]: !show && drawerTransitionState === 'exited',\n [testutilStyles['drawer-closed']]: !activeAiDrawer,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n aiDrawerFocusControl?.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: `${placement.insetBlockStart}px`,\n ...(!isMobile && {\n [customCssProps.drawerMinSize]: `${size}px`,\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(drawerTransitionState) ? size : 0}px`,\n }),\n }}\n data-testid={activeDrawerId && `awsui-app-layout-drawer-${activeDrawerId}`}\n >\n {!isMobile && activeAiDrawer?.resizable && (!isExpanded || expandedTransitionState !== 'entered') && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={aiDrawerFocusControl?.refs.slider}\n position=\"side-start\"\n className={clsx(testutilStyles['drawers-slider'], styles['ai-drawer-slider-handle'])}\n ariaLabel={activeAiDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeAiDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onPointerDown={resizeProps.onPointerDown}\n onDirectionClick={resizeProps.onDirectionClick}\n disabled={isResizingDisabled}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}>\n <div className={styles['drawer-content']}>\n <header className={styles['drawer-content-header']}>\n <div className={styles['drawer-content-header-content']}>\n {activeAiDrawer?.header ?? <div />}\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveAiDrawerChange?.(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId!);\n break;\n default:\n activeAiDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Left panel actions\"\n items={drawerActions}\n />\n </div>\n </div>\n {!isMobile && isExpanded && activeAiDrawer?.ariaLabels?.exitExpandedModeButton && (\n <div className={styles['drawer-back-to-console-slot']}>\n <div className={styles['drawer-back-to-console-button-wrapper']}>\n <button\n className={clsx(\n testutilStyles['active-ai-drawer-leave-expanded-mode-custom-button'],\n styles['drawer-back-to-console-button']\n )}\n formAction=\"none\"\n onClick={() => setExpandedDrawerId(null)}\n >\n {activeAiDrawer?.ariaLabels?.exitExpandedModeButton}\n </button>\n </div>\n </div>\n )}\n </header>\n {activeAiDrawer?.content}\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n }}\n </Transition>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAOnE,UAAU,wCAAwC;IAChD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAC;CAChD;AAED,iBAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,EAAE,wCAAwC,eA8J1C;AAED,eAAe,mCAAmC,CAAC"}
1
+ {"version":3,"file":"global-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAOnE,UAAU,wCAAwC;IAChD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,cAAc,GAAG,SAAS,CAAC;CAChD;AAED,iBAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACnB,EAAE,wCAAwC,eAyL1C;AAED,eAAe,mCAAmC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  import React, { useRef } from 'react';
4
4
  import { Transition } from 'react-transition-group';
5
5
  import clsx from 'clsx';
6
- import { InternalButton } from '../../../button/internal';
6
+ import ButtonGroup from '../../../button-group/internal';
7
7
  import PanelResizeHandle from '../../../internal/components/panel-resize-handle';
8
8
  import customCssProps from '../../../internal/generated/custom-css-properties';
9
9
  import { usePrevious } from '../../../internal/hooks/use-previous';
@@ -14,7 +14,7 @@ import sharedStyles from '../../resize/styles.css.js';
14
14
  import testutilStyles from '../../test-classes/styles.css.js';
15
15
  import styles from './styles.css.js';
16
16
  function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeGlobalDrawer, }) {
17
- var _a, _b, _c, _d, _e, _f;
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
18
18
  const { ariaLabels, globalDrawersFocusControl, isMobile, placement, onActiveGlobalDrawersChange, onActiveDrawerResize, minGlobalDrawersSizes, maxGlobalDrawersSizes, activeGlobalDrawersSizes, activeGlobalDrawers, verticalOffsets, drawersOpenQueue, expandedDrawerId, setExpandedDrawerId, activeAiDrawer, } = appLayoutInternals;
19
19
  const drawerRef = useRef(null);
20
20
  const activeDrawerId = (_a = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.id) !== null && _a !== void 0 ? _a : '';
@@ -42,8 +42,39 @@ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeG
42
42
  const wasExpanded = usePrevious(isExpanded);
43
43
  const animationDisabled = ((activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.defaultActive) && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||
44
44
  (wasExpanded && !isExpanded);
45
+ let drawerActions = [
46
+ {
47
+ type: 'icon-button',
48
+ id: 'close',
49
+ iconName: isMobile ? 'close' : 'angle-right',
50
+ text: (_g = computedAriaLabels.closeButton) !== null && _g !== void 0 ? _g : '',
51
+ analyticsAction: 'close',
52
+ },
53
+ ];
54
+ if (!isMobile && (activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.isExpandable)) {
55
+ drawerActions = [
56
+ {
57
+ type: 'icon-button',
58
+ id: 'expand',
59
+ iconName: isExpanded ? 'shrink' : 'expand',
60
+ text: (_j = (_h = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.ariaLabels) === null || _h === void 0 ? void 0 : _h.expandedModeButton) !== null && _j !== void 0 ? _j : '',
61
+ analyticsAction: isExpanded ? 'expand' : 'collapse',
62
+ },
63
+ ...drawerActions,
64
+ ];
65
+ }
66
+ if (activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.headerActions) {
67
+ drawerActions = [
68
+ {
69
+ type: 'group',
70
+ text: 'Actions',
71
+ items: activeGlobalDrawer.headerActions,
72
+ },
73
+ ...drawerActions,
74
+ ];
75
+ }
45
76
  return (React.createElement(Transition, { nodeRef: drawerRef, in: show || isExpanded, appear: show || isExpanded, timeout: 0 }, state => {
46
- var _a, _b, _c;
77
+ var _a, _b;
47
78
  return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['drawer-global'], styles[state], !animationDisabled && sharedStyles['with-motion-horizontal'], !animationDisabled && isExpanded && styles['with-expanded-motion'], {
48
79
  [styles['drawer-hidden']]: !show,
49
80
  [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,
@@ -72,12 +103,24 @@ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeG
72
103
  React.createElement(PanelResizeHandle, { ref: refs === null || refs === void 0 ? void 0 : refs.slider, position: "side", className: testutilStyles['drawers-slider'], ariaLabel: (_a = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.ariaLabels) === null || _a === void 0 ? void 0 : _a.resizeHandle, tooltipText: (_b = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.resizeHandleTooltipText, ariaValuenow: resizeProps.relativeSize, onKeyDown: resizeProps.onKeyDown, onDirectionClick: resizeProps.onDirectionClick, onPointerDown: resizeProps.onPointerDown }))),
73
104
  React.createElement("div", { className: clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal']), "data-testid": `awsui-app-layout-drawer-content-${activeDrawerId}` },
74
105
  React.createElement("div", { className: styles['drawer-actions'] },
75
- !isMobile && (activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.isExpandable) && (React.createElement("div", { className: styles['drawer-expanded-mode-button'] },
76
- React.createElement(InternalButton, { ariaLabel: (_c = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.expandedModeButton, className: testutilStyles['active-drawer-expanded-mode-button'], formAction: "none", ariaExpanded: isExpanded, iconName: isExpanded ? 'shrink' : 'expand', onClick: () => setExpandedDrawerId(isExpanded ? null : activeDrawerId), variant: "icon", analyticsAction: isExpanded ? 'expand' : 'collapse' }))),
77
- React.createElement("div", { className: clsx(styles['drawer-close-button']) },
78
- React.createElement(InternalButton, { ariaLabel: computedAriaLabels.closeButton, className: clsx({
79
- [testutilStyles['active-drawer-close-button']]: activeDrawerId,
80
- }), formAction: "none", iconName: isMobile ? 'close' : 'angle-right', onClick: () => onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true }), ref: refs === null || refs === void 0 ? void 0 : refs.close, variant: "icon", analyticsAction: "close" }))),
106
+ React.createElement(ButtonGroup, { dropdownExpandToViewport: false, variant: "icon", onItemClick: event => {
107
+ var _a;
108
+ switch (event.detail.id) {
109
+ case 'close':
110
+ onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true });
111
+ break;
112
+ case 'expand':
113
+ setExpandedDrawerId(isExpanded ? null : activeDrawerId);
114
+ break;
115
+ default:
116
+ (_a = activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.onHeaderActionClick) === null || _a === void 0 ? void 0 : _a.call(activeGlobalDrawer, event);
117
+ }
118
+ }, ariaLabel: "Global panel actions", items: drawerActions, __internalRootRef: (root) => {
119
+ if (!root) {
120
+ return;
121
+ }
122
+ refs.close = { current: root.querySelector('[data-itemid="close"]') };
123
+ } })),
81
124
  React.createElement("div", { className: styles['drawer-content'], style: { blockSize: drawerHeight } }, activeGlobalDrawer === null || activeGlobalDrawer === void 0 ? void 0 : activeGlobalDrawer.content)))));
82
125
  }));
83
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"global-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,SAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACuB;;IACzC,MAAM,EACJ,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,SAAS,EACT,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBA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BAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CACxB,CACF,CACF,CACA,CACT,CAAC;IACJ,CAAC,CACU,CACd,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../../../button/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer: InternalDrawer | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n activeGlobalDrawers,\n verticalOffsets,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(verticalOffsets, isMobile, placement);\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n const isExpanded = activeGlobalDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n (activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||\n (wasExpanded && !isExpanded);\n\n return (\n <Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['drawer-global'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-horizontal'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n [styles['has-next-siblings']]:\n activeGlobalDrawers.findIndex(drawer => drawer.id === activeDrawerId) + 1 <\n activeGlobalDrawers.length,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? '100%' : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && <div className={styles['drawer-gap']}></div>}\n {!isMobile && activeGlobalDrawer?.resizable && !isExpanded && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeGlobalDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\n <div className={styles['drawer-actions']}>\n {!isMobile && activeGlobalDrawer?.isExpandable && (\n <div className={styles['drawer-expanded-mode-button']}>\n <InternalButton\n ariaLabel={activeGlobalDrawer?.ariaLabels?.expandedModeButton}\n className={testutilStyles['active-drawer-expanded-mode-button']}\n formAction=\"none\"\n ariaExpanded={isExpanded}\n iconName={isExpanded ? 'shrink' : 'expand'}\n onClick={() => setExpandedDrawerId(isExpanded ? null : activeDrawerId)}\n variant=\"icon\"\n analyticsAction={isExpanded ? 'expand' : 'collapse'}\n />\n </div>\n )}\n <div className={clsx(styles['drawer-close-button'])}>\n <InternalButton\n ariaLabel={computedAriaLabels.closeButton}\n className={clsx({\n [testutilStyles['active-drawer-close-button']]: activeDrawerId,\n })}\n formAction=\"none\"\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true })}\n ref={refs?.close}\n variant=\"icon\"\n analyticsAction=\"close\"\n />\n </div>\n </div>\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
1
+ {"version":3,"file":"global-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBA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AC,EAAE;;gCACnB,QAAQ,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE;oCACvB,KAAK,OAAO;wCACV,2BAA2B,CAAC,cAAc,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;wCAC7E,MAAM;oCACR,KAAK,QAAQ;wCACX,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;wCACxD,MAAM;oCACR;wCACE,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,mBAAmB,mEAAG,KAAK,CAAC,CAAC;iCACpD;4BACH,CAAC,EACD,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,aAAa,EACpB,iBAAiB,EAAE,CAAC,IAAiB,EAAE,EAAE;gCACvC,IAAI,CAAC,IAAI,EAAE;oCACT,OAAO;iCACR;gCACD,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAyB,EAAE,CAAC;4BAChG,CAAC,GACD,CACE;oBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CACxB,CACF,CACF,CACA,CACT,CAAC;IACJ,CAAC,CACU,CACd,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,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 { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { InternalItemOrGroup } from '../../../button-group/interfaces';\nimport ButtonGroup from '../../../button-group/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer: InternalDrawer | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n activeGlobalDrawers,\n verticalOffsets,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(verticalOffsets, isMobile, placement);\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n const isExpanded = activeGlobalDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n (activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||\n (wasExpanded && !isExpanded);\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-right',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeGlobalDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeGlobalDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeGlobalDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeGlobalDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['drawer-global'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-horizontal'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n [styles['has-next-siblings']]:\n activeGlobalDrawers.findIndex(drawer => drawer.id === activeDrawerId) + 1 <\n activeGlobalDrawers.length,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? '100%' : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && <div className={styles['drawer-gap']}></div>}\n {!isMobile && activeGlobalDrawer?.resizable && !isExpanded && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeGlobalDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeGlobalDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = { current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable };\n }}\n />\n </div>\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';
3
+ import { ButtonGroupProps } from '../../button-group/interfaces';
3
4
  import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';
5
+ import { NonCancelableEventHandler } from '../../internal/events';
4
6
  import { SomeOptional } from '../../internal/types';
5
7
  import { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';
6
8
  import { SplitPanelProviderProps } from '../split-panel';
@@ -19,6 +21,8 @@ export type InternalDrawer = AppLayoutProps.Drawer & {
19
21
  exitExpandedModeButton?: string;
20
22
  };
21
23
  header?: React.ReactNode;
24
+ headerActions?: ReadonlyArray<ButtonGroupProps.Item>;
25
+ onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;
22
26
  };
23
27
  export interface AppLayoutInternals {
24
28
  ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OA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AG,iBAAiB,GAAG,SAAS,CAC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { SomeOptional } from '../../internal/types';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SplitPanelProviderProps } from '../split-panel';\nimport { OnChangeParams } from '../utils/use-drawers';\nimport { FocusControlMultipleStates, FocusControlState } from '../utils/use-focus-control';\nimport { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control';\nimport { VerticalLayoutOutput } from './compute-layout';\n\nexport interface AppLayoutInternalProps extends AppLayoutPropsWithDefaults {\n navigationTriggerHide?: boolean;\n}\n\nexport type InternalDrawer = AppLayoutProps.Drawer & {\n defaultActive?: boolean;\n isExpandable?: boolean;\n ariaLabels: AppLayoutProps.Drawer['ariaLabels'] & { expandedModeButton?: string; exitExpandedModeButton?: string };\n header?: React.ReactNode;\n};\n\n// Widgetization notice: structures in this file are shared multiple app layout instances, possibly different minor versions.\n// Treat these structures as an API and do not make incompatible changes.\n// Legacy widget interface\nexport interface AppLayoutInternals {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n headerVariant: AppLayoutPropsWithDefaults['headerVariant'];\n placement: AppLayoutPropsWithDefaults['placement'];\n navigationOpen: AppLayoutPropsWithDefaults['navigationOpen'];\n navigationFocusControl: FocusControlState;\n navigation: React.ReactNode;\n splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelOpen: boolean;\n splitPanelControlId: string;\n splitPanelFocusControl: SplitPanelFocusControlState;\n splitPanelToggleConfig: SplitPanelSideToggleProps;\n isMobile: boolean;\n activeDrawer: InternalDrawer | undefined;\n activeDrawerSize: number;\n minDrawerSize: number;\n maxDrawerSize: number;\n minGlobalDrawersSizes: Record<string, number>;\n maxGlobalDrawersSizes: Record<string, number>;\n drawers: ReadonlyArray<InternalDrawer>;\n drawersFocusControl: FocusControlState;\n globalDrawersFocusControl: FocusControlMultipleStates;\n activeGlobalDrawersIds: ReadonlyArray<string>;\n activeGlobalDrawers: ReadonlyArray<InternalDrawer>;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n activeGlobalDrawersSizes: Record<string, number>;\n stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications'];\n breadcrumbs: React.ReactNode;\n discoveredBreadcrumbs: BreadcrumbGroupProps | null;\n toolbarState: 'show' | 'hide';\n setToolbarState: (state: 'show' | 'hide') => void;\n verticalOffsets: VerticalLayoutOutput;\n drawersOpenQueue: ReadonlyArray<string>;\n setNotificationsHeight: (height: number) => void;\n setToolbarHeight: (height: number) => void;\n onSplitPanelToggle: () => void;\n onNavigationToggle: (open: boolean) => void;\n onActiveDrawerChange: (newDrawerId: string | null, params: OnChangeParams) => void;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n onActiveGlobalDrawersChange: (newDrawerId: string, params: OnChangeParams) => void;\n splitPanelAnimationDisabled?: boolean;\n expandedDrawerId: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n aiDrawer?: InternalDrawer | null;\n onActiveAiDrawerChange?: (newDrawerId: string | null, params?: OnChangeParams) => void;\n activeAiDrawer?: InternalDrawer | null;\n activeAiDrawerId: string | null;\n activeAiDrawerSize?: number;\n minAiDrawerSize?: number;\n maxAiDrawerSize?: number;\n aiDrawerFocusControl?: FocusControlState;\n onActiveAiDrawerResize: (size: number) => void;\n}\n\ninterface AppLayoutWidgetizedState extends AppLayoutInternals {\n isNested: boolean;\n verticalOffsets: VerticalLayoutOutput;\n navigationAnimationDisabled: boolean;\n aiDrawerExpandedMode: boolean;\n splitPanelOffsets: {\n stickyVerticalBottomOffset: number;\n mainContentPaddingBlockEnd: number | undefined;\n };\n}\n\n// New widget interface\nexport interface AppLayoutState {\n rootRef: React.Ref<HTMLElement>;\n isIntersecting: boolean;\n // new state management\n widgetizedState: AppLayoutWidgetizedState;\n // the old object shape for backward compatibility\n appLayoutInternals: AppLayoutInternals;\n splitPanelInternals: SplitPanelProviderProps;\n}\n\nexport type AppLayoutPendingState = SomeOptional<\n AppLayoutState,\n 'appLayoutInternals' | 'splitPanelInternals' | 'widgetizedState' | 'rootRef'\n>;\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';\nimport { ButtonGroupProps } from '../../button-group/interfaces';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { NonCancelableEventHandler } from '../../internal/events';\nimport { SomeOptional } from '../../internal/types';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SplitPanelProviderProps } from '../split-panel';\nimport { OnChangeParams } from '../utils/use-drawers';\nimport { FocusControlMultipleStates, FocusControlState } from '../utils/use-focus-control';\nimport { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control';\nimport { VerticalLayoutOutput } from './compute-layout';\n\nexport interface AppLayoutInternalProps extends AppLayoutPropsWithDefaults {\n navigationTriggerHide?: boolean;\n}\n\nexport type InternalDrawer = AppLayoutProps.Drawer & {\n defaultActive?: boolean;\n isExpandable?: boolean;\n ariaLabels: AppLayoutProps.Drawer['ariaLabels'] & { expandedModeButton?: string; exitExpandedModeButton?: string };\n header?: React.ReactNode;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n};\n\n// Widgetization notice: structures in this file are shared multiple app layout instances, possibly different minor versions.\n// Treat these structures as an API and do not make incompatible changes.\n// Legacy widget interface\nexport interface AppLayoutInternals {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n headerVariant: AppLayoutPropsWithDefaults['headerVariant'];\n placement: AppLayoutPropsWithDefaults['placement'];\n navigationOpen: AppLayoutPropsWithDefaults['navigationOpen'];\n navigationFocusControl: FocusControlState;\n navigation: React.ReactNode;\n splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelOpen: boolean;\n splitPanelControlId: string;\n splitPanelFocusControl: SplitPanelFocusControlState;\n splitPanelToggleConfig: SplitPanelSideToggleProps;\n isMobile: boolean;\n activeDrawer: InternalDrawer | undefined;\n activeDrawerSize: number;\n minDrawerSize: number;\n maxDrawerSize: number;\n minGlobalDrawersSizes: Record<string, number>;\n maxGlobalDrawersSizes: Record<string, number>;\n drawers: ReadonlyArray<InternalDrawer>;\n drawersFocusControl: FocusControlState;\n globalDrawersFocusControl: FocusControlMultipleStates;\n activeGlobalDrawersIds: ReadonlyArray<string>;\n activeGlobalDrawers: ReadonlyArray<InternalDrawer>;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n activeGlobalDrawersSizes: Record<string, number>;\n stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications'];\n breadcrumbs: React.ReactNode;\n discoveredBreadcrumbs: BreadcrumbGroupProps | null;\n toolbarState: 'show' | 'hide';\n setToolbarState: (state: 'show' | 'hide') => void;\n verticalOffsets: VerticalLayoutOutput;\n drawersOpenQueue: ReadonlyArray<string>;\n setNotificationsHeight: (height: number) => void;\n setToolbarHeight: (height: number) => void;\n onSplitPanelToggle: () => void;\n onNavigationToggle: (open: boolean) => void;\n onActiveDrawerChange: (newDrawerId: string | null, params: OnChangeParams) => void;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n onActiveGlobalDrawersChange: (newDrawerId: string, params: OnChangeParams) => void;\n splitPanelAnimationDisabled?: boolean;\n expandedDrawerId: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n aiDrawer?: InternalDrawer | null;\n onActiveAiDrawerChange?: (newDrawerId: string | null, params?: OnChangeParams) => void;\n activeAiDrawer?: InternalDrawer | null;\n activeAiDrawerId: string | null;\n activeAiDrawerSize?: number;\n minAiDrawerSize?: number;\n maxAiDrawerSize?: number;\n aiDrawerFocusControl?: FocusControlState;\n onActiveAiDrawerResize: (size: number) => void;\n}\n\ninterface AppLayoutWidgetizedState extends AppLayoutInternals {\n isNested: boolean;\n verticalOffsets: VerticalLayoutOutput;\n navigationAnimationDisabled: boolean;\n aiDrawerExpandedMode: boolean;\n splitPanelOffsets: {\n stickyVerticalBottomOffset: number;\n mainContentPaddingBlockEnd: number | undefined;\n };\n}\n\n// New widget interface\nexport interface AppLayoutState {\n rootRef: React.Ref<HTMLElement>;\n isIntersecting: boolean;\n // new state management\n widgetizedState: AppLayoutWidgetizedState;\n // the old object shape for backward compatibility\n appLayoutInternals: AppLayoutInternals;\n splitPanelInternals: SplitPanelProviderProps;\n}\n\nexport type AppLayoutPendingState = SomeOptional<\n AppLayoutState,\n 'appLayoutInternals' | 'splitPanelInternals' | 'widgetizedState' | 'rootRef'\n>;\n"]}