@factorialco/f0-react 1.287.0 → 1.289.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.
@@ -55,7 +55,6 @@ import { LongTextCellValue } from './types/longText';
55
55
  import { NumberCellValue } from './types/number';
56
56
  import { NumberCellValue as NumberCellValue_2 } from '../../value-display/types/number';
57
57
  import { NumberFilterOptions } from './NumberFilter/NumberFilter';
58
- import { NumberFilterValue } from './NumberFilter/NumberFilter';
59
58
  import { Observable } from 'zen-observable-ts';
60
59
  import { Path } from 'react-hook-form';
61
60
  import { PercentageCellValue } from './types/percentage';
@@ -71,6 +70,7 @@ import * as RechartsPrimitive from 'recharts';
71
70
  import { RefAttributes } from 'react';
72
71
  import { RefObject } from 'react';
73
72
  import { ScrollAreaProps } from '@radix-ui/react-scroll-area';
73
+ import { SearchFilterOptions } from './SearchFilter/SearchFilter';
74
74
  import { StatusCellValue } from './types/status';
75
75
  import { StatusCellValue as StatusCellValue_2 } from '../../value-display/types/status';
76
76
  import { SVGProps } from 'react';
@@ -650,6 +650,22 @@ declare type AvatarVariant = DistributiveOmit<({
650
650
  type: "icon";
651
651
  } & F0AvatarIconProps), "size">;
652
652
 
653
+ declare type AvatarVariant_2 = ({
654
+ type: "person";
655
+ } & Omit<F0AvatarPersonProps, "size">) | ({
656
+ type: "team";
657
+ } & Omit<F0AvatarTeamProps, "size">) | ({
658
+ type: "company";
659
+ } & Omit<F0AvatarCompanyProps, "size">) | ({
660
+ type: "file";
661
+ } & Omit<F0AvatarFileProps, "size">) | ({
662
+ type: "flag";
663
+ } & Omit<F0AvatarFlagProps, "size">) | ({
664
+ type: "emoji";
665
+ } & Omit<F0AvatarEmojiProps, "size">) | ({
666
+ type: "icon";
667
+ } & Omit<F0AvatarIconProps, "size">);
668
+
653
669
  export declare const Badge: ({ type, size, icon }: BadgeProps) => JSX_2.Element;
654
670
 
655
671
  export declare interface BadgeProps extends VariantProps<typeof badgeVariants> {
@@ -1339,6 +1355,19 @@ export declare type ChatWidgetEmptyStateProps = Props_5;
1339
1355
 
1340
1356
  declare type ChildrenResponse<R extends RecordType> = BaseResponse<R> | R[] | NestedResponseWithType<R>;
1341
1357
 
1358
+ declare type ChipLabel = {
1359
+ label: string;
1360
+ } & ({
1361
+ icon: IconType;
1362
+ avatar?: never;
1363
+ } | {
1364
+ icon?: never;
1365
+ avatar: AvatarVariant_2;
1366
+ } | {
1367
+ icon?: never;
1368
+ avatar?: never;
1369
+ });
1370
+
1342
1371
  export declare function ClockInControls({ trackedMinutes, remainingMinutes, data, labels, locationId, locations, canShowLocation, locationSelectorDisabled, onClockIn, onClockOut, onBreak, breakTypes, onChangeBreakTypeId, canShowBreakButton, canSeeGraph, canSeeRemainingTime, onChangeLocationId, canShowProject, projectSelectorElement, breakTypeName, }: ClockInControlsProps): JSX_2.Element;
1343
1372
 
1344
1373
  export declare interface ClockInControlsProps {
@@ -2181,12 +2210,20 @@ declare const defaultTranslations: {
2181
2210
  readonly equal: "Equal to";
2182
2211
  readonly equalTo: "Equal to {{value}}";
2183
2212
  readonly lessOrEqual: "Less or equal to";
2213
+ readonly lessThan: "Less than";
2184
2214
  readonly greaterOrEqual: "Greater or equal to";
2215
+ readonly greaterThan: "Greater than";
2185
2216
  readonly equalShort: "= {{value}}";
2186
2217
  readonly greaterThanOrEqualShort: ">= {{value}}";
2218
+ readonly greaterThanShort: "> {{value}}";
2187
2219
  readonly lessThanOrEqualShort: "<= {{value}}";
2220
+ readonly lessThanShort: "< {{value}}";
2188
2221
  readonly rangeTitle: "Use range";
2189
- readonly range: "Between {{min}} and {{max}}";
2222
+ readonly range: "{{minStrict}} {{min}} and {{maxStrict}} {{max}}";
2223
+ };
2224
+ readonly search: {
2225
+ readonly relaxed: "Relaxed";
2226
+ readonly strict: "Strict";
2190
2227
  };
2191
2228
  readonly selectAll: "Select all";
2192
2229
  readonly clear: "Clear";
@@ -2509,7 +2546,7 @@ declare const DropdownMenuItem: React_2.ForwardRefExoticComponent<Omit<DropdownM
2509
2546
  inset?: boolean;
2510
2547
  } & React_2.RefAttributes<HTMLDivElement>>;
2511
2548
 
2512
- declare type DropdownProps = Omit<DropdownInternalProps, (typeof privateProps_2)[number]> & {
2549
+ declare type DropdownProps = Omit<DropdownInternalProps, (typeof privateProps_4)[number]> & {
2513
2550
  open?: boolean;
2514
2551
  onOpenChange?: (open: boolean) => void;
2515
2552
  };
@@ -2945,12 +2982,12 @@ declare type FilterTypeContext<Options extends object = never> = {
2945
2982
  i18n: I18nContextType;
2946
2983
  };
2947
2984
 
2948
- declare type FilterTypeDefinition<Value = unknown, Options extends object = never, EmptyValue = Value> = {
2949
- /** Check if the value is empty */
2985
+ declare type FilterTypeDefinition<Value = unknown, Options extends object = never, EmptyValue = Value, OptionalOptions extends boolean = false> = {
2950
2986
  emptyValue: EmptyValue;
2987
+ /** Check if the value is empty */
2951
2988
  isEmpty: (value: Value | undefined, context: FilterTypeContext<Options>) => boolean;
2952
2989
  /** Render the filter form */
2953
- render: <Schema extends FilterTypeSchema<Options>>(props: {
2990
+ render: <Schema extends FilterTypeSchema<Options, OptionalOptions>>(props: {
2954
2991
  schema: Schema;
2955
2992
  value: Value;
2956
2993
  onChange: (value: Value) => void;
@@ -2959,7 +2996,7 @@ declare type FilterTypeDefinition<Value = unknown, Options extends object = neve
2959
2996
  /**
2960
2997
  * The value label to display in the filter chips
2961
2998
  */
2962
- chipLabel: (value: Value, context: FilterTypeContext<Options>) => string | Promise<string>;
2999
+ chipLabel: (value: Value, context: FilterTypeContext<Options>) => string | ChipLabel | Promise<string | ChipLabel>;
2963
3000
  /**
2964
3001
  * The default options to render a filter of this type, for example max and min date for a date filter, the list of options for an in filter, etc
2965
3002
  */
@@ -2974,14 +3011,27 @@ declare type FilterTypeKey = keyof typeof filterTypes;
2974
3011
 
2975
3012
  declare const filterTypes: {
2976
3013
  readonly in: FilterTypeDefinition<string[], InFilterOptions<string>>;
2977
- readonly search: FilterTypeDefinition<string>;
3014
+ readonly search: FilterTypeDefinition<string | {
3015
+ value: string;
3016
+ strict: boolean;
3017
+ }, SearchFilterOptions, string | {
3018
+ value: string;
3019
+ strict: boolean;
3020
+ }, true>;
2978
3021
  readonly date: FilterTypeDefinition<Date | DateRange | undefined, DateFilterOptions>;
2979
3022
  readonly number: FilterTypeDefinition<NumberFilterValue, NumberFilterOptions>;
2980
3023
  };
2981
3024
 
2982
- declare type FilterTypeSchema<Options extends object = never> = {
2983
- options: Options extends never ? never : Options;
3025
+ declare type FilterTypeSchema<Options extends object = never, OptionalOptions extends boolean = false> = OptionalOptions extends true ? FilterTypeSchemaOptionalOptions<Options> : FilterTypeSchemaRequiredOptions<Options>;
3026
+
3027
+ declare type FilterTypeSchemaOptionalOptions<Options extends object = never> = {
3028
+ label: string;
3029
+ options?: Options extends never ? never : Options;
3030
+ };
3031
+
3032
+ declare type FilterTypeSchemaRequiredOptions<Options extends object = never> = {
2984
3033
  label: string;
3034
+ options: Options extends never ? never : Options;
2985
3035
  };
2986
3036
 
2987
3037
  /**
@@ -2992,7 +3042,7 @@ declare type FilterTypeSchema<Options extends object = never> = {
2992
3042
  * This type is used to ensure type safety when working with filter values.
2993
3043
  * @template T - The filter definition type
2994
3044
  */
2995
- 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;
3045
+ 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 ? NumberFilterValue | undefined : never;
2996
3046
 
2997
3047
  /**
2998
3048
  * Extracts the value type for a specific filter key from a FiltersDefinition.
@@ -3339,9 +3389,9 @@ export declare type InfiniteScrollPaginatedResponse<TRecord> = BasePaginatedResp
3339
3389
  hasMore: boolean;
3340
3390
  };
3341
3391
 
3342
- export declare const Input: <T extends string = string>({ type, ...props }: InputProps<T>) => JSX_2.Element;
3392
+ export declare const Input: <T extends string>(props: InputProps<T>) => JSX_2.Element;
3343
3393
 
3344
- declare const Input_2: React_2.ForwardRefExoticComponent<Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> & Pick<InputFieldProps<string>, "label" | "onChange" | "role" | "onFocus" | "onBlur" | "disabled" | "maxLength" | "required" | "size" | "loading" | "status" | "error" | "icon" | "hideLabel" | "append" | "labelIcon" | "onClickContent" | "hint" | "readonly" | "clearable" | "autocomplete" | "onClear" | "isEmpty" | "emptyValue" | "hideMaxLength" | "appendTag" | "lengthProvider"> & React_2.RefAttributes<HTMLInputElement>>;
3394
+ declare const Input_2: React_2.ForwardRefExoticComponent<Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "onChange" | "size"> & Pick<InputFieldProps<string>, "label" | "onChange" | "role" | "onFocus" | "onBlur" | "disabled" | "maxLength" | "required" | "size" | "loading" | "status" | "error" | "icon" | "hideLabel" | "append" | "labelIcon" | "onClickContent" | "hint" | "readonly" | "clearable" | "autocomplete" | "onClear" | "isEmpty" | "emptyValue" | "hideMaxLength" | "appendTag" | "lengthProvider" | "buttonToggle"> & React_2.RefAttributes<HTMLInputElement>>;
3345
3395
 
3346
3396
  declare const INPUTFIELD_SIZES: readonly ["sm", "md"];
3347
3397
 
@@ -3404,6 +3454,16 @@ declare type InputFieldProps<T> = {
3404
3454
  */
3405
3455
  offset?: number;
3406
3456
  };
3457
+ /**
3458
+ * Renders a button toggle inside the input field
3459
+ */
3460
+ buttonToggle?: {
3461
+ label: string | [string, string];
3462
+ icon: IconType | [IconType, IconType];
3463
+ selected: boolean;
3464
+ disabled?: boolean;
3465
+ onChange: (selected: boolean) => void;
3466
+ };
3407
3467
  };
3408
3468
 
3409
3469
  declare type InputFieldSize = (typeof INPUTFIELD_SIZES)[number];
@@ -3420,11 +3480,13 @@ declare const inputFieldStatus: readonly ["default", "warning", "info", "error"]
3420
3480
 
3421
3481
  declare type InputFieldStatusType = (typeof inputFieldStatus)[number];
3422
3482
 
3423
- export declare type InputProps<T extends string> = Pick<ComponentProps<typeof Input_2>, "ref"> & Pick<InputFieldProps<T>, "autoFocus" | "required" | "disabled" | "size" | "onChange" | "value" | "placeholder" | "clearable" | "maxLength" | "hideMaxLength" | "label" | "labelIcon" | "icon" | "hideLabel" | "name" | "error" | "status" | "hint" | "autocomplete"> & {
3483
+ declare type InputInternalProps<T extends string> = Pick<ComponentProps<typeof Input_2>, "ref"> & Pick<InputFieldProps<T>, "autoFocus" | "required" | "disabled" | "size" | "onChange" | "value" | "placeholder" | "clearable" | "maxLength" | "label" | "labelIcon" | "icon" | "hideLabel" | "name" | "error" | "status" | "hint" | "autocomplete" | "buttonToggle" | "hideMaxLength"> & {
3424
3484
  type?: Exclude<HTMLInputTypeAttribute, "number">;
3425
3485
  onPressEnter?: () => void;
3426
3486
  };
3427
3487
 
3488
+ export declare type InputProps<T extends string> = Omit<InputInternalProps<T>, (typeof privateProps_2)[number]>;
3489
+
3428
3490
  declare const internalAvatarColors: readonly ["viridian", "malibu", "yellow", "purple", "lilac", "barbie", "smoke", "army", "flubber", "indigo", "camel"];
3429
3491
 
3430
3492
  declare type InternalAvatarProps = React_2.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> & {
@@ -3968,12 +4030,28 @@ export declare type NumberFilterDefinition = BaseFilterDefinition<"number"> & {
3968
4030
  declare type NumberFilterOptions_2 = {
3969
4031
  min?: number;
3970
4032
  max?: number;
3971
- modes?: ("range" | "single")[];
4033
+ modes?: readonly ("range" | "single")[];
4034
+ openCloseToggle?: boolean;
3972
4035
  };
3973
4036
 
3974
- export declare const NumberInput: ForwardRefExoticComponent<Omit<NumberInputProps, "ref"> & RefAttributes<HTMLInputElement>>;
4037
+ declare type NumberFilterValue = {
4038
+ mode: "single";
4039
+ value: number | undefined;
4040
+ } | {
4041
+ mode: "range";
4042
+ from: {
4043
+ value: number | undefined;
4044
+ closed: boolean;
4045
+ };
4046
+ to: {
4047
+ value: number | undefined;
4048
+ closed: boolean;
4049
+ };
4050
+ } | undefined;
4051
+
4052
+ export declare const NumberInput: (props: NumberInputProps) => JSX_2.Element;
3975
4053
 
3976
- export declare type NumberInputProps = Omit<InputProps<string>, "value" | "type" | "onChange"> & {
4054
+ declare type NumberInputInternalProps = Omit<InputInternalProps<string>, "value" | "type" | "onChange"> & {
3977
4055
  locale: string;
3978
4056
  value?: number | null;
3979
4057
  step?: number;
@@ -3984,6 +4062,8 @@ export declare type NumberInputProps = Omit<InputProps<string>, "value" | "type"
3984
4062
  units?: string;
3985
4063
  };
3986
4064
 
4065
+ export declare type NumberInputProps = Omit<NumberInputInternalProps, (typeof privateProps_3)[number]>;
4066
+
3987
4067
  declare type NumericQuestionProps = BaseQuestionPropsForOtherQuestionComponents & {
3988
4068
  value?: number | null;
3989
4069
  };
@@ -4071,7 +4151,7 @@ export declare interface OneCalendarInternalProps {
4071
4151
  compact?: boolean;
4072
4152
  }
4073
4153
 
4074
- export declare type OneCalendarProps = Omit<OneCalendarInternalProps, (typeof privateProps_3)[number]>;
4154
+ export declare type OneCalendarProps = Omit<OneCalendarInternalProps, (typeof privateProps_5)[number]>;
4075
4155
 
4076
4156
  /**
4077
4157
  * @experimental This is an experimental component use it at your own risk
@@ -4581,11 +4661,15 @@ export declare const PrivateBox: FC<PropsWithChildren>;
4581
4661
 
4582
4662
  declare const privateProps: readonly ["append", "className", "pressed", "compact", "noTitle", "noAutoTooltip", "style"];
4583
4663
 
4584
- declare const privateProps_2: readonly [];
4664
+ declare const privateProps_2: readonly ["buttonToggle"];
4585
4665
 
4586
- declare const privateProps_3: readonly ["compact"];
4666
+ declare const privateProps_3: readonly ["buttonToggle"];
4587
4667
 
4588
- declare const privateProps_4: readonly ["delay"];
4668
+ declare const privateProps_4: readonly [];
4669
+
4670
+ declare const privateProps_5: readonly ["compact"];
4671
+
4672
+ declare const privateProps_6: readonly ["delay"];
4589
4673
 
4590
4674
  declare type ProductUpdate = {
4591
4675
  title: string;
@@ -5726,7 +5810,7 @@ declare type TooltipInternalProps = {
5726
5810
  description: string;
5727
5811
  });
5728
5812
 
5729
- export declare type TooltipProps = Omit<TooltipInternalProps, (typeof privateProps_4)[number]>;
5813
+ export declare type TooltipProps = Omit<TooltipInternalProps, (typeof privateProps_6)[number]>;
5730
5814
 
5731
5815
  declare interface TranscriptLabels {
5732
5816
  deleteBlock: string;
@@ -6145,27 +6229,11 @@ declare global {
6145
6229
  }
6146
6230
 
6147
6231
 
6148
- declare module "gridstack" {
6149
- interface GridStackWidget {
6150
- id?: string;
6151
- allowedSizes?: Array<{
6152
- w: number;
6153
- h: number;
6154
- }>;
6155
- renderFn?: () => React.ReactElement | null;
6156
- meta?: Record<string, unknown>;
6157
- }
6158
- interface GridStackNode {
6159
- id?: string;
6160
- w?: number;
6161
- h?: number;
6162
- x?: number;
6163
- y?: number;
6164
- allowedSizes?: Array<{
6165
- w: number;
6166
- h: number;
6167
- }>;
6168
- renderFn?: () => React.ReactElement | null;
6232
+ declare module "@tiptap/core" {
6233
+ interface Commands<ReturnType> {
6234
+ aiBlock: {
6235
+ insertAIBlock: (data: AIBlockData, config: AIBlockConfigWithLabels) => ReturnType;
6236
+ };
6169
6237
  }
6170
6238
  }
6171
6239
 
@@ -6188,11 +6256,27 @@ declare module "@tiptap/core" {
6188
6256
  }
6189
6257
 
6190
6258
 
6191
- declare module "@tiptap/core" {
6192
- interface Commands<ReturnType> {
6193
- aiBlock: {
6194
- insertAIBlock: (data: AIBlockData, config: AIBlockConfigWithLabels) => ReturnType;
6195
- };
6259
+ declare module "gridstack" {
6260
+ interface GridStackWidget {
6261
+ id?: string;
6262
+ allowedSizes?: Array<{
6263
+ w: number;
6264
+ h: number;
6265
+ }>;
6266
+ renderFn?: () => React.ReactElement | null;
6267
+ meta?: Record<string, unknown>;
6268
+ }
6269
+ interface GridStackNode {
6270
+ id?: string;
6271
+ w?: number;
6272
+ h?: number;
6273
+ x?: number;
6274
+ y?: number;
6275
+ allowedSizes?: Array<{
6276
+ w: number;
6277
+ h: number;
6278
+ }>;
6279
+ renderFn?: () => React.ReactElement | null;
6196
6280
  }
6197
6281
  }
6198
6282