@fluentui/react-badge 9.1.30 → 9.1.32
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +67 -1
- package/CHANGELOG.md +26 -2
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/renderBadge.js +8 -2
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.js +1 -1
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js +1 -1
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/Badge.js +2 -2
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js +2 -2
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js +2 -2
- package/lib-commonjs/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.js +9 -7
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/index.js +5 -5
- package/lib-commonjs/components/Badge/index.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +14 -6
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.js +9 -7
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.styles.js +12 -8
- package/lib-commonjs/components/Badge/useBadgeStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js +9 -7
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js +5 -5
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +6 -4
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.styles.js +9 -5
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.styles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +11 -9
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js +5 -5
- package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js +102 -80
- package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +8 -6
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.styles.js +9 -5
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +42 -16
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,73 @@
|
|
2
2
|
"name": "@fluentui/react-badge",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Tue, 05 Sep 2023 13:23:20 GMT",
|
6
|
+
"tag": "@fluentui/react-badge_v9.1.32",
|
7
|
+
"version": "9.1.32",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
12
|
+
"package": "@fluentui/react-badge",
|
13
|
+
"commit": "eea6d93a62249ba4fba3347fb291c67ee1a3fb24",
|
14
|
+
"comment": "chore: migrate package to use JSX importSource"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "bernardo.sunderhus@gmail.com",
|
18
|
+
"package": "@fluentui/react-badge",
|
19
|
+
"commit": "b93c2ac22355b6cb6f33dd509c6cd9c21f4fffc8",
|
20
|
+
"comment": "bumps @swc/helpers version to 0.5.1"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-badge",
|
25
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.4",
|
26
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-badge",
|
31
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.7.3",
|
32
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-badge",
|
37
|
+
"comment": "Bump @fluentui/react-theme to v9.1.12",
|
38
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-badge",
|
43
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.1",
|
44
|
+
"commit": "0bf811dbcaaa6b78743537d142fe4d348b457045"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
}
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"date": "Tue, 29 Aug 2023 12:57:36 GMT",
|
51
|
+
"tag": "@fluentui/react-badge_v9.1.31",
|
52
|
+
"version": "9.1.31",
|
53
|
+
"comments": {
|
54
|
+
"patch": [
|
55
|
+
{
|
56
|
+
"author": "beachball",
|
57
|
+
"package": "@fluentui/react-badge",
|
58
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.3",
|
59
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"author": "beachball",
|
63
|
+
"package": "@fluentui/react-badge",
|
64
|
+
"comment": "Bump @fluentui/react-utilities to v9.13.0",
|
65
|
+
"commit": "f40ca42c8392904750bf1ef24826d273d1a5b4d5"
|
66
|
+
}
|
67
|
+
]
|
68
|
+
}
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"date": "Thu, 24 Aug 2023 10:26:35 GMT",
|
6
72
|
"tag": "@fluentui/react-badge_v9.1.30",
|
7
73
|
"version": "9.1.30",
|
8
74
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,36 @@
|
|
1
1
|
# Change Log - @fluentui/react-badge
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 05 Sep 2023 13:23:20 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.32](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v9.1.32)
|
8
|
+
|
9
|
+
Tue, 05 Sep 2023 13:23:20 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.1.31..@fluentui/react-badge_v9.1.32)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: migrate package to use JSX importSource ([PR #28959](https://github.com/microsoft/fluentui/pull/28959) by bernardo.sunderhus@gmail.com)
|
15
|
+
- bumps @swc/helpers version to 0.5.1 ([PR #28989](https://github.com/microsoft/fluentui/pull/28989) by bernardo.sunderhus@gmail.com)
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.4 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.7.3 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
18
|
+
- Bump @fluentui/react-theme to v9.1.12 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
19
|
+
- Bump @fluentui/react-utilities to v9.13.1 ([PR #27840](https://github.com/microsoft/fluentui/pull/27840) by beachball)
|
20
|
+
|
21
|
+
## [9.1.31](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v9.1.31)
|
22
|
+
|
23
|
+
Tue, 29 Aug 2023 12:57:36 GMT
|
24
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.1.30..@fluentui/react-badge_v9.1.31)
|
25
|
+
|
26
|
+
### Patches
|
27
|
+
|
28
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.3 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
29
|
+
- Bump @fluentui/react-utilities to v9.13.0 ([PR #29005](https://github.com/microsoft/fluentui/pull/29005) by beachball)
|
30
|
+
|
7
31
|
## [9.1.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-badge_v9.1.30)
|
8
32
|
|
9
|
-
Thu, 24 Aug 2023 10:
|
33
|
+
Thu, 24 Aug 2023 10:26:35 GMT
|
10
34
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-badge_v9.1.29..@fluentui/react-badge_v9.1.30)
|
11
35
|
|
12
36
|
### Patches
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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\n useBadgeStyles_unstable(state);\n\n useCustomStyleHook_unstable('useBadgeStyles_unstable')(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"],"names":["React","useBadge_unstable","useBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","Badge","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,oBAAoB,QAAQ,gBAAgB;AAIrD;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC
|
1
|
+
{"version":3,"sources":["Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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\n useBadgeStyles_unstable(state);\n\n useCustomStyleHook_unstable('useBadgeStyles_unstable')(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"],"names":["React","useBadge_unstable","useBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","Badge","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,iBAAiB,QAAQ,aAAa;AAC/C,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,oBAAoB,QAAQ,gBAAgB;AAIrD;;CAEC,GACD,OAAO,MAAMC,sBAAyCL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IAEvCN,wBAAwBO;IAExBN,4BAA4B,2BAA2BM;IAEvD,OAAOL,qBAAqBK;AAC9B,GAAG;AAEHJ,MAAMK,WAAW,GAAG"}
|
@@ -1,6 +1,12 @@
|
|
1
|
-
/** @jsxRuntime
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
2
2
|
import { assertSlots } from '@fluentui/react-utilities';
|
3
3
|
export const renderBadge_unstable = (state)=>{
|
4
4
|
assertSlots(state);
|
5
|
-
return /*#__PURE__*/
|
5
|
+
return /*#__PURE__*/ _jsxs(state.root, {
|
6
|
+
children: [
|
7
|
+
state.iconPosition === 'before' && state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
|
8
|
+
state.root.children,
|
9
|
+
state.iconPosition === 'after' && state.icon && /*#__PURE__*/ _jsx(state.icon, {})
|
10
|
+
]
|
11
|
+
});
|
6
12
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderBadge.tsx"],"sourcesContent":["/** @jsxRuntime
|
1
|
+
{"version":3,"sources":["renderBadge.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { BadgeState, BadgeSlots } from './Badge.types';\n\nexport const renderBadge_unstable = (state: BadgeState) => {\n assertSlots<BadgeSlots>(state);\n\n return (\n <state.root>\n {state.iconPosition === 'before' && state.icon && <state.icon />}\n {state.root.children}\n {state.iconPosition === 'after' && state.icon && <state.icon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderBadge_unstable","state","root","iconPosition","icon","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,OAAO,MAAMC,uBAAuB,CAACC;IACnCF,YAAwBE;IAExB,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAME,YAAY,KAAK,YAAYF,MAAMG,IAAI,kBAAI,KAACH,MAAMG,IAAI;YAC5DH,MAAMC,IAAI,CAACG,QAAQ;YACnBJ,MAAME,YAAY,KAAK,WAAWF,MAAMG,IAAI,kBAAI,KAACH,MAAMG,IAAI;;;AAGlE,EAAE"}
|
@@ -3,7 +3,7 @@ import { getNativeElementProps, slot } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
4
4
|
* Returns the props and state required to render the component
|
5
5
|
*/ export const useBadge_unstable = (props, ref)=>{
|
6
|
-
const { shape ='circular'
|
6
|
+
const { shape = 'circular', size = 'medium', iconPosition = 'before', appearance = 'filled', color = 'brand' } = props;
|
7
7
|
const state = {
|
8
8
|
shape,
|
9
9
|
size,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useBadge.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } 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: slot.always(\n getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n };\n\n return state;\n};\n"],"names":["React","getNativeElementProps","slot","useBadge_unstable","props","ref","shape","size","iconPosition","appearance","color","state","components","root","icon","always","elementType","optional"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;CAEC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC
|
1
|
+
{"version":3,"sources":["useBadge.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } 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: slot.always(\n getNativeElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n icon: slot.optional(props.icon, { elementType: 'span' }),\n };\n\n return state;\n};\n"],"names":["React","getNativeElementProps","slot","useBadge_unstable","props","ref","shape","size","iconPosition","appearance","color","state","components","root","icon","always","elementType","optional"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AAGxE;;CAEC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EACJC,QAAQ,UAAU,EAClBC,OAAO,QAAQ,EACfC,eAAe,QAAQ,EACvBC,aAAa,QAAQ,EACrBC,QAAQ,OAAO,EAChB,GAAGN;IAEJ,MAAMO,QAAoB;QACxBL;QACAC;QACAC;QACAC;QACAC;QACAE,YAAY;YACVC,MAAM;YACNC,MAAM;QACR;QACAD,MAAMX,KAAKa,MAAM,CACfd,sBAAsB,OAAO;YAC3BI;YACA,GAAGD,KAAK;QACV,IACA;YAAEY,aAAa;QAAM;QAEvBF,MAAMZ,KAAKe,QAAQ,CAACb,MAAMU,IAAI,EAAE;YAAEE,aAAa;QAAO;IACxD;IAEA,OAAOL;AACT,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CounterBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCounterBadge_unstable } from './useCounterBadge';\nimport { useCounterBadgeStyles_unstable } from './useCounterBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps } from './CounterBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.\n */\nexport const CounterBadge: ForwardRefComponent<CounterBadgeProps> = React.forwardRef((props, ref) => {\n const state = useCounterBadge_unstable(props, ref);\n\n useCounterBadgeStyles_unstable(state);\n\n useCustomStyleHook_unstable('useCounterBadgeStyles_unstable')(state);\n\n return renderBadge_unstable(state);\n});\n\nCounterBadge.displayName = 'CounterBadge';\n"],"names":["React","useCounterBadge_unstable","useCounterBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","CounterBadge","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,8BAA8B,QAAQ,iCAAiC;AAChF,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,oBAAoB,QAAQ,iBAAiB;AAItD;;CAEC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC
|
1
|
+
{"version":3,"sources":["CounterBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useCounterBadge_unstable } from './useCounterBadge';\nimport { useCounterBadgeStyles_unstable } from './useCounterBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps } from './CounterBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.\n */\nexport const CounterBadge: ForwardRefComponent<CounterBadgeProps> = React.forwardRef((props, ref) => {\n const state = useCounterBadge_unstable(props, ref);\n\n useCounterBadgeStyles_unstable(state);\n\n useCustomStyleHook_unstable('useCounterBadgeStyles_unstable')(state);\n\n return renderBadge_unstable(state);\n});\n\nCounterBadge.displayName = 'CounterBadge';\n"],"names":["React","useCounterBadge_unstable","useCounterBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","CounterBadge","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,8BAA8B,QAAQ,iCAAiC;AAChF,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,oBAAoB,QAAQ,iBAAiB;AAItD;;CAEC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQR,yBAAyBM,OAAOC;IAE9CN,+BAA+BO;IAE/BN,4BAA4B,kCAAkCM;IAE9D,OAAOL,qBAAqBK;AAC9B,GAAG;AAEHJ,aAAaK,WAAW,GAAG"}
|
@@ -3,7 +3,7 @@ import { useBadge_unstable } from '../Badge/index';
|
|
3
3
|
/**
|
4
4
|
* Returns the props and state required to render the component
|
5
5
|
*/ export const useCounterBadge_unstable = (props, ref)=>{
|
6
|
-
const { shape ='circular'
|
6
|
+
const { shape = 'circular', appearance = 'filled', showZero = false, overflowCount = 99, count = 0, dot = false } = props;
|
7
7
|
const state = {
|
8
8
|
...useBadge_unstable(props, ref),
|
9
9
|
shape,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useCounterBadge.ts"],"sourcesContent":["import * as React from 'react';\nimport type { BadgeState } from '../Badge/index';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useCounterBadge_unstable = (props: CounterBadgeProps, ref: React.Ref<HTMLElement>): CounterBadgeState => {\n const {\n shape = 'circular',\n appearance = 'filled',\n showZero = false,\n overflowCount = 99,\n count = 0,\n dot = false,\n } = props;\n\n const state: CounterBadgeState = {\n ...(useBadge_unstable(props, ref) as Pick<CounterBadgeState, keyof BadgeState>),\n shape,\n appearance,\n showZero,\n count,\n dot,\n };\n\n if ((count !== 0 || showZero) && !dot && !state.root.children) {\n state.root.children = count > overflowCount ? `${overflowCount}+` : `${count}`;\n }\n\n return state;\n};\n"],"names":["React","useBadge_unstable","useCounterBadge_unstable","props","ref","shape","appearance","showZero","overflowCount","count","dot","state","root","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,iBAAiB,QAAQ,iBAAiB;AAGnD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC
|
1
|
+
{"version":3,"sources":["useCounterBadge.ts"],"sourcesContent":["import * as React from 'react';\nimport type { BadgeState } from '../Badge/index';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useCounterBadge_unstable = (props: CounterBadgeProps, ref: React.Ref<HTMLElement>): CounterBadgeState => {\n const {\n shape = 'circular',\n appearance = 'filled',\n showZero = false,\n overflowCount = 99,\n count = 0,\n dot = false,\n } = props;\n\n const state: CounterBadgeState = {\n ...(useBadge_unstable(props, ref) as Pick<CounterBadgeState, keyof BadgeState>),\n shape,\n appearance,\n showZero,\n count,\n dot,\n };\n\n if ((count !== 0 || showZero) && !dot && !state.root.children) {\n state.root.children = count > overflowCount ? `${overflowCount}+` : `${count}`;\n }\n\n return state;\n};\n"],"names":["React","useBadge_unstable","useCounterBadge_unstable","props","ref","shape","appearance","showZero","overflowCount","count","dot","state","root","children"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,iBAAiB,QAAQ,iBAAiB;AAGnD;;CAEC,GACD,OAAO,MAAMC,2BAA2B,CAACC,OAA0BC;IACjE,MAAM,EACJC,QAAQ,UAAU,EAClBC,aAAa,QAAQ,EACrBC,WAAW,KAAK,EAChBC,gBAAgB,EAAE,EAClBC,QAAQ,CAAC,EACTC,MAAM,KAAK,EACZ,GAAGP;IAEJ,MAAMQ,QAA2B;QAC/B,GAAIV,kBAAkBE,OAAOC,IAAI;QACjCC;QACAC;QACAC;QACAE;QACAC;IACF;IAEA,IAAI,AAACD,CAAAA,UAAU,KAAKF,QAAO,KAAM,CAACG,OAAO,CAACC,MAAMC,IAAI,CAACC,QAAQ,EAAE;QAC7DF,MAAMC,IAAI,CAACC,QAAQ,GAAGJ,QAAQD,gBAAgB,CAAC,EAAEA,cAAc,CAAC,CAAC,GAAG,CAAC,EAAEC,MAAM,CAAC;IAChF;IAEA,OAAOE;AACT,EAAE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["PresenceBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePresenceBadge_unstable } from './usePresenceBadge';\nimport { usePresenceBadgeStyles_unstable } from './usePresenceBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from '../../Badge';\nimport type { PresenceBadgeProps } from './PresenceBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const PresenceBadge: ForwardRefComponent<PresenceBadgeProps> = React.forwardRef((props, ref) => {\n const state = usePresenceBadge_unstable(props, ref);\n\n usePresenceBadgeStyles_unstable(state);\n\n useCustomStyleHook_unstable('usePresenceBadgeStyles_unstable')(state);\n\n return renderBadge_unstable(state);\n});\n\nPresenceBadge.displayName = 'PresenceBadge';\n"],"names":["React","usePresenceBadge_unstable","usePresenceBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","PresenceBadge","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,+BAA+B,QAAQ,kCAAkC;AAClF,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,oBAAoB,QAAQ,cAAc;AAInD;;CAEC,GACD,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC
|
1
|
+
{"version":3,"sources":["PresenceBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { usePresenceBadge_unstable } from './usePresenceBadge';\nimport { usePresenceBadgeStyles_unstable } from './usePresenceBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from '../../Badge';\nimport type { PresenceBadgeProps } from './PresenceBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const PresenceBadge: ForwardRefComponent<PresenceBadgeProps> = React.forwardRef((props, ref) => {\n const state = usePresenceBadge_unstable(props, ref);\n\n usePresenceBadgeStyles_unstable(state);\n\n useCustomStyleHook_unstable('usePresenceBadgeStyles_unstable')(state);\n\n return renderBadge_unstable(state);\n});\n\nPresenceBadge.displayName = 'PresenceBadge';\n"],"names":["React","usePresenceBadge_unstable","usePresenceBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","PresenceBadge","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,+BAA+B,QAAQ,kCAAkC;AAClF,SAASC,2BAA2B,QAAQ,kCAAkC;AAC9E,SAASC,oBAAoB,QAAQ,cAAc;AAInD;;CAEC,GACD,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQR,0BAA0BM,OAAOC;IAE/CN,gCAAgCO;IAEhCN,4BAA4B,mCAAmCM;IAE/D,OAAOL,qBAAqBK;AAC9B,GAAG;AAEHJ,cAAcK,WAAW,GAAG"}
|
@@ -35,7 +35,7 @@ const DEFAULT_STRINGS = {
|
|
35
35
|
/**
|
36
36
|
* Returns the props and state required to render the component
|
37
37
|
*/ export const usePresenceBadge_unstable = (props, ref)=>{
|
38
|
-
const { size ='medium'
|
38
|
+
const { size = 'medium', status = 'available', outOfOffice = false } = props;
|
39
39
|
const statusText = DEFAULT_STRINGS[status];
|
40
40
|
const oofText = props.outOfOffice && props.status !== 'out-of-office' ? ` ${DEFAULT_STRINGS['out-of-office']}` : '';
|
41
41
|
const IconElement = iconMap(status, outOfOffice, size);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["usePresenceBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceAwayRegular,\n presenceBlockedRegular,\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 ? presenceAwayRegular[size] : presenceAwayFilled[size];\n case 'blocked':\n return presenceBlockedRegular[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 blocked: 'blocked',\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: slot.optional(props.icon, {\n defaultProps: {\n children: IconElement ? <IconElement /> : null,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n },\n ref,\n ),\n status,\n outOfOffice,\n };\n\n return state;\n};\n"],"names":["React","slot","presenceAvailableFilled","presenceAvailableRegular","presenceAwayFilled","presenceAwayRegular","presenceBlockedRegular","presenceBusyFilled","presenceDndFilled","presenceDndRegular","presenceOfflineRegular","presenceOofRegular","presenceUnknownRegular","useBadge_unstable","iconMap","status","outOfOffice","size","DEFAULT_STRINGS","busy","away","available","offline","unknown","blocked","usePresenceBadge_unstable","props","ref","statusText","oofText","IconElement","state","role","icon","optional","defaultProps","children","renderByDefault","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SACEC,uBAAuB,EACvBC,wBAAwB,EACxBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,kBAAkB,EAClBC,iBAAiB,EACjBC,kBAAkB,EAClBC,sBAAsB,EACtBC,kBAAkB,EAClBC,sBAAsB,QACjB,kBAAkB;AACzB,SAASC,iBAAiB,QAAQ,iBAAiB;AAGnD,MAAMC,UAAU,CAACC,QAAsCC,aAAsBC
|
1
|
+
{"version":3,"sources":["usePresenceBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { slot } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceAwayRegular,\n presenceBlockedRegular,\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 ? presenceAwayRegular[size] : presenceAwayFilled[size];\n case 'blocked':\n return presenceBlockedRegular[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 blocked: 'blocked',\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: slot.optional(props.icon, {\n defaultProps: {\n children: IconElement ? <IconElement /> : null,\n },\n renderByDefault: true,\n elementType: 'span',\n }),\n },\n ref,\n ),\n status,\n outOfOffice,\n };\n\n return state;\n};\n"],"names":["React","slot","presenceAvailableFilled","presenceAvailableRegular","presenceAwayFilled","presenceAwayRegular","presenceBlockedRegular","presenceBusyFilled","presenceDndFilled","presenceDndRegular","presenceOfflineRegular","presenceOofRegular","presenceUnknownRegular","useBadge_unstable","iconMap","status","outOfOffice","size","DEFAULT_STRINGS","busy","away","available","offline","unknown","blocked","usePresenceBadge_unstable","props","ref","statusText","oofText","IconElement","state","role","icon","optional","defaultProps","children","renderByDefault","elementType"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SACEC,uBAAuB,EACvBC,wBAAwB,EACxBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,kBAAkB,EAClBC,iBAAiB,EACjBC,kBAAkB,EAClBC,sBAAsB,EACtBC,kBAAkB,EAClBC,sBAAsB,QACjB,kBAAkB;AACzB,SAASC,iBAAiB,QAAQ,iBAAiB;AAGnD,MAAMC,UAAU,CAACC,QAAsCC,aAAsBC;IAC3E,OAAQF;QACN,KAAK;YACH,OAAOC,cAAcb,wBAAwB,CAACc,KAAK,GAAGf,uBAAuB,CAACe,KAAK;QACrF,KAAK;YACH,OAAOD,cAAcX,mBAAmB,CAACY,KAAK,GAAGb,kBAAkB,CAACa,KAAK;QAC3E,KAAK;YACH,OAAOX,sBAAsB,CAACW,KAAK;QACrC,KAAK;YACH,OAAOD,cAAcJ,sBAAsB,CAACK,KAAK,GAAGV,kBAAkB,CAACU,KAAK;QAC9E,KAAK;YACH,OAAOD,cAAcP,kBAAkB,CAACQ,KAAK,GAAGT,iBAAiB,CAACS,KAAK;QACzE,KAAK;YACH,OAAOP,sBAAsB,CAACO,KAAK;QACrC,KAAK;YACH,OAAON,kBAAkB,CAACM,KAAK;QACjC,KAAK;YACH,OAAOL,sBAAsB,CAACK,KAAK;IACvC;AACF;AAEA,MAAMC,kBAAkB;IACtBC,MAAM;IACN,iBAAiB;IACjBC,MAAM;IACNC,WAAW;IACXC,SAAS;IACT,kBAAkB;IAClBC,SAAS;IACTC,SAAS;AACX;AAEA;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEV,OAAO,QAAQ,EAAEF,SAAS,WAAW,EAAEC,cAAc,KAAK,EAAE,GAAGU;IAEvE,MAAME,aAAaV,eAAe,CAACH,OAAO;IAC1C,MAAMc,UAAUH,MAAMV,WAAW,IAAIU,MAAMX,MAAM,KAAK,kBAAkB,CAAC,CAAC,EAAEG,eAAe,CAAC,gBAAgB,CAAC,CAAC,GAAG;IAEjH,MAAMY,cAAchB,QAAQC,QAAQC,aAAaC;IAEjD,MAAMc,QAA4B;QAChC,GAAGlB,kBACD;YACE,cAAce,aAAaC;YAC3BG,MAAM;YACN,GAAGN,KAAK;YACRT;YACAgB,MAAMhC,KAAKiC,QAAQ,CAACR,MAAMO,IAAI,EAAE;gBAC9BE,cAAc;oBACZC,UAAUN,4BAAc,oBAACA,qBAAiB;gBAC5C;gBACAO,iBAAiB;gBACjBC,aAAa;YACf;QACF,GACAX,IACD;QACDZ;QACAC;IACF;IAEA,OAAOe;AACT,EAAE"}
|
package/lib-commonjs/Badge.js
CHANGED
@@ -2,5 +2,5 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./components/Badge/index"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Badge.js"],"sourcesContent":["export * from './components/Badge/index';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["Badge.js"],"sourcesContent":["export * from './components/Badge/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
|
@@ -2,5 +2,5 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./components/CounterBadge/index"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["CounterBadge.js"],"sourcesContent":["export * from './components/CounterBadge/index';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["CounterBadge.js"],"sourcesContent":["export * from './components/CounterBadge/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
|
@@ -2,5 +2,5 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./components/PresenceBadge/index"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["PresenceBadge.js"],"sourcesContent":["export * from './components/PresenceBadge/index';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["PresenceBadge.js"],"sourcesContent":["export * from './components/PresenceBadge/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
|
@@ -4,18 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
});
|
5
5
|
Object.defineProperty(exports, "Badge", {
|
6
6
|
enumerable: true,
|
7
|
-
get: ()
|
7
|
+
get: function() {
|
8
|
+
return Badge;
|
9
|
+
}
|
8
10
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
11
13
|
const _useBadge = require("./useBadge");
|
12
|
-
const
|
13
|
-
const
|
14
|
+
const _useBadgeStylesstyles = require("./useBadgeStyles.styles");
|
15
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
14
16
|
const _renderBadge = require("./renderBadge");
|
15
17
|
const Badge = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
16
18
|
const state = (0, _useBadge.useBadge_unstable)(props, ref);
|
17
|
-
(0,
|
18
|
-
(0,
|
19
|
+
(0, _useBadgeStylesstyles.useBadgeStyles_unstable)(state);
|
20
|
+
(0, _reactsharedcontexts.useCustomStyleHook_unstable)('useBadgeStyles_unstable')(state);
|
19
21
|
return (0, _renderBadge.renderBadge_unstable)(state);
|
20
22
|
});
|
21
23
|
Badge.displayName = 'Badge';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Badge.js"],"sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from './renderBadge';\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */ export const Badge = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useBadge_unstable(props, ref);\n useBadgeStyles_unstable(state);\n useCustomStyleHook_unstable('useBadgeStyles_unstable')(state);\n return renderBadge_unstable(state);\n});\nBadge.displayName = 'Badge';\n"],"names":["Badge","React","forwardRef","props","ref","state","useBadge_unstable","useBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","displayName"],"mappings":";;;;+BAOiBA
|
1
|
+
{"version":3,"sources":["Badge.js"],"sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\nimport { renderBadge_unstable } from './renderBadge';\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */ export const Badge = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useBadge_unstable(props, ref);\n useBadgeStyles_unstable(state);\n useCustomStyleHook_unstable('useBadgeStyles_unstable')(state);\n return renderBadge_unstable(state);\n});\nBadge.displayName = 'Badge';\n"],"names":["Badge","React","forwardRef","props","ref","state","useBadge_unstable","useBadgeStyles_unstable","useCustomStyleHook_unstable","renderBadge_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;0BACW;sCACM;qCACI;6BACP;AAG1B,MAAMA,QAAQ,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC5D,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,6CAAuB,EAACF;IACxBG,IAAAA,gDAA2B,EAAC,2BAA2BH;IACvD,OAAOI,IAAAA,iCAAoB,EAACJ;AAChC;AACAL,MAAMU,WAAW,GAAG"}
|
@@ -2,8 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
|
-
const
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
6
|
+
_export_star._(require("./Badge"), exports);
|
7
|
+
_export_star._(require("./renderBadge"), exports);
|
8
|
+
_export_star._(require("./useBadge"), exports);
|
9
|
+
_export_star._(require("./useBadgeStyles.styles"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Badge';\nexport * from './renderBadge';\nexport * from './useBadge';\nexport * from './useBadgeStyles.styles';\n"],"names":[],"mappings":";;;;;
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Badge';\nexport * from './renderBadge';\nexport * from './useBadge';\nexport * from './useBadgeStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
|
@@ -1,14 +1,22 @@
|
|
1
|
-
/** @jsxRuntime
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ "use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
5
5
|
Object.defineProperty(exports, "renderBadge_unstable", {
|
6
6
|
enumerable: true,
|
7
|
-
get: ()
|
7
|
+
get: function() {
|
8
|
+
return renderBadge_unstable;
|
9
|
+
}
|
8
10
|
});
|
9
|
-
const
|
10
|
-
const
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
12
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
11
13
|
const renderBadge_unstable = (state)=>{
|
12
|
-
(0,
|
13
|
-
return /*#__PURE__*/ (0,
|
14
|
+
(0, _reactutilities.assertSlots)(state);
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
16
|
+
children: [
|
17
|
+
state.iconPosition === 'before' && state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
|
18
|
+
state.root.children,
|
19
|
+
state.iconPosition === 'after' && state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {})
|
20
|
+
]
|
21
|
+
});
|
14
22
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["renderBadge.js"],"sourcesContent":["/** @jsxRuntime
|
1
|
+
{"version":3,"sources":["renderBadge.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\nexport const renderBadge_unstable = (state)=>{\n assertSlots(state);\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n state.iconPosition === 'before' && state.icon && /*#__PURE__*/ _jsx(state.icon, {}),\n state.root.children,\n state.iconPosition === 'after' && state.icon && /*#__PURE__*/ _jsx(state.icon, {})\n ]\n });\n};\n"],"names":["renderBadge_unstable","state","assertSlots","_jsxs","root","children","iconPosition","icon","_jsx"],"mappings":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAEjEA;;;eAAAA;;;4BAF+G;gCAChG;AACrB,MAAMA,uBAAuB,CAACC;IACjCC,IAAAA,2BAAW,EAACD;IACZ,OAAO,WAAW,GAAGE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,EAAE;QACnCC,UAAU;YACNJ,MAAMK,YAAY,KAAK,YAAYL,MAAMM,IAAI,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACP,MAAMM,IAAI,EAAE,CAAC;YACjFN,MAAMG,IAAI,CAACC,QAAQ;YACnBJ,MAAMK,YAAY,KAAK,WAAWL,MAAMM,IAAI,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACP,MAAMM,IAAI,EAAE,CAAC;SACnF;IACL;AACJ"}
|
@@ -4,13 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
});
|
5
5
|
Object.defineProperty(exports, "useBadge_unstable", {
|
6
6
|
enumerable: true,
|
7
|
-
get: ()
|
7
|
+
get: function() {
|
8
|
+
return useBadge_unstable;
|
9
|
+
}
|
8
10
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/
|
11
|
-
const
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
12
14
|
const useBadge_unstable = (props, ref)=>{
|
13
|
-
const { shape ='circular'
|
15
|
+
const { shape = 'circular', size = 'medium', iconPosition = 'before', appearance = 'filled', color = 'brand' } = props;
|
14
16
|
const state = {
|
15
17
|
shape,
|
16
18
|
size,
|
@@ -21,13 +23,13 @@ const useBadge_unstable = (props, ref)=>{
|
|
21
23
|
root: 'div',
|
22
24
|
icon: 'span'
|
23
25
|
},
|
24
|
-
root:
|
26
|
+
root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
|
25
27
|
ref,
|
26
28
|
...props
|
27
29
|
}), {
|
28
30
|
elementType: 'div'
|
29
31
|
}),
|
30
|
-
icon:
|
32
|
+
icon: _reactutilities.slot.optional(props.icon, {
|
31
33
|
elementType: 'span'
|
32
34
|
})
|
33
35
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useBadge.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Returns the props and state required to render the component\n */ export const useBadge_unstable = (props, ref)=>{\n const { shape ='circular'
|
1
|
+
{"version":3,"sources":["useBadge.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\n/**\n * Returns the props and state required to render the component\n */ export const useBadge_unstable = (props, ref)=>{\n const { shape = 'circular', size = 'medium', iconPosition = 'before', appearance = 'filled', color = 'brand' } = props;\n const state = {\n shape,\n size,\n iconPosition,\n appearance,\n color,\n components: {\n root: 'div',\n icon: 'span'\n },\n root: slot.always(getNativeElementProps('div', {\n ref,\n ...props\n }), {\n elementType: 'div'\n }),\n icon: slot.optional(props.icon, {\n elementType: 'span'\n })\n };\n return state;\n};\n"],"names":["useBadge_unstable","props","ref","shape","size","iconPosition","appearance","color","state","components","root","icon","slot","always","getNativeElementProps","elementType","optional"],"mappings":";;;;+BAIiBA;;;eAAAA;;;;iEAJM;gCACqB;AAGjC,MAAMA,oBAAoB,CAACC,OAAOC;IACzC,MAAM,EAAEC,QAAQ,UAAU,EAAEC,OAAO,QAAQ,EAAEC,eAAe,QAAQ,EAAEC,aAAa,QAAQ,EAAEC,QAAQ,OAAO,EAAE,GAAGN;IACjH,MAAMO,QAAQ;QACVL;QACAC;QACAC;QACAC;QACAC;QACAE,YAAY;YACRC,MAAM;YACNC,MAAM;QACV;QACAD,MAAME,oBAAI,CAACC,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3CZ;YACA,GAAGD,KAAK;QACZ,IAAI;YACAc,aAAa;QACjB;QACAJ,MAAMC,oBAAI,CAACI,QAAQ,CAACf,MAAMU,IAAI,EAAE;YAC5BI,aAAa;QACjB;IACJ;IACA,OAAOP;AACX"}
|
@@ -9,25 +9,29 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
badgeClassNames: ()
|
13
|
-
|
12
|
+
badgeClassNames: function() {
|
13
|
+
return badgeClassNames;
|
14
|
+
},
|
15
|
+
useBadgeStyles_unstable: function() {
|
16
|
+
return useBadgeStyles_unstable;
|
17
|
+
}
|
14
18
|
});
|
15
19
|
const _react = require("@griffel/react");
|
16
|
-
const
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
17
21
|
const badgeClassNames = {
|
18
22
|
root: 'fui-Badge',
|
19
23
|
icon: 'fui-Badge__icon'
|
20
24
|
};
|
21
25
|
// The text content of the badge has additional horizontal padding, but there is no `text` slot to add that padding to.
|
22
26
|
// Instead, add extra padding to the root, and a negative margin on the icon to "remove" the extra padding on the icon.
|
23
|
-
const textPadding =
|
24
|
-
const useRootClassName = /*#__PURE__*/ (0, _react
|
27
|
+
const textPadding = _reacttheme.tokens.spacingHorizontalXXS;
|
28
|
+
const useRootClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1l7mb74", "rntuq2r", [
|
25
29
|
".r1l7mb74{display:inline-flex;box-sizing:border-box;align-items:center;justify-content:center;position:relative;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase200);height:20px;width:20px;min-width:max-content;padding:0 calc(var(--spacingHorizontalXS) + var(--spacingHorizontalXXS));border-radius:var(--borderRadiusCircular);border-color:var(--colorTransparentStroke);}",
|
26
30
|
".r1l7mb74::after{content:\"\";position:absolute;top:0;left:0;bottom:0;right:0;border-style:solid;border-color:inherit;border-width:var(--strokeWidthThin);border-radius:inherit;}",
|
27
31
|
".rntuq2r{display:inline-flex;box-sizing:border-box;align-items:center;justify-content:center;position:relative;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase200);height:20px;width:20px;min-width:max-content;padding:0 calc(var(--spacingHorizontalXS) + var(--spacingHorizontalXXS));border-radius:var(--borderRadiusCircular);border-color:var(--colorTransparentStroke);}",
|
28
32
|
".rntuq2r::after{content:\"\";position:absolute;top:0;right:0;bottom:0;left:0;border-style:solid;border-color:inherit;border-width:var(--strokeWidthThin);border-radius:inherit;}"
|
29
33
|
]);
|
30
|
-
const useRootStyles = /*#__PURE__*/ (0, _react
|
34
|
+
const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
|
31
35
|
fontSmallToTiny: {
|
32
36
|
Bahqtrf: "fk6fouc",
|
33
37
|
Be2twd7: "f13mqy1h",
|
@@ -539,10 +543,10 @@ const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
539
543
|
".fvq8iai{border-bottom-color:var(--colorPaletteYellowBorder1);}"
|
540
544
|
]
|
541
545
|
});
|
542
|
-
const useIconRootClassName = /*#__PURE__*/ (0, _react
|
546
|
+
const useIconRootClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rttl5z0", null, [
|
543
547
|
".rttl5z0{display:flex;line-height:1;margin:0 calc(-1 * var(--spacingHorizontalXXS));font-size:12px;}"
|
544
548
|
]);
|
545
|
-
const useIconStyles = /*#__PURE__*/ (0, _react
|
549
|
+
const useIconStyles = /*#__PURE__*/ (0, _react.__styles)({
|
546
550
|
beforeText: {
|
547
551
|
t21cq0: [
|
548
552
|
"f1t8l4o1",
|