@cloudscape-design/components-themeable 3.0.255 → 3.0.256

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 (138) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/button/styles.scss +0 -4
  3. package/lib/internal/scss/token-group/styles.scss +14 -30
  4. package/lib/internal/template/app-layout/visual-refresh/app-bar.js +1 -1
  5. package/lib/internal/template/app-layout/visual-refresh/app-bar.js.map +1 -1
  6. package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
  7. package/lib/internal/template/autosuggest/internal.js +1 -2
  8. package/lib/internal/template/autosuggest/internal.js.map +1 -1
  9. package/lib/internal/template/autosuggest/options-list.d.ts +1 -2
  10. package/lib/internal/template/autosuggest/options-list.d.ts.map +1 -1
  11. package/lib/internal/template/autosuggest/options-list.js +2 -8
  12. package/lib/internal/template/autosuggest/options-list.js.map +1 -1
  13. package/lib/internal/template/button/internal.d.ts +1 -1
  14. package/lib/internal/template/button/internal.d.ts.map +1 -1
  15. package/lib/internal/template/button/internal.js +2 -3
  16. package/lib/internal/template/button/internal.js.map +1 -1
  17. package/lib/internal/template/button/styles.css.js +19 -20
  18. package/lib/internal/template/button/styles.scoped.css +136 -298
  19. package/lib/internal/template/button/styles.selectors.js +19 -20
  20. package/lib/internal/template/form-field/internal.d.ts +1 -6
  21. package/lib/internal/template/form-field/internal.d.ts.map +1 -1
  22. package/lib/internal/template/form-field/internal.js +3 -6
  23. package/lib/internal/template/form-field/internal.js.map +1 -1
  24. package/lib/internal/template/index.d.ts +0 -1
  25. package/lib/internal/template/index.d.ts.map +1 -1
  26. package/lib/internal/template/index.js +0 -1
  27. package/lib/internal/template/index.js.map +1 -1
  28. package/lib/internal/template/internal/base-component/styles.scoped.css +0 -37
  29. package/lib/internal/template/internal/components/dropdown-footer/index.d.ts +0 -1
  30. package/lib/internal/template/internal/components/dropdown-footer/index.d.ts.map +1 -1
  31. package/lib/internal/template/internal/components/dropdown-footer/index.js +2 -2
  32. package/lib/internal/template/internal/components/dropdown-footer/index.js.map +1 -1
  33. package/lib/internal/template/internal/components/live-region/index.d.ts +1 -2
  34. package/lib/internal/template/internal/components/live-region/index.d.ts.map +1 -1
  35. package/lib/internal/template/internal/components/live-region/index.js +2 -2
  36. package/lib/internal/template/internal/components/live-region/index.js.map +1 -1
  37. package/lib/internal/template/internal/components/options-list/index.d.ts +0 -1
  38. package/lib/internal/template/internal/components/options-list/index.d.ts.map +1 -1
  39. package/lib/internal/template/internal/components/options-list/index.js +2 -2
  40. package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
  41. package/lib/internal/template/internal/environment.js +1 -1
  42. package/lib/internal/template/internal/generated/theming/index.cjs +0 -95
  43. package/lib/internal/template/internal/generated/theming/index.js +0 -95
  44. package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
  45. package/lib/internal/template/multiselect/internal.js +3 -4
  46. package/lib/internal/template/multiselect/internal.js.map +1 -1
  47. package/lib/internal/template/package.json +0 -1
  48. package/lib/internal/template/property-filter/index.d.ts.map +1 -1
  49. package/lib/internal/template/property-filter/index.js +1 -1
  50. package/lib/internal/template/property-filter/index.js.map +1 -1
  51. package/lib/internal/template/property-filter/interfaces.d.ts +1 -2
  52. package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
  53. package/lib/internal/template/property-filter/interfaces.js.map +1 -1
  54. package/lib/internal/template/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  55. package/lib/internal/template/property-filter/property-filter-autosuggest.js +2 -4
  56. package/lib/internal/template/property-filter/property-filter-autosuggest.js.map +1 -1
  57. package/lib/internal/template/select/internal.d.ts.map +1 -1
  58. package/lib/internal/template/select/internal.js +3 -4
  59. package/lib/internal/template/select/internal.js.map +1 -1
  60. package/lib/internal/template/split-panel/interfaces.d.ts +8 -8
  61. package/lib/internal/template/split-panel/interfaces.d.ts.map +1 -1
  62. package/lib/internal/template/split-panel/interfaces.js.map +1 -1
  63. package/lib/internal/template/split-panel/preferences-modal.d.ts +7 -7
  64. package/lib/internal/template/split-panel/preferences-modal.d.ts.map +1 -1
  65. package/lib/internal/template/split-panel/preferences-modal.js.map +1 -1
  66. package/lib/internal/template/table/body-cell/index.js +1 -1
  67. package/lib/internal/template/table/body-cell/index.js.map +1 -1
  68. package/lib/internal/template/test-utils/dom/index.d.ts +0 -3
  69. package/lib/internal/template/test-utils/dom/index.js +2 -10
  70. package/lib/internal/template/test-utils/dom/index.js.map +1 -1
  71. package/lib/internal/template/test-utils/selectors/index.d.ts +0 -3
  72. package/lib/internal/template/test-utils/selectors/index.js +2 -10
  73. package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
  74. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  75. package/lib/internal/template/token-group/styles.css.js +5 -7
  76. package/lib/internal/template/token-group/styles.scoped.css +23 -41
  77. package/lib/internal/template/token-group/styles.selectors.js +5 -7
  78. package/lib/internal/template/token-group/token.d.ts +1 -4
  79. package/lib/internal/template/token-group/token.d.ts.map +1 -1
  80. package/lib/internal/template/token-group/token.js +4 -13
  81. package/lib/internal/template/token-group/token.js.map +1 -1
  82. package/lib/theming/index.d.ts +1 -2
  83. package/lib/theming/index.js +1 -2
  84. package/package.json +1 -1
  85. package/lib/internal/scss/file-upload/dropzone/styles.scss +0 -24
  86. package/lib/internal/scss/file-upload/file-input/styles.scss +0 -20
  87. package/lib/internal/scss/file-upload/file-option/styles.scss +0 -34
  88. package/lib/internal/scss/file-upload/styles.scss +0 -15
  89. package/lib/internal/template/file-upload/default-formatters.d.ts +0 -3
  90. package/lib/internal/template/file-upload/default-formatters.d.ts.map +0 -1
  91. package/lib/internal/template/file-upload/default-formatters.js +0 -23
  92. package/lib/internal/template/file-upload/default-formatters.js.map +0 -1
  93. package/lib/internal/template/file-upload/dropzone/index.d.ts +0 -9
  94. package/lib/internal/template/file-upload/dropzone/index.d.ts.map +0 -1
  95. package/lib/internal/template/file-upload/dropzone/index.js +0 -69
  96. package/lib/internal/template/file-upload/dropzone/index.js.map +0 -1
  97. package/lib/internal/template/file-upload/dropzone/styles.css.js +0 -7
  98. package/lib/internal/template/file-upload/dropzone/styles.scoped.css +0 -108
  99. package/lib/internal/template/file-upload/dropzone/styles.selectors.js +0 -8
  100. package/lib/internal/template/file-upload/file-input/index.d.ts +0 -14
  101. package/lib/internal/template/file-upload/file-input/index.d.ts.map +0 -1
  102. package/lib/internal/template/file-upload/file-input/index.js +0 -55
  103. package/lib/internal/template/file-upload/file-input/index.js.map +0 -1
  104. package/lib/internal/template/file-upload/file-input/styles.css.js +0 -8
  105. package/lib/internal/template/file-upload/file-input/styles.scoped.css +0 -21
  106. package/lib/internal/template/file-upload/file-input/styles.selectors.js +0 -9
  107. package/lib/internal/template/file-upload/file-option/index.d.ts +0 -10
  108. package/lib/internal/template/file-upload/file-option/index.d.ts.map +0 -1
  109. package/lib/internal/template/file-upload/file-option/index.js +0 -22
  110. package/lib/internal/template/file-upload/file-option/index.js.map +0 -1
  111. package/lib/internal/template/file-upload/file-option/styles.css.js +0 -12
  112. package/lib/internal/template/file-upload/file-option/styles.scoped.css +0 -35
  113. package/lib/internal/template/file-upload/file-option/styles.selectors.js +0 -13
  114. package/lib/internal/template/file-upload/file-option/thumbnail.d.ts +0 -7
  115. package/lib/internal/template/file-upload/file-option/thumbnail.d.ts.map +0 -1
  116. package/lib/internal/template/file-upload/file-option/thumbnail.js +0 -20
  117. package/lib/internal/template/file-upload/file-option/thumbnail.js.map +0 -1
  118. package/lib/internal/template/file-upload/index.d.ts +0 -6
  119. package/lib/internal/template/file-upload/index.d.ts.map +0 -1
  120. package/lib/internal/template/file-upload/index.js +0 -17
  121. package/lib/internal/template/file-upload/index.js.map +0 -1
  122. package/lib/internal/template/file-upload/interfaces.d.ts +0 -99
  123. package/lib/internal/template/file-upload/interfaces.d.ts.map +0 -1
  124. package/lib/internal/template/file-upload/interfaces.js +0 -4
  125. package/lib/internal/template/file-upload/interfaces.js.map +0 -1
  126. package/lib/internal/template/file-upload/internal.d.ts +0 -7
  127. package/lib/internal/template/file-upload/internal.d.ts.map +0 -1
  128. package/lib/internal/template/file-upload/internal.js +0 -72
  129. package/lib/internal/template/file-upload/internal.js.map +0 -1
  130. package/lib/internal/template/file-upload/styles.css.js +0 -7
  131. package/lib/internal/template/file-upload/styles.scoped.css +0 -16
  132. package/lib/internal/template/file-upload/styles.selectors.js +0 -8
  133. package/lib/internal/template/test-utils/dom/file-upload/index.d.ts +0 -29
  134. package/lib/internal/template/test-utils/dom/file-upload/index.js +0 -66
  135. package/lib/internal/template/test-utils/dom/file-upload/index.js.map +0 -1
  136. package/lib/internal/template/test-utils/selectors/file-upload/index.d.ts +0 -29
  137. package/lib/internal/template/test-utils/selectors/file-upload/index.js +0 -66
  138. package/lib/internal/template/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_12gn7_97:not(#\9) {
97
+ .awsui_root_dm8gx_26q91_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_12gn7_97.awsui_has-items_dm8gx_12gn7_109:not(#\9) {
135
+ .awsui_root_dm8gx_26q91_97.awsui_has-items_dm8gx_26q91_109:not(#\9) {
136
136
  padding-top: var(--space-xs-rsr2qu, 8px);
137
137
  }
138
138
 
139
- .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9) {
139
+ .awsui_token_dm8gx_26q91_113:not(#\9) {
140
+ height: 100%;
141
+ border: var(--border-field-width-y6x4sn, 1px) solid var(--color-border-item-selected-pr9yuf, #00a1c9);
142
+ padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-xxs-ynfts5, 4px) var(--space-scaled-xxs-95dhkm, 4px) var(--space-field-horizontal-z3i1c8, 8px);
143
+ display: flex;
144
+ align-items: flex-start;
145
+ background: var(--color-background-item-selected-fva7ca, #f1faff);
146
+ border-radius: var(--border-radius-token-3ax3p2, 2px);
147
+ color: var(--color-text-body-default-7m2b3r, #16191f);
148
+ box-sizing: border-box;
149
+ }
150
+
151
+ .awsui_dismiss-button_dm8gx_26q91_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-qhj7jl, #545b64);
144
156
  background-color: transparent;
145
157
  }
146
- body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9):focus {
158
+ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_26q91_125:not(#\9):focus {
147
159
  position: relative;
148
160
  }
149
- body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9):focus {
161
+ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_26q91_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_12gn7_113:not(#\9):focus::before {
165
+ body[data-awsui-focus-visible=true] .awsui_dismiss-button_dm8gx_26q91_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_12gn7_113:not(#\
161
173
  border-radius: var(--border-radius-control-default-focus-ring-hekmgc, 2px);
162
174
  box-shadow: 0 0 0 2px var(--color-border-item-focused-n5kd8g, #0073bb);
163
175
  }
164
- .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9):focus {
176
+ .awsui_dismiss-button_dm8gx_26q91_125:not(#\9):focus {
165
177
  outline: none;
166
178
  text-decoration: none;
167
179
  }
168
- .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9):hover {
180
+ .awsui_dismiss-button_dm8gx_26q91_125:not(#\9):hover {
169
181
  cursor: pointer;
170
182
  color: var(--color-text-button-inline-icon-hover-84mkuo, #16191f);
171
183
  }
172
184
 
173
- .awsui_token_dm8gx_12gn7_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_12gn7_154:not(#\9) {
181
- height: 100%;
182
- border: var(--border-field-width-y6x4sn, 1px) solid var(--color-border-item-selected-pr9yuf, #00a1c9);
183
- padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-xxs-ynfts5, 4px) var(--space-scaled-xxs-95dhkm, 4px) var(--space-field-horizontal-z3i1c8, 8px);
184
- display: flex;
185
- align-items: flex-start;
186
- background: var(--color-background-item-selected-fva7ca, #f1faff);
187
- border-radius: var(--border-radius-token-3ax3p2, 2px);
188
- color: var(--color-text-body-default-7m2b3r, #16191f);
189
- box-sizing: border-box;
190
- }
191
-
192
- .awsui_token-box-error_dm8gx_12gn7_166:not(#\9) {
193
- border-color: var(--color-border-status-error-fybu9w, #d13212);
194
- border-left-width: var(--border-invalid-width-glmng5, 4px);
195
- }
196
- .awsui_token-box-error_dm8gx_12gn7_166 > .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9) {
197
- color: var(--color-text-interactive-default-9me1cm, #545b64);
198
- }
199
- .awsui_token-box-error_dm8gx_12gn7_166 > .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9):hover {
200
- color: var(--color-text-interactive-hover-79wpl9, #16191f);
201
- }
202
-
203
- .awsui_token-box-disabled_dm8gx_12gn7_177.awsui_token-box-disabled_dm8gx_12gn7_177:not(#\9) {
185
+ .awsui_token-disabled_dm8gx_26q91_159:not(#\9) {
204
186
  border-color: var(--color-border-control-disabled-zgidl5, #d5dbdb);
205
187
  background-color: var(--color-background-container-content-o88wxm, #ffffff);
206
188
  color: var(--color-text-disabled-pjiy51, #aab7b8);
207
189
  pointer-events: none;
208
190
  }
209
- .awsui_token-box-disabled_dm8gx_12gn7_177.awsui_token-box-disabled_dm8gx_12gn7_177 > .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9) {
191
+ .awsui_token-disabled_dm8gx_26q91_159 > .awsui_dismiss-button_dm8gx_26q91_125:not(#\9) {
210
192
  color: var(--color-text-button-inline-icon-disabled-sesloi, #aab7b8);
211
193
  }
212
- .awsui_token-box-disabled_dm8gx_12gn7_177.awsui_token-box-disabled_dm8gx_12gn7_177 > .awsui_dismiss-button_dm8gx_12gn7_113:not(#\9):hover {
194
+ .awsui_token-disabled_dm8gx_26q91_159 > .awsui_dismiss-button_dm8gx_26q91_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-sesloi, #aab7b8);
@@ -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_12gn7_97",
6
- "has-items": "awsui_has-items_dm8gx_12gn7_109",
7
- "dismiss-button": "awsui_dismiss-button_dm8gx_12gn7_113",
8
- "token": "awsui_token_dm8gx_12gn7_147",
9
- "token-box": "awsui_token-box_dm8gx_12gn7_154",
10
- "token-box-error": "awsui_token-box-error_dm8gx_12gn7_166",
11
- "token-box-disabled": "awsui_token-box-disabled_dm8gx_12gn7_177"
5
+ "root": "awsui_root_dm8gx_26q91_97",
6
+ "has-items": "awsui_has-items_dm8gx_26q91_109",
7
+ "token": "awsui_token_dm8gx_26q91_113",
8
+ "dismiss-button": "awsui_dismiss-button_dm8gx_26q91_125",
9
+ "token-disabled": "awsui_token-disabled_dm8gx_26q91_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,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAa1D,MAAM,UAAU,KAAK,CAAC,EAST;QATS,EACpB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,kBAAkB,OAEP,EADR,SAAS,cARQ,qGASrB,CADa;IAEZ,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,OAAO,CACL,6CACM,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,EAClD,IAAI,EAAC,OAAO,gBACA,SAAS,sBACH,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,mBAClC,QAAQ;QAEvB,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,WAAW,CAAC,EACnB,QAAQ,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACxC,SAAS,IAAI,MAAM,CAAC,iBAAiB,CAAC,CACvC;YAEA,QAAQ;YACR,SAAS,IAAI,oBAAC,aAAa,IAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,GAAI,CACjG;QACL,SAAS,IAAI,CACZ,oBAAC,cAAc,IAAC,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,IAChE,SAAS,CACK,CAClB,CACG,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';\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"]}
@@ -3,6 +3,5 @@ export declare type Theme = TypedOverride;
3
3
  export interface BuildThemedComponentsParams {
4
4
  theme: Theme;
5
5
  outputDir: string;
6
- baseThemeId?: string;
7
6
  }
8
- export declare function buildThemedComponents({ theme, outputDir, baseThemeId, }: BuildThemedComponentsParams): Promise<void>;
7
+ export declare function buildThemedComponents({ theme, outputDir }: BuildThemedComponentsParams): Promise<void>;
@@ -7,11 +7,10 @@ const index_cjs_1 = require("../../lib/internal/template/internal/generated/them
7
7
  const internalDir = path_1.join(__dirname, '../../lib/internal');
8
8
  const scssDir = path_1.join(internalDir, './scss');
9
9
  const templateDir = path_1.join(internalDir, './template');
10
- async function buildThemedComponents({ theme, outputDir, baseThemeId, }) {
10
+ async function buildThemedComponents({ theme, outputDir }) {
11
11
  return awsui_theming_build_1.buildThemedComponents({
12
12
  override: theme,
13
13
  preset: index_cjs_1.preset,
14
- baseThemeId,
15
14
  componentsOutputDir: path_1.join(outputDir, 'components'),
16
15
  designTokensOutputDir: path_1.join(outputDir, 'design-tokens'),
17
16
  templateDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/components-themeable",
3
- "version": "3.0.255",
3
+ "version": "3.0.256",
4
4
  "files": [
5
5
  "lib",
6
6
  "package.json",
@@ -1,24 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- @use '../../internal/styles/tokens' as awsui;
7
- @use '../../internal/styles' as styles;
8
-
9
- .dropzone {
10
- display: flex;
11
- flex-direction: column;
12
- align-items: center;
13
- justify-content: center;
14
- gap: awsui.$space-static-xxs;
15
- padding: awsui.$space-static-l;
16
- border-radius: awsui.$border-radius-dropzone;
17
- color: awsui.$color-dropzone-text-active;
18
- background-color: awsui.$color-dropzone-background-active;
19
- font-weight: styles.$font-weight-bold;
20
- &-hovered {
21
- color: awsui.$color-dropzone-text-hover;
22
- background-color: awsui.$color-dropzone-background-hover;
23
- }
24
- }
@@ -1,20 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- @use '../../internal/styles/tokens' as awsui;
7
-
8
- .upload-button,
9
- .upload-input {
10
- /* used in test-utils */
11
- }
12
-
13
- .file-input-container {
14
- position: relative;
15
- }
16
-
17
- .upload-input {
18
- position: absolute;
19
- clip: rect(0, 0, 0, 0);
20
- }
@@ -1,34 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- @use '../../internal/styles/tokens' as awsui;
7
-
8
- .file-option-name,
9
- .file-option-size,
10
- .file-option-last-modified,
11
- .file-option-thumbnail {
12
- /* used in test-utils */
13
- }
14
-
15
- .file-option {
16
- width: 100%;
17
- min-width: 0;
18
- display: flex;
19
- gap: awsui.$space-scaled-xs;
20
- }
21
-
22
- .file-option-thumbnail {
23
- margin-top: awsui.$space-static-xxs;
24
- max-width: 60px;
25
- }
26
-
27
- .file-option-thumbnail-image {
28
- width: 100%;
29
- height: auto;
30
- }
31
-
32
- .file-option-metadata {
33
- width: 100%;
34
- }
@@ -1,15 +0,0 @@
1
- /*
2
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
- */
5
-
6
- @use '../internal/styles/tokens' as awsui;
7
-
8
- .root,
9
- .hints {
10
- /* used in test-utils */
11
- }
12
-
13
- .hints {
14
- margin-top: awsui.$space-static-xxs;
15
- }
@@ -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,CAAC,cAAc,EAAE,CAAC;YAEvB,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC,CAAC;QAEF,qDAAqD;QACrD,MAAM,cAAc,GAAG,CAAC,KAAgB,EAAE,EAAE;YAC1C,KAAK,CAAC,cAAc,EAAE,CAAC;YAEvB,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9D,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAC;QACjE,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC;QACnE,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;QAEzD,OAAO,GAAG,EAAE;YACV,SAAS,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;YACrC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;YAC7D,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC;YAC/D,QAAQ,CAAC,mBAAmB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAiB;IAC5D,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhE,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;QAC5C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,kBAAkB,CAAC,IAAI,CAAC,CAAC;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_19vf6_93",
5
- "dropzone-hovered": "awsui_dropzone-hovered_1fham_19vf6_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_19vf6_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-qwe2cs, 0px);
101
- color: var(--color-dropzone-text-active-se5py5, #545b64);
102
- background-color: var(--color-dropzone-background-active-4uyrv4, #d5dbdb);
103
- font-weight: 700;
104
- }
105
- .awsui_dropzone-hovered_1fham_19vf6_105:not(#\9) {
106
- color: var(--color-dropzone-text-hover-8nw8ve, #12293b);
107
- background-color: var(--color-dropzone-background-hover-ekwhes, #99cbe4);
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_19vf6_93",
6
- "dropzone-hovered": "awsui_dropzone-hovered_1fham_19vf6_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"}