@cloudscape-design/components-themeable 3.0.1401 → 3.0.1403

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 (186) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/action-card/mixins.scss +18 -4
  3. package/lib/internal/scss/action-card/styles.scss +63 -13
  4. package/lib/internal/scss/button/styles.scss +3 -0
  5. package/lib/internal/scss/copy-to-clipboard/styles.scss +0 -41
  6. package/lib/internal/scss/icon/hover-motion.scss +98 -60
  7. package/lib/internal/scss/internal/components/sticky-scrollbar/mixins.scss +10 -0
  8. package/lib/internal/scss/{table → internal/components}/sticky-scrollbar/styles.scss +2 -2
  9. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  10. package/lib/internal/scss/item-card/styles.scss +103 -13
  11. package/lib/internal/scss/table-root/styles.scss +3 -0
  12. package/lib/internal/scss/tabs/styles.scss +0 -1
  13. package/lib/internal/scss/tabs/tab-header-bar.scss +20 -42
  14. package/lib/internal/scss/token/styles.scss +1 -0
  15. package/lib/internal/template/action-card/internal.d.ts +10 -2
  16. package/lib/internal/template/action-card/internal.d.ts.map +1 -1
  17. package/lib/internal/template/action-card/internal.js +5 -5
  18. package/lib/internal/template/action-card/internal.js.map +1 -1
  19. package/lib/internal/template/action-card/styles.css.js +18 -17
  20. package/lib/internal/template/action-card/styles.scoped.css +274 -202
  21. package/lib/internal/template/action-card/styles.selectors.js +18 -17
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -1
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +3 -1
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -1
  25. package/lib/internal/template/button/styles.css.js +24 -24
  26. package/lib/internal/template/button/styles.scoped.css +83 -79
  27. package/lib/internal/template/button/styles.selectors.js +24 -24
  28. package/lib/internal/template/button-dropdown/filter.d.ts +1 -1
  29. package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
  30. package/lib/internal/template/copy-to-clipboard/internal.js +16 -36
  31. package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
  32. package/lib/internal/template/copy-to-clipboard/styles.css.js +5 -10
  33. package/lib/internal/template/copy-to-clipboard/styles.scoped.css +6 -38
  34. package/lib/internal/template/copy-to-clipboard/styles.selectors.js +5 -10
  35. package/lib/internal/template/icon/generated/icons.d.ts +1 -1
  36. package/lib/internal/template/icon/generated/icons.js +3 -3
  37. package/lib/internal/template/icon/generated/icons.js.map +1 -1
  38. package/lib/internal/template/icon-provider/interfaces.d.ts +1 -1
  39. package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
  40. package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
  41. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  42. package/lib/internal/template/internal/base-theme/styles.scoped.css +1 -0
  43. package/lib/internal/template/internal/components/listbox/interfaces.d.ts +13 -0
  44. package/lib/internal/template/internal/components/listbox/interfaces.d.ts.map +1 -0
  45. package/lib/internal/template/internal/components/listbox/interfaces.js +2 -0
  46. package/lib/internal/template/internal/components/listbox/interfaces.js.map +1 -0
  47. package/lib/internal/template/internal/components/listbox/parts/get-item-props.d.ts +1 -2
  48. package/lib/internal/template/internal/components/listbox/parts/get-item-props.d.ts.map +1 -1
  49. package/lib/internal/template/internal/components/listbox/parts/get-item-props.js +1 -2
  50. package/lib/internal/template/internal/components/listbox/parts/get-item-props.js.map +1 -1
  51. package/lib/internal/template/internal/components/listbox/parts/item.d.ts +44 -0
  52. package/lib/internal/template/internal/components/listbox/parts/item.d.ts.map +1 -0
  53. package/lib/internal/template/internal/components/listbox/parts/item.js +184 -0
  54. package/lib/internal/template/internal/components/listbox/parts/item.js.map +1 -0
  55. package/lib/internal/template/internal/components/listbox/parts/plain-list.d.ts +24 -0
  56. package/lib/internal/template/internal/components/listbox/parts/plain-list.d.ts.map +1 -0
  57. package/lib/internal/template/{select → internal/components/listbox}/parts/plain-list.js +9 -10
  58. package/lib/internal/template/internal/components/listbox/parts/plain-list.js.map +1 -0
  59. package/lib/internal/template/internal/components/listbox/parts/render-options.d.ts +3 -3
  60. package/lib/internal/template/internal/components/listbox/parts/render-options.d.ts.map +1 -1
  61. package/lib/internal/template/internal/components/listbox/parts/render-options.js +3 -6
  62. package/lib/internal/template/internal/components/listbox/parts/render-options.js.map +1 -1
  63. package/lib/internal/template/internal/components/listbox/use-listbox.d.ts +85 -0
  64. package/lib/internal/template/internal/components/listbox/use-listbox.d.ts.map +1 -0
  65. package/lib/internal/template/internal/components/listbox/use-listbox.js +117 -0
  66. package/lib/internal/template/internal/components/listbox/use-listbox.js.map +1 -0
  67. package/lib/internal/template/internal/components/listbox/use-type-ahead.d.ts +13 -0
  68. package/lib/internal/template/internal/components/listbox/use-type-ahead.d.ts.map +1 -0
  69. package/lib/internal/template/{select/utils/use-native-search.js → internal/components/listbox/use-type-ahead.js} +8 -8
  70. package/lib/internal/template/internal/components/listbox/use-type-ahead.js.map +1 -0
  71. package/lib/internal/template/internal/components/listbox/utils/navigation.d.ts +20 -0
  72. package/lib/internal/template/internal/components/listbox/utils/navigation.d.ts.map +1 -0
  73. package/lib/internal/template/internal/components/listbox/utils/navigation.js +22 -0
  74. package/lib/internal/template/internal/components/listbox/utils/navigation.js.map +1 -0
  75. package/lib/internal/template/internal/components/listbox/utils/option-props.d.ts +32 -0
  76. package/lib/internal/template/internal/components/listbox/utils/option-props.d.ts.map +1 -0
  77. package/lib/internal/template/internal/components/listbox/utils/option-props.js +51 -0
  78. package/lib/internal/template/internal/components/listbox/utils/option-props.js.map +1 -0
  79. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts +1 -1
  80. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
  81. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js +2 -2
  82. package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js.map +1 -1
  83. package/lib/internal/template/internal/components/sticky-scrollbar/index.d.ts.map +1 -0
  84. package/lib/internal/template/internal/components/sticky-scrollbar/index.js.map +1 -0
  85. package/lib/internal/template/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.d.ts +2 -1
  86. package/lib/internal/template/internal/components/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -0
  87. package/lib/internal/template/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.js +8 -5
  88. package/lib/internal/template/internal/components/sticky-scrollbar/sticky-scrollbar.js.map +1 -0
  89. package/lib/internal/template/internal/components/sticky-scrollbar/styles.css.js +11 -0
  90. package/lib/internal/template/{table → internal/components}/sticky-scrollbar/styles.scoped.css +8 -8
  91. package/lib/internal/template/internal/components/sticky-scrollbar/styles.selectors.js +12 -0
  92. package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.d.ts +10 -0
  93. package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -0
  94. package/lib/internal/template/{table → internal/components}/sticky-scrollbar/use-sticky-scrollbar.js +17 -16
  95. package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -0
  96. package/lib/internal/template/internal/environment.js +2 -2
  97. package/lib/internal/template/internal/environment.json +2 -2
  98. package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
  99. package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
  100. package/lib/internal/template/internal/generated/theming/index.cjs +4 -0
  101. package/lib/internal/template/internal/generated/theming/index.d.cts +9 -0
  102. package/lib/internal/template/internal/generated/theming/index.d.ts +9 -0
  103. package/lib/internal/template/internal/generated/theming/index.js +4 -0
  104. package/lib/internal/template/item-card/internal.d.ts +10 -1
  105. package/lib/internal/template/item-card/internal.d.ts.map +1 -1
  106. package/lib/internal/template/item-card/internal.js +4 -4
  107. package/lib/internal/template/item-card/internal.js.map +1 -1
  108. package/lib/internal/template/item-card/style.d.ts.map +1 -1
  109. package/lib/internal/template/item-card/style.js +6 -1
  110. package/lib/internal/template/item-card/style.js.map +1 -1
  111. package/lib/internal/template/item-card/styles.css.js +14 -14
  112. package/lib/internal/template/item-card/styles.scoped.css +125 -63
  113. package/lib/internal/template/item-card/styles.selectors.js +14 -14
  114. package/lib/internal/template/multiselect/embedded.d.ts.map +1 -1
  115. package/lib/internal/template/multiselect/embedded.js +2 -2
  116. package/lib/internal/template/multiselect/embedded.js.map +1 -1
  117. package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
  118. package/lib/internal/template/multiselect/internal.js +2 -2
  119. package/lib/internal/template/multiselect/internal.js.map +1 -1
  120. package/lib/internal/template/multiselect/use-multiselect.d.ts +2 -3
  121. package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
  122. package/lib/internal/template/multiselect/use-multiselect.js +7 -18
  123. package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
  124. package/lib/internal/template/select/internal.d.ts.map +1 -1
  125. package/lib/internal/template/select/internal.js +9 -19
  126. package/lib/internal/template/select/internal.js.map +1 -1
  127. package/lib/internal/template/select/parts/filter.d.ts +1 -1
  128. package/lib/internal/template/select/parts/virtual-list.d.ts +3 -2
  129. package/lib/internal/template/select/parts/virtual-list.d.ts.map +1 -1
  130. package/lib/internal/template/select/parts/virtual-list.js +7 -8
  131. package/lib/internal/template/select/parts/virtual-list.js.map +1 -1
  132. package/lib/internal/template/select/utils/use-select.d.ts +15 -11
  133. package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
  134. package/lib/internal/template/select/utils/use-select.js +41 -117
  135. package/lib/internal/template/select/utils/use-select.js.map +1 -1
  136. package/lib/internal/template/styling/action-card.scss +56 -0
  137. package/lib/internal/template/styling/item-card.scss +81 -0
  138. package/lib/internal/template/table/internal.d.ts.map +1 -1
  139. package/lib/internal/template/table/internal.js +1 -1
  140. package/lib/internal/template/table/internal.js.map +1 -1
  141. package/lib/internal/template/table-root/internal.d.ts.map +1 -1
  142. package/lib/internal/template/table-root/internal.js +17 -3
  143. package/lib/internal/template/table-root/internal.js.map +1 -1
  144. package/lib/internal/template/table-root/styles.css.js +5 -5
  145. package/lib/internal/template/table-root/styles.scoped.css +10 -6
  146. package/lib/internal/template/table-root/styles.selectors.js +5 -5
  147. package/lib/internal/template/tabs/styles.css.js +30 -31
  148. package/lib/internal/template/tabs/styles.scoped.css +51 -67
  149. package/lib/internal/template/tabs/styles.selectors.js +30 -31
  150. package/lib/internal/template/tabs/tab-header-bar.d.ts.map +1 -1
  151. package/lib/internal/template/tabs/tab-header-bar.js +5 -54
  152. package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
  153. package/lib/internal/template/toggle/internal.d.ts.map +1 -1
  154. package/lib/internal/template/toggle/internal.js +1 -1
  155. package/lib/internal/template/toggle/internal.js.map +1 -1
  156. package/lib/internal/template/token/styles.css.js +14 -14
  157. package/lib/internal/template/token/styles.scoped.css +25 -24
  158. package/lib/internal/template/token/styles.selectors.js +14 -14
  159. package/package.json +1 -1
  160. package/lib/internal/scss/copy-to-clipboard/motion.scss +0 -31
  161. package/lib/internal/scss/tabs/motion.scss +0 -22
  162. package/lib/internal/template/select/parts/item.d.ts +0 -34
  163. package/lib/internal/template/select/parts/item.d.ts.map +0 -1
  164. package/lib/internal/template/select/parts/item.js +0 -94
  165. package/lib/internal/template/select/parts/item.js.map +0 -1
  166. package/lib/internal/template/select/parts/multiselect-item.d.ts +0 -15
  167. package/lib/internal/template/select/parts/multiselect-item.d.ts.map +0 -1
  168. package/lib/internal/template/select/parts/multiselect-item.js +0 -112
  169. package/lib/internal/template/select/parts/multiselect-item.js.map +0 -1
  170. package/lib/internal/template/select/parts/plain-list.d.ts +0 -27
  171. package/lib/internal/template/select/parts/plain-list.d.ts.map +0 -1
  172. package/lib/internal/template/select/parts/plain-list.js.map +0 -1
  173. package/lib/internal/template/select/utils/use-native-search.d.ts +0 -13
  174. package/lib/internal/template/select/utils/use-native-search.d.ts.map +0 -1
  175. package/lib/internal/template/select/utils/use-native-search.js.map +0 -1
  176. package/lib/internal/template/table/sticky-scrollbar/index.d.ts.map +0 -1
  177. package/lib/internal/template/table/sticky-scrollbar/index.js.map +0 -1
  178. package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +0 -1
  179. package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.js.map +0 -1
  180. package/lib/internal/template/table/sticky-scrollbar/styles.css.js +0 -11
  181. package/lib/internal/template/table/sticky-scrollbar/styles.selectors.js +0 -12
  182. package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.d.ts +0 -4
  183. package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +0 -1
  184. package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.js.map +0 -1
  185. /package/lib/internal/template/{table → internal/components}/sticky-scrollbar/index.d.ts +0 -0
  186. /package/lib/internal/template/{table → internal/components}/sticky-scrollbar/index.js +0 -0
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "1a6b6c2b66ab2883122812e79ad4917e00e413da"
2
+ "commit": "d25043b390a04b3617641e16ef5f92fdbf69131b"
3
3
  }
@@ -3,8 +3,14 @@
3
3
 
4
4
  @use 'sass:map';
5
5
  @use '../internal/styles/tokens' as awsui;
6
+ @use '../internal/styles/style-api' as style-api;
6
7
  @use './constants' as constants;
7
8
 
9
+ // Border tokens stay public: as carriers they would inherit into nested components that read the same carrier name.
10
+ $border-tokens: style-api.resolve((border-color, border-width), public);
11
+ $carrier-tokens: style-api.resolve((border-radius, focus-ring-color, focus-ring-width, focus-ring-radius), carrier);
12
+ $tokens: map.merge($border-tokens, $carrier-tokens);
13
+
8
14
  $variant-border-radius: (
9
15
  'embedded': awsui.$border-radius-action-card-embedded,
10
16
  'default': awsui.$border-radius-action-card-default,
@@ -29,7 +35,15 @@ $variant-padding-inline: (
29
35
 
30
36
  @mixin state-border-radius($variant: 'default', $state: 'default') {
31
37
  $token: map.get($variant-border-radius, $variant);
32
- @include border-radius-all($token);
38
+ @include border-radius-all(style-api.value($carrier-tokens, border-radius, $token));
39
+ }
40
+
41
+ @mixin inherit-border-tokens {
42
+ @if style-api.enabled() {
43
+ @each $token, $property in $border-tokens {
44
+ #{$property}: inherit;
45
+ }
46
+ }
33
47
  }
34
48
 
35
49
  @mixin state-border-radius-all-variants($state: 'default') {
@@ -55,9 +69,9 @@ $variant-padding-inline: (
55
69
  }
56
70
 
57
71
  &:after {
58
- border-color: map.get($s, 'border-color');
59
- border-block-width: map.get($s, 'border-width');
60
- border-inline-width: map.get($s, 'border-width');
72
+ border-color: style-api.value($border-tokens, border-color, map.get($s, 'border-color'));
73
+ border-block-width: style-api.value($border-tokens, border-width, map.get($s, 'border-width'));
74
+ border-inline-width: style-api.value($border-tokens, border-width, map.get($s, 'border-width'));
61
75
  }
62
76
 
63
77
  > .icon,
@@ -8,12 +8,38 @@
8
8
  @use '../internal/styles' as styles;
9
9
  @use '../internal/styles/tokens' as awsui;
10
10
  @use '../internal/styles/utils/theming' as theming;
11
+ @use '../internal/styles/style-api' as style-api;
11
12
  @use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
12
13
  @use './constants' as constants;
13
14
  @use './mixins' as mixins;
14
15
  @use './motion';
15
16
 
17
+ $tokens: mixins.$tokens;
18
+ @include style-api.register($tokens);
19
+ @include style-api.docs(
20
+ 'root',
21
+ $tokens,
22
+ $properties: (background),
23
+ $descriptions: (
24
+ slot:
25
+ 'This is NOT a semantic button element. Use `:has(:hover)` or `:has(:active)` to target semantic button states. `disabled` is set by you: pass a different class when it is true.',
26
+ tokens: (
27
+ border-color: 'The border is drawn over the card edges and takes no space.',
28
+ border-width: 'The border is drawn over the card edges and takes no space.',
29
+ border-radius: 'Also rounds the header corners that meet the card corners.',
30
+ )
31
+ )
32
+ );
33
+ @include style-api.docs(
34
+ 'header',
35
+ $properties: (background, border),
36
+ $descriptions: (
37
+ slot:
38
+ 'Rendered when `header` or `description` is set. The block-end border is the divider between the header and the content. With a top-aligned `icon`, the header spans the full card width, icon included. With a centered `icon`, the icon column stays outside the header.'
39
+ )
40
+ );
16
41
  .header {
42
+ border-block-end: 0 solid transparent;
17
43
  &-inner {
18
44
  @include styles.font-heading-s;
19
45
  &.disabled {
@@ -31,10 +57,14 @@
31
57
  .header-row {
32
58
  display: flex;
33
59
  align-items: flex-start;
60
+ border-block-end: 0 solid transparent;
34
61
  > .header {
35
62
  flex: 1;
36
63
  min-inline-size: 0;
37
64
  }
65
+ &:not(:has(+ .body)) {
66
+ flex: 1;
67
+ }
38
68
  }
39
69
 
40
70
  .body {
@@ -111,6 +141,7 @@
111
141
  min-inline-size: 0;
112
142
  text-align: start;
113
143
  display: flex;
144
+ @include style-api.carriers(mixins.$carrier-tokens);
114
145
  $default-state: map.get(constants.$states, 'default');
115
146
  background: map.get($default-state, 'background');
116
147
  box-shadow: map.get($default-state, 'box-shadow');
@@ -122,10 +153,13 @@
122
153
 
123
154
  &:after {
124
155
  @include styles.base-pseudo-element;
156
+ @include mixins.inherit-border-tokens;
125
157
 
126
158
  box-shadow: none;
127
- border-block: solid map.get($default-state, 'border-width') map.get($default-state, 'border-color');
128
- border-inline: solid map.get($default-state, 'border-width') map.get($default-state, 'border-color');
159
+ $border-width: style-api.value(mixins.$border-tokens, border-width, map.get($default-state, 'border-width'));
160
+ $border-color: style-api.value(mixins.$border-tokens, border-color, map.get($default-state, 'border-color'));
161
+ border-block: solid $border-width $border-color;
162
+ border-inline: solid $border-width $border-color;
129
163
  }
130
164
 
131
165
  &.variant-default,
@@ -175,17 +209,7 @@
175
209
 
176
210
  &:has(.header-button:focus-visible),
177
211
  &:has(.overlay-button:focus-visible) {
178
- @include styles.focus-highlight(
179
- 2px,
180
- awsui.$border-radius-control-default-focus-ring,
181
- 0 0 0 2px awsui.$color-border-item-focused
182
- );
183
-
184
- @each $variant in ('embedded', 'default') {
185
- &.variant-#{$variant}::before {
186
- @include mixins.border-radius-all(awsui.$border-radius-control-default-focus-ring);
187
- }
188
- }
212
+ @include style-api.focus-highlight($gutter-block: 2px, $gutter-inline: 2px);
189
213
  }
190
214
 
191
215
  @each $variant in ('embedded', 'default') {
@@ -195,6 +219,32 @@
195
219
  @include mixins.state-border-radius($variant);
196
220
  }
197
221
 
222
+ $border-radius: style-api.value(
223
+ mixins.$carrier-tokens,
224
+ border-radius,
225
+ map.get(mixins.$variant-border-radius, $variant)
226
+ );
227
+ > .inner-card > .header,
228
+ > .inner-card > .header-row {
229
+ border-start-start-radius: $border-radius;
230
+ }
231
+ > .inner-card > .header:not(:has(+ .body)),
232
+ > .inner-card > .header-row:not(:has(+ .body)) {
233
+ border-end-start-radius: $border-radius;
234
+ }
235
+ &:not(.has-icon) > .inner-card > .header {
236
+ border-start-end-radius: $border-radius;
237
+ &:not(:has(+ .body)) {
238
+ border-end-end-radius: $border-radius;
239
+ }
240
+ }
241
+ > .inner-card > .header-row {
242
+ border-start-end-radius: $border-radius;
243
+ &:not(:has(+ .body)) {
244
+ border-end-end-radius: $border-radius;
245
+ }
246
+ }
247
+
198
248
  $padding-block: map.get(mixins.$variant-padding-block, $variant);
199
249
  $padding-inline: map.get(mixins.$variant-padding-inline, $variant);
200
250
 
@@ -211,6 +211,9 @@ $tokens: style-api.resolve(style-api.$focus-ring, carrier);
211
211
  }
212
212
 
213
213
  &.variant-inline-link {
214
+ text-decoration-line: awsui.$font-decoration-line-button-inline-link;
215
+ text-underline-offset: 3.5px;
216
+
214
217
  > .icon-left {
215
218
  inset-inline-start: 0;
216
219
  margin-inline-end: awsui.$space-xs;
@@ -4,7 +4,6 @@
4
4
  */
5
5
 
6
6
  @use '../internal/styles/tokens' as awsui;
7
- @use './motion';
8
7
  @use '../internal/styles/style-api' as style-api;
9
8
 
10
9
  @include style-api.docs-forward('copyButton', 'button', 'root');
@@ -14,46 +13,6 @@
14
13
  display: contents;
15
14
  }
16
15
 
17
- .icon-swap {
18
- position: absolute;
19
- inset: 0;
20
- }
21
-
22
- .icon-swap-copy {
23
- opacity: 1;
24
- transform: scale(1);
25
- @include motion.entering-with-motion;
26
- }
27
-
28
- .icon-swap-result {
29
- opacity: 0;
30
- transform: scale(0);
31
- @include motion.exiting-with-motion;
32
- }
33
-
34
- .icon-swap > .icon-swap-copy,
35
- .icon-swap > .icon-swap-result {
36
- position: absolute;
37
- inset-block-start: 0;
38
- inset-inline-start: 0;
39
- }
40
-
41
- .icon-swap-copied > .icon-swap-copy {
42
- opacity: 0;
43
- transform: scale(0);
44
- @include motion.exiting-with-motion;
45
- }
46
-
47
- .icon-swap-copied > .icon-swap-result {
48
- opacity: 1;
49
- transform: scale(1);
50
- @include motion.entering-with-motion;
51
- }
52
-
53
- .popover-message {
54
- display: inline;
55
- }
56
-
57
16
  .inline-container {
58
17
  word-break: break-all;
59
18
 
@@ -30,16 +30,20 @@ $_opted-in: 'svg[#{$_animated-attribute}]';
30
30
 
31
31
  // Opt-in attribute for which element triggers hover motion.
32
32
  $_trigger-attribute: 'data-awsui-motion-trigger';
33
- $_hover-trigger: '[#{$_trigger-attribute}~="hover"]#{$_enabled-only}';
33
+ $_hover-trigger: '[#{$_trigger-attribute}~="hover"]';
34
34
  // A focus owner that plays the motion of icons inside it.
35
- $_focus-trigger: '[#{$_trigger-attribute}~="focus"]#{$_enabled-only}';
35
+ $_focus-trigger: '[#{$_trigger-attribute}~="focus"]';
36
36
  // A trigger whose focus owner is nested and does not contain the icon (e.g. action card).
37
37
  // Matches `:focus-within` during keyboard interaction (the `useFocusVisible` body attribute that
38
38
  // focus rings use) instead of `:has(:focus-visible)`: a non-subject `:has()` is costly on every
39
39
  // style recalc and DOM insert. `:where(body... *)` keeps it independent of where the theme class is.
40
- $_delegated-focus-trigger: '[#{$_trigger-attribute}~="delegated-focus"]#{$_enabled-only}';
40
+ $_delegated-focus-trigger: '[#{$_trigger-attribute}~="delegated-focus"]';
41
41
  $_keyboard-focus-within: ':focus-within:where(body[data-awsui-focus-visible="true"] *)';
42
42
 
43
+ // Every trigger state in one selector, since a selector per state repeats the long prefix in
44
+ // every rule. The arms have equal specificity, so the cascade is the same as separate selectors.
45
+ $_active-trigger: ':is(#{$_hover-trigger}:is(:hover, :focus-visible), #{$_focus-trigger}:focus-visible, #{$_delegated-focus-trigger}#{$_keyboard-focus-within})#{$_enabled-only}';
46
+
43
47
  // Opt-in attribute for where the motion should be applied within a trigger region.
44
48
  $_target-attribute: 'data-awsui-motion-target';
45
49
  $_animating-icon: ':is([#{$_target-attribute}], :where([#{$_target-attribute}] *))';
@@ -1588,13 +1592,8 @@ $icon-hover-motion: (
1588
1592
  }
1589
1593
  }
1590
1594
 
1591
- // Also fires on :focus-visible of the trigger, of a focus owner around the icon, or of a
1592
- // focus owner nested inside a delegated-focus trigger.
1593
1595
  @mixin _on-hover-trigger($suffix) {
1594
- #{'#{$_hover-trigger}:hover #{$suffix}'},
1595
- #{'#{$_hover-trigger}:focus-visible #{$suffix}'},
1596
- #{'#{$_focus-trigger}:focus-visible #{$suffix}'},
1597
- #{'#{$_delegated-focus-trigger}#{$_keyboard-focus-within} #{$suffix}'} {
1596
+ #{'#{$_active-trigger} #{$suffix}'} {
1598
1597
  @content;
1599
1598
  }
1600
1599
  }
@@ -1658,63 +1657,102 @@ $icon-hover-motion: (
1658
1657
  }
1659
1658
  }
1660
1659
 
1660
+ @function _rest-declarations($spec) {
1661
+ $declarations: ();
1662
+ @if map.get($spec, to) {
1663
+ $declarations: map.merge(
1664
+ $declarations,
1665
+ (
1666
+ transition-property: map.get($spec, property) or transform,
1667
+ transition-duration: map.get($spec, duration),
1668
+ transition-timing-function: map.get($spec, easing),
1669
+ )
1670
+ );
1671
+ }
1672
+ @if map.get($spec, base) {
1673
+ $declarations: map.merge($declarations, map.get($spec, base));
1674
+ }
1675
+ @if map.get($spec, origin) {
1676
+ $declarations: map.set($declarations, transform-origin, map.get($spec, origin));
1677
+ }
1678
+ @return $declarations;
1679
+ }
1680
+
1681
+ @function _hover-declarations($spec) {
1682
+ $animation: map.get($spec, animation);
1683
+ @if not $animation {
1684
+ @return map.get($spec, to) or ();
1685
+ }
1686
+
1687
+ $declarations: (
1688
+ animation-name: $animation,
1689
+ animation-duration: map.get($spec, duration),
1690
+ animation-timing-function: map.get($spec, easing),
1691
+ );
1692
+ $iterations: map.get($spec, iterations) or 1;
1693
+ $fill: map.get($spec, fill) or none;
1694
+ $delay: map.get($spec, delay) or 0s;
1695
+ @if $iterations != 1 {
1696
+ $declarations: map.set($declarations, animation-iteration-count, $iterations);
1697
+ }
1698
+ @if $fill != none {
1699
+ $declarations: map.set($declarations, animation-fill-mode, $fill);
1700
+ }
1701
+ @if $delay != 0s {
1702
+ $declarations: map.set($declarations, animation-delay, $delay);
1703
+ }
1704
+ @return $declarations;
1705
+ }
1706
+
1707
+ // Appends `.name-$name` to the list stored under `$key`, creating the list if needed.
1708
+ @function _add-name($groups, $key, $name) {
1709
+ $names: map.get($groups, $key) or ();
1710
+ @return map.set($groups, $key, list.append($names, '.name-#{$name}', comma));
1711
+ }
1712
+
1713
+ @function _names-selector($names) {
1714
+ @if list.length($names) == 1 {
1715
+ @return list.nth($names, 1);
1716
+ }
1717
+ @return ':is(#{$names})';
1718
+ }
1719
+
1720
+ // Icons whose specs produce the same declarations on the same part share a rule, so each
1721
+ // distinct motion emits the long trigger and theme prefix once rather than once per icon.
1722
+ // An icon has a single name class, so merging rules across icons cannot change the cascade.
1661
1723
  @mixin per-icon-hover-motion {
1724
+ $rest-groups: ();
1725
+ $hover-groups: ();
1726
+
1662
1727
  @each $name, $specs in $icon-hover-motion {
1663
1728
  @each $spec in _specs($specs) {
1664
- $part: map.get($spec, part);
1665
- $target: _target($part);
1666
- $to: map.get($spec, to);
1667
- $animation: map.get($spec, animation);
1668
- $duration: map.get($spec, duration);
1669
- $easing: map.get($spec, easing);
1670
- $base: map.get($spec, base);
1671
- $origin: map.get($spec, origin);
1672
-
1673
- $property: map.get($spec, property) or transform;
1674
- $iterations: map.get($spec, iterations) or 1;
1675
- $fill: map.get($spec, fill) or none;
1676
- $delay: map.get($spec, delay) or 0s;
1677
-
1678
- @if $to or $base or $origin {
1679
- .icon.name-#{$name} #{$target} {
1680
- @include with-motion {
1681
- @if $to {
1682
- transition-property: #{$property};
1683
- transition-duration: $duration;
1684
- transition-timing-function: $easing;
1685
- }
1686
- @if $base {
1687
- @each $property, $value in $base {
1688
- #{$property}: #{$value};
1689
- }
1690
- }
1691
- @if $origin {
1692
- transform-origin: $origin;
1693
- }
1694
- }
1729
+ $target: _target(map.get($spec, part));
1730
+ $rest: _rest-declarations($spec);
1731
+ $hover: _hover-declarations($spec);
1732
+ @if list.length($rest) > 0 {
1733
+ $rest-groups: _add-name($rest-groups, ($target, $rest), $name);
1734
+ }
1735
+ @if list.length($hover) > 0 {
1736
+ $hover-groups: _add-name($hover-groups, ($target, $hover), $name);
1737
+ }
1738
+ }
1739
+ }
1740
+
1741
+ @each $key, $names in $rest-groups {
1742
+ .icon#{_names-selector($names)} #{list.nth($key, 1)} {
1743
+ @include with-motion {
1744
+ @each $property, $value in list.nth($key, 2) {
1745
+ #{$property}: #{$value};
1695
1746
  }
1696
1747
  }
1748
+ }
1749
+ }
1697
1750
 
1698
- @include _on-hover-trigger('.icon#{$_animating-icon}.name-#{$name} #{$target}') {
1699
- @include with-motion {
1700
- @if $animation {
1701
- animation-name: $animation;
1702
- animation-duration: $duration;
1703
- animation-timing-function: $easing;
1704
- @if $iterations != 1 {
1705
- animation-iteration-count: $iterations;
1706
- }
1707
- @if $fill != none {
1708
- animation-fill-mode: $fill;
1709
- }
1710
- @if $delay != 0s {
1711
- animation-delay: $delay;
1712
- }
1713
- } @else if $to {
1714
- @each $property, $value in $to {
1715
- #{$property}: #{$value};
1716
- }
1717
- }
1751
+ @each $key, $names in $hover-groups {
1752
+ @include _on-hover-trigger('.icon#{$_animating-icon}#{_names-selector($names)} #{list.nth($key, 1)}') {
1753
+ @include with-motion {
1754
+ @each $property, $value in list.nth($key, 2) {
1755
+ #{$property}: #{$value};
1718
1756
  }
1719
1757
  }
1720
1758
  }
@@ -0,0 +1,10 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ // For a scroller whose horizontal scrollbar is replaced by the sticky scrollbar.
5
+ @mixin hidden-scrollbar {
6
+ scrollbar-width: none; /* Firefox */
7
+ &::-webkit-scrollbar {
8
+ display: none; /* Safari and Chrome */
9
+ }
10
+ }
@@ -2,8 +2,8 @@
2
2
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- @use '../../internal/styles/tokens' as awsui;
6
- @use '../../internal/styles' as styles;
5
+ @use '../../styles/tokens' as awsui;
6
+ @use '../../styles' as styles;
7
7
 
8
8
  .sticky-scrollbar {
9
9
  block-size: 15px;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "1a6b6c2b";
3
+ $awsui-commit-hash: "d25043b3";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-8i8exb;
6
6
  $minContentWidth: --awsui-min-content-width-8i8exb;
@@ -9,8 +9,43 @@
9
9
  @use '../internal/styles' as styles;
10
10
  @use '../internal/styles/tokens' as awsui;
11
11
  @use '../internal/generated/custom-css-properties/index.scss' as custom-props;
12
+ @use '../internal/styles/style-api' as style-api;
12
13
  @use './motion';
13
14
 
15
+ $border-tokens: style-api.resolve((border-color, border-width), public);
16
+ // A carrier, because the nested `.inner-card` reads the radius.
17
+ $radius-tokens: style-api.resolve((border-radius), carrier);
18
+ @include style-api.register($border-tokens, $radius-tokens);
19
+ @include style-api.docs(
20
+ 'root',
21
+ map.merge($border-tokens, $radius-tokens),
22
+ $properties: (background, box-shadow),
23
+ $descriptions: (
24
+ slot:
25
+ 'The card box. The header, content and footer contents are your own elements; use `disableHeaderPaddings`, `disableContentPaddings` and `disableFooterPaddings` to let them fill their section.',
26
+ tokens: (
27
+ border-color: 'The border is drawn over the card edges and takes no space.',
28
+ border-width: 'The border is drawn over the card edges and takes no space.',
29
+ border-radius: 'Also rounds the header and footer corners.',
30
+ )
31
+ )
32
+ );
33
+ @include style-api.docs(
34
+ 'header',
35
+ $properties: (background, border),
36
+ $descriptions: (
37
+ slot:
38
+ 'Rendered when `header`, `description`, `icon` or `actions` is set. The block-end border is the divider between the header and the content.'
39
+ )
40
+ );
41
+ @include style-api.docs(
42
+ 'footer',
43
+ $properties: (background, border),
44
+ $descriptions: (
45
+ slot: 'Rendered when `footer` is set. The block-start border is the divider between the content and the footer.'
46
+ )
47
+ );
48
+
14
49
  // Variant configuration maps — adjust values here for easy customization
15
50
  $variant-border-radius: (
16
51
  'embedded': awsui.$border-radius-item-card-embedded,
@@ -30,15 +65,48 @@ $variant-padding-inline: (
30
65
  $action-padding-vertical: awsui.$space-scaled-xxs;
31
66
  $action-padding-horizontal: awsui.$space-xxs;
32
67
 
33
- @mixin apply-border-radius($variant: 'default') {
68
+ @function border-radius($variant) {
34
69
  $radius: map.get($variant-border-radius, $variant);
35
- border-start-start-radius: var(#{custom-props.$styleItemCardBorderRadius}, $radius);
36
- border-start-end-radius: var(#{custom-props.$styleItemCardBorderRadius}, $radius);
37
- border-end-start-radius: var(#{custom-props.$styleItemCardBorderRadius}, $radius);
38
- border-end-end-radius: var(#{custom-props.$styleItemCardBorderRadius}, $radius);
70
+ @return style-api.value($radius-tokens, border-radius, var(#{custom-props.$styleItemCardBorderRadius}, #{$radius}));
71
+ }
72
+
73
+ @mixin apply-border-radius($variant: 'default') {
74
+ $radius: border-radius($variant);
75
+ border-start-start-radius: $radius;
76
+ border-start-end-radius: $radius;
77
+ border-end-start-radius: $radius;
78
+ border-end-end-radius: $radius;
79
+ }
80
+
81
+ @mixin inherit-start-radius {
82
+ border-start-start-radius: inherit;
83
+ border-start-end-radius: inherit;
84
+ }
85
+
86
+ @mixin inherit-end-radius {
87
+ border-end-start-radius: inherit;
88
+ border-end-end-radius: inherit;
89
+ }
90
+
91
+ @function border-width($fallback) {
92
+ @return style-api.value(
93
+ $border-tokens,
94
+ border-width,
95
+ var(#{custom-props.$styleItemCardBorderWidthDefault}, #{$fallback})
96
+ );
97
+ }
98
+
99
+ @function border-color($fallback) {
100
+ @return style-api.value(
101
+ $border-tokens,
102
+ border-color,
103
+ var(#{custom-props.$styleItemCardBorderColorDefault}, #{$fallback})
104
+ );
39
105
  }
40
106
 
41
107
  .header {
108
+ // Solid on the divider side only, so a consumer border draws only the divider; zero width keeps the default.
109
+ border-block-end: 0 solid transparent;
42
110
  &-inner {
43
111
  @include styles.font-heading-s;
44
112
  }
@@ -52,12 +120,15 @@ $action-padding-horizontal: awsui.$space-xxs;
52
120
  }
53
121
 
54
122
  .footer {
123
+ // Solid on the divider side only, so a consumer border draws only the divider; zero width keeps the default.
124
+ border-block-start: 0 solid transparent;
55
125
  &:first-child {
56
126
  margin-block-start: auto;
57
127
  }
58
128
  }
59
129
 
60
130
  .root {
131
+ @include style-api.carriers($radius-tokens);
61
132
  @include styles.styles-reset();
62
133
  box-sizing: border-box;
63
134
  position: relative;
@@ -67,12 +138,15 @@ $action-padding-horizontal: awsui.$space-xxs;
67
138
 
68
139
  &:before {
69
140
  @include styles.base-pseudo-element;
141
+ @if style-api.enabled() {
142
+ // Public tokens do not inherit, so `::before` takes them from the root.
143
+ --awsui-style-border-color: inherit;
144
+ --awsui-style-border-width: inherit;
145
+ }
70
146
  box-shadow: none;
71
147
  border-color: transparent;
72
- border-block: solid var(#{custom-props.$styleItemCardBorderWidthDefault}, awsui.$border-width-item-card)
73
- var(#{custom-props.$styleItemCardBorderColorDefault}, awsui.$color-border-item-card);
74
- border-inline: solid var(#{custom-props.$styleItemCardBorderWidthDefault}, awsui.$border-width-item-card)
75
- var(#{custom-props.$styleItemCardBorderColorDefault}, awsui.$color-border-item-card);
148
+ border-block: solid border-width(awsui.$border-width-item-card) border-color(awsui.$color-border-item-card);
149
+ border-inline: solid border-width(awsui.$border-width-item-card) border-color(awsui.$color-border-item-card);
76
150
  }
77
151
 
78
152
  &::after {
@@ -80,16 +154,18 @@ $action-padding-horizontal: awsui.$space-xxs;
80
154
  }
81
155
 
82
156
  &:not(.refresh)::before {
83
- border-block-start: solid var(#{custom-props.$styleItemCardBorderWidthDefault}, awsui.$border-container-top-width)
84
- var(#{custom-props.$styleItemCardBorderColorDefault}, awsui.$color-border-container-top);
157
+ border-block-start: solid border-width(awsui.$border-container-top-width)
158
+ border-color(awsui.$color-border-container-top);
85
159
  }
86
160
 
87
161
  &.highlighted {
88
162
  background: awsui.$color-background-item-selected;
89
163
 
90
164
  &:before {
91
- border-block: solid awsui.$border-width-card-selected awsui.$color-border-item-card-highlighted;
92
- border-inline: solid awsui.$border-width-card-selected awsui.$color-border-item-card-highlighted;
165
+ border-block: solid style-api.value($border-tokens, border-width, awsui.$border-width-card-selected)
166
+ style-api.value($border-tokens, border-color, awsui.$color-border-item-card-highlighted);
167
+ border-inline: solid style-api.value($border-tokens, border-width, awsui.$border-width-card-selected)
168
+ style-api.value($border-tokens, border-color, awsui.$color-border-item-card-highlighted);
93
169
  }
94
170
  }
95
171
 
@@ -128,6 +204,20 @@ $action-padding-horizontal: awsui.$space-xxs;
128
204
  @include apply-border-radius($variant);
129
205
  }
130
206
 
207
+ // So a header or footer background stays inside the rounded card.
208
+ > .inner-card > .header {
209
+ @include inherit-start-radius;
210
+ &:last-child {
211
+ @include inherit-end-radius;
212
+ }
213
+ }
214
+ > .inner-card > .footer {
215
+ @include inherit-end-radius;
216
+ &:first-child {
217
+ @include inherit-start-radius;
218
+ }
219
+ }
220
+
131
221
  $padding-block: map.get($variant-padding-block, $variant);
132
222
  $padding-inline: map.get($variant-padding-inline, $variant);
133
223
 
@@ -6,6 +6,7 @@
6
6
  @use '../internal/styles/index' as styles;
7
7
  @use '../internal/styles/tokens' as awsui;
8
8
  @use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
9
+ @use '../internal/components/sticky-scrollbar/mixins' as sticky-scrollbar;
9
10
 
10
11
  .root {
11
12
  @include styles.styles-reset;
@@ -16,8 +17,10 @@
16
17
  background: awsui.$color-background-container-content;
17
18
  }
18
19
 
20
+ // Its scrollbar is hidden in favour of the sticky scrollbar, which stays reachable however tall the body is.
19
21
  .body-scroller {
20
22
  overflow-x: auto;
23
+ @include sticky-scrollbar.hidden-scrollbar;
21
24
  @include focus-visible.when-visible {
22
25
  @include styles.container-focus();
23
26
  }
@@ -8,7 +8,6 @@
8
8
  @use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
9
9
 
10
10
  @use './tab-header-bar';
11
- @use './motion';
12
11
 
13
12
  .root {
14
13
  /* used in test-utils or tests */