@btst/stack 2.6.0 → 2.6.2

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 (165) hide show
  1. package/dist/components/auto-form/index.cjs +8 -0
  2. package/dist/components/auto-form/index.d.cts +26 -0
  3. package/dist/components/auto-form/index.d.mts +26 -0
  4. package/dist/components/auto-form/index.d.ts +26 -0
  5. package/dist/components/auto-form/index.mjs +1 -0
  6. package/dist/components/empty/index.cjs +12 -0
  7. package/dist/components/empty/index.d.cts +15 -0
  8. package/dist/components/empty/index.d.mts +15 -0
  9. package/dist/components/empty/index.d.ts +15 -0
  10. package/dist/components/empty/index.mjs +1 -0
  11. package/dist/components/form-builder/index.cjs +16 -0
  12. package/dist/components/form-builder/index.d.cts +385 -0
  13. package/dist/components/form-builder/index.d.mts +385 -0
  14. package/dist/components/form-builder/index.d.ts +385 -0
  15. package/dist/components/form-builder/index.mjs +4 -0
  16. package/dist/components/markdown/index.cjs +9 -0
  17. package/dist/components/markdown/index.d.cts +30 -0
  18. package/dist/components/markdown/index.d.mts +30 -0
  19. package/dist/components/markdown/index.d.ts +30 -0
  20. package/dist/components/markdown/index.mjs +2 -0
  21. package/dist/components/markdown/style.css +394 -0
  22. package/dist/components/minimal-tiptap/style.css +548 -0
  23. package/dist/components/multi-select/index.cjs +7 -0
  24. package/dist/components/multi-select/index.d.cts +78 -0
  25. package/dist/components/multi-select/index.d.mts +78 -0
  26. package/dist/components/multi-select/index.d.ts +78 -0
  27. package/dist/components/multi-select/index.mjs +1 -0
  28. package/dist/components/search-select/index.cjs +7 -0
  29. package/dist/components/search-select/index.d.cts +15 -0
  30. package/dist/components/search-select/index.d.mts +15 -0
  31. package/dist/components/search-select/index.d.ts +15 -0
  32. package/dist/components/search-select/index.mjs +1 -0
  33. package/dist/components/stepped-auto-form/index.cjs +7 -0
  34. package/dist/components/stepped-auto-form/index.d.cts +37 -0
  35. package/dist/components/stepped-auto-form/index.d.mts +37 -0
  36. package/dist/components/stepped-auto-form/index.d.ts +37 -0
  37. package/dist/components/stepped-auto-form/index.mjs +1 -0
  38. package/dist/components/ui-builder/style.css +552 -0
  39. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.cjs +1 -1
  40. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +1 -1
  41. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs +2 -2
  42. package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +1 -1
  43. package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +3 -3
  44. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +1 -1
  45. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.cjs +20 -2
  46. package/dist/packages/stack/src/plugins/ai-chat/client/components/chat-layout.mjs +20 -2
  47. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.cjs +23 -0
  48. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.mjs +21 -0
  49. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.cjs +11 -12
  50. package/dist/packages/stack/src/plugins/blog/client/components/forms/markdown-editor.mjs +11 -12
  51. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.cjs +2 -2
  52. package/dist/packages/stack/src/plugins/blog/client/components/forms/post-forms.mjs +2 -2
  53. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.cjs +0 -3
  54. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-input.mjs +1 -1
  55. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.cjs +0 -3
  56. package/dist/packages/stack/src/plugins/blog/client/components/shared/search-modal.mjs +1 -1
  57. package/dist/packages/ui/src/components/auto-form/index.cjs +12 -2
  58. package/dist/packages/ui/src/components/auto-form/index.mjs +9 -2
  59. package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +2 -2
  60. package/dist/packages/ui/src/components/empty.cjs +28 -0
  61. package/dist/packages/ui/src/components/empty.mjs +27 -1
  62. package/dist/packages/ui/src/components/form-builder/components/index.mjs +2 -2
  63. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +1 -1
  64. package/dist/packages/ui/src/components/form-builder/index.mjs +2 -2
  65. package/dist/packages/ui/src/components/form.mjs +1 -1
  66. package/dist/packages/ui/src/components/kanban.mjs +1 -1
  67. package/dist/packages/ui/src/components/multi-select.mjs +2 -2
  68. package/dist/packages/ui/src/components/ui-builder/internal/config-panel.cjs +1 -1
  69. package/dist/packages/ui/src/components/ui-builder/internal/props-panel.cjs +1 -1
  70. package/dist/plugins/ai-chat/client/components/index.d.cts +1 -1
  71. package/dist/plugins/ai-chat/client/components/index.d.mts +1 -1
  72. package/dist/plugins/ai-chat/client/components/index.d.ts +1 -1
  73. package/dist/plugins/ai-chat/client/index.d.cts +2 -2
  74. package/dist/plugins/ai-chat/client/index.d.mts +2 -2
  75. package/dist/plugins/ai-chat/client/index.d.ts +2 -2
  76. package/dist/plugins/blog/api/index.d.cts +2 -2
  77. package/dist/plugins/blog/api/index.d.mts +2 -2
  78. package/dist/plugins/blog/api/index.d.ts +2 -2
  79. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  80. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  81. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  82. package/dist/plugins/blog/client/index.d.cts +2 -2
  83. package/dist/plugins/blog/client/index.d.mts +2 -2
  84. package/dist/plugins/blog/client/index.d.ts +2 -2
  85. package/dist/plugins/blog/query-keys.d.cts +2 -2
  86. package/dist/plugins/blog/query-keys.d.mts +2 -2
  87. package/dist/plugins/blog/query-keys.d.ts +2 -2
  88. package/dist/plugins/cms/client/index.d.cts +1 -1
  89. package/dist/plugins/cms/client/index.d.mts +1 -1
  90. package/dist/plugins/cms/client/index.d.ts +1 -1
  91. package/dist/plugins/form-builder/client/components/index.d.cts +1 -1
  92. package/dist/plugins/form-builder/client/components/index.d.mts +1 -1
  93. package/dist/plugins/form-builder/client/components/index.d.ts +1 -1
  94. package/dist/plugins/form-builder/client/index.d.cts +1 -1
  95. package/dist/plugins/form-builder/client/index.d.mts +1 -1
  96. package/dist/plugins/form-builder/client/index.d.ts +1 -1
  97. package/dist/plugins/kanban/api/index.d.cts +1 -1
  98. package/dist/plugins/kanban/api/index.d.mts +1 -1
  99. package/dist/plugins/kanban/api/index.d.ts +1 -1
  100. package/dist/plugins/kanban/query-keys.d.cts +1 -1
  101. package/dist/plugins/kanban/query-keys.d.mts +1 -1
  102. package/dist/plugins/kanban/query-keys.d.ts +1 -1
  103. package/dist/plugins/ui-builder/client/components/index.d.cts +2 -2
  104. package/dist/plugins/ui-builder/client/components/index.d.mts +2 -2
  105. package/dist/plugins/ui-builder/client/components/index.d.ts +2 -2
  106. package/dist/plugins/ui-builder/client/hooks/index.d.cts +3 -3
  107. package/dist/plugins/ui-builder/client/hooks/index.d.mts +3 -3
  108. package/dist/plugins/ui-builder/client/hooks/index.d.ts +3 -3
  109. package/dist/plugins/ui-builder/client/index.d.cts +3 -3
  110. package/dist/plugins/ui-builder/client/index.d.mts +3 -3
  111. package/dist/plugins/ui-builder/client/index.d.ts +3 -3
  112. package/dist/plugins/ui-builder/index.d.cts +3 -3
  113. package/dist/plugins/ui-builder/index.d.mts +3 -3
  114. package/dist/plugins/ui-builder/index.d.ts +3 -3
  115. package/dist/shared/{stack.B2DwzF3r.d.ts → stack.ASwEoINr.d.ts} +1 -1
  116. package/dist/shared/{stack.C5ZSOJGJ.d.cts → stack.B1srlBud.d.mts} +1 -1
  117. package/dist/shared/{stack.CQAZwXhV.d.cts → stack.B8vT-Yt4.d.mts} +3 -3
  118. package/dist/shared/{stack.D3BsrpAz.d.ts → stack.BAT540yW.d.ts} +3 -3
  119. package/dist/shared/{stack.D0QupDcQ.d.ts → stack.BK9Z2dcL.d.ts} +1 -1
  120. package/dist/shared/{stack.CNLHlv7r.d.mts → stack.BwA7trxA.d.cts} +3 -3
  121. package/dist/shared/{stack.Cl7ok_cY.d.cts → stack.CFECM0ew.d.cts} +1 -1
  122. package/dist/shared/stack.CZMWR72v.d.cts +10 -0
  123. package/dist/shared/stack.CZMWR72v.d.mts +10 -0
  124. package/dist/shared/stack.CZMWR72v.d.ts +10 -0
  125. package/dist/shared/{stack.VMmQdbsJ.d.mts → stack.DVtk5CNw.d.mts} +1 -1
  126. package/dist/shared/{stack.B8_74ror.d.ts → stack.DXnclTG7.d.ts} +4 -4
  127. package/dist/shared/{stack.CL4mKxe7.d.mts → stack.DaZM10cp.d.cts} +4 -4
  128. package/dist/shared/{stack.Dq4qVr1F.d.mts → stack.DmpPDPxA.d.cts} +1 -1
  129. package/dist/shared/{stack.C21-LFX8.d.cts → stack.cfCkioTe.d.mts} +4 -4
  130. package/dist/shared/stack.fdi94T4S.d.cts +291 -0
  131. package/dist/shared/stack.fdi94T4S.d.mts +291 -0
  132. package/dist/shared/stack.fdi94T4S.d.ts +291 -0
  133. package/dist/shared/{stack.BV9hnvu4.d.cts → stack.sba323Ml.d.cts} +2 -0
  134. package/dist/shared/{stack.BV9hnvu4.d.mts → stack.sba323Ml.d.mts} +2 -0
  135. package/dist/shared/{stack.BV9hnvu4.d.ts → stack.sba323Ml.d.ts} +2 -0
  136. package/package.json +97 -3
  137. package/src/components/auto-form/index.ts +12 -0
  138. package/src/components/empty/index.ts +8 -0
  139. package/src/components/form-builder/index.ts +23 -0
  140. package/src/components/kanban/index.ts +9 -0
  141. package/src/components/markdown/index.ts +5 -0
  142. package/src/components/markdown/style.css +3 -0
  143. package/src/components/minimal-tiptap/index.ts +5 -0
  144. package/src/components/minimal-tiptap/style.css +1 -0
  145. package/src/components/multi-select/index.ts +5 -0
  146. package/src/components/search-select/index.ts +1 -0
  147. package/src/components/stepped-auto-form/index.ts +5 -0
  148. package/src/components/ui-builder/index.ts +50 -0
  149. package/src/components/ui-builder/style.css +5 -0
  150. package/src/plugins/ai-chat/client/components/chat-layout.tsx +22 -1
  151. package/src/plugins/blog/client/components/forms/markdown-editor-with-overrides.tsx +29 -0
  152. package/src/plugins/blog/client/components/forms/markdown-editor.tsx +24 -21
  153. package/src/plugins/blog/client/components/forms/post-forms.tsx +2 -2
  154. package/src/plugins/blog/client/components/shared/posts-list.tsx +1 -1
  155. package/src/plugins/blog/client/components/shared/search-input.tsx +0 -2
  156. package/src/plugins/blog/client/components/shared/search-modal.tsx +0 -2
  157. package/dist/shared/stack.8nldKomx.d.cts +0 -114
  158. package/dist/shared/stack.8nldKomx.d.mts +0 -114
  159. package/dist/shared/stack.8nldKomx.d.ts +0 -114
  160. package/dist/shared/{stack.BWp0hcm9.d.cts → stack.BQmuNl5p.d.cts} +3 -3
  161. package/dist/shared/{stack.BWp0hcm9.d.mts → stack.BQmuNl5p.d.mts} +3 -3
  162. package/dist/shared/{stack.BWp0hcm9.d.ts → stack.BQmuNl5p.d.ts} +3 -3
  163. package/dist/shared/{stack.Ba_Ks8qi.d.mts → stack.CxaFNQCV.d.mts} +9 -9
  164. package/dist/shared/{stack.DMobugrZ.d.ts → stack.j75TpKh2.d.ts} +9 -9
  165. package/dist/shared/{stack.CFqqZUes.d.cts → stack.n1_i1p2B.d.cts} +9 -9
@@ -0,0 +1,291 @@
1
+ import { ControllerRenderProps, FieldValues } from 'react-hook-form';
2
+ import * as zod from 'zod';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
6
+
7
+ declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
8
+
9
+ declare function AutoFormEnum({ label, isRequired, field, fieldConfigItem, zodItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
10
+
11
+ declare function AutoFormInput({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
12
+
13
+ declare function AutoFormNumber({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
14
+
15
+ declare function AutoFormRadioGroup({ label, isRequired, field, zodItem, fieldProps, fieldConfigItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
16
+
17
+ declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
18
+
19
+ declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
20
+
21
+ declare const INPUT_COMPONENTS: {
22
+ checkbox: typeof AutoFormCheckbox;
23
+ date: typeof AutoFormDate;
24
+ select: typeof AutoFormEnum;
25
+ radio: typeof AutoFormRadioGroup;
26
+ switch: typeof AutoFormSwitch;
27
+ textarea: typeof AutoFormTextarea;
28
+ number: typeof AutoFormNumber;
29
+ fallback: typeof AutoFormInput;
30
+ };
31
+
32
+ /**
33
+ * Common input props shared by all field types.
34
+ */
35
+ interface BaseInputProps {
36
+ /** Whether the field is disabled */
37
+ disabled?: boolean;
38
+ /** Whether the field is read-only */
39
+ readOnly?: boolean;
40
+ /** Whether the field is required */
41
+ required?: boolean;
42
+ /** Whether to show the label (auto-form specific) */
43
+ showLabel?: boolean;
44
+ }
45
+ /**
46
+ * Input props for string-backed fields (text, email, password, url, phone, textarea).
47
+ */
48
+ interface StringInputProps extends BaseInputProps {
49
+ /** Placeholder text */
50
+ placeholder?: string;
51
+ /** HTML input type (text, email, password, tel, url) */
52
+ type?: "text" | "email" | "password" | "tel" | "url" | string;
53
+ /** Default value */
54
+ defaultValue?: string;
55
+ /** Minimum length */
56
+ minLength?: number;
57
+ /** Maximum length */
58
+ maxLength?: number;
59
+ /** Regex pattern for validation */
60
+ pattern?: string;
61
+ /** Autocomplete hint */
62
+ autoComplete?: string;
63
+ }
64
+ /**
65
+ * Input props for number-backed fields.
66
+ */
67
+ interface NumberInputProps extends BaseInputProps {
68
+ /** Placeholder text */
69
+ placeholder?: string;
70
+ /** Default value */
71
+ defaultValue?: number;
72
+ /** Minimum value */
73
+ min?: number;
74
+ /** Maximum value */
75
+ max?: number;
76
+ /** Step value for increment/decrement */
77
+ step?: number;
78
+ }
79
+ /**
80
+ * Input props for boolean-backed fields (checkbox, switch).
81
+ */
82
+ interface BooleanInputProps extends BaseInputProps {
83
+ /** Default value */
84
+ defaultValue?: boolean;
85
+ }
86
+ /**
87
+ * Input props for date-backed fields.
88
+ */
89
+ interface DateInputProps extends BaseInputProps {
90
+ /** Default value as ISO string or Date */
91
+ defaultValue?: string | Date;
92
+ /** Minimum date as ISO string */
93
+ min?: string;
94
+ /** Maximum date as ISO string */
95
+ max?: string;
96
+ }
97
+ /**
98
+ * Input props for enum-backed fields (select, radio).
99
+ */
100
+ interface EnumInputProps extends BaseInputProps {
101
+ /** Placeholder text (for select) */
102
+ placeholder?: string;
103
+ /** Default value (must match one of the enum options) */
104
+ defaultValue?: string;
105
+ }
106
+ /**
107
+ * Generic input props that accept any field type.
108
+ * Use this when the backing type is not known at compile time.
109
+ *
110
+ * This is the catch-all type used for runtime flexibility.
111
+ */
112
+ interface SerializableInputProps extends BaseInputProps {
113
+ placeholder?: string;
114
+ type?: string;
115
+ defaultValue?: unknown;
116
+ min?: number | string;
117
+ max?: number | string;
118
+ step?: number | string;
119
+ minLength?: number;
120
+ maxLength?: number;
121
+ pattern?: string;
122
+ autoComplete?: string;
123
+ /** Allow additional props for extensibility */
124
+ [key: string]: unknown;
125
+ }
126
+ /**
127
+ * Maps backing Zod types to their corresponding input props type.
128
+ */
129
+ interface InputPropsByBackingType {
130
+ string: StringInputProps;
131
+ number: NumberInputProps;
132
+ boolean: BooleanInputProps;
133
+ date: DateInputProps;
134
+ enum: EnumInputProps;
135
+ }
136
+ /**
137
+ * Built-in field types supported by auto-form.
138
+ */
139
+ type AutoFormBuiltinFieldType = keyof typeof INPUT_COMPONENTS;
140
+ /**
141
+ * Field types that can be specified in JSON Schema.
142
+ * Either a built-in type name or a custom component.
143
+ */
144
+ type FieldType = AutoFormBuiltinFieldType | (string & {});
145
+ /**
146
+ * JSON Schema property with form-builder and auto-form metadata.
147
+ *
148
+ * This is the intermediate format used when:
149
+ * - form-builder serializes field configurations
150
+ * - auto-form parses JSON Schema to build field configs
151
+ */
152
+ interface JSONSchemaPropertyBase {
153
+ /** JSON Schema type */
154
+ type?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
155
+ /** Human-readable title (JSON Schema standard) */
156
+ title?: string;
157
+ /** Description text */
158
+ description?: string;
159
+ /** Default value */
160
+ default?: unknown;
161
+ /** Enum values for select/radio fields */
162
+ enum?: (string | number | boolean | null)[];
163
+ /** Minimum value for numbers */
164
+ minimum?: number;
165
+ /** Maximum value for numbers */
166
+ maximum?: number;
167
+ /** Exclusive minimum for numbers */
168
+ exclusiveMinimum?: number;
169
+ /** Exclusive maximum for numbers */
170
+ exclusiveMaximum?: number;
171
+ /** Minimum length for strings */
172
+ minLength?: number;
173
+ /** Maximum length for strings */
174
+ maxLength?: number;
175
+ /** Regex pattern for strings */
176
+ pattern?: string;
177
+ /** Format hint (email, uri, date-time, etc.) */
178
+ format?: string;
179
+ /** Multiple of constraint for numbers */
180
+ multipleOf?: number;
181
+ /** Properties for object types */
182
+ properties?: Record<string, JSONSchemaPropertyBase>;
183
+ /** Required fields for object types */
184
+ required?: string[];
185
+ /** Additional properties allowed for objects */
186
+ additionalProperties?: boolean;
187
+ /** Item schema for array types */
188
+ items?: JSONSchemaPropertyBase;
189
+ /** Display label (form-builder/auto-form) */
190
+ label?: string;
191
+ /** Field type override (checkbox, date, select, radio, switch, textarea, etc.) */
192
+ fieldType?: FieldType;
193
+ /** Placeholder text */
194
+ placeholder?: string;
195
+ /** HTML input type (text, email, password, tel, etc.) */
196
+ inputType?: string;
197
+ /** Additional input props */
198
+ inputProps?: SerializableInputProps;
199
+ /** Display order */
200
+ order?: number;
201
+ /** Minimum date as ISO string */
202
+ formatMinimum?: string;
203
+ /** Maximum date as ISO string */
204
+ formatMaximum?: string;
205
+ }
206
+
207
+ /**
208
+ * Input props for form fields.
209
+ *
210
+ * This is the runtime type that accepts any input props.
211
+ * For type-safe props, use the discriminated types:
212
+ * - StringInputProps for text inputs
213
+ * - NumberInputProps for number inputs
214
+ * - BooleanInputProps for checkboxes/switches
215
+ * - DateInputProps for date pickers
216
+ * - EnumInputProps for selects/radios
217
+ */
218
+ type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
219
+ /**
220
+ * Configuration for a single field in AutoForm.
221
+ *
222
+ * Note: This type is designed to align with form-builder's FormBuilderFieldProps
223
+ * so that JSON Schema properties can be easily converted to field configs.
224
+ */
225
+ type FieldConfigItem = {
226
+ /** Description text or React node */
227
+ description?: React.ReactNode;
228
+ /** Input props passed to the field component */
229
+ inputProps?: FieldInputProps;
230
+ /** Display label */
231
+ label?: string;
232
+ /** Field type override - built-in type or custom component */
233
+ fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
234
+ /** Wrapper component for custom field layout */
235
+ renderParent?: (props: {
236
+ children: React.ReactNode;
237
+ }) => React.ReactElement | null;
238
+ /** Display order for field ordering */
239
+ order?: number;
240
+ };
241
+ /**
242
+ * FieldConfig for nested objects - allows both FieldConfigItem properties
243
+ * AND nested field configs for child properties.
244
+ */
245
+ type FieldConfigObject = FieldConfigItem & {
246
+ [key: string]: FieldConfigItem | FieldConfigObject | undefined;
247
+ };
248
+ /**
249
+ * For object fields, allow both FieldConfigItem properties (label, description, etc.)
250
+ * AND nested field configs for the object's properties.
251
+ */
252
+ type FieldConfig<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
253
+ [Key in keyof SchemaType]?: FieldConfigItem | FieldConfigObject;
254
+ };
255
+ declare enum DependencyType {
256
+ DISABLES = 0,
257
+ REQUIRES = 1,
258
+ HIDES = 2,
259
+ SETS_OPTIONS = 3
260
+ }
261
+ type BaseDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
262
+ sourceField: keyof SchemaType;
263
+ type: DependencyType;
264
+ targetField: keyof SchemaType;
265
+ when: (sourceFieldValue: any, targetFieldValue: any) => boolean;
266
+ };
267
+ type ValueDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
268
+ type: DependencyType.DISABLES | DependencyType.REQUIRES | DependencyType.HIDES;
269
+ };
270
+ type EnumValues = readonly [string, ...string[]];
271
+ type OptionsDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
272
+ type: DependencyType.SETS_OPTIONS;
273
+ options: EnumValues;
274
+ };
275
+ type Dependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = ValueDependency<SchemaType> | OptionsDependency<SchemaType>;
276
+ /**
277
+ * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
278
+ */
279
+ type AutoFormInputComponentProps = {
280
+ zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
281
+ field: ControllerRenderProps<FieldValues, any>;
282
+ fieldConfigItem: FieldConfigItem;
283
+ label: string;
284
+ isRequired: boolean;
285
+ fieldProps: any;
286
+ zodItem: zod.ZodType;
287
+ className?: string;
288
+ };
289
+
290
+ export { DependencyType as b };
291
+ export type { AutoFormInputComponentProps as A, Dependency as D, FieldConfigItem as F, InputPropsByBackingType as I, JSONSchemaPropertyBase as J, SerializableInputProps as S, FieldConfig as a, FieldType as c };
@@ -0,0 +1,291 @@
1
+ import { ControllerRenderProps, FieldValues } from 'react-hook-form';
2
+ import * as zod from 'zod';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ declare function AutoFormCheckbox({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
6
+
7
+ declare function AutoFormDate({ label, isRequired, field, fieldConfigItem, fieldProps, zodItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
8
+
9
+ declare function AutoFormEnum({ label, isRequired, field, fieldConfigItem, zodItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
10
+
11
+ declare function AutoFormInput({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
12
+
13
+ declare function AutoFormNumber({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
14
+
15
+ declare function AutoFormRadioGroup({ label, isRequired, field, zodItem, fieldProps, fieldConfigItem, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
16
+
17
+ declare function AutoFormSwitch({ label, isRequired, field, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
18
+
19
+ declare function AutoFormTextarea({ label, isRequired, fieldConfigItem, fieldProps, }: AutoFormInputComponentProps): react_jsx_runtime.JSX.Element;
20
+
21
+ declare const INPUT_COMPONENTS: {
22
+ checkbox: typeof AutoFormCheckbox;
23
+ date: typeof AutoFormDate;
24
+ select: typeof AutoFormEnum;
25
+ radio: typeof AutoFormRadioGroup;
26
+ switch: typeof AutoFormSwitch;
27
+ textarea: typeof AutoFormTextarea;
28
+ number: typeof AutoFormNumber;
29
+ fallback: typeof AutoFormInput;
30
+ };
31
+
32
+ /**
33
+ * Common input props shared by all field types.
34
+ */
35
+ interface BaseInputProps {
36
+ /** Whether the field is disabled */
37
+ disabled?: boolean;
38
+ /** Whether the field is read-only */
39
+ readOnly?: boolean;
40
+ /** Whether the field is required */
41
+ required?: boolean;
42
+ /** Whether to show the label (auto-form specific) */
43
+ showLabel?: boolean;
44
+ }
45
+ /**
46
+ * Input props for string-backed fields (text, email, password, url, phone, textarea).
47
+ */
48
+ interface StringInputProps extends BaseInputProps {
49
+ /** Placeholder text */
50
+ placeholder?: string;
51
+ /** HTML input type (text, email, password, tel, url) */
52
+ type?: "text" | "email" | "password" | "tel" | "url" | string;
53
+ /** Default value */
54
+ defaultValue?: string;
55
+ /** Minimum length */
56
+ minLength?: number;
57
+ /** Maximum length */
58
+ maxLength?: number;
59
+ /** Regex pattern for validation */
60
+ pattern?: string;
61
+ /** Autocomplete hint */
62
+ autoComplete?: string;
63
+ }
64
+ /**
65
+ * Input props for number-backed fields.
66
+ */
67
+ interface NumberInputProps extends BaseInputProps {
68
+ /** Placeholder text */
69
+ placeholder?: string;
70
+ /** Default value */
71
+ defaultValue?: number;
72
+ /** Minimum value */
73
+ min?: number;
74
+ /** Maximum value */
75
+ max?: number;
76
+ /** Step value for increment/decrement */
77
+ step?: number;
78
+ }
79
+ /**
80
+ * Input props for boolean-backed fields (checkbox, switch).
81
+ */
82
+ interface BooleanInputProps extends BaseInputProps {
83
+ /** Default value */
84
+ defaultValue?: boolean;
85
+ }
86
+ /**
87
+ * Input props for date-backed fields.
88
+ */
89
+ interface DateInputProps extends BaseInputProps {
90
+ /** Default value as ISO string or Date */
91
+ defaultValue?: string | Date;
92
+ /** Minimum date as ISO string */
93
+ min?: string;
94
+ /** Maximum date as ISO string */
95
+ max?: string;
96
+ }
97
+ /**
98
+ * Input props for enum-backed fields (select, radio).
99
+ */
100
+ interface EnumInputProps extends BaseInputProps {
101
+ /** Placeholder text (for select) */
102
+ placeholder?: string;
103
+ /** Default value (must match one of the enum options) */
104
+ defaultValue?: string;
105
+ }
106
+ /**
107
+ * Generic input props that accept any field type.
108
+ * Use this when the backing type is not known at compile time.
109
+ *
110
+ * This is the catch-all type used for runtime flexibility.
111
+ */
112
+ interface SerializableInputProps extends BaseInputProps {
113
+ placeholder?: string;
114
+ type?: string;
115
+ defaultValue?: unknown;
116
+ min?: number | string;
117
+ max?: number | string;
118
+ step?: number | string;
119
+ minLength?: number;
120
+ maxLength?: number;
121
+ pattern?: string;
122
+ autoComplete?: string;
123
+ /** Allow additional props for extensibility */
124
+ [key: string]: unknown;
125
+ }
126
+ /**
127
+ * Maps backing Zod types to their corresponding input props type.
128
+ */
129
+ interface InputPropsByBackingType {
130
+ string: StringInputProps;
131
+ number: NumberInputProps;
132
+ boolean: BooleanInputProps;
133
+ date: DateInputProps;
134
+ enum: EnumInputProps;
135
+ }
136
+ /**
137
+ * Built-in field types supported by auto-form.
138
+ */
139
+ type AutoFormBuiltinFieldType = keyof typeof INPUT_COMPONENTS;
140
+ /**
141
+ * Field types that can be specified in JSON Schema.
142
+ * Either a built-in type name or a custom component.
143
+ */
144
+ type FieldType = AutoFormBuiltinFieldType | (string & {});
145
+ /**
146
+ * JSON Schema property with form-builder and auto-form metadata.
147
+ *
148
+ * This is the intermediate format used when:
149
+ * - form-builder serializes field configurations
150
+ * - auto-form parses JSON Schema to build field configs
151
+ */
152
+ interface JSONSchemaPropertyBase {
153
+ /** JSON Schema type */
154
+ type?: "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
155
+ /** Human-readable title (JSON Schema standard) */
156
+ title?: string;
157
+ /** Description text */
158
+ description?: string;
159
+ /** Default value */
160
+ default?: unknown;
161
+ /** Enum values for select/radio fields */
162
+ enum?: (string | number | boolean | null)[];
163
+ /** Minimum value for numbers */
164
+ minimum?: number;
165
+ /** Maximum value for numbers */
166
+ maximum?: number;
167
+ /** Exclusive minimum for numbers */
168
+ exclusiveMinimum?: number;
169
+ /** Exclusive maximum for numbers */
170
+ exclusiveMaximum?: number;
171
+ /** Minimum length for strings */
172
+ minLength?: number;
173
+ /** Maximum length for strings */
174
+ maxLength?: number;
175
+ /** Regex pattern for strings */
176
+ pattern?: string;
177
+ /** Format hint (email, uri, date-time, etc.) */
178
+ format?: string;
179
+ /** Multiple of constraint for numbers */
180
+ multipleOf?: number;
181
+ /** Properties for object types */
182
+ properties?: Record<string, JSONSchemaPropertyBase>;
183
+ /** Required fields for object types */
184
+ required?: string[];
185
+ /** Additional properties allowed for objects */
186
+ additionalProperties?: boolean;
187
+ /** Item schema for array types */
188
+ items?: JSONSchemaPropertyBase;
189
+ /** Display label (form-builder/auto-form) */
190
+ label?: string;
191
+ /** Field type override (checkbox, date, select, radio, switch, textarea, etc.) */
192
+ fieldType?: FieldType;
193
+ /** Placeholder text */
194
+ placeholder?: string;
195
+ /** HTML input type (text, email, password, tel, etc.) */
196
+ inputType?: string;
197
+ /** Additional input props */
198
+ inputProps?: SerializableInputProps;
199
+ /** Display order */
200
+ order?: number;
201
+ /** Minimum date as ISO string */
202
+ formatMinimum?: string;
203
+ /** Maximum date as ISO string */
204
+ formatMaximum?: string;
205
+ }
206
+
207
+ /**
208
+ * Input props for form fields.
209
+ *
210
+ * This is the runtime type that accepts any input props.
211
+ * For type-safe props, use the discriminated types:
212
+ * - StringInputProps for text inputs
213
+ * - NumberInputProps for number inputs
214
+ * - BooleanInputProps for checkboxes/switches
215
+ * - DateInputProps for date pickers
216
+ * - EnumInputProps for selects/radios
217
+ */
218
+ type FieldInputProps = SerializableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, keyof SerializableInputProps> & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, keyof SerializableInputProps>;
219
+ /**
220
+ * Configuration for a single field in AutoForm.
221
+ *
222
+ * Note: This type is designed to align with form-builder's FormBuilderFieldProps
223
+ * so that JSON Schema properties can be easily converted to field configs.
224
+ */
225
+ type FieldConfigItem = {
226
+ /** Description text or React node */
227
+ description?: React.ReactNode;
228
+ /** Input props passed to the field component */
229
+ inputProps?: FieldInputProps;
230
+ /** Display label */
231
+ label?: string;
232
+ /** Field type override - built-in type or custom component */
233
+ fieldType?: keyof typeof INPUT_COMPONENTS | React.FC<AutoFormInputComponentProps>;
234
+ /** Wrapper component for custom field layout */
235
+ renderParent?: (props: {
236
+ children: React.ReactNode;
237
+ }) => React.ReactElement | null;
238
+ /** Display order for field ordering */
239
+ order?: number;
240
+ };
241
+ /**
242
+ * FieldConfig for nested objects - allows both FieldConfigItem properties
243
+ * AND nested field configs for child properties.
244
+ */
245
+ type FieldConfigObject = FieldConfigItem & {
246
+ [key: string]: FieldConfigItem | FieldConfigObject | undefined;
247
+ };
248
+ /**
249
+ * For object fields, allow both FieldConfigItem properties (label, description, etc.)
250
+ * AND nested field configs for the object's properties.
251
+ */
252
+ type FieldConfig<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
253
+ [Key in keyof SchemaType]?: FieldConfigItem | FieldConfigObject;
254
+ };
255
+ declare enum DependencyType {
256
+ DISABLES = 0,
257
+ REQUIRES = 1,
258
+ HIDES = 2,
259
+ SETS_OPTIONS = 3
260
+ }
261
+ type BaseDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = {
262
+ sourceField: keyof SchemaType;
263
+ type: DependencyType;
264
+ targetField: keyof SchemaType;
265
+ when: (sourceFieldValue: any, targetFieldValue: any) => boolean;
266
+ };
267
+ type ValueDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
268
+ type: DependencyType.DISABLES | DependencyType.REQUIRES | DependencyType.HIDES;
269
+ };
270
+ type EnumValues = readonly [string, ...string[]];
271
+ type OptionsDependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = BaseDependency<SchemaType> & {
272
+ type: DependencyType.SETS_OPTIONS;
273
+ options: EnumValues;
274
+ };
275
+ type Dependency<SchemaType extends zod.infer<zod.ZodObject<any, any>>> = ValueDependency<SchemaType> | OptionsDependency<SchemaType>;
276
+ /**
277
+ * A FormInput component can handle a specific Zod type (e.g. "ZodBoolean")
278
+ */
279
+ type AutoFormInputComponentProps = {
280
+ zodInputProps: React.InputHTMLAttributes<HTMLInputElement>;
281
+ field: ControllerRenderProps<FieldValues, any>;
282
+ fieldConfigItem: FieldConfigItem;
283
+ label: string;
284
+ isRequired: boolean;
285
+ fieldProps: any;
286
+ zodItem: zod.ZodType;
287
+ className?: string;
288
+ };
289
+
290
+ export { DependencyType as b };
291
+ export type { AutoFormInputComponentProps as A, Dependency as D, FieldConfigItem as F, InputPropsByBackingType as I, JSONSchemaPropertyBase as J, SerializableInputProps as S, FieldConfig as a, FieldType as c };