@factorialco/f0-react 1.436.1 → 1.438.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/ai.d.ts CHANGED
@@ -1969,11 +1969,6 @@ declare module "gridstack" {
1969
1969
  }
1970
1970
 
1971
1971
 
1972
- declare namespace Calendar {
1973
- var displayName: string;
1974
- }
1975
-
1976
-
1977
1972
  declare module "@tiptap/core" {
1978
1973
  interface Commands<ReturnType> {
1979
1974
  aiBlock: {
@@ -2021,3 +2016,8 @@ declare module "@tiptap/core" {
2021
2016
  };
2022
2017
  }
2023
2018
  }
2019
+
2020
+
2021
+ declare namespace Calendar {
2022
+ var displayName: string;
2023
+ }
@@ -1432,6 +1432,8 @@ export declare interface CardSelectableItem<T extends CardSelectableValue> {
1432
1432
  href: string;
1433
1433
  label?: string;
1434
1434
  };
1435
+ /** Custom content rendered inside the card when it is selected, with an expand/collapse animation */
1436
+ selectedContent?: ReactNode;
1435
1437
  }
1436
1438
 
1437
1439
  export declare interface CardSelectableMultipleProps<T extends CardSelectableValue> {
@@ -6406,11 +6408,11 @@ declare const spinnerVariants: (props?: ({
6406
6408
 
6407
6409
  export declare const Split: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6408
6410
  overflow?: "hidden" | "auto" | undefined;
6409
- paddingX?: "none" | "p-2" | "p-4" | "p-8" | "p-12" | "p-16" | undefined;
6411
+ paddingX?: "none" | "p-4" | "p-2" | "p-8" | "p-12" | "p-16" | undefined;
6410
6412
  maxWidth?: "md" | "sm" | "xs" | "xl" | "screen-sm" | "screen-md" | "screen-lg" | "screen-xl" | "screen-2xl" | undefined;
6411
6413
  height?: "auto" | "full" | undefined;
6412
6414
  width?: "auto" | "full" | undefined;
6413
- paddingY?: "none" | "p-2" | "p-4" | "p-8" | "p-12" | "p-16" | undefined;
6415
+ paddingY?: "none" | "p-4" | "p-2" | "p-8" | "p-12" | "p-16" | undefined;
6414
6416
  basis?: "0" | undefined;
6415
6417
  inline?: boolean | undefined;
6416
6418
  justifyContent?: "center" | "end" | "start" | "space-between" | "stretch" | undefined;
@@ -6436,11 +6438,11 @@ className?: ClassValue;
6436
6438
 
6437
6439
  export declare const Stack: ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
6438
6440
  overflow?: "hidden" | "auto" | undefined;
6439
- paddingX?: "none" | "p-2" | "p-4" | "p-8" | "p-12" | "p-16" | undefined;
6441
+ paddingX?: "none" | "p-4" | "p-2" | "p-8" | "p-12" | "p-16" | undefined;
6440
6442
  maxWidth?: "md" | "sm" | "xs" | "xl" | "screen-sm" | "screen-md" | "screen-lg" | "screen-xl" | "screen-2xl" | undefined;
6441
6443
  height?: "auto" | "full" | undefined;
6442
6444
  width?: "auto" | "full" | undefined;
6443
- paddingY?: "none" | "p-2" | "p-4" | "p-8" | "p-12" | "p-16" | undefined;
6445
+ paddingY?: "none" | "p-4" | "p-2" | "p-8" | "p-12" | "p-16" | undefined;
6444
6446
  basis?: "0" | undefined;
6445
6447
  inline?: boolean | undefined;
6446
6448
  justifyContent?: "center" | "end" | "start" | "space-between" | "stretch" | undefined;
@@ -7515,11 +7517,6 @@ declare module "gridstack" {
7515
7517
  }
7516
7518
 
7517
7519
 
7518
- declare namespace Calendar {
7519
- var displayName: string;
7520
- }
7521
-
7522
-
7523
7520
  declare module "@tiptap/core" {
7524
7521
  interface Commands<ReturnType> {
7525
7522
  aiBlock: {
@@ -7567,3 +7564,8 @@ declare module "@tiptap/core" {
7567
7564
  };
7568
7565
  }
7569
7566
  }
7567
+
7568
+
7569
+ declare namespace Calendar {
7570
+ var displayName: string;
7571
+ }
@@ -3,8 +3,8 @@ import { f1 as jN, f0 as VN, ai as WN, e_ as UN, fl as GN, az as KN, e$ as qN, a
3
3
  import { jsx as c, jsxs as g, Fragment as re } from "react/jsx-runtime";
4
4
  import * as he from "react";
5
5
  import ne, { forwardRef as F, useRef as K, useTransition as op, useState as L, useLayoutEffect as Ca, useContext as Es, createContext as Ds, useCallback as J, useMemo as ee, useEffect as W, useId as Sa, useImperativeHandle as Na, memo as Ia, Fragment as lp, isValidElement as ap, cloneElement as Aa, Children as _a } from "react";
6
- import { C as cp, m as dp, N as He, o as ot, q as Te, t as up, v as sr, w as Ue, x as Ta, y as Oe, z as Rs, E as $e, G as wo, H as fp, I as Ea, J as Ie, K as ze, O as vn, Q as vr, U as Da, W as hp, X as Ht, Y as pp, Z as mp, a0 as gp, a1 as Fn, a2 as zn, a3 as Ls, a4 as bp, a5 as Ra, a6 as La, a7 as Ma, a8 as wp, a9 as Oa, aa as Fa, ab as za, ac as Pa, ad as $a, ae as Ba, n as xo, af as xp, ag as yo, ah as yp, ai as vp, aj as kp, ak as Ha, al as Cp, am as Sp, an as Np, ao as ja, e as Ri, ap as Ip, aq as Ap, ar as _p, as as Tp, at as Ep, au as Dp, av as Rp, M as Lp, aw as Mp, ax as Op, ay as Fp, az as zp, u as Va, aA as Pp, aB as $p, aC as Bp, aD as Hp, aE as jp, aF as Vp, aG as vo, aH as Wp, aI as Up, aJ as Gp } from "./index-B0hDgrco.js";
7
- import { A as xI, f as yI, B as vI, a as kI, g as CI, j as SI, D as NI, F as II, b as AI, aM as _I, aK as TI, aL as EI, L as DI, h as RI, i as LI, k as MI, c as OI, R as FI, S as zI, T as PI, V as $I, _ as BI, l as HI, p as jI, s as VI } from "./index-B0hDgrco.js";
6
+ import { C as cp, m as dp, N as He, o as ot, q as Te, t as up, v as sr, w as Ue, x as Ta, y as Oe, z as Rs, E as $e, G as wo, H as fp, I as Ea, J as Ie, K as ze, O as vn, Q as vr, U as Da, W as hp, X as Ht, Y as pp, Z as mp, a0 as gp, a1 as Fn, a2 as zn, a3 as Ls, a4 as bp, a5 as Ra, a6 as La, a7 as Ma, a8 as wp, a9 as Oa, aa as Fa, ab as za, ac as Pa, ad as $a, ae as Ba, n as xo, af as xp, ag as yo, ah as yp, ai as vp, aj as kp, ak as Ha, al as Cp, am as Sp, an as Np, ao as ja, e as Ri, ap as Ip, aq as Ap, ar as _p, as as Tp, at as Ep, au as Dp, av as Rp, M as Lp, aw as Mp, ax as Op, ay as Fp, az as zp, u as Va, aA as Pp, aB as $p, aC as Bp, aD as Hp, aE as jp, aF as Vp, aG as vo, aH as Wp, aI as Up, aJ as Gp } from "./index-Ddy5at5O.js";
7
+ import { A as xI, f as yI, B as vI, a as kI, g as CI, j as SI, D as NI, F as II, b as AI, aM as _I, aK as TI, aL as EI, L as DI, h as RI, i as LI, k as MI, c as OI, R as FI, S as zI, T as PI, V as $I, _ as BI, l as HI, p as jI, s as VI } from "./index-Ddy5at5O.js";
8
8
  import './experimental.css';const Kp = Uu("Search", [
9
9
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
10
10
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
package/dist/f0.d.ts CHANGED
@@ -1774,6 +1774,8 @@ export declare interface CardSelectableItem<T extends CardSelectableValue> {
1774
1774
  href: string;
1775
1775
  label?: string;
1776
1776
  };
1777
+ /** Custom content rendered inside the card when it is selected, with an expand/collapse animation */
1778
+ selectedContent?: ReactNode;
1777
1779
  }
1778
1780
 
1779
1781
  export declare interface CardSelectableMultipleProps<T extends CardSelectableValue> {
@@ -1820,6 +1822,26 @@ export declare interface CardSelectableSingleProps<T extends CardSelectableValue
1820
1822
 
1821
1823
  export declare type CardSelectableValue = string | number;
1822
1824
 
1825
+ declare type CardSelectFieldRenderIf = CardSelectRenderIfCondition | CommonRenderIfCondition | F0BaseFieldRenderIfFunction;
1826
+
1827
+ declare interface CardSelectOption {
1828
+ value: string;
1829
+ label: string;
1830
+ description?: string;
1831
+ }
1832
+
1833
+ declare interface CardSelectRenderIfBase {
1834
+ fieldId: string;
1835
+ }
1836
+
1837
+ declare type CardSelectRenderIfCondition = CardSelectRenderIfBase & ({
1838
+ equalsTo: string;
1839
+ } | {
1840
+ notEqualsTo: string;
1841
+ } | {
1842
+ isEmpty: boolean;
1843
+ });
1844
+
1823
1845
  declare type CardVisualizationOptions<T, _Filters extends FiltersDefinition, _Sortings extends SortingsDefinition> = {
1824
1846
  cardProperties: ReadonlyArray<CardPropertyDefinition<T>>;
1825
1847
  title: (record: T) => string;
@@ -5037,6 +5059,26 @@ compact?: boolean;
5037
5059
 
5038
5060
  export declare type F0CardProps = Omit<CardInternalProps, (typeof privateProps_3)[number]>;
5039
5061
 
5062
+ declare interface F0CardSelectConfig {
5063
+ options: CardSelectOption[];
5064
+ hideLabel?: boolean;
5065
+ /**
5066
+ * When false, renders each option as a separate bordered card
5067
+ * instead of a single container with dividers.
5068
+ * @default true
5069
+ */
5070
+ grouped?: boolean;
5071
+ }
5072
+
5073
+ declare type F0CardSelectField = F0BaseField & {
5074
+ type: "cardSelect";
5075
+ options: CardSelectOption[];
5076
+ hideLabel?: boolean;
5077
+ /** When false, renders each option as a separate bordered card */
5078
+ grouped?: boolean;
5079
+ renderIf?: CardSelectFieldRenderIf;
5080
+ };
5081
+
5040
5082
  /**
5041
5083
  * @experimental This is an experimental component use it at your own risk
5042
5084
  */
@@ -5838,7 +5880,7 @@ export declare function F0EventCatcherProvider({ children, onEvent, enabled, cat
5838
5880
  /**
5839
5881
  * Union of all F0 field types used for rendering
5840
5882
  */
5841
- export declare type F0Field = F0TextField | F0NumberField | F0DurationField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0TimeField | F0DateTimeField | F0DateRangeField | F0RichTextField | F0FileField | F0CustomField;
5883
+ export declare type F0Field = F0TextField | F0NumberField | F0DurationField | F0TextareaField | F0SelectField | F0CheckboxField | F0SwitchField | F0DateField | F0TimeField | F0DateTimeField | F0DateRangeField | F0RichTextField | F0FileField | F0CardSelectField | F0CustomField;
5842
5884
 
5843
5885
  /**
5844
5886
  * Alert configuration for a field.
@@ -5873,12 +5915,12 @@ export declare type F0FieldAlertProps = Omit<F0AlertProps, "variant"> & {
5873
5915
  * @typeParam T - The value type for select fields (string or number)
5874
5916
  * @typeParam R - Record type for data source (when using source instead of options)
5875
5917
  */
5876
- export declare type F0FieldConfig<T extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>> = F0StringConfig<string, undefined, R> | F0NumberFieldConfig<R> | F0BooleanConfig | F0DateFieldConfig | F0TimeFieldConfig | F0DateTimeFieldConfig | F0ArrayConfig<T, R> | F0FileFieldConfig | F0ObjectConfig;
5918
+ export declare type F0FieldConfig<T extends string | number = string | number, R extends Record<string, unknown> = Record<string, unknown>> = F0StringConfig<string, undefined, R> | F0NumberFieldConfig<R> | F0BooleanConfig | F0DateFieldConfig | F0TimeFieldConfig | F0DateTimeFieldConfig | F0ArrayConfig<T, R> | F0FileFieldConfig | F0ObjectConfig | F0StringCardSelectConfig;
5877
5919
 
5878
5920
  /**
5879
5921
  * Field types for rendering
5880
5922
  */
5881
- export declare type F0FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "custom";
5923
+ export declare type F0FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "cardSelect" | "custom";
5882
5924
 
5883
5925
  /**
5884
5926
  * F0 config options specific to file fields
@@ -6120,7 +6162,7 @@ export declare function f0FormField<T extends z.ZodDate>(schema: T, config: F0Da
6120
6162
  * Enum field - select
6121
6163
  * @typeParam R - Record type for data source (when using source instead of options)
6122
6164
  */
6123
- export declare function f0FormField<T extends z.ZodEnum<[string, ...string[]]>, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0StringSelectConfig<R>): T & F0ZodType<T>;
6165
+ export declare function f0FormField<T extends z.ZodEnum<[string, ...string[]]>, R extends Record<string, unknown> = Record<string, unknown>>(schema: T, config: F0StringSelectConfig<R> | F0StringCardSelectConfig): T & F0ZodType<T>;
6124
6166
 
6125
6167
  /**
6126
6168
  * Array field - multi-select
@@ -6433,6 +6475,10 @@ export declare interface F0FormRef {
6433
6475
  * Get the list of field names in the form
6434
6476
  */
6435
6477
  getFieldNames: () => string[];
6478
+ /**
6479
+ * Access the action bar imperatively (e.g. to trigger a wiggle animation)
6480
+ */
6481
+ actionBar: F0ActionBarRef;
6436
6482
  /* Excluded from this release type: _setStateCallback */
6437
6483
  }
6438
6484
 
@@ -7016,6 +7062,13 @@ export declare type F0SelectTagProp = string | {
7016
7062
  src?: string;
7017
7063
  };
7018
7064
 
7065
+ /**
7066
+ * Config for string fields rendered as grouped radio cards
7067
+ */
7068
+ declare type F0StringCardSelectConfig = F0BaseConfig & F0CardSelectConfig & {
7069
+ fieldType: "cardSelect";
7070
+ };
7071
+
7019
7072
  /**
7020
7073
  * Union of all string field configs
7021
7074
  *
@@ -7023,7 +7076,7 @@ export declare type F0SelectTagProp = string | {
7023
7076
  * @typeParam TConfig - Type of the fieldConfig object (for custom fields)
7024
7077
  * @typeParam R - Record type for data source (when using source instead of options)
7025
7078
  */
7026
- export declare type F0StringConfig<TValue = string, TConfig = undefined, R extends Record<string, unknown> = Record<string, unknown>> = F0StringTextConfig | F0StringTextareaConfig | F0StringSelectConfig<R> | F0StringFileConfig | F0CustomFieldConfig<TValue, TConfig>;
7079
+ export declare type F0StringConfig<TValue = string, TConfig = undefined, R extends Record<string, unknown> = Record<string, unknown>> = F0StringTextConfig | F0StringTextareaConfig | F0StringSelectConfig<R> | F0StringCardSelectConfig | F0StringFileConfig | F0CustomFieldConfig<TValue, TConfig>;
7027
7080
 
7028
7081
  /**
7029
7082
  * Config for file fields (single file upload, form value is a string identifier)
@@ -7066,6 +7119,12 @@ export declare interface F0SwitchConfig {
7066
7119
  * moreInfoLink: { href: "https://help.example.com/article", label: "Learn more" }
7067
7120
  */
7068
7121
  moreInfoLink?: F0MoreInfoLink;
7122
+ /**
7123
+ * When false, prevents this switch from being grouped with adjacent switches
7124
+ * into a single bordered container. Renders as a standalone field instead.
7125
+ * @default true
7126
+ */
7127
+ grouped?: boolean;
7069
7128
  }
7070
7129
 
7071
7130
  /**
@@ -7075,6 +7134,8 @@ export declare type F0SwitchField = F0BaseField & {
7075
7134
  type: "switch";
7076
7135
  /** Link displayed below the help text, typically pointing to external documentation */
7077
7136
  moreInfoLink?: F0MoreInfoLink;
7137
+ /** When false, renders as a standalone field instead of grouping with adjacent switches */
7138
+ grouped?: boolean;
7078
7139
  /** Conditional rendering based on another field's value */
7079
7140
  renderIf?: SwitchFieldRenderIf;
7080
7141
  };
@@ -7405,7 +7466,7 @@ export declare function fieldsToSeconds(fields: DurationFields): number;
7405
7466
  /**
7406
7467
  * Field types for rendering
7407
7468
  */
7408
- export declare type FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "custom";
7469
+ export declare type FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "cardSelect" | "custom";
7409
7470
 
7410
7471
  export declare type FileAvatarVariant = Extract<AvatarVariant, {
7411
7472
  type: "file";
@@ -11681,11 +11742,6 @@ declare module "gridstack" {
11681
11742
  }
11682
11743
 
11683
11744
 
11684
- declare namespace Calendar {
11685
- var displayName: string;
11686
- }
11687
-
11688
-
11689
11745
  declare module "@tiptap/core" {
11690
11746
  interface Commands<ReturnType> {
11691
11747
  aiBlock: {
@@ -11733,3 +11789,8 @@ declare module "@tiptap/core" {
11733
11789
  };
11734
11790
  }
11735
11791
  }
11792
+
11793
+
11794
+ declare namespace Calendar {
11795
+ var displayName: string;
11796
+ }