@fluentui/react-badge 0.0.0-nightlyc9ccb6f37d20211122.1 → 0.0.0-nightlyca6ef2bc8e20220105.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +111 -16
- package/CHANGELOG.md +32 -11
- package/dist/react-badge.d.ts +5 -5
- package/lib/components/Badge/Badge.types.d.ts +1 -1
- package/lib/components/Badge/renderBadge.js +4 -1
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.js +73 -53
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +3 -5
- package/lib/components/CounterBadge/useCounterBadgeStyles.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 +29 -15
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +38 -43
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.d.ts +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +4 -1
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +72 -52
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +2 -4
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +6 -5
- 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 +28 -14
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +37 -43
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/package.json +11 -9
- 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 -98
- 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 -113
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
@@ -1,12 +1,10 @@
|
|
1
|
-
import { mergeClasses, __styles } from '@fluentui/react-make-styles';
|
1
|
+
import { shorthands, mergeClasses, __styles } from '@fluentui/react-make-styles';
|
2
2
|
import { useBadgeStyles } from '../Badge/useBadgeStyles';
|
3
3
|
export const counterBadgeClassName = 'fui-CounterBadge';
|
4
4
|
|
5
5
|
const useStyles = /*#__PURE__*/__styles({
|
6
|
-
"root": {
|
7
|
-
"Bf4jedk": "fgfkb25"
|
8
|
-
},
|
9
6
|
"dot": {
|
7
|
+
"Bf4jedk": "fgfkb25",
|
10
8
|
"a9b677": "f16dn6v3",
|
11
9
|
"Bqenvij": "f3mu39s",
|
12
10
|
"z8tnut": "f1g0x7ka",
|
@@ -27,7 +25,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
27
25
|
|
28
26
|
export const useCounterBadgeStyles = state => {
|
29
27
|
const styles = useStyles();
|
30
|
-
state.root.className = mergeClasses(counterBadgeClassName,
|
28
|
+
state.root.className = mergeClasses(counterBadgeClassName, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
|
31
29
|
return useBadgeStyles(state);
|
32
30
|
};
|
33
31
|
//# sourceMappingURL=useCounterBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,EAAqB,YAArB,kBAAqD,6BAArD;AACA,SAAS,cAAT,QAA+B,yBAA/B;AAGA,OAAO,MAAM,qBAAqB,GAAG,kBAA9B;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAgD;AACnF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,qBADiC,EAEjC,KAAK,CAAC,GAAN,IAAa,MAAM,CAAC,GAFa,EAGjC,CAAC,KAAK,CAAC,QAAP,IAAmB,KAAK,CAAC,KAAN,KAAgB,CAAnC,IAAwC,CAAC,KAAK,CAAC,GAA/C,IAAsD,MAAM,CAAC,IAH5B,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;AAMA,SAAO,cAAc,CAAC,KAAD,CAArB;AACD,CATM","sourceRoot":""}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';
|
2
|
+
import type { BadgeCommons, BadgeSlots } from '../Badge/index';
|
2
3
|
export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';
|
3
|
-
export
|
4
|
+
export declare type PresenceBadgeCommons = {
|
4
5
|
/**
|
5
6
|
* Represents several status
|
6
7
|
* @default available
|
@@ -12,6 +13,6 @@ export interface PresenceBadgeCommons {
|
|
12
13
|
* @default false
|
13
14
|
*/
|
14
15
|
outOfOffice: boolean;
|
15
|
-
}
|
16
|
-
export declare type PresenceBadgeProps =
|
17
|
-
export declare type PresenceBadgeState =
|
16
|
+
} & BadgeCommons;
|
17
|
+
export declare type PresenceBadgeProps = ComponentProps<Partial<Pick<BadgeSlots, 'root'>>> & Partial<Pick<PresenceBadgeCommons, 'status' | 'outOfOffice' | 'size'>>;
|
18
|
+
export declare type PresenceBadgeState = PresenceBadgeCommons & ComponentState<BadgeSlots>;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { PresenceBadgeState } from './PresenceBadge.types';
|
3
|
+
export declare const presenceAwayFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
4
|
+
export declare const presenceAvailableRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
5
|
+
export declare const presenceAvailableFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
6
|
+
export declare const presenceBusyFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
7
|
+
export declare const presenceDndFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
8
|
+
export declare const presenceDndRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
9
|
+
export declare const presenceOofRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
10
|
+
export declare const presenceOfflineRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
11
|
+
export declare const presenceUnknownRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import { PresenceAvailable10Regular, PresenceAvailable12Regular, PresenceAvailable16Regular, PresenceAvailable10Filled, PresenceAvailable12Filled, PresenceAvailable16Filled, PresenceAway10Filled, PresenceAway12Filled, PresenceAway16Filled, PresenceBusy10Filled, PresenceBusy12Filled, PresenceBusy16Filled, PresenceDnd10Regular, PresenceDnd12Regular, PresenceDnd16Regular, PresenceDnd10Filled, PresenceDnd12Filled, PresenceDnd16Filled, PresenceOof10Regular, PresenceOof12Regular, PresenceOof16Regular, PresenceOffline10Regular, PresenceOffline12Regular, PresenceOffline16Regular, PresenceUnknown10Regular, PresenceUnknown12Regular, PresenceUnknown16Regular } from '@fluentui/react-icons';
|
2
|
+
export const presenceAwayFilled = {
|
3
|
+
// FIXME not all presence icon sizes are available
|
4
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
5
|
+
tiny: PresenceAway10Filled,
|
6
|
+
'extra-small': PresenceAway10Filled,
|
7
|
+
small: PresenceAway12Filled,
|
8
|
+
medium: PresenceAway16Filled,
|
9
|
+
// FIXME not all presence icon sizes are available
|
10
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
11
|
+
large: PresenceAway16Filled,
|
12
|
+
// FIXME not all presence icon sizes are available
|
13
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
14
|
+
'extra-large': PresenceAway16Filled
|
15
|
+
};
|
16
|
+
export const presenceAvailableRegular = {
|
17
|
+
// FIXME not all presence icon sizes are available
|
18
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
19
|
+
tiny: PresenceAvailable10Regular,
|
20
|
+
'extra-small': PresenceAvailable10Regular,
|
21
|
+
small: PresenceAvailable12Regular,
|
22
|
+
medium: PresenceAvailable16Regular,
|
23
|
+
// FIXME not all presence icon sizes are available
|
24
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
25
|
+
large: PresenceAvailable16Regular,
|
26
|
+
// FIXME not all presence icon sizes are available
|
27
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
28
|
+
'extra-large': PresenceAvailable16Regular
|
29
|
+
};
|
30
|
+
export const presenceAvailableFilled = {
|
31
|
+
// FIXME not all presence icon sizes are available
|
32
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
33
|
+
tiny: PresenceAvailable10Filled,
|
34
|
+
'extra-small': PresenceAvailable10Filled,
|
35
|
+
small: PresenceAvailable12Filled,
|
36
|
+
medium: PresenceAvailable16Filled,
|
37
|
+
// FIXME not all presence icon sizes are available
|
38
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
39
|
+
large: PresenceAvailable16Filled,
|
40
|
+
// FIXME not all presence icon sizes are available
|
41
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
42
|
+
'extra-large': PresenceAvailable16Filled
|
43
|
+
};
|
44
|
+
export const presenceBusyFilled = {
|
45
|
+
// FIXME not all presence icon sizes are available
|
46
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
47
|
+
tiny: PresenceBusy10Filled,
|
48
|
+
'extra-small': PresenceBusy10Filled,
|
49
|
+
small: PresenceBusy12Filled,
|
50
|
+
medium: PresenceBusy16Filled,
|
51
|
+
// FIXME not all presence icon sizes are available
|
52
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
53
|
+
large: PresenceBusy16Filled,
|
54
|
+
// FIXME not all presence icon sizes are available
|
55
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
56
|
+
'extra-large': PresenceBusy16Filled
|
57
|
+
};
|
58
|
+
export const presenceDndFilled = {
|
59
|
+
// FIXME not all presence icon sizes are available
|
60
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
61
|
+
tiny: PresenceDnd10Filled,
|
62
|
+
'extra-small': PresenceDnd10Filled,
|
63
|
+
small: PresenceDnd12Filled,
|
64
|
+
medium: PresenceDnd16Filled,
|
65
|
+
// FIXME not all presence icon sizes are available
|
66
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
67
|
+
large: PresenceDnd16Filled,
|
68
|
+
// FIXME not all presence icon sizes are available
|
69
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
70
|
+
'extra-large': PresenceDnd16Filled
|
71
|
+
};
|
72
|
+
export const presenceDndRegular = {
|
73
|
+
// FIXME not all presence icon sizes are available
|
74
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
75
|
+
tiny: PresenceDnd10Regular,
|
76
|
+
'extra-small': PresenceDnd10Regular,
|
77
|
+
small: PresenceDnd12Regular,
|
78
|
+
medium: PresenceDnd16Regular,
|
79
|
+
// FIXME not all presence icon sizes are available
|
80
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
81
|
+
large: PresenceDnd16Regular,
|
82
|
+
// FIXME not all presence icon sizes are available
|
83
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
84
|
+
'extra-large': PresenceDnd16Regular
|
85
|
+
};
|
86
|
+
export const presenceOofRegular = {
|
87
|
+
// FIXME not all presence icon sizes are available
|
88
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
89
|
+
tiny: PresenceOof10Regular,
|
90
|
+
'extra-small': PresenceOof10Regular,
|
91
|
+
small: PresenceOof12Regular,
|
92
|
+
medium: PresenceOof16Regular,
|
93
|
+
// FIXME not all presence icon sizes are available
|
94
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
95
|
+
large: PresenceOof16Regular,
|
96
|
+
// FIXME not all presence icon sizes are available
|
97
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
98
|
+
'extra-large': PresenceOof16Regular
|
99
|
+
};
|
100
|
+
export const presenceOfflineRegular = {
|
101
|
+
// FIXME not all presence icon sizes are available
|
102
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
103
|
+
tiny: PresenceOffline10Regular,
|
104
|
+
'extra-small': PresenceOffline10Regular,
|
105
|
+
small: PresenceOffline12Regular,
|
106
|
+
medium: PresenceOffline16Regular,
|
107
|
+
// FIXME not all presence icon sizes are available
|
108
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
109
|
+
large: PresenceOffline16Regular,
|
110
|
+
// FIXME not all presence icon sizes are available
|
111
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
112
|
+
'extra-large': PresenceOffline16Regular
|
113
|
+
};
|
114
|
+
export const presenceUnknownRegular = {
|
115
|
+
// FIXME not all presence icon sizes are available
|
116
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
117
|
+
tiny: PresenceUnknown10Regular,
|
118
|
+
'extra-small': PresenceUnknown10Regular,
|
119
|
+
small: PresenceUnknown12Regular,
|
120
|
+
medium: PresenceUnknown16Regular,
|
121
|
+
// FIXME not all presence icon sizes are available
|
122
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
123
|
+
large: PresenceUnknown16Regular,
|
124
|
+
// FIXME not all presence icon sizes are available
|
125
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
126
|
+
'extra-large': PresenceUnknown16Regular
|
127
|
+
};
|
128
|
+
//# sourceMappingURL=presenceIcons.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":"AACA,SACE,0BADF,EAEE,0BAFF,EAGE,0BAHF,EAIE,yBAJF,EAKE,yBALF,EAME,yBANF,EAOE,oBAPF,EAQE,oBARF,EASE,oBATF,EAUE,oBAVF,EAWE,oBAXF,EAYE,oBAZF,EAaE,oBAbF,EAcE,oBAdF,EAeE,oBAfF,EAgBE,mBAhBF,EAiBE,mBAjBF,EAkBE,mBAlBF,EAmBE,oBAnBF,EAoBE,oBApBF,EAqBE,oBArBF,EAsBE,wBAtBF,EAuBE,wBAvBF,EAwBE,wBAxBF,EAyBE,wBAzBF,EA0BE,wBA1BF,EA2BE,wBA3BF,QA4BO,uBA5BP;AA+BA,OAAO,MAAM,kBAAkB,GAAuE;AACpG;AACA;AACA,EAAA,IAAI,EAAE,oBAH8F;AAIpG,iBAAe,oBAJqF;AAKpG,EAAA,KAAK,EAAE,oBAL6F;AAMpG,EAAA,MAAM,EAAE,oBAN4F;AAOpG;AACA;AACA,EAAA,KAAK,EAAE,oBAT6F;AAUpG;AACA;AACA,iBAAe;AAZqF,CAA/F;A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;AAeP,OAAO,MAAM,kBAAkB,GAAuE;AACpG;AACA;AACA,EAAA,IAAI,EAAE,oBAH8F;AAIpG,iBAAe,oBAJqF;AAKpG,EAAA,KAAK,EAAE,oBAL6F;AAMpG,EAAA,MAAM,EAAE,oBAN4F;AAOpG;AACA;AACA,EAAA,KAAK,EAAE,oBAT6F;AAUpG;AACA;AACA,iBAAe;AAZqF,CAA/F;AAeP,OAAO,MAAM,sBAAsB,GAAuE;AACxG;AACA;AACA,EAAA,IAAI,EAAE,wBAHkG;AAIxG,iBAAe,wBAJyF;AAKxG,EAAA,KAAK,EAAE,wBALiG;AAMxG,EAAA,MAAM,EAAE,wBANgG;AAOxG;AACA;AACA,EAAA,KAAK,EAAE,wBATiG;AAUxG;AACA;AACA,iBAAe;AAZyF,CAAnG;AAeP,OAAO,MAAM,sBAAsB,GAAuE;AACxG;AACA;AACA,EAAA,IAAI,EAAE,wBAHkG;AAIxG,iBAAe,wBAJyF;AAKxG,EAAA,KAAK,EAAE,wBALiG;AAMxG,EAAA,MAAM,EAAE,wBANgG;AAOxG;AACA;AACA,EAAA,KAAK,EAAE,wBATiG;AAUxG;AACA;AACA,iBAAe;AAZyF,CAAnG","sourceRoot":""}
|
@@ -1,37 +1,51 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { resolveShorthand } from '@fluentui/react-utilities';
|
3
|
+
import { presenceAvailableFilled, presenceAvailableRegular, presenceAwayFilled, presenceBusyFilled, presenceDndFilled, presenceDndRegular, presenceOfflineRegular, presenceOofRegular, presenceUnknownRegular } from './presenceIcons';
|
3
4
|
import { useBadge } from '../Badge/index';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
+
}
|
26
|
+
};
|
14
27
|
/**
|
15
28
|
* Returns the props and state required to render the component
|
16
29
|
*/
|
17
30
|
|
18
31
|
|
19
32
|
export const usePresenceBadge = (props, ref) => {
|
20
|
-
var _a, _b
|
33
|
+
var _a, _b;
|
21
34
|
|
22
35
|
const state = { ...useBadge({
|
23
|
-
size: '
|
36
|
+
size: 'medium',
|
24
37
|
...props,
|
25
|
-
icon: resolveShorthand(
|
38
|
+
icon: resolveShorthand(undefined, {
|
26
39
|
required: true
|
27
40
|
})
|
28
41
|
}, ref),
|
29
42
|
status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
|
30
43
|
outOfOffice: (_b = props.outOfOffice) !== null && _b !== void 0 ? _b : false
|
31
44
|
};
|
45
|
+
const IconElement = iconMap(state.status, state.outOfOffice, state.size);
|
32
46
|
|
33
|
-
if (
|
34
|
-
state.icon.children =
|
47
|
+
if (IconElement) {
|
48
|
+
state.icon.children = /*#__PURE__*/React.createElement(IconElement, null);
|
35
49
|
}
|
36
50
|
|
37
51
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,
|
1
|
+
{"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx"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,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAXQ;AAYhC,IAAA,WAAW,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,WAAN,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,EAAjB,GAAqB;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,5 +1,4 @@
|
|
1
|
-
import { mergeClasses, __styles } from '@fluentui/react-make-styles';
|
2
|
-
import { useBadgeStyles } from '../../Badge';
|
1
|
+
import { mergeClasses, __styles, shorthands } from '@fluentui/react-make-styles';
|
3
2
|
export const presenceBadgeClassName = 'fui-PresenceBadge';
|
4
3
|
|
5
4
|
const useStyles = /*#__PURE__*/__styles({
|
@@ -8,56 +7,34 @@ const useStyles = /*#__PURE__*/__styles({
|
|
8
7
|
"z189sj": ["fhxju0i", "f1cnd47f"],
|
9
8
|
"Byoj8tv": "f1qch9an",
|
10
9
|
"uwmqm3": ["f1cnd47f", "fhxju0i"],
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"
|
15
|
-
|
16
|
-
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
10
|
+
"mc9l5x": "ftuwxu6",
|
11
|
+
"B7ck84d": "f1ewtqcl",
|
12
|
+
"Bt984gj": "f122n59",
|
13
|
+
"Brf1p80": "f4d9j23",
|
14
|
+
"Bhmb4qv": "fb8jth9",
|
15
|
+
"Bbmb7ep": ["fqgqgel", "fchfifz"],
|
16
|
+
"Beyfa6y": ["fchfifz", "fqgqgel"],
|
17
|
+
"B7oj6ja": ["fc7b1hi", "f1dpx5h9"],
|
18
|
+
"Btl43ni": ["f1dpx5h9", "fc7b1hi"],
|
19
|
+
"De3pzq": "fxugw4r"
|
21
20
|
},
|
22
21
|
"statusBusy": {
|
23
|
-
"
|
24
|
-
"g2u3we": "f11ttmz8",
|
25
|
-
"h3c5rm": ["f1ratw88", "f459ikj"],
|
26
|
-
"B9xav0g": "fvovscg",
|
27
|
-
"zhjwy3": ["f459ikj", "f1ratw88"]
|
22
|
+
"sj55zd": "fvi85wt"
|
28
23
|
},
|
29
24
|
"statusAway": {
|
30
|
-
"
|
31
|
-
"g2u3we": "f1skk3ns",
|
32
|
-
"h3c5rm": ["f766wml", "f1rnrfqa"],
|
33
|
-
"B9xav0g": "fb8zvtn",
|
34
|
-
"zhjwy3": ["f1rnrfqa", "f766wml"]
|
25
|
+
"sj55zd": "f14k8a89"
|
35
26
|
},
|
36
27
|
"statusAvailable": {
|
37
|
-
"
|
38
|
-
"g2u3we": "f1t9i9vy",
|
39
|
-
"h3c5rm": ["f1r5awo9", "fnfhfy0"],
|
40
|
-
"B9xav0g": "fgfkvtu",
|
41
|
-
"zhjwy3": ["fnfhfy0", "f1r5awo9"]
|
28
|
+
"sj55zd": "fqa5hgp"
|
42
29
|
},
|
43
30
|
"statusOffline": {
|
44
|
-
"
|
45
|
-
"sj55zd": "f11d4kpn",
|
46
|
-
"g2u3we": "fi2z7s6",
|
47
|
-
"h3c5rm": ["f1agc6it", "f1sit5hz"],
|
48
|
-
"B9xav0g": "f9pok3v",
|
49
|
-
"zhjwy3": ["f1sit5hz", "f1agc6it"]
|
31
|
+
"sj55zd": "f11d4kpn"
|
50
32
|
},
|
51
33
|
"statusOutOfOffice": {
|
52
|
-
"
|
53
|
-
"sj55zd": "fdce8r3",
|
54
|
-
"g2u3we": "f161shwc",
|
55
|
-
"h3c5rm": ["fbde6ui", "f7rrh46"],
|
56
|
-
"B9xav0g": "f1yt3bcc",
|
57
|
-
"zhjwy3": ["f7rrh46", "fbde6ui"]
|
34
|
+
"sj55zd": "fdce8r3"
|
58
35
|
},
|
59
36
|
"outOfOffice": {
|
60
|
-
"
|
37
|
+
"sj55zd": "fr0bkrk"
|
61
38
|
},
|
62
39
|
"outOfOfficeAvailable": {
|
63
40
|
"sj55zd": "fqa5hgp"
|
@@ -67,9 +44,27 @@ const useStyles = /*#__PURE__*/__styles({
|
|
67
44
|
},
|
68
45
|
"outOfOfficeAway": {
|
69
46
|
"sj55zd": "f14k8a89"
|
47
|
+
},
|
48
|
+
"tiny": {
|
49
|
+
"Bubjx69": "f9ikmtg",
|
50
|
+
"a9b677": "f16dn6v3",
|
51
|
+
"B5pe6w7": "fab5kbq",
|
52
|
+
"p4uzdd": "f1ms1d91"
|
53
|
+
},
|
54
|
+
"large": {
|
55
|
+
"Bubjx69": "f9ikmtg",
|
56
|
+
"a9b677": "f64fuq3",
|
57
|
+
"B5pe6w7": "f1vfi1yj",
|
58
|
+
"p4uzdd": "f15s34gz"
|
59
|
+
},
|
60
|
+
"extraLarge": {
|
61
|
+
"Bubjx69": "f9ikmtg",
|
62
|
+
"a9b677": "f1w9dchk",
|
63
|
+
"B5pe6w7": "f14efy9b",
|
64
|
+
"p4uzdd": "fhipgdu"
|
70
65
|
}
|
71
66
|
}, {
|
72
|
-
"d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".
|
67
|
+
"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;}"]
|
73
68
|
});
|
74
69
|
/**
|
75
70
|
* Applies style classnames to slots
|
@@ -78,7 +73,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
78
73
|
|
79
74
|
export const usePresenceBadgeStyles = state => {
|
80
75
|
const styles = useStyles();
|
81
|
-
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,
|
82
|
-
return
|
76
|
+
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);
|
77
|
+
return state;
|
83
78
|
};
|
84
79
|
//# 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,6BAArD;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;AAA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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":""}
|
@@ -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 = {
|
@@ -14,7 +14,10 @@ const renderBadge = state => {
|
|
14
14
|
slots,
|
15
15
|
slotProps
|
16
16
|
} = react_utilities_1.getSlots(state, ['icon', 'root']);
|
17
|
-
return React.createElement(slots.root,
|
17
|
+
return React.createElement(slots.root, { ...slotProps.root
|
18
|
+
}, state.iconPosition === 'before' && React.createElement(slots.icon, { ...slotProps.icon
|
19
|
+
}), state.root.children, state.iconPosition === 'after' && React.createElement(slots.icon, { ...slotProps.icon
|
20
|
+
}));
|
18
21
|
};
|
19
22
|
|
20
23
|
exports.renderBadge = renderBadge;
|
@@ -1 +1 @@
|
|
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,
|
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,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADtC,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAHrC,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourceRoot":""}
|