@cloudscape-design/components-themeable 3.0.640 → 3.0.641

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 (40) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/button/styles.scss +12 -0
  3. package/lib/internal/scss/drawer/styles.scss +5 -5
  4. package/lib/internal/scss/help-panel/styles.scss +8 -8
  5. package/lib/internal/scss/side-navigation/styles.scss +6 -5
  6. package/lib/internal/scss/table/body-cell/styles.scss +7 -2
  7. package/lib/internal/template/button/styles.css.js +19 -19
  8. package/lib/internal/template/button/styles.scoped.css +159 -151
  9. package/lib/internal/template/button/styles.selectors.js +19 -19
  10. package/lib/internal/template/drawer/styles.css.js +3 -3
  11. package/lib/internal/template/drawer/styles.scoped.css +13 -13
  12. package/lib/internal/template/drawer/styles.selectors.js +3 -3
  13. package/lib/internal/template/help-panel/styles.css.js +4 -4
  14. package/lib/internal/template/help-panel/styles.scoped.css +71 -71
  15. package/lib/internal/template/help-panel/styles.selectors.js +4 -4
  16. package/lib/internal/template/internal/base-component/styles.scoped.css +35 -0
  17. package/lib/internal/template/internal/environment.js +1 -1
  18. package/lib/internal/template/internal/environment.json +1 -1
  19. package/lib/internal/template/internal/generated/styles/tokens.d.ts +5 -0
  20. package/lib/internal/template/internal/generated/styles/tokens.js +5 -0
  21. package/lib/internal/template/internal/generated/theming/index.cjs +75 -0
  22. package/lib/internal/template/internal/generated/theming/index.js +75 -0
  23. package/lib/internal/template/side-navigation/styles.css.js +28 -28
  24. package/lib/internal/template/side-navigation/styles.scoped.css +44 -43
  25. package/lib/internal/template/side-navigation/styles.selectors.js +28 -28
  26. package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts +1 -1
  27. package/lib/internal/template/table/body-cell/disabled-inline-editor.d.ts.map +1 -1
  28. package/lib/internal/template/table/body-cell/disabled-inline-editor.js +2 -2
  29. package/lib/internal/template/table/body-cell/disabled-inline-editor.js.map +1 -1
  30. package/lib/internal/template/table/body-cell/index.d.ts +1 -0
  31. package/lib/internal/template/table/body-cell/index.d.ts.map +1 -1
  32. package/lib/internal/template/table/body-cell/index.js +2 -2
  33. package/lib/internal/template/table/body-cell/index.js.map +1 -1
  34. package/lib/internal/template/table/body-cell/styles.css.js +44 -43
  35. package/lib/internal/template/table/body-cell/styles.scoped.css +167 -165
  36. package/lib/internal/template/table/body-cell/styles.selectors.js +44 -43
  37. package/lib/internal/template/table/internal.d.ts.map +1 -1
  38. package/lib/internal/template/table/internal.js +1 -1
  39. package/lib/internal/template/table/internal.js.map +1 -1
  40. package/package.json +1 -1
@@ -1,33 +1,33 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_l0dv0_1qw6y_99",
5
- "header": "awsui_header_l0dv0_1qw6y_136",
6
- "header-link": "awsui_header-link_l0dv0_1qw6y_149",
7
- "header-link--has-logo": "awsui_header-link--has-logo_l0dv0_1qw6y_159",
8
- "header-link-text": "awsui_header-link-text_l0dv0_1qw6y_159",
9
- "header-logo": "awsui_header-logo_l0dv0_1qw6y_164",
10
- "header-logo--stretched": "awsui_header-logo--stretched_l0dv0_1qw6y_170",
11
- "list-container": "awsui_list-container_l0dv0_1qw6y_175",
12
- "list": "awsui_list_l0dv0_1qw6y_175",
13
- "list-variant-root": "awsui_list-variant-root_l0dv0_1qw6y_187",
14
- "list-variant-root--last": "awsui_list-variant-root--last_l0dv0_1qw6y_194",
15
- "list-variant-expandable-link-group": "awsui_list-variant-expandable-link-group_l0dv0_1qw6y_198",
16
- "list-item": "awsui_list-item_l0dv0_1qw6y_202",
17
- "section": "awsui_section_l0dv0_1qw6y_210",
18
- "expandable-link-group": "awsui_expandable-link-group_l0dv0_1qw6y_211",
19
- "section--no-ident": "awsui_section--no-ident_l0dv0_1qw6y_214",
20
- "expandable-link-group--no-ident": "awsui_expandable-link-group--no-ident_l0dv0_1qw6y_215",
21
- "refresh": "awsui_refresh_l0dv0_1qw6y_223",
22
- "list-variant-section-group": "awsui_list-variant-section-group_l0dv0_1qw6y_231",
23
- "section-group": "awsui_section-group_l0dv0_1qw6y_238",
24
- "section-group-title": "awsui_section-group-title_l0dv0_1qw6y_249",
25
- "link": "awsui_link_l0dv0_1qw6y_253",
26
- "link-active": "awsui_link-active_l0dv0_1qw6y_262",
27
- "info": "awsui_info_l0dv0_1qw6y_299",
28
- "external-icon": "awsui_external-icon_l0dv0_1qw6y_303",
29
- "divider": "awsui_divider_l0dv0_1qw6y_307",
30
- "divider-default": "awsui_divider-default_l0dv0_1qw6y_313",
31
- "divider-header": "awsui_divider-header_l0dv0_1qw6y_318"
4
+ "root": "awsui_root_l0dv0_1igbc_99",
5
+ "header": "awsui_header_l0dv0_1igbc_136",
6
+ "header-link": "awsui_header-link_l0dv0_1igbc_149",
7
+ "header-link--has-logo": "awsui_header-link--has-logo_l0dv0_1igbc_159",
8
+ "header-link-text": "awsui_header-link-text_l0dv0_1igbc_159",
9
+ "header-logo": "awsui_header-logo_l0dv0_1igbc_164",
10
+ "header-logo--stretched": "awsui_header-logo--stretched_l0dv0_1igbc_170",
11
+ "list-container": "awsui_list-container_l0dv0_1igbc_175",
12
+ "list": "awsui_list_l0dv0_1igbc_175",
13
+ "list-variant-root": "awsui_list-variant-root_l0dv0_1igbc_187",
14
+ "list-variant-root--last": "awsui_list-variant-root--last_l0dv0_1igbc_194",
15
+ "list-variant-expandable-link-group": "awsui_list-variant-expandable-link-group_l0dv0_1igbc_198",
16
+ "list-item": "awsui_list-item_l0dv0_1igbc_202",
17
+ "section": "awsui_section_l0dv0_1igbc_210",
18
+ "expandable-link-group": "awsui_expandable-link-group_l0dv0_1igbc_211",
19
+ "section--no-ident": "awsui_section--no-ident_l0dv0_1igbc_214",
20
+ "expandable-link-group--no-ident": "awsui_expandable-link-group--no-ident_l0dv0_1igbc_215",
21
+ "refresh": "awsui_refresh_l0dv0_1igbc_223",
22
+ "list-variant-section-group": "awsui_list-variant-section-group_l0dv0_1igbc_231",
23
+ "section-group": "awsui_section-group_l0dv0_1igbc_238",
24
+ "section-group-title": "awsui_section-group-title_l0dv0_1igbc_249",
25
+ "link": "awsui_link_l0dv0_1igbc_253",
26
+ "link-active": "awsui_link-active_l0dv0_1igbc_262",
27
+ "info": "awsui_info_l0dv0_1igbc_299",
28
+ "external-icon": "awsui_external-icon_l0dv0_1igbc_303",
29
+ "divider": "awsui_divider_l0dv0_1igbc_307",
30
+ "divider-default": "awsui_divider-default_l0dv0_1igbc_312",
31
+ "divider-header": "awsui_divider-header_l0dv0_1igbc_318"
32
32
  };
33
33
 
@@ -96,7 +96,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
96
96
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
97
97
  SPDX-License-Identifier: Apache-2.0
98
98
  */
99
- .awsui_root_l0dv0_1qw6y_99:not(#\9) {
99
+ .awsui_root_l0dv0_1igbc_99:not(#\9) {
100
100
  border-collapse: separate;
101
101
  border-spacing: 0;
102
102
  box-sizing: border-box;
@@ -134,7 +134,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
134
134
  word-break: break-word;
135
135
  }
136
136
 
137
- .awsui_header_l0dv0_1qw6y_136:not(#\9) {
137
+ .awsui_header_l0dv0_1igbc_136:not(#\9) {
138
138
  font-size: var(--font-panel-header-size-tbwmfr, 18px);
139
139
  line-height: var(--font-panel-header-line-height-leujyg, 22px);
140
140
  font-weight: var(--font-weight-heading-l-1hf845, 700);
@@ -142,12 +142,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
142
142
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-fw8n0n, auto);
143
143
  margin-block: 0;
144
144
  margin-inline: 0;
145
- padding-block: var(--space-scaled-l-08jb88, 20px);
145
+ padding-block: var(--space-panel-header-vertical-3c8qmg, 20px);
146
146
  padding-inline-start: var(--space-panel-nav-left-c5t4hj, 32px);
147
147
  padding-inline-end: calc(var(--space-scaled-xxl-x330me, 32px) + var(--space-xl-5fdwzu, 24px));
148
148
  }
149
149
 
150
- .awsui_header-link_l0dv0_1qw6y_149:not(#\9) {
150
+ .awsui_header-link_l0dv0_1igbc_149:not(#\9) {
151
151
  font-size: var(--font-panel-header-size-tbwmfr, 18px);
152
152
  line-height: var(--font-panel-header-line-height-leujyg, 22px);
153
153
  font-weight: var(--font-weight-heading-l-1hf845, 700);
@@ -157,27 +157,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
157
157
  min-block-size: var(--font-panel-header-line-height-leujyg, 22px);
158
158
  display: flex;
159
159
  }
160
- .awsui_header-link--has-logo_l0dv0_1qw6y_159 > .awsui_header-link-text_l0dv0_1qw6y_159:not(#\9) {
160
+ .awsui_header-link--has-logo_l0dv0_1igbc_159 > .awsui_header-link-text_l0dv0_1igbc_159:not(#\9) {
161
161
  font-weight: 400;
162
162
  align-self: center;
163
163
  }
164
164
 
165
- .awsui_header-logo_l0dv0_1qw6y_164:not(#\9) {
165
+ .awsui_header-logo_l0dv0_1igbc_164:not(#\9) {
166
166
  margin-inline-end: var(--space-s-2025hl, 12px);
167
167
  margin-block-start: var(--space-xxxs-z28114, 2px);
168
168
  max-inline-size: calc(1.25 * var(--size-icon-big-hyxarq, 32px));
169
169
  align-self: flex-start;
170
170
  }
171
- .awsui_header-logo--stretched_l0dv0_1qw6y_170:not(#\9) {
171
+ .awsui_header-logo--stretched_l0dv0_1igbc_170:not(#\9) {
172
172
  max-inline-size: 100%;
173
173
  margin-inline-end: 0;
174
174
  }
175
175
 
176
- .awsui_list-container_l0dv0_1qw6y_175:not(#\9) {
177
- margin-block-start: var(--space-scaled-l-08jb88, 20px);
176
+ .awsui_list-container_l0dv0_1igbc_175:not(#\9) {
177
+ margin-block-start: var(--space-panel-content-top-adxo81, 20px);
178
178
  }
179
179
 
180
- .awsui_list_l0dv0_1qw6y_175:not(#\9) {
180
+ .awsui_list_l0dv0_1igbc_175:not(#\9) {
181
181
  margin-block: 0;
182
182
  margin-inline: 0;
183
183
  padding-block: 0;
@@ -185,22 +185,22 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
185
185
  padding-inline-start: var(--space-l-xu1x80, 20px);
186
186
  }
187
187
 
188
- .awsui_list-variant-root_l0dv0_1qw6y_187:not(#\9) {
188
+ .awsui_list-variant-root_l0dv0_1igbc_187:not(#\9) {
189
189
  margin-block: 0;
190
190
  margin-inline: 0;
191
191
  padding-block: 0;
192
192
  padding-inline-start: var(--space-panel-nav-left-c5t4hj, 32px);
193
193
  padding-inline-end: var(--space-panel-side-right-23w8pv, 32px);
194
194
  }
195
- .awsui_list-variant-root--last_l0dv0_1qw6y_194:not(#\9) {
196
- margin-block-end: var(--space-scaled-xxxl-679zhd, 40px);
195
+ .awsui_list-variant-root--last_l0dv0_1igbc_194:not(#\9) {
196
+ margin-block-end: var(--space-panel-content-bottom-a67jcq, 40px);
197
197
  }
198
198
 
199
- .awsui_list-variant-expandable-link-group_l0dv0_1qw6y_198:not(#\9) {
199
+ .awsui_list-variant-expandable-link-group_l0dv0_1igbc_198:not(#\9) {
200
200
  padding-inline-start: var(--space-xxxl-gvq98t, 40px);
201
201
  }
202
202
 
203
- .awsui_list-item_l0dv0_1qw6y_202:not(#\9) {
203
+ .awsui_list-item_l0dv0_1igbc_202:not(#\9) {
204
204
  margin-block: var(--space-scaled-xs-x91h81, 8px);
205
205
  margin-inline: 0;
206
206
  padding-block: 0;
@@ -208,35 +208,35 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
208
208
  list-style: none;
209
209
  }
210
210
 
211
- .awsui_section_l0dv0_1qw6y_210:not(#\9),
212
- .awsui_expandable-link-group_l0dv0_1qw6y_211:not(#\9) {
211
+ .awsui_section_l0dv0_1igbc_210:not(#\9),
212
+ .awsui_expandable-link-group_l0dv0_1igbc_211:not(#\9) {
213
213
  margin-inline-start: calc(-1 * var(--space-l-xu1x80, 20px));
214
214
  }
215
- .awsui_section--no-ident_l0dv0_1qw6y_214:not(#\9),
216
- .awsui_expandable-link-group--no-ident_l0dv0_1qw6y_215:not(#\9) {
215
+ .awsui_section--no-ident_l0dv0_1igbc_214:not(#\9),
216
+ .awsui_expandable-link-group--no-ident_l0dv0_1igbc_215:not(#\9) {
217
217
  margin-inline-start: 0;
218
218
  }
219
219
 
220
- .awsui_section_l0dv0_1qw6y_210:not(#\9) {
220
+ .awsui_section_l0dv0_1igbc_210:not(#\9) {
221
221
  margin-block: calc(var(--space-scaled-2x-l-z6majk, 20px) - var(--border-divider-section-width-wl9k66, 1px));
222
222
  /* stylelint-disable-next-line selector-max-type */
223
223
  }
224
- .awsui_section_l0dv0_1qw6y_210.awsui_refresh_l0dv0_1qw6y_223:not(#\9) {
224
+ .awsui_section_l0dv0_1igbc_210.awsui_refresh_l0dv0_1igbc_223:not(#\9) {
225
225
  margin-block: calc(var(--space-scaled-2x-m-9606n2, 16px) - var(--border-divider-section-width-wl9k66, 1px));
226
226
  }
227
- .awsui_section_l0dv0_1qw6y_210 > div:not(#\9) {
227
+ .awsui_section_l0dv0_1igbc_210 > div:not(#\9) {
228
228
  padding-block: 0;
229
229
  padding-inline: 0;
230
230
  }
231
231
 
232
- .awsui_list-variant-section-group_l0dv0_1qw6y_231:not(#\9) {
232
+ .awsui_list-variant-section-group_l0dv0_1igbc_231:not(#\9) {
233
233
  margin-block: 0;
234
234
  margin-inline: 0;
235
235
  padding-block: 0;
236
236
  padding-inline: 0;
237
237
  }
238
238
 
239
- .awsui_section-group_l0dv0_1qw6y_238:not(#\9) {
239
+ .awsui_section-group_l0dv0_1igbc_238:not(#\9) {
240
240
  font-size: var(--font-size-heading-m-io97me, 18px);
241
241
  line-height: var(--line-height-heading-m-6mmwjh, 22px);
242
242
  letter-spacing: var(--letter-spacing-heading-m-kfwhdw, normal);
@@ -247,11 +247,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
247
247
  margin-inline: 0;
248
248
  }
249
249
 
250
- .awsui_section-group-title_l0dv0_1qw6y_249:not(#\9) {
250
+ .awsui_section-group-title_l0dv0_1igbc_249:not(#\9) {
251
251
  /* used in test-utils */
252
252
  }
253
253
 
254
- .awsui_link_l0dv0_1qw6y_253:not(#\9) {
254
+ .awsui_link_l0dv0_1igbc_253:not(#\9) {
255
255
  font-size: var(--font-size-body-m-pa3mqb, 14px);
256
256
  line-height: var(--line-height-body-m-2zx78l, 22px);
257
257
  color: var(--color-text-body-secondary-6ysfsn, #545b64);
@@ -260,30 +260,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
260
260
  -moz-osx-font-smoothing: auto;
261
261
  }
262
262
 
263
- .awsui_link-active_l0dv0_1qw6y_262:not(#\9) {
263
+ .awsui_link-active_l0dv0_1igbc_262:not(#\9) {
264
264
  font-weight: var(--font-wayfinding-link-active-weight-wec2dg, 700);
265
265
  -webkit-font-smoothing: var(--font-smoothing-webkit-8fiijr, auto);
266
266
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-fw8n0n, auto);
267
267
  color: var(--color-text-accent-yy9054, #0073bb);
268
268
  }
269
269
 
270
- .awsui_header-link_l0dv0_1qw6y_149:not(#\9),
271
- .awsui_link_l0dv0_1qw6y_253:not(#\9) {
270
+ .awsui_header-link_l0dv0_1igbc_149:not(#\9),
271
+ .awsui_link_l0dv0_1igbc_253:not(#\9) {
272
272
  text-decoration: none;
273
273
  }
274
- .awsui_header-link_l0dv0_1qw6y_149:not(#\9):hover,
275
- .awsui_link_l0dv0_1qw6y_253:not(#\9):hover {
274
+ .awsui_header-link_l0dv0_1igbc_149:not(#\9):hover,
275
+ .awsui_link_l0dv0_1igbc_253:not(#\9):hover {
276
276
  color: var(--color-text-accent-yy9054, #0073bb);
277
277
  }
278
- .awsui_header-link_l0dv0_1qw6y_149:not(#\9):focus,
279
- .awsui_link_l0dv0_1qw6y_253:not(#\9):focus {
278
+ .awsui_header-link_l0dv0_1igbc_149:not(#\9):focus,
279
+ .awsui_link_l0dv0_1igbc_253:not(#\9):focus {
280
280
  outline: none;
281
281
  }
282
- .awsui_header-link_l0dv0_1qw6y_149:not(#\9):hover, .awsui_header-link_l0dv0_1qw6y_149:not(#\9):focus, .awsui_link_l0dv0_1qw6y_253:not(#\9):hover, .awsui_link_l0dv0_1qw6y_253:not(#\9):focus {
282
+ .awsui_header-link_l0dv0_1igbc_149:not(#\9):hover, .awsui_header-link_l0dv0_1igbc_149:not(#\9):focus, .awsui_link_l0dv0_1igbc_253:not(#\9):hover, .awsui_link_l0dv0_1igbc_253:not(#\9):focus {
283
283
  text-decoration: none;
284
284
  }
285
- body[data-awsui-focus-visible=true] .awsui_header-link_l0dv0_1qw6y_149:not(#\9):focus,
286
- body[data-awsui-focus-visible=true] .awsui_link_l0dv0_1qw6y_253:not(#\9):focus {
285
+ body[data-awsui-focus-visible=true] .awsui_header-link_l0dv0_1igbc_149:not(#\9):focus,
286
+ body[data-awsui-focus-visible=true] .awsui_link_l0dv0_1igbc_253:not(#\9):focus {
287
287
  outline: thin dotted;
288
288
  outline: var(--border-link-focus-ring-outline-gygm43, 5px auto Highlight);
289
289
  outline-offset: 2px;
@@ -295,25 +295,26 @@ body[data-awsui-focus-visible=true] .awsui_link_l0dv0_1qw6y_253:not(#\9):focus {
295
295
  box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-efbp5h, 0px) var(--color-border-item-focused-v8nq2m, #0073bb);
296
296
  }
297
297
 
298
- .awsui_info_l0dv0_1qw6y_299:not(#\9) {
298
+ .awsui_info_l0dv0_1igbc_299:not(#\9) {
299
299
  margin-inline-start: var(--space-xs-xf5ch3, 8px);
300
300
  }
301
301
 
302
- .awsui_external-icon_l0dv0_1qw6y_303:not(#\9) {
302
+ .awsui_external-icon_l0dv0_1igbc_303:not(#\9) {
303
303
  margin-inline-start: var(--space-xxs-9rrxti, 4px);
304
304
  }
305
305
 
306
- .awsui_divider_l0dv0_1qw6y_307:not(#\9) {
306
+ .awsui_divider_l0dv0_1igbc_307:not(#\9) {
307
307
  border-block: none;
308
308
  border-inline: none;
309
- border-block-start: var(--border-divider-section-width-wl9k66, 1px) solid var(--color-border-divider-default-in8dkg, #eaeded);
310
309
  }
311
310
 
312
- .awsui_divider-default_l0dv0_1qw6y_313:not(#\9) {
311
+ .awsui_divider-default_l0dv0_1igbc_312:not(#\9) {
313
312
  margin-block: var(--space-scaled-2x-xl-20qbzu, 24px);
314
- margin-inline: calc(-1 * var(--space-s-2025hl, 12px));
313
+ margin-inline: calc(-1 * var(--space-panel-divider-margin-horizontal-2jmfkj, 12px));
314
+ border-block-start: var(--border-divider-section-width-wl9k66, 1px) solid var(--color-border-divider-default-in8dkg, #eaeded);
315
315
  }
316
316
 
317
- .awsui_divider-header_l0dv0_1qw6y_318:not(#\9) {
317
+ .awsui_divider-header_l0dv0_1igbc_318:not(#\9) {
318
318
  margin-block-start: 0;
319
+ border-block-start: var(--border-divider-section-width-wl9k66, 1px) solid var(--color-border-panel-header-kec01h, #eaeded);
319
320
  }
@@ -2,33 +2,33 @@
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_l0dv0_1qw6y_99",
6
- "header": "awsui_header_l0dv0_1qw6y_136",
7
- "header-link": "awsui_header-link_l0dv0_1qw6y_149",
8
- "header-link--has-logo": "awsui_header-link--has-logo_l0dv0_1qw6y_159",
9
- "header-link-text": "awsui_header-link-text_l0dv0_1qw6y_159",
10
- "header-logo": "awsui_header-logo_l0dv0_1qw6y_164",
11
- "header-logo--stretched": "awsui_header-logo--stretched_l0dv0_1qw6y_170",
12
- "list-container": "awsui_list-container_l0dv0_1qw6y_175",
13
- "list": "awsui_list_l0dv0_1qw6y_175",
14
- "list-variant-root": "awsui_list-variant-root_l0dv0_1qw6y_187",
15
- "list-variant-root--last": "awsui_list-variant-root--last_l0dv0_1qw6y_194",
16
- "list-variant-expandable-link-group": "awsui_list-variant-expandable-link-group_l0dv0_1qw6y_198",
17
- "list-item": "awsui_list-item_l0dv0_1qw6y_202",
18
- "section": "awsui_section_l0dv0_1qw6y_210",
19
- "expandable-link-group": "awsui_expandable-link-group_l0dv0_1qw6y_211",
20
- "section--no-ident": "awsui_section--no-ident_l0dv0_1qw6y_214",
21
- "expandable-link-group--no-ident": "awsui_expandable-link-group--no-ident_l0dv0_1qw6y_215",
22
- "refresh": "awsui_refresh_l0dv0_1qw6y_223",
23
- "list-variant-section-group": "awsui_list-variant-section-group_l0dv0_1qw6y_231",
24
- "section-group": "awsui_section-group_l0dv0_1qw6y_238",
25
- "section-group-title": "awsui_section-group-title_l0dv0_1qw6y_249",
26
- "link": "awsui_link_l0dv0_1qw6y_253",
27
- "link-active": "awsui_link-active_l0dv0_1qw6y_262",
28
- "info": "awsui_info_l0dv0_1qw6y_299",
29
- "external-icon": "awsui_external-icon_l0dv0_1qw6y_303",
30
- "divider": "awsui_divider_l0dv0_1qw6y_307",
31
- "divider-default": "awsui_divider-default_l0dv0_1qw6y_313",
32
- "divider-header": "awsui_divider-header_l0dv0_1qw6y_318"
5
+ "root": "awsui_root_l0dv0_1igbc_99",
6
+ "header": "awsui_header_l0dv0_1igbc_136",
7
+ "header-link": "awsui_header-link_l0dv0_1igbc_149",
8
+ "header-link--has-logo": "awsui_header-link--has-logo_l0dv0_1igbc_159",
9
+ "header-link-text": "awsui_header-link-text_l0dv0_1igbc_159",
10
+ "header-logo": "awsui_header-logo_l0dv0_1igbc_164",
11
+ "header-logo--stretched": "awsui_header-logo--stretched_l0dv0_1igbc_170",
12
+ "list-container": "awsui_list-container_l0dv0_1igbc_175",
13
+ "list": "awsui_list_l0dv0_1igbc_175",
14
+ "list-variant-root": "awsui_list-variant-root_l0dv0_1igbc_187",
15
+ "list-variant-root--last": "awsui_list-variant-root--last_l0dv0_1igbc_194",
16
+ "list-variant-expandable-link-group": "awsui_list-variant-expandable-link-group_l0dv0_1igbc_198",
17
+ "list-item": "awsui_list-item_l0dv0_1igbc_202",
18
+ "section": "awsui_section_l0dv0_1igbc_210",
19
+ "expandable-link-group": "awsui_expandable-link-group_l0dv0_1igbc_211",
20
+ "section--no-ident": "awsui_section--no-ident_l0dv0_1igbc_214",
21
+ "expandable-link-group--no-ident": "awsui_expandable-link-group--no-ident_l0dv0_1igbc_215",
22
+ "refresh": "awsui_refresh_l0dv0_1igbc_223",
23
+ "list-variant-section-group": "awsui_list-variant-section-group_l0dv0_1igbc_231",
24
+ "section-group": "awsui_section-group_l0dv0_1igbc_238",
25
+ "section-group-title": "awsui_section-group-title_l0dv0_1igbc_249",
26
+ "link": "awsui_link_l0dv0_1igbc_253",
27
+ "link-active": "awsui_link-active_l0dv0_1igbc_262",
28
+ "info": "awsui_info_l0dv0_1igbc_299",
29
+ "external-icon": "awsui_external-icon_l0dv0_1igbc_303",
30
+ "divider": "awsui_divider_l0dv0_1igbc_307",
31
+ "divider-default": "awsui_divider-default_l0dv0_1igbc_312",
32
+ "divider-header": "awsui_divider-header_l0dv0_1igbc_318"
33
33
  };
34
34
 
@@ -3,6 +3,6 @@ import { TableBodyCellProps } from './index';
3
3
  interface DisabledInlineEditorProps<ItemType> extends TableBodyCellProps<ItemType> {
4
4
  editDisabledReason: string;
5
5
  }
6
- export declare function DisabledInlineEditor<ItemType>({ className, item, column, ariaLabels, isEditing, onEditStart, onEditEnd, editDisabledReason, isVisualRefresh, interactiveCell, ...rest }: DisabledInlineEditorProps<ItemType>): JSX.Element;
6
+ export declare function DisabledInlineEditor<ItemType>({ className, item, column, ariaLabels, isEditing, onEditStart, onEditEnd, editDisabledReason, isVisualRefresh, interactiveCell, resizableColumns, ...rest }: DisabledInlineEditorProps<ItemType>): JSX.Element;
7
7
  export {};
8
8
  //# sourceMappingURL=disabled-inline-editor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"disabled-inline-editor.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/disabled-inline-editor.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,UAAU,yBAAyB,CAAC,QAAQ,CAAE,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAChF,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,EAC7C,SAAS,EACT,IAAI,EACJ,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,eAAsB,EACtB,GAAG,IAAI,EACR,EAAE,yBAAyB,CAAC,QAAQ,CAAC,eAoGrC"}
1
+ {"version":3,"file":"disabled-inline-editor.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/disabled-inline-editor.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAI7C,UAAU,yBAAyB,CAAC,QAAQ,CAAE,SAAQ,kBAAkB,CAAC,QAAQ,CAAC;IAChF,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,EAC7C,SAAS,EACT,IAAI,EACJ,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,eAAsB,EACtB,gBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,yBAAyB,CAAC,QAAQ,CAAC,eAqGrC"}
@@ -16,7 +16,7 @@ import styles from './styles.css.js';
16
16
  import { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context';
17
17
  export function DisabledInlineEditor(_a) {
18
18
  var _b;
19
- var { className, item, column, ariaLabels, isEditing, onEditStart, onEditEnd, editDisabledReason, isVisualRefresh, interactiveCell = true } = _a, rest = __rest(_a, ["className", "item", "column", "ariaLabels", "isEditing", "onEditStart", "onEditEnd", "editDisabledReason", "isVisualRefresh", "interactiveCell"]);
19
+ var { className, item, column, ariaLabels, isEditing, onEditStart, onEditEnd, editDisabledReason, isVisualRefresh, interactiveCell = true, resizableColumns = false } = _a, rest = __rest(_a, ["className", "item", "column", "ariaLabels", "isEditing", "onEditStart", "onEditEnd", "editDisabledReason", "isVisualRefresh", "interactiveCell", "resizableColumns"]);
20
20
  const clickAwayRef = useClickAway(() => {
21
21
  if (isEditing) {
22
22
  onEditEnd(true);
@@ -42,7 +42,7 @@ export function DisabledInlineEditor(_a) {
42
42
  const { targetProps, descriptionEl } = useHiddenDescription(editDisabledReason);
43
43
  const portalClasses = usePortalModeClasses(portalRef);
44
44
  const { tabIndex } = useSingleTabStopNavigation(buttonRef);
45
- return (React.createElement(TableTdElement, Object.assign({}, rest, { nativeAttributes: { 'data-inline-editing-active': isEditing.toString() }, className: clsx(className, styles['body-cell-editable'], interactiveCell && styles['body-cell-interactive'], isEditing && styles['body-cell-edit-disabled-popover'], isVisualRefresh && styles['is-visual-refresh']), onClick: interactiveCell && !isEditing ? onClick : undefined, onMouseEnter: () => setHasHover(true), onMouseLeave: () => setHasHover(false), ref: clickAwayRef }),
45
+ return (React.createElement(TableTdElement, Object.assign({}, rest, { nativeAttributes: { 'data-inline-editing-active': isEditing.toString() }, className: clsx(className, styles['body-cell-editable'], interactiveCell && styles['body-cell-interactive'], resizableColumns && styles['resizable-columns'], isEditing && styles['body-cell-edit-disabled-popover'], isVisualRefresh && styles['is-visual-refresh']), onClick: interactiveCell && !isEditing ? onClick : undefined, onMouseEnter: () => setHasHover(true), onMouseLeave: () => setHasHover(false), ref: clickAwayRef }),
46
46
  column.cell(item),
47
47
  React.createElement("div", { className: styles['body-cell-editor-wrapper'] },
48
48
  React.createElement("button", Object.assign({ ref: buttonRef, tabIndex: tabIndex, className: clsx(styles['body-cell-editor'], styles['body-cell-editor-disabled']), "aria-label": (_b = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.activateEditLabel) === null || _b === void 0 ? void 0 : _b.call(ariaLabels, column, item), "aria-haspopup": "dialog", "aria-disabled": "true", onClick: !interactiveCell && !isEditing ? onClick : undefined, onFocus: () => setHasFocus(true), onBlur: () => setHasFocus(false), onKeyDown: handleEscape }, targetProps),
@@ -1 +1 @@
1
- {"version":3,"file":"disabled-inline-editor.js","sourceRoot":"","sources":["../../../../src/table/body-cell/disabled-inline-editor.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,oBAAoB,MAAM,oDAAoD,CAAC;AACtF,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAuB,MAAM,cAAc,CAAC;AAEnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AAMvG,MAAM,UAAU,oBAAoB,CAAW,EAYT;;QAZS,EAC7C,SAAS,EACT,IAAI,EACJ,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,eAAe,GAAG,IAAI,OAEc,EADjC,IAAI,cAXsC,kJAY9C,CADQ;IAEP,MAAM,YAAY,GAAG,YAAY,CAAC,GAAG,EAAE;QACrC,IAAI,SAAS,EAAE;YACb,SAAS,CAAC,IAAI,CAAC,CAAC;SACjB;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,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E,QAAQ,GAAI,EAChD,gBAAgB,EAAE,IAAI,EACtB,MAAM,EAAE,IAAI;wBAEZ,oBAAC,WAAW,IACV,aAAa,EAAE,KAAK,EACpB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC,EACnB,eAAe,EAAC,MAAM;4BAEtB,2CAAgB,QAAQ,IAAE,kBAAkB,CAAQ,CACxC,CACG,CACd,CACA,CACJ,CACR,CACc,CAClB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport useHiddenDescription from '../../button-dropdown/utils/use-hidden-description';\nimport Icon from '../../icon/internal';\nimport PopoverContainer from '../../popover/container';\nimport PopoverBody from '../../popover/body';\nimport Portal from '../../internal/components/portal';\nimport { usePortalModeClasses } from '../../internal/hooks/use-portal-mode-classes';\nimport Arrow from '../../popover/arrow';\nimport { useClickAway } from './click-away';\nimport { TableTdElement, TableTdElementProps } from './td-element';\nimport { TableBodyCellProps } from './index';\nimport styles from './styles.css.js';\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context';\n\ninterface DisabledInlineEditorProps<ItemType> extends TableBodyCellProps<ItemType> {\n editDisabledReason: string;\n}\n\nexport function DisabledInlineEditor<ItemType>({\n className,\n item,\n column,\n ariaLabels,\n isEditing,\n onEditStart,\n onEditEnd,\n editDisabledReason,\n isVisualRefresh,\n interactiveCell = true,\n ...rest\n}: DisabledInlineEditorProps<ItemType>) {\n const clickAwayRef = useClickAway(() => {\n if (isEditing) {\n onEditEnd(true);\n }\n });\n\n const [hasHover, setHasHover] = useState(false);\n const [hasFocus, setHasFocus] = useState(false);\n // When a cell is both expandable and editable the icon is always shown.\n const showIcon = hasHover || hasFocus || isEditing || !interactiveCell;\n\n const iconRef = useRef(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const portalRef = useRef<HTMLSpanElement>(null);\n\n function handleEscape(event: React.KeyboardEvent): void {\n if (event.key === 'Escape') {\n onEditEnd(true);\n }\n }\n\n const onClick = () => {\n onEditStart();\n buttonRef.current?.focus();\n };\n\n const { targetProps, descriptionEl } = useHiddenDescription(editDisabledReason);\n const portalClasses = usePortalModeClasses(portalRef);\n\n const { tabIndex } = useSingleTabStopNavigation(buttonRef);\n\n return (\n <TableTdElement\n {...rest}\n nativeAttributes={\n { 'data-inline-editing-active': isEditing.toString() } as TableTdElementProps['nativeAttributes']\n }\n className={clsx(\n className,\n styles['body-cell-editable'],\n interactiveCell && styles['body-cell-interactive'],\n isEditing && styles['body-cell-edit-disabled-popover'],\n isVisualRefresh && styles['is-visual-refresh']\n )}\n onClick={interactiveCell && !isEditing ? onClick : undefined}\n onMouseEnter={() => setHasHover(true)}\n onMouseLeave={() => setHasHover(false)}\n ref={clickAwayRef}\n >\n {column.cell(item)}\n\n <div className={styles['body-cell-editor-wrapper']}>\n <button\n ref={buttonRef}\n tabIndex={tabIndex}\n className={clsx(styles['body-cell-editor'], styles['body-cell-editor-disabled'])}\n aria-label={ariaLabels?.activateEditLabel?.(column, item)}\n aria-haspopup=\"dialog\"\n aria-disabled=\"true\"\n onClick={!interactiveCell && !isEditing ? onClick : undefined}\n onFocus={() => setHasFocus(true)}\n onBlur={() => setHasFocus(false)}\n onKeyDown={handleEscape}\n {...targetProps}\n >\n {showIcon && <Icon name=\"lock-private\" variant=\"normal\" __internalRootRef={iconRef} />}\n {descriptionEl}\n </button>\n </div>\n\n {isEditing && (\n <span ref={portalRef}>\n <Portal>\n <span className={portalClasses}>\n <PopoverContainer\n size=\"medium\"\n fixedWidth={false}\n position=\"top\"\n trackRef={iconRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={true}\n zIndex={2000}\n >\n <PopoverBody\n dismissButton={false}\n dismissAriaLabel={undefined}\n header={null}\n onDismiss={() => {}}\n overflowVisible=\"both\"\n >\n <span aria-live=\"polite\">{editDisabledReason}</span>\n </PopoverBody>\n </PopoverContainer>\n </span>\n </Portal>\n </span>\n )}\n </TableTdElement>\n );\n}\n"]}
1
+ {"version":3,"file":"disabled-inline-editor.js","sourceRoot":"","sources":["../../../../src/table/body-cell/disabled-inline-editor.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,oBAAoB,MAAM,oDAAoD,CAAC;AACtF,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAuB,MAAM,cAAc,CAAC;AAEnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,2DAA2D,CAAC;AAMvG,MAAM,UAAU,oBAAoB,CAAW,EAaT;;QAbS,EAC7C,SAAS,EACT,IAAI,EACJ,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,eAAe,GAAG,IAAI,EACtB,gBAAgB,GAAG,KAAK,OAEY,EADjC,IAAI,cAZsC,sKAa9C,CADQ;IAEP,MAAM,YAAY,GAAG,YAAY,CAAC,GAAG,EAAE;QACrC,IAAI,SAAS,EAAE;YACb,SAAS,CAAC,IAAI,CAAC,CAAC;SACjB;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,QAAQ,EAAE,WA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K,EAAE,QAAQ,CAAC,EAAE,CAAC,oBAAC,KAAK,IAAC,QAAQ,EAAE,QAAQ,GAAI,EAChD,gBAAgB,EAAE,IAAI,EACtB,MAAM,EAAE,IAAI;wBAEZ,oBAAC,WAAW,IACV,aAAa,EAAE,KAAK,EACpB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,IAAI,EACZ,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC,EACnB,eAAe,EAAC,MAAM;4BAEtB,2CAAgB,QAAQ,IAAE,kBAAkB,CAAQ,CACxC,CACG,CACd,CACA,CACJ,CACR,CACc,CAClB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport useHiddenDescription from '../../button-dropdown/utils/use-hidden-description';\nimport Icon from '../../icon/internal';\nimport PopoverContainer from '../../popover/container';\nimport PopoverBody from '../../popover/body';\nimport Portal from '../../internal/components/portal';\nimport { usePortalModeClasses } from '../../internal/hooks/use-portal-mode-classes';\nimport Arrow from '../../popover/arrow';\nimport { useClickAway } from './click-away';\nimport { TableTdElement, TableTdElementProps } from './td-element';\nimport { TableBodyCellProps } from './index';\nimport styles from './styles.css.js';\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context';\n\ninterface DisabledInlineEditorProps<ItemType> extends TableBodyCellProps<ItemType> {\n editDisabledReason: string;\n}\n\nexport function DisabledInlineEditor<ItemType>({\n className,\n item,\n column,\n ariaLabels,\n isEditing,\n onEditStart,\n onEditEnd,\n editDisabledReason,\n isVisualRefresh,\n interactiveCell = true,\n resizableColumns = false,\n ...rest\n}: DisabledInlineEditorProps<ItemType>) {\n const clickAwayRef = useClickAway(() => {\n if (isEditing) {\n onEditEnd(true);\n }\n });\n\n const [hasHover, setHasHover] = useState(false);\n const [hasFocus, setHasFocus] = useState(false);\n // When a cell is both expandable and editable the icon is always shown.\n const showIcon = hasHover || hasFocus || isEditing || !interactiveCell;\n\n const iconRef = useRef(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const portalRef = useRef<HTMLSpanElement>(null);\n\n function handleEscape(event: React.KeyboardEvent): void {\n if (event.key === 'Escape') {\n onEditEnd(true);\n }\n }\n\n const onClick = () => {\n onEditStart();\n buttonRef.current?.focus();\n };\n\n const { targetProps, descriptionEl } = useHiddenDescription(editDisabledReason);\n const portalClasses = usePortalModeClasses(portalRef);\n\n const { tabIndex } = useSingleTabStopNavigation(buttonRef);\n\n return (\n <TableTdElement\n {...rest}\n nativeAttributes={\n { 'data-inline-editing-active': isEditing.toString() } as TableTdElementProps['nativeAttributes']\n }\n className={clsx(\n className,\n styles['body-cell-editable'],\n interactiveCell && styles['body-cell-interactive'],\n resizableColumns && styles['resizable-columns'],\n isEditing && styles['body-cell-edit-disabled-popover'],\n isVisualRefresh && styles['is-visual-refresh']\n )}\n onClick={interactiveCell && !isEditing ? onClick : undefined}\n onMouseEnter={() => setHasHover(true)}\n onMouseLeave={() => setHasHover(false)}\n ref={clickAwayRef}\n >\n {column.cell(item)}\n\n <div className={styles['body-cell-editor-wrapper']}>\n <button\n ref={buttonRef}\n tabIndex={tabIndex}\n className={clsx(styles['body-cell-editor'], styles['body-cell-editor-disabled'])}\n aria-label={ariaLabels?.activateEditLabel?.(column, item)}\n aria-haspopup=\"dialog\"\n aria-disabled=\"true\"\n onClick={!interactiveCell && !isEditing ? onClick : undefined}\n onFocus={() => setHasFocus(true)}\n onBlur={() => setHasFocus(false)}\n onKeyDown={handleEscape}\n {...targetProps}\n >\n {showIcon && <Icon name=\"lock-private\" variant=\"normal\" __internalRootRef={iconRef} />}\n {descriptionEl}\n </button>\n </div>\n\n {isEditing && (\n <span ref={portalRef}>\n <Portal>\n <span className={portalClasses}>\n <PopoverContainer\n size=\"medium\"\n fixedWidth={false}\n position=\"top\"\n trackRef={iconRef}\n arrow={position => <Arrow position={position} />}\n renderWithPortal={true}\n zIndex={2000}\n >\n <PopoverBody\n dismissButton={false}\n dismissAriaLabel={undefined}\n header={null}\n onDismiss={() => {}}\n overflowVisible=\"both\"\n >\n <span aria-live=\"polite\">{editDisabledReason}</span>\n </PopoverBody>\n </PopoverContainer>\n </span>\n </Portal>\n </span>\n )}\n </TableTdElement>\n );\n}\n"]}
@@ -5,6 +5,7 @@ export interface TableBodyCellProps<ItemType> extends TableTdElementProps {
5
5
  column: TableProps.ColumnDefinition<ItemType>;
6
6
  item: ItemType;
7
7
  isEditing: boolean;
8
+ resizableColumns?: boolean;
8
9
  successfulEdit?: boolean;
9
10
  onEditStart: () => void;
10
11
  onEditEnd: (cancelled: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAkB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYnE,MAAM,WAAW,kBAAkB,CAAC,QAAQ,CAAE,SAAQ,mBAAmB;IACvE,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACrD,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA2HD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,EACtC,UAAU,EACV,GAAG,IAAI,EACR,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,eAexD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAkB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYnE,MAAM,WAAW,kBAAkB,CAAC,QAAQ,CAAE,SAAQ,mBAAmB;IACvE,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACrD,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA6HD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,EACtC,UAAU,EACV,GAAG,IAAI,EACR,EAAE,kBAAkB,CAAC,QAAQ,CAAC,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,eAexD"}
@@ -17,7 +17,7 @@ const submitHandlerFallback = () => {
17
17
  };
18
18
  function TableCellEditable(_a) {
19
19
  var _b, _c, _d;
20
- var { className, item, column, isEditing, onEditStart, onEditEnd, submitEdit, ariaLabels, isVisualRefresh, successfulEdit = false, interactiveCell = true } = _a, rest = __rest(_a, ["className", "item", "column", "isEditing", "onEditStart", "onEditEnd", "submitEdit", "ariaLabels", "isVisualRefresh", "successfulEdit", "interactiveCell"]);
20
+ var { className, item, column, isEditing, onEditStart, onEditEnd, submitEdit, ariaLabels, isVisualRefresh, resizableColumns = false, successfulEdit = false, interactiveCell = true } = _a, rest = __rest(_a, ["className", "item", "column", "isEditing", "onEditStart", "onEditEnd", "submitEdit", "ariaLabels", "isVisualRefresh", "resizableColumns", "successfulEdit", "interactiveCell"]);
21
21
  const i18n = useInternalI18n('table');
22
22
  const editActivateRef = useRef(null);
23
23
  const tdNativeAttributes = {
@@ -49,7 +49,7 @@ function TableCellEditable(_a) {
49
49
  }
50
50
  }, [hasFocus, successfulEdit, prevHasFocus, prevSuccessfulEdit]);
51
51
  const { tabIndex: editActivateTabIndex } = useSingleTabStopNavigation(editActivateRef);
52
- return (React.createElement(TableTdElement, Object.assign({}, rest, { nativeAttributes: tdNativeAttributes, className: clsx(className, styles['body-cell-editable'], interactiveCell && styles['body-cell-interactive'], isEditing && styles['body-cell-edit-active'], showSuccessIcon && showIcon && styles['body-cell-has-success'], isVisualRefresh && styles['is-visual-refresh']), onClick: interactiveCell && !isEditing ? onEditStart : undefined, onMouseEnter: () => setHasHover(true), onMouseLeave: () => setHasHover(false) }), isEditing ? (React.createElement(InlineEditor, { ariaLabels: ariaLabels, column: column, item: item, onEditEnd: options => {
52
+ return (React.createElement(TableTdElement, Object.assign({}, rest, { nativeAttributes: tdNativeAttributes, className: clsx(className, styles['body-cell-editable'], interactiveCell && styles['body-cell-interactive'], resizableColumns && styles['resizable-columns'], isEditing && styles['body-cell-edit-active'], showSuccessIcon && showIcon && styles['body-cell-has-success'], isVisualRefresh && styles['is-visual-refresh']), onClick: interactiveCell && !isEditing ? onEditStart : undefined, onMouseEnter: () => setHasHover(true), onMouseLeave: () => setHasHover(false) }), isEditing ? (React.createElement(InlineEditor, { ariaLabels: ariaLabels, column: column, item: item, onEditEnd: options => {
53
53
  setShowSuccessIcon(false);
54
54
  isFocusMoveNeededRef.current = options.refocusCell;
55
55
  onEditEnd(options.cancelled);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":";AAAA,qEAAq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AE;QAC7D,OAAO,oBAAC,iBAAiB,oBAAK,IAAI,EAAI,CAAC;KACxC;IAED,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;IAC9B,OAAO,oBAAC,cAAc,oBAAK,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAkB,CAAC;AACxE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport React, { useEffect, useRef, useState } from 'react';\nimport Icon from '../../icon/internal';\nimport { TableProps } from '../interfaces';\nimport { TableTdElement, TableTdElementProps } from './td-element';\nimport { InlineEditor } from './inline-editor';\nimport LiveRegion from '../../internal/components/live-region/index.js';\nimport { useInternalI18n } from '../../i18n/context';\nimport { usePrevious } from '../../internal/hooks/use-previous';\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context.js';\nimport { DisabledInlineEditor } from './disabled-inline-editor';\n\nconst submitHandlerFallback = () => {\n throw new Error('The function `handleSubmit` is required for editable columns');\n};\n\nexport interface TableBodyCellProps<ItemType> extends TableTdElementProps {\n column: TableProps.ColumnDefinition<ItemType>;\n item: ItemType;\n isEditing: boolean;\n successfulEdit?: boolean;\n onEditStart: () => void;\n onEditEnd: (cancelled: boolean) => void;\n submitEdit?: TableProps.SubmitEditFunction<ItemType>;\n ariaLabels: TableProps['ariaLabels'];\n interactiveCell?: boolean;\n}\n\nfunction TableCellEditable<ItemType>({\n className,\n item,\n column,\n isEditing,\n onEditStart,\n onEditEnd,\n submitEdit,\n ariaLabels,\n isVisualRefresh,\n successfulEdit = false,\n interactiveCell = true,\n ...rest\n}: TableBodyCellProps<ItemType>) {\n const i18n = useInternalI18n('table');\n const editActivateRef = useRef<HTMLButtonElement>(null);\n const tdNativeAttributes = {\n 'data-inline-editing-active': isEditing.toString(),\n };\n const isFocusMoveNeededRef = useRef(false);\n\n useEffect(() => {\n if (!isEditing && editActivateRef.current && isFocusMoveNeededRef.current) {\n isFocusMoveNeededRef.current = false;\n editActivateRef.current.focus();\n }\n }, [isEditing]);\n // To improve the initial page render performance we only show the edit icon when necessary.\n const [hasHover, setHasHover] = useState(false);\n const [hasFocus, setHasFocus] = useState(false);\n // When a cell is both expandable and editable the icon is always shown.\n const showIcon = hasHover || hasFocus || !interactiveCell;\n\n const prevSuccessfulEdit = usePrevious(successfulEdit);\n const prevHasFocus = usePrevious(hasFocus);\n const [showSuccessIcon, setShowSuccessIcon] = useState(false);\n\n useEffect(() => {\n // Hide the success icon after a successful edit, when cell loses focus.\n if (successfulEdit && prevSuccessfulEdit && !hasFocus && prevHasFocus) {\n setShowSuccessIcon(false);\n }\n // Show success icon right after a successful edit, when `successfulEdit` switches to true.\n if (successfulEdit && !prevSuccessfulEdit) {\n setShowSuccessIcon(true);\n }\n }, [hasFocus, successfulEdit, prevHasFocus, prevSuccessfulEdit]);\n\n const { tabIndex: editActivateTabIndex } = useSingleTabStopNavigation(editActivateRef);\n\n return (\n <TableTdElement\n {...rest}\n nativeAttributes={tdNativeAttributes as TableTdElementProps['nativeAttributes']}\n className={clsx(\n className,\n styles['body-cell-editable'],\n interactiveCell && styles['body-cell-interactive'],\n isEditing && styles['body-cell-edit-active'],\n showSuccessIcon && showIcon && styles['body-cell-has-success'],\n isVisualRefresh && styles['is-visual-refresh']\n )}\n onClick={interactiveCell && !isEditing ? onEditStart : undefined}\n onMouseEnter={() => setHasHover(true)}\n onMouseLeave={() => setHasHover(false)}\n >\n {isEditing ? (\n <InlineEditor\n ariaLabels={ariaLabels}\n column={column}\n item={item}\n onEditEnd={options => {\n setShowSuccessIcon(false);\n isFocusMoveNeededRef.current = options.refocusCell;\n onEditEnd(options.cancelled);\n }}\n submitEdit={submitEdit ?? submitHandlerFallback}\n />\n ) : (\n <>\n {column.cell(item)}\n\n {showSuccessIcon && showIcon && (\n <>\n <span\n className={styles['body-cell-success']}\n aria-label={ariaLabels?.successfulEditLabel?.(column)}\n role=\"img\"\n onMouseDown={e => {\n // Prevent the editor's Button blur event to be fired when clicking the success icon.\n // This prevents unfocusing the button and triggers the `TableTdElement` onClick event which initiates the edit mode.\n e.preventDefault();\n }}\n >\n <Icon name=\"status-positive\" variant=\"success\" />\n </span>\n <LiveRegion>\n {i18n('ariaLabels.successfulEditLabel', ariaLabels?.successfulEditLabel?.(column))}\n </LiveRegion>\n </>\n )}\n\n <div className={styles['body-cell-editor-wrapper']}>\n <button\n className={styles['body-cell-editor']}\n aria-label={ariaLabels?.activateEditLabel?.(column, item)}\n ref={editActivateRef}\n onClick={!interactiveCell && !isEditing ? onEditStart : undefined}\n onFocus={() => setHasFocus(true)}\n onBlur={() => setHasFocus(false)}\n tabIndex={editActivateTabIndex}\n >\n {showIcon && <Icon name=\"edit\" />}\n </button>\n </div>\n </>\n )}\n </TableTdElement>\n );\n}\n\nexport function TableBodyCell<ItemType>({\n isEditable,\n ...rest\n}: TableBodyCellProps<ItemType> & { isEditable: boolean }) {\n const isExpandableColumnCell = rest.level !== undefined;\n const editDisabledReason = rest.column.editConfig?.disabledReason?.(rest.item);\n\n // Inline editing is deactivated for expandable column because editable cells are interactive\n // and cannot include interactive content such as expand toggles.\n if (editDisabledReason && !isExpandableColumnCell) {\n return <DisabledInlineEditor editDisabledReason={editDisabledReason} {...rest} />;\n }\n if ((isEditable || rest.isEditing) && !isExpandableColumnCell) {\n return <TableCellEditable {...rest} />;\n }\n\n const { column, item } = rest;\n return <TableTdElement {...rest}>{column.cell(item)}</TableTdElement>;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/body-cell/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAA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AAI,EAAE,GAAG,IAAI,CAAC;IAC9B,OAAO,oBAAC,cAAc,oBAAK,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAkB,CAAC;AACxE,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport React, { useEffect, useRef, useState } from 'react';\nimport Icon from '../../icon/internal';\nimport { TableProps } from '../interfaces';\nimport { TableTdElement, TableTdElementProps } from './td-element';\nimport { InlineEditor } from './inline-editor';\nimport LiveRegion from '../../internal/components/live-region/index.js';\nimport { useInternalI18n } from '../../i18n/context';\nimport { usePrevious } from '../../internal/hooks/use-previous';\nimport { useSingleTabStopNavigation } from '../../internal/context/single-tab-stop-navigation-context.js';\nimport { DisabledInlineEditor } from './disabled-inline-editor';\n\nconst submitHandlerFallback = () => {\n throw new Error('The function `handleSubmit` is required for editable columns');\n};\n\nexport interface TableBodyCellProps<ItemType> extends TableTdElementProps {\n column: TableProps.ColumnDefinition<ItemType>;\n item: ItemType;\n isEditing: boolean;\n resizableColumns?: boolean;\n successfulEdit?: boolean;\n onEditStart: () => void;\n onEditEnd: (cancelled: boolean) => void;\n submitEdit?: TableProps.SubmitEditFunction<ItemType>;\n ariaLabels: TableProps['ariaLabels'];\n interactiveCell?: boolean;\n}\n\nfunction TableCellEditable<ItemType>({\n className,\n item,\n column,\n isEditing,\n onEditStart,\n onEditEnd,\n submitEdit,\n ariaLabels,\n isVisualRefresh,\n resizableColumns = false,\n successfulEdit = false,\n interactiveCell = true,\n ...rest\n}: TableBodyCellProps<ItemType>) {\n const i18n = useInternalI18n('table');\n const editActivateRef = useRef<HTMLButtonElement>(null);\n const tdNativeAttributes = {\n 'data-inline-editing-active': isEditing.toString(),\n };\n const isFocusMoveNeededRef = useRef(false);\n\n useEffect(() => {\n if (!isEditing && editActivateRef.current && isFocusMoveNeededRef.current) {\n isFocusMoveNeededRef.current = false;\n editActivateRef.current.focus();\n }\n }, [isEditing]);\n // To improve the initial page render performance we only show the edit icon when necessary.\n const [hasHover, setHasHover] = useState(false);\n const [hasFocus, setHasFocus] = useState(false);\n // When a cell is both expandable and editable the icon is always shown.\n const showIcon = hasHover || hasFocus || !interactiveCell;\n\n const prevSuccessfulEdit = usePrevious(successfulEdit);\n const prevHasFocus = usePrevious(hasFocus);\n const [showSuccessIcon, setShowSuccessIcon] = useState(false);\n\n useEffect(() => {\n // Hide the success icon after a successful edit, when cell loses focus.\n if (successfulEdit && prevSuccessfulEdit && !hasFocus && prevHasFocus) {\n setShowSuccessIcon(false);\n }\n // Show success icon right after a successful edit, when `successfulEdit` switches to true.\n if (successfulEdit && !prevSuccessfulEdit) {\n setShowSuccessIcon(true);\n }\n }, [hasFocus, successfulEdit, prevHasFocus, prevSuccessfulEdit]);\n\n const { tabIndex: editActivateTabIndex } = useSingleTabStopNavigation(editActivateRef);\n\n return (\n <TableTdElement\n {...rest}\n nativeAttributes={tdNativeAttributes as TableTdElementProps['nativeAttributes']}\n className={clsx(\n className,\n styles['body-cell-editable'],\n interactiveCell && styles['body-cell-interactive'],\n resizableColumns && styles['resizable-columns'],\n isEditing && styles['body-cell-edit-active'],\n showSuccessIcon && showIcon && styles['body-cell-has-success'],\n isVisualRefresh && styles['is-visual-refresh']\n )}\n onClick={interactiveCell && !isEditing ? onEditStart : undefined}\n onMouseEnter={() => setHasHover(true)}\n onMouseLeave={() => setHasHover(false)}\n >\n {isEditing ? (\n <InlineEditor\n ariaLabels={ariaLabels}\n column={column}\n item={item}\n onEditEnd={options => {\n setShowSuccessIcon(false);\n isFocusMoveNeededRef.current = options.refocusCell;\n onEditEnd(options.cancelled);\n }}\n submitEdit={submitEdit ?? submitHandlerFallback}\n />\n ) : (\n <>\n {column.cell(item)}\n\n {showSuccessIcon && showIcon && (\n <>\n <span\n className={styles['body-cell-success']}\n aria-label={ariaLabels?.successfulEditLabel?.(column)}\n role=\"img\"\n onMouseDown={e => {\n // Prevent the editor's Button blur event to be fired when clicking the success icon.\n // This prevents unfocusing the button and triggers the `TableTdElement` onClick event which initiates the edit mode.\n e.preventDefault();\n }}\n >\n <Icon name=\"status-positive\" variant=\"success\" />\n </span>\n <LiveRegion>\n {i18n('ariaLabels.successfulEditLabel', ariaLabels?.successfulEditLabel?.(column))}\n </LiveRegion>\n </>\n )}\n\n <div className={styles['body-cell-editor-wrapper']}>\n <button\n className={styles['body-cell-editor']}\n aria-label={ariaLabels?.activateEditLabel?.(column, item)}\n ref={editActivateRef}\n onClick={!interactiveCell && !isEditing ? onEditStart : undefined}\n onFocus={() => setHasFocus(true)}\n onBlur={() => setHasFocus(false)}\n tabIndex={editActivateTabIndex}\n >\n {showIcon && <Icon name=\"edit\" />}\n </button>\n </div>\n </>\n )}\n </TableTdElement>\n );\n}\n\nexport function TableBodyCell<ItemType>({\n isEditable,\n ...rest\n}: TableBodyCellProps<ItemType> & { isEditable: boolean }) {\n const isExpandableColumnCell = rest.level !== undefined;\n const editDisabledReason = rest.column.editConfig?.disabledReason?.(rest.item);\n\n // Inline editing is deactivated for expandable column because editable cells are interactive\n // and cannot include interactive content such as expand toggles.\n if (editDisabledReason && !isExpandableColumnCell) {\n return <DisabledInlineEditor editDisabledReason={editDisabledReason} {...rest} />;\n }\n if ((isEditable || rest.isEditing) && !isExpandableColumnCell) {\n return <TableCellEditable {...rest} />;\n }\n\n const { column, item } = rest;\n return <TableTdElement {...rest}>{column.cell(item)}</TableTdElement>;\n}\n"]}