@westonkd/sprint 0.4.0 → 0.6.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/agent-manifest.json +1762 -227
- package/dist/index.cjs +381 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1654 -133
- package/dist/index.js +5378 -1935
- package/dist/index.js.map +1 -1
- package/dist/sprint.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { JSX } from 'react';
|
|
3
|
+
import { MouseEvent as MouseEvent_2 } from 'react';
|
|
3
4
|
import { MouseEventHandler } from 'react';
|
|
4
5
|
import { Provider } from 'react';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
@@ -7,6 +8,8 @@ import { Ref } from 'react';
|
|
|
7
8
|
|
|
8
9
|
export declare function accessibleText(element: Element): string | undefined;
|
|
9
10
|
|
|
11
|
+
export declare const ACT_BREADCRUMB_TOOL: AgentToolSpec;
|
|
12
|
+
|
|
10
13
|
export declare function afterCommit(): Promise<void>;
|
|
11
14
|
|
|
12
15
|
export declare const AGENT_ATTRIBUTE = "data-sprint-agent";
|
|
@@ -87,6 +90,7 @@ export declare function AgentLine(props: AgentLineProps): JSX.Element;
|
|
|
87
90
|
export declare interface AgentLineProps {
|
|
88
91
|
node: AgentNode;
|
|
89
92
|
children?: ReactNode;
|
|
93
|
+
silent?: boolean;
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
export declare interface AgentManifest {
|
|
@@ -259,6 +263,193 @@ export declare interface AlertProps extends ComponentPropsWithRef<"div"> {
|
|
|
259
263
|
|
|
260
264
|
export declare type AlertTone = "neutral" | "info" | "warning" | "danger";
|
|
261
265
|
|
|
266
|
+
export declare function Breadcrumb(props: BreadcrumbProps): JSX.Element;
|
|
267
|
+
|
|
268
|
+
export declare interface BreadcrumbAction {
|
|
269
|
+
label: string;
|
|
270
|
+
href?: string;
|
|
271
|
+
external?: boolean;
|
|
272
|
+
onSelect?: () => void;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export declare interface BreadcrumbItem {
|
|
276
|
+
label: string;
|
|
277
|
+
href?: string;
|
|
278
|
+
active?: boolean;
|
|
279
|
+
external?: boolean;
|
|
280
|
+
children?: readonly BreadcrumbItem[];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export declare const breadcrumbMeta: {
|
|
284
|
+
readonly name: "Breadcrumb";
|
|
285
|
+
readonly category: "navigation";
|
|
286
|
+
readonly summary: "A navigation landmark that renders as one line: the path to the current page, where every crumb opens the level it sits in. Every destination in the tree stays in the page as an addressable part; the crumbs decide which of them a person is shown.";
|
|
287
|
+
readonly whenToUse: "Use it as an application's primary navigation when the destinations form a tree, or when the catalogue is larger than a rail can hold. A crumb opens its siblings, a branch drills into its children, and typing in an open crumb searches the whole tree, so what a person chooses from is one level rather than the whole set. Put a page-level command or two in actions. It takes destinations as data because it counts, filters and orders them.";
|
|
288
|
+
readonly whenNotToUse: "Do not use it for a handful of links that fit in a sidebar; that is Nav with NavGroup, which keeps every destination visible at once. Do not use it for links inside prose, and do not pass components in items or actions: each destination is a label, an href and its children, not a node.";
|
|
289
|
+
readonly status: "experimental";
|
|
290
|
+
readonly props: {
|
|
291
|
+
readonly label: {
|
|
292
|
+
readonly kind: "string";
|
|
293
|
+
readonly description: "What this navigation is for. Rendered as the landmark's accessible name and as the root of the path.";
|
|
294
|
+
readonly required: true;
|
|
295
|
+
};
|
|
296
|
+
readonly href: {
|
|
297
|
+
readonly kind: "string";
|
|
298
|
+
readonly description: "Where the root of the path leads, such as the list a detail page belongs to. Without it the root is plain text.";
|
|
299
|
+
};
|
|
300
|
+
readonly items: {
|
|
301
|
+
readonly kind: "array";
|
|
302
|
+
readonly description: "The destinations, as a tree of { label, href?, active?, external?, children? }. The item marked active is the current page, and the crumbs are the path to it. A branch without an href is a level, not a destination.";
|
|
303
|
+
readonly required: true;
|
|
304
|
+
};
|
|
305
|
+
readonly actions: {
|
|
306
|
+
readonly kind: "array";
|
|
307
|
+
readonly description: "Commands for the whole page, rendered at the end of the bar, as { label, href?, external?, onSelect? }. An action with an href is a link; one without runs onSelect.";
|
|
308
|
+
};
|
|
309
|
+
readonly maxCrumbs: {
|
|
310
|
+
readonly kind: "number";
|
|
311
|
+
readonly description: "How many crumbs the bar shows before it folds the middle of the path behind an ellipsis. On a narrow screen every crumb but the last folds regardless.";
|
|
312
|
+
readonly default: 4;
|
|
313
|
+
};
|
|
314
|
+
readonly emptyLabel: {
|
|
315
|
+
readonly kind: "string";
|
|
316
|
+
readonly description: "What the bar says when a filter matches no destination.";
|
|
317
|
+
readonly default: "No match";
|
|
318
|
+
};
|
|
319
|
+
readonly trailEmptyLabel: {
|
|
320
|
+
readonly kind: "string";
|
|
321
|
+
readonly description: "What the bar says when nothing has been visited through it yet.";
|
|
322
|
+
readonly default: "Nothing visited yet";
|
|
323
|
+
};
|
|
324
|
+
readonly open: {
|
|
325
|
+
readonly kind: "string";
|
|
326
|
+
readonly description: "Which crumb is open, as its depth from 0, or 'trail', or 'closed'. Pass it to drive the bar from outside, such as from an application-level shortcut; leave it off and the bar keeps its own state.";
|
|
327
|
+
};
|
|
328
|
+
readonly onOpenChange: {
|
|
329
|
+
readonly kind: "handler";
|
|
330
|
+
readonly description: "Called with the crumb depth the bar wants open, 'trail', or 'closed'. Required when open is controlled, so the bar can still close itself.";
|
|
331
|
+
};
|
|
332
|
+
readonly defaultVisited: {
|
|
333
|
+
readonly kind: "array";
|
|
334
|
+
readonly description: "The hrefs already visited, oldest first, to seed the trail with. Use it to restore a trail recorded through onNavigate when the bar remounts.";
|
|
335
|
+
};
|
|
336
|
+
readonly visited: {
|
|
337
|
+
readonly kind: "array";
|
|
338
|
+
readonly description: "The trail as hrefs, oldest first, when the owner keeps it. Leave it off and the bar keeps its own trail for as long as it is mounted.";
|
|
339
|
+
};
|
|
340
|
+
readonly onNavigate: {
|
|
341
|
+
readonly kind: "handler";
|
|
342
|
+
readonly description: "Called with the item when a destination is chosen, before the browser follows the href. Use it to record the visit somewhere that outlives this component.";
|
|
343
|
+
};
|
|
344
|
+
readonly agentName: {
|
|
345
|
+
readonly kind: "string";
|
|
346
|
+
readonly description: "Overrides the label when deriving the action tool's name.";
|
|
347
|
+
};
|
|
348
|
+
readonly agentTool: {
|
|
349
|
+
readonly kind: "boolean";
|
|
350
|
+
readonly description: "Whether actions without an href register a WebMCP tool.";
|
|
351
|
+
readonly default: true;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
readonly state: {
|
|
355
|
+
readonly href: {
|
|
356
|
+
readonly description: "On the root: where the root of the path leads. On a destination or an action: where it goes.";
|
|
357
|
+
readonly attribute: "data-sprint-href";
|
|
358
|
+
};
|
|
359
|
+
readonly recency: {
|
|
360
|
+
readonly description: "On a group of results while the trail is open: 1 for the group visited most recently, counting up. Orders the groups without a style attribute.";
|
|
361
|
+
readonly attribute: "data-sprint-recency";
|
|
362
|
+
};
|
|
363
|
+
readonly path: {
|
|
364
|
+
readonly description: "The path to the current page, labels joined by ' / '. Absent when no item is active.";
|
|
365
|
+
readonly attribute: "data-sprint-path";
|
|
366
|
+
};
|
|
367
|
+
readonly destinations: {
|
|
368
|
+
readonly description: "How many destinations the tree holds.";
|
|
369
|
+
readonly attribute: "data-sprint-destinations";
|
|
370
|
+
};
|
|
371
|
+
readonly visited: {
|
|
372
|
+
readonly description: "How many destinations have been visited through this bar.";
|
|
373
|
+
readonly attribute: "data-sprint-visited";
|
|
374
|
+
};
|
|
375
|
+
readonly open: {
|
|
376
|
+
readonly description: "Which crumb is open, as its depth, or trail. Absent when the bar is closed to its one line.";
|
|
377
|
+
readonly attribute: "data-sprint-open";
|
|
378
|
+
};
|
|
379
|
+
readonly matches: {
|
|
380
|
+
readonly description: "How many entries the open crumb is showing.";
|
|
381
|
+
readonly attribute: "data-sprint-matches";
|
|
382
|
+
};
|
|
383
|
+
readonly shown: {
|
|
384
|
+
readonly description: "On a destination: present when the open crumb is currently showing it to a person. Every destination stays in the page either way.";
|
|
385
|
+
readonly attribute: "data-sprint-shown";
|
|
386
|
+
};
|
|
387
|
+
readonly parent: {
|
|
388
|
+
readonly description: "On a destination: the labels of the levels above it, joined by ' / '.";
|
|
389
|
+
readonly attribute: "data-sprint-parent";
|
|
390
|
+
};
|
|
391
|
+
readonly active: {
|
|
392
|
+
readonly description: "On a destination: present when it is the current page.";
|
|
393
|
+
readonly attribute: "data-sprint-active";
|
|
394
|
+
};
|
|
395
|
+
readonly ancestor: {
|
|
396
|
+
readonly description: "On a destination: present when it is on the path to the current page.";
|
|
397
|
+
readonly attribute: "data-sprint-ancestor";
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly tools: {
|
|
401
|
+
readonly act: AgentToolSpec;
|
|
402
|
+
};
|
|
403
|
+
readonly agentView: {
|
|
404
|
+
readonly example: "- **Breadcrumb** \"Workbench\" [destinations=2, path=display / Table, visited=0] → tool `act-workbench`\n - part `action` \"Copy link\"\n - part `destination` \"Button\" [href=#/Button, parent=action]\n - part `destination` \"Table\" [active, href=#/Table, parent=display]";
|
|
405
|
+
};
|
|
406
|
+
readonly a11y: {
|
|
407
|
+
readonly role: "navigation";
|
|
408
|
+
readonly notes: "The label is the landmark's accessible name and the crumbs are an ordered list, the current one carrying aria-current=page. Destinations the open crumb is not showing are hidden from the accessibility tree by CSS, so a screen reader travels one level at a time exactly as a sighted reader does, while the page itself keeps all of them. From the field, ArrowDown enters the results and ArrowUp at the top returns to it; typing anywhere in the results goes back to the field and keeps the character. Enter takes the first result. Escape closes the bar, as does a press outside it, and the match count is a polite live region. ArrowUp in an empty field recalls the trail, the way a console recalls history. The ellipsis that folds the middle of the path is a toggle with aria-expanded.";
|
|
409
|
+
};
|
|
410
|
+
readonly relatedComponents: readonly ["Nav", "NavGroup", "Link", "Shell"];
|
|
411
|
+
readonly examples: readonly [{
|
|
412
|
+
readonly title: "A path you can edit";
|
|
413
|
+
readonly description: "One line of chrome over a tree. Each crumb opens the level it sits in and filters it as you type; a branch drills into its children.";
|
|
414
|
+
readonly code: "<Breadcrumb\n label=\"Workbench\"\n items={[\n { label: \"action\", children: [{ href: \"#/Button\", label: \"Button\" }] },\n {\n label: \"display\",\n children: [{ href: \"#/Table\", label: \"Table\", active: true }],\n },\n ]}\n/>";
|
|
415
|
+
}, {
|
|
416
|
+
readonly title: "A deep path that folds";
|
|
417
|
+
readonly description: "Past maxCrumbs the middle of the path folds behind an ellipsis, which unfolds it again. A crumb that is open is never folded.";
|
|
418
|
+
readonly code: "<Breadcrumb\n label=\"Store\"\n maxCrumbs={3}\n items={[\n {\n label: \"Clothing\",\n href: \"#/clothing\",\n children: [\n {\n label: \"Outerwear\",\n href: \"#/clothing/outerwear\",\n children: [\n {\n label: \"Jackets\",\n href: \"#/clothing/outerwear/jackets\",\n children: [{ label: \"Rain shell\", href: \"#/rain-shell\", active: true }],\n },\n ],\n },\n ],\n },\n ]}\n/>";
|
|
419
|
+
}, {
|
|
420
|
+
readonly title: "Trailing actions";
|
|
421
|
+
readonly description: "Commands for the whole page sit at the end of the bar. A link action publishes its href; one with onSelect registers a WebMCP tool, since an agent has no URL to reach it by.";
|
|
422
|
+
readonly code: "<Breadcrumb\n label=\"Docs\"\n items={[{ label: \"guides\", children: [{ href: \"#/guide/webmcp\", label: \"WebMCP\", active: true }] }]}\n actions={[\n { label: \"Copy link\", onSelect: () => navigator.clipboard.writeText(location.href) },\n { label: \"Source\", href: \"https://github.com/westonkd/sprint\", external: true },\n ]}\n/>";
|
|
423
|
+
}, {
|
|
424
|
+
readonly title: "A root that leads back";
|
|
425
|
+
readonly description: "Give the root an href and it becomes a link back to the list the page belongs to, the way \"People\" leads from a person back to everyone.";
|
|
426
|
+
readonly code: "<Breadcrumb\n label=\"People\"\n href=\"#/people\"\n items={[\n {\n label: \"Admin\",\n href: \"#/people?role=admin\",\n children: [{ label: \"Tess Ocampo\", href: \"#/people/tess\", active: true }],\n },\n ]}\n/>";
|
|
427
|
+
}, {
|
|
428
|
+
readonly title: "Recording where a person has been";
|
|
429
|
+
readonly description: "The bar keeps a trail of the destinations chosen through it, reachable from the visited count at its head. Record visits through onNavigate and hand them back in defaultVisited, and the trail survives the bar remounting.";
|
|
430
|
+
readonly code: "<Breadcrumb\n label=\"Docs\"\n items={[{ label: \"guides\", children: [{ href: \"#/guide/webmcp\", label: \"WebMCP\" }] }]}\n defaultVisited={[\"#/guide/webmcp\"]}\n onNavigate={(item) => console.log(item.href)}\n/>";
|
|
431
|
+
}];
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
export declare type BreadcrumbOpening = number | "trail" | "closed";
|
|
435
|
+
|
|
436
|
+
export declare interface BreadcrumbProps extends Omit<ComponentPropsWithRef<"nav">, "children"> {
|
|
437
|
+
label: string;
|
|
438
|
+
items: readonly BreadcrumbItem[];
|
|
439
|
+
actions?: readonly BreadcrumbAction[];
|
|
440
|
+
maxCrumbs?: number;
|
|
441
|
+
emptyLabel?: string;
|
|
442
|
+
trailEmptyLabel?: string;
|
|
443
|
+
open?: BreadcrumbOpening;
|
|
444
|
+
onOpenChange?: (opening: BreadcrumbOpening) => void;
|
|
445
|
+
onNavigate?: (item: BreadcrumbItem) => void;
|
|
446
|
+
href?: string;
|
|
447
|
+
visited?: readonly string[];
|
|
448
|
+
defaultVisited?: readonly string[];
|
|
449
|
+
agentName?: string;
|
|
450
|
+
agentTool?: boolean;
|
|
451
|
+
}
|
|
452
|
+
|
|
262
453
|
export declare function buildAgentManifest(version: string): AgentManifest;
|
|
263
454
|
|
|
264
455
|
export declare function buildAgentNode(input: NodeInput): AgentNode;
|
|
@@ -457,6 +648,106 @@ export declare interface CardProps extends Omit<ComponentPropsWithRef<"button">,
|
|
|
457
648
|
ref?: Ref<HTMLButtonElement> | Ref<HTMLAnchorElement>;
|
|
458
649
|
}
|
|
459
650
|
|
|
651
|
+
export declare interface Change {
|
|
652
|
+
kind: ChangeKind;
|
|
653
|
+
label: string;
|
|
654
|
+
from?: string;
|
|
655
|
+
to?: string;
|
|
656
|
+
detail?: string;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export declare type ChangeKind = "added" | "removed" | "changed";
|
|
660
|
+
|
|
661
|
+
export declare function ChangeList(props: ChangeListProps): JSX.Element;
|
|
662
|
+
|
|
663
|
+
export declare const changeListMeta: {
|
|
664
|
+
readonly name: "ChangeList";
|
|
665
|
+
readonly category: "display";
|
|
666
|
+
readonly summary: "A review of what will change or has changed: each row is marked added, removed or changed, and a changed row reads from → to. The kind of every row is a glyph, a tone and spoken text at once, and an agent reads it as state rather than from the glyph.";
|
|
667
|
+
readonly whenToUse: "Use it to show a diff before someone confirms it: a role change from Write to Maintain, members added to a team, settings a migration will drop. Pass the changes as data so each row is an addressable part carrying its kind, from and to. It registers no tool, because it only reports: the action is the Button that confirms the change, and the rows are already fully readable in the agent view.";
|
|
668
|
+
readonly whenNotToUse: "Do not use it for a list whose marks carry no meaning; that is List. Do not use it for a full record of fields; that is DescriptionList or Table. Do not put components in a change; label, from, to and detail are text.";
|
|
669
|
+
readonly status: "experimental";
|
|
670
|
+
readonly props: {
|
|
671
|
+
readonly label: {
|
|
672
|
+
readonly kind: "string";
|
|
673
|
+
readonly description: "What is changing. Names the list for a screen reader and for the agent view.";
|
|
674
|
+
readonly required: true;
|
|
675
|
+
};
|
|
676
|
+
readonly changes: {
|
|
677
|
+
readonly kind: "array";
|
|
678
|
+
readonly description: "The rows in order, each { kind, label, from?, to?, detail? }. kind is \"added\", \"removed\" or \"changed\"; label is the thing that changed; from and to are its old and new values, usually on a changed row; detail is one short line of consequence beneath it.";
|
|
679
|
+
readonly required: true;
|
|
680
|
+
};
|
|
681
|
+
readonly emptyLabel: {
|
|
682
|
+
readonly kind: "string";
|
|
683
|
+
readonly description: "What the list says when there is nothing to change.";
|
|
684
|
+
readonly default: "No changes";
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
readonly state: {
|
|
688
|
+
readonly changes: {
|
|
689
|
+
readonly description: "How many rows the list has.";
|
|
690
|
+
readonly attribute: "data-sprint-changes";
|
|
691
|
+
};
|
|
692
|
+
readonly added: {
|
|
693
|
+
readonly description: "How many rows are additions. Absent when there are none.";
|
|
694
|
+
readonly attribute: "data-sprint-added";
|
|
695
|
+
};
|
|
696
|
+
readonly removed: {
|
|
697
|
+
readonly description: "How many rows are removals. Absent when there are none.";
|
|
698
|
+
readonly attribute: "data-sprint-removed";
|
|
699
|
+
};
|
|
700
|
+
readonly changed: {
|
|
701
|
+
readonly description: "How many rows are changes of value. Absent when there are none.";
|
|
702
|
+
readonly attribute: "data-sprint-changed";
|
|
703
|
+
};
|
|
704
|
+
readonly empty: {
|
|
705
|
+
readonly description: "Present when there is nothing to change.";
|
|
706
|
+
readonly attribute: "data-sprint-empty";
|
|
707
|
+
};
|
|
708
|
+
readonly kind: {
|
|
709
|
+
readonly description: "On a change: whether the row was added, removed or changed.";
|
|
710
|
+
readonly attribute: "data-sprint-kind";
|
|
711
|
+
readonly values: readonly ["added", "removed", "changed"];
|
|
712
|
+
};
|
|
713
|
+
readonly from: {
|
|
714
|
+
readonly description: "On a change: the old value, when it has one.";
|
|
715
|
+
readonly attribute: "data-sprint-from";
|
|
716
|
+
};
|
|
717
|
+
readonly to: {
|
|
718
|
+
readonly description: "On a change: the new value, when it has one.";
|
|
719
|
+
readonly attribute: "data-sprint-to";
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
readonly agentView: {
|
|
723
|
+
readonly example: "- **ChangeList** \"Role changes\" [changed=1, changes=1]\n - part `change` \"Changed: Ada Lovelace, from Write to Maintain\" [from=Write, kind=changed, to=Maintain]";
|
|
724
|
+
};
|
|
725
|
+
readonly a11y: {
|
|
726
|
+
readonly role: "list";
|
|
727
|
+
readonly notes: "A ul named by its label, with an explicit list role. The +, − and → glyphs are aria-hidden; each row instead starts with visually hidden text naming its kind, and a changed row says from and to in words, so the kind never rests on the glyph or its color alone. Old values are a del and new values an ins.";
|
|
728
|
+
};
|
|
729
|
+
readonly relatedComponents: readonly ["List", "DescriptionList", "Dialog"];
|
|
730
|
+
readonly examples: readonly [{
|
|
731
|
+
readonly title: "A role change";
|
|
732
|
+
readonly description: "The one row a permission review is about: what it was, and what it becomes.";
|
|
733
|
+
readonly code: "<ChangeList\n label=\"Role changes\"\n changes={[{ kind: \"changed\", label: \"Ada Lovelace\", from: \"Write\", to: \"Maintain\" }]}\n/>";
|
|
734
|
+
}, {
|
|
735
|
+
readonly title: "A review before confirming";
|
|
736
|
+
readonly description: "Additions, removals and changes together, each with a line of consequence where one matters.";
|
|
737
|
+
readonly code: "<ChangeList\n label=\"Team changes\"\n changes={[\n { kind: \"added\", label: \"Grace Hopper\", detail: \"Gets read access to every repository.\" },\n { kind: \"removed\", label: \"Alan Turing\" },\n { kind: \"changed\", label: \"Ada Lovelace\", from: \"Write\", to: \"Maintain\" },\n ]}\n/>";
|
|
738
|
+
}, {
|
|
739
|
+
readonly title: "Nothing to change";
|
|
740
|
+
readonly description: "An empty review says so rather than rendering nothing.";
|
|
741
|
+
readonly code: "<ChangeList label=\"Role changes\" changes={[]} emptyLabel=\"No role changes\" />";
|
|
742
|
+
}];
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
export declare interface ChangeListProps extends Omit<ComponentPropsWithRef<"ul">, "children"> {
|
|
746
|
+
label: string;
|
|
747
|
+
changes: readonly Change[];
|
|
748
|
+
emptyLabel?: string;
|
|
749
|
+
}
|
|
750
|
+
|
|
460
751
|
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
461
752
|
|
|
462
753
|
export declare const checkboxMeta: {
|
|
@@ -571,6 +862,128 @@ export declare interface CheckboxProps extends Omit<ComponentPropsWithRef<"div">
|
|
|
571
862
|
agentTool?: boolean;
|
|
572
863
|
}
|
|
573
864
|
|
|
865
|
+
export declare function ChoiceGrid(props: ChoiceGridProps): JSX.Element;
|
|
866
|
+
|
|
867
|
+
export declare type ChoiceGridColumns = 2 | 3 | 4;
|
|
868
|
+
|
|
869
|
+
export declare const choiceGridMeta: {
|
|
870
|
+
readonly name: "ChoiceGrid";
|
|
871
|
+
readonly category: "input";
|
|
872
|
+
readonly summary: "A question answered by pressing one of several large, equal-sized tiles, each a glyph such as an emoji over a text label. It works in two modes: submit mode, where every tile is a real submit button carrying its value, and select mode, where the tiles are a radio group driven by value and onChange.";
|
|
873
|
+
readonly whenToUse: "Use it when one tap should answer a question and the options are few enough to show at once, ideally six to twelve: an emoji verification step at sign-in (\"pick the emoji you were sent\"), a reaction, a mood, or a category picked by icon. Submit mode needs no client state, so it suits a server-rendered form page: give it a name and no onChange, and the pressed tile submits its form with name=value. Use select mode, by passing value and onChange, when the answer is one field among several and the form is submitted by something else. A verification challenge meant for a human, such as the emoji check, should pass agentTool={false} so the page does not offer an agent a one-call way through it.";
|
|
874
|
+
readonly whenNotToUse: "Do not use it for two to four short text options, which is a SegmentedControl, for long lists, which are a Select, or for choosing several at once, which is a set of Checkboxes. Do not put components in an option: label and glyph are strings, and the label is the tile's accessible name because an emoji on its own is not one.";
|
|
875
|
+
readonly status: "experimental";
|
|
876
|
+
readonly props: {
|
|
877
|
+
readonly label: {
|
|
878
|
+
readonly kind: "string";
|
|
879
|
+
readonly description: "The question the tiles answer. Rendered as the legend of the grid's fieldset and used to derive the tool name, so write it as a person would read it, such as \"Which emoji were you sent?\".";
|
|
880
|
+
readonly required: true;
|
|
881
|
+
};
|
|
882
|
+
readonly options: {
|
|
883
|
+
readonly kind: "array";
|
|
884
|
+
readonly description: "The tiles in display order: { value, label, glyph? }. value is what the form receives, label is what a person reads and what the choose tool accepts, and glyph is a short string such as an emoji drawn large above the label and hidden from assistive technology.";
|
|
885
|
+
readonly required: true;
|
|
886
|
+
};
|
|
887
|
+
readonly columns: {
|
|
888
|
+
readonly kind: "enum";
|
|
889
|
+
readonly values: readonly ["2", "3", "4"];
|
|
890
|
+
readonly description: "How many columns the grid has at 40rem and wider. Narrower screens always get two, so every tile stays large enough to press.";
|
|
891
|
+
readonly default: 3;
|
|
892
|
+
};
|
|
893
|
+
readonly name: {
|
|
894
|
+
readonly kind: "string";
|
|
895
|
+
readonly description: "The form field name. In submit mode each tile is a submit button with this name and its option's value; in select mode a hidden input carries the selected value under this name.";
|
|
896
|
+
};
|
|
897
|
+
readonly value: {
|
|
898
|
+
readonly kind: "string";
|
|
899
|
+
readonly description: "Select mode only: the value of the selected option. Ignored in submit mode, where nothing stays selected.";
|
|
900
|
+
};
|
|
901
|
+
readonly onChange: {
|
|
902
|
+
readonly kind: "handler";
|
|
903
|
+
readonly description: "Passing it switches the grid to select mode. Called with the chosen value; the choose tool drives a real click, so it runs for agent choices too.";
|
|
904
|
+
};
|
|
905
|
+
readonly disabled: {
|
|
906
|
+
readonly kind: "boolean";
|
|
907
|
+
readonly description: "Disable every tile and unregister the choose tool.";
|
|
908
|
+
readonly default: false;
|
|
909
|
+
};
|
|
910
|
+
readonly agentName: {
|
|
911
|
+
readonly kind: "string";
|
|
912
|
+
readonly description: "Override the label used to derive the tool name, when the question is long or two grids on a page would collide.";
|
|
913
|
+
};
|
|
914
|
+
readonly agentTool: {
|
|
915
|
+
readonly kind: "boolean";
|
|
916
|
+
readonly description: "Set false to render the grid without registering a choose tool. Pass false for any challenge that exists to prove a human is present.";
|
|
917
|
+
readonly default: true;
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
readonly state: {
|
|
921
|
+
readonly mode: {
|
|
922
|
+
readonly description: "submit when pressing a tile submits the form, select when it changes a selection.";
|
|
923
|
+
readonly attribute: "data-sprint-mode";
|
|
924
|
+
readonly values: readonly ["submit", "select"];
|
|
925
|
+
};
|
|
926
|
+
readonly value: {
|
|
927
|
+
readonly description: "Select mode: the value of the option currently selected.";
|
|
928
|
+
readonly attribute: "data-sprint-value";
|
|
929
|
+
};
|
|
930
|
+
readonly columns: {
|
|
931
|
+
readonly description: "The column count at 40rem and wider.";
|
|
932
|
+
readonly attribute: "data-sprint-columns";
|
|
933
|
+
readonly values: readonly ["2", "3", "4"];
|
|
934
|
+
};
|
|
935
|
+
readonly disabled: {
|
|
936
|
+
readonly description: "Present when no tile can be pressed.";
|
|
937
|
+
readonly attribute: "data-sprint-disabled";
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
readonly tools: {
|
|
941
|
+
readonly choose: AgentToolSpec;
|
|
942
|
+
};
|
|
943
|
+
readonly agentView: {
|
|
944
|
+
readonly example: "- **ChoiceGrid** \"Pick a reaction\" [columns=4, mode=select, value=fire] → tool `choose-pick-a-reaction`\n - part `choice` \"Thumbs up\" [value=up]\n - part `choice` \"Fire\" [checked, value=fire]\n - part `choice` \"Laughing\" [value=laugh]\n - part `choice` \"Sad\" [value=sad]";
|
|
945
|
+
};
|
|
946
|
+
readonly examples: readonly [{
|
|
947
|
+
readonly title: "An emoji verification check";
|
|
948
|
+
readonly description: "Submit mode in a plain form: each tile is a submit button named emoji, so the form posts emoji=fox with no client state. agentTool is false because the check exists to prove a person is present.";
|
|
949
|
+
readonly code: "<form method=\"post\" action=\"verify\">\n <ChoiceGrid\n label=\"Which emoji were you sent?\"\n name=\"emoji\"\n agentTool={false}\n options={[\n { value: \"fox\", label: \"Fox\", glyph: \"🦊\" },\n { value: \"rocket\", label: \"Rocket\", glyph: \"🚀\" },\n { value: \"cactus\", label: \"Cactus\", glyph: \"🌵\" },\n { value: \"anchor\", label: \"Anchor\", glyph: \"⚓\" },\n { value: \"pizza\", label: \"Pizza\", glyph: \"🍕\" },\n { value: \"comet\", label: \"Comet\", glyph: \"☄️\" },\n ]}\n />\n</form>";
|
|
950
|
+
}, {
|
|
951
|
+
readonly title: "Picking one with state";
|
|
952
|
+
readonly description: "Select mode with four columns: the tiles are a radio group, and in agent view each one renders as its own control so an agent can choose without WebMCP.";
|
|
953
|
+
readonly code: "<ChoiceGrid\n label=\"Pick a reaction\"\n columns={4}\n name=\"reaction\"\n value={reaction}\n onChange={setReaction}\n options={[\n { value: \"up\", label: \"Thumbs up\", glyph: \"👍\" },\n { value: \"fire\", label: \"Fire\", glyph: \"🔥\" },\n { value: \"laugh\", label: \"Laughing\", glyph: \"😂\" },\n { value: \"sad\", label: \"Sad\", glyph: \"😢\" },\n ]}\n/>";
|
|
954
|
+
}, {
|
|
955
|
+
readonly title: "A disabled grid";
|
|
956
|
+
readonly description: "Disabled unregisters the tool and renders the agent view as text only, so an agent cannot press a tile a person could not.";
|
|
957
|
+
readonly code: "<ChoiceGrid\n label=\"Delivery window\"\n columns={2}\n disabled\n value=\"morning\"\n onChange={setWindow}\n options={[\n { value: \"morning\", label: \"Morning\", glyph: \"☀\" },\n { value: \"evening\", label: \"Evening\", glyph: \"☾\" },\n ]}\n/>";
|
|
958
|
+
}];
|
|
959
|
+
readonly a11y: {
|
|
960
|
+
readonly role: "group, or radiogroup in select mode";
|
|
961
|
+
readonly keyboard: readonly ["Tab reaches every tile in submit mode, and the group once in select mode", "Arrow keys move to the next or previous tile; in select mode they also select it", "Home and End move to the first and last tile", "Enter or Space presses the focused tile"];
|
|
962
|
+
readonly notes: "The root is a fieldset labelled by its legend. A glyph is aria-hidden and the label is always visible text, so each tile's accessible name is its label. In select mode, selection follows focus with a roving tabindex. In agent view a hidden input stays in the form so a choice made there submits the same field a person's would.";
|
|
963
|
+
};
|
|
964
|
+
readonly relatedComponents: readonly ["SegmentedControl", "Select", "Button"];
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
export declare interface ChoiceGridProps extends Omit<ComponentPropsWithRef<"fieldset">, "onChange"> {
|
|
968
|
+
label: string;
|
|
969
|
+
options: readonly ChoiceOption[];
|
|
970
|
+
columns?: ChoiceGridColumns;
|
|
971
|
+
name?: string;
|
|
972
|
+
value?: string;
|
|
973
|
+
onChange?: (value: string) => void;
|
|
974
|
+
disabled?: boolean;
|
|
975
|
+
agentName?: string;
|
|
976
|
+
agentTool?: boolean;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
export declare interface ChoiceOption {
|
|
980
|
+
value: string;
|
|
981
|
+
label: string;
|
|
982
|
+
glyph?: string;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
export declare const CHOOSE_TOOL: AgentToolSpec;
|
|
986
|
+
|
|
574
987
|
export declare function clamp(text: string, max: number): string;
|
|
575
988
|
|
|
576
989
|
export declare const CLOSE_DIALOG_TOOL: AgentToolSpec;
|
|
@@ -653,50 +1066,137 @@ export declare type CodeLanguage = "tsx" | "json" | "bash" | "text";
|
|
|
653
1066
|
|
|
654
1067
|
export declare const COMPONENT_ATTRIBUTE = "data-sprint";
|
|
655
1068
|
|
|
656
|
-
export declare
|
|
657
|
-
|
|
658
|
-
export declare function defineAgentMeta<const T extends AgentComponentMeta>(meta: T): T;
|
|
659
|
-
|
|
660
|
-
export declare interface DescriptionItem {
|
|
661
|
-
term: ReactNode;
|
|
662
|
-
description: ReactNode;
|
|
663
|
-
}
|
|
1069
|
+
export declare function CopyField(props: CopyFieldProps): JSX.Element;
|
|
664
1070
|
|
|
665
|
-
export declare
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
readonly
|
|
669
|
-
readonly
|
|
670
|
-
readonly
|
|
671
|
-
readonly whenToUse: "Use for the properties of a single entity: a token's created date and scopes, a session's device and last activity, a profile's fields. Each item pairs one term with one description.";
|
|
672
|
-
readonly whenNotToUse: "Do not use for many entities with the same fields; that is a Table. Do not put components inside term or description; both are flattened to text for the agent view, so only inline content survives. Do not use for prose sequences; that is a List.";
|
|
1071
|
+
export declare const copyFieldMeta: {
|
|
1072
|
+
readonly name: "CopyField";
|
|
1073
|
+
readonly category: "input";
|
|
1074
|
+
readonly summary: "A labelled, read-only value with a Copy control: a setup link, an invite URL, a webhook address. The value truncates with an ellipsis on one line, stays selectable, and the control confirms with Copied for two seconds.";
|
|
1075
|
+
readonly whenToUse: "Use it to hand a person a value they are meant to paste somewhere else, such as \"Copy the link\" under a device setup step. The whole value stays in the DOM and in the agent view however narrow the field is drawn, so truncation never hides it from a screen reader or an agent.";
|
|
1076
|
+
readonly whenNotToUse: "Do not use it for a secret; that is a SecretField, which masks the value and keeps it off every agent surface. Do not use it for a plain read-only value nobody needs to copy; that is a TextInput with readOnly, or a DescriptionList row. Do not use it for multi-line code; that is a CodeBlock.";
|
|
673
1077
|
readonly status: "experimental";
|
|
674
1078
|
readonly props: {
|
|
675
1079
|
readonly label: {
|
|
676
1080
|
readonly kind: "string";
|
|
677
|
-
readonly description: "
|
|
1081
|
+
readonly description: "What the value is, shown above it as the field label and used as the node's label in the agent view, e.g. \"Setup link\".";
|
|
678
1082
|
readonly required: true;
|
|
679
1083
|
};
|
|
680
|
-
readonly
|
|
681
|
-
readonly kind: "
|
|
682
|
-
readonly description: "The
|
|
1084
|
+
readonly value: {
|
|
1085
|
+
readonly kind: "string";
|
|
1086
|
+
readonly description: "The text shown and copied, verbatim. It is never masked: an agent reads it from the value part.";
|
|
683
1087
|
readonly required: true;
|
|
684
1088
|
};
|
|
685
|
-
readonly
|
|
1089
|
+
readonly copyLabel: {
|
|
686
1090
|
readonly kind: "string";
|
|
687
|
-
readonly description: "
|
|
688
|
-
readonly default: "
|
|
1091
|
+
readonly description: "The copy control's label while idle.";
|
|
1092
|
+
readonly default: "Copy";
|
|
1093
|
+
};
|
|
1094
|
+
readonly copiedLabel: {
|
|
1095
|
+
readonly kind: "string";
|
|
1096
|
+
readonly description: "The copy control's label for two seconds after the value reaches the clipboard.";
|
|
1097
|
+
readonly default: "Copied";
|
|
1098
|
+
};
|
|
1099
|
+
readonly onCopy: {
|
|
1100
|
+
readonly kind: "handler";
|
|
1101
|
+
readonly description: "Called with the value once it is on the clipboard. Not called when the clipboard refuses the write.";
|
|
689
1102
|
};
|
|
690
1103
|
};
|
|
691
1104
|
readonly state: {
|
|
692
|
-
readonly
|
|
693
|
-
readonly description: "
|
|
694
|
-
readonly attribute: "data-sprint-
|
|
1105
|
+
readonly copied: {
|
|
1106
|
+
readonly description: "Present for two seconds after the copy control has put the value on the clipboard.";
|
|
1107
|
+
readonly attribute: "data-sprint-copied";
|
|
1108
|
+
};
|
|
1109
|
+
readonly "copy-failed": {
|
|
1110
|
+
readonly description: "Present after the clipboard refused the write or is unavailable. The value's text is selected instead, so the person can copy it by hand.";
|
|
1111
|
+
readonly attribute: "data-sprint-copy-failed";
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
readonly agentView: {
|
|
1115
|
+
readonly example: "- **CopyField** \"Setup link\"\n - part `value` \"https://sprint.example/setup/7HW4\"\n - part `copy` \"Copy\"";
|
|
1116
|
+
};
|
|
1117
|
+
readonly examples: readonly [{
|
|
1118
|
+
readonly title: "Copy the link";
|
|
1119
|
+
readonly description: "The first real need: a setup link a person pastes into another device. A long URL truncates in the field and is still copied whole.";
|
|
1120
|
+
readonly code: "<CopyField\n label=\"Setup link\"\n value=\"https://sprint.example/setup/7HW4-XK92-QQ1D?station=KX-2209&expires=2026-10-01\"\n/>";
|
|
1121
|
+
}, {
|
|
1122
|
+
readonly title: "Custom control labels";
|
|
1123
|
+
readonly description: "Relabel the control in the language of the task, and react once the value is on the clipboard.";
|
|
1124
|
+
readonly code: "<CopyField\n label=\"Invite code\"\n value=\"NOMAD-0042\"\n copyLabel=\"Copy code\"\n copiedLabel=\"Code copied\"\n onCopy={() => setShared(true)}\n/>";
|
|
1125
|
+
}];
|
|
1126
|
+
readonly a11y: {
|
|
1127
|
+
readonly role: "group";
|
|
1128
|
+
readonly keyboard: readonly ["Tab reaches the copy control", "Enter or Space copies"];
|
|
1129
|
+
readonly notes: "The group is named by its visible label. The full value is in the DOM however it is truncated, and its title shows it on hover. The copy control is a real button whose label swap is a polite live region. If the clipboard refuses, the value's text is selected so a keyboard copy still works. No WebMCP tool is registered: the value is already readable in the agent view, and an agent gains nothing from writing it to the person's clipboard that reading it does not give.";
|
|
1130
|
+
};
|
|
1131
|
+
readonly relatedComponents: readonly ["SecretField", "TextInput", "CodeBlock", "DescriptionList"];
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
export declare interface CopyFieldProps extends Omit<ComponentPropsWithRef<"fieldset">, "children" | "onCopy"> {
|
|
1135
|
+
label: string;
|
|
1136
|
+
value: string;
|
|
1137
|
+
copyLabel?: string;
|
|
1138
|
+
copiedLabel?: string;
|
|
1139
|
+
onCopy?: (value: string) => void;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
export declare const defaultAgentFormat: AgentFormatter;
|
|
1143
|
+
|
|
1144
|
+
export declare function defineAgentMeta<const T extends AgentComponentMeta>(meta: T): T;
|
|
1145
|
+
|
|
1146
|
+
export declare interface DescriptionItem {
|
|
1147
|
+
term: ReactNode;
|
|
1148
|
+
description: ReactNode;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
export declare function DescriptionList(props: DescriptionListProps): JSX.Element;
|
|
1152
|
+
|
|
1153
|
+
export declare const descriptionListMeta: {
|
|
1154
|
+
readonly name: "DescriptionList";
|
|
1155
|
+
readonly category: "display";
|
|
1156
|
+
readonly summary: "Labelled term–description pairs for the details of one thing: metadata, settings, profile fields.";
|
|
1157
|
+
readonly whenToUse: "Use for the properties of a single entity: a token's created date and scopes, a session's device and last activity, a profile's fields. Each item pairs one term with one description. It lays itself out from its own width, not the viewport's: the term sits above its value until the list is at least 32rem wide, then moves into a column of its own, so it reads the same in a sidebar as in a full-width panel.";
|
|
1158
|
+
readonly whenNotToUse: "Do not use for many entities with the same fields; that is a Table. Do not put components inside term or description; both are flattened to text for the agent view, so only inline content survives. Do not use for prose sequences; that is a List.";
|
|
1159
|
+
readonly status: "experimental";
|
|
1160
|
+
readonly props: {
|
|
1161
|
+
readonly label: {
|
|
1162
|
+
readonly kind: "string";
|
|
1163
|
+
readonly description: "The accessible name for the list, describing what entity it details.";
|
|
1164
|
+
readonly required: true;
|
|
1165
|
+
};
|
|
1166
|
+
readonly items: {
|
|
1167
|
+
readonly kind: "array";
|
|
1168
|
+
readonly description: "The pairs, in order. Each item is { term, description }; both are inline content flattened to text for the agent view.";
|
|
1169
|
+
readonly required: true;
|
|
1170
|
+
};
|
|
1171
|
+
readonly emptyLabel: {
|
|
1172
|
+
readonly kind: "string";
|
|
1173
|
+
readonly description: "Text shown when items is empty. The region keeps its frame.";
|
|
1174
|
+
readonly default: "Empty";
|
|
1175
|
+
};
|
|
1176
|
+
readonly loading: {
|
|
1177
|
+
readonly kind: "boolean";
|
|
1178
|
+
readonly description: "Set while the pairs are being fetched. Sets aria-busy and sweeps a bar along the top edge. Existing pairs stay visible; with none yet, the empty slot says loadingLabel instead of emptyLabel.";
|
|
1179
|
+
readonly default: false;
|
|
1180
|
+
};
|
|
1181
|
+
readonly loadingLabel: {
|
|
1182
|
+
readonly kind: "string";
|
|
1183
|
+
readonly description: "What the empty slot says while loading.";
|
|
1184
|
+
readonly default: "Loading";
|
|
1185
|
+
};
|
|
1186
|
+
};
|
|
1187
|
+
readonly state: {
|
|
1188
|
+
readonly items: {
|
|
1189
|
+
readonly description: "The number of pairs.";
|
|
1190
|
+
readonly attribute: "data-sprint-items";
|
|
695
1191
|
};
|
|
696
1192
|
readonly empty: {
|
|
697
1193
|
readonly description: "Present when there are no pairs.";
|
|
698
1194
|
readonly attribute: "data-sprint-empty";
|
|
699
1195
|
};
|
|
1196
|
+
readonly loading: {
|
|
1197
|
+
readonly description: "Present while the pairs are being fetched. Alongside empty it means nothing has arrived yet, not that there is nothing.";
|
|
1198
|
+
readonly attribute: "data-sprint-loading";
|
|
1199
|
+
};
|
|
700
1200
|
};
|
|
701
1201
|
readonly agentView: {
|
|
702
1202
|
readonly example: "- **DescriptionList** \"Key sk-prod\" [items=2]";
|
|
@@ -719,6 +1219,8 @@ export declare interface DescriptionListProps extends ComponentPropsWithRef<"dl"
|
|
|
719
1219
|
label: string;
|
|
720
1220
|
items: readonly DescriptionItem[];
|
|
721
1221
|
emptyLabel?: string;
|
|
1222
|
+
loading?: boolean;
|
|
1223
|
+
loadingLabel?: string;
|
|
722
1224
|
}
|
|
723
1225
|
|
|
724
1226
|
export declare function Dialog(props: DialogProps): JSX.Element | null;
|
|
@@ -810,8 +1312,353 @@ export declare interface DialogProps extends Omit<ComponentPropsWithRef<"dialog"
|
|
|
810
1312
|
agentTool?: boolean;
|
|
811
1313
|
}
|
|
812
1314
|
|
|
1315
|
+
export declare function Disclosure(props: DisclosureProps): JSX.Element;
|
|
1316
|
+
|
|
1317
|
+
export declare const disclosureMeta: {
|
|
1318
|
+
readonly name: "Disclosure";
|
|
1319
|
+
readonly category: "layout";
|
|
1320
|
+
readonly summary: "A labelled region a person can show or hide with a toggle that carries its expanded state. Collapsing conceals the content from a person only: it stays in the page, and the agent view always renders it.";
|
|
1321
|
+
readonly whenToUse: "Use it for secondary detail a person reads on demand beside the primary content, such as an access breakdown on a user page behind \"Show access breakdown\". It replaces a Button that swaps its own label, because the toggle publishes aria-expanded and the region it controls, and the content stays readable to an agent without a click.";
|
|
1322
|
+
readonly whenNotToUse: "Do not use it to hide content an agent should not read; collapsing is a human affordance and the agent view carries the content regardless. Do not use it for a region that is always visible, which is a Panel, or for content that must interrupt the page, which is a Dialog. Do not use it to switch between alternative views of the same data, which is a SegmentedControl.";
|
|
1323
|
+
readonly status: "experimental";
|
|
1324
|
+
readonly props: {
|
|
1325
|
+
readonly label: {
|
|
1326
|
+
readonly kind: "string";
|
|
1327
|
+
readonly description: "What the region is, as a noun phrase such as \"Access breakdown\". It names the region for a screen reader, derives the toggle text and the tool name.";
|
|
1328
|
+
readonly required: true;
|
|
1329
|
+
};
|
|
1330
|
+
readonly children: {
|
|
1331
|
+
readonly kind: "node";
|
|
1332
|
+
readonly description: "The region's content. It is always mounted: collapsing hides it from a person with CSS, so components inside keep their tools and stay in the page projection.";
|
|
1333
|
+
};
|
|
1334
|
+
readonly expanded: {
|
|
1335
|
+
readonly kind: "boolean";
|
|
1336
|
+
readonly description: "Whether the region is revealed. Pass it with onExpandedChange to control the disclosure; leave it unset to let the disclosure keep its own state.";
|
|
1337
|
+
};
|
|
1338
|
+
readonly defaultExpanded: {
|
|
1339
|
+
readonly kind: "boolean";
|
|
1340
|
+
readonly description: "The initial state when the disclosure is uncontrolled.";
|
|
1341
|
+
readonly default: false;
|
|
1342
|
+
};
|
|
1343
|
+
readonly onExpandedChange: {
|
|
1344
|
+
readonly kind: "handler";
|
|
1345
|
+
readonly description: "Called with the new state whenever the toggle is pressed, by a person, a DOM-driving agent, or the expand tool.";
|
|
1346
|
+
};
|
|
1347
|
+
readonly showLabel: {
|
|
1348
|
+
readonly kind: "string";
|
|
1349
|
+
readonly description: "The toggle text while collapsed.";
|
|
1350
|
+
readonly default: "\"Show \" followed by the label";
|
|
1351
|
+
};
|
|
1352
|
+
readonly hideLabel: {
|
|
1353
|
+
readonly kind: "string";
|
|
1354
|
+
readonly description: "The toggle text while expanded.";
|
|
1355
|
+
readonly default: "\"Hide \" followed by the label";
|
|
1356
|
+
};
|
|
1357
|
+
readonly agentName: {
|
|
1358
|
+
readonly kind: "string";
|
|
1359
|
+
readonly description: "Override the label used to derive the tool name, when two disclosures on a page would otherwise collide.";
|
|
1360
|
+
};
|
|
1361
|
+
readonly agentTool: {
|
|
1362
|
+
readonly kind: "boolean";
|
|
1363
|
+
readonly description: "Set false to render the disclosure without registering an expand tool.";
|
|
1364
|
+
readonly default: true;
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
readonly state: {
|
|
1368
|
+
readonly expanded: {
|
|
1369
|
+
readonly description: "Present while the region is revealed to a person. Absent means collapsed: the content is still in the page, concealed by CSS rather than unmounted or marked hidden.";
|
|
1370
|
+
readonly attribute: "data-sprint-expanded";
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
readonly tools: {
|
|
1374
|
+
readonly expand: AgentToolSpec;
|
|
1375
|
+
};
|
|
1376
|
+
readonly agentView: {
|
|
1377
|
+
readonly example: "- **Disclosure** \"Access breakdown\" → tool `expand-access-breakdown`\n - part `toggle` \"Show access breakdown\"\n - **Text** \"Admin through the Operators group.\"";
|
|
1378
|
+
};
|
|
1379
|
+
readonly examples: readonly [{
|
|
1380
|
+
readonly title: "Secondary detail on demand";
|
|
1381
|
+
readonly description: "Uncontrolled: the disclosure keeps its own state. In agent view the content renders beneath the line whether or not a person has opened it, and the toggle is one control.";
|
|
1382
|
+
readonly code: "<Disclosure label=\"Access breakdown\">\n <Text>Admin through the Operators group.</Text>\n</Disclosure>";
|
|
1383
|
+
}, {
|
|
1384
|
+
readonly title: "A controlled disclosure";
|
|
1385
|
+
readonly description: "Pass expanded and onExpandedChange when something else on the page needs to know or set whether the region is open. The expand tool drives the same toggle.";
|
|
1386
|
+
readonly code: "<Disclosure\n label=\"Access breakdown\"\n expanded={open}\n onExpandedChange={setOpen}\n>\n <Text>Admin through the Operators group.</Text>\n</Disclosure>";
|
|
1387
|
+
}, {
|
|
1388
|
+
readonly title: "Custom toggle text";
|
|
1389
|
+
readonly description: "showLabel and hideLabel replace the derived toggle text when the noun phrase does not read naturally after Show and Hide.";
|
|
1390
|
+
readonly code: "<Disclosure label=\"Audit trail\" showLabel=\"Show 12 events\" hideLabel=\"Hide events\">\n <Text>Last change was a role grant by the on-call operator.</Text>\n</Disclosure>";
|
|
1391
|
+
}];
|
|
1392
|
+
readonly a11y: {
|
|
1393
|
+
readonly role: "region";
|
|
1394
|
+
readonly keyboard: readonly ["Enter toggles", "Space toggles"];
|
|
1395
|
+
readonly notes: "The root is a section named by the label. The toggle is a real button with aria-expanded and aria-controls pointing at the content. Collapsed content is display: none, which removes it from the accessibility tree for a person and a screen reader while leaving it in the DOM for the agent projection.";
|
|
1396
|
+
};
|
|
1397
|
+
readonly relatedComponents: readonly ["Panel", "Switch"];
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1400
|
+
export declare interface DisclosureProps extends ComponentPropsWithRef<"section"> {
|
|
1401
|
+
label: string;
|
|
1402
|
+
expanded?: boolean;
|
|
1403
|
+
defaultExpanded?: boolean;
|
|
1404
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
1405
|
+
showLabel?: string;
|
|
1406
|
+
hideLabel?: string;
|
|
1407
|
+
agentName?: string;
|
|
1408
|
+
agentTool?: boolean;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
813
1411
|
export declare const DISMISS_ALERT_TOOL: AgentToolSpec;
|
|
814
1412
|
|
|
1413
|
+
export declare function Divider(props: DividerProps): JSX.Element | null;
|
|
1414
|
+
|
|
1415
|
+
export declare const dividerMeta: {
|
|
1416
|
+
readonly name: "Divider";
|
|
1417
|
+
readonly category: "layout";
|
|
1418
|
+
readonly summary: "A horizontal rule that segments a page: the line between a header or a breadcrumb and the body under it, or between two runs of content. It draws in the active theme's own keyline or band, and can name the segment it opens.";
|
|
1419
|
+
readonly whenToUse: "Use it where a page changes subject and nothing else marks the change: under a PageHeader or a Breadcrumb before the body starts, or between groups of panels. Give it a label when the segment that follows has a name worth reading; an unlabelled Divider is invisible in agent view, because an agent does not care where a line is drawn, only what the line announces.";
|
|
1420
|
+
readonly whenNotToUse: "Do not use it to space things out; that is the gap on Stack. Do not use it to frame a region with a header; that is Panel, which draws its own keylines. Do not stack two in a row, and do not use it inside a Panel to separate a list's items; the list draws its own.";
|
|
1421
|
+
readonly status: "experimental";
|
|
1422
|
+
readonly props: {
|
|
1423
|
+
readonly label: {
|
|
1424
|
+
readonly kind: "string";
|
|
1425
|
+
readonly description: "The name of the segment the divider opens, rendered small on the rule.";
|
|
1426
|
+
};
|
|
1427
|
+
readonly weight: {
|
|
1428
|
+
readonly kind: "enum";
|
|
1429
|
+
readonly description: "How hard the break is. \"hairline\" is a keyline, \"heavy\" a thick strong keyline, \"band\" a strip of the theme's own ornament for the one break that matters most on a page.";
|
|
1430
|
+
readonly values: readonly ["hairline", "heavy", "band"];
|
|
1431
|
+
readonly default: "hairline";
|
|
1432
|
+
};
|
|
1433
|
+
};
|
|
1434
|
+
readonly state: {
|
|
1435
|
+
readonly weight: {
|
|
1436
|
+
readonly description: "How hard the break is.";
|
|
1437
|
+
readonly attribute: "data-sprint-weight";
|
|
1438
|
+
readonly values: readonly ["hairline", "heavy", "band"];
|
|
1439
|
+
};
|
|
1440
|
+
};
|
|
1441
|
+
readonly agentView: {
|
|
1442
|
+
readonly example: "- **Divider** \"Results\" [weight=band]";
|
|
1443
|
+
};
|
|
1444
|
+
readonly a11y: {
|
|
1445
|
+
readonly role: "separator";
|
|
1446
|
+
readonly notes: "The rule is a native hr, so assistive technology announces a separator. A label is ordinary text read just before it, the way a person reads it on the rule.";
|
|
1447
|
+
};
|
|
1448
|
+
readonly relatedComponents: readonly ["Stack", "PageHeader", "Breadcrumb", "Panel"];
|
|
1449
|
+
readonly examples: readonly [{
|
|
1450
|
+
readonly title: "Separating the header from the body";
|
|
1451
|
+
readonly description: "The plainest break: a keyline under the page's chrome, before the content starts.";
|
|
1452
|
+
readonly code: "<Stack>\n <Breadcrumb\n label=\"Docs\"\n items={[{ label: \"guides\", children: [{ href: \"#/guide/webmcp\", label: \"WebMCP\", active: true }] }]}\n />\n <Divider />\n <Text>The body of the page starts here.</Text>\n</Stack>";
|
|
1453
|
+
}, {
|
|
1454
|
+
readonly title: "A named segment";
|
|
1455
|
+
readonly description: "A label names what follows, on the rule itself and to an agent reading the page.";
|
|
1456
|
+
readonly code: "<Divider label=\"Results\" weight=\"heavy\" />";
|
|
1457
|
+
}, {
|
|
1458
|
+
readonly title: "The page's main break";
|
|
1459
|
+
readonly description: "A band draws the theme's own ornament: hatching in the default register, pins in calorie, a barcode strip in trax. Use it once per page.";
|
|
1460
|
+
readonly code: "<Divider label=\"Body\" weight=\"band\" />";
|
|
1461
|
+
}];
|
|
1462
|
+
};
|
|
1463
|
+
|
|
1464
|
+
export declare interface DividerProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
1465
|
+
label?: string;
|
|
1466
|
+
weight?: DividerWeight;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
export declare type DividerWeight = "hairline" | "heavy" | "band";
|
|
1470
|
+
|
|
1471
|
+
export declare function EmptyState(props: EmptyStateProps): JSX.Element;
|
|
1472
|
+
|
|
1473
|
+
export declare interface EmptyStateAction {
|
|
1474
|
+
label: string;
|
|
1475
|
+
onSelect?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
1476
|
+
href?: string;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
export declare const emptyStateMeta: {
|
|
1480
|
+
readonly name: "EmptyState";
|
|
1481
|
+
readonly category: "feedback";
|
|
1482
|
+
readonly summary: "A region that says there is nothing here, and why: a headline, an optional sentence, and an optional way out such as clearing filters or creating the first record. It marks the empty field with the register's own empty ornament.";
|
|
1483
|
+
readonly whenToUse: "Use it in place of a list, grid, or set of results that has nothing to show, so the space says it is empty rather than rendering nothing. Set reason=\"filtered\" when records exist but none match, so an agent knows to relax the filters rather than conclude there is no data.";
|
|
1484
|
+
readonly whenNotToUse: "Do not use it for an empty Table, List, or Panel; those already carry their own emptyLabel. Do not use it for a failure; that is an Alert. Do not use it while data is still loading; that is Pending.";
|
|
1485
|
+
readonly status: "experimental";
|
|
1486
|
+
readonly props: {
|
|
1487
|
+
readonly label: {
|
|
1488
|
+
readonly kind: "string";
|
|
1489
|
+
readonly description: "The headline, saying what is empty in a few words: \"No one matches these filters\". The region's accessible name.";
|
|
1490
|
+
readonly required: true;
|
|
1491
|
+
};
|
|
1492
|
+
readonly description: {
|
|
1493
|
+
readonly kind: "string";
|
|
1494
|
+
readonly description: "One sentence of explanation or next step. Carried as the description part.";
|
|
1495
|
+
};
|
|
1496
|
+
readonly action: {
|
|
1497
|
+
readonly kind: "object";
|
|
1498
|
+
readonly description: "The one way out, as data: { label, onSelect?, href? }. An href renders a Link, otherwise a Button that registers its own press tool, so the action is a single control in the agent view.";
|
|
1499
|
+
};
|
|
1500
|
+
readonly reason: {
|
|
1501
|
+
readonly kind: "enum";
|
|
1502
|
+
readonly description: "Why it is empty: nothing exists yet, or nothing matches the current filters.";
|
|
1503
|
+
readonly values: readonly ["empty", "filtered"];
|
|
1504
|
+
readonly default: "empty";
|
|
1505
|
+
};
|
|
1506
|
+
};
|
|
1507
|
+
readonly state: {
|
|
1508
|
+
readonly empty: {
|
|
1509
|
+
readonly description: "Always present, so one selector finds every empty region.";
|
|
1510
|
+
readonly attribute: "data-sprint-empty";
|
|
1511
|
+
};
|
|
1512
|
+
readonly reason: {
|
|
1513
|
+
readonly description: "Why the region is empty.";
|
|
1514
|
+
readonly attribute: "data-sprint-reason";
|
|
1515
|
+
readonly values: readonly ["empty", "filtered"];
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1518
|
+
readonly agentView: {
|
|
1519
|
+
readonly example: "- **EmptyState** \"No one matches these filters\" [empty, reason=filtered]\n - part `description` \"Try a different role or clear the search.\"";
|
|
1520
|
+
};
|
|
1521
|
+
readonly examples: readonly [{
|
|
1522
|
+
readonly title: "Nothing matches";
|
|
1523
|
+
readonly description: "Records exist but the filters exclude them all. The action is a Button, so it registers press-clear-filters.";
|
|
1524
|
+
readonly code: "<EmptyState\n reason=\"filtered\"\n label=\"No one matches these filters\"\n description=\"Try a different role or clear the search.\"\n action={{ label: \"Clear filters\", onSelect: clearFilters }}\n/>";
|
|
1525
|
+
}, {
|
|
1526
|
+
readonly title: "Nothing yet";
|
|
1527
|
+
readonly description: "The first-run case, with a link to where records are made.";
|
|
1528
|
+
readonly code: "<EmptyState\n label=\"No projects yet\"\n description=\"Projects you create or are invited to appear here.\"\n action={{ label: \"Create a project\", href: \"#/projects/new\" }}\n/>";
|
|
1529
|
+
}, {
|
|
1530
|
+
readonly title: "Just the headline";
|
|
1531
|
+
readonly code: "<EmptyState label=\"No notifications\" />";
|
|
1532
|
+
}];
|
|
1533
|
+
readonly a11y: {
|
|
1534
|
+
readonly role: "group";
|
|
1535
|
+
readonly notes: "The headline names the group and the description describes it. The action is an ordinary Button or Link inside it, reached in normal tab order.";
|
|
1536
|
+
};
|
|
1537
|
+
readonly relatedComponents: readonly ["Pending", "Alert", "Button", "Link"];
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
export declare interface EmptyStateProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
1541
|
+
label: string;
|
|
1542
|
+
description?: string;
|
|
1543
|
+
action?: EmptyStateAction;
|
|
1544
|
+
reason?: EmptyStateReason;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
export declare type EmptyStateReason = "empty" | "filtered";
|
|
1548
|
+
|
|
1549
|
+
export declare function EntityRow(props: EntityRowProps): JSX.Element;
|
|
1550
|
+
|
|
1551
|
+
export declare type EntityRowDetail = string | {
|
|
1552
|
+
term?: string;
|
|
1553
|
+
detail: string;
|
|
1554
|
+
};
|
|
1555
|
+
|
|
1556
|
+
export declare const entityRowMeta: {
|
|
1557
|
+
readonly name: "EntityRow";
|
|
1558
|
+
readonly category: "display";
|
|
1559
|
+
readonly summary: "One record in a list of records, as a single clickable row: a title, a few Tags, and one line of meta. Give it an href and the whole row is a link; give it onSelect and it is an action that registers an open tool.";
|
|
1560
|
+
readonly whenToUse: "Use it for a list of people, projects, or anything else a person scans and picks one of, where each entry needs a name, a classification, and a line of context such as last activity. Stack several in a Stack with gap=\"none\" and adjacent rows share their keylines. The title is the accessible name, so it is also what an agent selects on.";
|
|
1561
|
+
readonly whenNotToUse: "Do not use it when the entries are compared column by column; that is a Table. Do not use it for a catalogue entry with a paragraph of body; that is a Card. Do not put controls in it: the whole row is already one link or button, so tags and meta are data, not components.";
|
|
1562
|
+
readonly status: "experimental";
|
|
1563
|
+
readonly props: {
|
|
1564
|
+
readonly title: {
|
|
1565
|
+
readonly kind: "string";
|
|
1566
|
+
readonly description: "The record's name, and the row's accessible name. Also derives the tool name when the row acts.";
|
|
1567
|
+
readonly required: true;
|
|
1568
|
+
};
|
|
1569
|
+
readonly href: {
|
|
1570
|
+
readonly kind: "string";
|
|
1571
|
+
readonly description: "Destination, which makes the whole row a link. A row that navigates registers no tool by default, because an agent can follow the href itself.";
|
|
1572
|
+
};
|
|
1573
|
+
readonly onSelect: {
|
|
1574
|
+
readonly kind: "handler";
|
|
1575
|
+
readonly description: "What clicking does, called with the click event. Alone it makes the row a button that registers an open tool by default. Alongside href the row stays a link and the handler rides the click, so a router can call preventDefault.";
|
|
1576
|
+
};
|
|
1577
|
+
readonly tags: {
|
|
1578
|
+
readonly kind: "array";
|
|
1579
|
+
readonly description: "Classifications rendered as Tags after the title: { label, tone? }, where tone is one of the Tag tones. Carried as Tag lines under the row in the agent view.";
|
|
1580
|
+
};
|
|
1581
|
+
readonly meta: {
|
|
1582
|
+
readonly kind: "array";
|
|
1583
|
+
readonly description: "One line of context, each entry a string or { term?, detail }, joined with a middle dot. Truncates rather than wraps when the row is short of room. Carried as the meta part.";
|
|
1584
|
+
};
|
|
1585
|
+
readonly description: {
|
|
1586
|
+
readonly kind: "string";
|
|
1587
|
+
readonly description: "An optional sentence under the row, for a record that needs more than a line of meta. Carried as the description part.";
|
|
1588
|
+
};
|
|
1589
|
+
readonly disabled: {
|
|
1590
|
+
readonly kind: "boolean";
|
|
1591
|
+
readonly description: "Disable an acting row and unregister its tool. Has no effect on a row that navigates or does nothing.";
|
|
1592
|
+
readonly default: false;
|
|
1593
|
+
};
|
|
1594
|
+
readonly agentTool: {
|
|
1595
|
+
readonly kind: "boolean";
|
|
1596
|
+
readonly description: "Override the default: on for a row that acts, off for a row that navigates. A row with neither href nor onSelect never registers one.";
|
|
1597
|
+
};
|
|
1598
|
+
readonly agentName: {
|
|
1599
|
+
readonly kind: "string";
|
|
1600
|
+
readonly description: "Override the title used to derive the tool name, when two rows share a title.";
|
|
1601
|
+
};
|
|
1602
|
+
};
|
|
1603
|
+
readonly state: {
|
|
1604
|
+
readonly href: {
|
|
1605
|
+
readonly description: "Where the row goes, when it navigates.";
|
|
1606
|
+
readonly attribute: "data-sprint-href";
|
|
1607
|
+
};
|
|
1608
|
+
readonly disabled: {
|
|
1609
|
+
readonly description: "Present when an acting row cannot be opened.";
|
|
1610
|
+
readonly attribute: "data-sprint-disabled";
|
|
1611
|
+
};
|
|
1612
|
+
};
|
|
1613
|
+
readonly tools: {
|
|
1614
|
+
readonly open: AgentToolSpec;
|
|
1615
|
+
};
|
|
1616
|
+
readonly agentView: {
|
|
1617
|
+
readonly example: "- **EntityRow** \"Ada Lovelace\" [href=#/people/ada]\n - part `title` \"Ada Lovelace\"\n - part `meta` \"Last sign-in: 3 days ago · 2 apps\"\n - **Tag** \"admin\" [tone=info]\n - **Tag** \"billing\" [tone=neutral]";
|
|
1618
|
+
};
|
|
1619
|
+
readonly examples: readonly [{
|
|
1620
|
+
readonly title: "A person in a directory";
|
|
1621
|
+
readonly description: "A row that navigates. No tool, because the href is already public; tags and meta are data.";
|
|
1622
|
+
readonly code: "<EntityRow\n title=\"Ada Lovelace\"\n href=\"#/people/ada\"\n tags={[{ label: \"admin\", tone: \"info\" }, { label: \"billing\" }]}\n meta={[{ term: \"Last sign-in\", detail: \"3 days ago\" }, \"2 apps\"]}\n/>";
|
|
1623
|
+
}, {
|
|
1624
|
+
readonly title: "A row that acts";
|
|
1625
|
+
readonly description: "onSelect instead of href, so the row registers open-grace-hopper and an agent can pick it.";
|
|
1626
|
+
readonly code: "<EntityRow\n title=\"Grace Hopper\"\n onSelect={() => select(\"grace\")}\n tags={[{ label: \"owner\", tone: \"warning\" }]}\n meta={[\"Invited yesterday\"]}\n/>";
|
|
1627
|
+
}, {
|
|
1628
|
+
readonly title: "A directory of rows";
|
|
1629
|
+
readonly description: "Rows stacked with no gap share their keylines, so the list reads as one ruled block.";
|
|
1630
|
+
readonly code: "<Stack gap=\"none\">\n {people.map((person) => (\n <EntityRow\n key={person.id}\n title={person.name}\n href={person.href}\n tags={person.roles.map((role) => ({ label: role }))}\n meta={[{ term: \"Last sign-in\", detail: person.lastSignIn }]}\n />\n ))}\n</Stack>";
|
|
1631
|
+
}, {
|
|
1632
|
+
readonly title: "With a description";
|
|
1633
|
+
readonly description: "A sentence under the row, for a record that needs one.";
|
|
1634
|
+
readonly code: "<EntityRow\n title=\"Payments service\"\n href=\"#/projects/payments\"\n tags={[{ label: \"degraded\", tone: \"danger\" }]}\n meta={[\"Updated 4 min ago\"]}\n description=\"Card authorisations are timing out in eu-west.\"\n/>";
|
|
1635
|
+
}];
|
|
1636
|
+
readonly a11y: {
|
|
1637
|
+
readonly notes: "The whole row is one control: a link with an href, a button with onSelect, or a labelled group with neither. The title is the accessible name, and the tags, meta, and description are its accessible description, so a screen reader announces the name first and the context after.";
|
|
1638
|
+
};
|
|
1639
|
+
readonly relatedComponents: readonly ["Card", "Tag", "Stack", "Table"];
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1642
|
+
export declare interface EntityRowProps extends Omit<ComponentPropsWithRef<"button">, "ref" | "onSelect" | "children" | "title"> {
|
|
1643
|
+
title: string;
|
|
1644
|
+
href?: string;
|
|
1645
|
+
onSelect?: (event: MouseEvent_2<HTMLElement>) => void;
|
|
1646
|
+
tags?: readonly EntityRowTag[];
|
|
1647
|
+
meta?: readonly EntityRowDetail[];
|
|
1648
|
+
description?: string;
|
|
1649
|
+
disabled?: boolean;
|
|
1650
|
+
agentTool?: boolean;
|
|
1651
|
+
agentName?: string;
|
|
1652
|
+
ref?: Ref<HTMLButtonElement> | Ref<HTMLAnchorElement> | Ref<HTMLDivElement>;
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
export declare interface EntityRowTag {
|
|
1656
|
+
label: string;
|
|
1657
|
+
tone?: TagTone;
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
export declare const EXPAND_DISCLOSURE_TOOL: AgentToolSpec;
|
|
1661
|
+
|
|
815
1662
|
export declare const FILL_TEXTAREA_TOOL: AgentToolSpec;
|
|
816
1663
|
|
|
817
1664
|
export declare const FILL_TOOL: AgentToolSpec;
|
|
@@ -980,6 +1827,7 @@ export declare interface JsonSchemaProperty {
|
|
|
980
1827
|
description?: string;
|
|
981
1828
|
enum?: readonly string[];
|
|
982
1829
|
minimum?: number;
|
|
1830
|
+
maximum?: number;
|
|
983
1831
|
default?: string | number | boolean;
|
|
984
1832
|
}
|
|
985
1833
|
|
|
@@ -1075,12 +1923,14 @@ export declare function List(props: ListProps): JSX.Element;
|
|
|
1075
1923
|
|
|
1076
1924
|
export declare function listAgentMeta(): AgentComponentMeta[];
|
|
1077
1925
|
|
|
1926
|
+
export declare type ListMarker = "plus" | "bullet" | "number" | "none";
|
|
1927
|
+
|
|
1078
1928
|
export declare const listMeta: {
|
|
1079
1929
|
readonly name: "List";
|
|
1080
1930
|
readonly category: "display";
|
|
1081
1931
|
readonly summary: "A bulleted or numbered list built from an array of items. Each item is an addressable part carrying its position, so an agent can cite item three without counting lines.";
|
|
1082
1932
|
readonly whenToUse: "Use it for a short sequence of related points: rules, steps, links, caveats. Passing items as data rather than as children is what lets the agent view carry each one as its own part.";
|
|
1083
|
-
readonly whenNotToUse: "Do not use it for records with fields; that is Table. Do not use it as a layout for cards or controls; that is Stack.";
|
|
1933
|
+
readonly whenNotToUse: "Do not use it for a diff or a review of what will change, where each mark means added or removed; that is ChangeList. Do not use it for records with fields; that is Table. Do not use it as a layout for cards or controls; that is Stack.";
|
|
1084
1934
|
readonly status: "experimental";
|
|
1085
1935
|
readonly props: {
|
|
1086
1936
|
readonly label: {
|
|
@@ -1098,32 +1948,57 @@ export declare const listMeta: {
|
|
|
1098
1948
|
readonly description: "Number the items instead of bulleting them. Use it when the order is the point.";
|
|
1099
1949
|
readonly default: false;
|
|
1100
1950
|
};
|
|
1951
|
+
readonly marker: {
|
|
1952
|
+
readonly kind: "enum";
|
|
1953
|
+
readonly description: "The mark before each item. \"plus\" is the house bullet, \"bullet\" a plain dot for quieter prose, \"number\" counts the items and makes the list ordered, \"none\" drops the marker column for a list whose items already lead with their own mark. Defaults to \"number\" when ordered is set and \"plus\" otherwise. The marker is drawn, not read: an item whose mark means something, such as added or removed, belongs in a ChangeList.";
|
|
1954
|
+
readonly values: readonly ["plus", "bullet", "number", "none"];
|
|
1955
|
+
readonly default: "plus";
|
|
1956
|
+
};
|
|
1101
1957
|
readonly emptyLabel: {
|
|
1102
1958
|
readonly kind: "string";
|
|
1103
1959
|
readonly description: "What the list says when it has no items.";
|
|
1104
1960
|
readonly default: "Empty";
|
|
1105
1961
|
};
|
|
1106
|
-
|
|
1962
|
+
readonly loading: {
|
|
1963
|
+
readonly kind: "boolean";
|
|
1964
|
+
readonly description: "Set while the items are being fetched. Sets aria-busy and sweeps a bar along the top edge. Existing items stay visible; with none yet, the empty slot says loadingLabel instead of emptyLabel.";
|
|
1965
|
+
readonly default: false;
|
|
1966
|
+
};
|
|
1967
|
+
readonly loadingLabel: {
|
|
1968
|
+
readonly kind: "string";
|
|
1969
|
+
readonly description: "What the empty slot says while loading.";
|
|
1970
|
+
readonly default: "Loading";
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1107
1973
|
readonly state: {
|
|
1108
1974
|
readonly items: {
|
|
1109
1975
|
readonly description: "How many items the list has.";
|
|
1110
1976
|
readonly attribute: "data-sprint-items";
|
|
1111
1977
|
};
|
|
1112
1978
|
readonly ordered: {
|
|
1113
|
-
readonly description: "Present when the
|
|
1979
|
+
readonly description: "Present when the list is a real ol: ordered is set, or the marker is number.";
|
|
1114
1980
|
readonly attribute: "data-sprint-ordered";
|
|
1115
1981
|
};
|
|
1982
|
+
readonly marker: {
|
|
1983
|
+
readonly description: "The mark drawn before each item.";
|
|
1984
|
+
readonly attribute: "data-sprint-marker";
|
|
1985
|
+
readonly values: readonly ["plus", "bullet", "number", "none"];
|
|
1986
|
+
};
|
|
1116
1987
|
readonly empty: {
|
|
1117
1988
|
readonly description: "Present when the list has no items.";
|
|
1118
1989
|
readonly attribute: "data-sprint-empty";
|
|
1119
1990
|
};
|
|
1991
|
+
readonly loading: {
|
|
1992
|
+
readonly description: "Present while the items are being fetched. Alongside empty it means nothing has arrived yet, not that there is nothing.";
|
|
1993
|
+
readonly attribute: "data-sprint-loading";
|
|
1994
|
+
};
|
|
1120
1995
|
readonly index: {
|
|
1121
1996
|
readonly description: "On an item: its 1-based position in the list.";
|
|
1122
1997
|
readonly attribute: "data-sprint-index";
|
|
1123
1998
|
};
|
|
1124
1999
|
};
|
|
1125
2000
|
readonly agentView: {
|
|
1126
|
-
readonly example: "- **List** \"Tool rules\" [items=1]\n - part `item` \"One tool, one action.\" [index=1]";
|
|
2001
|
+
readonly example: "- **List** \"Tool rules\" [items=1, marker=plus]\n - part `item` \"One tool, one action.\" [index=1]";
|
|
1127
2002
|
};
|
|
1128
2003
|
readonly examples: readonly [{
|
|
1129
2004
|
readonly title: "A list of rules";
|
|
@@ -1131,10 +2006,18 @@ export declare const listMeta: {
|
|
|
1131
2006
|
}, {
|
|
1132
2007
|
readonly title: "A numbered sequence";
|
|
1133
2008
|
readonly code: "<List\n ordered\n label=\"Steps\"\n items={[\"Register the tool.\", \"Drive the DOM.\", \"Return the new state.\"]}\n/>";
|
|
2009
|
+
}, {
|
|
2010
|
+
readonly title: "Plain bullets";
|
|
2011
|
+
readonly description: "A quieter dot for running prose, where the house plus would shout.";
|
|
2012
|
+
readonly code: "<List\n marker=\"bullet\"\n label=\"Caveats\"\n items={[\"Chrome 149 only.\", \"Tools are a no-op without WebMCP.\"]}\n/>";
|
|
2013
|
+
}, {
|
|
2014
|
+
readonly title: "No marker";
|
|
2015
|
+
readonly description: "For items that already lead with their own mark, such as a link or a chip.";
|
|
2016
|
+
readonly code: "<List\n marker=\"none\"\n label=\"Related\"\n items={[\"Table for records.\", \"Stack for layout.\"]}\n/>";
|
|
1134
2017
|
}];
|
|
1135
2018
|
readonly a11y: {
|
|
1136
2019
|
readonly role: "list";
|
|
1137
|
-
readonly notes: "A real ul or ol named by its label, with an explicit list role because the custom markers require list-style none and Safari would otherwise drop the list semantics. The item count is announced, and the markers are drawn as pseudo-elements.";
|
|
2020
|
+
readonly notes: "A real ul or ol named by its label, with an explicit list role because the custom markers require list-style none and Safari would otherwise drop the list semantics. The item count is announced, and the markers are drawn as pseudo-elements, so a marker never carries meaning a screen reader would miss.";
|
|
1138
2021
|
};
|
|
1139
2022
|
};
|
|
1140
2023
|
|
|
@@ -1142,7 +2025,10 @@ export declare interface ListProps extends ComponentPropsWithRef<"ul"> {
|
|
|
1142
2025
|
label: string;
|
|
1143
2026
|
items: readonly ReactNode[];
|
|
1144
2027
|
ordered?: boolean;
|
|
2028
|
+
marker?: ListMarker;
|
|
1145
2029
|
emptyLabel?: string;
|
|
2030
|
+
loading?: boolean;
|
|
2031
|
+
loadingLabel?: string;
|
|
1146
2032
|
}
|
|
1147
2033
|
|
|
1148
2034
|
export declare interface MarkdownOptions {
|
|
@@ -1160,7 +2046,7 @@ export declare const metaLineMeta: {
|
|
|
1160
2046
|
readonly name: "MetaLine";
|
|
1161
2047
|
readonly category: "display";
|
|
1162
2048
|
readonly summary: "A slash-separated manifest line of term–detail pairs: serials, build strings, issue dates. It is chrome, not content, and in the agent view it reads as the same single line of text a person sees.";
|
|
1163
|
-
readonly whenToUse: "Use it for the compact strip of identifying metadata that belongs to a page, panel, or footer: version and build identifiers, timestamps, serial numbers, owners. Values are short
|
|
2049
|
+
readonly whenToUse: "Use it for the compact strip of identifying metadata that belongs to a page, panel, or footer: version and build identifiers, timestamps, serial numbers, owners. Values are short. By default the line truncates with an ellipsis rather than wrapping; set wrap where it sits in a narrow container and every entry has to stay visible.";
|
|
1164
2050
|
readonly whenNotToUse: "Do not use it for the details of a record a person is meant to study; that is a DescriptionList. Do not put anything interactive in it, and do not use it for prose.";
|
|
1165
2051
|
readonly status: "experimental";
|
|
1166
2052
|
readonly props: {
|
|
@@ -1169,12 +2055,21 @@ export declare const metaLineMeta: {
|
|
|
1169
2055
|
readonly description: "Term–detail pairs in display order: { term, detail }, both strings. Rendered as TERM: DETAIL, slash-separated, and carried as one line in the agent view. An empty array renders nothing.";
|
|
1170
2056
|
readonly required: true;
|
|
1171
2057
|
};
|
|
2058
|
+
readonly wrap: {
|
|
2059
|
+
readonly kind: "boolean";
|
|
2060
|
+
readonly description: "Let entries flow onto further lines instead of truncating the line. Each entry stays whole on one line, and a separator stays at the end of the line it closes, so no line starts with a slash. An entry wider than the container is the only thing that still truncates.";
|
|
2061
|
+
readonly default: false;
|
|
2062
|
+
};
|
|
1172
2063
|
};
|
|
1173
2064
|
readonly state: {
|
|
1174
2065
|
readonly entries: {
|
|
1175
2066
|
readonly description: "How many term–detail pairs the line carries.";
|
|
1176
2067
|
readonly attribute: "data-sprint-entries";
|
|
1177
2068
|
};
|
|
2069
|
+
readonly wrap: {
|
|
2070
|
+
readonly description: "Present when entries may flow onto further lines.";
|
|
2071
|
+
readonly attribute: "data-sprint-wrap";
|
|
2072
|
+
};
|
|
1178
2073
|
};
|
|
1179
2074
|
readonly agentView: {
|
|
1180
2075
|
readonly example: "- **MetaLine** \"SERIAL: NU-TYPE-CORE-A1 / ISSUED: 2744.07.22\" [entries=2]";
|
|
@@ -1187,6 +2082,10 @@ export declare const metaLineMeta: {
|
|
|
1187
2082
|
readonly title: "Version chrome for a footer";
|
|
1188
2083
|
readonly description: "The line an app pins under its content or into a Shell rail.";
|
|
1189
2084
|
readonly code: "<MetaLine\n entries={[\n { term: \"Sprint\", detail: \"v0.0.0\" },\n { term: \"Channel\", detail: \"dev\" },\n { term: \"WebMCP\", detail: \"chrome 149\" },\n ]}\n/>";
|
|
2085
|
+
}, {
|
|
2086
|
+
readonly title: "Wrapping in a narrow rail";
|
|
2087
|
+
readonly description: "With wrap, a sidebar shows every entry on as many lines as it needs instead of cutting the later ones off.";
|
|
2088
|
+
readonly code: "<MetaLine\n wrap\n entries={[\n { term: \"Sprint\", detail: \"v0.0.0\" },\n { term: \"Channel\", detail: \"dev\" },\n { term: \"WebMCP\", detail: \"chrome 149\" },\n { term: \"Build\", detail: \"2744.07.22-a1\" },\n ]}\n/>";
|
|
1190
2089
|
}];
|
|
1191
2090
|
readonly a11y: {
|
|
1192
2091
|
readonly role: "paragraph";
|
|
@@ -1196,6 +2095,7 @@ export declare const metaLineMeta: {
|
|
|
1196
2095
|
|
|
1197
2096
|
export declare interface MetaLineProps extends ComponentPropsWithRef<"p"> {
|
|
1198
2097
|
entries: readonly MetaLineEntry[];
|
|
2098
|
+
wrap?: boolean;
|
|
1199
2099
|
}
|
|
1200
2100
|
|
|
1201
2101
|
export declare interface ModelContext {
|
|
@@ -1306,6 +2206,8 @@ export declare function nodeLine(node: AgentNode): string;
|
|
|
1306
2206
|
|
|
1307
2207
|
export declare const OPEN_CARD_TOOL: AgentToolSpec;
|
|
1308
2208
|
|
|
2209
|
+
export declare const OPEN_ENTITY_ROW_TOOL: AgentToolSpec;
|
|
2210
|
+
|
|
1309
2211
|
export declare const OPEN_LINK_TOOL: AgentToolSpec;
|
|
1310
2212
|
|
|
1311
2213
|
export declare const OWNER_ATTRIBUTE = "data-sprint-owner";
|
|
@@ -1344,133 +2246,516 @@ export declare const pageHeaderMeta: {
|
|
|
1344
2246
|
readonly a11y: {
|
|
1345
2247
|
readonly notes: "The label renders as the page's h1, so keep to one PageHeader per page. Tags and the lede are ordinary content after it; the header element itself takes no landmark role because it sits inside main.";
|
|
1346
2248
|
};
|
|
1347
|
-
readonly relatedComponents: readonly ["Panel", "Heading", "Tag"];
|
|
2249
|
+
readonly relatedComponents: readonly ["Panel", "Heading", "Tag"];
|
|
2250
|
+
readonly examples: readonly [{
|
|
2251
|
+
readonly title: "A titled page with a lede";
|
|
2252
|
+
readonly code: "<PageHeader label=\"Reports\">\n <Text>Everything the quarter produced, in one place.</Text>\n</PageHeader>";
|
|
2253
|
+
}, {
|
|
2254
|
+
readonly title: "Status tags and a page-level control";
|
|
2255
|
+
readonly description: "Tags classify the page on the title line; the action slot holds the one control that affects the whole page.";
|
|
2256
|
+
readonly code: "<PageHeader\n label=\"Button\"\n tags={<Tag tone=\"warning\" filled>experimental</Tag>}\n actions={<Button agentTool={false}>Refresh</Button>}\n>\n <Text>A single action a person or an agent can trigger.</Text>\n</PageHeader>";
|
|
2257
|
+
}];
|
|
2258
|
+
};
|
|
2259
|
+
|
|
2260
|
+
export declare interface PageHeaderProps extends ComponentPropsWithRef<"header"> {
|
|
2261
|
+
label: string;
|
|
2262
|
+
tags?: ReactNode;
|
|
2263
|
+
actions?: ReactNode;
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
export declare function paginate(text: string, size: number): string[];
|
|
2267
|
+
|
|
2268
|
+
export declare function Pagination(props: PaginationProps): JSX.Element;
|
|
2269
|
+
|
|
2270
|
+
export declare const paginationMeta: {
|
|
2271
|
+
readonly name: "Pagination";
|
|
2272
|
+
readonly category: "navigation";
|
|
2273
|
+
readonly summary: "A navigation landmark for a long set shown one page at a time: Previous and Next controls, a \"Page 2 of 3\" readout, and a \"Showing 26–50 of 61\" summary of which items are on screen. It takes counts rather than items, so it works the same over a local array or a server query.";
|
|
2274
|
+
readonly whenToUse: "Use it under or above a Table or List whose items arrive a page at a time, when the count is known. Give it onPageChange to page in place, which registers one turn tool that can jump straight to any page; give it href to make every page a URL, which needs no tool because a link is already reachable. Its state carries the page, the page count and the item range, so an agent reading the page knows how much it has not seen.";
|
|
2275
|
+
readonly whenNotToUse: "Do not use it when the total is unknown or the set grows as it is read; that is a load-more Button. Do not use it for steps in a flow a person must complete in order, and do not use it to move between unrelated pages, which is Nav or Breadcrumb. Do not use it for a set that fits on one screen: it renders, but has nothing to do.";
|
|
2276
|
+
readonly status: "experimental";
|
|
2277
|
+
readonly props: {
|
|
2278
|
+
readonly label: {
|
|
2279
|
+
readonly kind: "string";
|
|
2280
|
+
readonly description: "What is being paged. Names the navigation landmark and derives the tool name, so prefer a noun phrase such as \"Users pages\".";
|
|
2281
|
+
readonly required: true;
|
|
2282
|
+
};
|
|
2283
|
+
readonly page: {
|
|
2284
|
+
readonly kind: "number";
|
|
2285
|
+
readonly description: "The 1-based page currently shown. The component is controlled; a value outside 1 to the page count is clamped into it.";
|
|
2286
|
+
readonly required: true;
|
|
2287
|
+
};
|
|
2288
|
+
readonly pageSize: {
|
|
2289
|
+
readonly kind: "number";
|
|
2290
|
+
readonly description: "How many items a full page holds. Values below 1 are treated as 1.";
|
|
2291
|
+
readonly required: true;
|
|
2292
|
+
};
|
|
2293
|
+
readonly total: {
|
|
2294
|
+
readonly kind: "number";
|
|
2295
|
+
readonly description: "How many items the whole set holds. The page count is total divided by pageSize, rounded up, and never less than 1, so an empty set is one empty page.";
|
|
2296
|
+
readonly required: true;
|
|
2297
|
+
};
|
|
2298
|
+
readonly onPageChange: {
|
|
2299
|
+
readonly kind: "handler";
|
|
2300
|
+
readonly description: "Called with the page to show. Without href the controls are buttons and the turn tool registers; with href it runs alongside the link, for routers that intercept clicks.";
|
|
2301
|
+
};
|
|
2302
|
+
readonly href: {
|
|
2303
|
+
readonly kind: "handler";
|
|
2304
|
+
readonly description: "Given a page number, returns its URL. When present, Previous and Next render as links, each publishes its URL as data-sprint-href, and no tool registers.";
|
|
2305
|
+
};
|
|
2306
|
+
readonly previousLabel: {
|
|
2307
|
+
readonly kind: "string";
|
|
2308
|
+
readonly description: "The text of the control that goes back a page.";
|
|
2309
|
+
readonly default: "Previous";
|
|
2310
|
+
};
|
|
2311
|
+
readonly nextLabel: {
|
|
2312
|
+
readonly kind: "string";
|
|
2313
|
+
readonly description: "The text of the control that goes forward a page.";
|
|
2314
|
+
readonly default: "Next";
|
|
2315
|
+
};
|
|
2316
|
+
readonly agentName: {
|
|
2317
|
+
readonly kind: "string";
|
|
2318
|
+
readonly description: "Override the label used to derive the tool name, when two paginations on a page would otherwise collide.";
|
|
2319
|
+
};
|
|
2320
|
+
readonly agentTool: {
|
|
2321
|
+
readonly kind: "boolean";
|
|
2322
|
+
readonly description: "Set false to render the controls without registering a turn tool.";
|
|
2323
|
+
readonly default: true;
|
|
2324
|
+
};
|
|
2325
|
+
};
|
|
2326
|
+
readonly state: {
|
|
2327
|
+
readonly page: {
|
|
2328
|
+
readonly description: "The 1-based page shown, after clamping.";
|
|
2329
|
+
readonly attribute: "data-sprint-page";
|
|
2330
|
+
};
|
|
2331
|
+
readonly pages: {
|
|
2332
|
+
readonly description: "How many pages the set spans. Never less than 1.";
|
|
2333
|
+
readonly attribute: "data-sprint-pages";
|
|
2334
|
+
};
|
|
2335
|
+
readonly total: {
|
|
2336
|
+
readonly description: "How many items the whole set holds.";
|
|
2337
|
+
readonly attribute: "data-sprint-total";
|
|
2338
|
+
};
|
|
2339
|
+
readonly first: {
|
|
2340
|
+
readonly description: "The 1-based position of the first item on this page, or 0 when the set is empty.";
|
|
2341
|
+
readonly attribute: "data-sprint-first";
|
|
2342
|
+
};
|
|
2343
|
+
readonly last: {
|
|
2344
|
+
readonly description: "The 1-based position of the last item on this page, or 0 when the set is empty.";
|
|
2345
|
+
readonly attribute: "data-sprint-last";
|
|
2346
|
+
};
|
|
2347
|
+
};
|
|
2348
|
+
readonly tools: {
|
|
2349
|
+
readonly turn: AgentToolSpec;
|
|
2350
|
+
};
|
|
2351
|
+
readonly agentView: {
|
|
2352
|
+
readonly example: "- **Pagination** \"Users pages\" [first=26, last=50, page=2, pages=3, total=61] → tool `turn-users-pages`\n - part `previous` \"Previous\"\n - part `next` \"Next\"";
|
|
2353
|
+
};
|
|
2354
|
+
readonly a11y: {
|
|
2355
|
+
readonly role: "navigation";
|
|
2356
|
+
readonly keyboard: readonly ["Tab reaches Previous and Next in order", "Enter or Space on a button, Enter on a link, turns the page"];
|
|
2357
|
+
readonly notes: "The root is a nav landmark named by label. A control with nowhere to go is a disabled button, or a link with no href and aria-disabled, so it leaves the tab order. The item summary is a polite live region, so a screen reader hears the new range after a turn.";
|
|
2358
|
+
};
|
|
2359
|
+
readonly relatedComponents: readonly ["Table", "List", "Nav", "Breadcrumb"];
|
|
2360
|
+
readonly examples: readonly [{
|
|
2361
|
+
readonly title: "Paging a table in place";
|
|
2362
|
+
readonly description: "With onPageChange the controls are buttons and one turn tool registers, so an agent can jump to page 3 without pressing Next twice.";
|
|
2363
|
+
readonly code: "<Pagination\n label=\"Users pages\"\n page={page}\n pageSize={25}\n total={61}\n onPageChange={setPage}\n/>";
|
|
2364
|
+
}, {
|
|
2365
|
+
readonly title: "Pages as links";
|
|
2366
|
+
readonly description: "With href every page is a URL. The controls are links, nothing registers, and each link publishes where it goes.";
|
|
2367
|
+
readonly code: "<Pagination\n label=\"Changelog pages\"\n page={2}\n pageSize={10}\n total={42}\n href={(page) => `#/changelog?page=${page}`}\n/>";
|
|
2368
|
+
}, {
|
|
2369
|
+
readonly title: "The last page, relabelled";
|
|
2370
|
+
readonly description: "On the last page Next is disabled and the summary shows the short final range. The labels are overridable for sets that read better as time.";
|
|
2371
|
+
readonly code: "<Pagination\n label=\"Activity pages\"\n page={4}\n pageSize={8}\n total={31}\n previousLabel=\"Newer\"\n nextLabel=\"Older\"\n onPageChange={setPage}\n/>";
|
|
2372
|
+
}, {
|
|
2373
|
+
readonly title: "An empty set";
|
|
2374
|
+
readonly description: "No items is one empty page. Both controls are disabled, no tool registers, and the summary still says what it is showing.";
|
|
2375
|
+
readonly code: "<Pagination\n label=\"Search results pages\"\n page={1}\n pageSize={20}\n total={0}\n onPageChange={setPage}\n/>";
|
|
2376
|
+
}];
|
|
2377
|
+
};
|
|
2378
|
+
|
|
2379
|
+
export declare interface PaginationProps extends Omit<ComponentPropsWithRef<"nav">, "children"> {
|
|
2380
|
+
label: string;
|
|
2381
|
+
page: number;
|
|
2382
|
+
pageSize: number;
|
|
2383
|
+
total: number;
|
|
2384
|
+
onPageChange?: (page: number) => void;
|
|
2385
|
+
href?: (page: number) => string;
|
|
2386
|
+
previousLabel?: string;
|
|
2387
|
+
nextLabel?: string;
|
|
2388
|
+
agentName?: string;
|
|
2389
|
+
agentTool?: boolean;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
export declare function Panel(props: PanelProps): JSX.Element;
|
|
2393
|
+
|
|
2394
|
+
declare type PanelHeadingLevel = 2 | 3 | 4;
|
|
2395
|
+
|
|
2396
|
+
export declare const panelMeta: {
|
|
2397
|
+
readonly name: "Panel";
|
|
2398
|
+
readonly category: "layout";
|
|
2399
|
+
readonly summary: "A labelled region with a header band and an optional slot for the controls that act on it. Everything on a Sprint page lives inside one.";
|
|
2400
|
+
readonly whenToUse: "Use it for every distinct region of a page: a section of documentation, a form, a readout, a preview. The label is the region's accessible name, so a person, a screen reader, and an agent all address the region by the same words.";
|
|
2401
|
+
readonly whenNotToUse: "Do not use it as a spacer or a plain box; that is Stack. Nesting reads clearly to about three deep, because each level alternates its ground and demotes its frame; past that, the depth cues repeat and the region wants a page of its own.";
|
|
2402
|
+
readonly status: "experimental";
|
|
2403
|
+
readonly props: {
|
|
2404
|
+
readonly label: {
|
|
2405
|
+
readonly kind: "string";
|
|
2406
|
+
readonly description: "What this region is. Rendered in the header band and used as the region's accessible name.";
|
|
2407
|
+
readonly required: true;
|
|
2408
|
+
};
|
|
2409
|
+
readonly children: {
|
|
2410
|
+
readonly kind: "node";
|
|
2411
|
+
readonly description: "The region's content. An empty panel says it is empty rather than collapsing.";
|
|
2412
|
+
};
|
|
2413
|
+
readonly headingLevel: {
|
|
2414
|
+
readonly kind: "enum";
|
|
2415
|
+
readonly description: "Render the label as a real heading at this outline depth, so the section is reachable when a screen reader navigates by headings. Set it on every panelled section of a page; leave it unset only for chrome such as a preview frame.";
|
|
2416
|
+
readonly values: readonly ["2", "3", "4"];
|
|
2417
|
+
};
|
|
2418
|
+
readonly actions: {
|
|
2419
|
+
readonly kind: "node";
|
|
2420
|
+
readonly description: "Controls that act on this region, rendered at the end of the header band. Keep it to one or two.";
|
|
2421
|
+
};
|
|
2422
|
+
readonly flush: {
|
|
2423
|
+
readonly kind: "boolean";
|
|
2424
|
+
readonly description: "Drop the body padding, for content that draws its own edges such as a Table or a CodeBlock.";
|
|
2425
|
+
readonly default: false;
|
|
2426
|
+
};
|
|
2427
|
+
readonly emptyLabel: {
|
|
2428
|
+
readonly kind: "string";
|
|
2429
|
+
readonly description: "What the panel says when it has no content.";
|
|
2430
|
+
readonly default: "Empty";
|
|
2431
|
+
};
|
|
2432
|
+
readonly loading: {
|
|
2433
|
+
readonly kind: "boolean";
|
|
2434
|
+
readonly description: "Set while the content are being fetched. Sets aria-busy and sweeps a bar along the top edge. Existing content stay visible; with none yet, the empty slot says loadingLabel instead of emptyLabel.";
|
|
2435
|
+
readonly default: false;
|
|
2436
|
+
};
|
|
2437
|
+
readonly loadingLabel: {
|
|
2438
|
+
readonly kind: "string";
|
|
2439
|
+
readonly description: "What the empty slot says while loading.";
|
|
2440
|
+
readonly default: "Loading";
|
|
2441
|
+
};
|
|
2442
|
+
};
|
|
2443
|
+
readonly state: {
|
|
2444
|
+
readonly flush: {
|
|
2445
|
+
readonly description: "Present when the body carries no padding of its own.";
|
|
2446
|
+
readonly attribute: "data-sprint-flush";
|
|
2447
|
+
};
|
|
2448
|
+
readonly empty: {
|
|
2449
|
+
readonly description: "Present when the panel has no content. The panel still renders its keyline and says it is empty.";
|
|
2450
|
+
readonly attribute: "data-sprint-empty";
|
|
2451
|
+
};
|
|
2452
|
+
readonly loading: {
|
|
2453
|
+
readonly description: "Present while the content are being fetched. Alongside empty it means nothing has arrived yet, not that there is nothing.";
|
|
2454
|
+
readonly attribute: "data-sprint-loading";
|
|
2455
|
+
};
|
|
2456
|
+
};
|
|
2457
|
+
readonly agentView: {
|
|
2458
|
+
readonly example: "- **Panel** \"WebMCP tools\"";
|
|
2459
|
+
};
|
|
2460
|
+
readonly a11y: {
|
|
2461
|
+
readonly role: "region";
|
|
2462
|
+
readonly notes: "The section is a named landmark either way: the label is its accessible name. With headingLevel the label is also a heading element, so the page outline includes the region; without it the region is reachable only by landmark navigation.";
|
|
2463
|
+
};
|
|
2464
|
+
readonly examples: readonly [{
|
|
2465
|
+
readonly title: "A section of a page";
|
|
2466
|
+
readonly description: "headingLevel puts the label in the page outline, so a screen reader finds the section by heading as well as by landmark.";
|
|
2467
|
+
readonly code: "<Panel label=\"When to use\" headingLevel={2}>\n <Text>Use it for any discrete action.</Text>\n</Panel>";
|
|
2468
|
+
}, {
|
|
2469
|
+
readonly title: "A panel with a control in its header";
|
|
2470
|
+
readonly description: "The header slot is for controls that act on the region, not for navigation.";
|
|
2471
|
+
readonly code: "<Panel\n label=\"Preview\"\n actions={<Button agentName=\"Reset preview\">Reset</Button>}\n>\n <Button tone=\"action\">Prepare launch</Button>\n</Panel>";
|
|
2472
|
+
}, {
|
|
2473
|
+
readonly title: "A flush panel around a table";
|
|
2474
|
+
readonly description: "Content that draws its own keylines sits flush, so borders do not double up.";
|
|
2475
|
+
readonly code: "<Panel label=\"Conventions\" flush>\n <Table label=\"Conventions\" columns={columns} rows={rows} />\n</Panel>";
|
|
2476
|
+
}, {
|
|
2477
|
+
readonly title: "Nested panels";
|
|
2478
|
+
readonly description: "Depth styles itself: the outermost panel carries a doubled keyline, each nested level alternates its ground, and nested headers demote to a dashed rule, so a reader ranks the levels without counting borders.";
|
|
2479
|
+
readonly code: "<Panel label=\"The shape\" headingLevel={2}>\n <Panel label=\"Human view\" headingLevel={3}>\n <Panel label=\"Crew\" headingLevel={4}>\n <Text>Registration fields live here.</Text>\n </Panel>\n </Panel>\n</Panel>";
|
|
2480
|
+
}, {
|
|
2481
|
+
readonly title: "An empty region";
|
|
2482
|
+
readonly description: "An empty panel keeps its border and states that it is empty, rather than vanishing and leaving a person or an agent unsure whether it failed to load.";
|
|
2483
|
+
readonly code: "<Panel label=\"Registered tools\" emptyLabel=\"No tools registered\" />";
|
|
2484
|
+
}];
|
|
2485
|
+
};
|
|
2486
|
+
|
|
2487
|
+
export declare interface PanelProps extends ComponentPropsWithRef<"section"> {
|
|
2488
|
+
label: string;
|
|
2489
|
+
headingLevel?: PanelHeadingLevel;
|
|
2490
|
+
actions?: ReactNode;
|
|
2491
|
+
flush?: boolean;
|
|
2492
|
+
emptyLabel?: string;
|
|
2493
|
+
loading?: boolean;
|
|
2494
|
+
loadingLabel?: string;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
export declare const PARAM_DESCRIPTION_LIMIT = 150;
|
|
2498
|
+
|
|
2499
|
+
export declare const PART_ATTRIBUTE = "data-sprint-part";
|
|
2500
|
+
|
|
2501
|
+
export declare function Pending(props: PendingProps): JSX.Element;
|
|
2502
|
+
|
|
2503
|
+
export declare const pendingMeta: {
|
|
2504
|
+
readonly name: "Pending";
|
|
2505
|
+
readonly category: "feedback";
|
|
2506
|
+
readonly summary: "Marks a region whose data is being fetched. Keeps stale content visible and readable while it refreshes, and holds a labelled pending field when there is nothing to show yet.";
|
|
2507
|
+
readonly whenToUse: "Wrap a region you build yourself while its data loads: a profile card, a chart, a custom summary. Pass the children only once data exists, so the first load shows the pending field and a refetch keeps the old content under a busy bar. Table, List, DescriptionList and Panel take a loading prop of their own, so reach for that first.";
|
|
2508
|
+
readonly whenNotToUse: "Do not wrap a Table, List, DescriptionList or Panel; use its loading prop, which keeps the region's own label and frame. Do not use for a long job with a countable amount of work; that is a Progress. Do not use for a busy action; that is Button's loading prop.";
|
|
2509
|
+
readonly status: "experimental";
|
|
2510
|
+
readonly props: {
|
|
2511
|
+
readonly loading: {
|
|
2512
|
+
readonly kind: "boolean";
|
|
2513
|
+
readonly description: "Whether the region's data is being fetched. While false the wrapper adds nothing to the agent view.";
|
|
2514
|
+
readonly required: true;
|
|
2515
|
+
};
|
|
2516
|
+
readonly label: {
|
|
2517
|
+
readonly kind: "string";
|
|
2518
|
+
readonly description: "What is loading, as a phrase a person can read in the empty field, such as \"Loading profile\".";
|
|
2519
|
+
readonly required: true;
|
|
2520
|
+
};
|
|
2521
|
+
readonly children: {
|
|
2522
|
+
readonly kind: "node";
|
|
2523
|
+
readonly description: "The region's content. Omit it until data exists; while loading with children they stay visible as stale content.";
|
|
2524
|
+
};
|
|
2525
|
+
};
|
|
2526
|
+
readonly state: {
|
|
2527
|
+
readonly loading: {
|
|
2528
|
+
readonly description: "Present while the region's data is being fetched.";
|
|
2529
|
+
readonly attribute: "data-sprint-loading";
|
|
2530
|
+
};
|
|
2531
|
+
readonly empty: {
|
|
2532
|
+
readonly description: "Present while loading with no content yet, so nothing on screen is data.";
|
|
2533
|
+
readonly attribute: "data-sprint-empty";
|
|
2534
|
+
};
|
|
2535
|
+
};
|
|
2536
|
+
readonly agentView: {
|
|
2537
|
+
readonly example: "- **Pending** \"Loading profile\" [empty, loading]";
|
|
2538
|
+
};
|
|
2539
|
+
readonly examples: readonly [{
|
|
2540
|
+
readonly title: "First load";
|
|
2541
|
+
readonly description: "No data yet, so the region holds a labelled pending field.";
|
|
2542
|
+
readonly code: "<Pending loading={isLoading} label=\"Loading profile\">\n {profile && <ProfileSummary profile={profile} />}\n</Pending>";
|
|
2543
|
+
}, {
|
|
2544
|
+
readonly title: "Refetching stale content";
|
|
2545
|
+
readonly description: "Content already on screen stays readable under a busy bar, and an agent reads it nested under a loading line.";
|
|
2546
|
+
readonly code: "<Pending loading={isFetching} label=\"Refreshing pilot\">\n <Stack gap=\"tight\">\n <Heading level={3}>{pilot.callsign}</Heading>\n <Text tone=\"muted\">{pilot.status}</Text>\n </Stack>\n</Pending>";
|
|
2547
|
+
}];
|
|
2548
|
+
readonly a11y: {
|
|
2549
|
+
readonly role: "group";
|
|
2550
|
+
readonly notes: "While loading the wrapper is a group named by its label with aria-busy set, so assistive technology knows the content may change. Idle, it is a plain element with no role.";
|
|
2551
|
+
};
|
|
2552
|
+
};
|
|
2553
|
+
|
|
2554
|
+
export declare interface PendingProps extends ComponentPropsWithRef<"div"> {
|
|
2555
|
+
loading: boolean;
|
|
2556
|
+
label: string;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
export declare const PRESS_TOOL: AgentToolSpec;
|
|
2560
|
+
|
|
2561
|
+
export declare function Progress(props: ProgressProps): JSX.Element;
|
|
2562
|
+
|
|
2563
|
+
export declare const progressMeta: {
|
|
2564
|
+
readonly name: "Progress";
|
|
2565
|
+
readonly category: "feedback";
|
|
2566
|
+
readonly summary: "A labelled loading indicator for work in progress. Indeterminate by default; pass value for a known fraction complete.";
|
|
2567
|
+
readonly whenToUse: "Use while something the person is waiting on is still running: a page section fetching, an upload, an import, a long job. Omit value when the remaining work is unknown, and pass value with max when it can be counted. Keep the label a stable noun phrase for what is loading, not a percentage.";
|
|
2568
|
+
readonly whenNotToUse: "Do not use for a busy action; Button's loading prop already marks the button itself. Do not use for the outcome of work that finished or failed; that is an Alert. Do not use for a quantity that is not progress, such as disk usage.";
|
|
2569
|
+
readonly status: "experimental";
|
|
2570
|
+
readonly props: {
|
|
2571
|
+
readonly label: {
|
|
2572
|
+
readonly kind: "string";
|
|
2573
|
+
readonly description: "What is loading, such as \"Importing manifest\". It is the indicator's accessible name and its agent label.";
|
|
2574
|
+
readonly required: true;
|
|
2575
|
+
};
|
|
2576
|
+
readonly value: {
|
|
2577
|
+
readonly kind: "number";
|
|
2578
|
+
readonly description: "Work completed so far, in the same units as max. Omit for an indeterminate indicator. Clamped to the range 0 to max.";
|
|
2579
|
+
};
|
|
2580
|
+
readonly max: {
|
|
2581
|
+
readonly kind: "number";
|
|
2582
|
+
readonly description: "The value at which the work is complete.";
|
|
2583
|
+
readonly default: 100;
|
|
2584
|
+
};
|
|
2585
|
+
};
|
|
2586
|
+
readonly state: {
|
|
2587
|
+
readonly loading: {
|
|
2588
|
+
readonly description: "Present until the work completes. An indeterminate indicator is always loading.";
|
|
2589
|
+
readonly attribute: "data-sprint-loading";
|
|
2590
|
+
};
|
|
2591
|
+
readonly value: {
|
|
2592
|
+
readonly description: "The fraction complete as a whole percentage, such as 40%. Absent while indeterminate.";
|
|
2593
|
+
readonly attribute: "data-sprint-value";
|
|
2594
|
+
};
|
|
2595
|
+
};
|
|
2596
|
+
readonly agentView: {
|
|
2597
|
+
readonly example: "- **Progress** \"Importing manifest\" [loading, value=40%]";
|
|
2598
|
+
};
|
|
1348
2599
|
readonly examples: readonly [{
|
|
1349
|
-
readonly title: "
|
|
1350
|
-
readonly
|
|
2600
|
+
readonly title: "Indeterminate load";
|
|
2601
|
+
readonly description: "Nothing to count yet, so the indicator only says that work is running.";
|
|
2602
|
+
readonly code: "<Progress label=\"Loading flight plan\" />";
|
|
1351
2603
|
}, {
|
|
1352
|
-
readonly title: "
|
|
1353
|
-
readonly description: "
|
|
1354
|
-
readonly code: "<
|
|
2604
|
+
readonly title: "Counted progress";
|
|
2605
|
+
readonly description: "With value and max the agent reads a percentage instead of guessing.";
|
|
2606
|
+
readonly code: "<Progress label=\"Importing manifest\" value={imported} max={total} />";
|
|
2607
|
+
}, {
|
|
2608
|
+
readonly title: "Complete";
|
|
2609
|
+
readonly description: "At max the loading state clears, so the line reads as finished rather than stalled.";
|
|
2610
|
+
readonly code: "<Progress label=\"Importing manifest\" value={240} max={240} />";
|
|
1355
2611
|
}];
|
|
2612
|
+
readonly a11y: {
|
|
2613
|
+
readonly role: "progressbar";
|
|
2614
|
+
readonly notes: "Renders a native progress element named by the visible label. Omitting value leaves it indeterminate, which assistive technology announces as busy. The percentage readout is hidden from assistive technology because the progressbar already carries its value.";
|
|
2615
|
+
};
|
|
1356
2616
|
};
|
|
1357
2617
|
|
|
1358
|
-
export declare interface
|
|
2618
|
+
export declare interface ProgressProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
1359
2619
|
label: string;
|
|
1360
|
-
|
|
1361
|
-
|
|
2620
|
+
value?: number;
|
|
2621
|
+
max?: number;
|
|
1362
2622
|
}
|
|
1363
2623
|
|
|
1364
|
-
export declare function
|
|
2624
|
+
export declare function reactText(node: ReactNode): string | undefined;
|
|
1365
2625
|
|
|
1366
|
-
export declare
|
|
2626
|
+
export declare const REGION_ATTRIBUTE = "data-sprint-region";
|
|
1367
2627
|
|
|
1368
|
-
declare
|
|
2628
|
+
export declare function registerTool(descriptor: ToolDescriptor, signal: AbortSignal): boolean;
|
|
1369
2629
|
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
readonly
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
2630
|
+
declare interface RegisterToolOptions {
|
|
2631
|
+
signal?: AbortSignal;
|
|
2632
|
+
exposedTo?: readonly string[];
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
export declare const RESERVED_STATE_KEYS: readonly string[];
|
|
2636
|
+
|
|
2637
|
+
export declare const SEARCH_TOOL: AgentToolSpec;
|
|
2638
|
+
|
|
2639
|
+
export declare function SearchField(props: SearchFieldProps): JSX.Element;
|
|
2640
|
+
|
|
2641
|
+
export declare const searchFieldMeta: {
|
|
2642
|
+
readonly name: "SearchField";
|
|
2643
|
+
readonly category: "input";
|
|
2644
|
+
readonly summary: "A search box inside its own search landmark: a labelled query field with a clear control, Escape to clear, Enter to submit, and an optional page-wide key that focuses it. It registers one search tool that sets the query and submits it.";
|
|
2645
|
+
readonly whenToUse: "Use it to filter or search a collection on the page, such as narrowing a users list by name. The landmark lets screen reader users jump straight to it, and the optional shortcut gives keyboard users the familiar slash-to-search.";
|
|
2646
|
+
readonly whenNotToUse: "Do not use it for any other single-line value; a name, an email address, or an identifier is a TextInput. Do not use it to choose from a short known set, which is a Select or a SegmentedControl. Do not give two fields on one page the same shortcut.";
|
|
1376
2647
|
readonly status: "experimental";
|
|
1377
2648
|
readonly props: {
|
|
1378
2649
|
readonly label: {
|
|
1379
2650
|
readonly kind: "string";
|
|
1380
|
-
readonly description: "What
|
|
2651
|
+
readonly description: "What is being searched, as a noun phrase such as \"Users\". Names the landmark and the field, and derives the tool name, so \"Users\" becomes search-users.";
|
|
1381
2652
|
readonly required: true;
|
|
1382
2653
|
};
|
|
1383
|
-
readonly
|
|
1384
|
-
readonly kind: "
|
|
1385
|
-
readonly description: "The
|
|
2654
|
+
readonly value: {
|
|
2655
|
+
readonly kind: "string";
|
|
2656
|
+
readonly description: "The current query. The field is fully controlled.";
|
|
2657
|
+
readonly required: true;
|
|
1386
2658
|
};
|
|
1387
|
-
readonly
|
|
1388
|
-
readonly kind: "
|
|
1389
|
-
readonly description: "
|
|
1390
|
-
readonly
|
|
2659
|
+
readonly onChange: {
|
|
2660
|
+
readonly kind: "handler";
|
|
2661
|
+
readonly description: "Called with the new query on every change, including the clear control, Escape, and the search tool.";
|
|
2662
|
+
readonly required: true;
|
|
1391
2663
|
};
|
|
1392
|
-
readonly
|
|
1393
|
-
readonly kind: "
|
|
1394
|
-
readonly description: "
|
|
2664
|
+
readonly onSubmit: {
|
|
2665
|
+
readonly kind: "handler";
|
|
2666
|
+
readonly description: "Called with the query when Enter is pressed or the search tool runs. Leave it off for a live filter that reacts to onChange alone.";
|
|
1395
2667
|
};
|
|
1396
|
-
readonly
|
|
2668
|
+
readonly placeholder: {
|
|
2669
|
+
readonly kind: "string";
|
|
2670
|
+
readonly description: "Ghost text shown while the field is empty, e.g. \"Name or email\".";
|
|
2671
|
+
};
|
|
2672
|
+
readonly hideLabel: {
|
|
1397
2673
|
readonly kind: "boolean";
|
|
1398
|
-
readonly description: "
|
|
2674
|
+
readonly description: "Hide the label visually while keeping it for screen readers and agents. Pair it with a placeholder so sighted people still know what the field searches.";
|
|
1399
2675
|
readonly default: false;
|
|
1400
2676
|
};
|
|
1401
|
-
readonly
|
|
2677
|
+
readonly shortcut: {
|
|
1402
2678
|
readonly kind: "string";
|
|
1403
|
-
readonly description: "
|
|
1404
|
-
|
|
2679
|
+
readonly description: "A single key that focuses the field from anywhere on the page, shown as a key chip while the field is empty and unfocused. Ignored while focus is in another editable element or a modifier is held. Pass \"/\" for the common convention; omit or pass false for none.";
|
|
2680
|
+
};
|
|
2681
|
+
readonly name: {
|
|
2682
|
+
readonly kind: "string";
|
|
2683
|
+
readonly description: "The native form name of the query input.";
|
|
2684
|
+
};
|
|
2685
|
+
readonly disabled: {
|
|
2686
|
+
readonly kind: "boolean";
|
|
2687
|
+
readonly description: "Disable the field, its shortcut, and its search tool.";
|
|
2688
|
+
readonly default: false;
|
|
2689
|
+
};
|
|
2690
|
+
readonly agentName: {
|
|
2691
|
+
readonly kind: "string";
|
|
2692
|
+
readonly description: "Override the label used to derive the tool name, when two search fields on a page would otherwise collide.";
|
|
2693
|
+
};
|
|
2694
|
+
readonly agentTool: {
|
|
2695
|
+
readonly kind: "boolean";
|
|
2696
|
+
readonly description: "Set false to render the field without registering a search tool.";
|
|
2697
|
+
readonly default: true;
|
|
1405
2698
|
};
|
|
1406
2699
|
};
|
|
1407
2700
|
readonly state: {
|
|
1408
|
-
readonly
|
|
1409
|
-
readonly description: "
|
|
1410
|
-
readonly attribute: "data-sprint-
|
|
2701
|
+
readonly value: {
|
|
2702
|
+
readonly description: "The current query, absent while the field is empty.";
|
|
2703
|
+
readonly attribute: "data-sprint-value";
|
|
1411
2704
|
};
|
|
1412
2705
|
readonly empty: {
|
|
1413
|
-
readonly description: "Present
|
|
2706
|
+
readonly description: "Present while the field holds no query.";
|
|
1414
2707
|
readonly attribute: "data-sprint-empty";
|
|
1415
2708
|
};
|
|
2709
|
+
readonly shortcut: {
|
|
2710
|
+
readonly description: "The key that focuses the field from anywhere on the page.";
|
|
2711
|
+
readonly attribute: "data-sprint-shortcut";
|
|
2712
|
+
};
|
|
2713
|
+
readonly disabled: {
|
|
2714
|
+
readonly description: "Present when the field cannot be edited.";
|
|
2715
|
+
readonly attribute: "data-sprint-disabled";
|
|
2716
|
+
};
|
|
1416
2717
|
};
|
|
1417
|
-
readonly
|
|
1418
|
-
readonly
|
|
2718
|
+
readonly tools: {
|
|
2719
|
+
readonly search: AgentToolSpec;
|
|
1419
2720
|
};
|
|
1420
|
-
readonly
|
|
1421
|
-
readonly
|
|
1422
|
-
readonly notes: "The section is a named landmark either way: the label is its accessible name. With headingLevel the label is also a heading element, so the page outline includes the region; without it the region is reachable only by landmark navigation.";
|
|
2721
|
+
readonly agentView: {
|
|
2722
|
+
readonly example: "- **SearchField** \"Users\" [empty, shortcut=/] → tool `search-users`";
|
|
1423
2723
|
};
|
|
1424
2724
|
readonly examples: readonly [{
|
|
1425
|
-
readonly title: "
|
|
1426
|
-
readonly description: "
|
|
1427
|
-
readonly code: "<
|
|
2725
|
+
readonly title: "Filtering a list";
|
|
2726
|
+
readonly description: "A live filter: onChange narrows the list as the person types, so there is no onSubmit. The label is hidden and the placeholder says what can be matched.";
|
|
2727
|
+
readonly code: "<SearchField\n label=\"Users\"\n hideLabel\n value={query}\n onChange={setQuery}\n placeholder=\"Name or email\"\n/>";
|
|
1428
2728
|
}, {
|
|
1429
|
-
readonly title: "A
|
|
1430
|
-
readonly description: "
|
|
1431
|
-
readonly code: "<
|
|
1432
|
-
}, {
|
|
1433
|
-
readonly title: "A flush panel around a table";
|
|
1434
|
-
readonly description: "Content that draws its own keylines sits flush, so borders do not double up.";
|
|
1435
|
-
readonly code: "<Panel label=\"Conventions\" flush>\n <Table label=\"Conventions\" columns={columns} rows={rows} />\n</Panel>";
|
|
1436
|
-
}, {
|
|
1437
|
-
readonly title: "Nested panels";
|
|
1438
|
-
readonly description: "Depth styles itself: the outermost panel carries a doubled keyline, each nested level alternates its ground, and nested headers demote to a dashed rule, so a reader ranks the levels without counting borders.";
|
|
1439
|
-
readonly code: "<Panel label=\"The shape\" headingLevel={2}>\n <Panel label=\"Human view\" headingLevel={3}>\n <Panel label=\"Crew\" headingLevel={4}>\n <Text>Registration fields live here.</Text>\n </Panel>\n </Panel>\n</Panel>";
|
|
2729
|
+
readonly title: "A slash shortcut";
|
|
2730
|
+
readonly description: "Pressing / anywhere on the page focuses the field unless focus is already in something editable. The key chip disappears once the field has focus or a query.";
|
|
2731
|
+
readonly code: "<SearchField\n label=\"Users\"\n value={query}\n onChange={setQuery}\n shortcut=\"/\"\n placeholder=\"Name or email\"\n/>";
|
|
1440
2732
|
}, {
|
|
1441
|
-
readonly title: "
|
|
1442
|
-
readonly description: "
|
|
1443
|
-
readonly code: "<
|
|
2733
|
+
readonly title: "Submitting a query";
|
|
2734
|
+
readonly description: "For a search that is too costly to run on every keystroke, onSubmit receives the query on Enter and when the search tool runs.";
|
|
2735
|
+
readonly code: "<SearchField\n label=\"Flight logs\"\n value={query}\n onChange={setQuery}\n onSubmit={runSearch}\n placeholder=\"Callsign or tail number\"\n/>";
|
|
1444
2736
|
}];
|
|
2737
|
+
readonly a11y: {
|
|
2738
|
+
readonly role: "search";
|
|
2739
|
+
readonly keyboard: readonly ["Enter submits the query", "Escape clears a non-empty query and keeps focus; on an empty field it passes through, so an enclosing dialog can close", "The shortcut key, when set, focuses the field from anywhere on the page"];
|
|
2740
|
+
readonly notes: "The root is a form with role search, labelled by the field's label, so it is listed as a search landmark. The input is type search and announces its shortcut with aria-keyshortcuts; the key chip itself is hidden from assistive technology. The clear control appears only while there is a query, and returns focus to the field.";
|
|
2741
|
+
};
|
|
2742
|
+
readonly relatedComponents: readonly ["TextInput"];
|
|
1445
2743
|
};
|
|
1446
2744
|
|
|
1447
|
-
export declare interface
|
|
2745
|
+
export declare interface SearchFieldProps extends Omit<ComponentPropsWithRef<"form">, "onChange" | "onSubmit"> {
|
|
1448
2746
|
label: string;
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
export declare const PRESS_TOOL: AgentToolSpec;
|
|
1460
|
-
|
|
1461
|
-
export declare function reactText(node: ReactNode): string | undefined;
|
|
1462
|
-
|
|
1463
|
-
export declare const REGION_ATTRIBUTE = "data-sprint-region";
|
|
1464
|
-
|
|
1465
|
-
export declare function registerTool(descriptor: ToolDescriptor, signal: AbortSignal): boolean;
|
|
1466
|
-
|
|
1467
|
-
declare interface RegisterToolOptions {
|
|
1468
|
-
signal?: AbortSignal;
|
|
1469
|
-
exposedTo?: readonly string[];
|
|
2747
|
+
value: string;
|
|
2748
|
+
onChange: (value: string) => void;
|
|
2749
|
+
onSubmit?: (value: string) => void;
|
|
2750
|
+
placeholder?: string;
|
|
2751
|
+
hideLabel?: boolean;
|
|
2752
|
+
shortcut?: string | false;
|
|
2753
|
+
name?: string;
|
|
2754
|
+
disabled?: boolean;
|
|
2755
|
+
agentName?: string;
|
|
2756
|
+
agentTool?: boolean;
|
|
1470
2757
|
}
|
|
1471
2758
|
|
|
1472
|
-
export declare const RESERVED_STATE_KEYS: readonly string[];
|
|
1473
|
-
|
|
1474
2759
|
export declare function SecretField(props: SecretFieldProps): JSX.Element;
|
|
1475
2760
|
|
|
1476
2761
|
export declare const secretFieldMeta: {
|
|
@@ -1551,7 +2836,7 @@ export declare const segmentedControlMeta: {
|
|
|
1551
2836
|
};
|
|
1552
2837
|
readonly options: {
|
|
1553
2838
|
readonly kind: "array";
|
|
1554
|
-
readonly description: "The choices in display order: { value, label }. The label is what a person sees and what the select tool accepts, so an agent never has to know the value.";
|
|
2839
|
+
readonly description: "The choices in display order: { value, label, count? }. The label is what a person sees and what the select tool accepts, so an agent never has to know the value. count renders as a muted chip beside the label and reaches the agent view as part state, so never fold a count into the label.";
|
|
1555
2840
|
readonly required: true;
|
|
1556
2841
|
};
|
|
1557
2842
|
readonly value: {
|
|
@@ -1564,6 +2849,19 @@ export declare const segmentedControlMeta: {
|
|
|
1564
2849
|
readonly description: "Called with the newly selected value. The select tool drives a real click, so this runs for agent selections too.";
|
|
1565
2850
|
readonly required: true;
|
|
1566
2851
|
};
|
|
2852
|
+
readonly savedValue: {
|
|
2853
|
+
readonly kind: "string";
|
|
2854
|
+
readonly description: "The value currently in effect, for a control that stages a change until something confirms it. While it differs from value the saved option keeps a marker and the control reports itself dirty, so both the saved and the proposed choice stay readable.";
|
|
2855
|
+
};
|
|
2856
|
+
readonly hint: {
|
|
2857
|
+
readonly kind: "string";
|
|
2858
|
+
readonly description: "Guidance shown under the options, linked with aria-describedby and carried into the agent view. Say what a staged change does, such as when it takes effect.";
|
|
2859
|
+
};
|
|
2860
|
+
readonly block: {
|
|
2861
|
+
readonly kind: "boolean";
|
|
2862
|
+
readonly description: "Fill the container's width, with every option taking an equal share. Without it the control stays as wide as its options, even inside a stretching column.";
|
|
2863
|
+
readonly default: false;
|
|
2864
|
+
};
|
|
1567
2865
|
readonly disabled: {
|
|
1568
2866
|
readonly kind: "boolean";
|
|
1569
2867
|
readonly description: "Disable every option and unregister the select tool.";
|
|
@@ -1584,6 +2882,14 @@ export declare const segmentedControlMeta: {
|
|
|
1584
2882
|
readonly description: "The value of the option currently selected.";
|
|
1585
2883
|
readonly attribute: "data-sprint-value";
|
|
1586
2884
|
};
|
|
2885
|
+
readonly dirty: {
|
|
2886
|
+
readonly description: "Present while savedValue is set and differs from value. The saved option carries data-sprint-saved.";
|
|
2887
|
+
readonly attribute: "data-sprint-dirty";
|
|
2888
|
+
};
|
|
2889
|
+
readonly block: {
|
|
2890
|
+
readonly description: "Present when the control fills its container.";
|
|
2891
|
+
readonly attribute: "data-sprint-block";
|
|
2892
|
+
};
|
|
1587
2893
|
readonly disabled: {
|
|
1588
2894
|
readonly description: "Present when no option can be chosen.";
|
|
1589
2895
|
readonly attribute: "data-sprint-disabled";
|
|
@@ -1593,12 +2899,24 @@ export declare const segmentedControlMeta: {
|
|
|
1593
2899
|
readonly select: AgentToolSpec;
|
|
1594
2900
|
};
|
|
1595
2901
|
readonly agentView: {
|
|
1596
|
-
readonly example: "- **SegmentedControl** \"
|
|
2902
|
+
readonly example: "- **SegmentedControl** \"Access\" [dirty, value=write] → tool `select-access`\n - part `option` \"Read\" [count=17, saved]\n - part `option` \"Write\" [checked, count=4]\n - part `hint` \"Currently Read. Nothing changes until you confirm.\"";
|
|
1597
2903
|
};
|
|
1598
2904
|
readonly examples: readonly [{
|
|
1599
2905
|
readonly title: "A view switch";
|
|
1600
2906
|
readonly description: "In agent view each option renders as its own control, so an agent driving the DOM can click one without WebMCP.";
|
|
1601
2907
|
readonly code: "<SegmentedControl\n label=\"Page view\"\n value={view}\n onChange={setView}\n options={[\n { value: \"human\", label: \"human\" },\n { value: \"agent\", label: \"agent\" },\n ]}\n/>";
|
|
2908
|
+
}, {
|
|
2909
|
+
readonly title: "Options with counts";
|
|
2910
|
+
readonly description: "A count is data, not label text: it renders as a chip, joins the accessible name, and reaches agents as part state while the select tool still takes the plain label.";
|
|
2911
|
+
readonly code: "<SegmentedControl\n label=\"Members\"\n value={filter}\n onChange={setFilter}\n options={[\n { value: \"all\", label: \"All\", count: 48 },\n { value: \"active\", label: \"Active\", count: 18 },\n { value: \"never\", label: \"Never signed in\", count: 30 },\n ]}\n/>";
|
|
2912
|
+
}, {
|
|
2913
|
+
readonly title: "A staged change";
|
|
2914
|
+
readonly description: "savedValue keeps the value in effect visible while another is selected, and hint says what confirming will do. The control reports itself dirty until the two agree.";
|
|
2915
|
+
readonly code: "<SegmentedControl\n label=\"Access\"\n value={access}\n savedValue=\"read\"\n onChange={setAccess}\n hint=\"Currently Read. Nothing changes until you confirm.\"\n options={[\n { value: \"read\", label: \"Read\" },\n { value: \"write\", label: \"Write\" },\n { value: \"admin\", label: \"Admin\" },\n ]}\n/>";
|
|
2916
|
+
}, {
|
|
2917
|
+
readonly title: "A full-width control";
|
|
2918
|
+
readonly description: "block fills the container and shares the width equally between options. Without it the control keeps its own width inside a stretching Stack.";
|
|
2919
|
+
readonly code: "<SegmentedControl\n label=\"Range\"\n block\n value={range}\n onChange={setRange}\n options={[\n { value: \"day\", label: \"Day\" },\n { value: \"week\", label: \"Week\" },\n { value: \"month\", label: \"Month\" },\n ]}\n/>";
|
|
1602
2920
|
}, {
|
|
1603
2921
|
readonly title: "A disabled control";
|
|
1604
2922
|
readonly description: "Disabled unregisters the tool, so an agent cannot select an option a person could not.";
|
|
@@ -1607,7 +2925,7 @@ export declare const segmentedControlMeta: {
|
|
|
1607
2925
|
readonly a11y: {
|
|
1608
2926
|
readonly role: "radiogroup";
|
|
1609
2927
|
readonly keyboard: readonly ["Arrow keys move to the next or previous option and select it", "Home selects the first option", "End selects the last option", "Tab enters and leaves the group once"];
|
|
1610
|
-
readonly notes: "Roving tabindex: only the selected option is in the tab order. Selection follows focus, which is the expected behaviour for a radio group.";
|
|
2928
|
+
readonly notes: "Roving tabindex: only the selected option is in the tab order. Selection follows focus, which is the expected behaviour for a radio group. An option with a count is named by its label and its count together; the hint is linked to the group with aria-describedby.";
|
|
1611
2929
|
};
|
|
1612
2930
|
};
|
|
1613
2931
|
|
|
@@ -1616,6 +2934,9 @@ export declare interface SegmentedControlProps extends Omit<ComponentPropsWithRe
|
|
|
1616
2934
|
options: readonly SegmentedOption[];
|
|
1617
2935
|
value: string;
|
|
1618
2936
|
onChange: (value: string) => void;
|
|
2937
|
+
savedValue?: string;
|
|
2938
|
+
hint?: string;
|
|
2939
|
+
block?: boolean;
|
|
1619
2940
|
disabled?: boolean;
|
|
1620
2941
|
agentName?: string;
|
|
1621
2942
|
agentTool?: boolean;
|
|
@@ -1624,6 +2945,7 @@ export declare interface SegmentedControlProps extends Omit<ComponentPropsWithRe
|
|
|
1624
2945
|
export declare interface SegmentedOption {
|
|
1625
2946
|
value: string;
|
|
1626
2947
|
label: string;
|
|
2948
|
+
count?: number;
|
|
1627
2949
|
}
|
|
1628
2950
|
|
|
1629
2951
|
export declare function Select(props: SelectProps): JSX.Element;
|
|
@@ -1635,7 +2957,7 @@ export declare const SELECT_TOOL: AgentToolSpec;
|
|
|
1635
2957
|
export declare const selectMeta: {
|
|
1636
2958
|
readonly name: "Select";
|
|
1637
2959
|
readonly category: "input";
|
|
1638
|
-
readonly summary: "A dropdown of mutually exclusive options
|
|
2960
|
+
readonly summary: "A dropdown of mutually exclusive options: a select-only combobox that opens a listbox on click or keyboard, carrying its own label, hint, and error. It registers a single select tool whose schema enumerates the option labels currently on offer.";
|
|
1639
2961
|
readonly whenToUse: "Use it when one value is chosen from a list too long to lay out flat: a region, a squad, a category. Options are data ({ value, label }), the tool accepts the visible label, and in agent view every option renders as its own control, so an agent picks one without opening anything.";
|
|
1640
2962
|
readonly whenNotToUse: "Do not use it for two to four short options a person should compare at a glance; that is a SegmentedControl. Do not use it for an on/off state, which is a Checkbox or a Switch, and never for navigation.";
|
|
1641
2963
|
readonly status: "experimental";
|
|
@@ -1647,7 +2969,7 @@ export declare const selectMeta: {
|
|
|
1647
2969
|
};
|
|
1648
2970
|
readonly options: {
|
|
1649
2971
|
readonly kind: "array";
|
|
1650
|
-
readonly description: "The choices in display order: { value, label }. The label is what a person sees and what the select tool accepts, so an agent never has to know the value.";
|
|
2972
|
+
readonly description: "The choices in display order: { value, label, count? }. The label is what a person sees and what the select tool accepts, so an agent never has to know the value. count renders as a muted chip beside the label and reaches the agent view as part state, so never fold a count into the label.";
|
|
1651
2973
|
readonly required: true;
|
|
1652
2974
|
};
|
|
1653
2975
|
readonly value: {
|
|
@@ -1657,12 +2979,12 @@ export declare const selectMeta: {
|
|
|
1657
2979
|
};
|
|
1658
2980
|
readonly onChange: {
|
|
1659
2981
|
readonly kind: "handler";
|
|
1660
|
-
readonly description: "Called with the newly chosen value. The select tool
|
|
2982
|
+
readonly description: "Called with the newly chosen value. The select tool clicks the real option, so this runs for agent selections too.";
|
|
1661
2983
|
readonly required: true;
|
|
1662
2984
|
};
|
|
1663
2985
|
readonly placeholder: {
|
|
1664
2986
|
readonly kind: "string";
|
|
1665
|
-
readonly description: "Shown while value is \"\".
|
|
2987
|
+
readonly description: "Shown in the closed control while value is \"\". It is not an option, so a person cannot choose it back.";
|
|
1666
2988
|
};
|
|
1667
2989
|
readonly hint: {
|
|
1668
2990
|
readonly kind: "string";
|
|
@@ -1674,7 +2996,7 @@ export declare const selectMeta: {
|
|
|
1674
2996
|
};
|
|
1675
2997
|
readonly name: {
|
|
1676
2998
|
readonly kind: "string";
|
|
1677
|
-
readonly description: "The
|
|
2999
|
+
readonly description: "The form name submitted with the surrounding form, through a hidden input carrying the value.";
|
|
1678
3000
|
};
|
|
1679
3001
|
readonly disabled: {
|
|
1680
3002
|
readonly kind: "boolean";
|
|
@@ -1717,17 +3039,25 @@ export declare const selectMeta: {
|
|
|
1717
3039
|
readonly description: "Present while an error is set.";
|
|
1718
3040
|
readonly attribute: "data-sprint-invalid";
|
|
1719
3041
|
};
|
|
3042
|
+
readonly active: {
|
|
3043
|
+
readonly description: "On an option part, present while the list is open and that option is highlighted by the keyboard or pointer.";
|
|
3044
|
+
readonly attribute: "data-sprint-active";
|
|
3045
|
+
};
|
|
1720
3046
|
};
|
|
1721
3047
|
readonly tools: {
|
|
1722
3048
|
readonly select: AgentToolSpec;
|
|
1723
3049
|
};
|
|
1724
3050
|
readonly agentView: {
|
|
1725
|
-
readonly example: "- **Select** \"Region\" [value=eu-1] → tool `select-region`\n - part `option` \"North Atlantic\"\n - part `option` \"Northern Europe\" [checked]\n - part `option` \"East Asia\"";
|
|
3051
|
+
readonly example: "- **Select** \"Region\" [value=eu-1] → tool `select-region`\n - part `option` \"North Atlantic\" [count=12]\n - part `option` \"Northern Europe\" [checked, count=30]\n - part `option` \"East Asia\" [count=7]";
|
|
1726
3052
|
};
|
|
1727
3053
|
readonly examples: readonly [{
|
|
1728
3054
|
readonly title: "A dropdown";
|
|
1729
3055
|
readonly description: "In agent view each option renders as its own control, so a DOM-driving agent chooses one directly.";
|
|
1730
3056
|
readonly code: "<Select\n label=\"Region\"\n value={region}\n onChange={setRegion}\n placeholder=\"Choose a region\"\n options={[\n { value: \"na-1\", label: \"North Atlantic\" },\n { value: \"eu-1\", label: \"Northern Europe\" },\n { value: \"ap-1\", label: \"East Asia\" },\n ]}\n/>";
|
|
3057
|
+
}, {
|
|
3058
|
+
readonly title: "Options with counts";
|
|
3059
|
+
readonly description: "A count is data, not label text: it renders as a chip in the list and the closed control, joins the accessible name, and reaches agents as part state while the select tool still takes the plain label.";
|
|
3060
|
+
readonly code: "<Select\n label=\"Region\"\n value={region}\n onChange={setRegion}\n placeholder=\"Choose a region\"\n options={[\n { value: \"na-1\", label: \"North Atlantic\", count: 12 },\n { value: \"eu-1\", label: \"Northern Europe\", count: 30 },\n { value: \"ap-1\", label: \"East Asia\", count: 7 },\n ]}\n/>";
|
|
1731
3061
|
}, {
|
|
1732
3062
|
readonly title: "A required choice with an error";
|
|
1733
3063
|
readonly description: "Empty plus required plus an error is how an unmade mandatory choice reads on every surface.";
|
|
@@ -1739,14 +3069,15 @@ export declare const selectMeta: {
|
|
|
1739
3069
|
}];
|
|
1740
3070
|
readonly a11y: {
|
|
1741
3071
|
readonly role: "combobox";
|
|
1742
|
-
readonly keyboard: readonly ["Arrow keys move through the options", "Enter or Space
|
|
1743
|
-
readonly notes: "A
|
|
3072
|
+
readonly keyboard: readonly ["Enter, Space, or an arrow key opens the list", "Arrow keys, Home, and End move through the options; typing a letter jumps to the next match", "Enter or Space chooses the highlighted option", "Escape or Tab closes the list without choosing"];
|
|
3073
|
+
readonly notes: "A select-only combobox: a button with role combobox that opens a listbox on a plain click, so a synthetic element.click() opens it as reliably as a pointer does, and the list renders in the page rather than in browser chrome an automated session cannot see. Focus stays on the button and aria-activedescendant tracks the highlighted option. The label is linked with aria-labelledby; errors set aria-invalid and link with aria-describedby. An option with a count is named by its label and count together.";
|
|
1744
3074
|
};
|
|
1745
3075
|
};
|
|
1746
3076
|
|
|
1747
3077
|
export declare interface SelectOption {
|
|
1748
3078
|
value: string;
|
|
1749
3079
|
label: string;
|
|
3080
|
+
count?: number;
|
|
1750
3081
|
}
|
|
1751
3082
|
|
|
1752
3083
|
export declare interface SelectProps extends Omit<ComponentPropsWithRef<"div">, "onChange"> {
|
|
@@ -1820,8 +3151,40 @@ export declare const shellMeta: {
|
|
|
1820
3151
|
readonly description: "Label of the drawer button while the drawer is open.";
|
|
1821
3152
|
readonly default: "Close";
|
|
1822
3153
|
};
|
|
3154
|
+
readonly collapsible: {
|
|
3155
|
+
readonly kind: "boolean";
|
|
3156
|
+
readonly description: "Lets a person hide the sidebar on wide viewports too. A second toggle appears beside the bar there, and while collapsed the page takes the narrow layout: the bar runs across the top and the sidebar is gone until it is shown again.";
|
|
3157
|
+
readonly default: false;
|
|
3158
|
+
};
|
|
3159
|
+
readonly collapsed: {
|
|
3160
|
+
readonly kind: "boolean";
|
|
3161
|
+
readonly description: "Whether the sidebar is collapsed on wide viewports, when the owner keeps that state. Pair it with onCollapsedChange.";
|
|
3162
|
+
};
|
|
3163
|
+
readonly defaultCollapsed: {
|
|
3164
|
+
readonly kind: "boolean";
|
|
3165
|
+
readonly description: "Whether a collapsible sidebar starts collapsed when the Shell keeps its own state.";
|
|
3166
|
+
readonly default: false;
|
|
3167
|
+
};
|
|
3168
|
+
readonly onCollapsedChange: {
|
|
3169
|
+
readonly kind: "handler";
|
|
3170
|
+
readonly description: "Called with the collapsed state the Shell wants. Use it to remember the choice across visits.";
|
|
3171
|
+
};
|
|
3172
|
+
readonly hideLabel: {
|
|
3173
|
+
readonly kind: "string";
|
|
3174
|
+
readonly description: "Label of the wide-viewport toggle while the sidebar is shown.";
|
|
3175
|
+
readonly default: "Hide menu";
|
|
3176
|
+
};
|
|
3177
|
+
readonly showLabel: {
|
|
3178
|
+
readonly kind: "string";
|
|
3179
|
+
readonly description: "Label of the wide-viewport toggle while the sidebar is collapsed.";
|
|
3180
|
+
readonly default: "Show menu";
|
|
3181
|
+
};
|
|
1823
3182
|
};
|
|
1824
3183
|
readonly state: {
|
|
3184
|
+
readonly collapsed: {
|
|
3185
|
+
readonly description: "Present while a collapsible sidebar is hidden on wide viewports. Narrow viewports ignore it and keep the drawer.";
|
|
3186
|
+
readonly attribute: "data-sprint-collapsed";
|
|
3187
|
+
};
|
|
1825
3188
|
readonly open: {
|
|
1826
3189
|
readonly description: "Present while the mobile drawer is open. On wide viewports the sidebar is always visible and this state is inert.";
|
|
1827
3190
|
readonly attribute: "data-sprint-open";
|
|
@@ -1835,6 +3198,10 @@ export declare const shellMeta: {
|
|
|
1835
3198
|
readonly title: "A sidebar app shell";
|
|
1836
3199
|
readonly description: "One Shell per view. The sidebar collapses to a top bar with a drawer on narrow screens, and an agent reading the page sees the nav and the content with no frame in between.";
|
|
1837
3200
|
readonly code: "<Shell\n bar={<Link href=\"#/\">ACME</Link>}\n side={\n <Nav label=\"Main\">\n <Link href=\"#/reports\" active>Reports</Link>\n <Link href=\"#/settings\">Settings</Link>\n </Nav>\n }\n>\n <Panel label=\"Reports\" headingLevel={2}>\n <Text>Quarterly numbers land here.</Text>\n </Panel>\n</Shell>";
|
|
3201
|
+
}, {
|
|
3202
|
+
readonly title: "A sidebar that can be hidden";
|
|
3203
|
+
readonly description: "With collapsible, a person can put the sidebar away on a wide screen as well as a narrow one, and get the full width for the page.";
|
|
3204
|
+
readonly code: "<Shell\n collapsible\n bar={<Link href=\"#/\">ACME</Link>}\n side={\n <Nav label=\"Main\">\n <Link href=\"#/reports\" active>Reports</Link>\n <Link href=\"#/settings\">Settings</Link>\n </Nav>\n }\n>\n <Text>Quarterly numbers land here.</Text>\n</Shell>";
|
|
1838
3205
|
}];
|
|
1839
3206
|
};
|
|
1840
3207
|
|
|
@@ -1845,6 +3212,12 @@ export declare interface ShellProps extends ComponentPropsWithRef<"div"> {
|
|
|
1845
3212
|
skipLabel?: string;
|
|
1846
3213
|
menuLabel?: string;
|
|
1847
3214
|
closeLabel?: string;
|
|
3215
|
+
collapsible?: boolean;
|
|
3216
|
+
collapsed?: boolean;
|
|
3217
|
+
defaultCollapsed?: boolean;
|
|
3218
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
3219
|
+
hideLabel?: string;
|
|
3220
|
+
showLabel?: string;
|
|
1848
3221
|
}
|
|
1849
3222
|
|
|
1850
3223
|
export declare function slug(value: string): string;
|
|
@@ -1879,6 +3252,8 @@ export declare interface SprintViewValue {
|
|
|
1879
3252
|
|
|
1880
3253
|
export declare function Stack(props: StackProps): JSX.Element;
|
|
1881
3254
|
|
|
3255
|
+
export declare const STACK_MINS: readonly ["10rem", "12rem", "14rem", "16rem", "18rem", "20rem", "22rem", "24rem", "28rem", "32rem"];
|
|
3256
|
+
|
|
1882
3257
|
export declare type StackAlign = "start" | "center" | "end" | "stretch" | "baseline";
|
|
1883
3258
|
|
|
1884
3259
|
export declare type StackDirection = "row" | "column" | "grid";
|
|
@@ -1933,8 +3308,9 @@ export declare const stackMeta: {
|
|
|
1933
3308
|
readonly default: false;
|
|
1934
3309
|
};
|
|
1935
3310
|
readonly min: {
|
|
1936
|
-
readonly kind: "
|
|
1937
|
-
readonly description: "Minimum track width for direction=\"grid\",
|
|
3311
|
+
readonly kind: "enum";
|
|
3312
|
+
readonly description: "Minimum track width for direction=\"grid\", from a fixed scale of rem lengths. Tracks never exceed the container. Scale values are mapped in the stylesheet through data-sprint-min, so they work under a strict Content Security Policy. Any other CSS length is still accepted as an escape hatch, but it is written to an inline style attribute, which a style-src policy without unsafe-inline blocks: under such a policy an off-scale grid falls back to one column.";
|
|
3313
|
+
readonly values: readonly ["10rem", "12rem", "14rem", "16rem", "18rem", "20rem", "22rem", "24rem", "28rem", "32rem"];
|
|
1938
3314
|
readonly default: "18rem";
|
|
1939
3315
|
};
|
|
1940
3316
|
};
|
|
@@ -1967,6 +3343,10 @@ export declare const stackMeta: {
|
|
|
1967
3343
|
readonly description: "Present when the row stacks into a column on narrow viewports.";
|
|
1968
3344
|
readonly attribute: "data-sprint-collapse";
|
|
1969
3345
|
};
|
|
3346
|
+
readonly min: {
|
|
3347
|
+
readonly description: "The minimum track width in use, present only when direction=\"grid\". A value off the scale is carried here too, with the length itself in an inline style.";
|
|
3348
|
+
readonly attribute: "data-sprint-min";
|
|
3349
|
+
};
|
|
1970
3350
|
};
|
|
1971
3351
|
readonly examples: readonly [{
|
|
1972
3352
|
readonly title: "A row of actions";
|
|
@@ -1982,6 +3362,8 @@ export declare const stackMeta: {
|
|
|
1982
3362
|
}];
|
|
1983
3363
|
};
|
|
1984
3364
|
|
|
3365
|
+
export declare type StackMin = (typeof STACK_MINS)[number];
|
|
3366
|
+
|
|
1985
3367
|
export declare interface StackProps extends ComponentPropsWithRef<"div"> {
|
|
1986
3368
|
direction?: StackDirection;
|
|
1987
3369
|
gap?: StackGap;
|
|
@@ -1989,11 +3371,106 @@ export declare interface StackProps extends ComponentPropsWithRef<"div"> {
|
|
|
1989
3371
|
justify?: StackJustify;
|
|
1990
3372
|
wrap?: boolean;
|
|
1991
3373
|
collapse?: boolean;
|
|
1992
|
-
min?: string;
|
|
3374
|
+
min?: StackMin | (string & Record<never, never>);
|
|
1993
3375
|
}
|
|
1994
3376
|
|
|
1995
3377
|
export declare const STATE_ATTRIBUTE_PREFIX = "data-sprint-";
|
|
1996
3378
|
|
|
3379
|
+
export declare interface Step {
|
|
3380
|
+
title: string;
|
|
3381
|
+
body?: string;
|
|
3382
|
+
state?: StepState;
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
export declare function Steps(props: StepsProps): JSX.Element;
|
|
3386
|
+
|
|
3387
|
+
export declare const stepsMeta: {
|
|
3388
|
+
readonly name: "Steps";
|
|
3389
|
+
readonly category: "display";
|
|
3390
|
+
readonly summary: "An ordered set of numbered steps a person works through: each one a number badge, a short title and an optional body, with a rule between them. A step can be marked done or current, so the list doubles as a record of how far someone has got.";
|
|
3391
|
+
readonly whenToUse: "Use it when the order is the instruction: a handful of things to do one after another, each worth a title of its own, like the two things to send someone or the stages of a setup. Mark the step in progress as current and the finished ones as done when the page knows; leave every state off when the steps are simply instructions. Each step is an addressable part carrying its position and state, so an agent can say which step is next without counting lines.";
|
|
3392
|
+
readonly whenNotToUse: "Do not use it for a plain numbered list of short points with no titles or progress; that is List with ordered. Do not use it as a wizard that moves between screens: Steps only displays where someone is, it has no actions and registers no WebMCP tool, because there is nothing to press and an agent reads every step and its state from the agent view. Pair it with a Button when the page itself advances. Do not put components or links in a step; title and body are plain strings.";
|
|
3393
|
+
readonly status: "experimental";
|
|
3394
|
+
readonly props: {
|
|
3395
|
+
readonly label: {
|
|
3396
|
+
readonly kind: "string";
|
|
3397
|
+
readonly description: "What the steps achieve, as a short phrase like \"Send Tess two things\". Names the list for a screen reader and for the agent view.";
|
|
3398
|
+
readonly required: true;
|
|
3399
|
+
};
|
|
3400
|
+
readonly steps: {
|
|
3401
|
+
readonly kind: "array";
|
|
3402
|
+
readonly description: "The steps in order, each { title: string; body?: string; state?: \"done\" | \"current\" }. Title is the instruction in a few words; body is an optional sentence of detail. A step with no state is upcoming. Mark at most one step current.";
|
|
3403
|
+
readonly required: true;
|
|
3404
|
+
};
|
|
3405
|
+
readonly doneLabel: {
|
|
3406
|
+
readonly kind: "string";
|
|
3407
|
+
readonly description: "What a screen reader hears as the description of a finished step, since the done mark is drawn rather than written.";
|
|
3408
|
+
readonly default: "Done";
|
|
3409
|
+
};
|
|
3410
|
+
readonly emptyLabel: {
|
|
3411
|
+
readonly kind: "string";
|
|
3412
|
+
readonly description: "What the list says when it has no steps.";
|
|
3413
|
+
readonly default: "No steps";
|
|
3414
|
+
};
|
|
3415
|
+
};
|
|
3416
|
+
readonly state: {
|
|
3417
|
+
readonly steps: {
|
|
3418
|
+
readonly description: "How many steps there are.";
|
|
3419
|
+
readonly attribute: "data-sprint-steps";
|
|
3420
|
+
};
|
|
3421
|
+
readonly complete: {
|
|
3422
|
+
readonly description: "Present when every step is done.";
|
|
3423
|
+
readonly attribute: "data-sprint-complete";
|
|
3424
|
+
};
|
|
3425
|
+
readonly empty: {
|
|
3426
|
+
readonly description: "Present when there are no steps.";
|
|
3427
|
+
readonly attribute: "data-sprint-empty";
|
|
3428
|
+
};
|
|
3429
|
+
readonly index: {
|
|
3430
|
+
readonly description: "On a step: its 1-based position, which is also the number in its badge.";
|
|
3431
|
+
readonly attribute: "data-sprint-index";
|
|
3432
|
+
};
|
|
3433
|
+
readonly done: {
|
|
3434
|
+
readonly description: "On a step: present once the step is finished.";
|
|
3435
|
+
readonly attribute: "data-sprint-done";
|
|
3436
|
+
};
|
|
3437
|
+
readonly current: {
|
|
3438
|
+
readonly description: "On a step: present on the step in progress.";
|
|
3439
|
+
readonly attribute: "data-sprint-current";
|
|
3440
|
+
};
|
|
3441
|
+
};
|
|
3442
|
+
readonly agentView: {
|
|
3443
|
+
readonly example: "- **Steps** \"Send Tess two things\" [steps=2]\n - part `step` \"Copy the link\" [index=1]\n - part `step` \"Pass on the emoji\" [index=2]";
|
|
3444
|
+
};
|
|
3445
|
+
readonly a11y: {
|
|
3446
|
+
readonly role: "list";
|
|
3447
|
+
readonly notes: "A real ol named by its label, with an explicit list role because the drawn badges require list-style none and Safari would otherwise drop the list semantics, so the position of each step is announced. The badge number is aria-hidden for the same reason. The current step carries aria-current=\"step\", and a done step is described by doneLabel. Title and body are read as one item, separated by a colon that is hidden visually.";
|
|
3448
|
+
};
|
|
3449
|
+
readonly relatedComponents: readonly ["List", "Progress", "Panel"];
|
|
3450
|
+
readonly examples: readonly [{
|
|
3451
|
+
readonly title: "Send Tess two things";
|
|
3452
|
+
readonly description: "The plainest case: two instructions in order, with no progress to report.";
|
|
3453
|
+
readonly code: "<Steps\n label=\"Send Tess two things\"\n steps={[{ title: \"Copy the link\" }, { title: \"Pass on the emoji\" }]}\n/>";
|
|
3454
|
+
}, {
|
|
3455
|
+
readonly title: "Partway through";
|
|
3456
|
+
readonly description: "A finished step, the one in progress, and one still to come, each with a line of detail.";
|
|
3457
|
+
readonly code: "<Steps\n label=\"Connect a tool\"\n steps={[\n {\n title: \"Register the tool\",\n body: \"Give it a name and an input schema.\",\n state: \"done\",\n },\n {\n title: \"Drive the DOM\",\n body: \"Click the real element rather than calling a prop.\",\n state: \"current\",\n },\n { title: \"Return the new state\", body: \"Read it back from the page.\" },\n ]}\n/>";
|
|
3458
|
+
}, {
|
|
3459
|
+
readonly title: "Every step done";
|
|
3460
|
+
readonly description: "When all steps are done the list publishes that it is complete.";
|
|
3461
|
+
readonly code: "<Steps\n label=\"Send Tess two things\"\n steps={[\n { title: \"Copy the link\", state: \"done\" },\n { title: \"Pass on the emoji\", state: \"done\" },\n ]}\n/>";
|
|
3462
|
+
}];
|
|
3463
|
+
};
|
|
3464
|
+
|
|
3465
|
+
export declare interface StepsProps extends Omit<ComponentPropsWithRef<"ol">, "children"> {
|
|
3466
|
+
label: string;
|
|
3467
|
+
steps: readonly Step[];
|
|
3468
|
+
doneLabel?: string;
|
|
3469
|
+
emptyLabel?: string;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
export declare type StepState = "done" | "current";
|
|
3473
|
+
|
|
1997
3474
|
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
1998
3475
|
|
|
1999
3476
|
export declare const switchMeta: {
|
|
@@ -2076,11 +3553,13 @@ export declare interface SwitchProps extends Omit<ComponentPropsWithRef<"button"
|
|
|
2076
3553
|
|
|
2077
3554
|
export declare function Table(props: TableProps): JSX.Element;
|
|
2078
3555
|
|
|
3556
|
+
export declare const TABLE_WIDTHS: readonly ["4rem", "5rem", "6rem", "7rem", "8rem", "9rem", "10rem", "12rem", "14rem", "16rem", "20rem", "24rem"];
|
|
3557
|
+
|
|
2079
3558
|
export declare interface TableColumn {
|
|
2080
3559
|
key: string;
|
|
2081
3560
|
header: string;
|
|
2082
3561
|
align?: "start" | "end";
|
|
2083
|
-
width?: string;
|
|
3562
|
+
width?: TableWidth | (string & Record<never, never>);
|
|
2084
3563
|
}
|
|
2085
3564
|
|
|
2086
3565
|
export declare const tableMeta: {
|
|
@@ -2098,7 +3577,7 @@ export declare const tableMeta: {
|
|
|
2098
3577
|
};
|
|
2099
3578
|
readonly columns: {
|
|
2100
3579
|
readonly kind: "array";
|
|
2101
|
-
readonly description: "Column definitions, in display order: { key, header, align?, width? }. The key addresses the cell in each row and appears on the cell as data-sprint-column.";
|
|
3580
|
+
readonly description: "Column definitions, in display order: { key, header, align?, width? }. The key addresses the cell in each row and appears on the cell as data-sprint-column. width is one of 4rem, 5rem, 6rem, 7rem, 8rem, 9rem, 10rem, 12rem, 14rem, 16rem, 20rem, or 24rem, mapped in the stylesheet through data-sprint-width on the header cell so it works under a strict Content Security Policy; any other CSS length is still accepted but is written to an inline style attribute, which a style-src policy without unsafe-inline blocks.";
|
|
2102
3581
|
readonly required: true;
|
|
2103
3582
|
};
|
|
2104
3583
|
readonly rows: {
|
|
@@ -2111,6 +3590,16 @@ export declare const tableMeta: {
|
|
|
2111
3590
|
readonly description: "What the table says when it has no rows.";
|
|
2112
3591
|
readonly default: "No rows";
|
|
2113
3592
|
};
|
|
3593
|
+
readonly loading: {
|
|
3594
|
+
readonly kind: "boolean";
|
|
3595
|
+
readonly description: "Set while the rows are being fetched. Sets aria-busy and sweeps a bar along the top edge. Existing rows stay visible; with none yet, the empty slot says loadingLabel instead of emptyLabel.";
|
|
3596
|
+
readonly default: false;
|
|
3597
|
+
};
|
|
3598
|
+
readonly loadingLabel: {
|
|
3599
|
+
readonly kind: "string";
|
|
3600
|
+
readonly description: "What the empty slot says while loading.";
|
|
3601
|
+
readonly default: "Loading";
|
|
3602
|
+
};
|
|
2114
3603
|
};
|
|
2115
3604
|
readonly state: {
|
|
2116
3605
|
readonly columns: {
|
|
@@ -2125,6 +3614,10 @@ export declare const tableMeta: {
|
|
|
2125
3614
|
readonly description: "Present when the table has no rows.";
|
|
2126
3615
|
readonly attribute: "data-sprint-empty";
|
|
2127
3616
|
};
|
|
3617
|
+
readonly loading: {
|
|
3618
|
+
readonly description: "Present while the rows are being fetched. Alongside empty it means nothing has arrived yet, not that there is nothing.";
|
|
3619
|
+
readonly attribute: "data-sprint-loading";
|
|
3620
|
+
};
|
|
2128
3621
|
readonly column: {
|
|
2129
3622
|
readonly description: "On a cell: which column it belongs to.";
|
|
2130
3623
|
readonly attribute: "data-sprint-column";
|
|
@@ -2133,6 +3626,10 @@ export declare const tableMeta: {
|
|
|
2133
3626
|
readonly description: "On a cell: which row it belongs to.";
|
|
2134
3627
|
readonly attribute: "data-sprint-row";
|
|
2135
3628
|
};
|
|
3629
|
+
readonly width: {
|
|
3630
|
+
readonly description: "On a column header: the width its column asked for, if any. A value off the scale is carried here too, with the length itself in an inline style.";
|
|
3631
|
+
readonly attribute: "data-sprint-width";
|
|
3632
|
+
};
|
|
2136
3633
|
readonly align: {
|
|
2137
3634
|
readonly description: "On a cell: the alignment its column asked for, if any.";
|
|
2138
3635
|
readonly attribute: "data-sprint-align";
|
|
@@ -2150,6 +3647,10 @@ export declare const tableMeta: {
|
|
|
2150
3647
|
readonly title: "A table with no rows";
|
|
2151
3648
|
readonly description: "An empty table keeps its header and says so, rather than rendering a bare keyline.";
|
|
2152
3649
|
readonly code: "<Table\n label=\"Registered tools\"\n emptyLabel=\"No tools registered\"\n columns={[{ key: \"name\", header: \"Name\" }]}\n rows={[]}\n/>";
|
|
3650
|
+
}, {
|
|
3651
|
+
readonly title: "A table while fetching";
|
|
3652
|
+
readonly description: "Before the first rows arrive the table reads [empty, loading], so an agent waits rather than concluding there is nothing.";
|
|
3653
|
+
readonly code: "<Table\n label=\"Loadouts\"\n loading={isFetching}\n columns={[{ key: \"name\", header: \"Name\" }]}\n rows={loadouts ?? []}\n/>";
|
|
2153
3654
|
}];
|
|
2154
3655
|
readonly a11y: {
|
|
2155
3656
|
readonly role: "table";
|
|
@@ -2162,6 +3663,8 @@ export declare interface TableProps extends ComponentPropsWithRef<"table"> {
|
|
|
2162
3663
|
columns: readonly TableColumn[];
|
|
2163
3664
|
rows: readonly TableRow[];
|
|
2164
3665
|
emptyLabel?: string;
|
|
3666
|
+
loading?: boolean;
|
|
3667
|
+
loadingLabel?: string;
|
|
2165
3668
|
}
|
|
2166
3669
|
|
|
2167
3670
|
export declare interface TableRow {
|
|
@@ -2169,6 +3672,8 @@ export declare interface TableRow {
|
|
|
2169
3672
|
cells: Record<string, ReactNode>;
|
|
2170
3673
|
}
|
|
2171
3674
|
|
|
3675
|
+
export declare type TableWidth = (typeof TABLE_WIDTHS)[number];
|
|
3676
|
+
|
|
2172
3677
|
export declare function Tag(props: TagProps): JSX.Element;
|
|
2173
3678
|
|
|
2174
3679
|
export declare const tagMeta: {
|
|
@@ -2365,7 +3870,7 @@ export declare const textInputMeta: {
|
|
|
2365
3870
|
readonly category: "input";
|
|
2366
3871
|
readonly summary: "A single-line text field carrying its own label, hint, and error. Fully controlled, and it registers one fill tool that replaces the field's text with an explicit value.";
|
|
2367
3872
|
readonly whenToUse: "Use it for any free-form single-line value: a name, an email address, a search term. The label is part of the component, so a form never needs a separate label element, and the error prop is how validation reaches both a person and an agent.";
|
|
2368
|
-
readonly whenNotToUse: "Do not use it for multi-line text, which is a Textarea. Do not use it to pick from a known set of values; that is a Select or a SegmentedControl. Do not use it for an on/off state, which is a Checkbox or a Switch.";
|
|
3873
|
+
readonly whenNotToUse: "Do not use it for multi-line text, which is a Textarea. Do not use it to pick from a known set of values; that is a Select or a SegmentedControl. Do not use it for an on/off state, which is a Checkbox or a Switch. Do not use a read-only TextInput to hand someone a value to paste elsewhere; that is a CopyField.";
|
|
2369
3874
|
readonly status: "experimental";
|
|
2370
3875
|
readonly props: {
|
|
2371
3876
|
readonly label: {
|
|
@@ -2414,6 +3919,11 @@ export declare const textInputMeta: {
|
|
|
2414
3919
|
readonly description: "Disable the field and unregister its fill tool.";
|
|
2415
3920
|
readonly default: false;
|
|
2416
3921
|
};
|
|
3922
|
+
readonly readOnly: {
|
|
3923
|
+
readonly kind: "boolean";
|
|
3924
|
+
readonly description: "Show the value without letting anyone change it. The field stays focusable and selectable, renders as plain text in the agent view, and registers no fill tool, because nothing can change it.";
|
|
3925
|
+
readonly default: false;
|
|
3926
|
+
};
|
|
2417
3927
|
readonly required: {
|
|
2418
3928
|
readonly kind: "boolean";
|
|
2419
3929
|
readonly description: "Mark the field required, visually and in the agent view.";
|
|
@@ -2446,6 +3956,10 @@ export declare const textInputMeta: {
|
|
|
2446
3956
|
readonly description: "Present when the field cannot be edited.";
|
|
2447
3957
|
readonly attribute: "data-sprint-disabled";
|
|
2448
3958
|
};
|
|
3959
|
+
readonly readonly: {
|
|
3960
|
+
readonly description: "Present when the field shows a value that cannot be changed. No fill tool is registered while it is set.";
|
|
3961
|
+
readonly attribute: "data-sprint-readonly";
|
|
3962
|
+
};
|
|
2449
3963
|
readonly required: {
|
|
2450
3964
|
readonly description: "Present when the field must be filled.";
|
|
2451
3965
|
readonly attribute: "data-sprint-required";
|
|
@@ -2473,6 +3987,10 @@ export declare const textInputMeta: {
|
|
|
2473
3987
|
readonly title: "A password";
|
|
2474
3988
|
readonly description: "The value stays off every agent surface: state reflects filled or empty, and tool results never echo the text.";
|
|
2475
3989
|
readonly code: "<TextInput\n label=\"Access code\"\n type=\"password\"\n value={code}\n onChange={setCode}\n autoComplete=\"current-password\"\n/>";
|
|
3990
|
+
}, {
|
|
3991
|
+
readonly title: "A read-only value";
|
|
3992
|
+
readonly description: "A value shown in the shape of a form field that nobody may edit. It stays focusable and selectable, reads as text in the agent view, and registers no fill tool. To hand someone a value to paste elsewhere, a CopyField adds the copy control.";
|
|
3993
|
+
readonly code: "<TextInput\n label=\"Station ID\"\n value=\"KX-2209-ALPHA\"\n onChange={() => {}}\n readOnly\n hint=\"Assigned at registration\"\n/>";
|
|
2476
3994
|
}];
|
|
2477
3995
|
readonly a11y: {
|
|
2478
3996
|
readonly role: "textbox";
|
|
@@ -2492,6 +4010,7 @@ export declare interface TextInputProps extends Omit<ComponentPropsWithRef<"div"
|
|
|
2492
4010
|
name?: string;
|
|
2493
4011
|
autoComplete?: string;
|
|
2494
4012
|
disabled?: boolean;
|
|
4013
|
+
readOnly?: boolean;
|
|
2495
4014
|
required?: boolean;
|
|
2496
4015
|
agentName?: string;
|
|
2497
4016
|
agentTool?: boolean;
|
|
@@ -2611,6 +4130,8 @@ export declare interface ToolExecuteContext {
|
|
|
2611
4130
|
|
|
2612
4131
|
export declare function toolName(scope: readonly string[], verb: string, label: string): string | null;
|
|
2613
4132
|
|
|
4133
|
+
export declare const TURN_PAGE_TOOL: AgentToolSpec;
|
|
4134
|
+
|
|
2614
4135
|
export declare function useAgentControls(): SprintAgentControls;
|
|
2615
4136
|
|
|
2616
4137
|
export declare function useAgentFormat(): AgentFormatter;
|