@react-spectrum/avatar 3.0.17 → 3.0.19
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/Avatar.main.js +2 -5
- package/dist/Avatar.main.js.map +1 -1
- package/dist/Avatar.mjs +2 -5
- package/dist/Avatar.module.js +2 -5
- package/dist/Avatar.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/Avatar.tsx +5 -8
package/dist/Avatar.main.js
CHANGED
|
@@ -32,7 +32,7 @@ $parcel$export(module.exports, "Avatar", () => $cc830936d47bae2b$export$e2255cf6
|
|
|
32
32
|
|
|
33
33
|
const $cc830936d47bae2b$var$DEFAULT_SIZE = 'avatar-size-100';
|
|
34
34
|
const $cc830936d47bae2b$var$SIZE_RE = /^size-\d+/;
|
|
35
|
-
|
|
35
|
+
const $cc830936d47bae2b$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $3FJGB$react.forwardRef)(function Avatar(props, ref) {
|
|
36
36
|
props = (0, $3FJGB$reactspectrumutils.useSlotProps)(props, 'avatar');
|
|
37
37
|
const { alt: alt = '', isDisabled: isDisabled, size: size = $cc830936d47bae2b$var$DEFAULT_SIZE, src: src, ...otherProps } = (0, $3FJGB$reactspectrumprovider.useProviderProps)(props);
|
|
38
38
|
const { styleProps: styleProps } = (0, $3FJGB$reactspectrumutils.useStyleProps)(otherProps);
|
|
@@ -59,10 +59,7 @@ function $cc830936d47bae2b$var$Avatar(props, ref) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* An avatar is a thumbnail representation of an entity, such as a user or an organization.
|
|
65
|
-
*/ const $cc830936d47bae2b$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $3FJGB$react.forwardRef)($cc830936d47bae2b$var$Avatar);
|
|
62
|
+
});
|
|
66
63
|
|
|
67
64
|
|
|
68
65
|
//# sourceMappingURL=Avatar.main.js.map
|
package/dist/Avatar.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,MAAM,qCAAe;AACrB,MAAM,gCAAU;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,MAAM,qCAAe;AACrB,MAAM,gCAAU;AAKT,MAAM,0DAAS,CAAA,GAAA,uBAAS,EAAE,SAAS,OAAO,KAA0B,EAAE,GAA6B;IACxG,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,MAAM,OACJ,MAAM,gBACN,UAAU,QACV,OAAO,yCACP,GAAG,EACH,GAAG,YACJ,GAAG,CAAA,GAAA,6CAAe,EAAE;IAErB,MAAM,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACnC,MAAM,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEzB,MAAM,WAAW,CAAA,GAAA,oCAAa,EAAE;IAEhC,2EAA2E;IAC3E,2DAA2D;IAC3D,MAAM,YAAY,OAAO,SAAS,YAAa,CAAA,8BAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,KAAW,IACnF,CAAA,GAAA,wCAAa,EAAE,oCAAc,kCAAkC;OAC/D,CAAA,GAAA,wCAAa,EAAE,QAAQ;IAE3B,qBACE,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,QAAQ;QACZ,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,mBACA;YACE,eAAe;QACjB,GACA,WAAW,SAAS;QACtB,KAAK;QACL,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,GAAI,aAAa;gBAAC,QAAQ;gBAAW,OAAO;YAAS,CAAC;QACxD;;AAEN","sources":["packages/@react-spectrum/avatar/src/Avatar.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, dimensionValue, useDOMRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumAvatarProps} from '@react-types/avatar';\nimport styles from '@adobe/spectrum-css-temp/components/avatar/vars.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nconst DEFAULT_SIZE = 'avatar-size-100';\nconst SIZE_RE = /^size-\\d+/;\n\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nexport const Avatar = forwardRef(function Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {\n props = useSlotProps(props, 'avatar');\n const {\n alt = '',\n isDisabled,\n size = DEFAULT_SIZE,\n src,\n ...otherProps\n } = useProviderProps(props);\n\n const {styleProps} = useStyleProps(otherProps);\n const domRef = useDOMRef(ref);\n\n const domProps = filterDOMProps(otherProps);\n\n // Casting `size` as `any` since `isNaN` expects a `number`, but we want it\n // to handle `string` numbers; e.g. '300' as opposed to 300\n const sizeValue = typeof size !== 'number' && (SIZE_RE.test(size) || !isNaN(size as any))\n ? dimensionValue(DEFAULT_SIZE) // override disallowed size values\n : dimensionValue(size || DEFAULT_SIZE);\n\n return (\n <img\n {...styleProps}\n {...domProps}\n alt={alt}\n className={classNames(\n styles,\n 'spectrum-Avatar',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className)}\n ref={domRef}\n src={src}\n style={{\n ...styleProps.style,\n ...(sizeValue && {height: sizeValue, width: sizeValue})\n }} />\n );\n});\n"],"names":[],"version":3,"file":"Avatar.main.js.map"}
|
package/dist/Avatar.mjs
CHANGED
|
@@ -26,7 +26,7 @@ function $parcel$interopDefault(a) {
|
|
|
26
26
|
|
|
27
27
|
const $ab0b7b2186c39312$var$DEFAULT_SIZE = 'avatar-size-100';
|
|
28
28
|
const $ab0b7b2186c39312$var$SIZE_RE = /^size-\d+/;
|
|
29
|
-
|
|
29
|
+
const $ab0b7b2186c39312$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $73onX$forwardRef)(function Avatar(props, ref) {
|
|
30
30
|
props = (0, $73onX$useSlotProps)(props, 'avatar');
|
|
31
31
|
const { alt: alt = '', isDisabled: isDisabled, size: size = $ab0b7b2186c39312$var$DEFAULT_SIZE, src: src, ...otherProps } = (0, $73onX$useProviderProps)(props);
|
|
32
32
|
const { styleProps: styleProps } = (0, $73onX$useStyleProps)(otherProps);
|
|
@@ -53,10 +53,7 @@ function $ab0b7b2186c39312$var$Avatar(props, ref) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* An avatar is a thumbnail representation of an entity, such as a user or an organization.
|
|
59
|
-
*/ const $ab0b7b2186c39312$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $73onX$forwardRef)($ab0b7b2186c39312$var$Avatar);
|
|
56
|
+
});
|
|
60
57
|
|
|
61
58
|
|
|
62
59
|
export {$ab0b7b2186c39312$export$e2255cf6045e8d47 as Avatar};
|
package/dist/Avatar.module.js
CHANGED
|
@@ -26,7 +26,7 @@ function $parcel$interopDefault(a) {
|
|
|
26
26
|
|
|
27
27
|
const $ab0b7b2186c39312$var$DEFAULT_SIZE = 'avatar-size-100';
|
|
28
28
|
const $ab0b7b2186c39312$var$SIZE_RE = /^size-\d+/;
|
|
29
|
-
|
|
29
|
+
const $ab0b7b2186c39312$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $73onX$forwardRef)(function Avatar(props, ref) {
|
|
30
30
|
props = (0, $73onX$useSlotProps)(props, 'avatar');
|
|
31
31
|
const { alt: alt = '', isDisabled: isDisabled, size: size = $ab0b7b2186c39312$var$DEFAULT_SIZE, src: src, ...otherProps } = (0, $73onX$useProviderProps)(props);
|
|
32
32
|
const { styleProps: styleProps } = (0, $73onX$useStyleProps)(otherProps);
|
|
@@ -53,10 +53,7 @@ function $ab0b7b2186c39312$var$Avatar(props, ref) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* An avatar is a thumbnail representation of an entity, such as a user or an organization.
|
|
59
|
-
*/ const $ab0b7b2186c39312$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $73onX$forwardRef)($ab0b7b2186c39312$var$Avatar);
|
|
56
|
+
});
|
|
60
57
|
|
|
61
58
|
|
|
62
59
|
export {$ab0b7b2186c39312$export$e2255cf6045e8d47 as Avatar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,MAAM,qCAAe;AACrB,MAAM,gCAAU;
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,MAAM,qCAAe;AACrB,MAAM,gCAAU;AAKT,MAAM,0DAAS,CAAA,GAAA,iBAAS,EAAE,SAAS,OAAO,KAA0B,EAAE,GAA6B;IACxG,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,MAAM,OACJ,MAAM,gBACN,UAAU,QACV,OAAO,yCACP,GAAG,EACH,GAAG,YACJ,GAAG,CAAA,GAAA,uBAAe,EAAE;IAErB,MAAM,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACnC,MAAM,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEzB,MAAM,WAAW,CAAA,GAAA,qBAAa,EAAE;IAEhC,2EAA2E;IAC3E,2DAA2D;IAC3D,MAAM,YAAY,OAAO,SAAS,YAAa,CAAA,8BAAQ,IAAI,CAAC,SAAS,CAAC,MAAM,KAAW,IACnF,CAAA,GAAA,qBAAa,EAAE,oCAAc,kCAAkC;OAC/D,CAAA,GAAA,qBAAa,EAAE,QAAQ;IAE3B,qBACE,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,QAAQ;QACZ,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,wDAAK,GACL,mBACA;YACE,eAAe;QACjB,GACA,WAAW,SAAS;QACtB,KAAK;QACL,KAAK;QACL,OAAO;YACL,GAAG,WAAW,KAAK;YACnB,GAAI,aAAa;gBAAC,QAAQ;gBAAW,OAAO;YAAS,CAAC;QACxD;;AAEN","sources":["packages/@react-spectrum/avatar/src/Avatar.tsx"],"sourcesContent":["/*\n * Copyright 2021 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, dimensionValue, useDOMRef, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumAvatarProps} from '@react-types/avatar';\nimport styles from '@adobe/spectrum-css-temp/components/avatar/vars.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nconst DEFAULT_SIZE = 'avatar-size-100';\nconst SIZE_RE = /^size-\\d+/;\n\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nexport const Avatar = forwardRef(function Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {\n props = useSlotProps(props, 'avatar');\n const {\n alt = '',\n isDisabled,\n size = DEFAULT_SIZE,\n src,\n ...otherProps\n } = useProviderProps(props);\n\n const {styleProps} = useStyleProps(otherProps);\n const domRef = useDOMRef(ref);\n\n const domProps = filterDOMProps(otherProps);\n\n // Casting `size` as `any` since `isNaN` expects a `number`, but we want it\n // to handle `string` numbers; e.g. '300' as opposed to 300\n const sizeValue = typeof size !== 'number' && (SIZE_RE.test(size) || !isNaN(size as any))\n ? dimensionValue(DEFAULT_SIZE) // override disallowed size values\n : dimensionValue(size || DEFAULT_SIZE);\n\n return (\n <img\n {...styleProps}\n {...domProps}\n alt={alt}\n className={classNames(\n styles,\n 'spectrum-Avatar',\n {\n 'is-disabled': isDisabled\n },\n styleProps.className)}\n ref={domRef}\n src={src}\n style={{\n ...styleProps.style,\n ...(sizeValue && {height: sizeValue, width: sizeValue})\n }} />\n );\n});\n"],"names":[],"version":3,"file":"Avatar.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;
|
|
1
|
+
{"mappings":";;;AAuBA;;GAEG;AACH,OAAO,MAAM,iHAwCX,CAAC;ACrDH,YAAY,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-spectrum/avatar/src/packages/@react-spectrum/avatar/src/Avatar.tsx","packages/@react-spectrum/avatar/src/packages/@react-spectrum/avatar/src/index.ts","packages/@react-spectrum/avatar/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2021 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/// <reference types=\"css-module-types\" />\nexport {Avatar} from './Avatar';\nexport type {SpectrumAvatarProps} from '@react-types/avatar';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/avatar",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.19",
|
|
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.
|
|
40
|
-
"@react-spectrum/utils": "^3.12.
|
|
41
|
-
"@react-types/avatar": "^3.0.
|
|
42
|
-
"@react-types/shared": "^3.
|
|
39
|
+
"@react-aria/utils": "^3.28.0",
|
|
40
|
+
"@react-spectrum/utils": "^3.12.2",
|
|
41
|
+
"@react-types/avatar": "^3.0.13",
|
|
42
|
+
"@react-types/shared": "^3.28.0",
|
|
43
43
|
"@swc/helpers": "^0.5.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -47,10 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@react-spectrum/provider": "^3.2.1",
|
|
50
|
-
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
50
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
|
|
51
|
+
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
|
|
56
57
|
}
|
package/src/Avatar.tsx
CHANGED
|
@@ -21,7 +21,10 @@ import {useProviderProps} from '@react-spectrum/provider';
|
|
|
21
21
|
const DEFAULT_SIZE = 'avatar-size-100';
|
|
22
22
|
const SIZE_RE = /^size-\d+/;
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* An avatar is a thumbnail representation of an entity, such as a user or an organization.
|
|
26
|
+
*/
|
|
27
|
+
export const Avatar = forwardRef(function Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {
|
|
25
28
|
props = useSlotProps(props, 'avatar');
|
|
26
29
|
const {
|
|
27
30
|
alt = '',
|
|
@@ -61,10 +64,4 @@ function Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {
|
|
|
61
64
|
...(sizeValue && {height: sizeValue, width: sizeValue})
|
|
62
65
|
}} />
|
|
63
66
|
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* An avatar is a thumbnail representation of an entity, such as a user or an organization.
|
|
68
|
-
*/
|
|
69
|
-
const _Avatar = forwardRef(Avatar);
|
|
70
|
-
export {_Avatar as Avatar};
|
|
67
|
+
});
|