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

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 +672 -18
  2. package/CHANGELOG.md +274 -103
  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 +18 -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 +21 -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
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,eAAT,QAAgC,mBAAhC;AACA,SAAS,qBAAT,QAAsC,yBAAtC;AACA,SAAS,WAAT,QAA4B,gBAA5B;AAIA;;AAEG;;AACH,OAAO,IAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC9F,MAAM,KAAK,GAAG,eAAe,CAAC,KAAD,EAAQ,GAAR,CAA7B;AACA,EAAA,qBAAqB,CAAC,KAAD,CAArB;AAEA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALmE,CAA7D;AAOP,YAAY,CAAC,WAAb,GAA2B,cAA3B","sourceRoot":""}
1
+ {"version":3,"sources":["components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,wBAAT,QAAyC,mBAAzC;AACA,SAAS,8BAAT,QAA+C,yBAA/C;AACA,SAAS,oBAAT,QAAqC,gBAArC;AAIA;;AAEG;;AACH,OAAO,MAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClG,QAAM,KAAK,GAAG,wBAAwB,CAAC,KAAD,EAAQ,GAAR,CAAtC;AACA,EAAA,8BAA8B,CAAC,KAAD,CAA9B;AAEA,SAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALmE,CAA7D;AAOP,YAAY,CAAC,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,"file":"CounterBadge.types.js","sourceRoot":"","sources":["../../../src/components/CounterBadge/CounterBadge.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"CounterBadge.types.js","sourceRoot":"../src/","sources":["components/CounterBadge/CounterBadge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeProps, BadgeState } from '../Badge/index';\n\nexport type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'color' | 'shape'> & {\n /**\n * A Badge can have different appearances that emphasize certain parts of it:\n * - filled: The default appearance if one is not specified.\n * The badge background is filled with color with a contrasting foreground text to match.\n * - ghost: The badge background is transparent, with the foreground text taking color to emphasize it.\n * @default filled\n */\n appearance?: 'filled' | 'ghost';\n\n /**\n * Semantic colors for a counter badge\n * @default brand\n */\n color?: Extract<BadgeProps['color'], 'brand' | 'danger' | 'important' | 'informative'>;\n\n /**\n * Value displayed by the Badge\n * @default 0\n */\n count?: number;\n\n /**\n * If a dot should be displayed without the count\n * @default false\n */\n dot?: boolean;\n\n /**\n * Max number to be displayed\n * @default 99\n */\n overflowCount?: number;\n\n /**\n * A Badge can be circular or rounded\n * @default circular\n */\n shape?: 'circular' | 'rounded';\n\n /**\n * If the badge should be shown when count is 0\n * @default false\n */\n showZero?: boolean;\n};\n\nexport type CounterBadgeState = Omit<BadgeState, 'appearance' | 'color' | 'shape'> &\n Required<Pick<CounterBadgeProps, 'appearance' | 'color' | 'count' | 'dot' | 'shape' | 'showZero'>>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/CounterBadge/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/CounterBadge/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC","sourcesContent":["export * from './CounterBadge';\nexport * from './CounterBadge.types';\nexport * from './useCounterBadge';\nexport * from './useCounterBadgeStyles';\n"]}
@@ -1,34 +1,27 @@
1
- import { __assign } from "tslib";
2
- import { useBadge } from '../Badge/index';
1
+ import { useBadge_unstable } from '../Badge/index';
3
2
  /**
4
3
  * Returns the props and state required to render the component
5
4
  */
6
5
 
7
- export var useCounterBadge = function (props, ref) {
8
- var _a = props.shape,
9
- shape = _a === void 0 ? 'circular' : _a,
10
- _b = props.appearance,
11
- appearance = _b === void 0 ? 'filled' : _b,
12
- _c = props.showZero,
13
- showZero = _c === void 0 ? false : _c,
14
- _d = props.overflowCount,
15
- overflowCount = _d === void 0 ? 99 : _d,
16
- _e = props.count,
17
- count = _e === void 0 ? 0 : _e,
18
- _f = props.dot,
19
- dot = _f === void 0 ? false : _f;
20
-
21
- var state = __assign(__assign({}, useBadge(props, ref)), {
22
- shape: shape,
23
- appearance: appearance,
24
- showZero: showZero,
25
- overflowCount: overflowCount,
26
- count: count,
27
- dot: dot
28
- });
6
+ export const useCounterBadge_unstable = (props, ref) => {
7
+ const {
8
+ shape = 'circular',
9
+ appearance = 'filled',
10
+ showZero = false,
11
+ overflowCount = 99,
12
+ count = 0,
13
+ dot = false
14
+ } = props;
15
+ const state = { ...useBadge_unstable(props, ref),
16
+ shape,
17
+ appearance,
18
+ showZero,
19
+ count,
20
+ dot
21
+ };
29
22
 
30
23
  if (!state.dot && !state.root.children) {
31
- state.root.children = state.count > state.overflowCount ? state.overflowCount + "+" : "" + state.count;
24
+ state.root.children = state.count > overflowCount ? `${overflowCount}+` : `${state.count}`;
32
25
  }
33
26
 
34
27
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":";AACA,SAAS,QAAT,QAAyB,gBAAzB;AAGA;;AAEG;;AACH,OAAO,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,K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,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","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/"}
@@ -1,40 +1,13 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
- import { useBadgeStyles } from '../Badge/useBadgeStyles';
1
+ import { shorthands, mergeClasses, __styles } from '@griffel/react';
2
+ import { useBadgeStyles_unstable } from '../Badge/useBadgeStyles';
3
+ export const counterBadgeClassNames = {
4
+ root: 'fui-CounterBadge',
5
+ icon: 'fui-CounterBadge__icon'
6
+ };
3
7
 
4
- var useStyles = /*#__PURE__*/__styles({
5
- "root": {
6
- "Bf4jedk": "fgfkb25"
7
- },
8
- "warning": {
9
- "De3pzq": "fic4z9l",
10
- "g2u3we": "f1g6aqbb",
11
- "h3c5rm": ["f1xc4egn", "f1y13pv"],
12
- "B9xav0g": "f12f05r9",
13
- "zhjwy3": ["f1y13pv", "f1xc4egn"]
14
- },
15
- "important": {
16
- "De3pzq": "f1y11cvn",
17
- "g2u3we": "f9ag23u",
18
- "h3c5rm": ["fzlvby", "fj2uge6"],
19
- "B9xav0g": "fk41dq4",
20
- "zhjwy3": ["fj2uge6", "fzlvby"]
21
- },
22
- "severe": {
23
- "De3pzq": "ftpr1dl",
24
- "g2u3we": "fx7g4rx",
25
- "h3c5rm": ["f1edxl4n", "f5hlgd2"],
26
- "B9xav0g": "f5ppncr",
27
- "zhjwy3": ["f5hlgd2", "f1edxl4n"]
28
- },
29
- "informative": {
30
- "De3pzq": "f6zwqgc",
31
- "g2u3we": "f1pdtvjr",
32
- "h3c5rm": ["f1ctwv29", "f1m7luuw"],
33
- "B9xav0g": "f1ijpqjr",
34
- "zhjwy3": ["f1m7luuw", "f1ctwv29"],
35
- "sj55zd": "f11d4kpn"
36
- },
8
+ const useStyles = /*#__PURE__*/__styles({
37
9
  "dot": {
10
+ "Bf4jedk": "fgfkb25",
38
11
  "a9b677": "f16dn6v3",
39
12
  "Bqenvij": "f3mu39s",
40
13
  "z8tnut": "f1g0x7ka",
@@ -46,16 +19,21 @@ var useStyles = /*#__PURE__*/__styles({
46
19
  "mc9l5x": "fjseox"
47
20
  }
48
21
  }, {
49
- "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;}"]
22
+ "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;}"]
50
23
  });
51
24
  /**
52
25
  * Applies style classnames to slots
53
26
  */
54
27
 
55
28
 
56
- export var useCounterBadgeStyles = function (state) {
57
- var styles = useStyles();
58
- state.root.className = 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);
59
- return useBadgeStyles(state);
29
+ export const useCounterBadgeStyles_unstable = state => {
30
+ const styles = useStyles();
31
+ state.root.className = mergeClasses(counterBadgeClassNames.root, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
32
+
33
+ if (state.icon) {
34
+ state.icon.className = mergeClasses(counterBadgeClassNames.icon, state.icon.className);
35
+ }
36
+
37
+ return useBadgeStyles_unstable(state);
60
38
  };
61
39
  //# sourceMappingURL=useCounterBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AACA,SAAS,cAAT,QAA+B,yBAA/B;;AAGA,IAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACH,OAAO,MAAM,8BAA8B,GAAI,KAAD,IAAgD;AAC5F,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,sBAAsB,CAAC,IADU,EAEjC,KAAK,CAAC,GAAN,IAAa,MAAM,CAAC,GAFa,EAGjC,CAAC,KAAK,CAAC,QAAP,IAAmB,KAAK,CAAC,KAAN,KAAgB,CAAnC,IAAwC,CAAC,KAAK,CAAC,GAA/C,IAAsD,MAAM,CAAC,IAH5B,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;;AAOA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,sBAAsB,CAAC,IAAxB,EAA8B,KAAK,CAAC,IAAN,CAAW,SAAzC,CAAnC;AACD;;AAED,SAAO,uBAAuB,CAAC,KAAD,CAA9B;AACD,CAdM","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/"}
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { usePresenceBadge } from './usePresenceBadge';
3
- import { usePresenceBadgeStyles } from './usePresenceBadgeStyles';
4
- import { renderBadge } from '../../Badge';
2
+ import { usePresenceBadge_unstable } from './usePresenceBadge';
3
+ import { usePresenceBadgeStyles_unstable } from './usePresenceBadgeStyles';
4
+ import { renderBadge_unstable } from '../../Badge';
5
5
  /**
6
- * Define a styled Badge, using the `useBadge` hook.
6
+ * Define a styled Badge, using the `useBadge_unstable` hook.
7
7
  */
8
8
 
9
- export var PresenceBadge = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
- var state = usePresenceBadge(props, ref);
11
- usePresenceBadgeStyles(state);
12
- return renderBadge(state);
9
+ export const PresenceBadge = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = usePresenceBadge_unstable(props, ref);
11
+ usePresenceBadgeStyles_unstable(state);
12
+ return renderBadge_unstable(state);
13
13
  });
14
14
  PresenceBadge.displayName = 'PresenceBadge';
15
15
  //# sourceMappingURL=PresenceBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PresenceBadge/PresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AACA,SAAS,sBAAT,QAAuC,0BAAvC;AACA,SAAS,WAAT,QAA4B,aAA5B;AAIA;;AAEG;;AACH,OAAO,IAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChG,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAD,EAAQ,GAAR,CAA9B;AACA,EAAA,sBAAsB,CAAC,KAAD,CAAtB;AAEA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourceRoot":""}
1
+ {"version":3,"sources":["components/PresenceBadge/PresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,+BAAT,QAAgD,0BAAhD;AACA,SAAS,oBAAT,QAAqC,aAArC;AAIA;;AAEG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpG,QAAM,KAAK,GAAG,yBAAyB,CAAC,KAAD,EAAQ,GAAR,CAAvC;AACA,EAAA,+BAA+B,CAAC,KAAD,CAA/B;AAEA,SAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALqE,CAA/D;AAOP,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,"file":"PresenceBadge.types.js","sourceRoot":"","sources":["../../../src/components/PresenceBadge/PresenceBadge.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"PresenceBadge.types.js","sourceRoot":"../src/","sources":["components/PresenceBadge/PresenceBadge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { BadgeProps, BadgeState, BadgeSlots } from '../Badge/Badge.types';\n\nexport type PresenceBadgeStatus =\n | 'busy'\n | 'out-of-office'\n | 'away'\n | 'available'\n | 'offline'\n | 'do-not-disturb'\n | 'unknown';\n\nexport type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root' | 'icon'>>, 'color'> &\n Pick<BadgeProps, 'size'> & {\n /**\n * Represents several status\n * @default available\n */\n status?: PresenceBadgeStatus;\n\n /**\n * Modifies the display to indicate that the user is out of office.\n * This can be combined with any status to display an out-of-office version of that status\n * @default false\n */\n outOfOffice?: boolean;\n };\n\nexport type PresenceBadgeState = ComponentState<BadgeSlots> &\n BadgeState &\n Required<Pick<PresenceBadgeProps, 'status' | 'outOfOffice'>>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PresenceBadge/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/PresenceBadge/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './PresenceBadge';\nexport * from './PresenceBadge.types';\nexport * from './usePresenceBadge';\nexport * from './usePresenceBadgeStyles';\n"]}
@@ -0,0 +1,128 @@
1
+ import { PresenceAvailable10Regular, PresenceAvailable12Regular, PresenceAvailable16Regular, PresenceAvailable10Filled, PresenceAvailable12Filled, PresenceAvailable16Filled, PresenceAway10Filled, PresenceAway12Filled, PresenceAway16Filled, PresenceBusy10Filled, PresenceBusy12Filled, PresenceBusy16Filled, PresenceDnd10Regular, PresenceDnd12Regular, PresenceDnd16Regular, PresenceDnd10Filled, PresenceDnd12Filled, PresenceDnd16Filled, PresenceOof10Regular, PresenceOof12Regular, PresenceOof16Regular, PresenceOffline10Regular, PresenceOffline12Regular, PresenceOffline16Regular, PresenceUnknown10Regular, PresenceUnknown12Regular, PresenceUnknown16Regular } from '@fluentui/react-icons';
2
+ export const presenceAwayFilled = {
3
+ // FIXME not all presence icon sizes are available
4
+ // https://github.com/microsoft/fluentui/issues/20650
5
+ tiny: PresenceAway10Filled,
6
+ 'extra-small': PresenceAway10Filled,
7
+ small: PresenceAway12Filled,
8
+ medium: PresenceAway16Filled,
9
+ // FIXME not all presence icon sizes are available
10
+ // https://github.com/microsoft/fluentui/issues/20650
11
+ large: PresenceAway16Filled,
12
+ // FIXME not all presence icon sizes are available
13
+ // https://github.com/microsoft/fluentui/issues/20650
14
+ 'extra-large': PresenceAway16Filled
15
+ };
16
+ export const presenceAvailableRegular = {
17
+ // FIXME not all presence icon sizes are available
18
+ // https://github.com/microsoft/fluentui/issues/20650
19
+ tiny: PresenceAvailable10Regular,
20
+ 'extra-small': PresenceAvailable10Regular,
21
+ small: PresenceAvailable12Regular,
22
+ medium: PresenceAvailable16Regular,
23
+ // FIXME not all presence icon sizes are available
24
+ // https://github.com/microsoft/fluentui/issues/20650
25
+ large: PresenceAvailable16Regular,
26
+ // FIXME not all presence icon sizes are available
27
+ // https://github.com/microsoft/fluentui/issues/20650
28
+ 'extra-large': PresenceAvailable16Regular
29
+ };
30
+ export const presenceAvailableFilled = {
31
+ // FIXME not all presence icon sizes are available
32
+ // https://github.com/microsoft/fluentui/issues/20650
33
+ tiny: PresenceAvailable10Filled,
34
+ 'extra-small': PresenceAvailable10Filled,
35
+ small: PresenceAvailable12Filled,
36
+ medium: PresenceAvailable16Filled,
37
+ // FIXME not all presence icon sizes are available
38
+ // https://github.com/microsoft/fluentui/issues/20650
39
+ large: PresenceAvailable16Filled,
40
+ // FIXME not all presence icon sizes are available
41
+ // https://github.com/microsoft/fluentui/issues/20650
42
+ 'extra-large': PresenceAvailable16Filled
43
+ };
44
+ export const presenceBusyFilled = {
45
+ // FIXME not all presence icon sizes are available
46
+ // https://github.com/microsoft/fluentui/issues/20650
47
+ tiny: PresenceBusy10Filled,
48
+ 'extra-small': PresenceBusy10Filled,
49
+ small: PresenceBusy12Filled,
50
+ medium: PresenceBusy16Filled,
51
+ // FIXME not all presence icon sizes are available
52
+ // https://github.com/microsoft/fluentui/issues/20650
53
+ large: PresenceBusy16Filled,
54
+ // FIXME not all presence icon sizes are available
55
+ // https://github.com/microsoft/fluentui/issues/20650
56
+ 'extra-large': PresenceBusy16Filled
57
+ };
58
+ export const presenceDndFilled = {
59
+ // FIXME not all presence icon sizes are available
60
+ // https://github.com/microsoft/fluentui/issues/20650
61
+ tiny: PresenceDnd10Filled,
62
+ 'extra-small': PresenceDnd10Filled,
63
+ small: PresenceDnd12Filled,
64
+ medium: PresenceDnd16Filled,
65
+ // FIXME not all presence icon sizes are available
66
+ // https://github.com/microsoft/fluentui/issues/20650
67
+ large: PresenceDnd16Filled,
68
+ // FIXME not all presence icon sizes are available
69
+ // https://github.com/microsoft/fluentui/issues/20650
70
+ 'extra-large': PresenceDnd16Filled
71
+ };
72
+ export const presenceDndRegular = {
73
+ // FIXME not all presence icon sizes are available
74
+ // https://github.com/microsoft/fluentui/issues/20650
75
+ tiny: PresenceDnd10Regular,
76
+ 'extra-small': PresenceDnd10Regular,
77
+ small: PresenceDnd12Regular,
78
+ medium: PresenceDnd16Regular,
79
+ // FIXME not all presence icon sizes are available
80
+ // https://github.com/microsoft/fluentui/issues/20650
81
+ large: PresenceDnd16Regular,
82
+ // FIXME not all presence icon sizes are available
83
+ // https://github.com/microsoft/fluentui/issues/20650
84
+ 'extra-large': PresenceDnd16Regular
85
+ };
86
+ export const presenceOofRegular = {
87
+ // FIXME not all presence icon sizes are available
88
+ // https://github.com/microsoft/fluentui/issues/20650
89
+ tiny: PresenceOof10Regular,
90
+ 'extra-small': PresenceOof10Regular,
91
+ small: PresenceOof12Regular,
92
+ medium: PresenceOof16Regular,
93
+ // FIXME not all presence icon sizes are available
94
+ // https://github.com/microsoft/fluentui/issues/20650
95
+ large: PresenceOof16Regular,
96
+ // FIXME not all presence icon sizes are available
97
+ // https://github.com/microsoft/fluentui/issues/20650
98
+ 'extra-large': PresenceOof16Regular
99
+ };
100
+ export const presenceOfflineRegular = {
101
+ // FIXME not all presence icon sizes are available
102
+ // https://github.com/microsoft/fluentui/issues/20650
103
+ tiny: PresenceOffline10Regular,
104
+ 'extra-small': PresenceOffline10Regular,
105
+ small: PresenceOffline12Regular,
106
+ medium: PresenceOffline16Regular,
107
+ // FIXME not all presence icon sizes are available
108
+ // https://github.com/microsoft/fluentui/issues/20650
109
+ large: PresenceOffline16Regular,
110
+ // FIXME not all presence icon sizes are available
111
+ // https://github.com/microsoft/fluentui/issues/20650
112
+ 'extra-large': PresenceOffline16Regular
113
+ };
114
+ export const presenceUnknownRegular = {
115
+ // FIXME not all presence icon sizes are available
116
+ // https://github.com/microsoft/fluentui/issues/20650
117
+ tiny: PresenceUnknown10Regular,
118
+ 'extra-small': PresenceUnknown10Regular,
119
+ small: PresenceUnknown12Regular,
120
+ medium: PresenceUnknown16Regular,
121
+ // FIXME not all presence icon sizes are available
122
+ // https://github.com/microsoft/fluentui/issues/20650
123
+ large: PresenceUnknown16Regular,
124
+ // FIXME not all presence icon sizes are available
125
+ // https://github.com/microsoft/fluentui/issues/20650
126
+ 'extra-large': PresenceUnknown16Regular
127
+ };
128
+ //# sourceMappingURL=presenceIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":"AACA,SACE,0BADF,EAEE,0BAFF,EAGE,0BAHF,EAIE,yBAJF,EAKE,yBALF,EAME,yBANF,EAOE,oBAPF,EAQE,oBARF,EASE,oBATF,EAUE,oBAVF,EAWE,oBAXF,EAYE,oBAZF,E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Content":["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/"}
@@ -1,40 +1,66 @@
1
- import { __assign } from "tslib";
2
1
  import * as React from 'react';
3
2
  import { resolveShorthand } from '@fluentui/react-utilities';
4
- import { useBadge } from '../Badge/index';
5
- import { SkypeMinusIcon, SkypeClockIcon, SkypeArrowIcon, SkypeCheckIcon, CancelIcon } from './DefaultPresenceBadgeIcons';
6
-
7
- var iconMap = function (outOfOffice) {
8
- return {
9
- busy: null,
10
- available: outOfOffice ? /*#__PURE__*/React.createElement(SkypeArrowIcon, null) : /*#__PURE__*/React.createElement(SkypeCheckIcon, null),
11
- away: outOfOffice ? /*#__PURE__*/React.createElement(SkypeArrowIcon, null) : /*#__PURE__*/React.createElement(SkypeClockIcon, null),
12
- offline: /*#__PURE__*/React.createElement(CancelIcon, null),
13
- outOfOffice: /*#__PURE__*/React.createElement(SkypeArrowIcon, null),
14
- doNotDisturb: /*#__PURE__*/React.createElement(SkypeMinusIcon, null)
15
- };
3
+ import { presenceAvailableFilled, presenceAvailableRegular, presenceAwayFilled, presenceBusyFilled, presenceDndFilled, presenceDndRegular, presenceOfflineRegular, presenceOofRegular, presenceUnknownRegular } from './presenceIcons';
4
+ import { useBadge_unstable } from '../Badge/index';
5
+
6
+ const iconMap = (status, outOfOffice, size) => {
7
+ switch (status) {
8
+ case 'available':
9
+ return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];
10
+
11
+ case 'away':
12
+ return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];
13
+
14
+ case 'busy':
15
+ return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];
16
+
17
+ case 'do-not-disturb':
18
+ return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];
19
+
20
+ case 'offline':
21
+ return presenceOfflineRegular[size];
22
+
23
+ case 'out-of-office':
24
+ return presenceOofRegular[size];
25
+
26
+ case 'unknown':
27
+ return presenceUnknownRegular[size];
28
+ }
29
+ };
30
+
31
+ const DEFAULT_STRINGS = {
32
+ busy: 'busy',
33
+ 'out-of-office': 'out of office',
34
+ away: 'away',
35
+ available: 'available',
36
+ offline: 'offline',
37
+ 'do-not-disturb': 'do not disturb',
38
+ unknown: 'unknown'
16
39
  };
17
40
  /**
18
41
  * Returns the props and state required to render the component
19
42
  */
20
43
 
44
+ export const usePresenceBadge_unstable = (props, ref) => {
45
+ var _a, _b;
21
46
 
22
- export var usePresenceBadge = function (props, ref) {
23
- var _a, _b, _c;
24
-
25
- var state = __assign(__assign({}, useBadge(__assign(__assign({
26
- size: 'small'
27
- }, props), {
28
- icon: resolveShorthand(props.icon, {
29
- required: true
30
- })
31
- }), ref)), {
47
+ const state = { ...useBadge_unstable({
48
+ size: 'medium',
49
+ ...props,
50
+ icon: resolveShorthand(props.icon, {
51
+ required: true,
52
+ defaultProps: {
53
+ 'aria-label': props.status && DEFAULT_STRINGS[props.status]
54
+ }
55
+ })
56
+ }, ref),
32
57
  status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
33
58
  outOfOffice: (_b = props.outOfOffice) !== null && _b !== void 0 ? _b : false
34
- });
59
+ };
60
+ const IconElement = iconMap(state.status, state.outOfOffice, state.size);
35
61
 
36
- if (!((_c = state.icon) === null || _c === void 0 ? void 0 : _c.children)) {
37
- state.icon.children = iconMap(state.outOfOffice)[state.status];
62
+ if (IconElement) {
63
+ state.icon.children = /*#__PURE__*/React.createElement(IconElement, null);
38
64
  }
39
65
 
40
66
  return state;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SAAS,QAAT,QAAyB,gBAAzB;AACA,SACE,cADF,EAEE,cAFF,EAGE,cAHF,EAIE,cAJF,EAKE,UALF,QAMO,6BANP;;AASA,IAAM,OAAO,GAA8E,UAAA,WAAA,EAAW;AAAI,SAAC;AACzG,IAAA,IAAI,EAAE,IADmG;AAEzG,IAAA,SAAS,EAAE,WAAW,gBAAG,KAAA,CAAA,aAAA,CAAC,cAAD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IAAI,EAAE,MADgB;AAEtB,mBAAiB,eAFK;AAGtB,EAAA,IAAI,EAAE,MAHgB;AAItB,EAAA,SAAS,EAAE,WAJW;AAKtB,EAAA,OAAO,EAAE,SALa;AAMtB,oBAAkB,gBANI;AAOtB,EAAA,OAAO,EAAE;AAPa,CAAxB;AAUA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;AACtB,QAAM,KAAK,GAAuB,EAChC,GAAG,iBAAiB,CAClB;AACE,MAAA,IAAI,EAAE,QADR;AAEE,SAAG,KAFL;AAGE,MAAA,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;AACjC,QAAA,QAAQ,EAAE,IADuB;AAEjC,QAAA,YAAY,EAAE;AACZ,wBAAc,KAAK,CAAC,MAAN,IAAgB,eAAe,CAAC,KAAK,CAAC,MAAP;AADjC;AAFmB,OAAb;AAHxB,KADkB,EAWlB,GAXkB,CADY;AAchC,IAAA,MAAM,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAdQ;AAehC,IAAA,WAAW,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,WAAN,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,EAAjB,GAAqB;AAfF,GAAlC;AAkBA,QAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAP,EAAe,KAAK,CAAC,WAArB,EAAkC,KAAK,CAAC,IAAxC,CAA3B;;AACA,MAAI,WAAJ,EAAiB;AACf,IAAA,KAAK,CAAC,IAAN,CAAY,QAAZ,gBAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CA5BM","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/"}