lkd-web-kit 0.7.1 → 0.7.3

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.
@@ -2,14 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const nullableButRequired = (schema, message = "Campo requerido") => schema.nullable().check((ctx) => {
6
- if (ctx.value === null) {
7
- ctx.issues.push({
5
+ const z = require('zod');
6
+
7
+ const nullableButRequired = (schema, message = "Campo requerido") => schema.nullable().transform((val, ctx) => {
8
+ if (val === null) {
9
+ ctx.addIssue({
8
10
  code: "custom",
9
- message,
10
- input: ctx.value
11
+ fatal: true,
12
+ message
11
13
  });
14
+ return z.z.NEVER;
12
15
  }
16
+ return val;
13
17
  });
14
18
 
15
19
  exports.nullableButRequired = nullableButRequired;
@@ -1,11 +1,15 @@
1
- const nullableButRequired = (schema, message = "Campo requerido") => schema.nullable().check((ctx) => {
2
- if (ctx.value === null) {
3
- ctx.issues.push({
1
+ import { z } from 'zod';
2
+
3
+ const nullableButRequired = (schema, message = "Campo requerido") => schema.nullable().transform((val, ctx) => {
4
+ if (val === null) {
5
+ ctx.addIssue({
4
6
  code: "custom",
5
- message,
6
- input: ctx.value
7
+ fatal: true,
8
+ message
7
9
  });
10
+ return z.NEVER;
8
11
  }
12
+ return val;
9
13
  });
10
14
 
11
15
  export { nullableButRequired };
@@ -2,14 +2,18 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const optionalButRequired = (schema, message = "Campo requerido") => schema.optional().check((ctx) => {
6
- if (ctx.value === void 0) {
7
- ctx.issues.push({
5
+ const z = require('zod');
6
+
7
+ const optionalButRequired = (schema, message = "Campo requerido") => schema.optional().transform((val, ctx) => {
8
+ if (val === void 0) {
9
+ ctx.addIssue({
8
10
  code: "custom",
9
- message,
10
- input: ctx.value
11
+ fatal: true,
12
+ message
11
13
  });
14
+ return z.z.NEVER;
12
15
  }
16
+ return val;
13
17
  });
14
18
 
15
19
  exports.optionalButRequired = optionalButRequired;
@@ -1,11 +1,15 @@
1
- const optionalButRequired = (schema, message = "Campo requerido") => schema.optional().check((ctx) => {
2
- if (ctx.value === void 0) {
3
- ctx.issues.push({
1
+ import { z } from 'zod';
2
+
3
+ const optionalButRequired = (schema, message = "Campo requerido") => schema.optional().transform((val, ctx) => {
4
+ if (val === void 0) {
5
+ ctx.addIssue({
4
6
  code: "custom",
5
- message,
6
- input: ctx.value
7
+ fatal: true,
8
+ message
7
9
  });
10
+ return z.NEVER;
8
11
  }
12
+ return val;
9
13
  });
10
14
 
11
15
  export { optionalButRequired };
package/dist/index.d.ts CHANGED
@@ -419,7 +419,7 @@ export declare const MyNotifications: (props: MyNotificationPrpos) => JSX.Elemen
419
419
 
420
420
  export declare const MyNumberInput: (props: MyNumberInputProps) => JSX.Element;
421
421
 
422
- export declare interface MyNumberInputProps extends NumberInputProps {
422
+ export declare interface MyNumberInputProps extends Omit<NumberInputProps, "onValueChange"> {
423
423
  ref?: React.Ref<HTMLInputElement>;
424
424
  }
425
425
 
@@ -497,7 +497,7 @@ export declare const newRoute: {
497
497
  <LocalQuery extends object = {}, PathParams extends Params = {}>(pathBuilder: (params: PathParams) => string, options?: RouteOptions<LocalQuery, PathParams> | undefined): (params?: RouteInput<PathParams, LocalQuery> | undefined) => string;
498
498
  };
499
499
 
500
- export declare const nullableButRequired: <T extends ZodType>(schema: T, message?: string) => z.ZodNullable<T>;
500
+ export declare const nullableButRequired: <T extends ZodType>(schema: T, message?: string) => z.ZodPipe<z.ZodNullable<T>, z.ZodTransform<Awaited<z.core.output<T> & undefined> | Awaited<z.core.output<T> & {}>, z.core.output<T> | null>>;
501
501
 
502
502
  export declare const numberToTimeInput: (number: number) => string;
503
503
 
@@ -508,7 +508,7 @@ export declare type OnScrollProgressOptions = {
508
508
  disabled?: boolean;
509
509
  };
510
510
 
511
- export declare const optionalButRequired: <T extends ZodType>(schema: T, message?: string) => z.ZodOptional<T>;
511
+ export declare const optionalButRequired: <T extends ZodType>(schema: T, message?: string) => z.ZodPipe<z.ZodOptional<T>, z.ZodTransform<Awaited<z.core.output<T> & null> | Awaited<z.core.output<T> & {}>, z.core.output<T> | undefined>>;
512
512
 
513
513
  export declare const PageDataProvider: ({ value, children }: PageDataProviderProps) => JSX.Element;
514
514
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",
@@ -53,17 +53,17 @@
53
53
  "vitest": "^3.2.4"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mantine/core": "^8.3.6",
57
- "@mantine/dates": "^8.3.6",
58
- "@mantine/hooks": "^8.3.6",
59
- "@mantine/notifications": "^8.3.6",
60
- "@tanstack/react-query": "^5.90.5",
56
+ "@mantine/core": "^8.3.7",
57
+ "@mantine/dates": "^8.3.7",
58
+ "@mantine/hooks": "^8.3.7",
59
+ "@mantine/notifications": "^8.3.7",
60
+ "@tanstack/react-query": "^5.90.7",
61
61
  "clsx": "^2.1.1",
62
- "ky": "^1.13.0",
62
+ "ky": "^1.14.0",
63
63
  "next": "^16.0.1",
64
64
  "react": "^19.2.0",
65
65
  "react-dom": "^19.2.0",
66
- "react-hook-form": "^7.65.0",
66
+ "react-hook-form": "^7.66.0",
67
67
  "react-query-kit": "^3.3.2",
68
68
  "zod": "^4.1.12"
69
69
  },