@factorialco/f0-react 1.279.0 → 1.280.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/f0.d.ts CHANGED
@@ -224,6 +224,10 @@ declare const alertAvatarVariants: (props?: ({
224
224
 
225
225
  declare type AlertTagProps = ComponentProps<typeof F0TagAlert>;
226
226
 
227
+ declare const _allowedVariants: readonly ["heading", "heading-large"];
228
+
229
+ declare const _allowedVariants_2: readonly ["body", "description", "small", "inverse", "code", "label"];
230
+
227
231
  export declare type AllSelectionStatus = {
228
232
  checked: boolean;
229
233
  indeterminate: boolean;
@@ -231,6 +235,8 @@ export declare type AllSelectionStatus = {
231
235
  unselectedCount: number;
232
236
  };
233
237
 
238
+ declare const allTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "p", "span", "div", "label", "code"];
239
+
234
240
  declare type AnimationVariantsOptions = {
235
241
  delay?: number;
236
242
  duration?: number;
@@ -244,6 +250,8 @@ canBeBlurred?: boolean;
244
250
  blurArea?: "l" | "r" | "lr";
245
251
  } & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLElement | SVGElement>>;
246
252
 
253
+ declare type AsAllowedList = (typeof allTags)[number];
254
+
247
255
  declare const Avatar: React_2.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React_2.RefAttributes<HTMLSpanElement>, "ref"> & {
248
256
  size?: (typeof internalAvatarSizes)[number];
249
257
  type?: (typeof internalAvatarTypes)[number];
@@ -1921,7 +1929,7 @@ export declare type F0AvatarFileProps = Omit<React.ComponentPropsWithoutRef<type
1921
1929
  } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
1922
1930
 
1923
1931
  declare type F0AvatarFlagProps = {
1924
- flag: CountryCode;
1932
+ flag: CountryCode | (string & {});
1925
1933
  size?: BaseAvatarProps["size"];
1926
1934
  badge?: AvatarBadge;
1927
1935
  } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
@@ -2229,6 +2237,13 @@ export declare interface F0GridStackRef {
2229
2237
  removeAll: () => void;
2230
2238
  }
2231
2239
 
2240
+ export declare const F0Heading: ForwardRefExoticComponent<Omit<F0HeadingProps, "ref"> & RefAttributes<HTMLElement>>;
2241
+
2242
+ export declare type F0HeadingProps = Omit<TextProps, "className" | "variant" | "as"> & {
2243
+ variant?: (typeof _allowedVariants)[number];
2244
+ as?: HeadingTags;
2245
+ };
2246
+
2232
2247
  export declare const F0Icon: ForwardRefExoticComponent<Omit<Omit<F0IconProps_2, "ref"> & RefAttributes<SVGSVGElement>, "ref"> & RefAttributes<HTMLElement | SVGElement>>;
2233
2248
 
2234
2249
  export declare interface F0IconProps extends SVGProps<SVGSVGElement>, VariantProps<typeof iconVariants> {
@@ -2285,6 +2300,14 @@ export declare const F0TagStatus: ForwardRefExoticComponent<TagStatusProps & Ref
2285
2300
 
2286
2301
  export declare const F0TagTeam: ForwardRefExoticComponent<TagTeamProps & RefAttributes<HTMLDivElement>>;
2287
2302
 
2303
+ export declare const F0Text: ForwardRefExoticComponent<Omit<F0TextProps, "ref"> & RefAttributes<HTMLElement>>;
2304
+
2305
+ export declare type F0TextProps = Omit<TextProps, "className" | "variant" | "as"> & {
2306
+ variant?: (typeof _allowedVariants_2)[number];
2307
+ as?: TextTags;
2308
+ markdown?: boolean;
2309
+ };
2310
+
2288
2311
  export declare type FileAvatarVariant = Extract<AvatarVariant, {
2289
2312
  type: "file";
2290
2313
  }>;
@@ -2552,6 +2575,10 @@ export declare type GroupRecord<RecordType> = {
2552
2575
  records: RecordType[];
2553
2576
  };
2554
2577
 
2578
+ declare type HeadingTags = (typeof headingTags)[number];
2579
+
2580
+ declare const headingTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
2581
+
2555
2582
  export declare const HomeLayout: ForwardRefExoticComponent<Omit<{
2556
2583
  widgets?: ReactNode[];
2557
2584
  children?: ReactNode;
@@ -2619,6 +2646,15 @@ declare type InFilterOptionItem<T = unknown> = {
2619
2646
  */
2620
2647
  declare type InFilterOptions_2<T, _R extends RecordType = RecordType> = {
2621
2648
  cache?: boolean;
2649
+ /**
2650
+ * Optional function to resolve labels for specific values without fetching all options.
2651
+ * This is useful when you have a dynamic source and want to avoid fetching all options
2652
+ * just to display labels for selected values.
2653
+ * @param value - The value to get the label for
2654
+ * @returns The label for the value, or a promise that resolves to the label
2655
+ * @note The parameter type is `unknown` to allow compatibility when T is different types
2656
+ */
2657
+ getLabel?: (value: unknown) => string | Promise<string>;
2622
2658
  } & ({
2623
2659
  options: Array<InFilterOptionItem<T>> | (() => Array<InFilterOptionItem<T>> | Promise<Array<InFilterOptionItem<T>>>);
2624
2660
  } | {
@@ -3767,6 +3803,70 @@ export declare type TeamAvatarVariant = Extract<AvatarVariant, {
3767
3803
 
3768
3804
  declare type TeamTagProps = ComponentProps<typeof F0TagTeam>;
3769
3805
 
3806
+ declare interface TextProps extends Omit<default_2.HTMLAttributes<HTMLElement>, "className">, default_2.RefAttributes<HTMLElement> {
3807
+ /**
3808
+ * Content to be rendered
3809
+ */
3810
+ content: string;
3811
+ /**
3812
+ * The text variant to render. Determines styling and default semantic element.
3813
+ */
3814
+ variant?: TextVariant;
3815
+ /**
3816
+ * Text alignment
3817
+ * @default left
3818
+ */
3819
+ align?: NonNullable<TextVariants["align"]>;
3820
+ /**
3821
+ * Additional classes to apply
3822
+ * @private
3823
+ */
3824
+ className?: string;
3825
+ /**
3826
+ * HTML tag name to use for rendered element.
3827
+ * If not provided, uses semantic default based on variant.
3828
+ * @default varies by variant
3829
+ */
3830
+ as?: AsAllowedList;
3831
+ /**
3832
+ * Enable text ellipsis with optional line configuration
3833
+ * - `true`: Single line ellipsis (lines = 1)
3834
+ * - `number`: Multi-line ellipsis with specified line count
3835
+ * - `undefined`: No ellipsis
3836
+ */
3837
+ ellipsis?: boolean | number;
3838
+ /**
3839
+ * Disable tooltip when text is truncated
3840
+ * Only applies when ellipsis is enabled
3841
+ * @default false
3842
+ */
3843
+ noEllipsisTooltip?: boolean;
3844
+ /**
3845
+ * Enable markdown parsing for content
3846
+ * @default false
3847
+ */
3848
+ markdown?: boolean;
3849
+ }
3850
+
3851
+ declare type TextTags = (typeof textTags)[number];
3852
+
3853
+ declare const textTags: readonly ["p", "span", "div", "label", "code"];
3854
+
3855
+ declare type TextVariant = NonNullable<TextVariants["variant"]>;
3856
+
3857
+ declare type TextVariants = VariantProps<typeof textVariants>;
3858
+
3859
+ declare const textVariants: (props?: ({
3860
+ variant?: "info" | "small" | "body" | "code" | "label" | "description" | "selected" | "heading" | "positive" | "inverse" | "critical" | "warning" | "heading-large" | "label-input" | "warning-strong" | "critical-strong" | "positive-strong" | "info-strong" | undefined;
3861
+ align?: "center" | "left" | "right" | undefined;
3862
+ } & ({
3863
+ class?: ClassValue;
3864
+ className?: never;
3865
+ } | {
3866
+ class?: never;
3867
+ className?: ClassValue;
3868
+ })) | undefined) => string;
3869
+
3770
3870
  declare type TranslationKey = Join<PathsToStringProps<typeof defaultTranslations>, ".">;
3771
3871
 
3772
3872
  declare type TranslationShape<T> = {
@@ -4195,31 +4295,6 @@ declare global {
4195
4295
  }
4196
4296
 
4197
4297
 
4198
- declare module "gridstack" {
4199
- interface GridStackWidget {
4200
- id?: string;
4201
- allowedSizes?: Array<{
4202
- w: number;
4203
- h: number;
4204
- }>;
4205
- renderFn?: () => React.ReactElement | null;
4206
- meta?: Record<string, unknown>;
4207
- }
4208
- interface GridStackNode {
4209
- id?: string;
4210
- w?: number;
4211
- h?: number;
4212
- x?: number;
4213
- y?: number;
4214
- allowedSizes?: Array<{
4215
- w: number;
4216
- h: number;
4217
- }>;
4218
- renderFn?: () => React.ReactElement | null;
4219
- }
4220
- }
4221
-
4222
-
4223
4298
  declare module "@tiptap/core" {
4224
4299
  interface Commands<ReturnType> {
4225
4300
  aiBlock: {
@@ -4247,8 +4322,28 @@ declare module "@tiptap/core" {
4247
4322
  }
4248
4323
 
4249
4324
 
4250
- declare namespace Calendar {
4251
- var displayName: string;
4325
+ declare module "gridstack" {
4326
+ interface GridStackWidget {
4327
+ id?: string;
4328
+ allowedSizes?: Array<{
4329
+ w: number;
4330
+ h: number;
4331
+ }>;
4332
+ renderFn?: () => React.ReactElement | null;
4333
+ meta?: Record<string, unknown>;
4334
+ }
4335
+ interface GridStackNode {
4336
+ id?: string;
4337
+ w?: number;
4338
+ h?: number;
4339
+ x?: number;
4340
+ y?: number;
4341
+ allowedSizes?: Array<{
4342
+ w: number;
4343
+ h: number;
4344
+ }>;
4345
+ renderFn?: () => React.ReactElement | null;
4346
+ }
4252
4347
  }
4253
4348
 
4254
4349
 
@@ -4259,3 +4354,8 @@ declare module "@tiptap/core" {
4259
4354
  };
4260
4355
  }
4261
4356
  }
4357
+
4358
+
4359
+ declare namespace Calendar {
4360
+ var displayName: string;
4361
+ }