@surrealdb/ui 2.1.1 → 3.0.0-beta.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/README.md +1 -1
- package/dist/fonts.d.ts +1 -1
- package/dist/icons.d.ts +3 -1
- package/dist/icons.js +104 -103
- package/dist/icons.js.map +1 -1
- package/dist/ui.css +1 -1
- package/dist/ui.d.ts +608 -34
- package/dist/ui.js +10034 -8199
- package/dist/ui.js.map +1 -1
- package/package.json +3 -1
- package/res/_mixins.scss +5 -3
package/dist/ui.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { CodeProps } from '@mantine/core';
|
|
|
14
14
|
import { Command } from '@codemirror/view';
|
|
15
15
|
import { ComponentPropsWithoutRef } from 'react';
|
|
16
16
|
import { ComponentType } from 'react';
|
|
17
|
+
import { Context } from 'react';
|
|
17
18
|
import { CSSProperties } from 'react';
|
|
18
19
|
import { CSSVariablesResolver } from '@mantine/core';
|
|
19
20
|
import { default as default_2 } from 'github-slugger';
|
|
@@ -39,6 +40,7 @@ import { MantineRadius } from '@mantine/core';
|
|
|
39
40
|
import { MantineSize } from '@mantine/core';
|
|
40
41
|
import { MantineSpacing } from '@mantine/core';
|
|
41
42
|
import { MantineThemeOverride } from '@mantine/core';
|
|
43
|
+
import { MantineTransition } from '@mantine/core';
|
|
42
44
|
import { PolymorphicFactory } from '@mantine/core';
|
|
43
45
|
import * as portals from 'react-reverse-portal';
|
|
44
46
|
import { PropsWithChildren } from 'react';
|
|
@@ -53,18 +55,31 @@ import { TabsListProps } from '@mantine/core';
|
|
|
53
55
|
import { TabsProps as TabsProps_2 } from '@mantine/core';
|
|
54
56
|
import { TabsTabProps } from '@mantine/core';
|
|
55
57
|
import { TextProps } from '@mantine/core';
|
|
56
|
-
import { TimelineProps } from '@mantine/core';
|
|
57
58
|
import { TitleOrder } from '@mantine/core';
|
|
58
59
|
import { TitleProps } from '@mantine/core';
|
|
59
60
|
import { Tree } from '@lezer/common';
|
|
61
|
+
import { UnstyledButtonProps } from '@mantine/core';
|
|
60
62
|
import { VariantColorsResolver } from '@mantine/core';
|
|
61
63
|
import { VideoHTMLAttributes } from 'react';
|
|
62
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Accent — the product colour of the surrounding region.
|
|
67
|
+
*
|
|
68
|
+
* Not a hue of its own: each shade names a token that `[data-surreal-accent]`
|
|
69
|
+
* points at Lilac (Database, and the default) or Violet (Agent Memory). Ask for
|
|
70
|
+
* it with `color="accent"` where a control should carry the product's identity;
|
|
71
|
+
* an uncoloured control stays neutral.
|
|
72
|
+
*/
|
|
73
|
+
export declare const ACCENT: MantineColorsTuple;
|
|
74
|
+
|
|
63
75
|
/**
|
|
64
76
|
* A keybind used to accept a completion
|
|
65
77
|
*/
|
|
66
78
|
export declare const acceptWithTab: KeyBinding;
|
|
67
79
|
|
|
80
|
+
/** The tile types a context can use and the viewer may see: what an add drawer offers. */
|
|
81
|
+
export declare function addableTiles<Context>(registry: TileRegistry<Context>, context: Context): TileRegistry<Context>;
|
|
82
|
+
|
|
68
83
|
/**
|
|
69
84
|
* Add cursor above the current line
|
|
70
85
|
*/
|
|
@@ -80,6 +95,23 @@ export declare const addCursorBelow: Command;
|
|
|
80
95
|
*/
|
|
81
96
|
export declare const addCursorVerticallyKeymap: readonly KeyBinding[];
|
|
82
97
|
|
|
98
|
+
/** Adds a tile in the first free spot that holds it. */
|
|
99
|
+
export declare function addTile(tiles: readonly TileValue[], tile: Omit<TileValue, "x" | "y" | "w" | "h">, size: TileSize, columns: number): TileValue[];
|
|
100
|
+
|
|
101
|
+
export declare interface AddTileOptions<Context> {
|
|
102
|
+
registry: TileRegistry<Context>;
|
|
103
|
+
tiles: readonly TileValue[];
|
|
104
|
+
context: Context;
|
|
105
|
+
onAdd: (type: string, config?: Record<string, unknown>) => void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Searches the tiles the viewer may add and adds the one chosen, asking for its settings
|
|
110
|
+
* first when its type has a configurator. Tiles the viewer may not see are not offered,
|
|
111
|
+
* and those already on the grid sink to the bottom, marked as added.
|
|
112
|
+
*/
|
|
113
|
+
export declare function AddTilePicker<Context>({ registry, tiles, context, onAdd, }: AddTileOptions<Context>): ReactNode;
|
|
114
|
+
|
|
83
115
|
declare type AnyFn = (...rest: any[]) => any;
|
|
84
116
|
|
|
85
117
|
/**
|
|
@@ -133,6 +165,9 @@ export declare interface ArrowButtonProps extends ButtonProps, ElementProps<"but
|
|
|
133
165
|
external?: boolean;
|
|
134
166
|
}
|
|
135
167
|
|
|
168
|
+
/** The tile types a context can use. */
|
|
169
|
+
export declare function availableTiles<Context>(registry: TileRegistry<Context>, context: Context): TileRegistry<Context>;
|
|
170
|
+
|
|
136
171
|
export declare interface BooleanHandle {
|
|
137
172
|
open: () => void;
|
|
138
173
|
close: () => void;
|
|
@@ -484,6 +519,9 @@ export declare interface BuildTimelineDisplayListOptions<T> {
|
|
|
484
519
|
*/
|
|
485
520
|
declare type CalloutKind = "note" | "tip" | "important" | "warning" | "caution";
|
|
486
521
|
|
|
522
|
+
/** Whether another tile of the type may be added to the tiles. */
|
|
523
|
+
export declare function canAddTile<Context>(type: TileType<never, Context>, tiles: readonly TileValue[]): boolean;
|
|
524
|
+
|
|
487
525
|
export declare const CDN_ID_PATTERN: RegExp;
|
|
488
526
|
|
|
489
527
|
export declare const CDN_URL_PATTERN: RegExp;
|
|
@@ -508,6 +546,9 @@ declare interface ChoiceNode {
|
|
|
508
546
|
children: RailroadNode[];
|
|
509
547
|
}
|
|
510
548
|
|
|
549
|
+
/** Keeps a size within a tile type's limits and the grid's width. */
|
|
550
|
+
export declare function clampSize(size: TileSize, limits: TileLimits, columns: number): TileSize;
|
|
551
|
+
|
|
511
552
|
export declare function clsx(...args: unknown[]): string;
|
|
512
553
|
|
|
513
554
|
/** A read-only code panel with a caption and a copy button. */
|
|
@@ -634,6 +675,9 @@ declare interface CommentNode {
|
|
|
634
675
|
*/
|
|
635
676
|
export declare const commonExtensions: () => Extension;
|
|
636
677
|
|
|
678
|
+
/** Lifts every tile as far up as it can go, so no tile leaves a gap above it. */
|
|
679
|
+
export declare function compactTiles(tiles: readonly TileValue[]): TileValue[];
|
|
680
|
+
|
|
637
681
|
export declare function ConfirmationProvider({ enterConfirms, children, }: PropsWithChildren<ConfirmationProviderProps>): ReactNode;
|
|
638
682
|
|
|
639
683
|
export declare interface ConfirmationProviderProps {
|
|
@@ -654,6 +698,9 @@ export declare interface ConfirmOptions<T> {
|
|
|
654
698
|
onConfirm: (value: T) => void;
|
|
655
699
|
}
|
|
656
700
|
|
|
701
|
+
/** The number of rows the tiles reach down to. */
|
|
702
|
+
export declare function countRows(tiles: readonly TileRect[]): number;
|
|
703
|
+
|
|
657
704
|
/**
|
|
658
705
|
* Open ephemeral overlays that would be covered by `topId` — they should close
|
|
659
706
|
* instead of staying mounted behind the new top.
|
|
@@ -685,6 +732,9 @@ export declare function createSerializedState(doc: string): EditorStateSnapshot;
|
|
|
685
732
|
*/
|
|
686
733
|
export declare function createStyleHighlighter(style?: HighlightStyle): Highlighter;
|
|
687
734
|
|
|
735
|
+
/** Adds a tile of the type at its default size, in the first free spot. */
|
|
736
|
+
export declare function createTile<Context>(registry: TileRegistry<Context>, tiles: readonly TileValue[], typeId: string, config?: Record<string, unknown>, columns?: number): TileValue[];
|
|
737
|
+
|
|
688
738
|
/**
|
|
689
739
|
* An island is made by setting the CSS `color-scheme` property, never by
|
|
690
740
|
* stamping a data attribute. See doc/adr/0001-light-dark-color-scheme-islands.md.
|
|
@@ -724,6 +774,9 @@ export declare type DefaultSort = {
|
|
|
724
774
|
[key: string]: unknown;
|
|
725
775
|
};
|
|
726
776
|
|
|
777
|
+
/** Erases a tile type's config so types of different configs can share a registry. */
|
|
778
|
+
export declare function defineTile<Config, Context>(type: TileType<Config, Context>): TileType<never, Context>;
|
|
779
|
+
|
|
727
780
|
/** A flat, square disclosure panel for collapsible content. */
|
|
728
781
|
export declare const Details: MantineComponent<DetailsFactory>;
|
|
729
782
|
|
|
@@ -799,6 +852,9 @@ export declare type DisplayStylesNames = "root";
|
|
|
799
852
|
|
|
800
853
|
export declare const Drawer: DrawerCompound;
|
|
801
854
|
|
|
855
|
+
/** Every drawer transition, by side, for a `Drawer` whose side is known up front. */
|
|
856
|
+
export declare const DRAWER_TRANSITIONS: Record<TransitionSide, MantineTransition>;
|
|
857
|
+
|
|
802
858
|
declare function DrawerBody({ lane, children, className, ...rest }: DrawerBodyProps): ReactNode;
|
|
803
859
|
|
|
804
860
|
export declare interface DrawerBodyProps extends Omit<BoxProps, "children"> {
|
|
@@ -868,8 +924,34 @@ export declare interface DrawerState {
|
|
|
868
924
|
portal: portals.HtmlPortalNode;
|
|
869
925
|
}
|
|
870
926
|
|
|
927
|
+
/** The drawer transition for the side it opens from. */
|
|
928
|
+
export declare function drawerTransition(side: TransitionSide): MantineTransition;
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* The variables `SURREAL_TRANSITIONS.drawer` reads for the side a drawer opens
|
|
932
|
+
* from, which the kit's `Drawer` sets from its `position`: where it starts, and
|
|
933
|
+
* the shadow its surface bleeds past that edge with.
|
|
934
|
+
*/
|
|
935
|
+
export declare function drawerTransitionVars(side: TransitionSide): Record<string, string>;
|
|
936
|
+
|
|
871
937
|
declare type DynamicNode<T> = ReactNode | ((value: T) => ReactNode);
|
|
872
938
|
|
|
939
|
+
/**
|
|
940
|
+
* Easing for a layer that arrives with weight: it overshoots its final size a
|
|
941
|
+
* touch and settles back ("ease back"). Modals and drawers.
|
|
942
|
+
*/
|
|
943
|
+
export declare const EASE_BACK = "cubic-bezier(0.34, 1.56, 0.64, 1)";
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* The ease back for a drawer: the same settle, far gentler. A drawer travels its
|
|
947
|
+
* whole width, so the modal's overshoot would carry it tens of pixels past its
|
|
948
|
+
* rest; this one carries it a few, early, and eases the rest of the way in slowly.
|
|
949
|
+
*/
|
|
950
|
+
export declare const EASE_BACK_SUBTLE = "cubic-bezier(0.16, 1.18, 0.3, 1)";
|
|
951
|
+
|
|
952
|
+
/** Easing for a layer that simply arrives: quick out of the gate, no overshoot. */
|
|
953
|
+
export declare const EASE_OUT = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
954
|
+
|
|
873
955
|
export declare interface EditorController {
|
|
874
956
|
ref: RefObject<HTMLDivElement | null>;
|
|
875
957
|
mounted: boolean;
|
|
@@ -977,8 +1059,8 @@ export declare function extractTest(input: string): ExtractedCode;
|
|
|
977
1059
|
/**
|
|
978
1060
|
* The short uppercase line that names a section or product above a title.
|
|
979
1061
|
*
|
|
980
|
-
*
|
|
981
|
-
*
|
|
1062
|
+
* Tracked-out uppercase in the secondary text colour, so it names what follows
|
|
1063
|
+
* without competing with it. Pass `color` to carry a product hue.
|
|
982
1064
|
*/
|
|
983
1065
|
export declare const Eyebrow: MantinePolymorphicComponent<EyebrowFactory>;
|
|
984
1066
|
|
|
@@ -997,7 +1079,7 @@ export declare type EyebrowFactory = PolymorphicFactory<{
|
|
|
997
1079
|
export declare interface EyebrowProps extends BoxProps, StylesApiProps<EyebrowFactory>, ElementProps<"p"> {
|
|
998
1080
|
/** Text size. @default `"xs"` */
|
|
999
1081
|
size?: MantineSize;
|
|
1000
|
-
/**
|
|
1082
|
+
/** Draws the eyebrow in a palette colour instead of the secondary text colour. */
|
|
1001
1083
|
color?: MantineColor;
|
|
1002
1084
|
}
|
|
1003
1085
|
|
|
@@ -1006,6 +1088,12 @@ export declare type EyebrowStylesNames = "root";
|
|
|
1006
1088
|
/** Case-insensitive filter over command titles and keywords. */
|
|
1007
1089
|
export declare function filterSlashCommands(commands: readonly SlashCommand[], query: string): SlashCommand[];
|
|
1008
1090
|
|
|
1091
|
+
/** Finds the first cell, reading left to right and top to bottom, a rectangle fits in. */
|
|
1092
|
+
export declare function findFreeSpot(tiles: readonly TileRect[], size: TileSize, columns: number): {
|
|
1093
|
+
x: number;
|
|
1094
|
+
y: number;
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1009
1097
|
/** Human-readable reading time label, e.g. `5 min read`. */
|
|
1010
1098
|
export declare function formatMarkdownReadTime(markdown: string): string;
|
|
1011
1099
|
|
|
@@ -1028,6 +1116,17 @@ export declare function getMarkdownEditorReady(state: EditorState): boolean;
|
|
|
1028
1116
|
*/
|
|
1029
1117
|
export declare function getMarkdownMode(state: EditorState): MarkdownEditMode;
|
|
1030
1118
|
|
|
1119
|
+
/**
|
|
1120
|
+
* Graphite — the near-grey neutral used for every surface.
|
|
1121
|
+
*
|
|
1122
|
+
* The dark end is the page: `#0B0A10` canvas, `#131218` surface and `#18171D`
|
|
1123
|
+
* raised. The light end is the same ramp read the other way, so a light page and
|
|
1124
|
+
* a dark one keep the same calm, barely tinted grey.
|
|
1125
|
+
*
|
|
1126
|
+
* Never use Graphite for text; text roles live on {@link OBSIDIAN}.
|
|
1127
|
+
*/
|
|
1128
|
+
export declare const GRAPHITE: MantineColorsTuple;
|
|
1129
|
+
|
|
1031
1130
|
/** A document heading with slug id, plain text, and depth. */
|
|
1032
1131
|
declare interface Heading {
|
|
1033
1132
|
id: string;
|
|
@@ -1472,6 +1571,8 @@ export declare const iconSidekick: string;
|
|
|
1472
1571
|
|
|
1473
1572
|
export declare const iconSpectron: string;
|
|
1474
1573
|
|
|
1574
|
+
export declare const iconSplit: string;
|
|
1575
|
+
|
|
1475
1576
|
export declare const iconStar: string;
|
|
1476
1577
|
|
|
1477
1578
|
export declare const iconStarPlus: string;
|
|
@@ -1561,6 +1662,9 @@ export declare function isCDNId(query: string): boolean;
|
|
|
1561
1662
|
/** True when the registered component declares `block: true`. */
|
|
1562
1663
|
export declare function isMarkdownComponentBlock(components: MarkdownComponents | undefined, name: string): boolean;
|
|
1563
1664
|
|
|
1665
|
+
/** Whether two layouts hold the same tiles in the same places, with the same configs. */
|
|
1666
|
+
export declare function isSameLayout(a: readonly TileValue[], b: readonly TileValue[]): boolean;
|
|
1667
|
+
|
|
1564
1668
|
/**
|
|
1565
1669
|
* Returns whether the given URL points at a recognised video container.
|
|
1566
1670
|
*/
|
|
@@ -1571,9 +1675,18 @@ export declare type JsxMode = "render" | "throw" | "graceful" | "omit";
|
|
|
1571
1675
|
|
|
1572
1676
|
declare type Language = "csharp" | "rust" | "javascript" | "typescript" | "surrealql" | "json" | "yaml" | "java" | "go" | "python" | "html" | "bash" | "cli" | "php" | "markdown" | "syntax";
|
|
1573
1677
|
|
|
1574
|
-
/**
|
|
1678
|
+
/**
|
|
1679
|
+
* Lays the specified tiles out in order, at the type's default size unless a spec gives one.
|
|
1680
|
+
* Specs of a type the registry does not hold are skipped, so a preset can name tiles only
|
|
1681
|
+
* some contexts have.
|
|
1682
|
+
*/
|
|
1683
|
+
export declare function layoutTiles<Context>(registry: TileRegistry<Context>, specs: readonly TileSpec[], columns?: number): TileValue[];
|
|
1684
|
+
|
|
1685
|
+
/** Surreal Lilac — the Database product color, and the default accent. */
|
|
1575
1686
|
export declare const LILAC: MantineColorsTuple;
|
|
1576
1687
|
|
|
1688
|
+
export declare function limitsOfTile<Context>(registry: TileRegistry<Context>, type: string): TileLimits | undefined;
|
|
1689
|
+
|
|
1577
1690
|
/**
|
|
1578
1691
|
* A whole card that is one link.
|
|
1579
1692
|
*
|
|
@@ -2070,6 +2183,12 @@ export declare class MiniController {
|
|
|
2070
2183
|
executeQuery(query: string): void;
|
|
2071
2184
|
}
|
|
2072
2185
|
|
|
2186
|
+
/** Moves a tile to a cell, displacing what is in its way. Its size is kept. */
|
|
2187
|
+
export declare function moveTile(tiles: readonly TileValue[], id: string, to: {
|
|
2188
|
+
x: number;
|
|
2189
|
+
y: number;
|
|
2190
|
+
}, columns: number): TileValue[];
|
|
2191
|
+
|
|
2073
2192
|
/**
|
|
2074
2193
|
* Drops a run of text to the secondary color.
|
|
2075
2194
|
*
|
|
@@ -2099,6 +2218,12 @@ declare interface NonTerminalNode {
|
|
|
2099
2218
|
text: string;
|
|
2100
2219
|
}
|
|
2101
2220
|
|
|
2221
|
+
/**
|
|
2222
|
+
* Makes stored tiles safe to draw: sizes are brought within each type's limits,
|
|
2223
|
+
* repeated ids and unknown types are dropped, and overlaps are resolved.
|
|
2224
|
+
*/
|
|
2225
|
+
export declare function normaliseTiles(tiles: readonly TileValue[], limitsOf: (type: string) => TileLimits | undefined, columns: number): TileValue[];
|
|
2226
|
+
|
|
2102
2227
|
/** A callout that flags a note, a tip, or something important, risky or dangerous. */
|
|
2103
2228
|
export declare const Note: MantineComponent<NoteFactory>;
|
|
2104
2229
|
|
|
@@ -2127,20 +2252,15 @@ export declare interface NoteProps extends NoteAlertProps, StylesApiProps<NoteFa
|
|
|
2127
2252
|
export declare type NoteStylesNames = "root" | "title" | "icon" | "label";
|
|
2128
2253
|
|
|
2129
2254
|
/**
|
|
2130
|
-
* Obsidian — the purple-tinted neutral
|
|
2131
|
-
*
|
|
2132
|
-
* Never use Obsidian for text; text roles live on {@link SLATE}.
|
|
2133
|
-
* Anchors come from the brand toolkit: `#F9FAFE` light surface, `#DADFE7`, and
|
|
2134
|
-
* three dark steps: `#242132` paper, `#191723` page and `#0C0C12`, which is
|
|
2135
|
-
* reserved for code.
|
|
2255
|
+
* Obsidian — the purple-tinted neutral for text, lines and interactive fills.
|
|
2136
2256
|
*
|
|
2137
|
-
*
|
|
2138
|
-
*
|
|
2139
|
-
*
|
|
2140
|
-
* reach it.
|
|
2257
|
+
* Text, hairlines, the neutral action fill and the tracks of selection
|
|
2258
|
+
* controls read Obsidian. Surfaces never do: they live on {@link GRAPHITE}, so a
|
|
2259
|
+
* page stays a quiet grey while what sits on it carries the brand's tint.
|
|
2141
2260
|
*
|
|
2142
|
-
*
|
|
2143
|
-
*
|
|
2261
|
+
* Every shade is taken from the brand toolkit: `#F1F1F6` light, `#B0AEC6`
|
|
2262
|
+
* bright, `#8986A2` text, `#706D8F` light, `#4A4761` mid, `#242132` and
|
|
2263
|
+
* `#0F0D19` dark.
|
|
2144
2264
|
*/
|
|
2145
2265
|
export declare const OBSIDIAN: MantineColorsTuple;
|
|
2146
2266
|
|
|
@@ -2156,6 +2276,9 @@ declare interface OptionalNode {
|
|
|
2156
2276
|
child: RailroadNode;
|
|
2157
2277
|
}
|
|
2158
2278
|
|
|
2279
|
+
/** Lays tiles out left to right in the order given, wrapping onto a new row when one does not fit. */
|
|
2280
|
+
export declare function packTiles(drafts: readonly TileDraft[], columns: number): TileValue[];
|
|
2281
|
+
|
|
2159
2282
|
/**
|
|
2160
2283
|
* Parse a fenced code info string such as `surql runnable="SELECT 1"`,
|
|
2161
2284
|
* `js title="Example"`, or `ts runnable` into a language plus an attribute map.
|
|
@@ -2736,6 +2859,9 @@ export declare type RailroadDiagramStylesNames = "root" | "diagram" | "terminal"
|
|
|
2736
2859
|
|
|
2737
2860
|
export declare type RailroadNode = DiagramNode | SequenceNode | TerminalNode | NonTerminalNode | OptionalNode | ChoiceNode | OneOrMoreNode | ZeroOrMoreNode | CommentNode;
|
|
2738
2861
|
|
|
2862
|
+
/** Resizes a tile within its limits and the grid, displacing what is in its way. */
|
|
2863
|
+
export declare function resizeTile(tiles: readonly TileValue[], id: string, size: TileSize, limits: TileLimits, columns: number): TileValue[];
|
|
2864
|
+
|
|
2739
2865
|
/**
|
|
2740
2866
|
* Normalises a renderer registration, so a bare component and a config object
|
|
2741
2867
|
* are handled identically downstream.
|
|
@@ -3344,11 +3470,11 @@ export declare interface SlashStore {
|
|
|
3344
3470
|
}
|
|
3345
3471
|
|
|
3346
3472
|
/**
|
|
3347
|
-
* Slate — the blue-tinted neutral
|
|
3473
|
+
* Slate — the blue-tinted neutral that painted text before 3.0.
|
|
3348
3474
|
*
|
|
3349
|
-
*
|
|
3350
|
-
*
|
|
3351
|
-
*
|
|
3475
|
+
* Kept for compatibility: it stays registered so a consumer reading `slate` or
|
|
3476
|
+
* `--mantine-color-slate-*` keeps its colour. The kit's own roles no longer use
|
|
3477
|
+
* it, since text moved to {@link OBSIDIAN}; new work should read the text tokens.
|
|
3352
3478
|
*/
|
|
3353
3479
|
export declare const SLATE: MantineColorsTuple;
|
|
3354
3480
|
|
|
@@ -3491,7 +3617,7 @@ export declare interface StackerSettings {
|
|
|
3491
3617
|
variant?: StackerKind;
|
|
3492
3618
|
/** Edge the drawer is anchored to. Ignored for modals. @default "right" */
|
|
3493
3619
|
side?: StackerSide;
|
|
3494
|
-
/** Allow dragging the drawer towards its edge to dismiss it. Ignored for modals. @default false */
|
|
3620
|
+
/** Allow dragging the drawer towards its edge to dismiss it, on touch screens only. Ignored for modals. @default false */
|
|
3495
3621
|
draggable?: boolean;
|
|
3496
3622
|
/** Content area size — modal width or drawer extent. Defaults: modal `"lg"`, drawer `"md"`. */
|
|
3497
3623
|
size?: MantineSize | (string & {}) | number;
|
|
@@ -3561,26 +3687,26 @@ export declare type StatusIconStylesNames = "root" | "icon";
|
|
|
3561
3687
|
export declare type StatusVariant = "success" | "warning" | "error" | "neutral";
|
|
3562
3688
|
|
|
3563
3689
|
/**
|
|
3564
|
-
* A vertical
|
|
3565
|
-
*
|
|
3566
|
-
*
|
|
3690
|
+
* A vertical list of steps that expand one at a time. Each step has a two-digit
|
|
3691
|
+
* number on a rail, joined to the next by a hairline, and a clickable title;
|
|
3692
|
+
* activating a step reveals its content, with an optional button to advance.
|
|
3567
3693
|
*/
|
|
3568
3694
|
export declare const StepperTimeline: MantineComponent<StepperTimelineFactory>;
|
|
3569
3695
|
|
|
3570
3696
|
export declare type StepperTimelineFactory = Factory<{
|
|
3571
3697
|
props: StepperTimelineProps;
|
|
3572
|
-
ref:
|
|
3698
|
+
ref: HTMLOListElement;
|
|
3573
3699
|
stylesNames: StepperTimelineStylesNames;
|
|
3574
3700
|
}>;
|
|
3575
3701
|
|
|
3576
3702
|
export declare interface StepperTimelineItem {
|
|
3577
|
-
/** Heading shown
|
|
3703
|
+
/** Heading shown beside the step number; clicking it activates the step. */
|
|
3578
3704
|
title: ReactNode;
|
|
3579
3705
|
/** Body revealed when the step is active. */
|
|
3580
3706
|
content: ReactNode;
|
|
3581
3707
|
}
|
|
3582
3708
|
|
|
3583
|
-
export declare interface StepperTimelineProps extends
|
|
3709
|
+
export declare interface StepperTimelineProps extends BoxProps, StylesApiProps<StepperTimelineFactory>, ElementProps<"ol"> {
|
|
3584
3710
|
/** Ordered list of steps to render. */
|
|
3585
3711
|
items: StepperTimelineItem[];
|
|
3586
3712
|
/** Index of the active (expanded) step in controlled mode. */
|
|
@@ -3595,7 +3721,7 @@ export declare interface StepperTimelineProps extends Omit<TimelineProps, "activ
|
|
|
3595
3721
|
hideContinue?: boolean;
|
|
3596
3722
|
}
|
|
3597
3723
|
|
|
3598
|
-
export declare type StepperTimelineStylesNames = "root" | "item" | "bullet" | "title" | "content" | "continue";
|
|
3724
|
+
export declare type StepperTimelineStylesNames = "root" | "item" | "rail" | "bullet" | "line" | "body" | "title" | "content" | "continue";
|
|
3599
3725
|
|
|
3600
3726
|
/**
|
|
3601
3727
|
* Suggest completions at the start of each line
|
|
@@ -3607,18 +3733,41 @@ export declare const SURREAL_CDN_BASE = "https://cdn.surrealdb.com";
|
|
|
3607
3733
|
/** Every palette the UI Kit adds on top of Mantine's defaults. */
|
|
3608
3734
|
export declare const SURREAL_COLORS: Record<SurrealColor, MantineColorsTuple>;
|
|
3609
3735
|
|
|
3736
|
+
/**
|
|
3737
|
+
* The kit's layer transitions, as Mantine transitions: pass one as
|
|
3738
|
+
* `transitionProps={{ transition: SURREAL_TRANSITIONS.modal }}`, with
|
|
3739
|
+
* {@link EASE_BACK} for a modal, {@link EASE_BACK_SUBTLE} for a drawer and
|
|
3740
|
+
* {@link EASE_OUT} for the rest.
|
|
3741
|
+
*
|
|
3742
|
+
* - `modal` fades and scales in about its centre.
|
|
3743
|
+
* - `drawer` slides in from wholly off the edge it opens from, with no fade or
|
|
3744
|
+
* scale. The kit's `Drawer` sets the side from its `position`; elsewhere use
|
|
3745
|
+
* {@link drawerTransition} with the side.
|
|
3746
|
+
* - `floating` - menus, popovers, hover cards, dropdowns and tooltips - fades and
|
|
3747
|
+
* scales in from the side facing what opened it. The origin is read from
|
|
3748
|
+
* `--surreal-floating-origin`, which the kit's dropdown styles set from the
|
|
3749
|
+
* dropdown's placement.
|
|
3750
|
+
*/
|
|
3751
|
+
export declare const SURREAL_TRANSITIONS: {
|
|
3752
|
+
modal: MantineTransition;
|
|
3753
|
+
drawer: MantineTransition;
|
|
3754
|
+
floating: MantineTransition;
|
|
3755
|
+
};
|
|
3756
|
+
|
|
3610
3757
|
/** The name of every palette the UI Kit adds on top of Mantine's defaults. */
|
|
3611
|
-
export declare type SurrealColor = "pink" | "lilac" | "purple" | "violet" | "obsidian" | "slate";
|
|
3758
|
+
export declare type SurrealColor = "pink" | "lilac" | "purple" | "violet" | "obsidian" | "graphite" | "accent" | "slate";
|
|
3612
3759
|
|
|
3613
3760
|
/**
|
|
3614
3761
|
* The UI Kit's CSS variables resolver.
|
|
3615
3762
|
*
|
|
3616
|
-
* It does
|
|
3763
|
+
* It does three things Mantine cannot do on its own:
|
|
3617
3764
|
*
|
|
3618
3765
|
* 1. Rewrites every scheme-dependent Mantine variable as a `light-dark()`
|
|
3619
3766
|
* expression so that scheme islands work (ADR 0001).
|
|
3620
3767
|
* 2. Emits the brand foreground tokens, switching Lilac and Pink to a black
|
|
3621
3768
|
* foreground when `theme.other.contrastMode` is enabled (ADR 0003).
|
|
3769
|
+
* 3. Maps Mantine's stock `gray` and `dark` shades onto the kit's roles, so no
|
|
3770
|
+
* component falls back to a grey the kit does not use.
|
|
3622
3771
|
*/
|
|
3623
3772
|
export declare const surrealCssVariablesResolver: CSSVariablesResolver;
|
|
3624
3773
|
|
|
@@ -3650,8 +3799,8 @@ export declare type SurrealProduct = "database" | "memory";
|
|
|
3650
3799
|
*
|
|
3651
3800
|
* Two departures from Mantine's default:
|
|
3652
3801
|
*
|
|
3653
|
-
* 1. A control that did not ask for a color
|
|
3654
|
-
*
|
|
3802
|
+
* 1. A control that did not ask for a color is neutral: the primary action is
|
|
3803
|
+
* the `--surreal-action` fill, never a brand hue.
|
|
3655
3804
|
* 2. Brand fills keep a white foreground, including where Mantine's luminance
|
|
3656
3805
|
* check would pick black. The foreground comes from a token so that
|
|
3657
3806
|
* `other.contrastMode` can flip it where black genuinely measures better.
|
|
@@ -3750,9 +3899,424 @@ export declare interface ThemedImageProps extends BoxProps, StylesApiProps<Theme
|
|
|
3750
3899
|
|
|
3751
3900
|
export declare type ThemedImageStylesNames = "root" | "light" | "dark";
|
|
3752
3901
|
|
|
3902
|
+
export declare const TILE_COLUMN_GAP = 32;
|
|
3903
|
+
|
|
3904
|
+
export declare const TILE_GRID_COLUMNS = 12;
|
|
3905
|
+
|
|
3906
|
+
/** Row heights in a tile's lists: a regular row of two lines, and a compact one of one. */
|
|
3907
|
+
export declare const TILE_ROW_HEIGHT: {
|
|
3908
|
+
readonly regular: 56;
|
|
3909
|
+
readonly compact: 44;
|
|
3910
|
+
};
|
|
3911
|
+
|
|
3912
|
+
export declare const TILE_STAT_HEIGHT = 84;
|
|
3913
|
+
|
|
3914
|
+
/** A tile's header action: an icon that names itself on hover. */
|
|
3915
|
+
export declare const TileAction: FC<TileActionProps>;
|
|
3916
|
+
|
|
3917
|
+
export declare interface TileActionProps {
|
|
3918
|
+
label: string;
|
|
3919
|
+
icon: string;
|
|
3920
|
+
onClick: () => void;
|
|
3921
|
+
/** Why the action is unavailable. It stays visible, and says why. */
|
|
3922
|
+
blockedReason?: string;
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
/**
|
|
3926
|
+
* A tile with nothing to show but a line of text, such as one whose subject is
|
|
3927
|
+
* gone or that the viewer may not see.
|
|
3928
|
+
*/
|
|
3929
|
+
export declare const TileBlank: FC<TileBlankProps>;
|
|
3930
|
+
|
|
3931
|
+
export declare interface TileBlankProps {
|
|
3932
|
+
/** Names the tile for the controls that act on it. */
|
|
3933
|
+
label: string;
|
|
3934
|
+
children: ReactNode;
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
/** The pixels a tile's content has to fill. */
|
|
3938
|
+
export declare interface TileBody {
|
|
3939
|
+
width: number;
|
|
3940
|
+
height: number;
|
|
3941
|
+
}
|
|
3942
|
+
|
|
3943
|
+
/** A labelled group of menu items to pick one choice from, the chosen one checked. */
|
|
3944
|
+
export declare function TileChoiceOptions<T extends string>({ label, choices, value, onChange, }: TileChoiceOptionsProps<T>): ReactNode;
|
|
3945
|
+
|
|
3946
|
+
export declare interface TileChoiceOptionsProps<T extends string> {
|
|
3947
|
+
label: string;
|
|
3948
|
+
choices: readonly {
|
|
3949
|
+
value: T;
|
|
3950
|
+
label: string;
|
|
3951
|
+
}[];
|
|
3952
|
+
value: T;
|
|
3953
|
+
onChange: (value: T) => void;
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
export declare const TileChromeContext: Context<TileChromeValue | null>;
|
|
3957
|
+
|
|
3958
|
+
export declare interface TileChromeValue {
|
|
3959
|
+
/** The menu of the tile's options, and of removing it. */
|
|
3960
|
+
menu: (label: string) => ReactNode;
|
|
3961
|
+
}
|
|
3962
|
+
|
|
3963
|
+
/** A column of a tile's list beside the name. Optional ones give way first as the tile narrows. */
|
|
3964
|
+
export declare interface TileColumn {
|
|
3965
|
+
label: string;
|
|
3966
|
+
isOptional?: boolean;
|
|
3967
|
+
}
|
|
3968
|
+
|
|
3969
|
+
export declare interface TileConfiguratorProps<Config, Context> {
|
|
3970
|
+
context: Context;
|
|
3971
|
+
/** Finishes adding the tile with the settings chosen. */
|
|
3972
|
+
onSubmit: (config: Config) => void;
|
|
3973
|
+
}
|
|
3974
|
+
|
|
3975
|
+
/** A day of the month under its month, the way a calendar page shows it. */
|
|
3976
|
+
export declare const TileDateBlock: FC<TileDateBlockProps>;
|
|
3977
|
+
|
|
3978
|
+
export declare interface TileDateBlockProps {
|
|
3979
|
+
date: Date;
|
|
3980
|
+
}
|
|
3981
|
+
|
|
3982
|
+
export declare interface TileDraft {
|
|
3983
|
+
id: string;
|
|
3984
|
+
type: string;
|
|
3985
|
+
config?: Record<string, unknown>;
|
|
3986
|
+
size: TileSize;
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
/** What a tile says when it has nothing to show. */
|
|
3990
|
+
export declare const TileEmpty: FC<TileEmptyProps>;
|
|
3991
|
+
|
|
3992
|
+
export declare interface TileEmptyProps {
|
|
3993
|
+
title?: string;
|
|
3994
|
+
children: ReactNode;
|
|
3995
|
+
/** A primary action is the tile's call to action, drawn in its accent. */
|
|
3996
|
+
action?: {
|
|
3997
|
+
label: string;
|
|
3998
|
+
onClick: () => void;
|
|
3999
|
+
isPrimary?: boolean;
|
|
4000
|
+
};
|
|
4001
|
+
}
|
|
4002
|
+
|
|
4003
|
+
export declare interface TileFactProps {
|
|
4004
|
+
label: string;
|
|
4005
|
+
value: ReactNode;
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
/** Labelled values, one to a line, divided by hairlines; as many as fit. */
|
|
4009
|
+
export declare const TileFacts: FC<{
|
|
4010
|
+
facts: TileFactProps[];
|
|
4011
|
+
}>;
|
|
4012
|
+
|
|
4013
|
+
export declare interface TileFooterLink {
|
|
4014
|
+
label: string;
|
|
4015
|
+
onClick: () => void;
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
/**
|
|
4019
|
+
* The frame every tile draws in: one surface holding a header with the title,
|
|
4020
|
+
* the tile's actions and its menu, a content area that is measured so the tile
|
|
4021
|
+
* can fit what it shows to the space it was given, and a footer link. The
|
|
4022
|
+
* content area clips; a tile that scrolls its list does so itself.
|
|
4023
|
+
*/
|
|
4024
|
+
export declare const TileFrame: FC<TileFrameProps>;
|
|
4025
|
+
|
|
4026
|
+
export declare interface TileFrameProps extends PropsWithChildren {
|
|
4027
|
+
title: ReactNode;
|
|
4028
|
+
/** Names the tile for the controls that act on it. Defaults to a string title. */
|
|
4029
|
+
label?: string;
|
|
4030
|
+
/** How many of something the tile is about, shown beside its title. */
|
|
4031
|
+
count?: number;
|
|
4032
|
+
/**
|
|
4033
|
+
* The product accent the tile takes (`data-surreal-accent`), such as `database` or
|
|
4034
|
+
* `memory`. A tile without one keeps its footer link neutral.
|
|
4035
|
+
*/
|
|
4036
|
+
accent?: string;
|
|
4037
|
+
/** Small controls at the header's trailing edge, before the tile's menu. */
|
|
4038
|
+
actions?: ReactNode;
|
|
4039
|
+
/** The way on to everything the tile summarises, kept at its bottom edge. */
|
|
4040
|
+
footer?: TileFooterLink;
|
|
4041
|
+
/**
|
|
4042
|
+
* Draws the content on one line beside the menu, with no title or footer, for a tile one
|
|
4043
|
+
* row tall such as a search box. The title still names the tile for its controls.
|
|
4044
|
+
*/
|
|
4045
|
+
isInline?: boolean;
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
/**
|
|
4049
|
+
* A grid of tiles that each span any number of cells, within the limits of their
|
|
4050
|
+
* type. The grid fills the width it is given, so its cells stretch with the
|
|
4051
|
+
* viewport. It knows nothing of what the tiles show: the registry says that.
|
|
4052
|
+
*/
|
|
4053
|
+
export declare function TileGrid<Context>({ registry, value, onChange, context, onRemoved, isLocked, columns, rowHeight, gap, compactBelow, deniedMessage, }: TileGridProps<Context>): ReactNode;
|
|
4054
|
+
|
|
4055
|
+
export declare interface TileGridProps<Context> {
|
|
4056
|
+
/** The kinds of tile the grid can draw. */
|
|
4057
|
+
registry: TileRegistry<Context>;
|
|
4058
|
+
/** The tiles on the grid. Tiles of a type the registry does not know, or reports unavailable, are not drawn. */
|
|
4059
|
+
value: readonly TileValue[];
|
|
4060
|
+
onChange: (tiles: TileValue[]) => void;
|
|
4061
|
+
/** Handed to every tile of a type that wants it. */
|
|
4062
|
+
context: Context;
|
|
4063
|
+
/** Called after a tile is removed, with the tiles as they were, so the host can offer to undo it. */
|
|
4064
|
+
onRemoved?: (tile: TileValue, previous: TileValue[]) => void;
|
|
4065
|
+
/** Fixes the tiles in place: nothing can be moved, resized or removed, and no handles show. */
|
|
4066
|
+
isLocked?: boolean;
|
|
4067
|
+
columns?: number;
|
|
4068
|
+
/** The height of one row of cells, in pixels. */
|
|
4069
|
+
rowHeight?: number;
|
|
4070
|
+
gap?: number;
|
|
4071
|
+
/** Below this width the grid is one column of tiles, still as tall as their rows. */
|
|
4072
|
+
compactBelow?: number;
|
|
4073
|
+
/** What a tile the viewer may not see says in place of its content. */
|
|
4074
|
+
deniedMessage?: ReactNode;
|
|
4075
|
+
}
|
|
4076
|
+
|
|
4077
|
+
/** A tile's leading figure: large, with a word beside it and a line under it. */
|
|
4078
|
+
export declare const TileHeadline: FC<TileHeadlineProps>;
|
|
4079
|
+
|
|
4080
|
+
export declare interface TileHeadlineProps {
|
|
4081
|
+
value: ReactNode;
|
|
4082
|
+
/** Beside the figure, such as what it is out of, or how far it moved. */
|
|
4083
|
+
aside?: ReactNode;
|
|
4084
|
+
/** Under the figure, such as the period it covers. */
|
|
4085
|
+
caption?: ReactNode;
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4088
|
+
/** The size limits of a tile type, in cells. */
|
|
4089
|
+
export declare interface TileLimits {
|
|
4090
|
+
min: TileSize;
|
|
4091
|
+
max: TileSize;
|
|
4092
|
+
}
|
|
4093
|
+
|
|
4094
|
+
/**
|
|
4095
|
+
* Lists as many items as the tile has room for, in as many columns as its
|
|
4096
|
+
* width allows, filling each column top to bottom, and the tile's footer leads
|
|
4097
|
+
* to the rest. A scrollable list shows them all instead, row by row.
|
|
4098
|
+
*/
|
|
4099
|
+
export declare function TileList<T>({ items, rowHeight, columnWidth, maxColumns, isPending, isScrollable, empty, columns: tableColumns, nameLabel, renderItem, itemKey, }: TileListProps<T>): ReactNode;
|
|
4100
|
+
|
|
4101
|
+
export declare interface TileListProps<T> {
|
|
4102
|
+
items: readonly T[];
|
|
4103
|
+
rowHeight?: number;
|
|
4104
|
+
/** The narrowest a column may get before the list drops to fewer. */
|
|
4105
|
+
columnWidth?: number;
|
|
4106
|
+
maxColumns?: number;
|
|
4107
|
+
isPending?: boolean;
|
|
4108
|
+
/** Lists every item, row by row, scrolling once they outgrow the tile. */
|
|
4109
|
+
isScrollable?: boolean;
|
|
4110
|
+
/** Shown in place of the list while there is nothing in it. */
|
|
4111
|
+
empty: ReactNode;
|
|
4112
|
+
/**
|
|
4113
|
+
* Lays the list out as a table: a head naming each column above a single
|
|
4114
|
+
* column of rows, whose `TileRow`s pass their values as `cells`.
|
|
4115
|
+
*/
|
|
4116
|
+
columns?: readonly TileColumn[];
|
|
4117
|
+
/** Heads the name column of a list with `columns`. */
|
|
4118
|
+
nameLabel?: string;
|
|
4119
|
+
renderItem: (item: T) => ReactNode;
|
|
4120
|
+
itemKey: (item: T) => string;
|
|
4121
|
+
}
|
|
4122
|
+
|
|
4123
|
+
export declare interface TileOptionsProps<Config> {
|
|
4124
|
+
config: Config;
|
|
4125
|
+
onChange: (config: Config) => void;
|
|
4126
|
+
}
|
|
4127
|
+
|
|
4128
|
+
/** What a tile's component is given to draw itself. */
|
|
4129
|
+
export declare interface TileProps<Config, Context> {
|
|
4130
|
+
/** The tile's own settings, such as the instance it shows. */
|
|
4131
|
+
config: Config;
|
|
4132
|
+
/** Whatever the host handed the grid, for tiles that need more than their config. */
|
|
4133
|
+
context: Context;
|
|
4134
|
+
/** The cells the tile covers. Its measured pixels are read with `useTileBody`. */
|
|
4135
|
+
size: TileSize;
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
/** A rectangle of cells: its top-left cell and how many columns and rows it spans. */
|
|
4139
|
+
export declare interface TileRect {
|
|
4140
|
+
x: number;
|
|
4141
|
+
y: number;
|
|
4142
|
+
w: number;
|
|
4143
|
+
h: number;
|
|
4144
|
+
}
|
|
4145
|
+
|
|
4146
|
+
/** The kinds of tile a grid knows. */
|
|
4147
|
+
export declare type TileRegistry<Context = unknown> = readonly TileType<never, Context>[];
|
|
4148
|
+
|
|
4149
|
+
/** One line of a tile's list, divided from the next by a hairline. */
|
|
4150
|
+
export declare const TileRow: FC<TileRowProps>;
|
|
4151
|
+
|
|
4152
|
+
/**
|
|
4153
|
+
* The clickable shell every row in a tile shares: inset from the hairlines
|
|
4154
|
+
* around it, so its hover never touches them. Rows lay their content out inside.
|
|
4155
|
+
*/
|
|
4156
|
+
export declare const TileRowButton: FC<PropsWithChildren<UnstyledButtonProps & {
|
|
4157
|
+
className?: string;
|
|
4158
|
+
onClick?: () => void;
|
|
4159
|
+
}>>;
|
|
4160
|
+
|
|
4161
|
+
/** A row's leading icon. */
|
|
4162
|
+
export declare const TileRowIcon: FC<TileRowIconProps>;
|
|
4163
|
+
|
|
4164
|
+
export declare interface TileRowIconProps {
|
|
4165
|
+
path: string;
|
|
4166
|
+
/** The product the row's subject belongs to, which colours the icon. Muted without one. */
|
|
4167
|
+
accent?: string;
|
|
4168
|
+
isDimmed?: boolean;
|
|
4169
|
+
}
|
|
4170
|
+
|
|
4171
|
+
export declare interface TileRowProps {
|
|
4172
|
+
leading?: ReactNode;
|
|
4173
|
+
title: ReactNode;
|
|
4174
|
+
/** Sits beside the title, such as a state. */
|
|
4175
|
+
badge?: ReactNode;
|
|
4176
|
+
subtitle?: ReactNode;
|
|
4177
|
+
/** Sits at the trailing edge, such as a region or a time. */
|
|
4178
|
+
trailing?: string;
|
|
4179
|
+
/** The trailing marker of a row that leads somewhere. Defaults to a chevron. */
|
|
4180
|
+
marker?: string | null;
|
|
4181
|
+
/**
|
|
4182
|
+
* The row's value in each of its list's `columns`, in order. Lines up under
|
|
4183
|
+
* the list's head; cells of columns that gave way are left out.
|
|
4184
|
+
*/
|
|
4185
|
+
cells?: readonly ReactNode[];
|
|
4186
|
+
isDimmed?: boolean;
|
|
4187
|
+
onClick?: () => void;
|
|
4188
|
+
}
|
|
4189
|
+
|
|
4190
|
+
/**
|
|
4191
|
+
* Parses a tile's stored config. Shaped like a zod schema's `safeParse`, so a
|
|
4192
|
+
* zod schema can be passed as it is without the kit depending on zod.
|
|
4193
|
+
*/
|
|
4194
|
+
export declare interface TileSchema<Config> {
|
|
4195
|
+
safeParse: (input: unknown) => {
|
|
4196
|
+
success: true;
|
|
4197
|
+
data: Config;
|
|
4198
|
+
} | {
|
|
4199
|
+
success: false;
|
|
4200
|
+
};
|
|
4201
|
+
}
|
|
4202
|
+
|
|
4203
|
+
/**
|
|
4204
|
+
* Every item as rows of a fixed height, scrolling once they outgrow the space
|
|
4205
|
+
* left to them. The scrollbar sits in the tile's trailing padding rather than
|
|
4206
|
+
* over the rows.
|
|
4207
|
+
*/
|
|
4208
|
+
export declare function TileScrollRows<T>({ items, rowHeight, columns, isDivided, renderItem, itemKey, }: TileScrollRowsProps<T>): ReactNode;
|
|
4209
|
+
|
|
4210
|
+
export declare interface TileScrollRowsProps<T> {
|
|
4211
|
+
items: readonly T[];
|
|
4212
|
+
rowHeight: number;
|
|
4213
|
+
columns?: number;
|
|
4214
|
+
/** Divides the rows with hairlines. */
|
|
4215
|
+
isDivided?: boolean;
|
|
4216
|
+
renderItem: (item: T) => ReactNode;
|
|
4217
|
+
itemKey: (item: T) => string;
|
|
4218
|
+
}
|
|
4219
|
+
|
|
4220
|
+
/** How many cells a tile spans. */
|
|
4221
|
+
export declare interface TileSize {
|
|
4222
|
+
cols: number;
|
|
4223
|
+
rows: number;
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
export declare interface TileSpec {
|
|
4227
|
+
type: string;
|
|
4228
|
+
config?: Record<string, unknown>;
|
|
4229
|
+
/** Overrides the type's default size, in columns and rows. */
|
|
4230
|
+
size?: [cols: number, rows: number];
|
|
4231
|
+
}
|
|
4232
|
+
|
|
4233
|
+
/** A labelled figure, large and in tabular numbers. */
|
|
4234
|
+
export declare const TileStat: FC<TileStatProps & {
|
|
4235
|
+
isLeading?: boolean;
|
|
4236
|
+
}>;
|
|
4237
|
+
|
|
4238
|
+
/**
|
|
4239
|
+
* Lays figures out in rows divided by hairlines: as many to a row as fit, but
|
|
4240
|
+
* fewer when that would leave the last row ragged and the rows still fit.
|
|
4241
|
+
*/
|
|
4242
|
+
export declare const TileStatGrid: FC<{
|
|
4243
|
+
stats: TileStatProps[];
|
|
4244
|
+
minWidth?: number;
|
|
4245
|
+
}>;
|
|
4246
|
+
|
|
4247
|
+
export declare interface TileStatProps {
|
|
4248
|
+
label: string;
|
|
4249
|
+
value: ReactNode;
|
|
4250
|
+
caption?: ReactNode;
|
|
4251
|
+
}
|
|
4252
|
+
|
|
4253
|
+
/** A tile title led by an icon in the tile's accent, for tiles about one thing. */
|
|
4254
|
+
export declare const TileTitleIcon: FC<TileTitleIconProps>;
|
|
4255
|
+
|
|
4256
|
+
export declare interface TileTitleIconProps {
|
|
4257
|
+
path: string;
|
|
4258
|
+
children: ReactNode;
|
|
4259
|
+
}
|
|
4260
|
+
|
|
4261
|
+
/** A menu item that switches something on or off, checked while it is on. */
|
|
4262
|
+
export declare const TileToggleOption: FC<PropsWithChildren<{
|
|
4263
|
+
checked: boolean;
|
|
4264
|
+
onChange: (checked: boolean) => void;
|
|
4265
|
+
}>>;
|
|
4266
|
+
|
|
4267
|
+
/** One kind of tile a grid can hold. */
|
|
4268
|
+
export declare interface TileType<Config = unknown, Context = unknown> extends TileLimits {
|
|
4269
|
+
id: string;
|
|
4270
|
+
title: string;
|
|
4271
|
+
description: string;
|
|
4272
|
+
/**
|
|
4273
|
+
* The heading the add drawer lists the type under. Headings appear in the order of their
|
|
4274
|
+
* first type in the registry; types without one come under no heading.
|
|
4275
|
+
*/
|
|
4276
|
+
category?: string;
|
|
4277
|
+
/** Represents the type in the add drawer. An icon path from `@surrealdb/ui`. */
|
|
4278
|
+
icon: string;
|
|
4279
|
+
/** The size a new tile starts at. */
|
|
4280
|
+
size: TileSize;
|
|
4281
|
+
/** Parses a tile's stored config. A config that does not parse is replaced by `{}`. */
|
|
4282
|
+
schema?: TileSchema<Config>;
|
|
4283
|
+
component: FC<TileProps<Config, Context>>;
|
|
4284
|
+
/** Menu items shown above "Remove tile" in the tile's menu. */
|
|
4285
|
+
options?: FC<TileOptionsProps<Config>>;
|
|
4286
|
+
/** Asks which one the tile is for before it is added, for tiles that show a specific thing. */
|
|
4287
|
+
configurator?: FC<TileConfiguratorProps<Config, Context>>;
|
|
4288
|
+
/** Whether the grid may hold several tiles of this type. Otherwise there is at most one. */
|
|
4289
|
+
multiple?: boolean;
|
|
4290
|
+
/** Whether the type applies to the context at all. An unavailable type is not drawn or offered. */
|
|
4291
|
+
isAvailable?: (context: Context) => boolean;
|
|
4292
|
+
/**
|
|
4293
|
+
* Whether the viewer may see what the tile shows. A tile that is not permitted keeps its
|
|
4294
|
+
* place and says so, and its component never mounts, so it starts no requests. The add
|
|
4295
|
+
* drawer does not offer it.
|
|
4296
|
+
*/
|
|
4297
|
+
isPermitted?: (context: Context) => boolean;
|
|
4298
|
+
}
|
|
4299
|
+
|
|
4300
|
+
/** One tile of a grid: what it is, how it is set up, and where it sits. */
|
|
4301
|
+
export declare interface TileValue extends TileRect {
|
|
4302
|
+
id: string;
|
|
4303
|
+
type: string;
|
|
4304
|
+
config?: Record<string, unknown>;
|
|
4305
|
+
}
|
|
4306
|
+
|
|
3753
4307
|
/** The top-most open item, or undefined when nothing is open. */
|
|
3754
4308
|
export declare function topOpened(items: StackerItem[]): StackerItem | undefined;
|
|
3755
4309
|
|
|
4310
|
+
/** How long the kit's layer transitions take, in milliseconds. */
|
|
4311
|
+
export declare const TRANSITION_DURATION: {
|
|
4312
|
+
readonly overlay: 220;
|
|
4313
|
+
readonly drawer: 280;
|
|
4314
|
+
readonly floating: 150;
|
|
4315
|
+
};
|
|
4316
|
+
|
|
4317
|
+
/** The side a drawer opens from. */
|
|
4318
|
+
export declare type TransitionSide = "left" | "right" | "top" | "bottom";
|
|
4319
|
+
|
|
3756
4320
|
/** Trim `{#id}` from the end of a heading source range (returns new exclusive `titleTo`). */
|
|
3757
4321
|
export declare function trimCustomHeadingIdFromRange(source: {
|
|
3758
4322
|
slice(from: number, to: number): string;
|
|
@@ -3761,6 +4325,13 @@ export declare function trimCustomHeadingIdFromRange(source: {
|
|
|
3761
4325
|
customId?: string;
|
|
3762
4326
|
};
|
|
3763
4327
|
|
|
4328
|
+
/**
|
|
4329
|
+
* Returns an opener for the Stacker drawer that adds a tile to a grid. Needs a
|
|
4330
|
+
* `StackerProvider` above it; without one, put an {@link AddTilePicker} in a drawer of
|
|
4331
|
+
* your own.
|
|
4332
|
+
*/
|
|
4333
|
+
export declare function useAddTileDrawer<Context>(): (options: AddTileOptions<Context>) => void;
|
|
4334
|
+
|
|
3764
4335
|
/**
|
|
3765
4336
|
* Returns a function which can be used to trigger a confirmation dialog
|
|
3766
4337
|
*/
|
|
@@ -3849,6 +4420,9 @@ export declare function useSwitch(initialState?: boolean, callbacks?: {
|
|
|
3849
4420
|
onClose?: () => void;
|
|
3850
4421
|
}): readonly [boolean, BooleanHandle];
|
|
3851
4422
|
|
|
4423
|
+
/** The measured size of the content area of the tile it is called from. */
|
|
4424
|
+
export declare function useTileBody(): TileBody;
|
|
4425
|
+
|
|
3852
4426
|
/** A version string rendered as inline code. */
|
|
3853
4427
|
export declare const Version: MantineComponent<VersionFactory>;
|
|
3854
4428
|
|
|
@@ -3975,7 +4549,7 @@ declare module "@mantine/core" {
|
|
|
3975
4549
|
}
|
|
3976
4550
|
|
|
3977
4551
|
declare module "@mantine/core" {
|
|
3978
|
-
type ExtendedCustomColors = "pink" | "lilac" | "purple" | "violet" | "obsidian" | "slate" | import("@mantine/core").DefaultMantineColor;
|
|
4552
|
+
type ExtendedCustomColors = "pink" | "lilac" | "purple" | "violet" | "obsidian" | "graphite" | "accent" | "slate" | import("@mantine/core").DefaultMantineColor;
|
|
3979
4553
|
interface MantineThemeColorsOverride {
|
|
3980
4554
|
colors: Record<ExtendedCustomColors, import("@mantine/core").MantineColorsTuple>;
|
|
3981
4555
|
}
|