@react-spectrum/dropzone 3.0.0-rc.3 → 3.0.0

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 (61) hide show
  1. package/dist/DropZone.main.js +86 -0
  2. package/dist/DropZone.main.js.map +1 -0
  3. package/dist/DropZone.mjs +81 -0
  4. package/dist/DropZone.module.js +81 -0
  5. package/dist/DropZone.module.js.map +1 -0
  6. package/dist/ar-AE.mjs +1 -1
  7. package/dist/bg-BG.mjs +1 -1
  8. package/dist/cs-CZ.mjs +1 -1
  9. package/dist/da-DK.mjs +1 -1
  10. package/dist/de-DE.mjs +1 -1
  11. package/dist/dropzone_vars_css.main.js +38 -0
  12. package/dist/dropzone_vars_css.main.js.map +1 -0
  13. package/dist/dropzone_vars_css.mjs +40 -0
  14. package/dist/dropzone_vars_css.module.js +40 -0
  15. package/dist/dropzone_vars_css.module.js.map +1 -0
  16. package/dist/el-GR.mjs +1 -1
  17. package/dist/en-US.mjs +1 -1
  18. package/dist/es-ES.mjs +1 -1
  19. package/dist/et-EE.mjs +1 -1
  20. package/dist/fi-FI.mjs +1 -1
  21. package/dist/fr-FR.mjs +1 -1
  22. package/dist/he-IL.mjs +1 -1
  23. package/dist/hr-HR.mjs +1 -1
  24. package/dist/hu-HU.mjs +1 -1
  25. package/dist/import.mjs +1 -207
  26. package/dist/intlStrings.main.js +108 -0
  27. package/dist/intlStrings.main.js.map +1 -0
  28. package/dist/intlStrings.mjs +110 -0
  29. package/dist/intlStrings.module.js +110 -0
  30. package/dist/intlStrings.module.js.map +1 -0
  31. package/dist/it-IT.mjs +1 -1
  32. package/dist/ja-JP.mjs +1 -1
  33. package/dist/ko-KR.mjs +1 -1
  34. package/dist/lt-LT.mjs +1 -1
  35. package/dist/lv-LV.mjs +1 -1
  36. package/dist/main.js +2 -204
  37. package/dist/main.js.map +1 -1
  38. package/dist/module.js +1 -207
  39. package/dist/module.js.map +1 -1
  40. package/dist/nb-NO.mjs +1 -1
  41. package/dist/nl-NL.mjs +1 -1
  42. package/dist/pl-PL.mjs +1 -1
  43. package/dist/pt-BR.mjs +1 -1
  44. package/dist/pt-PT.mjs +1 -1
  45. package/dist/ro-RO.mjs +1 -1
  46. package/dist/ru-RU.mjs +1 -1
  47. package/dist/sk-SK.mjs +1 -1
  48. package/dist/sl-SI.mjs +1 -1
  49. package/dist/sr-SP.mjs +1 -1
  50. package/dist/sv-SE.mjs +1 -1
  51. package/dist/tr-TR.mjs +1 -1
  52. package/dist/types.d.ts +3 -3
  53. package/dist/types.d.ts.map +1 -1
  54. package/dist/uk-UA.mjs +1 -1
  55. package/dist/{main.css → vars.c0db847d.css} +15 -26
  56. package/dist/vars.c0db847d.css.map +1 -0
  57. package/dist/zh-CN.mjs +1 -1
  58. package/dist/zh-TW.mjs +1 -1
  59. package/package.json +8 -8
  60. package/src/DropZone.tsx +42 -35
  61. package/dist/main.css.map +0 -1
@@ -23,11 +23,7 @@
23
23
  font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
24
24
  }
25
25
 
26
- .b5Gu6W_i18nFontFamily:lang(zh-SG) {
27
- font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
28
- }
29
-
30
- .b5Gu6W_i18nFontFamily:lang(zh-CN) {
26
+ .b5Gu6W_i18nFontFamily:lang(zh-SG), .b5Gu6W_i18nFontFamily:lang(zh-CN) {
31
27
  font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
32
28
  }
33
29
 
@@ -55,13 +51,7 @@
55
51
  transition: box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out, margin var(--spectrum-global-animation-duration-100, .13s) ease-out;
56
52
  display: block;
57
53
  position: absolute;
58
- top: 0;
59
- bottom: 0;
60
- left: 0;
61
- right: 0;
62
- }
63
-
64
- .b5Gu6W_spectrum-FocusRing {
54
+ inset: 0;
65
55
  }
66
56
 
67
57
  .b5Gu6W_spectrum-FocusRing.b5Gu6W_focus-ring:after {
@@ -78,6 +68,16 @@
78
68
  box-shadow: 0 var(--spectrum-focus-ring-size) 0 var(--spectrum-focus-ring-color);
79
69
  }
80
70
 
71
+ @media (forced-colors: active) {
72
+ .b5Gu6W_spectrum-FocusRing, .b5Gu6W_spectrum-FocusRing-ring, .b5Gu6W_spectrum-FocusRing--quiet {
73
+ --spectrum-high-contrast-focus-ring-color: Highlight;
74
+ }
75
+
76
+ :is(.b5Gu6W_spectrum-FocusRing, .b5Gu6W_spectrum-FocusRing-ring, .b5Gu6W_spectrum-FocusRing--quiet):after {
77
+ forced-color-adjust: none;
78
+ }
79
+ }
80
+
81
81
  .b5Gu6W_spectrum-Dropzone {
82
82
  text-align: center;
83
83
  border-width: var(--spectrum-dropzone-border-width, var(--spectrum-alias-border-size-thick));
@@ -91,10 +91,7 @@
91
91
  content: "";
92
92
  display: none;
93
93
  position: absolute;
94
- top: 0;
95
- bottom: 0;
96
- left: 0;
97
- right: 0;
94
+ inset: 0;
98
95
  }
99
96
 
100
97
  .b5Gu6W_spectrum-Dropzone:focus {
@@ -106,11 +103,7 @@
106
103
  border-style: solid;
107
104
  }
108
105
 
109
- .b5Gu6W_spectrum-Dropzone[data-drop-target].b5Gu6W_spectrum-Dropzone--filled .b5Gu6W_spectrum-Dropzone-banner {
110
- display: block;
111
- }
112
-
113
- .b5Gu6W_spectrum-Dropzone[data-drop-target] .b5Gu6W_spectrum-Dropzone-backdrop {
106
+ .b5Gu6W_spectrum-Dropzone[data-drop-target].b5Gu6W_spectrum-Dropzone--filled .b5Gu6W_spectrum-Dropzone-banner, .b5Gu6W_spectrum-Dropzone[data-drop-target] .b5Gu6W_spectrum-Dropzone-backdrop {
114
107
  display: block;
115
108
  }
116
109
 
@@ -139,9 +132,6 @@
139
132
 
140
133
  .b5Gu6W_spectrum-Dropzone {
141
134
  --spectrum-dropzone-illustratedmessage-illustration-color-key-focus: var(--spectrum-global-color-blue-500);
142
- }
143
-
144
- .b5Gu6W_spectrum-Dropzone {
145
135
  border-color: var(--spectrum-dropzone-border-color, var(--spectrum-global-color-gray-300));
146
136
  }
147
137
 
@@ -176,5 +166,4 @@
176
166
  --spectrum-dropzone-illustratedmessage-illustration-color-key-focus: Highlight;
177
167
  }
178
168
  }
179
-
180
- /*# sourceMappingURL=main.css.map */
169
+ /*# sourceMappingURL=vars.c0db847d.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;AAQE;;;;;;;AAUA;;;;;AAGE;;;;AAMA;;;;AAYJ;;;;;;;;;;;;;AAaA;EAGM;;;;EAKA;;;;;AAmBN;;;;;AAOE;;;;AAIA;;;;;;AAMI;;;;AAKF;;;;AAMA;;;;AAMJ;EACE","sources":["packages/@adobe/spectrum-css-temp/components/dropzone/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"vars.c0db847d.css.map"}
package/dist/zh-CN.mjs CHANGED
@@ -5,4 +5,4 @@ $1ba57165d5de0b25$exports = {
5
5
 
6
6
 
7
7
  export {$1ba57165d5de0b25$exports as default};
8
- //# sourceMappingURL=zh-CN.module.js.map
8
+ //# sourceMappingURL=zh-CN.mjs.map
package/dist/zh-TW.mjs CHANGED
@@ -5,4 +5,4 @@ $586e20fd0bf5d7aa$exports = {
5
5
 
6
6
 
7
7
  export {$586e20fd0bf5d7aa$exports as default};
8
- //# sourceMappingURL=zh-TW.module.js.map
8
+ //# sourceMappingURL=zh-TW.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/dropzone",
3
- "version": "3.0.0-rc.3",
3
+ "version": "3.0.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,16 +36,16 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/i18n": "^3.10.2",
40
- "@react-aria/utils": "^3.23.2",
41
- "@react-spectrum/utils": "^3.11.5",
42
- "@react-types/shared": "^3.22.1",
39
+ "@react-aria/i18n": "^3.11.0",
40
+ "@react-aria/utils": "^3.24.0",
41
+ "@react-spectrum/utils": "^3.11.6",
42
+ "@react-types/shared": "^3.23.0",
43
43
  "@swc/helpers": "^0.5.0",
44
- "react-aria-components": "^1.1.1"
44
+ "react-aria-components": "^1.2.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
48
- "@react-spectrum/test-utils": "3.0.0-alpha.1"
48
+ "@react-spectrum/test-utils-internal": "3.0.0-alpha.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@react-spectrum/provider": "^3.0.0",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "de9f84a22583fc741c29b341d14cd35ef4cca161"
57
+ "gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
58
58
  }
package/src/DropZone.tsx CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  import {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';
14
14
  import {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';
15
- import {DropZoneProps, DropZone as RACDropZone} from 'react-aria-components';
15
+ import {DropZoneProps, HeadingContext, Provider, DropZone as RACDropZone} from 'react-aria-components';
16
16
  // @ts-ignore
17
17
  import intlMessages from '../intl/*.json';
18
18
  import {mergeProps, useId} from '@react-aria/utils';
@@ -20,7 +20,7 @@ import React, {ReactNode} from 'react';
20
20
  import styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';
21
21
  import {useLocalizedStringFormatter} from '@react-aria/i18n';
22
22
 
23
- export interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd'>, DOMProps, StyleProps, AriaLabelingProps {
23
+ export interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd' | 'isDisabled' | 'className' | 'style'>, DOMProps, StyleProps, AriaLabelingProps {
24
24
  /** The content to display in the drop zone. */
25
25
  children: ReactNode,
26
26
  /** Whether the drop zone has been filled. */
@@ -41,43 +41,50 @@ function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {
41
41
  let {styleProps} = useStyleProps(props);
42
42
  let domRef = useDOMRef(ref);
43
43
  let messageId = useId();
44
+ let headingId = useId();
44
45
  let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dropzone');
46
+ let ariaLabelledby = isFilled ? `${headingId} ${messageId}` : headingId;
45
47
 
46
48
  return (
47
- <RACDropZone
48
- {...mergeProps(filterProps(otherProps))}
49
- {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}
50
- aria-labelledby={isFilled && messageId}
51
- className={
52
- classNames(
53
- styles,
54
- 'spectrum-Dropzone',
55
- styleProps.className,
56
- {'spectrum-Dropzone--filled': isFilled}
57
- )}
58
- ref={domRef}>
59
- <SlotProvider
60
- slots={{
61
- illustration: {UNSAFE_className: classNames(
62
- styles,
63
- 'spectrum-Dropzone-illustratedMessage'
64
- )}
65
- }}>
66
- {children}
67
- </SlotProvider>
68
- <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />
69
- <div
70
- id={messageId}
49
+ <Provider
50
+ values={[
51
+ [HeadingContext, {id: headingId}]
52
+ ]}>
53
+ <RACDropZone
54
+ {...mergeProps(filterProps(otherProps))}
55
+ {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}
56
+ aria-labelledby={ariaLabelledby}
71
57
  className={
72
- classNames(
73
- styles,
74
- 'spectrum-Dropzone-banner',
75
- styleProps.className
76
- )
77
- }>
78
- {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}
79
- </div>
80
- </RACDropZone>
58
+ classNames(
59
+ styles,
60
+ 'spectrum-Dropzone',
61
+ styleProps.className,
62
+ {'spectrum-Dropzone--filled': isFilled}
63
+ )}
64
+ ref={domRef}>
65
+ <SlotProvider
66
+ slots={{
67
+ illustration: {UNSAFE_className: classNames(
68
+ styles,
69
+ 'spectrum-Dropzone-illustratedMessage'
70
+ )}
71
+ }}>
72
+ {children}
73
+ </SlotProvider>
74
+ <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />
75
+ <div
76
+ id={messageId}
77
+ className={
78
+ classNames(
79
+ styles,
80
+ 'spectrum-Dropzone-banner',
81
+ styleProps.className
82
+ )
83
+ }>
84
+ {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}
85
+ </div>
86
+ </RACDropZone>
87
+ </Provider>
81
88
  );
82
89
  }
83
90
 
package/dist/main.css.map DELETED
@@ -1 +0,0 @@
1
- {"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;;;;AAiBF;;;AAII;;;;;AAQF;;;;AAKE;;;;;AAOJ;;;;;;;;;AAQE;;;;;;;;;;AAUA;;;;;AAGE;;;;AAMA;;;;AAMA;;;;AAMJ;;;;;;;;;;;;;AAaA;EAGM;;;;EAKA;;;;;AAmBN;;;;AAIA;;;;AAGE;;;;AAIA;;;;;;AAMI;;;;AAKF;;;;AAMA;;;;AAMJ;EACE","sources":["packages/@adobe/spectrum-css-temp/components/dropzone/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"main.css.map"}