@react-spectrum/avatar 3.0.0-alpha.1 → 3.0.0-alpha.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/main.js CHANGED
@@ -1,65 +1,48 @@
1
1
  require("./main.css");
2
- var $d6Pi2$reactspectrumutils = require("@react-spectrum/utils");
3
- var $d6Pi2$reactariautils = require("@react-aria/utils");
4
- var $d6Pi2$react = require("react");
5
- var $d6Pi2$reactspectrumprovider = require("@react-spectrum/provider");
2
+ var $hTGwy$reactspectrumutils = require("@react-spectrum/utils");
3
+ var $hTGwy$reactariautils = require("@react-aria/utils");
4
+ var $hTGwy$react = require("react");
5
+ var $hTGwy$reactspectrumprovider = require("@react-spectrum/provider");
6
6
 
7
- function $parcel$exportWildcard(dest, source) {
8
- Object.keys(source).forEach(function(key) {
9
- if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
10
- return;
11
- }
12
-
13
- Object.defineProperty(dest, key, {
14
- enumerable: true,
15
- get: function get() {
16
- return source[key];
17
- }
18
- });
19
- });
20
-
21
- return dest;
7
+ function $parcel$export(e, n, v, s) {
8
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
22
9
  }
23
10
  function $parcel$interopDefault(a) {
24
11
  return a && a.__esModule ? a.default : a;
25
12
  }
26
- function $parcel$export(e, n, v, s) {
27
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
28
- }
29
- var $b2100e1779e6b01d$exports = {};
30
13
 
31
- $parcel$export($b2100e1779e6b01d$exports, "Avatar", () => $b2100e1779e6b01d$export$e2255cf6045e8d47);
14
+ $parcel$export(module.exports, "Avatar", () => $cc830936d47bae2b$export$e2255cf6045e8d47);
32
15
 
33
16
 
34
17
 
35
- var $9299bbd9c45a760c$exports = {};
18
+ var $d22788318b5f79eb$exports = {};
36
19
 
37
- $parcel$export($9299bbd9c45a760c$exports, "spectrum-Avatar", () => $9299bbd9c45a760c$export$2e049b8d031600fb, (v) => $9299bbd9c45a760c$export$2e049b8d031600fb = v);
38
- $parcel$export($9299bbd9c45a760c$exports, "is-disabled", () => $9299bbd9c45a760c$export$d35bc1e505d1ebbf, (v) => $9299bbd9c45a760c$export$d35bc1e505d1ebbf = v);
39
- var $9299bbd9c45a760c$export$2e049b8d031600fb;
40
- var $9299bbd9c45a760c$export$d35bc1e505d1ebbf;
41
- $9299bbd9c45a760c$export$2e049b8d031600fb = "spectrum-Avatar_2ebb13";
42
- $9299bbd9c45a760c$export$d35bc1e505d1ebbf = "is-disabled_2ebb13";
20
+ $parcel$export($d22788318b5f79eb$exports, "spectrum-Avatar", () => $d22788318b5f79eb$export$2e049b8d031600fb, (v) => $d22788318b5f79eb$export$2e049b8d031600fb = v);
21
+ $parcel$export($d22788318b5f79eb$exports, "is-disabled", () => $d22788318b5f79eb$export$d35bc1e505d1ebbf, (v) => $d22788318b5f79eb$export$d35bc1e505d1ebbf = v);
22
+ var $d22788318b5f79eb$export$2e049b8d031600fb;
23
+ var $d22788318b5f79eb$export$d35bc1e505d1ebbf;
24
+ $d22788318b5f79eb$export$2e049b8d031600fb = "spectrum-Avatar_2ebb13";
25
+ $d22788318b5f79eb$export$d35bc1e505d1ebbf = "is-disabled_2ebb13";
43
26
 
44
27
 
45
28
 
46
- const $b2100e1779e6b01d$var$DEFAULT_SIZE = 'avatar-size-100';
47
- const $b2100e1779e6b01d$var$SIZE_RE = /^size-\d+/;
48
- function $b2100e1779e6b01d$var$Avatar(props, ref) {
49
- props = $d6Pi2$reactspectrumutils.useSlotProps(props, 'avatar');
50
- const { alt: alt = '' , isDisabled: isDisabled , size: size , src: src , ...otherProps } = $d6Pi2$reactspectrumprovider.useProviderProps(props);
51
- const { styleProps: styleProps } = $d6Pi2$reactspectrumutils.useStyleProps(otherProps);
52
- const domRef = $d6Pi2$reactspectrumutils.useDOMRef(ref);
53
- const domProps = $d6Pi2$reactariautils.filterDOMProps(otherProps);
29
+ const $cc830936d47bae2b$var$DEFAULT_SIZE = 'avatar-size-100';
30
+ const $cc830936d47bae2b$var$SIZE_RE = /^size-\d+/;
31
+ function $cc830936d47bae2b$var$Avatar(props, ref) {
32
+ props = $hTGwy$reactspectrumutils.useSlotProps(props, 'avatar');
33
+ const { alt: alt = '' , isDisabled: isDisabled , size: size , src: src , ...otherProps } = $hTGwy$reactspectrumprovider.useProviderProps(props);
34
+ const { styleProps: styleProps } = $hTGwy$reactspectrumutils.useStyleProps(otherProps);
35
+ const domRef = $hTGwy$reactspectrumutils.useDOMRef(ref);
36
+ const domProps = $hTGwy$reactariautils.filterDOMProps(otherProps);
54
37
  // Casting `size` as `any` since `isNaN` expects a `number`, but we want it
55
38
  // to handle `string` numbers; e.g. '300' as opposed to 300
56
- const sizeValue = typeof size !== 'number' && ($b2100e1779e6b01d$var$SIZE_RE.test(size) || !isNaN(size)) ? $d6Pi2$reactspectrumutils.dimensionValue($b2100e1779e6b01d$var$DEFAULT_SIZE) // override disallowed size values
57
- : $d6Pi2$reactspectrumutils.dimensionValue(size || $b2100e1779e6b01d$var$DEFAULT_SIZE);
58
- return(/*#__PURE__*/ ($parcel$interopDefault($d6Pi2$react)).createElement("img", {
39
+ const sizeValue = typeof size !== 'number' && ($cc830936d47bae2b$var$SIZE_RE.test(size) || !isNaN(size)) ? $hTGwy$reactspectrumutils.dimensionValue($cc830936d47bae2b$var$DEFAULT_SIZE) // override disallowed size values
40
+ : $hTGwy$reactspectrumutils.dimensionValue(size || $cc830936d47bae2b$var$DEFAULT_SIZE);
41
+ return(/*#__PURE__*/ ($parcel$interopDefault($hTGwy$react)).createElement("img", {
59
42
  ...styleProps,
60
43
  ...domProps,
61
44
  alt: alt,
62
- className: $d6Pi2$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($9299bbd9c45a760c$exports)), 'spectrum-Avatar', {
45
+ className: $hTGwy$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($d22788318b5f79eb$exports)), 'spectrum-Avatar', {
63
46
  'is-disabled': isDisabled
64
47
  }, styleProps.className),
65
48
  ref: domRef,
@@ -75,10 +58,9 @@ function $b2100e1779e6b01d$var$Avatar(props, ref) {
75
58
  }
76
59
  /**
77
60
  * An avatar is a thumbnail representation of an entity, such as a user or an organization.
78
- */ const $b2100e1779e6b01d$export$e2255cf6045e8d47 = /*#__PURE__*/ $d6Pi2$react.forwardRef($b2100e1779e6b01d$var$Avatar);
61
+ */ const $cc830936d47bae2b$export$e2255cf6045e8d47 = /*#__PURE__*/ $hTGwy$react.forwardRef($cc830936d47bae2b$var$Avatar);
79
62
 
80
63
 
81
- $parcel$exportWildcard(module.exports, $b2100e1779e6b01d$exports);
82
64
 
83
65
 
84
66
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAiC;AACjC,GAA6B;AAD7B,yCAAiC,GAAG,CAAwB;AAC5D,yCAA6B,GAAG,CAAoB;;;;ADmBpD,KAAK,CAAC,kCAAY,GAAG,CAAiB;AACtC,KAAK,CAAC,6BAAO;SAEJ,4BAAM,CAAC,KAA0B,EAAE,GAA6B,EAAE,CAAC;IAC1E,KAAK,GAAG,sCAAY,CAAC,KAAK,EAAE,CAAQ;IACpC,KAAK,CAAC,CAAC,MACL,GAAG,GAAG,CAAE,gBACR,UAAU,SACV,IAAI,QACJ,GAAG,MACA,UAAU,CACf,CAAC,GAAG,6CAAgB,CAAC,KAAK;IAE1B,KAAK,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,uCAAa,CAAC,UAAU;IAC7C,KAAK,CAAC,MAAM,GAAG,mCAAS,CAAC,GAAG;IAE5B,KAAK,CAAC,QAAQ,GAAG,oCAAc,CAAC,UAAU;IAE1C,EAA2E,AAA3E,yEAA2E;IAC3E,EAA2D,AAA3D,yDAA2D;IAC3D,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,KAAK,CAAQ,YAAK,6BAAO,CAAC,IAAI,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,KAC5E,wCAAc,CAAC,kCAAY,CAAE,CAAkC,AAAlC,EAAkC,AAAlC,gCAAkC;OAC/D,wCAAc,CAAC,IAAI,IAAI,kCAAY;IAEvC,MAAM,oEACH,CAAG;WACE,UAAU;WACV,QAAQ;QACZ,GAAG,EAAE,GAAG;QACR,SAAS,EAAE,oCAAU,CACnB,gEAAM,EACN,CAAiB,kBACjB,CAAC;YACC,CAAa,cAAE,UAAU;QAC3B,CAAC,EACD,UAAU,CAAC,SAAS;QACtB,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,CAAC;eACH,UAAU,CAAC,KAAK;eACf,SAAS,IAAI,CAAC;gBAAA,MAAM,EAAE,SAAS;gBAAE,KAAK,EAAE,SAAS;YAAA,CAAC;QACxD,CAAC;;AAEP,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,KAAK,CAAC,yCAAO,iBAAG,uBAAU,CAAC,4BAAM","sources":["packages/@react-spectrum/avatar/src/index.ts","packages/@react-spectrum/avatar/src/Avatar.tsx","packages/@adobe/spectrum-css-temp/components/avatar/vars.css"],"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\n/// <reference types=\"css-module-types\" />\n\nexport * from './Avatar';\n","/*\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\nfunction Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {\n props = useSlotProps(props, 'avatar');\n const {\n alt = '',\n isDisabled,\n 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\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nconst _Avatar = forwardRef(Avatar);\nexport {_Avatar as Avatar};\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@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AEAA,GAAiC;AACjC,GAA6B;AAD7B,yCAAiC,GAAG,CAAwB;AAC5D,yCAA6B,GAAG,CAAoB;;;;ADmBpD,KAAK,CAAC,kCAAY,GAAG,CAAiB;AACtC,KAAK,CAAC,6BAAO;SAEJ,4BAAM,CAAC,KAA0B,EAAE,GAA6B,EAAE,CAAC;IAC1E,KAAK,GAAG,sCAAY,CAAC,KAAK,EAAE,CAAQ;IACpC,KAAK,CAAC,CAAC,MACL,GAAG,GAAG,CAAE,gBACR,UAAU,SACV,IAAI,QACJ,GAAG,MACA,UAAU,CACf,CAAC,GAAG,6CAAgB,CAAC,KAAK;IAE1B,KAAK,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,uCAAa,CAAC,UAAU;IAC7C,KAAK,CAAC,MAAM,GAAG,mCAAS,CAAC,GAAG;IAE5B,KAAK,CAAC,QAAQ,GAAG,oCAAc,CAAC,UAAU;IAE1C,EAA2E,AAA3E,yEAA2E;IAC3E,EAA2D,AAA3D,yDAA2D;IAC3D,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,KAAK,CAAQ,YAAK,6BAAO,CAAC,IAAI,CAAC,IAAI,MAAM,KAAK,CAAC,IAAI,KAC5E,wCAAc,CAAC,kCAAY,CAAE,CAAkC,AAAlC,EAAkC,AAAlC,gCAAkC;OAC/D,wCAAc,CAAC,IAAI,IAAI,kCAAY;IAEvC,MAAM,oEACH,CAAG;WACE,UAAU;WACV,QAAQ;QACZ,GAAG,EAAE,GAAG;QACR,SAAS,EAAE,oCAAU,CACnB,gEAAM,EACN,CAAiB,kBACjB,CAAC;YACC,CAAa,cAAE,UAAU;QAC3B,CAAC,EACD,UAAU,CAAC,SAAS;QACtB,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,CAAC;eACH,UAAU,CAAC,KAAK;eACf,SAAS,IAAI,CAAC;gBAAA,MAAM,EAAE,SAAS;gBAAE,KAAK,EAAE,SAAS;YAAA,CAAC;QACxD,CAAC;;AAEP,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,KAAK,CAAC,yCAAO,iBAAG,uBAAU,CAAC,4BAAM","sources":["packages/@react-spectrum/avatar/src/index.ts","packages/@react-spectrum/avatar/src/Avatar.tsx","packages/@adobe/spectrum-css-temp/components/avatar/vars.css"],"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/// <reference types=\"css-module-types\" />\nexport {Avatar} from './Avatar';\nexport type {SpectrumAvatarProps} from '@react-types/avatar';\n","/*\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\nfunction Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {\n props = useSlotProps(props, 'avatar');\n const {\n alt = '',\n isDisabled,\n 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\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nconst _Avatar = forwardRef(Avatar);\nexport {_Avatar as Avatar};\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@import './skin.css';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "./main.css";
2
- import {useSlotProps as $5tAoP$useSlotProps, useStyleProps as $5tAoP$useStyleProps, useDOMRef as $5tAoP$useDOMRef, dimensionValue as $5tAoP$dimensionValue, classNames as $5tAoP$classNames} from "@react-spectrum/utils";
3
- import {filterDOMProps as $5tAoP$filterDOMProps} from "@react-aria/utils";
4
- import $5tAoP$react, {forwardRef as $5tAoP$forwardRef} from "react";
5
- import {useProviderProps as $5tAoP$useProviderProps} from "@react-spectrum/provider";
2
+ import {useSlotProps as $85w8l$useSlotProps, useStyleProps as $85w8l$useStyleProps, useDOMRef as $85w8l$useDOMRef, dimensionValue as $85w8l$dimensionValue, classNames as $85w8l$classNames} from "@react-spectrum/utils";
3
+ import {filterDOMProps as $85w8l$filterDOMProps} from "@react-aria/utils";
4
+ import $85w8l$react, {forwardRef as $85w8l$forwardRef} from "react";
5
+ import {useProviderProps as $85w8l$useProviderProps} from "@react-spectrum/provider";
6
6
 
7
7
  function $parcel$interopDefault(a) {
8
8
  return a && a.__esModule ? a.default : a;
@@ -10,40 +10,37 @@ function $parcel$interopDefault(a) {
10
10
  function $parcel$export(e, n, v, s) {
11
11
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
12
12
  }
13
- var $8849a664c31dd3e9$exports = {};
14
13
 
15
- $parcel$export($8849a664c31dd3e9$exports, "Avatar", () => $8849a664c31dd3e9$export$e2255cf6045e8d47);
16
14
 
17
15
 
16
+ var $f81b9c4eea42ecfe$exports = {};
18
17
 
19
- var $b521db8745125e0a$exports = {};
18
+ $parcel$export($f81b9c4eea42ecfe$exports, "spectrum-Avatar", () => $f81b9c4eea42ecfe$export$2e049b8d031600fb, (v) => $f81b9c4eea42ecfe$export$2e049b8d031600fb = v);
19
+ $parcel$export($f81b9c4eea42ecfe$exports, "is-disabled", () => $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf, (v) => $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf = v);
20
+ var $f81b9c4eea42ecfe$export$2e049b8d031600fb;
21
+ var $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf;
22
+ $f81b9c4eea42ecfe$export$2e049b8d031600fb = "spectrum-Avatar_2ebb13";
23
+ $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf = "is-disabled_2ebb13";
20
24
 
21
- $parcel$export($b521db8745125e0a$exports, "spectrum-Avatar", () => $b521db8745125e0a$export$2e049b8d031600fb, (v) => $b521db8745125e0a$export$2e049b8d031600fb = v);
22
- $parcel$export($b521db8745125e0a$exports, "is-disabled", () => $b521db8745125e0a$export$d35bc1e505d1ebbf, (v) => $b521db8745125e0a$export$d35bc1e505d1ebbf = v);
23
- var $b521db8745125e0a$export$2e049b8d031600fb;
24
- var $b521db8745125e0a$export$d35bc1e505d1ebbf;
25
- $b521db8745125e0a$export$2e049b8d031600fb = "spectrum-Avatar_2ebb13";
26
- $b521db8745125e0a$export$d35bc1e505d1ebbf = "is-disabled_2ebb13";
27
25
 
28
26
 
29
-
30
- const $8849a664c31dd3e9$var$DEFAULT_SIZE = 'avatar-size-100';
31
- const $8849a664c31dd3e9$var$SIZE_RE = /^size-\d+/;
32
- function $8849a664c31dd3e9$var$Avatar(props, ref) {
33
- props = $5tAoP$useSlotProps(props, 'avatar');
34
- const { alt: alt = '' , isDisabled: isDisabled , size: size , src: src , ...otherProps } = $5tAoP$useProviderProps(props);
35
- const { styleProps: styleProps } = $5tAoP$useStyleProps(otherProps);
36
- const domRef = $5tAoP$useDOMRef(ref);
37
- const domProps = $5tAoP$filterDOMProps(otherProps);
27
+ const $ab0b7b2186c39312$var$DEFAULT_SIZE = 'avatar-size-100';
28
+ const $ab0b7b2186c39312$var$SIZE_RE = /^size-\d+/;
29
+ function $ab0b7b2186c39312$var$Avatar(props, ref) {
30
+ props = $85w8l$useSlotProps(props, 'avatar');
31
+ const { alt: alt = '' , isDisabled: isDisabled , size: size , src: src , ...otherProps } = $85w8l$useProviderProps(props);
32
+ const { styleProps: styleProps } = $85w8l$useStyleProps(otherProps);
33
+ const domRef = $85w8l$useDOMRef(ref);
34
+ const domProps = $85w8l$filterDOMProps(otherProps);
38
35
  // Casting `size` as `any` since `isNaN` expects a `number`, but we want it
39
36
  // to handle `string` numbers; e.g. '300' as opposed to 300
40
- const sizeValue = typeof size !== 'number' && ($8849a664c31dd3e9$var$SIZE_RE.test(size) || !isNaN(size)) ? $5tAoP$dimensionValue($8849a664c31dd3e9$var$DEFAULT_SIZE) // override disallowed size values
41
- : $5tAoP$dimensionValue(size || $8849a664c31dd3e9$var$DEFAULT_SIZE);
42
- return(/*#__PURE__*/ $5tAoP$react.createElement("img", {
37
+ const sizeValue = typeof size !== 'number' && ($ab0b7b2186c39312$var$SIZE_RE.test(size) || !isNaN(size)) ? $85w8l$dimensionValue($ab0b7b2186c39312$var$DEFAULT_SIZE) // override disallowed size values
38
+ : $85w8l$dimensionValue(size || $ab0b7b2186c39312$var$DEFAULT_SIZE);
39
+ return(/*#__PURE__*/ $85w8l$react.createElement("img", {
43
40
  ...styleProps,
44
41
  ...domProps,
45
42
  alt: alt,
46
- className: $5tAoP$classNames((/*@__PURE__*/$parcel$interopDefault($b521db8745125e0a$exports)), 'spectrum-Avatar', {
43
+ className: $85w8l$classNames((/*@__PURE__*/$parcel$interopDefault($f81b9c4eea42ecfe$exports)), 'spectrum-Avatar', {
47
44
  'is-disabled': isDisabled
48
45
  }, styleProps.className),
49
46
  ref: domRef,
@@ -59,10 +56,10 @@ function $8849a664c31dd3e9$var$Avatar(props, ref) {
59
56
  }
60
57
  /**
61
58
  * An avatar is a thumbnail representation of an entity, such as a user or an organization.
62
- */ const $8849a664c31dd3e9$export$e2255cf6045e8d47 = /*#__PURE__*/ $5tAoP$forwardRef($8849a664c31dd3e9$var$Avatar);
59
+ */ const $ab0b7b2186c39312$export$e2255cf6045e8d47 = /*#__PURE__*/ $85w8l$forwardRef($ab0b7b2186c39312$var$Avatar);
63
60
 
64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AU,CAAC,SAAS;QACtB,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,CAAC;eACH,UAAU,CAAC,KAAK;eACf,SAAS,IAAI,CAAC;gBAAA,MAAM,EAAE,SAAS;gBAAE,KAAK,EAAE,SAAS;YAAA,CAAC;QACxD,CAAC;;AAEP,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,KAAK,CAAC,yCAAO,iBAAG,iBAAU,CAAC,4BAAM","sources":["packages/@react-spectrum/avatar/src/index.ts","packages/@react-spectrum/avatar/src/Avatar.tsx","packages/@adobe/spectrum-css-temp/components/avatar/vars.css"],"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\n/// <reference types=\"css-module-types\" />\n\nexport * from './Avatar';\n","/*\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\nfunction Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {\n props = useSlotProps(props, 'avatar');\n const {\n alt = '',\n isDisabled,\n 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\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nconst _Avatar = forwardRef(Avatar);\nexport {_Avatar as Avatar};\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@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AEAA,GAAiC;AACjC,GAA6B;AAD7B,yCAAiC,GAAG,CAAwB;AAC5D,yC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,KAAK,CAAC,yCAAO,iBAAG,iBAAU,CAAC,4BAAM","sources":["packages/@react-spectrum/avatar/src/index.ts","packages/@react-spectrum/avatar/src/Avatar.tsx","packages/@adobe/spectrum-css-temp/components/avatar/vars.css"],"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/// <reference types=\"css-module-types\" />\nexport {Avatar} from './Avatar';\nexport type {SpectrumAvatarProps} from '@react-types/avatar';\n","/*\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\nfunction Avatar(props: SpectrumAvatarProps, ref: DOMRef<HTMLImageElement>) {\n props = useSlotProps(props, 'avatar');\n const {\n alt = '',\n isDisabled,\n 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\n/**\n * An avatar is a thumbnail representation of an entity, such as a user or an organization.\n */\nconst _Avatar = forwardRef(Avatar);\nexport {_Avatar as Avatar};\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@import './skin.css';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -4,5 +4,6 @@ import { SpectrumAvatarProps } from "@react-types/avatar";
4
4
  * An avatar is a thumbnail representation of an entity, such as a user or an organization.
5
5
  */
6
6
  export const Avatar: React.ForwardRefExoticComponent<SpectrumAvatarProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLImageElement>>>;
7
+ export type { SpectrumAvatarProps } from '@react-types/avatar';
7
8
 
8
9
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;AAiEA;;GAEG;AACH,OAAA,MAAM,+IAA4B,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\n/// <reference types=\"css-module-types\" />\n\nexport * from './Avatar';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;AAiEA;;GAEG;AACH,OAAA,MAAM,+IAA4B,CAAC;ACvDnC,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.0-alpha.1",
3
+ "version": "3.0.0-alpha.10",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -32,20 +32,20 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.6.2",
35
- "@react-aria/utils": "^3.11.1",
36
- "@react-spectrum/utils": "^3.6.4",
37
- "@react-types/avatar": "3.0.0-alpha.1",
38
- "@react-types/shared": "^3.11.0"
35
+ "@react-aria/utils": "^3.14.0",
36
+ "@react-spectrum/utils": "^3.7.4",
37
+ "@react-types/avatar": "3.0.0-alpha.9",
38
+ "@react-types/shared": "^3.15.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@react-spectrum/provider": "^3.2.1",
45
- "react": "^16.8.0 || ^17.0.0-rc.1"
45
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "54c2366c4f31bd4bf619126131cd583c12972acc"
50
+ "gitHead": "9202ef59e8c104dd06ffe33148445ef7932a5d1b"
51
51
  }
package/src/index.ts CHANGED
@@ -9,7 +9,6 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
-
13
12
  /// <reference types="css-module-types" />
14
-
15
- export * from './Avatar';
13
+ export {Avatar} from './Avatar';
14
+ export type {SpectrumAvatarProps} from '@react-types/avatar';