@fluentui/react-badge 0.0.0-nightly0e0cf06c3420211029.1 → 0.0.0-nightlyed2d7c8d6320211111.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +34 -16
- package/CHANGELOG.md +13 -11
- package/dist/react-badge.d.ts +6 -0
- package/lib/common/isConformant.js +1 -1
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Badge/Badge.js +2 -2
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/renderBadge.js +6 -7
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.js +19 -22
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.d.ts +1 -0
- package/lib/components/Badge/useBadgeStyles.js +16 -15
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.js +2 -2
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js +18 -24
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -0
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +5 -4
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +62 -75
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js +2 -2
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js +17 -20
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -0
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +5 -4
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/Badge.js +1 -1
- package/lib-commonjs/CounterBadge.js +1 -1
- package/lib-commonjs/PresenceBadge.js +1 -1
- package/lib-commonjs/common/isConformant.js +3 -3
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.js +6 -6
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/index.js +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +8 -10
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.js +20 -24
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +1 -0
- package/lib-commonjs/components/Badge/useBadgeStyles.js +19 -17
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js +6 -6
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +19 -26
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -0
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +9 -7
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +65 -79
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +6 -6
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +21 -25
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -0
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +9 -7
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
@@ -2,52 +2,64 @@
|
|
2
2
|
"name": "@fluentui/react-badge",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-badge_v0.0.0-
|
7
|
-
"version": "0.0.0-
|
5
|
+
"date": "Thu, 11 Nov 2021 13:12:46 GMT",
|
6
|
+
"tag": "@fluentui/react-badge_v0.0.0-nightlyed2d7c8d6320211111.1",
|
7
|
+
"version": "0.0.0-nightlyed2d7c8d6320211111.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
11
11
|
"author": "email not defined",
|
12
12
|
"package": "@fluentui/react-badge",
|
13
|
-
"commit": "
|
13
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
|
+
{
|
17
|
+
"author": "olfedias@microsoft.com",
|
18
|
+
"package": "@fluentui/react-badge",
|
19
|
+
"commit": "e42f50656c1b703d88c398b114f225ba5f1f5f22",
|
20
|
+
"comment": "export static classes for components"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "gcox@microsoft.com",
|
24
|
+
"package": "@fluentui/react-badge",
|
25
|
+
"commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586",
|
26
|
+
"comment": "Updated beta and RC components to ES2019"
|
27
|
+
},
|
16
28
|
{
|
17
29
|
"author": "beachball",
|
18
30
|
"package": "@fluentui/react-badge",
|
19
|
-
"comment": "Bump @fluentui/react-make-styles to v0.0.0-
|
20
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1",
|
32
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9"
|
21
33
|
},
|
22
34
|
{
|
23
35
|
"author": "beachball",
|
24
36
|
"package": "@fluentui/react-badge",
|
25
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-
|
26
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightlyed2d7c8d6320211111.1",
|
38
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9"
|
27
39
|
},
|
28
40
|
{
|
29
41
|
"author": "beachball",
|
30
42
|
"package": "@fluentui/react-badge",
|
31
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-
|
32
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyed2d7c8d6320211111.1",
|
44
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9"
|
33
45
|
},
|
34
46
|
{
|
35
47
|
"author": "beachball",
|
36
48
|
"package": "@fluentui/react-badge",
|
37
|
-
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-
|
38
|
-
"commit": "
|
49
|
+
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1",
|
50
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9"
|
39
51
|
},
|
40
52
|
{
|
41
53
|
"author": "beachball",
|
42
54
|
"package": "@fluentui/react-badge",
|
43
|
-
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-
|
44
|
-
"commit": "
|
55
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1",
|
56
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9"
|
45
57
|
},
|
46
58
|
{
|
47
59
|
"author": "beachball",
|
48
60
|
"package": "@fluentui/react-badge",
|
49
|
-
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-
|
50
|
-
"commit": "
|
61
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1",
|
62
|
+
"commit": "69054b5abc9c52ffb203f51ad40b49d9729af7d9"
|
51
63
|
}
|
52
64
|
],
|
53
65
|
"none": [
|
@@ -56,6 +68,12 @@
|
|
56
68
|
"package": "@fluentui/react-badge",
|
57
69
|
"commit": "7fafe76eb2c09f9d17a03c11ba73729d91ef411e",
|
58
70
|
"comment": "update docs descriptions"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"author": "me@levithomason.com",
|
74
|
+
"package": "@fluentui/react-badge",
|
75
|
+
"commit": "cdbe0769d2a6ee91a98a3e62c6ac9329a714355c",
|
76
|
+
"comment": "Docs update"
|
59
77
|
}
|
60
78
|
]
|
61
79
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
# Change Log - @fluentui/react-badge
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 11 Nov 2021 13:12:46 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightlyed2d7c8d6320211111.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v0.0.0-nightlyed2d7c8d6320211111.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.0.0-beta.2..@fluentui/react-badge_v0.0.0-
|
9
|
+
Thu, 11 Nov 2021 13:12:46 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.0.0-beta.2..@fluentui/react-badge_v0.0.0-nightlyed2d7c8d6320211111.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/
|
15
|
-
-
|
16
|
-
-
|
17
|
-
- Bump @fluentui/react-
|
18
|
-
- Bump @fluentui/
|
19
|
-
- Bump @fluentui/
|
20
|
-
- Bump @fluentui/
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by email not defined)
|
15
|
+
- export static classes for components ([PR #20453](https://github.com/microsoft/fluentui/pull/20453) by olfedias@microsoft.com)
|
16
|
+
- Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com)
|
17
|
+
- Bump @fluentui/react-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by beachball)
|
18
|
+
- Bump @fluentui/react-theme to v0.0.0-nightlyed2d7c8d6320211111.1 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by beachball)
|
19
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightlyed2d7c8d6320211111.1 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by beachball)
|
20
|
+
- Bump @fluentui/babel-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by beachball)
|
21
|
+
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by beachball)
|
22
|
+
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyed2d7c8d6320211111.1 ([commit](https://github.com/microsoft/fluentui/commit/69054b5abc9c52ffb203f51ad40b49d9729af7d9) by beachball)
|
21
23
|
|
22
24
|
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v9.0.0-beta.2)
|
23
25
|
|
package/dist/react-badge.d.ts
CHANGED
@@ -9,6 +9,8 @@ import * as React_2 from 'react';
|
|
9
9
|
*/
|
10
10
|
export declare const Badge: ForwardRefComponent<BadgeProps>;
|
11
11
|
|
12
|
+
export declare const badgeClassName = "fui-Badge";
|
13
|
+
|
12
14
|
export declare type BadgeCommons = {
|
13
15
|
/**
|
14
16
|
* A Badge can be filled, outline, ghost, inverted
|
@@ -51,6 +53,8 @@ export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
|
|
51
53
|
*/
|
52
54
|
export declare const CounterBadge: ForwardRefComponent<CounterBadgeProps>;
|
53
55
|
|
56
|
+
export declare const counterBadgeClassName = "fui-CounterBadge";
|
57
|
+
|
54
58
|
export declare type CounterBadgeCommons = {
|
55
59
|
/**
|
56
60
|
* Max number to be displayed
|
@@ -99,6 +103,8 @@ export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape'>
|
|
99
103
|
*/
|
100
104
|
export declare const PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
|
101
105
|
|
106
|
+
export declare const presenceBadgeClassName = "fui-PresenceBadge";
|
107
|
+
|
102
108
|
export declare interface PresenceBadgeCommons {
|
103
109
|
/**
|
104
110
|
* Represents several status
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
2
|
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
3
3
|
export function isConformant(testInfo) {
|
4
|
-
|
4
|
+
const defaultOptions = {
|
5
5
|
asPropHandlesRef: true,
|
6
6
|
componentPath: module.parent.filename.replace('.test', ''),
|
7
7
|
// https://github.com/microsoft/fluentui/issues/19522
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,QAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D;AACA,IAAA,eAAe,EAAE,IAJ0C;AAK3D,IAAA,UAAU,EAAE;AAL+C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -6,8 +6,8 @@ import { renderBadge } from './renderBadge';
|
|
6
6
|
* Define a styled Badge, using the `useBadge` hook.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export
|
10
|
-
|
9
|
+
export const Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useBadge(props, ref);
|
11
11
|
useBadgeStyles(state);
|
12
12
|
return renderBadge(state);
|
13
13
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,YAAzB;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,WAAT,QAA4B,eAA5B;AAIA;;AAEG;;AACH,OAAO,
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,YAAzB;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,WAAT,QAA4B,eAA5B;AAIA;;AAEG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,QAAQ,CAAC,KAAD,EAAQ,GAAR,CAAtB;AACA,EAAA,cAAc,CAAC,KAAD,CAAd;AAEA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,11 +1,10 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import * as React from 'react';
|
3
2
|
import { getSlots } from '@fluentui/react-utilities';
|
4
|
-
export
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
3
|
+
export const renderBadge = state => {
|
4
|
+
const {
|
5
|
+
slots,
|
6
|
+
slotProps
|
7
|
+
} = getSlots(state, ['icon', 'root']);
|
8
|
+
return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), state.iconPosition === 'before' && /*#__PURE__*/React.createElement(slots.icon, Object.assign({}, slotProps.icon)), state.root.children, state.iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, Object.assign({}, slotProps.icon)));
|
10
9
|
};
|
11
10
|
//# sourceMappingURL=renderBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA,OAAO,MAAM,WAAW,GAAI,KAAD,IAAsB;AAC/C,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAa,KAAb,EAAoB,CAAC,MAAD,EAAS,MAAT,CAApB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,iBAAmC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADtC,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,iBAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAHrC,CADF;AAOD,CAVM","sourceRoot":""}
|
@@ -1,34 +1,31 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
3
2
|
/**
|
4
3
|
* Returns the props and state required to render the component
|
5
4
|
*/
|
6
5
|
|
7
|
-
export
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
iconPosition: iconPosition,
|
22
|
-
appearance: appearance,
|
23
|
-
color: color,
|
6
|
+
export const useBadge = (props, ref) => {
|
7
|
+
const {
|
8
|
+
shape = 'circular',
|
9
|
+
size = 'medium',
|
10
|
+
iconPosition = 'before',
|
11
|
+
appearance = 'filled',
|
12
|
+
color = 'brand'
|
13
|
+
} = props;
|
14
|
+
const state = {
|
15
|
+
shape,
|
16
|
+
size,
|
17
|
+
iconPosition,
|
18
|
+
appearance,
|
19
|
+
color,
|
24
20
|
components: {
|
25
21
|
root: 'div',
|
26
22
|
icon: 'span'
|
27
23
|
},
|
28
|
-
root: getNativeElementProps('div',
|
29
|
-
ref
|
30
|
-
'aria-hidden': true
|
31
|
-
|
24
|
+
root: getNativeElementProps('div', {
|
25
|
+
ref,
|
26
|
+
'aria-hidden': true,
|
27
|
+
...props
|
28
|
+
}),
|
32
29
|
icon: resolveShorthand(props.icon)
|
33
30
|
};
|
34
31
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;AAEG;;AACH,OAAO,MAAM,QAAQ,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AACrF,QAAM;AACJ,IAAA,KAAK,GAAG,UADJ;AAEJ,IAAA,IAAI,GAAG,QAFH;AAGJ,IAAA,YAAY,GAAG,QAHX;AAIJ,IAAA,UAAU,GAAG,QAJT;AAKJ,IAAA,KAAK,GAAG;AALJ,MAMF,KANJ;AAQA,QAAM,KAAK,GAAe;AACxB,IAAA,KADwB;AAExB,IAAA,IAFwB;AAGxB,IAAA,YAHwB;AAIxB,IAAA,UAJwB;AAKxB,IAAA,KALwB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,IAAI,EAAE;AAFI,KANY;AAUxB,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,qBAAe,IAFkB;AAGjC,SAAG;AAH8B,KAAR,CAVH;AAexB,IAAA,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP;AAfE,GAA1B;AAkBA,SAAO,KAAP;AACD,CA5BM","sourceRoot":""}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { mergeClasses, __styles } from '@fluentui/react-make-styles';
|
2
|
+
export const badgeClassName = 'fui-Badge';
|
2
3
|
|
3
|
-
|
4
|
+
const useStyles = /*#__PURE__*/__styles({
|
4
5
|
"root": {
|
5
6
|
"mc9l5x": "ftuwxu6",
|
6
7
|
"B7ck84d": "f1ewtqcl",
|
@@ -300,20 +301,20 @@ var useStyles = /*#__PURE__*/__styles({
|
|
300
301
|
*/
|
301
302
|
|
302
303
|
|
303
|
-
export
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
state.root.className = mergeClasses(styles.root, state.size === 'tiny' && styles.rootTiny, state.size === 'extra-small' && styles.rootExtraSmall, state.size === 'small' && styles.rootSmall, state.size === 'medium' && styles.rootMedium, state.size === 'large' && styles.rootLarge, state.size === 'extra-large' && styles.rootExtraLarge, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shape === 'rounded' && (state.size === 'small' || state.size === 'extra-small' || state.size === 'tiny') && styles.rootRoundedSmallToTiny, isGhost && styles.rootGhost, isOutline && styles.rootOutline, isTint && styles.rootTint, isFilled && isDanger && styles.rootFilledDanger, isOutline && isDanger && styles.rootOutlineDanger, isTint && isDanger && styles.rootTintDanger, isGhost && isDanger && styles.rootGhostDanger, isFilled && isSevere && styles.rootFilledSevere, isOutline && isSevere && styles.rootOutlineSevere, isTint && isSevere && styles.rootTintSevere, isGhost && isSevere && styles.rootGhostSevere, isFilled && isWarning && styles.rootFilledWarning, isOutline && isWarning && styles.rootOutlineWarning, isTint && isWarning && styles.rootTintWarning, isGhost && isWarning && styles.rootGhostWarning, isFilled && isSuccess && styles.rootFilledSuccess, isOutline && isSuccess && styles.rootOutlineSuccess, isTint && isSuccess && styles.rootTintSuccess, isGhost && isSuccess && styles.rootGhostSuccess, isFilled && isImportant && styles.rootFilledImportant, isOutline && isImportant && styles.rootOutlineImportant, isTint && isImportant && styles.rootTintImportant, isGhost && isImportant && styles.rootGhostImportant, isFilled && isInformative && styles.rootFilledInformative, isOutline && isInformative && styles.rootOutlineInformative, isTint && isInformative && styles.rootTintInformative, isGhost && isInformative && styles.rootGhostInformative, isFilled && isSubtle && styles.rootFilledSubtle, isOutline && isSubtle && styles.rootOutlineSubtle, isTint && isSubtle && styles.rootTintSubtle, isGhost && isSubtle && styles.rootGhostSubtle, state.root.className);
|
304
|
+
export const useBadgeStyles = state => {
|
305
|
+
const styles = useStyles();
|
306
|
+
const isGhost = state.appearance === 'ghost';
|
307
|
+
const isOutline = state.appearance === 'outline';
|
308
|
+
const isTint = state.appearance === 'tint';
|
309
|
+
const isFilled = state.appearance === 'filled';
|
310
|
+
const isDanger = state.color === 'danger';
|
311
|
+
const isSevere = state.color === 'severe';
|
312
|
+
const isWarning = state.color === 'warning';
|
313
|
+
const isSuccess = state.color === 'success';
|
314
|
+
const isImportant = state.color === 'important';
|
315
|
+
const isInformative = state.color === 'informative';
|
316
|
+
const isSubtle = state.color === 'subtle';
|
317
|
+
state.root.className = mergeClasses(badgeClassName, styles.root, state.size === 'tiny' && styles.rootTiny, state.size === 'extra-small' && styles.rootExtraSmall, state.size === 'small' && styles.rootSmall, state.size === 'medium' && styles.rootMedium, state.size === 'large' && styles.rootLarge, state.size === 'extra-large' && styles.rootExtraLarge, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shape === 'rounded' && (state.size === 'small' || state.size === 'extra-small' || state.size === 'tiny') && styles.rootRoundedSmallToTiny, isGhost && styles.rootGhost, isOutline && styles.rootOutline, isTint && styles.rootTint, isFilled && isDanger && styles.rootFilledDanger, isOutline && isDanger && styles.rootOutlineDanger, isTint && isDanger && styles.rootTintDanger, isGhost && isDanger && styles.rootGhostDanger, isFilled && isSevere && styles.rootFilledSevere, isOutline && isSevere && styles.rootOutlineSevere, isTint && isSevere && styles.rootTintSevere, isGhost && isSevere && styles.rootGhostSevere, isFilled && isWarning && styles.rootFilledWarning, isOutline && isWarning && styles.rootOutlineWarning, isTint && isWarning && styles.rootTintWarning, isGhost && isWarning && styles.rootGhostWarning, isFilled && isSuccess && styles.rootFilledSuccess, isOutline && isSuccess && styles.rootOutlineSuccess, isTint && isSuccess && styles.rootTintSuccess, isGhost && isSuccess && styles.rootGhostSuccess, isFilled && isImportant && styles.rootFilledImportant, isOutline && isImportant && styles.rootOutlineImportant, isTint && isImportant && styles.rootTintImportant, isGhost && isImportant && styles.rootGhostImportant, isFilled && isInformative && styles.rootFilledInformative, isOutline && isInformative && styles.rootOutlineInformative, isTint && isInformative && styles.rootTintInformative, isGhost && isInformative && styles.rootGhostInformative, isFilled && isSubtle && styles.rootFilledSubtle, isOutline && isSubtle && styles.rootOutlineSubtle, isTint && isSubtle && styles.rootTintSubtle, isGhost && isSubtle && styles.rootGhostSubtle, state.root.className);
|
317
318
|
|
318
319
|
if (state.icon) {
|
319
320
|
state.icon.className = mergeClasses(styles.icon, state.icon.className);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Badge/useBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/useBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AAGA,OAAO,MAAM,cAAc,GAAG,WAAvB;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AyB,MAAM,CAAC,iBAnCC,EAoCjC,OAAO,IAAI,WAAX,IAA0B,MAAM,CAAC,kBApCA,EAqCjC,QAAQ,IAAI,aAAZ,IAA6B,MAAM,CAAC,qBArCH,EAsCjC,SAAS,IAAI,aAAb,IAA8B,MAAM,CAAC,sBAtCJ,EAuCjC,MAAM,IAAI,aAAV,IAA2B,MAAM,CAAC,mBAvCD,EAwCjC,OAAO,IAAI,aAAX,IAA4B,MAAM,CAAC,oBAxCF,EAyCjC,QAAQ,IAAI,QAAZ,IAAwB,MAAM,CAAC,gBAzCE,EA0CjC,SAAS,IAAI,QAAb,IAAyB,MAAM,CAAC,iBA1CC,EA2CjC,MAAM,IAAI,QAAV,IAAsB,MAAM,CAAC,cA3CI,EA4CjC,OAAO,IAAI,QAAX,IAAuB,MAAM,CAAC,eA5CG,EA6CjC,KAAK,CAAC,IAAN,CAAW,SA7CsB,CAAnC;;AAgDA,MAAI,KAAK,CAAC,IAAV,EAAgB;AACd,IAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,MAAM,CAAC,IAAR,EAAc,KAAK,CAAC,IAAN,CAAW,SAAzB,CAAnC;AACD;;AAED,SAAO,KAAP;AACD,CAnEM","sourceRoot":""}
|
@@ -6,8 +6,8 @@ import { renderBadge } from '../Badge/index';
|
|
6
6
|
* Define a styled CounterBadge, using the `useCounterBadge` hook.
|
7
7
|
*/
|
8
8
|
|
9
|
-
export
|
10
|
-
|
9
|
+
export const CounterBadge = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
+
const state = useCounterBadge(props, ref);
|
11
11
|
useCounterBadgeStyles(state);
|
12
12
|
return renderBadge(state);
|
13
13
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,eAAT,QAAgC,mBAAhC;AACA,SAAS,qBAAT,QAAsC,yBAAtC;AACA,SAAS,WAAT,QAA4B,gBAA5B;AAIA;;AAEG;;AACH,OAAO,
|
1
|
+
{"version":3,"sources":["../../../src/components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,eAAT,QAAgC,mBAAhC;AACA,SAAS,qBAAT,QAAsC,yBAAtC;AACA,SAAS,WAAT,QAA4B,gBAA5B;AAIA;;AAEG;;AACH,OAAO,MAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAClG,QAAM,KAAK,GAAG,eAAe,CAAC,KAAD,EAAQ,GAAR,CAA7B;AACA,EAAA,qBAAqB,CAAC,KAAD,CAArB;AAEA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALmE,CAA7D;AAOP,YAAY,CAAC,WAAb,GAA2B,cAA3B","sourceRoot":""}
|
@@ -1,34 +1,28 @@
|
|
1
|
-
import { __assign } from "tslib";
|
2
1
|
import { useBadge } from '../Badge/index';
|
3
2
|
/**
|
4
3
|
* Returns the props and state required to render the component
|
5
4
|
*/
|
6
5
|
|
7
|
-
export
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
showZero: showZero,
|
25
|
-
overflowCount: overflowCount,
|
26
|
-
count: count,
|
27
|
-
dot: dot
|
28
|
-
});
|
6
|
+
export const useCounterBadge = (props, ref) => {
|
7
|
+
const {
|
8
|
+
shape = 'circular',
|
9
|
+
appearance = 'filled',
|
10
|
+
showZero = false,
|
11
|
+
overflowCount = 99,
|
12
|
+
count = 0,
|
13
|
+
dot = false
|
14
|
+
} = props;
|
15
|
+
const state = { ...useBadge(props, ref),
|
16
|
+
shape,
|
17
|
+
appearance,
|
18
|
+
showZero,
|
19
|
+
overflowCount,
|
20
|
+
count,
|
21
|
+
dot
|
22
|
+
};
|
29
23
|
|
30
24
|
if (!state.dot && !state.root.children) {
|
31
|
-
state.root.children = state.count > state.overflowCount ? state.overflowCount
|
25
|
+
state.root.children = state.count > state.overflowCount ? `${state.overflowCount}+` : `${state.count}`;
|
32
26
|
}
|
33
27
|
|
34
28
|
return state;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":"AACA,SAAS,QAAT,QAAyB,gBAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,eAAe,GAAG,CAAC,KAAD,EAA2B,GAA3B,KAA6E;AAC1G,QAAM;AACJ,IAAA,KAAK,GAAG,UADJ;AAEJ,IAAA,UAAU,GAAG,QAFT;AAGJ,IAAA,QAAQ,GAAG,KAHP;AAIJ,IAAA,aAAa,GAAG,EAJZ;AAKJ,IAAA,KAAK,GAAG,CALJ;AAMJ,IAAA,GAAG,GAAG;AANF,MAOF,KAPJ;AASA,QAAM,KAAK,GAAsB,EAC/B,GAAG,QAAQ,CAAC,KAAD,EAAQ,GAAR,CADoB;AAE/B,IAAA,KAF+B;AAG/B,IAAA,UAH+B;AAI/B,IAAA,QAJ+B;AAK/B,IAAA,aAL+B;AAM/B,IAAA,KAN+B;AAO/B,IAAA;AAP+B,GAAjC;;AAUA,MAAI,CAAC,KAAK,CAAC,GAAP,IAAc,CAAC,KAAK,CAAC,IAAN,CAAW,QAA9B,EAAwC;AACtC,IAAA,KAAK,CAAC,IAAN,CAAW,QAAX,GAAsB,KAAK,CAAC,KAAN,GAAc,KAAK,CAAC,aAApB,GAAoC,GAAG,KAAK,CAAC,aAAa,GAA1D,GAAgE,GAAG,KAAK,CAAC,KAAK,EAApG;AACD;;AAED,SAAO,KAAP;AACD,CAzBM","sourceRoot":""}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { mergeClasses, __styles } from '@fluentui/react-make-styles';
|
2
2
|
import { useBadgeStyles } from '../Badge/useBadgeStyles';
|
3
|
+
export const counterBadgeClassName = 'fui-CounterBadge';
|
3
4
|
|
4
|
-
|
5
|
+
const useStyles = /*#__PURE__*/__styles({
|
5
6
|
"root": {
|
6
7
|
"Bf4jedk": "fgfkb25"
|
7
8
|
},
|
@@ -53,9 +54,9 @@ var useStyles = /*#__PURE__*/__styles({
|
|
53
54
|
*/
|
54
55
|
|
55
56
|
|
56
|
-
export
|
57
|
-
|
58
|
-
state.root.className = mergeClasses(styles.root, state.color === 'warning' && styles.warning, state.color === 'important' && styles.important, state.color === 'severe' && styles.severe, state.color === 'informative' && styles.informative, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
|
57
|
+
export const useCounterBadgeStyles = state => {
|
58
|
+
const styles = useStyles();
|
59
|
+
state.root.className = mergeClasses(counterBadgeClassName, styles.root, state.color === 'warning' && styles.warning, state.color === 'important' && styles.important, state.color === 'severe' && styles.severe, state.color === 'informative' && styles.informative, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.root.className);
|
59
60
|
return useBadgeStyles(state);
|
60
61
|
};
|
61
62
|
//# sourceMappingURL=useCounterBadgeStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AACA,SAAS,cAAT,QAA+B,yBAA/B
|
1
|
+
{"version":3,"sources":["../../../src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":"AAAA,SAAS,YAAT,kBAAyC,6BAAzC;AACA,SAAS,cAAT,QAA+B,yBAA/B;AAGA,OAAO,MAAM,qBAAqB,GAAG,kBAA9B;;AAEP,MAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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