@react-spectrum/image 3.4.12-nightly.4494 → 3.4.12-nightly.4506

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.
package/dist/import.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./main.css";
1
+ import "./module.css";
2
2
  import {useSlotProps as $9XFMV$useSlotProps, useStyleProps as $9XFMV$useStyleProps, useDOMRef as $9XFMV$useDOMRef, classNames as $9XFMV$classNames} from "@react-spectrum/utils";
3
3
  import {filterDOMProps as $9XFMV$filterDOMProps} from "@react-aria/utils";
4
4
  import $9XFMV$react from "react";
@@ -68,7 +68,9 @@ function $77e0ac4d4aa3e5ef$var$Image(props, ref) {
68
68
  style: {
69
69
  objectFit: objectFit
70
70
  },
71
- className: (0, $9XFMV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cf2f2ea6e1c0495a$exports))), "spectrum-Image-img")
71
+ className: (0, $9XFMV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cf2f2ea6e1c0495a$exports))), "spectrum-Image-img"),
72
+ onError: props === null || props === void 0 ? void 0 : props.onError,
73
+ onLoad: props === null || props === void 0 ? void 0 : props.onLoad
72
74
  }));
73
75
  }
74
76
  /**
package/dist/main.css CHANGED
@@ -4,5 +4,4 @@
4
4
  height: 100%;
5
5
  display: block;
6
6
  }
7
-
8
7
  /*# sourceMappingURL=main.css.map */
package/dist/main.js CHANGED
@@ -70,7 +70,9 @@ function $bda2e7b47de3a920$var$Image(props, ref) {
70
70
  style: {
71
71
  objectFit: objectFit
72
72
  },
73
- className: (0, $je8mI$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ec6587ec6732a958$exports))), "spectrum-Image-img")
73
+ className: (0, $je8mI$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($ec6587ec6732a958$exports))), "spectrum-Image-img"),
74
+ onError: props === null || props === void 0 ? void 0 : props.onError,
75
+ onLoad: props === null || props === void 0 ? void 0 : props.onLoad
74
76
  }));
75
77
  }
76
78
  /**
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;ACVD,IAAA;AAAA,4CAAuC,CAAC,yBAAyB,CAAC;;;;ADoBlE,0CAA0C;AAE1C,SAAS,4BAAM,KAAyB,EAAE,GAA2B;IACnE,uGAAuG,GACvG,IAAI,kBAAkB,MAAM,GAAG;IAC/B,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,aACF,SAAS,OACT,GAAG,OACH,GAAG,EACH,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,OAAO,MACT,QAAQ,IAAI,CACV;IAMJ,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG,WAAW,SAAS;QAClD,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,UAAU;QACZ;QACA,KAAK;qBACL,0DAAC;QACC,KAAK;QACL,KAAK,mBAAmB;QACxB,OAAO;uBAAC;QAAS;QACjB,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;;AAGtC;AAEA;;CAEC,GACD,MAAM,0DAAS,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/image/src/index.ts","packages/@react-spectrum/image/src/Image.tsx","packages/@adobe/spectrum-css-temp/components/image/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/// <reference types=\"css-module-types\" />\n\nexport {Image} from './Image';\nexport type {SpectrumImageProps} from '@react-types/image';\n","/*\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, useDOMRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React from 'react';\nimport {SpectrumImageProps} from '@react-types/image';\nimport styles from '@adobe/spectrum-css-temp/components/image/vars.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n// incomplete component for show right now\n\nfunction 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 {\n objectFit,\n src,\n alt,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n if (alt == null) {\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 </div>\n );\n}\n\n/**\n * Image is used to insert and display an image within a component.\n */\nconst _Image = React.forwardRef(Image);\nexport {_Image as Image};\n","/*\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"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;ACVD,IAAA;AAAA,4CAAuC,CAAC,yBAAyB,CAAC;;;;ADoBlE,0CAA0C;AAE1C,SAAS,4BAAM,KAAyB,EAAE,GAA2B;IACnE,uGAAuG,GACvG,IAAI,kBAAkB,MAAM,GAAG;IAC/B,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,IAAI,aACF,SAAS,OACT,GAAG,OACH,GAAG,EACH,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,IAAI,OAAO,MACT,QAAQ,IAAI,CACV;IAMJ,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG,WAAW,SAAS;QAClD,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,UAAU;QACZ;QACA,KAAK;qBACL,0DAAC;QACC,KAAK;QACL,KAAK,mBAAmB;QACxB,OAAO;uBAAC;QAAS;QACjB,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QAC9B,OAAO,EAAE,kBAAA,4BAAA,MAAO,OAAO;QACvB,MAAM,EAAE,kBAAA,4BAAA,MAAO,MAAM;;AAG7B;AAEA;;CAEC,GACD,MAAM,0DAAS,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/image/src/index.ts","packages/@react-spectrum/image/src/Image.tsx","packages/@adobe/spectrum-css-temp/components/image/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/// <reference types=\"css-module-types\" />\n\nexport {Image} from './Image';\nexport type {SpectrumImageProps} from '@react-types/image';\n","/*\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, useDOMRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React from 'react';\nimport {SpectrumImageProps} from '@react-types/image';\nimport styles from '@adobe/spectrum-css-temp/components/image/vars.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n// incomplete component for show right now\n\nfunction 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 {\n objectFit,\n src,\n alt,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n if (alt == null) {\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 </div>\n );\n}\n\n/**\n * Image is used to insert and display an image within a component.\n */\nconst _Image = React.forwardRef(Image);\nexport {_Image as Image};\n","/*\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"],"names":[],"version":3,"file":"main.js.map"}
@@ -0,0 +1,7 @@
1
+ .Gv9sRq_spectrum-Image-img {
2
+ width: 100%;
3
+ max-width: 100%;
4
+ height: 100%;
5
+ display: block;
6
+ }
7
+ /*# sourceMappingURL=module.css.map */
@@ -0,0 +1 @@
1
+ {"mappings":"AA4BA","sources":["packages/@adobe/spectrum-css-temp/components/image/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"],"names":[],"version":3,"file":"module.css.map"}
package/dist/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./main.css";
1
+ import "./module.css";
2
2
  import {useSlotProps as $9XFMV$useSlotProps, useStyleProps as $9XFMV$useStyleProps, useDOMRef as $9XFMV$useDOMRef, classNames as $9XFMV$classNames} from "@react-spectrum/utils";
3
3
  import {filterDOMProps as $9XFMV$filterDOMProps} from "@react-aria/utils";
4
4
  import $9XFMV$react from "react";
@@ -68,7 +68,9 @@ function $77e0ac4d4aa3e5ef$var$Image(props, ref) {
68
68
  style: {
69
69
  objectFit: objectFit
70
70
  },
71
- className: (0, $9XFMV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cf2f2ea6e1c0495a$exports))), "spectrum-Image-img")
71
+ className: (0, $9XFMV$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($cf2f2ea6e1c0495a$exports))), "spectrum-Image-img"),
72
+ onError: props === null || props === void 0 ? void 0 : props.onError,
73
+ onLoad: props === null || props === void 0 ? void 0 : props.onLoad
72
74
  }));
73
75
  }
74
76
  /**
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;ACVD,IAAA;AAAA,4CAAuC,CAAC,yBAAyB,CAAC;;;;ADoBlE,0CAA0C;AAE1C,SAAS,4BAAM,KAAyB,EAAE,GAA2B;IACnE,uGAAuG,GACvG,IAAI,kBAAkB,MAAM,GAAG;IAC/B,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,aACF,SAAS,OACT,GAAG,OACH,GAAG,EACH,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,OAAO,MACT,QAAQ,IAAI,CACV;IAMJ,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,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,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;;AAGtC;AAEA;;CAEC,GACD,MAAM,0DAAS,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/image/src/index.ts","packages/@react-spectrum/image/src/Image.tsx","packages/@adobe/spectrum-css-temp/components/image/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/// <reference types=\"css-module-types\" />\n\nexport {Image} from './Image';\nexport type {SpectrumImageProps} from '@react-types/image';\n","/*\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, useDOMRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React from 'react';\nimport {SpectrumImageProps} from '@react-types/image';\nimport styles from '@adobe/spectrum-css-temp/components/image/vars.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n// incomplete component for show right now\n\nfunction 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 {\n objectFit,\n src,\n alt,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n if (alt == null) {\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 </div>\n );\n}\n\n/**\n * Image is used to insert and display an image within a component.\n */\nconst _Image = React.forwardRef(Image);\nexport {_Image as Image};\n","/*\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"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;ACVD,IAAA;AAAA,4CAAuC,CAAC,yBAAyB,CAAC;;;;ADoBlE,0CAA0C;AAE1C,SAAS,4BAAM,KAAyB,EAAE,GAA2B;IACnE,uGAAuG,GACvG,IAAI,kBAAkB,MAAM,GAAG;IAC/B,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,IAAI,aACF,SAAS,OACT,GAAG,OACH,GAAG,EACH,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,IAAI,OAAO,MACT,QAAQ,IAAI,CACV;IAMJ,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,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,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;QAC9B,OAAO,EAAE,kBAAA,4BAAA,MAAO,OAAO;QACvB,MAAM,EAAE,kBAAA,4BAAA,MAAO,MAAM;;AAG7B;AAEA;;CAEC,GACD,MAAM,0DAAS,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/image/src/index.ts","packages/@react-spectrum/image/src/Image.tsx","packages/@adobe/spectrum-css-temp/components/image/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/// <reference types=\"css-module-types\" />\n\nexport {Image} from './Image';\nexport type {SpectrumImageProps} from '@react-types/image';\n","/*\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, useDOMRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React from 'react';\nimport {SpectrumImageProps} from '@react-types/image';\nimport styles from '@adobe/spectrum-css-temp/components/image/vars.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n// incomplete component for show right now\n\nfunction 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 {\n objectFit,\n src,\n alt,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n\n if (alt == null) {\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 </div>\n );\n}\n\n/**\n * Image is used to insert and display an image within a component.\n */\nconst _Image = React.forwardRef(Image);\nexport {_Image as Image};\n","/*\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"],"names":[],"version":3,"file":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;AA+DA;;GAEG;AACH,OAAA,MAAM,2IAAgC,CAAC;ACnDvC,YAAY,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC","sources":["packages/@react-spectrum/image/src/packages/@react-spectrum/image/src/Image.tsx","packages/@react-spectrum/image/src/packages/@react-spectrum/image/src/index.ts","packages/@react-spectrum/image/src/index.ts"],"sourcesContent":[null,null,"/*\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/// <reference types=\"css-module-types\" />\n\nexport {Image} from './Image';\nexport type {SpectrumImageProps} from '@react-types/image';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAiEA;;GAEG;AACH,OAAA,MAAM,2IAAgC,CAAC;ACrDvC,YAAY,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC","sources":["packages/@react-spectrum/image/src/packages/@react-spectrum/image/src/Image.tsx","packages/@react-spectrum/image/src/packages/@react-spectrum/image/src/index.ts","packages/@react-spectrum/image/src/index.ts"],"sourcesContent":[null,null,"/*\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/// <reference types=\"css-module-types\" />\n\nexport {Image} from './Image';\nexport type {SpectrumImageProps} from '@react-types/image';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/image",
3
- "version": "3.4.12-nightly.4494+361d47080",
3
+ "version": "3.4.12-nightly.4506+4608dc5c3",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,14 +36,14 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/utils": "3.0.0-nightly.2782+361d47080",
40
- "@react-spectrum/utils": "3.0.0-nightly.2782+361d47080",
41
- "@react-types/image": "3.3.8-nightly.4494+361d47080",
42
- "@react-types/shared": "3.0.0-nightly.2782+361d47080",
39
+ "@react-aria/utils": "3.0.0-nightly.2794+4608dc5c3",
40
+ "@react-spectrum/utils": "3.0.0-nightly.2794+4608dc5c3",
41
+ "@react-types/image": "3.3.8-nightly.4506+4608dc5c3",
42
+ "@react-types/shared": "3.0.0-nightly.2794+4608dc5c3",
43
43
  "@swc/helpers": "^0.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@adobe/spectrum-css-temp": "3.0.0-nightly.2782+361d47080"
46
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2794+4608dc5c3"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@react-spectrum/provider": "^3.0.0",
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "361d47080c79e4d52ee287078b9e3c27ed312f2e"
55
+ "gitHead": "4608dc5c390e87bec882a1c8ecd0e585fcf6b404"
56
56
  }
package/src/Image.tsx CHANGED
@@ -56,7 +56,9 @@ function Image(props: SpectrumImageProps, ref: DOMRef<HTMLDivElement>) {
56
56
  src={src}
57
57
  alt={userProvidedAlt || alt}
58
58
  style={{objectFit}}
59
- className={classNames(styles, 'spectrum-Image-img')} />
59
+ className={classNames(styles, 'spectrum-Image-img')}
60
+ onError={props?.onError}
61
+ onLoad={props?.onLoad} />
60
62
  </div>
61
63
  );
62
64
  }