@dipusevilla/componentes-iu 1.0.17 → 1.0.19
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/index.cjs.js +13 -13
- package/dist/index.es.js +1567 -1562
- package/dist/index.umd.js +14 -14
- package/dist/types/components/SearchField.d.ts +7 -2
- package/dist/types/types/FormTypes.d.ts +7 -1
- package/package.json +95 -95
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { type Control } from "react-hook-form";
|
|
1
|
+
import { type Control, type UseFormGetValues, type UseFormWatch } from "react-hook-form";
|
|
2
2
|
import { Option } from "../types/FormTypes";
|
|
3
|
+
type FormCtx = {
|
|
4
|
+
getValues: UseFormGetValues<any>;
|
|
5
|
+
watch: UseFormWatch<any>;
|
|
6
|
+
};
|
|
3
7
|
export interface SearchFieldProps {
|
|
4
8
|
name: string;
|
|
5
9
|
control: Control<any>;
|
|
6
|
-
searchFn: (query: string) => Promise<Option[]>;
|
|
10
|
+
searchFn: (query: string, ctx?: FormCtx) => Promise<Option[]>;
|
|
7
11
|
label?: string;
|
|
8
12
|
size?: "sm" | "md" | "lg";
|
|
9
13
|
width?: string;
|
|
10
14
|
disabled?: boolean;
|
|
11
15
|
}
|
|
12
16
|
export declare function SearchField({ name, control, searchFn, label, size, width, disabled, }: SearchFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -2,10 +2,15 @@ import type { AnyObject, ObjectSchema } from "yup";
|
|
|
2
2
|
import { Size } from "../components/InputGroup";
|
|
3
3
|
import { InputProps } from "../components/Input";
|
|
4
4
|
import { SelectProps } from "../components/Select";
|
|
5
|
+
import { UseFormGetValues, UseFormWatch } from "react-hook-form";
|
|
5
6
|
/**
|
|
6
7
|
* Tipo de campo atómico admitido.
|
|
7
8
|
*/
|
|
8
9
|
export type FieldType = "text" | "email" | "number" | "password" | "select" | "date" | "optionGroup" | "button" | "textarea" | "file" | "inputGroup" | "checkbox" | "search";
|
|
10
|
+
type FormCtx = {
|
|
11
|
+
getValues: UseFormGetValues<any>;
|
|
12
|
+
watch: UseFormWatch<any>;
|
|
13
|
+
};
|
|
9
14
|
/**
|
|
10
15
|
* Esquema que describe un campo atómico del formulario.
|
|
11
16
|
*/
|
|
@@ -85,7 +90,7 @@ export interface FieldSchema {
|
|
|
85
90
|
width?: string;
|
|
86
91
|
}>;
|
|
87
92
|
/** Para el campo de búsqueda: función que recibe el texto y devuelve opciones */
|
|
88
|
-
searchFn?: (query: string) => Promise<{
|
|
93
|
+
searchFn?: (query: string, ctx?: FormCtx) => Promise<{
|
|
89
94
|
label: string;
|
|
90
95
|
value: any;
|
|
91
96
|
}[]>;
|
|
@@ -203,3 +208,4 @@ export type Option = {
|
|
|
203
208
|
label?: string;
|
|
204
209
|
value: string | number;
|
|
205
210
|
};
|
|
211
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dipusevilla/componentes-iu",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Librería de componentes React de Dipusevilla",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"react",
|
|
7
|
-
"design-system",
|
|
8
|
-
"component-library",
|
|
9
|
-
"ui",
|
|
10
|
-
"dipusevilla"
|
|
11
|
-
],
|
|
12
|
-
"author": "Dipusevilla <desarrolloinpro@dipusevilla.es>",
|
|
13
|
-
"main": "dist/index.cjs.js",
|
|
14
|
-
"module": "dist/index.es.js",
|
|
15
|
-
"unpkg": "dist/index.umd.js",
|
|
16
|
-
"types": "dist/types/index.d.ts",
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build:types": "tsc --project tsconfig.build.json",
|
|
19
|
-
"build": "vite build && npm run build:types",
|
|
20
|
-
"prepublishOnly": "npm run build",
|
|
21
|
-
"dev": "vite",
|
|
22
|
-
"lint": "eslint .",
|
|
23
|
-
"preview": "vite preview",
|
|
24
|
-
"storybook": "storybook dev -p 6006",
|
|
25
|
-
"build-storybook": "storybook build"
|
|
26
|
-
},
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"react": "^19.1.0",
|
|
29
|
-
"react-dom": "^19.1.0"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@headlessui/react": "^2.2.4",
|
|
33
|
-
"@heroicons/react": "^2.2.0",
|
|
34
|
-
"@hookform/resolvers": "^5.0.1",
|
|
35
|
-
"clsx": "^2.1.1",
|
|
36
|
-
"i18next": "^25.2.1",
|
|
37
|
-
"react-hook-form": "^7.56.4",
|
|
38
|
-
"react-i18next": "^15.5.2",
|
|
39
|
-
"yup": "^1.6.1"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@chromatic-com/storybook": "^3.2.6",
|
|
43
|
-
"@eslint/js": "^9.25.0",
|
|
44
|
-
"@storybook/addon-essentials": "^8.6.14",
|
|
45
|
-
"@storybook/addon-onboarding": "^8.6.14",
|
|
46
|
-
"@storybook/blocks": "^8.6.14",
|
|
47
|
-
"@storybook/builder-vite": "^8.6.14",
|
|
48
|
-
"@storybook/experimental-addon-test": "^8.6.14",
|
|
49
|
-
"@storybook/react": "^8.6.14",
|
|
50
|
-
"@storybook/react-vite": "^8.6.14",
|
|
51
|
-
"@storybook/test": "^8.6.14",
|
|
52
|
-
"@tailwindcss/postcss": "^4.1.8",
|
|
53
|
-
"@tailwindcss/vite": "^4.1.7",
|
|
54
|
-
"@types/i18next": "^12.1.0",
|
|
55
|
-
"@types/node": "^22.15.29",
|
|
56
|
-
"@types/react": "^19.1.6",
|
|
57
|
-
"@types/react-dom": "^19.1.5",
|
|
58
|
-
"@types/tailwindcss": "^3.0.11",
|
|
59
|
-
"@vitejs/plugin-react": "^4.4.1",
|
|
60
|
-
"@vitest/browser": "^3.1.4",
|
|
61
|
-
"@vitest/coverage-v8": "^3.1.4",
|
|
62
|
-
"autoprefixer": "^10.4.21",
|
|
63
|
-
"eslint": "^9.25.0",
|
|
64
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
65
|
-
"eslint-plugin-react-refresh": "^0.4.19",
|
|
66
|
-
"eslint-plugin-storybook": "^0.12.0",
|
|
67
|
-
"globals": "^16.0.0",
|
|
68
|
-
"playwright": "^1.52.0",
|
|
69
|
-
"postcss": "^8.5.4",
|
|
70
|
-
"storybook": "^8.6.14",
|
|
71
|
-
"storybook-dark-mode": "^4.0.2",
|
|
72
|
-
"tailwindcss": "^4.1.8",
|
|
73
|
-
"typescript": "~5.8.3",
|
|
74
|
-
"typescript-eslint": "^8.30.1",
|
|
75
|
-
"vite": "^6.3.5",
|
|
76
|
-
"vite-plugin-svgr": "^4.3.0",
|
|
77
|
-
"vitest": "^3.1.4"
|
|
78
|
-
},
|
|
79
|
-
"license": "ISC",
|
|
80
|
-
"eslintConfig": {
|
|
81
|
-
"extends": [
|
|
82
|
-
"plugin:storybook/recommended"
|
|
83
|
-
]
|
|
84
|
-
},
|
|
85
|
-
"exports": {
|
|
86
|
-
".": {
|
|
87
|
-
"import": "./dist/index.es.js",
|
|
88
|
-
"require": "./dist/index.cjs.js"
|
|
89
|
-
},
|
|
90
|
-
"./style.css": "./dist/index.css"
|
|
91
|
-
},
|
|
92
|
-
"files": [
|
|
93
|
-
"dist"
|
|
94
|
-
]
|
|
95
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dipusevilla/componentes-iu",
|
|
3
|
+
"version": "1.0.19",
|
|
4
|
+
"description": "Librería de componentes React de Dipusevilla",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"design-system",
|
|
8
|
+
"component-library",
|
|
9
|
+
"ui",
|
|
10
|
+
"dipusevilla"
|
|
11
|
+
],
|
|
12
|
+
"author": "Dipusevilla <desarrolloinpro@dipusevilla.es>",
|
|
13
|
+
"main": "dist/index.cjs.js",
|
|
14
|
+
"module": "dist/index.es.js",
|
|
15
|
+
"unpkg": "dist/index.umd.js",
|
|
16
|
+
"types": "dist/types/index.d.ts",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build:types": "tsc --project tsconfig.build.json",
|
|
19
|
+
"build": "vite build && npm run build:types",
|
|
20
|
+
"prepublishOnly": "npm run build",
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"lint": "eslint .",
|
|
23
|
+
"preview": "vite preview",
|
|
24
|
+
"storybook": "storybook dev -p 6006",
|
|
25
|
+
"build-storybook": "storybook build"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": "^19.1.0",
|
|
29
|
+
"react-dom": "^19.1.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@headlessui/react": "^2.2.4",
|
|
33
|
+
"@heroicons/react": "^2.2.0",
|
|
34
|
+
"@hookform/resolvers": "^5.0.1",
|
|
35
|
+
"clsx": "^2.1.1",
|
|
36
|
+
"i18next": "^25.2.1",
|
|
37
|
+
"react-hook-form": "^7.56.4",
|
|
38
|
+
"react-i18next": "^15.5.2",
|
|
39
|
+
"yup": "^1.6.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
43
|
+
"@eslint/js": "^9.25.0",
|
|
44
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
45
|
+
"@storybook/addon-onboarding": "^8.6.14",
|
|
46
|
+
"@storybook/blocks": "^8.6.14",
|
|
47
|
+
"@storybook/builder-vite": "^8.6.14",
|
|
48
|
+
"@storybook/experimental-addon-test": "^8.6.14",
|
|
49
|
+
"@storybook/react": "^8.6.14",
|
|
50
|
+
"@storybook/react-vite": "^8.6.14",
|
|
51
|
+
"@storybook/test": "^8.6.14",
|
|
52
|
+
"@tailwindcss/postcss": "^4.1.8",
|
|
53
|
+
"@tailwindcss/vite": "^4.1.7",
|
|
54
|
+
"@types/i18next": "^12.1.0",
|
|
55
|
+
"@types/node": "^22.15.29",
|
|
56
|
+
"@types/react": "^19.1.6",
|
|
57
|
+
"@types/react-dom": "^19.1.5",
|
|
58
|
+
"@types/tailwindcss": "^3.0.11",
|
|
59
|
+
"@vitejs/plugin-react": "^4.4.1",
|
|
60
|
+
"@vitest/browser": "^3.1.4",
|
|
61
|
+
"@vitest/coverage-v8": "^3.1.4",
|
|
62
|
+
"autoprefixer": "^10.4.21",
|
|
63
|
+
"eslint": "^9.25.0",
|
|
64
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
65
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
66
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
67
|
+
"globals": "^16.0.0",
|
|
68
|
+
"playwright": "^1.52.0",
|
|
69
|
+
"postcss": "^8.5.4",
|
|
70
|
+
"storybook": "^8.6.14",
|
|
71
|
+
"storybook-dark-mode": "^4.0.2",
|
|
72
|
+
"tailwindcss": "^4.1.8",
|
|
73
|
+
"typescript": "~5.8.3",
|
|
74
|
+
"typescript-eslint": "^8.30.1",
|
|
75
|
+
"vite": "^6.3.5",
|
|
76
|
+
"vite-plugin-svgr": "^4.3.0",
|
|
77
|
+
"vitest": "^3.1.4"
|
|
78
|
+
},
|
|
79
|
+
"license": "ISC",
|
|
80
|
+
"eslintConfig": {
|
|
81
|
+
"extends": [
|
|
82
|
+
"plugin:storybook/recommended"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"exports": {
|
|
86
|
+
".": {
|
|
87
|
+
"import": "./dist/index.es.js",
|
|
88
|
+
"require": "./dist/index.cjs.js"
|
|
89
|
+
},
|
|
90
|
+
"./style.css": "./dist/index.css"
|
|
91
|
+
},
|
|
92
|
+
"files": [
|
|
93
|
+
"dist"
|
|
94
|
+
]
|
|
95
|
+
}
|