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AAS,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/@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 extends Omit<DropZoneProps, 'onHoverStart' | 'onHoverChange' | 'onHoverEnd' | 'isDisabled' | 'className' | 'style' | 'render'>, 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.cjs.map"}