@ai-matrx/design-system 0.60.1 → 0.60.6

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.
@@ -0,0 +1,484 @@
1
+ import { ClassValue } from 'clsx';
2
+ import * as React from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ export { A as AppRail, a as AppRailAvatar, b as AppRailAvatarProps, c as AppRailGroup, d as AppRailItem, e as AppRailItemProps, f as AppRailSpacer, C as CanvasColumnDef, g as CanvasLayout, h as CanvasLayoutProps, i as CanvasPanelDef, j as Checkbox, k as CheckboxProps, l as Collapsible, m as CollapsibleContent, n as CollapsibleTrigger, o as ConfirmDialog, p as ConfirmDialogHost, q as ConfirmDialogProps, r as ContextMenu, s as ContextMenuContent, t as ContextMenuItem, u as ContextMenuSeparator, v as ContextMenuShortcut, w as ContextMenuTrigger, D as Dialog, x as DialogClose, y as DialogContent, z as DialogDescription, B as DialogFooter, E as DialogHeader, F as DialogTitle, G as DialogTrigger, H as DropdownMenu, I as DropdownMenuCheckboxItem, J as DropdownMenuContent, K as DropdownMenuGroup, L as DropdownMenuItem, M as DropdownMenuLabel, N as DropdownMenuRadioGroup, O as DropdownMenuRadioItem, P as DropdownMenuSeparator, Q as DropdownMenuShortcut, R as DropdownMenuSub, S as DropdownMenuSubContent, T as DropdownMenuSubTrigger, U as DropdownMenuTrigger, V as ModeSwitch, W as ModeSwitchOption, X as ModeSwitchProps, Y as OrganizationMark, Z as Popover, _ as PopoverAnchor, $ as PopoverContent, a0 as PopoverTrigger, a1 as Skeleton, a2 as StatusDot, a3 as StatusDotProps, a4 as StatusTone, a5 as Switch, a6 as SwitchProps, a7 as Tooltip, a8 as TooltipContent, a9 as TooltipContentProps, aa as TooltipProvider, ab as TooltipTrigger, ac as organizationColor } from './organization-picker-mLqIcesx.js';
6
+ import '@radix-ui/react-switch';
7
+ import '@radix-ui/react-checkbox';
8
+ import '@radix-ui/react-tooltip';
9
+ import '@radix-ui/react-dropdown-menu';
10
+ import '@radix-ui/react-context-menu';
11
+ import '@radix-ui/react-dialog';
12
+ import '@radix-ui/react-popover';
13
+ import '@radix-ui/react-collapsible';
14
+
15
+ declare function cn(...inputs: ClassValue[]): string;
16
+
17
+ /** The macOS text styles. Nothing else sets a font size in desktop app code. */
18
+ type TextVariant = "title-large" | "title-1" | "title-2" | "title-3" | "headline" | "body" | "callout" | "caption";
19
+ /** Emphasis levels and status tones. Status tones are for status words only, never decoration. */
20
+ type TextTone = "primary" | "secondary" | "tertiary" | "tint" | "danger" | "warning" | "success";
21
+ declare const TEXT_TONE: Record<TextTone, string>;
22
+ interface TextProps extends React.HTMLAttributes<HTMLElement> {
23
+ variant?: TextVariant | undefined;
24
+ tone?: TextTone | undefined;
25
+ /** Medium weight for emphasis inside body copy (titles carry their own weight). */
26
+ emphasized?: boolean | undefined;
27
+ mono?: boolean | undefined;
28
+ /** One line, ellipsis at the end. */
29
+ truncate?: boolean | undefined;
30
+ /** Numbers that line up in columns. */
31
+ tabular?: boolean | undefined;
32
+ /** Text the user may select and copy (desktop chrome is unselectable by default). */
33
+ selectable?: boolean | undefined;
34
+ as?: "span" | "p" | "div" | "h1" | "h2" | "h3" | "label" | "dt" | "dd";
35
+ }
36
+ declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLElement>>;
37
+
38
+ interface SpinnerProps extends React.SVGAttributes<SVGSVGElement> {
39
+ size?: "sm" | "md" | "lg" | "xl";
40
+ /** Accessible name; omit when a visible label already says what is loading. */
41
+ label?: string;
42
+ }
43
+ /** The macOS activity indicator: twelve fading spokes, stepped rotation. */
44
+ declare function Spinner({ size, label, className, ...props }: SpinnerProps): React.JSX.Element;
45
+
46
+ /**
47
+ * The macOS push button family.
48
+ * - `primary`: the default action (the one blue button in a sheet or form). One per view.
49
+ * - `secondary`: an ordinary push button (raised control surface, hairline edge).
50
+ * - `plain`: borderless toolbar/inline button; shows a fill on hover.
51
+ * - `destructive`: an action that removes or stops something.
52
+ */
53
+ declare const buttonVariants: (props?: ({
54
+ variant?: "primary" | "secondary" | "plain" | "destructive" | null | undefined;
55
+ size?: "sm" | "md" | "lg" | null | undefined;
56
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
57
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
58
+ /** Leading icon (16 px; 14 px at `sm`). */
59
+ icon?: React.ReactNode;
60
+ /** Shows the activity indicator in place of the icon and disables the button. */
61
+ busy?: boolean;
62
+ asChild?: boolean;
63
+ }
64
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
65
+ declare const iconButtonVariants: (props?: ({
66
+ size?: "sm" | "md" | null | undefined;
67
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
68
+ interface IconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "aria-label">, VariantProps<typeof iconButtonVariants> {
69
+ icon: React.ReactNode;
70
+ /** Required: the accessible name and the tooltip. An icon without a name is a guess. */
71
+ label: string;
72
+ /** Keyboard shortcut shown in the tooltip, e.g. "⌘K". */
73
+ shortcut?: string;
74
+ /** Pressed/on state for toggles (sidebar visibility, filters). */
75
+ active?: boolean;
76
+ }
77
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
78
+
79
+ /** The text field surface: inset well, hairline edge, tint halo on focus. */
80
+ declare const FIELD = "focus-ring w-full min-w-0 rounded-control bg-control text-body text-label shadow-control placeholder:text-label-tertiary disabled:opacity-40 read-only:bg-fill";
81
+ interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
82
+ size?: "sm" | "md";
83
+ invalid?: boolean;
84
+ }
85
+ declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
86
+ interface TextAreaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
87
+ invalid?: boolean;
88
+ }
89
+ declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
90
+ interface SearchFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "onChange" | "type"> {
91
+ value: string;
92
+ onValueChange: (value: string) => void;
93
+ size?: "sm" | "md";
94
+ }
95
+ /** The rounded search field: magnifier, clear button when non-empty, Escape clears. */
96
+ declare const SearchField: React.ForwardRefExoticComponent<SearchFieldProps & React.RefAttributes<HTMLInputElement>>;
97
+
98
+ interface SelectOption {
99
+ value: string;
100
+ label: React.ReactNode;
101
+ disabled?: boolean;
102
+ }
103
+ interface SelectProps {
104
+ value: string | undefined;
105
+ onValueChange: (value: string) => void;
106
+ /** Options; `"-"` draws a separator. */
107
+ options: ReadonlyArray<SelectOption | "-">;
108
+ placeholder?: string;
109
+ size?: "sm" | "md";
110
+ disabled?: boolean;
111
+ /** Accessible name when no visible label is associated. */
112
+ "aria-label"?: string;
113
+ id?: string;
114
+ className?: string;
115
+ /** `data-*` hooks land on the trigger. */
116
+ [data: `data-${string}`]: string | undefined;
117
+ }
118
+ /** The macOS pop-up button: a raised control with the up/down chevron, menu of options. */
119
+ declare function Select({ value, onValueChange, options, placeholder, size, disabled, id, className, "aria-label": ariaLabel, ...data }: SelectProps): React.JSX.Element;
120
+
121
+ interface Segment<T extends string> {
122
+ value: T;
123
+ label: React.ReactNode;
124
+ /** Required when `label` is an icon. */
125
+ ariaLabel?: string;
126
+ disabled?: boolean;
127
+ }
128
+ interface SegmentedProps<T extends string> {
129
+ value: T;
130
+ onValueChange: (value: T) => void;
131
+ segments: ReadonlyArray<Segment<T>>;
132
+ size?: "sm" | "md";
133
+ "aria-label": string;
134
+ className?: string;
135
+ [data: `data-${string}`]: string | undefined;
136
+ }
137
+ /** The macOS segmented control: one choice of a few (≤ 5), arrow keys move between segments. */
138
+ declare function Segmented<T extends string>({ value, onValueChange, segments, size, className, "aria-label": ariaLabel, ...data }: SegmentedProps<T>): React.JSX.Element;
139
+
140
+ type PageWidth = "form" | "wide" | "full";
141
+ interface PageProps extends React.HTMLAttributes<HTMLDivElement> {
142
+ /** `wide` (default) for every screen that lists things — tables, devices, displays, windows;
143
+ * `form` for settings and one thing's facts (the body narrows, the left edge and header stay);
144
+ * `full` only for a canvas-like screen. */
145
+ width?: PageWidth;
146
+ /** The page header; drawn at the top of the scrolling column. */
147
+ header?: React.ReactNode;
148
+ }
149
+ /**
150
+ * One scrolling content page: fixed side gutters, a centred column of the chosen width, and the
151
+ * same vertical rhythm on every screen (24 px between sections).
152
+ */
153
+ declare const Page: React.ForwardRefExoticComponent<PageProps & React.RefAttributes<HTMLDivElement>>;
154
+ interface PageHeaderProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
155
+ title: React.ReactNode;
156
+ /** One short line under the title (a status or a count; never a paragraph). */
157
+ subtitle?: React.ReactNode;
158
+ /** Leading icon or symbol (32 px). */
159
+ icon?: React.ReactNode;
160
+ /** Trailing controls: buttons, a search field. */
161
+ actions?: React.ReactNode;
162
+ }
163
+ declare function PageHeader({ title, subtitle, icon, actions, className, ...props }: PageHeaderProps): React.JSX.Element;
164
+ interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
165
+ /** The toolbar drags the window (title bar / unified toolbar). Controls inside never drag. */
166
+ draggable?: boolean;
167
+ }
168
+ /** A unified-toolbar row: 52 px, controls 28 px, 8 px apart. */
169
+ declare function Toolbar({ draggable, className, ...props }: ToolbarProps): React.JSX.Element;
170
+ /** Pushes the following toolbar items to the trailing edge. */
171
+ declare function ToolbarSpacer(): React.JSX.Element;
172
+ /** A thin vertical rule between toolbar groups. */
173
+ declare function ToolbarDivider(): React.JSX.Element;
174
+
175
+ interface SectionProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"> {
176
+ /** Section title above the group (headline). */
177
+ title?: React.ReactNode;
178
+ /** Controls on the title line (a button, a count). */
179
+ actions?: React.ReactNode;
180
+ /** Explanatory line below the group (caption, secondary). */
181
+ footer?: React.ReactNode;
182
+ /** `grouped` (default) draws the inset rounded box with hairlines between rows (System
183
+ * Settings). `plain` draws the rows straight on the page. */
184
+ appearance?: "grouped" | "plain";
185
+ }
186
+ /**
187
+ * A titled group of rows. Children are `Row`s (or `SectionContent` for free content); the
188
+ * hairline between rows is drawn here, inset to where the text starts, so no screen draws its own.
189
+ */
190
+ declare function Section({ title, actions, footer, appearance, className, children, ...props }: SectionProps): React.JSX.Element;
191
+ /** Free content inside a Section's group (a chart, a code block), with the group's padding. */
192
+ declare function SectionContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
193
+ interface RowProps extends Omit<React.HTMLAttributes<HTMLElement>, "title" | "onSelect"> {
194
+ /** Leading icon (16 px) or a small image. */
195
+ icon?: React.ReactNode;
196
+ title: React.ReactNode;
197
+ /** Second line under the title; makes the row tall. */
198
+ subtitle?: React.ReactNode;
199
+ /** Trailing value text (secondary), e.g. "16 GB". */
200
+ value?: React.ReactNode;
201
+ /** Trailing control (a Switch, a Button, a Tag). Clicks inside it never select the row. */
202
+ accessory?: React.ReactNode;
203
+ /** Shows the disclosure chevron: the row opens a deeper page. */
204
+ chevron?: boolean;
205
+ /** Makes the whole row a button. */
206
+ onSelect?: () => void;
207
+ selected?: boolean;
208
+ disabled?: boolean;
209
+ destructive?: boolean;
210
+ /** Monospace title (paths, commands, identifiers). */
211
+ mono?: boolean;
212
+ }
213
+ /**
214
+ * THE row. Leading icon · title / subtitle · value · accessory · chevron. 36 px single line,
215
+ * 48 px with a subtitle. Selectable rows are buttons with the tint focus ring.
216
+ */
217
+ declare const Row: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLElement>>;
218
+ interface FieldRowProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "action"> {
219
+ /** Label before the field (omit when the Section title already says it). */
220
+ label?: React.ReactNode;
221
+ /** The input: TextField, SearchField or Select. */
222
+ field: React.ReactNode;
223
+ /** The action that uses it (a Button; `type="submit"` makes Enter run it). */
224
+ action?: React.ReactNode;
225
+ /** Runs on Enter / the submit button. */
226
+ onSubmit?: () => void;
227
+ /** A multi-line field (TextArea): the action sits under it, at the trailing edge. */
228
+ stacked?: boolean;
229
+ }
230
+ /**
231
+ * THE input-plus-action row (a command to start, a link to open, a path to transcribe): one row in
232
+ * a Section, the field filling the space, the action at the trailing edge. Enter submits.
233
+ */
234
+ declare function FieldRow({ label, field, action, onSubmit, stacked, className, ...props }: FieldRowProps): React.JSX.Element;
235
+
236
+ interface CodeBlockProps extends React.HTMLAttributes<HTMLPreElement> {
237
+ /** Cap the height and scroll inside (long output, clipboard text, logs). */
238
+ scroll?: boolean;
239
+ /** Keep the newest line in view as text arrives (live output), unless the person scrolled up. */
240
+ follow?: boolean;
241
+ }
242
+ /** Preformatted, selectable monospace text: command output, file contents, the clipboard. */
243
+ declare function CodeBlock({ scroll, follow, className, children, ...props }: CodeBlockProps): React.JSX.Element;
244
+
245
+ interface Column<T> {
246
+ key: string;
247
+ header: React.ReactNode;
248
+ /** Cell content. Strings truncate with an ellipsis. */
249
+ cell: (row: T) => React.ReactNode;
250
+ /** Column width: `auto` shares the remaining space (default); `fit` shrinks to its content;
251
+ * the named widths are fixed. */
252
+ width?: "auto" | "fit" | "xs" | "sm" | "md" | "lg";
253
+ align?: "start" | "end" | "center";
254
+ /** Numbers: right-aligned, tabular figures. */
255
+ numeric?: boolean;
256
+ mono?: boolean;
257
+ /** Makes the header sortable (click, or Enter on it); returns the ascending order. */
258
+ sort?: (a: T, b: T) => number;
259
+ }
260
+ /** The ONE action a row may show inline: always a small secondary button, never destructive. */
261
+ interface RowAction {
262
+ label: string;
263
+ onSelect: () => void;
264
+ disabled?: boolean;
265
+ }
266
+ /** Everything else a row can do, behind its More button. Destructive items are drawn in red and
267
+ * ask for confirmation in their own words. */
268
+ interface RowMenuItem {
269
+ label: string;
270
+ onSelect: () => void;
271
+ /** Drawn in red; with `confirm`, asks first ("Stop node (pid 96209)?"). */
272
+ destructive?: boolean;
273
+ /** The confirmation question for a destructive item. */
274
+ confirm?: string;
275
+ disabled?: boolean;
276
+ }
277
+ interface SortState {
278
+ key: string;
279
+ direction: "ascending" | "descending";
280
+ }
281
+ interface DataTableProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "aria-label"> {
282
+ columns: ReadonlyArray<Column<T>>;
283
+ rows: ReadonlyArray<T>;
284
+ rowKey: (row: T) => string;
285
+ /** Row activation (click / Enter). */
286
+ onRowSelect?: (row: T) => void;
287
+ selectedKey?: string | null;
288
+ /** Shown in place of the body when there are no rows (use `StateView`). */
289
+ empty?: React.ReactNode;
290
+ /** Accessible name. */
291
+ "aria-label": string;
292
+ /** Alternating row backgrounds (macOS table default). */
293
+ striped?: boolean;
294
+ /** An outline row: content shown under the row when it is expanded (disclosure triangle,
295
+ * click or Right/Left arrow). Return null for a row with nothing to show. */
296
+ detail?: (row: T) => React.ReactNode | null;
297
+ /** Rows that cannot be selected or expanded (drawn dimmed). */
298
+ isDisabled?: (row: T) => boolean;
299
+ /** The row's one inline action (e.g. Open, Show, Capture). */
300
+ rowAction?: (row: T) => RowAction | null;
301
+ /** The row's other actions (Edit, Remove, Stop), behind a More button. */
302
+ rowMenu?: (row: T) => ReadonlyArray<RowMenuItem> | null;
303
+ /** Initial sort (a sortable column's key). The person can change it by clicking headers. */
304
+ defaultSort?: SortState;
305
+ /** `data-*` attributes for a row (test hooks, state markers). */
306
+ rowData?: (row: T) => Record<`data-${string}`, string | undefined>;
307
+ className?: string;
308
+ }
309
+ /**
310
+ * The macOS table: 24 px rows, caption-weight headers, hairline under the header, optional
311
+ * alternating rows, tint selection. Arrow keys move between rows when rows are selectable.
312
+ */
313
+ declare function DataTable<T>({ columns, rows, rowKey, onRowSelect, selectedKey, empty, striped, detail, isDisabled, rowAction, rowMenu, defaultSort, rowData, className, "aria-label": ariaLabel, ...rest }: DataTableProps<T>): React.JSX.Element;
314
+
315
+ /**
316
+ * The source list (Finder / Mail / Notes sidebar). Sections of 28 px rows; the open row carries a
317
+ * neutral selection fill that dims when the window is inactive (`[data-window-active=false]` on any
318
+ * ancestor). Up/Down arrow keys move between rows; Home/End jump to the ends.
319
+ */
320
+ declare function SourceList({ className, onKeyDown, ...props }: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
321
+ interface SourceListSectionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
322
+ title?: React.ReactNode;
323
+ /** A trailing control on the title line (an IconButton "+"). */
324
+ action?: React.ReactNode;
325
+ }
326
+ declare function SourceListSection({ title, action, className, children, ...props }: SourceListSectionProps): React.JSX.Element;
327
+ interface SourceListItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
328
+ /** Leading icon (16 px, secondary) or a StatusLight. */
329
+ icon?: React.ReactNode;
330
+ label: React.ReactNode;
331
+ /** Second line (caption): makes the row two lines tall. */
332
+ hint?: React.ReactNode;
333
+ /** Trailing count or Tag. */
334
+ badge?: React.ReactNode;
335
+ /** This row is the open page. */
336
+ current?: boolean;
337
+ }
338
+ declare const SourceListItem: React.ForwardRefExoticComponent<SourceListItemProps & React.RefAttributes<HTMLButtonElement>>;
339
+ /** "Show more / Show less" under a long section. */
340
+ interface SourceListMoreProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> {
341
+ expanded: boolean;
342
+ onToggle: () => void;
343
+ }
344
+ declare function SourceListMore({ expanded, onToggle, className, ...props }: SourceListMoreProps): React.JSX.Element;
345
+
346
+ /** Any read in flight: the shape `useDesktopRequest` returns (and any query hook can match). */
347
+ interface ResourceState<T> {
348
+ data: T | undefined;
349
+ error: {
350
+ message: string;
351
+ } | undefined | null;
352
+ loading: boolean;
353
+ refetch?: () => unknown;
354
+ }
355
+ interface ResourceProps<T> {
356
+ state: ResourceState<T>;
357
+ /** What is being read, as the loading line ("Reading processes"). */
358
+ loading: string;
359
+ /** What failed, as the error title ("Processes can't be read"). */
360
+ failed: string;
361
+ /** Treat the data as empty (render `empty`). Default: an empty array. */
362
+ isEmpty?: (data: T) => boolean;
363
+ /** The empty state (a StateView kind="empty"). */
364
+ empty?: React.ReactNode;
365
+ /** `page` fills the content area; `inline` sits in a section (default). */
366
+ size?: "page" | "inline";
367
+ children: (data: T) => React.ReactNode;
368
+ }
369
+ /**
370
+ * THE way a screen shows data it reads: loading → error (with Try again) → empty → the content.
371
+ * Once data has arrived, a background refresh never blanks it; a refresh error keeps the last data.
372
+ */
373
+ declare function Resource<T>({ state, loading, failed, isEmpty, empty, size, children }: ResourceProps<T>): React.JSX.Element;
374
+
375
+ interface ComingSoonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
376
+ /** The feature's icon (the same one its menu entry shows). */
377
+ icon: React.ReactNode;
378
+ /** The feature's name, exactly as its menu entry says it. */
379
+ title: string;
380
+ /** One line: what it will do for the person. */
381
+ summary: string;
382
+ /** Up to four short lines: what it will include. */
383
+ includes?: ReadonlyArray<string>;
384
+ }
385
+ /**
386
+ * THE page for anything not built yet. Every menu entry, button and route either opens its real
387
+ * screen or this — never a control that does nothing. Same place, same look, every time.
388
+ */
389
+ declare function ComingSoon({ icon, title, summary, includes, className, ...props }: ComingSoonProps): React.JSX.Element;
390
+
391
+ interface StateViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
392
+ /** `empty`: nothing here yet. `loading`: work in flight. `error`: it failed (say why). */
393
+ kind: "empty" | "loading" | "error";
394
+ /** Large glyph (empty/error). Loading always shows the activity indicator. */
395
+ icon?: React.ReactNode;
396
+ title: React.ReactNode;
397
+ /** One line: the reason, or what to do. */
398
+ message?: React.ReactNode;
399
+ /** One or two Buttons (Retry, Create). */
400
+ actions?: React.ReactNode;
401
+ /** `page` centres in the whole content area; `inline` sits inside a section or table. */
402
+ size?: "page" | "inline";
403
+ }
404
+ /** THE empty / loading / error state. Every screen says these three things the same way. */
405
+ declare function StateView({ kind, icon, title, message, actions, size, className, ...props }: StateViewProps): React.JSX.Element;
406
+ type BannerTone = "neutral" | "info" | "warning" | "danger" | "success";
407
+ interface BannerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
408
+ tone: BannerTone;
409
+ icon?: React.ReactNode;
410
+ title: React.ReactNode;
411
+ message?: React.ReactNode;
412
+ /** Trailing Buttons (size sm). */
413
+ actions?: React.ReactNode;
414
+ }
415
+ /** An inline notice above content: something failed, needs attention, or just happened. */
416
+ declare function Banner({ tone, icon, title, message, actions, className, ...props }: BannerProps): React.JSX.Element;
417
+ interface ErrorBannerProps extends Omit<BannerProps, "tone" | "title" | "message" | "actions"> {
418
+ /** The failed action's error (e.g. `useDesktopAction().error`); nothing renders without one. */
419
+ error: {
420
+ message: string;
421
+ } | null | undefined;
422
+ onDismiss: () => void;
423
+ /** Headline; default "That didn't work". */
424
+ title?: React.ReactNode;
425
+ }
426
+ /** THE banner for a failed action: the error's own words and a Dismiss button. */
427
+ declare function ErrorBanner({ error, onDismiss, title, ...props }: ErrorBannerProps): React.JSX.Element | null;
428
+
429
+ interface MeterProps {
430
+ [data: `data-${string}`]: string | undefined;
431
+ /** 0 … max. `null` draws the indeterminate bar. */
432
+ value: number | null;
433
+ max?: number;
434
+ /** `level` colours by fullness (green → orange ≥ 70 % → red ≥ 90 %), for capacity (disk, memory).
435
+ * `progress` is always the tint, for work under way. */
436
+ kind?: "level" | "progress";
437
+ size?: "sm" | "md";
438
+ "aria-label": string;
439
+ className?: string;
440
+ }
441
+ declare const METER_THRESHOLDS: {
442
+ readonly warning: 0.7;
443
+ readonly critical: 0.9;
444
+ };
445
+ declare function meterTone(fraction: number): "normal" | "warning" | "critical";
446
+ /** The level indicator / progress bar. One threshold rule for every capacity in the app. */
447
+ declare function Meter({ value, max, kind, size, className, "aria-label": ariaLabel, ...data }: MeterProps): React.JSX.Element;
448
+
449
+ type TagTone = "neutral" | "tint" | "success" | "warning" | "danger";
450
+ interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
451
+ tone?: TagTone;
452
+ }
453
+ /** A small capsule label: a state ("Running"), a kind ("Beta"), a count. Caption size, 18 px. */
454
+ declare function Tag({ tone, className, ...props }: TagProps): React.JSX.Element;
455
+ type StatusTone = "neutral" | "success" | "warning" | "danger" | "tint";
456
+ /** The status light (8 px): running, stopped, needs attention. Always paired with words or a label. */
457
+ interface StatusLightProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
458
+ tone: StatusTone;
459
+ /** What the light means ("Running"); read by assistive tech unless `aria-hidden`. */
460
+ label: string;
461
+ }
462
+ declare function StatusLight({ tone, label, className, ...props }: StatusLightProps): React.JSX.Element;
463
+ /** A keyboard shortcut, e.g. `<Kbd>⌘K</Kbd>`. */
464
+ declare function Kbd({ className, ...props }: React.HTMLAttributes<HTMLElement>): React.JSX.Element;
465
+
466
+ /**
467
+ * Display formatting for desktop screens: ONE way to show a size, a duration, a time and an error.
468
+ * macOS shows file and memory sizes in decimal units (1 GB = 1,000,000,000 bytes), so do we.
469
+ */
470
+ declare function formatBytes(bytes: number | null | undefined): string;
471
+ /** "3 sec", "4 min", "2 hr 5 min", "3 days 4 hr" — the two largest units. */
472
+ declare function formatDuration(ms: number | null | undefined): string;
473
+ /** "just now", "5 minutes ago", "yesterday", then a date (Finder's Date Modified style). */
474
+ declare function formatRelativeTime(at: Date | number | string | null | undefined, now?: number): string;
475
+ /** The human sentence for any thrown value. */
476
+ declare function errorMessage(error: unknown): string;
477
+ /** The compact age for dense table cells: "now", "5m", "10h", "3d", then "Oct 3" (Mail's list). */
478
+ declare function formatAge(at: Date | number | string | null | undefined, now?: number): string;
479
+ /** A time of day, the way the menu bar shows it: "2:44 PM" (24-hour where the person's locale is). */
480
+ declare function formatClockTime(at: Date | number | string | null | undefined): string;
481
+ /** How much of a capacity is used, in the same words everywhere: "183 GB of 275 GB in use". */
482
+ declare function formatUsage(used: number | null | undefined, total: number | null | undefined): string;
483
+
484
+ export { Banner, type BannerProps, type BannerTone, Button, type ButtonProps, CodeBlock, type CodeBlockProps, type Column, ComingSoon, type ComingSoonProps, DataTable, type DataTableProps, ErrorBanner, type ErrorBannerProps, FIELD, FieldRow, type FieldRowProps, IconButton, type IconButtonProps, Kbd, METER_THRESHOLDS, Meter, type MeterProps, Page, PageHeader, type PageHeaderProps, type PageProps, type PageWidth, Resource, type ResourceProps, type ResourceState, Row, type RowAction, type RowMenuItem, type RowProps, SearchField, type SearchFieldProps, Section, SectionContent, type SectionProps, type Segment, Segmented, type SegmentedProps, Select, type SelectOption, type SelectProps, type SortState, SourceList, SourceListItem, type SourceListItemProps, SourceListMore, type SourceListMoreProps, SourceListSection, type SourceListSectionProps, Spinner, type SpinnerProps, StateView, type StateViewProps, StatusLight, type StatusLightProps, type StatusTone as StatusLightTone, TEXT_TONE, Tag, type TagProps, type TagTone, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, type TextTone, type TextVariant, Toolbar, ToolbarDivider, type ToolbarProps, ToolbarSpacer, buttonVariants, cn, errorMessage, formatAge, formatBytes, formatClockTime, formatDuration, formatRelativeTime, formatUsage, meterTone };