@factorialco/f0-react 2.44.0 → 2.46.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
@@ -2045,6 +2045,22 @@ declare type CardAvatarVariant = AvatarVariant | {
2045
2045
  } | {
2046
2046
  type: "icon";
2047
2047
  icon: IconType;
2048
+ } | {
2049
+ type: "module";
2050
+ module: ModuleId;
2051
+ } | {
2052
+ type: "alert";
2053
+ variant: AlertAvatarProps["type"];
2054
+ } | {
2055
+ type: "date";
2056
+ date: Date;
2057
+ } | {
2058
+ type: "pulse";
2059
+ firstName: string;
2060
+ lastName: string;
2061
+ src?: string;
2062
+ pulse?: Pulse;
2063
+ onPulseClick: () => void;
2048
2064
  };
2049
2065
 
2050
2066
  /**
@@ -2259,6 +2275,33 @@ declare const cardPropertyRenderers: {
2259
2275
 
2260
2276
  declare type CardPropertyType = keyof typeof cardPropertyRenderers;
2261
2277
 
2278
+ declare interface CardRowConfirmAction {
2279
+ onClick: () => void;
2280
+ /** Accessible label and tooltip. Defaults to "Confirm" / "Reject". */
2281
+ label?: string;
2282
+ disabled?: boolean;
2283
+ }
2284
+
2285
+ /**
2286
+ * Container breakpoint at which the card row switches between its inline and its
2287
+ * stacked (actions-on-their-own-line) layout. `never` keeps it inline at every
2288
+ * width.
2289
+ */
2290
+ declare type CardRowStackAt = "sm" | "md" | "lg" | "never";
2291
+
2292
+ /**
2293
+ * Resolved state shown at the trailing edge in place of the actions: a coloured
2294
+ * icon (e.g. `Check` for accepted, `Cross` for rejected) carrying the outcome.
2295
+ */
2296
+ declare interface CardRowStatus {
2297
+ /** The icon to render (e.g. `Check` for accepted, `Cross` for rejected). */
2298
+ icon: IconType;
2299
+ /** Colour family. */
2300
+ variant: StatusVariant;
2301
+ /** Accessible label; the icon carries meaning, so this is required. */
2302
+ label: string;
2303
+ }
2304
+
2262
2305
  declare interface CardSecondaryAction {
2263
2306
  label: string;
2264
2307
  icon?: IconType;
@@ -6850,6 +6893,98 @@ compact?: boolean;
6850
6893
 
6851
6894
  export declare type F0CardProps = Omit<CardInternalProps, (typeof privateProps_3)[number]>;
6852
6895
 
6896
+ export declare const F0CardRow: WithDataTestIdReturnType_3<ForwardRefExoticComponent<F0CardRowProps & RefAttributes<HTMLDivElement>> & {
6897
+ Skeleton: ({ compact }: {
6898
+ compact?: boolean;
6899
+ }) => JSX_2.Element;
6900
+ }>;
6901
+
6902
+ export declare interface F0CardRowProps {
6903
+ /**
6904
+ * The primary line of text.
6905
+ */
6906
+ title: string;
6907
+ /**
6908
+ * Optional secondary line shown beneath the title (wraps across multiple
6909
+ * lines when long).
6910
+ */
6911
+ description?: string;
6912
+ /**
6913
+ * Optional avatar rendered at a fixed `lg` size on the left (the size is not
6914
+ * configurable). Accepts any avatar type in the system: person, company, team,
6915
+ * file, flag, icon, emoji, module, alert, date, pulse. Types without a `lg`
6916
+ * variant (date, pulse) render at their intrinsic size.
6917
+ */
6918
+ avatar?: CardAvatarVariant;
6919
+ /**
6920
+ * The primary action button, shown at the trailing edge of the row.
6921
+ */
6922
+ primaryAction?: CardPrimaryAction;
6923
+ /**
6924
+ * Secondary actions (buttons) or a single link, shown before the primary action.
6925
+ */
6926
+ secondaryActions?: CardSecondaryAction[] | CardSecondaryLink;
6927
+ /**
6928
+ * Overflow (⋯) menu actions, rendered as the trailing control of the row.
6929
+ */
6930
+ otherActions?: DropdownItem[];
6931
+ /**
6932
+ * Confirm/reject variant: renders an icon-only ✗ (reject) + ✓ (confirm) pair
6933
+ * instead of the standard actions. Provide either or both.
6934
+ */
6935
+ confirmAction?: CardRowConfirmAction;
6936
+ /**
6937
+ * Reject (✗) action of the confirm/reject variant. See {@link confirmAction}.
6938
+ */
6939
+ rejectAction?: CardRowConfirmAction;
6940
+ /**
6941
+ * Resolved-state icon shown at the trailing edge in place of any actions — the
6942
+ * outcome of a confirm/reject row, e.g.
6943
+ * `{ icon: Check, variant: "positive", label: "Accepted" }`.
6944
+ * Takes precedence over the action props.
6945
+ */
6946
+ status?: CardRowStatus;
6947
+ /**
6948
+ * Strikes through and dims the title/description, marking the row's subject as
6949
+ * void or closed (e.g. a rejected request). Purely presentational — pair it
6950
+ * with the matching `status` tag at the call site.
6951
+ */
6952
+ inactive?: boolean;
6953
+ /**
6954
+ * Compact layout: tighter padding and smaller controls.
6955
+ */
6956
+ compact?: boolean;
6957
+ /**
6958
+ * Container width at which the actions drop to their own line (below it) vs.
6959
+ * sit inline (at/above it). `never` keeps them inline at every width.
6960
+ * @default "never"
6961
+ */
6962
+ stackAt?: CardRowStackAt;
6963
+ /**
6964
+ * When set, the whole row becomes a link to this href.
6965
+ */
6966
+ link?: string;
6967
+ /**
6968
+ * Stretch to fill the height of its container.
6969
+ */
6970
+ fullHeight?: boolean;
6971
+ /**
6972
+ * Alert banner displayed above the row with a coloured header strip and matching
6973
+ * border. Supports info, warning, critical and positive variants.
6974
+ * Use `visible` + `onDismiss` for controlled dismiss behaviour.
6975
+ */
6976
+ alert?: CardAlertProps;
6977
+ /**
6978
+ * Called when the row is clicked.
6979
+ */
6980
+ onClick?: () => void;
6981
+ /**
6982
+ * Disables the full-row overlay link so a parent can manage drag-and-drop while
6983
+ * still allowing click navigation via `onClick`.
6984
+ */
6985
+ disableOverlayLink?: boolean;
6986
+ }
6987
+
6853
6988
  declare interface F0CardSelectConfig {
6854
6989
  options: CardSelectOption[];
6855
6990
  hideLabel?: boolean;
@@ -8879,30 +9014,51 @@ export declare type F0HeadingProps = Omit<TextProps, "className" | "variant" | "
8879
9014
  as?: HeadingTags;
8880
9015
  };
8881
9016
 
8882
- export declare const F0HILActionConfirmation: ({ text, confirmationText, onConfirm, cancelText, onCancel, }: F0HILActionConfirmationProps) => JSX_2.Element;
9017
+ export declare const F0HILActionConfirmation: ({ text, description, avatar, confirmationText, onConfirm, cancelText, onCancel, stackAt, }: F0HILActionConfirmationProps) => JSX_2.Element;
8883
9018
 
8884
9019
  /**
8885
- * Props for the F0HILActionConfirmation component
9020
+ * Props for the F0HILActionConfirmation component.
9021
+ *
9022
+ * Renders an inline approve/reject row built on `F0CardRow`'s confirm/reject
9023
+ * variant: the prompt as the row title, with icon-only ✓ (confirm) and ✗
9024
+ * (reject) buttons at the trailing edge.
8886
9025
  */
8887
9026
  export declare type F0HILActionConfirmationProps = {
8888
9027
  /**
8889
- * Optional descriptive text shown above the action buttons
9028
+ * The prompt shown as the row title (e.g. the action awaiting confirmation).
9029
+ * Required — a confirmation without a prompt has no meaning.
8890
9030
  */
8891
- text?: string;
9031
+ text: string;
8892
9032
  /**
8893
- * Text displayed on the confirmation button
9033
+ * Optional secondary line shown beneath the title (single line, truncated).
9034
+ */
9035
+ description?: F0CardRowProps["description"];
9036
+ /**
9037
+ * Optional avatar rendered on the left of the row. Accepts any avatar type in
9038
+ * the system (person, company, team, file, icon, emoji, …).
9039
+ */
9040
+ avatar?: F0CardRowProps["avatar"];
9041
+ /**
9042
+ * Container width at which the ✓/✗ actions drop onto their own line instead of
9043
+ * staying inline. Prevents the buttons from overlapping the prompt in narrow
9044
+ * containers. Set to `"never"` to keep them inline at every width.
9045
+ * @default "sm"
9046
+ */
9047
+ stackAt?: F0CardRowProps["stackAt"];
9048
+ /**
9049
+ * Accessible label and tooltip for the confirm (✓) button.
8894
9050
  */
8895
9051
  confirmationText: string;
8896
9052
  /**
8897
- * Callback fired when the confirmation button is clicked
9053
+ * Callback fired when the confirm button is clicked.
8898
9054
  */
8899
9055
  onConfirm: () => void;
8900
9056
  /**
8901
- * Text displayed on the cancel button
9057
+ * Accessible label and tooltip for the reject (✗) button.
8902
9058
  */
8903
9059
  cancelText: string;
8904
9060
  /**
8905
- * Callback fired when the cancel button is clicked
9061
+ * Callback fired when the reject button is clicked.
8906
9062
  */
8907
9063
  onCancel: () => void;
8908
9064
  };
@@ -12909,6 +13065,10 @@ declare type Props_3 = {
12909
13065
 
12910
13066
  declare type Props_4 = {} & Pick<BaseHeaderProps, "avatar" | "title" | "description" | "primaryAction" | "secondaryActions" | "otherActions" | "metadata" | "status" | "deactivated" | "showBottomBorder">;
12911
13067
 
13068
+ declare type Pulse = (typeof pulses)[number];
13069
+
13070
+ declare const pulses: readonly ["superNegative", "negative", "neutral", "positive", "superPositive"];
13071
+
12912
13072
  export declare type QuestionActionParams = {
12913
13073
  questionId: string;
12914
13074
  type: ActionType;
@@ -15587,9 +15747,9 @@ declare namespace Calendar {
15587
15747
 
15588
15748
  declare module "@tiptap/core" {
15589
15749
  interface Commands<ReturnType> {
15590
- aiBlock: {
15591
- insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
15592
- executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
15750
+ enhanceHighlight: {
15751
+ setEnhanceHighlight: (from: number, to: number) => ReturnType;
15752
+ clearEnhanceHighlight: () => ReturnType;
15593
15753
  };
15594
15754
  }
15595
15755
  }
@@ -15597,9 +15757,9 @@ declare module "@tiptap/core" {
15597
15757
 
15598
15758
  declare module "@tiptap/core" {
15599
15759
  interface Commands<ReturnType> {
15600
- enhanceHighlight: {
15601
- setEnhanceHighlight: (from: number, to: number) => ReturnType;
15602
- clearEnhanceHighlight: () => ReturnType;
15760
+ aiBlock: {
15761
+ insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
15762
+ executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
15603
15763
  };
15604
15764
  }
15605
15765
  }