lkd-web-kit 0.1.4 → 0.1.6
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 +15 -5
- package/dist/src/form/utils/optionalInput.cjs +2 -0
- package/dist/src/form/utils/optionalInput.cjs.map +1 -0
- package/dist/src/form/utils/optionalInput.mjs +10 -0
- package/dist/src/form/utils/optionalInput.mjs.map +1 -0
- package/dist/src/hocs/withForm.cjs +1 -1
- package/dist/src/hocs/withForm.cjs.map +1 -1
- package/dist/src/hocs/withForm.mjs +1 -1
- package/dist/src/hocs/withForm.mjs.map +1 -1
- package/dist/src/hocs/withModalManager.cjs +1 -1
- package/dist/src/hocs/withModalManager.cjs.map +1 -1
- package/dist/src/hocs/withModalManager.mjs +1 -1
- package/dist/src/hocs/withModalManager.mjs.map +1 -1
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.mjs +65 -62
- package/dist/src/index.mjs.map +1 -1
- package/dist/src/mantine/my-default-theme.cjs +1 -1
- package/dist/src/mantine/my-default-theme.cjs.map +1 -1
- package/dist/src/mantine/my-default-theme.mjs +14 -8
- package/dist/src/mantine/my-default-theme.mjs.map +1 -1
- package/dist/src/utils/ky/addBodyJsonHook.cjs +1 -1
- package/dist/src/utils/ky/addBodyJsonHook.cjs.map +1 -1
- package/dist/src/utils/ky/addBodyJsonHook.mjs +10 -3
- package/dist/src/utils/ky/addBodyJsonHook.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { InfiniteData } from '@tanstack/react-query';
|
|
|
20
20
|
import { InfiniteQueryHookResult } from 'react-query-kit';
|
|
21
21
|
import { InputBaseProps } from '@mantine/core';
|
|
22
22
|
import { JSX } from 'react/jsx-runtime';
|
|
23
|
+
import { KyRequest } from 'ky';
|
|
23
24
|
import { KyResponse } from 'ky';
|
|
24
25
|
import { LoaderProps } from '@mantine/core';
|
|
25
26
|
import { MantineColorShade } from '@mantine/core';
|
|
@@ -27,6 +28,7 @@ import { MantineThemeColors } from '@mantine/core';
|
|
|
27
28
|
import { MantineThemeOverride } from '@mantine/core';
|
|
28
29
|
import { ModalProps } from '@mantine/core';
|
|
29
30
|
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
31
|
+
import { NormalizedOptions } from 'ky';
|
|
30
32
|
import { NotificationsProps } from '@mantine/notifications';
|
|
31
33
|
import { NumberInputProps } from '@mantine/core';
|
|
32
34
|
import { RadioGroupProps } from '@mantine/core';
|
|
@@ -42,6 +44,7 @@ import { TextInputProps } from '@mantine/core';
|
|
|
42
44
|
import { TimeInputProps } from '@mantine/dates';
|
|
43
45
|
import { UseFormReturn } from 'react-hook-form';
|
|
44
46
|
import { z } from 'zod';
|
|
47
|
+
import * as z_2 from 'zod';
|
|
45
48
|
import { ZodTypeAny } from 'zod';
|
|
46
49
|
|
|
47
50
|
export declare const addBodyJsonHook: BeforeErrorHook;
|
|
@@ -252,11 +255,16 @@ export declare const isInfinityEmpty: (data: InfiniteData<{
|
|
|
252
255
|
data: unknown[];
|
|
253
256
|
}> | undefined) => boolean;
|
|
254
257
|
|
|
255
|
-
export declare
|
|
256
|
-
response:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
export declare class KyError<T = unknown> extends HTTPError<T> {
|
|
259
|
+
response: KyResponseWithBody<T>;
|
|
260
|
+
request: KyRequest;
|
|
261
|
+
options: NormalizedOptions;
|
|
262
|
+
constructor(response: KyResponse<T>, request: KyRequest, options: NormalizedOptions, bodyJson: T);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
declare interface KyResponseWithBody<T> extends KyResponse<T> {
|
|
266
|
+
bodyJson?: T;
|
|
267
|
+
}
|
|
260
268
|
|
|
261
269
|
export declare interface LayoutProps {
|
|
262
270
|
children: React.ReactNode;
|
|
@@ -345,6 +353,8 @@ export declare const nullableInput: <T extends ZodTypeAny>(schema: T, message?:
|
|
|
345
353
|
|
|
346
354
|
export declare const numberToTimeInput: (number: number) => string;
|
|
347
355
|
|
|
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, "">]>;
|
|
357
|
+
|
|
348
358
|
export declare const PageDataProvider: ({ value, children }: PageDataProviderProps) => JSX.Element;
|
|
349
359
|
|
|
350
360
|
declare interface PageDataProviderProps {
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react-hook-form"),f=require("../form/utils/zodValidator.cjs"),h=(i,a)=>{const r=e=>{const{validate:l,name:d="",placeholder:s,label:c,description:n,...u}=e;return o.jsx(b.Controller,{name:d,defaultValue:"",rules:{validate:l&&!e.disabled?f.zodValidator(l):void 0},disabled:e.disabled,...a?.(e),render:t=>{const{fieldState:{isTouched:v,error:m}}=t,F={...t,props:{...e,validate:void 0},field:{...t.field,label:c,placeholder:s,description:n,error:m?.message},...u};return o.jsx(i,{...F})}})};return r.displayName=`
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),b=require("react-hook-form"),f=require("../form/utils/zodValidator.cjs"),h=(i,a)=>{const r=e=>{const{validate:l,name:d="",placeholder:s,label:c,description:n,...u}=e;return o.jsx(b.Controller,{name:d,defaultValue:"",rules:{validate:l&&!e.disabled?f.zodValidator(l):void 0},disabled:e.disabled,...a?.(e),render:t=>{const{fieldState:{isTouched:v,error:m}}=t,F={...t,props:{...e,validate:void 0},field:{...t.field,label:c,placeholder:s,description:n,error:m?.message},...u};return o.jsx(i,{...F})}})};return r.displayName=`WithForm(${i.displayName})`,r};exports.withForm=h;
|
|
2
2
|
//# sourceMappingURL=withForm.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withForm.cjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `
|
|
1
|
+
{"version":3,"file":"withForm.cjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `WithForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":"2MAwBaA,EAAW,CACtBC,EACAC,IACG,CACG,MAAAC,EAA0CC,GAAU,CAClD,KAAA,CAAE,SAAAC,EAAU,KAAAC,EAAO,GAAI,YAAAC,EAAa,MAAAC,EAAO,YAAAC,EAAa,GAAGC,CAAA,EAAsBN,EAGrF,OAAAO,EAAA,IAACC,EAAA,WAAA,CACC,KAAAN,EACA,aAAc,GACd,MAAO,CACL,SAAUD,GAAY,CAACD,EAAM,SAAWS,EAAAA,aAAaR,CAAQ,EAAI,MACnE,EACA,SAAUD,EAAM,SACf,GAAGF,IAAqBE,CAAK,EAC9B,OAASU,GAAgB,CACjB,KAAA,CACJ,WAAY,CAAE,UAAAC,EAAW,MAAAC,CAAM,CAAA,EAC7BF,EAEEG,EAAa,CACjB,GAAGH,EACH,MAAO,CACL,GAAGV,EACH,SAAU,MACZ,EACA,MAAO,CACL,GAAGU,EAAY,MACf,MAAAN,EACA,YAAAD,EACA,YAAAE,EACA,MAAOO,GAAO,OAChB,EACA,GAAGN,CACL,EAEO,OAAAC,MAACV,EAAkB,CAAA,GAAGgB,CAAY,CAAA,CAAA,CAC3C,CACF,CAEJ,EAEU,OAAAd,EAAA,YAAc,YAAYF,EAAiB,WAAW,IAEzDE,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withForm.mjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `
|
|
1
|
+
{"version":3,"file":"withForm.mjs","sources":["../../../src/hocs/withForm.tsx"],"sourcesContent":["'use client';\r\nimport { Controller, ControllerProps } from 'react-hook-form';\r\nimport { ZodTypeAny } from 'zod';\r\nimport { zodValidator } from '../form';\r\n\r\nexport interface WithFormProps {\r\n name?: string;\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n validate?: ZodTypeAny;\r\n disabled?: boolean;\r\n}\r\n\r\nexport type FormFieldProps<T = unknown> = Parameters<ControllerProps['render']>[0] & {\r\n props: T;\r\n field: {\r\n label?: React.ReactNode;\r\n placeholder?: string;\r\n description?: React.ReactNode;\r\n error?: string;\r\n };\r\n};\r\n\r\nexport const withForm = <P extends unknown>(\r\n WrappedComponent: React.ComponentType<FormFieldProps<P>>,\r\n getControllerProps?: (props: P) => Omit<Partial<ControllerProps>, 'render'>,\r\n) => {\r\n const FormField: React.FC<P & WithFormProps> = (props) => {\r\n const { validate, name = '', placeholder, label, description, ...withFormRestProps } = props;\r\n\r\n return (\r\n <Controller\r\n name={name}\r\n defaultValue={''}\r\n rules={{\r\n validate: validate && !props.disabled ? zodValidator(validate) : undefined,\r\n }}\r\n disabled={props.disabled}\r\n {...getControllerProps?.(props)}\r\n render={(renderProps) => {\r\n const {\r\n fieldState: { isTouched, error },\r\n } = renderProps;\r\n\r\n const fieldProps = {\r\n ...renderProps,\r\n props: {\r\n ...props,\r\n validate: undefined,\r\n },\r\n field: {\r\n ...renderProps.field,\r\n label,\r\n placeholder,\r\n description,\r\n error: error?.message,\r\n },\r\n ...withFormRestProps,\r\n } as FormFieldProps<P>;\r\n\r\n return <WrappedComponent {...fieldProps} />;\r\n }}\r\n />\r\n );\r\n };\r\n\r\n FormField.displayName = `WithForm(${WrappedComponent.displayName})`;\r\n\r\n return FormField;\r\n};\r\n"],"names":["withForm","WrappedComponent","getControllerProps","FormField","props","validate","name","placeholder","label","description","withFormRestProps","jsx","Controller","zodValidator","renderProps","isTouched","error","fieldProps"],"mappings":";;;;AAwBa,MAAAA,IAAW,CACtBC,GACAC,MACG;AACG,QAAAC,IAAyC,CAACC,MAAU;AAClD,UAAA,EAAE,UAAAC,GAAU,MAAAC,IAAO,IAAI,aAAAC,GAAa,OAAAC,GAAO,aAAAC,GAAa,GAAGC,EAAA,IAAsBN;AAGrF,WAAA,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAAN;AAAA,QACA,cAAc;AAAA,QACd,OAAO;AAAA,UACL,UAAUD,KAAY,CAACD,EAAM,WAAWS,EAAaR,CAAQ,IAAI;AAAA,QACnE;AAAA,QACA,UAAUD,EAAM;AAAA,QACf,GAAGF,IAAqBE,CAAK;AAAA,QAC9B,QAAQ,CAACU,MAAgB;AACjB,gBAAA;AAAA,YACJ,YAAY,EAAE,WAAAC,GAAW,OAAAC,EAAM;AAAA,UAAA,IAC7BF,GAEEG,IAAa;AAAA,YACjB,GAAGH;AAAA,YACH,OAAO;AAAA,cACL,GAAGV;AAAA,cACH,UAAU;AAAA,YACZ;AAAA,YACA,OAAO;AAAA,cACL,GAAGU,EAAY;AAAA,cACf,OAAAN;AAAA,cACA,aAAAD;AAAA,cACA,aAAAE;AAAA,cACA,OAAOO,GAAO;AAAA,YAChB;AAAA,YACA,GAAGN;AAAA,UACL;AAEO,iBAAA,gBAAAC,EAACV,GAAkB,EAAA,GAAGgB,EAAY,CAAA;AAAA,QAAA;AAAA,MAC3C;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAd,EAAA,cAAc,YAAYF,EAAiB,WAAW,KAEzDE;AACT;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("react"),c=e=>{const t=({removeModal:r,opened:s,...n})=>{const[l,a]=i.useState(!1),o=()=>{a(!1),setTimeout(()=>r(),200),n.onClose?.()};return i.useEffect(()=>{s?setTimeout(()=>a(!0),0):o()},[s]),u.jsx(e,{...n,opened:l,onClose:o})};return t.displayName=`
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("react"),c=e=>{const t=({removeModal:r,opened:s,...n})=>{const[l,a]=i.useState(!1),o=()=>{a(!1),setTimeout(()=>r(),200),n.onClose?.()};return i.useEffect(()=>{s?setTimeout(()=>a(!0),0):o()},[s]),u.jsx(e,{...n,opened:l,onClose:o})};return t.displayName=`WithModalManager(${e.displayName})`,t};exports.withModalManager=c;
|
|
2
2
|
//# sourceMappingURL=withModalManager.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withModalManager.cjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `
|
|
1
|
+
{"version":3,"file":"withModalManager.cjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":"qJASaA,EACXC,GACG,CACH,MAAMC,EAA8D,CAAC,CACnE,YAAAC,EACA,OAAAC,EACA,GAAGC,CAAA,IACC,CACJ,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAK,EAEpCC,EAAU,IAAM,CACpBF,EAAU,EAAK,EACJ,WAAA,IAAMJ,EAAY,EAAG,GAAG,EACnCE,EAAM,UAAU,CAClB,EAEAK,OAAAA,EAAAA,UAAU,IAAM,CACVN,EAAmB,WAAA,IAAMG,EAAU,EAAI,EAAG,CAAC,EAClCE,EAAA,CAAA,EACZ,CAACL,CAAM,CAAC,EAGTO,EAAA,IAACV,EAAA,CACE,GAAII,EACL,OAAQC,EACR,QAAAG,CAAA,CACF,CAEJ,EAEU,OAAAP,EAAA,YAAc,oBAAoBD,EAAiB,WAAW,IAEjEC,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withModalManager.mjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `
|
|
1
|
+
{"version":3,"file":"withModalManager.mjs","sources":["../../../src/hocs/withModalManager.tsx"],"sourcesContent":["'use client';\r\nimport { ModalProps } from '@mantine/core';\r\nimport { useEffect, useState } from 'react';\r\n\r\nexport interface WithModalManagerProps {\r\n removeModal: () => void;\r\n opened: boolean;\r\n}\r\n\r\nexport const withModalManager = <P extends Object>(\r\n WrappedComponent: React.ComponentType<P & ModalProps>,\r\n) => {\r\n const Component: React.FC<P & WithModalManagerProps & ModalProps> = ({\r\n removeModal,\r\n opened,\r\n ...props\r\n }) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const onClose = () => {\r\n setIsOpen(false);\r\n setTimeout(() => removeModal(), 200);\r\n props.onClose?.();\r\n };\r\n\r\n useEffect(() => {\r\n if (opened) setTimeout(() => setIsOpen(true), 0);\r\n else onClose();\r\n }, [opened]);\r\n\r\n return (\r\n <WrappedComponent\r\n {...(props as P)}\r\n opened={isOpen}\r\n onClose={onClose}\r\n />\r\n );\r\n };\r\n\r\n Component.displayName = `WithModalManager(${WrappedComponent.displayName})`;\r\n\r\n return Component;\r\n};\r\n"],"names":["withModalManager","WrappedComponent","Component","removeModal","opened","props","isOpen","setIsOpen","useState","onClose","useEffect","jsx"],"mappings":";;;AASa,MAAAA,IAAmB,CAC9BC,MACG;AACH,QAAMC,IAA8D,CAAC;AAAA,IACnE,aAAAC;AAAA,IACA,QAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,MACC;AACJ,UAAM,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAK,GAEpCC,IAAU,MAAM;AACpB,MAAAF,EAAU,EAAK,GACJ,WAAA,MAAMJ,EAAY,GAAG,GAAG,GACnCE,EAAM,UAAU;AAAA,IAClB;AAEA,WAAAK,EAAU,MAAM;AACd,MAAIN,IAAmB,WAAA,MAAMG,EAAU,EAAI,GAAG,CAAC,IAClCE,EAAA;AAAA,IAAA,GACZ,CAACL,CAAM,CAAC,GAGT,gBAAAO;AAAA,MAACV;AAAA,MAAA;AAAA,QACE,GAAII;AAAA,QACL,QAAQC;AAAA,QACR,SAAAG;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAEU,SAAAP,EAAA,cAAc,oBAAoBD,EAAiB,WAAW,KAEjEC;AACT;"}
|
package/dist/src/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/src/index.mjs
CHANGED
|
@@ -13,55 +13,57 @@ import { MyTimeInput as b } from "./components/MyTimeInput/index.mjs";
|
|
|
13
13
|
import { SelectInfinity as h } from "./components/SelectInfinity/index.mjs";
|
|
14
14
|
import { HttpStatus as B } 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
|
|
16
|
+
import { NavigationHistoryProvider as w, QP_BACK_URL_NAME as E, useNavigationHistory as A } from "./contexts/NavigationHistoryContext/index.mjs";
|
|
17
17
|
import { PageDataProvider as O, usePageData as R } from "./contexts/PageDataContext/index.mjs";
|
|
18
18
|
import { Form as J } from "./form/Form.mjs";
|
|
19
|
-
import { FormButtonSubmit as
|
|
20
|
-
import { zodValidator as
|
|
19
|
+
import { FormButtonSubmit as L } from "./form/FormButtonSubmit.mjs";
|
|
20
|
+
import { zodValidator as z } from "./form/utils/zodValidator.mjs";
|
|
21
21
|
import { nullableInput as Q } from "./form/utils/nullableInput.mjs";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
22
|
+
import { optionalInput as W } from "./form/utils/optionalInput.mjs";
|
|
23
|
+
import { FormCheckbox as q } from "./form/base/FormCheckbox.mjs";
|
|
24
|
+
import { FormDatePickerInput as Y } from "./form/base/FormDatePickerInput.mjs";
|
|
25
|
+
import { FormDateTimePicker as $ } from "./form/base/FormDateTimePicker.mjs";
|
|
26
|
+
import { FormNumberInput as or } from "./form/base/FormNumberInput.mjs";
|
|
27
|
+
import { FormRadioGroup as tr } from "./form/base/FormRadioGroup.mjs";
|
|
28
|
+
import { FormSelect as pr } from "./form/base/FormSelect.mjs";
|
|
29
|
+
import { FormSelectInfinity as xr } from "./form/base/FormSelectInfinity.mjs";
|
|
30
|
+
import { FormTextarea as ir } from "./form/base/FormTextArea.mjs";
|
|
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";
|
|
34
|
+
import { withModalManager as Pr } from "./hocs/withModalManager.mjs";
|
|
35
|
+
import { useBreakpoint as Mr } from "./hooks/useBreakpoint.mjs";
|
|
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";
|
|
39
|
+
import { breakpointsWithPx as Dr } from "./mantine/breakpoints-with-px.mjs";
|
|
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";
|
|
48
49
|
export {
|
|
49
50
|
e as EmptyState,
|
|
50
51
|
J as Form,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
L as FormButtonSubmit,
|
|
53
|
+
q as FormCheckbox,
|
|
54
|
+
Y as FormDatePickerInput,
|
|
55
|
+
$ as FormDateTimePicker,
|
|
56
|
+
or as FormNumberInput,
|
|
57
|
+
tr as FormRadioGroup,
|
|
58
|
+
pr as FormSelect,
|
|
59
|
+
xr as FormSelectInfinity,
|
|
60
|
+
ur as FormTextInput,
|
|
61
|
+
ir as FormTextarea,
|
|
62
|
+
sr as FormTimeInput,
|
|
62
63
|
B as HttpStatus,
|
|
63
64
|
a as Icon,
|
|
64
65
|
m as InfinityLoader,
|
|
66
|
+
Rr as KyError,
|
|
65
67
|
n as MyDatePickerInput,
|
|
66
68
|
y as MyDateTimePicker,
|
|
67
69
|
l as MyNotifications,
|
|
@@ -73,31 +75,32 @@ export {
|
|
|
73
75
|
f as NavItems,
|
|
74
76
|
w as NavigationHistoryProvider,
|
|
75
77
|
O as PageDataProvider,
|
|
76
|
-
|
|
78
|
+
E as QP_BACK_URL_NAME,
|
|
77
79
|
v as Revalidate,
|
|
78
80
|
h as SelectInfinity,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
_r as addBodyJsonHook,
|
|
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,
|
|
87
89
|
Q as nullableInput,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
Mr as
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
lr as numberToTimeInput,
|
|
91
|
+
W as optionalInput,
|
|
92
|
+
Kr as parseJSON,
|
|
93
|
+
Qr as shuffleArray,
|
|
94
|
+
Ir as timeInputToNumber,
|
|
95
|
+
Hr as toTailwindColors,
|
|
96
|
+
Mr as useBreakpoint,
|
|
97
|
+
Nr as useFetchNextPageOnScroll,
|
|
98
|
+
A as useNavigationHistory,
|
|
99
|
+
gr as useOnScrollProgress,
|
|
97
100
|
R as usePageData,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
kr as useUpdateSearchParams,
|
|
102
|
+
dr as withForm,
|
|
103
|
+
Pr as withModalManager,
|
|
104
|
+
z as zodValidator
|
|
102
105
|
};
|
|
103
106
|
//# sourceMappingURL=index.mjs.map
|
package/dist/src/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@mantine/core"),t=require("./breakpoints-with-px.cjs"),o={breakpoints:t.breakpointsWithPx,cursorType:"pointer",components:{Notification:e.Notification.extend({defaultProps:{withBorder:!0}}),AppShell:e.AppShell.extend({defaultProps:{padding:0}}),Select:e.Select.extend({defaultProps:{allowDeselect:!1}}),Menu:e.Menu.extend({defaultProps:{position:"bottom-end"}}),Tooltip:e.Tooltip.extend({defaultProps:{multiline:!0,w:300}})}};exports.myDefaultTheme=o;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@mantine/core"),t=require("./breakpoints-with-px.cjs"),o={breakpoints:t.breakpointsWithPx,cursorType:"pointer",components:{Notification:e.Notification.extend({defaultProps:{withBorder:!0}}),AppShell:e.AppShell.extend({defaultProps:{padding:0}}),Select:e.Select.extend({defaultProps:{allowDeselect:!1}}),Menu:e.Menu.extend({defaultProps:{position:"bottom-end"}}),Tooltip:e.Tooltip.extend({defaultProps:{multiline:!0,w:300}}),Portal:e.Portal.extend({defaultProps:{reuseTargetNode:!0}})}};exports.myDefaultTheme=o;
|
|
2
2
|
//# sourceMappingURL=my-default-theme.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-default-theme.cjs","sources":["../../../src/mantine/my-default-theme.ts"],"sourcesContent":["import {\r\n AppShell,\r\n MantineTheme,\r\n Menu,\r\n Select,\r\n Tooltip,\r\n Notification,\r\n MantineThemeOverride,\r\n} from '@mantine/core';\r\nimport { breakpointsWithPx } from './breakpoints-with-px';\r\n\r\nexport const myDefaultTheme: MantineThemeOverride = {\r\n breakpoints: breakpointsWithPx,\r\n cursorType: 'pointer',\r\n components: {\r\n Notification: Notification.extend({\r\n defaultProps: {\r\n withBorder: true,\r\n },\r\n }),\r\n AppShell: AppShell.extend({\r\n defaultProps: {\r\n padding: 0,\r\n },\r\n }),\r\n Select: Select.extend({\r\n defaultProps: {\r\n allowDeselect: false,\r\n },\r\n }),\r\n Menu: Menu.extend({\r\n defaultProps: {\r\n position: 'bottom-end',\r\n },\r\n }),\r\n Tooltip: Tooltip.extend({\r\n defaultProps: {\r\n multiline: true,\r\n w: 300,\r\n },\r\n }),\r\n },\r\n};\r\n"],"names":["myDefaultTheme","breakpointsWithPx","Notification","AppShell","Select","Menu","Tooltip"],"mappings":"
|
|
1
|
+
{"version":3,"file":"my-default-theme.cjs","sources":["../../../src/mantine/my-default-theme.ts"],"sourcesContent":["import {\r\n AppShell,\r\n MantineTheme,\r\n Menu,\r\n Select,\r\n Tooltip,\r\n Notification,\r\n MantineThemeOverride,\r\n Portal,\r\n} from '@mantine/core';\r\nimport { breakpointsWithPx } from './breakpoints-with-px';\r\n\r\nexport const myDefaultTheme: MantineThemeOverride = {\r\n breakpoints: breakpointsWithPx,\r\n cursorType: 'pointer',\r\n components: {\r\n Notification: Notification.extend({\r\n defaultProps: {\r\n withBorder: true,\r\n },\r\n }),\r\n AppShell: AppShell.extend({\r\n defaultProps: {\r\n padding: 0,\r\n },\r\n }),\r\n Select: Select.extend({\r\n defaultProps: {\r\n allowDeselect: false,\r\n },\r\n }),\r\n Menu: Menu.extend({\r\n defaultProps: {\r\n position: 'bottom-end',\r\n },\r\n }),\r\n Tooltip: Tooltip.extend({\r\n defaultProps: {\r\n multiline: true,\r\n w: 300,\r\n },\r\n }),\r\n // borrar en v8\r\n Portal: Portal.extend({\r\n defaultProps: {\r\n reuseTargetNode: true,\r\n },\r\n }),\r\n },\r\n};\r\n"],"names":["myDefaultTheme","breakpointsWithPx","Notification","AppShell","Select","Menu","Tooltip","Portal"],"mappings":"wJAYaA,EAAuC,CAClD,YAAaC,EAAA,kBACb,WAAY,UACZ,WAAY,CACV,aAAcC,eAAa,OAAO,CAChC,aAAc,CACZ,WAAY,EAAA,CACd,CACD,EACD,SAAUC,WAAS,OAAO,CACxB,aAAc,CACZ,QAAS,CAAA,CACX,CACD,EACD,OAAQC,SAAO,OAAO,CACpB,aAAc,CACZ,cAAe,EAAA,CACjB,CACD,EACD,KAAMC,OAAK,OAAO,CAChB,aAAc,CACZ,SAAU,YAAA,CACZ,CACD,EACD,QAASC,UAAQ,OAAO,CACtB,aAAc,CACZ,UAAW,GACX,EAAG,GAAA,CACL,CACD,EAED,OAAQC,SAAO,OAAO,CACpB,aAAc,CACZ,gBAAiB,EAAA,CAEpB,CAAA,CAAA,CAEL"}
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { breakpointsWithPx as
|
|
1
|
+
import { Portal as e, Tooltip as t, Menu as o, Select as r, AppShell as l, Notification as p } from "@mantine/core";
|
|
2
|
+
import { breakpointsWithPx as i } from "./breakpoints-with-px.mjs";
|
|
3
3
|
const d = {
|
|
4
|
-
breakpoints:
|
|
4
|
+
breakpoints: i,
|
|
5
5
|
cursorType: "pointer",
|
|
6
6
|
components: {
|
|
7
|
-
Notification:
|
|
7
|
+
Notification: p.extend({
|
|
8
8
|
defaultProps: {
|
|
9
9
|
withBorder: !0
|
|
10
10
|
}
|
|
11
11
|
}),
|
|
12
|
-
AppShell:
|
|
12
|
+
AppShell: l.extend({
|
|
13
13
|
defaultProps: {
|
|
14
14
|
padding: 0
|
|
15
15
|
}
|
|
16
16
|
}),
|
|
17
|
-
Select:
|
|
17
|
+
Select: r.extend({
|
|
18
18
|
defaultProps: {
|
|
19
19
|
allowDeselect: !1
|
|
20
20
|
}
|
|
21
21
|
}),
|
|
22
|
-
Menu:
|
|
22
|
+
Menu: o.extend({
|
|
23
23
|
defaultProps: {
|
|
24
24
|
position: "bottom-end"
|
|
25
25
|
}
|
|
26
26
|
}),
|
|
27
|
-
Tooltip:
|
|
27
|
+
Tooltip: t.extend({
|
|
28
28
|
defaultProps: {
|
|
29
29
|
multiline: !0,
|
|
30
30
|
w: 300
|
|
31
31
|
}
|
|
32
|
+
}),
|
|
33
|
+
// borrar en v8
|
|
34
|
+
Portal: e.extend({
|
|
35
|
+
defaultProps: {
|
|
36
|
+
reuseTargetNode: !0
|
|
37
|
+
}
|
|
32
38
|
})
|
|
33
39
|
}
|
|
34
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"my-default-theme.mjs","sources":["../../../src/mantine/my-default-theme.ts"],"sourcesContent":["import {\r\n AppShell,\r\n MantineTheme,\r\n Menu,\r\n Select,\r\n Tooltip,\r\n Notification,\r\n MantineThemeOverride,\r\n} from '@mantine/core';\r\nimport { breakpointsWithPx } from './breakpoints-with-px';\r\n\r\nexport const myDefaultTheme: MantineThemeOverride = {\r\n breakpoints: breakpointsWithPx,\r\n cursorType: 'pointer',\r\n components: {\r\n Notification: Notification.extend({\r\n defaultProps: {\r\n withBorder: true,\r\n },\r\n }),\r\n AppShell: AppShell.extend({\r\n defaultProps: {\r\n padding: 0,\r\n },\r\n }),\r\n Select: Select.extend({\r\n defaultProps: {\r\n allowDeselect: false,\r\n },\r\n }),\r\n Menu: Menu.extend({\r\n defaultProps: {\r\n position: 'bottom-end',\r\n },\r\n }),\r\n Tooltip: Tooltip.extend({\r\n defaultProps: {\r\n multiline: true,\r\n w: 300,\r\n },\r\n }),\r\n },\r\n};\r\n"],"names":["myDefaultTheme","breakpointsWithPx","Notification","AppShell","Select","Menu","Tooltip"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"my-default-theme.mjs","sources":["../../../src/mantine/my-default-theme.ts"],"sourcesContent":["import {\r\n AppShell,\r\n MantineTheme,\r\n Menu,\r\n Select,\r\n Tooltip,\r\n Notification,\r\n MantineThemeOverride,\r\n Portal,\r\n} from '@mantine/core';\r\nimport { breakpointsWithPx } from './breakpoints-with-px';\r\n\r\nexport const myDefaultTheme: MantineThemeOverride = {\r\n breakpoints: breakpointsWithPx,\r\n cursorType: 'pointer',\r\n components: {\r\n Notification: Notification.extend({\r\n defaultProps: {\r\n withBorder: true,\r\n },\r\n }),\r\n AppShell: AppShell.extend({\r\n defaultProps: {\r\n padding: 0,\r\n },\r\n }),\r\n Select: Select.extend({\r\n defaultProps: {\r\n allowDeselect: false,\r\n },\r\n }),\r\n Menu: Menu.extend({\r\n defaultProps: {\r\n position: 'bottom-end',\r\n },\r\n }),\r\n Tooltip: Tooltip.extend({\r\n defaultProps: {\r\n multiline: true,\r\n w: 300,\r\n },\r\n }),\r\n // borrar en v8\r\n Portal: Portal.extend({\r\n defaultProps: {\r\n reuseTargetNode: true,\r\n },\r\n }),\r\n },\r\n};\r\n"],"names":["myDefaultTheme","breakpointsWithPx","Notification","AppShell","Select","Menu","Tooltip","Portal"],"mappings":";;AAYO,MAAMA,IAAuC;AAAA,EAClD,aAAaC;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,IACV,cAAcC,EAAa,OAAO;AAAA,MAChC,cAAc;AAAA,QACZ,YAAY;AAAA,MAAA;AAAA,IACd,CACD;AAAA,IACD,UAAUC,EAAS,OAAO;AAAA,MACxB,cAAc;AAAA,QACZ,SAAS;AAAA,MAAA;AAAA,IACX,CACD;AAAA,IACD,QAAQC,EAAO,OAAO;AAAA,MACpB,cAAc;AAAA,QACZ,eAAe;AAAA,MAAA;AAAA,IACjB,CACD;AAAA,IACD,MAAMC,EAAK,OAAO;AAAA,MAChB,cAAc;AAAA,QACZ,UAAU;AAAA,MAAA;AAAA,IACZ,CACD;AAAA,IACD,SAASC,EAAQ,OAAO;AAAA,MACtB,cAAc;AAAA,QACZ,WAAW;AAAA,QACX,GAAG;AAAA,MAAA;AAAA,IACL,CACD;AAAA;AAAA,IAED,QAAQC,EAAO,OAAO;AAAA,MACpB,cAAc;AAAA,QACZ,iBAAiB;AAAA,MAAA;AAAA,IAEpB,CAAA;AAAA,EAAA;AAEL;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("ky"),d=require("./parseJson.cjs");class a extends t.HTTPError{constructor(s,e,r,n){super(s,e,r),this.response.bodyJson=n}}const y=async o=>(o.response.bodyJson=await d.parseJSON(o.response),o);exports.KyError=a;exports.addBodyJsonHook=y;
|
|
2
2
|
//# sourceMappingURL=addBodyJsonHook.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBodyJsonHook.cjs","sources":["../../../../src/utils/ky/addBodyJsonHook.ts"],"sourcesContent":["import { BeforeErrorHook, HTTPError } from 'ky';\r\nimport { parseJSON } from './parseJson';\r\n\r\nexport
|
|
1
|
+
{"version":3,"file":"addBodyJsonHook.cjs","sources":["../../../../src/utils/ky/addBodyJsonHook.ts"],"sourcesContent":["import { BeforeErrorHook, HTTPError, KyRequest, KyResponse, NormalizedOptions } from 'ky';\r\nimport { parseJSON } from './parseJson';\r\n\r\ninterface KyResponseWithBody<T> extends KyResponse<T> {\r\n bodyJson?: T;\r\n}\r\n\r\nexport class KyError<T = unknown> extends HTTPError<T> {\r\n declare response: KyResponseWithBody<T>;\r\n declare request: KyRequest;\r\n declare options: NormalizedOptions;\r\n\r\n constructor(\r\n response: KyResponse<T>,\r\n request: KyRequest,\r\n options: NormalizedOptions,\r\n bodyJson: T,\r\n ) {\r\n super(response, request, options);\r\n this.response.bodyJson = bodyJson;\r\n }\r\n}\r\n\r\nexport const addBodyJsonHook: BeforeErrorHook = async (error: KyError<unknown>) => {\r\n error.response.bodyJson = await parseJSON(error.response);\r\n return error;\r\n};\r\n"],"names":["KyError","HTTPError","response","request","options","bodyJson","addBodyJsonHook","error","parseJSON"],"mappings":"mIAOO,MAAMA,UAA6BC,EAAAA,SAAa,CAKrD,YACEC,EACAC,EACAC,EACAC,EACA,CACM,MAAAH,EAAUC,EAASC,CAAO,EAChC,KAAK,SAAS,SAAWC,CAAA,CAE7B,CAEa,MAAAC,EAAmC,MAAOC,IACrDA,EAAM,SAAS,SAAW,MAAMC,EAAAA,UAAUD,EAAM,QAAQ,EACjDA"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HTTPError as t } from "ky";
|
|
2
|
+
import { parseJSON as p } from "./parseJson.mjs";
|
|
3
|
+
class c extends t {
|
|
4
|
+
constructor(s, r, n, e) {
|
|
5
|
+
super(s, r, n), this.response.bodyJson = e;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const y = async (o) => (o.response.bodyJson = await p(o.response), o);
|
|
3
9
|
export {
|
|
4
|
-
|
|
10
|
+
c as KyError,
|
|
11
|
+
y as addBodyJsonHook
|
|
5
12
|
};
|
|
6
13
|
//# sourceMappingURL=addBodyJsonHook.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBodyJsonHook.mjs","sources":["../../../../src/utils/ky/addBodyJsonHook.ts"],"sourcesContent":["import { BeforeErrorHook, HTTPError } from 'ky';\r\nimport { parseJSON } from './parseJson';\r\n\r\nexport
|
|
1
|
+
{"version":3,"file":"addBodyJsonHook.mjs","sources":["../../../../src/utils/ky/addBodyJsonHook.ts"],"sourcesContent":["import { BeforeErrorHook, HTTPError, KyRequest, KyResponse, NormalizedOptions } from 'ky';\r\nimport { parseJSON } from './parseJson';\r\n\r\ninterface KyResponseWithBody<T> extends KyResponse<T> {\r\n bodyJson?: T;\r\n}\r\n\r\nexport class KyError<T = unknown> extends HTTPError<T> {\r\n declare response: KyResponseWithBody<T>;\r\n declare request: KyRequest;\r\n declare options: NormalizedOptions;\r\n\r\n constructor(\r\n response: KyResponse<T>,\r\n request: KyRequest,\r\n options: NormalizedOptions,\r\n bodyJson: T,\r\n ) {\r\n super(response, request, options);\r\n this.response.bodyJson = bodyJson;\r\n }\r\n}\r\n\r\nexport const addBodyJsonHook: BeforeErrorHook = async (error: KyError<unknown>) => {\r\n error.response.bodyJson = await parseJSON(error.response);\r\n return error;\r\n};\r\n"],"names":["KyError","HTTPError","response","request","options","bodyJson","addBodyJsonHook","error","parseJSON"],"mappings":";;AAOO,MAAMA,UAA6BC,EAAa;AAAA,EAKrD,YACEC,GACAC,GACAC,GACAC,GACA;AACM,UAAAH,GAAUC,GAASC,CAAO,GAChC,KAAK,SAAS,WAAWC;AAAA,EAAA;AAE7B;AAEa,MAAAC,IAAmC,OAAOC,OACrDA,EAAM,SAAS,WAAW,MAAMC,EAAUD,EAAM,QAAQ,GACjDA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lkd-web-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "A template for creating React component libraries with Vite.",
|
|
5
5
|
"author": "LKD",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,19 +55,19 @@
|
|
|
55
55
|
"vitest": "^3.1.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@mantine/core": "^7.17.
|
|
59
|
-
"@mantine/dates": "^7.17.
|
|
60
|
-
"@mantine/hooks": "^7.17.
|
|
61
|
-
"@mantine/notifications": "^7.17.
|
|
62
|
-
"@tanstack/react-query": "^5.
|
|
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",
|
|
63
63
|
"clsx": "^2.1.1",
|
|
64
|
-
"ky": "^1.8.
|
|
65
|
-
"next": "^15.3.
|
|
64
|
+
"ky": "^1.8.1",
|
|
65
|
+
"next": "^15.3.1",
|
|
66
66
|
"query-string": "^9.1.1",
|
|
67
67
|
"react": "^19.1.0",
|
|
68
68
|
"react-dom": "^19.1.0",
|
|
69
|
-
"react-hook-form": "^7.
|
|
69
|
+
"react-hook-form": "^7.56.1",
|
|
70
70
|
"react-query-kit": "^3.3.1",
|
|
71
|
-
"zod": "^3.24.
|
|
71
|
+
"zod": "^3.24.3"
|
|
72
72
|
}
|
|
73
73
|
}
|