@cloudscape-design/components-themeable 3.0.1193 → 3.0.1195

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 (47) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/cards/styles.scss +7 -6
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/template/THIRD-PARTY-LICENSES +0 -35
  5. package/lib/internal/template/cards/analytics-metadata/interfaces.d.ts +1 -0
  6. package/lib/internal/template/cards/analytics-metadata/interfaces.d.ts.map +1 -1
  7. package/lib/internal/template/cards/analytics-metadata/interfaces.js.map +1 -1
  8. package/lib/internal/template/cards/index.d.ts.map +1 -1
  9. package/lib/internal/template/cards/index.js +4 -0
  10. package/lib/internal/template/cards/index.js.map +1 -1
  11. package/lib/internal/template/cards/styles.css.js +39 -39
  12. package/lib/internal/template/cards/styles.scoped.css +57 -56
  13. package/lib/internal/template/cards/styles.selectors.js +39 -39
  14. package/lib/internal/template/column-layout/flexible-column-layout/index.js +1 -1
  15. package/lib/internal/template/column-layout/flexible-column-layout/index.js.map +1 -1
  16. package/lib/internal/template/column-layout/grid-column-layout.js +1 -1
  17. package/lib/internal/template/column-layout/grid-column-layout.js.map +1 -1
  18. package/lib/internal/template/error-boundary/index.d.ts +1 -1
  19. package/lib/internal/template/error-boundary/index.d.ts.map +1 -1
  20. package/lib/internal/template/error-boundary/index.js +3 -3
  21. package/lib/internal/template/error-boundary/index.js.map +1 -1
  22. package/lib/internal/template/error-boundary/interfaces.d.ts +13 -3
  23. package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
  24. package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
  25. package/lib/internal/template/error-boundary/internal.d.ts +3 -9
  26. package/lib/internal/template/error-boundary/internal.d.ts.map +1 -1
  27. package/lib/internal/template/error-boundary/internal.js +2 -2
  28. package/lib/internal/template/error-boundary/internal.js.map +1 -1
  29. package/lib/internal/template/grid/internal.d.ts.map +1 -1
  30. package/lib/internal/template/grid/internal.js +1 -1
  31. package/lib/internal/template/grid/internal.js.map +1 -1
  32. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  33. package/lib/internal/template/internal/environment.js +2 -2
  34. package/lib/internal/template/internal/environment.json +2 -2
  35. package/lib/internal/template/internal/metrics.d.ts +1 -1
  36. package/lib/internal/template/internal/metrics.d.ts.map +1 -1
  37. package/lib/internal/template/internal/metrics.js +1 -1
  38. package/lib/internal/template/internal/metrics.js.map +1 -1
  39. package/lib/internal/template/package.json +1 -1
  40. package/lib/internal/template/space-between/internal.d.ts.map +1 -1
  41. package/lib/internal/template/space-between/internal.js +3 -3
  42. package/lib/internal/template/space-between/internal.js.map +1 -1
  43. package/package.json +1 -1
  44. package/lib/internal/template/internal/vendor/react-keyed-flatten-children/index.d.ts +0 -3
  45. package/lib/internal/template/internal/vendor/react-keyed-flatten-children/index.d.ts.map +0 -1
  46. package/lib/internal/template/internal/vendor/react-keyed-flatten-children/index.js +0 -27
  47. package/lib/internal/template/internal/vendor/react-keyed-flatten-children/index.js.map +0 -1
@@ -2,44 +2,44 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "card-inner": "awsui_card-inner_p8a6i_1hyts_161",
6
- "root": "awsui_root_p8a6i_1hyts_193",
7
- "header-variant-full-page": "awsui_header-variant-full-page_p8a6i_1hyts_232",
8
- "header-refresh": "awsui_header-refresh_p8a6i_1hyts_232",
9
- "list": "awsui_list_p8a6i_1hyts_239",
10
- "list-grid-1": "awsui_list-grid-1_p8a6i_1hyts_250",
11
- "card": "awsui_card_p8a6i_1hyts_161",
12
- "list-grid-2": "awsui_list-grid-2_p8a6i_1hyts_253",
13
- "list-grid-3": "awsui_list-grid-3_p8a6i_1hyts_256",
14
- "list-grid-4": "awsui_list-grid-4_p8a6i_1hyts_259",
15
- "list-grid-5": "awsui_list-grid-5_p8a6i_1hyts_262",
16
- "list-grid-6": "awsui_list-grid-6_p8a6i_1hyts_265",
17
- "list-grid-7": "awsui_list-grid-7_p8a6i_1hyts_268",
18
- "list-grid-8": "awsui_list-grid-8_p8a6i_1hyts_271",
19
- "list-grid-9": "awsui_list-grid-9_p8a6i_1hyts_274",
20
- "list-grid-10": "awsui_list-grid-10_p8a6i_1hyts_277",
21
- "list-grid-11": "awsui_list-grid-11_p8a6i_1hyts_280",
22
- "list-grid-12": "awsui_list-grid-12_p8a6i_1hyts_283",
23
- "list-grid-13": "awsui_list-grid-13_p8a6i_1hyts_286",
24
- "list-grid-14": "awsui_list-grid-14_p8a6i_1hyts_289",
25
- "list-grid-15": "awsui_list-grid-15_p8a6i_1hyts_292",
26
- "list-grid-16": "awsui_list-grid-16_p8a6i_1hyts_295",
27
- "list-grid-17": "awsui_list-grid-17_p8a6i_1hyts_298",
28
- "list-grid-18": "awsui_list-grid-18_p8a6i_1hyts_301",
29
- "list-grid-19": "awsui_list-grid-19_p8a6i_1hyts_304",
30
- "list-grid-20": "awsui_list-grid-20_p8a6i_1hyts_307",
31
- "selection-control": "awsui_selection-control_p8a6i_1hyts_311",
32
- "loading": "awsui_loading_p8a6i_1hyts_321",
33
- "empty": "awsui_empty_p8a6i_1hyts_322",
34
- "has-header": "awsui_has-header_p8a6i_1hyts_329",
35
- "refresh": "awsui_refresh_p8a6i_1hyts_332",
36
- "card-header": "awsui_card-header_p8a6i_1hyts_403",
37
- "card-header-inner": "awsui_card-header-inner_p8a6i_1hyts_411",
38
- "card-selectable": "awsui_card-selectable_p8a6i_1hyts_415",
39
- "card-selected": "awsui_card-selected_p8a6i_1hyts_418",
40
- "section": "awsui_section_p8a6i_1hyts_426",
41
- "section-header": "awsui_section-header_p8a6i_1hyts_434",
42
- "section-content": "awsui_section-content_p8a6i_1hyts_440",
43
- "footer-pagination": "awsui_footer-pagination_p8a6i_1hyts_450"
5
+ "card-inner": "awsui_card-inner_p8a6i_169tu_161",
6
+ "root": "awsui_root_p8a6i_169tu_193",
7
+ "header-variant-full-page": "awsui_header-variant-full-page_p8a6i_169tu_232",
8
+ "header-refresh": "awsui_header-refresh_p8a6i_169tu_232",
9
+ "list": "awsui_list_p8a6i_169tu_239",
10
+ "list-grid-1": "awsui_list-grid-1_p8a6i_169tu_250",
11
+ "card": "awsui_card_p8a6i_169tu_161",
12
+ "list-grid-2": "awsui_list-grid-2_p8a6i_169tu_253",
13
+ "list-grid-3": "awsui_list-grid-3_p8a6i_169tu_256",
14
+ "list-grid-4": "awsui_list-grid-4_p8a6i_169tu_259",
15
+ "list-grid-5": "awsui_list-grid-5_p8a6i_169tu_262",
16
+ "list-grid-6": "awsui_list-grid-6_p8a6i_169tu_265",
17
+ "list-grid-7": "awsui_list-grid-7_p8a6i_169tu_268",
18
+ "list-grid-8": "awsui_list-grid-8_p8a6i_169tu_271",
19
+ "list-grid-9": "awsui_list-grid-9_p8a6i_169tu_274",
20
+ "list-grid-10": "awsui_list-grid-10_p8a6i_169tu_277",
21
+ "list-grid-11": "awsui_list-grid-11_p8a6i_169tu_280",
22
+ "list-grid-12": "awsui_list-grid-12_p8a6i_169tu_283",
23
+ "list-grid-13": "awsui_list-grid-13_p8a6i_169tu_286",
24
+ "list-grid-14": "awsui_list-grid-14_p8a6i_169tu_289",
25
+ "list-grid-15": "awsui_list-grid-15_p8a6i_169tu_292",
26
+ "list-grid-16": "awsui_list-grid-16_p8a6i_169tu_295",
27
+ "list-grid-17": "awsui_list-grid-17_p8a6i_169tu_298",
28
+ "list-grid-18": "awsui_list-grid-18_p8a6i_169tu_301",
29
+ "list-grid-19": "awsui_list-grid-19_p8a6i_169tu_304",
30
+ "list-grid-20": "awsui_list-grid-20_p8a6i_169tu_307",
31
+ "selection-control": "awsui_selection-control_p8a6i_169tu_311",
32
+ "loading": "awsui_loading_p8a6i_169tu_321",
33
+ "empty": "awsui_empty_p8a6i_169tu_322",
34
+ "has-header": "awsui_has-header_p8a6i_169tu_329",
35
+ "refresh": "awsui_refresh_p8a6i_169tu_332",
36
+ "card-header": "awsui_card-header_p8a6i_169tu_404",
37
+ "card-header-inner": "awsui_card-header-inner_p8a6i_169tu_412",
38
+ "card-selectable": "awsui_card-selectable_p8a6i_169tu_416",
39
+ "card-selected": "awsui_card-selected_p8a6i_169tu_419",
40
+ "section": "awsui_section_p8a6i_169tu_427",
41
+ "section-header": "awsui_section-header_p8a6i_169tu_435",
42
+ "section-content": "awsui_section-content_p8a6i_169tu_441",
43
+ "footer-pagination": "awsui_footer-pagination_p8a6i_169tu_451"
44
44
  };
45
45
 
@@ -1,9 +1,9 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
+ import flattenChildren from 'react-keyed-flatten-children';
4
5
  import clsx from 'clsx';
5
6
  import { useContainerQuery } from '@cloudscape-design/component-toolkit';
6
- import flattenChildren from '../../internal/vendor/react-keyed-flatten-children';
7
7
  import styles from './styles.css.js';
8
8
  const isOdd = (value) => value % 2 !== 0;
9
9
  export function calculcateCssColumnCount(columns, minColumnWidth, containerWidth) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/column-layout/flexible-column-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,eAAe,MAAM,oDAAoD,CAAC;AAGjF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AAE1D,MAAM,UAAU,wBAAwB,CACtC,OAAe,EACf,cAAsB,EACtB,cAA6B;IAE7B,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,OAAO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AC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAClC,sEAAsE;QACtE,MAAM,GAAG,GAAI,KAAgC,CAAC,GAAG,CAAC;QAElD,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAClC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC3B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,WAAW,KAAK,CAAC;aAChD,CAAC,IAED,KAAK,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport flattenChildren from '../../internal/vendor/react-keyed-flatten-children';\nimport { InternalColumnLayoutProps } from '../interfaces';\n\nimport styles from './styles.css.js';\n\nconst isOdd = (value: number): boolean => value % 2 !== 0;\n\nexport function calculcateCssColumnCount(\n columns: number,\n minColumnWidth: number,\n containerWidth: number | null\n): number {\n if (!containerWidth) {\n return columns;\n }\n\n // First, calculate how many columns we can have based on the current container width and minColumnWidth.\n const targetColumnCount = Math.min(columns, Math.floor(containerWidth / minColumnWidth));\n\n // When we start wrapping into fewer columns than desired, we want to keep the number of columns even.\n return Math.max(\n 1,\n targetColumnCount < columns && isOdd(targetColumnCount) ? targetColumnCount - 1 : targetColumnCount\n );\n}\n\ninterface FlexibleColumnLayoutProps\n extends Pick<\n InternalColumnLayoutProps,\n 'minColumnWidth' | 'columns' | 'variant' | 'borders' | 'disableGutters' | '__tagOverride'\n > {\n children: React.ReactNode;\n}\n\nexport default function FlexibleColumnLayout({\n columns = 1,\n minColumnWidth = 0,\n disableGutters,\n variant,\n children,\n __tagOverride,\n}: FlexibleColumnLayoutProps) {\n const [containerWidth, containerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n\n const columnCount = calculcateCssColumnCount(columns, minColumnWidth, containerWidth);\n const shouldDisableGutters = variant !== 'text-grid' && disableGutters;\n\n // Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n const flattenedChildren = flattenChildren(children);\n const Tag = (__tagOverride ?? 'div') as 'div';\n\n return (\n <Tag\n ref={containerRef}\n className={clsx(\n styles['css-grid'],\n styles[`grid-variant-${variant}`],\n shouldDisableGutters && [styles['grid-no-gutters']]\n )}\n style={{ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` }}\n >\n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n const key = (child as Record<'key', unknown>).key;\n\n return (\n <div\n key={key ? String(key) : undefined}\n className={clsx(styles.item, {\n [styles['first-column']]: i % columnCount === 0,\n })}\n >\n {child}\n </div>\n );\n })}\n </Tag>\n );\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/column-layout/flexible-column-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAIzE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AAE1D,MAAM,UAAU,wBAAwB,CACtC,OAAe,EACf,cAAsB,EACtB,cAA6B;IAE7B,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,yGAAyG;IACzG,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,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O,CACL,6BACE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAClC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC3B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,WAAW,KAAK,CAAC;aAChD,CAAC,IAED,KAAK,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { InternalColumnLayoutProps } from '../interfaces';\n\nimport styles from './styles.css.js';\n\nconst isOdd = (value: number): boolean => value % 2 !== 0;\n\nexport function calculcateCssColumnCount(\n columns: number,\n minColumnWidth: number,\n containerWidth: number | null\n): number {\n if (!containerWidth) {\n return columns;\n }\n\n // First, calculate how many columns we can have based on the current container width and minColumnWidth.\n const targetColumnCount = Math.min(columns, Math.floor(containerWidth / minColumnWidth));\n\n // When we start wrapping into fewer columns than desired, we want to keep the number of columns even.\n return Math.max(\n 1,\n targetColumnCount < columns && isOdd(targetColumnCount) ? targetColumnCount - 1 : targetColumnCount\n );\n}\n\ninterface FlexibleColumnLayoutProps\n extends Pick<\n InternalColumnLayoutProps,\n 'minColumnWidth' | 'columns' | 'variant' | 'borders' | 'disableGutters' | '__tagOverride'\n > {\n children: React.ReactNode;\n}\n\nexport default function FlexibleColumnLayout({\n columns = 1,\n minColumnWidth = 0,\n disableGutters,\n variant,\n children,\n __tagOverride,\n}: FlexibleColumnLayoutProps) {\n const [containerWidth, containerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n\n const columnCount = calculcateCssColumnCount(columns, minColumnWidth, containerWidth);\n const shouldDisableGutters = variant !== 'text-grid' && disableGutters;\n\n // Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n const flattenedChildren = flattenChildren(children);\n const Tag = (__tagOverride ?? 'div') as 'div';\n\n return (\n <Tag\n ref={containerRef}\n className={clsx(\n styles['css-grid'],\n styles[`grid-variant-${variant}`],\n shouldDisableGutters && [styles['grid-no-gutters']]\n )}\n style={{ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` }}\n >\n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n const key = (child as Record<'key', unknown>).key;\n\n return (\n <div\n key={key ? String(key) : undefined}\n className={clsx(styles.item, {\n [styles['first-column']]: i % columnCount === 0,\n })}\n >\n {child}\n </div>\n );\n })}\n </Tag>\n );\n}\n"]}
@@ -1,10 +1,10 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
+ import flattenChildren from 'react-keyed-flatten-children';
4
5
  import clsx from 'clsx';
5
6
  import InternalGrid from '../grid/internal';
6
7
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
7
- import flattenChildren from '../internal/vendor/react-keyed-flatten-children';
8
8
  import { COLUMN_TRIGGERS } from './internal';
9
9
  import { repeat } from './util';
10
10
  import styles from './styles.css.js';
@@ -1 +1 @@
1
- {"version":3,"file":"grid-column-layout.js","sourceRoot":"","sources":["../../../src/column-layout/grid-column-layout.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,eAAe,MAAM,iDAAiD,CAAC;AAE9E,OAAO,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MA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AAE,GAAG,EACR,cAAc,EAAE,IAAI,EACpB,cAAc,EAAE,MAAM,CAAC,MAAA,WAAW,CAAC,OAAO,CAAC,mCAAI,EAAE,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAC5E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,gBAAgB,OAAO,EAAE,CAAC,EAAE;YACjG,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,2BAA2B;YAChE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,yBAAyB;YAC5D,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,oBAAoB;SAClD,CAAC,EACF,YAAY,EAAE,YAAY,IAAI,UAAU,EACxC,qBAAqB,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,IAAI,MAAM,CAAC,mBAAmB,UAAU,EAAE,CAAC,EAC1F,aAAa,EAAE,aAAa,IAE3B,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { GridProps } from '../grid/interfaces';\nimport InternalGrid from '../grid/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport flattenChildren from '../internal/vendor/react-keyed-flatten-children';\nimport { InternalColumnLayoutProps } from './interfaces';\nimport { COLUMN_TRIGGERS, ColumnLayoutBreakpoint } from './internal';\nimport { repeat } from './util';\n\nimport styles from './styles.css.js';\n\nconst COLUMN_DEFS: Record<number, GridProps.ElementDefinition | undefined> = {\n 1: { colspan: { default: 12, xxs: 12, xs: 12 } },\n 2: { colspan: { default: 12, xxs: 6, xs: 6 } },\n 3: { colspan: { default: 12, xxs: 6, xs: 4 } },\n 4: { colspan: { default: 12, xxs: 6, xs: 3 } },\n};\n\ninterface GridColumnLayoutProps\n extends Required<Pick<InternalColumnLayoutProps, 'columns' | 'variant' | 'borders' | 'disableGutters'>>,\n Pick<InternalColumnLayoutProps, '__tagOverride'> {\n children: React.ReactNode;\n __breakpoint?: ColumnLayoutBreakpoint;\n}\n\nexport default function GridColumnLayout({\n columns,\n variant,\n borders,\n disableGutters,\n __breakpoint,\n children,\n __tagOverride,\n}: GridColumnLayoutProps) {\n const isTextGridVariant = variant === 'text-grid';\n const shouldDisableGutters = !isTextGridVariant && disableGutters;\n const shouldHaveHorizontalBorders = !isTextGridVariant && (borders === 'horizontal' || borders === 'all');\n const shouldHaveVerticalBorders = !isTextGridVariant && (borders === 'vertical' || borders === 'all');\n\n // Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n const flattenedChildren = flattenChildren(children);\n\n const [breakpoint, ref] = useContainerBreakpoints(COLUMN_TRIGGERS);\n\n return (\n <InternalGrid\n ref={ref}\n disableGutters={true}\n gridDefinition={repeat(COLUMN_DEFS[columns] ?? {}, flattenedChildren.length)}\n className={clsx(styles.grid, styles[`grid-columns-${columns}`], styles[`grid-variant-${variant}`], {\n [styles['grid-horizontal-borders']]: shouldHaveHorizontalBorders,\n [styles['grid-vertical-borders']]: shouldHaveVerticalBorders,\n [styles['grid-no-gutters']]: shouldDisableGutters,\n })}\n __breakpoint={__breakpoint || breakpoint}\n __responsiveClassName={breakpoint => breakpoint && styles[`grid-breakpoint-${breakpoint}`]}\n __tagOverride={__tagOverride}\n >\n {children}\n </InternalGrid>\n );\n}\n"]}
1
+ {"version":3,"file":"grid-column-layout.js","sourceRoot":"","sources":["../../../src/column-layout/grid-column-layout.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,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AC,UAAU,EAAE,GAAG,CAAC,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC;IAEnE,OAAO,CACL,oBAAC,YAAY,IACX,GAAG,EAAE,GAAG,EACR,cAAc,EAAE,IAAI,EACpB,cAAc,EAAE,MAAM,CAAC,MAAA,WAAW,CAAC,OAAO,CAAC,mCAAI,EAAE,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAC5E,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,gBAAgB,OAAO,EAAE,CAAC,EAAE;YACjG,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,2BAA2B;YAChE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,yBAAyB;YAC5D,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,oBAAoB;SAClD,CAAC,EACF,YAAY,EAAE,YAAY,IAAI,UAAU,EACxC,qBAAqB,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,IAAI,MAAM,CAAC,mBAAmB,UAAU,EAAE,CAAC,EAC1F,aAAa,EAAE,aAAa,IAE3B,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport clsx from 'clsx';\n\nimport { GridProps } from '../grid/interfaces';\nimport InternalGrid from '../grid/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalColumnLayoutProps } from './interfaces';\nimport { COLUMN_TRIGGERS, ColumnLayoutBreakpoint } from './internal';\nimport { repeat } from './util';\n\nimport styles from './styles.css.js';\n\nconst COLUMN_DEFS: Record<number, GridProps.ElementDefinition | undefined> = {\n 1: { colspan: { default: 12, xxs: 12, xs: 12 } },\n 2: { colspan: { default: 12, xxs: 6, xs: 6 } },\n 3: { colspan: { default: 12, xxs: 6, xs: 4 } },\n 4: { colspan: { default: 12, xxs: 6, xs: 3 } },\n};\n\ninterface GridColumnLayoutProps\n extends Required<Pick<InternalColumnLayoutProps, 'columns' | 'variant' | 'borders' | 'disableGutters'>>,\n Pick<InternalColumnLayoutProps, '__tagOverride'> {\n children: React.ReactNode;\n __breakpoint?: ColumnLayoutBreakpoint;\n}\n\nexport default function GridColumnLayout({\n columns,\n variant,\n borders,\n disableGutters,\n __breakpoint,\n children,\n __tagOverride,\n}: GridColumnLayoutProps) {\n const isTextGridVariant = variant === 'text-grid';\n const shouldDisableGutters = !isTextGridVariant && disableGutters;\n const shouldHaveHorizontalBorders = !isTextGridVariant && (borders === 'horizontal' || borders === 'all');\n const shouldHaveVerticalBorders = !isTextGridVariant && (borders === 'vertical' || borders === 'all');\n\n // Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n const flattenedChildren = flattenChildren(children);\n\n const [breakpoint, ref] = useContainerBreakpoints(COLUMN_TRIGGERS);\n\n return (\n <InternalGrid\n ref={ref}\n disableGutters={true}\n gridDefinition={repeat(COLUMN_DEFS[columns] ?? {}, flattenedChildren.length)}\n className={clsx(styles.grid, styles[`grid-columns-${columns}`], styles[`grid-variant-${variant}`], {\n [styles['grid-horizontal-borders']]: shouldHaveHorizontalBorders,\n [styles['grid-vertical-borders']]: shouldHaveVerticalBorders,\n [styles['grid-no-gutters']]: shouldDisableGutters,\n })}\n __breakpoint={__breakpoint || breakpoint}\n __responsiveClassName={breakpoint => breakpoint && styles[`grid-breakpoint-${breakpoint}`]}\n __tagOverride={__tagOverride}\n >\n {children}\n </InternalGrid>\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ErrorBoundaryProps } from './interfaces';
2
2
  export { ErrorBoundaryProps };
3
- declare function ErrorBoundary({ suppressNested, ...props }: ErrorBoundaryProps): JSX.Element;
3
+ declare function ErrorBoundary({ suppressNested, suppressible, ...props }: ErrorBoundaryProps): JSX.Element;
4
4
  export default ErrorBoundary;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,iBAAS,aAAa,CAAC,EAAE,cAAsB,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,eAU9E;AAID,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,iBAAS,aAAa,CAAC,EAAE,cAAsB,EAAE,YAAoB,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,eAiBpG;AAID,eAAe,aAAa,CAAC"}
@@ -5,17 +5,17 @@ import React from 'react';
5
5
  import useBaseComponent from '../internal/hooks/use-base-component';
6
6
  import { applyDisplayName } from '../internal/utils/apply-display-name';
7
7
  import { InternalErrorBoundary } from './internal';
8
- function ErrorBoundary({ suppressNested = false, ...props }) {
8
+ function ErrorBoundary({ suppressNested = false, suppressible = false, ...props }) {
9
9
  var _a, _b;
10
10
  const baseComponentProps = useBaseComponent('ErrorBoundary', {
11
- props: { suppressNested },
11
+ props: { suppressNested, suppressible },
12
12
  metadata: {
13
13
  hasBoundaryId: !!props.errorBoundaryId,
14
14
  hasFeedbackAction: !!((_b = (_a = props.i18nStrings) === null || _a === void 0 ? void 0 : _a.components) === null || _b === void 0 ? void 0 : _b.Feedback),
15
15
  hasRenderFallback: !!props.renderFallback,
16
16
  },
17
17
  });
18
- return React.createElement(InternalErrorBoundary, { ...baseComponentProps, ...props, suppressNested: suppressNested });
18
+ return (React.createElement(InternalErrorBoundary, { ...baseComponentProps, ...props, suppressNested: suppressNested, suppressible: suppressible }));
19
19
  }
20
20
  applyDisplayName(ErrorBoundary, 'ErrorBoundary');
21
21
  export default ErrorBoundary;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/error-boundary/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAInD,SAAS,aAAa,CAAC,EAAE,cAAc,GAAG,KAAK,EAAE,GAAG,KAAK,EAAsB;;IAC7E,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,EAAE;QAC3D,KAAK,EAAE,EAAE,cAAc,EAAE;QACzB,QAAQ,EAAE;YACR,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe;YACtC,iBAAiB,EAAE,CAAC,CAAC,CAAA,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,UAAU,0CAAE,QAAQ,CAAA;YAC5D,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc;SAC1C;KACF,CAAC,CAAC;IACH,OAAO,oBAAC,qBAAqB,OAAK,kBAAkB,KAAM,KAAK,EAAE,cAAc,EAAE,cAAc,GAAI,CAAC;AACtG,CAAC;AAED,gBAAgB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAEjD,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ErrorBoundaryProps } from './interfaces';\nimport { InternalErrorBoundary } from './internal';\n\nexport { ErrorBoundaryProps };\n\nfunction ErrorBoundary({ suppressNested = false, ...props }: ErrorBoundaryProps) {\n const baseComponentProps = useBaseComponent('ErrorBoundary', {\n props: { suppressNested },\n metadata: {\n hasBoundaryId: !!props.errorBoundaryId,\n hasFeedbackAction: !!props.i18nStrings?.components?.Feedback,\n hasRenderFallback: !!props.renderFallback,\n },\n });\n return <InternalErrorBoundary {...baseComponentProps} {...props} suppressNested={suppressNested} />;\n}\n\napplyDisplayName(ErrorBoundary, 'ErrorBoundary');\n\nexport default ErrorBoundary;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/error-boundary/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAInD,SAAS,aAAa,CAAC,EAAE,cAAc,GAAG,KAAK,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,KAAK,EAAsB;;IACnG,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,EAAE;QAC3D,KAAK,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE;QACvC,QAAQ,EAAE;YACR,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe;YACtC,iBAAiB,EAAE,CAAC,CAAC,CAAA,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,UAAU,0CAAE,QAAQ,CAAA;YAC5D,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc;SAC1C;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,qBAAqB,OAChB,kBAAkB,KAClB,KAAK,EACT,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AAEjD,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n'use client';\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { ErrorBoundaryProps } from './interfaces';\nimport { InternalErrorBoundary } from './internal';\n\nexport { ErrorBoundaryProps };\n\nfunction ErrorBoundary({ suppressNested = false, suppressible = false, ...props }: ErrorBoundaryProps) {\n const baseComponentProps = useBaseComponent('ErrorBoundary', {\n props: { suppressNested, suppressible },\n metadata: {\n hasBoundaryId: !!props.errorBoundaryId,\n hasFeedbackAction: !!props.i18nStrings?.components?.Feedback,\n hasRenderFallback: !!props.renderFallback,\n },\n });\n return (\n <InternalErrorBoundary\n {...baseComponentProps}\n {...props}\n suppressNested={suppressNested}\n suppressible={suppressible}\n />\n );\n}\n\napplyDisplayName(ErrorBoundary, 'ErrorBoundary');\n\nexport default ErrorBoundary;\n"]}
@@ -25,11 +25,16 @@ export interface ErrorBoundaryProps {
25
25
  * error boundaries. These boundaries activate automatically when they detect
26
26
  * an ancestor boundary, inheriting configuration from the closest one.
27
27
  *
28
- * When `suppressNested` is set to `true`, nested built-in or standalone
29
- * boundaries are disabled. In this mode, all errors originating from within
30
- * the boundary’s content are captured exclusively by this boundary.
28
+ * When `suppressNested` is set to `true`, nested built-in error boundaries
29
+ * and nested standalone error boundaries with `suppressible=true` are disabled,
30
+ * so the errors propagate further up and are captured by this error boundary.
31
31
  */
32
32
  suppressNested?: boolean;
33
+ /**
34
+ * When set to `true`, this error boundary can be suppressed by another error
35
+ * boundary with `suppressNested=true`, rendered above in the components tree.
36
+ */
37
+ suppressible?: boolean;
33
38
  /**
34
39
  * Optional custom renderer for the fallback UI displayed when an error occurs.
35
40
  *
@@ -82,4 +87,9 @@ export declare namespace ErrorBoundaryProps {
82
87
  errorBoundaryId?: string;
83
88
  }
84
89
  }
90
+ export interface BuiltInErrorBoundaryProps {
91
+ children: React.ReactNode;
92
+ wrapper?: (content: React.ReactNode) => React.ReactNode;
93
+ suppressNested?: boolean;
94
+ }
85
95
  //# 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,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;;;OAQG;IACH,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC,aAAa,KAAK,IAAI,CAAC;IAE5D;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,CAAC,aAAa,KAAK,KAAK,CAAC,SAAS,CAAC;IAE9E;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC;IAE7C;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,aAAa;QAC5B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;KAC1B;IAED,UAAiB,WAAW;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,UAAU,CAAC,EAAE;YACX,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;S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AAE;YACX,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;SACnD,CAAC;KACH;IAED,UAAiB,iBAAiB;QAChC,QAAQ,EAAE,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"}
@@ -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\nexport interface ErrorBoundaryProps {\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 or standalone\n * boundaries are disabled. In this mode, all errors originating from within\n * the boundary’s content are captured exclusively by this boundary.\n */\n suppressNested?: 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"]}
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\nexport interface ErrorBoundaryProps {\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,7 +1,6 @@
1
- import React from 'react';
2
1
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
2
  import { SomeRequired } from '../internal/types';
4
- import { ErrorBoundaryProps } from './interfaces';
3
+ import { BuiltInErrorBoundaryProps, ErrorBoundaryProps } from './interfaces';
5
4
  declare global {
6
5
  interface HTMLElement {
7
6
  __awsui__?: {
@@ -10,14 +9,9 @@ declare global {
10
9
  };
11
10
  }
12
11
  }
13
- interface InternalErrorBoundaryProps extends SomeRequired<ErrorBoundaryProps, 'suppressNested'>, InternalBaseComponentProps {
14
- }
15
- export declare function InternalErrorBoundary({ children, suppressNested, __internalRootRef, ...props }: InternalErrorBoundaryProps): JSX.Element;
16
- interface BuiltInErrorBoundaryProps {
17
- children: React.ReactNode;
18
- wrapper?: (content: React.ReactNode) => React.ReactNode;
19
- suppressNested?: boolean;
12
+ interface InternalErrorBoundaryProps extends SomeRequired<ErrorBoundaryProps, 'suppressNested' | 'suppressible'>, InternalBaseComponentProps {
20
13
  }
14
+ export declare function InternalErrorBoundary({ children, suppressNested, suppressible, __internalRootRef, ...props }: InternalErrorBoundaryProps): JSX.Element;
21
15
  export declare function BuiltInErrorBoundary({ wrapper, suppressNested, children }: BuiltInErrorBoundaryProps): JSX.Element;
22
16
  export {};
23
17
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/error-boundary/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAKlD,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,CAAC,EACxD,0BAA0B;CAAG;AAEjC,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,0BAA0B,eA8B5B;AAED,UAAU,yBAAyB;IACjC,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,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,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"}
@@ -9,9 +9,9 @@ const ErrorBoundariesContext = createContext({
9
9
  onError: () => { },
10
10
  suppressed: RootSuppressed,
11
11
  });
12
- export function InternalErrorBoundary({ children, suppressNested, __internalRootRef, ...props }) {
12
+ export function InternalErrorBoundary({ children, suppressNested, suppressible, __internalRootRef, ...props }) {
13
13
  const context = useContext(ErrorBoundariesContext);
14
- const thisSuppressed = context.suppressed === true;
14
+ const thisSuppressed = context.suppressed === true && suppressible;
15
15
  const nextSuppressed = suppressNested || thisSuppressed;
16
16
  const [forcedError, setForcedError] = useState(false);
17
17
  const setElement = (node) => {
@@ -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;AA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F,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 { 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'>,\n InternalBaseComponentProps {}\n\nexport function InternalErrorBoundary({\n children,\n suppressNested,\n __internalRootRef,\n ...props\n}: InternalErrorBoundaryProps) {\n const context = useContext(ErrorBoundariesContext);\n const thisSuppressed = context.suppressed === true;\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\ninterface BuiltInErrorBoundaryProps {\n children: React.ReactNode;\n wrapper?: (content: React.ReactNode) => React.ReactNode;\n suppressNested?: boolean;\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,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,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,cAA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,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 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/grid/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAa,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKxC,OAAO,EAAE,UAAU,EAA0B,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,UAAU,iBAAkB,SAAQ,SAAS,EAAE,0BAA0B;IACvE,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,KAAK,UAAU,CAAC;IACtE;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,0FA0EjB,CAAC;AAgBF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/grid/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAa,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKxC,OAAO,EAAE,UAAU,EAA0B,MAAM,yBAAyB,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,UAAU,iBAAkB,SAAQ,SAAS,EAAE,0BAA0B;IACvE,YAAY,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAEjC;;OAEG;IACH,qBAAqB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,KAAK,UAAU,CAAC;IACtE;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,0FA0EjB,CAAC;AAgBF,eAAe,YAAY,CAAC"}
@@ -1,13 +1,13 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React from 'react';
4
+ import flattenChildren from 'react-keyed-flatten-children';
4
5
  import clsx from 'clsx';
5
6
  import { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';
6
7
  import { getBaseProps } from '../internal/base-component';
7
8
  import { matchBreakpointMapping } from '../internal/breakpoints';
8
9
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
9
10
  import { isDevelopment } from '../internal/is-development';
10
- import flattenChildren from '../internal/vendor/react-keyed-flatten-children';
11
11
  import styles from './styles.css.js';
12
12
  const InternalGrid = React.forwardRef(({ __breakpoint, gridDefinition = [], disableGutters = false, children, __tagOverride, __responsiveClassName, __internalRootRef, ...restProps }, ref) => {
13
13
  let [defaultBreakpoint, defaultRef] = useContainerBreakpoints(undefined);
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/grid/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,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,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,mBAAmB,CAC1B,IAAY,EACZ,OAAyD,EACzD,UAA6B;IAE7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,IAAI,IAAI,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,eAAe,YAAY,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, { ClassValue } from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { Breakpoint, matchBreakpointMapping } from '../internal/breakpoints';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { isDevelopment } from '../internal/is-development';\nimport flattenChildren from '../internal/vendor/react-keyed-flatten-children';\nimport { GridProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalGridProps extends GridProps, InternalBaseComponentProps {\n __breakpoint?: Breakpoint | null;\n\n /**\n * The handler that fires when the grid breakpoint changes.\n */\n __responsiveClassName?: (breakpoint: Breakpoint | null) => ClassValue;\n /**\n * Overrides the default wrapper HTML tag.\n */\n __tagOverride?: string;\n}\n\nconst InternalGrid = React.forwardRef(\n (\n {\n __breakpoint,\n gridDefinition = [],\n disableGutters = false,\n children,\n __tagOverride,\n __responsiveClassName,\n __internalRootRef,\n ...restProps\n }: InternalGridProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n let [defaultBreakpoint, defaultRef]: [Breakpoint | null, React.Ref<HTMLDivElement>] =\n useContainerBreakpoints(undefined);\n if (__breakpoint !== undefined) {\n defaultBreakpoint = __breakpoint;\n defaultRef = ref;\n }\n\n const baseProps = getBaseProps(restProps);\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n const Tag = (__tagOverride ?? 'div') as 'div';\n\n if (isDevelopment) {\n const columnCount = gridDefinition.length;\n const childCount = flattenedChildren.length;\n if (columnCount !== childCount) {\n warnOnce(\n 'Grid',\n `The number of children (${childCount}) does not match the number of columns defined (${columnCount}).`\n );\n }\n }\n\n const mergedRef = useMergeRefs(defaultRef, __internalRootRef);\n\n return (\n <Tag\n {...baseProps}\n className={clsx(\n styles.grid,\n baseProps.className,\n { [styles['no-gutters']]: disableGutters },\n __responsiveClassName ? __responsiveClassName(defaultBreakpoint) : null\n )}\n ref={mergedRef}\n >\n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n const key = (child as Record<'key', unknown>).key;\n\n return (\n <div\n key={key ? String(key) : undefined}\n className={clsx(\n styles['grid-column'],\n getColumnClassNames('colspan', gridDefinition[i]?.colspan, defaultBreakpoint),\n getColumnClassNames('offset', gridDefinition[i]?.offset, defaultBreakpoint),\n getColumnClassNames('pull', gridDefinition[i]?.pull, defaultBreakpoint),\n getColumnClassNames('push', gridDefinition[i]?.push, defaultBreakpoint)\n )}\n >\n <div className={styles['restore-pointer-events']}>{child}</div>\n </div>\n );\n })}\n </Tag>\n );\n }\n);\n\nfunction getColumnClassNames(\n prop: string,\n mapping: undefined | number | GridProps.BreakpointMapping,\n breakpoint: Breakpoint | null\n): string | null {\n if (typeof mapping === 'number') {\n return styles[`${prop}-${mapping}`];\n }\n if (breakpoint === null || mapping === undefined) {\n return null;\n }\n return styles[`${prop}-${matchBreakpointMapping(mapping, breakpoint)}`];\n}\n\nexport default InternalGrid;\n"]}
1
+ {"version":3,"file":"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AK,SAAS,EAAE,MAAM,CAAC,wBAAwB,CAAC,IAAG,KAAK,CAAO,CAC3D,CACP,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,mBAAmB,CAC1B,IAAY,EACZ,OAAyD,EACzD,UAA6B;IAE7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,UAAU,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,IAAI,IAAI,sBAAsB,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport clsx, { ClassValue } from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { Breakpoint, matchBreakpointMapping } from '../internal/breakpoints';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { isDevelopment } from '../internal/is-development';\nimport { GridProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalGridProps extends GridProps, InternalBaseComponentProps {\n __breakpoint?: Breakpoint | null;\n\n /**\n * The handler that fires when the grid breakpoint changes.\n */\n __responsiveClassName?: (breakpoint: Breakpoint | null) => ClassValue;\n /**\n * Overrides the default wrapper HTML tag.\n */\n __tagOverride?: string;\n}\n\nconst InternalGrid = React.forwardRef(\n (\n {\n __breakpoint,\n gridDefinition = [],\n disableGutters = false,\n children,\n __tagOverride,\n __responsiveClassName,\n __internalRootRef,\n ...restProps\n }: InternalGridProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n let [defaultBreakpoint, defaultRef]: [Breakpoint | null, React.Ref<HTMLDivElement>] =\n useContainerBreakpoints(undefined);\n if (__breakpoint !== undefined) {\n defaultBreakpoint = __breakpoint;\n defaultRef = ref;\n }\n\n const baseProps = getBaseProps(restProps);\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n const Tag = (__tagOverride ?? 'div') as 'div';\n\n if (isDevelopment) {\n const columnCount = gridDefinition.length;\n const childCount = flattenedChildren.length;\n if (columnCount !== childCount) {\n warnOnce(\n 'Grid',\n `The number of children (${childCount}) does not match the number of columns defined (${columnCount}).`\n );\n }\n }\n\n const mergedRef = useMergeRefs(defaultRef, __internalRootRef);\n\n return (\n <Tag\n {...baseProps}\n className={clsx(\n styles.grid,\n baseProps.className,\n { [styles['no-gutters']]: disableGutters },\n __responsiveClassName ? __responsiveClassName(defaultBreakpoint) : null\n )}\n ref={mergedRef}\n >\n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n const key = (child as Record<'key', unknown>).key;\n\n return (\n <div\n key={key ? String(key) : undefined}\n className={clsx(\n styles['grid-column'],\n getColumnClassNames('colspan', gridDefinition[i]?.colspan, defaultBreakpoint),\n getColumnClassNames('offset', gridDefinition[i]?.offset, defaultBreakpoint),\n getColumnClassNames('pull', gridDefinition[i]?.pull, defaultBreakpoint),\n getColumnClassNames('push', gridDefinition[i]?.push, defaultBreakpoint)\n )}\n >\n <div className={styles['restore-pointer-events']}>{child}</div>\n </div>\n );\n })}\n </Tag>\n );\n }\n);\n\nfunction getColumnClassNames(\n prop: string,\n mapping: undefined | number | GridProps.BreakpointMapping,\n breakpoint: Breakpoint | null\n): string | null {\n if (typeof mapping === 'number') {\n return styles[`${prop}-${mapping}`];\n }\n if (breakpoint === null || mapping === undefined) {\n return null;\n }\n return styles[`${prop}-${matchBreakpointMapping(mapping, breakpoint)}`];\n}\n\nexport default InternalGrid;\n"]}
@@ -3810,5 +3810,5 @@ body {
3810
3810
  }
3811
3811
  }
3812
3812
  :root {
3813
- --awsui-version-info-f612c54a: true;
3813
+ --awsui-version-info-4129df49: true;
3814
3814
  }
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (f612c54a)";
3
- export var GIT_SHA = "f612c54a";
2
+ export var PACKAGE_VERSION = "3.0.0 (4129df49)";
3
+ export var GIT_SHA = "4129df49";
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 (f612c54a)",
4
- "GIT_SHA": "f612c54a",
3
+ "PACKAGE_VERSION": "3.0.0 (4129df49)",
4
+ "GIT_SHA": "4129df49",
5
5
  "THEME": "default",
6
6
  "SYSTEM": "core",
7
7
  "ALWAYS_VISUAL_REFRESH": false
@@ -1,3 +1,3 @@
1
- import { Metrics } from '@cloudscape-design/component-toolkit/internal';
1
+ import { Metrics } from '@cloudscape-design/component-toolkit/internal/metrics';
2
2
  export declare const metrics: Metrics;
3
3
  //# sourceMappingURL=metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/internal/metrics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;AAIxE,eAAO,MAAM,OAAO,SAAgG,CAAC"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/internal/metrics.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uDAAuD,CAAC;AAIhF,eAAO,MAAM,OAAO,SAAgG,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { Metrics } from '@cloudscape-design/component-toolkit/internal';
3
+ import { Metrics } from '@cloudscape-design/component-toolkit/internal/metrics';
4
4
  import { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from './environment';
5
5
  export const metrics = new Metrics({ packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme: THEME });
6
6
  //# sourceMappingURL=metrics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/internal/metrics.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;AAExE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Metrics } from '@cloudscape-design/component-toolkit/internal';\n\nimport { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from './environment';\n\nexport const metrics = new Metrics({ packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme: THEME });\n"]}
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/internal/metrics.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,uDAAuD,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { Metrics } from '@cloudscape-design/component-toolkit/internal/metrics';\n\nimport { PACKAGE_SOURCE, PACKAGE_VERSION, THEME } from './environment';\n\nexport const metrics = new Metrics({ packageSource: PACKAGE_SOURCE, packageVersion: PACKAGE_VERSION, theme: THEME });\n"]}
@@ -178,7 +178,7 @@
178
178
  "date-fns": "^2.25.0",
179
179
  "intl-messageformat": "^10.3.1",
180
180
  "mnth": "^2.0.0",
181
- "react-is": ">=16.8.0",
181
+ "react-keyed-flatten-children": "^2.2.1",
182
182
  "react-transition-group": "^4.4.2",
183
183
  "tslib": "^2.4.0",
184
184
  "weekstart": "^1.1.0"
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/space-between/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAM1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMjD,QAAA,MAAM,oBAAoB,uHAgDzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/space-between/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMjD,QAAA,MAAM,oBAAoB,uHAgDzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,11 +1,11 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import React, { forwardRef, isValidElement } from 'react';
3
+ import React, { forwardRef } from 'react';
4
+ import flattenChildren from 'react-keyed-flatten-children';
4
5
  import clsx from 'clsx';
5
6
  import { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';
6
7
  import { getBaseProps } from '../internal/base-component';
7
8
  import WithNativeAttributes from '../internal/utils/with-native-attributes';
8
- import flattenChildren from '../internal/vendor/react-keyed-flatten-children';
9
9
  import styles from './styles.css.js';
10
10
  const InternalSpaceBetween = forwardRef(({ direction = 'vertical', size, children, alignItems, nativeAttributes, __internalRootRef, ...props }, ref) => {
11
11
  const mergedRef = useMergeRefs(ref, __internalRootRef);
@@ -15,7 +15,7 @@ const InternalSpaceBetween = forwardRef(({ direction = 'vertical', size, childre
15
15
  */
16
16
  const flattenedChildren = flattenChildren(children);
17
17
  return (React.createElement(WithNativeAttributes, { ...baseProps, tag: "div", componentName: "SpaceBetween", nativeAttributes: nativeAttributes, className: clsx(baseProps.className, styles.root, styles[direction], styles[`${direction}-${size}`], alignItems && styles[`align-${alignItems}`]), ref: mergedRef }, flattenedChildren.map(child => {
18
- const key = isValidElement(child) ? child.key : undefined;
18
+ const key = typeof child === 'object' ? child.key : undefined;
19
19
  return (React.createElement("div", { key: key, className: styles.child }, child));
20
20
  })));
21
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/space-between/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAC5E,OAAO,eAAe,MAAM,iDAAiD,CAAC;AAG9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,oBAAoB,GAAG,UAAU,CACrC,CACE,EACE,SAAS,GAAG,UAAU,EACtB,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,GAAG,KAAK,EACkB,EAC5B,GAA8B,EAC9B,EAAE;IACF,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEtC;;KAEC;IACD,MAAM,iBAAiB,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAEpD,OAAO,CACL,oBAAC,oBAAoB,OACf,SAAS,EACb,GAAG,EAAC,KAAK,EACT,aAAa,EAAC,cAAc,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,IAAI,CACb,SAAS,CAAC,SAAS,EACnB,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,SAAS,CAAC,EACjB,MAAM,CAAC,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC,EAC9B,UAAU,IAAI,MAAM,CAAC,SAAS,UAAU,EAAE,CAAC,CAC5C,EACD,GAAG,EAAE,SAAS,IAEb,iBAAiB,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAC7B,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QAE1D,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,IACnC,KAAK,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACmB,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, isValidElement } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport flattenChildren from '../internal/vendor/react-keyed-flatten-children';\nimport { SpaceBetweenProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalSpaceBetweenProps = SpaceBetweenProps & InternalBaseComponentProps;\n\nconst InternalSpaceBetween = forwardRef(\n (\n {\n direction = 'vertical',\n size,\n children,\n alignItems,\n nativeAttributes,\n __internalRootRef,\n ...props\n }: InternalSpaceBetweenProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const mergedRef = useMergeRefs(ref, __internalRootRef);\n const baseProps = getBaseProps(props);\n\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"div\"\n componentName=\"SpaceBetween\"\n nativeAttributes={nativeAttributes}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[direction],\n styles[`${direction}-${size}`],\n alignItems && styles[`align-${alignItems}`]\n )}\n ref={mergedRef}\n >\n {flattenedChildren.map(child => {\n const key = isValidElement(child) ? child.key : undefined;\n\n return (\n <div key={key} className={styles.child}>\n {child}\n </div>\n );\n })}\n </WithNativeAttributes>\n );\n }\n);\n\nexport default InternalSpaceBetween;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/space-between/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4B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reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef } from 'react';\nimport flattenChildren from 'react-keyed-flatten-children';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport { SpaceBetweenProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalSpaceBetweenProps = SpaceBetweenProps & InternalBaseComponentProps;\n\nconst InternalSpaceBetween = forwardRef(\n (\n {\n direction = 'vertical',\n size,\n children,\n alignItems,\n nativeAttributes,\n __internalRootRef,\n ...props\n }: InternalSpaceBetweenProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const mergedRef = useMergeRefs(ref, __internalRootRef);\n const baseProps = getBaseProps(props);\n\n /*\n Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n */\n const flattenedChildren = flattenChildren(children);\n\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"div\"\n componentName=\"SpaceBetween\"\n nativeAttributes={nativeAttributes}\n className={clsx(\n baseProps.className,\n styles.root,\n styles[direction],\n styles[`${direction}-${size}`],\n alignItems && styles[`align-${alignItems}`]\n )}\n ref={mergedRef}\n >\n {flattenedChildren.map(child => {\n const key = typeof child === 'object' ? child.key : undefined;\n\n return (\n <div key={key} className={styles.child}>\n {child}\n </div>\n );\n })}\n </WithNativeAttributes>\n );\n }\n);\n\nexport default InternalSpaceBetween;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.1193",
3
+ "version": "3.0.1195",
4
4
  "files": [
5
5
  "lib"
6
6
  ],
@@ -1,3 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export default function flattenChildren(children: ReactNode, depth?: number, keys?: (string | number)[]): ReactNode[];
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/vendor/react-keyed-flatten-children/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAwD,SAAS,EAAE,MAAM,OAAO,CAAC;AASxF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,SAAI,EAAE,IAAI,GAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAO,GAAG,SAAS,EAAE,CAenH"}
@@ -1,27 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- // Vendored from react-keyed-flatten-children@3.2.0 (MIT License)
4
- // Original source: https://github.com/grrowl/react-keyed-flatten-children
5
- import { Children, cloneElement, isValidElement } from 'react';
6
- import { isFragment } from 'react-is';
7
- /* Returns React children into an array, flattening fragments. */
8
- function isFragmentWithChildren(node) {
9
- return isFragment(node);
10
- }
11
- export default function flattenChildren(children, depth = 0, keys = []) {
12
- return Children.toArray(children).reduce((acc, node, nodeIndex) => {
13
- if (isFragmentWithChildren(node)) {
14
- acc.push(...flattenChildren(node.props.children, depth + 1, keys.concat(node.key || nodeIndex)));
15
- }
16
- else if (isValidElement(node)) {
17
- acc.push(cloneElement(node, {
18
- key: keys.concat(String(node.key)).join('.'),
19
- }));
20
- }
21
- else if (typeof node === 'string' || typeof node === 'number') {
22
- acc.push(node);
23
- }
24
- return acc;
25
- }, []);
26
- }
27
- //# sourceMappingURL=index.js.map