@factorialco/f0-react 1.294.0 → 1.296.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.
@@ -110,6 +110,13 @@ declare type Action_2 = {
110
110
  variant?: "default" | "outline" | "promote";
111
111
  };
112
112
 
113
+ export declare type ActionBarGroup = {
114
+ label?: string;
115
+ items: ActionBarItem[];
116
+ };
117
+
118
+ export declare type ActionBarItem = ActionType_2;
119
+
113
120
  declare type ActionBaseProps = ActionCommonProps & DataAttributes;
114
121
 
115
122
  declare type ActionButtonProps = ActionBaseProps & {
@@ -298,7 +305,14 @@ export declare type actionType = {
298
305
  icon?: IconType;
299
306
  };
300
307
 
301
- declare type ActionType_2 = CopyActionType | NavigateActionType | OpenLinkActionType;
308
+ declare type ActionType_2 = {
309
+ label: string;
310
+ icon?: IconType;
311
+ onClick?: () => void;
312
+ disabled?: boolean;
313
+ critical?: boolean;
314
+ description?: string;
315
+ };
302
316
 
303
317
  declare type actionType_2 = {
304
318
  label: string;
@@ -309,6 +323,8 @@ declare type actionType_2 = {
309
323
  variant?: "default" | "outline" | "neutral";
310
324
  };
311
325
 
326
+ declare type ActionType_3 = CopyActionType | NavigateActionType | OpenLinkActionType;
327
+
312
328
  declare type ActionVariant = (typeof actionVariants)[number];
313
329
 
314
330
  declare const actionVariants: readonly ["default", "outline", "critical", "neutral", "ghost", "promote", "outlinePromote", "ai", "link", "unstyled", "mention"];
@@ -1567,7 +1583,7 @@ declare const CompanyItem: ForwardRefExoticComponent<CompanyItemProps & RefAttri
1567
1583
  declare type CompanyItemProps = {
1568
1584
  name: string;
1569
1585
  avatarUrl?: URL_2;
1570
- action?: ActionType_2;
1586
+ action?: ActionType_3;
1571
1587
  };
1572
1588
 
1573
1589
  export declare function CompanySelector({ companies, selected, onChange, isLoading, withNotification, additionalOptions, }: CompanySelectorProps): JSX_2.Element;
@@ -1908,7 +1924,7 @@ export declare type DataSourceDefinition<R extends RecordType = RecordType, Filt
1908
1924
  /** Selectable items value under the checkbox column (undefined if not selectable) */
1909
1925
  selectable?: (item: R) => string | number | undefined;
1910
1926
  /** Default selected items */
1911
- defaultSelectedItems?: SelectedItemsState;
1927
+ defaultSelectedItems?: SelectedItemsState<R>;
1912
1928
  /***** GROUPING ***************************************************/
1913
1929
  /** Grouping configuration */
1914
1930
  grouping?: Grouping;
@@ -2217,6 +2233,7 @@ declare const defaultTranslations: {
2217
2233
  readonly selected: {
2218
2234
  readonly singular: "Selected";
2219
2235
  readonly plural: "Selected";
2236
+ readonly all: "All selected";
2220
2237
  };
2221
2238
  };
2222
2239
  readonly filters: {
@@ -2592,7 +2609,7 @@ declare type EmployeeItemProps = {
2592
2609
  firstName: string;
2593
2610
  lastName: string;
2594
2611
  avatarUrl?: URL_2;
2595
- action?: ActionType_2;
2612
+ action?: ActionType_3;
2596
2613
  };
2597
2614
 
2598
2615
  declare type EmptyState = {
@@ -2733,6 +2750,27 @@ declare type ExtractVisualizationSettings<T> = T extends {
2733
2750
  };
2734
2751
  } ? S : never;
2735
2752
 
2753
+ export declare const F0ActionBar: ({ isOpen, secondaryActions, label, ...props }: F0ActionBarProps) => JSX_2.Element;
2754
+
2755
+ declare interface F0ActionBarProps {
2756
+ /**
2757
+ * Whether the action bar is open
2758
+ */
2759
+ isOpen: boolean;
2760
+ /**
2761
+ * The primary action
2762
+ */
2763
+ primaryActions?: ActionBarItem[] | ActionBarGroup[] | ActionBarGroup;
2764
+ /**
2765
+ * The secondary actions
2766
+ */
2767
+ secondaryActions?: ActionBarItem[];
2768
+ /**
2769
+ * The label of the action bar
2770
+ */
2771
+ label?: string;
2772
+ }
2773
+
2736
2774
  export declare const F0AiBanner: ForwardRefExoticComponent<AiBannerInternalProps & RefAttributes<HTMLDivElement>> & {
2737
2775
  Skeleton: ({ compact }: AiBannerSkeletonProps) => JSX_2.Element;
2738
2776
  };
@@ -2874,6 +2912,26 @@ declare interface F0IconProps extends SVGProps<SVGSVGElement>, VariantProps<type
2874
2912
  color?: "default" | "currentColor" | `#${string}` | Lowercase<NestedKeyOf<typeof f1Colors.icon>>;
2875
2913
  }
2876
2914
 
2915
+ /**
2916
+ * Base props shared across all F0Select variants
2917
+ */
2918
+ declare type F0SelectBaseProps<T extends string, R = unknown> = {
2919
+ onChangeSelectedOption?: (option: F0SelectItemObject<T, ResolvedRecordType<R>> | undefined, checked: boolean) => void;
2920
+ children?: React.ReactNode;
2921
+ open?: boolean;
2922
+ showSearchBox?: boolean;
2923
+ searchBoxPlaceholder?: string;
2924
+ onSearchChange?: (value: string) => void;
2925
+ searchValue?: string;
2926
+ onOpenChange?: (open: boolean) => void;
2927
+ searchEmptyMessage?: string;
2928
+ className?: string;
2929
+ selectContentClassName?: string;
2930
+ actions?: Action[];
2931
+ /** Container element to render the portal content into */
2932
+ portalContainer?: HTMLElement | null;
2933
+ };
2934
+
2877
2935
  declare type F0SelectItemObject<T, R = unknown> = {
2878
2936
  type?: "item";
2879
2937
  value: T;
@@ -2897,42 +2955,43 @@ export { F0SelectItemProps as SelectItemProps }
2897
2955
  /**
2898
2956
  * Select component for choosing from a list of options.
2899
2957
  *
2900
- * @template T - The type of the emitted value
2958
+ * @template T - The type of the emitted value
2901
2959
  * @template R - The type of the record/item data (used with data source)
2902
- *
2903
2960
  */
2904
- declare type F0SelectProps<T extends string, R = unknown> = {
2905
- onChangeSelectedOption?: (option: F0SelectItemObject<T, ResolvedRecordType<R>> | undefined, checked: boolean) => void;
2906
- children?: React.ReactNode;
2907
- open?: boolean;
2908
- showSearchBox?: boolean;
2909
- searchBoxPlaceholder?: string;
2910
- onSearchChange?: (value: string) => void;
2911
- searchValue?: string;
2912
- onOpenChange?: (open: boolean) => void;
2913
- searchEmptyMessage?: string;
2914
- className?: string;
2915
- selectContentClassName?: string;
2916
- actions?: Action[];
2917
- portalContainer?: HTMLElement | null;
2918
- } & ({
2961
+ declare type F0SelectProps<T extends string, R = unknown> = F0SelectBaseProps<T, R> & // Single select not clearable
2962
+ ({
2919
2963
  clearable?: false;
2920
2964
  multiple?: false;
2921
2965
  value?: T;
2922
2966
  defaultItem?: F0SelectItemObject<T, ResolvedRecordType<R>>;
2923
2967
  onChange?: (value: T, originalItem?: ResolvedRecordType<R> | undefined, option?: F0SelectItemObject<T, ResolvedRecordType<R>>) => void;
2968
+ /** Callback for selection changes - provides full selection state for advanced use cases (e.g., "Select All" with exclusions) */
2969
+ onSelectItems?: never;
2924
2970
  } | {
2925
2971
  clearable: true;
2926
2972
  multiple?: false;
2927
2973
  value?: T;
2928
2974
  defaultItem?: F0SelectItemObject<T, ResolvedRecordType<R>>;
2929
2975
  onChange?: (value: T, originalItem?: ResolvedRecordType<R> | undefined, option?: F0SelectItemObject<T, ResolvedRecordType<R>>) => void;
2976
+ onSelectItems?: never;
2930
2977
  } | {
2931
2978
  multiple: true;
2932
2979
  clearable?: boolean;
2933
2980
  value?: T[];
2934
2981
  defaultItem?: F0SelectItemObject<T, ResolvedRecordType<R>>[];
2935
2982
  onChange?: (value: T[], originalItems: ResolvedRecordType<R>[], options: F0SelectItemObject<T, ResolvedRecordType<R>>[]) => void;
2983
+ /**
2984
+ * Callback for selection changes - provides full selection state including:
2985
+ * - `status.allSelected`: true if "Select All" was used, "indeterminate" if some items deselected after Select All
2986
+ * - `status.items`: Map of all items with their checked state
2987
+ * - `filters`: Current applied filters
2988
+ * - `selectedCount`: Total number of selected items
2989
+ *
2990
+ * Use this for "chunked" selection mode where you need to track:
2991
+ * - When allSelected is true/indeterminate: excluded items are those with checked=false
2992
+ * - When allSelected is false: included items are those with checked=true
2993
+ */
2994
+ onSelectItems?: OnSelectItemsCallback<ResolvedRecordType<R>, FiltersDefinition>;
2936
2995
  }) & ({
2937
2996
  source: DataSourceDefinition<ResolvedRecordType<R>, FiltersDefinition, SortingsDefinition, GroupingDefinition<ResolvedRecordType<R>>>;
2938
2997
  mapOptions: (item: ResolvedRecordType<R>) => F0SelectItemProps<T, ResolvedRecordType<R>>;
@@ -3618,7 +3677,7 @@ declare type ItemDefinition = {
3618
3677
  declare type ItemProps = {
3619
3678
  text: string;
3620
3679
  icon?: IconType;
3621
- action?: ActionType_2;
3680
+ action?: ActionType_3;
3622
3681
  };
3623
3682
 
3624
3683
  declare type Items = typeof Item_2 | typeof PersonItem | typeof CompanyItem | typeof TeamItem;
@@ -5210,10 +5269,13 @@ export declare type SelectedItems<T> = ReadonlyArray<T>;
5210
5269
 
5211
5270
  export declare type SelectedItemsDetailedStatus<R extends RecordType, Filters extends FiltersDefinition> = {
5212
5271
  allSelected: boolean | "indeterminate";
5272
+ /** Status of items that have been loaded. Items not yet loaded won't appear here. */
5213
5273
  itemsStatus: ReadonlyArray<{
5214
5274
  item: R;
5215
5275
  checked: boolean;
5216
5276
  }>;
5277
+ /** All selected item IDs, including those not yet loaded */
5278
+ selectedIds: ReadonlyArray<SelectionId>;
5217
5279
  groupsStatus: Record<string, boolean>;
5218
5280
  filters: FiltersState<Filters>;
5219
5281
  selectedCount: number;
@@ -5222,18 +5284,23 @@ export declare type SelectedItemsDetailedStatus<R extends RecordType, Filters ex
5222
5284
  /**
5223
5285
  * Represents the selected items by id
5224
5286
  */
5225
- export declare type SelectedItemsState = {
5226
- allSelected?: boolean | "indeterminate";
5227
- items?: ReadonlyArray<{
5228
- id: string;
5229
- checked: boolean;
5230
- }>;
5231
- groups?: ReadonlyArray<{
5232
- groupId: string;
5233
- checked: boolean;
5234
- }>;
5287
+ export declare type SelectedItemsState<R extends RecordType> = {
5288
+ allSelected: boolean | "indeterminate";
5289
+ items: Map<SelectedItemState<R>["id"], SelectedItemState<R>>;
5290
+ groups: Map<SelectedState["id"], SelectedState>;
5291
+ };
5292
+
5293
+ export declare type SelectedItemState<R extends RecordType> = SelectedState & {
5294
+ item?: WithGroupId<R>;
5235
5295
  };
5236
5296
 
5297
+ export declare type SelectedState = {
5298
+ id: SelectionId;
5299
+ checked: boolean;
5300
+ };
5301
+
5302
+ export declare type SelectionId = number | string;
5303
+
5237
5304
  export declare type SelectQuestionOption = {
5238
5305
  id?: string;
5239
5306
  value: string;
@@ -5689,7 +5756,7 @@ declare const TeamItem: ForwardRefExoticComponent<TeamItemProps & RefAttributes<
5689
5756
 
5690
5757
  declare type TeamItemProps = {
5691
5758
  name: string;
5692
- action?: ActionType_2;
5759
+ action?: ActionType_3;
5693
5760
  };
5694
5761
 
5695
5762
  export declare const Textarea: React.FC<TextareaProps>;
@@ -6338,11 +6405,6 @@ declare module "@tiptap/core" {
6338
6405
  }
6339
6406
 
6340
6407
 
6341
- declare namespace Calendar {
6342
- var displayName: string;
6343
- }
6344
-
6345
-
6346
6408
  declare module "@tiptap/core" {
6347
6409
  interface Commands<ReturnType> {
6348
6410
  moodTracker: {
@@ -6350,3 +6412,8 @@ declare module "@tiptap/core" {
6350
6412
  };
6351
6413
  }
6352
6414
  }
6415
+
6416
+
6417
+ declare namespace Calendar {
6418
+ var displayName: string;
6419
+ }