@fluentui/react-badge 9.0.0-rc.9 → 9.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +232 -1
- package/CHANGELOG.md +85 -2
- package/MIGRATION.md +59 -0
- package/README.md +40 -2
- package/Spec.md +11 -74
- package/dist/index.d.ts +3 -16
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.js +0 -1
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.js +119 -98
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +0 -5
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js +12 -11
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +10 -6
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib/index.js +3 -6
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.js +0 -1
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +119 -98
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +1 -6
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +12 -11
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +11 -7
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -22
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -9
@@ -14,13 +14,13 @@ const iconMap = (status, outOfOffice, size) => {
|
|
14
14
|
case 'busy':
|
15
15
|
return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];
|
16
16
|
|
17
|
-
case '
|
17
|
+
case 'do-not-disturb':
|
18
18
|
return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];
|
19
19
|
|
20
20
|
case 'offline':
|
21
21
|
return presenceOfflineRegular[size];
|
22
22
|
|
23
|
-
case '
|
23
|
+
case 'out-of-office':
|
24
24
|
return presenceOofRegular[size];
|
25
25
|
|
26
26
|
case 'unknown':
|
@@ -30,11 +30,11 @@ const iconMap = (status, outOfOffice, size) => {
|
|
30
30
|
|
31
31
|
const DEFAULT_STRINGS = {
|
32
32
|
busy: 'busy',
|
33
|
-
|
33
|
+
'out-of-office': 'out of office',
|
34
34
|
away: 'away',
|
35
35
|
available: 'available',
|
36
36
|
offline: 'offline',
|
37
|
-
|
37
|
+
'do-not-disturb': 'do not disturb',
|
38
38
|
unknown: 'unknown'
|
39
39
|
};
|
40
40
|
/**
|
@@ -42,20 +42,21 @@ const DEFAULT_STRINGS = {
|
|
42
42
|
*/
|
43
43
|
|
44
44
|
export const usePresenceBadge_unstable = (props, ref) => {
|
45
|
-
var _a, _b;
|
45
|
+
var _a, _b, _c;
|
46
46
|
|
47
|
+
const statusText = DEFAULT_STRINGS[(_a = props.status) !== null && _a !== void 0 ? _a : 'available'];
|
48
|
+
const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';
|
47
49
|
const state = { ...useBadge_unstable({
|
48
50
|
size: 'medium',
|
51
|
+
'aria-label': statusText + oofText,
|
52
|
+
role: 'img',
|
49
53
|
...props,
|
50
54
|
icon: resolveShorthand(props.icon, {
|
51
|
-
required: true
|
52
|
-
defaultProps: {
|
53
|
-
'aria-label': props.status && DEFAULT_STRINGS[props.status]
|
54
|
-
}
|
55
|
+
required: true
|
55
56
|
})
|
56
57
|
}, ref),
|
57
|
-
status: (
|
58
|
-
outOfOffice: (
|
58
|
+
status: (_b = props.status) !== null && _b !== void 0 ? _b : 'available',
|
59
|
+
outOfOffice: (_c = props.outOfOffice) !== null && _c !== void 0 ? _c : false
|
59
60
|
};
|
60
61
|
const IconElement = iconMap(state.status, state.outOfOffice, state.size);
|
61
62
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SACE,uBADF,EAEE,wBAFF,EAGE,kBAHF,EAIE,kBAJF,EAKE,iBALF,EAME,kBANF,EAOE,sBAPF,EAQE,kBARF,EASE,sBATF,QAUO,iBAVP;AAWA,SAAS,iBAAT,QAAkC,gBAAlC;;AAGA,MAAM,OAAO,GAAG,CACd,MADc,EAEd,WAFc,EAGd,IAHc,KAIoB;
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SACE,uBADF,EAEE,wBAFF,EAGE,kBAHF,EAIE,kBAJF,EAKE,iBALF,EAME,kBANF,EAOE,sBAPF,EAQE,kBARF,EASE,sBATF,QAUO,iBAVP;AAWA,SAAS,iBAAT,QAAkC,gBAAlC;;AAGA,MAAM,OAAO,GAAG,CACd,MADc,EAEd,WAFc,EAGd,IAHc,KAIoB;EAClC,QAAQ,MAAR;IACE,KAAK,WAAL;MACE,OAAO,WAAW,GAAG,wBAAwB,CAAC,IAAD,CAA3B,GAAoC,uBAAuB,CAAC,IAAD,CAA7E;;IACF,KAAK,MAAL;MACE,OAAO,WAAW,GAAG,sBAAsB,CAAC,IAAD,CAAzB,GAAkC,kBAAkB,CAAC,IAAD,CAAtE;;IACF,KAAK,MAAL;MACE,OAAO,WAAW,GAAG,sBAAsB,CAAC,IAAD,CAAzB,GAAkC,kBAAkB,CAAC,IAAD,CAAtE;;IACF,KAAK,gBAAL;MACE,OAAO,WAAW,GAAG,kBAAkB,CAAC,IAAD,CAArB,GAA8B,iBAAiB,CAAC,IAAD,CAAjE;;IACF,KAAK,SAAL;MACE,OAAO,sBAAsB,CAAC,IAAD,CAA7B;;IACF,KAAK,eAAL;MACE,OAAO,kBAAkB,CAAC,IAAD,CAAzB;;IACF,KAAK,SAAL;MACE,OAAO,sBAAsB,CAAC,IAAD,CAA7B;EAdJ;AAgBD,CArBD;;AAuBA,MAAM,eAAe,GAAG;EACtB,IAAI,EAAE,MADgB;EAEtB,iBAAiB,eAFK;EAGtB,IAAI,EAAE,MAHgB;EAItB,SAAS,EAAE,WAJW;EAKtB,OAAO,EAAE,SALa;EAMtB,kBAAkB,gBANI;EAOtB,OAAO,EAAE;AAPa,CAAxB;AAUA;;AAEG;;AACH,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;EACtB,MAAM,UAAU,GAAG,eAAe,CAAC,CAAA,EAAA,GAAA,KAAK,CAAC,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAAjB,CAAlC;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,eAAtC,GAAwD,IAAI,eAAe,CAAC,eAAD,CAAiB,EAA5F,GAAiG,EAAjH;EACA,MAAM,KAAK,GAAuB,EAChC,GAAG,iBAAiB,CAClB;MACE,IAAI,EAAE,QADR;MAEE,cAAc,UAAU,GAAG,OAF7B;MAGE,IAAI,EAAE,KAHR;MAIE,GAAG,KAJL;MAKE,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;QACjC,QAAQ,EAAE;MADuB,CAAb;IALxB,CADkB,EAUlB,GAVkB,CADY;IAahC,MAAM,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAbQ;IAchC,WAAW,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,WAAN,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,EAAjB,GAAqB;EAdF,CAAlC;EAiBA,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAP,EAAe,KAAK,CAAC,WAArB,EAAkC,KAAK,CAAC,IAAxC,CAA3B;;EACA,IAAI,WAAJ,EAAiB;IACf,KAAK,CAAC,IAAN,CAAY,QAAZ,gBAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;EACD;;EAED,OAAO,KAAP;AACD,CA7BM","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceBusyFilled,\n presenceDndFilled,\n presenceDndRegular,\n presenceOfflineRegular,\n presenceOofRegular,\n presenceUnknownRegular,\n} from './presenceIcons';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';\n\nconst iconMap = (\n status: PresenceBadgeState['status'],\n outOfOffice: boolean,\n size: PresenceBadgeState['size'],\n): React.FunctionComponent | null => {\n switch (status) {\n case 'available':\n return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];\n case 'away':\n return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];\n case 'busy':\n return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];\n case 'do-not-disturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'out-of-office':\n return presenceOofRegular[size];\n case 'unknown':\n return presenceUnknownRegular[size];\n }\n};\n\nconst DEFAULT_STRINGS = {\n busy: 'busy',\n 'out-of-office': 'out of office',\n away: 'away',\n available: 'available',\n offline: 'offline',\n 'do-not-disturb': 'do not disturb',\n unknown: 'unknown',\n};\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge_unstable = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n): PresenceBadgeState => {\n const statusText = DEFAULT_STRINGS[props.status ?? 'available'];\n const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n size: 'medium',\n 'aria-label': statusText + oofText,\n role: 'img',\n ...props,\n icon: resolveShorthand(props.icon, {\n required: true,\n }),\n },\n ref,\n ),\n status: props.status ?? 'available',\n outOfOffice: props.outOfOffice ?? false,\n };\n\n const IconElement = iconMap(state.status, state.outOfOffice, state.size);\n if (IconElement) {\n state.icon!.children = <IconElement />;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,15 +1,18 @@
|
|
1
1
|
import { mergeClasses, __styles, shorthands } from '@griffel/react';
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `presenceBadgeClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
|
7
|
-
export const presenceBadgeClassName = 'fui-PresenceBadge';
|
8
3
|
export const presenceBadgeClassNames = {
|
9
4
|
root: 'fui-PresenceBadge',
|
10
5
|
icon: 'fui-PresenceBadge__icon'
|
11
6
|
};
|
12
7
|
|
8
|
+
const getIsBusy = status => {
|
9
|
+
if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {
|
10
|
+
return true;
|
11
|
+
}
|
12
|
+
|
13
|
+
return false;
|
14
|
+
};
|
15
|
+
|
13
16
|
const useStyles = /*#__PURE__*/__styles({
|
14
17
|
"root": {
|
15
18
|
"z8tnut": "f1g0x7ka",
|
@@ -82,7 +85,8 @@ const useStyles = /*#__PURE__*/__styles({
|
|
82
85
|
|
83
86
|
export const usePresenceBadgeStyles_unstable = state => {
|
84
87
|
const styles = useStyles();
|
85
|
-
|
88
|
+
const isBusy = getIsBusy(state.status);
|
89
|
+
state.root.className = mergeClasses(presenceBadgeClassNames.root, styles.root, isBusy && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'out-of-office' && styles.statusOutOfOffice, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && isBusy && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway, state.outOfOffice && state.status === 'offline' && styles.statusOffline, state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice, state.size === 'tiny' && styles.tiny, state.size === 'large' && styles.large, state.size === 'extra-large' && styles.extraLarge, state.root.className);
|
86
90
|
|
87
91
|
if (state.icon) {
|
88
92
|
state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,YAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAKA
|
1
|
+
{"version":3,"sources":["components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,YAAmC,UAAnC,QAAqD,gBAArD;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAKA,OAAO,MAAM,uBAAuB,GAA+B;EACjE,IAAI,EAAE,mBAD2D;EAEjE,IAAI,EAAE;AAF2D,CAA5D;;AAKP,MAAM,SAAS,GAAI,MAAD,IAAyC;EACzD,IAAI,MAAM,KAAK,MAAX,IAAqB,MAAM,KAAK,gBAAhC,IAAoD,MAAM,KAAK,SAAnE,EAA8E;IAC5E,OAAO,IAAP;EACD;;EAED,OAAO,KAAP;AACD,CAND;;AAQA,MAAM,SAAS,gBAAG;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,EAAlB;AAuEA;;AAEG;;;AACH,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAkD;EAC/F,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,MAAP,CAAxB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,uBAAuB,CAAC,IADS,EAEjC,MAAM,CAAC,IAF0B,EAGjC,MAAM,IAAI,MAAM,CAAC,UAHgB,EAIjC,KAAK,CAAC,MAAN,KAAiB,MAAjB,IAA2B,MAAM,CAAC,UAJD,EAKjC,KAAK,CAAC,MAAN,KAAiB,WAAjB,IAAgC,MAAM,CAAC,eALN,EAMjC,KAAK,CAAC,MAAN,KAAiB,SAAjB,IAA8B,MAAM,CAAC,aANJ,EAOjC,KAAK,CAAC,MAAN,KAAiB,eAAjB,IAAoC,MAAM,CAAC,iBAPV,EAQjC,KAAK,CAAC,WAAN,IAAqB,MAAM,CAAC,WARK,EASjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,WAAtC,IAAqD,MAAM,CAAC,oBAT3B,EAUjC,KAAK,CAAC,WAAN,IAAqB,MAArB,IAA+B,MAAM,CAAC,eAVL,EAWjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,MAAtC,IAAgD,MAAM,CAAC,eAXtB,EAYjC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,SAAtC,IAAmD,MAAM,CAAC,aAZzB,EAajC,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,eAAtC,IAAyD,MAAM,CAAC,iBAb/B,EAcjC,KAAK,CAAC,IAAN,KAAe,MAAf,IAAyB,MAAM,CAAC,IAdC,EAejC,KAAK,CAAC,IAAN,KAAe,OAAf,IAA0B,MAAM,CAAC,KAfA,EAgBjC,KAAK,CAAC,IAAN,KAAe,aAAf,IAAgC,MAAM,CAAC,UAhBN,EAiBjC,KAAK,CAAC,IAAN,CAAW,SAjBsB,CAAnC;;EAoBA,IAAI,KAAK,CAAC,IAAV,EAAgB;IACd,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,uBAAuB,CAAC,IAAzB,EAA+B,KAAK,CAAC,IAAN,CAAW,SAA1C,CAAnC;EACD;;EAED,OAAO,KAAP;AACD,CA5BM","sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { BadgeSlots } from '../Badge/Badge.types';\nimport type { PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge.types';\n\nexport const presenceBadgeClassNames: SlotClassNames<BadgeSlots> = {\n root: 'fui-PresenceBadge',\n icon: 'fui-PresenceBadge__icon',\n};\n\nconst getIsBusy = (status: PresenceBadgeStatus): boolean => {\n if (status === 'busy' || status === 'do-not-disturb' || status === 'unknown') {\n return true;\n }\n\n return false;\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.padding(0),\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n\n '& span': {\n display: 'flex',\n },\n ...shorthands.borderRadius('50%'),\n backgroundColor: tokens.colorNeutralBackground1,\n },\n statusBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n statusAway: {\n color: tokens.colorPaletteMarigoldBackground3,\n },\n statusAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n statusOffline: {\n color: tokens.colorNeutralForeground3,\n },\n statusOutOfOffice: {\n color: tokens.colorPaletteBerryForeground3,\n },\n outOfOffice: {\n color: tokens.colorNeutralBackground1,\n },\n outOfOfficeAvailable: {\n color: tokens.colorPaletteLightGreenForeground3,\n },\n outOfOfficeBusy: {\n color: tokens.colorPaletteRedBackground3,\n },\n outOfOfficeAway: {\n color: tokens.colorPaletteMarigoldBackground3,\n },\n\n // Icons are not resizeable, and these sizes are currently missing\n // use `!important` to size the currently available icons to the missing ones\n //\n tiny: {\n aspectRatio: '1',\n width: '6px',\n '& svg': {\n width: '6px !important',\n height: '6px !important',\n },\n },\n large: {\n aspectRatio: '1',\n width: '20px',\n '& svg': {\n width: '20px !important',\n height: '20px !important',\n },\n },\n extraLarge: {\n aspectRatio: '1',\n width: '28px',\n '& svg': {\n width: '28px !important',\n height: '28px !important',\n },\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const usePresenceBadgeStyles_unstable = (state: PresenceBadgeState): PresenceBadgeState => {\n const styles = useStyles();\n const isBusy = getIsBusy(state.status);\n state.root.className = mergeClasses(\n presenceBadgeClassNames.root,\n styles.root,\n isBusy && styles.statusBusy,\n state.status === 'away' && styles.statusAway,\n state.status === 'available' && styles.statusAvailable,\n state.status === 'offline' && styles.statusOffline,\n state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.outOfOffice && styles.outOfOffice,\n state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable,\n state.outOfOffice && isBusy && styles.outOfOfficeBusy,\n state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway,\n state.outOfOffice && state.status === 'offline' && styles.statusOffline,\n state.outOfOffice && state.status === 'out-of-office' && styles.statusOutOfOffice,\n state.size === 'tiny' && styles.tiny,\n state.size === 'large' && styles.large,\n state.size === 'extra-large' && styles.extraLarge,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(presenceBadgeClassNames.icon, state.icon.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib/index.js
CHANGED
@@ -1,7 +1,4 @@
|
|
1
|
-
export { Badge,
|
2
|
-
|
3
|
-
export {
|
4
|
-
presenceBadgeClassName, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, usePresenceBadge_unstable } from './PresenceBadge';
|
5
|
-
export { CounterBadge, // eslint-disable-next-line deprecation/deprecation
|
6
|
-
counterBadgeClassName, counterBadgeClassNames, useCounterBadgeStyles_unstable, useCounterBadge_unstable } from './CounterBadge';
|
1
|
+
export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';
|
2
|
+
export { PresenceBadge, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, usePresenceBadge_unstable } from './PresenceBadge';
|
3
|
+
export { CounterBadge, counterBadgeClassNames, useCounterBadgeStyles_unstable, useCounterBadge_unstable } from './CounterBadge';
|
7
4
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SAAS,KAAT,EAAgB,eAAhB,EAAiC,oBAAjC,EAAuD,uBAAvD,EAAgF,iBAAhF,QAAyG,SAAzG;AAEA,SACE,aADF,EAEE,uBAFF,EAGE,+BAHF,EAIE,yBAJF,QAKO,iBALP;AAOA,SACE,YADF,EAEE,sBAFF,EAGE,8BAHF,EAIE,wBAJF,QAKO,gBALP","sourcesContent":["export { Badge, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable } from './Badge';\nexport type { BadgeProps, BadgeSlots, BadgeState } from './Badge';\nexport {\n PresenceBadge,\n presenceBadgeClassNames,\n usePresenceBadgeStyles_unstable,\n usePresenceBadge_unstable,\n} from './PresenceBadge';\nexport type { PresenceBadgeProps, PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge';\nexport {\n CounterBadge,\n counterBadgeClassNames,\n useCounterBadgeStyles_unstable,\n useCounterBadge_unstable,\n} from './CounterBadge';\nexport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge';\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;
|
1
|
+
{"version":3,"sources":["components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpF,MAAM,KAAK,GAAG,UAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;EACA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;EAEA,OAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles';\nimport { renderBadge_unstable } from './renderBadge';\nimport type { BadgeProps } from './Badge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const Badge: ForwardRefComponent<BadgeProps> = React.forwardRef((props, ref) => {\n const state = useBadge_unstable(props, ref);\n useBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;
|
1
|
+
{"version":3,"sources":["components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;EACxD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,CAA7B;EAEA,OACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAK,CAAC,IAAzC,IAAiD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADpD,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAK,CAAC,IAAxC,IAAgD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAHnD,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { BadgeState, BadgeSlots } from './Badge.types';\n\nexport const renderBadge_unstable = (state: BadgeState) => {\n const { slots, slotProps } = getSlots<BadgeSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.iconPosition === 'before' && slots.icon && <slots.icon {...slotProps.icon} />}\n {state.root.children}\n {state.iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Badge/useBadge.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;
|
1
|
+
{"version":3,"sources":["components/Badge/useBadge.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;EAC9F,MAAM;IACJ,KAAK,GAAG,UADJ;IAEJ,IAAI,GAAG,QAFH;IAGJ,YAAY,GAAG,QAHX;IAIJ,UAAU,GAAG,QAJT;IAKJ,KAAK,GAAG;EALJ,IAMF,KANJ;EAQA,MAAM,KAAK,GAAe;IACxB,KADwB;IAExB,IAFwB;IAGxB,YAHwB;IAIxB,UAJwB;IAKxB,KALwB;IAMxB,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,IAAI,EAAE;IAFI,CANY;IAUxB,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAA7B,CAVkB;IAcxB,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB;EAdkB,CAA1B;EAiBA,OAAO,KAAP;AACD,CA3BM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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"],"sourceRoot":"../src/"}
|
@@ -3,21 +3,19 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useBadgeStyles_unstable = exports.badgeClassNames =
|
6
|
+
exports.useBadgeStyles_unstable = exports.badgeClassNames = void 0;
|
7
7
|
|
8
8
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
9
|
|
10
10
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
|
-
/**
|
12
|
-
* @deprecated Use `badgeClassNames.root` instead.
|
13
|
-
*/
|
14
|
-
|
15
11
|
|
16
|
-
exports.badgeClassName = 'fui-Badge';
|
17
12
|
exports.badgeClassNames = {
|
18
13
|
root: 'fui-Badge',
|
19
14
|
icon: 'fui-Badge__icon'
|
20
|
-
};
|
15
|
+
}; // The text content of the badge has additional horizontal padding, but there is no `text` slot to add that padding to.
|
16
|
+
// Instead, add extra padding to the root, and a negative margin on the icon to "remove" the extra padding on the icon.
|
17
|
+
|
18
|
+
const textPadding = react_theme_1.tokens.spacingHorizontalXXS;
|
21
19
|
|
22
20
|
const useRootStyles = /*#__PURE__*/react_1.__styles({
|
23
21
|
"base": {
|
@@ -25,77 +23,68 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
25
23
|
"B7ck84d": "f1ewtqcl",
|
26
24
|
"Bt984gj": "f122n59",
|
27
25
|
"Brf1p80": "f4d9j23",
|
26
|
+
"qhf8xq": "f10pi13n",
|
27
|
+
"Bahqtrf": "fk6fouc",
|
28
|
+
"Be2twd7": "fy9rknc",
|
28
29
|
"Bhrd7zp": "fl43uef",
|
29
|
-
"
|
30
|
-
|
31
|
-
|
32
|
-
"ibv6hh": ["f1ojsxk5", "f5tn483"],
|
33
|
-
"icvyot": "fzkkow9",
|
34
|
-
"vrafjx": ["fcdblym", "fjik90z"],
|
35
|
-
"oivjwe": "fg706s2",
|
36
|
-
"wvpqe5": ["fjik90z", "fcdblym"],
|
30
|
+
"Bg96gwp": "fwrc4pm"
|
31
|
+
},
|
32
|
+
"fontSmallToTiny": {
|
37
33
|
"Bahqtrf": "fk6fouc",
|
38
|
-
"
|
34
|
+
"Be2twd7": "f13mqy1h",
|
35
|
+
"Bhrd7zp": "fl43uef",
|
36
|
+
"Bg96gwp": "fcpl73t"
|
39
37
|
},
|
40
38
|
"tiny": {
|
41
39
|
"a9b677": "f16dn6v3",
|
42
40
|
"Bqenvij": "f3mu39s",
|
43
|
-
"Be2twd7": "f130uwy9"
|
41
|
+
"Be2twd7": "f130uwy9",
|
42
|
+
"Bg96gwp": "fod1mrr"
|
44
43
|
},
|
45
44
|
"extra-small": {
|
46
45
|
"a9b677": "fpd43o0",
|
47
46
|
"Bqenvij": "f30q22z",
|
48
|
-
"Be2twd7": "f1tccstq"
|
47
|
+
"Be2twd7": "f1tccstq",
|
48
|
+
"Bg96gwp": "f1y3arg5"
|
49
49
|
},
|
50
50
|
"small": {
|
51
51
|
"Bf4jedk": "fq2vo04",
|
52
52
|
"Bqenvij": "fd461yt",
|
53
|
-
"z8tnut": "
|
54
|
-
"z189sj": ["
|
55
|
-
"Byoj8tv": "
|
56
|
-
"uwmqm3": ["
|
57
|
-
"i8kkvl": "f1q8lukm",
|
58
|
-
"Belr9w4": "f1ma2n7n",
|
59
|
-
"Be2twd7": "f1n0apg3"
|
53
|
+
"z8tnut": "f1g0x7ka",
|
54
|
+
"z189sj": ["fps1v9c", "f17ae1jz"],
|
55
|
+
"Byoj8tv": "f1qch9an",
|
56
|
+
"uwmqm3": ["f17ae1jz", "fps1v9c"]
|
60
57
|
},
|
61
58
|
"medium": {
|
62
59
|
"Bqenvij": "fjamq6b",
|
63
60
|
"Bf4jedk": "f11u7vat",
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"Byoj8tv": "f1y2xyjm",
|
69
|
-
"uwmqm3": ["fycuoez", "f8wuabp"],
|
70
|
-
"Be2twd7": "fnmn6fi"
|
61
|
+
"z8tnut": "f1g0x7ka",
|
62
|
+
"z189sj": ["f17a92cs", "f1pe0i86"],
|
63
|
+
"Byoj8tv": "f1qch9an",
|
64
|
+
"uwmqm3": ["f1pe0i86", "f17a92cs"]
|
71
65
|
},
|
72
66
|
"large": {
|
73
67
|
"Bf4jedk": "f17fgpbq",
|
74
68
|
"Bqenvij": "frvgh55",
|
75
|
-
"z8tnut": "
|
76
|
-
"z189sj": ["
|
77
|
-
"Byoj8tv": "
|
78
|
-
"uwmqm3": ["
|
79
|
-
"Be2twd7": "f1ugzwwg",
|
80
|
-
"i8kkvl": "f1q8lukm",
|
81
|
-
"Belr9w4": "f1ma2n7n"
|
69
|
+
"z8tnut": "f1g0x7ka",
|
70
|
+
"z189sj": ["f17a92cs", "f1pe0i86"],
|
71
|
+
"Byoj8tv": "f1qch9an",
|
72
|
+
"uwmqm3": ["f1pe0i86", "f17a92cs"]
|
82
73
|
},
|
83
74
|
"extra-large": {
|
84
75
|
"Bf4jedk": "fwbmr0d",
|
85
76
|
"Bqenvij": "f1d2rq10",
|
86
|
-
"z8tnut": "
|
87
|
-
"z189sj": ["
|
88
|
-
"Byoj8tv": "
|
89
|
-
"uwmqm3": ["
|
90
|
-
|
91
|
-
|
92
|
-
"
|
93
|
-
"
|
94
|
-
"
|
95
|
-
"
|
96
|
-
|
97
|
-
},
|
98
|
-
"square": {},
|
77
|
+
"z8tnut": "f1g0x7ka",
|
78
|
+
"z189sj": ["fqznh8f", "f1xile11"],
|
79
|
+
"Byoj8tv": "f1qch9an",
|
80
|
+
"uwmqm3": ["f1xile11", "fqznh8f"]
|
81
|
+
},
|
82
|
+
"square": {
|
83
|
+
"Bbmb7ep": ["fzi6hpg", "fyowgf4"],
|
84
|
+
"Beyfa6y": ["fyowgf4", "fzi6hpg"],
|
85
|
+
"B7oj6ja": ["f3fg2lr", "f13av6d4"],
|
86
|
+
"Btl43ni": ["f13av6d4", "f3fg2lr"]
|
87
|
+
},
|
99
88
|
"rounded": {
|
100
89
|
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
101
90
|
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
@@ -109,10 +98,34 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
109
98
|
"Btl43ni": ["f1s4nn1u", "f1rstyi9"]
|
110
99
|
},
|
111
100
|
"circular": {
|
112
|
-
"Bbmb7ep": ["
|
113
|
-
"Beyfa6y": ["
|
114
|
-
"B7oj6ja": ["
|
115
|
-
"Btl43ni": ["
|
101
|
+
"Bbmb7ep": ["f8fbkgy", "f1nfllo7"],
|
102
|
+
"Beyfa6y": ["f1nfllo7", "f8fbkgy"],
|
103
|
+
"B7oj6ja": ["f1djnp8u", "f1s8kh49"],
|
104
|
+
"Btl43ni": ["f1s8kh49", "f1djnp8u"]
|
105
|
+
},
|
106
|
+
"border": {
|
107
|
+
"Bsft5z2": "f13zj6fq",
|
108
|
+
"E3zdtr": "f1mdlcz9",
|
109
|
+
"bn5sak": "frwkxtg",
|
110
|
+
"Eqx8gd": ["f1n6gb5g", "f15yvnhg"],
|
111
|
+
"By385i5": "fo72kxq",
|
112
|
+
"B1piin3": ["f15yvnhg", "f1n6gb5g"],
|
113
|
+
"Bm2nyyq": "f8rth92",
|
114
|
+
"Barhvk9": ["flthirb", "ftkbnf5"],
|
115
|
+
"Bw17bha": "f1lh990p",
|
116
|
+
"vfts7": ["ftkbnf5", "flthirb"],
|
117
|
+
"xrcqlc": "f6czdpx",
|
118
|
+
"Ihftqj": ["f13hvwk3", "f1en4csx"],
|
119
|
+
"Bcgy8vk": "f1i1u9k0",
|
120
|
+
"Bhxzhr1": ["f1en4csx", "f13hvwk3"],
|
121
|
+
"B0n5ga8": "fhtl3ys",
|
122
|
+
"s924m2": ["f140b627", "f1wihoeh"],
|
123
|
+
"B1q35kw": "fplas78",
|
124
|
+
"Gp14am": ["f1wihoeh", "f140b627"],
|
125
|
+
"B3778ie": ["f1lf1ovl", "f1ydfmkj"],
|
126
|
+
"d9w3h3": ["f1ydfmkj", "f1lf1ovl"],
|
127
|
+
"Bl18szs": ["feq0ynf", "f1ss7ivt"],
|
128
|
+
"B4j8arr": ["f1ss7ivt", "feq0ynf"]
|
116
129
|
},
|
117
130
|
"filled": {
|
118
131
|
"g2u3we": "fghlq4f",
|
@@ -122,19 +135,11 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
122
135
|
},
|
123
136
|
"filled-brand": {
|
124
137
|
"De3pzq": "ffp7eso",
|
125
|
-
"sj55zd": "f1phragk"
|
126
|
-
"g2u3we": "f1vp46cd",
|
127
|
-
"h3c5rm": ["f1lxz1cr", "ff8nh0i"],
|
128
|
-
"B9xav0g": "fe9j8it",
|
129
|
-
"zhjwy3": ["ff8nh0i", "f1lxz1cr"]
|
138
|
+
"sj55zd": "f1phragk"
|
130
139
|
},
|
131
140
|
"filled-danger": {
|
132
141
|
"De3pzq": "fdl5y0r",
|
133
|
-
"sj55zd": "f1phragk"
|
134
|
-
"g2u3we": "f11ttmz8",
|
135
|
-
"h3c5rm": ["f1ratw88", "f459ikj"],
|
136
|
-
"B9xav0g": "fvovscg",
|
137
|
-
"zhjwy3": ["f459ikj", "f1ratw88"]
|
142
|
+
"sj55zd": "f1phragk"
|
138
143
|
},
|
139
144
|
"filled-important": {
|
140
145
|
"De3pzq": "f1c73kur",
|
@@ -158,20 +163,11 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
158
163
|
},
|
159
164
|
"filled-warning": {
|
160
165
|
"De3pzq": "ffq97bm",
|
161
|
-
"sj55zd": "
|
162
|
-
"g2u3we": "f1gyeiz5",
|
163
|
-
"h3c5rm": ["f1jnj1iq", "fd1epeu"],
|
164
|
-
"B9xav0g": "f102bkgo",
|
165
|
-
"zhjwy3": ["fd1epeu", "f1jnj1iq"]
|
166
|
-
},
|
167
|
-
"ghost": {
|
168
|
-
"icvyot": "f1ern45e",
|
169
|
-
"vrafjx": ["f1n71otn", "f1deefiw"],
|
170
|
-
"oivjwe": "f1h8hb77",
|
171
|
-
"wvpqe5": ["f1deefiw", "f1n71otn"]
|
166
|
+
"sj55zd": "ff5vbop"
|
172
167
|
},
|
168
|
+
"ghost": {},
|
173
169
|
"ghost-brand": {
|
174
|
-
"sj55zd": "
|
170
|
+
"sj55zd": "f16muhyy"
|
175
171
|
},
|
176
172
|
"ghost-danger": {
|
177
173
|
"sj55zd": "f1whyuy6"
|
@@ -201,7 +197,7 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
201
197
|
"zhjwy3": ["f1p1bl80", "f1gkuv52"]
|
202
198
|
},
|
203
199
|
"outline-brand": {
|
204
|
-
"sj55zd": "
|
200
|
+
"sj55zd": "f16muhyy"
|
205
201
|
},
|
206
202
|
"outline-danger": {
|
207
203
|
"sj55zd": "f1whyuy6"
|
@@ -268,10 +264,10 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
268
264
|
"tint-severe": {
|
269
265
|
"De3pzq": "f1xzsg4",
|
270
266
|
"sj55zd": "f1k5f75o",
|
271
|
-
"g2u3we": "
|
272
|
-
"h3c5rm": ["
|
273
|
-
"B9xav0g": "
|
274
|
-
"zhjwy3": ["
|
267
|
+
"g2u3we": "fxy9dsj",
|
268
|
+
"h3c5rm": ["f54u6j2", "fcm23ze"],
|
269
|
+
"B9xav0g": "f4vf0uq",
|
270
|
+
"zhjwy3": ["fcm23ze", "f54u6j2"]
|
275
271
|
},
|
276
272
|
"tint-subtle": {
|
277
273
|
"De3pzq": "fxugw4r",
|
@@ -284,29 +280,43 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
284
280
|
"tint-success": {
|
285
281
|
"De3pzq": "f2vsrz6",
|
286
282
|
"sj55zd": "ffmvakt",
|
287
|
-
"g2u3we": "
|
288
|
-
"h3c5rm": ["
|
289
|
-
"B9xav0g": "
|
290
|
-
"zhjwy3": ["
|
283
|
+
"g2u3we": "fdmic9h",
|
284
|
+
"h3c5rm": ["f196y6m", "fetptd8"],
|
285
|
+
"B9xav0g": "f1pev5xq",
|
286
|
+
"zhjwy3": ["fetptd8", "f196y6m"]
|
291
287
|
},
|
292
288
|
"tint-warning": {
|
293
289
|
"De3pzq": "f10s6hli",
|
294
290
|
"sj55zd": "fpti2h4",
|
295
|
-
"g2u3we": "
|
296
|
-
"h3c5rm": ["
|
297
|
-
"B9xav0g": "
|
298
|
-
"zhjwy3": ["
|
291
|
+
"g2u3we": "fn9i3n",
|
292
|
+
"h3c5rm": ["f1aw8cx4", "f51if14"],
|
293
|
+
"B9xav0g": "fvq8iai",
|
294
|
+
"zhjwy3": ["f51if14", "f1aw8cx4"]
|
299
295
|
}
|
300
296
|
}, {
|
301
|
-
"d": [".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;}", ".
|
297
|
+
"d": [".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;}", ".f10pi13n{position:relative;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".fcpl73t{line-height:var(--lineHeightBase100);}", ".f16dn6v3{width:6px;}", ".f3mu39s{height:6px;}", ".f130uwy9{font-size:4px;}", ".fod1mrr{line-height:4px;}", ".fpd43o0{width:10px;}", ".f30q22z{height:10px;}", ".f1tccstq{font-size:6px;}", ".f1y3arg5{line-height:6px;}", ".fq2vo04{min-width:16px;}", ".fd461yt{height:16px;}", ".f1g0x7ka{padding-top:0;}", ".fps1v9c{padding-right:calc(var(--spacingHorizontalXXS) + var(--spacingHorizontalXXS));}", ".f17ae1jz{padding-left:calc(var(--spacingHorizontalXXS) + var(--spacingHorizontalXXS));}", ".f1qch9an{padding-bottom:0;}", ".fjamq6b{height:20px;}", ".f11u7vat{min-width:20px;}", ".f17a92cs{padding-right:calc(var(--spacingHorizontalXS) + var(--spacingHorizontalXXS));}", ".f1pe0i86{padding-left:calc(var(--spacingHorizontalXS) + var(--spacingHorizontalXXS));}", ".f17fgpbq{min-width:24px;}", ".frvgh55{height:24px;}", ".fwbmr0d{min-width:32px;}", ".f1d2rq10{height:32px;}", ".fqznh8f{padding-right:calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", ".f1xile11{padding-left:calc(var(--spacingHorizontalSNudge) + var(--spacingHorizontalXXS));}", ".fzi6hpg{border-bottom-right-radius:var(--borderRadiusNone);}", ".fyowgf4{border-bottom-left-radius:var(--borderRadiusNone);}", ".f3fg2lr{border-top-right-radius:var(--borderRadiusNone);}", ".f13av6d4{border-top-left-radius:var(--borderRadiusNone);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1g3puop{border-bottom-right-radius:var(--borderRadiusSmall);}", ".fi2rrw2{border-bottom-left-radius:var(--borderRadiusSmall);}", ".f1rstyi9{border-top-right-radius:var(--borderRadiusSmall);}", ".f1s4nn1u{border-top-left-radius:var(--borderRadiusSmall);}", ".f8fbkgy{border-bottom-right-radius:var(--borderRadiusCircular);}", ".f1nfllo7{border-bottom-left-radius:var(--borderRadiusCircular);}", ".f1djnp8u{border-top-right-radius:var(--borderRadiusCircular);}", ".f1s8kh49{border-top-left-radius:var(--borderRadiusCircular);}", ".f13zj6fq::after{content:\"\";}", ".f1mdlcz9::after{position:absolute;}", ".frwkxtg::after{top:0;}", ".f1n6gb5g::after{left:0;}", ".f15yvnhg::after{right:0;}", ".fo72kxq::after{bottom:0;}", ".f8rth92::after{border-top-style:solid;}", ".flthirb::after{border-right-style:solid;}", ".ftkbnf5::after{border-left-style:solid;}", ".f1lh990p::after{border-bottom-style:solid;}", ".f6czdpx::after{border-top-width:var(--strokeWidthThin);}", ".f13hvwk3::after{border-right-width:var(--strokeWidthThin);}", ".f1en4csx::after{border-left-width:var(--strokeWidthThin);}", ".f1i1u9k0::after{border-bottom-width:var(--strokeWidthThin);}", ".fhtl3ys::after{border-top-color:inherit;}", ".f140b627::after{border-right-color:inherit;}", ".f1wihoeh::after{border-left-color:inherit;}", ".fplas78::after{border-bottom-color:inherit;}", ".f1lf1ovl::after{border-bottom-right-radius:inherit;}", ".f1ydfmkj::after{border-bottom-left-radius:inherit;}", ".feq0ynf::after{border-top-right-radius:inherit;}", ".f1ss7ivt::after{border-top-left-radius:inherit;}", ".fghlq4f{border-top-color:var(--colorTransparentStroke);}", ".f1gn591s{border-right-color:var(--colorTransparentStroke);}", ".fjscplz{border-left-color:var(--colorTransparentStroke);}", ".fb073pr{border-bottom-color:var(--colorTransparentStroke);}", ".ffp7eso{background-color:var(--colorBrandBackground);}", ".f1phragk{color:var(--colorNeutralForegroundOnBrand);}", ".fdl5y0r{background-color:var(--colorPaletteRedBackground3);}", ".f1c73kur{background-color:var(--colorNeutralForeground1);}", ".fr0bkrk{color:var(--colorNeutralBackground1);}", ".f3vzo32{background-color:var(--colorNeutralBackground5);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f1s438gw{background-color:var(--colorPaletteDarkOrangeBackground3);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".flxk52p{background-color:var(--colorPaletteGreenBackground3);}", ".ffq97bm{background-color:var(--colorPaletteYellowBackground3);}", ".ff5vbop{color:var(--colorNeutralForeground1Static);}", ".f16muhyy{color:var(--colorBrandForeground1);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".f1l8vj45{color:var(--colorPaletteDarkOrangeForeground3);}", ".fqpbvvt{color:var(--colorNeutralForegroundInverted);}", ".f1m7fhi8{color:var(--colorPaletteGreenForeground3);}", ".fpti2h4{color:var(--colorPaletteYellowForeground2);}", ".f23ftbb{border-top-color:currentColor;}", ".f1gkuv52{border-right-color:currentColor;}", ".f1p1bl80{border-left-color:currentColor;}", ".fioka3i{border-bottom-color:currentColor;}", ".fq0vr37{border-top-color:var(--colorNeutralStrokeAccessible);}", ".f1byw159{border-right-color:var(--colorNeutralStrokeAccessible);}", ".f11cr0be{border-left-color:var(--colorNeutralStrokeAccessible);}", ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f68mrw8{border-top-color:var(--colorNeutralStroke2);}", ".f7pw515{border-right-color:var(--colorNeutralStroke2);}", ".fw35ms5{border-left-color:var(--colorNeutralStroke2);}", ".frpde29{border-bottom-color:var(--colorNeutralStroke2);}", ".f1sms7z7{color:var(--colorPaletteGreenForeground2);}", ".f16xkysk{background-color:var(--colorBrandBackground2);}", ".faj9fo0{color:var(--colorBrandForeground2);}", ".f161y7kd{border-top-color:var(--colorBrandStroke2);}", ".f1c8dzaj{border-right-color:var(--colorBrandStroke2);}", ".f1sl6hi9{border-left-color:var(--colorBrandStroke2);}", ".f1619yhw{border-bottom-color:var(--colorBrandStroke2);}", ".ff0poqj{background-color:var(--colorPaletteRedBackground1);}", ".f1hcrxcs{color:var(--colorPaletteRedForeground1);}", ".f1oqjm8o{border-top-color:var(--colorPaletteRedBorder1);}", ".fkgrb8g{border-right-color:var(--colorPaletteRedBorder1);}", ".frb5wm0{border-left-color:var(--colorPaletteRedBorder1);}", ".f1iai1ph{border-bottom-color:var(--colorPaletteRedBorder1);}", ".f945g0u{background-color:var(--colorNeutralForeground3);}", ".f1ctqxl6{background-color:var(--colorNeutralBackground4);}", ".f1xzsg4{background-color:var(--colorPaletteDarkOrangeBackground1);}", ".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}", ".fxy9dsj{border-top-color:var(--colorPaletteDarkOrangeBorder1);}", ".f54u6j2{border-right-color:var(--colorPaletteDarkOrangeBorder1);}", ".fcm23ze{border-left-color:var(--colorPaletteDarkOrangeBorder1);}", ".f4vf0uq{border-bottom-color:var(--colorPaletteDarkOrangeBorder1);}", ".f2vsrz6{background-color:var(--colorPaletteGreenBackground1);}", ".ffmvakt{color:var(--colorPaletteGreenForeground1);}", ".fdmic9h{border-top-color:var(--colorPaletteGreenBorder1);}", ".f196y6m{border-right-color:var(--colorPaletteGreenBorder1);}", ".fetptd8{border-left-color:var(--colorPaletteGreenBorder1);}", ".f1pev5xq{border-bottom-color:var(--colorPaletteGreenBorder1);}", ".f10s6hli{background-color:var(--colorPaletteYellowBackground1);}", ".fn9i3n{border-top-color:var(--colorPaletteYellowBorder1);}", ".f1aw8cx4{border-right-color:var(--colorPaletteYellowBorder1);}", ".f51if14{border-left-color:var(--colorPaletteYellowBorder1);}", ".fvq8iai{border-bottom-color:var(--colorPaletteYellowBorder1);}"]
|
302
298
|
});
|
303
299
|
|
304
300
|
const useIconStyles = /*#__PURE__*/react_1.__styles({
|
305
301
|
"base": {
|
306
302
|
"mc9l5x": "f22iagw",
|
307
|
-
"
|
308
|
-
"
|
309
|
-
"
|
303
|
+
"Bg96gwp": "fp6vxd",
|
304
|
+
"B6of3ja": "f1hu3pq6",
|
305
|
+
"t21cq0": ["fqq8nkd", "f1fdzpd1"],
|
306
|
+
"jrapky": "f19f4twv",
|
307
|
+
"Frg6f3": ["f1fdzpd1", "fqq8nkd"]
|
308
|
+
},
|
309
|
+
"beforeText": {
|
310
|
+
"t21cq0": ["f1t8l4o1", "f11juvx6"]
|
311
|
+
},
|
312
|
+
"afterText": {
|
313
|
+
"Frg6f3": ["f11juvx6", "f1t8l4o1"]
|
314
|
+
},
|
315
|
+
"beforeTextXL": {
|
316
|
+
"t21cq0": ["f1rs9grm", "f1kwmkpi"]
|
317
|
+
},
|
318
|
+
"afterTextXL": {
|
319
|
+
"Frg6f3": ["f1kwmkpi", "f1rs9grm"]
|
310
320
|
},
|
311
321
|
"tiny": {
|
312
322
|
"Be2twd7": "f1tccstq"
|
@@ -327,7 +337,7 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
|
|
327
337
|
"Be2twd7": "fe5j1ua"
|
328
338
|
}
|
329
339
|
}, {
|
330
|
-
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".
|
340
|
+
"d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fp6vxd{line-height:1;}", ".f1hu3pq6{margin-top:0;}", ".fqq8nkd{margin-right:calc(-1 * var(--spacingHorizontalXXS));}", ".f1fdzpd1{margin-left:calc(-1 * var(--spacingHorizontalXXS));}", ".f19f4twv{margin-bottom:0;}", ".f1t8l4o1{margin-right:calc(var(--spacingHorizontalXXS) + var(--spacingHorizontalXXS));}", ".f11juvx6{margin-left:calc(var(--spacingHorizontalXXS) + var(--spacingHorizontalXXS));}", ".f1rs9grm{margin-right:calc(var(--spacingHorizontalXS) + var(--spacingHorizontalXXS));}", ".f1kwmkpi{margin-left:calc(var(--spacingHorizontalXS) + var(--spacingHorizontalXXS));}", ".f1tccstq{font-size:6px;}", ".fnmn6fi{font-size:10px;}", ".f1ugzwwg{font-size:12px;}", ".f4ybsrx{font-size:16px;}", ".fe5j1ua{font-size:20px;}"]
|
331
341
|
});
|
332
342
|
/**
|
333
343
|
* Applies style classnames to slots
|
@@ -336,11 +346,22 @@ const useIconStyles = /*#__PURE__*/react_1.__styles({
|
|
336
346
|
|
337
347
|
const useBadgeStyles_unstable = state => {
|
338
348
|
const rootStyles = useRootStyles();
|
339
|
-
|
349
|
+
const smallToTiny = state.size === 'small' || state.size === 'extra-small' || state.size === 'tiny';
|
350
|
+
state.root.className = react_1.mergeClasses(exports.badgeClassNames.root, rootStyles.base, smallToTiny && rootStyles.fontSmallToTiny, rootStyles[state.size], rootStyles[state.shape], state.shape === 'rounded' && smallToTiny && rootStyles.roundedSmallToTiny, state.appearance !== 'ghost' && rootStyles.border, rootStyles[state.appearance], rootStyles[`${state.appearance}-${state.color}`], state.root.className);
|
340
351
|
const iconStyles = useIconStyles();
|
341
352
|
|
342
353
|
if (state.icon) {
|
343
|
-
|
354
|
+
let iconPositionClass;
|
355
|
+
|
356
|
+
if (state.root.children) {
|
357
|
+
if (state.size === 'extra-large') {
|
358
|
+
iconPositionClass = state.iconPosition === 'after' ? iconStyles.afterTextXL : iconStyles.beforeTextXL;
|
359
|
+
} else {
|
360
|
+
iconPositionClass = state.iconPosition === 'after' ? iconStyles.afterText : iconStyles.beforeText;
|
361
|
+
}
|
362
|
+
}
|
363
|
+
|
364
|
+
state.icon.className = react_1.mergeClasses(exports.badgeClassNames.icon, iconStyles.base, iconPositionClass, iconStyles[state.size], state.icon.className);
|
344
365
|
}
|
345
366
|
|
346
367
|
return state;
|