@cloudscape-design/components 3.0.827 → 3.0.829
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/app-layout/visual-refresh-toolbar/navigation/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/navigation/index.js +2 -1
- package/app-layout/visual-refresh-toolbar/navigation/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/notifications/index.d.ts +1 -2
- package/app-layout/visual-refresh-toolbar/notifications/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/notifications/index.js +2 -1
- package/app-layout/visual-refresh-toolbar/notifications/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/index.d.ts +9 -0
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/index.d.ts.map +1 -0
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/index.js +13 -0
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/index.js.map +1 -0
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/styles.css.js +7 -0
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/styles.scoped.css +7 -0
- package/app-layout/visual-refresh-toolbar/skeleton/breadcrumbs/styles.selectors.js +8 -0
- package/app-layout/visual-refresh-toolbar/skeleton/slot-skeletons.d.ts +6 -0
- package/app-layout/visual-refresh-toolbar/skeleton/slot-skeletons.d.ts.map +1 -0
- package/app-layout/visual-refresh-toolbar/skeleton/slot-skeletons.js +9 -0
- package/app-layout/visual-refresh-toolbar/skeleton/slot-skeletons.js.map +1 -0
- package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/index.js +4 -7
- package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +13 -15
- package/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +15 -19
- package/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +13 -15
- package/breadcrumb-group/implementation.d.ts.map +1 -1
- package/breadcrumb-group/implementation.js +5 -7
- package/breadcrumb-group/implementation.js.map +1 -1
- package/breadcrumb-group/index.d.ts.map +1 -1
- package/breadcrumb-group/index.js +2 -1
- package/breadcrumb-group/index.js.map +1 -1
- package/breadcrumb-group/interfaces.d.ts +2 -1
- package/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/breadcrumb-group/interfaces.js.map +1 -1
- package/breadcrumb-group/item/funnel.d.ts +4 -3
- package/breadcrumb-group/item/funnel.d.ts.map +1 -1
- package/breadcrumb-group/item/funnel.js +10 -6
- package/breadcrumb-group/item/funnel.js.map +1 -1
- package/breadcrumb-group/item/item.d.ts +1 -1
- package/breadcrumb-group/item/item.d.ts.map +1 -1
- package/breadcrumb-group/item/item.js +10 -10
- package/breadcrumb-group/item/item.js.map +1 -1
- package/breadcrumb-group/item/styles.css.js +7 -8
- package/breadcrumb-group/item/styles.scoped.css +25 -29
- package/breadcrumb-group/item/styles.selectors.js +7 -8
- package/breadcrumb-group/skeleton.d.ts +4 -3
- package/breadcrumb-group/skeleton.d.ts.map +1 -1
- package/breadcrumb-group/skeleton.js +2 -7
- package/breadcrumb-group/skeleton.js.map +1 -1
- package/breadcrumb-group/styles.css.js +10 -9
- package/breadcrumb-group/styles.scoped.css +14 -10
- package/breadcrumb-group/styles.selectors.js +10 -9
- package/button-group/icon-toggle-button-item.d.ts +12 -0
- package/button-group/icon-toggle-button-item.d.ts.map +1 -0
- package/button-group/icon-toggle-button-item.js +30 -0
- package/button-group/icon-toggle-button-item.js.map +1 -0
- package/button-group/interfaces.d.ts +42 -6
- package/button-group/interfaces.d.ts.map +1 -1
- package/button-group/interfaces.js.map +1 -1
- package/button-group/item-element.d.ts.map +1 -1
- package/button-group/item-element.js +2 -0
- package/button-group/item-element.js.map +1 -1
- package/button-group/menu-dropdown-item.js +1 -1
- package/button-group/menu-dropdown-item.js.map +1 -1
- package/{internal/components/file-dropzone → file-dropzone}/index.d.ts +1 -1
- package/file-dropzone/index.d.ts.map +1 -0
- package/file-dropzone/index.js +14 -0
- package/file-dropzone/index.js.map +1 -0
- package/{internal/components/file-dropzone → file-dropzone}/interfaces.d.ts +2 -2
- package/file-dropzone/interfaces.d.ts.map +1 -0
- package/file-dropzone/interfaces.js.map +1 -0
- package/file-dropzone/internal.d.ts +5 -0
- package/file-dropzone/internal.d.ts.map +1 -0
- package/{internal/components/file-dropzone/index.js → file-dropzone/internal.js} +10 -6
- package/file-dropzone/internal.js.map +1 -0
- package/file-dropzone/styles.css.js +8 -0
- package/{internal/components/file-dropzone → file-dropzone}/styles.scoped.css +17 -14
- package/{internal/components/file-dropzone → file-dropzone}/styles.selectors.js +3 -3
- package/file-dropzone/use-files-dragging.d.ts.map +1 -0
- package/file-dropzone/use-files-dragging.js.map +1 -0
- package/file-input/index.d.ts +6 -0
- package/file-input/index.d.ts.map +1 -0
- package/file-input/index.js +20 -0
- package/file-input/index.js.map +1 -0
- package/{internal/components/file-input → file-input}/interfaces.d.ts +3 -3
- package/file-input/interfaces.d.ts.map +1 -0
- package/file-input/interfaces.js.map +1 -0
- package/file-input/internal.d.ts +6 -0
- package/file-input/internal.d.ts.map +1 -0
- package/{internal/components/file-input/index.js → file-input/internal.js} +13 -11
- package/file-input/internal.js.map +1 -0
- package/file-input/styles.css.js +10 -0
- package/{internal/components/file-input → file-input}/styles.scoped.css +6 -6
- package/file-input/styles.selectors.js +11 -0
- package/file-token-group/default-formatters.d.ts.map +1 -0
- package/{internal/components/file-token-group → file-token-group}/default-formatters.js +1 -1
- package/file-token-group/default-formatters.js.map +1 -0
- package/{internal/components/file-token-group → file-token-group}/file-token.d.ts +2 -2
- package/file-token-group/file-token.d.ts.map +1 -0
- package/{internal/components/file-token-group → file-token-group}/file-token.js +8 -8
- package/file-token-group/file-token.js.map +1 -0
- package/file-token-group/index.d.ts +6 -0
- package/file-token-group/index.d.ts.map +1 -0
- package/file-token-group/index.js +23 -0
- package/file-token-group/index.js.map +1 -0
- package/{internal/components/file-token-group → file-token-group}/interfaces.d.ts +2 -2
- package/file-token-group/interfaces.d.ts.map +1 -0
- package/file-token-group/interfaces.js.map +1 -0
- package/{internal/components/file-token-group/index.d.ts → file-token-group/internal.d.ts} +2 -3
- package/file-token-group/internal.d.ts.map +1 -0
- package/{internal/components/file-token-group/index.js → file-token-group/internal.js} +7 -7
- package/file-token-group/internal.js.map +1 -0
- package/file-token-group/styles.css.js +27 -0
- package/{internal/components/file-token-group → file-token-group}/styles.scoped.css +29 -29
- package/file-token-group/styles.selectors.js +28 -0
- package/file-token-group/test-classes/styles.css.js +11 -0
- package/file-token-group/test-classes/styles.scoped.css +12 -0
- package/file-token-group/test-classes/styles.selectors.js +12 -0
- package/file-token-group/thumbnail.d.ts.map +1 -0
- package/file-token-group/thumbnail.js.map +1 -0
- package/file-upload/internal.d.ts.map +1 -1
- package/file-upload/internal.js +6 -5
- package/file-upload/internal.js.map +1 -1
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/internal/analytics/components/analytics-funnel.js +2 -2
- package/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/internal/analytics/selectors.d.ts +1 -1
- package/internal/analytics/selectors.d.ts.map +1 -1
- package/internal/analytics/selectors.js +2 -4
- package/internal/analytics/selectors.js.map +1 -1
- package/internal/base-component/styles.scoped.css +30 -20
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +4 -2
- package/internal/generated/styles/tokens.js +6 -4
- package/internal/generated/theming/index.cjs +136 -74
- package/internal/generated/theming/index.js +136 -74
- package/internal/manifest.json +1 -1
- package/internal/widgets/index.d.ts +4 -3
- package/internal/widgets/index.d.ts.map +1 -1
- package/internal/widgets/index.js +2 -2
- package/internal/widgets/index.js.map +1 -1
- package/package.json +4 -1
- package/test-utils/dom/button-group/index.d.ts +5 -0
- package/test-utils/dom/button-group/index.js +9 -0
- package/test-utils/dom/button-group/index.js.map +1 -1
- package/test-utils/dom/{internal/file-dropzone.js → file-dropzone/index.js} +2 -2
- package/test-utils/dom/file-dropzone/index.js.map +1 -0
- package/test-utils/dom/{internal/file-input.js → file-input/index.js} +2 -2
- package/test-utils/dom/file-input/index.js.map +1 -0
- package/test-utils/dom/{internal/file-token-group.js → file-token-group/index.js} +14 -14
- package/test-utils/dom/file-token-group/index.js.map +1 -0
- package/test-utils/dom/file-upload/index.d.ts +1 -1
- package/test-utils/dom/file-upload/index.js +13 -13
- package/test-utils/dom/file-upload/index.js.map +1 -1
- package/test-utils/dom/index.d.ts +9 -0
- package/test-utils/dom/index.js +26 -2
- package/test-utils/dom/index.js.map +1 -1
- package/test-utils/selectors/button-group/index.d.ts +5 -0
- package/test-utils/selectors/button-group/index.js +9 -0
- package/test-utils/selectors/button-group/index.js.map +1 -1
- package/test-utils/selectors/{internal/file-dropzone.js → file-dropzone/index.js} +2 -2
- package/test-utils/selectors/file-dropzone/index.js.map +1 -0
- package/test-utils/selectors/{internal/file-input.js → file-input/index.js} +2 -2
- package/test-utils/selectors/file-input/index.js.map +1 -0
- package/test-utils/selectors/{internal/file-token-group.js → file-token-group/index.js} +14 -14
- package/test-utils/selectors/file-token-group/index.js.map +1 -0
- package/test-utils/selectors/file-upload/index.d.ts +1 -1
- package/test-utils/selectors/file-upload/index.js +13 -13
- package/test-utils/selectors/file-upload/index.js.map +1 -1
- package/test-utils/selectors/index.d.ts +9 -0
- package/test-utils/selectors/index.js +26 -2
- package/test-utils/selectors/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/toggle-button/internal.d.ts +3 -1
- package/toggle-button/internal.d.ts.map +1 -1
- package/toggle-button/internal.js.map +1 -1
- package/wizard/internal.d.ts.map +1 -1
- package/wizard/internal.js +2 -2
- package/wizard/internal.js.map +1 -1
- package/internal/components/file-dropzone/index.d.ts.map +0 -1
- package/internal/components/file-dropzone/index.js.map +0 -1
- package/internal/components/file-dropzone/interfaces.d.ts.map +0 -1
- package/internal/components/file-dropzone/interfaces.js.map +0 -1
- package/internal/components/file-dropzone/styles.css.js +0 -8
- package/internal/components/file-dropzone/use-files-dragging.d.ts.map +0 -1
- package/internal/components/file-dropzone/use-files-dragging.js.map +0 -1
- package/internal/components/file-input/index.d.ts +0 -6
- package/internal/components/file-input/index.d.ts.map +0 -1
- package/internal/components/file-input/index.js.map +0 -1
- package/internal/components/file-input/interfaces.d.ts.map +0 -1
- package/internal/components/file-input/interfaces.js.map +0 -1
- package/internal/components/file-input/styles.css.js +0 -10
- package/internal/components/file-input/styles.selectors.js +0 -11
- package/internal/components/file-token-group/default-formatters.d.ts.map +0 -1
- package/internal/components/file-token-group/default-formatters.js.map +0 -1
- package/internal/components/file-token-group/file-token.d.ts.map +0 -1
- package/internal/components/file-token-group/file-token.js.map +0 -1
- package/internal/components/file-token-group/index.d.ts.map +0 -1
- package/internal/components/file-token-group/index.js.map +0 -1
- package/internal/components/file-token-group/interfaces.d.ts.map +0 -1
- package/internal/components/file-token-group/interfaces.js.map +0 -1
- package/internal/components/file-token-group/styles.css.js +0 -27
- package/internal/components/file-token-group/styles.selectors.js +0 -28
- package/internal/components/file-token-group/test-classes/styles.css.js +0 -11
- package/internal/components/file-token-group/test-classes/styles.scoped.css +0 -12
- package/internal/components/file-token-group/test-classes/styles.selectors.js +0 -12
- package/internal/components/file-token-group/thumbnail.d.ts.map +0 -1
- package/internal/components/file-token-group/thumbnail.js.map +0 -1
- package/test-utils/dom/internal/file-dropzone.js.map +0 -1
- package/test-utils/dom/internal/file-input.js.map +0 -1
- package/test-utils/dom/internal/file-token-group.js.map +0 -1
- package/test-utils/selectors/internal/file-dropzone.js.map +0 -1
- package/test-utils/selectors/internal/file-input.js.map +0 -1
- package/test-utils/selectors/internal/file-token-group.js.map +0 -1
- /package/{internal/components/file-dropzone → file-dropzone}/interfaces.js +0 -0
- /package/{internal/components/file-dropzone → file-dropzone}/use-files-dragging.d.ts +0 -0
- /package/{internal/components/file-dropzone → file-dropzone}/use-files-dragging.js +0 -0
- /package/{internal/components/file-input → file-input}/interfaces.js +0 -0
- /package/{internal/components/file-token-group → file-token-group}/default-formatters.d.ts +0 -0
- /package/{internal/components/file-token-group → file-token-group}/interfaces.js +0 -0
- /package/{internal/components/file-token-group → file-token-group}/thumbnail.d.ts +0 -0
- /package/{internal/components/file-token-group → file-token-group}/thumbnail.js +0 -0
- /package/test-utils/dom/{internal/file-dropzone.d.ts → file-dropzone/index.d.ts} +0 -0
- /package/test-utils/dom/{internal/file-input.d.ts → file-input/index.d.ts} +0 -0
- /package/test-utils/dom/{internal/file-token-group.d.ts → file-token-group/index.d.ts} +0 -0
- /package/test-utils/selectors/{internal/file-dropzone.d.ts → file-dropzone/index.d.ts} +0 -0
- /package/test-utils/selectors/{internal/file-input.d.ts → file-input/index.d.ts} +0 -0
- /package/test-utils/selectors/{internal/file-token-group.d.ts → file-token-group/index.d.ts} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
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 InternalFileInput from './internal';
|
|
8
|
+
const FileInput = React.forwardRef((_a, ref) => {
|
|
9
|
+
var { multiple, variant } = _a, props = __rest(_a, ["multiple", "variant"]);
|
|
10
|
+
const baseComponentProps = useBaseComponent('FileInput', {
|
|
11
|
+
props: {
|
|
12
|
+
multiple,
|
|
13
|
+
variant,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
return React.createElement(InternalFileInput, Object.assign({ multiple: multiple, variant: variant }, props, baseComponentProps, { ref: ref }));
|
|
17
|
+
});
|
|
18
|
+
applyDisplayName(FileInput, 'FileInput');
|
|
19
|
+
export default FileInput;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/file-input/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,iBAAiB,MAAM,YAAY,CAAC;AAI3C,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAChC,CAAC,EAA+C,EAAE,GAAkC,EAAE,EAAE;QAAvF,EAAE,QAAQ,EAAE,OAAO,OAA4B,EAAvB,KAAK,cAA7B,uBAA+B,CAAF;IAC5B,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,WAAW,EAAE;QACvD,KAAK,EAAE;YACL,QAAQ;YACR,OAAO;SACR;KACF,CAAC,CAAC;IACH,OAAO,oBAAC,iBAAiB,kBAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,IAAM,KAAK,EAAM,kBAAkB,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAClH,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzC,eAAe,SAAS,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 { FileInputProps } from './interfaces';\nimport InternalFileInput from './internal';\n\nexport { FileInputProps };\n\nconst FileInput = React.forwardRef(\n ({ multiple, variant, ...props }: FileInputProps, ref: React.Ref<FileInputProps.Ref>) => {\n const baseComponentProps = useBaseComponent('FileInput', {\n props: {\n multiple,\n variant,\n },\n });\n return <InternalFileInput multiple={multiple} variant={variant} {...props} {...baseComponentProps} ref={ref} />;\n }\n);\n\napplyDisplayName(FileInput, 'FileInput');\nexport default FileInput;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseComponentProps } from '
|
|
2
|
-
import { FormFieldCommonValidationControlProps } from '
|
|
3
|
-
import { NonCancelableEventHandler } from '
|
|
1
|
+
import { BaseComponentProps } from '../internal/base-component';
|
|
2
|
+
import { FormFieldCommonValidationControlProps } from '../internal/context/form-field-context';
|
|
3
|
+
import { NonCancelableEventHandler } from '../internal/events';
|
|
4
4
|
export interface FileInputProps extends BaseComponentProps, FormFieldCommonValidationControlProps {
|
|
5
5
|
/**
|
|
6
6
|
* Variant of the file input. Defaults to "button".
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/file-input/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qCAAqC,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,qCAAqC;IAC/F;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,EAAE,yBAAyB,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAEjE;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED,yBAAiB,cAAc,CAAC;IAC9B,UAAiB,YAAY;QAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;KACf;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/file-input/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 { FormFieldCommonValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface FileInputProps extends BaseComponentProps, FormFieldCommonValidationControlProps {\n /**\n * Variant of the file input. Defaults to \"button\".\n */\n variant?: 'button' | 'icon';\n\n /**\n * Adds `aria-label` to the file input element. Use this to provide an accessible name for file inputs\n * that don't have visible text, and to distinguish between multiple file inputs with identical visible text.\n */\n ariaLabel?: string;\n\n /**\n * Text displayed in the file input component. Used as the aria label if ariaLabel is not defined.\n * @displayname text\n */\n children?: string;\n\n /**\n * Specifies the native file input `accept` attribute to describe the allow-list of file types.\n */\n accept?: string;\n\n /**\n * Specifies whether to add aria-required to the file upload control.\n */\n ariaRequired?: boolean;\n\n /**\n * Specifies the native file input `multiple` attribute to allow users entering more than one file.\n */\n multiple?: boolean;\n\n /**\n * Called when the user selects new file(s), or removes a file.\n * The event `detail` contains the current value of the component.\n */\n onChange: NonCancelableEventHandler<FileInputProps.ChangeDetail>;\n\n /**\n * Specifies the currently selected file(s).\n * If you want to clear the selection, use empty array.\n */\n value: ReadonlyArray<File>;\n}\n\nexport namespace FileInputProps {\n export interface ChangeDetail {\n value: File[];\n }\n\n export interface Ref {\n /**\n * Sets focus on the file upload button.\n */\n focus(): void;\n }\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';
|
|
3
|
+
import { FileInputProps } from './interfaces';
|
|
4
|
+
declare const InternalFileInput: React.ForwardRefExoticComponent<FileInputProps & InternalBaseComponentProps<any> & React.RefAttributes<FileInputProps.Ref>>;
|
|
5
|
+
export default InternalFileInput;
|
|
6
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/file-input/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwD,MAAM,OAAO,CAAC;AAY7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAG3F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,QAAA,MAAM,iBAAiB,6HAuGtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -4,18 +4,20 @@ import { __rest } from "tslib";
|
|
|
4
4
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
7
|
-
import InternalButton from '
|
|
8
|
-
import { useFormFieldContext } from '
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
7
|
+
import InternalButton from '../button/internal';
|
|
8
|
+
import { useFormFieldContext } from '../contexts/form-field';
|
|
9
|
+
import { getBaseProps } from '../internal/base-component/index.js';
|
|
10
|
+
import ScreenreaderOnly from '../internal/components/screenreader-only';
|
|
11
|
+
import { fireNonCancelableEvent } from '../internal/events';
|
|
12
|
+
import checkControlled from '../internal/hooks/check-controlled';
|
|
13
|
+
import useForwardFocus from '../internal/hooks/forward-focus';
|
|
14
|
+
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
15
|
+
import { joinStrings } from '../internal/utils/strings';
|
|
15
16
|
import styles from './styles.css.js';
|
|
16
17
|
const InternalFileInput = React.forwardRef((_a, ref) => {
|
|
17
18
|
var _b;
|
|
18
|
-
var { accept, ariaRequired, ariaLabel, multiple = false, value, onChange, variant = 'button', children } = _a, restProps = __rest(_a, ["accept", "ariaRequired", "ariaLabel", "multiple", "value", "onChange", "variant", "children"]);
|
|
19
|
+
var { accept, ariaRequired, ariaLabel, multiple = false, value, onChange, variant = 'button', children, __internalRootRef = null } = _a, restProps = __rest(_a, ["accept", "ariaRequired", "ariaLabel", "multiple", "value", "onChange", "variant", "children", "__internalRootRef"]);
|
|
20
|
+
const baseProps = getBaseProps(restProps);
|
|
19
21
|
const uploadInputRef = useRef(null);
|
|
20
22
|
const uploadButtonLabelId = useUniqueId('upload-button-label');
|
|
21
23
|
const formFieldContext = useFormFieldContext(restProps);
|
|
@@ -58,10 +60,10 @@ const InternalFileInput = React.forwardRef((_a, ref) => {
|
|
|
58
60
|
uploadInputRef.current.value = ''; // reset value to allow calling onChange when the same file is uploaded again
|
|
59
61
|
}
|
|
60
62
|
}, [value]);
|
|
61
|
-
return (React.createElement("div", { className: clsx(styles.root) },
|
|
63
|
+
return (React.createElement("div", Object.assign({}, baseProps, { ref: __internalRootRef, className: clsx(baseProps.className, styles.root) }),
|
|
62
64
|
React.createElement("input", Object.assign({ id: controlId, ref: uploadInputRef, type: "file", hidden: false, multiple: multiple, accept: accept, onChange: onUploadInputChange, onFocus: onUploadInputFocus, onBlur: onUploadInputBlur, className: clsx(styles['file-input'], styles.hidden) }, nativeAttributes)),
|
|
63
65
|
React.createElement(InternalButton, { iconName: "upload", variant: variant === 'icon' ? 'icon' : undefined, formAction: "none", onClick: onUploadButtonClick, className: clsx(styles['file-input-button'], isFocused && styles['force-focus-outline']), __nativeAttributes: { tabIndex: -1, 'aria-hidden': true } }, variant === 'button' && children),
|
|
64
66
|
React.createElement(ScreenreaderOnly, { id: uploadButtonLabelId }, ariaLabel || children)));
|
|
65
67
|
});
|
|
66
68
|
export default InternalFileInput;
|
|
67
|
-
//# sourceMappingURL=
|
|
69
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/file-input/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAoB,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,iBAAiB,GAAG,KAAK,CAAC,UAAU,CACxC,CACE,EAW8C,EAC9C,GAA4B,EAC5B,EAAE;;QAbF,EACE,MAAM,EACN,YAAY,EACZ,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,QAAQ,EAClB,QAAQ,EACR,iBAAiB,GAAG,IAAI,OAEoB,EADzC,SAAS,cAVd,oHAWC,CADa;IAId,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,cAAc,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,cAAc,IACb,QAAQ,EAAC,QAAQ,EACjB,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAChD,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,EACxF,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,IAExD,OAAO,KAAK,QAAQ,IAAI,QAAQ,CAClB;QAGjB,oBAAC,gBAAgB,IAAC,EAAE,EAAE,mBAAmB,IAAG,SAAS,IAAI,QAAQ,CAAoB,CACjF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ChangeEvent, Ref, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalButton from '../button/internal';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { getBaseProps } from '../internal/base-component/index.js';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { joinStrings } from '../internal/utils/strings';\nimport { FileInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nconst InternalFileInput = React.forwardRef(\n (\n {\n accept,\n ariaRequired,\n ariaLabel,\n multiple = false,\n value,\n onChange,\n variant = 'button',\n children,\n __internalRootRef = null,\n ...restProps\n }: FileInputProps & InternalBaseComponentProps,\n ref: Ref<FileInputProps.Ref>\n ) => {\n const baseProps = getBaseProps(restProps);\n const uploadInputRef = useRef<HTMLInputElement>(null);\n const uploadButtonLabelId = useUniqueId('upload-button-label');\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('upload-input');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n useForwardFocus(ref, uploadInputRef);\n\n const [isFocused, setIsFocused] = useState(false);\n const onUploadButtonClick = () => uploadInputRef.current?.click();\n const onUploadInputFocus = () => setIsFocused(true);\n const onUploadInputBlur = () => setIsFocused(false);\n\n const onUploadInputChange = ({ target }: ChangeEvent<HTMLInputElement>) => {\n fireNonCancelableEvent(onChange, { value: target.files ? Array.from(target.files) : [] });\n };\n\n checkControlled('FileInput', 'value', value, 'onChange', onChange);\n\n const nativeAttributes: React.HTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel || children,\n 'aria-labelledby': joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId),\n 'aria-describedby': formFieldContext.ariaDescribedby,\n };\n if (formFieldContext.invalid) {\n nativeAttributes['aria-invalid'] = true;\n }\n if (ariaRequired) {\n nativeAttributes['aria-required'] = true;\n }\n\n if (variant === 'icon' && !ariaLabel) {\n warnOnce('FileInput', 'Aria label is required with icon variant.');\n }\n\n // Synchronizing component's value with the native file input state.\n useEffect(() => {\n /* istanbul ignore next: The DataTransfer is not available in jsdom. */\n if (window.DataTransfer) {\n const dataTransfer = new DataTransfer();\n for (const file of value) {\n dataTransfer.items.add(file);\n }\n uploadInputRef.current!.files = dataTransfer.files;\n }\n if (uploadInputRef.current) {\n uploadInputRef.current.value = ''; // reset value to allow calling onChange when the same file is uploaded again\n }\n }, [value]);\n\n return (\n <div {...baseProps} ref={__internalRootRef} className={clsx(baseProps.className, styles.root)}>\n {/* This is the actual interactive and accessible file-upload element. */}\n {/* It is visually hidden to achieve the desired UX design. */}\n <input\n id={controlId}\n ref={uploadInputRef}\n type=\"file\"\n hidden={false}\n multiple={multiple}\n accept={accept}\n onChange={onUploadInputChange}\n onFocus={onUploadInputFocus}\n onBlur={onUploadInputBlur}\n className={clsx(styles['file-input'], styles.hidden)}\n {...nativeAttributes}\n />\n\n {/* The button is decorative. It dispatches clicks to the file input and is ARIA-hidden. */}\n {/* When the input is focused the focus outline is forced on the button. */}\n <InternalButton\n iconName=\"upload\"\n variant={variant === 'icon' ? 'icon' : undefined}\n formAction=\"none\"\n onClick={onUploadButtonClick}\n className={clsx(styles['file-input-button'], isFocused && styles['force-focus-outline'])}\n __nativeAttributes={{ tabIndex: -1, 'aria-hidden': true }}\n >\n {variant === 'button' && children}\n </InternalButton>\n\n {/* The file input needs to be labelled with provided content. Can't use the button because it is ARIA-hidden. */}\n <ScreenreaderOnly id={uploadButtonLabelId}>{ariaLabel || children}</ScreenreaderOnly>\n </div>\n );\n }\n);\n\nexport default InternalFileInput;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"root": "awsui_root_1wp4s_tule3_181",
|
|
5
|
+
"file-input": "awsui_file-input_1wp4s_tule3_182",
|
|
6
|
+
"hidden": "awsui_hidden_1wp4s_tule3_186",
|
|
7
|
+
"file-input-button": "awsui_file-input-button_1wp4s_tule3_192",
|
|
8
|
+
"force-focus-outline": "awsui_force-focus-outline_1wp4s_tule3_192"
|
|
9
|
+
};
|
|
10
|
+
|
|
@@ -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_tule3_181:not(#\9),
|
|
182
|
+
.awsui_file-input_1wp4s_tule3_182:not(#\9) {
|
|
183
183
|
/* used in test-utils */
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
.
|
|
186
|
+
.awsui_hidden_1wp4s_tule3_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_tule3_192.awsui_force-focus-outline_1wp4s_tule3_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_tule3_192.awsui_force-focus-outline_1wp4s_tule3_192:not(#\9) {
|
|
196
196
|
outline: 2px dotted transparent;
|
|
197
197
|
outline-offset: calc(var(--space-button-focus-outline-gutter-cqfd0c, 4px) - 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_tule3_192.awsui_force-focus-outline_1wp4s_tule3_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_tule3_181",
|
|
6
|
+
"file-input": "awsui_file-input_1wp4s_tule3_182",
|
|
7
|
+
"hidden": "awsui_hidden_1wp4s_tule3_186",
|
|
8
|
+
"file-input-button": "awsui_file-input-button_1wp4s_tule3_192",
|
|
9
|
+
"force-focus-outline": "awsui_force-focus-outline_1wp4s_tule3_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/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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;AAEt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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;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,SAAS,EAAE,yBAAyB,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAExE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC;IAE1C;;;;;;;;OAQG;IACH,KAAK,EAAE,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC/C;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,WAAW,EAAE,mBAAmB,CAAC,WAAW,CAAC;CAC9C;AAED,yBAAiB,mBAAmB,CAAC;IACnC,UAAiB,aAAa;QAC5B,SAAS,EAAE,MAAM,CAAC;KACnB;IAED,UAAiB,WAAW;QAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QAEvB,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;IAED,KAAY,SAAS,GAAG,YAAY,GAAG,UAAU,CAAC;IAElD,UAAiB,IAAI;QACnB,IAAI,EAAE,IAAI,CAAC;QACX,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAC1B,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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,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;QACpG,oBAAC,SAAS,IACR,SAAS,EAAE,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EACrE,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAC/B,oBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,oBAAoB,EAAE,oBAAoB,EAC1C,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,GAAG,EAAE;oBACd,sBAAsB,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;oBACjD,iBAAiB,CAAC,SAAS,CAAC,CAAC;gBAC/B,CAAC,EACD,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,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_9obu5_205",
|
|
5
|
+
"file-loading-overlay": "awsui_file-loading-overlay_39ths_9obu5_240",
|
|
6
|
+
"file-loading-overlay-single-row": "awsui_file-loading-overlay-single-row_39ths_9obu5_245",
|
|
7
|
+
"file-option-name": "awsui_file-option-name_39ths_9obu5_249",
|
|
8
|
+
"file-option-size": "awsui_file-option-size_39ths_9obu5_250",
|
|
9
|
+
"file-option-last-modified": "awsui_file-option-last-modified_39ths_9obu5_251",
|
|
10
|
+
"file-option": "awsui_file-option_39ths_9obu5_249",
|
|
11
|
+
"file-option-thumbnail": "awsui_file-option-thumbnail_39ths_9obu5_264",
|
|
12
|
+
"file-option-thumbnail-image": "awsui_file-option-thumbnail-image_39ths_9obu5_268",
|
|
13
|
+
"file-option-metadata": "awsui_file-option-metadata_39ths_9obu5_281",
|
|
14
|
+
"with-image": "awsui_with-image_39ths_9obu5_284",
|
|
15
|
+
"single-row-loading": "awsui_single-row-loading_39ths_9obu5_287",
|
|
16
|
+
"token": "awsui_token_39ths_9obu5_291",
|
|
17
|
+
"token-grid": "awsui_token-grid_39ths_9obu5_298",
|
|
18
|
+
"token-contains-image": "awsui_token-contains-image_39ths_9obu5_307",
|
|
19
|
+
"token-box": "awsui_token-box_39ths_9obu5_311",
|
|
20
|
+
"horizontal": "awsui_horizontal_39ths_9obu5_330",
|
|
21
|
+
"error": "awsui_error_39ths_9obu5_338",
|
|
22
|
+
"dismiss-button": "awsui_dismiss-button_39ths_9obu5_342",
|
|
23
|
+
"warning": "awsui_warning_39ths_9obu5_348",
|
|
24
|
+
"read-only": "awsui_read-only_39ths_9obu5_358",
|
|
25
|
+
"loading": "awsui_loading_39ths_9obu5_371"
|
|
26
|
+
};
|
|
27
|
+
|