lawgic-dev-kit 0.22.2 → 0.22.4
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/_virtual/index2.js +2 -3
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +3 -5
- package/dist/_virtual/index5.js +5 -2
- package/dist/components/atoms/Chip/Chip.d.ts +13 -0
- package/dist/components/atoms/Chip/Chip.js +32 -0
- package/dist/components/atoms/Chip/index.d.ts +1 -0
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.js +17 -30
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +8 -2
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.js +46 -12
- package/dist/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +3 -3
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +1 -1
- package/dist/components/atoms/LoadingSpinner/LoadingSpinner.js +56 -12
- package/dist/components/atoms/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/atoms/PasswordInput/PasswordInput.js +57 -41
- package/dist/components/atoms/PasswordInput/PasswordInput.types.d.ts +1 -0
- package/dist/components/atoms/SelectInput/SelectInput.js +10 -10
- package/dist/components/atoms/SelectInput/SelectInput.types.d.ts +2 -2
- package/dist/components/atoms/TextInput/TextInput.js +13 -13
- package/dist/components/atoms/TextInput/TextInput.types.d.ts +1 -1
- package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +1 -1
- package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.js +14 -14
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.js +12 -12
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +1 -1
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/molecules/DateInput/DateInput.d.ts +1 -1
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +5 -4
- package/dist/components/molecules/MultiSelectDropdown/MultiSelectDropdown.js +123 -105
- package/dist/components/molecules/SingleSelectDropdown/SingleSelectDropdown.d.ts +25 -0
- package/dist/components/molecules/SingleSelectDropdown/SingleSelectDropdown.js +212 -0
- package/dist/components/molecules/SingleSelectDropdown/index.d.ts +1 -0
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +1 -1
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/index.js +143 -139
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +94 -89
- package/dist/node_modules/@fortawesome/pro-solid-svg-icons/index.js +14 -9
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/dist/src/components/atoms/Chip/Chip.d.ts +13 -0
- package/dist/src/components/atoms/Chip/index.d.ts +1 -0
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.styles.d.ts +8 -2
- package/dist/src/components/atoms/InformationDisclaimer/InformationDisclaimer.types.d.ts +3 -3
- package/dist/src/components/atoms/LoadingSpinner/LoadingSpinner.d.ts +1 -1
- package/dist/src/components/atoms/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/src/components/atoms/PasswordInput/PasswordInput.types.d.ts +1 -0
- package/dist/src/components/atoms/SelectInput/SelectInput.types.d.ts +2 -2
- package/dist/src/components/atoms/TextInput/TextInput.types.d.ts +1 -1
- package/dist/src/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +1 -1
- package/dist/src/components/atoms/UncontrolledTextInput/UncontrolledTextInput.types.d.ts +1 -1
- package/dist/src/components/atoms/index.d.ts +1 -0
- package/dist/src/components/molecules/DateInput/DateInput.d.ts +1 -1
- package/dist/src/components/molecules/MultiSelectDropdown/MultiSelectDropdown.d.ts +5 -4
- package/dist/src/components/molecules/SingleSelectDropdown/SingleSelectDropdown.d.ts +25 -0
- package/dist/src/components/molecules/SingleSelectDropdown/index.d.ts +1 -0
- package/dist/src/components/molecules/UncontrolledDateInput/UncontrolledDateInput.d.ts +1 -1
- package/dist/src/components/molecules/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -17,7 +17,7 @@ interface UncontrolledSelectorProps {
|
|
|
17
17
|
innerClassName?: string;
|
|
18
18
|
dropdownStyle?: React.CSSProperties;
|
|
19
19
|
showChevron?: boolean;
|
|
20
|
-
size?: 'sm' | '
|
|
20
|
+
size?: 'sm' | 'md';
|
|
21
21
|
}
|
|
22
22
|
declare const UncontrolledSelector: React.FC<UncontrolledSelectorProps>;
|
|
23
23
|
export default UncontrolledSelector;
|
|
@@ -17,9 +17,9 @@ const me = ({
|
|
|
17
17
|
innerClassName: C = "",
|
|
18
18
|
dropdownStyle: O = {},
|
|
19
19
|
showChevron: z = !0,
|
|
20
|
-
size: R = "
|
|
20
|
+
size: R = "md"
|
|
21
21
|
}) => {
|
|
22
|
-
const [
|
|
22
|
+
const [a, m] = N(!1), [l, p] = N(""), h = $(null), T = $(null), x = r.find((e) => e.value === s), n = {
|
|
23
23
|
sm: {
|
|
24
24
|
container: "px-16 py-8",
|
|
25
25
|
text: "text-sm",
|
|
@@ -29,14 +29,14 @@ const me = ({
|
|
|
29
29
|
icon: "w-12 h-12",
|
|
30
30
|
option: "text-sm"
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
md: {
|
|
33
33
|
container: "p-16",
|
|
34
|
-
text: "text-
|
|
34
|
+
text: "text-14",
|
|
35
35
|
label: "text-14",
|
|
36
36
|
error: "text-sm",
|
|
37
37
|
gap: "gap-8",
|
|
38
38
|
icon: "w-16 h-16",
|
|
39
|
-
option: "text-
|
|
39
|
+
option: "text-14"
|
|
40
40
|
}
|
|
41
41
|
}[R], v = g(() => r.map((e) => ({
|
|
42
42
|
...e,
|
|
@@ -63,7 +63,7 @@ const me = ({
|
|
|
63
63
|
};
|
|
64
64
|
return new Q(v, e);
|
|
65
65
|
}, [v]), { x: F, y: P, strategy: A, refs: c, context: f } = Y({
|
|
66
|
-
open:
|
|
66
|
+
open: a,
|
|
67
67
|
onOpenChange: m,
|
|
68
68
|
middleware: [
|
|
69
69
|
Z(8),
|
|
@@ -87,15 +87,15 @@ const me = ({
|
|
|
87
87
|
]), { isMounted: D, styles: I } = K(f, {
|
|
88
88
|
duration: { open: 200, close: 150 },
|
|
89
89
|
initial: { opacity: 0, transform: "translateY(-4px)" }
|
|
90
|
-
}), k = g(() =>
|
|
90
|
+
}), k = g(() => l.trim() ? w.search(l).map((o) => ({
|
|
91
91
|
...o.item,
|
|
92
92
|
score: o.score,
|
|
93
93
|
matches: o.matches
|
|
94
|
-
})) : r, [
|
|
94
|
+
})) : r, [l, w, r]), U = (e) => {
|
|
95
95
|
b(e.value), m(!1), p("");
|
|
96
96
|
}, _ = B({
|
|
97
97
|
onClick: () => {
|
|
98
|
-
u || (m(!
|
|
98
|
+
u || (m(!a), !a && h.current && j && setTimeout(() => {
|
|
99
99
|
var e;
|
|
100
100
|
return (e = h.current) == null ? void 0 : e.focus();
|
|
101
101
|
}, 100));
|
|
@@ -117,14 +117,14 @@ const me = ({
|
|
|
117
117
|
${n.container} cursor-pointer border transition-all duration-200
|
|
118
118
|
${u ? "opacity-60 cursor-not-allowed" : "hover:border-blue-400"}
|
|
119
119
|
${i ? "border-red-500 hover:border-red-600" : ""}
|
|
120
|
-
${
|
|
120
|
+
${a ? "border-blue-400" : "border-blue-100"}`,
|
|
121
121
|
..._,
|
|
122
122
|
children: [
|
|
123
123
|
/* @__PURE__ */ t.jsx("div", { className: "flex items-center w-full overflow-hidden", children: /* @__PURE__ */ t.jsx("span", { className: `flex-grow font-600 truncate ${n.text} ${x ? "" : "text-gray-400"}`, children: x ? x.label : L }) }),
|
|
124
124
|
z && /* @__PURE__ */ t.jsx(
|
|
125
125
|
"svg",
|
|
126
126
|
{
|
|
127
|
-
className: `${n.icon} transition-transform ${
|
|
127
|
+
className: `${n.icon} transition-transform ${a ? "transform rotate-180" : ""}`,
|
|
128
128
|
fill: "none",
|
|
129
129
|
stroke: "currentColor",
|
|
130
130
|
viewBox: "0 0 24 24",
|
|
@@ -160,13 +160,13 @@ const me = ({
|
|
|
160
160
|
type: "text",
|
|
161
161
|
className: "w-full py-8 pl-40 pr-12 rounded-full focus:outline-none text-body-s",
|
|
162
162
|
placeholder: "Search options...",
|
|
163
|
-
value:
|
|
163
|
+
value: l,
|
|
164
164
|
onChange: (e) => p(e.target.value),
|
|
165
165
|
onClick: (e) => e.stopPropagation(),
|
|
166
166
|
autoFocus: !0
|
|
167
167
|
}
|
|
168
168
|
),
|
|
169
|
-
|
|
169
|
+
l && /* @__PURE__ */ t.jsx(
|
|
170
170
|
"button",
|
|
171
171
|
{
|
|
172
172
|
className: "absolute inset-y-0 right-0 pr-12 flex items-center",
|
|
@@ -191,7 +191,7 @@ const me = ({
|
|
|
191
191
|
/* @__PURE__ */ t.jsx("svg", { className: "mx-auto h-24 w-24 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
192
192
|
/* @__PURE__ */ t.jsxs("p", { className: "mt-8 text-body-s", children: [
|
|
193
193
|
'No matches found for "',
|
|
194
|
-
|
|
194
|
+
l,
|
|
195
195
|
'"'
|
|
196
196
|
] })
|
|
197
197
|
] }) })
|
|
@@ -4,17 +4,17 @@ import "react";
|
|
|
4
4
|
const w = ({
|
|
5
5
|
label: u,
|
|
6
6
|
onChange: p,
|
|
7
|
-
value:
|
|
7
|
+
value: n,
|
|
8
8
|
name: t,
|
|
9
9
|
error: l,
|
|
10
10
|
placeholder: i,
|
|
11
11
|
className: g = "",
|
|
12
12
|
disabled: e = !1,
|
|
13
|
-
disabledInput:
|
|
14
|
-
size:
|
|
13
|
+
disabledInput: s = !1,
|
|
14
|
+
size: d = "md",
|
|
15
15
|
leftSide: a,
|
|
16
16
|
rightSide: c,
|
|
17
|
-
...
|
|
17
|
+
...b
|
|
18
18
|
}) => {
|
|
19
19
|
const { t: x } = h(), r = {
|
|
20
20
|
sm: {
|
|
@@ -24,14 +24,14 @@ const w = ({
|
|
|
24
24
|
error: "text-sm",
|
|
25
25
|
gap: "gap-8"
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
md: {
|
|
28
28
|
container: "p-16",
|
|
29
|
-
text: "text-
|
|
29
|
+
text: "text-14",
|
|
30
30
|
label: "text-14",
|
|
31
31
|
error: "text-14",
|
|
32
32
|
gap: "gap-8"
|
|
33
33
|
}
|
|
34
|
-
}[
|
|
34
|
+
}[d];
|
|
35
35
|
return /* @__PURE__ */ o.jsxs(
|
|
36
36
|
"label",
|
|
37
37
|
{
|
|
@@ -52,12 +52,12 @@ const w = ({
|
|
|
52
52
|
className: `
|
|
53
53
|
flex items-center justify-between gap-8 bg-light
|
|
54
54
|
${r.container} ${l && "!border-red-500"} rounded-full border
|
|
55
|
-
${
|
|
55
|
+
${n && !e ? "border-blue-200" : "border-blue-100"}
|
|
56
56
|
${!e && "group-hover:border-blue-300"}
|
|
57
57
|
${e && "cursor-not-allowed"}
|
|
58
58
|
|
|
59
59
|
group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
|
|
60
|
-
${
|
|
60
|
+
${s && "hover:!cursor-pointer"}
|
|
61
61
|
group-disabled:bg-gray-500
|
|
62
62
|
`,
|
|
63
63
|
children: [
|
|
@@ -65,16 +65,16 @@ const w = ({
|
|
|
65
65
|
/* @__PURE__ */ o.jsx(
|
|
66
66
|
"input",
|
|
67
67
|
{
|
|
68
|
-
...
|
|
68
|
+
...b,
|
|
69
69
|
id: t,
|
|
70
70
|
name: t,
|
|
71
71
|
disabled: e,
|
|
72
72
|
placeholder: i,
|
|
73
|
-
value:
|
|
73
|
+
value: n,
|
|
74
74
|
onChange: (f) => {
|
|
75
75
|
p(f.target.value);
|
|
76
76
|
},
|
|
77
|
-
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 ${r.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${
|
|
77
|
+
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 ${r.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${s && "pointer-events-none !select-none !caret-transparent"}`
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
80
|
c && c
|
|
@@ -8,7 +8,7 @@ export type UncontrolledTextInputProps = {
|
|
|
8
8
|
error?: string | undefined;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
disabledInput?: boolean;
|
|
11
|
-
size?: 'sm' | '
|
|
11
|
+
size?: 'sm' | 'md';
|
|
12
12
|
leftSide?: React.ReactNode;
|
|
13
13
|
rightSide?: React.ReactNode;
|
|
14
14
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>;
|
|
@@ -6,6 +6,7 @@ export * from './BoxContainer/index';
|
|
|
6
6
|
export * from './Button/index';
|
|
7
7
|
export * from './CenterModal/index';
|
|
8
8
|
export * from './Checkbox/index';
|
|
9
|
+
export * from './Chip/index';
|
|
9
10
|
export * from './CountryInput/index';
|
|
10
11
|
export * from './CountryLabel/index';
|
|
11
12
|
export * from './CountrySelectInput/index';
|
|
@@ -8,7 +8,7 @@ export type DateInputProps<T extends FieldValues = FieldValues> = {
|
|
|
8
8
|
translateKey?: string;
|
|
9
9
|
futureDates?: boolean;
|
|
10
10
|
pastDates?: boolean;
|
|
11
|
-
size?: "sm" | "
|
|
11
|
+
size?: "sm" | "md";
|
|
12
12
|
};
|
|
13
13
|
declare const DateInput: <T extends FieldValues = FieldValues>({ control, name, showTimeSelector, label, translateKey, placeholder, futureDates, pastDates, size, }: DateInputProps<T>) => React.ReactElement;
|
|
14
14
|
export default DateInput;
|
|
@@ -2,10 +2,11 @@ import { default as React } from 'react';
|
|
|
2
2
|
export type Option = {
|
|
3
3
|
label: string;
|
|
4
4
|
value: string | number;
|
|
5
|
+
dividerBefore?: boolean;
|
|
5
6
|
colors?: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
bgColor?: string;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
dotColor?: string;
|
|
9
10
|
};
|
|
10
11
|
};
|
|
11
12
|
interface MultiSelectDropdownProps {
|
|
@@ -17,7 +18,7 @@ interface MultiSelectDropdownProps {
|
|
|
17
18
|
allowSearch?: boolean;
|
|
18
19
|
className?: string;
|
|
19
20
|
disabled?: boolean;
|
|
20
|
-
size?: 'sm' | '
|
|
21
|
+
size?: 'sm' | 'md';
|
|
21
22
|
}
|
|
22
23
|
declare const MultiSelectDropdown: React.FC<MultiSelectDropdownProps>;
|
|
23
24
|
export default MultiSelectDropdown;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useFloating as
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import E, { useState as b, useRef as v, useCallback as _ } from "react";
|
|
3
|
+
import { useFloating as q, useClick as H, useDismiss as Y, useInteractions as A, useTransitionStyles as G } from "../../../node_modules/@floating-ui/react/dist/floating-ui.react.js";
|
|
4
4
|
import "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
5
5
|
import "../../../_virtual/lodash.js";
|
|
6
6
|
import "../../../contexts/themeContext.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import "../InformationContainer/InformationContainer.js";
|
|
9
9
|
import "react-dom";
|
|
10
|
-
import
|
|
10
|
+
import J from "../../atoms/Checkbox/Checkbox.js";
|
|
11
11
|
import "../../../constants/countries.js";
|
|
12
12
|
import "../../atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
13
13
|
import "fuse.js";
|
|
14
|
-
import { autoUpdate as
|
|
15
|
-
import { offset as
|
|
16
|
-
const
|
|
14
|
+
import { autoUpdate as K } from "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
15
|
+
import { offset as Q, flip as U, shift as X, size as Z, arrow as V } from "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js";
|
|
16
|
+
const fe = ({
|
|
17
17
|
label: p,
|
|
18
18
|
options: u,
|
|
19
19
|
selectedValues: n,
|
|
20
|
-
onUpdate:
|
|
21
|
-
placeholder:
|
|
22
|
-
allowSearch:
|
|
23
|
-
className:
|
|
20
|
+
onUpdate: m,
|
|
21
|
+
placeholder: k = "Seleccionar opciones",
|
|
22
|
+
allowSearch: w = !0,
|
|
23
|
+
className: N = "",
|
|
24
24
|
disabled: r = !1,
|
|
25
|
-
size:
|
|
25
|
+
size: C = "md"
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const [
|
|
27
|
+
var y;
|
|
28
|
+
const [l, h] = b(!1), [i, f] = b(""), $ = v(null), z = v(null), o = {
|
|
29
29
|
sm: {
|
|
30
30
|
container: "px-16 py-8",
|
|
31
31
|
text: "text-sm",
|
|
@@ -36,155 +36,173 @@ const ue = ({
|
|
|
36
36
|
searchText: "text-sm",
|
|
37
37
|
searchIcon: "size-12"
|
|
38
38
|
},
|
|
39
|
-
|
|
39
|
+
md: {
|
|
40
40
|
container: "p-16",
|
|
41
|
-
text: "text-
|
|
41
|
+
text: "text-14",
|
|
42
42
|
label: "text-14",
|
|
43
43
|
icon: "w-16 h-16",
|
|
44
44
|
checkboxSize: 20,
|
|
45
45
|
gap: "gap-8",
|
|
46
|
-
searchText: "text-
|
|
46
|
+
searchText: "text-14",
|
|
47
47
|
searchIcon: "size-16"
|
|
48
48
|
}
|
|
49
|
-
}[
|
|
50
|
-
open:
|
|
51
|
-
onOpenChange: (
|
|
49
|
+
}[C], { x: S, y: L, strategy: M, refs: x, context: d } = q({
|
|
50
|
+
open: l && !r,
|
|
51
|
+
onOpenChange: (t) => !r && h(t),
|
|
52
52
|
middleware: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
apply({ availableHeight:
|
|
53
|
+
Q(8),
|
|
54
|
+
U(),
|
|
55
|
+
X({ padding: 8 }),
|
|
56
|
+
Z({
|
|
57
|
+
apply({ availableHeight: t, elements: s }) {
|
|
58
58
|
Object.assign(s.floating.style, {
|
|
59
|
-
maxHeight: `${Math.min(
|
|
59
|
+
maxHeight: `${Math.min(t - 10, 500)}px`
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
padding: 8
|
|
63
|
-
})
|
|
63
|
+
}),
|
|
64
|
+
V({ element: z })
|
|
64
65
|
],
|
|
65
66
|
placement: "bottom-start",
|
|
66
|
-
whileElementsMounted:
|
|
67
|
-
}),
|
|
67
|
+
whileElementsMounted: K
|
|
68
|
+
}), R = H(d, { enabled: !r }), B = Y(d), { getReferenceProps: I, getFloatingProps: T } = A([R, B]), { isMounted: F, styles: O } = G(d, {
|
|
68
69
|
duration: { open: 200, close: 150 },
|
|
69
70
|
initial: { opacity: 0, transform: "translateY(-4px)" }
|
|
70
|
-
}),
|
|
71
|
+
}), P = _((t, s) => {
|
|
71
72
|
if (r) return;
|
|
72
|
-
let
|
|
73
|
-
s ?
|
|
74
|
-
}, [n,
|
|
75
|
-
(
|
|
76
|
-
),
|
|
77
|
-
if (n.length === 0) return
|
|
78
|
-
const
|
|
79
|
-
return
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
let a;
|
|
74
|
+
s ? a = n.includes(t) ? n : [...n, t] : a = n.filter((c) => c !== t), m(a);
|
|
75
|
+
}, [n, m, r]), g = u.filter(
|
|
76
|
+
(t) => t.label.toLowerCase().includes(i.toLowerCase())
|
|
77
|
+
), W = () => {
|
|
78
|
+
if (n.length === 0) return k;
|
|
79
|
+
const t = u.filter((s) => n.includes(s.value)).map((s) => s.label);
|
|
80
|
+
return t.length === 1 ? t[0] : `${t.length} seleccionados`;
|
|
81
|
+
}, D = I({
|
|
82
|
+
onClick: () => !r && h(!l)
|
|
83
|
+
});
|
|
84
|
+
return /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col select-none ${o.gap} ${r ? "cursor-not-allowed" : ""} ${N}`, children: [
|
|
85
|
+
p && /* @__PURE__ */ e.jsx("h6", { className: `text-gray-600 font-600 ${o.label} ${r ? "text-gray-300" : ""}`, children: p }),
|
|
86
|
+
/* @__PURE__ */ e.jsxs(
|
|
84
87
|
"div",
|
|
85
88
|
{
|
|
86
|
-
ref:
|
|
89
|
+
ref: x.setReference,
|
|
87
90
|
className: `
|
|
88
91
|
flex items-center justify-between rounded-full border transition-all duration-200
|
|
89
92
|
${o.container}
|
|
90
93
|
${r ? "bg-gray-50 border-gray-200 cursor-not-allowed" : "bg-blue-50 cursor-pointer"}
|
|
91
|
-
${!r && (
|
|
94
|
+
${!r && (l ? "border-blue-500" : "border-blue-100 hover:border-blue-300")}
|
|
92
95
|
`,
|
|
93
|
-
...
|
|
96
|
+
...D,
|
|
94
97
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ e.jsx("span", { className: `flex-grow text-left truncate font-600 ${o.text} ${r ? "text-gray-300" : "text-gray-500"}`, children: W() }),
|
|
99
|
+
/* @__PURE__ */ e.jsx(
|
|
97
100
|
"svg",
|
|
98
101
|
{
|
|
99
|
-
className: `${o.icon} transition-transform ${
|
|
102
|
+
className: `${o.icon} transition-transform ${l ? "rotate-180" : ""} ${r ? "text-gray-300" : "text-gray-500"}`,
|
|
100
103
|
fill: "none",
|
|
101
104
|
stroke: "currentColor",
|
|
102
105
|
viewBox: "0 0 24 24",
|
|
103
|
-
children: /* @__PURE__ */
|
|
106
|
+
children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19 9l-7 7-7-7" })
|
|
104
107
|
}
|
|
105
108
|
)
|
|
106
109
|
]
|
|
107
110
|
}
|
|
108
111
|
),
|
|
109
|
-
|
|
112
|
+
F && !r && /* @__PURE__ */ e.jsxs(
|
|
110
113
|
"div",
|
|
111
114
|
{
|
|
112
|
-
ref:
|
|
115
|
+
ref: x.setFloating,
|
|
113
116
|
style: {
|
|
114
|
-
position:
|
|
115
|
-
top:
|
|
117
|
+
position: M,
|
|
118
|
+
top: L ?? 0,
|
|
116
119
|
left: S ?? 0,
|
|
117
|
-
...
|
|
118
|
-
width: (
|
|
120
|
+
...O,
|
|
121
|
+
width: (y = x.reference.current) == null ? void 0 : y.clientWidth,
|
|
119
122
|
zIndex: 50
|
|
120
123
|
},
|
|
121
124
|
className: "bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",
|
|
122
125
|
...T(),
|
|
123
126
|
children: [
|
|
124
|
-
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
+
w && /* @__PURE__ */ e.jsx("div", { className: "sticky top-0 bg-white p-8 border-b border-gray-100 z-20", children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
128
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-y-0 left-0 pl-12 flex items-center pointer-events-none", children: /* @__PURE__ */ e.jsx("svg", { className: `${o.searchIcon} text-gray-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) }),
|
|
129
|
+
/* @__PURE__ */ e.jsx(
|
|
127
130
|
"input",
|
|
128
131
|
{
|
|
129
132
|
ref: $,
|
|
130
133
|
type: "text",
|
|
131
134
|
className: `w-full py-6 pl-36 pr-12 rounded-full focus:outline-none bg-gray-50 ${o.searchText}`,
|
|
132
135
|
placeholder: "Buscar...",
|
|
133
|
-
value:
|
|
134
|
-
onChange: (
|
|
135
|
-
onClick: (
|
|
136
|
+
value: i,
|
|
137
|
+
onChange: (t) => f(t.target.value),
|
|
138
|
+
onClick: (t) => t.stopPropagation(),
|
|
136
139
|
autoFocus: !0
|
|
137
140
|
}
|
|
141
|
+
),
|
|
142
|
+
i && /* @__PURE__ */ e.jsx(
|
|
143
|
+
"button",
|
|
144
|
+
{
|
|
145
|
+
className: "absolute inset-y-0 right-0 pr-12 flex items-center",
|
|
146
|
+
onClick: (t) => {
|
|
147
|
+
t.stopPropagation(), f("");
|
|
148
|
+
},
|
|
149
|
+
children: /* @__PURE__ */ e.jsx("svg", { className: "h-16 w-16 text-gray-400 hover:text-gray-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" }) })
|
|
150
|
+
}
|
|
138
151
|
)
|
|
139
152
|
] }) }),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
var
|
|
142
|
-
const s = n.includes(
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
"div",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
)
|
|
182
|
-
|
|
153
|
+
/* @__PURE__ */ e.jsx("div", { className: "max-h-[450px] overflow-y-auto", children: g.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "py-4", children: g.map((t) => {
|
|
154
|
+
var a, c, j;
|
|
155
|
+
const s = n.includes(t.value);
|
|
156
|
+
return /* @__PURE__ */ e.jsxs(E.Fragment, { children: [
|
|
157
|
+
t.dividerBefore && /* @__PURE__ */ e.jsx("div", { className: "px-16 py-8", children: /* @__PURE__ */ e.jsx("hr", { className: "border-t border-gray-200" }) }),
|
|
158
|
+
/* @__PURE__ */ e.jsxs(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
className: "flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer gap-12",
|
|
162
|
+
onClick: () => P(t.value, !s),
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ e.jsx(
|
|
165
|
+
J,
|
|
166
|
+
{
|
|
167
|
+
active: s,
|
|
168
|
+
size: o.checkboxSize,
|
|
169
|
+
variant: "square",
|
|
170
|
+
className: "flex-shrink-0"
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
/* @__PURE__ */ e.jsxs(
|
|
174
|
+
"div",
|
|
175
|
+
{
|
|
176
|
+
className: `flex items-center rounded-[8px] py-4 px-8 gap-[6px] overflow-hidden ${((a = t.colors) == null ? void 0 : a.bgColor) || ""} ${((c = t.colors) == null ? void 0 : c.textColor) || ""}`,
|
|
177
|
+
children: [
|
|
178
|
+
((j = t.colors) == null ? void 0 : j.dotColor) && /* @__PURE__ */ e.jsx(
|
|
179
|
+
"span",
|
|
180
|
+
{
|
|
181
|
+
className: "size-6 rounded-full flex-shrink-0",
|
|
182
|
+
style: { background: t.colors.dotColor }
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ e.jsx("span", { className: `${o.text} font-semibold truncate`, children: t.label })
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
] }, t.value);
|
|
193
|
+
}) }) : /* @__PURE__ */ e.jsxs("div", { className: "px-16 py-16 text-center text-gray-500", children: [
|
|
194
|
+
/* @__PURE__ */ e.jsx("svg", { className: "mx-auto h-24 w-24 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
195
|
+
/* @__PURE__ */ e.jsxs("p", { className: "mt-8 text-body-s", children: [
|
|
196
|
+
"No se encontraron resultados para “",
|
|
197
|
+
i,
|
|
198
|
+
"”"
|
|
199
|
+
] })
|
|
200
|
+
] }) })
|
|
183
201
|
]
|
|
184
202
|
}
|
|
185
203
|
)
|
|
186
204
|
] });
|
|
187
205
|
};
|
|
188
206
|
export {
|
|
189
|
-
|
|
207
|
+
fe as default
|
|
190
208
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type Option = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
dividerBefore?: boolean;
|
|
6
|
+
colors?: {
|
|
7
|
+
bgColor?: string;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
dotColor?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
interface SingleSelectDropdownProps {
|
|
13
|
+
label?: string;
|
|
14
|
+
options: Option[];
|
|
15
|
+
selectedValue?: string | number | null;
|
|
16
|
+
onUpdate: (value: string | number | null) => void;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
allowSearch?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
size?: 'sm' | 'md';
|
|
22
|
+
showRadio?: boolean;
|
|
23
|
+
}
|
|
24
|
+
declare const SingleSelectDropdown: React.FC<SingleSelectDropdownProps>;
|
|
25
|
+
export default SingleSelectDropdown;
|