@clasing/ui 2.8.0 → 2.9.1
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-DBOcqSZb.js → badge-CaH3b0zW.js} +7 -10
- package/dist/components/accordion.js +14 -16
- 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/calendar.js +42 -38
- package/dist/components/checkbox.js +13 -15
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input.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-C0PAOim8.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 +46 -32
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e, c as I } from "../index-C_XDkVGm.js";
|
|
2
|
-
import { B as z } from "../badge-
|
|
2
|
+
import { B as z } from "../badge-CaH3b0zW.js";
|
|
3
3
|
import { C as E, f as P, d as O, b as _, c as A, e as F, g as L } from "../command-Cq3FhQXv.js";
|
|
4
4
|
import { P as T, b as W, c as G } from "../popover-CLQxfbEi.js";
|
|
5
5
|
import { CheckIcon as B, CaretUpDownIcon as D, XIcon as U } from "@phosphor-icons/react";
|
|
@@ -12,27 +12,27 @@ function ne({
|
|
|
12
12
|
defaultValues: o,
|
|
13
13
|
onValuesChange: a,
|
|
14
14
|
isLoading: c,
|
|
15
|
-
onSearchChange:
|
|
15
|
+
onSearchChange: i,
|
|
16
16
|
loadingText: f = "Loading...",
|
|
17
17
|
noResultsText: u = "No results found"
|
|
18
18
|
}) {
|
|
19
19
|
const [d, p] = y(!1), [b, x] = y(
|
|
20
20
|
new Set(r ?? o)
|
|
21
|
-
), [
|
|
21
|
+
), [C, m] = y(/* @__PURE__ */ new Map()), [h, j] = y("");
|
|
22
22
|
function s(n) {
|
|
23
23
|
const g = (w) => {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
24
|
+
const v = new Set(w);
|
|
25
|
+
return v.has(n) ? v.delete(n) : v.add(n), v;
|
|
26
26
|
};
|
|
27
27
|
x(g), a?.([...g(b)]);
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const l = V((n, g) => {
|
|
30
30
|
m((w) => w.get(n) === g ? w : new Map(w).set(n, g));
|
|
31
|
-
}, []),
|
|
31
|
+
}, []), S = V(
|
|
32
32
|
(n) => {
|
|
33
|
-
j(n),
|
|
33
|
+
j(n), i?.(n);
|
|
34
34
|
},
|
|
35
|
-
[
|
|
35
|
+
[i]
|
|
36
36
|
);
|
|
37
37
|
return /* @__PURE__ */ e.jsx(
|
|
38
38
|
R,
|
|
@@ -42,11 +42,11 @@ function ne({
|
|
|
42
42
|
setOpen: p,
|
|
43
43
|
selectedValues: r ? new Set(r) : b,
|
|
44
44
|
toggleValue: s,
|
|
45
|
-
items:
|
|
46
|
-
onItemAdded:
|
|
45
|
+
items: C,
|
|
46
|
+
onItemAdded: l,
|
|
47
47
|
isLoading: c,
|
|
48
48
|
searchValue: h,
|
|
49
|
-
onSearchChange:
|
|
49
|
+
onSearchChange: S,
|
|
50
50
|
loadingText: f,
|
|
51
51
|
noResultsText: u
|
|
52
52
|
},
|
|
@@ -73,9 +73,7 @@ function re({
|
|
|
73
73
|
`
|
|
74
74
|
flex w-fit items-center justify-between gap-2 overflow-hidden
|
|
75
75
|
rounded-md border border-input bg-transparent whitespace-nowrap
|
|
76
|
-
|
|
77
|
-
focus-visible:border-ring focus-visible:ring-[3px]
|
|
78
|
-
focus-visible:ring-ring/50
|
|
76
|
+
focusable-item
|
|
79
77
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
80
78
|
aria-invalid:border-destructive-foreground
|
|
81
79
|
aria-invalid:ring-destructive-foreground/20
|
|
@@ -109,22 +107,22 @@ function se({
|
|
|
109
107
|
overflowBehavior: a = "wrap-when-open",
|
|
110
108
|
...c
|
|
111
109
|
}) {
|
|
112
|
-
const { selectedValues:
|
|
110
|
+
const { selectedValues: i, toggleValue: f, items: u, open: d } = N(), [p, b] = y(0), x = M(null), C = M(null), m = M(/* @__PURE__ */ new Set()), h = a === "wrap" || a === "wrap-when-open" && d;
|
|
113
111
|
k(() => {
|
|
114
112
|
h && m.current.forEach((s) => s.style.removeProperty("display"));
|
|
115
113
|
}, [h]);
|
|
116
114
|
const j = V(() => {
|
|
117
115
|
if (x.current == null) return;
|
|
118
|
-
const s = x.current,
|
|
119
|
-
|
|
120
|
-
let
|
|
116
|
+
const s = x.current, l = C.current;
|
|
117
|
+
l != null && (l.style.display = "none"), m.current.forEach((n) => n.style.removeProperty("display"));
|
|
118
|
+
let S = 0;
|
|
121
119
|
for (let n = m.current.size - 1; n >= 0; n--) {
|
|
122
120
|
const g = [...m.current][n];
|
|
123
121
|
if (s.scrollWidth <= s.clientWidth)
|
|
124
122
|
break;
|
|
125
|
-
|
|
123
|
+
S = m.current.size - n, g.style.display = "none", l?.style.removeProperty("display");
|
|
126
124
|
}
|
|
127
|
-
b(
|
|
125
|
+
b(S);
|
|
128
126
|
}, []);
|
|
129
127
|
return k(() => {
|
|
130
128
|
if (x.current == null) return;
|
|
@@ -132,7 +130,7 @@ function se({
|
|
|
132
130
|
return s.observe(x.current), () => s.disconnect();
|
|
133
131
|
}, [j]), q(() => {
|
|
134
132
|
j();
|
|
135
|
-
}, [
|
|
133
|
+
}, [i, j]), i.size === 0 && t ? /* @__PURE__ */ e.jsx("span", { className: "font-regular text-muted-foreground", children: t }) : /* @__PURE__ */ e.jsxs(
|
|
136
134
|
"div",
|
|
137
135
|
{
|
|
138
136
|
...c,
|
|
@@ -143,19 +141,19 @@ function se({
|
|
|
143
141
|
o
|
|
144
142
|
),
|
|
145
143
|
children: [
|
|
146
|
-
[...
|
|
144
|
+
[...i].filter((s) => u.has(s)).map((s) => /* @__PURE__ */ e.jsxs(
|
|
147
145
|
z,
|
|
148
146
|
{
|
|
149
|
-
ref: (
|
|
150
|
-
if (
|
|
151
|
-
return m.current.add(
|
|
152
|
-
m.current.delete(
|
|
147
|
+
ref: (l) => {
|
|
148
|
+
if (l != null)
|
|
149
|
+
return m.current.add(l), () => {
|
|
150
|
+
m.current.delete(l);
|
|
153
151
|
};
|
|
154
152
|
},
|
|
155
153
|
variant: "outline",
|
|
156
154
|
className: "group flex items-center gap-1",
|
|
157
|
-
onClick: r ? (
|
|
158
|
-
|
|
155
|
+
onClick: r ? (l) => {
|
|
156
|
+
l.stopPropagation(), f(s);
|
|
159
157
|
} : void 0,
|
|
160
158
|
children: [
|
|
161
159
|
u.get(s),
|
|
@@ -179,7 +177,7 @@ function se({
|
|
|
179
177
|
display: p > 0 && !h ? "block" : "none"
|
|
180
178
|
},
|
|
181
179
|
variant: "outline",
|
|
182
|
-
ref:
|
|
180
|
+
ref: C,
|
|
183
181
|
children: [
|
|
184
182
|
"+",
|
|
185
183
|
p
|
|
@@ -195,7 +193,7 @@ function oe({
|
|
|
195
193
|
children: r,
|
|
196
194
|
...o
|
|
197
195
|
}) {
|
|
198
|
-
const { isLoading: a, onSearchChange: c, searchValue:
|
|
196
|
+
const { isLoading: a, onSearchChange: c, searchValue: i, noResultsText: f, loadingText: u } = N(), d = typeof t == "object" ? !0 : t;
|
|
199
197
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
200
198
|
/* @__PURE__ */ e.jsx("div", { style: { display: "none" }, children: /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx(P, { children: r }) }) }),
|
|
201
199
|
/* @__PURE__ */ e.jsx(W, { className: "min-w-(--radix-popover-trigger-width) p-0", children: /* @__PURE__ */ e.jsxs(E, { ...o, children: [
|
|
@@ -203,7 +201,7 @@ function oe({
|
|
|
203
201
|
O,
|
|
204
202
|
{
|
|
205
203
|
placeholder: typeof t == "object" ? t.placeholder : void 0,
|
|
206
|
-
value:
|
|
204
|
+
value: i,
|
|
207
205
|
onValueChange: c
|
|
208
206
|
}
|
|
209
207
|
) : /* @__PURE__ */ e.jsx("button", { autoFocus: !0, "aria-hidden": "true", className: "sr-only" }),
|
|
@@ -224,7 +222,7 @@ function ae({
|
|
|
224
222
|
onSelect: a,
|
|
225
223
|
...c
|
|
226
224
|
}) {
|
|
227
|
-
const { toggleValue:
|
|
225
|
+
const { toggleValue: i, selectedValues: f, onItemAdded: u } = N(), d = f.has(t);
|
|
228
226
|
return k(() => {
|
|
229
227
|
u(t, o ?? r);
|
|
230
228
|
}, [t, r, u, o]), /* @__PURE__ */ e.jsxs(
|
|
@@ -233,7 +231,7 @@ function ae({
|
|
|
233
231
|
...c,
|
|
234
232
|
value: t,
|
|
235
233
|
onSelect: (p) => {
|
|
236
|
-
|
|
234
|
+
i(p), a?.(p);
|
|
237
235
|
},
|
|
238
236
|
children: [
|
|
239
237
|
/* @__PURE__ */ e.jsx(
|
|
@@ -247,10 +245,10 @@ function ae({
|
|
|
247
245
|
}
|
|
248
246
|
);
|
|
249
247
|
}
|
|
250
|
-
function
|
|
248
|
+
function le(t) {
|
|
251
249
|
return /* @__PURE__ */ e.jsx(A, { ...t });
|
|
252
250
|
}
|
|
253
|
-
function
|
|
251
|
+
function ie(t) {
|
|
254
252
|
return /* @__PURE__ */ e.jsx(L, { ...t });
|
|
255
253
|
}
|
|
256
254
|
function N() {
|
|
@@ -264,9 +262,9 @@ function N() {
|
|
|
264
262
|
export {
|
|
265
263
|
ne as MultiSelect,
|
|
266
264
|
oe as MultiSelectContent,
|
|
267
|
-
|
|
265
|
+
le as MultiSelectGroup,
|
|
268
266
|
ae as MultiSelectItem,
|
|
269
|
-
|
|
267
|
+
ie as MultiSelectSeparator,
|
|
270
268
|
re as MultiSelectTrigger,
|
|
271
269
|
se as MultiSelectValue
|
|
272
270
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as e, c as o } from "../index-C_XDkVGm.js";
|
|
2
2
|
import * as n from "@radix-ui/react-navigation-menu";
|
|
3
3
|
import { cva as s } from "class-variance-authority";
|
|
4
|
-
import { CaretDownIcon as
|
|
4
|
+
import { CaretDownIcon as d } from "@phosphor-icons/react";
|
|
5
5
|
function v({
|
|
6
6
|
className: t,
|
|
7
7
|
children: a,
|
|
@@ -28,7 +28,7 @@ function v({
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function p({
|
|
32
32
|
className: t,
|
|
33
33
|
...a
|
|
34
34
|
}) {
|
|
@@ -44,7 +44,7 @@ function f({
|
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function f({
|
|
48
48
|
className: t,
|
|
49
49
|
...a
|
|
50
50
|
}) {
|
|
@@ -57,14 +57,13 @@ function p({
|
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const u = s(
|
|
61
61
|
`
|
|
62
62
|
group inline-flex h-9 w-max items-center justify-center rounded-md
|
|
63
|
-
bg-background px-4 py-2 paragraph-sm font-medium
|
|
63
|
+
bg-background px-4 py-2 paragraph-sm font-medium focusable-item
|
|
64
64
|
transition-[color,box-shadow] outline-none
|
|
65
65
|
hover:bg-accent hover:text-accent-foreground
|
|
66
66
|
focus:bg-accent focus:text-accent-foreground
|
|
67
|
-
focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1
|
|
68
67
|
disabled:pointer-events-none disabled:opacity-50
|
|
69
68
|
data-[state=open]:bg-accent/50 data-[state=open]:text-accent-foreground
|
|
70
69
|
data-[state=open]:hover:bg-accent
|
|
@@ -80,13 +79,13 @@ function x({
|
|
|
80
79
|
n.Trigger,
|
|
81
80
|
{
|
|
82
81
|
"data-slot": "navigation-menu-trigger",
|
|
83
|
-
className: o(
|
|
82
|
+
className: o(u(), "group", t),
|
|
84
83
|
...i,
|
|
85
84
|
children: [
|
|
86
85
|
a,
|
|
87
86
|
" ",
|
|
88
87
|
/* @__PURE__ */ e.jsx(
|
|
89
|
-
|
|
88
|
+
d,
|
|
90
89
|
{
|
|
91
90
|
className: `\r
|
|
92
91
|
relative top-px ml-1 size-3 transition duration-300\r
|
|
@@ -174,7 +173,7 @@ function l({
|
|
|
174
173
|
}
|
|
175
174
|
);
|
|
176
175
|
}
|
|
177
|
-
function
|
|
176
|
+
function h({
|
|
178
177
|
className: t,
|
|
179
178
|
...a
|
|
180
179
|
}) {
|
|
@@ -184,12 +183,10 @@ function b({
|
|
|
184
183
|
"data-slot": "navigation-menu-link",
|
|
185
184
|
className: o(
|
|
186
185
|
`
|
|
187
|
-
flex flex-col gap-1 rounded-sm p-2 paragraph-sm
|
|
188
|
-
outline-none
|
|
186
|
+
flex flex-col gap-1 rounded-sm p-2 paragraph-sm focusable-item
|
|
187
|
+
transition-all outline-none
|
|
189
188
|
hover:bg-accent hover:text-accent-foreground
|
|
190
189
|
focus:bg-accent focus:text-accent-foreground
|
|
191
|
-
focus-visible:ring-[3px] focus-visible:ring-ring/50
|
|
192
|
-
focus-visible:outline-1
|
|
193
190
|
data-[active=true]:bg-accent/50
|
|
194
191
|
data-[active=true]:text-accent-foreground
|
|
195
192
|
data-[active=true]:hover:bg-accent
|
|
@@ -202,7 +199,7 @@ function b({
|
|
|
202
199
|
}
|
|
203
200
|
);
|
|
204
201
|
}
|
|
205
|
-
function
|
|
202
|
+
function b({
|
|
206
203
|
className: t,
|
|
207
204
|
...a
|
|
208
205
|
}) {
|
|
@@ -233,11 +230,11 @@ function h({
|
|
|
233
230
|
export {
|
|
234
231
|
v as NavigationMenu,
|
|
235
232
|
w as NavigationMenuContent,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
233
|
+
b as NavigationMenuIndicator,
|
|
234
|
+
f as NavigationMenuItem,
|
|
235
|
+
h as NavigationMenuLink,
|
|
236
|
+
p as NavigationMenuList,
|
|
240
237
|
x as NavigationMenuTrigger,
|
|
241
238
|
l as NavigationMenuViewport,
|
|
242
|
-
|
|
239
|
+
u as navigationMenuTriggerStyle
|
|
243
240
|
};
|
|
@@ -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
|
}
|