@factorialco/f0-react 6.13.0 → 6.14.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.
@@ -78,6 +78,7 @@ import { PersonCellValue } from './types/person';
78
78
  import { PersonCellValue as PersonCellValue_2 } from './experimental';
79
79
  import { PieChartProps } from './PieChart';
80
80
  import { PieChartProps as PieChartProps_2 } from './experimental';
81
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
81
82
  import { PopoverProps } from '@radix-ui/react-popover';
82
83
  import { ProgressBarCellValue } from './types/progressBar';
83
84
  import { ProgressBarCellValue as ProgressBarCellValue_2 } from './experimental';
@@ -2399,6 +2400,169 @@ declare interface ClockInGraphProps {
2399
2400
 
2400
2401
  declare type ClockInStatus = "clocked-in" | "break" | "clocked-out";
2401
2402
 
2403
+ /**
2404
+ * The single call to action at the bottom of the panel. Both fields are
2405
+ * optional: the coachmark always advances to the next step (or closes on the
2406
+ * last one) when the button is pressed, so `onClick` is only for side effects
2407
+ * and `label` only for overriding the default wording.
2408
+ */
2409
+ export declare type CoachmarkAction = {
2410
+ /** Defaults to `Next` on every step but the last, `Got it` on the last. */
2411
+ label?: string;
2412
+ /** Extra side effect. Advancing and closing happen either way. */
2413
+ onClick?: () => void;
2414
+ };
2415
+
2416
+ declare type CoachmarkBase = CoachmarkPlacement & {
2417
+ /**
2418
+ * Stable identity. Opening again with the same id replaces that coachmark
2419
+ * instead of queueing a second one, so an effect that runs twice shows one
2420
+ * coachmark. Defaults to a generated id.
2421
+ */
2422
+ id?: CoachmarkId;
2423
+ /**
2424
+ * Called when the user closes the coachmark with the close button or Escape,
2425
+ * before the last step is reached. For tracking only — the coachmark closes
2426
+ * itself either way.
2427
+ */
2428
+ onDismiss?: () => void;
2429
+ /**
2430
+ * Called when the user presses the action on the last step. For tracking only
2431
+ * — the coachmark closes itself either way.
2432
+ */
2433
+ onComplete?: () => void;
2434
+ };
2435
+
2436
+ declare type CoachmarkContent = {
2437
+ /** Headline. Also the accessible name of the panel. */
2438
+ title: string;
2439
+ /** Supporting copy under the title. */
2440
+ description?: string;
2441
+ /** The single call to action, rendered at the bottom right. */
2442
+ action?: CoachmarkAction;
2443
+ };
2444
+
2445
+ export declare type CoachmarkId = string;
2446
+
2447
+ /**
2448
+ * What `coachmarks.open` accepts: either one coachmark, or a sequence of steps
2449
+ * shown one at a time. The two shapes are mutually exclusive.
2450
+ */
2451
+ export declare type CoachmarkOptions = CoachmarkSingleOptions | CoachmarkSequenceOptions;
2452
+
2453
+ /**
2454
+ * Where the panel sits relative to its target. `side` is a preference: the
2455
+ * panel flips and shifts on its own when it would overflow the viewport.
2456
+ */
2457
+ declare type CoachmarkPlacement = {
2458
+ /** Renders a triangle pointing at the target. Defaults to `true`. */
2459
+ arrow?: boolean;
2460
+ /** Preferred side of the target. Defaults to `"bottom"`. */
2461
+ side?: PopoverContentProps["side"];
2462
+ /** Alignment along the target's edge. Defaults to `"center"`. */
2463
+ align?: PopoverContentProps["align"];
2464
+ /** Distance in pixels between the target and the panel. */
2465
+ sideOffset?: number;
2466
+ };
2467
+
2468
+ /**
2469
+ * Renders the coachmark at the head of the queue. Mounted by `F0Provider`, so
2470
+ * `coachmarks.open` works from anywhere without a hook or a wrapper component.
2471
+ */
2472
+ export declare const CoachmarkProvider: ({ children, portalTarget, }: CoachmarkProviderProps) => JSX_2.Element;
2473
+
2474
+ declare type CoachmarkProviderProps = {
2475
+ children: React.ReactNode;
2476
+ /**
2477
+ * Selector for the element the panel is portalled into. Defaults to the
2478
+ * top-level overlay root, which keeps the coachmark above app content (the
2479
+ * ApplicationFrame's `isolate`, the fullscreen AI chat) while staying inside
2480
+ * `#f0-layout` so design tokens and the theme class still apply. Falls back to
2481
+ * `document.body` when the element is absent.
2482
+ */
2483
+ portalTarget?: string;
2484
+ };
2485
+
2486
+ /**
2487
+ * Imperative API for coachmarks: a panel anchored to an element, pointing out a
2488
+ * feature the user has not discovered yet. Can be called from anywhere — no hook
2489
+ * required — as long as `<F0Provider>` (which mounts `CoachmarkProvider`) is in
2490
+ * the tree.
2491
+ *
2492
+ * There is no `open` prop and no component to render: the coachmark closes
2493
+ * itself when the user acknowledges it, and only one is ever on screen — a
2494
+ * second `open` waits its turn.
2495
+ *
2496
+ * @example
2497
+ * import { coachmarks } from "@factorialco/f0-react/experimental"
2498
+ *
2499
+ * coachmarks.open({
2500
+ * id: "smart-filters",
2501
+ * targetElement: "#filters-button",
2502
+ * title: "Filters got smarter",
2503
+ * description: "Stack filters, then save the combination as a view.",
2504
+ * action: { label: "Learn more", onClick: () => openDocs() },
2505
+ * })
2506
+ *
2507
+ * @example A walkthrough, one step at a time
2508
+ * coachmarks.open({
2509
+ * steps: [
2510
+ * { targetElement: "#filters-button", title: "Start with a filter" },
2511
+ * { targetElement: "#save-view", title: "Then save it as a view" },
2512
+ * ],
2513
+ * onComplete: () => track("tour-finished"),
2514
+ * })
2515
+ */
2516
+ export declare const coachmarks: {
2517
+ /**
2518
+ * Show a coachmark, or queue it behind the one already on screen.
2519
+ * @param options One coachmark, or a sequence of `steps`
2520
+ * @returns The id of the coachmark (pass it to `coachmarks.close`)
2521
+ */
2522
+ open: (options: CoachmarkOptions) => CoachmarkId;
2523
+ /**
2524
+ * Remove a coachmark by id, whether it is on screen or still queued. For
2525
+ * closing it programmatically — the user does not need this.
2526
+ * @param id The id returned by `coachmarks.open`
2527
+ */
2528
+ close: (id: CoachmarkId) => void;
2529
+ /** Remove every coachmark, on screen and queued. */
2530
+ closeAll: () => void;
2531
+ };
2532
+
2533
+ /** A walkthrough: several steps, shown one at a time in order. */
2534
+ export declare type CoachmarkSequenceOptions = CoachmarkBase & {
2535
+ /** Shared fallback target for steps that do not name their own. */
2536
+ targetElement?: CoachmarkTarget;
2537
+ steps: CoachmarkStep[];
2538
+ title?: never;
2539
+ description?: never;
2540
+ action?: never;
2541
+ };
2542
+
2543
+ /** One coachmark: its own copy, anchored to one element. */
2544
+ export declare type CoachmarkSingleOptions = CoachmarkBase & CoachmarkContent & {
2545
+ targetElement: CoachmarkTarget;
2546
+ steps?: never;
2547
+ };
2548
+
2549
+ /**
2550
+ * One step of a walkthrough. Each step can point at its own element and carry
2551
+ * its own placement; anything it leaves out falls back to the value passed
2552
+ * alongside `steps`.
2553
+ */
2554
+ export declare type CoachmarkStep = CoachmarkContent & CoachmarkPlacement & {
2555
+ /** Falls back to the `targetElement` passed alongside `steps`. */
2556
+ targetElement?: CoachmarkTarget;
2557
+ };
2558
+
2559
+ /**
2560
+ * What the coachmark points at: a CSS selector that must match exactly one
2561
+ * element, or the element itself. A selector is re-resolved while the coachmark
2562
+ * is queued, so it may point at something that mounts later.
2563
+ */
2564
+ export declare type CoachmarkTarget = string | HTMLElement;
2565
+
2402
2566
  declare type ColId = string;
2403
2567
 
2404
2568
  declare interface CollectionComputation {
@@ -3542,6 +3706,10 @@ declare const defaultTranslations: {
3542
3706
  readonly join: "Join";
3543
3707
  readonly summary: "Summary";
3544
3708
  };
3709
+ readonly coachmark: {
3710
+ readonly next: "Next";
3711
+ readonly done: "Got it";
3712
+ };
3545
3713
  readonly actions: {
3546
3714
  readonly add: "Add";
3547
3715
  readonly edit: "Edit";
@@ -9727,6 +9895,10 @@ declare interface PieComputation {
9727
9895
  limit?: number;
9728
9896
  }
9729
9897
 
9898
+ declare type PopoverContentProps = React_2.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {
9899
+ container?: HTMLElement | null;
9900
+ };
9901
+
9730
9902
  declare type PostDescriptionProps = {
9731
9903
  content: HTMLString;
9732
9904
  collapsed?: boolean;
@@ -12667,11 +12839,9 @@ declare namespace Calendar {
12667
12839
 
12668
12840
  declare module "@tiptap/core" {
12669
12841
  interface Commands<ReturnType> {
12670
- enhanceHighlight: {
12671
- setEnhanceHighlight: (from: number, to: number, options?: {
12672
- placeholder?: string;
12673
- }) => ReturnType;
12674
- clearEnhanceHighlight: () => ReturnType;
12842
+ aiBlock: {
12843
+ insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
12844
+ executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
12675
12845
  };
12676
12846
  }
12677
12847
  }
@@ -12679,9 +12849,9 @@ declare module "@tiptap/core" {
12679
12849
 
12680
12850
  declare module "@tiptap/core" {
12681
12851
  interface Commands<ReturnType> {
12682
- aiBlock: {
12683
- insertAIBlock: (data: AIBlockData, config: AIBlockConfig) => ReturnType;
12684
- executeAIAction: (actionType: string, config: AIBlockConfig) => ReturnType;
12852
+ fontSize: {
12853
+ setFontSize: (fontSize: string) => ReturnType;
12854
+ unsetFontSize: () => ReturnType;
12685
12855
  };
12686
12856
  }
12687
12857
  }
@@ -12689,9 +12859,11 @@ declare module "@tiptap/core" {
12689
12859
 
12690
12860
  declare module "@tiptap/core" {
12691
12861
  interface Commands<ReturnType> {
12692
- fontSize: {
12693
- setFontSize: (fontSize: string) => ReturnType;
12694
- unsetFontSize: () => ReturnType;
12862
+ enhanceHighlight: {
12863
+ setEnhanceHighlight: (from: number, to: number, options?: {
12864
+ placeholder?: string;
12865
+ }) => ReturnType;
12866
+ clearEnhanceHighlight: () => ReturnType;
12695
12867
  };
12696
12868
  }
12697
12869
  }