@react-spectrum/icon 3.3.7 → 3.5.0
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 +4 -25
- package/dist/main.js.map +1 -1
- package/dist/module.js +0 -6
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/Icon.tsx +1 -1
- package/src/UIIcon.tsx +3 -3
- package/src/index.ts +5 -2
package/dist/main.js
CHANGED
|
@@ -4,31 +4,15 @@ var $khAmQ$reactariautils = require("@react-aria/utils");
|
|
|
4
4
|
var $khAmQ$react = require("react");
|
|
5
5
|
var $khAmQ$reactspectrumprovider = require("@react-spectrum/provider");
|
|
6
6
|
|
|
7
|
-
function $parcel$
|
|
8
|
-
Object.
|
|
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 $2f297c87d3047269$exports = {};
|
|
30
13
|
|
|
31
|
-
$parcel$export(
|
|
14
|
+
$parcel$export(module.exports, "Icon", () => $2f297c87d3047269$export$f04a61298a47a40f);
|
|
15
|
+
$parcel$export(module.exports, "UIIcon", () => $722df481e3c1f593$export$906cc5990ff10700);
|
|
32
16
|
|
|
33
17
|
|
|
34
18
|
|
|
@@ -213,9 +197,6 @@ function $2f297c87d3047269$export$f04a61298a47a40f(props) {
|
|
|
213
197
|
}
|
|
214
198
|
|
|
215
199
|
|
|
216
|
-
var $722df481e3c1f593$exports = {};
|
|
217
|
-
|
|
218
|
-
$parcel$export($722df481e3c1f593$exports, "UIIcon", () => $722df481e3c1f593$export$906cc5990ff10700);
|
|
219
200
|
|
|
220
201
|
|
|
221
202
|
|
|
@@ -244,8 +225,6 @@ function $722df481e3c1f593$export$906cc5990ff10700(props) {
|
|
|
244
225
|
}
|
|
245
226
|
|
|
246
227
|
|
|
247
|
-
$parcel$exportWildcard(module.exports, $2f297c87d3047269$exports);
|
|
248
|
-
$parcel$exportWildcard(module.exports, $722df481e3c1f593$exports);
|
|
249
228
|
|
|
250
229
|
|
|
251
230
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAAiC;AACjC,GAAwC;AACxC,GAAuC;AACvC,GAAsC;AACtC,GAAsC;AACtC,GAAsC;AACtC,GAAuC;AACvC,GAAwC;AACxC,GAAkC;AAClC,GAAwC;AACxC,GAAyC;AACzC,GAAiC;AACjC,GAA6C;AAC7C,GAA4C;AAC5C,GAAgD;AAChD,GAAiD;AACjD,GAA0C;AAC1C,GAAiD;AACjD,GAAgD;AAChD,GAAmD;AACnD,GAAkD;AAClD,GAAkD;AAClD,GAAmD;AACnD,GAAmD;AACnD,GAAoD;AACpD,GAAmD;AACnD,GAAgD;AAChD,GAAgD;AAChD,GAA4C;AAC5C,GAA6C;AAC7C,GAA4C;AAC5C,GAA2C;AAC3C,GAA+C;AAC/C,GAAkD;AAClD,GAA4C;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,kBAAM,QAAQ,CAAC,IAAI,CAAC,CAAa;QAClF,CAAC,EACD,UAAU,CAAC,SAAS;IACxB,CAAC;AACH,CAAC;;","sources":["packages/@react-spectrum/icon/src/index.ts","packages/@react-spectrum/icon/src/Icon.tsx","packages/@adobe/spectrum-css-temp/components/icon/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport * from './Icon';\nexport * from './UIIcon';\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\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\ninterface 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","/*\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","/*\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\ninterface IconProps 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<IconProps, 'children'>;\n\nexport function UIIcon(props: IconProps) {\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)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AC3C,GAAG,CAAC,QAAQ,GAAG,wCAAW;IAC1B,GAAG,CAAC,KAAK,GAAG,CAAG;IACf,EAAE,EAAE,QAAQ,KAAK,IAAI,EACnB,KAAK,GAAG,QAAQ,CAAC,KAAK,KAAK,CAAO,SAAG,CAAG,KAAG,CAAG;IAGhD,EAAE,GAAG,UAAU,EACb,UAAU,GAAG,SAAS;IAGxB,MAAM,eAAC,sCAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;WAChC,oCAAc,CAAC,UAAU;WACzB,UAAU;eACb,KAAK;QACL,SAAS,EAAE,CAAO;QAClB,CAAY,aAAE,SAAS;QACvB,CAAa,cAAG,SAAS,GAAI,UAAU,IAAI,SAAS,GAAI,IAAI;QAC5D,IAAI,EAAE,CAAK;QACX,SAAS,EAAE,oCAAU,CACnB,gEAAM,EACN,QAAQ,CAAC,KAAK,CAAC,SAAS,EACxB,CAAe,gBACf,CAAC;cACG,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAa,kBAAM,QAAQ,CAAC,IAAI,CAAC,CAAa;QAClF,CAAC,EACD,UAAU,CAAC,SAAS;IACxB,CAAC;AACH,CAAC;;","sources":["packages/@react-spectrum/icon/src/index.ts","packages/@react-spectrum/icon/src/Icon.tsx","packages/@adobe/spectrum-css-temp/components/icon/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport {Icon} from './Icon';\nexport {UIIcon} from './UIIcon';\n\nexport type {IconProps, IconPropsWithoutChildren} from './Icon';\nexport type {UIIconProps, UIIconPropsWithoutChildren} from './UIIcon';\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\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","/*\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","/*\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":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -10,9 +10,6 @@ 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 $6bfb67578ee6effd$exports = {};
|
|
14
|
-
|
|
15
|
-
$parcel$export($6bfb67578ee6effd$exports, "Icon", () => $6bfb67578ee6effd$export$f04a61298a47a40f);
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
|
|
@@ -197,9 +194,6 @@ function $6bfb67578ee6effd$export$f04a61298a47a40f(props) {
|
|
|
197
194
|
}
|
|
198
195
|
|
|
199
196
|
|
|
200
|
-
var $9ba43a63383852e3$exports = {};
|
|
201
|
-
|
|
202
|
-
$parcel$export($9ba43a63383852e3$exports, "UIIcon", () => $9ba43a63383852e3$export$906cc5990ff10700);
|
|
203
197
|
|
|
204
198
|
|
|
205
199
|
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAAiC;AACjC,GAAwC;AACxC,GAAuC;AACvC,GAAsC;AACtC,GAAsC;AACtC,GAAsC;AACtC,GAAuC;AACvC,GAAwC;AACxC,GAAkC;AAClC,GAAwC;AACxC,GAAyC;AACzC,GAAiC;AACjC,GAA6C;AAC7C,GAA4C;AAC5C,GAAgD;AAChD,GAAiD;AACjD,GAA0C;AAC1C,GAAiD;AACjD,GAAgD;AAChD,GAAmD;AACnD,GAAkD;AAClD,GAAkD;AAClD,GAAmD;AACnD,GAAmD;AACnD,GAAoD;AACpD,GAAmD;AACnD,GAAgD;AAChD,GAAgD;AAChD,GAA4C;AAC5C,GAA6C;AAC7C,GAA4C;AAC5C,GAA2C;AAC3C,GAA+C;AAC/C,GAAkD;AAClD,GAA4C;AAC5C,GAA2C;AAC3C,GAA4C;AAC5C,GAA2C;AAC3C,GAA6C;AAC7C,GAA2C;AAC3C,GAA0C;AAC1C,GAA2C;AAC3C,GAAsC;AACtC,GAA6C;AAC7C,GAA+C;AAC/C,GAA8C;AAC9C,GAA+C;AA/C/C,yCAA+B,GAAG,CAAsB;AACxD,yCAAiC,GAAG,CAAwB;AAC5D,yCAAwC,GAAG,CAA+B;AAC1E,yCAAuC,GAAG,CAA8B;AACxE,wCAAsC,GAAG,CAA6B;AACtE,yCAAsC,GAAG,CAA6B;AACtE,yCAAsC,GAAG,CAA6B;AACtE,yCAAuC,GAAG,CAA8B;AACxE,yCAAwC,GAAG,CAA+B;AAC1E,yCAAkC,GAAG,CAAyB;AAC9D,yCAAwC,GA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,GACvB,CAAa,cAAE,UAAU,MACtB,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,oBAAa,CAAC,UAAU;IAC3C,GAAG,CAAC,QAAQ,GAAG,kBAAW;IAC1B,GAAG,CAAC,KAAK,GAAG,CAAG;IACf,EAAE,EAAE,QAAQ,KAAK,IAAI,EACnB,KAAK,GAAG,QAAQ,CAAC,KAAK,KAAK,CAAO,SAAG,CAAG,KAAG,CAAG;IAGhD,EAAE,GAAG,UAAU,EACb,UAAU,GAAG,SAAS;IAGxB,MAAM,eAAC,YAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;WAChC,qBAAc,CAAC,UAAU;WACzB,UAAU;eACb,KAAK;QACL,SAAS,EAAE,CAAO;QAClB,CAAY,aAAE,SAAS;QACvB,CAAa,cAAG,SAAS,GAAI,UAAU,IAAI,SAAS,GAAI,IAAI;QAC5D,IAAI,EAAE,CAAK;QACX,SAAS,EAAE,iBAAU,CACnB,gEAAM,EACN,QAAQ,CAAC,KAAK,CAAC,SAAS,EACxB,CAAe,gBACf,CAAC;cACG,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAa,kBAAM,QAAQ,CAAC,IAAI,CAAC,CAAa;QAClF,CAAC,EACD,UAAU,CAAC,SAAS;IACxB,CAAC;AACH,CAAC;;","sources":["packages/@react-spectrum/icon/src/index.ts","packages/@react-spectrum/icon/src/Icon.tsx","packages/@adobe/spectrum-css-temp/components/icon/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport * from './Icon';\nexport * from './UIIcon';\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\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\ninterface 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","/*\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","/*\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\ninterface IconProps 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<IconProps, 'children'>;\n\nexport function UIIcon(props: IconProps) {\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":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAAiC;AACjC,GAAwC;AACxC,GAAuC;AACvC,GAAsC;AACtC,GAAsC;AACtC,GAAsC;AACtC,GAAuC;AACvC,GAAwC;AACxC,GAAkC;AAClC,GAAwC;AACxC,GAAyC;AACzC,GAAiC;AACjC,GAA6C;AAC7C,GAA4C;AAC5C,GAAgD;AAChD,GAAiD;AACjD,GAA0C;AAC1C,GAAiD;AACjD,GAAgD;AAChD,GAAmD;AACnD,GAAkD;AAClD,GAAkD;AAClD,GAAmD;AACnD,GAAmD;AACn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,SAAS,EAAE,iBAAU,CACnB,gEAAM,EACN,QAAQ,CAAC,KAAK,CAAC,SAAS,EACxB,CAAe,gBACf,CAAC;cACG,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAa,kBAAM,QAAQ,CAAC,IAAI,CAAC,CAAa;QAClF,CAAC,EACD,UAAU,CAAC,SAAS;IACxB,CAAC;AACH,CAAC;;","sources":["packages/@react-spectrum/icon/src/index.ts","packages/@react-spectrum/icon/src/Icon.tsx","packages/@adobe/spectrum-css-temp/components/icon/vars.css","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\n/// <reference types=\"css-module-types\" />\n\nexport {Icon} from './Icon';\nexport {UIIcon} from './UIIcon';\n\nexport type {IconProps, IconPropsWithoutChildren} from './Icon';\nexport type {UIIconProps, UIIconPropsWithoutChildren} from './UIIcon';\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\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","/*\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","/*\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":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AriaLabelingProps, DOMProps, IconColorValue, StyleProps } from "@react-types/shared";
|
|
2
2
|
import React, { ReactElement } from "react";
|
|
3
|
-
interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
3
|
+
export interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
4
4
|
/**
|
|
5
5
|
* A screen reader only label for the Icon.
|
|
6
6
|
*/
|
|
@@ -32,7 +32,7 @@ export type IconPropsWithoutChildren = Omit<IconProps, 'children'>;
|
|
|
32
32
|
* 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.
|
|
33
33
|
*/
|
|
34
34
|
export function Icon(props: IconProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
35
|
-
interface
|
|
35
|
+
export interface UIIconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
36
36
|
children: ReactElement;
|
|
37
37
|
slot?: string;
|
|
38
38
|
/**
|
|
@@ -40,7 +40,7 @@ interface _IconProps1 extends DOMProps, AriaLabelingProps, StyleProps {
|
|
|
40
40
|
*/
|
|
41
41
|
'aria-hidden'?: boolean | 'false' | 'true';
|
|
42
42
|
}
|
|
43
|
-
export type UIIconPropsWithoutChildren = Omit<
|
|
44
|
-
export function UIIcon(props:
|
|
43
|
+
export type UIIconPropsWithoutChildren = Omit<UIIconProps, 'children'>;
|
|
44
|
+
export function UIIcon(props: UIIconProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
45
45
|
|
|
46
46
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAmBA,
|
|
1
|
+
{"mappings":";;AAmBA,0BAA2B,SAAQ,QAAQ,EAAE,iBAAiB,EAAE,UAAU;IACxE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAE,IAAI,GAAG,KAAK,CAAC;IACpD;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IAC3C;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAA;CACvB;AAED,uCAAuC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAWnE;;GAEG;AACH,qBAAqB,KAAK,EAAE,SAAS,sEAqCpC;AC/ED,4BAA6B,SAAQ,QAAQ,EAAE,iBAAiB,EAAE,UAAU;IAC1E,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;CAC3C;AAED,yCAAyC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;AAEvE,uBAAuB,KAAK,EAAE,WAAW,sEAqCxC","sources":["packages/@react-spectrum/icon/src/packages/@react-spectrum/icon/src/Icon.tsx","packages/@react-spectrum/icon/src/packages/@react-spectrum/icon/src/UIIcon.tsx","packages/@react-spectrum/icon/src/packages/@react-spectrum/icon/src/index.ts","packages/@react-spectrum/icon/src/index.ts"],"sourcesContent":[null,null,null,"/*\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/// <reference types=\"css-module-types\" />\n\nexport {Icon} from './Icon';\nexport {UIIcon} from './UIIcon';\n\nexport type {IconProps, IconPropsWithoutChildren} from './Icon';\nexport type {UIIconProps, UIIconPropsWithoutChildren} from './UIIcon';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/icon",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.6.2",
|
|
35
|
-
"@react-aria/utils": "^3.
|
|
36
|
-
"@react-spectrum/utils": "^3.
|
|
37
|
-
"@react-types/shared": "^3.
|
|
35
|
+
"@react-aria/utils": "^3.13.2",
|
|
36
|
+
"@react-spectrum/utils": "^3.7.2",
|
|
37
|
+
"@react-types/shared": "^3.14.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@react-spectrum/provider": "^3.0.0",
|
|
44
|
-
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
44
|
+
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "cd7c0ec917122c7612f653c22f8ed558f8b66ecd"
|
|
50
50
|
}
|
package/src/Icon.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import React, {ReactElement} from 'react';
|
|
|
17
17
|
import styles from '@adobe/spectrum-css-temp/components/icon/vars.css';
|
|
18
18
|
import {useProvider} from '@react-spectrum/provider';
|
|
19
19
|
|
|
20
|
-
interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
20
|
+
export interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
21
21
|
/**
|
|
22
22
|
* A screen reader only label for the Icon.
|
|
23
23
|
*/
|
package/src/UIIcon.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import React, {ReactElement} from 'react';
|
|
|
17
17
|
import styles from '@adobe/spectrum-css-temp/components/icon/vars.css';
|
|
18
18
|
import {useProvider} from '@react-spectrum/provider';
|
|
19
19
|
|
|
20
|
-
interface
|
|
20
|
+
export interface UIIconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
21
21
|
children: ReactElement,
|
|
22
22
|
slot?: string,
|
|
23
23
|
/**
|
|
@@ -26,9 +26,9 @@ interface IconProps extends DOMProps, AriaLabelingProps, StyleProps {
|
|
|
26
26
|
'aria-hidden'?: boolean | 'false' | 'true'
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export type UIIconPropsWithoutChildren = Omit<
|
|
29
|
+
export type UIIconPropsWithoutChildren = Omit<UIIconProps, 'children'>;
|
|
30
30
|
|
|
31
|
-
export function UIIcon(props:
|
|
31
|
+
export function UIIcon(props: UIIconProps) {
|
|
32
32
|
props = useSlotProps(props, 'icon');
|
|
33
33
|
let {
|
|
34
34
|
children,
|
package/src/index.ts
CHANGED
|
@@ -12,5 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
/// <reference types="css-module-types" />
|
|
14
14
|
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export {Icon} from './Icon';
|
|
16
|
+
export {UIIcon} from './UIIcon';
|
|
17
|
+
|
|
18
|
+
export type {IconProps, IconPropsWithoutChildren} from './Icon';
|
|
19
|
+
export type {UIIconProps, UIIconPropsWithoutChildren} from './UIIcon';
|