@fluentui/react-persona 0.0.0-nightly-20231012-0415.1 → 0.0.0-nightly-20231016-0417.1

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,9 +2,9 @@
2
2
  "name": "@fluentui/react-persona",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 12 Oct 2023 04:22:36 GMT",
6
- "tag": "@fluentui/react-persona_v0.0.0-nightly-20231012-0415.1",
7
- "version": "0.0.0-nightly-20231012-0415.1",
5
+ "date": "Mon, 16 Oct 2023 04:24:32 GMT",
6
+ "tag": "@fluentui/react-persona_v0.0.0-nightly-20231016-0417.1",
7
+ "version": "0.0.0-nightly-20231016-0417.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,50 +16,77 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-persona",
19
- "comment": "Bump @fluentui/react-avatar to v0.0.0-nightly-20231012-0415.1",
20
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
19
+ "comment": "Bump @fluentui/react-avatar to v0.0.0-nightly-20231016-0417.1",
20
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-persona",
25
- "comment": "Bump @fluentui/react-badge to v0.0.0-nightly-20231012-0415.1",
26
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
25
+ "comment": "Bump @fluentui/react-badge to v0.0.0-nightly-20231016-0417.1",
26
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-persona",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231012-0415.1",
32
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
31
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231016-0417.1",
32
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-persona",
37
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20231012-0415.1",
38
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
37
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20231016-0417.1",
38
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
39
39
  },
40
40
  {
41
41
  "author": "beachball",
42
42
  "package": "@fluentui/react-persona",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20231012-0415.1",
44
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
43
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20231016-0417.1",
44
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
45
45
  },
46
46
  {
47
47
  "author": "beachball",
48
48
  "package": "@fluentui/react-persona",
49
- "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231012-0415.1",
50
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
49
+ "comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231016-0417.1",
50
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
51
51
  },
52
52
  {
53
53
  "author": "beachball",
54
54
  "package": "@fluentui/react-persona",
55
- "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20231012-0415.1",
56
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
55
+ "comment": "Bump @fluentui/react-conformance to v0.0.0-nightly-20231016-0417.1",
56
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
57
57
  },
58
58
  {
59
59
  "author": "beachball",
60
60
  "package": "@fluentui/react-persona",
61
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231012-0415.1",
62
- "commit": "9540e996730ba65d980f1b0ab8eda151661020be"
61
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231016-0417.1",
62
+ "commit": "9ae318a652ff9867244c91fc0c1e63ab1d2d756e"
63
+ }
64
+ ]
65
+ }
66
+ },
67
+ {
68
+ "date": "Thu, 12 Oct 2023 14:55:44 GMT",
69
+ "tag": "@fluentui/react-persona_v9.2.50",
70
+ "version": "9.2.50",
71
+ "comments": {
72
+ "patch": [
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-persona",
76
+ "comment": "Bump @fluentui/react-avatar to v9.5.40",
77
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-persona",
82
+ "comment": "Bump @fluentui/react-badge to v9.2.9",
83
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
84
+ },
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui/react-persona",
88
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.17",
89
+ "commit": "8178c3cae60005bc21137aa1f3e766e18cdb4a30"
63
90
  }
64
91
  ]
65
92
  }
package/CHANGELOG.md CHANGED
@@ -1,25 +1,36 @@
1
1
  # Change Log - @fluentui/react-persona
2
2
 
3
- This log was last generated on Thu, 12 Oct 2023 04:22:36 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 16 Oct 2023 04:24:32 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20231012-0415.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v0.0.0-nightly-20231012-0415.1)
7
+ ## [0.0.0-nightly-20231016-0417.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v0.0.0-nightly-20231016-0417.1)
8
8
 
9
- Thu, 12 Oct 2023 04:22:36 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.49..@fluentui/react-persona_v0.0.0-nightly-20231012-0415.1)
9
+ Mon, 16 Oct 2023 04:24:32 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.50..@fluentui/react-persona_v0.0.0-nightly-20231016-0417.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-avatar to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
16
- - Bump @fluentui/react-badge to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
18
- - Bump @fluentui/react-theme to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
20
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
21
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
22
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231012-0415.1 ([commit](https://github.com/microsoft/fluentui/commit/9540e996730ba65d980f1b0ab8eda151661020be) by beachball)
15
+ - Bump @fluentui/react-avatar to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
16
+ - Bump @fluentui/react-badge to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
18
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
19
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
20
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
21
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
22
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20231016-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/9ae318a652ff9867244c91fc0c1e63ab1d2d756e) by beachball)
23
+
24
+ ## [9.2.50](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.50)
25
+
26
+ Thu, 12 Oct 2023 14:55:44 GMT
27
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.2.49..@fluentui/react-persona_v9.2.50)
28
+
29
+ ### Patches
30
+
31
+ - Bump @fluentui/react-avatar to v9.5.40 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
32
+ - Bump @fluentui/react-badge to v9.2.9 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
33
+ - Bump @fluentui/react-jsx-runtime to v9.0.17 ([PR #29513](https://github.com/microsoft/fluentui/pull/29513) by beachball)
23
34
 
24
35
  ## [9.2.49](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.2.49)
25
36
 
@@ -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,wB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B,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,UAAU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PC,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": "0.0.0-nightly-20231012-0415.1",
3
+ "version": "0.0.0-nightly-20231016-0417.1",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -27,18 +27,18 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
- "@fluentui/react-conformance": "0.0.0-nightly-20231012-0415.1",
31
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20231012-0415.1",
30
+ "@fluentui/react-conformance": "0.0.0-nightly-20231016-0417.1",
31
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20231016-0417.1",
32
32
  "@fluentui/scripts-api-extractor": "*",
33
33
  "@fluentui/scripts-tasks": "*"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-avatar": "0.0.0-nightly-20231012-0415.1",
37
- "@fluentui/react-badge": "0.0.0-nightly-20231012-0415.1",
38
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20231012-0415.1",
39
- "@fluentui/react-theme": "0.0.0-nightly-20231012-0415.1",
40
- "@fluentui/react-utilities": "0.0.0-nightly-20231012-0415.1",
41
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20231012-0415.1",
36
+ "@fluentui/react-avatar": "0.0.0-nightly-20231016-0417.1",
37
+ "@fluentui/react-badge": "0.0.0-nightly-20231016-0417.1",
38
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20231016-0417.1",
39
+ "@fluentui/react-theme": "0.0.0-nightly-20231016-0417.1",
40
+ "@fluentui/react-utilities": "0.0.0-nightly-20231016-0417.1",
41
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20231016-0417.1",
42
42
  "@griffel/react": "^1.5.14",
43
43
  "@swc/helpers": "^0.5.1"
44
44
  },