lawgic-dev-kit 0.8.2 → 0.8.6
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/components/atoms/Avatar/Avatar.js +3 -2
- package/dist/components/atoms/Checkbox/Checkbox.d.ts +7 -2
- package/dist/components/atoms/CountryLabel/CountryLabel.js +32 -0
- package/dist/components/atoms/PhoneInput/PhoneInput.js +282 -0
- package/dist/components/atoms/UploadContainer/UploadContainer.js +14 -13
- package/dist/components/atoms/index.d.ts +3 -0
- package/dist/components/molecules/AlertModal/AlertModal.js +7 -6
- package/dist/components/molecules/CalendarSelector/CalendarSelector.d.ts +1 -0
- package/dist/components/molecules/CalendarSelector/CalendarSelector.js +166 -106
- package/dist/components/molecules/DateInput/DateInput.js +8 -7
- package/dist/components/molecules/DialogModal/DialogModal.js +3 -2
- package/dist/components/molecules/Dropdown/Dropdown.js +22 -21
- package/dist/components/molecules/Dropdown/Dropdown.types.d.ts +2 -0
- package/dist/components/molecules/FloatingMenu/FloatingMenu.js +6 -5
- package/dist/components/molecules/Tabs/Tabs.d.ts +2 -1
- package/dist/components/molecules/Tabs/Tabs.js +19 -17
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +5 -7
- package/dist/constants/countries.js +1749 -0
- package/dist/index.js +61 -57
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +160 -161
- package/dist/src/components/atoms/ActionButton/ActionButton.d.ts +11 -0
- package/dist/src/components/atoms/ActionButton/index.d.ts +1 -0
- package/dist/src/components/atoms/AsyncToast/index.d.ts +11 -0
- package/dist/src/components/atoms/Avatar/Avatar.d.ts +11 -0
- package/dist/src/components/atoms/Avatar/index.d.ts +1 -0
- package/dist/src/components/atoms/BoxContainer/BoxContainer.d.ts +4 -0
- package/dist/src/components/atoms/BoxContainer/BoxContainer.types.d.ts +6 -0
- package/dist/src/components/atoms/BoxContainer/index.d.ts +1 -0
- package/dist/src/components/atoms/Button/Button.d.ts +4 -0
- package/dist/src/components/atoms/Button/Button.styles.d.ts +26 -0
- package/dist/src/components/atoms/Button/Button.types.d.ts +12 -0
- package/dist/src/components/atoms/Button/index.d.ts +1 -0
- package/dist/src/components/atoms/CenterModal/CenterModal.d.ts +4 -0
- package/dist/src/components/atoms/CenterModal/CenterModal.types.d.ts +5 -0
- package/dist/src/components/atoms/CenterModal/index.d.ts +1 -0
- package/dist/src/components/atoms/Checkbox/Checkbox.d.ts +10 -0
- package/dist/src/components/atoms/Checkbox/index.d.ts +1 -0
- package/dist/src/components/atoms/CountryInput/CountryInput.d.ts +4 -0
- package/dist/src/components/atoms/CountryInput/CountryInput.types.d.ts +37 -0
- package/dist/src/components/atoms/CountryInput/index.d.ts +1 -0
- package/dist/src/components/atoms/CountryLabel/CountryLabel.d.ts +6 -0
- package/dist/src/components/atoms/CountryLabel/index.d.ts +1 -0
- package/dist/src/components/atoms/CountrySelectInput/CountryDropdown.d.ts +4 -0
- package/dist/src/components/atoms/CountrySelectInput/CountryDropdown.types.d.ts +36 -0
- package/dist/src/components/atoms/CountrySelectInput/index.d.ts +1 -0
- package/dist/src/components/atoms/Divider/Divider.d.ts +7 -0
- package/dist/src/components/atoms/Divider/index.d.ts +1 -0
- package/dist/src/components/atoms/FullLogo/FullLogo.d.ts +3 -0
- package/dist/src/components/atoms/FullLogo/index.d.ts +1 -0
- package/dist/src/components/atoms/IconButton/IconButton.d.ts +4 -0
- package/dist/src/components/atoms/IconButton/IconButton.styles.d.ts +10 -0
- package/dist/src/components/atoms/IconButton/IconButton.types.d.ts +11 -0
- package/dist/src/components/atoms/IconButton/index.d.ts +1 -0
- package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.d.ts +4 -0
- package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.types.d.ts +12 -0
- package/dist/src/components/atoms/ImageProfileInput/ImageProfileInput.validators.d.ts +9 -0
- package/dist/src/components/atoms/ImageProfileInput/index.d.ts +2 -0
- package/dist/src/components/atoms/IndexedStep/IndexedStep.d.ts +9 -0
- package/dist/src/components/atoms/IndexedStep/index.d.ts +1 -0
- package/dist/src/components/atoms/InfoCard/InfoCard.d.ts +3 -0
- package/dist/src/components/atoms/InfoCard/InfoCard.types.d.ts +6 -0
- package/dist/src/components/atoms/InfoCard/index.d.ts +1 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.d.ts +4 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +2 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +9 -0
- package/dist/src/components/atoms/InformationDisclaimer/index.d.ts +1 -0
- package/dist/src/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +8 -0
- package/dist/src/components/atoms/LoadingSpinner/index.d.ts +1 -0
- package/dist/src/components/atoms/PasswordInput/PasswordInput.d.ts +5 -0
- package/dist/src/components/atoms/PasswordInput/PasswordInput.types.d.ts +11 -0
- package/dist/src/components/atoms/PasswordInput/index.d.ts +1 -0
- package/dist/src/components/atoms/PhoneInput/PhoneInput.d.ts +4 -0
- package/dist/src/components/atoms/PhoneInput/PhoneInput.types.d.ts +12 -0
- package/dist/src/components/atoms/PhoneInput/index.d.ts +1 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/src/components/atoms/ProgressBar/ProgressBar.types.d.ts +4 -0
- package/dist/src/components/atoms/ProgressBar/index.d.ts +1 -0
- package/dist/src/components/atoms/SearchBar/index.d.ts +2 -0
- package/dist/src/components/atoms/SectionButton/SectionButton.d.ts +12 -0
- package/dist/src/components/atoms/SectionButton/desktop/SectionButton.d.ts +3 -0
- package/dist/src/components/atoms/SectionButton/desktop/SectionButton.styles.d.ts +1 -0
- package/dist/src/components/atoms/SectionButton/desktop/SectionButton.types.d.ts +10 -0
- package/dist/src/components/atoms/SectionButton/desktop/index.d.ts +2 -0
- package/dist/src/components/atoms/SectionButton/index.d.ts +1 -0
- package/dist/src/components/atoms/SectionButton/mobile/MobileSectionButton.styles.d.ts +2 -0
- package/dist/src/components/atoms/SectionButton/mobile/SectionButton.d.ts +3 -0
- package/dist/src/components/atoms/SectionButton/mobile/SectionButton.types.d.ts +10 -0
- package/dist/src/components/atoms/SectionButton/mobile/index.d.ts +2 -0
- package/dist/src/components/atoms/SelectDropdown/SelectDropdown.d.ts +4 -0
- package/dist/src/components/atoms/SelectDropdown/SelectDropdown.types.d.ts +24 -0
- package/dist/src/components/atoms/SelectDropdown/index.d.ts +1 -0
- package/dist/src/components/atoms/SidebarButton/index.d.ts +10 -0
- package/dist/src/components/atoms/Tab/Tab.styles.d.ts +6 -0
- package/dist/src/components/atoms/Tab/Tab.types.d.ts +10 -0
- package/dist/src/components/atoms/Tab/index.d.ts +1 -0
- package/dist/src/components/atoms/TextButton/TextButton.d.ts +4 -0
- package/dist/src/components/atoms/TextButton/TextButton.styles.d.ts +2 -0
- package/dist/src/components/atoms/TextButton/TextButton.types.d.ts +6 -0
- package/dist/src/components/atoms/TextButton/index.d.ts +1 -0
- package/dist/src/components/atoms/TextInput/TextInput.d.ts +5 -0
- package/dist/src/components/atoms/TextInput/TextInput.types.d.ts +11 -0
- package/dist/src/components/atoms/TextInput/index.d.ts +1 -0
- package/dist/src/components/atoms/TextStaticInput/TextStaticInput.d.ts +3 -0
- package/dist/src/components/atoms/TextStaticInput/TextStaticInput.types.d.ts +5 -0
- package/dist/src/components/atoms/TextStaticInput/index.d.ts +1 -0
- package/dist/src/components/atoms/Toast/Toast.d.ts +21 -0
- package/dist/src/components/atoms/Toast/index.d.ts +1 -0
- package/dist/src/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +16 -0
- package/dist/src/components/atoms/UncontrolledSelector/index.d.ts +1 -0
- package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.d.ts +4 -0
- package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +13 -0
- package/dist/src/components/atoms/UncontrolledTextInput/index.d.ts +1 -0
- package/dist/src/components/atoms/UploadContainer/UploadContainer.d.ts +4 -0
- package/dist/src/components/atoms/UploadContainer/UploadContainer.types.d.ts +32 -0
- package/dist/src/components/atoms/UploadContainer/index.d.ts +1 -0
- package/dist/src/components/atoms/index.d.ts +30 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/molecules/AlertModal/AlertModal.d.ts +3 -0
- package/dist/src/components/molecules/AlertModal/AlertModal.types.d.ts +8 -0
- package/dist/src/components/molecules/AlertModal/index.d.ts +2 -0
- package/dist/src/components/molecules/CalendarSelector/CalendarSelector.d.ts +9 -0
- package/dist/src/components/molecules/CalendarSelector/PeriodToggle.d.ts +6 -0
- package/dist/src/components/molecules/CalendarSelector/TimeDisplay.d.ts +7 -0
- package/dist/src/components/molecules/CalendarSelector/index.d.ts +1 -0
- package/dist/src/components/molecules/DateInput/DateInput.d.ts +11 -0
- package/dist/src/components/molecules/DateInput/index.d.ts +1 -0
- package/dist/src/components/molecules/DialogModal/DialogModal.d.ts +3 -0
- package/dist/src/components/molecules/DialogModal/DialogModal.types.d.ts +10 -0
- package/dist/src/components/molecules/DialogModal/index.d.ts +1 -0
- package/dist/src/components/molecules/Dropdown/Dropdown.d.ts +3 -0
- package/dist/src/components/molecules/Dropdown/Dropdown.types.d.ts +9 -0
- package/dist/src/components/molecules/Dropdown/index.d.ts +1 -0
- package/dist/src/components/molecules/FileUpload/FileUpload.d.ts +4 -0
- package/dist/src/components/molecules/FileUpload/FileUpload.types.d.ts +17 -0
- package/dist/src/components/molecules/FileUpload/index.d.ts +1 -0
- package/dist/src/components/molecules/FloatingMenu/FloatingMenu.d.ts +4 -0
- package/dist/src/components/molecules/FloatingMenu/FloatingMenu.types.d.ts +11 -0
- package/dist/src/components/molecules/FloatingMenu/index.d.ts +1 -0
- package/dist/src/components/molecules/IndexedStepper/IndexedStepper.d.ts +7 -0
- package/dist/src/components/molecules/IndexedStepper/index.d.ts +1 -0
- package/dist/src/components/molecules/InformationContainer/InformationContainer.d.ts +14 -0
- package/dist/src/components/molecules/InformationContainer/index.d.ts +1 -0
- package/dist/src/components/molecules/SearchModal/SearchModal.d.ts +4 -0
- package/dist/src/components/molecules/SearchModal/SearchModal.types.d.ts +5 -0
- package/dist/src/components/molecules/SearchModal/index.d.ts +1 -0
- package/dist/src/components/molecules/Stepper/Stepper.d.ts +3 -0
- package/dist/src/components/molecules/Stepper/Stepper.types.d.ts +7 -0
- package/dist/src/components/molecules/Stepper/index.d.ts +1 -0
- package/dist/src/components/molecules/Tabs/Tabs.d.ts +2 -1
- package/dist/src/components/molecules/Tabs/index.d.ts +1 -0
- package/dist/src/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +10 -0
- package/dist/src/components/molecules/UncontrolledDateInput/index.d.ts +1 -0
- package/dist/src/components/molecules/index.d.ts +10 -0
- package/dist/src/components/organisms/index.d.ts +1 -0
- package/dist/src/constants/countries.d.ts +30 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/providers/ThemeProvider.d.ts +10 -0
- package/dist/src/providers/index.d.ts +1 -0
- package/dist/src/themes/default.d.ts +2 -0
- package/dist/src/themes/index.d.ts +2 -0
- package/dist/src/themes/types.d.ts +6 -0
- package/dist/src/types/baseModalProps.d.ts +4 -0
- package/dist/src/types/display.d.ts +2 -0
- package/dist/src/types/fileInfo.d.ts +2 -0
- package/dist/src/types/i18n.d.ts +1 -0
- package/dist/src/types/index.d.ts +9 -0
- package/dist/src/types/modal.d.ts +31 -0
- package/dist/src/types/modalType.d.ts +1 -0
- package/dist/src/types/navbarOption.d.ts +7 -0
- package/dist/src/types/sidebarOption.d.ts +7 -0
- package/dist/src/types/styleValues.d.ts +4 -0
- package/dist/src/types/toast.d.ts +26 -0
- package/dist/src/utils/dates.d.ts +1 -0
- package/dist/src/utils/files.d.ts +8 -0
- package/dist/src/utils/images.d.ts +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/modal.d.ts +10 -0
- package/dist/src/utils/renderContentOptions.d.ts +3 -0
- package/dist/src/utils/strings.d.ts +2 -0
- package/dist/src/utils/toast.d.ts +15 -0
- package/dist/utils/modal.js +18 -17
- package/dist/utils/toast.js +3 -2
- package/dist/vite.config.d.ts +2 -0
- package/package.json +1 -1
- package/dist/components/atoms/Logo/Logo.d.ts +0 -3
- package/dist/components/atoms/Logo/Slogan.d.ts +0 -3
|
@@ -7,8 +7,9 @@ import { getImageUrl as E } from "../../../utils/images.js";
|
|
|
7
7
|
import "../../../_virtual/lodash.js";
|
|
8
8
|
import "../../../providers/ThemeProvider.js";
|
|
9
9
|
import "../ImageProfileInput/ImageProfileInput.validators.js";
|
|
10
|
+
import "../../../constants/countries.js";
|
|
10
11
|
import "react-dom";
|
|
11
|
-
const
|
|
12
|
+
const V = ({ containerProps: x = {}, imageProps: d = {}, src: m = "", alt: i = "", size: e = 30, user: t = null }) => {
|
|
12
13
|
const { className: p = " ", ...g } = x, { className: s = " ", ...v } = d, o = e + "px", n = e * 0.5 + "px", l = e * 0.4 + "px", [j, w] = W(!1), N = () => i ? h(i) : t ? h(t != null && t.first_name || t != null && t.last_name ? ((t == null ? void 0 : t.first_name) || "") + " " + ((t == null ? void 0 : t.last_name) || "") : t == null ? void 0 : t.email) : "#9CA1B6", c = (f) => {
|
|
13
14
|
try {
|
|
14
15
|
return f ? (new URL(f), !0) : !1;
|
|
@@ -95,5 +96,5 @@ const T = ({ containerProps: x = {}, imageProps: d = {}, src: m = "", alt: i = "
|
|
|
95
96
|
);
|
|
96
97
|
};
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
V as default
|
|
99
100
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
type ColorVariant = "blue" | "aqua" | "red" | "gray";
|
|
3
|
+
type Variant = "rounded" | "square";
|
|
4
|
+
interface CheckboxProps extends React.ComponentPropsWithoutRef<"div"> {
|
|
3
5
|
active?: boolean | string | number;
|
|
4
|
-
|
|
6
|
+
color?: ColorVariant;
|
|
7
|
+
variant?: Variant;
|
|
8
|
+
}
|
|
9
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
|
5
10
|
export default Checkbox;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
const o = ({ country: s }) => {
|
|
3
|
+
const a = (e) => {
|
|
4
|
+
var r;
|
|
5
|
+
return e ? e.codeISO2 ? e.codeISO2.toLowerCase() : ((r = e.code) == null ? void 0 : r.toLowerCase()) || "" : "";
|
|
6
|
+
};
|
|
7
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-8", children: [
|
|
8
|
+
/* @__PURE__ */ t.jsx(
|
|
9
|
+
"img",
|
|
10
|
+
{
|
|
11
|
+
loading: "lazy",
|
|
12
|
+
width: "24",
|
|
13
|
+
height: "16",
|
|
14
|
+
className: "mr-2",
|
|
15
|
+
src: `https://flagcdn.com/w20/${a(
|
|
16
|
+
s
|
|
17
|
+
)}.png`,
|
|
18
|
+
srcSet: `https://flagcdn.com/w40/${a(
|
|
19
|
+
s
|
|
20
|
+
)}.png 2x`,
|
|
21
|
+
alt: s.label,
|
|
22
|
+
onError: (e) => {
|
|
23
|
+
e.currentTarget.style.display = "none";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ t.jsx("p", { className: "text-body-s text-gray-600", children: s.label })
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
o as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useState as f, useRef as h, useEffect as A } from "react";
|
|
3
|
+
import { useController as xe } from "../../../node_modules/react-hook-form/dist/index.esm.js";
|
|
4
|
+
import { useFloating as be, useClick as we, useDismiss as Ce, useInteractions as ve, useTransitionStyles as je } from "../../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
|
|
5
|
+
import { FontAwesomeIcon as Ne } from "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
6
|
+
import { faChevronDown as ye } from "../../../node_modules/@fortawesome/pro-regular-svg-icons/index.js";
|
|
7
|
+
import { useTheme as Se } from "../../../providers/ThemeProvider.js";
|
|
8
|
+
import Le from "../../../constants/countries.js";
|
|
9
|
+
import { autoUpdate as Te } from "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
10
|
+
import { offset as Ie, flip as $e, shift as Ee, size as Oe, arrow as Pe } from "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js";
|
|
11
|
+
const Ye = ({
|
|
12
|
+
name: v,
|
|
13
|
+
control: H,
|
|
14
|
+
label: Y = "phone_number",
|
|
15
|
+
placeholder: U = "enter_phone_number",
|
|
16
|
+
language: W = "en",
|
|
17
|
+
className: X = "",
|
|
18
|
+
translateKey: q,
|
|
19
|
+
countries: i = Le
|
|
20
|
+
}) => {
|
|
21
|
+
var z, F, D, V;
|
|
22
|
+
const { t: l } = Se(), { field: s, fieldState: j } = xe({
|
|
23
|
+
name: v,
|
|
24
|
+
control: H,
|
|
25
|
+
rules: { validate: {} }
|
|
26
|
+
}), N = ((z = s.value) == null ? void 0 : z.split(" ")) || [], G = N[0] || "", J = N[1] || "", K = i.find((e) => G === e.phone), [c, g] = f(!1), [d, y] = f(""), [r, S] = f(
|
|
27
|
+
K || null
|
|
28
|
+
), [L, T] = f(J), [Q, I] = f(!1), x = h(null), $ = h(null), E = h(null), b = h(null), { x: Z, y: ee, strategy: te, refs: O, context: w, placement: oe, middlewareData: P } = be({
|
|
29
|
+
open: c,
|
|
30
|
+
onOpenChange: g,
|
|
31
|
+
middleware: [
|
|
32
|
+
Ie(8),
|
|
33
|
+
$e(),
|
|
34
|
+
Ee({ padding: 8 }),
|
|
35
|
+
Oe({
|
|
36
|
+
apply({ availableHeight: e, elements: o }) {
|
|
37
|
+
Object.assign(o.floating.style, {
|
|
38
|
+
maxHeight: `${Math.min(e - 10, 300)}px`
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
padding: 8
|
|
42
|
+
}),
|
|
43
|
+
Pe({ element: $ })
|
|
44
|
+
],
|
|
45
|
+
placement: "bottom-start",
|
|
46
|
+
whileElementsMounted: Te
|
|
47
|
+
}), ne = we(w), re = Ce(w), { getReferenceProps: se, getFloatingProps: le } = ve([
|
|
48
|
+
ne,
|
|
49
|
+
re
|
|
50
|
+
]), { isMounted: ae, styles: ie } = je(w, {
|
|
51
|
+
duration: {
|
|
52
|
+
open: 200,
|
|
53
|
+
close: 150
|
|
54
|
+
},
|
|
55
|
+
initial: {
|
|
56
|
+
opacity: 0,
|
|
57
|
+
transform: "translateY(-4px)"
|
|
58
|
+
}
|
|
59
|
+
}), R = (Array.isArray(i) ? i : []).filter((e) => {
|
|
60
|
+
if (!d.trim()) return !0;
|
|
61
|
+
const o = W === "es" && e.labelES ? e.labelES.toLowerCase() : e.label.toLowerCase(), n = e.code ? e.code.toLowerCase() : "", a = e.phone ? e.phone.toLowerCase() : "";
|
|
62
|
+
return o.includes(d.toLowerCase()) || n.includes(d.toLowerCase()) || a.includes(d.toLowerCase());
|
|
63
|
+
}), ce = (e) => {
|
|
64
|
+
S(e), g(!1), y("");
|
|
65
|
+
const o = `${e.phone} ${L}`;
|
|
66
|
+
s.onChange(o), setTimeout(() => {
|
|
67
|
+
var n;
|
|
68
|
+
(n = E.current) == null || n.focus();
|
|
69
|
+
}, 100);
|
|
70
|
+
}, de = (e) => {
|
|
71
|
+
const o = e.target.value;
|
|
72
|
+
if (T(o), r) {
|
|
73
|
+
const n = `${r.phone} ${o}`;
|
|
74
|
+
s.onChange(n);
|
|
75
|
+
}
|
|
76
|
+
}, ue = () => {
|
|
77
|
+
g(!c), !c && x.current && setTimeout(() => {
|
|
78
|
+
var e;
|
|
79
|
+
(e = x.current) == null || e.focus();
|
|
80
|
+
}, 100);
|
|
81
|
+
}, B = () => {
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
c || s.onBlur();
|
|
84
|
+
}, 200);
|
|
85
|
+
}, pe = () => {
|
|
86
|
+
I(!0);
|
|
87
|
+
}, me = () => {
|
|
88
|
+
I(!1);
|
|
89
|
+
};
|
|
90
|
+
A(() => {
|
|
91
|
+
if (s.value) {
|
|
92
|
+
const e = s.value.split(" "), o = e[0] || "", n = e[1] || "", a = i.find(
|
|
93
|
+
(m) => m.phone === o
|
|
94
|
+
);
|
|
95
|
+
a && S(a), T(n);
|
|
96
|
+
}
|
|
97
|
+
}, [s.value, i]), A(() => {
|
|
98
|
+
const e = (o) => {
|
|
99
|
+
b.current && !b.current.contains(o.target) && s.onBlur();
|
|
100
|
+
};
|
|
101
|
+
return document.addEventListener("mousedown", e), () => {
|
|
102
|
+
document.removeEventListener("mousedown", e);
|
|
103
|
+
};
|
|
104
|
+
}, [s]);
|
|
105
|
+
const C = (e) => {
|
|
106
|
+
var o;
|
|
107
|
+
return e ? e.codeISO2 ? e.codeISO2.toLowerCase() : ((o = e.code) == null ? void 0 : o.toLowerCase()) || "" : "";
|
|
108
|
+
}, M = (F = P.arrow) == null ? void 0 : F.x, k = (D = P.arrow) == null ? void 0 : D.y, u = {
|
|
109
|
+
top: "bottom",
|
|
110
|
+
right: "left",
|
|
111
|
+
bottom: "top",
|
|
112
|
+
left: "right"
|
|
113
|
+
}[oe.split("-")[0]], fe = se({
|
|
114
|
+
onClick: ue,
|
|
115
|
+
onBlur: B
|
|
116
|
+
}), _ = () => j.error ? "border-red-500" : Q || c ? "border-blue-400" : "border-blue-100", he = l(Y), ge = l(U), p = (V = j.error) == null ? void 0 : V.message;
|
|
117
|
+
return /* @__PURE__ */ t.jsxs("div", { className: `w-full relative flex flex-col gap-8 ${X}`, children: [
|
|
118
|
+
/* @__PURE__ */ t.jsx(
|
|
119
|
+
"label",
|
|
120
|
+
{
|
|
121
|
+
className: `text-gray-600 font-600 group ${p && "!text-red-500"} text-label`,
|
|
122
|
+
children: he
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ t.jsxs(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref: b,
|
|
129
|
+
className: "flex items-center w-full",
|
|
130
|
+
onMouseEnter: pe,
|
|
131
|
+
onMouseLeave: me,
|
|
132
|
+
children: [
|
|
133
|
+
/* @__PURE__ */ t.jsxs(
|
|
134
|
+
"div",
|
|
135
|
+
{
|
|
136
|
+
ref: O.setReference,
|
|
137
|
+
className: `flex items-center justify-between text-lg max-w-120 font-600 bg-light rounded-l-full p-16 cursor-pointer border border-r-0 transition-all duration-200 ${p ? "border-red-500" : _()}`,
|
|
138
|
+
style: { minWidth: "140px" },
|
|
139
|
+
...fe,
|
|
140
|
+
tabIndex: 0,
|
|
141
|
+
children: [
|
|
142
|
+
r != null && r.code ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center truncate", children: [
|
|
143
|
+
C(r) && /* @__PURE__ */ t.jsx(
|
|
144
|
+
"img",
|
|
145
|
+
{
|
|
146
|
+
loading: "lazy",
|
|
147
|
+
width: "24",
|
|
148
|
+
height: "16",
|
|
149
|
+
className: "mr-2",
|
|
150
|
+
src: `https://flagcdn.com/w20/${C(
|
|
151
|
+
r
|
|
152
|
+
)}.png`,
|
|
153
|
+
srcSet: `https://flagcdn.com/w40/${C(
|
|
154
|
+
r
|
|
155
|
+
)}.png 2x`,
|
|
156
|
+
alt: r.label,
|
|
157
|
+
onError: (e) => {
|
|
158
|
+
e.currentTarget.style.display = "none";
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
163
|
+
"+",
|
|
164
|
+
r.phone
|
|
165
|
+
] })
|
|
166
|
+
] }) : /* @__PURE__ */ t.jsx("span", { className: "text-gray-500 truncate", children: l("select_country") }),
|
|
167
|
+
/* @__PURE__ */ t.jsx(
|
|
168
|
+
Ne,
|
|
169
|
+
{
|
|
170
|
+
icon: ye,
|
|
171
|
+
className: "w-14 h-14 min-w-14 min-h-14"
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ t.jsx(
|
|
178
|
+
"input",
|
|
179
|
+
{
|
|
180
|
+
ref: E,
|
|
181
|
+
type: "tel",
|
|
182
|
+
className: `flex-grow bg-light rounded-r-full font-600 text-lg p-16 border transition-all duration-200 ${p ? "border-red-500" : _()}`,
|
|
183
|
+
placeholder: ge,
|
|
184
|
+
value: L,
|
|
185
|
+
onChange: de,
|
|
186
|
+
onBlur: B
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
p && /* @__PURE__ */ t.jsx("p", { className: "mt-1 text-sm text-red-600", children: l(p, { x: l(q || "") || v }) }),
|
|
193
|
+
ae && /* @__PURE__ */ t.jsxs(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
ref: O.setFloating,
|
|
197
|
+
style: {
|
|
198
|
+
position: te,
|
|
199
|
+
top: ee ?? 0,
|
|
200
|
+
left: Z ?? 0,
|
|
201
|
+
...ie
|
|
202
|
+
},
|
|
203
|
+
className: "z-10 w-fit bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto max-w-120",
|
|
204
|
+
...le(),
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ t.jsx(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
ref: $,
|
|
210
|
+
className: "absolute w-4 h-4 bg-white rotate-45 border-blue-400",
|
|
211
|
+
style: {
|
|
212
|
+
left: M != null ? `${M}px` : "",
|
|
213
|
+
top: k != null ? `${k}px` : "",
|
|
214
|
+
right: "",
|
|
215
|
+
bottom: "",
|
|
216
|
+
[u]: "-2px",
|
|
217
|
+
borderRight: u === "left" ? "1px solid" : "none",
|
|
218
|
+
borderBottom: u === "top" ? "1px solid" : "none",
|
|
219
|
+
borderLeft: u === "right" ? "1px solid" : "none",
|
|
220
|
+
borderTop: u === "bottom" ? "1px solid" : "none"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ t.jsx("div", { className: "sticky top-0 bg-white p-2 z-20 w-fit", children: /* @__PURE__ */ t.jsx(
|
|
225
|
+
"input",
|
|
226
|
+
{
|
|
227
|
+
ref: x,
|
|
228
|
+
type: "text",
|
|
229
|
+
className: "w-fit p-16",
|
|
230
|
+
placeholder: l("search") + "...",
|
|
231
|
+
value: d,
|
|
232
|
+
onChange: (e) => y(e.target.value),
|
|
233
|
+
onClick: (e) => e.stopPropagation(),
|
|
234
|
+
onBlur: (e) => {
|
|
235
|
+
e.stopPropagation();
|
|
236
|
+
},
|
|
237
|
+
autoFocus: !0
|
|
238
|
+
}
|
|
239
|
+
) }),
|
|
240
|
+
/* @__PURE__ */ t.jsx("div", { children: R.length > 0 ? /* @__PURE__ */ t.jsx("ul", { className: "flex flex-col", children: R.map((e, o) => {
|
|
241
|
+
var a;
|
|
242
|
+
const n = e.codeISO2 ? e.codeISO2.toLowerCase() : ((a = e.code) == null ? void 0 : a.toLowerCase()) || "";
|
|
243
|
+
return /* @__PURE__ */ t.jsxs(
|
|
244
|
+
"li",
|
|
245
|
+
{
|
|
246
|
+
className: "flex items-center justify-between gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",
|
|
247
|
+
onClick: (m) => {
|
|
248
|
+
m.stopPropagation(), ce(e);
|
|
249
|
+
},
|
|
250
|
+
children: [
|
|
251
|
+
n && /* @__PURE__ */ t.jsx(
|
|
252
|
+
"img",
|
|
253
|
+
{
|
|
254
|
+
loading: "lazy",
|
|
255
|
+
width: "24",
|
|
256
|
+
height: "16",
|
|
257
|
+
className: "mr-2",
|
|
258
|
+
src: `https://flagcdn.com/w20/${n}.png`,
|
|
259
|
+
srcSet: `https://flagcdn.com/w40/${n}.png 2x`,
|
|
260
|
+
alt: e.label,
|
|
261
|
+
onError: (m) => {
|
|
262
|
+
m.currentTarget.style.display = "none";
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
),
|
|
266
|
+
/* @__PURE__ */ t.jsxs("span", { className: "text-gray-500", children: [
|
|
267
|
+
"+",
|
|
268
|
+
e.phone
|
|
269
|
+
] })
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
`${e.code}-${o}`
|
|
273
|
+
);
|
|
274
|
+
}) }) : /* @__PURE__ */ t.jsx("div", { className: "px-3 py-2 text-gray-500", children: l("no_countries_found") }) })
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
] });
|
|
279
|
+
};
|
|
280
|
+
export {
|
|
281
|
+
Ye as default
|
|
282
|
+
};
|
|
@@ -6,14 +6,15 @@ import { translateBytes as F } from "../../../utils/files.js";
|
|
|
6
6
|
import "../../../_virtual/lodash.js";
|
|
7
7
|
import "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
8
8
|
import "../ImageProfileInput/ImageProfileInput.validators.js";
|
|
9
|
+
import "../../../constants/countries.js";
|
|
9
10
|
import "react-dom";
|
|
10
|
-
const
|
|
11
|
+
const q = ({
|
|
11
12
|
title: h = "drag_and_drop_your_files_here",
|
|
12
13
|
subtitle: d = null,
|
|
13
14
|
buttonTitle: v = "choose_files",
|
|
14
15
|
onUpload: j = () => {
|
|
15
16
|
},
|
|
16
|
-
acceptedExtensions:
|
|
17
|
+
acceptedExtensions: o = [
|
|
17
18
|
"pdf",
|
|
18
19
|
"png",
|
|
19
20
|
"jpg",
|
|
@@ -24,24 +25,24 @@ const K = ({
|
|
|
24
25
|
"xls",
|
|
25
26
|
"xlsx"
|
|
26
27
|
],
|
|
27
|
-
maxSize:
|
|
28
|
+
maxSize: n = 1024
|
|
28
29
|
// en KB
|
|
29
30
|
}) => {
|
|
30
|
-
const { t: l } = B(), [
|
|
31
|
+
const { t: l } = B(), [m, a] = g(!1), [f, i] = g(""), c = $(null), y = o.map((e) => `.${e}`).join(","), u = (e) => {
|
|
31
32
|
const r = [];
|
|
32
33
|
let p = !1;
|
|
33
34
|
Array.from(e).forEach((s) => {
|
|
34
35
|
var x;
|
|
35
36
|
const _ = ((x = s.name.split(".").pop()) == null ? void 0 : x.toLowerCase()) || "";
|
|
36
|
-
if (!
|
|
37
|
+
if (!o.includes(_)) {
|
|
37
38
|
i(
|
|
38
39
|
`El archivo ${s.name} tiene una extensión no permitida.`
|
|
39
40
|
), p = !0;
|
|
40
41
|
return;
|
|
41
42
|
}
|
|
42
|
-
if (s.size >
|
|
43
|
+
if (s.size > n * 1024) {
|
|
43
44
|
i(
|
|
44
|
-
`El archivo ${s.name} excede el tamaño máximo de ${
|
|
45
|
+
`El archivo ${s.name} excede el tamaño máximo de ${n}KB.`
|
|
45
46
|
), p = !0;
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
@@ -57,7 +58,7 @@ const K = ({
|
|
|
57
58
|
}, C = (e) => {
|
|
58
59
|
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
59
60
|
}, E = (e) => {
|
|
60
|
-
e.preventDefault(), e.stopPropagation(),
|
|
61
|
+
e.preventDefault(), e.stopPropagation(), m || a(!0);
|
|
61
62
|
}, w = (e) => {
|
|
62
63
|
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
63
64
|
const r = e.dataTransfer.files;
|
|
@@ -67,7 +68,7 @@ const K = ({
|
|
|
67
68
|
/* @__PURE__ */ t.jsxs(
|
|
68
69
|
"div",
|
|
69
70
|
{
|
|
70
|
-
className: `flex flex-col border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center cursor-pointer transition-all duration-300 ${
|
|
71
|
+
className: `flex flex-col border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center cursor-pointer transition-all duration-300 ${m ? "border-blue-400 bg-blue-100/50" : "border-gray-200 bg-white hover:border-blue-400"}`,
|
|
71
72
|
onDragEnter: N,
|
|
72
73
|
onDragLeave: C,
|
|
73
74
|
onDragOver: E,
|
|
@@ -101,15 +102,15 @@ const K = ({
|
|
|
101
102
|
]
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
|
-
|
|
105
|
+
f && /* @__PURE__ */ t.jsx("div", { className: "mt-3 text-sm text-red-500", children: f }),
|
|
105
106
|
/* @__PURE__ */ t.jsx("div", { className: "mt-10 w-full flex justify-center", children: /* @__PURE__ */ t.jsxs("span", { className: "text-gray-500 font-400 text-base", children: [
|
|
106
|
-
|
|
107
|
+
o.join(", ").toUpperCase(),
|
|
107
108
|
" formats. Maximus size:",
|
|
108
109
|
" ",
|
|
109
|
-
F(
|
|
110
|
+
F(n, "mb")
|
|
110
111
|
] }) })
|
|
111
112
|
] });
|
|
112
113
|
};
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
q as default
|
|
115
116
|
};
|
|
@@ -25,3 +25,6 @@ export * from './UncontrolledSelector/index';
|
|
|
25
25
|
export * from './UncontrolledTextInput/index';
|
|
26
26
|
export * from './UploadContainer/index';
|
|
27
27
|
export * from './InformationDisclaimer/index';
|
|
28
|
+
export * from './CountryLabel/index';
|
|
29
|
+
export * from './PhoneInput/index';
|
|
30
|
+
export * from './SidebarButton/index';
|
|
@@ -8,14 +8,15 @@ import g from "../../atoms/BoxContainer/BoxContainer.js";
|
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import a from "../../atoms/Button/Button.js";
|
|
10
10
|
import "../../atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
11
|
+
import "../../../constants/countries.js";
|
|
11
12
|
import { AnimatePresence as u } from "../../../node_modules/motion/dist/es/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
12
13
|
import { motion as n } from "../../../node_modules/motion/dist/es/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
13
|
-
const
|
|
14
|
+
const I = ({
|
|
14
15
|
title: s,
|
|
15
16
|
description: r,
|
|
16
|
-
open:
|
|
17
|
+
open: o,
|
|
17
18
|
onClose: i,
|
|
18
|
-
onConfirm:
|
|
19
|
+
onConfirm: l,
|
|
19
20
|
onCancel: c
|
|
20
21
|
}) => {
|
|
21
22
|
const { t: e } = j(), m = {
|
|
@@ -46,11 +47,11 @@ const E = ({
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
}, p = () => {
|
|
49
|
-
|
|
50
|
+
l(), i();
|
|
50
51
|
}, d = () => {
|
|
51
52
|
c(), i();
|
|
52
53
|
};
|
|
53
|
-
return /* @__PURE__ */ t.jsx(u, { children:
|
|
54
|
+
return /* @__PURE__ */ t.jsx(u, { children: o && /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
|
|
54
55
|
n.div,
|
|
55
56
|
{
|
|
56
57
|
className: "fixed inset-0 bg-black bg-opacity-50 z-9999 flex items-center justify-center",
|
|
@@ -107,5 +108,5 @@ const E = ({
|
|
|
107
108
|
) }) });
|
|
108
109
|
};
|
|
109
110
|
export {
|
|
110
|
-
|
|
111
|
+
I as default
|
|
111
112
|
};
|