@fluentui/react-persona 9.7.1 → 9.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @fluentui/react-persona
2
2
 
3
- This log was last generated on Mon, 30 Mar 2026 14:35:50 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 23 Apr 2026 11:59:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.7.3)
8
+
9
+ Thu, 23 Apr 2026 11:59:28 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.7.2..@fluentui/react-persona_v9.7.3)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-avatar to v9.11.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
15
+ - Bump @fluentui/react-badge to v9.5.2 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.26.3 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
18
+
19
+ ## [9.7.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.7.2)
20
+
21
+ Wed, 01 Apr 2026 15:52:43 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.7.1..@fluentui/react-persona_v9.7.2)
23
+
24
+ ### Patches
25
+
26
+ - Bump @fluentui/react-avatar to v9.11.0 ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by beachball)
27
+
7
28
  ## [9.7.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.7.1)
8
29
 
9
- Mon, 30 Mar 2026 14:35:50 GMT
30
+ Mon, 30 Mar 2026 14:37:41 GMT
10
31
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.7.0..@fluentui/react-persona_v9.7.1)
11
32
 
12
33
  ### Patches
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { Avatar } from '@fluentui/react-avatar';
1
+ import type { Avatar } from '@fluentui/react-avatar';
2
2
  import type { ComponentProps } from '@fluentui/react-utilities';
3
3
  import type { ComponentState } from '@fluentui/react-utilities';
4
4
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
5
5
  import type { JSXElement } from '@fluentui/react-utilities';
6
- import { PresenceBadge } from '@fluentui/react-badge';
7
- import * as React_2 from 'react';
6
+ import type { PresenceBadge } from '@fluentui/react-badge';
7
+ import type * as React_2 from 'react';
8
8
  import type { Slot } from '@fluentui/react-utilities';
9
9
  import type { SlotClassNames } from '@fluentui/react-utilities';
10
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Persona/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\nexport type PersonaBaseProps = ComponentProps<Omit<PersonaSlots, 'avatar' | 'presence'>> & Pick<PersonaProps, 'name'>;\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\nexport type PersonaBaseState = ComponentState<Omit<PersonaSlots, 'avatar' | 'presence'>> &\n Pick<PersonaState, 'numTextLines'>;\n"],"names":[],"mappings":"AAkGA,WACqC"}
1
+ {"version":3,"sources":["../src/components/Persona/Persona.types.ts"],"sourcesContent":["import type { Avatar } from '@fluentui/react-avatar';\nimport type { 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\nexport type PersonaBaseProps = ComponentProps<Omit<PersonaSlots, 'avatar' | 'presence'>> & Pick<PersonaProps, 'name'>;\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\nexport type PersonaBaseState = ComponentState<Omit<PersonaSlots, 'avatar' | 'presence'>> &\n Pick<PersonaState, 'numTextLines'>;\n"],"names":[],"mappings":"AAkGA,WACqC"}
@@ -1,5 +1,4 @@
1
1
  'use client';
2
- import * as React from 'react';
3
2
  import { Avatar } from '@fluentui/react-avatar';
4
3
  import { slot } from '@fluentui/react-utilities';
5
4
  import { PresenceBadge } from '@fluentui/react-badge';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Persona/usePersona.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { slot } from '@fluentui/react-utilities';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport type { PersonaBaseProps, PersonaBaseState, 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 {\n avatar,\n presenceOnly = false,\n size = 'medium',\n textAlignment = 'start',\n textPosition = 'after',\n presence,\n ...baseProps\n } = props;\n\n const state = usePersonaBase_unstable(baseProps, ref);\n\n return {\n ...state,\n presenceOnly,\n size,\n textAlignment,\n textPosition,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n avatar: Avatar,\n presence: PresenceBadge,\n },\n avatar: !presenceOnly\n ? slot.optional(avatar, {\n renderByDefault: true,\n defaultProps: {\n name: props.name,\n badge: presence,\n size: avatarSizes[size],\n },\n elementType: Avatar,\n })\n : undefined,\n presence: presenceOnly\n ? slot.optional(presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n elementType: PresenceBadge,\n })\n : undefined,\n };\n};\n\n/**\n * Base hook for Persona component, manages state and structure common to all variants of Persona\n */\nexport const usePersonaBase_unstable = (props: PersonaBaseProps, ref?: React.Ref<HTMLElement>): PersonaBaseState => {\n const {\n name,\n primaryText: primaryTextProp,\n secondaryText: secondaryTextProp,\n tertiaryText: tertiaryTextProp,\n quaternaryText: quaternaryTextProp,\n ...rest\n } = props;\n\n const primaryText = slot.optional(primaryTextProp, {\n renderByDefault: true,\n defaultProps: {\n children: name,\n },\n elementType: 'span',\n });\n const secondaryText = slot.optional(secondaryTextProp, { elementType: 'span' });\n const tertiaryText = slot.optional(tertiaryTextProp, { elementType: 'span' });\n const quaternaryText = slot.optional(quaternaryTextProp, { elementType: 'span' });\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].filter(Boolean).length;\n\n return {\n numTextLines,\n components: {\n root: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n quaternaryText: 'span',\n },\n root: slot.always(\n {\n ref: ref as React.Ref<HTMLDivElement>,\n ...rest,\n },\n { elementType: 'div' },\n ),\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","slot","PresenceBadge","usePersona_unstable","props","ref","avatar","presenceOnly","size","textAlignment","textPosition","presence","baseProps","state","usePersonaBase_unstable","components","optional","renderByDefault","defaultProps","name","badge","avatarSizes","elementType","undefined","presenceSizes","primaryText","primaryTextProp","secondaryText","secondaryTextProp","tertiaryText","tertiaryTextProp","quaternaryText","quaternaryTextProp","rest","children","numTextLines","filter","Boolean","length","root","always","small","medium","large","huge"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,aAAa,QAAQ,wBAAwB;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,MAAM,EACJC,MAAM,EACNC,eAAe,KAAK,EACpBC,OAAO,QAAQ,EACfC,gBAAgB,OAAO,EACvBC,eAAe,OAAO,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IAEJ,MAAMS,QAAQC,wBAAwBF,WAAWP;IAEjD,OAAO;QACL,GAAGQ,KAAK;QACRN;QACAC;QACAC;QACAC;QACA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QAEvBG;QACAE;QACAE;QACAE;IACF;AACF,EAAE;AAEF,MAAMP,gBAAgB;IACpB,eAAe;IACfiB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR;AAEA,MAAMvB,cAAc;IAClB,eAAe;IACfoB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR"}
1
+ {"version":3,"sources":["../src/components/Persona/usePersona.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { slot } from '@fluentui/react-utilities';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport type { PersonaBaseProps, PersonaBaseState, 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 {\n avatar,\n presenceOnly = false,\n size = 'medium',\n textAlignment = 'start',\n textPosition = 'after',\n presence,\n ...baseProps\n } = props;\n\n const state = usePersonaBase_unstable(baseProps, ref);\n\n return {\n ...state,\n presenceOnly,\n size,\n textAlignment,\n textPosition,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n avatar: Avatar,\n presence: PresenceBadge,\n },\n avatar: !presenceOnly\n ? slot.optional(avatar, {\n renderByDefault: true,\n defaultProps: {\n name: props.name,\n badge: presence,\n size: avatarSizes[size],\n },\n elementType: Avatar,\n })\n : undefined,\n presence: presenceOnly\n ? slot.optional(presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n elementType: PresenceBadge,\n })\n : undefined,\n };\n};\n\n/**\n * Base hook for Persona component, manages state and structure common to all variants of Persona\n */\nexport const usePersonaBase_unstable = (props: PersonaBaseProps, ref?: React.Ref<HTMLElement>): PersonaBaseState => {\n const {\n name,\n primaryText: primaryTextProp,\n secondaryText: secondaryTextProp,\n tertiaryText: tertiaryTextProp,\n quaternaryText: quaternaryTextProp,\n ...rest\n } = props;\n\n const primaryText = slot.optional(primaryTextProp, {\n renderByDefault: true,\n defaultProps: {\n children: name,\n },\n elementType: 'span',\n });\n const secondaryText = slot.optional(secondaryTextProp, { elementType: 'span' });\n const tertiaryText = slot.optional(tertiaryTextProp, { elementType: 'span' });\n const quaternaryText = slot.optional(quaternaryTextProp, { elementType: 'span' });\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].filter(Boolean).length;\n\n return {\n numTextLines,\n components: {\n root: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n quaternaryText: 'span',\n },\n root: slot.always(\n {\n ref: ref as React.Ref<HTMLDivElement>,\n ...rest,\n },\n { elementType: 'div' },\n ),\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":["Avatar","slot","PresenceBadge","usePersona_unstable","props","ref","avatar","presenceOnly","size","textAlignment","textPosition","presence","baseProps","state","usePersonaBase_unstable","components","optional","renderByDefault","defaultProps","name","badge","avatarSizes","elementType","undefined","presenceSizes","primaryText","primaryTextProp","secondaryText","secondaryTextProp","tertiaryText","tertiaryTextProp","quaternaryText","quaternaryTextProp","rest","children","numTextLines","filter","Boolean","length","root","always","small","medium","large","huge"],"mappings":"AAAA;AAGA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAASC,IAAI,QAAQ,4BAA4B;AACjD,SAASC,aAAa,QAAQ,wBAAwB;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC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QAAcE;KAAe,CAACK,MAAM,CAACC,SAASC,MAAM;IAEtG,OAAO;QACLH;QACApB,YAAY;YACVwB,MAAM;YACNd,aAAa;YACbE,eAAe;YACfE,cAAc;YACdE,gBAAgB;QAClB;QACAQ,MAAMtC,KAAKuC,MAAM,CACf;YACEnC,KAAKA;YACL,GAAG4B,IAAI;QACT,GACA;YAAEX,aAAa;QAAM;QAEvBG;QACAE;QACAE;QACAE;IACF;AACF,EAAE;AAEF,MAAMP,gBAAgB;IACpB,eAAe;IACfiB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR;AAEA,MAAMvB,cAAc;IAClB,eAAe;IACfoB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Persona/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\nexport type PersonaBaseProps = ComponentProps<Omit<PersonaSlots, 'avatar' | 'presence'>> & Pick<PersonaProps, 'name'>;\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\nexport type PersonaBaseState = ComponentState<Omit<PersonaSlots, 'avatar' | 'presence'>> &\n Pick<PersonaState, 'numTextLines'>;\n"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../src/components/Persona/Persona.types.ts"],"sourcesContent":["import type { Avatar } from '@fluentui/react-avatar';\nimport type { 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\nexport type PersonaBaseProps = ComponentProps<Omit<PersonaSlots, 'avatar' | 'presence'>> & Pick<PersonaProps, 'name'>;\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\nexport type PersonaBaseState = ComponentState<Omit<PersonaSlots, 'avatar' | 'presence'>> &\n Pick<PersonaState, 'numTextLines'>;\n"],"names":[],"mappings":""}
@@ -17,8 +17,6 @@ _export(exports, {
17
17
  return usePersona_unstable;
18
18
  }
19
19
  });
20
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
21
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
22
20
  const _reactavatar = require("@fluentui/react-avatar");
23
21
  const _reactutilities = require("@fluentui/react-utilities");
24
22
  const _reactbadge = require("@fluentui/react-badge");
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Persona/usePersona.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { slot } from '@fluentui/react-utilities';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport type { PersonaBaseProps, PersonaBaseState, 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 {\n avatar,\n presenceOnly = false,\n size = 'medium',\n textAlignment = 'start',\n textPosition = 'after',\n presence,\n ...baseProps\n } = props;\n\n const state = usePersonaBase_unstable(baseProps, ref);\n\n return {\n ...state,\n presenceOnly,\n size,\n textAlignment,\n textPosition,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n avatar: Avatar,\n presence: PresenceBadge,\n },\n avatar: !presenceOnly\n ? slot.optional(avatar, {\n renderByDefault: true,\n defaultProps: {\n name: props.name,\n badge: presence,\n size: avatarSizes[size],\n },\n elementType: Avatar,\n })\n : undefined,\n presence: presenceOnly\n ? slot.optional(presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n elementType: PresenceBadge,\n })\n : undefined,\n };\n};\n\n/**\n * Base hook for Persona component, manages state and structure common to all variants of Persona\n */\nexport const usePersonaBase_unstable = (props: PersonaBaseProps, ref?: React.Ref<HTMLElement>): PersonaBaseState => {\n const {\n name,\n primaryText: primaryTextProp,\n secondaryText: secondaryTextProp,\n tertiaryText: tertiaryTextProp,\n quaternaryText: quaternaryTextProp,\n ...rest\n } = props;\n\n const primaryText = slot.optional(primaryTextProp, {\n renderByDefault: true,\n defaultProps: {\n children: name,\n },\n elementType: 'span',\n });\n const secondaryText = slot.optional(secondaryTextProp, { elementType: 'span' });\n const tertiaryText = slot.optional(tertiaryTextProp, { elementType: 'span' });\n const quaternaryText = slot.optional(quaternaryTextProp, { elementType: 'span' });\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].filter(Boolean).length;\n\n return {\n numTextLines,\n components: {\n root: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n quaternaryText: 'span',\n },\n root: slot.always(\n {\n ref: ref as React.Ref<HTMLDivElement>,\n ...rest,\n },\n { elementType: 'div' },\n ),\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","slot","PresenceBadge","usePersona_unstable","props","ref","avatar","presenceOnly","size","textAlignment","textPosition","presence","baseProps","state","usePersonaBase_unstable","components","optional","renderByDefault","defaultProps","name","badge","avatarSizes","elementType","undefined","presenceSizes","primaryText","primaryTextProp","secondaryText","secondaryTextProp","tertiaryText","tertiaryTextProp","quaternaryText","quaternaryTextProp","rest","children","numTextLines","filter","Boolean","length","root","always","small","medium","large","huge"],"mappings":"AAAA;;;;;;;;;;;;2BAmEae;eAAAA;;IAlDAX,mBAAAA;;;;;iEAfU,QAAQ;6BACR,yBAAyB;gCAC3B,4BAA4B;4BACnB,wBAAwB;AAY/C,4BAA4B,CAACC,OAAqBC;IACvD,MAAM,EACJC,MAAM,EACNC,eAAe,KAAK,EACpBC,OAAO,QAAQ,EACfC,gBAAgB,OAAO,EACvBC,eAAe,OAAO,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IAEJ,MAAMS,QAAQC,wBAAwBF,WAAWP;IAEjD,OAAO;QACL,GAAGQ,KAAK;QACRN;QACAC;QACAC;QACAC;QACAK,YAAY;YACV,4DAA4D;YAC5D,GAAGF,MA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;QACT,GACA;YAAEX,aAAa;QAAM;QAEvBG;QACAE;QACAE;QACAE;IACF;AACF,EAAE;AAEF,MAAMP,gBAAgB;IACpB,eAAe;IACfiB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR;AAEA,MAAMvB,cAAc;IAClB,eAAe;IACfoB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR"}
1
+ {"version":3,"sources":["../src/components/Persona/usePersona.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { slot } from '@fluentui/react-utilities';\nimport { PresenceBadge } from '@fluentui/react-badge';\nimport type { PersonaBaseProps, PersonaBaseState, 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 {\n avatar,\n presenceOnly = false,\n size = 'medium',\n textAlignment = 'start',\n textPosition = 'after',\n presence,\n ...baseProps\n } = props;\n\n const state = usePersonaBase_unstable(baseProps, ref);\n\n return {\n ...state,\n presenceOnly,\n size,\n textAlignment,\n textPosition,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...state.components,\n avatar: Avatar,\n presence: PresenceBadge,\n },\n avatar: !presenceOnly\n ? slot.optional(avatar, {\n renderByDefault: true,\n defaultProps: {\n name: props.name,\n badge: presence,\n size: avatarSizes[size],\n },\n elementType: Avatar,\n })\n : undefined,\n presence: presenceOnly\n ? slot.optional(presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n elementType: PresenceBadge,\n })\n : undefined,\n };\n};\n\n/**\n * Base hook for Persona component, manages state and structure common to all variants of Persona\n */\nexport const usePersonaBase_unstable = (props: PersonaBaseProps, ref?: React.Ref<HTMLElement>): PersonaBaseState => {\n const {\n name,\n primaryText: primaryTextProp,\n secondaryText: secondaryTextProp,\n tertiaryText: tertiaryTextProp,\n quaternaryText: quaternaryTextProp,\n ...rest\n } = props;\n\n const primaryText = slot.optional(primaryTextProp, {\n renderByDefault: true,\n defaultProps: {\n children: name,\n },\n elementType: 'span',\n });\n const secondaryText = slot.optional(secondaryTextProp, { elementType: 'span' });\n const tertiaryText = slot.optional(tertiaryTextProp, { elementType: 'span' });\n const quaternaryText = slot.optional(quaternaryTextProp, { elementType: 'span' });\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].filter(Boolean).length;\n\n return {\n numTextLines,\n components: {\n root: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n quaternaryText: 'span',\n },\n root: slot.always(\n {\n ref: ref as React.Ref<HTMLDivElement>,\n ...rest,\n },\n { elementType: 'div' },\n ),\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":["Avatar","slot","PresenceBadge","usePersona_unstable","props","ref","avatar","presenceOnly","size","textAlignment","textPosition","presence","baseProps","state","usePersonaBase_unstable","components","optional","renderByDefault","defaultProps","name","badge","avatarSizes","elementType","undefined","presenceSizes","primaryText","primaryTextProp","secondaryText","secondaryTextProp","tertiaryText","tertiaryTextProp","quaternaryText","quaternaryTextProp","rest","children","numTextLines","filter","Boolean","length","root","always","small","medium","large","huge"],"mappings":"AAAA;;;;;;;;;;;;2BAmEac;eAAAA;;IAlDAX,mBAAAA;;;;6BAdU,yBAAyB;gCAC3B,4BAA4B;4BACnB,wBAAwB;AAY/C,4BAA4B,CAACC,OAAqBC;IACv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V,aAAa;IAAO;IAC/E,MAAMa,eAAe;QAACV;QAAaE;QAAeE;QAAcE;KAAe,CAACK,MAAM,CAACC,SAASC,MAAM;IAEtG,OAAO;QACLH;QACApB,YAAY;YACVwB,MAAM;YACNd,aAAa;YACbE,eAAe;YACfE,cAAc;YACdE,gBAAgB;QAClB;QACAQ,MAAMtC,oBAAAA,CAAKuC,MAAM,CACf;YACEnC,KAAKA;YACL,GAAG4B,IAAI;QACT,GACA;YAAEX,aAAa;QAAM;QAEvBG;QACAE;QACAE;QACAE;IACF;AACF,EAAE;AAEF,MAAMP,gBAAgB;IACpB,eAAe;IACfiB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR;AAEA,MAAMvB,cAAc;IAClB,eAAe;IACfoB,OAAO;IACPC,QAAQ;IACRC,OAAO;IACP,eAAe;IACfC,MAAM;AACR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-persona",
3
- "version": "9.7.1",
3
+ "version": "9.7.3",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,12 +12,12 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui/react-avatar": "^9.10.4",
16
- "@fluentui/react-badge": "^9.5.1",
15
+ "@fluentui/react-avatar": "^9.11.1",
16
+ "@fluentui/react-badge": "^9.5.2",
17
17
  "@fluentui/react-shared-contexts": "^9.26.2",
18
18
  "@fluentui/react-theme": "^9.2.1",
19
- "@fluentui/react-utilities": "^9.26.2",
20
- "@fluentui/react-jsx-runtime": "^9.4.1",
19
+ "@fluentui/react-utilities": "^9.26.3",
20
+ "@fluentui/react-jsx-runtime": "^9.4.2",
21
21
  "@griffel/react": "^1.5.32",
22
22
  "@swc/helpers": "^0.5.1"
23
23
  },