@factorialco/f0-react 1.436.1 → 1.437.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.
@@ -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;
@@ -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-CFs2gP7X.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-CFs2gP7X.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
@@ -7016,6 +7058,13 @@ export declare type F0SelectTagProp = string | {
7016
7058
  src?: string;
7017
7059
  };
7018
7060
 
7061
+ /**
7062
+ * Config for string fields rendered as grouped radio cards
7063
+ */
7064
+ declare type F0StringCardSelectConfig = F0BaseConfig & F0CardSelectConfig & {
7065
+ fieldType: "cardSelect";
7066
+ };
7067
+
7019
7068
  /**
7020
7069
  * Union of all string field configs
7021
7070
  *
@@ -7023,7 +7072,7 @@ export declare type F0SelectTagProp = string | {
7023
7072
  * @typeParam TConfig - Type of the fieldConfig object (for custom fields)
7024
7073
  * @typeParam R - Record type for data source (when using source instead of options)
7025
7074
  */
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>;
7075
+ 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
7076
 
7028
7077
  /**
7029
7078
  * Config for file fields (single file upload, form value is a string identifier)
@@ -7066,6 +7115,12 @@ export declare interface F0SwitchConfig {
7066
7115
  * moreInfoLink: { href: "https://help.example.com/article", label: "Learn more" }
7067
7116
  */
7068
7117
  moreInfoLink?: F0MoreInfoLink;
7118
+ /**
7119
+ * When false, prevents this switch from being grouped with adjacent switches
7120
+ * into a single bordered container. Renders as a standalone field instead.
7121
+ * @default true
7122
+ */
7123
+ grouped?: boolean;
7069
7124
  }
7070
7125
 
7071
7126
  /**
@@ -7075,6 +7130,8 @@ export declare type F0SwitchField = F0BaseField & {
7075
7130
  type: "switch";
7076
7131
  /** Link displayed below the help text, typically pointing to external documentation */
7077
7132
  moreInfoLink?: F0MoreInfoLink;
7133
+ /** When false, renders as a standalone field instead of grouping with adjacent switches */
7134
+ grouped?: boolean;
7078
7135
  /** Conditional rendering based on another field's value */
7079
7136
  renderIf?: SwitchFieldRenderIf;
7080
7137
  };
@@ -7405,7 +7462,7 @@ export declare function fieldsToSeconds(fields: DurationFields): number;
7405
7462
  /**
7406
7463
  * Field types for rendering
7407
7464
  */
7408
- export declare type FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "custom";
7465
+ export declare type FieldType = "text" | "number" | "duration" | "textarea" | "select" | "checkbox" | "switch" | "date" | "time" | "datetime" | "daterange" | "richtext" | "file" | "cardSelect" | "custom";
7409
7466
 
7410
7467
  export declare type FileAvatarVariant = Extract<AvatarVariant, {
7411
7468
  type: "file";