@fluentui/react-persona 9.2.49 → 9.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,73 @@
2
2
  "name": "@fluentui/react-persona",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 11 Oct 2023 13:50:07 GMT",
5
+ "date": "Wed, 18 Oct 2023 17:47:35 GMT",
6
+ "tag": "@fluentui/react-persona_v9.2.51",
7
+ "version": "9.2.51",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-persona",
13
+ "commit": "967882a55a7333effea42e4c24a64e8547309116",
14
+ "comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-persona",
19
+ "comment": "Bump @fluentui/react-avatar to v9.5.41",
20
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-persona",
25
+ "comment": "Bump @fluentui/react-badge to v9.2.10",
26
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-persona",
31
+ "comment": "Bump @fluentui/react-utilities to v9.15.1",
32
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-persona",
37
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.18",
38
+ "commit": "c0d3065982e1646c54ba00c1d524248b792dbcad"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Thu, 12 Oct 2023 14:55:44 GMT",
45
+ "tag": "@fluentui/react-persona_v9.2.50",
46
+ "version": "9.2.50",
47
+ "comments": {
48
+ "patch": [
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-persona",
52
+ "comment": "Bump @fluentui/react-avatar to v9.5.40",
53
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
54
+ },
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-persona",
58
+ "comment": "Bump @fluentui/react-badge to v9.2.9",
59
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-persona",
64
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.17",
65
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ {
71
+ "date": "Wed, 11 Oct 2023 13:54:26 GMT",
6
72
  "tag": "@fluentui/react-persona_v9.2.49",
7
73
  "version": "9.2.49",
8
74
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,36 @@
1
1
  # Change Log - @fluentui/react-persona
2
2
 
3
- This log was last generated on Wed, 11 Oct 2023 13:50:07 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 18 Oct 2023 17:47:35 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.2.51](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.51)
8
+
9
+ Wed, 18 Oct 2023 17:47:35 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.50..@fluentui/react-persona_v9.2.51)
11
+
12
+ ### Patches
13
+
14
+ - chore: migrate from getNativeElementProps to getIntrinsicElementProps ([PR #29499](https://github.com/microsoft/fluentui/pull/29499) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-avatar to v9.5.41 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
16
+ - Bump @fluentui/react-badge to v9.2.10 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.15.1 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
18
+ - Bump @fluentui/react-jsx-runtime to v9.0.18 ([PR #29560](https://github.com/microsoft/fluentui/pull/29560) by beachball)
19
+
20
+ ## [9.2.50](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.50)
21
+
22
+ Thu, 12 Oct 2023 14:55:44 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.49..@fluentui/react-persona_v9.2.50)
24
+
25
+ ### Patches
26
+
27
+ - Bump @fluentui/react-avatar to v9.5.40 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
28
+ - Bump @fluentui/react-badge to v9.2.9 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
29
+ - Bump @fluentui/react-jsx-runtime to v9.0.17 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
30
+
7
31
  ## [9.2.49](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.49)
8
32
 
9
- Wed, 11 Oct 2023 13:50:07 GMT
33
+ Wed, 11 Oct 2023 13:54:26 GMT
10
34
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.48..@fluentui/react-persona_v9.2.49)
11
35
 
12
36
  ### Patches
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Avatar } from '@fluentui/react-avatar';
3
- import { getNativeElementProps, slot } from '@fluentui/react-utilities';
3
+ import { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';
4
4
  import { PresenceBadge } from '@fluentui/react-badge';
5
5
  /**
6
6
  * Create the state required to render Persona.
@@ -49,9 +49,12 @@ import { PresenceBadge } from '@fluentui/react-badge';
49
49
  tertiaryText: 'span',
50
50
  quaternaryText: 'span'
51
51
  },
52
- root: slot.always(getNativeElementProps('div', {
52
+ root: slot.always(getIntrinsicElementProps('div', {
53
53
  ...props,
54
- ref
54
+ // FIXME:
55
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
56
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
57
+ ref: ref
55
58
  }, /* excludedPropNames */ [
56
59
  'name'
57
60
  ]), {
@@ -1 +1 @@
1
- {"version":3,"sources":["usePersona.ts"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { getNativeElementProps, slot } 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 = slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: name,\n },\n elementType: 'span',\n });\n const secondaryText = slot.optional(props.secondaryText, { elementType: 'span' });\n const tertiaryText = slot.optional(props.tertiaryText, { elementType: 'span' });\n const quaternaryText = slot.optional(props.quaternaryText, { elementType: 'span' });\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].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\n root: slot.always(\n getNativeElementProps(\n 'div',\n {\n ...props,\n ref,\n },\n /* excludedPropNames */ ['name'],\n ),\n { elementType: 'div' },\n ),\n avatar: !presenceOnly\n ? slot.optional(props.avatar, {\n renderByDefault: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSizes[size],\n },\n elementType: Avatar,\n })\n : undefined,\n presence: presenceOnly\n ? slot.optional(props.presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n elementType: PresenceBadge,\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","slot","PresenceBadge","usePersona_unstable","props","ref","name","presenceOnly","size","textAlignment","textPosition","primaryText","optional","renderByDefault","defaultProps","children","elementType","secondaryText","tertiaryText","quaternaryText","numTextLines","filter","Boolean","length","components","root","avatar","presence","always","badge","avatarSizes","undefined","presenceSizes","small","medium","large","huge"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,qBAAqB,EAAEC,IAAI,QAAQ,4BAA4B;AACxE,SAASC,aAAa,QAAQ,wBAAwB;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,MAAM,EAAEC,IAAI,EAAEC,eAAe,KAAK,EAAEC,OAAO,QAAQ,EAAEC,gBAAgB,OAAO,EAAEC,eAAe,OAAO,EAAE,GAAGN;IAEzG,MAAMO,cAAcV,KAAKW,QAAQ,CAACR,MAAMO,WAAW,EAAE;QACnDE,iBAAiB;QACjBC,cAAc;YACZC,UAAUT;QACZ;QACAU,aAAa;IACf;IACA,MAAMC,gBAAgBhB,KAAKW,QAAQ,CAACR,MAAMa,aAAa,EAAE;QAAED,aAAa;IAAO;IAC/E,MAAME,eAAejB,KAAKW,QAAQ,CAACR,MAAMc,YAAY,EAAE;QAAEF,aAAa;IAAO;IAC7E,MAAMG,iBAAiBlB,KAAKW,QAAQ,CAACR,MAAMe,cAAc,EAAE;QAAEH,aAAa;IAAO;IACjF,MAAMI,eAAe;QAACT;QAAaM;QAAeC;QAAcC;KAAe,CAACE,MAAM,CAACC,SAASC,MAAM;IACtG,OAAO;QACLH;QACAb;QACAC;QACAC;QACAC;QACAc,YAAY;YACVC,MAAM;YACNC,QAAQ3B;YACR4B,UAAUzB;YACVS,aAAa;YACbM,eAAe;YACfC,cAAc;YACdC,gBAAgB;QAClB;QAEAM,MAAMxB,KAAK2B,MAAM,CACf5B,sBACE,OACA;YACE,GAAGI,KAAK;YACRC;QACF,GACA,qBAAqB,GAAG;YAAC;SAAO,GAElC;YAAEW,aAAa;QAAM;QAEvBU,QAAQ,CAACnB,eACLN,KAAKW,QAAQ,CAACR,MAAMsB,MAAM,EAAE;YAC1Bb,iBAAiB;YACjBC,cAAc;gBACZR;gBACAuB,OAAOzB,MAAMuB,QAAQ;gBACrBnB,MAAMsB,WAAW,CAACtB,KAAK;YACzB;YACAQ,aAAajB;QACf,KACAgC;QACJJ,UAAUpB,eACNN,KAAKW,QAAQ,CAACR,MAAMuB,QAAQ,EAAE;YAC5Bb,cAAc;gBACZN,MAAMwB,aAAa,CAACxB,KAAK;YAC3B;YACAQ,aAAad;QACf,KACA6B;QACJpB;QACAM;QACAC;QACAC;IACF;AACF,EAAE;AAEF,MAAMa,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
+ {"version":3,"sources":["usePersona.ts"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { getIntrinsicElementProps, slot } 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 = slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: name,\n },\n elementType: 'span',\n });\n const secondaryText = slot.optional(props.secondaryText, { elementType: 'span' });\n const tertiaryText = slot.optional(props.tertiaryText, { elementType: 'span' });\n const quaternaryText = slot.optional(props.quaternaryText, { elementType: 'span' });\n const numTextLines = [primaryText, secondaryText, tertiaryText, quaternaryText].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\n root: slot.always(\n getIntrinsicElementProps(\n 'div',\n {\n ...props,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref as React.Ref<HTMLDivElement>,\n },\n /* excludedPropNames */ ['name'],\n ),\n { elementType: 'div' },\n ),\n avatar: !presenceOnly\n ? slot.optional(props.avatar, {\n renderByDefault: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSizes[size],\n },\n elementType: Avatar,\n })\n : undefined,\n presence: presenceOnly\n ? slot.optional(props.presence, {\n defaultProps: {\n size: presenceSizes[size],\n },\n elementType: PresenceBadge,\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","getIntrinsicElementProps","slot","PresenceBadge","usePersona_unstable","props","ref","name","presenceOnly","size","textAlignment","textPosition","primaryText","optional","renderByDefault","defaultProps","children","elementType","secondaryText","tertiaryText","quaternaryText","numTextLines","filter","Boolean","length","components","root","avatar","presence","always","badge","avatarSizes","undefined","presenceSizes","small","medium","large","huge"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,aAAa,QAAQ,wBAAwB;AAGtD;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,MAAM,EAAEC,IAAI,EAAEC,eAAe,KAAK,EAAEC,OAAO,QAAQ,EAAEC,gBAAgB,OAAO,EAAEC,eAAe,OAAO,EAAE,GAAGN;IAEzG,MAAMO,cAAcV,KAAKW,QAAQ,CAACR,MAAMO,WAAW,EAAE;QACnDE,iBAAiB;QACjBC,cAAc;YACZC,UAAUT;QACZ;QACAU,aAAa;IACf;IACA,MAAMC,gBAAgBhB,KAAKW,QAAQ,CAACR,MAAMa,aAAa,EAAE;QAAED,aAAa;IAAO;IAC/E,MAAME,eAAejB,KAAKW,QAAQ,CAACR,MAAMc,YAAY,EAAE;QAAEF,aAAa;IAAO;IAC7E,MAAMG,iBAAiBlB,KAAKW,QAAQ,CAACR,MAAMe,cAAc,EAAE;QAAEH,aAAa;IAAO;IACjF,MAAMI,eAAe;QAACT;QAAaM;QAAeC;QAAcC;KAAe,CAACE,MAAM,CAACC,SAASC,MAAM;IACtG,OAAO;QACLH;QACAb;QACAC;QACAC;QACAC;QACAc,YAAY;YACVC,MAAM;YACNC,QAAQ3B;YACR4B,UAAUzB;YACVS,aAAa;YACbM,eAAe;YACfC,cAAc;YACdC,gBAAgB;QAClB;QAEAM,MAAMxB,KAAK2B,MAAM,CACf5B,yBACE,OACA;YACE,GAAGI,KAAK;YACR,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FC,KAAKA;QACP,GACA,qBAAqB,GAAG;YAAC;SAAO,GAElC;YAAEW,aAAa;QAAM;QAEvBU,QAAQ,CAACnB,eACLN,KAAKW,QAAQ,CAACR,MAAMsB,MAAM,EAAE;YAC1Bb,iBAAiB;YACjBC,cAAc;gBACZR;gBACAuB,OAAOzB,MAAMuB,QAAQ;gBACrBnB,MAAMsB,WAAW,CAACtB,KAAK;YACzB;YACAQ,aAAajB;QACf,KACAgC;QACJJ,UAAUpB,eACNN,KAAKW,QAAQ,CAACR,MAAMuB,QAAQ,EAAE;YAC5Bb,cAAc;gBACZN,MAAMwB,aAAa,CAACxB,KAAK;YAC3B;YACAQ,aAAad;QACf,KACA6B;QACJpB;QACAM;QACAC;QACAC;IACF;AACF,EAAE;AAEF,MAAMa,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"}
@@ -52,9 +52,12 @@ const usePersona_unstable = (props, ref)=>{
52
52
  tertiaryText: 'span',
53
53
  quaternaryText: 'span'
54
54
  },
55
- root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)('div', {
55
+ root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
56
56
  ...props,
57
- ref
57
+ // FIXME:
58
+ // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
59
+ // but since it would be a breaking change to fix it, we are casting ref to it's proper type
60
+ ref: ref
58
61
  }, /* excludedPropNames */ [
59
62
  'name'
60
63
  ]), {
@@ -1 +1 @@
1
- {"version":3,"sources":["usePersona.js"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { getNativeElementProps, slot } 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 = slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: name\n },\n elementType: 'span'\n });\n const secondaryText = slot.optional(props.secondaryText, {\n elementType: 'span'\n });\n const tertiaryText = slot.optional(props.tertiaryText, {\n elementType: 'span'\n });\n const quaternaryText = slot.optional(props.quaternaryText, {\n elementType: 'span'\n });\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: slot.always(getNativeElementProps('div', {\n ...props,\n ref\n }, /* excludedPropNames */ [\n 'name'\n ]), {\n elementType: 'div'\n }),\n avatar: !presenceOnly ? slot.optional(props.avatar, {\n renderByDefault: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSizes[size]\n },\n elementType: Avatar\n }) : undefined,\n presence: presenceOnly ? slot.optional(props.presence, {\n defaultProps: {\n size: presenceSizes[size]\n },\n elementType: PresenceBadge\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","slot","optional","renderByDefault","defaultProps","children","elementType","secondaryText","tertiaryText","quaternaryText","numTextLines","filter","Boolean","length","components","root","avatar","Avatar","presence","PresenceBadge","always","getNativeElementProps","badge","avatarSizes","undefined","presenceSizes","small","medium","large","huge"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;6BACA;gCACqB;4BACd;AASnB,MAAMA,sBAAsB,CAACC,OAAOC;IAC3C,MAAM,EAAEC,IAAI,EAAEC,eAAe,KAAK,EAAEC,OAAO,QAAQ,EAAEC,gBAAgB,OAAO,EAAEC,eAAe,OAAO,EAAE,GAAGN;IACzG,MAAMO,cAAcC,oBAAI,CAACC,QAAQ,CAACT,MAAMO,WAAW,EAAE;QACjDG,iBAAiB;QACjBC,cAAc;YACVC,UAAUV;QACd;QACAW,aAAa;IACjB;IACA,MAAMC,gBAAgBN,oBAAI,CAACC,QAAQ,CAACT,MAAMc,aAAa,EAAE;QACrDD,aAAa;IACjB;IACA,MAAME,eAAeP,oBAAI,CAACC,QAAQ,CAACT,MAAMe,YAAY,EAAE;QACnDF,aAAa;IACjB;IACA,MAAMG,iBAAiBR,oBAAI,CAACC,QAAQ,CAACT,MAAMgB,cAAc,EAAE;QACvDH,aAAa;IACjB;IACA,MAAMI,eAAe;QACjBV;QACAO;QACAC;QACAC;KACH,CAACE,MAAM,CAACC,SAASC,MAAM;IACxB,OAAO;QACHH;QACAd;QACAC;QACAC;QACAC;QACAe,YAAY;YACRC,MAAM;YACNC,QAAQC,mBAAM;YACdC,UAAUC,yBAAa;YACvBnB,aAAa;YACbO,eAAe;YACfC,cAAc;YACdC,gBAAgB;QACpB;QACAM,MAAMd,oBAAI,CAACmB,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3C,GAAG5B,KAAK;YACRC;QACJ,GAAG,qBAAqB,GAAG;YACvB;SACH,GAAG;YACAY,aAAa;QACjB;QACAU,QAAQ,CAACpB,eAAeK,oBAAI,CAACC,QAAQ,CAACT,MAAMuB,MAAM,EAAE;YAChDb,iBAAiB;YACjBC,cAAc;gBACVT;gBACA2B,OAAO7B,MAAMyB,QAAQ;gBACrBrB,MAAM0B,WAAW,CAAC1B,KAAK;YAC3B;YACAS,aAAaW,mBAAM;QACvB,KAAKO;QACLN,UAAUtB,eAAeK,oBAAI,CAACC,QAAQ,CAACT,MAAMyB,QAAQ,EAAE;YACnDd,cAAc;gBACVP,MAAM4B,aAAa,CAAC5B,KAAK;YAC7B;YACAS,aAAaa,yBAAa;QAC9B,KAAKK;QACLxB;QACAO;QACAC;QACAC;IACJ;AACJ;AACA,MAAMgB,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"}
1
+ {"version":3,"sources":["usePersona.js"],"sourcesContent":["import * as React from 'react';\nimport { Avatar } from '@fluentui/react-avatar';\nimport { getIntrinsicElementProps, slot } 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 = slot.optional(props.primaryText, {\n renderByDefault: true,\n defaultProps: {\n children: name\n },\n elementType: 'span'\n });\n const secondaryText = slot.optional(props.secondaryText, {\n elementType: 'span'\n });\n const tertiaryText = slot.optional(props.tertiaryText, {\n elementType: 'span'\n });\n const quaternaryText = slot.optional(props.quaternaryText, {\n elementType: 'span'\n });\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: slot.always(getIntrinsicElementProps('div', {\n ...props,\n // FIXME:\n // `ref` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: ref\n }, /* excludedPropNames */ [\n 'name'\n ]), {\n elementType: 'div'\n }),\n avatar: !presenceOnly ? slot.optional(props.avatar, {\n renderByDefault: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSizes[size]\n },\n elementType: Avatar\n }) : undefined,\n presence: presenceOnly ? slot.optional(props.presence, {\n defaultProps: {\n size: presenceSizes[size]\n },\n elementType: PresenceBadge\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","slot","optional","renderByDefault","defaultProps","children","elementType","secondaryText","tertiaryText","quaternaryText","numTextLines","filter","Boolean","length","components","root","avatar","Avatar","presence","PresenceBadge","always","getIntrinsicElementProps","badge","avatarSizes","undefined","presenceSizes","small","medium","large","huge"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;6BACA;gCACwB;4BACjB;AASnB,MAAMA,sBAAsB,CAACC,OAAOC;IAC3C,MAAM,EAAEC,IAAI,EAAEC,eAAe,KAAK,EAAEC,OAAO,QAAQ,EAAEC,gBAAgB,OAAO,EAAEC,eAAe,OAAO,EAAE,GAAGN;IACzG,MAAMO,cAAcC,oBAAI,CAACC,QAAQ,CAACT,MAAMO,WAAW,EAAE;QACjDG,iBAAiB;QACjBC,cAAc;YACVC,UAAUV;QACd;QACAW,aAAa;IACjB;IACA,MAAMC,gBAAgBN,oBAAI,CAACC,QAAQ,CAACT,MAAMc,aAAa,EAAE;QACrDD,aAAa;IACjB;IACA,MAAME,eAAeP,oBAAI,CAACC,QAAQ,CAACT,MAAMe,YAAY,EAAE;QACnDF,aAAa;IACjB;IACA,MAAMG,iBAAiBR,oBAAI,CAACC,QAAQ,CAACT,MAAMgB,cAAc,EAAE;QACvDH,aAAa;IACjB;IACA,MAAMI,eAAe;QACjBV;QACAO;QACAC;QACAC;KACH,CAACE,MAAM,CAACC,SAASC,MAAM;IACxB,OAAO;QACHH;QACAd;QACAC;QACAC;QACAC;QACAe,YAAY;YACRC,MAAM;YACNC,QAAQC,mBAAM;YACdC,UAAUC,yBAAa;YACvBnB,aAAa;YACbO,eAAe;YACfC,cAAc;YACdC,gBAAgB;QACpB;QACAM,MAAMd,oBAAI,CAACmB,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,GAAG5B,KAAK;YACR,SAAS;YACT,4EAA4E;YAC5E,4FAA4F;YAC5FC,KAAKA;QACT,GAAG,qBAAqB,GAAG;YACvB;SACH,GAAG;YACAY,aAAa;QACjB;QACAU,QAAQ,CAACpB,eAAeK,oBAAI,CAACC,QAAQ,CAACT,MAAMuB,MAAM,EAAE;YAChDb,iBAAiB;YACjBC,cAAc;gBACVT;gBACA2B,OAAO7B,MAAMyB,QAAQ;gBACrBrB,MAAM0B,WAAW,CAAC1B,KAAK;YAC3B;YACAS,aAAaW,mBAAM;QACvB,KAAKO;QACLN,UAAUtB,eAAeK,oBAAI,CAACC,QAAQ,CAACT,MAAMyB,QAAQ,EAAE;YACnDd,cAAc;gBACVP,MAAM4B,aAAa,CAAC5B,KAAK;YAC7B;YACAS,aAAaa,yBAAa;QAC9B,KAAKK;QACLxB;QACAO;QACAC;QACAC;IACJ;AACJ;AACA,MAAMgB,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-persona",
3
- "version": "9.2.49",
3
+ "version": "9.2.51",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -33,12 +33,12 @@
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-avatar": "^9.5.39",
37
- "@fluentui/react-badge": "^9.2.8",
36
+ "@fluentui/react-avatar": "^9.5.41",
37
+ "@fluentui/react-badge": "^9.2.10",
38
38
  "@fluentui/react-shared-contexts": "^9.10.0",
39
39
  "@fluentui/react-theme": "^9.1.14",
40
- "@fluentui/react-utilities": "^9.15.0",
41
- "@fluentui/react-jsx-runtime": "^9.0.16",
40
+ "@fluentui/react-utilities": "^9.15.1",
41
+ "@fluentui/react-jsx-runtime": "^9.0.18",
42
42
  "@griffel/react": "^1.5.14",
43
43
  "@swc/helpers": "^0.5.1"
44
44
  },