@skygraph/react 0.0.0-placeholder.0 → 0.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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/dist/Table-BqN2u5ma.d.cts +1015 -0
  3. package/dist/Table-IvijKCyd.d.ts +1015 -0
  4. package/dist/chunk-2OCEO636.js +91 -0
  5. package/dist/chunk-2OCEO636.js.map +1 -0
  6. package/dist/chunk-6SHHUUAE.js +1667 -0
  7. package/dist/chunk-6SHHUUAE.js.map +1 -0
  8. package/dist/chunk-BNMJSYI2.js +54 -0
  9. package/dist/chunk-BNMJSYI2.js.map +1 -0
  10. package/dist/chunk-DRBAZI46.js +57 -0
  11. package/dist/chunk-DRBAZI46.js.map +1 -0
  12. package/dist/chunk-GJDDPZH7.js +226 -0
  13. package/dist/chunk-GJDDPZH7.js.map +1 -0
  14. package/dist/chunk-KCFWFDSP.js +847 -0
  15. package/dist/chunk-KCFWFDSP.js.map +1 -0
  16. package/dist/chunk-MJAEAFPN.js +3791 -0
  17. package/dist/chunk-MJAEAFPN.js.map +1 -0
  18. package/dist/chunk-MLEBVELO.js +1412 -0
  19. package/dist/chunk-MLEBVELO.js.map +1 -0
  20. package/dist/chunk-SEQI65CF.js +61 -0
  21. package/dist/chunk-SEQI65CF.js.map +1 -0
  22. package/dist/chunk-ZJF6SJLP.js +200 -0
  23. package/dist/chunk-ZJF6SJLP.js.map +1 -0
  24. package/dist/common-CdpocIEz.d.cts +27 -0
  25. package/dist/common-CdpocIEz.d.ts +27 -0
  26. package/dist/datagrid-B6hg5yJh.d.cts +200 -0
  27. package/dist/datagrid-B6hg5yJh.d.ts +200 -0
  28. package/dist/datagrid.cjs +1052 -0
  29. package/dist/datagrid.cjs.map +1 -0
  30. package/dist/datagrid.d.cts +2 -0
  31. package/dist/datagrid.d.ts +2 -0
  32. package/dist/datagrid.js +10 -0
  33. package/dist/datagrid.js.map +1 -0
  34. package/dist/devtools.cjs +253 -0
  35. package/dist/devtools.cjs.map +1 -0
  36. package/dist/devtools.d.cts +29 -0
  37. package/dist/devtools.d.ts +29 -0
  38. package/dist/devtools.js +9 -0
  39. package/dist/devtools.js.map +1 -0
  40. package/dist/form.cjs +1723 -0
  41. package/dist/form.cjs.map +1 -0
  42. package/dist/form.d.cts +530 -0
  43. package/dist/form.d.ts +530 -0
  44. package/dist/form.js +49 -0
  45. package/dist/form.js.map +1 -0
  46. package/dist/index.cjs +22419 -0
  47. package/dist/index.cjs.map +1 -0
  48. package/dist/index.d.cts +3671 -0
  49. package/dist/index.d.ts +3671 -0
  50. package/dist/index.js +14087 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/table.cjs +4130 -0
  53. package/dist/table.cjs.map +1 -0
  54. package/dist/table.d.cts +31 -0
  55. package/dist/table.d.ts +31 -0
  56. package/dist/table.js +26 -0
  57. package/dist/table.js.map +1 -0
  58. package/dist/tree.cjs +1821 -0
  59. package/dist/tree.cjs.map +1 -0
  60. package/dist/tree.d.cts +348 -0
  61. package/dist/tree.d.ts +348 -0
  62. package/dist/tree.js +13 -0
  63. package/dist/tree.js.map +1 -0
  64. package/dist/virtual.cjs +145 -0
  65. package/dist/virtual.cjs.map +1 -0
  66. package/dist/virtual.d.cts +50 -0
  67. package/dist/virtual.d.ts +50 -0
  68. package/dist/virtual.js +11 -0
  69. package/dist/virtual.js.map +1 -0
  70. package/package.json +108 -18
  71. package/README.md +0 -12
  72. package/index.js +0 -3
@@ -0,0 +1,530 @@
1
+ import { Core, FormEngine, FormOptions, FormState, ValidationResult, ValidationMode, Rule, FormListOperation } from '@skygraph/core';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import React__default from 'react';
4
+ import { B as BaseComponentProps, I as InteractiveProps, S as SizableProps } from './common-CdpocIEz.cjs';
5
+
6
+ interface UseFieldReturn {
7
+ value: unknown;
8
+ errors: string[];
9
+ warnings: string[];
10
+ error: string | null;
11
+ touched: boolean;
12
+ dirty: boolean;
13
+ validating: boolean;
14
+ status: 'success' | 'warning' | 'error' | 'validating' | undefined;
15
+ onChange: (value: unknown) => void;
16
+ onBlur: () => void;
17
+ }
18
+ declare function useField(core: Core, form: FormEngine, name: string): UseFieldReturn;
19
+
20
+ interface UseFormOptions extends FormOptions {
21
+ onSubmit?: (values: Record<string, unknown>) => void | Promise<void>;
22
+ onSubmitInvalid?: (errors: Record<string, string[]>) => void;
23
+ }
24
+ interface UseFormReturn {
25
+ core: Core;
26
+ form: FormEngine;
27
+ formState: FormState;
28
+ submit: () => Promise<void>;
29
+ reset: (values?: Record<string, unknown>) => void;
30
+ setFieldValue: (name: string, value: unknown) => void;
31
+ setFieldsValue: (values: Record<string, unknown>) => void;
32
+ getFieldValue: (name: string) => unknown;
33
+ getFieldsValue: () => Record<string, unknown>;
34
+ validateFields: (name?: string) => Promise<ValidationResult>;
35
+ }
36
+ declare function useForm(options?: UseFormOptions): UseFormReturn;
37
+
38
+ /** Props for the root form wrapper; merges {@link UseFormOptions} with layout and UI settings. */
39
+ interface FormProps extends UseFormOptions {
40
+ /** Controlled form instance from {@link useForm}; when omitted, an internal instance is created. */
41
+ form?: UseFormReturn;
42
+ /** `name` attribute on the native `<form>` element. */
43
+ name?: string;
44
+ /** Arrangement of labels and controls.
45
+ * @default 'vertical'
46
+ */
47
+ layout?: 'horizontal' | 'vertical' | 'inline';
48
+ /** Field/control size for context consumers. */
49
+ size?: 'small' | 'middle' | 'large';
50
+ /** Disables fields that read this value from form context. */
51
+ disabled?: boolean;
52
+ /** When `true`, appends a colon after labels that support it. */
53
+ colon?: boolean;
54
+ /** How required fields are marked in labels (`*` vs “optional”). */
55
+ requiredMark?: boolean | 'optional';
56
+ /** Label column grid settings (24-column) for horizontal layout. */
57
+ labelCol?: {
58
+ /** Column span (out of 24). */
59
+ span?: number;
60
+ /** Column offset (out of 24). */
61
+ offset?: number;
62
+ };
63
+ /** Control column grid settings (24-column) for horizontal layout. */
64
+ wrapperCol?: {
65
+ /** Column span (out of 24). */
66
+ span?: number;
67
+ /** Column offset (out of 24). */
68
+ offset?: number;
69
+ };
70
+ /** Text alignment for the label column. */
71
+ labelAlign?: 'left' | 'right';
72
+ /** Additional class names on the `<form>`. */
73
+ className?: string;
74
+ /** Inline styles on the `<form>`. */
75
+ style?: React__default.CSSProperties;
76
+ /** Form body content. */
77
+ children: React__default.ReactNode;
78
+ /** After submit, scroll the first invalid field into view (`true` uses smooth centering). */
79
+ scrollToFirstError?: boolean | ScrollIntoViewOptions;
80
+ /** Keeps unmounted field values in the form store. */
81
+ preserve?: boolean;
82
+ /** Events that trigger validation (passed through to form options). */
83
+ validateTrigger?: ValidationMode | ValidationMode[];
84
+ /** Custom icons shown for field feedback states. */
85
+ feedbackIcons?: {
86
+ /** Icon for successful validation. */
87
+ success?: React__default.ReactNode;
88
+ /** Icon for warning validation. */
89
+ warning?: React__default.ReactNode;
90
+ /** Icon for error validation. */
91
+ error?: React__default.ReactNode;
92
+ /** Icon while async validation is running. */
93
+ validating?: React__default.ReactNode;
94
+ };
95
+ /**
96
+ * Called with the form values when the form passes validation and submits.
97
+ * Alias for `onSubmit`. Both fire; if both are provided, `onSubmit` runs first.
98
+ */
99
+ onFinish?: (values: Record<string, unknown>) => void | Promise<void>;
100
+ /**
101
+ * Initial field values. Alias for `defaultValues` (the underlying Form
102
+ * engine option). When both are provided, `defaultValues` wins.
103
+ */
104
+ initialValues?: Record<string, unknown>;
105
+ }
106
+ /**
107
+ * Renders a `<form>` and provides {@link FormContext} for fields and lists.
108
+ * Submits via the engine’s `submit` and optionally scrolls to the first error.
109
+ */
110
+ declare function Form({ form: externalForm, name: formName, layout, size: sizeProp, disabled: disabledProp, colon, requiredMark, labelCol, wrapperCol, labelAlign, className, style, children, scrollToFirstError, preserve, feedbackIcons, onFinish, initialValues, ...formOptions }: FormProps): react_jsx_runtime.JSX.Element;
111
+
112
+ /** Props for a single named field with validation, layout, and optional custom control. */
113
+ interface FieldProps extends BaseComponentProps {
114
+ /** Registered path in the form store. */
115
+ name: string;
116
+ /** Visible label text; layout comes from {@link FormContext}. */
117
+ label?: string;
118
+ /** When `true`, prepends a required rule in addition to `rules`. */
119
+ required?: boolean;
120
+ /** Validation rules for this field.
121
+ * @default []
122
+ */
123
+ rules?: Rule[];
124
+ /** Rules that produce warnings without failing validation. */
125
+ warningRules?: Rule[];
126
+ /** Re-validates this field when any listed field changes. */
127
+ dependencies?: string[];
128
+ /** When `true`, the field renders nothing (values can remain registered). */
129
+ hidden?: boolean;
130
+ /** Disables the control; falls back to form context `disabled`. */
131
+ disabled?: boolean;
132
+ /** Placeholder for the built-in `Input` / `Textarea`. */
133
+ placeholder?: string;
134
+ /** Built-in control type when `children` is not provided.
135
+ * @default 'text'
136
+ */
137
+ type?: 'text' | 'email' | 'password' | 'number' | 'textarea';
138
+ /** Helper text shown below the control when there are no errors/warnings. */
139
+ help?: React__default.ReactNode;
140
+ /** Supplementary content below the control area. */
141
+ extra?: React__default.ReactNode;
142
+ /** Tooltip title wrapping the label text. */
143
+ tooltip?: string;
144
+ /** Custom control, render prop, or omit for default input/textarea. */
145
+ children?: React__default.ReactNode | ((field: UseFieldReturn) => React__default.ReactNode);
146
+ /** Renders only the control (validation wiring) without layout chrome. */
147
+ noStyle?: boolean;
148
+ /** Maps raw change values before committing to the store. */
149
+ normalize?: (value: unknown, prevValue: unknown) => unknown;
150
+ /** Custom extractor for control events (reserved for controlled wrappers). */
151
+ getValueFromEvent?: (...args: unknown[]) => unknown;
152
+ /** Prop name on the child that holds the value (for custom controls). */
153
+ valuePropName?: string;
154
+ /** Stops after the first failing rule when validating. */
155
+ validateFirst?: boolean;
156
+ /** Manual validation status badge; overrides engine-derived status when set. */
157
+ validateStatus?: 'success' | 'warning' | 'error' | 'validating';
158
+ /** Shows feedback icons when the field has been touched. */
159
+ hasFeedback?: boolean;
160
+ /** Keeps value on unregister; overrides form-level `preserve` when set. */
161
+ preserve?: boolean;
162
+ /** Overrides form `labelCol` for this field in horizontal layout. */
163
+ labelCol?: {
164
+ /** Column span (out of 24). */
165
+ span?: number;
166
+ /** Column offset (out of 24). */
167
+ offset?: number;
168
+ };
169
+ /** Overrides form `wrapperCol` for this field in horizontal layout. */
170
+ wrapperCol?: {
171
+ /** Column span (out of 24). */
172
+ span?: number;
173
+ /** Column offset (out of 24). */
174
+ offset?: number;
175
+ };
176
+ /** Template variables merged into validation messages for this field. */
177
+ messageVariables?: Record<string, string>;
178
+ }
179
+ /**
180
+ * Registers `name` with the form engine, renders label/help/errors, and either
181
+ * a built-in input or custom `children` / render-prop control.
182
+ */
183
+ declare function Field({ name, label, required, rules, warningRules, dependencies, hidden, disabled: fieldDisabled, unstyled, placeholder, type, help, extra, tooltip, children, noStyle, normalize, getValueFromEvent: _getValueFromEvent, validateFirst, validateStatus: manualStatus, hasFeedback, preserve, labelCol: fieldLabelCol, wrapperCol: fieldWrapperCol, messageVariables: _messageVariables, }: FieldProps): react_jsx_runtime.JSX.Element | null;
184
+
185
+ /** Props for a primary-styled submit {@link Button} used inside {@link Form}. */
186
+ interface SubmitButtonProps {
187
+ /** Button label; falls back when omitted in destructuring.
188
+ * @default 'Submit'
189
+ */
190
+ children?: React__default.ReactNode;
191
+ /** Disables the button. */
192
+ disabled?: boolean;
193
+ /** Shows a loading state on the button. */
194
+ loading?: boolean;
195
+ /** Extra class names passed to {@link Button}. */
196
+ className?: string;
197
+ /** Inline styles forwarded to the underlying {@link Button}. */
198
+ style?: React__default.CSSProperties;
199
+ /** Strips built-in button styles on the underlying {@link Button}. */
200
+ unstyled?: boolean;
201
+ }
202
+ /**
203
+ * `type="submit"` primary button; forwards disabled/loading and styling to {@link Button}.
204
+ */
205
+ declare function SubmitButton({ children, disabled, loading, className, style, unstyled, }: SubmitButtonProps): react_jsx_runtime.JSX.Element;
206
+
207
+ /** Values exposed by {@link FormContext} to descendant fields and hooks. */
208
+ interface FormContextValue {
209
+ /** Shared Skygraph core instance for the form tree. */
210
+ core: Core;
211
+ /** Form engine coordinating values, validation, and submit. */
212
+ form: FormEngine;
213
+ /** Active form layout from the nearest {@link Form}. */
214
+ layout?: 'horizontal' | 'vertical' | 'inline';
215
+ /** Active control size from the nearest {@link Form}. */
216
+ size?: 'small' | 'middle' | 'large';
217
+ /** Whether the form tree is disabled. */
218
+ disabled?: boolean;
219
+ /** Whether labels show a trailing colon. */
220
+ colon?: boolean;
221
+ /** Required/optional marking mode for labels. */
222
+ requiredMark?: boolean | 'optional';
223
+ /** Default label column grid for horizontal layout. */
224
+ labelCol?: {
225
+ /** Column span (out of 24). */
226
+ span?: number;
227
+ /** Column offset (out of 24). */
228
+ offset?: number;
229
+ };
230
+ /** Default control column grid for horizontal layout. */
231
+ wrapperCol?: {
232
+ /** Column span (out of 24). */
233
+ span?: number;
234
+ /** Column offset (out of 24). */
235
+ offset?: number;
236
+ };
237
+ /** Default label text alignment. */
238
+ labelAlign?: 'left' | 'right';
239
+ /** Whether unmounted field values are preserved. */
240
+ preserve?: boolean;
241
+ /** Icons used for field feedback states. */
242
+ feedbackIcons?: {
243
+ /** Success-state icon. */
244
+ success?: React__default.ReactNode;
245
+ /** Warning-state icon. */
246
+ warning?: React__default.ReactNode;
247
+ /** Error-state icon. */
248
+ error?: React__default.ReactNode;
249
+ /** Validating-state icon. */
250
+ validating?: React__default.ReactNode;
251
+ };
252
+ }
253
+ declare const FormContext: React__default.Context<FormContextValue | null>;
254
+ /**
255
+ * Returns the current `FormContextValue` from the nearest {@link Form}.
256
+ * @throws If used outside `<Form>`.
257
+ */
258
+ declare function useFormContext(): FormContextValue;
259
+
260
+ /** Stable identity and position of one row in a {@link FormList}. */
261
+ interface FormListField {
262
+ /** Stable React key for list reconciliation. */
263
+ key: string;
264
+ /** Zero-based index in the list value array. */
265
+ index: number;
266
+ }
267
+ /** Props for a dynamic array field bound to form state. */
268
+ interface FormListProps {
269
+ /** Field path in the form store holding the array value. */
270
+ name: string;
271
+ /** Seeds the store when the path is unset on first mount. */
272
+ initialValue?: unknown[];
273
+ /** When `true`, each row receives `dragProps` for HTML5 drag-and-drop reordering. */
274
+ draggable?: boolean;
275
+ /** Render function receiving fields, list operations, and validation meta. */
276
+ children: (fields: FormListField[], operation: FormListOperation, meta: {
277
+ errors: string[];
278
+ }) => React__default.ReactNode;
279
+ }
280
+ /**
281
+ * Manages an array at `name` with stable keys, add/remove/move/replace helpers,
282
+ * and optional drag reordering when `draggable` is enabled.
283
+ */
284
+ declare function FormList({ name, initialValue, draggable, children }: FormListProps): react_jsx_runtime.JSX.Element;
285
+
286
+ declare function useWatch(core: Core, name: string): unknown;
287
+
288
+ interface UseFieldArrayReturn {
289
+ fields: {
290
+ key: string;
291
+ index: number;
292
+ }[];
293
+ append: (defaultValue?: unknown) => void;
294
+ remove: (index: number) => void;
295
+ move: (from: number, to: number) => void;
296
+ replace: (values: unknown[]) => void;
297
+ }
298
+ declare function useFieldArray(form: FormEngine, name: string): UseFieldArrayReturn;
299
+
300
+ /** Supported input kinds for form field rendering and inference. */
301
+ type FieldType = 'string' | 'number' | 'boolean' | 'email' | 'url' | 'date' | 'time' | 'textarea' | 'select' | 'multiselect' | 'password' | 'color' | 'slider' | 'rate' | 'file' | 'switch' | 'radio';
302
+ /** Single choice label/value pair for select, multiselect, or radio fields. */
303
+ interface AutoFieldOption {
304
+ /** Display text for the option. */
305
+ label: string;
306
+ /** Stored value when the option is selected. */
307
+ value: string | number;
308
+ }
309
+ /** Props for a form field that picks its control from field name, value shape, and `type`. */
310
+ interface AutoFieldProps extends BaseComponentProps, InteractiveProps {
311
+ /** Form field key used with `useFormContext`. */
312
+ name: string;
313
+ /** Caption shown above the control (or inline for checkbox/switch). */
314
+ label?: React__default.ReactNode;
315
+ /** Forces a control type; otherwise inferred from value and `options`. */
316
+ type?: FieldType;
317
+ /** Options for select, multiselect, or radio types. */
318
+ options?: AutoFieldOption[];
319
+ /** Placeholder or empty-option label where applicable. */
320
+ placeholder?: string;
321
+ /** Minimum numeric or range value. */
322
+ min?: number;
323
+ /** Maximum numeric, range, or star rating count. */
324
+ max?: number;
325
+ /** Step for number inputs and range sliders. */
326
+ step?: number;
327
+ /** `accept` attribute for file inputs. */
328
+ accept?: string;
329
+ /** Allows multiple files when type is `file`. */
330
+ multiple?: boolean;
331
+ }
332
+ /**
333
+ * Renders an appropriate input for a form field based on `type`, options, and current value.
334
+ * Reads and writes through `FormContext` using `name`.
335
+ */
336
+ declare function AutoField(props: AutoFieldProps): react_jsx_runtime.JSX.Element;
337
+
338
+ interface JSONSchemaProperty {
339
+ type?: string;
340
+ title?: string;
341
+ description?: string;
342
+ default?: unknown;
343
+ enum?: unknown[];
344
+ enumNames?: string[];
345
+ minimum?: number;
346
+ maximum?: number;
347
+ minLength?: number;
348
+ maxLength?: number;
349
+ pattern?: string;
350
+ format?: string;
351
+ items?: JSONSchemaProperty;
352
+ required?: string[];
353
+ properties?: Record<string, JSONSchemaProperty>;
354
+ oneOf?: Array<{
355
+ const: unknown;
356
+ title?: string;
357
+ }>;
358
+ }
359
+ interface JSONSchema extends JSONSchemaProperty {
360
+ $schema?: string;
361
+ }
362
+ interface AutoFieldConfig {
363
+ name: string;
364
+ label?: string;
365
+ type: FieldType;
366
+ placeholder?: string;
367
+ options?: AutoFieldOption[];
368
+ min?: number;
369
+ max?: number;
370
+ step?: number;
371
+ }
372
+ declare function jsonSchemaToFields(schema: JSONSchema): AutoFieldConfig[];
373
+ declare function jsonSchemaToRules(schema: JSONSchema): Record<string, Rule[]>;
374
+ declare function jsonSchemaToDefaults(schema: JSONSchema): Record<string, unknown>;
375
+
376
+ /**
377
+ * Zod schema adapter. Converts a Zod schema (or any schema with .safeParse)
378
+ * into SkyGraph form rules.
379
+ *
380
+ * Works with Zod v3/v4 or any library that implements:
381
+ * { safeParse(value: unknown): { success: boolean; error?: { issues: Array<{ message: string }> } } }
382
+ */
383
+ interface ZodLikeSchema {
384
+ safeParse(value: unknown): {
385
+ success: boolean;
386
+ error?: {
387
+ issues: Array<{
388
+ message: string;
389
+ path?: (string | number)[];
390
+ }>;
391
+ };
392
+ };
393
+ }
394
+ interface ZodAdapterOptions {
395
+ /** Custom error message override */
396
+ message?: string;
397
+ /** Which issue to pick when multiple exist (default: 'first') */
398
+ pick?: 'first' | 'all';
399
+ }
400
+ /**
401
+ * Convert a single Zod schema into a SkyGraph Rule for one field.
402
+ */
403
+ declare function zodRule(schema: ZodLikeSchema, options?: ZodAdapterOptions): Rule;
404
+ /**
405
+ * Convert a Zod object schema into a map of field name -> Rule[].
406
+ * Useful for auto-registering all fields from a schema.
407
+ */
408
+ interface ZodObjectLikeSchema {
409
+ shape: Record<string, ZodLikeSchema>;
410
+ }
411
+ declare function zodRules(schema: ZodObjectLikeSchema, options?: ZodAdapterOptions): Record<string, Rule[]>;
412
+ /**
413
+ * Extract default values from a Zod schema.
414
+ * Uses safeParse(undefined) to trigger Zod's .default() mechanism,
415
+ * then reads the parsed data for the actual default value.
416
+ */
417
+ declare function zodDefaults(schema: ZodObjectLikeSchema): Record<string, unknown>;
418
+ interface ZodDef {
419
+ typeName?: string;
420
+ checks?: Array<{
421
+ kind: string;
422
+ value?: unknown;
423
+ regex?: RegExp;
424
+ message?: string;
425
+ }>;
426
+ values?: unknown[];
427
+ innerType?: {
428
+ _def: ZodDef;
429
+ };
430
+ type?: {
431
+ _def: ZodDef;
432
+ };
433
+ options?: Array<{
434
+ _def: ZodDef;
435
+ }>;
436
+ }
437
+ interface ZodFieldSchema {
438
+ _def: ZodDef;
439
+ description?: string;
440
+ }
441
+ interface ZodObjectSchema {
442
+ _def: ZodDef;
443
+ shape?: Record<string, ZodFieldSchema>;
444
+ }
445
+ /**
446
+ * Converts a Zod schema to a minimal JSON Schema representation for SchemaForm.
447
+ */
448
+ declare function zodToJsonSchema(schema: ZodObjectSchema): JSONSchema;
449
+
450
+ interface FormProviderContextValue {
451
+ registerForm: (name: string, form: FormEngine) => void;
452
+ unregisterForm: (name: string) => void;
453
+ onFormFinish?: (name: string, info: {
454
+ values: Record<string, unknown>;
455
+ forms: Record<string, FormEngine>;
456
+ }) => void;
457
+ onFormChange?: (name: string, info: {
458
+ changedFields: string[];
459
+ forms: Record<string, FormEngine>;
460
+ }) => void;
461
+ }
462
+ /** Props for a registry of named forms and their lifecycle callbacks. */
463
+ interface FormProviderProps {
464
+ /** Called after a registered form finishes submit successfully. */
465
+ onFormFinish?: (name: string, info: {
466
+ values: Record<string, unknown>;
467
+ forms: Record<string, FormEngine>;
468
+ }) => void;
469
+ /** Called when values change in a registered form. */
470
+ onFormChange?: (name: string, info: {
471
+ changedFields: string[];
472
+ forms: Record<string, FormEngine>;
473
+ }) => void;
474
+ /** Tree of forms and other UI that may register with this provider. */
475
+ children: React__default.ReactNode;
476
+ }
477
+ /**
478
+ * Provides a context so named {@link Form} instances can register and report
479
+ * `onFormFinish` / `onFormChange` to a single parent.
480
+ */
481
+ declare function FormProvider({ onFormFinish, onFormChange, children }: FormProviderProps): react_jsx_runtime.JSX.Element;
482
+ /**
483
+ * Returns the optional multi-form provider context, or `null` if there is no {@link FormProvider}.
484
+ */
485
+ declare function useFormProvider(): FormProviderContextValue | null;
486
+
487
+ /** Builds a {@link Form} from JSON Schema or Zod (converted to JSON Schema) with {@link Field} + {@link AutoField} rows. */
488
+ interface SchemaFormProps extends BaseComponentProps, SizableProps {
489
+ /** JSON Schema object or a Zod schema (`_def` present) to derive fields and rules. */
490
+ schema: JSONSchema | {
491
+ _def?: unknown;
492
+ };
493
+ /** Called with all values on successful submit. */
494
+ onSubmit?: (values: Record<string, unknown>) => void | Promise<void>;
495
+ /** Passed through to the inner {@link Form}. */
496
+ layout?: 'horizontal' | 'vertical' | 'inline';
497
+ /** Disables generated controls and the inner {@link Form}. */
498
+ disabled?: boolean;
499
+ /** External form instance; otherwise an internal `useForm` is created with schema defaults. */
500
+ form?: UseFormReturn;
501
+ /** Passed through to the inner {@link Form}. */
502
+ labelCol?: {
503
+ /** Column span (out of 24). */
504
+ span?: number;
505
+ /** Column offset (out of 24). */
506
+ offset?: number;
507
+ };
508
+ /** Passed through to the inner {@link Form}. */
509
+ wrapperCol?: {
510
+ /** Column span (out of 24). */
511
+ span?: number;
512
+ /** Column offset (out of 24). */
513
+ offset?: number;
514
+ };
515
+ className?: string;
516
+ style?: React__default.CSSProperties;
517
+ /** Label for the default submit button when `children` is omitted.
518
+ * @default 'Submit'
519
+ */
520
+ submitText?: string;
521
+ /** Replaces the default submit button; omit to use a primary `<button type="submit">`. */
522
+ children?: React__default.ReactNode;
523
+ }
524
+ /**
525
+ * Generates fields from `schema`, wires validation, and wraps them in {@link Form}.
526
+ * Supports Zod input by converting it to JSON Schema first.
527
+ */
528
+ declare function SchemaForm({ schema: rawSchema, onSubmit, layout, size, disabled, form: externalForm, labelCol, wrapperCol, className, style, submitText: submitTextProp, children, }: SchemaFormProps): react_jsx_runtime.JSX.Element;
529
+
530
+ export { AutoField, type AutoFieldConfig, type AutoFieldOption, type AutoFieldProps, Field, type FieldProps, type FieldType, Form, FormContext, FormList, type FormListField, type FormListProps, type FormProps, FormProvider, type FormProviderProps, type JSONSchema, type JSONSchemaProperty, SchemaForm, type SchemaFormProps, SubmitButton, type SubmitButtonProps, type UseFieldArrayReturn, type UseFieldReturn, type UseFormOptions, type UseFormReturn, type ZodAdapterOptions, type ZodLikeSchema, type ZodObjectLikeSchema, jsonSchemaToDefaults, jsonSchemaToFields, jsonSchemaToRules, useField, useFieldArray, useForm, useFormContext, useFormProvider, useWatch, zodDefaults, zodRule, zodRules, zodToJsonSchema };