{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAuDM,MAAM,0DAAQ,CAAA,GAAA,YAAI,EAAE,UAAU,CACnC,0CAA0C;AAE1C,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnE,uGAAuG,GACvG,IAAI,kBAAkB,MAAM,GAAG;IAC/B,QAAQ,CAAA,GAAA,yCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,IAAI,aAAC,SAAS,OAAE,GAAG,OAAE,GAAG,EAAE,GAAG,YAAW,GAAG;IAC3C,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,yCAAQ,EAAE;IAEvB,IAAI,OAAO,QAAQ,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC1C,QAAQ,IAAI,CACV;IAMJ,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG,WAAW,SAAS;QAClD,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,UAAU;QACZ;QACA,KAAK;qBACL,gCAAC;QACC,KAAK;QACL,KAAK,mBAAmB;QACxB,OAAO;uBAAC;QAAS;QACjB,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,kDAAK,GAAG;QAC9B,SAAS,OAAO;QAChB,QAAQ,OAAO;QACf,aAAa,OAAO;;AAI5B","sources":["packages/@adobe/react-spectrum/src/image/Image.tsx"],"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\nimport {classNames} from '../utils/classNames';\n\nimport {DOMProps, DOMRef, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport React, {ReactEventHandler} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/image/vars.css';\nimport {useDOMRef} from '../utils/useDOMRef';\nimport {useProviderProps} from '../provider/Provider';\nimport {useSlotProps} from '../utils/Slots';\nimport {useStyleProps} from '../utils/styleProps';\n\nexport interface ImageProps {\n  /**\n   * The URL of the image.\n   */\n  src: string;\n  /**\n   * Text description of the image.\n   */\n  alt?: string;\n  /**\n   * Sets the Image [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit) style.\n   */\n  objectFit?: any; // move to styleProps for images and type better\n  /**\n   * Called if an error occurs while loading or rendering an image, see [Image loading\n   * errors](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#image_loading_errors).\n   */\n  onError?: ReactEventHandler<HTMLImageElement>;\n  /**\n   * Called when the image has successfully loaded, see [load\n   * event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/load_event).\n   */\n  onLoad?: ReactEventHandler<HTMLImageElement>;\n  /**\n   * Indicates if the fetching of the image must be done using a CORS request.\n   * [See MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin).\n   */\n  crossOrigin?: 'anonymous' | 'use-credentials';\n}\n\nexport interface SpectrumImageProps extends ImageProps, DOMProps, StyleProps {\n  /**\n   * A slot to place the image in.\n   *\n   * @default 'image'\n   */\n  slot?: string;\n}\n\n/**\n * Image is used to insert and display an image within a component.\n */\nexport const Image = React.forwardRef(\n  // incomplete component for show right now\n\n  function Image(props: SpectrumImageProps, ref: DOMRef<HTMLDivElement>) {\n    /* Slots should be able to pass an alt for default behavior, but in Images, the child may know better. */\n    let userProvidedAlt = props.alt;\n    props = useSlotProps(props, 'image');\n    props = useProviderProps(props);\n    let {objectFit, src, alt, ...otherProps} = props;\n    let {styleProps} = useStyleProps(otherProps);\n    let domRef = useDOMRef(ref);\n\n    if (alt == null && process.env.NODE_ENV !== 'production') {\n      console.warn(\n        'The `alt` prop was not provided to an image. ' +\n          'Add `alt` text for screen readers, or set `alt=\"\"` prop to indicate that the image ' +\n          'is decorative or redundant with displayed text and should not be announced by screen readers.'\n      );\n    }\n\n    return (\n      <div\n        {...filterDOMProps(props)}\n        {...styleProps}\n        className={classNames(styles, styleProps.className)}\n        style={{\n          ...styleProps.style,\n          overflow: 'hidden'\n        }}\n        ref={domRef}>\n        <img\n          src={src}\n          alt={userProvidedAlt || alt}\n          style={{objectFit}}\n          className={classNames(styles, 'spectrum-Image-img')}\n          onError={props?.onError}\n          onLoad={props?.onLoad}\n          crossOrigin={props?.crossOrigin}\n        />\n      </div>\n    );\n  }\n);\n"],"names":[],"version":3,"file":"Image.mjs.map"}