@cloudscape-design/components-themeable 3.0.1142 → 3.0.1144

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 (79) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  3. package/lib/internal/scss/status-indicator/styles.scss +1 -0
  4. package/lib/internal/scss/tree-view/tree-item/styles.scss +2 -3
  5. package/lib/internal/scss/tree-view/vertical-connector/styles.scss +29 -0
  6. package/lib/internal/template/collection-preferences/visible-content.d.ts.map +1 -1
  7. package/lib/internal/template/collection-preferences/visible-content.js +1 -1
  8. package/lib/internal/template/collection-preferences/visible-content.js.map +1 -1
  9. package/lib/internal/template/icon/generated/icons.d.ts +1 -0
  10. package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
  11. package/lib/internal/template/icon/generated/icons.js +2 -0
  12. package/lib/internal/template/icon/generated/icons.js.map +1 -1
  13. package/lib/internal/template/icon/interfaces.d.ts +1 -1
  14. package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
  15. package/lib/internal/template/icon/interfaces.js.map +1 -1
  16. package/lib/internal/template/icon-provider/interfaces.d.ts +1 -0
  17. package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
  18. package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
  19. package/lib/internal/template/internal/base-component/styles.scoped.css +13 -1
  20. package/lib/internal/template/internal/environment.js +2 -2
  21. package/lib/internal/template/internal/environment.json +2 -2
  22. package/lib/internal/template/internal/generated/styles/tokens.d.ts +2 -0
  23. package/lib/internal/template/internal/generated/styles/tokens.js +2 -0
  24. package/lib/internal/template/internal/generated/theming/index.cjs +45 -0
  25. package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +9 -0
  26. package/lib/internal/template/internal/generated/theming/index.d.ts +9 -0
  27. package/lib/internal/template/internal/generated/theming/index.js +45 -0
  28. package/lib/internal/template/internal/hooks/use-mobile/index.d.ts.map +1 -1
  29. package/lib/internal/template/internal/hooks/use-mobile/index.js +3 -1
  30. package/lib/internal/template/internal/hooks/use-mobile/index.js.map +1 -1
  31. package/lib/internal/template/internal/plugins/api.d.ts.map +1 -1
  32. package/lib/internal/template/internal/plugins/api.js +1 -3
  33. package/lib/internal/template/internal/plugins/api.js.map +1 -1
  34. package/lib/internal/template/internal/utils/check-safe-url.d.ts.map +1 -1
  35. package/lib/internal/template/internal/utils/check-safe-url.js +1 -3
  36. package/lib/internal/template/internal/utils/check-safe-url.js.map +1 -1
  37. package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js +2 -10
  38. package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
  39. package/lib/internal/template/status-indicator/interfaces.d.ts +1 -1
  40. package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
  41. package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
  42. package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
  43. package/lib/internal/template/status-indicator/internal.js +1 -0
  44. package/lib/internal/template/status-indicator/internal.js.map +1 -1
  45. package/lib/internal/template/status-indicator/styles.css.js +24 -23
  46. package/lib/internal/template/status-indicator/styles.scoped.css +32 -29
  47. package/lib/internal/template/status-indicator/styles.selectors.js +24 -23
  48. package/lib/internal/template/steps/internal.d.ts.map +1 -1
  49. package/lib/internal/template/steps/internal.js +1 -0
  50. package/lib/internal/template/steps/internal.js.map +1 -1
  51. package/lib/internal/template/table/body-cell/inline-editor.d.ts.map +1 -1
  52. package/lib/internal/template/table/body-cell/inline-editor.js +1 -3
  53. package/lib/internal/template/table/body-cell/inline-editor.js.map +1 -1
  54. package/lib/internal/template/tree-view/index.d.ts +1 -1
  55. package/lib/internal/template/tree-view/index.d.ts.map +1 -1
  56. package/lib/internal/template/tree-view/index.js +5 -3
  57. package/lib/internal/template/tree-view/index.js.map +1 -1
  58. package/lib/internal/template/tree-view/interfaces.d.ts +5 -0
  59. package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -1
  60. package/lib/internal/template/tree-view/interfaces.js.map +1 -1
  61. package/lib/internal/template/tree-view/internal.d.ts +1 -1
  62. package/lib/internal/template/tree-view/internal.d.ts.map +1 -1
  63. package/lib/internal/template/tree-view/internal.js +2 -2
  64. package/lib/internal/template/tree-view/internal.js.map +1 -1
  65. package/lib/internal/template/tree-view/tree-item/index.d.ts +2 -2
  66. package/lib/internal/template/tree-view/tree-item/index.d.ts.map +1 -1
  67. package/lib/internal/template/tree-view/tree-item/index.js +10 -5
  68. package/lib/internal/template/tree-view/tree-item/index.js.map +1 -1
  69. package/lib/internal/template/tree-view/tree-item/styles.css.js +9 -9
  70. package/lib/internal/template/tree-view/tree-item/styles.scoped.css +14 -15
  71. package/lib/internal/template/tree-view/tree-item/styles.selectors.js +9 -9
  72. package/lib/internal/template/tree-view/vertical-connector/index.d.ts +6 -0
  73. package/lib/internal/template/tree-view/vertical-connector/index.d.ts.map +1 -0
  74. package/lib/internal/template/tree-view/vertical-connector/index.js +11 -0
  75. package/lib/internal/template/tree-view/vertical-connector/index.js.map +1 -0
  76. package/lib/internal/template/tree-view/vertical-connector/styles.css.js +8 -0
  77. package/lib/internal/template/tree-view/vertical-connector/styles.scoped.css +25 -0
  78. package/lib/internal/template/tree-view/vertical-connector/styles.selectors.js +9 -0
  79. package/package.json +1 -1
@@ -2077,6 +2077,10 @@ export var preset = {
2077
2077
  "light": "{colorNeutral250}",
2078
2078
  "dark": "{colorNeutral950}"
2079
2079
  },
2080
+ "colorTreeViewConnectorLine": {
2081
+ "light": "{colorNeutral500}",
2082
+ "dark": "{colorNeutral300}"
2083
+ },
2080
2084
  "fontBoxValueLargeWeight": "700",
2081
2085
  "fontButtonLetterSpacing": "0.005em",
2082
2086
  "fontChartDetailSize": "{fontSizeBodyS}",
@@ -2605,6 +2609,10 @@ export var preset = {
2605
2609
  "comfortable": "{spaceContainerHorizontal}",
2606
2610
  "compact": "{spaceContainerHorizontal}"
2607
2611
  },
2612
+ "spaceTreeViewIndentation": {
2613
+ "comfortable": "{spaceL}",
2614
+ "compact": "{spaceL}"
2615
+ },
2608
2616
  "spaceTileGutter": {
2609
2617
  "comfortable": "{spaceXl}",
2610
2618
  "compact": "{spaceM}"
@@ -3071,6 +3079,10 @@ export var preset = {
3071
3079
  "comfortable": "{spaceContainerHorizontal}",
3072
3080
  "compact": "{spaceContainerHorizontal}"
3073
3081
  },
3082
+ "spaceTreeViewIndentation": {
3083
+ "comfortable": "{spaceL}",
3084
+ "compact": "{spaceL}"
3085
+ },
3074
3086
  "spaceTileGutter": {
3075
3087
  "comfortable": "{spaceXl}",
3076
3088
  "compact": "{spaceM}"
@@ -4344,6 +4356,10 @@ export var preset = {
4344
4356
  "colorGapGlobalDrawer": {
4345
4357
  "light": "{colorNeutral950}",
4346
4358
  "dark": "{colorNeutral950}"
4359
+ },
4360
+ "colorTreeViewConnectorLine": {
4361
+ "light": "{colorNeutral300}",
4362
+ "dark": "{colorNeutral300}"
4347
4363
  }
4348
4364
  }
4349
4365
  },
@@ -5518,6 +5534,10 @@ export var preset = {
5518
5534
  "colorGapGlobalDrawer": {
5519
5535
  "light": "{colorNeutral950}",
5520
5536
  "dark": "{colorNeutral950}"
5537
+ },
5538
+ "colorTreeViewConnectorLine": {
5539
+ "light": "{colorNeutral300}",
5540
+ "dark": "{colorNeutral300}"
5521
5541
  }
5522
5542
  }
5523
5543
  },
@@ -6628,6 +6648,10 @@ export var preset = {
6628
6648
  "colorGapGlobalDrawer": {
6629
6649
  "light": "{colorNeutral250}",
6630
6650
  "dark": "{colorNeutral950}"
6651
+ },
6652
+ "colorTreeViewConnectorLine": {
6653
+ "light": "{colorNeutral500}",
6654
+ "dark": "{colorNeutral300}"
6631
6655
  }
6632
6656
  }
6633
6657
  },
@@ -7738,6 +7762,10 @@ export var preset = {
7738
7762
  "colorGapGlobalDrawer": {
7739
7763
  "light": "{colorNeutral250}",
7740
7764
  "dark": "{colorNeutral950}"
7765
+ },
7766
+ "colorTreeViewConnectorLine": {
7767
+ "light": "{colorNeutral500}",
7768
+ "dark": "{colorNeutral300}"
7741
7769
  }
7742
7770
  }
7743
7771
  },
@@ -8849,6 +8877,10 @@ export var preset = {
8849
8877
  "light": "{colorNeutral250}",
8850
8878
  "dark": "{colorNeutral950}"
8851
8879
  },
8880
+ "colorTreeViewConnectorLine": {
8881
+ "light": "{colorNeutral500}",
8882
+ "dark": "{colorNeutral300}"
8883
+ },
8852
8884
  "fontExpandableHeadingSize": "14px",
8853
8885
  "borderDividerSectionWidth": "1px"
8854
8886
  }
@@ -9960,6 +9992,10 @@ export var preset = {
9960
9992
  "colorGapGlobalDrawer": {
9961
9993
  "light": "{colorNeutral950}",
9962
9994
  "dark": "{colorNeutral950}"
9995
+ },
9996
+ "colorTreeViewConnectorLine": {
9997
+ "light": "{colorNeutral300}",
9998
+ "dark": "{colorNeutral300}"
9963
9999
  }
9964
10000
  }
9965
10001
  },
@@ -10472,6 +10508,7 @@ export var preset = {
10472
10508
  "colorDropzoneBorderDefault": "color",
10473
10509
  "colorDropzoneBorderHover": "color",
10474
10510
  "colorGapGlobalDrawer": "color",
10511
+ "colorTreeViewConnectorLine": "color",
10475
10512
  "motionDurationExtraFast": "motion",
10476
10513
  "motionDurationExtraSlow": "motion",
10477
10514
  "motionDurationFast": "motion",
@@ -10581,6 +10618,7 @@ export var preset = {
10581
10618
  "spaceTableHeaderToolsBottom": "density",
10582
10619
  "spaceTableHeaderToolsFullPageBottom": "density",
10583
10620
  "spaceTableHorizontal": "density",
10621
+ "spaceTreeViewIndentation": "density",
10584
10622
  "spaceTileGutter": "density",
10585
10623
  "spaceScaled2xNone": "density",
10586
10624
  "spaceScaled2xXxxs": "density",
@@ -10925,6 +10963,7 @@ export var preset = {
10925
10963
  "colorDropzoneTextHover",
10926
10964
  "colorDropzoneBorderDefault",
10927
10965
  "colorDropzoneBorderHover",
10966
+ "colorTreeViewConnectorLine",
10928
10967
  "fontFamilyBase",
10929
10968
  "fontFamilyMonospace",
10930
10969
  "fontSizeBodyM",
@@ -11290,6 +11329,7 @@ export var preset = {
11290
11329
  "colorDropzoneTextHover",
11291
11330
  "colorDropzoneBorderDefault",
11292
11331
  "colorDropzoneBorderHover",
11332
+ "colorTreeViewConnectorLine",
11293
11333
  "fontFamilyBase",
11294
11334
  "fontFamilyMonospace",
11295
11335
  "fontSizeBodyM",
@@ -11353,6 +11393,7 @@ export var preset = {
11353
11393
  "motionKeyframesScalePopup",
11354
11394
  "spaceContainerHorizontal",
11355
11395
  "spaceFieldHorizontal",
11396
+ "spaceTreeViewIndentation",
11356
11397
  "spaceScaledXxxs",
11357
11398
  "spaceScaledXxs",
11358
11399
  "spaceScaledXs",
@@ -11921,6 +11962,7 @@ export var preset = {
11921
11962
  "colorDropzoneBorderDefault": "color-dropzone-border-default",
11922
11963
  "colorDropzoneBorderHover": "color-dropzone-border-hover",
11923
11964
  "colorGapGlobalDrawer": "color-gap-global-drawer",
11965
+ "colorTreeViewConnectorLine": "color-tree-view-connector-line",
11924
11966
  "fontBoxValueLargeWeight": "font-box-value-large-weight",
11925
11967
  "fontButtonLetterSpacing": "font-button-letter-spacing",
11926
11968
  "fontChartDetailSize": "font-chart-detail-size",
@@ -12122,6 +12164,7 @@ export var preset = {
12122
12164
  "spaceTableHeaderToolsBottom": "space-table-header-tools-bottom",
12123
12165
  "spaceTableHeaderToolsFullPageBottom": "space-table-header-tools-full-page-bottom",
12124
12166
  "spaceTableHorizontal": "space-table-horizontal",
12167
+ "spaceTreeViewIndentation": "space-tree-view-indentation",
12125
12168
  "spaceTileGutter": "space-tile-gutter",
12126
12169
  "spaceScaled2xNone": "space-scaled-2x-none",
12127
12170
  "spaceScaled2xXxxs": "space-scaled-2x-xxxs",
@@ -12727,6 +12770,7 @@ export var preset = {
12727
12770
  "colorDropzoneBorderDefault": "--color-dropzone-border-default-k648ha",
12728
12771
  "colorDropzoneBorderHover": "--color-dropzone-border-hover-otpag5",
12729
12772
  "colorGapGlobalDrawer": "--color-gap-global-drawer-nh699a",
12773
+ "colorTreeViewConnectorLine": "--color-tree-view-connector-line-1usxvn",
12730
12774
  "fontBoxValueLargeWeight": "--font-box-value-large-weight-wr00sw",
12731
12775
  "fontButtonLetterSpacing": "--font-button-letter-spacing-ufowe3",
12732
12776
  "fontChartDetailSize": "--font-chart-detail-size-9qr25q",
@@ -12928,6 +12972,7 @@ export var preset = {
12928
12972
  "spaceTableHeaderToolsBottom": "--space-table-header-tools-bottom-d9u5kf",
12929
12973
  "spaceTableHeaderToolsFullPageBottom": "--space-table-header-tools-full-page-bottom-9m47g6",
12930
12974
  "spaceTableHorizontal": "--space-table-horizontal-suurzj",
12975
+ "spaceTreeViewIndentation": "--space-tree-view-indentation-gmy1k3",
12931
12976
  "spaceTileGutter": "--space-tile-gutter-bi2bdv",
12932
12977
  "spaceScaled2xNone": "--space-scaled-2x-none-987dp7",
12933
12978
  "spaceScaled2xXxxs": "--space-scaled-2x-xxxs-reumxj",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-mobile/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,eAAwC,CAAC;AA4B3E,eAAO,MAAM,SAAS,eASpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-mobile/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,eAAwC,CAAC;AA6B3E,eAAO,MAAM,SAAS,eASpB,CAAC"}
@@ -4,6 +4,7 @@ import { createSingletonState } from '@cloudscape-design/component-toolkit/inter
4
4
  import { getMatchingBreakpoint, mobileBreakpoint } from '../../breakpoints';
5
5
  export const forceMobileModeSymbol = Symbol.for('awsui-force-mobile-mode');
6
6
  function getIsMobile() {
7
+ var _a;
7
8
  // allow overriding the mobile mode in tests
8
9
  // any is needed because of this https://github.com/microsoft/TypeScript/issues/36813
9
10
  const forceMobileMode = globalThis[forceMobileModeSymbol];
@@ -22,7 +23,8 @@ function getIsMobile() {
22
23
  * wouldn't know which one of them to use).
23
24
  * Instead, we use the media query here in JS too.
24
25
  */
25
- return window.matchMedia(`(max-width: ${mobileBreakpoint}px)`).matches;
26
+ /* istanbul ignore next: matchMedia is not available in jsdom. */
27
+ return (_a = window.matchMedia(`(max-width: ${mobileBreakpoint}px)`)) === null || _a === void 0 ? void 0 : _a.matches;
26
28
  }
27
29
  return getMatchingBreakpoint(window.innerWidth, ['xs']) !== 'xs';
28
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-mobile/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAE3E,SAAS,WAAW;IAClB,4CAA4C;IAC5C,qFAAqF;IACrF,MAAM,eAAe,GAAI,UAAkB,CAAC,qBAAqB,CAAC,CAAC;IACnE,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE,CAAC;QAC3C,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,qCAAqC;QACrC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB;;;;;;WAMG;QACH,OAAO,MAAM,CAAC,UAAU,CAAC,eAAe,gBAAgB,KAAK,CAAC,CAAC,OAAO,CAAC;IACzE,CAAC;IAED,OAAO,qBAAqB,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC;AACnE,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,oBAAoB,CAAU;IACrD,YAAY,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;IACjC,OAAO,EAAE,OAAO,CAAC,EAAE;QACjB,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;QAC9C,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5C,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACjD,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createSingletonState } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getMatchingBreakpoint, mobileBreakpoint } from '../../breakpoints';\n\nexport const forceMobileModeSymbol = Symbol.for('awsui-force-mobile-mode');\n\nfunction getIsMobile() {\n // allow overriding the mobile mode in tests\n // any is needed because of this https://github.com/microsoft/TypeScript/issues/36813\n const forceMobileMode = (globalThis as any)[forceMobileModeSymbol];\n if (typeof forceMobileMode !== 'undefined') {\n return forceMobileMode;\n }\n if (typeof window === 'undefined') {\n // assume desktop in server-rendering\n return false;\n }\n\n if (window.matchMedia) {\n /**\n * Some browsers include the scrollbar width in their media query calculations, but\n * some browsers don't. Thus we can't use `window.innerWidth` or\n * `document.documentElement.clientWidth` to get a very accurate result (since we\n * wouldn't know which one of them to use).\n * Instead, we use the media query here in JS too.\n */\n return window.matchMedia(`(max-width: ${mobileBreakpoint}px)`).matches;\n }\n\n return getMatchingBreakpoint(window.innerWidth, ['xs']) !== 'xs';\n}\n\nexport const useMobile = createSingletonState<boolean>({\n initialState: () => getIsMobile(),\n factory: handler => {\n const listener = () => handler(getIsMobile());\n window.addEventListener('resize', listener);\n return () => {\n window.removeEventListener('resize', listener);\n };\n },\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/hooks/use-mobile/index.ts"],"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Content":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createSingletonState } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getMatchingBreakpoint, mobileBreakpoint } from '../../breakpoints';\n\nexport const forceMobileModeSymbol = Symbol.for('awsui-force-mobile-mode');\n\nfunction getIsMobile() {\n // allow overriding the mobile mode in tests\n // any is needed because of this https://github.com/microsoft/TypeScript/issues/36813\n const forceMobileMode = (globalThis as any)[forceMobileModeSymbol];\n if (typeof forceMobileMode !== 'undefined') {\n return forceMobileMode;\n }\n if (typeof window === 'undefined') {\n // assume desktop in server-rendering\n return false;\n }\n\n if (window.matchMedia) {\n /**\n * Some browsers include the scrollbar width in their media query calculations, but\n * some browsers don't. Thus we can't use `window.innerWidth` or\n * `document.documentElement.clientWidth` to get a very accurate result (since we\n * wouldn't know which one of them to use).\n * Instead, we use the media query here in JS too.\n */\n /* istanbul ignore next: matchMedia is not available in jsdom. */\n return window.matchMedia(`(max-width: ${mobileBreakpoint}px)`)?.matches;\n }\n\n return getMatchingBreakpoint(window.innerWidth, ['xs']) !== 'xs';\n}\n\nexport const useMobile = createSingletonState<boolean>({\n initialState: () => getIsMobile(),\n factory: handler => {\n const listener = () => handler(getIsMobile());\n window.addEventListener('resize', listener);\n return () => {\n window.removeEventListener('resize', listener);\n };\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/internal/plugins/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAA2B,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAC7G,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAE3B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAA6B,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,sBAAsB,EAAyB,MAAM,2BAA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,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAA6B,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,sBAAsB,EAAyB,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAuB,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAK1G,UAAU,QAAQ;IAChB,YAAY,EAAE;QACZ,SAAS,EAAE,gBAAgB,CAAC;QAC5B,KAAK,EAAE,gBAAgB,CAAC;QACxB,YAAY,EAAE,0BAA0B,CAAC;QACzC,QAAQ,EAAE,gBAAgB,CAAC;QAC3B,YAAY,EAAE,0BAA0B,CAAC;KAC1C,CAAC;IACF,oBAAoB,EAAE;QACpB,SAAS,EAAE,kBAAkB,CAAC;QAC9B,eAAe,EAAE,0BAA0B,CAAC;QAC5C,KAAK,EAAE,kBAAkB,CAAC;QAC1B,YAAY,EAAE,4BAA4B,CAAC;QAC3C,QAAQ,EAAE,kBAAkB,CAAC;QAC7B,YAAY,EAAE,4BAA4B,CAAC;QAC3C,WAAW,EAAE,sBAAsB,CAAC,oBAAoB,CAAC,CAAC;QAC1D,mBAAmB,EAAE,8BAA8B,CAAC;KACrD,CAAC;CACH;AAwBD,wBAAgB,OAAO,aAWtB;AAED,eAAO,MAAQ,YAAY;eArDZ,gBAAgB;WACpB,gBAAgB;kBACT,0BAA0B;cAC9B,gBAAgB;kBACZ,0BAA0B;GAiDf,oBAAoB;eA9ClC,kBAAkB;qBACZ,0BAA0B;WACpC,kBAAkB;kBACX,4BAA4B;cAChC,kBAAkB;kBACd,4BAA4B;iBAC7B,sBAAsB,CAAC,oBAAoB,CAAC;yBACpC,8BAA8B;CAuCQ,CAAC"}
@@ -16,10 +16,8 @@ function findUpApi(currentWindow) {
16
16
  return undefined;
17
17
  }
18
18
  return findUpApi(currentWindow.parent);
19
- // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore
20
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
19
  }
22
- catch (ex) {
20
+ catch {
23
21
  // Most likely a cross-origin access error
24
22
  return undefined;
25
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/internal/plugins/api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAwC,MAAM,8BAA8B,CAAC;AAC7G,OAAO,EAGL,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA8B,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAA0B,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAwC,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAkC,MAAM,qCAAqC,CAAC;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AA0BlD,SAAS,SAAS,CAAC,aAA4B;IAC7C,IAAI,CAAC;QACH,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,UAAU,CAAC,EAAE,CAAC;YAChC,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;YAC7D,4DAA4D;YAC5D,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,SAAS,CAAC,aAAa,CAAC,MAAuB,CAAC,CAAC;QAExD,6GAA6G;QAC7G,6DAA6D;IAC/D,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,0CAA0C;QAC1C,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,UAA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AAe,CAChF,GAAG,CAAC,oBAAoB,CAAC,mBAAmB,CAC7C,CAAC;IAEF,OAAO,GAAe,CAAC;AACzB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';\nimport { ActionButtonsController, ActionsApiInternal, ActionsApiPublic } from './controllers/action-buttons';\nimport {\n AlertFlashContentApiInternal,\n AlertFlashContentApiPublic,\n AlertFlashContentController,\n} from './controllers/alert-flash-content';\nimport { AppLayoutWidgetApiInternal, AppLayoutWidgetController } from './controllers/app-layout-widget';\nimport { BreadcrumbsApiInternal, BreadcrumbsController } from './controllers/breadcrumbs';\nimport { DrawersApiInternal, DrawersApiPublic, DrawersController } from './controllers/drawers';\nimport { SharedReactContexts, SharedReactContextsApiInternal } from './controllers/shared-react-contexts';\nimport { reportRuntimeApiLoadMetric } from './helpers/metrics';\n\nconst storageKey = Symbol.for('awsui-plugin-api');\n\ninterface AwsuiApi {\n awsuiPlugins: {\n appLayout: DrawersApiPublic;\n alert: ActionsApiPublic;\n alertContent: AlertFlashContentApiPublic;\n flashbar: ActionsApiPublic;\n flashContent: AlertFlashContentApiPublic;\n };\n awsuiPluginsInternal: {\n appLayout: DrawersApiInternal;\n appLayoutWidget: AppLayoutWidgetApiInternal;\n alert: ActionsApiInternal;\n alertContent: AlertFlashContentApiInternal;\n flashbar: ActionsApiInternal;\n flashContent: AlertFlashContentApiInternal;\n breadcrumbs: BreadcrumbsApiInternal<BreadcrumbGroupProps>;\n sharedReactContexts: SharedReactContextsApiInternal;\n };\n}\n\ninterface WindowWithApi extends Window {\n [storageKey]: AwsuiApi;\n}\n\nfunction findUpApi(currentWindow: WindowWithApi): AwsuiApi | undefined {\n try {\n if (currentWindow?.[storageKey]) {\n return currentWindow[storageKey];\n }\n\n if (!currentWindow || currentWindow.parent === currentWindow) {\n // When the window has no more parents, it references itself\n return undefined;\n }\n\n return findUpApi(currentWindow.parent as WindowWithApi);\n\n // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (ex) {\n // Most likely a cross-origin access error\n return undefined;\n }\n}\n\nexport function loadApi() {\n if (typeof window === 'undefined') {\n return installApi({});\n }\n const win = window as unknown as WindowWithApi;\n const existingApi = findUpApi(win);\n if (!existingApi) {\n reportRuntimeApiLoadMetric();\n }\n win[storageKey] = installApi(existingApi ?? {});\n return win[storageKey];\n}\n\nexport const { awsuiPlugins, awsuiPluginsInternal } = loadApi();\n\ntype DeepPartial<T> = T extends (...args: any) => any ? T : { [P in keyof T]?: DeepPartial<T[P]> };\n\nfunction installApi(api: DeepPartial<AwsuiApi>): AwsuiApi {\n api.awsuiPlugins ??= {};\n api.awsuiPluginsInternal ??= {};\n\n const appLayoutDrawers = new DrawersController();\n api.awsuiPlugins.appLayout = appLayoutDrawers.installPublic(api.awsuiPlugins.appLayout);\n api.awsuiPluginsInternal.appLayout = appLayoutDrawers.installInternal(api.awsuiPluginsInternal.appLayout);\n\n const appLayoutController = new AppLayoutWidgetController();\n api.awsuiPluginsInternal.appLayoutWidget = appLayoutController.installInternal(\n api.awsuiPluginsInternal.appLayoutWidget\n );\n\n const alertActions = new ActionButtonsController();\n api.awsuiPlugins.alert = alertActions.installPublic(api.awsuiPlugins.alert);\n api.awsuiPluginsInternal.alert = alertActions.installInternal(api.awsuiPluginsInternal.alert);\n\n const alertContent = new AlertFlashContentController();\n api.awsuiPlugins.alertContent = alertContent.installPublic(api.awsuiPlugins.alertContent);\n api.awsuiPluginsInternal.alertContent = alertContent.installInternal(api.awsuiPluginsInternal.alertContent);\n\n const flashContent = new AlertFlashContentController();\n api.awsuiPlugins.flashContent = flashContent.installPublic(api.awsuiPlugins.flashContent);\n api.awsuiPluginsInternal.flashContent = flashContent.installInternal(api.awsuiPluginsInternal.flashContent);\n\n const flashbarActions = new ActionButtonsController();\n api.awsuiPlugins.flashbar = flashbarActions.installPublic(api.awsuiPlugins.flashbar);\n api.awsuiPluginsInternal.flashbar = flashbarActions.installInternal(api.awsuiPluginsInternal.flashbar);\n\n const breadcrumbs = new BreadcrumbsController<BreadcrumbGroupProps>();\n api.awsuiPluginsInternal.breadcrumbs = breadcrumbs.installInternal(api.awsuiPluginsInternal.breadcrumbs);\n\n const sharedReactContexts = new SharedReactContexts();\n api.awsuiPluginsInternal.sharedReactContexts = sharedReactContexts.installInternal(\n api.awsuiPluginsInternal.sharedReactContexts\n );\n\n return api as AwsuiApi;\n}\n"]}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../src/internal/plugins/api.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAwC,MAAM,8BAA8B,CAAC;AAC7G,OAAO,EAGL,2BAA2B,GAC5B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAA8B,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAA0B,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EAAwC,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAkC,MAAM,qCAAqC,CAAC;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AA0BlD,SAAS,SAAS,CAAC,aAA4B;IAC7C,IAAI,CAAC;QACH,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,UAAU,CAAC,EAAE,CAAC;YAChC,OAAO,aAAa,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,MAAM,KAAK,aAAa,EAAE,CAAC;YAC7D,4DAA4D;YAC5D,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,SAAS,CAAC,aAAa,CAAC,MAAuB,CAAC,CAAC;IA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AC,eAAe,CAAC,GAAG,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAEzG,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACtD,GAAG,CAAC,oBAAoB,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,eAAe,CAChF,GAAG,CAAC,oBAAoB,CAAC,mBAAmB,CAC7C,CAAC;IAEF,OAAO,GAAe,CAAC;AACzB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';\nimport { ActionButtonsController, ActionsApiInternal, ActionsApiPublic } from './controllers/action-buttons';\nimport {\n AlertFlashContentApiInternal,\n AlertFlashContentApiPublic,\n AlertFlashContentController,\n} from './controllers/alert-flash-content';\nimport { AppLayoutWidgetApiInternal, AppLayoutWidgetController } from './controllers/app-layout-widget';\nimport { BreadcrumbsApiInternal, BreadcrumbsController } from './controllers/breadcrumbs';\nimport { DrawersApiInternal, DrawersApiPublic, DrawersController } from './controllers/drawers';\nimport { SharedReactContexts, SharedReactContextsApiInternal } from './controllers/shared-react-contexts';\nimport { reportRuntimeApiLoadMetric } from './helpers/metrics';\n\nconst storageKey = Symbol.for('awsui-plugin-api');\n\ninterface AwsuiApi {\n awsuiPlugins: {\n appLayout: DrawersApiPublic;\n alert: ActionsApiPublic;\n alertContent: AlertFlashContentApiPublic;\n flashbar: ActionsApiPublic;\n flashContent: AlertFlashContentApiPublic;\n };\n awsuiPluginsInternal: {\n appLayout: DrawersApiInternal;\n appLayoutWidget: AppLayoutWidgetApiInternal;\n alert: ActionsApiInternal;\n alertContent: AlertFlashContentApiInternal;\n flashbar: ActionsApiInternal;\n flashContent: AlertFlashContentApiInternal;\n breadcrumbs: BreadcrumbsApiInternal<BreadcrumbGroupProps>;\n sharedReactContexts: SharedReactContextsApiInternal;\n };\n}\n\ninterface WindowWithApi extends Window {\n [storageKey]: AwsuiApi;\n}\n\nfunction findUpApi(currentWindow: WindowWithApi): AwsuiApi | undefined {\n try {\n if (currentWindow?.[storageKey]) {\n return currentWindow[storageKey];\n }\n\n if (!currentWindow || currentWindow.parent === currentWindow) {\n // When the window has no more parents, it references itself\n return undefined;\n }\n\n return findUpApi(currentWindow.parent as WindowWithApi);\n } catch {\n // Most likely a cross-origin access error\n return undefined;\n }\n}\n\nexport function loadApi() {\n if (typeof window === 'undefined') {\n return installApi({});\n }\n const win = window as unknown as WindowWithApi;\n const existingApi = findUpApi(win);\n if (!existingApi) {\n reportRuntimeApiLoadMetric();\n }\n win[storageKey] = installApi(existingApi ?? {});\n return win[storageKey];\n}\n\nexport const { awsuiPlugins, awsuiPluginsInternal } = loadApi();\n\ntype DeepPartial<T> = T extends (...args: any) => any ? T : { [P in keyof T]?: DeepPartial<T[P]> };\n\nfunction installApi(api: DeepPartial<AwsuiApi>): AwsuiApi {\n api.awsuiPlugins ??= {};\n api.awsuiPluginsInternal ??= {};\n\n const appLayoutDrawers = new DrawersController();\n api.awsuiPlugins.appLayout = appLayoutDrawers.installPublic(api.awsuiPlugins.appLayout);\n api.awsuiPluginsInternal.appLayout = appLayoutDrawers.installInternal(api.awsuiPluginsInternal.appLayout);\n\n const appLayoutController = new AppLayoutWidgetController();\n api.awsuiPluginsInternal.appLayoutWidget = appLayoutController.installInternal(\n api.awsuiPluginsInternal.appLayoutWidget\n );\n\n const alertActions = new ActionButtonsController();\n api.awsuiPlugins.alert = alertActions.installPublic(api.awsuiPlugins.alert);\n api.awsuiPluginsInternal.alert = alertActions.installInternal(api.awsuiPluginsInternal.alert);\n\n const alertContent = new AlertFlashContentController();\n api.awsuiPlugins.alertContent = alertContent.installPublic(api.awsuiPlugins.alertContent);\n api.awsuiPluginsInternal.alertContent = alertContent.installInternal(api.awsuiPluginsInternal.alertContent);\n\n const flashContent = new AlertFlashContentController();\n api.awsuiPlugins.flashContent = flashContent.installPublic(api.awsuiPlugins.flashContent);\n api.awsuiPluginsInternal.flashContent = flashContent.installInternal(api.awsuiPluginsInternal.flashContent);\n\n const flashbarActions = new ActionButtonsController();\n api.awsuiPlugins.flashbar = flashbarActions.installPublic(api.awsuiPlugins.flashbar);\n api.awsuiPluginsInternal.flashbar = flashbarActions.installInternal(api.awsuiPluginsInternal.flashbar);\n\n const breadcrumbs = new BreadcrumbsController<BreadcrumbGroupProps>();\n api.awsuiPluginsInternal.breadcrumbs = breadcrumbs.installInternal(api.awsuiPluginsInternal.breadcrumbs);\n\n const sharedReactContexts = new SharedReactContexts();\n api.awsuiPluginsInternal.sharedReactContexts = sharedReactContexts.installInternal(\n api.awsuiPluginsInternal.sharedReactContexts\n );\n\n return api as AwsuiApi;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"check-safe-url.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/check-safe-url.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CA2BpF"}
1
+ {"version":3,"file":"check-safe-url.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/check-safe-url.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAwBpF"}
@@ -12,10 +12,8 @@ export function checkSafeUrl(component, url) {
12
12
  let parsedUrl;
13
13
  try {
14
14
  parsedUrl = new URL(url);
15
- // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore
16
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
15
  }
18
- catch (e) {
16
+ catch {
19
17
  // If the URL cannot be parsed by the browser, it likely does not pose a security risk.
20
18
  return;
21
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"check-safe-url.js","sourceRoot":"","sources":["../../../../src/internal/utils/check-safe-url.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,MAAM,qBAAqB,GAAG,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC;AAE5F,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,GAA8B;IAC5E,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO;IACT,CAAC;IACD,IAAI,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,IAAI,SAAc,CAAC;IACnB,IAAI,CAAC;QACH,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAEzB,6GAA6G;QAC7G,6DAA6D;IAC/D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,uFAAuF;QACvF,OAAO;IACT,CAAC;IAED,IAAI,SAAS,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QACzC,QAAQ,CAAC,SAAS,EAAE,wEAAwE,GAAG,IAAI,CAAC,CAAC;QACrG,sDAAsD;QACtD,mIAAmI;QACnI,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO;AACT,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nconst allowedJavascriptUrls = ['javascript:void(0)', 'javascript:void(0);', 'javascript:;'];\n\nexport function checkSafeUrl(component: string, url: string | undefined | null): void {\n if (!url) {\n return;\n }\n if (allowedJavascriptUrls.indexOf(url.toLowerCase()) !== -1) {\n return;\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n\n // Consumers in the past have not always been able to support not specifiying the value so we keep and ignore\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (e) {\n // If the URL cannot be parsed by the browser, it likely does not pose a security risk.\n return;\n }\n\n if (parsedUrl.protocol === 'javascript:') {\n warnOnce(component, `A javascript: URL was blocked as a security precaution. The URL was \"${url}\".`);\n // This mirrors the error message that React will use:\n // https://github.com/facebook/react/blob/a724a3b578dce77d427bef313102a4d0e978d9b4/packages/react-dom/src/shared/sanitizeURL.js#L30\n throw new Error(`A javascript: URL was blocked as a security precaution.`);\n }\n\n return;\n}\n"]}
1
+ {"version":3,"file":"check-safe-url.js","sourceRoot":"","sources":["../../../../src/internal/utils/check-safe-url.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,MAAM,qBAAqB,GAAG,CAAC,oBAAoB,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC;AAE5F,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,GAA8B;IAC5E,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO;IACT,CAAC;IACD,IAAI,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,IAAI,SAAc,CAAC;IACnB,IAAI,CAAC;QACH,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,uFAAuF;QACvF,OAAO;IACT,CAAC;IAED,IAAI,SAAS,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QACzC,QAAQ,CAAC,SAAS,EAAE,wEAAwE,GAAG,IAAI,CAAC,CAAC;QACrG,sDAAsD;QACtD,mIAAmI;QACnI,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO;AACT,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nconst allowedJavascriptUrls = ['javascript:void(0)', 'javascript:void(0);', 'javascript:;'];\n\nexport function checkSafeUrl(component: string, url: string | undefined | null): void {\n if (!url) {\n return;\n }\n if (allowedJavascriptUrls.indexOf(url.toLowerCase()) !== -1) {\n return;\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch {\n // If the URL cannot be parsed by the browser, it likely does not pose a security risk.\n return;\n }\n\n if (parsedUrl.protocol === 'javascript:') {\n warnOnce(component, `A javascript: URL was blocked as a security precaution. The URL was \"${url}\".`);\n // This mirrors the error message that React will use:\n // https://github.com/facebook/react/blob/a724a3b578dce77d427bef313102a4d0e978d9b4/packages/react-dom/src/shared/sanitizeURL.js#L30\n throw new Error(`A javascript: URL was blocked as a security precaution.`);\n }\n\n return;\n}\n"]}
@@ -88,17 +88,9 @@ function getAllX(series) {
88
88
  break;
89
89
  }
90
90
  }
91
- const allDataX = [];
92
- addDataXSet.forEach(x => allDataX.push(x));
93
- return allDataX;
91
+ return Array.from(addDataXSet);
94
92
  }
95
93
  function flatten(arrays) {
96
- const merged = [];
97
- for (const array of arrays) {
98
- for (const item of array) {
99
- merged.push(item);
100
- }
101
- }
102
- return merged;
94
+ return arrays.flat();
103
95
  }
104
96
  //# sourceMappingURL=make-scaled-series.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"make-scaled-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/make-scaled-series.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUrD,yFAAyF;AACzF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,SAAgD,EAChD,MAAkB,EAClB,MAAyB;IAEzB,MAAM,OAAO,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,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AE,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;QACnC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YACf,qCAAqC;YACrC,KAAK,KAAK,CAAC;YACX,KAAK,MAAM;gBACT,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;oBACvB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;gBACD,MAAM;YAER,KAAK,WAAW;gBACd,sCAAsC;gBACtC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;oBACpB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;gBACD,kCAAkC;gBAClC,MAAM;QACV,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAQ,EAAE,CAAC;IACzB,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,OAAO,CAAI,MAAa;IAC/B,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';\nimport { isXThreshold, isYThreshold } from './utils';\n\nexport interface ScaledPoint<T> {\n x: number;\n y: number;\n color: string;\n datum?: MixedLineBarChartProps.Datum<T> | undefined;\n series: MixedLineBarChartProps.ChartSeries<T>;\n}\n\n/** Combine all line series into an array of scaled data points with the given scales. */\nexport default function makeScaledSeries<T extends ChartDataTypes>(\n allSeries: ReadonlyArray<InternalChartSeries<T>>,\n xScale: ChartScale,\n yScale: NumericChartScale\n): readonly ScaledPoint<T>[] {\n const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n const scaleX = (x: T) => (xScale.d3Scale(x as any) || 0) + xOffset;\n const scaleY = (y: number) => yScale.d3Scale(y) || 0;\n const allX = getAllX(allSeries);\n\n function mergeLineSeriesPointsWithXThresholds(\n scaledPoints: ScaledPoint<T>[],\n xThresholdSeries: MixedLineBarChartProps.ThresholdSeries<T> & { x: T },\n xThresholdSeriesColor: string\n ) {\n const x = scaleX(xThresholdSeries.x);\n\n // Locate a point the x-threshold can be inserted after (if such exists).\n let bisectIndex = -1;\n for (let i = 0; i < scaledPoints.length - 1; i++) {\n if (scaledPoints[i].x < x && x < scaledPoints[i + 1].x) {\n bisectIndex = i;\n break;\n }\n }\n\n // Insert x-threshold point into the given series using extrapolated Y value.\n // The extrapolated value is only used to render highlighted point on the chart plot.\n if (bisectIndex !== -1) {\n const prevY = scaledPoints[bisectIndex].datum?.y || 0;\n const nextY = scaledPoints[bisectIndex + 1].datum?.y || 0;\n const averageY = (prevY + nextY) / 2;\n scaledPoints.push({\n x: x,\n y: scaleY(averageY),\n datum: { x: xThresholdSeries.x, y: NaN },\n series: scaledPoints[bisectIndex].series,\n color: xThresholdSeriesColor,\n });\n }\n }\n\n const scaledSeriesX = allSeries.map(({ series, color }) => {\n const scaledPoints: ScaledPoint<T>[] = [];\n\n // Scale and add all line series data points.\n if (series.type === 'line') {\n for (const datum of series.data as MixedLineBarChartProps.Datum<T>[]) {\n scaledPoints.push({ x: scaleX(datum.x), y: scaleY(datum.y), datum, series, color });\n }\n\n // Sort scaled points to ensure correct x-thresholds insertion.\n scaledPoints.sort((s1, s2) => s1.x - s2.x);\n\n // Merge x-thresholds into series if they don't have a shared coordinate.\n for (const otherSeries of allSeries) {\n if (isXThreshold(otherSeries.series)) {\n mergeLineSeriesPointsWithXThresholds(scaledPoints, otherSeries.series, otherSeries.color);\n }\n }\n }\n // Y-thresholds only have Y. To make thresholds navigable they are mapped to all defined X values.\n else if (isYThreshold(series)) {\n for (const x of allX) {\n scaledPoints.push({ x: scaleX(x), y: scaleY(series.y), datum: { x, y: series.y }, series, color });\n }\n // Support threshold-only setup.\n if (allX.length === 0) {\n scaledPoints.push({ x: NaN, y: scaleY(series.y), series, color });\n }\n }\n // X-thresholds only have X. The y value is taken as NaN which means there is no associated point - only vertical marker.\n else if (isXThreshold(series)) {\n scaledPoints.push({ x: scaleX(series.x), y: NaN, datum: { x: series.x, y: NaN }, series, color });\n }\n // Bar series are handled separately.\n return scaledPoints;\n });\n\n // Sort scaled points by x to ensure their order matches visual order in the chart to support navigation.\n return flatten(scaledSeriesX).sort((s1, s2) => s1.x - s2.x);\n}\n\n/** Collect unique x values from all data series. */\nfunction getAllX<T>(series: ReadonlyArray<InternalChartSeries<T>>) {\n const addDataXSet = new Set<T>();\n for (const { series: s } of series) {\n switch (s.type) {\n // Add all X values from data series.\n case 'bar':\n case 'line':\n for (const d of s.data) {\n addDataXSet.add(d.x);\n }\n break;\n\n case 'threshold':\n // X-thresholds have a single X value.\n if (isXThreshold(s)) {\n addDataXSet.add(s.x);\n }\n // Thresholds don't have X values.\n break;\n }\n }\n const allDataX: T[] = [];\n addDataXSet.forEach(x => allDataX.push(x));\n\n return allDataX;\n}\n\nfunction flatten<T>(arrays: T[][]): T[] {\n const merged: T[] = [];\n for (const array of arrays) {\n for (const item of array) {\n merged.push(item);\n }\n }\n return merged;\n}\n"]}
1
+ {"version":3,"file":"make-scaled-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/make-scaled-series.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUrD,yFAAyF;AACz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E,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,oDAAoD;AACpD,SAAS,OAAO,CAAI,MAA6C;IAC/D,MAAM,WAAW,GAAG,IAAI,GAAG,EAAK,CAAC;IACjC,KAAK,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,MAAM,EAAE,CAAC;QACnC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YACf,qCAAqC;YACrC,KAAK,KAAK,CAAC;YACX,KAAK,MAAM;gBACT,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;oBACvB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;gBACD,MAAM;YAER,KAAK,WAAW;gBACd,sCAAsC;gBACtC,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;oBACpB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACvB,CAAC;gBACD,kCAAkC;gBAClC,MAAM;QACV,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,OAAO,CAAI,MAAa;IAC/B,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';\nimport { isXThreshold, isYThreshold } from './utils';\n\nexport interface ScaledPoint<T> {\n x: number;\n y: number;\n color: string;\n datum?: MixedLineBarChartProps.Datum<T> | undefined;\n series: MixedLineBarChartProps.ChartSeries<T>;\n}\n\n/** Combine all line series into an array of scaled data points with the given scales. */\nexport default function makeScaledSeries<T extends ChartDataTypes>(\n allSeries: ReadonlyArray<InternalChartSeries<T>>,\n xScale: ChartScale,\n yScale: NumericChartScale\n): readonly ScaledPoint<T>[] {\n const xOffset = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n const scaleX = (x: T) => (xScale.d3Scale(x as any) || 0) + xOffset;\n const scaleY = (y: number) => yScale.d3Scale(y) || 0;\n const allX = getAllX(allSeries);\n\n function mergeLineSeriesPointsWithXThresholds(\n scaledPoints: ScaledPoint<T>[],\n xThresholdSeries: MixedLineBarChartProps.ThresholdSeries<T> & { x: T },\n xThresholdSeriesColor: string\n ) {\n const x = scaleX(xThresholdSeries.x);\n\n // Locate a point the x-threshold can be inserted after (if such exists).\n let bisectIndex = -1;\n for (let i = 0; i < scaledPoints.length - 1; i++) {\n if (scaledPoints[i].x < x && x < scaledPoints[i + 1].x) {\n bisectIndex = i;\n break;\n }\n }\n\n // Insert x-threshold point into the given series using extrapolated Y value.\n // The extrapolated value is only used to render highlighted point on the chart plot.\n if (bisectIndex !== -1) {\n const prevY = scaledPoints[bisectIndex].datum?.y || 0;\n const nextY = scaledPoints[bisectIndex + 1].datum?.y || 0;\n const averageY = (prevY + nextY) / 2;\n scaledPoints.push({\n x: x,\n y: scaleY(averageY),\n datum: { x: xThresholdSeries.x, y: NaN },\n series: scaledPoints[bisectIndex].series,\n color: xThresholdSeriesColor,\n });\n }\n }\n\n const scaledSeriesX = allSeries.map(({ series, color }) => {\n const scaledPoints: ScaledPoint<T>[] = [];\n\n // Scale and add all line series data points.\n if (series.type === 'line') {\n for (const datum of series.data as MixedLineBarChartProps.Datum<T>[]) {\n scaledPoints.push({ x: scaleX(datum.x), y: scaleY(datum.y), datum, series, color });\n }\n\n // Sort scaled points to ensure correct x-thresholds insertion.\n scaledPoints.sort((s1, s2) => s1.x - s2.x);\n\n // Merge x-thresholds into series if they don't have a shared coordinate.\n for (const otherSeries of allSeries) {\n if (isXThreshold(otherSeries.series)) {\n mergeLineSeriesPointsWithXThresholds(scaledPoints, otherSeries.series, otherSeries.color);\n }\n }\n }\n // Y-thresholds only have Y. To make thresholds navigable they are mapped to all defined X values.\n else if (isYThreshold(series)) {\n for (const x of allX) {\n scaledPoints.push({ x: scaleX(x), y: scaleY(series.y), datum: { x, y: series.y }, series, color });\n }\n // Support threshold-only setup.\n if (allX.length === 0) {\n scaledPoints.push({ x: NaN, y: scaleY(series.y), series, color });\n }\n }\n // X-thresholds only have X. The y value is taken as NaN which means there is no associated point - only vertical marker.\n else if (isXThreshold(series)) {\n scaledPoints.push({ x: scaleX(series.x), y: NaN, datum: { x: series.x, y: NaN }, series, color });\n }\n // Bar series are handled separately.\n return scaledPoints;\n });\n\n // Sort scaled points by x to ensure their order matches visual order in the chart to support navigation.\n return flatten(scaledSeriesX).sort((s1, s2) => s1.x - s2.x);\n}\n\n/** Collect unique x values from all data series. */\nfunction getAllX<T>(series: ReadonlyArray<InternalChartSeries<T>>) {\n const addDataXSet = new Set<T>();\n for (const { series: s } of series) {\n switch (s.type) {\n // Add all X values from data series.\n case 'bar':\n case 'line':\n for (const d of s.data) {\n addDataXSet.add(d.x);\n }\n break;\n\n case 'threshold':\n // X-thresholds have a single X value.\n if (isXThreshold(s)) {\n addDataXSet.add(s.x);\n }\n // Thresholds don't have X values.\n break;\n }\n }\n return Array.from(addDataXSet);\n}\n\nfunction flatten<T>(arrays: T[][]): T[] {\n return arrays.flat();\n}\n"]}
@@ -39,7 +39,7 @@ export interface StatusIndicatorProps extends BaseComponentProps {
39
39
  nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;
40
40
  }
41
41
  export declare namespace StatusIndicatorProps {
42
- type Type = 'error' | 'warning' | 'success' | 'info' | 'stopped' | 'pending' | 'in-progress' | 'loading';
42
+ type Type = 'error' | 'warning' | 'success' | 'info' | 'stopped' | 'pending' | 'in-progress' | 'loading' | 'not-started';
43
43
  type Color = 'blue' | 'grey' | 'green' | 'red' | 'yellow';
44
44
  }
45
45
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/status-indicator/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;CACxE;AAED,yBAAiB,oBAAoB,CAAC;IAGpC,KAAY,IAAI,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;IAChH,KAAY,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;CAClE"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/status-indicator/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,CAAC,IAAI,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC,KAAK,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;CACxE;AAED,yBAAiB,oBAAoB,CAAC;IAGpC,KAAY,IAAI,GACZ,OAAO,GACP,SAAS,GACT,SAAS,GACT,MAAM,GACN,SAAS,GACT,SAAS,GACT,aAAa,GACb,SAAS,GACT,aAAa,CAAC;IAClB,KAAY,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;CAClE"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/status-indicator/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface StatusIndicatorProps extends BaseComponentProps {\n /**\n * Specifies the status type.\n */\n type?: StatusIndicatorProps.Type;\n /**\n * A text fragment that communicates the status.\n */\n children?: React.ReactNode;\n /**\n * Specifies an `aria-label` for the icon. If the status text alone does not fully describe the status,\n * use this to communicate additional context.\n */\n iconAriaLabel?: string;\n /**\n * Specifies an override for the status indicator color.\n */\n colorOverride?: StatusIndicatorProps.Color;\n /**\n * Specifies if the text content should wrap. If you set it to false, it prevents the text from wrapping\n * and truncates it with an ellipsis.\n */\n wrapText?: boolean;\n /**\n * Attributes to add to the native element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace StatusIndicatorProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Type = 'error' | 'warning' | 'success' | 'info' | 'stopped' | 'pending' | 'in-progress' | 'loading';\n export type Color = 'blue' | 'grey' | 'green' | 'red' | 'yellow';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/status-indicator/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface StatusIndicatorProps extends BaseComponentProps {\n /**\n * Specifies the status type.\n */\n type?: StatusIndicatorProps.Type;\n /**\n * A text fragment that communicates the status.\n */\n children?: React.ReactNode;\n /**\n * Specifies an `aria-label` for the icon. If the status text alone does not fully describe the status,\n * use this to communicate additional context.\n */\n iconAriaLabel?: string;\n /**\n * Specifies an override for the status indicator color.\n */\n colorOverride?: StatusIndicatorProps.Color;\n /**\n * Specifies if the text content should wrap. If you set it to false, it prevents the text from wrapping\n * and truncates it with an ellipsis.\n */\n wrapText?: boolean;\n /**\n * Attributes to add to the native element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace StatusIndicatorProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Type =\n | 'error'\n | 'warning'\n | 'success'\n | 'info'\n | 'stopped'\n | 'pending'\n | 'in-progress'\n | 'loading'\n | 'not-started';\n export type Color = 'blue' | 'grey' | 'green' | 'red' | 'yellow';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/status-indicator/internal.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,WAAW,4BACf,SAAQ,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,EAChD,0BAA0B;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC;CACvC;AAaD,UAAU,uBAAwB,SAAQ,IAAI,CAAC,4BAA4B,EAAE,MAAM,GAAG,eAAe,CAAC;IACpG,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,CAAC;CACrD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,EACb,OAAO,EACP,OAAO,EACP,IAAe,GAChB,EAAE,uBAAuB,eAWzB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,QAAe,EACf,gBAAgB,EAChB,SAAiB,EACjB,iBAAiB,EACjB,MAAiB,EACjB,SAA0B,EAC1B,GAAG,IAAI,EACR,EAAE,4BAA4B,eAqC9B"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/status-indicator/internal.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIpD,MAAM,WAAW,4BACf,SAAQ,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,EAChD,0BAA0B;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC;CACvC;AAcD,UAAU,uBAAwB,SAAQ,IAAI,CAAC,4BAA4B,EAAE,MAAM,GAAG,eAAe,CAAC;IACpG,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,CAAC;IACpD,IAAI,CAAC,EAAE,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,4BAA4B,CAAC,WAAW,CAAC,CAAC;CACrD;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,EACb,OAAO,EACP,OAAO,EACP,IAAe,GAChB,EAAE,uBAAuB,eAWzB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,QAAe,EACf,gBAAgB,EAChB,SAAiB,EACjB,iBAAiB,EACjB,MAAiB,EACjB,SAA0B,EAC1B,GAAG,IAAI,EACR,EAAE,4BAA4B,eAqC9B"}
@@ -19,6 +19,7 @@ const typeToIcon = size => ({
19
19
  pending: React.createElement(InternalIcon, { name: "status-pending", size: size }),
20
20
  'in-progress': React.createElement(InternalIcon, { name: "status-in-progress", size: size }),
21
21
  loading: React.createElement(InternalSpinner, null),
22
+ 'not-started': React.createElement(InternalIcon, { name: "status-not-started", size: size }),
22
23
  });
23
24
  export function InternalStatusIcon({ type, iconAriaLabel, animate, display, size = 'normal', }) {
24
25
  return (React.createElement("span", { className: clsx(styles.icon, animate && styles['icon-shake']), "aria-label": iconAriaLabel, role: iconAriaLabel ? 'img' : undefined },
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/status-indicator/internal.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,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D;;GAEG;AACH,OAAO,oBAAoB,MAAM,0CAA0C,CAAC;AAC5E,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAGlD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,MAAM,UAAU,GAA6E,IAAI,CAAC,EAAE,CAAC,CAAC;IACpG,KAAK,EAAE,oBAAC,YAAY,IAAC,IAAI,EAAC,iBAAiB,EAAC,IAAI,EAAE,IAAI,GAAI;IAC1D,OAAO,EAAE,oBAAC,YAAY,IAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAE,IAAI,GAAI;IAC3D,OAAO,EAAE,oBAAC,YAAY,IAAC,IAAI,EAAC,iBAAiB,EAAC,IAAI,EAAE,IAAI,GAAI;IAC5D,IAAI,EAAE,oBAAC,YAAY,IAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAE,IAAI,GAAI;IACrD,OAAO,EAAE,oBAAC,YAAY,IAAC,IAAI,EAAC,gBAAgB,EAAC,IAAI,EAAE,IAAI,GAAI;IAC3D,OAAO,EAAE,oBAAC,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SAAS,CACpB,EACD,GAAG,EAAE,iBAAiB;QAEtB,8BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,WAAW,SAAS,EAAE,CAAC,EAC9B,QAAQ,KAAK,KAAK,IAAI,MAAM,CAAC,mBAAmB,CAAC,EACjD,SAAS,IAAI,MAAM,CAAC,mBAAmB,CAAC,CACzC;YAED,oBAAC,kBAAkB,IACjB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,SAAS,EAClB,IAAI,EAAE,MAAM,GACZ;YACD,QAAQ,CACJ,CACc,CACxB,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 { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n/**\n * @awsuiSystem core\n */\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport InternalSpinner from '../spinner/internal';\nimport { StatusIndicatorProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalStatusIndicatorProps\n extends SomeRequired<StatusIndicatorProps, 'type'>,\n InternalBaseComponentProps {\n /**\n * Play an animation on the error icon when first rendered\n */\n __animate?: boolean;\n\n /**\n * Size of icon.\n */\n __size?: IconProps.Size;\n\n /**\n * The CSS behavior of the status indicator container element.\n */\n __display?: 'inline' | 'inline-block';\n}\n\nconst typeToIcon: (size: IconProps.Size) => Record<StatusIndicatorProps.Type, JSX.Element> = size => ({\n error: <InternalIcon name=\"status-negative\" size={size} />,\n warning: <InternalIcon name=\"status-warning\" size={size} />,\n success: <InternalIcon name=\"status-positive\" size={size} />,\n info: <InternalIcon name=\"status-info\" size={size} />,\n stopped: <InternalIcon name=\"status-stopped\" size={size} />,\n pending: <InternalIcon name=\"status-pending\" size={size} />,\n 'in-progress': <InternalIcon name=\"status-in-progress\" size={size} />,\n loading: <InternalSpinner />,\n});\n\ninterface InternalStatusIconProps extends Pick<InternalStatusIndicatorProps, 'type' | 'iconAriaLabel'> {\n animate?: InternalStatusIndicatorProps['__animate'];\n size?: InternalStatusIndicatorProps['__size'];\n display?: InternalStatusIndicatorProps['__display'];\n}\n\nexport function InternalStatusIcon({\n type,\n iconAriaLabel,\n animate,\n display,\n size = 'normal',\n}: InternalStatusIconProps) {\n return (\n <span\n className={clsx(styles.icon, animate && styles['icon-shake'])}\n aria-label={iconAriaLabel}\n role={iconAriaLabel ? 'img' : undefined}\n >\n {typeToIcon(size)[type]}\n {display === 'inline' && <>&nbsp;</>}\n </span>\n );\n}\n\nexport default function StatusIndicator({\n type,\n children,\n iconAriaLabel,\n colorOverride,\n wrapText = true,\n nativeAttributes,\n __animate = false,\n __internalRootRef,\n __size = 'normal',\n __display = 'inline-block',\n ...rest\n}: InternalStatusIndicatorProps) {\n const baseProps = getBaseProps(rest);\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"span\"\n componentName=\"StatusIndicator\"\n nativeAttributes={nativeAttributes}\n className={clsx(\n styles.root,\n styles[`status-${type}`],\n {\n [styles[`color-override-${colorOverride}`]]: colorOverride,\n },\n baseProps.className\n )}\n ref={__internalRootRef}\n >\n <span\n className={clsx(\n styles.container,\n styles[`display-${__display}`],\n wrapText === false && styles['overflow-ellipsis'],\n __animate && styles['container-fade-in']\n )}\n >\n <InternalStatusIcon\n type={type}\n iconAriaLabel={iconAriaLabel}\n animate={__animate}\n display={__display}\n size={__size}\n />\n {children}\n </span>\n </WithNativeAttributes>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/status-indicator/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAA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AAS,EAClB,IAAI,EAAE,MAAM,GACZ;YACD,QAAQ,CACJ,CACc,CACxB,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 { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n/**\n * @awsuiSystem core\n */\nimport WithNativeAttributes from '../internal/utils/with-native-attributes';\nimport InternalSpinner from '../spinner/internal';\nimport { StatusIndicatorProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport interface InternalStatusIndicatorProps\n extends SomeRequired<StatusIndicatorProps, 'type'>,\n InternalBaseComponentProps {\n /**\n * Play an animation on the error icon when first rendered\n */\n __animate?: boolean;\n\n /**\n * Size of icon.\n */\n __size?: IconProps.Size;\n\n /**\n * The CSS behavior of the status indicator container element.\n */\n __display?: 'inline' | 'inline-block';\n}\n\nconst typeToIcon: (size: IconProps.Size) => Record<StatusIndicatorProps.Type, JSX.Element> = size => ({\n error: <InternalIcon name=\"status-negative\" size={size} />,\n warning: <InternalIcon name=\"status-warning\" size={size} />,\n success: <InternalIcon name=\"status-positive\" size={size} />,\n info: <InternalIcon name=\"status-info\" size={size} />,\n stopped: <InternalIcon name=\"status-stopped\" size={size} />,\n pending: <InternalIcon name=\"status-pending\" size={size} />,\n 'in-progress': <InternalIcon name=\"status-in-progress\" size={size} />,\n loading: <InternalSpinner />,\n 'not-started': <InternalIcon name=\"status-not-started\" size={size} />,\n});\n\ninterface InternalStatusIconProps extends Pick<InternalStatusIndicatorProps, 'type' | 'iconAriaLabel'> {\n animate?: InternalStatusIndicatorProps['__animate'];\n size?: InternalStatusIndicatorProps['__size'];\n display?: InternalStatusIndicatorProps['__display'];\n}\n\nexport function InternalStatusIcon({\n type,\n iconAriaLabel,\n animate,\n display,\n size = 'normal',\n}: InternalStatusIconProps) {\n return (\n <span\n className={clsx(styles.icon, animate && styles['icon-shake'])}\n aria-label={iconAriaLabel}\n role={iconAriaLabel ? 'img' : undefined}\n >\n {typeToIcon(size)[type]}\n {display === 'inline' && <>&nbsp;</>}\n </span>\n );\n}\n\nexport default function StatusIndicator({\n type,\n children,\n iconAriaLabel,\n colorOverride,\n wrapText = true,\n nativeAttributes,\n __animate = false,\n __internalRootRef,\n __size = 'normal',\n __display = 'inline-block',\n ...rest\n}: InternalStatusIndicatorProps) {\n const baseProps = getBaseProps(rest);\n return (\n <WithNativeAttributes\n {...baseProps}\n tag=\"span\"\n componentName=\"StatusIndicator\"\n nativeAttributes={nativeAttributes}\n className={clsx(\n styles.root,\n styles[`status-${type}`],\n {\n [styles[`color-override-${colorOverride}`]]: colorOverride,\n },\n baseProps.className\n )}\n ref={__internalRootRef}\n >\n <span\n className={clsx(\n styles.container,\n styles[`display-${__display}`],\n wrapText === false && styles['overflow-ellipsis'],\n __animate && styles['container-fade-in']\n )}\n >\n <InternalStatusIcon\n type={type}\n iconAriaLabel={iconAriaLabel}\n animate={__animate}\n display={__display}\n size={__size}\n />\n {children}\n </span>\n </WithNativeAttributes>\n );\n}\n"]}
@@ -1,28 +1,29 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "icon-shake": "awsui_icon-shake_1cbgc_w2bnm_153",
5
- "awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_1cbgc_w2bnm_1",
6
- "container-fade-in": "awsui_container-fade-in_1cbgc_w2bnm_181",
7
- "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1cbgc_w2bnm_1",
8
- "root": "awsui_root_1cbgc_w2bnm_203",
9
- "status-error": "awsui_status-error_1cbgc_w2bnm_212",
10
- "status-warning": "awsui_status-warning_1cbgc_w2bnm_215",
11
- "status-success": "awsui_status-success_1cbgc_w2bnm_218",
12
- "status-info": "awsui_status-info_1cbgc_w2bnm_221",
13
- "status-stopped": "awsui_status-stopped_1cbgc_w2bnm_224",
14
- "status-pending": "awsui_status-pending_1cbgc_w2bnm_227",
15
- "status-in-progress": "awsui_status-in-progress_1cbgc_w2bnm_230",
16
- "status-loading": "awsui_status-loading_1cbgc_w2bnm_233",
17
- "color-override-red": "awsui_color-override-red_1cbgc_w2bnm_236",
18
- "color-override-grey": "awsui_color-override-grey_1cbgc_w2bnm_239",
19
- "color-override-blue": "awsui_color-override-blue_1cbgc_w2bnm_242",
20
- "color-override-green": "awsui_color-override-green_1cbgc_w2bnm_245",
21
- "color-override-yellow": "awsui_color-override-yellow_1cbgc_w2bnm_248",
22
- "container": "awsui_container_1cbgc_w2bnm_181",
23
- "display-inline": "awsui_display-inline_1cbgc_w2bnm_252",
24
- "icon": "awsui_icon_1cbgc_w2bnm_153",
25
- "display-inline-block": "awsui_display-inline-block_1cbgc_w2bnm_260",
26
- "overflow-ellipsis": "awsui_overflow-ellipsis_1cbgc_w2bnm_269"
4
+ "icon-shake": "awsui_icon-shake_1cbgc_zrca7_153",
5
+ "awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1",
6
+ "container-fade-in": "awsui_container-fade-in_1cbgc_zrca7_181",
7
+ "awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1",
8
+ "root": "awsui_root_1cbgc_zrca7_203",
9
+ "status-error": "awsui_status-error_1cbgc_zrca7_212",
10
+ "status-warning": "awsui_status-warning_1cbgc_zrca7_215",
11
+ "status-success": "awsui_status-success_1cbgc_zrca7_218",
12
+ "status-info": "awsui_status-info_1cbgc_zrca7_221",
13
+ "status-stopped": "awsui_status-stopped_1cbgc_zrca7_224",
14
+ "status-pending": "awsui_status-pending_1cbgc_zrca7_227",
15
+ "status-in-progress": "awsui_status-in-progress_1cbgc_zrca7_230",
16
+ "status-loading": "awsui_status-loading_1cbgc_zrca7_233",
17
+ "status-not-started": "awsui_status-not-started_1cbgc_zrca7_236",
18
+ "color-override-red": "awsui_color-override-red_1cbgc_zrca7_239",
19
+ "color-override-grey": "awsui_color-override-grey_1cbgc_zrca7_242",
20
+ "color-override-blue": "awsui_color-override-blue_1cbgc_zrca7_245",
21
+ "color-override-green": "awsui_color-override-green_1cbgc_zrca7_248",
22
+ "color-override-yellow": "awsui_color-override-yellow_1cbgc_zrca7_251",
23
+ "container": "awsui_container_1cbgc_zrca7_181",
24
+ "display-inline": "awsui_display-inline_1cbgc_zrca7_255",
25
+ "icon": "awsui_icon_1cbgc_zrca7_153",
26
+ "display-inline-block": "awsui_display-inline-block_1cbgc_zrca7_263",
27
+ "overflow-ellipsis": "awsui_overflow-ellipsis_1cbgc_zrca7_272"
27
28
  };
28
29