@clasing/ui 2.7.5 → 2.9.0
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/{badge-DnN1HZI0.js → badge-CaH3b0zW.js} +12 -15
- package/dist/{button-C8ApjC1N.js → button-DSpGxL2e.js} +11 -12
- package/dist/components/accordion.js +14 -16
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/blocks/interactive-card.js +45 -51
- package/dist/components/blocks/selectable-chips.js +33 -32
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/checkbox.js +13 -15
- package/dist/components/context-menu.js +7 -7
- package/dist/components/dropdown-menu.js +38 -38
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/multi-select.js +36 -38
- package/dist/components/navigation-menu.js +16 -19
- package/dist/components/phone-input.js +88 -80
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.js +18 -20
- package/dist/components/textarea.js +19 -25
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/{input-EFdg0T-Q.js → input-D9gqZjs0.js} +34 -42
- package/dist/{scroll-area-DQenuQib.js → scroll-area-BTNDZ-p2.js} +11 -13
- package/dist/{toggle-Bj6sVNqF.js → toggle-Df9QfXij.js} +9 -11
- package/dist/ui.css +57 -35
- package/package.json +1 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { j as e, c as p } from "../index-C_XDkVGm.js";
|
|
2
|
-
import { C as
|
|
3
|
-
import { I as M } from "../input-
|
|
2
|
+
import { C as O, d as A, f as F, b as L, c as D, e as N } from "../command-Cq3FhQXv.js";
|
|
3
|
+
import { I as M } from "../input-D9gqZjs0.js";
|
|
4
4
|
import { P as q, c as H, b as G } from "../popover-CLQxfbEi.js";
|
|
5
|
-
import { S as W } from "../scroll-area-
|
|
5
|
+
import { S as W } from "../scroll-area-BTNDZ-p2.js";
|
|
6
6
|
import { CaretDownIcon as $, CheckIcon as B } from "@phosphor-icons/react";
|
|
7
|
-
import * as
|
|
7
|
+
import * as n from "react";
|
|
8
8
|
import * as I from "react-phone-number-input";
|
|
9
9
|
import J from "react-phone-number-input/flags";
|
|
10
10
|
import K from "react-phone-number-input/locale/en";
|
|
11
11
|
import Q from "react-phone-number-input/locale/es";
|
|
12
12
|
import U from "react-phone-number-input/locale/fr";
|
|
13
|
-
function X(r,
|
|
14
|
-
const [
|
|
15
|
-
return
|
|
13
|
+
function X(r, o) {
|
|
14
|
+
const [t, s] = n.useState(r);
|
|
15
|
+
return n.useEffect(() => {
|
|
16
16
|
const a = setTimeout(() => {
|
|
17
17
|
s(r);
|
|
18
|
-
},
|
|
18
|
+
}, o);
|
|
19
19
|
return () => {
|
|
20
20
|
clearTimeout(a);
|
|
21
21
|
};
|
|
22
|
-
}, [r,
|
|
22
|
+
}, [r, o]), t;
|
|
23
23
|
}
|
|
24
|
-
const Y =
|
|
24
|
+
const Y = n.forwardRef(
|
|
25
25
|
({
|
|
26
26
|
className: r,
|
|
27
|
-
onChange:
|
|
28
|
-
value:
|
|
27
|
+
onChange: o,
|
|
28
|
+
value: t,
|
|
29
29
|
size: s = "md",
|
|
30
30
|
rounded: a = "default",
|
|
31
|
-
locale:
|
|
32
|
-
...
|
|
31
|
+
locale: u = "en",
|
|
32
|
+
...d
|
|
33
33
|
}, c) => /* @__PURE__ */ e.jsx(
|
|
34
34
|
I.default,
|
|
35
35
|
{
|
|
@@ -39,66 +39,66 @@ const Y = t.forwardRef(
|
|
|
39
39
|
countrySelectComponent: E,
|
|
40
40
|
inputComponent: P,
|
|
41
41
|
smartCaret: !1,
|
|
42
|
-
labels:
|
|
43
|
-
value:
|
|
44
|
-
onChange: (h) =>
|
|
42
|
+
labels: u === "es" ? Q : u === "fr" ? U : K,
|
|
43
|
+
value: t || void 0,
|
|
44
|
+
onChange: (h) => o?.(h || ""),
|
|
45
45
|
countrySelectProps: {
|
|
46
46
|
size: s,
|
|
47
47
|
rounded: a,
|
|
48
|
-
...
|
|
48
|
+
...d
|
|
49
49
|
},
|
|
50
50
|
numberInputProps: {
|
|
51
51
|
size: s,
|
|
52
52
|
rounded: a,
|
|
53
|
-
...
|
|
53
|
+
...d
|
|
54
54
|
},
|
|
55
|
-
...
|
|
55
|
+
...d
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
);
|
|
59
59
|
Y.displayName = "PhoneInput";
|
|
60
|
-
const P =
|
|
61
|
-
const { "data-country":
|
|
60
|
+
const P = n.forwardRef(({ className: r, rounded: o = "default", size: t, ...s }, a) => {
|
|
61
|
+
const { "data-country": u, ...d } = s;
|
|
62
62
|
return /* @__PURE__ */ e.jsx(
|
|
63
63
|
M,
|
|
64
64
|
{
|
|
65
|
-
size:
|
|
65
|
+
size: t,
|
|
66
66
|
className: p(
|
|
67
67
|
"w-full",
|
|
68
68
|
{
|
|
69
|
-
"rounded-s-none rounded-e-lg":
|
|
70
|
-
"rounded-s-none rounded-e-full":
|
|
71
|
-
"rounded-e-sm":
|
|
72
|
-
"rounded-e-md":
|
|
73
|
-
"rounded-e-lg":
|
|
69
|
+
"rounded-s-none rounded-e-lg": o !== "full",
|
|
70
|
+
"rounded-s-none rounded-e-full": o === "full",
|
|
71
|
+
"rounded-e-sm": t === "sm",
|
|
72
|
+
"rounded-e-md": t === "md",
|
|
73
|
+
"rounded-e-lg": t === "lg"
|
|
74
74
|
},
|
|
75
75
|
r
|
|
76
76
|
),
|
|
77
|
-
...
|
|
77
|
+
...d,
|
|
78
78
|
ref: a
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
81
|
});
|
|
82
82
|
P.displayName = "InputComponent";
|
|
83
|
-
const E =
|
|
83
|
+
const E = n.memo(
|
|
84
84
|
({
|
|
85
85
|
disabled: r,
|
|
86
|
-
value:
|
|
87
|
-
options:
|
|
86
|
+
value: o,
|
|
87
|
+
options: t,
|
|
88
88
|
onChange: s,
|
|
89
89
|
size: a = "md",
|
|
90
|
-
rounded:
|
|
91
|
-
...
|
|
90
|
+
rounded: u = "default",
|
|
91
|
+
...d
|
|
92
92
|
}) => {
|
|
93
|
-
const c =
|
|
93
|
+
const c = n.useRef(null), [h, j] = n.useState(""), [b, v] = n.useState(!1), [w, y] = n.useState(20), f = X(h, 100), m = n.useMemo(() => f ? t.filter(
|
|
94
94
|
({ label: l, value: i }) => i && (l.toLowerCase().includes(f.toLowerCase()) || i.toLowerCase().includes(f.toLowerCase()))
|
|
95
|
-
) :
|
|
96
|
-
() => m.slice(0,
|
|
97
|
-
[m,
|
|
95
|
+
) : t, [t, f]), g = n.useMemo(
|
|
96
|
+
() => m.slice(0, w),
|
|
97
|
+
[m, w]
|
|
98
98
|
);
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
}, [f]),
|
|
99
|
+
return n.useEffect(() => {
|
|
100
|
+
y(20);
|
|
101
|
+
}, [f]), n.useEffect(() => {
|
|
102
102
|
if (!b) return;
|
|
103
103
|
const l = setTimeout(() => {
|
|
104
104
|
if (!c.current) return;
|
|
@@ -107,9 +107,9 @@ const E = t.memo(
|
|
|
107
107
|
);
|
|
108
108
|
if (!x) return;
|
|
109
109
|
const S = () => {
|
|
110
|
-
const { scrollTop:
|
|
111
|
-
|
|
112
|
-
(
|
|
110
|
+
const { scrollTop: _, scrollHeight: V, clientHeight: R } = x;
|
|
111
|
+
_ + R >= V - 100 && y(
|
|
112
|
+
(k) => Math.min(k + 20, m.length)
|
|
113
113
|
);
|
|
114
114
|
};
|
|
115
115
|
x.addEventListener("scroll", S, {
|
|
@@ -136,18 +136,15 @@ const E = t.memo(
|
|
|
136
136
|
"button",
|
|
137
137
|
{
|
|
138
138
|
type: "button",
|
|
139
|
-
"aria-invalid":
|
|
139
|
+
"aria-invalid": d["aria-invalid"],
|
|
140
140
|
className: p(
|
|
141
141
|
`
|
|
142
142
|
flex w-fit min-w-0 items-center justify-center border border-r-0
|
|
143
|
-
border-input bg-transparent paragraph-md
|
|
144
|
-
transition-[color,box-shadow] outline-none
|
|
143
|
+
border-input bg-transparent paragraph-md focusable-item
|
|
145
144
|
selection:bg-primary selection:text-primary-foreground
|
|
146
145
|
file:inline-flex file:border-0 file:bg-transparent
|
|
147
146
|
file:paragraph-sm file:font-semibold file:text-foreground
|
|
148
147
|
placeholder:text-muted-foreground
|
|
149
|
-
focus-visible:z-1 focus-visible:border-ring
|
|
150
|
-
focus-visible:ring-[3px] focus-visible:ring-ring/50
|
|
151
148
|
disabled:pointer-events-none disabled:cursor-not-allowed
|
|
152
149
|
disabled:opacity-50
|
|
153
150
|
aria-invalid:border-destructive-foreground
|
|
@@ -156,7 +153,7 @@ const E = t.memo(
|
|
|
156
153
|
dark:bg-input/30
|
|
157
154
|
dark:aria-invalid:ring-destructive-foreground/40
|
|
158
155
|
`,
|
|
159
|
-
|
|
156
|
+
u === "default" ? "rounded-e-none" : "rounded-s-full rounded-e-none",
|
|
160
157
|
{
|
|
161
158
|
"h-8 rounded-s-sm px-2 py-1 label-md": a === "sm",
|
|
162
159
|
"h-12 rounded-s-md px-3 py-1 label-lg": a === "md",
|
|
@@ -164,13 +161,13 @@ const E = t.memo(
|
|
|
164
161
|
}
|
|
165
162
|
),
|
|
166
163
|
disabled: r,
|
|
167
|
-
...
|
|
164
|
+
...d,
|
|
168
165
|
children: [
|
|
169
166
|
/* @__PURE__ */ e.jsx(
|
|
170
167
|
C,
|
|
171
168
|
{
|
|
172
|
-
country:
|
|
173
|
-
countryName:
|
|
169
|
+
country: o,
|
|
170
|
+
countryName: o,
|
|
174
171
|
disabled: r
|
|
175
172
|
}
|
|
176
173
|
),
|
|
@@ -186,7 +183,7 @@ const E = t.memo(
|
|
|
186
183
|
]
|
|
187
184
|
}
|
|
188
185
|
) }),
|
|
189
|
-
/* @__PURE__ */ e.jsx(G, { className: "w-
|
|
186
|
+
/* @__PURE__ */ e.jsx(G, { className: "w-75 p-0", children: /* @__PURE__ */ e.jsxs(O, { children: [
|
|
190
187
|
/* @__PURE__ */ e.jsx(
|
|
191
188
|
A,
|
|
192
189
|
{
|
|
@@ -205,15 +202,15 @@ const E = t.memo(
|
|
|
205
202
|
}
|
|
206
203
|
),
|
|
207
204
|
/* @__PURE__ */ e.jsx(F, { children: /* @__PURE__ */ e.jsxs(W, { ref: c, className: "h-72", children: [
|
|
208
|
-
/* @__PURE__ */ e.jsx(L, { children: g
|
|
205
|
+
/* @__PURE__ */ e.jsx(L, { children: g?.length === 0 && t?.length > 20 ? "Too many results. Please refine your search." : "No country found." }),
|
|
209
206
|
/* @__PURE__ */ e.jsxs(D, { children: [
|
|
210
|
-
g
|
|
207
|
+
g?.map(
|
|
211
208
|
({ value: l, label: i }) => l ? /* @__PURE__ */ e.jsx(
|
|
212
209
|
T,
|
|
213
210
|
{
|
|
214
211
|
country: l,
|
|
215
212
|
countryName: i,
|
|
216
|
-
selectedCountry:
|
|
213
|
+
selectedCountry: o,
|
|
217
214
|
onChange: s,
|
|
218
215
|
onSelectComplete: () => v(!1)
|
|
219
216
|
},
|
|
@@ -244,39 +241,48 @@ const E = t.memo(
|
|
|
244
241
|
}
|
|
245
242
|
);
|
|
246
243
|
E.displayName = "CountrySelect";
|
|
247
|
-
const T =
|
|
244
|
+
const T = n.memo(
|
|
248
245
|
({
|
|
249
246
|
country: r,
|
|
250
|
-
countryName:
|
|
251
|
-
selectedCountry:
|
|
247
|
+
countryName: o,
|
|
248
|
+
selectedCountry: t,
|
|
252
249
|
onChange: s,
|
|
253
250
|
onSelectComplete: a
|
|
254
251
|
}) => {
|
|
255
|
-
const
|
|
252
|
+
const u = n.useCallback(() => {
|
|
256
253
|
s(r), a();
|
|
257
254
|
}, [r, s, a]);
|
|
258
|
-
return /* @__PURE__ */ e.jsxs(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
255
|
+
return /* @__PURE__ */ e.jsxs(
|
|
256
|
+
N,
|
|
257
|
+
{
|
|
258
|
+
keywords: [o, r],
|
|
259
|
+
value: r,
|
|
260
|
+
className: "gap-2",
|
|
261
|
+
onSelect: u,
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ e.jsx(C, { country: r, countryName: o }),
|
|
264
|
+
/* @__PURE__ */ e.jsx("span", { className: "flex-1 paragraph-sm", children: o }),
|
|
265
|
+
/* @__PURE__ */ e.jsx("span", { className: "paragraph-sm text-foreground/50", children: `+${I.getCountryCallingCode(r)}` }),
|
|
266
|
+
/* @__PURE__ */ e.jsx(
|
|
267
|
+
B,
|
|
268
|
+
{
|
|
269
|
+
className: p(
|
|
270
|
+
"ml-auto size-4",
|
|
271
|
+
r === t ? "opacity-100" : "opacity-0"
|
|
272
|
+
)
|
|
273
|
+
}
|
|
268
274
|
)
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
);
|
|
272
278
|
}
|
|
273
279
|
);
|
|
274
280
|
T.displayName = "CountrySelectOption";
|
|
275
|
-
const C =
|
|
281
|
+
const C = n.memo(
|
|
276
282
|
({
|
|
277
283
|
country: r,
|
|
278
|
-
countryName:
|
|
279
|
-
disabled:
|
|
284
|
+
countryName: o,
|
|
285
|
+
disabled: t
|
|
280
286
|
}) => {
|
|
281
287
|
const s = J[r];
|
|
282
288
|
return /* @__PURE__ */ e.jsx(
|
|
@@ -285,11 +291,13 @@ const C = t.memo(
|
|
|
285
291
|
className: p(
|
|
286
292
|
`
|
|
287
293
|
flex h-4 w-6 overflow-hidden rounded-[4px] bg-foreground/20
|
|
288
|
-
[&_svg:
|
|
294
|
+
[&_svg]:h-auto [&_svg]:w-6!
|
|
295
|
+
[&_svg:not([class*='size-'])]:h-auto
|
|
296
|
+
[&_svg:not([class*='size-'])]:w-full
|
|
289
297
|
`,
|
|
290
|
-
{ "opacity-50":
|
|
298
|
+
{ "opacity-50": t }
|
|
291
299
|
),
|
|
292
|
-
children: s ? /* @__PURE__ */ e.jsx(s, { title:
|
|
300
|
+
children: s ? /* @__PURE__ */ e.jsx(s, { title: o }) : null
|
|
293
301
|
}
|
|
294
302
|
);
|
|
295
303
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e, c as r } from "../index-C_XDkVGm.js";
|
|
2
2
|
import * as s from "@radix-ui/react-select";
|
|
3
|
-
import { CheckIcon as
|
|
3
|
+
import { CheckIcon as i, CaretDownIcon as d, CaretUpIcon as c } from "@phosphor-icons/react";
|
|
4
4
|
function f({
|
|
5
5
|
...t
|
|
6
6
|
}) {
|
|
@@ -19,8 +19,8 @@ function h({
|
|
|
19
19
|
function b({
|
|
20
20
|
className: t,
|
|
21
21
|
size: a = "md",
|
|
22
|
-
children:
|
|
23
|
-
variant:
|
|
22
|
+
children: l,
|
|
23
|
+
variant: o = "default",
|
|
24
24
|
...n
|
|
25
25
|
}) {
|
|
26
26
|
return /* @__PURE__ */ e.jsxs(
|
|
@@ -28,14 +28,12 @@ function b({
|
|
|
28
28
|
{
|
|
29
29
|
"data-slot": "select-trigger",
|
|
30
30
|
"data-size": a,
|
|
31
|
-
"data-variant":
|
|
31
|
+
"data-variant": o,
|
|
32
32
|
className: r(
|
|
33
33
|
`
|
|
34
34
|
flex w-fit items-center justify-between gap-2 rounded-md border
|
|
35
35
|
border-input bg-transparent whitespace-nowrap text-foreground
|
|
36
|
-
|
|
37
|
-
focus-visible:border-ring focus-visible:ring-[3px]
|
|
38
|
-
focus-visible:ring-ring
|
|
36
|
+
focusable-item
|
|
39
37
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
40
38
|
aria-invalid:border-destructive-foreground
|
|
41
39
|
aria-invalid:ring-destructive-foreground/20
|
|
@@ -51,7 +49,7 @@ function b({
|
|
|
51
49
|
[&_svg:not([class*='size-'])]:size-4
|
|
52
50
|
`,
|
|
53
51
|
// Variante de filtro: cuando hay valor seleccionado, texto y borde en color ring
|
|
54
|
-
|
|
52
|
+
o === "filter" && `
|
|
55
53
|
not-data-placeholder:border-ring not-data-placeholder:text-ring
|
|
56
54
|
dark:not-data-placeholder:text-blue-300
|
|
57
55
|
`,
|
|
@@ -66,8 +64,8 @@ function b({
|
|
|
66
64
|
),
|
|
67
65
|
...n,
|
|
68
66
|
children: [
|
|
69
|
-
|
|
70
|
-
/* @__PURE__ */ e.jsx(s.Icon, { asChild: !0, children: /* @__PURE__ */ e.jsx(
|
|
67
|
+
l,
|
|
68
|
+
/* @__PURE__ */ e.jsx(s.Icon, { asChild: !0, children: /* @__PURE__ */ e.jsx(d, { className: "size-4 opacity-50" }) })
|
|
71
69
|
]
|
|
72
70
|
}
|
|
73
71
|
);
|
|
@@ -75,8 +73,8 @@ function b({
|
|
|
75
73
|
function v({
|
|
76
74
|
className: t,
|
|
77
75
|
children: a,
|
|
78
|
-
position:
|
|
79
|
-
collisionPadding:
|
|
76
|
+
position: l = "popper",
|
|
77
|
+
collisionPadding: o = 24,
|
|
80
78
|
...n
|
|
81
79
|
}) {
|
|
82
80
|
return /* @__PURE__ */ e.jsx(s.Portal, { children: /* @__PURE__ */ e.jsxs(
|
|
@@ -98,7 +96,7 @@ function v({
|
|
|
98
96
|
data-[state=open]:animate-in data-[state=open]:fade-in-0
|
|
99
97
|
data-[state=open]:zoom-in-95
|
|
100
98
|
`,
|
|
101
|
-
|
|
99
|
+
l === "popper" && `
|
|
102
100
|
data-[side=bottom]:translate-y-1
|
|
103
101
|
data-[side=left]:-translate-x-1
|
|
104
102
|
data-[side=right]:translate-x-1
|
|
@@ -106,8 +104,8 @@ function v({
|
|
|
106
104
|
`,
|
|
107
105
|
t
|
|
108
106
|
),
|
|
109
|
-
collisionPadding:
|
|
110
|
-
position:
|
|
107
|
+
collisionPadding: o,
|
|
108
|
+
position: l,
|
|
111
109
|
...n,
|
|
112
110
|
children: [
|
|
113
111
|
/* @__PURE__ */ e.jsx(u, {}),
|
|
@@ -116,7 +114,7 @@ function v({
|
|
|
116
114
|
{
|
|
117
115
|
className: r(
|
|
118
116
|
"p-1",
|
|
119
|
-
|
|
117
|
+
l === "popper" && `
|
|
120
118
|
h-(--radix-select-trigger-height) w-full
|
|
121
119
|
min-w-(--radix-select-trigger-width) scroll-my-1
|
|
122
120
|
`
|
|
@@ -148,7 +146,7 @@ function j({
|
|
|
148
146
|
function y({
|
|
149
147
|
className: t,
|
|
150
148
|
children: a,
|
|
151
|
-
...
|
|
149
|
+
...l
|
|
152
150
|
}) {
|
|
153
151
|
return /* @__PURE__ */ e.jsxs(
|
|
154
152
|
s.Item,
|
|
@@ -167,9 +165,9 @@ function y({
|
|
|
167
165
|
`,
|
|
168
166
|
t
|
|
169
167
|
),
|
|
170
|
-
...
|
|
168
|
+
...l,
|
|
171
169
|
children: [
|
|
172
|
-
/* @__PURE__ */ e.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(s.ItemIndicator, { children: /* @__PURE__ */ e.jsx(
|
|
170
|
+
/* @__PURE__ */ e.jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e.jsx(s.ItemIndicator, { children: /* @__PURE__ */ e.jsx(i, { className: "size-4" }) }) }),
|
|
173
171
|
/* @__PURE__ */ e.jsx(s.ItemText, { children: a })
|
|
174
172
|
]
|
|
175
173
|
}
|
|
@@ -218,7 +216,7 @@ function p({
|
|
|
218
216
|
t
|
|
219
217
|
),
|
|
220
218
|
...a,
|
|
221
|
-
children: /* @__PURE__ */ e.jsx(
|
|
219
|
+
children: /* @__PURE__ */ e.jsx(d, { className: "size-4" })
|
|
222
220
|
}
|
|
223
221
|
);
|
|
224
222
|
}
|
|
@@ -30,27 +30,24 @@ const u = v(
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
function
|
|
33
|
+
function m({
|
|
34
34
|
className: n,
|
|
35
|
-
size:
|
|
36
|
-
resize:
|
|
37
|
-
icon:
|
|
35
|
+
size: d,
|
|
36
|
+
resize: l,
|
|
37
|
+
icon: a,
|
|
38
38
|
maxLength: e,
|
|
39
39
|
showCharacterCount: c = !1,
|
|
40
|
-
...
|
|
40
|
+
...t
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
43
|
-
return !
|
|
42
|
+
const i = t.value ? String(t.value).length : 0, o = c || e;
|
|
43
|
+
return !a && !o ? /* @__PURE__ */ r.jsx(
|
|
44
44
|
"textarea",
|
|
45
45
|
{
|
|
46
46
|
"data-slot": "textarea",
|
|
47
47
|
maxLength: e,
|
|
48
48
|
className: s(
|
|
49
|
-
u({ size:
|
|
50
|
-
|
|
51
|
-
focus-visible:border-ring focus-visible:ring-[3px]
|
|
52
|
-
focus-visible:ring-ring
|
|
53
|
-
`,
|
|
49
|
+
u({ size: d, resize: l }),
|
|
50
|
+
"focusable-item",
|
|
54
51
|
`
|
|
55
52
|
aria-invalid:border-destructive-foreground
|
|
56
53
|
aria-invalid:ring-destructive-foreground/20
|
|
@@ -58,7 +55,7 @@ function b({
|
|
|
58
55
|
`,
|
|
59
56
|
n
|
|
60
57
|
),
|
|
61
|
-
...
|
|
58
|
+
...t
|
|
62
59
|
}
|
|
63
60
|
) : /* @__PURE__ */ r.jsxs("div", { className: "space-y-2", children: [
|
|
64
61
|
/* @__PURE__ */ r.jsxs("div", { className: "relative w-full", children: [
|
|
@@ -68,35 +65,32 @@ function b({
|
|
|
68
65
|
"data-slot": "textarea",
|
|
69
66
|
maxLength: e,
|
|
70
67
|
className: s(
|
|
71
|
-
u({ size:
|
|
72
|
-
|
|
73
|
-
focus-visible:border-ring focus-visible:ring-[3px]
|
|
74
|
-
focus-visible:ring-ring
|
|
75
|
-
`,
|
|
68
|
+
u({ size: d, resize: l }),
|
|
69
|
+
"focusable-item",
|
|
76
70
|
`
|
|
77
71
|
aria-invalid:border-destructive-foreground
|
|
78
72
|
aria-invalid:ring-destructive-foreground/20
|
|
79
73
|
dark:aria-invalid:ring-destructive-foreground/40
|
|
80
74
|
`,
|
|
81
|
-
|
|
75
|
+
a ? "pr-10" : "",
|
|
82
76
|
n
|
|
83
77
|
),
|
|
84
|
-
...
|
|
78
|
+
...t
|
|
85
79
|
}
|
|
86
80
|
),
|
|
87
|
-
|
|
81
|
+
a && a
|
|
88
82
|
] }),
|
|
89
|
-
|
|
83
|
+
o && /* @__PURE__ */ r.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ r.jsx(
|
|
90
84
|
"span",
|
|
91
85
|
{
|
|
92
86
|
className: s("paragraph-xs text-muted-foreground", {
|
|
93
|
-
"text-destructive": e &&
|
|
87
|
+
"text-destructive": e && i > e
|
|
94
88
|
}),
|
|
95
|
-
children: e ? `${
|
|
89
|
+
children: e ? `${i}/${e}` : i
|
|
96
90
|
}
|
|
97
91
|
) })
|
|
98
92
|
] });
|
|
99
93
|
}
|
|
100
94
|
export {
|
|
101
|
-
|
|
95
|
+
m as Textarea
|
|
102
96
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as i, c as s } from "../index-C_XDkVGm.js";
|
|
2
2
|
import * as d from "@radix-ui/react-toggle-group";
|
|
3
3
|
import * as l from "react";
|
|
4
|
-
import { t as m } from "../toggle-
|
|
4
|
+
import { t as m } from "../toggle-Df9QfXij.js";
|
|
5
5
|
const u = l.createContext({
|
|
6
6
|
size: "md",
|
|
7
7
|
variant: "default"
|