@factorialco/f0-react 1.372.0 → 1.372.1

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.
@@ -18,8 +18,6 @@ import { ClassValue } from 'cva';
18
18
  import { CompanyCellValue } from './types/company';
19
19
  import { CompanyCellValue as CompanyCellValue_2 } from '../../../ui/value-display/types/company';
20
20
  import { ComponentProps } from 'react';
21
- import { ControllerProps } from 'react-hook-form';
22
- import { ControllerRenderProps } from 'react-hook-form';
23
21
  import { CopilotKitProps } from '@copilotkit/react-core';
24
22
  import { CountryCellValue } from './types/country';
25
23
  import { DateCellValue } from './types/date';
@@ -34,8 +32,6 @@ import { Editor } from '@tiptap/react';
34
32
  import { F0SelectProps as F0SelectProps_2 } from './types';
35
33
  import { f1Colors } from '@factorialco/f0-core';
36
34
  import { FC } from 'react';
37
- import { FieldPath } from 'react-hook-form';
38
- import { FieldValues } from 'react-hook-form';
39
35
  import { FileCellValue } from './types/file';
40
36
  import { FileCellValue as FileCellValue_2 } from '../../../ui/value-display/types/file';
41
37
  import { FolderCellValue } from './types/folder';
@@ -57,7 +53,6 @@ import { NumberCellValue } from './types/number';
57
53
  import { NumberCellValue as NumberCellValue_2 } from '../../../ui/value-display/types/number';
58
54
  import { NumberFilterOptions } from './NumberFilter/NumberFilter';
59
55
  import { Observable } from 'zen-observable-ts';
60
- import { Path } from 'react-hook-form';
61
56
  import { PercentageCellValue } from './types/percentage';
62
57
  import { PersonCellValue } from './types/person';
63
58
  import { PersonCellValue as PersonCellValue_2 } from '../../../ui/value-display/types/person';
@@ -86,16 +81,10 @@ import { TeamCellValue as TeamCellValue_2 } from '../../../ui/value-display/type
86
81
  import { TextCellValue } from './types/text';
87
82
  import { TextCellValue as TextCellValue_2 } from '../../../ui/value-display/types/text';
88
83
  import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
89
- import { useForm } from 'react-hook-form';
90
- import { UseFormHandleSubmit } from 'react-hook-form';
91
- import { UseFormProps } from 'react-hook-form';
92
- import { UseFormReturn } from 'react-hook-form';
93
84
  import { ValueDisplayRendererContext as ValueDisplayRendererContext_2 } from '../../../ui/value-display';
94
85
  import { VariantProps } from 'cva';
95
86
  import { VerticalBarChartProps } from '../../../components/Charts/VerticalBarChart';
96
87
  import { WidgetProps as WidgetProps_2 } from '../Widget';
97
- import { z } from 'zod';
98
- import { ZodType } from 'zod';
99
88
 
100
89
  declare type Action = {
101
90
  label: string;
@@ -119,6 +108,8 @@ export declare type ActionBarGroup = {
119
108
 
120
109
  export declare type ActionBarItem = ActionType_2;
121
110
 
111
+ export declare type ActionBarStatus = "idle" | "loading" | "success";
112
+
122
113
  declare type ActionBaseProps = ActionCommonProps & DataAttributes;
123
114
 
124
115
  declare type ActionButtonProps = ActionBaseProps & {
@@ -2685,6 +2676,8 @@ declare const defaultTranslations: {
2685
2676
  readonly forms: {
2686
2677
  readonly actionBar: {
2687
2678
  readonly unsavedChanges: "You have changes pending to be saved";
2679
+ readonly saving: "Saving...";
2680
+ readonly saved: "Your changes have been saved";
2688
2681
  readonly discard: "Discard";
2689
2682
  readonly issues: {
2690
2683
  readonly one: "{{count}} issue";
@@ -2981,7 +2974,7 @@ declare type ExtractVisualizationSettings<T> = T extends {
2981
2974
  };
2982
2975
  } ? S : never;
2983
2976
 
2984
- export declare const F0ActionBar: ({ isOpen, secondaryActions, label, variant, leftContent, centerInFrameContent, ...props }: F0ActionBarProps) => JSX_2.Element;
2977
+ export declare const F0ActionBar: ({ isOpen, secondaryActions, label, variant, leftContent, centerInFrameContent, status, ...props }: F0ActionBarProps) => JSX_2.Element;
2985
2978
 
2986
2979
  declare interface F0ActionBarProps {
2987
2980
  /**
@@ -3017,6 +3010,14 @@ declare interface F0ActionBarProps {
3017
3010
  * @default false
3018
3011
  */
3019
3012
  centerInFrameContent?: boolean;
3013
+ /**
3014
+ * The current status of the action bar.
3015
+ * - "idle": Default state, shows an alert icon (pending changes)
3016
+ * - "loading": Shows a spinner and disables all actions
3017
+ * - "success": Shows a checkmark icon and disables all actions
3018
+ * @default "idle"
3019
+ */
3020
+ status?: ActionBarStatus;
3020
3021
  }
3021
3022
 
3022
3023
  export declare const F0AiBanner: ForwardRefExoticComponent<AiBannerInternalProps & RefAttributes<HTMLDivElement>> & {
@@ -3586,34 +3587,6 @@ declare type FontSize = (typeof fontSizes)[number];
3586
3587
 
3587
3588
  declare const fontSizes: readonly ["sm", "md", "lg"];
3588
3589
 
3589
- export declare function Form<Schema extends SchemaType, FormData extends InferSchema<Schema>>({ onSubmit, children, ...form }: {
3590
- children: React.ReactNode;
3591
- } & FormType<Schema, FormData>): JSX_2.Element;
3592
-
3593
- export declare function FormActions<Schema extends SchemaType, FormData extends InferSchema<Schema>>({ submitLabel, form, }: {
3594
- submitLabel: string;
3595
- form: FormType<Schema, FormData>;
3596
- }): JSX_2.Element;
3597
-
3598
- declare type FormError<Fields extends FieldValues> = {
3599
- success: false;
3600
- rootMessage?: string;
3601
- errors: Partial<Record<Path<Fields>, string>>;
3602
- };
3603
-
3604
- export declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ label, description, children, ...props }: FormFieldProps<TFieldValues, TName> & {
3605
- children: (field: ControllerRenderProps<TFieldValues>) => JSX.Element;
3606
- }) => JSX_2.Element;
3607
-
3608
- export declare type FormFieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = Pick<ControllerProps<TFieldValues, TName>, "name" | "control"> & {
3609
- label: string;
3610
- description?: string;
3611
- };
3612
-
3613
- declare type FormType<T extends SchemaType, FormType extends InferSchema<T>> = UseFormReturn<FormType, unknown, undefined> & {
3614
- onSubmit: ReturnType<UseFormHandleSubmit<FormType>>;
3615
- };
3616
-
3617
3590
  declare interface FrameContextType {
3618
3591
  isSmallScreen: boolean;
3619
3592
  isLastToggleInvokedByUser: boolean;
@@ -3846,8 +3819,6 @@ declare type InferRecord<S> = S extends {
3846
3819
  dataAdapter: DataCollectionDataAdapter<infer R, any, any>;
3847
3820
  } ? R : never;
3848
3821
 
3849
- declare type InferSchema<T extends SchemaType> = z.infer<T>;
3850
-
3851
3822
  export declare type InFilterDefinition<T = string | number, R extends RecordType = RecordType> = BaseFilterDefinition<"in"> & {
3852
3823
  options: InFilterOptions_2<T, R>;
3853
3824
  };
@@ -4893,8 +4864,6 @@ export declare type OnSelectItemsCallback<R extends RecordType, Filters extends
4893
4864
  byLane?: Record<string, SelectedItemsDetailedStatus<R, Filters>>;
4894
4865
  }, clearSelectedItems: () => void, handleSelectAll?: (checked: boolean) => void) => void;
4895
4866
 
4896
- declare type OnSubmitHandler<TFieldValues extends FieldValues, TTransformedValues extends FieldValues | undefined = undefined> = (data: ReturnType<UseFormHandleSubmit<TFieldValues, TTransformedValues>>) => Promise<Success | FormError<TFieldValues>> | Success | FormError<TFieldValues>;
4897
-
4898
4867
  declare type OpenLinkActionType = {
4899
4868
  type: "open-link";
4900
4869
  href: string;
@@ -5476,8 +5445,6 @@ declare interface RichTextEditorSkeletonProps {
5476
5445
  rows?: number;
5477
5446
  }
5478
5447
 
5479
- declare type SchemaType = ZodType;
5480
-
5481
5448
  export declare const ScrollArea: ForwardRefExoticComponent<Omit<Omit<ScrollAreaProps & RefAttributes<HTMLDivElement>, "ref"> & {
5482
5449
  showBar?: boolean;
5483
5450
  viewportRef?: React.RefObject<HTMLDivElement>;
@@ -5826,12 +5793,6 @@ export declare type subActionType = {
5826
5793
  icon?: IconType;
5827
5794
  };
5828
5795
 
5829
- declare type Success = {
5830
- success: true;
5831
- rootMessage?: never;
5832
- errors?: never;
5833
- };
5834
-
5835
5796
  declare interface SuccessMessageProps {
5836
5797
  title: string;
5837
5798
  description: string;
@@ -6351,10 +6312,6 @@ declare interface UseDataReturn<R extends RecordType> {
6351
6312
  mergedFilters: FiltersState<FiltersDefinition>;
6352
6313
  }
6353
6314
 
6354
- export { useForm }
6355
-
6356
- export declare function useFormSchema<Schema extends SchemaType, FormData extends InferSchema<Schema>>(schema: Schema, options: UseFormProps<FormData>, onSubmit: OnSubmitHandler<FormData>): FormType<Schema, FormData>;
6357
-
6358
6315
  export declare const useInfiniteScrollPagination: (paginationInfo: PaginationInfo | null, isLoading: boolean, isLoadingMore: boolean, loadMore: () => void) => {
6359
6316
  loadingIndicatorRef: RefObject<HTMLTableCellElement>;
6360
6317
  };