@fluentui/react-badge 9.0.0-alpha.92 → 9.0.0-beta.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +277 -1
- package/CHANGELOG.md +67 -2
- package/dist/react-badge.d.ts +18 -7
- package/lib/components/Badge/Badge.js +2 -2
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.d.ts +1 -1
- package/lib/components/Badge/renderBadge.js +6 -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.d.ts +1 -0
- package/lib/components/Badge/useBadgeStyles.js +35 -35
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.js +2 -2
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.d.ts +7 -2
- package/lib/components/CounterBadge/useCounterBadge.js +18 -24
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -0
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +6 -34
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js +2 -2
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +6 -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.js +35 -24
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -0
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +38 -45
- 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.js +6 -6
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.d.ts +1 -1
- package/lib-commonjs/components/Badge/index.js +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +8 -10
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.js +20 -24
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +1 -0
- package/lib-commonjs/components/Badge/useBadgeStyles.js +38 -37
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js +6 -6
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +7 -2
- package/lib-commonjs/components/CounterBadge/index.js +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +19 -26
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -0
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +10 -37
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +6 -6
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +6 -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.js +36 -26
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -0
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +40 -47
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +11 -10
- 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,40 +1,51 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { resolveShorthand } from '@fluentui/react-utilities';
|
3
|
+
import { presenceAvailableFilled, presenceAvailableRegular, presenceAwayFilled, presenceBusyFilled, presenceDndFilled, presenceDndRegular, presenceOfflineRegular, presenceOofRegular, presenceUnknownRegular } from './presenceIcons';
|
4
4
|
import { useBadge } from '../Badge/index';
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
away:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
|
6
|
+
const iconMap = (status, outOfOffice, size) => {
|
7
|
+
switch (status) {
|
8
|
+
case 'available':
|
9
|
+
return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];
|
10
|
+
|
11
|
+
case 'away':
|
12
|
+
return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];
|
13
|
+
|
14
|
+
case 'busy':
|
15
|
+
return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];
|
16
|
+
|
17
|
+
case 'doNotDisturb':
|
18
|
+
return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];
|
19
|
+
|
20
|
+
case 'offline':
|
21
|
+
return presenceOfflineRegular[size];
|
22
|
+
|
23
|
+
case 'outOfOffice':
|
24
|
+
return presenceOofRegular[size];
|
25
|
+
}
|
16
26
|
};
|
17
27
|
/**
|
18
28
|
* Returns the props and state required to render the component
|
19
29
|
*/
|
20
30
|
|
21
31
|
|
22
|
-
export
|
23
|
-
var _a, _b
|
32
|
+
export const usePresenceBadge = (props, ref) => {
|
33
|
+
var _a, _b;
|
24
34
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
35
|
+
const state = { ...useBadge({
|
36
|
+
size: 'medium',
|
37
|
+
...props,
|
38
|
+
icon: resolveShorthand(undefined, {
|
39
|
+
required: true
|
40
|
+
})
|
41
|
+
}, ref),
|
32
42
|
status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
|
33
43
|
outOfOffice: (_b = props.outOfOffice) !== null && _b !== void 0 ? _b : false
|
34
|
-
}
|
44
|
+
};
|
45
|
+
const IconElement = iconMap(state.status, state.outOfOffice, state.size);
|
35
46
|
|
36
|
-
if (
|
37
|
-
state.icon.children =
|
47
|
+
if (IconElement) {
|
48
|
+
state.icon.children = /*#__PURE__*/React.createElement(IconElement, null);
|
38
49
|
}
|
39
50
|
|
40
51
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx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C,MAAR,MAAc,IAAd,IAAc,EAAA,KAAA,KAAA,CAAd,GAAc,EAAd,GAAkB,WAXQ;AAYhC,IAAA,WAAW,EAAA,CAAA,EAAA,GAAE,KAAK,CAAC,WAAR,MAAmB,IAAnB,IAAmB,EAAA,KAAA,KAAA,CAAnB,GAAmB,EAAnB,GAAuB;AAZF,GAAlC;AAeA,QAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAP,EAAe,KAAK,CAAC,WAArB,EAAkC,KAAK,CAAC,IAAxC,CAA3B;;AACA,MAAI,WAAJ,EAAiB;AACf,IAAA,KAAK,CAAC,IAAN,CAAY,QAAZ,gBAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CAtBM","sourceRoot":""}
|
@@ -1,62 +1,37 @@
|
|
1
1
|
import { mergeClasses, __styles } from '@fluentui/react-make-styles';
|
2
|
-
|
2
|
+
export const presenceBadgeClassName = 'fui-PresenceBadge';
|
3
3
|
|
4
|
-
|
4
|
+
const useStyles = /*#__PURE__*/__styles({
|
5
5
|
"root": {
|
6
6
|
"z8tnut": "f1g0x7ka",
|
7
7
|
"z189sj": ["fhxju0i", "f1cnd47f"],
|
8
8
|
"Byoj8tv": "f1qch9an",
|
9
9
|
"uwmqm3": ["f1cnd47f", "fhxju0i"],
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
|
15
|
-
|
16
|
-
"
|
17
|
-
"Bekrc4i": ["f5tn483", "f1ojsxk5"],
|
18
|
-
"Bn0qgzm": "f1vxd6vx",
|
19
|
-
"ibv6hh": ["f1ojsxk5", "f5tn483"]
|
10
|
+
"mc9l5x": "ftuwxu6",
|
11
|
+
"B7ck84d": "f1ewtqcl",
|
12
|
+
"Bt984gj": "f122n59",
|
13
|
+
"Brf1p80": "f4d9j23",
|
14
|
+
"Bhmb4qv": "fb8jth9",
|
15
|
+
"Dimara": "f5q2cvs",
|
16
|
+
"De3pzq": "fxugw4r"
|
20
17
|
},
|
21
18
|
"statusBusy": {
|
22
|
-
"
|
23
|
-
"g2u3we": "f11ttmz8",
|
24
|
-
"h3c5rm": ["f1ratw88", "f459ikj"],
|
25
|
-
"B9xav0g": "fvovscg",
|
26
|
-
"zhjwy3": ["f459ikj", "f1ratw88"]
|
19
|
+
"sj55zd": "fvi85wt"
|
27
20
|
},
|
28
21
|
"statusAway": {
|
29
|
-
"
|
30
|
-
"g2u3we": "f1skk3ns",
|
31
|
-
"h3c5rm": ["f766wml", "f1rnrfqa"],
|
32
|
-
"B9xav0g": "fb8zvtn",
|
33
|
-
"zhjwy3": ["f1rnrfqa", "f766wml"]
|
22
|
+
"sj55zd": "f14k8a89"
|
34
23
|
},
|
35
24
|
"statusAvailable": {
|
36
|
-
"
|
37
|
-
"g2u3we": "f1t9i9vy",
|
38
|
-
"h3c5rm": ["f1r5awo9", "fnfhfy0"],
|
39
|
-
"B9xav0g": "fgfkvtu",
|
40
|
-
"zhjwy3": ["fnfhfy0", "f1r5awo9"]
|
25
|
+
"sj55zd": "fqa5hgp"
|
41
26
|
},
|
42
27
|
"statusOffline": {
|
43
|
-
"
|
44
|
-
"sj55zd": "f11d4kpn",
|
45
|
-
"g2u3we": "fi2z7s6",
|
46
|
-
"h3c5rm": ["f1agc6it", "f1sit5hz"],
|
47
|
-
"B9xav0g": "f9pok3v",
|
48
|
-
"zhjwy3": ["f1sit5hz", "f1agc6it"]
|
28
|
+
"sj55zd": "f11d4kpn"
|
49
29
|
},
|
50
30
|
"statusOutOfOffice": {
|
51
|
-
"
|
52
|
-
"sj55zd": "fdce8r3",
|
53
|
-
"g2u3we": "f161shwc",
|
54
|
-
"h3c5rm": ["fbde6ui", "f7rrh46"],
|
55
|
-
"B9xav0g": "f1yt3bcc",
|
56
|
-
"zhjwy3": ["f7rrh46", "fbde6ui"]
|
31
|
+
"sj55zd": "fdce8r3"
|
57
32
|
},
|
58
33
|
"outOfOffice": {
|
59
|
-
"
|
34
|
+
"sj55zd": "fr0bkrk"
|
60
35
|
},
|
61
36
|
"outOfOfficeAvailable": {
|
62
37
|
"sj55zd": "fqa5hgp"
|
@@ -66,18 +41,36 @@ var useStyles = /*#__PURE__*/__styles({
|
|
66
41
|
},
|
67
42
|
"outOfOfficeAway": {
|
68
43
|
"sj55zd": "f14k8a89"
|
44
|
+
},
|
45
|
+
"tiny": {
|
46
|
+
"Bubjx69": "f9ikmtg",
|
47
|
+
"a9b677": "f16dn6v3",
|
48
|
+
"B5pe6w7": "fab5kbq",
|
49
|
+
"p4uzdd": "f1ms1d91"
|
50
|
+
},
|
51
|
+
"large": {
|
52
|
+
"Bubjx69": "f9ikmtg",
|
53
|
+
"a9b677": "f64fuq3",
|
54
|
+
"B5pe6w7": "f1vfi1yj",
|
55
|
+
"p4uzdd": "f15s34gz"
|
56
|
+
},
|
57
|
+
"extraLarge": {
|
58
|
+
"Bubjx69": "f9ikmtg",
|
59
|
+
"a9b677": "f1w9dchk",
|
60
|
+
"B5pe6w7": "f14efy9b",
|
61
|
+
"p4uzdd": "fhipgdu"
|
69
62
|
}
|
70
63
|
}, {
|
71
|
-
"d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".
|
64
|
+
"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;}", ".f5q2cvs{border-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
65
|
});
|
73
66
|
/**
|
74
67
|
* Applies style classnames to slots
|
75
68
|
*/
|
76
69
|
|
77
70
|
|
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
|
71
|
+
export const usePresenceBadgeStyles = state => {
|
72
|
+
const styles = useStyles();
|
73
|
+
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);
|
74
|
+
return state;
|
82
75
|
};
|
83
76
|
//# sourceMappingURL=usePresenceBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;
|
1
|
+
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;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,EAAlB;AAuEA;;AAEG;;;AACH,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAkD;AACtF,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,IAA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
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
|
@@ -5,20 +5,20 @@ 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
16
|
* Define a styled Badge, using the `useBadge` hook.
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
exports.Badge = /*#__PURE__*/React.forwardRef(
|
21
|
-
|
20
|
+
exports.Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
+
const state = useBadge_1.useBadge(props, ref);
|
22
22
|
useBadgeStyles_1.useBadgeStyles(state);
|
23
23
|
return renderBadge_1.renderBadge(state);
|
24
24
|
});
|
@@ -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,QAAA,CAAS,KAAT,EAAgB,GAAhB,CAAd;AACA,EAAA,gBAAA,CAAA,cAAA,CAAe,KAAf;AAEA,SAAO,aAAA,CAAA,WAAA,CAAY,KAAZ,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import type { ComponentProps, ComponentState, ObjectShorthandProps } from '@fluentui/react-utilities';
|
3
3
|
export declare type BadgeSlots = {
|
4
|
-
root: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
|
4
|
+
root: ObjectShorthandProps<Omit<React.HTMLAttributes<HTMLElement>, 'color'>>;
|
5
5
|
icon?: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
|
6
6
|
};
|
7
7
|
export declare type BadgeCommons = {
|
@@ -5,18 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.renderBadge = 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
|
-
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.iconPosition === 'before' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), state.root.children, state.iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)));
|
12
|
+
const renderBadge = state => {
|
13
|
+
const {
|
14
|
+
slots,
|
15
|
+
slotProps
|
16
|
+
} = react_utilities_1.getSlots(state, ['icon', 'root']);
|
17
|
+
return React.createElement(slots.root, Object.assign({}, slotProps.root), state.iconPosition === 'before' && React.createElement(slots.icon, Object.assign({}, slotProps.icon)), state.root.children, state.iconPosition === 'after' && React.createElement(slots.icon, Object.assign({}, slotProps.icon)));
|
20
18
|
};
|
21
19
|
|
22
20
|
exports.renderBadge = renderBadge;
|
@@ -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,WAAW,GAAI,KAAD,IAAsB;AAC/C,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,EAA4B,CAAC,MAAD,EAAS,MAAT,CAA5B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADtC,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAHrC,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourceRoot":""}
|
@@ -5,39 +5,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useBadge = 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 = (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;
|
@@ -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,QAAQ,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AACrF,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,QAAA,GAAQ,QAAR","sourceRoot":""}
|