@fluentui/react-persona 9.2.14 → 9.2.15
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +46 -1
- package/CHANGELOG.md +16 -2
- package/lib/Persona.js +0 -1
- package/lib/Persona.js.map +1 -1
- package/lib/components/Persona/Persona.js +5 -7
- package/lib/components/Persona/Persona.js.map +1 -1
- package/lib/components/Persona/Persona.types.js +1 -2
- package/lib/components/Persona/Persona.types.js.map +1 -1
- package/lib/components/Persona/index.js +0 -1
- package/lib/components/Persona/index.js.map +1 -1
- package/lib/components/Persona/renderPersona.js +6 -14
- package/lib/components/Persona/renderPersona.js.map +1 -1
- package/lib/components/Persona/usePersona.js +68 -69
- package/lib/components/Persona/usePersona.js.map +1 -1
- package/lib/components/Persona/usePersonaStyles.styles.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Persona.js +0 -3
- package/lib-commonjs/Persona.js.map +1 -1
- package/lib-commonjs/components/Persona/Persona.js +1 -3
- package/lib-commonjs/components/Persona/Persona.js.map +1 -1
- package/lib-commonjs/components/Persona/Persona.types.js +0 -3
- package/lib-commonjs/components/Persona/Persona.types.js.map +1 -1
- package/lib-commonjs/components/Persona/index.js +0 -3
- package/lib-commonjs/components/Persona/index.js.map +1 -1
- package/lib-commonjs/components/Persona/renderPersona.js +1 -3
- package/lib-commonjs/components/Persona/renderPersona.js.map +1 -1
- package/lib-commonjs/components/Persona/usePersona.js +1 -3
- package/lib-commonjs/components/Persona/usePersona.js.map +1 -1
- package/lib-commonjs/components/Persona/usePersonaStyles.styles.js +0 -2
- package/lib-commonjs/components/Persona/usePersonaStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +7 -7
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,52 @@
|
|
2
2
|
"name": "@fluentui/react-persona",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Wed, 31 May 2023 06:42:59 GMT",
|
6
|
+
"tag": "@fluentui/react-persona_v9.2.15",
|
7
|
+
"version": "9.2.15",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "seanmonahan@microsoft.com",
|
12
|
+
"package": "@fluentui/react-persona",
|
13
|
+
"commit": "d640b972d7ac86bfb76ae6c6329f12cdd33b3b7c",
|
14
|
+
"comment": "chore: Update Griffel to v1.5.7."
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-persona",
|
19
|
+
"comment": "Bump @fluentui/react-avatar to v9.5.5",
|
20
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-persona",
|
25
|
+
"comment": "Bump @fluentui/react-badge to v9.1.15",
|
26
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-persona",
|
31
|
+
"comment": "Bump @fluentui/react-utilities to v9.9.2",
|
32
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-persona",
|
37
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6",
|
38
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-persona",
|
43
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22",
|
44
|
+
"commit": "17ca96c6b7f684f36a5c63e40e78b4986a86c713"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
}
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"date": "Thu, 25 May 2023 10:00:48 GMT",
|
6
51
|
"tag": "@fluentui/react-persona_v9.2.14",
|
7
52
|
"version": "9.2.14",
|
8
53
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
# Change Log - @fluentui/react-persona
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 31 May 2023 06:42:59 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.2.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.15)
|
8
|
+
|
9
|
+
Wed, 31 May 2023 06:42:59 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.14..@fluentui/react-persona_v9.2.15)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: Update Griffel to v1.5.7. ([PR #27925](https://github.com/microsoft/fluentui/pull/27925) by seanmonahan@microsoft.com)
|
15
|
+
- Bump @fluentui/react-avatar to v9.5.5 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
16
|
+
- Bump @fluentui/react-badge to v9.1.15 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
17
|
+
- Bump @fluentui/react-utilities to v9.9.2 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
18
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.6 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
19
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.22 ([PR #28054](https://github.com/microsoft/fluentui/pull/28054) by beachball)
|
20
|
+
|
7
21
|
## [9.2.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.14)
|
8
22
|
|
9
|
-
Thu, 25 May 2023
|
23
|
+
Thu, 25 May 2023 10:00:48 GMT
|
10
24
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.13..@fluentui/react-persona_v9.2.14)
|
11
25
|
|
12
26
|
### Patches
|
package/lib/Persona.js
CHANGED
package/lib/Persona.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["Persona.ts"],"sourcesContent":["export * from './components/Persona/index';\n"],"names":[],"mappings":"AAAA,cAAc,6BAA6B"}
|
@@ -6,12 +6,10 @@ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
7
7
|
* A Persona is a visual representation of a person or status that showcases an Avatar, PresenceBadge,
|
8
8
|
* or an Avatar with a PresenceBadge.
|
9
|
-
*/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
return renderPersona_unstable(state);
|
9
|
+
*/ export const Persona = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
10
|
+
const state = usePersona_unstable(props, ref);
|
11
|
+
usePersonaStyles_unstable(state);
|
12
|
+
useCustomStyleHook_unstable('usePersonaStyles_unstable')(state);
|
13
|
+
return renderPersona_unstable(state);
|
15
14
|
});
|
16
15
|
Persona.displayName = 'Persona';
|
17
|
-
//# sourceMappingURL=Persona.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["Persona.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderPersona_unstable } from './renderPersona';\nimport { usePersona_unstable } from './usePersona';\nimport { usePersonaStyles_unstable } from './usePersonaStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { PersonaProps } from './Persona.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A Persona is a visual representation of a person or status that showcases an Avatar, PresenceBadge,\n * or an Avatar with a PresenceBadge.\n */\nexport const Persona: ForwardRefComponent<PersonaProps> = React.forwardRef((props, ref) => {\n const state = usePersona_unstable(props, ref);\n\n usePersonaStyles_unstable(state);\n\n useCustomStyleHook_unstable('usePersonaStyles_unstable')(state);\n\n return renderPersona_unstable(state);\n});\n\nPersona.displayName = 'Persona';\n"],"names":["React","renderPersona_unstable","usePersona_unstable","usePersonaStyles_unstable","useCustomStyleHook_unstable","Persona","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SAASC,yBAAyB,QAAQ,4BAA4B;AAGtE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,wBAA6CL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACzF,MAAMC,QAAQP,oBAAoBK,OAAOC;IAEzCL,0BAA0BM;IAE1BL,4BAA4B,6BAA6BK;IAEzD,OAAOR,uBAAuBQ;AAChC,GAAG;AAEHJ,QAAQK,WAAW,GAAG"}
|
@@ -1,2 +1 @@
|
|
1
|
-
export {};
|
2
|
-
//# sourceMappingURL=Persona.types.js.map
|
1
|
+
export { };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["Persona.types.ts"],"sourcesContent":["import { Avatar } from '@fluentui/react-avatar';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type PersonaSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * Avatar to display.\n *\n * If a PresenceBadge and an Avatar are provided, the Avatar will display the PresenceBadge as its presence.\n */\n avatar?: Slot<typeof Avatar>;\n\n /**\n * PresenceBadge to display.\n *\n * If `presenceOnly` is true, the PresenceBadge will be displayed instead of the Avatar.\n */\n presence?: Slot<typeof PresenceBadge>;\n\n /**\n * The first line of text in the Persona, larger than the rest of the lines.\n *\n * `primaryText` defaults to the `name` prop. We recomend to only use `name`, use `primaryText` when the text is\n * different than the `name` prop.\n */\n primaryText?: Slot<'span'>;\n\n /**\n * The second line of text in the Persona.\n */\n secondaryText?: Slot<'span'>;\n\n /**\n * The third line of text in the Persona.\n */\n tertiaryText?: Slot<'span'>;\n\n /**\n * The fourth line of text in the Persona.\n */\n quaternaryText?: Slot<'span'>;\n};\n\n/**\n * Persona Props\n */\nexport type PersonaProps = ComponentProps<PersonaSlots> & {\n /**\n * The name of the person or entity represented by the Persona.\n *\n * When `primaryText` is not provided, this will be used as the default value for `primaryText`.\n */\n name?: string;\n\n /**\n * Whether to display only the presence.\n *\n * @default false\n */\n presenceOnly?: boolean;\n\n /**\n * The size of a Persona and its text.\n *\n * @default medium\n */\n size?: 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'huge';\n\n /**\n * The position of the text relative to the avatar/presence.\n *\n * @default after\n */\n textPosition?: 'after' | 'before' | 'below';\n\n /**\n * The vertical alignment of the text relative to the avatar/presence.\n *\n * @default start\n */\n textAlignment?: 'center' | 'start';\n};\n\n/**\n * State used in rendering Persona\n */\nexport type PersonaState = ComponentState<PersonaSlots> &\n Required<Pick<PersonaProps, 'presenceOnly' | 'size' | 'textAlignment' | 'textPosition'>> & {\n /**\n * The number of text lines used.\n */\n numTextLines: number;\n };\n"],"names":[],"mappings":"AAAA,WA8FI"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './Persona';\nexport * from './Persona.types';\nexport * from './renderPersona';\nexport * from './usePersona';\nexport * from './usePersonaStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,YAAY;AAC1B,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC,cAAc,eAAe;AAC7B,cAAc,4BAA4B"}
|
@@ -1,18 +1,10 @@
|
|
1
|
-
/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';
|
2
2
|
import { getSlotsNext } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Render the final JSX of Persona
|
5
|
-
*/
|
6
|
-
|
7
|
-
|
8
|
-
presenceOnly,
|
9
|
-
textPosition
|
10
|
-
} = state;
|
11
|
-
const {
|
12
|
-
slots,
|
13
|
-
slotProps
|
14
|
-
} = getSlotsNext(state);
|
15
|
-
const coin = presenceOnly ? slots.presence && /*#__PURE__*/createElement(slots.presence, slotProps.presence) : slots.avatar && /*#__PURE__*/createElement(slots.avatar, slotProps.avatar);
|
16
|
-
return /*#__PURE__*/createElement(slots.root, slotProps.root, (textPosition === 'after' || textPosition === 'below') && coin, slots.primaryText && /*#__PURE__*/createElement(slots.primaryText, slotProps.primaryText), slots.secondaryText && /*#__PURE__*/createElement(slots.secondaryText, slotProps.secondaryText), slots.tertiaryText && /*#__PURE__*/createElement(slots.tertiaryText, slotProps.tertiaryText), slots.quaternaryText && /*#__PURE__*/createElement(slots.quaternaryText, slotProps.quaternaryText), textPosition === 'before' && coin);
|
5
|
+
*/ export const renderPersona_unstable = (state)=>{
|
6
|
+
const { presenceOnly , textPosition } = state;
|
7
|
+
const { slots , slotProps } = getSlotsNext(state);
|
8
|
+
const coin = presenceOnly ? slots.presence && /*#__PURE__*/ createElement(slots.presence, slotProps.presence) : slots.avatar && /*#__PURE__*/ createElement(slots.avatar, slotProps.avatar);
|
9
|
+
return /*#__PURE__*/ createElement(slots.root, slotProps.root, (textPosition === 'after' || textPosition === 'below') && coin, slots.primaryText && /*#__PURE__*/ createElement(slots.primaryText, slotProps.primaryText), slots.secondaryText && /*#__PURE__*/ createElement(slots.secondaryText, slotProps.secondaryText), slots.tertiaryText && /*#__PURE__*/ createElement(slots.tertiaryText, slotProps.tertiaryText), slots.quaternaryText && /*#__PURE__*/ createElement(slots.quaternaryText, slotProps.quaternaryText), textPosition === 'before' && coin);
|
17
10
|
};
|
18
|
-
//# sourceMappingURL=renderPersona.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["renderPersona.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { PersonaState, PersonaSlots } from './Persona.types';\n\n/**\n * Render the final JSX of Persona\n */\nexport const renderPersona_unstable = (state: PersonaState) => {\n const { presenceOnly, textPosition } = state;\n const { slots, slotProps } = getSlotsNext<PersonaSlots>(state);\n\n const coin = presenceOnly\n ? slots.presence && <slots.presence {...slotProps.presence} />\n : slots.avatar && <slots.avatar {...slotProps.avatar} />;\n\n return (\n <slots.root {...slotProps.root}>\n {(textPosition === 'after' || textPosition === 'below') && coin}\n {slots.primaryText && <slots.primaryText {...slotProps.primaryText} />}\n {slots.secondaryText && <slots.secondaryText {...slotProps.secondaryText} />}\n {slots.tertiaryText && <slots.tertiaryText {...slotProps.tertiaryText} />}\n {slots.quaternaryText && <slots.quaternaryText {...slotProps.quaternaryText} />}\n {textPosition === 'before' && coin}\n </slots.root>\n );\n};\n"],"names":["createElement","getSlotsNext","renderPersona_unstable","state","presenceOnly","textPosition","slots","slotProps","coin","presence","avatar","root","primaryText","secondaryText","tertiaryText","quaternaryText"],"mappings":"AAAA,wBAAwB,GACxB,uBAAuB,GAEvB,SAASA,aAAa,QAAQ,8BAA8B;AAE5D,SAASC,YAAY,QAAQ,4BAA4B;AAGzD;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC,QAAwB;IAC7D,MAAM,EAAEC,aAAY,EAAEC,aAAY,EAAE,GAAGF;IACvC,MAAM,EAAEG,MAAK,EAAEC,UAAS,EAAE,GAAGN,aAA2BE;IAExD,MAAMK,OAAOJ,eACTE,MAAMG,QAAQ,kBAAI,AAfxB,cAeyBH,MAAMG,QAAQ,EAAKF,UAAUE,QAAQ,IACxDH,MAAMI,MAAM,kBAAI,AAhBtB,cAgBuBJ,MAAMI,MAAM,EAAKH,UAAUG,MAAM,CAAI;IAE1D,qBACE,AAnBJ,cAmBKJ,MAAMK,IAAI,EAAKJ,UAAUI,IAAI,EAC3B,AAACN,CAAAA,iBAAiB,WAAWA,iBAAiB,OAAM,KAAMG,MAC1DF,MAAMM,WAAW,kBAAI,AArB5B,cAqB6BN,MAAMM,WAAW,EAAKL,UAAUK,WAAW,GACjEN,MAAMO,aAAa,kBAAI,AAtB9B,cAsB+BP,MAAMO,aAAa,EAAKN,UAAUM,aAAa,GACvEP,MAAMQ,YAAY,kBAAI,AAvB7B,cAuB8BR,MAAMQ,YAAY,EAAKP,UAAUO,YAAY,GACpER,MAAMS,cAAc,kBAAI,AAxB/B,cAwBgCT,MAAMS,cAAc,EAAKR,UAAUQ,cAAc,GAC1EV,iBAAiB,YAAYG;AAGpC,EAAE"}
|
@@ -10,77 +10,76 @@ import { PresenceBadge } from '@fluentui/react-badge';
|
|
10
10
|
*
|
11
11
|
* @param props - props from this instance of Persona
|
12
12
|
* @param ref - reference to root HTMLElement of Persona
|
13
|
-
*/
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
13
|
+
*/ export const usePersona_unstable = (props, ref)=>{
|
14
|
+
const { name , presenceOnly =false , size ='medium' , textAlignment ='start' , textPosition ='after' } = props;
|
15
|
+
const primaryText = resolveShorthand(props.primaryText, {
|
16
|
+
required: true,
|
17
|
+
defaultProps: {
|
18
|
+
children: name
|
19
|
+
}
|
20
|
+
});
|
21
|
+
const secondaryText = resolveShorthand(props.secondaryText);
|
22
|
+
const tertiaryText = resolveShorthand(props.tertiaryText);
|
23
|
+
const quaternaryText = resolveShorthand(props.quaternaryText);
|
24
|
+
const numTextLines = [
|
25
|
+
primaryText,
|
26
|
+
secondaryText,
|
27
|
+
tertiaryText,
|
28
|
+
quaternaryText
|
29
|
+
].filter(Boolean).length;
|
30
|
+
return {
|
31
|
+
numTextLines,
|
32
|
+
presenceOnly,
|
33
|
+
size,
|
34
|
+
textAlignment,
|
35
|
+
textPosition,
|
36
|
+
components: {
|
37
|
+
root: 'div',
|
38
|
+
avatar: Avatar,
|
39
|
+
presence: PresenceBadge,
|
40
|
+
primaryText: 'span',
|
41
|
+
secondaryText: 'span',
|
42
|
+
tertiaryText: 'span',
|
43
|
+
quaternaryText: 'span'
|
44
|
+
},
|
45
|
+
root: getNativeElementProps('div', {
|
46
|
+
...props,
|
47
|
+
ref
|
48
|
+
}, /* excludedPropNames */ [
|
49
|
+
'name'
|
50
|
+
]),
|
51
|
+
avatar: !presenceOnly ? resolveShorthand(props.avatar, {
|
52
|
+
required: true,
|
53
|
+
defaultProps: {
|
54
|
+
name,
|
55
|
+
badge: props.presence,
|
56
|
+
size: avatarSizes[size]
|
57
|
+
}
|
58
|
+
}) : undefined,
|
59
|
+
presence: presenceOnly ? resolveShorthand(props.presence, {
|
60
|
+
defaultProps: {
|
61
|
+
size: presenceSizes[size]
|
62
|
+
}
|
63
|
+
}) : undefined,
|
64
|
+
primaryText,
|
65
|
+
secondaryText,
|
66
|
+
tertiaryText,
|
67
|
+
quaternaryText
|
68
|
+
};
|
69
69
|
};
|
70
70
|
const presenceSizes = {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
'extra-small': 'tiny',
|
72
|
+
small: 'extra-small',
|
73
|
+
medium: 'small',
|
74
|
+
large: 'medium',
|
75
|
+
'extra-large': 'large',
|
76
|
+
huge: 'large'
|
77
77
|
};
|
78
78
|
const avatarSizes = {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
79
|
+
'extra-small': 20,
|
80
|
+
small: 28,
|
81
|
+
medium: 32,
|
82
|
+
large: 36,
|
83
|
+
'extra-large': 40,
|
84
|
+
huge: 56
|
85
85
|
};
|
86
|
-
//# sourceMappingURL=usePersona.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["usePersona.ts"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport type { PersonaProps, PersonaState } from './Persona.types';\n\n/**\n * Create the state required to render Persona.\n *\n * The returned state can be modified with hooks such as usePersonaStyles_unstable,\n * before being passed to renderPersona_unstable.\n *\n * @param props - props from this instance of Persona\n * @param ref - reference to root HTMLElement of Persona\n */\nexport const usePersona_unstable = (props: PersonaProps, ref: React.Ref<HTMLElement>): PersonaState => {\n const { name, presenceOnly = false, size = 'medium', textAlignment = 'start', textPosition = 'after' } = props;\n\n const primaryText = resolveShorthand(props.primaryText, {\n required: true,\n defaultProps: {\n children: name,\n },\n });\n const secondaryText = resolveShorthand(props.secondaryText);\n const tertiaryText = resolveShorthand(props.tertiaryText);\n const quaternaryText = resolveShorthand(props.quaternaryText);\n\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].filter(Boolean).length;\n\n return {\n numTextLines,\n presenceOnly,\n size,\n textAlignment,\n textPosition,\n\n components: {\n root: 'div',\n avatar: Avatar,\n presence: PresenceBadge,\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n quaternaryText: 'span',\n },\n\n root: getNativeElementProps(\n 'div',\n {\n ...props,\n ref,\n },\n /* excludedPropNames */ ['name'],\n ),\n avatar: !presenceOnly\n ? resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSizes[size],\n },\n })\n : undefined,\n presence: presenceOnly\n ? resolveShorthand(props.presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n })\n : undefined,\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText,\n };\n};\n\nconst presenceSizes = {\n 'extra-small': 'tiny',\n small: 'extra-small',\n medium: 'small',\n large: 'medium',\n 'extra-large': 'large',\n huge: 'large',\n} as const;\n\nconst avatarSizes = {\n 'extra-small': 20,\n small: 28,\n medium: 32,\n large: 36,\n 'extra-large': 40,\n huge: 56,\n} as const;\n"],"names":["React","Avatar","getNativeElementProps","resolveShorthand","PresenceBadge","usePersona_unstable","props","ref","name","presenceOnly","size","textAlignment","textPosition","primaryText","required","defaultProps","children","secondaryText","tertiaryText","quaternaryText","numTextLines","filter","Boolean","length","components","root","avatar","presence","badge","avatarSizes","undefined","presenceSizes","small","medium","large","huge"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ,4BAA4B;AACpF,SAASC,aAAa,QAAQ,wBAAwB;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC,MAA8C;IACrG,MAAM,EAAEC,KAAI,EAAEC,cAAe,KAAK,CAAA,EAAEC,MAAO,SAAQ,EAAEC,eAAgB,QAAO,EAAEC,cAAe,QAAO,EAAE,GAAGN;IAEzG,MAAMO,cAAcV,iBAAiBG,MAAMO,WAAW,EAAE;QACtDC,UAAU,IAAI;QACdC,cAAc;YACZC,UAAUR;QACZ;IACF;IACA,MAAMS,gBAAgBd,iBAAiBG,MAAMW,aAAa;IAC1D,MAAMC,eAAef,iBAAiBG,MAAMY,YAAY;IACxD,MAAMC,iBAAiBhB,iBAAiBG,MAAMa,cAAc;IAE5D,MAAMC,eAAe;QAACP;QAAaI;QAAeC;QAAcC;KAAe,CAACE,MAAM,CAACC,SAASC,MAAM;IAEtG,OAAO;QACLH;QACAX;QACAC;QACAC;QACAC;QAEAY,YAAY;YACVC,MAAM;YACNC,QAAQzB;YACR0B,UAAUvB;YACVS,aAAa;YACbI,eAAe;YACfC,cAAc;YACdC,gBAAgB;QAClB;QAEAM,MAAMvB,sBACJ,OACA;YACE,GAAGI,KAAK;YACRC;QACF,GACA,qBAAqB,GAAG;YAAC;SAAO;QAElCmB,QAAQ,CAACjB,eACLN,iBAAiBG,MAAMoB,MAAM,EAAE;YAC7BZ,UAAU,IAAI;YACdC,cAAc;gBACZP;gBACAoB,OAAOtB,MAAMqB,QAAQ;gBACrBjB,MAAMmB,WAAW,CAACnB,KAAK;YACzB;QACF,KACAoB,SAAS;QACbH,UAAUlB,eACNN,iBAAiBG,MAAMqB,QAAQ,EAAE;YAC/BZ,cAAc;gBACZL,MAAMqB,aAAa,CAACrB,KAAK;YAC3B;QACF,KACAoB,SAAS;QACbjB;QACAI;QACAC;QACAC;IACF;AACF,EAAE;AAEF,MAAMY,gBAAgB;IACpB,eAAe;IACfC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR;AAEA,MAAMN,cAAc;IAClB,eAAe;IACfG,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","personaClassNames","root","avatar","presence","primaryText","secondaryText","tertiaryText","quaternaryText","avatarSpacing","useRootClassName","useStyles","beforeAfterCenter","wkccdc","after","before","B7hvi0a","Budl1dq","below","Bxotwcr","media","Ijaq50","mediaBeforeAfterCenter","start","qb2dma","center","afterAlignToPrimary","Bw0ie65","beforeAlignToPrimary","Br312pm","secondLineSpacing","B6of3ja","primary","secondary","tertiary","quaternary","d","useAvatarSpacingStyles","Bs1gm4r","small","medium","large","huge","t21cq0","jrapky","Frg6f3","usePresenceSpacingStyles","usePersonaStyles_unstable","state","presenceOnly","size","textAlignment","textPosition","alignToPrimary","alignBeforeAfterCenter","primaryTextClassName","optionalTextClassName","useTextClassNames","rootClassName","styles","avatarSpacingStyles","presenceSpacingStyles","className","usePrimaryTextBaseClassName","useOptionalTextBaseClassName","useTextStyles","body1","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","caption1","subtitle2","primaryTextBaseClassName","optionalTextBaseClassName","textStyles","primaryTextSize","alignToPrimaryClassName","numTextLines"],"sources":["../../../src/components/Persona/usePersonaStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { PersonaSlots, PersonaState } from './Persona.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const personaClassNames: SlotClassNames<PersonaSlots> = {\n root: 'fui-Persona',\n avatar: 'fui-Persona__avatar',\n presence: 'fui-Persona__presence',\n primaryText: 'fui-Persona__primaryText',\n secondaryText: 'fui-Persona__secondaryText',\n tertiaryText: 'fui-Persona__tertiaryText',\n quaternaryText: 'fui-Persona__quaternaryText',\n};\n\nconst avatarSpacing = `--fui-Persona__avatar--spacing`;\n\nconst useRootClassName = makeResetStyles({\n display: 'inline-grid',\n gridAutoRows: 'max-content',\n gridAutoFlow: 'column',\n justifyItems: 'start',\n gridTemplateColumns: 'max-content [middle] auto',\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n beforeAfterCenter: {\n // This template is needed to make sure the Avatar is centered when it takes up more space than the text lines\n gridTemplateRows:\n '1fr [primary] max-content [secondary] max-content [tertiary] max-content [quaternary] max-content 1fr',\n },\n\n after: {\n // Intentionally empty\n },\n before: {\n justifyItems: 'end',\n gridTemplateColumns: 'auto [middle] max-content',\n },\n below: {\n gridAutoFlow: 'unset',\n justifyItems: 'center',\n gridTemplateColumns: 'unset',\n },\n\n media: {\n gridRowStart: 'span 5',\n },\n\n mediaBeforeAfterCenter: {\n gridRowStart: 'span 6',\n },\n\n start: {\n alignSelf: 'start',\n },\n center: {\n alignSelf: 'center',\n },\n\n afterAlignToPrimary: {\n alignSelf: 'center',\n gridRowStart: 'unset',\n gridColumnEnd: 'middle',\n },\n beforeAlignToPrimary: {\n alignSelf: 'center',\n gridRowStart: 'unset',\n gridColumnStart: 'middle',\n },\n\n secondLineSpacing: {\n marginTop: '-2px',\n },\n\n primary: { gridRowStart: 'primary' },\n secondary: { gridRowStart: 'secondary' },\n tertiary: { gridRowStart: 'tertiary' },\n quaternary: { gridRowStart: 'quaternary' },\n});\n\nconst useAvatarSpacingStyles = makeStyles({\n 'extra-small': {\n [avatarSpacing]: tokens.spacingHorizontalSNudge,\n },\n small: {\n [avatarSpacing]: tokens.spacingHorizontalS,\n },\n medium: {\n [avatarSpacing]: tokens.spacingHorizontalS,\n },\n large: {\n [avatarSpacing]: tokens.spacingHorizontalMNudge,\n },\n 'extra-large': {\n [avatarSpacing]: tokens.spacingHorizontalMNudge,\n },\n huge: {\n [avatarSpacing]: tokens.spacingHorizontalM,\n },\n after: {\n marginRight: `var(${avatarSpacing})`,\n },\n below: {\n marginBottom: `var(${avatarSpacing})`,\n },\n before: {\n marginLeft: `var(${avatarSpacing})`,\n },\n});\n\nconst usePresenceSpacingStyles = makeStyles({\n small: {\n [avatarSpacing]: tokens.spacingHorizontalSNudge,\n },\n});\n\n/**\n * Apply styling to the Persona slots based on the state\n */\nexport const usePersonaStyles_unstable = (state: PersonaState): PersonaState => {\n const { presenceOnly, size, textAlignment, textPosition } = state;\n\n const alignToPrimary = presenceOnly && textAlignment === 'start' && size !== 'extra-large' && size !== 'huge';\n const alignBeforeAfterCenter = textPosition !== 'below' && textAlignment === 'center';\n const { primaryTextClassName, optionalTextClassName } = useTextClassNames(state, alignToPrimary);\n\n const rootClassName = useRootClassName();\n const styles = useStyles();\n const avatarSpacingStyles = useAvatarSpacingStyles();\n const presenceSpacingStyles = { ...avatarSpacingStyles, ...usePresenceSpacingStyles() };\n\n state.root.className = mergeClasses(\n personaClassNames.root,\n rootClassName,\n alignBeforeAfterCenter && styles.beforeAfterCenter,\n styles[textPosition],\n state.root.className,\n );\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(\n personaClassNames.avatar,\n textPosition !== 'below' && styles.media,\n alignBeforeAfterCenter && styles.mediaBeforeAfterCenter,\n styles[textAlignment],\n avatarSpacingStyles[size],\n avatarSpacingStyles[textPosition],\n state.avatar.className,\n );\n }\n\n if (state.presence) {\n state.presence.className = mergeClasses(\n personaClassNames.presence,\n textPosition !== 'below' && styles.media,\n alignBeforeAfterCenter && styles.mediaBeforeAfterCenter,\n styles[textAlignment],\n presenceSpacingStyles[size],\n presenceSpacingStyles[textPosition],\n textPosition === 'after' && alignToPrimary && styles.afterAlignToPrimary,\n textPosition === 'before' && alignToPrimary && styles.beforeAlignToPrimary,\n state.presence.className,\n );\n }\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n personaClassNames.primaryText,\n alignBeforeAfterCenter && styles.primary,\n primaryTextClassName,\n state.primaryText.className,\n );\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n personaClassNames.secondaryText,\n alignBeforeAfterCenter && styles.secondary,\n optionalTextClassName,\n styles.secondLineSpacing,\n state.secondaryText.className,\n );\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n personaClassNames.tertiaryText,\n alignBeforeAfterCenter && styles.tertiary,\n optionalTextClassName,\n state.tertiaryText.className,\n );\n }\n\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(\n personaClassNames.quaternaryText,\n alignBeforeAfterCenter && styles.quaternary,\n optionalTextClassName,\n state.quaternaryText.className,\n );\n }\n\n return state;\n};\n\nconst usePrimaryTextBaseClassName = makeResetStyles({\n display: 'block',\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1,\n});\n\nconst useOptionalTextBaseClassName = makeResetStyles({\n display: 'block',\n color: tokens.colorNeutralForeground2,\n ...typographyStyles.caption1,\n});\n\nconst useTextStyles = makeStyles({\n beforeAlignToPrimary: {\n gridColumnEnd: 'middle',\n },\n afterAlignToPrimary: {\n gridColumnStart: 'middle',\n },\n\n body1: typographyStyles.body1,\n caption1: typographyStyles.caption1,\n subtitle2: typographyStyles.subtitle2,\n});\n\nconst useTextClassNames = (\n state: PersonaState,\n alignToPrimary: boolean,\n): {\n primaryTextClassName: string;\n optionalTextClassName: string;\n} => {\n const { presenceOnly, size, textPosition } = state;\n const primaryTextBaseClassName = usePrimaryTextBaseClassName();\n const optionalTextBaseClassName = useOptionalTextBaseClassName();\n const textStyles = useTextStyles();\n\n let primaryTextSize;\n let alignToPrimaryClassName;\n\n if (presenceOnly) {\n if (size === 'extra-small') {\n primaryTextSize = state.numTextLines <= 1 && textStyles.caption1;\n } else if (size === 'extra-large' || size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n }\n\n if (alignToPrimary) {\n if (textPosition === 'before') {\n alignToPrimaryClassName = textStyles.beforeAlignToPrimary;\n } else if (textPosition === 'after') {\n alignToPrimaryClassName = textStyles.afterAlignToPrimary;\n }\n }\n } else {\n if (size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n } else if (size === 'extra-large') {\n primaryTextSize = textStyles.subtitle2;\n }\n }\n\n return {\n primaryTextClassName: mergeClasses(primaryTextBaseClassName, primaryTextSize, alignToPrimaryClassName),\n optionalTextClassName: mergeClasses(\n optionalTextBaseClassName,\n !presenceOnly && size === 'huge' && textStyles.body1,\n alignToPrimaryClassName,\n ),\n };\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ;AAC1D,SAASC,MAAM,EAAEC,gBAAgB,QAAQ;AAIzC,OAAO,MAAMC,iBAAA,GAAkD;EAC7DC,IAAA,EAAM;EACNC,MAAA,EAAQ;EACRC,QAAA,EAAU;EACVC,WAAA,EAAa;EACbC,aAAA,EA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IAAID,YAAA,KAAiB,UAAU;QAC7ByB,uBAAA,GAA0BF,UAAA,CAAW/C,oBAAoB;MAC3D,OAAO,IAAIwB,YAAA,KAAiB,SAAS;QACnCyB,uBAAA,GAA0BF,UAAA,CAAWjD,mBAAmB;MAC1D;IACF;EACF,OAAO;IACL,IAAIwB,IAAA,KAAS,QAAQ;MACnB0B,eAAA,GAAkBD,UAAA,CAAWH,SAAS;IACxC,OAAO,IAAItB,IAAA,KAAS,eAAe;MACjC0B,eAAA,GAAkBD,UAAA,CAAWH,SAAS;IACxC;EACF;EAEA,OAAO;IACLjB,oBAAA,EAAsBzD,YAAA,CAAa2E,wBAAA,EAA0BG,eAAA,EAAiBC,uBAAA;IAC9ErB,qBAAA,EAAuB1D,YAAA,CACrB4E,yBAAA,EACA,CAACzB,YAAA,IAAgBC,IAAA,KAAS,UAAUyB,UAAA,CAAWT,KAAK,EACpDW,uBAAA;EAEJ;AACF"}
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","personaClassNames","root","avatar","presence","primaryText","secondaryText","tertiaryText","quaternaryText","avatarSpacing","useRootClassName","useStyles","beforeAfterCenter","wkccdc","after","before","B7hvi0a","Budl1dq","below","Bxotwcr","media","Ijaq50","mediaBeforeAfterCenter","start","qb2dma","center","afterAlignToPrimary","Bw0ie65","beforeAlignToPrimary","Br312pm","secondLineSpacing","B6of3ja","primary","secondary","tertiary","quaternary","d","useAvatarSpacingStyles","Bs1gm4r","small","medium","large","huge","t21cq0","jrapky","Frg6f3","usePresenceSpacingStyles","usePersonaStyles_unstable","state","presenceOnly","size","textAlignment","textPosition","alignToPrimary","alignBeforeAfterCenter","primaryTextClassName","optionalTextClassName","useTextClassNames","rootClassName","styles","avatarSpacingStyles","presenceSpacingStyles","className","usePrimaryTextBaseClassName","useOptionalTextBaseClassName","useTextStyles","body1","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","caption1","subtitle2","primaryTextBaseClassName","optionalTextBaseClassName","textStyles","primaryTextSize","alignToPrimaryClassName","numTextLines"],"sources":["usePersonaStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const personaClassNames = {\n root: 'fui-Persona',\n avatar: 'fui-Persona__avatar',\n presence: 'fui-Persona__presence',\n primaryText: 'fui-Persona__primaryText',\n secondaryText: 'fui-Persona__secondaryText',\n tertiaryText: 'fui-Persona__tertiaryText',\n quaternaryText: 'fui-Persona__quaternaryText'\n};\nconst avatarSpacing = `--fui-Persona__avatar--spacing`;\nconst useRootClassName = makeResetStyles({\n display: 'inline-grid',\n gridAutoRows: 'max-content',\n gridAutoFlow: 'column',\n justifyItems: 'start',\n gridTemplateColumns: 'max-content [middle] auto'\n});\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n beforeAfterCenter: {\n // This template is needed to make sure the Avatar is centered when it takes up more space than the text lines\n gridTemplateRows: '1fr [primary] max-content [secondary] max-content [tertiary] max-content [quaternary] max-content 1fr'\n },\n after: {\n },\n before: {\n justifyItems: 'end',\n gridTemplateColumns: 'auto [middle] max-content'\n },\n below: {\n gridAutoFlow: 'unset',\n justifyItems: 'center',\n gridTemplateColumns: 'unset'\n },\n media: {\n gridRowStart: 'span 5'\n },\n mediaBeforeAfterCenter: {\n gridRowStart: 'span 6'\n },\n start: {\n alignSelf: 'start'\n },\n center: {\n alignSelf: 'center'\n },\n afterAlignToPrimary: {\n alignSelf: 'center',\n gridRowStart: 'unset',\n gridColumnEnd: 'middle'\n },\n beforeAlignToPrimary: {\n alignSelf: 'center',\n gridRowStart: 'unset',\n gridColumnStart: 'middle'\n },\n secondLineSpacing: {\n marginTop: '-2px'\n },\n primary: {\n gridRowStart: 'primary'\n },\n secondary: {\n gridRowStart: 'secondary'\n },\n tertiary: {\n gridRowStart: 'tertiary'\n },\n quaternary: {\n gridRowStart: 'quaternary'\n }\n});\nconst useAvatarSpacingStyles = makeStyles({\n 'extra-small': {\n [avatarSpacing]: tokens.spacingHorizontalSNudge\n },\n small: {\n [avatarSpacing]: tokens.spacingHorizontalS\n },\n medium: {\n [avatarSpacing]: tokens.spacingHorizontalS\n },\n large: {\n [avatarSpacing]: tokens.spacingHorizontalMNudge\n },\n 'extra-large': {\n [avatarSpacing]: tokens.spacingHorizontalMNudge\n },\n huge: {\n [avatarSpacing]: tokens.spacingHorizontalM\n },\n after: {\n marginRight: `var(${avatarSpacing})`\n },\n below: {\n marginBottom: `var(${avatarSpacing})`\n },\n before: {\n marginLeft: `var(${avatarSpacing})`\n }\n});\nconst usePresenceSpacingStyles = makeStyles({\n small: {\n [avatarSpacing]: tokens.spacingHorizontalSNudge\n }\n});\n/**\n * Apply styling to the Persona slots based on the state\n */ export const usePersonaStyles_unstable = (state)=>{\n const { presenceOnly , size , textAlignment , textPosition } = state;\n const alignToPrimary = presenceOnly && textAlignment === 'start' && size !== 'extra-large' && size !== 'huge';\n const alignBeforeAfterCenter = textPosition !== 'below' && textAlignment === 'center';\n const { primaryTextClassName , optionalTextClassName } = useTextClassNames(state, alignToPrimary);\n const rootClassName = useRootClassName();\n const styles = useStyles();\n const avatarSpacingStyles = useAvatarSpacingStyles();\n const presenceSpacingStyles = {\n ...avatarSpacingStyles,\n ...usePresenceSpacingStyles()\n };\n state.root.className = mergeClasses(personaClassNames.root, rootClassName, alignBeforeAfterCenter && styles.beforeAfterCenter, styles[textPosition], state.root.className);\n if (state.avatar) {\n state.avatar.className = mergeClasses(personaClassNames.avatar, textPosition !== 'below' && styles.media, alignBeforeAfterCenter && styles.mediaBeforeAfterCenter, styles[textAlignment], avatarSpacingStyles[size], avatarSpacingStyles[textPosition], state.avatar.className);\n }\n if (state.presence) {\n state.presence.className = mergeClasses(personaClassNames.presence, textPosition !== 'below' && styles.media, alignBeforeAfterCenter && styles.mediaBeforeAfterCenter, styles[textAlignment], presenceSpacingStyles[size], presenceSpacingStyles[textPosition], textPosition === 'after' && alignToPrimary && styles.afterAlignToPrimary, textPosition === 'before' && alignToPrimary && styles.beforeAlignToPrimary, state.presence.className);\n }\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(personaClassNames.primaryText, alignBeforeAfterCenter && styles.primary, primaryTextClassName, state.primaryText.className);\n }\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(personaClassNames.secondaryText, alignBeforeAfterCenter && styles.secondary, optionalTextClassName, styles.secondLineSpacing, state.secondaryText.className);\n }\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(personaClassNames.tertiaryText, alignBeforeAfterCenter && styles.tertiary, optionalTextClassName, state.tertiaryText.className);\n }\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(personaClassNames.quaternaryText, alignBeforeAfterCenter && styles.quaternary, optionalTextClassName, state.quaternaryText.className);\n }\n return state;\n};\nconst usePrimaryTextBaseClassName = makeResetStyles({\n display: 'block',\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1\n});\nconst useOptionalTextBaseClassName = makeResetStyles({\n display: 'block',\n color: tokens.colorNeutralForeground2,\n ...typographyStyles.caption1\n});\nconst useTextStyles = makeStyles({\n beforeAlignToPrimary: {\n gridColumnEnd: 'middle'\n },\n afterAlignToPrimary: {\n gridColumnStart: 'middle'\n },\n body1: typographyStyles.body1,\n caption1: typographyStyles.caption1,\n subtitle2: typographyStyles.subtitle2\n});\nconst useTextClassNames = (state, alignToPrimary)=>{\n const { presenceOnly , size , textPosition } = state;\n const primaryTextBaseClassName = usePrimaryTextBaseClassName();\n const optionalTextBaseClassName = useOptionalTextBaseClassName();\n const textStyles = useTextStyles();\n let primaryTextSize;\n let alignToPrimaryClassName;\n if (presenceOnly) {\n if (size === 'extra-small') {\n primaryTextSize = state.numTextLines <= 1 && textStyles.caption1;\n } else if (size === 'extra-large' || size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n }\n if (alignToPrimary) {\n if (textPosition === 'before') {\n alignToPrimaryClassName = textStyles.beforeAlignToPrimary;\n } else if (textPosition === 'after') {\n alignToPrimaryClassName = textStyles.afterAlignToPrimary;\n }\n }\n } else {\n if (size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n } else if (size === 'extra-large') {\n primaryTextSize = textStyles.subtitle2;\n }\n }\n return {\n primaryTextClassName: mergeClasses(primaryTextBaseClassName, primaryTextSize, alignToPrimaryClassName),\n optionalTextClassName: mergeClasses(optionalTextBaseClassName, !presenceOnly && size === 'huge' && textStyles.body1, alignToPrimaryClassName)\n };\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,uBAAuB;AAChE,OAAO,MAAMC,iBAAiB,GAAG;EAC7BC,IAAI,EAAE,aAAa;EACnBC,MAAM,EAAE,qBAAqB;EAC7BC,QAAQ,EAAE,uBAAuB;EACjCC,WAAW,EAAE,0BAA0B;EACvCC,aAAa,EAAE,4BAA4B;EAC3CC,YAAY,EAAE,2BAA2B;EACzCC,cAAc,EAAE;AACpB,CAAC;AACD,MAAMC,aAAa,GAAI,gCAA+B;AACtD,MAAMC,gBAAgB,gBAAGd,aAAA,yKAMxB,CAAC;AACF;AACA;AACA;AAAI,MAAMe,SAAS,gBAAGd,QAAA;EAAAe,iBAAA;IAAAC,MAAA;EAAA;EAAAC,KAAA;EAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,KAAA;IAAAC,OAAA;IAAAH,OAAA;IAAAC,OAAA;EAAA;EAAAG,KAAA;IAAAC,MAAA;EAAA;EAAAC,sBAAA;IAAAD,MAAA;EAAA;EAAAE,KAAA;IAAAC,MAAA;EAAA;EAAAC,MAAA;IAAAD,MAAA;EAAA;EAAAE,mBAAA;IAAAF,MAAA;IAAAH,MAAA;IAAAM,OAAA;EAAA;EAAAC,oBAAA;IAAAJ,MAAA;IAAAH,MAAA;IAAAQ,OAAA;EAAA;EAAAC,iBAAA;IAAAC,OAAA;EAAA;EAAAC,OAAA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BAAwB,EAAEG,eAAe,EAAEC,uBAAuB,CAAC;IACtGrB,qBAAqB,EAAE1D,YAAY,CAAC4E,yBAAyB,EAAE,CAACzB,YAAY,IAAIC,IAAI,KAAK,MAAM,IAAIyB,UAAU,CAACT,KAAK,EAAEW,uBAAuB;EAChJ,CAAC;AACL,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Persona,\n personaClassNames,\n renderPersona_unstable,\n usePersonaStyles_unstable,\n usePersona_unstable,\n} from './Persona';\nexport type { PersonaProps, PersonaSlots, PersonaState } from './Persona';\n"],"names":["Persona","personaClassNames","renderPersona_unstable","usePersonaStyles_unstable","usePersona_unstable"],"mappings":"AAAA,SACEA,OAAO,EACPC,iBAAiB,EACjBC,sBAAsB,EACtBC,yBAAyB,EACzBC,mBAAmB,QACd,YAAY"}
|
package/lib-commonjs/Persona.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["Persona.js"],"sourcesContent":["export * from './components/Persona/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
@@ -18,6 +18,4 @@ const Persona = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
18
|
(0, _reactSharedContexts.useCustomStyleHook_unstable)('usePersonaStyles_unstable')(state);
|
19
19
|
return (0, _renderPersona.renderPersona_unstable)(state);
|
20
20
|
});
|
21
|
-
Persona.displayName = 'Persona';
|
22
|
-
|
23
|
-
//# sourceMappingURL=Persona.js.map
|
21
|
+
Persona.displayName = 'Persona';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["Persona.js"],"sourcesContent":["import * as React from 'react';\nimport { renderPersona_unstable } from './renderPersona';\nimport { usePersona_unstable } from './usePersona';\nimport { usePersonaStyles_unstable } from './usePersonaStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A Persona is a visual representation of a person or status that showcases an Avatar, PresenceBadge,\n * or an Avatar with a PresenceBadge.\n */ export const Persona = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = usePersona_unstable(props, ref);\n usePersonaStyles_unstable(state);\n useCustomStyleHook_unstable('usePersonaStyles_unstable')(state);\n return renderPersona_unstable(state);\n});\nPersona.displayName = 'Persona';\n"],"names":["Persona","React","forwardRef","props","ref","state","usePersona_unstable","usePersonaStyles_unstable","useCustomStyleHook_unstable","renderPersona_unstable","displayName"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;+BACgB;4BACH;wCACM;qCACE;AAIjC,MAAMA,UAAU,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACpE,MAAMC,QAAQC,IAAAA,+BAAmB,EAACH,OAAOC;IACzCG,IAAAA,iDAAyB,EAACF;IAC1BG,IAAAA,gDAA2B,EAAC,6BAA6BH;IACzD,OAAOI,IAAAA,qCAAsB,EAACJ;AAClC;AACAL,QAAQU,WAAW,GAAG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
@@ -8,6 +8,3 @@ _exportStar(require("./Persona.types"), exports);
|
|
8
8
|
_exportStar(require("./renderPersona"), exports);
|
9
9
|
_exportStar(require("./usePersona"), exports);
|
10
10
|
_exportStar(require("./usePersonaStyles.styles"), exports);
|
11
|
-
//# sourceMappingURL=index.js.map
|
12
|
-
|
13
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Persona';\nexport * from './Persona.types';\nexport * from './renderPersona';\nexport * from './usePersona';\nexport * from './usePersonaStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
@@ -13,6 +13,4 @@ const renderPersona_unstable = (state)=>{
|
|
13
13
|
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
14
14
|
const coin = presenceOnly ? slots.presence && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.presence, slotProps.presence) : slots.avatar && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.avatar, slotProps.avatar);
|
15
15
|
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, (textPosition === 'after' || textPosition === 'below') && coin, slots.primaryText && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.primaryText, slotProps.primaryText), slots.secondaryText && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.secondaryText, slotProps.secondaryText), slots.tertiaryText && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.tertiaryText, slotProps.tertiaryText), slots.quaternaryText && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.quaternaryText, slotProps.quaternaryText), textPosition === 'before' && coin);
|
16
|
-
};
|
17
|
-
|
18
|
-
//# sourceMappingURL=renderPersona.js.map
|
16
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["renderPersona.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Persona\n */ export const renderPersona_unstable = (state)=>{\n const { presenceOnly , textPosition } = state;\n const { slots , slotProps } = getSlotsNext(state);\n const coin = presenceOnly ? slots.presence && /*#__PURE__*/ createElement(slots.presence, slotProps.presence) : slots.avatar && /*#__PURE__*/ createElement(slots.avatar, slotProps.avatar);\n return /*#__PURE__*/ createElement(slots.root, slotProps.root, (textPosition === 'after' || textPosition === 'below') && coin, slots.primaryText && /*#__PURE__*/ createElement(slots.primaryText, slotProps.primaryText), slots.secondaryText && /*#__PURE__*/ createElement(slots.secondaryText, slotProps.secondaryText), slots.tertiaryText && /*#__PURE__*/ createElement(slots.tertiaryText, slotProps.tertiaryText), slots.quaternaryText && /*#__PURE__*/ createElement(slots.quaternaryText, slotProps.quaternaryText), textPosition === 'before' && coin);\n};\n"],"names":["renderPersona_unstable","state","presenceOnly","textPosition","slots","slotProps","getSlotsNext","coin","presence","createElement","avatar","root","primaryText","secondaryText","tertiaryText","quaternaryText"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAIjCA;;aAAAA;;iCAJkE;gCACtD;AAGlB,MAAMA,yBAAyB,CAACC,QAAQ;IAC/C,MAAM,EAAEC,aAAY,EAAGC,aAAY,EAAG,GAAGF;IACzC,MAAM,EAAEG,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACL;IAC5C,MAAMM,OAAOL,eAAeE,MAAMI,QAAQ,IAAI,WAAW,GAAGC,IAAAA,8BAAa,EAACL,MAAMI,QAAQ,EAAEH,UAAUG,QAAQ,IAAIJ,MAAMM,MAAM,IAAI,WAAW,GAAGD,IAAAA,8BAAa,EAACL,MAAMM,MAAM,EAAEL,UAAUK,MAAM,CAAC;IAC3L,OAAO,WAAW,GAAGD,IAAAA,8BAAa,EAACL,MAAMO,IAAI,EAAEN,UAAUM,IAAI,EAAE,AAACR,CAAAA,iBAAiB,WAAWA,iBAAiB,OAAM,KAAMI,MAAMH,MAAMQ,WAAW,IAAI,WAAW,GAAGH,IAAAA,8BAAa,EAACL,MAAMQ,WAAW,EAAEP,UAAUO,WAAW,GAAGR,MAAMS,aAAa,IAAI,WAAW,GAAGJ,IAAAA,8BAAa,EAACL,MAAMS,aAAa,EAAER,UAAUQ,aAAa,GAAGT,MAAMU,YAAY,IAAI,WAAW,GAAGL,IAAAA,8BAAa,EAACL,MAAMU,YAAY,EAAET,UAAUS,YAAY,GAAGV,MAAMW,cAAc,IAAI,WAAW,GAAGN,IAAAA,8BAAa,EAACL,MAAMW,cAAc,EAAEV,UAAUU,cAAc,GAAGZ,iBAAiB,YAAYI;AACliB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["usePersona.js"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { PresenceBadge } from '@fluentui/react-badge';\n/**\n * Create the state required to render Persona.\n *\n * The returned state can be modified with hooks such as usePersonaStyles_unstable,\n * before being passed to renderPersona_unstable.\n *\n * @param props - props from this instance of Persona\n * @param ref - reference to root HTMLElement of Persona\n */ export const usePersona_unstable = (props, ref)=>{\n const { name , presenceOnly =false , size ='medium' , textAlignment ='start' , textPosition ='after' } = props;\n const primaryText = resolveShorthand(props.primaryText, {\n required: true,\n defaultProps: {\n children: name\n }\n });\n const secondaryText = resolveShorthand(props.secondaryText);\n const tertiaryText = resolveShorthand(props.tertiaryText);\n const quaternaryText = resolveShorthand(props.quaternaryText);\n const numTextLines = [\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText\n ].filter(Boolean).length;\n return {\n numTextLines,\n presenceOnly,\n size,\n textAlignment,\n textPosition,\n components: {\n root: 'div',\n avatar: Avatar,\n presence: PresenceBadge,\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n quaternaryText: 'span'\n },\n root: getNativeElementProps('div', {\n ...props,\n ref\n }, /* excludedPropNames */ [\n 'name'\n ]),\n avatar: !presenceOnly ? resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSizes[size]\n }\n }) : undefined,\n presence: presenceOnly ? resolveShorthand(props.presence, {\n defaultProps: {\n size: presenceSizes[size]\n }\n }) : undefined,\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText\n };\n};\nconst presenceSizes = {\n 'extra-small': 'tiny',\n small: 'extra-small',\n medium: 'small',\n large: 'medium',\n 'extra-large': 'large',\n huge: 'large'\n};\nconst avatarSizes = {\n 'extra-small': 20,\n small: 28,\n medium: 32,\n large: 36,\n 'extra-large': 40,\n huge: 56\n};\n"],"names":["usePersona_unstable","props","ref","name","presenceOnly","size","textAlignment","textPosition","primaryText","resolveShorthand","required","defaultProps","children","secondaryText","tertiaryText","quaternaryText","numTextLines","filter","Boolean","length","components","root","avatar","Avatar","presence","PresenceBadge","getNativeElementProps","badge","avatarSizes","undefined","presenceSizes","small","medium","large","huge"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;6BACA;gCACiC;4BAC1B;AASnB,MAAMA,sBAAsB,CAACC,OAAOC,MAAM;IACjD,MAAM,EAAEC,KAAI,EAAGC,cAAc,KAAK,CAAA,EAAGC,MAAM,SAAQ,EAAGC,eAAe,QAAO,EAAGC,cAAc,QAAO,EAAG,GAAGN;IAC1G,MAAMO,cAAcC,IAAAA,gCAAgB,EAACR,MAAMO,WAAW,EAAE;QACpDE,UAAU,IAAI;QACdC,cAAc;YACVC,UAAUT;QACd;IACJ;IACA,MAAMU,gBAAgBJ,IAAAA,gCAAgB,EAACR,MAAMY,aAAa;IAC1D,MAAMC,eAAeL,IAAAA,gCAAgB,EAACR,MAAMa,YAAY;IACxD,MAAMC,iBAAiBN,IAAAA,gCAAgB,EAACR,MAAMc,cAAc;IAC5D,MAAMC,eAAe;QACjBR;QACAK;QACAC;QACAC;KACH,CAACE,MAAM,CAACC,SAASC,MAAM;IACxB,OAAO;QACHH;QACAZ;QACAC;QACAC;QACAC;QACAa,YAAY;YACRC,MAAM;YACNC,QAAQC,mBAAM;YACdC,UAAUC,yBAAa;YACvBjB,aAAa;YACbK,eAAe;YACfC,cAAc;YACdC,gBAAgB;QACpB;QACAM,MAAMK,IAAAA,qCAAqB,EAAC,OAAO;YAC/B,GAAGzB,KAAK;YACRC;QACJ,GAAG,qBAAqB,GAAG;YACvB;SACH;QACDoB,QAAQ,CAAClB,eAAeK,IAAAA,gCAAgB,EAACR,MAAMqB,MAAM,EAAE;YACnDZ,UAAU,IAAI;YACdC,cAAc;gBACVR;gBACAwB,OAAO1B,MAAMuB,QAAQ;gBACrBnB,MAAMuB,WAAW,CAACvB,KAAK;YAC3B;QACJ,KAAKwB,SAAS;QACdL,UAAUpB,eAAeK,IAAAA,gCAAgB,EAACR,MAAMuB,QAAQ,EAAE;YACtDb,cAAc;gBACVN,MAAMyB,aAAa,CAACzB,KAAK;YAC7B;QACJ,KAAKwB,SAAS;QACdrB;QACAK;QACAC;QACAC;IACJ;AACJ;AACA,MAAMe,gBAAgB;IAClB,eAAe;IACfC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACV;AACA,MAAMN,cAAc;IAChB,eAAe;IACfG,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACV"}
|
@@ -266,5 +266,3 @@ const useTextClassNames = (state, alignToPrimary)=>{
|
|
266
266
|
optionalTextClassName: (0, _react.mergeClasses)(optionalTextBaseClassName, !presenceOnly && size === 'huge' && textStyles.body1, alignToPrimaryClassName)
|
267
267
|
};
|
268
268
|
}; //# sourceMappingURL=usePersonaStyles.styles.js.map
|
269
|
-
|
270
|
-
//# sourceMappingURL=usePersonaStyles.styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Persona/usePersonaStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const personaClassNames = {\n root: 'fui-Persona',\n avatar: 'fui-Persona__avatar',\n presence: 'fui-Persona__presence',\n primaryText: 'fui-Persona__primaryText',\n secondaryText: 'fui-Persona__secondaryText',\n tertiaryText: 'fui-Persona__tertiaryText',\n quaternaryText: 'fui-Persona__quaternaryText'\n};\nconst avatarSpacing = `--fui-Persona__avatar--spacing`;\nconst useRootClassName = /*#__PURE__*/__resetStyles(\"rlroi9i\", null, [\".rlroi9i{display:inline-grid;grid-auto-rows:max-content;grid-auto-flow:column;justify-items:start;grid-template-columns:max-content [middle] auto;}\"]);\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n beforeAfterCenter: {\n wkccdc: \"f1iantul\"\n },\n after: {},\n before: {\n B7hvi0a: \"f1tll2w5\",\n Budl1dq: \"ffvkwdr\"\n },\n below: {\n Bxotwcr: \"f1nkeedh\",\n B7hvi0a: \"f1oiokrs\",\n Budl1dq: \"f1emgwh2\"\n },\n media: {\n Ijaq50: \"f1hek2iy\"\n },\n mediaBeforeAfterCenter: {\n Ijaq50: \"fa4dipu\"\n },\n start: {\n qb2dma: \"f9h729m\"\n },\n center: {\n qb2dma: \"f7nlbp4\"\n },\n afterAlignToPrimary: {\n qb2dma: \"f7nlbp4\",\n Ijaq50: \"f1rnkkuc\",\n Bw0ie65: \"f1warjpf\"\n },\n beforeAlignToPrimary: {\n qb2dma: \"f7nlbp4\",\n Ijaq50: \"f1rnkkuc\",\n Br312pm: \"fwu52yu\"\n },\n secondLineSpacing: {\n B6of3ja: \"f1ryq6si\"\n },\n primary: {\n Ijaq50: \"f1q3ipgb\"\n },\n secondary: {\n Ijaq50: \"f3drtdk\"\n },\n tertiary: {\n Ijaq50: \"fa1o6s1\"\n },\n quaternary: {\n Ijaq50: \"f1tuwaia\"\n }\n}, {\n d: [\".f1iantul{grid-template-rows:1fr [primary] max-content [secondary] max-content [tertiary] max-content [quaternary] max-content 1fr;}\", \".f1tll2w5{justify-items:end;}\", \".ffvkwdr{grid-template-columns:auto [middle] max-content;}\", \".f1nkeedh{grid-auto-flow:unset;}\", \".f1oiokrs{justify-items:center;}\", \".f1emgwh2{grid-template-columns:unset;}\", \".f1hek2iy{grid-row-start:span 5;}\", \".fa4dipu{grid-row-start:span 6;}\", \".f9h729m{-webkit-align-self:start;-ms-flex-item-align:start;align-self:start;}\", \".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}\", \".f1rnkkuc{grid-row-start:unset;}\", \".f1warjpf{grid-column-end:middle;}\", \".fwu52yu{grid-column-start:middle;}\", \".f1ryq6si{margin-top:-2px;}\", \".f1q3ipgb{grid-row-start:primary;}\", \".f3drtdk{grid-row-start:secondary;}\", \".fa1o6s1{grid-row-start:tertiary;}\", \".f1tuwaia{grid-row-start:quaternary;}\"]\n});\nconst useAvatarSpacingStyles = /*#__PURE__*/__styles({\n \"extra-small\": {\n Bs1gm4r: \"f1e48tse\"\n },\n small: {\n Bs1gm4r: \"f18q9vkd\"\n },\n medium: {\n Bs1gm4r: \"f18q9vkd\"\n },\n large: {\n Bs1gm4r: \"fx34bi6\"\n },\n \"extra-large\": {\n Bs1gm4r: \"fx34bi6\"\n },\n huge: {\n Bs1gm4r: \"f1o96qtm\"\n },\n after: {\n t21cq0: [\"f103ycu4\", \"f1tao51\"]\n },\n below: {\n jrapky: \"fbo7acy\"\n },\n before: {\n Frg6f3: [\"f1tao51\", \"f103ycu4\"]\n }\n}, {\n d: [\".f1e48tse{--fui-Persona__avatar--spacing:var(--spacingHorizontalSNudge);}\", \".f18q9vkd{--fui-Persona__avatar--spacing:var(--spacingHorizontalS);}\", \".fx34bi6{--fui-Persona__avatar--spacing:var(--spacingHorizontalMNudge);}\", \".f1o96qtm{--fui-Persona__avatar--spacing:var(--spacingHorizontalM);}\", \".f103ycu4{margin-right:var(--fui-Persona__avatar--spacing);}\", \".f1tao51{margin-left:var(--fui-Persona__avatar--spacing);}\", \".fbo7acy{margin-bottom:var(--fui-Persona__avatar--spacing);}\"]\n});\nconst usePresenceSpacingStyles = /*#__PURE__*/__styles({\n small: {\n Bs1gm4r: \"f1e48tse\"\n }\n}, {\n d: [\".f1e48tse{--fui-Persona__avatar--spacing:var(--spacingHorizontalSNudge);}\"]\n});\n/**\n * Apply styling to the Persona slots based on the state\n */\nexport const usePersonaStyles_unstable = state => {\n const {\n presenceOnly,\n size,\n textAlignment,\n textPosition\n } = state;\n const alignToPrimary = presenceOnly && textAlignment === 'start' && size !== 'extra-large' && size !== 'huge';\n const alignBeforeAfterCenter = textPosition !== 'below' && textAlignment === 'center';\n const {\n primaryTextClassName,\n optionalTextClassName\n } = useTextClassNames(state, alignToPrimary);\n const rootClassName = useRootClassName();\n const styles = useStyles();\n const avatarSpacingStyles = useAvatarSpacingStyles();\n const presenceSpacingStyles = {\n ...avatarSpacingStyles,\n ...usePresenceSpacingStyles()\n };\n state.root.className = mergeClasses(personaClassNames.root, rootClassName, alignBeforeAfterCenter && styles.beforeAfterCenter, styles[textPosition], state.root.className);\n if (state.avatar) {\n state.avatar.className = mergeClasses(personaClassNames.avatar, textPosition !== 'below' && styles.media, alignBeforeAfterCenter && styles.mediaBeforeAfterCenter, styles[textAlignment], avatarSpacingStyles[size], avatarSpacingStyles[textPosition], state.avatar.className);\n }\n if (state.presence) {\n state.presence.className = mergeClasses(personaClassNames.presence, textPosition !== 'below' && styles.media, alignBeforeAfterCenter && styles.mediaBeforeAfterCenter, styles[textAlignment], presenceSpacingStyles[size], presenceSpacingStyles[textPosition], textPosition === 'after' && alignToPrimary && styles.afterAlignToPrimary, textPosition === 'before' && alignToPrimary && styles.beforeAlignToPrimary, state.presence.className);\n }\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(personaClassNames.primaryText, alignBeforeAfterCenter && styles.primary, primaryTextClassName, state.primaryText.className);\n }\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(personaClassNames.secondaryText, alignBeforeAfterCenter && styles.secondary, optionalTextClassName, styles.secondLineSpacing, state.secondaryText.className);\n }\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(personaClassNames.tertiaryText, alignBeforeAfterCenter && styles.tertiary, optionalTextClassName, state.tertiaryText.className);\n }\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(personaClassNames.quaternaryText, alignBeforeAfterCenter && styles.quaternary, optionalTextClassName, state.quaternaryText.className);\n }\n return state;\n};\nconst usePrimaryTextBaseClassName = /*#__PURE__*/__resetStyles(\"rvj41k9\", null, [\".rvj41k9{display:block;color:var(--colorNeutralForeground1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}\"]);\nconst useOptionalTextBaseClassName = /*#__PURE__*/__resetStyles(\"rp1pf9e\", null, [\".rp1pf9e{display:block;color:var(--colorNeutralForeground2);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}\"]);\nconst useTextStyles = /*#__PURE__*/__styles({\n beforeAlignToPrimary: {\n Bw0ie65: \"f1warjpf\"\n },\n afterAlignToPrimary: {\n Br312pm: \"fwu52yu\"\n },\n body1: {\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n },\n caption1: {\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fy9rknc\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"fwrc4pm\"\n },\n subtitle2: {\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fod5ikn\",\n Bhrd7zp: \"fl43uef\",\n Bg96gwp: \"faaz57k\"\n }\n}, {\n d: [\".f1warjpf{grid-column-end:middle;}\", \".fwu52yu{grid-column-start:middle;}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".fwrc4pm{line-height:var(--lineHeightBase200);}\", \".fod5ikn{font-size:var(--fontSizeBase400);}\", \".fl43uef{font-weight:var(--fontWeightSemibold);}\", \".faaz57k{line-height:var(--lineHeightBase400);}\"]\n});\nconst useTextClassNames = (state, alignToPrimary) => {\n const {\n presenceOnly,\n size,\n textPosition\n } = state;\n const primaryTextBaseClassName = usePrimaryTextBaseClassName();\n const optionalTextBaseClassName = useOptionalTextBaseClassName();\n const textStyles = useTextStyles();\n let primaryTextSize;\n let alignToPrimaryClassName;\n if (presenceOnly) {\n if (size === 'extra-small') {\n primaryTextSize = state.numTextLines <= 1 && textStyles.caption1;\n } else if (size === 'extra-large' || size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n }\n if (alignToPrimary) {\n if (textPosition === 'before') {\n alignToPrimaryClassName = textStyles.beforeAlignToPrimary;\n } else if (textPosition === 'after') {\n alignToPrimaryClassName = textStyles.afterAlignToPrimary;\n }\n }\n } else {\n if (size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n } else if (size === 'extra-large') {\n primaryTextSize = textStyles.subtitle2;\n }\n }\n return {\n primaryTextClassName: mergeClasses(primaryTextBaseClassName, primaryTextSize, alignToPrimaryClassName),\n optionalTextClassName: mergeClasses(optionalTextBaseClassName, !presenceOnly && size === 'huge' && textStyles.body1, alignToPrimaryClassName)\n };\n};\n//# sourceMappingURL=usePersonaStyles.styles.js.map"],"names":["personaClassNames","usePersonaStyles_unstable","root","avatar","presence","primaryText","secondaryText","tertiaryText","quaternaryText","avatarSpacing","useRootClassName","__resetStyles","useStyles","__styles","beforeAfterCenter","wkccdc","after","before","B7hvi0a","Budl1dq","below","Bxotwcr","media","Ijaq50","mediaBeforeAfterCenter","start","qb2dma","center","afterAlignToPrimary","Bw0ie65","beforeAlignToPrimary","Br312pm","secondLineSpacing","B6of3ja","primary","secondary","tertiary","quaternary","d","useAvatarSpacingStyles","Bs1gm4r","small","medium","large","huge","t21cq0","jrapky","Frg6f3","usePresenceSpacingStyles","state","presenceOnly","size","textAlignment","textPosition","alignToPrimary","alignBeforeAfterCenter","primaryTextClassName","optionalTextClassName","useTextClassNames","rootClassName","styles","avatarSpacingStyles","presenceSpacingStyles","className","mergeClasses","usePrimaryTextBaseClassName","useOptionalTextBaseClassName","useTextStyles","body1","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","caption1","subtitle2","primaryTextBaseClassName","optionalTextBaseClassName","textStyles","primaryTextSize","alignToPrimaryClassName","numTextLines"],"mappings":";;;;;;;;;;;IAEaA,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AIpB,gBAAgB;YAClB,IAAID,iBAAiB,UAAU;gBAC7B0B,0BAA0BF,WAAW/C,oBAAoB;YAC3D,OAAO,IAAIuB,iBAAiB,SAAS;gBACnC0B,0BAA0BF,WAAWjD,mBAAmB;YAC1D,CAAC;QACH,CAAC;IACH,OAAO;QACL,IAAIuB,SAAS,QAAQ;YACnB2B,kBAAkBD,WAAWH,SAAS;QACxC,OAAO,IAAIvB,SAAS,eAAe;YACjC2B,kBAAkBD,WAAWH,SAAS;QACxC,CAAC;IACH,CAAC;IACD,OAAO;QACLlB,sBAAsBQ,IAAAA,mBAAY,EAACW,0BAA0BG,iBAAiBC;QAC9EtB,uBAAuBO,IAAAA,mBAAY,EAACY,2BAA2B,CAAC1B,gBAAgBC,SAAS,UAAU0B,WAAWT,KAAK,EAAEW;IACvH;AACF,GACA,mDAAmD"}
|
1
|
+
{"version":3,"sources":["usePersonaStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const personaClassNames = {\n root: 'fui-Persona',\n avatar: 'fui-Persona__avatar',\n presence: 'fui-Persona__presence',\n primaryText: 'fui-Persona__primaryText',\n secondaryText: 'fui-Persona__secondaryText',\n tertiaryText: 'fui-Persona__tertiaryText',\n quaternaryText: 'fui-Persona__quaternaryText'\n};\nconst avatarSpacing = `--fui-Persona__avatar--spacing`;\nconst useRootClassName = /*#__PURE__*/__resetStyles(\"rlroi9i\", null, [\".rlroi9i{display:inline-grid;grid-auto-rows:max-content;grid-auto-flow:column;justify-items:start;grid-template-columns:max-content [middle] auto;}\"]);\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n beforeAfterCenter: {\n wkccdc: \"f1iantul\"\n },\n after: {},\n before: {\n B7hvi0a: \"f1tll2w5\",\n Budl1dq: \"ffvkwdr\"\n },\n below: {\n Bxotwcr: \"f1nkeedh\",\n B7hvi0a: \"f1oiokrs\",\n Budl1dq: \"f1emgwh2\"\n },\n media: {\n Ijaq50: \"f1hek2iy\"\n },\n mediaBeforeAfterCenter: {\n Ijaq50: \"fa4dipu\"\n },\n start: {\n qb2dma: \"f9h729m\"\n },\n center: {\n qb2dma: \"f7nlbp4\"\n },\n afterAlignToPrimary: {\n qb2dma: \"f7nlbp4\",\n Ijaq50: \"f1rnkkuc\",\n Bw0ie65: \"f1warjpf\"\n },\n beforeAlignToPrimary: {\n qb2dma: \"f7nlbp4\",\n Ijaq50: \"f1rnkkuc\",\n Br312pm: \"fwu52yu\"\n },\n secondLineSpacing: {\n B6of3ja: \"f1ryq6si\"\n },\n primary: {\n Ijaq50: \"f1q3ipgb\"\n },\n secondary: {\n Ijaq50: \"f3drtdk\"\n },\n tertiary: {\n Ijaq50: \"fa1o6s1\"\n },\n quaternary: {\n Ijaq50: \"f1tuwaia\"\n }\n}, {\n d: [\".f1iantul{grid-template-rows:1fr [primary] max-content [secondary] max-content [tertiary] max-content [quaternary] max-content 1fr;}\", \".f1tll2w5{justify-items:end;}\", \".ffvkwdr{grid-template-columns:auto [middle] max-content;}\", \".f1nkeedh{grid-auto-flow:unset;}\", \".f1oiokrs{justify-items:center;}\", \".f1emgwh2{grid-template-columns:unset;}\", \".f1hek2iy{grid-row-start:span 5;}\", \".fa4dipu{grid-row-start:span 6;}\", \".f9h729m{-webkit-align-self:start;-ms-flex-item-align:start;align-self:start;}\", \".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}\", \".f1rnkkuc{grid-row-start:unset;}\", \".f1warjpf{grid-column-end:middle;}\", \".fwu52yu{grid-column-start:middle;}\", \".f1ryq6si{margin-top:-2px;}\", \".f1q3ipgb{grid-row-start:primary;}\", \".f3drtdk{grid-row-start:secondary;}\", \".fa1o6s1{grid-row-start:tertiary;}\", \".f1tuwaia{grid-row-start:quaternary;}\"]\n});\nconst useAvatarSpacingStyles = /*#__PURE__*/__styles({\n \"extra-small\": {\n Bs1gm4r: \"f1e48tse\"\n },\n small: {\n Bs1gm4r: \"f18q9vkd\"\n },\n medium: {\n Bs1gm4r: \"f18q9vkd\"\n },\n large: {\n Bs1gm4r: \"fx34bi6\"\n },\n \"extra-large\": {\n Bs1gm4r: \"fx34bi6\"\n },\n huge: {\n Bs1gm4r: \"f1o96qtm\"\n },\n after: {\n t21cq0: [\"f103ycu4\", \"f1tao51\"]\n },\n below: {\n jrapky: \"fbo7acy\"\n },\n before: {\n Frg6f3: [\"f1tao51\", \"f103ycu4\"]\n }\n}, {\n d: [\".f1e48tse{--fui-Persona__avatar--spacing:var(--spacingHorizontalSNudge);}\", \".f18q9vkd{--fui-Persona__avatar--spacing:var(--spacingHorizontalS);}\", \".fx34bi6{--fui-Persona__avatar--spacing:var(--spacingHorizontalMNudge);}\", \".f1o96qtm{--fui-Persona__avatar--spacing:var(--spacingHorizontalM);}\", \".f103ycu4{margin-right:var(--fui-Persona__avatar--spacing);}\", \".f1tao51{margin-left:var(--fui-Persona__avatar--spacing);}\", \".fbo7acy{margin-bottom:var(--fui-Persona__avatar--spacing);}\"]\n});\nconst usePresenceSpacingStyles = /*#__PURE__*/__styles({\n small: {\n Bs1gm4r: \"f1e48tse\"\n }\n}, {\n d: [\".f1e48tse{--fui-Persona__avatar--spacing:var(--spacingHorizontalSNudge);}\"]\n});\n/**\n * Apply styling to the Persona slots based on the state\n */\nexport const usePersonaStyles_unstable = state => {\n const {\n presenceOnly,\n size,\n textAlignment,\n textPosition\n } = state;\n const alignToPrimary = presenceOnly && textAlignment === 'start' && size !== 'extra-large' && size !== 'huge';\n const alignBeforeAfterCenter = textPosition !== 'below' && textAlignment === 'center';\n const {\n primaryTextClassName,\n optionalTextClassName\n } = useTextClassNames(state, alignToPrimary);\n const rootClassName = useRootClassName();\n const styles = useStyles();\n const avatarSpacingStyles = useAvatarSpacingStyles();\n const presenceSpacingStyles = {\n ...avatarSpacingStyles,\n ...usePresenceSpacingStyles()\n };\n state.root.className = mergeClasses(personaClassNames.root, rootClassName, alignBeforeAfterCenter && styles.beforeAfterCenter, styles[textPosition], state.root.className);\n if (state.avatar) {\n state.avatar.className = mergeClasses(personaClassNames.avatar, textPosition !== 'below' && styles.media, alignBeforeAfterCenter && styles.mediaBeforeAfterCenter, styles[textAlignment], avatarSpacingStyles[size], avatarSpacingStyles[textPosition], state.avatar.className);\n }\n if (state.presence) {\n state.presence.className = mergeClasses(personaClassNames.presence, textPosition !== 'below' && styles.media, alignBeforeAfterCenter && styles.mediaBeforeAfterCenter, styles[textAlignment], presenceSpacingStyles[size], presenceSpacingStyles[textPosition], textPosition === 'after' && alignToPrimary && styles.afterAlignToPrimary, textPosition === 'before' && alignToPrimary && styles.beforeAlignToPrimary, state.presence.className);\n }\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(personaClassNames.primaryText, alignBeforeAfterCenter && styles.primary, primaryTextClassName, state.primaryText.className);\n }\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(personaClassNames.secondaryText, alignBeforeAfterCenter && styles.secondary, optionalTextClassName, styles.secondLineSpacing, state.secondaryText.className);\n }\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(personaClassNames.tertiaryText, alignBeforeAfterCenter && styles.tertiary, optionalTextClassName, state.tertiaryText.className);\n }\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(personaClassNames.quaternaryText, alignBeforeAfterCenter && styles.quaternary, optionalTextClassName, state.quaternaryText.className);\n }\n return state;\n};\nconst usePrimaryTextBaseClassName = /*#__PURE__*/__resetStyles(\"rvj41k9\", null, [\".rvj41k9{display:block;color:var(--colorNeutralForeground1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}\"]);\nconst useOptionalTextBaseClassName = /*#__PURE__*/__resetStyles(\"rp1pf9e\", null, [\".rp1pf9e{display:block;color:var(--colorNeutralForeground2);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}\"]);\nconst useTextStyles = /*#__PURE__*/__styles({\n beforeAlignToPrimary: {\n Bw0ie65: \"f1warjpf\"\n },\n afterAlignToPrimary: {\n Br312pm: \"fwu52yu\"\n },\n body1: {\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fkhj508\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"f1i3iumi\"\n },\n caption1: {\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fy9rknc\",\n Bhrd7zp: \"figsok6\",\n Bg96gwp: \"fwrc4pm\"\n },\n subtitle2: {\n Bahqtrf: \"fk6fouc\",\n Be2twd7: \"fod5ikn\",\n Bhrd7zp: \"fl43uef\",\n Bg96gwp: \"faaz57k\"\n }\n}, {\n d: [\".f1warjpf{grid-column-end:middle;}\", \".fwu52yu{grid-column-start:middle;}\", \".fk6fouc{font-family:var(--fontFamilyBase);}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".figsok6{font-weight:var(--fontWeightRegular);}\", \".f1i3iumi{line-height:var(--lineHeightBase300);}\", \".fy9rknc{font-size:var(--fontSizeBase200);}\", \".fwrc4pm{line-height:var(--lineHeightBase200);}\", \".fod5ikn{font-size:var(--fontSizeBase400);}\", \".fl43uef{font-weight:var(--fontWeightSemibold);}\", \".faaz57k{line-height:var(--lineHeightBase400);}\"]\n});\nconst useTextClassNames = (state, alignToPrimary) => {\n const {\n presenceOnly,\n size,\n textPosition\n } = state;\n const primaryTextBaseClassName = usePrimaryTextBaseClassName();\n const optionalTextBaseClassName = useOptionalTextBaseClassName();\n const textStyles = useTextStyles();\n let primaryTextSize;\n let alignToPrimaryClassName;\n if (presenceOnly) {\n if (size === 'extra-small') {\n primaryTextSize = state.numTextLines <= 1 && textStyles.caption1;\n } else if (size === 'extra-large' || size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n }\n if (alignToPrimary) {\n if (textPosition === 'before') {\n alignToPrimaryClassName = textStyles.beforeAlignToPrimary;\n } else if (textPosition === 'after') {\n alignToPrimaryClassName = textStyles.afterAlignToPrimary;\n }\n }\n } else {\n if (size === 'huge') {\n primaryTextSize = textStyles.subtitle2;\n } else if (size === 'extra-large') {\n primaryTextSize = textStyles.subtitle2;\n }\n }\n return {\n primaryTextClassName: mergeClasses(primaryTextBaseClassName, primaryTextSize, alignToPrimaryClassName),\n optionalTextClassName: mergeClasses(optionalTextBaseClassName, !presenceOnly && size === 'huge' && textStyles.body1, alignToPrimaryClassName)\n };\n};\n//# sourceMappingURL=usePersonaStyles.styles.js.map"],"names":["personaClassNames","usePersonaStyles_unstable","root","avatar","presence","primaryText","secondaryText","tertiaryText","quaternaryText","avatarSpacing","useRootClassName","__resetStyles","useStyles","__styles","beforeAfterCenter","wkccdc","after","before","B7hvi0a","Budl1dq","below","Bxotwcr","media","Ijaq50","mediaBeforeAfterCenter","start","qb2dma","center","afterAlignToPrimary","Bw0ie65","beforeAlignToPrimary","Br312pm","secondLineSpacing","B6of3ja","primary","secondary","tertiary","quaternary","d","useAvatarSpacingStyles","Bs1gm4r","small","medium","large","huge","t21cq0","jrapky","Frg6f3","usePresenceSpacingStyles","state","presenceOnly","size","textAlignment","textPosition","alignToPrimary","alignBeforeAfterCenter","primaryTextClassName","optionalTextClassName","useTextClassNames","rootClassName","styles","avatarSpacingStyles","presenceSpacingStyles","className","mergeClasses","usePrimaryTextBaseClassName","useOptionalTextBaseClassName","useTextStyles","body1","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","caption1","subtitle2","primaryTextBaseClassName","optionalTextBaseClassName","textStyles","primaryTextSize","alignToPrimaryClassName","numTextLines"],"mappings":";;;;;;;;;;;IAEaA,iBAAiB,MAAjBA;IA6GAC,yBAAyB,MAAzBA;;uBA/GyC;AAE/C,MAAMD,oBAAoB;IAC/BE,MAAM;IACNC,QAAQ;IACRC,UAAU;IACVC,aAAa;IACbC,eAAe;IACfC,cAAc;IACdC,gBAAgB;AAClB;AACA,MAAMC,gBAAgB,CAAC,8BAA8B,CAAC;AACtD,MAAMC,mBAAmB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WH,SAAS;QACxC,OAAO,IAAIvB,SAAS,eAAe;YACjC2B,kBAAkBD,WAAWH,SAAS;QACxC,CAAC;IACH,CAAC;IACD,OAAO;QACLlB,sBAAsBQ,IAAAA,mBAAY,EAACW,0BAA0BG,iBAAiBC;QAC9EtB,uBAAuBO,IAAAA,mBAAY,EAACY,2BAA2B,CAAC1B,gBAAgBC,SAAS,UAAU0B,WAAWT,KAAK,EAAEW;IACvH;AACF,GACA,mDAAmD"}
|
package/lib-commonjs/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { Persona, personaClassNames, renderPersona_unstable, usePersonaStyles_unstable, usePersona_unstable } from './Persona';\n"],"names":["Persona","personaClassNames","renderPersona_unstable","usePersonaStyles_unstable","usePersona_unstable"],"mappings":";;;;;;;;;;;IAASA,OAAO,MAAPA,gBAAO;IAAEC,iBAAiB,MAAjBA,0BAAiB;IAAEC,sBAAsB,MAAtBA,+BAAsB;IAAEC,yBAAyB,MAAzBA,kCAAyB;IAAEC,mBAAmB,MAAnBA,4BAAmB;;yBAAQ"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-persona",
|
3
|
-
"version": "9.2.
|
3
|
+
"version": "9.2.15",
|
4
4
|
"description": "React components for building web experiences",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -28,18 +28,18 @@
|
|
28
28
|
"devDependencies": {
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
30
|
"@fluentui/react-conformance": "*",
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.22",
|
32
32
|
"@fluentui/scripts-api-extractor": "*",
|
33
33
|
"@fluentui/scripts-tasks": "*"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@fluentui/react-avatar": "^9.5.
|
37
|
-
"@fluentui/react-badge": "^9.1.
|
36
|
+
"@fluentui/react-avatar": "^9.5.5",
|
37
|
+
"@fluentui/react-badge": "^9.1.15",
|
38
38
|
"@fluentui/react-shared-contexts": "^9.5.0",
|
39
39
|
"@fluentui/react-theme": "^9.1.8",
|
40
|
-
"@fluentui/react-utilities": "^9.9.
|
41
|
-
"@fluentui/react-jsx-runtime": "9.0.0-alpha.
|
42
|
-
"@griffel/react": "^1.5.
|
40
|
+
"@fluentui/react-utilities": "^9.9.2",
|
41
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.6",
|
42
|
+
"@griffel/react": "^1.5.7",
|
43
43
|
"@swc/helpers": "^0.4.14"
|
44
44
|
},
|
45
45
|
"peerDependencies": {
|