@fluentui-react-native/experimental-avatar 0.13.0 → 0.13.4

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.
Files changed (117) hide show
  1. package/CHANGELOG.json +106 -1
  2. package/CHANGELOG.md +39 -2
  3. package/lib/Avatar.d.ts +69 -2
  4. package/lib/Avatar.d.ts.map +1 -1
  5. package/lib/Avatar.js +32 -38
  6. package/lib/Avatar.js.map +1 -1
  7. package/lib/JSAvatar.d.ts +12 -0
  8. package/lib/JSAvatar.d.ts.map +1 -0
  9. package/lib/{Avatar.helpers.d.ts → JSAvatar.helpers.d.ts} +3 -3
  10. package/lib/JSAvatar.helpers.d.ts.map +1 -0
  11. package/lib/{Avatar.helpers.js → JSAvatar.helpers.js} +1 -1
  12. package/lib/JSAvatar.helpers.js.map +1 -0
  13. package/lib/JSAvatar.js +62 -0
  14. package/lib/JSAvatar.js.map +1 -0
  15. package/lib/JSAvatar.styling.d.ts +5 -0
  16. package/lib/JSAvatar.styling.d.ts.map +1 -0
  17. package/lib/{Avatar.styling.js → JSAvatar.styling.js} +35 -43
  18. package/lib/JSAvatar.styling.js.map +1 -0
  19. package/{lib-commonjs/Avatar.types.d.ts → lib/JSAvatar.types.d.ts} +20 -12
  20. package/lib/JSAvatar.types.d.ts.map +1 -0
  21. package/lib/JSAvatar.types.js +2 -0
  22. package/lib/JSAvatar.types.js.map +1 -0
  23. package/lib/JSAvatarTokens.d.ts +5 -0
  24. package/lib/JSAvatarTokens.d.ts.map +1 -0
  25. package/lib/JSAvatarTokens.js +18 -0
  26. package/lib/JSAvatarTokens.js.map +1 -0
  27. package/lib/index.d.ts +2 -1
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js +2 -1
  30. package/lib/index.js.map +1 -1
  31. package/lib/useAvatar.d.ts +2 -2
  32. package/lib/useAvatar.d.ts.map +1 -1
  33. package/lib/useAvatar.js +3 -3
  34. package/lib/useAvatar.js.map +1 -1
  35. package/lib-commonjs/Avatar.d.ts +69 -2
  36. package/lib-commonjs/Avatar.d.ts.map +1 -1
  37. package/lib-commonjs/Avatar.js +31 -37
  38. package/lib-commonjs/Avatar.js.map +1 -1
  39. package/lib-commonjs/JSAvatar.d.ts +12 -0
  40. package/lib-commonjs/JSAvatar.d.ts.map +1 -0
  41. package/lib-commonjs/{Avatar.helpers.d.ts → JSAvatar.helpers.d.ts} +3 -3
  42. package/lib-commonjs/JSAvatar.helpers.d.ts.map +1 -0
  43. package/lib-commonjs/{Avatar.helpers.js → JSAvatar.helpers.js} +1 -1
  44. package/lib-commonjs/JSAvatar.helpers.js.map +1 -0
  45. package/lib-commonjs/JSAvatar.js +64 -0
  46. package/lib-commonjs/JSAvatar.js.map +1 -0
  47. package/lib-commonjs/JSAvatar.styling.d.ts +5 -0
  48. package/lib-commonjs/JSAvatar.styling.d.ts.map +1 -0
  49. package/lib-commonjs/JSAvatar.styling.js +125 -0
  50. package/lib-commonjs/JSAvatar.styling.js.map +1 -0
  51. package/{lib/Avatar.types.d.ts → lib-commonjs/JSAvatar.types.d.ts} +20 -12
  52. package/lib-commonjs/JSAvatar.types.d.ts.map +1 -0
  53. package/lib-commonjs/{Avatar.types.js → JSAvatar.types.js} +2 -2
  54. package/lib-commonjs/JSAvatar.types.js.map +1 -0
  55. package/lib-commonjs/JSAvatarTokens.d.ts +5 -0
  56. package/lib-commonjs/JSAvatarTokens.d.ts.map +1 -0
  57. package/lib-commonjs/JSAvatarTokens.js +20 -0
  58. package/lib-commonjs/JSAvatarTokens.js.map +1 -0
  59. package/lib-commonjs/index.d.ts +2 -1
  60. package/lib-commonjs/index.d.ts.map +1 -1
  61. package/lib-commonjs/index.js +2 -1
  62. package/lib-commonjs/index.js.map +1 -1
  63. package/lib-commonjs/useAvatar.d.ts +2 -2
  64. package/lib-commonjs/useAvatar.d.ts.map +1 -1
  65. package/lib-commonjs/useAvatar.js +4 -4
  66. package/lib-commonjs/useAvatar.js.map +1 -1
  67. package/package.json +5 -5
  68. package/src/Avatar.tsx +127 -37
  69. package/src/{Avatar.helpers.ts → JSAvatar.helpers.ts} +2 -2
  70. package/src/{Avatar.styling.ts → JSAvatar.styling.ts} +24 -20
  71. package/src/JSAvatar.tsx +56 -0
  72. package/src/{Avatar.types.ts → JSAvatar.types.ts} +20 -11
  73. package/src/{AvatarTokens.ts → JSAvatarTokens.ts} +11 -4
  74. package/src/index.ts +2 -1
  75. package/src/useAvatar.ts +6 -5
  76. package/lib/Avatar.helpers.d.ts.map +0 -1
  77. package/lib/Avatar.helpers.js.map +0 -1
  78. package/lib/Avatar.ios.d.ts +0 -70
  79. package/lib/Avatar.ios.d.ts.map +0 -1
  80. package/lib/Avatar.ios.js +0 -45
  81. package/lib/Avatar.ios.js.map +0 -1
  82. package/lib/Avatar.macos.d.ts +0 -70
  83. package/lib/Avatar.macos.d.ts.map +0 -1
  84. package/lib/Avatar.macos.js +0 -45
  85. package/lib/Avatar.macos.js.map +0 -1
  86. package/lib/Avatar.styling.d.ts +0 -4
  87. package/lib/Avatar.styling.d.ts.map +0 -1
  88. package/lib/Avatar.styling.js.map +0 -1
  89. package/lib/Avatar.types.d.ts.map +0 -1
  90. package/lib/Avatar.types.js +0 -2
  91. package/lib/Avatar.types.js.map +0 -1
  92. package/lib/AvatarTokens.d.ts +0 -5
  93. package/lib/AvatarTokens.d.ts.map +0 -1
  94. package/lib/AvatarTokens.js +0 -11
  95. package/lib/AvatarTokens.js.map +0 -1
  96. package/lib-commonjs/Avatar.helpers.d.ts.map +0 -1
  97. package/lib-commonjs/Avatar.helpers.js.map +0 -1
  98. package/lib-commonjs/Avatar.ios.d.ts +0 -70
  99. package/lib-commonjs/Avatar.ios.d.ts.map +0 -1
  100. package/lib-commonjs/Avatar.ios.js +0 -47
  101. package/lib-commonjs/Avatar.ios.js.map +0 -1
  102. package/lib-commonjs/Avatar.macos.d.ts +0 -70
  103. package/lib-commonjs/Avatar.macos.d.ts.map +0 -1
  104. package/lib-commonjs/Avatar.macos.js +0 -47
  105. package/lib-commonjs/Avatar.macos.js.map +0 -1
  106. package/lib-commonjs/Avatar.styling.d.ts +0 -4
  107. package/lib-commonjs/Avatar.styling.d.ts.map +0 -1
  108. package/lib-commonjs/Avatar.styling.js +0 -133
  109. package/lib-commonjs/Avatar.styling.js.map +0 -1
  110. package/lib-commonjs/Avatar.types.d.ts.map +0 -1
  111. package/lib-commonjs/Avatar.types.js.map +0 -1
  112. package/lib-commonjs/AvatarTokens.d.ts +0 -5
  113. package/lib-commonjs/AvatarTokens.d.ts.map +0 -1
  114. package/lib-commonjs/AvatarTokens.js +0 -13
  115. package/lib-commonjs/AvatarTokens.js.map +0 -1
  116. package/src/Avatar.ios.tsx +0 -134
  117. package/src/Avatar.macos.tsx +0 -134
@@ -1,8 +1,9 @@
1
- import { avatarName, AvatarTokens, AvatarSlotProps, AvatarProps } from './Avatar.types';
1
+ import { JSAvatarName, JSAvatarTokens, AvatarSlotProps, JSAvatarProps } from './JSAvatar.types';
2
2
  import { Theme, UseStylingOptions, buildProps } from '@fluentui-react-native/framework';
3
- import { defaultAvatarTokens } from './AvatarTokens';
3
+ import { defaultJSAvatarTokens } from './JSAvatarTokens';
4
4
  import { ViewStyle } from 'react-native';
5
- import { calculateEffectiveSizes, convertCoinColorFluent, getRingThickness } from './Avatar.helpers';
5
+ import { calculateEffectiveSizes, convertCoinColorFluent, getRingThickness } from './JSAvatar.helpers';
6
+ import { borderStyles } from '@fluentui-react-native/tokens';
6
7
 
7
8
  const nameMap: { [key: string]: string } = {
8
9
  start: 'flex-start',
@@ -10,11 +11,14 @@ const nameMap: { [key: string]: string } = {
10
11
  end: 'flex-end',
11
12
  };
12
13
 
13
- export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, AvatarTokens> = {
14
- tokens: [defaultAvatarTokens, avatarName],
14
+ export const avatarStates: (keyof JSAvatarTokens)[] = ['circular', 'square'];
15
+
16
+ export const stylingSettings: UseStylingOptions<JSAvatarProps, AvatarSlotProps, JSAvatarTokens> = {
17
+ tokens: [defaultJSAvatarTokens, JSAvatarName],
18
+ states: avatarStates,
15
19
  slotProps: {
16
20
  root: buildProps(
17
- (tokens: AvatarTokens) => {
21
+ (tokens: JSAvatarTokens) => {
18
22
  const { physicalSize } = calculateEffectiveSizes(tokens);
19
23
  const { horizontalIconAlignment, verticalIconAlignment } = tokens;
20
24
  return {
@@ -32,7 +36,7 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
32
36
  ['horizontalIconAlignment', 'verticalIconAlignment'],
33
37
  ),
34
38
  initials: buildProps(
35
- (tokens: AvatarTokens) => {
39
+ (tokens: JSAvatarTokens) => {
36
40
  const { initialsSize } = calculateEffectiveSizes(tokens);
37
41
  return {
38
42
  style: {
@@ -43,7 +47,7 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
43
47
  ['initialsSize'],
44
48
  ),
45
49
  initialsBackground: buildProps(
46
- (tokens: AvatarTokens) => {
50
+ (tokens: JSAvatarTokens, theme: Theme) => {
47
51
  const { physicalSize } = calculateEffectiveSizes(tokens);
48
52
  const { backgroundColor, coinColorFluent } = tokens;
49
53
  let effectiveBackgroundColor = backgroundColor;
@@ -52,7 +56,7 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
52
56
  }
53
57
  return {
54
58
  style: {
55
- borderRadius: physicalSize / 2,
59
+ ...borderStyles.from(tokens, theme),
56
60
  width: physicalSize,
57
61
  height: physicalSize,
58
62
  flexGrow: 1,
@@ -63,24 +67,24 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
63
67
  },
64
68
  };
65
69
  },
66
- ['coinColorFluent', 'backgroundColor', 'physicalSize'],
70
+ ['coinColorFluent', 'backgroundColor', 'physicalSize', ...borderStyles.keys],
67
71
  ),
68
72
  photo: buildProps(
69
- (tokens: AvatarTokens) => {
73
+ (tokens: JSAvatarTokens) => {
70
74
  const { physicalSize } = calculateEffectiveSizes(tokens);
71
75
 
72
76
  return {
73
77
  style: {
74
- borderRadius: physicalSize / 2,
78
+ borderRadius: tokens.borderRadius,
75
79
  width: physicalSize,
76
80
  height: physicalSize,
77
81
  },
78
82
  };
79
83
  },
80
- ['physicalSize'],
84
+ ['physicalSize', 'borderRadius'],
81
85
  ),
82
86
  icon: buildProps(
83
- (tokens: AvatarTokens, theme: Theme) => {
87
+ (tokens: JSAvatarTokens, theme: Theme) => {
84
88
  const { iconSize, iconStrokeWidth } = calculateEffectiveSizes(tokens);
85
89
  const iconSizeAdjusted = iconSize + iconStrokeWidth * 2;
86
90
  const iconStrokeColor = tokens.iconStrokeColor || theme.colors.background;
@@ -100,7 +104,7 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
100
104
  ['iconSize', 'iconStrokeWidth', 'iconStrokeColor'],
101
105
  ),
102
106
  ring: buildProps(
103
- (tokens: AvatarTokens, theme: Theme) => {
107
+ (tokens: JSAvatarTokens, theme: Theme) => {
104
108
  const { physicalSize } = calculateEffectiveSizes(tokens);
105
109
  const { ring } = tokens;
106
110
 
@@ -116,19 +120,19 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
116
120
  borderStyle: 'solid',
117
121
  borderColor: ringColor,
118
122
  borderWidth: effectiveRingThickness,
119
- borderRadius: effectiveSize / 2,
120
123
  width: effectiveSize,
121
124
  height: effectiveSize,
122
125
  position: 'absolute',
123
126
  top: -effectiveRingThickness,
124
127
  left: -effectiveRingThickness,
128
+ ...borderStyles.from(tokens, theme),
125
129
  },
126
130
  };
127
131
  },
128
- ['physicalSize', 'ring', 'physicalSize'],
132
+ ['physicalSize', 'ring', 'physicalSize', ...borderStyles.keys],
129
133
  ),
130
134
  glow: buildProps(
131
- (tokens: AvatarTokens, theme: Theme) => {
135
+ (tokens: JSAvatarTokens, theme: Theme) => {
132
136
  const { physicalSize } = calculateEffectiveSizes(tokens);
133
137
  const { ring } = tokens;
134
138
 
@@ -144,16 +148,16 @@ export const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, Av
144
148
  borderStyle: 'solid',
145
149
  borderColor: glowColor,
146
150
  borderWidth: effectiveRingThickness - innerGap,
147
- borderRadius: effectiveSize / 2,
148
151
  width: effectiveSize,
149
152
  height: effectiveSize,
150
153
  position: 'absolute',
151
154
  top: -effectiveRingThickness,
152
155
  left: -effectiveRingThickness,
156
+ ...borderStyles.from(tokens, theme),
153
157
  },
154
158
  };
155
159
  },
156
- ['physicalSize', 'ring'],
160
+ ['physicalSize', 'ring', ...borderStyles.keys],
157
161
  ),
158
162
  },
159
163
  };
@@ -0,0 +1,56 @@
1
+ /** @jsx withSlots */
2
+ import { Image, View, Text } from 'react-native';
3
+ import { JSAvatarProps, JSAvatarType, JSAvatarName, JSAvatarState } from './JSAvatar.types';
4
+ import { stylingSettings } from './JSAvatar.styling';
5
+ import { compose, UseSlots, mergeProps, withSlots } from '@fluentui-react-native/framework';
6
+ import { useAvatar } from './useAvatar';
7
+
8
+ /**
9
+ * A function which determines if a set of styles should be applied to the compoent given the current state and props of the avatar.
10
+ *
11
+ * @param layer The name of the state that is being checked for
12
+ * @param state The current state of the avatar
13
+ * @param userProps The props that were passed into the avatar
14
+ * @returns Whether the styles that are assigned to the layer should be applied to the avatar
15
+ */
16
+ export const avatarLookup = (layer: string, state: JSAvatarState, userProps: JSAvatarProps): boolean => {
17
+ return state[layer] || userProps[layer] || layer === userProps['shape'] || (!userProps['shape'] && layer === 'circular');
18
+ };
19
+
20
+ export const JSAvatar = compose<JSAvatarType>({
21
+ displayName: JSAvatarName,
22
+ ...stylingSettings,
23
+ slots: {
24
+ root: View,
25
+ photo: Image,
26
+ initials: Text,
27
+ initialsBackground: View,
28
+ icon: Image,
29
+ ring: View,
30
+ glow: View,
31
+ },
32
+ render: (userProps: JSAvatarProps, useSlots: UseSlots<JSAvatarType>) => {
33
+ const avatar = useAvatar(userProps);
34
+ const Slots = useSlots(userProps, (layer) => avatarLookup(layer, avatar.state, userProps));
35
+
36
+ return (final: JSAvatarProps) => {
37
+ const { children, accessibilityLabel, ...mergedProps } = mergeProps(avatar.props, final);
38
+ const { personaPhotoSource, iconSource, showRing, transparentRing } = avatar.state;
39
+
40
+ return (
41
+ <Slots.root {...mergedProps}>
42
+ {personaPhotoSource ? (
43
+ <Slots.photo accessibilityLabel={accessibilityLabel} source={personaPhotoSource} />
44
+ ) : (
45
+ <Slots.initialsBackground>
46
+ <Slots.initials>{children}</Slots.initials>
47
+ </Slots.initialsBackground>
48
+ )}
49
+ {showRing && !transparentRing && <Slots.ring />}
50
+ {showRing && <Slots.glow />}
51
+ {!!iconSource && !!iconSource.uri && <Slots.icon source={iconSource} />}
52
+ </Slots.root>
53
+ );
54
+ };
55
+ },
56
+ });
@@ -1,11 +1,15 @@
1
1
  import type { IViewProps } from '@fluentui-react-native/adapters';
2
2
  import { ImageProps, ViewProps, ImageURISource, TextProps, ColorValue } from 'react-native';
3
- import { IBackgroundColorTokens, IForegroundColorTokens } from '@fluentui-react-native/tokens';
3
+ import { IBackgroundColorTokens, IForegroundColorTokens, IBorderTokens } from '@fluentui-react-native/tokens';
4
4
 
5
- export const avatarName = 'Avatar';
5
+ export const JSAvatarName = 'Avatar';
6
6
 
7
7
  export type AvatarSize = 'size8' | 'size24' | 'size32' | 'size40' | 'size48' | 'size56' | 'size72' | 'size100' | 'size120';
8
8
 
9
+ export type AvatarShape = 'circular' | 'square';
10
+ export type AvatarActive = 'active' | 'inactive' | 'unset';
11
+ export type AvatarActiveAppearance = 'ring' | 'shadow' | 'glow' | 'ring-shadow' | 'ring-glow';
12
+
9
13
  /**
10
14
  * Sets color of the avatar when there is no picture. Uses fluent color names
11
15
  */
@@ -50,12 +54,15 @@ export interface AvatarConfigurableProps {
50
54
  coinColorFluent?: AvatarColor;
51
55
  }
52
56
 
53
- export interface AvatarProps extends IViewProps, AvatarConfigurableProps {
57
+ export interface JSAvatarProps extends IViewProps, AvatarConfigurableProps {
58
+ active?: AvatarActive;
59
+ activeAppearance?: AvatarActiveAppearance;
54
60
  imageUrl?: string;
55
61
  imageDescription?: string;
56
62
  initials?: string;
57
63
  presence?: AvatarPresence;
58
64
  isOutOfOffice?: boolean;
65
+ shape?: AvatarShape;
59
66
  }
60
67
 
61
68
  export interface AvatarSlotProps {
@@ -70,7 +77,7 @@ export interface AvatarSlotProps {
70
77
 
71
78
  export type IconAlignment = 'start' | 'center' | 'end';
72
79
 
73
- export interface AvatarTokens extends IBackgroundColorTokens, IForegroundColorTokens, AvatarConfigurableProps {
80
+ export interface JSAvatarTokens extends IBackgroundColorTokens, IForegroundColorTokens, AvatarConfigurableProps, IBorderTokens {
74
81
  avatarSize?: number;
75
82
  iconSize?: number;
76
83
  iconStrokeWidth?: number;
@@ -79,9 +86,11 @@ export interface AvatarTokens extends IBackgroundColorTokens, IForegroundColorTo
79
86
  horizontalIconAlignment?: IconAlignment;
80
87
  verticalIconAlignment?: IconAlignment;
81
88
  physicalSize?: number;
89
+ circular?: JSAvatarTokens;
90
+ square?: JSAvatarTokens;
82
91
  }
83
92
 
84
- export interface AvatarState {
93
+ export interface JSAvatarState {
85
94
  personaPhotoSource: ImageURISource | undefined;
86
95
  iconSource: ImageURISource | undefined;
87
96
  showRing: boolean;
@@ -89,13 +98,13 @@ export interface AvatarState {
89
98
  }
90
99
 
91
100
  export interface AvatarInfo {
92
- props: AvatarProps;
93
- state: AvatarState;
101
+ props: JSAvatarProps;
102
+ state: JSAvatarState;
94
103
  }
95
104
 
96
- export interface AvatarType {
97
- props: AvatarProps;
105
+ export interface JSAvatarType {
106
+ props: JSAvatarProps;
98
107
  slotProps: AvatarSlotProps;
99
- tokens: AvatarTokens;
100
- state: AvatarState;
108
+ tokens: JSAvatarTokens;
109
+ state: JSAvatarState;
101
110
  }
@@ -1,13 +1,20 @@
1
1
  import { Theme } from '@fluentui-react-native/framework';
2
2
  import { TokenSettings } from '@fluentui-react-native/use-styling';
3
- import { AvatarTokens } from '.';
4
- import { convertCoinColorFluent } from './Avatar.helpers';
3
+ import { JSAvatarTokens } from '.';
4
+ import { convertCoinColorFluent } from './JSAvatar.helpers';
5
+ import { globalTokens } from '@fluentui-react-native/theme-tokens';
5
6
 
6
- export const defaultAvatarTokens: TokenSettings<AvatarTokens, Theme> = () =>
7
+ export const defaultJSAvatarTokens: TokenSettings<JSAvatarTokens, Theme> = () =>
7
8
  ({
8
9
  horizontalIconAlignment: 'end',
9
10
  verticalIconAlignment: 'end',
10
11
  color: 'white', // initials is always 'white', unless overriden by token
11
12
  iconStrokeColor: 'white', // icon stroke color is always 'white', unless overriden by token
12
13
  backgroundColor: convertCoinColorFluent('cornflower'),
13
- } as AvatarTokens);
14
+ circular: {
15
+ borderRadius: globalTokens.corner.radius.circle,
16
+ },
17
+ square: {
18
+ borderRadius: globalTokens.corner.radius.medium,
19
+ },
20
+ } as JSAvatarTokens);
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './Avatar';
2
- export * from './Avatar.types';
2
+ export * from './JSAvatar';
3
+ export * from './JSAvatar.types';
package/src/useAvatar.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AvatarProps, AvatarInfo, AvatarState } from './Avatar.types';
2
- import { getPresenceIconSource } from './Avatar.helpers';
1
+ import { JSAvatarProps, AvatarInfo, JSAvatarState } from './JSAvatar.types';
2
+ import { getPresenceIconSource } from './JSAvatar.helpers';
3
3
 
4
4
  /**
5
5
  * Re-usable hook for FURN Avatar.
@@ -8,8 +8,8 @@ import { getPresenceIconSource } from './Avatar.helpers';
8
8
  * @param props user props sent to FURN Avatar
9
9
  * @returns configured props and state for FURN Avatar
10
10
  */
11
- export const useAvatar = (props: AvatarProps): AvatarInfo => {
12
- const { imageUrl, imageDescription, initials, presence, isOutOfOffice, ring, ...rest } = props;
11
+ export const useAvatar = (props: JSAvatarProps): AvatarInfo => {
12
+ const { imageUrl, imageDescription, initials, presence, isOutOfOffice, ring, shape, ...rest } = props;
13
13
 
14
14
  const personaPhotoSource =
15
15
  imageUrl === undefined
@@ -22,7 +22,7 @@ export const useAvatar = (props: AvatarProps): AvatarInfo => {
22
22
  const showRing = !!ring;
23
23
  const transparentRing = !!ring?.transparent;
24
24
 
25
- const state: AvatarState = {
25
+ const state: JSAvatarState = {
26
26
  iconSource,
27
27
  personaPhotoSource,
28
28
  showRing,
@@ -33,6 +33,7 @@ export const useAvatar = (props: AvatarProps): AvatarInfo => {
33
33
  props: {
34
34
  children: initials,
35
35
  accessibilityLabel: imageDescription,
36
+ shape: shape || 'circular',
36
37
  ...rest,
37
38
  },
38
39
  state: {
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.helpers.d.ts","sourceRoot":"","sources":["../src/Avatar.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA4B9C,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,GAAG,cAAc,CAEtG;AAED,oBAAY,gBAAgB,GAAG;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAcF,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,gBAAgB,CAEhE;AAyBD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,CAErE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CAoB9E;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAiBjE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.helpers.js","sourceRoot":"","sources":["../src/Avatar.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MA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ACH;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,SAAwB;IACvD,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC;QACX,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC;QACX;YACE,OAAO,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KACxC;AACH,CAAC"}
@@ -1,70 +0,0 @@
1
- import { ImageURISource, ViewProps, ColorValue } from 'react-native';
2
- export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
3
- export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
4
- export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
5
- export declare type AvatarTokens = {
6
- /**
7
- * Supported Avatar sizes
8
- */
9
- size?: Size;
10
- /**
11
- * Supported Avatar styles
12
- */
13
- avatarStyle?: AvatarStyle;
14
- };
15
- export declare type AvatarProps = AvatarTokens & {
16
- /**
17
- * The image to be displayed
18
- */
19
- imageSource?: ImageURISource;
20
- /**
21
- * The primary text to create initials with (e.g. a name)
22
- */
23
- primaryText?: string;
24
- /**
25
- * The secondary text to create initials with if primary text is not provided (e.g. an email address)
26
- */
27
- secondaryText?: string;
28
- /**
29
- * A custom color for the ring around the Avatar
30
- */
31
- ringColor?: ColorValue;
32
- /**
33
- * A custom color for the avatar initials when no image is shown
34
- */
35
- foregroundColor?: ColorValue;
36
- /**
37
- * A custom color for the avatar background when no image is shown
38
- */
39
- backgroundColor?: ColorValue;
40
- /**
41
- * The avatar view's presence state.
42
- */
43
- presence?: Presence;
44
- /**
45
- * A boolean inidicating whether the ring is visible
46
- */
47
- isRingVisible?: boolean;
48
- /**
49
- * A boolean indicating whether the Inner Ring Gap is transparent
50
- */
51
- isTransparent?: boolean;
52
- /**
53
- * A boolean indicating out of office status
54
- */
55
- isOutOfOffice?: boolean;
56
- /**
57
- * A boolean indicating whether the gap between the avatar and ring is visible.
58
- */
59
- hasRingInnerGap?: boolean;
60
- /**
61
- * An image to be shown as the backdrop of the ring, rather then a solid color.
62
- * Takes precendence over `ringColor`
63
- */
64
- customBorderImageSource?: ImageURISource;
65
- };
66
- export declare type NativeAvatarViewProps = ViewProps & AvatarProps;
67
- export declare const Avatar: import("@fluentui-react-native/composition").ComposeFactoryComponent<AvatarProps, {
68
- root: NativeAvatarViewProps;
69
- }, AvatarTokens, import("@fluentui-react-native/framework").Theme, object>;
70
- //# sourceMappingURL=Avatar.ios.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.ios.d.ts","sourceRoot":"","sources":["../src/Avatar.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAOpF,oBAAY,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElF,oBAAY,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEvG,oBAAY,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAQ1G,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,WAAW,GAAG,YAAY,GAAG;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C,CAAC;AAIF,oBAAY,qBAAqB,GAAG,SAAS,GAAG,WAAW,CAAC;AAO5D,eAAO,MAAM,MAAM;;0EA4BjB,CAAC"}
package/lib/Avatar.ios.js DELETED
@@ -1,45 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- /** @jsx withSlots */
13
- import { compose, buildProps, mergeProps, withSlots } from '@fluentui-react-native/framework';
14
- import { NativeModules } from 'react-native';
15
- import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
16
- var avatarName = 'Avatar';
17
- var NativeAvatarView = ensureNativeComponent('FRNAvatarView');
18
- var ExportedNativeConstants = NativeModules.FRNAvatarViewManager;
19
- var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
20
- export var Avatar = compose({
21
- displayName: avatarName,
22
- tokens: [
23
- {
24
- size: 'small',
25
- avatarStyle: 'default',
26
- },
27
- avatarName,
28
- ],
29
- tokensThatAreAlsoProps: tokensThatAreAlsoProps,
30
- slots: { root: NativeAvatarView },
31
- slotProps: {
32
- root: buildProps(function (tokens) { return ({
33
- size: tokens.size,
34
- style: {
35
- height: ExportedNativeConstants.sizes[tokens.size],
36
- width: ExportedNativeConstants.sizes[tokens.size],
37
- },
38
- }); }, ['size']),
39
- },
40
- render: function (props, useSlots) {
41
- var Root = useSlots(props).root;
42
- return function (rest) { return withSlots(Root, __assign({}, mergeProps(props, rest))); };
43
- },
44
- });
45
- //# sourceMappingURL=Avatar.ios.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.ios.js","sourceRoot":"","sources":["../src/Avatar.ios.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAkB,aAAa,EAAyB,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,IAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B,IAAM,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,aAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAA2B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAS/E,MAAM,CAAC,IAAM,MAAM,GAAG,OAAO,CAAa;IACxC,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,SAAS;SACvB;QACD,UAAU;KACX;IACD,sBAAsB,wBAAA;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACjC,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,UAAC,MAAM,IAAK,OAAA,CAAC;YACX,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE;gBACL,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAClD,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;aAClD;SACF,CAAC,EANU,CAMV,EACF,CAAC,MAAM,CAAC,CACT;KACF;IACD,MAAM,EAAE,UAAC,KAAkB,EAAE,QAA8B;QACzD,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAiB,IAAK,OAAA,UAAC,IAAI,eAAK,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IACtE,CAAC;CACF,CAAC,CAAC"}
@@ -1,70 +0,0 @@
1
- import { ImageURISource, ViewProps, ColorValue } from 'react-native';
2
- export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
3
- export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
4
- export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
5
- export declare type AvatarTokens = {
6
- /**
7
- * Supported Avatar sizes
8
- */
9
- size?: Size;
10
- /**
11
- * Supported Avatar styles
12
- */
13
- avatarStyle?: AvatarStyle;
14
- };
15
- export declare type AvatarProps = AvatarTokens & {
16
- /**
17
- * The image to be displayed
18
- */
19
- imageSource?: ImageURISource;
20
- /**
21
- * The primary text to create initials with (e.g. a name)
22
- */
23
- primaryText?: string;
24
- /**
25
- * The secondary text to create initials with if primary text is not provided (e.g. an email address)
26
- */
27
- secondaryText?: string;
28
- /**
29
- * A custom color for the ring around the Avatar
30
- */
31
- ringColor?: ColorValue;
32
- /**
33
- * A custom color for the avatar initials when no image is shown
34
- */
35
- foregroundColor?: ColorValue;
36
- /**
37
- * A custom color for the avatar background when no image is shown
38
- */
39
- backgroundColor?: ColorValue;
40
- /**
41
- * The avatar view's presence state.
42
- */
43
- presence?: Presence;
44
- /**
45
- * A boolean inidicating whether the ring is visible
46
- */
47
- isRingVisible?: boolean;
48
- /**
49
- * A boolean indicating whether the Inner Ring Gap is transparent
50
- */
51
- isTransparent?: boolean;
52
- /**
53
- * A boolean indicating out of office status
54
- */
55
- isOutOfOffice?: boolean;
56
- /**
57
- * A boolean indicating whether the gap between the avatar and ring is visible.
58
- */
59
- hasRingInnerGap?: boolean;
60
- /**
61
- * An image to be shown as the backdrop of the ring, rather then a solid color.
62
- * Takes precendence over `ringColor`
63
- */
64
- customBorderImageSource?: ImageURISource;
65
- };
66
- export declare type NativeAvatarViewProps = ViewProps & AvatarProps;
67
- export declare const Avatar: import("@fluentui-react-native/composition").ComposeFactoryComponent<AvatarProps, {
68
- root: NativeAvatarViewProps;
69
- }, AvatarTokens, import("@fluentui-react-native/framework").Theme, object>;
70
- //# sourceMappingURL=Avatar.macos.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.macos.d.ts","sourceRoot":"","sources":["../src/Avatar.macos.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAOpF,oBAAY,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElF,oBAAY,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEvG,oBAAY,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAQ1G,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,WAAW,GAAG,YAAY,GAAG;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C,CAAC;AAIF,oBAAY,qBAAqB,GAAG,SAAS,GAAG,WAAW,CAAC;AAO5D,eAAO,MAAM,MAAM;;0EA4BjB,CAAC"}
@@ -1,45 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- /** @jsx withSlots */
13
- import { compose, buildProps, mergeProps, withSlots } from '@fluentui-react-native/framework';
14
- import { NativeModules } from 'react-native';
15
- import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
16
- var avatarName = 'Avatar';
17
- var NativeAvatarView = ensureNativeComponent('FRNAvatarView');
18
- var ExportedNativeConstants = NativeModules.FRNAvatarViewManager;
19
- var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
20
- export var Avatar = compose({
21
- displayName: avatarName,
22
- tokens: [
23
- {
24
- size: 'small',
25
- avatarStyle: 'default',
26
- },
27
- avatarName,
28
- ],
29
- tokensThatAreAlsoProps: tokensThatAreAlsoProps,
30
- slots: { root: NativeAvatarView },
31
- slotProps: {
32
- root: buildProps(function (tokens) { return ({
33
- size: tokens.size,
34
- style: {
35
- height: ExportedNativeConstants.sizes[tokens.size],
36
- width: ExportedNativeConstants.sizes[tokens.size],
37
- },
38
- }); }, ['size']),
39
- },
40
- render: function (props, useSlots) {
41
- var Root = useSlots(props).root;
42
- return function (rest) { return withSlots(Root, __assign({}, mergeProps(props, rest))); };
43
- },
44
- });
45
- //# sourceMappingURL=Avatar.macos.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.macos.js","sourceRoot":"","sources":["../src/Avatar.macos.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAkB,aAAa,EAAyB,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,IAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B,IAAM,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,aAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAA2B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAS/E,MAAM,CAAC,IAAM,MAAM,GAAG,OAAO,CAAa;IACxC,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,SAAS;SACvB;QACD,UAAU;KACX;IACD,sBAAsB,wBAAA;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACjC,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,UAAC,MAAM,IAAK,OAAA,CAAC;YACX,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE;gBACL,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAClD,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;aAClD;SACF,CAAC,EANU,CAMV,EACF,CAAC,MAAM,CAAC,CACT;KACF;IACD,MAAM,EAAE,UAAC,KAAkB,EAAE,QAA8B;QACzD,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAiB,IAAK,OAAA,UAAC,IAAI,eAAK,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IACtE,CAAC;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { AvatarTokens, AvatarSlotProps, AvatarProps } from './Avatar.types';
2
- import { UseStylingOptions } from '@fluentui-react-native/framework';
3
- export declare const stylingSettings: UseStylingOptions<AvatarProps, AvatarSlotProps, AvatarTokens>;
4
- //# sourceMappingURL=Avatar.styling.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.styling.d.ts","sourceRoot":"","sources":["../src/Avatar.styling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAS,iBAAiB,EAAc,MAAM,kCAAkC,CAAC;AAWxF,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,WAAW,EAAE,eAAe,EAAE,YAAY,CAkJzF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.styling.js","sourceRoot":"","sources":["../src/Avatar.styling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,E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sources":["../src/Avatar.types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,IAAM,UAAU,GAAG,QAAQ,CAAC"}
@@ -1,5 +0,0 @@
1
- import { Theme } from '@fluentui-react-native/framework';
2
- import { TokenSettings } from '@fluentui-react-native/use-styling';
3
- import { AvatarTokens } from '.';
4
- export declare const defaultAvatarTokens: TokenSettings<AvatarTokens, Theme>;
5
- //# sourceMappingURL=AvatarTokens.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AvatarTokens.d.ts","sourceRoot":"","sources":["../src/AvatarTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAGjC,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,YAAY,EAAE,KAAK,CAO/C,CAAC"}