@factorialco/f0-react 2.50.0 → 2.52.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/f0.d.ts CHANGED
@@ -54,6 +54,7 @@ import { F0AvatarPersonProps as F0AvatarPersonProps_2 } from './types';
54
54
  import { F0AvatarTeamProps as F0AvatarTeamProps_2 } from './F0AvatarTeam';
55
55
  import { F0DataChartProps as F0DataChartProps_2 } from './types';
56
56
  import { F0DialogInternalProps } from './internal-types';
57
+ import { F0DrawerProps } from './F0Drawer';
57
58
  import { F0DurationInputProps as F0DurationInputProps_2 } from './types';
58
59
  import { F0FormDefinition as F0FormDefinition_2 } from './f0';
59
60
  import { F0FormDefinitionPerSection as F0FormDefinitionPerSection_2 } from './f0';
@@ -1438,7 +1439,7 @@ declare type BaseFilterDefinition<T extends FilterTypeKey> = {
1438
1439
  hideSelector?: boolean;
1439
1440
  };
1440
1441
 
1441
- declare function BaseHeader({ title, avatar, deactivated, description, primaryAction, secondaryActions, otherActions, status, metadata, showBottomBorder, }: BaseHeaderProps_2): JSX_2.Element;
1442
+ declare function BaseHeader({ title, avatar, deactivated, description, primaryAction, secondaryActions, otherActions, status, metadata, metadataRowGap, showBottomBorder, }: BaseHeaderProps_2): JSX_2.Element;
1442
1443
 
1443
1444
  declare type BaseHeaderProps = ComponentProps<typeof BaseHeader>;
1444
1445
 
@@ -1463,6 +1464,7 @@ declare interface BaseHeaderProps_2 {
1463
1464
  actions?: MetadataAction[];
1464
1465
  };
1465
1466
  metadata?: MetadataProps["items"];
1467
+ metadataRowGap?: MetadataProps["rowGap"];
1466
1468
  /** Renders a 1px bottom border at the very bottom of the header. */
1467
1469
  showBottomBorder?: boolean;
1468
1470
  }
@@ -5031,6 +5033,38 @@ declare type DetailsItemContent = (ComponentProps<typeof DataList.Item> & {
5031
5033
  type: "file";
5032
5034
  });
5033
5035
 
5036
+ declare type DialogAlikeAction = {
5037
+ value?: string;
5038
+ label: string;
5039
+ icon?: IconType;
5040
+ onClick: () => void | Promise<void>;
5041
+ disabled?: boolean;
5042
+ loading?: boolean;
5043
+ closeOnClick?: boolean;
5044
+ };
5045
+
5046
+ declare type DialogAlikeActionsProps = {
5047
+ primaryAction?: DialogAlikeAction | DialogAlikeAction[];
5048
+ secondaryAction?: DialogAlikeAction | DialogAlikeAction[];
5049
+ };
5050
+
5051
+ declare type DialogAlikePosition = (typeof dialogAlikePositions)[number];
5052
+
5053
+ declare const dialogAlikePositions: readonly ["center", "left", "right", "fullscreen"];
5054
+
5055
+ export declare type DialogControls = {
5056
+ kind: "resource";
5057
+ expand?: {
5058
+ label: string;
5059
+ onClick: () => void;
5060
+ };
5061
+ navigation?: NavigationProps;
5062
+ } | {
5063
+ kind: "back";
5064
+ label: string;
5065
+ onClick: () => void;
5066
+ };
5067
+
5034
5068
  export declare type DialogPosition = (typeof dialogPositions)[number];
5035
5069
 
5036
5070
  declare const dialogPositions: readonly ["center", "left", "right", "fullscreen"];
@@ -5039,6 +5073,31 @@ export declare type DialogWidth = (typeof dialogWidths)[number];
5039
5073
 
5040
5074
  declare const dialogWidths: readonly ["sm", "md", "lg", "xl"];
5041
5075
 
5076
+ declare type DialogWrapperContextType = {
5077
+ open: boolean;
5078
+ onClose: () => void;
5079
+ shownBottomSheet: boolean;
5080
+ position: DialogAlikePosition;
5081
+ /**
5082
+ * The dialog's content container element.
5083
+ * Use this as the `portalContainer` prop for components like F0Select
5084
+ * to ensure dropdowns render inside the dialog.
5085
+ */
5086
+ portalContainer: HTMLDivElement | null;
5087
+ };
5088
+
5089
+ /**
5090
+ * The props for the F0DialogProvider component.
5091
+ */
5092
+ declare type DialogWrapperProviderProps = {
5093
+ isOpen: boolean;
5094
+ onClose: () => void;
5095
+ shownBottomSheet?: boolean;
5096
+ position: DialogAlikePosition;
5097
+ children: ReactNode;
5098
+ portalContainer: HTMLDivElement | null;
5099
+ };
5100
+
5042
5101
  /** Display modes */
5043
5102
  export declare type DisplayToken = "block" | "flex" | "inline" | "inline-flex" | "grid" | "none";
5044
5103
 
@@ -5089,6 +5148,8 @@ export declare type DragPayload<T = unknown> = {
5089
5148
  data?: T;
5090
5149
  };
5091
5150
 
5151
+ declare const drawerPositions: readonly ["left", "right"];
5152
+
5092
5153
  declare type DropdownItem = DropdownItemObject | DropdownItemSeparator | DropdownItemLabel;
5093
5154
 
5094
5155
  declare type DropdownItemLabel = {
@@ -7814,6 +7875,10 @@ export declare type F0DialogActionsProps = {
7814
7875
  secondaryAction?: F0DialogSecondaryAction | F0DialogSecondaryActionItem[];
7815
7876
  };
7816
7877
 
7878
+ export declare const F0DialogAlikeContext: Context<DialogWrapperContextType>;
7879
+
7880
+ export declare const F0DialogAlikeProvider: ({ isOpen, onClose, shownBottomSheet, position, children, portalContainer, }: DialogWrapperProviderProps) => JSX_2.Element;
7881
+
7817
7882
  export declare const F0DialogContext: Context<F0DialogContextType>;
7818
7883
 
7819
7884
  declare type F0DialogContextType = {
@@ -7862,6 +7927,20 @@ export declare type F0DialogSecondaryAction = {
7862
7927
 
7863
7928
  export declare type F0DialogSecondaryActionItem = F0DialogActionItem;
7864
7929
 
7930
+ /**
7931
+ * @experimental This is an experimental component use it at your own risk
7932
+ */
7933
+ export declare const F0Drawer: {
7934
+ (props: F0DrawerProps): JSX_2.Element;
7935
+ displayName: string;
7936
+ };
7937
+
7938
+ export declare type F0DrawerAction = DialogAlikeAction;
7939
+
7940
+ export declare type F0DrawerActionsProps = DialogAlikeActionsProps;
7941
+
7942
+ export declare type F0DrawerPosition = (typeof drawerPositions)[number];
7943
+
7865
7944
  export declare type F0DropdownButtonProps<T = string> = {
7866
7945
  size?: ButtonDropdownSize;
7867
7946
  items: ButtonDropdownItem<T>[] | ButtonDropdownGroup<T>[] | ButtonDropdownGroup<T>;
@@ -11927,8 +12006,11 @@ declare interface MetadataProps {
11927
12006
  * If true and the metadata type is a list, it will be collapsed to the first item
11928
12007
  */
11929
12008
  collapse?: boolean;
12009
+ rowGap?: MetadataRowGap;
11930
12010
  }
11931
12011
 
12012
+ declare type MetadataRowGap = "none" | "xs" | "sm" | "md";
12013
+
11932
12014
  export declare interface MetricComputation {
11933
12015
  datasetId: string;
11934
12016
  aggregation: AggregationType;
@@ -12081,6 +12163,21 @@ declare type NavigationItem = Pick<LinkProps, "href" | "exactMatch" | "onClick">
12081
12163
  label: string;
12082
12164
  } & DataAttributes_2;
12083
12165
 
12166
+ declare type NavigationProps = {
12167
+ previous?: {
12168
+ url: string;
12169
+ title: string;
12170
+ };
12171
+ next?: {
12172
+ url: string;
12173
+ title: string;
12174
+ };
12175
+ counter?: {
12176
+ current: number;
12177
+ total: number;
12178
+ };
12179
+ };
12180
+
12084
12181
  declare type NavTarget = HTMLAttributeAnchorTarget;
12085
12182
 
12086
12183
  /**
@@ -13207,7 +13304,7 @@ declare type Props_3 = {
13207
13304
  list?: TagCounterItem[];
13208
13305
  };
13209
13306
 
13210
- declare type Props_4 = {} & Pick<BaseHeaderProps, "avatar" | "title" | "description" | "primaryAction" | "secondaryActions" | "otherActions" | "metadata" | "status" | "deactivated" | "showBottomBorder">;
13307
+ declare type Props_4 = {} & Pick<BaseHeaderProps, "avatar" | "title" | "description" | "primaryAction" | "secondaryActions" | "otherActions" | "metadata" | "status" | "deactivated" | "metadataRowGap" | "showBottomBorder">;
13211
13308
 
13212
13309
  declare type Pulse = (typeof pulses)[number];
13213
13310
 
@@ -15217,6 +15314,8 @@ export declare function useF0AiFormRegistry(): F0AiFormRegistryContextValue | nu
15217
15314
 
15218
15315
  export declare const useF0Dialog: () => F0DialogContextType;
15219
15316
 
15317
+ export declare const useF0DialogAlikeContext: () => DialogWrapperContextType;
15318
+
15220
15319
  /**
15221
15320
  * Hook to control F0Form programmatically.
15222
15321
  *
@@ -15898,9 +15997,8 @@ declare module "@tiptap/core" {
15898
15997
 
15899
15998
  declare module "@tiptap/core" {
15900
15999
  interface Commands<ReturnType> {
15901
- enhanceHighlight: {
15902
- setEnhanceHighlight: (from: number, to: number) => ReturnType;
15903
- clearEnhanceHighlight: () => ReturnType;
16000
+ moodTracker: {
16001
+ insertMoodTracker: (data: MoodTrackerData) => ReturnType;
15904
16002
  };
15905
16003
  }
15906
16004
  }
@@ -15908,8 +16006,9 @@ declare module "@tiptap/core" {
15908
16006
 
15909
16007
  declare module "@tiptap/core" {
15910
16008
  interface Commands<ReturnType> {
15911
- moodTracker: {
15912
- insertMoodTracker: (data: MoodTrackerData) => ReturnType;
16009
+ enhanceHighlight: {
16010
+ setEnhanceHighlight: (from: number, to: number) => ReturnType;
16011
+ clearEnhanceHighlight: () => ReturnType;
15913
16012
  };
15914
16013
  }
15915
16014
  }