@fluentui/react-persona 0.0.0-nightly-20221013-0426.1 → 9.0.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,46 +2,52 @@
2
2
  "name": "@fluentui/react-persona",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 13 Oct 2022 04:32:43 GMT",
6
- "tag": "@fluentui/react-persona_v0.0.0-nightly-20221013-0426.1",
7
- "version": "0.0.0-nightly-20221013-0426.1",
5
+ "date": "Thu, 13 Oct 2022 10:59:31 GMT",
6
+ "tag": "@fluentui/react-persona_v9.0.1",
7
+ "version": "9.0.1",
8
8
  "comments": {
9
- "prerelease": [
9
+ "patch": [
10
10
  {
11
- "author": "fluentui-internal@service.microsoft.com",
11
+ "author": "olfedias@microsoft.com",
12
12
  "package": "@fluentui/react-persona",
13
- "commit": "not available",
14
- "comment": "Release nightly v9"
13
+ "commit": "1a527d440e0497ef8046b3ce240492241e7a04ac",
14
+ "comment": "chore: Update Griffel to latest version"
15
15
  },
16
16
  {
17
- "author": "beachball",
17
+ "author": "esteban.230@hotmail.com",
18
+ "package": "@fluentui/react-persona",
19
+ "commit": "0b45dbb1df893c61086b5de4f312f7258d3d8fd7",
20
+ "comment": "chore: Add unit and conformance tests."
21
+ },
22
+ {
23
+ "author": "esteban.230@hotmail.com",
18
24
  "package": "@fluentui/react-persona",
19
- "comment": "Bump @fluentui/react-avatar to v0.0.0-nightly-20221013-0426.1",
20
- "commit": "b8c447f4822ef29f70f42a94dbbaeeab164fd343"
25
+ "commit": "67a8c98b8d53cd2fa14d668cf639b867b68ad18a",
26
+ "comment": "chore: Adding bundle-size command for bundle-size fixtures."
21
27
  },
22
28
  {
23
29
  "author": "beachball",
24
30
  "package": "@fluentui/react-persona",
25
- "comment": "Bump @fluentui/react-badge to v0.0.0-nightly-20221013-0426.1",
26
- "commit": "b8c447f4822ef29f70f42a94dbbaeeab164fd343"
31
+ "comment": "Bump @fluentui/react-avatar to v9.2.1",
32
+ "commit": "cd05c21e62ff37812d614330eb70f97fd978c97a"
27
33
  },
28
34
  {
29
35
  "author": "beachball",
30
36
  "package": "@fluentui/react-persona",
31
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20221013-0426.1",
32
- "commit": "b8c447f4822ef29f70f42a94dbbaeeab164fd343"
37
+ "comment": "Bump @fluentui/react-badge to v9.0.8",
38
+ "commit": "cd05c21e62ff37812d614330eb70f97fd978c97a"
33
39
  },
34
40
  {
35
41
  "author": "beachball",
36
42
  "package": "@fluentui/react-persona",
37
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20221013-0426.1",
38
- "commit": "b8c447f4822ef29f70f42a94dbbaeeab164fd343"
43
+ "comment": "Bump @fluentui/react-utilities to v9.1.1",
44
+ "commit": "cd05c21e62ff37812d614330eb70f97fd978c97a"
39
45
  },
40
46
  {
41
47
  "author": "beachball",
42
48
  "package": "@fluentui/react-persona",
43
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221013-0426.1",
44
- "commit": "b8c447f4822ef29f70f42a94dbbaeeab164fd343"
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.15",
50
+ "commit": "cd05c21e62ff37812d614330eb70f97fd978c97a"
45
51
  }
46
52
  ]
47
53
  }
package/CHANGELOG.md CHANGED
@@ -1,22 +1,23 @@
1
1
  # Change Log - @fluentui/react-persona
2
2
 
3
- This log was last generated on Thu, 13 Oct 2022 04:32:43 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 13 Oct 2022 10:59:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20221013-0426.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v0.0.0-nightly-20221013-0426.1)
7
+ ## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.0.1)
8
8
 
9
- Thu, 13 Oct 2022 04:32:43 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.0.0..@fluentui/react-persona_v0.0.0-nightly-20221013-0426.1)
9
+ Thu, 13 Oct 2022 10:59:31 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-persona_v9.0.0..@fluentui/react-persona_v9.0.1)
11
11
 
12
- ### Changes
12
+ ### Patches
13
13
 
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-20221013-0426.1 ([commit](https://github.com/microsoft/fluentui/commit/b8c447f4822ef29f70f42a94dbbaeeab164fd343) by beachball)
16
- - Bump @fluentui/react-badge to v0.0.0-nightly-20221013-0426.1 ([commit](https://github.com/microsoft/fluentui/commit/b8c447f4822ef29f70f42a94dbbaeeab164fd343) by beachball)
17
- - Bump @fluentui/react-theme to v0.0.0-nightly-20221013-0426.1 ([commit](https://github.com/microsoft/fluentui/commit/b8c447f4822ef29f70f42a94dbbaeeab164fd343) by beachball)
18
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20221013-0426.1 ([commit](https://github.com/microsoft/fluentui/commit/b8c447f4822ef29f70f42a94dbbaeeab164fd343) by beachball)
19
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20221013-0426.1 ([commit](https://github.com/microsoft/fluentui/commit/b8c447f4822ef29f70f42a94dbbaeeab164fd343) by beachball)
14
+ - chore: Update Griffel to latest version ([PR #25075](https://github.com/microsoft/fluentui/pull/25075) by olfedias@microsoft.com)
15
+ - chore: Add unit and conformance tests. ([PR #25007](https://github.com/microsoft/fluentui/pull/25007) by esteban.230@hotmail.com)
16
+ - chore: Adding bundle-size command for bundle-size fixtures. ([PR #25055](https://github.com/microsoft/fluentui/pull/25055) by esteban.230@hotmail.com)
17
+ - Bump @fluentui/react-avatar to v9.2.1 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
18
+ - Bump @fluentui/react-badge to v9.0.8 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.1.1 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.15 ([PR #25181](https://github.com/microsoft/fluentui/pull/25181) by beachball)
20
21
 
21
22
  ## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-persona_v9.0.0)
22
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"Persona.js","sourceRoot":"","sources":["../src/Persona.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Persona/index';\n"]}
1
+ {"version":3,"file":"Persona.js","sourceRoot":"../src/","sources":["Persona.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Persona/index';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/Persona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAIA;;;AAGG;;AACH,OAAO,MAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxF,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;EAEA,yBAAyB,CAAC,KAAD,CAAzB;EACA,OAAO,sBAAsB,CAAC,KAAD,CAA7B;AACD,CALyD,CAAnD;AAOP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { renderPersona_unstable } from './renderPersona';\nimport { usePersona_unstable } from './usePersona';\nimport { usePersonaStyles_unstable } from './usePersonaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { PersonaProps } from './Persona.types';\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 return renderPersona_unstable(state);\n});\n\nPersona.displayName = 'Persona';\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/Persona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAIA;;;AAGG;;AACH,OAAO,MAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxF,MAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;EAEA,yBAAyB,CAAC,KAAD,CAAzB;EACA,OAAO,sBAAsB,CAAC,KAAD,CAA7B;AACD,CALyD,CAAnD;AAOP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { renderPersona_unstable } from './renderPersona';\nimport { usePersona_unstable } from './usePersona';\nimport { usePersonaStyles_unstable } from './usePersonaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { PersonaProps } from './Persona.types';\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 return renderPersona_unstable(state);\n});\n\nPersona.displayName = 'Persona';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"Persona.types.js","sourceRoot":"","sources":["../../../src/components/Persona/Persona.types.ts"],"names":[],"mappings":"","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 * This defaults to the `name` prop, and it is recomended that you only set its value if it should be different from\n * from 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 position of the text relative to the avatar/presence.\n *\n * @default after\n */\n textPosition?: 'before' | 'after' | 'below';\n};\n\n/**\n * State used in rendering Persona\n */\nexport type PersonaState = ComponentState<PersonaSlots> &\n Required<Pick<PersonaProps, 'textPosition' | 'presenceOnly'>> & {\n /**\n * Whether the sizing type is fixed or not.\n */\n fixed: boolean;\n /**\n * The number of text lines used.\n */\n numTextLines: number;\n };\n"]}
1
+ {"version":3,"file":"Persona.types.js","sourceRoot":"../src/","sources":["components/Persona/Persona.types.ts"],"names":[],"mappings":"","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 * This defaults to the `name` prop, and it is recomended that you only set its value if it should be different from\n * from 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 position of the text relative to the avatar/presence.\n *\n * @default after\n */\n textPosition?: 'before' | 'after' | 'below';\n};\n\n/**\n * State used in rendering Persona\n */\nexport type PersonaState = ComponentState<PersonaSlots> &\n Required<Pick<PersonaProps, 'textPosition' | 'presenceOnly'>> & {\n /**\n * Whether the sizing type is fixed or not.\n */\n fixed: boolean;\n /**\n * The number of text lines used.\n */\n numTextLines: number;\n };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Persona/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './Persona';\nexport * from './Persona.types';\nexport * from './renderPersona';\nexport * from './usePersona';\nexport * from './usePersonaStyles';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Persona/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './Persona';\nexport * from './Persona.types';\nexport * from './renderPersona';\nexport * from './usePersona';\nexport * from './usePersonaStyles';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/renderPersona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAwB;EAC5D,MAAM;IAAE,YAAF;IAAgB;EAAhB,IAAiC,KAAvC;EACA,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAe,KAAf,CAArC;EAEA,MAAM,IAAI,GAAG,YAAY,GACrB,KAAK,CAAC,QAAN,iBAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADG,GAErB,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFpB;EAIA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,CAAC,YAAY,KAAK,OAAjB,IAA4B,YAAY,KAAK,OAA9C,KAA0D,IAD7D,EAEG,KAAK,CAAC,WAAN,iBAAqB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,WAAP,EAAkB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAlB,CAFxB,EAGG,KAAK,CAAC,aAAN,iBAAuB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,aAAP,EAAoB,EAAA,GAAK,SAAS,CAAC;EAAf,CAApB,CAH1B,EAIG,KAAK,CAAC,YAAN,iBAAsB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAnB,CAJzB,EAKG,KAAK,CAAC,cAAN,iBAAwB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,cAAP,EAAqB,EAAA,GAAK,SAAS,CAAC;EAAf,CAArB,CAL3B,EAMG,YAAY,KAAK,QAAjB,IAA6B,IANhC,CADF;AAUD,CAlBM","sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 } = getSlots<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"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/renderPersona.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAwB;EAC5D,MAAM;IAAE,YAAF;IAAgB;EAAhB,IAAiC,KAAvC;EACA,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAe,KAAf,CAArC;EAEA,MAAM,IAAI,GAAG,YAAY,GACrB,KAAK,CAAC,QAAN,iBAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADG,GAErB,KAAK,CAAC,MAAN,iBAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFpB;EAIA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,CAAC,YAAY,KAAK,OAAjB,IAA4B,YAAY,KAAK,OAA9C,KAA0D,IAD7D,EAEG,KAAK,CAAC,WAAN,iBAAqB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,WAAP,EAAkB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAlB,CAFxB,EAGG,KAAK,CAAC,aAAN,iBAAuB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,aAAP,EAAoB,EAAA,GAAK,SAAS,CAAC;EAAf,CAApB,CAH1B,EAIG,KAAK,CAAC,YAAN,iBAAsB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAnB,CAJzB,EAKG,KAAK,CAAC,cAAN,iBAAwB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,cAAP,EAAqB,EAAA,GAAK,SAAS,CAAC;EAAf,CAArB,CAL3B,EAMG,YAAY,KAAK,QAAjB,IAA6B,IANhC,CADF;AAUD,CAlBM","sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 } = getSlots<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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/usePersona.ts"],"names":[],"mappings":"AACA,SAAS,MAAT,QAAuB,wBAAvB;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AACA,SAAS,aAAT,QAA8B,uBAA9B;AAKA;;;;;;;;AAQG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;EACpG,MAAM;IAAE,YAAY,GAAG,KAAjB;IAAwB,YAAY,GAAG,OAAvC;IAAgD;EAAhD,IAAyD,KAA/D;EAEA,MAAM,WAAW,GAAG,gBAAgB,CAAC,KAAK,CAAC,WAAP,EAAoB;IACtD,QAAQ,EAAE,IAD4C;IAEtD,YAAY,EAAE;MACZ,QAAQ,EAAE;IADE;EAFwC,CAApB,CAApC;EAMA,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,aAAP,CAAtC;EACA,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC,YAAP,CAArC;EACA,MAAM,cAAc,GAAG,gBAAgB,CAAC,KAAK,CAAC,cAAP,CAAvC;EAEA,MAAM,YAAY,GAAG,CAAC,WAAD,EAAc,aAAd,EAA6B,YAA7B,EAA2C,cAA3C,EAA2D,MAA3D,CAAkE,OAAlE,EAA2E,MAAhG;E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iB,CAAjB,CADmC,GAMnD,SANJ;EAQA,OAAO;IACL,KADK;IAEL,YAFK;IAGL,YAHK;IAIL,YAJK;IAML,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,MAAM,EAAE,MAFE;MAGV,QAAQ,EAAE,aAHA;MAIV,WAAW,EAAE,MAJH;MAKV,aAAa,EAAE,MALL;MAMV,YAAY,EAAE,MANJ;MAOV,cAAc,EAAE;IAPN,CANP;IAgBL,IAAI,EAAE,qBAAqB,CACzB,KADyB,EAEzB,EACE,GAAG,KADL;MAEE;IAFF,CAFyB;IAMzB;IAAwB,CAAC,MAAD,CANC,CAhBtB;IAwBL,MAxBK;IAyBL,QAzBK;IA0BL,WA1BK;IA2BL,aA3BK;IA4BL,YA5BK;IA6BL;EA7BK,CAAP;AA+BD,CA9FM","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 { AvatarProps } from '@fluentui/react-avatar';\nimport type { PersonaProps, PersonaState } from './Persona.types';\nimport type { PresenceBadgeProps } from '@fluentui/react-badge';\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 { presenceOnly = false, textPosition = 'after', name } = 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 let fixed = false;\n if (!presenceOnly && props.avatar) {\n fixed = !!(props.avatar as AvatarProps).size;\n } else if (props.presence && props.presence) {\n fixed = !!(props.presence as PresenceBadgeProps).size;\n }\n\n let avatarSize: AvatarProps['size'] = undefined;\n let presenceSize: PresenceBadgeProps['size'] = undefined;\n if (presenceOnly && !fixed) {\n if (numTextLines === 1) {\n presenceSize = 'small';\n } else if (numTextLines === 2) {\n presenceSize = 'large';\n } else {\n presenceSize = 'extra-large';\n }\n } else if (!fixed) {\n if (numTextLines === 1) {\n avatarSize = 16;\n } else if (numTextLines === 2) {\n avatarSize = 32;\n } else if (numTextLines === 3) {\n avatarSize = 56;\n } else {\n avatarSize = 72;\n }\n }\n\n const avatar: PersonaState['avatar'] = !presenceOnly\n ? resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSize,\n },\n })\n : undefined;\n\n const presence: PersonaState['presence'] = presenceOnly\n ? resolveShorthand(props.presence, {\n defaultProps: {\n size: presenceSize,\n },\n })\n : undefined;\n\n return {\n fixed,\n numTextLines,\n presenceOnly,\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,\n presence,\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText,\n };\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/usePersona.ts"],"names":[],"mappings":"AACA,SAAS,MAAT,QAAuB,wBAAvB;AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AACA,SAAS,aAAT,QAA8B,uBAA9B;AAKA;;;;;;;;AAQG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;EACpG,MAAM;IAAE,YAAY,GAAG,KAAjB;IAAwB,YAAY,GAAG,OAAvC;IAAgD;EAAhD,IAAyD,KAA/D;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A,IAAI,YAAY,KAAK,CAArB,EAAwB;MAC7B,UAAU,GAAG,EAAb;IACD,CAFM,MAEA;MACL,UAAU,GAAG,EAAb;IACD;EACF;;EAED,MAAM,MAAM,GAA2B,CAAC,YAAD,GACnC,gBAAgB,CAAC,KAAK,CAAC,MAAP,EAAe;IAC7B,QAAQ,EAAE,IADmB;IAE7B,YAAY,EAAE;MACZ,IADY;MAEZ,KAAK,EAAE,KAAK,CAAC,QAFD;MAGZ,IAAI,EAAE;IAHM;EAFe,CAAf,CADmB,GASnC,SATJ;EAWA,MAAM,QAAQ,GAA6B,YAAY,GACnD,gBAAgB,CAAC,KAAK,CAAC,QAAP,EAAiB;IAC/B,YAAY,EAAE;MACZ,IAAI,EAAE;IADM;EADiB,CAAjB,CADmC,GAMnD,SANJ;EAQA,OAAO;IACL,KADK;IAEL,YAFK;IAGL,YAHK;IAIL,YAJK;IAML,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,MAAM,EAAE,MAFE;MAGV,QAAQ,EAAE,aAHA;MAIV,WAAW,EAAE,MAJH;MAKV,aAAa,EAAE,MALL;MAMV,YAAY,EAAE,MANJ;MAOV,cAAc,EAAE;IAPN,CANP;IAgBL,IAAI,EAAE,qBAAqB,CACzB,KADyB,EAEzB,EACE,GAAG,KADL;MAEE;IAFF,CAFyB;IAMzB;IAAwB,CAAC,MAAD,CANC,CAhBtB;IAwBL,MAxBK;IAyBL,QAzBK;IA0BL,WA1BK;IA2BL,aA3BK;IA4BL,YA5BK;IA6BL;EA7BK,CAAP;AA+BD,CA9FM","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 { AvatarProps } from '@fluentui/react-avatar';\nimport type { PersonaProps, PersonaState } from './Persona.types';\nimport type { PresenceBadgeProps } from '@fluentui/react-badge';\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 { presenceOnly = false, textPosition = 'after', name } = 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 let fixed = false;\n if (!presenceOnly && props.avatar) {\n fixed = !!(props.avatar as AvatarProps).size;\n } else if (props.presence && props.presence) {\n fixed = !!(props.presence as PresenceBadgeProps).size;\n }\n\n let avatarSize: AvatarProps['size'] = undefined;\n let presenceSize: PresenceBadgeProps['size'] = undefined;\n if (presenceOnly && !fixed) {\n if (numTextLines === 1) {\n presenceSize = 'small';\n } else if (numTextLines === 2) {\n presenceSize = 'large';\n } else {\n presenceSize = 'extra-large';\n }\n } else if (!fixed) {\n if (numTextLines === 1) {\n avatarSize = 16;\n } else if (numTextLines === 2) {\n avatarSize = 32;\n } else if (numTextLines === 3) {\n avatarSize = 56;\n } else {\n avatarSize = 72;\n }\n }\n\n const avatar: PersonaState['avatar'] = !presenceOnly\n ? resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSize,\n },\n })\n : undefined;\n\n const presence: PersonaState['presence'] = presenceOnly\n ? resolveShorthand(props.presence, {\n defaultProps: {\n size: presenceSize,\n },\n })\n : undefined;\n\n return {\n fixed,\n numTextLines,\n presenceOnly,\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,\n presence,\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/usePersonaStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AAIA,OAAO,MAAM,iBAAiB,GAAiC;EAC7D,IAAI,EAAE,aADuD;EAE7D,MAAM,EAAE,qBAFqD;EAG7D,QAAQ,EAAE,uBAHmD;EAI7D,WAAW,EAAE,0BAJgD;EAK7D,aAAa,EAAE,4BAL8C;EAM7D,YAAY,EAAE,2BAN+C;EAO7D,cAAc,EAAE;AAP6C,CAAxD;AAUP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AA+BA;;AAEG;;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM;IAAE,KAAF;IAAS;EAAT,IAA0B,KAAhC;EACA,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,oBAAF;IAAwB;EAAxB,IAAkD,iBAAiB,CAAC,KAAD,CAAzE;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CAAC,iBAAiB,CAAC,IAAnB,EAAyB,MAAM,CAAC,IAAhC,EAAsC,MAAM,CAAC,YAAD,CAA5C,EAA4D,KAAK,CAAC,IAAN,CAAW,SAAvE,CAAnC;;EAEA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,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AE;MAAF,IAAW,KAAK,CAAC,QAAvB;;MAEA,IAAI,IAAI,KAAK,aAAT,IAA0B,IAAI,KAAK,MAAvC,EAA+C;QAC7C,IAAI,YAAY,GAAG,CAAnB,EAAsB;UACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;QACD,CAFD,MAEO;UACL,eAAe,GAAG,UAAU,CAAC,QAA7B;QACD;;QACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;MACD,CAPD,MAOO;QACL,eAAe,GAAG,UAAU,CAAC,KAA7B;QACA,gBAAgB,GAAG,UAAU,CAAC,QAA9B;MACD;IACF;EACF,CApCD,MAoCO;IACL,IAAI,YAAY,GAAG,CAAnB,EAAsB;MACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;IACD,CAFD,MAEO;MACL,eAAe,GAAG,UAAU,CAAC,QAA7B;IACD;;IACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;EACD;;EAED,OAAO;IACL,oBAAoB,EAAE,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,UAAU,CAAC,WAA7B,EAA0C,eAA1C,CAD7B;IAEL,qBAAqB,EAAE,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,UAAU,CAAC,YAA7B,EAA2C,gBAA3C;EAF9B,CAAP;AAID,CA5DD","sourcesContent":["import { 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\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'inline-grid',\n gridAutoColumns: 'max-content',\n gridAutoRows: 'max-content',\n },\n after: {\n gridAutoFlow: 'column',\n justifyItems: 'start',\n columnGap: '8px',\n },\n before: {\n gridAutoFlow: 'column',\n justifyItems: 'end',\n columnGap: '8px',\n },\n below: {\n justifyItems: 'center',\n },\n coin: {\n gridRowStart: 'span 5',\n },\n\n fixed: {\n alignSelf: 'start',\n },\n scaled: {\n alignSelf: 'center',\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 { fixed, textPosition } = state;\n const styles = useStyles();\n const { primaryTextClassName, optionalTextClassName } = useTextClassNames(state);\n\n state.root.className = mergeClasses(personaClassNames.root, styles.root, styles[textPosition], state.root.className);\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(\n personaClassNames.avatar,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.avatar.className,\n );\n }\n\n if (state.presence) {\n state.presence.className = mergeClasses(\n personaClassNames.presence,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.presence.className,\n );\n }\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n personaClassNames.primaryText,\n primaryTextClassName,\n state.primaryText.className,\n );\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n personaClassNames.secondaryText,\n optionalTextClassName,\n state.secondaryText.className,\n );\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n personaClassNames.tertiaryText,\n optionalTextClassName,\n state.tertiaryText.className,\n );\n }\n\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(\n personaClassNames.quaternaryText,\n optionalTextClassName,\n state.quaternaryText.className,\n );\n }\n\n return state;\n};\n\nconst useTextStyles = makeStyles({\n base: {\n display: 'block',\n },\n primaryText: {\n color: tokens.colorNeutralForeground1,\n },\n optionalText: {\n color: tokens.colorNeutralForeground2,\n },\n\n body1: typographyStyles.body1,\n caption1: typographyStyles.caption1,\n subtitle2: typographyStyles.subtitle2,\n subtitle1: typographyStyles.subtitle1,\n title2: typographyStyles.title2,\n title3: typographyStyles.title3,\n});\n\nconst useTextClassNames = (\n state: PersonaState,\n): {\n primaryTextClassName: string;\n optionalTextClassName: string;\n} => {\n const { fixed, numTextLines, presenceOnly } = state;\n const textStyles = useTextStyles();\n let primaryTextSize;\n let optionalTextSize;\n\n if (fixed) {\n if (state.avatar && state.avatar.size) {\n const { size } = state.avatar;\n\n if (size < 40) {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n } else if (size < 64) {\n primaryTextSize = textStyles.subtitle2;\n optionalTextSize = textStyles.body1;\n } else if (size < 96) {\n primaryTextSize = textStyles.subtitle1;\n optionalTextSize = textStyles.caption1;\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.title3;\n } else {\n primaryTextSize = textStyles.title2;\n }\n optionalTextSize = textStyles.body1;\n }\n } else if (presenceOnly && state.presence) {\n const { size } = state.presence;\n\n if (size === 'extra-small' || size === 'tiny') {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n } else {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n }\n }\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n }\n\n return {\n primaryTextClassName: mergeClasses(textStyles.base, textStyles.primaryText, primaryTextSize),\n optionalTextClassName: mergeClasses(textStyles.base, textStyles.optionalText, optionalTextSize),\n };\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/usePersonaStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,EAAiB,gBAAjB,QAAyC,uBAAzC;AAIA,OAAO,MAAM,iBAAiB,GAAiC;EAC7D,IAAI,EAAE,aADuD;EAE7D,MAAM,EAAE,qBAFqD;EA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IACF;EACF,CApCD,MAoCO;IACL,IAAI,YAAY,GAAG,CAAnB,EAAsB;MACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;IACD,CAFD,MAEO;MACL,eAAe,GAAG,UAAU,CAAC,QAA7B;IACD;;IACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;EACD;;EAED,OAAO;IACL,oBAAoB,EAAE,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,UAAU,CAAC,WAA7B,EAA0C,eAA1C,CAD7B;IAEL,qBAAqB,EAAE,YAAY,CAAC,UAAU,CAAC,IAAZ,EAAkB,UAAU,CAAC,YAA7B,EAA2C,gBAA3C;EAF9B,CAAP;AAID,CA5DD","sourcesContent":["import { 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\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'inline-grid',\n gridAutoColumns: 'max-content',\n gridAutoRows: 'max-content',\n },\n after: {\n gridAutoFlow: 'column',\n justifyItems: 'start',\n columnGap: '8px',\n },\n before: {\n gridAutoFlow: 'column',\n justifyItems: 'end',\n columnGap: '8px',\n },\n below: {\n justifyItems: 'center',\n },\n coin: {\n gridRowStart: 'span 5',\n },\n\n fixed: {\n alignSelf: 'start',\n },\n scaled: {\n alignSelf: 'center',\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 { fixed, textPosition } = state;\n const styles = useStyles();\n const { primaryTextClassName, optionalTextClassName } = useTextClassNames(state);\n\n state.root.className = mergeClasses(personaClassNames.root, styles.root, styles[textPosition], state.root.className);\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(\n personaClassNames.avatar,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.avatar.className,\n );\n }\n\n if (state.presence) {\n state.presence.className = mergeClasses(\n personaClassNames.presence,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.presence.className,\n );\n }\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n personaClassNames.primaryText,\n primaryTextClassName,\n state.primaryText.className,\n );\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n personaClassNames.secondaryText,\n optionalTextClassName,\n state.secondaryText.className,\n );\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n personaClassNames.tertiaryText,\n optionalTextClassName,\n state.tertiaryText.className,\n );\n }\n\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(\n personaClassNames.quaternaryText,\n optionalTextClassName,\n state.quaternaryText.className,\n );\n }\n\n return state;\n};\n\nconst useTextStyles = makeStyles({\n base: {\n display: 'block',\n },\n primaryText: {\n color: tokens.colorNeutralForeground1,\n },\n optionalText: {\n color: tokens.colorNeutralForeground2,\n },\n\n body1: typographyStyles.body1,\n caption1: typographyStyles.caption1,\n subtitle2: typographyStyles.subtitle2,\n subtitle1: typographyStyles.subtitle1,\n title2: typographyStyles.title2,\n title3: typographyStyles.title3,\n});\n\nconst useTextClassNames = (\n state: PersonaState,\n): {\n primaryTextClassName: string;\n optionalTextClassName: string;\n} => {\n const { fixed, numTextLines, presenceOnly } = state;\n const textStyles = useTextStyles();\n let primaryTextSize;\n let optionalTextSize;\n\n if (fixed) {\n if (state.avatar && state.avatar.size) {\n const { size } = state.avatar;\n\n if (size < 40) {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n } else if (size < 64) {\n primaryTextSize = textStyles.subtitle2;\n optionalTextSize = textStyles.body1;\n } else if (size < 96) {\n primaryTextSize = textStyles.subtitle1;\n optionalTextSize = textStyles.caption1;\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.title3;\n } else {\n primaryTextSize = textStyles.title2;\n }\n optionalTextSize = textStyles.body1;\n }\n } else if (presenceOnly && state.presence) {\n const { size } = state.presence;\n\n if (size === 'extra-small' || size === 'tiny') {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n } else {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n }\n }\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n }\n\n return {\n primaryTextClassName: mergeClasses(textStyles.base, textStyles.primaryText, primaryTextSize),\n optionalTextClassName: mergeClasses(textStyles.base, textStyles.optionalText, optionalTextSize),\n };\n};\n"],"sourceRoot":"../src/"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SACE,OADF,EAEE,iBAFF,EAGE,sBAHF,EAIE,yBAJF,EAKE,mBALF,QAMO,WANP","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"],"sourceRoot":""}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,OADF,EAEE,iBAFF,EAGE,sBAHF,EAIE,yBAJF,EAKE,mBALF,QAMO,WANP","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"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Persona.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,4BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Persona/index';\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["Persona.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,4BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Persona/index';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/Persona.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,OAAA,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxF,MAAM,KAAK,GAAG,YAAA,CAAA,mBAAA,CAAoB,KAApB,EAA2B,GAA3B,CAAd;EAEA,kBAAA,CAAA,yBAAA,CAA0B,KAA1B;EACA,OAAO,eAAA,CAAA,sBAAA,CAAuB,KAAvB,CAAP;AACD,CALyD,CAA7C;AAOb,OAAA,CAAA,OAAA,CAAQ,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { renderPersona_unstable } from './renderPersona';\nimport { usePersona_unstable } from './usePersona';\nimport { usePersonaStyles_unstable } from './usePersonaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { PersonaProps } from './Persona.types';\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 return renderPersona_unstable(state);\n});\n\nPersona.displayName = 'Persona';\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/Persona.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;AAIA;;;AAGG;;;AACU,OAAA,CAAA,OAAA,gBAA6C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACxF,MAAM,KAAK,GAAG,YAAA,CAAA,mBAAA,CAAoB,KAApB,EAA2B,GAA3B,CAAd;EAEA,kBAAA,CAAA,yBAAA,CAA0B,KAA1B;EACA,OAAO,eAAA,CAAA,sBAAA,CAAuB,KAAvB,CAAP;AACD,CALyD,CAA7C;AAOb,OAAA,CAAA,OAAA,CAAQ,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { renderPersona_unstable } from './renderPersona';\nimport { usePersona_unstable } from './usePersona';\nimport { usePersonaStyles_unstable } from './usePersonaStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { PersonaProps } from './Persona.types';\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 return renderPersona_unstable(state);\n});\n\nPersona.displayName = 'Persona';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Persona';\nexport * from './Persona.types';\nexport * from './renderPersona';\nexport * from './usePersona';\nexport * from './usePersonaStyles';\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,WAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Persona';\nexport * from './Persona.types';\nexport * from './renderPersona';\nexport * from './usePersona';\nexport * from './usePersonaStyles';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/renderPersona.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,sBAAsB,GAAI,KAAD,IAAwB;EAC5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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 } = getSlots<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"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/renderPersona.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,sBAAsB,GAAI,KAAD,IAAwB;EAC5D,MAAM;IAAE,YAAF;IAAgB;EAAhB,IAAiC,KAAvC;EACA,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAuB,KAAvB,CAA7B;EAEA,MAAM,IAAI,GAAG,YAAY,GACrB,KAAK,CAAC,QAAN,IAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;EAAf,CAAf,CADG,GAErB,KAAK,CAAC,MAAN,IAAgB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;EAAf,CAAb,CAFpB;EAIA,OACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,CAAC,YAAY,KAAK,OAAjB,IAA4B,YAAY,KAAK,OAA9C,KAA0D,IAD7D,EAEG,KAAK,CAAC,WAAN,IAAqB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,WAAP,EAAkB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAlB,CAFxB,EAGG,KAAK,CAAC,aAAN,IAAuB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,aAAP,EAAoB,EAAA,GAAK,SAAS,CAAC;EAAf,CAApB,CAH1B,EAIG,KAAK,CAAC,YAAN,IAAsB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAnB,CAJzB,EAKG,KAAK,CAAC,cAAN,IAAwB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,cAAP,EAAqB,EAAA,GAAK,SAAS,CAAC;EAAf,CAArB,CAL3B,EAMG,YAAY,KAAK,QAAjB,IAA6B,IANhC,CADF;AAUD,CAlBM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getSlots } 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 } = getSlots<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"],"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E,MANJ;MAOV,cAAc,EAAE;IAPN,CANP;IAgBL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CACJ,KADI,EAEJ,EACE,GAAG,KADL;MAEE;IAFF,CAFI;IAMJ;IAAwB,CAAC,MAAD,CANpB,CAhBD;IAwBL,MAxBK;IAyBL,QAzBK;IA0BL,WA1BK;IA2BL,aA3BK;IA4BL,YA5BK;IA6BL;EA7BK,CAAP;AA+BD,CA9FM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","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 { AvatarProps } from '@fluentui/react-avatar';\nimport type { PersonaProps, PersonaState } from './Persona.types';\nimport type { PresenceBadgeProps } from '@fluentui/react-badge';\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 { presenceOnly = false, textPosition = 'after', name } = 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 let fixed = false;\n if (!presenceOnly && props.avatar) {\n fixed = !!(props.avatar as AvatarProps).size;\n } else if (props.presence && props.presence) {\n fixed = !!(props.presence as PresenceBadgeProps).size;\n }\n\n let avatarSize: AvatarProps['size'] = undefined;\n let presenceSize: PresenceBadgeProps['size'] = undefined;\n if (presenceOnly && !fixed) {\n if (numTextLines === 1) {\n presenceSize = 'small';\n } else if (numTextLines === 2) {\n presenceSize = 'large';\n } else {\n presenceSize = 'extra-large';\n }\n } else if (!fixed) {\n if (numTextLines === 1) {\n avatarSize = 16;\n } else if (numTextLines === 2) {\n avatarSize = 32;\n } else if (numTextLines === 3) {\n avatarSize = 56;\n } else {\n avatarSize = 72;\n }\n }\n\n const avatar: PersonaState['avatar'] = !presenceOnly\n ? resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSize,\n },\n })\n : undefined;\n\n const presence: PersonaState['presence'] = presenceOnly\n ? resolveShorthand(props.presence, {\n defaultProps: {\n size: presenceSize,\n },\n })\n : undefined;\n\n return {\n fixed,\n numTextLines,\n presenceOnly,\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,\n presence,\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText,\n };\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/usePersona.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAKA;;;;;;;;AAQG;;;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;EACpG,MAAM;IAAE,YAAY,GAAG,KAAjB;IAAwB,YAAY,GAAG,OAAvC;IAAgD;EAAhD,IAAyD,KAA/D;EAEA,MAAM,WAAW,GAAG,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,WAAvB,EAAoC;IACtD,QAAQ,EAAE,IAD4C;IAEtD,YAAY,EAAE;MACZ,QAAQ,EAAE;IADE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AG,EAAb;IACD;EACF;;EAED,MAAM,MAAM,GAA2B,CAAC,YAAD,GACnC,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,MAAvB,EAA+B;IAC7B,QAAQ,EAAE,IADmB;IAE7B,YAAY,EAAE;MACZ,IADY;MAEZ,KAAK,EAAE,KAAK,CAAC,QAFD;MAGZ,IAAI,EAAE;IAHM;EAFe,CAA/B,CADmC,GASnC,SATJ;EAWA,MAAM,QAAQ,GAA6B,YAAY,GACnD,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,QAAvB,EAAiC;IAC/B,YAAY,EAAE;MACZ,IAAI,EAAE;IADM;EADiB,CAAjC,CADmD,GAMnD,SANJ;EAQA,OAAO;IACL,KADK;IAEL,YAFK;IAGL,YAHK;IAIL,YAJK;IAML,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,MAAM,EAAE,cAAA,CAAA,MAFE;MAGV,QAAQ,EAAE,aAAA,CAAA,aAHA;MAIV,WAAW,EAAE,MAJH;MAKV,aAAa,EAAE,MALL;MAMV,YAAY,EAAE,MANJ;MAOV,cAAc,EAAE;IAPN,CANP;IAgBL,IAAI,EAAE,iBAAA,CAAA,qBAAA,CACJ,KADI,EAEJ,EACE,GAAG,KADL;MAEE;IAFF,CAFI;IAMJ;IAAwB,CAAC,MAAD,CANpB,CAhBD;IAwBL,MAxBK;IAyBL,QAzBK;IA0BL,WA1BK;IA2BL,aA3BK;IA4BL,YA5BK;IA6BL;EA7BK,CAAP;AA+BD,CA9FM;;AAAM,OAAA,CAAA,mBAAA,GAAmB,mBAAnB","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 { AvatarProps } from '@fluentui/react-avatar';\nimport type { PersonaProps, PersonaState } from './Persona.types';\nimport type { PresenceBadgeProps } from '@fluentui/react-badge';\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 { presenceOnly = false, textPosition = 'after', name } = 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 let fixed = false;\n if (!presenceOnly && props.avatar) {\n fixed = !!(props.avatar as AvatarProps).size;\n } else if (props.presence && props.presence) {\n fixed = !!(props.presence as PresenceBadgeProps).size;\n }\n\n let avatarSize: AvatarProps['size'] = undefined;\n let presenceSize: PresenceBadgeProps['size'] = undefined;\n if (presenceOnly && !fixed) {\n if (numTextLines === 1) {\n presenceSize = 'small';\n } else if (numTextLines === 2) {\n presenceSize = 'large';\n } else {\n presenceSize = 'extra-large';\n }\n } else if (!fixed) {\n if (numTextLines === 1) {\n avatarSize = 16;\n } else if (numTextLines === 2) {\n avatarSize = 32;\n } else if (numTextLines === 3) {\n avatarSize = 56;\n } else {\n avatarSize = 72;\n }\n }\n\n const avatar: PersonaState['avatar'] = !presenceOnly\n ? resolveShorthand(props.avatar, {\n required: true,\n defaultProps: {\n name,\n badge: props.presence,\n size: avatarSize,\n },\n })\n : undefined;\n\n const presence: PersonaState['presence'] = presenceOnly\n ? resolveShorthand(props.presence, {\n defaultProps: {\n size: presenceSize,\n },\n })\n : undefined;\n\n return {\n fixed,\n numTextLines,\n presenceOnly,\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,\n presence,\n primaryText,\n secondaryText,\n tertiaryText,\n quaternaryText,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Persona/usePersonaStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,iBAAA,GAAkD;EAC7D,IAAI,EAAE,aADuD;EAE7D,MAAM,EAAE,qBAFqD;EAG7D,QAAQ,EAAE,uBAHmD;EAI7D,WAAW,EAAE,0BAJgD;EAK7D,aAAa,EAAE,4BAL8C;EAM7D,YAAY,EAAE,2BAN+C;EAO7D,cAAc,EAAE;AAP6C,CAAlD;AAUb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AA+BA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM;IAAE,KAAF;IAAS;EAAT,IAA0B,KAAhC;EACA,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,oBAAF;IAAwB;EAAxB,IAAkD,iBAAiB,CAAC,KAAD,CAAzE;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,iBAAA,CAAkB,IAA/B,EAAqC,MAAM,CAAC,IAA5C,EAAkD,MAAM,CAAC,YAAD,CAAxD,EAAwE,KAAK,CAAC,IAAN,CAAW,SAAnF,CAAvB;;EAEA,IAAI,KA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HM,MAGA;QACL,IAAI,YAAY,GAAG,CAAnB,EAAsB;UACpB,eAAe,GAAG,UAAU,CAAC,MAA7B;QACD,CAFD,MAEO;UACL,eAAe,GAAG,UAAU,CAAC,MAA7B;QACD;;QACD,gBAAgB,GAAG,UAAU,CAAC,KAA9B;MACD;IACF,CApBD,MAoBO,IAAI,YAAY,IAAI,KAAK,CAAC,QAA1B,EAAoC;MACzC,MAAM;QAAE;MAAF,IAAW,KAAK,CAAC,QAAvB;;MAEA,IAAI,IAAI,KAAK,aAAT,IAA0B,IAAI,KAAK,MAAvC,EAA+C;QAC7C,IAAI,YAAY,GAAG,CAAnB,EAAsB;UACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;QACD,CAFD,MAEO;UACL,eAAe,GAAG,UAAU,CAAC,QAA7B;QACD;;QACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;MACD,CAPD,MAOO;QACL,eAAe,GAAG,UAAU,CAAC,KAA7B;QACA,gBAAgB,GAAG,UAAU,CAAC,QAA9B;MACD;IACF;EACF,CApCD,MAoCO;IACL,IAAI,YAAY,GAAG,CAAnB,EAAsB;MACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;IACD,CAFD,MAEO;MACL,eAAe,GAAG,UAAU,CAAC,QAA7B;IACD;;IACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;EACD;;EAED,OAAO;IACL,oBAAoB,EAAE,OAAA,CAAA,YAAA,CAAa,UAAU,CAAC,IAAxB,EAA8B,UAAU,CAAC,WAAzC,EAAsD,eAAtD,CADjB;IAEL,qBAAqB,EAAE,OAAA,CAAA,YAAA,CAAa,UAAU,CAAC,IAAxB,EAA8B,UAAU,CAAC,YAAzC,EAAuD,gBAAvD;EAFlB,CAAP;AAID,CA5DD","sourcesContent":["import { 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\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'inline-grid',\n gridAutoColumns: 'max-content',\n gridAutoRows: 'max-content',\n },\n after: {\n gridAutoFlow: 'column',\n justifyItems: 'start',\n columnGap: '8px',\n },\n before: {\n gridAutoFlow: 'column',\n justifyItems: 'end',\n columnGap: '8px',\n },\n below: {\n justifyItems: 'center',\n },\n coin: {\n gridRowStart: 'span 5',\n },\n\n fixed: {\n alignSelf: 'start',\n },\n scaled: {\n alignSelf: 'center',\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 { fixed, textPosition } = state;\n const styles = useStyles();\n const { primaryTextClassName, optionalTextClassName } = useTextClassNames(state);\n\n state.root.className = mergeClasses(personaClassNames.root, styles.root, styles[textPosition], state.root.className);\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(\n personaClassNames.avatar,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.avatar.className,\n );\n }\n\n if (state.presence) {\n state.presence.className = mergeClasses(\n personaClassNames.presence,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.presence.className,\n );\n }\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n personaClassNames.primaryText,\n primaryTextClassName,\n state.primaryText.className,\n );\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n personaClassNames.secondaryText,\n optionalTextClassName,\n state.secondaryText.className,\n );\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n personaClassNames.tertiaryText,\n optionalTextClassName,\n state.tertiaryText.className,\n );\n }\n\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(\n personaClassNames.quaternaryText,\n optionalTextClassName,\n state.quaternaryText.className,\n );\n }\n\n return state;\n};\n\nconst useTextStyles = makeStyles({\n base: {\n display: 'block',\n },\n primaryText: {\n color: tokens.colorNeutralForeground1,\n },\n optionalText: {\n color: tokens.colorNeutralForeground2,\n },\n\n body1: typographyStyles.body1,\n caption1: typographyStyles.caption1,\n subtitle2: typographyStyles.subtitle2,\n subtitle1: typographyStyles.subtitle1,\n title2: typographyStyles.title2,\n title3: typographyStyles.title3,\n});\n\nconst useTextClassNames = (\n state: PersonaState,\n): {\n primaryTextClassName: string;\n optionalTextClassName: string;\n} => {\n const { fixed, numTextLines, presenceOnly } = state;\n const textStyles = useTextStyles();\n let primaryTextSize;\n let optionalTextSize;\n\n if (fixed) {\n if (state.avatar && state.avatar.size) {\n const { size } = state.avatar;\n\n if (size < 40) {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n } else if (size < 64) {\n primaryTextSize = textStyles.subtitle2;\n optionalTextSize = textStyles.body1;\n } else if (size < 96) {\n primaryTextSize = textStyles.subtitle1;\n optionalTextSize = textStyles.caption1;\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.title3;\n } else {\n primaryTextSize = textStyles.title2;\n }\n optionalTextSize = textStyles.body1;\n }\n } else if (presenceOnly && state.presence) {\n const { size } = state.presence;\n\n if (size === 'extra-small' || size === 'tiny') {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n } else {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n }\n }\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n }\n\n return {\n primaryTextClassName: mergeClasses(textStyles.base, textStyles.primaryText, primaryTextSize),\n optionalTextClassName: mergeClasses(textStyles.base, textStyles.optionalText, optionalTextSize),\n };\n};\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["components/Persona/usePersonaStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAIa,OAAA,CAAA,iBAAA,GAAkD;EAC7D,IAAI,EAAE,aADuD;EAE7D,MAAM,EAAE,qBAFqD;EAG7D,QAAQ,EAAE,uBAHmD;EAI7D,WAAW,EAAE,0BAJgD;EAK7D,aAAa,EAAE,4BAL8C;EAM7D,YAAY,EAAE,2BAN+C;EAO7D,cAAc,EAAE;AAP6C,CAAlD;AAUb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AA+BA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM;IAAE,KAAF;IAAS;EAAT,IAA0B,KAAhC;EACA,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,oBAAF;IAAwB;EAAxB,IAAkD,iBAAiB,CAAC,KAAD,CAAzE;EAEA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,iBAAA,CAAkB,IAA/B,EAAqC,MAAM,CAAC,IAA5C,EAAkD,MAAM,CAAC,YAAD,CAAxD,EAAwE,KAAK,CAAC,IAAN,CAAW,SAAnF,CAAvB;;EAEA,IAAI,KAAK,CAAC,MAAV,EAAkB;IAChB,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,OAAA,CAAA,YAAA,CACvB,OAAA,CAAA,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ACL,eAAe,GAAG,UAAU,CAAC,MAA7B;QACD;;QACD,gBAAgB,GAAG,UAAU,CAAC,KAA9B;MACD;IACF,CApBD,MAoBO,IAAI,YAAY,IAAI,KAAK,CAAC,QAA1B,EAAoC;MACzC,MAAM;QAAE;MAAF,IAAW,KAAK,CAAC,QAAvB;;MAEA,IAAI,IAAI,KAAK,aAAT,IAA0B,IAAI,KAAK,MAAvC,EAA+C;QAC7C,IAAI,YAAY,GAAG,CAAnB,EAAsB;UACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;QACD,CAFD,MAEO;UACL,eAAe,GAAG,UAAU,CAAC,QAA7B;QACD;;QACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;MACD,CAPD,MAOO;QACL,eAAe,GAAG,UAAU,CAAC,KAA7B;QACA,gBAAgB,GAAG,UAAU,CAAC,QAA9B;MACD;IACF;EACF,CApCD,MAoCO;IACL,IAAI,YAAY,GAAG,CAAnB,EAAsB;MACpB,eAAe,GAAG,UAAU,CAAC,KAA7B;IACD,CAFD,MAEO;MACL,eAAe,GAAG,UAAU,CAAC,QAA7B;IACD;;IACD,gBAAgB,GAAG,UAAU,CAAC,QAA9B;EACD;;EAED,OAAO;IACL,oBAAoB,EAAE,OAAA,CAAA,YAAA,CAAa,UAAU,CAAC,IAAxB,EAA8B,UAAU,CAAC,WAAzC,EAAsD,eAAtD,CADjB;IAEL,qBAAqB,EAAE,OAAA,CAAA,YAAA,CAAa,UAAU,CAAC,IAAxB,EAA8B,UAAU,CAAC,YAAzC,EAAuD,gBAAvD;EAFlB,CAAP;AAID,CA5DD","sourcesContent":["import { 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\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'inline-grid',\n gridAutoColumns: 'max-content',\n gridAutoRows: 'max-content',\n },\n after: {\n gridAutoFlow: 'column',\n justifyItems: 'start',\n columnGap: '8px',\n },\n before: {\n gridAutoFlow: 'column',\n justifyItems: 'end',\n columnGap: '8px',\n },\n below: {\n justifyItems: 'center',\n },\n coin: {\n gridRowStart: 'span 5',\n },\n\n fixed: {\n alignSelf: 'start',\n },\n scaled: {\n alignSelf: 'center',\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 { fixed, textPosition } = state;\n const styles = useStyles();\n const { primaryTextClassName, optionalTextClassName } = useTextClassNames(state);\n\n state.root.className = mergeClasses(personaClassNames.root, styles.root, styles[textPosition], state.root.className);\n\n if (state.avatar) {\n state.avatar.className = mergeClasses(\n personaClassNames.avatar,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.avatar.className,\n );\n }\n\n if (state.presence) {\n state.presence.className = mergeClasses(\n personaClassNames.presence,\n styles.coin,\n fixed ? styles.fixed : styles.scaled,\n state.presence.className,\n );\n }\n\n if (state.primaryText) {\n state.primaryText.className = mergeClasses(\n personaClassNames.primaryText,\n primaryTextClassName,\n state.primaryText.className,\n );\n }\n\n if (state.secondaryText) {\n state.secondaryText.className = mergeClasses(\n personaClassNames.secondaryText,\n optionalTextClassName,\n state.secondaryText.className,\n );\n }\n\n if (state.tertiaryText) {\n state.tertiaryText.className = mergeClasses(\n personaClassNames.tertiaryText,\n optionalTextClassName,\n state.tertiaryText.className,\n );\n }\n\n if (state.quaternaryText) {\n state.quaternaryText.className = mergeClasses(\n personaClassNames.quaternaryText,\n optionalTextClassName,\n state.quaternaryText.className,\n );\n }\n\n return state;\n};\n\nconst useTextStyles = makeStyles({\n base: {\n display: 'block',\n },\n primaryText: {\n color: tokens.colorNeutralForeground1,\n },\n optionalText: {\n color: tokens.colorNeutralForeground2,\n },\n\n body1: typographyStyles.body1,\n caption1: typographyStyles.caption1,\n subtitle2: typographyStyles.subtitle2,\n subtitle1: typographyStyles.subtitle1,\n title2: typographyStyles.title2,\n title3: typographyStyles.title3,\n});\n\nconst useTextClassNames = (\n state: PersonaState,\n): {\n primaryTextClassName: string;\n optionalTextClassName: string;\n} => {\n const { fixed, numTextLines, presenceOnly } = state;\n const textStyles = useTextStyles();\n let primaryTextSize;\n let optionalTextSize;\n\n if (fixed) {\n if (state.avatar && state.avatar.size) {\n const { size } = state.avatar;\n\n if (size < 40) {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n } else if (size < 64) {\n primaryTextSize = textStyles.subtitle2;\n optionalTextSize = textStyles.body1;\n } else if (size < 96) {\n primaryTextSize = textStyles.subtitle1;\n optionalTextSize = textStyles.caption1;\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.title3;\n } else {\n primaryTextSize = textStyles.title2;\n }\n optionalTextSize = textStyles.body1;\n }\n } else if (presenceOnly && state.presence) {\n const { size } = state.presence;\n\n if (size === 'extra-small' || size === 'tiny') {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n } else {\n primaryTextSize = textStyles.body1;\n optionalTextSize = textStyles.caption1;\n }\n }\n } else {\n if (numTextLines > 1) {\n primaryTextSize = textStyles.body1;\n } else {\n primaryTextSize = textStyles.caption1;\n }\n optionalTextSize = textStyles.caption1;\n }\n\n return {\n primaryTextClassName: mergeClasses(textStyles.base, textStyles.primaryText, primaryTextSize),\n optionalTextClassName: mergeClasses(textStyles.base, textStyles.optionalText, optionalTextSize),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,SAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,OAAA;EAAO;AAAP,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,iBAAA;EAAiB;AAAjB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,sBAAA;EAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,yBAAA;EAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA","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"],"sourceRoot":""}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,SAAA,gBAAA,OAAA,CAAA,WAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,SAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,OAAA;EAAO;AAAP,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,iBAAA;EAAiB;AAAjB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,sBAAA;EAAsB;AAAtB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,yBAAA;EAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;EAAA,UAAA,EAAA,IAAA;EAAA,GAAA,EAAA,YAAA;IAAA,OAAA,SAAA,CAAA,mBAAA;EAAmB;AAAnB,CAAA","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"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-persona",
3
- "version": "0.0.0-nightly-20221013-0426.1",
3
+ "version": "9.0.1",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,14 +28,14 @@
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
30
  "@fluentui/react-conformance": "*",
31
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20221013-0426.1",
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.15",
32
32
  "@fluentui/scripts": "^1.0.0"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-avatar": "0.0.0-nightly-20221013-0426.1",
36
- "@fluentui/react-badge": "0.0.0-nightly-20221013-0426.1",
37
- "@fluentui/react-theme": "0.0.0-nightly-20221013-0426.1",
38
- "@fluentui/react-utilities": "0.0.0-nightly-20221013-0426.1",
35
+ "@fluentui/react-avatar": "^9.2.1",
36
+ "@fluentui/react-badge": "^9.0.8",
37
+ "@fluentui/react-theme": "^9.1.0",
38
+ "@fluentui/react-utilities": "^9.1.1",
39
39
  "@griffel/react": "^1.4.0",
40
40
  "tslib": "^2.1.0"
41
41
  },
@@ -45,5 +45,10 @@
45
45
  "react": ">=16.8.0 <18.0.0",
46
46
  "react-dom": ">=16.8.0 <18.0.0"
47
47
  },
48
- "beachball": {}
48
+ "beachball": {
49
+ "disallowedChangeTypes": [
50
+ "major",
51
+ "prerelease"
52
+ ]
53
+ }
49
54
  }