@fluentui/react-badge 0.0.0-nightlyfbae36b19b20211111.1 → 0.0.0-nightlyfc5cfdc52420220215.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/CHANGELOG.json +299 -16
  2. package/CHANGELOG.md +70 -11
  3. package/dist/react-badge.d.ts +27 -28
  4. package/lib/components/Badge/Badge.d.ts +1 -1
  5. package/lib/components/Badge/Badge.js +7 -7
  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 +6 -3
  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 +1 -1
  16. package/lib/components/Badge/useBadge.js.map +1 -1
  17. package/lib/components/Badge/useBadgeStyles.d.ts +1 -1
  18. package/lib/components/Badge/useBadgeStyles.js +209 -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 +7 -7
  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 +3 -3
  26. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  27. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
  28. package/lib/components/CounterBadge/useCounterBadgeStyles.js +7 -38
  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 +7 -7
  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 +32 -18
  39. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  40. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
  41. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +40 -44
  42. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  43. package/lib-commonjs/components/Badge/Badge.d.ts +1 -1
  44. package/lib-commonjs/components/Badge/Badge.js +4 -4
  45. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  46. package/lib-commonjs/components/Badge/Badge.types.d.ts +4 -5
  47. package/lib-commonjs/components/Badge/index.d.ts +1 -1
  48. package/lib-commonjs/components/Badge/index.js +0 -2
  49. package/lib-commonjs/components/Badge/index.js.map +1 -1
  50. package/lib-commonjs/components/Badge/renderBadge.d.ts +1 -1
  51. package/lib-commonjs/components/Badge/renderBadge.js +8 -5
  52. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  53. package/lib-commonjs/components/Badge/useBadge.d.ts +1 -1
  54. package/lib-commonjs/components/Badge/useBadge.js +3 -3
  55. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  56. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +1 -1
  57. package/lib-commonjs/components/Badge/useBadgeStyles.js +212 -205
  58. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  59. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -1
  60. package/lib-commonjs/components/CounterBadge/CounterBadge.js +4 -4
  61. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  62. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  63. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -1
  64. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +4 -4
  65. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  66. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
  67. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +9 -40
  68. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  69. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  70. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +4 -4
  71. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  72. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  73. package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +11 -0
  74. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +136 -0
  75. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -0
  76. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  77. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +32 -18
  78. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  79. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
  80. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +43 -47
  81. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  82. package/package.json +14 -15
  83. package/lib/common/isConformant.d.ts +0 -4
  84. package/lib/common/isConformant.js +0 -13
  85. package/lib/common/isConformant.js.map +0 -1
  86. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  87. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -98
  88. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
  89. package/lib-commonjs/common/isConformant.d.ts +0 -4
  90. package/lib-commonjs/common/isConformant.js +0 -24
  91. package/lib-commonjs/common/isConformant.js.map +0 -1
  92. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  93. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -113
  94. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
@@ -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 {};
@@ -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,7 +3,7 @@
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
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 useCounterBadge = (props, ref) => {
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.useBadge(props, ref),
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.useCounterBadge = useCounterBadge;
39
+ exports.useCounterBadge_unstable = useCounterBadge_unstable;
40
40
  //# sourceMappingURL=useCounterBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,eAAe,GAAG,CAAC,KAAD,EAA2B,GAA3B,KAA6E;AAC1G,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,GAAG,OAAA,CAAA,QAAA,CAAS,KAAT,EAAgB,GAAhB,CAD4B;AAE/B,IAAA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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":""}
@@ -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 useCounterBadgeStyles: (state: CounterBadgeState) => CounterBadgeState;
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.useCounterBadgeStyles = exports.counterBadgeClassName = void 0;
6
+ exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassName = void 0;
7
7
 
8
- const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
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__*/react_make_styles_1.__styles({
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;}", ".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;}"]
60
29
  });
61
30
  /**
62
31
  * Applies style classnames to slots
63
32
  */
64
33
 
65
34
 
66
- const useCounterBadgeStyles = state => {
35
+ const useCounterBadgeStyles_unstable = state => {
67
36
  const styles = useStyles();
68
- state.root.className = react_make_styles_1.mergeClasses(exports.counterBadgeClassName, 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);
69
- return useBadgeStyles_1.useBadgeStyles(state);
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.useCounterBadgeStyles = useCounterBadgeStyles;
41
+ exports.useCounterBadgeStyles_unstable = useCounterBadgeStyles_unstable;
73
42
  //# sourceMappingURL=useCounterBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;;AAGa,OAAA,CAAA,qBAAA,GAAwB,kBAAxB;;AAEb,MAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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xB;;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>;
@@ -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 `useBadge` hook.
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.usePresenceBadge(props, ref);
22
- usePresenceBadgeStyles_1.usePresenceBadgeStyles(state);
23
- return Badge_1.renderBadge(state);
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,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,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 {};
@@ -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":["../../../src/components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AA+Ba,OAAA,CAAA,kBAAA,GAAyF;AACpG;AACA;AACA,EAAA,IAAI,EAAE,aAAA,CAAA,oBAH8F;AAIpG,iBAAe,aAAA,CAAA,oBAJqF;AAKpG,EAAA,KAAK,EAAE,aAAA,CAAA,oBAL6F;AAMpG,EAAA,MAAM,EAAE,aAAA,CAAA,oBAN4F;AAOpG;AACA;AACA,EAAA,KAAK,EAAE,aAAA,CAAA,oBAT6F;AAUpG;AACA;AACA,iBAAe,aAAA,CAAA;AAZqF,CAAzF;AAeA,OAAA,CAAA,wBAAA,GAA+F;AAC1G;AACA;AACA,EAAA,IAAI,EAAE,aAAA,CAAA,0BAHoG;AAI1G,iBAAe,aAAA,CAAA,0BAJ2F;AAK1G,EAAA,KAAK,EAAE,aAAA,CAAA,0BALmG;A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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,49 +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
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 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];
15
20
 
16
- const iconMap = outOfOffice => ({
17
- busy: null,
18
- available: outOfOffice ? React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null) : React.createElement(DefaultPresenceBadgeIcons_1.SkypeCheckIcon, null),
19
- away: outOfOffice ? React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null) : React.createElement(DefaultPresenceBadgeIcons_1.SkypeClockIcon, null),
20
- offline: React.createElement(DefaultPresenceBadgeIcons_1.CancelIcon, null),
21
- outOfOffice: React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null),
22
- doNotDisturb: React.createElement(DefaultPresenceBadgeIcons_1.SkypeMinusIcon, null)
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 usePresenceBadge = (props, ref) => {
30
- var _a, _b, _c;
42
+ const usePresenceBadge_unstable = (props, ref) => {
43
+ var _a, _b;
31
44
 
32
- const state = { ...index_1.useBadge({
33
- size: 'small',
45
+ const state = { ...index_1.useBadge_unstable({
46
+ size: 'medium',
34
47
  ...props,
35
- icon: react_utilities_1.resolveShorthand(props.icon, {
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 (!((_c = state.icon) === null || _c === void 0 ? void 0 : _c.children)) {
44
- state.icon.children = iconMap(state.outOfOffice)[state.status];
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.usePresenceBadge = usePresenceBadge;
64
+ exports.usePresenceBadge_unstable = usePresenceBadge_unstable;
51
65
  //# sourceMappingURL=usePresenceBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,OAAA,gB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 @@ export declare const presenceBadgeClassName = "fui-PresenceBadge";
3
3
  /**
4
4
  * Applies style classnames to slots
5
5
  */
6
- export declare const usePresenceBadgeStyles: (state: PresenceBadgeState) => PresenceBadgeState;
6
+ export declare const usePresenceBadgeStyles_unstable: (state: PresenceBadgeState) => PresenceBadgeState;