@cloudscape-design/components 3.0.249 → 3.0.250

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/app-layout/visual-refresh/app-bar.js +1 -1
  2. package/app-layout/visual-refresh/app-bar.js.map +1 -1
  3. package/autosuggest/internal.d.ts.map +1 -1
  4. package/autosuggest/internal.js +1 -2
  5. package/autosuggest/internal.js.map +1 -1
  6. package/autosuggest/options-list.d.ts +1 -2
  7. package/autosuggest/options-list.d.ts.map +1 -1
  8. package/autosuggest/options-list.js +2 -8
  9. package/autosuggest/options-list.js.map +1 -1
  10. package/button/internal.d.ts +1 -1
  11. package/button/internal.d.ts.map +1 -1
  12. package/button/internal.js +2 -3
  13. package/button/internal.js.map +1 -1
  14. package/button/styles.css.js +19 -20
  15. package/button/styles.scoped.css +136 -298
  16. package/button/styles.selectors.js +19 -20
  17. package/form-field/internal.d.ts +1 -6
  18. package/form-field/internal.d.ts.map +1 -1
  19. package/form-field/internal.js +3 -6
  20. package/form-field/internal.js.map +1 -1
  21. package/index.d.ts +0 -1
  22. package/index.d.ts.map +1 -1
  23. package/index.js +0 -1
  24. package/index.js.map +1 -1
  25. package/internal/base-component/styles.scoped.css +0 -17
  26. package/internal/components/dropdown-footer/index.d.ts +0 -1
  27. package/internal/components/dropdown-footer/index.d.ts.map +1 -1
  28. package/internal/components/dropdown-footer/index.js +2 -2
  29. package/internal/components/dropdown-footer/index.js.map +1 -1
  30. package/internal/components/live-region/index.d.ts +1 -2
  31. package/internal/components/live-region/index.d.ts.map +1 -1
  32. package/internal/components/live-region/index.js +2 -2
  33. package/internal/components/live-region/index.js.map +1 -1
  34. package/internal/components/options-list/index.d.ts +0 -1
  35. package/internal/components/options-list/index.d.ts.map +1 -1
  36. package/internal/components/options-list/index.js +2 -2
  37. package/internal/components/options-list/index.js.map +1 -1
  38. package/internal/environment.js +1 -1
  39. package/internal/generated/theming/index.cjs +0 -95
  40. package/internal/generated/theming/index.js +0 -95
  41. package/internal/manifest.json +1 -1
  42. package/multiselect/internal.d.ts.map +1 -1
  43. package/multiselect/internal.js +3 -4
  44. package/multiselect/internal.js.map +1 -1
  45. package/package.json +1 -2
  46. package/property-filter/index.d.ts.map +1 -1
  47. package/property-filter/index.js +1 -1
  48. package/property-filter/index.js.map +1 -1
  49. package/property-filter/interfaces.d.ts +1 -2
  50. package/property-filter/interfaces.d.ts.map +1 -1
  51. package/property-filter/interfaces.js.map +1 -1
  52. package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  53. package/property-filter/property-filter-autosuggest.js +2 -4
  54. package/property-filter/property-filter-autosuggest.js.map +1 -1
  55. package/select/internal.d.ts.map +1 -1
  56. package/select/internal.js +3 -4
  57. package/select/internal.js.map +1 -1
  58. package/split-panel/interfaces.d.ts +8 -8
  59. package/split-panel/interfaces.d.ts.map +1 -1
  60. package/split-panel/interfaces.js.map +1 -1
  61. package/split-panel/preferences-modal.d.ts +7 -7
  62. package/split-panel/preferences-modal.d.ts.map +1 -1
  63. package/split-panel/preferences-modal.js.map +1 -1
  64. package/table/body-cell/index.js +1 -1
  65. package/table/body-cell/index.js.map +1 -1
  66. package/test-utils/dom/index.d.ts +0 -3
  67. package/test-utils/dom/index.js +2 -10
  68. package/test-utils/dom/index.js.map +1 -1
  69. package/test-utils/selectors/index.d.ts +0 -3
  70. package/test-utils/selectors/index.js +2 -10
  71. package/test-utils/selectors/index.js.map +1 -1
  72. package/test-utils/tsconfig.tsbuildinfo +1 -1
  73. package/token-group/styles.css.js +5 -7
  74. package/token-group/styles.scoped.css +23 -41
  75. package/token-group/styles.selectors.js +5 -7
  76. package/token-group/token.d.ts +1 -4
  77. package/token-group/token.d.ts.map +1 -1
  78. package/token-group/token.js +4 -13
  79. package/token-group/token.js.map +1 -1
  80. package/file-upload/default-formatters.d.ts +0 -3
  81. package/file-upload/default-formatters.d.ts.map +0 -1
  82. package/file-upload/default-formatters.js +0 -23
  83. package/file-upload/default-formatters.js.map +0 -1
  84. package/file-upload/dropzone/index.d.ts +0 -9
  85. package/file-upload/dropzone/index.d.ts.map +0 -1
  86. package/file-upload/dropzone/index.js +0 -69
  87. package/file-upload/dropzone/index.js.map +0 -1
  88. package/file-upload/dropzone/styles.css.js +0 -7
  89. package/file-upload/dropzone/styles.scoped.css +0 -108
  90. package/file-upload/dropzone/styles.selectors.js +0 -8
  91. package/file-upload/file-input/index.d.ts +0 -14
  92. package/file-upload/file-input/index.d.ts.map +0 -1
  93. package/file-upload/file-input/index.js +0 -55
  94. package/file-upload/file-input/index.js.map +0 -1
  95. package/file-upload/file-input/styles.css.js +0 -8
  96. package/file-upload/file-input/styles.scoped.css +0 -21
  97. package/file-upload/file-input/styles.selectors.js +0 -9
  98. package/file-upload/file-option/index.d.ts +0 -10
  99. package/file-upload/file-option/index.d.ts.map +0 -1
  100. package/file-upload/file-option/index.js +0 -22
  101. package/file-upload/file-option/index.js.map +0 -1
  102. package/file-upload/file-option/styles.css.js +0 -12
  103. package/file-upload/file-option/styles.scoped.css +0 -35
  104. package/file-upload/file-option/styles.selectors.js +0 -13
  105. package/file-upload/file-option/thumbnail.d.ts +0 -7
  106. package/file-upload/file-option/thumbnail.d.ts.map +0 -1
  107. package/file-upload/file-option/thumbnail.js +0 -20
  108. package/file-upload/file-option/thumbnail.js.map +0 -1
  109. package/file-upload/index.d.ts +0 -6
  110. package/file-upload/index.d.ts.map +0 -1
  111. package/file-upload/index.js +0 -17
  112. package/file-upload/index.js.map +0 -1
  113. package/file-upload/interfaces.d.ts +0 -99
  114. package/file-upload/interfaces.d.ts.map +0 -1
  115. package/file-upload/interfaces.js +0 -4
  116. package/file-upload/interfaces.js.map +0 -1
  117. package/file-upload/internal.d.ts +0 -7
  118. package/file-upload/internal.d.ts.map +0 -1
  119. package/file-upload/internal.js +0 -72
  120. package/file-upload/internal.js.map +0 -1
  121. package/file-upload/styles.css.js +0 -7
  122. package/file-upload/styles.scoped.css +0 -16
  123. package/file-upload/styles.selectors.js +0 -8
  124. package/test-utils/dom/file-upload/index.d.ts +0 -29
  125. package/test-utils/dom/file-upload/index.js +0 -66
  126. package/test-utils/dom/file-upload/index.js.map +0 -1
  127. package/test-utils/selectors/file-upload/index.d.ts +0 -29
  128. package/test-utils/selectors/file-upload/index.js +0 -66
  129. package/test-utils/selectors/file-upload/index.js.map +0 -1
@@ -94,7 +94,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
94
94
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
95
95
  SPDX-License-Identifier: Apache-2.0
96
96
  */
97
- .awsui_root_dm8gx_o4sq7_97:not(#\9) {
97
+ .awsui_root_dm8gx_on6jb_97:not(#\9) {
98
98
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
99
99
  border-collapse: separate;
100
100
  border-spacing: 0;
@@ -132,25 +132,37 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
132
132
  -webkit-font-smoothing: auto;
133
133
  -moz-osx-font-smoothing: auto;
134
134
  }
135
- .awsui_root_dm8gx_o4sq7_97.awsui_has-items_dm8gx_o4sq7_109:not(#\9) {
135
+ .awsui_root_dm8gx_on6jb_97.awsui_has-items_dm8gx_on6jb_109:not(#\9) {
136
136
  padding-top: var(--space-xs-rsr2qu, 8px);
137
137
  }
138
138
 
139
- .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9) {
139
+ .awsui_token_dm8gx_on6jb_113:not(#\9) {
140
+ height: 100%;
141
+ border: var(--border-field-width-idlekx, 2px) solid var(--color-border-item-selected-ppkssz, #0972d3);
142
+ padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-xxs-ynfts5, 4px) var(--space-scaled-xxs-95dhkm, 4px) var(--space-field-horizontal-89h2yr, 12px);
143
+ display: flex;
144
+ align-items: flex-start;
145
+ background: var(--color-background-item-selected-ebt4bi, #f2f8fd);
146
+ border-radius: var(--border-radius-token-wohc9e, 8px);
147
+ color: var(--color-text-body-default-ajf1h5, #000716);
148
+ box-sizing: border-box;
149
+ }
150
+
151
+ .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9) {
140
152
  margin: -1px -1px 0 var(--space-xxs-ynfts5, 4px);
141
153
  border: 1px solid transparent;
142
154
  padding: 0 var(--space-xxs-ynfts5, 4px);
143
155
  color: var(--color-text-button-inline-icon-default-w65lqn, #0972d3);
144
156
  background-color: transparent;
145
157
  }
146
- body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):focus {
158
+ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9):focus {
147
159
  position: relative;
148
160
  }
149
- body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):focus {
161
+ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9):focus {
150
162
  outline: 2px dotted transparent;
151
163
  outline-offset: calc(0px - 1px);
152
164
  }
153
- body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):focus::before {
165
+ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9):focus::before {
154
166
  content: " ";
155
167
  display: block;
156
168
  position: absolute;
@@ -161,55 +173,25 @@ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\
161
173
  border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
162
174
  box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
163
175
  }
164
- .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):focus {
176
+ .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9):focus {
165
177
  outline: none;
166
178
  text-decoration: none;
167
179
  }
168
- .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):hover {
180
+ .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9):hover {
169
181
  cursor: pointer;
170
182
  color: var(--color-text-button-inline-icon-hover-wd5icp, #033160);
171
183
  }
172
184
 
173
- .awsui_token_dm8gx_o4sq7_147:not(#\9) {
174
- height: 100%;
175
- display: flex;
176
- flex-direction: column;
177
- gap: var(--space-xxs-ynfts5, 4px);
178
- }
179
-
180
- .awsui_token-box_dm8gx_o4sq7_154:not(#\9) {
181
- height: 100%;
182
- border: var(--border-field-width-idlekx, 2px) solid var(--color-border-item-selected-ppkssz, #0972d3);
183
- padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-xxs-ynfts5, 4px) var(--space-scaled-xxs-95dhkm, 4px) var(--space-field-horizontal-89h2yr, 12px);
184
- display: flex;
185
- align-items: flex-start;
186
- background: var(--color-background-item-selected-ebt4bi, #f2f8fd);
187
- border-radius: var(--border-radius-token-wohc9e, 8px);
188
- color: var(--color-text-body-default-ajf1h5, #000716);
189
- box-sizing: border-box;
190
- }
191
-
192
- .awsui_token-box-error_dm8gx_o4sq7_166:not(#\9) {
193
- border-color: var(--color-border-status-error-mfrddc, #d91515);
194
- border-left-width: var(--border-invalid-width-5jpdqn, 8px);
195
- }
196
- .awsui_token-box-error_dm8gx_o4sq7_166 > .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9) {
197
- color: var(--color-text-interactive-default-eg5fsa, #414d5c);
198
- }
199
- .awsui_token-box-error_dm8gx_o4sq7_166 > .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):hover {
200
- color: var(--color-text-interactive-hover-v3lasm, #000716);
201
- }
202
-
203
- .awsui_token-box-disabled_dm8gx_o4sq7_177.awsui_token-box-disabled_dm8gx_o4sq7_177:not(#\9) {
185
+ .awsui_token-disabled_dm8gx_on6jb_159:not(#\9) {
204
186
  border-color: var(--color-border-control-disabled-vx8bco, #d1d5db);
205
187
  background-color: var(--color-background-container-content-i8i4a0, #ffffff);
206
188
  color: var(--color-text-disabled-a2nkh4, #9ba7b6);
207
189
  pointer-events: none;
208
190
  }
209
- .awsui_token-box-disabled_dm8gx_o4sq7_177.awsui_token-box-disabled_dm8gx_o4sq7_177 > .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9) {
191
+ .awsui_token-disabled_dm8gx_on6jb_159 > .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9) {
210
192
  color: var(--color-text-button-inline-icon-disabled-gfhvz7, #9ba7b6);
211
193
  }
212
- .awsui_token-box-disabled_dm8gx_o4sq7_177.awsui_token-box-disabled_dm8gx_o4sq7_177 > .awsui_dismiss-button_dm8gx_o4sq7_113:not(#\9):hover {
194
+ .awsui_token-disabled_dm8gx_on6jb_159 > .awsui_dismiss-button_dm8gx_on6jb_125:not(#\9):hover {
213
195
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
214
196
  cursor: auto;
215
197
  color: var(--color-text-button-inline-icon-disabled-gfhvz7, #9ba7b6);
@@ -2,12 +2,10 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_dm8gx_o4sq7_97",
6
- "has-items": "awsui_has-items_dm8gx_o4sq7_109",
7
- "dismiss-button": "awsui_dismiss-button_dm8gx_o4sq7_113",
8
- "token": "awsui_token_dm8gx_o4sq7_147",
9
- "token-box": "awsui_token-box_dm8gx_o4sq7_154",
10
- "token-box-error": "awsui_token-box-error_dm8gx_o4sq7_166",
11
- "token-box-disabled": "awsui_token-box-disabled_dm8gx_o4sq7_177"
5
+ "root": "awsui_root_dm8gx_on6jb_97",
6
+ "has-items": "awsui_has-items_dm8gx_on6jb_109",
7
+ "token": "awsui_token_dm8gx_on6jb_113",
8
+ "dismiss-button": "awsui_dismiss-button_dm8gx_on6jb_125",
9
+ "token-disabled": "awsui_token-disabled_dm8gx_on6jb_159"
12
10
  };
13
11
 
@@ -5,10 +5,7 @@ interface TokenProps {
5
5
  dismissLabel?: string;
6
6
  onDismiss?: () => void;
7
7
  disabled?: boolean;
8
- errorText?: React.ReactNode;
9
- errorIconAriaLabel?: string;
10
- className?: string;
11
8
  }
12
- export declare function Token({ ariaLabel, disabled, dismissLabel, onDismiss, children, errorText, errorIconAriaLabel, ...restProps }: TokenProps): JSX.Element;
9
+ export declare function Token({ ariaLabel, disabled, dismissLabel, onDismiss, children }: TokenProps): JSX.Element;
13
10
  export {};
14
11
  //# sourceMappingURL=token.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"lib/default/","sources":["token-group/token.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,GAAG,SAAS,EACb,EAAE,UAAU,eA6BZ"}
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"lib/default/","sources":["token-group/token.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,UAAU,eAY3F"}
@@ -1,21 +1,12 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import { __rest } from "tslib";
4
3
  import React from 'react';
5
4
  import clsx from 'clsx';
6
5
  import DismissButton from './dismiss-button';
7
6
  import styles from './styles.css.js';
8
- import { FormFieldError } from '../form-field/internal';
9
- import { useUniqueId } from '../internal/hooks/use-unique-id';
10
- import { getBaseProps } from '../internal/base-component';
11
- export function Token(_a) {
12
- var { ariaLabel, disabled, dismissLabel, onDismiss, children, errorText, errorIconAriaLabel } = _a, restProps = __rest(_a, ["ariaLabel", "disabled", "dismissLabel", "onDismiss", "children", "errorText", "errorIconAriaLabel"]);
13
- const errorId = useUniqueId('error');
14
- const baseProps = getBaseProps(restProps);
15
- return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.token, baseProps.className), role: "group", "aria-label": ariaLabel, "aria-describedby": errorText ? errorId : undefined, "aria-disabled": disabled }),
16
- React.createElement("div", { className: clsx(styles['token-box'], disabled && styles['token-box-disabled'], errorText && styles['token-box-error']) },
17
- children,
18
- onDismiss && React.createElement(DismissButton, { disabled: disabled, dismissLabel: dismissLabel, onDismiss: onDismiss })),
19
- errorText && (React.createElement(FormFieldError, { id: errorId, errorIconAriaLabel: errorIconAriaLabel }, errorText))));
7
+ export function Token({ ariaLabel, disabled, dismissLabel, onDismiss, children }) {
8
+ return (React.createElement("div", { className: clsx(styles.token, disabled && styles['token-disabled']), role: "group", "aria-label": ariaLabel, "aria-disabled": disabled },
9
+ children,
10
+ onDismiss && React.createElement(DismissButton, { disabled: disabled, dismissLabel: dismissLabel, onDismiss: onDismiss })));
20
11
  }
21
12
  //# sourceMappingURL=token.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token.js","sourceRoot":"lib/default/","sources":["token-group/token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,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liates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport DismissButton from './dismiss-button';\nimport styles from './styles.css.js';\nimport { FormFieldError } from '../form-field/internal';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { getBaseProps } from '../internal/base-component';\n\ninterface TokenProps {\n children: React.ReactNode;\n ariaLabel?: string;\n dismissLabel?: string;\n onDismiss?: () => void;\n disabled?: boolean;\n errorText?: React.ReactNode;\n errorIconAriaLabel?: string;\n className?: string;\n}\n\nexport function Token({\n ariaLabel,\n disabled,\n dismissLabel,\n onDismiss,\n children,\n errorText,\n errorIconAriaLabel,\n ...restProps\n}: TokenProps) {\n const errorId = useUniqueId('error');\n const baseProps = getBaseProps(restProps);\n return (\n <div\n {...baseProps}\n className={clsx(styles.token, baseProps.className)}\n role=\"group\"\n aria-label={ariaLabel}\n aria-describedby={errorText ? errorId : undefined}\n aria-disabled={disabled}\n >\n <div\n className={clsx(\n styles['token-box'],\n disabled && styles['token-box-disabled'],\n errorText && styles['token-box-error']\n )}\n >\n {children}\n {onDismiss && <DismissButton disabled={disabled} dismissLabel={dismissLabel} onDismiss={onDismiss} />}\n </div>\n {errorText && (\n <FormFieldError id={errorId} errorIconAriaLabel={errorIconAriaLabel}>\n {errorText}\n </FormFieldError>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"token.js","sourceRoot":"lib/default/","sources":["token-group/token.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAUrC,MAAM,UAAU,KAAK,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAc;IAC1F,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC,EACnE,IAAI,EAAC,OAAO,gBACA,SAAS,mBACN,QAAQ;QAEtB,QAAQ;QACR,SAAS,IAAI,oBAAC,aAAa,IAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,GAAI,CACjG,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 from 'react';\nimport clsx from 'clsx';\n\nimport DismissButton from './dismiss-button';\nimport styles from './styles.css.js';\n\ninterface TokenProps {\n children: React.ReactNode;\n ariaLabel?: string;\n dismissLabel?: string;\n onDismiss?: () => void;\n disabled?: boolean;\n}\n\nexport function Token({ ariaLabel, disabled, dismissLabel, onDismiss, children }: TokenProps) {\n return (\n <div\n className={clsx(styles.token, disabled && styles['token-disabled'])}\n role=\"group\"\n aria-label={ariaLabel}\n aria-disabled={disabled}\n >\n {children}\n {onDismiss && <DismissButton disabled={disabled} dismissLabel={dismissLabel} onDismiss={onDismiss} />}\n </div>\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- export declare function formatFileSize(size: number): string;
2
- export declare function formatFileLastModified(date: Date): string;
3
- //# sourceMappingURL=default-formatters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-formatters.d.ts","sourceRoot":"lib/default/","sources":["file-upload/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,23 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { formatDateTime } from '../internal/utils/date-time';
4
- const KB = 1000;
5
- const MB = Math.pow(1000, 2);
6
- const GB = Math.pow(1000, 3);
7
- const TB = Math.pow(1000, 4);
8
- export function formatFileSize(size) {
9
- if (size < MB) {
10
- return `${(size / KB).toFixed(2)} KB`;
11
- }
12
- if (size < GB) {
13
- return `${(size / MB).toFixed(2)} MB`;
14
- }
15
- if (size < TB) {
16
- return `${(size / GB).toFixed(2)} GB`;
17
- }
18
- return `${(size / TB).toFixed(2)} TB`;
19
- }
20
- export function formatFileLastModified(date) {
21
- return formatDateTime(date);
22
- }
23
- //# sourceMappingURL=default-formatters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"default-formatters.js","sourceRoot":"lib/default/","sources":["file-upload/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,9 +0,0 @@
1
- import React from 'react';
2
- interface DropzoneProps {
3
- onChange: (files: File[]) => void;
4
- children: React.ReactNode;
5
- }
6
- export declare function useDropzoneVisible(): boolean;
7
- export declare function Dropzone({ onChange, children }: DropzoneProps): JSX.Element;
8
- export {};
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["file-upload/dropzone/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,UAAU,aAAa;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,kBAAkB,YA6CjC;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,aAAa,eAuC7D"}
@@ -1,69 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import React, { useEffect, useState } from 'react';
4
- import styles from './styles.css.js';
5
- import clsx from 'clsx';
6
- import InternalIcon from '../../icon/internal';
7
- export function useDropzoneVisible() {
8
- const [isDropzoneVisible, setDropzoneVisible] = useState(false);
9
- // Registering global drag events listeners.
10
- useEffect(() => {
11
- // The timer helps avoiding dropzone blinking.
12
- let dragTimer = null;
13
- // The file-upload dropzone is shown when the user drags files over to the browser.
14
- const onDocumentDragOver = (event) => {
15
- var _a, _b;
16
- event.preventDefault();
17
- if (((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.types) === null || _b === void 0 ? void 0 : _b.indexOf('Files')) !== -1) {
18
- setDropzoneVisible(true);
19
- dragTimer && clearTimeout(dragTimer);
20
- }
21
- };
22
- // When the files are no longer dragged over the browser the state must be reset.
23
- const onDocumentDragLeave = (event) => {
24
- event.preventDefault();
25
- dragTimer = setTimeout(() => setDropzoneVisible(false), 25);
26
- };
27
- // If the files were dropped the state must be reset.
28
- const onDocumentDrop = (event) => {
29
- event.preventDefault();
30
- dragTimer = setTimeout(() => setDropzoneVisible(false), 25);
31
- };
32
- document.addEventListener('dragover', onDocumentDragOver, false);
33
- document.addEventListener('dragleave', onDocumentDragLeave, false);
34
- document.addEventListener('drop', onDocumentDrop, false);
35
- return () => {
36
- dragTimer && clearTimeout(dragTimer);
37
- document.removeEventListener('dragover', onDocumentDragOver);
38
- document.removeEventListener('dragleave', onDocumentDragLeave);
39
- document.removeEventListener('drop', onDocumentDrop);
40
- };
41
- }, []);
42
- return isDropzoneVisible;
43
- }
44
- export function Dropzone({ onChange, children }) {
45
- const [isDropzoneHovered, setDropzoneHovered] = useState(false);
46
- const onDragOver = (event) => {
47
- event.preventDefault();
48
- setDropzoneHovered(true);
49
- if (event.dataTransfer) {
50
- event.dataTransfer.dropEffect = 'copy';
51
- }
52
- };
53
- const onDragLeave = (event) => {
54
- event.preventDefault();
55
- setDropzoneHovered(false);
56
- if (event.dataTransfer) {
57
- event.dataTransfer.dropEffect = 'none';
58
- }
59
- };
60
- const onDrop = (event) => {
61
- event.preventDefault();
62
- setDropzoneHovered(false);
63
- onChange(Array.from(event.dataTransfer.files));
64
- };
65
- return (React.createElement("div", { className: clsx(styles.dropzone, isDropzoneHovered && styles['dropzone-hovered']), onDragOver: onDragOver, onDragLeave: onDragLeave, onDrop: onDrop },
66
- React.createElement(InternalIcon, { name: "upload" }),
67
- React.createElement("span", null, children)));
68
- }
69
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["file-upload/dropzone/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAO/C,MAAM,UAAU,kBAAkB;IAChC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhE,4CAA4C;IAC5C,SAAS,CAAC,GAAG,EAAE;QACb,8CAA8C;QAC9C,IAAI,SAAS,GAAyC,IAAI,CAAC;QAE3D,mFAAmF;QACnF,MAAM,kBAAkB,GAAG,CAAC,KAAgB,EAAE,EAAE;;YAC9C,KAAK,CAAC,cAAc,EAAE,CAAC;YAEvB,IAAI,CAAA,MAAA,MAAA,KAAK,CAAC,YAAY,0CAAE,KAAK,0CAAE,OAAO,CAAC,OAAO,CAAC,MAAK,CAAC,CAAC,EAAE;gBACtD,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACzB,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;aACtC;QACH,CAAC,CAAC;QAEF,iFAAiF;QACjF,MAAM,mBAAmB,GAAG,CAAC,KAAgB,EAAE,EAAE;YAC/C,KAAK,C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C;QAEzB,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,KAAK,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAC;SACxC;IACH,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,KAAsB,EAAE,EAAE;QAC7C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,IAAI,KAAK,CAAC,YAAY,EAAE;YACtB,KAAK,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAC;SACxC;IACH,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,CAAC,KAAsB,EAAE,EAAE;QACxC,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC;IAEF,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,iBAAiB,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC,EACjF,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM;QAEd,oBAAC,YAAY,IAAC,IAAI,EAAC,QAAQ,GAAG;QAC9B,kCAAO,QAAQ,CAAQ,CACnB,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';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport InternalIcon from '../../icon/internal';\n\ninterface DropzoneProps {\n onChange: (files: File[]) => void;\n children: React.ReactNode;\n}\n\nexport function useDropzoneVisible() {\n const [isDropzoneVisible, setDropzoneVisible] = useState(false);\n\n // Registering global drag events listeners.\n useEffect(() => {\n // The timer helps avoiding dropzone blinking.\n let dragTimer: null | ReturnType<typeof setTimeout> = null;\n\n // The file-upload dropzone is shown when the user drags files over to the browser.\n const onDocumentDragOver = (event: DragEvent) => {\n event.preventDefault();\n\n if (event.dataTransfer?.types?.indexOf('Files') !== -1) {\n setDropzoneVisible(true);\n dragTimer && clearTimeout(dragTimer);\n }\n };\n\n // When the files are no longer dragged over the browser the state must be reset.\n const onDocumentDragLeave = (event: DragEvent) => {\n event.preventDefault();\n\n dragTimer = setTimeout(() => setDropzoneVisible(false), 25);\n };\n\n // If the files were dropped the state must be reset.\n const onDocumentDrop = (event: DragEvent) => {\n event.preventDefault();\n\n dragTimer = setTimeout(() => setDropzoneVisible(false), 25);\n };\n\n document.addEventListener('dragover', onDocumentDragOver, false);\n document.addEventListener('dragleave', onDocumentDragLeave, false);\n document.addEventListener('drop', onDocumentDrop, false);\n\n return () => {\n dragTimer && clearTimeout(dragTimer);\n document.removeEventListener('dragover', onDocumentDragOver);\n document.removeEventListener('dragleave', onDocumentDragLeave);\n document.removeEventListener('drop', onDocumentDrop);\n };\n }, []);\n\n return isDropzoneVisible;\n}\n\nexport function Dropzone({ onChange, children }: DropzoneProps) {\n const [isDropzoneHovered, setDropzoneHovered] = useState(false);\n\n const onDragOver = (event: React.DragEvent) => {\n event.preventDefault();\n setDropzoneHovered(true);\n\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'copy';\n }\n };\n\n const onDragLeave = (event: React.DragEvent) => {\n event.preventDefault();\n setDropzoneHovered(false);\n\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'none';\n }\n };\n\n const onDrop = (event: React.DragEvent) => {\n event.preventDefault();\n setDropzoneHovered(false);\n\n onChange(Array.from(event.dataTransfer.files));\n };\n\n return (\n <div\n className={clsx(styles.dropzone, isDropzoneHovered && styles['dropzone-hovered'])}\n onDragOver={onDragOver}\n onDragLeave={onDragLeave}\n onDrop={onDrop}\n >\n <InternalIcon name=\"upload\" />\n <span>{children}</span>\n </div>\n );\n}\n"]}
@@ -1,7 +0,0 @@
1
-
2
- import './styles.scoped.css';
3
- export default {
4
- "dropzone": "awsui_dropzone_1fham_1blgf_93",
5
- "dropzone-hovered": "awsui_dropzone-hovered_1fham_1blgf_105"
6
- };
7
-
@@ -1,108 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
- /*
6
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
- SPDX-License-Identifier: Apache-2.0
8
- */
9
- /*
10
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
11
- SPDX-License-Identifier: Apache-2.0
12
- */
13
- /*
14
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
15
- SPDX-License-Identifier: Apache-2.0
16
- */
17
- /*
18
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
19
- SPDX-License-Identifier: Apache-2.0
20
- */
21
- /*
22
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
23
- SPDX-License-Identifier: Apache-2.0
24
- */
25
- /*
26
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
27
- SPDX-License-Identifier: Apache-2.0
28
- */
29
- /*
30
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
31
- SPDX-License-Identifier: Apache-2.0
32
- */
33
- /*
34
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
35
- SPDX-License-Identifier: Apache-2.0
36
- */
37
- /*
38
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
39
- SPDX-License-Identifier: Apache-2.0
40
- */
41
- /*
42
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
43
- SPDX-License-Identifier: Apache-2.0
44
- */
45
- /*
46
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
47
- SPDX-License-Identifier: Apache-2.0
48
- */
49
- /*
50
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
51
- SPDX-License-Identifier: Apache-2.0
52
- */
53
- /*
54
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
55
- SPDX-License-Identifier: Apache-2.0
56
- */
57
- /*
58
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
59
- SPDX-License-Identifier: Apache-2.0
60
- */
61
- /*
62
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
63
- SPDX-License-Identifier: Apache-2.0
64
- */
65
- /* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
66
- /* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
67
- /*
68
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
69
- SPDX-License-Identifier: Apache-2.0
70
- */
71
- /*
72
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
73
- SPDX-License-Identifier: Apache-2.0
74
- */
75
- /*
76
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
77
- SPDX-License-Identifier: Apache-2.0
78
- */
79
- /*
80
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
81
- SPDX-License-Identifier: Apache-2.0
82
- */
83
- /* Style used for links in slots/components that are text heavy, to help links stand out among
84
- surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
85
- /*
86
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
87
- SPDX-License-Identifier: Apache-2.0
88
- */
89
- /*
90
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
91
- SPDX-License-Identifier: Apache-2.0
92
- */
93
- .awsui_dropzone_1fham_1blgf_93:not(#\9) {
94
- display: flex;
95
- flex-direction: column;
96
- align-items: center;
97
- justify-content: center;
98
- gap: var(--space-static-xxs-jy4jgd, 4px);
99
- padding: var(--space-static-l-t7yjdj, 20px);
100
- border-radius: var(--border-radius-dropzone-poqo08, 12px);
101
- color: var(--color-dropzone-text-active-aobpir, #5f6b7a);
102
- background-color: var(--color-dropzone-background-active-g4zi07, #e9ebed);
103
- font-weight: 700;
104
- }
105
- .awsui_dropzone-hovered_1fham_1blgf_105:not(#\9) {
106
- color: var(--color-dropzone-text-hover-ud2lnq, #033160);
107
- background-color: var(--color-dropzone-background-hover-j98f7z, #d3e7f9);
108
- }
@@ -1,8 +0,0 @@
1
-
2
- // es-module interop with Babel and Typescript
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- module.exports.default = {
5
- "dropzone": "awsui_dropzone_1fham_1blgf_93",
6
- "dropzone-hovered": "awsui_dropzone-hovered_1fham_1blgf_105"
7
- };
8
-
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { FormFieldValidationControlProps } from '../../internal/context/form-field-context';
3
- import { FileUploadProps } from '../interfaces';
4
- interface FileInputProps extends FormFieldValidationControlProps {
5
- accept?: string;
6
- ariaRequired?: boolean;
7
- multiple: boolean;
8
- value: readonly File[];
9
- onChange: (files: File[]) => void;
10
- children: React.ReactNode;
11
- }
12
- declare const _default: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<FileUploadProps.Ref>>;
13
- export default _default;
14
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["file-upload/file-input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAMtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,UAAU,cAAe,SAAQ,+BAA+B;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;;AAED,wBAA2C"}
@@ -1,55 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import { __rest } from "tslib";
4
- import React, { useEffect, useRef, useState } from 'react';
5
- import InternalButton from '../../button/internal';
6
- import styles from './styles.css.js';
7
- import { useFormFieldContext } from '../../contexts/form-field';
8
- import { useUniqueId } from '../../internal/hooks/use-unique-id';
9
- import { joinStrings } from '../../internal/utils/strings';
10
- import ScreenreaderOnly from '../../internal/components/screenreader-only';
11
- import useForwardFocus from '../../internal/hooks/forward-focus';
12
- export default React.forwardRef(FileInput);
13
- function FileInput(_a, ref) {
14
- var _b;
15
- var { accept, ariaRequired, multiple, value, onChange, children } = _a, restProps = __rest(_a, ["accept", "ariaRequired", "multiple", "value", "onChange", "children"]);
16
- const uploadInputRef = useRef(null);
17
- const uploadButtonLabelId = useUniqueId('upload-button-label');
18
- const formFieldContext = useFormFieldContext(restProps);
19
- const selfControlId = useUniqueId('upload-input');
20
- const controlId = (_b = formFieldContext.controlId) !== null && _b !== void 0 ? _b : selfControlId;
21
- useForwardFocus(ref, uploadInputRef);
22
- const [isFocused, setIsFocused] = useState(false);
23
- const onUploadButtonClick = () => { var _a; return (_a = uploadInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); };
24
- const onUploadInputFocus = () => setIsFocused(true);
25
- const onUploadInputBlur = () => setIsFocused(false);
26
- const onUploadInputChange = ({ target }) => {
27
- onChange(target.files ? Array.from(target.files) : []);
28
- };
29
- const nativeAttributes = {
30
- 'aria-labelledby': joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId),
31
- 'aria-describedby': formFieldContext.ariaDescribedby,
32
- };
33
- if (formFieldContext.invalid) {
34
- nativeAttributes['aria-invalid'] = true;
35
- }
36
- if (ariaRequired) {
37
- nativeAttributes['aria-required'] = true;
38
- }
39
- // Synchronizing component's value with the native file input state.
40
- useEffect(() => {
41
- // The DataTransfer is not available in jsdom.
42
- if (window.DataTransfer) {
43
- const dataTransfer = new DataTransfer();
44
- for (const file of value) {
45
- dataTransfer.items.add(file);
46
- }
47
- uploadInputRef.current.files = dataTransfer.files;
48
- }
49
- }, [value]);
50
- return (React.createElement("div", { className: styles['file-input-container'] },
51
- React.createElement("input", Object.assign({ id: controlId, ref: uploadInputRef, type: "file", hidden: false, multiple: multiple, accept: accept, onChange: onUploadInputChange, onFocus: onUploadInputFocus, onBlur: onUploadInputBlur, className: styles['upload-input'] }, nativeAttributes)),
52
- React.createElement(InternalButton, { iconName: "upload", formAction: "none", onClick: onUploadButtonClick, className: styles['upload-button'], __nativeAttributes: { tabIndex: -1, 'aria-hidden': true }, __forcedFocusState: isFocused ? 'focused' : undefined }, children),
53
- React.createElement(ScreenreaderOnly, { id: uploadButtonLabelId }, children)));
54
- }
55
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["file-upload/file-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAE3E,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAWjE,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAE3C,SAAS,SAAS,CAChB,EAA2F,EAC3F,GAAsC;;QADtC,EAAE,MAAM,EAAE,YAA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P,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { ChangeEvent, ForwardedRef, useEffect, useRef, useState } from 'react';\n\nimport InternalButton from '../../button/internal';\nimport styles from './styles.css.js';\nimport { useFormFieldContext } from '../../contexts/form-field';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { FormFieldValidationControlProps } from '../../internal/context/form-field-context';\nimport { joinStrings } from '../../internal/utils/strings';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { FileUploadProps } from '../interfaces';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\n\ninterface FileInputProps extends FormFieldValidationControlProps {\n accept?: string;\n ariaRequired?: boolean;\n multiple: boolean;\n value: readonly File[];\n onChange: (files: File[]) => void;\n children: React.ReactNode;\n}\n\nexport default React.forwardRef(FileInput);\n\nfunction FileInput(\n { accept, ariaRequired, multiple, value, onChange, children, ...restProps }: FileInputProps,\n ref: ForwardedRef<FileUploadProps.Ref>\n) {\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\n const onUploadButtonClick = () => uploadInputRef.current?.click();\n\n const onUploadInputFocus = () => setIsFocused(true);\n\n const onUploadInputBlur = () => setIsFocused(false);\n\n const onUploadInputChange = ({ target }: ChangeEvent<HTMLInputElement>) => {\n onChange(target.files ? Array.from(target.files) : []);\n };\n\n const nativeAttributes: Record<string, any> = {\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 // Synchronizing component's value with the native file input state.\n useEffect(() => {\n // 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 }, [value]);\n\n return (\n <div className={styles['file-input-container']}>\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={styles['upload-input']}\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 formAction=\"none\"\n onClick={onUploadButtonClick}\n className={styles['upload-button']}\n __nativeAttributes={{ tabIndex: -1, 'aria-hidden': true }}\n __forcedFocusState={isFocused ? 'focused' : undefined}\n >\n {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}>{children}</ScreenreaderOnly>\n </div>\n );\n}\n"]}
@@ -1,8 +0,0 @@
1
-
2
- import './styles.scoped.css';
3
- export default {
4
- "upload-button": "awsui_upload-button_4xu1k_1753t_9",
5
- "upload-input": "awsui_upload-input_4xu1k_1753t_10",
6
- "file-input-container": "awsui_file-input-container_4xu1k_1753t_14"
7
- };
8
-
@@ -1,21 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
- /*
6
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
- SPDX-License-Identifier: Apache-2.0
8
- */
9
- .awsui_upload-button_4xu1k_1753t_9:not(#\9),
10
- .awsui_upload-input_4xu1k_1753t_10:not(#\9) {
11
- /* used in test-utils */
12
- }
13
-
14
- .awsui_file-input-container_4xu1k_1753t_14:not(#\9) {
15
- position: relative;
16
- }
17
-
18
- .awsui_upload-input_4xu1k_1753t_10:not(#\9) {
19
- position: absolute;
20
- clip: rect(0, 0, 0, 0);
21
- }
@@ -1,9 +0,0 @@
1
-
2
- // es-module interop with Babel and Typescript
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- module.exports.default = {
5
- "upload-button": "awsui_upload-button_4xu1k_1753t_9",
6
- "upload-input": "awsui_upload-input_4xu1k_1753t_10",
7
- "file-input-container": "awsui_file-input-container_4xu1k_1753t_14"
8
- };
9
-
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { FileMetadata, FileUploadProps } from '../interfaces';
3
- interface FileOptionProps {
4
- file: File;
5
- metadata: FileMetadata;
6
- i18nStrings: FileUploadProps.I18nStrings;
7
- }
8
- export declare function FileOption({ file, metadata, i18nStrings }: FileOptionProps): JSX.Element;
9
- export {};
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["file-upload/file-option/index.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAO9D,UAAU,eAAe;IACvB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,eAAe,CAAC,WAAW,CAAC;CAC1C;AAED,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,eAAe,eA2B1E"}
@@ -1,22 +0,0 @@
1
- // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- // SPDX-License-Identifier: Apache-2.0
3
- import React from 'react';
4
- import InternalBox from '../../box/internal';
5
- import InternalSpaceBetween from '../../space-between/internal';
6
- import styles from './styles.css.js';
7
- import * as defaultFormatters from '../default-formatters';
8
- import { FileOptionThumbnail } from './thumbnail';
9
- export function FileOption({ file, metadata, i18nStrings }) {
10
- var _a, _b;
11
- const isImage = file.type.startsWith('image/');
12
- const formatFileSize = (_a = i18nStrings.formatFileSize) !== null && _a !== void 0 ? _a : defaultFormatters.formatFileSize;
13
- const formatFileLastModified = (_b = i18nStrings.formatFileLastModified) !== null && _b !== void 0 ? _b : defaultFormatters.formatFileLastModified;
14
- return (React.createElement(InternalBox, { className: styles['file-option'] },
15
- metadata.showFileThumbnail && isImage && React.createElement(FileOptionThumbnail, { file: file }),
16
- React.createElement("div", { className: styles['file-option-metadata'] },
17
- React.createElement(InternalSpaceBetween, { direction: "vertical", size: "xxxs" },
18
- React.createElement(InternalBox, { className: styles['file-option-name'] }, file.name),
19
- metadata.showFileSize && file.size ? (React.createElement(InternalBox, { fontSize: "body-s", color: "text-body-secondary", className: styles['file-option-size'] }, formatFileSize(file.size))) : null,
20
- metadata.showFileLastModified && file.lastModified ? (React.createElement(InternalBox, { fontSize: "body-s", color: "text-body-secondary", className: styles['file-option-last-modified'] }, formatFileLastModified(new Date(file.lastModified)))) : null))));
21
- }
22
- //# sourceMappingURL=index.js.map