@cloudscape-design/components-themeable 3.0.109 → 3.0.111

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 (96) hide show
  1. package/lib/internal/scss/app-layout/visual-refresh/app-bar.scss +11 -2
  2. package/lib/internal/scss/app-layout/visual-refresh/background.scss +6 -9
  3. package/lib/internal/scss/app-layout/visual-refresh/navigation.scss +13 -0
  4. package/lib/internal/scss/app-layout/visual-refresh/split-panel.scss +1 -0
  5. package/lib/internal/scss/app-layout/visual-refresh/tools.scss +4 -0
  6. package/lib/internal/scss/app-layout/visual-refresh/trigger-button.scss +2 -0
  7. package/lib/internal/scss/container/styles.scss +15 -1
  8. package/lib/internal/scss/split-panel/icons/icons-styles.scss +4 -1
  9. package/lib/internal/scss/table/header-cell/styles.scss +3 -3
  10. package/lib/internal/scss/table/styles.scss +11 -3
  11. package/lib/internal/template/app-layout/visual-refresh/app-bar.d.ts.map +1 -1
  12. package/lib/internal/template/app-layout/visual-refresh/app-bar.js +2 -1
  13. package/lib/internal/template/app-layout/visual-refresh/app-bar.js.map +1 -1
  14. package/lib/internal/template/app-layout/visual-refresh/background.d.ts.map +1 -1
  15. package/lib/internal/template/app-layout/visual-refresh/background.js +7 -4
  16. package/lib/internal/template/app-layout/visual-refresh/background.js.map +1 -1
  17. package/lib/internal/template/app-layout/visual-refresh/context.d.ts +2 -0
  18. package/lib/internal/template/app-layout/visual-refresh/context.d.ts.map +1 -1
  19. package/lib/internal/template/app-layout/visual-refresh/context.js +23 -18
  20. package/lib/internal/template/app-layout/visual-refresh/context.js.map +1 -1
  21. package/lib/internal/template/app-layout/visual-refresh/styles.css.js +60 -59
  22. package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +175 -152
  23. package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +60 -59
  24. package/lib/internal/template/cards/index.d.ts.map +1 -1
  25. package/lib/internal/template/cards/index.js +1 -1
  26. package/lib/internal/template/cards/index.js.map +1 -1
  27. package/lib/internal/template/container/internal.d.ts +2 -1
  28. package/lib/internal/template/container/internal.d.ts.map +1 -1
  29. package/lib/internal/template/container/internal.js +21 -6
  30. package/lib/internal/template/container/internal.js.map +1 -1
  31. package/lib/internal/template/container/styles.css.js +16 -16
  32. package/lib/internal/template/container/styles.scoped.css +36 -26
  33. package/lib/internal/template/container/styles.selectors.js +16 -16
  34. package/lib/internal/template/internal/environment.js +1 -1
  35. package/lib/internal/template/internal/hooks/forward-focus/radio-group.d.ts +12 -0
  36. package/lib/internal/template/internal/hooks/forward-focus/radio-group.d.ts.map +1 -0
  37. package/lib/internal/template/internal/hooks/forward-focus/radio-group.js +27 -0
  38. package/lib/internal/template/internal/hooks/forward-focus/radio-group.js.map +1 -0
  39. package/lib/internal/template/radio-group/index.d.ts +3 -1
  40. package/lib/internal/template/radio-group/index.d.ts.map +1 -1
  41. package/lib/internal/template/radio-group/index.js +4 -3
  42. package/lib/internal/template/radio-group/index.js.map +1 -1
  43. package/lib/internal/template/radio-group/interfaces.d.ts +6 -0
  44. package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
  45. package/lib/internal/template/radio-group/interfaces.js.map +1 -1
  46. package/lib/internal/template/radio-group/internal.d.ts +3 -3
  47. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  48. package/lib/internal/template/radio-group/internal.js +6 -3
  49. package/lib/internal/template/radio-group/internal.js.map +1 -1
  50. package/lib/internal/template/split-panel/icons/bottom-icon-refresh.d.ts.map +1 -1
  51. package/lib/internal/template/split-panel/icons/bottom-icon-refresh.js +6 -9
  52. package/lib/internal/template/split-panel/icons/bottom-icon-refresh.js.map +1 -1
  53. package/lib/internal/template/split-panel/icons/side-position-refresh.d.ts +1 -0
  54. package/lib/internal/template/split-panel/icons/side-position-refresh.d.ts.map +1 -1
  55. package/lib/internal/template/split-panel/icons/side-position-refresh.js +6 -9
  56. package/lib/internal/template/split-panel/icons/side-position-refresh.js.map +1 -1
  57. package/lib/internal/template/split-panel/styles.css.js +59 -58
  58. package/lib/internal/template/split-panel/styles.scoped.css +84 -81
  59. package/lib/internal/template/split-panel/styles.selectors.js +59 -58
  60. package/lib/internal/template/table/header-cell/index.d.ts +2 -1
  61. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  62. package/lib/internal/template/table/header-cell/index.js +2 -1
  63. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  64. package/lib/internal/template/table/header-cell/styles.css.js +16 -15
  65. package/lib/internal/template/table/header-cell/styles.scoped.css +26 -26
  66. package/lib/internal/template/table/header-cell/styles.selectors.js +16 -15
  67. package/lib/internal/template/table/internal.d.ts.map +1 -1
  68. package/lib/internal/template/table/internal.js +7 -3
  69. package/lib/internal/template/table/internal.js.map +1 -1
  70. package/lib/internal/template/table/sticky-header.d.ts +1 -0
  71. package/lib/internal/template/table/sticky-header.d.ts.map +1 -1
  72. package/lib/internal/template/table/sticky-header.js +2 -1
  73. package/lib/internal/template/table/sticky-header.js.map +1 -1
  74. package/lib/internal/template/table/styles.css.js +34 -32
  75. package/lib/internal/template/table/styles.scoped.css +47 -39
  76. package/lib/internal/template/table/styles.selectors.js +34 -32
  77. package/lib/internal/template/table/thead.d.ts.map +1 -1
  78. package/lib/internal/template/table/thead.js +3 -3
  79. package/lib/internal/template/table/thead.js.map +1 -1
  80. package/lib/internal/template/tiles/index.d.ts +3 -1
  81. package/lib/internal/template/tiles/index.d.ts.map +1 -1
  82. package/lib/internal/template/tiles/index.js +4 -3
  83. package/lib/internal/template/tiles/index.js.map +1 -1
  84. package/lib/internal/template/tiles/interfaces.d.ts +6 -0
  85. package/lib/internal/template/tiles/interfaces.d.ts.map +1 -1
  86. package/lib/internal/template/tiles/interfaces.js.map +1 -1
  87. package/lib/internal/template/tiles/internal.d.ts +3 -3
  88. package/lib/internal/template/tiles/internal.d.ts.map +1 -1
  89. package/lib/internal/template/tiles/internal.js +24 -21
  90. package/lib/internal/template/tiles/internal.js.map +1 -1
  91. package/lib/internal/template/tiles/tile.d.ts +2 -1
  92. package/lib/internal/template/tiles/tile.d.ts.map +1 -1
  93. package/lib/internal/template/tiles/tile.js +7 -5
  94. package/lib/internal/template/tiles/tile.js.map +1 -1
  95. package/lib/manifest.json +3 -0
  96. package/package.json +1 -1
@@ -94,7 +94,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_root_wih1l_2te74_97:not(#\9) {
97
+ .awsui_root_wih1l_r2zh7_97:not(#\9) {
98
98
  font-size: var(--font-body-m-size-sregvd, 14px);
99
99
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
100
100
  color: var(--color-text-body-default-7m2b3r, #16191f);
@@ -103,44 +103,44 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
103
103
  width: 100%;
104
104
  }
105
105
 
106
- .awsui_tools_wih1l_2te74_106:not(#\9) {
106
+ .awsui_tools_wih1l_r2zh7_106:not(#\9) {
107
107
  display: flex;
108
108
  align-items: flex-start;
109
109
  flex-wrap: wrap;
110
110
  padding: var(--space-scaled-xs-6859qs, 8px) 0 var(--space-scaled-xxs-95dhkm, 4px);
111
111
  }
112
- .awsui_tools-filtering_wih1l_2te74_112:not(#\9) {
112
+ .awsui_tools-filtering_wih1l_r2zh7_112:not(#\9) {
113
113
  flex: 1 1 0%;
114
114
  max-width: 100%;
115
115
  margin-right: var(--space-l-4vl6xu, 20px);
116
116
  }
117
- .awsui_tools-align-right_wih1l_2te74_117:not(#\9) {
117
+ .awsui_tools-align-right_wih1l_r2zh7_117:not(#\9) {
118
118
  display: flex;
119
119
  margin-left: auto;
120
120
  }
121
- .awsui_tools-pagination_wih1l_2te74_121 + .awsui_tools-preferences_wih1l_2te74_121:not(#\9) {
121
+ .awsui_tools-pagination_wih1l_r2zh7_121 + .awsui_tools-preferences_wih1l_r2zh7_121:not(#\9) {
122
122
  border-left: var(--border-divider-section-width-5a4cv1, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
123
123
  box-sizing: border-box;
124
124
  margin-left: var(--space-xs-rsr2qu, 8px);
125
125
  padding-left: var(--space-xs-rsr2qu, 8px);
126
126
  }
127
- .awsui_tools-small_wih1l_2te74_127 > .awsui_tools-filtering_wih1l_2te74_112:not(#\9) {
127
+ .awsui_tools-small_wih1l_r2zh7_127 > .awsui_tools-filtering_wih1l_r2zh7_112:not(#\9) {
128
128
  margin-right: 0;
129
129
  margin-bottom: var(--space-scaled-xs-6859qs, 8px);
130
130
  flex-basis: 100%;
131
131
  }
132
132
 
133
- .awsui_table_wih1l_2te74_133:not(#\9) {
133
+ .awsui_table_wih1l_r2zh7_133:not(#\9) {
134
134
  width: 100%;
135
135
  border-spacing: 0;
136
136
  position: relative;
137
137
  box-sizing: border-box;
138
138
  }
139
- .awsui_table-layout-fixed_wih1l_2te74_139:not(#\9) {
139
+ .awsui_table-layout-fixed_wih1l_r2zh7_139:not(#\9) {
140
140
  table-layout: fixed;
141
141
  }
142
142
 
143
- .awsui_wrapper_wih1l_2te74_143:not(#\9) {
143
+ .awsui_wrapper_wih1l_r2zh7_143:not(#\9) {
144
144
  position: relative;
145
145
  box-sizing: border-box;
146
146
  width: 100%;
@@ -150,31 +150,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
150
150
  border-top-right-radius: var(--border-radius-container-1aveko, 0px);
151
151
  border-top-left-radius: var(--border-radius-container-1aveko, 0px);
152
152
  }
153
- .awsui_wrapper_wih1l_2te74_143.awsui_variant-stacked_wih1l_2te74_153 > .awsui_table_wih1l_2te74_133:not(#\9), .awsui_wrapper_wih1l_2te74_143.awsui_variant-container_wih1l_2te74_153 > .awsui_table_wih1l_2te74_133:not(#\9) {
153
+ .awsui_wrapper_wih1l_r2zh7_143.awsui_variant-stacked_wih1l_r2zh7_153 > .awsui_table_wih1l_r2zh7_133:not(#\9), .awsui_wrapper_wih1l_r2zh7_143.awsui_variant-container_wih1l_r2zh7_153 > .awsui_table_wih1l_r2zh7_133:not(#\9) {
154
154
  padding-left: var(--space-table-horizontal-njdbej, 0px);
155
155
  padding-right: var(--space-table-horizontal-njdbej, 0px);
156
156
  }
157
- .awsui_wrapper_wih1l_2te74_143.awsui_variant-embedded_wih1l_2te74_157:not(#\9) {
157
+ .awsui_wrapper_wih1l_r2zh7_143.awsui_variant-embedded_wih1l_r2zh7_157:not(#\9) {
158
158
  padding-bottom: var(--space-table-embedded-content-bottom-7vc5vt, 0px);
159
159
  }
160
- .awsui_wrapper_wih1l_2te74_143.awsui_has-header_wih1l_2te74_160:not(#\9) {
160
+ .awsui_wrapper_wih1l_r2zh7_143.awsui_has-header_wih1l_r2zh7_160:not(#\9) {
161
161
  padding-top: 0px;
162
162
  }
163
- .awsui_wrapper_wih1l_2te74_143.awsui_has-footer_wih1l_2te74_163:not(#\9) {
163
+ .awsui_wrapper_wih1l_r2zh7_143.awsui_has-footer_wih1l_r2zh7_163:not(#\9) {
164
164
  padding-bottom: 0px;
165
165
  }
166
- .awsui_wrapper_wih1l_2te74_143[data-awsui-focus-visible=true]:not(#\9):focus {
166
+ .awsui_wrapper_wih1l_r2zh7_143[data-awsui-focus-visible=true]:not(#\9):focus {
167
167
  outline: 2px dotted transparent;
168
168
  outline-offset: 2px;
169
169
  border-radius: var(--border-radius-container-1aveko, 0px);
170
170
  box-shadow: 0 0 0 2px var(--color-border-item-focused-n5kd8g, #0073bb);
171
171
  }
172
172
 
173
- .awsui_cell-merged_wih1l_2te74_173:not(#\9) {
173
+ .awsui_cell-merged_wih1l_r2zh7_173:not(#\9) {
174
174
  text-align: center;
175
175
  padding: 0;
176
176
  }
177
- .awsui_cell-merged-content_wih1l_2te74_177:not(#\9) {
177
+ .awsui_cell-merged-content_wih1l_r2zh7_177:not(#\9) {
178
178
  box-sizing: border-box;
179
179
  width: 100%;
180
180
  padding: var(--space-scaled-m-pv0fmt, 16px) var(--space-l-4vl6xu, 20px) var(--space-scaled-l-t03y3z, 20px);
@@ -182,34 +182,34 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
182
182
  /* stylelint-enable plugin/no-unsupported-browser-features */
183
183
  }
184
184
  @supports (position: sticky) {
185
- .awsui_cell-merged-content_wih1l_2te74_177:not(#\9) {
185
+ .awsui_cell-merged-content_wih1l_r2zh7_177:not(#\9) {
186
186
  position: sticky;
187
187
  left: 0;
188
188
  margin: 0 calc(-2 * var(--space-table-horizontal-njdbej, 0px));
189
189
  }
190
190
  }
191
191
 
192
- .awsui_empty_wih1l_2te74_192:not(#\9) {
192
+ .awsui_empty_wih1l_r2zh7_192:not(#\9) {
193
193
  color: var(--color-text-empty-izapdt, #687078);
194
194
  }
195
195
 
196
- .awsui_loading_wih1l_2te74_196:not(#\9) {
196
+ .awsui_loading_wih1l_r2zh7_196:not(#\9) {
197
197
  /* used in test-utils */
198
198
  }
199
199
 
200
- .awsui_selection-control_wih1l_2te74_200:not(#\9) {
200
+ .awsui_selection-control_wih1l_r2zh7_200:not(#\9) {
201
201
  position: relative;
202
202
  box-sizing: border-box;
203
203
  width: 54px;
204
204
  max-width: 54px;
205
205
  min-width: 54px;
206
206
  }
207
- .awsui_selection-control_wih1l_2te74_200.awsui_selection-control-header_wih1l_2te74_207:not(#\9) {
207
+ .awsui_selection-control_wih1l_r2zh7_200.awsui_selection-control-header_wih1l_r2zh7_207:not(#\9) {
208
208
  padding: var(--space-scaled-xs-6859qs, 8px) var(--space-scaled-l-t03y3z, 20px);
209
209
  border-left: var(--border-item-width-yvnixs, 1px) solid transparent;
210
210
  }
211
211
 
212
- .awsui_sticky-scrollbar_wih1l_2te74_212:not(#\9) {
212
+ .awsui_sticky-scrollbar_wih1l_r2zh7_212:not(#\9) {
213
213
  height: 15px;
214
214
  position: fixed;
215
215
  display: none;
@@ -219,14 +219,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
219
219
  bottom: 0;
220
220
  width: 100%;
221
221
  }
222
- .awsui_sticky-scrollbar-content_wih1l_2te74_222:not(#\9) {
222
+ .awsui_sticky-scrollbar-content_wih1l_r2zh7_222:not(#\9) {
223
223
  height: 15px;
224
224
  }
225
- .awsui_sticky-scrollbar-visible_wih1l_2te74_225:not(#\9) {
225
+ .awsui_sticky-scrollbar-visible_wih1l_r2zh7_225:not(#\9) {
226
226
  display: block;
227
227
  }
228
228
 
229
- .awsui_header-secondary_wih1l_2te74_229:not(#\9) {
229
+ /*
230
+ The dynamic height dark header needs a background that will cover
231
+ the default white background of the container component.
232
+ */
233
+ .awsui_dark-header_wih1l_r2zh7_233:not(#\9) {
234
+ background-color: var(--color-background-layout-main-q0tbxx, #f2f3f3);
235
+ }
236
+
237
+ .awsui_header-secondary_wih1l_r2zh7_237:not(#\9) {
230
238
  overflow: auto;
231
239
  -ms-overflow-style: none;
232
240
  /* Internet Explorer 10+ */
@@ -237,50 +245,50 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
237
245
  border-radius: 0;
238
246
  background: var(--color-background-table-header-mryayf, #fafafa);
239
247
  }
240
- .awsui_header-secondary_wih1l_2te74_229.awsui_variant-stacked_wih1l_2te74_153 > .awsui_table_wih1l_2te74_133:not(#\9), .awsui_header-secondary_wih1l_2te74_229.awsui_variant-container_wih1l_2te74_153 > .awsui_table_wih1l_2te74_133:not(#\9) {
248
+ .awsui_header-secondary_wih1l_r2zh7_237.awsui_variant-stacked_wih1l_r2zh7_153 > .awsui_table_wih1l_r2zh7_133:not(#\9), .awsui_header-secondary_wih1l_r2zh7_237.awsui_variant-container_wih1l_r2zh7_153 > .awsui_table_wih1l_r2zh7_133:not(#\9) {
241
249
  padding-left: var(--space-table-horizontal-njdbej, 0px);
242
250
  padding-right: var(--space-table-horizontal-njdbej, 0px);
243
251
  }
244
- .awsui_header-secondary_wih1l_2te74_229:not(#\9)::-webkit-scrollbar {
252
+ .awsui_header-secondary_wih1l_r2zh7_237:not(#\9)::-webkit-scrollbar {
245
253
  display: none;
246
254
  /* Safari and Chrome */
247
255
  }
256
+ .awsui_header-secondary_wih1l_r2zh7_237.awsui_table-has-header_wih1l_r2zh7_256:not(#\9) {
257
+ border-top: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-container-divider-z203b8, #eaeded);
258
+ }
248
259
 
249
- .awsui_header-controls_wih1l_2te74_249:not(#\9) {
260
+ .awsui_header-controls_wih1l_r2zh7_260:not(#\9) {
250
261
  padding-top: var(--space-container-header-vertical-0bd19u, 12px);
251
262
  padding-bottom: var(--space-container-header-vertical-0bd19u, 12px);
252
263
  }
253
- .awsui_header-controls_wih1l_2te74_249.awsui_variant-stacked_wih1l_2te74_153:not(#\9), .awsui_header-controls_wih1l_2te74_249.awsui_variant-container_wih1l_2te74_153:not(#\9) {
264
+ .awsui_header-controls_wih1l_r2zh7_260.awsui_variant-stacked_wih1l_r2zh7_153:not(#\9), .awsui_header-controls_wih1l_r2zh7_260.awsui_variant-container_wih1l_r2zh7_153:not(#\9) {
254
265
  padding-left: calc(var(--space-table-horizontal-njdbej, 0px) + var(--space-table-header-horizontal-4u689g, 20px));
255
266
  padding-right: calc(var(--space-table-horizontal-njdbej, 0px) + var(--space-table-header-horizontal-4u689g, 20px));
256
267
  }
257
- .awsui_header-controls_wih1l_2te74_249.awsui_variant-embedded_wih1l_2te74_157:not(#\9) {
268
+ .awsui_header-controls_wih1l_r2zh7_260.awsui_variant-embedded_wih1l_r2zh7_157:not(#\9) {
258
269
  padding-left: var(--space-table-header-horizontal-4u689g, 20px);
259
270
  padding-right: var(--space-table-header-horizontal-4u689g, 20px);
260
271
  padding-top: var(--space-table-embedded-header-top-1yxc8d, 12px);
261
272
  }
262
- .awsui_header-controls_wih1l_2te74_249 + .awsui_header-secondary_wih1l_2te74_229:not(#\9) {
263
- border-top: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-container-divider-z203b8, #eaeded);
264
- }
265
273
 
266
- .awsui_divider_wih1l_2te74_266:not(#\9) {
274
+ .awsui_divider_wih1l_r2zh7_274:not(#\9) {
267
275
  border: none;
268
276
  margin: 0;
269
277
  height: 0;
270
278
  border-top: var(--border-divider-section-width-5a4cv1, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
271
279
  }
272
280
 
273
- .awsui_footer-wrapper_wih1l_2te74_273.awsui_variant-stacked_wih1l_2te74_153:not(#\9), .awsui_footer-wrapper_wih1l_2te74_273.awsui_variant-container_wih1l_2te74_153:not(#\9) {
281
+ .awsui_footer-wrapper_wih1l_r2zh7_281.awsui_variant-stacked_wih1l_r2zh7_153:not(#\9), .awsui_footer-wrapper_wih1l_r2zh7_281.awsui_variant-container_wih1l_r2zh7_153:not(#\9) {
274
282
  padding-left: var(--space-table-horizontal-njdbej, 0px);
275
283
  padding-right: var(--space-table-horizontal-njdbej, 0px);
276
284
  }
277
285
 
278
- .awsui_footer_wih1l_2te74_273:not(#\9) {
286
+ .awsui_footer_wih1l_r2zh7_281:not(#\9) {
279
287
  padding: var(--space-scaled-s-cu1hzn, 12px) var(--space-table-footer-horizontal-m6qo87, 20px);
280
288
  }
281
289
 
282
- .awsui_thead-active_wih1l_2te74_282:not(#\9),
283
- .awsui_row_wih1l_2te74_283:not(#\9),
284
- .awsui_row-selected_wih1l_2te74_284:not(#\9) {
290
+ .awsui_thead-active_wih1l_r2zh7_290:not(#\9),
291
+ .awsui_row_wih1l_r2zh7_291:not(#\9),
292
+ .awsui_row-selected_wih1l_r2zh7_292:not(#\9) {
285
293
  /* used in test-utils */
286
294
  }
@@ -2,37 +2,39 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_wih1l_2te74_97",
6
- "tools": "awsui_tools_wih1l_2te74_106",
7
- "tools-filtering": "awsui_tools-filtering_wih1l_2te74_112",
8
- "tools-align-right": "awsui_tools-align-right_wih1l_2te74_117",
9
- "tools-pagination": "awsui_tools-pagination_wih1l_2te74_121",
10
- "tools-preferences": "awsui_tools-preferences_wih1l_2te74_121",
11
- "tools-small": "awsui_tools-small_wih1l_2te74_127",
12
- "table": "awsui_table_wih1l_2te74_133",
13
- "table-layout-fixed": "awsui_table-layout-fixed_wih1l_2te74_139",
14
- "wrapper": "awsui_wrapper_wih1l_2te74_143",
15
- "variant-stacked": "awsui_variant-stacked_wih1l_2te74_153",
16
- "variant-container": "awsui_variant-container_wih1l_2te74_153",
17
- "variant-embedded": "awsui_variant-embedded_wih1l_2te74_157",
18
- "has-header": "awsui_has-header_wih1l_2te74_160",
19
- "has-footer": "awsui_has-footer_wih1l_2te74_163",
20
- "cell-merged": "awsui_cell-merged_wih1l_2te74_173",
21
- "cell-merged-content": "awsui_cell-merged-content_wih1l_2te74_177",
22
- "empty": "awsui_empty_wih1l_2te74_192",
23
- "loading": "awsui_loading_wih1l_2te74_196",
24
- "selection-control": "awsui_selection-control_wih1l_2te74_200",
25
- "selection-control-header": "awsui_selection-control-header_wih1l_2te74_207",
26
- "sticky-scrollbar": "awsui_sticky-scrollbar_wih1l_2te74_212",
27
- "sticky-scrollbar-content": "awsui_sticky-scrollbar-content_wih1l_2te74_222",
28
- "sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_wih1l_2te74_225",
29
- "header-secondary": "awsui_header-secondary_wih1l_2te74_229",
30
- "header-controls": "awsui_header-controls_wih1l_2te74_249",
31
- "divider": "awsui_divider_wih1l_2te74_266",
32
- "footer-wrapper": "awsui_footer-wrapper_wih1l_2te74_273",
33
- "footer": "awsui_footer_wih1l_2te74_273",
34
- "thead-active": "awsui_thead-active_wih1l_2te74_282",
35
- "row": "awsui_row_wih1l_2te74_283",
36
- "row-selected": "awsui_row-selected_wih1l_2te74_284"
5
+ "root": "awsui_root_wih1l_r2zh7_97",
6
+ "tools": "awsui_tools_wih1l_r2zh7_106",
7
+ "tools-filtering": "awsui_tools-filtering_wih1l_r2zh7_112",
8
+ "tools-align-right": "awsui_tools-align-right_wih1l_r2zh7_117",
9
+ "tools-pagination": "awsui_tools-pagination_wih1l_r2zh7_121",
10
+ "tools-preferences": "awsui_tools-preferences_wih1l_r2zh7_121",
11
+ "tools-small": "awsui_tools-small_wih1l_r2zh7_127",
12
+ "table": "awsui_table_wih1l_r2zh7_133",
13
+ "table-layout-fixed": "awsui_table-layout-fixed_wih1l_r2zh7_139",
14
+ "wrapper": "awsui_wrapper_wih1l_r2zh7_143",
15
+ "variant-stacked": "awsui_variant-stacked_wih1l_r2zh7_153",
16
+ "variant-container": "awsui_variant-container_wih1l_r2zh7_153",
17
+ "variant-embedded": "awsui_variant-embedded_wih1l_r2zh7_157",
18
+ "has-header": "awsui_has-header_wih1l_r2zh7_160",
19
+ "has-footer": "awsui_has-footer_wih1l_r2zh7_163",
20
+ "cell-merged": "awsui_cell-merged_wih1l_r2zh7_173",
21
+ "cell-merged-content": "awsui_cell-merged-content_wih1l_r2zh7_177",
22
+ "empty": "awsui_empty_wih1l_r2zh7_192",
23
+ "loading": "awsui_loading_wih1l_r2zh7_196",
24
+ "selection-control": "awsui_selection-control_wih1l_r2zh7_200",
25
+ "selection-control-header": "awsui_selection-control-header_wih1l_r2zh7_207",
26
+ "sticky-scrollbar": "awsui_sticky-scrollbar_wih1l_r2zh7_212",
27
+ "sticky-scrollbar-content": "awsui_sticky-scrollbar-content_wih1l_r2zh7_222",
28
+ "sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_wih1l_r2zh7_225",
29
+ "dark-header": "awsui_dark-header_wih1l_r2zh7_233",
30
+ "header-secondary": "awsui_header-secondary_wih1l_r2zh7_237",
31
+ "table-has-header": "awsui_table-has-header_wih1l_r2zh7_256",
32
+ "header-controls": "awsui_header-controls_wih1l_r2zh7_260",
33
+ "divider": "awsui_divider_wih1l_r2zh7_274",
34
+ "footer-wrapper": "awsui_footer-wrapper_wih1l_r2zh7_281",
35
+ "footer": "awsui_footer_wih1l_r2zh7_281",
36
+ "thead-active": "awsui_thead-active_wih1l_r2zh7_290",
37
+ "row": "awsui_row_wih1l_r2zh7_291",
38
+ "row-selected": "awsui_row-selected_wih1l_r2zh7_292"
37
39
  };
38
40
 
@@ -1 +1 @@
1
- {"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAyB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAQvF,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,UAAU,CAAC,aAAa,GAAG,SAAS,CAAC;IACpD,iBAAiB,EAAE,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IACnE,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACzD,iBAAiB,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,cAAc,EAAE,qBAAqB,CAAC;IACtC,WAAW,EAAE,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtG,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM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AAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACtG,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,yBAAyB,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC;IACrF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,8BAA8B,CAAC,EAAE,MAAM,CAAC;CACzC;AAED,QAAA,MAAM,KAAK,wFAqGV,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -19,9 +19,9 @@ var Thead = React.forwardRef(function (_a, outerRef) {
19
19
  var _f = useColumnWidths(), columnWidths = _f.columnWidths, totalWidth = _f.totalWidth, updateColumn = _f.updateColumn;
20
20
  return (React.createElement("thead", { className: clsx(!hidden && styles['thead-active']) },
21
21
  React.createElement("tr", __assign({}, focusMarkers.all, { ref: outerRef }),
22
- selectionType === 'multi' && (React.createElement("th", { className: clsx(headerCellClass, selectionCellClass), scope: "col" },
22
+ selectionType === 'multi' && (React.createElement("th", { className: clsx(headerCellClass, selectionCellClass, hidden && headerCellStyles['header-cell-hidden']), scope: "col" },
23
23
  React.createElement(SelectionControl, __assign({ onFocusDown: function (event) { return onFocusMove(event.target, -1, +1); } }, selectAllProps, (hidden ? { tabIndex: -1 } : {}))))),
24
- selectionType === 'single' && (React.createElement("th", { className: clsx(headerCellClass, selectionCellClass), scope: "col" },
24
+ selectionType === 'single' && (React.createElement("th", { className: clsx(headerCellClass, selectionCellClass, hidden && headerCellStyles['header-cell-hidden']), scope: "col" },
25
25
  React.createElement(ScreenreaderOnly, null, singleSelectionHeaderAriaLabel))),
26
26
  columnDefinitions.map(function (column, colIndex) {
27
27
  var widthOverride;
@@ -39,7 +39,7 @@ var Thead = React.forwardRef(function (_a, outerRef) {
39
39
  width: widthOverride || column.width,
40
40
  minWidth: sticky ? undefined : column.minWidth,
41
41
  maxWidth: resizableColumns || sticky ? undefined : column.maxWidth
42
- }, tabIndex: sticky ? -1 : 0, showFocusRing: colIndex === showFocusRing, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, colIndex: colIndex, updateColumn: updateColumn, onResizeFinish: function () { return onResizeFinish(columnWidths); }, resizableColumns: resizableColumns, onClick: function (detail) { return fireNonCancelableEvent(onSortingChange, detail); }, onFocus: function () { return onCellFocus === null || onCellFocus === void 0 ? void 0 : onCellFocus(colIndex); }, onBlur: onCellBlur }));
42
+ }, tabIndex: sticky ? -1 : 0, showFocusRing: colIndex === showFocusRing, column: column, activeSortingColumn: sortingColumn, sortingDescending: sortingDescending, sortingDisabled: sortingDisabled, wrapLines: wrapLines, hidden: hidden, colIndex: colIndex, updateColumn: updateColumn, onResizeFinish: function () { return onResizeFinish(columnWidths); }, resizableColumns: resizableColumns, onClick: function (detail) { return fireNonCancelableEvent(onSortingChange, detail); }, onFocus: function () { return onCellFocus === null || onCellFocus === void 0 ? void 0 : onCellFocus(colIndex); }, onBlur: onCellBlur }));
43
43
  }))));
44
44
  });
45
45
  export default Thead;
@@ -1 +1 @@
1
- {"version":3,"file":"thead.js","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAA2C,MAAM,qBAAqB,CAAC;AAC9E,OAAO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;iBACF;gBACD,OAAO,CACL,oBAAC,eAAe,IACd,GAAG,EAAE,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,EACnC,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE;wBACL,KAAK,EAAE,aAAa,IAAI,MAAM,CAAC,KAAK;wBACpC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ;wBAC9C,QAAQ,EAAE,gBAAgB,IAAI,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ;qBACnE,EACD,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACzB,aAAa,EAAE,QAAQ,KAAK,aAAa,EACzC,MAAM,EAAE,MAAM,EACd,mBAAmB,EAAE,aAAa,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAM,OAAA,cAAc,CAAC,YAAY,CAAC,EAA5B,CAA4B,EAClD,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,UAAA,MAAM,IAAI,OAAA,sBAAsB,CAAC,eAAe,EAAE,MAAM,CAAC,EAA/C,CAA+C,EAClE,OAAO,EAAE,cAAM,OAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAG,QAAQ,CAAC,EAAvB,CAAuB,EACtC,MAAM,EAAE,UAAU,GAClB,CACH,CAAC;YACJ,CAAC,CAAC,CACC,CACC,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { TableProps } from './interfaces';\nimport SelectionControl, { SelectionControlProps } from './selection-control';\nimport { focusMarkers } from './use-selection';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { getColumnKey } from './utils';\nimport { TableHeaderCell } from './header-cell';\nimport { useColumnWidths } from './use-column-widths';\nimport styles from './styles.css.js';\nimport headerCellStyles from './header-cell/styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\n\nexport interface TheadProps {\n containerWidth: number | null;\n selectionType: TableProps.SelectionType | undefined;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n sortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n variant: TableProps.Variant;\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n selectAllProps: SelectionControlProps;\n onFocusMove: ((sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void) | undefined;\n onCellFocus?: (colIndex: number) => void;\n onCellBlur?: () => void;\n onResizeFinish: (newWidths: Record<string, number>) => void;\n showFocusRing?: number | null;\n onSortingChange: NonCancelableEventHandler<TableProps.SortingState<any>> | undefined;\n sticky?: boolean;\n hidden?: boolean;\n stuck?: boolean;\n singleSelectionHeaderAriaLabel?: string;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n containerWidth,\n selectionType,\n selectAllProps,\n columnDefinitions,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n resizableColumns,\n variant,\n wrapLines,\n onFocusMove,\n onCellFocus,\n onCellBlur,\n onSortingChange,\n onResizeFinish,\n singleSelectionHeaderAriaLabel,\n showFocusRing = null,\n sticky = false,\n hidden = false,\n stuck = false,\n }: TheadProps,\n outerRef: React.Ref<HTMLTableRowElement>\n ) => {\n const headerCellClass = clsx(\n headerCellStyles['header-cell'],\n headerCellStyles[`header-cell-variant-${variant}`],\n sticky && headerCellStyles['header-cell-sticky'],\n stuck && headerCellStyles['header-cell-stuck']\n );\n const selectionCellClass = clsx(styles['selection-control'], styles['selection-control-header']);\n const { columnWidths, totalWidth, updateColumn } = useColumnWidths();\n\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n <tr {...focusMarkers.all} ref={outerRef}>\n {selectionType === 'multi' && (\n <th className={clsx(headerCellClass, selectionCellClass)} scope=\"col\">\n <SelectionControl\n onFocusDown={event => onFocusMove!(event.target as HTMLElement, -1, +1)}\n {...selectAllProps}\n {...(hidden ? { tabIndex: -1 } : {})}\n />\n </th>\n )}\n {selectionType === 'single' && (\n <th className={clsx(headerCellClass, selectionCellClass)} scope=\"col\">\n <ScreenreaderOnly>{singleSelectionHeaderAriaLabel}</ScreenreaderOnly>\n </th>\n )}\n {columnDefinitions.map((column, colIndex) => {\n let widthOverride;\n if (resizableColumns) {\n if (columnWidths) {\n // use stateful value if available\n widthOverride = columnWidths[getColumnKey(column, colIndex)];\n }\n if (colIndex === columnDefinitions.length - 1 && containerWidth && containerWidth > totalWidth) {\n // let the last column grow and fill the container width\n widthOverride = 'auto';\n }\n }\n return (\n <TableHeaderCell\n key={getColumnKey(column, colIndex)}\n className={headerCellClass}\n style={{\n width: widthOverride || column.width,\n minWidth: sticky ? undefined : column.minWidth,\n maxWidth: resizableColumns || sticky ? undefined : column.maxWidth,\n }}\n tabIndex={sticky ? -1 : 0}\n showFocusRing={colIndex === showFocusRing}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n colIndex={colIndex}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidths)}\n resizableColumns={resizableColumns}\n onClick={detail => fireNonCancelableEvent(onSortingChange, detail)}\n onFocus={() => onCellFocus?.(colIndex)}\n onBlur={onCellBlur}\n />\n );\n })}\n </tr>\n </thead>\n );\n }\n);\n\nexport default Thead;\n"]}
1
+ {"version":3,"file":"thead.js","sourceRoot":"","sources":["../../../src/table/thead.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MA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AC,CAAC,CACC,CACC,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { TableProps } from './interfaces';\nimport SelectionControl, { SelectionControlProps } from './selection-control';\nimport { focusMarkers } from './use-selection';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { getColumnKey } from './utils';\nimport { TableHeaderCell } from './header-cell';\nimport { useColumnWidths } from './use-column-widths';\nimport styles from './styles.css.js';\nimport headerCellStyles from './header-cell/styles.css.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\n\nexport interface TheadProps {\n containerWidth: number | null;\n selectionType: TableProps.SelectionType | undefined;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n sortingColumn: TableProps.SortingColumn<any> | undefined;\n sortingDescending: boolean | undefined;\n sortingDisabled: boolean | undefined;\n variant: TableProps.Variant;\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n selectAllProps: SelectionControlProps;\n onFocusMove: ((sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void) | undefined;\n onCellFocus?: (colIndex: number) => void;\n onCellBlur?: () => void;\n onResizeFinish: (newWidths: Record<string, number>) => void;\n showFocusRing?: number | null;\n onSortingChange: NonCancelableEventHandler<TableProps.SortingState<any>> | undefined;\n sticky?: boolean;\n hidden?: boolean;\n stuck?: boolean;\n singleSelectionHeaderAriaLabel?: string;\n}\n\nconst Thead = React.forwardRef(\n (\n {\n containerWidth,\n selectionType,\n selectAllProps,\n columnDefinitions,\n sortingColumn,\n sortingDisabled,\n sortingDescending,\n resizableColumns,\n variant,\n wrapLines,\n onFocusMove,\n onCellFocus,\n onCellBlur,\n onSortingChange,\n onResizeFinish,\n singleSelectionHeaderAriaLabel,\n showFocusRing = null,\n sticky = false,\n hidden = false,\n stuck = false,\n }: TheadProps,\n outerRef: React.Ref<HTMLTableRowElement>\n ) => {\n const headerCellClass = clsx(\n headerCellStyles['header-cell'],\n headerCellStyles[`header-cell-variant-${variant}`],\n sticky && headerCellStyles['header-cell-sticky'],\n stuck && headerCellStyles['header-cell-stuck']\n );\n const selectionCellClass = clsx(styles['selection-control'], styles['selection-control-header']);\n const { columnWidths, totalWidth, updateColumn } = useColumnWidths();\n\n return (\n <thead className={clsx(!hidden && styles['thead-active'])}>\n <tr {...focusMarkers.all} ref={outerRef}>\n {selectionType === 'multi' && (\n <th\n className={clsx(headerCellClass, selectionCellClass, hidden && headerCellStyles['header-cell-hidden'])}\n scope=\"col\"\n >\n <SelectionControl\n onFocusDown={event => onFocusMove!(event.target as HTMLElement, -1, +1)}\n {...selectAllProps}\n {...(hidden ? { tabIndex: -1 } : {})}\n />\n </th>\n )}\n {selectionType === 'single' && (\n <th\n className={clsx(headerCellClass, selectionCellClass, hidden && headerCellStyles['header-cell-hidden'])}\n scope=\"col\"\n >\n <ScreenreaderOnly>{singleSelectionHeaderAriaLabel}</ScreenreaderOnly>\n </th>\n )}\n {columnDefinitions.map((column, colIndex) => {\n let widthOverride;\n if (resizableColumns) {\n if (columnWidths) {\n // use stateful value if available\n widthOverride = columnWidths[getColumnKey(column, colIndex)];\n }\n if (colIndex === columnDefinitions.length - 1 && containerWidth && containerWidth > totalWidth) {\n // let the last column grow and fill the container width\n widthOverride = 'auto';\n }\n }\n return (\n <TableHeaderCell\n key={getColumnKey(column, colIndex)}\n className={headerCellClass}\n style={{\n width: widthOverride || column.width,\n minWidth: sticky ? undefined : column.minWidth,\n maxWidth: resizableColumns || sticky ? undefined : column.maxWidth,\n }}\n tabIndex={sticky ? -1 : 0}\n showFocusRing={colIndex === showFocusRing}\n column={column}\n activeSortingColumn={sortingColumn}\n sortingDescending={sortingDescending}\n sortingDisabled={sortingDisabled}\n wrapLines={wrapLines}\n hidden={hidden}\n colIndex={colIndex}\n updateColumn={updateColumn}\n onResizeFinish={() => onResizeFinish(columnWidths)}\n resizableColumns={resizableColumns}\n onClick={detail => fireNonCancelableEvent(onSortingChange, detail)}\n onFocus={() => onCellFocus?.(colIndex)}\n onBlur={onCellBlur}\n />\n );\n })}\n </tr>\n </thead>\n );\n }\n);\n\nexport default Thead;\n"]}
@@ -1,4 +1,6 @@
1
+ import React from 'react';
1
2
  import { TilesProps } from './interfaces';
2
3
  export { TilesProps };
3
- export default function Tiles(props: TilesProps): JSX.Element;
4
+ declare const Tiles: React.ForwardRefExoticComponent<TilesProps & React.RefAttributes<TilesProps.Ref>>;
5
+ export default Tiles;
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tiles/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAK,EAAE,UAAU,eAG9C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tiles/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,QAAA,MAAM,KAAK,mFAGT,CAAC;AAGH,eAAe,KAAK,CAAC"}
@@ -5,9 +5,10 @@ import React from 'react';
5
5
  import { applyDisplayName } from '../internal/utils/apply-display-name';
6
6
  import useBaseComponent from '../internal/hooks/use-base-component';
7
7
  import InternalTiles from './internal';
8
- export default function Tiles(props) {
8
+ var Tiles = React.forwardRef(function (props, ref) {
9
9
  var baseComponentProps = useBaseComponent('Tiles');
10
- return React.createElement(InternalTiles, __assign({}, props, baseComponentProps));
11
- }
10
+ return React.createElement(InternalTiles, __assign({ ref: ref }, props, baseComponentProps));
11
+ });
12
12
  applyDisplayName(Tiles, 'Tiles');
13
+ export default Tiles;
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tiles/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,aAAa,MAAM,YAAY,CAAC;AAIvC,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,KAAiB;IAC7C,IAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,oBAAC,aAAa,eAAK,KAAK,EAAM,kBAAkB,EAAI,CAAC;AAC9D,CAAC;AAED,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { TilesProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport InternalTiles from './internal';\n\nexport { TilesProps };\n\nexport default function Tiles(props: TilesProps) {\n const baseComponentProps = useBaseComponent('Tiles');\n return <InternalTiles {...props} {...baseComponentProps} />;\n}\n\napplyDisplayName(Tiles, 'Tiles');\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tiles/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,aAAa,MAAM,YAAY,CAAC;AAIvC,IAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,UAAC,KAAiB,EAAE,GAA8B;IAC/E,IAAM,kBAAkB,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACrD,OAAO,oBAAC,aAAa,aAAC,GAAG,EAAE,GAAG,IAAM,KAAK,EAAM,kBAAkB,EAAI,CAAC;AACxE,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACjC,eAAe,KAAK,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { TilesProps } from './interfaces';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport InternalTiles from './internal';\n\nexport { TilesProps };\n\nconst Tiles = React.forwardRef((props: TilesProps, ref: React.Ref<TilesProps.Ref>) => {\n const baseComponentProps = useBaseComponent('Tiles');\n return <InternalTiles ref={ref} {...props} {...baseComponentProps} />;\n});\n\napplyDisplayName(Tiles, 'Tiles');\nexport default Tiles;\n"]}
@@ -54,5 +54,11 @@ export declare namespace TilesProps {
54
54
  interface ChangeDetail {
55
55
  value: string;
56
56
  }
57
+ interface Ref {
58
+ /**
59
+ * Sets input focus onto the UI control.
60
+ */
61
+ focus(): void;
62
+ }
57
63
  }
58
64
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/tiles/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEpE,MAAM,WAAW,UAAW,SAAQ,kB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GAAG,IAAI,CAAC;IAErB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IAElD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;CAC/D;AAED,yBAAiB,UAAU,CAAC;IAC1B,KAAY,UAAU,GAAG,WAAW,CAAC;IACrC,UAAiB,eAAe;QAC9B,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,YAAY;QAC3B,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tiles/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { Breakpoint as _Breakpoint } from '../internal/breakpoints';\n\nexport interface TilesProps extends BaseComponentProps, FormFieldControlProps {\n /**\n * Specifies the value of the selected tile.\n * If you want to clear the selection, use `null`.\n */\n value: string | null;\n\n /**\n * List of tile definitions. Each tile has the following properties:\n *\n * - `value` [string] - The value that will be associated with the tile. This is the value the tiles will get when the radio button is selected.\n * - `label` [ReactNode] - A short description for the option the tile represents.\n * - `description` [ReactNode] - (Optional) Further explanatory guidance on the tile option, shown below the `label`.\n * - `image` [ReactNode] - (Optional) Visually distinctive image for the tile option, shown below the `description`.\n * - `disabled` [boolean] - (Optional) Specifies whether the tile is disabled. Users can't select disabled tiles.\n * - `controlId` [string] - (Optional) The ID of the internal input. You can use this to relate a label element's `for` attribute to this control.\n * We recommend that you don't set this property because it's automatically set by the tiles component.\n */\n items?: ReadonlyArray<TilesProps.TilesDefinition>;\n\n /**\n * Adds `aria-label` on the group. Don't set this property if you are using this form element within a form field\n * because the form field component automatically sets the correct labels to make the component accessible.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-required` on the group.\n */\n ariaRequired?: boolean;\n\n /**\n * The number of columns for the tiles to be displayed in. Valid values are integers between 1 and 4.\n * If no value is specified, the number of columns is determined based on the number of items, with a maximum of 3.\n * It is set to 2 if 4 or 8 items are supplied in order to optimize the layout.\n */\n columns?: number;\n\n /**\n * Called when the user selects a different tile.\n */\n onChange?: NonCancelableEventHandler<TilesProps.ChangeDetail>;\n}\n\nexport namespace TilesProps {\n export type Breakpoint = _Breakpoint;\n export interface TilesDefinition {\n value: string;\n label: React.ReactNode;\n description?: React.ReactNode;\n image?: React.ReactNode;\n disabled?: boolean;\n controlId?: string;\n }\n\n export interface ChangeDetail {\n value: string;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tiles/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { FormFieldControlProps } from '../internal/context/form-field-context';\nimport { Breakpoint as _Breakpoint } from '../internal/breakpoints';\n\nexport interface TilesProps extends BaseComponentProps, FormFieldControlProps {\n /**\n * Specifies the value of the selected tile.\n * If you want to clear the selection, use `null`.\n */\n value: string | null;\n\n /**\n * List of tile definitions. Each tile has the following properties:\n *\n * - `value` [string] - The value that will be associated with the tile. This is the value the tiles will get when the radio button is selected.\n * - `label` [ReactNode] - A short description for the option the tile represents.\n * - `description` [ReactNode] - (Optional) Further explanatory guidance on the tile option, shown below the `label`.\n * - `image` [ReactNode] - (Optional) Visually distinctive image for the tile option, shown below the `description`.\n * - `disabled` [boolean] - (Optional) Specifies whether the tile is disabled. Users can't select disabled tiles.\n * - `controlId` [string] - (Optional) The ID of the internal input. You can use this to relate a label element's `for` attribute to this control.\n * We recommend that you don't set this property because it's automatically set by the tiles component.\n */\n items?: ReadonlyArray<TilesProps.TilesDefinition>;\n\n /**\n * Adds `aria-label` on the group. Don't set this property if you are using this form element within a form field\n * because the form field component automatically sets the correct labels to make the component accessible.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-required` on the group.\n */\n ariaRequired?: boolean;\n\n /**\n * The number of columns for the tiles to be displayed in. Valid values are integers between 1 and 4.\n * If no value is specified, the number of columns is determined based on the number of items, with a maximum of 3.\n * It is set to 2 if 4 or 8 items are supplied in order to optimize the layout.\n */\n columns?: number;\n\n /**\n * Called when the user selects a different tile.\n */\n onChange?: NonCancelableEventHandler<TilesProps.ChangeDetail>;\n}\n\nexport namespace TilesProps {\n export type Breakpoint = _Breakpoint;\n export interface TilesDefinition {\n value: string;\n label: React.ReactNode;\n description?: React.ReactNode;\n image?: React.ReactNode;\n disabled?: boolean;\n controlId?: string;\n }\n\n export interface ChangeDetail {\n value: string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
+ import React from 'react';
1
2
  import { TilesProps } from './interfaces';
2
3
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
3
- declare type InternalTilesProps = TilesProps & InternalBaseComponentProps;
4
- export default function InternalTiles({ value, items, ariaLabel, ariaRequired, columns, onChange, __internalRootRef, ...rest }: InternalTilesProps): JSX.Element;
5
- export {};
4
+ declare const InternalTiles: React.ForwardRefExoticComponent<TilesProps & InternalBaseComponentProps & React.RefAttributes<TilesProps.Ref>>;
5
+ export default InternalTiles;
6
6
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAMlF,aAAK,kBAAkB,GAAG,UAAU,GAAG,0BAA0B,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,iBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,kBAAkB,eAiDpB"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AASlF,QAAA,MAAM,aAAa,gHA2ClB,CAAC;AAqBF,eAAe,aAAa,CAAC"}
@@ -10,31 +10,34 @@ import { useUniqueId } from '../internal/hooks/use-unique-id';
10
10
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
11
11
  import { useMergeRefs } from '../internal/hooks/use-merge-refs';
12
12
  import { Tile } from './tile';
13
+ import useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';
13
14
  var COLUMN_TRIGGERS = ['default', 'xxs', 'xs'];
14
- export default function InternalTiles(_a) {
15
+ var InternalTiles = React.forwardRef(function (_a, ref) {
15
16
  var value = _a.value, items = _a.items, ariaLabel = _a.ariaLabel, ariaRequired = _a.ariaRequired, columns = _a.columns, onChange = _a.onChange, _b = _a.__internalRootRef, __internalRootRef = _b === void 0 ? null : _b, rest = __rest(_a, ["value", "items", "ariaLabel", "ariaRequired", "columns", "onChange", "__internalRootRef"]);
16
- var getColumns = function () {
17
- if (columns) {
18
- return columns;
19
- }
20
- var nItems = items ? items.length : 0;
21
- var columnsLookup = {
22
- 0: 1,
23
- 1: 1,
24
- 2: 2,
25
- 4: 2,
26
- 8: 2
27
- };
28
- return columnsLookup[nItems] || 3;
29
- };
30
- var _c = useFormFieldContext(rest), ariaDescribedby = _c.ariaDescribedby, ariaLabelledby = _c.ariaLabelledby;
31
17
  var baseProps = getBaseProps(rest);
18
+ var _c = useFormFieldContext(rest), ariaDescribedby = _c.ariaDescribedby, ariaLabelledby = _c.ariaLabelledby;
32
19
  var generatedName = useUniqueId('awsui-tiles-');
33
- var nColumns = getColumns();
34
- var _d = useContainerBreakpoints(COLUMN_TRIGGERS), breakpoint = _d[0], ref = _d[1];
35
- var mergedRef = useMergeRefs(ref, __internalRootRef);
20
+ var _d = useRadioGroupForwardFocus(ref, items, value), tileRef = _d[0], tileRefIndex = _d[1];
21
+ var _e = useContainerBreakpoints(COLUMN_TRIGGERS), breakpoint = _e[0], breakpointRef = _e[1];
22
+ var mergedRef = useMergeRefs(breakpointRef, __internalRootRef);
23
+ var columnCount = getColumnCount(items, columns);
36
24
  return (React.createElement("div", __assign({ role: "radiogroup", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired }, baseProps, { className: clsx(baseProps.className, styles.root), ref: mergedRef }),
37
- React.createElement("div", { className: clsx(styles.columns, styles["column-".concat(nColumns)]) }, items &&
38
- items.map(function (item) { return (React.createElement(Tile, { key: item.value, item: item, selected: item.value === value, name: generatedName, breakpoint: breakpoint, onChange: onChange })); }))));
25
+ React.createElement("div", { className: clsx(styles.columns, styles["column-".concat(columnCount)]) }, items &&
26
+ items.map(function (item, index) { return (React.createElement(Tile, { ref: index === tileRefIndex ? tileRef : undefined, key: item.value, item: item, selected: item.value === value, name: generatedName, breakpoint: breakpoint, onChange: onChange })); }))));
27
+ });
28
+ function getColumnCount(items, columns) {
29
+ if (columns) {
30
+ return columns;
31
+ }
32
+ var nItems = items ? items.length : 0;
33
+ var columnsLookup = {
34
+ 0: 1,
35
+ 1: 1,
36
+ 2: 2,
37
+ 4: 2,
38
+ 8: 2
39
+ };
40
+ return columnsLookup[nItems] || 3;
39
41
  }
42
+ export default InternalTiles;
40
43
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,IAAM,eAAe,GAA4B,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAI1E,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EASjB;IARnB,IAAA,KAAK,WAAA,EACL,KAAK,WAAA,EACL,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,yBAAwB,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EACrB,IAAI,cAR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E,IAAI,CAAC,KAAK,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,EAC9B,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,GAClB,CACH,EATiB,CASjB,CAAC,CACA,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { TilesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Tile } from './tile';\n\nconst COLUMN_TRIGGERS: TilesProps.Breakpoint[] = ['default', 'xxs', 'xs'];\n\ntype InternalTilesProps = TilesProps & InternalBaseComponentProps;\n\nexport default function InternalTiles({\n value,\n items,\n ariaLabel,\n ariaRequired,\n columns,\n onChange,\n __internalRootRef = null,\n ...rest\n}: InternalTilesProps) {\n const getColumns = () => {\n if (columns) {\n return columns;\n }\n\n const nItems = items ? items.length : 0;\n const columnsLookup: Record<number, number> = {\n 0: 1,\n 1: 1,\n 2: 2,\n 4: 2,\n 8: 2,\n };\n return columnsLookup[nItems] || 3;\n };\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);\n const baseProps = getBaseProps(rest);\n const generatedName = useUniqueId('awsui-tiles-');\n const nColumns = getColumns();\n const [breakpoint, ref] = useContainerBreakpoints(COLUMN_TRIGGERS);\n const mergedRef = useMergeRefs(ref, __internalRootRef);\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={mergedRef}\n >\n <div className={clsx(styles.columns, styles[`column-${nColumns}`])}>\n {items &&\n items.map(item => (\n <Tile\n key={item.value}\n item={item}\n selected={item.value === value}\n name={generatedName}\n breakpoint={breakpoint}\n onChange={onChange}\n />\n ))}\n </div>\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAEpF,IAAM,eAAe,GAA4B,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;AAI1E,IAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CACpC,UACE,EAAmH,EACnH,GAA8B;IAD5B,IAAA,KAAK,WAAA,EAAE,KAAK,WAAA,EAAE,SAAS,eAAA,EAAE,YAAY,kBAAA,EAAE,OAAO,aAAA,EAAE,QAAQ,cAAA,EAAE,yBAAwB,EAAxB,iBAAiB,mBAAG,IAAI,KAAA,EAAK,IAAI,cAA7F,2FAA+F,CAAF;IAG7F,IAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAA,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AS,cAAc,CACrB,KAA4D,EAC5D,OAA2B;IAE3B,IAAI,OAAO,EAAE;QACX,OAAO,OAAO,CAAC;KAChB;IAED,IAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,IAAM,aAAa,GAA2B;QAC5C,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;KACL,CAAC;IACF,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { TilesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Tile } from './tile';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\n\nconst COLUMN_TRIGGERS: TilesProps.Breakpoint[] = ['default', 'xxs', 'xs'];\n\ntype InternalTilesProps = TilesProps & InternalBaseComponentProps;\n\nconst InternalTiles = React.forwardRef(\n (\n { value, items, ariaLabel, ariaRequired, columns, onChange, __internalRootRef = null, ...rest }: InternalTilesProps,\n ref: React.Ref<TilesProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);\n const generatedName = useUniqueId('awsui-tiles-');\n\n const [tileRef, tileRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n const [breakpoint, breakpointRef] = useContainerBreakpoints(COLUMN_TRIGGERS);\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const columnCount = getColumnCount(items, columns);\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={mergedRef}\n >\n <div className={clsx(styles.columns, styles[`column-${columnCount}`])}>\n {items &&\n items.map((item, index) => (\n <Tile\n ref={index === tileRefIndex ? tileRef : undefined}\n key={item.value}\n item={item}\n selected={item.value === value}\n name={generatedName}\n breakpoint={breakpoint}\n onChange={onChange}\n />\n ))}\n </div>\n </div>\n );\n }\n);\n\nfunction getColumnCount(\n items: ReadonlyArray<TilesProps.TilesDefinition> | undefined,\n columns: number | undefined\n): number {\n if (columns) {\n return columns;\n }\n\n const nItems = items ? items.length : 0;\n const columnsLookup: Record<number, number> = {\n 0: 1,\n 1: 1,\n 2: 2,\n 4: 2,\n 8: 2,\n };\n return columnsLookup[nItems] || 3;\n}\n\nexport default InternalTiles;\n"]}
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { TilesProps } from './interfaces';
2
3
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
3
4
  interface TileProps {
@@ -7,6 +8,6 @@ interface TileProps {
7
8
  breakpoint: ReturnType<typeof useContainerBreakpoints>[0];
8
9
  onChange: TilesProps['onChange'];
9
10
  }
10
- export declare function Tile({ item, selected, name, breakpoint, onChange }: TileProps): JSX.Element;
11
+ export declare const Tile: React.ForwardRefExoticComponent<TileProps & React.RefAttributes<HTMLInputElement>>;
11
12
  export {};
12
13
  //# sourceMappingURL=tile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/tiles/tile.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,UAAU,SAAS;IACjB,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,SAAS,eAuC7E"}
1
+ {"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/tiles/tile.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAI9E,UAAU,SAAS;IACjB,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,IAAI,oFA2ChB,CAAC"}