@surrealdb/ui 1.2.11 → 1.2.13

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.
Files changed (101) hide show
  1. package/.claude/launch.json +17 -0
  2. package/.oxfmtrc.json +27 -0
  3. package/.oxlintrc.json +23 -0
  4. package/.zed/settings.json +34 -34
  5. package/AGENTS.md +21 -19
  6. package/README.md +15 -10
  7. package/dist/assets/245b1ccaa4927818.svg +3 -0
  8. package/dist/assets/333e1fe6e67ca4a2.svg +10 -0
  9. package/dist/assets/4b0e10c655814886.svg +21 -0
  10. package/dist/assets/9932da008ea5dd32.svg +3 -0
  11. package/dist/assets/a372168d5789daa2.svg +4 -0
  12. package/dist/assets/b140e44ee4ae7e35.svg +5 -0
  13. package/dist/assets/e028075817d928e4.svg +3 -0
  14. package/dist/assets/ee1065ad5a8f7f14.svg +6 -0
  15. package/dist/ui.css +1 -1
  16. package/dist/ui.d.ts +579 -1
  17. package/dist/ui.js +11553 -8988
  18. package/dist/ui.js.map +1 -1
  19. package/doc/code-style.md +264 -0
  20. package/doc/stacker-plan.md +219 -0
  21. package/package.json +119 -115
  22. package/res/_mixins.scss +15 -11
  23. package/tests/_setup/e2e-helpers.tsx +85 -85
  24. package/tests/_setup/portable-stories.ts +11 -10
  25. package/tests/e2e/MarkdownEditor/content-blocks.test.tsx +140 -139
  26. package/tests/e2e/MarkdownEditor/edits.test.tsx +101 -100
  27. package/tests/e2e/MarkdownEditor/heading-fold.test.tsx +35 -34
  28. package/tests/e2e/MarkdownEditor/hybrid-widgets.test.tsx +178 -177
  29. package/tests/e2e/MarkdownEditor/image-on-image.test.tsx +50 -49
  30. package/tests/e2e/MarkdownEditor/jsx-block-content.test.tsx +195 -194
  31. package/tests/e2e/MarkdownEditor/jsx-highlight.test.tsx +47 -46
  32. package/tests/e2e/MarkdownEditor/jsx-inline-badges.test.tsx +35 -34
  33. package/tests/e2e/MarkdownEditor/jsx-inline-click.test.tsx +39 -38
  34. package/tests/e2e/MarkdownEditor/jsx-selection.test.tsx +28 -27
  35. package/tests/e2e/MarkdownEditor/link-placeholder.test.tsx +49 -48
  36. package/tests/e2e/MarkdownEditor/media-align.test.tsx +40 -39
  37. package/tests/e2e/MarkdownEditor/media-edit.test.tsx +49 -48
  38. package/tests/e2e/MarkdownEditor/media-sizing.test.tsx +108 -107
  39. package/tests/e2e/MarkdownEditor/modes.test.tsx +79 -78
  40. package/tests/e2e/MarkdownEditor/onimage-parity.test.tsx +29 -28
  41. package/tests/e2e/MarkdownEditor/regressions.test.tsx +194 -193
  42. package/tests/e2e/MarkdownEditor/slash-commands.test.tsx +81 -80
  43. package/tests/e2e/MarkdownEditor/table-click.test.tsx +36 -35
  44. package/tests/e2e/MarkdownEditor/table-controls.test.tsx +44 -43
  45. package/tests/e2e/MarkdownEditor/table-format.test.tsx +28 -27
  46. package/tests/e2e/MarkdownEditor/undo-redo.test.tsx +22 -21
  47. package/tests/e2e/MarkdownViewer/parity.test.tsx +144 -143
  48. package/tests/e2e/MarkdownViewer/render.test.tsx +20 -19
  49. package/tests/e2e/Stacker/stacker.test.tsx +304 -0
  50. package/tests/unit/Editor/helpers.test.ts +26 -26
  51. package/tests/unit/MarkdownConformance/error-isolation.test.tsx +26 -25
  52. package/tests/unit/MarkdownConformance/indentation.test.tsx +20 -19
  53. package/tests/unit/MarkdownConformance/inline-code-fuzz.test.tsx +255 -0
  54. package/tests/unit/MarkdownConformance/jsx-attributes.test.tsx +39 -38
  55. package/tests/unit/MarkdownConformance/jsx-fuzz.test.tsx +122 -122
  56. package/tests/unit/MarkdownConformance/links.test.tsx +78 -54
  57. package/tests/unit/MarkdownConformance/render-helpers.tsx +60 -60
  58. package/tests/unit/MarkdownEditor/code-info.test.ts +58 -58
  59. package/tests/unit/MarkdownEditor/decorations.test.ts +423 -421
  60. package/tests/unit/MarkdownEditor/editor-ready.test.ts +22 -22
  61. package/tests/unit/MarkdownEditor/html-descriptors.test.ts +70 -70
  62. package/tests/unit/MarkdownEditor/indented-fence.test.ts +80 -80
  63. package/tests/unit/MarkdownEditor/jsx-attr-scan.test.ts +87 -87
  64. package/tests/unit/MarkdownEditor/jsx-block-widget.test.ts +51 -51
  65. package/tests/unit/MarkdownEditor/jsx-tag-grammar.test.ts +63 -63
  66. package/tests/unit/MarkdownEditor/list-indent.test.ts +67 -67
  67. package/tests/unit/MarkdownEditor/slash-commands.test.ts +150 -150
  68. package/tests/unit/MarkdownEditor/table-format.test.ts +67 -67
  69. package/tests/unit/MarkdownEditor/table.test.ts +96 -96
  70. package/tests/unit/MarkdownEditor/triggers.test.ts +167 -167
  71. package/tests/unit/MarkdownEditor/widget-store.test.ts +90 -90
  72. package/tests/unit/MarkdownViewer/callout.test.tsx +42 -42
  73. package/tests/unit/MarkdownViewer/code-highlight.test.tsx +41 -41
  74. package/tests/unit/MarkdownViewer/code-title.test.tsx +45 -45
  75. package/tests/unit/MarkdownViewer/features.test.tsx +129 -129
  76. package/tests/unit/MarkdownViewer/headings.test.tsx +28 -28
  77. package/tests/unit/MarkdownViewer/indented-jsx-children.test.tsx +53 -53
  78. package/tests/unit/MarkdownViewer/jsx-block-nesting.test.tsx +137 -137
  79. package/tests/unit/MarkdownViewer/jsx.test.tsx +188 -188
  80. package/tests/unit/MarkdownViewer/list-bullets.test.tsx +31 -31
  81. package/tests/unit/MarkdownViewer/list-code.test.tsx +45 -45
  82. package/tests/unit/MarkdownViewer/preserve-newlines.test.tsx +109 -109
  83. package/tests/unit/MarkdownViewer/read-time.test.ts +13 -13
  84. package/tests/unit/MarkdownViewer/renderers.test.tsx +75 -75
  85. package/tests/unit/MarkdownViewer/runnable.test.tsx +51 -51
  86. package/tests/unit/MarkdownViewer/ssr.test.tsx +56 -55
  87. package/tests/unit/MarkdownViewer/syntax-highlighting.test.tsx +43 -42
  88. package/tests/unit/MarkdownViewer/tabs-fenced-code.test.tsx +120 -120
  89. package/tests/unit/MarkdownViewer/tabs.test.tsx +83 -82
  90. package/tests/unit/Stacker/drag.test.ts +21 -0
  91. package/tests/unit/Stacker/helpers.test.ts +105 -0
  92. package/tests/unit/Stacker/reducer.test.ts +107 -0
  93. package/tools/duplicate-vector-mappings.json +141 -141
  94. package/tools/glass-export-overrides.json +6 -6
  95. package/tools/icon-parser.ts +41 -40
  96. package/tools/integration-gradient-exports.json +55 -55
  97. package/tools/picto-compare.ts +32 -32
  98. package/tools/picto-merge-urls.ts +19 -19
  99. package/tools/picto-sync.ts +543 -543
  100. package/tools/picto-verify-gradients.ts +50 -50
  101. package/tools/vector-export-nodes.json +975 -975
package/dist/ui.d.ts CHANGED
@@ -6,6 +6,7 @@ import { ButtonProps } from '@mantine/core';
6
6
  import { CodeProps } from '@mantine/core';
7
7
  import { Command } from '@codemirror/view';
8
8
  import { ComponentType } from 'react';
9
+ import { CSSProperties } from 'react';
9
10
  import { default as default_2 } from 'github-slugger';
10
11
  import { EditorSelection } from '@codemirror/state';
11
12
  import { EditorState } from '@codemirror/state';
@@ -24,8 +25,10 @@ import { MantineColor } from '@mantine/core';
24
25
  import { MantineColorScheme } from '@mantine/core';
25
26
  import { MantineFontSize } from '@mantine/core';
26
27
  import { MantineSize } from '@mantine/core';
28
+ import { MantineSpacing } from '@mantine/core';
27
29
  import { MantineThemeOverride } from '@mantine/core';
28
30
  import { PaperProps } from '@mantine/core';
31
+ import * as portals from 'react-reverse-portal';
29
32
  import { PropsWithChildren } from 'react';
30
33
  import { ReactElement } from 'react';
31
34
  import { ReactNode } from 'react';
@@ -152,6 +155,12 @@ export declare const brandDynamiqLight: string;
152
155
 
153
156
  export declare const brandElixir: string;
154
157
 
158
+ export declare const brandEveDark: string;
159
+
160
+ export declare const brandEveLight: string;
161
+
162
+ export declare const brandFacebookMessenger: string;
163
+
155
164
  export declare const brandFeastDark: string;
156
165
 
157
166
  export declare const brandFeastLight: string;
@@ -248,6 +257,8 @@ export declare const brandPolyAIDark: string;
248
257
 
249
258
  export declare const brandPolyAILight: string;
250
259
 
260
+ export declare const brandPydantic: string;
261
+
251
262
  export declare const brandPython: string;
252
263
 
253
264
  export declare const brandReact: string;
@@ -270,12 +281,16 @@ export declare const brandSlack: string;
270
281
 
271
282
  export declare const brandSmolAgents: string;
272
283
 
284
+ export declare const brandSMS: string;
285
+
273
286
  export declare const brandSnowflake: string;
274
287
 
275
288
  export declare const brandSolidJS: string;
276
289
 
277
290
  export declare const brandStackOverflow: string;
278
291
 
292
+ export declare const brandStrands: string;
293
+
279
294
  export declare const brandStripe: string;
280
295
 
281
296
  export declare const brandSurrealDB: string;
@@ -286,6 +301,8 @@ export declare const brandTanStackDark: string;
286
301
 
287
302
  export declare const brandTanStackLight: string;
288
303
 
304
+ export declare const brandTelegram: string;
305
+
289
306
  export declare const brandTencentDark: string;
290
307
 
291
308
  export declare const brandTencentLight: string;
@@ -312,6 +329,8 @@ export declare const brandVSCode: string;
312
329
 
313
330
  export declare const brandWebAssembly: string;
314
331
 
332
+ export declare const brandWhatsApp: string;
333
+
315
334
  export declare const brandWindows: string;
316
335
 
317
336
  export declare const brandXDark: string;
@@ -330,6 +349,28 @@ export declare const brandZedLight: string;
330
349
 
331
350
  export declare const BreadcrumbButton: FC<ButtonProps & ElementProps<"button">>;
332
351
 
352
+ /**
353
+ * Builds the ordered list of rows RichTimeline renders.
354
+ *
355
+ * With no active filter (or no `filter` at all) this is just the sorted entries. When a
356
+ * filter is active AND `getIndex` is supplied, contiguous runs of hidden entries are
357
+ * collapsed into gap rows so the reader can see that history was skipped. Without
358
+ * `getIndex` the hidden entries are simply dropped (no gap markers).
359
+ */
360
+ export declare function buildTimelineDisplayList<T>(options: BuildTimelineDisplayListOptions<T>): RichTimelineDisplayItem<T>[];
361
+
362
+ /** Inputs to {@link buildTimelineDisplayList}. */
363
+ export declare interface BuildTimelineDisplayListOptions<T> {
364
+ entries: T[];
365
+ getKey: (entry: T) => string;
366
+ filter?: (entry: T) => boolean;
367
+ /** Stable position within the source sequence. Required to collapse hidden runs into gaps. */
368
+ getIndex?: (entry: T) => number;
369
+ order?: RichTimelineOrder;
370
+ /** Sort value; takes precedence over `getIndex` when both are provided. */
371
+ getSortKey?: (entry: T) => number;
372
+ }
373
+
333
374
  /**
334
375
  * GitHub-flavoured markdown alert kinds (`> [!kind]`, see GitHub docs).
335
376
  * Other spellings in source are normalised onto this set.
@@ -375,7 +416,6 @@ export declare interface CodeEditorProps extends BoxProps {
375
416
  autoFocus?: boolean;
376
417
  innerProps?: BoxProps;
377
418
  withPadding?: boolean;
378
- ref?: RefObject<EditorView>;
379
419
  }
380
420
 
381
421
  /** React component keyed by lower-cased fenced-code info string. */
@@ -426,6 +466,12 @@ export declare interface ConfirmOptions<T> {
426
466
  onConfirm: (value: T) => void;
427
467
  }
428
468
 
469
+ /**
470
+ * Open ephemeral overlays that would be covered by `topId` — they should close
471
+ * instead of staying mounted behind the new top.
472
+ */
473
+ export declare function coveredEphemeral(items: StackerItem[], topId: string): StackerItem[];
474
+
429
475
  /**
430
476
  * Get a cached style highlighter for the given color scheme
431
477
  */
@@ -471,6 +517,8 @@ export declare const DEFAULT_MARKDOWN_MODE: MarkdownEditMode;
471
517
  */
472
518
  export declare const DEFAULT_SLASH_COMMANDS: readonly SlashCommand[];
473
519
 
520
+ export declare function defaultGapLabel(count: number): string;
521
+
474
522
  export declare type DefaultSort = {
475
523
  [key: string]: unknown;
476
524
  };
@@ -493,6 +541,77 @@ export declare interface DiagramNode {
493
541
  children: RailroadNode[];
494
542
  }
495
543
 
544
+ export declare const Drawer: DrawerCompound;
545
+
546
+ declare function DrawerBody({ lane, children, className, ...rest }: DrawerBodyProps): ReactNode;
547
+
548
+ export declare interface DrawerBodyProps extends Omit<BoxProps, "children"> {
549
+ lane: string;
550
+ children: ReactNode;
551
+ }
552
+
553
+ export declare interface DrawerCompound {
554
+ (props: DrawerProps): ReactNode;
555
+ Lanes: typeof DrawerLanes;
556
+ Lane: typeof DrawerLane;
557
+ Body: typeof DrawerBody;
558
+ }
559
+
560
+ export declare interface DrawerConfig {
561
+ lanes: string[];
562
+ defaultCurrentLane: string;
563
+ pinnedLane?: string;
564
+ }
565
+
566
+ /**
567
+ * Depth transform for a drawer sheet covered by `depth` sheets above it. The
568
+ * transform-origin sits at the free edge and the sheet is pushed outward, so
569
+ * scaling never eats the peek strip and lower sheets stick out from behind.
570
+ */
571
+ export declare function drawerDepthStyle(side: StackerSide, depth: number): CSSProperties;
572
+
573
+ declare function DrawerLane({ lane, label, icon, className, ...rest }: DrawerLaneProps): ReactNode;
574
+
575
+ export declare interface DrawerLaneProps extends Omit<BoxProps, "children"> {
576
+ lane: string;
577
+ label: string;
578
+ icon: string;
579
+ children?: ReactNode;
580
+ }
581
+
582
+ declare function DrawerLanes({ children, className, ...rest }: DrawerLanesProps): ReactNode;
583
+
584
+ export declare interface DrawerLanesProps extends Omit<BoxProps, "children"> {
585
+ children: ReactNode;
586
+ }
587
+
588
+ export declare interface DrawerProps {
589
+ children: ReactNode;
590
+ }
591
+
592
+ export declare function DrawerProvider({ children, state }: DrawerProviderProps): ReactNode;
593
+
594
+ export declare interface DrawerProviderProps {
595
+ children: ReactNode;
596
+ state: DrawerState;
597
+ }
598
+
599
+ export declare interface DrawerState {
600
+ open: boolean;
601
+ currentLane: string;
602
+ activeLane: string;
603
+ progress: number;
604
+ dragging: boolean;
605
+ translate: number;
606
+ expandedHeight: number;
607
+ maxTranslate: number;
608
+ config: DrawerConfig;
609
+ dragRef: (node: HTMLDivElement | null) => void;
610
+ selectLane: (lane: string) => void;
611
+ collapse: () => void;
612
+ portal: portals.HtmlPortalNode;
613
+ }
614
+
496
615
  declare type DynamicNode<T> = ReactNode | ((value: T) => ReactNode);
497
616
 
498
617
  export declare interface EditorController {
@@ -2618,6 +2737,19 @@ export declare function resolveHeadingId(node: SyntaxNode, source: MarkdownSourc
2618
2737
  */
2619
2738
  export declare function resolveImageDescriptor(url: string, alt: string, title?: string, onResolveMedia?: (node: MediaDescriptor) => MediaDescriptor): MediaDescriptor;
2620
2739
 
2740
+ /**
2741
+ * Resolve overlay kind from an explicit variant hint or the viewport.
2742
+ */
2743
+ export declare function resolveKind(variant: StackerKind | undefined, isMobile: boolean): StackerKind;
2744
+
2745
+ /**
2746
+ * Live render kind for the current stack. Empty stacks render nothing. Otherwise:
2747
+ * stack-level `forcedKind` (from the founding overlay's `variant`) → first item's
2748
+ * `variant` → viewport. `forcedKind` keeps a forced kind after the founding
2749
+ * overlay is removed (e.g. ephemeral covered by a push).
2750
+ */
2751
+ export declare function resolveLiveKind(items: StackerItem[], isMobile: boolean, forcedKind?: StackerKind | null): StackerKind | null;
2752
+
2621
2753
  /** Normalise a component registration into its `{ component, block, preserveNewlines }` form. */
2622
2754
  export declare function resolveMarkdownComponent(def: MarkdownComponentDef | undefined): MarkdownComponentConfig | undefined;
2623
2755
 
@@ -2643,6 +2775,286 @@ export declare interface ResponsiveTabsProps extends Omit<TabsProps_2, "children
2643
2775
  selectProps?: Omit<SelectProps, "data" | "value" | "defaultValue" | "onChange">;
2644
2776
  }
2645
2777
 
2778
+ export declare const RichTimeline: RichTimelineCompound;
2779
+
2780
+ export declare const RichTimelineActions: FC<{
2781
+ children: ReactNode;
2782
+ }>;
2783
+
2784
+ export declare const RichTimelineBadge: FC<RichTimelineBadgeProps>;
2785
+
2786
+ declare interface RichTimelineBadgeProps {
2787
+ children: ReactNode;
2788
+ color?: string;
2789
+ }
2790
+
2791
+ export declare const RichTimelineCard: FC<RichTimelineCardProps>;
2792
+
2793
+ /** Card density: `stacked` is a padded multi-line card, `compact` is a single dense row. */
2794
+ export declare type RichTimelineCardLayout = "stacked" | "compact";
2795
+
2796
+ declare interface RichTimelineCardProps {
2797
+ children: ReactNode;
2798
+ layout?: RichTimelineCardLayout;
2799
+ selected?: boolean;
2800
+ invalid?: boolean;
2801
+ staggerIndex?: number;
2802
+ onClick?: () => void;
2803
+ className?: string;
2804
+ padding?: "sm" | "md" | false;
2805
+ }
2806
+
2807
+ /**
2808
+ * RichTimeline children is a render-prop: it receives each display item (entry or gap) plus its
2809
+ * context and returns the row to render. Compose the row from the exported slots, or use the
2810
+ * ready-made `RichTimeline.Event`.
2811
+ */
2812
+ declare type RichTimelineChildren<T> = (props: RichTimelineRenderProps<T>) => ReactNode;
2813
+
2814
+ /**
2815
+ * Public type of the `RichTimeline` compound: callable as a component, with the ready-made
2816
+ * `RichTimeline.Event` and the neutral layout slots attached as static members (`RichTimeline.Card`,
2817
+ * `RichTimeline.Row`, …).
2818
+ */
2819
+ export declare interface RichTimelineCompound {
2820
+ <T>(props: RichTimelineProps<T>): ReactNode;
2821
+ Event: typeof RichTimelineEvent;
2822
+ Marker: typeof RichTimelineMarker;
2823
+ StatusMarker: typeof RichTimelineStatusMarker;
2824
+ IndexMarker: typeof RichTimelineIndexMarker;
2825
+ Card: typeof RichTimelineCard;
2826
+ Gap: typeof RichTimelineGap;
2827
+ Row: typeof RichTimelineRow;
2828
+ Header: typeof RichTimelineHeader;
2829
+ Title: typeof RichTimelineTitle;
2830
+ Badge: typeof RichTimelineBadge;
2831
+ Description: typeof RichTimelineDescription;
2832
+ Meta: typeof RichTimelineMeta;
2833
+ Actions: typeof RichTimelineActions;
2834
+ RowPrimary: typeof RichTimelineRowPrimary;
2835
+ Details: typeof RichTimelineDetails;
2836
+ DetailsToggle: typeof RichTimelineDetailsToggle;
2837
+ Summary: typeof RichTimelineSummary;
2838
+ }
2839
+
2840
+ export declare const RichTimelineDescription: FC<RichTimelineDescriptionProps>;
2841
+
2842
+ declare interface RichTimelineDescriptionProps {
2843
+ children: ReactNode;
2844
+ mono?: boolean;
2845
+ }
2846
+
2847
+ /** Expandable detail region; renders nothing until its row's context is expanded. An inset
2848
+ divider separates it from the card body for manual compositions. */
2849
+ export declare const RichTimelineDetails: FC<RichTimelineDetailsProps>;
2850
+
2851
+ declare interface RichTimelineDetailsProps {
2852
+ children: ReactNode;
2853
+ label?: ReactNode;
2854
+ ctx: RichTimelineItemContext;
2855
+ }
2856
+
2857
+ /** Full-width disclosure control for the foot of an event card — an unmistakable target. */
2858
+ export declare const RichTimelineDetailsToggle: FC<RichTimelineDetailsToggleProps>;
2859
+
2860
+ declare interface RichTimelineDetailsToggleProps {
2861
+ expanded: boolean;
2862
+ onToggle: () => void;
2863
+ /** Label shown while collapsed. */
2864
+ showLabel?: string;
2865
+ /** Label shown while expanded. */
2866
+ hideLabel?: string;
2867
+ className?: string;
2868
+ }
2869
+
2870
+ /** A real data row in the display list. */
2871
+ export declare interface RichTimelineDisplayEntry<T> {
2872
+ kind: "entry";
2873
+ entry: T;
2874
+ key: string;
2875
+ /** Position used to stagger the entrance animation; capped so late rows don't lag. */
2876
+ staggerIndex: number;
2877
+ }
2878
+
2879
+ /**
2880
+ * A collapsed placeholder standing in for a contiguous run of entries that a filter
2881
+ * hid. Only produced when `getIndex` is supplied (see {@link BuildTimelineDisplayListOptions}).
2882
+ */
2883
+ export declare interface RichTimelineDisplayGap {
2884
+ kind: "gap";
2885
+ key: string;
2886
+ hiddenCount: number;
2887
+ /** Inclusive index range the gap covers, when known. */
2888
+ fromIndex?: number;
2889
+ toIndex?: number;
2890
+ }
2891
+
2892
+ /** A row to render: either a real entry or a gap placeholder. */
2893
+ export declare type RichTimelineDisplayItem<T> = RichTimelineDisplayEntry<T> | RichTimelineDisplayGap;
2894
+
2895
+ /**
2896
+ * Stacked event card: a square status marker, a title/badge/summary header, and — when the item
2897
+ * carries `details` — a divider-separated details panel revealed by a full-width footer toggle.
2898
+ */
2899
+ export declare const RichTimelineEvent: FC<RichTimelineEventProps>;
2900
+
2901
+ /** Status badge shown alongside an event's title. */
2902
+ export declare interface RichTimelineEventBadge {
2903
+ label: string;
2904
+ color: string;
2905
+ }
2906
+
2907
+ /** Data model for a {@link RichTimelineEvent} (`RichTimeline.Event`) row. */
2908
+ export declare interface RichTimelineEventItem {
2909
+ id: string;
2910
+ variant: StatusVariant;
2911
+ /** Accessible label for the status marker; falls back to the badge label. */
2912
+ markerLabel?: string;
2913
+ title: ReactNode;
2914
+ badge?: RichTimelineEventBadge;
2915
+ summary?: ReactNode;
2916
+ meta?: ReactNode;
2917
+ actions?: ReactNode;
2918
+ body?: ReactNode;
2919
+ /** Expandable detail content; its presence adds the footer disclosure toggle. */
2920
+ details?: ReactNode;
2921
+ detailsLabel?: string;
2922
+ defaultExpanded?: boolean;
2923
+ /** Activates the whole row (e.g. navigate/select); independent of expanding details. */
2924
+ onActivate?: () => void;
2925
+ }
2926
+
2927
+ export declare interface RichTimelineEventProps {
2928
+ item: RichTimelineEventItem;
2929
+ ctx: RichTimelineItemContext;
2930
+ /** Entrance-animation stagger position; pass `item.staggerIndex` from the RichTimeline render-prop. */
2931
+ staggerIndex?: number;
2932
+ }
2933
+
2934
+ export declare const RichTimelineGap: FC<RichTimelineGapProps>;
2935
+
2936
+ declare interface RichTimelineGapProps {
2937
+ count: number;
2938
+ label?: ReactNode;
2939
+ ariaLabel?: string;
2940
+ hideMarkerOnMobile?: boolean;
2941
+ }
2942
+
2943
+ export declare const RichTimelineHeader: FC<{
2944
+ children: ReactNode;
2945
+ interactive?: boolean;
2946
+ onClick?: () => void;
2947
+ onKeyDown?: (e: React.KeyboardEvent) => void;
2948
+ role?: string;
2949
+ tabIndex?: number;
2950
+ ariaExpanded?: boolean;
2951
+ }>;
2952
+
2953
+ export declare const RichTimelineIndexMarker: FC<RichTimelineIndexMarkerProps>;
2954
+
2955
+ /** Square, monospaced marker showing an entry's position — used by the explorer-style rows. */
2956
+ declare interface RichTimelineIndexMarkerProps {
2957
+ label: ReactNode;
2958
+ selected?: boolean;
2959
+ className?: string;
2960
+ }
2961
+
2962
+ /** Per-row state handed to render-prop children and slot renderers. */
2963
+ export declare interface RichTimelineItemContext {
2964
+ selected: boolean;
2965
+ invalid: boolean;
2966
+ expanded: boolean;
2967
+ toggleExpanded: () => void;
2968
+ cardLayout: RichTimelineCardLayout;
2969
+ /** True when a filter is active anywhere in the list (not whether this row is filtered out). */
2970
+ filtered: boolean;
2971
+ }
2972
+
2973
+ export declare const RichTimelineMarker: FC<RichTimelineMarkerProps>;
2974
+
2975
+ declare interface RichTimelineMarkerProps {
2976
+ children: ReactNode;
2977
+ className?: string;
2978
+ hideOnMobile?: boolean;
2979
+ }
2980
+
2981
+ export declare const RichTimelineMeta: FC<{
2982
+ children: ReactNode;
2983
+ }>;
2984
+
2985
+ /** Direction the display list is sorted in: most recent at the top or at the bottom. */
2986
+ export declare type RichTimelineOrder = "newest-first" | "oldest-first";
2987
+
2988
+ export declare interface RichTimelineProps<T> {
2989
+ /** Source data; sorting, filtering and gap insertion are derived from these. */
2990
+ entries: T[];
2991
+ /** Stable React key for an entry. */
2992
+ getKey: (entry: T) => string;
2993
+ order?: RichTimelineOrder;
2994
+ /** Sort value; takes precedence over `getIndex`. */
2995
+ getSortKey?: (entry: T) => number;
2996
+ /** Returns `true` for entries that should stay visible. */
2997
+ filter?: (entry: T) => boolean;
2998
+ /** Positional index; supplying it lets filtered-out runs collapse into gap rows. */
2999
+ getIndex?: (entry: T) => number;
3000
+ selectedKey?: string;
3001
+ /** Keys to render with the "invalid" treatment. */
3002
+ invalidKeys?: ReadonlySet<string>;
3003
+ /** Keys expanded on first render (expansion is uncontrolled thereafter). */
3004
+ initialExpandedKeys?: ReadonlySet<string>;
3005
+ /** `true`/options forces windowing; omitted, it auto-enables past 100 rows. */
3006
+ virtualize?: boolean | VirtualizeOptions;
3007
+ cardLayout?: RichTimelineCardLayout;
3008
+ hideMarkerOnMobile?: boolean;
3009
+ emptyMessage?: ReactNode;
3010
+ className?: string;
3011
+ /** Render-prop returning the row for each display item (entry or gap). */
3012
+ children: RichTimelineChildren<T>;
3013
+ }
3014
+
3015
+ /** Arguments to the RichTimeline render-prop. */
3016
+ export declare interface RichTimelineRenderProps<T> {
3017
+ item: RichTimelineDisplayItem<T>;
3018
+ ctx: RichTimelineItemContext;
3019
+ }
3020
+
3021
+ export declare const RichTimelineRow: FC<RichTimelineRowProps>;
3022
+
3023
+ export declare const RichTimelineRowPrimary: FC<{
3024
+ children: ReactNode;
3025
+ }>;
3026
+
3027
+ declare interface RichTimelineRowProps {
3028
+ children: ReactNode;
3029
+ staggerIndex?: number;
3030
+ align?: "start" | "center";
3031
+ hideMarkerOnMobile?: boolean;
3032
+ className?: string;
3033
+ }
3034
+
3035
+ export declare const RichTimelineStatusMarker: FC<RichTimelineStatusMarkerProps>;
3036
+
3037
+ /** Square, opaque status chip (success/warning/error/neutral) — the marker for event rows. */
3038
+ declare interface RichTimelineStatusMarkerProps {
3039
+ variant: StatusVariant;
3040
+ /** Accessible name. When omitted the chip is treated as decorative (`aria-hidden`). */
3041
+ label?: string;
3042
+ className?: string;
3043
+ }
3044
+
3045
+ /** Optional "Showing N of M" / "N entries" caption; hidden when there's nothing useful to say. */
3046
+ export declare const RichTimelineSummary: FC<RichTimelineSummaryProps>;
3047
+
3048
+ declare interface RichTimelineSummaryProps {
3049
+ filtered: boolean;
3050
+ matchCount: number;
3051
+ totalCount: number;
3052
+ }
3053
+
3054
+ export declare const RichTimelineTitle: FC<{
3055
+ children: ReactNode;
3056
+ }>;
3057
+
2646
3058
  export declare function SectionTitle({ order, kicker, description, kickerProps, titleProps, descriptionProps, children, ...boxProps }: PropsWithChildren<SectionTitle>): ReactElement;
2647
3059
 
2648
3060
  export declare interface SectionTitle extends BoxProps {
@@ -2678,6 +3090,12 @@ export declare const setMarkdownEditorReady: StateEffectType<boolean>;
2678
3090
  */
2679
3091
  export declare const setMarkdownMode: StateEffectType<MarkdownEditMode>;
2680
3092
 
3093
+ /**
3094
+ * Decide whether a released drag should dismiss the drawer: either a fast flick
3095
+ * towards the edge, or dragged past halfway.
3096
+ */
3097
+ export declare function shouldDismiss(closeAmount: number, extent: number, towardsVelocity: number): boolean;
3098
+
2681
3099
  export declare function Since({ v, prefix, ...props }: SinceProps): ReactNode;
2682
3100
 
2683
3101
  export declare interface SinceProps extends Omit<BadgeProps, "children"> {
@@ -2796,10 +3214,146 @@ export declare interface SpinnerProps extends BoxProps {
2796
3214
  title?: string;
2797
3215
  }
2798
3216
 
3217
+ export declare const STACKER_INITIAL_STATE: StackerState;
3218
+
3219
+ export declare type StackerAction = {
3220
+ type: "OPEN";
3221
+ item: StackerItem;
3222
+ } | {
3223
+ type: "CLOSE";
3224
+ id: string;
3225
+ } | {
3226
+ type: "CLOSE_ALL";
3227
+ } | {
3228
+ type: "REMOVE";
3229
+ id: string;
3230
+ } | {
3231
+ type: "UPDATE";
3232
+ id: string;
3233
+ patch: Partial<StackerSettings>;
3234
+ };
3235
+
3236
+ /** Value exposed by {@link useStacker}. */
3237
+ export declare interface StackerContextValue {
3238
+ /** Push an overlay onto the stack. Returns the overlay id. */
3239
+ open: (settings?: StackerSettings) => string;
3240
+ /** Close an overlay by id, or the top overlay when the id is omitted. */
3241
+ close: (id?: string) => void;
3242
+ /** Close every open overlay. */
3243
+ closeAll: () => void;
3244
+ /** Merge new settings into an overlay on the stack. */
3245
+ update: (id: string, patch: Partial<StackerSettings>) => void;
3246
+ /** Current stack, ordered bottom-to-top. */
3247
+ stack: StackerItem[];
3248
+ /** Live render kind from the viewport and first stack item, or null when empty. */
3249
+ kind: StackerKind | null;
3250
+ }
3251
+
3252
+ /** A single entry on the stack. */
3253
+ export declare interface StackerItem {
3254
+ id: string;
3255
+ /** False while the overlay plays its exit transition before removal. */
3256
+ opened: boolean;
3257
+ settings: StackerSettings;
3258
+ }
3259
+
3260
+ /** How an overlay is rendered: a centered modal or an edge-anchored drawer. */
3261
+ export declare type StackerKind = "modal" | "drawer";
3262
+
3263
+ /**
3264
+ * Provides {@link useStacker}. Overlays render as modals on desktop and drawers
3265
+ * on mobile (or the forced `variant`), stack like Mantine's modal manager, and
3266
+ * the page content scales back slightly while a drawer stack is open.
3267
+ */
3268
+ export declare function StackerProvider({ children, mobileQuery, zIndex, }: StackerProviderProps): ReactNode;
3269
+
3270
+ export declare interface StackerProviderProps {
3271
+ children?: ReactNode;
3272
+ /** Viewport query selecting the drawer kind. @default "(max-width: 48em)" */
3273
+ mobileQuery?: string;
3274
+ /** Base z-index for the stack. @default 200 */
3275
+ zIndex?: number;
3276
+ }
3277
+
3278
+ /**
3279
+ * Pure state transitions for the stack. Closing an overlay flips its `opened`
3280
+ * flag (so it can play an exit transition); a later `REMOVE` drops it once the
3281
+ * transition finishes.
3282
+ */
3283
+ export declare function stackerReducer(state: StackerState, action: StackerAction): StackerState;
3284
+
3285
+ /** Options accepted by {@link StackerContextValue.open}. */
3286
+ export declare interface StackerSettings {
3287
+ /** Explicit id. Defaults to a random id. Opening an id already on the stack is a no-op. */
3288
+ id?: string;
3289
+ /** Heading rendered in the overlay header. */
3290
+ title?: ReactNode;
3291
+ /** Secondary text rendered underneath the title. */
3292
+ subtitle?: ReactNode;
3293
+ /** Overlay body content. */
3294
+ children?: ReactNode;
3295
+ /**
3296
+ * Force this overlay kind instead of choosing from the viewport. When set on
3297
+ * the founding overlay of a stack, the kind is remembered for the whole stack
3298
+ * even if that overlay is later removed (e.g. ephemeral). Later items' hints
3299
+ * are ignored while the stack is non-empty.
3300
+ */
3301
+ variant?: StackerKind;
3302
+ /** Edge the drawer is anchored to. Ignored for modals. @default "right" */
3303
+ side?: StackerSide;
3304
+ /** Allow dragging the drawer towards its edge to dismiss it. Ignored for modals. @default false */
3305
+ draggable?: boolean;
3306
+ /** Content area size — modal width or drawer extent. Defaults: modal `"lg"`, drawer `"md"`. */
3307
+ size?: MantineSize | (string & {}) | number;
3308
+ /** Header/body padding. @default "xl" */
3309
+ padding?: MantineSpacing;
3310
+ /** Render the header close button. @default true */
3311
+ withCloseButton?: boolean;
3312
+ /** Close this overlay with Escape while it is on top. @default true */
3313
+ closeOnEscape?: boolean;
3314
+ /** Close this overlay by clicking the scrim while it is on top. @default true */
3315
+ closeOnClickOutside?: boolean;
3316
+ /**
3317
+ * When true, this overlay is closed (and removed after its exit) as soon as
3318
+ * another overlay is pushed on top of it — it never stays covered/peeking.
3319
+ * @default false
3320
+ */
3321
+ ephemeral?: boolean;
3322
+ /** Called when the overlay begins closing. */
3323
+ onClose?: () => void;
3324
+ }
3325
+
3326
+ /** Edge a drawer is anchored to. */
3327
+ export declare type StackerSide = "left" | "right" | "top" | "bottom";
3328
+
3329
+ export declare interface StackerState {
3330
+ /**
3331
+ * Forced kind from the stack-founding overlay's `variant`. Survives removal of
3332
+ * that overlay (e.g. ephemeral covered) until the stack is empty.
3333
+ */
3334
+ forcedKind: StackerKind | null;
3335
+ /** Stack entries, ordered bottom-to-top. `opened: false` = playing exit. */
3336
+ items: StackerItem[];
3337
+ }
3338
+
2799
3339
  export declare type StateFields = {
2800
3340
  [prop: string]: StateField<any>;
2801
3341
  };
2802
3342
 
3343
+ /** A circular, tinted status badge — a status glyph (success/warning/error/neutral) on a tone chip. */
3344
+ export declare const StatusIcon: FC<StatusIconProps>;
3345
+
3346
+ export declare interface StatusIconProps extends Omit<BoxProps, "children"> {
3347
+ variant: StatusVariant;
3348
+ size?: StatusIconSize;
3349
+ /** Accessible name. When omitted the icon is treated as decorative (`aria-hidden`). */
3350
+ label?: string;
3351
+ }
3352
+
3353
+ export declare type StatusIconSize = "sm" | "md" | "xl";
3354
+
3355
+ export declare type StatusVariant = "success" | "warning" | "error" | "neutral";
3356
+
2803
3357
  /**
2804
3358
  * A vertical timeline whose steps expand one at a time. Each step shows a
2805
3359
  * numbered bullet and a clickable title; activating a step collapses the others
@@ -2887,6 +3441,9 @@ export declare interface ThemedImageProps extends ImageProps {
2887
3441
  darkSrc?: string;
2888
3442
  }
2889
3443
 
3444
+ /** The top-most open item, or undefined when nothing is open. */
3445
+ export declare function topOpened(items: StackerItem[]): StackerItem | undefined;
3446
+
2890
3447
  /** Trim `{#id}` from the end of a heading source range (returns new exclusive `titleTo`). */
2891
3448
  export declare function trimCustomHeadingIdFromRange(source: {
2892
3449
  slice(from: number, to: number): string;
@@ -2900,6 +3457,10 @@ export declare function trimCustomHeadingIdFromRange(source: {
2900
3457
  */
2901
3458
  export declare function useConfirmation<T = void>(options: ConfirmOptions<T>): (value?: T) => void;
2902
3459
 
3460
+ export declare function useDrawer(config: DrawerConfig): DrawerState;
3461
+
3462
+ export declare function useDrawerState(): DrawerState;
3463
+
2903
3464
  export declare function useEditor(options?: EditorOptions): EditorController;
2904
3465
 
2905
3466
  /**
@@ -2951,6 +3512,12 @@ export declare function useSort<T = DefaultSort>(options?: SortOptions<T>): Sort
2951
3512
  */
2952
3513
  export declare function useStable<T extends AnyFn>(callback: T): T;
2953
3514
 
3515
+ /**
3516
+ * Access the nearest {@link StackerProvider}. Multiple providers can be nested;
3517
+ * each hook call resolves to the closest one.
3518
+ */
3519
+ export declare function useStacker(): StackerContextValue;
3520
+
2954
3521
  /**
2955
3522
  * A state used to track an active/inactive switch state (boolean)
2956
3523
  *
@@ -2984,6 +3551,17 @@ export declare interface VideoPlayerProps extends BoxProps {
2984
3551
  videoProps?: Omit<VideoHTMLAttributes<HTMLVideoElement>, "autoPlay" | "loop" | "poster" | "controls" | "src" | "muted">;
2985
3552
  }
2986
3553
 
3554
+ /** Tuning passed through to TanStack Virtual when the list is windowed. */
3555
+ export declare interface VirtualizeOptions {
3556
+ /** Estimated px height of an entry row. */
3557
+ estimateSize?: number;
3558
+ /** Estimated px height of a gap row. */
3559
+ gapEstimateSize?: number;
3560
+ overscan?: number;
3561
+ /** Height of the scroll viewport. */
3562
+ scrollHeight?: number | string;
3563
+ }
3564
+
2987
3565
  /**
2988
3566
  * The default UI Kit editor theme
2989
3567
  */