lawgic-dev-kit 0.15.0 → 0.15.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/components/atoms/Avatar/Avatar.js +17 -16
- package/dist/components/atoms/SelectInput/SelectInput.js +96 -74
- package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +2 -0
- package/dist/components/atoms/UncontrolledSelector/UncontrolledSelector.js +189 -51
- package/dist/components/atoms/UploadContainer/UploadContainer.js +3 -2
- package/dist/components/atoms/UploadContainer/UploadContainer.types.d.ts +1 -1
- package/dist/components/molecules/AlertModal/AlertModal.js +3 -2
- package/dist/components/molecules/CalendarSelector/CalendarSelector.js +3 -2
- package/dist/components/molecules/DialogModal/DialogModal.js +3 -2
- package/dist/components/molecules/FloatingMenu/FloatingMenu.js +6 -5
- package/dist/components/molecules/Tabs/Tabs.js +8 -7
- package/dist/components/molecules/UncontrolledDateInput/UncontrolledDateInput.js +12 -11
- package/dist/lawgic-dev-kit.css +1 -1
- package/dist/lawgic-dev-kit.umd.js +47 -45
- package/dist/src/components/atoms/UncontrolledSelector/UncontrolledSelector.d.ts +18 -0
- package/dist/src/components/atoms/UploadContainer/UploadContainer.types.d.ts +34 -0
- package/dist/utils/modal.js +28 -27
- package/dist/utils/toast.js +3 -2
- package/package.json +7 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Option {
|
|
3
|
+
label: string | React.ReactNode;
|
|
4
|
+
value: number | string;
|
|
5
|
+
}
|
|
6
|
+
interface UncontrolledSelectorProps {
|
|
7
|
+
value: number | string;
|
|
8
|
+
onChange: (value: number | string) => void;
|
|
9
|
+
options: Option[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
allowSearch?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const UncontrolledSelector: React.FC<UncontrolledSelectorProps>;
|
|
18
|
+
export default UncontrolledSelector;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface UploadContainerProps {
|
|
2
|
+
/**
|
|
3
|
+
* Título que se muestra en el área de carga
|
|
4
|
+
* @default 'drag_and_drop_your_files_here'
|
|
5
|
+
*/
|
|
6
|
+
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Subtítulo opcional para mostrar información adicional
|
|
9
|
+
* @default null
|
|
10
|
+
*/
|
|
11
|
+
subtitle?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Texto del botón de selección de archivos
|
|
14
|
+
* @default 'choose_files'
|
|
15
|
+
*/
|
|
16
|
+
buttonTitle?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Función que se ejecuta cuando se cargan archivos válidos
|
|
19
|
+
* @param files Array de objetos File seleccionados
|
|
20
|
+
*/
|
|
21
|
+
onUpload?: (files: File[]) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Lista de extensiones de archivo permitidas
|
|
24
|
+
* @default ['pdf', 'png', 'jpg', 'jpeg', 'svg', 'docx', 'doc', 'xls', 'xlsx']
|
|
25
|
+
*/
|
|
26
|
+
acceptedExtensions?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Tamaño máximo de archivo en KB
|
|
29
|
+
* @default 1024
|
|
30
|
+
*/
|
|
31
|
+
maxSize?: number;
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
loadingDuration?: number;
|
|
34
|
+
}
|
package/dist/utils/modal.js
CHANGED
|
@@ -8,11 +8,12 @@ import x from "../components/atoms/CenterModal/CenterModal.js";
|
|
|
8
8
|
import "react-hook-form";
|
|
9
9
|
import "../constants/countries.js";
|
|
10
10
|
import "../components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
11
|
+
import "fuse.js";
|
|
11
12
|
import h from "../components/molecules/DialogModal/DialogModal.js";
|
|
12
13
|
import "../components/molecules/InformationContainer/InformationContainer.js";
|
|
13
|
-
const
|
|
14
|
-
const [p,
|
|
15
|
-
const
|
|
14
|
+
const T = () => {
|
|
15
|
+
const [p, n] = M([]), o = w([]), d = s((e) => {
|
|
16
|
+
const r = {
|
|
16
17
|
...e,
|
|
17
18
|
id: (e == null ? void 0 : e.id) || i.uniqueId(),
|
|
18
19
|
open: !0,
|
|
@@ -23,25 +24,25 @@ const S = () => {
|
|
|
23
24
|
onClose: () => t(e.id || i.uniqueId())
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
o.current = [...o.current,
|
|
27
|
+
o.current = [...o.current, r], n(o.current);
|
|
27
28
|
}, []), l = s((e) => {
|
|
28
|
-
const
|
|
29
|
-
id:
|
|
29
|
+
const r = i.uniqueId(), c = {
|
|
30
|
+
id: r,
|
|
30
31
|
open: !0,
|
|
31
32
|
onClose: () => {
|
|
32
|
-
t(
|
|
33
|
+
t(r);
|
|
33
34
|
},
|
|
34
35
|
type: "custom",
|
|
35
36
|
component: e
|
|
36
37
|
};
|
|
37
|
-
o.current = [...o.current, c],
|
|
38
|
+
o.current = [...o.current, c], n(o.current);
|
|
38
39
|
}, []), t = s((e) => {
|
|
39
40
|
o.current = o.current.map(
|
|
40
|
-
(
|
|
41
|
-
),
|
|
41
|
+
(r) => r.id === e ? { ...r, open: !1 } : r
|
|
42
|
+
), n(o.current), setTimeout(() => {
|
|
42
43
|
o.current = o.current.filter(
|
|
43
|
-
(
|
|
44
|
-
),
|
|
44
|
+
(r) => r.id !== e
|
|
45
|
+
), n(o.current);
|
|
45
46
|
}, 150);
|
|
46
47
|
}, []);
|
|
47
48
|
return C(() => {
|
|
@@ -75,34 +76,34 @@ const S = () => {
|
|
|
75
76
|
e.id
|
|
76
77
|
);
|
|
77
78
|
}
|
|
78
|
-
const { props:
|
|
79
|
+
const { props: r } = e;
|
|
79
80
|
return /* @__PURE__ */ u.jsx(
|
|
80
81
|
x,
|
|
81
82
|
{
|
|
82
|
-
...
|
|
83
|
+
...r,
|
|
83
84
|
open: e.open,
|
|
84
85
|
onClose: () => t(e.id),
|
|
85
|
-
children: typeof
|
|
86
|
+
children: typeof r.children == "function" ? r.children(() => t(e.id)) : r.children
|
|
86
87
|
},
|
|
87
88
|
e.id
|
|
88
89
|
);
|
|
89
90
|
}) });
|
|
90
91
|
};
|
|
91
|
-
function T(p) {
|
|
92
|
-
var r;
|
|
93
|
-
(r = window == null ? void 0 : window.openModal) == null || r.call(window, p);
|
|
94
|
-
}
|
|
95
92
|
function v(p) {
|
|
96
|
-
var
|
|
97
|
-
(
|
|
93
|
+
var n;
|
|
94
|
+
(n = window == null ? void 0 : window.openModal) == null || n.call(window, p);
|
|
98
95
|
}
|
|
99
96
|
function z(p) {
|
|
100
|
-
var
|
|
101
|
-
(
|
|
97
|
+
var n;
|
|
98
|
+
(n = window == null ? void 0 : window.openCustomModal) == null || n.call(window, p);
|
|
99
|
+
}
|
|
100
|
+
function B(p) {
|
|
101
|
+
var n;
|
|
102
|
+
(n = window == null ? void 0 : window.closeModal) == null || n.call(window, p);
|
|
102
103
|
}
|
|
103
104
|
export {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
T as ModalContainer,
|
|
106
|
+
B as closeModal,
|
|
107
|
+
z as openCustomModal,
|
|
108
|
+
v as openModal
|
|
108
109
|
};
|
package/dist/utils/toast.js
CHANGED
|
@@ -9,6 +9,7 @@ import "../components/molecules/InformationContainer/InformationContainer.js";
|
|
|
9
9
|
import "../constants/countries.js";
|
|
10
10
|
import "../components/atoms/ImageProfileInput/ImageProfileInput.validators.js";
|
|
11
11
|
import h from "../components/atoms/Toast/Toast.js";
|
|
12
|
+
import "fuse.js";
|
|
12
13
|
const m = [];
|
|
13
14
|
function l(e = "bottom-center") {
|
|
14
15
|
var o;
|
|
@@ -104,7 +105,7 @@ const p = (e, o, t = {}) => {
|
|
|
104
105
|
resolve: t,
|
|
105
106
|
reject: a
|
|
106
107
|
};
|
|
107
|
-
},
|
|
108
|
+
}, F = {
|
|
108
109
|
success: (e, o = {}) => c(e, "success", o),
|
|
109
110
|
error: (e, o = {}) => c(e, "error", o),
|
|
110
111
|
warning: (e, o = {}) => c(e, "warning", o),
|
|
@@ -115,5 +116,5 @@ const p = (e, o, t = {}) => {
|
|
|
115
116
|
export {
|
|
116
117
|
p as showToastAsync,
|
|
117
118
|
b as showToastLoading,
|
|
118
|
-
|
|
119
|
+
F as toast
|
|
119
120
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lawgic-dev-kit",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "Componentes de UI para Lawgic",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -91,7 +91,8 @@
|
|
|
91
91
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
92
92
|
"react": ">=18.2 <20",
|
|
93
93
|
"react-dom": ">=18.2 <20",
|
|
94
|
-
"react-hook-form": "^7.54.2"
|
|
94
|
+
"react-hook-form": "^7.54.2",
|
|
95
|
+
"fuse.js": "^7.1.0"
|
|
95
96
|
},
|
|
96
97
|
"dependencies": {
|
|
97
98
|
"@floating-ui/dom": "^1.6.13",
|
|
@@ -99,13 +100,11 @@
|
|
|
99
100
|
"@tailwindcss/postcss": "^4.1.5",
|
|
100
101
|
"clsx": "^2.1.1",
|
|
101
102
|
"date-fns": "^4.1.0",
|
|
103
|
+
"fuse.js": "^7.1.0",
|
|
102
104
|
"motion": "^12.5.0",
|
|
103
105
|
"tailwindest": "^3.1.1"
|
|
104
106
|
},
|
|
105
107
|
"devDependencies": {
|
|
106
|
-
"tailwindcss": "latest",
|
|
107
|
-
"autoprefixer": "latest",
|
|
108
|
-
"postcss": "latest",
|
|
109
108
|
"@chromatic-com/storybook": "^3.2.5",
|
|
110
109
|
"@eslint/js": "^9.21.0",
|
|
111
110
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
|
@@ -129,6 +128,7 @@
|
|
|
129
128
|
"@vitejs/plugin-react-swc": "^3.8.0",
|
|
130
129
|
"@vitest/browser": "^3.0.8",
|
|
131
130
|
"@vitest/coverage-v8": "^3.0.8",
|
|
131
|
+
"autoprefixer": "latest",
|
|
132
132
|
"eslint": "^9.21.0",
|
|
133
133
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
134
134
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
@@ -136,10 +136,12 @@
|
|
|
136
136
|
"globals": "^15.15.0",
|
|
137
137
|
"legal-cycle-api-types": "^0.0.70",
|
|
138
138
|
"playwright": "^1.51.0",
|
|
139
|
+
"postcss": "latest",
|
|
139
140
|
"react": "^19.1.0",
|
|
140
141
|
"react-dom": "^19.1.0",
|
|
141
142
|
"react-hook-form": "^7.54.2",
|
|
142
143
|
"storybook": "^8.6.4",
|
|
144
|
+
"tailwindcss": "latest",
|
|
143
145
|
"typescript": "~5.7.2",
|
|
144
146
|
"typescript-eslint": "^8.24.1",
|
|
145
147
|
"vite": "^6.2.0",
|