@zag-js/avatar 2.0.0-next.2 → 2.0.0-next.4
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 +69 -74
- package/dist/avatar.connect.mjs +65 -49
- package/dist/avatar.dom.d.mts +6 -9
- package/dist/avatar.dom.d.ts +6 -9
- package/dist/avatar.dom.js +15 -42
- package/dist/avatar.dom.mjs +7 -13
- package/dist/avatar.machine.d.mts +2 -7
- package/dist/avatar.machine.d.ts +2 -7
- package/dist/avatar.machine.js +81 -129
- package/dist/avatar.machine.mjs +79 -95
- 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 +69 -62
- package/dist/avatar.types.d.ts +69 -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 +7 -7
|
@@ -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,79 +1,74 @@
|
|
|
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.connect.ts
|
|
21
|
-
var avatar_connect_exports = {};
|
|
22
|
-
__export(avatar_connect_exports, {
|
|
23
|
-
connect: () => connect
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
24
4
|
});
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
const require_avatar_anatomy = require("./avatar.anatomy.js");
|
|
6
|
+
// src/avatar.connect.ts
|
|
27
7
|
function connect(service, normalize) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
8
|
+
const { send, prop, scope } = service;
|
|
9
|
+
const status = getStatus(service);
|
|
10
|
+
const loaded = status === "loaded";
|
|
11
|
+
function getRootState() {
|
|
12
|
+
return { status };
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
status,
|
|
16
|
+
loaded,
|
|
17
|
+
setLoaded() {
|
|
18
|
+
send({
|
|
19
|
+
type: "img.loaded",
|
|
20
|
+
src: "api"
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
setError() {
|
|
24
|
+
send({
|
|
25
|
+
type: "img.error",
|
|
26
|
+
src: "api"
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
getRootState,
|
|
30
|
+
getRootProps() {
|
|
31
|
+
const rootState = getRootState();
|
|
32
|
+
return normalize.element({
|
|
33
|
+
...require_avatar_anatomy.parts.root.attrs(scope.id),
|
|
34
|
+
dir: prop("dir"),
|
|
35
|
+
"data-status": rootState.status
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
getImageProps() {
|
|
39
|
+
return normalize.img({
|
|
40
|
+
...require_avatar_anatomy.parts.image.attrs(scope.id),
|
|
41
|
+
hidden: !loaded,
|
|
42
|
+
dir: prop("dir"),
|
|
43
|
+
"data-state": loaded ? "visible" : "hidden",
|
|
44
|
+
onLoad() {
|
|
45
|
+
send({
|
|
46
|
+
type: "img.loaded",
|
|
47
|
+
src: "element"
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
onError() {
|
|
51
|
+
send({
|
|
52
|
+
type: "img.error",
|
|
53
|
+
src: "element"
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
getFallbackProps() {
|
|
59
|
+
return normalize.element({
|
|
60
|
+
...require_avatar_anatomy.parts.fallback.attrs(scope.id),
|
|
61
|
+
dir: prop("dir"),
|
|
62
|
+
hidden: loaded,
|
|
63
|
+
"data-state": loaded ? "hidden" : "visible"
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
69
67
|
}
|
|
70
68
|
function getStatus(service) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
const { state } = service;
|
|
70
|
+
if (state.matches("error")) return "error";
|
|
71
|
+
if (state.matches("loaded")) return "loaded";
|
|
72
|
+
return "loading";
|
|
75
73
|
}
|
|
76
|
-
|
|
77
|
-
0 && (module.exports = {
|
|
78
|
-
connect
|
|
79
|
-
});
|
|
74
|
+
exports.connect = connect;
|
package/dist/avatar.connect.mjs
CHANGED
|
@@ -1,54 +1,70 @@
|
|
|
1
|
-
// src/avatar.connect.ts
|
|
2
1
|
import { parts } from "./avatar.anatomy.mjs";
|
|
2
|
+
// src/avatar.connect.ts
|
|
3
3
|
function connect(service, normalize) {
|
|
4
|
-
|
|
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
|
-
|
|
4
|
+
const { send, prop, scope } = service;
|
|
5
|
+
const status = getStatus(service);
|
|
6
|
+
const loaded = status === "loaded";
|
|
7
|
+
function getRootState() {
|
|
8
|
+
return { status };
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
status,
|
|
12
|
+
loaded,
|
|
13
|
+
setLoaded() {
|
|
14
|
+
send({
|
|
15
|
+
type: "img.loaded",
|
|
16
|
+
src: "api"
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
setError() {
|
|
20
|
+
send({
|
|
21
|
+
type: "img.error",
|
|
22
|
+
src: "api"
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
getRootState,
|
|
26
|
+
getRootProps() {
|
|
27
|
+
const rootState = getRootState();
|
|
28
|
+
return normalize.element({
|
|
29
|
+
...parts.root.attrs(scope.id),
|
|
30
|
+
dir: prop("dir"),
|
|
31
|
+
"data-status": rootState.status
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
getImageProps() {
|
|
35
|
+
return normalize.img({
|
|
36
|
+
...parts.image.attrs(scope.id),
|
|
37
|
+
hidden: !loaded,
|
|
38
|
+
dir: prop("dir"),
|
|
39
|
+
"data-state": loaded ? "visible" : "hidden",
|
|
40
|
+
onLoad() {
|
|
41
|
+
send({
|
|
42
|
+
type: "img.loaded",
|
|
43
|
+
src: "element"
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
onError() {
|
|
47
|
+
send({
|
|
48
|
+
type: "img.error",
|
|
49
|
+
src: "element"
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
getFallbackProps() {
|
|
55
|
+
return normalize.element({
|
|
56
|
+
...parts.fallback.attrs(scope.id),
|
|
57
|
+
dir: prop("dir"),
|
|
58
|
+
hidden: loaded,
|
|
59
|
+
"data-state": loaded ? "hidden" : "visible"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
45
63
|
}
|
|
46
64
|
function getStatus(service) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
65
|
+
const { state } = service;
|
|
66
|
+
if (state.matches("error")) return "error";
|
|
67
|
+
if (state.matches("loaded")) return "loaded";
|
|
68
|
+
return "loading";
|
|
51
69
|
}
|
|
52
|
-
export {
|
|
53
|
-
connect
|
|
54
|
-
};
|
|
70
|
+
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,43 +1,16 @@
|
|
|
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 import_avatar = require("./avatar.anatomy.js");
|
|
31
|
-
var getRootId = (ctx) => ctx.ids?.root ?? `${ctx.id}`;
|
|
32
|
-
var getImageId = (ctx) => ctx.ids?.image ?? `${ctx.id}:image`;
|
|
33
|
-
var getFallbackId = (ctx) => ctx.ids?.fallback ?? `${ctx.id}:fallback`;
|
|
34
|
-
var getRootEl = (ctx) => ctx.query(ctx.selector(import_avatar.parts.root));
|
|
35
|
-
var getImageEl = (ctx) => ctx.query(ctx.selector(import_avatar.parts.image));
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
getFallbackId,
|
|
39
|
-
getImageEl,
|
|
40
|
-
getImageId,
|
|
41
|
-
getRootEl,
|
|
42
|
-
getRootId
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
43
4
|
});
|
|
5
|
+
const require_avatar_anatomy = require("./avatar.anatomy.js");
|
|
6
|
+
// src/avatar.dom.ts
|
|
7
|
+
const getRootId = (ctx) => ctx.ids?.root ?? `${ctx.id}`;
|
|
8
|
+
const getImageId = (ctx) => ctx.ids?.image ?? `${ctx.id}:image`;
|
|
9
|
+
const getFallbackId = (ctx) => ctx.ids?.fallback ?? `${ctx.id}:fallback`;
|
|
10
|
+
const getRootEl = (ctx) => ctx.query(ctx.selector(require_avatar_anatomy.parts.root));
|
|
11
|
+
const getImageEl = (ctx) => ctx.query(ctx.selector(require_avatar_anatomy.parts.image));
|
|
12
|
+
exports.getFallbackId = getFallbackId;
|
|
13
|
+
exports.getImageEl = getImageEl;
|
|
14
|
+
exports.getImageId = getImageId;
|
|
15
|
+
exports.getRootEl = getRootEl;
|
|
16
|
+
exports.getRootId = getRootId;
|
package/dist/avatar.dom.mjs
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
// src/avatar.dom.ts
|
|
2
1
|
import { parts } from "./avatar.anatomy.mjs";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
getImageEl,
|
|
11
|
-
getImageId,
|
|
12
|
-
getRootEl,
|
|
13
|
-
getRootId
|
|
14
|
-
};
|
|
2
|
+
// src/avatar.dom.ts
|
|
3
|
+
const getRootId = (ctx) => ctx.ids?.root ?? `${ctx.id}`;
|
|
4
|
+
const getImageId = (ctx) => ctx.ids?.image ?? `${ctx.id}:image`;
|
|
5
|
+
const getFallbackId = (ctx) => ctx.ids?.fallback ?? `${ctx.id}:fallback`;
|
|
6
|
+
const getRootEl = (ctx) => ctx.query(ctx.selector(parts.root));
|
|
7
|
+
const getImageEl = (ctx) => ctx.query(ctx.selector(parts.image));
|
|
8
|
+
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>;
|