@factorialco/f0-react 1.309.1 → 1.311.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/README.md CHANGED
@@ -81,6 +81,6 @@ import "@factorialco/f0-react/dist/styles.css"
81
81
 
82
82
  You can then utilize any of its components:
83
83
 
84
- ```
84
+ ```tsx
85
85
  import { Button } from "@factorialco/f0-react"
86
86
  ```
@@ -6483,6 +6483,11 @@ declare module "gridstack" {
6483
6483
  }
6484
6484
 
6485
6485
 
6486
+ declare namespace Calendar {
6487
+ var displayName: string;
6488
+ }
6489
+
6490
+
6486
6491
  declare module "@tiptap/core" {
6487
6492
  interface Commands<ReturnType> {
6488
6493
  moodTracker: {
@@ -6490,8 +6495,3 @@ declare module "@tiptap/core" {
6490
6495
  };
6491
6496
  }
6492
6497
  }
6493
-
6494
-
6495
- declare namespace Calendar {
6496
- var displayName: string;
6497
- }
@@ -1,5 +1,5 @@
1
- import { bK as Zm, bL as $c, bM as vA, bN as yA, bO as Jm, bP as v7, bQ as Ls, av as c0, bR as Wr, bS as f0, bT as Ts, bU as Tf, az as ii, bV as sl, bW as Xm, bX as xA, e as ks, bY as Vc, bZ as kA, b_ as wA, b$ as bA, c0 as CA, c1 as Ym, c2 as y7, c3 as x7, c4 as _A, c5 as SA, c6 as EA, d as fa, c7 as Qm, c8 as Af, c9 as LA, ca as k7, cb as e3, cc as t3, cd as TA, ce as d0, aI as w7, cf as n3, cg as AA, ch as b7, ci as C7, cj as A5, ck as Nf, cl as NA, cm as MA, cn as OA, co as Ah, cp as FA, cq as DA, cr as IA, m as ye, cs as _7, ct as RA, cu as Mf, l as Ua, cv as zc, z as xd, cw as S7, x as c1, cx as PA, n as Nh, cy as BA, q as HA, r as f1, i as $A, H as VA, J as zA, t as N5, cz as jA, G as M5, cA as WA, N as UA, cB as E7, cC as L7, cD as qA, aA as Te, F as Ve, c as F, cE as Of, cF as i3, cG as r3, cH as Gn, cI as Vn, cJ as Ff, cK as Nl, cL as kd, bG as Ml, b as Je, cM as da, A as dt, b8 as fs, B as Ft, cN as GA, cO as s3, a as Rn, cP as O5, cQ as KA, cR as ZA, cS as JA, aw as T7, ax as A7, cT as N7, cU as M7, cV as Lo, cW as XA, cX as F5, cY as YA, cZ as QA, c_ as eN, w as Kt, S as xe, c$ as u0, d0 as Ci, d1 as o3, ao as Oi, ap as tN, d2 as O7, D as a3, b9 as ol, d3 as t2, d4 as F7, d5 as D7, d6 as I7, d7 as R7, d8 as P7, am as zt, d9 as B7, da as H7, db as $7, dc as V7, dd as z7, de as nN, df as iN, dg as h0, dh as j7, C as rN, bm as sN, di as Fi, au as Zo, g as hn, as as l3, dj as D5, dk as oN, ay as W7, dl as U7, dm as wd, dn as aN, f as ua, dp as Jo, dq as q7, dr as lN, ds as I5, dt as al, du as c3, dv as Df, dw as bd, dx as cN, dy as G7, dz as fN, dA as f3, dB as jc, dC as Di, dD as dN, dE as uN, dF as $s, dG as Mh, dH as hN, dI as fc, dJ as Fa, dK as pN, dL as K7, dM as mN, dN as gN, dO as vN, dP as yN, O as ri, U as xN, Z as kN, _ as wN, a0 as bN, a5 as R5, a6 as P5, a7 as CN, a8 as _N, dQ as SN, dR as Oh, dS as qa, dT as d3, dU as EN, dV as LN, dW as TN, b6 as AN, dX as NN, bH as If, b5 as Cd, dY as n2, dZ as Z7, h as Pi, d_ as p0, b2 as ws, d$ as MN, e0 as ON, e1 as J7, b0 as yr, e2 as FN, e3 as X7, e4 as Y7, e5 as Ol, e6 as u3, e7 as DN, e8 as Q7, e9 as IN, ea as RN, ak as h3, al as p3, an as m3, eb as ex, ec as PN, ed as BN, ee as HN, ef as tx, aE as $N, eg as i2, eh as nx, aZ as _d, ei as VN, ej as zN, ek as jN, el as WN, em as UN, aW as r2, bJ as qN, bI as GN, en as ix, at as ro, eo as KN, ep as ZN, bg as m0, a_ as g3, aT as Rf, eq as rx, b1 as JN, aV as sx, aR as ox, er as XN, es as ax, et as YN, aU as Fl, aX as lx, aG as QN, eu as eM, bo as tM, bp as nM, bw as g0, bu as v3, aC as v0, ev as y0, ew as x0, aD as k0, ex as y3, bv as cx, b4 as x3, ey as iM, bA as rM, ez as s2, eA as sM, eB as Sd, eC as oM, bq as Ed, bB as aM, eD as lM, bz as fx, eE as cM, by as fM, bx as dM, eF as uM, eG as hM, eH as k3, eI as pM, eJ as mM, eK as gM, eL as vM, eM as yM, eN as xM, eO as kM, eP as wM, u as dx, bb as bM, bt as CM, eQ as _M, eR as SM, aY as EM, eS as Pf, eT as w3, b3, eU as C3, eV as Bf, eW as LM, eX as ux, eY as TM, eZ as AM, bC as hx, e_ as px, bd as mx, e$ as NM, f0 as MM, f1 as OM, aF as FM, aa as DM, ab as IM, ad as RM, ae as PM, af as BM, ac as HM, f2 as B5, f3 as $M, f4 as VM, K as zM, f5 as gx, f6 as jM } from "./hooks-BxHngDSH.js";
2
- import { aH as ege, f9 as tge, fa as nge, f8 as ige, a$ as rge, b7 as sge, f7 as oge, ba as age } from "./hooks-BxHngDSH.js";
1
+ import { bN as Zm, bO as $c, bP as vA, bQ as yA, bR as Jm, bS as v7, bT as Ls, az as c0, bU as Wr, bV as f0, bW as Ts, bX as Tf, aD as ii, bY as sl, bZ as Xm, b_ as xA, e as ks, b$ as Vc, c0 as kA, c1 as wA, c2 as bA, c3 as CA, c4 as Ym, c5 as y7, c6 as x7, c7 as _A, c8 as SA, c9 as EA, d as fa, ca as Qm, cb as Af, cc as LA, cd as k7, ce as e3, cf as t3, cg as TA, ch as d0, aM as w7, ci as n3, cj as AA, ck as b7, cl as C7, cm as A5, cn as Nf, co as NA, cp as MA, cq as OA, cr as Ah, cs as FA, ct as DA, cu as IA, m as ye, cv as _7, cw as RA, cx as Mf, l as Ua, cy as zc, z as xd, cz as S7, x as c1, cA as PA, n as Nh, cB as BA, q as HA, r as f1, i as $A, H as VA, J as zA, t as N5, cC as jA, G as M5, cD as WA, N as UA, cE as E7, cF as L7, cG as qA, aE as Te, F as Ve, c as F, cH as Of, cI as i3, cJ as r3, cK as Gn, cL as Vn, cM as Ff, cN as Nl, cO as kd, bJ as Ml, b as Je, cP as da, A as dt, bc as fs, B as Ft, cQ as GA, cR as s3, a as Rn, cS as O5, cT as KA, cU as ZA, cV as JA, aA as T7, aB as A7, cW as N7, cX as M7, cY as Lo, cZ as XA, c_ as F5, c$ as YA, d0 as QA, d1 as eN, w as Kt, S as xe, d2 as u0, d3 as Ci, d4 as o3, as as Oi, at as tN, d5 as O7, D as a3, bd as ol, d6 as t2, d7 as F7, d8 as D7, d9 as I7, da as R7, db as P7, aq as zt, dc as B7, dd as H7, de as $7, df as V7, dg as z7, dh as nN, di as iN, dj as h0, dk as j7, C as rN, bp as sN, dl as Fi, ay as Zo, g as hn, aw as l3, dm as D5, dn as oN, aC as W7, dp as U7, dq as wd, dr as aN, f as ua, ds as Jo, dt as q7, du as lN, dv as I5, dw as al, dx as c3, dy as Df, dz as bd, dA as cN, dB as G7, dC as fN, dD as f3, dE as jc, dF as Di, dG as dN, dH as uN, dI as $s, dJ as Mh, dK as hN, dL as fc, dM as Fa, dN as pN, dO as K7, dP as mN, dQ as gN, dR as vN, dS as yN, O as ri, U as xN, Z as kN, _ as wN, a0 as bN, a5 as R5, a6 as P5, a7 as CN, a8 as _N, dT as SN, dU as Oh, dV as qa, dW as d3, dX as EN, dY as LN, dZ as TN, ba as AN, d_ as NN, bK as If, b9 as Cd, d$ as n2, e0 as Z7, h as Pi, e1 as p0, b6 as ws, e2 as MN, e3 as ON, e4 as J7, b4 as yr, e5 as FN, e6 as X7, e7 as Y7, e8 as Ol, e9 as u3, ea as DN, eb as Q7, ec as IN, ed as RN, ao as h3, ap as p3, ar as m3, ee as ex, ef as PN, eg as BN, eh as HN, ei as tx, aI as $N, ej as i2, ek as nx, b1 as _d, el as VN, em as zN, en as jN, eo as WN, ep as UN, a_ as r2, bM as qN, bL as GN, eq as ix, ax as ro, er as KN, es as ZN, bj as m0, b2 as g3, aX as Rf, et as rx, b5 as JN, aZ as sx, aV as ox, eu as XN, ev as ax, ew as YN, aY as Fl, a$ as lx, aK as QN, ex as eM, br as tM, bs as nM, bz as g0, bx as v3, aG as v0, ey as y0, ez as x0, aH as k0, eA as y3, by as cx, b8 as x3, eB as iM, bD as rM, eC as s2, eD as sM, eE as Sd, eF as oM, bt as Ed, bE as aM, eG as lM, bC as fx, eH as cM, bB as fM, bA as dM, eI as uM, eJ as hM, eK as k3, eL as pM, eM as mM, eN as gM, eO as vM, eP as yM, eQ as xM, eR as kM, eS as wM, u as dx, bf as bM, bw as CM, eT as _M, eU as SM, b0 as EM, eV as Pf, eW as w3, b7 as b3, eX as C3, eY as Bf, eZ as LM, e_ as ux, e$ as TM, f0 as AM, bF as hx, f1 as px, bh as mx, f2 as NM, f3 as MM, f4 as OM, aJ as FM, aa as DM, ab as IM, ad as RM, ae as PM, af as BM, ac as HM, f5 as B5, f6 as $M, f7 as VM, K as zM, f8 as gx, f9 as jM } from "./hooks-ncaiQCro.js";
2
+ import { aL as ege, fc as tge, fd as nge, fb as ige, b3 as rge, bb as sge, fa as oge, be as age } from "./hooks-ncaiQCro.js";
3
3
  import { jsxs as x, jsx as f, Fragment as Ge } from "react/jsx-runtime";
4
4
  import * as Se from "react";
5
5
  import be, { forwardRef as B, createContext as li, useRef as _e, useState as X, useCallback as Ze, useContext as Kn, useMemo as we, useEffect as Ae, PureComponent as WM, useId as go, useTransition as UM, useLayoutEffect as ha, memo as Hf, Fragment as Hr, isValidElement as vx, cloneElement as _3, createElement as o2, useDebugValue as yx, createRef as qM, version as H5, useImperativeHandle as w0, Children as xx } from "react";
@@ -74806,6 +74806,8 @@ function J4e({ title: t, description: e, emoji: n, actions: i }) {
74806
74806
  }
74807
74807
  const A3e = B(({ title: t, children: e }, n) => (jM(t, {
74808
74808
  disallowEmpty: !0
74809
+ }, {
74810
+ componentName: "WidgetSection"
74809
74811
  }), x("div", {
74810
74812
  ref: n,
74811
74813
  className: "flex flex-col gap-2",
package/dist/f0.d.ts CHANGED
@@ -10,6 +10,7 @@ import { AvatarListCellValue as AvatarListCellValue_2 } from './types/avatarList
10
10
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
11
11
  import { AvatarProps as AvatarProps_2 } from '@radix-ui/react-avatar';
12
12
  import { baseColors } from '@factorialco/f0-core';
13
+ import { BigNumberProps as BigNumberProps_2 } from './types';
13
14
  import { BlockContentExtraProps } from './blocks/BlockContent';
14
15
  import { BlockProps } from './blocks/Block';
15
16
  import { CategoryBarProps } from './CategoryBarChart';
@@ -561,6 +562,14 @@ declare type BaseTag<T extends {
561
562
  type: string;
562
563
  }> = T & WithTooltipDescription;
563
564
 
565
+ export declare type BigNumberProps = {
566
+ value: Numeric | NumberWithFormatter | number;
567
+ label?: string;
568
+ trend?: boolean | TrendConfig;
569
+ comparisonHint?: string;
570
+ comparison: Numeric | NumberWithFormatter | number;
571
+ };
572
+
564
573
  export declare const buildTranslations: (translations: TranslationsType) => TranslationsType;
565
574
 
566
575
  /**
@@ -2212,6 +2221,13 @@ export declare type F0AvatarTeamProps = {
2212
2221
  badge?: AvatarBadge;
2213
2222
  } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
2214
2223
 
2224
+ export declare const F0BigNumber: {
2225
+ ({ label, ...props }: BigNumberProps_2): JSX_2.Element;
2226
+ displayName: string;
2227
+ } & {
2228
+ Skeleton: () => JSX_2.Element;
2229
+ };
2230
+
2215
2231
  export declare const F0Button: ForwardRefExoticComponent<Omit<ButtonInternalProps, "style" | "className" | "variant" | "pressed" | "append" | "compact" | "noAutoTooltip" | "noTitle"> & {
2216
2232
  variant?: Exclude<ButtonInternalProps["variant"], "ai">;
2217
2233
  } & RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
@@ -3373,13 +3389,128 @@ declare type NumberFilterValue = {
3373
3389
  };
3374
3390
  } | undefined;
3375
3391
 
3376
- declare interface NumericValue {
3377
- number: number;
3378
- units?: string;
3379
- unitsPosition?: "left" | "right";
3380
- decimalPlaces?: number | undefined;
3392
+ export declare type NumberWithFormatter = NumericWithFormatter & {
3393
+ animated?: boolean;
3394
+ };
3395
+
3396
+ declare type Numeric = NumericValue | number | undefined | null;
3397
+
3398
+ /**
3399
+ * Formats a numeric value according to the provided options.
3400
+ *
3401
+ * @param value - The numeric value to format.
3402
+ * @param options - The formatting options.
3403
+ * @returns The formatted value as a string.
3404
+ */
3405
+ declare type NumericFormatter = (value: Numeric, options?: NumericFormatterOptions) => string;
3406
+
3407
+ /**
3408
+ * Configuration options for the numeric formatter.
3409
+ */
3410
+ declare type NumericFormatterOptions = {
3411
+ /**
3412
+ * Locale string for number formatting (e.g., "en-US", "es-ES", "de-DE").
3413
+ * Determines the decimal separator and other locale-specific formatting rules.
3414
+ *
3415
+ * @default "en-US"
3416
+ */
3381
3417
  locale?: string;
3382
- }
3418
+ /**
3419
+ * Maximum number of decimal places to display.
3420
+ * The formatter will round the number to this precision.
3421
+ *
3422
+ * @default 2
3423
+ */
3424
+ decimalPlaces?: number;
3425
+ /**
3426
+ * Whether to hide the units from the formatted value.
3427
+ *
3428
+ * @default false
3429
+ */
3430
+ hideUnits?: boolean;
3431
+ /**
3432
+ * Whether to space the units from the formatted value.
3433
+ *
3434
+ * @default false
3435
+ */
3436
+ unitsSpaced?: boolean;
3437
+ /**
3438
+ * Whether to use compact notation for the formatted value.
3439
+ *
3440
+ * @default false
3441
+ */
3442
+ compact?: boolean;
3443
+ /**
3444
+ * Placeholder text to return when value is undefined or null.
3445
+ */
3446
+ emptyPlaceholder?: string;
3447
+ /**
3448
+ * Whether to use grouping for the formatted value.
3449
+ *
3450
+ * @default true
3451
+ */
3452
+ useGrouping?: boolean;
3453
+ };
3454
+
3455
+ /**
3456
+ * Represents a numeric value that can be formatted with optional units.
3457
+ *
3458
+ * The value can be provided in two formats:
3459
+ * - `value`: Direct numeric value (e.g., 123.45)
3460
+ * - `value_x100`: Value stored as integer multiplied by 100 (e.g., 12345 represents 123.45)
3461
+ *
3462
+ * @example
3463
+ * ```ts
3464
+ * // Direct value
3465
+ * const directValue: NumericValue = { value: 123.45, units: "€" }
3466
+ *
3467
+ * // Value stored as x100 (useful for avoiding floating point precision issues)
3468
+ * const x100Value: NumericValue = { value_x100: 12345, units: "€" }
3469
+ * ```
3470
+ */
3471
+ declare type NumericValue = {
3472
+ /**
3473
+ * Optional unit string to append or prepend to the formatted number.
3474
+ * Common examples: "€", "$", "kg", "%", etc.
3475
+ */
3476
+ units?: string;
3477
+ /**
3478
+ * Position of the units relative to the number.
3479
+ * - "prepend": Units appear before the number (e.g., "$123.45")
3480
+ * - "append": Units appear after the number (e.g., "123.45€")
3481
+ *
3482
+ * @default "append"
3483
+ */
3484
+ unitsPosition?: "prepend" | "append";
3485
+ } & ({
3486
+ /**
3487
+ * Direct numeric value to format.
3488
+ */
3489
+ value: number | undefined;
3490
+ } | {
3491
+ /**
3492
+ * Numeric value stored as an integer multiplied by 100.
3493
+ * This format is useful for avoiding floating-point precision issues.
3494
+ * The formatter will automatically divide by 100 before formatting.
3495
+ *
3496
+ * @example
3497
+ * value_x100: 12345 represents 123.45
3498
+ */
3499
+ value_x100: number | undefined;
3500
+ });
3501
+
3502
+ /**
3503
+ * A numeric value that can be formatted with an optional formatter and options.
3504
+ *
3505
+ * @param value - The numeric value to format.
3506
+ * @param formatter - The formatter to use.
3507
+ * @param formatterOptions - The formatting options.
3508
+ */
3509
+ declare type NumericWithFormatter = {
3510
+ numericValue: NumericValue;
3511
+ formatter?: NumericFormatter;
3512
+ formatterOptions?: NumericFormatterOptions;
3513
+ };
3383
3514
 
3384
3515
  declare type OnBulkActionCallback<Record extends RecordType, Filters extends FiltersDefinition> = (...args: [
3385
3516
  action: BulkAction,
@@ -3788,6 +3919,14 @@ declare type RegularAction = BaseAction & {
3788
3919
  variant: ButtonVariant;
3789
3920
  };
3790
3921
 
3922
+ /**
3923
+ * A numeric value that can be formatted with an optional formatter and options.
3924
+ * This is a relaxed version of NumericWithFormatter that allows the numeric value to be a Numeric.
3925
+ */
3926
+ declare type RelaxedNumericWithFormatter = Omit<NumericWithFormatter, "numericValue"> & {
3927
+ numericValue: Numeric;
3928
+ };
3929
+
3791
3930
  declare type RendererDefinition = ValueDisplayRendererDefinition;
3792
3931
 
3793
3932
  export declare type ResolvedRecordType<R> = R extends RecordType ? R : RecordType;
@@ -4095,13 +4234,16 @@ export declare type TagBalanceProps = {
4095
4234
  */
4096
4235
  nullText?: string;
4097
4236
  /**
4098
- * Amount to display next to the tag
4237
+ * Value to display next to the tag can be a number, a Numeric or a NumericWithFormatter
4099
4238
  */
4100
- amount?: number | NumericValue | null;
4239
+ amount: RelaxedNumericWithFormatter | Numeric;
4101
4240
  } & ({
4102
- percentage: number | Omit<NumericValue, "units" | "unitsPosition">;
4241
+ percentage: (Omit<RelaxedNumericWithFormatter, "value"> & {
4242
+ value: Omit<Numeric, "units" | "unitsPosition">;
4243
+ }) | Omit<Numeric, "units" | "unitsPosition">;
4103
4244
  } | {
4104
4245
  percentage?: null;
4246
+ formatterOptions?: undefined;
4105
4247
  });
4106
4248
 
4107
4249
  export declare interface TagCompanyProps {
@@ -4293,6 +4435,11 @@ declare type TranslationShape<T> = {
4293
4435
 
4294
4436
  export declare type TranslationsType = TranslationShape<typeof defaultTranslations>;
4295
4437
 
4438
+ export declare type TrendConfig = {
4439
+ show?: boolean;
4440
+ invertStatus?: boolean;
4441
+ };
4442
+
4296
4443
  export declare const TwoColumnLayout: ForwardRefExoticComponent<Omit<TwoColumnLayoutProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLElement | SVGElement>>;
4297
4444
 
4298
4445
  export declare interface TwoColumnLayoutProps {
@@ -4802,6 +4949,11 @@ declare module "gridstack" {
4802
4949
  }
4803
4950
 
4804
4951
 
4952
+ declare namespace Calendar {
4953
+ var displayName: string;
4954
+ }
4955
+
4956
+
4805
4957
  declare module "@tiptap/core" {
4806
4958
  interface Commands<ReturnType> {
4807
4959
  moodTracker: {
@@ -4809,8 +4961,3 @@ declare module "@tiptap/core" {
4809
4961
  };
4810
4962
  }
4811
4963
  }
4812
-
4813
-
4814
- declare namespace Calendar {
4815
- var displayName: string;
4816
- }