@fluentui-react-native/experimental-avatar 0.14.43 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +46 -1
- package/CHANGELOG.md +26 -2
- package/{lib-commonjs/Avatar.d.ts → lib/NativeAvatar.d.ts} +6 -6
- package/lib/NativeAvatar.d.ts.map +1 -0
- package/lib/{Avatar.js → NativeAvatar.js} +3 -3
- package/lib/NativeAvatar.js.map +1 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/{lib/Avatar.d.ts → lib-commonjs/NativeAvatar.d.ts} +6 -6
- package/lib-commonjs/NativeAvatar.d.ts.map +1 -0
- package/lib-commonjs/{Avatar.js → NativeAvatar.js} +4 -4
- package/lib-commonjs/NativeAvatar.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -3
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +1 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +2 -10
- package/src/{Avatar.tsx → NativeAvatar.tsx} +11 -11
- package/src/__tests__/{JSAvatar.test.jsx → Avatar.test.jsx} +2 -2
- package/src/__tests__/__snapshots__/Avatar.test.jsx.snap +93 -0
- package/src/index.ts +1 -3
- package/MIGRATION.md +0 -158
- package/SPEC.md +0 -305
- package/jest.config.js +0 -2
- package/lib/Avatar.d.ts.map +0 -1
- package/lib/Avatar.js.map +0 -1
- package/lib/JSAvatar.d.ts +0 -12
- package/lib/JSAvatar.d.ts.map +0 -1
- package/lib/JSAvatar.helpers.d.ts +0 -7
- package/lib/JSAvatar.helpers.d.ts.map +0 -1
- package/lib/JSAvatar.helpers.js +0 -28
- package/lib/JSAvatar.helpers.js.map +0 -1
- package/lib/JSAvatar.js +0 -75
- package/lib/JSAvatar.js.map +0 -1
- package/lib/JSAvatar.styling.d.ts +0 -5
- package/lib/JSAvatar.styling.d.ts.map +0 -1
- package/lib/JSAvatar.styling.js +0 -114
- package/lib/JSAvatar.styling.js.map +0 -1
- package/lib/JSAvatar.types.d.ts +0 -192
- package/lib/JSAvatar.types.d.ts.map +0 -1
- package/lib/JSAvatar.types.js +0 -56
- package/lib/JSAvatar.types.js.map +0 -1
- package/lib/JSAvatarTokens.d.ts +0 -5
- package/lib/JSAvatarTokens.d.ts.map +0 -1
- package/lib/JSAvatarTokens.js +0 -200
- package/lib/JSAvatarTokens.js.map +0 -1
- package/lib/JSAvatarTokens.win32.d.ts +0 -5
- package/lib/JSAvatarTokens.win32.d.ts.map +0 -1
- package/lib/JSAvatarTokens.win32.js +0 -203
- package/lib/JSAvatarTokens.win32.js.map +0 -1
- package/lib/getHashCode.d.ts +0 -8
- package/lib/getHashCode.d.ts.map +0 -1
- package/lib/getHashCode.js +0 -16
- package/lib/getHashCode.js.map +0 -1
- package/lib/titles.d.ts +0 -2
- package/lib/titles.d.ts.map +0 -1
- package/lib/titles.js +0 -109
- package/lib/titles.js.map +0 -1
- package/lib/useAvatar.d.ts +0 -33
- package/lib/useAvatar.d.ts.map +0 -1
- package/lib/useAvatar.js +0 -105
- package/lib/useAvatar.js.map +0 -1
- package/lib-commonjs/Avatar.d.ts.map +0 -1
- package/lib-commonjs/Avatar.js.map +0 -1
- package/lib-commonjs/JSAvatar.d.ts +0 -12
- package/lib-commonjs/JSAvatar.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.helpers.d.ts +0 -7
- package/lib-commonjs/JSAvatar.helpers.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.helpers.js +0 -32
- package/lib-commonjs/JSAvatar.helpers.js.map +0 -1
- package/lib-commonjs/JSAvatar.js +0 -79
- package/lib-commonjs/JSAvatar.js.map +0 -1
- package/lib-commonjs/JSAvatar.styling.d.ts +0 -5
- package/lib-commonjs/JSAvatar.styling.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.styling.js +0 -117
- package/lib-commonjs/JSAvatar.styling.js.map +0 -1
- package/lib-commonjs/JSAvatar.types.d.ts +0 -192
- package/lib-commonjs/JSAvatar.types.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.types.js +0 -59
- package/lib-commonjs/JSAvatar.types.js.map +0 -1
- package/lib-commonjs/JSAvatarTokens.d.ts +0 -5
- package/lib-commonjs/JSAvatarTokens.d.ts.map +0 -1
- package/lib-commonjs/JSAvatarTokens.js +0 -204
- package/lib-commonjs/JSAvatarTokens.js.map +0 -1
- package/lib-commonjs/JSAvatarTokens.win32.d.ts +0 -5
- package/lib-commonjs/JSAvatarTokens.win32.d.ts.map +0 -1
- package/lib-commonjs/JSAvatarTokens.win32.js +0 -207
- package/lib-commonjs/JSAvatarTokens.win32.js.map +0 -1
- package/lib-commonjs/getHashCode.d.ts +0 -8
- package/lib-commonjs/getHashCode.d.ts.map +0 -1
- package/lib-commonjs/getHashCode.js +0 -20
- package/lib-commonjs/getHashCode.js.map +0 -1
- package/lib-commonjs/titles.d.ts +0 -2
- package/lib-commonjs/titles.d.ts.map +0 -1
- package/lib-commonjs/titles.js +0 -112
- package/lib-commonjs/titles.js.map +0 -1
- package/lib-commonjs/useAvatar.d.ts +0 -33
- package/lib-commonjs/useAvatar.d.ts.map +0 -1
- package/lib-commonjs/useAvatar.js +0 -112
- package/lib-commonjs/useAvatar.js.map +0 -1
- package/src/JSAvatar.helpers.ts +0 -35
- package/src/JSAvatar.styling.ts +0 -159
- package/src/JSAvatar.tsx +0 -80
- package/src/JSAvatar.types.ts +0 -259
- package/src/JSAvatarTokens.ts +0 -203
- package/src/JSAvatarTokens.win32.ts +0 -206
- package/src/__tests__/__snapshots__/JSAvatar.test.jsx.snap +0 -96
- package/src/getHashCode.ts +0 -16
- package/src/titles.ts +0 -108
- package/src/useAvatar.ts +0 -122
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.removeTitlesFromName = exports.removeRedundantCharacters = exports.getInitials = exports.useAvatar = void 0;
|
|
26
|
-
var JSAvatar_types_1 = require("./JSAvatar.types");
|
|
27
|
-
var titles_1 = require("./titles");
|
|
28
|
-
var getHashCode_1 = require("./getHashCode");
|
|
29
|
-
/**
|
|
30
|
-
* Re-usable hook for FURN Avatar.
|
|
31
|
-
* This hook configures Avatar props and state for FURN Avatar.
|
|
32
|
-
*
|
|
33
|
-
* @param props user props sent to FURN Avatar
|
|
34
|
-
* @returns configured props and state for FURN Avatar
|
|
35
|
-
*/
|
|
36
|
-
var useAvatar = function (props) {
|
|
37
|
-
var _a;
|
|
38
|
-
var avatarColor = props.avatarColor, active = props.active, accessibilityLabel = props.accessibilityLabel, accessibilityRole = props.accessibilityRole, activeAppearance = props.activeAppearance, badge = props.badge, idForColor = props.idForColor, initials = props.initials, name = props.name, ring = props.ring, shape = props.shape, rest = __rest(props, ["avatarColor", "active", "accessibilityLabel", "accessibilityRole", "activeAppearance", "badge", "idForColor", "initials", "name", "ring", "shape"]);
|
|
39
|
-
var showRing = active === 'active' && activeAppearance === 'ring';
|
|
40
|
-
var transparentRing = !!(ring === null || ring === void 0 ? void 0 : ring.transparent);
|
|
41
|
-
var showBadge = (!active || active === 'unset') && !!badge && !!badge.status;
|
|
42
|
-
var accessibilityText = "".concat(name || '').concat(showBadge ? ", ".concat(badge.status) : '');
|
|
43
|
-
var badgeProps = __assign({ size: 'small' }, badge);
|
|
44
|
-
var state = {
|
|
45
|
-
showRing: showRing,
|
|
46
|
-
transparentRing: transparentRing,
|
|
47
|
-
showBadge: showBadge,
|
|
48
|
-
};
|
|
49
|
-
var _initials = initials || (0, exports.getInitials)(name);
|
|
50
|
-
var avatarColorsIdx = (0, getHashCode_1.getHashCodeWeb)((_a = idForColor !== null && idForColor !== void 0 ? idForColor : name) !== null && _a !== void 0 ? _a : '') % JSAvatar_types_1.AvatarColors.length;
|
|
51
|
-
var _avatarColor = avatarColor === 'colorful' ? JSAvatar_types_1.AvatarColors[avatarColorsIdx] : avatarColor;
|
|
52
|
-
return {
|
|
53
|
-
props: __assign(__assign({ accessible: true, accessibilityLabel: accessibilityLabel || accessibilityText, accessibilityRole: accessibilityRole !== null && accessibilityRole !== void 0 ? accessibilityRole : 'image', avatarColor: _avatarColor, shape: shape || 'circular' }, rest), { active: active, activeAppearance: activeAppearance, badge: badgeProps, initials: _initials }),
|
|
54
|
-
state: __assign({}, state),
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
exports.useAvatar = useAvatar;
|
|
58
|
-
/**
|
|
59
|
-
* A function which takes a name and returns initials
|
|
60
|
-
*
|
|
61
|
-
* @param name
|
|
62
|
-
* @returns initials. First letter of the word if only one word was provided.
|
|
63
|
-
* First letters of the first and last words if more words were provided.
|
|
64
|
-
* Words in braces, titles, special characters, parantheses and dashes should be ignored.
|
|
65
|
-
*/
|
|
66
|
-
var getInitials = function (name) {
|
|
67
|
-
if (!name) {
|
|
68
|
-
return '';
|
|
69
|
-
}
|
|
70
|
-
var ARABIC_ASIAN_REGEXP = new RegExp('[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uD840-\uD869]', 'g');
|
|
71
|
-
var words = (0, exports.removeRedundantCharacters)(name);
|
|
72
|
-
var wordsLength = words.length;
|
|
73
|
-
var lastWordIdx = wordsLength - 1;
|
|
74
|
-
var firstLetter = words[0].charAt(0).toUpperCase();
|
|
75
|
-
var lastLetter = wordsLength > 1 ? words[lastWordIdx].charAt(0).toUpperCase() : '';
|
|
76
|
-
var initials = "".concat(firstLetter).concat(ARABIC_ASIAN_REGEXP.test(name) ? '' : lastLetter);
|
|
77
|
-
return initials;
|
|
78
|
-
};
|
|
79
|
-
exports.getInitials = getInitials;
|
|
80
|
-
/**
|
|
81
|
-
* A function which takes a name and returns array of valid words
|
|
82
|
-
*
|
|
83
|
-
* @param name
|
|
84
|
-
* @returns array of words without phone numbers and special characters.
|
|
85
|
-
*/
|
|
86
|
-
var removeRedundantCharacters = function (name) {
|
|
87
|
-
if (!name) {
|
|
88
|
-
return [];
|
|
89
|
-
}
|
|
90
|
-
var WORDS_IN_BRACES_REGEXP = new RegExp('[(\\[\\{][^\\)\\]\\}]*[\\)\\]\\}]', 'g');
|
|
91
|
-
var PHONE_NUMBER_REGEXP = new RegExp('(\\+|(\\d|\\s))', 'g');
|
|
92
|
-
var SPECIAL_CHARACTERS_REGEXP = new RegExp('[!"#\'$%&*+,-./:;>=<?@^_`|~¡¢£¤¥¦§¨©ª«¬®ˉ°±²¼½¾¿×÷]', 'g');
|
|
93
|
-
var words = name
|
|
94
|
-
.replace(WORDS_IN_BRACES_REGEXP, '')
|
|
95
|
-
.replace(PHONE_NUMBER_REGEXP, ' ')
|
|
96
|
-
.replace(SPECIAL_CHARACTERS_REGEXP, '')
|
|
97
|
-
.trim()
|
|
98
|
-
.split(' ');
|
|
99
|
-
return (0, exports.removeTitlesFromName)(words);
|
|
100
|
-
};
|
|
101
|
-
exports.removeRedundantCharacters = removeRedundantCharacters;
|
|
102
|
-
/**
|
|
103
|
-
* A function which verifies whether words array contains title
|
|
104
|
-
*
|
|
105
|
-
* @param words array of words in name
|
|
106
|
-
* @returns array of words without titles
|
|
107
|
-
*/
|
|
108
|
-
var removeTitlesFromName = function (words) {
|
|
109
|
-
return words.filter(function (word) { return !titles_1.titles.has(word); });
|
|
110
|
-
};
|
|
111
|
-
exports.removeTitlesFromName = removeTitlesFromName;
|
|
112
|
-
//# sourceMappingURL=useAvatar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAvatar.js","sourceRoot":"","sources":["../src/useAvatar.ts"],"names":[],"mappings":"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"}
|
package/src/JSAvatar.helpers.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
2
|
-
|
|
3
|
-
const sizeAdjustment = {
|
|
4
|
-
small: 8,
|
|
5
|
-
medium: 12,
|
|
6
|
-
large: 16,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export type AvatarSizeConfig = {
|
|
10
|
-
iconSize: number;
|
|
11
|
-
iconStrokeWidth: number;
|
|
12
|
-
initialsSize: number;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function getRingConfig(size: number): any {
|
|
16
|
-
if (size <= 48) {
|
|
17
|
-
return {
|
|
18
|
-
size: size + sizeAdjustment.small,
|
|
19
|
-
stroke: globalTokens.stroke.width.thick,
|
|
20
|
-
innerStroke: globalTokens.stroke.width.thick,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
if (size <= 71) {
|
|
24
|
-
return {
|
|
25
|
-
size: size + sizeAdjustment.medium,
|
|
26
|
-
stroke: globalTokens.stroke.width.thicker,
|
|
27
|
-
innerStroke: globalTokens.stroke.width.thicker,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
size: size + sizeAdjustment.large,
|
|
32
|
-
stroke: globalTokens.stroke.width.thickest,
|
|
33
|
-
innerStroke: globalTokens.stroke.width.thickest,
|
|
34
|
-
};
|
|
35
|
-
}
|
package/src/JSAvatar.styling.ts
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
JSAvatarName,
|
|
3
|
-
JSAvatarTokens,
|
|
4
|
-
AvatarConfigurableProps,
|
|
5
|
-
AvatarSlotProps,
|
|
6
|
-
JSAvatarProps,
|
|
7
|
-
AvatarColors,
|
|
8
|
-
AvatarSizesForTokens,
|
|
9
|
-
AvatarNamedColor,
|
|
10
|
-
ColorSchemes,
|
|
11
|
-
AvatarColorSchemes,
|
|
12
|
-
} from './JSAvatar.types';
|
|
13
|
-
import { Theme, UseStylingOptions, buildProps } from '@fluentui-react-native/framework';
|
|
14
|
-
import { defaultJSAvatarTokens } from './JSAvatarTokens';
|
|
15
|
-
import { ViewStyle } from 'react-native';
|
|
16
|
-
import { getRingConfig } from './JSAvatar.helpers';
|
|
17
|
-
import { borderStyles, fontStyles } from '@fluentui-react-native/tokens';
|
|
18
|
-
|
|
19
|
-
const nameMap: { [key: string]: string } = {
|
|
20
|
-
start: 'flex-start',
|
|
21
|
-
center: 'center',
|
|
22
|
-
end: 'flex-end',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const avatarStates: (keyof JSAvatarTokens)[] = [
|
|
26
|
-
...AvatarColors,
|
|
27
|
-
...AvatarSizesForTokens,
|
|
28
|
-
'neutral',
|
|
29
|
-
'brand',
|
|
30
|
-
'circular',
|
|
31
|
-
'square',
|
|
32
|
-
'inactive',
|
|
33
|
-
'ringColor',
|
|
34
|
-
'iconColor',
|
|
35
|
-
'iconSize',
|
|
36
|
-
'size',
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
const tokensThatAreAlsoProps: (keyof AvatarConfigurableProps)[] = ['avatarColor', 'initialsColor', 'ring'];
|
|
40
|
-
|
|
41
|
-
export const stylingSettings: UseStylingOptions<JSAvatarProps, AvatarSlotProps, JSAvatarTokens> = {
|
|
42
|
-
tokens: [defaultJSAvatarTokens, JSAvatarName],
|
|
43
|
-
tokensThatAreAlsoProps,
|
|
44
|
-
states: avatarStates,
|
|
45
|
-
slotProps: {
|
|
46
|
-
root: buildProps(
|
|
47
|
-
(tokens: JSAvatarTokens) => {
|
|
48
|
-
const { horizontalIconAlignment, verticalIconAlignment, size, avatarOpacity } = tokens;
|
|
49
|
-
return {
|
|
50
|
-
style: {
|
|
51
|
-
flexDirection: 'row',
|
|
52
|
-
width: size,
|
|
53
|
-
height: size,
|
|
54
|
-
justifyContent: nameMap[horizontalIconAlignment || 'end'] as ViewStyle['justifyContent'],
|
|
55
|
-
alignItems: nameMap[verticalIconAlignment || 'end'] as ViewStyle['alignItems'],
|
|
56
|
-
horizontalIconAlignment,
|
|
57
|
-
verticalIconAlignment,
|
|
58
|
-
opacity: avatarOpacity,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
['horizontalIconAlignment', 'verticalIconAlignment', 'avatarOpacity', 'size'],
|
|
63
|
-
),
|
|
64
|
-
initials: buildProps(
|
|
65
|
-
(tokens: JSAvatarTokens, theme: Theme) => {
|
|
66
|
-
return {
|
|
67
|
-
style: {
|
|
68
|
-
...fontStyles.from(tokens, theme),
|
|
69
|
-
color: tokens.initialsColor || tokens.color,
|
|
70
|
-
textAlign: 'center',
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
['color', 'initialsColor', ...fontStyles.keys],
|
|
75
|
-
),
|
|
76
|
-
initialsBackground: buildProps(
|
|
77
|
-
(tokens: JSAvatarTokens, theme: Theme) => {
|
|
78
|
-
const { backgroundColor, size, avatarColor } = tokens;
|
|
79
|
-
const _avatarColor =
|
|
80
|
-
!avatarColor || AvatarColors.includes(avatarColor as AvatarNamedColor) || ColorSchemes.includes(avatarColor as AvatarColorSchemes)
|
|
81
|
-
? backgroundColor
|
|
82
|
-
: avatarColor;
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
style: {
|
|
86
|
-
...borderStyles.from(tokens, theme),
|
|
87
|
-
width: size,
|
|
88
|
-
height: size,
|
|
89
|
-
flexGrow: 1,
|
|
90
|
-
alignSelf: 'stretch',
|
|
91
|
-
justifyContent: 'center',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
backgroundColor: _avatarColor,
|
|
94
|
-
borderWidth: tokens.borderWidth,
|
|
95
|
-
borderColor: tokens.borderColor,
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
['avatarColor', 'backgroundColor', 'size', 'borderColor', 'borderWidth', ...borderStyles.keys],
|
|
100
|
-
),
|
|
101
|
-
image: buildProps(
|
|
102
|
-
(tokens: JSAvatarTokens) => {
|
|
103
|
-
const { borderRadius, size, borderWidth, borderColor } = tokens;
|
|
104
|
-
return {
|
|
105
|
-
style: {
|
|
106
|
-
borderRadius: borderRadius,
|
|
107
|
-
width: size,
|
|
108
|
-
height: size,
|
|
109
|
-
borderWidth: borderWidth,
|
|
110
|
-
borderColor: borderColor,
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
},
|
|
114
|
-
['borderRadius', 'size', 'borderColor', 'borderWidth'],
|
|
115
|
-
),
|
|
116
|
-
icon: buildProps(
|
|
117
|
-
(tokens: JSAvatarTokens) => {
|
|
118
|
-
return {
|
|
119
|
-
style: {
|
|
120
|
-
position: 'absolute',
|
|
121
|
-
fontSize: tokens.iconSize,
|
|
122
|
-
},
|
|
123
|
-
color: tokens.color,
|
|
124
|
-
width: tokens.iconSize,
|
|
125
|
-
height: tokens.iconSize,
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
['iconSize', 'iconColor'],
|
|
129
|
-
),
|
|
130
|
-
ring: buildProps(
|
|
131
|
-
(tokens: JSAvatarTokens, theme: Theme) => {
|
|
132
|
-
const ringConfig = getRingConfig(tokens.size);
|
|
133
|
-
return {
|
|
134
|
-
style: {
|
|
135
|
-
borderStyle: 'solid',
|
|
136
|
-
width: ringConfig.size,
|
|
137
|
-
height: ringConfig.size,
|
|
138
|
-
position: 'absolute',
|
|
139
|
-
top: -ringConfig.stroke * 2,
|
|
140
|
-
left: -ringConfig.stroke * 2,
|
|
141
|
-
...borderStyles.from(tokens, theme),
|
|
142
|
-
borderWidth: ringConfig.stroke,
|
|
143
|
-
borderColor: tokens.ringColor,
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
|
-
['size', 'ringColor', ...borderStyles.keys],
|
|
148
|
-
),
|
|
149
|
-
badge: buildProps(
|
|
150
|
-
(tokens: JSAvatarTokens) => {
|
|
151
|
-
return {
|
|
152
|
-
size: tokens.badgeSize,
|
|
153
|
-
shape: 'circular',
|
|
154
|
-
};
|
|
155
|
-
},
|
|
156
|
-
['badgeSize'],
|
|
157
|
-
),
|
|
158
|
-
},
|
|
159
|
-
};
|
package/src/JSAvatar.tsx
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/** @jsx withSlots */
|
|
2
|
-
import { Image, View, Text, Platform } 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
|
-
import { PresenceBadge } from '@fluentui-react-native/badge';
|
|
8
|
-
import { Icon } from '@fluentui-react-native/icon';
|
|
9
|
-
import { createIconProps } from '@fluentui-react-native/interactive-hooks';
|
|
10
|
-
import { SvgXml } from 'react-native-svg';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A function which determines if a set of styles should be applied to the compoent given the current state and props of the avatar.
|
|
14
|
-
*
|
|
15
|
-
* @param layer The name of the state that is being checked for
|
|
16
|
-
* @param state The current state of the avatar
|
|
17
|
-
* @param userProps The props that were passed into the avatar
|
|
18
|
-
* @returns Whether the styles that are assigned to the layer should be applied to the avatar
|
|
19
|
-
*/
|
|
20
|
-
export const avatarLookup = (layer: string, state: JSAvatarState, userProps: JSAvatarProps): boolean => {
|
|
21
|
-
const size = userProps.size;
|
|
22
|
-
const avatarSize = size ? `size${size}` : '';
|
|
23
|
-
return (
|
|
24
|
-
state[layer] ||
|
|
25
|
-
userProps[layer] ||
|
|
26
|
-
layer === userProps['shape'] ||
|
|
27
|
-
(!userProps['shape'] && layer === 'circular') ||
|
|
28
|
-
layer === userProps['avatarColor'] ||
|
|
29
|
-
layer === avatarSize ||
|
|
30
|
-
(userProps.active === 'inactive' && layer === 'inactive')
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const JSAvatar = compose<JSAvatarType>({
|
|
35
|
-
displayName: JSAvatarName,
|
|
36
|
-
...stylingSettings,
|
|
37
|
-
slots: {
|
|
38
|
-
root: View,
|
|
39
|
-
image: Image,
|
|
40
|
-
initials: Text,
|
|
41
|
-
initialsBackground: View,
|
|
42
|
-
icon: Icon,
|
|
43
|
-
ring: View,
|
|
44
|
-
badge: PresenceBadge,
|
|
45
|
-
},
|
|
46
|
-
useRender: (userProps: JSAvatarProps, useSlots: UseSlots<JSAvatarType>) => {
|
|
47
|
-
const avatar = useAvatar(userProps);
|
|
48
|
-
const iconProps = createIconProps(userProps.icon);
|
|
49
|
-
const Slots = useSlots(avatar.props, (layer) => avatarLookup(layer, avatar.state, avatar.props));
|
|
50
|
-
|
|
51
|
-
return (final: JSAvatarProps) => {
|
|
52
|
-
const { activeAppearance, icon, initials, imageUrl, badge, ...mergedProps } = mergeProps(avatar.props, final);
|
|
53
|
-
const { showRing, transparentRing, showBadge } = avatar.state;
|
|
54
|
-
const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
|
|
55
|
-
const fallBackIconXml = `<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
56
|
-
<path d="M7 0C4.79086 0 3 1.79086 3 4C3 6.20914 4.79086 8 7 8C9.20914 8 11 6.20914 11 4C11 1.79086 9.20914 0 7 0ZM4 4C4 2.34315 5.34315 1 7 1C8.65685 1 10 2.34315 10 4C10 5.65685 8.65685 7 7 7C5.34315 7 4 5.65685 4 4ZM2.00873 9C0.903151 9 0 9.88687 0 11C0 12.6912 0.83281 13.9663 2.13499 14.7966C3.41697 15.614 5.14526 16 7 16C8.85474 16 10.583 15.614 11.865 14.7966C13.1672 13.9663 14 12.6912 14 11C14 9.89557 13.1045 9.00001 12 9.00001L2.00873 9ZM1 11C1 10.4467 1.44786 10 2.00873 10L12 10C12.5522 10 13 10.4478 13 11C13 12.3088 12.3777 13.2837 11.3274 13.9534C10.2568 14.636 8.73511 15 7 15C5.26489 15 3.74318 14.636 2.67262 13.9534C1.62226 13.2837 1 12.3088 1 11Z" fill="currentColor"/>
|
|
57
|
-
</svg>
|
|
58
|
-
`;
|
|
59
|
-
return (
|
|
60
|
-
<Slots.root {...mergedProps}>
|
|
61
|
-
{imageUrl ? (
|
|
62
|
-
<Slots.image source={{ uri: imageUrl }} />
|
|
63
|
-
) : (
|
|
64
|
-
<Slots.initialsBackground accessible={false}>
|
|
65
|
-
{initials ? (
|
|
66
|
-
<Slots.initials accessible={false}>{initials}</Slots.initials>
|
|
67
|
-
) : userProps.icon ? (
|
|
68
|
-
<Slots.icon {...iconProps} accessible={false} />
|
|
69
|
-
) : (
|
|
70
|
-
svgIconsEnabled && <SvgXml xml={fallBackIconXml} />
|
|
71
|
-
)}
|
|
72
|
-
</Slots.initialsBackground>
|
|
73
|
-
)}
|
|
74
|
-
{showRing && !transparentRing && <Slots.ring />}
|
|
75
|
-
{svgIconsEnabled && showBadge && <Slots.badge {...badge} />}
|
|
76
|
-
</Slots.root>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
});
|
package/src/JSAvatar.types.ts
DELETED
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
2
|
-
import { ImageProps, ViewProps, TextProps, ColorValue } from 'react-native';
|
|
3
|
-
import { IBackgroundColorTokens, IForegroundColorTokens, IBorderTokens, FontTokens } from '@fluentui-react-native/tokens';
|
|
4
|
-
import { BadgeProps, PresenceBadgeProps, BadgeSize } from '@fluentui-react-native/badge';
|
|
5
|
-
import { IconProps, IconSourcesType } from '@fluentui-react-native/icon';
|
|
6
|
-
|
|
7
|
-
export const JSAvatarName = 'Avatar';
|
|
8
|
-
export const AvatarSizesForTokens = [
|
|
9
|
-
'size20',
|
|
10
|
-
'size24',
|
|
11
|
-
'size28',
|
|
12
|
-
'size32',
|
|
13
|
-
'size36',
|
|
14
|
-
'size40',
|
|
15
|
-
'size48',
|
|
16
|
-
'size56',
|
|
17
|
-
'size64',
|
|
18
|
-
'size72',
|
|
19
|
-
'size96',
|
|
20
|
-
'size120',
|
|
21
|
-
] as const;
|
|
22
|
-
|
|
23
|
-
export const AvatarSizes = [20, 24, 28, 32, 36, 40, 48, 56, 64, 72, 96, 120] as const;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Sets color of the avatar when there is no picture. Uses fluent color names
|
|
27
|
-
*/
|
|
28
|
-
export const AvatarColors = [
|
|
29
|
-
'darkRed',
|
|
30
|
-
'cranberry',
|
|
31
|
-
'red',
|
|
32
|
-
'pumpkin',
|
|
33
|
-
'peach',
|
|
34
|
-
'marigold',
|
|
35
|
-
'gold',
|
|
36
|
-
'brass',
|
|
37
|
-
'brown',
|
|
38
|
-
'forest',
|
|
39
|
-
'seafoam',
|
|
40
|
-
'darkGreen',
|
|
41
|
-
'lightTeal',
|
|
42
|
-
'teal',
|
|
43
|
-
'steel',
|
|
44
|
-
'blue',
|
|
45
|
-
'royalBlue',
|
|
46
|
-
'cornflower',
|
|
47
|
-
'navy',
|
|
48
|
-
'lavender',
|
|
49
|
-
'purple',
|
|
50
|
-
'grape',
|
|
51
|
-
'lilac',
|
|
52
|
-
'pink',
|
|
53
|
-
'magenta',
|
|
54
|
-
'plum',
|
|
55
|
-
'beige',
|
|
56
|
-
'mink',
|
|
57
|
-
'platinum',
|
|
58
|
-
'anchor',
|
|
59
|
-
'burgundy',
|
|
60
|
-
'hotPink',
|
|
61
|
-
'orchid',
|
|
62
|
-
] as const;
|
|
63
|
-
export const ColorSchemes = ['neutral', 'brand', 'colorful'] as const;
|
|
64
|
-
export type AvatarSize = typeof AvatarSizes[number];
|
|
65
|
-
export type AvatarNamedColor = typeof AvatarColors[number];
|
|
66
|
-
export type AvatarColorSchemes = typeof ColorSchemes[number];
|
|
67
|
-
|
|
68
|
-
export type AvatarShape = 'circular' | 'square';
|
|
69
|
-
export type AvatarActive = 'active' | 'inactive' | 'unset';
|
|
70
|
-
export type AvatarActiveAppearance = 'ring';
|
|
71
|
-
export type AvatarColor = AvatarColorSchemes | AvatarNamedColor | ColorValue;
|
|
72
|
-
export type IconAlignment = 'start' | 'center' | 'end';
|
|
73
|
-
|
|
74
|
-
export interface RingConfig {
|
|
75
|
-
transparent?: boolean;
|
|
76
|
-
ringThickness?: number;
|
|
77
|
-
innerGap?: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface AvatarConfigurableProps {
|
|
81
|
-
/**
|
|
82
|
-
* The color when displaying either an icon or initials.
|
|
83
|
-
* * neutral (default): gray
|
|
84
|
-
* * brand: color from the brand palette
|
|
85
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
86
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
87
|
-
*
|
|
88
|
-
* @defaultvalue neutral
|
|
89
|
-
*/
|
|
90
|
-
avatarColor?: AvatarColor;
|
|
91
|
-
initialsColor?: ColorValue;
|
|
92
|
-
ring?: RingConfig;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Size of the avatar in pixels.
|
|
96
|
-
*
|
|
97
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
98
|
-
* based on design guidelines for the Avatar control.
|
|
99
|
-
*
|
|
100
|
-
* @defaultvalue 24
|
|
101
|
-
*/
|
|
102
|
-
size?: AvatarSize;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface JSAvatarProps extends IViewProps, AvatarConfigurableProps {
|
|
106
|
-
/**
|
|
107
|
-
* Optional activity indicator
|
|
108
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
109
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
110
|
-
* * unset: normal display
|
|
111
|
-
*
|
|
112
|
-
* @defaultvalue unset
|
|
113
|
-
*/
|
|
114
|
-
active?: AvatarActive;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* The appearance when `active="active"`
|
|
118
|
-
*
|
|
119
|
-
* @defaultvalue ring
|
|
120
|
-
*/
|
|
121
|
-
activeAppearance?: AvatarActiveAppearance;
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Badge shows the avatar's presence status.
|
|
125
|
-
* Badge can be shown only if `active` prop is undefined or unset
|
|
126
|
-
*/
|
|
127
|
-
badge?: PresenceBadgeProps;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Icon to be displayed when the avatar doesn't have an image or initials.
|
|
131
|
-
*
|
|
132
|
-
* @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
|
|
133
|
-
*/
|
|
134
|
-
icon?: IconSourcesType;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
138
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
139
|
-
*/
|
|
140
|
-
idForColor?: string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* (optional) Custom initials.
|
|
144
|
-
*
|
|
145
|
-
* It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
|
|
146
|
-
* using the `getInitials` function.
|
|
147
|
-
*
|
|
148
|
-
* The initials are displayed when there is no image (including while the image is loading).
|
|
149
|
-
*/
|
|
150
|
-
initials?: string;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* The name of the person or entity represented by this Avatar. This should always be provided if it is available.
|
|
154
|
-
*
|
|
155
|
-
* The name will be used to determine the initials displayed when there is no icon, as well as provided to
|
|
156
|
-
* accessibility tools.
|
|
157
|
-
*/
|
|
158
|
-
name?: string;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* The avatar can have a circular or square shape.
|
|
162
|
-
* @defaultvalue circular
|
|
163
|
-
*/
|
|
164
|
-
shape?: AvatarShape;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Shorthand for passing image URL instead of using `image` prop
|
|
168
|
-
*/
|
|
169
|
-
imageUrl?: string;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export interface JSAvatarTokens extends IBackgroundColorTokens, IForegroundColorTokens, AvatarConfigurableProps, IBorderTokens, FontTokens {
|
|
173
|
-
iconColor?: ColorValue;
|
|
174
|
-
iconSize?: number;
|
|
175
|
-
horizontalIconAlignment?: IconAlignment;
|
|
176
|
-
verticalIconAlignment?: IconAlignment;
|
|
177
|
-
circular?: JSAvatarTokens;
|
|
178
|
-
ringColor?: ColorValue;
|
|
179
|
-
ringBackgroundColor?: ColorValue;
|
|
180
|
-
square?: JSAvatarTokens;
|
|
181
|
-
inactive?: JSAvatarTokens;
|
|
182
|
-
avatarOpacity?: number;
|
|
183
|
-
size20?: JSAvatarTokens;
|
|
184
|
-
size24?: JSAvatarTokens;
|
|
185
|
-
size28?: JSAvatarTokens;
|
|
186
|
-
size32?: JSAvatarTokens;
|
|
187
|
-
size36?: JSAvatarTokens;
|
|
188
|
-
size40?: JSAvatarTokens;
|
|
189
|
-
size48?: JSAvatarTokens;
|
|
190
|
-
size56?: JSAvatarTokens;
|
|
191
|
-
size64?: JSAvatarTokens;
|
|
192
|
-
size72?: JSAvatarTokens;
|
|
193
|
-
size96?: JSAvatarTokens;
|
|
194
|
-
size120?: JSAvatarTokens;
|
|
195
|
-
badgeSize?: BadgeSize;
|
|
196
|
-
neutral?: JSAvatarTokens;
|
|
197
|
-
brand?: JSAvatarTokens;
|
|
198
|
-
darkRed?: JSAvatarTokens;
|
|
199
|
-
cranberry?: JSAvatarTokens;
|
|
200
|
-
red?: JSAvatarTokens;
|
|
201
|
-
pumpkin?: JSAvatarTokens;
|
|
202
|
-
peach?: JSAvatarTokens;
|
|
203
|
-
marigold?: JSAvatarTokens;
|
|
204
|
-
gold?: JSAvatarTokens;
|
|
205
|
-
brass?: JSAvatarTokens;
|
|
206
|
-
brown?: JSAvatarTokens;
|
|
207
|
-
forest?: JSAvatarTokens;
|
|
208
|
-
seafoam?: JSAvatarTokens;
|
|
209
|
-
darkGreen?: JSAvatarTokens;
|
|
210
|
-
lightTeal?: JSAvatarTokens;
|
|
211
|
-
teal?: JSAvatarTokens;
|
|
212
|
-
steel?: JSAvatarTokens;
|
|
213
|
-
blue?: JSAvatarTokens;
|
|
214
|
-
royalBlue?: JSAvatarTokens;
|
|
215
|
-
cornflower?: JSAvatarTokens;
|
|
216
|
-
navy?: JSAvatarTokens;
|
|
217
|
-
lavender?: JSAvatarTokens;
|
|
218
|
-
purple?: JSAvatarTokens;
|
|
219
|
-
grape?: JSAvatarTokens;
|
|
220
|
-
lilac?: JSAvatarTokens;
|
|
221
|
-
pink?: JSAvatarTokens;
|
|
222
|
-
magenta?: JSAvatarTokens;
|
|
223
|
-
plum?: JSAvatarTokens;
|
|
224
|
-
beige?: JSAvatarTokens;
|
|
225
|
-
mink?: JSAvatarTokens;
|
|
226
|
-
platinum?: JSAvatarTokens;
|
|
227
|
-
anchor?: JSAvatarTokens;
|
|
228
|
-
burgundy?: JSAvatarTokens;
|
|
229
|
-
hotPink?: JSAvatarTokens;
|
|
230
|
-
orchid?: JSAvatarTokens;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
export interface AvatarSlotProps {
|
|
234
|
-
root: ViewProps;
|
|
235
|
-
image: ImageProps;
|
|
236
|
-
initials: TextProps;
|
|
237
|
-
initialsBackground: ViewProps;
|
|
238
|
-
icon: IconProps;
|
|
239
|
-
ring: ViewProps;
|
|
240
|
-
badge: BadgeProps;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export interface JSAvatarState {
|
|
244
|
-
showRing: boolean;
|
|
245
|
-
transparentRing: boolean;
|
|
246
|
-
showBadge: boolean;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export interface AvatarInfo {
|
|
250
|
-
props: JSAvatarProps;
|
|
251
|
-
state: JSAvatarState;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export interface JSAvatarType {
|
|
255
|
-
props: JSAvatarProps;
|
|
256
|
-
slotProps: AvatarSlotProps;
|
|
257
|
-
tokens: JSAvatarTokens;
|
|
258
|
-
state: JSAvatarState;
|
|
259
|
-
}
|