@fluentui/react-badge 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. package/CHANGELOG.json +644 -25
  2. package/CHANGELOG.md +265 -104
  3. package/dist/index.d.ts +157 -0
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/Badge.js.map +1 -1
  6. package/lib/CounterBadge.js.map +1 -1
  7. package/lib/PresenceBadge.js.map +1 -1
  8. package/lib/components/Badge/Badge.js +8 -8
  9. package/lib/components/Badge/Badge.js.map +1 -1
  10. package/lib/components/Badge/Badge.types.js.map +1 -1
  11. package/lib/components/Badge/index.js +0 -1
  12. package/lib/components/Badge/index.js.map +1 -1
  13. package/lib/components/Badge/renderBadge.js +9 -7
  14. package/lib/components/Badge/renderBadge.js.map +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.js +213 -203
  18. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  19. package/lib/components/CounterBadge/CounterBadge.js +8 -8
  20. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  21. package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
  22. package/lib/components/CounterBadge/index.js.map +1 -1
  23. package/lib/components/CounterBadge/useCounterBadge.js +18 -25
  24. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  25. package/lib/components/CounterBadge/useCounterBadgeStyles.js +18 -40
  26. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  27. package/lib/components/PresenceBadge/PresenceBadge.js +8 -8
  28. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  29. package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  30. package/lib/components/PresenceBadge/index.js.map +1 -1
  31. package/lib/components/PresenceBadge/presenceIcons.js +128 -0
  32. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -0
  33. package/lib/components/PresenceBadge/usePresenceBadge.js +52 -26
  34. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  35. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +60 -46
  36. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  37. package/lib/index.js +3 -5
  38. package/lib/index.js.map +1 -1
  39. package/lib-commonjs/Badge.js +1 -1
  40. package/lib-commonjs/Badge.js.map +1 -1
  41. package/lib-commonjs/CounterBadge.js +1 -1
  42. package/lib-commonjs/CounterBadge.js.map +1 -1
  43. package/lib-commonjs/PresenceBadge.js +1 -1
  44. package/lib-commonjs/PresenceBadge.js.map +1 -1
  45. package/lib-commonjs/components/Badge/Badge.js +9 -9
  46. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  47. package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
  48. package/lib-commonjs/components/Badge/index.js +1 -3
  49. package/lib-commonjs/components/Badge/index.js.map +1 -1
  50. package/lib-commonjs/components/Badge/renderBadge.js +13 -12
  51. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  52. package/lib-commonjs/components/Badge/useBadge.js +22 -26
  53. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  54. package/lib-commonjs/components/Badge/useBadgeStyles.js +217 -205
  55. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  56. package/lib-commonjs/components/CounterBadge/CounterBadge.js +9 -9
  57. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  58. package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
  59. package/lib-commonjs/components/CounterBadge/index.js +1 -1
  60. package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
  61. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +20 -28
  62. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  63. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +21 -42
  64. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  65. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +9 -9
  66. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  67. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  68. package/lib-commonjs/components/PresenceBadge/index.js +1 -1
  69. package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
  70. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +136 -0
  71. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -0
  72. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +54 -29
  73. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  74. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +63 -48
  75. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  76. package/lib-commonjs/index.js +82 -6
  77. package/lib-commonjs/index.js.map +1 -1
  78. package/package.json +23 -27
  79. package/dist/react-badge.d.ts +0 -154
  80. package/lib/Badge.d.ts +0 -1
  81. package/lib/CounterBadge.d.ts +0 -1
  82. package/lib/PresenceBadge.d.ts +0 -1
  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/Badge/Badge.d.ts +0 -6
  87. package/lib/components/Badge/Badge.types.d.ts +0 -35
  88. package/lib/components/Badge/index.d.ts +0 -5
  89. package/lib/components/Badge/renderBadge.d.ts +0 -2
  90. package/lib/components/Badge/useBadge.d.ts +0 -6
  91. package/lib/components/Badge/useBadgeStyles.d.ts +0 -5
  92. package/lib/components/CounterBadge/CounterBadge.d.ts +0 -6
  93. package/lib/components/CounterBadge/CounterBadge.types.d.ts +0 -41
  94. package/lib/components/CounterBadge/index.d.ts +0 -4
  95. package/lib/components/CounterBadge/useCounterBadge.d.ts +0 -6
  96. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -5
  97. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  98. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -111
  99. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
  100. package/lib/components/PresenceBadge/PresenceBadge.d.ts +0 -6
  101. package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +0 -17
  102. package/lib/components/PresenceBadge/index.d.ts +0 -4
  103. package/lib/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
  104. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -5
  105. package/lib/index.d.ts +0 -5
  106. package/lib-commonjs/Badge.d.ts +0 -1
  107. package/lib-commonjs/CounterBadge.d.ts +0 -1
  108. package/lib-commonjs/PresenceBadge.d.ts +0 -1
  109. package/lib-commonjs/common/isConformant.d.ts +0 -4
  110. package/lib-commonjs/common/isConformant.js +0 -24
  111. package/lib-commonjs/common/isConformant.js.map +0 -1
  112. package/lib-commonjs/components/Badge/Badge.d.ts +0 -6
  113. package/lib-commonjs/components/Badge/Badge.types.d.ts +0 -35
  114. package/lib-commonjs/components/Badge/index.d.ts +0 -5
  115. package/lib-commonjs/components/Badge/renderBadge.d.ts +0 -2
  116. package/lib-commonjs/components/Badge/useBadge.d.ts +0 -6
  117. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +0 -5
  118. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +0 -6
  119. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +0 -41
  120. package/lib-commonjs/components/CounterBadge/index.d.ts +0 -4
  121. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +0 -6
  122. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -5
  123. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  124. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -127
  125. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
  126. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +0 -6
  127. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +0 -17
  128. package/lib-commonjs/components/PresenceBadge/index.d.ts +0 -4
  129. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
  130. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -5
  131. package/lib-commonjs/index.d.ts +0 -5
@@ -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":["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 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -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
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/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","sourceRoot":""}
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,45 +3,37 @@
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
+ count,
28
+ dot
29
+ };
38
30
 
39
31
  if (!state.dot && !state.root.children) {
40
- state.root.children = state.count > state.overflowCount ? state.overflowCount + "+" : "" + state.count;
32
+ state.root.children = state.count > overflowCount ? `${overflowCount}+` : `${state.count}`;
41
33
  }
42
34
 
43
35
  return state;
44
36
  };
45
37
 
46
- exports.useCounterBadge = useCounterBadge;
38
+ exports.useCounterBadge_unstable = useCounterBadge_unstable;
47
39
  //# 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,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;;AASA,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,aAAd,GAA8B,GAAG,aAAa,GAA9C,GAAoD,GAAG,KAAK,CAAC,KAAK,EAAxF;AACD;;AAED,SAAO,KAAP;AACD,CAxBM;;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 count,\n dot,\n };\n\n if (!state.dot && !state.root.children) {\n state.root.children = state.count > overflowCount ? `${overflowCount}+` : `${state.count}`;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -3,46 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useCounterBadgeStyles = void 0;
6
+ exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassNames = 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.counterBadgeClassNames = {
13
+ root: 'fui-CounterBadge',
14
+ icon: 'fui-CounterBadge__icon'
15
+ };
16
+
17
+ const useStyles = /*#__PURE__*/react_1.__styles({
45
18
  "dot": {
19
+ "Bf4jedk": "fgfkb25",
46
20
  "a9b677": "f16dn6v3",
47
21
  "Bqenvij": "f3mu39s",
48
22
  "z8tnut": "f1g0x7ka",
@@ -54,18 +28,23 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
54
28
  "mc9l5x": "fjseox"
55
29
  }
56
30
  }, {
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;}"]
31
+ "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
32
  });
59
33
  /**
60
34
  * Applies style classnames to slots
61
35
  */
62
36
 
63
37
 
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);
38
+ const useCounterBadgeStyles_unstable = state => {
39
+ const styles = useStyles();
40
+ state.root.className = react_1.mergeClasses(exports.counterBadgeClassNames.root, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
41
+
42
+ if (state.icon) {
43
+ state.icon.className = react_1.mergeClasses(exports.counterBadgeClassNames.icon, state.icon.className);
44
+ }
45
+
46
+ return useBadgeStyles_1.useBadgeStyles_unstable(state);
68
47
  };
69
48
 
70
- exports.useCounterBadgeStyles = useCounterBadgeStyles;
49
+ exports.useCounterBadgeStyles_unstable = useCounterBadgeStyles_unstable;
71
50
  //# 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAgCA;;AAEG;;;AACI,IAAM,qBAAqB,GAAG,UAAC,KAAD,EAAyB;AAC5D,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CACrB,MAAM,CAAC,IADc,EAErB,KAAK,CAAC,KAAN,KAAgB,SAAhB,IAA6B,MAAM,CAAC,OAFf,EAGrB,KAAK,CAAC,KAAN,KAAgB,WAAhB,IAA+B,MAAM,CAAC,SAHjB,EAIrB,KAAK,CAAC,KAAN,KAAgB,QAAhB,IAA4B,MAAM,CAAC,MAJd,EAKrB,KAAK,CAAC,KAAN,KAAgB,aAAhB,IAAiC,MAAM,CAAC,WALnB,EAMrB,KAAK,CAAC,GAAN,IAAa,MAAM,CAAC,GANC,EAOrB,CAAC,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,CAAuB,IAApC,EAA0C,KAAK,CAAC,IAAN,CAAW,SAArD,CAAvB;AACD;;AAED,SAAO,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAP;AACD,CAdM;;AAAM,OAAA,CAAA,8BAAA,GAA8B,8BAA9B","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useBadgeStyles_unstable } from '../Badge/useBadgeStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { BadgeSlots } from '../Badge/Badge.types';\nimport type { CounterBadgeState } from './CounterBadge.types';\n\nexport const counterBadgeClassNames: SlotClassNames<BadgeSlots> = {\n root: 'fui-CounterBadge',\n icon: 'fui-CounterBadge__icon',\n};\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 counterBadgeClassNames.root,\n state.dot && styles.dot,\n !state.showZero && state.count === 0 && !state.dot && styles.hide,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(counterBadgeClassNames.icon, state.icon.className);\n }\n\n return useBadgeStyles_unstable(state) as CounterBadgeState;\n};\n"],"sourceRoot":"../src/"}
@@ -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":["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 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -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
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/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","sourceRoot":""}
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,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/PresenceBad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,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","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,53 +3,78 @@
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 'do-not-disturb':
28
+ return outOfOffice ? presenceIcons_1.presenceDndRegular[size] : presenceIcons_1.presenceDndFilled[size];
29
+
30
+ case 'offline':
31
+ return presenceIcons_1.presenceOfflineRegular[size];
32
+
33
+ case 'out-of-office':
34
+ return presenceIcons_1.presenceOofRegular[size];
35
+
36
+ case 'unknown':
37
+ return presenceIcons_1.presenceUnknownRegular[size];
38
+ }
39
+ };
40
+
41
+ const DEFAULT_STRINGS = {
42
+ busy: 'busy',
43
+ 'out-of-office': 'out of office',
44
+ away: 'away',
45
+ available: 'available',
46
+ offline: 'offline',
47
+ 'do-not-disturb': 'do not disturb',
48
+ unknown: 'unknown'
27
49
  };
28
50
  /**
29
51
  * Returns the props and state required to render the component
30
52
  */
31
53
 
54
+ const usePresenceBadge_unstable = (props, ref) => {
55
+ var _a, _b;
32
56
 
33
- var usePresenceBadge = function (props, ref) {
34
- var _a, _b, _c;
35
-
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)), {
57
+ const state = { ...index_1.useBadge_unstable({
58
+ size: 'medium',
59
+ ...props,
60
+ icon: react_utilities_1.resolveShorthand(props.icon, {
61
+ required: true,
62
+ defaultProps: {
63
+ 'aria-label': props.status && DEFAULT_STRINGS[props.status]
64
+ }
65
+ })
66
+ }, ref),
43
67
  status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
44
68
  outOfOffice: (_b = props.outOfOffice) !== null && _b !== void 0 ? _b : false
45
- });
69
+ };
70
+ const IconElement = iconMap(state.status, state.outOfOffice, state.size);
46
71
 
47
- if (!((_c = state.icon) === null || _c === void 0 ? void 0 : _c.children)) {
48
- state.icon.children = iconMap(state.outOfOffice)[state.status];
72
+ if (IconElement) {
73
+ state.icon.children = React.createElement(IconElement, null);
49
74
  }
50
75
 
51
76
  return state;
52
77
  };
53
78
 
54
- exports.usePresenceBadge = usePresenceBadge;
79
+ exports.usePresenceBadge_unstable = usePresenceBadge_unstable;
55
80
  //# 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,2BAAA,CAAA,cAAD,EAAe,IAAf,CAAH,GAAwB,KAAA,C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,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CA5BM;;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 } 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 'do-not-disturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'out-of-office':\n return presenceOofRegular[size];\n case 'unknown':\n return presenceUnknownRegular[size];\n }\n};\n\nconst DEFAULT_STRINGS = {\n busy: 'busy',\n 'out-of-office': 'out of office',\n away: 'away',\n available: 'available',\n offline: 'offline',\n 'do-not-disturb': 'do not disturb',\n unknown: 'unknown',\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(props.icon, {\n required: true,\n defaultProps: {\n 'aria-label': props.status && DEFAULT_STRINGS[props.status],\n },\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/"}