@nimblebrain/synapse 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/codegen/index.cjs +5 -5
- package/dist/codegen/index.js +1 -1
- package/dist/ui/fonts.cjs +19 -0
- package/dist/ui/fonts.cjs.map +1 -0
- package/dist/ui/fonts.d.cts +30 -0
- package/dist/ui/fonts.d.ts +30 -0
- package/dist/ui/fonts.js +17 -0
- package/dist/ui/fonts.js.map +1 -0
- package/dist/ui/index.cjs +1451 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +424 -0
- package/dist/ui/index.d.ts +424 -0
- package/dist/ui/index.js +1420 -0
- package/dist/ui/index.js.map +1 -0
- package/package.json +11 -1
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, DialogHTMLAttributes, InputHTMLAttributes, RefObject, CSSProperties, ElementType } from 'react';
|
|
3
|
+
|
|
4
|
+
interface AvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
5
|
+
/** Name used for initials and the image alt text. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Optional image URL; falls back to initials when absent or on error. */
|
|
8
|
+
src?: string;
|
|
9
|
+
/** Diameter in px. Default 28. */
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
declare function Avatar({ name, src, size, style, ...rest }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
type BadgeTone = "neutral" | "accent" | "success" | "warning" | "danger" | "processing" | "warm";
|
|
15
|
+
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
16
|
+
tone?: BadgeTone;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare function Badge({ tone, style, children, ...rest }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
type Variant = "primary" | "secondary" | "ghost";
|
|
22
|
+
type Size = "sm" | "md";
|
|
23
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
24
|
+
variant?: Variant;
|
|
25
|
+
size?: Size;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
declare function Button({ variant, size, style, className, children, ...rest }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
interface TextLinkProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
+
/** Resting tone. Hover always moves toward `accent` (or `danger`). */
|
|
31
|
+
tone?: "muted" | "default" | "danger";
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/** A chrome-less text button — for back / delete / retry affordances. */
|
|
35
|
+
declare function TextLink({ tone, style, className, children, ...rest }: TextLinkProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
38
|
+
/** Inner padding (CSS length or px number). Default `0.875rem`. */
|
|
39
|
+
padding?: number | string;
|
|
40
|
+
/** Lift on hover — for clickable cards. */
|
|
41
|
+
interactive?: boolean;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
declare function Card({ padding, interactive, style, className, children, ...rest }: CardProps): react_jsx_runtime.JSX.Element;
|
|
45
|
+
|
|
46
|
+
type Side$1 = "left" | "right" | "bottom";
|
|
47
|
+
interface DrawerProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "title" | "onCancel" | "onClick"> {
|
|
48
|
+
open: boolean;
|
|
49
|
+
/** Called by the backdrop and the Header close button. */
|
|
50
|
+
onClose: () => void;
|
|
51
|
+
/** Called on Escape. Defaults to `onClose` — override to do something else
|
|
52
|
+
* (e.g. pop one level of a panel stack before closing). */
|
|
53
|
+
onEscape?: () => void;
|
|
54
|
+
side?: Side$1;
|
|
55
|
+
/** Panel width (ignored for `side="bottom"`, which is full width). Default 480. */
|
|
56
|
+
width?: number | string;
|
|
57
|
+
children?: ReactNode;
|
|
58
|
+
}
|
|
59
|
+
declare function DrawerRoot({ open, onClose, onEscape, side, width, style, children, ...rest }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
60
|
+
interface HeaderProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
61
|
+
/**
|
|
62
|
+
* Heading text — rendered as an `<h2>` and wired as the drawer's accessible
|
|
63
|
+
* name. Renders **instead of** `children` (pass one or the other, not both).
|
|
64
|
+
*/
|
|
65
|
+
title?: ReactNode;
|
|
66
|
+
/** Show a leading back button (e.g. pop one level of a panel stack). */
|
|
67
|
+
onBack?: () => void;
|
|
68
|
+
/** Trailing controls placed before the close button. */
|
|
69
|
+
actions?: ReactNode;
|
|
70
|
+
/** Show a close button that calls this. */
|
|
71
|
+
onClose?: () => void;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
declare function Header$1({ title, onBack, actions, onClose, style, children, ...rest }: HeaderProps): react_jsx_runtime.JSX.Element;
|
|
75
|
+
declare function Body$1({ style, children, ...rest }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
76
|
+
declare function Footer$1({ style, children, ...rest }: HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
77
|
+
/** `Drawer` with `.Header`, `.Body`, `.Footer` slots. */
|
|
78
|
+
declare const Drawer: typeof DrawerRoot & {
|
|
79
|
+
Header: typeof Header$1;
|
|
80
|
+
Body: typeof Body$1;
|
|
81
|
+
Footer: typeof Footer$1;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
85
|
+
icon?: ReactNode;
|
|
86
|
+
title?: ReactNode;
|
|
87
|
+
description?: ReactNode;
|
|
88
|
+
action?: ReactNode;
|
|
89
|
+
}
|
|
90
|
+
declare function EmptyState({ icon, title, description, action, style, ...rest }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
91
|
+
|
|
92
|
+
interface ListRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
93
|
+
title: ReactNode;
|
|
94
|
+
/** Secondary line under the title. */
|
|
95
|
+
meta?: ReactNode;
|
|
96
|
+
/** Leading slot — e.g. a StatusDot or Avatar. */
|
|
97
|
+
leading?: ReactNode;
|
|
98
|
+
/** Trailing slot — e.g. a timestamp or actions. */
|
|
99
|
+
trailing?: ReactNode;
|
|
100
|
+
/** Enables pointer cursor + hover tint. */
|
|
101
|
+
interactive?: boolean;
|
|
102
|
+
}
|
|
103
|
+
declare function ListRow({ title, meta, leading, trailing, interactive, style, className, ...rest }: ListRowProps): react_jsx_runtime.JSX.Element;
|
|
104
|
+
|
|
105
|
+
interface PaginationProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
106
|
+
/** Current page, 1-based. */
|
|
107
|
+
page: number;
|
|
108
|
+
/** Total number of pages. */
|
|
109
|
+
pageCount: number;
|
|
110
|
+
onChange: (page: number) => void;
|
|
111
|
+
}
|
|
112
|
+
declare function Pagination({ page, pageCount, onChange, style, ...rest }: PaginationProps): react_jsx_runtime.JSX.Element;
|
|
113
|
+
|
|
114
|
+
interface ProseProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "dangerouslySetInnerHTML"> {
|
|
115
|
+
/** Trusted, pre-sanitized HTML string. */
|
|
116
|
+
html?: string;
|
|
117
|
+
children?: ReactNode;
|
|
118
|
+
}
|
|
119
|
+
declare function Prose({ html, children, className, ...rest }: ProseProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
121
|
+
interface SearchFieldProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
122
|
+
variant?: "underline" | "boxed";
|
|
123
|
+
}
|
|
124
|
+
declare function SearchField({ variant, style, className, type, ...rest }: SearchFieldProps): react_jsx_runtime.JSX.Element;
|
|
125
|
+
|
|
126
|
+
interface Option<T extends string> {
|
|
127
|
+
label: string;
|
|
128
|
+
value: T;
|
|
129
|
+
}
|
|
130
|
+
interface SegmentedControlProps<T extends string> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
131
|
+
options: Option<T>[];
|
|
132
|
+
value: T;
|
|
133
|
+
onChange: (value: T) => void;
|
|
134
|
+
}
|
|
135
|
+
declare function SegmentedControl<T extends string>({ options, value, onChange, style, className, ...rest }: SegmentedControlProps<T>): react_jsx_runtime.JSX.Element;
|
|
136
|
+
|
|
137
|
+
interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {
|
|
138
|
+
/** Diameter in px. Default 16. */
|
|
139
|
+
size?: number;
|
|
140
|
+
/** Arc color. Defaults to the accent token. */
|
|
141
|
+
color?: string;
|
|
142
|
+
}
|
|
143
|
+
declare function Spinner({ size, color, style, className, ...rest }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
144
|
+
|
|
145
|
+
type Status = "working" | "completed" | "failed" | "idle";
|
|
146
|
+
interface StatusDotProps extends Omit<HTMLAttributes<HTMLSpanElement>, "color"> {
|
|
147
|
+
status?: Status;
|
|
148
|
+
/** Override the dot color (any CSS color / token). */
|
|
149
|
+
color?: string;
|
|
150
|
+
/** Diameter in px. Default 8. */
|
|
151
|
+
size?: number;
|
|
152
|
+
}
|
|
153
|
+
declare function StatusDot({ status, color, size, style, className, ...rest }: StatusDotProps): react_jsx_runtime.JSX.Element;
|
|
154
|
+
|
|
155
|
+
type Align$1 = "left" | "right" | "center";
|
|
156
|
+
interface Column<T> {
|
|
157
|
+
/** Stable column id. */
|
|
158
|
+
key: string;
|
|
159
|
+
header: ReactNode;
|
|
160
|
+
/** Cell content for a row. */
|
|
161
|
+
render: (row: T, index: number) => ReactNode;
|
|
162
|
+
align?: Align$1;
|
|
163
|
+
width?: number | string;
|
|
164
|
+
}
|
|
165
|
+
interface TableProps<T> extends Omit<HTMLAttributes<HTMLTableElement>, "children"> {
|
|
166
|
+
data: T[];
|
|
167
|
+
columns: Column<T>[];
|
|
168
|
+
/** Stable key per row. */
|
|
169
|
+
rowKey: (row: T, index: number) => string | number;
|
|
170
|
+
onRowClick?: (row: T, index: number) => void;
|
|
171
|
+
/** Shown when `data` is empty. */
|
|
172
|
+
empty?: ReactNode;
|
|
173
|
+
}
|
|
174
|
+
declare function Table<T>({ data, columns, rowKey, onRowClick, empty, style, className, ...rest }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
175
|
+
|
|
176
|
+
type ContentWidth = "reading" | "full";
|
|
177
|
+
interface AppFrameProps extends HTMLAttributes<HTMLDivElement> {
|
|
178
|
+
contentWidth?: ContentWidth;
|
|
179
|
+
children?: ReactNode;
|
|
180
|
+
}
|
|
181
|
+
declare function AppFrameRoot({ contentWidth, style, children, ...rest }: AppFrameProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
declare function Header({ style, children, ...rest }: HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
183
|
+
interface BodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
184
|
+
/**
|
|
185
|
+
* Host a full-bleed body layout (SidebarLayout, BoardLayout) edge-to-edge:
|
|
186
|
+
* no padding, no reading column, and the body itself doesn't scroll — the
|
|
187
|
+
* layout's panes manage their own scroll. Leave off for plain content
|
|
188
|
+
* (lists, forms), which get the padded reading/full column.
|
|
189
|
+
*/
|
|
190
|
+
bleed?: boolean;
|
|
191
|
+
}
|
|
192
|
+
declare function Body({ bleed, style, children, ...rest }: BodyProps): react_jsx_runtime.JSX.Element;
|
|
193
|
+
declare function Footer({ style, children, ...rest }: HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
194
|
+
/** `AppFrame` with `.Header`, `.Body`, `.Footer` slots. */
|
|
195
|
+
declare const AppFrame: typeof AppFrameRoot & {
|
|
196
|
+
Header: typeof Header;
|
|
197
|
+
Body: typeof Body;
|
|
198
|
+
Footer: typeof Footer;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
interface ListDetailState {
|
|
202
|
+
collapsed: boolean;
|
|
203
|
+
selected: boolean;
|
|
204
|
+
listWidth: number | string;
|
|
205
|
+
onBack?: () => void;
|
|
206
|
+
}
|
|
207
|
+
/** Read the list/detail responsive state — for custom back affordances. */
|
|
208
|
+
declare function useListDetail(): ListDetailState;
|
|
209
|
+
interface ListDetailLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
210
|
+
/** Is a detail open? Drives which pane shows on a narrow layout. */
|
|
211
|
+
selected?: boolean;
|
|
212
|
+
/** Called by `Back` (and custom triggers) to return to the list when narrow. */
|
|
213
|
+
onBack?: () => void;
|
|
214
|
+
/** Master list width when side-by-side. Default 320. */
|
|
215
|
+
listWidth?: number | string;
|
|
216
|
+
/** Collapse to one-at-a-time below this layout width (px). Default 720. */
|
|
217
|
+
breakpoint?: number;
|
|
218
|
+
children?: ReactNode;
|
|
219
|
+
}
|
|
220
|
+
declare function ListDetailLayoutRoot({ selected, onBack, listWidth, breakpoint, style, children, ...rest }: ListDetailLayoutProps): react_jsx_runtime.JSX.Element;
|
|
221
|
+
declare function List({ style, children, ...rest }: HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element | null;
|
|
222
|
+
declare function Detail({ style, children, ...rest }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element | null;
|
|
223
|
+
interface BackProps {
|
|
224
|
+
children?: ReactNode;
|
|
225
|
+
style?: React.CSSProperties;
|
|
226
|
+
}
|
|
227
|
+
/** "← Back" affordance — renders only on a narrow pane with a detail open. */
|
|
228
|
+
declare function Back({ children, style }: BackProps): react_jsx_runtime.JSX.Element | null;
|
|
229
|
+
/** `ListDetailLayout` with `.List`, `.Detail`, and `.Back` slots. */
|
|
230
|
+
declare const ListDetailLayout: typeof ListDetailLayoutRoot & {
|
|
231
|
+
List: typeof List;
|
|
232
|
+
Detail: typeof Detail;
|
|
233
|
+
Back: typeof Back;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
type CollapseMode = "reflow" | "drawer";
|
|
237
|
+
type Side = "left" | "right";
|
|
238
|
+
interface SidebarState {
|
|
239
|
+
collapsed: boolean;
|
|
240
|
+
mode: CollapseMode;
|
|
241
|
+
side: Side;
|
|
242
|
+
width: number | string;
|
|
243
|
+
open: boolean;
|
|
244
|
+
setOpen: (open: boolean) => void;
|
|
245
|
+
}
|
|
246
|
+
/** Read the sidebar's responsive state — for custom triggers or nav re-orientation. */
|
|
247
|
+
declare function useSidebar(): SidebarState;
|
|
248
|
+
interface SidebarLayoutProps extends HTMLAttributes<HTMLDivElement> {
|
|
249
|
+
side?: Side;
|
|
250
|
+
/** Expanded rail / drawer width. Default 240. */
|
|
251
|
+
width?: number | string;
|
|
252
|
+
/** Collapse below this pane width (px). Default 640. */
|
|
253
|
+
breakpoint?: number;
|
|
254
|
+
collapseMode?: CollapseMode;
|
|
255
|
+
children?: ReactNode;
|
|
256
|
+
}
|
|
257
|
+
declare function SidebarLayoutRoot({ side, width, breakpoint, collapseMode, style, children, ...rest }: SidebarLayoutProps): react_jsx_runtime.JSX.Element;
|
|
258
|
+
declare function Sidebar({ style, children, ...rest }: HTMLAttributes<HTMLElement>): react_jsx_runtime.JSX.Element;
|
|
259
|
+
declare function Main({ style, children, ...rest }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
260
|
+
interface TriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
261
|
+
/** Override the default hamburger glyph. */
|
|
262
|
+
children?: ReactNode;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Hamburger that opens the drawer. Renders only when collapsed in `drawer`
|
|
266
|
+
* mode, and only when it can see a `SidebarLayout` context — so it's safe to
|
|
267
|
+
* place anywhere inside the layout subtree (it no-ops elsewhere). Note: in v1
|
|
268
|
+
* the context lives on `SidebarLayout` itself, so the trigger must sit inside
|
|
269
|
+
* it (e.g. a toolbar in `Main`), not in a sibling `AppFrame.Header`.
|
|
270
|
+
*/
|
|
271
|
+
declare function Trigger({ children, style, onClick, ...rest }: TriggerProps): react_jsx_runtime.JSX.Element | null;
|
|
272
|
+
/** `SidebarLayout` with `.Sidebar`, `.Main`, and `.Trigger` slots. */
|
|
273
|
+
declare const SidebarLayout: typeof SidebarLayoutRoot & {
|
|
274
|
+
Sidebar: typeof Sidebar;
|
|
275
|
+
Main: typeof Main;
|
|
276
|
+
Trigger: typeof Trigger;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* `useBreakpoint` — responsive hook keyed to an element's OWN width, not the
|
|
281
|
+
* device viewport. Synapse apps render in an iframe pane whose width the host
|
|
282
|
+
* controls (fullscreen, split, or a narrow sidebar), so layouts must react to
|
|
283
|
+
* the space they're actually given.
|
|
284
|
+
*
|
|
285
|
+
* Attach the returned `ref` to the element whose width drives the decision.
|
|
286
|
+
* Width is measured synchronously on mount (no first-frame flash) and kept live
|
|
287
|
+
* via `ResizeObserver`. SSR/test-safe: without a DOM/`ResizeObserver` it simply
|
|
288
|
+
* reports `isNarrow: false`.
|
|
289
|
+
*/
|
|
290
|
+
|
|
291
|
+
declare function useBreakpoint<T extends HTMLElement = HTMLDivElement>(breakpoint: number): {
|
|
292
|
+
ref: RefObject<T | null>;
|
|
293
|
+
isNarrow: boolean;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
type Align = "start" | "center" | "end" | "stretch" | "baseline";
|
|
297
|
+
type Justify = "start" | "center" | "end" | "between" | "around";
|
|
298
|
+
interface FlexProps extends HTMLAttributes<HTMLDivElement> {
|
|
299
|
+
gap?: number | string;
|
|
300
|
+
align?: Align;
|
|
301
|
+
justify?: Justify;
|
|
302
|
+
wrap?: boolean;
|
|
303
|
+
children?: ReactNode;
|
|
304
|
+
}
|
|
305
|
+
/** Vertical flex container with `gap`. Defaults to `align: stretch`. */
|
|
306
|
+
declare function Stack({ gap, align, justify, wrap, style, children, ...rest }: FlexProps): react_jsx_runtime.JSX.Element;
|
|
307
|
+
/** Horizontal flex container with `gap`. Defaults to `align: center`. */
|
|
308
|
+
declare function Inline({ gap, align, justify, wrap, style, children, ...rest }: FlexProps): react_jsx_runtime.JSX.Element;
|
|
309
|
+
/** Flexible gap that pushes siblings apart inside a `Stack`/`Inline`. */
|
|
310
|
+
declare function Spacer({ style, ...rest }: HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
311
|
+
interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
312
|
+
orientation?: "horizontal" | "vertical";
|
|
313
|
+
}
|
|
314
|
+
/** A hairline rule using the border token. Horizontal by default. Decorative
|
|
315
|
+
* (`aria-hidden`) — it's a visual divider, not a focusable/valued separator. */
|
|
316
|
+
declare function Divider({ orientation, style, ...rest }: DividerProps): react_jsx_runtime.JSX.Element;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* The token contract for `@nimblebrain/synapse/ui`.
|
|
320
|
+
*
|
|
321
|
+
* Values are NOT brand hexes — they are `var(--token, fallback)` references to
|
|
322
|
+
* the CSS custom properties the host injects into the app iframe (the MCP
|
|
323
|
+
* ext-apps `hostContext.styles.variables`). Because styling resolves through
|
|
324
|
+
* CSS variables, theme changes (including light↔dark) reflect automatically
|
|
325
|
+
* with no React re-render: the host swaps the `:root` vars and every `var()`
|
|
326
|
+
* re-resolves.
|
|
327
|
+
*
|
|
328
|
+
* The fallbacks are deliberately **neutral** (system fonts, neutral grays, a
|
|
329
|
+
* generic blue) — NOT NimbleBrain brand. Brand arrives by injection when the
|
|
330
|
+
* app runs inside the NimbleBrain host; standalone/static renders get a sane
|
|
331
|
+
* unbranded default. This keeps the library host-agnostic.
|
|
332
|
+
*
|
|
333
|
+
* Components import the static `tokens` object and style with CSS `var()`, so
|
|
334
|
+
* theming (incl. light/dark) resolves in CSS with no re-render.
|
|
335
|
+
*/
|
|
336
|
+
|
|
337
|
+
/** Resolved design tokens as CSS `var()` references with neutral fallbacks. */
|
|
338
|
+
declare const tokens: {
|
|
339
|
+
readonly bg: "var(--color-background-primary, #ffffff)";
|
|
340
|
+
readonly bgRaised: "var(--color-background-secondary, #fafafa)";
|
|
341
|
+
readonly bgSubtle: "var(--color-background-tertiary, #f3f4f6)";
|
|
342
|
+
readonly fg: "var(--color-text-primary, #111827)";
|
|
343
|
+
readonly fgMuted: "var(--color-text-secondary, #6b7280)";
|
|
344
|
+
readonly fgFaint: "var(--color-text-tertiary, #9ca3af)";
|
|
345
|
+
readonly accent: "var(--color-text-accent, #2563eb)";
|
|
346
|
+
readonly accentFg: "var(--nb-color-accent-foreground, #ffffff)";
|
|
347
|
+
readonly border: "var(--color-border-primary, #e5e7eb)";
|
|
348
|
+
readonly borderStrong: "var(--color-border-secondary, #d1d5db)";
|
|
349
|
+
readonly ring: "var(--color-ring-primary, #2563eb)";
|
|
350
|
+
readonly danger: "var(--nb-color-danger, #dc2626)";
|
|
351
|
+
readonly success: "var(--nb-color-success, #059669)";
|
|
352
|
+
readonly warning: "var(--nb-color-warning, #f59e0b)";
|
|
353
|
+
readonly warm: "var(--nb-color-warm, #d4620a)";
|
|
354
|
+
readonly warmLight: "var(--nb-color-warm-light, #fef5ee)";
|
|
355
|
+
readonly processing: "var(--nb-color-processing, #7c3aed)";
|
|
356
|
+
readonly processingLight: "var(--nb-color-processing-light, #f3eeff)";
|
|
357
|
+
readonly infoLight: "var(--nb-color-info-light, #eef4ff)";
|
|
358
|
+
readonly fontSans: "var(--font-sans, system-ui, -apple-system, BlinkMacSystemFont, sans-serif)";
|
|
359
|
+
readonly fontMono: "var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace)";
|
|
360
|
+
readonly fontHeading: "var(--nb-font-heading, Georgia, 'Times New Roman', serif)";
|
|
361
|
+
readonly weightNormal: "var(--font-weight-normal, 400)";
|
|
362
|
+
readonly weightMedium: "var(--font-weight-medium, 500)";
|
|
363
|
+
readonly weightSemibold: "var(--font-weight-semibold, 600)";
|
|
364
|
+
readonly weightBold: "var(--font-weight-bold, 700)";
|
|
365
|
+
readonly textXsSize: "var(--font-text-xs-size, 0.75rem)";
|
|
366
|
+
readonly textXsLine: "var(--font-text-xs-line-height, 1rem)";
|
|
367
|
+
readonly textSmSize: "var(--font-text-sm-size, 0.875rem)";
|
|
368
|
+
readonly textSmLine: "var(--font-text-sm-line-height, 1.25rem)";
|
|
369
|
+
readonly textBaseSize: "var(--font-text-base-size, 1rem)";
|
|
370
|
+
readonly textBaseLine: "var(--font-text-base-line-height, 1.5rem)";
|
|
371
|
+
readonly textLgSize: "var(--font-text-lg-size, 1.125rem)";
|
|
372
|
+
readonly textLgLine: "var(--font-text-lg-line-height, 1.75rem)";
|
|
373
|
+
readonly headingSmSize: "var(--font-heading-sm-size, 1.25rem)";
|
|
374
|
+
readonly headingSmLine: "var(--font-heading-sm-line-height, 1.75rem)";
|
|
375
|
+
readonly headingMdSize: "var(--font-heading-md-size, 1.5rem)";
|
|
376
|
+
readonly headingMdLine: "var(--font-heading-md-line-height, 2rem)";
|
|
377
|
+
readonly headingLgSize: "var(--font-heading-lg-size, 2rem)";
|
|
378
|
+
readonly headingLgLine: "var(--font-heading-lg-line-height, 2.5rem)";
|
|
379
|
+
readonly radiusXs: "var(--border-radius-xs, 0.25rem)";
|
|
380
|
+
readonly radiusSm: "var(--border-radius-sm, 0.5rem)";
|
|
381
|
+
readonly radiusMd: "var(--border-radius-md, 0.75rem)";
|
|
382
|
+
readonly radiusLg: "var(--border-radius-lg, 1rem)";
|
|
383
|
+
readonly radiusXl: "var(--border-radius-xl, 1.5rem)";
|
|
384
|
+
readonly borderWidth: "var(--border-width-regular, 1px)";
|
|
385
|
+
readonly shadowHairline: "var(--shadow-hairline, 0 0 0 1px rgba(0,0,0,0.06))";
|
|
386
|
+
readonly shadowSm: "var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05))";
|
|
387
|
+
readonly shadowMd: "var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1))";
|
|
388
|
+
readonly shadowLg: "var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1))";
|
|
389
|
+
};
|
|
390
|
+
type Tokens = typeof tokens;
|
|
391
|
+
/** Body text sizes. */
|
|
392
|
+
type TextSize = "xs" | "sm" | "base" | "lg";
|
|
393
|
+
/** Heading sizes. */
|
|
394
|
+
type HeadingSize = "sm" | "md" | "lg";
|
|
395
|
+
/** `{ fontSize, lineHeight }` for a body-text level. */
|
|
396
|
+
declare function textStyle(size: TextSize): CSSProperties;
|
|
397
|
+
/** `{ fontSize, lineHeight }` for a heading level. */
|
|
398
|
+
declare function headingStyle(size: HeadingSize): CSSProperties;
|
|
399
|
+
|
|
400
|
+
type Tone = "default" | "muted" | "faint" | "accent" | "danger" | "success";
|
|
401
|
+
type Weight = "normal" | "medium" | "semibold" | "bold";
|
|
402
|
+
interface TextProps extends Omit<HTMLAttributes<HTMLElement>, "color"> {
|
|
403
|
+
size?: TextSize;
|
|
404
|
+
weight?: Weight;
|
|
405
|
+
tone?: Tone;
|
|
406
|
+
mono?: boolean;
|
|
407
|
+
/** Single-line ellipsis truncation. */
|
|
408
|
+
truncate?: boolean;
|
|
409
|
+
as?: ElementType;
|
|
410
|
+
children?: ReactNode;
|
|
411
|
+
}
|
|
412
|
+
/** Body text. Defaults to base size, normal weight, primary tone, sans font. */
|
|
413
|
+
declare function Text({ size, weight, tone, mono, truncate, as: As, style, children, ...rest }: TextProps): react_jsx_runtime.JSX.Element;
|
|
414
|
+
interface HeadingProps extends Omit<HTMLAttributes<HTMLHeadingElement>, "color"> {
|
|
415
|
+
size?: HeadingSize;
|
|
416
|
+
weight?: Weight;
|
|
417
|
+
tone?: Tone;
|
|
418
|
+
as?: ElementType;
|
|
419
|
+
children?: ReactNode;
|
|
420
|
+
}
|
|
421
|
+
/** Display heading using the heading font slot. Defaults to md, semibold. */
|
|
422
|
+
declare function Heading({ size, weight, tone, as: As, style, children, ...rest }: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
423
|
+
|
|
424
|
+
export { AppFrame, Avatar, Badge, type BadgeTone, Button, Card, type Column, Divider, Drawer, EmptyState, Heading, type HeadingSize, Inline, ListDetailLayout, ListRow, Pagination, Prose, SearchField, SegmentedControl, SidebarLayout, Spacer, Spinner, Stack, type Status, StatusDot, Table, Text, TextLink, type TextSize, type Tokens, headingStyle, textStyle, tokens, useBreakpoint, useListDetail, useSidebar };
|