@react-spectrum/badge 3.1.25 → 3.1.26
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/Badge.main.js +2 -2
- package/dist/Badge.main.js.map +1 -1
- package/dist/Badge.mjs +3 -3
- package/dist/Badge.module.js +3 -3
- package/dist/Badge.module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/Badge.tsx +19 -17
package/dist/Badge.main.js
CHANGED
|
@@ -45,7 +45,7 @@ const $f243611f87a6fe61$export$37acb3580601e69a = /*#__PURE__*/ (0, $3aISS$react
|
|
|
45
45
|
[`spectrum-Badge--${variant}`]: variant
|
|
46
46
|
}, styleProps.className),
|
|
47
47
|
ref: domRef
|
|
48
|
-
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3aISS$react))).createElement((0, $3aISS$reactspectrumutils.SlotProvider), {
|
|
48
|
+
}, /*#__PURE__*/ (0, ($parcel$interopDefault($3aISS$react))).createElement((0, $3aISS$reactspectrumutils.ClearSlots), null, /*#__PURE__*/ (0, ($parcel$interopDefault($3aISS$react))).createElement((0, $3aISS$reactspectrumutils.SlotProvider), {
|
|
49
49
|
slots: {
|
|
50
50
|
icon: {
|
|
51
51
|
size: 'S',
|
|
@@ -55,7 +55,7 @@ const $f243611f87a6fe61$export$37acb3580601e69a = /*#__PURE__*/ (0, $3aISS$react
|
|
|
55
55
|
UNSAFE_className: (0, $3aISS$reactspectrumutils.classNames)((0, ($parcel$interopDefault($0f362c72c73357fc$exports))), 'spectrum-Badge-label')
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, ($parcel$interopDefault($3aISS$react))).createElement((0, $3aISS$reactspectrumtext.Text), null, children) : children));
|
|
58
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, ($parcel$interopDefault($3aISS$react))).createElement((0, $3aISS$reactspectrumtext.Text), null, children) : children)));
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
|
package/dist/Badge.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAeM,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnG,IAAI,YACF,QAAQ,WACR,OAAO,EACP,GAAG,YACJ,GAAG,CAAA,GAAA,6CAAe,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,0DAAC,CAAA,GAAA,6BAAG,SAAG,YACP;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAeM,MAAM,0DAAQ,CAAA,GAAA,uBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnG,IAAI,YACF,QAAQ,WACR,OAAO,EACP,GAAG,YACJ,GAAG,CAAA,GAAA,6CAAe,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,sCAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,0DAAC,CAAA,GAAA,oCAAS,uBACR,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,0DAAC,CAAA,GAAA,6BAAG,SAAG,YACP;AAMhB","sources":["packages/@react-spectrum/badge/src/Badge.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, ClearSlots, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumBadgeProps} from '@react-types/badge';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nexport const Badge = forwardRef(function Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n variant,\n ...otherProps\n } = useProviderProps(props);\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <span\n {...filterDOMProps(otherProps)}\n {...styleProps}\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Badge',\n {\n [`spectrum-Badge--${variant}`]: variant\n },\n styleProps.className\n )}\n ref={domRef}>\n <ClearSlots>\n <SlotProvider\n slots={{\n icon: {\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n },\n text: {\n UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n }\n }}>\n\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </SlotProvider>\n </ClearSlots>\n </span>\n );\n});\n"],"names":[],"version":3,"file":"Badge.main.js.map"}
|
package/dist/Badge.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./badge.814a37ed.css";
|
|
2
2
|
import $jtG7a$badge_vars_cssmodulejs from "./badge_vars_css.mjs";
|
|
3
|
-
import {useDOMRef as $jtG7a$useDOMRef, useStyleProps as $jtG7a$useStyleProps, classNames as $jtG7a$classNames, SlotProvider as $jtG7a$SlotProvider} from "@react-spectrum/utils";
|
|
3
|
+
import {useDOMRef as $jtG7a$useDOMRef, useStyleProps as $jtG7a$useStyleProps, classNames as $jtG7a$classNames, ClearSlots as $jtG7a$ClearSlots, SlotProvider as $jtG7a$SlotProvider} from "@react-spectrum/utils";
|
|
4
4
|
import {filterDOMProps as $jtG7a$filterDOMProps} from "@react-aria/utils";
|
|
5
5
|
import $jtG7a$react, {forwardRef as $jtG7a$forwardRef} from "react";
|
|
6
6
|
import {Text as $jtG7a$Text} from "@react-spectrum/text";
|
|
@@ -39,7 +39,7 @@ const $c2a9f60d7159b63f$export$37acb3580601e69a = /*#__PURE__*/ (0, $jtG7a$forwa
|
|
|
39
39
|
[`spectrum-Badge--${variant}`]: variant
|
|
40
40
|
}, styleProps.className),
|
|
41
41
|
ref: domRef
|
|
42
|
-
}, /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$SlotProvider), {
|
|
42
|
+
}, /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$ClearSlots), null, /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$SlotProvider), {
|
|
43
43
|
slots: {
|
|
44
44
|
icon: {
|
|
45
45
|
size: 'S',
|
|
@@ -49,7 +49,7 @@ const $c2a9f60d7159b63f$export$37acb3580601e69a = /*#__PURE__*/ (0, $jtG7a$forwa
|
|
|
49
49
|
UNSAFE_className: (0, $jtG7a$classNames)((0, ($parcel$interopDefault($jtG7a$badge_vars_cssmodulejs))), 'spectrum-Badge-label')
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$Text), null, children) : children));
|
|
52
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$Text), null, children) : children)));
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
|
package/dist/Badge.module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./badge.814a37ed.css";
|
|
2
2
|
import $jtG7a$badge_vars_cssmodulejs from "./badge_vars_css.module.js";
|
|
3
|
-
import {useDOMRef as $jtG7a$useDOMRef, useStyleProps as $jtG7a$useStyleProps, classNames as $jtG7a$classNames, SlotProvider as $jtG7a$SlotProvider} from "@react-spectrum/utils";
|
|
3
|
+
import {useDOMRef as $jtG7a$useDOMRef, useStyleProps as $jtG7a$useStyleProps, classNames as $jtG7a$classNames, ClearSlots as $jtG7a$ClearSlots, SlotProvider as $jtG7a$SlotProvider} from "@react-spectrum/utils";
|
|
4
4
|
import {filterDOMProps as $jtG7a$filterDOMProps} from "@react-aria/utils";
|
|
5
5
|
import $jtG7a$react, {forwardRef as $jtG7a$forwardRef} from "react";
|
|
6
6
|
import {Text as $jtG7a$Text} from "@react-spectrum/text";
|
|
@@ -39,7 +39,7 @@ const $c2a9f60d7159b63f$export$37acb3580601e69a = /*#__PURE__*/ (0, $jtG7a$forwa
|
|
|
39
39
|
[`spectrum-Badge--${variant}`]: variant
|
|
40
40
|
}, styleProps.className),
|
|
41
41
|
ref: domRef
|
|
42
|
-
}, /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$SlotProvider), {
|
|
42
|
+
}, /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$ClearSlots), null, /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$SlotProvider), {
|
|
43
43
|
slots: {
|
|
44
44
|
icon: {
|
|
45
45
|
size: 'S',
|
|
@@ -49,7 +49,7 @@ const $c2a9f60d7159b63f$export$37acb3580601e69a = /*#__PURE__*/ (0, $jtG7a$forwa
|
|
|
49
49
|
UNSAFE_className: (0, $jtG7a$classNames)((0, ($parcel$interopDefault($jtG7a$badge_vars_cssmodulejs))), 'spectrum-Badge-label')
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$Text), null, children) : children));
|
|
52
|
+
}, typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $jtG7a$react).createElement((0, $jtG7a$Text), null, children) : children)));
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
|
package/dist/Badge.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAeM,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnG,IAAI,YACF,QAAQ,WACR,OAAO,EACP,GAAG,YACJ,GAAG,CAAA,GAAA,uBAAe,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,uDAAK,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,gCAAC,CAAA,GAAA,WAAG,SAAG,YACP;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAeM,MAAM,0DAAQ,CAAA,GAAA,iBAAS,EAAE,SAAS,MAAM,KAAyB,EAAE,GAA2B;IACnG,IAAI,YACF,QAAQ,WACR,OAAO,EACP,GAAG,YACJ,GAAG,CAAA,GAAA,uBAAe,EAAE;IACrB,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,aAAa,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,QAAQ,EAAE,KAAK,CAAC,CAAA,IAAK,eAAC,CAAA,GAAA,YAAI,EAAE,cAAc,CAAC;IAEzF,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,uDAAK,GACL,kBACA;YACE,CAAC,CAAC,gBAAgB,EAAE,SAAS,CAAC,EAAE;QAClC,GACA,WAAW,SAAS;QAEtB,KAAK;qBACL,gCAAC,CAAA,GAAA,iBAAS,uBACR,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,MAAM;gBACJ,MAAM;gBACN,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;YACvC;YACA,MAAM;gBACJ,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,uDAAK,GAAG;YACvC;QACF;OAGE,OAAO,aAAa,YAAY,2BAC5B,gCAAC,CAAA,GAAA,WAAG,SAAG,YACP;AAMhB","sources":["packages/@react-spectrum/badge/src/Badge.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames, ClearSlots, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React, {forwardRef} from 'react';\nimport {SpectrumBadgeProps} from '@react-types/badge';\nimport styles from '@adobe/spectrum-css-temp/components/badge/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n\n/**\n * Badges are used for showing a small amount of color-categorized metadata, ideal for getting a user's attention.\n */\nexport const Badge = forwardRef(function Badge(props: SpectrumBadgeProps, ref: DOMRef<HTMLDivElement>) {\n let {\n children,\n variant,\n ...otherProps\n } = useProviderProps(props);\n let domRef = useDOMRef(ref);\n let {styleProps} = useStyleProps(otherProps);\n let isTextOnly = React.Children.toArray(props.children).every(c => !React.isValidElement(c));\n\n return (\n <span\n {...filterDOMProps(otherProps)}\n {...styleProps}\n role=\"presentation\"\n className={classNames(\n styles,\n 'spectrum-Badge',\n {\n [`spectrum-Badge--${variant}`]: variant\n },\n styleProps.className\n )}\n ref={domRef}>\n <ClearSlots>\n <SlotProvider\n slots={{\n icon: {\n size: 'S',\n UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')\n },\n text: {\n UNSAFE_className: classNames(styles, 'spectrum-Badge-label')\n }\n }}>\n\n {\n typeof children === 'string' || isTextOnly\n ? <Text>{children}</Text>\n : children\n }\n </SlotProvider>\n </ClearSlots>\n </span>\n );\n});\n"],"names":[],"version":3,"file":"Badge.module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;AAsBA;;GAEG;AACH,OAAO,MAAM,
|
|
1
|
+
{"mappings":";;;AAsBA;;GAEG;AACH,OAAO,MAAM,6GA6CX,CAAC;ACvDH,YAAY,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC","sources":["packages/@react-spectrum/badge/src/packages/@react-spectrum/badge/src/Badge.tsx","packages/@react-spectrum/badge/src/packages/@react-spectrum/badge/src/index.ts","packages/@react-spectrum/badge/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2022 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 {Badge} from './Badge';\nexport type {SpectrumBadgeProps} from '@react-types/badge';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/badge",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.26",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"url": "https://github.com/adobe/react-spectrum"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@react-aria/utils": "^3.
|
|
44
|
-
"@react-spectrum/text": "^3.5.
|
|
45
|
-
"@react-spectrum/utils": "^3.12.
|
|
46
|
-
"@react-types/badge": "^3.1.
|
|
47
|
-
"@react-types/shared": "^3.
|
|
43
|
+
"@react-aria/utils": "^3.30.0",
|
|
44
|
+
"@react-spectrum/text": "^3.5.18",
|
|
45
|
+
"@react-spectrum/utils": "^3.12.7",
|
|
46
|
+
"@react-types/badge": "^3.1.19",
|
|
47
|
+
"@react-types/shared": "^3.31.0",
|
|
48
48
|
"@swc/helpers": "^0.5.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "8b9348ff255e018b2dd9b27e2a45507cadfa1d35"
|
|
62
62
|
}
|
package/src/Badge.tsx
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {classNames, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';
|
|
13
|
+
import {classNames, ClearSlots, SlotProvider, useDOMRef, useStyleProps} from '@react-spectrum/utils';
|
|
14
14
|
import {DOMRef} from '@react-types/shared';
|
|
15
15
|
import {filterDOMProps} from '@react-aria/utils';
|
|
16
16
|
import React, {forwardRef} from 'react';
|
|
@@ -47,23 +47,25 @@ export const Badge = forwardRef(function Badge(props: SpectrumBadgeProps, ref: D
|
|
|
47
47
|
styleProps.className
|
|
48
48
|
)}
|
|
49
49
|
ref={domRef}>
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
<ClearSlots>
|
|
51
|
+
<SlotProvider
|
|
52
|
+
slots={{
|
|
53
|
+
icon: {
|
|
54
|
+
size: 'S',
|
|
55
|
+
UNSAFE_className: classNames(styles, 'spectrum-Badge-icon')
|
|
56
|
+
},
|
|
57
|
+
text: {
|
|
58
|
+
UNSAFE_className: classNames(styles, 'spectrum-Badge-label')
|
|
59
|
+
}
|
|
60
|
+
}}>
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
{
|
|
63
|
+
typeof children === 'string' || isTextOnly
|
|
64
|
+
? <Text>{children}</Text>
|
|
65
|
+
: children
|
|
66
|
+
}
|
|
67
|
+
</SlotProvider>
|
|
68
|
+
</ClearSlots>
|
|
67
69
|
</span>
|
|
68
70
|
);
|
|
69
71
|
});
|