@react-spectrum/icon 3.7.11 → 3.7.13
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/Icon.main.js +65 -0
- package/dist/Icon.main.js.map +1 -0
- package/dist/Icon.mjs +60 -0
- package/dist/Icon.module.js +60 -0
- package/dist/Icon.module.js.map +1 -0
- package/dist/Illustration.main.js +46 -0
- package/dist/Illustration.main.js.map +1 -0
- package/dist/Illustration.mjs +37 -0
- package/dist/Illustration.module.js +37 -0
- package/dist/Illustration.module.js.map +1 -0
- package/dist/UIIcon.main.js +56 -0
- package/dist/UIIcon.main.js.map +1 -0
- package/dist/UIIcon.mjs +51 -0
- package/dist/UIIcon.module.js +51 -0
- package/dist/UIIcon.module.js.map +1 -0
- package/dist/icon_vars_css.main.js +152 -0
- package/dist/icon_vars_css.main.js.map +1 -0
- package/dist/icon_vars_css.mjs +154 -0
- package/dist/icon_vars_css.module.js +154 -0
- package/dist/icon_vars_css.module.js.map +1 -0
- package/dist/import.mjs +3 -273
- package/dist/main.js +6 -272
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -273
- package/dist/module.js.map +1 -1
- package/dist/{main.css → vars.4163ca54.css} +8 -79
- package/dist/vars.4163ca54.css.map +1 -0
- package/package.json +5 -5
- package/dist/main.css.map +0 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require("./vars.4163ca54.css");
|
|
2
|
+
var $5ef39e0c80b682c7$exports = require("./icon_vars_css.main.js");
|
|
3
|
+
var $hx3aW$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
+
var $hx3aW$reactariautils = require("@react-aria/utils");
|
|
5
|
+
var $hx3aW$react = require("react");
|
|
6
|
+
var $hx3aW$reactspectrumprovider = require("@react-spectrum/provider");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function $parcel$export(e, n, v, s) {
|
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$parcel$export(module.exports, "Icon", () => $2f297c87d3047269$export$f04a61298a47a40f);
|
|
18
|
+
/*
|
|
19
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
20
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
22
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
25
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
26
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
27
|
+
* governing permissions and limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function $2f297c87d3047269$var$iconColorValue(value) {
|
|
34
|
+
return `var(--spectrum-semantic-${value}-color-icon)`;
|
|
35
|
+
}
|
|
36
|
+
const $2f297c87d3047269$var$iconStyleProps = {
|
|
37
|
+
...(0, $hx3aW$reactspectrumutils.baseStyleProps),
|
|
38
|
+
color: [
|
|
39
|
+
'color',
|
|
40
|
+
$2f297c87d3047269$var$iconColorValue
|
|
41
|
+
]
|
|
42
|
+
};
|
|
43
|
+
function $2f297c87d3047269$export$f04a61298a47a40f(props) {
|
|
44
|
+
props = (0, $hx3aW$reactspectrumutils.useSlotProps)(props, 'icon');
|
|
45
|
+
let { children: children, size: size, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
46
|
+
let { styleProps: styleProps } = (0, $hx3aW$reactspectrumutils.useStyleProps)(otherProps, $2f297c87d3047269$var$iconStyleProps);
|
|
47
|
+
let provider = (0, $hx3aW$reactspectrumprovider.useProvider)();
|
|
48
|
+
let scale = 'M';
|
|
49
|
+
if (provider !== null) scale = provider.scale === 'large' ? 'L' : 'M';
|
|
50
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
51
|
+
// Use user specified size, falling back to provider scale if size is undef
|
|
52
|
+
let iconSize = size ? size : scale;
|
|
53
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($hx3aW$react))).cloneElement(children, {
|
|
54
|
+
...(0, $hx3aW$reactariautils.filterDOMProps)(otherProps),
|
|
55
|
+
...styleProps,
|
|
56
|
+
focusable: 'false',
|
|
57
|
+
'aria-label': ariaLabel,
|
|
58
|
+
'aria-hidden': ariaLabel ? ariaHidden || undefined : true,
|
|
59
|
+
role: 'img',
|
|
60
|
+
className: (0, $hx3aW$reactspectrumutils.classNames)((0, ($parcel$interopDefault($5ef39e0c80b682c7$exports))), children.props.className, 'spectrum-Icon', `spectrum-Icon--size${iconSize}`, styleProps.className)
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=Icon.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuCD,SAAS,qCAAe,KAAqB;IAC3C,OAAO,CAAC,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACvD;AAEA,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,wCAAa,CAAC;IACjB,OAAO;QAAC;QAAS;KAAe;AAClC;AAKO,SAAS,0CAAK,KAAgB;IACnC,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,QACR,IAAI,EACJ,cAAc,SAAS,EACvB,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE,YAAY;IAE7C,IAAI,WAAW,CAAA,GAAA,wCAAU;IACzB,IAAI,QAAQ;IACZ,IAAI,aAAa,MACf,QAAQ,SAAS,KAAK,KAAK,UAAU,MAAM;IAE7C,IAAI,CAAC,YACH,aAAa;IAGf,2EAA2E;IAC3E,IAAI,WAAW,OAAO,OAAO;IAE7B,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,WAAW;QACX,cAAc;QACd,eAAgB,YAAa,cAAc,YAAa;QACxD,MAAM;QACN,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,SAAS,KAAK,CAAC,SAAS,EACxB,iBACA,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAChC,WAAW,SAAS;IACxB;AACF","sources":["packages/@react-spectrum/icon/src/Icon.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 {AriaLabelingProps, DOMProps, IconColorValue, StyleProps} from '@react-types/shared';\nimport {baseStyleProps, classNames, StyleHandlers, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/icon/vars.css';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {\n /**\n * A screen reader only label for the Icon.\n */\n 'aria-label'?: string,\n /**\n * The content to display. Should be an SVG.\n */\n children: ReactElement,\n /**\n * Size of Icon (changes based on scale).\n */\n size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' |'XL' | 'XXL',\n /**\n * A slot to place the icon in.\n * @default 'icon'\n */\n slot?: string,\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n 'aria-hidden'?: boolean | 'false' | 'true',\n /**\n * Color of the Icon.\n */\n color?: IconColorValue\n}\n\nexport type IconPropsWithoutChildren = Omit<IconProps, 'children'>;\n\nfunction iconColorValue(value: IconColorValue) {\n return `var(--spectrum-semantic-${value}-color-icon)`;\n}\n\nconst iconStyleProps: StyleHandlers = {\n ...baseStyleProps,\n color: ['color', iconColorValue]\n};\n\n/**\n * Spectrum icons are clear, minimal, and consistent across platforms. They follow the focused and rational principles of the design system in both metaphor and style.\n */\nexport function Icon(props: IconProps) {\n props = useSlotProps(props, 'icon');\n let {\n children,\n size,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps, iconStyleProps);\n\n let provider = useProvider();\n let scale = 'M';\n if (provider !== null) {\n scale = provider.scale === 'large' ? 'L' : 'M';\n }\n if (!ariaHidden) {\n ariaHidden = undefined;\n }\n\n // Use user specified size, falling back to provider scale if size is undef\n let iconSize = size ? size : scale;\n\n return React.cloneElement(children, {\n ...filterDOMProps(otherProps),\n ...styleProps,\n focusable: 'false',\n 'aria-label': ariaLabel,\n 'aria-hidden': (ariaLabel ? (ariaHidden || undefined) : true),\n role: 'img',\n className: classNames(\n styles,\n children.props.className,\n 'spectrum-Icon',\n `spectrum-Icon--size${iconSize}`,\n styleProps.className)\n });\n}\n"],"names":[],"version":3,"file":"Icon.main.js.map"}
|
package/dist/Icon.mjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "./vars.4163ca54.css";
|
|
2
|
+
import $hJE0A$icon_vars_cssmodulejs from "./icon_vars_css.mjs";
|
|
3
|
+
import {baseStyleProps as $hJE0A$baseStyleProps, useSlotProps as $hJE0A$useSlotProps, useStyleProps as $hJE0A$useStyleProps, classNames as $hJE0A$classNames} from "@react-spectrum/utils";
|
|
4
|
+
import {filterDOMProps as $hJE0A$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import $hJE0A$react from "react";
|
|
6
|
+
import {useProvider as $hJE0A$useProvider} from "@react-spectrum/provider";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function $6bfb67578ee6effd$var$iconColorValue(value) {
|
|
28
|
+
return `var(--spectrum-semantic-${value}-color-icon)`;
|
|
29
|
+
}
|
|
30
|
+
const $6bfb67578ee6effd$var$iconStyleProps = {
|
|
31
|
+
...(0, $hJE0A$baseStyleProps),
|
|
32
|
+
color: [
|
|
33
|
+
'color',
|
|
34
|
+
$6bfb67578ee6effd$var$iconColorValue
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
function $6bfb67578ee6effd$export$f04a61298a47a40f(props) {
|
|
38
|
+
props = (0, $hJE0A$useSlotProps)(props, 'icon');
|
|
39
|
+
let { children: children, size: size, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
40
|
+
let { styleProps: styleProps } = (0, $hJE0A$useStyleProps)(otherProps, $6bfb67578ee6effd$var$iconStyleProps);
|
|
41
|
+
let provider = (0, $hJE0A$useProvider)();
|
|
42
|
+
let scale = 'M';
|
|
43
|
+
if (provider !== null) scale = provider.scale === 'large' ? 'L' : 'M';
|
|
44
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
45
|
+
// Use user specified size, falling back to provider scale if size is undef
|
|
46
|
+
let iconSize = size ? size : scale;
|
|
47
|
+
return /*#__PURE__*/ (0, $hJE0A$react).cloneElement(children, {
|
|
48
|
+
...(0, $hJE0A$filterDOMProps)(otherProps),
|
|
49
|
+
...styleProps,
|
|
50
|
+
focusable: 'false',
|
|
51
|
+
'aria-label': ariaLabel,
|
|
52
|
+
'aria-hidden': ariaLabel ? ariaHidden || undefined : true,
|
|
53
|
+
role: 'img',
|
|
54
|
+
className: (0, $hJE0A$classNames)((0, ($parcel$interopDefault($hJE0A$icon_vars_cssmodulejs))), children.props.className, 'spectrum-Icon', `spectrum-Icon--size${iconSize}`, styleProps.className)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export {$6bfb67578ee6effd$export$f04a61298a47a40f as Icon};
|
|
60
|
+
//# sourceMappingURL=Icon.module.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "./vars.4163ca54.css";
|
|
2
|
+
import $hJE0A$icon_vars_cssmodulejs from "./icon_vars_css.module.js";
|
|
3
|
+
import {baseStyleProps as $hJE0A$baseStyleProps, useSlotProps as $hJE0A$useSlotProps, useStyleProps as $hJE0A$useStyleProps, classNames as $hJE0A$classNames} from "@react-spectrum/utils";
|
|
4
|
+
import {filterDOMProps as $hJE0A$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import $hJE0A$react from "react";
|
|
6
|
+
import {useProvider as $hJE0A$useProvider} from "@react-spectrum/provider";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function $6bfb67578ee6effd$var$iconColorValue(value) {
|
|
28
|
+
return `var(--spectrum-semantic-${value}-color-icon)`;
|
|
29
|
+
}
|
|
30
|
+
const $6bfb67578ee6effd$var$iconStyleProps = {
|
|
31
|
+
...(0, $hJE0A$baseStyleProps),
|
|
32
|
+
color: [
|
|
33
|
+
'color',
|
|
34
|
+
$6bfb67578ee6effd$var$iconColorValue
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
function $6bfb67578ee6effd$export$f04a61298a47a40f(props) {
|
|
38
|
+
props = (0, $hJE0A$useSlotProps)(props, 'icon');
|
|
39
|
+
let { children: children, size: size, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
40
|
+
let { styleProps: styleProps } = (0, $hJE0A$useStyleProps)(otherProps, $6bfb67578ee6effd$var$iconStyleProps);
|
|
41
|
+
let provider = (0, $hJE0A$useProvider)();
|
|
42
|
+
let scale = 'M';
|
|
43
|
+
if (provider !== null) scale = provider.scale === 'large' ? 'L' : 'M';
|
|
44
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
45
|
+
// Use user specified size, falling back to provider scale if size is undef
|
|
46
|
+
let iconSize = size ? size : scale;
|
|
47
|
+
return /*#__PURE__*/ (0, $hJE0A$react).cloneElement(children, {
|
|
48
|
+
...(0, $hJE0A$filterDOMProps)(otherProps),
|
|
49
|
+
...styleProps,
|
|
50
|
+
focusable: 'false',
|
|
51
|
+
'aria-label': ariaLabel,
|
|
52
|
+
'aria-hidden': ariaLabel ? ariaHidden || undefined : true,
|
|
53
|
+
role: 'img',
|
|
54
|
+
className: (0, $hJE0A$classNames)((0, ($parcel$interopDefault($hJE0A$icon_vars_cssmodulejs))), children.props.className, 'spectrum-Icon', `spectrum-Icon--size${iconSize}`, styleProps.className)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export {$6bfb67578ee6effd$export$f04a61298a47a40f as Icon};
|
|
60
|
+
//# sourceMappingURL=Icon.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAuCD,SAAS,qCAAe,KAAqB;IAC3C,OAAO,CAAC,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACvD;AAEA,MAAM,uCAAgC;IACpC,GAAG,CAAA,GAAA,qBAAa,CAAC;IACjB,OAAO;QAAC;QAAS;KAAe;AAClC;AAKO,SAAS,0CAAK,KAAgB;IACnC,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,QACR,IAAI,EACJ,cAAc,SAAS,EACvB,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE,YAAY;IAE7C,IAAI,WAAW,CAAA,GAAA,kBAAU;IACzB,IAAI,QAAQ;IACZ,IAAI,aAAa,MACf,QAAQ,SAAS,KAAK,KAAK,UAAU,MAAM;IAE7C,IAAI,CAAC,YACH,aAAa;IAGf,2EAA2E;IAC3E,IAAI,WAAW,OAAO,OAAO;IAE7B,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,WAAW;QACX,cAAc;QACd,eAAgB,YAAa,cAAc,YAAa;QACxD,MAAM;QACN,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,sDAAK,GACL,SAAS,KAAK,CAAC,SAAS,EACxB,iBACA,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAChC,WAAW,SAAS;IACxB;AACF","sources":["packages/@react-spectrum/icon/src/Icon.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 {AriaLabelingProps, DOMProps, IconColorValue, StyleProps} from '@react-types/shared';\nimport {baseStyleProps, classNames, StyleHandlers, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/icon/vars.css';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {\n /**\n * A screen reader only label for the Icon.\n */\n 'aria-label'?: string,\n /**\n * The content to display. Should be an SVG.\n */\n children: ReactElement,\n /**\n * Size of Icon (changes based on scale).\n */\n size?: 'XXS' | 'XS' | 'S' | 'M' | 'L' |'XL' | 'XXL',\n /**\n * A slot to place the icon in.\n * @default 'icon'\n */\n slot?: string,\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n 'aria-hidden'?: boolean | 'false' | 'true',\n /**\n * Color of the Icon.\n */\n color?: IconColorValue\n}\n\nexport type IconPropsWithoutChildren = Omit<IconProps, 'children'>;\n\nfunction iconColorValue(value: IconColorValue) {\n return `var(--spectrum-semantic-${value}-color-icon)`;\n}\n\nconst iconStyleProps: StyleHandlers = {\n ...baseStyleProps,\n color: ['color', iconColorValue]\n};\n\n/**\n * Spectrum icons are clear, minimal, and consistent across platforms. They follow the focused and rational principles of the design system in both metaphor and style.\n */\nexport function Icon(props: IconProps) {\n props = useSlotProps(props, 'icon');\n let {\n children,\n size,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps, iconStyleProps);\n\n let provider = useProvider();\n let scale = 'M';\n if (provider !== null) {\n scale = provider.scale === 'large' ? 'L' : 'M';\n }\n if (!ariaHidden) {\n ariaHidden = undefined;\n }\n\n // Use user specified size, falling back to provider scale if size is undef\n let iconSize = size ? size : scale;\n\n return React.cloneElement(children, {\n ...filterDOMProps(otherProps),\n ...styleProps,\n focusable: 'false',\n 'aria-label': ariaLabel,\n 'aria-hidden': (ariaLabel ? (ariaHidden || undefined) : true),\n role: 'img',\n className: classNames(\n styles,\n children.props.className,\n 'spectrum-Icon',\n `spectrum-Icon--size${iconSize}`,\n styleProps.className)\n });\n}\n"],"names":[],"version":3,"file":"Icon.module.js.map"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var $fIMBi$reactariautils = require("@react-aria/utils");
|
|
2
|
+
var $fIMBi$react = require("react");
|
|
3
|
+
var $fIMBi$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function $parcel$interopDefault(a) {
|
|
7
|
+
return a && a.__esModule ? a.default : a;
|
|
8
|
+
}
|
|
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
|
+
$parcel$export(module.exports, "Illustration", () => $ebfd4d66f1999633$export$d43c2e2ca9b2c105);
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
function $ebfd4d66f1999633$export$d43c2e2ca9b2c105(props) {
|
|
29
|
+
props = (0, $fIMBi$reactspectrumutils.useSlotProps)(props, 'illustration');
|
|
30
|
+
let { children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
31
|
+
let { styleProps: styleProps } = (0, $fIMBi$reactspectrumutils.useStyleProps)(otherProps);
|
|
32
|
+
let hasLabel = ariaLabel || ariaLabelledby;
|
|
33
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
34
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($fIMBi$react))).cloneElement(children, {
|
|
35
|
+
...(0, $fIMBi$reactariautils.filterDOMProps)(otherProps),
|
|
36
|
+
...styleProps,
|
|
37
|
+
focusable: 'false',
|
|
38
|
+
'aria-label': ariaLabel,
|
|
39
|
+
'aria-labelledby': ariaLabelledby,
|
|
40
|
+
'aria-hidden': ariaHidden,
|
|
41
|
+
role: hasLabel ? 'img' : undefined
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=Illustration.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAgCM,SAAS,0CAAa,KAAwB;IACnD,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,EACR,cAAc,SAAS,EACvB,mBAAmB,cAAc,EACjC,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,IAAI,WAAW,aAAa;IAE5B,IAAI,CAAC,YACH,aAAa;IAGf,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,WAAW;QACX,cAAc;QACd,mBAAmB;QACnB,eAAe;QACf,MAAM,WAAW,QAAQ;IAC3B;AACF","sources":["packages/@react-spectrum/icon/src/Illustration.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 {AriaLabelingProps, DOMProps, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useSlotProps, useStyleProps} from '@react-spectrum/utils';\n\nexport interface IllustrationProps extends DOMProps, AriaLabelingProps, StyleProps {\n /**\n * A screen reader only label for the Illustration.\n */\n 'aria-label'?: string,\n /**\n * The content to display. Should be an SVG.\n */\n children: ReactElement,\n /**\n * A slot to place the illustration in.\n * @default 'illustration'\n */\n slot?: string,\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n 'aria-hidden'?: boolean | 'false' | 'true'\n}\n\nexport type IllustrationPropsWithoutChildren = Omit<IllustrationProps, 'children'>;\n\n/**\n * Wrapper component for illustrations. Use this to wrap your svg element for a custom illustration.\n */\nexport function Illustration(props: IllustrationProps) {\n props = useSlotProps(props, 'illustration');\n let {\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-hidden': ariaHidden,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n\n let hasLabel = ariaLabel || ariaLabelledby;\n\n if (!ariaHidden) {\n ariaHidden = undefined;\n }\n\n return React.cloneElement(children, {\n ...filterDOMProps(otherProps),\n ...styleProps,\n focusable: 'false',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-hidden': ariaHidden,\n role: hasLabel ? 'img' : undefined\n });\n}\n"],"names":[],"version":3,"file":"Illustration.main.js.map"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {filterDOMProps as $2nyUy$filterDOMProps} from "@react-aria/utils";
|
|
2
|
+
import $2nyUy$react from "react";
|
|
3
|
+
import {useSlotProps as $2nyUy$useSlotProps, useStyleProps as $2nyUy$useStyleProps} from "@react-spectrum/utils";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
7
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
* governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function $88bb85359d3a4aed$export$d43c2e2ca9b2c105(props) {
|
|
19
|
+
props = (0, $2nyUy$useSlotProps)(props, 'illustration');
|
|
20
|
+
let { children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
21
|
+
let { styleProps: styleProps } = (0, $2nyUy$useStyleProps)(otherProps);
|
|
22
|
+
let hasLabel = ariaLabel || ariaLabelledby;
|
|
23
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
24
|
+
return /*#__PURE__*/ (0, $2nyUy$react).cloneElement(children, {
|
|
25
|
+
...(0, $2nyUy$filterDOMProps)(otherProps),
|
|
26
|
+
...styleProps,
|
|
27
|
+
focusable: 'false',
|
|
28
|
+
'aria-label': ariaLabel,
|
|
29
|
+
'aria-labelledby': ariaLabelledby,
|
|
30
|
+
'aria-hidden': ariaHidden,
|
|
31
|
+
role: hasLabel ? 'img' : undefined
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export {$88bb85359d3a4aed$export$d43c2e2ca9b2c105 as Illustration};
|
|
37
|
+
//# sourceMappingURL=Illustration.module.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {filterDOMProps as $2nyUy$filterDOMProps} from "@react-aria/utils";
|
|
2
|
+
import $2nyUy$react from "react";
|
|
3
|
+
import {useSlotProps as $2nyUy$useSlotProps, useStyleProps as $2nyUy$useStyleProps} from "@react-spectrum/utils";
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
7
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
* governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
function $88bb85359d3a4aed$export$d43c2e2ca9b2c105(props) {
|
|
19
|
+
props = (0, $2nyUy$useSlotProps)(props, 'illustration');
|
|
20
|
+
let { children: children, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
21
|
+
let { styleProps: styleProps } = (0, $2nyUy$useStyleProps)(otherProps);
|
|
22
|
+
let hasLabel = ariaLabel || ariaLabelledby;
|
|
23
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
24
|
+
return /*#__PURE__*/ (0, $2nyUy$react).cloneElement(children, {
|
|
25
|
+
...(0, $2nyUy$filterDOMProps)(otherProps),
|
|
26
|
+
...styleProps,
|
|
27
|
+
focusable: 'false',
|
|
28
|
+
'aria-label': ariaLabel,
|
|
29
|
+
'aria-labelledby': ariaLabelledby,
|
|
30
|
+
'aria-hidden': ariaHidden,
|
|
31
|
+
role: hasLabel ? 'img' : undefined
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export {$88bb85359d3a4aed$export$d43c2e2ca9b2c105 as Illustration};
|
|
37
|
+
//# sourceMappingURL=Illustration.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;AAAA;;;;;;;;;;CAUC;;;AAgCM,SAAS,0CAAa,KAAwB;IACnD,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,EACR,cAAc,SAAS,EACvB,mBAAmB,cAAc,EACjC,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,IAAI,WAAW,aAAa;IAE5B,IAAI,CAAC,YACH,aAAa;IAGf,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACb,WAAW;QACX,cAAc;QACd,mBAAmB;QACnB,eAAe;QACf,MAAM,WAAW,QAAQ;IAC3B;AACF","sources":["packages/@react-spectrum/icon/src/Illustration.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 {AriaLabelingProps, DOMProps, StyleProps} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport {useSlotProps, useStyleProps} from '@react-spectrum/utils';\n\nexport interface IllustrationProps extends DOMProps, AriaLabelingProps, StyleProps {\n /**\n * A screen reader only label for the Illustration.\n */\n 'aria-label'?: string,\n /**\n * The content to display. Should be an SVG.\n */\n children: ReactElement,\n /**\n * A slot to place the illustration in.\n * @default 'illustration'\n */\n slot?: string,\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n 'aria-hidden'?: boolean | 'false' | 'true'\n}\n\nexport type IllustrationPropsWithoutChildren = Omit<IllustrationProps, 'children'>;\n\n/**\n * Wrapper component for illustrations. Use this to wrap your svg element for a custom illustration.\n */\nexport function Illustration(props: IllustrationProps) {\n props = useSlotProps(props, 'illustration');\n let {\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-hidden': ariaHidden,\n ...otherProps\n } = props;\n let {styleProps} = useStyleProps(otherProps);\n\n let hasLabel = ariaLabel || ariaLabelledby;\n\n if (!ariaHidden) {\n ariaHidden = undefined;\n }\n\n return React.cloneElement(children, {\n ...filterDOMProps(otherProps),\n ...styleProps,\n focusable: 'false',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-hidden': ariaHidden,\n role: hasLabel ? 'img' : undefined\n });\n}\n"],"names":[],"version":3,"file":"Illustration.module.js.map"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
require("./vars.4163ca54.css");
|
|
2
|
+
var $5ef39e0c80b682c7$exports = require("./icon_vars_css.main.js");
|
|
3
|
+
var $anCtz$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
+
var $anCtz$reactariautils = require("@react-aria/utils");
|
|
5
|
+
var $anCtz$react = require("react");
|
|
6
|
+
var $anCtz$reactspectrumprovider = require("@react-spectrum/provider");
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function $parcel$export(e, n, v, s) {
|
|
14
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$parcel$export(module.exports, "UIIcon", () => $722df481e3c1f593$export$906cc5990ff10700);
|
|
18
|
+
/*
|
|
19
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
20
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
22
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
25
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
26
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
27
|
+
* governing permissions and limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
function $722df481e3c1f593$export$906cc5990ff10700(props) {
|
|
34
|
+
props = (0, $anCtz$reactspectrumutils.useSlotProps)(props, 'icon');
|
|
35
|
+
let { children: children, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
36
|
+
let { styleProps: styleProps } = (0, $anCtz$reactspectrumutils.useStyleProps)(otherProps);
|
|
37
|
+
let provider = (0, $anCtz$reactspectrumprovider.useProvider)();
|
|
38
|
+
let scale = 'M';
|
|
39
|
+
if (provider !== null) scale = provider.scale === 'large' ? 'L' : 'M';
|
|
40
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
41
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($anCtz$react))).cloneElement(children, {
|
|
42
|
+
...(0, $anCtz$reactariautils.filterDOMProps)(otherProps),
|
|
43
|
+
...styleProps,
|
|
44
|
+
scale: scale,
|
|
45
|
+
focusable: 'false',
|
|
46
|
+
'aria-label': ariaLabel,
|
|
47
|
+
'aria-hidden': ariaLabel ? ariaHidden || undefined : true,
|
|
48
|
+
role: 'img',
|
|
49
|
+
className: (0, $anCtz$reactspectrumutils.classNames)((0, ($parcel$interopDefault($5ef39e0c80b682c7$exports))), children.props.className, 'spectrum-Icon', {
|
|
50
|
+
[`spectrum-UIIcon-${children.type['displayName']}`]: children.type['displayName']
|
|
51
|
+
}, styleProps.className)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=UIIcon.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAO,KAAkB;IACvC,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,EACR,cAAc,SAAS,EACvB,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,wCAAU;IACzB,IAAI,QAAQ;IACZ,IAAI,aAAa,MACf,QAAQ,SAAS,KAAK,KAAK,UAAU,MAAM;IAG7C,IAAI,CAAC,YACH,aAAa;IAGf,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;eACb;QACA,WAAW;QACX,cAAc;QACd,eAAgB,YAAa,cAAc,YAAa;QACxD,MAAM;QACN,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,SAAS,KAAK,CAAC,SAAS,EACxB,iBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,CAAC,cAAc;QACnF,GACA,WAAW,SAAS;IACxB;AACF","sources":["packages/@react-spectrum/icon/src/UIIcon.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 {AriaLabelingProps, DOMProps, StyleProps} from '@react-types/shared';\nimport {classNames, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/icon/vars.css';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport interface UIIconProps extends DOMProps, AriaLabelingProps, StyleProps {\n children: ReactElement,\n slot?: string,\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n 'aria-hidden'?: boolean | 'false' | 'true'\n}\n\nexport type UIIconPropsWithoutChildren = Omit<UIIconProps, 'children'>;\n\nexport function UIIcon(props: UIIconProps) {\n props = useSlotProps(props, 'icon');\n let {\n children,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let provider = useProvider();\n let scale = 'M';\n if (provider !== null) {\n scale = provider.scale === 'large' ? 'L' : 'M';\n }\n\n if (!ariaHidden) {\n ariaHidden = undefined;\n }\n\n return React.cloneElement(children, {\n ...filterDOMProps(otherProps),\n ...styleProps,\n scale,\n focusable: 'false',\n 'aria-label': ariaLabel,\n 'aria-hidden': (ariaLabel ? (ariaHidden || undefined) : true),\n role: 'img',\n className: classNames(\n styles,\n children.props.className,\n 'spectrum-Icon',\n {\n [`spectrum-UIIcon-${children.type['displayName']}`]: children.type['displayName']\n },\n styleProps.className)\n });\n}\n"],"names":[],"version":3,"file":"UIIcon.main.js.map"}
|
package/dist/UIIcon.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "./vars.4163ca54.css";
|
|
2
|
+
import $g4kmm$icon_vars_cssmodulejs from "./icon_vars_css.mjs";
|
|
3
|
+
import {useSlotProps as $g4kmm$useSlotProps, useStyleProps as $g4kmm$useStyleProps, classNames as $g4kmm$classNames} from "@react-spectrum/utils";
|
|
4
|
+
import {filterDOMProps as $g4kmm$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import $g4kmm$react from "react";
|
|
6
|
+
import {useProvider as $g4kmm$useProvider} from "@react-spectrum/provider";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function $9ba43a63383852e3$export$906cc5990ff10700(props) {
|
|
28
|
+
props = (0, $g4kmm$useSlotProps)(props, 'icon');
|
|
29
|
+
let { children: children, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
30
|
+
let { styleProps: styleProps } = (0, $g4kmm$useStyleProps)(otherProps);
|
|
31
|
+
let provider = (0, $g4kmm$useProvider)();
|
|
32
|
+
let scale = 'M';
|
|
33
|
+
if (provider !== null) scale = provider.scale === 'large' ? 'L' : 'M';
|
|
34
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
35
|
+
return /*#__PURE__*/ (0, $g4kmm$react).cloneElement(children, {
|
|
36
|
+
...(0, $g4kmm$filterDOMProps)(otherProps),
|
|
37
|
+
...styleProps,
|
|
38
|
+
scale: scale,
|
|
39
|
+
focusable: 'false',
|
|
40
|
+
'aria-label': ariaLabel,
|
|
41
|
+
'aria-hidden': ariaLabel ? ariaHidden || undefined : true,
|
|
42
|
+
role: 'img',
|
|
43
|
+
className: (0, $g4kmm$classNames)((0, ($parcel$interopDefault($g4kmm$icon_vars_cssmodulejs))), children.props.className, 'spectrum-Icon', {
|
|
44
|
+
[`spectrum-UIIcon-${children.type['displayName']}`]: children.type['displayName']
|
|
45
|
+
}, styleProps.className)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export {$9ba43a63383852e3$export$906cc5990ff10700 as UIIcon};
|
|
51
|
+
//# sourceMappingURL=UIIcon.module.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "./vars.4163ca54.css";
|
|
2
|
+
import $g4kmm$icon_vars_cssmodulejs from "./icon_vars_css.module.js";
|
|
3
|
+
import {useSlotProps as $g4kmm$useSlotProps, useStyleProps as $g4kmm$useStyleProps, classNames as $g4kmm$classNames} from "@react-spectrum/utils";
|
|
4
|
+
import {filterDOMProps as $g4kmm$filterDOMProps} from "@react-aria/utils";
|
|
5
|
+
import $g4kmm$react from "react";
|
|
6
|
+
import {useProvider as $g4kmm$useProvider} from "@react-spectrum/provider";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function $parcel$interopDefault(a) {
|
|
10
|
+
return a && a.__esModule ? a.default : a;
|
|
11
|
+
}
|
|
12
|
+
/*
|
|
13
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
+
* governing permissions and limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function $9ba43a63383852e3$export$906cc5990ff10700(props) {
|
|
28
|
+
props = (0, $g4kmm$useSlotProps)(props, 'icon');
|
|
29
|
+
let { children: children, 'aria-label': ariaLabel, 'aria-hidden': ariaHidden, ...otherProps } = props;
|
|
30
|
+
let { styleProps: styleProps } = (0, $g4kmm$useStyleProps)(otherProps);
|
|
31
|
+
let provider = (0, $g4kmm$useProvider)();
|
|
32
|
+
let scale = 'M';
|
|
33
|
+
if (provider !== null) scale = provider.scale === 'large' ? 'L' : 'M';
|
|
34
|
+
if (!ariaHidden) ariaHidden = undefined;
|
|
35
|
+
return /*#__PURE__*/ (0, $g4kmm$react).cloneElement(children, {
|
|
36
|
+
...(0, $g4kmm$filterDOMProps)(otherProps),
|
|
37
|
+
...styleProps,
|
|
38
|
+
scale: scale,
|
|
39
|
+
focusable: 'false',
|
|
40
|
+
'aria-label': ariaLabel,
|
|
41
|
+
'aria-hidden': ariaLabel ? ariaHidden || undefined : true,
|
|
42
|
+
role: 'img',
|
|
43
|
+
className: (0, $g4kmm$classNames)((0, ($parcel$interopDefault($g4kmm$icon_vars_cssmodulejs))), children.props.className, 'spectrum-Icon', {
|
|
44
|
+
[`spectrum-UIIcon-${children.type['displayName']}`]: children.type['displayName']
|
|
45
|
+
}, styleProps.className)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export {$9ba43a63383852e3$export$906cc5990ff10700 as UIIcon};
|
|
51
|
+
//# sourceMappingURL=UIIcon.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoBM,SAAS,0CAAO,KAAkB;IACvC,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,YACF,QAAQ,EACR,cAAc,SAAS,EACvB,eAAe,UAAU,EACzB,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,WAAW,CAAA,GAAA,kBAAU;IACzB,IAAI,QAAQ;IACZ,IAAI,aAAa,MACf,QAAQ,SAAS,KAAK,KAAK,UAAU,MAAM;IAG7C,IAAI,CAAC,YACH,aAAa;IAGf,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,UAAU;QAClC,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;eACb;QACA,WAAW;QACX,cAAc;QACd,eAAgB,YAAa,cAAc,YAAa;QACxD,MAAM;QACN,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,sDAAK,GACL,SAAS,KAAK,CAAC,SAAS,EACxB,iBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,CAAC,cAAc;QACnF,GACA,WAAW,SAAS;IACxB;AACF","sources":["packages/@react-spectrum/icon/src/UIIcon.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 {AriaLabelingProps, DOMProps, StyleProps} from '@react-types/shared';\nimport {classNames, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {ReactElement} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/icon/vars.css';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport interface UIIconProps extends DOMProps, AriaLabelingProps, StyleProps {\n children: ReactElement,\n slot?: string,\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n 'aria-hidden'?: boolean | 'false' | 'true'\n}\n\nexport type UIIconPropsWithoutChildren = Omit<UIIconProps, 'children'>;\n\nexport function UIIcon(props: UIIconProps) {\n props = useSlotProps(props, 'icon');\n let {\n children,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let provider = useProvider();\n let scale = 'M';\n if (provider !== null) {\n scale = provider.scale === 'large' ? 'L' : 'M';\n }\n\n if (!ariaHidden) {\n ariaHidden = undefined;\n }\n\n return React.cloneElement(children, {\n ...filterDOMProps(otherProps),\n ...styleProps,\n scale,\n focusable: 'false',\n 'aria-label': ariaLabel,\n 'aria-hidden': (ariaLabel ? (ariaHidden || undefined) : true),\n role: 'img',\n className: classNames(\n styles,\n children.props.className,\n 'spectrum-Icon',\n {\n [`spectrum-UIIcon-${children.type['displayName']}`]: children.type['displayName']\n },\n styleProps.className)\n });\n}\n"],"names":[],"version":3,"file":"UIIcon.module.js.map"}
|