@fluentui/react-badge 9.0.0-nightly.f81b28ceb3.1 → 9.0.0-rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/CHANGELOG.json +365 -18
  2. package/CHANGELOG.md +76 -11
  3. package/dist/react-badge.d.ts +33 -28
  4. package/lib/components/Badge/Badge.d.ts +1 -1
  5. package/lib/components/Badge/Badge.js +8 -8
  6. package/lib/components/Badge/Badge.js.map +1 -1
  7. package/lib/components/Badge/Badge.types.d.ts +4 -5
  8. package/lib/components/Badge/index.d.ts +1 -1
  9. package/lib/components/Badge/index.js +0 -1
  10. package/lib/components/Badge/index.js.map +1 -1
  11. package/lib/components/Badge/renderBadge.d.ts +1 -1
  12. package/lib/components/Badge/renderBadge.js +9 -7
  13. package/lib/components/Badge/renderBadge.js.map +1 -1
  14. package/lib/components/Badge/useBadge.d.ts +1 -1
  15. package/lib/components/Badge/useBadge.js +19 -22
  16. package/lib/components/Badge/useBadge.js.map +1 -1
  17. package/lib/components/Badge/useBadgeStyles.d.ts +2 -1
  18. package/lib/components/Badge/useBadgeStyles.js +210 -203
  19. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  20. package/lib/components/CounterBadge/CounterBadge.d.ts +1 -1
  21. package/lib/components/CounterBadge/CounterBadge.js +8 -8
  22. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  23. package/lib/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  24. package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -1
  25. package/lib/components/CounterBadge/useCounterBadge.js +19 -25
  26. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  27. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +2 -1
  28. package/lib/components/CounterBadge/useCounterBadgeStyles.js +10 -40
  29. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  30. package/lib/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  31. package/lib/components/PresenceBadge/PresenceBadge.js +8 -8
  32. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  33. package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  34. package/lib/components/PresenceBadge/presenceIcons.d.ts +11 -0
  35. package/lib/components/PresenceBadge/presenceIcons.js +128 -0
  36. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -0
  37. package/lib/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  38. package/lib/components/PresenceBadge/usePresenceBadge.js +36 -25
  39. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  40. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +2 -1
  41. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +43 -46
  42. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  43. package/lib-commonjs/Badge.js +1 -1
  44. package/lib-commonjs/CounterBadge.js +1 -1
  45. package/lib-commonjs/PresenceBadge.js +1 -1
  46. package/lib-commonjs/components/Badge/Badge.d.ts +1 -1
  47. package/lib-commonjs/components/Badge/Badge.js +9 -9
  48. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  49. package/lib-commonjs/components/Badge/Badge.types.d.ts +4 -5
  50. package/lib-commonjs/components/Badge/index.d.ts +1 -1
  51. package/lib-commonjs/components/Badge/index.js +1 -3
  52. package/lib-commonjs/components/Badge/index.js.map +1 -1
  53. package/lib-commonjs/components/Badge/renderBadge.d.ts +1 -1
  54. package/lib-commonjs/components/Badge/renderBadge.js +13 -12
  55. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  56. package/lib-commonjs/components/Badge/useBadge.d.ts +1 -1
  57. package/lib-commonjs/components/Badge/useBadge.js +22 -26
  58. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  59. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +2 -1
  60. package/lib-commonjs/components/Badge/useBadgeStyles.js +214 -205
  61. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  62. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -1
  63. package/lib-commonjs/components/CounterBadge/CounterBadge.js +9 -9
  64. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  65. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  66. package/lib-commonjs/components/CounterBadge/index.js +1 -1
  67. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -1
  68. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +21 -28
  69. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  70. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +2 -1
  71. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +13 -42
  72. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  73. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  74. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +9 -9
  75. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  76. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  77. package/lib-commonjs/components/PresenceBadge/index.js +1 -1
  78. package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +11 -0
  79. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +136 -0
  80. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -0
  81. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  82. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +38 -28
  83. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  84. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +2 -1
  85. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +46 -48
  86. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  87. package/lib-commonjs/index.js +1 -1
  88. package/package.json +14 -15
  89. package/lib/common/isConformant.d.ts +0 -4
  90. package/lib/common/isConformant.js +0 -13
  91. package/lib/common/isConformant.js.map +0 -1
  92. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  93. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -111
  94. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
  95. package/lib-commonjs/common/isConformant.d.ts +0 -4
  96. package/lib-commonjs/common/isConformant.js +0 -24
  97. package/lib-commonjs/common/isConformant.js.map +0 -1
  98. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  99. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -127
  100. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.CounterBadge = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var useCounterBadge_1 = /*#__PURE__*/require("./useCounterBadge");
10
+ const useCounterBadge_1 = /*#__PURE__*/require("./useCounterBadge");
11
11
 
12
- var useCounterBadgeStyles_1 = /*#__PURE__*/require("./useCounterBadgeStyles");
12
+ const useCounterBadgeStyles_1 = /*#__PURE__*/require("./useCounterBadgeStyles");
13
13
 
14
- var index_1 = /*#__PURE__*/require("../Badge/index");
14
+ const index_1 = /*#__PURE__*/require("../Badge/index");
15
15
  /**
16
- * Define a styled CounterBadge, using the `useCounterBadge` hook.
16
+ * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.
17
17
  */
18
18
 
19
19
 
20
- exports.CounterBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = useCounterBadge_1.useCounterBadge(props, ref);
22
- useCounterBadgeStyles_1.useCounterBadgeStyles(state);
23
- return index_1.renderBadge(state);
20
+ exports.CounterBadge = /*#__PURE__*/React.forwardRef((props, ref) => {
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":["../../../src/components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,IAAA,uBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,YAAA,gBAAuD,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC9F,MAAM,KAAK,GAAG,iBAAA,CAAA,eAAA,CAAgB,KAAhB,EAAuB,GAAvB,CAAd;AACA,EAAA,uBAAA,CAAA,qBAAA,CAAsB,KAAtB;AAEA,SAAO,OAAA,CAAA,WAAA,CAAY,KAAZ,CAAP;AACD,CALmE,CAAvD;AAOb,OAAA,CAAA,YAAA,CAAa,WAAb,GAA2B,cAA3B","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/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","sourceRoot":""}
@@ -1,5 +1,5 @@
1
1
  import type { BadgeProps, BadgeState } from '../Badge/index';
2
- export declare type CounterBadgeCommons = {
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
- * {@docCategory CounterBadge}
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 {};
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./CounterBadge"), exports);
10
10
 
@@ -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 useCounterBadge: (props: CounterBadgeProps, ref: React.Ref<HTMLElement>) => CounterBadgeState;
6
+ export declare const useCounterBadge_unstable: (props: CounterBadgeProps, ref: React.Ref<HTMLElement>) => CounterBadgeState;
@@ -3,45 +3,38 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCounterBadge = void 0;
6
+ exports.useCounterBadge_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
9
-
10
- var index_1 = /*#__PURE__*/require("../Badge/index");
8
+ const index_1 = /*#__PURE__*/require("../Badge/index");
11
9
  /**
12
10
  * Returns the props and state required to render the component
13
11
  */
14
12
 
15
13
 
16
- var useCounterBadge = function (props, ref) {
17
- var _a = props.shape,
18
- shape = _a === void 0 ? 'circular' : _a,
19
- _b = props.appearance,
20
- appearance = _b === void 0 ? 'filled' : _b,
21
- _c = props.showZero,
22
- showZero = _c === void 0 ? false : _c,
23
- _d = props.overflowCount,
24
- overflowCount = _d === void 0 ? 99 : _d,
25
- _e = props.count,
26
- count = _e === void 0 ? 0 : _e,
27
- _f = props.dot,
28
- dot = _f === void 0 ? false : _f;
29
-
30
- var state = tslib_1.__assign(tslib_1.__assign({}, index_1.useBadge(props, ref)), {
31
- shape: shape,
32
- appearance: appearance,
33
- showZero: showZero,
34
- overflowCount: overflowCount,
35
- count: count,
36
- dot: dot
37
- });
14
+ const useCounterBadge_unstable = (props, ref) => {
15
+ const {
16
+ shape = 'circular',
17
+ appearance = 'filled',
18
+ showZero = false,
19
+ overflowCount = 99,
20
+ count = 0,
21
+ dot = false
22
+ } = props;
23
+ const state = { ...index_1.useBadge_unstable(props, ref),
24
+ shape,
25
+ appearance,
26
+ showZero,
27
+ overflowCount,
28
+ count,
29
+ dot
30
+ };
38
31
 
39
32
  if (!state.dot && !state.root.children) {
40
- state.root.children = state.count > state.overflowCount ? state.overflowCount + "+" : "" + state.count;
33
+ state.root.children = state.count > state.overflowCount ? `${state.overflowCount}+` : `${state.count}`;
41
34
  }
42
35
 
43
36
  return state;
44
37
  };
45
38
 
46
- exports.useCounterBadge = useCounterBadge;
39
+ exports.useCounterBadge_unstable = useCounterBadge_unstable;
47
40
  //# sourceMappingURL=useCounterBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,eAAe,GAAG,UAAC,KAAD,EAA2B,GAA3B,EAAsD;AAEjF,MAAA,EAAA,GAME,KAAK,CANW,KAAlB;AAAA,MAAA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,UAAH,GAAa,EAAlB;AAAA,MACA,EAAA,GAKE,KAAK,CALc,UADrB;AAAA,MACA,UAAU,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EADrB;AAAA,MAEA,EAAA,GAIE,KAAK,CAJS,QAFhB;AAAA,MAEA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAFhB;AAAA,MAGA,EAAA,GAGE,KAAK,CAHW,aAHlB;AAAA,MAGA,aAAa,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,EAAH,GAAK,EAHlB;AAAA,MAIA,EAAA,GAEE,KAAK,CAFE,KAJT;AAAA,MAIA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,CAAH,GAAI,EAJT;AAAA,MAKA,EAAA,GACE,KAAK,CADI,GALX;AAAA,MAKA,GAAG,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EALX;;AAQF,MAAM,KAAK,GAAA,OAAA,CAAA,QAAA,CAAA,OAAA,CAAA,QAAA,CAAA,EAAA,EACN,OAAA,CAAA,QAAA,CAAS,KAAT,EAAgB,GAAhB,CADM,CAAA,EACc;AACvB,IAAA,KAAK,EAAA,KADkB;AAEvB,IAAA,UAAU,EAAA,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,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","sourceRoot":""}
@@ -1,5 +1,6 @@
1
1
  import type { CounterBadgeState } from './CounterBadge.types';
2
+ export declare const counterBadgeClassName = "fui-CounterBadge";
2
3
  /**
3
4
  * Applies style classnames to slots
4
5
  */
5
- export declare const useCounterBadgeStyles: (state: CounterBadgeState) => CounterBadgeState;
6
+ export declare const useCounterBadgeStyles_unstable: (state: CounterBadgeState) => CounterBadgeState;
@@ -3,46 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCounterBadgeStyles = void 0;
6
+ exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassName = void 0;
7
7
 
8
- var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
8
+ const react_1 = /*#__PURE__*/require("@griffel/react");
9
9
 
10
- var useBadgeStyles_1 = /*#__PURE__*/require("../Badge/useBadgeStyles");
10
+ const useBadgeStyles_1 = /*#__PURE__*/require("../Badge/useBadgeStyles");
11
11
 
12
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
13
- "root": {
14
- "Bf4jedk": "fgfkb25"
15
- },
16
- "warning": {
17
- "De3pzq": "fic4z9l",
18
- "g2u3we": "f1g6aqbb",
19
- "h3c5rm": ["f1xc4egn", "f1y13pv"],
20
- "B9xav0g": "f12f05r9",
21
- "zhjwy3": ["f1y13pv", "f1xc4egn"]
22
- },
23
- "important": {
24
- "De3pzq": "f1y11cvn",
25
- "g2u3we": "f9ag23u",
26
- "h3c5rm": ["fzlvby", "fj2uge6"],
27
- "B9xav0g": "fk41dq4",
28
- "zhjwy3": ["fj2uge6", "fzlvby"]
29
- },
30
- "severe": {
31
- "De3pzq": "ftpr1dl",
32
- "g2u3we": "fx7g4rx",
33
- "h3c5rm": ["f1edxl4n", "f5hlgd2"],
34
- "B9xav0g": "f5ppncr",
35
- "zhjwy3": ["f5hlgd2", "f1edxl4n"]
36
- },
37
- "informative": {
38
- "De3pzq": "f6zwqgc",
39
- "g2u3we": "f1pdtvjr",
40
- "h3c5rm": ["f1ctwv29", "f1m7luuw"],
41
- "B9xav0g": "f1ijpqjr",
42
- "zhjwy3": ["f1m7luuw", "f1ctwv29"],
43
- "sj55zd": "f11d4kpn"
44
- },
12
+ exports.counterBadgeClassName = 'fui-CounterBadge';
13
+
14
+ const useStyles = /*#__PURE__*/react_1.__styles({
45
15
  "dot": {
16
+ "Bf4jedk": "fgfkb25",
46
17
  "a9b677": "f16dn6v3",
47
18
  "Bqenvij": "f3mu39s",
48
19
  "z8tnut": "f1g0x7ka",
@@ -54,18 +25,18 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
54
25
  "mc9l5x": "fjseox"
55
26
  }
56
27
  }, {
57
- "d": [".fgfkb25{min-width:auto;}", ".fic4z9l{background-color:#c50f1f;}", ".f1g6aqbb{border-top-color:#c50f1f;}", ".f1xc4egn{border-right-color:#c50f1f;}", ".f1y13pv{border-left-color:#c50f1f;}", ".f12f05r9{border-bottom-color:#c50f1f;}", ".f1y11cvn{background-color:#242424;}", ".f9ag23u{border-top-color:#242424;}", ".fzlvby{border-right-color:#242424;}", ".fj2uge6{border-left-color:#242424;}", ".fk41dq4{border-bottom-color:#242424;}", ".ftpr1dl{background-color:#d13438;}", ".fx7g4rx{border-top-color:#d13438;}", ".f1edxl4n{border-right-color:#d13438;}", ".f5hlgd2{border-left-color:#d13438;}", ".f5ppncr{border-bottom-color:#d13438;}", ".f6zwqgc{background-color:#ebebeb;}", ".f1pdtvjr{border-top-color:#ebebeb;}", ".f1ctwv29{border-right-color:#ebebeb;}", ".f1m7luuw{border-left-color:#ebebeb;}", ".f1ijpqjr{border-bottom-color:#ebebeb;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".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;}"]
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;}"]
58
29
  });
59
30
  /**
60
31
  * Applies style classnames to slots
61
32
  */
62
33
 
63
34
 
64
- var useCounterBadgeStyles = function (state) {
65
- var styles = useStyles();
66
- state.root.className = react_make_styles_1.mergeClasses(styles.root, state.color === 'warning' && styles.warning, state.color === 'important' && styles.important, state.color === 'severe' && styles.severe, state.color === 'informative' && styles.informative, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
67
- return useBadgeStyles_1.useBadgeStyles(state);
35
+ const useCounterBadgeStyles_unstable = state => {
36
+ const styles = useStyles();
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);
68
39
  };
69
40
 
70
- exports.useCounterBadgeStyles = useCounterBadgeStyles;
41
+ exports.useCounterBadgeStyles_unstable = useCounterBadgeStyles_unstable;
71
42
  //# sourceMappingURL=useCounterBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;A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,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","sourceRoot":""}
@@ -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 `useBadge` hook.
4
+ * Define a styled Badge, using the `useBadge_unstable` hook.
5
5
  */
6
6
  export declare const PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PresenceBadge = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var usePresenceBadge_1 = /*#__PURE__*/require("./usePresenceBadge");
10
+ const usePresenceBadge_1 = /*#__PURE__*/require("./usePresenceBadge");
11
11
 
12
- var usePresenceBadgeStyles_1 = /*#__PURE__*/require("./usePresenceBadgeStyles");
12
+ const usePresenceBadgeStyles_1 = /*#__PURE__*/require("./usePresenceBadgeStyles");
13
13
 
14
- var Badge_1 = /*#__PURE__*/require("../../Badge");
14
+ const Badge_1 = /*#__PURE__*/require("../../Badge");
15
15
  /**
16
- * Define a styled Badge, using the `useBadge` hook.
16
+ * Define a styled Badge, using the `useBadge_unstable` hook.
17
17
  */
18
18
 
19
19
 
20
- exports.PresenceBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = usePresenceBadge_1.usePresenceBadge(props, ref);
22
- usePresenceBadgeStyles_1.usePresenceBadgeStyles(state);
23
- return Badge_1.renderBadge(state);
20
+ exports.PresenceBadge = /*#__PURE__*/React.forwardRef((props, ref) => {
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":["../../../src/components/PresenceBadge/PresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,IAAA,wBAAA,gBAAA,OAAA,CAAA,0BAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChG,MAAM,KAAK,GAAG,kBAAA,CAAA,gBAAA,CAAiB,KAAjB,EAAwB,GAAxB,CAAd;AACA,EAAA,wBAAA,CAAA,sBAAA,CAAuB,KAAvB;AAEA,SAAO,OAAA,CAAA,WAAA,CAAY,KAAZ,CAAP;AACD,CALqE,CAAzD;AAOb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/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","sourceRoot":""}
@@ -1,6 +1,7 @@
1
- import type { BadgeProps, BadgeState } from '../Badge/index';
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
- export interface PresenceBadgeCommons {
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 = BadgeProps & Partial<PresenceBadgeCommons>;
17
- export declare type PresenceBadgeState = BadgeState & PresenceBadgeCommons;
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 {};
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
8
 
9
9
  tslib_1.__exportStar(require("./PresenceBadge"), exports);
10
10
 
@@ -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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,EAAA,KAAK,EAAE,aAAA,CAAA,wBALiG;AAMxG,EAAA,MAAM,EAAE,aAAA,CAAA,wBANgG;AAOxG;AACA;AACA,EAAA,KAAK,EAAE,aAAA,CAAA,wBATiG;AAUxG;AACA;AACA,iBAAe,aAAA,CAAA;AAZyF,CAA7F;AAeA,OAAA,CAAA,sBAAA,GAA6F;AACxG;AACA;AACA,EAAA,IAAI,EAAE,aAAA,CAAA,wBAHkG;AAIxG,iBAAe,aAAA,CAAA,wBAJyF;AAKxG,EAAA,KAAK,EAAE,aAAA,CAAA,wBALiG;AAMxG,EAAA,MAAM,EAAE,aAAA,CAAA,wBANgG;AAOxG;AACA;AACA,EAAA,KAAK,EAAE,aAAA,CAAA,wBATiG;AAUxG;AACA;AACA,iBAAe,aAAA,CAAA;AAZyF,CAA7F","sourceRoot":""}
@@ -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 usePresenceBadge: (props: PresenceBadgeProps, ref: React.Ref<HTMLElement>) => PresenceBadgeState;
6
+ export declare const usePresenceBadge_unstable: (props: PresenceBadgeProps, ref: React.Ref<HTMLElement>) => PresenceBadgeState;
@@ -3,53 +3,63 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePresenceBadge = void 0;
6
+ exports.usePresenceBadge_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var React = /*#__PURE__*/require("react");
10
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
11
 
12
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
12
+ const presenceIcons_1 = /*#__PURE__*/require("./presenceIcons");
13
13
 
14
- var index_1 = /*#__PURE__*/require("../Badge/index");
14
+ const index_1 = /*#__PURE__*/require("../Badge/index");
15
15
 
16
- var DefaultPresenceBadgeIcons_1 = /*#__PURE__*/require("./DefaultPresenceBadgeIcons");
16
+ const iconMap = (status, outOfOffice, size) => {
17
+ switch (status) {
18
+ case 'available':
19
+ return outOfOffice ? presenceIcons_1.presenceAvailableRegular[size] : presenceIcons_1.presenceAvailableFilled[size];
17
20
 
18
- var iconMap = function (outOfOffice) {
19
- return {
20
- busy: null,
21
- available: outOfOffice ? React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null) : React.createElement(DefaultPresenceBadgeIcons_1.SkypeCheckIcon, null),
22
- away: outOfOffice ? React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null) : React.createElement(DefaultPresenceBadgeIcons_1.SkypeClockIcon, null),
23
- offline: React.createElement(DefaultPresenceBadgeIcons_1.CancelIcon, null),
24
- outOfOffice: React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null),
25
- doNotDisturb: React.createElement(DefaultPresenceBadgeIcons_1.SkypeMinusIcon, null)
26
- };
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
+ }
27
36
  };
28
37
  /**
29
38
  * Returns the props and state required to render the component
30
39
  */
31
40
 
32
41
 
33
- var usePresenceBadge = function (props, ref) {
34
- var _a, _b, _c;
42
+ const usePresenceBadge_unstable = (props, ref) => {
43
+ var _a, _b;
35
44
 
36
- var state = tslib_1.__assign(tslib_1.__assign({}, index_1.useBadge(tslib_1.__assign(tslib_1.__assign({
37
- size: 'small'
38
- }, props), {
39
- icon: react_utilities_1.resolveShorthand(props.icon, {
40
- required: true
41
- })
42
- }), ref)), {
45
+ const state = { ...index_1.useBadge_unstable({
46
+ size: 'medium',
47
+ ...props,
48
+ icon: react_utilities_1.resolveShorthand(undefined, {
49
+ required: true
50
+ })
51
+ }, ref),
43
52
  status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
44
53
  outOfOffice: (_b = props.outOfOffice) !== null && _b !== void 0 ? _b : false
45
- });
54
+ };
55
+ const IconElement = iconMap(state.status, state.outOfOffice, state.size);
46
56
 
47
- if (!((_c = state.icon) === null || _c === void 0 ? void 0 : _c.children)) {
48
- state.icon.children = iconMap(state.outOfOffice)[state.status];
57
+ if (IconElement) {
58
+ state.icon.children = React.createElement(IconElement, null);
49
59
  }
50
60
 
51
61
  return state;
52
62
  };
53
63
 
54
- exports.usePresenceBadge = usePresenceBadge;
64
+ exports.usePresenceBadge_unstable = usePresenceBadge_unstable;
55
65
  //# sourceMappingURL=usePresenceBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,IAAA,2BAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AASA,IAAM,OAAO,GAA8E,UAAA,WAAA,EAAW;AAAI,SAAC;AACzG,IAAA,IAAI,EAAE,IADmG;AAEzG,IAAA,SAAS,EAAE,WAAW,GAAG,KAAA,CAAA,aAAA,CAAC,2BAAA,CAAA,cAAD,EAAe,IAAf,CAAH,GAAwB,KAAA,CAAA,aAAA,CAAC,2BAAA,CAAA,cAAD,EAAe,IAAf,CAF2D;AAGzG,IAAA,IAAI,EAAE,WAAW,GAAG,KAAA,CAAA,aAAA,CAAC,2BA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