@douglasneuroinformatics/libui 4.3.0 → 4.4.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.
@@ -22,7 +22,6 @@ import * as _radix_ui_react_context_menu from '@radix-ui/react-context-menu';
22
22
  import * as _radix_ui_react_dialog from '@radix-ui/react-dialog';
23
23
  import { Drawer as Drawer$1 } from 'vaul';
24
24
  import { FormDataType, FormContent, PartialNullableFormDataType } from '@douglasneuroinformatics/libui-form-types';
25
- import { z } from 'zod';
26
25
  import * as _radix_ui_react_hover_card from '@radix-ui/react-hover-card';
27
26
  import * as LabelPrimitive from '@radix-ui/react-label';
28
27
  import { L as Language } from './types-DDyMlEuL.js';
@@ -1277,7 +1276,35 @@ type FileDropzoneProps = {
1277
1276
  };
1278
1277
  declare const FileDropzone: ({ acceptedFileTypes, className, description, file, setFile, titles }: FileDropzoneProps) => react_jsx_runtime.JSX.Element;
1279
1278
 
1280
- type FormProps<TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<TSchema> = z.TypeOf<TSchema>> = {
1279
+ type ZodIssueLike = {
1280
+ [key: string]: any;
1281
+ readonly code: string;
1282
+ readonly message: string;
1283
+ readonly path: PropertyKey[];
1284
+ };
1285
+ type ZodErrorLike = {
1286
+ cause?: unknown;
1287
+ issues: ZodIssueLike[];
1288
+ name: string;
1289
+ };
1290
+ type ZodSafeParseResultLike<T> = ZodSafeParseErrorLike | ZodSafeParseSuccessLike<T>;
1291
+ type ZodSafeParseSuccessLike<TOutput> = {
1292
+ data: TOutput;
1293
+ error?: never;
1294
+ success: true;
1295
+ };
1296
+ type ZodSafeParseErrorLike = {
1297
+ data?: never;
1298
+ error: ZodErrorLike;
1299
+ success: false;
1300
+ };
1301
+ type ZodTypeLike<TOutput, TInput = TOutput> = {
1302
+ readonly _input: TInput;
1303
+ readonly _output: TOutput;
1304
+ safeParseAsync: (data: unknown) => Promise<ZodSafeParseResultLike<TOutput>>;
1305
+ };
1306
+
1307
+ type FormProps<TSchema extends ZodTypeLike<FormDataType>, TData extends TSchema['_input'] = TSchema['_input']> = {
1281
1308
  [key: `data-${string}`]: unknown;
1282
1309
  additionalButtons?: {
1283
1310
  left?: React.ReactNode;
@@ -1298,7 +1325,7 @@ type FormProps<TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<T
1298
1325
  } | {
1299
1326
  success: true;
1300
1327
  }>) | null;
1301
- onError?: (error: z.ZodError<NoInfer<TData>>) => void;
1328
+ onError?: (error: ZodErrorLike) => void;
1302
1329
  onSubmit: (data: NoInfer<TData>) => Promisable<void>;
1303
1330
  preventResetValuesOnReset?: boolean;
1304
1331
  readOnly?: boolean;
@@ -1306,9 +1333,9 @@ type FormProps<TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<T
1306
1333
  revalidateOnBlur?: boolean;
1307
1334
  submitBtnLabel?: string;
1308
1335
  suspendWhileSubmitting?: boolean;
1309
- validationSchema: z.ZodType<TData>;
1336
+ validationSchema: ZodTypeLike<TData>;
1310
1337
  };
1311
- declare const Form: <TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<TSchema> = z.TypeOf<TSchema>>({ additionalButtons, className, content, customStyles, fieldsFooter, id, initialValues, onBeforeSubmit, onError, onSubmit, preventResetValuesOnReset, readOnly, resetBtn, revalidateOnBlur, submitBtnLabel, suspendWhileSubmitting, validationSchema, ...props }: FormProps<TSchema, TData>) => react_jsx_runtime.JSX.Element;
1338
+ declare const Form: <TSchema extends ZodTypeLike<FormDataType>, TData extends TSchema["_input"] = TSchema["_input"]>({ additionalButtons, className, content, customStyles, fieldsFooter, id, initialValues, onBeforeSubmit, onError, onSubmit, preventResetValuesOnReset, readOnly, resetBtn, revalidateOnBlur, submitBtnLabel, suspendWhileSubmitting, validationSchema, ...props }: FormProps<TSchema, TData>) => react_jsx_runtime.JSX.Element;
1312
1339
 
1313
1340
  type HeadingProps = {
1314
1341
  children: string;
@@ -2115,7 +2115,6 @@ var FileDropzone = ({
2115
2115
  import { useEffect as useEffect10, useState as useState8 } from "react";
2116
2116
  import { get, set } from "lodash-es";
2117
2117
  import { twMerge } from "tailwind-merge";
2118
- import "zod";
2119
2118
 
2120
2119
  // src/components/Heading/Heading.tsx
2121
2120
  import { jsx as jsx93 } from "react/jsx-runtime";