@fluentui/react-badge 0.0.0-nightly-20221117-0420.1 → 0.0.0-nightly-20221121-0425.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.json +44 -9
- package/CHANGELOG.md +18 -7
- package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js +13 -12
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +13 -12
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"name": "@fluentui/react-badge",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-badge_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Mon, 21 Nov 2022 04:32:01 GMT",
|
6
|
+
"tag": "@fluentui/react-badge_v0.0.0-nightly-20221121-0425.1",
|
7
|
+
"version": "0.0.0-nightly-20221121-0425.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
@@ -16,20 +16,55 @@
|
|
16
16
|
{
|
17
17
|
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-badge",
|
19
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
20
|
-
"commit": "
|
19
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20221121-0425.1",
|
20
|
+
"commit": "a6a0d9b8213bc50861a30b847ff642e7f13ddce1"
|
21
21
|
},
|
22
22
|
{
|
23
23
|
"author": "beachball",
|
24
24
|
"package": "@fluentui/react-badge",
|
25
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
26
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20221121-0425.1",
|
26
|
+
"commit": "a6a0d9b8213bc50861a30b847ff642e7f13ddce1"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"author": "beachball",
|
30
30
|
"package": "@fluentui/react-badge",
|
31
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
32
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221121-0425.1",
|
32
|
+
"commit": "a6a0d9b8213bc50861a30b847ff642e7f13ddce1"
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"date": "Thu, 17 Nov 2022 23:05:34 GMT",
|
39
|
+
"tag": "@fluentui/react-badge_v9.0.13",
|
40
|
+
"version": "9.0.13",
|
41
|
+
"comments": {
|
42
|
+
"patch": [
|
43
|
+
{
|
44
|
+
"author": "behowell@microsoft.com",
|
45
|
+
"package": "@fluentui/react-badge",
|
46
|
+
"commit": "38cbc51623baf411e5379936c050f0b2c53ecc54",
|
47
|
+
"comment": "chore: Update Badge colors with new mappings from design"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"author": "humberto_makoto@hotmail.com",
|
51
|
+
"package": "@fluentui/react-badge",
|
52
|
+
"commit": "fc94f09d58f1bb48bb8bdcc562d9a8fc5b801e98",
|
53
|
+
"comment": "fix: Allow PresenceBadge's icon to be overridden by the user."
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"author": "beachball",
|
57
|
+
"package": "@fluentui/react-badge",
|
58
|
+
"comment": "Bump @fluentui/react-utilities to v9.2.2",
|
59
|
+
"commit": "94e156be5d3b5790d82dccf08c32672733fb9335"
|
60
|
+
}
|
61
|
+
],
|
62
|
+
"none": [
|
63
|
+
{
|
64
|
+
"author": "martinhochel@microsoft.com",
|
65
|
+
"package": "@fluentui/react-badge",
|
66
|
+
"commit": "ea768501802d65d63ddc63fff3816fb6b5008ae4",
|
67
|
+
"comment": "chore: update package scaffold"
|
33
68
|
}
|
34
69
|
]
|
35
70
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,31 @@
|
|
1
1
|
# Change Log - @fluentui/react-badge
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 21 Nov 2022 04:32:01 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20221121-0425.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v0.0.0-nightly-20221121-0425.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.0.
|
9
|
+
Mon, 21 Nov 2022 04:32:01 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.0.13..@fluentui/react-badge_v0.0.0-nightly-20221121-0425.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20221121-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/a6a0d9b8213bc50861a30b847ff642e7f13ddce1) by beachball)
|
16
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20221121-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/a6a0d9b8213bc50861a30b847ff642e7f13ddce1) by beachball)
|
17
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221121-0425.1 ([commit](https://github.com/microsoft/fluentui/commit/a6a0d9b8213bc50861a30b847ff642e7f13ddce1) by beachball)
|
18
|
+
|
19
|
+
## [9.0.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v9.0.13)
|
20
|
+
|
21
|
+
Thu, 17 Nov 2022 23:05:34 GMT
|
22
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.0.12..@fluentui/react-badge_v9.0.13)
|
23
|
+
|
24
|
+
### Patches
|
25
|
+
|
26
|
+
- chore: Update Badge colors with new mappings from design ([PR #25599](https://github.com/microsoft/fluentui/pull/25599) by behowell@microsoft.com)
|
27
|
+
- fix: Allow PresenceBadge's icon to be overridden by the user. ([PR #25684](https://github.com/microsoft/fluentui/pull/25684) by humberto_makoto@hotmail.com)
|
28
|
+
- Bump @fluentui/react-utilities to v9.2.2 ([PR #25683](https://github.com/microsoft/fluentui/pull/25683) by beachball)
|
18
29
|
|
19
30
|
## [9.0.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v9.0.12)
|
20
31
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":"AACA,SACE,0BADF,EAEE,0BAFF,EAGE,0BAHF,EAIE,yBAJF,EAKE,yBALF,EAME,yBANF,EAOE,oBAPF,EAQE,oBARF,EASE,oBATF,EAUE,oBAVF,EAWE,oBAXF,EAYE,oBAZF,EAaE,oBAbF,EAcE,oBAdF,EAeE,oBAfF,EAgBE,mBAhBF,EAiBE,mBAjBF,EAkBE,mBAlBF,EAmBE,oBAnBF,EAoBE,oBApBF,EAqBE,oBArBF,EAsBE,wBAtBF,EAuBE,wBAvBF,EAwBE,wBAxBF,EAyBE,wBAzBF,EA0BE,wBA1BF,EA2BE,wBA3BF,QA4BO,uBA5BP;AA+BA,OAAO,MAAM,kBAAkB,
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":"AACA,SACE,0BADF,EAEE,0B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A,eAAe;AAZ8E,CAAxF;AAeP,OAAO,MAAM,iBAAiB,GAAgE;EAC5F;EACA;EACA,IAAI,EAAE,mBAHsF;EAI5F,eAAe,mBAJ6E;EAK5F,KAAK,EAAE,mBALqF;EAM5F,MAAM,EAAE,mBANoF;EAO5F;EACA;EACA,KAAK,EAAE,mBATqF;EAU5F;EACA;EACA,eAAe;AAZ6E,CAAvF;AAeP,OAAO,MAAM,kBAAkB,GAAgE;EAC7F;EACA;EACA,IAAI,EAAE,oBAHuF;EAI7F,eAAe,oBAJ8E;EAK7F,KAAK,EAAE,oBALsF;EAM7F,MAAM,EAAE,oBANqF;EAO7F;EACA;EACA,KAAK,EAAE,oBATsF;EAU7F;EACA;EACA,eAAe;AAZ8E,CAAxF;AAeP,OAAO,MAAM,kBAAkB,GAAgE;EAC7F;EACA;EACA,IAAI,EAAE,oBAHuF;EAI7F,eAAe,oBAJ8E;EAK7F,KAAK,EAAE,oBALsF;EAM7F,MAAM,EAAE,oBANqF;EAO7F;EACA;EACA,KAAK,EAAE,oBATsF;EAU7F;EACA;EACA,eAAe;AAZ8E,CAAxF;AAeP,OAAO,MAAM,sBAAsB,GAAgE;EACjG;EACA;EACA,IAAI,EAAE,wBAH2F;EAIjG,eAAe,wBAJkF;EAKjG,KAAK,EAAE,wBAL0F;EAMjG,MAAM,EAAE,wBANyF;EAOjG;EACA;EACA,KAAK,EAAE,wBAT0F;EAUjG;EACA;EACA,eAAe;AAZkF,CAA5F;AAeP,OAAO,MAAM,sBAAsB,GAAgE;EACjG;EACA;EACA,IAAI,EAAE,wBAH2F;EAIjG,eAAe,wBAJkF;EAKjG,KAAK,EAAE,wBAL0F;EAMjG,MAAM,EAAE,wBANyF;EAOjG;EACA;EACA,KAAK,EAAE,wBAT0F;EAUjG;EACA;EACA,eAAe;AAZkF,CAA5F","sourcesContent":["import * as React from 'react';\nimport {\n PresenceAvailable10Regular,\n PresenceAvailable12Regular,\n PresenceAvailable16Regular,\n PresenceAvailable10Filled,\n PresenceAvailable12Filled,\n PresenceAvailable16Filled,\n PresenceAway10Filled,\n PresenceAway12Filled,\n PresenceAway16Filled,\n PresenceBusy10Filled,\n PresenceBusy12Filled,\n PresenceBusy16Filled,\n PresenceDnd10Regular,\n PresenceDnd12Regular,\n PresenceDnd16Regular,\n PresenceDnd10Filled,\n PresenceDnd12Filled,\n PresenceDnd16Filled,\n PresenceOof10Regular,\n PresenceOof12Regular,\n PresenceOof16Regular,\n PresenceOffline10Regular,\n PresenceOffline12Regular,\n PresenceOffline16Regular,\n PresenceUnknown10Regular,\n PresenceUnknown12Regular,\n PresenceUnknown16Regular,\n} from '@fluentui/react-icons';\nimport type { PresenceBadgeState } from './PresenceBadge.types';\n\nexport const presenceAwayFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAway10Filled,\n 'extra-small': PresenceAway10Filled,\n small: PresenceAway12Filled,\n medium: PresenceAway16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAway16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAway16Filled,\n};\n\nexport const presenceAvailableRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAvailable10Regular,\n 'extra-small': PresenceAvailable10Regular,\n small: PresenceAvailable12Regular,\n medium: PresenceAvailable16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAvailable16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAvailable16Regular,\n};\n\nexport const presenceAvailableFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAvailable10Filled,\n 'extra-small': PresenceAvailable10Filled,\n small: PresenceAvailable12Filled,\n medium: PresenceAvailable16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAvailable16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAvailable16Filled,\n};\n\nexport const presenceBusyFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceBusy10Filled,\n 'extra-small': PresenceBusy10Filled,\n small: PresenceBusy12Filled,\n medium: PresenceBusy16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceBusy16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceBusy16Filled,\n};\n\nexport const presenceDndFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceDnd10Filled,\n 'extra-small': PresenceDnd10Filled,\n small: PresenceDnd12Filled,\n medium: PresenceDnd16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceDnd16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceDnd16Filled,\n};\n\nexport const presenceDndRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceDnd10Regular,\n 'extra-small': PresenceDnd10Regular,\n small: PresenceDnd12Regular,\n medium: PresenceDnd16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceDnd16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceDnd16Regular,\n};\n\nexport const presenceOofRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceOof10Regular,\n 'extra-small': PresenceOof10Regular,\n small: PresenceOof12Regular,\n medium: PresenceOof16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceOof16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceOof16Regular,\n};\n\nexport const presenceOfflineRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceOffline10Regular,\n 'extra-small': PresenceOffline10Regular,\n small: PresenceOffline12Regular,\n medium: PresenceOffline16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceOffline16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceOffline16Regular,\n};\n\nexport const presenceUnknownRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceUnknown10Regular,\n 'extra-small': PresenceUnknown10Regular,\n small: PresenceUnknown12Regular,\n medium: PresenceUnknown16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceUnknown16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceUnknown16Regular,\n};\n"],"sourceRoot":""}
|
@@ -42,28 +42,29 @@ const DEFAULT_STRINGS = {
|
|
42
42
|
*/
|
43
43
|
|
44
44
|
export const usePresenceBadge_unstable = (props, ref) => {
|
45
|
-
|
46
|
-
|
47
|
-
|
45
|
+
const {
|
46
|
+
size = 'medium',
|
47
|
+
status = 'available',
|
48
|
+
outOfOffice = false
|
49
|
+
} = props;
|
50
|
+
const statusText = DEFAULT_STRINGS[status];
|
48
51
|
const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';
|
52
|
+
const IconElement = iconMap(status, outOfOffice, size);
|
49
53
|
const state = { ...useBadge_unstable({
|
50
|
-
size: 'medium',
|
51
54
|
'aria-label': statusText + oofText,
|
52
55
|
role: 'img',
|
53
56
|
...props,
|
57
|
+
size,
|
54
58
|
icon: resolveShorthand(props.icon, {
|
59
|
+
defaultProps: {
|
60
|
+
children: IconElement ? /*#__PURE__*/React.createElement(IconElement, null) : null
|
61
|
+
},
|
55
62
|
required: true
|
56
63
|
})
|
57
64
|
}, ref),
|
58
|
-
status
|
59
|
-
outOfOffice
|
65
|
+
status,
|
66
|
+
outOfOffice
|
60
67
|
};
|
61
|
-
const IconElement = iconMap(state.status, state.outOfOffice, state.size);
|
62
|
-
|
63
|
-
if (IconElement) {
|
64
|
-
state.icon.children = /*#__PURE__*/React.createElement(IconElement, null);
|
65
|
-
}
|
66
|
-
|
67
68
|
return state;
|
68
69
|
};
|
69
70
|
//# sourceMappingURL=usePresenceBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/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,
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":"AAAA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,GAAG,QAAT;IAAmB,MAAM,GAAG,WAA5B;IAAyC,WAAW,GAAG;EAAvD,IAAiE,KAAvE;EAEA,MAAM,UAAU,GAAG,eAAe,CAAC,MAAD,CAAlC;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,eAAtC,GAAwD,IAAI,eAAe,CAAC,eAAD,CAAiB,EAA5F,GAAiG,EAAjH;EAEA,MAAM,WAAW,GAAG,OAAO,CAAC,MAAD,EAAS,WAAT,EAAsB,IAAtB,CAA3B;EAEA,MAAM,KAAK,GAAuB,EAChC,GAAG,iBAAiB,CAClB;MACE,cAAc,UAAU,GAAG,OAD7B;MAEE,IAAI,EAAE,KAFR;MAGE,GAAG,KAHL;MAIE,IAJF;MAKE,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;QACjC,YAAY,EAAE;UACZ,QAAQ,EAAE,WAAW,gBAAG,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAH,GAAqB;QAD9B,CADmB;QAIjC,QAAQ,EAAE;MAJuB,CAAb;IALxB,CADkB,EAalB,GAbkB,CADY;IAgBhC,MAhBgC;IAiBhC;EAjBgC,CAAlC;EAoBA,OAAO,KAAP;AACD,CAhCM","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 = (status: PresenceBadgeState['status'], outOfOffice: boolean, size: PresenceBadgeState['size']) => {\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 { size = 'medium', status = 'available', outOfOffice = false } = props;\n\n const statusText = DEFAULT_STRINGS[status];\n const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';\n\n const IconElement = iconMap(status, outOfOffice, size);\n\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n 'aria-label': statusText + oofText,\n role: 'img',\n ...props,\n size,\n icon: resolveShorthand(props.icon, {\n defaultProps: {\n children: IconElement ? <IconElement /> : null,\n },\n required: true,\n }),\n },\n ref,\n ),\n status,\n outOfOffice,\n };\n\n return state;\n};\n"],"sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AA+Ba,OAAA,CAAA,kBAAA,
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/presenceIcons.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AA+Ba,OAAA,CAAA,kBAAA,GAAkF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G,MAAM,EAAE,aAAA,CAAA,wBANyF;EAOjG;EACA;EACA,KAAK,EAAE,aAAA,CAAA,wBAT0F;EAUjG;EACA;EACA,eAAe,aAAA,CAAA;AAZkF,CAAtF","sourcesContent":["import * as React from 'react';\nimport {\n PresenceAvailable10Regular,\n PresenceAvailable12Regular,\n PresenceAvailable16Regular,\n PresenceAvailable10Filled,\n PresenceAvailable12Filled,\n PresenceAvailable16Filled,\n PresenceAway10Filled,\n PresenceAway12Filled,\n PresenceAway16Filled,\n PresenceBusy10Filled,\n PresenceBusy12Filled,\n PresenceBusy16Filled,\n PresenceDnd10Regular,\n PresenceDnd12Regular,\n PresenceDnd16Regular,\n PresenceDnd10Filled,\n PresenceDnd12Filled,\n PresenceDnd16Filled,\n PresenceOof10Regular,\n PresenceOof12Regular,\n PresenceOof16Regular,\n PresenceOffline10Regular,\n PresenceOffline12Regular,\n PresenceOffline16Regular,\n PresenceUnknown10Regular,\n PresenceUnknown12Regular,\n PresenceUnknown16Regular,\n} from '@fluentui/react-icons';\nimport type { PresenceBadgeState } from './PresenceBadge.types';\n\nexport const presenceAwayFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAway10Filled,\n 'extra-small': PresenceAway10Filled,\n small: PresenceAway12Filled,\n medium: PresenceAway16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAway16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAway16Filled,\n};\n\nexport const presenceAvailableRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAvailable10Regular,\n 'extra-small': PresenceAvailable10Regular,\n small: PresenceAvailable12Regular,\n medium: PresenceAvailable16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAvailable16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAvailable16Regular,\n};\n\nexport const presenceAvailableFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceAvailable10Filled,\n 'extra-small': PresenceAvailable10Filled,\n small: PresenceAvailable12Filled,\n medium: PresenceAvailable16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceAvailable16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceAvailable16Filled,\n};\n\nexport const presenceBusyFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceBusy10Filled,\n 'extra-small': PresenceBusy10Filled,\n small: PresenceBusy12Filled,\n medium: PresenceBusy16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceBusy16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceBusy16Filled,\n};\n\nexport const presenceDndFilled: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceDnd10Filled,\n 'extra-small': PresenceDnd10Filled,\n small: PresenceDnd12Filled,\n medium: PresenceDnd16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceDnd16Filled,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceDnd16Filled,\n};\n\nexport const presenceDndRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceDnd10Regular,\n 'extra-small': PresenceDnd10Regular,\n small: PresenceDnd12Regular,\n medium: PresenceDnd16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceDnd16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceDnd16Regular,\n};\n\nexport const presenceOofRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceOof10Regular,\n 'extra-small': PresenceOof10Regular,\n small: PresenceOof12Regular,\n medium: PresenceOof16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceOof16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceOof16Regular,\n};\n\nexport const presenceOfflineRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceOffline10Regular,\n 'extra-small': PresenceOffline10Regular,\n small: PresenceOffline12Regular,\n medium: PresenceOffline16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceOffline16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceOffline16Regular,\n};\n\nexport const presenceUnknownRegular: Record<PresenceBadgeState['size'], React.FunctionComponent> = {\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n tiny: PresenceUnknown10Regular,\n 'extra-small': PresenceUnknown10Regular,\n small: PresenceUnknown12Regular,\n medium: PresenceUnknown16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n large: PresenceUnknown16Regular,\n // FIXME not all presence icon sizes are available\n // https://github.com/microsoft/fluentui/issues/20650\n 'extra-large': PresenceUnknown16Regular,\n};\n"],"sourceRoot":""}
|
@@ -52,28 +52,29 @@ const DEFAULT_STRINGS = {
|
|
52
52
|
*/
|
53
53
|
|
54
54
|
const usePresenceBadge_unstable = (props, ref) => {
|
55
|
-
|
56
|
-
|
57
|
-
|
55
|
+
const {
|
56
|
+
size = 'medium',
|
57
|
+
status = 'available',
|
58
|
+
outOfOffice = false
|
59
|
+
} = props;
|
60
|
+
const statusText = DEFAULT_STRINGS[status];
|
58
61
|
const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';
|
62
|
+
const IconElement = iconMap(status, outOfOffice, size);
|
59
63
|
const state = { ...index_1.useBadge_unstable({
|
60
|
-
size: 'medium',
|
61
64
|
'aria-label': statusText + oofText,
|
62
65
|
role: 'img',
|
63
66
|
...props,
|
67
|
+
size,
|
64
68
|
icon: react_utilities_1.resolveShorthand(props.icon, {
|
69
|
+
defaultProps: {
|
70
|
+
children: IconElement ? React.createElement(IconElement, null) : null
|
71
|
+
},
|
65
72
|
required: true
|
66
73
|
})
|
67
74
|
}, ref),
|
68
|
-
status
|
69
|
-
outOfOffice
|
75
|
+
status,
|
76
|
+
outOfOffice
|
70
77
|
};
|
71
|
-
const IconElement = iconMap(state.status, state.outOfOffice, state.size);
|
72
|
-
|
73
|
-
if (IconElement) {
|
74
|
-
state.icon.children = React.createElement(IconElement, null);
|
75
|
-
}
|
76
|
-
|
77
78
|
return state;
|
78
79
|
};
|
79
80
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAWA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAM,OAAO,GAAG,
|
1
|
+
{"version":3,"sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAWA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAM,OAAO,GAAG,CAAC,MAAD,EAAuC,WAAvC,EAA6D,IAA7D,KAAiG;EAC/G,QAAQ,MAAR;IACE,KAAK,WAAL;MACE,OAAO,WAAW,GAAG,eAAA,CAAA,wBAAA,CAAyB,IAAzB,CAAH,GAAoC,eAAA,CAAA,uBAAA,CAAwB,IAAxB,CAAtD;;IACF,KAAK,MAAL;MACE,OAAO,WAAW,GAAG,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAH,GAAkC,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAApD;;IACF,KAAK,MAAL;MACE,OAAO,WAAW,GAAG,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAH,GAAkC,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAApD;;IACF,KAAK,gBAAL;MACE,OAAO,WAAW,GAAG,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAAH,GAA8B,eAAA,CAAA,iBAAA,CAAkB,IAAlB,CAAhD;;IACF,KAAK,SAAL;MACE,OAAO,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAP;;IACF,KAAK,eAAL;MACE,OAAO,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAAP;;IACF,KAAK,SAAL;MACE,OAAO,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAP;EAdJ;AAgBD,CAjBD;;AAmBA,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;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;EACtB,MAAM;IAAE,IAAI,GAAG,QAAT;IAAmB,MAAM,GAAG,WAA5B;IAAyC,WAAW,GAAG;EAAvD,IAAiE,KAAvE;EAEA,MAAM,UAAU,GAAG,eAAe,CAAC,MAAD,CAAlC;EACA,MAAM,OAAO,GAAG,KAAK,CAAC,WAAN,IAAqB,KAAK,CAAC,MAAN,KAAiB,eAAtC,GAAwD,IAAI,eAAe,CAAC,eAAD,CAAiB,EAA5F,GAAiG,EAAjH;EAEA,MAAM,WAAW,GAAG,OAAO,CAAC,MAAD,EAAS,WAAT,EAAsB,IAAtB,CAA3B;EAEA,MAAM,KAAK,GAAuB,EAChC,GAAG,OAAA,CAAA,iBAAA,CACD;MACE,cAAc,UAAU,GAAG,OAD7B;MAEE,IAAI,EAAE,KAFR;MAGE,GAAG,KAHL;MAIE,IAJF;MAKE,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB,EAA6B;QACjC,YAAY,EAAE;UACZ,QAAQ,EAAE,WAAW,GAAG,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAH,GAAqB;QAD9B,CADmB;QAIjC,QAAQ,EAAE;MAJuB,CAA7B;IALR,CADC,EAaD,GAbC,CAD6B;IAgBhC,MAhBgC;IAiBhC;EAjBgC,CAAlC;EAoBA,OAAO,KAAP;AACD,CAhCM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","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 = (status: PresenceBadgeState['status'], outOfOffice: boolean, size: PresenceBadgeState['size']) => {\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 { size = 'medium', status = 'available', outOfOffice = false } = props;\n\n const statusText = DEFAULT_STRINGS[status];\n const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';\n\n const IconElement = iconMap(status, outOfOffice, size);\n\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n 'aria-label': statusText + oofText,\n role: 'img',\n ...props,\n size,\n icon: resolveShorthand(props.icon, {\n defaultProps: {\n children: IconElement ? <IconElement /> : null,\n },\n required: true,\n }),\n },\n ref,\n ),\n status,\n outOfOffice,\n };\n\n return state;\n};\n"],"sourceRoot":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-badge",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20221121-0425.1",
|
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": "0.0.0-nightly-
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20221121-0425.1",
|
31
31
|
"@fluentui/scripts": "^1.0.0"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@fluentui/react-icons": "^2.0.175",
|
35
35
|
"@griffel/react": "^1.4.2",
|
36
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
37
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
36
|
+
"@fluentui/react-theme": "0.0.0-nightly-20221121-0425.1",
|
37
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20221121-0425.1",
|
38
38
|
"tslib": "^2.1.0"
|
39
39
|
},
|
40
40
|
"peerDependencies": {
|