@ztwoint/z-ui 0.1.110 → 0.1.112
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,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface Z2RadioCardProps {
|
|
2
3
|
primaryText: string;
|
|
3
4
|
supportText: string;
|
|
4
5
|
value: string;
|
|
@@ -6,5 +7,7 @@ declare function Z2RadioCard({ primaryText, supportText, value, id, disabled, cl
|
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
itemClassName?: string;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
endIcon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function Z2RadioCard({ primaryText, supportText, value, id, disabled, className, itemClassName, endIcon, }: Z2RadioCardProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Z2RadioCard, Z2RadioCardProps };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as h from "react";
|
|
3
|
+
import { cn as s } from "../../lib/utils.js";
|
|
4
|
+
import { Z2RadioGroupItem as b, Z2RadioGroupIndicator as p } from "../radio/z2-radio.js";
|
|
5
|
+
import { CheckIcon as k } from "lucide-react";
|
|
6
|
+
import { Z2TextPreset as x } from "../text-preset/text-preset.js";
|
|
7
|
+
function v({ primaryText: t, supportText: o }) {
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
x,
|
|
10
|
+
{
|
|
11
|
+
type: "L",
|
|
12
|
+
multiline: !0,
|
|
13
|
+
primaryFirst: !0,
|
|
14
|
+
primaryText: t,
|
|
15
|
+
supportText: o,
|
|
16
|
+
className: "flex-1 min-w-0 min-h-0"
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function j({
|
|
21
|
+
primaryText: t,
|
|
22
|
+
supportText: o,
|
|
23
|
+
value: n,
|
|
24
|
+
id: c,
|
|
25
|
+
disabled: i,
|
|
26
|
+
className: l,
|
|
27
|
+
itemClassName: d,
|
|
28
|
+
endIcon: a
|
|
29
|
+
}) {
|
|
30
|
+
const r = h.useRef(null);
|
|
31
|
+
return /* @__PURE__ */ m(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
onClick: (f) => {
|
|
35
|
+
if (i) return;
|
|
36
|
+
const u = f.target;
|
|
37
|
+
r.current && !r.current.contains(u) && r.current.click();
|
|
38
|
+
},
|
|
39
|
+
className: s(
|
|
40
|
+
"group relative flex items-start justify-start cursor-pointer p-3.5 gap-3 border border-stroke-solid-light rounded-xl transition-colors overflow-hidden",
|
|
41
|
+
"hover:border-stroke-solid-hover",
|
|
42
|
+
// Left accent when checked (pseudo element)
|
|
43
|
+
'before:content-[""] before:absolute before:inset-y-0 before:left-0 before:w-1 before:rounded-l-xl before:bg-stroke-solid-active before:hidden has-[&[data-state=checked]]:before:block',
|
|
44
|
+
// When the nested radio is checked, style the card
|
|
45
|
+
"has-[&[data-state=checked]]:border-stroke-solid-active has-[&[data-state=checked]]:bg-surface-accent-default/10",
|
|
46
|
+
l
|
|
47
|
+
),
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ e(
|
|
50
|
+
b,
|
|
51
|
+
{
|
|
52
|
+
ref: r,
|
|
53
|
+
value: n,
|
|
54
|
+
id: c,
|
|
55
|
+
disabled: i,
|
|
56
|
+
className: s(d),
|
|
57
|
+
children: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(k, { className: "size-2.5 text-surface-neutral-default" }) })
|
|
58
|
+
}
|
|
59
|
+
),
|
|
60
|
+
/* @__PURE__ */ e(v, { primaryText: t, supportText: o }),
|
|
61
|
+
a ? /* @__PURE__ */ e("div", { className: "ml-auto flex-shrink-0 pointer-events-none", children: a }) : null
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
j as Z2RadioCard
|
|
68
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -110,10 +110,11 @@ import { Z2Table as Za, Z2TableBase as ca, Z2TableBody as sa, Z2TableBodyRow as
|
|
|
110
110
|
import { Z2TableContainer as Aa, Z2TableProvider as ya, Z2TableRoot as ka, useZ2Table as Ha } from "./components/dynamic-table/z2-table-context.js";
|
|
111
111
|
import { Z2TablePagination as Na } from "./components/dynamic-table/z2-table-pagination.js";
|
|
112
112
|
import { Z2TableColumnHeader as Ga } from "./components/dynamic-table/z2-column-header.js";
|
|
113
|
-
import {
|
|
113
|
+
import { Z2RadioCard as _a } from "./components/radio-card/radio-card.js";
|
|
114
114
|
import { useTheme as Ua } from "./lib/theme.hook.js";
|
|
115
|
-
import {
|
|
116
|
-
import {
|
|
115
|
+
import { cn as Xa } from "./lib/utils.js";
|
|
116
|
+
import { Z2PopoverTrigger as Ja } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
117
|
+
import { Z2PopoverContent as Ya } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
117
118
|
export {
|
|
118
119
|
p as Alert,
|
|
119
120
|
m as AlertCirclesIcon,
|
|
@@ -252,8 +253,9 @@ export {
|
|
|
252
253
|
Do as Z2DropdownSubTrigger,
|
|
253
254
|
Gt as Z2Icon,
|
|
254
255
|
y as Z2Popover,
|
|
255
|
-
|
|
256
|
-
|
|
256
|
+
Ya as Z2PopoverContent,
|
|
257
|
+
Ja as Z2PopoverTrigger,
|
|
258
|
+
_a as Z2RadioCard,
|
|
257
259
|
Gr as Z2RadioGroup,
|
|
258
260
|
Wr as Z2RadioGroupIndicator,
|
|
259
261
|
_r as Z2RadioGroupItem,
|
|
@@ -309,7 +311,7 @@ export {
|
|
|
309
311
|
cr as Z2Tooltip,
|
|
310
312
|
Sr as badgeVariants,
|
|
311
313
|
i as buttonVariants,
|
|
312
|
-
|
|
314
|
+
Xa as cn,
|
|
313
315
|
Ce as extractCellValue,
|
|
314
316
|
Le as useTableContext,
|
|
315
317
|
Ua as useTheme,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface Z2RadioCardProps {
|
|
2
3
|
primaryText: string;
|
|
3
4
|
supportText: string;
|
|
4
5
|
value: string;
|
|
@@ -6,5 +7,7 @@ declare function Z2RadioCard({ primaryText, supportText, value, id, disabled, cl
|
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
className?: string;
|
|
8
9
|
itemClassName?: string;
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
endIcon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function Z2RadioCard({ primaryText, supportText, value, id, disabled, className, itemClassName, endIcon, }: Z2RadioCardProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Z2RadioCard, Z2RadioCardProps };
|