@mekari/pixel3-avatar 0.0.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/dist/avatar-excess.d.mts +8 -0
- package/dist/avatar-excess.d.ts +8 -0
- package/dist/avatar-excess.js +42 -0
- package/dist/avatar-excess.mjs +7 -0
- package/dist/avatar-fallback.d.mts +8 -0
- package/dist/avatar-fallback.d.ts +8 -0
- package/dist/avatar-fallback.js +45 -0
- package/dist/avatar-fallback.mjs +7 -0
- package/dist/avatar-group.d.mts +54 -0
- package/dist/avatar-group.d.ts +54 -0
- package/dist/avatar-group.js +166 -0
- package/dist/avatar-group.mjs +13 -0
- package/dist/avatar-image.d.mts +8 -0
- package/dist/avatar-image.d.ts +8 -0
- package/dist/avatar-image.js +37 -0
- package/dist/avatar-image.mjs +7 -0
- package/dist/avatar.d.mts +102 -0
- package/dist/avatar.d.ts +102 -0
- package/dist/avatar.js +284 -0
- package/dist/avatar.mjs +14 -0
- package/dist/chunk-43VB6T4V.mjs +36 -0
- package/dist/chunk-4VNSI4PL.mjs +13 -0
- package/dist/chunk-CY2Z6I23.mjs +18 -0
- package/dist/chunk-ITYXDMOF.mjs +74 -0
- package/dist/chunk-JVROEGO3.mjs +52 -0
- package/dist/chunk-NKXS73IR.mjs +21 -0
- package/dist/chunk-QZ7VFGWC.mjs +6 -0
- package/dist/chunk-RTYPPBOR.mjs +44 -0
- package/dist/chunk-U4MXRXR7.mjs +56 -0
- package/dist/chunk-ZK47OSEJ.mjs +26 -0
- package/dist/chunk-ZMUFXMG4.mjs +118 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +406 -0
- package/dist/index.mjs +19 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/modules/avatar.connects.d.mts +11 -0
- package/dist/modules/avatar.connects.d.ts +11 -0
- package/dist/modules/avatar.connects.js +148 -0
- package/dist/modules/avatar.connects.mjs +10 -0
- package/dist/modules/avatar.hooks.d.mts +8 -0
- package/dist/modules/avatar.hooks.d.ts +8 -0
- package/dist/modules/avatar.hooks.js +234 -0
- package/dist/modules/avatar.hooks.mjs +12 -0
- package/dist/modules/avatar.machines.d.mts +14 -0
- package/dist/modules/avatar.machines.d.ts +14 -0
- package/dist/modules/avatar.machines.js +78 -0
- package/dist/modules/avatar.machines.mjs +9 -0
- package/dist/modules/avatar.props.d.mts +71 -0
- package/dist/modules/avatar.props.d.ts +71 -0
- package/dist/modules/avatar.props.js +101 -0
- package/dist/modules/avatar.props.mjs +13 -0
- package/dist/modules/avatar.types.d.mts +65 -0
- package/dist/modules/avatar.types.d.ts +65 -0
- package/dist/modules/avatar.types.js +18 -0
- package/dist/modules/avatar.types.mjs +0 -0
- package/dist/modules/avatar.utils.d.mts +8 -0
- package/dist/modules/avatar.utils.d.ts +8 -0
- package/dist/modules/avatar.utils.js +49 -0
- package/dist/modules/avatar.utils.mjs +11 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/avatar-excess.tsx":{"bytes":424,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true}],"format":"esm"},"src/avatar-fallback.tsx":{"bytes":974,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true}],"format":"esm"},"src/modules/avatar.props.ts":{"bytes":1862,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"./avatar.types","kind":"import-statement","external":true}],"format":"esm"},"src/modules/avatar.machines.ts":{"bytes":1580,"imports":[{"path":"xstate","kind":"import-statement","external":true},{"path":"./avatar.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/avatar.utils.ts":{"bytes":627,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/avatar.connects.ts":{"bytes":3024,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true},{"path":"src/modules/avatar.utils.ts","kind":"import-statement","original":"./avatar.utils"},{"path":"./avatar.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/modules/avatar.hooks.ts":{"bytes":1599,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"@xstate/vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true},{"path":"src/modules/avatar.machines.ts","kind":"import-statement","original":"./avatar.machines"},{"path":"src/modules/avatar.connects.ts","kind":"import-statement","original":"./avatar.connects"},{"path":"./avatar.types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/avatar-group.tsx":{"bytes":1488,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"src/modules/avatar.props.ts","kind":"import-statement","original":"./modules/avatar.props"},{"path":"src/modules/avatar.hooks.ts","kind":"import-statement","original":"./modules/avatar.hooks"},{"path":"src/avatar-excess.tsx","kind":"import-statement","original":"./avatar-excess"}],"format":"esm"},"src/avatar-image.tsx":{"bytes":383,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true}],"format":"esm"},"src/avatar.tsx":{"bytes":1179,"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"src/modules/avatar.props.ts","kind":"import-statement","original":"./modules/avatar.props"},{"path":"src/modules/avatar.hooks.ts","kind":"import-statement","original":"./modules/avatar.hooks"},{"path":"src/modules/avatar.utils.ts","kind":"import-statement","original":"./modules/avatar.utils"},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true},{"path":"src/avatar-fallback.tsx","kind":"import-statement","original":"./avatar-fallback"},{"path":"src/avatar-image.tsx","kind":"import-statement","original":"./avatar-image"}],"format":"esm"},"src/index.ts":{"bytes":359,"imports":[{"path":"src/avatar.tsx","kind":"import-statement","original":"./avatar"},{"path":"src/avatar-group.tsx","kind":"import-statement","original":"./avatar-group"}],"format":"esm"},"src/modules/avatar.types.ts":{"bytes":1788,"imports":[{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/modules/avatar.machines.mjs":{"imports":[{"path":"dist/chunk-U4MXRXR7.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["avatarGroupMachine","avatarMachine"],"entryPoint":"src/modules/avatar.machines.ts","inputs":{},"bytes":161},"dist/modules/avatar.props.mjs":{"imports":[{"path":"dist/chunk-ITYXDMOF.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["avatarEmits","avatarGroupEmits","avatarGroupProps","avatarProps"],"entryPoint":"src/modules/avatar.props.ts","inputs":{},"bytes":223},"dist/modules/avatar.types.mjs":{"imports":[],"exports":[],"entryPoint":"src/modules/avatar.types.ts","inputs":{"src/modules/avatar.types.ts":{"bytesInOutput":0}},"bytes":0},"dist/modules/avatar.utils.mjs":{"imports":[{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["getColor","getInitial","isColorInList"],"entryPoint":"src/modules/avatar.utils.ts","inputs":{},"bytes":169},"dist/avatar-excess.mjs":{"imports":[{"path":"dist/chunk-CY2Z6I23.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAvatarExcess"],"entryPoint":"src/avatar-excess.tsx","inputs":{},"bytes":117},"dist/avatar-fallback.mjs":{"imports":[{"path":"dist/chunk-NKXS73IR.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAvatarFallback"],"entryPoint":"src/avatar-fallback.tsx","inputs":{},"bytes":121},"dist/avatar-group.mjs":{"imports":[{"path":"dist/chunk-RTYPPBOR.mjs","kind":"import-statement"},{"path":"dist/chunk-CY2Z6I23.mjs","kind":"import-statement"},{"path":"dist/chunk-ITYXDMOF.mjs","kind":"import-statement"},{"path":"dist/chunk-JVROEGO3.mjs","kind":"import-statement"},{"path":"dist/chunk-U4MXRXR7.mjs","kind":"import-statement"},{"path":"dist/chunk-ZMUFXMG4.mjs","kind":"import-statement"},{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAvatarGroup"],"entryPoint":"src/avatar-group.tsx","inputs":{},"bytes":301},"dist/avatar-image.mjs":{"imports":[{"path":"dist/chunk-4VNSI4PL.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAvatarImage"],"entryPoint":"src/avatar-image.tsx","inputs":{},"bytes":115},"dist/avatar.mjs":{"imports":[{"path":"dist/chunk-43VB6T4V.mjs","kind":"import-statement"},{"path":"dist/chunk-NKXS73IR.mjs","kind":"import-statement"},{"path":"dist/chunk-ITYXDMOF.mjs","kind":"import-statement"},{"path":"dist/chunk-4VNSI4PL.mjs","kind":"import-statement"},{"path":"dist/chunk-JVROEGO3.mjs","kind":"import-statement"},{"path":"dist/chunk-U4MXRXR7.mjs","kind":"import-statement"},{"path":"dist/chunk-ZMUFXMG4.mjs","kind":"import-statement"},{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAvatar"],"entryPoint":"src/avatar.tsx","inputs":{},"bytes":322},"dist/index.mjs":{"imports":[{"path":"dist/chunk-RTYPPBOR.mjs","kind":"import-statement"},{"path":"dist/chunk-CY2Z6I23.mjs","kind":"import-statement"},{"path":"dist/chunk-43VB6T4V.mjs","kind":"import-statement"},{"path":"dist/chunk-NKXS73IR.mjs","kind":"import-statement"},{"path":"dist/chunk-ITYXDMOF.mjs","kind":"import-statement"},{"path":"dist/chunk-4VNSI4PL.mjs","kind":"import-statement"},{"path":"dist/chunk-JVROEGO3.mjs","kind":"import-statement"},{"path":"dist/chunk-U4MXRXR7.mjs","kind":"import-statement"},{"path":"dist/chunk-ZMUFXMG4.mjs","kind":"import-statement"},{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["MpAvatar","MpAvatarGroup"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":426},"dist/chunk-RTYPPBOR.mjs":{"imports":[{"path":"dist/chunk-CY2Z6I23.mjs","kind":"import-statement"},{"path":"dist/chunk-ITYXDMOF.mjs","kind":"import-statement"},{"path":"dist/chunk-JVROEGO3.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"exports":["MpAvatarGroup"],"inputs":{"src/avatar-group.tsx":{"bytesInOutput":1137}},"bytes":1384},"dist/chunk-CY2Z6I23.mjs":{"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true}],"exports":["MpAvatarExcess"],"inputs":{"src/avatar-excess.tsx":{"bytesInOutput":331}},"bytes":386},"dist/chunk-43VB6T4V.mjs":{"imports":[{"path":"dist/chunk-NKXS73IR.mjs","kind":"import-statement"},{"path":"dist/chunk-ITYXDMOF.mjs","kind":"import-statement"},{"path":"dist/chunk-4VNSI4PL.mjs","kind":"import-statement"},{"path":"dist/chunk-JVROEGO3.mjs","kind":"import-statement"},{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-icon","kind":"import-statement","external":true}],"exports":["MpAvatar"],"inputs":{"src/avatar.tsx":{"bytesInOutput":718}},"bytes":1050},"dist/chunk-NKXS73IR.mjs":{"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true}],"exports":["MpAvatarFallback"],"inputs":{"src/avatar-fallback.tsx":{"bytesInOutput":811}},"bytes":870},"dist/chunk-ITYXDMOF.mjs":{"imports":[{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true}],"exports":["avatarEmits","avatarGroupEmits","avatarGroupProps","avatarProps"],"inputs":{"src/modules/avatar.props.ts":{"bytesInOutput":924}},"bytes":1037},"dist/chunk-4VNSI4PL.mjs":{"imports":[{"path":"vue","kind":"import-statement","external":true},{"path":"vue","kind":"import-statement","external":true}],"exports":["MpAvatarImage"],"inputs":{"src/avatar-image.tsx":{"bytesInOutput":223}},"bytes":276},"dist/modules/avatar.connects.mjs":{"imports":[{"path":"dist/chunk-ZMUFXMG4.mjs","kind":"import-statement"},{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["avatarConnect","avatarGroupConnect"],"entryPoint":"src/modules/avatar.connects.ts","inputs":{},"bytes":193},"dist/modules/avatar.hooks.mjs":{"imports":[{"path":"dist/chunk-JVROEGO3.mjs","kind":"import-statement"},{"path":"dist/chunk-U4MXRXR7.mjs","kind":"import-statement"},{"path":"dist/chunk-ZMUFXMG4.mjs","kind":"import-statement"},{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["useAvatar","useAvatarGroup"],"entryPoint":"src/modules/avatar.hooks.ts","inputs":{},"bytes":241},"dist/chunk-JVROEGO3.mjs":{"imports":[{"path":"dist/chunk-U4MXRXR7.mjs","kind":"import-statement"},{"path":"dist/chunk-ZMUFXMG4.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"@xstate/vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-utils","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/recipes","kind":"import-statement","external":true}],"exports":["useAvatar","useAvatarGroup"],"inputs":{"src/modules/avatar.hooks.ts":{"bytesInOutput":1289}},"bytes":1569},"dist/chunk-U4MXRXR7.mjs":{"imports":[{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"xstate","kind":"import-statement","external":true}],"exports":["avatarGroupMachine","avatarMachine"],"inputs":{"src/modules/avatar.machines.ts":{"bytesInOutput":1398}},"bytes":1533},"dist/chunk-ZMUFXMG4.mjs":{"imports":[{"path":"dist/chunk-ZK47OSEJ.mjs","kind":"import-statement"},{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"},{"path":"vue","kind":"import-statement","external":true},{"path":"@mekari/pixel3-styled-system/tokens","kind":"import-statement","external":true}],"exports":["avatarConnect","avatarGroupConnect"],"inputs":{"src/modules/avatar.connects.ts":{"bytesInOutput":2773}},"bytes":2976},"dist/chunk-ZK47OSEJ.mjs":{"imports":[{"path":"dist/chunk-QZ7VFGWC.mjs","kind":"import-statement"}],"exports":["getColor","getInitial","isColorInList"],"inputs":{"src/modules/avatar.utils.ts":{"bytesInOutput":589}},"bytes":725},"dist/chunk-QZ7VFGWC.mjs":{"imports":[],"exports":["__name"],"inputs":{},"bytes":151}}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AvatarState, AvatarSend, AvatarClasses, AvatarApiMachine, AvatarGroupState, AvatarGroupApiMachine } from './avatar.types.mjs';
|
|
2
|
+
import '@mekari/pixel3-utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Exported avatar connects.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
declare function avatarConnect(state: AvatarState, send: AvatarSend, classes: AvatarClasses): AvatarApiMachine;
|
|
9
|
+
declare function avatarGroupConnect(state: AvatarGroupState, send: AvatarSend, classes: AvatarClasses): AvatarGroupApiMachine;
|
|
10
|
+
|
|
11
|
+
export { avatarConnect, avatarGroupConnect };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AvatarState, AvatarSend, AvatarClasses, AvatarApiMachine, AvatarGroupState, AvatarGroupApiMachine } from './avatar.types.js';
|
|
2
|
+
import '@mekari/pixel3-utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Exported avatar connects.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
declare function avatarConnect(state: AvatarState, send: AvatarSend, classes: AvatarClasses): AvatarApiMachine;
|
|
9
|
+
declare function avatarGroupConnect(state: AvatarGroupState, send: AvatarSend, classes: AvatarClasses): AvatarGroupApiMachine;
|
|
10
|
+
|
|
11
|
+
export { avatarConnect, avatarGroupConnect };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/modules/avatar.connects.ts
|
|
22
|
+
var avatar_connects_exports = {};
|
|
23
|
+
__export(avatar_connects_exports, {
|
|
24
|
+
avatarConnect: () => avatarConnect,
|
|
25
|
+
avatarGroupConnect: () => avatarGroupConnect
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(avatar_connects_exports);
|
|
28
|
+
var import_vue = require("vue");
|
|
29
|
+
var import_tokens = require("@mekari/pixel3-styled-system/tokens");
|
|
30
|
+
|
|
31
|
+
// src/modules/avatar.utils.ts
|
|
32
|
+
var background = ["gray", "sky", "teal", "violet", "amber", "rose", "stone", "lime", "pink"];
|
|
33
|
+
var getColor = /* @__PURE__ */ __name(() => {
|
|
34
|
+
const order = Math.floor(Math.random() * background.length);
|
|
35
|
+
return `${background[order]}.400`;
|
|
36
|
+
}, "getColor");
|
|
37
|
+
var isColorInList = /* @__PURE__ */ __name((value) => {
|
|
38
|
+
return background.includes(value);
|
|
39
|
+
}, "isColorInList");
|
|
40
|
+
|
|
41
|
+
// src/modules/avatar.connects.ts
|
|
42
|
+
function avatarConnect(state, send, classes) {
|
|
43
|
+
const {
|
|
44
|
+
id,
|
|
45
|
+
name,
|
|
46
|
+
borderColor,
|
|
47
|
+
hasBorder,
|
|
48
|
+
variantColor,
|
|
49
|
+
src,
|
|
50
|
+
icon,
|
|
51
|
+
iconVariant,
|
|
52
|
+
iconColor,
|
|
53
|
+
spacing,
|
|
54
|
+
onClick
|
|
55
|
+
} = state.context;
|
|
56
|
+
const isLoaded = state.matches("loaded");
|
|
57
|
+
const isClickable = (0, import_vue.computed)(() => {
|
|
58
|
+
var _a, _b;
|
|
59
|
+
return !!((_b = (_a = (0, import_vue.getCurrentInstance)()) == null ? void 0 : _a.vnode.props) == null ? void 0 : _b.onClick);
|
|
60
|
+
}).value;
|
|
61
|
+
const isRandomColor = isColorInList(variantColor);
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
src,
|
|
65
|
+
icon,
|
|
66
|
+
isLoaded,
|
|
67
|
+
rootProps: {
|
|
68
|
+
id,
|
|
69
|
+
onClick,
|
|
70
|
+
class: classes.root,
|
|
71
|
+
style: {
|
|
72
|
+
"--mp-avatar--cursor": isClickable ? "pointer" : void 0,
|
|
73
|
+
"--mp-avatar--margin-left": `calc(${import_tokens.token.var(`spacing.${spacing}`)} * -1)`,
|
|
74
|
+
"--mp-avatar--border-color": import_tokens.token.var(`colors.${hasBorder ? borderColor != null ? borderColor : "white" : "white"}`),
|
|
75
|
+
"--mp-avatar--background-color": import_tokens.token.var(`colors.${isRandomColor ? variantColor : getColor()}`)
|
|
76
|
+
},
|
|
77
|
+
"data-has-border": hasBorder,
|
|
78
|
+
"data-pixel-component": "MpAvatar"
|
|
79
|
+
},
|
|
80
|
+
fallbackProps: {
|
|
81
|
+
id: `${id}-fallback`,
|
|
82
|
+
class: classes.fallback,
|
|
83
|
+
"data-pixel-component": "MpAvatarFallback"
|
|
84
|
+
},
|
|
85
|
+
imageProps: {
|
|
86
|
+
id: `${id}-image`,
|
|
87
|
+
alt: name,
|
|
88
|
+
src,
|
|
89
|
+
onLoad() {
|
|
90
|
+
send({
|
|
91
|
+
type: "IMG_LOADED"
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
onError() {
|
|
95
|
+
send({
|
|
96
|
+
type: "IMG_ERROR"
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
class: classes.image,
|
|
100
|
+
style: {
|
|
101
|
+
"--mp-avatar--visibility": !isLoaded ? "hidden" : void 0,
|
|
102
|
+
"--mp-avatar--display": !isLoaded ? "contents" : void 0
|
|
103
|
+
},
|
|
104
|
+
"data-pixel-component": "MpAvatarImage"
|
|
105
|
+
},
|
|
106
|
+
iconProps: {
|
|
107
|
+
id: `${id}-icon`,
|
|
108
|
+
name: icon,
|
|
109
|
+
variant: iconVariant,
|
|
110
|
+
variantColor: iconColor,
|
|
111
|
+
class: classes.icon,
|
|
112
|
+
"data-pixel-component": "MpAvatarIcon"
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
__name(avatarConnect, "avatarConnect");
|
|
117
|
+
function avatarGroupConnect(state, send, classes) {
|
|
118
|
+
const {
|
|
119
|
+
id,
|
|
120
|
+
onClick
|
|
121
|
+
} = state.context;
|
|
122
|
+
const isClickable = (0, import_vue.computed)(() => {
|
|
123
|
+
var _a, _b;
|
|
124
|
+
return !!((_b = (_a = (0, import_vue.getCurrentInstance)()) == null ? void 0 : _a.vnode.props) == null ? void 0 : _b.onClick);
|
|
125
|
+
}).value;
|
|
126
|
+
return {
|
|
127
|
+
rootProps: {
|
|
128
|
+
id,
|
|
129
|
+
class: classes.root,
|
|
130
|
+
"data-pixel-component": "MpAvatarGroup"
|
|
131
|
+
},
|
|
132
|
+
excessProps: {
|
|
133
|
+
id: `${id}-excess`,
|
|
134
|
+
onClick,
|
|
135
|
+
class: classes.excess,
|
|
136
|
+
style: {
|
|
137
|
+
"--mp-avatar-group--cursor": isClickable ? "pointer" : void 0
|
|
138
|
+
},
|
|
139
|
+
"data-pixel-component": "MpAvatarExcess"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
__name(avatarGroupConnect, "avatarGroupConnect");
|
|
144
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
145
|
+
0 && (module.exports = {
|
|
146
|
+
avatarConnect,
|
|
147
|
+
avatarGroupConnect
|
|
148
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { AvatarDefinedContext, AvatarApiMachine, AvatarGroupDefinedContext, AvatarGroupApiMachine } from './avatar.types.mjs';
|
|
3
|
+
import * as _mekari_pixel3_utils from '@mekari/pixel3-utils';
|
|
4
|
+
|
|
5
|
+
declare const useAvatar: (props: AvatarDefinedContext, emit: CallableFunction) => vue.ComputedRef<AvatarApiMachine<_mekari_pixel3_utils.PropTypes>>;
|
|
6
|
+
declare const useAvatarGroup: (props: AvatarGroupDefinedContext, emit: CallableFunction) => vue.ComputedRef<AvatarGroupApiMachine<_mekari_pixel3_utils.PropTypes>>;
|
|
7
|
+
|
|
8
|
+
export { useAvatar, useAvatarGroup };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { AvatarDefinedContext, AvatarApiMachine, AvatarGroupDefinedContext, AvatarGroupApiMachine } from './avatar.types.js';
|
|
3
|
+
import * as _mekari_pixel3_utils from '@mekari/pixel3-utils';
|
|
4
|
+
|
|
5
|
+
declare const useAvatar: (props: AvatarDefinedContext, emit: CallableFunction) => vue.ComputedRef<AvatarApiMachine<_mekari_pixel3_utils.PropTypes>>;
|
|
6
|
+
declare const useAvatarGroup: (props: AvatarGroupDefinedContext, emit: CallableFunction) => vue.ComputedRef<AvatarGroupApiMachine<_mekari_pixel3_utils.PropTypes>>;
|
|
7
|
+
|
|
8
|
+
export { useAvatar, useAvatarGroup };
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/modules/avatar.hooks.ts
|
|
22
|
+
var avatar_hooks_exports = {};
|
|
23
|
+
__export(avatar_hooks_exports, {
|
|
24
|
+
useAvatar: () => useAvatar,
|
|
25
|
+
useAvatarGroup: () => useAvatarGroup
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(avatar_hooks_exports);
|
|
28
|
+
var import_vue2 = require("vue");
|
|
29
|
+
var import_vue3 = require("@xstate/vue");
|
|
30
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
31
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
32
|
+
|
|
33
|
+
// src/modules/avatar.machines.ts
|
|
34
|
+
var import_xstate = require("xstate");
|
|
35
|
+
function avatarMachine(context) {
|
|
36
|
+
return (0, import_xstate.createMachine)({
|
|
37
|
+
/** @xstate-layout N4IgpgJg5mDOIC5QEMBuyAuyBOA6ANgPbIQCWAdlAMQCSAsgOID6AMgPICCAIgKJcDaABgC6iUAAdCsUhlKFyYkAA9EARgAsATlwBWAMybBANgBMOgDQgAnojMncAdh0BfZ5bSYcBYmUq1GTDwASkFsQUKiSCCS0rLyiioIGtr6hqYW1ogAHA64gll6hUXFha7u6Fh4RCSQ-szBoeEiijEycgpRieoajnrqek6WNghZqrplIB6VuGDY2ITYdaycvALNUa1xHaBdgnq4mgMZw6p6Jq5uIOSEEHCKUzgtUm3xnYgAtEZDH0YTD1U+ChQJ6xdoJRDqEzfBCadR-Cpeaq3CAgl7bZSIHRGfajMzQ04uS7-GZzBaorbghB6QTabrqYx4zIjXI6AoldkXZxAA */
|
|
38
|
+
id: "avatar",
|
|
39
|
+
context,
|
|
40
|
+
initial: "loading",
|
|
41
|
+
states: {
|
|
42
|
+
loading: {
|
|
43
|
+
on: {
|
|
44
|
+
IMG_LOADED: {
|
|
45
|
+
target: "loaded"
|
|
46
|
+
},
|
|
47
|
+
IMG_ERROR: {
|
|
48
|
+
target: "error"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
loaded: {
|
|
53
|
+
on: {
|
|
54
|
+
IMG_ERROR: {
|
|
55
|
+
target: "error"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
error: {
|
|
60
|
+
on: {
|
|
61
|
+
IMG_LOADED: {
|
|
62
|
+
target: "loaded"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
predictableActionArguments: true
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
__name(avatarMachine, "avatarMachine");
|
|
71
|
+
function avatarGroupMachine(context) {
|
|
72
|
+
return (0, import_xstate.createMachine)({
|
|
73
|
+
/** @xstate-layout N4IgpgJg5mDOIC5gF8A0IB2B7CdGgEMA3AgFwICcBaKCrAVwAd8RGtYBLUjrDFgD0QBGAEzoAnsJHIZyIA */
|
|
74
|
+
id: "avatar-group",
|
|
75
|
+
context,
|
|
76
|
+
predictableActionArguments: true
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
__name(avatarGroupMachine, "avatarGroupMachine");
|
|
80
|
+
|
|
81
|
+
// src/modules/avatar.connects.ts
|
|
82
|
+
var import_vue = require("vue");
|
|
83
|
+
var import_tokens = require("@mekari/pixel3-styled-system/tokens");
|
|
84
|
+
|
|
85
|
+
// src/modules/avatar.utils.ts
|
|
86
|
+
var background = ["gray", "sky", "teal", "violet", "amber", "rose", "stone", "lime", "pink"];
|
|
87
|
+
var getColor = /* @__PURE__ */ __name(() => {
|
|
88
|
+
const order = Math.floor(Math.random() * background.length);
|
|
89
|
+
return `${background[order]}.400`;
|
|
90
|
+
}, "getColor");
|
|
91
|
+
var isColorInList = /* @__PURE__ */ __name((value) => {
|
|
92
|
+
return background.includes(value);
|
|
93
|
+
}, "isColorInList");
|
|
94
|
+
|
|
95
|
+
// src/modules/avatar.connects.ts
|
|
96
|
+
function avatarConnect(state, send, classes) {
|
|
97
|
+
const {
|
|
98
|
+
id,
|
|
99
|
+
name,
|
|
100
|
+
borderColor,
|
|
101
|
+
hasBorder,
|
|
102
|
+
variantColor,
|
|
103
|
+
src,
|
|
104
|
+
icon,
|
|
105
|
+
iconVariant,
|
|
106
|
+
iconColor,
|
|
107
|
+
spacing,
|
|
108
|
+
onClick
|
|
109
|
+
} = state.context;
|
|
110
|
+
const isLoaded = state.matches("loaded");
|
|
111
|
+
const isClickable = (0, import_vue.computed)(() => {
|
|
112
|
+
var _a, _b;
|
|
113
|
+
return !!((_b = (_a = (0, import_vue.getCurrentInstance)()) == null ? void 0 : _a.vnode.props) == null ? void 0 : _b.onClick);
|
|
114
|
+
}).value;
|
|
115
|
+
const isRandomColor = isColorInList(variantColor);
|
|
116
|
+
return {
|
|
117
|
+
name,
|
|
118
|
+
src,
|
|
119
|
+
icon,
|
|
120
|
+
isLoaded,
|
|
121
|
+
rootProps: {
|
|
122
|
+
id,
|
|
123
|
+
onClick,
|
|
124
|
+
class: classes.root,
|
|
125
|
+
style: {
|
|
126
|
+
"--mp-avatar--cursor": isClickable ? "pointer" : void 0,
|
|
127
|
+
"--mp-avatar--margin-left": `calc(${import_tokens.token.var(`spacing.${spacing}`)} * -1)`,
|
|
128
|
+
"--mp-avatar--border-color": import_tokens.token.var(`colors.${hasBorder ? borderColor != null ? borderColor : "white" : "white"}`),
|
|
129
|
+
"--mp-avatar--background-color": import_tokens.token.var(`colors.${isRandomColor ? variantColor : getColor()}`)
|
|
130
|
+
},
|
|
131
|
+
"data-has-border": hasBorder,
|
|
132
|
+
"data-pixel-component": "MpAvatar"
|
|
133
|
+
},
|
|
134
|
+
fallbackProps: {
|
|
135
|
+
id: `${id}-fallback`,
|
|
136
|
+
class: classes.fallback,
|
|
137
|
+
"data-pixel-component": "MpAvatarFallback"
|
|
138
|
+
},
|
|
139
|
+
imageProps: {
|
|
140
|
+
id: `${id}-image`,
|
|
141
|
+
alt: name,
|
|
142
|
+
src,
|
|
143
|
+
onLoad() {
|
|
144
|
+
send({
|
|
145
|
+
type: "IMG_LOADED"
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
onError() {
|
|
149
|
+
send({
|
|
150
|
+
type: "IMG_ERROR"
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
class: classes.image,
|
|
154
|
+
style: {
|
|
155
|
+
"--mp-avatar--visibility": !isLoaded ? "hidden" : void 0,
|
|
156
|
+
"--mp-avatar--display": !isLoaded ? "contents" : void 0
|
|
157
|
+
},
|
|
158
|
+
"data-pixel-component": "MpAvatarImage"
|
|
159
|
+
},
|
|
160
|
+
iconProps: {
|
|
161
|
+
id: `${id}-icon`,
|
|
162
|
+
name: icon,
|
|
163
|
+
variant: iconVariant,
|
|
164
|
+
variantColor: iconColor,
|
|
165
|
+
class: classes.icon,
|
|
166
|
+
"data-pixel-component": "MpAvatarIcon"
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
__name(avatarConnect, "avatarConnect");
|
|
171
|
+
function avatarGroupConnect(state, send, classes) {
|
|
172
|
+
const {
|
|
173
|
+
id,
|
|
174
|
+
onClick
|
|
175
|
+
} = state.context;
|
|
176
|
+
const isClickable = (0, import_vue.computed)(() => {
|
|
177
|
+
var _a, _b;
|
|
178
|
+
return !!((_b = (_a = (0, import_vue.getCurrentInstance)()) == null ? void 0 : _a.vnode.props) == null ? void 0 : _b.onClick);
|
|
179
|
+
}).value;
|
|
180
|
+
return {
|
|
181
|
+
rootProps: {
|
|
182
|
+
id,
|
|
183
|
+
class: classes.root,
|
|
184
|
+
"data-pixel-component": "MpAvatarGroup"
|
|
185
|
+
},
|
|
186
|
+
excessProps: {
|
|
187
|
+
id: `${id}-excess`,
|
|
188
|
+
onClick,
|
|
189
|
+
class: classes.excess,
|
|
190
|
+
style: {
|
|
191
|
+
"--mp-avatar-group--cursor": isClickable ? "pointer" : void 0
|
|
192
|
+
},
|
|
193
|
+
"data-pixel-component": "MpAvatarExcess"
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
__name(avatarGroupConnect, "avatarGroupConnect");
|
|
198
|
+
|
|
199
|
+
// src/modules/avatar.hooks.ts
|
|
200
|
+
var useAvatar = /* @__PURE__ */ __name((props, emit) => {
|
|
201
|
+
var _a;
|
|
202
|
+
const context = (0, import_vue2.ref)(props);
|
|
203
|
+
const {
|
|
204
|
+
state,
|
|
205
|
+
send
|
|
206
|
+
} = (0, import_vue3.useMachine)(avatarMachine({
|
|
207
|
+
...context.value,
|
|
208
|
+
id: (_a = context.value.id) != null ? _a : `mp-avatar-${(0, import_pixel3_utils.useId)()}`,
|
|
209
|
+
onClick: (evt) => emit("click", evt)
|
|
210
|
+
}));
|
|
211
|
+
const [avatarProps] = import_recipes.avatarSlotRecipe.splitVariantProps(context.value);
|
|
212
|
+
const classes = (0, import_recipes.avatarSlotRecipe)(avatarProps);
|
|
213
|
+
return (0, import_vue2.computed)(() => avatarConnect(state.value, send, classes));
|
|
214
|
+
}, "useAvatar");
|
|
215
|
+
var useAvatarGroup = /* @__PURE__ */ __name((props, emit) => {
|
|
216
|
+
var _a;
|
|
217
|
+
const context = (0, import_vue2.ref)(props);
|
|
218
|
+
const {
|
|
219
|
+
state,
|
|
220
|
+
send
|
|
221
|
+
} = (0, import_vue3.useMachine)(avatarGroupMachine({
|
|
222
|
+
...context.value,
|
|
223
|
+
id: (_a = context.value.id) != null ? _a : `mp-avatar-group-${(0, import_pixel3_utils.useId)()}`,
|
|
224
|
+
onClick: (evt) => emit("click", evt)
|
|
225
|
+
}));
|
|
226
|
+
const [avatarGroupProps] = import_recipes.avatarGroupSlotRecipe.splitVariantProps(context.value);
|
|
227
|
+
const classes = (0, import_recipes.avatarGroupSlotRecipe)(avatarGroupProps);
|
|
228
|
+
return (0, import_vue2.computed)(() => avatarGroupConnect(state.value, send, classes));
|
|
229
|
+
}, "useAvatarGroup");
|
|
230
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
231
|
+
0 && (module.exports = {
|
|
232
|
+
useAvatar,
|
|
233
|
+
useAvatarGroup
|
|
234
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useAvatar,
|
|
3
|
+
useAvatarGroup
|
|
4
|
+
} from "../chunk-JVROEGO3.mjs";
|
|
5
|
+
import "../chunk-U4MXRXR7.mjs";
|
|
6
|
+
import "../chunk-ZMUFXMG4.mjs";
|
|
7
|
+
import "../chunk-ZK47OSEJ.mjs";
|
|
8
|
+
import "../chunk-QZ7VFGWC.mjs";
|
|
9
|
+
export {
|
|
10
|
+
useAvatar,
|
|
11
|
+
useAvatarGroup
|
|
12
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
import { AvatarDefinedContext, AvatarProps, AvatarGroupDefinedContext, AvatarGroupProps } from './avatar.types.mjs';
|
|
3
|
+
import '@mekari/pixel3-utils';
|
|
4
|
+
|
|
5
|
+
declare function avatarMachine(context: AvatarDefinedContext): xstate.StateMachine<Pick<Partial<AvatarProps>, "id"> & Omit<AvatarProps, "id">, any, xstate.AnyEventObject, {
|
|
6
|
+
value: any;
|
|
7
|
+
context: Pick<Partial<AvatarProps>, "id"> & Omit<AvatarProps, "id">;
|
|
8
|
+
}, xstate.BaseActionObject, xstate.ServiceMap, xstate.ResolveTypegenMeta<xstate.TypegenDisabled, xstate.AnyEventObject, xstate.BaseActionObject, xstate.ServiceMap>>;
|
|
9
|
+
declare function avatarGroupMachine(context: AvatarGroupDefinedContext): xstate.StateMachine<Pick<Partial<AvatarGroupProps>, "id"> & Omit<AvatarGroupProps, "id">, any, xstate.AnyEventObject, {
|
|
10
|
+
value: any;
|
|
11
|
+
context: Pick<Partial<AvatarGroupProps>, "id"> & Omit<AvatarGroupProps, "id">;
|
|
12
|
+
}, xstate.BaseActionObject, xstate.ServiceMap, xstate.ResolveTypegenMeta<xstate.TypegenDisabled, xstate.AnyEventObject, xstate.BaseActionObject, xstate.ServiceMap>>;
|
|
13
|
+
|
|
14
|
+
export { avatarGroupMachine, avatarMachine };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as xstate from 'xstate';
|
|
2
|
+
import { AvatarDefinedContext, AvatarProps, AvatarGroupDefinedContext, AvatarGroupProps } from './avatar.types.js';
|
|
3
|
+
import '@mekari/pixel3-utils';
|
|
4
|
+
|
|
5
|
+
declare function avatarMachine(context: AvatarDefinedContext): xstate.StateMachine<Pick<Partial<AvatarProps>, "id"> & Omit<AvatarProps, "id">, any, xstate.AnyEventObject, {
|
|
6
|
+
value: any;
|
|
7
|
+
context: Pick<Partial<AvatarProps>, "id"> & Omit<AvatarProps, "id">;
|
|
8
|
+
}, xstate.BaseActionObject, xstate.ServiceMap, xstate.ResolveTypegenMeta<xstate.TypegenDisabled, xstate.AnyEventObject, xstate.BaseActionObject, xstate.ServiceMap>>;
|
|
9
|
+
declare function avatarGroupMachine(context: AvatarGroupDefinedContext): xstate.StateMachine<Pick<Partial<AvatarGroupProps>, "id"> & Omit<AvatarGroupProps, "id">, any, xstate.AnyEventObject, {
|
|
10
|
+
value: any;
|
|
11
|
+
context: Pick<Partial<AvatarGroupProps>, "id"> & Omit<AvatarGroupProps, "id">;
|
|
12
|
+
}, xstate.BaseActionObject, xstate.ServiceMap, xstate.ResolveTypegenMeta<xstate.TypegenDisabled, xstate.AnyEventObject, xstate.BaseActionObject, xstate.ServiceMap>>;
|
|
13
|
+
|
|
14
|
+
export { avatarGroupMachine, avatarMachine };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/modules/avatar.machines.ts
|
|
22
|
+
var avatar_machines_exports = {};
|
|
23
|
+
__export(avatar_machines_exports, {
|
|
24
|
+
avatarGroupMachine: () => avatarGroupMachine,
|
|
25
|
+
avatarMachine: () => avatarMachine
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(avatar_machines_exports);
|
|
28
|
+
var import_xstate = require("xstate");
|
|
29
|
+
function avatarMachine(context) {
|
|
30
|
+
return (0, import_xstate.createMachine)({
|
|
31
|
+
/** @xstate-layout N4IgpgJg5mDOIC5QEMBuyAuyBOA6ANgPbIQCWAdlAMQCSAsgOID6AMgPICCAIgKJcDaABgC6iUAAdCsUhlKFyYkAA9EARgAsATlwBWAMybBANgBMOgDQgAnojMncAdh0BfZ5bSYcBYmUq1GTDwASkFsQUKiSCCS0rLyiioIGtr6hqYW1ogAHA64gll6hUXFha7u6Fh4RCSQ-szBoeEiijEycgpRieoajnrqek6WNghZqrplIB6VuGDY2ITYdaycvALNUa1xHaBdgnq4mgMZw6p6Jq5uIOSEEHCKUzgtUm3xnYgAtEZDH0YTD1U+ChQJ6xdoJRDqEzfBCadR-Cpeaq3CAgl7bZSIHRGfajMzQ04uS7-GZzBaorbghB6QTabrqYx4zIjXI6AoldkXZxAA */
|
|
32
|
+
id: "avatar",
|
|
33
|
+
context,
|
|
34
|
+
initial: "loading",
|
|
35
|
+
states: {
|
|
36
|
+
loading: {
|
|
37
|
+
on: {
|
|
38
|
+
IMG_LOADED: {
|
|
39
|
+
target: "loaded"
|
|
40
|
+
},
|
|
41
|
+
IMG_ERROR: {
|
|
42
|
+
target: "error"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
loaded: {
|
|
47
|
+
on: {
|
|
48
|
+
IMG_ERROR: {
|
|
49
|
+
target: "error"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
on: {
|
|
55
|
+
IMG_LOADED: {
|
|
56
|
+
target: "loaded"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
predictableActionArguments: true
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
__name(avatarMachine, "avatarMachine");
|
|
65
|
+
function avatarGroupMachine(context) {
|
|
66
|
+
return (0, import_xstate.createMachine)({
|
|
67
|
+
/** @xstate-layout N4IgpgJg5mDOIC5gF8A0IB2B7CdGgEMA3AgFwICcBaKCrAVwAd8RGtYBLUjrDFgD0QBGAEzoAnsJHIZyIA */
|
|
68
|
+
id: "avatar-group",
|
|
69
|
+
context,
|
|
70
|
+
predictableActionArguments: true
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
__name(avatarGroupMachine, "avatarGroupMachine");
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
avatarGroupMachine,
|
|
77
|
+
avatarMachine
|
|
78
|
+
});
|