@react-spectrum/avatar 3.0.0-nightly.3696 → 3.0.0-nightly.3705
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 +86 -0
- package/package.json +12 -7
package/dist/import.mjs
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import "./main.css";
|
|
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
|
+
|
|
7
|
+
function $parcel$interopDefault(a) {
|
|
8
|
+
return a && a.__esModule ? a.default : a;
|
|
9
|
+
}
|
|
10
|
+
function $parcel$export(e, n, v, s) {
|
|
11
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
|
+
}
|
|
13
|
+
/*
|
|
14
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
15
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
17
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
21
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
* governing permissions and limitations under the License.
|
|
23
|
+
*/ /// <reference types="css-module-types" />
|
|
24
|
+
/*
|
|
25
|
+
* Copyright 2021 Adobe. All rights reserved.
|
|
26
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
27
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
28
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
29
|
+
*
|
|
30
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
31
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
32
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
33
|
+
* governing permissions and limitations under the License.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
var $f81b9c4eea42ecfe$exports = {};
|
|
38
|
+
|
|
39
|
+
$parcel$export($f81b9c4eea42ecfe$exports, "spectrum-Avatar", () => $f81b9c4eea42ecfe$export$2e049b8d031600fb, (v) => $f81b9c4eea42ecfe$export$2e049b8d031600fb = v);
|
|
40
|
+
$parcel$export($f81b9c4eea42ecfe$exports, "is-disabled", () => $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf, (v) => $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf = v);
|
|
41
|
+
var $f81b9c4eea42ecfe$export$2e049b8d031600fb;
|
|
42
|
+
var $f81b9c4eea42ecfe$export$d35bc1e505d1ebbf;
|
|
43
|
+
$f81b9c4eea42ecfe$export$2e049b8d031600fb = "spectrum-Avatar_2ebb13";
|
|
44
|
+
$f81b9c4eea42ecfe$export$d35bc1e505d1ebbf = "is-disabled_2ebb13";
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
const $ab0b7b2186c39312$var$DEFAULT_SIZE = "avatar-size-100";
|
|
49
|
+
const $ab0b7b2186c39312$var$SIZE_RE = /^size-\d+/;
|
|
50
|
+
function $ab0b7b2186c39312$var$Avatar(props, ref) {
|
|
51
|
+
props = (0, $85w8l$useSlotProps)(props, "avatar");
|
|
52
|
+
const { alt: alt = "" , isDisabled: isDisabled , size: size = $ab0b7b2186c39312$var$DEFAULT_SIZE , src: src , ...otherProps } = (0, $85w8l$useProviderProps)(props);
|
|
53
|
+
const { styleProps: styleProps } = (0, $85w8l$useStyleProps)(otherProps);
|
|
54
|
+
const domRef = (0, $85w8l$useDOMRef)(ref);
|
|
55
|
+
const domProps = (0, $85w8l$filterDOMProps)(otherProps);
|
|
56
|
+
// Casting `size` as `any` since `isNaN` expects a `number`, but we want it
|
|
57
|
+
// to handle `string` numbers; e.g. '300' as opposed to 300
|
|
58
|
+
const sizeValue = typeof size !== "number" && ($ab0b7b2186c39312$var$SIZE_RE.test(size) || !isNaN(size)) ? (0, $85w8l$dimensionValue)($ab0b7b2186c39312$var$DEFAULT_SIZE) // override disallowed size values
|
|
59
|
+
: (0, $85w8l$dimensionValue)(size || $ab0b7b2186c39312$var$DEFAULT_SIZE);
|
|
60
|
+
return /*#__PURE__*/ (0, $85w8l$react).createElement("img", {
|
|
61
|
+
...styleProps,
|
|
62
|
+
...domProps,
|
|
63
|
+
alt: alt,
|
|
64
|
+
className: (0, $85w8l$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($f81b9c4eea42ecfe$exports))), "spectrum-Avatar", {
|
|
65
|
+
"is-disabled": isDisabled
|
|
66
|
+
}, styleProps.className),
|
|
67
|
+
ref: domRef,
|
|
68
|
+
src: src,
|
|
69
|
+
style: {
|
|
70
|
+
...styleProps.style,
|
|
71
|
+
...sizeValue && {
|
|
72
|
+
height: sizeValue,
|
|
73
|
+
width: sizeValue
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* An avatar is a thumbnail representation of an entity, such as a user or an organization.
|
|
80
|
+
*/ const $ab0b7b2186c39312$export$e2255cf6045e8d47 = /*#__PURE__*/ (0, $85w8l$forwardRef)($ab0b7b2186c39312$var$Avatar);
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
export {$ab0b7b2186c39312$export$e2255cf6045e8d47 as Avatar};
|
|
86
|
+
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/avatar",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.3705+93b3c951e",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"types": "./dist/types.d.ts",
|
|
10
|
+
"import": "./dist/import.mjs",
|
|
11
|
+
"require": "./dist/main.js"
|
|
12
|
+
},
|
|
8
13
|
"types": "dist/types.d.ts",
|
|
9
14
|
"source": "src/index.ts",
|
|
10
15
|
"files": [
|
|
@@ -31,14 +36,14 @@
|
|
|
31
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
32
37
|
},
|
|
33
38
|
"dependencies": {
|
|
34
|
-
"@react-aria/utils": "3.0.0-nightly.
|
|
35
|
-
"@react-spectrum/utils": "3.0.0-nightly.
|
|
36
|
-
"@react-types/avatar": "3.0.0-nightly.
|
|
37
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
39
|
+
"@react-aria/utils": "3.0.0-nightly.2005+93b3c951e",
|
|
40
|
+
"@react-spectrum/utils": "3.0.0-nightly.2005+93b3c951e",
|
|
41
|
+
"@react-types/avatar": "3.0.0-nightly.3705+93b3c951e",
|
|
42
|
+
"@react-types/shared": "3.0.0-nightly.2005+93b3c951e",
|
|
38
43
|
"@swc/helpers": "^0.4.14"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
41
|
-
"@adobe/spectrum-css-temp": "3.0.0-nightly.
|
|
46
|
+
"@adobe/spectrum-css-temp": "3.0.0-nightly.2005+93b3c951e"
|
|
42
47
|
},
|
|
43
48
|
"peerDependencies": {
|
|
44
49
|
"@react-spectrum/provider": "^3.2.1",
|
|
@@ -47,5 +52,5 @@
|
|
|
47
52
|
"publishConfig": {
|
|
48
53
|
"access": "public"
|
|
49
54
|
},
|
|
50
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "93b3c951eb784b14183f9988f2d188b34de8f42d"
|
|
51
56
|
}
|