@fluentui/react-badge 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +365 -18
- package/CHANGELOG.md +76 -11
- package/dist/react-badge.d.ts +33 -28
- package/lib/components/Badge/Badge.d.ts +1 -1
- package/lib/components/Badge/Badge.js +8 -8
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.d.ts +4 -5
- package/lib/components/Badge/index.d.ts +1 -1
- package/lib/components/Badge/index.js +0 -1
- package/lib/components/Badge/index.js.map +1 -1
- package/lib/components/Badge/renderBadge.d.ts +1 -1
- package/lib/components/Badge/renderBadge.js +9 -7
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.d.ts +1 -1
- package/lib/components/Badge/useBadge.js +19 -22
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.d.ts +2 -1
- package/lib/components/Badge/useBadgeStyles.js +210 -203
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.d.ts +1 -1
- package/lib/components/CounterBadge/CounterBadge.js +8 -8
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.d.ts +9 -9
- package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js +19 -25
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +2 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +10 -40
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.d.ts +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js +8 -8
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
- package/lib/components/PresenceBadge/presenceIcons.d.ts +11 -0
- package/lib/components/PresenceBadge/presenceIcons.js +128 -0
- package/lib/components/PresenceBadge/presenceIcons.js.map +1 -0
- package/lib/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js +36 -25
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +2 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +43 -46
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/Badge.js +1 -1
- package/lib-commonjs/CounterBadge.js +1 -1
- package/lib-commonjs/PresenceBadge.js +1 -1
- package/lib-commonjs/components/Badge/Badge.d.ts +1 -1
- package/lib-commonjs/components/Badge/Badge.js +9 -9
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.d.ts +4 -5
- package/lib-commonjs/components/Badge/index.d.ts +1 -1
- package/lib-commonjs/components/Badge/index.js +1 -3
- package/lib-commonjs/components/Badge/index.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.d.ts +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +13 -12
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.d.ts +1 -1
- package/lib-commonjs/components/Badge/useBadge.js +22 -26
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +2 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +214 -205
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js +9 -9
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +9 -9
- package/lib-commonjs/components/CounterBadge/index.js +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +21 -28
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +2 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +13 -42
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +9 -9
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
- package/lib-commonjs/components/PresenceBadge/index.js +1 -1
- package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +11 -0
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js +136 -0
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -0
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +38 -28
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +2 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +46 -48
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +14 -15
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -13
- package/lib/common/isConformant.js.map +0 -1
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -111
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -24
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -127
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
@@ -1,62 +1,41 @@
|
|
1
|
-
import { mergeClasses, __styles } from '@
|
2
|
-
import {
|
1
|
+
import { mergeClasses, __styles, shorthands } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
3
|
+
export const presenceBadgeClassName = 'fui-PresenceBadge';
|
3
4
|
|
4
|
-
|
5
|
+
const useStyles = /*#__PURE__*/__styles({
|
5
6
|
"root": {
|
6
7
|
"z8tnut": "f1g0x7ka",
|
7
8
|
"z189sj": ["fhxju0i", "f1cnd47f"],
|
8
9
|
"Byoj8tv": "f1qch9an",
|
9
10
|
"uwmqm3": ["f1cnd47f", "fhxju0i"],
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
|
15
|
-
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
11
|
+
"mc9l5x": "ftuwxu6",
|
12
|
+
"B7ck84d": "f1ewtqcl",
|
13
|
+
"Bt984gj": "f122n59",
|
14
|
+
"Brf1p80": "f4d9j23",
|
15
|
+
"Bhmb4qv": "fb8jth9",
|
16
|
+
"Bbmb7ep": ["fqgqgel", "fchfifz"],
|
17
|
+
"Beyfa6y": ["fchfifz", "fqgqgel"],
|
18
|
+
"B7oj6ja": ["fc7b1hi", "f1dpx5h9"],
|
19
|
+
"Btl43ni": ["f1dpx5h9", "fc7b1hi"],
|
20
|
+
"De3pzq": "fxugw4r"
|
20
21
|
},
|
21
22
|
"statusBusy": {
|
22
|
-
"
|
23
|
-
"g2u3we": "f11ttmz8",
|
24
|
-
"h3c5rm": ["f1ratw88", "f459ikj"],
|
25
|
-
"B9xav0g": "fvovscg",
|
26
|
-
"zhjwy3": ["f459ikj", "f1ratw88"]
|
23
|
+
"sj55zd": "fvi85wt"
|
27
24
|
},
|
28
25
|
"statusAway": {
|
29
|
-
"
|
30
|
-
"g2u3we": "f1skk3ns",
|
31
|
-
"h3c5rm": ["f766wml", "f1rnrfqa"],
|
32
|
-
"B9xav0g": "fb8zvtn",
|
33
|
-
"zhjwy3": ["f1rnrfqa", "f766wml"]
|
26
|
+
"sj55zd": "f14k8a89"
|
34
27
|
},
|
35
28
|
"statusAvailable": {
|
36
|
-
"
|
37
|
-
"g2u3we": "f1t9i9vy",
|
38
|
-
"h3c5rm": ["f1r5awo9", "fnfhfy0"],
|
39
|
-
"B9xav0g": "fgfkvtu",
|
40
|
-
"zhjwy3": ["fnfhfy0", "f1r5awo9"]
|
29
|
+
"sj55zd": "fqa5hgp"
|
41
30
|
},
|
42
31
|
"statusOffline": {
|
43
|
-
"
|
44
|
-
"sj55zd": "f11d4kpn",
|
45
|
-
"g2u3we": "fi2z7s6",
|
46
|
-
"h3c5rm": ["f1agc6it", "f1sit5hz"],
|
47
|
-
"B9xav0g": "f9pok3v",
|
48
|
-
"zhjwy3": ["f1sit5hz", "f1agc6it"]
|
32
|
+
"sj55zd": "f11d4kpn"
|
49
33
|
},
|
50
34
|
"statusOutOfOffice": {
|
51
|
-
"
|
52
|
-
"sj55zd": "fdce8r3",
|
53
|
-
"g2u3we": "f161shwc",
|
54
|
-
"h3c5rm": ["fbde6ui", "f7rrh46"],
|
55
|
-
"B9xav0g": "f1yt3bcc",
|
56
|
-
"zhjwy3": ["f7rrh46", "fbde6ui"]
|
35
|
+
"sj55zd": "fdce8r3"
|
57
36
|
},
|
58
37
|
"outOfOffice": {
|
59
|
-
"
|
38
|
+
"sj55zd": "fr0bkrk"
|
60
39
|
},
|
61
40
|
"outOfOfficeAvailable": {
|
62
41
|
"sj55zd": "fqa5hgp"
|
@@ -66,18 +45,36 @@ var useStyles = /*#__PURE__*/__styles({
|
|
66
45
|
},
|
67
46
|
"outOfOfficeAway": {
|
68
47
|
"sj55zd": "f14k8a89"
|
48
|
+
},
|
49
|
+
"tiny": {
|
50
|
+
"Bubjx69": "f9ikmtg",
|
51
|
+
"a9b677": "f16dn6v3",
|
52
|
+
"B5pe6w7": "fab5kbq",
|
53
|
+
"p4uzdd": "f1ms1d91"
|
54
|
+
},
|
55
|
+
"large": {
|
56
|
+
"Bubjx69": "f9ikmtg",
|
57
|
+
"a9b677": "f64fuq3",
|
58
|
+
"B5pe6w7": "f1vfi1yj",
|
59
|
+
"p4uzdd": "f15s34gz"
|
60
|
+
},
|
61
|
+
"extraLarge": {
|
62
|
+
"Bubjx69": "f9ikmtg",
|
63
|
+
"a9b677": "f1w9dchk",
|
64
|
+
"B5pe6w7": "f14efy9b",
|
65
|
+
"p4uzdd": "fhipgdu"
|
69
66
|
}
|
70
67
|
}, {
|
71
|
-
"d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".
|
68
|
+
"d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f1ewtqcl{box-sizing:border-box;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fb8jth9 span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqgqgel{border-bottom-right-radius:50%;}", ".fchfifz{border-bottom-left-radius:50%;}", ".fc7b1hi{border-top-right-radius:50%;}", ".f1dpx5h9{border-top-left-radius:50%;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".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;}"]
|
72
69
|
});
|
73
70
|
/**
|
74
71
|
* Applies style classnames to slots
|
75
72
|
*/
|
76
73
|
|
77
74
|
|
78
|
-
export
|
79
|
-
|
80
|
-
state.root.className = mergeClasses(styles.root, (state.status === 'busy' || state.status === 'doNotDisturb') && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'outOfOffice' && styles.statusOutOfOffice, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && (state.status === 'busy' || state.status === 'doNotDisturb') && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway,
|
81
|
-
return
|
75
|
+
export const usePresenceBadgeStyles_unstable = state => {
|
76
|
+
const styles = useStyles();
|
77
|
+
state.root.className = mergeClasses(presenceBadgeClassName, styles.root, (state.status === 'busy' || state.status === 'doNotDisturb') && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'outOfOffice' && styles.statusOutOfOffice, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && (state.status === 'busy' || state.status === 'doNotDisturb') && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'outOfOffice' && styles.statusOutOfOffice, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
|
78
|
+
return state;
|
82
79
|
};
|
83
80
|
//# sourceMappingURL=usePresenceBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,
|
1
|
+
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,YAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAGA,OAAO,MAAM,sBAAsB,GAAG,mBAA/B;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAuEA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;AAC/F,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,sBADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,CAAC,KAAK,CAAC,MAAN,KAAiB,MAAjB,IAA2B,KAAK,CAAC,MAAN,KAAiB,cAA7C,KAAgE,MAAM,CAAC,UAHtC,EAIjC,KAAK,CAAC,MAAN,KAAiB,MAAjB,IAA2B,MAAM,CAAC,UAJD,EAKjC,KAAK,CAAC,MAAN,KAAiB,WAAjB,IAAgC,MAAM,CAAC,eALN,EAMjC,KAAK,CAAC,MAAN,KAAiB,SAAjB,IAA8B,MAAM,CAAC,aANJ,EAOjC,KAAK,CAAC,MAAN,KAAiB,aAAjB,IAAkC,MAAM,CAAC,iBAPR,EAQjC,KAAK,CAAC,WAAN,IAAqB,MAAM,CAAC,WARK,EASjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,WAAtC,IAAqD,MAAM,CAAC,oBAT3B,EAUjC,KAAK,CAAC,WAAN,KAAsB,KAAK,CAAC,MAAN,KAAiB,MAAjB,IAA2B,KAAK,CAAC,MAAN,KAAiB,cAAlE,KAAqF,MAAM,CAAC,eAV3D,EAWjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,MAAtC,IAAgD,MAAM,CAAC,eAXtB,EAYjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,SAAtC,IAAmD,MAAM,CAAC,aAZzB,EAajC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,aAAtC,IAAuD,MAAM,CAAC,iBAb7B,EAcjC,KAAK,CAAC,IAAN,KAAe,MAAf,IAAyB,MAAM,CAAC,IAdC,EAejC,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,KAfA,EAgBjC,KAAK,CAAC,IAAN,KAAe,aAAf,IAAgC,MAAM,CAAC,UAhBN,EAiBjC,KAAK,CAAC,IAAN,CAAW,SAjBsB,CAAnC;AAoBA,SAAO,KAAP;AACD,CAvBM","sourceRoot":""}
|
package/lib-commonjs/Badge.js
CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/Badge/index"), exports);
|
10
10
|
//# sourceMappingURL=Badge.js.map
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/CounterBadge/index"), exports);
|
10
10
|
//# sourceMappingURL=CounterBadge.js.map
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/PresenceBadge/index"), exports);
|
10
10
|
//# sourceMappingURL=PresenceBadge.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { BadgeProps } from './Badge.types';
|
2
2
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
|
-
* Define a styled Badge, using the `
|
4
|
+
* Define a styled Badge, using the `useBadge_unstable` hook.
|
5
5
|
*/
|
6
6
|
export declare const Badge: ForwardRefComponent<BadgeProps>;
|
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.Badge = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const useBadge_1 = /*#__PURE__*/require("./useBadge");
|
11
11
|
|
12
|
-
|
12
|
+
const useBadgeStyles_1 = /*#__PURE__*/require("./useBadgeStyles");
|
13
13
|
|
14
|
-
|
14
|
+
const renderBadge_1 = /*#__PURE__*/require("./renderBadge");
|
15
15
|
/**
|
16
|
-
* Define a styled Badge, using the `
|
16
|
+
* Define a styled Badge, using the `useBadge_unstable` hook.
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
exports.Badge = /*#__PURE__*/React.forwardRef(
|
21
|
-
|
22
|
-
useBadgeStyles_1.
|
23
|
-
return renderBadge_1.
|
20
|
+
exports.Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
+
const state = useBadge_1.useBadge_unstable(props, ref);
|
22
|
+
useBadgeStyles_1.useBadgeStyles_unstable(state);
|
23
|
+
return renderBadge_1.renderBadge_unstable(state);
|
24
24
|
});
|
25
25
|
exports.Badge.displayName = 'Badge';
|
26
26
|
//# sourceMappingURL=Badge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,UAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AACA,EAAA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;AAEA,SAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import
|
2
|
-
import type { ComponentProps, ComponentState, ObjectShorthandProps } from '@fluentui/react-utilities';
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
3
2
|
export declare type BadgeSlots = {
|
4
|
-
root:
|
5
|
-
icon?:
|
3
|
+
root: Slot<'div'>;
|
4
|
+
icon?: Slot<'span'>;
|
6
5
|
};
|
7
6
|
export declare type BadgeCommons = {
|
8
7
|
/**
|
@@ -31,5 +30,5 @@ export declare type BadgeCommons = {
|
|
31
30
|
*/
|
32
31
|
size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
33
32
|
};
|
34
|
-
export declare type BadgeProps = ComponentProps<
|
33
|
+
export declare type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & Partial<BadgeCommons>;
|
35
34
|
export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./Badge"), exports);
|
10
10
|
|
11
|
-
tslib_1.__exportStar(require("./Badge.types"), exports);
|
12
|
-
|
13
11
|
tslib_1.__exportStar(require("./renderBadge"), exports);
|
14
12
|
|
15
13
|
tslib_1.__exportStar(require("./useBadge"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AAGA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import type { BadgeState } from './Badge.types';
|
2
|
-
export declare const
|
2
|
+
export declare const renderBadge_unstable: (state: BadgeState) => JSX.Element;
|
@@ -3,21 +3,22 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderBadge_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
const renderBadge_unstable = state => {
|
13
|
+
const {
|
14
|
+
slots,
|
15
|
+
slotProps
|
16
|
+
} = react_utilities_1.getSlots(state);
|
17
|
+
return React.createElement(slots.root, { ...slotProps.root
|
18
|
+
}, state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
|
19
|
+
}), state.root.children, state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
|
20
|
+
}));
|
20
21
|
};
|
21
22
|
|
22
|
-
exports.
|
23
|
+
exports.renderBadge_unstable = renderBadge_unstable;
|
23
24
|
//# sourceMappingURL=renderBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;AACxD,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAK,CAAC,IAAzC,IAAiD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADpD,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAK,CAAC,IAAxC,IAAgD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAHnD,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
|
@@ -3,4 +3,4 @@ import type { BadgeProps, BadgeState } from './Badge.types';
|
|
3
3
|
/**
|
4
4
|
* Returns the props and state required to render the component
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useBadge_unstable: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
|
@@ -3,45 +3,41 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useBadge_unstable = void 0;
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
9
|
/**
|
12
10
|
* Returns the props and state required to render the component
|
13
11
|
*/
|
14
12
|
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
iconPosition: iconPosition,
|
31
|
-
appearance: appearance,
|
32
|
-
color: color,
|
14
|
+
const useBadge_unstable = (props, ref) => {
|
15
|
+
const {
|
16
|
+
shape = 'circular',
|
17
|
+
size = 'medium',
|
18
|
+
iconPosition = 'before',
|
19
|
+
appearance = 'filled',
|
20
|
+
color = 'brand'
|
21
|
+
} = props;
|
22
|
+
const state = {
|
23
|
+
shape,
|
24
|
+
size,
|
25
|
+
iconPosition,
|
26
|
+
appearance,
|
27
|
+
color,
|
33
28
|
components: {
|
34
29
|
root: 'div',
|
35
30
|
icon: 'span'
|
36
31
|
},
|
37
|
-
root: react_utilities_1.getNativeElementProps('div',
|
38
|
-
ref
|
39
|
-
'aria-hidden': true
|
40
|
-
|
32
|
+
root: react_utilities_1.getNativeElementProps('div', {
|
33
|
+
ref,
|
34
|
+
'aria-hidden': true,
|
35
|
+
...props
|
36
|
+
}),
|
41
37
|
icon: react_utilities_1.resolveShorthand(props.icon)
|
42
38
|
};
|
43
39
|
return state;
|
44
40
|
};
|
45
41
|
|
46
|
-
exports.
|
42
|
+
exports.useBadge_unstable = useBadge_unstable;
|
47
43
|
//# sourceMappingURL=useBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AAC9F,QAAM;AACJ,IAAA,KAAK,GAAG,UADJ;AAEJ,IAAA,IAAI,GAAG,QAFH;AAGJ,IAAA,YAAY,GAAG,QAHX;AAIJ,IAAA,UAAU,GAAG,QAJT;AAKJ,IAAA,KAAK,GAAG;AALJ,MAMF,KANJ;AAQA,QAAM,KAAK,GAAe;AACxB,IAAA,KADwB;AAExB,IAAA,IAFwB;AAGxB,IAAA,YAHwB;AAIxB,IAAA,UAJwB;AAKxB,IAAA,KALwB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,IAAI,EAAE;AAFI,KANY;AAUxB,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;AACjC,MAAA,GADiC;AAEjC,qBAAe,IAFkB;AAGjC,SAAG;AAH8B,KAA7B,CAVkB;AAexB,IAAA,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB;AAfkB,GAA1B;AAkBA,SAAO,KAAP;AACD,CA5BM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { BadgeState } from './Badge.types';
|
2
|
+
export declare const badgeClassName = "fui-Badge";
|
2
3
|
/**
|
3
4
|
* Applies style classnames to slots
|
4
5
|
*/
|
5
|
-
export declare const
|
6
|
+
export declare const useBadgeStyles_unstable: (state: BadgeState) => BadgeState;
|