@cloudscape-design/components 3.0.1296 → 3.0.1298

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 (58) hide show
  1. package/flashbar/collapsible-flashbar.d.ts.map +1 -1
  2. package/flashbar/collapsible-flashbar.js +6 -1
  3. package/flashbar/collapsible-flashbar.js.map +1 -1
  4. package/flashbar/flash.d.ts.map +1 -1
  5. package/flashbar/flash.js +2 -5
  6. package/flashbar/flash.js.map +1 -1
  7. package/index.d.ts +1 -0
  8. package/index.d.ts.map +1 -1
  9. package/index.js +1 -0
  10. package/index.js.map +1 -1
  11. package/internal/base-component/styles.scoped.css +12 -1
  12. package/internal/components/focus-lock/index.d.ts.map +1 -1
  13. package/internal/components/focus-lock/index.js +4 -2
  14. package/internal/components/focus-lock/index.js.map +1 -1
  15. package/internal/environment.js +2 -2
  16. package/internal/environment.json +2 -2
  17. package/internal/generated/styles/tokens.d.ts +3 -0
  18. package/internal/generated/styles/tokens.js +3 -0
  19. package/internal/generated/theming/index.cjs +65 -0
  20. package/internal/generated/theming/index.js +65 -0
  21. package/internal/manifest.json +1 -1
  22. package/live-region/internal.d.ts +5 -0
  23. package/live-region/internal.d.ts.map +1 -1
  24. package/live-region/internal.js +10 -2
  25. package/live-region/internal.js.map +1 -1
  26. package/package.json +2 -1
  27. package/skeleton/index.d.ts +10 -0
  28. package/skeleton/index.d.ts.map +1 -0
  29. package/skeleton/index.js +21 -0
  30. package/skeleton/index.js.map +1 -0
  31. package/skeleton/interfaces.d.ts +36 -0
  32. package/skeleton/interfaces.d.ts.map +1 -0
  33. package/skeleton/interfaces.js +2 -0
  34. package/skeleton/interfaces.js.map +1 -0
  35. package/skeleton/internal.d.ts +14 -0
  36. package/skeleton/internal.d.ts.map +1 -0
  37. package/skeleton/internal.js +13 -0
  38. package/skeleton/internal.js.map +1 -0
  39. package/skeleton/styles.css.js +20 -0
  40. package/skeleton/styles.scoped.css +273 -0
  41. package/skeleton/styles.selectors.js +21 -0
  42. package/test-utils/dom/index.d.ts +28 -0
  43. package/test-utils/dom/index.js +20 -1
  44. package/test-utils/dom/index.js.map +1 -1
  45. package/test-utils/dom/skeleton/index.d.ts +4 -0
  46. package/test-utils/dom/skeleton/index.js +11 -0
  47. package/test-utils/dom/skeleton/index.js.map +1 -0
  48. package/test-utils/selectors/index.d.ts +18 -0
  49. package/test-utils/selectors/index.js +15 -1
  50. package/test-utils/selectors/index.js.map +1 -1
  51. package/test-utils/selectors/skeleton/index.d.ts +4 -0
  52. package/test-utils/selectors/skeleton/index.js +11 -0
  53. package/test-utils/selectors/skeleton/index.js.map +1 -0
  54. package/tutorial-panel/components/tutorial-detail-view/index.d.ts.map +1 -1
  55. package/tutorial-panel/components/tutorial-detail-view/index.js +2 -1
  56. package/tutorial-panel/components/tutorial-detail-view/index.js.map +1 -1
  57. package/tutorial-panel/components/tutorial-list/index.js +11 -12
  58. package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
@@ -588,6 +588,8 @@ export var colorIconActionCardDefault = "var(--color-icon-action-card-default-an
588
588
  export var colorIconActionCardHover = "var(--color-icon-action-card-hover-qxq4pp, #002b66)";
589
589
  export var colorIconActionCardActive = "var(--color-icon-action-card-active-rhp94s, #002b66)";
590
590
  export var colorIconActionCardDisabled = "var(--color-icon-action-card-disabled-wm3kyf, #b4b4bb)";
591
+ export var colorBackgroundSkeleton = "var(--color-background-skeleton-sjxg4n, #ebebf0)";
592
+ export var colorBackgroundSkeletonWave = "var(--color-background-skeleton-wave-1dy97d, #f6f6f9)";
591
593
  export var fontBoxValueLargeWeight = "var(--font-box-value-large-weight-wr00sw, 700)";
592
594
  export var fontButtonLetterSpacing = "var(--font-button-letter-spacing-ufowe3, 0.005em)";
593
595
  export var fontChartDetailSize = "var(--font-chart-detail-size-9qr25q, 12px)";
@@ -714,6 +716,7 @@ export var borderWidthActionCardDefault = "var(--border-width-action-card-defaul
714
716
  export var borderWidthActionCardHover = "var(--border-width-action-card-hover-02l6fg, 1px)";
715
717
  export var borderWidthActionCardActive = "var(--border-width-action-card-active-pwtgzu, 1px)";
716
718
  export var borderWidthActionCardDisabled = "var(--border-width-action-card-disabled-rdvlbc, 1px)";
719
+ export var borderRadiusSkeleton = "var(--border-radius-skeleton-9lkvfi, 8px)";
717
720
  export var motionDurationExtraFast = "var(--motion-duration-extra-fast-l4w48j, 45ms)";
718
721
  export var motionDurationExtraSlow = "var(--motion-duration-extra-slow-29bqym, 270ms)";
719
722
  export var motionDurationFast = "var(--motion-duration-fast-unntf6, 90ms)";
@@ -2399,6 +2399,14 @@ module.exports.preset = {
2399
2399
  "light": "{colorNeutral400}",
2400
2400
  "dark": "{colorNeutral600}"
2401
2401
  },
2402
+ "colorBackgroundSkeleton": {
2403
+ "light": "{colorNeutral250}",
2404
+ "dark": "{colorNeutral750}"
2405
+ },
2406
+ "colorBackgroundSkeletonWave": {
2407
+ "light": "{colorNeutral150}",
2408
+ "dark": "{colorNeutral700}"
2409
+ },
2402
2410
  "fontBoxValueLargeWeight": "700",
2403
2411
  "fontButtonLetterSpacing": "0.005em",
2404
2412
  "fontChartDetailSize": "{fontSizeBodyS}",
@@ -2525,6 +2533,7 @@ module.exports.preset = {
2525
2533
  "borderWidthActionCardHover": "{borderWidthCard}",
2526
2534
  "borderWidthActionCardActive": "{borderWidthCard}",
2527
2535
  "borderWidthActionCardDisabled": "{borderWidthCard}",
2536
+ "borderRadiusSkeleton": "8px",
2528
2537
  "motionDurationExtraFast": {
2529
2538
  "default": "45ms",
2530
2539
  "disabled": "0ms"
@@ -5033,6 +5042,14 @@ module.exports.preset = {
5033
5042
  "light": "{colorNeutral600}",
5034
5043
  "dark": "{colorNeutral600}"
5035
5044
  },
5045
+ "colorBackgroundSkeleton": {
5046
+ "light": "{colorNeutral750}",
5047
+ "dark": "{colorNeutral750}"
5048
+ },
5049
+ "colorBackgroundSkeletonWave": {
5050
+ "light": "{colorNeutral700}",
5051
+ "dark": "{colorNeutral700}"
5052
+ },
5036
5053
  "colorPrimary50": "#f0fbff",
5037
5054
  "colorPrimary100": "#d1f1ff",
5038
5055
  "colorPrimary200": "#b8e7ff",
@@ -6502,6 +6519,14 @@ module.exports.preset = {
6502
6519
  "light": "{colorNeutral600}",
6503
6520
  "dark": "{colorNeutral600}"
6504
6521
  },
6522
+ "colorBackgroundSkeleton": {
6523
+ "light": "{colorNeutral750}",
6524
+ "dark": "{colorNeutral750}"
6525
+ },
6526
+ "colorBackgroundSkeletonWave": {
6527
+ "light": "{colorNeutral700}",
6528
+ "dark": "{colorNeutral700}"
6529
+ },
6505
6530
  "colorPrimary50": "#f0fbff",
6506
6531
  "colorPrimary100": "#d1f1ff",
6507
6532
  "colorPrimary200": "#b8e7ff",
@@ -7898,6 +7923,14 @@ module.exports.preset = {
7898
7923
  "colorIconActionCardDisabled": {
7899
7924
  "light": "{colorNeutral400}",
7900
7925
  "dark": "{colorNeutral600}"
7926
+ },
7927
+ "colorBackgroundSkeleton": {
7928
+ "light": "{colorNeutral250}",
7929
+ "dark": "{colorNeutral750}"
7930
+ },
7931
+ "colorBackgroundSkeletonWave": {
7932
+ "light": "{colorNeutral150}",
7933
+ "dark": "{colorNeutral700}"
7901
7934
  }
7902
7935
  }
7903
7936
  },
@@ -9180,6 +9213,14 @@ module.exports.preset = {
9180
9213
  "colorIconActionCardDisabled": {
9181
9214
  "light": "{colorNeutral400}",
9182
9215
  "dark": "{colorNeutral600}"
9216
+ },
9217
+ "colorBackgroundSkeleton": {
9218
+ "light": "{colorNeutral250}",
9219
+ "dark": "{colorNeutral750}"
9220
+ },
9221
+ "colorBackgroundSkeletonWave": {
9222
+ "light": "{colorNeutral150}",
9223
+ "dark": "{colorNeutral700}"
9183
9224
  }
9184
9225
  }
9185
9226
  },
@@ -10463,6 +10504,14 @@ module.exports.preset = {
10463
10504
  "light": "{colorNeutral400}",
10464
10505
  "dark": "{colorNeutral600}"
10465
10506
  },
10507
+ "colorBackgroundSkeleton": {
10508
+ "light": "{colorNeutral250}",
10509
+ "dark": "{colorNeutral750}"
10510
+ },
10511
+ "colorBackgroundSkeletonWave": {
10512
+ "light": "{colorNeutral150}",
10513
+ "dark": "{colorNeutral700}"
10514
+ },
10466
10515
  "fontExpandableHeadingSize": "14px",
10467
10516
  "borderDividerSectionWidth": "1px"
10468
10517
  }
@@ -11746,6 +11795,14 @@ module.exports.preset = {
11746
11795
  "colorIconActionCardDisabled": {
11747
11796
  "light": "{colorNeutral600}",
11748
11797
  "dark": "{colorNeutral600}"
11798
+ },
11799
+ "colorBackgroundSkeleton": {
11800
+ "light": "{colorNeutral750}",
11801
+ "dark": "{colorNeutral750}"
11802
+ },
11803
+ "colorBackgroundSkeletonWave": {
11804
+ "light": "{colorNeutral700}",
11805
+ "dark": "{colorNeutral700}"
11749
11806
  }
11750
11807
  }
11751
11808
  },
@@ -12351,6 +12408,8 @@ module.exports.preset = {
12351
12408
  "colorIconActionCardHover": "color",
12352
12409
  "colorIconActionCardActive": "color",
12353
12410
  "colorIconActionCardDisabled": "color",
12411
+ "colorBackgroundSkeleton": "color",
12412
+ "colorBackgroundSkeletonWave": "color",
12354
12413
  "motionDurationExtraFast": "motion",
12355
12414
  "motionDurationExtraSlow": "motion",
12356
12415
  "motionDurationFast": "motion",
@@ -14208,6 +14267,8 @@ module.exports.preset = {
14208
14267
  "colorIconActionCardHover": "color-icon-action-card-hover",
14209
14268
  "colorIconActionCardActive": "color-icon-action-card-active",
14210
14269
  "colorIconActionCardDisabled": "color-icon-action-card-disabled",
14270
+ "colorBackgroundSkeleton": "color-background-skeleton",
14271
+ "colorBackgroundSkeletonWave": "color-background-skeleton-wave",
14211
14272
  "fontBoxValueLargeWeight": "font-box-value-large-weight",
14212
14273
  "fontButtonLetterSpacing": "font-button-letter-spacing",
14213
14274
  "fontChartDetailSize": "font-chart-detail-size",
@@ -14334,6 +14395,7 @@ module.exports.preset = {
14334
14395
  "borderWidthActionCardHover": "border-width-action-card-hover",
14335
14396
  "borderWidthActionCardActive": "border-width-action-card-active",
14336
14397
  "borderWidthActionCardDisabled": "border-width-action-card-disabled",
14398
+ "borderRadiusSkeleton": "border-radius-skeleton",
14337
14399
  "motionDurationExtraFast": "motion-duration-extra-fast",
14338
14400
  "motionDurationExtraSlow": "motion-duration-extra-slow",
14339
14401
  "motionDurationFast": "motion-duration-fast",
@@ -15112,6 +15174,8 @@ module.exports.preset = {
15112
15174
  "colorIconActionCardHover": "--color-icon-action-card-hover-qxq4pp",
15113
15175
  "colorIconActionCardActive": "--color-icon-action-card-active-rhp94s",
15114
15176
  "colorIconActionCardDisabled": "--color-icon-action-card-disabled-wm3kyf",
15177
+ "colorBackgroundSkeleton": "--color-background-skeleton-sjxg4n",
15178
+ "colorBackgroundSkeletonWave": "--color-background-skeleton-wave-1dy97d",
15115
15179
  "fontBoxValueLargeWeight": "--font-box-value-large-weight-wr00sw",
15116
15180
  "fontButtonLetterSpacing": "--font-button-letter-spacing-ufowe3",
15117
15181
  "fontChartDetailSize": "--font-chart-detail-size-9qr25q",
@@ -15238,6 +15302,7 @@ module.exports.preset = {
15238
15302
  "borderWidthActionCardHover": "--border-width-action-card-hover-02l6fg",
15239
15303
  "borderWidthActionCardActive": "--border-width-action-card-active-pwtgzu",
15240
15304
  "borderWidthActionCardDisabled": "--border-width-action-card-disabled-rdvlbc",
15305
+ "borderRadiusSkeleton": "--border-radius-skeleton-9lkvfi",
15241
15306
  "motionDurationExtraFast": "--motion-duration-extra-fast-l4w48j",
15242
15307
  "motionDurationExtraSlow": "--motion-duration-extra-slow-29bqym",
15243
15308
  "motionDurationFast": "--motion-duration-fast-unntf6",
@@ -2399,6 +2399,14 @@ export var preset = {
2399
2399
  "light": "{colorNeutral400}",
2400
2400
  "dark": "{colorNeutral600}"
2401
2401
  },
2402
+ "colorBackgroundSkeleton": {
2403
+ "light": "{colorNeutral250}",
2404
+ "dark": "{colorNeutral750}"
2405
+ },
2406
+ "colorBackgroundSkeletonWave": {
2407
+ "light": "{colorNeutral150}",
2408
+ "dark": "{colorNeutral700}"
2409
+ },
2402
2410
  "fontBoxValueLargeWeight": "700",
2403
2411
  "fontButtonLetterSpacing": "0.005em",
2404
2412
  "fontChartDetailSize": "{fontSizeBodyS}",
@@ -2525,6 +2533,7 @@ export var preset = {
2525
2533
  "borderWidthActionCardHover": "{borderWidthCard}",
2526
2534
  "borderWidthActionCardActive": "{borderWidthCard}",
2527
2535
  "borderWidthActionCardDisabled": "{borderWidthCard}",
2536
+ "borderRadiusSkeleton": "8px",
2528
2537
  "motionDurationExtraFast": {
2529
2538
  "default": "45ms",
2530
2539
  "disabled": "0ms"
@@ -5033,6 +5042,14 @@ export var preset = {
5033
5042
  "light": "{colorNeutral600}",
5034
5043
  "dark": "{colorNeutral600}"
5035
5044
  },
5045
+ "colorBackgroundSkeleton": {
5046
+ "light": "{colorNeutral750}",
5047
+ "dark": "{colorNeutral750}"
5048
+ },
5049
+ "colorBackgroundSkeletonWave": {
5050
+ "light": "{colorNeutral700}",
5051
+ "dark": "{colorNeutral700}"
5052
+ },
5036
5053
  "colorPrimary50": "#f0fbff",
5037
5054
  "colorPrimary100": "#d1f1ff",
5038
5055
  "colorPrimary200": "#b8e7ff",
@@ -6502,6 +6519,14 @@ export var preset = {
6502
6519
  "light": "{colorNeutral600}",
6503
6520
  "dark": "{colorNeutral600}"
6504
6521
  },
6522
+ "colorBackgroundSkeleton": {
6523
+ "light": "{colorNeutral750}",
6524
+ "dark": "{colorNeutral750}"
6525
+ },
6526
+ "colorBackgroundSkeletonWave": {
6527
+ "light": "{colorNeutral700}",
6528
+ "dark": "{colorNeutral700}"
6529
+ },
6505
6530
  "colorPrimary50": "#f0fbff",
6506
6531
  "colorPrimary100": "#d1f1ff",
6507
6532
  "colorPrimary200": "#b8e7ff",
@@ -7898,6 +7923,14 @@ export var preset = {
7898
7923
  "colorIconActionCardDisabled": {
7899
7924
  "light": "{colorNeutral400}",
7900
7925
  "dark": "{colorNeutral600}"
7926
+ },
7927
+ "colorBackgroundSkeleton": {
7928
+ "light": "{colorNeutral250}",
7929
+ "dark": "{colorNeutral750}"
7930
+ },
7931
+ "colorBackgroundSkeletonWave": {
7932
+ "light": "{colorNeutral150}",
7933
+ "dark": "{colorNeutral700}"
7901
7934
  }
7902
7935
  }
7903
7936
  },
@@ -9180,6 +9213,14 @@ export var preset = {
9180
9213
  "colorIconActionCardDisabled": {
9181
9214
  "light": "{colorNeutral400}",
9182
9215
  "dark": "{colorNeutral600}"
9216
+ },
9217
+ "colorBackgroundSkeleton": {
9218
+ "light": "{colorNeutral250}",
9219
+ "dark": "{colorNeutral750}"
9220
+ },
9221
+ "colorBackgroundSkeletonWave": {
9222
+ "light": "{colorNeutral150}",
9223
+ "dark": "{colorNeutral700}"
9183
9224
  }
9184
9225
  }
9185
9226
  },
@@ -10463,6 +10504,14 @@ export var preset = {
10463
10504
  "light": "{colorNeutral400}",
10464
10505
  "dark": "{colorNeutral600}"
10465
10506
  },
10507
+ "colorBackgroundSkeleton": {
10508
+ "light": "{colorNeutral250}",
10509
+ "dark": "{colorNeutral750}"
10510
+ },
10511
+ "colorBackgroundSkeletonWave": {
10512
+ "light": "{colorNeutral150}",
10513
+ "dark": "{colorNeutral700}"
10514
+ },
10466
10515
  "fontExpandableHeadingSize": "14px",
10467
10516
  "borderDividerSectionWidth": "1px"
10468
10517
  }
@@ -11746,6 +11795,14 @@ export var preset = {
11746
11795
  "colorIconActionCardDisabled": {
11747
11796
  "light": "{colorNeutral600}",
11748
11797
  "dark": "{colorNeutral600}"
11798
+ },
11799
+ "colorBackgroundSkeleton": {
11800
+ "light": "{colorNeutral750}",
11801
+ "dark": "{colorNeutral750}"
11802
+ },
11803
+ "colorBackgroundSkeletonWave": {
11804
+ "light": "{colorNeutral700}",
11805
+ "dark": "{colorNeutral700}"
11749
11806
  }
11750
11807
  }
11751
11808
  },
@@ -12351,6 +12408,8 @@ export var preset = {
12351
12408
  "colorIconActionCardHover": "color",
12352
12409
  "colorIconActionCardActive": "color",
12353
12410
  "colorIconActionCardDisabled": "color",
12411
+ "colorBackgroundSkeleton": "color",
12412
+ "colorBackgroundSkeletonWave": "color",
12354
12413
  "motionDurationExtraFast": "motion",
12355
12414
  "motionDurationExtraSlow": "motion",
12356
12415
  "motionDurationFast": "motion",
@@ -14208,6 +14267,8 @@ export var preset = {
14208
14267
  "colorIconActionCardHover": "color-icon-action-card-hover",
14209
14268
  "colorIconActionCardActive": "color-icon-action-card-active",
14210
14269
  "colorIconActionCardDisabled": "color-icon-action-card-disabled",
14270
+ "colorBackgroundSkeleton": "color-background-skeleton",
14271
+ "colorBackgroundSkeletonWave": "color-background-skeleton-wave",
14211
14272
  "fontBoxValueLargeWeight": "font-box-value-large-weight",
14212
14273
  "fontButtonLetterSpacing": "font-button-letter-spacing",
14213
14274
  "fontChartDetailSize": "font-chart-detail-size",
@@ -14334,6 +14395,7 @@ export var preset = {
14334
14395
  "borderWidthActionCardHover": "border-width-action-card-hover",
14335
14396
  "borderWidthActionCardActive": "border-width-action-card-active",
14336
14397
  "borderWidthActionCardDisabled": "border-width-action-card-disabled",
14398
+ "borderRadiusSkeleton": "border-radius-skeleton",
14337
14399
  "motionDurationExtraFast": "motion-duration-extra-fast",
14338
14400
  "motionDurationExtraSlow": "motion-duration-extra-slow",
14339
14401
  "motionDurationFast": "motion-duration-fast",
@@ -15112,6 +15174,8 @@ export var preset = {
15112
15174
  "colorIconActionCardHover": "--color-icon-action-card-hover-qxq4pp",
15113
15175
  "colorIconActionCardActive": "--color-icon-action-card-active-rhp94s",
15114
15176
  "colorIconActionCardDisabled": "--color-icon-action-card-disabled-wm3kyf",
15177
+ "colorBackgroundSkeleton": "--color-background-skeleton-sjxg4n",
15178
+ "colorBackgroundSkeletonWave": "--color-background-skeleton-wave-1dy97d",
15115
15179
  "fontBoxValueLargeWeight": "--font-box-value-large-weight-wr00sw",
15116
15180
  "fontButtonLetterSpacing": "--font-button-letter-spacing-ufowe3",
15117
15181
  "fontChartDetailSize": "--font-chart-detail-size-9qr25q",
@@ -15238,6 +15302,7 @@ export var preset = {
15238
15302
  "borderWidthActionCardHover": "--border-width-action-card-hover-02l6fg",
15239
15303
  "borderWidthActionCardActive": "--border-width-action-card-active-pwtgzu",
15240
15304
  "borderWidthActionCardDisabled": "--border-width-action-card-disabled-rdvlbc",
15305
+ "borderRadiusSkeleton": "--border-radius-skeleton-9lkvfi",
15241
15306
  "motionDurationExtraFast": "--motion-duration-extra-fast-l4w48j",
15242
15307
  "motionDurationExtraSlow": "--motion-duration-extra-slow-29bqym",
15243
15308
  "motionDurationFast": "--motion-duration-fast-unntf6",
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "6f1df81380f2d4a269fe203c8ddd1fcdf2d4b25d"
2
+ "commit": "be984ac790ad40485a7f8bfe6c41161046f3033a"
3
3
  }
@@ -8,6 +8,11 @@ interface InternalLiveRegionProps extends InternalBaseComponentProps, LiveRegion
8
8
  * interrupted by other actions (like text entry in text filtering).
9
9
  */
10
10
  delay?: number;
11
+ /**
12
+ * By default, the live region will announce the message immediately on mount.
13
+ * This attribute prevents that.
14
+ */
15
+ preventInitialAnnouncement?: boolean;
11
16
  /**
12
17
  * Use a list of strings and/or refs to existing elements for building the
13
18
  * announcement text. If this property is set, `children` and `message` will
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,UAAU,uBAAwB,SAAQ,0BAA0B,EAAE,eAAe;IACnF;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;;AAED,wBAyEG;AAcH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAU5D"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAMtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,UAAU,uBAAwB,SAAQ,0BAA0B,EAAE,eAAe;IACnF;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC,CAAC;CAC5E;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB;;AAED,wBAmFG;AAcH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAU5D"}
@@ -7,7 +7,7 @@ import { getBaseProps } from '../internal/base-component';
7
7
  import { LiveRegionController } from './controller';
8
8
  import styles from './styles.css.js';
9
9
  import testUtilStyles from './test-classes/styles.css.js';
10
- export default React.forwardRef(function InternalLiveRegion({ assertive = false, hidden = false, tagName: TagName = 'div', delay, sources, children, __internalRootRef, className, ...restProps }, ref) {
10
+ export default React.forwardRef(function InternalLiveRegion({ assertive = false, hidden = false, tagName: TagName = 'div', delay, sources, preventInitialAnnouncement, children, __internalRootRef, className, ...restProps }, ref) {
11
11
  const baseProps = getBaseProps(restProps);
12
12
  const childrenRef = useRef(null);
13
13
  const mergedRef = useMergeRefs(childrenRef, __internalRootRef);
@@ -41,11 +41,19 @@ export default React.forwardRef(function InternalLiveRegion({ assertive = false,
41
41
  return extractTextContent(childrenRef.current);
42
42
  }
43
43
  };
44
+ const initialAnnouncementContent = useRef();
44
45
  // Call the controller on every render. The controller will deduplicate the
45
46
  // message against the previous announcement internally.
46
47
  useEffect(() => {
47
48
  var _a;
48
- (_a = liveRegionControllerRef.current) === null || _a === void 0 ? void 0 : _a.announce({ message: getContent() });
49
+ const message = getContent();
50
+ if (initialAnnouncementContent.current === undefined) {
51
+ initialAnnouncementContent.current = message;
52
+ }
53
+ if (preventInitialAnnouncement && initialAnnouncementContent.current === message) {
54
+ return;
55
+ }
56
+ (_a = liveRegionControllerRef.current) === null || _a === void 0 ? void 0 : _a.announce({ message });
49
57
  });
50
58
  useImperativeHandle(ref, () => ({
51
59
  reannounce() {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AA8B1D,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,kBAAkB,CACzD,EACE,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,EACd,OAAO,EAAE,OAAO,GAAG,KAAK,EACxB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,GAAG,SAAS,EACY,EAC1B,GAAqC;IAErC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,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GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACxF,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAwE;IAChG,OAAO,MAAM;SACV,GAAG,CAAC,IAAI,CAAC,EAAE;QACV,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useImperativeHandle, useRef } 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 { LiveRegionController } from './controller';\nimport { LiveRegionProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface InternalLiveRegionProps extends InternalBaseComponentProps, LiveRegionProps {\n /**\n * The delay between each announcement from this live region. You should\n * leave this set to the default unless this live region is commonly\n * interrupted by other actions (like text entry in text filtering).\n */\n delay?: number;\n\n /**\n * Use a list of strings and/or refs to existing elements for building the\n * announcement text. If this property is set, `children` and `message` will\n * be ignored.\n */\n sources?: ReadonlyArray<string | React.RefObject<HTMLElement> | undefined>;\n}\n\nexport interface InternalLiveRegionRef {\n /**\n * Force the live region to announce the message, even if it's the same as\n * the previously announced message.\n *\n * This is useful when making status updates after a change (e.g. filtering)\n * where the new message might be the same as the old one, but the announcement\n * also serves to tell screen reader users that the action was performed.\n */\n reannounce(): void;\n}\n\nexport default React.forwardRef(function InternalLiveRegion(\n {\n assertive = false,\n hidden = false,\n tagName: TagName = 'div',\n delay,\n sources,\n children,\n __internalRootRef,\n className,\n ...restProps\n }: InternalLiveRegionProps,\n ref: React.Ref<InternalLiveRegionRef>\n) {\n const baseProps = getBaseProps(restProps);\n const childrenRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n const mergedRef = useMergeRefs(childrenRef, __internalRootRef);\n\n useEffect(() => {\n // We have to do this because `inert` isn't properly supported until\n // React 19 and this seems much more maintainable than version detection.\n // `inert` is better than `hidden` because it also blocks pointer and\n // focus events as well as hiding the contents from screen readers.\n // https://github.com/facebook/react/issues/17157\n if (childrenRef.current) {\n childrenRef.current.inert = hidden;\n }\n }, [hidden]);\n\n // Initialize the live region controller inside an effect. We have to do this\n // because the controller depends on DOM elements, which aren't available on the\n // server.\n const liveRegionControllerRef = useRef<LiveRegionController | undefined>();\n useEffect(() => {\n const liveRegionController = new LiveRegionController(assertive ? 'assertive' : 'polite', delay);\n liveRegionControllerRef.current = liveRegionController;\n return () => {\n liveRegionController.destroy();\n liveRegionControllerRef.current = undefined;\n };\n }, [assertive, delay]);\n\n const getContent = () => {\n if (sources) {\n return getSourceContent(sources);\n }\n if (childrenRef.current) {\n return extractTextContent(childrenRef.current);\n }\n };\n\n // Call the controller on every render. The controller will deduplicate the\n // message against the previous announcement internally.\n useEffect(() => {\n liveRegionControllerRef.current?.announce({ message: getContent() });\n });\n\n useImperativeHandle(ref, () => ({\n reannounce() {\n liveRegionControllerRef.current?.announce({ message: getContent(), forceReannounce: true });\n },\n }));\n\n return (\n <TagName\n ref={mergedRef}\n {...baseProps}\n className={clsx(styles.root, testUtilStyles.root, className)}\n hidden={hidden}\n >\n {children}\n </TagName>\n );\n});\n\nconst processNode = (childNode: Node): string => {\n if (childNode.nodeType === Node.TEXT_NODE) {\n return childNode.textContent || '';\n }\n\n if (childNode.nodeType === Node.ELEMENT_NODE) {\n return extractTextContent(childNode as HTMLElement);\n }\n\n return '';\n};\n\nexport function extractTextContent(node: HTMLElement): string {\n // We use the text content of the node as the announcement text.\n // This only extracts text content from the node including all its children which is enough for now.\n // To make it more powerful, it is possible to create a more sophisticated extractor with respect to\n // ARIA properties to ignore aria-hidden nodes and read ARIA labels from the live content.\n if (!node || !node?.childNodes?.length) {\n return '';\n }\n\n return Array.from(node.childNodes, processNode).join(' ').replace(/\\s+/g, ' ').trim();\n}\n\nfunction getSourceContent(source: ReadonlyArray<string | React.RefObject<HTMLElement> | undefined>): string {\n return source\n .map(item => {\n if (!item || typeof item === 'string') {\n return item;\n }\n if (item.current) {\n return extractTextContent(item.current);\n }\n })\n .filter(Boolean)\n .join(' ');\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/live-region/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAoC1D,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,kBAAkB,CACzD,EACE,SAAS,GAAG,KAAK,EACjB,MAAM,GAAG,KAAK,EACd,OAAO,EAAE,OAAO,GAAG,KAAK,EACxB,KAAK,EACL,OAAO,EACP,0BAA0B,EAC1B,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,GAAG,SAAS,EACY,EAC1B,GAAqC;IAErC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,WAAW,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F,IAAI,CAAC,IAAI,IAAI,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,0CAAE,MAAM,CAAA,EAAE,CAAC;QACvC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACxF,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAwE;IAChG,OAAO,MAAM;SACV,GAAG,CAAC,IAAI,CAAC,EAAE;QACV,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useImperativeHandle, useRef } 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 { LiveRegionController } from './controller';\nimport { LiveRegionProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ninterface InternalLiveRegionProps extends InternalBaseComponentProps, LiveRegionProps {\n /**\n * The delay between each announcement from this live region. You should\n * leave this set to the default unless this live region is commonly\n * interrupted by other actions (like text entry in text filtering).\n */\n delay?: number;\n\n /**\n * By default, the live region will announce the message immediately on mount.\n * This attribute prevents that.\n */\n preventInitialAnnouncement?: boolean;\n\n /**\n * Use a list of strings and/or refs to existing elements for building the\n * announcement text. If this property is set, `children` and `message` will\n * be ignored.\n */\n sources?: ReadonlyArray<string | React.RefObject<HTMLElement> | undefined>;\n}\n\nexport interface InternalLiveRegionRef {\n /**\n * Force the live region to announce the message, even if it's the same as\n * the previously announced message.\n *\n * This is useful when making status updates after a change (e.g. filtering)\n * where the new message might be the same as the old one, but the announcement\n * also serves to tell screen reader users that the action was performed.\n */\n reannounce(): void;\n}\n\nexport default React.forwardRef(function InternalLiveRegion(\n {\n assertive = false,\n hidden = false,\n tagName: TagName = 'div',\n delay,\n sources,\n preventInitialAnnouncement,\n children,\n __internalRootRef,\n className,\n ...restProps\n }: InternalLiveRegionProps,\n ref: React.Ref<InternalLiveRegionRef>\n) {\n const baseProps = getBaseProps(restProps);\n const childrenRef = useRef<HTMLSpanElement & HTMLDivElement>(null);\n const mergedRef = useMergeRefs(childrenRef, __internalRootRef);\n\n useEffect(() => {\n // We have to do this because `inert` isn't properly supported until\n // React 19 and this seems much more maintainable than version detection.\n // `inert` is better than `hidden` because it also blocks pointer and\n // focus events as well as hiding the contents from screen readers.\n // https://github.com/facebook/react/issues/17157\n if (childrenRef.current) {\n childrenRef.current.inert = hidden;\n }\n }, [hidden]);\n\n // Initialize the live region controller inside an effect. We have to do this\n // because the controller depends on DOM elements, which aren't available on the\n // server.\n const liveRegionControllerRef = useRef<LiveRegionController | undefined>();\n useEffect(() => {\n const liveRegionController = new LiveRegionController(assertive ? 'assertive' : 'polite', delay);\n liveRegionControllerRef.current = liveRegionController;\n return () => {\n liveRegionController.destroy();\n liveRegionControllerRef.current = undefined;\n };\n }, [assertive, delay]);\n\n const getContent = () => {\n if (sources) {\n return getSourceContent(sources);\n }\n if (childrenRef.current) {\n return extractTextContent(childrenRef.current);\n }\n };\n\n const initialAnnouncementContent = useRef<string | undefined>();\n\n // Call the controller on every render. The controller will deduplicate the\n // message against the previous announcement internally.\n useEffect(() => {\n const message = getContent();\n if (initialAnnouncementContent.current === undefined) {\n initialAnnouncementContent.current = message;\n }\n if (preventInitialAnnouncement && initialAnnouncementContent.current === message) {\n return;\n }\n liveRegionControllerRef.current?.announce({ message });\n });\n\n useImperativeHandle(ref, () => ({\n reannounce() {\n liveRegionControllerRef.current?.announce({ message: getContent(), forceReannounce: true });\n },\n }));\n\n return (\n <TagName\n ref={mergedRef}\n {...baseProps}\n className={clsx(styles.root, testUtilStyles.root, className)}\n hidden={hidden}\n >\n {children}\n </TagName>\n );\n});\n\nconst processNode = (childNode: Node): string => {\n if (childNode.nodeType === Node.TEXT_NODE) {\n return childNode.textContent || '';\n }\n\n if (childNode.nodeType === Node.ELEMENT_NODE) {\n return extractTextContent(childNode as HTMLElement);\n }\n\n return '';\n};\n\nexport function extractTextContent(node: HTMLElement): string {\n // We use the text content of the node as the announcement text.\n // This only extracts text content from the node including all its children which is enough for now.\n // To make it more powerful, it is possible to create a more sophisticated extractor with respect to\n // ARIA properties to ignore aria-hidden nodes and read ARIA labels from the live content.\n if (!node || !node?.childNodes?.length) {\n return '';\n }\n\n return Array.from(node.childNodes, processNode).join(' ').replace(/\\s+/g, ' ').trim();\n}\n\nfunction getSourceContent(source: ReadonlyArray<string | React.RefObject<HTMLElement> | undefined>): string {\n return source\n .map(item => {\n if (!item || typeof item === 'string') {\n return item;\n }\n if (item.current) {\n return extractTextContent(item.current);\n }\n })\n .filter(Boolean)\n .join(' ');\n}\n"]}
package/package.json CHANGED
@@ -103,6 +103,7 @@
103
103
  "./segmented-control": "./segmented-control/index.js",
104
104
  "./select": "./select/index.js",
105
105
  "./side-navigation": "./side-navigation/index.js",
106
+ "./skeleton": "./skeleton/index.js",
106
107
  "./slider": "./slider/index.js",
107
108
  "./space-between": "./space-between/index.js",
108
109
  "./spinner": "./spinner/index.js",
@@ -165,7 +166,7 @@
165
166
  "./internal/base-component/index.js",
166
167
  "./internal/base-component/styles.css.js"
167
168
  ],
168
- "version": "3.0.1296",
169
+ "version": "3.0.1298",
169
170
  "repository": {
170
171
  "type": "git",
171
172
  "url": "https://github.com/cloudscape-design/components.git"
@@ -0,0 +1,10 @@
1
+ import { SkeletonProps } from './interfaces';
2
+ export { SkeletonProps };
3
+ export default function Skeleton({
4
+ variant,
5
+ display,
6
+ tagOverride,
7
+ height,
8
+ width,
9
+ ...restProps
10
+ }: SkeletonProps): JSX.Element;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skeleton/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,OAAmB,EACnB,OAAiB,EACjB,WAAmB,EACnB,MAAM,EACN,KAAK,EACL,GAAG,SAAS,EACb,EAAE,aAAa,eAqBf"}
@@ -0,0 +1,21 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ 'use client';
4
+ import React from 'react';
5
+ import useBaseComponent from '../internal/hooks/use-base-component';
6
+ import { applyDisplayName } from '../internal/utils/apply-display-name';
7
+ import InternalSkeleton from './internal';
8
+ export default function Skeleton({ variant = 'dynamic', display = 'block', tagOverride = 'div', height, width, ...restProps }) {
9
+ const baseComponentProps = useBaseComponent('Skeleton', {
10
+ props: {
11
+ variant,
12
+ display,
13
+ height,
14
+ width,
15
+ tagOverride,
16
+ },
17
+ });
18
+ return (React.createElement(InternalSkeleton, { variant: variant, display: display, height: height, width: width, tagOverride: tagOverride, ...restProps, ...baseComponentProps }));
19
+ }
20
+ applyDisplayName(Skeleton, 'Skeleton');
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/skeleton/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAI1C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,OAAO,GAAG,SAAS,EACnB,OAAO,GAAG,OAAO,EACjB,WAAW,GAAG,KAAK,EACnB,MAAM,EACN,KAAK,EACL,GAAG,SAAS,EACE;IACd,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,EAAE;QACtD,KAAK,EAAE;YACL,OAAO;YACP,OAAO;YACP,MAAM;YACN,KAAK;YACL,WAAW;SACZ;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,gBAAgB,IACf,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,KACpB,SAAS,KACT,kBAAkB,GACtB,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\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 { SkeletonProps } from './interfaces';\nimport InternalSkeleton from './internal';\n\nexport { SkeletonProps };\n\nexport default function Skeleton({\n variant = 'dynamic',\n display = 'block',\n tagOverride = 'div',\n height,\n width,\n ...restProps\n}: SkeletonProps) {\n const baseComponentProps = useBaseComponent('Skeleton', {\n props: {\n variant,\n display,\n height,\n width,\n tagOverride,\n },\n });\n return (\n <InternalSkeleton\n variant={variant}\n display={display}\n height={height}\n width={width}\n tagOverride={tagOverride}\n {...restProps}\n {...baseComponentProps}\n />\n );\n}\n\napplyDisplayName(Skeleton, 'Skeleton');\n"]}
@@ -0,0 +1,36 @@
1
+ import { BaseComponentProps } from '../internal/base-component';
2
+ export interface SkeletonProps extends BaseComponentProps {
3
+ /**
4
+ * Specifies the variant of the skeleton to match Box fontSize options.
5
+ * The default value, `dynamic`, matches skeleton height to the surrounding font size.
6
+ * * `text-body-s` - Skeleton with height matching body-s line-height.
7
+ * * `text-body-m` - Skeleton with height matching body-m line-height.
8
+ * * `text-heading-xs` - Skeleton with height matching heading-xs line-height.
9
+ * * `text-heading-s` - Skeleton with height matching heading-s line-height.
10
+ * * `text-heading-m` - Skeleton with height matching heading-m line-height.
11
+ * * `text-heading-l` - Skeleton with height matching heading-l line-height.
12
+ * * `text-heading-xl` - Skeleton with height matching heading-xl line-height.
13
+ * * `text-display-l` - Skeleton with height matching display-l line-height.
14
+ */
15
+ variant?: SkeletonProps.Variant;
16
+ /**
17
+ * Specifies the CSS `display` of the skeleton.
18
+ */
19
+ display?: 'block' | 'inline-block' | 'inline';
20
+ /**
21
+ * Overrides the default HTML tag used by the component.
22
+ */
23
+ tagOverride?: string;
24
+ /**
25
+ * Specifies the height of the skeleton. Accepts any valid CSS value (for example, `"100px"`, `"3em"`).
26
+ * By default the height is determined by the `variant`.
27
+ */
28
+ height?: string;
29
+ /**
30
+ * Specifies the width of the skeleton. Accepts any valid CSS value (for example, `"200px"`, `"100%"`).
31
+ */
32
+ width?: string;
33
+ }
34
+ export declare namespace SkeletonProps {
35
+ type Variant = 'dynamic' | 'text-body-s' | 'text-body-m' | 'text-heading-xs' | 'text-heading-s' | 'text-heading-m' | 'text-heading-l' | 'text-heading-xl' | 'text-display-l';
36
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/skeleton/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC;IAEhC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,GAAG,QAAQ,CAAC;IAE9C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yBAAiB,aAAa,CAAC;IAC7B,KAAY,OAAO,GACf,SAAS,GACT,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/skeleton/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\nexport interface SkeletonProps extends BaseComponentProps {\n /**\n * Specifies the variant of the skeleton to match Box fontSize options.\n * The default value, `dynamic`, matches skeleton height to the surrounding font size.\n * * `text-body-s` - Skeleton with height matching body-s line-height.\n * * `text-body-m` - Skeleton with height matching body-m line-height.\n * * `text-heading-xs` - Skeleton with height matching heading-xs line-height.\n * * `text-heading-s` - Skeleton with height matching heading-s line-height.\n * * `text-heading-m` - Skeleton with height matching heading-m line-height.\n * * `text-heading-l` - Skeleton with height matching heading-l line-height.\n * * `text-heading-xl` - Skeleton with height matching heading-xl line-height.\n * * `text-display-l` - Skeleton with height matching display-l line-height.\n */\n variant?: SkeletonProps.Variant;\n\n /**\n * Specifies the CSS `display` of the skeleton.\n */\n display?: 'block' | 'inline-block' | 'inline';\n\n /**\n * Overrides the default HTML tag used by the component.\n */\n tagOverride?: string;\n\n /**\n * Specifies the height of the skeleton. Accepts any valid CSS value (for example, `\"100px\"`, `\"3em\"`).\n * By default the height is determined by the `variant`.\n */\n height?: string;\n\n /**\n * Specifies the width of the skeleton. Accepts any valid CSS value (for example, `\"200px\"`, `\"100%\"`).\n */\n width?: string;\n}\n\nexport namespace SkeletonProps {\n export type Variant =\n | 'dynamic'\n | 'text-body-s'\n | 'text-body-m'\n | 'text-heading-xs'\n | 'text-heading-s'\n | 'text-heading-m'\n | 'text-heading-l'\n | 'text-heading-xl'\n | 'text-display-l';\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
+ import { SomeRequired } from '../internal/types';
3
+ import { SkeletonProps } from './interfaces';
4
+ interface InternalSkeletonProps extends SomeRequired<SkeletonProps, 'variant' | 'tagOverride'>, InternalBaseComponentProps {}
5
+ export default function InternalSkeleton({
6
+ variant,
7
+ height,
8
+ width,
9
+ display,
10
+ tagOverride,
11
+ __internalRootRef,
12
+ ...props
13
+ }: InternalSkeletonProps): JSX.Element;
14
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/skeleton/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,UAAU,qBACR,SAAQ,YAAY,CAAC,aAAa,EAAE,SAAS,GAAG,aAAa,CAAC,EAC5D,0BAA0B;CAAG;AAEjC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,GAAG,KAAK,EACT,EAAE,qBAAqB,eAqBvB"}
@@ -0,0 +1,13 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import React from 'react';
4
+ import clsx from 'clsx';
5
+ import { getBaseProps } from '../internal/base-component';
6
+ import styles from './styles.css.js';
7
+ export default function InternalSkeleton({ variant, height, width, display, tagOverride, __internalRootRef, ...props }) {
8
+ const baseProps = getBaseProps(props);
9
+ const Tag = tagOverride;
10
+ return (React.createElement(Tag, { ...baseProps, className: clsx(baseProps.className, styles.root, variant && styles[`variant-${variant}`], display && styles[`display-${display}`]), ref: __internalRootRef, style: width !== undefined ? { inlineSize: width } : {}, "aria-hidden": "true" },
11
+ React.createElement(Tag, { className: styles.inner, style: height !== undefined ? { blockSize: height } : {} })));
12
+ }
13
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/skeleton/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,GAAG,KAAK,EACc;IACtB,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEtC,MAAM,GAAG,GAAG,WAAoB,CAAC;IAEjC,OAAO,CACL,oBAAC,GAAG,OACE,SAAS,EACb,SAAS,EAAE,IAAI,CACb,SAAS,CAAC,SAAS,EACnB,MAAM,CAAC,IAAI,EACX,OAAO,IAAI,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,EACvC,OAAO,IAAI,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,CACxC,EACD,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,iBAC3C,MAAM;QAElB,oBAAC,GAAG,IAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GAAI,CACtF,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 { getBaseProps } from '../internal/base-component';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport { SkeletonProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalSkeletonProps\n extends SomeRequired<SkeletonProps, 'variant' | 'tagOverride'>,\n InternalBaseComponentProps {}\n\nexport default function InternalSkeleton({\n variant,\n height,\n width,\n display,\n tagOverride,\n __internalRootRef,\n ...props\n}: InternalSkeletonProps) {\n const baseProps = getBaseProps(props);\n\n const Tag = tagOverride as 'div';\n\n return (\n <Tag\n {...baseProps}\n className={clsx(\n baseProps.className,\n styles.root,\n variant && styles[`variant-${variant}`],\n display && styles[`display-${display}`]\n )}\n ref={__internalRootRef}\n style={width !== undefined ? { inlineSize: width } : {}}\n aria-hidden=\"true\"\n >\n <Tag className={styles.inner} style={height !== undefined ? { blockSize: height } : {}} />\n </Tag>\n );\n}\n"]}
@@ -0,0 +1,20 @@
1
+
2
+ import './styles.scoped.css';
3
+ export default {
4
+ "root": "awsui_root_1qq5l_23px4_161",
5
+ "inner": "awsui_inner_1qq5l_23px4_164",
6
+ "skeleton-wave": "awsui_skeleton-wave_1qq5l_23px4_1",
7
+ "skeleton-wave-rtl": "awsui_skeleton-wave-rtl_1qq5l_23px4_1",
8
+ "display-block": "awsui_display-block_1qq5l_23px4_222",
9
+ "display-inline-block": "awsui_display-inline-block_1qq5l_23px4_226",
10
+ "display-inline": "awsui_display-inline_1qq5l_23px4_226",
11
+ "variant-text-body-s": "awsui_variant-text-body-s_1qq5l_23px4_235",
12
+ "variant-text-body-m": "awsui_variant-text-body-m_1qq5l_23px4_240",
13
+ "variant-text-heading-xs": "awsui_variant-text-heading-xs_1qq5l_23px4_245",
14
+ "variant-text-heading-s": "awsui_variant-text-heading-s_1qq5l_23px4_250",
15
+ "variant-text-heading-m": "awsui_variant-text-heading-m_1qq5l_23px4_255",
16
+ "variant-text-heading-l": "awsui_variant-text-heading-l_1qq5l_23px4_260",
17
+ "variant-text-heading-xl": "awsui_variant-text-heading-xl_1qq5l_23px4_265",
18
+ "variant-text-display-l": "awsui_variant-text-display-l_1qq5l_23px4_270"
19
+ };
20
+