@aginies/ui 0.1.0 → 0.3.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/dist/index.cjs +1813 -1363
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -8
- package/dist/index.d.ts +142 -8
- package/dist/index.js +1766 -1326
- package/dist/index.js.map +1 -1
- package/dist/styles.css +97 -13
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -763,8 +763,12 @@ export interface DataColumn<T = any> {
|
|
|
763
763
|
sortValue?: (row: T) => any;
|
|
764
764
|
/** right for numbers and amounts */
|
|
765
765
|
align?: 'left' | 'right' | 'center';
|
|
766
|
+
/** Column width; also the room it needs when `minWidth` is absent (px numbers count for priority hiding) */
|
|
766
767
|
width?: number | string;
|
|
768
|
+
/** Narrowest width the column may take; priority hiding sums these (default 120px) */
|
|
767
769
|
minWidth?: number | string;
|
|
770
|
+
/** DataTable only: 1 = always shown (default), higher numbers hide first when the table's own width cannot fit every column */
|
|
771
|
+
priority?: number;
|
|
768
772
|
/** Custom cell; receives (value, row, index) */
|
|
769
773
|
render?: (value: any, row: T, index: number) => React.ReactNode;
|
|
770
774
|
/** Inline edit on double-click, F2 or the pencil (needs onCellEdit) */
|
|
@@ -778,8 +782,8 @@ export interface DataColumn<T = any> {
|
|
|
778
782
|
className?: string;
|
|
779
783
|
}
|
|
780
784
|
/** Visible strings of a DataTable, overridable per locale. */
|
|
781
|
-
export interface DataTableLabels { empty?: string; emptyHint?: string; loading?: string; error?: string; errorHint?: string; retry?: string; selectAll?: string; selectRow?: string; actions?: string; sortedAsc?: string; sortedDesc?: string; edit?: string; }
|
|
782
|
-
/** Dense record grid for agents, runs, approvals and tenants: sortable columns, selection with select-all, inline cell edit, row actions, sticky header, and the states error → loading → empty → rows. Rows are 32px compact and 44px comfortable. */
|
|
785
|
+
export interface DataTableLabels { empty?: string; emptyHint?: string; loading?: string; error?: string; errorHint?: string; retry?: string; selectAll?: string; selectRow?: string; actions?: string; sortedAsc?: string; sortedDesc?: string; edit?: string; /** aria-label of the row-detail toggle while closed */ expandRow?: string; /** aria-label of the row-detail toggle while open */ collapseRow?: string; }
|
|
786
|
+
/** Dense record grid for agents, runs, approvals and tenants: sortable columns, selection with select-all, inline cell edit, row actions, sticky header, and the states error → loading → empty → rows. Rows are 32px compact and 44px comfortable. At narrow widths it hides columns by `priority` against its own measured width and can pin the first column (`stickyFirst`). */
|
|
783
787
|
export interface DataTableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'selected' | 'value'> {
|
|
784
788
|
columns: DataColumn<T>[];
|
|
785
789
|
rows: T[];
|
|
@@ -824,6 +828,10 @@ export interface DataTableProps<T = any> extends Omit<React.HTMLAttributes<HTMLD
|
|
|
824
828
|
rowClassName?: (row: T, index: number) => string | false | undefined;
|
|
825
829
|
/** Key of the row whose detail is open (side panel, split view): aria-current, --selection ground and a --signal edge. Independent of `selected` */
|
|
826
830
|
activeKey?: string | number | null;
|
|
831
|
+
/** First data column (and the selection column) stays put while the table scrolls sideways, with a hairline shadow once scrolled */
|
|
832
|
+
stickyFirst?: boolean;
|
|
833
|
+
/** Called with the keys of the columns hidden by `priority` whenever that set changes ([] when all fit) */
|
|
834
|
+
onHiddenColumnsChange?: (keys: string[]) => void;
|
|
827
835
|
}
|
|
828
836
|
export declare function DataTable<T = any>(props: DataTableProps<T>): JSX.Element;
|
|
829
837
|
|
|
@@ -1320,24 +1328,103 @@ export declare function Toolbar(props: ToolbarProps): JSX.Element;
|
|
|
1320
1328
|
/** Vertical hairline between toolbar groups. */
|
|
1321
1329
|
export declare function ToolbarSeparator(props: React.HTMLAttributes<HTMLSpanElement>): JSX.Element;
|
|
1322
1330
|
|
|
1323
|
-
/** The console frame: optional GlobalHeader on top, VerticalNavigation on the left, a scrolling main area with the console gutter, optional
|
|
1331
|
+
/** The console frame: optional GlobalHeader on top, VerticalNavigation on the left, a scrolling main area with the console gutter, optional side panel on the right. It measures its own width: ≥ 1280 everything docked; 1024–1279 the sidebar on its 56px rail; < 1024 the sidebar is a drawer and the side panel a sheet from the right, both opened from a 48px page bar; < 768 the gutter is 16px. */
|
|
1324
1332
|
export interface PageLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1325
1333
|
/** A GlobalHeader (brand screens) — consoles usually omit it */
|
|
1326
1334
|
header?: React.ReactNode;
|
|
1327
|
-
/** A VerticalNavigation */
|
|
1335
|
+
/** A VerticalNavigation; it reads its state (docked, rail, drawer) from the PageLayout */
|
|
1328
1336
|
navigation?: React.ReactNode;
|
|
1329
|
-
/** A side panel: inspector, artifact, conversation */
|
|
1337
|
+
/** A side panel: inspector, artifact, conversation. A SidePanel passed without a mode is docked in the frame */
|
|
1330
1338
|
sidePanel?: React.ReactNode;
|
|
1331
1339
|
/** Defaults to --panel-w (288) */
|
|
1332
1340
|
sidePanelWidth?: number | string;
|
|
1333
|
-
/** Content
|
|
1341
|
+
/** Content width preset: reading (--content-reading 960: settings, documents, wizards) · default (--content-max 1440) · wide (--content-wide 1920: dashboards that add columns) · full (no cap: tables and canvases) */
|
|
1342
|
+
width?: 'reading' | 'default' | 'wide' | 'full';
|
|
1343
|
+
/** Content max width; overrides width */
|
|
1334
1344
|
maxWidth?: number | string;
|
|
1335
1345
|
/** No gutter or max width, and the content fills the main area's height (canvas, split views) */
|
|
1336
1346
|
flush?: boolean;
|
|
1347
|
+
/** Sidebar state: auto (default, from the measured width), or forced docked / rail / overlay */
|
|
1348
|
+
sidebarMode?: 'auto' | 'docked' | 'rail' | 'overlay';
|
|
1349
|
+
/** Side panel state: auto (default: docked ≥ 1024, overlay below), or forced docked / overlay */
|
|
1350
|
+
panelMode?: 'auto' | 'docked' | 'overlay';
|
|
1351
|
+
/** Overlay drawer open (controlled); uncontrolled it opens from the page bar */
|
|
1352
|
+
sidebarOpen?: boolean;
|
|
1353
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
1354
|
+
/** Overlay sheet open (controlled); uncontrolled it opens from the page bar and when a side panel appears while the page is narrow */
|
|
1355
|
+
panelOpen?: boolean;
|
|
1356
|
+
onPanelOpenChange?: (open: boolean) => void;
|
|
1357
|
+
/** The 48px page bar shown while the sidebar or panel is an overlay: false hides it (open them through usePageLayout), a node replaces the mark in its middle */
|
|
1358
|
+
bar?: boolean | React.ReactNode;
|
|
1359
|
+
labels?: { openNav?: string; closeNav?: string; openPanel?: string; closePanel?: string; navigation?: string; details?: string };
|
|
1337
1360
|
as?: any;
|
|
1338
1361
|
}
|
|
1339
1362
|
export declare function PageLayout(props: PageLayoutProps): JSX.Element;
|
|
1340
1363
|
|
|
1364
|
+
/** State of the enclosing PageLayout, for a page that needs to adapt (drop table columns, put the menu button in its own header). */
|
|
1365
|
+
export interface PageLayoutState {
|
|
1366
|
+
/** Breakpoint of the page's own width */
|
|
1367
|
+
bp: Breakpoint;
|
|
1368
|
+
sidebar: 'docked' | 'rail' | 'overlay' | null;
|
|
1369
|
+
panel: 'docked' | 'overlay' | null;
|
|
1370
|
+
railExpanded: boolean;
|
|
1371
|
+
setRailExpanded: (expanded: boolean) => void;
|
|
1372
|
+
sidebarOpen: boolean;
|
|
1373
|
+
openSidebar: () => void;
|
|
1374
|
+
closeSidebar: () => void;
|
|
1375
|
+
panelOpen: boolean;
|
|
1376
|
+
openPanel: () => void;
|
|
1377
|
+
closePanel: () => void;
|
|
1378
|
+
}
|
|
1379
|
+
/** The enclosing PageLayout's state; null outside one. */
|
|
1380
|
+
export declare function usePageLayout(): PageLayoutState | null;
|
|
1381
|
+
export declare const PageLayoutContext: React.Context<PageLayoutState | null>;
|
|
1382
|
+
|
|
1383
|
+
/** Breakpoint names: base < 640 ≤ sm < 768 ≤ md < 1024 ≤ lg < 1280 ≤ xl < 1536 ≤ 2xl (tokens bp-sm … bp-2xl). */
|
|
1384
|
+
export type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
1385
|
+
/** A value per breakpoint, mobile first: each one holds until a larger breakpoint sets another. */
|
|
1386
|
+
export type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
1387
|
+
|
|
1388
|
+
/** 12-column grid (--grid-columns, --grid-gap) laid out by its own width through a container query, so it responds to its pane, not the window. Dashboards, record bodies, card galleries. */
|
|
1389
|
+
export interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
1390
|
+
/** Gallery mode: auto-fill columns at least this wide (number = px), e.g. 280 for cards. GridItem spans are ignored */
|
|
1391
|
+
min?: number | string;
|
|
1392
|
+
/** Column count (default --grid-columns, 12) */
|
|
1393
|
+
columns?: number;
|
|
1394
|
+
/** Gap: lg (default, --grid-gap 24), md 16, sm 12, none, or any length */
|
|
1395
|
+
gap?: 'none' | 'sm' | 'md' | 'lg' | number | string;
|
|
1396
|
+
/** Row gap when it differs from gap */
|
|
1397
|
+
rowGap?: 'none' | 'sm' | 'md' | 'lg' | number | string;
|
|
1398
|
+
/** Vertical alignment of items in a row (default stretch) */
|
|
1399
|
+
align?: 'start' | 'center' | 'end';
|
|
1400
|
+
/** Back-fills holes left by wide items */
|
|
1401
|
+
dense?: boolean;
|
|
1402
|
+
as?: any;
|
|
1403
|
+
}
|
|
1404
|
+
export declare function Grid(props: GridProps): JSX.Element;
|
|
1405
|
+
/** One cell of a Grid. */
|
|
1406
|
+
export interface GridItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
1407
|
+
/** Columns to span: a number, 'full', or per breakpoint of the Grid's width ({ base: 12, lg: 6, xl: 4 }). Default 12 */
|
|
1408
|
+
span?: Responsive<number | 'full'>;
|
|
1409
|
+
/** Starting column line */
|
|
1410
|
+
start?: number;
|
|
1411
|
+
/** Rows to span */
|
|
1412
|
+
rowSpan?: number;
|
|
1413
|
+
as?: any;
|
|
1414
|
+
}
|
|
1415
|
+
export declare function GridItem(props: GridItemProps): JSX.Element;
|
|
1416
|
+
|
|
1417
|
+
/** Breakpoint values in px (= tokens): { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 }. */
|
|
1418
|
+
export declare const BREAKPOINTS: Record<Exclude<Breakpoint, 'base'>, number>;
|
|
1419
|
+
/** Name of the largest breakpoint a width reaches. */
|
|
1420
|
+
export declare function breakpointFor(width: number): Breakpoint;
|
|
1421
|
+
/** Width (px) of an element, kept current with a ResizeObserver; null until measured. */
|
|
1422
|
+
export declare function useElementWidth(ref: React.RefObject<Element>): number | null;
|
|
1423
|
+
/** Breakpoint of an element's own width; null until measured. Use it to drop low-priority table columns in a narrow pane. */
|
|
1424
|
+
export declare function useBreakpoint(ref: React.RefObject<Element>): Breakpoint | null;
|
|
1425
|
+
/** Drawer/sheet focus handling: focus moves into the container on open, Tab stays inside, Esc calls onClose, focus returns on close. */
|
|
1426
|
+
export declare function useOverlayFocus(ref: React.RefObject<HTMLElement>, open: boolean, onClose?: () => void): void;
|
|
1427
|
+
|
|
1341
1428
|
/** The website's .room: a section that inverts the theme inside — sets data-theme opposite to its ancestor and paints --bg. */
|
|
1342
1429
|
export interface RoomProps extends React.HTMLAttributes<HTMLElement> {
|
|
1343
1430
|
/** Force a theme instead of inverting the ancestor's */
|
|
@@ -1412,7 +1499,9 @@ export interface VerticalNavigationProps extends Omit<React.HTMLAttributes<HTMLE
|
|
|
1412
1499
|
/** Each new width while resizing; persist it and pass it back as width */
|
|
1413
1500
|
onResize?: (width: number) => void;
|
|
1414
1501
|
logoHref?: string;
|
|
1415
|
-
|
|
1502
|
+
/** Layout state. Omit it inside PageLayout, which sets it from its width: docked ≥ 1280, rail 1024–1279 (collapsed to 56px until the user expands it), overlay < 1024 (a drawer with a close button that closes when an item is chosen). Standalone default: docked */
|
|
1503
|
+
mode?: 'docked' | 'rail' | 'overlay';
|
|
1504
|
+
labels?: { search?: string; collapse?: string; expand?: string; navigation?: string; resize?: string; close?: string };
|
|
1416
1505
|
}
|
|
1417
1506
|
export declare function VerticalNavigation(props: VerticalNavigationProps): JSX.Element;
|
|
1418
1507
|
|
|
@@ -1511,7 +1600,15 @@ export interface SplitViewProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
1511
1600
|
resizable?: boolean;
|
|
1512
1601
|
/** Shows a toggle that hides the list */
|
|
1513
1602
|
collapsible?: boolean;
|
|
1514
|
-
|
|
1603
|
+
/** Width of the SplitView itself (a breakpoint name or px) below which list and detail stack: the list fills the pane and a picked record opens as a full pane with a back button. Default 'md' (768); false never stacks. Below 'lg' (1024) the list narrows to --panel-w */
|
|
1604
|
+
stackBelow?: 'sm' | 'md' | 'lg' | 'xl' | number | false;
|
|
1605
|
+
/** Pane shown first when stacked (default 'list') */
|
|
1606
|
+
defaultStackedView?: 'list' | 'detail';
|
|
1607
|
+
/** Called when the stacked pane changes */
|
|
1608
|
+
onStackedViewChange?: (view: 'list' | 'detail') => void;
|
|
1609
|
+
/** Called by the stacked detail's back button (after it returns to the list) */
|
|
1610
|
+
onBack?: () => void;
|
|
1611
|
+
labels?: { resize?: string; empty?: string; collapse?: string; expand?: string; back?: string };
|
|
1515
1612
|
}
|
|
1516
1613
|
export declare function SplitView(props: SplitViewProps): JSX.Element;
|
|
1517
1614
|
|
|
@@ -1720,6 +1817,40 @@ export interface StepperProps extends Omit<React.HTMLAttributes<HTMLOListElement
|
|
|
1720
1817
|
}
|
|
1721
1818
|
export declare function Stepper(props: StepperProps): JSX.Element;
|
|
1722
1819
|
|
|
1820
|
+
/** One view in an ActivityBar. */
|
|
1821
|
+
export interface ActivityBarItem {
|
|
1822
|
+
/** Value passed to onSelect and matched against `active` */
|
|
1823
|
+
id: string;
|
|
1824
|
+
/** Lucide icon name (kebab-case), or a node such as <ProductIcon product="code" size={20} /> */
|
|
1825
|
+
icon: string | React.ReactNode;
|
|
1826
|
+
/** Accessible name and tooltip text */
|
|
1827
|
+
label: string;
|
|
1828
|
+
/** Small count Badge on the icon (a number, or a short word) */
|
|
1829
|
+
badge?: number | string;
|
|
1830
|
+
/** Shown dimmed, skipped by the arrow keys, not selectable */
|
|
1831
|
+
disabled?: boolean;
|
|
1832
|
+
/** id of the view panel this item opens (sets aria-controls) */
|
|
1833
|
+
controls?: string;
|
|
1834
|
+
/** id for the tab button, so the panel can point back with aria-labelledby */
|
|
1835
|
+
tabId?: string;
|
|
1836
|
+
}
|
|
1837
|
+
/** Vertical 48px icon strip that switches the view beside it, like VS Code's activity bar or IntelliJ's tool-window bar: use it in IDE mocks and the web build of the Code panel. A vertical tablist with roving focus (↑ ↓ Home End, Enter or Space selects), tooltips with each label, a 2px --signal bar on the edge facing the view. */
|
|
1838
|
+
export interface ActivityBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
1839
|
+
/** Top group of views */
|
|
1840
|
+
items: ActivityBarItem[];
|
|
1841
|
+
/** Bottom group (accounts, settings), pushed to the foot of the bar */
|
|
1842
|
+
footerItems?: ActivityBarItem[];
|
|
1843
|
+
/** id of the selected item */
|
|
1844
|
+
active?: string;
|
|
1845
|
+
/** Called with the id and item when an item is clicked or chosen with Enter / Space */
|
|
1846
|
+
onSelect?: (id: string, item: ActivityBarItem) => void;
|
|
1847
|
+
/** Which side of the view the bar sits on; the active bar and the --line edge face the view (default left) */
|
|
1848
|
+
side?: 'left' | 'right';
|
|
1849
|
+
/** aria-label of the tablist (default "Views") */
|
|
1850
|
+
labels?: { navigation?: string };
|
|
1851
|
+
}
|
|
1852
|
+
export declare function ActivityBar(props: ActivityBarProps): JSX.Element;
|
|
1853
|
+
|
|
1723
1854
|
// --- feedback ---
|
|
1724
1855
|
/** The brand loader: the Aginies mark animated with CSS keyframes only. Use it wherever the product itself is working (boot, page data, an agent run); use Spinner for a single control. */
|
|
1725
1856
|
export interface AginiesLoaderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'label'> {
|
|
@@ -1994,7 +2125,10 @@ export interface SidePanelProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
1994
2125
|
size?: 'md' | 'lg';
|
|
1995
2126
|
/** Any width (number = px), overriding size: a 600px trace inspector, "40vw" */
|
|
1996
2127
|
width?: number | string;
|
|
2128
|
+
/** docked sits in the layout (inside PageLayout, a SidePanel with no mode is docked); overlay (default) is a modal sheet from the right: scrim, focus moved in and kept inside, Esc and scrim click call onClose, focus restored */
|
|
1997
2129
|
mode?: 'overlay' | 'docked';
|
|
2130
|
+
/** Overlay only: the --overlay scrim behind the sheet (default true) */
|
|
2131
|
+
scrim?: boolean;
|
|
1998
2132
|
children?: React.ReactNode;
|
|
1999
2133
|
labels?: { close?: string };
|
|
2000
2134
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -763,8 +763,12 @@ export interface DataColumn<T = any> {
|
|
|
763
763
|
sortValue?: (row: T) => any;
|
|
764
764
|
/** right for numbers and amounts */
|
|
765
765
|
align?: 'left' | 'right' | 'center';
|
|
766
|
+
/** Column width; also the room it needs when `minWidth` is absent (px numbers count for priority hiding) */
|
|
766
767
|
width?: number | string;
|
|
768
|
+
/** Narrowest width the column may take; priority hiding sums these (default 120px) */
|
|
767
769
|
minWidth?: number | string;
|
|
770
|
+
/** DataTable only: 1 = always shown (default), higher numbers hide first when the table's own width cannot fit every column */
|
|
771
|
+
priority?: number;
|
|
768
772
|
/** Custom cell; receives (value, row, index) */
|
|
769
773
|
render?: (value: any, row: T, index: number) => React.ReactNode;
|
|
770
774
|
/** Inline edit on double-click, F2 or the pencil (needs onCellEdit) */
|
|
@@ -778,8 +782,8 @@ export interface DataColumn<T = any> {
|
|
|
778
782
|
className?: string;
|
|
779
783
|
}
|
|
780
784
|
/** Visible strings of a DataTable, overridable per locale. */
|
|
781
|
-
export interface DataTableLabels { empty?: string; emptyHint?: string; loading?: string; error?: string; errorHint?: string; retry?: string; selectAll?: string; selectRow?: string; actions?: string; sortedAsc?: string; sortedDesc?: string; edit?: string; }
|
|
782
|
-
/** Dense record grid for agents, runs, approvals and tenants: sortable columns, selection with select-all, inline cell edit, row actions, sticky header, and the states error → loading → empty → rows. Rows are 32px compact and 44px comfortable. */
|
|
785
|
+
export interface DataTableLabels { empty?: string; emptyHint?: string; loading?: string; error?: string; errorHint?: string; retry?: string; selectAll?: string; selectRow?: string; actions?: string; sortedAsc?: string; sortedDesc?: string; edit?: string; /** aria-label of the row-detail toggle while closed */ expandRow?: string; /** aria-label of the row-detail toggle while open */ collapseRow?: string; }
|
|
786
|
+
/** Dense record grid for agents, runs, approvals and tenants: sortable columns, selection with select-all, inline cell edit, row actions, sticky header, and the states error → loading → empty → rows. Rows are 32px compact and 44px comfortable. At narrow widths it hides columns by `priority` against its own measured width and can pin the first column (`stickyFirst`). */
|
|
783
787
|
export interface DataTableProps<T = any> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'selected' | 'value'> {
|
|
784
788
|
columns: DataColumn<T>[];
|
|
785
789
|
rows: T[];
|
|
@@ -824,6 +828,10 @@ export interface DataTableProps<T = any> extends Omit<React.HTMLAttributes<HTMLD
|
|
|
824
828
|
rowClassName?: (row: T, index: number) => string | false | undefined;
|
|
825
829
|
/** Key of the row whose detail is open (side panel, split view): aria-current, --selection ground and a --signal edge. Independent of `selected` */
|
|
826
830
|
activeKey?: string | number | null;
|
|
831
|
+
/** First data column (and the selection column) stays put while the table scrolls sideways, with a hairline shadow once scrolled */
|
|
832
|
+
stickyFirst?: boolean;
|
|
833
|
+
/** Called with the keys of the columns hidden by `priority` whenever that set changes ([] when all fit) */
|
|
834
|
+
onHiddenColumnsChange?: (keys: string[]) => void;
|
|
827
835
|
}
|
|
828
836
|
export declare function DataTable<T = any>(props: DataTableProps<T>): JSX.Element;
|
|
829
837
|
|
|
@@ -1320,24 +1328,103 @@ export declare function Toolbar(props: ToolbarProps): JSX.Element;
|
|
|
1320
1328
|
/** Vertical hairline between toolbar groups. */
|
|
1321
1329
|
export declare function ToolbarSeparator(props: React.HTMLAttributes<HTMLSpanElement>): JSX.Element;
|
|
1322
1330
|
|
|
1323
|
-
/** The console frame: optional GlobalHeader on top, VerticalNavigation on the left, a scrolling main area with the console gutter, optional
|
|
1331
|
+
/** The console frame: optional GlobalHeader on top, VerticalNavigation on the left, a scrolling main area with the console gutter, optional side panel on the right. It measures its own width: ≥ 1280 everything docked; 1024–1279 the sidebar on its 56px rail; < 1024 the sidebar is a drawer and the side panel a sheet from the right, both opened from a 48px page bar; < 768 the gutter is 16px. */
|
|
1324
1332
|
export interface PageLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
1325
1333
|
/** A GlobalHeader (brand screens) — consoles usually omit it */
|
|
1326
1334
|
header?: React.ReactNode;
|
|
1327
|
-
/** A VerticalNavigation */
|
|
1335
|
+
/** A VerticalNavigation; it reads its state (docked, rail, drawer) from the PageLayout */
|
|
1328
1336
|
navigation?: React.ReactNode;
|
|
1329
|
-
/** A side panel: inspector, artifact, conversation */
|
|
1337
|
+
/** A side panel: inspector, artifact, conversation. A SidePanel passed without a mode is docked in the frame */
|
|
1330
1338
|
sidePanel?: React.ReactNode;
|
|
1331
1339
|
/** Defaults to --panel-w (288) */
|
|
1332
1340
|
sidePanelWidth?: number | string;
|
|
1333
|
-
/** Content
|
|
1341
|
+
/** Content width preset: reading (--content-reading 960: settings, documents, wizards) · default (--content-max 1440) · wide (--content-wide 1920: dashboards that add columns) · full (no cap: tables and canvases) */
|
|
1342
|
+
width?: 'reading' | 'default' | 'wide' | 'full';
|
|
1343
|
+
/** Content max width; overrides width */
|
|
1334
1344
|
maxWidth?: number | string;
|
|
1335
1345
|
/** No gutter or max width, and the content fills the main area's height (canvas, split views) */
|
|
1336
1346
|
flush?: boolean;
|
|
1347
|
+
/** Sidebar state: auto (default, from the measured width), or forced docked / rail / overlay */
|
|
1348
|
+
sidebarMode?: 'auto' | 'docked' | 'rail' | 'overlay';
|
|
1349
|
+
/** Side panel state: auto (default: docked ≥ 1024, overlay below), or forced docked / overlay */
|
|
1350
|
+
panelMode?: 'auto' | 'docked' | 'overlay';
|
|
1351
|
+
/** Overlay drawer open (controlled); uncontrolled it opens from the page bar */
|
|
1352
|
+
sidebarOpen?: boolean;
|
|
1353
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
1354
|
+
/** Overlay sheet open (controlled); uncontrolled it opens from the page bar and when a side panel appears while the page is narrow */
|
|
1355
|
+
panelOpen?: boolean;
|
|
1356
|
+
onPanelOpenChange?: (open: boolean) => void;
|
|
1357
|
+
/** The 48px page bar shown while the sidebar or panel is an overlay: false hides it (open them through usePageLayout), a node replaces the mark in its middle */
|
|
1358
|
+
bar?: boolean | React.ReactNode;
|
|
1359
|
+
labels?: { openNav?: string; closeNav?: string; openPanel?: string; closePanel?: string; navigation?: string; details?: string };
|
|
1337
1360
|
as?: any;
|
|
1338
1361
|
}
|
|
1339
1362
|
export declare function PageLayout(props: PageLayoutProps): JSX.Element;
|
|
1340
1363
|
|
|
1364
|
+
/** State of the enclosing PageLayout, for a page that needs to adapt (drop table columns, put the menu button in its own header). */
|
|
1365
|
+
export interface PageLayoutState {
|
|
1366
|
+
/** Breakpoint of the page's own width */
|
|
1367
|
+
bp: Breakpoint;
|
|
1368
|
+
sidebar: 'docked' | 'rail' | 'overlay' | null;
|
|
1369
|
+
panel: 'docked' | 'overlay' | null;
|
|
1370
|
+
railExpanded: boolean;
|
|
1371
|
+
setRailExpanded: (expanded: boolean) => void;
|
|
1372
|
+
sidebarOpen: boolean;
|
|
1373
|
+
openSidebar: () => void;
|
|
1374
|
+
closeSidebar: () => void;
|
|
1375
|
+
panelOpen: boolean;
|
|
1376
|
+
openPanel: () => void;
|
|
1377
|
+
closePanel: () => void;
|
|
1378
|
+
}
|
|
1379
|
+
/** The enclosing PageLayout's state; null outside one. */
|
|
1380
|
+
export declare function usePageLayout(): PageLayoutState | null;
|
|
1381
|
+
export declare const PageLayoutContext: React.Context<PageLayoutState | null>;
|
|
1382
|
+
|
|
1383
|
+
/** Breakpoint names: base < 640 ≤ sm < 768 ≤ md < 1024 ≤ lg < 1280 ≤ xl < 1536 ≤ 2xl (tokens bp-sm … bp-2xl). */
|
|
1384
|
+
export type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
1385
|
+
/** A value per breakpoint, mobile first: each one holds until a larger breakpoint sets another. */
|
|
1386
|
+
export type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
1387
|
+
|
|
1388
|
+
/** 12-column grid (--grid-columns, --grid-gap) laid out by its own width through a container query, so it responds to its pane, not the window. Dashboards, record bodies, card galleries. */
|
|
1389
|
+
export interface GridProps extends React.HTMLAttributes<HTMLElement> {
|
|
1390
|
+
/** Gallery mode: auto-fill columns at least this wide (number = px), e.g. 280 for cards. GridItem spans are ignored */
|
|
1391
|
+
min?: number | string;
|
|
1392
|
+
/** Column count (default --grid-columns, 12) */
|
|
1393
|
+
columns?: number;
|
|
1394
|
+
/** Gap: lg (default, --grid-gap 24), md 16, sm 12, none, or any length */
|
|
1395
|
+
gap?: 'none' | 'sm' | 'md' | 'lg' | number | string;
|
|
1396
|
+
/** Row gap when it differs from gap */
|
|
1397
|
+
rowGap?: 'none' | 'sm' | 'md' | 'lg' | number | string;
|
|
1398
|
+
/** Vertical alignment of items in a row (default stretch) */
|
|
1399
|
+
align?: 'start' | 'center' | 'end';
|
|
1400
|
+
/** Back-fills holes left by wide items */
|
|
1401
|
+
dense?: boolean;
|
|
1402
|
+
as?: any;
|
|
1403
|
+
}
|
|
1404
|
+
export declare function Grid(props: GridProps): JSX.Element;
|
|
1405
|
+
/** One cell of a Grid. */
|
|
1406
|
+
export interface GridItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
1407
|
+
/** Columns to span: a number, 'full', or per breakpoint of the Grid's width ({ base: 12, lg: 6, xl: 4 }). Default 12 */
|
|
1408
|
+
span?: Responsive<number | 'full'>;
|
|
1409
|
+
/** Starting column line */
|
|
1410
|
+
start?: number;
|
|
1411
|
+
/** Rows to span */
|
|
1412
|
+
rowSpan?: number;
|
|
1413
|
+
as?: any;
|
|
1414
|
+
}
|
|
1415
|
+
export declare function GridItem(props: GridItemProps): JSX.Element;
|
|
1416
|
+
|
|
1417
|
+
/** Breakpoint values in px (= tokens): { sm: 640, md: 768, lg: 1024, xl: 1280, '2xl': 1536 }. */
|
|
1418
|
+
export declare const BREAKPOINTS: Record<Exclude<Breakpoint, 'base'>, number>;
|
|
1419
|
+
/** Name of the largest breakpoint a width reaches. */
|
|
1420
|
+
export declare function breakpointFor(width: number): Breakpoint;
|
|
1421
|
+
/** Width (px) of an element, kept current with a ResizeObserver; null until measured. */
|
|
1422
|
+
export declare function useElementWidth(ref: React.RefObject<Element>): number | null;
|
|
1423
|
+
/** Breakpoint of an element's own width; null until measured. Use it to drop low-priority table columns in a narrow pane. */
|
|
1424
|
+
export declare function useBreakpoint(ref: React.RefObject<Element>): Breakpoint | null;
|
|
1425
|
+
/** Drawer/sheet focus handling: focus moves into the container on open, Tab stays inside, Esc calls onClose, focus returns on close. */
|
|
1426
|
+
export declare function useOverlayFocus(ref: React.RefObject<HTMLElement>, open: boolean, onClose?: () => void): void;
|
|
1427
|
+
|
|
1341
1428
|
/** The website's .room: a section that inverts the theme inside — sets data-theme opposite to its ancestor and paints --bg. */
|
|
1342
1429
|
export interface RoomProps extends React.HTMLAttributes<HTMLElement> {
|
|
1343
1430
|
/** Force a theme instead of inverting the ancestor's */
|
|
@@ -1412,7 +1499,9 @@ export interface VerticalNavigationProps extends Omit<React.HTMLAttributes<HTMLE
|
|
|
1412
1499
|
/** Each new width while resizing; persist it and pass it back as width */
|
|
1413
1500
|
onResize?: (width: number) => void;
|
|
1414
1501
|
logoHref?: string;
|
|
1415
|
-
|
|
1502
|
+
/** Layout state. Omit it inside PageLayout, which sets it from its width: docked ≥ 1280, rail 1024–1279 (collapsed to 56px until the user expands it), overlay < 1024 (a drawer with a close button that closes when an item is chosen). Standalone default: docked */
|
|
1503
|
+
mode?: 'docked' | 'rail' | 'overlay';
|
|
1504
|
+
labels?: { search?: string; collapse?: string; expand?: string; navigation?: string; resize?: string; close?: string };
|
|
1416
1505
|
}
|
|
1417
1506
|
export declare function VerticalNavigation(props: VerticalNavigationProps): JSX.Element;
|
|
1418
1507
|
|
|
@@ -1511,7 +1600,15 @@ export interface SplitViewProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
1511
1600
|
resizable?: boolean;
|
|
1512
1601
|
/** Shows a toggle that hides the list */
|
|
1513
1602
|
collapsible?: boolean;
|
|
1514
|
-
|
|
1603
|
+
/** Width of the SplitView itself (a breakpoint name or px) below which list and detail stack: the list fills the pane and a picked record opens as a full pane with a back button. Default 'md' (768); false never stacks. Below 'lg' (1024) the list narrows to --panel-w */
|
|
1604
|
+
stackBelow?: 'sm' | 'md' | 'lg' | 'xl' | number | false;
|
|
1605
|
+
/** Pane shown first when stacked (default 'list') */
|
|
1606
|
+
defaultStackedView?: 'list' | 'detail';
|
|
1607
|
+
/** Called when the stacked pane changes */
|
|
1608
|
+
onStackedViewChange?: (view: 'list' | 'detail') => void;
|
|
1609
|
+
/** Called by the stacked detail's back button (after it returns to the list) */
|
|
1610
|
+
onBack?: () => void;
|
|
1611
|
+
labels?: { resize?: string; empty?: string; collapse?: string; expand?: string; back?: string };
|
|
1515
1612
|
}
|
|
1516
1613
|
export declare function SplitView(props: SplitViewProps): JSX.Element;
|
|
1517
1614
|
|
|
@@ -1720,6 +1817,40 @@ export interface StepperProps extends Omit<React.HTMLAttributes<HTMLOListElement
|
|
|
1720
1817
|
}
|
|
1721
1818
|
export declare function Stepper(props: StepperProps): JSX.Element;
|
|
1722
1819
|
|
|
1820
|
+
/** One view in an ActivityBar. */
|
|
1821
|
+
export interface ActivityBarItem {
|
|
1822
|
+
/** Value passed to onSelect and matched against `active` */
|
|
1823
|
+
id: string;
|
|
1824
|
+
/** Lucide icon name (kebab-case), or a node such as <ProductIcon product="code" size={20} /> */
|
|
1825
|
+
icon: string | React.ReactNode;
|
|
1826
|
+
/** Accessible name and tooltip text */
|
|
1827
|
+
label: string;
|
|
1828
|
+
/** Small count Badge on the icon (a number, or a short word) */
|
|
1829
|
+
badge?: number | string;
|
|
1830
|
+
/** Shown dimmed, skipped by the arrow keys, not selectable */
|
|
1831
|
+
disabled?: boolean;
|
|
1832
|
+
/** id of the view panel this item opens (sets aria-controls) */
|
|
1833
|
+
controls?: string;
|
|
1834
|
+
/** id for the tab button, so the panel can point back with aria-labelledby */
|
|
1835
|
+
tabId?: string;
|
|
1836
|
+
}
|
|
1837
|
+
/** Vertical 48px icon strip that switches the view beside it, like VS Code's activity bar or IntelliJ's tool-window bar: use it in IDE mocks and the web build of the Code panel. A vertical tablist with roving focus (↑ ↓ Home End, Enter or Space selects), tooltips with each label, a 2px --signal bar on the edge facing the view. */
|
|
1838
|
+
export interface ActivityBarProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
1839
|
+
/** Top group of views */
|
|
1840
|
+
items: ActivityBarItem[];
|
|
1841
|
+
/** Bottom group (accounts, settings), pushed to the foot of the bar */
|
|
1842
|
+
footerItems?: ActivityBarItem[];
|
|
1843
|
+
/** id of the selected item */
|
|
1844
|
+
active?: string;
|
|
1845
|
+
/** Called with the id and item when an item is clicked or chosen with Enter / Space */
|
|
1846
|
+
onSelect?: (id: string, item: ActivityBarItem) => void;
|
|
1847
|
+
/** Which side of the view the bar sits on; the active bar and the --line edge face the view (default left) */
|
|
1848
|
+
side?: 'left' | 'right';
|
|
1849
|
+
/** aria-label of the tablist (default "Views") */
|
|
1850
|
+
labels?: { navigation?: string };
|
|
1851
|
+
}
|
|
1852
|
+
export declare function ActivityBar(props: ActivityBarProps): JSX.Element;
|
|
1853
|
+
|
|
1723
1854
|
// --- feedback ---
|
|
1724
1855
|
/** The brand loader: the Aginies mark animated with CSS keyframes only. Use it wherever the product itself is working (boot, page data, an agent run); use Spinner for a single control. */
|
|
1725
1856
|
export interface AginiesLoaderProps extends Omit<React.HTMLAttributes<HTMLElement>, 'label'> {
|
|
@@ -1994,7 +2125,10 @@ export interface SidePanelProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
1994
2125
|
size?: 'md' | 'lg';
|
|
1995
2126
|
/** Any width (number = px), overriding size: a 600px trace inspector, "40vw" */
|
|
1996
2127
|
width?: number | string;
|
|
2128
|
+
/** docked sits in the layout (inside PageLayout, a SidePanel with no mode is docked); overlay (default) is a modal sheet from the right: scrim, focus moved in and kept inside, Esc and scrim click call onClose, focus restored */
|
|
1997
2129
|
mode?: 'overlay' | 'docked';
|
|
2130
|
+
/** Overlay only: the --overlay scrim behind the sheet (default true) */
|
|
2131
|
+
scrim?: boolean;
|
|
1998
2132
|
children?: React.ReactNode;
|
|
1999
2133
|
labels?: { close?: string };
|
|
2000
2134
|
}
|