@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.
Files changed (67) hide show
  1. package/CHANGELOG.json +224 -1
  2. package/CHANGELOG.md +179 -128
  3. package/SPEC-AvatarGroup.md +185 -0
  4. package/dist/{react-avatar.d.ts → index.d.ts} +103 -1
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/AvatarGroup.js +2 -0
  7. package/lib/AvatarGroup.js.map +1 -0
  8. package/lib/components/Avatar/Avatar.types.js.map +1 -1
  9. package/lib/components/Avatar/useAvatarStyles.js +21 -10
  10. package/lib/components/Avatar/useAvatarStyles.js.map +1 -1
  11. package/lib/components/AvatarGroup/AvatarGroup.js +15 -0
  12. package/lib/components/AvatarGroup/AvatarGroup.js.map +1 -0
  13. package/lib/components/AvatarGroup/AvatarGroup.strings.js +4 -0
  14. package/lib/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
  15. package/lib/components/AvatarGroup/AvatarGroup.types.js +2 -0
  16. package/lib/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  17. package/lib/components/AvatarGroup/index.js +6 -0
  18. package/lib/components/AvatarGroup/index.js.map +1 -0
  19. package/lib/components/AvatarGroup/renderAvatarGroup.js +16 -0
  20. package/lib/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  21. package/lib/components/AvatarGroup/useAvatarGroup.js +60 -0
  22. package/lib/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  23. package/lib/components/AvatarGroup/useAvatarGroupStyles.js +37 -0
  24. package/lib/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  25. package/lib/index.js +4 -2
  26. package/lib/index.js.map +1 -1
  27. package/lib-commonjs/AvatarGroup.js +10 -0
  28. package/lib-commonjs/AvatarGroup.js.map +1 -0
  29. package/lib-commonjs/components/Avatar/useAvatarStyles.js +22 -11
  30. package/lib-commonjs/components/Avatar/useAvatarStyles.js.map +1 -1
  31. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js +26 -0
  32. package/lib-commonjs/components/AvatarGroup/AvatarGroup.js.map +1 -0
  33. package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js +10 -0
  34. package/lib-commonjs/components/AvatarGroup/AvatarGroup.strings.js.map +1 -0
  35. package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js +6 -0
  36. package/lib-commonjs/components/AvatarGroup/AvatarGroup.types.js.map +1 -0
  37. package/lib-commonjs/components/AvatarGroup/index.js +18 -0
  38. package/lib-commonjs/components/AvatarGroup/index.js.map +1 -0
  39. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js +27 -0
  40. package/lib-commonjs/components/AvatarGroup/renderAvatarGroup.js.map +1 -0
  41. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js +73 -0
  42. package/lib-commonjs/components/AvatarGroup/useAvatarGroup.js.map +1 -0
  43. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js +47 -0
  44. package/lib-commonjs/components/AvatarGroup/useAvatarGroupStyles.js.map +1 -0
  45. package/lib-commonjs/index.js +80 -3
  46. package/lib-commonjs/index.js.map +1 -1
  47. package/package.json +15 -21
  48. package/lib/Avatar.d.ts +0 -1
  49. package/lib/components/Avatar/Avatar.d.ts +0 -3
  50. package/lib/components/Avatar/Avatar.types.d.ts +0 -107
  51. package/lib/components/Avatar/index.d.ts +0 -5
  52. package/lib/components/Avatar/renderAvatar.d.ts +0 -2
  53. package/lib/components/Avatar/useAvatar.d.ts +0 -3
  54. package/lib/components/Avatar/useAvatarStyles.d.ts +0 -3
  55. package/lib/index.d.ts +0 -2
  56. package/lib/utils/getInitials.d.ts +0 -14
  57. package/lib/utils/index.d.ts +0 -1
  58. package/lib-commonjs/Avatar.d.ts +0 -1
  59. package/lib-commonjs/components/Avatar/Avatar.d.ts +0 -3
  60. package/lib-commonjs/components/Avatar/Avatar.types.d.ts +0 -107
  61. package/lib-commonjs/components/Avatar/index.d.ts +0 -5
  62. package/lib-commonjs/components/Avatar/renderAvatar.d.ts +0 -2
  63. package/lib-commonjs/components/Avatar/useAvatar.d.ts +0 -3
  64. package/lib-commonjs/components/Avatar/useAvatarStyles.d.ts +0 -3
  65. package/lib-commonjs/index.d.ts +0 -2
  66. package/lib-commonjs/utils/getInitials.d.ts +0 -14
  67. 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/"}
@@ -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
- const tslib_1 = /*#__PURE__*/require("tslib");
8
+ var Avatar_1 = /*#__PURE__*/require("./Avatar");
8
9
 
9
- tslib_1.__exportStar(require("./Avatar"), exports);
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
- tslib_1.__exportStar(require("./utils/index"), exports);
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":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Avatar';\nexport * from './utils/index';\n"],"sourceRoot":"../src/"}
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.5",
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": "lib/index.d.ts",
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 ../../scripts/typescript/normalize-import --output ./dist/packages/react-avatar/src && yarn docs",
25
- "storybook": "node ../../scripts/storybook/runner",
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.3",
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.5",
32
32
  "@fluentui/scripts": "^1.0.0",
33
- "@types/enzyme": "3.10.3",
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.5",
47
- "@fluentui/react-icons": "^2.0.159-beta.10",
48
- "@fluentui/react-theme": "9.0.0-rc.4",
49
- "@fluentui/react-utilities": "9.0.0-rc.5",
50
- "@griffel/react": "1.0.0",
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,3 +0,0 @@
1
- import type { AvatarProps } from './Avatar.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- export declare const Avatar: ForwardRefComponent<AvatarProps>;
@@ -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 {};
@@ -1,5 +0,0 @@
1
- export * from './Avatar.types';
2
- export * from './Avatar';
3
- export * from './renderAvatar';
4
- export * from './useAvatar';
5
- export * from './useAvatarStyles';
@@ -1,2 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const renderAvatar_unstable: (state: AvatarState) => JSX.Element;
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import type { AvatarProps, AvatarState } from './Avatar.types';
3
- export declare const useAvatar_unstable: (props: AvatarProps, ref: React.Ref<HTMLElement>) => AvatarState;
@@ -1,3 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const avatarClassName = "fui-Avatar";
3
- export declare const useAvatarStyles_unstable: (state: AvatarState) => AvatarState;
package/lib/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './Avatar';
2
- export * from './utils/index';
@@ -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';
@@ -1 +0,0 @@
1
- export * from './components/Avatar/index';
@@ -1,3 +0,0 @@
1
- import type { AvatarProps } from './Avatar.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- export declare const Avatar: ForwardRefComponent<AvatarProps>;
@@ -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 {};
@@ -1,5 +0,0 @@
1
- export * from './Avatar.types';
2
- export * from './Avatar';
3
- export * from './renderAvatar';
4
- export * from './useAvatar';
5
- export * from './useAvatarStyles';
@@ -1,2 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const renderAvatar_unstable: (state: AvatarState) => JSX.Element;
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- import type { AvatarProps, AvatarState } from './Avatar.types';
3
- export declare const useAvatar_unstable: (props: AvatarProps, ref: React.Ref<HTMLElement>) => AvatarState;
@@ -1,3 +0,0 @@
1
- import type { AvatarState } from './Avatar.types';
2
- export declare const avatarClassName = "fui-Avatar";
3
- export declare const useAvatarStyles_unstable: (state: AvatarState) => AvatarState;
@@ -1,2 +0,0 @@
1
- export * from './Avatar';
2
- export * from './utils/index';
@@ -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';