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AAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;sBACnC,0DAAC;QACC,IAAI;QACJ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,4BAA4B,WAAW,SAAS;OAC7E,iBAAiB,iBAAiB,gBAAgB,MAAM,CAAC;AAKpE","sources":["packages/@adobe/react-spectrum/src/dropzone/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} from '../utils/classNames';\nimport {DropZoneProps, DropZone as RACDropZone} from 'react-aria-components/DropZone';\nimport {HeadingContext} from 'react-aria-components/Heading';\nimport intlMessages from '../../intl/dropzone/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {Provider} from 'react-aria-components/slots';\nimport React, {ReactNode} from 'react';\n// @ts-ignore\nimport {SlotProvider} from '../utils/Slots';\nimport styles from '@adobe/spectrum-css-temp/components/dropzone/vars.css';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useId} from 'react-aria/useId';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface SpectrumDropZoneProps\n  extends\n    Omit<\n      DropZoneProps,\n      | 'onHoverStart'\n      | 'onHoverChange'\n      | 'onHoverEnd'\n      | 'isDisabled'\n      | 'className'\n      | 'style'\n      | 'render'\n    >,\n    DOMProps,\n    StyleProps,\n    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(\n  props: SpectrumDropZoneProps,\n  ref: DOMRef<HTMLDivElement>\n) {\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 values={[[HeadingContext, {id: headingId}]]}>\n      <RACDropZone\n        {...mergeProps(filterProps(otherProps))}\n        {...(styleProps as Omit<React.HTMLAttributes<HTMLElement>, 'onDrop'>)}\n        aria-labelledby={ariaLabelledby}\n        className={classNames(styles, 'spectrum-Dropzone', styleProps.className, {\n          'spectrum-Dropzone--filled': isFilled\n        })}\n        ref={domRef}>\n        <SlotProvider\n          slots={{\n            illustration: {\n              UNSAFE_className: classNames(styles, 'spectrum-Dropzone-illustratedMessage')\n            }\n          }}>\n          {children}\n        </SlotProvider>\n        <div className={classNames(styles, 'spectrum-Dropzone-backdrop')} />\n        <div\n          id={messageId}\n          className={classNames(styles, 'spectrum-Dropzone-banner', styleProps.className)}>\n          {replaceMessage ? replaceMessage : stringFormatter.format('replaceMessage')}\n        </div>\n      </RACDropZone>\n    </Provider>\n  );\n});\n"],"names":[],"version":3,"file":"DropZone.cjs.map"}