@ship-it-ui/ui 0.0.2 → 0.0.4
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/dist/index.cjs +1639 -583
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +385 -27
- package/dist/index.d.ts +385 -27
- package/dist/index.js +1643 -583
- package/dist/index.js.map +1 -1
- package/package.json +8 -4
- package/src/styles/globals.css +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
2
|
export { ClassValue } from 'clsx';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
-
import { useEffect, KeyboardEvent, RefObject, ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, AnchorHTMLAttributes, Ref, FC, SVGAttributes } from 'react';
|
|
4
|
+
import { useEffect, KeyboardEvent, RefObject, ButtonHTMLAttributes, ReactNode, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, AnchorHTMLAttributes, Ref, LabelHTMLAttributes, FC, SVGAttributes } from 'react';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
6
|
import { VariantProps } from 'class-variance-authority';
|
|
7
7
|
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
@@ -593,6 +593,37 @@ type KbdProps = HTMLAttributes<HTMLElement>;
|
|
|
593
593
|
*/
|
|
594
594
|
declare const Kbd: react.ForwardRefExoticComponent<KbdProps & react.RefAttributes<HTMLElement>>;
|
|
595
595
|
|
|
596
|
+
/**
|
|
597
|
+
* ScrollArea — token-styled scrollbar primitive built on
|
|
598
|
+
* `@radix-ui/react-scroll-area`. Wraps a viewport with custom scrollbars that
|
|
599
|
+
* match the design tokens (`--color-text-muted` thumb on `--color-panel-2`
|
|
600
|
+
* track) and behave consistently across platforms.
|
|
601
|
+
*
|
|
602
|
+
* Defaults to `type="hover"` so scrollbars fade in only when the pointer is
|
|
603
|
+
* over the area, matching the system feel without the OS-default chrome.
|
|
604
|
+
*/
|
|
605
|
+
type ScrollAreaType = 'auto' | 'always' | 'scroll' | 'hover';
|
|
606
|
+
interface ScrollAreaProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onScroll' | 'dir'> {
|
|
607
|
+
/** Scrollbar visibility behavior. Default `'hover'`. */
|
|
608
|
+
type?: ScrollAreaType;
|
|
609
|
+
/** Which scrollbars to render. Default `'vertical'`. */
|
|
610
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
611
|
+
/** Time in ms before scrollbar hides after the last interaction (auto/scroll/hover). */
|
|
612
|
+
scrollHideDelay?: number;
|
|
613
|
+
/** Class applied to the inner viewport rather than the outer root. */
|
|
614
|
+
viewportClassName?: string;
|
|
615
|
+
/**
|
|
616
|
+
* Ref to the inner viewport (the scrollable element). Useful when a consumer
|
|
617
|
+
* wants to drive scroll position imperatively without losing the outer-root
|
|
618
|
+
* ref forwarded as `ref`.
|
|
619
|
+
*/
|
|
620
|
+
viewportRef?: Ref<HTMLDivElement>;
|
|
621
|
+
/** Document direction for RTL handling. */
|
|
622
|
+
dir?: 'ltr' | 'rtl';
|
|
623
|
+
children?: ReactNode;
|
|
624
|
+
}
|
|
625
|
+
declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaProps & react.RefAttributes<HTMLDivElement>>;
|
|
626
|
+
|
|
596
627
|
declare const skeletonStyles: (props?: ({
|
|
597
628
|
shape?: "circle" | "line" | "block" | null | undefined;
|
|
598
629
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
@@ -1170,6 +1201,28 @@ interface DotsProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
|
|
|
1170
1201
|
}
|
|
1171
1202
|
declare const Dots: react.ForwardRefExoticComponent<DotsProps & react.RefAttributes<HTMLElement>>;
|
|
1172
1203
|
|
|
1204
|
+
/**
|
|
1205
|
+
* Dropzone — drag-and-drop file capture surface with a click-to-browse
|
|
1206
|
+
* fallback. Manages its own drag-over state and forwards file drops to
|
|
1207
|
+
* `onFiles`. Native `<input type="file">` covers keyboard / a11y.
|
|
1208
|
+
*/
|
|
1209
|
+
interface DropzoneProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'onDrop' | 'onDragOver' | 'onDragLeave' | 'title'> {
|
|
1210
|
+
/** Fired with the dropped or selected files. */
|
|
1211
|
+
onFiles?: (files: File[]) => void;
|
|
1212
|
+
/** Limit accepted MIME types or extensions. Forwarded to the hidden input + filtered on drop. */
|
|
1213
|
+
accept?: string;
|
|
1214
|
+
/** Allow multiple files. Default true. */
|
|
1215
|
+
multiple?: boolean;
|
|
1216
|
+
/** Heading text. Default "Drop files to ingest". */
|
|
1217
|
+
title?: ReactNode;
|
|
1218
|
+
/** Subtitle / hint text rendered below the title. */
|
|
1219
|
+
description?: ReactNode;
|
|
1220
|
+
/** Glyph at the top of the surface. Default `↥`. */
|
|
1221
|
+
icon?: ReactNode;
|
|
1222
|
+
disabled?: boolean;
|
|
1223
|
+
}
|
|
1224
|
+
declare const Dropzone: react.ForwardRefExoticComponent<DropzoneProps & react.RefAttributes<HTMLLabelElement>>;
|
|
1225
|
+
|
|
1173
1226
|
/**
|
|
1174
1227
|
* EmptyState — placeholder for empty lists, no-results states, and error
|
|
1175
1228
|
* surfaces. A 48×48 icon plate sits above a title + description and an
|
|
@@ -1223,6 +1276,117 @@ interface FileChipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>
|
|
|
1223
1276
|
}
|
|
1224
1277
|
declare const FileChip: react.ForwardRefExoticComponent<FileChipProps & react.RefAttributes<HTMLDivElement>>;
|
|
1225
1278
|
|
|
1279
|
+
/**
|
|
1280
|
+
* FilterPanel — multi-facet checkbox filter panel. Pass a `facets` array
|
|
1281
|
+
* describing each facet (label, options, optional collapsibility); the panel
|
|
1282
|
+
* renders a header with a reset action, then each facet as a labeled
|
|
1283
|
+
* checkbox group. Selections are emitted as
|
|
1284
|
+
* `Record<facetId, readonly string[]>` and supported in both controlled and
|
|
1285
|
+
* uncontrolled modes — mirroring `Slider` and `NavBar`.
|
|
1286
|
+
*
|
|
1287
|
+
* Reset both invokes the optional `onReset` callback and emits an empty
|
|
1288
|
+
* selection through `onValueChange`, so consumers can drive either signal.
|
|
1289
|
+
*/
|
|
1290
|
+
interface FilterFacetOption {
|
|
1291
|
+
value: string;
|
|
1292
|
+
label: ReactNode;
|
|
1293
|
+
}
|
|
1294
|
+
interface FilterFacet {
|
|
1295
|
+
id: string;
|
|
1296
|
+
label: ReactNode;
|
|
1297
|
+
options: ReadonlyArray<FilterFacetOption>;
|
|
1298
|
+
/** Whether the group can collapse. Default `true`. */
|
|
1299
|
+
collapsible?: boolean;
|
|
1300
|
+
/** Initial open state for collapsible groups. Default `true`. */
|
|
1301
|
+
defaultOpen?: boolean;
|
|
1302
|
+
}
|
|
1303
|
+
type FilterPanelValue = Record<string, ReadonlyArray<string>>;
|
|
1304
|
+
interface FilterPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onReset' | 'defaultValue' | 'title'> {
|
|
1305
|
+
facets: ReadonlyArray<FilterFacet>;
|
|
1306
|
+
/** Controlled selection map keyed by facet id. */
|
|
1307
|
+
value?: FilterPanelValue;
|
|
1308
|
+
/** Uncontrolled initial selection map. Default `{}`. */
|
|
1309
|
+
defaultValue?: FilterPanelValue;
|
|
1310
|
+
/** Fires whenever the selection changes — including reset. */
|
|
1311
|
+
onValueChange?: (next: FilterPanelValue) => void;
|
|
1312
|
+
/** Fired when the reset action is invoked, alongside `onValueChange({})`. */
|
|
1313
|
+
onReset?: () => void;
|
|
1314
|
+
/**
|
|
1315
|
+
* Optional per-option counts shown in a trailing pill. Shape:
|
|
1316
|
+
* `{ [facetId]: { [optionValue]: number } }`.
|
|
1317
|
+
*/
|
|
1318
|
+
counts?: Record<string, Record<string, number>>;
|
|
1319
|
+
/** Override the header title. Default `'Filter'`. */
|
|
1320
|
+
title?: ReactNode;
|
|
1321
|
+
/** Override the reset button label. Default `'Reset'`. */
|
|
1322
|
+
resetLabel?: ReactNode;
|
|
1323
|
+
}
|
|
1324
|
+
declare const FilterPanel: react.ForwardRefExoticComponent<FilterPanelProps & react.RefAttributes<HTMLDivElement>>;
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* RadialProgress — circular SVG progress ring. Renders the percent label in the
|
|
1328
|
+
* center by default; pass `children` to override (e.g., a glyph or a count).
|
|
1329
|
+
*
|
|
1330
|
+
* Tones: accent (default) and ok (auto-applied when value === max).
|
|
1331
|
+
*/
|
|
1332
|
+
type RadialTone = 'accent' | 'ok' | 'warn' | 'err';
|
|
1333
|
+
interface RadialProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
1334
|
+
/** Current value, 0..max. */
|
|
1335
|
+
value: number;
|
|
1336
|
+
/** Maximum value. Default 100. */
|
|
1337
|
+
max?: number;
|
|
1338
|
+
/** Pixel size of the SVG. Default 64. */
|
|
1339
|
+
size?: number;
|
|
1340
|
+
/** Stroke width. Default 4. */
|
|
1341
|
+
thickness?: number;
|
|
1342
|
+
/** Color tone. Auto-flips to `ok` on completion unless explicitly set. */
|
|
1343
|
+
tone?: RadialTone;
|
|
1344
|
+
/** Replaces the centered percent label. */
|
|
1345
|
+
children?: ReactNode;
|
|
1346
|
+
/** Accessible label. Falls back to `${pct}%`. */
|
|
1347
|
+
'aria-label'?: string;
|
|
1348
|
+
}
|
|
1349
|
+
declare const RadialProgress: react.ForwardRefExoticComponent<RadialProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* HealthScore — `RadialProgress` + delta indicator + optional breakdown
|
|
1353
|
+
* tooltip. The shape generalizes recurring product surfaces like service
|
|
1354
|
+
* health, deployment confidence, and graph health.
|
|
1355
|
+
*
|
|
1356
|
+
* Delta sign drives the arrow direction and tone (positive = ok, negative =
|
|
1357
|
+
* err) unless an explicit `tone` is set. When a `breakdown` is supplied, the
|
|
1358
|
+
* score wraps in a `HoverCard` that reveals the per-bucket contributions.
|
|
1359
|
+
*/
|
|
1360
|
+
interface HealthScoreBreakdownEntry {
|
|
1361
|
+
label: ReactNode;
|
|
1362
|
+
value: number;
|
|
1363
|
+
/** Tone for the value text. Defaults to inheriting the parent score tone. */
|
|
1364
|
+
tone?: RadialTone;
|
|
1365
|
+
}
|
|
1366
|
+
interface HealthScoreProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
1367
|
+
/** Current value, 0..max. */
|
|
1368
|
+
value: number;
|
|
1369
|
+
/** Maximum value. Default 100. */
|
|
1370
|
+
max?: number;
|
|
1371
|
+
/**
|
|
1372
|
+
* Signed change vs. the previous period. Positive draws an up-arrow + ok
|
|
1373
|
+
* tone, negative draws a down-arrow + err tone. Pass `0` to render a flat
|
|
1374
|
+
* indicator.
|
|
1375
|
+
*/
|
|
1376
|
+
delta?: number;
|
|
1377
|
+
/** Label rendered under the score. */
|
|
1378
|
+
label?: ReactNode;
|
|
1379
|
+
/** Optional per-bucket contributions revealed in a HoverCard. */
|
|
1380
|
+
breakdown?: ReadonlyArray<HealthScoreBreakdownEntry>;
|
|
1381
|
+
/** Pixel size for the RadialProgress. Default 72. */
|
|
1382
|
+
size?: number;
|
|
1383
|
+
/** Color tone for the ring. Auto-derived when omitted. */
|
|
1384
|
+
tone?: RadialTone;
|
|
1385
|
+
/** Accessible label for the score. Defaults to `${pct}% health`. */
|
|
1386
|
+
'aria-label'?: string;
|
|
1387
|
+
}
|
|
1388
|
+
declare const HealthScore: react.ForwardRefExoticComponent<HealthScoreProps & react.RefAttributes<HTMLDivElement>>;
|
|
1389
|
+
|
|
1226
1390
|
/**
|
|
1227
1391
|
* Menubar — desktop-style horizontal menu strip (File, Edit, View, …) built on
|
|
1228
1392
|
* Radix Menubar. Owns ARIA + keyboard semantics; ShipIt owns styling.
|
|
@@ -1244,6 +1408,92 @@ interface MenubarItemProps extends RadixMenubar.MenubarItemProps {
|
|
|
1244
1408
|
declare const MenubarItem: react.ForwardRefExoticComponent<MenubarItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
1245
1409
|
declare const MenubarSeparator: react.ForwardRefExoticComponent<RadixMenubar.MenubarSeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
1246
1410
|
|
|
1411
|
+
/**
|
|
1412
|
+
* NavBar — primary app navigation. The same component renders either as a
|
|
1413
|
+
* horizontal top bar (`orientation="horizontal"`) or as a vertical side rail
|
|
1414
|
+
* (`orientation="vertical"`); both layouts are driven by the same `items`
|
|
1415
|
+
* tree. Items can carry nested `children` to produce dropdowns on
|
|
1416
|
+
* horizontal and expand-collapse groups on vertical. Below `md` the bar
|
|
1417
|
+
* collapses to a hamburger that opens a Drawer rendering the items
|
|
1418
|
+
* vertically (set `responsive={false}` to opt out).
|
|
1419
|
+
*
|
|
1420
|
+
* Active state can be controlled (`value` + `onValueChange`) or uncontrolled
|
|
1421
|
+
* (`defaultValue`). Items with an `href` render as anchors; otherwise as
|
|
1422
|
+
* buttons that fire `onValueChange`.
|
|
1423
|
+
*/
|
|
1424
|
+
interface NavBarItem {
|
|
1425
|
+
/** Stable identifier — what `value` / `onValueChange` reference. */
|
|
1426
|
+
id: string;
|
|
1427
|
+
label: ReactNode;
|
|
1428
|
+
/** Optional left-of-label icon node. */
|
|
1429
|
+
icon?: ReactNode;
|
|
1430
|
+
/** When set, item renders as an `<a>`; otherwise as a `<button>`. */
|
|
1431
|
+
href?: string;
|
|
1432
|
+
/** Trailing badge text. */
|
|
1433
|
+
badge?: ReactNode;
|
|
1434
|
+
disabled?: boolean;
|
|
1435
|
+
/** Nested items — dropdowns on horizontal, expand-groups on vertical. */
|
|
1436
|
+
children?: NavBarItem[];
|
|
1437
|
+
}
|
|
1438
|
+
type NavBarOrientation = 'horizontal' | 'vertical';
|
|
1439
|
+
interface NavBarProps extends Omit<HTMLAttributes<HTMLElement>, 'defaultValue' | 'title'> {
|
|
1440
|
+
/** Layout direction. Default `'horizontal'`. */
|
|
1441
|
+
orientation?: NavBarOrientation;
|
|
1442
|
+
/** Item tree driving the bar. */
|
|
1443
|
+
items: NavBarItem[];
|
|
1444
|
+
/**
|
|
1445
|
+
* Brand / logo slot rendered at the start. When `responsive` is `true`,
|
|
1446
|
+
* `brand` also seeds the mobile Drawer's accessible name, so it should
|
|
1447
|
+
* include text — e.g. `<><Logo /> ShipIt</>` rather than `<Logo />` alone.
|
|
1448
|
+
* Falls back to `'Navigation'` when omitted.
|
|
1449
|
+
*/
|
|
1450
|
+
brand?: ReactNode;
|
|
1451
|
+
/** Trailing slot for secondary actions (avatar, settings, theme toggle, …). */
|
|
1452
|
+
actions?: ReactNode;
|
|
1453
|
+
/** Controlled active item id. */
|
|
1454
|
+
value?: string;
|
|
1455
|
+
/** Uncontrolled initial active item id. */
|
|
1456
|
+
defaultValue?: string;
|
|
1457
|
+
/** Fired when an item is activated. */
|
|
1458
|
+
onValueChange?: (id: string) => void;
|
|
1459
|
+
/** Pixel width of the vertical rail. Default 240. */
|
|
1460
|
+
width?: number;
|
|
1461
|
+
/** Collapse to a hamburger drawer below `md`. Default `true`. */
|
|
1462
|
+
responsive?: boolean;
|
|
1463
|
+
}
|
|
1464
|
+
declare const NavBar: react.ForwardRefExoticComponent<NavBarProps & react.RefAttributes<HTMLElement>>;
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* OnboardingChecklist — list of getting-started tasks driven by remote
|
|
1468
|
+
* progress. Each item has a `status` (`pending` / `in-progress` / `done`)
|
|
1469
|
+
* that decides its dot color and label tone, plus an optional `action` slot
|
|
1470
|
+
* (typically a `Button`) rendered on the right.
|
|
1471
|
+
*
|
|
1472
|
+
* The header shows aggregate progress as a `Progress` bar; pass
|
|
1473
|
+
* `progressLabel` to override the default `"{n} of {m} complete"` text.
|
|
1474
|
+
*/
|
|
1475
|
+
type OnboardingItemStatus = 'pending' | 'in-progress' | 'done';
|
|
1476
|
+
interface OnboardingItem {
|
|
1477
|
+
id: string;
|
|
1478
|
+
label: ReactNode;
|
|
1479
|
+
description?: ReactNode;
|
|
1480
|
+
status: OnboardingItemStatus;
|
|
1481
|
+
/** Trailing call-to-action (typically a `Button`). */
|
|
1482
|
+
action?: ReactNode;
|
|
1483
|
+
}
|
|
1484
|
+
interface OnboardingChecklistProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
1485
|
+
items: ReadonlyArray<OnboardingItem>;
|
|
1486
|
+
/** Fires when an item row is clicked. The whole row becomes clickable when supplied. */
|
|
1487
|
+
onItemClick?: (id: string) => void;
|
|
1488
|
+
/** Header heading. Default `'Get started'`. */
|
|
1489
|
+
title?: ReactNode;
|
|
1490
|
+
/** Override the progress label rendered next to the bar. */
|
|
1491
|
+
progressLabel?: ReactNode;
|
|
1492
|
+
/** Hide the aggregate progress bar. */
|
|
1493
|
+
hideProgress?: boolean;
|
|
1494
|
+
}
|
|
1495
|
+
declare const OnboardingChecklist: react.ForwardRefExoticComponent<OnboardingChecklistProps & react.RefAttributes<HTMLElement>>;
|
|
1496
|
+
|
|
1247
1497
|
/**
|
|
1248
1498
|
* Pagination — page selector for paginated lists/tables. Renders prev/next
|
|
1249
1499
|
* arrows plus a compact range of numbered pages. Use `siblings` to control how
|
|
@@ -1288,31 +1538,6 @@ interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'>, Va
|
|
|
1288
1538
|
}
|
|
1289
1539
|
declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1290
1540
|
|
|
1291
|
-
/**
|
|
1292
|
-
* RadialProgress — circular SVG progress ring. Renders the percent label in the
|
|
1293
|
-
* center by default; pass `children` to override (e.g., a glyph or a count).
|
|
1294
|
-
*
|
|
1295
|
-
* Tones: accent (default) and ok (auto-applied when value === max).
|
|
1296
|
-
*/
|
|
1297
|
-
type RadialTone = 'accent' | 'ok' | 'warn' | 'err';
|
|
1298
|
-
interface RadialProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
1299
|
-
/** Current value, 0..max. */
|
|
1300
|
-
value: number;
|
|
1301
|
-
/** Maximum value. Default 100. */
|
|
1302
|
-
max?: number;
|
|
1303
|
-
/** Pixel size of the SVG. Default 64. */
|
|
1304
|
-
size?: number;
|
|
1305
|
-
/** Stroke width. Default 4. */
|
|
1306
|
-
thickness?: number;
|
|
1307
|
-
/** Color tone. Auto-flips to `ok` on completion unless explicitly set. */
|
|
1308
|
-
tone?: RadialTone;
|
|
1309
|
-
/** Replaces the centered percent label. */
|
|
1310
|
-
children?: ReactNode;
|
|
1311
|
-
/** Accessible label. Falls back to `${pct}%`. */
|
|
1312
|
-
'aria-label'?: string;
|
|
1313
|
-
}
|
|
1314
|
-
declare const RadialProgress: react.ForwardRefExoticComponent<RadialProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
1315
|
-
|
|
1316
1541
|
/**
|
|
1317
1542
|
* Sidebar — primary app navigation column. A simple flex column with the
|
|
1318
1543
|
* panel background and a right border. Compose with `<NavItem>` and
|
|
@@ -1344,8 +1569,27 @@ declare const NavItem: react.ForwardRefExoticComponent<NavItemProps & react.RefA
|
|
|
1344
1569
|
interface NavSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
1345
1570
|
/** Eyebrow heading. Rendered uppercase, mono, dim. */
|
|
1346
1571
|
label: ReactNode;
|
|
1572
|
+
/** Optional leading glyph or icon node next to the eyebrow. */
|
|
1573
|
+
icon?: ReactNode;
|
|
1347
1574
|
/** Optional trailing element next to the heading (e.g., a `+` add affordance). */
|
|
1348
1575
|
action?: ReactNode;
|
|
1576
|
+
/**
|
|
1577
|
+
* When true, the eyebrow becomes a button that toggles the body. The body
|
|
1578
|
+
* is hidden when closed. Default `false` — the eyebrow stays static.
|
|
1579
|
+
*/
|
|
1580
|
+
collapsible?: boolean;
|
|
1581
|
+
/** Uncontrolled initial open state. Default `true`. Ignored when `open` is provided. */
|
|
1582
|
+
defaultOpen?: boolean;
|
|
1583
|
+
/** Controlled open state. */
|
|
1584
|
+
open?: boolean;
|
|
1585
|
+
/** Fires when the open state changes. */
|
|
1586
|
+
onOpenChange?: (open: boolean) => void;
|
|
1587
|
+
/**
|
|
1588
|
+
* Pixel indent applied to the body. Useful when this section nests other
|
|
1589
|
+
* sections — the indent visually anchors children to the eyebrow above.
|
|
1590
|
+
* A subtle left rail is drawn alongside the indent. Default `0`.
|
|
1591
|
+
*/
|
|
1592
|
+
indent?: number;
|
|
1349
1593
|
}
|
|
1350
1594
|
declare const NavSection: react.ForwardRefExoticComponent<NavSectionProps & react.RefAttributes<HTMLDivElement>>;
|
|
1351
1595
|
|
|
@@ -1471,6 +1715,53 @@ interface TimelineItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
|
1471
1715
|
}
|
|
1472
1716
|
declare const TimelineItem: react.ForwardRefExoticComponent<TimelineItemProps & react.RefAttributes<HTMLLIElement>>;
|
|
1473
1717
|
|
|
1718
|
+
/**
|
|
1719
|
+
* formatRelative — compact "x ago" / "in x" formatter used by ActivityTimeline
|
|
1720
|
+
* and any other surface that wants to print typed event timestamps. Always
|
|
1721
|
+
* returns a short, ASCII string; if you need locale-aware formatting reach for
|
|
1722
|
+
* `Intl.RelativeTimeFormat` instead.
|
|
1723
|
+
*
|
|
1724
|
+
* The `now` argument is injectable so callers can render deterministically in
|
|
1725
|
+
* tests and during SSR. Invalid or unparseable inputs return an empty string
|
|
1726
|
+
* (note: `0` is a valid timestamp — the Unix epoch — and renders as a real
|
|
1727
|
+
* relative time).
|
|
1728
|
+
*/
|
|
1729
|
+
declare function formatRelative(input: Date | string | number, now?: Date): string;
|
|
1730
|
+
|
|
1731
|
+
/**
|
|
1732
|
+
* ActivityTimeline — typed-event variant of `Timeline`. Each event carries
|
|
1733
|
+
* an optional `icon`, an `actor` (name + avatar slot), a `title`, an `at`
|
|
1734
|
+
* timestamp formatted relative to `relativeNow`, and an optional `payload`
|
|
1735
|
+
* preview. Tone drives the marker color.
|
|
1736
|
+
*
|
|
1737
|
+
* The component is presentation-only — supply your own data adapter to map
|
|
1738
|
+
* domain events to `ActivityEvent`s.
|
|
1739
|
+
*/
|
|
1740
|
+
interface ActivityActor {
|
|
1741
|
+
name: ReactNode;
|
|
1742
|
+
/** Typically an `<Avatar>` or `<IconGlyph>`. */
|
|
1743
|
+
avatar?: ReactNode;
|
|
1744
|
+
}
|
|
1745
|
+
interface ActivityEvent {
|
|
1746
|
+
id: string;
|
|
1747
|
+
/** Leading icon next to the marker. Often an `<IconGlyph>`. */
|
|
1748
|
+
icon?: ReactNode;
|
|
1749
|
+
actor?: ActivityActor;
|
|
1750
|
+
title: ReactNode;
|
|
1751
|
+
/** Event time. Renders relative to `relativeNow`. */
|
|
1752
|
+
at: Date | string | number;
|
|
1753
|
+
/** Optional inline preview (e.g. a diff snippet or a payload summary). */
|
|
1754
|
+
payload?: ReactNode;
|
|
1755
|
+
/** Marker color tone. Default `accent`. */
|
|
1756
|
+
tone?: TimelineEventTone;
|
|
1757
|
+
}
|
|
1758
|
+
interface ActivityTimelineProps extends HTMLAttributes<HTMLOListElement> {
|
|
1759
|
+
events: ReadonlyArray<ActivityEvent>;
|
|
1760
|
+
/** Reference time for relative formatting. Injectable for tests/SSR. */
|
|
1761
|
+
relativeNow?: Date;
|
|
1762
|
+
}
|
|
1763
|
+
declare const ActivityTimeline: react.ForwardRefExoticComponent<ActivityTimelineProps & react.RefAttributes<HTMLOListElement>>;
|
|
1764
|
+
|
|
1474
1765
|
/**
|
|
1475
1766
|
* Topbar — slim header strip across the top of an app surface. The title
|
|
1476
1767
|
* lives on the left, the rest of the row is yours via `actions` (search,
|
|
@@ -1513,4 +1804,71 @@ interface TreeProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onSelect'> {
|
|
|
1513
1804
|
}
|
|
1514
1805
|
declare const Tree: react.ForwardRefExoticComponent<TreeProps & react.RefAttributes<HTMLUListElement>>;
|
|
1515
1806
|
|
|
1516
|
-
|
|
1807
|
+
/**
|
|
1808
|
+
* WizardDialog — modal multi-step flow. Composes `Dialog`, `Stepper`, and
|
|
1809
|
+
* Next/Back navigation around a `steps` array. Each step's content can be a
|
|
1810
|
+
* static node or a render function that receives the wizard context, which
|
|
1811
|
+
* is useful for steps that need to read or drive the navigation imperatively.
|
|
1812
|
+
*
|
|
1813
|
+
* `canAdvance` lets a step gate the Next button (e.g. when a form field is
|
|
1814
|
+
* empty). When the last step's Next is clicked, the wizard calls
|
|
1815
|
+
* `onComplete()` and lets the consumer close the dialog from there.
|
|
1816
|
+
*/
|
|
1817
|
+
interface WizardContext {
|
|
1818
|
+
current: number;
|
|
1819
|
+
total: number;
|
|
1820
|
+
goNext: () => void;
|
|
1821
|
+
goBack: () => void;
|
|
1822
|
+
goTo: (index: number) => void;
|
|
1823
|
+
isFirst: boolean;
|
|
1824
|
+
isLast: boolean;
|
|
1825
|
+
}
|
|
1826
|
+
interface WizardStep {
|
|
1827
|
+
/** Stable id. Used as the React key and the Stepper id. */
|
|
1828
|
+
id: string;
|
|
1829
|
+
/** Visible label in the Stepper. */
|
|
1830
|
+
label: string;
|
|
1831
|
+
/**
|
|
1832
|
+
* Step body. Pass a node for static content or a function for content that
|
|
1833
|
+
* needs the wizard context (e.g. to disable a Next button from inside).
|
|
1834
|
+
*/
|
|
1835
|
+
content: ReactNode | ((ctx: WizardContext) => ReactNode);
|
|
1836
|
+
/**
|
|
1837
|
+
* Predicate that gates the Next button for this step. Receives the wizard
|
|
1838
|
+
* context. Default: always true (Next is enabled).
|
|
1839
|
+
*/
|
|
1840
|
+
canAdvance?: (ctx: WizardContext) => boolean;
|
|
1841
|
+
}
|
|
1842
|
+
interface WizardDialogProps {
|
|
1843
|
+
/** Controlled open state. */
|
|
1844
|
+
open?: boolean;
|
|
1845
|
+
/** Uncontrolled initial open state. */
|
|
1846
|
+
defaultOpen?: boolean;
|
|
1847
|
+
/** Fires when the dialog open state changes. */
|
|
1848
|
+
onOpenChange?: (open: boolean) => void;
|
|
1849
|
+
/** Ordered list of wizard steps. */
|
|
1850
|
+
steps: ReadonlyArray<WizardStep>;
|
|
1851
|
+
/** Step index to start at. Default 0. */
|
|
1852
|
+
initialStep?: number;
|
|
1853
|
+
/** Fires when Next is clicked on the last step. The consumer typically closes the dialog here. */
|
|
1854
|
+
onComplete?: () => void;
|
|
1855
|
+
/** Dialog title (visible heading). */
|
|
1856
|
+
title?: ReactNode;
|
|
1857
|
+
/** Dialog description (rendered below the title for assistive tech). */
|
|
1858
|
+
description?: ReactNode;
|
|
1859
|
+
/** Pixel max-width of the dialog panel. Default 560. */
|
|
1860
|
+
width?: number | string;
|
|
1861
|
+
/** Override the Next button label. Default `'Next'`. */
|
|
1862
|
+
nextLabel?: ReactNode;
|
|
1863
|
+
/** Override the Next button label on the last step. Default `'Done'`. */
|
|
1864
|
+
completeLabel?: ReactNode;
|
|
1865
|
+
/** Override the Back button label. Default `'Back'`. */
|
|
1866
|
+
backLabel?: ReactNode;
|
|
1867
|
+
/** Optional cancel slot rendered in the footer alongside the navigation. */
|
|
1868
|
+
cancelLabel?: ReactNode;
|
|
1869
|
+
/** Fires when the cancel button is pressed. The consumer typically closes the dialog. */
|
|
1870
|
+
onCancel?: () => void;
|
|
1871
|
+
}
|
|
1872
|
+
declare const WizardDialog: react.ForwardRefExoticComponent<WizardDialogProps & react.RefAttributes<HTMLDivElement>>;
|
|
1873
|
+
|
|
1874
|
+
export { type ActivityActor, type ActivityEvent, ActivityTimeline, type ActivityTimelineProps, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, type AlertDialogProps, AlertDialogRoot, AlertDialogTrigger, type AlertProps, type AlertTone, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Calendar, type CalendarProps, Card, CardLink, type CardLinkProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Combobox, type ComboboxOption, type ComboboxProps, CommandPalette, type CommandPaletteGroup, type CommandPaletteItem, type CommandPaletteProps, ContextMenu, ContextMenuContent, ContextMenuItem, type ContextMenuItemProps, ContextMenuPortal, ContextMenuRoot, ContextMenuSeparator, ContextMenuTrigger, Crumb, type CrumbProps, DataTable, type DataTableColumn, type DataTableProps, type DataTableSort, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogOverlay, DialogPortal, type DialogProps, DialogRoot, DialogTrigger, Dots, type DotsProps, Drawer, type DrawerProps, type DrawerSide, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRoot, DropdownMenuTrigger, Dropzone, type DropzoneProps, EmptyState, type EmptyStateProps, FAB, type FABProps, Field, type FieldProps, FileChip, type FileChipProps, type FilterFacet, type FilterFacetOption, FilterPanel, type FilterPanelProps, type FilterPanelValue, HealthScore, type HealthScoreBreakdownEntry, type HealthScoreProps, HoverCard, HoverCardContent, HoverCardPortal, type HoverCardProps, HoverCardRoot, HoverCardTrigger, IconButton, type IconButtonProps, Input, type InputProps, Kbd, type KbdProps, MenuCheckboxItem, MenuItem, type MenuItemProps, MenuSeparator, Menubar, MenubarContent, MenubarItem, type MenubarItemProps, MenubarMenu, MenubarSeparator, MenubarTrigger, NavBar, type NavBarItem, type NavBarOrientation, type NavBarProps, NavItem, type NavItemProps, NavSection, type NavSectionProps, type NormalizedOption, OTP, type OTPHandle, type OTPProps, OnboardingChecklist, type OnboardingChecklistProps, type OnboardingItem, type OnboardingItemStatus, Pagination, type PaginationProps, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger, Progress, type ProgressProps, RadialProgress, type RadialProgressProps, type RadialTone, Radio, RadioGroup, type RadioGroupProps, type RadioProps, ScrollArea, type ScrollAreaProps, type ScrollAreaType, SearchInput, type SearchInputProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, type SelectOption, type SelectProps, SelectRoot, SelectTrigger, SelectValue, Sheet, type SheetProps, Sidebar, type SidebarProps, Skeleton, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, Slider, type SliderProps, Sparkline, type SparklineProps, Spinner, type SpinnerProps, SplitButton, type SplitButtonProps, StatCard, type StatCardProps, type StatTrend, StatusDot, type StatusDotProps, type StatusState, type StepState, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, Tab, type TabProps, Tabs, TabsContent, TabsList, type TabsProps, type TabsVariantProps, Tag, type TagProps, Textarea, type TextareaProps, type Theme, Timeline, type TimelineEvent, type TimelineEventTone, TimelineItem, type TimelineItemProps, type TimelineProps, ToastCard, type ToastInput, ToastProvider, type ToastVariant, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, Topbar, type TopbarProps, Tree, type TreeItem, type TreeProps, type UseControllableStateProps, type UseKeyboardListOptions, type UseKeyboardListResult, type WizardContext, WizardDialog, type WizardDialogProps, type WizardStep, badgeStyles, buttonStyles, cardStyles, cn, filterCommandItems, formatRelative, iconButtonStyles, useControllableState, useDisclosure, useEscape, useIsomorphicLayoutEffect, useKeyboardList, useOutsideClick, useTheme, useToast };
|