@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.41
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/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CtAG97Ts.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-left-C4LEg1fH.js +7 -0
- package/dist/chevron-up-CRyLc5Ml.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +42 -44
- package/dist/components/Badge/Badge.variants.js +8 -6
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Card/Card.variants.js +5 -9
- package/dist/components/Checkbox/Checkbox.js +6 -6
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1243 -1191
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +37 -31
- package/dist/components/Dropdown/Dropdown.variants.js +9 -4
- package/dist/components/Dropdown/components/List/List.js +128 -59
- package/dist/components/Dropdown/components/ListItem/ListItem.js +90 -39
- package/dist/components/Dropdown/components/Wrapper.js +141 -134
- package/dist/components/Dropdown/constants/index.js +4 -0
- package/dist/components/Dropdown/constants/pagination.js +4 -0
- package/dist/components/Dropdown/contexts/dropdown.context.js +17 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -20
- package/dist/components/Dropdown/hooks/useDropdown.js +74 -29
- package/dist/components/Dropdown/hooks/useNavigationList.js +27 -39
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +2 -2
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +2 -1
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +34 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +38 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +37 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +105 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -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 +36 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -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 +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +647 -664
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +8 -8
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Toast/Toast.js +283 -255
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +121 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +93 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +16 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
- package/dist/components/index.js +88 -80
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
- package/dist/index-2hB40Iuc.js +1873 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
- package/dist/index-BtQfgaSF.js +60 -0
- package/dist/index-C3tHPg8y.js +662 -0
- package/dist/index-C65LtGuU.js +137 -0
- package/dist/index-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/{index-D3xzCzcO.js → index-CdwPV0FE.js} +4 -4
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-Dbt2vBmS.js +136 -0
- package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
- package/dist/index-DrWQH0QF.js +55 -0
- package/dist/index-Ds6U2x4Z.js +479 -0
- package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
- package/dist/index-ohdbKsws.js +27 -0
- package/dist/index.d.ts +232 -23
- package/dist/index.js +112 -102
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +48 -34
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +191 -167
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
- package/package.json +48 -34
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/index-BXuxPoz7.js +0 -435
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-C9T9HQaa.js +0 -423
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-Oq5GlCHP.js +0 -131
- package/dist/index-iXyXtdgP.js +0 -31
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as V } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as k, useState as R, useEffect as g, useCallback as S } from "react";
|
|
3
|
+
import { MultiSelectDropdownContext as C } from "./MultiSelectDropdown.context.js";
|
|
4
|
+
import { useToggle as E } from "../../../hooks/useToggle.js";
|
|
5
|
+
const q = ({
|
|
6
|
+
children: x,
|
|
7
|
+
defaultOptions: r = [],
|
|
8
|
+
multiselect: i = !0,
|
|
9
|
+
value: f,
|
|
10
|
+
onChange: m,
|
|
11
|
+
onBlur: u,
|
|
12
|
+
name: h,
|
|
13
|
+
isLoading: b,
|
|
14
|
+
noOptionsText: j
|
|
15
|
+
}) => {
|
|
16
|
+
const d = k(null), [w, I] = E(!1), [y, p] = R(r), [c, v] = R([]), o = f !== void 0;
|
|
17
|
+
g(() => {
|
|
18
|
+
if (!o) {
|
|
19
|
+
const n = new Set(
|
|
20
|
+
c.map((e) => e.id)
|
|
21
|
+
);
|
|
22
|
+
p(
|
|
23
|
+
i ? r.filter((e) => !n.has(e.id)) : r.map((e) => ({
|
|
24
|
+
...e,
|
|
25
|
+
isSelected: n.has(e.id)
|
|
26
|
+
}))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}, [r, i, o, c]), g(() => {
|
|
30
|
+
if (o) {
|
|
31
|
+
const n = f || [];
|
|
32
|
+
v(n);
|
|
33
|
+
const e = new Set(n.map((s) => s.id));
|
|
34
|
+
p(
|
|
35
|
+
i ? r.filter((s) => !e.has(s.id)) : r.map((s) => ({
|
|
36
|
+
...s,
|
|
37
|
+
isSelected: e.has(s.id)
|
|
38
|
+
}))
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}, [f, o, r, i]);
|
|
42
|
+
const l = S(
|
|
43
|
+
(n) => {
|
|
44
|
+
const e = n.map(({ id: t, value: O, label: P }) => ({
|
|
45
|
+
id: t,
|
|
46
|
+
value: O ?? P
|
|
47
|
+
})), s = JSON.stringify(e);
|
|
48
|
+
d.current && (d.current.value = s), m && m({
|
|
49
|
+
target: {
|
|
50
|
+
value: n,
|
|
51
|
+
name: h ?? ""
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
[m, h]
|
|
56
|
+
), a = S(
|
|
57
|
+
(n) => {
|
|
58
|
+
const e = w;
|
|
59
|
+
I(n), e && n === !1 && u && d.current && u({
|
|
60
|
+
target: d.current,
|
|
61
|
+
type: "blur"
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
[w, I, u, d]
|
|
65
|
+
), D = S(
|
|
66
|
+
(n) => {
|
|
67
|
+
if (o) {
|
|
68
|
+
const t = [
|
|
69
|
+
...i ? c : [],
|
|
70
|
+
n
|
|
71
|
+
];
|
|
72
|
+
l(t), a(!1);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const e = [
|
|
76
|
+
...i ? c : [],
|
|
77
|
+
n
|
|
78
|
+
];
|
|
79
|
+
v(e);
|
|
80
|
+
const s = e.map((t) => t.id);
|
|
81
|
+
p(() => i ? r.filter(
|
|
82
|
+
(t) => !s.includes(t.id)
|
|
83
|
+
) : r.map((t) => ({
|
|
84
|
+
...t,
|
|
85
|
+
isSelected: s.includes(t.id)
|
|
86
|
+
}))), l(e), a(!1);
|
|
87
|
+
},
|
|
88
|
+
[
|
|
89
|
+
r,
|
|
90
|
+
l,
|
|
91
|
+
i,
|
|
92
|
+
c,
|
|
93
|
+
a,
|
|
94
|
+
o
|
|
95
|
+
]
|
|
96
|
+
), M = S(
|
|
97
|
+
(n) => {
|
|
98
|
+
if (o) {
|
|
99
|
+
const t = c.filter(
|
|
100
|
+
(O) => O.id !== n.id
|
|
101
|
+
);
|
|
102
|
+
l(t);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const e = c.filter(
|
|
106
|
+
(t) => t.id !== n.id
|
|
107
|
+
);
|
|
108
|
+
v(e);
|
|
109
|
+
const s = e.map((t) => t.id);
|
|
110
|
+
p(
|
|
111
|
+
() => r.filter(
|
|
112
|
+
(t) => !s.includes(t.id)
|
|
113
|
+
)
|
|
114
|
+
), l(e);
|
|
115
|
+
},
|
|
116
|
+
[r, l, c, o]
|
|
117
|
+
);
|
|
118
|
+
return /* @__PURE__ */ V(
|
|
119
|
+
C.Provider,
|
|
120
|
+
{
|
|
121
|
+
value: {
|
|
122
|
+
options: y,
|
|
123
|
+
selectedOptions: c,
|
|
124
|
+
isOpen: w,
|
|
125
|
+
inputRef: d,
|
|
126
|
+
onSelectOption: D,
|
|
127
|
+
onRemoveOption: M,
|
|
128
|
+
onOpen: a,
|
|
129
|
+
isLoading: b,
|
|
130
|
+
noOptionsText: j
|
|
131
|
+
},
|
|
132
|
+
children: x
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
q as MultiSelectDropdownProvider
|
|
138
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef as l, useEffect as c, useCallback as u } from "react";
|
|
2
|
+
import { useMultiSelectDropdown as i } from "../contexts/MultiSelectDropdown.hook.js";
|
|
3
|
+
const f = () => {
|
|
4
|
+
const n = l(null), { onOpen: e } = i();
|
|
5
|
+
c(() => {
|
|
6
|
+
const t = new AbortController(), a = (o) => {
|
|
7
|
+
o.key === "Escape" && e(!1);
|
|
8
|
+
}, r = (o) => {
|
|
9
|
+
n.current?.contains(o.target) || e(!1);
|
|
10
|
+
};
|
|
11
|
+
return document.addEventListener("keydown", a, {
|
|
12
|
+
signal: t.signal
|
|
13
|
+
}), document.addEventListener("mousedown", r, {
|
|
14
|
+
signal: t.signal
|
|
15
|
+
}), () => {
|
|
16
|
+
t.abort();
|
|
17
|
+
};
|
|
18
|
+
}, [e, n]);
|
|
19
|
+
const s = u(
|
|
20
|
+
(t) => {
|
|
21
|
+
t.target?.closest("[data-value]") || e(!0);
|
|
22
|
+
},
|
|
23
|
+
[e]
|
|
24
|
+
);
|
|
25
|
+
return {
|
|
26
|
+
wrapperRef: n,
|
|
27
|
+
handleOpen: s
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
f as useMultiSelectDropdown
|
|
32
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as m, jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { R as O } from "../../index-
|
|
2
|
+
import { R as O } from "../../index-DrWQH0QF.js";
|
|
3
3
|
import f, { forwardRef as b, useId as N, useCallback as w } from "react";
|
|
4
4
|
import { cn as y } from "../../utils/index.js";
|
|
5
5
|
import { labelVariants as z, buttonVariants as j, numberInputVariants as _ } from "./NumberInput.variants.js";
|
|
6
|
-
import { P as l } from "../../index
|
|
6
|
+
import { P as l } from "../../index--V_ZsiQe.js";
|
|
7
7
|
function h() {
|
|
8
8
|
return h = Object.assign || function(e) {
|
|
9
9
|
for (var o = 1; o < arguments.length; o++) {
|
|
@@ -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,46 @@
|
|
|
1
|
+
import { c as r } from "../../index-D29mdTf5.js";
|
|
2
|
+
const t = r(
|
|
3
|
+
[
|
|
4
|
+
"text-sm",
|
|
5
|
+
"relative",
|
|
6
|
+
"border",
|
|
7
|
+
"border-gray-300",
|
|
8
|
+
"rounded",
|
|
9
|
+
"data-[state=open]:border-aurora-500",
|
|
10
|
+
"focus-within:border-aurora-500",
|
|
11
|
+
"transition-colors",
|
|
12
|
+
"duration-150",
|
|
13
|
+
"dark:border-slate-500",
|
|
14
|
+
"dark:bg-slate-800",
|
|
15
|
+
"dark:data-[state=open]:border-slate-500",
|
|
16
|
+
"dark:focus-within:border-slate-500"
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
default: [],
|
|
22
|
+
error: [
|
|
23
|
+
"border-red-600",
|
|
24
|
+
"dark:border-red-500",
|
|
25
|
+
"data-[state=open]:border-red-500",
|
|
26
|
+
"focus-within:border-red-500",
|
|
27
|
+
"pr-8",
|
|
28
|
+
"focus-visible:ring-transparent"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
), e = r([
|
|
37
|
+
"cursor-pointer",
|
|
38
|
+
"text-sm",
|
|
39
|
+
"leading-5",
|
|
40
|
+
"tracking-[0.1px]",
|
|
41
|
+
"dark:text-slate-50"
|
|
42
|
+
]);
|
|
43
|
+
export {
|
|
44
|
+
e as labelVariants,
|
|
45
|
+
t as phoneNumberInputVariants
|
|
46
|
+
};
|
|
@@ -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
|
+
};
|