@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,62 +1,52 @@
1
- import { mergeClasses, __styles } from '@fluentui/react-make-styles';
2
- import { useBadgeStyles } from '../../Badge';
1
+ import { mergeClasses, __styles, shorthands } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ export const presenceBadgeClassNames = {
4
+ root: 'fui-PresenceBadge',
5
+ icon: 'fui-PresenceBadge__icon'
6
+ };
7
+
8
+ const getIsBusy = status => {
9
+ if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {
10
+ return true;
11
+ }
12
+
13
+ return false;
14
+ };
3
15
 
4
- var useStyles = /*#__PURE__*/__styles({
16
+ const useStyles = /*#__PURE__*/__styles({
5
17
  "root": {
6
18
  "z8tnut": "f1g0x7ka",
7
19
  "z189sj": ["fhxju0i", "f1cnd47f"],
8
20
  "Byoj8tv": "f1qch9an",
9
21
  "uwmqm3": ["f1cnd47f", "fhxju0i"],
10
- "B4j52fo": "f18zi460",
11
- "Bekrc4i": ["f1wpluaz", "fsfsuhs"],
12
- "Bn0qgzm": "fmklw6v",
13
- "ibv6hh": ["fsfsuhs", "f1wpluaz"]
14
- },
15
- "thinBorder": {
16
- "B4j52fo": "f192inf7",
17
- "Bekrc4i": ["f5tn483", "f1ojsxk5"],
18
- "Bn0qgzm": "f1vxd6vx",
19
- "ibv6hh": ["f1ojsxk5", "f5tn483"]
22
+ "mc9l5x": "ftuwxu6",
23
+ "B7ck84d": "f1ewtqcl",
24
+ "Bt984gj": "f122n59",
25
+ "Brf1p80": "f4d9j23",
26
+ "Bhmb4qv": "fb8jth9",
27
+ "Bbmb7ep": ["fqgqgel", "fchfifz"],
28
+ "Beyfa6y": ["fchfifz", "fqgqgel"],
29
+ "B7oj6ja": ["fc7b1hi", "f1dpx5h9"],
30
+ "Btl43ni": ["f1dpx5h9", "fc7b1hi"],
31
+ "De3pzq": "fxugw4r"
20
32
  },
21
33
  "statusBusy": {
22
- "De3pzq": "fdl5y0r",
23
- "g2u3we": "f11ttmz8",
24
- "h3c5rm": ["f1ratw88", "f459ikj"],
25
- "B9xav0g": "fvovscg",
26
- "zhjwy3": ["f459ikj", "f1ratw88"]
34
+ "sj55zd": "fvi85wt"
27
35
  },
28
36
  "statusAway": {
29
- "De3pzq": "fb00bxr",
30
- "g2u3we": "f1skk3ns",
31
- "h3c5rm": ["f766wml", "f1rnrfqa"],
32
- "B9xav0g": "fb8zvtn",
33
- "zhjwy3": ["f1rnrfqa", "f766wml"]
37
+ "sj55zd": "f14k8a89"
34
38
  },
35
39
  "statusAvailable": {
36
- "De3pzq": "f1og3d8b",
37
- "g2u3we": "f1t9i9vy",
38
- "h3c5rm": ["f1r5awo9", "fnfhfy0"],
39
- "B9xav0g": "fgfkvtu",
40
- "zhjwy3": ["fnfhfy0", "f1r5awo9"]
40
+ "sj55zd": "fqa5hgp"
41
41
  },
42
42
  "statusOffline": {
43
- "De3pzq": "fxugw4r",
44
- "sj55zd": "f11d4kpn",
45
- "g2u3we": "fi2z7s6",
46
- "h3c5rm": ["f1agc6it", "f1sit5hz"],
47
- "B9xav0g": "f9pok3v",
48
- "zhjwy3": ["f1sit5hz", "f1agc6it"]
43
+ "sj55zd": "f11d4kpn"
49
44
  },
50
45
  "statusOutOfOffice": {
51
- "De3pzq": "fxugw4r",
52
- "sj55zd": "fdce8r3",
53
- "g2u3we": "f161shwc",
54
- "h3c5rm": ["fbde6ui", "f7rrh46"],
55
- "B9xav0g": "f1yt3bcc",
56
- "zhjwy3": ["f7rrh46", "fbde6ui"]
46
+ "sj55zd": "fdce8r3"
57
47
  },
58
48
  "outOfOffice": {
59
- "De3pzq": "fxugw4r"
49
+ "sj55zd": "fr0bkrk"
60
50
  },
61
51
  "outOfOfficeAvailable": {
62
52
  "sj55zd": "fqa5hgp"
@@ -66,18 +56,42 @@ var useStyles = /*#__PURE__*/__styles({
66
56
  },
67
57
  "outOfOfficeAway": {
68
58
  "sj55zd": "f14k8a89"
59
+ },
60
+ "tiny": {
61
+ "Bubjx69": "f9ikmtg",
62
+ "a9b677": "f16dn6v3",
63
+ "B5pe6w7": "fab5kbq",
64
+ "p4uzdd": "f1ms1d91"
65
+ },
66
+ "large": {
67
+ "Bubjx69": "f9ikmtg",
68
+ "a9b677": "f64fuq3",
69
+ "B5pe6w7": "f1vfi1yj",
70
+ "p4uzdd": "f15s34gz"
71
+ },
72
+ "extraLarge": {
73
+ "Bubjx69": "f9ikmtg",
74
+ "a9b677": "f1w9dchk",
75
+ "B5pe6w7": "f14efy9b",
76
+ "p4uzdd": "fhipgdu"
69
77
  }
70
78
  }, {
71
- "d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".f18zi460{border-top-width:var(--strokeWidthThick);}", ".f1wpluaz{border-right-width:var(--strokeWidthThick);}", ".fsfsuhs{border-left-width:var(--strokeWidthThick);}", ".fmklw6v{border-bottom-width:var(--strokeWidthThick);}", ".f192inf7{border-top-width:var(--strokeWidthThin);}", ".f5tn483{border-right-width:var(--strokeWidthThin);}", ".f1ojsxk5{border-left-width:var(--strokeWidthThin);}", ".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}", ".fdl5y0r{background-color:var(--colorPaletteRedBackground3);}", ".f11ttmz8{border-top-color:var(--colorPaletteRedBackground3);}", ".f1ratw88{border-right-color:var(--colorPaletteRedBackground3);}", ".f459ikj{border-left-color:var(--colorPaletteRedBackground3);}", ".fvovscg{border-bottom-color:var(--colorPaletteRedBackground3);}", ".fb00bxr{background-color:var(--colorPaletteMarigoldBackground3);}", ".f1skk3ns{border-top-color:var(--colorPaletteMarigoldBackground3);}", ".f766wml{border-right-color:var(--colorPaletteMarigoldBackground3);}", ".f1rnrfqa{border-left-color:var(--colorPaletteMarigoldBackground3);}", ".fb8zvtn{border-bottom-color:var(--colorPaletteMarigoldBackground3);}", ".f1og3d8b{background-color:var(--colorPaletteLightGreenForeground3);}", ".f1t9i9vy{border-top-color:var(--colorPaletteLightGreenForeground3);}", ".f1r5awo9{border-right-color:var(--colorPaletteLightGreenForeground3);}", ".fnfhfy0{border-left-color:var(--colorPaletteLightGreenForeground3);}", ".fgfkvtu{border-bottom-color:var(--colorPaletteLightGreenForeground3);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".fi2z7s6{border-top-color:var(--colorNeutralForeground3);}", ".f1agc6it{border-right-color:var(--colorNeutralForeground3);}", ".f1sit5hz{border-left-color:var(--colorNeutralForeground3);}", ".f9pok3v{border-bottom-color:var(--colorNeutralForeground3);}", ".fdce8r3{color:var(--colorPaletteBerryForeground3);}", ".f161shwc{border-top-color:var(--colorPaletteBerryForeground3);}", ".fbde6ui{border-right-color:var(--colorPaletteBerryForeground3);}", ".f7rrh46{border-left-color:var(--colorPaletteBerryForeground3);}", ".f1yt3bcc{border-bottom-color:var(--colorPaletteBerryForeground3);}", ".fqa5hgp{color:var(--colorPaletteLightGreenForeground3);}", ".fvi85wt{color:var(--colorPaletteRedBackground3);}", ".f14k8a89{color:var(--colorPaletteMarigoldBackground3);}"]
79
+ "d": [".f1g0x7ka{padding-top:0;}", ".fhxju0i{padding-right:0;}", ".f1cnd47f{padding-left:0;}", ".f1qch9an{padding-bottom:0;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f1ewtqcl{box-sizing:border-box;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".fb8jth9 span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fqgqgel{border-bottom-right-radius:50%;}", ".fchfifz{border-bottom-left-radius:50%;}", ".fc7b1hi{border-top-right-radius:50%;}", ".f1dpx5h9{border-top-left-radius:50%;}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fvi85wt{color:var(--colorPaletteRedBackground3);}", ".f14k8a89{color:var(--colorPaletteMarigoldBackground3);}", ".fqa5hgp{color:var(--colorPaletteLightGreenForeground3);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".fdce8r3{color:var(--colorPaletteBerryForeground3);}", ".fr0bkrk{color:var(--colorNeutralBackground1);}", ".f9ikmtg{aspect-ratio:1;}", ".f16dn6v3{width:6px;}", ".fab5kbq svg{width:6px!important;}", ".f1ms1d91 svg{height:6px!important;}", ".f64fuq3{width:20px;}", ".f1vfi1yj svg{width:20px!important;}", ".f15s34gz svg{height:20px!important;}", ".f1w9dchk{width:28px;}", ".f14efy9b svg{width:28px!important;}", ".fhipgdu svg{height:28px!important;}"]
72
80
  });
73
81
  /**
74
82
  * Applies style classnames to slots
75
83
  */
76
84
 
77
85
 
78
- export var usePresenceBadgeStyles = function (state) {
79
- var styles = useStyles();
80
- state.root.className = mergeClasses(styles.root, (state.status === 'busy' || state.status === 'doNotDisturb') && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'outOfOffice' && styles.statusOutOfOffice, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && (state.status === 'busy' || state.status === 'doNotDisturb') && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway, (state.size === 'tiny' || state.size === 'extra-small') && styles.thinBorder, state.root.className);
81
- return useBadgeStyles(state);
86
+ export const usePresenceBadgeStyles_unstable = state => {
87
+ const styles = useStyles();
88
+ const isBusy = getIsBusy(state.status);
89
+ state.root.className = mergeClasses(presenceBadgeClassNames.root, styles.root, isBusy && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
90
+
91
+ if (state.icon) {
92
+ state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);
93
+ }
94
+
95
+ return state;
82
96
  };
83
97
  //# sourceMappingURL=usePresenceBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AACA,SAAS,cAAT,QAA+B,aAA/B;;AAGA,IAAM,SAAS,gBAAG;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AA4CA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,CAAC,aANJ,EAOjC,KAAK,CAAC,MAAN,KAAiB,eAAjB,IAAoC,MAAM,CAAC,iBAPV,EAQjC,KAAK,CAAC,WAAN,IAAqB,MAAM,CAAC,WARK,EASjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,WAAtC,IAAqD,MAAM,CAAC,oBAT3B,EAUjC,KAAK,CAAC,WAAN,IAAqB,MAArB,IAA+B,MAAM,CAAC,eAVL,EAWjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,MAAtC,IAAgD,MAAM,CAAC,eAXtB,EAYjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,SAAtC,IAAmD,MAAM,CAAC,aAZzB,EAajC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,eAAtC,IAAyD,MAAM,CAAC,iBAb/B,EAcjC,KAAK,CAAC,IAAN,KAAe,MAAf,IAAyB,MAAM,CAAC,IAdC,EAejC,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,KAfA,EAgBjC,KAAK,CAAC,IAAN,KAAe,aAAf,IAAgC,MAAM,CAAC,UAhBN,EAiBjC,KAAK,CAAC,IAAN,CAAW,SAjBsB,CAAnC;;AAoBA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAuB,CAAC,IAAzB,EAA+B,KAAK,CAAC,IAAN,CAAW,SAA1C,CAAnC;AACD;;AAED,SAAO,KAAP;AACD,CA5BM","sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { BadgeSlots } from '../Badge/Badge.types';\nimport type { PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge.types';\n\nexport const presenceBadgeClassNames: SlotClassNames<BadgeSlots> = {\n root: 'fui-PresenceBadge',\n icon: 'fui-PresenceBadge__icon',\n};\n\nconst getIsBusy = (status: PresenceBadgeStatus): boolean => {\n if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {\n return true;\n }\n\n return false;\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.padding(0),\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n\n '& span': {\n display: 'flex',\n },\n ...shorthands.borderRadius('50%'),\n backgroundColor: tokens.colorNeutralBackground1,\n },\n statusBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n statusAway: {\n color: tokens.colorPaletteMarigoldBackground3,\n },\n statusAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n statusOffline: {\n color: tokens.colorNeutralForeground3,\n },\n statusOutOfOffice: {\n color: tokens.colorPaletteBerryForeground3,\n },\n outOfOffice: {\n color: tokens.colorNeutralBackground1,\n },\n outOfOfficeAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n outOfOfficeBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n outOfOfficeAway: {\n color: tokens.colorPaletteMarigoldBackground3,\n },\n\n // Icons are not resizeable, and these sizes are currently missing\n // use `!important` to size the currently available icons to the missing ones\n //\n tiny: {\n aspectRatio: '1',\n width: '6px',\n '& svg': {\n width: '6px !important',\n height: '6px !important',\n },\n },\n large: {\n aspectRatio: '1',\n width: '20px',\n '& svg': {\n width: '20px !important',\n height: '20px !important',\n },\n },\n extraLarge: {\n aspectRatio: '1',\n width: '28px',\n '& svg': {\n width: '28px !important',\n height: '28px !important',\n },\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const usePresenceBadgeStyles_unstable = (state: PresenceBadgeState): PresenceBadgeState => {\n const styles = useStyles();\n const isBusy = getIsBusy(state.status);\n state.root.className = mergeClasses(\n presenceBadgeClassNames.root,\n styles.root,\n isBusy && styles.statusBusy,\n state.status === 'away' && styles.statusAway,\n state.status === 'available' && styles.statusAvailable,\n state.status === 'offline' && styles.statusOffline,\n state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.outOfOffice && styles.outOfOffice,\n state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable,\n state.outOfOffice && isBusy && styles.outOfOfficeBusy,\n state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway,\n state.outOfOffice && state.status === 'offline' && styles.statusOffline,\n state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.size === 'tiny' && styles.tiny,\n state.size === 'large' && styles.large,\n state.size === 'extra-large' && styles.extraLarge,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
package/lib/index.js CHANGED
@@ -1,6 +1,4 @@
1
- export * from './components/Badge/index';
2
- export * from './Badge';
3
- export * from './PresenceBadge';
4
- export * from './components/CounterBadge/index';
5
- export * from './CounterBadge';
1
+ export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';
2
+ export { PresenceBadge, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, usePresenceBadge_unstable } from './PresenceBadge';
3
+ export { CounterBadge, counterBadgeClassNames, useCounterBadgeStyles_unstable, useCounterBadge_unstable } from './CounterBadge';
6
4
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,eAAhB,EAAiC,oBAAjC,EAAuD,uBAAvD,EAAgF,iBAAhF,QAAyG,SAAzG;AAEA,SACE,aADF,EAEE,uBAFF,EAGE,+BAHF,EAIE,yBAJF,QAKO,iBALP;AAOA,SACE,YADF,EAEE,sBAFF,EAGE,8BAHF,EAIE,wBAJF,QAKO,gBALP","sourcesContent":["export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';\nexport type { BadgeProps, BadgeSlots, BadgeState } from './Badge';\nexport {\n PresenceBadge,\n presenceBadgeClassNames,\n usePresenceBadgeStyles_unstable,\n usePresenceBadge_unstable,\n} from './PresenceBadge';\nexport type { PresenceBadgeProps, PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge';\nexport {\n CounterBadge,\n counterBadgeClassNames,\n useCounterBadgeStyles_unstable,\n useCounterBadge_unstable,\n} from './CounterBadge';\nexport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge';\n"],"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("./components/Badge/index"), exports);
10
10
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Badge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["Badge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Badge/index';\n"],"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("./components/CounterBadge/index"), exports);
10
10
  //# sourceMappingURL=CounterBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/CounterBadge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["CounterBadge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/CounterBadge/index';\n"],"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("./components/PresenceBadge/index"), exports);
10
10
  //# sourceMappingURL=PresenceBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/PresenceBadge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["PresenceBadge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/PresenceBadge/index';\n"],"sourceRoot":"../src/"}
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.Badge = void 0;
7
7
 
8
- var React = /*#__PURE__*/require("react");
8
+ const React = /*#__PURE__*/require("react");
9
9
 
10
- var useBadge_1 = /*#__PURE__*/require("./useBadge");
10
+ const useBadge_1 = /*#__PURE__*/require("./useBadge");
11
11
 
12
- var useBadgeStyles_1 = /*#__PURE__*/require("./useBadgeStyles");
12
+ const useBadgeStyles_1 = /*#__PURE__*/require("./useBadgeStyles");
13
13
 
14
- var renderBadge_1 = /*#__PURE__*/require("./renderBadge");
14
+ const renderBadge_1 = /*#__PURE__*/require("./renderBadge");
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.Badge = /*#__PURE__*/React.forwardRef(function (props, ref) {
21
- var state = useBadge_1.useBadge(props, ref);
22
- useBadgeStyles_1.useBadgeStyles(state);
23
- return renderBadge_1.renderBadge(state);
20
+ exports.Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
21
+ const state = useBadge_1.useBadge_unstable(props, ref);
22
+ useBadgeStyles_1.useBadgeStyles_unstable(state);
23
+ return renderBadge_1.renderBadge_unstable(state);
24
24
  });
25
25
  exports.Badge.displayName = 'Badge';
26
26
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChF,MAAM,KAAK,GAAG,UAAA,CAAA,QAAA,CAAS,KAAT,EAAgB,GAAhB,CAAd;AACA,EAAA,gBAAA,CAAA,cAAA,CAAe,KAAf;AAEA,SAAO,aAAA,CAAA,WAAA,CAAY,KAAZ,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourceRoot":""}
1
+ {"version":3,"sources":["components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,UAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AACA,EAAA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;AAEA,SAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles';\nimport { renderBadge_unstable } from './renderBadge';\nimport type { BadgeProps } from './Badge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const Badge: ForwardRefComponent<BadgeProps> = React.forwardRef((props, ref) => {\n const state = useBadge_unstable(props, ref);\n useBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -4,12 +4,10 @@ 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("./Badge"), exports);
10
10
 
11
- tslib_1.__exportStar(require("./Badge.types"), exports);
12
-
13
11
  tslib_1.__exportStar(require("./renderBadge"), exports);
14
12
 
15
13
  tslib_1.__exportStar(require("./useBadge"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["components/Badge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AAGA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Badge';\n// Explicit exports to omit BadgeCommons\nexport type { BadgeProps, BadgeSlots, BadgeState } from './Badge.types';\nexport * from './renderBadge';\nexport * from './useBadge';\nexport * from './useBadgeStyles';\n"],"sourceRoot":"../src/"}
@@ -3,21 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.renderBadge = void 0;
6
+ exports.renderBadge_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");
13
-
14
- var renderBadge = function (state) {
15
- var _a = react_utilities_1.getSlots(state, ['icon', 'root']),
16
- slots = _a.slots,
17
- slotProps = _a.slotProps;
18
-
19
- return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.iconPosition === 'before' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), state.root.children, state.iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)));
12
+ const renderBadge_unstable = state => {
13
+ const {
14
+ slots,
15
+ slotProps
16
+ } = react_utilities_1.getSlots(state);
17
+ return React.createElement(slots.root, { ...slotProps.root
18
+ }, state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
19
+ }), state.root.children, state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
20
+ }));
20
21
  };
21
22
 
22
- exports.renderBadge = renderBadge;
23
+ exports.renderBadge_unstable = renderBadge_unstable;
23
24
  //# sourceMappingURL=renderBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGO,IAAM,WAAW,GAAG,UAAC,KAAD,EAAkB;AACrC,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,EAA4B,CAAC,MAAD,EAAS,MAAT,CAA5B,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADtC,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAHrC,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourceRoot":""}
1
+ {"version":3,"sources":["components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;AACxD,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAK,CAAC,IAAzC,IAAiD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADpD,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAK,CAAC,IAAxC,IAAgD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAHnD,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { BadgeState, BadgeSlots } from './Badge.types';\n\nexport const renderBadge_unstable = (state: BadgeState) => {\n const { slots, slotProps } = getSlots<BadgeSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.iconPosition === 'before' && slots.icon && <slots.icon {...slotProps.icon} />}\n {state.root.children}\n {state.iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -3,45 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useBadge = void 0;
6
+ exports.useBadge_unstable = void 0;
7
7
 
8
- var tslib_1 = /*#__PURE__*/require("tslib");
9
-
10
- var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
8
+ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
9
  /**
12
10
  * Returns the props and state required to render the component
13
11
  */
14
12
 
15
13
 
16
- var useBadge = function (props, ref) {
17
- var _a = props.shape,
18
- shape = _a === void 0 ? 'circular' : _a,
19
- _b = props.size,
20
- size = _b === void 0 ? 'medium' : _b,
21
- _c = props.iconPosition,
22
- iconPosition = _c === void 0 ? 'before' : _c,
23
- _d = props.appearance,
24
- appearance = _d === void 0 ? 'filled' : _d,
25
- _e = props.color,
26
- color = _e === void 0 ? 'brand' : _e;
27
- var state = {
28
- shape: shape,
29
- size: size,
30
- iconPosition: iconPosition,
31
- appearance: appearance,
32
- color: color,
14
+ const useBadge_unstable = (props, ref) => {
15
+ const {
16
+ shape = 'circular',
17
+ size = 'medium',
18
+ iconPosition = 'before',
19
+ appearance = 'filled',
20
+ color = 'brand'
21
+ } = props;
22
+ const state = {
23
+ shape,
24
+ size,
25
+ iconPosition,
26
+ appearance,
27
+ color,
33
28
  components: {
34
29
  root: 'div',
35
30
  icon: 'span'
36
31
  },
37
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({
38
- ref: ref,
39
- 'aria-hidden': true
40
- }, props)),
32
+ root: react_utilities_1.getNativeElementProps('div', {
33
+ ref,
34
+ ...props
35
+ }),
41
36
  icon: react_utilities_1.resolveShorthand(props.icon)
42
37
  };
43
38
  return state;
44
39
  };
45
40
 
46
- exports.useBadge = useBadge;
41
+ exports.useBadge_unstable = useBadge_unstable;
47
42
  //# sourceMappingURL=useBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,QAAQ,GAAG,UAAC,KAAD,EAAoB,GAApB,EAA+C;AAEnE,MAAA,EAAA,GAKE,KAAK,CALW,KAAlB;AAAA,MAAA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,UAAH,GAAa,EAAlB;AAAA,MACA,EAAA,GAIE,KAAK,CAJQ,IADf;AAAA,MACA,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EADf;AAAA,MAEA,EAAA,GAGE,KAAK,CAHgB,YAFvB;AAAA,MAEA,YAAY,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAFvB;AAAA,MAGA,EAAA,GAEE,KAAK,CAFc,UAHrB;AAAA,MAGA,UAAU,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAHrB;AAAA,MAIA,EAAA,GACE,KAAK,CADQ,KAJf;AAAA,MAIA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,OAAH,GAAU,EAJf;AAOF,MAAM,KAAK,GAAe;AACxB,IAAA,KAAK,EAAA,KADmB;AAExB,IAAA,IAAI,EAAA,IAFoB;AAGxB,IAAA,YAAY,EAAA,YAHY;AAIxB,IAAA,UAAU,EAAA,UAJc;AAKxB,IAAA,KAAK,EAAA,KALmB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV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esContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { BadgeProps, BadgeState } from './Badge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useBadge_unstable = (props: BadgeProps, ref: React.Ref<HTMLElement>): BadgeState => {\n const {\n shape = 'circular',\n size = 'medium',\n iconPosition = 'before',\n appearance = 'filled',\n color = 'brand',\n } = props;\n\n const state: BadgeState = {\n shape,\n size,\n iconPosition,\n appearance,\n color,\n components: {\n root: 'div',\n icon: 'span',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n icon: resolveShorthand(props.icon),\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}