@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
@@ -3,68 +3,59 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.usePresenceBadgeStyles = void 0;
6
+ exports.usePresenceBadgeStyles_unstable = exports.presenceBadgeClassNames = 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 Badge_1 = /*#__PURE__*/require("../../Badge");
10
+ const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
11
 
12
- var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
12
+ exports.presenceBadgeClassNames = {
13
+ root: 'fui-PresenceBadge',
14
+ icon: 'fui-PresenceBadge__icon'
15
+ };
16
+
17
+ const getIsBusy = status => {
18
+ if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {
19
+ return true;
20
+ }
21
+
22
+ return false;
23
+ };
24
+
25
+ const useStyles = /*#__PURE__*/react_1.__styles({
13
26
  "root": {
14
27
  "z8tnut": "f1g0x7ka",
15
28
  "z189sj": ["fhxju0i", "f1cnd47f"],
16
29
  "Byoj8tv": "f1qch9an",
17
30
  "uwmqm3": ["f1cnd47f", "fhxju0i"],
18
- "B4j52fo": "f18zi460",
19
- "Bekrc4i": ["f1wpluaz", "fsfsuhs"],
20
- "Bn0qgzm": "fmklw6v",
21
- "ibv6hh": ["fsfsuhs", "f1wpluaz"]
22
- },
23
- "thinBorder": {
24
- "B4j52fo": "f192inf7",
25
- "Bekrc4i": ["f5tn483", "f1ojsxk5"],
26
- "Bn0qgzm": "f1vxd6vx",
27
- "ibv6hh": ["f1ojsxk5", "f5tn483"]
31
+ "mc9l5x": "ftuwxu6",
32
+ "B7ck84d": "f1ewtqcl",
33
+ "Bt984gj": "f122n59",
34
+ "Brf1p80": "f4d9j23",
35
+ "Bhmb4qv": "fb8jth9",
36
+ "Bbmb7ep": ["fqgqgel", "fchfifz"],
37
+ "Beyfa6y": ["fchfifz", "fqgqgel"],
38
+ "B7oj6ja": ["fc7b1hi", "f1dpx5h9"],
39
+ "Btl43ni": ["f1dpx5h9", "fc7b1hi"],
40
+ "De3pzq": "fxugw4r"
28
41
  },
29
42
  "statusBusy": {
30
- "De3pzq": "fdl5y0r",
31
- "g2u3we": "f11ttmz8",
32
- "h3c5rm": ["f1ratw88", "f459ikj"],
33
- "B9xav0g": "fvovscg",
34
- "zhjwy3": ["f459ikj", "f1ratw88"]
43
+ "sj55zd": "fvi85wt"
35
44
  },
36
45
  "statusAway": {
37
- "De3pzq": "fb00bxr",
38
- "g2u3we": "f1skk3ns",
39
- "h3c5rm": ["f766wml", "f1rnrfqa"],
40
- "B9xav0g": "fb8zvtn",
41
- "zhjwy3": ["f1rnrfqa", "f766wml"]
46
+ "sj55zd": "f14k8a89"
42
47
  },
43
48
  "statusAvailable": {
44
- "De3pzq": "f1og3d8b",
45
- "g2u3we": "f1t9i9vy",
46
- "h3c5rm": ["f1r5awo9", "fnfhfy0"],
47
- "B9xav0g": "fgfkvtu",
48
- "zhjwy3": ["fnfhfy0", "f1r5awo9"]
49
+ "sj55zd": "fqa5hgp"
49
50
  },
50
51
  "statusOffline": {
51
- "De3pzq": "fxugw4r",
52
- "sj55zd": "f11d4kpn",
53
- "g2u3we": "fi2z7s6",
54
- "h3c5rm": ["f1agc6it", "f1sit5hz"],
55
- "B9xav0g": "f9pok3v",
56
- "zhjwy3": ["f1sit5hz", "f1agc6it"]
52
+ "sj55zd": "f11d4kpn"
57
53
  },
58
54
  "statusOutOfOffice": {
59
- "De3pzq": "fxugw4r",
60
- "sj55zd": "fdce8r3",
61
- "g2u3we": "f161shwc",
62
- "h3c5rm": ["fbde6ui", "f7rrh46"],
63
- "B9xav0g": "f1yt3bcc",
64
- "zhjwy3": ["f7rrh46", "fbde6ui"]
55
+ "sj55zd": "fdce8r3"
65
56
  },
66
57
  "outOfOffice": {
67
- "De3pzq": "fxugw4r"
58
+ "sj55zd": "fr0bkrk"
68
59
  },
69
60
  "outOfOfficeAvailable": {
70
61
  "sj55zd": "fqa5hgp"
@@ -74,20 +65,44 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
74
65
  },
75
66
  "outOfOfficeAway": {
76
67
  "sj55zd": "f14k8a89"
68
+ },
69
+ "tiny": {
70
+ "Bubjx69": "f9ikmtg",
71
+ "a9b677": "f16dn6v3",
72
+ "B5pe6w7": "fab5kbq",
73
+ "p4uzdd": "f1ms1d91"
74
+ },
75
+ "large": {
76
+ "Bubjx69": "f9ikmtg",
77
+ "a9b677": "f64fuq3",
78
+ "B5pe6w7": "f1vfi1yj",
79
+ "p4uzdd": "f15s34gz"
80
+ },
81
+ "extraLarge": {
82
+ "Bubjx69": "f9ikmtg",
83
+ "a9b677": "f1w9dchk",
84
+ "B5pe6w7": "f14efy9b",
85
+ "p4uzdd": "fhipgdu"
77
86
  }
78
87
  }, {
79
- "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);}"]
88
+ "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;}"]
80
89
  });
81
90
  /**
82
91
  * Applies style classnames to slots
83
92
  */
84
93
 
85
94
 
86
- var usePresenceBadgeStyles = function (state) {
87
- var styles = useStyles();
88
- state.root.className = react_make_styles_1.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);
89
- return Badge_1.useBadgeStyles(state);
95
+ const usePresenceBadgeStyles_unstable = state => {
96
+ const styles = useStyles();
97
+ const isBusy = getIsBusy(state.status);
98
+ state.root.className = react_1.mergeClasses(exports.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);
99
+
100
+ if (state.icon) {
101
+ state.icon.className = react_1.mergeClasses(exports.presenceBadgeClassNames.icon, state.icon.className);
102
+ }
103
+
104
+ return state;
90
105
  };
91
106
 
92
- exports.usePresenceBadgeStyles = usePresenceBadgeStyles;
107
+ exports.usePresenceBadgeStyles_unstable = usePresenceBadgeStyles_unstable;
93
108
  //# sourceMappingURL=usePresenceBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,OAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AAGA,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAgC,MAAM,CAAC,UAhBlB,EAiBrB,KAAK,CAAC,IAAN,CAAW,SAjBU,CAAvB;;AAoBA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,uBAAA,CAAwB,IAArC,EAA2C,KAAK,CAAC,IAAN,CAAW,SAAtD,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CA5BM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","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/"}
@@ -3,16 +3,92 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.useCounterBadge_unstable = exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassNames = exports.CounterBadge = exports.usePresenceBadge_unstable = exports.usePresenceBadgeStyles_unstable = exports.presenceBadgeClassNames = exports.PresenceBadge = exports.useBadge_unstable = exports.useBadgeStyles_unstable = exports.renderBadge_unstable = exports.badgeClassNames = exports.Badge = void 0;
6
7
 
7
- var tslib_1 = /*#__PURE__*/require("tslib");
8
+ var Badge_1 = /*#__PURE__*/require("./Badge");
8
9
 
9
- tslib_1.__exportStar(require("./components/Badge/index"), exports);
10
+ Object.defineProperty(exports, "Badge", {
11
+ enumerable: true,
12
+ get: function () {
13
+ return Badge_1.Badge;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "badgeClassNames", {
17
+ enumerable: true,
18
+ get: function () {
19
+ return Badge_1.badgeClassNames;
20
+ }
21
+ });
22
+ Object.defineProperty(exports, "renderBadge_unstable", {
23
+ enumerable: true,
24
+ get: function () {
25
+ return Badge_1.renderBadge_unstable;
26
+ }
27
+ });
28
+ Object.defineProperty(exports, "useBadgeStyles_unstable", {
29
+ enumerable: true,
30
+ get: function () {
31
+ return Badge_1.useBadgeStyles_unstable;
32
+ }
33
+ });
34
+ Object.defineProperty(exports, "useBadge_unstable", {
35
+ enumerable: true,
36
+ get: function () {
37
+ return Badge_1.useBadge_unstable;
38
+ }
39
+ });
10
40
 
11
- tslib_1.__exportStar(require("./Badge"), exports);
41
+ var PresenceBadge_1 = /*#__PURE__*/require("./PresenceBadge");
12
42
 
13
- tslib_1.__exportStar(require("./PresenceBadge"), exports);
43
+ Object.defineProperty(exports, "PresenceBadge", {
44
+ enumerable: true,
45
+ get: function () {
46
+ return PresenceBadge_1.PresenceBadge;
47
+ }
48
+ });
49
+ Object.defineProperty(exports, "presenceBadgeClassNames", {
50
+ enumerable: true,
51
+ get: function () {
52
+ return PresenceBadge_1.presenceBadgeClassNames;
53
+ }
54
+ });
55
+ Object.defineProperty(exports, "usePresenceBadgeStyles_unstable", {
56
+ enumerable: true,
57
+ get: function () {
58
+ return PresenceBadge_1.usePresenceBadgeStyles_unstable;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, "usePresenceBadge_unstable", {
62
+ enumerable: true,
63
+ get: function () {
64
+ return PresenceBadge_1.usePresenceBadge_unstable;
65
+ }
66
+ });
14
67
 
15
- tslib_1.__exportStar(require("./components/CounterBadge/index"), exports);
68
+ var CounterBadge_1 = /*#__PURE__*/require("./CounterBadge");
16
69
 
17
- tslib_1.__exportStar(require("./CounterBadge"), exports);
70
+ Object.defineProperty(exports, "CounterBadge", {
71
+ enumerable: true,
72
+ get: function () {
73
+ return CounterBadge_1.CounterBadge;
74
+ }
75
+ });
76
+ Object.defineProperty(exports, "counterBadgeClassNames", {
77
+ enumerable: true,
78
+ get: function () {
79
+ return CounterBadge_1.counterBadgeClassNames;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, "useCounterBadgeStyles_unstable", {
83
+ enumerable: true,
84
+ get: function () {
85
+ return CounterBadge_1.useCounterBadgeStyles_unstable;
86
+ }
87
+ });
88
+ Object.defineProperty(exports, "useCounterBadge_unstable", {
89
+ enumerable: true,
90
+ get: function () {
91
+ return CounterBadge_1.useCounterBadge_unstable;
92
+ }
93
+ });
18
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iCAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,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AA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,+BAAA;AAA+B;AAA/B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,eAAA,CAAA,yBAAA;AAAyB;AAAzB,CAAA;;AAGF,IAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,cAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,YAAA;AAAY;AAAZ,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gCAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,8BAAA;AAA8B;AAA9B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,cAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA","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/"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-badge",
3
- "version": "9.0.0-nightly.f81b28ceb3.1",
3
+ "version": "9.0.0-rc.11",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -19,47 +19,43 @@
19
19
  "just": "just-scripts",
20
20
  "lint": "just-scripts lint",
21
21
  "start": "yarn storybook",
22
- "test": "jest",
22
+ "test": "jest --passWithNoTests",
23
23
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
- "build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/react-badge/src && yarn docs",
25
- "storybook": "start-storybook"
24
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-badge/src && yarn docs",
25
+ "storybook": "node ../../../scripts/storybook/runner",
26
+ "type-check": "tsc -b tsconfig.json"
26
27
  },
27
28
  "devDependencies": {
28
- "@fluentui/babel-make-styles": "9.0.0-nightly.f81b28ceb3.1",
29
29
  "@fluentui/eslint-plugin": "*",
30
- "@fluentui/jest-serializer-make-styles": "9.0.0-nightly.f81b28ceb3.1",
31
30
  "@fluentui/react-conformance": "*",
32
- "@fluentui/react-conformance-make-styles": "9.0.0-nightly.f81b28ceb3.1",
33
- "@fluentui/scripts": "^1.0.0",
34
- "@types/enzyme": "3.10.3",
35
- "@types/enzyme-adapter-react-16": "1.0.3",
36
- "@types/react": "16.9.42",
37
- "@types/react-dom": "16.9.10",
38
- "@types/react-test-renderer": "^16.0.0",
39
- "enzyme": "~3.10.0",
40
- "enzyme-adapter-react-16": "^1.15.0",
41
- "react": "16.8.6",
42
- "react-dom": "16.8.6",
43
- "react-test-renderer": "^16.3.0"
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.7",
32
+ "@fluentui/scripts": "^1.0.0"
44
33
  },
45
34
  "dependencies": {
46
- "@fluentui/react-make-styles": "9.0.0-nightly.f81b28ceb3.1",
47
- "@fluentui/react-theme": "9.0.0-nightly.f81b28ceb3.1",
48
- "@fluentui/react-utilities": "9.0.0-nightly.f81b28ceb3.1",
35
+ "@fluentui/react-icons": "^2.0.166-rc.3",
36
+ "@griffel/react": "1.0.5",
37
+ "@fluentui/react-theme": "9.0.0-rc.9",
38
+ "@fluentui/react-utilities": "9.0.0-rc.9",
49
39
  "tslib": "^2.1.0"
50
40
  },
51
41
  "peerDependencies": {
52
- "@types/react": ">=16.8.0 <17.0.0",
53
- "@types/react-dom": ">=16.8.0 <17.0.0",
54
- "react": ">=16.8.0 <17.0.0",
55
- "react-dom": ">=16.8.0 <17.0.0"
42
+ "@types/react": ">=16.8.0 <18.0.0",
43
+ "@types/react-dom": ">=16.8.0 <18.0.0",
44
+ "react": ">=16.8.0 <18.0.0",
45
+ "react-dom": ">=16.8.0 <18.0.0"
56
46
  },
57
47
  "beachball": {
58
- "tag": "beta",
59
48
  "disallowedChangeTypes": [
60
49
  "major",
61
50
  "minor",
62
51
  "patch"
63
52
  ]
53
+ },
54
+ "exports": {
55
+ ".": {
56
+ "types": "./lib/index.d.ts",
57
+ "import": "./lib/index.js",
58
+ "require": "./lib-commonjs/index.js"
59
+ }
64
60
  }
65
61
  }
@@ -1,154 +0,0 @@
1
- import type { ComponentProps } from '@fluentui/react-utilities';
2
- import type { ComponentState } from '@fluentui/react-utilities';
3
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
- import type { ObjectShorthandProps } from '@fluentui/react-utilities';
5
- import * as React_2 from 'react';
6
-
7
- /**
8
- * Define a styled Badge, using the `useBadge` hook.
9
- */
10
- export declare const Badge: ForwardRefComponent<BadgeProps>;
11
-
12
- export declare type BadgeCommons = {
13
- /**
14
- * A Badge can be filled, outline, ghost, inverted
15
- * @defaultvalue filled
16
- */
17
- appearance: 'filled' | 'ghost' | 'outline' | 'tint';
18
- /**
19
- * A Badge can be one of preset colors
20
- * @defaultvalue brand
21
- */
22
- color: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
23
- /**
24
- * A Badge can position the icon before or after the content.
25
- * @defaultvalue before
26
- */
27
- iconPosition: 'before' | 'after';
28
- /**
29
- * A Badge can be square, circular or rounded.
30
- * @defaultvalue circular
31
- */
32
- shape: 'circular' | 'rounded' | 'square';
33
- /**
34
- * A Badge can be on of several preset sizes.
35
- * @defaultvalue medium
36
- */
37
- size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
38
- };
39
-
40
- export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
41
-
42
- export declare type BadgeSlots = {
43
- root: ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>;
44
- icon?: ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>;
45
- };
46
-
47
- export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
48
-
49
- /**
50
- * Define a styled CounterBadge, using the `useCounterBadge` hook.
51
- */
52
- export declare const CounterBadge: ForwardRefComponent<CounterBadgeProps>;
53
-
54
- export declare type CounterBadgeCommons = {
55
- /**
56
- * Max number to be displayed
57
- * @default 99
58
- */
59
- overflowCount: number;
60
- /**
61
- * Value displayed by the Badge
62
- * @default 0
63
- */
64
- count: number;
65
- /**
66
- * If the badge should be shown when count is 0
67
- * @default false
68
- */
69
- showZero: boolean;
70
- /**
71
- * If a dot should be displayed without the count
72
- * @default false
73
- */
74
- dot: boolean;
75
- /**
76
- * A Badge can be circular or rounded
77
- * @default circular
78
- */
79
- shape: 'circular' | 'rounded';
80
- /**
81
- * A Badge can be filled, ghost
82
- * @default filled
83
- */
84
- appearance: 'filled' | 'ghost';
85
- };
86
-
87
- /**
88
- * {@docCategory CounterBadge}
89
- */
90
- export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape'> & Partial<CounterBadgeCommons>;
91
-
92
- /**
93
- * {@docCategory CounterBadge}
94
- */
95
- export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape'> & CounterBadgeCommons;
96
-
97
- /**
98
- * Define a styled Badge, using the `useBadge` hook.
99
- */
100
- export declare const PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
101
-
102
- export declare interface PresenceBadgeCommons {
103
- /**
104
- * Represents several status
105
- * @default available
106
- */
107
- status: PresenceBadgeStatus;
108
- /**
109
- * Modifies the display to indicate that the user is out of office.
110
- * This can be combined with any status to display an out-of-office version of that status
111
- * @default false
112
- */
113
- outOfOffice: boolean;
114
- }
115
-
116
- export declare type PresenceBadgeProps = BadgeProps & Partial<PresenceBadgeCommons>;
117
-
118
- export declare type PresenceBadgeState = BadgeState & PresenceBadgeCommons;
119
-
120
- export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';
121
-
122
- export declare const renderBadge: (state: BadgeState) => JSX.Element;
123
-
124
- /**
125
- * Returns the props and state required to render the component
126
- */
127
- export declare const useBadge: (props: BadgeProps, ref: React_2.Ref<HTMLElement>) => BadgeState;
128
-
129
- /**
130
- * Applies style classnames to slots
131
- */
132
- export declare const useBadgeStyles: (state: BadgeState) => BadgeState;
133
-
134
- /**
135
- * Returns the props and state required to render the component
136
- */
137
- export declare const useCounterBadge: (props: CounterBadgeProps, ref: React_2.Ref<HTMLElement>) => CounterBadgeState;
138
-
139
- /**
140
- * Applies style classnames to slots
141
- */
142
- export declare const useCounterBadgeStyles: (state: CounterBadgeState) => CounterBadgeState;
143
-
144
- /**
145
- * Returns the props and state required to render the component
146
- */
147
- export declare const usePresenceBadge: (props: PresenceBadgeProps, ref: React_2.Ref<HTMLElement>) => PresenceBadgeState;
148
-
149
- /**
150
- * Applies style classnames to slots
151
- */
152
- export declare const usePresenceBadgeStyles: (state: PresenceBadgeState) => PresenceBadgeState;
153
-
154
- export { }
package/lib/Badge.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Badge/index';
@@ -1 +0,0 @@
1
- export * from './components/CounterBadge/index';
@@ -1 +0,0 @@
1
- export * from './components/PresenceBadge/index';
@@ -1,4 +0,0 @@
1
- import type { IsConformantOptions } from '@fluentui/react-conformance';
2
- export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
- componentPath?: string;
4
- }): void;
@@ -1,13 +0,0 @@
1
- import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
- import makeStylesTests from '@fluentui/react-conformance-make-styles';
3
- export function isConformant(testInfo) {
4
- var defaultOptions = {
5
- asPropHandlesRef: true,
6
- componentPath: module.parent.filename.replace('.test', ''),
7
- // https://github.com/microsoft/fluentui/issues/19522
8
- skipAsPropTests: true,
9
- extraTests: makeStylesTests
10
- };
11
- baseIsConformant(defaultOptions, testInfo);
12
- }
13
- //# sourceMappingURL=isConformant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D;AACA,IAAA,eAAe,EAAE,IAJ0C;AAK3D,IAAA,UAAU,EAAE;AAL+C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
@@ -1,6 +0,0 @@
1
- import type { BadgeProps } from './Badge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled Badge, using the `useBadge` hook.
5
- */
6
- export declare const Badge: ForwardRefComponent<BadgeProps>;
@@ -1,35 +0,0 @@
1
- import * as React from 'react';
2
- import type { ComponentProps, ComponentState, ObjectShorthandProps } from '@fluentui/react-utilities';
3
- export declare type BadgeSlots = {
4
- root: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
5
- icon?: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
6
- };
7
- export declare type BadgeCommons = {
8
- /**
9
- * A Badge can be filled, outline, ghost, inverted
10
- * @defaultvalue filled
11
- */
12
- appearance: 'filled' | 'ghost' | 'outline' | 'tint';
13
- /**
14
- * A Badge can be one of preset colors
15
- * @defaultvalue brand
16
- */
17
- color: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
18
- /**
19
- * A Badge can position the icon before or after the content.
20
- * @defaultvalue before
21
- */
22
- iconPosition: 'before' | 'after';
23
- /**
24
- * A Badge can be square, circular or rounded.
25
- * @defaultvalue circular
26
- */
27
- shape: 'circular' | 'rounded' | 'square';
28
- /**
29
- * A Badge can be on of several preset sizes.
30
- * @defaultvalue medium
31
- */
32
- size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
33
- };
34
- export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
35
- export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
@@ -1,5 +0,0 @@
1
- export * from './Badge';
2
- export * from './Badge.types';
3
- export * from './renderBadge';
4
- export * from './useBadge';
5
- export * from './useBadgeStyles';
@@ -1,2 +0,0 @@
1
- import type { BadgeState } from './Badge.types';
2
- export declare const renderBadge: (state: BadgeState) => JSX.Element;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { BadgeProps, BadgeState } from './Badge.types';
3
- /**
4
- * Returns the props and state required to render the component
5
- */
6
- export declare const useBadge: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
@@ -1,5 +0,0 @@
1
- import type { BadgeState } from './Badge.types';
2
- /**
3
- * Applies style classnames to slots
4
- */
5
- export declare const useBadgeStyles: (state: BadgeState) => BadgeState;