@factorialco/f0-react 6.5.0 → 6.7.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.
@@ -39,6 +39,7 @@ import { DotTagCellValue as DotTagCellValue_2 } from './experimental';
39
39
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
40
40
  import { EmployeeItemProps } from './types';
41
41
  import { F0EmojiPickerProps as F0EmojiPickerProps_2 } from './types';
42
+ import { F0PhoneInputProps as F0PhoneInputProps_2 } from './types';
42
43
  import { F0SegmentedControlProps as F0SegmentedControlProps_2 } from './types';
43
44
  import { F0SelectProps as F0SelectProps_2 } from './types';
44
45
  import { F0TagBalanceProps as F0TagBalanceProps_2 } from './types';
@@ -3184,6 +3185,7 @@ declare const defaultTranslations: {
3184
3185
  readonly selectPlaceholder: "Select";
3185
3186
  };
3186
3187
  readonly countries: {
3188
+ ac: string;
3187
3189
  ad: string;
3188
3190
  ae: string;
3189
3191
  af: string;
@@ -3208,14 +3210,19 @@ declare const defaultTranslations: {
3208
3210
  bh: string;
3209
3211
  bi: string;
3210
3212
  bj: string;
3213
+ bl: string;
3211
3214
  bm: string;
3215
+ bn: string;
3212
3216
  bo: string;
3217
+ bq: string;
3213
3218
  br: string;
3219
+ bs: string;
3214
3220
  bt: string;
3215
3221
  bw: string;
3216
3222
  by: string;
3217
3223
  bz: string;
3218
3224
  ca: string;
3225
+ cc: string;
3219
3226
  cd: string;
3220
3227
  cf: string;
3221
3228
  cg: string;
@@ -3230,6 +3237,7 @@ declare const defaultTranslations: {
3230
3237
  cu: string;
3231
3238
  cv: string;
3232
3239
  cw: string;
3240
+ cx: string;
3233
3241
  cy: string;
3234
3242
  cz: string;
3235
3243
  de: string;
@@ -3241,6 +3249,7 @@ declare const defaultTranslations: {
3241
3249
  ec: string;
3242
3250
  ee: string;
3243
3251
  eg: string;
3252
+ eh: string;
3244
3253
  er: string;
3245
3254
  es: string;
3246
3255
  et: string;
@@ -3254,17 +3263,20 @@ declare const defaultTranslations: {
3254
3263
  gb: string;
3255
3264
  gd: string;
3256
3265
  ge: string;
3266
+ gf: string;
3257
3267
  gg: string;
3258
3268
  gh: string;
3259
3269
  gi: string;
3260
3270
  gl: string;
3261
3271
  gm: string;
3262
3272
  gn: string;
3273
+ gp: string;
3263
3274
  gq: string;
3264
3275
  gr: string;
3265
3276
  gt: string;
3266
3277
  gu: string;
3267
3278
  gw: string;
3279
+ gy: string;
3268
3280
  hk: string;
3269
3281
  hn: string;
3270
3282
  hr: string;
@@ -3285,6 +3297,140 @@ declare const defaultTranslations: {
3285
3297
  jo: string;
3286
3298
  jp: string;
3287
3299
  ke: string;
3300
+ kg: string;
3301
+ kh: string;
3302
+ ki: string;
3303
+ km: string;
3304
+ kn: string;
3305
+ kp: string;
3306
+ kr: string;
3307
+ kw: string;
3308
+ ky: string;
3309
+ kz: string;
3310
+ la: string;
3311
+ lb: string;
3312
+ lc: string;
3313
+ li: string;
3314
+ lk: string;
3315
+ lr: string;
3316
+ ls: string;
3317
+ lt: string;
3318
+ lu: string;
3319
+ lv: string;
3320
+ ly: string;
3321
+ ma: string;
3322
+ mc: string;
3323
+ md: string;
3324
+ me: string;
3325
+ mf: string;
3326
+ mg: string;
3327
+ mh: string;
3328
+ mk: string;
3329
+ ml: string;
3330
+ mm: string;
3331
+ mn: string;
3332
+ mo: string;
3333
+ mp: string;
3334
+ mq: string;
3335
+ mr: string;
3336
+ ms: string;
3337
+ mt: string;
3338
+ mu: string;
3339
+ mv: string;
3340
+ mw: string;
3341
+ mx: string;
3342
+ my: string;
3343
+ mz: string;
3344
+ na: string;
3345
+ nc: string;
3346
+ ne: string;
3347
+ nf: string;
3348
+ ng: string;
3349
+ ni: string;
3350
+ nl: string;
3351
+ no: string;
3352
+ np: string;
3353
+ nr: string;
3354
+ nu: string;
3355
+ nz: string;
3356
+ om: string;
3357
+ pa: string;
3358
+ pe: string;
3359
+ pf: string;
3360
+ pg: string;
3361
+ ph: string;
3362
+ pk: string;
3363
+ pl: string;
3364
+ pm: string;
3365
+ pn: string;
3366
+ pr: string;
3367
+ ps: string;
3368
+ pt: string;
3369
+ pw: string;
3370
+ py: string;
3371
+ qa: string;
3372
+ re: string;
3373
+ ro: string;
3374
+ rs: string;
3375
+ ru: string;
3376
+ rw: string;
3377
+ sa: string;
3378
+ sb: string;
3379
+ sc: string;
3380
+ sd: string;
3381
+ se: string;
3382
+ sg: string;
3383
+ sh: string;
3384
+ si: string;
3385
+ sj: string;
3386
+ sk: string;
3387
+ sl: string;
3388
+ sm: string;
3389
+ sn: string;
3390
+ so: string;
3391
+ sr: string;
3392
+ ss: string;
3393
+ st: string;
3394
+ sv: string;
3395
+ sx: string;
3396
+ sy: string;
3397
+ sz: string;
3398
+ ta: string;
3399
+ tc: string;
3400
+ td: string;
3401
+ tg: string;
3402
+ th: string;
3403
+ tj: string;
3404
+ tk: string;
3405
+ tl: string;
3406
+ tm: string;
3407
+ tn: string;
3408
+ to: string;
3409
+ tr: string;
3410
+ tt: string;
3411
+ tv: string;
3412
+ tw: string;
3413
+ tz: string;
3414
+ ua: string;
3415
+ ug: string;
3416
+ us: string;
3417
+ uy: string;
3418
+ uz: string;
3419
+ va: string;
3420
+ vc: string;
3421
+ ve: string;
3422
+ vg: string;
3423
+ vi: string;
3424
+ vn: string;
3425
+ vu: string;
3426
+ wf: string;
3427
+ ws: string;
3428
+ xk: string;
3429
+ ye: string;
3430
+ yt: string;
3431
+ za: string;
3432
+ zm: string;
3433
+ zw: string;
3288
3434
  };
3289
3435
  readonly approvals: {
3290
3436
  readonly history: "Approval history";
@@ -3952,6 +4098,12 @@ declare const defaultTranslations: {
3952
4098
  readonly greaterThan: "It should be greater than {{min}}";
3953
4099
  readonly lessThan: "It should be less than {{max}}";
3954
4100
  };
4101
+ readonly phoneInput: {
4102
+ readonly country: "Country";
4103
+ readonly countryWithDialCode: "{{country}} {{dialCode}}";
4104
+ readonly searchCountry: "Search country or dial code";
4105
+ readonly noResults: "No country found";
4106
+ };
3955
4107
  readonly imageUpload: {
3956
4108
  readonly uploading: "Uploading...";
3957
4109
  readonly uploadError: "Upload failed";
@@ -4165,6 +4317,9 @@ declare const defaultTranslations: {
4165
4317
  readonly checkbox: {
4166
4318
  readonly mustBeChecked: "This option must be selected";
4167
4319
  };
4320
+ readonly phone: {
4321
+ readonly invalid: "Enter a valid phone number";
4322
+ };
4168
4323
  };
4169
4324
  };
4170
4325
  readonly graph: {
@@ -6221,6 +6376,73 @@ export declare const F0NumberInput: ForwardRefExoticComponent<Omit<F0NumberInput
6221
6376
 
6222
6377
  export declare type F0NumberInputProps = Omit<NumberInputInternalProps, (typeof privateProps_4)[number]>;
6223
6378
 
6379
+ /** @experimental This is an experimental component, use it at your own risk. */
6380
+ export declare const F0PhoneInput: ForwardRefExoticComponent<F0PhoneInputProps_2 & RefAttributes<HTMLInputElement>>;
6381
+
6382
+ export declare type F0PhoneInputChangeMeta = {
6383
+ /** Country resolved for the current value, e.g. `"es"` */
6384
+ country: CountryCode | undefined;
6385
+ /** Full E.164 representation when derivable, e.g. `"+34674897945"` */
6386
+ e164: string | undefined;
6387
+ /** libphonenumber validity — informative only, never enforced */
6388
+ isValid: boolean;
6389
+ isPossible: boolean;
6390
+ };
6391
+
6392
+ export declare interface F0PhoneInputProps {
6393
+ label: string;
6394
+ /** Controlled value */
6395
+ value?: F0PhoneInputValue;
6396
+ /** Initial value when uncontrolled */
6397
+ defaultValue?: F0PhoneInputValue;
6398
+ onChange?: (value: F0PhoneInputValue | undefined, meta: F0PhoneInputChangeMeta) => void;
6399
+ onCountryChange?: (country: CountryCode | undefined) => void;
6400
+ /** Country pre-selected while the input is empty */
6401
+ defaultCountry?: CountryCode;
6402
+ /** Countries listed first in the selector, in the given order */
6403
+ pinnedCountries?: CountryCode[];
6404
+ /** Restricts both the selector and typed/pasted country detection */
6405
+ allowedCountries?: CountryCode[];
6406
+ /**
6407
+ * Defaults to a national example number (`612 34 56 78`) for the selected
6408
+ * country, or an international one (`+34 612 34 56 78`) while no country
6409
+ * is selected
6410
+ */
6411
+ placeholder?: string;
6412
+ hideLabel?: boolean;
6413
+ labelIcon?: IconType;
6414
+ hint?: string;
6415
+ error?: string | boolean;
6416
+ status?: InputFieldStatus;
6417
+ required?: boolean;
6418
+ disabled?: boolean;
6419
+ readonly?: boolean;
6420
+ loading?: boolean;
6421
+ clearable?: boolean;
6422
+ size?: PhoneInputSize;
6423
+ name?: string;
6424
+ id?: string;
6425
+ autoFocus?: boolean;
6426
+ onBlur?: (event: React.FocusEvent<HTMLElement>) => void;
6427
+ onFocus?: (event: React.FocusEvent<HTMLElement>) => void;
6428
+ }
6429
+
6430
+ /**
6431
+ * Structured phone value matching how backends store the pair:
6432
+ * a dial code plus the national number. Consumers never need to
6433
+ * split or join the two parts themselves.
6434
+ */
6435
+ export declare type F0PhoneInputValue = {
6436
+ /** Dial code including the leading `+`, e.g. `"+34"` */
6437
+ prefix: string | undefined;
6438
+ /**
6439
+ * National significant number (digits only, no trunk prefix) — or the raw
6440
+ * stored string when it cannot be parsed (legacy data is passed through
6441
+ * untouched until the user edits it).
6442
+ */
6443
+ number: string;
6444
+ };
6445
+
6224
6446
  /**
6225
6447
  * @experimental This is an experimental component, use it at your own risk.
6226
6448
  */
@@ -6500,11 +6722,28 @@ declare type F0SelectBaseProps<T extends string, R = unknown> = {
6500
6722
  fitContentWidth?: boolean;
6501
6723
  } & WithDataTestIdProps;
6502
6724
 
6725
+ /**
6726
+ * Short token rendered next to the option label, in secondary color, on a
6727
+ * single line — never wraps and never affects row height. For prose that
6728
+ * deserves its own line use `description`; for chips/badges use `tag`.
6729
+ * Can coexist with both.
6730
+ *
6731
+ * Deliberately strict: no free-form variant. Each variant carries semantics
6732
+ * the component can validate and format — add new ones (e.g. currency,
6733
+ * locale) as concrete use cases appear.
6734
+ */
6735
+ export declare type F0SelectItemMetadata = {
6736
+ type: "dialCode";
6737
+ dialCode: string;
6738
+ };
6739
+
6503
6740
  declare type F0SelectItemObject<T, R = unknown> = {
6504
6741
  type?: "item";
6505
6742
  value: T;
6506
6743
  label: string;
6507
6744
  description?: string;
6745
+ /** Short token shown next to the label (e.g. a dial code) */
6746
+ metadata?: F0SelectItemMetadata;
6508
6747
  avatar?: AvatarVariant;
6509
6748
  tag?: F0SelectTagProp;
6510
6749
  icon?: IconType;
@@ -7743,10 +7982,21 @@ declare const internalAvatarSizes: readonly ["xsmall", "small", "medium", "large
7743
7982
 
7744
7983
  declare const internalAvatarTypes: readonly ["base", "rounded"];
7745
7984
 
7985
+ export declare const isPossiblePhoneValue: (value: F0PhoneInputValue | undefined, fallbackCountry?: CountryCode) => boolean;
7986
+
7746
7987
  export declare const isSystemMessage: (item: F0ChatItem) => item is F0ChatSystemMessage;
7747
7988
 
7748
7989
  export declare const isUserMessage: (item: F0ChatItem) => item is F0ChatMessage;
7749
7990
 
7991
+ /**
7992
+ * Standalone validators for the structured pair, matching the `isValid` /
7993
+ * `isPossible` flags of the change meta: "valid" checks the country's number
7994
+ * patterns, "possible" only checks the length. For form schemas.
7995
+ * `fallbackCountry` must mirror the input's `defaultCountry` so prefix-less
7996
+ * legacy values validate exactly as the input renders them.
7997
+ */
7998
+ export declare const isValidPhoneValue: (value: F0PhoneInputValue | undefined, fallbackCountry?: CountryCode) => boolean;
7999
+
7750
8000
  export declare function Item({ item, counter, isActive, collapsible, isExpanded, onToggleExpanded, sortable, children, onDragOver, onDragLeave, onDrop, canDropInside, currentParentId, justDropped, }: TOCItemProps): JSX_2.Element;
7751
8001
 
7752
8002
  export declare type ItemActionsDefinition<T extends RecordType> = (item: T) => ActionDefinition[] | undefined;
@@ -9142,6 +9392,10 @@ declare type PersonProfile = {
9142
9392
 
9143
9393
  declare type PersonTagProps = ComponentProps<typeof F0TagPerson>;
9144
9394
 
9395
+ export declare type PhoneInputSize = (typeof phoneInputSizes)[number];
9396
+
9397
+ export declare const phoneInputSizes: readonly ["sm", "md"];
9398
+
9145
9399
  export declare const PieChart: WithDataTestIdReturnType_5<ForwardRefExoticComponent<Omit<PieChartProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLElement | SVGElement>>>;
9146
9400
 
9147
9401
  export declare const PieChartWidget: ForwardRefExoticComponent<Omit<WidgetProps_2 & {
@@ -11998,9 +12252,11 @@ declare module "@tiptap/core" {
11998
12252
 
11999
12253
  declare module "@tiptap/core" {
12000
12254
  interface Commands<ReturnType> {
12001
- fontSize: {
12002
- setFontSize: (fontSize: string) => ReturnType;
12003
- unsetFontSize: () => ReturnType;
12255
+ enhanceHighlight: {
12256
+ setEnhanceHighlight: (from: number, to: number, options?: {
12257
+ placeholder?: string;
12258
+ }) => ReturnType;
12259
+ clearEnhanceHighlight: () => ReturnType;
12004
12260
  };
12005
12261
  }
12006
12262
  }
@@ -12008,11 +12264,9 @@ declare module "@tiptap/core" {
12008
12264
 
12009
12265
  declare module "@tiptap/core" {
12010
12266
  interface Commands<ReturnType> {
12011
- enhanceHighlight: {
12012
- setEnhanceHighlight: (from: number, to: number, options?: {
12013
- placeholder?: string;
12014
- }) => ReturnType;
12015
- clearEnhanceHighlight: () => ReturnType;
12267
+ fontSize: {
12268
+ setFontSize: (fontSize: string) => ReturnType;
12269
+ unsetFontSize: () => ReturnType;
12016
12270
  };
12017
12271
  }
12018
12272
  }