@factorialco/f0-react 1.276.2 → 1.277.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/experimental.d.ts +179 -51
- package/dist/experimental.js +51 -50
- package/dist/f0.d.ts +179 -51
- package/dist/f0.js +464 -361
- package/dist/{hooks-D4s6Agu-.js → hooks-Bw_38rK-.js} +9281 -9260
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/f0.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AlertTagCellValue } from '../../value-display/types/alertTag';
|
|
2
|
-
import { AlertTagCellValue as AlertTagCellValue_2 } from './types/alertTag
|
|
2
|
+
import { AlertTagCellValue as AlertTagCellValue_2 } from './types/alertTag';
|
|
3
3
|
import { AmountCellValue } from '../../value-display/types/amount';
|
|
4
|
-
import { AmountCellValue as AmountCellValue_2 } from './types/amount
|
|
4
|
+
import { AmountCellValue as AmountCellValue_2 } from './types/amount';
|
|
5
5
|
import { AnchorHTMLAttributes } from 'react';
|
|
6
6
|
import { AriaAttributes } from 'react';
|
|
7
7
|
import { AutoFill as AutoFill_2 } from 'react';
|
|
8
8
|
import { AvatarListCellValue } from '../../value-display/types/avatarList';
|
|
9
|
-
import { AvatarListCellValue as AvatarListCellValue_2 } from './types/avatarList
|
|
9
|
+
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';
|
|
@@ -16,29 +16,30 @@ import { ChartConfig as ChartConfig_2 } from './utils/types';
|
|
|
16
16
|
import { ChartPropsBase } from './utils/types';
|
|
17
17
|
import { ClassValue } from 'cva';
|
|
18
18
|
import { CompanyCellValue } from '../../value-display/types/company';
|
|
19
|
-
import { CompanyCellValue as CompanyCellValue_2 } from './types/company
|
|
19
|
+
import { CompanyCellValue as CompanyCellValue_2 } from './types/company';
|
|
20
20
|
import { ComponentProps } from 'react';
|
|
21
|
+
import { CountryCellValue } from './types/country';
|
|
21
22
|
import { DateCellValue } from '../../value-display/types/date';
|
|
22
|
-
import { DateCellValue as DateCellValue_2 } from './types/date
|
|
23
|
+
import { DateCellValue as DateCellValue_2 } from './types/date';
|
|
23
24
|
import { DateFilterOptions } from './DateFilter/DateFilter';
|
|
24
25
|
import { default as default_2 } from 'react';
|
|
25
26
|
import { DotTagCellValue } from '../../value-display/types/dotTag';
|
|
26
|
-
import { DotTagCellValue as DotTagCellValue_2 } from './types/dotTag
|
|
27
|
+
import { DotTagCellValue as DotTagCellValue_2 } from './types/dotTag';
|
|
27
28
|
import { F0GridStackProps as F0GridStackProps_2 } from './F0GridStack';
|
|
28
29
|
import { F0GridStackRef as F0GridStackRef_2 } from './F0GridStack';
|
|
29
30
|
import { F0IconProps as F0IconProps_2 } from './F0Icon';
|
|
30
31
|
import { f1Colors } from '@factorialco/f0-core';
|
|
31
32
|
import { FileCellValue } from '../../value-display/types/file';
|
|
32
|
-
import { FileCellValue as FileCellValue_2 } from './types/file
|
|
33
|
+
import { FileCellValue as FileCellValue_2 } from './types/file';
|
|
33
34
|
import { FolderCellValue } from '../../value-display/types/folder';
|
|
34
|
-
import { FolderCellValue as FolderCellValue_2 } from './types/folder
|
|
35
|
+
import { FolderCellValue as FolderCellValue_2 } from './types/folder';
|
|
35
36
|
import { ForwardedRef } from 'react';
|
|
36
37
|
import { ForwardRefExoticComponent } from 'react';
|
|
37
38
|
import { GridStackOptions } from 'gridstack';
|
|
38
39
|
import { GridStackWidget } from 'gridstack';
|
|
39
40
|
import { HTMLAttributeAnchorTarget } from 'react';
|
|
40
41
|
import { HTMLAttributes } from 'react';
|
|
41
|
-
import { IconCellValue } from './types/icon
|
|
42
|
+
import { IconCellValue } from './types/icon';
|
|
42
43
|
import { ImgHTMLAttributes } from 'react';
|
|
43
44
|
import { InFilterOptions } from './InFilter/types';
|
|
44
45
|
import { internalAvatarColors as internalAvatarColors_2 } from '../../../ui/Avatar';
|
|
@@ -47,15 +48,15 @@ import { internalAvatarTypes as internalAvatarTypes_2 } from '../../../ui/Avatar
|
|
|
47
48
|
import { JSX as JSX_2 } from 'react';
|
|
48
49
|
import { LineChartConfig } from '../../ui/chart';
|
|
49
50
|
import { LineChartPropsBase } from './utils/types';
|
|
50
|
-
import { LongTextCellValue } from './types/longText
|
|
51
|
+
import { LongTextCellValue } from './types/longText';
|
|
51
52
|
import { NumberCellValue } from '../../value-display/types/number';
|
|
52
|
-
import { NumberCellValue as NumberCellValue_2 } from './types/number
|
|
53
|
+
import { NumberCellValue as NumberCellValue_2 } from './types/number';
|
|
53
54
|
import { NumberFilterOptions } from './NumberFilter/NumberFilter';
|
|
54
55
|
import { NumberFilterValue } from './NumberFilter/NumberFilter';
|
|
55
56
|
import { Observable } from 'zen-observable-ts';
|
|
56
|
-
import { PercentageCellValue } from './types/percentage
|
|
57
|
+
import { PercentageCellValue } from './types/percentage';
|
|
57
58
|
import { PersonCellValue } from '../../value-display/types/person';
|
|
58
|
-
import { PersonCellValue as PersonCellValue_2 } from './types/person
|
|
59
|
+
import { PersonCellValue as PersonCellValue_2 } from './types/person';
|
|
59
60
|
import { PieChartProps } from './PieChart';
|
|
60
61
|
import { PopoverContentProps } from '@radix-ui/react-popover';
|
|
61
62
|
import * as React_2 from 'react';
|
|
@@ -64,16 +65,16 @@ import { ReactNode } from 'react';
|
|
|
64
65
|
import { RefAttributes } from 'react';
|
|
65
66
|
import { RefObject } from 'react';
|
|
66
67
|
import { StatusCellValue } from '../../value-display/types/status';
|
|
67
|
-
import { StatusCellValue as StatusCellValue_2 } from './types/status
|
|
68
|
+
import { StatusCellValue as StatusCellValue_2 } from './types/status';
|
|
68
69
|
import { SVGProps } from 'react';
|
|
69
70
|
import { TagCellValue } from '../../value-display/types/tag';
|
|
70
|
-
import { TagCellValue as TagCellValue_2 } from './types/tag
|
|
71
|
+
import { TagCellValue as TagCellValue_2 } from './types/tag';
|
|
71
72
|
import { TagListCellValue } from '../../value-display/types/tagList';
|
|
72
|
-
import { TagListCellValue as TagListCellValue_2 } from './types/tagList
|
|
73
|
+
import { TagListCellValue as TagListCellValue_2 } from './types/tagList';
|
|
73
74
|
import { TeamCellValue } from '../../value-display/types/team';
|
|
74
|
-
import { TeamCellValue as TeamCellValue_2 } from './types/team
|
|
75
|
+
import { TeamCellValue as TeamCellValue_2 } from './types/team';
|
|
75
76
|
import { TextCellValue } from '../../value-display/types/text';
|
|
76
|
-
import { TextCellValue as TextCellValue_2 } from './types/text
|
|
77
|
+
import { TextCellValue as TextCellValue_2 } from './types/text';
|
|
77
78
|
import { ValueDisplayRendererContext } from '../../value-display';
|
|
78
79
|
import { VariantProps } from 'cva';
|
|
79
80
|
|
|
@@ -1035,6 +1036,8 @@ declare type ComponentTypes = (typeof componentTypes)[number];
|
|
|
1035
1036
|
|
|
1036
1037
|
declare const componentTypes: readonly ["layout", "info", "action", "form"];
|
|
1037
1038
|
|
|
1039
|
+
declare type CountryCode = keyof TranslationsType["countries"];
|
|
1040
|
+
|
|
1038
1041
|
export declare function createAtlaskitDriver(instanceId: symbol): DndDriver;
|
|
1039
1042
|
|
|
1040
1043
|
/**
|
|
@@ -1282,7 +1285,7 @@ export declare type DataSourceDefinition<R extends RecordType = RecordType, Filt
|
|
|
1282
1285
|
currentGrouping?: GroupingState<R, Grouping>;
|
|
1283
1286
|
};
|
|
1284
1287
|
|
|
1285
|
-
declare type DateFilterDefinition = BaseFilterDefinition<"date"> & {
|
|
1288
|
+
export declare type DateFilterDefinition = BaseFilterDefinition<"date"> & {
|
|
1286
1289
|
options?: DateFilterOptions_2;
|
|
1287
1290
|
};
|
|
1288
1291
|
|
|
@@ -1372,6 +1375,109 @@ declare type DateValue = {
|
|
|
1372
1375
|
declare type DefaultAction = BannerAction;
|
|
1373
1376
|
|
|
1374
1377
|
export declare const defaultTranslations: {
|
|
1378
|
+
readonly countries: {
|
|
1379
|
+
ad: string;
|
|
1380
|
+
ae: string;
|
|
1381
|
+
af: string;
|
|
1382
|
+
ag: string;
|
|
1383
|
+
ai: string;
|
|
1384
|
+
al: string;
|
|
1385
|
+
am: string;
|
|
1386
|
+
ao: string;
|
|
1387
|
+
ar: string;
|
|
1388
|
+
as: string;
|
|
1389
|
+
at: string;
|
|
1390
|
+
au: string;
|
|
1391
|
+
aw: string;
|
|
1392
|
+
ax: string;
|
|
1393
|
+
az: string;
|
|
1394
|
+
ba: string;
|
|
1395
|
+
bb: string;
|
|
1396
|
+
bd: string;
|
|
1397
|
+
be: string;
|
|
1398
|
+
bf: string;
|
|
1399
|
+
bg: string;
|
|
1400
|
+
bh: string;
|
|
1401
|
+
bi: string;
|
|
1402
|
+
bj: string;
|
|
1403
|
+
bm: string;
|
|
1404
|
+
bo: string;
|
|
1405
|
+
br: string;
|
|
1406
|
+
bt: string;
|
|
1407
|
+
bw: string;
|
|
1408
|
+
by: string;
|
|
1409
|
+
bz: string;
|
|
1410
|
+
ca: string;
|
|
1411
|
+
cd: string;
|
|
1412
|
+
cf: string;
|
|
1413
|
+
cg: string;
|
|
1414
|
+
ch: string;
|
|
1415
|
+
ci: string;
|
|
1416
|
+
ck: string;
|
|
1417
|
+
cl: string;
|
|
1418
|
+
cm: string;
|
|
1419
|
+
cn: string;
|
|
1420
|
+
co: string;
|
|
1421
|
+
cr: string;
|
|
1422
|
+
cu: string;
|
|
1423
|
+
cv: string;
|
|
1424
|
+
cw: string;
|
|
1425
|
+
cy: string;
|
|
1426
|
+
cz: string;
|
|
1427
|
+
de: string;
|
|
1428
|
+
dj: string;
|
|
1429
|
+
dk: string;
|
|
1430
|
+
dm: string;
|
|
1431
|
+
do: string;
|
|
1432
|
+
dz: string;
|
|
1433
|
+
ec: string;
|
|
1434
|
+
ee: string;
|
|
1435
|
+
eg: string;
|
|
1436
|
+
er: string;
|
|
1437
|
+
es: string;
|
|
1438
|
+
et: string;
|
|
1439
|
+
fi: string;
|
|
1440
|
+
fj: string;
|
|
1441
|
+
fk: string;
|
|
1442
|
+
fm: string;
|
|
1443
|
+
fo: string;
|
|
1444
|
+
fr: string;
|
|
1445
|
+
ga: string;
|
|
1446
|
+
gb: string;
|
|
1447
|
+
gd: string;
|
|
1448
|
+
ge: string;
|
|
1449
|
+
gg: string;
|
|
1450
|
+
gh: string;
|
|
1451
|
+
gi: string;
|
|
1452
|
+
gl: string;
|
|
1453
|
+
gm: string;
|
|
1454
|
+
gn: string;
|
|
1455
|
+
gq: string;
|
|
1456
|
+
gr: string;
|
|
1457
|
+
gt: string;
|
|
1458
|
+
gu: string;
|
|
1459
|
+
gw: string;
|
|
1460
|
+
hk: string;
|
|
1461
|
+
hn: string;
|
|
1462
|
+
hr: string;
|
|
1463
|
+
ht: string;
|
|
1464
|
+
hu: string;
|
|
1465
|
+
id: string;
|
|
1466
|
+
ie: string;
|
|
1467
|
+
il: string;
|
|
1468
|
+
im: string;
|
|
1469
|
+
in: string;
|
|
1470
|
+
io: string;
|
|
1471
|
+
iq: string;
|
|
1472
|
+
ir: string;
|
|
1473
|
+
is: string;
|
|
1474
|
+
it: string;
|
|
1475
|
+
je: string;
|
|
1476
|
+
jm: string;
|
|
1477
|
+
jo: string;
|
|
1478
|
+
jp: string;
|
|
1479
|
+
ke: string;
|
|
1480
|
+
};
|
|
1375
1481
|
readonly approvals: {
|
|
1376
1482
|
readonly history: "Approval history";
|
|
1377
1483
|
readonly statuses: {
|
|
@@ -1800,7 +1906,7 @@ export declare type F0AvatarFileProps = Omit<React.ComponentPropsWithoutRef<type
|
|
|
1800
1906
|
} & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
|
|
1801
1907
|
|
|
1802
1908
|
declare type F0AvatarFlagProps = {
|
|
1803
|
-
flag:
|
|
1909
|
+
flag: CountryCode;
|
|
1804
1910
|
size?: BaseAvatarProps["size"];
|
|
1805
1911
|
badge?: AvatarBadge;
|
|
1806
1912
|
} & Pick<BaseAvatarProps, "aria-label" | "aria-labelledby">;
|
|
@@ -2271,6 +2377,26 @@ declare type FilterTypeSchema<Options extends object = never> = {
|
|
|
2271
2377
|
*/
|
|
2272
2378
|
export declare type FilterValue<T extends FilterDefinition> = T extends InFilterDefinition<infer U> ? U[] : T extends SearchFilterDefinition ? string : T extends DateFilterDefinition ? DateRange | Date | undefined : T extends NumberFilterDefinition ? [number | undefined, number | undefined] | undefined : never;
|
|
2273
2379
|
|
|
2380
|
+
/**
|
|
2381
|
+
* Extracts the value type for a specific filter key from a FiltersDefinition.
|
|
2382
|
+
* This helper type allows for type-safe access to filter values when you know the specific filter key.
|
|
2383
|
+
*
|
|
2384
|
+
* @example
|
|
2385
|
+
* ```ts
|
|
2386
|
+
* type MyFilters = {
|
|
2387
|
+
* department: InFilterDefinition<string>
|
|
2388
|
+
* search: SearchFilterDefinition
|
|
2389
|
+
* }
|
|
2390
|
+
*
|
|
2391
|
+
* type DepartmentValue = FilterValueByKey<MyFilters, 'department'> // string[]
|
|
2392
|
+
* type SearchValue = FilterValueByKey<MyFilters, 'search'> // string
|
|
2393
|
+
* ```
|
|
2394
|
+
*
|
|
2395
|
+
* @template Definition - The FiltersDefinition type
|
|
2396
|
+
* @template Key - The specific filter key to extract the value type for
|
|
2397
|
+
*/
|
|
2398
|
+
export declare type FilterValueByKey<Definition extends Record<string, FilterDefinition>, Key extends keyof Definition> = FilterValue<Definition[Key]>;
|
|
2399
|
+
|
|
2274
2400
|
export declare type FlagAvatarVariant = Extract<AvatarVariant, {
|
|
2275
2401
|
type: "flag";
|
|
2276
2402
|
}>;
|
|
@@ -2456,7 +2582,7 @@ declare type ImageContextValue = {
|
|
|
2456
2582
|
|
|
2457
2583
|
declare type ImageProps = ImgHTMLAttributes<HTMLImageElement>;
|
|
2458
2584
|
|
|
2459
|
-
declare type InFilterDefinition<T =
|
|
2585
|
+
export declare type InFilterDefinition<T = string | number, R extends RecordType = RecordType> = BaseFilterDefinition<"in"> & {
|
|
2460
2586
|
options: InFilterOptions_2<T, R>;
|
|
2461
2587
|
};
|
|
2462
2588
|
|
|
@@ -2476,13 +2602,13 @@ declare type InFilterOptionItem<T = unknown> = {
|
|
|
2476
2602
|
* Represents the options for the InFilter component.
|
|
2477
2603
|
* @template T - Type of the underlying value
|
|
2478
2604
|
*/
|
|
2479
|
-
declare type InFilterOptions_2<T,
|
|
2605
|
+
declare type InFilterOptions_2<T, _R extends RecordType = RecordType> = {
|
|
2480
2606
|
cache?: boolean;
|
|
2481
2607
|
} & ({
|
|
2482
2608
|
options: Array<InFilterOptionItem<T>> | (() => Array<InFilterOptionItem<T>> | Promise<Array<InFilterOptionItem<T>>>);
|
|
2483
2609
|
} | {
|
|
2484
|
-
source: DataSourceDefinition<
|
|
2485
|
-
mapOptions: (item:
|
|
2610
|
+
source: DataSourceDefinition<any, FiltersDefinition, SortingsDefinition, GroupingDefinition<any>>;
|
|
2611
|
+
mapOptions: (item: any) => InFilterOptionItem<T>;
|
|
2486
2612
|
});
|
|
2487
2613
|
|
|
2488
2614
|
/**
|
|
@@ -2852,7 +2978,7 @@ export declare interface NextStepsProps {
|
|
|
2852
2978
|
items: StepItemProps[];
|
|
2853
2979
|
}
|
|
2854
2980
|
|
|
2855
|
-
declare type NumberFilterDefinition = BaseFilterDefinition<"number"> & {
|
|
2981
|
+
export declare type NumberFilterDefinition = BaseFilterDefinition<"number"> & {
|
|
2856
2982
|
options?: NumberFilterOptions_2;
|
|
2857
2983
|
};
|
|
2858
2984
|
|
|
@@ -3257,7 +3383,7 @@ declare type RegularAction = BaseAction & {
|
|
|
3257
3383
|
|
|
3258
3384
|
declare type RendererDefinition = ValueDisplayRendererDefinition;
|
|
3259
3385
|
|
|
3260
|
-
declare type SearchFilterDefinition = BaseFilterDefinition<"search">;
|
|
3386
|
+
export declare type SearchFilterDefinition = BaseFilterDefinition<"search">;
|
|
3261
3387
|
|
|
3262
3388
|
declare type SearchOptions = {
|
|
3263
3389
|
/** Whether search is enabled */
|
|
@@ -3949,6 +4075,7 @@ export declare const useXRay: () => {
|
|
|
3949
4075
|
|
|
3950
4076
|
declare type ValueDisplayRendererContext_2 = {
|
|
3951
4077
|
visualization: ValueDisplayVisualizationType;
|
|
4078
|
+
i18n: TranslationsType;
|
|
3952
4079
|
};
|
|
3953
4080
|
|
|
3954
4081
|
/**
|
|
@@ -3981,6 +4108,7 @@ declare const valueDisplayRenderers: {
|
|
|
3981
4108
|
readonly icon: (args: IconCellValue, meta: ValueDisplayRendererContext_2) => JSX_2.Element;
|
|
3982
4109
|
readonly file: (args: FileCellValue_2) => JSX_2.Element;
|
|
3983
4110
|
readonly folder: (args: FolderCellValue_2) => JSX_2.Element;
|
|
4111
|
+
readonly country: (args: CountryCellValue, context: ValueDisplayRendererContext_2) => JSX_2.Element;
|
|
3984
4112
|
};
|
|
3985
4113
|
|
|
3986
4114
|
declare type ValueDisplayVisualizationType = "table" | "card" | "list" | (string & {});
|
|
@@ -4052,6 +4180,31 @@ declare global {
|
|
|
4052
4180
|
}
|
|
4053
4181
|
|
|
4054
4182
|
|
|
4183
|
+
declare module "gridstack" {
|
|
4184
|
+
interface GridStackWidget {
|
|
4185
|
+
id?: string;
|
|
4186
|
+
allowedSizes?: Array<{
|
|
4187
|
+
w: number;
|
|
4188
|
+
h: number;
|
|
4189
|
+
}>;
|
|
4190
|
+
renderFn?: () => React.ReactElement | null;
|
|
4191
|
+
meta?: Record<string, unknown>;
|
|
4192
|
+
}
|
|
4193
|
+
interface GridStackNode {
|
|
4194
|
+
id?: string;
|
|
4195
|
+
w?: number;
|
|
4196
|
+
h?: number;
|
|
4197
|
+
x?: number;
|
|
4198
|
+
y?: number;
|
|
4199
|
+
allowedSizes?: Array<{
|
|
4200
|
+
w: number;
|
|
4201
|
+
h: number;
|
|
4202
|
+
}>;
|
|
4203
|
+
renderFn?: () => React.ReactElement | null;
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4207
|
+
|
|
4055
4208
|
declare module "@tiptap/core" {
|
|
4056
4209
|
interface Commands<ReturnType> {
|
|
4057
4210
|
aiBlock: {
|
|
@@ -4079,31 +4232,6 @@ declare module "@tiptap/core" {
|
|
|
4079
4232
|
}
|
|
4080
4233
|
|
|
4081
4234
|
|
|
4082
|
-
declare module "gridstack" {
|
|
4083
|
-
interface GridStackWidget {
|
|
4084
|
-
id?: string;
|
|
4085
|
-
allowedSizes?: Array<{
|
|
4086
|
-
w: number;
|
|
4087
|
-
h: number;
|
|
4088
|
-
}>;
|
|
4089
|
-
renderFn?: () => React.ReactElement | null;
|
|
4090
|
-
meta?: Record<string, unknown>;
|
|
4091
|
-
}
|
|
4092
|
-
interface GridStackNode {
|
|
4093
|
-
id?: string;
|
|
4094
|
-
w?: number;
|
|
4095
|
-
h?: number;
|
|
4096
|
-
x?: number;
|
|
4097
|
-
y?: number;
|
|
4098
|
-
allowedSizes?: Array<{
|
|
4099
|
-
w: number;
|
|
4100
|
-
h: number;
|
|
4101
|
-
}>;
|
|
4102
|
-
renderFn?: () => React.ReactElement | null;
|
|
4103
|
-
}
|
|
4104
|
-
}
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
4235
|
declare module "@tiptap/core" {
|
|
4108
4236
|
interface Commands<ReturnType> {
|
|
4109
4237
|
moodTracker: {
|