@cloudscape-design/components-themeable 3.0.1229 → 3.0.1230

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 (57) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/error-boundary/styles.scss +2 -1
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  5. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +52 -46
  6. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  7. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -1
  8. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +66 -64
  9. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +56 -54
  12. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  13. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
  14. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +3 -1
  15. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  16. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts +5 -5
  17. package/lib/internal/template/app-layout/visual-refresh-toolbar/internal.d.ts.map +1 -1
  18. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.d.ts +3 -2
  19. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.d.ts.map +1 -1
  20. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js +6 -1
  21. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js.map +1 -1
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +54 -49
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  25. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
  26. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +31 -26
  27. package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  28. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.d.ts +3 -2
  29. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.d.ts.map +1 -1
  30. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js +6 -2
  31. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js.map +1 -1
  32. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts +3 -2
  33. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
  34. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +6 -2
  35. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
  36. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.d.ts +3 -2
  37. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.d.ts.map +1 -1
  38. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js +6 -1
  39. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js.map +1 -1
  40. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.d.ts +3 -2
  41. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.d.ts.map +1 -1
  42. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js +4 -1
  43. package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js.map +1 -1
  44. package/lib/internal/template/error-boundary/interfaces.d.ts +3 -0
  45. package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
  46. package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
  47. package/lib/internal/template/error-boundary/internal.d.ts +2 -1
  48. package/lib/internal/template/error-boundary/internal.d.ts.map +1 -1
  49. package/lib/internal/template/error-boundary/internal.js +11 -0
  50. package/lib/internal/template/error-boundary/internal.js.map +1 -1
  51. package/lib/internal/template/error-boundary/styles.css.js +5 -4
  52. package/lib/internal/template/error-boundary/styles.scoped.css +5 -4
  53. package/lib/internal/template/error-boundary/styles.selectors.js +5 -4
  54. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  55. package/lib/internal/template/internal/environment.js +2 -2
  56. package/lib/internal/template/internal/environment.json +2 -2
  57. package/package.json +1 -1
@@ -2,12 +2,13 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
4
  import clsx from 'clsx';
5
+ import { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';
5
6
  import { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';
6
7
  import { createWidgetizedComponent } from '../../../internal/widgets';
7
8
  import { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../notifications';
8
9
  import { isWidgetReady } from '../state/invariants';
9
10
  import styles from '../skeleton/styles.css.js';
10
- export const TopContentSlotImplementation = ({ appLayoutProps, appLayoutState }) => {
11
+ export const TopContentSlotImplementationInternal = ({ appLayoutProps, appLayoutState }) => {
11
12
  if (!isWidgetReady(appLayoutState)) {
12
13
  return null;
13
14
  }
@@ -15,5 +16,7 @@ export const TopContentSlotImplementation = ({ appLayoutProps, appLayoutState })
15
16
  appLayoutProps.notifications && (React.createElement("div", { className: clsx(styles['notifications-background'], appLayoutProps.headerVariant === 'high-contrast' && highContrastHeaderClassName) })),
16
17
  appLayoutProps.notifications && (React.createElement(AppLayoutNotifications, { appLayoutInternals: appLayoutState.appLayoutInternals }, appLayoutProps.notifications))));
17
18
  };
19
+ export const TopContentSlotImplementation = (props) => (React.createElement(AppLayoutBuiltInErrorBoundary, null,
20
+ React.createElement(TopContentSlotImplementationInternal, { ...props })));
18
21
  export const createWidgetizedAppLayoutTopContentSlot = createWidgetizedComponent(TopContentSlotImplementation);
19
22
  //# sourceMappingURL=top-content-slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"top-content-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oCAAoC,IAAI,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IACpG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL;QACG,cAAc,CAAC,aAAa,IAAI,CAC/B,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,0BAA0B,CAAC,EAClC,cAAc,CAAC,aAAa,KAAK,eAAe,IAAI,2BAA2B,CAChF,GACI,CACR;QACA,cAAc,CAAC,aAAa,IAAI,CAC/B,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,IAC1E,cAAc,CAAC,aAAa,CACN,CAC1B,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../notifications';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { isWidgetReady } from '../state/invariants';\n\nimport styles from '../skeleton/styles.css.js';\n\nexport const TopContentSlotImplementation = ({ appLayoutProps, appLayoutState }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n return (\n <>\n {appLayoutProps.notifications && (\n <div\n className={clsx(\n styles['notifications-background'],\n appLayoutProps.headerVariant === 'high-contrast' && highContrastHeaderClassName\n )}\n ></div>\n )}\n {appLayoutProps.notifications && (\n <AppLayoutNotifications appLayoutInternals={appLayoutState.appLayoutInternals}>\n {appLayoutProps.notifications}\n </AppLayoutNotifications>\n )}\n </>\n );\n};\n\nexport const createWidgetizedAppLayoutTopContentSlot = createWidgetizedComponent(TopContentSlotImplementation);\n"]}
1
+ {"version":3,"file":"top-content-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oCAAoC,IAAI,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,EAAE,cAAc,EAAE,cAAc,EAAqB,EAAE,EAAE;IAC5G,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL;QACG,cAAc,CAAC,aAAa,IAAI,CAC/B,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,0BAA0B,CAAC,EAClC,cAAc,CAAC,aAAa,KAAK,eAAe,IAAI,2BAA2B,CAChF,GACI,CACR;QACA,cAAc,CAAC,aAAa,IAAI,CAC/B,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,IAC1E,cAAc,CAAC,aAAa,CACN,CAC1B,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACxE,oBAAC,6BAA6B;IAC5B,oBAAC,oCAAoC,OAAK,KAAK,GAAI,CACrB,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAAC,4BAA4B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../notifications';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { isWidgetReady } from '../state/invariants';\n\nimport styles from '../skeleton/styles.css.js';\n\nexport const TopContentSlotImplementationInternal = ({ appLayoutProps, appLayoutState }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n return (\n <>\n {appLayoutProps.notifications && (\n <div\n className={clsx(\n styles['notifications-background'],\n appLayoutProps.headerVariant === 'high-contrast' && highContrastHeaderClassName\n )}\n ></div>\n )}\n {appLayoutProps.notifications && (\n <AppLayoutNotifications appLayoutInternals={appLayoutState.appLayoutInternals}>\n {appLayoutProps.notifications}\n </AppLayoutNotifications>\n )}\n </>\n );\n};\n\nexport const TopContentSlotImplementation = (props: SkeletonPartProps) => (\n <AppLayoutBuiltInErrorBoundary>\n <TopContentSlotImplementationInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n);\n\nexport const createWidgetizedAppLayoutTopContentSlot = createWidgetizedComponent(TopContentSlotImplementation);\n"]}
@@ -93,4 +93,7 @@ export interface BuiltInErrorBoundaryProps {
93
93
  wrapper?: (content: React.ReactNode) => React.ReactNode;
94
94
  suppressNested?: boolean;
95
95
  }
96
+ export interface AppLayoutBuiltInErrorBoundaryProps extends BuiltInErrorBoundaryProps {
97
+ renderFallback?: ErrorBoundaryProps['renderFallback'];
98
+ }
96
99
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,OAAO,EAAE,CAAC,MAAM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AAE,KAAK,CAAC,SAAS,CAAC;KAC3B;IAED,UAAiB,aAAa;QAC5B,KAAK,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B;CACF;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;IACxD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,kCAAmC,SAAQ,yBAAyB;IACnF,cAAc,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;CACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/error-boundary/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 { ErrorInfo } from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ErrorBoundaryProps extends BaseComponentProps {\n /**\n * Optional identifier for the error boundary instance.\n *\n * When provided, the identifier is included in the `onError` callback payload.\n * In the rendered output, the boundary wraps its content in a `<div>` with the\n * attribute `data-awsui-boundary-id={errorBoundaryId}` to support debugging.\n */\n errorBoundaryId?: string;\n\n /**\n * Callback invoked when an error is intercepted by the boundary.\n * Use this function to record, log, or report errors (for example, to telemetry or monitoring systems).\n *\n * The callback receives a `detail` object containing:\n * * `error` (Error): The thrown error instance.\n * * `errorInfo` (React.ErrorInfo): Additional metadata captured by React.\n * * `errorBoundaryId` (optional, string): The boundary identifier, if defined.\n */\n onError: (detail: ErrorBoundaryProps.OnErrorDetail) => void;\n\n /**\n * Controls how nested error boundaries behave.\n *\n * Several components—such as app layout, container, and modal include built-in\n * error boundaries. These boundaries activate automatically when they detect\n * an ancestor boundary, inheriting configuration from the closest one.\n *\n * When `suppressNested` is set to `true`, nested built-in error boundaries\n * and nested standalone error boundaries with `suppressible=true` are disabled,\n * so the errors propagate further up and are captured by this error boundary.\n */\n suppressNested?: boolean;\n\n /**\n * When set to `true`, this error boundary can be suppressed by another error\n * boundary with `suppressNested=true`, rendered above in the components tree.\n */\n suppressible?: boolean;\n\n /**\n * Optional custom renderer for the fallback UI displayed when an error occurs.\n *\n * The function receives the default slots derived from i18n configuration:\n * * `header` (ReactNode): The fallback header text.\n * * `description` (ReactNode): The fallback description text.\n * * `action` (ReactNode): The fallback action element (a refresh button by default).\n *\n * Return a React node to fully override the default fallback presentation.\n */\n renderFallback?: (props: ErrorBoundaryProps.FallbackProps) => React.ReactNode;\n\n /**\n * Localized strings and components used in the fallback UI.\n *\n * * `headerText` (string): Header text displayed in the fallback view.\n * * `descriptionText` (string): Description text displayed in the fallback view. Supports embedding inline\n * feedback actions by including `<Feedback>` pseudo-tags when `components.Feedback` is provided.\n * * `refreshActionText` (string): Text for the default refresh action button.\n * * `components.Feedback` (React.ComponentType<I18nFeedbackProps>): A component used to render\n * inline feedback actions within the description text.\n *\n * @i18n\n */\n i18nStrings?: ErrorBoundaryProps.I18nStrings;\n\n /**\n * Child content rendered when no error has been captured.\n */\n children: React.ReactNode;\n}\n\nexport namespace ErrorBoundaryProps {\n export interface FallbackProps {\n header?: React.ReactNode;\n description?: React.ReactNode;\n action?: React.ReactNode;\n }\n\n export interface I18nStrings {\n headerText?: string;\n descriptionText?: string;\n refreshActionText?: string;\n components?: {\n Feedback?: React.ComponentType<I18nFeedbackProps>;\n };\n }\n\n export interface I18nFeedbackProps {\n children: React.ReactNode;\n }\n\n export interface OnErrorDetail {\n error: Error;\n errorInfo: ErrorInfo;\n errorBoundaryId?: string;\n }\n}\n\nexport interface BuiltInErrorBoundaryProps {\n children: React.ReactNode;\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n suppressNested?: boolean;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/error-boundary/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 { ErrorInfo } from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ErrorBoundaryProps extends BaseComponentProps {\n /**\n * Optional identifier for the error boundary instance.\n *\n * When provided, the identifier is included in the `onError` callback payload.\n * In the rendered output, the boundary wraps its content in a `<div>` with the\n * attribute `data-awsui-boundary-id={errorBoundaryId}` to support debugging.\n */\n errorBoundaryId?: string;\n\n /**\n * Callback invoked when an error is intercepted by the boundary.\n * Use this function to record, log, or report errors (for example, to telemetry or monitoring systems).\n *\n * The callback receives a `detail` object containing:\n * * `error` (Error): The thrown error instance.\n * * `errorInfo` (React.ErrorInfo): Additional metadata captured by React.\n * * `errorBoundaryId` (optional, string): The boundary identifier, if defined.\n */\n onError: (detail: ErrorBoundaryProps.OnErrorDetail) => void;\n\n /**\n * Controls how nested error boundaries behave.\n *\n * Several components—such as app layout, container, and modal include built-in\n * error boundaries. These boundaries activate automatically when they detect\n * an ancestor boundary, inheriting configuration from the closest one.\n *\n * When `suppressNested` is set to `true`, nested built-in error boundaries\n * and nested standalone error boundaries with `suppressible=true` are disabled,\n * so the errors propagate further up and are captured by this error boundary.\n */\n suppressNested?: boolean;\n\n /**\n * When set to `true`, this error boundary can be suppressed by another error\n * boundary with `suppressNested=true`, rendered above in the components tree.\n */\n suppressible?: boolean;\n\n /**\n * Optional custom renderer for the fallback UI displayed when an error occurs.\n *\n * The function receives the default slots derived from i18n configuration:\n * * `header` (ReactNode): The fallback header text.\n * * `description` (ReactNode): The fallback description text.\n * * `action` (ReactNode): The fallback action element (a refresh button by default).\n *\n * Return a React node to fully override the default fallback presentation.\n */\n renderFallback?: (props: ErrorBoundaryProps.FallbackProps) => React.ReactNode;\n\n /**\n * Localized strings and components used in the fallback UI.\n *\n * * `headerText` (string): Header text displayed in the fallback view.\n * * `descriptionText` (string): Description text displayed in the fallback view. Supports embedding inline\n * feedback actions by including `<Feedback>` pseudo-tags when `components.Feedback` is provided.\n * * `refreshActionText` (string): Text for the default refresh action button.\n * * `components.Feedback` (React.ComponentType<I18nFeedbackProps>): A component used to render\n * inline feedback actions within the description text.\n *\n * @i18n\n */\n i18nStrings?: ErrorBoundaryProps.I18nStrings;\n\n /**\n * Child content rendered when no error has been captured.\n */\n children: React.ReactNode;\n}\n\nexport namespace ErrorBoundaryProps {\n export interface FallbackProps {\n header?: React.ReactNode;\n description?: React.ReactNode;\n action?: React.ReactNode;\n }\n\n export interface I18nStrings {\n headerText?: string;\n descriptionText?: string;\n refreshActionText?: string;\n components?: {\n Feedback?: React.ComponentType<I18nFeedbackProps>;\n };\n }\n\n export interface I18nFeedbackProps {\n children: React.ReactNode;\n }\n\n export interface OnErrorDetail {\n error: Error;\n errorInfo: ErrorInfo;\n errorBoundaryId?: string;\n }\n}\n\nexport interface BuiltInErrorBoundaryProps {\n children: React.ReactNode;\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n suppressNested?: boolean;\n}\n\nexport interface AppLayoutBuiltInErrorBoundaryProps extends BuiltInErrorBoundaryProps {\n renderFallback?: ErrorBoundaryProps['renderFallback'];\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
2
  import { SomeRequired } from '../internal/types';
3
- import { BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';
3
+ import { AppLayoutBuiltInErrorBoundaryProps, BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';
4
4
  declare global {
5
5
  interface HTMLElement {
6
6
  __awsui__?: {
@@ -13,5 +13,6 @@ interface InternalErrorBoundaryProps extends SomeRequired<ErrorBoundaryProps, 's
13
13
  }
14
14
  export declare function InternalErrorBoundary({ children, suppressNested, suppressible, __internalRootRef, ...props }: InternalErrorBoundaryProps): JSX.Element;
15
15
  export declare function BuiltInErrorBoundary({ wrapper, suppressNested, children }: BuiltInErrorBoundaryProps): JSX.Element;
16
+ export declare function AppLayoutBuiltInErrorBoundary({ wrapper, suppressNested, children, renderFallback, }: AppLayoutBuiltInErrorBoundaryProps): JSX.Element;
16
17
  export {};
17
18
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAK7E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,SAAS,CAAC,EAAE;YAAE,UAAU,CAAC,IAAI,IAAI,CAAC;YAAC,gBAAgB,CAAC,IAAI,IAAI,CAAA;SAAE,CAAC;KAChE;CACF;AAaD,UAAU,0BACR,SAAQ,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,GAAG,cAAc,CAAC,EACzE,0BAA0B;CAAG;AAEjC,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,0BAA0B,eA8B5B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAsB,EAAE,QAAQ,EAAE,EAAE,yBAAyB,eAa5G"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,kCAAkC,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAKjH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,SAAS,CAAC,EAAE;YAAE,UAAU,CAAC,IAAI,IAAI,CAAC;YAAC,gBAAgB,CAAC,IAAI,IAAI,CAAA;SAAE,CAAC;KAChE;CACF;AAaD,UAAU,0BACR,SAAQ,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,GAAG,cAAc,CAAC,EACzE,0BAA0B;CAAG;AAEjC,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,0BAA0B,eA8B5B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAsB,EAAE,QAAQ,EAAE,EAAE,yBAAyB,eAa5G;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,EACP,cAAsB,EACtB,QAAQ,EACR,cAA4B,GAC7B,EAAE,kCAAkC,eAoBpC"}
@@ -34,6 +34,17 @@ export function BuiltInErrorBoundary({ wrapper, suppressNested = false, children
34
34
  return !thisSuppressed ? (React.createElement(ErrorBoundaryImpl, { ...context, wrapper: wrapper },
35
35
  React.createElement(ErrorBoundariesContext.Provider, { value: { ...context, suppressed: nextSuppressed } }, children))) : (React.createElement(React.Fragment, null, children));
36
36
  }
37
+ export function AppLayoutBuiltInErrorBoundary({ wrapper, suppressNested = false, children, renderFallback = () => React.createElement(React.Fragment, null), }) {
38
+ const context = useContext(ErrorBoundariesContext);
39
+ const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;
40
+ const nextSuppressed = suppressNested || thisSuppressed;
41
+ return (React.createElement(ErrorBoundaryImpl, { ...context, wrapper: wrapper, renderFallback: renderFallback, className: styles['app-layout-part-fallback'], onError: error => {
42
+ var _a;
43
+ (_a = context === null || context === void 0 ? void 0 : context.onError) === null || _a === void 0 ? void 0 : _a.call(context, error);
44
+ // TODO Implement cloudscape error reporting
45
+ } },
46
+ React.createElement(ErrorBoundariesContext.Provider, { value: { ...context, suppressed: nextSuppressed, renderFallback } }, children)));
47
+ }
37
48
  class ErrorBoundaryImpl extends Component {
38
49
  constructor(props) {
39
50
  super(props);
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAI7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AASrC,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAEhC,MAAM,sBAAsB,GAAG,aAAa,CAI1C;IACA,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC;AAMH,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,GAAG,KAAK,EACmB;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,KAAK,IAAI,IAAI,YAAY,CAAC;IACnE,MAAM,cAAc,GAAG,cAAc,IAAI,cAAc,CAAC;IAExD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,UAAU,GAAG,CAAC,IAA2B,EAAE,EAAE;QACjD,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;YACtB,CAAC;YACD,IAAI,CAAC,SAAS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AAQ,CAAI,CAChB,CAAC;AACJ,CAAC;AAWD,MAAM,iBAAkB,SAAQ,SAAqD;IACnF,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,wBAAwB;QAC7B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B;;QACxD,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,mDAAG,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM;;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAClD,MAAM,QAAQ,GAAG,oBAAC,qBAAqB,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;YAC3D,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,mDAAG,QAAQ,CAAC,mCAAI,QAAQ,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Component, createContext, useContext, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { ErrorBoundaryFallback } from './fallback';\nimport { BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\n// Helper methods attached to the component's root node for e2e testing.\ndeclare global {\n interface HTMLElement {\n __awsui__?: { forceError?(): void; clearForcedError?(): void };\n }\n}\n\nconst RootSuppressed = Symbol();\n\nconst ErrorBoundariesContext = createContext<\n Pick<ErrorBoundaryProps, 'renderFallback' | 'i18nStrings' | 'onError' | 'errorBoundaryId'> & {\n suppressed: boolean | typeof RootSuppressed;\n }\n>({\n onError: () => {},\n suppressed: RootSuppressed,\n});\n\ninterface InternalErrorBoundaryProps\n extends SomeRequired<ErrorBoundaryProps, 'suppressNested' | 'suppressible'>,\n InternalBaseComponentProps {}\n\nexport function InternalErrorBoundary({\n children,\n suppressNested,\n suppressible,\n __internalRootRef,\n ...props\n}: InternalErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true && suppressible;\n const nextSuppressed = suppressNested || thisSuppressed;\n\n const [forcedError, setForcedError] = useState(false);\n const setElement = (node: null | HTMLDivElement) => {\n if (node) {\n if (!node.__awsui__) {\n node.__awsui__ = {};\n }\n node.__awsui__.forceError = () => setForcedError(true);\n node.__awsui__.clearForcedError = () => setForcedError(false);\n }\n };\n const mergedRef = useMergeRefs(setElement, __internalRootRef);\n\n return (\n <div ref={mergedRef} className={styles['error-boundary']} data-awsui-boundary-id={props.errorBoundaryId}>\n {!thisSuppressed ? (\n <ErrorBoundaryImpl {...props} forcedError={forcedError}>\n <ErrorBoundariesContext.Provider value={{ ...props, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n )}\n </div>\n );\n}\n\nexport function BuiltInErrorBoundary({ wrapper, suppressNested = false, children }: BuiltInErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;\n const nextSuppressed = suppressNested || thisSuppressed;\n return !thisSuppressed ? (\n <ErrorBoundaryImpl {...context} wrapper={wrapper}>\n <ErrorBoundariesContext.Provider value={{ ...context, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n );\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\ninterface ErrorBoundaryImplProps extends ErrorBoundaryProps {\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n forcedError?: boolean;\n}\n\nclass ErrorBoundaryImpl extends Component<ErrorBoundaryImplProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryImplProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n this.props.onError?.({ error, errorInfo, errorBoundaryId: this.props.errorBoundaryId });\n }\n\n render() {\n if (this.state.hasError || this.props.forcedError) {\n const fallback = <ErrorBoundaryFallback {...this.props} />;\n return this.props.wrapper?.(fallback) ?? fallback;\n }\n return this.props.children;\n }\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAI7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AASrC,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC;AAEhC,MAAM,sBAAsB,GAAG,aAAa,CAI1C;IACA,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC;AAMH,MAAM,UAAU,qBAAqB,CAAC,EACpC,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,GAAG,KAAK,EACmB;IAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;IACnD,MAAM,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AAqD;IACnF,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,wBAAwB;QAC7B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B;;QACxD,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,mDAAG,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED,MAAM;;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YAClD,MAAM,QAAQ,GAAG,oBAAC,qBAAqB,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;YAC3D,OAAO,MAAA,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,OAAO,mDAAG,QAAQ,CAAC,mCAAI,QAAQ,CAAC;QACpD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Component, createContext, useContext, useState } from 'react';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { ErrorBoundaryFallback } from './fallback';\nimport { AppLayoutBuiltInErrorBoundaryProps, BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\n// Helper methods attached to the component's root node for e2e testing.\ndeclare global {\n interface HTMLElement {\n __awsui__?: { forceError?(): void; clearForcedError?(): void };\n }\n}\n\nconst RootSuppressed = Symbol();\n\nconst ErrorBoundariesContext = createContext<\n Pick<ErrorBoundaryProps, 'renderFallback' | 'i18nStrings' | 'onError' | 'errorBoundaryId'> & {\n suppressed: boolean | typeof RootSuppressed;\n }\n>({\n onError: () => {},\n suppressed: RootSuppressed,\n});\n\ninterface InternalErrorBoundaryProps\n extends SomeRequired<ErrorBoundaryProps, 'suppressNested' | 'suppressible'>,\n InternalBaseComponentProps {}\n\nexport function InternalErrorBoundary({\n children,\n suppressNested,\n suppressible,\n __internalRootRef,\n ...props\n}: InternalErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true && suppressible;\n const nextSuppressed = suppressNested || thisSuppressed;\n\n const [forcedError, setForcedError] = useState(false);\n const setElement = (node: null | HTMLDivElement) => {\n if (node) {\n if (!node.__awsui__) {\n node.__awsui__ = {};\n }\n node.__awsui__.forceError = () => setForcedError(true);\n node.__awsui__.clearForcedError = () => setForcedError(false);\n }\n };\n const mergedRef = useMergeRefs(setElement, __internalRootRef);\n\n return (\n <div ref={mergedRef} className={styles['error-boundary']} data-awsui-boundary-id={props.errorBoundaryId}>\n {!thisSuppressed ? (\n <ErrorBoundaryImpl {...props} forcedError={forcedError}>\n <ErrorBoundariesContext.Provider value={{ ...props, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n )}\n </div>\n );\n}\n\nexport function BuiltInErrorBoundary({ wrapper, suppressNested = false, children }: BuiltInErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;\n const nextSuppressed = suppressNested || thisSuppressed;\n return !thisSuppressed ? (\n <ErrorBoundaryImpl {...context} wrapper={wrapper}>\n <ErrorBoundariesContext.Provider value={{ ...context, suppressed: nextSuppressed }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n ) : (\n <>{children}</>\n );\n}\n\nexport function AppLayoutBuiltInErrorBoundary({\n wrapper,\n suppressNested = false,\n children,\n renderFallback = () => <></>,\n}: AppLayoutBuiltInErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true || context.suppressed === RootSuppressed;\n const nextSuppressed = suppressNested || thisSuppressed;\n return (\n <ErrorBoundaryImpl\n {...context}\n wrapper={wrapper}\n renderFallback={renderFallback}\n className={styles['app-layout-part-fallback']}\n onError={error => {\n context?.onError?.(error);\n // TODO Implement cloudscape error reporting\n }}\n >\n <ErrorBoundariesContext.Provider value={{ ...context, suppressed: nextSuppressed, renderFallback }}>\n {children}\n </ErrorBoundariesContext.Provider>\n </ErrorBoundaryImpl>\n );\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n}\n\ninterface ErrorBoundaryImplProps extends ErrorBoundaryProps {\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n forcedError?: boolean;\n}\n\nclass ErrorBoundaryImpl extends Component<ErrorBoundaryImplProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryImplProps) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n return { hasError: true };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void {\n this.props.onError?.({ error, errorInfo, errorBoundaryId: this.props.errorBoundaryId });\n }\n\n render() {\n if (this.state.hasError || this.props.forcedError) {\n const fallback = <ErrorBoundaryFallback {...this.props} />;\n return this.props.wrapper?.(fallback) ?? fallback;\n }\n return this.props.children;\n }\n}\n"]}
@@ -1,9 +1,10 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "error-boundary": "awsui_error-boundary_9pwoq_r5exj_5",
5
- "header": "awsui_header_9pwoq_r5exj_6",
6
- "description": "awsui_description_9pwoq_r5exj_7",
7
- "action": "awsui_action_9pwoq_r5exj_8"
4
+ "error-boundary": "awsui_error-boundary_9pwoq_e6u2g_5",
5
+ "header": "awsui_header_9pwoq_e6u2g_6",
6
+ "description": "awsui_description_9pwoq_e6u2g_7",
7
+ "action": "awsui_action_9pwoq_e6u2g_8",
8
+ "app-layout-part-fallback": "awsui_app-layout-part-fallback_9pwoq_e6u2g_9"
8
9
  };
9
10
 
@@ -2,9 +2,10 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- .awsui_error-boundary_9pwoq_r5exj_5:not(#\9),
6
- .awsui_header_9pwoq_r5exj_6:not(#\9),
7
- .awsui_description_9pwoq_r5exj_7:not(#\9),
8
- .awsui_action_9pwoq_r5exj_8:not(#\9) {
5
+ .awsui_error-boundary_9pwoq_e6u2g_5:not(#\9),
6
+ .awsui_header_9pwoq_e6u2g_6:not(#\9),
7
+ .awsui_description_9pwoq_e6u2g_7:not(#\9),
8
+ .awsui_action_9pwoq_e6u2g_8:not(#\9),
9
+ .awsui_app-layout-part-fallback_9pwoq_e6u2g_9:not(#\9) {
9
10
  display: contents;
10
11
  }
@@ -2,9 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "error-boundary": "awsui_error-boundary_9pwoq_r5exj_5",
6
- "header": "awsui_header_9pwoq_r5exj_6",
7
- "description": "awsui_description_9pwoq_r5exj_7",
8
- "action": "awsui_action_9pwoq_r5exj_8"
5
+ "error-boundary": "awsui_error-boundary_9pwoq_e6u2g_5",
6
+ "header": "awsui_header_9pwoq_e6u2g_6",
7
+ "description": "awsui_description_9pwoq_e6u2g_7",
8
+ "action": "awsui_action_9pwoq_e6u2g_8",
9
+ "app-layout-part-fallback": "awsui_app-layout-part-fallback_9pwoq_e6u2g_9"
9
10
  };
10
11
 
@@ -3816,5 +3816,5 @@ body {
3816
3816
  }
3817
3817
  }
3818
3818
  :root {
3819
- --awsui-version-info-54387a4e: true;
3819
+ --awsui-version-info-d579b631: true;
3820
3820
  }
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (54387a4e)";
3
- export var GIT_SHA = "54387a4e";
2
+ export var PACKAGE_VERSION = "3.0.0 (d579b631)";
3
+ export var GIT_SHA = "d579b631";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "core";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (54387a4e)",
4
- "GIT_SHA": "54387a4e",
3
+ "PACKAGE_VERSION": "3.0.0 (d579b631)",
4
+ "GIT_SHA": "d579b631",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.1229",
3
+ "version": "3.0.1230",
4
4
  "files": [
5
5
  "lib"
6
6
  ],