@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.
@@ -132,7 +132,7 @@ export declare type ActionBarGroup = {
132
132
  items: ActionBarItem[];
133
133
  };
134
134
 
135
- export declare type ActionBarItem = ActionType_2;
135
+ export declare type ActionBarItem = ActionType;
136
136
 
137
137
  export declare type ActionBarStatus = "idle" | "loading" | "success";
138
138
 
@@ -318,7 +318,14 @@ declare type ActionSize = (typeof actionSizes)[number];
318
318
 
319
319
  declare const actionSizes: readonly ["sm", "md", "lg"];
320
320
 
321
- export declare type ActionType = "duplicate" | "delete";
321
+ declare type ActionType = {
322
+ label: string;
323
+ icon?: IconType;
324
+ onClick?: () => void;
325
+ disabled?: boolean;
326
+ critical?: boolean;
327
+ description?: string;
328
+ };
322
329
 
323
330
  export declare type actionType = {
324
331
  label: string;
@@ -328,15 +335,6 @@ export declare type actionType = {
328
335
  icon?: IconType;
329
336
  };
330
337
 
331
- declare type ActionType_2 = {
332
- label: string;
333
- icon?: IconType;
334
- onClick?: () => void;
335
- disabled?: boolean;
336
- critical?: boolean;
337
- description?: string;
338
- };
339
-
340
338
  declare type ActionVariant = (typeof actionVariants)[number];
341
339
 
342
340
  declare const actionVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "ai", "link", "unstyled", "mention"];
@@ -348,7 +346,7 @@ export declare const ActivityItemList: (({ items, loadingMoreItems, onClickItem,
348
346
  Skeleton: () => default_2.JSX.Element;
349
347
  };
350
348
 
351
- export declare type ActivityItemListProps = Pick<SectionProps_2, "items" | "onClickItem"> & {
349
+ export declare type ActivityItemListProps = Pick<SectionProps, "items" | "onClickItem"> & {
352
350
  onEndReached?: () => void;
353
351
  onEndReachedItemsThreshold?: number;
354
352
  loadingMoreItems?: boolean;
@@ -883,25 +881,6 @@ export declare type BasePaginatedResponse<R> = BaseResponse<R> & {
883
881
  perPage: number;
884
882
  };
885
883
 
886
- export declare type BaseQuestionOnChangeParams = {
887
- id: string;
888
- title?: string;
889
- description?: string;
890
- required?: boolean;
891
- };
892
-
893
- declare type BaseQuestionProps = {
894
- id: string;
895
- title: string;
896
- description?: string;
897
- type: QuestionType;
898
- children: React.ReactNode;
899
- required?: boolean;
900
- locked?: boolean;
901
- };
902
-
903
- declare type BaseQuestionPropsForOtherQuestionComponents = Omit<BaseQuestionProps, "children" | "onChange">;
904
-
905
884
  /**
906
885
  * Base response type for collection data
907
886
  * @template R - The type of records in the collection
@@ -1579,32 +1558,6 @@ declare interface ClockInGraphProps {
1579
1558
 
1580
1559
  declare type ClockInStatus = "clocked-in" | "break" | "clocked-out";
1581
1560
 
1582
- export declare const CoCreationForm: WithDataTestIdReturnType_4<({ elements: elementsProp, isEditMode, onChange, disallowOptionalQuestions, allowedQuestionTypes, applyingChanges, }: CoCreationFormProps) => JSX_2.Element>;
1583
-
1584
- export declare type CoCreationFormCallbacks = {
1585
- onQuestionChange?: (params: OnChangeQuestionParams) => void;
1586
- onSectionChange?: (params: OnChangeSectionParams) => void;
1587
- onAddNewElement?: (params: OnAddNewElementParams) => void;
1588
- onDuplicateElement?: (params: OnDuplicateElementParams) => void;
1589
- };
1590
-
1591
- export declare type CoCreationFormElement = {
1592
- type: "section";
1593
- section: SectionElement;
1594
- } | {
1595
- type: "question";
1596
- question: QuestionElement;
1597
- };
1598
-
1599
- export declare type CoCreationFormProps = {
1600
- elements: CoCreationFormElement[];
1601
- onChange: (elements: CoCreationFormElement[]) => void;
1602
- isEditMode?: boolean;
1603
- disallowOptionalQuestions?: boolean;
1604
- allowedQuestionTypes?: QuestionType[];
1605
- applyingChanges?: boolean;
1606
- };
1607
-
1608
1561
  declare type ColId = string;
1609
1562
 
1610
1563
  /**
@@ -1628,7 +1581,7 @@ export declare type CollectionProps<Record extends RecordType, Filters extends F
1628
1581
  */
1629
1582
  tmpFullWidth?: boolean;
1630
1583
  /** Indicates the source visualization type */
1631
- fromVisualization?: "table" | "editableTable";
1584
+ fromVisualization?: TableVisualizationType;
1632
1585
  } & VisualizationOptions;
1633
1586
 
1634
1587
  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>> = {
@@ -1740,8 +1693,6 @@ declare type CompareToDef = {
1740
1693
 
1741
1694
  declare type CompareToDefKey = string;
1742
1695
 
1743
- export declare function computeSectionEndIds(elements: CoCreationFormElement[]): Set<string>;
1744
-
1745
1696
  declare type Content = (ComponentProps<typeof DataList.Item> & {
1746
1697
  type: "item";
1747
1698
  }) | (ComponentProps<typeof DataList.PersonItem> & {
@@ -2178,10 +2129,6 @@ export declare interface DatePreset {
2178
2129
  value: DateRange | (() => DateRange);
2179
2130
  }
2180
2131
 
2181
- declare type DateQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
2182
- value?: Date | null;
2183
- };
2184
-
2185
2132
  export declare type DateRange = {
2186
2133
  from: Date;
2187
2134
  to?: Date;
@@ -2677,7 +2624,7 @@ declare const defaultTranslations: {
2677
2624
  readonly dismiss: "Dismiss";
2678
2625
  };
2679
2626
  };
2680
- readonly coCreationForm: {
2627
+ readonly surveyFormBuilder: {
2681
2628
  readonly actions: {
2682
2629
  readonly actions: "Actions";
2683
2630
  readonly duplicateQuestion: "Duplicate question";
@@ -2709,7 +2656,11 @@ declare const defaultTranslations: {
2709
2656
  };
2710
2657
  readonly answer: {
2711
2658
  readonly label: "Answer";
2712
- readonly placeholder: "Respondent's answer";
2659
+ readonly dropdownPlaceholder: "Pick an option";
2660
+ readonly textPlaceholder: "Type your answer";
2661
+ readonly numericPlaceholder: "Enter a number";
2662
+ readonly linkPlaceholder: "https://example.com";
2663
+ readonly invalidUrl: "Enter a valid URL";
2713
2664
  };
2714
2665
  readonly labels: {
2715
2666
  readonly applyingChanges: "Applying changes";
@@ -2728,6 +2679,16 @@ declare const defaultTranslations: {
2728
2679
  readonly lastQuestionDialogDescription: "Moving this question will leave the section empty and it will be removed. Do you want to continue?";
2729
2680
  };
2730
2681
  };
2682
+ readonly surveyAnsweringForm: {
2683
+ readonly actions: {
2684
+ readonly submit: "Submit survey";
2685
+ readonly cancel: "Cancel";
2686
+ readonly next: "Next";
2687
+ readonly previous: "Previous";
2688
+ readonly expand: "Expand";
2689
+ readonly collapse: "Collapse";
2690
+ };
2691
+ };
2731
2692
  readonly richTextEditor: {
2732
2693
  readonly bold: "Bold";
2733
2694
  readonly italic: "Italic";
@@ -2940,14 +2901,8 @@ declare type DropdownProps = Omit<DropdownInternalProps, (typeof privateProps_4)
2940
2901
  onOpenChange?: (open: boolean) => void;
2941
2902
  } & WithDataTestIdProps;
2942
2903
 
2943
- declare type DropdownSingleQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
2944
- type: "dropdown-single";
2945
- options: SelectQuestionOption[];
2946
- value?: string | null;
2947
- };
2948
-
2949
2904
  /** The edit mode for a column cell in the editable table. */
2950
- declare type EditableTableCellEditType = "text" | "date" | "select" | "multiselect";
2905
+ declare type EditableTableCellEditType = "text" | "date" | "select" | "multiselect" | "display-only" | "disabled";
2951
2906
 
2952
2907
  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>>;
2953
2908
 
@@ -2967,13 +2922,6 @@ declare type EditableTableColumnDefinition<R extends RecordType, Sortings extend
2967
2922
  * When omitted, the cell is always rendered read-only.
2968
2923
  */
2969
2924
  editType?: (item: R) => EditableTableCellEditType | undefined;
2970
- /**
2971
- * Function that determines if the cell should be editable for a given item.
2972
- * The cell is only editable if both `editType` returns a value AND
2973
- * this function returns `true` for the given item.
2974
- * Return `true` for all items to make the column always editable.
2975
- */
2976
- editable: (item: R) => boolean;
2977
2925
  };
2978
2926
 
2979
2927
  declare type EditableTableVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = Omit<TableVisualizationOptions<R, _Filters, Sortings, Summaries>, "columns"> & {
@@ -2999,8 +2947,6 @@ export declare type editorStateType = {
2999
2947
  json: JSONContent | null;
3000
2948
  };
3001
2949
 
3002
- export declare type ElementType = QuestionType | "section";
3003
-
3004
2950
  declare type EmptyState = {
3005
2951
  emoji?: string;
3006
2952
  title: string;
@@ -3829,20 +3775,6 @@ declare type FlagAvatarVariant = Extract<AvatarVariant, {
3829
3775
  type: "flag";
3830
3776
  }>;
3831
3777
 
3832
- export declare type FlatFormItem = {
3833
- type: "section-header";
3834
- id: string;
3835
- section: SectionElement;
3836
- } | {
3837
- type: "question";
3838
- id: string;
3839
- question: QuestionElement;
3840
- } | {
3841
- type: "section-end";
3842
- id: string;
3843
- sectionId: string;
3844
- };
3845
-
3846
3778
  export declare type FlattenedItem = {
3847
3779
  parent: EntitySelectEntity | null;
3848
3780
  subItem: EntitySelectSubEntity & {
@@ -3851,8 +3783,6 @@ export declare type FlattenedItem = {
3851
3783
  };
3852
3784
  };
3853
3785
 
3854
- export declare function flattenElements(elements: CoCreationFormElement[]): FlatFormItem[];
3855
-
3856
3786
  declare type FontSize = (typeof fontSizes)[number];
3857
3787
 
3858
3788
  declare const fontSizes: readonly ["sm", "md", "lg"];
@@ -4169,21 +4099,6 @@ export declare type InfiniteScrollPaginatedResponse<TRecord> = BasePaginatedResp
4169
4099
  hasMore: boolean;
4170
4100
  };
4171
4101
 
4172
- /**
4173
- * Re-inject section-end markers into a flat list that has none.
4174
- *
4175
- * Uses `inSectionQuestionIds` (the set of question IDs that originally
4176
- * belonged to *any* section) to determine where each section ends:
4177
- * - Questions in the set stay inside the current section.
4178
- * - Original standalone questions (NOT in the set) cause the section to close
4179
- * before them so they remain standalone.
4180
- *
4181
- * This allows cross-section moves (a question from section B placed after
4182
- * section A's header joins section A) while keeping standalone questions
4183
- * outside sections unless the user explicitly drags them between section items.
4184
- */
4185
- export declare function injectSectionEnds(items: FlatFormItem[], inSectionQuestionIds: Set<string>): FlatFormItem[];
4186
-
4187
4102
  /**
4188
4103
  * @experimental This is an experimental component use it at your own risk
4189
4104
  */
@@ -4367,10 +4282,6 @@ declare type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
4367
4282
  disabled?: boolean;
4368
4283
  };
4369
4284
 
4370
- declare type LinkQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
4371
- value?: string | null;
4372
- };
4373
-
4374
4285
  /**
4375
4286
  * Group List: Renders the list for a group
4376
4287
  */
@@ -4866,10 +4777,6 @@ declare type NumericFormatterOptions = {
4866
4777
  useGrouping?: boolean;
4867
4778
  };
4868
4779
 
4869
- declare type NumericQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
4870
- value?: number | null;
4871
- };
4872
-
4873
4780
  /**
4874
4781
  * Represents a numeric value that can be formatted with optional units.
4875
4782
  *
@@ -4943,61 +4850,11 @@ declare interface OmniButtonProps {
4943
4850
  hasNewUpdate?: boolean;
4944
4851
  }
4945
4852
 
4946
- export declare type OnAddNewElementParams = {
4947
- type: ElementType;
4948
- afterId?: string;
4949
- };
4950
-
4951
4853
  export declare type OnBulkActionCallback<Record extends RecordType, Filters extends FiltersDefinition> = (...args: [
4952
4854
  action: BulkAction,
4953
4855
  ...Parameters<OnSelectItemsCallback<Record, Filters>>
4954
4856
  ]) => void;
4955
4857
 
4956
- declare type OnChangeQuestionParams = BaseQuestionOnChangeParams & ({
4957
- type: "text" | "longText";
4958
- value?: string | null;
4959
- } | {
4960
- type: "rating";
4961
- value: number;
4962
- options?: {
4963
- value: number;
4964
- label: string;
4965
- }[];
4966
- } | {
4967
- type: "select";
4968
- value?: string | null;
4969
- options: SelectQuestionOption[];
4970
- } | {
4971
- type: "multi-select";
4972
- value?: string[] | null;
4973
- options: SelectQuestionOption[];
4974
- } | {
4975
- type: "dropdown-single";
4976
- value?: string | null;
4977
- options?: SelectQuestionOption[];
4978
- } | {
4979
- type: "numeric";
4980
- value?: number | null;
4981
- } | {
4982
- type: "link";
4983
- value?: string | null;
4984
- } | {
4985
- type: "date";
4986
- value?: Date | null;
4987
- });
4988
-
4989
- export declare type OnChangeSectionParams = {
4990
- id: string;
4991
- title: string;
4992
- description?: string;
4993
- questions?: QuestionElement[];
4994
- };
4995
-
4996
- export declare type OnDuplicateElementParams = {
4997
- elementId: string;
4998
- type: ElementType;
4999
- };
5000
-
5001
4858
  /**
5002
4859
  * @experimental This is an experimental component use it at your own risk
5003
4860
  */
@@ -5713,30 +5570,6 @@ declare type Pulse = (typeof pulses)[number];
5713
5570
 
5714
5571
  declare const pulses: readonly ["superNegative", "negative", "neutral", "positive", "superPositive"];
5715
5572
 
5716
- export declare type QuestionActionParams = {
5717
- questionId: string;
5718
- type: ActionType;
5719
- index: number;
5720
- };
5721
-
5722
- export declare type QuestionElement = Omit<TextQuestionProps, QuestionPropsToOmit> | Omit<RatingQuestionProps & {
5723
- type: "rating";
5724
- }, QuestionPropsToOmit> | Omit<SelectQuestionProps & {
5725
- type: "select" | "multi-select";
5726
- }, QuestionPropsToOmit> | Omit<DropdownSingleQuestionProps & {
5727
- type: "dropdown-single";
5728
- }, QuestionPropsToOmit> | Omit<NumericQuestionProps & {
5729
- type: "numeric";
5730
- }, QuestionPropsToOmit> | Omit<LinkQuestionProps & {
5731
- type: "link";
5732
- }, QuestionPropsToOmit> | Omit<DateQuestionProps & {
5733
- type: "date";
5734
- }, QuestionPropsToOmit>;
5735
-
5736
- declare type QuestionPropsToOmit = "onAction" | "onChange" | "onAddNewElement";
5737
-
5738
- export declare type QuestionType = "rating" | "select" | "multi-select" | "dropdown-single" | "text" | "longText" | "numeric" | "link" | "date";
5739
-
5740
5573
  export declare const RadarChart: RadarChartGeneric;
5741
5574
 
5742
5575
  export declare const _RadarChart: <K extends ChartConfig>({ data, dataConfig, scaleMin, scaleMax, aspect }: RadarChartProps<K>, ref: ForwardedRef<HTMLDivElement>) => JSX_2.Element;
@@ -5753,15 +5586,6 @@ export declare type RadarChartProps<K extends ChartConfig> = {
5753
5586
 
5754
5587
  export declare const rangeSeparator = "\u2192";
5755
5588
 
5756
- declare type RatingQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
5757
- value?: number;
5758
- } & {
5759
- options: {
5760
- value: number;
5761
- label: string;
5762
- }[];
5763
- };
5764
-
5765
5589
  declare interface ReactionProps {
5766
5590
  emoji: string;
5767
5591
  initialCount: number;
@@ -5781,8 +5605,6 @@ declare interface ReactionsProps {
5781
5605
  };
5782
5606
  }
5783
5607
 
5784
- export declare function reconstructElements(flatItems: FlatFormItem[]): CoCreationFormElement[];
5785
-
5786
5608
  /**
5787
5609
  * Utility type to get all possible paths through an object using dot notation
5788
5610
  * @template T - The object type to traverse
@@ -5951,28 +5773,12 @@ export declare type secondaryActionType = (actionType | toggleActionType) & {
5951
5773
  type?: "button" | "switch";
5952
5774
  };
5953
5775
 
5954
- export declare type SectionActionParams = {
5955
- sectionId: string;
5956
- type: ActionType;
5957
- index: number;
5958
- };
5959
-
5960
- export declare type SectionElement = Omit<SectionProps, "onAction" | "onChange">;
5961
-
5962
5776
  /**
5963
5777
  * @experimental This is an experimental component use it at your own risk
5964
5778
  */
5965
5779
  export declare const SectionHeader: ({ title, description, action, link, separator, }: Props_2) => JSX_2.Element;
5966
5780
 
5967
5781
  declare type SectionProps = {
5968
- id: string;
5969
- title: string;
5970
- description?: string;
5971
- locked?: boolean;
5972
- questions?: QuestionElement[];
5973
- };
5974
-
5975
- declare type SectionProps_2 = {
5976
5782
  title: string;
5977
5783
  items: Omit<ActivityItemProps, "onClick">[];
5978
5784
  onClickItem: (id: string) => void;
@@ -6026,23 +5832,6 @@ export declare type SelectedState = {
6026
5832
 
6027
5833
  export declare type SelectionId = number | string;
6028
5834
 
6029
- export declare type SelectQuestionOption = {
6030
- id?: string;
6031
- value: string;
6032
- label: string;
6033
- correct?: boolean;
6034
- };
6035
-
6036
- declare type SelectQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
6037
- options: SelectQuestionOption[];
6038
- } & ({
6039
- type: "select";
6040
- value?: string | null;
6041
- } | {
6042
- type: "multi-select";
6043
- value?: string[] | null;
6044
- });
6045
-
6046
5835
  export declare const selectSizes: readonly ["sm", "md"];
6047
5836
 
6048
5837
  /**
@@ -6435,6 +6224,8 @@ declare type TableVisualizationSettings = {
6435
6224
  hidden?: ColId[];
6436
6225
  };
6437
6226
 
6227
+ export declare type TableVisualizationType = "table" | "editableTable";
6228
+
6438
6229
  /**
6439
6230
  * @experimental This is an experimental component use it at your own risk
6440
6231
  */
@@ -6542,11 +6333,6 @@ declare const Textarea_2: React_2.ForwardRefExoticComponent<Omit<React_2.Textare
6542
6333
 
6543
6334
  export declare type TextareaProps = Pick<ComponentProps<typeof Textarea_2>, "disabled" | "onChange" | "value" | "placeholder" | "rows" | "cols" | "label" | "labelIcon" | "icon" | "hideLabel" | "maxLength" | "clearable" | "onBlur" | "onFocus" | "name" | "status" | "hint" | "error" | "size" | "loading" | "required">;
6544
6335
 
6545
- declare type TextQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
6546
- type: "text" | "longText";
6547
- value?: string | null;
6548
- };
6549
-
6550
6336
  declare const THEMES: {
6551
6337
  readonly light: "";
6552
6338
  readonly dark: ".dark";