@cloudscape-design/components-themeable 3.0.1141 → 3.0.1143
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/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/status-indicator/styles.scss +1 -0
- package/lib/internal/template/collection-preferences/visible-content.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/visible-content.js +1 -1
- package/lib/internal/template/collection-preferences/visible-content.js.map +1 -1
- package/lib/internal/template/icon/generated/icons.d.ts +1 -0
- package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
- package/lib/internal/template/icon/generated/icons.js +2 -0
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon/interfaces.d.ts +1 -1
- package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon/interfaces.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +1 -0
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/plugins/api.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/api.js +1 -3
- package/lib/internal/template/internal/plugins/api.js.map +1 -1
- package/lib/internal/template/internal/utils/check-safe-url.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/check-safe-url.js +1 -3
- package/lib/internal/template/internal/utils/check-safe-url.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js +2 -10
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.d.ts.map +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.js +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.js.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.d.ts +1 -1
- package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
- package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/internal.js +1 -0
- package/lib/internal/template/status-indicator/internal.js.map +1 -1
- package/lib/internal/template/status-indicator/styles.css.js +24 -23
- package/lib/internal/template/status-indicator/styles.scoped.css +32 -29
- package/lib/internal/template/status-indicator/styles.selectors.js +24 -23
- package/lib/internal/template/steps/internal.d.ts.map +1 -1
- package/lib/internal/template/steps/internal.js +1 -0
- package/lib/internal/template/steps/internal.js.map +1 -1
- package/lib/internal/template/table/body-cell/inline-editor.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/inline-editor.js +1 -3
- package/lib/internal/template/table/body-cell/inline-editor.js.map +1 -1
- package/package.json +1 -1
|
@@ -150,11 +150,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
151
151
|
SPDX-License-Identifier: Apache-2.0
|
|
152
152
|
*/
|
|
153
|
-
.awsui_icon-
|
|
153
|
+
.awsui_icon-shake_1cbgc_zrca7_153:not(#\9) {
|
|
154
154
|
display: inline-block;
|
|
155
|
-
animation: awsui_awsui-motion-shake-
|
|
155
|
+
animation: awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1 var(--motion-duration-refresh-only-medium-h3wrr6, 0ms);
|
|
156
156
|
}
|
|
157
|
-
@keyframes awsui_awsui-motion-shake-
|
|
157
|
+
@keyframes awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1 {
|
|
158
158
|
0% {
|
|
159
159
|
transform: translateX(-5px);
|
|
160
160
|
animation-timing-function: linear;
|
|
@@ -168,20 +168,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
@media (prefers-reduced-motion: reduce) {
|
|
171
|
-
.awsui_icon-
|
|
171
|
+
.awsui_icon-shake_1cbgc_zrca7_153:not(#\9) {
|
|
172
172
|
animation: none;
|
|
173
173
|
transition: none;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
.awsui-motion-disabled .awsui_icon-
|
|
176
|
+
.awsui-motion-disabled .awsui_icon-shake_1cbgc_zrca7_153:not(#\9), .awsui-mode-entering .awsui_icon-shake_1cbgc_zrca7_153:not(#\9) {
|
|
177
177
|
animation: none;
|
|
178
178
|
transition: none;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.awsui_container-fade-
|
|
182
|
-
animation: awsui_awsui-motion-fade-in-
|
|
181
|
+
.awsui_container-fade-in_1cbgc_zrca7_181:not(#\9) {
|
|
182
|
+
animation: awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1 var(--motion-duration-refresh-only-medium-h3wrr6, 0ms) var(--motion-easing-refresh-only-a-8gio5w, cubic-bezier(0, 0, 0, 1));
|
|
183
183
|
}
|
|
184
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
184
|
+
@keyframes awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1 {
|
|
185
185
|
from {
|
|
186
186
|
opacity: 0;
|
|
187
187
|
}
|
|
@@ -190,17 +190,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
@media (prefers-reduced-motion: reduce) {
|
|
193
|
-
.awsui_container-fade-
|
|
193
|
+
.awsui_container-fade-in_1cbgc_zrca7_181:not(#\9) {
|
|
194
194
|
animation: none;
|
|
195
195
|
transition: none;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
.awsui-motion-disabled .awsui_container-fade-
|
|
198
|
+
.awsui-motion-disabled .awsui_container-fade-in_1cbgc_zrca7_181:not(#\9), .awsui-mode-entering .awsui_container-fade-in_1cbgc_zrca7_181:not(#\9) {
|
|
199
199
|
animation: none;
|
|
200
200
|
transition: none;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.
|
|
203
|
+
.awsui_root_1cbgc_zrca7_203:not(#\9) {
|
|
204
204
|
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
205
205
|
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
206
206
|
color: var(--color-text-body-default-5qid0u, #16191f);
|
|
@@ -209,64 +209,67 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
209
209
|
-webkit-font-smoothing: auto;
|
|
210
210
|
-moz-osx-font-smoothing: auto;
|
|
211
211
|
}
|
|
212
|
-
.
|
|
212
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-error_1cbgc_zrca7_212:not(#\9) {
|
|
213
213
|
color: var(--color-text-status-error-aknuvu, #d13212);
|
|
214
214
|
}
|
|
215
|
-
.
|
|
215
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-warning_1cbgc_zrca7_215:not(#\9) {
|
|
216
216
|
color: var(--color-text-status-warning-9b45qh, #906806);
|
|
217
217
|
}
|
|
218
|
-
.
|
|
218
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-success_1cbgc_zrca7_218:not(#\9) {
|
|
219
219
|
color: var(--color-text-status-success-yodf3z, #1d8102);
|
|
220
220
|
}
|
|
221
|
-
.
|
|
221
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-info_1cbgc_zrca7_221:not(#\9) {
|
|
222
222
|
color: var(--color-text-status-info-xt2ka7, #0073bb);
|
|
223
223
|
}
|
|
224
|
-
.
|
|
224
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-stopped_1cbgc_zrca7_224:not(#\9) {
|
|
225
225
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
226
226
|
}
|
|
227
|
-
.
|
|
227
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-pending_1cbgc_zrca7_227:not(#\9) {
|
|
228
228
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
229
229
|
}
|
|
230
|
-
.
|
|
230
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-in-progress_1cbgc_zrca7_230:not(#\9) {
|
|
231
231
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
232
232
|
}
|
|
233
|
-
.
|
|
233
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-loading_1cbgc_zrca7_233:not(#\9) {
|
|
234
234
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
235
235
|
}
|
|
236
|
-
.
|
|
236
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-not-started_1cbgc_zrca7_236:not(#\9) {
|
|
237
|
+
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
238
|
+
}
|
|
239
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-red_1cbgc_zrca7_239:not(#\9) {
|
|
237
240
|
color: var(--color-text-status-error-aknuvu, #d13212);
|
|
238
241
|
}
|
|
239
|
-
.
|
|
242
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-grey_1cbgc_zrca7_242:not(#\9) {
|
|
240
243
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
241
244
|
}
|
|
242
|
-
.
|
|
245
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-blue_1cbgc_zrca7_245:not(#\9) {
|
|
243
246
|
color: var(--color-text-status-info-xt2ka7, #0073bb);
|
|
244
247
|
}
|
|
245
|
-
.
|
|
248
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-green_1cbgc_zrca7_248:not(#\9) {
|
|
246
249
|
color: var(--color-text-status-success-yodf3z, #1d8102);
|
|
247
250
|
}
|
|
248
|
-
.
|
|
251
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-yellow_1cbgc_zrca7_251:not(#\9) {
|
|
249
252
|
color: var(--color-text-status-warning-9b45qh, #906806);
|
|
250
253
|
}
|
|
251
254
|
|
|
252
|
-
.
|
|
255
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline_1cbgc_zrca7_255:not(#\9) {
|
|
253
256
|
min-inline-size: 0;
|
|
254
257
|
word-break: break-word;
|
|
255
258
|
display: inline;
|
|
256
259
|
}
|
|
257
|
-
.
|
|
260
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline_1cbgc_zrca7_255 > .awsui_icon_1cbgc_zrca7_153:not(#\9) {
|
|
258
261
|
white-space: nowrap;
|
|
259
262
|
}
|
|
260
|
-
.
|
|
263
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline-block_1cbgc_zrca7_263:not(#\9) {
|
|
261
264
|
display: inline-block;
|
|
262
265
|
word-wrap: break-word;
|
|
263
266
|
word-break: break-all;
|
|
264
267
|
}
|
|
265
|
-
.
|
|
268
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline-block_1cbgc_zrca7_263 > .awsui_icon_1cbgc_zrca7_153:not(#\9) {
|
|
266
269
|
padding-inline-end: var(--space-xxs-jnczic, 4px);
|
|
267
270
|
}
|
|
268
271
|
|
|
269
|
-
.awsui_overflow-
|
|
272
|
+
.awsui_overflow-ellipsis_1cbgc_zrca7_272:not(#\9) {
|
|
270
273
|
max-inline-size: 100%;
|
|
271
274
|
overflow: hidden;
|
|
272
275
|
text-overflow: ellipsis;
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"icon-shake": "awsui_icon-
|
|
6
|
-
"awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-
|
|
7
|
-
"container-fade-in": "awsui_container-fade-
|
|
8
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
9
|
-
"root": "
|
|
10
|
-
"status-error": "awsui_status-
|
|
11
|
-
"status-warning": "awsui_status-
|
|
12
|
-
"status-success": "awsui_status-
|
|
13
|
-
"status-info": "awsui_status-
|
|
14
|
-
"status-stopped": "awsui_status-
|
|
15
|
-
"status-pending": "awsui_status-
|
|
16
|
-
"status-in-progress": "awsui_status-in-
|
|
17
|
-
"status-loading": "awsui_status-
|
|
18
|
-
"
|
|
19
|
-
"color-override-
|
|
20
|
-
"color-override-
|
|
21
|
-
"color-override-
|
|
22
|
-
"color-override-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
5
|
+
"icon-shake": "awsui_icon-shake_1cbgc_zrca7_153",
|
|
6
|
+
"awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1",
|
|
7
|
+
"container-fade-in": "awsui_container-fade-in_1cbgc_zrca7_181",
|
|
8
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1",
|
|
9
|
+
"root": "awsui_root_1cbgc_zrca7_203",
|
|
10
|
+
"status-error": "awsui_status-error_1cbgc_zrca7_212",
|
|
11
|
+
"status-warning": "awsui_status-warning_1cbgc_zrca7_215",
|
|
12
|
+
"status-success": "awsui_status-success_1cbgc_zrca7_218",
|
|
13
|
+
"status-info": "awsui_status-info_1cbgc_zrca7_221",
|
|
14
|
+
"status-stopped": "awsui_status-stopped_1cbgc_zrca7_224",
|
|
15
|
+
"status-pending": "awsui_status-pending_1cbgc_zrca7_227",
|
|
16
|
+
"status-in-progress": "awsui_status-in-progress_1cbgc_zrca7_230",
|
|
17
|
+
"status-loading": "awsui_status-loading_1cbgc_zrca7_233",
|
|
18
|
+
"status-not-started": "awsui_status-not-started_1cbgc_zrca7_236",
|
|
19
|
+
"color-override-red": "awsui_color-override-red_1cbgc_zrca7_239",
|
|
20
|
+
"color-override-grey": "awsui_color-override-grey_1cbgc_zrca7_242",
|
|
21
|
+
"color-override-blue": "awsui_color-override-blue_1cbgc_zrca7_245",
|
|
22
|
+
"color-override-green": "awsui_color-override-green_1cbgc_zrca7_248",
|
|
23
|
+
"color-override-yellow": "awsui_color-override-yellow_1cbgc_zrca7_251",
|
|
24
|
+
"container": "awsui_container_1cbgc_zrca7_181",
|
|
25
|
+
"display-inline": "awsui_display-inline_1cbgc_zrca7_255",
|
|
26
|
+
"icon": "awsui_icon_1cbgc_zrca7_153",
|
|
27
|
+
"display-inline-block": "awsui_display-inline-block_1cbgc_zrca7_263",
|
|
28
|
+
"overflow-ellipsis": "awsui_overflow-ellipsis_1cbgc_zrca7_272"
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,0BAA0B,CAAC;AA4EzF,QAAA,MAAM,aAAa,GAAI,6GASpB,kBAAkB,gBA8BpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -14,6 +14,7 @@ const statusToColor = {
|
|
|
14
14
|
pending: 'text-status-inactive',
|
|
15
15
|
'in-progress': 'text-status-inactive',
|
|
16
16
|
loading: 'text-status-inactive',
|
|
17
|
+
'not-started': 'text-status-inactive',
|
|
17
18
|
};
|
|
18
19
|
const CustomStep = ({ step, orientation, renderStep, }) => {
|
|
19
20
|
const { status, statusIconAriaLabel } = step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAG1C,OAAO,uBAAuB,EAAE,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG3F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,aAAa,GAA8C;IAC/D,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,sBAAsB;IAC/B,aAAa,EAAE,sBAAsB;IACrC,OAAO,EAAE,sBAAsB;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAG1C,OAAO,uBAAuB,EAAE,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG3F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,aAAa,GAA8C;IAC/D,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EA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,SAAS,qBACJ,cAAc,sBACb,eAAe,IAEhC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACzB,UAAU,CAAC,CAAC,CAAC,CACX,oBAAC,UAAU,IAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAI,CACzF,CAAC,CAAC,CAAC,CACF,oBAAC,YAAY,IACX,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,WAAW,EAAE,WAAW,GACxB,CACH,CACF,CACE,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { BoxProps } from '../box/interfaces';\nimport InternalBox from '../box/internal';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport InternalStatusIndicator, { InternalStatusIcon } from '../status-indicator/internal';\nimport { StepsProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalStepsProps = SomeRequired<StepsProps, 'steps'> & InternalBaseComponentProps;\n\nconst statusToColor: Record<StepsProps.Status, BoxProps.Color> = {\n error: 'text-status-error',\n warning: 'text-status-warning',\n success: 'text-status-success',\n info: 'text-status-info',\n stopped: 'text-status-inactive',\n pending: 'text-status-inactive',\n 'in-progress': 'text-status-inactive',\n loading: 'text-status-inactive',\n 'not-started': 'text-status-inactive',\n};\n\nconst CustomStep = ({\n step,\n orientation,\n renderStep,\n}: {\n step: StepsProps.Step;\n orientation: StepsProps.Orientation;\n renderStep: Required<StepsProps>['renderStep'];\n}) => {\n const { status, statusIconAriaLabel } = step;\n const { header, details, icon } = renderStep(step);\n return (\n <li className={styles.container}>\n <div className={styles.header}>\n {icon ? icon : <InternalStatusIcon type={status} iconAriaLabel={statusIconAriaLabel} />}\n {orientation === 'vertical' ? header : <hr className={styles.connector} role=\"none\" />}\n </div>\n {orientation === 'vertical' ? (\n <hr className={styles.connector} role=\"none\" />\n ) : (\n <div className={styles['horizontal-header']}>{header}</div>\n )}\n {details && <div className={styles.details}>{details}</div>}\n </li>\n );\n};\n\nconst InternalStep = ({\n status,\n statusIconAriaLabel,\n header,\n details,\n orientation,\n}: StepsProps.Step & { orientation: StepsProps.Orientation }) => {\n return (\n <li className={styles.container}>\n <div className={styles.header}>\n {orientation === 'vertical' ? (\n <InternalStatusIndicator type={status} iconAriaLabel={statusIconAriaLabel}>\n {header}\n </InternalStatusIndicator>\n ) : (\n <>\n <InternalBox color={statusToColor[status]}>\n <InternalStatusIcon type={status} iconAriaLabel={statusIconAriaLabel} />\n </InternalBox>\n <hr className={styles.connector} role=\"none\" />\n </>\n )}\n </div>\n {orientation === 'vertical' ? (\n <hr className={styles.connector} role=\"none\" />\n ) : (\n <div className={styles['horizontal-header']}>\n <InternalBox color={statusToColor[status]}>{header}</InternalBox>\n </div>\n )}\n {details && <div className={styles.details}>{details}</div>}\n </li>\n );\n};\n\nconst InternalSteps = ({\n steps,\n orientation = 'vertical',\n renderStep,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n __internalRootRef,\n ...props\n}: InternalStepsProps) => {\n return (\n <div\n {...props}\n className={clsx(styles.root, props.className, orientation === 'horizontal' ? styles.horizontal : styles.vertical)}\n ref={__internalRootRef}\n >\n <ol\n className={styles.list}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {steps.map((step, index) =>\n renderStep ? (\n <CustomStep key={index} orientation={orientation} step={step} renderStep={renderStep} />\n ) : (\n <InternalStep\n key={index}\n status={step.status}\n statusIconAriaLabel={step.statusIconAriaLabel}\n header={step.header}\n details={step.details}\n orientation={orientation}\n />\n )\n )}\n </ol>\n </div>\n );\n};\n\nexport default InternalSteps;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-editor.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/inline-editor.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,UAAU,gBAAgB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,iBAAiB,CAAC,QAAQ;IAClC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,EACrC,UAAU,EACV,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE,iBAAiB,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"inline-editor.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/inline-editor.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,UAAU,gBAAgB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,iBAAiB,CAAC,QAAQ;IAClC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,EACrC,UAAU,EACV,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE,iBAAiB,CAAC,QAAQ,CAAC,eAiI7B"}
|
|
@@ -34,10 +34,8 @@ export function InlineEditor({ ariaLabels, item, column, onEditEnd, submitEdit,
|
|
|
34
34
|
await submitEdit(item, column, currentEditValue);
|
|
35
35
|
setCurrentEditLoading(false);
|
|
36
36
|
finishEdit();
|
|
37
|
-
// Consumers in the past have not always been able to support not specifiying the value so we keep and ignore
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
37
|
}
|
|
40
|
-
catch
|
|
38
|
+
catch {
|
|
41
39
|
setCurrentEditLoading(false);
|
|
42
40
|
(_a = focusLockRef.current) === null || _a === void 0 ? void 0 : _a.focusFirst();
|
|
43
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-editor.js","sourceRoot":"","sources":["../../../../src/table/body-cell/inline-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,SAA2B,MAAM,sCAAsC,CAAC;AAE/E,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,YAAY,M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C5C,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACrB,oBAAC,MAAM,IACL,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,2DAAG,MAAM,CAAC,EAChD,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAC,OAAO,EAChB,OAAO,EAAC,aAAa,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GACzB,CACH,CAAC,CAAC,CAAC,IAAI;gCACR,oBAAC,MAAM,IACL,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,2DAAG,MAAM,CAAC,EAChD,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EACjD,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACrD,QAAQ,EAAC,OAAO,EAChB,OAAO,EAAC,aAAa,EACrB,OAAO,EAAE,kBAAkB,GAC3B,CACW;4BACf,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,kBAAkB;gCACjB,CAAC,CAAC,IAAI,CAAC,+BAA+B,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,kBAAkB,2DAAG,MAAM,CAAC,CAAC;gCACjF,CAAC,CAAC,EAAE,CACa,CAChB,CACH,CACI,CACA,CACV,CACI,CACb,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport Button from '../../button/internal';\nimport FormField from '../../form-field/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport FocusLock, { FocusLockRef } from '../../internal/components/focus-lock';\nimport { Optional } from '../../internal/types';\nimport InternalLiveRegion from '../../live-region/internal';\nimport SpaceBetween from '../../space-between/internal';\nimport { TableProps } from '../interfaces';\nimport { useClickAway } from './click-away';\n\nimport styles from './styles.css.js';\n\n// A function that does nothing\nconst noop = () => undefined;\n\ninterface OnEditEndOptions {\n cancelled: boolean;\n refocusCell: boolean;\n}\n\ninterface InlineEditorProps<ItemType> {\n ariaLabels: TableProps['ariaLabels'];\n column: TableProps.ColumnDefinition<ItemType>;\n item: ItemType;\n onEditEnd: (options: OnEditEndOptions) => void;\n submitEdit: TableProps.SubmitEditFunction<ItemType>;\n __onRender?: () => void;\n}\n\nexport function InlineEditor<ItemType>({\n ariaLabels,\n item,\n column,\n onEditEnd,\n submitEdit,\n __onRender,\n}: InlineEditorProps<ItemType>) {\n const [currentEditLoading, setCurrentEditLoading] = useState(false);\n const [currentEditValue, setCurrentEditValue] = useState<Optional<any>>();\n const i18n = useInternalI18n('table');\n\n const focusLockRef = useRef<FocusLockRef>(null);\n\n function finishEdit({ cancelled = false, refocusCell = true }: Partial<OnEditEndOptions> = {}) {\n if (!cancelled) {\n setCurrentEditValue(undefined);\n }\n onEditEnd({ cancelled, refocusCell: refocusCell });\n }\n\n async function handleSubmit() {\n if (currentEditValue === undefined) {\n finishEdit();\n return;\n }\n\n setCurrentEditLoading(true);\n try {\n await submitEdit(item, column, currentEditValue);\n setCurrentEditLoading(false);\n finishEdit();\n } catch {\n setCurrentEditLoading(false);\n focusLockRef.current?.focusFirst();\n }\n }\n\n function onFormSubmit(evt: React.FormEvent) {\n evt.preventDefault(); // Prevents the form from navigating away\n evt.stopPropagation(); // Prevents any outer form elements from submitting\n handleSubmit();\n }\n\n function onCancel({ reFocusEditedCell = true } = {}) {\n if (currentEditLoading) {\n return;\n }\n finishEdit({ cancelled: true, refocusCell: reFocusEditedCell });\n }\n\n function handleEscape(event: React.KeyboardEvent): void {\n if (event.key === 'Escape') {\n onCancel();\n }\n }\n\n const clickAwayRef = useClickAway(() => onCancel({ reFocusEditedCell: false }));\n\n useEffect(() => {\n if (__onRender) {\n const timer = setTimeout(__onRender, 1);\n return () => clearTimeout(timer);\n }\n }, [__onRender]);\n\n // asserting non-undefined editConfig here because this component is unreachable otherwise\n const {\n ariaLabel = undefined,\n validation = noop,\n errorIconAriaLabel,\n constraintText,\n editingCell,\n disableNativeForm,\n } = column.editConfig!;\n\n const cellContext = {\n currentValue: currentEditValue,\n setValue: setCurrentEditValue,\n submitValue: handleSubmit,\n };\n\n const FormElement = disableNativeForm ? 'div' : 'form';\n\n return (\n <FocusLock restoreFocus={true} ref={focusLockRef}>\n <div\n role=\"dialog\"\n ref={clickAwayRef}\n aria-label={ariaLabels?.activateEditLabel?.(column, item)}\n onKeyDown={handleEscape}\n >\n <FormElement onSubmit={disableNativeForm ? undefined : onFormSubmit}>\n <FormField\n stretch={true}\n label={ariaLabel}\n constraintText={constraintText}\n __hideLabel={true}\n __disableGutters={true}\n i18nStrings={{ errorIconAriaLabel }}\n errorText={validation(item, currentEditValue)}\n >\n <div className={styles['body-cell-editor-row']}>\n <div className={styles['body-cell-editor-row-editor']}>{editingCell(item, cellContext)}</div>\n <span className={styles['body-cell-editor-controls']}>\n <SpaceBetween direction=\"horizontal\" size=\"xxs\">\n {!currentEditLoading ? (\n <Button\n ariaLabel={ariaLabels?.cancelEditLabel?.(column)}\n formAction=\"none\"\n iconName=\"close\"\n variant=\"inline-icon\"\n onClick={() => onCancel()}\n />\n ) : null}\n <Button\n ariaLabel={ariaLabels?.submitEditLabel?.(column)}\n formAction={disableNativeForm ? 'none' : 'submit'}\n onClick={disableNativeForm ? handleSubmit : undefined}\n iconName=\"check\"\n variant=\"inline-icon\"\n loading={currentEditLoading}\n />\n </SpaceBetween>\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {currentEditLoading\n ? i18n('ariaLabels.submittingEditText', ariaLabels?.submittingEditText?.(column))\n : ''}\n </InternalLiveRegion>\n </span>\n </div>\n </FormField>\n </FormElement>\n </div>\n </FocusLock>\n );\n}\n"]}
|