@ztwoint/z-ui 0.1.133 → 0.1.135
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as h from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Z2RadioGroupItem as
|
|
5
|
-
import { CheckIcon as
|
|
6
|
-
import { Z2TextPreset as
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
3
|
+
import { cn as i } from "../../lib/utils.js";
|
|
4
|
+
import { Z2RadioGroupItem as p, Z2RadioGroupIndicator as x } from "../radio/z2-radio.js";
|
|
5
|
+
import { CheckIcon as v } from "lucide-react";
|
|
6
|
+
import { Z2TextPreset as k } from "../text-preset/text-preset.js";
|
|
7
|
+
function g({ primaryText: t, supportText: o }) {
|
|
8
|
+
return /* @__PURE__ */ r(
|
|
9
|
+
k,
|
|
10
10
|
{
|
|
11
11
|
type: "L",
|
|
12
12
|
multiline: !0,
|
|
@@ -22,43 +22,43 @@ function j({
|
|
|
22
22
|
supportText: o,
|
|
23
23
|
value: n,
|
|
24
24
|
id: c,
|
|
25
|
-
disabled:
|
|
25
|
+
disabled: s,
|
|
26
26
|
className: l,
|
|
27
|
-
itemClassName:
|
|
27
|
+
itemClassName: u,
|
|
28
28
|
endIcon: a
|
|
29
29
|
}) {
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
const e = h.useRef(null);
|
|
31
|
+
return /* @__PURE__ */ f(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
onClick: (
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
34
|
+
onClick: (d) => {
|
|
35
|
+
if (s) return;
|
|
36
|
+
const m = d.target;
|
|
37
|
+
e.current && !e.current.contains(m) && e.current.click();
|
|
38
38
|
},
|
|
39
|
-
className:
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
//
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
"has-[&[data-state=checked]]:border-stroke-solid-active
|
|
39
|
+
className: i(
|
|
40
|
+
// Base card styles (unchecked state)
|
|
41
|
+
"group relative flex items-start justify-start cursor-pointer p-3.5 gap-3 rounded-xl border border-stroke-solid-light bg-surface-neutral-default shadow-xs transition-colors",
|
|
42
|
+
// Hover state
|
|
43
|
+
"hover:border-stroke-solid-hover hover:bg-surface-neutral-hover hover:shadow-sm",
|
|
44
|
+
// Checked state styles (no left accent border)
|
|
45
|
+
"has-[&[data-state=checked]]:border-stroke-solid-active has-[&[data-state=checked]]:shadow-md",
|
|
46
46
|
l
|
|
47
47
|
),
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
p,
|
|
51
51
|
{
|
|
52
|
-
ref:
|
|
52
|
+
ref: e,
|
|
53
53
|
value: n,
|
|
54
54
|
id: c,
|
|
55
|
-
disabled:
|
|
56
|
-
className:
|
|
57
|
-
children: /* @__PURE__ */
|
|
55
|
+
disabled: s,
|
|
56
|
+
className: i(u),
|
|
57
|
+
children: /* @__PURE__ */ r(x, { children: /* @__PURE__ */ r(v, { className: "size-2.5 text-surface-neutral-default" }) })
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
a ? /* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ r(g, { primaryText: t, supportText: o }),
|
|
61
|
+
a ? /* @__PURE__ */ r("div", { className: "ml-auto flex-shrink-0 pointer-events-none", children: a }) : null
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
);
|