@fluentui/react-badge 9.1.4 → 9.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +58 -1
  3. package/CHANGELOG.md +18 -2
  4. package/lib/Badge.js.map +1 -1
  5. package/lib/CounterBadge.js.map +1 -1
  6. package/lib/PresenceBadge.js.map +1 -1
  7. package/lib/components/Badge/Badge.js.map +1 -1
  8. package/lib/components/Badge/Badge.types.js.map +1 -1
  9. package/lib/components/Badge/index.js.map +1 -1
  10. package/lib/components/Badge/renderBadge.js +1 -7
  11. package/lib/components/Badge/renderBadge.js.map +1 -1
  12. package/lib/components/Badge/useBadge.js +1 -0
  13. package/lib/components/Badge/useBadge.js.map +1 -1
  14. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  15. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  16. package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
  17. package/lib/components/CounterBadge/index.js.map +1 -1
  18. package/lib/components/CounterBadge/useCounterBadge.js +1 -0
  19. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  20. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  21. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  22. package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  23. package/lib/components/PresenceBadge/index.js.map +1 -1
  24. package/lib/components/PresenceBadge/presenceIcons.js +34 -41
  25. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
  26. package/lib/components/PresenceBadge/usePresenceBadge.js +2 -2
  27. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  28. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +1 -1
  29. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  30. package/lib/index.js.map +1 -1
  31. package/lib-commonjs/Badge.js +5 -4
  32. package/lib-commonjs/Badge.js.map +1 -1
  33. package/lib-commonjs/CounterBadge.js +5 -4
  34. package/lib-commonjs/CounterBadge.js.map +1 -1
  35. package/lib-commonjs/PresenceBadge.js +5 -4
  36. package/lib-commonjs/PresenceBadge.js.map +1 -1
  37. package/lib-commonjs/components/Badge/Badge.js +19 -20
  38. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  39. package/lib-commonjs/components/Badge/Badge.types.js +3 -2
  40. package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
  41. package/lib-commonjs/components/Badge/index.js +8 -7
  42. package/lib-commonjs/components/Badge/index.js.map +1 -1
  43. package/lib-commonjs/components/Badge/renderBadge.js +13 -19
  44. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  45. package/lib-commonjs/components/Badge/useBadge.js +29 -34
  46. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  47. package/lib-commonjs/components/Badge/useBadgeStyles.js +608 -310
  48. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  49. package/lib-commonjs/components/CounterBadge/CounterBadge.js +19 -20
  50. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  51. package/lib-commonjs/components/CounterBadge/CounterBadge.types.js +3 -2
  52. package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
  53. package/lib-commonjs/components/CounterBadge/index.js +8 -7
  54. package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
  55. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +24 -30
  56. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  57. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +54 -34
  58. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  59. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +19 -20
  60. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  61. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js +3 -2
  62. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  63. package/lib-commonjs/components/PresenceBadge/index.js +8 -7
  64. package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
  65. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +146 -134
  66. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
  67. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +61 -65
  68. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  69. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +102 -78
  70. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  71. package/lib-commonjs/index.js +28 -85
  72. package/lib-commonjs/index.js.map +1 -1
  73. package/package.json +9 -8
  74. package/lib-amd/Badge.js +0 -6
  75. package/lib-amd/Badge.js.map +0 -1
  76. package/lib-amd/CounterBadge.js +0 -6
  77. package/lib-amd/CounterBadge.js.map +0 -1
  78. package/lib-amd/PresenceBadge.js +0 -6
  79. package/lib-amd/PresenceBadge.js.map +0 -1
  80. package/lib-amd/components/Badge/Badge.js +0 -17
  81. package/lib-amd/components/Badge/Badge.js.map +0 -1
  82. package/lib-amd/components/Badge/Badge.types.js +0 -5
  83. package/lib-amd/components/Badge/Badge.types.js.map +0 -1
  84. package/lib-amd/components/Badge/index.js +0 -9
  85. package/lib-amd/components/Badge/index.js.map +0 -1
  86. package/lib-amd/components/Badge/renderBadge.js +0 -14
  87. package/lib-amd/components/Badge/renderBadge.js.map +0 -1
  88. package/lib-amd/components/Badge/useBadge.js +0 -27
  89. package/lib-amd/components/Badge/useBadge.js.map +0 -1
  90. package/lib-amd/components/Badge/useBadgeStyles.js +0 -212
  91. package/lib-amd/components/Badge/useBadgeStyles.js.map +0 -1
  92. package/lib-amd/components/CounterBadge/CounterBadge.js +0 -17
  93. package/lib-amd/components/CounterBadge/CounterBadge.js.map +0 -1
  94. package/lib-amd/components/CounterBadge/CounterBadge.types.js +0 -5
  95. package/lib-amd/components/CounterBadge/CounterBadge.types.js.map +0 -1
  96. package/lib-amd/components/CounterBadge/index.js +0 -9
  97. package/lib-amd/components/CounterBadge/index.js.map +0 -1
  98. package/lib-amd/components/CounterBadge/useCounterBadge.js +0 -18
  99. package/lib-amd/components/CounterBadge/useCounterBadge.js.map +0 -1
  100. package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js +0 -28
  101. package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js.map +0 -1
  102. package/lib-amd/components/PresenceBadge/PresenceBadge.js +0 -17
  103. package/lib-amd/components/PresenceBadge/PresenceBadge.js.map +0 -1
  104. package/lib-amd/components/PresenceBadge/PresenceBadge.types.js +0 -5
  105. package/lib-amd/components/PresenceBadge/PresenceBadge.types.js.map +0 -1
  106. package/lib-amd/components/PresenceBadge/index.js +0 -9
  107. package/lib-amd/components/PresenceBadge/index.js.map +0 -1
  108. package/lib-amd/components/PresenceBadge/presenceIcons.js +0 -146
  109. package/lib-amd/components/PresenceBadge/presenceIcons.js.map +0 -1
  110. package/lib-amd/components/PresenceBadge/usePresenceBadge.js +0 -53
  111. package/lib-amd/components/PresenceBadge/usePresenceBadge.js.map +0 -1
  112. package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js +0 -101
  113. package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js.map +0 -1
  114. package/lib-amd/index.js +0 -19
  115. package/lib-amd/index.js.map +0 -1
@@ -1,86 +1,110 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ presenceBadgeClassNames: ()=>presenceBadgeClassNames,
13
+ usePresenceBadgeStyles_unstable: ()=>usePresenceBadgeStyles_unstable
5
14
  });
6
- exports.usePresenceBadgeStyles_unstable = exports.presenceBadgeClassNames = void 0;
7
- const react_1 = /*#__PURE__*/require("@griffel/react");
8
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
9
- exports.presenceBadgeClassNames = {
10
- root: 'fui-PresenceBadge',
11
- icon: 'fui-PresenceBadge__icon'
15
+ const _react = require("@griffel/react");
16
+ const presenceBadgeClassNames = {
17
+ root: 'fui-PresenceBadge',
18
+ icon: 'fui-PresenceBadge__icon'
12
19
  };
13
- const getIsBusy = status => {
14
- if (status === 'busy' || status === 'do-not-disturb' || status === 'blocked') {
15
- return true;
16
- }
17
- return false;
20
+ const getIsBusy = (status)=>{
21
+ if (status === 'busy' || status === 'do-not-disturb' || status === 'blocked') {
22
+ return true;
23
+ }
24
+ return false;
18
25
  };
19
- const useRootClassName = /*#__PURE__*/react_1.__resetStyles("r11sysef", null, [".r11sysef{padding:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;border-radius:var(--borderRadiusCircular);background-color:var(--colorNeutralBackground1);}", ".r11sysef span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}"]);
20
- const useStyles = /*#__PURE__*/react_1.__styles({
21
- statusBusy: {
22
- sj55zd: "fvi85wt"
23
- },
24
- statusAway: {
25
- sj55zd: "f14k8a89"
26
- },
27
- statusAvailable: {
28
- sj55zd: "fqa5hgp"
29
- },
30
- statusOffline: {
31
- sj55zd: "f11d4kpn"
32
- },
33
- statusOutOfOffice: {
34
- sj55zd: "fdce8r3"
35
- },
36
- statusUnknown: {
37
- sj55zd: "f11d4kpn"
38
- },
39
- outOfOffice: {
40
- sj55zd: "fr0bkrk"
41
- },
42
- outOfOfficeAvailable: {
43
- sj55zd: "fqa5hgp"
44
- },
45
- outOfOfficeBusy: {
46
- sj55zd: "fvi85wt"
47
- },
48
- outOfOfficeUnknown: {
49
- sj55zd: "f11d4kpn"
50
- },
51
- tiny: {
52
- Bubjx69: "f9ikmtg",
53
- a9b677: "f16dn6v3",
54
- B5pe6w7: "fab5kbq",
55
- p4uzdd: "f1ms1d91"
56
- },
57
- large: {
58
- Bubjx69: "f9ikmtg",
59
- a9b677: "f64fuq3",
60
- B5pe6w7: "f1vfi1yj",
61
- p4uzdd: "f15s34gz"
62
- },
63
- extraLarge: {
64
- Bubjx69: "f9ikmtg",
65
- a9b677: "f1w9dchk",
66
- B5pe6w7: "f14efy9b",
67
- p4uzdd: "fhipgdu"
68
- }
26
+ const useRootClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r11sysef", null, [
27
+ ".r11sysef{padding:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;border-radius:var(--borderRadiusCircular);background-color:var(--colorNeutralBackground1);}",
28
+ ".r11sysef span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}"
29
+ ]);
30
+ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
31
+ statusBusy: {
32
+ sj55zd: "fvi85wt"
33
+ },
34
+ statusAway: {
35
+ sj55zd: "f14k8a89"
36
+ },
37
+ statusAvailable: {
38
+ sj55zd: "fqa5hgp"
39
+ },
40
+ statusOffline: {
41
+ sj55zd: "f11d4kpn"
42
+ },
43
+ statusOutOfOffice: {
44
+ sj55zd: "fdce8r3"
45
+ },
46
+ statusUnknown: {
47
+ sj55zd: "f11d4kpn"
48
+ },
49
+ outOfOffice: {
50
+ sj55zd: "fr0bkrk"
51
+ },
52
+ outOfOfficeAvailable: {
53
+ sj55zd: "fqa5hgp"
54
+ },
55
+ outOfOfficeBusy: {
56
+ sj55zd: "fvi85wt"
57
+ },
58
+ outOfOfficeUnknown: {
59
+ sj55zd: "f11d4kpn"
60
+ },
61
+ tiny: {
62
+ Bubjx69: "f9ikmtg",
63
+ a9b677: "f16dn6v3",
64
+ B5pe6w7: "fab5kbq",
65
+ p4uzdd: "f1ms1d91"
66
+ },
67
+ large: {
68
+ Bubjx69: "f9ikmtg",
69
+ a9b677: "f64fuq3",
70
+ B5pe6w7: "f1vfi1yj",
71
+ p4uzdd: "f15s34gz"
72
+ },
73
+ extraLarge: {
74
+ Bubjx69: "f9ikmtg",
75
+ a9b677: "f1w9dchk",
76
+ B5pe6w7: "f14efy9b",
77
+ p4uzdd: "fhipgdu"
78
+ }
69
79
  }, {
70
- d: [".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
+ d: [
81
+ ".fvi85wt{color:var(--colorPaletteRedBackground3);}",
82
+ ".f14k8a89{color:var(--colorPaletteMarigoldBackground3);}",
83
+ ".fqa5hgp{color:var(--colorPaletteLightGreenForeground3);}",
84
+ ".f11d4kpn{color:var(--colorNeutralForeground3);}",
85
+ ".fdce8r3{color:var(--colorPaletteBerryForeground3);}",
86
+ ".fr0bkrk{color:var(--colorNeutralBackground1);}",
87
+ ".f9ikmtg{aspect-ratio:1;}",
88
+ ".f16dn6v3{width:6px;}",
89
+ ".fab5kbq svg{width:6px!important;}",
90
+ ".f1ms1d91 svg{height:6px!important;}",
91
+ ".f64fuq3{width:20px;}",
92
+ ".f1vfi1yj svg{width:20px!important;}",
93
+ ".f15s34gz svg{height:20px!important;}",
94
+ ".f1w9dchk{width:28px;}",
95
+ ".f14efy9b svg{width:28px!important;}",
96
+ ".fhipgdu svg{height:28px!important;}"
97
+ ]
71
98
  });
72
- /**
73
- * Applies style classnames to slots
74
- */
75
- const usePresenceBadgeStyles_unstable = state => {
76
- const rootClassName = useRootClassName();
77
- const styles = useStyles();
78
- const isBusy = getIsBusy(state.status);
79
- state.root.className = react_1.mergeClasses(exports.presenceBadgeClassNames.root, rootClassName, 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.status === 'unknown' && styles.statusUnknown, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.statusOutOfOffice, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && state.status === 'unknown' && styles.outOfOfficeUnknown, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
80
- if (state.icon) {
81
- state.icon.className = react_1.mergeClasses(exports.presenceBadgeClassNames.icon, state.icon.className);
82
- }
83
- return state;
84
- };
85
- exports.usePresenceBadgeStyles_unstable = usePresenceBadgeStyles_unstable;
99
+ const usePresenceBadgeStyles_unstable = (state)=>{
100
+ const rootClassName = useRootClassName();
101
+ const styles = useStyles();
102
+ const isBusy = getIsBusy(state.status);
103
+ state.root.className = (0, _react.mergeClasses)(presenceBadgeClassNames.root, rootClassName, 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.status === 'unknown' && styles.statusUnknown, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.statusAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && state.status === 'unknown' && styles.outOfOfficeUnknown, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
104
+ if (state.icon) {
105
+ state.icon.className = (0, _react.mergeClasses)(presenceBadgeClassNames.icon, state.icon.className);
106
+ }
107
+ return state;
108
+ }; //# sourceMappingURL=usePresenceBadgeStyles.js.map
109
+
86
110
  //# sourceMappingURL=usePresenceBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_1","require","react_theme_1","exports","presenceBadgeClassNames","root","icon","getIsBusy","status","useRootClassName","__resetStyles","useStyles","__styles","statusBusy","sj55zd","statusAway","statusAvailable","statusOffline","statusOutOfOffice","statusUnknown","outOfOffice","outOfOfficeAvailable","outOfOfficeBusy","outOfOfficeUnknown","tiny","Bubjx69","a9b677","B5pe6w7","p4uzdd","large","extraLarge","d","usePresenceBadgeStyles_unstable","state","rootClassName","styles","isBusy","className","mergeClasses","size"],"sources":["../src/packages/react-components/react-badge/src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } 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 === 'blocked') {\n return true;\n }\n\n return false;\n};\n\nconst useRootClassName = makeResetStyles({\n padding: 0,\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n\n '& span': {\n display: 'flex',\n },\n borderRadius: tokens.borderRadiusCircular,\n backgroundColor: tokens.colorNeutralBackground1,\n});\n\nconst useStyles = makeStyles({\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 statusUnknown: {\n color: tokens.colorNeutralForeground3,\n },\n outOfOffice: {\n color: tokens.colorNeutralBackground1,\n },\n outOfOfficeAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n outOfOfficeBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n outOfOfficeUnknown: {\n color: tokens.colorNeutralForeground3,\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 rootClassName = useRootClassName();\n const styles = useStyles();\n const isBusy = getIsBusy(state.status);\n state.root.className = mergeClasses(\n presenceBadgeClassNames.root,\n rootClassName,\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.status === 'unknown' && styles.statusUnknown,\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.statusOutOfOffice,\n state.outOfOffice && state.status === 'offline' && styles.statusOffline,\n state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.outOfOffice && state.status === 'unknown' && styles.outOfOfficeUnknown,\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"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AAKaE,OAAA,CAAAC,uBAAuB,GAA+B;EACjEC,IAAI,EAAE,mBAAmB;EACzBC,IAAI,EAAE;CACP;AAED,MAAMC,SAAS,GAAIC,MAA2B,IAAa;EACzD,IAAIA,MAAM,KAAK,MAAM,IAAIA,MAAM,KAAK,gBAAgB,IAAIA,MAAM,KAAK,SAAS,EAAE;IAC5E,OAAO,IAAI;;EAGb,OAAO,KAAK;AACd,CAAC;AAED,MAAMC,gBAAgB,gBAAGT,OAAA,CAAAU,aAAe,iiBAYtC;AAEF,MAAMC,SAAS,gBAAGX,OAAA,CAAAY,QAAU;EAAAC,UAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAD,MAAA;EAAA;EAAAE,eAAA;IAAAF,MAAA;EAAA;EAAAG,aAAA;IAAAH,MAAA;EAAA;EAAAI,iBAAA;IAAAJ,MAAA;EAAA;EAAAK,aAAA;IAAAL,MAAA;EAAA;EAAAM,WAAA;IAAAN,MAAA;EAAA;EAAAO,oBAAA;IAAAP,MAAA;EAAA;EAAAQ,eAAA;IAAAR,MAAA;EAAA;EAAAS,kBAAA;IAAAT,MAAA;EAAA;EAAAU,IAAA;IA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,CAACjB,iBAAiB,EACxEe,KAAK,CAACb,WAAW,IAAIa,KAAK,CAACzB,MAAM,KAAK,SAAS,IAAI2B,MAAM,CAAClB,aAAa,EACvEgB,KAAK,CAACb,WAAW,IAAIa,KAAK,CAACzB,MAAM,KAAK,eAAe,IAAI2B,MAAM,CAACjB,iBAAiB,EACjFe,KAAK,CAACb,WAAW,IAAIa,KAAK,CAACzB,MAAM,KAAK,SAAS,IAAI2B,MAAM,CAACZ,kBAAkB,EAC5EU,KAAK,CAACM,IAAI,KAAK,MAAM,IAAIJ,MAAM,CAACX,IAAI,EACpCS,KAAK,CAACM,IAAI,KAAK,OAAO,IAAIJ,MAAM,CAACN,KAAK,EACtCI,KAAK,CAACM,IAAI,KAAK,aAAa,IAAIJ,MAAM,CAACL,UAAU,EACjDG,KAAK,CAAC5B,IAAI,CAACgC,SAAS,CACrB;EAED,IAAIJ,KAAK,CAAC3B,IAAI,EAAE;IACd2B,KAAK,CAAC3B,IAAI,CAAC+B,SAAS,GAAGrC,OAAA,CAAAsC,YAAY,CAACnC,OAAA,CAAAC,uBAAuB,CAACE,IAAI,EAAE2B,KAAK,CAAC3B,IAAI,CAAC+B,SAAS,CAAC;;EAGzF,OAAOJ,KAAK;AACd,CAAC;AA/BY9B,OAAA,CAAA6B,+BAA+B,GAAAA,+BAAA"}
1
+ {"version":3,"sources":["../../../lib/components/PresenceBadge/usePresenceBadgeStyles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const presenceBadgeClassNames = {\n root: 'fui-PresenceBadge',\n icon: 'fui-PresenceBadge__icon'\n};\nconst getIsBusy = status => {\n if (status === 'busy' || status === 'do-not-disturb' || status === 'blocked') {\n return true;\n }\n return false;\n};\nconst useRootClassName = /*#__PURE__*/__resetStyles(\"r11sysef\", null, [\".r11sysef{padding:0;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;border-radius:var(--borderRadiusCircular);background-color:var(--colorNeutralBackground1);}\", \".r11sysef span{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\"]);\nconst useStyles = /*#__PURE__*/__styles({\n statusBusy: {\n sj55zd: \"fvi85wt\"\n },\n statusAway: {\n sj55zd: \"f14k8a89\"\n },\n statusAvailable: {\n sj55zd: \"fqa5hgp\"\n },\n statusOffline: {\n sj55zd: \"f11d4kpn\"\n },\n statusOutOfOffice: {\n sj55zd: \"fdce8r3\"\n },\n statusUnknown: {\n sj55zd: \"f11d4kpn\"\n },\n outOfOffice: {\n sj55zd: \"fr0bkrk\"\n },\n outOfOfficeAvailable: {\n sj55zd: \"fqa5hgp\"\n },\n outOfOfficeBusy: {\n sj55zd: \"fvi85wt\"\n },\n outOfOfficeUnknown: {\n sj55zd: \"f11d4kpn\"\n },\n tiny: {\n Bubjx69: \"f9ikmtg\",\n a9b677: \"f16dn6v3\",\n B5pe6w7: \"fab5kbq\",\n p4uzdd: \"f1ms1d91\"\n },\n large: {\n Bubjx69: \"f9ikmtg\",\n a9b677: \"f64fuq3\",\n B5pe6w7: \"f1vfi1yj\",\n p4uzdd: \"f15s34gz\"\n },\n extraLarge: {\n Bubjx69: \"f9ikmtg\",\n a9b677: \"f1w9dchk\",\n B5pe6w7: \"f14efy9b\",\n p4uzdd: \"fhipgdu\"\n }\n}, {\n d: [\".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;}\"]\n});\n/**\n * Applies style classnames to slots\n */\nexport const usePresenceBadgeStyles_unstable = state => {\n const rootClassName = useRootClassName();\n const styles = useStyles();\n const isBusy = getIsBusy(state.status);\n state.root.className = mergeClasses(presenceBadgeClassNames.root, rootClassName, 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.status === 'unknown' && styles.statusUnknown, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.statusAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && state.status === 'unknown' && styles.outOfOfficeUnknown, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);\n }\n return state;\n};\n//# sourceMappingURL=usePresenceBadgeStyles.js.map"],"names":["presenceBadgeClassNames","usePresenceBadgeStyles_unstable","root","icon","getIsBusy","status","useRootClassName","__resetStyles","useStyles","__styles","statusBusy","sj55zd","statusAway","statusAvailable","statusOffline","statusOutOfOffice","statusUnknown","outOfOffice","outOfOfficeAvailable","outOfOfficeBusy","outOfOfficeUnknown","tiny","Bubjx69","a9b677","B5pe6w7","p4uzdd","large","extraLarge","d","state","rootClassName","styles","isBusy","className","mergeClasses","size"],"mappings":";;;;;;;;;;;IAEaA,uBAAuB,MAAvBA;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"__esModule", {
4
- value: true
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;
7
- var Badge_1 = /*#__PURE__*/require("./Badge");
8
- Object.defineProperty(exports, "Badge", {
9
- enumerable: true,
10
- get: function () {
11
- return Badge_1.Badge;
12
- }
13
- });
14
- Object.defineProperty(exports, "badgeClassNames", {
15
- enumerable: true,
16
- get: function () {
17
- return Badge_1.badgeClassNames;
18
- }
19
- });
20
- Object.defineProperty(exports, "renderBadge_unstable", {
21
- enumerable: true,
22
- get: function () {
23
- return Badge_1.renderBadge_unstable;
24
- }
25
- });
26
- Object.defineProperty(exports, "useBadgeStyles_unstable", {
27
- enumerable: true,
28
- get: function () {
29
- return Badge_1.useBadgeStyles_unstable;
30
- }
31
- });
32
- Object.defineProperty(exports, "useBadge_unstable", {
33
- enumerable: true,
34
- get: function () {
35
- return Badge_1.useBadge_unstable;
36
- }
37
- });
38
- var PresenceBadge_1 = /*#__PURE__*/require("./PresenceBadge");
39
- Object.defineProperty(exports, "PresenceBadge", {
40
- enumerable: true,
41
- get: function () {
42
- return PresenceBadge_1.PresenceBadge;
43
- }
44
- });
45
- Object.defineProperty(exports, "presenceBadgeClassNames", {
46
- enumerable: true,
47
- get: function () {
48
- return PresenceBadge_1.presenceBadgeClassNames;
49
- }
50
- });
51
- Object.defineProperty(exports, "usePresenceBadgeStyles_unstable", {
52
- enumerable: true,
53
- get: function () {
54
- return PresenceBadge_1.usePresenceBadgeStyles_unstable;
55
- }
56
- });
57
- Object.defineProperty(exports, "usePresenceBadge_unstable", {
58
- enumerable: true,
59
- get: function () {
60
- return PresenceBadge_1.usePresenceBadge_unstable;
61
- }
62
- });
63
- var CounterBadge_1 = /*#__PURE__*/require("./CounterBadge");
64
- Object.defineProperty(exports, "CounterBadge", {
65
- enumerable: true,
66
- get: function () {
67
- return CounterBadge_1.CounterBadge;
68
- }
69
- });
70
- Object.defineProperty(exports, "counterBadgeClassNames", {
71
- enumerable: true,
72
- get: function () {
73
- return CounterBadge_1.counterBadgeClassNames;
74
- }
75
- });
76
- Object.defineProperty(exports, "useCounterBadgeStyles_unstable", {
77
- enumerable: true,
78
- get: function () {
79
- return CounterBadge_1.useCounterBadgeStyles_unstable;
80
- }
81
- });
82
- Object.defineProperty(exports, "useCounterBadge_unstable", {
83
- enumerable: true,
84
- get: function () {
85
- return CounterBadge_1.useCounterBadge_unstable;
86
- }
87
- });
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ Badge: ()=>_badge.Badge,
13
+ badgeClassNames: ()=>_badge.badgeClassNames,
14
+ renderBadge_unstable: ()=>_badge.renderBadge_unstable,
15
+ useBadgeStyles_unstable: ()=>_badge.useBadgeStyles_unstable,
16
+ useBadge_unstable: ()=>_badge.useBadge_unstable,
17
+ PresenceBadge: ()=>_presenceBadge.PresenceBadge,
18
+ presenceBadgeClassNames: ()=>_presenceBadge.presenceBadgeClassNames,
19
+ usePresenceBadgeStyles_unstable: ()=>_presenceBadge.usePresenceBadgeStyles_unstable,
20
+ usePresenceBadge_unstable: ()=>_presenceBadge.usePresenceBadge_unstable,
21
+ CounterBadge: ()=>_counterBadge.CounterBadge,
22
+ counterBadgeClassNames: ()=>_counterBadge.counterBadgeClassNames,
23
+ useCounterBadgeStyles_unstable: ()=>_counterBadge.useCounterBadgeStyles_unstable,
24
+ useCounterBadge_unstable: ()=>_counterBadge.useCounterBadge_unstable
25
+ });
26
+ const _badge = require("./Badge");
27
+ const _presenceBadge = require("./PresenceBadge");
28
+ const _counterBadge = require("./CounterBadge");
29
+ //# sourceMappingURL=index.js.map
30
+
88
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Badge_1","require","Object","defineProperty","exports","enumerable","get","Badge","badgeClassNames","renderBadge_unstable","useBadgeStyles_unstable","useBadge_unstable","PresenceBadge_1","PresenceBadge","presenceBadgeClassNames","usePresenceBadgeStyles_unstable","usePresenceBadge_unstable","CounterBadge_1","CounterBadge","counterBadgeClassNames","useCounterBadgeStyles_unstable","useCounterBadge_unstable"],"sources":["../src/packages/react-components/react-badge/src/index.ts"],"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"],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAO,KAAK;EAAA;AAAA;AAAEL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAQ,eAAe;EAAA;AAAA;AAAEN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAS,oBAAoB;EAAA;AAAA;AAAEP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN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A;AAAA"}
1
+ {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';\nexport { PresenceBadge, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, usePresenceBadge_unstable } from './PresenceBadge';\nexport { CounterBadge, counterBadgeClassNames, useCounterBadgeStyles_unstable, useCounterBadge_unstable } from './CounterBadge';\n//# sourceMappingURL=index.js.map"],"names":["Badge","badgeClassNames","renderBadge_unstable","useBadgeStyles_unstable","useBadge_unstable","PresenceBadge","presenceBadgeClassNames","usePresenceBadgeStyles_unstable","usePresenceBadge_unstable","CounterBadge","counterBadgeClassNames","useCounterBadgeStyles_unstable","useCounterBadge_unstable"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IACxFC,aAAa,MAAbA,4BAAa;IAAEC,uBAAuB,MAAvBA,sCAAuB;IAAEC,+BAA+B,MAA/BA,8CAA+B;IAAEC,yBAAyB,MAAzBA,wCAAyB;IAClGC,YAAY,MAAZA,0BAAY;IAAEC,sBAAsB,MAAtBA,oCAAsB;IAAEC,8BAA8B,MAA9BA,4CAA8B;IAAEC,wBAAwB,MAAxBA,sCAAwB;;uBAFE;+BACU;8BACJ;CAC/G,iCAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-badge",
3
- "version": "9.1.4",
3
+ "version": "9.1.5",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -22,22 +22,22 @@
22
22
  "test": "jest --passWithNoTests",
23
23
  "storybook": "start-storybook",
24
24
  "type-check": "tsc -b tsconfig.json",
25
- "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
25
+ "generate-api": "just-scripts generate-api"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "9.0.0-beta.19",
30
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.20",
31
31
  "@fluentui/scripts-api-extractor": "*",
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-icons": "^2.0.175",
36
- "@fluentui/react-shared-contexts": "^9.3.1",
37
- "@fluentui/react-theme": "^9.1.6",
38
- "@fluentui/react-utilities": "^9.7.1",
35
+ "@fluentui/react-icons": "^2.0.196",
36
+ "@fluentui/react-shared-contexts": "^9.3.2",
37
+ "@fluentui/react-theme": "^9.1.7",
38
+ "@fluentui/react-utilities": "^9.7.2",
39
39
  "@griffel/react": "^1.5.2",
40
- "tslib": "^2.1.0"
40
+ "@swc/helpers": "^0.4.14"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@types/react": ">=16.8.0 <19.0.0",
@@ -54,6 +54,7 @@
54
54
  "exports": {
55
55
  ".": {
56
56
  "types": "./dist/index.d.ts",
57
+ "node": "./lib-commonjs/index.js",
57
58
  "import": "./lib/index.js",
58
59
  "require": "./lib-commonjs/index.js"
59
60
  },
package/lib-amd/Badge.js DELETED
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./components/Badge/index"], function (require, exports, tslib_1, index_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(index_1, exports);
5
- });
6
- //# sourceMappingURL=Badge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-badge/src/Badge.ts"],"names":[],"mappings":";;;IAAA,uCAAyC","sourcesContent":["export * from './components/Badge/index';\n"]}
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./components/CounterBadge/index"], function (require, exports, tslib_1, index_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(index_1, exports);
5
- });
6
- //# sourceMappingURL=CounterBadge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CounterBadge.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-badge/src/CounterBadge.ts"],"names":[],"mappings":";;;IAAA,uCAAgD","sourcesContent":["export * from './components/CounterBadge/index';\n"]}
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./components/PresenceBadge/index"], function (require, exports, tslib_1, index_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(index_1, exports);
5
- });
6
- //# sourceMappingURL=PresenceBadge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PresenceBadge.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-badge/src/PresenceBadge.ts"],"names":[],"mappings":";;;IAAA,uCAAiD","sourcesContent":["export * from './components/PresenceBadge/index';\n"]}
@@ -1,17 +0,0 @@
1
- define(["require", "exports", "react", "./useBadge", "./useBadgeStyles", "@fluentui/react-shared-contexts", "./renderBadge"], function (require, exports, React, useBadge_1, useBadgeStyles_1, react_shared_contexts_1, renderBadge_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Badge = void 0;
5
- /**
6
- * Define a styled Badge, using the `useBadge_unstable` hook.
7
- */
8
- exports.Badge = React.forwardRef(function (props, ref) {
9
- var state = useBadge_1.useBadge_unstable(props, ref);
10
- useBadgeStyles_1.useBadgeStyles_unstable(state);
11
- var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useBadgeStyles_unstable;
12
- useCustomStyles(state);
13
- return renderBadge_1.renderBadge_unstable(state);
14
- });
15
- exports.Badge.displayName = 'Badge';
16
- });
17
- //# sourceMappingURL=Badge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,KAAK,GAAoC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE5C,wCAAuB,CAAC,KAAK,CAAC,CAAC;QAEvB,IAAyB,eAAe,GAAK,oDAA4B,EAAE,wBAAnC,CAAoC;QACpF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\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\n useBadgeStyles_unstable(state);\n\n const { useBadgeStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"]}
@@ -1,5 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- });
5
- //# sourceMappingURL=Badge.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/Badge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type BadgeSlots = {\n root: Slot<'div'>;\n icon?: Slot<'span'>;\n};\n\n// react has a non-standard `color` attribute in its types\n// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a4ab0fa432320e70da9e51c8ae2e47377f65804b/types/react/index.d.ts#L1868\nexport type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & {\n /**\n * A Badge can be filled, outline, ghost, inverted\n * @defaultvalue filled\n */\n appearance?: 'filled' | 'ghost' | 'outline' | 'tint';\n\n /**\n * A Badge can be one of preset colors\n * @defaultvalue brand\n */\n color?: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';\n\n /**\n * A Badge can position the icon before or after the content.\n * @defaultvalue before\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A Badge can be square, circular or rounded.\n * @defaultvalue circular\n */\n shape?: 'circular' | 'rounded' | 'square';\n\n /**\n * A Badge can be on of several preset sizes.\n * @defaultvalue medium\n */\n size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n};\n\nexport type BadgeState = ComponentState<BadgeSlots> &\n Required<Pick<BadgeProps, 'appearance' | 'color' | 'iconPosition' | 'shape' | 'size'>>;\n"]}
@@ -1,9 +0,0 @@
1
- define(["require", "exports", "tslib", "./Badge", "./renderBadge", "./useBadge", "./useBadgeStyles"], function (require, exports, tslib_1, Badge_1, renderBadge_1, useBadge_1, useBadgeStyles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(Badge_1, exports);
5
- tslib_1.__exportStar(renderBadge_1, exports);
6
- tslib_1.__exportStar(useBadge_1, exports);
7
- tslib_1.__exportStar(useBadgeStyles_1, exports);
8
- });
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/index.ts"],"names":[],"mappings":";;;IAAA,uCAAwB;IAGxB,6CAA8B;IAC9B,0CAA2B;IAC3B,gDAAiC","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"]}
@@ -1,14 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.renderBadge_unstable = void 0;
5
- var renderBadge_unstable = function (state) {
6
- var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
7
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
8
- state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
9
- state.root.children,
10
- state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon))));
11
- };
12
- exports.renderBadge_unstable = renderBadge_unstable;
13
- });
14
- //# sourceMappingURL=renderBadge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;IAIO,IAAM,oBAAoB,GAAG,UAAC,KAAiB;QAC9C,IAAA,KAAuB,0BAAQ,CAAa,KAAK,CAAC,EAAhD,KAAK,WAAA,EAAE,SAAS,eAAgC,CAAC;QAEzD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,YAAY,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACnF,KAAK,CAAC,IAAI,CAAC,QAAQ;YACnB,KAAK,CAAC,YAAY,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACxE,CACd,CAAC;IACJ,CAAC,CAAC;IAVW,QAAA,oBAAoB,wBAU/B","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"]}
@@ -1,27 +0,0 @@
1
- define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useBadge_unstable = void 0;
5
- /**
6
- * Returns the props and state required to render the component
7
- */
8
- var useBadge_unstable = function (props, ref) {
9
- var _a = props.shape, shape = _a === void 0 ? 'circular' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.iconPosition, iconPosition = _c === void 0 ? 'before' : _c, _d = props.appearance, appearance = _d === void 0 ? 'filled' : _d, _e = props.color, color = _e === void 0 ? 'brand' : _e;
10
- var state = {
11
- shape: shape,
12
- size: size,
13
- iconPosition: iconPosition,
14
- appearance: appearance,
15
- color: color,
16
- components: {
17
- root: 'div',
18
- icon: 'span',
19
- },
20
- root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
21
- icon: react_utilities_1.resolveShorthand(props.icon),
22
- };
23
- return state;
24
- };
25
- exports.useBadge_unstable = useBadge_unstable;
26
- });
27
- //# sourceMappingURL=useBadge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/useBadge.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAA2B;QAE5E,IAAA,KAKE,KAAK,MALW,EAAlB,KAAK,mBAAG,UAAU,KAAA,EAClB,KAIE,KAAK,KAJQ,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,KAGE,KAAK,aAHgB,EAAvB,YAAY,mBAAG,QAAQ,KAAA,EACvB,KAEE,KAAK,WAFc,EAArB,UAAU,mBAAG,QAAQ,KAAA,EACrB,KACE,KAAK,MADQ,EAAf,KAAK,mBAAG,OAAO,KAAA,CACP;QAEV,IAAM,KAAK,GAAe;YACxB,KAAK,OAAA;YACL,IAAI,MAAA;YACJ,YAAY,cAAA;YACZ,UAAU,YAAA;YACV,KAAK,OAAA;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,MAAM;aACb;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,IACA,KAAK,EACR;YACF,IAAI,EAAE,kCAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;SACnC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA3BW,QAAA,iBAAiB,qBA2B5B","sourcesContent":["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"]}