@fluentui/react-badge 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +644 -25
- package/CHANGELOG.md +265 -104
- package/dist/index.d.ts +157 -0
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- 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 +8 -8
- 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 +0 -1
- package/lib/components/Badge/index.js.map +1 -1
- package/lib/components/Badge/renderBadge.js +9 -7
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.js +19 -22
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.js +213 -203
- package/lib/components/Badge/useBadgeStyles.js.map +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.js.map +1 -1
- package/lib/components/CounterBadge/index.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js +18 -25
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +18 -40
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +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.js.map +1 -1
- package/lib/components/PresenceBadge/index.js.map +1 -1
- package/lib/components/PresenceBadge/presenceIcons.js +128 -0
- package/lib/components/PresenceBadge/presenceIcons.js.map +1 -0
- package/lib/components/PresenceBadge/usePresenceBadge.js +52 -26
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +60 -46
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib/index.js +3 -5
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Badge.js +1 -1
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js +1 -1
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js +1 -1
- package/lib-commonjs/PresenceBadge.js.map +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.js.map +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.js +13 -12
- package/lib-commonjs/components/Badge/renderBadge.js.map +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.js +217 -205
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +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.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js +1 -1
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +20 -28
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +21 -42
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +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.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
- 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.js +54 -29
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +63 -48
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js +82 -6
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +23 -27
- package/dist/react-badge.d.ts +0 -154
- package/lib/Badge.d.ts +0 -1
- package/lib/CounterBadge.d.ts +0 -1
- package/lib/PresenceBadge.d.ts +0 -1
- 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/Badge/Badge.d.ts +0 -6
- package/lib/components/Badge/Badge.types.d.ts +0 -35
- package/lib/components/Badge/index.d.ts +0 -5
- package/lib/components/Badge/renderBadge.d.ts +0 -2
- package/lib/components/Badge/useBadge.d.ts +0 -6
- package/lib/components/Badge/useBadgeStyles.d.ts +0 -5
- package/lib/components/CounterBadge/CounterBadge.d.ts +0 -6
- package/lib/components/CounterBadge/CounterBadge.types.d.ts +0 -41
- package/lib/components/CounterBadge/index.d.ts +0 -4
- package/lib/components/CounterBadge/useCounterBadge.d.ts +0 -6
- package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -5
- 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/components/PresenceBadge/PresenceBadge.d.ts +0 -6
- package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +0 -17
- package/lib/components/PresenceBadge/index.d.ts +0 -4
- package/lib/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -5
- package/lib/index.d.ts +0 -5
- package/lib-commonjs/Badge.d.ts +0 -1
- package/lib-commonjs/CounterBadge.d.ts +0 -1
- package/lib-commonjs/PresenceBadge.d.ts +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/Badge/Badge.d.ts +0 -6
- package/lib-commonjs/components/Badge/Badge.types.d.ts +0 -35
- package/lib-commonjs/components/Badge/index.d.ts +0 -5
- package/lib-commonjs/components/Badge/renderBadge.d.ts +0 -2
- package/lib-commonjs/components/Badge/useBadge.d.ts +0 -6
- package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +0 -5
- package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +0 -6
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +0 -41
- package/lib-commonjs/components/CounterBadge/index.d.ts +0 -4
- package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +0 -6
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -5
- 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
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +0 -6
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +0 -17
- package/lib-commonjs/components/PresenceBadge/index.d.ts +0 -4
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -5
- package/lib-commonjs/index.d.ts +0 -5
@@ -3,68 +3,59 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.usePresenceBadgeStyles_unstable = exports.presenceBadgeClassNames = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
11
|
|
12
|
-
|
12
|
+
exports.presenceBadgeClassNames = {
|
13
|
+
root: 'fui-PresenceBadge',
|
14
|
+
icon: 'fui-PresenceBadge__icon'
|
15
|
+
};
|
16
|
+
|
17
|
+
const getIsBusy = status => {
|
18
|
+
if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {
|
19
|
+
return true;
|
20
|
+
}
|
21
|
+
|
22
|
+
return false;
|
23
|
+
};
|
24
|
+
|
25
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
13
26
|
"root": {
|
14
27
|
"z8tnut": "f1g0x7ka",
|
15
28
|
"z189sj": ["fhxju0i", "f1cnd47f"],
|
16
29
|
"Byoj8tv": "f1qch9an",
|
17
30
|
"uwmqm3": ["f1cnd47f", "fhxju0i"],
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
|
23
|
-
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
31
|
+
"mc9l5x": "ftuwxu6",
|
32
|
+
"B7ck84d": "f1ewtqcl",
|
33
|
+
"Bt984gj": "f122n59",
|
34
|
+
"Brf1p80": "f4d9j23",
|
35
|
+
"Bhmb4qv": "fb8jth9",
|
36
|
+
"Bbmb7ep": ["fqgqgel", "fchfifz"],
|
37
|
+
"Beyfa6y": ["fchfifz", "fqgqgel"],
|
38
|
+
"B7oj6ja": ["fc7b1hi", "f1dpx5h9"],
|
39
|
+
"Btl43ni": ["f1dpx5h9", "fc7b1hi"],
|
40
|
+
"De3pzq": "fxugw4r"
|
28
41
|
},
|
29
42
|
"statusBusy": {
|
30
|
-
"
|
31
|
-
"g2u3we": "f11ttmz8",
|
32
|
-
"h3c5rm": ["f1ratw88", "f459ikj"],
|
33
|
-
"B9xav0g": "fvovscg",
|
34
|
-
"zhjwy3": ["f459ikj", "f1ratw88"]
|
43
|
+
"sj55zd": "fvi85wt"
|
35
44
|
},
|
36
45
|
"statusAway": {
|
37
|
-
"
|
38
|
-
"g2u3we": "f1skk3ns",
|
39
|
-
"h3c5rm": ["f766wml", "f1rnrfqa"],
|
40
|
-
"B9xav0g": "fb8zvtn",
|
41
|
-
"zhjwy3": ["f1rnrfqa", "f766wml"]
|
46
|
+
"sj55zd": "f14k8a89"
|
42
47
|
},
|
43
48
|
"statusAvailable": {
|
44
|
-
"
|
45
|
-
"g2u3we": "f1t9i9vy",
|
46
|
-
"h3c5rm": ["f1r5awo9", "fnfhfy0"],
|
47
|
-
"B9xav0g": "fgfkvtu",
|
48
|
-
"zhjwy3": ["fnfhfy0", "f1r5awo9"]
|
49
|
+
"sj55zd": "fqa5hgp"
|
49
50
|
},
|
50
51
|
"statusOffline": {
|
51
|
-
"
|
52
|
-
"sj55zd": "f11d4kpn",
|
53
|
-
"g2u3we": "fi2z7s6",
|
54
|
-
"h3c5rm": ["f1agc6it", "f1sit5hz"],
|
55
|
-
"B9xav0g": "f9pok3v",
|
56
|
-
"zhjwy3": ["f1sit5hz", "f1agc6it"]
|
52
|
+
"sj55zd": "f11d4kpn"
|
57
53
|
},
|
58
54
|
"statusOutOfOffice": {
|
59
|
-
"
|
60
|
-
"sj55zd": "fdce8r3",
|
61
|
-
"g2u3we": "f161shwc",
|
62
|
-
"h3c5rm": ["fbde6ui", "f7rrh46"],
|
63
|
-
"B9xav0g": "f1yt3bcc",
|
64
|
-
"zhjwy3": ["f7rrh46", "fbde6ui"]
|
55
|
+
"sj55zd": "fdce8r3"
|
65
56
|
},
|
66
57
|
"outOfOffice": {
|
67
|
-
"
|
58
|
+
"sj55zd": "fr0bkrk"
|
68
59
|
},
|
69
60
|
"outOfOfficeAvailable": {
|
70
61
|
"sj55zd": "fqa5hgp"
|
@@ -74,20 +65,44 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
74
65
|
},
|
75
66
|
"outOfOfficeAway": {
|
76
67
|
"sj55zd": "f14k8a89"
|
68
|
+
},
|
69
|
+
"tiny": {
|
70
|
+
"Bubjx69": "f9ikmtg",
|
71
|
+
"a9b677": "f16dn6v3",
|
72
|
+
"B5pe6w7": "fab5kbq",
|
73
|
+
"p4uzdd": "f1ms1d91"
|
74
|
+
},
|
75
|
+
"large": {
|
76
|
+
"Bubjx69": "f9ikmtg",
|
77
|
+
"a9b677": "f64fuq3",
|
78
|
+
"B5pe6w7": "f1vfi1yj",
|
79
|
+
"p4uzdd": "f15s34gz"
|
80
|
+
},
|
81
|
+
"extraLarge": {
|
82
|
+
"Bubjx69": "f9ikmtg",
|
83
|
+
"a9b677": "f1w9dchk",
|
84
|
+
"B5pe6w7": "f14efy9b",
|
85
|
+
"p4uzdd": "fhipgdu"
|
77
86
|
}
|
78
87
|
}, {
|
79
|
-
"d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".
|
88
|
+
"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;}"]
|
80
89
|
});
|
81
90
|
/**
|
82
91
|
* Applies style classnames to slots
|
83
92
|
*/
|
84
93
|
|
85
94
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
95
|
+
const usePresenceBadgeStyles_unstable = state => {
|
96
|
+
const styles = useStyles();
|
97
|
+
const isBusy = getIsBusy(state.status);
|
98
|
+
state.root.className = react_1.mergeClasses(exports.presenceBadgeClassNames.root, styles.root, 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.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
|
99
|
+
|
100
|
+
if (state.icon) {
|
101
|
+
state.icon.className = react_1.mergeClasses(exports.presenceBadgeClassNames.icon, state.icon.className);
|
102
|
+
}
|
103
|
+
|
104
|
+
return state;
|
90
105
|
};
|
91
106
|
|
92
|
-
exports.
|
107
|
+
exports.usePresenceBadgeStyles_unstable = usePresenceBadgeStyles_unstable;
|
93
108
|
//# sourceMappingURL=usePresenceBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"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","sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { BadgeSlots } from '../Badge/Badge.types';\nimport type { PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge.types';\n\nexport const presenceBadgeClassNames: SlotClassNames<BadgeSlots> = {\n root: 'fui-PresenceBadge',\n icon: 'fui-PresenceBadge__icon',\n};\n\nconst getIsBusy = (status: PresenceBadgeStatus): boolean => {\n if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {\n return true;\n }\n\n return false;\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.padding(0),\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n\n '& span': {\n display: 'flex',\n },\n ...shorthands.borderRadius('50%'),\n backgroundColor: tokens.colorNeutralBackground1,\n },\n statusBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n statusAway: {\n color: tokens.colorPaletteMarigoldBackground3,\n },\n statusAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n statusOffline: {\n color: tokens.colorNeutralForeground3,\n },\n statusOutOfOffice: {\n color: tokens.colorPaletteBerryForeground3,\n },\n outOfOffice: {\n color: tokens.colorNeutralBackground1,\n },\n outOfOfficeAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n outOfOfficeBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n outOfOfficeAway: {\n color: tokens.colorPaletteMarigoldBackground3,\n },\n\n // Icons are not resizeable, and these sizes are currently missing\n // use `!important` to size the currently available icons to the missing ones\n //\n tiny: {\n aspectRatio: '1',\n width: '6px',\n '& svg': {\n width: '6px !important',\n height: '6px !important',\n },\n },\n large: {\n aspectRatio: '1',\n width: '20px',\n '& svg': {\n width: '20px !important',\n height: '20px !important',\n },\n },\n extraLarge: {\n aspectRatio: '1',\n width: '28px',\n '& svg': {\n width: '28px !important',\n height: '28px !important',\n },\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const usePresenceBadgeStyles_unstable = (state: PresenceBadgeState): PresenceBadgeState => {\n const styles = useStyles();\n const isBusy = getIsBusy(state.status);\n state.root.className = mergeClasses(\n presenceBadgeClassNames.root,\n styles.root,\n isBusy && styles.statusBusy,\n state.status === 'away' && styles.statusAway,\n state.status === 'available' && styles.statusAvailable,\n state.status === 'offline' && styles.statusOffline,\n state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.outOfOffice && styles.outOfOffice,\n state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable,\n state.outOfOffice && isBusy && styles.outOfOfficeBusy,\n state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway,\n state.outOfOffice && state.status === 'offline' && styles.statusOffline,\n state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.size === 'tiny' && styles.tiny,\n state.size === 'large' && styles.large,\n state.size === 'extra-large' && styles.extraLarge,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
@@ -3,16 +3,92 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.useCounterBadge_unstable = exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassNames = exports.CounterBadge = exports.usePresenceBadge_unstable = exports.usePresenceBadgeStyles_unstable = exports.presenceBadgeClassNames = exports.PresenceBadge = exports.useBadge_unstable = exports.useBadgeStyles_unstable = exports.renderBadge_unstable = exports.badgeClassNames = exports.Badge = void 0;
|
6
7
|
|
7
|
-
var
|
8
|
+
var Badge_1 = /*#__PURE__*/require("./Badge");
|
8
9
|
|
9
|
-
|
10
|
+
Object.defineProperty(exports, "Badge", {
|
11
|
+
enumerable: true,
|
12
|
+
get: function () {
|
13
|
+
return Badge_1.Badge;
|
14
|
+
}
|
15
|
+
});
|
16
|
+
Object.defineProperty(exports, "badgeClassNames", {
|
17
|
+
enumerable: true,
|
18
|
+
get: function () {
|
19
|
+
return Badge_1.badgeClassNames;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
Object.defineProperty(exports, "renderBadge_unstable", {
|
23
|
+
enumerable: true,
|
24
|
+
get: function () {
|
25
|
+
return Badge_1.renderBadge_unstable;
|
26
|
+
}
|
27
|
+
});
|
28
|
+
Object.defineProperty(exports, "useBadgeStyles_unstable", {
|
29
|
+
enumerable: true,
|
30
|
+
get: function () {
|
31
|
+
return Badge_1.useBadgeStyles_unstable;
|
32
|
+
}
|
33
|
+
});
|
34
|
+
Object.defineProperty(exports, "useBadge_unstable", {
|
35
|
+
enumerable: true,
|
36
|
+
get: function () {
|
37
|
+
return Badge_1.useBadge_unstable;
|
38
|
+
}
|
39
|
+
});
|
10
40
|
|
11
|
-
|
41
|
+
var PresenceBadge_1 = /*#__PURE__*/require("./PresenceBadge");
|
12
42
|
|
13
|
-
|
43
|
+
Object.defineProperty(exports, "PresenceBadge", {
|
44
|
+
enumerable: true,
|
45
|
+
get: function () {
|
46
|
+
return PresenceBadge_1.PresenceBadge;
|
47
|
+
}
|
48
|
+
});
|
49
|
+
Object.defineProperty(exports, "presenceBadgeClassNames", {
|
50
|
+
enumerable: true,
|
51
|
+
get: function () {
|
52
|
+
return PresenceBadge_1.presenceBadgeClassNames;
|
53
|
+
}
|
54
|
+
});
|
55
|
+
Object.defineProperty(exports, "usePresenceBadgeStyles_unstable", {
|
56
|
+
enumerable: true,
|
57
|
+
get: function () {
|
58
|
+
return PresenceBadge_1.usePresenceBadgeStyles_unstable;
|
59
|
+
}
|
60
|
+
});
|
61
|
+
Object.defineProperty(exports, "usePresenceBadge_unstable", {
|
62
|
+
enumerable: true,
|
63
|
+
get: function () {
|
64
|
+
return PresenceBadge_1.usePresenceBadge_unstable;
|
65
|
+
}
|
66
|
+
});
|
14
67
|
|
15
|
-
|
68
|
+
var CounterBadge_1 = /*#__PURE__*/require("./CounterBadge");
|
16
69
|
|
17
|
-
|
70
|
+
Object.defineProperty(exports, "CounterBadge", {
|
71
|
+
enumerable: true,
|
72
|
+
get: function () {
|
73
|
+
return CounterBadge_1.CounterBadge;
|
74
|
+
}
|
75
|
+
});
|
76
|
+
Object.defineProperty(exports, "counterBadgeClassNames", {
|
77
|
+
enumerable: true,
|
78
|
+
get: function () {
|
79
|
+
return CounterBadge_1.counterBadgeClassNames;
|
80
|
+
}
|
81
|
+
});
|
82
|
+
Object.defineProperty(exports, "useCounterBadgeStyles_unstable", {
|
83
|
+
enumerable: true,
|
84
|
+
get: function () {
|
85
|
+
return CounterBadge_1.useCounterBadgeStyles_unstable;
|
86
|
+
}
|
87
|
+
});
|
88
|
+
Object.defineProperty(exports, "useCounterBadge_unstable", {
|
89
|
+
enumerable: true,
|
90
|
+
get: function () {
|
91
|
+
return CounterBadge_1.useCounterBadge_unstable;
|
92
|
+
}
|
93
|
+
});
|
18
94
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,KAAA;AAAK;AAAL,CAAA;AAAO,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AAAiB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AAAsB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AAAyB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA;;AAEhF,IAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,eAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,aAAA;AAAa;AAAb,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,+BAAA;AAA+B;AAA/B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,yBAAA;AAAyB;AAAzB,CAAA;;AAGF,IAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,cAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,YAAA;AAAY;AAAZ,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,8BAAA;AAA8B;AAA9B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA","sourcesContent":["export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';\nexport type { BadgeProps, BadgeSlots, BadgeState } from './Badge';\nexport {\n PresenceBadge,\n presenceBadgeClassNames,\n usePresenceBadgeStyles_unstable,\n usePresenceBadge_unstable,\n} from './PresenceBadge';\nexport type { PresenceBadgeProps, PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge';\nexport {\n CounterBadge,\n counterBadgeClassNames,\n useCounterBadgeStyles_unstable,\n useCounterBadge_unstable,\n} from './CounterBadge';\nexport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-badge",
|
3
|
-
"version": "9.0.0-
|
3
|
+
"version": "9.0.0-rc.10",
|
4
4
|
"description": "React components for building web experiences",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "
|
7
|
+
"typings": "dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -19,47 +19,43 @@
|
|
19
19
|
"just": "just-scripts",
|
20
20
|
"lint": "just-scripts lint",
|
21
21
|
"start": "yarn storybook",
|
22
|
-
"test": "jest",
|
22
|
+
"test": "jest --passWithNoTests",
|
23
23
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
24
|
-
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node
|
25
|
-
"storybook": "
|
24
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-badge/src && yarn docs",
|
25
|
+
"storybook": "node ../../../scripts/storybook/runner",
|
26
|
+
"type-check": "tsc -b tsconfig.json"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
|
-
"@fluentui/babel-make-styles": "9.0.0-nightly.d730088d7f.0",
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-nightly.d730088d7f.0",
|
31
30
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-
|
33
|
-
"@fluentui/scripts": "^1.0.0"
|
34
|
-
"@types/enzyme": "3.10.3",
|
35
|
-
"@types/enzyme-adapter-react-16": "1.0.3",
|
36
|
-
"@types/react": "16.9.42",
|
37
|
-
"@types/react-dom": "16.9.10",
|
38
|
-
"@types/react-test-renderer": "^16.0.0",
|
39
|
-
"enzyme": "~3.10.0",
|
40
|
-
"enzyme-adapter-react-16": "^1.15.0",
|
41
|
-
"react": "16.8.6",
|
42
|
-
"react-dom": "16.8.6",
|
43
|
-
"react-test-renderer": "^16.3.0"
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.7",
|
32
|
+
"@fluentui/scripts": "^1.0.0"
|
44
33
|
},
|
45
34
|
"dependencies": {
|
46
|
-
"@fluentui/react-
|
47
|
-
"@
|
48
|
-
"@fluentui/react-
|
35
|
+
"@fluentui/react-icons": "^2.0.166-rc.3",
|
36
|
+
"@griffel/react": "1.0.5",
|
37
|
+
"@fluentui/react-theme": "9.0.0-rc.9",
|
38
|
+
"@fluentui/react-utilities": "9.0.0-rc.9",
|
49
39
|
"tslib": "^2.1.0"
|
50
40
|
},
|
51
41
|
"peerDependencies": {
|
52
|
-
"@types/react": ">=16.8.0 <
|
53
|
-
"@types/react-dom": ">=16.8.0 <
|
54
|
-
"react": ">=16.8.0 <
|
55
|
-
"react-dom": ">=16.8.0 <
|
42
|
+
"@types/react": ">=16.8.0 <18.0.0",
|
43
|
+
"@types/react-dom": ">=16.8.0 <18.0.0",
|
44
|
+
"react": ">=16.8.0 <18.0.0",
|
45
|
+
"react-dom": ">=16.8.0 <18.0.0"
|
56
46
|
},
|
57
47
|
"beachball": {
|
58
|
-
"tag": "beta",
|
59
48
|
"disallowedChangeTypes": [
|
60
49
|
"major",
|
61
50
|
"minor",
|
62
51
|
"patch"
|
63
52
|
]
|
53
|
+
},
|
54
|
+
"exports": {
|
55
|
+
".": {
|
56
|
+
"types": "./lib/index.d.ts",
|
57
|
+
"import": "./lib/index.js",
|
58
|
+
"require": "./lib-commonjs/index.js"
|
59
|
+
}
|
64
60
|
}
|
65
61
|
}
|
package/dist/react-badge.d.ts
DELETED
@@ -1,154 +0,0 @@
|
|
1
|
-
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
|
-
import type { ComponentState } from '@fluentui/react-utilities';
|
3
|
-
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
4
|
-
import type { ObjectShorthandProps } from '@fluentui/react-utilities';
|
5
|
-
import * as React_2 from 'react';
|
6
|
-
|
7
|
-
/**
|
8
|
-
* Define a styled Badge, using the `useBadge` hook.
|
9
|
-
*/
|
10
|
-
export declare const Badge: ForwardRefComponent<BadgeProps>;
|
11
|
-
|
12
|
-
export declare type BadgeCommons = {
|
13
|
-
/**
|
14
|
-
* A Badge can be filled, outline, ghost, inverted
|
15
|
-
* @defaultvalue filled
|
16
|
-
*/
|
17
|
-
appearance: 'filled' | 'ghost' | 'outline' | 'tint';
|
18
|
-
/**
|
19
|
-
* A Badge can be one of preset colors
|
20
|
-
* @defaultvalue brand
|
21
|
-
*/
|
22
|
-
color: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
|
23
|
-
/**
|
24
|
-
* A Badge can position the icon before or after the content.
|
25
|
-
* @defaultvalue before
|
26
|
-
*/
|
27
|
-
iconPosition: 'before' | 'after';
|
28
|
-
/**
|
29
|
-
* A Badge can be square, circular or rounded.
|
30
|
-
* @defaultvalue circular
|
31
|
-
*/
|
32
|
-
shape: 'circular' | 'rounded' | 'square';
|
33
|
-
/**
|
34
|
-
* A Badge can be on of several preset sizes.
|
35
|
-
* @defaultvalue medium
|
36
|
-
*/
|
37
|
-
size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
38
|
-
};
|
39
|
-
|
40
|
-
export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
|
41
|
-
|
42
|
-
export declare type BadgeSlots = {
|
43
|
-
root: ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>;
|
44
|
-
icon?: ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>;
|
45
|
-
};
|
46
|
-
|
47
|
-
export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
|
48
|
-
|
49
|
-
/**
|
50
|
-
* Define a styled CounterBadge, using the `useCounterBadge` hook.
|
51
|
-
*/
|
52
|
-
export declare const CounterBadge: ForwardRefComponent<CounterBadgeProps>;
|
53
|
-
|
54
|
-
export declare type CounterBadgeCommons = {
|
55
|
-
/**
|
56
|
-
* Max number to be displayed
|
57
|
-
* @default 99
|
58
|
-
*/
|
59
|
-
overflowCount: number;
|
60
|
-
/**
|
61
|
-
* Value displayed by the Badge
|
62
|
-
* @default 0
|
63
|
-
*/
|
64
|
-
count: number;
|
65
|
-
/**
|
66
|
-
* If the badge should be shown when count is 0
|
67
|
-
* @default false
|
68
|
-
*/
|
69
|
-
showZero: boolean;
|
70
|
-
/**
|
71
|
-
* If a dot should be displayed without the count
|
72
|
-
* @default false
|
73
|
-
*/
|
74
|
-
dot: boolean;
|
75
|
-
/**
|
76
|
-
* A Badge can be circular or rounded
|
77
|
-
* @default circular
|
78
|
-
*/
|
79
|
-
shape: 'circular' | 'rounded';
|
80
|
-
/**
|
81
|
-
* A Badge can be filled, ghost
|
82
|
-
* @default filled
|
83
|
-
*/
|
84
|
-
appearance: 'filled' | 'ghost';
|
85
|
-
};
|
86
|
-
|
87
|
-
/**
|
88
|
-
* {@docCategory CounterBadge}
|
89
|
-
*/
|
90
|
-
export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape'> & Partial<CounterBadgeCommons>;
|
91
|
-
|
92
|
-
/**
|
93
|
-
* {@docCategory CounterBadge}
|
94
|
-
*/
|
95
|
-
export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape'> & CounterBadgeCommons;
|
96
|
-
|
97
|
-
/**
|
98
|
-
* Define a styled Badge, using the `useBadge` hook.
|
99
|
-
*/
|
100
|
-
export declare const PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
|
101
|
-
|
102
|
-
export declare interface PresenceBadgeCommons {
|
103
|
-
/**
|
104
|
-
* Represents several status
|
105
|
-
* @default available
|
106
|
-
*/
|
107
|
-
status: PresenceBadgeStatus;
|
108
|
-
/**
|
109
|
-
* Modifies the display to indicate that the user is out of office.
|
110
|
-
* This can be combined with any status to display an out-of-office version of that status
|
111
|
-
* @default false
|
112
|
-
*/
|
113
|
-
outOfOffice: boolean;
|
114
|
-
}
|
115
|
-
|
116
|
-
export declare type PresenceBadgeProps = BadgeProps & Partial<PresenceBadgeCommons>;
|
117
|
-
|
118
|
-
export declare type PresenceBadgeState = BadgeState & PresenceBadgeCommons;
|
119
|
-
|
120
|
-
export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';
|
121
|
-
|
122
|
-
export declare const renderBadge: (state: BadgeState) => JSX.Element;
|
123
|
-
|
124
|
-
/**
|
125
|
-
* Returns the props and state required to render the component
|
126
|
-
*/
|
127
|
-
export declare const useBadge: (props: BadgeProps, ref: React_2.Ref<HTMLElement>) => BadgeState;
|
128
|
-
|
129
|
-
/**
|
130
|
-
* Applies style classnames to slots
|
131
|
-
*/
|
132
|
-
export declare const useBadgeStyles: (state: BadgeState) => BadgeState;
|
133
|
-
|
134
|
-
/**
|
135
|
-
* Returns the props and state required to render the component
|
136
|
-
*/
|
137
|
-
export declare const useCounterBadge: (props: CounterBadgeProps, ref: React_2.Ref<HTMLElement>) => CounterBadgeState;
|
138
|
-
|
139
|
-
/**
|
140
|
-
* Applies style classnames to slots
|
141
|
-
*/
|
142
|
-
export declare const useCounterBadgeStyles: (state: CounterBadgeState) => CounterBadgeState;
|
143
|
-
|
144
|
-
/**
|
145
|
-
* Returns the props and state required to render the component
|
146
|
-
*/
|
147
|
-
export declare const usePresenceBadge: (props: PresenceBadgeProps, ref: React_2.Ref<HTMLElement>) => PresenceBadgeState;
|
148
|
-
|
149
|
-
/**
|
150
|
-
* Applies style classnames to slots
|
151
|
-
*/
|
152
|
-
export declare const usePresenceBadgeStyles: (state: PresenceBadgeState) => PresenceBadgeState;
|
153
|
-
|
154
|
-
export { }
|
package/lib/Badge.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Badge/index';
|
package/lib/CounterBadge.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/CounterBadge/index';
|
package/lib/PresenceBadge.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/PresenceBadge/index';
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
3
|
-
export function isConformant(testInfo) {
|
4
|
-
var defaultOptions = {
|
5
|
-
asPropHandlesRef: true,
|
6
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
7
|
-
// https://github.com/microsoft/fluentui/issues/19522
|
8
|
-
skipAsPropTests: true,
|
9
|
-
extraTests: makeStylesTests
|
10
|
-
};
|
11
|
-
baseIsConformant(defaultOptions, testInfo);
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D;AACA,IAAA,eAAe,EAAE,IAJ0C;AAK3D,IAAA,UAAU,EAAE;AAL+C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ComponentProps, ComponentState, ObjectShorthandProps } from '@fluentui/react-utilities';
|
3
|
-
export declare type BadgeSlots = {
|
4
|
-
root: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
|
5
|
-
icon?: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
|
6
|
-
};
|
7
|
-
export declare type BadgeCommons = {
|
8
|
-
/**
|
9
|
-
* A Badge can be filled, outline, ghost, inverted
|
10
|
-
* @defaultvalue filled
|
11
|
-
*/
|
12
|
-
appearance: 'filled' | 'ghost' | 'outline' | 'tint';
|
13
|
-
/**
|
14
|
-
* A Badge can be one of preset colors
|
15
|
-
* @defaultvalue brand
|
16
|
-
*/
|
17
|
-
color: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
|
18
|
-
/**
|
19
|
-
* A Badge can position the icon before or after the content.
|
20
|
-
* @defaultvalue before
|
21
|
-
*/
|
22
|
-
iconPosition: 'before' | 'after';
|
23
|
-
/**
|
24
|
-
* A Badge can be square, circular or rounded.
|
25
|
-
* @defaultvalue circular
|
26
|
-
*/
|
27
|
-
shape: 'circular' | 'rounded' | 'square';
|
28
|
-
/**
|
29
|
-
* A Badge can be on of several preset sizes.
|
30
|
-
* @defaultvalue medium
|
31
|
-
*/
|
32
|
-
size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
33
|
-
};
|
34
|
-
export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
|
35
|
-
export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
|