@factorialco/f0-react 1.293.0 → 1.295.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.
@@ -121,6 +121,10 @@ declare type ActionButtonProps = ActionBaseProps & {
121
121
  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
122
122
  };
123
123
 
124
+ declare type ActionButtonVariant = (typeof actionButtonVariants)[number];
125
+
126
+ declare const actionButtonVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "ai"];
127
+
124
128
  declare interface ActionCommonProps {
125
129
  /**
126
130
  * Tooltip
@@ -307,7 +311,7 @@ declare type actionType_2 = {
307
311
 
308
312
  declare type ActionVariant = (typeof actionVariants)[number];
309
313
 
310
- declare const actionVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "link", "unstyled", "mention"];
314
+ declare const actionVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "ai", "link", "unstyled", "mention"];
311
315
 
312
316
  export declare const ActivityItemList: (({ items, loadingMoreItems, onClickItem, onEndReached, onEndReachedItemsThreshold, }: ActivityItemListProps) => default_2.JSX.Element) & {
313
317
  Skeleton: () => default_2.JSX.Element;
@@ -1042,7 +1046,7 @@ declare type ButtonDropdownItem<T = string> = {
1042
1046
  description?: string;
1043
1047
  };
1044
1048
 
1045
- declare type ButtonInternalProps = Pick<ActionProps, "size" | "disabled" | "className" | "pressed" | "compact" | "variant" | "tooltip"> & DataAttributes & {
1049
+ declare type ButtonInternalProps = Pick<ActionProps, "size" | "disabled" | "className" | "pressed" | "compact" | "tooltip"> & DataAttributes & {
1046
1050
  /**
1047
1051
  * The aria-label of the button if not provided title or label will be used.
1048
1052
  */
@@ -1050,7 +1054,7 @@ declare type ButtonInternalProps = Pick<ActionProps, "size" | "disabled" | "clas
1050
1054
  /**
1051
1055
  * The variant of the button.
1052
1056
  */
1053
- variant?: ButtonVariant;
1057
+ variant?: ActionButtonVariant;
1054
1058
  /**
1055
1059
  * Callback fired when the button is clicked. Supports async functions for loading state.
1056
1060
  */
@@ -1136,9 +1140,7 @@ declare type ButtonType = (typeof buttonTypes)[number];
1136
1140
 
1137
1141
  declare const buttonTypes: readonly ["button", "submit", "reset"];
1138
1142
 
1139
- declare type ButtonVariant = (typeof buttonVariants)[number];
1140
-
1141
- declare const buttonVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote"];
1143
+ declare type ButtonVariant = Exclude<(typeof actionButtonVariants)[number], "ai">;
1142
1144
 
1143
1145
  export declare type CalendarDate = {
1144
1146
  day: number;
@@ -1906,7 +1908,7 @@ export declare type DataSourceDefinition<R extends RecordType = RecordType, Filt
1906
1908
  /** Selectable items value under the checkbox column (undefined if not selectable) */
1907
1909
  selectable?: (item: R) => string | number | undefined;
1908
1910
  /** Default selected items */
1909
- defaultSelectedItems?: SelectedItemsState;
1911
+ defaultSelectedItems?: SelectedItemsState<R>;
1910
1912
  /***** GROUPING ***************************************************/
1911
1913
  /** Grouping configuration */
1912
1914
  grouping?: Grouping;
@@ -2215,6 +2217,7 @@ declare const defaultTranslations: {
2215
2217
  readonly selected: {
2216
2218
  readonly singular: "Selected";
2217
2219
  readonly plural: "Selected";
2220
+ readonly all: "All selected";
2218
2221
  };
2219
2222
  };
2220
2223
  readonly filters: {
@@ -2854,7 +2857,9 @@ declare type F0AvatarTeamProps = {
2854
2857
  badge?: AvatarBadge;
2855
2858
  } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
2856
2859
 
2857
- declare type F0ButtonProps = Omit<ButtonInternalProps, (typeof privateProps)[number]>;
2860
+ declare type F0ButtonProps = Omit<ButtonInternalProps, (typeof privateProps)[number] | "variant"> & {
2861
+ variant?: Exclude<ButtonInternalProps["variant"], "ai">;
2862
+ };
2858
2863
 
2859
2864
  export declare const F0Callout: ForwardRefExoticComponent<CalloutInternalProps & RefAttributes<HTMLDivElement>> & {
2860
2865
  Skeleton: ({ compact, variant }: CalloutSkeletonProps) => JSX_2.Element;
@@ -2870,6 +2875,26 @@ declare interface F0IconProps extends SVGProps<SVGSVGElement>, VariantProps<type
2870
2875
  color?: "default" | "currentColor" | `#${string}` | Lowercase<NestedKeyOf<typeof f1Colors.icon>>;
2871
2876
  }
2872
2877
 
2878
+ /**
2879
+ * Base props shared across all F0Select variants
2880
+ */
2881
+ declare type F0SelectBaseProps<T extends string, R = unknown> = {
2882
+ onChangeSelectedOption?: (option: F0SelectItemObject<T, ResolvedRecordType<R>> | undefined, checked: boolean) => void;
2883
+ children?: React.ReactNode;
2884
+ open?: boolean;
2885
+ showSearchBox?: boolean;
2886
+ searchBoxPlaceholder?: string;
2887
+ onSearchChange?: (value: string) => void;
2888
+ searchValue?: string;
2889
+ onOpenChange?: (open: boolean) => void;
2890
+ searchEmptyMessage?: string;
2891
+ className?: string;
2892
+ selectContentClassName?: string;
2893
+ actions?: Action[];
2894
+ /** Container element to render the portal content into */
2895
+ portalContainer?: HTMLElement | null;
2896
+ };
2897
+
2873
2898
  declare type F0SelectItemObject<T, R = unknown> = {
2874
2899
  type?: "item";
2875
2900
  value: T;
@@ -2893,42 +2918,43 @@ export { F0SelectItemProps as SelectItemProps }
2893
2918
  /**
2894
2919
  * Select component for choosing from a list of options.
2895
2920
  *
2896
- * @template T - The type of the emitted value
2921
+ * @template T - The type of the emitted value
2897
2922
  * @template R - The type of the record/item data (used with data source)
2898
- *
2899
2923
  */
2900
- declare type F0SelectProps<T extends string, R = unknown> = {
2901
- onChangeSelectedOption?: (option: F0SelectItemObject<T, ResolvedRecordType<R>> | undefined, checked: boolean) => void;
2902
- children?: React.ReactNode;
2903
- open?: boolean;
2904
- showSearchBox?: boolean;
2905
- searchBoxPlaceholder?: string;
2906
- onSearchChange?: (value: string) => void;
2907
- searchValue?: string;
2908
- onOpenChange?: (open: boolean) => void;
2909
- searchEmptyMessage?: string;
2910
- className?: string;
2911
- selectContentClassName?: string;
2912
- actions?: Action[];
2913
- portalContainer?: HTMLElement | null;
2914
- } & ({
2924
+ declare type F0SelectProps<T extends string, R = unknown> = F0SelectBaseProps<T, R> & // Single select not clearable
2925
+ ({
2915
2926
  clearable?: false;
2916
2927
  multiple?: false;
2917
2928
  value?: T;
2918
2929
  defaultItem?: F0SelectItemObject<T, ResolvedRecordType<R>>;
2919
2930
  onChange?: (value: T, originalItem?: ResolvedRecordType<R> | undefined, option?: F0SelectItemObject<T, ResolvedRecordType<R>>) => void;
2931
+ /** Callback for selection changes - provides full selection state for advanced use cases (e.g., "Select All" with exclusions) */
2932
+ onSelectItems?: never;
2920
2933
  } | {
2921
2934
  clearable: true;
2922
2935
  multiple?: false;
2923
2936
  value?: T;
2924
2937
  defaultItem?: F0SelectItemObject<T, ResolvedRecordType<R>>;
2925
2938
  onChange?: (value: T, originalItem?: ResolvedRecordType<R> | undefined, option?: F0SelectItemObject<T, ResolvedRecordType<R>>) => void;
2939
+ onSelectItems?: never;
2926
2940
  } | {
2927
2941
  multiple: true;
2928
2942
  clearable?: boolean;
2929
2943
  value?: T[];
2930
2944
  defaultItem?: F0SelectItemObject<T, ResolvedRecordType<R>>[];
2931
2945
  onChange?: (value: T[], originalItems: ResolvedRecordType<R>[], options: F0SelectItemObject<T, ResolvedRecordType<R>>[]) => void;
2946
+ /**
2947
+ * Callback for selection changes - provides full selection state including:
2948
+ * - `status.allSelected`: true if "Select All" was used, "indeterminate" if some items deselected after Select All
2949
+ * - `status.items`: Map of all items with their checked state
2950
+ * - `filters`: Current applied filters
2951
+ * - `selectedCount`: Total number of selected items
2952
+ *
2953
+ * Use this for "chunked" selection mode where you need to track:
2954
+ * - When allSelected is true/indeterminate: excluded items are those with checked=false
2955
+ * - When allSelected is false: included items are those with checked=true
2956
+ */
2957
+ onSelectItems?: OnSelectItemsCallback<ResolvedRecordType<R>, FiltersDefinition>;
2932
2958
  }) & ({
2933
2959
  source: DataSourceDefinition<ResolvedRecordType<R>, FiltersDefinition, SortingsDefinition, GroupingDefinition<ResolvedRecordType<R>>>;
2934
2960
  mapOptions: (item: ResolvedRecordType<R>) => F0SelectItemProps<T, ResolvedRecordType<R>>;
@@ -5206,10 +5232,13 @@ export declare type SelectedItems<T> = ReadonlyArray<T>;
5206
5232
 
5207
5233
  export declare type SelectedItemsDetailedStatus<R extends RecordType, Filters extends FiltersDefinition> = {
5208
5234
  allSelected: boolean | "indeterminate";
5235
+ /** Status of items that have been loaded. Items not yet loaded won't appear here. */
5209
5236
  itemsStatus: ReadonlyArray<{
5210
5237
  item: R;
5211
5238
  checked: boolean;
5212
5239
  }>;
5240
+ /** All selected item IDs, including those not yet loaded */
5241
+ selectedIds: ReadonlyArray<SelectionId>;
5213
5242
  groupsStatus: Record<string, boolean>;
5214
5243
  filters: FiltersState<Filters>;
5215
5244
  selectedCount: number;
@@ -5218,18 +5247,23 @@ export declare type SelectedItemsDetailedStatus<R extends RecordType, Filters ex
5218
5247
  /**
5219
5248
  * Represents the selected items by id
5220
5249
  */
5221
- export declare type SelectedItemsState = {
5222
- allSelected?: boolean | "indeterminate";
5223
- items?: ReadonlyArray<{
5224
- id: string;
5225
- checked: boolean;
5226
- }>;
5227
- groups?: ReadonlyArray<{
5228
- groupId: string;
5229
- checked: boolean;
5230
- }>;
5250
+ export declare type SelectedItemsState<R extends RecordType> = {
5251
+ allSelected: boolean | "indeterminate";
5252
+ items: Map<SelectedItemState<R>["id"], SelectedItemState<R>>;
5253
+ groups: Map<SelectedState["id"], SelectedState>;
5254
+ };
5255
+
5256
+ export declare type SelectedItemState<R extends RecordType> = SelectedState & {
5257
+ item?: WithGroupId<R>;
5258
+ };
5259
+
5260
+ export declare type SelectedState = {
5261
+ id: SelectionId;
5262
+ checked: boolean;
5231
5263
  };
5232
5264
 
5265
+ export declare type SelectionId = number | string;
5266
+
5233
5267
  export declare type SelectQuestionOption = {
5234
5268
  id?: string;
5235
5269
  value: string;
@@ -6334,6 +6368,11 @@ declare module "gridstack" {
6334
6368
  }
6335
6369
 
6336
6370
 
6371
+ declare namespace Calendar {
6372
+ var displayName: string;
6373
+ }
6374
+
6375
+
6337
6376
  declare module "@tiptap/core" {
6338
6377
  interface Commands<ReturnType> {
6339
6378
  moodTracker: {
@@ -6341,8 +6380,3 @@ declare module "@tiptap/core" {
6341
6380
  };
6342
6381
  }
6343
6382
  }
6344
-
6345
-
6346
- declare namespace Calendar {
6347
- var displayName: string;
6348
- }