@frigade/react 2.7.0 → 2.7.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/index.d.ts CHANGED
@@ -1344,6 +1344,26 @@ declare function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }?: St
1344
1344
  interface BoxPropsWithoutChildren extends Omit<BoxProps, 'children'> {
1345
1345
  }
1346
1346
  interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1347
+ /**
1348
+ * Whether to automatically mark the Flow started (i.e. in progress) when the Flow is eligible to be shown.
1349
+ * You will need to call `flow.start()` or `step.start()` from the parent component if you set this to `false`. Most components should not need to override this behavior.
1350
+ *
1351
+ * Defaults to `true`.
1352
+ */
1353
+ autoStart?: boolean;
1354
+ /**
1355
+ * Optional component to wrap the child components in, e.g. `as={Dialog}` will render the Flow in a modal Dialog. Defaults to `Box`.
1356
+ */
1357
+ as?: React$1.ElementType;
1358
+ /**
1359
+ * Emotion CSS prop to apply to the component. See [Theming documentation](https://docs.frigade.com/v2/sdk/styling/css-overrides) for more information.
1360
+ *
1361
+ * Example usage:
1362
+ * ```
1363
+ * <Frigade.Checklist css={{ backgroundColor: "pink", ".fr-button-primary": { backgroundColor: "fuchsia" } }} />
1364
+ * ```
1365
+ */
1366
+ css?: React$1.Attributes['css'];
1347
1367
  /**
1348
1368
  * Whether the Flow is dismissible or not
1349
1369
  *
@@ -1385,19 +1405,6 @@ interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1385
1405
  * For instance, you can use `title: Hello, ${name}!` in the Flow configuration and pass `variables={{name: 'John'}}` to customize the copy.
1386
1406
  */
1387
1407
  variables?: Record<string, unknown>;
1388
- /**
1389
- * Optional component to wrap the child components in, e.g. `as={Dialog}` will render the Flow in a modal Dialog. Defaults to `Box`.
1390
- */
1391
- as?: React$1.ElementType;
1392
- /**
1393
- * Emotion CSS prop to apply to the component. See [Theming documentation](https://docs.frigade.com/v2/sdk/styling/css-overrides) for more information.
1394
- *
1395
- * Example usage:
1396
- * ```
1397
- * <Frigade.Checklist css={{ backgroundColor: "pink", ".fr-button-primary": { backgroundColor: "fuchsia" } }} />
1398
- * ```
1399
- */
1400
- css?: React$1.Attributes['css'];
1401
1408
  }
1402
1409
  interface FlowProps extends FlowPropsWithoutChildren {
1403
1410
  /**
@@ -1445,7 +1452,7 @@ declare namespace Dialog {
1445
1452
  var displayName: string;
1446
1453
  }
1447
1454
 
1448
- declare function Flow({ as, children, flowId, onComplete, onDismiss, onPrimary, onSecondary, variables, ...props }: FlowProps): _emotion_react_jsx_runtime.JSX.Element;
1455
+ declare function Flow({ as, autoStart, children, flowId, onComplete, onDismiss, onPrimary, onSecondary, variables, ...props }: FlowProps): _emotion_react_jsx_runtime.JSX.Element;
1449
1456
 
1450
1457
  interface AnnouncementProps extends FlowPropsWithoutChildren, DialogProps {
1451
1458
  /**
@@ -1679,14 +1686,16 @@ interface HintProps extends BoxProps {
1679
1686
  autoScroll?: ScrollIntoViewOptions | boolean;
1680
1687
  children?: React.ReactNode;
1681
1688
  defaultOpen?: boolean;
1689
+ lockScroll?: boolean;
1682
1690
  modal?: boolean;
1691
+ onMount?: () => void;
1683
1692
  onOpenChange?: (open: boolean) => void;
1684
1693
  open?: boolean;
1685
1694
  side?: SideValue;
1686
1695
  sideOffset?: number;
1687
1696
  spotlight?: boolean;
1688
1697
  }
1689
- declare function Hint({ align, alignOffset, anchor, autoScroll, children, css, defaultOpen, modal, onOpenChange, open, part, side, sideOffset, spotlight, style, ...props }: HintProps): _emotion_react_jsx_runtime.JSX.Element;
1698
+ declare function Hint({ align, alignOffset, anchor, autoScroll, children, css, defaultOpen, lockScroll, modal, onMount, onOpenChange, open, part, side, sideOffset, spotlight, style, ...props }: HintProps): _emotion_react_jsx_runtime.JSX.Element;
1690
1699
 
1691
1700
  declare function SelectField(props: FormFieldProps): _emotion_react_jsx_runtime.JSX.Element;
1692
1701
 
@@ -1712,6 +1721,29 @@ interface BaseFieldProps extends FormFieldProps {
1712
1721
  }
1713
1722
  declare function BaseField({ children, field, fieldData, fieldState }: BaseFieldProps): _emotion_react_jsx_runtime.JSX.Element;
1714
1723
 
1724
+ type NPSOptions = {
1725
+ label: string;
1726
+ value: string;
1727
+ }[];
1728
+ interface NPSProps extends FormProps {
1729
+ /**
1730
+ * The options to display in the NPS field.
1731
+ * If not provided, the default NPS numbers from 0 to 10 will be used.
1732
+ */
1733
+ options?: NPSOptions;
1734
+ /**
1735
+ * The label to display for the positive end of the NPS scale.
1736
+ * If not provided, the default label "Extremely likely" will be used.
1737
+ */
1738
+ positiveLabel?: string;
1739
+ /**
1740
+ * The label to display for the negative end of the NPS scale.
1741
+ * If not provided, the default label "Not likely at all" will be used.
1742
+ */
1743
+ negativeLabel?: string;
1744
+ }
1745
+ declare function NPS({ as, flowId, fieldTypes, part, options, positiveLabel, negativeLabel, ...props }: NPSProps): _emotion_react_jsx_runtime.JSX.Element;
1746
+
1715
1747
  interface ProgressProps extends BoxProps {
1716
1748
  current: number;
1717
1749
  total: number;
@@ -1834,40 +1866,21 @@ interface ProviderProps {
1834
1866
  declare function Provider({ children, css, defaultCollection, navigate, theme, ...props }: ProviderProps): _emotion_react_jsx_runtime.JSX.Element;
1835
1867
 
1836
1868
  interface OverlayProps extends BoxProps {
1869
+ lockScroll?: boolean;
1837
1870
  }
1838
1871
 
1839
1872
  interface SpotlightProps extends OverlayProps {
1840
1873
  anchor: string;
1874
+ lockScroll?: boolean;
1841
1875
  }
1842
- declare function Spotlight({ anchor, part, style, ...props }: SpotlightProps): _emotion_react_jsx_runtime.JSX.Element;
1843
-
1844
- type NPSOptions = {
1845
- label: string;
1846
- value: string;
1847
- }[];
1848
- interface NPSProps extends FormProps {
1849
- /**
1850
- * The options to display in the NPS field.
1851
- * If not provided, the default NPS numbers from 0 to 10 will be used.
1852
- */
1853
- options?: NPSOptions;
1854
- /**
1855
- * The label to display for the positive end of the NPS scale.
1856
- * If not provided, the default label "Extremely likely" will be used.
1857
- */
1858
- positiveLabel?: string;
1859
- /**
1860
- * The label to display for the negative end of the NPS scale.
1861
- * If not provided, the default label "Not likely at all" will be used.
1862
- */
1863
- negativeLabel?: string;
1864
- }
1865
- declare function NPS({ as, flowId, fieldTypes, part, options, positiveLabel, negativeLabel, ...props }: NPSProps): _emotion_react_jsx_runtime.JSX.Element;
1876
+ declare function Spotlight({ anchor, lockScroll, part, style, ...props }: SpotlightProps): _emotion_react_jsx_runtime.JSX.Element;
1866
1877
 
1867
1878
  declare const index_NPS: typeof NPS;
1879
+ type index_NPSProps = NPSProps;
1868
1880
  declare namespace index {
1869
1881
  export {
1870
1882
  index_NPS as NPS,
1883
+ index_NPSProps as NPSProps,
1871
1884
  };
1872
1885
  }
1873
1886
 
@@ -1934,6 +1947,11 @@ interface TourProps extends FlowPropsWithoutChildren, Omit<HintProps, 'anchor'>
1934
1947
  * Whether the tooltip should be open by default.
1935
1948
  */
1936
1949
  defaultOpen?: boolean;
1950
+ /**
1951
+ * Whether to lock the scroll of the container when the Spotlight is enabled.
1952
+ * Defaults to `true`.
1953
+ */
1954
+ lockScroll?: boolean;
1937
1955
  /**
1938
1956
  * Whether to render a modal overlay behind the tooltip.
1939
1957
  */
@@ -2002,4 +2020,4 @@ declare function useGroup(): {
2002
2020
  isLoading: boolean;
2003
2021
  };
2004
2022
 
2005
- export { Announcement, AnnouncementProps, Banner, BannerProps, BaseField, Box, BoxProps, Button, ButtonProps, Card, CardHeaderProps, CardProps, index$2 as Checklist, CollapsibleProps, CollapsibleStepProps, Collection, Dialog, DialogProps, DismissHandler, FieldTypes, Flex, Flow, FlowChildrenProps, FlowConfig, FlowHandlerProp, FlowHandlerProps, FlowProps, FlowPropsWithoutChildren, Form, FormFieldData, FormFieldProps, FormProps, Hint, Image, Label, Media, index$1 as Progress, ProgressBadge, ProgressBadgeProps, Provider, ProviderProps, RadioField, SelectField, Spotlight, StepHandler, StepHandlerProp, StepHandlerProps, index as Survey, Text, TextField, TextProps, TextareaField, Theme, Tokens, Tooltip, TooltipProps, Tour, TourProps, Video, themeVariables, tokens, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useStepHandlers, useUser };
2023
+ export { Announcement, AnnouncementProps, Banner, BannerProps, BaseField, Box, BoxProps, Button, ButtonProps, Card, CardHeaderProps, CardProps, index$2 as Checklist, CollapsibleProps, CollapsibleStepProps, Collection, Dialog, DialogProps, DismissHandler, FieldTypes, Flex, Flow, FlowChildrenProps, FlowConfig, FlowHandlerProp, FlowHandlerProps, FlowProps, FlowPropsWithoutChildren, Form, FormFieldData, FormFieldProps, FormProps, Hint, Image, Label, Media, NPSProps, index$1 as Progress, ProgressBadge, ProgressBadgeProps, Provider, ProviderProps, RadioField, SelectField, Spotlight, StepHandler, StepHandlerProp, StepHandlerProps, index as Survey, Text, TextField, TextProps, TextareaField, Theme, Tokens, Tooltip, TooltipProps, Tour, TourProps, Video, themeVariables, tokens, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useStepHandlers, useUser };