@zag-js/avatar 1.46.0 → 1.48.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.anatomy.d.mts +2 -6
- package/dist/avatar.anatomy.d.ts +2 -6
- package/dist/avatar.anatomy.js +8 -33
- package/dist/avatar.anatomy.mjs +4 -7
- package/dist/avatar.connect.d.mts +4 -7
- package/dist/avatar.connect.d.ts +4 -7
- package/dist/avatar.connect.js +64 -86
- package/dist/avatar.connect.mjs +60 -51
- package/dist/avatar.dom.d.mts +6 -9
- package/dist/avatar.dom.d.ts +6 -9
- package/dist/avatar.dom.js +14 -41
- package/dist/avatar.dom.mjs +6 -12
- package/dist/avatar.machine.d.mts +2 -7
- package/dist/avatar.machine.d.ts +2 -7
- package/dist/avatar.machine.js +75 -127
- package/dist/avatar.machine.mjs +71 -91
- package/dist/avatar.props.d.mts +3 -8
- package/dist/avatar.props.d.ts +3 -8
- package/dist/avatar.props.js +16 -34
- package/dist/avatar.props.mjs +10 -7
- package/dist/avatar.types.d.mts +59 -62
- package/dist/avatar.types.d.ts +59 -62
- package/dist/avatar.types.js +4 -18
- package/dist/avatar.types.mjs +1 -0
- package/dist/index.d.mts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.js +12 -38
- package/dist/index.mjs +2 -7
- package/package.json +8 -8
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "image" | "fallback">;
|
|
4
|
-
declare const parts: Record<"root" | "image" | "fallback", _zag_js_anatomy.AnatomyPart>;
|
|
5
|
-
|
|
6
|
-
export { anatomy, parts };
|
|
1
|
+
export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"fallback" | "image" | "root">;
|
|
2
|
+
export declare const parts: Record<"fallback" | "image" | "root", import("@zag-js/anatomy").AnatomyPart>;
|
package/dist/avatar.anatomy.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "image" | "fallback">;
|
|
4
|
-
declare const parts: Record<"root" | "image" | "fallback", _zag_js_anatomy.AnatomyPart>;
|
|
5
|
-
|
|
6
|
-
export { anatomy, parts };
|
|
1
|
+
export declare const anatomy: import("@zag-js/anatomy").AnatomyInstance<"fallback" | "image" | "root">;
|
|
2
|
+
export declare const parts: Record<"fallback" | "image" | "root", import("@zag-js/anatomy").AnatomyPart>;
|
package/dist/avatar.anatomy.js
CHANGED
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/avatar.anatomy.ts
|
|
21
|
-
var avatar_anatomy_exports = {};
|
|
22
|
-
__export(avatar_anatomy_exports, {
|
|
23
|
-
anatomy: () => anatomy,
|
|
24
|
-
parts: () => parts
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(avatar_anatomy_exports);
|
|
27
|
-
var import_anatomy = require("@zag-js/anatomy");
|
|
28
|
-
var anatomy = (0, import_anatomy.createAnatomy)("avatar").parts("root", "image", "fallback");
|
|
29
|
-
var parts = anatomy.build();
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
anatomy,
|
|
33
|
-
parts
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
34
4
|
});
|
|
5
|
+
// src/avatar.anatomy.ts
|
|
6
|
+
const anatomy = (0, require("@zag-js/anatomy").createAnatomy)("avatar").parts("root", "image", "fallback");
|
|
7
|
+
const parts = anatomy.build();
|
|
8
|
+
exports.anatomy = anatomy;
|
|
9
|
+
exports.parts = parts;
|
package/dist/avatar.anatomy.mjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
// src/avatar.anatomy.ts
|
|
2
1
|
import { createAnatomy } from "@zag-js/anatomy";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
parts
|
|
8
|
-
};
|
|
2
|
+
// src/avatar.anatomy.ts
|
|
3
|
+
const anatomy = createAnatomy("avatar").parts("root", "image", "fallback");
|
|
4
|
+
const parts = anatomy.build();
|
|
5
|
+
export { anatomy, parts };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Service } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
declare function connect<T extends PropTypes>(service: Service<AvatarSchema>, normalize: NormalizeProps<T>): AvatarApi<T>;
|
|
6
|
-
|
|
7
|
-
export { connect };
|
|
1
|
+
import { AvatarApi, AvatarSchema } from "./avatar.types.mjs";
|
|
2
|
+
import { Service } from "@zag-js/core";
|
|
3
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
4
|
+
export declare function connect<T extends PropTypes>(service: Service<AvatarSchema>, normalize: NormalizeProps<T>): AvatarApi<T>;
|
package/dist/avatar.connect.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
declare function connect<T extends PropTypes>(service: Service<AvatarSchema>, normalize: NormalizeProps<T>): AvatarApi<T>;
|
|
6
|
-
|
|
7
|
-
export { connect };
|
|
1
|
+
import { AvatarApi, AvatarSchema } from "./avatar.types.js";
|
|
2
|
+
import { NormalizeProps, PropTypes } from "@zag-js/types";
|
|
3
|
+
import { Service } from "@zag-js/core";
|
|
4
|
+
export declare function connect<T extends PropTypes>(service: Service<AvatarSchema>, normalize: NormalizeProps<T>): AvatarApi<T>;
|
package/dist/avatar.connect.js
CHANGED
|
@@ -1,89 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/avatar.connect.ts
|
|
31
|
-
var avatar_connect_exports = {};
|
|
32
|
-
__export(avatar_connect_exports, {
|
|
33
|
-
connect: () => connect
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
34
4
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
const require_avatar_anatomy = require("./avatar.anatomy.js");
|
|
6
|
+
const require_avatar_dom = require("./avatar.dom.js");
|
|
7
|
+
// src/avatar.connect.ts
|
|
38
8
|
function connect(service, normalize) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
9
|
+
const { state, send, prop, scope } = service;
|
|
10
|
+
const loaded = state.matches("loaded");
|
|
11
|
+
return {
|
|
12
|
+
loaded,
|
|
13
|
+
setSrc(src) {
|
|
14
|
+
require_avatar_dom.getImageEl(scope)?.setAttribute("src", src);
|
|
15
|
+
},
|
|
16
|
+
setLoaded() {
|
|
17
|
+
send({
|
|
18
|
+
type: "img.loaded",
|
|
19
|
+
src: "api"
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
setError() {
|
|
23
|
+
send({
|
|
24
|
+
type: "img.error",
|
|
25
|
+
src: "api"
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
getRootProps() {
|
|
29
|
+
return normalize.element({
|
|
30
|
+
...require_avatar_anatomy.parts.root.attrs,
|
|
31
|
+
dir: prop("dir"),
|
|
32
|
+
id: require_avatar_dom.getRootId(scope)
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
getImageProps() {
|
|
36
|
+
return normalize.img({
|
|
37
|
+
...require_avatar_anatomy.parts.image.attrs,
|
|
38
|
+
hidden: !loaded,
|
|
39
|
+
dir: prop("dir"),
|
|
40
|
+
id: require_avatar_dom.getImageId(scope),
|
|
41
|
+
"data-state": loaded ? "visible" : "hidden",
|
|
42
|
+
onLoad() {
|
|
43
|
+
send({
|
|
44
|
+
type: "img.loaded",
|
|
45
|
+
src: "element"
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
onError() {
|
|
49
|
+
send({
|
|
50
|
+
type: "img.error",
|
|
51
|
+
src: "element"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
getFallbackProps() {
|
|
57
|
+
return normalize.element({
|
|
58
|
+
...require_avatar_anatomy.parts.fallback.attrs,
|
|
59
|
+
dir: prop("dir"),
|
|
60
|
+
id: require_avatar_dom.getFallbackId(scope),
|
|
61
|
+
hidden: loaded,
|
|
62
|
+
"data-state": loaded ? "hidden" : "visible"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
85
66
|
}
|
|
86
|
-
|
|
87
|
-
0 && (module.exports = {
|
|
88
|
-
connect
|
|
89
|
-
});
|
|
67
|
+
exports.connect = connect;
|
package/dist/avatar.connect.mjs
CHANGED
|
@@ -1,54 +1,63 @@
|
|
|
1
|
-
// src/avatar.connect.ts
|
|
2
1
|
import { parts } from "./avatar.anatomy.mjs";
|
|
3
|
-
import
|
|
2
|
+
import { getFallbackId, getImageEl, getImageId, getRootId } from "./avatar.dom.mjs";
|
|
3
|
+
// src/avatar.connect.ts
|
|
4
4
|
function connect(service, normalize) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
5
|
+
const { state, send, prop, scope } = service;
|
|
6
|
+
const loaded = state.matches("loaded");
|
|
7
|
+
return {
|
|
8
|
+
loaded,
|
|
9
|
+
setSrc(src) {
|
|
10
|
+
getImageEl(scope)?.setAttribute("src", src);
|
|
11
|
+
},
|
|
12
|
+
setLoaded() {
|
|
13
|
+
send({
|
|
14
|
+
type: "img.loaded",
|
|
15
|
+
src: "api"
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
setError() {
|
|
19
|
+
send({
|
|
20
|
+
type: "img.error",
|
|
21
|
+
src: "api"
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
getRootProps() {
|
|
25
|
+
return normalize.element({
|
|
26
|
+
...parts.root.attrs,
|
|
27
|
+
dir: prop("dir"),
|
|
28
|
+
id: getRootId(scope)
|
|
29
|
+
});
|
|
30
|
+
},
|
|
31
|
+
getImageProps() {
|
|
32
|
+
return normalize.img({
|
|
33
|
+
...parts.image.attrs,
|
|
34
|
+
hidden: !loaded,
|
|
35
|
+
dir: prop("dir"),
|
|
36
|
+
id: getImageId(scope),
|
|
37
|
+
"data-state": loaded ? "visible" : "hidden",
|
|
38
|
+
onLoad() {
|
|
39
|
+
send({
|
|
40
|
+
type: "img.loaded",
|
|
41
|
+
src: "element"
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
onError() {
|
|
45
|
+
send({
|
|
46
|
+
type: "img.error",
|
|
47
|
+
src: "element"
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
getFallbackProps() {
|
|
53
|
+
return normalize.element({
|
|
54
|
+
...parts.fallback.attrs,
|
|
55
|
+
dir: prop("dir"),
|
|
56
|
+
id: getFallbackId(scope),
|
|
57
|
+
hidden: loaded,
|
|
58
|
+
"data-state": loaded ? "hidden" : "visible"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
51
62
|
}
|
|
52
|
-
export {
|
|
53
|
-
connect
|
|
54
|
-
};
|
|
63
|
+
export { connect };
|
package/dist/avatar.dom.d.mts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Scope } from
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
declare const getImageEl: (ctx: Scope) => HTMLImageElement | null;
|
|
8
|
-
|
|
9
|
-
export { getFallbackId, getImageEl, getImageId, getRootEl, getRootId };
|
|
1
|
+
import { Scope } from "@zag-js/core";
|
|
2
|
+
export declare const getRootId: (ctx: Scope) => any;
|
|
3
|
+
export declare const getImageId: (ctx: Scope) => any;
|
|
4
|
+
export declare const getFallbackId: (ctx: Scope) => any;
|
|
5
|
+
export declare const getRootEl: (ctx: Scope) => HTMLElement | null;
|
|
6
|
+
export declare const getImageEl: (ctx: Scope) => HTMLImageElement | null;
|
package/dist/avatar.dom.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Scope } from
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
declare const getImageEl: (ctx: Scope) => HTMLImageElement | null;
|
|
8
|
-
|
|
9
|
-
export { getFallbackId, getImageEl, getImageId, getRootEl, getRootId };
|
|
1
|
+
import { Scope } from "@zag-js/core";
|
|
2
|
+
export declare const getRootId: (ctx: Scope) => any;
|
|
3
|
+
export declare const getImageId: (ctx: Scope) => any;
|
|
4
|
+
export declare const getFallbackId: (ctx: Scope) => any;
|
|
5
|
+
export declare const getRootEl: (ctx: Scope) => HTMLElement | null;
|
|
6
|
+
export declare const getImageEl: (ctx: Scope) => HTMLImageElement | null;
|
package/dist/avatar.dom.js
CHANGED
|
@@ -1,42 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/avatar.dom.ts
|
|
21
|
-
var avatar_dom_exports = {};
|
|
22
|
-
__export(avatar_dom_exports, {
|
|
23
|
-
getFallbackId: () => getFallbackId,
|
|
24
|
-
getImageEl: () => getImageEl,
|
|
25
|
-
getImageId: () => getImageId,
|
|
26
|
-
getRootEl: () => getRootEl,
|
|
27
|
-
getRootId: () => getRootId
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(avatar_dom_exports);
|
|
30
|
-
var getRootId = (ctx) => ctx.ids?.root ?? `avatar:${ctx.id}`;
|
|
31
|
-
var getImageId = (ctx) => ctx.ids?.image ?? `avatar:${ctx.id}:image`;
|
|
32
|
-
var getFallbackId = (ctx) => ctx.ids?.fallback ?? `avatar:${ctx.id}:fallback`;
|
|
33
|
-
var getRootEl = (ctx) => ctx.getById(getRootId(ctx));
|
|
34
|
-
var getImageEl = (ctx) => ctx.getById(getImageId(ctx));
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
getFallbackId,
|
|
38
|
-
getImageEl,
|
|
39
|
-
getImageId,
|
|
40
|
-
getRootEl,
|
|
41
|
-
getRootId
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
42
4
|
});
|
|
5
|
+
// src/avatar.dom.ts
|
|
6
|
+
const getRootId = (ctx) => ctx.ids?.root ?? `avatar:${ctx.id}`;
|
|
7
|
+
const getImageId = (ctx) => ctx.ids?.image ?? `avatar:${ctx.id}:image`;
|
|
8
|
+
const getFallbackId = (ctx) => ctx.ids?.fallback ?? `avatar:${ctx.id}:fallback`;
|
|
9
|
+
const getRootEl = (ctx) => ctx.getById(getRootId(ctx));
|
|
10
|
+
const getImageEl = (ctx) => ctx.getById(getImageId(ctx));
|
|
11
|
+
exports.getFallbackId = getFallbackId;
|
|
12
|
+
exports.getImageEl = getImageEl;
|
|
13
|
+
exports.getImageId = getImageId;
|
|
14
|
+
exports.getRootEl = getRootEl;
|
|
15
|
+
exports.getRootId = getRootId;
|
package/dist/avatar.dom.mjs
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
// src/avatar.dom.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
getFallbackId,
|
|
9
|
-
getImageEl,
|
|
10
|
-
getImageId,
|
|
11
|
-
getRootEl,
|
|
12
|
-
getRootId
|
|
13
|
-
};
|
|
2
|
+
const getRootId = (ctx) => ctx.ids?.root ?? `avatar:${ctx.id}`;
|
|
3
|
+
const getImageId = (ctx) => ctx.ids?.image ?? `avatar:${ctx.id}:image`;
|
|
4
|
+
const getFallbackId = (ctx) => ctx.ids?.fallback ?? `avatar:${ctx.id}:fallback`;
|
|
5
|
+
const getRootEl = (ctx) => ctx.getById(getRootId(ctx));
|
|
6
|
+
const getImageEl = (ctx) => ctx.getById(getImageId(ctx));
|
|
7
|
+
export { getFallbackId, getImageEl, getImageId, getRootEl, getRootId };
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import '@zag-js/types';
|
|
4
|
-
|
|
5
|
-
declare const machine: _zag_js_core.Machine<AvatarSchema>;
|
|
6
|
-
|
|
7
|
-
export { machine };
|
|
1
|
+
import { AvatarSchema } from "./avatar.types.mjs";
|
|
2
|
+
export declare const machine: import("@zag-js/core").Machine<AvatarSchema>;
|
package/dist/avatar.machine.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import '@zag-js/types';
|
|
4
|
-
|
|
5
|
-
declare const machine: _zag_js_core.Machine<AvatarSchema>;
|
|
6
|
-
|
|
7
|
-
export { machine };
|
|
1
|
+
import { AvatarSchema } from "./avatar.types.js";
|
|
2
|
+
export declare const machine: import("@zag-js/core").Machine<AvatarSchema>;
|