formanitor 0.0.49 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
 
3
- type FieldType = 'text' | 'number' | 'textarea' | 'diagnosis_textarea' | 'richtext' | 'select' | 'multiselect' | 'radio' | 'repeatable' | 'checkbox' | 'image_upload' | 'media_upload' | 'signature' | 'date' | 'datetime' | 'editable_table' | 'static_text' | 'medications' | 'investigations' | 'procedures' | 'vitals' | 'hidden_vitals' | 'referral' | 'followup' | 'toggle' | 'urology_smart_history' | 'urology_examination' | 'urology_pathway' | string;
4
+ type FieldType = "text" | "number" | "textarea" | "diagnosis_textarea" | "richtext" | "select" | "multiselect" | "radio" | "repeatable" | "checkbox" | "image_upload" | "media_upload" | "file_upload" | "signature" | "date" | "datetime" | "editable_table" | "static_text" | "medications" | "investigations" | "procedures" | "vitals" | "hidden_vitals" | "referral" | "followup" | "toggle" | "urology_smart_history" | "urology_examination" | "urology_pathway" | string;
4
5
  interface ValidationRule {
5
6
  min?: number;
6
7
  max?: number;
@@ -10,7 +11,7 @@ interface ValidationRule {
10
11
  custom?: (value: any) => string | null;
11
12
  }
12
13
  interface Permission {
13
- [role: string]: 'edit' | 'view' | 'hide';
14
+ [role: string]: "edit" | "view" | "hide";
14
15
  }
15
16
  interface DataSource {
16
17
  source: string;
@@ -18,7 +19,7 @@ interface DataSource {
18
19
  dependsOn?: string[];
19
20
  }
20
21
  interface EventDefinition {
21
- trigger: 'onValueChange' | 'onBlur' | 'onFocus';
22
+ trigger: "onValueChange" | "onBlur" | "onFocus";
22
23
  condition?: Condition;
23
24
  emit: string;
24
25
  }
@@ -27,6 +28,34 @@ interface FieldPrefill {
27
28
  source?: string;
28
29
  field?: string;
29
30
  }
31
+ /** Optional Tailwind (or other) class names applied on top of each field’s default styles. */
32
+ interface FieldStyleClassNames {
33
+ /** Outermost wrapper around the field (typically the `space-y-*` column). */
34
+ wrapper?: string;
35
+ /** Primary field label (the `Label` next to the control). */
36
+ label?: string;
37
+ /** Main interactive control: input, textarea, select trigger, upload area, bordered option list, etc. */
38
+ control?: string;
39
+ /** Helper text under the field (`description` in schema). */
40
+ description?: string;
41
+ /** Validation / error line below the field. */
42
+ error?: string;
43
+ /** The red asterisk shown when `required` is true (only if `showRequiredAsterisk` is not false). */
44
+ requiredIndicator?: string;
45
+ }
46
+ /**
47
+ * Per-field presentation overrides. All keys optional — omitting `style` keeps existing behaviour.
48
+ */
49
+ interface FieldStyleConfig {
50
+ /** When false, the primary label row is hidden (controls should use `aria-label`). Default true. */
51
+ labelVisible?: boolean;
52
+ /**
53
+ * When false, the red * for required fields is not rendered. Validation still uses `required`.
54
+ * Default true (show asterisk when required).
55
+ */
56
+ showRequiredAsterisk?: boolean;
57
+ classNames?: FieldStyleClassNames;
58
+ }
30
59
  interface BaseFieldDef {
31
60
  id: string;
32
61
  type: FieldType;
@@ -48,7 +77,7 @@ interface BaseFieldDef {
48
77
  * - "center" is the main content column and is 2× the width of side columns.
49
78
  * Default: "center" when omitted.
50
79
  */
51
- position?: 'left' | 'center' | 'right';
80
+ position?: "left" | "center" | "right";
52
81
  /**
53
82
  * How many layout columns this field spans horizontally.
54
83
  * - 1 = occupies its own column (e.g. just "left", just "center", or just "right")
@@ -62,6 +91,8 @@ interface BaseFieldDef {
62
91
  * shows the label in a colored block above the input).
63
92
  */
64
93
  theme?: string;
94
+ /** Optional layout and class overrides for this field (see {@link FieldStyleConfig}). */
95
+ style?: FieldStyleConfig;
65
96
  meta?: Record<string, unknown>;
66
97
  /**
67
98
  * When true, a microphone button is rendered alongside this field so the
@@ -71,22 +102,22 @@ interface BaseFieldDef {
71
102
  voice?: boolean;
72
103
  }
73
104
  interface TextFieldDef extends BaseFieldDef {
74
- type: 'text' | 'textarea';
105
+ type: "text" | "textarea";
75
106
  /** For textarea: height in pixels. If omitted, uses default min height (80px). */
76
107
  height?: number;
77
108
  }
78
109
  /** Rich text (HTML) field with TipTap toolbar. Value is stored as HTML string. */
79
110
  interface RichTextFieldDef extends BaseFieldDef {
80
- type: 'richtext';
111
+ type: "richtext";
81
112
  /** Minimum height of the editor body in pixels. Default: 160. */
82
113
  minHeight?: number;
83
114
  }
84
115
  interface NumberFieldDef extends BaseFieldDef {
85
- type: 'number';
116
+ type: "number";
86
117
  }
87
118
  /** Single-thumb numeric slider (e.g. VAS 0–10). Value is a number. */
88
119
  interface SliderFieldDef extends BaseFieldDef {
89
- type: 'slider';
120
+ type: "slider";
90
121
  /** Inclusive minimum. Default 0. */
91
122
  min?: number;
92
123
  /** Inclusive maximum. Default 10. */
@@ -101,35 +132,46 @@ interface SelectOption {
101
132
  score?: number;
102
133
  }
103
134
  interface SelectFieldDef extends BaseFieldDef {
104
- type: 'select' | 'multiselect';
135
+ type: "select" | "multiselect";
105
136
  options?: SelectOption[];
106
137
  }
107
138
  interface RadioFieldDef extends BaseFieldDef {
108
- type: 'radio';
139
+ type: "radio";
109
140
  options?: SelectOption[];
110
141
  }
111
142
  interface CheckboxFieldDef extends BaseFieldDef {
112
- type: 'checkbox';
143
+ type: "checkbox";
113
144
  /** Options for the checkbox group; value is stored as array of selected option values. */
114
145
  options?: SelectOption[];
115
146
  }
116
147
  interface RepeatableFieldDef extends BaseFieldDef {
117
- type: 'repeatable';
148
+ type: "repeatable";
118
149
  row: FieldDef[];
119
150
  }
120
151
  interface ImageUploadFieldDef extends BaseFieldDef {
121
- type: 'image_upload';
152
+ type: "image_upload";
122
153
  maxSize?: number;
123
154
  acceptedTypes?: string[];
124
155
  }
125
156
  interface MediaUploadFieldDef extends BaseFieldDef {
126
- type: 'media_upload';
157
+ type: "media_upload";
127
158
  maxSize?: number;
128
159
  /** Default: images (image/*) and application/pdf */
129
160
  acceptedTypes?: string[];
130
161
  }
162
+ interface FileUploadFieldDef extends BaseFieldDef {
163
+ type: "file_upload";
164
+ /** HTML accept string, e.g. "application/pdf,image/*" */
165
+ accept?: string;
166
+ multiple?: boolean;
167
+ maxSize?: number;
168
+ uploadPlaceholder?: string;
169
+ uploadFormats?: string;
170
+ /** When true, uploaded files render as a stacked list with removable rows. */
171
+ list?: boolean;
172
+ }
131
173
  interface SignatureFieldDef extends BaseFieldDef {
132
- type: 'signature';
174
+ type: "signature";
133
175
  canvasWidth?: number;
134
176
  canvasHeight?: number;
135
177
  strokeColor?: string;
@@ -143,7 +185,7 @@ interface EditableTableColumnDef {
143
185
  allowDelete?: boolean;
144
186
  }
145
187
  interface EditableTableFieldDef extends BaseFieldDef {
146
- type: 'editable_table';
188
+ type: "editable_table";
147
189
  /** Initial columns. Per-column allowDelete controls whether that column can be removed. */
148
190
  columns?: EditableTableColumnDef[];
149
191
  allowAddRow?: boolean;
@@ -157,26 +199,26 @@ interface EditableTableFieldDef extends BaseFieldDef {
157
199
  /** Placeholder/hint for the new column name input. Default: "New Column Name". */
158
200
  newColumnNameHint?: string;
159
201
  /** How to capture new column name: "text" (input) or "datetime" (picker). Default: "text". */
160
- newColumnNameInputType?: 'text' | 'datetime';
202
+ newColumnNameInputType?: "text" | "datetime";
161
203
  /** Minimum rows to keep; delete button is hidden when rows.length <= minRows. Default: 0. */
162
204
  minRows?: number;
163
205
  }
164
206
  interface StaticTextFieldDef extends BaseFieldDef {
165
- type: 'static_text';
207
+ type: "static_text";
166
208
  /** Display size. Default: 'regular'. */
167
- size?: 'regular' | 'large';
209
+ size?: "regular" | "large";
168
210
  }
169
211
  interface MedicationsFieldDef extends BaseFieldDef {
170
- type: 'medications';
212
+ type: "medications";
171
213
  }
172
214
  interface InvestigationsFieldDef extends BaseFieldDef {
173
- type: 'investigations';
215
+ type: "investigations";
174
216
  }
175
217
  interface ProceduresFieldDef extends BaseFieldDef {
176
- type: 'procedures';
218
+ type: "procedures";
177
219
  }
178
220
  interface DifferentialDiagnosisFieldDef extends BaseFieldDef {
179
- type: 'differential_diagnosis';
221
+ type: "differential_diagnosis";
180
222
  }
181
223
  /**
182
224
  * A read-only vitals panel populated by an external API fetch.
@@ -184,7 +226,7 @@ interface DifferentialDiagnosisFieldDef extends BaseFieldDef {
184
226
  * The fetched value (raw vitals object) is stored in form state and included in submission.
185
227
  */
186
228
  interface VitalsFieldDef extends BaseFieldDef {
187
- type: 'vitals';
229
+ type: "vitals";
188
230
  }
189
231
  /** One selected referral. Stored in form state as an array of these. */
190
232
  interface ReferralItem {
@@ -197,22 +239,22 @@ interface ReferralItem {
197
239
  * Options via fieldHandlers[fieldId].onFetchOptions (e.g. { specializations: string[] }).
198
240
  */
199
241
  interface ReferralFieldDef extends BaseFieldDef {
200
- type: 'referral';
242
+ type: "referral";
201
243
  options?: SelectOption[];
202
244
  }
203
245
  /** Stored value for followup field: false/null = no followup; object = one-time followup as number of days from current date. */
204
246
  interface FollowupValue {
205
- followupType: 'one time';
247
+ followupType: "one time";
206
248
  /** Number of days from (current) date when set; always stored as string. */
207
249
  value: string;
208
- unit: 'days';
250
+ unit: "days";
209
251
  }
210
252
  /**
211
253
  * Follow-up field: "No Follow-up" | "One Time" with schedule by duration (e.g. 7 days) or by date.
212
254
  * Value shape: false | FollowupValue.
213
255
  */
214
256
  interface FollowupFieldDef extends BaseFieldDef {
215
- type: 'followup';
257
+ type: "followup";
216
258
  }
217
259
  /** A matched master record returned from a backend search API. */
218
260
  interface MatchedCondition {
@@ -252,7 +294,7 @@ interface DiagnosisTextareaValue {
252
294
  * Value shape: `SmartTextareaValue` — `{ text, extractedKeywords }`.
253
295
  */
254
296
  interface SmartTextareaFieldDef extends BaseFieldDef {
255
- type: 'smart_textarea';
297
+ type: "smart_textarea";
256
298
  height?: number;
257
299
  /** Semantic label for the kind of content (e.g. 'allergies', 'chiefComplaints', 'symptoms'). */
258
300
  componentType: string;
@@ -266,7 +308,7 @@ interface SmartTextareaFieldDef extends BaseFieldDef {
266
308
  * Value shape in form state can be plain text (legacy) or `DiagnosisTextareaValue`.
267
309
  */
268
310
  interface DiagnosisTextareaFieldDef extends BaseFieldDef {
269
- type: 'diagnosis_textarea';
311
+ type: "diagnosis_textarea";
270
312
  /** Height in pixels. If omitted, uses default min height (80px). */
271
313
  height?: number;
272
314
  /** Debounce delay in ms before API call triggers. Default: 700. */
@@ -284,7 +326,7 @@ interface DiagnosisTextareaFieldDef extends BaseFieldDef {
284
326
  * - `complaint_chips` is an alias type string for the same widget (e.g. chief complaints).
285
327
  */
286
328
  interface SuggestionTextareaFieldDef extends BaseFieldDef {
287
- type: 'suggestion_textarea' | 'complaint_chips';
329
+ type: "suggestion_textarea" | "complaint_chips";
288
330
  options?: SelectOption[];
289
331
  /** Height in pixels for the textarea. */
290
332
  height?: number;
@@ -332,13 +374,13 @@ interface LensAssessmentValue {
332
374
  * optional clinical notes. Shown via schema rules (e.g. chief-complaint `contains`).
333
375
  */
334
376
  interface LensAssessmentFieldDef extends BaseFieldDef {
335
- type: 'lens_assessment';
377
+ type: "lens_assessment";
336
378
  meta?: {
337
379
  cardTitle?: string;
338
380
  } & Record<string, unknown>;
339
381
  }
340
382
  /** Keys for the five-item functional impairment scale (0–3 each). */
341
- type FunctionalImpairmentDimension = 'reading' | 'nightDriving' | 'glare' | 'occupation' | 'adl';
383
+ type FunctionalImpairmentDimension = "reading" | "nightDriving" | "glare" | "occupation" | "adl";
342
384
  /** Stored value for `functional_impairment_score` fields (sum 0–15). */
343
385
  interface FunctionalImpairmentScoreValue {
344
386
  reading: number;
@@ -351,13 +393,13 @@ interface FunctionalImpairmentScoreValue {
351
393
  * Cataract-related functional impairment: five 0–3 items and total /15.
352
394
  */
353
395
  interface FunctionalImpairmentScoreFieldDef extends BaseFieldDef {
354
- type: 'functional_impairment_score';
396
+ type: "functional_impairment_score";
355
397
  meta?: {
356
398
  cardTitle?: string;
357
399
  } & Record<string, unknown>;
358
400
  }
359
401
  /** Biometry acquisition method (IOL workup). */
360
- type BiometryMethod = 'optical_biometry' | 'ascan_immersion' | 'ascan_contact';
402
+ type BiometryMethod = "optical_biometry" | "ascan_immersion" | "ascan_contact";
361
403
  /** Value for `biometry_iol_workup` — bilateral inputs, shared formula/method, optional workup flags. */
362
404
  interface BiometryIolWorkupValue {
363
405
  axialLengthOD: string;
@@ -378,7 +420,7 @@ interface BiometryIolWorkupValue {
378
420
  }
379
421
  /** Table + IOL formula workup (Stage 7). */
380
422
  interface BiometryIolWorkupFieldDef extends BaseFieldDef {
381
- type: 'biometry_iol_workup';
423
+ type: "biometry_iol_workup";
382
424
  meta?: {
383
425
  cardTitle?: string;
384
426
  } & Record<string, unknown>;
@@ -390,49 +432,49 @@ interface SurgicalRiskFlagsValue {
390
432
  }
391
433
  /** Bilateral cataract surgical risk flags with derived Low/Moderate/High badge per eye (Stage 11). */
392
434
  interface SurgicalRiskFlagsFieldDef extends BaseFieldDef {
393
- type: 'surgical_risk_flags';
435
+ type: "surgical_risk_flags";
394
436
  meta?: {
395
437
  cardTitle?: string;
396
438
  } & Record<string, unknown>;
397
439
  }
398
440
  /** Urology OPD: dynamic smart history (SOCRATES, IPSS, haematuria, sexual). */
399
441
  interface UrologySmartHistoryFieldDef extends BaseFieldDef {
400
- type: 'urology_smart_history';
442
+ type: "urology_smart_history";
401
443
  }
402
444
  /** Urology OPD: structured examination (general, abdomen, GU, DRE). */
403
445
  interface UrologyExaminationFieldDef extends BaseFieldDef {
404
- type: 'urology_examination';
446
+ type: "urology_examination";
405
447
  }
406
448
  /** Urology OPD: objective pathway metrics and risk toggles (maps to `uro_pathway`). */
407
449
  interface UrologyPathwayFieldDef extends BaseFieldDef {
408
- type: 'urology_pathway';
450
+ type: "urology_pathway";
409
451
  meta?: {
410
452
  subtitle?: string;
411
453
  } & Record<string, unknown>;
412
454
  }
413
455
  /** OB/GYN OPD: structured examination (general/abdomen/breast/pelvic + uterus size). */
414
456
  interface OBGExaminationFieldDef extends BaseFieldDef {
415
- type: 'obg_examination';
457
+ type: "obg_examination";
416
458
  }
417
459
  /** OB/GYN OPD: consultant zoning + 5 pathway panels (menstrual / antenatal / gynae / infertility / postop). Antenatal panels render inside the Obstetric History widget. */
418
460
  interface OBGPathwayFieldDef extends BaseFieldDef {
419
- type: 'obg_pathway';
461
+ type: "obg_pathway";
420
462
  }
421
463
  /** General surgery OPD: structured smart history (SOCRATES, swelling, GI, breast, anorectal, thyroid); HOPC is template field `symptoms` embedded in the widget. */
422
464
  interface GeneralSurgerySmartHistoryFieldDef extends BaseFieldDef {
423
- type: 'general_surgery_smart_history';
465
+ type: "general_surgery_smart_history";
424
466
  }
425
467
  /** General surgery OPD: general signs, regional selection, structured abdomen + regional exam cards + notes. */
426
468
  interface GeneralSurgeryExaminationFieldDef extends BaseFieldDef {
427
- type: 'general_surgery_examination';
469
+ type: "general_surgery_examination";
428
470
  }
429
471
  /** General surgery OPD: condition-wise grading (Clearsight triggers; no surgery column). */
430
472
  interface GeneralSurgeryGradingFieldDef extends BaseFieldDef {
431
- type: 'general_surgery_grading';
473
+ type: "general_surgery_grading";
432
474
  }
433
475
  /** Pain scale (slider) + checkbox flags in one highlight-label shell; reusable across specialties. */
434
476
  interface PainScaleFlagsFieldDef extends BaseFieldDef {
435
- type: 'pain_scale_flags';
477
+ type: "pain_scale_flags";
436
478
  min?: number;
437
479
  max?: number;
438
480
  step?: number;
@@ -457,13 +499,13 @@ interface MedicationFrequentItem {
457
499
  duration?: string;
458
500
  /** Optional structured duration components (preferred over duration when present). */
459
501
  duration_value?: string;
460
- duration_unit?: 'days' | 'weeks' | 'months' | string;
502
+ duration_unit?: "days" | "weeks" | "months" | string;
461
503
  /** Optional schedule slots; when omitted, Forminator falls back to "0". */
462
504
  morning?: string;
463
505
  afternoon?: string;
464
506
  night?: string;
465
507
  /** Optional food-timing hint; when omitted, Forminator defaults to "AFTER FOOD". */
466
- before_after?: 'AFTER FOOD' | 'BEFORE FOOD' | string;
508
+ before_after?: "AFTER FOOD" | "BEFORE FOOD" | string;
467
509
  /** Optional notes; when omitted, Forminator may derive a note from route. */
468
510
  notes?: string;
469
511
  usage_count?: number;
@@ -501,7 +543,7 @@ interface DiagnosticPackage {
501
543
  tests: DiagnosticPackageTest[];
502
544
  }
503
545
  interface PhoneInputFieldDef extends BaseFieldDef {
504
- type: 'phone_input';
546
+ type: "phone_input";
505
547
  meta?: {
506
548
  /** ID of the sibling otp_input field to clear when the phone is edited after a send. */
507
549
  otpFieldId?: string;
@@ -510,7 +552,7 @@ interface PhoneInputFieldDef extends BaseFieldDef {
510
552
  };
511
553
  }
512
554
  interface OtpInputFieldDef extends BaseFieldDef {
513
- type: 'otp_input';
555
+ type: "otp_input";
514
556
  meta?: {
515
557
  /** ID of the sibling phone_input field to read the number from. Defaults to "phone". */
516
558
  phoneFieldId?: string;
@@ -526,18 +568,18 @@ interface OtpVerifiedValue {
526
568
  code: string;
527
569
  token?: string;
528
570
  }
529
- type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SliderFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | SuggestionTextareaFieldDef | LensAssessmentFieldDef | FunctionalImpairmentScoreFieldDef | ToggleFieldDef | BiometryIolWorkupFieldDef | SurgicalRiskFlagsFieldDef | GeneralSurgerySmartHistoryFieldDef | GeneralSurgeryExaminationFieldDef | GeneralSurgeryGradingFieldDef | UrologySmartHistoryFieldDef | UrologyExaminationFieldDef | UrologyPathwayFieldDef | OBGExaminationFieldDef | OBGPathwayFieldDef | PainScaleFlagsFieldDef | PhoneInputFieldDef | OtpInputFieldDef | BaseFieldDef;
571
+ type FieldDef = TextFieldDef | RichTextFieldDef | NumberFieldDef | SliderFieldDef | SelectFieldDef | RadioFieldDef | CheckboxFieldDef | RepeatableFieldDef | ImageUploadFieldDef | MediaUploadFieldDef | FileUploadFieldDef | SignatureFieldDef | EditableTableFieldDef | StaticTextFieldDef | MedicationsFieldDef | InvestigationsFieldDef | ProceduresFieldDef | DifferentialDiagnosisFieldDef | VitalsFieldDef | ReferralFieldDef | FollowupFieldDef | SmartTextareaFieldDef | DiagnosisTextareaFieldDef | SuggestionTextareaFieldDef | LensAssessmentFieldDef | FunctionalImpairmentScoreFieldDef | ToggleFieldDef | BiometryIolWorkupFieldDef | SurgicalRiskFlagsFieldDef | GeneralSurgerySmartHistoryFieldDef | GeneralSurgeryExaminationFieldDef | GeneralSurgeryGradingFieldDef | UrologySmartHistoryFieldDef | UrologyExaminationFieldDef | UrologyPathwayFieldDef | OBGExaminationFieldDef | OBGPathwayFieldDef | PainScaleFlagsFieldDef | PhoneInputFieldDef | OtpInputFieldDef | BaseFieldDef;
530
572
  /** Boolean switch; value is `true` | `false`. */
531
573
  interface ToggleFieldDef extends BaseFieldDef {
532
- type: 'toggle';
574
+ type: "toggle";
533
575
  }
534
576
  interface ToggleFieldDef extends BaseFieldDef {
535
- type: 'toggle';
577
+ type: "toggle";
536
578
  excludes?: string[];
537
579
  }
538
580
  interface Condition {
539
581
  field?: string;
540
- op: '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in' | 'contains';
582
+ op: "==" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "contains";
541
583
  /**
542
584
  * For `op: "contains"`:
543
585
  * - If the field value is an **array**, checks `value.includes(condition.value)` (e.g. multiselect).
@@ -547,7 +589,7 @@ interface Condition {
547
589
  value: any;
548
590
  }
549
591
  interface RuleAction {
550
- action: 'hide' | 'show' | 'disable' | 'enable' | 'setRequired';
592
+ action: "hide" | "show" | "disable" | "enable" | "setRequired";
551
593
  target: string;
552
594
  }
553
595
  interface Rule {
@@ -565,7 +607,7 @@ interface Workflow {
565
607
  transitions: WorkflowTransition[];
566
608
  }
567
609
  interface ColumnLayout {
568
- type: 'column_layout';
610
+ type: "column_layout";
569
611
  id: string;
570
612
  /** Number of columns. Children take equal width. */
571
613
  columns: number;
@@ -576,19 +618,19 @@ interface ColumnLayout {
576
618
  /** Section child: either a field ID or a nested column_layout. */
577
619
  type SectionChild = string | ColumnLayout;
578
620
  interface Section {
579
- type: 'section';
621
+ type: "section";
580
622
  id: string;
581
623
  title: string;
582
624
  children: SectionChild[];
583
625
  }
584
626
  interface MultiStepNode {
585
- type: 'section';
627
+ type: "section";
586
628
  id: string;
587
629
  title: string;
588
630
  children: SectionChild[];
589
631
  }
590
632
  interface MultiStepLayoutNode {
591
- type: 'multi_step';
633
+ type: "multi_step";
592
634
  id: string;
593
635
  title?: string;
594
636
  steps: MultiStepNode[];
@@ -596,14 +638,14 @@ interface MultiStepLayoutNode {
596
638
  /** Show step indicator header. Default true. */
597
639
  showStepper?: boolean;
598
640
  /** Visual style for the stepper. Default 'numbered'. */
599
- stepperVariant?: 'numbered' | 'dots' | 'labels';
641
+ stepperVariant?: "numbered" | "dots" | "labels";
600
642
  /** Collapse completed steps into an accordion. Default true. */
601
643
  collapseCompleted?: boolean;
602
644
  };
603
645
  }
604
646
  type LayoutNode = Section | ColumnLayout | MultiStepLayoutNode;
605
647
  interface WebhookDef {
606
- method: 'GET' | 'POST' | 'PUT';
648
+ method: "GET" | "POST" | "PUT";
607
649
  url: string;
608
650
  }
609
651
  interface ScoreRange {
@@ -613,31 +655,31 @@ interface ScoreRange {
613
655
  }
614
656
  interface ScoreComputation {
615
657
  target: string;
616
- type: 'score';
658
+ type: "score";
617
659
  source: string;
618
660
  ranges: ScoreRange[];
619
661
  }
620
662
  interface SumComputation {
621
663
  target: string;
622
- type: 'sum';
664
+ type: "sum";
623
665
  fields: string[];
624
666
  }
625
667
  /** Expression node for formula computation: field ref, number, or binary op. */
626
668
  type FormulaExpr = {
627
- type: 'field';
669
+ type: "field";
628
670
  field: string;
629
671
  } | {
630
- type: 'number';
672
+ type: "number";
631
673
  value: number;
632
674
  } | {
633
- type: 'op';
634
- op: '+' | '-' | '*' | '/' | '**';
675
+ type: "op";
676
+ op: "+" | "-" | "*" | "/" | "**";
635
677
  left: FormulaExpr;
636
678
  right: FormulaExpr;
637
679
  };
638
680
  interface FormulaComputation {
639
681
  target: string;
640
- type: 'formula';
682
+ type: "formula";
641
683
  expression: FormulaExpr;
642
684
  }
643
685
  type Computation = SumComputation | ScoreComputation | FormulaComputation;
@@ -1009,6 +1051,16 @@ interface SmartFormProps {
1009
1051
  */
1010
1052
  declare const SmartForm: React.FC<SmartFormProps>;
1011
1053
 
1054
+ declare function isLabelVisible(fieldDef: Pick<BaseFieldDef, "style">): boolean;
1055
+ declare function FieldRequiredIndicator({ fieldDef, }: {
1056
+ fieldDef: Pick<BaseFieldDef, "required" | "style">;
1057
+ }): react_jsx_runtime.JSX.Element | null;
1058
+ declare function fieldWrapperClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
1059
+ declare function fieldLabelClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
1060
+ declare function fieldControlClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
1061
+ declare function fieldDescriptionClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
1062
+ declare function fieldErrorClass(fieldDef: Pick<BaseFieldDef, "style">, ...defaults: (string | undefined)[]): string;
1063
+
1012
1064
  interface FieldRendererProps {
1013
1065
  fieldId: string;
1014
1066
  }
@@ -1075,6 +1127,29 @@ interface FormControlsProps {
1075
1127
  }
1076
1128
  declare const FormControls: React.FC<FormControlsProps>;
1077
1129
 
1130
+ interface UploadProps {
1131
+ accept?: string;
1132
+ multiple?: boolean;
1133
+ disabled?: boolean;
1134
+ value?: FileList | File[] | null;
1135
+ onChange: (files: FileList | null) => void;
1136
+ className?: string;
1137
+ /** Shown under placeholder, e.g. "PDF, PNG, JPG" */
1138
+ formatsLabel?: string;
1139
+ placeholder?: string;
1140
+ beforeUploadContent?: React.ReactNode;
1141
+ id?: string;
1142
+ /**
1143
+ * When true, do not show "N files selected" in the drop zone; parent can render file rows.
1144
+ */
1145
+ listLayout?: boolean;
1146
+ }
1147
+ declare function Upload({ value, accept, multiple, disabled, onChange, className, formatsLabel, placeholder, beforeUploadContent, id: idProp, listLayout, }: UploadProps): react_jsx_runtime.JSX.Element;
1148
+
1149
+ declare const FormFileUploadWidget: React.FC<{
1150
+ fieldId: string;
1151
+ }>;
1152
+
1078
1153
  declare const ImageUploadWidget: React.FC<{
1079
1154
  fieldId: string;
1080
1155
  }>;
@@ -1280,4 +1355,4 @@ declare const SmartTextareaWidget: React.FC<{
1280
1355
  fieldId: string;
1281
1356
  }>;
1282
1357
 
1283
- export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type BiometryIolWorkupFieldDef, type BiometryIolWorkupValue, type BiometryMethod, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, DynamicFormV2, type DynamicFormV2Props, type DynamicFormV2SectionMode, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, type FieldState, type FieldType, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type FunctionalImpairmentDimension, type FunctionalImpairmentScoreFieldDef, type FunctionalImpairmentScoreValue, type GeneralSurgeryExaminationFieldDef, type GeneralSurgeryGradingFieldDef, type GeneralSurgerySmartHistoryFieldDef, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type LensAssessmentFieldDef, type LensAssessmentValue, type LocsGrades, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, MultiStepForm, type MultiStepFormProps, type MultiStepLayoutNode, type MultiStepNode, type NumberFieldDef, type OBGExaminationFieldDef, type OBGPathwayFieldDef, type OtpInputFieldDef, type OtpVerifiedValue, type PainScaleFlagsFieldDef, type Permission, type PhoneInputFieldDef, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, type SliderFieldDef, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreAuthConfig, type StoreConfig, type SubmissionData, type SuggestionTextareaFieldDef, type SumComputation, type SurgicalRiskFlagsFieldDef, type SurgicalRiskFlagsValue, type TextFieldDef, type ToggleFieldDef, type UrologyExaminationFieldDef, type UrologyPathwayFieldDef, type UrologySmartHistoryFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldMetaRequestsMarMedicationOrdersButton, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };
1358
+ export { type AIDifferentialDiagnosisItem, AddInvestigationField, type AddInvestigationFieldProps, AddMedicationField, type AddMedicationFieldProps, type BaseFieldDef, type BiometryIolWorkupFieldDef, type BiometryIolWorkupValue, type BiometryMethod, type CheckboxFieldDef, type ColumnLayout, type Computation, type Condition, type CreateUploadHandlerOptions, type DataSource, type DiagnosisGradeSelection, type DiagnosisTextareaFieldDef, type DiagnosisTextareaValue, type DiagnosticPackage, type DiagnosticPackageTest, DifferentialDiagnosis, type DifferentialDiagnosisFieldDef, type DifferentialDiagnosisItem, type DifferentialDiagnosisProps, type DoctorFrequentItems, DynamicForm, DynamicFormV2, type DynamicFormV2Props, type DynamicFormV2SectionMode, EMAIL_REGEX, type EditableTableColumnDef, type EditableTableFieldDef, type EventDefinition, type ExtractedKeywordMatch, type FieldDef, type FieldHandler, type FieldHandlersMap, type FieldPrefill, FieldRenderer, FieldRequiredIndicator, type FieldState, type FieldStyleClassNames, type FieldStyleConfig, type FieldType, type FileUploadFieldDef, type FollowupFieldDef, type FollowupValue, FormControls, type FormControlsProps, type FormDef, type FormErrors, FormFileUploadWidget, FormProvider, type FormState, FormStore, type FormValues, type FormulaComputation, type FormulaExpr, type FunctionalImpairmentDimension, type FunctionalImpairmentScoreFieldDef, type FunctionalImpairmentScoreValue, type GeneralSurgeryExaminationFieldDef, type GeneralSurgeryGradingFieldDef, type GeneralSurgerySmartHistoryFieldDef, type ImageUploadFieldDef, ImageUploadWidget, type Investigation, type InvestigationFrequentItem, type InvestigationSearchResult, type InvestigationsFieldDef, type LayoutNode, type LensAssessmentFieldDef, type LensAssessmentValue, type LocsGrades, MAR_MEDICATION_ORDERS_META_KEY, type MatchedCondition, type MediaUploadFieldDef, MediaUploadWidget, type Medication, type MedicationFrequentItem, type MedicationSearchResult, type MedicationsFieldDef, MultiStepForm, type MultiStepFormProps, type MultiStepLayoutNode, type MultiStepNode, type NumberFieldDef, type OBGExaminationFieldDef, type OBGPathwayFieldDef, type OtpInputFieldDef, type OtpVerifiedValue, type PainScaleFlagsFieldDef, type Permission, type PhoneInputFieldDef, type PresignedUploadResponse, type ProcedureFrequentItem, type ProceduresFieldDef, type RadioFieldDef, ReadOnlyForm, ReadOnlyImageUpload, ReadOnlyMediaUpload, ReadOnlySignature, ReadOnlyTable, type ReferralFieldDef, type ReferralItem, type RepeatableFieldDef, type RichTextFieldDef, RichTextWidget, type Rule, type RuleAction, type RuleResult, type ScoreComputation, type ScoreRange, type Section, type SectionChild, type SelectFieldDef, type SelectOption, type SignatureFieldDef, SignatureUploadWidget, type SliderFieldDef, SmartForm, type SmartFormProps, type SmartKeywordsResult, type SmartTextareaFieldDef, type SmartTextareaValue, SmartTextareaWidget, type StaticTextFieldDef, type StoreAuthConfig, type StoreConfig, type SubmissionData, type SuggestionTextareaFieldDef, type SumComputation, type SurgicalRiskFlagsFieldDef, type SurgicalRiskFlagsValue, type TextFieldDef, type ToggleFieldDef, Upload, type UploadProps, type UrologyExaminationFieldDef, type UrologyPathwayFieldDef, type UrologySmartHistoryFieldDef, type ValidationRule, type VitalsFieldDef, type WebhookDef, type Workflow, type WorkflowTransition, createUploadHandler, evaluateRules, fieldControlClass, fieldDescriptionClass, fieldErrorClass, fieldLabelClass, fieldMetaRequestsMarMedicationOrdersButton, fieldWrapperClass, isLabelVisible, useField, useFieldHandlers, useForm, useFormStore, useFrequentItems, usePackages, useSmartKeywords, validateField, validateForm };