@cloudscape-design/components-themeable 3.0.865 → 3.0.867
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.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss +4 -30
- package/lib/internal/scss/internal/components/dnd-area/styles.scss +70 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts +1 -2
- package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js +2 -2
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.js +4 -6
- package/lib/internal/template/collection-preferences/content-display/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/styles.css.js +10 -12
- package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +10 -36
- package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +10 -12
- package/lib/internal/template/collection-preferences/styles.css.js +36 -38
- package/lib/internal/template/collection-preferences/styles.scoped.css +37 -63
- package/lib/internal/template/collection-preferences/styles.selectors.js +36 -38
- package/lib/internal/template/internal/components/dnd-area/index.d.ts +4 -0
- package/lib/internal/template/internal/components/dnd-area/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/{dnd-container → dnd-area}/index.js +13 -15
- package/lib/internal/template/internal/components/dnd-area/index.js.map +1 -0
- package/lib/internal/template/internal/components/{dnd-container → dnd-area}/interfaces.d.ts +13 -14
- package/lib/internal/template/internal/components/dnd-area/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/defaults.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/defaults.js.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/index.js.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/events.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/events.js.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/listeners.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/listeners.js.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/scroll.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/keyboard-sensor/utilities/scroll.js.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/styles.css.js +13 -0
- package/lib/internal/template/internal/components/{dnd-container → dnd-area}/styles.scoped.css +79 -4
- package/lib/internal/template/internal/components/dnd-area/styles.selectors.js +14 -0
- package/lib/internal/template/internal/components/{dnd-container → dnd-area}/use-drag-and-drop-reorder.d.ts +2 -2
- package/lib/internal/template/internal/components/dnd-area/use-drag-and-drop-reorder.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/use-drag-and-drop-reorder.js.map +1 -0
- package/lib/internal/template/internal/components/{dnd-container → dnd-area}/use-live-announcements.d.ts +3 -3
- package/lib/internal/template/internal/components/dnd-area/use-live-announcements.d.ts.map +1 -0
- package/lib/internal/template/internal/components/dnd-area/use-live-announcements.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/index.d.ts +7 -5
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +2 -3
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js +7 -7
- package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/scss/internal/components/dnd-container/styles.scss +0 -21
- package/lib/internal/template/internal/components/dnd-container/index.d.ts +0 -4
- package/lib/internal/template/internal/components/dnd-container/index.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/index.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/interfaces.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/interfaces.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/defaults.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/defaults.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/index.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/index.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/utilities/events.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/utilities/events.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/utilities/listeners.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/utilities/listeners.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/utilities/scroll.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/keyboard-sensor/utilities/scroll.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/styles.css.js +0 -6
- package/lib/internal/template/internal/components/dnd-container/styles.selectors.js +0 -7
- package/lib/internal/template/internal/components/dnd-container/use-drag-and-drop-reorder.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/use-drag-and-drop-reorder.js.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/use-live-announcements.d.ts.map +0 -1
- package/lib/internal/template/internal/components/dnd-container/use-live-announcements.js.map +0 -1
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/interfaces.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/defaults.d.ts +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/defaults.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/index.d.ts +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/index.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/utilities/events.d.ts +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/utilities/events.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/utilities/listeners.d.ts +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/utilities/listeners.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/utilities/scroll.d.ts +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/keyboard-sensor/utilities/scroll.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/use-drag-and-drop-reorder.js +0 -0
- /package/lib/internal/template/internal/components/{dnd-container → dnd-area}/use-live-announcements.js +0 -0
|
@@ -286,11 +286,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
286
286
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
287
287
|
SPDX-License-Identifier: Apache-2.0
|
|
288
288
|
*/
|
|
289
|
-
.awsui_content-display-option-
|
|
289
|
+
.awsui_content-display-option-toggle_1f3h0_1jgk7_289:not(#\9) {
|
|
290
290
|
/* used in test-utils */
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
.awsui_content-display-option-
|
|
293
|
+
.awsui_content-display-option-content_1f3h0_1jgk7_293:not(#\9) {
|
|
294
294
|
border-collapse: separate;
|
|
295
295
|
border-spacing: 0;
|
|
296
296
|
box-sizing: border-box;
|
|
@@ -333,52 +333,26 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
333
333
|
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
.awsui_content-display-
|
|
336
|
+
.awsui_content-display-option_1f3h0_1jgk7_289:not(#\9) {
|
|
337
337
|
list-style: none;
|
|
338
338
|
position: relative;
|
|
339
339
|
border-block-start: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
340
340
|
}
|
|
341
|
-
.awsui_content-display-option_1f3h0_1c3gl_289:not(#\9):not(.awsui_placeholder_1f3h0_1c3gl_340).awsui_sorting_1f3h0_1c3gl_340 {
|
|
342
|
-
transition: transform var(--motion-duration-transition-quick-1ym1ir, 90ms) var(--motion-easing-transition-quick-c2tqbv, linear);
|
|
343
|
-
}
|
|
344
|
-
@media (prefers-reduced-motion: reduce) {
|
|
345
|
-
.awsui_content-display-option_1f3h0_1c3gl_289:not(#\9):not(.awsui_placeholder_1f3h0_1c3gl_340).awsui_sorting_1f3h0_1c3gl_340 {
|
|
346
|
-
animation: none;
|
|
347
|
-
transition: none;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
.awsui-motion-disabled .awsui_content-display-option_1f3h0_1c3gl_289:not(#\9):not(.awsui_placeholder_1f3h0_1c3gl_340).awsui_sorting_1f3h0_1c3gl_340, .awsui-mode-entering .awsui_content-display-option_1f3h0_1c3gl_289:not(#\9):not(.awsui_placeholder_1f3h0_1c3gl_340).awsui_sorting_1f3h0_1c3gl_340 {
|
|
351
|
-
animation: none;
|
|
352
|
-
transition: none;
|
|
353
|
-
}
|
|
354
|
-
.awsui_content-display-option_1f3h0_1c3gl_289.awsui_placeholder_1f3h0_1c3gl_340 > .awsui_content-display-option-content_1f3h0_1c3gl_293:not(#\9) {
|
|
355
|
-
position: relative;
|
|
356
|
-
}
|
|
357
|
-
.awsui_content-display-option_1f3h0_1c3gl_289.awsui_placeholder_1f3h0_1c3gl_340 > .awsui_content-display-option-content_1f3h0_1c3gl_293:not(#\9):after {
|
|
358
|
-
content: " ";
|
|
359
|
-
position: absolute;
|
|
360
|
-
inset: 0;
|
|
361
|
-
background: var(--color-drag-placeholder-hover-gowvta, #99cbe4);
|
|
362
|
-
border-start-start-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
363
|
-
border-start-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
364
|
-
border-end-start-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
365
|
-
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
366
|
-
}
|
|
367
341
|
|
|
368
|
-
.awsui_content-display-option-
|
|
342
|
+
.awsui_content-display-option-label_1f3h0_1jgk7_341:not(#\9) {
|
|
369
343
|
flex-grow: 1;
|
|
370
344
|
min-inline-size: 0;
|
|
371
345
|
word-break: break-word;
|
|
372
346
|
padding-inline-end: var(--space-l-eenfqd, 20px);
|
|
373
347
|
}
|
|
374
348
|
|
|
375
|
-
.awsui_content-
|
|
376
|
-
.awsui_content-display-text-
|
|
377
|
-
.awsui_content-display-no-
|
|
349
|
+
.awsui_content-display_1f3h0_1jgk7_289:not(#\9),
|
|
350
|
+
.awsui_content-display-text-filter_1f3h0_1jgk7_349:not(#\9),
|
|
351
|
+
.awsui_content-display-no-match_1f3h0_1jgk7_350:not(#\9) {
|
|
378
352
|
/* used in test-utils */
|
|
379
353
|
}
|
|
380
354
|
|
|
381
|
-
.awsui_content-display-
|
|
355
|
+
.awsui_content-display-title_1f3h0_1jgk7_354:not(#\9) {
|
|
382
356
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
383
357
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
384
358
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -387,7 +361,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
387
361
|
margin-inline: 0;
|
|
388
362
|
}
|
|
389
363
|
|
|
390
|
-
.awsui_content-display-
|
|
364
|
+
.awsui_content-display-description_1f3h0_1jgk7_363:not(#\9) {
|
|
391
365
|
color: var(--color-text-form-secondary-5q4khe, #687078);
|
|
392
366
|
font-size: var(--font-size-body-s-4dzx5q, 12px);
|
|
393
367
|
line-height: var(--line-height-body-s-egzl4q, 16px);
|
|
@@ -395,7 +369,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
395
369
|
margin-block-start: var(--space-scaled-xxxs-6vyqo7, 2px);
|
|
396
370
|
}
|
|
397
371
|
|
|
398
|
-
.awsui_content-display-option-
|
|
372
|
+
.awsui_content-display-option-list_1f3h0_1jgk7_371:not(#\9) {
|
|
399
373
|
position: relative;
|
|
400
374
|
list-style: none;
|
|
401
375
|
padding-block: 0;
|
|
@@ -2,17 +2,15 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
6
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
7
|
-
"content-display-option": "awsui_content-display-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"content-display-
|
|
11
|
-
"content-display": "awsui_content-
|
|
12
|
-
"content-display-
|
|
13
|
-
"content-display-
|
|
14
|
-
"content-display-
|
|
15
|
-
"content-display-description": "awsui_content-display-description_1f3h0_1c3gl_389",
|
|
16
|
-
"content-display-option-list": "awsui_content-display-option-list_1f3h0_1c3gl_397"
|
|
5
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_1f3h0_1jgk7_289",
|
|
6
|
+
"content-display-option-content": "awsui_content-display-option-content_1f3h0_1jgk7_293",
|
|
7
|
+
"content-display-option": "awsui_content-display-option_1f3h0_1jgk7_289",
|
|
8
|
+
"content-display-option-label": "awsui_content-display-option-label_1f3h0_1jgk7_341",
|
|
9
|
+
"content-display": "awsui_content-display_1f3h0_1jgk7_289",
|
|
10
|
+
"content-display-text-filter": "awsui_content-display-text-filter_1f3h0_1jgk7_349",
|
|
11
|
+
"content-display-no-match": "awsui_content-display-no-match_1f3h0_1jgk7_350",
|
|
12
|
+
"content-display-title": "awsui_content-display-title_1f3h0_1jgk7_354",
|
|
13
|
+
"content-display-description": "awsui_content-display-description_1f3h0_1jgk7_363",
|
|
14
|
+
"content-display-option-list": "awsui_content-display-option-list_1f3h0_1jgk7_371"
|
|
17
15
|
};
|
|
18
16
|
|
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"visible-content": "awsui_visible-
|
|
5
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
6
|
-
"visible-content-groups": "awsui_visible-content-
|
|
7
|
-
"visible-content-group": "awsui_visible-content-
|
|
8
|
-
"visible-content-title": "awsui_visible-content-
|
|
9
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
10
|
-
"visible-content-option": "awsui_visible-content-
|
|
11
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
12
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
13
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
14
|
-
"content-display-option": "awsui_content-display-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"content-display-
|
|
18
|
-
"content-display": "awsui_content-
|
|
19
|
-
"content-display-
|
|
20
|
-
"content-display-
|
|
21
|
-
"content-display-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"page-size": "awsui_page-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"sticky-columns": "awsui_sticky-
|
|
38
|
-
"sticky-columns-
|
|
39
|
-
"sticky-columns-
|
|
40
|
-
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_11461_757",
|
|
41
|
-
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_11461_758"
|
|
4
|
+
"visible-content": "awsui_visible-content_tc96w_4nczn_289",
|
|
5
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_4nczn_290",
|
|
6
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_4nczn_291",
|
|
7
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_4nczn_291",
|
|
8
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_4nczn_296",
|
|
9
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_4nczn_306",
|
|
10
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_4nczn_312",
|
|
11
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_4nczn_325",
|
|
12
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_4nczn_620",
|
|
13
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_4nczn_624",
|
|
14
|
+
"content-display-option": "awsui_content-display-option_tc96w_4nczn_620",
|
|
15
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_4nczn_672",
|
|
16
|
+
"content-display": "awsui_content-display_tc96w_4nczn_620",
|
|
17
|
+
"content-display-text-filter": "awsui_content-display-text-filter_tc96w_4nczn_680",
|
|
18
|
+
"content-display-no-match": "awsui_content-display-no-match_tc96w_4nczn_681",
|
|
19
|
+
"content-display-title": "awsui_content-display-title_tc96w_4nczn_685",
|
|
20
|
+
"content-display-description": "awsui_content-display-description_tc96w_4nczn_694",
|
|
21
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_4nczn_702",
|
|
22
|
+
"root": "awsui_root_tc96w_4nczn_709",
|
|
23
|
+
"modal-root": "awsui_modal-root_tc96w_4nczn_710",
|
|
24
|
+
"trigger-button": "awsui_trigger-button_tc96w_4nczn_711",
|
|
25
|
+
"cancel-button": "awsui_cancel-button_tc96w_4nczn_712",
|
|
26
|
+
"confirm-button": "awsui_confirm-button_tc96w_4nczn_713",
|
|
27
|
+
"custom": "awsui_custom_tc96w_4nczn_714",
|
|
28
|
+
"second-column-small": "awsui_second-column-small_tc96w_4nczn_718",
|
|
29
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_4nczn_722",
|
|
30
|
+
"striped-rows": "awsui_striped-rows_tc96w_4nczn_723",
|
|
31
|
+
"content-density": "awsui_content-density_tc96w_4nczn_724",
|
|
32
|
+
"page-size": "awsui_page-size_tc96w_4nczn_725",
|
|
33
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_4nczn_726",
|
|
34
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_4nczn_727",
|
|
35
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_4nczn_728",
|
|
36
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_4nczn_729",
|
|
37
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_4nczn_730",
|
|
38
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_4nczn_731",
|
|
39
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_4nczn_732"
|
|
42
40
|
};
|
|
43
41
|
|
|
@@ -286,14 +286,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
286
286
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
287
287
|
SPDX-License-Identifier: Apache-2.0
|
|
288
288
|
*/
|
|
289
|
-
.awsui_visible-
|
|
290
|
-
.awsui_visible-content-
|
|
291
|
-
.awsui_visible-content-
|
|
292
|
-
.awsui_visible-content-
|
|
289
|
+
.awsui_visible-content_tc96w_4nczn_289:not(#\9),
|
|
290
|
+
.awsui_visible-content-toggle_tc96w_4nczn_290:not(#\9),
|
|
291
|
+
.awsui_visible-content-groups_tc96w_4nczn_291:not(#\9),
|
|
292
|
+
.awsui_visible-content-group_tc96w_4nczn_291:not(#\9) {
|
|
293
293
|
/* used in test-utils */
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
.awsui_visible-content-
|
|
296
|
+
.awsui_visible-content-title_tc96w_4nczn_296:not(#\9) {
|
|
297
297
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
298
298
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
299
299
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -303,13 +303,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
303
303
|
margin-inline: 0;
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
.awsui_visible-content-group-
|
|
306
|
+
.awsui_visible-content-group-label_tc96w_4nczn_306:not(#\9) {
|
|
307
307
|
color: var(--color-text-group-label-eorpbe, #545b64);
|
|
308
308
|
padding-block-end: var(--space-xs-6dgkww, 8px);
|
|
309
309
|
border-block-end: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
.awsui_visible-content-
|
|
312
|
+
.awsui_visible-content-option_tc96w_4nczn_312:not(#\9) {
|
|
313
313
|
display: flex;
|
|
314
314
|
flex-wrap: nowrap;
|
|
315
315
|
justify-content: space-between;
|
|
@@ -318,11 +318,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
318
318
|
padding-inline-end: 0px;
|
|
319
319
|
border-block-end: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
320
320
|
}
|
|
321
|
-
.awsui_visible-content-
|
|
321
|
+
.awsui_visible-content-option_tc96w_4nczn_312:not(#\9):last-child {
|
|
322
322
|
border-block-end: none;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
.awsui_visible-content-option-
|
|
325
|
+
.awsui_visible-content-option-label_tc96w_4nczn_325:not(#\9) {
|
|
326
326
|
overflow: hidden;
|
|
327
327
|
text-overflow: ellipsis;
|
|
328
328
|
padding-inline-end: var(--space-l-eenfqd, 20px);
|
|
@@ -617,11 +617,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
617
617
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
618
618
|
SPDX-License-Identifier: Apache-2.0
|
|
619
619
|
*/
|
|
620
|
-
.awsui_content-display-option-
|
|
620
|
+
.awsui_content-display-option-toggle_tc96w_4nczn_620:not(#\9) {
|
|
621
621
|
/* used in test-utils */
|
|
622
622
|
}
|
|
623
623
|
|
|
624
|
-
.awsui_content-display-option-
|
|
624
|
+
.awsui_content-display-option-content_tc96w_4nczn_624:not(#\9) {
|
|
625
625
|
border-collapse: separate;
|
|
626
626
|
border-spacing: 0;
|
|
627
627
|
box-sizing: border-box;
|
|
@@ -664,52 +664,26 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
664
664
|
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
665
665
|
}
|
|
666
666
|
|
|
667
|
-
.awsui_content-display-
|
|
667
|
+
.awsui_content-display-option_tc96w_4nczn_620:not(#\9) {
|
|
668
668
|
list-style: none;
|
|
669
669
|
position: relative;
|
|
670
670
|
border-block-start: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
671
671
|
}
|
|
672
|
-
.awsui_content-display-option_tc96w_11461_620:not(#\9):not(.awsui_placeholder_tc96w_11461_671).awsui_sorting_tc96w_11461_671 {
|
|
673
|
-
transition: transform var(--motion-duration-transition-quick-1ym1ir, 90ms) var(--motion-easing-transition-quick-c2tqbv, linear);
|
|
674
|
-
}
|
|
675
|
-
@media (prefers-reduced-motion: reduce) {
|
|
676
|
-
.awsui_content-display-option_tc96w_11461_620:not(#\9):not(.awsui_placeholder_tc96w_11461_671).awsui_sorting_tc96w_11461_671 {
|
|
677
|
-
animation: none;
|
|
678
|
-
transition: none;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
.awsui-motion-disabled .awsui_content-display-option_tc96w_11461_620:not(#\9):not(.awsui_placeholder_tc96w_11461_671).awsui_sorting_tc96w_11461_671, .awsui-mode-entering .awsui_content-display-option_tc96w_11461_620:not(#\9):not(.awsui_placeholder_tc96w_11461_671).awsui_sorting_tc96w_11461_671 {
|
|
682
|
-
animation: none;
|
|
683
|
-
transition: none;
|
|
684
|
-
}
|
|
685
|
-
.awsui_content-display-option_tc96w_11461_620.awsui_placeholder_tc96w_11461_671 > .awsui_content-display-option-content_tc96w_11461_624:not(#\9) {
|
|
686
|
-
position: relative;
|
|
687
|
-
}
|
|
688
|
-
.awsui_content-display-option_tc96w_11461_620.awsui_placeholder_tc96w_11461_671 > .awsui_content-display-option-content_tc96w_11461_624:not(#\9):after {
|
|
689
|
-
content: " ";
|
|
690
|
-
position: absolute;
|
|
691
|
-
inset: 0;
|
|
692
|
-
background: var(--color-drag-placeholder-hover-gowvta, #99cbe4);
|
|
693
|
-
border-start-start-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
694
|
-
border-start-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
695
|
-
border-end-start-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
696
|
-
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
697
|
-
}
|
|
698
672
|
|
|
699
|
-
.awsui_content-display-option-
|
|
673
|
+
.awsui_content-display-option-label_tc96w_4nczn_672:not(#\9) {
|
|
700
674
|
flex-grow: 1;
|
|
701
675
|
min-inline-size: 0;
|
|
702
676
|
word-break: break-word;
|
|
703
677
|
padding-inline-end: var(--space-l-eenfqd, 20px);
|
|
704
678
|
}
|
|
705
679
|
|
|
706
|
-
.awsui_content-
|
|
707
|
-
.awsui_content-display-text-
|
|
708
|
-
.awsui_content-display-no-
|
|
680
|
+
.awsui_content-display_tc96w_4nczn_620:not(#\9),
|
|
681
|
+
.awsui_content-display-text-filter_tc96w_4nczn_680:not(#\9),
|
|
682
|
+
.awsui_content-display-no-match_tc96w_4nczn_681:not(#\9) {
|
|
709
683
|
/* used in test-utils */
|
|
710
684
|
}
|
|
711
685
|
|
|
712
|
-
.awsui_content-display-
|
|
686
|
+
.awsui_content-display-title_tc96w_4nczn_685:not(#\9) {
|
|
713
687
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
714
688
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
715
689
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -718,7 +692,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
718
692
|
margin-inline: 0;
|
|
719
693
|
}
|
|
720
694
|
|
|
721
|
-
.awsui_content-display-
|
|
695
|
+
.awsui_content-display-description_tc96w_4nczn_694:not(#\9) {
|
|
722
696
|
color: var(--color-text-form-secondary-5q4khe, #687078);
|
|
723
697
|
font-size: var(--font-size-body-s-4dzx5q, 12px);
|
|
724
698
|
line-height: var(--line-height-body-s-egzl4q, 16px);
|
|
@@ -726,36 +700,36 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
726
700
|
margin-block-start: var(--space-scaled-xxxs-6vyqo7, 2px);
|
|
727
701
|
}
|
|
728
702
|
|
|
729
|
-
.awsui_content-display-option-
|
|
703
|
+
.awsui_content-display-option-list_tc96w_4nczn_702:not(#\9) {
|
|
730
704
|
position: relative;
|
|
731
705
|
list-style: none;
|
|
732
706
|
padding-block: 0;
|
|
733
707
|
padding-inline: 0;
|
|
734
708
|
}
|
|
735
709
|
|
|
736
|
-
.
|
|
737
|
-
.awsui_modal-
|
|
738
|
-
.awsui_trigger-
|
|
739
|
-
.awsui_cancel-
|
|
740
|
-
.awsui_confirm-
|
|
741
|
-
.
|
|
710
|
+
.awsui_root_tc96w_4nczn_709:not(#\9),
|
|
711
|
+
.awsui_modal-root_tc96w_4nczn_710:not(#\9),
|
|
712
|
+
.awsui_trigger-button_tc96w_4nczn_711:not(#\9),
|
|
713
|
+
.awsui_cancel-button_tc96w_4nczn_712:not(#\9),
|
|
714
|
+
.awsui_confirm-button_tc96w_4nczn_713:not(#\9),
|
|
715
|
+
.awsui_custom_tc96w_4nczn_714:not(#\9) {
|
|
742
716
|
/* used in test-utils */
|
|
743
717
|
}
|
|
744
718
|
|
|
745
|
-
.awsui_second-column-
|
|
719
|
+
.awsui_second-column-small_tc96w_4nczn_718:not(#\9) {
|
|
746
720
|
padding-block-start: calc(2 * var(--space-scaled-l-7e51pg, 20px));
|
|
747
721
|
}
|
|
748
722
|
|
|
749
|
-
.awsui_wrap-
|
|
750
|
-
.awsui_striped-
|
|
751
|
-
.awsui_content-
|
|
752
|
-
.awsui_page-
|
|
753
|
-
.awsui_page-size-form-
|
|
754
|
-
.awsui_page-size-radio-
|
|
755
|
-
.awsui_sticky-
|
|
756
|
-
.awsui_sticky-columns-form-
|
|
757
|
-
.awsui_sticky-columns-radio-
|
|
758
|
-
.awsui_sticky-columns-
|
|
759
|
-
.awsui_sticky-columns-
|
|
723
|
+
.awsui_wrap-lines_tc96w_4nczn_722:not(#\9),
|
|
724
|
+
.awsui_striped-rows_tc96w_4nczn_723:not(#\9),
|
|
725
|
+
.awsui_content-density_tc96w_4nczn_724:not(#\9),
|
|
726
|
+
.awsui_page-size_tc96w_4nczn_725:not(#\9),
|
|
727
|
+
.awsui_page-size-form-field_tc96w_4nczn_726:not(#\9),
|
|
728
|
+
.awsui_page-size-radio-group_tc96w_4nczn_727:not(#\9),
|
|
729
|
+
.awsui_sticky-columns_tc96w_4nczn_728:not(#\9),
|
|
730
|
+
.awsui_sticky-columns-form-field_tc96w_4nczn_729:not(#\9),
|
|
731
|
+
.awsui_sticky-columns-radio-group_tc96w_4nczn_730:not(#\9),
|
|
732
|
+
.awsui_sticky-columns-first_tc96w_4nczn_731:not(#\9),
|
|
733
|
+
.awsui_sticky-columns-last_tc96w_4nczn_732:not(#\9) {
|
|
760
734
|
/* used in test-utils */
|
|
761
735
|
}
|
|
@@ -2,43 +2,41 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"visible-content": "awsui_visible-
|
|
6
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
7
|
-
"visible-content-groups": "awsui_visible-content-
|
|
8
|
-
"visible-content-group": "awsui_visible-content-
|
|
9
|
-
"visible-content-title": "awsui_visible-content-
|
|
10
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
11
|
-
"visible-content-option": "awsui_visible-content-
|
|
12
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
13
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
14
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
15
|
-
"content-display-option": "awsui_content-display-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"content-display-
|
|
19
|
-
"content-display": "awsui_content-
|
|
20
|
-
"content-display-
|
|
21
|
-
"content-display-
|
|
22
|
-
"content-display-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"page-size": "awsui_page-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"sticky-columns": "awsui_sticky-
|
|
39
|
-
"sticky-columns-
|
|
40
|
-
"sticky-columns-
|
|
41
|
-
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_11461_757",
|
|
42
|
-
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_11461_758"
|
|
5
|
+
"visible-content": "awsui_visible-content_tc96w_4nczn_289",
|
|
6
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_4nczn_290",
|
|
7
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_4nczn_291",
|
|
8
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_4nczn_291",
|
|
9
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_4nczn_296",
|
|
10
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_4nczn_306",
|
|
11
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_4nczn_312",
|
|
12
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_4nczn_325",
|
|
13
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_4nczn_620",
|
|
14
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_4nczn_624",
|
|
15
|
+
"content-display-option": "awsui_content-display-option_tc96w_4nczn_620",
|
|
16
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_4nczn_672",
|
|
17
|
+
"content-display": "awsui_content-display_tc96w_4nczn_620",
|
|
18
|
+
"content-display-text-filter": "awsui_content-display-text-filter_tc96w_4nczn_680",
|
|
19
|
+
"content-display-no-match": "awsui_content-display-no-match_tc96w_4nczn_681",
|
|
20
|
+
"content-display-title": "awsui_content-display-title_tc96w_4nczn_685",
|
|
21
|
+
"content-display-description": "awsui_content-display-description_tc96w_4nczn_694",
|
|
22
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_4nczn_702",
|
|
23
|
+
"root": "awsui_root_tc96w_4nczn_709",
|
|
24
|
+
"modal-root": "awsui_modal-root_tc96w_4nczn_710",
|
|
25
|
+
"trigger-button": "awsui_trigger-button_tc96w_4nczn_711",
|
|
26
|
+
"cancel-button": "awsui_cancel-button_tc96w_4nczn_712",
|
|
27
|
+
"confirm-button": "awsui_confirm-button_tc96w_4nczn_713",
|
|
28
|
+
"custom": "awsui_custom_tc96w_4nczn_714",
|
|
29
|
+
"second-column-small": "awsui_second-column-small_tc96w_4nczn_718",
|
|
30
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_4nczn_722",
|
|
31
|
+
"striped-rows": "awsui_striped-rows_tc96w_4nczn_723",
|
|
32
|
+
"content-density": "awsui_content-density_tc96w_4nczn_724",
|
|
33
|
+
"page-size": "awsui_page-size_tc96w_4nczn_725",
|
|
34
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_4nczn_726",
|
|
35
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_4nczn_727",
|
|
36
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_4nczn_728",
|
|
37
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_4nczn_729",
|
|
38
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_4nczn_730",
|
|
39
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_4nczn_731",
|
|
40
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_4nczn_732"
|
|
43
41
|
};
|
|
44
42
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DndAreaProps } from './interfaces';
|
|
3
|
+
export declare function DndArea<Data>({ items, renderItem, onItemsChange, disableReorder, i18nStrings, borderRadiusVariant, }: DndAreaProps<Data>): JSX.Element;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/dnd-area/index.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAe,YAAY,EAAmB,MAAM,cAAc,CAAC;AAM1E,wBAAgB,OAAO,CAAC,IAAI,EAAE,EAC5B,KAAK,EACL,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,EACX,mBAA4B,GAC7B,EAAE,YAAY,CAAC,IAAI,CAAC,eA2EpB"}
|
|
@@ -4,12 +4,14 @@ import React, { useEffect, useRef } from 'react';
|
|
|
4
4
|
import { DndContext, DragOverlay } from '@dnd-kit/core';
|
|
5
5
|
import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
6
6
|
import { CSS } from '@dnd-kit/utilities';
|
|
7
|
+
import clsx from 'clsx';
|
|
7
8
|
import { joinStrings } from '../../utils/strings';
|
|
8
9
|
import Portal from '../portal';
|
|
9
10
|
import useDragAndDropReorder from './use-drag-and-drop-reorder';
|
|
10
11
|
import useLiveAnnouncements from './use-live-announcements';
|
|
11
12
|
import styles from './styles.css.js';
|
|
12
|
-
export function
|
|
13
|
+
export function DndArea({ items, renderItem, onItemsChange, disableReorder, i18nStrings, borderRadiusVariant = 'item', }) {
|
|
14
|
+
var _a;
|
|
13
15
|
const { activeItemId, setActiveItemId, collisionDetection, handleKeyDown, sensors } = useDragAndDropReorder({
|
|
14
16
|
items,
|
|
15
17
|
});
|
|
@@ -33,19 +35,18 @@ export function DndContainer({ items, renderItem, onItemsChange, disableReorder,
|
|
|
33
35
|
onItemsChange(arrayMove([...items], oldIndex, newIndex));
|
|
34
36
|
}
|
|
35
37
|
}, onDragCancel: () => setActiveItemId(null) },
|
|
36
|
-
React.createElement(SortableContext, { disabled: disableReorder, items: items.map(item => item.id), strategy: verticalListSortingStrategy }, items.map(item => (React.createElement(DraggableItem, { key: item.id, item: item, renderItem: renderItem, onKeyDown: handleKeyDown, dragHandleAriaLabel: i18nStrings.dragHandleAriaLabel })))),
|
|
38
|
+
React.createElement(SortableContext, { disabled: disableReorder, items: items.map(item => item.id), strategy: verticalListSortingStrategy }, items.map(item => (React.createElement(DraggableItem, { key: item.id, item: item, renderItem: renderItem, onKeyDown: handleKeyDown, dragHandleAriaLabel: i18nStrings.dragHandleAriaLabel, borderRadiusVariant: borderRadiusVariant })))),
|
|
37
39
|
React.createElement(Portal, { container: portalContainer },
|
|
38
|
-
React.createElement(DragOverlay, { className:
|
|
40
|
+
React.createElement(DragOverlay, { className: clsx(styles['drag-overlay'], styles[`drag-overlay-${borderRadiusVariant}`]), dropAnimation: null, style: { zIndex: 5000 } }, activeItem &&
|
|
39
41
|
renderItem({
|
|
40
42
|
item: activeItem,
|
|
41
43
|
style: {},
|
|
44
|
+
className: styles.active,
|
|
42
45
|
isDragging: true,
|
|
43
46
|
isSorting: false,
|
|
44
47
|
isActive: true,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
dragHandleListeners: {
|
|
48
|
+
dragHandleProps: {
|
|
49
|
+
ariaLabel: (_a = joinStrings(i18nStrings.dragHandleAriaLabel, activeItem.label)) !== null && _a !== void 0 ? _a : '',
|
|
49
50
|
onKeyDown: handleKeyDown,
|
|
50
51
|
},
|
|
51
52
|
})))));
|
|
@@ -65,7 +66,8 @@ function usePortalContainer() {
|
|
|
65
66
|
}, []);
|
|
66
67
|
return portalContainerRef.current;
|
|
67
68
|
}
|
|
68
|
-
function DraggableItem({ item, dragHandleAriaLabel, onKeyDown, renderItem, }) {
|
|
69
|
+
function DraggableItem({ item, dragHandleAriaLabel, onKeyDown, renderItem, borderRadiusVariant, }) {
|
|
70
|
+
var _a;
|
|
69
71
|
const { isDragging, isSorting, listeners, setNodeRef, transform, attributes } = useSortable({ id: item.id });
|
|
70
72
|
const style = { transform: CSS.Translate.toString(transform) };
|
|
71
73
|
const dragHandleListeners = attributes['aria-disabled']
|
|
@@ -78,20 +80,16 @@ function DraggableItem({ item, dragHandleAriaLabel, onKeyDown, renderItem, }) {
|
|
|
78
80
|
listeners.onKeyDown(event);
|
|
79
81
|
}
|
|
80
82
|
} });
|
|
81
|
-
const
|
|
82
|
-
['aria-label']: joinStrings(dragHandleAriaLabel, item.label),
|
|
83
|
-
['aria-describedby']: attributes['aria-describedby'],
|
|
84
|
-
['aria-disabled']: attributes['aria-disabled'],
|
|
85
|
-
};
|
|
83
|
+
const className = clsx(isDragging && clsx(styles.placeholder, styles[`placeholder-${borderRadiusVariant}`]), isSorting && styles.sorting);
|
|
86
84
|
return (React.createElement(React.Fragment, null, renderItem({
|
|
87
85
|
item,
|
|
88
86
|
ref: setNodeRef,
|
|
89
87
|
style,
|
|
88
|
+
className,
|
|
90
89
|
isDragging,
|
|
91
90
|
isSorting,
|
|
92
91
|
isActive: false,
|
|
93
|
-
dragHandleListeners,
|
|
94
|
-
dragHandleAttributes,
|
|
92
|
+
dragHandleProps: Object.assign(Object.assign({}, dragHandleListeners), { ariaLabel: (_a = joinStrings(dragHandleAriaLabel, item.label)) !== null && _a !== void 0 ? _a : '', ariaDescribedby: attributes['aria-describedby'], disabled: attributes['aria-disabled'] }),
|
|
95
93
|
})));
|
|
96
94
|
}
|
|
97
95
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/dnd-area/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACzG,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,qBAAq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BAAmB,GAAG,UAAU,CAAC,eAAe,CAAC;QACrD,CAAC,CAAC,EAAE;QACJ,CAAC,iCACM,SAAS,KACZ,SAAS,EAAE,CAAC,KAA0B,EAAE,EAAE;gBACxC,IAAI,SAAS,EAAE;oBACb,SAAS,CAAC,KAAK,CAAC,CAAC;iBAClB;gBACD,IAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,EAAE;oBACxB,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;iBAC5B;YACH,CAAC,GACF,CAAC;IACN,MAAM,SAAS,GAAG,IAAI,CACpB,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,eAAe,mBAAmB,EAAE,CAAC,CAAC,EACpF,SAAS,IAAI,MAAM,CAAC,OAAO,CAC5B,CAAC;IACF,OAAO,CACL,0CACG,UAAU,CAAC;QACV,IAAI;QACJ,GAAG,EAAE,UAAU;QACf,KAAK;QACL,SAAS;QACT,UAAU;QACV,SAAS;QACT,QAAQ,EAAE,KAAK;QACf,eAAe,kCACV,mBAAmB,KACtB,SAAS,EAAE,MAAA,WAAW,CAAC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,mCAAI,EAAE,EAC7D,eAAe,EAAE,UAAU,CAAC,kBAAkB,CAAC,EAC/C,QAAQ,EAAE,UAAU,CAAC,eAAe,CAAC,GACtC;KACF,CAAC,CACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useRef } from 'react';\nimport { DndContext, DragOverlay } from '@dnd-kit/core';\nimport { arrayMove, SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport clsx from 'clsx';\n\nimport { joinStrings } from '../../utils/strings';\nimport Portal from '../portal';\nimport { DndAreaItem, DndAreaProps, RenderItemProps } from './interfaces';\nimport useDragAndDropReorder from './use-drag-and-drop-reorder';\nimport useLiveAnnouncements from './use-live-announcements';\n\nimport styles from './styles.css.js';\n\nexport function DndArea<Data>({\n items,\n renderItem,\n onItemsChange,\n disableReorder,\n i18nStrings,\n borderRadiusVariant = 'item',\n}: DndAreaProps<Data>) {\n const { activeItemId, setActiveItemId, collisionDetection, handleKeyDown, sensors } = useDragAndDropReorder({\n items,\n });\n const activeItem = activeItemId ? items.find(item => item.id === activeItemId) : null;\n const isDragging = activeItemId !== null;\n const announcements = useLiveAnnouncements({ items, isDragging, ...i18nStrings });\n const portalContainer = usePortalContainer();\n return (\n <DndContext\n sensors={sensors}\n collisionDetection={collisionDetection}\n accessibility={{\n announcements,\n restoreFocus: false,\n screenReaderInstructions: i18nStrings.dragHandleAriaDescription\n ? { draggable: i18nStrings.dragHandleAriaDescription }\n : undefined,\n container: portalContainer,\n }}\n onDragStart={({ active }) => setActiveItemId(active.id)}\n onDragEnd={event => {\n setActiveItemId(null);\n const { active, over } = event;\n\n if (over && active.id !== over.id) {\n const oldIndex = items.findIndex(item => item.id === active.id);\n const newIndex = items.findIndex(item => item.id === over.id);\n onItemsChange(arrayMove([...items], oldIndex, newIndex));\n }\n }}\n onDragCancel={() => setActiveItemId(null)}\n >\n <SortableContext\n disabled={disableReorder}\n items={items.map(item => item.id)}\n strategy={verticalListSortingStrategy}\n >\n {items.map(item => (\n <DraggableItem\n key={item.id}\n item={item}\n renderItem={renderItem}\n onKeyDown={handleKeyDown}\n dragHandleAriaLabel={i18nStrings.dragHandleAriaLabel}\n borderRadiusVariant={borderRadiusVariant}\n />\n ))}\n </SortableContext>\n\n <Portal container={portalContainer}>\n {/* Make sure that the drag overlay is above the modal by assigning the z-index as inline style\n so that it prevails over dnd-kit's inline z-index of 999 */}\n <DragOverlay\n className={clsx(styles['drag-overlay'], styles[`drag-overlay-${borderRadiusVariant}`])}\n dropAnimation={null}\n style={{ zIndex: 5000 }}\n >\n {activeItem &&\n renderItem({\n item: activeItem,\n style: {},\n className: styles.active,\n isDragging: true,\n isSorting: false,\n isActive: true,\n dragHandleProps: {\n ariaLabel: joinStrings(i18nStrings.dragHandleAriaLabel, activeItem.label) ?? '',\n onKeyDown: handleKeyDown,\n },\n })}\n </DragOverlay>\n </Portal>\n </DndContext>\n );\n}\n\nfunction usePortalContainer() {\n const portalContainerRef = useRef(document.createElement('div'));\n useEffect(() => {\n const container = portalContainerRef.current;\n if (!container.isConnected) {\n document.body.appendChild(container);\n }\n return () => {\n if (container.isConnected) {\n document.body.removeChild(container);\n }\n };\n }, []);\n return portalContainerRef.current;\n}\n\nfunction DraggableItem<Data>({\n item,\n dragHandleAriaLabel,\n onKeyDown,\n renderItem,\n borderRadiusVariant,\n}: {\n item: DndAreaItem<Data>;\n dragHandleAriaLabel?: string;\n onKeyDown: (event: React.KeyboardEvent) => void;\n renderItem: (props: RenderItemProps<Data>) => React.ReactNode;\n borderRadiusVariant: 'item' | 'container';\n}) {\n const { isDragging, isSorting, listeners, setNodeRef, transform, attributes } = useSortable({ id: item.id });\n const style = { transform: CSS.Translate.toString(transform) };\n const dragHandleListeners = attributes['aria-disabled']\n ? {}\n : {\n ...listeners,\n onKeyDown: (event: React.KeyboardEvent) => {\n if (onKeyDown) {\n onKeyDown(event);\n }\n if (listeners?.onKeyDown) {\n listeners.onKeyDown(event);\n }\n },\n };\n const className = clsx(\n isDragging && clsx(styles.placeholder, styles[`placeholder-${borderRadiusVariant}`]),\n isSorting && styles.sorting\n );\n return (\n <>\n {renderItem({\n item,\n ref: setNodeRef,\n style,\n className,\n isDragging,\n isSorting,\n isActive: false,\n dragHandleProps: {\n ...dragHandleListeners,\n ariaLabel: joinStrings(dragHandleAriaLabel, item.label) ?? '',\n ariaDescribedby: attributes['aria-describedby'],\n disabled: attributes['aria-disabled'],\n },\n })}\n </>\n );\n}\n"]}
|