@fluentui/react-badge 0.0.0-nightlyfe9829e48120211112.1 → 0.0.0-nightlyff78d1e27a20220217.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +299 -16
- package/CHANGELOG.md +70 -11
- package/dist/react-badge.d.ts +27 -28
- 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.d.ts +1 -1
- package/lib/components/Badge/Badge.js +7 -7
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.d.ts +4 -5
- package/lib/components/Badge/Badge.types.js.map +1 -1
- 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 +6 -3
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.d.ts +1 -1
- package/lib/components/Badge/useBadge.js +1 -1
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.d.ts +1 -1
- package/lib/components/Badge/useBadgeStyles.js +209 -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 +7 -7
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.d.ts +9 -9
- package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib/components/CounterBadge/index.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js +3 -3
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +7 -38
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.d.ts +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js +7 -7
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
- package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib/components/PresenceBadge/index.js.map +1 -1
- 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 +32 -18
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +40 -44
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.d.ts +1 -1
- package/lib-commonjs/components/Badge/Badge.js +4 -4
- 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/Badge.types.js.map +1 -1
- package/lib-commonjs/components/Badge/index.d.ts +1 -1
- package/lib-commonjs/components/Badge/index.js +0 -2
- 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 +8 -5
- 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 +3 -3
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +212 -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 +4 -4
- 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/CounterBadge.types.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +4 -4
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +9 -40
- 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 +4 -4
- 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/PresenceBadge.types.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js.map +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 +32 -18
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +43 -47
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +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 -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
@@ -13,14 +13,14 @@ const useCounterBadgeStyles_1 = /*#__PURE__*/require("./useCounterBadgeStyles");
|
|
13
13
|
|
14
14
|
const index_1 = /*#__PURE__*/require("../Badge/index");
|
15
15
|
/**
|
16
|
-
* Define a styled CounterBadge, using the `
|
16
|
+
* Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
20
|
exports.CounterBadge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
-
const state = useCounterBadge_1.
|
22
|
-
useCounterBadgeStyles_1.
|
23
|
-
return index_1.
|
21
|
+
const state = useCounterBadge_1.useCounterBadge_unstable(props, ref);
|
22
|
+
useCounterBadgeStyles_1.useCounterBadgeStyles_unstable(state);
|
23
|
+
return index_1.renderBadge_unstable(state);
|
24
24
|
});
|
25
25
|
exports.CounterBadge.displayName = 'CounterBadge';
|
26
26
|
//# sourceMappingURL=CounterBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,MAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,YAAA,gBAAuD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClG,QAAM,KAAK,GAAG,iBAAA,CAAA,wBAAA,CAAyB,KAAzB,EAAgC,GAAhC,CAAd;AACA,EAAA,uBAAA,CAAA,8BAAA,CAA+B,KAA/B;AAEA,SAAO,OAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALmE,CAAvD;AAOb,OAAA,CAAA,YAAA,CAAa,WAAb,GAA2B,cAA3B","sourcesContent":["import * as React from 'react';\nimport { useCounterBadge_unstable } from './useCounterBadge';\nimport { useCounterBadgeStyles_unstable } from './useCounterBadgeStyles';\nimport { renderBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps } from './CounterBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.\n */\nexport const CounterBadge: ForwardRefComponent<CounterBadgeProps> = React.forwardRef((props, ref) => {\n const state = useCounterBadge_unstable(props, ref);\n useCounterBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nCounterBadge.displayName = 'CounterBadge';\n"],"sourceRoot":"../src/"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { BadgeProps, BadgeState } from '../Badge/index';
|
2
|
-
|
2
|
+
declare type CounterBadgeCommons = {
|
3
3
|
/**
|
4
4
|
* Max number to be displayed
|
5
5
|
* @default 99
|
@@ -30,12 +30,12 @@ export declare type CounterBadgeCommons = {
|
|
30
30
|
* @default filled
|
31
31
|
*/
|
32
32
|
appearance: 'filled' | 'ghost';
|
33
|
+
/**
|
34
|
+
* Semantic colors for a counter badge
|
35
|
+
* @default brand
|
36
|
+
*/
|
37
|
+
color: Extract<BadgeProps['color'], 'brand' | 'danger' | 'important' | 'informative'>;
|
33
38
|
};
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape'> & Partial<CounterBadgeCommons>;
|
38
|
-
/**
|
39
|
-
* {@docCategory CounterBadge}
|
40
|
-
*/
|
41
|
-
export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape'> & CounterBadgeCommons;
|
39
|
+
export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape' | 'color'> & Partial<CounterBadgeCommons>;
|
40
|
+
export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape' | 'color'> & CounterBadgeCommons;
|
41
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CounterBadge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,yBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './CounterBadge';\nexport * from './CounterBadge.types';\nexport * from './useCounterBadge';\nexport * from './useCounterBadgeStyles';\n"],"sourceRoot":"../src/"}
|
@@ -3,4 +3,4 @@ import type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.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 useCounterBadge_unstable: (props: CounterBadgeProps, ref: React.Ref<HTMLElement>) => CounterBadgeState;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useCounterBadge_unstable = void 0;
|
7
7
|
|
8
8
|
const index_1 = /*#__PURE__*/require("../Badge/index");
|
9
9
|
/**
|
@@ -11,7 +11,7 @@ const index_1 = /*#__PURE__*/require("../Badge/index");
|
|
11
11
|
*/
|
12
12
|
|
13
13
|
|
14
|
-
const
|
14
|
+
const useCounterBadge_unstable = (props, ref) => {
|
15
15
|
const {
|
16
16
|
shape = 'circular',
|
17
17
|
appearance = 'filled',
|
@@ -20,7 +20,7 @@ const useCounterBadge = (props, ref) => {
|
|
20
20
|
count = 0,
|
21
21
|
dot = false
|
22
22
|
} = props;
|
23
|
-
const state = { ...index_1.
|
23
|
+
const state = { ...index_1.useBadge_unstable(props, ref),
|
24
24
|
shape,
|
25
25
|
appearance,
|
26
26
|
showZero,
|
@@ -36,5 +36,5 @@ const useCounterBadge = (props, ref) => {
|
|
36
36
|
return state;
|
37
37
|
};
|
38
38
|
|
39
|
-
exports.
|
39
|
+
exports.useCounterBadge_unstable = useCounterBadge_unstable;
|
40
40
|
//# sourceMappingURL=useCounterBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,wBAAwB,GAAG,CAAC,KAAD,EAA2B,GAA3B,KAA6E;AACnH,QAAM;AACJ,IAAA,KAAK,GAAG,UADJ;AAEJ,IAAA,UAAU,GAAG,QAFT;AAGJ,IAAA,QAAQ,GAAG,KAHP;AAIJ,IAAA,aAAa,GAAG,EAJZ;AAKJ,IAAA,KAAK,GAAG,CALJ;AAMJ,IAAA,GAAG,GAAG;AANF,MAOF,KAPJ;AASA,QAAM,KAAK,GAAsB,EAC/B,GAAI,OAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAD2B;AAE/B,IAAA,KAF+B;AAG/B,IAAA,UAH+B;AAI/B,IAAA,QAJ+B;AAK/B,IAAA,aAL+B;AAM/B,IAAA,KAN+B;AAO/B,IAAA;AAP+B,GAAjC;;AAUA,MAAI,CAAC,KAAK,CAAC,GAAP,IAAc,CAAC,KAAK,CAAC,IAAN,CAAW,QAA9B,EAAwC;AACtC,IAAA,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,KAAK,CAAC,KAAN,GAAc,KAAK,CAAC,aAApB,GAAoC,GAAG,KAAK,CAAC,aAAa,GAA1D,GAAgE,GAAG,KAAK,CAAC,KAAK,EAApG;AACD;;AAED,SAAO,KAAP;AACD,CAzBM;;AAAM,OAAA,CAAA,wBAAA,GAAwB,wBAAxB","sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useCounterBadge_unstable = (props: CounterBadgeProps, ref: React.Ref<HTMLElement>): CounterBadgeState => {\n const {\n shape = 'circular',\n appearance = 'filled',\n showZero = false,\n overflowCount = 99,\n count = 0,\n dot = false,\n } = props;\n\n const state: CounterBadgeState = {\n ...(useBadge_unstable(props, ref) as CounterBadgeState),\n shape,\n appearance,\n showZero,\n overflowCount,\n count,\n dot,\n };\n\n if (!state.dot && !state.root.children) {\n state.root.children = state.count > state.overflowCount ? `${state.overflowCount}+` : `${state.count}`;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -3,4 +3,4 @@ export declare const counterBadgeClassName = "fui-CounterBadge";
|
|
3
3
|
/**
|
4
4
|
* Applies style classnames to slots
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useCounterBadgeStyles_unstable: (state: CounterBadgeState) => CounterBadgeState;
|
@@ -3,48 +3,17 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassName = void 0;
|
7
7
|
|
8
|
-
const
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
9
|
|
10
10
|
const useBadgeStyles_1 = /*#__PURE__*/require("../Badge/useBadgeStyles");
|
11
11
|
|
12
12
|
exports.counterBadgeClassName = 'fui-CounterBadge';
|
13
13
|
|
14
|
-
const useStyles = /*#__PURE__*/
|
15
|
-
"root": {
|
16
|
-
"Bf4jedk": "fgfkb25"
|
17
|
-
},
|
18
|
-
"warning": {
|
19
|
-
"De3pzq": "fic4z9l",
|
20
|
-
"g2u3we": "f1g6aqbb",
|
21
|
-
"h3c5rm": ["f1xc4egn", "f1y13pv"],
|
22
|
-
"B9xav0g": "f12f05r9",
|
23
|
-
"zhjwy3": ["f1y13pv", "f1xc4egn"]
|
24
|
-
},
|
25
|
-
"important": {
|
26
|
-
"De3pzq": "f1y11cvn",
|
27
|
-
"g2u3we": "f9ag23u",
|
28
|
-
"h3c5rm": ["fzlvby", "fj2uge6"],
|
29
|
-
"B9xav0g": "fk41dq4",
|
30
|
-
"zhjwy3": ["fj2uge6", "fzlvby"]
|
31
|
-
},
|
32
|
-
"severe": {
|
33
|
-
"De3pzq": "ftpr1dl",
|
34
|
-
"g2u3we": "fx7g4rx",
|
35
|
-
"h3c5rm": ["f1edxl4n", "f5hlgd2"],
|
36
|
-
"B9xav0g": "f5ppncr",
|
37
|
-
"zhjwy3": ["f5hlgd2", "f1edxl4n"]
|
38
|
-
},
|
39
|
-
"informative": {
|
40
|
-
"De3pzq": "f6zwqgc",
|
41
|
-
"g2u3we": "f1pdtvjr",
|
42
|
-
"h3c5rm": ["f1ctwv29", "f1m7luuw"],
|
43
|
-
"B9xav0g": "f1ijpqjr",
|
44
|
-
"zhjwy3": ["f1m7luuw", "f1ctwv29"],
|
45
|
-
"sj55zd": "f11d4kpn"
|
46
|
-
},
|
14
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
47
15
|
"dot": {
|
16
|
+
"Bf4jedk": "fgfkb25",
|
48
17
|
"a9b677": "f16dn6v3",
|
49
18
|
"Bqenvij": "f3mu39s",
|
50
19
|
"z8tnut": "f1g0x7ka",
|
@@ -56,18 +25,18 @@ const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
56
25
|
"mc9l5x": "fjseox"
|
57
26
|
}
|
58
27
|
}, {
|
59
|
-
"d": [".fgfkb25{min-width:auto;}", ".
|
28
|
+
"d": [".fgfkb25{min-width:auto;}", ".f16dn6v3{width:6px;}", ".f3mu39s{height:6px;}", ".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".fjseox{display:none;}"]
|
60
29
|
});
|
61
30
|
/**
|
62
31
|
* Applies style classnames to slots
|
63
32
|
*/
|
64
33
|
|
65
34
|
|
66
|
-
const
|
35
|
+
const useCounterBadgeStyles_unstable = state => {
|
67
36
|
const styles = useStyles();
|
68
|
-
state.root.className =
|
69
|
-
return useBadgeStyles_1.
|
37
|
+
state.root.className = react_1.mergeClasses(exports.counterBadgeClassName, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
|
38
|
+
return useBadgeStyles_1.useBadgeStyles_unstable(state);
|
70
39
|
};
|
71
40
|
|
72
|
-
exports.
|
41
|
+
exports.useCounterBadgeStyles_unstable = useCounterBadgeStyles_unstable;
|
73
42
|
//# sourceMappingURL=useCounterBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAGa,OAAA,CAAA,qBAAA,GAAwB,kBAAxB;;AAEb,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACI,MAAM,8BAA8B,GAAI,KAAD,IAAgD;AAC5F,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,qBADqB,EAErB,KAAK,CAAC,GAAN,IAAa,MAAM,CAAC,GAFC,EAGrB,CAAC,KAAK,CAAC,QAAP,IAAmB,KAAK,CAAC,KAAN,KAAgB,CAAnC,IAAwC,CAAC,KAAK,CAAC,GAA/C,IAAsD,MAAM,CAAC,IAHxC,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;AAMA,SAAO,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAP;AACD,CATM;;AAAM,OAAA,CAAA,8BAAA,GAA8B,8BAA9B","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useBadgeStyles_unstable } from '../Badge/useBadgeStyles';\nimport type { CounterBadgeState } from './CounterBadge.types';\n\nexport const counterBadgeClassName = 'fui-CounterBadge';\n\nconst useStyles = makeStyles({\n dot: {\n minWidth: 'auto',\n width: '6px',\n height: '6px',\n ...shorthands.padding('0'),\n },\n hide: {\n display: 'none',\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const useCounterBadgeStyles_unstable = (state: CounterBadgeState): CounterBadgeState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n counterBadgeClassName,\n state.dot && styles.dot,\n !state.showZero && state.count === 0 && !state.dot && styles.hide,\n state.root.className,\n );\n return useBadgeStyles_unstable(state) as CounterBadgeState;\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { PresenceBadgeProps } from './PresenceBadge.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 PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
|
@@ -13,14 +13,14 @@ const usePresenceBadgeStyles_1 = /*#__PURE__*/require("./usePresenceBadgeStyles"
|
|
13
13
|
|
14
14
|
const Badge_1 = /*#__PURE__*/require("../../Badge");
|
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
20
|
exports.PresenceBadge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
-
const state = usePresenceBadge_1.
|
22
|
-
usePresenceBadgeStyles_1.
|
23
|
-
return Badge_1.
|
21
|
+
const state = usePresenceBadge_1.usePresenceBadge_unstable(props, ref);
|
22
|
+
usePresenceBadgeStyles_1.usePresenceBadgeStyles_unstable(state);
|
23
|
+
return Badge_1.renderBadge_unstable(state);
|
24
24
|
});
|
25
25
|
exports.PresenceBadge.displayName = 'PresenceBadge';
|
26
26
|
//# sourceMappingURL=PresenceBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/PresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpG,QAAM,KAAK,GAAG,kBAAA,CAAA,yBAAA,CAA0B,KAA1B,EAAiC,GAAjC,CAAd;AACA,EAAA,wBAAA,CAAA,+BAAA,CAAgC,KAAhC;AAEA,SAAO,OAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqE,CAAzD;AAOb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport { usePresenceBadge_unstable } from './usePresenceBadge';\nimport { usePresenceBadgeStyles_unstable } from './usePresenceBadgeStyles';\nimport { renderBadge_unstable } from '../../Badge';\nimport type { PresenceBadgeProps } from './PresenceBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const PresenceBadge: ForwardRefComponent<PresenceBadgeProps> = React.forwardRef((props, ref) => {\n const state = usePresenceBadge_unstable(props, ref);\n usePresenceBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nPresenceBadge.displayName = 'PresenceBadge';\n"],"sourceRoot":"../src/"}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import type {
|
1
|
+
import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';
|
2
|
+
import type { BadgeCommons, BadgeSlots } from '../Badge/Badge.types';
|
2
3
|
export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';
|
3
|
-
|
4
|
+
declare type PresenceBadgeCommons = {
|
4
5
|
/**
|
5
6
|
* Represents several status
|
6
7
|
* @default available
|
@@ -12,6 +13,7 @@ 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 = Omit<ComponentProps<Pick<BadgeSlots, 'root'>>, 'color'> & Partial<Pick<PresenceBadgeCommons, 'status' | 'outOfOffice' | 'size'>>;
|
18
|
+
export declare type PresenceBadgeState = PresenceBadgeCommons & ComponentState<BadgeSlots>;
|
19
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,uBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './PresenceBadge';\nexport * from './PresenceBadge.types';\nexport * from './usePresenceBadge';\nexport * from './usePresenceBadgeStyles';\n"],"sourceRoot":"../src/"}
|
@@ -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,136 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.presenceUnknownRegular = exports.presenceOfflineRegular = exports.presenceOofRegular = exports.presenceDndRegular = exports.presenceDndFilled = exports.presenceBusyFilled = exports.presenceAvailableFilled = exports.presenceAvailableRegular = exports.presenceAwayFilled = void 0;
|
7
|
+
|
8
|
+
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
9
|
+
|
10
|
+
exports.presenceAwayFilled = {
|
11
|
+
// FIXME not all presence icon sizes are available
|
12
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
13
|
+
tiny: react_icons_1.PresenceAway10Filled,
|
14
|
+
'extra-small': react_icons_1.PresenceAway10Filled,
|
15
|
+
small: react_icons_1.PresenceAway12Filled,
|
16
|
+
medium: react_icons_1.PresenceAway16Filled,
|
17
|
+
// FIXME not all presence icon sizes are available
|
18
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
19
|
+
large: react_icons_1.PresenceAway16Filled,
|
20
|
+
// FIXME not all presence icon sizes are available
|
21
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
22
|
+
'extra-large': react_icons_1.PresenceAway16Filled
|
23
|
+
};
|
24
|
+
exports.presenceAvailableRegular = {
|
25
|
+
// FIXME not all presence icon sizes are available
|
26
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
27
|
+
tiny: react_icons_1.PresenceAvailable10Regular,
|
28
|
+
'extra-small': react_icons_1.PresenceAvailable10Regular,
|
29
|
+
small: react_icons_1.PresenceAvailable12Regular,
|
30
|
+
medium: react_icons_1.PresenceAvailable16Regular,
|
31
|
+
// FIXME not all presence icon sizes are available
|
32
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
33
|
+
large: react_icons_1.PresenceAvailable16Regular,
|
34
|
+
// FIXME not all presence icon sizes are available
|
35
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
36
|
+
'extra-large': react_icons_1.PresenceAvailable16Regular
|
37
|
+
};
|
38
|
+
exports.presenceAvailableFilled = {
|
39
|
+
// FIXME not all presence icon sizes are available
|
40
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
41
|
+
tiny: react_icons_1.PresenceAvailable10Filled,
|
42
|
+
'extra-small': react_icons_1.PresenceAvailable10Filled,
|
43
|
+
small: react_icons_1.PresenceAvailable12Filled,
|
44
|
+
medium: react_icons_1.PresenceAvailable16Filled,
|
45
|
+
// FIXME not all presence icon sizes are available
|
46
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
47
|
+
large: react_icons_1.PresenceAvailable16Filled,
|
48
|
+
// FIXME not all presence icon sizes are available
|
49
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
50
|
+
'extra-large': react_icons_1.PresenceAvailable16Filled
|
51
|
+
};
|
52
|
+
exports.presenceBusyFilled = {
|
53
|
+
// FIXME not all presence icon sizes are available
|
54
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
55
|
+
tiny: react_icons_1.PresenceBusy10Filled,
|
56
|
+
'extra-small': react_icons_1.PresenceBusy10Filled,
|
57
|
+
small: react_icons_1.PresenceBusy12Filled,
|
58
|
+
medium: react_icons_1.PresenceBusy16Filled,
|
59
|
+
// FIXME not all presence icon sizes are available
|
60
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
61
|
+
large: react_icons_1.PresenceBusy16Filled,
|
62
|
+
// FIXME not all presence icon sizes are available
|
63
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
64
|
+
'extra-large': react_icons_1.PresenceBusy16Filled
|
65
|
+
};
|
66
|
+
exports.presenceDndFilled = {
|
67
|
+
// FIXME not all presence icon sizes are available
|
68
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
69
|
+
tiny: react_icons_1.PresenceDnd10Filled,
|
70
|
+
'extra-small': react_icons_1.PresenceDnd10Filled,
|
71
|
+
small: react_icons_1.PresenceDnd12Filled,
|
72
|
+
medium: react_icons_1.PresenceDnd16Filled,
|
73
|
+
// FIXME not all presence icon sizes are available
|
74
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
75
|
+
large: react_icons_1.PresenceDnd16Filled,
|
76
|
+
// FIXME not all presence icon sizes are available
|
77
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
78
|
+
'extra-large': react_icons_1.PresenceDnd16Filled
|
79
|
+
};
|
80
|
+
exports.presenceDndRegular = {
|
81
|
+
// FIXME not all presence icon sizes are available
|
82
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
83
|
+
tiny: react_icons_1.PresenceDnd10Regular,
|
84
|
+
'extra-small': react_icons_1.PresenceDnd10Regular,
|
85
|
+
small: react_icons_1.PresenceDnd12Regular,
|
86
|
+
medium: react_icons_1.PresenceDnd16Regular,
|
87
|
+
// FIXME not all presence icon sizes are available
|
88
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
89
|
+
large: react_icons_1.PresenceDnd16Regular,
|
90
|
+
// FIXME not all presence icon sizes are available
|
91
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
92
|
+
'extra-large': react_icons_1.PresenceDnd16Regular
|
93
|
+
};
|
94
|
+
exports.presenceOofRegular = {
|
95
|
+
// FIXME not all presence icon sizes are available
|
96
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
97
|
+
tiny: react_icons_1.PresenceOof10Regular,
|
98
|
+
'extra-small': react_icons_1.PresenceOof10Regular,
|
99
|
+
small: react_icons_1.PresenceOof12Regular,
|
100
|
+
medium: react_icons_1.PresenceOof16Regular,
|
101
|
+
// FIXME not all presence icon sizes are available
|
102
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
103
|
+
large: react_icons_1.PresenceOof16Regular,
|
104
|
+
// FIXME not all presence icon sizes are available
|
105
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
106
|
+
'extra-large': react_icons_1.PresenceOof16Regular
|
107
|
+
};
|
108
|
+
exports.presenceOfflineRegular = {
|
109
|
+
// FIXME not all presence icon sizes are available
|
110
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
111
|
+
tiny: react_icons_1.PresenceOffline10Regular,
|
112
|
+
'extra-small': react_icons_1.PresenceOffline10Regular,
|
113
|
+
small: react_icons_1.PresenceOffline12Regular,
|
114
|
+
medium: react_icons_1.PresenceOffline16Regular,
|
115
|
+
// FIXME not all presence icon sizes are available
|
116
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
117
|
+
large: react_icons_1.PresenceOffline16Regular,
|
118
|
+
// FIXME not all presence icon sizes are available
|
119
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
120
|
+
'extra-large': react_icons_1.PresenceOffline16Regular
|
121
|
+
};
|
122
|
+
exports.presenceUnknownRegular = {
|
123
|
+
// FIXME not all presence icon sizes are available
|
124
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
125
|
+
tiny: react_icons_1.PresenceUnknown10Regular,
|
126
|
+
'extra-small': react_icons_1.PresenceUnknown10Regular,
|
127
|
+
small: react_icons_1.PresenceUnknown12Regular,
|
128
|
+
medium: react_icons_1.PresenceUnknown16Regular,
|
129
|
+
// FIXME not all presence icon sizes are available
|
130
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
131
|
+
large: react_icons_1.PresenceUnknown16Regular,
|
132
|
+
// FIXME not all presence icon sizes are available
|
133
|
+
// https://github.com/microsoft/fluentui/issues/20650
|
134
|
+
'extra-large': react_icons_1.PresenceUnknown16Regular
|
135
|
+
};
|
136
|
+
//# sourceMappingURL=presenceIcons.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport {\n PresenceAvailable10Regular,\n PresenceAvailable12Regular,\n PresenceAvailable16Regular,\n PresenceAvailable10Filled,\n PresenceAvailable12Filled,\n PresenceAvailable16Filled,\n PresenceAway10Filled,\n PresenceAway12Filled,\n PresenceAway16Filled,\n PresenceBusy10Filled,\n PresenceBusy12Filled,\n PresenceBusy16Filled,\n PresenceDnd10Regular,\n PresenceDnd12Regular,\n PresenceDnd16Regular,\n PresenceDnd10Filled,\n PresenceDnd12Filled,\n PresenceDnd16Filled,\n PresenceOof10Regular,\n PresenceOof12Regular,\n PresenceOof16Regular,\n PresenceOffline10Regular,\n PresenceOffline12Regular,\n PresenceOffline16Regular,\n PresenceUnknown10Regular,\n PresenceUnknown12Regular,\n PresenceUnknown16Regular,\n} from '@fluentui/react-icons';\nimport type { PresenceBadgeState } from './PresenceBadge.types';\n\nexport const presenceAwayFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAway10Filled,\n 'extra-small': PresenceAway10Filled,\n small: PresenceAway12Filled,\n medium: PresenceAway16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAway16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAway16Filled,\n};\n\nexport const presenceAvailableRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAvailable10Regular,\n 'extra-small': PresenceAvailable10Regular,\n small: PresenceAvailable12Regular,\n medium: PresenceAvailable16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAvailable16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAvailable16Regular,\n};\n\nexport const presenceAvailableFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAvailable10Filled,\n 'extra-small': PresenceAvailable10Filled,\n small: PresenceAvailable12Filled,\n medium: PresenceAvailable16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAvailable16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAvailable16Filled,\n};\n\nexport const presenceBusyFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceBusy10Filled,\n 'extra-small': PresenceBusy10Filled,\n small: PresenceBusy12Filled,\n medium: PresenceBusy16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceBusy16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceBusy16Filled,\n};\n\nexport const presenceDndFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceDnd10Filled,\n 'extra-small': PresenceDnd10Filled,\n small: PresenceDnd12Filled,\n medium: PresenceDnd16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceDnd16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceDnd16Filled,\n};\n\nexport const presenceDndRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceDnd10Regular,\n 'extra-small': PresenceDnd10Regular,\n small: PresenceDnd12Regular,\n medium: PresenceDnd16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceDnd16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceDnd16Regular,\n};\n\nexport const presenceOofRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceOof10Regular,\n 'extra-small': PresenceOof10Regular,\n small: PresenceOof12Regular,\n medium: PresenceOof16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceOof16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceOof16Regular,\n};\n\nexport const presenceOfflineRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceOffline10Regular,\n 'extra-small': PresenceOffline10Regular,\n small: PresenceOffline12Regular,\n medium: PresenceOffline16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceOffline16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceOffline16Regular,\n};\n\nexport const presenceUnknownRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceUnknown10Regular,\n 'extra-small': PresenceUnknown10Regular,\n small: PresenceUnknown12Regular,\n medium: PresenceUnknown16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceUnknown16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceUnknown16Regular,\n};\n"],"sourceRoot":"../src/"}
|
@@ -3,4 +3,4 @@ import type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.typ
|
|
3
3
|
/**
|
4
4
|
* Returns the props and state required to render the component
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const usePresenceBadge_unstable: (props: PresenceBadgeProps, ref: React.Ref<HTMLElement>) => PresenceBadgeState;
|
@@ -3,49 +3,63 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.usePresenceBadge_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
|
+
const presenceIcons_1 = /*#__PURE__*/require("./presenceIcons");
|
13
|
+
|
12
14
|
const index_1 = /*#__PURE__*/require("../Badge/index");
|
13
15
|
|
14
|
-
const
|
16
|
+
const iconMap = (status, outOfOffice, size) => {
|
17
|
+
switch (status) {
|
18
|
+
case 'available':
|
19
|
+
return outOfOffice ? presenceIcons_1.presenceAvailableRegular[size] : presenceIcons_1.presenceAvailableFilled[size];
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
case 'away':
|
22
|
+
return outOfOffice ? presenceIcons_1.presenceOfflineRegular[size] : presenceIcons_1.presenceAwayFilled[size];
|
23
|
+
|
24
|
+
case 'busy':
|
25
|
+
return outOfOffice ? presenceIcons_1.presenceUnknownRegular[size] : presenceIcons_1.presenceBusyFilled[size];
|
26
|
+
|
27
|
+
case 'doNotDisturb':
|
28
|
+
return outOfOffice ? presenceIcons_1.presenceDndRegular[size] : presenceIcons_1.presenceDndFilled[size];
|
29
|
+
|
30
|
+
case 'offline':
|
31
|
+
return presenceIcons_1.presenceOfflineRegular[size];
|
32
|
+
|
33
|
+
case 'outOfOffice':
|
34
|
+
return presenceIcons_1.presenceOofRegular[size];
|
35
|
+
}
|
36
|
+
};
|
24
37
|
/**
|
25
38
|
* Returns the props and state required to render the component
|
26
39
|
*/
|
27
40
|
|
28
41
|
|
29
|
-
const
|
30
|
-
var _a, _b
|
42
|
+
const usePresenceBadge_unstable = (props, ref) => {
|
43
|
+
var _a, _b;
|
31
44
|
|
32
|
-
const state = { ...index_1.
|
33
|
-
size: '
|
45
|
+
const state = { ...index_1.useBadge_unstable({
|
46
|
+
size: 'medium',
|
34
47
|
...props,
|
35
|
-
icon: react_utilities_1.resolveShorthand(
|
48
|
+
icon: react_utilities_1.resolveShorthand(undefined, {
|
36
49
|
required: true
|
37
50
|
})
|
38
51
|
}, ref),
|
39
52
|
status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
|
40
53
|
outOfOffice: (_b = props.outOfOffice) !== null && _b !== void 0 ? _b : false
|
41
54
|
};
|
55
|
+
const IconElement = iconMap(state.status, state.outOfOffice, state.size);
|
42
56
|
|
43
|
-
if (
|
44
|
-
state.icon.children =
|
57
|
+
if (IconElement) {
|
58
|
+
state.icon.children = React.createElement(IconElement, null);
|
45
59
|
}
|
46
60
|
|
47
61
|
return state;
|
48
62
|
};
|
49
63
|
|
50
|
-
exports.
|
64
|
+
exports.usePresenceBadge_unstable = usePresenceBadge_unstable;
|
51
65
|
//# sourceMappingURL=usePresenceBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAWA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAM,OAAO,GAAG,CACd,MADc,EAEd,WAFc,EAGd,IAHc,KAIoB;AAClC,UAAQ,MAAR;AACE,SAAK,WAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,wBAAA,CAAyB,IAAzB,CAAH,GAAoC,eAAA,CAAA,uBAAA,CAAwB,IAAxB,CAAtD;;AACF,SAAK,MAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAH,GAAkC,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAApD;;AACF,SAAK,MAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAH,GAAkC,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAApD;;AACF,SAAK,cAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAAH,GAA8B,eAAA,CAAA,iBAAA,CAAkB,IAAlB,CAAhD;;AACF,SAAK,SAAL;AACE,aAAO,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAP;;AACF,SAAK,aAAL;AACE,aAAO,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAAP;AAZJ;AAcD,CAnBD;AAqBA;;AAEG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;AACtB,QAAM,KAAK,GAAuB,EAChC,GAAG,OAAA,CAAA,iBAAA,CACD;AACE,MAAA,IAAI,EAAE,QADR;AAEE,SAAG,KAFL;AAGE,MAAA,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,SAAjB,EAAkD;AACtD,QAAA,QAAQ,EAAE;AAD4C,OAAlD;AAHR,KADC,EAQD,GARC,CAD6B;AAWhC,IAAA,MAAM,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,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,GAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CAzBM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceBusyFilled,\n presenceDndFilled,\n presenceDndRegular,\n presenceOfflineRegular,\n presenceOofRegular,\n presenceUnknownRegular,\n} from './presenceIcons';\nimport { useBadge_unstable, BadgeProps } from '../Badge/index';\nimport type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';\n\nconst iconMap = (\n status: PresenceBadgeState['status'],\n outOfOffice: boolean,\n size: PresenceBadgeState['size'],\n): React.FunctionComponent | null => {\n switch (status) {\n case 'available':\n return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];\n case 'away':\n return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];\n case 'busy':\n return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];\n case 'doNotDisturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'outOfOffice':\n return presenceOofRegular[size];\n }\n};\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge_unstable = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n): PresenceBadgeState => {\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n size: 'medium',\n ...props,\n icon: resolveShorthand(undefined as BadgeProps['icon'], {\n required: true,\n }),\n },\n ref,\n ),\n status: props.status ?? 'available',\n outOfOffice: props.outOfOffice ?? false,\n };\n\n const IconElement = iconMap(state.status, state.outOfOffice, state.size);\n if (IconElement) {\n state.icon!.children = <IconElement />;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -3,4 +3,4 @@ export declare const presenceBadgeClassName = "fui-PresenceBadge";
|
|
3
3
|
/**
|
4
4
|
* Applies style classnames to slots
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const usePresenceBadgeStyles_unstable: (state: PresenceBadgeState) => PresenceBadgeState;
|