@zag-js/avatar
Advanced tools
Comparing version 0.11.2 to 0.12.0
@@ -34,5 +34,2 @@ "use strict"; | ||
// src/avatar.connect.ts | ||
var import_dom_query2 = require("@zag-js/dom-query"); | ||
// src/avatar.dom.ts | ||
@@ -76,3 +73,3 @@ var import_dom_query = require("@zag-js/dom-query"); | ||
id: dom.getImageId(state.context), | ||
"data-loaded": (0, import_dom_query2.dataAttr)(isLoaded), | ||
"data-state": isLoaded ? "visible" : "hidden", | ||
onLoad() { | ||
@@ -93,2 +90,3 @@ send({ type: "IMG.LOADED", src: "element" }); | ||
hidden: !showFallback, | ||
"data-state": isLoaded ? "hidden" : "visible", | ||
style: { | ||
@@ -185,3 +183,4 @@ gridArea: "1 / 1 / 2 / 2" | ||
if (img?.complete) { | ||
send({ type: "IMG.LOADED", src: "ssr" }); | ||
const type = img.currentSrc ? "IMG.LOADED" : "IMG.ERROR"; | ||
send({ type, src: "ssr" }); | ||
} | ||
@@ -188,0 +187,0 @@ } |
{ | ||
"name": "@zag-js/avatar", | ||
"version": "0.11.2", | ||
"version": "0.12.0", | ||
"description": "Core logic for the avatar widget implemented as a state machine", | ||
@@ -31,8 +31,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.11.2", | ||
"@zag-js/mutation-observer": "0.11.2", | ||
"@zag-js/core": "0.11.2", | ||
"@zag-js/dom-query": "0.11.2", | ||
"@zag-js/utils": "0.11.2", | ||
"@zag-js/types": "0.11.2" | ||
"@zag-js/anatomy": "0.12.0", | ||
"@zag-js/mutation-observer": "0.12.0", | ||
"@zag-js/core": "0.12.0", | ||
"@zag-js/dom-query": "0.12.0", | ||
"@zag-js/utils": "0.12.0", | ||
"@zag-js/types": "0.12.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
@@ -1,2 +0,1 @@ | ||
import { dataAttr } from "@zag-js/dom-query" | ||
import type { NormalizeProps, PropTypes } from "@zag-js/types" | ||
@@ -39,3 +38,3 @@ import { parts } from "./avatar.anatomy" | ||
id: dom.getImageId(state.context), | ||
"data-loaded": dataAttr(isLoaded), | ||
"data-state": isLoaded ? "visible" : "hidden", | ||
onLoad() { | ||
@@ -57,2 +56,3 @@ send({ type: "IMG.LOADED", src: "element" }) | ||
hidden: !showFallback, | ||
"data-state": isLoaded ? "hidden" : "visible", | ||
style: { | ||
@@ -59,0 +59,0 @@ gridArea: "1 / 1 / 2 / 2", |
@@ -90,3 +90,4 @@ import { createMachine } from "@zag-js/core" | ||
if (img?.complete) { | ||
send({ type: "IMG.LOADED", src: "ssr" }) | ||
const type = img.currentSrc ? "IMG.LOADED" : "IMG.ERROR" | ||
send({ type, src: "ssr" }) | ||
} | ||
@@ -93,0 +94,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39772
598
+ Added@zag-js/anatomy@0.12.0(transitive)
+ Added@zag-js/core@0.12.0(transitive)
+ Added@zag-js/dom-query@0.12.0(transitive)
+ Added@zag-js/mutation-observer@0.12.0(transitive)
+ Added@zag-js/store@0.12.0(transitive)
+ Added@zag-js/types@0.12.0(transitive)
+ Added@zag-js/utils@0.12.0(transitive)
- Removed@zag-js/anatomy@0.11.2(transitive)
- Removed@zag-js/core@0.11.2(transitive)
- Removed@zag-js/dom-query@0.11.2(transitive)
- Removed@zag-js/mutation-observer@0.11.2(transitive)
- Removed@zag-js/store@0.11.2(transitive)
- Removed@zag-js/types@0.11.2(transitive)
- Removed@zag-js/utils@0.11.2(transitive)
Updated@zag-js/anatomy@0.12.0
Updated@zag-js/core@0.12.0
Updated@zag-js/dom-query@0.12.0
Updated@zag-js/types@0.12.0
Updated@zag-js/utils@0.12.0