laif-ds 0.1.88 → 0.1.90
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/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/components/ui/app-multiple-select-dropdown.js +76 -73
- package/dist/components/ui/app-select.js +54 -34
- package/dist/components/ui/async-select.js +88 -87
- package/dist/components/ui/button.js +32 -32
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/data-table.js +1 -1
- package/dist/components/ui/date-picker.js +7 -7
- package/dist/components/ui/input.js +15 -16
- package/dist/components/ui/multiple-selector.js +36 -34
- package/dist/components/ui/select.js +34 -29
- package/dist/components/ui/switch.js +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as p from "react";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useDebounce as
|
|
6
|
-
import { cva as
|
|
7
|
-
import { cn as
|
|
4
|
+
import { useState as a, useEffect as h, useCallback as A } from "react";
|
|
5
|
+
import { useDebounce as re } from "../../hooks/use-debounce.js";
|
|
6
|
+
import { cva as oe } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
7
|
+
import { cn as g } from "../../lib/utils.js";
|
|
8
8
|
import { Label as le } from "./label.js";
|
|
9
|
-
import { Popover as ae, PopoverTrigger as
|
|
9
|
+
import { Popover as ae, PopoverTrigger as ie, PopoverContent as ce } from "./popover.js";
|
|
10
10
|
import { Command as de, CommandInput as fe, CommandList as me, CommandEmpty as ue, CommandGroup as G, CommandItem as M } from "./command.js";
|
|
11
11
|
import { Icon as B } from "./icon.js";
|
|
12
12
|
import pe from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
13
13
|
import he from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
14
|
-
const ge =
|
|
15
|
-
"flex items-center justify-between whitespace-nowrap rounded-md border border-input bg-d-input px-3 py-2
|
|
14
|
+
const ge = oe(
|
|
15
|
+
"flex items-center justify-between whitespace-nowrap rounded-md border border-d-input bg-d-input px-3 py-2 data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
size: {
|
|
@@ -26,20 +26,20 @@ const ge = re(
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
);
|
|
29
|
-
function
|
|
30
|
-
fetcher:
|
|
29
|
+
function Te({
|
|
30
|
+
fetcher: c,
|
|
31
31
|
preload: f,
|
|
32
|
-
filterFn:
|
|
33
|
-
renderOption:
|
|
34
|
-
getOptionValue:
|
|
35
|
-
getDisplayValue:
|
|
32
|
+
filterFn: S,
|
|
33
|
+
renderOption: k,
|
|
34
|
+
getOptionValue: i,
|
|
35
|
+
getDisplayValue: x,
|
|
36
36
|
notFound: U,
|
|
37
37
|
loadingSkeleton: X,
|
|
38
38
|
label: z,
|
|
39
39
|
labelClassName: $,
|
|
40
40
|
placeholder: O = "Select...",
|
|
41
|
-
value:
|
|
42
|
-
onChange:
|
|
41
|
+
value: r = "",
|
|
42
|
+
onChange: w,
|
|
43
43
|
disabled: W = !1,
|
|
44
44
|
width: m = "200px",
|
|
45
45
|
triggerClassName: q,
|
|
@@ -47,108 +47,108 @@ function Pe({
|
|
|
47
47
|
clearable: L = !0,
|
|
48
48
|
size: J
|
|
49
49
|
}) {
|
|
50
|
-
const [
|
|
50
|
+
const [l, j] = a(!1), y = m === "auto", I = p.useRef(null), T = p.useRef(null), K = p.useRef(null), Q = p.useRef(null), [N, b] = a(!1), [v, C] = a(null), [E, R] = a(null), [D, Y] = a(""), u = re(D, f ? 0 : 300), [P, F] = a([]), [n, d] = a([]), [Z, _] = a(
|
|
51
51
|
void 0
|
|
52
52
|
);
|
|
53
53
|
h(() => ((async () => {
|
|
54
54
|
try {
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
);
|
|
59
|
-
const s = await i("");
|
|
60
|
-
A(s), d(s);
|
|
55
|
+
if (b(!0), C(null), f) {
|
|
56
|
+
const s = await c("");
|
|
57
|
+
F(s), d(s);
|
|
61
58
|
} else {
|
|
62
|
-
const s = await
|
|
59
|
+
const s = await c(r);
|
|
63
60
|
d(s);
|
|
64
61
|
}
|
|
65
62
|
} catch (s) {
|
|
66
|
-
|
|
63
|
+
C(
|
|
67
64
|
s instanceof Error ? s.message : "Failed to fetch options"
|
|
68
65
|
);
|
|
69
66
|
} finally {
|
|
70
|
-
|
|
67
|
+
b(!1);
|
|
71
68
|
}
|
|
72
69
|
})(), () => {
|
|
73
|
-
d([]),
|
|
74
|
-
}), [
|
|
75
|
-
if (
|
|
70
|
+
d([]), F([]);
|
|
71
|
+
}), [c, r, f]), h(() => {
|
|
72
|
+
if (l)
|
|
76
73
|
if (f)
|
|
77
74
|
if (u) {
|
|
78
|
-
const t =
|
|
79
|
-
(s) =>
|
|
75
|
+
const t = P.filter(
|
|
76
|
+
(s) => S ? S(s, u) : String(x(s)).toLowerCase().includes(u.toLowerCase())
|
|
80
77
|
);
|
|
81
78
|
d(t);
|
|
82
79
|
} else
|
|
83
|
-
d(
|
|
80
|
+
d(P);
|
|
84
81
|
else
|
|
85
82
|
(async () => {
|
|
86
83
|
try {
|
|
87
|
-
|
|
88
|
-
const s = await
|
|
84
|
+
b(!0), C(null);
|
|
85
|
+
const s = await c(u);
|
|
89
86
|
d(s);
|
|
90
87
|
} catch (s) {
|
|
91
|
-
|
|
88
|
+
C(
|
|
92
89
|
s instanceof Error ? s.message : "Failed to fetch options"
|
|
93
90
|
);
|
|
94
91
|
} finally {
|
|
95
|
-
|
|
92
|
+
b(!1);
|
|
96
93
|
}
|
|
97
94
|
})();
|
|
98
95
|
}, [
|
|
99
|
-
|
|
96
|
+
l,
|
|
100
97
|
u,
|
|
101
98
|
f,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
S,
|
|
100
|
+
P,
|
|
101
|
+
x
|
|
105
102
|
]), h(() => {
|
|
106
|
-
if (
|
|
107
|
-
const t = n.find((s) =>
|
|
108
|
-
|
|
109
|
-
} else
|
|
110
|
-
}, [
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
if (
|
|
114
|
-
const t =
|
|
103
|
+
if (r && n.length > 0) {
|
|
104
|
+
const t = n.find((s) => i(s) === r);
|
|
105
|
+
R(t || null);
|
|
106
|
+
} else r || R(null);
|
|
107
|
+
}, [r, n, i]), h(() => {
|
|
108
|
+
l && I.current && I.current.focus();
|
|
109
|
+
}, [l]), h(() => {
|
|
110
|
+
if (l && T.current) {
|
|
111
|
+
const t = T.current.getBoundingClientRect();
|
|
115
112
|
_(t.width);
|
|
116
113
|
}
|
|
117
|
-
}, [
|
|
118
|
-
const V =
|
|
114
|
+
}, [l]);
|
|
115
|
+
const V = A(
|
|
119
116
|
(t) => {
|
|
120
|
-
const s = L && t ===
|
|
121
|
-
|
|
117
|
+
const s = L && t === r ? "" : t, se = n.find((ne) => i(ne) === s) || null;
|
|
118
|
+
R(se), w(s), j(!1);
|
|
122
119
|
},
|
|
123
|
-
[
|
|
124
|
-
), ee =
|
|
120
|
+
[r, w, L, n, i]
|
|
121
|
+
), ee = A(
|
|
125
122
|
(t) => {
|
|
126
|
-
t.stopPropagation(), t.preventDefault(),
|
|
123
|
+
t.stopPropagation(), t.preventDefault(), R(null), w(""), j(!1);
|
|
127
124
|
},
|
|
128
|
-
[
|
|
125
|
+
[w]
|
|
129
126
|
), te = p.useId();
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
z && /* @__PURE__ */ e(le, { className: $, children: z }),
|
|
132
|
-
/* @__PURE__ */ e("div", { ref: K, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */ e(
|
|
127
|
+
return /* @__PURE__ */ o("div", { className: g("space-y-1.5", y && "w-full"), children: [
|
|
128
|
+
z && /* @__PURE__ */ e(le, { className: g($, "w-fit"), children: z }),
|
|
129
|
+
/* @__PURE__ */ e("div", { ref: K, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */ o(ae, { open: l, onOpenChange: j, children: [
|
|
130
|
+
/* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ e(
|
|
134
131
|
"button",
|
|
135
132
|
{
|
|
136
133
|
id: te,
|
|
134
|
+
ref: T,
|
|
137
135
|
type: "button",
|
|
138
136
|
disabled: W,
|
|
139
|
-
className:
|
|
137
|
+
className: g(
|
|
140
138
|
ge({ size: J }),
|
|
139
|
+
"!border-d-border/50 border !shadow-none",
|
|
141
140
|
W && "cursor-not-allowed opacity-50",
|
|
142
141
|
q,
|
|
143
142
|
"font-normal",
|
|
144
|
-
y && "w-full"
|
|
143
|
+
y && "w-full",
|
|
144
|
+
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
145
|
+
l && "ring-d-ring ring-1"
|
|
145
146
|
),
|
|
146
147
|
style: y ? void 0 : { width: m },
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
L && T && /* @__PURE__ */ e(
|
|
148
|
+
children: /* @__PURE__ */ o("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
|
|
149
|
+
E ? /* @__PURE__ */ e("div", { className: "truncate", children: x(E) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground", children: O }),
|
|
150
|
+
/* @__PURE__ */ o("div", { className: "flex w-full items-center justify-end gap-1", children: [
|
|
151
|
+
L && E && /* @__PURE__ */ e(
|
|
152
152
|
"div",
|
|
153
153
|
{
|
|
154
154
|
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
@@ -178,9 +178,9 @@ function Pe({
|
|
|
178
178
|
}
|
|
179
179
|
) }),
|
|
180
180
|
/* @__PURE__ */ e(
|
|
181
|
-
|
|
181
|
+
ce,
|
|
182
182
|
{
|
|
183
|
-
className:
|
|
183
|
+
className: g("p-0"),
|
|
184
184
|
style: {
|
|
185
185
|
width: y ? Z : typeof m == "number" ? `${m}px` : m
|
|
186
186
|
},
|
|
@@ -189,46 +189,47 @@ function Pe({
|
|
|
189
189
|
sideOffset: 4,
|
|
190
190
|
onWheel: (t) => t.stopPropagation(),
|
|
191
191
|
avoidCollisions: !1,
|
|
192
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ o(
|
|
193
193
|
de,
|
|
194
194
|
{
|
|
195
195
|
shouldFilter: !1,
|
|
196
|
-
className: "w-full border-none shadow-
|
|
196
|
+
className: "w-full border-none shadow-sm",
|
|
197
197
|
children: [
|
|
198
198
|
/* @__PURE__ */ e(
|
|
199
199
|
fe,
|
|
200
200
|
{
|
|
201
201
|
ref: I,
|
|
202
202
|
placeholder: O,
|
|
203
|
+
className: "placeholder:text-d-muted-foreground",
|
|
203
204
|
value: D,
|
|
204
205
|
onValueChange: Y
|
|
205
206
|
}
|
|
206
207
|
),
|
|
207
|
-
|
|
208
|
-
/* @__PURE__ */
|
|
208
|
+
N && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(pe, { className: "h-4 w-4 animate-spin" }) }),
|
|
209
|
+
/* @__PURE__ */ o(me, { ref: Q, children: [
|
|
209
210
|
v && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: v }),
|
|
210
|
-
|
|
211
|
-
!
|
|
212
|
-
!
|
|
211
|
+
N && n.length === 0 && (X || /* @__PURE__ */ e(xe, {})),
|
|
212
|
+
!N && !v && n.length === 0 && (U || /* @__PURE__ */ e(ue, { children: H || "No results found." })),
|
|
213
|
+
!N && !v && n.length > 0 && /* @__PURE__ */ e(G, { children: n.map((t) => /* @__PURE__ */ o(
|
|
213
214
|
M,
|
|
214
215
|
{
|
|
215
|
-
value:
|
|
216
|
+
value: i(t),
|
|
216
217
|
onSelect: V,
|
|
217
218
|
className: "cursor-pointer",
|
|
218
219
|
children: [
|
|
219
|
-
|
|
220
|
+
k ? k(t) : /* @__PURE__ */ e("span", { children: x(t) }),
|
|
220
221
|
/* @__PURE__ */ e(
|
|
221
222
|
he,
|
|
222
223
|
{
|
|
223
|
-
className:
|
|
224
|
+
className: g(
|
|
224
225
|
"ml-auto h-4 w-4",
|
|
225
|
-
|
|
226
|
+
r === i(t) ? "opacity-100" : "opacity-0"
|
|
226
227
|
)
|
|
227
228
|
}
|
|
228
229
|
)
|
|
229
230
|
]
|
|
230
231
|
},
|
|
231
|
-
|
|
232
|
+
i(t)
|
|
232
233
|
)) })
|
|
233
234
|
] })
|
|
234
235
|
]
|
|
@@ -240,15 +241,15 @@ function Pe({
|
|
|
240
241
|
] });
|
|
241
242
|
}
|
|
242
243
|
function xe() {
|
|
243
|
-
return /* @__PURE__ */ e(G, { children: [1, 2, 3].map((
|
|
244
|
+
return /* @__PURE__ */ e(G, { children: [1, 2, 3].map((c) => /* @__PURE__ */ e(M, { disabled: !0, children: /* @__PURE__ */ o("div", { className: "flex w-full items-center gap-2", children: [
|
|
244
245
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ o("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
246
247
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
|
|
247
248
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
|
|
248
249
|
] })
|
|
249
|
-
] }) },
|
|
250
|
+
] }) }, c)) });
|
|
250
251
|
}
|
|
251
252
|
export {
|
|
252
|
-
|
|
253
|
-
ge as
|
|
253
|
+
Te as AsyncSelect,
|
|
254
|
+
ge as selectTriggerVariants
|
|
254
255
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
3
3
|
import { Root as v } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
|
-
import { cva as
|
|
4
|
+
import { cva as m } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
5
|
import { cn as l } from "../../lib/utils.js";
|
|
6
6
|
import { Icon as u } from "./icon.js";
|
|
7
|
-
const
|
|
8
|
-
"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive
|
|
7
|
+
const b = m(
|
|
8
|
+
"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-d-ring focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive transition-all duration-200 ease-out transform-gpu active:scale-[0.98] active:shadow-sm overflow-hidden relative group",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90",
|
|
13
|
-
destructive: "bg-d-destructive text-white shadow-xs hover:bg-d-destructive/90 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60",
|
|
14
|
-
outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
|
|
15
|
-
"outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary",
|
|
16
|
-
secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground",
|
|
12
|
+
default: "bg-d-primary text-d-primary-foreground shadow-xs hover:bg-d-primary/90 hover:shadow-d-primary/25 [clip-path:inset(0_round_0.375rem)] before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:translate-x-[-100%] hover:before:translate-x-[100%] before:transition-transform before:duration-700 before:ease-out",
|
|
13
|
+
destructive: "bg-d-destructive text-white shadow-xs hover:bg-d-destructive/90 hover:shadow-d-destructive/25 focus-visible:ring-d-destructive/20 dark:focus-visible:ring-d-destructive/40 dark:bg-d-destructive/60 [clip-path:inset(0_round_0.375rem)] before:absolute before:inset-0 before:bg-gradient-to-r before:from-transparent before:via-white/20 before:to-transparent before:translate-x-[-100%] hover:before:translate-x-[100%] before:transition-transform before:duration-700 before:ease-out",
|
|
14
|
+
outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground hover:border-d-accent dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
|
|
15
|
+
"outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary hover:bg-d-primary/5 hover:border-d-primary/80 ",
|
|
16
|
+
secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground ",
|
|
17
17
|
ghost: "hover:bg-d-accent hover:text-d-accent-foreground dark:hover:bg-d-accent",
|
|
18
18
|
link: "text-d-primary underline-offset-4 hover:underline"
|
|
19
19
|
},
|
|
@@ -30,42 +30,42 @@ const m = h(
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
function
|
|
34
|
-
className:
|
|
35
|
-
variant:
|
|
36
|
-
size:
|
|
37
|
-
asChild:
|
|
38
|
-
iconLeft:
|
|
33
|
+
function w({
|
|
34
|
+
className: o,
|
|
35
|
+
variant: a,
|
|
36
|
+
size: e,
|
|
37
|
+
asChild: n = !1,
|
|
38
|
+
iconLeft: d,
|
|
39
39
|
iconRight: i,
|
|
40
|
-
isLoading:
|
|
40
|
+
isLoading: f = !1,
|
|
41
41
|
...t
|
|
42
42
|
}) {
|
|
43
|
-
const s =
|
|
44
|
-
return
|
|
43
|
+
const s = n ? v : "button";
|
|
44
|
+
return n ? /* @__PURE__ */ r(
|
|
45
45
|
s,
|
|
46
46
|
{
|
|
47
47
|
"data-slot": "button",
|
|
48
|
-
className: l(
|
|
48
|
+
className: l(b({ variant: a, size: e, className: o })),
|
|
49
49
|
...t
|
|
50
50
|
}
|
|
51
51
|
) : /* @__PURE__ */ c(
|
|
52
52
|
s,
|
|
53
53
|
{
|
|
54
54
|
"data-slot": "button",
|
|
55
|
-
className: l(
|
|
55
|
+
className: l(b({ variant: a, size: e, className: o }), "relative"),
|
|
56
56
|
...t,
|
|
57
57
|
children: [
|
|
58
|
-
|
|
58
|
+
f ? /* @__PURE__ */ c(
|
|
59
59
|
"svg",
|
|
60
60
|
{
|
|
61
61
|
className: "mr-1 -ml-1 animate-spin",
|
|
62
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
63
63
|
fill: "none",
|
|
64
64
|
viewBox: "0 0 24 24",
|
|
65
|
-
width:
|
|
66
|
-
height:
|
|
65
|
+
width: e === "sm" ? 14 : e === "lg" ? 20 : 16,
|
|
66
|
+
height: e === "sm" ? 14 : e === "lg" ? 20 : 16,
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ r(
|
|
69
69
|
"circle",
|
|
70
70
|
{
|
|
71
71
|
className: "opacity-25",
|
|
@@ -76,7 +76,7 @@ function k({
|
|
|
76
76
|
strokeWidth: "4"
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ r(
|
|
80
80
|
"path",
|
|
81
81
|
{
|
|
82
82
|
className: "opacity-75",
|
|
@@ -86,19 +86,19 @@ function k({
|
|
|
86
86
|
)
|
|
87
87
|
]
|
|
88
88
|
}
|
|
89
|
-
) :
|
|
89
|
+
) : d && /* @__PURE__ */ r(
|
|
90
90
|
u,
|
|
91
91
|
{
|
|
92
|
-
name:
|
|
93
|
-
size:
|
|
92
|
+
name: d,
|
|
93
|
+
size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
96
|
t.children,
|
|
97
|
-
i && /* @__PURE__ */
|
|
97
|
+
i && /* @__PURE__ */ r(
|
|
98
98
|
u,
|
|
99
99
|
{
|
|
100
100
|
name: i,
|
|
101
|
-
size:
|
|
101
|
+
size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
]
|
|
@@ -106,6 +106,6 @@ function k({
|
|
|
106
106
|
);
|
|
107
107
|
}
|
|
108
108
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
w as Button,
|
|
110
|
+
b as buttonVariants
|
|
111
111
|
};
|
|
@@ -64,7 +64,7 @@ function B({
|
|
|
64
64
|
t.dropdowns
|
|
65
65
|
),
|
|
66
66
|
dropdown_root: e(
|
|
67
|
-
"relative has-focus:border-ring border border-d-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
67
|
+
"relative has-focus:border-ring border border-d-input shadow-xs has-focus:ring-d-ring/50 has-focus:ring-[3px] rounded-md",
|
|
68
68
|
t.dropdown_root
|
|
69
69
|
),
|
|
70
70
|
dropdown: e("absolute inset-0 opacity-0", t.dropdown),
|
|
@@ -159,7 +159,7 @@ function v({
|
|
|
159
159
|
"data-range-end": r.range_end,
|
|
160
160
|
"data-range-middle": r.range_middle,
|
|
161
161
|
className: e(
|
|
162
|
-
"data-[selected-single=true]:bg-d-primary data-[selected-single=true]:text-d-primary-foreground data-[range-middle=true]:bg-d-accent data-[range-middle=true]:text-d-accent-foreground data-[range-start=true]:bg-d-primary data-[range-start=true]:text-d-primary-foreground data-[range-end=true]:bg-d-primary data-[range-end=true]:text-d-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-d-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[1px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
162
|
+
"data-[selected-single=true]:bg-d-primary data-[selected-single=true]:text-d-primary-foreground data-[range-middle=true]:bg-d-accent data-[range-middle=true]:text-d-accent-foreground data-[range-start=true]:bg-d-primary data-[range-start=true]:text-d-primary-foreground data-[range-end=true]:bg-d-primary data-[range-end=true]:text-d-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-d-ring/50 dark:hover:text-d-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[1px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
163
163
|
s.day,
|
|
164
164
|
c
|
|
165
165
|
),
|
|
@@ -242,7 +242,7 @@ function Ue({
|
|
|
242
242
|
),
|
|
243
243
|
/* @__PURE__ */ n("div", { className: "flex h-full max-w-full min-w-0 flex-1 items-center", children: d && d.length > 0 && /* @__PURE__ */ h(W, { className: "h-full w-full", children: [
|
|
244
244
|
/* @__PURE__ */ n(F, { orientation: "horizontal" }),
|
|
245
|
-
/* @__PURE__ */ n("div", { className: "flex w-full max-w-full min-w-0 items-center justify-start gap-2 sm:justify-end", children: d.map((e, t) => {
|
|
245
|
+
/* @__PURE__ */ n("div", { className: "flex w-full max-w-full min-w-0 items-center justify-start gap-2 p-0.5 sm:justify-end", children: d.map((e, t) => {
|
|
246
246
|
const l = I[e.column] ?? [];
|
|
247
247
|
return /* @__PURE__ */ n(
|
|
248
248
|
Re,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as c from "react";
|
|
4
4
|
import { cn as g } from "../../lib/utils.js";
|
|
5
5
|
import { buttonVariants as x } from "./button.js";
|
|
6
6
|
import { Icon as h } from "./icon.js";
|
|
@@ -17,20 +17,20 @@ function E({
|
|
|
17
17
|
disabled: t = !1,
|
|
18
18
|
size: o = "default"
|
|
19
19
|
}) {
|
|
20
|
-
const [r, i] =
|
|
21
|
-
|
|
20
|
+
const [r, i] = c.useState(n);
|
|
21
|
+
c.useEffect(() => {
|
|
22
22
|
i(n);
|
|
23
23
|
}, [n]);
|
|
24
24
|
const p = (s) => {
|
|
25
25
|
i(s), a && a(s);
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ d(w, { open: t ? !1 : void 0, children: [
|
|
28
28
|
/* @__PURE__ */ e(P, { asChild: !0, children: /* @__PURE__ */ e(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
31
|
className: g(
|
|
32
32
|
x({ variant: u, size: o }),
|
|
33
|
-
"border-d-input text-d-foreground hover:bg-d-accent bg-d-input ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none [&>span]:line-clamp-1",
|
|
33
|
+
"border-d-input text-d-foreground hover:bg-d-accent bg-d-input ring-offset-background data-[placeholder]:text-d-muted-foreground focus:ring-d-ring flex items-center justify-between border px-3 py-2 font-normal whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none [&>span]:line-clamp-1",
|
|
34
34
|
!r && "text-d-muted-foreground",
|
|
35
35
|
t && "cursor-not-allowed opacity-50",
|
|
36
36
|
f,
|
|
@@ -42,7 +42,7 @@ function E({
|
|
|
42
42
|
tabIndex: t ? -1 : 0,
|
|
43
43
|
onClick: t ? void 0 : () => {
|
|
44
44
|
},
|
|
45
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ d("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
46
46
|
/* @__PURE__ */ e(
|
|
47
47
|
h,
|
|
48
48
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as x from "react";
|
|
4
4
|
import { cva as g } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as l } from "../../lib/utils.js";
|
|
6
6
|
import { Label as v } from "./label.js";
|
|
7
|
-
import { Icon as
|
|
7
|
+
import { Icon as s } from "./icon.js";
|
|
8
8
|
const b = g(
|
|
9
|
-
"file:text-d-foreground placeholder:text-d-muted-foreground selection:bg-d-primary selection:text-d-primary-foreground
|
|
9
|
+
"file:text-d-foreground placeholder:text-d-muted-foreground shadow-none selection:bg-d-primary selection:text-d-primary-foreground flex w-full min-w-0 rounded-md bg-d-input border border-d-border/50 px-3 py-1 text-base transition-all duration-200 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
size: {
|
|
@@ -27,34 +27,33 @@ const b = g(
|
|
|
27
27
|
labelClassName: u,
|
|
28
28
|
id: p,
|
|
29
29
|
iconLeft: i,
|
|
30
|
-
iconRight:
|
|
30
|
+
iconRight: n,
|
|
31
31
|
size: t,
|
|
32
32
|
...f
|
|
33
33
|
}, c) => {
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
r && /* @__PURE__ */ e(v, { htmlFor:
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
i && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
34
|
+
const d = p || (r ? `input-${Math.random().toString(36).substring(2, 9)}` : void 0);
|
|
35
|
+
return /* @__PURE__ */ a("div", { className: l("space-y-1.5", o), children: [
|
|
36
|
+
r && /* @__PURE__ */ e(v, { htmlFor: d, className: u, children: r }),
|
|
37
|
+
/* @__PURE__ */ a("div", { className: "relative w-full", children: [
|
|
38
|
+
i && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ e(s, { name: i, size: t === "lg" ? "sm" : "xs" }) }),
|
|
39
39
|
/* @__PURE__ */ e(
|
|
40
40
|
"input",
|
|
41
41
|
{
|
|
42
|
-
id:
|
|
42
|
+
id: d,
|
|
43
43
|
type: m,
|
|
44
44
|
"data-slot": "input",
|
|
45
|
-
className:
|
|
45
|
+
className: l(
|
|
46
46
|
b({ size: t }),
|
|
47
|
-
"focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none",
|
|
47
|
+
"focus-visible:ring-d-ring focus-visible:ring-1 focus-visible:outline-none",
|
|
48
48
|
"aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
|
|
49
|
-
"shadow-sm",
|
|
50
49
|
i ? t !== "lg" ? "pl-9" : "pl-10" : "",
|
|
51
|
-
|
|
50
|
+
n ? t !== "lg" ? "pr-9" : "pr-10" : ""
|
|
52
51
|
),
|
|
53
52
|
ref: c,
|
|
54
53
|
...f
|
|
55
54
|
}
|
|
56
55
|
),
|
|
57
|
-
|
|
56
|
+
n && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(s, { name: n, size: t === "lg" ? "sm" : "xs" }) })
|
|
58
57
|
] })
|
|
59
58
|
] });
|
|
60
59
|
}
|