@react-spectrum/dropzone 3.0.5 → 3.0.7

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.
@@ -40,7 +40,7 @@ let $f7b7e7956f17a6e7$var$filterProps = (props)=>{
40
40
  let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
41
41
  return otherProps;
42
42
  };
43
- function $f7b7e7956f17a6e7$var$DropZone(props, ref) {
43
+ const $f7b7e7956f17a6e7$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, ($parcel$interopDefault($7vttB$react))).forwardRef(function DropZone(props, ref) {
44
44
  let { children: children, isFilled: isFilled, replaceMessage: replaceMessage, ...otherProps } = props;
45
45
  let { styleProps: styleProps } = (0, $7vttB$reactspectrumutils.useStyleProps)(props);
46
46
  let domRef = (0, $7vttB$reactspectrumutils.useDOMRef)(ref);
@@ -77,10 +77,7 @@ function $f7b7e7956f17a6e7$var$DropZone(props, ref) {
77
77
  id: messageId,
78
78
  className: (0, $7vttB$reactspectrumutils.classNames)((0, ($parcel$interopDefault($880edb5e40e39939$exports))), 'spectrum-Dropzone-banner', styleProps.className)
79
79
  }, replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage'))));
80
- }
81
- /**
82
- * A drop zone is an area into which one or multiple objects can be dragged and dropped.
83
- */ let $f7b7e7956f17a6e7$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, ($parcel$interopDefault($7vttB$react))).forwardRef($f7b7e7956f17a6e7$var$DropZone);
80
+ });
84
81
 
85
82
 
86
83
  //# sourceMappingURL=DropZone.main.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAqBD,oFAAoF;AACpF,IAAI,oCAAc,CAAC;IACjB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAEA,SAAS,+BAAS,KAA4B,EAAE,GAA2B;IACzE,IAAI,YAAC,QAAQ,YAAE,QAAQ,kBAAE,cAAc,EAAE,GAAG,YAAW,GAAG;IAC1D,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,2BAAI;IACpB,IAAI,YAAY,CAAA,GAAA,2BAAI;IACpB,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,iBAAiB,WAAW,CAAC,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,GAAG;IAE9D,qBACE,0DAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBAAC,IAAI;gBAAS;aAAE;SAClC;qBACD,0DAAC,CAAA,GAAA,mCAAU;QACR,GAAG,CAAA,GAAA,gCAAS,EAAE,kCAAY,YAAY;QACtC,GAAG,UAAU;QACd,mBAAiB;QACjB,WACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,qBACA,WAAW,SAAS,EACpB;YAAC,6BAA6B;QAAQ;QAExC,KAAK;qBACL,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,cAAc;gBAAC,kBAAkB,CAAA,GAAA,oCAAS,EACxC,CAAA,GAAA,mDAAK,GACL;YACC;QACL;OACC,yBAEH,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBACnC,0DAAC;QACC,IAAI;QACJ,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,4BACA,WAAW,SAAS;OAGvB,iBAAiB,iBAAiB,gBAAgB,MAAM,CAAC;AAKpE;AAEA;;CAEC,GACD,IAAI,yDAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/dropzone/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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\nimport {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DropZoneProps, HeadingContext, Provider, DropZone as RACDropZone} from 'react-aria-components';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useId} from '@react-aria/utils';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd' | 'isDisabled' | 'className' | 'style'>, DOMProps, StyleProps, AriaLabelingProps {\n /** The content to display in the drop zone. */\n children: ReactNode,\n /** Whether the drop zone has been filled. */\n isFilled?: boolean,\n /** The message to replace the default banner message that is shown when the drop zone is filled. */\n replaceMessage?: string\n}\n\n// Filter out props used by RAC DropZone that we don't want in RSP DropZone for now.\nlet filterProps = (props) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\nfunction DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isFilled, replaceMessage, ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let messageId = useId();\n let headingId = useId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dropzone');\n let ariaLabelledby = isFilled ? `${headingId} ${messageId}` : headingId;\n\n return (\n <Provider\n values={[\n [HeadingContext, {id: headingId}]\n ]}>\n <RACDropZone\n {...mergeProps(filterProps(otherProps))}\n {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}\n aria-labelledby={ariaLabelledby}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone',\n styleProps.className,\n {'spectrum-Dropzone--filled': isFilled}\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n illustration: {UNSAFE_className: classNames(\n styles,\n 'spectrum-Dropzone-illustratedMessage'\n )}\n }}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />\n <div\n id={messageId}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone-banner',\n styleProps.className\n )\n }>\n {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}\n </div>\n </RACDropZone>\n </Provider>\n );\n}\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nlet _DropZone = React.forwardRef(DropZone);\nexport {_DropZone as DropZone};\n"],"names":[],"version":3,"file":"DropZone.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAqBD,oFAAoF;AACpF,IAAI,oCAAc,CAAC;IACjB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,yDAAW,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,SAAS,KAA4B,EAAE,GAA2B;IAClH,IAAI,YAAC,QAAQ,YAAE,QAAQ,kBAAE,cAAc,EAAE,GAAG,YAAW,GAAG;IAC1D,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,2BAAI;IACpB,IAAI,YAAY,CAAA,GAAA,2BAAI;IACpB,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,iBAAiB,WAAW,GAAG,UAAU,CAAC,EAAE,WAAW,GAAG;IAE9D,qBACE,0DAAC,CAAA,GAAA,mCAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBAAC,IAAI;gBAAS;aAAE;SAClC;qBACD,0DAAC,CAAA,GAAA,mCAAU;QACR,GAAG,CAAA,GAAA,gCAAS,EAAE,kCAAY,YAAY;QACtC,GAAG,UAAU;QACd,mBAAiB;QACjB,WACA,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,qBACA,WAAW,SAAS,EACpB;YAAC,6BAA6B;QAAQ;QAExC,KAAK;qBACL,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,cAAc;gBAAC,kBAAkB,CAAA,GAAA,oCAAS,EACxC,CAAA,GAAA,mDAAK,GACL;YACC;QACL;OACC,yBAEH,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBACnC,0DAAC;QACC,IAAI;QACJ,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,4BACA,WAAW,SAAS;OAGvB,iBAAiB,iBAAiB,gBAAgB,MAAM,CAAC;AAKpE","sources":["packages/@react-spectrum/dropzone/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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\nimport {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DropZoneProps, HeadingContext, Provider, DropZone as RACDropZone} from 'react-aria-components';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useId} from '@react-aria/utils';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd' | 'isDisabled' | 'className' | 'style'>, DOMProps, StyleProps, AriaLabelingProps {\n /** The content to display in the drop zone. */\n children: ReactNode,\n /** Whether the drop zone has been filled. */\n isFilled?: boolean,\n /** The message to replace the default banner message that is shown when the drop zone is filled. */\n replaceMessage?: string\n}\n\n// Filter out props used by RAC DropZone that we don't want in RSP DropZone for now.\nlet filterProps = (props) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = React.forwardRef(function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isFilled, replaceMessage, ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let messageId = useId();\n let headingId = useId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dropzone');\n let ariaLabelledby = isFilled ? `${headingId} ${messageId}` : headingId;\n\n return (\n <Provider\n values={[\n [HeadingContext, {id: headingId}]\n ]}>\n <RACDropZone\n {...mergeProps(filterProps(otherProps))}\n {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}\n aria-labelledby={ariaLabelledby}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone',\n styleProps.className,\n {'spectrum-Dropzone--filled': isFilled}\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n illustration: {UNSAFE_className: classNames(\n styles,\n 'spectrum-Dropzone-illustratedMessage'\n )}\n }}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />\n <div\n id={messageId}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone-banner',\n styleProps.className\n )\n }>\n {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}\n </div>\n </RACDropZone>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.main.js.map"}
package/dist/DropZone.mjs CHANGED
@@ -34,7 +34,7 @@ let $37da9a3796695f28$var$filterProps = (props)=>{
34
34
  let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
35
35
  return otherProps;
36
36
  };
37
- function $37da9a3796695f28$var$DropZone(props, ref) {
37
+ const $37da9a3796695f28$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $fl6Ye$react).forwardRef(function DropZone(props, ref) {
38
38
  let { children: children, isFilled: isFilled, replaceMessage: replaceMessage, ...otherProps } = props;
39
39
  let { styleProps: styleProps } = (0, $fl6Ye$useStyleProps)(props);
40
40
  let domRef = (0, $fl6Ye$useDOMRef)(ref);
@@ -71,10 +71,7 @@ function $37da9a3796695f28$var$DropZone(props, ref) {
71
71
  id: messageId,
72
72
  className: (0, $fl6Ye$classNames)((0, ($parcel$interopDefault($fl6Ye$dropzone_vars_cssmodulejs))), 'spectrum-Dropzone-banner', styleProps.className)
73
73
  }, replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage'))));
74
- }
75
- /**
76
- * A drop zone is an area into which one or multiple objects can be dragged and dropped.
77
- */ let $37da9a3796695f28$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $fl6Ye$react).forwardRef($37da9a3796695f28$var$DropZone);
74
+ });
78
75
 
79
76
 
80
77
  export {$37da9a3796695f28$export$3c6489d84dc98b6 as DropZone};
@@ -34,7 +34,7 @@ let $37da9a3796695f28$var$filterProps = (props)=>{
34
34
  let { onHoverStart: onHoverStart, onHoverChange: onHoverChange, onHoverEnd: onHoverEnd, ...otherProps } = props;
35
35
  return otherProps;
36
36
  };
37
- function $37da9a3796695f28$var$DropZone(props, ref) {
37
+ const $37da9a3796695f28$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $fl6Ye$react).forwardRef(function DropZone(props, ref) {
38
38
  let { children: children, isFilled: isFilled, replaceMessage: replaceMessage, ...otherProps } = props;
39
39
  let { styleProps: styleProps } = (0, $fl6Ye$useStyleProps)(props);
40
40
  let domRef = (0, $fl6Ye$useDOMRef)(ref);
@@ -71,10 +71,7 @@ function $37da9a3796695f28$var$DropZone(props, ref) {
71
71
  id: messageId,
72
72
  className: (0, $fl6Ye$classNames)((0, ($parcel$interopDefault($fl6Ye$dropzone_vars_cssmodulejs))), 'spectrum-Dropzone-banner', styleProps.className)
73
73
  }, replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage'))));
74
- }
75
- /**
76
- * A drop zone is an area into which one or multiple objects can be dragged and dropped.
77
- */ let $37da9a3796695f28$export$3c6489d84dc98b6 = /*#__PURE__*/ (0, $fl6Ye$react).forwardRef($37da9a3796695f28$var$DropZone);
74
+ });
78
75
 
79
76
 
80
77
  export {$37da9a3796695f28$export$3c6489d84dc98b6 as DropZone};
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAqBD,oFAAoF;AACpF,IAAI,oCAAc,CAAC;IACjB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAEA,SAAS,+BAAS,KAA4B,EAAE,GAA2B;IACzE,IAAI,YAAC,QAAQ,YAAE,QAAQ,kBAAE,cAAc,EAAE,GAAG,YAAW,GAAG;IAC1D,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,YAAI;IACpB,IAAI,YAAY,CAAA,GAAA,YAAI;IACpB,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,iBAAiB,WAAW,CAAC,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,GAAG;IAE9D,qBACE,gCAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qBAAa;gBAAG;oBAAC,IAAI;gBAAS;aAAE;SAClC;qBACD,gCAAC,CAAA,GAAA,eAAU;QACR,GAAG,CAAA,GAAA,iBAAS,EAAE,kCAAY,YAAY;QACtC,GAAG,UAAU;QACd,mBAAiB;QACjB,WACA,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,0DAAK,GACL,qBACA,WAAW,SAAS,EACpB;YAAC,6BAA6B;QAAQ;QAExC,KAAK;qBACL,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,cAAc;gBAAC,kBAAkB,CAAA,GAAA,iBAAS,EACxC,CAAA,GAAA,0DAAK,GACL;YACC;QACL;OACC,yBAEH,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;sBACnC,gCAAC;QACC,IAAI;QACJ,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,0DAAK,GACL,4BACA,WAAW,SAAS;OAGvB,iBAAiB,iBAAiB,gBAAgB,MAAM,CAAC;AAKpE;AAEA;;CAEC,GACD,IAAI,yDAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/dropzone/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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\nimport {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DropZoneProps, HeadingContext, Provider, DropZone as RACDropZone} from 'react-aria-components';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useId} from '@react-aria/utils';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd' | 'isDisabled' | 'className' | 'style'>, DOMProps, StyleProps, AriaLabelingProps {\n /** The content to display in the drop zone. */\n children: ReactNode,\n /** Whether the drop zone has been filled. */\n isFilled?: boolean,\n /** The message to replace the default banner message that is shown when the drop zone is filled. */\n replaceMessage?: string\n}\n\n// Filter out props used by RAC DropZone that we don't want in RSP DropZone for now.\nlet filterProps = (props) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\nfunction DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isFilled, replaceMessage, ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let messageId = useId();\n let headingId = useId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dropzone');\n let ariaLabelledby = isFilled ? `${headingId} ${messageId}` : headingId;\n\n return (\n <Provider\n values={[\n [HeadingContext, {id: headingId}]\n ]}>\n <RACDropZone\n {...mergeProps(filterProps(otherProps))}\n {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}\n aria-labelledby={ariaLabelledby}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone',\n styleProps.className,\n {'spectrum-Dropzone--filled': isFilled}\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n illustration: {UNSAFE_className: classNames(\n styles,\n 'spectrum-Dropzone-illustratedMessage'\n )}\n }}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />\n <div\n id={messageId}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone-banner',\n styleProps.className\n )\n }>\n {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}\n </div>\n </RACDropZone>\n </Provider>\n );\n}\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nlet _DropZone = React.forwardRef(DropZone);\nexport {_DropZone as DropZone};\n"],"names":[],"version":3,"file":"DropZone.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAqBD,oFAAoF;AACpF,IAAI,oCAAc,CAAC;IACjB,6DAA6D;IAC7D,IAAI,gBAAC,YAAY,iBAAE,aAAa,cAAE,UAAU,EAAE,GAAG,YAAW,GAAG;IAC/D,OAAO;AACT;AAKO,MAAM,yDAAW,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,SAAS,KAA4B,EAAE,GAA2B;IAClH,IAAI,YAAC,QAAQ,YAAE,QAAQ,kBAAE,cAAc,EAAE,GAAG,YAAW,GAAG;IAC1D,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,YAAY,CAAA,GAAA,YAAI;IACpB,IAAI,YAAY,CAAA,GAAA,YAAI;IACpB,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,iBAAiB,WAAW,GAAG,UAAU,CAAC,EAAE,WAAW,GAAG;IAE9D,qBACE,gCAAC,CAAA,GAAA,eAAO;QACN,QAAQ;YACN;gBAAC,CAAA,GAAA,qBAAa;gBAAG;oBAAC,IAAI;gBAAS;aAAE;SAClC;qBACD,gCAAC,CAAA,GAAA,eAAU;QACR,GAAG,CAAA,GAAA,iBAAS,EAAE,kCAAY,YAAY;QACtC,GAAG,UAAU;QACd,mBAAiB;QACjB,WACA,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,0DAAK,GACL,qBACA,WAAW,SAAS,EACpB;YAAC,6BAA6B;QAAQ;QAExC,KAAK;qBACL,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,cAAc;gBAAC,kBAAkB,CAAA,GAAA,iBAAS,EACxC,CAAA,GAAA,0DAAK,GACL;YACC;QACL;OACC,yBAEH,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,0DAAK,GAAG;sBACnC,gCAAC;QACC,IAAI;QACJ,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,0DAAK,GACL,4BACA,WAAW,SAAS;OAGvB,iBAAiB,iBAAiB,gBAAgB,MAAM,CAAC;AAKpE","sources":["packages/@react-spectrum/dropzone/src/DropZone.tsx"],"sourcesContent":["/*\n * Copyright 2023 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\nimport {AriaLabelingProps, DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DropZoneProps, HeadingContext, Provider, DropZone as RACDropZone} from 'react-aria-components';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps, useId} from '@react-aria/utils';\nimport React, {ReactNode} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\nexport interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd' | 'isDisabled' | 'className' | 'style'>, DOMProps, StyleProps, AriaLabelingProps {\n /** The content to display in the drop zone. */\n children: ReactNode,\n /** Whether the drop zone has been filled. */\n isFilled?: boolean,\n /** The message to replace the default banner message that is shown when the drop zone is filled. */\n replaceMessage?: string\n}\n\n// Filter out props used by RAC DropZone that we don't want in RSP DropZone for now.\nlet filterProps = (props) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {onHoverStart, onHoverChange, onHoverEnd, ...otherProps} = props;\n return otherProps;\n};\n\n/**\n * A drop zone is an area into which one or multiple objects can be dragged and dropped.\n */\nexport const DropZone = React.forwardRef(function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {\n let {children, isFilled, replaceMessage, ...otherProps} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n let messageId = useId();\n let headingId = useId();\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/dropzone');\n let ariaLabelledby = isFilled ? `${headingId} ${messageId}` : headingId;\n\n return (\n <Provider\n values={[\n [HeadingContext, {id: headingId}]\n ]}>\n <RACDropZone\n {...mergeProps(filterProps(otherProps))}\n {...styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>}\n aria-labelledby={ariaLabelledby}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone',\n styleProps.className,\n {'spectrum-Dropzone--filled': isFilled}\n )}\n ref={domRef}>\n <SlotProvider\n slots={{\n illustration: {UNSAFE_className: classNames(\n styles,\n 'spectrum-Dropzone-illustratedMessage'\n )}\n }}>\n {children}\n </SlotProvider>\n <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />\n <div\n id={messageId}\n className={\n classNames(\n styles,\n 'spectrum-Dropzone-banner',\n styleProps.className\n )\n }>\n {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}\n </div>\n </RACDropZone>\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DropZone.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAsC,CAAC,wBAAwB,CAAC;AAChE,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAyD,CAAC,2CAA2C,CAAC;AACtG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC","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":"dropzone_vars_css.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAsC,CAAC,wBAAwB,CAAC;AAChE,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAyD,CAAC,2CAA2C,CAAC;AACtG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC","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":"dropzone_vars_css.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAsC,CAAC,wBAAwB,CAAC;AAChE,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAyD,CAAC,2CAA2C,CAAC;AACtG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC","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":"dropzone_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AATA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAsC,CAAC,wBAAwB,CAAC;AAChE,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,4CAAyD,CAAC,2CAA2C,CAAC;AACtG,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC","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":"dropzone_vars_css.module.js.map"}
package/dist/types.d.ts CHANGED
@@ -12,6 +12,6 @@ export interface SpectrumDropZoneProps extends Omit<DropZoneProps, 'onHoverStart
12
12
  /**
13
13
  * A drop zone is an area into which one or multiple objects can be dragged and dropped.
14
14
  */
15
- export let DropZone: React.ForwardRefExoticComponent<SpectrumDropZoneProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
15
+ export const DropZone: React.ForwardRefExoticComponent<SpectrumDropZoneProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
16
16
 
17
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;;AAsBA,sCAAuC,SAAQ,IAAI,CAAC,aAAa,EAAE,cAAc,GAAG,eAAe,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB;IACjM,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oGAAoG;IACpG,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AA6DD;;GAEG;AACH,OAAA,IAAI,mHAAsC,CAAC","sources":["packages/@react-spectrum/dropzone/src/packages/@react-spectrum/dropzone/src/DropZone.tsx","packages/@react-spectrum/dropzone/src/packages/@react-spectrum/dropzone/src/index.ts","packages/@react-spectrum/dropzone/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2023 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/// <reference types=\"css-module-types\" />\n\nexport {DropZone} from './DropZone';\nexport type {SpectrumDropZoneProps} from './DropZone';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AAsBA,sCAAuC,SAAQ,IAAI,CAAC,aAAa,EAAE,cAAc,GAAG,eAAe,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB;IACjM,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oGAAoG;IACpG,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AASD;;GAEG;AACH,OAAO,MAAM,mHAkDX,CAAC","sources":["packages/@react-spectrum/dropzone/src/packages/@react-spectrum/dropzone/src/DropZone.tsx","packages/@react-spectrum/dropzone/src/packages/@react-spectrum/dropzone/src/index.ts","packages/@react-spectrum/dropzone/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2023 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/// <reference types=\"css-module-types\" />\n\nexport {DropZone} from './DropZone';\nexport type {SpectrumDropZoneProps} from './DropZone';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/dropzone",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,12 +36,12 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/i18n": "^3.12.3",
40
- "@react-aria/utils": "^3.25.3",
41
- "@react-spectrum/utils": "^3.11.11",
42
- "@react-types/shared": "^3.25.0",
39
+ "@react-aria/i18n": "^3.12.5",
40
+ "@react-aria/utils": "^3.27.0",
41
+ "@react-spectrum/utils": "^3.12.1",
42
+ "@react-types/shared": "^3.27.0",
43
43
  "@swc/helpers": "^0.5.0",
44
- "react-aria-components": "^1.4.1"
44
+ "react-aria-components": "^1.6.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@react-spectrum/provider": "^3.0.0",
53
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
53
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "8e0a28d188cdbdbd2b32296fa034b1b02ddde229"
58
+ "gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
59
59
  }
package/src/DropZone.tsx CHANGED
@@ -36,7 +36,10 @@ let filterProps = (props) => {
36
36
  return otherProps;
37
37
  };
38
38
 
39
- function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {
39
+ /**
40
+ * A drop zone is an area into which one or multiple objects can be dragged and dropped.
41
+ */
42
+ export const DropZone = React.forwardRef(function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {
40
43
  let {children, isFilled, replaceMessage, ...otherProps} = props;
41
44
  let {styleProps} = useStyleProps(props);
42
45
  let domRef = useDOMRef(ref);
@@ -86,10 +89,4 @@ function DropZone(props: SpectrumDropZoneProps, ref: DOMRef<HTMLDivElement>) {
86
89
  </RACDropZone>
87
90
  </Provider>
88
91
  );
89
- }
90
-
91
- /**
92
- * A drop zone is an area into which one or multiple objects can be dragged and dropped.
93
- */
94
- let _DropZone = React.forwardRef(DropZone);
95
- export {_DropZone as DropZone};
92
+ });