@photoroom/ui 0.1.106 → 0.1.107
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/components/input/FloatingInput/FloatingInput.d.ts +8 -0
- package/components/input/FloatingInput/FloatingInput.d.ts.map +1 -1
- package/components/input/FloatingInput/ReferenceImageFooter.d.ts +8 -0
- package/components/input/FloatingInput/ReferenceImageFooter.d.ts.map +1 -0
- package/components/input/FloatingInput/index.d.ts +1 -1
- package/components/input/FloatingInput/index.d.ts.map +1 -1
- package/components/input/FloatingInput/types.d.ts +18 -0
- package/components/input/FloatingInput/types.d.ts.map +1 -0
- package/components/input/ImageWidget/ImageWidget.d.ts +11 -0
- package/components/input/ImageWidget/ImageWidget.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.mjs +21 -21
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -46707,53 +46707,53 @@ var z3 = l(({ icon: e, className: t, ...n }, r) => /* @__PURE__ */ T("button", {
|
|
|
46707
46707
|
z3.displayName = "ImageWidgetButton";
|
|
46708
46708
|
//#endregion
|
|
46709
46709
|
//#region src/components/input/ImageWidget/ImageWidget.tsx
|
|
46710
|
-
var B3 = .5, V3 = 2, Rue = 80, zue = 80, H3 = l(({ src: e, alt: t, width: n = zue, height: r = Rue, flexibleWidth: i = !1, fill: a = !1, isLoading: o = !1,
|
|
46711
|
-
let [
|
|
46710
|
+
var B3 = .5, V3 = 2, Rue = 80, zue = 80, H3 = l(({ src: e, alt: t, width: n = zue, height: r = Rue, flexibleWidth: i = !1, fill: a = !1, isLoading: o = !1, selected: s = !1, disabled: c = !1, buttonIcon: l, onButtonClick: u, buttonLabel: d, className: f, imgClassName: m }, h) => {
|
|
46711
|
+
let [g, _] = C(null), v = p((e) => {
|
|
46712
46712
|
let t = e.currentTarget;
|
|
46713
|
-
t.naturalWidth && t.naturalHeight &&
|
|
46714
|
-
}, []), { width:
|
|
46715
|
-
width: Math.round(r * Math.min(V3, Math.max(B3,
|
|
46713
|
+
t.naturalWidth && t.naturalHeight && _(t.naturalWidth / t.naturalHeight);
|
|
46714
|
+
}, []), { width: y, height: x, isClamped: S } = b(() => i && g !== null ? {
|
|
46715
|
+
width: Math.round(r * Math.min(V3, Math.max(B3, g))),
|
|
46716
46716
|
height: r,
|
|
46717
|
-
isClamped:
|
|
46717
|
+
isClamped: g < B3 || g > V3
|
|
46718
46718
|
} : {
|
|
46719
46719
|
width: n,
|
|
46720
46720
|
height: r,
|
|
46721
46721
|
isClamped: !1
|
|
46722
46722
|
}, [
|
|
46723
46723
|
i,
|
|
46724
|
-
|
|
46724
|
+
g,
|
|
46725
46725
|
r,
|
|
46726
46726
|
n
|
|
46727
|
-
]),
|
|
46727
|
+
]), w = !o && l && u;
|
|
46728
46728
|
return /* @__PURE__ */ E("div", {
|
|
46729
|
-
ref:
|
|
46730
|
-
className: H("group", a ? "absolute inset-0" : "relative shrink-0",
|
|
46729
|
+
ref: h,
|
|
46730
|
+
className: H("group", a ? "absolute inset-0" : "relative shrink-0", f),
|
|
46731
46731
|
style: a ? void 0 : {
|
|
46732
|
-
width:
|
|
46733
|
-
height:
|
|
46732
|
+
width: y,
|
|
46733
|
+
height: x
|
|
46734
46734
|
},
|
|
46735
46735
|
children: [/* @__PURE__ */ E("div", {
|
|
46736
|
-
className: V("rounded-400 bg-surface-default relative h-full w-full overflow-hidden", "after:rounded-400 after:pointer-events-none after:absolute after:inset-0 after:shadow-[
|
|
46736
|
+
className: V("rounded-400 bg-surface-default relative h-full w-full overflow-hidden", "after:rounded-400 after:pointer-events-none after:absolute after:inset-0 after:content-['']", s ? "after:shadow-[inset_0_0_0_2px_var(--color-content-accent)]" : "after:shadow-[inset_0_0_0_1px_var(--color-misc-border)]"),
|
|
46737
46737
|
children: [o ? /* @__PURE__ */ T("div", {
|
|
46738
46738
|
className: "flex h-full w-full items-center justify-center",
|
|
46739
46739
|
children: /* @__PURE__ */ T(pG, { className: "size-6" })
|
|
46740
46740
|
}) : /* @__PURE__ */ T("img", {
|
|
46741
46741
|
src: e,
|
|
46742
46742
|
alt: t,
|
|
46743
|
-
className: H("h-full w-full",
|
|
46744
|
-
onLoad: i ?
|
|
46745
|
-
}), /* @__PURE__ */ T("div", { className: "rounded-400 interaction-transition group-hover:bg-misc-visual-hover group-active:bg-misc-visual-down absolute inset-0 transition-colors" })]
|
|
46746
|
-
}),
|
|
46743
|
+
className: H("h-full w-full", S ? "object-contain" : "object-cover", m),
|
|
46744
|
+
onLoad: i ? v : void 0
|
|
46745
|
+
}), !c && /* @__PURE__ */ T("div", { className: "rounded-400 interaction-transition group-hover:bg-misc-visual-hover group-active:bg-misc-visual-down absolute inset-0 transition-colors" })]
|
|
46746
|
+
}), w && /* @__PURE__ */ T("div", {
|
|
46747
46747
|
className: "absolute top-1 right-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 focus-within:opacity-100",
|
|
46748
46748
|
children: /* @__PURE__ */ T(oo, {
|
|
46749
|
-
content:
|
|
46749
|
+
content: d,
|
|
46750
46750
|
side: "top",
|
|
46751
46751
|
children: /* @__PURE__ */ T(z3, {
|
|
46752
|
-
icon:
|
|
46752
|
+
icon: l,
|
|
46753
46753
|
onClick: (e) => {
|
|
46754
|
-
e.stopPropagation(),
|
|
46754
|
+
e.stopPropagation(), u();
|
|
46755
46755
|
},
|
|
46756
|
-
"aria-label":
|
|
46756
|
+
"aria-label": d
|
|
46757
46757
|
})
|
|
46758
46758
|
})
|
|
46759
46759
|
})]
|