@fluentui/react-avatar 9.0.0-rc.5 → 9.0.0-rc.8
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 +224 -1
- package/CHANGELOG.md +179 -128
- package/SPEC-AvatarGroup.md +185 -0
- package/dist/{react-avatar.d.ts → index.d.ts} +103 -1
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/AvatarGroup.js +2 -0
- package/lib/AvatarGroup.js.map +1 -0
- package/lib/components/Avatar/Avatar.types.js.map +1 -1
- package/lib/components/Avatar/useAvatarStyles.js +21 -10
- package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib/components/AvatarGroup/AvatarGroup.js +15 -0
- package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/lib/components/AvatarGroup/AvatarGroup.strings.js +4 -0
- package/lib/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
- package/lib/components/AvatarGroup/AvatarGroup.types.js +2 -0
- package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
- package/lib/components/AvatarGroup/index.js +6 -0
- package/lib/components/AvatarGroup/index.js.map +1 -0
- package/lib/components/AvatarGroup/renderAvatarGroup.js +16 -0
- package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
- package/lib/components/AvatarGroup/useAvatarGroup.js +60 -0
- package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -0
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js +37 -0
- package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/AvatarGroup.js +10 -0
- package/lib-commonjs/AvatarGroup.js.map +1 -0
- package/lib-commonjs/components/Avatar/useAvatarStyles.js +22 -11
- package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +26 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js +10 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +6 -0
- package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/index.js +18 -0
- package/lib-commonjs/components/AvatarGroup/index.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +27 -0
- package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +73 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +47 -0
- package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
- package/lib-commonjs/index.js +80 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +15 -21
- package/lib/Avatar.d.ts +0 -1
- package/lib/components/Avatar/Avatar.d.ts +0 -3
- package/lib/components/Avatar/Avatar.types.d.ts +0 -107
- package/lib/components/Avatar/index.d.ts +0 -5
- package/lib/components/Avatar/renderAvatar.d.ts +0 -2
- package/lib/components/Avatar/useAvatar.d.ts +0 -3
- package/lib/components/Avatar/useAvatarStyles.d.ts +0 -3
- package/lib/index.d.ts +0 -2
- package/lib/utils/getInitials.d.ts +0 -14
- package/lib/utils/index.d.ts +0 -1
- package/lib-commonjs/Avatar.d.ts +0 -1
- package/lib-commonjs/components/Avatar/Avatar.d.ts +0 -3
- package/lib-commonjs/components/Avatar/Avatar.types.d.ts +0 -107
- package/lib-commonjs/components/Avatar/index.d.ts +0 -5
- package/lib-commonjs/components/Avatar/renderAvatar.d.ts +0 -2
- package/lib-commonjs/components/Avatar/useAvatar.d.ts +0 -3
- package/lib-commonjs/components/Avatar/useAvatarStyles.d.ts +0 -3
- package/lib-commonjs/index.d.ts +0 -2
- package/lib-commonjs/utils/getInitials.d.ts +0 -14
- package/lib-commonjs/utils/index.d.ts +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAvatarGroupStyles_unstable = exports.extraAvatarGroupClassNames = exports.avatarGroupClassNames = void 0;
|
|
7
|
+
|
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
|
9
|
+
|
|
10
|
+
exports.avatarGroupClassNames = {
|
|
11
|
+
root: 'fui-AvatarGroup',
|
|
12
|
+
popoverSurface: 'fui-AvatarGroup__popoverSurface',
|
|
13
|
+
popoverTrigger: 'fui-AvatarGroup__popoverTrigger'
|
|
14
|
+
};
|
|
15
|
+
exports.extraAvatarGroupClassNames = {
|
|
16
|
+
popoverSurfaceItem: 'fui-AvatarGroup__popoverSurfaceItem'
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Styles for the root slot
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
|
23
|
+
"root": {}
|
|
24
|
+
}, {});
|
|
25
|
+
/**
|
|
26
|
+
* Apply styling to the AvatarGroup slots based on the state
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
const useAvatarGroupStyles_unstable = state => {
|
|
31
|
+
const styles = useStyles();
|
|
32
|
+
state.root.className = react_1.mergeClasses(exports.avatarGroupClassNames.root, styles.root, state.root.className); // TODO Add class names to slots, for example:
|
|
33
|
+
// state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
|
|
34
|
+
|
|
35
|
+
if (state.popoverSurface) {
|
|
36
|
+
state.popoverSurface.className = react_1.mergeClasses(exports.avatarGroupClassNames.popoverSurface, state.popoverSurface.className);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (state.popoverTrigger) {
|
|
40
|
+
state.popoverTrigger.className = react_1.mergeClasses(exports.avatarGroupClassNames.popoverTrigger, state.popoverTrigger.className);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.useAvatarGroupStyles_unstable = useAvatarGroupStyles_unstable;
|
|
47
|
+
//# sourceMappingURL=useAvatarGroupStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/AvatarGroup/useAvatarGroupStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAIa,OAAA,CAAA,qBAAA,GAA0D;AACrE,EAAA,IAAI,EAAE,iBAD+D;AAErE,EAAA,cAAc,EAAE,iCAFqD;AAGrE,EAAA,cAAc,EAAE;AAHqD,CAA1D;AAMA,OAAA,CAAA,0BAAA,GAA6B;AACxC,EAAA,kBAAkB,EAAE;AADoB,CAA7B;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;AAAA;AAAA,MAAlB;AAQA;;AAEG;;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA8C;AACzF,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,IAAnC,EAAyC,MAAM,CAAC,IAAhD,EAAsD,KAAK,CAAC,IAAN,CAAW,SAAjE,CAAvB,CAFyF,CAIzF;AACA;;AAEA,MAAI,KAAK,CAAC,cAAV,EAA0B;AACxB,IAAA,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,cAAnC,EAAmD,KAAK,CAAC,cAAN,CAAqB,SAAxE,CAAjC;AACD;;AAED,MAAI,KAAK,CAAC,cAAV,EAA0B;AACxB,IAAA,KAAK,CAAC,cAAN,CAAqB,SAArB,GAAiC,OAAA,CAAA,YAAA,CAAa,OAAA,CAAA,qBAAA,CAAsB,cAAnC,EAAmD,KAAK,CAAC,cAAN,CAAqB,SAAxE,CAAjC;AACD;;AAED,SAAO,KAAP;AACD,CAhBM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { AvatarGroupSlots, AvatarGroupState } from './AvatarGroup.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const avatarGroupClassNames: SlotClassNames<AvatarGroupSlots> = {\n root: 'fui-AvatarGroup',\n popoverSurface: 'fui-AvatarGroup__popoverSurface',\n popoverTrigger: 'fui-AvatarGroup__popoverTrigger',\n};\n\nexport const extraAvatarGroupClassNames = {\n popoverSurfaceItem: 'fui-AvatarGroup__popoverSurfaceItem',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n // TODO Add default styles for the root element\n },\n\n // TODO add additional classes for different states and/or slots\n});\n\n/**\n * Apply styling to the AvatarGroup slots based on the state\n */\nexport const useAvatarGroupStyles_unstable = (state: AvatarGroupState): AvatarGroupState => {\n const styles = useStyles();\n state.root.className = mergeClasses(avatarGroupClassNames.root, styles.root, state.root.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n if (state.popoverSurface) {\n state.popoverSurface.className = mergeClasses(avatarGroupClassNames.popoverSurface, state.popoverSurface.className);\n }\n\n if (state.popoverTrigger) {\n state.popoverTrigger.className = mergeClasses(avatarGroupClassNames.popoverTrigger, state.popoverTrigger.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -3,10 +3,87 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.useAvatarGroup_unstable = exports.useAvatarGroupStyles_unstable = exports.renderAvatarGroup_unstable = exports.avatarGroupClassNames = exports.AvatarGroup = exports.getInitials = exports.useAvatar_unstable = exports.useAvatarStyles_unstable = exports.renderAvatar_unstable = exports.avatarClassNames = exports.avatarClassName = exports.Avatar = void 0;
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
var Avatar_1 = /*#__PURE__*/require("./Avatar");
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Object.defineProperty(exports, "Avatar", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return Avatar_1.Avatar;
|
|
14
|
+
}
|
|
15
|
+
}); // eslint-disable-next-line deprecation/deprecation
|
|
10
16
|
|
|
11
|
-
|
|
17
|
+
Object.defineProperty(exports, "avatarClassName", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return Avatar_1.avatarClassName;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "avatarClassNames", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () {
|
|
26
|
+
return Avatar_1.avatarClassNames;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
Object.defineProperty(exports, "renderAvatar_unstable", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () {
|
|
32
|
+
return Avatar_1.renderAvatar_unstable;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "useAvatarStyles_unstable", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () {
|
|
38
|
+
return Avatar_1.useAvatarStyles_unstable;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(exports, "useAvatar_unstable", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return Avatar_1.useAvatar_unstable;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
var index_1 = /*#__PURE__*/require("./utils/index");
|
|
49
|
+
|
|
50
|
+
Object.defineProperty(exports, "getInitials", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () {
|
|
53
|
+
return index_1.getInitials;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
var AvatarGroup_1 = /*#__PURE__*/require("./AvatarGroup");
|
|
58
|
+
|
|
59
|
+
Object.defineProperty(exports, "AvatarGroup", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () {
|
|
62
|
+
return AvatarGroup_1.AvatarGroup;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "avatarGroupClassNames", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return AvatarGroup_1.avatarGroupClassNames;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(exports, "renderAvatarGroup_unstable", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function () {
|
|
74
|
+
return AvatarGroup_1.renderAvatarGroup_unstable;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "useAvatarGroupStyles_unstable", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return AvatarGroup_1.useAvatarGroupStyles_unstable;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "useAvatarGroup_unstable", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function () {
|
|
86
|
+
return AvatarGroup_1.useAvatarGroup_unstable;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
12
89
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,QAAA,gBAAA,OAAA,CAAA,UAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,QAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,QAAA,CAAA,MAAA;AAAM;AAAN,CAAA,E,CACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,QAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,QAAA,CAAA,gBAAA;AAAgB;AAAhB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,QAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,0BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,QAAA,CAAA,wBAAA;AAAwB;AAAxB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,oBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,QAAA,CAAA,kBAAA;AAAkB;AAAlB,CAAA;;AAGF,IAAA,OAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,WAAA;AAAW;AAAX,CAAA;;AACT,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,WAAA;AAAW;AAAX,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,uBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,qBAAA;AAAqB;AAArB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,+BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,6BAAA;AAA6B;AAA7B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,aAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA","sourcesContent":["export {\n Avatar,\n // eslint-disable-next-line deprecation/deprecation\n avatarClassName,\n avatarClassNames,\n renderAvatar_unstable,\n useAvatarStyles_unstable,\n useAvatar_unstable,\n} from './Avatar';\nexport type { AvatarNamedColor, AvatarProps, AvatarSlots, AvatarState, AvatarSizes } from './Avatar';\nexport { getInitials } from './utils/index';\nexport {\n AvatarGroup,\n avatarGroupClassNames,\n renderAvatarGroup_unstable,\n useAvatarGroupStyles_unstable,\n useAvatarGroup_unstable,\n} from './AvatarGroup';\nexport type { AvatarGroupProps, AvatarGroupSlots, AvatarGroupState } from './AvatarGroup';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-avatar",
|
|
3
|
-
"version": "9.0.0-rc.
|
|
3
|
+
"version": "9.0.0-rc.8",
|
|
4
4
|
"description": "React components for building Microsoft web experiences.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
7
|
-
"typings": "
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -21,33 +21,27 @@
|
|
|
21
21
|
"start": "yarn storybook",
|
|
22
22
|
"test": "jest --passWithNoTests",
|
|
23
23
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
|
24
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node
|
|
25
|
-
"storybook": "node
|
|
24
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-avatar/src && yarn docs",
|
|
25
|
+
"storybook": "node ../../../scripts/storybook/runner",
|
|
26
26
|
"type-check": "tsc -b tsconfig.json"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
|
30
30
|
"@fluentui/react-conformance": "*",
|
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.5",
|
|
32
32
|
"@fluentui/scripts": "^1.0.0",
|
|
33
|
-
"
|
|
34
|
-
"@types/enzyme-adapter-react-16": "1.0.3",
|
|
35
|
-
"@types/react": "16.9.42",
|
|
36
|
-
"@types/react-dom": "16.9.10",
|
|
37
|
-
"@types/react-test-renderer": "^16.0.0",
|
|
38
|
-
"enzyme": "~3.10.0",
|
|
39
|
-
"enzyme-adapter-react-16": "^1.15.0",
|
|
40
|
-
"es6-weak-map": "^2.0.2",
|
|
41
|
-
"react": "16.8.6",
|
|
42
|
-
"react-dom": "16.8.6",
|
|
43
|
-
"react-test-renderer": "^16.3.0"
|
|
33
|
+
"es6-weak-map": "^2.0.2"
|
|
44
34
|
},
|
|
45
35
|
"dependencies": {
|
|
46
|
-
"@fluentui/react-badge": "9.0.0-rc.
|
|
47
|
-
"@fluentui/react-
|
|
48
|
-
"@fluentui/react-
|
|
49
|
-
"@fluentui/react-
|
|
50
|
-
"@
|
|
36
|
+
"@fluentui/react-badge": "9.0.0-rc.8",
|
|
37
|
+
"@fluentui/react-button": "9.0.0-rc.9",
|
|
38
|
+
"@fluentui/react-icons": "^2.0.166-rc.3",
|
|
39
|
+
"@fluentui/react-popover": "9.0.0-rc.9",
|
|
40
|
+
"@fluentui/react-tooltip": "9.0.0-rc.9",
|
|
41
|
+
"@fluentui/react-theme": "9.0.0-rc.7",
|
|
42
|
+
"@fluentui/react-shared-contexts": "9.0.0-rc.7",
|
|
43
|
+
"@fluentui/react-utilities": "9.0.0-rc.8",
|
|
44
|
+
"@griffel/react": "1.0.3",
|
|
51
45
|
"tslib": "^2.1.0"
|
|
52
46
|
},
|
|
53
47
|
"peerDependencies": {
|
package/lib/Avatar.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Avatar/index';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { PresenceBadge } from '@fluentui/react-badge';
|
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
|
-
export declare type AvatarSlots = {
|
|
4
|
-
root: Slot<'span'>;
|
|
5
|
-
/**
|
|
6
|
-
* The Avatar's image.
|
|
7
|
-
*
|
|
8
|
-
* Usage e.g.: `image={{ src: '...' }}`
|
|
9
|
-
*/
|
|
10
|
-
image?: Slot<'img'>;
|
|
11
|
-
/**
|
|
12
|
-
* (optional) Custom initials.
|
|
13
|
-
*
|
|
14
|
-
* It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
|
|
15
|
-
* using the `getInitials` function.
|
|
16
|
-
*
|
|
17
|
-
* The initials are displayed when there is no image (including while the image is loading).
|
|
18
|
-
*/
|
|
19
|
-
initials?: Slot<'span'>;
|
|
20
|
-
/**
|
|
21
|
-
* Icon to be displayed when the avatar doesn't have an image or initials.
|
|
22
|
-
*
|
|
23
|
-
* @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
|
|
24
|
-
*/
|
|
25
|
-
icon?: Slot<'span'>;
|
|
26
|
-
/**
|
|
27
|
-
* Badge to show the avatar's presence status.
|
|
28
|
-
*/
|
|
29
|
-
badge?: Slot<typeof PresenceBadge>;
|
|
30
|
-
};
|
|
31
|
-
declare type AvatarCommons = {
|
|
32
|
-
/**
|
|
33
|
-
* The name of the person or entity represented by this Avatar. This should always be provided if it is available.
|
|
34
|
-
*
|
|
35
|
-
* The name will be used to determine the initials displayed when there is no icon, as well as provided to
|
|
36
|
-
* accessibility tools.
|
|
37
|
-
*/
|
|
38
|
-
name?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Size of the avatar in pixels.
|
|
41
|
-
*
|
|
42
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
43
|
-
* based on design guidelines for the Avatar control.
|
|
44
|
-
*
|
|
45
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
46
|
-
* to override the rendered size.
|
|
47
|
-
*
|
|
48
|
-
* For example, to set the avatar to 45px in size:
|
|
49
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
50
|
-
*
|
|
51
|
-
* @defaultvalue 32
|
|
52
|
-
*/
|
|
53
|
-
size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
54
|
-
/**
|
|
55
|
-
* The avatar can have a circular or square shape.
|
|
56
|
-
* @defaultvalue circular
|
|
57
|
-
*/
|
|
58
|
-
shape: 'circular' | 'square';
|
|
59
|
-
/**
|
|
60
|
-
* Optional activity indicator
|
|
61
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
62
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
63
|
-
* * unset: normal display
|
|
64
|
-
*
|
|
65
|
-
* @defaultvalue unset
|
|
66
|
-
*/
|
|
67
|
-
active: 'active' | 'inactive' | 'unset';
|
|
68
|
-
/**
|
|
69
|
-
* The appearance when `active="active"`
|
|
70
|
-
*
|
|
71
|
-
* @defaultvalue ring
|
|
72
|
-
*/
|
|
73
|
-
activeAppearance: 'ring' | 'shadow' | 'ring-shadow';
|
|
74
|
-
/**
|
|
75
|
-
* The color when displaying either an icon or initials.
|
|
76
|
-
* * neutral (default): gray
|
|
77
|
-
* * brand: color from the brand palette
|
|
78
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
79
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
80
|
-
*
|
|
81
|
-
* @defaultvalue neutral
|
|
82
|
-
*/
|
|
83
|
-
color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
84
|
-
/**
|
|
85
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
86
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
87
|
-
*/
|
|
88
|
-
idForColor: string | undefined;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* A specific named color for the Avatar
|
|
92
|
-
*/
|
|
93
|
-
export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
|
|
94
|
-
/**
|
|
95
|
-
* Properties for Avatar
|
|
96
|
-
*/
|
|
97
|
-
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & Partial<AvatarCommons>;
|
|
98
|
-
/**
|
|
99
|
-
* State used in rendering Avatar
|
|
100
|
-
*/
|
|
101
|
-
export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
|
|
102
|
-
/**
|
|
103
|
-
* The Avatar's color, with `'colorful'` resolved to a named color
|
|
104
|
-
*/
|
|
105
|
-
color: Exclude<AvatarCommons['color'], 'colorful'>;
|
|
106
|
-
};
|
|
107
|
-
export {};
|
package/lib/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regular expressions matching characters to ignore when calculating the initials.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Get (up to 2 characters) initials based on display name of the persona.
|
|
6
|
-
*
|
|
7
|
-
* @param displayName - The full name of the person or entity
|
|
8
|
-
* @param isRtl - Whether the display is in RTL
|
|
9
|
-
* @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
|
|
10
|
-
*
|
|
11
|
-
* @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
|
|
12
|
-
* could be derived from the name.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
|
package/lib/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getInitials } from './getInitials';
|
package/lib-commonjs/Avatar.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/Avatar/index';
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { PresenceBadge } from '@fluentui/react-badge';
|
|
2
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
|
-
export declare type AvatarSlots = {
|
|
4
|
-
root: Slot<'span'>;
|
|
5
|
-
/**
|
|
6
|
-
* The Avatar's image.
|
|
7
|
-
*
|
|
8
|
-
* Usage e.g.: `image={{ src: '...' }}`
|
|
9
|
-
*/
|
|
10
|
-
image?: Slot<'img'>;
|
|
11
|
-
/**
|
|
12
|
-
* (optional) Custom initials.
|
|
13
|
-
*
|
|
14
|
-
* It is usually not necessary to specify custom initials; by default they will be derived from the `name` prop,
|
|
15
|
-
* using the `getInitials` function.
|
|
16
|
-
*
|
|
17
|
-
* The initials are displayed when there is no image (including while the image is loading).
|
|
18
|
-
*/
|
|
19
|
-
initials?: Slot<'span'>;
|
|
20
|
-
/**
|
|
21
|
-
* Icon to be displayed when the avatar doesn't have an image or initials.
|
|
22
|
-
*
|
|
23
|
-
* @defaultvalue `PersonRegular` (the default icon's size depends on the Avatar's size)
|
|
24
|
-
*/
|
|
25
|
-
icon?: Slot<'span'>;
|
|
26
|
-
/**
|
|
27
|
-
* Badge to show the avatar's presence status.
|
|
28
|
-
*/
|
|
29
|
-
badge?: Slot<typeof PresenceBadge>;
|
|
30
|
-
};
|
|
31
|
-
declare type AvatarCommons = {
|
|
32
|
-
/**
|
|
33
|
-
* The name of the person or entity represented by this Avatar. This should always be provided if it is available.
|
|
34
|
-
*
|
|
35
|
-
* The name will be used to determine the initials displayed when there is no icon, as well as provided to
|
|
36
|
-
* accessibility tools.
|
|
37
|
-
*/
|
|
38
|
-
name?: string;
|
|
39
|
-
/**
|
|
40
|
-
* Size of the avatar in pixels.
|
|
41
|
-
*
|
|
42
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
43
|
-
* based on design guidelines for the Avatar control.
|
|
44
|
-
*
|
|
45
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
46
|
-
* to override the rendered size.
|
|
47
|
-
*
|
|
48
|
-
* For example, to set the avatar to 45px in size:
|
|
49
|
-
* `<Avatar size={40} style={{ width: '45px', height: '45px' }} />`
|
|
50
|
-
*
|
|
51
|
-
* @defaultvalue 32
|
|
52
|
-
*/
|
|
53
|
-
size: 20 | 24 | 28 | 32 | 36 | 40 | 48 | 56 | 64 | 72 | 96 | 120 | 128;
|
|
54
|
-
/**
|
|
55
|
-
* The avatar can have a circular or square shape.
|
|
56
|
-
* @defaultvalue circular
|
|
57
|
-
*/
|
|
58
|
-
shape: 'circular' | 'square';
|
|
59
|
-
/**
|
|
60
|
-
* Optional activity indicator
|
|
61
|
-
* * active: the avatar will be decorated according to activeAppearance
|
|
62
|
-
* * inactive: the avatar will be reduced in size and partially transparent
|
|
63
|
-
* * unset: normal display
|
|
64
|
-
*
|
|
65
|
-
* @defaultvalue unset
|
|
66
|
-
*/
|
|
67
|
-
active: 'active' | 'inactive' | 'unset';
|
|
68
|
-
/**
|
|
69
|
-
* The appearance when `active="active"`
|
|
70
|
-
*
|
|
71
|
-
* @defaultvalue ring
|
|
72
|
-
*/
|
|
73
|
-
activeAppearance: 'ring' | 'shadow' | 'ring-shadow';
|
|
74
|
-
/**
|
|
75
|
-
* The color when displaying either an icon or initials.
|
|
76
|
-
* * neutral (default): gray
|
|
77
|
-
* * brand: color from the brand palette
|
|
78
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or idForColor if provided)
|
|
79
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
80
|
-
*
|
|
81
|
-
* @defaultvalue neutral
|
|
82
|
-
*/
|
|
83
|
-
color: 'neutral' | 'brand' | 'colorful' | AvatarNamedColor;
|
|
84
|
-
/**
|
|
85
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
86
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
87
|
-
*/
|
|
88
|
-
idForColor: string | undefined;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* A specific named color for the Avatar
|
|
92
|
-
*/
|
|
93
|
-
export declare type AvatarNamedColor = 'darkRed' | 'cranberry' | 'red' | 'pumpkin' | 'peach' | 'marigold' | 'gold' | 'brass' | 'brown' | 'forest' | 'seafoam' | 'darkGreen' | 'lightTeal' | 'teal' | 'steel' | 'blue' | 'royalBlue' | 'cornflower' | 'navy' | 'lavender' | 'purple' | 'grape' | 'lilac' | 'pink' | 'magenta' | 'plum' | 'beige' | 'mink' | 'platinum' | 'anchor';
|
|
94
|
-
/**
|
|
95
|
-
* Properties for Avatar
|
|
96
|
-
*/
|
|
97
|
-
export declare type AvatarProps = Omit<ComponentProps<AvatarSlots>, 'color'> & Partial<AvatarCommons>;
|
|
98
|
-
/**
|
|
99
|
-
* State used in rendering Avatar
|
|
100
|
-
*/
|
|
101
|
-
export declare type AvatarState = ComponentState<AvatarSlots> & AvatarCommons & {
|
|
102
|
-
/**
|
|
103
|
-
* The Avatar's color, with `'colorful'` resolved to a named color
|
|
104
|
-
*/
|
|
105
|
-
color: Exclude<AvatarCommons['color'], 'colorful'>;
|
|
106
|
-
};
|
|
107
|
-
export {};
|
package/lib-commonjs/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Regular expressions matching characters to ignore when calculating the initials.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Get (up to 2 characters) initials based on display name of the persona.
|
|
6
|
-
*
|
|
7
|
-
* @param displayName - The full name of the person or entity
|
|
8
|
-
* @param isRtl - Whether the display is in RTL
|
|
9
|
-
* @param allowPhoneInitials - Should initials be generated from phone numbers (default false)
|
|
10
|
-
*
|
|
11
|
-
* @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
|
|
12
|
-
* could be derived from the name.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getInitials(displayName: string | undefined | null, isRtl: boolean, allowPhoneInitials?: boolean): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getInitials } from './getInitials';
|