@factorialco/f0-react 3.12.0 → 4.0.1

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/ai.d.ts CHANGED
@@ -1128,25 +1128,7 @@ declare type CardAvatarVariant = AvatarVariant | {
1128
1128
  date: Date;
1129
1129
  };
1130
1130
 
1131
- declare type CardInternalProps = F0AiInsightCardProps & {
1132
- className?: string;
1133
- };
1134
-
1135
- declare interface CardPrimaryAction {
1136
- label: string;
1137
- icon?: IconType;
1138
- onClick: () => void;
1139
- /**
1140
- * Visual emphasis of the primary action. `"outline"` renders it as an outline
1141
- * button while keeping it pinned at the trailing edge (so a lone CTA never
1142
- * sheds into the "⋯" menu). Use it when the card's only action shouldn't carry
1143
- * full primary weight.
1144
- * @default "default"
1145
- */
1146
- variant?: "default" | "outline";
1147
- }
1148
-
1149
- declare interface CardRowConfirmAction {
1131
+ declare interface CardHorizontalConfirmAction {
1150
1132
  onClick: () => void;
1151
1133
  /** Accessible label and tooltip. Defaults to "Confirm" / "Reject". */
1152
1134
  label?: string;
@@ -1154,17 +1136,17 @@ declare interface CardRowConfirmAction {
1154
1136
  }
1155
1137
 
1156
1138
  /**
1157
- * Container breakpoint at which the card row switches between its inline and its
1139
+ * Container breakpoint at which the horizontal card switches between its inline and its
1158
1140
  * stacked (actions-on-their-own-line) layout. `never` keeps it inline at every
1159
1141
  * width.
1160
1142
  */
1161
- declare type CardRowStackAt = "sm" | "md" | "lg" | "never";
1143
+ declare type CardHorizontalStackAt = "sm" | "md" | "lg" | "never";
1162
1144
 
1163
1145
  /**
1164
1146
  * Resolved state shown at the trailing edge in place of the actions: a coloured
1165
1147
  * icon (e.g. `Check` for accepted, `Cross` for rejected) carrying the outcome.
1166
1148
  */
1167
- declare interface CardRowStatus {
1149
+ declare interface CardHorizontalStatus {
1168
1150
  /** The icon to render (e.g. `Check` for accepted, `Cross` for rejected). */
1169
1151
  icon: IconType;
1170
1152
  /** Colour family. */
@@ -1173,6 +1155,24 @@ declare interface CardRowStatus {
1173
1155
  label: string;
1174
1156
  }
1175
1157
 
1158
+ declare type CardInternalProps = F0AiInsightCardProps & {
1159
+ className?: string;
1160
+ };
1161
+
1162
+ declare interface CardPrimaryAction {
1163
+ label: string;
1164
+ icon?: IconType;
1165
+ onClick: () => void;
1166
+ /**
1167
+ * Visual emphasis of the primary action. `"outline"` renders it as an outline
1168
+ * button while keeping it pinned at the trailing edge (so a lone CTA never
1169
+ * sheds into the "⋯" menu). Use it when the card's only action shouldn't carry
1170
+ * full primary weight.
1171
+ * @default "default"
1172
+ */
1173
+ variant?: "default" | "outline";
1174
+ }
1175
+
1176
1176
  declare interface CardSecondaryAction {
1177
1177
  label: string;
1178
1178
  icon?: IconType;
@@ -3320,7 +3320,7 @@ export declare type F0CanvasPanelProps = {
3320
3320
  entities?: Record<string, CanvasEntityDefinition<any>>;
3321
3321
  };
3322
3322
 
3323
- declare interface F0CardRowProps {
3323
+ declare interface F0CardHorizontalProps {
3324
3324
  /**
3325
3325
  * The primary line of text.
3326
3326
  */
@@ -3353,18 +3353,18 @@ declare interface F0CardRowProps {
3353
3353
  * Confirm/reject variant: renders an icon-only ✗ (reject) + ✓ (confirm) pair
3354
3354
  * instead of the standard actions. Provide either or both.
3355
3355
  */
3356
- confirmAction?: CardRowConfirmAction;
3356
+ confirmAction?: CardHorizontalConfirmAction;
3357
3357
  /**
3358
3358
  * Reject (✗) action of the confirm/reject variant. See {@link confirmAction}.
3359
3359
  */
3360
- rejectAction?: CardRowConfirmAction;
3360
+ rejectAction?: CardHorizontalConfirmAction;
3361
3361
  /**
3362
3362
  * Resolved-state icon shown at the trailing edge in place of any actions — the
3363
3363
  * outcome of a confirm/reject row, e.g.
3364
3364
  * `{ icon: Check, variant: "positive", label: "Accepted" }`.
3365
3365
  * Takes precedence over the action props.
3366
3366
  */
3367
- status?: CardRowStatus;
3367
+ status?: CardHorizontalStatus;
3368
3368
  /**
3369
3369
  * Strikes through and dims the title/description, marking the row's subject as
3370
3370
  * void or closed (e.g. a rejected request). Purely presentational — pair it
@@ -3376,7 +3376,7 @@ declare interface F0CardRowProps {
3376
3376
  * sit inline (at/above it). `never` keeps them inline at every width.
3377
3377
  * @default "never"
3378
3378
  */
3379
- stackAt?: CardRowStackAt;
3379
+ stackAt?: CardHorizontalStackAt;
3380
3380
  /**
3381
3381
  * Stretch to fill the height of its container.
3382
3382
  */
@@ -3458,7 +3458,7 @@ export declare const F0HILActionConfirmation: ({ text, description, avatar, conf
3458
3458
  /**
3459
3459
  * Props for the F0HILActionConfirmation component.
3460
3460
  *
3461
- * Renders an inline approve/reject row built on `F0CardRow`'s confirm/reject
3461
+ * Renders an inline approve/reject row built on `F0CardHorizontal`'s confirm/reject
3462
3462
  * variant: the prompt as the row title, with icon-only ✓ (confirm) and ✗
3463
3463
  * (reject) buttons at the trailing edge.
3464
3464
  */
@@ -3471,19 +3471,19 @@ export declare type F0HILActionConfirmationProps = {
3471
3471
  /**
3472
3472
  * Optional secondary line shown beneath the title (single line, truncated).
3473
3473
  */
3474
- description?: F0CardRowProps["description"];
3474
+ description?: F0CardHorizontalProps["description"];
3475
3475
  /**
3476
3476
  * Optional avatar rendered on the left of the row. Accepts any avatar type in
3477
3477
  * the system (person, company, team, file, icon, emoji, …).
3478
3478
  */
3479
- avatar?: F0CardRowProps["avatar"];
3479
+ avatar?: F0CardHorizontalProps["avatar"];
3480
3480
  /**
3481
3481
  * Container width at which the ✓/✗ actions drop onto their own line instead of
3482
3482
  * staying inline. Prevents the buttons from overlapping the prompt in narrow
3483
3483
  * containers. Set to `"never"` to keep them inline at every width.
3484
3484
  * @default "sm"
3485
3485
  */
3486
- stackAt?: F0CardRowProps["stackAt"];
3486
+ stackAt?: F0CardHorizontalProps["stackAt"];
3487
3487
  /**
3488
3488
  * Accessible label and tooltip for the confirm (✓) button.
3489
3489
  */
@@ -4739,10 +4739,8 @@ declare module "@tiptap/core" {
4739
4739
 
4740
4740
  declare module "@tiptap/core" {
4741
4741
  interface Commands<ReturnType> {
4742
- videoEmbed: {
4743
- setVideoEmbed: (options: {
4744
- src: string;
4745
- }) => ReturnType;
4742
+ transcript: {
4743
+ insertTranscript: (data: TranscriptData) => ReturnType;
4746
4744
  };
4747
4745
  }
4748
4746
  }
@@ -4750,8 +4748,10 @@ declare module "@tiptap/core" {
4750
4748
 
4751
4749
  declare module "@tiptap/core" {
4752
4750
  interface Commands<ReturnType> {
4753
- transcript: {
4754
- insertTranscript: (data: TranscriptData) => ReturnType;
4751
+ videoEmbed: {
4752
+ setVideoEmbed: (options: {
4753
+ src: string;
4754
+ }) => ReturnType;
4755
4755
  };
4756
4756
  }
4757
4757
  }
package/dist/ai.js CHANGED
@@ -1,6 +1,6 @@
1
- import { C as e, D as r, c as t, F as o, a as i, f as n, g as F, d as C, e as A, I as l, P as d, b as u, u as m } from "./F0CanvasPanel-DWqZRYSD.js";
1
+ import { C as e, D as r, c as t, F as o, a as i, f as n, g as F, d as C, e as A, I as l, P as d, b as u, u as m } from "./F0CanvasPanel-BRbh7bn2.js";
2
2
  import { defaultTranslations as c } from "./i18n-provider-defaults.js";
3
- import { A as P, s as v, t as f, w as g, l as p, i as T, q as y, x as S, p as x, r as H, j as V, e as b, g as k, k as w, F as M, h as O, a as D, n as j, m as q, o as z, b as B, f as E, v as L, c as R, d as G, u as J } from "./useChatHistory-BJpDjaBs.js";
3
+ import { A as P, s as v, t as f, w as g, l as p, i as T, q as y, x as S, p as x, r as H, j as V, e as b, g as k, k as w, F as M, h as O, a as D, n as j, m as q, o as z, b as B, f as E, v as L, c as R, d as G, u as J } from "./useChatHistory-cszINQb8.js";
4
4
  export {
5
5
  P as AiChatTranslationsProvider,
6
6
  e as ChatSpinner,
@@ -268,6 +268,10 @@ declare type ActionLinkProps = ActionBaseProps & {
268
268
  className?: string;
269
269
  };
270
270
 
271
+ declare type ActionLinkVariant = (typeof actionLinkVariants)[number];
272
+
273
+ declare const actionLinkVariants: readonly ["link", "unstyled", "mention"];
274
+
271
275
  declare type ActionProps = ActionLinkProps | ActionButtonProps;
272
276
 
273
277
  declare type ActionProps_2 = {
@@ -1567,6 +1571,77 @@ declare type CanvasEntityDefinition<T extends CanvasContentBase = CanvasContentB
1567
1571
  overflowHidden?: boolean;
1568
1572
  };
1569
1573
 
1574
+ /**
1575
+ * An optional action button rendered in the alert header.
1576
+ * Mutually exclusive with `dismissible` — only one can be shown at a time.
1577
+ * Supply either `onClick` (handler) or `href` (navigation link), not both.
1578
+ */
1579
+ declare type CardAlertAction = {
1580
+ /** Label text for the action button. */
1581
+ label: string;
1582
+ /** Whether the action button is disabled. */
1583
+ disabled?: boolean;
1584
+ } & ({
1585
+ /** Called when the action button is clicked. */
1586
+ onClick: () => void;
1587
+ href?: never;
1588
+ } | {
1589
+ /** URL to navigate to when the action button is clicked. */
1590
+ href: string;
1591
+ onClick?: never;
1592
+ });
1593
+
1594
+ declare interface CardAlertBase {
1595
+ /**
1596
+ * The visual variant of the alert, which determines the color scheme and default icon.
1597
+ */
1598
+ variant: CardAlertVariant;
1599
+ /**
1600
+ * The title text displayed in the alert banner.
1601
+ */
1602
+ title: string;
1603
+ /**
1604
+ * Optional custom icon. When omitted, defaults to the icon that best represents the variant.
1605
+ */
1606
+ icon?: IconType;
1607
+ /**
1608
+ * Controls whether the alert is visible. Defaults to true.
1609
+ * Use this together with onDismiss for controlled dismiss behaviour:
1610
+ * alert={{ ..., visible, dismissible: true, onDismiss: () => setVisible(false) }}
1611
+ */
1612
+ visible?: boolean;
1613
+ }
1614
+
1615
+ declare type CardAlertDismissible = CardAlertBase & {
1616
+ /** Renders a dismiss (×) button. Requires onDismiss. */
1617
+ dismissible: true;
1618
+ /**
1619
+ * Called when the dismiss (×) button is clicked.
1620
+ * The consumer is responsible for hiding the alert (e.g. by setting visible: false).
1621
+ */
1622
+ onDismiss: () => void;
1623
+ action?: never;
1624
+ };
1625
+
1626
+ declare type CardAlertNonDismissible = CardAlertBase & {
1627
+ dismissible?: false;
1628
+ onDismiss?: never;
1629
+ action?: never;
1630
+ };
1631
+
1632
+ declare type CardAlertProps = CardAlertDismissible | CardAlertWithAction | CardAlertNonDismissible;
1633
+
1634
+ declare type CardAlertVariant = (typeof cardAlertVariants)[number];
1635
+
1636
+ declare const cardAlertVariants: readonly ["info", "warning", "critical", "positive"];
1637
+
1638
+ declare type CardAlertWithAction = CardAlertBase & {
1639
+ dismissible?: never;
1640
+ onDismiss?: never;
1641
+ /** Action button rendered in the alert header. Mutually exclusive with `dismissible`. */
1642
+ action: CardAlertAction;
1643
+ };
1644
+
1570
1645
  declare type CardAvatarVariant = AvatarVariant | {
1571
1646
  type: "emoji";
1572
1647
  emoji: string;
@@ -1592,6 +1667,33 @@ declare type CardAvatarVariant = AvatarVariant | {
1592
1667
  */
1593
1668
  declare type CardCollectionProps<Record extends RecordType, Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition, ItemActions extends ItemActionsDefinition<Record>, NavigationFilters extends NavigationFiltersDefinition, Grouping extends GroupingDefinition<Record>> = CollectionProps<Record, Filters, Sortings, Summaries, ItemActions, NavigationFilters, Grouping, CardVisualizationOptions<Record, Filters, Sortings>>;
1594
1669
 
1670
+ declare interface CardHorizontalConfirmAction {
1671
+ onClick: () => void;
1672
+ /** Accessible label and tooltip. Defaults to "Confirm" / "Reject". */
1673
+ label?: string;
1674
+ disabled?: boolean;
1675
+ }
1676
+
1677
+ /**
1678
+ * Container breakpoint at which the horizontal card switches between its inline and its
1679
+ * stacked (actions-on-their-own-line) layout. `never` keeps it inline at every
1680
+ * width.
1681
+ */
1682
+ declare type CardHorizontalStackAt = "sm" | "md" | "lg" | "never";
1683
+
1684
+ /**
1685
+ * Resolved state shown at the trailing edge in place of the actions: a coloured
1686
+ * icon (e.g. `Check` for accepted, `Cross` for rejected) carrying the outcome.
1687
+ */
1688
+ declare interface CardHorizontalStatus {
1689
+ /** The icon to render (e.g. `Check` for accepted, `Cross` for rejected). */
1690
+ icon: IconType;
1691
+ /** Colour family. */
1692
+ variant: StatusVariant;
1693
+ /** Accessible label; the icon carries meaning, so this is required. */
1694
+ label: string;
1695
+ }
1696
+
1595
1697
  declare type CardImageAspectRatio = (typeof cardImageAspectRatios)[number];
1596
1698
 
1597
1699
  declare const cardImageAspectRatios: readonly ["default", "video"];
@@ -1616,6 +1718,20 @@ declare type CardMetadataProperty = {
1616
1718
  };
1617
1719
  }[CardPropertyType];
1618
1720
 
1721
+ declare interface CardPrimaryAction {
1722
+ label: string;
1723
+ icon?: IconType;
1724
+ onClick: () => void;
1725
+ /**
1726
+ * Visual emphasis of the primary action. `"outline"` renders it as an outline
1727
+ * button while keeping it pinned at the trailing edge (so a lone CTA never
1728
+ * sheds into the "⋯" menu). Use it when the card's only action shouldn't carry
1729
+ * full primary weight.
1730
+ * @default "default"
1731
+ */
1732
+ variant?: "default" | "outline";
1733
+ }
1734
+
1619
1735
  declare type CardPropertyDefinition<T> = PropertyDefinition_2<T> & {
1620
1736
  icon?: IconType;
1621
1737
  };
@@ -1641,6 +1757,16 @@ declare const cardPropertyRenderers: {
1641
1757
 
1642
1758
  declare type CardPropertyType = keyof typeof cardPropertyRenderers;
1643
1759
 
1760
+ declare interface CardSecondaryAction {
1761
+ label: string;
1762
+ icon?: IconType;
1763
+ onClick: () => void;
1764
+ }
1765
+
1766
+ declare interface CardSecondaryLink extends Pick<F0LinkProps, "href" | "target" | "disabled"> {
1767
+ label: string;
1768
+ }
1769
+
1644
1770
  declare type CardSelectableAvatarVariant = AvatarVariant | {
1645
1771
  type: "emoji";
1646
1772
  emoji: string;
@@ -4549,6 +4675,101 @@ export declare const F0Callout: ForwardRefExoticComponent<Omit<CalloutInternalPr
4549
4675
 
4550
4676
  export declare type F0CalloutProps = CalloutInternalProps;
4551
4677
 
4678
+ /**
4679
+ * @experimental This is an experimental component, use it at your own risk.
4680
+ */
4681
+ export declare const F0CardHorizontal: WithDataTestIdReturnType_2<ForwardRefExoticComponent<F0CardHorizontalProps & RefAttributes<HTMLDivElement>> & {
4682
+ Skeleton: () => JSX_2.Element;
4683
+ }>;
4684
+
4685
+ export declare interface F0CardHorizontalProps {
4686
+ /**
4687
+ * The primary line of text.
4688
+ */
4689
+ title: string;
4690
+ /**
4691
+ * Optional secondary line shown beneath the title (wraps across multiple
4692
+ * lines when long).
4693
+ */
4694
+ description?: string;
4695
+ /**
4696
+ * Optional avatar rendered at a fixed `lg` size on the left (the size is not
4697
+ * configurable). Accepts any avatar type in the system: person, company, team,
4698
+ * file, flag, icon, emoji, module, alert, date, pulse. Types without a `lg`
4699
+ * variant (date, pulse) render at their intrinsic size.
4700
+ */
4701
+ avatar?: CardAvatarVariant;
4702
+ /**
4703
+ * The primary action button, shown at the trailing edge of the row.
4704
+ */
4705
+ primaryAction?: CardPrimaryAction;
4706
+ /**
4707
+ * Secondary actions (buttons) or a single link, shown before the primary action.
4708
+ */
4709
+ secondaryActions?: CardSecondaryAction[] | CardSecondaryLink;
4710
+ /**
4711
+ * Overflow (⋯) menu actions, rendered as the trailing control of the row.
4712
+ */
4713
+ otherActions?: DropdownItem[];
4714
+ /**
4715
+ * Confirm/reject variant: renders an icon-only ✗ (reject) + ✓ (confirm) pair
4716
+ * instead of the standard actions. Provide either or both.
4717
+ */
4718
+ confirmAction?: CardHorizontalConfirmAction;
4719
+ /**
4720
+ * Reject (✗) action of the confirm/reject variant. See {@link confirmAction}.
4721
+ */
4722
+ rejectAction?: CardHorizontalConfirmAction;
4723
+ /**
4724
+ * Resolved-state icon shown at the trailing edge in place of any actions — the
4725
+ * outcome of a confirm/reject row, e.g.
4726
+ * `{ icon: Check, variant: "positive", label: "Accepted" }`.
4727
+ * Takes precedence over the action props.
4728
+ */
4729
+ status?: CardHorizontalStatus;
4730
+ /**
4731
+ * Strikes through and dims the title/description, marking the row's subject as
4732
+ * void or closed (e.g. a rejected request). Purely presentational — pair it
4733
+ * with the matching `status` tag at the call site.
4734
+ */
4735
+ inactive?: boolean;
4736
+ /**
4737
+ * Container width at which the actions drop to their own line (below it) vs.
4738
+ * sit inline (at/above it). `never` keeps them inline at every width.
4739
+ * @default "never"
4740
+ */
4741
+ stackAt?: CardHorizontalStackAt;
4742
+ /**
4743
+ * Stretch to fill the height of its container.
4744
+ */
4745
+ fullHeight?: boolean;
4746
+ /**
4747
+ * Alert banner displayed above the row with a coloured header strip and matching
4748
+ * border. Supports info, warning, critical and positive variants.
4749
+ * Use `visible` + `onDismiss` for controlled dismiss behaviour.
4750
+ */
4751
+ alert?: CardAlertProps;
4752
+ /**
4753
+ * Opt-in: makes the whole row a link to this href. The row only becomes a
4754
+ * click target (pointer cursor + hover affordance + overlay link) when `link`
4755
+ * or `onClick` is set — otherwise it's a static row whose only interactive
4756
+ * parts are its actions.
4757
+ */
4758
+ link?: string;
4759
+ /**
4760
+ * Opt-in: called when the row is clicked. Like `link`, it turns the whole row
4761
+ * into an explicit click target (pointer cursor + hover affordance). Use it
4762
+ * for cards whose entire surface is the action (e.g. entry-point cards with no
4763
+ * CTA button); leave it unset for rows that act only through their buttons.
4764
+ */
4765
+ onClick?: () => void;
4766
+ /**
4767
+ * Disables the full-row overlay link (used with `link`) so a parent can manage
4768
+ * drag-and-drop while still allowing click navigation via `onClick`.
4769
+ */
4770
+ disableOverlayLink?: boolean;
4771
+ }
4772
+
4552
4773
  export declare type F0FileAction = {
4553
4774
  icon?: IconType;
4554
4775
  label: string;
@@ -4582,6 +4803,12 @@ declare interface F0IconProps extends SVGProps<SVGSVGElement>, VariantProps<type
4582
4803
  color?: "default" | "currentColor" | `#${string}` | Lowercase<NestedKeyOf<typeof f1Colors.icon>>;
4583
4804
  }
4584
4805
 
4806
+ declare type F0LinkProps = Omit<ActionLinkProps, "variant" | "href"> & {
4807
+ variant?: ActionLinkVariant;
4808
+ stopPropagation?: boolean;
4809
+ href?: string;
4810
+ };
4811
+
4585
4812
  declare type F0Message = {
4586
4813
  id: string;
4587
4814
  role: "user" | "assistant" | "system" | "tool";
@@ -9537,10 +9764,8 @@ declare module "@tiptap/core" {
9537
9764
 
9538
9765
  declare module "@tiptap/core" {
9539
9766
  interface Commands<ReturnType> {
9540
- videoEmbed: {
9541
- setVideoEmbed: (options: {
9542
- src: string;
9543
- }) => ReturnType;
9767
+ transcript: {
9768
+ insertTranscript: (data: TranscriptData) => ReturnType;
9544
9769
  };
9545
9770
  }
9546
9771
  }
@@ -9548,8 +9773,10 @@ declare module "@tiptap/core" {
9548
9773
 
9549
9774
  declare module "@tiptap/core" {
9550
9775
  interface Commands<ReturnType> {
9551
- transcript: {
9552
- insertTranscript: (data: TranscriptData) => ReturnType;
9776
+ videoEmbed: {
9777
+ setVideoEmbed: (options: {
9778
+ src: string;
9779
+ }) => ReturnType;
9553
9780
  };
9554
9781
  }
9555
9782
  }