@react-spectrum/image 3.5.8 → 3.5.10
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/Image.main.js +2 -2
- package/dist/Image.main.js.map +1 -1
- package/dist/Image.mjs +2 -2
- package/dist/Image.module.js +2 -2
- package/dist/Image.module.js.map +1 -1
- package/dist/{vars.ed1277c0.css → image.e67161ea.css} +1 -1
- package/dist/{vars.ed1277c0.css.map → image.e67161ea.css.map} +1 -1
- package/package.json +6 -6
- package/src/Image.tsx +1 -1
package/dist/Image.main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./
|
|
1
|
+
require("./image.e67161ea.css");
|
|
2
2
|
var $ec6587ec6732a958$exports = require("./image_vars_css.main.js");
|
|
3
3
|
var $lyGvT$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
4
|
var $lyGvT$reactariautils = require("@react-aria/utils");
|
|
@@ -37,7 +37,7 @@ const $bda2e7b47de3a920$export$3e431a229df88919 = /*#__PURE__*/ (0, ($parcel$int
|
|
|
37
37
|
let { objectFit: objectFit, src: src, alt: alt, ...otherProps } = props;
|
|
38
38
|
let { styleProps: styleProps } = (0, $lyGvT$reactspectrumutils.useStyleProps)(otherProps);
|
|
39
39
|
let domRef = (0, $lyGvT$reactspectrumutils.useDOMRef)(ref);
|
|
40
|
-
if (alt == null) console.warn('The `alt` prop was not provided to an image. Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image is decorative or redundant with displayed text and should not be announced by screen readers.');
|
|
40
|
+
if (alt == null && process.env.NODE_ENV !== 'production') console.warn('The `alt` prop was not provided to an image. Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image is decorative or redundant with displayed text and should not be announced by screen readers.');
|
|
41
41
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($lyGvT$react))).createElement("div", {
|
|
42
42
|
...(0, $lyGvT$reactariautils.filterDOMProps)(props),
|
|
43
43
|
...styleProps,
|
package/dist/Image.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ACL,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,mDAAK,GAAG;QAC9B,OAAO,EAAE,kBAAA,4BAAA,MAAO,OAAO;QACvB,MAAM,EAAE,kBAAA,4BAAA,MAAO,MAAM;;AAG7B","sources":["packages/@react-spectrum/image/src/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, 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/**\n * Image is used to insert and display an image within a component.\n */\nexport const Image = React.forwardRef(// 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 && 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 </div>\n );\n});\n"],"names":[],"version":3,"file":"Image.main.js.map"}
|
package/dist/Image.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./image.e67161ea.css";
|
|
2
2
|
import $6cGum$image_vars_cssmodulejs from "./image_vars_css.mjs";
|
|
3
3
|
import {useSlotProps as $6cGum$useSlotProps, useStyleProps as $6cGum$useStyleProps, useDOMRef as $6cGum$useDOMRef, classNames as $6cGum$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {filterDOMProps as $6cGum$filterDOMProps} from "@react-aria/utils";
|
|
@@ -31,7 +31,7 @@ const $77e0ac4d4aa3e5ef$export$3e431a229df88919 = /*#__PURE__*/ (0, $6cGum$react
|
|
|
31
31
|
let { objectFit: objectFit, src: src, alt: alt, ...otherProps } = props;
|
|
32
32
|
let { styleProps: styleProps } = (0, $6cGum$useStyleProps)(otherProps);
|
|
33
33
|
let domRef = (0, $6cGum$useDOMRef)(ref);
|
|
34
|
-
if (alt == null) console.warn('The `alt` prop was not provided to an image. Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image is decorative or redundant with displayed text and should not be announced by screen readers.');
|
|
34
|
+
if (alt == null && process.env.NODE_ENV !== 'production') console.warn('The `alt` prop was not provided to an image. Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image is decorative or redundant with displayed text and should not be announced by screen readers.');
|
|
35
35
|
return /*#__PURE__*/ (0, $6cGum$react).createElement("div", {
|
|
36
36
|
...(0, $6cGum$filterDOMProps)(props),
|
|
37
37
|
...styleProps,
|
package/dist/Image.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./image.e67161ea.css";
|
|
2
2
|
import $6cGum$image_vars_cssmodulejs from "./image_vars_css.module.js";
|
|
3
3
|
import {useSlotProps as $6cGum$useSlotProps, useStyleProps as $6cGum$useStyleProps, useDOMRef as $6cGum$useDOMRef, classNames as $6cGum$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {filterDOMProps as $6cGum$filterDOMProps} from "@react-aria/utils";
|
|
@@ -31,7 +31,7 @@ const $77e0ac4d4aa3e5ef$export$3e431a229df88919 = /*#__PURE__*/ (0, $6cGum$react
|
|
|
31
31
|
let { objectFit: objectFit, src: src, alt: alt, ...otherProps } = props;
|
|
32
32
|
let { styleProps: styleProps } = (0, $6cGum$useStyleProps)(otherProps);
|
|
33
33
|
let domRef = (0, $6cGum$useDOMRef)(ref);
|
|
34
|
-
if (alt == null) console.warn('The `alt` prop was not provided to an image. Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image is decorative or redundant with displayed text and should not be announced by screen readers.');
|
|
34
|
+
if (alt == null && process.env.NODE_ENV !== 'production') console.warn('The `alt` prop was not provided to an image. Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image is decorative or redundant with displayed text and should not be announced by screen readers.');
|
|
35
35
|
return /*#__PURE__*/ (0, $6cGum$react).createElement("div", {
|
|
36
36
|
...(0, $6cGum$filterDOMProps)(props),
|
|
37
37
|
...styleProps,
|
package/dist/Image.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAaM,MAAM,0DAAQ,CAAA,GAAA,YAAI,EAAE,UAAU,CAErC,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnE,uGAAuG,GACvG,IAAI,kBAAkB,MAAM,GAAG;IAC/B,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,QAAQ,CAAA,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"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, 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/**\n * Image is used to insert and display an image within a component.\n */\nexport const Image = React.forwardRef(// 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 && 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 </div>\n );\n});\n"],"names":[],"version":3,"file":"Image.module.js.map"}
|
|
@@ -1 +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":"
|
|
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":"image.e67161ea.css.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/image",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.10",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/utils": "^3.28.
|
|
40
|
-
"@react-spectrum/utils": "^3.12.
|
|
41
|
-
"@react-types/image": "^3.4.
|
|
42
|
-
"@react-types/shared": "^3.
|
|
39
|
+
"@react-aria/utils": "^3.28.2",
|
|
40
|
+
"@react-spectrum/utils": "^3.12.4",
|
|
41
|
+
"@react-types/image": "^3.4.8",
|
|
42
|
+
"@react-types/shared": "^3.29.0",
|
|
43
43
|
"@swc/helpers": "^0.5.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
|
|
57
57
|
}
|
package/src/Image.tsx
CHANGED
|
@@ -37,7 +37,7 @@ function Image(props: SpectrumImageProps, ref: DOMRef<HTMLDivElement>) {
|
|
|
37
37
|
let {styleProps} = useStyleProps(otherProps);
|
|
38
38
|
let domRef = useDOMRef(ref);
|
|
39
39
|
|
|
40
|
-
if (alt == null) {
|
|
40
|
+
if (alt == null && process.env.NODE_ENV !== 'production') {
|
|
41
41
|
console.warn(
|
|
42
42
|
'The `alt` prop was not provided to an image. ' +
|
|
43
43
|
'Add `alt` text for screen readers, or set `alt=""` prop to indicate that the image ' +
|