@cloudscape-design/components 3.0.750 → 3.0.752

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 (131) hide show
  1. package/alert/actions-wrapper/index.d.ts +1 -1
  2. package/alert/actions-wrapper/index.d.ts.map +1 -1
  3. package/alert/actions-wrapper/index.js +2 -2
  4. package/alert/actions-wrapper/index.js.map +1 -1
  5. package/alert/internal.d.ts.map +1 -1
  6. package/alert/internal.js +15 -5
  7. package/alert/internal.js.map +1 -1
  8. package/alert/styles.css.js +27 -25
  9. package/alert/styles.scoped.css +45 -39
  10. package/alert/styles.selectors.js +27 -25
  11. package/app-layout/drawer/styles.css.js +13 -13
  12. package/app-layout/drawer/styles.scoped.css +22 -22
  13. package/app-layout/drawer/styles.selectors.js +13 -13
  14. package/app-layout/mobile-toolbar/styles.css.js +8 -8
  15. package/app-layout/mobile-toolbar/styles.scoped.css +10 -10
  16. package/app-layout/mobile-toolbar/styles.selectors.js +8 -8
  17. package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +16 -16
  18. package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +34 -34
  19. package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +16 -16
  20. package/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +12 -12
  21. package/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +17 -17
  22. package/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +12 -12
  23. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.css.js +6 -6
  24. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scoped.css +24 -24
  25. package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.selectors.js +6 -6
  26. package/breadcrumb-group/implementation.d.ts.map +1 -1
  27. package/breadcrumb-group/implementation.js +1 -1
  28. package/breadcrumb-group/implementation.js.map +1 -1
  29. package/breadcrumb-group/interfaces.d.ts +1 -1
  30. package/breadcrumb-group/interfaces.js.map +1 -1
  31. package/button-dropdown/interfaces.d.ts +7 -0
  32. package/button-dropdown/interfaces.d.ts.map +1 -1
  33. package/button-dropdown/interfaces.js.map +1 -1
  34. package/button-dropdown/internal.d.ts.map +1 -1
  35. package/button-dropdown/internal.js +2 -2
  36. package/button-dropdown/internal.js.map +1 -1
  37. package/button-dropdown/item-element/index.d.ts +1 -1
  38. package/button-dropdown/item-element/index.d.ts.map +1 -1
  39. package/button-dropdown/item-element/index.js +4 -4
  40. package/button-dropdown/item-element/index.js.map +1 -1
  41. package/button-dropdown/item-element/styles.css.js +13 -12
  42. package/button-dropdown/item-element/styles.scoped.css +52 -14
  43. package/button-dropdown/item-element/styles.selectors.js +13 -12
  44. package/button-dropdown/items-list.d.ts +1 -1
  45. package/button-dropdown/items-list.d.ts.map +1 -1
  46. package/button-dropdown/items-list.js +2 -2
  47. package/button-dropdown/items-list.js.map +1 -1
  48. package/flashbar/analytics-metadata/interfaces.d.ts +36 -0
  49. package/flashbar/analytics-metadata/interfaces.d.ts.map +1 -0
  50. package/flashbar/analytics-metadata/interfaces.js +4 -0
  51. package/flashbar/analytics-metadata/interfaces.js.map +1 -0
  52. package/flashbar/analytics-metadata/styles.css.js +6 -0
  53. package/flashbar/analytics-metadata/styles.scoped.css +7 -0
  54. package/flashbar/analytics-metadata/styles.selectors.js +7 -0
  55. package/flashbar/analytics-metadata/utils.d.ts +7 -0
  56. package/flashbar/analytics-metadata/utils.d.ts.map +1 -0
  57. package/flashbar/analytics-metadata/utils.js +33 -0
  58. package/flashbar/analytics-metadata/utils.js.map +1 -0
  59. package/flashbar/collapsible-flashbar.d.ts.map +1 -1
  60. package/flashbar/collapsible-flashbar.js +13 -5
  61. package/flashbar/collapsible-flashbar.js.map +1 -1
  62. package/flashbar/flash.d.ts.map +1 -1
  63. package/flashbar/flash.js +19 -7
  64. package/flashbar/flash.js.map +1 -1
  65. package/flashbar/non-collapsible-flashbar.d.ts.map +1 -1
  66. package/flashbar/non-collapsible-flashbar.js +4 -2
  67. package/flashbar/non-collapsible-flashbar.js.map +1 -1
  68. package/flashbar/styles.css.js +50 -47
  69. package/flashbar/styles.scoped.css +152 -146
  70. package/flashbar/styles.selectors.js +50 -47
  71. package/internal/base-component/styles.scoped.css +5 -10
  72. package/internal/components/tooltip/index.d.ts +3 -1
  73. package/internal/components/tooltip/index.d.ts.map +1 -1
  74. package/internal/components/tooltip/index.js +2 -2
  75. package/internal/components/tooltip/index.js.map +1 -1
  76. package/internal/components/tooltip/registry.d.ts +4 -0
  77. package/internal/components/tooltip/registry.d.ts.map +1 -0
  78. package/internal/components/tooltip/registry.js +28 -0
  79. package/internal/components/tooltip/registry.js.map +1 -0
  80. package/internal/environment.js +1 -1
  81. package/internal/environment.json +1 -1
  82. package/internal/generated/styles/tokens.js +1 -1
  83. package/internal/generated/theming/index.cjs +15 -15
  84. package/internal/generated/theming/index.js +15 -15
  85. package/internal/manifest.json +1 -1
  86. package/internal/plugins/api.d.ts +9 -0
  87. package/internal/plugins/api.d.ts.map +1 -1
  88. package/internal/plugins/api.js +7 -0
  89. package/internal/plugins/api.js.map +1 -1
  90. package/internal/plugins/controllers/alert-flash-content.d.ts +46 -0
  91. package/internal/plugins/controllers/alert-flash-content.d.ts.map +1 -0
  92. package/internal/plugins/controllers/alert-flash-content.js +59 -0
  93. package/internal/plugins/controllers/alert-flash-content.js.map +1 -0
  94. package/internal/plugins/helpers/index.d.ts +1 -0
  95. package/internal/plugins/helpers/index.d.ts.map +1 -1
  96. package/internal/plugins/helpers/index.js +1 -0
  97. package/internal/plugins/helpers/index.js.map +1 -1
  98. package/internal/plugins/helpers/use-discovered-action.d.ts +2 -2
  99. package/internal/plugins/helpers/use-discovered-action.d.ts.map +1 -1
  100. package/internal/plugins/helpers/use-discovered-action.js.map +1 -1
  101. package/internal/plugins/helpers/use-discovered-content.d.ts +15 -0
  102. package/internal/plugins/helpers/use-discovered-content.d.ts.map +1 -0
  103. package/internal/plugins/helpers/use-discovered-content.js +82 -0
  104. package/internal/plugins/helpers/use-discovered-content.js.map +1 -0
  105. package/package.json +1 -1
  106. package/popover/styles.css.js +52 -52
  107. package/popover/styles.scoped.css +72 -72
  108. package/popover/styles.selectors.js +52 -52
  109. package/property-filter/styles.css.js +38 -38
  110. package/property-filter/styles.scoped.css +40 -44
  111. package/property-filter/styles.selectors.js +38 -38
  112. package/side-navigation/implementation.d.ts +1 -1
  113. package/side-navigation/implementation.d.ts.map +1 -1
  114. package/side-navigation/implementation.js +2 -1
  115. package/side-navigation/implementation.js.map +1 -1
  116. package/side-navigation/interfaces.d.ts +4 -0
  117. package/side-navigation/interfaces.d.ts.map +1 -1
  118. package/side-navigation/interfaces.js.map +1 -1
  119. package/side-navigation/styles.css.js +30 -29
  120. package/side-navigation/styles.scoped.css +46 -41
  121. package/side-navigation/styles.selectors.js +30 -29
  122. package/test-utils/dom/side-navigation/index.d.ts +1 -0
  123. package/test-utils/dom/side-navigation/index.js +3 -0
  124. package/test-utils/dom/side-navigation/index.js.map +1 -1
  125. package/test-utils/selectors/side-navigation/index.d.ts +1 -0
  126. package/test-utils/selectors/side-navigation/index.js +3 -0
  127. package/test-utils/selectors/side-navigation/index.js.map +1 -1
  128. package/test-utils/tsconfig.tsbuildinfo +1 -1
  129. package/wizard/styles.css.js +30 -30
  130. package/wizard/styles.scoped.css +59 -59
  131. package/wizard/styles.selectors.js +30 -30
@@ -0,0 +1,46 @@
1
+ interface RefShim<T> {
2
+ current: T | null;
3
+ }
4
+ export interface AlertFlashContentContext {
5
+ type: string;
6
+ headerRef: RefShim<HTMLElement>;
7
+ contentRef: RefShim<HTMLElement>;
8
+ }
9
+ export type ReplacementType = 'original' | 'remove' | 'replaced';
10
+ export interface ReplacementApi {
11
+ hideHeader(): void;
12
+ restoreHeader(): void;
13
+ replaceHeader(replacer: (container: HTMLElement) => void): void;
14
+ hideContent(): void;
15
+ restoreContent(): void;
16
+ replaceContent(replacer: (container: HTMLElement) => void): void;
17
+ }
18
+ export interface AlertFlashContentResult {
19
+ update: () => void;
20
+ unmount: (containers: {
21
+ replacementHeaderContainer: HTMLElement;
22
+ replacementContentContainer: HTMLElement;
23
+ }) => void;
24
+ }
25
+ export interface AlertFlashContentConfig {
26
+ id: string;
27
+ runReplacer: (context: AlertFlashContentContext, replacementApi: ReplacementApi) => AlertFlashContentResult;
28
+ }
29
+ export type AlertFlashContentRegistrationListener = (provider: AlertFlashContentConfig) => () => void;
30
+ export interface AlertFlashContentApiPublic {
31
+ registerContentReplacer(config: AlertFlashContentConfig): void;
32
+ }
33
+ export interface AlertFlashContentApiInternal {
34
+ clearRegisteredReplacer(): void;
35
+ onContentRegistered(listener: AlertFlashContentRegistrationListener): () => void;
36
+ }
37
+ export declare class AlertFlashContentController {
38
+ #private;
39
+ registerContentReplacer: (content: AlertFlashContentConfig) => void;
40
+ clearRegisteredReplacer: () => void;
41
+ onContentRegistered: (listener: AlertFlashContentRegistrationListener) => () => void;
42
+ installPublic(api?: Partial<AlertFlashContentApiPublic>): AlertFlashContentApiPublic;
43
+ installInternal(internalApi?: Partial<AlertFlashContentApiInternal>): AlertFlashContentApiInternal;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=alert-flash-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-flash-content.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/alert-flash-content.ts"],"names":[],"mappings":"AAMA,UAAU,OAAO,CAAC,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,UAAU,IAAI,IAAI,CAAC;IACnB,aAAa,IAAI,IA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+ // SPDX-License-Identifier: Apache-2.0
3
+ var _AlertFlashContentController_listeners, _AlertFlashContentController_cleanups, _AlertFlashContentController_provider, _AlertFlashContentController_scheduleUpdate;
4
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
5
+ import debounce from '../../debounce';
6
+ export class AlertFlashContentController {
7
+ constructor() {
8
+ _AlertFlashContentController_listeners.set(this, []);
9
+ _AlertFlashContentController_cleanups.set(this, new Map());
10
+ _AlertFlashContentController_provider.set(this, void 0);
11
+ _AlertFlashContentController_scheduleUpdate.set(this, debounce(() => __classPrivateFieldGet(this, _AlertFlashContentController_listeners, "f").forEach(listener => {
12
+ if (__classPrivateFieldGet(this, _AlertFlashContentController_provider, "f")) {
13
+ const cleanup = listener(__classPrivateFieldGet(this, _AlertFlashContentController_provider, "f"));
14
+ __classPrivateFieldGet(this, _AlertFlashContentController_cleanups, "f").set(listener, cleanup);
15
+ }
16
+ }), 0));
17
+ this.registerContentReplacer = (content) => {
18
+ if (__classPrivateFieldGet(this, _AlertFlashContentController_provider, "f")) {
19
+ console.warn(`Cannot call \`registerContentReplacer\` with new provider: provider with id "${__classPrivateFieldGet(this, _AlertFlashContentController_provider, "f").id}" already registered.`);
20
+ return;
21
+ }
22
+ __classPrivateFieldSet(this, _AlertFlashContentController_provider, content, "f");
23
+ // Notify existing components if registration happens after the components are rendered.
24
+ __classPrivateFieldGet(this, _AlertFlashContentController_scheduleUpdate, "f").call(this);
25
+ };
26
+ this.clearRegisteredReplacer = () => {
27
+ __classPrivateFieldSet(this, _AlertFlashContentController_provider, undefined, "f");
28
+ };
29
+ this.onContentRegistered = (listener) => {
30
+ if (__classPrivateFieldGet(this, _AlertFlashContentController_provider, "f")) {
31
+ const cleanup = listener(__classPrivateFieldGet(this, _AlertFlashContentController_provider, "f"));
32
+ __classPrivateFieldGet(this, _AlertFlashContentController_listeners, "f").push(listener);
33
+ __classPrivateFieldGet(this, _AlertFlashContentController_cleanups, "f").set(listener, cleanup);
34
+ }
35
+ else {
36
+ __classPrivateFieldGet(this, _AlertFlashContentController_listeners, "f").push(listener);
37
+ }
38
+ return () => {
39
+ var _a;
40
+ (_a = __classPrivateFieldGet(this, _AlertFlashContentController_cleanups, "f").get(listener)) === null || _a === void 0 ? void 0 : _a();
41
+ __classPrivateFieldSet(this, _AlertFlashContentController_listeners, __classPrivateFieldGet(this, _AlertFlashContentController_listeners, "f").filter(item => item !== listener), "f");
42
+ __classPrivateFieldGet(this, _AlertFlashContentController_cleanups, "f").delete(listener);
43
+ };
44
+ };
45
+ }
46
+ installPublic(api = {}) {
47
+ var _a;
48
+ (_a = api.registerContentReplacer) !== null && _a !== void 0 ? _a : (api.registerContentReplacer = this.registerContentReplacer);
49
+ return api;
50
+ }
51
+ installInternal(internalApi = {}) {
52
+ var _a, _b;
53
+ (_a = internalApi.clearRegisteredReplacer) !== null && _a !== void 0 ? _a : (internalApi.clearRegisteredReplacer = this.clearRegisteredReplacer);
54
+ (_b = internalApi.onContentRegistered) !== null && _b !== void 0 ? _b : (internalApi.onContentRegistered = this.onContentRegistered);
55
+ return internalApi;
56
+ }
57
+ }
58
+ _AlertFlashContentController_listeners = new WeakMap(), _AlertFlashContentController_cleanups = new WeakMap(), _AlertFlashContentController_provider = new WeakMap(), _AlertFlashContentController_scheduleUpdate = new WeakMap();
59
+ //# sourceMappingURL=alert-flash-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-flash-content.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/alert-flash-content.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AA6CtC,MAAM,OAAO,2BAA2B;IAAxC;QACE,iDAA2D,EAAE,EAAC;QAC9D,gDAAY,IAAI,GAAG,EAAqD,EAAC;QACzE,wDAAoC;QAEpC,sDAAkB,QAAQ,CACxB,GAAG,EAAE,CACH,uBAAA,IAAI,8CAAW,CAAC,OAAO,CAAC,QAAQ,C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AAC,IAAI,KAAK,QAAQ,CAAC,MAAA,CAAC;gBACpE,uBAAA,IAAI,6CAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC,CAAC;QACJ,CAAC,CAAC;IAYJ,CAAC;IAVC,aAAa,CAAC,MAA2C,EAAE;;QACzD,MAAA,GAAG,CAAC,uBAAuB,oCAA3B,GAAG,CAAC,uBAAuB,GAAK,IAAI,CAAC,uBAAuB,EAAC;QAC7D,OAAO,GAAiC,CAAC;IAC3C,CAAC;IAED,eAAe,CAAC,cAAqD,EAAE;;QACrE,MAAA,WAAW,CAAC,uBAAuB,oCAAnC,WAAW,CAAC,uBAAuB,GAAK,IAAI,CAAC,uBAAuB,EAAC;QACrE,MAAA,WAAW,CAAC,mBAAmB,oCAA/B,WAAW,CAAC,mBAAmB,GAAK,IAAI,CAAC,mBAAmB,EAAC;QAC7D,OAAO,WAA2C,CAAC;IACrD,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport debounce from '../../debounce';\n\n// this code should not depend on React typings, because it is portable between major versions\ninterface RefShim<T> {\n current: T | null;\n}\n\nexport interface AlertFlashContentContext {\n type: string;\n headerRef: RefShim<HTMLElement>;\n contentRef: RefShim<HTMLElement>;\n}\n\nexport type ReplacementType = 'original' | 'remove' | 'replaced';\n\nexport interface ReplacementApi {\n hideHeader(): void;\n restoreHeader(): void;\n replaceHeader(replacer: (container: HTMLElement) => void): void;\n hideContent(): void;\n restoreContent(): void;\n replaceContent(replacer: (container: HTMLElement) => void): void;\n}\n\nexport interface AlertFlashContentResult {\n update: () => void;\n unmount: (containers: { replacementHeaderContainer: HTMLElement; replacementContentContainer: HTMLElement }) => void;\n}\n\nexport interface AlertFlashContentConfig {\n id: string;\n runReplacer: (context: AlertFlashContentContext, replacementApi: ReplacementApi) => AlertFlashContentResult;\n}\n\nexport type AlertFlashContentRegistrationListener = (provider: AlertFlashContentConfig) => () => void;\n\nexport interface AlertFlashContentApiPublic {\n registerContentReplacer(config: AlertFlashContentConfig): void;\n}\n\nexport interface AlertFlashContentApiInternal {\n clearRegisteredReplacer(): void;\n onContentRegistered(listener: AlertFlashContentRegistrationListener): () => void;\n}\n\nexport class AlertFlashContentController {\n #listeners: Array<AlertFlashContentRegistrationListener> = [];\n #cleanups = new Map<AlertFlashContentRegistrationListener, () => void>();\n #provider?: AlertFlashContentConfig;\n\n #scheduleUpdate = debounce(\n () =>\n this.#listeners.forEach(listener => {\n if (this.#provider) {\n const cleanup = listener(this.#provider);\n this.#cleanups.set(listener, cleanup);\n }\n }),\n 0\n );\n\n registerContentReplacer = (content: AlertFlashContentConfig) => {\n if (this.#provider) {\n console.warn(\n `Cannot call \\`registerContentReplacer\\` with new provider: provider with id \"${this.#provider.id}\" already registered.`\n );\n return;\n }\n this.#provider = content;\n\n // Notify existing components if registration happens after the components are rendered.\n this.#scheduleUpdate();\n };\n\n clearRegisteredReplacer = () => {\n this.#provider = undefined;\n };\n\n onContentRegistered = (listener: AlertFlashContentRegistrationListener) => {\n if (this.#provider) {\n const cleanup = listener(this.#provider);\n this.#listeners.push(listener);\n this.#cleanups.set(listener, cleanup);\n } else {\n this.#listeners.push(listener);\n }\n return () => {\n this.#cleanups.get(listener)?.();\n this.#listeners = this.#listeners.filter(item => item !== listener);\n this.#cleanups.delete(listener);\n };\n };\n\n installPublic(api: Partial<AlertFlashContentApiPublic> = {}): AlertFlashContentApiPublic {\n api.registerContentReplacer ??= this.registerContentReplacer;\n return api as AlertFlashContentApiPublic;\n }\n\n installInternal(internalApi: Partial<AlertFlashContentApiInternal> = {}): AlertFlashContentApiInternal {\n internalApi.clearRegisteredReplacer ??= this.clearRegisteredReplacer;\n internalApi.onContentRegistered ??= this.onContentRegistered;\n return internalApi as AlertFlashContentApiInternal;\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
1
  export { RuntimeContentWrapper } from './runtime-content-wrapper';
2
2
  export { createUseDiscoveredAction } from './use-discovered-action';
3
+ export { createUseDiscoveredContent } from './use-discovered-content';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -2,4 +2,5 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { RuntimeContentWrapper } from './runtime-content-wrapper';
4
4
  export { createUseDiscoveredAction } from './use-discovered-action';
5
+ export { createUseDiscoveredContent } from './use-discovered-content';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport { RuntimeContentWrapper } from './runtime-content-wrapper';\nexport { createUseDiscoveredAction } from './use-discovered-action';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport { RuntimeContentWrapper } from './runtime-content-wrapper';\nexport { createUseDiscoveredAction } from './use-discovered-action';\nexport { createUseDiscoveredContent } from './use-discovered-content';\n"]}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { ActionButtonsController } from '../controllers/action-buttons';
3
3
  export declare function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']): (type: string) => {
4
4
  discoveredActions: React.ReactNode[];
5
- headerRef: React.RefObject<HTMLDivElement>;
6
- contentRef: React.RefObject<HTMLDivElement>;
5
+ headerRef: React.Ref<HTMLDivElement>;
6
+ contentRef: React.Ref<HTMLDivElement>;
7
7
  };
8
8
  //# sourceMappingURL=use-discovered-action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-discovered-action.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAA+B,MAAM,+BAA+B,CAAC;AAgBrG,wBAAgB,yBAAyB,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,UAC/D,MAAM;;;;EAajD"}
1
+ {"version":3,"file":"use-discovered-action.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAA+B,MAAM,+BAA+B,CAAC;AAgBrG,wBAAgB,yBAAyB,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,UAC/D,MAAM;uBAC3B,MAAM,SAAS,EAAE;eACzB,MAAM,GAAG,CAAC,cAAc,CAAC;gBACxB,MAAM,GAAG,CAAC,cAAc,CAAC;EAcxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-discovered-action.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,SAAS,oBAAoB,CAAC,MAA2B,EAAE,OAAsB;IAC/E,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,oBAAC,qBAAqB,IACpB,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,EACnC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,EAClE,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAC7D,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,kBAAiE;IACzG,OAAO,SAAS,mBAAmB,CAAC,IAAY;QAC9C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;QACvF,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAEhD,SAAS,CAAC,GAAG,EAAE;YACb,OAAO,kBAAkB,CAAC,OAAO,CAAC,EAAE;gBAClC,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7G,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAEX,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { ActionButtonsController, ActionConfig, ActionContext } from '../controllers/action-buttons';\nimport { RuntimeContentWrapper } from './runtime-content-wrapper';\n\nfunction convertRuntimeAction(action: ActionConfig | null, context: ActionContext) {\n if (!action) {\n return null;\n }\n return (\n <RuntimeContentWrapper\n key={action.id + '-' + context.type}\n mountContent={container => action.mountContent(container, context)}\n unmountContent={container => action.unmountContent(container)}\n />\n );\n}\n\nexport function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']) {\n return function useDiscoveredAction(type: string) {\n const [discoveredActions, setDiscoveredActions] = useState<Array<React.ReactNode>>([]);\n const headerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n return onActionRegistered(actions => {\n setDiscoveredActions(actions.map(action => convertRuntimeAction(action, { type, headerRef, contentRef })));\n });\n }, [type]);\n\n return { discoveredActions, headerRef, contentRef };\n };\n}\n"]}
1
+ {"version":3,"file":"use-discovered-action.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-action.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,SAAS,oBAAoB,CAAC,MAA2B,EAAE,OAAsB;IAC/E,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CACL,oBAAC,qBAAqB,IACpB,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,OAAO,CAAC,IAAI,EACnC,YAAY,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,EAClE,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,GAC7D,CACH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,kBAAiE;IACzG,OAAO,SAAS,mBAAmB,CAAC,IAAY;QAK9C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAyB,EAAE,CAAC,CAAC;QACvF,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAEhD,SAAS,CAAC,GAAG,EAAE;YACb,OAAO,kBAAkB,CAAC,OAAO,CAAC,EAAE;gBAClC,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7G,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAEX,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;IACtD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { ActionButtonsController, ActionConfig, ActionContext } from '../controllers/action-buttons';\nimport { RuntimeContentWrapper } from './runtime-content-wrapper';\n\nfunction convertRuntimeAction(action: ActionConfig | null, context: ActionContext) {\n if (!action) {\n return null;\n }\n return (\n <RuntimeContentWrapper\n key={action.id + '-' + context.type}\n mountContent={container => action.mountContent(container, context)}\n unmountContent={container => action.unmountContent(container)}\n />\n );\n}\n\nexport function createUseDiscoveredAction(onActionRegistered: ActionButtonsController['onActionRegistered']) {\n return function useDiscoveredAction(type: string): {\n discoveredActions: React.ReactNode[];\n headerRef: React.Ref<HTMLDivElement>;\n contentRef: React.Ref<HTMLDivElement>;\n } {\n const [discoveredActions, setDiscoveredActions] = useState<Array<React.ReactNode>>([]);\n const headerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n return onActionRegistered(actions => {\n setDiscoveredActions(actions.map(action => convertRuntimeAction(action, { type, headerRef, contentRef })));\n });\n }, [type]);\n\n return { discoveredActions, headerRef, contentRef };\n };\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import { AlertFlashContentController, ReplacementType } from '../controllers/alert-flash-content';
3
+ export declare function createUseDiscoveredContent(componentName: string, onContentRegistered: AlertFlashContentController['onContentRegistered']): ({ type, header, children, }: {
4
+ type: string;
5
+ header: ReactNode;
6
+ children: ReactNode;
7
+ }) => {
8
+ headerReplacementType: ReplacementType;
9
+ contentReplacementType: ReplacementType;
10
+ headerRef: import("react").Ref<HTMLDivElement>;
11
+ replacementHeaderRef: import("react").Ref<HTMLDivElement>;
12
+ contentRef: import("react").Ref<HTMLDivElement>;
13
+ replacementContentRef: import("react").Ref<HTMLDivElement>;
14
+ };
15
+ //# sourceMappingURL=use-discovered-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-discovered-content.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-content.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,2BAA2B,EAE3B,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAE5C,wBAAgB,0BAA0B,CACxC,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,2BAA2B,CAAC,qBAAqB,CAAC;UAO/D,MAAM;YACJ,SAAS;cACP,SAAS;;;;;;;;EAoFtB"}
@@ -0,0 +1,82 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { useEffect, useRef, useState } from 'react';
4
+ export function createUseDiscoveredContent(componentName, onContentRegistered) {
5
+ return function useDiscoveredContent({ type, header, children, }) {
6
+ const headerRef = useRef(null);
7
+ const contentRef = useRef(null);
8
+ const replacementHeaderRef = useRef(null);
9
+ const replacementContentRef = useRef(null);
10
+ const [headerReplacementType, setFoundHeaderReplacement] = useState('original');
11
+ const [contentReplacementType, setFoundContentReplacement] = useState('original');
12
+ const mountedProvider = useRef();
13
+ useEffect(() => {
14
+ const context = { type, headerRef, contentRef };
15
+ return onContentRegistered(provider => {
16
+ let mounted = true;
17
+ function checkMounted(methodName) {
18
+ if (!mounted) {
19
+ console.warn(`[AwsUi] [Runtime ${componentName} content] \`${methodName}\` called after component unmounted`);
20
+ return false;
21
+ }
22
+ return true;
23
+ }
24
+ mountedProvider.current = provider.runReplacer(context, {
25
+ hideHeader() {
26
+ if (checkMounted('hideHeader')) {
27
+ setFoundHeaderReplacement('remove');
28
+ }
29
+ },
30
+ restoreHeader() {
31
+ if (checkMounted('restoreHeader')) {
32
+ setFoundHeaderReplacement('original');
33
+ }
34
+ },
35
+ replaceHeader(replacer) {
36
+ if (checkMounted('replaceHeader')) {
37
+ replacer(replacementHeaderRef.current);
38
+ setFoundHeaderReplacement('replaced');
39
+ }
40
+ },
41
+ hideContent() {
42
+ if (checkMounted('hideContent')) {
43
+ setFoundContentReplacement('remove');
44
+ }
45
+ },
46
+ restoreContent() {
47
+ if (checkMounted('restoreContent')) {
48
+ setFoundContentReplacement('original');
49
+ }
50
+ },
51
+ replaceContent(replacer) {
52
+ if (checkMounted('replaceContent')) {
53
+ replacer(replacementContentRef.current);
54
+ setFoundContentReplacement('replaced');
55
+ }
56
+ },
57
+ });
58
+ return () => {
59
+ var _a;
60
+ (_a = mountedProvider.current) === null || _a === void 0 ? void 0 : _a.unmount({
61
+ replacementHeaderContainer: replacementHeaderRef.current,
62
+ replacementContentContainer: replacementContentRef.current,
63
+ });
64
+ mounted = false;
65
+ };
66
+ });
67
+ }, [type]);
68
+ useEffect(() => {
69
+ var _a;
70
+ (_a = mountedProvider.current) === null || _a === void 0 ? void 0 : _a.update();
71
+ }, [type, header, children]);
72
+ return {
73
+ headerReplacementType,
74
+ contentReplacementType,
75
+ headerRef: headerRef,
76
+ replacementHeaderRef: replacementHeaderRef,
77
+ contentRef: contentRef,
78
+ replacementContentRef: replacementContentRef,
79
+ };
80
+ };
81
+ }
82
+ //# sourceMappingURL=use-discovered-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-discovered-content.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/helpers/use-discovered-content.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQ/D,MAAM,UAAU,0BAA0B,CACxC,aAAqB,EACrB,mBAAuE;IAEvE,OAAO,SAAS,oBAAoB,CAAC,EACnC,IAAI,EACJ,MAAM,EACN,QAAQ,GAKT;QACC,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAChD,MAAM,oBAAoB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAC1D,MAAM,qBAAqB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;QAC3D,MAAM,CAAC,qBAAqB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAkB,UAAU,CAAC,CAAC;QACjG,MAAM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Ac,CAAC,QAA0C;wBACvD,IAAI,YAAY,CAAC,gBAAgB,CAAC,EAAE;4BAClC,QAAQ,CAAC,qBAAqB,CAAC,OAAQ,CAAC,CAAC;4BACzC,0BAA0B,CAAC,UAAU,CAAC,CAAC;yBACxC;oBACH,CAAC;iBACF,CAAC,CAAC;gBAEH,OAAO,GAAG,EAAE;;oBACV,MAAA,eAAe,CAAC,OAAO,0CAAE,OAAO,CAAC;wBAC/B,0BAA0B,EAAE,oBAAoB,CAAC,OAAQ;wBACzD,2BAA2B,EAAE,qBAAqB,CAAC,OAAQ;qBAC5D,CAAC,CAAC;oBACH,OAAO,GAAG,KAAK,CAAC;gBAClB,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;QAEX,SAAS,CAAC,GAAG,EAAE;;YACb,MAAA,eAAe,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAC;QACpC,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;QAE7B,OAAO;YACL,qBAAqB;YACrB,sBAAsB;YACtB,SAAS,EAAE,SAAsC;YACjD,oBAAoB,EAAE,oBAAiD;YACvE,UAAU,EAAE,UAAuC;YACnD,qBAAqB,EAAE,qBAAkD;SAC1E,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ReactNode, useEffect, useRef, useState } from 'react';\n\nimport {\n AlertFlashContentController,\n AlertFlashContentResult,\n ReplacementType,\n} from '../controllers/alert-flash-content';\n\nexport function createUseDiscoveredContent(\n componentName: string,\n onContentRegistered: AlertFlashContentController['onContentRegistered']\n) {\n return function useDiscoveredContent({\n type,\n header,\n children,\n }: {\n type: string;\n header: ReactNode;\n children: ReactNode;\n }) {\n const headerRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const replacementHeaderRef = useRef<HTMLDivElement>(null);\n const replacementContentRef = useRef<HTMLDivElement>(null);\n const [headerReplacementType, setFoundHeaderReplacement] = useState<ReplacementType>('original');\n const [contentReplacementType, setFoundContentReplacement] = useState<ReplacementType>('original');\n const mountedProvider = useRef<AlertFlashContentResult | undefined>();\n\n useEffect(() => {\n const context = { type, headerRef, contentRef };\n\n return onContentRegistered(provider => {\n let mounted = true;\n\n function checkMounted(methodName: string) {\n if (!mounted) {\n console.warn(\n `[AwsUi] [Runtime ${componentName} content] \\`${methodName}\\` called after component unmounted`\n );\n return false;\n }\n return true;\n }\n\n mountedProvider.current = provider.runReplacer(context, {\n hideHeader() {\n if (checkMounted('hideHeader')) {\n setFoundHeaderReplacement('remove');\n }\n },\n restoreHeader() {\n if (checkMounted('restoreHeader')) {\n setFoundHeaderReplacement('original');\n }\n },\n replaceHeader(replacer: (container: HTMLElement) => void) {\n if (checkMounted('replaceHeader')) {\n replacer(replacementHeaderRef.current!);\n setFoundHeaderReplacement('replaced');\n }\n },\n hideContent() {\n if (checkMounted('hideContent')) {\n setFoundContentReplacement('remove');\n }\n },\n restoreContent() {\n if (checkMounted('restoreContent')) {\n setFoundContentReplacement('original');\n }\n },\n replaceContent(replacer: (container: HTMLElement) => void) {\n if (checkMounted('replaceContent')) {\n replacer(replacementContentRef.current!);\n setFoundContentReplacement('replaced');\n }\n },\n });\n\n return () => {\n mountedProvider.current?.unmount({\n replacementHeaderContainer: replacementHeaderRef.current!,\n replacementContentContainer: replacementContentRef.current!,\n });\n mounted = false;\n };\n });\n }, [type]);\n\n useEffect(() => {\n mountedProvider.current?.update();\n }, [type, header, children]);\n\n return {\n headerReplacementType,\n contentReplacementType,\n headerRef: headerRef as React.Ref<HTMLDivElement>,\n replacementHeaderRef: replacementHeaderRef as React.Ref<HTMLDivElement>,\n contentRef: contentRef as React.Ref<HTMLDivElement>,\n replacementContentRef: replacementContentRef as React.Ref<HTMLDivElement>,\n };\n };\n}\n"]}
package/package.json CHANGED
@@ -126,7 +126,7 @@
126
126
  "./internal/base-component/index.js",
127
127
  "./internal/base-component/styles.css.js"
128
128
  ],
129
- "version": "3.0.750",
129
+ "version": "3.0.752",
130
130
  "repository": {
131
131
  "type": "git",
132
132
  "url": "https://github.com/cloudscape-design/components.git"
@@ -1,57 +1,57 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "arrow": "awsui_arrow_xjuzf_1xram_281",
5
- "arrow-outer": "awsui_arrow-outer_xjuzf_1xram_285",
6
- "arrow-inner": "awsui_arrow-inner_xjuzf_1xram_285",
7
- "refresh": "awsui_refresh_xjuzf_1xram_320",
8
- "arrow-position-right-top": "awsui_arrow-position-right-top_xjuzf_1xram_330",
9
- "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_xjuzf_1xram_330",
10
- "arrow-position-left-top": "awsui_arrow-position-left-top_xjuzf_1xram_333",
11
- "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_xjuzf_1xram_333",
12
- "arrow-position-top-center": "awsui_arrow-position-top-center_xjuzf_1xram_336",
13
- "arrow-position-top-right": "awsui_arrow-position-top-right_xjuzf_1xram_336",
14
- "arrow-position-top-left": "awsui_arrow-position-top-left_xjuzf_1xram_336",
15
- "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_xjuzf_1xram_336",
16
- "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_xjuzf_1xram_339",
17
- "arrow-position-bottom-right": "awsui_arrow-position-bottom-right_xjuzf_1xram_339",
18
- "arrow-position-bottom-left": "awsui_arrow-position-bottom-left_xjuzf_1xram_339",
19
- "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_xjuzf_1xram_339",
20
- "body": "awsui_body_xjuzf_1xram_483",
21
- "body-overflow-visible": "awsui_body-overflow-visible_xjuzf_1xram_522",
22
- "has-dismiss": "awsui_has-dismiss_xjuzf_1xram_526",
23
- "dismiss": "awsui_dismiss_xjuzf_1xram_531",
24
- "dismiss-control": "awsui_dismiss-control_xjuzf_1xram_539",
25
- "header-row": "awsui_header-row_xjuzf_1xram_543",
26
- "header": "awsui_header_xjuzf_1xram_543",
27
- "content": "awsui_content_xjuzf_1xram_568",
28
- "content-overflow-visible": "awsui_content-overflow-visible_xjuzf_1xram_576",
29
- "container": "awsui_container_xjuzf_1xram_720",
30
- "container-body": "awsui_container-body_xjuzf_1xram_728",
31
- "container-body-variant-annotation": "awsui_container-body-variant-annotation_xjuzf_1xram_771",
32
- "container-body-size-small": "awsui_container-body-size-small_xjuzf_1xram_776",
33
- "fixed-width": "awsui_fixed-width_xjuzf_1xram_779",
34
- "container-body-size-medium": "awsui_container-body-size-medium_xjuzf_1xram_783",
35
- "container-body-size-large": "awsui_container-body-size-large_xjuzf_1xram_790",
36
- "container-arrow": "awsui_container-arrow_xjuzf_1xram_802",
37
- "container-arrow-position-right-top": "awsui_container-arrow-position-right-top_xjuzf_1xram_806",
38
- "container-arrow-position-right-bottom": "awsui_container-arrow-position-right-bottom_xjuzf_1xram_806",
39
- "container-arrow-position-left-top": "awsui_container-arrow-position-left-top_xjuzf_1xram_823",
40
- "container-arrow-position-left-bottom": "awsui_container-arrow-position-left-bottom_xjuzf_1xram_823",
41
- "container-arrow-position-top-center": "awsui_container-arrow-position-top-center_xjuzf_1xram_840",
42
- "container-arrow-position-top-right": "awsui_container-arrow-position-top-right_xjuzf_1xram_840",
43
- "container-arrow-position-top-left": "awsui_container-arrow-position-top-left_xjuzf_1xram_840",
44
- "container-arrow-position-top-responsive": "awsui_container-arrow-position-top-responsive_xjuzf_1xram_840",
45
- "container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-center_xjuzf_1xram_856",
46
- "container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-right_xjuzf_1xram_860",
47
- "container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-left_xjuzf_1xram_864",
48
- "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_xjuzf_1xram_1",
49
- "root": "awsui_root_xjuzf_1xram_1052",
50
- "root-filtering-token": "awsui_root-filtering-token_xjuzf_1xram_1088",
51
- "trigger": "awsui_trigger_xjuzf_1xram_1092",
52
- "overflow-ellipsis": "awsui_overflow-ellipsis_xjuzf_1xram_1099",
53
- "trigger-type-text": "awsui_trigger-type-text_xjuzf_1xram_1107",
54
- "trigger-type-filtering-token": "awsui_trigger-type-filtering-token_xjuzf_1xram_1143",
55
- "popover-inline-content": "awsui_popover-inline-content_xjuzf_1xram_1147"
4
+ "arrow": "awsui_arrow_xjuzf_na7jp_281",
5
+ "arrow-outer": "awsui_arrow-outer_xjuzf_na7jp_285",
6
+ "arrow-inner": "awsui_arrow-inner_xjuzf_na7jp_285",
7
+ "refresh": "awsui_refresh_xjuzf_na7jp_320",
8
+ "arrow-position-right-top": "awsui_arrow-position-right-top_xjuzf_na7jp_330",
9
+ "arrow-position-right-bottom": "awsui_arrow-position-right-bottom_xjuzf_na7jp_330",
10
+ "arrow-position-left-top": "awsui_arrow-position-left-top_xjuzf_na7jp_333",
11
+ "arrow-position-left-bottom": "awsui_arrow-position-left-bottom_xjuzf_na7jp_333",
12
+ "arrow-position-top-center": "awsui_arrow-position-top-center_xjuzf_na7jp_336",
13
+ "arrow-position-top-right": "awsui_arrow-position-top-right_xjuzf_na7jp_336",
14
+ "arrow-position-top-left": "awsui_arrow-position-top-left_xjuzf_na7jp_336",
15
+ "arrow-position-top-responsive": "awsui_arrow-position-top-responsive_xjuzf_na7jp_336",
16
+ "arrow-position-bottom-center": "awsui_arrow-position-bottom-center_xjuzf_na7jp_339",
17
+ "arrow-position-bottom-right": "awsui_arrow-position-bottom-right_xjuzf_na7jp_339",
18
+ "arrow-position-bottom-left": "awsui_arrow-position-bottom-left_xjuzf_na7jp_339",
19
+ "arrow-position-bottom-responsive": "awsui_arrow-position-bottom-responsive_xjuzf_na7jp_339",
20
+ "body": "awsui_body_xjuzf_na7jp_483",
21
+ "body-overflow-visible": "awsui_body-overflow-visible_xjuzf_na7jp_522",
22
+ "has-dismiss": "awsui_has-dismiss_xjuzf_na7jp_526",
23
+ "dismiss": "awsui_dismiss_xjuzf_na7jp_531",
24
+ "dismiss-control": "awsui_dismiss-control_xjuzf_na7jp_539",
25
+ "header-row": "awsui_header-row_xjuzf_na7jp_543",
26
+ "header": "awsui_header_xjuzf_na7jp_543",
27
+ "content": "awsui_content_xjuzf_na7jp_568",
28
+ "content-overflow-visible": "awsui_content-overflow-visible_xjuzf_na7jp_576",
29
+ "container": "awsui_container_xjuzf_na7jp_720",
30
+ "container-body": "awsui_container-body_xjuzf_na7jp_728",
31
+ "container-body-variant-annotation": "awsui_container-body-variant-annotation_xjuzf_na7jp_771",
32
+ "container-body-size-small": "awsui_container-body-size-small_xjuzf_na7jp_776",
33
+ "fixed-width": "awsui_fixed-width_xjuzf_na7jp_779",
34
+ "container-body-size-medium": "awsui_container-body-size-medium_xjuzf_na7jp_783",
35
+ "container-body-size-large": "awsui_container-body-size-large_xjuzf_na7jp_790",
36
+ "container-arrow": "awsui_container-arrow_xjuzf_na7jp_802",
37
+ "container-arrow-position-right-top": "awsui_container-arrow-position-right-top_xjuzf_na7jp_806",
38
+ "container-arrow-position-right-bottom": "awsui_container-arrow-position-right-bottom_xjuzf_na7jp_806",
39
+ "container-arrow-position-left-top": "awsui_container-arrow-position-left-top_xjuzf_na7jp_823",
40
+ "container-arrow-position-left-bottom": "awsui_container-arrow-position-left-bottom_xjuzf_na7jp_823",
41
+ "container-arrow-position-top-center": "awsui_container-arrow-position-top-center_xjuzf_na7jp_840",
42
+ "container-arrow-position-top-right": "awsui_container-arrow-position-top-right_xjuzf_na7jp_840",
43
+ "container-arrow-position-top-left": "awsui_container-arrow-position-top-left_xjuzf_na7jp_840",
44
+ "container-arrow-position-top-responsive": "awsui_container-arrow-position-top-responsive_xjuzf_na7jp_840",
45
+ "container-arrow-position-bottom-center": "awsui_container-arrow-position-bottom-center_xjuzf_na7jp_856",
46
+ "container-arrow-position-bottom-right": "awsui_container-arrow-position-bottom-right_xjuzf_na7jp_860",
47
+ "container-arrow-position-bottom-left": "awsui_container-arrow-position-bottom-left_xjuzf_na7jp_864",
48
+ "awsui-motion-fade-in": "awsui_awsui-motion-fade-in_xjuzf_na7jp_1",
49
+ "root": "awsui_root_xjuzf_na7jp_1052",
50
+ "root-filtering-token": "awsui_root-filtering-token_xjuzf_na7jp_1088",
51
+ "trigger": "awsui_trigger_xjuzf_na7jp_1092",
52
+ "overflow-ellipsis": "awsui_overflow-ellipsis_xjuzf_na7jp_1099",
53
+ "trigger-type-text": "awsui_trigger-type-text_xjuzf_na7jp_1107",
54
+ "trigger-type-filtering-token": "awsui_trigger-type-filtering-token_xjuzf_na7jp_1143",
55
+ "popover-inline-content": "awsui_popover-inline-content_xjuzf_na7jp_1147"
56
56
  };
57
57