@cloudscape-design/components-themeable 3.0.840 → 3.0.842
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/app-layout/visual-refresh-toolbar/navigation/styles.scss +10 -14
- package/lib/internal/scss/{internal/components/file-dropzone → file-dropzone}/styles.scss +14 -11
- package/lib/internal/scss/{internal/components/file-input → file-input}/styles.scss +2 -2
- package/lib/internal/scss/{internal/components/file-token-group → file-token-group}/constants.scss +1 -1
- package/lib/internal/scss/{internal/components/file-token-group → file-token-group}/styles.scss +3 -3
- package/lib/internal/scss/internal/components/token-list/styles.scss +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js +5 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +10 -16
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +12 -0
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -0
- package/lib/internal/template/button-group/icon-toggle-button-item.js +30 -0
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -0
- package/lib/internal/template/button-group/interfaces.d.ts +42 -6
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/button-group/item-element.d.ts.map +1 -1
- package/lib/internal/template/button-group/item-element.js +2 -0
- package/lib/internal/template/button-group/item-element.js.map +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js +1 -1
- package/lib/internal/template/button-group/menu-dropdown-item.js.map +1 -1
- package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/index.d.ts +1 -1
- package/lib/internal/template/file-dropzone/index.d.ts.map +1 -0
- package/lib/internal/template/file-dropzone/index.js +14 -0
- package/lib/internal/template/file-dropzone/index.js.map +1 -0
- package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/interfaces.d.ts +2 -2
- package/lib/internal/template/file-dropzone/interfaces.d.ts.map +1 -0
- package/lib/internal/template/file-dropzone/interfaces.js.map +1 -0
- package/lib/internal/template/file-dropzone/internal.d.ts +5 -0
- package/lib/internal/template/file-dropzone/internal.d.ts.map +1 -0
- package/lib/internal/template/{internal/components/file-dropzone/index.js → file-dropzone/internal.js} +10 -6
- package/lib/internal/template/file-dropzone/internal.js.map +1 -0
- package/lib/internal/template/file-dropzone/styles.css.js +8 -0
- package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/styles.scoped.css +17 -14
- package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/styles.selectors.js +3 -3
- package/lib/internal/template/file-dropzone/use-files-dragging.d.ts.map +1 -0
- package/lib/internal/template/file-dropzone/use-files-dragging.js.map +1 -0
- package/lib/internal/template/file-input/index.d.ts +6 -0
- package/lib/internal/template/file-input/index.d.ts.map +1 -0
- package/lib/internal/template/file-input/index.js +20 -0
- package/lib/internal/template/file-input/index.js.map +1 -0
- package/lib/internal/template/{internal/components/file-input → file-input}/interfaces.d.ts +3 -3
- package/lib/internal/template/file-input/interfaces.d.ts.map +1 -0
- package/lib/internal/template/file-input/interfaces.js.map +1 -0
- package/lib/internal/template/file-input/internal.d.ts +6 -0
- package/lib/internal/template/file-input/internal.d.ts.map +1 -0
- package/lib/internal/template/{internal/components/file-input/index.js → file-input/internal.js} +13 -11
- package/lib/internal/template/file-input/internal.js.map +1 -0
- package/lib/internal/template/file-input/styles.css.js +10 -0
- package/lib/internal/template/{internal/components/file-input → file-input}/styles.scoped.css +6 -6
- package/lib/internal/template/file-input/styles.selectors.js +11 -0
- package/lib/internal/template/file-token-group/default-formatters.d.ts.map +1 -0
- package/lib/internal/template/{internal/components/file-token-group → file-token-group}/default-formatters.js +1 -1
- package/lib/internal/template/file-token-group/default-formatters.js.map +1 -0
- package/lib/internal/template/{internal/components/file-token-group → file-token-group}/file-token.d.ts +2 -2
- package/lib/internal/template/file-token-group/file-token.d.ts.map +1 -0
- package/lib/internal/template/{internal/components/file-token-group → file-token-group}/file-token.js +8 -8
- package/lib/internal/template/file-token-group/file-token.js.map +1 -0
- package/lib/internal/template/file-token-group/index.d.ts +6 -0
- package/lib/internal/template/file-token-group/index.d.ts.map +1 -0
- package/lib/internal/template/file-token-group/index.js +23 -0
- package/lib/internal/template/file-token-group/index.js.map +1 -0
- package/lib/internal/template/{internal/components/file-token-group → file-token-group}/interfaces.d.ts +2 -2
- package/lib/internal/template/file-token-group/interfaces.d.ts.map +1 -0
- package/lib/internal/template/file-token-group/interfaces.js.map +1 -0
- package/lib/internal/template/{internal/components/file-token-group/index.d.ts → file-token-group/internal.d.ts} +2 -3
- package/lib/internal/template/file-token-group/internal.d.ts.map +1 -0
- package/lib/internal/template/{internal/components/file-token-group/index.js → file-token-group/internal.js} +7 -7
- package/lib/internal/template/file-token-group/internal.js.map +1 -0
- package/lib/internal/template/file-token-group/styles.css.js +27 -0
- package/lib/internal/template/{internal/components/file-token-group → file-token-group}/styles.scoped.css +29 -29
- package/lib/internal/template/file-token-group/styles.selectors.js +28 -0
- package/lib/internal/template/file-token-group/test-classes/styles.css.js +11 -0
- package/lib/internal/template/file-token-group/test-classes/styles.scoped.css +12 -0
- package/lib/internal/template/file-token-group/test-classes/styles.selectors.js +12 -0
- package/lib/internal/template/file-token-group/thumbnail.d.ts.map +1 -0
- package/lib/internal/template/file-token-group/thumbnail.js.map +1 -0
- package/lib/internal/template/file-upload/internal.d.ts.map +1 -1
- package/lib/internal/template/file-upload/internal.js +6 -5
- package/lib/internal/template/file-upload/internal.js.map +1 -1
- package/lib/internal/template/index.d.ts +3 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +3 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +62 -43
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +4 -2
- package/lib/internal/template/internal/generated/styles/tokens.js +6 -4
- package/lib/internal/template/internal/generated/theming/index.cjs +136 -74
- package/lib/internal/template/internal/generated/theming/index.js +136 -74
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +6 -2
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.js +24 -21
- package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-localized.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/date-time/format-date-localized.js +6 -1
- package/lib/internal/template/internal/utils/date-time/format-date-localized.js.map +1 -1
- package/lib/internal/template/package.json +3 -0
- package/lib/internal/template/test-utils/dom/button-group/index.d.ts +5 -0
- package/lib/internal/template/test-utils/dom/button-group/index.js +9 -0
- package/lib/internal/template/test-utils/dom/button-group/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/{internal/file-dropzone.js → file-dropzone/index.js} +2 -2
- package/lib/internal/template/test-utils/dom/file-dropzone/index.js.map +1 -0
- package/lib/internal/template/test-utils/dom/{internal/file-input.js → file-input/index.js} +2 -2
- package/lib/internal/template/test-utils/dom/file-input/index.js.map +1 -0
- package/lib/internal/template/test-utils/dom/{internal/file-token-group.js → file-token-group/index.js} +14 -14
- package/lib/internal/template/test-utils/dom/file-token-group/index.js.map +1 -0
- package/lib/internal/template/test-utils/dom/file-upload/index.d.ts +1 -1
- package/lib/internal/template/test-utils/dom/file-upload/index.js +13 -13
- package/lib/internal/template/test-utils/dom/file-upload/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/index.d.ts +9 -0
- package/lib/internal/template/test-utils/dom/index.js +26 -2
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/button-group/index.d.ts +5 -0
- package/lib/internal/template/test-utils/selectors/button-group/index.js +9 -0
- package/lib/internal/template/test-utils/selectors/button-group/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/{internal/file-dropzone.js → file-dropzone/index.js} +2 -2
- package/lib/internal/template/test-utils/selectors/file-dropzone/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/{internal/file-input.js → file-input/index.js} +2 -2
- package/lib/internal/template/test-utils/selectors/file-input/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/{internal/file-token-group.js → file-token-group/index.js} +14 -14
- package/lib/internal/template/test-utils/selectors/file-token-group/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/file-upload/index.d.ts +1 -1
- package/lib/internal/template/test-utils/selectors/file-upload/index.js +13 -13
- package/lib/internal/template/test-utils/selectors/file-upload/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/index.d.ts +9 -0
- package/lib/internal/template/test-utils/selectors/index.js +26 -2
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/toggle-button/internal.d.ts +3 -1
- package/lib/internal/template/toggle-button/internal.d.ts.map +1 -1
- package/lib/internal/template/toggle-button/internal.js.map +1 -1
- package/lib/internal/template/wizard/wizard-form.d.ts +4 -2
- package/lib/internal/template/wizard/wizard-form.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-form.js +10 -9
- package/lib/internal/template/wizard/wizard-form.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/template/internal/components/file-dropzone/index.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-dropzone/index.js.map +0 -1
- package/lib/internal/template/internal/components/file-dropzone/interfaces.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-dropzone/interfaces.js.map +0 -1
- package/lib/internal/template/internal/components/file-dropzone/styles.css.js +0 -8
- package/lib/internal/template/internal/components/file-dropzone/use-files-dragging.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-dropzone/use-files-dragging.js.map +0 -1
- package/lib/internal/template/internal/components/file-input/index.d.ts +0 -6
- package/lib/internal/template/internal/components/file-input/index.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-input/index.js.map +0 -1
- package/lib/internal/template/internal/components/file-input/interfaces.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-input/interfaces.js.map +0 -1
- package/lib/internal/template/internal/components/file-input/styles.css.js +0 -10
- package/lib/internal/template/internal/components/file-input/styles.selectors.js +0 -11
- package/lib/internal/template/internal/components/file-token-group/default-formatters.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/default-formatters.js.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/file-token.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/file-token.js.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/index.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/index.js.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/interfaces.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/interfaces.js.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/styles.css.js +0 -27
- package/lib/internal/template/internal/components/file-token-group/styles.selectors.js +0 -28
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.css.js +0 -11
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.scoped.css +0 -12
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.selectors.js +0 -12
- package/lib/internal/template/internal/components/file-token-group/thumbnail.d.ts.map +0 -1
- package/lib/internal/template/internal/components/file-token-group/thumbnail.js.map +0 -1
- package/lib/internal/template/test-utils/dom/internal/file-dropzone.js.map +0 -1
- package/lib/internal/template/test-utils/dom/internal/file-input.js.map +0 -1
- package/lib/internal/template/test-utils/dom/internal/file-token-group.js.map +0 -1
- package/lib/internal/template/test-utils/selectors/internal/file-dropzone.js.map +0 -1
- package/lib/internal/template/test-utils/selectors/internal/file-input.js.map +0 -1
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.js.map +0 -1
- /package/lib/internal/scss/{internal/components/file-token-group → file-token-group}/test-classes/styles.scss +0 -0
- /package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/interfaces.js +0 -0
- /package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/use-files-dragging.d.ts +0 -0
- /package/lib/internal/template/{internal/components/file-dropzone → file-dropzone}/use-files-dragging.js +0 -0
- /package/lib/internal/template/{internal/components/file-input → file-input}/interfaces.js +0 -0
- /package/lib/internal/template/{internal/components/file-token-group → file-token-group}/default-formatters.d.ts +0 -0
- /package/lib/internal/template/{internal/components/file-token-group → file-token-group}/interfaces.js +0 -0
- /package/lib/internal/template/{internal/components/file-token-group → file-token-group}/thumbnail.d.ts +0 -0
- /package/lib/internal/template/{internal/components/file-token-group → file-token-group}/thumbnail.js +0 -0
- /package/lib/internal/template/test-utils/dom/{internal/file-dropzone.d.ts → file-dropzone/index.d.ts} +0 -0
- /package/lib/internal/template/test-utils/dom/{internal/file-input.d.ts → file-input/index.d.ts} +0 -0
- /package/lib/internal/template/test-utils/dom/{internal/file-token-group.d.ts → file-token-group/index.d.ts} +0 -0
- /package/lib/internal/template/test-utils/selectors/{internal/file-dropzone.d.ts → file-dropzone/index.d.ts} +0 -0
- /package/lib/internal/template/test-utils/selectors/{internal/file-input.d.ts → file-input/index.d.ts} +0 -0
- /package/lib/internal/template/test-utils/selectors/{internal/file-token-group.d.ts → file-token-group/index.d.ts} +0 -0
package/lib/internal/template/{internal/components/file-input → file-input}/styles.scoped.css
RENAMED
|
@@ -178,25 +178,25 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
178
178
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
179
179
|
SPDX-License-Identifier: Apache-2.0
|
|
180
180
|
*/
|
|
181
|
-
.
|
|
182
|
-
.awsui_file-
|
|
181
|
+
.awsui_root_1wp4s_tjfs1_181:not(#\9),
|
|
182
|
+
.awsui_file-input_1wp4s_tjfs1_182:not(#\9) {
|
|
183
183
|
/* used in test-utils */
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
.
|
|
186
|
+
.awsui_hidden_1wp4s_tjfs1_186:not(#\9) {
|
|
187
187
|
position: absolute !important;
|
|
188
188
|
inset-block-start: -9999px !important;
|
|
189
189
|
inset-inline-start: -9999px !important;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
body[data-awsui-focus-visible=true] .awsui_file-input-
|
|
192
|
+
body[data-awsui-focus-visible=true] .awsui_file-input-button_1wp4s_tjfs1_192.awsui_force-focus-outline_1wp4s_tjfs1_192:not(#\9) {
|
|
193
193
|
position: relative;
|
|
194
194
|
}
|
|
195
|
-
body[data-awsui-focus-visible=true] .awsui_file-input-
|
|
195
|
+
body[data-awsui-focus-visible=true] .awsui_file-input-button_1wp4s_tjfs1_192.awsui_force-focus-outline_1wp4s_tjfs1_192:not(#\9) {
|
|
196
196
|
outline: 2px dotted transparent;
|
|
197
197
|
outline-offset: calc(var(--space-button-focus-outline-gutter-90p0io, 3px) - 1px);
|
|
198
198
|
}
|
|
199
|
-
body[data-awsui-focus-visible=true] .awsui_file-input-
|
|
199
|
+
body[data-awsui-focus-visible=true] .awsui_file-input-button_1wp4s_tjfs1_192.awsui_force-focus-outline_1wp4s_tjfs1_192:not(#\9)::before {
|
|
200
200
|
content: " ";
|
|
201
201
|
display: block;
|
|
202
202
|
position: absolute;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_1wp4s_tjfs1_181",
|
|
6
|
+
"file-input": "awsui_file-input_1wp4s_tjfs1_182",
|
|
7
|
+
"hidden": "awsui_hidden_1wp4s_tjfs1_186",
|
|
8
|
+
"file-input-button": "awsui_file-input-button_1wp4s_tjfs1_192",
|
|
9
|
+
"force-focus-outline": "awsui_force-focus-outline_1wp4s_tjfs1_192"
|
|
10
|
+
};
|
|
11
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-formatters.d.ts","sourceRoot":"","sources":["../../../src/file-token-group/default-formatters.ts"],"names":[],"mappings":"AAUA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWnD;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEzD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { formatDateTime } from '
|
|
3
|
+
import { formatDateTime } from '../internal/utils/date-time';
|
|
4
4
|
const KB = 1000;
|
|
5
5
|
const MB = Math.pow(1000, 2);
|
|
6
6
|
const GB = Math.pow(1000, 3);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-formatters.js","sourceRoot":"","sources":["../../../src/file-token-group/default-formatters.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,EAAE,GAAG,IAAI,CAAC;AAChB,MAAM,EAAE,GAAG,SAAA,IAAI,EAAI,CAAC,CAAA,CAAC;AACrB,MAAM,EAAE,GAAG,SAAA,IAAI,EAAI,CAAC,CAAA,CAAC;AACrB,MAAM,EAAE,GAAG,SAAA,IAAI,EAAI,CAAC,CAAA,CAAC;AAErB,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,IAAI,GAAG,EAAE,EAAE;QACb,OAAO,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;KACvC;IACD,IAAI,IAAI,GAAG,EAAE,EAAE;QACb,OAAO,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;KACvC;IACD,IAAI,IAAI,GAAG,EAAE,EAAE;QACb,OAAO,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;KACvC;IACD,OAAO,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAU;IAC/C,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { formatDateTime } from '../internal/utils/date-time';\n\nconst KB = 1000;\nconst MB = 1000 ** 2;\nconst GB = 1000 ** 3;\nconst TB = 1000 ** 4;\n\nexport function formatFileSize(size: number): string {\n if (size < MB) {\n return `${(size / KB).toFixed(2)} KB`;\n }\n if (size < GB) {\n return `${(size / MB).toFixed(2)} MB`;\n }\n if (size < TB) {\n return `${(size / GB).toFixed(2)} GB`;\n }\n return `${(size / TB).toFixed(2)} TB`;\n}\n\nexport function formatFileLastModified(date: Date): string {\n return formatDateTime(date);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { BaseComponentProps } from '../internal/base-component/index.js';
|
|
3
|
+
import { TokenGroupProps } from '../token-group/interfaces.js';
|
|
4
4
|
export declare namespace FileTokenProps {
|
|
5
5
|
interface I18nStrings {
|
|
6
6
|
removeFileAriaLabel: (fileIndex: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-token.d.ts","sourceRoot":"","sources":["../../../src/file-token-group/file-token.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAKhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAMzE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO/D,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,WAAW;QAC1B,mBAAmB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QACnD,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;QACjD,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;KACjD;CACF;AAED,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,cAAc,CAAC,WAAW,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,OAAO,EACP,KAAK,GACN,EAAE,cAAc,eA+HhB;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { useRef, useState } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import InternalBox from '
|
|
6
|
-
import { FormFieldError, FormFieldWarning } from '
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
5
|
+
import InternalBox from '../box/internal.js';
|
|
6
|
+
import { FormFieldError, FormFieldWarning } from '../form-field/internal';
|
|
7
|
+
import Tooltip from '../internal/components/tooltip/index';
|
|
8
|
+
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
9
|
+
import InternalSpaceBetween from '../space-between/internal.js';
|
|
10
|
+
import InternalSpinner from '../spinner/internal.js';
|
|
11
|
+
import DismissButton from '../token-group/dismiss-button';
|
|
12
12
|
import * as defaultFormatters from './default-formatters.js';
|
|
13
13
|
import { FileOptionThumbnail } from './thumbnail.js';
|
|
14
14
|
import styles from './styles.css.js';
|
|
@@ -35,7 +35,7 @@ function InternalFileToken({ file, showFileLastModified, showFileSize, showFileT
|
|
|
35
35
|
const fileIsSingleRow = !showFileLastModified && !showFileSize && (!groupContainsImage || (groupContainsImage && !showFileThumbnail));
|
|
36
36
|
return (React.createElement("div", { ref: containerRef, className: clsx(styles.token, {
|
|
37
37
|
[styles['token-grid']]: alignment === 'horizontal',
|
|
38
|
-
[styles['token-contains-image']]: groupContainsImage,
|
|
38
|
+
[styles['token-contains-image']]: groupContainsImage && showFileThumbnail,
|
|
39
39
|
}), role: "group", "aria-label": file.name, "aria-describedby": errorText ? errorId : warningText ? warningId : undefined, "aria-disabled": loading, "data-index": index },
|
|
40
40
|
React.createElement("div", { className: clsx(styles['token-box'], {
|
|
41
41
|
[styles.loading]: loading,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-token.js","sourceRoot":"","sources":["../../../src/file-token-group/file-token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,OAAO,MAAM,sCAAsC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,eAAe,MAAM,wBAAwB,CAAC;AACrD,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAE1D,OAAO,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AA8B1D,SAAS,iBAAiB,CAAC,EACzB,IAAI,EACJ,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB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SAAS,EAAE,SAAS,GAAI,CAC9F,CACG;QACL,SAAS,IAAI,CACZ,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,IAC5E,SAAS,CACK,CAClB;QACA,WAAW,IAAI,CACd,oBAAC,gBAAgB,IAAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,WAAW,CAAC,oBAAoB,IACpF,WAAW,CACK,CACpB;QACA,WAAW,IAAI,gBAAgB,EAAE,IAAI,CACpC,oBAAC,OAAO,IACN,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,IAAI,CAAC,IAAI,EACnB,KAAK,EAAE,oBAAC,WAAW,IAAC,UAAU,EAAC,QAAQ,IAAE,IAAI,CAAC,IAAI,CAAe,GACjE,CACH,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,iBAAiB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalBox from '../box/internal.js';\nimport { FormFieldError, FormFieldWarning } from '../form-field/internal';\nimport { BaseComponentProps } from '../internal/base-component/index.js';\nimport Tooltip from '../internal/components/tooltip/index';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport InternalSpaceBetween from '../space-between/internal.js';\nimport InternalSpinner from '../spinner/internal.js';\nimport DismissButton from '../token-group/dismiss-button';\nimport { TokenGroupProps } from '../token-group/interfaces.js';\nimport * as defaultFormatters from './default-formatters.js';\nimport { FileOptionThumbnail } from './thumbnail.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport namespace FileTokenProps {\n export interface I18nStrings {\n removeFileAriaLabel: (fileIndex: number) => string;\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n formatFileSize?: (sizeInBytes: number) => string;\n formatFileLastModified?: (date: Date) => string;\n }\n}\n\nexport interface FileTokenProps extends BaseComponentProps {\n file: File;\n onDismiss: () => void;\n showFileSize?: boolean;\n showFileLastModified?: boolean;\n showFileThumbnail?: boolean;\n errorText?: React.ReactNode;\n warningText?: React.ReactNode;\n loading?: boolean;\n readOnly?: boolean;\n i18nStrings: FileTokenProps.I18nStrings;\n dismissLabel?: string;\n alignment?: TokenGroupProps.Alignment;\n groupContainsImage?: boolean;\n isImage: boolean;\n index: number;\n}\n\nfunction InternalFileToken({\n file,\n showFileLastModified,\n showFileSize,\n showFileThumbnail,\n i18nStrings,\n onDismiss,\n errorText,\n warningText,\n readOnly,\n loading,\n alignment,\n groupContainsImage,\n isImage,\n index,\n}: FileTokenProps) {\n const formatFileSize = i18nStrings.formatFileSize ?? defaultFormatters.formatFileSize;\n const formatFileLastModified = i18nStrings.formatFileLastModified ?? defaultFormatters.formatFileLastModified;\n\n const errorId = useUniqueId('error');\n const warningId = useUniqueId('warning');\n\n const showWarning = warningText && !errorText;\n const containerRef = useRef<HTMLDivElement>(null);\n const fileNameRef = useRef<HTMLSpanElement>(null);\n const fileNameContainerRef = useRef<HTMLDivElement>(null);\n const [showTooltip, setShowTooltip] = useState(false);\n\n function isEllipsisActive() {\n const span = fileNameRef.current;\n const container = fileNameContainerRef.current;\n\n if (span && container) {\n return span.offsetWidth >= container.offsetWidth;\n }\n return false;\n }\n\n const fileIsSingleRow =\n !showFileLastModified && !showFileSize && (!groupContainsImage || (groupContainsImage && !showFileThumbnail));\n\n return (\n <div\n ref={containerRef}\n className={clsx(styles.token, {\n [styles['token-grid']]: alignment === 'horizontal',\n [styles['token-contains-image']]: groupContainsImage && showFileThumbnail,\n })}\n role=\"group\"\n aria-label={file.name}\n aria-describedby={errorText ? errorId : warningText ? warningId : undefined}\n aria-disabled={loading}\n data-index={index}\n >\n <div\n className={clsx(styles['token-box'], {\n [styles.loading]: loading,\n [styles.error]: errorText,\n [styles.warning]: showWarning,\n [styles.horizontal]: alignment === 'horizontal',\n [styles['read-only']]: readOnly,\n })}\n >\n {loading && (\n <div\n className={clsx(styles['file-loading-overlay'], {\n [styles['file-loading-overlay-single-row']]: loading && fileIsSingleRow,\n })}\n >\n <InternalSpinner variant=\"disabled\" size=\"normal\" />\n </div>\n )}\n <InternalBox className={styles['file-option']}>\n {showFileThumbnail && isImage && <FileOptionThumbnail file={file} />}\n\n <div\n className={clsx(styles['file-option-metadata'], {\n [styles['with-image']]: showFileThumbnail && isImage,\n [styles['single-row-loading']]: loading && fileIsSingleRow,\n })}\n >\n <InternalSpaceBetween direction=\"vertical\" size=\"xxxs\">\n <div\n onMouseOver={() => setShowTooltip(true)}\n onMouseOut={() => setShowTooltip(false)}\n ref={fileNameContainerRef}\n >\n <InternalBox\n fontWeight=\"normal\"\n className={clsx(styles['file-option-name'], testUtilStyles['file-option-name'], {\n [testUtilStyles['ellipsis-active']]: isEllipsisActive(),\n })}\n >\n <span ref={fileNameRef}>{file.name}</span>\n </InternalBox>\n </div>\n\n {showFileSize && file.size ? (\n <InternalBox\n fontSize=\"body-s\"\n color={'text-body-secondary'}\n className={clsx(styles['file-option-size'], testUtilStyles['file-option-size'])}\n >\n {formatFileSize(file.size)}\n </InternalBox>\n ) : null}\n\n {showFileLastModified && file.lastModified ? (\n <InternalBox\n fontSize=\"body-s\"\n color={'text-body-secondary'}\n className={clsx(styles['file-option-last-modified'], testUtilStyles['file-option-last-modified'])}\n >\n {formatFileLastModified(new Date(file.lastModified))}\n </InternalBox>\n ) : null}\n </InternalSpaceBetween>\n </div>\n </InternalBox>\n {onDismiss && !readOnly && (\n <DismissButton dismissLabel={i18nStrings.removeFileAriaLabel(index)} onDismiss={onDismiss} />\n )}\n </div>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={i18nStrings.errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n {showWarning && (\n <FormFieldWarning id={warningId} warningIconAriaLabel={i18nStrings.warningIconAriaLabel}>\n {warningText}\n </FormFieldWarning>\n )}\n {showTooltip && isEllipsisActive() && (\n <Tooltip\n trackRef={containerRef}\n trackKey={file.name}\n value={<InternalBox fontWeight=\"normal\">{file.name}</InternalBox>}\n />\n )}\n </div>\n );\n}\n\nexport default InternalFileToken;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FileTokenGroupProps } from './interfaces';
|
|
3
|
+
export { FileTokenGroupProps };
|
|
4
|
+
declare const FileTokenGroup: ({ showFileLastModified, showFileSize, showFileThumbnail, alignment, limit, ...props }: FileTokenGroupProps) => JSX.Element;
|
|
5
|
+
export default FileTokenGroup;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file-token-group/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,0FAOjB,mBAAmB,gBAqBrB,CAAC;AAGF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
|
+
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
+
import InternalFileTokenGroup from './internal';
|
|
8
|
+
const FileTokenGroup = (_a) => {
|
|
9
|
+
var { showFileLastModified, showFileSize, showFileThumbnail, alignment, limit } = _a, props = __rest(_a, ["showFileLastModified", "showFileSize", "showFileThumbnail", "alignment", "limit"]);
|
|
10
|
+
const baseComponentProps = useBaseComponent('FileTokenGroup', {
|
|
11
|
+
props: {
|
|
12
|
+
showFileLastModified,
|
|
13
|
+
showFileSize,
|
|
14
|
+
showFileThumbnail,
|
|
15
|
+
alignment,
|
|
16
|
+
limit,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
return (React.createElement(InternalFileTokenGroup, Object.assign({ showFileLastModified: showFileLastModified, showFileSize: showFileSize, showFileThumbnail: showFileThumbnail, alignment: alignment, limit: limit }, props, baseComponentProps)));
|
|
20
|
+
};
|
|
21
|
+
applyDisplayName(FileTokenGroup, 'FileTokenGroup');
|
|
22
|
+
export default FileTokenGroup;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/file-token-group/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,sBAAsB,MAAM,YAAY,CAAC;AAIhD,MAAM,cAAc,GAAG,CAAC,EAOF,EAAE,EAAE;QAPF,EACtB,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,KAAK,OAEe,EADjB,KAAK,cANc,mFAOvB,CADS;IAER,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,gBAAgB,EAAE;QAC5D,KAAK,EAAE;YACL,oBAAoB;YACpB,YAAY;YACZ,iBAAiB;YACjB,SAAS;YACT,KAAK;SACN;KACF,CAAC,CAAC;IACH,OAAO,CACL,oBAAC,sBAAsB,kBACrB,oBAAoB,EAAE,oBAAoB,EAC1C,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,IACR,KAAK,EACL,kBAAkB,EACtB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AACnD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { FileTokenGroupProps } from './interfaces';\nimport InternalFileTokenGroup from './internal';\n\nexport { FileTokenGroupProps };\n\nconst FileTokenGroup = ({\n showFileLastModified,\n showFileSize,\n showFileThumbnail,\n alignment,\n limit,\n ...props\n}: FileTokenGroupProps) => {\n const baseComponentProps = useBaseComponent('FileTokenGroup', {\n props: {\n showFileLastModified,\n showFileSize,\n showFileThumbnail,\n alignment,\n limit,\n },\n });\n return (\n <InternalFileTokenGroup\n showFileLastModified={showFileLastModified}\n showFileSize={showFileSize}\n showFileThumbnail={showFileThumbnail}\n alignment={alignment}\n limit={limit}\n {...props}\n {...baseComponentProps}\n />\n );\n};\n\napplyDisplayName(FileTokenGroup, 'FileTokenGroup');\nexport default FileTokenGroup;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseComponentProps } from '
|
|
2
|
-
import { NonCancelableEventHandler } from '
|
|
1
|
+
import { BaseComponentProps } from '../internal/base-component';
|
|
2
|
+
import { NonCancelableEventHandler } from '../internal/events';
|
|
3
3
|
export interface FileTokenGroupProps extends BaseComponentProps {
|
|
4
4
|
/**
|
|
5
5
|
* Show file size in the token. Use `i18nStrings.formatFileSize` to customize it.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/file-token-group/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAE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B,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/file-token-group/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface FileTokenGroupProps extends BaseComponentProps {\n /**\n * Show file size in the token. Use `i18nStrings.formatFileSize` to customize it.\n */\n showFileSize?: boolean;\n\n /**\n * Show file last modified timestamp in the token. Use `i18nStrings.formatFileLastModified` to customize it.\n */\n showFileLastModified?: boolean;\n\n /**\n * Show file thumbnail in the token. Only supported for images.\n */\n showFileThumbnail?: boolean;\n /**\n * Called when the user clicks on the dismiss button. The token won't be automatically removed.\n * Make sure that you add a listener to this event to update your application state.\n */\n onDismiss: NonCancelableEventHandler<FileTokenGroupProps.DismissDetail>;\n\n /**\n * Specifies the maximum number of displayed tokens. If the property isn't set, all of the tokens are displayed.\n */\n limit?: number;\n /**\n * Specifies the direction in which tokens are aligned (`horizontal | vertical`).\n */\n alignment?: FileTokenGroupProps.Alignment;\n\n /**\n *\n * An array of objects representing token items. Each token has the following properties:\n *\n * - `file` (string) - File value.\n * - `loading` (boolean) - (Optional) Determine whether the token is loading.\n * - `errorText` (string) - (Optional) Text that displays as a validation error message.\n * - `warningText` (string) - (Optional) - Text that displays as a validation warning message.\n */\n items: ReadonlyArray<FileTokenGroupProps.Item>;\n /**\n * Adds an `aria-label` to the \"Show fewer\" button.\n * Use to assign unique labels when there are multiple file token groups with the same `limitShowFewer` label on one page.\n */\n limitShowFewerAriaLabel?: string;\n /**\n * Adds an `aria-label` to the \"Show more\" button.\n * Use to assign unique labels when there are multiple file token groups with the same `limitShowMore` label on one page.\n */\n limitShowMoreAriaLabel?: string;\n /**\n * Specifies if the control is read-only, which prevents the\n * user from modifying the value. A read-only control is still focusable.\n */\n readOnly?: boolean;\n /**\n * An object containing all the localized strings required by the component:\n * * `removeFileAriaLabel` (function): A function to render the ARIA label for file token remove button.\n * * `errorIconAriaLabel` (string): The ARIA label to be shown on the error file icon.\n * * `warningIconAriaLabel` (string): The ARIA label to be shown on the warning file icon.\n * * `formatFileSize` (function): (Optional) A function that takes file size in bytes, and produces a formatted string.\n * * `formatFileLastModified` (function): (Optional) A function that takes the files last modified date, and produces a formatted string.\n */\n i18nStrings: FileTokenGroupProps.I18nStrings;\n}\n\nexport namespace FileTokenGroupProps {\n export interface DismissDetail {\n fileIndex: number;\n }\n\n export interface I18nStrings {\n limitShowFewer?: string;\n limitShowMore?: string;\n\n removeFileAriaLabel: (fileIndex: number) => string;\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n formatFileSize?: (sizeInBytes: number) => string;\n formatFileLastModified?: (date: Date) => string;\n }\n\n export type Alignment = 'horizontal' | 'vertical';\n\n export interface Item {\n file: File;\n loading?: boolean;\n errorText?: null | string;\n warningText?: null | string;\n }\n}\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InternalBaseComponentProps } from '
|
|
2
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';
|
|
3
3
|
import { FileTokenGroupProps } from './interfaces.js';
|
|
4
|
-
export { FileTokenGroupProps };
|
|
5
4
|
type InternalFileTokenGroupProps = FileTokenGroupProps & InternalBaseComponentProps;
|
|
6
5
|
declare function InternalFileTokenGroup({ items, showFileLastModified, showFileSize, showFileThumbnail, i18nStrings, onDismiss, limit, readOnly, alignment, __internalRootRef, ...restProps }: InternalFileTokenGroupProps): JSX.Element;
|
|
7
6
|
export default InternalFileTokenGroup;
|
|
8
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-token-group/internal.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAI3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAMtD,KAAK,2BAA2B,GAAG,mBAAmB,GAAG,0BAA0B,CAAC;AAEpF,iBAAS,sBAAsB,CAAC,EAC9B,KAAK,EACL,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAsB,EACtB,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,2BAA2B,eAqD7B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import { __rest } from "tslib";
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import { getBaseProps } from '
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
6
|
+
import { getBaseProps } from '../internal/base-component/index.js';
|
|
7
|
+
import TokenList from '../internal/components/token-list/index.js';
|
|
8
|
+
import { fireNonCancelableEvent } from '../internal/events/index.js';
|
|
9
|
+
import { useListFocusController } from '../internal/hooks/use-list-focus-controller.js';
|
|
10
|
+
import { useMergeRefs } from '../internal/hooks/use-merge-refs/index.js';
|
|
11
11
|
import InternalFileToken from './file-token.js';
|
|
12
|
-
import tokenListStyles from '../token-list/styles.css.js';
|
|
12
|
+
import tokenListStyles from '../internal/components/token-list/styles.css.js';
|
|
13
13
|
import styles from './styles.css.js';
|
|
14
14
|
import testStyles from './test-classes/styles.css.js';
|
|
15
15
|
function InternalFileTokenGroup(_a) {
|
|
@@ -38,4 +38,4 @@ function InternalFileTokenGroup(_a) {
|
|
|
38
38
|
} })));
|
|
39
39
|
}
|
|
40
40
|
export default InternalFileTokenGroup;
|
|
41
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/file-token-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,SAAS,MAAM,4CAA4C,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,iBAAiB,MAAM,iBAAiB,CAAC;AAGhD,OAAO,eAAe,MAAM,iDAAiD,CAAC;AAC9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,UAAU,MAAM,8BAA8B,CAAC;AAItD,SAAS,sBAAsB,CAAC,EAYF;QAZE,EAC9B,KAAK,EACL,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAS,GAAG,UAAU,EACtB,iBAAiB,OAEW,EADzB,SAAS,cAXkB,yJAY/B,CADa;IAEZ,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC1E,MAAM,YAAY,GAAG,sBAAsB,CAAC;QAC1C,cAAc;QACd,YAAY,EAAE,MAAM,CAAC,EAAE;YACrB,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,gBAAgB,EAAE,IAAI,eAAe,CAAC,WAA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pB,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAC3B,KAAK,EAAE,SAAS,GAChB,CACH,EACD,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE;gBACX,cAAc,EAAE,WAAW,CAAC,cAAc;gBAC1C,aAAa,EAAE,WAAW,CAAC,aAAa;aACzC,GACD,CACE,CACP,CAAC;AACJ,CAAC;AAED,eAAe,sBAAsB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component/index.js';\nimport TokenList from '../internal/components/token-list/index.js';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useListFocusController } from '../internal/hooks/use-list-focus-controller.js';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs/index.js';\nimport InternalFileToken from './file-token.js';\nimport { FileTokenGroupProps } from './interfaces.js';\n\nimport tokenListStyles from '../internal/components/token-list/styles.css.js';\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\ntype InternalFileTokenGroupProps = FileTokenGroupProps & InternalBaseComponentProps;\n\nfunction InternalFileTokenGroup({\n items,\n showFileLastModified,\n showFileSize,\n showFileThumbnail,\n i18nStrings,\n onDismiss,\n limit,\n readOnly,\n alignment = 'vertical',\n __internalRootRef,\n ...restProps\n}: InternalFileTokenGroupProps) {\n const baseProps = getBaseProps(restProps);\n\n const [nextFocusIndex, setNextFocusIndex] = useState<null | number>(null);\n const tokenListRef = useListFocusController({\n nextFocusIndex,\n onFocusMoved: target => {\n target.focus();\n setNextFocusIndex(null);\n },\n listItemSelector: `.${tokenListStyles['list-item']}`,\n showMoreSelector: `.${tokenListStyles.toggle}`,\n });\n\n const mergedRef = useMergeRefs(__internalRootRef, tokenListRef);\n\n const isImage = (file: File) => file.type.startsWith('image/');\n const groupContainsImage = items.filter(item => isImage(item.file)).length > 0;\n\n return (\n <div {...baseProps} ref={mergedRef} className={clsx(baseProps.className, styles.root, testStyles.root)}>\n <TokenList\n alignment={alignment === 'horizontal' ? 'horizontal-grid' : alignment}\n items={items}\n renderItem={(file, fileIndex) => (\n <InternalFileToken\n file={file.file}\n showFileLastModified={showFileLastModified}\n showFileSize={showFileSize}\n showFileThumbnail={showFileThumbnail}\n onDismiss={() => {\n fireNonCancelableEvent(onDismiss, { fileIndex });\n setNextFocusIndex(fileIndex);\n }}\n errorText={file.errorText}\n warningText={file.warningText}\n i18nStrings={i18nStrings}\n loading={file.loading}\n readOnly={readOnly}\n alignment={alignment}\n groupContainsImage={groupContainsImage}\n isImage={isImage(file.file)}\n index={fileIndex}\n />\n )}\n limit={limit}\n i18nStrings={{\n limitShowFewer: i18nStrings.limitShowFewer,\n limitShowMore: i18nStrings.limitShowMore,\n }}\n />\n </div>\n );\n}\n\nexport default InternalFileTokenGroup;\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"root": "awsui_root_39ths_y71y3_205",
|
|
5
|
+
"file-loading-overlay": "awsui_file-loading-overlay_39ths_y71y3_240",
|
|
6
|
+
"file-loading-overlay-single-row": "awsui_file-loading-overlay-single-row_39ths_y71y3_245",
|
|
7
|
+
"file-option-name": "awsui_file-option-name_39ths_y71y3_249",
|
|
8
|
+
"file-option-size": "awsui_file-option-size_39ths_y71y3_250",
|
|
9
|
+
"file-option-last-modified": "awsui_file-option-last-modified_39ths_y71y3_251",
|
|
10
|
+
"file-option": "awsui_file-option_39ths_y71y3_249",
|
|
11
|
+
"file-option-thumbnail": "awsui_file-option-thumbnail_39ths_y71y3_264",
|
|
12
|
+
"file-option-thumbnail-image": "awsui_file-option-thumbnail-image_39ths_y71y3_268",
|
|
13
|
+
"file-option-metadata": "awsui_file-option-metadata_39ths_y71y3_281",
|
|
14
|
+
"with-image": "awsui_with-image_39ths_y71y3_284",
|
|
15
|
+
"single-row-loading": "awsui_single-row-loading_39ths_y71y3_287",
|
|
16
|
+
"token": "awsui_token_39ths_y71y3_291",
|
|
17
|
+
"token-grid": "awsui_token-grid_39ths_y71y3_298",
|
|
18
|
+
"token-contains-image": "awsui_token-contains-image_39ths_y71y3_307",
|
|
19
|
+
"token-box": "awsui_token-box_39ths_y71y3_311",
|
|
20
|
+
"horizontal": "awsui_horizontal_39ths_y71y3_330",
|
|
21
|
+
"error": "awsui_error_39ths_y71y3_338",
|
|
22
|
+
"dismiss-button": "awsui_dismiss-button_39ths_y71y3_342",
|
|
23
|
+
"warning": "awsui_warning_39ths_y71y3_348",
|
|
24
|
+
"read-only": "awsui_read-only_39ths_y71y3_358",
|
|
25
|
+
"loading": "awsui_loading_39ths_y71y3_371"
|
|
26
|
+
};
|
|
27
|
+
|
|
@@ -202,7 +202,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
202
202
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
203
203
|
SPDX-License-Identifier: Apache-2.0
|
|
204
204
|
*/
|
|
205
|
-
.
|
|
205
|
+
.awsui_root_39ths_y71y3_205:not(#\9) {
|
|
206
206
|
border-collapse: separate;
|
|
207
207
|
border-spacing: 0;
|
|
208
208
|
box-sizing: border-box;
|
|
@@ -238,35 +238,35 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
238
238
|
-moz-osx-font-smoothing: auto;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
.awsui_file-loading-
|
|
241
|
+
.awsui_file-loading-overlay_39ths_y71y3_240:not(#\9) {
|
|
242
242
|
position: absolute;
|
|
243
243
|
inset-inline-end: var(--space-static-xs-fwcjew, 8px);
|
|
244
244
|
inset-block-end: var(--space-static-xxs-9qxzo2, 4px);
|
|
245
245
|
}
|
|
246
|
-
.awsui_file-loading-overlay-single-
|
|
246
|
+
.awsui_file-loading-overlay-single-row_39ths_y71y3_245:not(#\9) {
|
|
247
247
|
inset-inline-end: var(--space-static-xxl-ybu58c, 32px);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
.awsui_file-option-
|
|
251
|
-
.awsui_file-option-
|
|
252
|
-
.awsui_file-option-last-
|
|
250
|
+
.awsui_file-option-name_39ths_y71y3_249:not(#\9),
|
|
251
|
+
.awsui_file-option-size_39ths_y71y3_250:not(#\9),
|
|
252
|
+
.awsui_file-option-last-modified_39ths_y71y3_251:not(#\9) {
|
|
253
253
|
text-overflow: ellipsis;
|
|
254
254
|
overflow: hidden;
|
|
255
255
|
white-space: nowrap;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
.awsui_file-
|
|
258
|
+
.awsui_file-option_39ths_y71y3_249:not(#\9) {
|
|
259
259
|
inline-size: 100%;
|
|
260
260
|
min-inline-size: 0;
|
|
261
261
|
display: flex;
|
|
262
262
|
gap: var(--space-scaled-xs-t3am3w, 8px);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
.awsui_file-option-
|
|
265
|
+
.awsui_file-option-thumbnail_39ths_y71y3_264:not(#\9) {
|
|
266
266
|
margin-block-start: var(--space-static-xxs-9qxzo2, 4px);
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
.awsui_file-option-thumbnail-
|
|
269
|
+
.awsui_file-option-thumbnail-image_39ths_y71y3_268:not(#\9) {
|
|
270
270
|
font-size: var(--font-size-body-s-4dzx5q, 12px);
|
|
271
271
|
line-height: var(--line-height-body-s-egzl4q, 16px);
|
|
272
272
|
letter-spacing: var(--letter-spacing-body-s-cbaxyl, normal);
|
|
@@ -279,37 +279,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
279
279
|
overflow: hidden;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
.awsui_file-option-
|
|
282
|
+
.awsui_file-option-metadata_39ths_y71y3_281:not(#\9) {
|
|
283
283
|
inline-size: 100%;
|
|
284
284
|
}
|
|
285
|
-
.awsui_file-option-
|
|
285
|
+
.awsui_file-option-metadata_39ths_y71y3_281.awsui_with-image_39ths_y71y3_284:not(#\9) {
|
|
286
286
|
inline-size: calc(100% - 48px);
|
|
287
287
|
}
|
|
288
|
-
.awsui_file-option-
|
|
288
|
+
.awsui_file-option-metadata_39ths_y71y3_281.awsui_single-row-loading_39ths_y71y3_287:not(#\9) {
|
|
289
289
|
inline-size: calc(100% - var(--size-icon-normal-19036g, 16px));
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
.
|
|
292
|
+
.awsui_token_39ths_y71y3_291:not(#\9) {
|
|
293
293
|
position: relative;
|
|
294
294
|
block-size: 100%;
|
|
295
295
|
display: flex;
|
|
296
296
|
flex-direction: column;
|
|
297
297
|
gap: var(--space-xxs-y2432o, 4px);
|
|
298
298
|
}
|
|
299
|
-
.awsui_token-
|
|
299
|
+
.awsui_token-grid_39ths_y71y3_298:not(#\9) {
|
|
300
300
|
display: grid;
|
|
301
301
|
grid-template-rows: max-content auto;
|
|
302
302
|
}
|
|
303
303
|
@media (max-width: 688px) {
|
|
304
|
-
.awsui_token-
|
|
304
|
+
.awsui_token-grid_39ths_y71y3_298:not(#\9) {
|
|
305
305
|
display: flex;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
.awsui_token-contains-
|
|
308
|
+
.awsui_token-contains-image_39ths_y71y3_307:not(#\9) {
|
|
309
309
|
grid-template-rows: 68px auto;
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
.awsui_token-
|
|
312
|
+
.awsui_token-box_39ths_y71y3_311:not(#\9) {
|
|
313
313
|
position: relative;
|
|
314
314
|
block-size: 100%;
|
|
315
315
|
border-block: var(--border-field-width-fjuzc5, 1px) solid var(--color-border-item-selected-aam4fo, #0073bb);
|
|
@@ -328,48 +328,48 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
328
328
|
color: var(--color-text-body-default-agk00h, #16191f);
|
|
329
329
|
box-sizing: border-box;
|
|
330
330
|
}
|
|
331
|
-
.awsui_token-
|
|
331
|
+
.awsui_token-box_39ths_y71y3_311.awsui_horizontal_39ths_y71y3_330:not(#\9) {
|
|
332
332
|
max-inline-size: 230px;
|
|
333
333
|
}
|
|
334
334
|
@media (max-width: 688px) {
|
|
335
|
-
.awsui_token-
|
|
335
|
+
.awsui_token-box_39ths_y71y3_311.awsui_horizontal_39ths_y71y3_330:not(#\9) {
|
|
336
336
|
max-inline-size: 100%;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
.awsui_token-
|
|
339
|
+
.awsui_token-box_39ths_y71y3_311.awsui_error_39ths_y71y3_338:not(#\9) {
|
|
340
340
|
border-color: var(--color-border-status-error-5n723o, #d13212);
|
|
341
341
|
border-inline-start-width: var(--border-invalid-width-bkxihb, 4px);
|
|
342
342
|
}
|
|
343
|
-
.awsui_token-
|
|
343
|
+
.awsui_token-box_39ths_y71y3_311.awsui_error_39ths_y71y3_338 > .awsui_dismiss-button_39ths_y71y3_342:not(#\9) {
|
|
344
344
|
color: var(--color-text-interactive-default-t1snbz, #545b64);
|
|
345
345
|
}
|
|
346
|
-
.awsui_token-
|
|
346
|
+
.awsui_token-box_39ths_y71y3_311.awsui_error_39ths_y71y3_338 > .awsui_dismiss-button_39ths_y71y3_342:not(#\9):hover {
|
|
347
347
|
color: var(--color-text-interactive-hover-kxltdh, #16191f);
|
|
348
348
|
}
|
|
349
|
-
.awsui_token-
|
|
349
|
+
.awsui_token-box_39ths_y71y3_311.awsui_warning_39ths_y71y3_348:not(#\9) {
|
|
350
350
|
border-color: var(--color-border-status-warning-wkps52, #906806);
|
|
351
351
|
border-inline-start-width: var(--border-invalid-width-bkxihb, 4px);
|
|
352
352
|
}
|
|
353
|
-
.awsui_token-
|
|
353
|
+
.awsui_token-box_39ths_y71y3_311.awsui_warning_39ths_y71y3_348 > .awsui_dismiss-button_39ths_y71y3_342:not(#\9) {
|
|
354
354
|
color: var(--color-text-interactive-default-t1snbz, #545b64);
|
|
355
355
|
}
|
|
356
|
-
.awsui_token-
|
|
356
|
+
.awsui_token-box_39ths_y71y3_311.awsui_warning_39ths_y71y3_348 > .awsui_dismiss-button_39ths_y71y3_342:not(#\9):hover {
|
|
357
357
|
color: var(--color-text-interactive-hover-kxltdh, #16191f);
|
|
358
358
|
}
|
|
359
|
-
.awsui_token-
|
|
359
|
+
.awsui_token-box_39ths_y71y3_311.awsui_read-only_39ths_y71y3_358:not(#\9) {
|
|
360
360
|
border-color: var(--color-border-input-disabled-vjmitr, #eaeded);
|
|
361
361
|
background-color: var(--color-background-container-content-myy7cn, #ffffff);
|
|
362
362
|
pointer-events: none;
|
|
363
363
|
}
|
|
364
|
-
.awsui_token-
|
|
364
|
+
.awsui_token-box_39ths_y71y3_311.awsui_read-only_39ths_y71y3_358 > .awsui_dismiss-button_39ths_y71y3_342:not(#\9) {
|
|
365
365
|
color: var(--color-text-button-inline-icon-disabled-pdpnjk, #aab7b8);
|
|
366
366
|
}
|
|
367
|
-
.awsui_token-
|
|
367
|
+
.awsui_token-box_39ths_y71y3_311.awsui_read-only_39ths_y71y3_358 > .awsui_dismiss-button_39ths_y71y3_342:not(#\9):hover {
|
|
368
368
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
369
369
|
cursor: initial;
|
|
370
370
|
color: var(--color-text-button-inline-icon-disabled-pdpnjk, #aab7b8);
|
|
371
371
|
}
|
|
372
|
-
.awsui_token-
|
|
372
|
+
.awsui_token-box_39ths_y71y3_311.awsui_loading_39ths_y71y3_371:not(#\9) {
|
|
373
373
|
border-color: var(--color-border-control-disabled-7jgofv, #d5dbdb);
|
|
374
374
|
background-color: var(--color-background-container-content-myy7cn, #ffffff);
|
|
375
375
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_39ths_y71y3_205",
|
|
6
|
+
"file-loading-overlay": "awsui_file-loading-overlay_39ths_y71y3_240",
|
|
7
|
+
"file-loading-overlay-single-row": "awsui_file-loading-overlay-single-row_39ths_y71y3_245",
|
|
8
|
+
"file-option-name": "awsui_file-option-name_39ths_y71y3_249",
|
|
9
|
+
"file-option-size": "awsui_file-option-size_39ths_y71y3_250",
|
|
10
|
+
"file-option-last-modified": "awsui_file-option-last-modified_39ths_y71y3_251",
|
|
11
|
+
"file-option": "awsui_file-option_39ths_y71y3_249",
|
|
12
|
+
"file-option-thumbnail": "awsui_file-option-thumbnail_39ths_y71y3_264",
|
|
13
|
+
"file-option-thumbnail-image": "awsui_file-option-thumbnail-image_39ths_y71y3_268",
|
|
14
|
+
"file-option-metadata": "awsui_file-option-metadata_39ths_y71y3_281",
|
|
15
|
+
"with-image": "awsui_with-image_39ths_y71y3_284",
|
|
16
|
+
"single-row-loading": "awsui_single-row-loading_39ths_y71y3_287",
|
|
17
|
+
"token": "awsui_token_39ths_y71y3_291",
|
|
18
|
+
"token-grid": "awsui_token-grid_39ths_y71y3_298",
|
|
19
|
+
"token-contains-image": "awsui_token-contains-image_39ths_y71y3_307",
|
|
20
|
+
"token-box": "awsui_token-box_39ths_y71y3_311",
|
|
21
|
+
"horizontal": "awsui_horizontal_39ths_y71y3_330",
|
|
22
|
+
"error": "awsui_error_39ths_y71y3_338",
|
|
23
|
+
"dismiss-button": "awsui_dismiss-button_39ths_y71y3_342",
|
|
24
|
+
"warning": "awsui_warning_39ths_y71y3_348",
|
|
25
|
+
"read-only": "awsui_read-only_39ths_y71y3_358",
|
|
26
|
+
"loading": "awsui_loading_39ths_y71y3_371"
|
|
27
|
+
};
|
|
28
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"root": "awsui_root_polq8_6ggi7_5",
|
|
5
|
+
"file-option-thumbnail": "awsui_file-option-thumbnail_polq8_6ggi7_6",
|
|
6
|
+
"file-option-name": "awsui_file-option-name_polq8_6ggi7_7",
|
|
7
|
+
"file-option-size": "awsui_file-option-size_polq8_6ggi7_8",
|
|
8
|
+
"file-option-last-modified": "awsui_file-option-last-modified_polq8_6ggi7_9",
|
|
9
|
+
"ellipsis-active": "awsui_ellipsis-active_polq8_6ggi7_10"
|
|
10
|
+
};
|
|
11
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
.awsui_root_polq8_6ggi7_5:not(#\9),
|
|
6
|
+
.awsui_file-option-thumbnail_polq8_6ggi7_6:not(#\9),
|
|
7
|
+
.awsui_file-option-name_polq8_6ggi7_7:not(#\9),
|
|
8
|
+
.awsui_file-option-size_polq8_6ggi7_8:not(#\9),
|
|
9
|
+
.awsui_file-option-last-modified_polq8_6ggi7_9:not(#\9),
|
|
10
|
+
.awsui_ellipsis-active_polq8_6ggi7_10:not(#\9) {
|
|
11
|
+
/* used in test-utils */
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_polq8_6ggi7_5",
|
|
6
|
+
"file-option-thumbnail": "awsui_file-option-thumbnail_polq8_6ggi7_6",
|
|
7
|
+
"file-option-name": "awsui_file-option-name_polq8_6ggi7_7",
|
|
8
|
+
"file-option-size": "awsui_file-option-size_polq8_6ggi7_8",
|
|
9
|
+
"file-option-last-modified": "awsui_file-option-last-modified_polq8_6ggi7_9",
|
|
10
|
+
"ellipsis-active": "awsui_ellipsis-active_polq8_6ggi7_10"
|
|
11
|
+
};
|
|
12
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.d.ts","sourceRoot":"","sources":["../../../src/file-token-group/thumbnail.tsx"],"names":[],"mappings":";AAOA,UAAU,wBAAwB;IAChC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,eAoBrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.js","sourceRoot":"","sources":["../../../src/file-token-group/thumbnail.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAA4B;IACpE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE7C,SAAS,CAAC,GAAG,EAAE;QACb,qDAAqD;QACrD,IAAI,GAAG,CAAC,eAAe,EAAE;YACvB,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACtC,WAAW,CAAC,GAAG,CAAC,CAAC;YAEjB,OAAO,GAAG,EAAE;gBACV,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,iBAAe,IAAI;QAChE,6BAAK,SAAS,EAAE,MAAM,CAAC,6BAA6B,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAI,CACpF,CACP,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, useState } from 'react';\n\nimport styles from './styles.css.js';\n\ninterface FileOptionThumbnailProps {\n file: File;\n}\n\nexport function FileOptionThumbnail({ file }: FileOptionThumbnailProps) {\n const [imageSrc, setImageSrc] = useState('');\n\n useEffect(() => {\n // The URL.createObjectURL is not available in jsdom.\n if (URL.createObjectURL) {\n const src = URL.createObjectURL(file);\n setImageSrc(src);\n\n return () => {\n URL.revokeObjectURL(src);\n };\n }\n }, [file]);\n\n return (\n <div className={styles['file-option-thumbnail']} aria-hidden={true}>\n <img className={styles['file-option-thumbnail-image']} alt={file.name} src={imageSrc} />\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-upload/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-upload/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAMlF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;;AAQ/C,wBAAoD"}
|
|
@@ -6,11 +6,12 @@ import clsx from 'clsx';
|
|
|
6
6
|
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
7
7
|
import InternalBox from '../box/internal';
|
|
8
8
|
import { useFormFieldContext } from '../contexts/form-field';
|
|
9
|
+
import InternalFileDropzone from '../file-dropzone/internal';
|
|
10
|
+
import { useFilesDragging } from '../file-dropzone/use-files-dragging';
|
|
11
|
+
import InternalFileInput from '../file-input/internal';
|
|
12
|
+
import InternalFileTokenGroup from '../file-token-group/internal';
|
|
9
13
|
import { ConstraintText, FormFieldError, FormFieldWarning } from '../form-field/internal';
|
|
10
14
|
import { getBaseProps } from '../internal/base-component';
|
|
11
|
-
import InternalFileDropzone, { useFilesDragging } from '../internal/components/file-dropzone';
|
|
12
|
-
import InternalFileInput from '../internal/components/file-input';
|
|
13
|
-
import InternalFileTokenGroup from '../internal/components/file-token-group';
|
|
14
15
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
15
16
|
import checkControlled from '../internal/hooks/check-controlled';
|
|
16
17
|
import { useListFocusController } from '../internal/hooks/use-list-focus-controller';
|
|
@@ -18,7 +19,7 @@ import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
|
18
19
|
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
19
20
|
import { joinStrings } from '../internal/utils/strings';
|
|
20
21
|
import InternalSpaceBetween from '../space-between/internal';
|
|
21
|
-
import fileInputStyles from '../
|
|
22
|
+
import fileInputStyles from '../file-input/styles.css.js';
|
|
22
23
|
import tokenListStyles from '../internal/components/token-list/styles.css.js';
|
|
23
24
|
import styles from './styles.css.js';
|
|
24
25
|
export default React.forwardRef(InternalFileUpload);
|
|
@@ -67,7 +68,7 @@ function InternalFileUpload(_a, externalRef) {
|
|
|
67
68
|
const invalid = restProps.invalid || formFieldContext.invalid || hasError;
|
|
68
69
|
return (React.createElement(InternalSpaceBetween, Object.assign({}, baseProps, { size: "xs", className: clsx(baseProps.className, styles.root), __internalRootRef: __internalRootRef, ref: tokenListRef }),
|
|
69
70
|
React.createElement(InternalBox, null,
|
|
70
|
-
areFilesDragging ? (React.createElement(InternalFileDropzone, { onChange: event => handleFilesChange(event.detail.value) }, i18nStrings.dropzoneText(multiple))) : (React.createElement(InternalFileInput,
|
|
71
|
+
areFilesDragging ? (React.createElement(InternalFileDropzone, { onChange: event => handleFilesChange(event.detail.value) }, i18nStrings.dropzoneText(multiple))) : (React.createElement(InternalFileInput, { ref: ref, accept: accept, ariaRequired: ariaRequired, multiple: multiple, onChange: event => handleFilesChange(event.detail.value), value: value, ariaLabelledby: restProps.ariaLabelledby, controlId: restProps.controlId, ariaDescribedby: ariaDescribedBy, invalid: invalid }, i18nStrings.uploadButtonText(multiple))),
|
|
71
72
|
(constraintText || errorText || warningText) && (React.createElement("div", { className: styles.hints },
|
|
72
73
|
errorText && (React.createElement(FormFieldError, { id: errorId, errorIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.errorIconAriaLabel }, errorText)),
|
|
73
74
|
showWarning && (React.createElement(FormFieldWarning, { id: warningId, warningIconAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.warningIconAriaLabel }, warningText)),
|