@fluentui/react-badge 9.0.16 → 9.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/CHANGELOG.json +42 -1
  2. package/CHANGELOG.md +13 -2
  3. package/lib/components/Badge/Badge.js +0 -1
  4. package/lib/components/Badge/Badge.js.map +1 -1
  5. package/lib/components/Badge/renderBadge.js +6 -3
  6. package/lib/components/Badge/renderBadge.js.map +1 -1
  7. package/lib/components/Badge/useBadge.js +0 -1
  8. package/lib/components/Badge/useBadge.js.map +1 -1
  9. package/lib/components/Badge/useBadgeStyles.js +242 -250
  10. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  11. package/lib/components/CounterBadge/CounterBadge.js +0 -1
  12. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  13. package/lib/components/CounterBadge/useCounterBadge.js +2 -4
  14. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  15. package/lib/components/CounterBadge/useCounterBadgeStyles.js +11 -16
  16. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  17. package/lib/components/PresenceBadge/PresenceBadge.js +0 -1
  18. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  19. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
  20. package/lib/components/PresenceBadge/usePresenceBadge.js +2 -10
  21. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  22. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +49 -56
  23. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib-commonjs/Badge.js +0 -2
  26. package/lib-commonjs/Badge.js.map +1 -1
  27. package/lib-commonjs/CounterBadge.js +0 -2
  28. package/lib-commonjs/CounterBadge.js.map +1 -1
  29. package/lib-commonjs/PresenceBadge.js +0 -2
  30. package/lib-commonjs/PresenceBadge.js.map +1 -1
  31. package/lib-commonjs/components/Badge/Badge.js +0 -6
  32. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  33. package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
  34. package/lib-commonjs/components/Badge/index.js +0 -5
  35. package/lib-commonjs/components/Badge/index.js.map +1 -1
  36. package/lib-commonjs/components/Badge/renderBadge.js +6 -7
  37. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  38. package/lib-commonjs/components/Badge/useBadge.js +0 -4
  39. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  40. package/lib-commonjs/components/Badge/useBadgeStyles.js +242 -254
  41. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  42. package/lib-commonjs/components/CounterBadge/CounterBadge.js +0 -6
  43. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  44. package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
  45. package/lib-commonjs/components/CounterBadge/index.js +0 -5
  46. package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
  47. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +2 -7
  48. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  49. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +11 -20
  50. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  51. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +0 -6
  52. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  53. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  54. package/lib-commonjs/components/PresenceBadge/index.js +0 -5
  55. package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
  56. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +0 -2
  57. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
  58. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +2 -15
  59. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  60. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +49 -60
  61. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  62. package/lib-commonjs/index.js +0 -6
  63. package/lib-commonjs/index.js.map +1 -1
  64. package/package.json +5 -5
@@ -4,105 +4,94 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.usePresenceBadgeStyles_unstable = exports.presenceBadgeClassNames = void 0;
7
-
8
7
  const react_1 = /*#__PURE__*/require("@griffel/react");
9
-
10
8
  const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
11
-
12
9
  exports.presenceBadgeClassNames = {
13
10
  root: 'fui-PresenceBadge',
14
11
  icon: 'fui-PresenceBadge__icon'
15
12
  };
16
-
17
13
  const getIsBusy = status => {
18
14
  if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {
19
15
  return true;
20
16
  }
21
-
22
17
  return false;
23
18
  };
24
-
25
19
  const useStyles = /*#__PURE__*/react_1.__styles({
26
- "root": {
27
- "z8tnut": "f1g0x7ka",
28
- "z189sj": ["fhxju0i", "f1cnd47f"],
29
- "Byoj8tv": "f1qch9an",
30
- "uwmqm3": ["f1cnd47f", "fhxju0i"],
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"
20
+ root: {
21
+ z8tnut: "f1g0x7ka",
22
+ z189sj: ["fhxju0i", "f1cnd47f"],
23
+ Byoj8tv: "f1qch9an",
24
+ uwmqm3: ["f1cnd47f", "fhxju0i"],
25
+ mc9l5x: "ftuwxu6",
26
+ B7ck84d: "f1ewtqcl",
27
+ Bt984gj: "f122n59",
28
+ Brf1p80: "f4d9j23",
29
+ Bhmb4qv: "fb8jth9",
30
+ Bbmb7ep: ["fqgqgel", "fchfifz"],
31
+ Beyfa6y: ["fchfifz", "fqgqgel"],
32
+ B7oj6ja: ["fc7b1hi", "f1dpx5h9"],
33
+ Btl43ni: ["f1dpx5h9", "fc7b1hi"],
34
+ De3pzq: "fxugw4r"
41
35
  },
42
- "statusBusy": {
43
- "sj55zd": "fvi85wt"
36
+ statusBusy: {
37
+ sj55zd: "fvi85wt"
44
38
  },
45
- "statusAway": {
46
- "sj55zd": "f14k8a89"
39
+ statusAway: {
40
+ sj55zd: "f14k8a89"
47
41
  },
48
- "statusAvailable": {
49
- "sj55zd": "fqa5hgp"
42
+ statusAvailable: {
43
+ sj55zd: "fqa5hgp"
50
44
  },
51
- "statusOffline": {
52
- "sj55zd": "f11d4kpn"
45
+ statusOffline: {
46
+ sj55zd: "f11d4kpn"
53
47
  },
54
- "statusOutOfOffice": {
55
- "sj55zd": "fdce8r3"
48
+ statusOutOfOffice: {
49
+ sj55zd: "fdce8r3"
56
50
  },
57
- "outOfOffice": {
58
- "sj55zd": "fr0bkrk"
51
+ outOfOffice: {
52
+ sj55zd: "fr0bkrk"
59
53
  },
60
- "outOfOfficeAvailable": {
61
- "sj55zd": "fqa5hgp"
54
+ outOfOfficeAvailable: {
55
+ sj55zd: "fqa5hgp"
62
56
  },
63
- "outOfOfficeBusy": {
64
- "sj55zd": "fvi85wt"
57
+ outOfOfficeBusy: {
58
+ sj55zd: "fvi85wt"
65
59
  },
66
- "outOfOfficeAway": {
67
- "sj55zd": "f14k8a89"
60
+ outOfOfficeAway: {
61
+ sj55zd: "f14k8a89"
68
62
  },
69
- "tiny": {
70
- "Bubjx69": "f9ikmtg",
71
- "a9b677": "f16dn6v3",
72
- "B5pe6w7": "fab5kbq",
73
- "p4uzdd": "f1ms1d91"
63
+ tiny: {
64
+ Bubjx69: "f9ikmtg",
65
+ a9b677: "f16dn6v3",
66
+ B5pe6w7: "fab5kbq",
67
+ p4uzdd: "f1ms1d91"
74
68
  },
75
- "large": {
76
- "Bubjx69": "f9ikmtg",
77
- "a9b677": "f64fuq3",
78
- "B5pe6w7": "f1vfi1yj",
79
- "p4uzdd": "f15s34gz"
69
+ large: {
70
+ Bubjx69: "f9ikmtg",
71
+ a9b677: "f64fuq3",
72
+ B5pe6w7: "f1vfi1yj",
73
+ p4uzdd: "f15s34gz"
80
74
  },
81
- "extraLarge": {
82
- "Bubjx69": "f9ikmtg",
83
- "a9b677": "f1w9dchk",
84
- "B5pe6w7": "f14efy9b",
85
- "p4uzdd": "fhipgdu"
75
+ extraLarge: {
76
+ Bubjx69: "f9ikmtg",
77
+ a9b677: "f1w9dchk",
78
+ B5pe6w7: "f14efy9b",
79
+ p4uzdd: "fhipgdu"
86
80
  }
87
81
  }, {
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;}"]
82
+ 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;}"]
89
83
  });
90
84
  /**
91
85
  * Applies style classnames to slots
92
86
  */
93
-
94
-
95
87
  const usePresenceBadgeStyles_unstable = state => {
96
88
  const styles = useStyles();
97
89
  const isBusy = getIsBusy(state.status);
98
90
  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
91
  if (state.icon) {
101
92
  state.icon.className = react_1.mergeClasses(exports.presenceBadgeClassNames.icon, state.icon.className);
102
93
  }
103
-
104
94
  return state;
105
95
  };
106
-
107
96
  exports.usePresenceBadgeStyles_unstable = usePresenceBadgeStyles_unstable;
108
97
  //# sourceMappingURL=usePresenceBadgeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAKa,OAAA,CAAA,uBAAA,GAAsD;EACjE,IAAI,EAAE,mBAD2D;EAEjE,IAAI,EAAE;AAF2D,CAAtD;;AAKb,MAAM,SAAS,GAAI,MAAD,IAAyC;EACzD,IAAI,MAAM,KAAK,MAAX,IAAqB,MAAM,KAAK,gBAAhC,IAAoD,MAAM,KAAK,SAAnE,EAA8E;IAC5E,OAAO,IA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,CAAC,eAVjB,EAWrB,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,MAAtC,IAAgD,MAAM,CAAC,eAXlC,EAYrB,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,SAAtC,IAAmD,MAAM,CAAC,aAZrC,EAarB,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,eAAtC,IAAyD,MAAM,CAAC,iBAb3C,EAcrB,KAAK,CAAC,IAAN,KAAe,MAAf,IAAyB,MAAM,CAAC,IAdX,EAerB,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,KAfZ,EAgBrB,KAAK,CAAC,IAAN,KAAe,aAAf,IAAgC,MAAM,CAAC,UAhBlB,EAiBrB,KAAK,CAAC,IAAN,CAAW,SAjBU,CAAvB;;EAoBA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,uBAAA,CAAwB,IAArC,EAA2C,KAAK,CAAC,IAAN,CAAW,SAAtD,CAAvB;EACD;;EAED,OAAO,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/"}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAKaA,+BAAuB,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,SAAS,gBAAGC,gBAAU;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAqE1B;AAEF;;;AAGO,MAAMC,+BAA+B,GAAIC,KAAyB,IAAwB;EAC/F,MAAMC,MAAM,GAAGJ,SAAS,EAAE;EAC1B,MAAMK,MAAM,GAAGP,SAAS,CAACK,KAAK,CAACJ,MAAM,CAAC;EACtCI,KAAK,CAACP,IAAI,CAACU,SAAS,GAAGL,oBAAY,CACjCN,+BAAuB,CAACC,IAAI,EAC5BQ,MAAM,CA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","root","icon","getIsBusy","status","useStyles","react_1","usePresenceBadgeStyles_unstable","state","styles","isBusy","className","statusBusy","statusAway","statusAvailable","statusOffline","statusOutOfOffice","outOfOffice","outOfOfficeAvailable","outOfOfficeBusy","outOfOfficeAway","size","tiny","large","extraLarge"],"sourceRoot":"../src/","sources":["packages/react-components/react-badge/src/components/PresenceBadge/usePresenceBadgeStyles.ts"],"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"]}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
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
-
8
7
  var Badge_1 = /*#__PURE__*/require("./Badge");
9
-
10
8
  Object.defineProperty(exports, "Badge", {
11
9
  enumerable: true,
12
10
  get: function () {
@@ -37,9 +35,7 @@ Object.defineProperty(exports, "useBadge_unstable", {
37
35
  return Badge_1.useBadge_unstable;
38
36
  }
39
37
  });
40
-
41
38
  var PresenceBadge_1 = /*#__PURE__*/require("./PresenceBadge");
42
-
43
39
  Object.defineProperty(exports, "PresenceBadge", {
44
40
  enumerable: true,
45
41
  get: function () {
@@ -64,9 +60,7 @@ Object.defineProperty(exports, "usePresenceBadge_unstable", {
64
60
  return PresenceBadge_1.usePresenceBadge_unstable;
65
61
  }
66
62
  });
67
-
68
63
  var CounterBadge_1 = /*#__PURE__*/require("./CounterBadge");
69
-
70
64
  Object.defineProperty(exports, "CounterBadge", {
71
65
  enumerable: true,
72
66
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,KAAA;EAAK;AAAL,CAAA;AAAO,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,eAAA;EAAe;AAAf,CAAA;AAAiB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,CAAA,oBAAA;EAAoB;AAApB,CAAA;AAAsB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,OAAA,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AA,CAAA,OAAA,EAAA,gCAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,cAAA,CAAA,8BAAA;EAA8B;AAA9B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,cAAA,CAAA,wBAAA;EAAwB;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/"}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,sCAAuB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AAEjG;AACEF;EAAAC;EAAAC;IAAA,oCAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,8CAAuB;EAAA;AAAA;AACvBF;EAAAC;EAAAC;IAAA,sDAA+B;EAAA;AAAA;AAC/BF;EAAAC;EAAAC;IAAA,gDAAyB;EAAA;AAAA;AAG3B;AACEF;EAAAC;EAAAC;IAAA,kCAAY;EAAA;AAAA;AACZF;EAAAC;EAAAC;IAAA,4CAAsB;EAAA;AAAA;AACtBF;EAAAC;EAAAC;IAAA,oDAA8B;EAAA;AAAA;AAC9BF;EAAAC;EAAAC;IAAA,8CAAwB;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-badge",
3
- "version": "9.0.16",
3
+ "version": "9.0.17",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -27,14 +27,14 @@
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "9.0.0-beta.18",
31
- "@fluentui/scripts": "^1.0.0"
30
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.19",
31
+ "@fluentui/scripts": "*"
32
32
  },
33
33
  "dependencies": {
34
34
  "@fluentui/react-icons": "^2.0.175",
35
- "@griffel/react": "^1.4.2",
35
+ "@griffel/react": "^1.5.2",
36
36
  "@fluentui/react-theme": "^9.1.5",
37
- "@fluentui/react-utilities": "^9.3.0",
37
+ "@fluentui/react-utilities": "^9.3.1",
38
38
  "tslib": "^2.1.0"
39
39
  },
40
40
  "peerDependencies": {