@frigade/react 2.1.19 → 2.1.21

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/index.d.ts CHANGED
@@ -7,7 +7,7 @@ import { Flow as Flow$1, FlowStep, PropertyPayload, StatefulFlow } from '@frigad
7
7
  export { _frigade_js as FrigadeJS };
8
8
  import { EmotionJSX } from '@emotion/react/types/jsx-namespace';
9
9
  import * as Collapsible$1 from '@radix-ui/react-collapsible';
10
- import { ControllerFieldState, Message, ValidationRule } from 'react-hook-form';
10
+ import { UseFormReturn, ControllerFieldState, Message, ValidationRule } from 'react-hook-form';
11
11
  import * as Popover from '@radix-ui/react-popover';
12
12
 
13
13
  type DeepPartial<T> = {
@@ -209,11 +209,7 @@ declare const tokens: {
209
209
  black: string;
210
210
  white: string;
211
211
  };
212
- borders: {
213
- md: string;
214
- };
215
212
  borderWidths: {
216
- 0: string;
217
213
  md: string;
218
214
  };
219
215
  };
@@ -397,11 +393,7 @@ declare const theme: DeepPartial<{
397
393
  black: string;
398
394
  white: string;
399
395
  };
400
- borders: {
401
- md: string;
402
- };
403
396
  borderWidths: {
404
- 0: string;
405
397
  md: string;
406
398
  };
407
399
  }>;
@@ -415,16 +407,206 @@ declare const themedStyleProps: {
415
407
  readonly color: Record<ColorName, string>;
416
408
  readonly backgroundColor: Record<ColorName, string>;
417
409
  readonly borderColor: Record<ColorName, string>;
418
- readonly border: DeepPartial<{
419
- md: string;
420
- }>;
410
+ readonly border: {
411
+ readonly inherit: string;
412
+ readonly white: string;
413
+ readonly black: string;
414
+ readonly gray100: string;
415
+ readonly gray200: string;
416
+ readonly gray300: string;
417
+ readonly gray400: string;
418
+ readonly gray500: string;
419
+ readonly gray600: string;
420
+ readonly gray700: string;
421
+ readonly gray800: string;
422
+ readonly gray900: string;
423
+ readonly blue400: string;
424
+ readonly blue500: string;
425
+ readonly blue800: string;
426
+ readonly blue900: string;
427
+ readonly green400: string;
428
+ readonly green500: string;
429
+ readonly green800: string;
430
+ readonly red500: string;
431
+ readonly transparent: string;
432
+ readonly "blue.100": string;
433
+ readonly "blue.200": string;
434
+ readonly "blue.300": string;
435
+ readonly "blue.400": string;
436
+ readonly "blue.500": string;
437
+ readonly "blue.600": string;
438
+ readonly "blue.700": string;
439
+ readonly "blue.800": string;
440
+ readonly "blue.900": string;
441
+ readonly "gray.100": string;
442
+ readonly "gray.200": string;
443
+ readonly "gray.300": string;
444
+ readonly "gray.400": string;
445
+ readonly "gray.500": string;
446
+ readonly "gray.600": string;
447
+ readonly "gray.700": string;
448
+ readonly "gray.800": string;
449
+ readonly "gray.900": string;
450
+ readonly "green.100": string;
451
+ readonly "green.200": string;
452
+ readonly "green.300": string;
453
+ readonly "green.400": string;
454
+ readonly "green.500": string;
455
+ readonly "green.600": string;
456
+ readonly "green.700": string;
457
+ readonly "green.800": string;
458
+ readonly "green.900": string;
459
+ readonly "red.100": string;
460
+ readonly "red.200": string;
461
+ readonly "red.300": string;
462
+ readonly "red.400": string;
463
+ readonly "red.500": string;
464
+ readonly "red.600": string;
465
+ readonly "red.700": string;
466
+ readonly "red.800": string;
467
+ readonly "red.900": string;
468
+ readonly "yellow.100": string;
469
+ readonly "yellow.200": string;
470
+ readonly "yellow.300": string;
471
+ readonly "yellow.400": string;
472
+ readonly "yellow.500": string;
473
+ readonly "yellow.600": string;
474
+ readonly "yellow.700": string;
475
+ readonly "yellow.800": string;
476
+ readonly "yellow.900": string;
477
+ readonly "negative.100": string;
478
+ readonly "negative.200": string;
479
+ readonly "negative.300": string;
480
+ readonly "negative.400": string;
481
+ readonly "negative.500": string;
482
+ readonly "negative.600": string;
483
+ readonly "negative.700": string;
484
+ readonly "negative.800": string;
485
+ readonly "negative.900": string;
486
+ readonly "negative.background": string;
487
+ readonly "negative.border": string;
488
+ readonly "negative.foreground": string;
489
+ readonly "negative.surface": string;
490
+ readonly "negative.active.background": string;
491
+ readonly "negative.active.border": string;
492
+ readonly "negative.active.foreground": string;
493
+ readonly "negative.active.surface": string;
494
+ readonly "negative.focus.background": string;
495
+ readonly "negative.focus.border": string;
496
+ readonly "negative.focus.foreground": string;
497
+ readonly "negative.focus.surface": string;
498
+ readonly "negative.hover.background": string;
499
+ readonly "negative.hover.border": string;
500
+ readonly "negative.hover.foreground": string;
501
+ readonly "negative.hover.surface": string;
502
+ readonly "neutral.100": string;
503
+ readonly "neutral.200": string;
504
+ readonly "neutral.300": string;
505
+ readonly "neutral.400": string;
506
+ readonly "neutral.500": string;
507
+ readonly "neutral.600": string;
508
+ readonly "neutral.700": string;
509
+ readonly "neutral.800": string;
510
+ readonly "neutral.900": string;
511
+ readonly "neutral.background": string;
512
+ readonly "neutral.border": string;
513
+ readonly "neutral.foreground": string;
514
+ readonly "neutral.surface": string;
515
+ readonly "neutral.active.background": string;
516
+ readonly "neutral.active.border": string;
517
+ readonly "neutral.active.foreground": string;
518
+ readonly "neutral.active.surface": string;
519
+ readonly "neutral.focus.background": string;
520
+ readonly "neutral.focus.border": string;
521
+ readonly "neutral.focus.foreground": string;
522
+ readonly "neutral.focus.surface": string;
523
+ readonly "neutral.hover.background": string;
524
+ readonly "neutral.hover.border": string;
525
+ readonly "neutral.hover.foreground": string;
526
+ readonly "neutral.hover.surface": string;
527
+ readonly "positive.100": string;
528
+ readonly "positive.200": string;
529
+ readonly "positive.300": string;
530
+ readonly "positive.400": string;
531
+ readonly "positive.500": string;
532
+ readonly "positive.600": string;
533
+ readonly "positive.700": string;
534
+ readonly "positive.800": string;
535
+ readonly "positive.900": string;
536
+ readonly "positive.background": string;
537
+ readonly "positive.border": string;
538
+ readonly "positive.foreground": string;
539
+ readonly "positive.surface": string;
540
+ readonly "positive.active.background": string;
541
+ readonly "positive.active.border": string;
542
+ readonly "positive.active.foreground": string;
543
+ readonly "positive.active.surface": string;
544
+ readonly "positive.focus.background": string;
545
+ readonly "positive.focus.border": string;
546
+ readonly "positive.focus.foreground": string;
547
+ readonly "positive.focus.surface": string;
548
+ readonly "positive.hover.background": string;
549
+ readonly "positive.hover.border": string;
550
+ readonly "positive.hover.foreground": string;
551
+ readonly "positive.hover.surface": string;
552
+ readonly "primary.100": string;
553
+ readonly "primary.200": string;
554
+ readonly "primary.300": string;
555
+ readonly "primary.400": string;
556
+ readonly "primary.500": string;
557
+ readonly "primary.600": string;
558
+ readonly "primary.700": string;
559
+ readonly "primary.800": string;
560
+ readonly "primary.900": string;
561
+ readonly "primary.background": string;
562
+ readonly "primary.border": string;
563
+ readonly "primary.foreground": string;
564
+ readonly "primary.surface": string;
565
+ readonly "primary.active.background": string;
566
+ readonly "primary.active.border": string;
567
+ readonly "primary.active.foreground": string;
568
+ readonly "primary.active.surface": string;
569
+ readonly "primary.focus.background": string;
570
+ readonly "primary.focus.border": string;
571
+ readonly "primary.focus.foreground": string;
572
+ readonly "primary.focus.surface": string;
573
+ readonly "primary.hover.background": string;
574
+ readonly "primary.hover.border": string;
575
+ readonly "primary.hover.foreground": string;
576
+ readonly "primary.hover.surface": string;
577
+ readonly "secondary.100": string;
578
+ readonly "secondary.200": string;
579
+ readonly "secondary.300": string;
580
+ readonly "secondary.400": string;
581
+ readonly "secondary.500": string;
582
+ readonly "secondary.600": string;
583
+ readonly "secondary.700": string;
584
+ readonly "secondary.800": string;
585
+ readonly "secondary.900": string;
586
+ readonly "secondary.background": string;
587
+ readonly "secondary.border": string;
588
+ readonly "secondary.foreground": string;
589
+ readonly "secondary.surface": string;
590
+ readonly "secondary.active.background": string;
591
+ readonly "secondary.active.border": string;
592
+ readonly "secondary.active.foreground": string;
593
+ readonly "secondary.active.surface": string;
594
+ readonly "secondary.focus.background": string;
595
+ readonly "secondary.focus.border": string;
596
+ readonly "secondary.focus.foreground": string;
597
+ readonly "secondary.focus.surface": string;
598
+ readonly "secondary.hover.background": string;
599
+ readonly "secondary.hover.border": string;
600
+ readonly "secondary.hover.foreground": string;
601
+ readonly "secondary.hover.surface": string;
602
+ readonly md?: string;
603
+ };
421
604
  readonly borderRadius: DeepPartial<{
422
605
  md: string;
423
606
  lg: string;
424
607
  round: string;
425
608
  }>;
426
609
  readonly borderWidth: DeepPartial<{
427
- 0: string;
428
610
  md: string;
429
611
  }>;
430
612
  readonly boxShadow: DeepPartial<{
@@ -1035,6 +1217,7 @@ type ButtonVariant = 'Primary' | 'Secondary' | 'Link' | 'Plain';
1035
1217
  interface ButtonProps extends BoxProps {
1036
1218
  title?: string;
1037
1219
  variant?: ButtonVariant;
1220
+ loading?: boolean;
1038
1221
  }
1039
1222
  declare function Primary({ children, ...props }: ButtonProps): _emotion_react_jsx_runtime.JSX.Element;
1040
1223
  declare function Secondary({ children, ...props }: ButtonProps): _emotion_react_jsx_runtime.JSX.Element;
@@ -1188,6 +1371,11 @@ interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1188
1371
  * For instance, you can use `title: Hello, ${name}!` in the Flow configuration and pass `variables={{name: 'John'}}` to customize the copy.
1189
1372
  */
1190
1373
  variables?: Record<string, unknown>;
1374
+ /**
1375
+ * Optional component type to wrap the child components in. Use the`as={Box}` component for inline placement or the `as={Dialog}` component for modal placement.
1376
+ * If you want to wrap the Flow in a custom component (such as your own modal), you can pass the custom component here.
1377
+ */
1378
+ as?: React$1.ElementType;
1191
1379
  }
1192
1380
  interface FlowProps extends FlowPropsWithoutChildren {
1193
1381
  /**
@@ -1251,11 +1439,11 @@ interface AnnouncementProps extends FlowPropsWithoutChildren, DialogProps {
1251
1439
  */
1252
1440
  defaultOpen?: boolean;
1253
1441
  }
1254
- declare function Announcement({ flowId, ...props }: AnnouncementProps): _emotion_react_jsx_runtime.JSX.Element;
1442
+ declare function Announcement({ flowId, part, ...props }: AnnouncementProps): _emotion_react_jsx_runtime.JSX.Element;
1255
1443
 
1256
1444
  interface BannerProps extends FlowPropsWithoutChildren {
1257
1445
  }
1258
- declare function Banner({ dismissible, flowId, ...props }: BannerProps): _emotion_react_jsx_runtime.JSX.Element;
1446
+ declare function Banner({ dismissible, flowId, part, ...props }: BannerProps): _emotion_react_jsx_runtime.JSX.Element;
1259
1447
 
1260
1448
  interface CardHeaderProps extends BoxProps {
1261
1449
  dismissible?: boolean;
@@ -1299,7 +1487,7 @@ interface CollapsibleProps extends FlowPropsWithoutChildren {
1299
1487
  */
1300
1488
  stepTypes?: StepTypes;
1301
1489
  }
1302
- declare function Collapsible({ dismissible, flowId, onPrimary, onSecondary, stepTypes, ...props }: CollapsibleProps): EmotionJSX.Element;
1490
+ declare function Collapsible({ dismissible, flowId, onPrimary, onSecondary, part, stepTypes, ...props }: CollapsibleProps): EmotionJSX.Element;
1303
1491
 
1304
1492
  declare function Content({ children }: {
1305
1493
  children: any;
@@ -1368,7 +1556,7 @@ interface FormFieldData extends ValidationRules {
1368
1556
  interface FormFieldProps {
1369
1557
  field: any;
1370
1558
  fieldData: FormFieldData;
1371
- formState: any;
1559
+ formContext: UseFormReturn;
1372
1560
  fieldState: ControllerFieldState;
1373
1561
  /**
1374
1562
  * Function for submitting the current step of the form.
@@ -1383,7 +1571,24 @@ interface FormProps extends FlowPropsWithoutChildren {
1383
1571
  */
1384
1572
  fieldTypes?: FieldTypes;
1385
1573
  }
1386
- declare function Form({ fieldTypes, flowId, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
1574
+ declare function Form({ fieldTypes, flowId, part, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
1575
+
1576
+ declare function SelectField(props: FormFieldProps): _emotion_react_jsx_runtime.JSX.Element;
1577
+
1578
+ declare function TextField(props: FormFieldProps): _emotion_react_jsx_runtime.JSX.Element;
1579
+
1580
+ declare function RadioField(props: FormFieldProps): _emotion_react_jsx_runtime.JSX.Element;
1581
+
1582
+ declare function Label({ children, id, required }: {
1583
+ children: any;
1584
+ id: any;
1585
+ required?: boolean;
1586
+ }): _emotion_react_jsx_runtime.JSX.Element;
1587
+
1588
+ interface BaseFieldProps extends FormFieldProps {
1589
+ children: (fieldProps?: any) => React.ReactNode;
1590
+ }
1591
+ declare function BaseField({ children, field, fieldData, fieldState }: BaseFieldProps): _emotion_react_jsx_runtime.JSX.Element;
1387
1592
 
1388
1593
  interface ProgressProps extends BoxProps {
1389
1594
  current: number;
@@ -1420,6 +1625,15 @@ interface ProviderProps {
1420
1625
  */
1421
1626
  apiUrl?: string;
1422
1627
  children?: React.ReactNode;
1628
+ /**
1629
+ * Global CSS properties to attach to the :root element.
1630
+ * @see https://emotion.sh/docs/css-prop#object-styles
1631
+ */
1632
+ css?: Record<string, unknown>;
1633
+ /**
1634
+ * The group ID to use for this context (optional).
1635
+ */
1636
+ groupId?: string;
1423
1637
  /**
1424
1638
  * A function to handle navigation. By default, Frigade will use `window.open` if not provided.
1425
1639
  * https://docs.frigade.com/v2/sdk/navigation
@@ -1433,10 +1647,6 @@ interface ProviderProps {
1433
1647
  * The user ID of the user who is interacting with Frigade. If not provided, Frigade will generate a random guest ID and persist it in local storage.
1434
1648
  */
1435
1649
  userId?: string;
1436
- /**
1437
- * The group ID to use for this context (optional).
1438
- */
1439
- groupId?: string;
1440
1650
  /**
1441
1651
  * @ignore Internal use only.
1442
1652
  * If enabled, Frigade will not send any data to the API. A user's state will be reset on page refresh.
@@ -1448,9 +1658,9 @@ interface ProviderProps {
1448
1658
  */
1449
1659
  __flowStateOverrides?: Record<string, StatefulFlow>;
1450
1660
  }
1451
- declare function Provider({ children, navigate, theme, ...props }: ProviderProps): _emotion_react_jsx_runtime.JSX.Element;
1661
+ declare function Provider({ children, css, navigate, theme, ...props }: ProviderProps): _emotion_react_jsx_runtime.JSX.Element;
1452
1662
 
1453
- declare function NPS({ as, flowId, fieldTypes, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
1663
+ declare function NPS({ as, flowId, fieldTypes, part, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
1454
1664
 
1455
1665
  declare const index_NPS: typeof NPS;
1456
1666
  declare namespace index {
@@ -1506,7 +1716,7 @@ interface TourProps extends TooltipProps, FlowPropsWithoutChildren {
1506
1716
  */
1507
1717
  modal?: boolean;
1508
1718
  }
1509
- declare function Tour({ flowId, onComplete, variables, ...props }: TourProps): _emotion_react_jsx_runtime.JSX.Element;
1719
+ declare function Tour({ flowId, onComplete, variables, part, ...props }: TourProps): _emotion_react_jsx_runtime.JSX.Element;
1510
1720
 
1511
1721
  declare function useBoundingClientRect(): {
1512
1722
  node: any;
@@ -1544,4 +1754,4 @@ declare function useGroup(): {
1544
1754
  track: (eventName: string, properties?: Record<string, unknown>) => Promise<void>;
1545
1755
  };
1546
1756
 
1547
- export { Announcement, AnnouncementProps, Banner, BannerProps, Box, BoxProps, Button, ButtonProps, Card, CardHeaderProps, CardProps, index$2 as Checklist, CollapsibleProps, CollapsibleStepProps, Dialog, DialogProps, DismissHandler, Flex, Flow, FlowChildrenProps, FlowConfig, FlowHandlerProp, FlowHandlerProps, FlowProps, FlowPropsWithoutChildren, Form, index$1 as Progress, Provider, ProviderProps, StepHandler, StepHandlerProp, StepHandlerProps, index as Survey, Text, TextProps, Theme, Tokens, Tooltip, TooltipProps, Tour, TourProps, themeVariables, tokens, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useModal, useStepHandlers, useUser };
1757
+ export { Announcement, AnnouncementProps, Banner, BannerProps, BaseField, Box, BoxProps, Button, ButtonProps, Card, CardHeaderProps, CardProps, index$2 as Checklist, CollapsibleProps, CollapsibleStepProps, Dialog, DialogProps, DismissHandler, FieldTypes, Flex, Flow, FlowChildrenProps, FlowConfig, FlowHandlerProp, FlowHandlerProps, FlowProps, FlowPropsWithoutChildren, Form, FormFieldData, FormFieldProps, FormProps, Label, index$1 as Progress, Provider, ProviderProps, RadioField, SelectField, StepHandler, StepHandlerProp, StepHandlerProps, index as Survey, Text, TextField, TextProps, Theme, Tokens, Tooltip, TooltipProps, Tour, TourProps, themeVariables, tokens, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useModal, useStepHandlers, useUser };