@konstructio/ui 0.1.2-alpha.27 → 0.1.2-alpha.29
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/DatePicker.css +1 -1
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Badge/Badge.variants.js +1 -1
- package/dist/components/Card/Card.variants.js +5 -9
- package/dist/components/Datepicker/DatePicker.js +1250 -1190
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/components/List/List.js +45 -39
- package/dist/components/Dropdown/components/Wrapper.js +81 -80
- package/dist/components/Dropdown/hooks/useDropdown.js +21 -21
- package/dist/components/Filter/Filter.variants.js +2 -2
- package/dist/components/Input/Input.variants.js +1 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +27 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +621 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6137 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +5 -5
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1886
- package/dist/components/index.js +72 -70
- package/dist/index-2hB40Iuc.js +1873 -0
- package/dist/index-C3tHPg8y.js +662 -0
- package/dist/index.d.ts +32 -13
- package/dist/index.js +82 -80
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/package.json +13 -7
- package/dist/styles.css +1 -1
- package/package.json +13 -7
|
@@ -1,91 +1,97 @@
|
|
|
1
1
|
import { jsxs as H, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { S as V } from "../../../../index-BtQfgaSF.js";
|
|
3
3
|
import { d as Z } from "../../../../debounce-BFejQm9P.js";
|
|
4
|
-
import { forwardRef as B, useRef as
|
|
4
|
+
import { forwardRef as B, useRef as k, useState as G, useImperativeHandle as J, useMemo as K, useEffect as M } from "react";
|
|
5
5
|
import { Loading as Q } from "../../../Loading/Loading.js";
|
|
6
6
|
import { cn as a } from "../../../../utils/index.js";
|
|
7
7
|
import { useNavigationUlList as R } from "../../hooks/useNavigationList.js";
|
|
8
|
-
import { ListItem as
|
|
8
|
+
import { ListItem as b } from "../ListItem/ListItem.js";
|
|
9
9
|
import { listVariants as W } from "./List.variants.js";
|
|
10
10
|
import { DEFAULT_LIST_SIZE as X } from "../../constants/pagination.js";
|
|
11
11
|
import { useDropdownContext as Y } from "../../contexts/dropdown.hook.js";
|
|
12
12
|
const ue = B(
|
|
13
13
|
({
|
|
14
|
-
additionalOptions:
|
|
15
|
-
className:
|
|
14
|
+
additionalOptions: C,
|
|
15
|
+
className: F,
|
|
16
16
|
inputRef: i,
|
|
17
|
-
isLoading:
|
|
17
|
+
isLoading: N,
|
|
18
18
|
itemClassName: l,
|
|
19
|
-
name:
|
|
20
|
-
searchable:
|
|
19
|
+
name: I,
|
|
20
|
+
searchable: L = !1,
|
|
21
21
|
listItemSecondRowClassName: c,
|
|
22
|
-
wrapperInputRef:
|
|
22
|
+
wrapperInputRef: O,
|
|
23
23
|
isInfiniteScrollEnabled: u,
|
|
24
24
|
onFetchMoreOptions: f
|
|
25
|
-
},
|
|
26
|
-
const s =
|
|
27
|
-
isOpen:
|
|
25
|
+
}, T) => {
|
|
26
|
+
const s = k(null), m = k(null), [p, x] = G(!1), {
|
|
27
|
+
isOpen: j,
|
|
28
28
|
searchTerm: g,
|
|
29
|
-
canFilter:
|
|
29
|
+
canFilter: E,
|
|
30
30
|
canContinueFetching: n,
|
|
31
|
-
page:
|
|
32
|
-
options:
|
|
33
|
-
isTyping:
|
|
31
|
+
page: d,
|
|
32
|
+
options: y,
|
|
33
|
+
isTyping: w,
|
|
34
34
|
setOptions: P,
|
|
35
35
|
setPage: S,
|
|
36
36
|
setCanContinueFetching: D
|
|
37
37
|
} = Y();
|
|
38
|
-
J(
|
|
39
|
-
const
|
|
38
|
+
J(T, () => s.current, [s]);
|
|
39
|
+
const h = L && E ? y.filter((e) => {
|
|
40
40
|
const t = g.toLowerCase();
|
|
41
41
|
return (typeof e.label == "string" ? e.label.toLowerCase() : "").includes(t);
|
|
42
|
-
}) :
|
|
42
|
+
}) : y;
|
|
43
43
|
R({
|
|
44
44
|
ulRef: s,
|
|
45
|
-
wrapperInputRef:
|
|
46
|
-
searchable:
|
|
47
|
-
filteredOptions:
|
|
45
|
+
wrapperInputRef: O,
|
|
46
|
+
searchable: L,
|
|
47
|
+
filteredOptions: h
|
|
48
48
|
});
|
|
49
|
-
const U =
|
|
50
|
-
(e, t, r) => t === r.findIndex((
|
|
51
|
-
), _ =
|
|
49
|
+
const U = h.filter(
|
|
50
|
+
(e, t, r) => t === r.findIndex((v) => v.value === e.value)
|
|
51
|
+
), _ = h.length === 0, q = K(
|
|
52
52
|
() => Z(async (e) => {
|
|
53
53
|
const [t] = e;
|
|
54
54
|
if (t.isIntersecting && !p && f && n)
|
|
55
55
|
try {
|
|
56
|
-
|
|
57
|
-
const r =
|
|
56
|
+
x(!0);
|
|
57
|
+
const r = d + 1, { data: v, hasMore: z } = await f({
|
|
58
58
|
page: r,
|
|
59
59
|
pageSize: X,
|
|
60
60
|
termOfSearch: g
|
|
61
61
|
});
|
|
62
|
-
S(r), D(z), P((A) => [...A, ...
|
|
62
|
+
S(r), D(z), P((A) => [...A, ...v]);
|
|
63
63
|
} catch {
|
|
64
64
|
console.error("Error fetching more options");
|
|
65
65
|
} finally {
|
|
66
|
-
|
|
66
|
+
x(!1);
|
|
67
67
|
}
|
|
68
68
|
}, 100),
|
|
69
|
-
[p, f, g]
|
|
69
|
+
[p, f, g, d]
|
|
70
70
|
);
|
|
71
71
|
return M(() => {
|
|
72
|
-
if (u && n && m.current && !
|
|
72
|
+
if (u && n && m.current && !w) {
|
|
73
73
|
const e = new IntersectionObserver(q, {
|
|
74
74
|
threshold: 0.1
|
|
75
75
|
});
|
|
76
76
|
return e.observe(m.current), () => e.disconnect();
|
|
77
77
|
}
|
|
78
|
-
}, [
|
|
78
|
+
}, [
|
|
79
|
+
u,
|
|
80
|
+
n,
|
|
81
|
+
p,
|
|
82
|
+
w,
|
|
83
|
+
d
|
|
84
|
+
]), /* @__PURE__ */ H(
|
|
79
85
|
"ul",
|
|
80
86
|
{
|
|
81
87
|
ref: s,
|
|
82
|
-
title:
|
|
88
|
+
title: I,
|
|
83
89
|
role: "listbox",
|
|
84
|
-
className: a(W({ className:
|
|
85
|
-
"data-state":
|
|
90
|
+
className: a(W({ className: F })),
|
|
91
|
+
"data-state": j ? "open" : "closed",
|
|
86
92
|
children: [
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
N ? /* @__PURE__ */ o(
|
|
94
|
+
b,
|
|
89
95
|
{
|
|
90
96
|
className: a("select-none", l),
|
|
91
97
|
isClickable: !1,
|
|
@@ -95,7 +101,7 @@ const ue = B(
|
|
|
95
101
|
listItemSecondRowClassName: c
|
|
96
102
|
}
|
|
97
103
|
) : _ ? /* @__PURE__ */ o(
|
|
98
|
-
|
|
104
|
+
b,
|
|
99
105
|
{
|
|
100
106
|
className: a("select-none", l),
|
|
101
107
|
isClickable: !1,
|
|
@@ -105,7 +111,7 @@ const ue = B(
|
|
|
105
111
|
listItemSecondRowClassName: c
|
|
106
112
|
}
|
|
107
113
|
) : U.map((e) => /* @__PURE__ */ o(
|
|
108
|
-
|
|
114
|
+
b,
|
|
109
115
|
{
|
|
110
116
|
className: a("select-none", l),
|
|
111
117
|
isClickable: !0,
|
|
@@ -126,7 +132,7 @@ const ue = B(
|
|
|
126
132
|
children: /* @__PURE__ */ o(Q, { className: "w-4 h-4 text-aurora-500 select-none" })
|
|
127
133
|
}
|
|
128
134
|
),
|
|
129
|
-
|
|
135
|
+
C?.map((e, t) => /* @__PURE__ */ o("li", { role: "option", "data-action": "true", children: /* @__PURE__ */ o(V, { className: "flex p-2 w-full h-full gap-1 items-center text-sm [&>svg]:w-3.5 [&>svg]:h-3.5 [&>svg]:shrink-0 cursor-pointer select-none hover:bg-gray-50 hover:dark:bg-slate-700 focus:outline-0", children: e }) }, t))
|
|
130
136
|
]
|
|
131
137
|
}
|
|
132
138
|
);
|
|
@@ -1,132 +1,133 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Y, useId as Z, useRef as C, useMemo as ee, useImperativeHandle as te, useEffect as ae } from "react";
|
|
3
3
|
import { Loading as re } from "../../Loading/Loading.js";
|
|
4
4
|
import { Typography as ne } from "../../Typography/Typography.js";
|
|
5
5
|
import { cn as s } from "../../../utils/index.js";
|
|
6
6
|
import { labelVariants as oe, inputVariants as se, dropdownVariants as le } from "../Dropdown.variants.js";
|
|
7
|
-
import { useDropdown as
|
|
8
|
-
import { List as
|
|
9
|
-
import { c as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
const
|
|
7
|
+
import { useDropdown as ie } from "../hooks/useDropdown.js";
|
|
8
|
+
import { List as ce } from "./List/List.js";
|
|
9
|
+
import { c as pe } from "../../../createLucideIcon-D4r5Phnh.js";
|
|
10
|
+
import { C as ue } from "../../../chevron-up-DrQr2Fwd.js";
|
|
11
|
+
import { useDropdownContext as fe } from "../contexts/dropdown.hook.js";
|
|
12
|
+
const me = [
|
|
13
13
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
14
14
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
15
|
-
],
|
|
15
|
+
], de = pe("search", me), je = Y(
|
|
16
16
|
({
|
|
17
|
-
additionalOptions:
|
|
18
|
-
className:
|
|
17
|
+
additionalOptions: V,
|
|
18
|
+
className: O,
|
|
19
19
|
defaultValue: x,
|
|
20
20
|
disabled: a = !1,
|
|
21
|
-
error:
|
|
22
|
-
iconClassName:
|
|
23
|
-
inputClassName:
|
|
24
|
-
isLoading:
|
|
21
|
+
error: f,
|
|
22
|
+
iconClassName: R,
|
|
23
|
+
inputClassName: F,
|
|
24
|
+
isLoading: k,
|
|
25
25
|
isRequired: h,
|
|
26
26
|
label: v,
|
|
27
27
|
labelClassName: T,
|
|
28
|
-
listClassName:
|
|
29
|
-
listItemClassName:
|
|
30
|
-
listItemSecondRowClassName:
|
|
31
|
-
name:
|
|
28
|
+
listClassName: D,
|
|
29
|
+
listItemClassName: E,
|
|
30
|
+
listItemSecondRowClassName: M,
|
|
31
|
+
name: m,
|
|
32
32
|
placeholder: N,
|
|
33
33
|
searchable: g = !1,
|
|
34
34
|
showSearchIcon: w,
|
|
35
|
-
theme:
|
|
36
|
-
wrapperClassName:
|
|
37
|
-
isInfiniteScrollEnabled:
|
|
38
|
-
onFetchMoreOptions:
|
|
39
|
-
onBlur:
|
|
40
|
-
onSearchChange:
|
|
41
|
-
...
|
|
42
|
-
},
|
|
43
|
-
const
|
|
44
|
-
isOpen:
|
|
45
|
-
searchTerm:
|
|
35
|
+
theme: W,
|
|
36
|
+
wrapperClassName: _,
|
|
37
|
+
isInfiniteScrollEnabled: $ = !1,
|
|
38
|
+
onFetchMoreOptions: H,
|
|
39
|
+
onBlur: P,
|
|
40
|
+
onSearchChange: U,
|
|
41
|
+
...y
|
|
42
|
+
}, q) => {
|
|
43
|
+
const I = Z(), l = C(null), L = C(null), A = C(0), {
|
|
44
|
+
isOpen: i,
|
|
45
|
+
searchTerm: B,
|
|
46
46
|
value: o,
|
|
47
47
|
options: n,
|
|
48
48
|
setValue: c,
|
|
49
|
-
setSearchTerm:
|
|
50
|
-
setCanFilter:
|
|
51
|
-
|
|
49
|
+
setSearchTerm: G,
|
|
50
|
+
setCanFilter: J,
|
|
51
|
+
toggleOpen: K
|
|
52
|
+
} = fe(), e = ee(() => n.find(({ value: r }) => r === o), [n, o]), { wrapperRef: Q, wrapperInputRef: j, handleOpen: z } = ie({
|
|
52
53
|
ulRef: L,
|
|
53
54
|
inputRef: l,
|
|
54
55
|
disabled: a,
|
|
55
56
|
internalValue: e,
|
|
56
|
-
onBlur:
|
|
57
|
-
}),
|
|
58
|
-
te(
|
|
57
|
+
onBlur: P
|
|
58
|
+
}), p = m ? `${I}-${m}` : I;
|
|
59
|
+
te(q, () => l.current, [l]), ae(() => {
|
|
59
60
|
if (x && !o) {
|
|
60
|
-
const r = n && n.find((
|
|
61
|
+
const r = n && n.find((u) => u.value === x);
|
|
61
62
|
r && c(r.value);
|
|
62
63
|
}
|
|
63
64
|
}, [x, n, c, o]);
|
|
64
65
|
const S = (r) => {
|
|
65
|
-
const
|
|
66
|
-
|
|
66
|
+
const u = r.target.value;
|
|
67
|
+
J(!0), c(""), G(u ?? ""), U?.(u);
|
|
67
68
|
const b = n.find(
|
|
68
|
-
(X) => X.value.toLocaleLowerCase() ===
|
|
69
|
+
(X) => X.value.toLocaleLowerCase() === u.toLocaleLowerCase()
|
|
69
70
|
);
|
|
70
71
|
c(b ? b.value : e?.value ?? "");
|
|
71
72
|
};
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ d(
|
|
73
74
|
"div",
|
|
74
75
|
{
|
|
75
76
|
ref: Q,
|
|
76
|
-
className: s("flex flex-col w-full relative",
|
|
77
|
-
"data-theme":
|
|
77
|
+
className: s("flex flex-col w-full relative", _),
|
|
78
|
+
"data-theme": W,
|
|
78
79
|
children: [
|
|
79
|
-
v ? /* @__PURE__ */
|
|
80
|
+
v ? /* @__PURE__ */ d(
|
|
80
81
|
"label",
|
|
81
82
|
{
|
|
82
|
-
id:
|
|
83
|
+
id: p,
|
|
83
84
|
className: s(oe({ className: T })),
|
|
84
|
-
htmlFor:
|
|
85
|
-
onClick: () => !a &&
|
|
85
|
+
htmlFor: p,
|
|
86
|
+
onClick: () => !a && z(),
|
|
86
87
|
children: [
|
|
87
88
|
v,
|
|
88
89
|
h && /* @__PURE__ */ t("span", { className: "text-red-600 ml-1", children: "*" })
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
92
|
) : null,
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ d(
|
|
93
94
|
"div",
|
|
94
95
|
{
|
|
95
96
|
ref: j,
|
|
96
|
-
id:
|
|
97
|
+
id: p,
|
|
97
98
|
className: s(
|
|
98
|
-
le({ className:
|
|
99
|
+
le({ className: O, hasError: !!f, disabled: a })
|
|
99
100
|
),
|
|
100
101
|
role: "combobox",
|
|
101
|
-
onClick: () => !a &&
|
|
102
|
-
"aria-expanded":
|
|
103
|
-
tabIndex:
|
|
104
|
-
"aria-labelledby":
|
|
102
|
+
onClick: () => !a && K(!i),
|
|
103
|
+
"aria-expanded": i,
|
|
104
|
+
tabIndex: A.current,
|
|
105
|
+
"aria-labelledby": p,
|
|
105
106
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ d("div", { className: "flex gap-2.5 items-center flex-1", children: [
|
|
107
108
|
e?.leftIcon && !w && /* @__PURE__ */ t("span", { className: "w-4 h-4 flex justify-center items-center dark:text-slate-50", children: e.leftIcon }),
|
|
108
|
-
w && /* @__PURE__ */ t(
|
|
109
|
+
w && /* @__PURE__ */ t(de, { className: "w-4 h-4 text-zinc-500 select-none dark:text-slate-300 dark:group-focus-within:text-slate-50 transition-colors duration-300" }),
|
|
109
110
|
g ? /* @__PURE__ */ t(
|
|
110
111
|
"input",
|
|
111
112
|
{
|
|
112
113
|
type: "text",
|
|
113
|
-
value:
|
|
114
|
+
value: i ? B : e?.label ?? o ?? "",
|
|
114
115
|
onChange: S,
|
|
115
116
|
placeholder: N,
|
|
116
|
-
className: s(se({ className:
|
|
117
|
-
"text-red-700 placeholder:text-red-700": !!
|
|
117
|
+
className: s(se({ className: F }), {
|
|
118
|
+
"text-red-700 placeholder:text-red-700": !!f
|
|
118
119
|
}),
|
|
119
120
|
onClick: (r) => {
|
|
120
|
-
r.stopPropagation(), a ||
|
|
121
|
+
r.stopPropagation(), a || z();
|
|
121
122
|
},
|
|
122
123
|
"aria-label": v || N,
|
|
123
|
-
"aria-labelledby":
|
|
124
|
+
"aria-labelledby": p,
|
|
124
125
|
required: h,
|
|
125
126
|
autoComplete: "off",
|
|
126
127
|
autoCapitalize: "words",
|
|
127
128
|
disabled: a,
|
|
128
129
|
tabIndex: -1,
|
|
129
|
-
...
|
|
130
|
+
...y
|
|
130
131
|
}
|
|
131
132
|
) : /* @__PURE__ */ t(
|
|
132
133
|
ne,
|
|
@@ -135,7 +136,7 @@ const fe = [
|
|
|
135
136
|
className: s(
|
|
136
137
|
"flex-1 text-zinc-400 text-sm dark:text-slate-400",
|
|
137
138
|
{
|
|
138
|
-
"text-red-700": !!
|
|
139
|
+
"text-red-700": !!f,
|
|
139
140
|
"select-none": !e,
|
|
140
141
|
"text-slate-800 dark:text-slate-50": e,
|
|
141
142
|
"text-slate-400/50 dark:text-slate-50/50": a
|
|
@@ -145,15 +146,15 @@ const fe = [
|
|
|
145
146
|
}
|
|
146
147
|
)
|
|
147
148
|
] }),
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
k ? /* @__PURE__ */ t(re, { className: "w-4 h-4 text-zinc-500 select-none" }) : !w && /* @__PURE__ */ t(
|
|
150
|
+
ue,
|
|
150
151
|
{
|
|
151
|
-
"data-state":
|
|
152
|
+
"data-state": i ? "open" : "closed",
|
|
152
153
|
className: s(
|
|
153
154
|
"w-4 h-4 text-zinc-500 transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 select-none dark:group-focus-within:text-slate-50",
|
|
154
|
-
|
|
155
|
+
R,
|
|
155
156
|
{
|
|
156
|
-
"text-red-700": !!
|
|
157
|
+
"text-red-700": !!f,
|
|
157
158
|
"text-slate-400/50 dark:group-focus-within:text-zinc-500": a
|
|
158
159
|
}
|
|
159
160
|
)
|
|
@@ -167,31 +168,31 @@ const fe = [
|
|
|
167
168
|
{
|
|
168
169
|
ref: l,
|
|
169
170
|
type: "text",
|
|
170
|
-
name:
|
|
171
|
+
name: m,
|
|
171
172
|
className: "hidden",
|
|
172
173
|
"aria-hidden": "true",
|
|
173
174
|
required: h,
|
|
174
175
|
inert: !0,
|
|
175
176
|
defaultValue: e?.value ?? o ?? void 0,
|
|
176
|
-
...
|
|
177
|
+
...y
|
|
177
178
|
}
|
|
178
179
|
),
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
i && /* @__PURE__ */ t(
|
|
181
|
+
ce,
|
|
181
182
|
{
|
|
182
183
|
ref: L,
|
|
183
|
-
additionalOptions:
|
|
184
|
-
className:
|
|
185
|
-
itemClassName:
|
|
186
|
-
name:
|
|
184
|
+
additionalOptions: V,
|
|
185
|
+
className: D,
|
|
186
|
+
itemClassName: E,
|
|
187
|
+
name: m,
|
|
187
188
|
wrapperInputRef: j,
|
|
188
189
|
inputRef: l,
|
|
189
190
|
options: n,
|
|
190
|
-
isLoading: !!
|
|
191
|
+
isLoading: !!k,
|
|
191
192
|
searchable: g,
|
|
192
|
-
listItemSecondRowClassName:
|
|
193
|
-
isInfiniteScrollEnabled:
|
|
194
|
-
onFetchMoreOptions:
|
|
193
|
+
listItemSecondRowClassName: M,
|
|
194
|
+
isInfiniteScrollEnabled: $,
|
|
195
|
+
onFetchMoreOptions: H
|
|
195
196
|
}
|
|
196
197
|
)
|
|
197
198
|
]
|
|
@@ -200,5 +201,5 @@ const fe = [
|
|
|
200
201
|
}
|
|
201
202
|
);
|
|
202
203
|
export {
|
|
203
|
-
|
|
204
|
+
je as Wrapper
|
|
204
205
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useRef as m, useEffect as
|
|
1
|
+
import { useRef as m, useEffect as c, useCallback as b } from "react";
|
|
2
2
|
import { useDropdownContext as L } from "../contexts/dropdown.hook.js";
|
|
3
|
-
const
|
|
3
|
+
const p = ({
|
|
4
4
|
ulRef: f,
|
|
5
5
|
inputRef: t,
|
|
6
6
|
disabled: w,
|
|
7
|
-
internalValue:
|
|
7
|
+
internalValue: u,
|
|
8
8
|
onBlur: g
|
|
9
9
|
}) => {
|
|
10
|
-
const r = m(null), a = m(null), { value:
|
|
11
|
-
|
|
12
|
-
const e = new AbortController(), o = (
|
|
13
|
-
|
|
14
|
-
}, s = (
|
|
15
|
-
r.current?.contains(
|
|
10
|
+
const r = m(null), a = m(null), { value: i, setSearchTerm: v, setCanFilter: d, toggleOpen: n } = L();
|
|
11
|
+
c(() => {
|
|
12
|
+
const e = new AbortController(), o = (l) => {
|
|
13
|
+
l.key === "Escape" && n(!1);
|
|
14
|
+
}, s = (l) => {
|
|
15
|
+
r.current?.contains(l.target) || n(!1);
|
|
16
16
|
};
|
|
17
17
|
return document.addEventListener("keydown", o, {
|
|
18
18
|
signal: e.signal
|
|
@@ -28,14 +28,14 @@ const y = ({
|
|
|
28
28
|
}
|
|
29
29
|
), a.current?.addEventListener(
|
|
30
30
|
"focusin",
|
|
31
|
-
() => {
|
|
32
|
-
w
|
|
31
|
+
(l) => {
|
|
32
|
+
!w && l.target?.matches(":focus-visible") && n(!0);
|
|
33
33
|
},
|
|
34
34
|
{ signal: e.signal }
|
|
35
35
|
), () => {
|
|
36
36
|
e.abort();
|
|
37
37
|
};
|
|
38
|
-
}, [n, r]),
|
|
38
|
+
}, [n, r]), c(() => {
|
|
39
39
|
const e = new AbortController();
|
|
40
40
|
return a.current?.addEventListener(
|
|
41
41
|
"keydown",
|
|
@@ -49,24 +49,24 @@ const y = ({
|
|
|
49
49
|
), () => {
|
|
50
50
|
e.abort();
|
|
51
51
|
};
|
|
52
|
-
}, [a, f]),
|
|
52
|
+
}, [a, f]), c(() => {
|
|
53
53
|
const e = new AbortController();
|
|
54
54
|
return t?.current?.addEventListener(
|
|
55
55
|
"focusin",
|
|
56
56
|
() => {
|
|
57
|
-
v(
|
|
57
|
+
v(u?.value ?? ""), d(!1);
|
|
58
58
|
},
|
|
59
59
|
{ signal: e.signal }
|
|
60
60
|
), t?.current?.addEventListener(
|
|
61
61
|
"focusout",
|
|
62
62
|
() => {
|
|
63
|
-
|
|
63
|
+
d(!0);
|
|
64
64
|
},
|
|
65
65
|
{ signal: e.signal }
|
|
66
66
|
), a.current?.addEventListener(
|
|
67
67
|
"focus",
|
|
68
68
|
() => {
|
|
69
|
-
|
|
69
|
+
d(!1);
|
|
70
70
|
},
|
|
71
71
|
{ signal: e.signal }
|
|
72
72
|
), r.current?.addEventListener(
|
|
@@ -78,9 +78,9 @@ const y = ({
|
|
|
78
78
|
), () => {
|
|
79
79
|
e.abort();
|
|
80
80
|
};
|
|
81
|
-
}, [
|
|
82
|
-
t?.current && (t.current.value =
|
|
83
|
-
}, [
|
|
81
|
+
}, [i]), c(() => {
|
|
82
|
+
t?.current && (t.current.value = i && u?.value || "");
|
|
83
|
+
}, [u, i]), c(() => {
|
|
84
84
|
const e = new AbortController();
|
|
85
85
|
return r.current?.addEventListener("focusout", (o) => {
|
|
86
86
|
const s = o.relatedTarget;
|
|
@@ -88,7 +88,7 @@ const y = ({
|
|
|
88
88
|
}), () => {
|
|
89
89
|
e.abort();
|
|
90
90
|
};
|
|
91
|
-
}, [n, r, v, g,
|
|
91
|
+
}, [n, r, v, g, i]);
|
|
92
92
|
const E = b(() => {
|
|
93
93
|
n(!0), requestAnimationFrame(() => t?.current?.focus());
|
|
94
94
|
}, [t, n]);
|
|
@@ -99,5 +99,5 @@ const y = ({
|
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
p as useDropdown
|
|
103
103
|
};
|
|
@@ -39,7 +39,7 @@ const a = r(
|
|
|
39
39
|
variants: {
|
|
40
40
|
variant: {
|
|
41
41
|
default: "",
|
|
42
|
-
error: "border-red-600 kubefirst-dark:border-red-500 dark:border-red-500
|
|
42
|
+
error: "border-red-600 kubefirst-dark:border-red-500 dark:border-red-500 pr-8 focus-visible:ring-transparent"
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
defaultVariants: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as p } from "react";
|
|
3
|
+
import { PhoneNumberProvider as t } from "./contexts/phone-number.provider.js";
|
|
4
|
+
import { Wrapper as f } from "./components/Wrapper.js";
|
|
5
|
+
const u = p(({ defaultCountryCode: o = "US", ...m }, e) => /* @__PURE__ */ r(t, { defaultCountryCode: o, children: /* @__PURE__ */ r(f, { ref: e, ...m }) }));
|
|
6
|
+
export {
|
|
7
|
+
u as PhoneNumberInput
|
|
8
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { c as r } from "../../index-D29mdTf5.js";
|
|
2
|
+
const e = r(
|
|
3
|
+
[
|
|
4
|
+
"relative",
|
|
5
|
+
"border",
|
|
6
|
+
"border-gray-300",
|
|
7
|
+
"rounded",
|
|
8
|
+
"data-[state=open]:border-aurora-500",
|
|
9
|
+
"focus-within:border-aurora-500",
|
|
10
|
+
"transition-colors",
|
|
11
|
+
"duration-150",
|
|
12
|
+
"dark:border-slate-500",
|
|
13
|
+
"dark:bg-slate-800",
|
|
14
|
+
"dark:data-[state=open]:border-slate-500",
|
|
15
|
+
"dark:focus-within:border-slate-500"
|
|
16
|
+
],
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: [],
|
|
21
|
+
error: [
|
|
22
|
+
"border-red-600",
|
|
23
|
+
"dark:border-red-500",
|
|
24
|
+
"data-[state=open]:border-red-500",
|
|
25
|
+
"focus-within:border-red-500",
|
|
26
|
+
"pr-8",
|
|
27
|
+
"focus-visible:ring-transparent"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "default"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
), t = r([
|
|
36
|
+
"cursor-pointer",
|
|
37
|
+
"text-sm",
|
|
38
|
+
"leading-5",
|
|
39
|
+
"tracking-[0.1px]",
|
|
40
|
+
"dark:text-slate-50"
|
|
41
|
+
]);
|
|
42
|
+
export {
|
|
43
|
+
t as labelVariants,
|
|
44
|
+
e as phoneNumberInputVariants
|
|
45
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { C as s } from "../../../../chevron-up-DrQr2Fwd.js";
|
|
3
|
+
import { usePhoneNumberContext as l } from "../../contexts/phone-number.hook.js";
|
|
4
|
+
const m = () => {
|
|
5
|
+
const { selectedCountry: o, isOpenSelector: t, handleOpenSelector: a } = l(), { flag: n } = o;
|
|
6
|
+
return /* @__PURE__ */ r(
|
|
7
|
+
"button",
|
|
8
|
+
{
|
|
9
|
+
type: "button",
|
|
10
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
11
|
+
onClick: () => a(!t),
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ e(n, {}),
|
|
14
|
+
/* @__PURE__ */ e(
|
|
15
|
+
s,
|
|
16
|
+
{
|
|
17
|
+
className: "transition-all duration-100 data-[state=open]:rotate-0 data-[state=closed]:rotate-180 w-5 h-5 text-slate-400",
|
|
18
|
+
"data-state": t ? "open" : "closed"
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
m as FlagContent
|
|
27
|
+
};
|