@fluentui/react-badge 9.3.2 → 9.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -2
- package/lib/Badge.js.map +1 -1
- package/lib/CounterBadge.js.map +1 -1
- package/lib/PresenceBadge.js.map +1 -1
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.js.map +1 -1
- package/lib/components/Badge/index.js.map +1 -1
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.styles.raw.js +292 -0
- package/lib/components/Badge/useBadgeStyles.styles.raw.js.map +1 -0
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib/components/CounterBadge/index.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.styles.raw.js +28 -0
- package/lib/components/CounterBadge/useCounterBadgeStyles.styles.raw.js.map +1 -0
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib/components/PresenceBadge/index.js.map +1 -1
- package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.styles.raw.js +104 -0
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.styles.raw.js.map +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
- package/lib-commonjs/components/Badge/index.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.styles.raw.js +302 -0
- package/lib-commonjs/components/Badge/useBadgeStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.styles.raw.js +44 -0
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.styles.raw.js +120 -0
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["usePresenceBadgeStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, 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 = makeResetStyles({\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: tokens.borderRadiusCircular,\n backgroundColor: tokens.colorNeutralBackground1,\n // The background color bleeds around the edge of the icon due to antialiasing on the svg and element background.\n // Since all presence icons have a border around the edge that is at least 1px wide*, we can inset the background\n // using padding and backgroundClip. The icon has margin: -1px to account for the padding.\n // (* except size=\"tiny\", where backgroundClip is unset)\n padding: '1px',\n backgroundClip: 'content-box'\n});\nconst useIconClassName = makeResetStyles({\n display: 'flex',\n margin: '-1px'\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 // 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 backgroundClip: 'unset',\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 * Applies style classnames to slots\n */ export const usePresenceBadgeStyles_unstable = (state)=>{\n 'use no memo';\n const rootClassName = useRootClassName();\n const iconClassName = useIconClassName();\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 === 'out-of-office' || state.status === 'away' || state.status === 'offline') && 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, iconClassName, state.icon.className);\n }\n return state;\n};\n"],"names":["
|
1
|
+
{"version":3,"sources":["usePresenceBadgeStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, 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 = makeResetStyles({\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: tokens.borderRadiusCircular,\n backgroundColor: tokens.colorNeutralBackground1,\n // The background color bleeds around the edge of the icon due to antialiasing on the svg and element background.\n // Since all presence icons have a border around the edge that is at least 1px wide*, we can inset the background\n // using padding and backgroundClip. The icon has margin: -1px to account for the padding.\n // (* except size=\"tiny\", where backgroundClip is unset)\n padding: '1px',\n backgroundClip: 'content-box'\n});\nconst useIconClassName = makeResetStyles({\n display: 'flex',\n margin: '-1px'\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 // 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 backgroundClip: 'unset',\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 * Applies style classnames to slots\n */ export const usePresenceBadgeStyles_unstable = (state)=>{\n 'use no memo';\n const rootClassName = useRootClassName();\n const iconClassName = useIconClassName();\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 === 'out-of-office' || state.status === 'away' || state.status === 'offline') && 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, iconClassName, state.icon.className);\n }\n return state;\n};\n"],"names":["__resetStyles","__styles","mergeClasses","tokens","presenceBadgeClassNames","root","icon","getIsBusy","status","useRootClassName","useIconClassName","useStyles","statusBusy","sj55zd","statusAway","statusAvailable","statusOffline","statusOutOfOffice","statusUnknown","outOfOffice","outOfOfficeAvailable","outOfOfficeBusy","outOfOfficeUnknown","tiny","Bubjx69","a9b677","B2eet1l","B5pe6w7","p4uzdd","large","extraLarge","d","usePresenceBadgeStyles_unstable","state","rootClassName","iconClassName","styles","isBusy","className","size"],"mappings":";;;;;;;;;;;IAEaI,uBAAuB;;;mCA0FY;eAA/B4B;;;uBA5FyC,gBAAgB;AAEnE,gCAAgC;IACnC3B,IAAI,EAAE,mBAAmB;IACzBC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,SAAS,IAAIC,MAAM,IAAG;IACxB,IAAIA,MAAM,KAAK,MAAM,IAAIA,MAAM,KAAK,gBAAgB,IAAIA,MAAM,KAAK,SAAS,EAAE;QAC1E,OAAO,IAAI;IACf;IACA,OAAO,KAAK;AAChB,CAAC;AACD,MAAMC,gBAAgB,GAAA,WAAA,GAAGT,wBAAA,EAAA,WAAA,MAAA;IAAA;CAaxB,CAAC;AACF,MAAMU,gBAAgB,GAAA,WAAA,OAAGV,oBAAA,EAAA,YAAA,MAAA;IAAA;CAGxB,CAAC;AACF,MAAMW,SAAS,GAAA,WAAA,OAAGV,eAAA,EAAA;IAAAW,UAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;IAAAC,UAAA,EAAA;QAAAD,MAAA,EAAA;IAAA;IAAAE,eAAA,EAAA;QAAAF,MAAA,EAAA;IAAA;IAAAG,aAAA,EAAA;QAAAH,MAAA,EAAA;IAAA;IAAAI,iBAAA,EAAA;QAAAJ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.defineProperty(exports, "__esModule", {
|
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: function() {
|
13
|
+
return presenceBadgeClassNames;
|
14
|
+
},
|
15
|
+
usePresenceBadgeStyles_unstable: function() {
|
16
|
+
return usePresenceBadgeStyles_unstable;
|
17
|
+
}
|
18
|
+
});
|
19
|
+
const _react = require("@griffel/react");
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
21
|
+
const presenceBadgeClassNames = {
|
22
|
+
root: 'fui-PresenceBadge',
|
23
|
+
icon: 'fui-PresenceBadge__icon'
|
24
|
+
};
|
25
|
+
const getIsBusy = (status)=>{
|
26
|
+
if (status === 'busy' || status === 'do-not-disturb' || status === 'blocked') {
|
27
|
+
return true;
|
28
|
+
}
|
29
|
+
return false;
|
30
|
+
};
|
31
|
+
const useRootClassName = (0, _react.makeResetStyles)({
|
32
|
+
display: 'inline-flex',
|
33
|
+
boxSizing: 'border-box',
|
34
|
+
alignItems: 'center',
|
35
|
+
justifyContent: 'center',
|
36
|
+
borderRadius: _reacttheme.tokens.borderRadiusCircular,
|
37
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
|
38
|
+
// The background color bleeds around the edge of the icon due to antialiasing on the svg and element background.
|
39
|
+
// Since all presence icons have a border around the edge that is at least 1px wide*, we can inset the background
|
40
|
+
// using padding and backgroundClip. The icon has margin: -1px to account for the padding.
|
41
|
+
// (* except size="tiny", where backgroundClip is unset)
|
42
|
+
padding: '1px',
|
43
|
+
backgroundClip: 'content-box'
|
44
|
+
});
|
45
|
+
const useIconClassName = (0, _react.makeResetStyles)({
|
46
|
+
display: 'flex',
|
47
|
+
margin: '-1px'
|
48
|
+
});
|
49
|
+
const useStyles = (0, _react.makeStyles)({
|
50
|
+
statusBusy: {
|
51
|
+
color: _reacttheme.tokens.colorPaletteRedBackground3
|
52
|
+
},
|
53
|
+
statusAway: {
|
54
|
+
color: _reacttheme.tokens.colorPaletteMarigoldBackground3
|
55
|
+
},
|
56
|
+
statusAvailable: {
|
57
|
+
color: _reacttheme.tokens.colorPaletteLightGreenForeground3
|
58
|
+
},
|
59
|
+
statusOffline: {
|
60
|
+
color: _reacttheme.tokens.colorNeutralForeground3
|
61
|
+
},
|
62
|
+
statusOutOfOffice: {
|
63
|
+
color: _reacttheme.tokens.colorPaletteBerryForeground3
|
64
|
+
},
|
65
|
+
statusUnknown: {
|
66
|
+
color: _reacttheme.tokens.colorNeutralForeground3
|
67
|
+
},
|
68
|
+
outOfOffice: {
|
69
|
+
color: _reacttheme.tokens.colorNeutralBackground1
|
70
|
+
},
|
71
|
+
outOfOfficeAvailable: {
|
72
|
+
color: _reacttheme.tokens.colorPaletteLightGreenForeground3
|
73
|
+
},
|
74
|
+
outOfOfficeBusy: {
|
75
|
+
color: _reacttheme.tokens.colorPaletteRedBackground3
|
76
|
+
},
|
77
|
+
outOfOfficeUnknown: {
|
78
|
+
color: _reacttheme.tokens.colorNeutralForeground3
|
79
|
+
},
|
80
|
+
// Icons are not resizeable, and these sizes are currently missing
|
81
|
+
// use `!important` to size the currently available icons to the missing ones
|
82
|
+
//
|
83
|
+
tiny: {
|
84
|
+
aspectRatio: '1',
|
85
|
+
width: '6px',
|
86
|
+
backgroundClip: 'unset',
|
87
|
+
'& svg': {
|
88
|
+
width: '6px !important',
|
89
|
+
height: '6px !important'
|
90
|
+
}
|
91
|
+
},
|
92
|
+
large: {
|
93
|
+
aspectRatio: '1',
|
94
|
+
width: '20px',
|
95
|
+
'& svg': {
|
96
|
+
width: '20px !important',
|
97
|
+
height: '20px !important'
|
98
|
+
}
|
99
|
+
},
|
100
|
+
extraLarge: {
|
101
|
+
aspectRatio: '1',
|
102
|
+
width: '28px',
|
103
|
+
'& svg': {
|
104
|
+
width: '28px !important',
|
105
|
+
height: '28px !important'
|
106
|
+
}
|
107
|
+
}
|
108
|
+
});
|
109
|
+
const usePresenceBadgeStyles_unstable = (state)=>{
|
110
|
+
'use no memo';
|
111
|
+
const rootClassName = useRootClassName();
|
112
|
+
const iconClassName = useIconClassName();
|
113
|
+
const styles = useStyles();
|
114
|
+
const isBusy = getIsBusy(state.status);
|
115
|
+
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 === 'out-of-office' || state.status === 'away' || state.status === 'offline') && 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);
|
116
|
+
if (state.icon) {
|
117
|
+
state.icon.className = (0, _react.mergeClasses)(presenceBadgeClassNames.icon, iconClassName, state.icon.className);
|
118
|
+
}
|
119
|
+
return state;
|
120
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/components/PresenceBadge/usePresenceBadgeStyles.styles.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 display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n\n borderRadius: tokens.borderRadiusCircular,\n backgroundColor: tokens.colorNeutralBackground1,\n\n // The background color bleeds around the edge of the icon due to antialiasing on the svg and element background.\n // Since all presence icons have a border around the edge that is at least 1px wide*, we can inset the background\n // using padding and backgroundClip. The icon has margin: -1px to account for the padding.\n // (* except size=\"tiny\", where backgroundClip is unset)\n padding: '1px',\n backgroundClip: 'content-box',\n});\n\nconst useIconClassName = makeResetStyles({\n display: 'flex',\n margin: '-1px',\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 backgroundClip: 'unset', // tiny icons have a border less than 1px wide, and can't use the backgroundClip fix\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 'use no memo';\n\n const rootClassName = useRootClassName();\n const iconClassName = useIconClassName();\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 &&\n (state.status === 'out-of-office' || state.status === 'away' || state.status === 'offline') &&\n 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, iconClassName, state.icon.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","presenceBadgeClassNames","root","icon","getIsBusy","status","useRootClassName","display","boxSizing","alignItems","justifyContent","borderRadius","borderRadiusCircular","backgroundColor","colorNeutralBackground1","padding","backgroundClip","useIconClassName","margin","useStyles","statusBusy","color","colorPaletteRedBackground3","statusAway","colorPaletteMarigoldBackground3","statusAvailable","colorPaletteLightGreenForeground3","statusOffline","colorNeutralForeground3","statusOutOfOffice","colorPaletteBerryForeground3","statusUnknown","outOfOffice","outOfOfficeAvailable","outOfOfficeBusy","outOfOfficeUnknown","tiny","aspectRatio","width","height","large","extraLarge","usePresenceBadgeStyles_unstable","state","rootClassName","iconClassName","styles","isBusy","className","size"],"mappings":";;;;;;;;;;;IAMaI,uBAAAA;;;mCA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O,MAAMM,IAAI,KAAK,WAAWH,OAAON,KAAK,EACtCG,MAAMM,IAAI,KAAK,iBAAiBH,OAAOL,UAAU,EACjDE,MAAMzC,IAAI,CAAC8C,SAAS;IAGtB,IAAIL,MAAMxC,IAAI,EAAE;QACdwC,MAAMxC,IAAI,CAAC6C,SAAS,OAAGjD,mBAAAA,EAAaE,wBAAwBE,IAAI,EAAE0C,eAAeF,MAAMxC,IAAI,CAAC6C,SAAS;IACvG;IAEA,OAAOL;AACT,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../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 presenceAwayRegular,\n presenceAwayFilled,\n presenceAvailableRegular,\n presenceAvailableFilled,\n presenceBlockedRegular,\n presenceBusyFilled,\n presenceDndRegular,\n presenceDndFilled,\n presenceOofRegular,\n presenceOfflineRegular,\n presenceUnknownRegular,\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"],"names":["Badge","
|
1
|
+
{"version":3,"sources":["../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 presenceAwayRegular,\n presenceAwayFilled,\n presenceAvailableRegular,\n presenceAvailableFilled,\n presenceBlockedRegular,\n presenceBusyFilled,\n presenceDndRegular,\n presenceDndFilled,\n presenceOofRegular,\n presenceOfflineRegular,\n presenceUnknownRegular,\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"],"names":["Badge","badgeClassNames","renderBadge_unstable","useBadgeStyles_unstable","useBadge_unstable","PresenceBadge","presenceBadgeClassNames","usePresenceBadgeStyles_unstable","usePresenceBadge_unstable","presenceAwayRegular","presenceAwayFilled","presenceAvailableRegular","presenceAvailableFilled","presenceBlockedRegular","presenceBusyFilled","presenceDndRegular","presenceDndFilled","presenceOofRegular","presenceOfflineRegular","presenceUnknownRegular","CounterBadge","counterBadgeClassNames","useCounterBadgeStyles_unstable","useCounterBadge_unstable"],"mappings":";;;;;;;;;;;IAASA,KAAK;;;IAqBZoB,YAAY;;;;eAlBZf,4BAAa;;;eAHCJ,sBAAe;;IAsB7BoB;mDAAsB;;IAZtBT,uBAAuB;;;;eADvBD,uCAAwB;;;eADxBD,iCAAkB;;;eADlBD,kCAAmB;;;eAHnBH,sCAAuB;;IAOvBO,sBAAsB;;;;eACtBC,iCAAkB;;;eAElBE,gCAAiB;;sBADC;eAAlBD;;;eAGAG,qCAAsB;;sBADJ;eAAlBD;;;eAEAE,qCAAsB;;;eAjBSjB,2BAAoB;;2BAAyB;eAAvBC;;;eAAyBC,wBAAiB;;;eAuB/FkB,4CAA8B;;;eAC9BC,sCAAwB;;;eAnBxBhB,8CAA+B;;;eAC/BC,wCAAyB;;;uBAN8E,UAAU;+BAkB5G,kBAAkB;8BAOlB,iBAAiB"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-badge",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.4.1",
|
4
4
|
"description": "React components for building web experiences",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -19,10 +19,10 @@
|
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"@fluentui/react-icons": "^2.0.245",
|
22
|
-
"@fluentui/react-jsx-runtime": "^9.1.
|
22
|
+
"@fluentui/react-jsx-runtime": "^9.1.3",
|
23
23
|
"@fluentui/react-shared-contexts": "^9.24.0",
|
24
24
|
"@fluentui/react-theme": "^9.1.24",
|
25
|
-
"@fluentui/react-utilities": "^9.
|
25
|
+
"@fluentui/react-utilities": "^9.23.0",
|
26
26
|
"@griffel/react": "^1.5.22",
|
27
27
|
"@swc/helpers": "^0.5.1"
|
28
28
|
},
|