@fluentui/react-badge 9.1.4 → 9.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +58 -1
- package/CHANGELOG.md +18 -2
- package/lib/Badge.js.map +1 -1
- package/lib/CounterBadge.js.map +1 -1
- package/lib/PresenceBadge.js.map +1 -1
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.js.map +1 -1
- package/lib/components/Badge/index.js.map +1 -1
- package/lib/components/Badge/renderBadge.js +1 -7
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.js +1 -0
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib/components/CounterBadge/index.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js +1 -0
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib/components/PresenceBadge/index.js.map +1 -1
- package/lib/components/PresenceBadge/presenceIcons.js +34 -41
- package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js +2 -2
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Badge.js +5 -4
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js +5 -4
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js +5 -4
- package/lib-commonjs/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.js +19 -20
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.js +3 -2
- package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
- package/lib-commonjs/components/Badge/index.js +8 -7
- package/lib-commonjs/components/Badge/index.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +13 -19
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.js +29 -34
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +608 -310
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js +19 -20
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.js +3 -2
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js +8 -7
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +24 -30
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +54 -34
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +19 -20
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js +3 -2
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js +8 -7
- package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js +146 -134
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +61 -65
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +102 -78
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js +28 -85
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -8
- package/lib-amd/Badge.js +0 -6
- package/lib-amd/Badge.js.map +0 -1
- package/lib-amd/CounterBadge.js +0 -6
- package/lib-amd/CounterBadge.js.map +0 -1
- package/lib-amd/PresenceBadge.js +0 -6
- package/lib-amd/PresenceBadge.js.map +0 -1
- package/lib-amd/components/Badge/Badge.js +0 -17
- package/lib-amd/components/Badge/Badge.js.map +0 -1
- package/lib-amd/components/Badge/Badge.types.js +0 -5
- package/lib-amd/components/Badge/Badge.types.js.map +0 -1
- package/lib-amd/components/Badge/index.js +0 -9
- package/lib-amd/components/Badge/index.js.map +0 -1
- package/lib-amd/components/Badge/renderBadge.js +0 -14
- package/lib-amd/components/Badge/renderBadge.js.map +0 -1
- package/lib-amd/components/Badge/useBadge.js +0 -27
- package/lib-amd/components/Badge/useBadge.js.map +0 -1
- package/lib-amd/components/Badge/useBadgeStyles.js +0 -212
- package/lib-amd/components/Badge/useBadgeStyles.js.map +0 -1
- package/lib-amd/components/CounterBadge/CounterBadge.js +0 -17
- package/lib-amd/components/CounterBadge/CounterBadge.js.map +0 -1
- package/lib-amd/components/CounterBadge/CounterBadge.types.js +0 -5
- package/lib-amd/components/CounterBadge/CounterBadge.types.js.map +0 -1
- package/lib-amd/components/CounterBadge/index.js +0 -9
- package/lib-amd/components/CounterBadge/index.js.map +0 -1
- package/lib-amd/components/CounterBadge/useCounterBadge.js +0 -18
- package/lib-amd/components/CounterBadge/useCounterBadge.js.map +0 -1
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js +0 -28
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js.map +0 -1
- package/lib-amd/components/PresenceBadge/PresenceBadge.js +0 -17
- package/lib-amd/components/PresenceBadge/PresenceBadge.js.map +0 -1
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.js +0 -5
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.js.map +0 -1
- package/lib-amd/components/PresenceBadge/index.js +0 -9
- package/lib-amd/components/PresenceBadge/index.js.map +0 -1
- package/lib-amd/components/PresenceBadge/presenceIcons.js +0 -146
- package/lib-amd/components/PresenceBadge/presenceIcons.js.map +0 -1
- package/lib-amd/components/PresenceBadge/usePresenceBadge.js +0 -53
- package/lib-amd/components/PresenceBadge/usePresenceBadge.js.map +0 -1
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js +0 -101
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js.map +0 -1
- package/lib-amd/index.js +0 -19
- package/lib-amd/index.js.map +0 -1
@@ -1,86 +1,110 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
presenceBadgeClassNames: ()=>presenceBadgeClassNames,
|
13
|
+
usePresenceBadgeStyles_unstable: ()=>usePresenceBadgeStyles_unstable
|
5
14
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
|
9
|
-
|
10
|
-
root: 'fui-PresenceBadge',
|
11
|
-
icon: 'fui-PresenceBadge__icon'
|
15
|
+
const _react = require("@griffel/react");
|
16
|
+
const presenceBadgeClassNames = {
|
17
|
+
root: 'fui-PresenceBadge',
|
18
|
+
icon: 'fui-PresenceBadge__icon'
|
12
19
|
};
|
13
|
-
const getIsBusy = status
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
20
|
+
const getIsBusy = (status)=>{
|
21
|
+
if (status === 'busy' || status === 'do-not-disturb' || status === 'blocked') {
|
22
|
+
return true;
|
23
|
+
}
|
24
|
+
return false;
|
18
25
|
};
|
19
|
-
const useRootClassName = /*#__PURE__*/
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
26
|
+
const useRootClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r11sysef", null, [
|
27
|
+
".r11sysef{padding:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;border-radius:var(--borderRadiusCircular);background-color:var(--colorNeutralBackground1);}",
|
28
|
+
".r11sysef span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}"
|
29
|
+
]);
|
30
|
+
const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
31
|
+
statusBusy: {
|
32
|
+
sj55zd: "fvi85wt"
|
33
|
+
},
|
34
|
+
statusAway: {
|
35
|
+
sj55zd: "f14k8a89"
|
36
|
+
},
|
37
|
+
statusAvailable: {
|
38
|
+
sj55zd: "fqa5hgp"
|
39
|
+
},
|
40
|
+
statusOffline: {
|
41
|
+
sj55zd: "f11d4kpn"
|
42
|
+
},
|
43
|
+
statusOutOfOffice: {
|
44
|
+
sj55zd: "fdce8r3"
|
45
|
+
},
|
46
|
+
statusUnknown: {
|
47
|
+
sj55zd: "f11d4kpn"
|
48
|
+
},
|
49
|
+
outOfOffice: {
|
50
|
+
sj55zd: "fr0bkrk"
|
51
|
+
},
|
52
|
+
outOfOfficeAvailable: {
|
53
|
+
sj55zd: "fqa5hgp"
|
54
|
+
},
|
55
|
+
outOfOfficeBusy: {
|
56
|
+
sj55zd: "fvi85wt"
|
57
|
+
},
|
58
|
+
outOfOfficeUnknown: {
|
59
|
+
sj55zd: "f11d4kpn"
|
60
|
+
},
|
61
|
+
tiny: {
|
62
|
+
Bubjx69: "f9ikmtg",
|
63
|
+
a9b677: "f16dn6v3",
|
64
|
+
B5pe6w7: "fab5kbq",
|
65
|
+
p4uzdd: "f1ms1d91"
|
66
|
+
},
|
67
|
+
large: {
|
68
|
+
Bubjx69: "f9ikmtg",
|
69
|
+
a9b677: "f64fuq3",
|
70
|
+
B5pe6w7: "f1vfi1yj",
|
71
|
+
p4uzdd: "f15s34gz"
|
72
|
+
},
|
73
|
+
extraLarge: {
|
74
|
+
Bubjx69: "f9ikmtg",
|
75
|
+
a9b677: "f1w9dchk",
|
76
|
+
B5pe6w7: "f14efy9b",
|
77
|
+
p4uzdd: "fhipgdu"
|
78
|
+
}
|
69
79
|
}, {
|
70
|
-
|
80
|
+
d: [
|
81
|
+
".fvi85wt{color:var(--colorPaletteRedBackground3);}",
|
82
|
+
".f14k8a89{color:var(--colorPaletteMarigoldBackground3);}",
|
83
|
+
".fqa5hgp{color:var(--colorPaletteLightGreenForeground3);}",
|
84
|
+
".f11d4kpn{color:var(--colorNeutralForeground3);}",
|
85
|
+
".fdce8r3{color:var(--colorPaletteBerryForeground3);}",
|
86
|
+
".fr0bkrk{color:var(--colorNeutralBackground1);}",
|
87
|
+
".f9ikmtg{aspect-ratio:1;}",
|
88
|
+
".f16dn6v3{width:6px;}",
|
89
|
+
".fab5kbq svg{width:6px!important;}",
|
90
|
+
".f1ms1d91 svg{height:6px!important;}",
|
91
|
+
".f64fuq3{width:20px;}",
|
92
|
+
".f1vfi1yj svg{width:20px!important;}",
|
93
|
+
".f15s34gz svg{height:20px!important;}",
|
94
|
+
".f1w9dchk{width:28px;}",
|
95
|
+
".f14efy9b svg{width:28px!important;}",
|
96
|
+
".fhipgdu svg{height:28px!important;}"
|
97
|
+
]
|
71
98
|
});
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
const
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
return state;
|
84
|
-
};
|
85
|
-
exports.usePresenceBadgeStyles_unstable = usePresenceBadgeStyles_unstable;
|
99
|
+
const usePresenceBadgeStyles_unstable = (state)=>{
|
100
|
+
const rootClassName = useRootClassName();
|
101
|
+
const styles = useStyles();
|
102
|
+
const isBusy = getIsBusy(state.status);
|
103
|
+
state.root.className = (0, _react.mergeClasses)(presenceBadgeClassNames.root, rootClassName, isBusy && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'out-of-office' && styles.statusOutOfOffice, state.status === 'unknown' && styles.statusUnknown, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.statusAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && state.status === 'unknown' && styles.outOfOfficeUnknown, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
|
104
|
+
if (state.icon) {
|
105
|
+
state.icon.className = (0, _react.mergeClasses)(presenceBadgeClassNames.icon, state.icon.className);
|
106
|
+
}
|
107
|
+
return state;
|
108
|
+
}; //# sourceMappingURL=usePresenceBadgeStyles.js.map
|
109
|
+
|
86
110
|
//# sourceMappingURL=usePresenceBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/PresenceBadge/usePresenceBadgeStyles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const presenceBadgeClassNames = {\n root: 'fui-PresenceBadge',\n icon: 'fui-PresenceBadge__icon'\n};\nconst getIsBusy = status => {\n if (status === 'busy' || status === 'do-not-disturb' || status === 'blocked') {\n return true;\n }\n return false;\n};\nconst useRootClassName = /*#__PURE__*/__resetStyles(\"r11sysef\", null, [\".r11sysef{padding:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;border-radius:var(--borderRadiusCircular);background-color:var(--colorNeutralBackground1);}\", \".r11sysef span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\"]);\nconst useStyles = /*#__PURE__*/__styles({\n statusBusy: {\n sj55zd: \"fvi85wt\"\n },\n statusAway: {\n sj55zd: \"f14k8a89\"\n },\n statusAvailable: {\n sj55zd: \"fqa5hgp\"\n },\n statusOffline: {\n sj55zd: \"f11d4kpn\"\n },\n statusOutOfOffice: {\n sj55zd: \"fdce8r3\"\n },\n statusUnknown: {\n sj55zd: \"f11d4kpn\"\n },\n outOfOffice: {\n sj55zd: \"fr0bkrk\"\n },\n outOfOfficeAvailable: {\n sj55zd: \"fqa5hgp\"\n },\n outOfOfficeBusy: {\n sj55zd: \"fvi85wt\"\n },\n outOfOfficeUnknown: {\n sj55zd: \"f11d4kpn\"\n },\n tiny: {\n Bubjx69: \"f9ikmtg\",\n a9b677: \"f16dn6v3\",\n B5pe6w7: \"fab5kbq\",\n p4uzdd: \"f1ms1d91\"\n },\n large: {\n Bubjx69: \"f9ikmtg\",\n a9b677: \"f64fuq3\",\n B5pe6w7: \"f1vfi1yj\",\n p4uzdd: \"f15s34gz\"\n },\n extraLarge: {\n Bubjx69: \"f9ikmtg\",\n a9b677: \"f1w9dchk\",\n B5pe6w7: \"f14efy9b\",\n p4uzdd: \"fhipgdu\"\n }\n}, {\n d: [\".fvi85wt{color:var(--colorPaletteRedBackground3);}\", \".f14k8a89{color:var(--colorPaletteMarigoldBackground3);}\", \".fqa5hgp{color:var(--colorPaletteLightGreenForeground3);}\", \".f11d4kpn{color:var(--colorNeutralForeground3);}\", \".fdce8r3{color:var(--colorPaletteBerryForeground3);}\", \".fr0bkrk{color:var(--colorNeutralBackground1);}\", \".f9ikmtg{aspect-ratio:1;}\", \".f16dn6v3{width:6px;}\", \".fab5kbq svg{width:6px!important;}\", \".f1ms1d91 svg{height:6px!important;}\", \".f64fuq3{width:20px;}\", \".f1vfi1yj svg{width:20px!important;}\", \".f15s34gz svg{height:20px!important;}\", \".f1w9dchk{width:28px;}\", \".f14efy9b svg{width:28px!important;}\", \".fhipgdu svg{height:28px!important;}\"]\n});\n/**\n * Applies style classnames to slots\n */\nexport const usePresenceBadgeStyles_unstable = state => {\n const rootClassName = useRootClassName();\n const styles = useStyles();\n const isBusy = getIsBusy(state.status);\n state.root.className = mergeClasses(presenceBadgeClassNames.root, rootClassName, isBusy && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'out-of-office' && styles.statusOutOfOffice, state.status === 'unknown' && styles.statusUnknown, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.statusAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && state.status === 'unknown' && styles.outOfOfficeUnknown, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);\n }\n return state;\n};\n//# sourceMappingURL=usePresenceBadgeStyles.js.map"],"names":["presenceBadgeClassNames","usePresenceBadgeStyles_unstable","root","icon","getIsBusy","status","useRootClassName","__resetStyles","useStyles","__styles","statusBusy","sj55zd","statusAway","statusAvailable","statusOffline","statusOutOfOffice","statusUnknown","outOfOffice","outOfOfficeAvailable","outOfOfficeBusy","outOfOfficeUnknown","tiny","Bubjx69","a9b677","B5pe6w7","p4uzdd","large","extraLarge","d","state","rootClassName","styles","isBusy","className","mergeClasses","size"],"mappings":"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"}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,88 +1,31 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
5
|
-
});
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
Object.defineProperty(exports, "useBadge_unstable", {
|
33
|
-
enumerable: true,
|
34
|
-
get: function () {
|
35
|
-
return Badge_1.useBadge_unstable;
|
36
|
-
}
|
37
|
-
});
|
38
|
-
var PresenceBadge_1 = /*#__PURE__*/require("./PresenceBadge");
|
39
|
-
Object.defineProperty(exports, "PresenceBadge", {
|
40
|
-
enumerable: true,
|
41
|
-
get: function () {
|
42
|
-
return PresenceBadge_1.PresenceBadge;
|
43
|
-
}
|
44
|
-
});
|
45
|
-
Object.defineProperty(exports, "presenceBadgeClassNames", {
|
46
|
-
enumerable: true,
|
47
|
-
get: function () {
|
48
|
-
return PresenceBadge_1.presenceBadgeClassNames;
|
49
|
-
}
|
50
|
-
});
|
51
|
-
Object.defineProperty(exports, "usePresenceBadgeStyles_unstable", {
|
52
|
-
enumerable: true,
|
53
|
-
get: function () {
|
54
|
-
return PresenceBadge_1.usePresenceBadgeStyles_unstable;
|
55
|
-
}
|
56
|
-
});
|
57
|
-
Object.defineProperty(exports, "usePresenceBadge_unstable", {
|
58
|
-
enumerable: true,
|
59
|
-
get: function () {
|
60
|
-
return PresenceBadge_1.usePresenceBadge_unstable;
|
61
|
-
}
|
62
|
-
});
|
63
|
-
var CounterBadge_1 = /*#__PURE__*/require("./CounterBadge");
|
64
|
-
Object.defineProperty(exports, "CounterBadge", {
|
65
|
-
enumerable: true,
|
66
|
-
get: function () {
|
67
|
-
return CounterBadge_1.CounterBadge;
|
68
|
-
}
|
69
|
-
});
|
70
|
-
Object.defineProperty(exports, "counterBadgeClassNames", {
|
71
|
-
enumerable: true,
|
72
|
-
get: function () {
|
73
|
-
return CounterBadge_1.counterBadgeClassNames;
|
74
|
-
}
|
75
|
-
});
|
76
|
-
Object.defineProperty(exports, "useCounterBadgeStyles_unstable", {
|
77
|
-
enumerable: true,
|
78
|
-
get: function () {
|
79
|
-
return CounterBadge_1.useCounterBadgeStyles_unstable;
|
80
|
-
}
|
81
|
-
});
|
82
|
-
Object.defineProperty(exports, "useCounterBadge_unstable", {
|
83
|
-
enumerable: true,
|
84
|
-
get: function () {
|
85
|
-
return CounterBadge_1.useCounterBadge_unstable;
|
86
|
-
}
|
87
|
-
});
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
Badge: ()=>_badge.Badge,
|
13
|
+
badgeClassNames: ()=>_badge.badgeClassNames,
|
14
|
+
renderBadge_unstable: ()=>_badge.renderBadge_unstable,
|
15
|
+
useBadgeStyles_unstable: ()=>_badge.useBadgeStyles_unstable,
|
16
|
+
useBadge_unstable: ()=>_badge.useBadge_unstable,
|
17
|
+
PresenceBadge: ()=>_presenceBadge.PresenceBadge,
|
18
|
+
presenceBadgeClassNames: ()=>_presenceBadge.presenceBadgeClassNames,
|
19
|
+
usePresenceBadgeStyles_unstable: ()=>_presenceBadge.usePresenceBadgeStyles_unstable,
|
20
|
+
usePresenceBadge_unstable: ()=>_presenceBadge.usePresenceBadge_unstable,
|
21
|
+
CounterBadge: ()=>_counterBadge.CounterBadge,
|
22
|
+
counterBadgeClassNames: ()=>_counterBadge.counterBadgeClassNames,
|
23
|
+
useCounterBadgeStyles_unstable: ()=>_counterBadge.useCounterBadgeStyles_unstable,
|
24
|
+
useCounterBadge_unstable: ()=>_counterBadge.useCounterBadge_unstable
|
25
|
+
});
|
26
|
+
const _badge = require("./Badge");
|
27
|
+
const _presenceBadge = require("./PresenceBadge");
|
28
|
+
const _counterBadge = require("./CounterBadge");
|
29
|
+
//# sourceMappingURL=index.js.map
|
30
|
+
|
88
31
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';\nexport { PresenceBadge, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, usePresenceBadge_unstable } from './PresenceBadge';\nexport { CounterBadge, counterBadgeClassNames, useCounterBadgeStyles_unstable, useCounterBadge_unstable } from './CounterBadge';\n//# sourceMappingURL=index.js.map"],"names":["Badge","badgeClassNames","renderBadge_unstable","useBadgeStyles_unstable","useBadge_unstable","PresenceBadge","presenceBadgeClassNames","usePresenceBadgeStyles_unstable","usePresenceBadge_unstable","CounterBadge","counterBadgeClassNames","useCounterBadgeStyles_unstable","useCounterBadge_unstable"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IACxFC,aAAa,MAAbA,4BAAa;IAAEC,uBAAuB,MAAvBA,sCAAuB;IAAEC,+BAA+B,MAA/BA,8CAA+B;IAAEC,yBAAyB,MAAzBA,wCAAyB;IAClGC,YAAY,MAAZA,0BAAY;IAAEC,sBAAsB,MAAtBA,oCAAsB;IAAEC,8BAA8B,MAA9BA,4CAA8B;IAAEC,wBAAwB,MAAxBA,sCAAwB;;uBAFE;+BACU;8BACJ;CAC/G,iCAAiC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-badge",
|
3
|
-
"version": "9.1.
|
3
|
+
"version": "9.1.5",
|
4
4
|
"description": "React components for building web experiences",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -22,22 +22,22 @@
|
|
22
22
|
"test": "jest --passWithNoTests",
|
23
23
|
"storybook": "start-storybook",
|
24
24
|
"type-check": "tsc -b tsconfig.json",
|
25
|
-
"generate-api": "
|
25
|
+
"generate-api": "just-scripts generate-api"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
29
29
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
30
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.20",
|
31
31
|
"@fluentui/scripts-api-extractor": "*",
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@fluentui/react-icons": "^2.0.
|
36
|
-
"@fluentui/react-shared-contexts": "^9.3.
|
37
|
-
"@fluentui/react-theme": "^9.1.
|
38
|
-
"@fluentui/react-utilities": "^9.7.
|
35
|
+
"@fluentui/react-icons": "^2.0.196",
|
36
|
+
"@fluentui/react-shared-contexts": "^9.3.2",
|
37
|
+
"@fluentui/react-theme": "^9.1.7",
|
38
|
+
"@fluentui/react-utilities": "^9.7.2",
|
39
39
|
"@griffel/react": "^1.5.2",
|
40
|
-
"
|
40
|
+
"@swc/helpers": "^0.4.14"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
43
43
|
"@types/react": ">=16.8.0 <19.0.0",
|
@@ -54,6 +54,7 @@
|
|
54
54
|
"exports": {
|
55
55
|
".": {
|
56
56
|
"types": "./dist/index.d.ts",
|
57
|
+
"node": "./lib-commonjs/index.js",
|
57
58
|
"import": "./lib/index.js",
|
58
59
|
"require": "./lib-commonjs/index.js"
|
59
60
|
},
|
package/lib-amd/Badge.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/Badge/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=Badge.js.map
|
package/lib-amd/Badge.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-badge/src/Badge.ts"],"names":[],"mappings":";;;IAAA,uCAAyC","sourcesContent":["export * from './components/Badge/index';\n"]}
|
package/lib-amd/CounterBadge.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/CounterBadge/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=CounterBadge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CounterBadge.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-badge/src/CounterBadge.ts"],"names":[],"mappings":";;;IAAA,uCAAgD","sourcesContent":["export * from './components/CounterBadge/index';\n"]}
|
package/lib-amd/PresenceBadge.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/PresenceBadge/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=PresenceBadge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"PresenceBadge.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-badge/src/PresenceBadge.ts"],"names":[],"mappings":";;;IAAA,uCAAiD","sourcesContent":["export * from './components/PresenceBadge/index';\n"]}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "./useBadge", "./useBadgeStyles", "@fluentui/react-shared-contexts", "./renderBadge"], function (require, exports, React, useBadge_1, useBadgeStyles_1, react_shared_contexts_1, renderBadge_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.Badge = void 0;
|
5
|
-
/**
|
6
|
-
* Define a styled Badge, using the `useBadge_unstable` hook.
|
7
|
-
*/
|
8
|
-
exports.Badge = React.forwardRef(function (props, ref) {
|
9
|
-
var state = useBadge_1.useBadge_unstable(props, ref);
|
10
|
-
useBadgeStyles_1.useBadgeStyles_unstable(state);
|
11
|
-
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useBadgeStyles_unstable;
|
12
|
-
useCustomStyles(state);
|
13
|
-
return renderBadge_1.renderBadge_unstable(state);
|
14
|
-
});
|
15
|
-
exports.Badge.displayName = 'Badge';
|
16
|
-
});
|
17
|
-
//# sourceMappingURL=Badge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,KAAK,GAAoC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE5C,wCAAuB,CAAC,KAAK,CAAC,CAAC;QAEvB,IAAyB,eAAe,GAAK,oDAA4B,EAAE,wBAAnC,CAAoC;QACpF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from './renderBadge';\nimport type { BadgeProps } from './Badge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const Badge: ForwardRefComponent<BadgeProps> = React.forwardRef((props, ref) => {\n const state = useBadge_unstable(props, ref);\n\n useBadgeStyles_unstable(state);\n\n const { useBadgeStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Badge.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/Badge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type BadgeSlots = {\n root: Slot<'div'>;\n icon?: Slot<'span'>;\n};\n\n// react has a non-standard `color` attribute in its types\n// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a4ab0fa432320e70da9e51c8ae2e47377f65804b/types/react/index.d.ts#L1868\nexport type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & {\n /**\n * A Badge can be filled, outline, ghost, inverted\n * @defaultvalue filled\n */\n appearance?: 'filled' | 'ghost' | 'outline' | 'tint';\n\n /**\n * A Badge can be one of preset colors\n * @defaultvalue brand\n */\n color?: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';\n\n /**\n * A Badge can position the icon before or after the content.\n * @defaultvalue before\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A Badge can be square, circular or rounded.\n * @defaultvalue circular\n */\n shape?: 'circular' | 'rounded' | 'square';\n\n /**\n * A Badge can be on of several preset sizes.\n * @defaultvalue medium\n */\n size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n};\n\nexport type BadgeState = ComponentState<BadgeSlots> &\n Required<Pick<BadgeProps, 'appearance' | 'color' | 'iconPosition' | 'shape' | 'size'>>;\n"]}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./Badge", "./renderBadge", "./useBadge", "./useBadgeStyles"], function (require, exports, tslib_1, Badge_1, renderBadge_1, useBadge_1, useBadgeStyles_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(Badge_1, exports);
|
5
|
-
tslib_1.__exportStar(renderBadge_1, exports);
|
6
|
-
tslib_1.__exportStar(useBadge_1, exports);
|
7
|
-
tslib_1.__exportStar(useBadgeStyles_1, exports);
|
8
|
-
});
|
9
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/index.ts"],"names":[],"mappings":";;;IAAA,uCAAwB;IAGxB,6CAA8B;IAC9B,0CAA2B;IAC3B,gDAAiC","sourcesContent":["export * from './Badge';\n// Explicit exports to omit BadgeCommons\nexport type { BadgeProps, BadgeSlots, BadgeState } from './Badge.types';\nexport * from './renderBadge';\nexport * from './useBadge';\nexport * from './useBadgeStyles';\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.renderBadge_unstable = void 0;
|
5
|
-
var renderBadge_unstable = function (state) {
|
6
|
-
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
7
|
-
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
8
|
-
state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
|
9
|
-
state.root.children,
|
10
|
-
state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon))));
|
11
|
-
};
|
12
|
-
exports.renderBadge_unstable = renderBadge_unstable;
|
13
|
-
});
|
14
|
-
//# sourceMappingURL=renderBadge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"renderBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;IAIO,IAAM,oBAAoB,GAAG,UAAC,KAAiB;QAC9C,IAAA,KAAuB,0BAAQ,CAAa,KAAK,CAAC,EAAhD,KAAK,WAAA,EAAE,SAAS,eAAgC,CAAC;QAEzD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,YAAY,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACnF,KAAK,CAAC,IAAI,CAAC,QAAQ;YACnB,KAAK,CAAC,YAAY,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACxE,CACd,CAAC;IACJ,CAAC,CAAC;IAVW,QAAA,oBAAoB,wBAU/B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { BadgeState, BadgeSlots } from './Badge.types';\n\nexport const renderBadge_unstable = (state: BadgeState) => {\n const { slots, slotProps } = getSlots<BadgeSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.iconPosition === 'before' && slots.icon && <slots.icon {...slotProps.icon} />}\n {state.root.children}\n {state.iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useBadge_unstable = void 0;
|
5
|
-
/**
|
6
|
-
* Returns the props and state required to render the component
|
7
|
-
*/
|
8
|
-
var useBadge_unstable = function (props, ref) {
|
9
|
-
var _a = props.shape, shape = _a === void 0 ? 'circular' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.iconPosition, iconPosition = _c === void 0 ? 'before' : _c, _d = props.appearance, appearance = _d === void 0 ? 'filled' : _d, _e = props.color, color = _e === void 0 ? 'brand' : _e;
|
10
|
-
var state = {
|
11
|
-
shape: shape,
|
12
|
-
size: size,
|
13
|
-
iconPosition: iconPosition,
|
14
|
-
appearance: appearance,
|
15
|
-
color: color,
|
16
|
-
components: {
|
17
|
-
root: 'div',
|
18
|
-
icon: 'span',
|
19
|
-
},
|
20
|
-
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
|
21
|
-
icon: react_utilities_1.resolveShorthand(props.icon),
|
22
|
-
};
|
23
|
-
return state;
|
24
|
-
};
|
25
|
-
exports.useBadge_unstable = useBadge_unstable;
|
26
|
-
});
|
27
|
-
//# sourceMappingURL=useBadge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/useBadge.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAA2B;QAE5E,IAAA,KAKE,KAAK,MALW,EAAlB,KAAK,mBAAG,UAAU,KAAA,EAClB,KAIE,KAAK,KAJQ,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,KAGE,KAAK,aAHgB,EAAvB,YAAY,mBAAG,QAAQ,KAAA,EACvB,KAEE,KAAK,WAFc,EAArB,UAAU,mBAAG,QAAQ,KAAA,EACrB,KACE,KAAK,MADQ,EAAf,KAAK,mBAAG,OAAO,KAAA,CACP;QAEV,IAAM,KAAK,GAAe;YACxB,KAAK,OAAA;YACL,IAAI,MAAA;YACJ,YAAY,cAAA;YACZ,UAAU,YAAA;YACV,KAAK,OAAA;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,MAAM;aACb;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,IACA,KAAK,EACR;YACF,IAAI,EAAE,kCAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;SACnC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA3BW,QAAA,iBAAiB,qBA2B5B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { BadgeProps, BadgeState } from './Badge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useBadge_unstable = (props: BadgeProps, ref: React.Ref<HTMLElement>): BadgeState => {\n const {\n shape = 'circular',\n size = 'medium',\n iconPosition = 'before',\n appearance = 'filled',\n color = 'brand',\n } = props;\n\n const state: BadgeState = {\n shape,\n size,\n iconPosition,\n appearance,\n color,\n components: {\n root: 'div',\n icon: 'span',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n icon: resolveShorthand(props.icon),\n };\n\n return state;\n};\n"]}
|