@factorialco/f0-react 1.397.0 → 1.399.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/f0.d.ts CHANGED
@@ -135,6 +135,7 @@ import { WithDataTestIdReturnType as WithDataTestIdReturnType_3 } from './f0';
135
135
  import { WithDataTestIdReturnType as WithDataTestIdReturnType_4 } from './f0';
136
136
  import { WithDataTestIdReturnType as WithDataTestIdReturnType_5 } from './f0';
137
137
  import { WithDataTestIdReturnType as WithDataTestIdReturnType_6 } from './f0';
138
+ import { WithDataTestIdReturnType as WithDataTestIdReturnType_7 } from './f0';
138
139
  import { z } from 'zod';
139
140
  import { ZodEffects } from 'zod';
140
141
  import { ZodRawShape } from 'zod';
@@ -290,6 +291,8 @@ declare type ActionSize = (typeof actionSizes)[number];
290
291
 
291
292
  declare const actionSizes: readonly ["sm", "md", "lg"];
292
293
 
294
+ export declare type ActionType = "duplicate" | "delete";
295
+
293
296
  declare type ActionVariant = (typeof actionVariants)[number];
294
297
 
295
298
  declare const actionVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "ai", "link", "unstyled", "mention"];
@@ -871,6 +874,25 @@ export declare type BasePaginatedResponse<R> = BaseResponse<R> & {
871
874
  perPage: number;
872
875
  };
873
876
 
877
+ export declare type BaseQuestionOnChangeParams = {
878
+ id: string;
879
+ title?: string;
880
+ description?: string;
881
+ required?: boolean;
882
+ };
883
+
884
+ declare type BaseQuestionProps = {
885
+ id: string;
886
+ title: string;
887
+ description?: string;
888
+ type: QuestionType;
889
+ children: React.ReactNode;
890
+ required?: boolean;
891
+ locked?: boolean;
892
+ };
893
+
894
+ declare type BaseQuestionPropsForOtherQuestionComponents = Omit<BaseQuestionProps, "children" | "onChange">;
895
+
874
896
  /**
875
897
  * Base response type for collection data
876
898
  * @template R - The type of records in the collection
@@ -1552,7 +1574,7 @@ declare type CollectionProps<Record extends RecordType, Filters extends FiltersD
1552
1574
  */
1553
1575
  tmpFullWidth?: boolean;
1554
1576
  /** Indicates the source visualization type */
1555
- fromVisualization?: "table" | "editableTable";
1577
+ fromVisualization?: TableVisualizationType;
1556
1578
  } & VisualizationOptions;
1557
1579
 
1558
1580
  declare type CollectionVisualizations<Record extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<Record>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<Record>> = {
@@ -1642,6 +1664,8 @@ declare type ComponentTypes = (typeof componentTypes)[number];
1642
1664
 
1643
1665
  declare const componentTypes: readonly ["layout", "info", "action", "form"];
1644
1666
 
1667
+ export declare function computeSectionEndIds(elements: SurveyFormBuilderElement[]): Set<string>;
1668
+
1645
1669
  declare type CountryCode = keyof TranslationsType["countries"];
1646
1670
 
1647
1671
  export declare function createAtlaskitDriver(instanceId: symbol): DndDriver;
@@ -2214,6 +2238,10 @@ export declare interface DatePreset {
2214
2238
  value: DateRange | (() => DateRange);
2215
2239
  }
2216
2240
 
2241
+ declare type DateQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
2242
+ value?: Date | null;
2243
+ };
2244
+
2217
2245
  declare type DateRange = {
2218
2246
  from: Date;
2219
2247
  to?: Date;
@@ -2724,7 +2752,7 @@ export declare const defaultTranslations: {
2724
2752
  readonly dismiss: "Dismiss";
2725
2753
  };
2726
2754
  };
2727
- readonly coCreationForm: {
2755
+ readonly surveyFormBuilder: {
2728
2756
  readonly actions: {
2729
2757
  readonly actions: "Actions";
2730
2758
  readonly duplicateQuestion: "Duplicate question";
@@ -2756,7 +2784,11 @@ export declare const defaultTranslations: {
2756
2784
  };
2757
2785
  readonly answer: {
2758
2786
  readonly label: "Answer";
2759
- readonly placeholder: "Respondent's answer";
2787
+ readonly dropdownPlaceholder: "Pick an option";
2788
+ readonly textPlaceholder: "Type your answer";
2789
+ readonly numericPlaceholder: "Enter a number";
2790
+ readonly linkPlaceholder: "https://example.com";
2791
+ readonly invalidUrl: "Enter a valid URL";
2760
2792
  };
2761
2793
  readonly labels: {
2762
2794
  readonly applyingChanges: "Applying changes";
@@ -2775,6 +2807,16 @@ export declare const defaultTranslations: {
2775
2807
  readonly lastQuestionDialogDescription: "Moving this question will leave the section empty and it will be removed. Do you want to continue?";
2776
2808
  };
2777
2809
  };
2810
+ readonly surveyAnsweringForm: {
2811
+ readonly actions: {
2812
+ readonly submit: "Submit survey";
2813
+ readonly cancel: "Cancel";
2814
+ readonly next: "Next";
2815
+ readonly previous: "Previous";
2816
+ readonly expand: "Expand";
2817
+ readonly collapse: "Collapse";
2818
+ };
2819
+ };
2778
2820
  readonly richTextEditor: {
2779
2821
  readonly bold: "Bold";
2780
2822
  readonly italic: "Italic";
@@ -2961,6 +3003,12 @@ declare type DropdownItemSeparator = {
2961
3003
  type: "separator";
2962
3004
  };
2963
3005
 
3006
+ declare type DropdownSingleQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
3007
+ type: "dropdown-single";
3008
+ options: SelectQuestionOption[];
3009
+ value?: string | null;
3010
+ };
3011
+
2964
3012
  export declare type DropIntent = {
2965
3013
  type: "reorder";
2966
3014
  containerId: string;
@@ -2980,7 +3028,7 @@ export declare type DropIntent = {
2980
3028
  };
2981
3029
 
2982
3030
  /** The edit mode for a column cell in the editable table. */
2983
- declare type EditableTableCellEditType = "text" | "date" | "select" | "multiselect";
3031
+ declare type EditableTableCellEditType = "text" | "date" | "select" | "multiselect" | "display-only" | "disabled";
2984
3032
 
2985
3033
  declare type EditableTableCollectionProps<R extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<R>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<R>> = CollectionProps<R, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping, EditableTableVisualizationOptions<R, Filters, Sortings, Summaries>>;
2986
3034
 
@@ -3000,13 +3048,6 @@ declare type EditableTableColumnDefinition<R extends RecordType, Sortings extend
3000
3048
  * When omitted, the cell is always rendered read-only.
3001
3049
  */
3002
3050
  editType?: (item: R) => EditableTableCellEditType | undefined;
3003
- /**
3004
- * Function that determines if the cell should be editable for a given item.
3005
- * The cell is only editable if both `editType` returns a value AND
3006
- * this function returns `true` for the given item.
3007
- * Return `true` for all items to make the column always editable.
3008
- */
3009
- editable: (item: R) => boolean;
3010
3051
  };
3011
3052
 
3012
3053
  declare type EditableTableVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = Omit<TableVisualizationOptions<R, _Filters, Sortings, Summaries>, "columns"> & {
@@ -3027,6 +3068,8 @@ declare type EditableTableVisualizationOptions<R extends RecordType, _Filters ex
3027
3068
 
3028
3069
  declare type EditableTableVisualizationSettings = TableVisualizationSettings;
3029
3070
 
3071
+ export declare type ElementType = QuestionType | "section";
3072
+
3030
3073
  export declare function Em({ children, ...props }: React.HTMLAttributes<HTMLSpanElement>): JSX_2.Element;
3031
3074
 
3032
3075
  export declare function EmojiImage({ emoji, size, alt }: EmojiImageProps): JSX_2.Element;
@@ -4609,6 +4652,20 @@ export declare interface F0FormDiscardConfig {
4609
4652
  */
4610
4653
  export declare type F0FormErrorTriggerMode = "on-blur" | "on-change" | "on-submit";
4611
4654
 
4655
+ /**
4656
+ * Standalone form field component that renders the appropriate F0Form input
4657
+ * without requiring a react-hook-form context.
4658
+ *
4659
+ * Supports all field types that F0Form supports: text, number, textarea,
4660
+ * select, checkbox, switch, date, time, datetime, daterange, richtext, custom,
4661
+ * and file.
4662
+ */
4663
+ export declare function F0FormField({ field, value, onChange, onBlur, error, errorMessage, loading, required, disabled, hideLabel: hideLabelProp, initialFiles, }: F0FormFieldProps): JSX_2.Element;
4664
+
4665
+ export declare namespace F0FormField {
4666
+ var displayName: string;
4667
+ }
4668
+
4612
4669
  /**
4613
4670
  * String field - text input, textarea, select, or custom
4614
4671
  * @typeParam R - Record type for data source (when using source instead of options)
@@ -4684,6 +4741,44 @@ export declare function f0FormField<T extends ZodTypeAny, TConfig = undefined>(s
4684
4741
  */
4685
4742
  export declare function f0FormField<T extends ZodTypeAny, V extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0FieldConfig<V, R>): T & F0ZodType<T>;
4686
4743
 
4744
+ declare interface F0FormFieldCommonProps {
4745
+ /** Field definition (type, label, placeholder, etc.) */
4746
+ /** Current field value */
4747
+ value: unknown;
4748
+ /** Called when the field value changes */
4749
+ onChange: (value: unknown) => void;
4750
+ /** Called when the field loses focus */
4751
+ onBlur?: () => void;
4752
+ /** Whether the field has an error */
4753
+ error?: boolean;
4754
+ /** Error message to display */
4755
+ errorMessage?: string;
4756
+ /** Whether the field is in a loading/validating state */
4757
+ loading?: boolean;
4758
+ /** Whether the field is required */
4759
+ required?: boolean;
4760
+ /** Whether the field is disabled (overrides field.disabled) */
4761
+ disabled?: boolean;
4762
+ /** Whether to hide the label (useful when label is rendered externally) */
4763
+ hideLabel?: boolean;
4764
+ }
4765
+
4766
+ declare interface F0FormFieldFileProps extends F0FormFieldCommonProps {
4767
+ /** File field definition */
4768
+ field: F0FileField;
4769
+ /** Shared pool of pre-existing file metadata for standalone file fields */
4770
+ initialFiles?: InitialFile[];
4771
+ }
4772
+
4773
+ declare interface F0FormFieldNonFileProps extends F0FormFieldCommonProps {
4774
+ /** Non-file field definition */
4775
+ field: Exclude<F0Field, F0FileField>;
4776
+ /** Only supported for file fields */
4777
+ initialFiles?: never;
4778
+ }
4779
+
4780
+ export declare type F0FormFieldProps = F0FormFieldFileProps | F0FormFieldNonFileProps;
4781
+
4687
4782
  /**
4688
4783
  * Union of all F0Form prop variants.
4689
4784
  * The component detects the mode based on whether `schema` is a single Zod schema
@@ -4875,6 +4970,12 @@ declare interface F0FormSubmitConfigBase {
4875
4970
  icon?: IconType | null;
4876
4971
  /** Label shown in the action bar while submitting (defaults to i18n "forms.actionBar.saving") */
4877
4972
  savingMessage?: string;
4973
+ /**
4974
+ * Duration in ms before the success message auto-clears.
4975
+ * - number: auto-clear after this many ms (default: 3000)
4976
+ * - null: never auto-clear (caller is responsible for unmounting)
4977
+ */
4978
+ successMessageDuration?: number | null;
4878
4979
  }
4879
4980
 
4880
4981
  /**
@@ -5468,7 +5569,7 @@ export declare const F0TableOfContentPopover: WithDataTestIdReturnType_3<typeof
5468
5569
  * Internal implementation of the TableOfContentPopover component.
5469
5570
  * This component includes all props including private ones.
5470
5571
  */
5471
- declare function F0TableOfContentPopover_2({ title, items, className, activeItem, collapsible, sortable, onReorder, showChildrenCounter, barsAlign, size, variant, }: F0TableOfContentPopoverProps): JSX_2.Element;
5572
+ declare function F0TableOfContentPopover_2({ title, items, className, activeItem, collapsible, sortable, onReorder, showChildrenCounter, barsAlign, size, variant, portalContainer, }: F0TableOfContentPopoverProps): JSX_2.Element;
5472
5573
 
5473
5574
  declare interface F0TableOfContentPopoverProps extends Omit<TOCProps, "showSearchBox" | "title" | "hideChildrenCounter"> {
5474
5575
  /** Optional title displayed at the top of the menu popup */
@@ -5483,6 +5584,8 @@ declare interface F0TableOfContentPopoverProps extends Omit<TOCProps, "showSearc
5483
5584
  size?: PopupSize;
5484
5585
  /** Visual variant: "dark" for light backgrounds (default), "light" for dark backgrounds */
5485
5586
  variant?: TableOfContentPopoverVariant;
5587
+ /** Container element for the portal. When inside a modal, pass the modal's container to prevent focus/click issues */
5588
+ portalContainer?: HTMLElement | null;
5486
5589
  }
5487
5590
 
5488
5591
  export declare const F0TagAlert: WithDataTestIdReturnType_4<ForwardRefExoticComponent<Props_2 & RefAttributes<HTMLDivElement>>>;
@@ -5948,6 +6051,30 @@ export declare type FlagAvatarVariant = Extract<AvatarVariant, {
5948
6051
  type: "flag";
5949
6052
  }>;
5950
6053
 
6054
+ export declare type FlatFormItem = {
6055
+ type: "section-header";
6056
+ id: string;
6057
+ section: SectionElement;
6058
+ } | {
6059
+ type: "question";
6060
+ id: string;
6061
+ question: QuestionElement;
6062
+ } | {
6063
+ type: "section-end";
6064
+ id: string;
6065
+ sectionId: string;
6066
+ };
6067
+
6068
+ export declare type FlatQuestion = {
6069
+ id: string;
6070
+ type: string;
6071
+ required?: boolean;
6072
+ sectionTitle?: string;
6073
+ sectionDescription?: string;
6074
+ };
6075
+
6076
+ export declare function flattenElements(elements: SurveyFormBuilderElement[]): FlatFormItem[];
6077
+
5951
6078
  /** Flex direction */
5952
6079
  export declare type FlexDirectionToken = "row" | "column" | "row-reverse" | "column-reverse";
5953
6080
 
@@ -5960,6 +6087,23 @@ declare const fontSizes: readonly ["sm", "md", "lg"];
5960
6087
 
5961
6088
  /* Excluded from this release type: FormDefinitionItem */
5962
6089
 
6090
+ /**
6091
+ * Standalone form field props — decoupled from react-hook-form.
6092
+ * This is the minimal contract that field renderers need to operate.
6093
+ */
6094
+ export declare interface FormFieldProps {
6095
+ /** Current field value */
6096
+ value: unknown;
6097
+ /** Called when the field value changes */
6098
+ onChange: (value: unknown) => void;
6099
+ /** Called when the field loses focus (used for validation triggers) */
6100
+ onBlur: () => void;
6101
+ /** Field name (defaults to field.id if not provided) */
6102
+ name?: string;
6103
+ /** Ref callback for the underlying input element */
6104
+ ref?: React.RefCallback<HTMLElement>;
6105
+ }
6106
+
5963
6107
  /** Fraction tokens for proportional widths */
5964
6108
  export declare type FractionToken = "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "5/6";
5965
6109
 
@@ -6418,6 +6562,21 @@ export declare interface InitialFile {
6418
6562
  size?: number;
6419
6563
  }
6420
6564
 
6565
+ /**
6566
+ * Re-inject section-end markers into a flat list that has none.
6567
+ *
6568
+ * Uses `inSectionQuestionIds` (the set of question IDs that originally
6569
+ * belonged to *any* section) to determine where each section ends:
6570
+ * - Questions in the set stay inside the current section.
6571
+ * - Original standalone questions (NOT in the set) cause the section to close
6572
+ * before them so they remain standalone.
6573
+ *
6574
+ * This allows cross-section moves (a question from section B placed after
6575
+ * section A's header joins section A) while keeping standalone questions
6576
+ * outside sections unless the user explicitly drags them between section items.
6577
+ */
6578
+ export declare function injectSectionEnds(items: FlatFormItem[], inSectionQuestionIds: Set<string>): FlatFormItem[];
6579
+
6421
6580
  declare const INPUTFIELD_SIZES: readonly ["sm", "md"];
6422
6581
 
6423
6582
  declare type InputFieldInheritedProps = (typeof inputFieldInheritedProps)[number];
@@ -6658,6 +6817,10 @@ declare type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
6658
6817
  disabled?: boolean;
6659
6818
  };
6660
6819
 
6820
+ declare type LinkQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
6821
+ value?: string | null;
6822
+ };
6823
+
6661
6824
  export declare const linkVariants: readonly ["link", "unstyled", "mention"];
6662
6825
 
6663
6826
  /**
@@ -7043,6 +7206,10 @@ declare type NumericFormatterOptions = {
7043
7206
  useGrouping?: boolean;
7044
7207
  };
7045
7208
 
7209
+ declare type NumericQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
7210
+ value?: number | null;
7211
+ };
7212
+
7046
7213
  /**
7047
7214
  * Numeric size scale matching core spacing (relativeSpacing).
7048
7215
  * Maps 1:1 to Tailwind classes like w-0, w-4, w-8, w-16, etc.
@@ -7111,11 +7278,61 @@ declare type NumericWithFormatter = {
7111
7278
 
7112
7279
  export declare function Ol({ children, ...props }: React.HTMLAttributes<HTMLOListElement>): JSX_2.Element;
7113
7280
 
7281
+ export declare type OnAddNewElementParams = {
7282
+ type: ElementType;
7283
+ afterId?: string;
7284
+ };
7285
+
7114
7286
  declare type OnBulkActionCallback<Record extends RecordType, Filters extends FiltersDefinition> = (...args: [
7115
7287
  action: BulkAction,
7116
7288
  ...Parameters<OnSelectItemsCallback<Record, Filters>>
7117
7289
  ]) => void;
7118
7290
 
7291
+ declare type OnChangeQuestionParams = BaseQuestionOnChangeParams & ({
7292
+ type: "text" | "longText";
7293
+ value?: string | null;
7294
+ } | {
7295
+ type: "rating";
7296
+ value: number;
7297
+ options?: {
7298
+ value: number;
7299
+ label: string;
7300
+ }[];
7301
+ } | {
7302
+ type: "select";
7303
+ value?: string | null;
7304
+ options: SelectQuestionOption[];
7305
+ } | {
7306
+ type: "multi-select";
7307
+ value?: string[] | null;
7308
+ options: SelectQuestionOption[];
7309
+ } | {
7310
+ type: "dropdown-single";
7311
+ value?: string | null;
7312
+ options?: SelectQuestionOption[];
7313
+ } | {
7314
+ type: "numeric";
7315
+ value?: number | null;
7316
+ } | {
7317
+ type: "link";
7318
+ value?: string | null;
7319
+ } | {
7320
+ type: "date";
7321
+ value?: Date | null;
7322
+ });
7323
+
7324
+ export declare type OnChangeSectionParams = {
7325
+ id: string;
7326
+ title: string;
7327
+ description?: string;
7328
+ questions?: QuestionElement[];
7329
+ };
7330
+
7331
+ export declare type OnDuplicateElementParams = {
7332
+ elementId: string;
7333
+ type: ElementType;
7334
+ };
7335
+
7119
7336
  export declare const OneFilterPicker: <Definition extends FiltersDefinition>(props: OneFilterPickerRootProps<Definition> & {
7120
7337
  dataTestId?: string;
7121
7338
  }) => ReactElement | null;
@@ -7562,6 +7779,30 @@ declare type Props_3 = {
7562
7779
  list?: TagCounterItem[];
7563
7780
  };
7564
7781
 
7782
+ export declare type QuestionActionParams = {
7783
+ questionId: string;
7784
+ type: ActionType;
7785
+ index: number;
7786
+ };
7787
+
7788
+ export declare type QuestionElement = Omit<TextQuestionProps, QuestionPropsToOmit> | Omit<RatingQuestionProps & {
7789
+ type: "rating";
7790
+ }, QuestionPropsToOmit> | Omit<SelectQuestionProps & {
7791
+ type: "select" | "multi-select";
7792
+ }, QuestionPropsToOmit> | Omit<DropdownSingleQuestionProps & {
7793
+ type: "dropdown-single";
7794
+ }, QuestionPropsToOmit> | Omit<NumericQuestionProps & {
7795
+ type: "numeric";
7796
+ }, QuestionPropsToOmit> | Omit<LinkQuestionProps & {
7797
+ type: "link";
7798
+ }, QuestionPropsToOmit> | Omit<DateQuestionProps & {
7799
+ type: "date";
7800
+ }, QuestionPropsToOmit>;
7801
+
7802
+ declare type QuestionPropsToOmit = "onAction" | "onChange" | "onAddNewElement";
7803
+
7804
+ export declare type QuestionType = "rating" | "select" | "multi-select" | "dropdown-single" | "text" | "longText" | "numeric" | "link" | "date";
7805
+
7565
7806
  export declare interface RadarChartConfig {
7566
7807
  type: "radar";
7567
7808
  /** Fill the radar area. @default true */
@@ -7574,6 +7815,17 @@ export declare interface RadarChartConfig {
7574
7815
  valueFormatter?: (value: number) => string;
7575
7816
  }
7576
7817
 
7818
+ declare type RatingQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
7819
+ value?: number;
7820
+ } & {
7821
+ options: {
7822
+ value: number;
7823
+ label: string;
7824
+ }[];
7825
+ };
7826
+
7827
+ export declare function reconstructElements(flatItems: FlatFormItem[]): SurveyFormBuilderElement[];
7828
+
7577
7829
  /**
7578
7830
  * Utility type to get all possible paths through an object using dot notation
7579
7831
  * @template T - The object type to traverse
@@ -7741,8 +7993,24 @@ declare type SecondaryActionsDefinition = {
7741
7993
 
7742
7994
  declare type SecondaryActionsItems = SecondaryActionItem[] | SecondaryActionItem[][] | SecondaryActionGroup[];
7743
7995
 
7996
+ export declare type SectionActionParams = {
7997
+ sectionId: string;
7998
+ type: ActionType;
7999
+ index: number;
8000
+ };
8001
+
7744
8002
  /* Excluded from this release type: SectionDefinition */
7745
8003
 
8004
+ export declare type SectionElement = Omit<SectionProps, "onAction" | "onChange">;
8005
+
8006
+ declare type SectionProps = {
8007
+ id: string;
8008
+ title: string;
8009
+ description?: string;
8010
+ locked?: boolean;
8011
+ questions?: QuestionElement[];
8012
+ };
8013
+
7746
8014
  /**
7747
8015
  * Conditional rendering for sections - can be a condition object or a function
7748
8016
  */
@@ -7817,6 +8085,23 @@ export declare type SelectionStatus<R extends RecordType, Filters extends Filter
7817
8085
  totalKnownItemsCount: number;
7818
8086
  };
7819
8087
 
8088
+ export declare type SelectQuestionOption = {
8089
+ id?: string;
8090
+ value: string;
8091
+ label: string;
8092
+ correct?: boolean;
8093
+ };
8094
+
8095
+ declare type SelectQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
8096
+ options: SelectQuestionOption[];
8097
+ } & ({
8098
+ type: "select";
8099
+ value?: string | null;
8100
+ } | {
8101
+ type: "multi-select";
8102
+ value?: string[] | null;
8103
+ });
8104
+
7820
8105
  /**
7821
8106
  * Base for select-specific conditions
7822
8107
  */
@@ -7942,6 +8227,87 @@ declare type SummaryKey<Definition extends SummariesDefinition> = Definition ext
7942
8227
 
7943
8228
  declare type SummaryType = "sum";
7944
8229
 
8230
+ export declare function SurveyAnsweringForm({ elements, onSubmit, mode, title, isOpen, onClose, fullscreen: fullscreenProp, allowToChangeFullscreen, defaultValues, errorTriggerMode, }: SurveyAnsweringFormProps): JSX_2.Element;
8231
+
8232
+ export declare type SurveyAnsweringFormMode = "stepped" | "all-questions";
8233
+
8234
+ export declare interface SurveyAnsweringFormProps {
8235
+ elements: SurveyFormBuilderElement[];
8236
+ onSubmit: (answers: SurveySubmitAnswers) => Promise<SurveyFormSubmitResult> | SurveyFormSubmitResult;
8237
+ mode: SurveyAnsweringFormMode;
8238
+ title: string;
8239
+ isOpen: boolean;
8240
+ onClose: () => void;
8241
+ fullscreen?: boolean;
8242
+ allowToChangeFullscreen?: boolean;
8243
+ defaultValues?: Partial<SurveyAnswers>;
8244
+ errorTriggerMode?: F0FormErrorTriggerMode;
8245
+ }
8246
+
8247
+ export declare type SurveyAnswers = Record<string, SurveyAnswerValue>;
8248
+
8249
+ export declare type SurveyAnswerValue = {
8250
+ type: "text" | "longText";
8251
+ value: string | null;
8252
+ } | {
8253
+ type: "rating";
8254
+ value: number | null;
8255
+ } | {
8256
+ type: "select";
8257
+ value: string | null;
8258
+ } | {
8259
+ type: "multi-select";
8260
+ value: string[] | null;
8261
+ } | {
8262
+ type: "dropdown-single";
8263
+ value: string | null;
8264
+ } | {
8265
+ type: "numeric";
8266
+ value: number | null;
8267
+ } | {
8268
+ type: "link";
8269
+ value: string | null;
8270
+ } | {
8271
+ type: "date";
8272
+ value: Date | null;
8273
+ };
8274
+
8275
+ export declare const SurveyFormBuilder: WithDataTestIdReturnType_7<({ elements: elementsProp, disabled, onChange, disallowOptionalQuestions, allowedQuestionTypes, applyingChanges, }: SurveyFormBuilderProps) => JSX_2.Element>;
8276
+
8277
+ export declare type SurveyFormBuilderCallbacks = {
8278
+ onQuestionChange?: (params: OnChangeQuestionParams) => void;
8279
+ onSectionChange?: (params: OnChangeSectionParams) => void;
8280
+ onAddNewElement?: (params: OnAddNewElementParams) => void;
8281
+ onDuplicateElement?: (params: OnDuplicateElementParams) => void;
8282
+ };
8283
+
8284
+ export declare type SurveyFormBuilderElement = {
8285
+ type: "section";
8286
+ section: SectionElement;
8287
+ } | {
8288
+ type: "question";
8289
+ question: QuestionElement;
8290
+ };
8291
+
8292
+ export declare type SurveyFormBuilderProps = {
8293
+ elements: SurveyFormBuilderElement[];
8294
+ onChange: (elements: SurveyFormBuilderElement[]) => void;
8295
+ disabled?: boolean;
8296
+ disallowOptionalQuestions?: boolean;
8297
+ allowedQuestionTypes?: QuestionType[];
8298
+ applyingChanges?: boolean;
8299
+ };
8300
+
8301
+ export declare type SurveyFormSubmitResult = {
8302
+ success: true;
8303
+ message?: string;
8304
+ } | {
8305
+ success: false;
8306
+ errors?: Record<string, string>;
8307
+ };
8308
+
8309
+ export declare type SurveySubmitAnswers = Record<string, string | number | string[] | Date | null>;
8310
+
7945
8311
  /**
7946
8312
  * All valid renderIf conditions for switch fields
7947
8313
  */
@@ -8069,6 +8435,8 @@ declare type TableVisualizationSettings = {
8069
8435
  hidden?: ColId[];
8070
8436
  };
8071
8437
 
8438
+ declare type TableVisualizationType = "table" | "editableTable";
8439
+
8072
8440
  export declare const Tag: WithDataTestIdReturnType_4<({ tag }: {
8073
8441
  tag: TagVariant_2;
8074
8442
  }) => ReactNode>;
@@ -8300,6 +8668,11 @@ declare interface TextProps extends Omit<default_2.HTMLAttributes<HTMLElement>,
8300
8668
  required?: boolean;
8301
8669
  }
8302
8670
 
8671
+ declare type TextQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
8672
+ type: "text" | "longText";
8673
+ value?: string | null;
8674
+ };
8675
+
8303
8676
  /**
8304
8677
  * Base for text-specific conditions
8305
8678
  */