lkd-web-kit 0.1.7 → 0.2.0

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.d.ts CHANGED
@@ -44,7 +44,6 @@ import { TextInputProps } from '@mantine/core';
44
44
  import { TimeInputProps } from '@mantine/dates';
45
45
  import { UseFormReturn } from 'react-hook-form';
46
46
  import { z } from 'zod';
47
- import * as z_2 from 'zod';
48
47
  import { ZodTypeAny } from 'zod';
49
48
 
50
49
  export declare const addBodyJsonHook: BeforeErrorHook;
@@ -86,7 +85,7 @@ export declare interface EmptyProps extends ComponentProps<'div'> {
86
85
 
87
86
  export declare const EmptyState: ({ label, action, icon, className, size, ...props }: EmptyProps) => JSX.Element;
88
87
 
89
- export declare const Form: <T extends FieldValues>({ methods, onSubmit, onSubmitError, ...rest }: FormProps<T>) => JSX.Element;
88
+ export declare const Form: <T extends FieldValues, TContext = any, TT extends T = T>({ methods, onSubmit, onSubmitError, ...rest }: FormProps<T, TContext, TT>) => JSX.Element;
90
89
 
91
90
  export declare function formatBytes(bytes: number, decimals?: number): string;
92
91
 
@@ -121,10 +120,10 @@ export declare const FormNumberInput: FC<MyNumberInputProps & WithFormProps>;
121
120
 
122
121
  export declare type FormNumberInputProps = MyNumberInputProps & WithFormProps;
123
122
 
124
- declare interface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {
125
- methods: UseFormReturn<T, any, any>;
126
- onSubmit?: SubmitHandler<T>;
127
- onSubmitError?: SubmitErrorHandler<any>;
123
+ declare interface FormProps<T extends FieldValues, TContext = any, TT extends T = T> extends BoxProps, ElementProps<'form', 'onSubmit'> {
124
+ methods: UseFormReturn<T, TContext, TT>;
125
+ onSubmit?: SubmitHandler<TT>;
126
+ onSubmitError?: SubmitErrorHandler<T>;
128
127
  }
129
128
 
130
129
  export declare const FormRadioGroup: FC<RadioGroupProps & WithFormProps>;
@@ -349,11 +348,11 @@ export declare interface NavItemsProps {
349
348
 
350
349
  export declare const newHref: <T extends TParams, S extends TSearchParams = TSearchParams>(fn: string | ((args: Args<T, S>) => string)) => (args?: Args<T, S>) => string;
351
350
 
352
- export declare const nullableInput: <T extends ZodTypeAny>(schema: T, message?: string) => z.ZodEffects<z.ZodNullable<T>, (T["_output"] & undefined) | (T["_output"] & {}), T["_input"] | null>;
351
+ export declare const nullableButRequired: <T extends ZodTypeAny>(schema: T, message?: string) => z.ZodEffects<z.ZodNullable<T>, T["_output"] | null, T["_input"] | null>;
353
352
 
354
353
  export declare const numberToTimeInput: (number: number) => string;
355
354
 
356
- export declare function optionalInput<T extends z_2.ZodTypeAny>(schema: T): z_2.ZodUnion<[z_2.ZodOptional<T>, z_2.ZodEffects<z_2.ZodLiteral<"">, undefined, "">]>;
355
+ export declare const optionalButRequired: <T extends ZodTypeAny>(schema: T, message?: string) => z.ZodEffects<z.ZodOptional<T>, T["_output"] | undefined, T["_input"] | undefined>;
357
356
 
358
357
  export declare const PageDataProvider: ({ value, children }: PageDataProviderProps) => JSX.Element;
359
358
 
@@ -1 +1 @@
1
- {"version":3,"file":"Form.cjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={(e) => {\r\n e.stopPropagation();\r\n methods.handleSubmit(onSubmit, onSubmitError)(e);\r\n }}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box","e"],"mappings":"0LAiBaA,EAAO,CAAwB,CAC1C,QAAAC,EACA,SAAAC,EAAW,IAAM,CAAC,EAClB,cAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,IAACC,EAAc,aAAA,CAAA,GAAGL,EAChB,SAAAI,EAAA,IAACE,EAAA,IAAA,CACC,UAAU,OACV,SAAWC,GAAM,CACfA,EAAE,gBAAgB,EAClBP,EAAQ,aAAaC,EAAUC,CAAa,EAAEK,CAAC,CACjD,EACC,GAAGJ,CAAA,CAAA,EAER"}
1
+ {"version":3,"file":"Form.cjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues, TContext = any, TT extends T = T>\r\n extends BoxProps,\r\n ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, TContext, TT>;\r\n onSubmit?: SubmitHandler<TT>;\r\n onSubmitError?: SubmitErrorHandler<T>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues, TContext = any, TT extends T = T>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T, TContext, TT>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={(e) => {\r\n e.stopPropagation();\r\n methods.handleSubmit(onSubmit, onSubmitError)(e);\r\n }}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box","e"],"mappings":"0LAmBaA,EAAO,CAA0D,CAC5E,QAAAC,EACA,SAAAC,EAAW,IAAM,CAAC,EAClB,cAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,IAACC,EAAc,aAAA,CAAA,GAAGL,EAChB,SAAAI,EAAA,IAACE,EAAA,IAAA,CACC,UAAU,OACV,SAAWC,GAAM,CACfA,EAAE,gBAAgB,EAClBP,EAAQ,aAAaC,EAAUC,CAAa,EAAEK,CAAC,CACjD,EACC,GAAGJ,CAAA,CAAA,EAER"}
@@ -1 +1 @@
1
- {"version":3,"file":"Form.mjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues> extends BoxProps, ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, any, any>;\r\n onSubmit?: SubmitHandler<T>;\r\n onSubmitError?: SubmitErrorHandler<any>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={(e) => {\r\n e.stopPropagation();\r\n methods.handleSubmit(onSubmit, onSubmitError)(e);\r\n }}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box","e"],"mappings":";;;;AAiBO,MAAMA,IAAO,CAAwB;AAAA,EAC1C,SAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AAAA,EAClB,eAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAACC,GAAc,EAAA,GAAGL,GAChB,UAAA,gBAAAI;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,UAAU,CAACC,MAAM;AACf,MAAAA,EAAE,gBAAgB,GAClBP,EAAQ,aAAaC,GAAUC,CAAa,EAAEK,CAAC;AAAA,IACjD;AAAA,IACC,GAAGJ;AAAA,EAAA;AAAA,GAER;"}
1
+ {"version":3,"file":"Form.mjs","sources":["../../../src/form/Form.tsx"],"sourcesContent":["'use client';\r\nimport { Box, BoxProps, ElementProps } from '@mantine/core';\r\nimport {\r\n FieldValues,\r\n FormProvider,\r\n SubmitErrorHandler,\r\n SubmitHandler,\r\n UseFormReturn,\r\n} from 'react-hook-form';\r\n\r\n// TODO: Completar el tipado con el schema usando z.output<schema> en el data del onSubmit\r\ninterface FormProps<T extends FieldValues, TContext = any, TT extends T = T>\r\n extends BoxProps,\r\n ElementProps<'form', 'onSubmit'> {\r\n methods: UseFormReturn<T, TContext, TT>;\r\n onSubmit?: SubmitHandler<TT>;\r\n onSubmitError?: SubmitErrorHandler<T>;\r\n}\r\n\r\nexport const Form = <T extends FieldValues, TContext = any, TT extends T = T>({\r\n methods,\r\n onSubmit = () => {},\r\n onSubmitError,\r\n ...rest\r\n}: FormProps<T, TContext, TT>) => {\r\n return (\r\n <FormProvider {...methods}>\r\n <Box\r\n component=\"form\"\r\n onSubmit={(e) => {\r\n e.stopPropagation();\r\n methods.handleSubmit(onSubmit, onSubmitError)(e);\r\n }}\r\n {...rest}\r\n />\r\n </FormProvider>\r\n );\r\n};\r\n"],"names":["Form","methods","onSubmit","onSubmitError","rest","jsx","FormProvider","Box","e"],"mappings":";;;;AAmBO,MAAMA,IAAO,CAA0D;AAAA,EAC5E,SAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAAC;AAAA,EAClB,eAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC,EAACC,GAAc,EAAA,GAAGL,GAChB,UAAA,gBAAAI;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,UAAU,CAACC,MAAM;AACf,MAAAA,EAAE,gBAAgB,GAClBP,EAAQ,aAAaC,GAAUC,CAAa,EAAEK,CAAC;AAAA,IACjD;AAAA,IACC,GAAGJ;AAAA,EAAA;AAAA,GAER;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("zod"),r=(e,u="Campo requerido")=>e.nullable().superRefine((l,o)=>{l===null&&o.addIssue({code:d.z.ZodIssueCode.custom,message:u})});exports.nullableButRequired=r;
2
+ //# sourceMappingURL=nullable-but-required.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable-but-required.cjs","sources":["../../../../src/form/utils/nullable-but-required.ts"],"sourcesContent":["import { z, ZodTypeAny } from 'zod';\r\n\r\nexport const nullableButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.nullable().superRefine((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["nullableButRequired","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAsB,CAAuBC,EAAWC,EAAU,oBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,EAAKC,IAAQ,CACtCD,IAAQ,MACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,QAAAH,CAAA,CACD,CAEL,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z as d } from "zod";
2
+ const s = (e, o = "Campo requerido") => e.nullable().superRefine((u, l) => {
3
+ u === null && l.addIssue({
4
+ code: d.ZodIssueCode.custom,
5
+ message: o
6
+ });
7
+ });
8
+ export {
9
+ s as nullableButRequired
10
+ };
11
+ //# sourceMappingURL=nullable-but-required.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nullable-but-required.mjs","sources":["../../../../src/form/utils/nullable-but-required.ts"],"sourcesContent":["import { z, ZodTypeAny } from 'zod';\r\n\r\nexport const nullableButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.nullable().superRefine((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["nullableButRequired","schema","message","val","ctx","z"],"mappings":";AAEa,MAAAA,IAAsB,CAAuBC,GAAWC,IAAU,sBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,GAAKC,MAAQ;AAC1C,EAAID,MAAQ,QACVC,EAAI,SAAS;AAAA,IACX,MAAMC,EAAE,aAAa;AAAA,IACrB,SAAAH;AAAA,EAAA,CACD;AAEL,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("zod"),d=(e,o="Campo requerido")=>e.optional().superRefine((t,i)=>{t===void 0&&i.addIssue({code:u.z.ZodIssueCode.custom,message:o})});exports.optionalButRequired=d;
2
+ //# sourceMappingURL=optional-but-required.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-but-required.cjs","sources":["../../../../src/form/utils/optional-but-required.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const optionalButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.optional().superRefine((val, ctx) => {\r\n if (val === undefined) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["optionalButRequired","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAsB,CAAuBC,EAAWC,EAAU,oBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,EAAKC,IAAQ,CACtCD,IAAQ,QACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,QAAAH,CAAA,CACD,CAEL,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { z as r } from "zod";
2
+ const t = (o, e = "Campo requerido") => o.optional().superRefine((d, i) => {
3
+ d === void 0 && i.addIssue({
4
+ code: r.ZodIssueCode.custom,
5
+ message: e
6
+ });
7
+ });
8
+ export {
9
+ t as optionalButRequired
10
+ };
11
+ //# sourceMappingURL=optional-but-required.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"optional-but-required.mjs","sources":["../../../../src/form/utils/optional-but-required.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const optionalButRequired = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') =>\r\n schema.optional().superRefine((val, ctx) => {\r\n if (val === undefined) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n message,\r\n });\r\n }\r\n });\r\n"],"names":["optionalButRequired","schema","message","val","ctx","z"],"mappings":";AAEa,MAAAA,IAAsB,CAAuBC,GAAWC,IAAU,sBAC7ED,EAAO,SAAA,EAAW,YAAY,CAACE,GAAKC,MAAQ;AAC1C,EAAID,MAAQ,UACVC,EAAI,SAAS;AAAA,IACX,MAAMC,EAAE,aAAa;AAAA,IACrB,SAAAH;AAAA,EAAA,CACD;AAEL,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./components/EmptyState/index.cjs"),u=require("./components/InfinityLoader/index.cjs"),a=require("./components/NavItems.cjs"),s=require("./components/Icon.cjs"),c=require("./components/MyDatePickerInput/index.cjs"),m=require("./components/MyDateTimePicker/index.cjs"),p=require("./components/MyNotifications/index.cjs"),l=require("./components/MyNumberInput/index.cjs"),y=require("./components/MySelect/index.cjs"),d=require("./components/MyTextarea/index.cjs"),q=require("./components/MyTextInput/index.cjs"),I=require("./components/MyTimeInput/index.cjs"),F=require("./components/SelectInfinity/index.cjs"),x=require("./consts/http-status.cjs"),P=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),t=require("./contexts/PageDataContext/index.cjs"),T=require("./form/Form.cjs"),S=require("./form/FormButtonSubmit.cjs"),f=require("./form/utils/zodValidator.cjs"),h=require("./form/utils/nullableInput.cjs"),M=require("./form/utils/optionalInput.cjs"),b=require("./form/base/FormCheckbox.cjs"),N=require("./form/base/FormDatePickerInput.cjs"),g=require("./form/base/FormDateTimePicker.cjs"),k=require("./form/base/FormNumberInput.cjs"),B=require("./form/base/FormRadioGroup.cjs"),D=require("./form/base/FormSelect.cjs"),v=require("./form/base/FormSelectInfinity.cjs"),w=require("./form/base/FormTextArea.cjs"),H=require("./form/base/FormTextInput.cjs"),r=require("./form/base/FormTimeInput.cjs"),$=require("./hocs/withForm.cjs"),E=require("./hocs/withModalManager.cjs"),O=require("./hooks/useBreakpoint.cjs"),A=require("./hooks/useFetchNextPageOnScroll.cjs"),C=require("./hooks/useOnScrollProgress.cjs"),R=require("./hooks/useUpdateSearchParams.cjs"),J=require("./mantine/breakpoints-with-px.cjs"),_=require("./mantine/to-tailwind-colors.cjs"),U=require("./mantine/my-default-theme.cjs"),K=require("./utils/formatBytes.cjs"),o=require("./utils/ky/addBodyJsonHook.cjs"),L=require("./utils/ky/parseJson.cjs"),i=require("./utils/array/groupBy.cjs"),z=require("./utils/array/shuffleArray.cjs"),G=require("./utils/newHref.cjs"),V=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=n.EmptyState;exports.InfinityLoader=u.InfinityLoader;exports.NavItems=a.NavItems;exports.Icon=s.Icon;exports.MyDatePickerInput=c.MyDatePickerInput;exports.MyDateTimePicker=m.MyDateTimePicker;exports.MyNotifications=p.MyNotifications;exports.MyNumberInput=l.MyNumberInput;exports.MySelect=y.MySelect;exports.MyTextarea=d.MyTextarea;exports.MyTextInput=q.MyTextInput;exports.MyTimeInput=I.MyTimeInput;exports.SelectInfinity=F.SelectInfinity;exports.HttpStatus=x.HttpStatus;exports.Revalidate=P.Revalidate;exports.NavigationHistoryProvider=e.NavigationHistoryProvider;exports.QP_BACK_URL_NAME=e.QP_BACK_URL_NAME;exports.useNavigationHistory=e.useNavigationHistory;exports.PageDataProvider=t.PageDataProvider;exports.usePageData=t.usePageData;exports.Form=T.Form;exports.FormButtonSubmit=S.FormButtonSubmit;exports.zodValidator=f.zodValidator;exports.nullableInput=h.nullableInput;exports.optionalInput=M.optionalInput;exports.FormCheckbox=b.FormCheckbox;exports.FormDatePickerInput=N.FormDatePickerInput;exports.FormDateTimePicker=g.FormDateTimePicker;exports.FormNumberInput=k.FormNumberInput;exports.FormRadioGroup=B.FormRadioGroup;exports.FormSelect=D.FormSelect;exports.FormSelectInfinity=v.FormSelectInfinity;exports.FormTextarea=w.FormTextarea;exports.FormTextInput=H.FormTextInput;exports.FormTimeInput=r.FormTimeInput;exports.numberToTimeInput=r.numberToTimeInput;exports.timeInputToNumber=r.timeInputToNumber;exports.withForm=$.withForm;exports.withModalManager=E.withModalManager;exports.useBreakpoint=O.useBreakpoint;exports.useFetchNextPageOnScroll=A.useFetchNextPageOnScroll;exports.useOnScrollProgress=C.useOnScrollProgress;exports.useUpdateSearchParams=R.useUpdateSearchParams;exports.breakpointsWithPx=J.breakpointsWithPx;exports.toTailwindColors=_.toTailwindColors;exports.myDefaultTheme=U.myDefaultTheme;exports.formatBytes=K.formatBytes;exports.KyError=o.KyError;exports.addBodyJsonHook=o.addBodyJsonHook;exports.parseJSON=L.parseJSON;exports.groupBy=i.groupBy;exports.indexBy=i.indexBy;exports.shuffleArray=z.shuffleArray;exports.newHref=G.newHref;exports.isInfinityEmpty=V.isInfinityEmpty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./components/EmptyState/index.cjs"),u=require("./components/InfinityLoader/index.cjs"),a=require("./components/NavItems.cjs"),s=require("./components/Icon.cjs"),c=require("./components/MyDatePickerInput/index.cjs"),m=require("./components/MyDateTimePicker/index.cjs"),d=require("./components/MyNotifications/index.cjs"),l=require("./components/MyNumberInput/index.cjs"),y=require("./components/MySelect/index.cjs"),p=require("./components/MyTextarea/index.cjs"),q=require("./components/MyTextInput/index.cjs"),F=require("./components/MyTimeInput/index.cjs"),I=require("./components/SelectInfinity/index.cjs"),x=require("./consts/http-status.cjs"),P=require("./consts/revalidate.cjs"),e=require("./contexts/NavigationHistoryContext/index.cjs"),t=require("./contexts/PageDataContext/index.cjs"),T=require("./form/Form.cjs"),S=require("./form/FormButtonSubmit.cjs"),f=require("./form/utils/zodValidator.cjs"),h=require("./form/utils/nullable-but-required.cjs"),B=require("./form/utils/optional-but-required.cjs"),M=require("./form/base/FormCheckbox.cjs"),b=require("./form/base/FormDatePickerInput.cjs"),N=require("./form/base/FormDateTimePicker.cjs"),g=require("./form/base/FormNumberInput.cjs"),k=require("./form/base/FormRadioGroup.cjs"),D=require("./form/base/FormSelect.cjs"),v=require("./form/base/FormSelectInfinity.cjs"),R=require("./form/base/FormTextArea.cjs"),w=require("./form/base/FormTextInput.cjs"),r=require("./form/base/FormTimeInput.cjs"),H=require("./hocs/withForm.cjs"),$=require("./hocs/withModalManager.cjs"),E=require("./hooks/useBreakpoint.cjs"),O=require("./hooks/useFetchNextPageOnScroll.cjs"),A=require("./hooks/useOnScrollProgress.cjs"),C=require("./hooks/useUpdateSearchParams.cjs"),J=require("./mantine/breakpoints-with-px.cjs"),_=require("./mantine/to-tailwind-colors.cjs"),U=require("./mantine/my-default-theme.cjs"),K=require("./utils/formatBytes.cjs"),o=require("./utils/ky/addBodyJsonHook.cjs"),L=require("./utils/ky/parseJson.cjs"),i=require("./utils/array/groupBy.cjs"),z=require("./utils/array/shuffleArray.cjs"),G=require("./utils/newHref.cjs"),V=require("./utils/isInfinityEmpty.cjs");exports.EmptyState=n.EmptyState;exports.InfinityLoader=u.InfinityLoader;exports.NavItems=a.NavItems;exports.Icon=s.Icon;exports.MyDatePickerInput=c.MyDatePickerInput;exports.MyDateTimePicker=m.MyDateTimePicker;exports.MyNotifications=d.MyNotifications;exports.MyNumberInput=l.MyNumberInput;exports.MySelect=y.MySelect;exports.MyTextarea=p.MyTextarea;exports.MyTextInput=q.MyTextInput;exports.MyTimeInput=F.MyTimeInput;exports.SelectInfinity=I.SelectInfinity;exports.HttpStatus=x.HttpStatus;exports.Revalidate=P.Revalidate;exports.NavigationHistoryProvider=e.NavigationHistoryProvider;exports.QP_BACK_URL_NAME=e.QP_BACK_URL_NAME;exports.useNavigationHistory=e.useNavigationHistory;exports.PageDataProvider=t.PageDataProvider;exports.usePageData=t.usePageData;exports.Form=T.Form;exports.FormButtonSubmit=S.FormButtonSubmit;exports.zodValidator=f.zodValidator;exports.nullableButRequired=h.nullableButRequired;exports.optionalButRequired=B.optionalButRequired;exports.FormCheckbox=M.FormCheckbox;exports.FormDatePickerInput=b.FormDatePickerInput;exports.FormDateTimePicker=N.FormDateTimePicker;exports.FormNumberInput=g.FormNumberInput;exports.FormRadioGroup=k.FormRadioGroup;exports.FormSelect=D.FormSelect;exports.FormSelectInfinity=v.FormSelectInfinity;exports.FormTextarea=R.FormTextarea;exports.FormTextInput=w.FormTextInput;exports.FormTimeInput=r.FormTimeInput;exports.numberToTimeInput=r.numberToTimeInput;exports.timeInputToNumber=r.timeInputToNumber;exports.withForm=H.withForm;exports.withModalManager=$.withModalManager;exports.useBreakpoint=E.useBreakpoint;exports.useFetchNextPageOnScroll=O.useFetchNextPageOnScroll;exports.useOnScrollProgress=A.useOnScrollProgress;exports.useUpdateSearchParams=C.useUpdateSearchParams;exports.breakpointsWithPx=J.breakpointsWithPx;exports.toTailwindColors=_.toTailwindColors;exports.myDefaultTheme=U.myDefaultTheme;exports.formatBytes=K.formatBytes;exports.KyError=o.KyError;exports.addBodyJsonHook=o.addBodyJsonHook;exports.parseJSON=L.parseJSON;exports.groupBy=i.groupBy;exports.indexBy=i.indexBy;exports.shuffleArray=z.shuffleArray;exports.newHref=G.newHref;exports.isInfinityEmpty=V.isInfinityEmpty;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -5,22 +5,22 @@ import { Icon as a } from "./components/Icon.mjs";
5
5
  import { MyDatePickerInput as n } from "./components/MyDatePickerInput/index.mjs";
6
6
  import { MyDateTimePicker as y } from "./components/MyDateTimePicker/index.mjs";
7
7
  import { MyNotifications as l } from "./components/MyNotifications/index.mjs";
8
- import { MyNumberInput as c } from "./components/MyNumberInput/index.mjs";
8
+ import { MyNumberInput as I } from "./components/MyNumberInput/index.mjs";
9
9
  import { MySelect as F } from "./components/MySelect/index.mjs";
10
10
  import { MyTextarea as T } from "./components/MyTextarea/index.mjs";
11
11
  import { MyTextInput as S } from "./components/MyTextInput/index.mjs";
12
- import { MyTimeInput as b } from "./components/MyTimeInput/index.mjs";
13
- import { SelectInfinity as h } from "./components/SelectInfinity/index.mjs";
14
- import { HttpStatus as B } from "./consts/http-status.mjs";
12
+ import { MyTimeInput as B } from "./components/MyTimeInput/index.mjs";
13
+ import { SelectInfinity as g } from "./components/SelectInfinity/index.mjs";
14
+ import { HttpStatus as k } from "./consts/http-status.mjs";
15
15
  import { Revalidate as v } from "./consts/revalidate.mjs";
16
- import { NavigationHistoryProvider as w, QP_BACK_URL_NAME as E, useNavigationHistory as A } from "./contexts/NavigationHistoryContext/index.mjs";
17
- import { PageDataProvider as O, usePageData as R } from "./contexts/PageDataContext/index.mjs";
18
- import { Form as J } from "./form/Form.mjs";
19
- import { FormButtonSubmit as L } from "./form/FormButtonSubmit.mjs";
20
- import { zodValidator as z } from "./form/utils/zodValidator.mjs";
21
- import { nullableInput as Q } from "./form/utils/nullableInput.mjs";
22
- import { optionalInput as W } from "./form/utils/optionalInput.mjs";
23
- import { FormCheckbox as q } from "./form/base/FormCheckbox.mjs";
16
+ import { NavigationHistoryProvider as R, QP_BACK_URL_NAME as w, useNavigationHistory as E } from "./contexts/NavigationHistoryContext/index.mjs";
17
+ import { PageDataProvider as C, usePageData as O } from "./contexts/PageDataContext/index.mjs";
18
+ import { Form as q } from "./form/Form.mjs";
19
+ import { FormButtonSubmit as K } from "./form/FormButtonSubmit.mjs";
20
+ import { zodValidator as U } from "./form/utils/zodValidator.mjs";
21
+ import { nullableButRequired as G } from "./form/utils/nullable-but-required.mjs";
22
+ import { optionalButRequired as V } from "./form/utils/optional-but-required.mjs";
23
+ import { FormCheckbox as j } from "./form/base/FormCheckbox.mjs";
24
24
  import { FormDatePickerInput as Y } from "./form/base/FormDatePickerInput.mjs";
25
25
  import { FormDateTimePicker as $ } from "./form/base/FormDateTimePicker.mjs";
26
26
  import { FormNumberInput as or } from "./form/base/FormNumberInput.mjs";
@@ -29,28 +29,28 @@ import { FormSelect as pr } from "./form/base/FormSelect.mjs";
29
29
  import { FormSelectInfinity as xr } from "./form/base/FormSelectInfinity.mjs";
30
30
  import { FormTextarea as ir } from "./form/base/FormTextArea.mjs";
31
31
  import { FormTextInput as ur } from "./form/base/FormTextInput.mjs";
32
- import { FormTimeInput as sr, numberToTimeInput as lr, timeInputToNumber as Ir } from "./form/base/FormTimeInput.mjs";
33
- import { withForm as dr } from "./hocs/withForm.mjs";
32
+ import { FormTimeInput as sr, numberToTimeInput as lr, timeInputToNumber as dr } from "./form/base/FormTimeInput.mjs";
33
+ import { withForm as cr } from "./hocs/withForm.mjs";
34
34
  import { withModalManager as Pr } from "./hocs/withModalManager.mjs";
35
35
  import { useBreakpoint as Mr } from "./hooks/useBreakpoint.mjs";
36
36
  import { useFetchNextPageOnScroll as Nr } from "./hooks/useFetchNextPageOnScroll.mjs";
37
- import { useOnScrollProgress as gr } from "./hooks/useOnScrollProgress.mjs";
38
- import { useUpdateSearchParams as kr } from "./hooks/useUpdateSearchParams.mjs";
37
+ import { useOnScrollProgress as br } from "./hooks/useOnScrollProgress.mjs";
38
+ import { useUpdateSearchParams as hr } from "./hooks/useUpdateSearchParams.mjs";
39
39
  import { breakpointsWithPx as Dr } from "./mantine/breakpoints-with-px.mjs";
40
40
  import { toTailwindColors as Hr } from "./mantine/to-tailwind-colors.mjs";
41
- import { myDefaultTheme as Er } from "./mantine/my-default-theme.mjs";
42
- import { formatBytes as Cr } from "./utils/formatBytes.mjs";
43
- import { KyError as Rr, addBodyJsonHook as _r } from "./utils/ky/addBodyJsonHook.mjs";
44
- import { parseJSON as Kr } from "./utils/ky/parseJson.mjs";
45
- import { groupBy as Ur, indexBy as zr } from "./utils/array/groupBy.mjs";
46
- import { shuffleArray as Qr } from "./utils/array/shuffleArray.mjs";
47
- import { newHref as Wr } from "./utils/newHref.mjs";
48
- import { isInfinityEmpty as qr } from "./utils/isInfinityEmpty.mjs";
41
+ import { myDefaultTheme as wr } from "./mantine/my-default-theme.mjs";
42
+ import { formatBytes as Ar } from "./utils/formatBytes.mjs";
43
+ import { KyError as Or, addBodyJsonHook as _r } from "./utils/ky/addBodyJsonHook.mjs";
44
+ import { parseJSON as Jr } from "./utils/ky/parseJson.mjs";
45
+ import { groupBy as Lr, indexBy as Ur } from "./utils/array/groupBy.mjs";
46
+ import { shuffleArray as Gr } from "./utils/array/shuffleArray.mjs";
47
+ import { newHref as Vr } from "./utils/newHref.mjs";
48
+ import { isInfinityEmpty as jr } from "./utils/isInfinityEmpty.mjs";
49
49
  export {
50
50
  e as EmptyState,
51
- J as Form,
52
- L as FormButtonSubmit,
53
- q as FormCheckbox,
51
+ q as Form,
52
+ K as FormButtonSubmit,
53
+ j as FormCheckbox,
54
54
  Y as FormDatePickerInput,
55
55
  $ as FormDateTimePicker,
56
56
  or as FormNumberInput,
@@ -60,47 +60,47 @@ export {
60
60
  ur as FormTextInput,
61
61
  ir as FormTextarea,
62
62
  sr as FormTimeInput,
63
- B as HttpStatus,
63
+ k as HttpStatus,
64
64
  a as Icon,
65
65
  m as InfinityLoader,
66
- Rr as KyError,
66
+ Or as KyError,
67
67
  n as MyDatePickerInput,
68
68
  y as MyDateTimePicker,
69
69
  l as MyNotifications,
70
- c as MyNumberInput,
70
+ I as MyNumberInput,
71
71
  F as MySelect,
72
72
  S as MyTextInput,
73
73
  T as MyTextarea,
74
- b as MyTimeInput,
74
+ B as MyTimeInput,
75
75
  f as NavItems,
76
- w as NavigationHistoryProvider,
77
- O as PageDataProvider,
78
- E as QP_BACK_URL_NAME,
76
+ R as NavigationHistoryProvider,
77
+ C as PageDataProvider,
78
+ w as QP_BACK_URL_NAME,
79
79
  v as Revalidate,
80
- h as SelectInfinity,
80
+ g as SelectInfinity,
81
81
  _r as addBodyJsonHook,
82
82
  Dr as breakpointsWithPx,
83
- Cr as formatBytes,
84
- Ur as groupBy,
85
- zr as indexBy,
86
- qr as isInfinityEmpty,
87
- Er as myDefaultTheme,
88
- Wr as newHref,
89
- Q as nullableInput,
83
+ Ar as formatBytes,
84
+ Lr as groupBy,
85
+ Ur as indexBy,
86
+ jr as isInfinityEmpty,
87
+ wr as myDefaultTheme,
88
+ Vr as newHref,
89
+ G as nullableButRequired,
90
90
  lr as numberToTimeInput,
91
- W as optionalInput,
92
- Kr as parseJSON,
93
- Qr as shuffleArray,
94
- Ir as timeInputToNumber,
91
+ V as optionalButRequired,
92
+ Jr as parseJSON,
93
+ Gr as shuffleArray,
94
+ dr as timeInputToNumber,
95
95
  Hr as toTailwindColors,
96
96
  Mr as useBreakpoint,
97
97
  Nr as useFetchNextPageOnScroll,
98
- A as useNavigationHistory,
99
- gr as useOnScrollProgress,
100
- R as usePageData,
101
- kr as useUpdateSearchParams,
102
- dr as withForm,
98
+ E as useNavigationHistory,
99
+ br as useOnScrollProgress,
100
+ O as usePageData,
101
+ hr as useUpdateSearchParams,
102
+ cr as withForm,
103
103
  Pr as withModalManager,
104
- z as zodValidator
104
+ U as zodValidator
105
105
  };
106
106
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkd-web-kit",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "description": "A template for creating React component libraries with Vite.",
5
5
  "author": "LKD",
6
6
  "license": "MIT",
@@ -55,18 +55,18 @@
55
55
  "vitest": "^3.1.1"
56
56
  },
57
57
  "peerDependencies": {
58
- "@mantine/core": "^7.17.5",
59
- "@mantine/dates": "^7.17.5",
60
- "@mantine/hooks": "^7.17.5",
61
- "@mantine/notifications": "^7.17.5",
62
- "@tanstack/react-query": "^5.74.4",
58
+ "@mantine/core": "^7.17.7",
59
+ "@mantine/dates": "^7.17.7",
60
+ "@mantine/hooks": "^7.17.7",
61
+ "@mantine/notifications": "^7.17.7",
62
+ "@tanstack/react-query": "^5.75.2",
63
63
  "clsx": "^2.1.1",
64
64
  "ky": "^1.8.1",
65
65
  "next": "^15.3.1",
66
- "query-string": "^9.1.1",
66
+ "query-string": "^9.1.2",
67
67
  "react": "^19.1.0",
68
68
  "react-dom": "^19.1.0",
69
- "react-hook-form": "^7.56.1",
69
+ "react-hook-form": "^7.56.2",
70
70
  "react-query-kit": "^3.3.1",
71
71
  "zod": "^3.24.3"
72
72
  }
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("zod"),n=(r,t="Campo requerido")=>r.nullable().transform((e,l)=>e===null?(l.addIssue({code:u.z.ZodIssueCode.custom,fatal:!0,message:t}),u.z.NEVER):e);exports.nullableInput=n;
2
- //# sourceMappingURL=nullableInput.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullableInput.cjs","sources":["../../../../src/form/utils/nullableInput.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const nullableInput = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') => {\r\n return schema.nullable().transform((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n fatal: true,\r\n message,\r\n });\r\n\r\n return z.NEVER;\r\n }\r\n\r\n return val;\r\n });\r\n};\r\n"],"names":["nullableInput","schema","message","val","ctx","z"],"mappings":"uGAEaA,EAAgB,CAAuBC,EAAWC,EAAU,oBAChED,EAAO,SAAS,EAAE,UAAU,CAACE,EAAKC,IACnCD,IAAQ,MACVC,EAAI,SAAS,CACX,KAAMC,EAAAA,EAAE,aAAa,OACrB,MAAO,GACP,QAAAH,CAAA,CACD,EAEMG,EAAE,EAAA,OAGJF,CACR"}
@@ -1,10 +0,0 @@
1
- import { z as e } from "zod";
2
- const l = (u, o = "Campo requerido") => u.nullable().transform((r, t) => r === null ? (t.addIssue({
3
- code: e.ZodIssueCode.custom,
4
- fatal: !0,
5
- message: o
6
- }), e.NEVER) : r);
7
- export {
8
- l as nullableInput
9
- };
10
- //# sourceMappingURL=nullableInput.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nullableInput.mjs","sources":["../../../../src/form/utils/nullableInput.ts"],"sourcesContent":["import { ZodTypeAny, z } from 'zod';\r\n\r\nexport const nullableInput = <T extends ZodTypeAny>(schema: T, message = 'Campo requerido') => {\r\n return schema.nullable().transform((val, ctx) => {\r\n if (val === null) {\r\n ctx.addIssue({\r\n code: z.ZodIssueCode.custom,\r\n fatal: true,\r\n message,\r\n });\r\n\r\n return z.NEVER;\r\n }\r\n\r\n return val;\r\n });\r\n};\r\n"],"names":["nullableInput","schema","message","val","ctx","z"],"mappings":";AAEO,MAAMA,IAAgB,CAAuBC,GAAWC,IAAU,sBAChED,EAAO,SAAS,EAAE,UAAU,CAACE,GAAKC,MACnCD,MAAQ,QACVC,EAAI,SAAS;AAAA,EACX,MAAMC,EAAE,aAAa;AAAA,EACrB,OAAO;AAAA,EACP,SAAAH;AAAA,CACD,GAEMG,EAAE,SAGJF,CACR;"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("zod");function i(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const u=i(r),c=u.literal("").transform(()=>{});function a(t){return t.optional().or(c)}exports.optionalInput=a;
2
- //# sourceMappingURL=optionalInput.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optionalInput.cjs","sources":["../../../../src/form/utils/optionalInput.ts"],"sourcesContent":["import * as z from 'zod';\r\n\r\nconst emptyStringToUndefined = z.literal('').transform(() => undefined);\r\n\r\nexport function optionalInput<T extends z.ZodTypeAny>(schema: T) {\r\n return schema.optional().or(emptyStringToUndefined);\r\n}\r\n"],"names":["emptyStringToUndefined","z","optionalInput","schema"],"mappings":"6ZAEMA,EAAyBC,EAAE,QAAQ,EAAE,EAAE,UAAU,IAAA,EAAe,EAE/D,SAASC,EAAsCC,EAAW,CAC/D,OAAOA,EAAO,WAAW,GAAGH,CAAsB,CACpD"}
@@ -1,10 +0,0 @@
1
- import * as t from "zod";
2
- const n = t.literal("").transform(() => {
3
- });
4
- function r(o) {
5
- return o.optional().or(n);
6
- }
7
- export {
8
- r as optionalInput
9
- };
10
- //# sourceMappingURL=optionalInput.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"optionalInput.mjs","sources":["../../../../src/form/utils/optionalInput.ts"],"sourcesContent":["import * as z from 'zod';\r\n\r\nconst emptyStringToUndefined = z.literal('').transform(() => undefined);\r\n\r\nexport function optionalInput<T extends z.ZodTypeAny>(schema: T) {\r\n return schema.optional().or(emptyStringToUndefined);\r\n}\r\n"],"names":["emptyStringToUndefined","z","optionalInput","schema"],"mappings":";AAEA,MAAMA,IAAyBC,EAAE,QAAQ,EAAE,EAAE,UAAU,MAAA;AAAA,CAAe;AAE/D,SAASC,EAAsCC,GAAW;AAC/D,SAAOA,EAAO,WAAW,GAAGH,CAAsB;AACpD;"}