@factorialco/f0-react 1.383.0 → 1.383.2

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
@@ -1,33 +1,30 @@
1
1
  import { AgentState } from '@livekit/components-react';
2
2
  import { AIMessage } from '@copilotkit/shared';
3
3
  import { AlertAvatarProps as AlertAvatarProps_2 } from './F0AvatarAlert';
4
- import { AlertTagCellValue } from '../../../ui/value-display/types/alertTag';
4
+ import { AlertTagCellValue } from './f0';
5
5
  import { AlertTagCellValue as AlertTagCellValue_2 } from './types/alertTag';
6
- import { AmountCellValue } from '../../../ui/value-display/types/amount';
6
+ import { AmountCellValue } from './f0';
7
7
  import { AmountCellValue as AmountCellValue_2 } from './types/amount';
8
8
  import { AnchorHTMLAttributes } from 'react';
9
9
  import { AriaAttributes } from 'react';
10
10
  import { AssistantMessageProps } from '@copilotkit/react-ui';
11
11
  import { AutoFill as AutoFill_2 } from 'react';
12
- import { AvatarBadge as AvatarBadge_2 } from '../F0Avatar';
13
- import { AvatarFileSize as AvatarFileSize_2 } from './types';
14
- import { AvatarListCellValue } from '../../../ui/value-display/types/avatarList';
12
+ import { AvatarListCellValue } from './f0';
15
13
  import { AvatarListCellValue as AvatarListCellValue_2 } from './types/avatarList';
16
14
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
17
15
  import { AvatarProps } from './F0Avatar';
18
16
  import { AvatarProps as AvatarProps_2 } from '@radix-ui/react-avatar';
19
17
  import { BarSeriesCellValue } from './types/barSeries';
20
- import { BaseAvatarProps as BaseAvatarProps_2 } from '../internal/BaseAvatar';
21
18
  import { baseColors } from '@factorialco/f0-core';
22
19
  import { BigNumberProps as BigNumberProps_2 } from './types';
23
20
  import { BlockContentExtraProps } from './blocks/BlockContent';
24
21
  import { BlockProps } from './blocks/Block';
25
22
  import { CategoryBarProps } from './CategoryBarChart';
26
- import { ChartConfig } from '../../ui/chart';
23
+ import { ChartConfig } from './f0';
27
24
  import { ChartConfig as ChartConfig_2 } from './utils/types';
28
25
  import { ChartPropsBase } from './utils/types';
29
26
  import { ClassValue } from 'cva';
30
- import { CompanyCellValue } from '../../../ui/value-display/types/company';
27
+ import { CompanyCellValue } from './f0';
31
28
  import { CompanyCellValue as CompanyCellValue_2 } from './types/company';
32
29
  import { ComponentProps } from 'react';
33
30
  import { ComponentType } from 'react';
@@ -35,11 +32,11 @@ import { Context } from 'react';
35
32
  import { CopilotKitProps } from '@copilotkit/react-core';
36
33
  import { CountryCellValue } from './types/country';
37
34
  import { DashboardProps as DashboardProps_2 } from './Dashboard';
38
- import { DateCellValue } from '../../../ui/value-display/types/date';
35
+ import { DateCellValue } from './f0';
39
36
  import { DateCellValue as DateCellValue_2 } from './types/date';
40
37
  import { DateFilterOptions } from './DateFilter/DateFilter';
41
38
  import { default as default_2 } from 'react';
42
- import { DotTagCellValue } from '../../../ui/value-display/types/dotTag';
39
+ import { DotTagCellValue } from './f0';
43
40
  import { DotTagCellValue as DotTagCellValue_2 } from './types/dotTag';
44
41
  import { F0AvatarCompanyProps as F0AvatarCompanyProps_2 } from './types';
45
42
  import { F0AvatarDateProps } from './F0AvatarDate';
@@ -49,9 +46,10 @@ import { F0AvatarListProps as F0AvatarListProps_2 } from './types';
49
46
  import { F0AvatarPersonProps as F0AvatarPersonProps_2 } from './types';
50
47
  import { F0AvatarTeamProps as F0AvatarTeamProps_2 } from './F0AvatarTeam';
51
48
  import { F0DialogInternalProps } from './internal-types';
52
- import { F0FormDefinitionPerSection as F0FormDefinitionPerSection_2 } from '../F0WizardForm/types';
53
- import { F0FormDefinitionSingleSchema as F0FormDefinitionSingleSchema_2 } from '../F0WizardForm/types';
49
+ import { F0FormDefinitionPerSection as F0FormDefinitionPerSection_2 } from './f0';
50
+ import { F0FormDefinitionSingleSchema as F0FormDefinitionSingleSchema_2 } from './f0';
54
51
  import { F0GridStackProps as F0GridStackProps_2 } from './F0GridStack';
52
+ import { F0SelectProps as F0SelectProps_2 } from './types';
55
53
  import { F0TagBalanceProps } from './types';
56
54
  import { F0TagCompanyProps } from './types';
57
55
  import { F0TagListProps } from './types';
@@ -61,10 +59,9 @@ import { F0TagStatusProps } from './types';
61
59
  import { F0TagTeamProps } from './types';
62
60
  import { f1Colors } from '@factorialco/f0-core';
63
61
  import { FC } from 'react';
64
- import { FileCellValue } from '../../../ui/value-display/types/file';
62
+ import { FileCellValue } from './f0';
65
63
  import { FileCellValue as FileCellValue_2 } from './types/file';
66
- import { FileDef as FileDef_2 } from './types';
67
- import { FolderCellValue } from '../../../ui/value-display/types/folder';
64
+ import { FolderCellValue } from './f0';
68
65
  import { FolderCellValue as FolderCellValue_2 } from './types/folder';
69
66
  import { ForwardedRef } from 'react';
70
67
  import { ForwardRefExoticComponent } from 'react';
@@ -80,29 +77,29 @@ import { HTMLAttributes } from 'react';
80
77
  import { IconCellValue } from './types/icon';
81
78
  import { ImgHTMLAttributes } from 'react';
82
79
  import { InFilterOptions } from './InFilter/types';
83
- import { internalAvatarColors as internalAvatarColors_2 } from '../../../ui/Avatar';
84
- import { internalAvatarSizes as internalAvatarSizes_2 } from '../../../ui/Avatar';
85
- import { internalAvatarTypes as internalAvatarTypes_2 } from '../../../ui/Avatar';
80
+ import { internalAvatarColors as internalAvatarColors_2 } from './f0';
81
+ import { internalAvatarSizes as internalAvatarSizes_2 } from './f0';
82
+ import { internalAvatarTypes as internalAvatarTypes_2 } from './f0';
86
83
  import { JSX as JSX_2 } from 'react';
87
- import { LineChartConfig } from '../../ui/chart';
84
+ import { LineChartConfig } from './f0';
88
85
  import { LineChartPropsBase } from './utils/types';
89
86
  import { LocalAudioTrack } from 'livekit-client';
90
87
  import { LongTextCellValue } from './types/longText';
91
88
  import { Message } from '@copilotkit/shared';
92
89
  import { MessagesProps } from '@copilotkit/react-ui';
93
- import { NumberCellValue } from '../../../ui/value-display/types/number';
90
+ import { NumberCellValue } from './f0';
94
91
  import { NumberCellValue as NumberCellValue_2 } from './types/number';
95
92
  import { NumberFilterOptions } from './NumberFilter/NumberFilter';
96
93
  import { Observable } from 'zen-observable-ts';
97
94
  import { PageLayoutBlockComponent as PageLayoutBlockComponent_2 } from './types';
98
- import { PageLayoutGroupComponent as PageLayoutGroupComponent_2 } from '../Layout';
95
+ import { PageLayoutGroupComponent as PageLayoutGroupComponent_2 } from './f0';
99
96
  import { PageProps } from './pages/Page';
100
97
  import { PercentageCellValue } from './types/percentage';
101
- import { PersonCellValue } from '../../../ui/value-display/types/person';
98
+ import { PersonCellValue } from './f0';
102
99
  import { PersonCellValue as PersonCellValue_2 } from './types/person';
103
100
  import { PieChartProps } from './PieChart';
104
101
  import { PopoverContentProps } from '@radix-ui/react-popover';
105
- import { ProgressBarCellValue } from '../../../ui/value-display/types/progressBar';
102
+ import { ProgressBarCellValue } from './f0';
106
103
  import { ProgressBarCellValue as ProgressBarCellValue_2 } from './types/progressBar';
107
104
  import { Props as Props_2 } from './types';
108
105
  import * as React_2 from 'react';
@@ -113,28 +110,28 @@ import { RefObject } from 'react';
113
110
  import { RemoteAudioTrack } from 'livekit-client';
114
111
  import { SearchFilterOptions } from './SearchFilter/SearchFilter';
115
112
  import { SizeToken as SizeToken_2 } from './types';
116
- import { StatusCellValue } from '../../../ui/value-display/types/status';
113
+ import { StatusCellValue } from './f0';
117
114
  import { StatusCellValue as StatusCellValue_2 } from './types/status';
118
115
  import { SVGProps } from 'react';
119
116
  import * as SwitchPrimitive from '@radix-ui/react-switch';
120
- import { TagCellValue } from '../../../ui/value-display/types/tag';
117
+ import { TagCellValue } from './f0';
121
118
  import { TagCellValue as TagCellValue_2 } from './types/tag';
122
- import { TagListCellValue } from '../../../ui/value-display/types/tagList';
119
+ import { TagListCellValue } from './f0';
123
120
  import { TagListCellValue as TagListCellValue_2 } from './types/tagList';
124
121
  import { TagType as TagType_2 } from './types';
125
122
  import { TagVariant as TagVariant_2 } from './F0Tag';
126
- import { TeamCellValue } from '../../../ui/value-display/types/team';
123
+ import { TeamCellValue } from './f0';
127
124
  import { TeamCellValue as TeamCellValue_2 } from './types/team';
128
- import { TextCellValue } from '../../../ui/value-display/types/text';
125
+ import { TextCellValue } from './f0';
129
126
  import { TextCellValue as TextCellValue_2 } from './types/text';
130
127
  import { TrackReferenceOrPlaceholder } from '@livekit/components-react';
131
- import { ValueDisplayRendererContext } from '../../../ui/value-display';
128
+ import { ValueDisplayRendererContext } from './f0';
132
129
  import { VariantProps } from 'cva';
133
- import { WithDataTestIdReturnType as WithDataTestIdReturnType_2 } from '../lib/data-testid';
134
- import { WithDataTestIdReturnType as WithDataTestIdReturnType_3 } from '../../lib/data-testid';
135
- import { WithDataTestIdReturnType as WithDataTestIdReturnType_4 } from '../../../lib/data-testid';
136
- import { WithDataTestIdReturnType as WithDataTestIdReturnType_5 } from '../../f0';
137
- import { WithDataTestIdReturnType as WithDataTestIdReturnType_6 } from '../../lib/data-testid/index.tsx';
130
+ import { WithDataTestIdReturnType as WithDataTestIdReturnType_2 } from './f0';
131
+ import { WithDataTestIdReturnType as WithDataTestIdReturnType_3 } from './f0';
132
+ import { WithDataTestIdReturnType as WithDataTestIdReturnType_4 } from './f0';
133
+ import { WithDataTestIdReturnType as WithDataTestIdReturnType_5 } from './f0';
134
+ import { WithDataTestIdReturnType as WithDataTestIdReturnType_6 } from './f0';
138
135
  import { z } from 'zod';
139
136
  import { ZodEffects } from 'zod';
140
137
  import { ZodRawShape } from 'zod';
@@ -616,12 +613,9 @@ export declare type AvatarVariants = (typeof avatarVariants)[number];
616
613
 
617
614
  export declare const avatarVariants: readonly ["person", "team", "company", "file", "flag"];
618
615
 
619
- export declare const Await: AwaitGeneric;
620
-
621
- /**
622
- * Generic component type so <Await resolve={value}> correctly types children as (value: T) => ReactNode.
623
- */
624
- declare type AwaitGeneric = <T>(props: AwaitProps<T> & WithDataTestIdProps) => ReactNode;
616
+ export declare const Await: <T>(props: AwaitProps<T> & {
617
+ dataTestId?: string;
618
+ }) => ReactNode;
625
619
 
626
620
  export declare type AwaitProps<T> = {
627
621
  resolve: Promise<T> | T;
@@ -1904,6 +1898,29 @@ export declare type DataSourceDefinition<R extends RecordType = RecordType, Filt
1904
1898
  }) => number | undefined;
1905
1899
  };
1906
1900
 
1901
+ /**
1902
+ * Wrapper component that conditionally renders a `data-testid` attribute.
1903
+ *
1904
+ * When `dataTestId` is provided and the platform context enables test id rendering,
1905
+ * wraps children in a `<div data-testid={dataTestId} style={{ display: "contents" }}>`.
1906
+ * Otherwise renders children as-is with no wrapper element.
1907
+ *
1908
+ * Use this directly inside components with complex generic types (e.g. F0Select,
1909
+ * OneFilterPicker) where the `withDataTestId` HOC would erase type parameters.
1910
+ *
1911
+ * @example
1912
+ * ```tsx
1913
+ * const MyComponent = <T,>({ dataTestId, ...props }: MyProps<T> & WithDataTestIdProps) => (
1914
+ * <DataTestIdWrapper dataTestId={dataTestId}>
1915
+ * <div>...</div>
1916
+ * </DataTestIdWrapper>
1917
+ * )
1918
+ * ```
1919
+ */
1920
+ export declare const DataTestIdWrapper: ({ dataTestId, children, }: WithDataTestIdProps & {
1921
+ children: ReactNode;
1922
+ }) => ReactNode;
1923
+
1907
1924
  /**
1908
1925
  * All valid renderIf conditions for date fields
1909
1926
  */
@@ -2974,21 +2991,21 @@ export declare type F0AvatarEmojiProps = {
2974
2991
  size?: (typeof avatarEmojiSizes)[number];
2975
2992
  } & Partial<Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">>;
2976
2993
 
2977
- export declare const F0AvatarFile: WithDataTestIdReturnType_4<ForwardRefExoticComponent<Omit<Omit<Omit<AvatarProps_2 & RefAttributes<HTMLSpanElement>, "ref"> & {
2994
+ export declare const F0AvatarFile: ForwardRefExoticComponent<Omit<Omit<Omit<AvatarProps_2 & RefAttributes<HTMLSpanElement>, "ref"> & {
2978
2995
  size?: internalAvatarSizes_2[number];
2979
2996
  type?: internalAvatarTypes_2[number];
2980
2997
  color?: internalAvatarColors_2[number];
2981
2998
  } & RefAttributes<HTMLSpanElement>, "ref">, "type" | "size"> & {
2982
- file: FileDef_2;
2983
- size?: AvatarFileSize_2;
2984
- badge?: AvatarBadge_2;
2985
- } & Pick<BaseAvatarProps_2, "aria-label" | "aria-labelledby"> & RefAttributes<HTMLSpanElement>>>;
2999
+ file: FileDef;
3000
+ size?: AvatarFileSize;
3001
+ badge?: AvatarBadge;
3002
+ } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby"> & WithDataTestIdProps & RefAttributes<HTMLSpanElement>>;
2986
3003
 
2987
3004
  export declare type F0AvatarFileProps = Omit<React.ComponentPropsWithoutRef<typeof Avatar>, "type" | "size"> & {
2988
3005
  file: FileDef;
2989
3006
  size?: AvatarFileSize;
2990
3007
  badge?: AvatarBadge;
2991
- } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
3008
+ } & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby"> & WithDataTestIdProps;
2992
3009
 
2993
3010
  declare type F0AvatarFlagProps = {
2994
3011
  flag: CountryCode | (string & {});
@@ -3837,9 +3854,9 @@ export declare type F0FileField = F0BaseField & {
3837
3854
  */
3838
3855
  export declare type F0FileFieldConfig = F0StringFileConfig | F0ArrayFileConfig;
3839
3856
 
3840
- export declare const F0FilterPickerContent: F0FilterPickerContentGeneric;
3841
-
3842
- declare type F0FilterPickerContentGeneric = <Filters extends FiltersDefinition>(props: F0FilterPickerContentProps<Filters> & WithDataTestIdProps) => ReactElement | null;
3857
+ export declare const F0FilterPickerContent: <Filters extends FiltersDefinition>(props: F0FilterPickerContentProps<Filters> & {
3858
+ dataTestId?: string;
3859
+ }) => ReactElement | null;
3843
3860
 
3844
3861
  /**
3845
3862
  * Props for the F0FilterPickerContent component.
@@ -3859,11 +3876,13 @@ export declare interface F0FilterPickerContentProps<Filters extends FiltersDefin
3859
3876
  }
3860
3877
 
3861
3878
  /**
3862
- * Public props for F0FilterPickerContent (includes dataTestId from withDataTestId).
3879
+ * Public props for F0FilterPickerContent (includes dataTestId).
3863
3880
  * Use this when typing props that include the optional dataTestId attribute.
3864
3881
  * @template Filters - The type defining the structure of available filters
3865
3882
  */
3866
- export declare type F0FilterPickerContentPublicProps<Filters extends FiltersDefinition> = F0FilterPickerContentProps<Filters> & WithDataTestIdProps;
3883
+ export declare type F0FilterPickerContentPublicProps<Filters extends FiltersDefinition> = F0FilterPickerContentProps<Filters> & {
3884
+ dataTestId?: string;
3885
+ };
3867
3886
 
3868
3887
  /**
3869
3888
  * @experimental This is an experimental component, use it at your own risk
@@ -4554,7 +4573,9 @@ export declare interface F0SectionConfig {
4554
4573
  /**
4555
4574
  * @experimental This is an experimental component use it at your own risk
4556
4575
  */
4557
- export declare const F0Select: F0SelectGeneric;
4576
+ export declare const F0Select: <T extends string = string, R = unknown>(props: F0SelectProps_2<T, R> & {
4577
+ ref?: React.Ref<HTMLButtonElement>;
4578
+ }) => React.ReactElement;
4558
4579
 
4559
4580
  /**
4560
4581
  * Base props shared across all F0Select variants
@@ -4585,7 +4606,7 @@ declare type F0SelectBaseProps<T extends string, R = unknown> = {
4585
4606
  * @default false
4586
4607
  */
4587
4608
  showPreview?: boolean;
4588
- };
4609
+ } & WithDataTestIdProps;
4589
4610
 
4590
4611
  /**
4591
4612
  * F0 config options specific to select fields
@@ -4650,12 +4671,6 @@ export declare type F0SelectField = F0BaseField & F0SelectConfig & {
4650
4671
  renderIf?: SelectFieldRenderIf;
4651
4672
  };
4652
4673
 
4653
- /**
4654
- * Generic component type so consumers can use <F0Select<T, R> />.
4655
- * Preserves dataTestId and F0SelectProps<T, R>.
4656
- */
4657
- declare type F0SelectGeneric = <T extends string, R = unknown>(props: F0SelectProps<T, R> & WithDataTestIdProps) => ReactElement | null;
4658
-
4659
4674
  export declare type F0SelectItemObject<T, R = unknown> = {
4660
4675
  type?: "item";
4661
4676
  value: T;
@@ -6336,13 +6351,9 @@ action: BulkAction,
6336
6351
  ...Parameters<OnSelectItemsCallback<Record, Filters>>
6337
6352
  ]) => void;
6338
6353
 
6339
- export declare const OneFilterPicker: OneFilterPickerGeneric;
6340
-
6341
- /**
6342
- * Generic component type so consumers can use <OneFilterPicker<Definition> />.
6343
- * Preserves dataTestId and OneFilterPickerRootProps<Definition>.
6344
- */
6345
- declare type OneFilterPickerGeneric = <Definition extends FiltersDefinition>(props: OneFilterPickerRootProps<Definition> & WithDataTestIdProps) => ReactElement | null;
6354
+ export declare const OneFilterPicker: <Definition extends FiltersDefinition>(props: OneFilterPickerRootProps<Definition> & {
6355
+ dataTestId?: string;
6356
+ }) => ReactElement | null;
6346
6357
 
6347
6358
  /**
6348
6359
  * Props for the Filters component.
@@ -7093,12 +7104,6 @@ export declare interface StandardLayoutProps extends VariantProps<typeof layoutV
7093
7104
  children?: default_2.ReactNode;
7094
7105
  }
7095
7106
 
7096
- /**
7097
- * Keys on T that are not part of Function, so we preserve static members (Skeleton, displayName, etc.)
7098
- * without bringing in a second call signature that would confuse ComponentProps<> inference.
7099
- */
7100
- declare type StaticMembersOf<T> = Pick<T, Exclude<keyof T, keyof Function>>;
7101
-
7102
7107
  export declare type Status = (typeof statuses_2)[number];
7103
7108
 
7104
7109
  declare const statuses: readonly ["neutral", "info", "positive", "warning", "critical"];
@@ -8242,11 +8247,15 @@ export declare type WithDataTestIdProps = {
8242
8247
  export declare type WithDataTestIdPropsOf<T extends default_2.ComponentType<unknown>> = default_2.ComponentProps<T> & WithDataTestIdProps;
8243
8248
 
8244
8249
  /**
8245
- * Return type has a single call signature with props = ComponentProps<T> & WithDataTestIdProps,
8246
- * so ComponentProps<Wrapped> and Storybook's Meta/StoryObj infer correctly.
8247
- * Static properties (e.g. F0Card.Skeleton) are preserved via StaticMembersOf<T>.
8250
+ * Given a component type T, produce a new component type that:
8251
+ * 1. Accepts all of T's props plus dataTestId
8252
+ * 2. Preserves callback argument types (e.g., onCheckedChange: (checked: boolean) => void)
8253
+ * 3. Preserves static members (e.g., F0Card.Skeleton)
8254
+ *
8255
+ * We use a mapped type approach to avoid the pitfalls of React.ComponentType
8256
+ * which collapses callback inference.
8248
8257
  */
8249
- export declare type WithDataTestIdReturnType<T extends default_2.ComponentType<unknown>> = default_2.ComponentType<WithDataTestIdPropsOf<T>> & StaticMembersOf<T>;
8258
+ export declare type WithDataTestIdReturnType<T extends default_2.ComponentType<any>> = default_2.ForwardRefExoticComponent<default_2.PropsWithoutRef<default_2.ComponentProps<T> & WithDataTestIdProps> & default_2.RefAttributes<T extends default_2.ForwardRefExoticComponent<infer P> ? P extends default_2.RefAttributes<infer R> ? R : unknown : unknown>> & Pick<T, Exclude<keyof T, keyof default_2.ForwardRefExoticComponent<unknown>>>;
8250
8259
 
8251
8260
  export declare type WithGroupId<RecordType> = RecordType & {
8252
8261
  [GROUP_ID_SYMBOL]: unknown | undefined;
@@ -8321,6 +8330,11 @@ declare module "gridstack" {
8321
8330
  }
8322
8331
 
8323
8332
 
8333
+ declare namespace Calendar {
8334
+ var displayName: string;
8335
+ }
8336
+
8337
+
8324
8338
  declare module "@tiptap/core" {
8325
8339
  interface Commands<ReturnType> {
8326
8340
  aiBlock: {
@@ -8368,8 +8382,3 @@ declare module "@tiptap/core" {
8368
8382
  };
8369
8383
  }
8370
8384
  }
8371
-
8372
-
8373
- declare namespace Calendar {
8374
- var displayName: string;
8375
- }