altitude-design 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/guidance/components/AILabel/README.md +35 -0
- package/dist/guidance/components/Accordion/README.md +25 -0
- package/dist/guidance/components/AgentFleet/README.md +48 -1
- package/dist/guidance/components/AgentLanes/README.md +32 -0
- package/dist/guidance/components/AgentRequests/README.md +47 -0
- package/dist/guidance/components/Alert/README.md +49 -0
- package/dist/guidance/components/AltitudeProvider/README.md +63 -0
- package/dist/guidance/components/AppShell/README.md +70 -0
- package/dist/guidance/components/AreaChart/README.md +58 -0
- package/dist/guidance/components/Artifact/README.md +69 -0
- package/dist/guidance/components/Avatar/README.md +41 -0
- package/dist/guidance/components/Await/README.md +48 -0
- package/dist/guidance/components/Badge/README.md +44 -0
- package/dist/guidance/components/BarChart/README.md +62 -0
- package/dist/guidance/components/BarList/README.md +58 -0
- package/dist/guidance/components/Board/README.md +67 -0
- package/dist/guidance/components/Breadcrumb/README.md +31 -0
- package/dist/guidance/components/Button/README.md +41 -0
- package/dist/guidance/components/Card/README.md +38 -0
- package/dist/guidance/components/ChartBrush/README.md +57 -0
- package/dist/guidance/components/ChartContainer/README.md +77 -0
- package/dist/guidance/components/ChartLegend/README.md +43 -0
- package/dist/guidance/components/ChartReference/README.md +74 -0
- package/dist/guidance/components/ChartTooltip/README.md +63 -0
- package/dist/guidance/components/Checkbox/README.md +35 -0
- package/dist/guidance/components/Checklist/README.md +66 -0
- package/dist/guidance/components/CodeBlock/README.md +44 -0
- package/dist/guidance/components/ColorPicker/README.md +39 -0
- package/dist/guidance/components/Combobox/README.md +35 -0
- package/dist/guidance/components/CommandPalette/README.md +177 -0
- package/dist/guidance/components/CommentThread/README.md +51 -0
- package/dist/guidance/components/Confirmation/README.md +60 -0
- package/dist/guidance/components/ContextMenu/README.md +51 -0
- package/dist/guidance/components/Conversation/README.md +124 -0
- package/dist/guidance/components/CopyButton/README.md +31 -0
- package/dist/guidance/components/DataGrid/README.md +75 -0
- package/dist/guidance/components/DatePicker/README.md +49 -0
- package/dist/guidance/components/Dialog/README.md +175 -0
- package/dist/guidance/components/DiffView/README.md +77 -0
- package/dist/guidance/components/DotPlot/README.md +44 -0
- package/dist/guidance/components/Drilldown/README.md +28 -0
- package/dist/guidance/components/DropZone/README.md +50 -0
- package/dist/guidance/components/DropdownMenu/README.md +44 -0
- package/dist/guidance/components/EditRegion/README.md +159 -0
- package/dist/guidance/components/EmptyState/README.md +49 -0
- package/dist/guidance/components/FeatureGate/README.md +39 -0
- package/dist/guidance/components/Field/README.md +36 -0
- package/dist/guidance/components/FilterBar/README.md +63 -0
- package/dist/guidance/components/FormattedNumber/README.md +44 -0
- package/dist/guidance/components/Heatmap/README.md +71 -0
- package/dist/guidance/components/HoldButton/README.md +32 -0
- package/dist/guidance/components/HoverCard/README.md +53 -0
- package/dist/guidance/components/InlineCitation/README.md +32 -0
- package/dist/guidance/components/InlineEdit/README.md +247 -1
- package/dist/guidance/components/Input/README.md +36 -0
- package/dist/guidance/components/InputOTP/README.md +46 -0
- package/dist/guidance/components/ItemGroup/README.md +100 -0
- package/dist/guidance/components/Kbd/README.md +27 -0
- package/dist/guidance/components/LineChart/README.md +62 -0
- package/dist/guidance/components/Link/README.md +41 -0
- package/dist/guidance/components/Markdown/README.md +81 -0
- package/dist/guidance/components/Meter/README.md +52 -0
- package/dist/guidance/components/NotificationCenter/README.md +39 -0
- package/dist/guidance/components/NumberInput/README.md +37 -0
- package/dist/guidance/components/PageHeader/README.md +45 -0
- package/dist/guidance/components/Pagination/README.md +33 -0
- package/dist/guidance/components/PasswordInput/README.md +36 -0
- package/dist/guidance/components/PermissionMatrix/README.md +40 -0
- package/dist/guidance/components/Pile/README.md +42 -0
- package/dist/guidance/components/PlanPicker/README.md +37 -0
- package/dist/guidance/components/Popover/README.md +36 -0
- package/dist/guidance/components/Progress/README.md +31 -0
- package/dist/guidance/components/PromptInput/README.md +98 -0
- package/dist/guidance/components/PropertyList/README.md +80 -0
- package/dist/guidance/components/Question/README.md +54 -0
- package/dist/guidance/components/RadioGroup/README.md +37 -0
- package/dist/guidance/components/RelativeTime/README.md +47 -0
- package/dist/guidance/components/RemovalReceipt/README.md +77 -0
- package/dist/guidance/components/Resizable/README.md +29 -0
- package/dist/guidance/components/SaveBar/README.md +38 -0
- package/dist/guidance/components/SavedViews/README.md +58 -0
- package/dist/guidance/components/ScatterChart/README.md +63 -0
- package/dist/guidance/components/Schedule/README.md +66 -0
- package/dist/guidance/components/ScrollArea/README.md +28 -0
- package/dist/guidance/components/SecretField/README.md +46 -0
- package/dist/guidance/components/Select/README.md +70 -0
- package/dist/guidance/components/Separator/README.md +44 -0
- package/dist/guidance/components/Sheet/README.md +94 -0
- package/dist/guidance/components/Skeleton/README.md +36 -0
- package/dist/guidance/components/Slider/README.md +35 -0
- package/dist/guidance/components/SortableList/README.md +34 -0
- package/dist/guidance/components/Sparkline/README.md +58 -0
- package/dist/guidance/components/SplitButton/README.md +39 -0
- package/dist/guidance/components/Stat/README.md +61 -0
- package/dist/guidance/components/Stepper/README.md +61 -0
- package/dist/guidance/components/Suggestions/README.md +58 -0
- package/dist/guidance/components/Surface/README.md +28 -0
- package/dist/guidance/components/Switch/README.md +29 -0
- package/dist/guidance/components/SyncIndicator/README.md +54 -0
- package/dist/guidance/components/Table/README.md +62 -0
- package/dist/guidance/components/Tabs/README.md +55 -0
- package/dist/guidance/components/TagInput/README.md +50 -0
- package/dist/guidance/components/Terminal/README.md +42 -0
- package/dist/guidance/components/ThreadList/README.md +73 -0
- package/dist/guidance/components/TimeInput/README.md +37 -0
- package/dist/guidance/components/Timeline/README.md +55 -0
- package/dist/guidance/components/Toaster/README.md +38 -0
- package/dist/guidance/components/Toggle/README.md +52 -0
- package/dist/guidance/components/Toolbar/README.md +69 -0
- package/dist/guidance/components/Tooltip/README.md +29 -0
- package/dist/guidance/components/Tour/README.md +44 -0
- package/dist/guidance/components/Trace/README.md +92 -0
- package/dist/guidance/components/Tree/README.md +85 -0
- package/dist/guidance/index.json +117 -117
- package/dist/guidance/llms.txt +1 -1
- package/dist/guidance/manifest.json +120 -120
- package/dist/guidance/visual/ActionsInPlace.md +5 -5
- package/dist/guidance/visual/Distinctiveness.md +6 -2
- package/dist/guidance/visual/Research.md +14 -2
- package/dist/guidance/visual/Theming.md +1 -1
- package/dist/types/agent-fleet.d.ts +28 -0
- package/dist/types/ai-label.d.ts +7 -0
- package/dist/types/app-shell.d.ts +23 -0
- package/dist/types/area-chart.d.ts +8 -0
- package/dist/types/artifact.d.ts +14 -0
- package/dist/types/bar-chart.d.ts +6 -0
- package/dist/types/bar-list.d.ts +6 -0
- package/dist/types/breadcrumb.d.ts +6 -0
- package/dist/types/chart-brush.d.ts +6 -0
- package/dist/types/chart.d.ts +29 -1
- package/dist/types/checklist.d.ts +6 -0
- package/dist/types/code-block.d.ts +6 -0
- package/dist/types/collections.d.ts +15 -0
- package/dist/types/color-picker.d.ts +6 -0
- package/dist/types/command.d.ts +13 -0
- package/dist/types/comment-thread.d.ts +11 -0
- package/dist/types/confirmation.d.ts +8 -0
- package/dist/types/context-menu.d.ts +11 -0
- package/dist/types/controls.d.ts +174 -10
- package/dist/types/conversation.d.ts +21 -0
- package/dist/types/copy-button.d.ts +6 -0
- package/dist/types/core.d.ts +31 -0
- package/dist/types/data-grid.d.ts +25 -0
- package/dist/types/date-picker.d.ts +6 -0
- package/dist/types/diff-view.d.ts +8 -0
- package/dist/types/dot-plot.d.ts +6 -0
- package/dist/types/edit-region.d.ts +23 -0
- package/dist/types/empty.d.ts +9 -0
- package/dist/types/feature-gate.d.ts +8 -0
- package/dist/types/filter-bar.d.ts +8 -0
- package/dist/types/formatted-number.d.ts +6 -0
- package/dist/types/heatmap.d.ts +6 -0
- package/dist/types/inline-citation.d.ts +6 -0
- package/dist/types/inline-edit.d.ts +7 -0
- package/dist/types/input-otp.d.ts +11 -0
- package/dist/types/item-group.d.ts +29 -0
- package/dist/types/line-chart.d.ts +6 -0
- package/dist/types/link.d.ts +8 -1
- package/dist/types/markdown.d.ts +6 -0
- package/dist/types/meter.d.ts +6 -0
- package/dist/types/nav.d.ts +6 -0
- package/dist/types/notifications.d.ts +6 -0
- package/dist/types/number-input.d.ts +6 -0
- package/dist/types/overlays.d.ts +61 -0
- package/dist/types/page-header.d.ts +14 -0
- package/dist/types/pagination.d.ts +6 -0
- package/dist/types/password-input.d.ts +6 -0
- package/dist/types/permission-matrix.d.ts +7 -0
- package/dist/types/pile.d.ts +6 -0
- package/dist/types/plan-picker.d.ts +6 -0
- package/dist/types/prompt-input.d.ts +11 -0
- package/dist/types/property-list.d.ts +17 -0
- package/dist/types/question.d.ts +11 -0
- package/dist/types/relative-time.d.ts +8 -1
- package/dist/types/removal-receipt.d.ts +18 -1
- package/dist/types/save-bar.d.ts +6 -0
- package/dist/types/saved-views.d.ts +12 -0
- package/dist/types/scatter-chart.d.ts +8 -0
- package/dist/types/schedule.d.ts +21 -0
- package/dist/types/secret-field.d.ts +6 -0
- package/dist/types/select.d.ts +12 -0
- package/dist/types/separator.d.ts +8 -1
- package/dist/types/sheet.d.ts +19 -0
- package/dist/types/sparkline.d.ts +6 -0
- package/dist/types/split-button.d.ts +7 -0
- package/dist/types/stat.d.ts +7 -0
- package/dist/types/stepper.d.ts +12 -0
- package/dist/types/suggestions.d.ts +10 -0
- package/dist/types/sync-indicator.d.ts +8 -0
- package/dist/types/tag-input.d.ts +8 -0
- package/dist/types/terminal.d.ts +6 -0
- package/dist/types/thread-list.d.ts +16 -0
- package/dist/types/time-input.d.ts +6 -0
- package/dist/types/timeline.d.ts +9 -0
- package/dist/types/toggle.d.ts +6 -0
- package/dist/types/toolbar.d.ts +20 -0
- package/dist/types/tour.d.ts +10 -0
- package/dist/types/trace.d.ts +16 -0
- package/dist/types/tree.d.ts +21 -0
- package/dist/types-cjs/agent-fleet.d.cts +28 -0
- package/dist/types-cjs/ai-label.d.cts +7 -0
- package/dist/types-cjs/app-shell.d.cts +23 -0
- package/dist/types-cjs/area-chart.d.cts +8 -0
- package/dist/types-cjs/artifact.d.cts +14 -0
- package/dist/types-cjs/bar-chart.d.cts +6 -0
- package/dist/types-cjs/bar-list.d.cts +6 -0
- package/dist/types-cjs/breadcrumb.d.cts +6 -0
- package/dist/types-cjs/chart-brush.d.cts +6 -0
- package/dist/types-cjs/chart.d.cts +29 -1
- package/dist/types-cjs/checklist.d.cts +6 -0
- package/dist/types-cjs/code-block.d.cts +6 -0
- package/dist/types-cjs/collections.d.cts +15 -0
- package/dist/types-cjs/color-picker.d.cts +6 -0
- package/dist/types-cjs/command.d.cts +13 -0
- package/dist/types-cjs/comment-thread.d.cts +11 -0
- package/dist/types-cjs/confirmation.d.cts +8 -0
- package/dist/types-cjs/context-menu.d.cts +11 -0
- package/dist/types-cjs/controls.d.cts +174 -10
- package/dist/types-cjs/conversation.d.cts +21 -0
- package/dist/types-cjs/copy-button.d.cts +6 -0
- package/dist/types-cjs/core.d.cts +31 -0
- package/dist/types-cjs/data-grid.d.cts +25 -0
- package/dist/types-cjs/date-picker.d.cts +6 -0
- package/dist/types-cjs/diff-view.d.cts +8 -0
- package/dist/types-cjs/dot-plot.d.cts +6 -0
- package/dist/types-cjs/edit-region.d.cts +23 -0
- package/dist/types-cjs/empty.d.cts +9 -0
- package/dist/types-cjs/feature-gate.d.cts +8 -0
- package/dist/types-cjs/filter-bar.d.cts +8 -0
- package/dist/types-cjs/formatted-number.d.cts +6 -0
- package/dist/types-cjs/heatmap.d.cts +6 -0
- package/dist/types-cjs/inline-citation.d.cts +6 -0
- package/dist/types-cjs/inline-edit.d.cts +7 -0
- package/dist/types-cjs/input-otp.d.cts +11 -0
- package/dist/types-cjs/item-group.d.cts +29 -0
- package/dist/types-cjs/line-chart.d.cts +6 -0
- package/dist/types-cjs/link.d.cts +8 -1
- package/dist/types-cjs/markdown.d.cts +6 -0
- package/dist/types-cjs/meter.d.cts +6 -0
- package/dist/types-cjs/nav.d.cts +6 -0
- package/dist/types-cjs/notifications.d.cts +6 -0
- package/dist/types-cjs/number-input.d.cts +6 -0
- package/dist/types-cjs/overlays.d.cts +61 -0
- package/dist/types-cjs/page-header.d.cts +14 -0
- package/dist/types-cjs/pagination.d.cts +6 -0
- package/dist/types-cjs/password-input.d.cts +6 -0
- package/dist/types-cjs/permission-matrix.d.cts +7 -0
- package/dist/types-cjs/pile.d.cts +6 -0
- package/dist/types-cjs/plan-picker.d.cts +6 -0
- package/dist/types-cjs/prompt-input.d.cts +11 -0
- package/dist/types-cjs/property-list.d.cts +17 -0
- package/dist/types-cjs/question.d.cts +11 -0
- package/dist/types-cjs/relative-time.d.cts +8 -1
- package/dist/types-cjs/removal-receipt.d.cts +18 -1
- package/dist/types-cjs/save-bar.d.cts +6 -0
- package/dist/types-cjs/saved-views.d.cts +12 -0
- package/dist/types-cjs/scatter-chart.d.cts +8 -0
- package/dist/types-cjs/schedule.d.cts +21 -0
- package/dist/types-cjs/secret-field.d.cts +6 -0
- package/dist/types-cjs/select.d.cts +12 -0
- package/dist/types-cjs/separator.d.cts +8 -1
- package/dist/types-cjs/sheet.d.cts +19 -0
- package/dist/types-cjs/sparkline.d.cts +6 -0
- package/dist/types-cjs/split-button.d.cts +7 -0
- package/dist/types-cjs/stat.d.cts +7 -0
- package/dist/types-cjs/stepper.d.cts +12 -0
- package/dist/types-cjs/suggestions.d.cts +10 -0
- package/dist/types-cjs/sync-indicator.d.cts +8 -0
- package/dist/types-cjs/tag-input.d.cts +8 -0
- package/dist/types-cjs/terminal.d.cts +6 -0
- package/dist/types-cjs/thread-list.d.cts +16 -0
- package/dist/types-cjs/time-input.d.cts +6 -0
- package/dist/types-cjs/timeline.d.cts +9 -0
- package/dist/types-cjs/toggle.d.cts +6 -0
- package/dist/types-cjs/toolbar.d.cts +20 -0
- package/dist/types-cjs/tour.d.cts +10 -0
- package/dist/types-cjs/trace.d.cts +16 -0
- package/dist/types-cjs/tree.d.cts +21 -0
- package/package.json +1 -1
|
@@ -61,6 +61,23 @@ export interface PropertyListItemProps<V> {
|
|
|
61
61
|
* One record's properties as label–value pairs. The properties are the record, on the ground; an unset value is a
|
|
62
62
|
* small opening; an editable value is one plate that lifts when pointed at, because clicking it opens its editor
|
|
63
63
|
* (InlineEdit, with any control). “Edit all” lifts the whole list into one EditRegion for cross-field rules.
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { Badge, Combobox, Input, PropertyList, PropertyListItem, Select } from 'altitude-design';
|
|
67
|
+
*
|
|
68
|
+
* <PropertyList aria-labelledby="pl-issue" shortcuts>
|
|
69
|
+
* <PropertyListItem label="Status" value={issue.status} shortcut="s" commit="on-choose" onSave={save('status')} onValueChange={set('status')}
|
|
70
|
+
* renderValue={s => <Badge tone={PL_TONE[s]}>{plLabel(PL_STATUS, s)}</Badge>} editor={c => <Select {...c} items={PL_STATUS} size="sm" />} />
|
|
71
|
+
* <PropertyListItem label="Assignee" value={issue.assignee} shortcut="a" commit="on-choose" onSave={save('assignee')} onValueChange={set('assignee')}
|
|
72
|
+
* renderValue={p => plLabel(PL_PEOPLE, p)} editor={c => <Combobox {...c} items={PL_PEOPLE} size="sm" />} />
|
|
73
|
+
* <PropertyListItem label="Priority" value={issue.priority} emptyLabel="Add priority" commit="on-choose" onSave={save('priority')} onValueChange={set('priority')}
|
|
74
|
+
* renderValue={p => plLabel(PL_PRIORITY, p)} editor={c => <Select {...c} items={PL_PRIORITY} size="sm" />} />
|
|
75
|
+
* <PropertyListItem label="Estimate" value={issue.estimate} onSave={save('estimate')} onValueChange={set('estimate')} required
|
|
76
|
+
* validate={n => Number.isInteger(n) && n >= 0 ? undefined : 'Use a whole number, 0 or more.'} renderValue={n => `${n} points`}
|
|
77
|
+
* editor={({ value, onValueChange, ...c }) => <Input {...c} type="number" size="sm" value={value ?? ''} onChange={e => onValueChange(e.target.value === '' ? null : Number(e.target.value))} />} />
|
|
78
|
+
* <PropertyListItem label="Created" value={issue.created} />
|
|
79
|
+
* </PropertyList>
|
|
80
|
+
* ```
|
|
64
81
|
*/
|
|
65
82
|
export declare function PropertyList<T extends Record<string, unknown> = Record<string, unknown>>({ layout, shortcuts, editAll, proposedBy, className, children, ...aria }: PropertyListProps<T>): React.JSX.Element;
|
|
66
83
|
/** One property. With onSave its value is an editable plate (InlineEdit); without, read-only text. */
|
|
@@ -44,6 +44,17 @@ export interface QuestionProps {
|
|
|
44
44
|
* has been dispatched, so it's raised like a requested Confirmation, not pending. Options are a radio group (or
|
|
45
45
|
* checkboxes), "Your own answer" is a field, and Answer is the one primary; there's no default and nothing is focused
|
|
46
46
|
* for you. Answered, it presses to the ground as one line: "You chose: Staging · now".
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* import { Question, QuestionOption } from 'altitude-design';
|
|
50
|
+
*
|
|
51
|
+
* <Question title="Which environment should I deploy to?" state={q.state} answer={q.answer} answeredAt={q.at} allowOther
|
|
52
|
+
* answerLabel="Deploy" skipLabel="Let the assistant decide" onSkip={() => setQ({ state: 'expired' })}
|
|
53
|
+
* onAnswer={(answer) => setQ({ state: 'answered', answer, at: Date.now() })}>
|
|
54
|
+
* <QuestionOption value="staging" label="Staging" description="Resets nightly. Safe to try things." />
|
|
55
|
+
* <QuestionOption value="production" label="Production" description="Customers will see it immediately." />
|
|
56
|
+
* </Question>
|
|
57
|
+
* ```
|
|
47
58
|
*/
|
|
48
59
|
export declare function Question({ title, state: own, multiple, allowOther, otherLabel, answerLabel, skipLabel, onSkip, onAnswer, answer, answeredAt, requestedBy, name, children, className }: QuestionProps): React.JSX.Element;
|
|
49
60
|
export interface QuestionSetProps {
|
|
@@ -17,5 +17,12 @@ export interface RelativeTimeProps extends RelativeTimeOptions, Omit<React.TimeH
|
|
|
17
17
|
/** Show the exact date, time and zone in a Tooltip on hover and focus (the element becomes focusable). Default true. */
|
|
18
18
|
tooltip?: boolean;
|
|
19
19
|
}
|
|
20
|
-
/** A moment as "3 minutes ago" in a <time>, refreshed on one shared timer, with its exact time on hand. Ticking isn't a change.
|
|
20
|
+
/** A moment as "3 minutes ago" in a <time>, refreshed on one shared timer, with its exact time on hand. Ticking isn't a change.
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { RelativeTime } from 'altitude-design';
|
|
24
|
+
*
|
|
25
|
+
* <RelativeTime date={when} format="auto" />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
21
28
|
export declare function RelativeTime({ date, format, threshold, tense, locale, tooltip, className, title, style, ...rest }: RelativeTimeProps): React.JSX.Element;
|
|
@@ -28,7 +28,24 @@ export interface RemovalReceiptProps extends Omit<React.HTMLAttributes<HTMLEleme
|
|
|
28
28
|
/** When mounted, the slot glides open from nothing (an item brought back from elsewhere), then settles. */
|
|
29
29
|
arrive?: boolean;
|
|
30
30
|
}
|
|
31
|
-
/** An item's slot that keeps its place when the item leaves: the result shows where the item was, then the gap closes.
|
|
31
|
+
/** An item's slot that keeps its place when the item leaves: the result shows where the item was, then the gap closes.
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { Button, RemovalReceipt, toast } from 'altitude-design';
|
|
35
|
+
*
|
|
36
|
+
* <RemovalReceipt as="li" key={hook.id} removed={!!receipt} pending={receipt?.pending} arrive={back === hook.id}
|
|
37
|
+
* title={receipt?.undoing ? `Restoring ${hook.name}…` : receipt?.pending ? `Removing ${hook.name}…` : `${hook.name} removed.`}
|
|
38
|
+
* action={receipt && (!receipt.pending || receipt.undoing) &&
|
|
39
|
+
* <Button size="sm" loading={!!receipt.undoing} aria-label={`Undo removing ${hook.name}`} onClick={() => undo(hook)}>Undo</Button>}
|
|
40
|
+
* onClosed={() => {
|
|
41
|
+
* put(hook.id, null); setHooks((list) => list.filter((h) => h.id !== hook.id));
|
|
42
|
+
* toast({ title: `${hook.name} removed.`, action: { label: 'Undo', onClick: () => restore(hook) } });
|
|
43
|
+
* }}>
|
|
44
|
+
* <div className="rr-body"><div className="rr-name">{hook.name}</div><div className="rr-url">{hook.url}</div></div>
|
|
45
|
+
* <Button size="sm" variant="ghost" aria-label={`Remove ${hook.name}`} onClick={() => remove(hook)}>Remove</Button>
|
|
46
|
+
* </RemovalReceipt>
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
32
49
|
export declare function RemovalReceipt({ as, removed, pending, title, action, tone, icon, hold, onClosed, focusFallback, arrive, settle, className, style, children, ...rest }: RemovalReceiptProps): React.DetailedReactHTMLElement<{
|
|
33
50
|
style: {
|
|
34
51
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
@@ -33,6 +33,12 @@ export interface SaveBarProps {
|
|
|
33
33
|
* Unsaved changes on a page, held above it until saved or discarded. A draft is something in your hand, so the bar
|
|
34
34
|
* floats at level 3, docked to the bottom edge (below Sheets and Dialogs). Saving hovers as a pending write; a saved
|
|
35
35
|
* draft lowers away while the fields settle; a failed save drops the bar to a trench and keeps the draft.
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* import { SaveBar } from 'altitude-design';
|
|
39
|
+
*
|
|
40
|
+
* <SaveBar record={record} />
|
|
41
|
+
* ```
|
|
36
42
|
*/
|
|
37
43
|
export declare function SaveBar({ record, dirty: dirtyProp, saving: savingProp, error: errorProp, invalidCount: invalidProp, changedCount, onSave, onDiscard, delay, saveLabel, discardLabel, className }: SaveBarProps): React.JSX.Element;
|
|
38
44
|
export {};
|
|
@@ -68,5 +68,17 @@ export interface SavedViewsProps {
|
|
|
68
68
|
/**
|
|
69
69
|
* Saved views as folder Tabs: the active tab and the table beneath it are one raised sheet. A view you've changed is a
|
|
70
70
|
* draft: its tab carries a dot and "modified", and Save view, Save as new view and Reset appear beside the tabs.
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* import { DataTable, FilterBar, FormattedNumber, SavedViews } from 'altitude-design';
|
|
74
|
+
*
|
|
75
|
+
* <SavedViews views={views} aria-label="Deal views">
|
|
76
|
+
* <FilterBar fields={fields} {...views.filterBarProps} aria-label="Filter deals" />
|
|
77
|
+
* <DataTable aria-label="Deals" rows={deals} getRowId={(r) => r.id} {...views.tableProps} columnsMenu density="compact"
|
|
78
|
+
* relevance={(r) => (value.some((f) => f.value !== undefined) ? (matches(r, value, match) ? 'match' : 'miss') : undefined)}
|
|
79
|
+
* columns={[{ key: 'name', header: 'Deal', sortValue: (r) => r.name }, { key: 'stage', header: 'Stage', sortValue: (r) => r.stage }, { key: 'owner', header: 'Owner', sortValue: (r) => r.owner },
|
|
80
|
+
* { key: 'value', header: 'Value', align: 'end', sortValue: (r) => r.value, cell: (r) => <FormattedNumber value={r.value} format="currency" currency="USD" minorUnits={false} maximumFractionDigits={0} /> }]} />
|
|
81
|
+
* </SavedViews>
|
|
82
|
+
* ```
|
|
71
83
|
*/
|
|
72
84
|
export declare function SavedViews({ views: v, children, 'aria-label': label, className }: SavedViewsProps): React.JSX.Element;
|
|
@@ -47,6 +47,14 @@ export interface ScatterChartProps {
|
|
|
47
47
|
* customer. Dots are the record, so they lie on the plot: at least 8px, a data-* fill and a marker shape per group, a
|
|
48
48
|
* 2px ring of the plot's own colour so overlapping dots stay apart. Never raised, never shaded. A few can be labelled
|
|
49
49
|
* in ink with a 1px leader, and a least-squares trend drawn as a 1px ink-muted line.
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* import { ChartLegend, ChartLegendContent, ScatterChart } from 'altitude-design';
|
|
53
|
+
*
|
|
54
|
+
* <ScatterChart data={endpoints} x="kb" y="ms" group="service" id="name" name="name" label={(d) => (d.ms > 250 && d.kb < 300 ? d.name : null)} trend>
|
|
55
|
+
* <ChartLegend content={<ChartLegendContent toggle label="Services" />} />
|
|
56
|
+
* </ScatterChart>
|
|
57
|
+
* ```
|
|
50
58
|
*/
|
|
51
59
|
export declare function ScatterChart(props: ScatterChartProps): React.JSX.Element;
|
|
52
60
|
export declare namespace ScatterChart {
|
|
@@ -76,5 +76,26 @@ export interface ScheduleProps<T> {
|
|
|
76
76
|
* A day or week of time whose events you handle directly. The grid is ground; events are live work items raised one
|
|
77
77
|
* level, like BoardCards. Time opens into wells only while something could land in it (carrying or drawing), and the
|
|
78
78
|
* slot under a carried event deepens to a trench the length of the event. A carried event floats at level 3, tilted.
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* import { Schedule } from 'altitude-design';
|
|
82
|
+
*
|
|
83
|
+
* <Schedule aria-label="Room bookings" view="workweek" date={date} onDateChange={setDate} now="2026-10-27T10:20"
|
|
84
|
+
* events={events} getKey={e => e.id} getStart={e => e.start} getEnd={e => e.end} getLabel={e => e.title}
|
|
85
|
+
* dayStart="08:00" dayEnd="18:00"
|
|
86
|
+
* renderEvent={e => <><strong>{e.title}</strong><small className="sch-room">{e.start.slice(11)}–{e.end.slice(11)} · {e.room}</small></>}
|
|
87
|
+
* heldBy={e => e.id === 'e6' ? { name: 'Ana', presence: 2 } : null}
|
|
88
|
+
* // Rooms close at 17:00 on Fridays.
|
|
89
|
+
* isUnavailable={({ start, end }) => start.slice(0, 10) === '2026-10-30' && end.slice(11) > '17:00'}
|
|
90
|
+
* onChange={async ({ id, start, end }) => {
|
|
91
|
+
* await schWait(300);
|
|
92
|
+
* // The demo service refuses Wednesday mornings: the rooms are being cleaned.
|
|
93
|
+
* if (start.slice(0, 10) === '2026-10-28' && start.slice(11) < '12:00') return { ok: false, error: 'Both rooms are being cleaned on Wednesday morning.' };
|
|
94
|
+
* setEvents(list => list.map(e => e.id === id ? { ...e, start, end } : e)); return { ok: true };
|
|
95
|
+
* }}
|
|
96
|
+
* onCreate={async ({ start, end, title }) => { await schWait(300); const event = { id: 'n' + ++seq.current, title, start, end, room: 'Room A' }; setEvents(list => [...list, event]); return { ok: true, value: event }; }}
|
|
97
|
+
* onRename={async (e, title) => { await schWait(200); setEvents(list => list.map(x => x.id === e.id ? { ...x, title } : x)); return { ok: true }; }}
|
|
98
|
+
* onRemove={e => setEvents(list => list.filter(x => x.id !== e.id))} />
|
|
99
|
+
* ```
|
|
79
100
|
*/
|
|
80
101
|
export declare function Schedule<T>({ view: viewProp, narrowView, date, onDateChange, events, getKey, getStart, getEnd, getLabel, step, dayStart, dayEnd, hourHeight: hourHeightProp, weekStartsOn, defaultDuration, renderEvent, onCreate, onChange, onRename, onOpen, onRemove, heldBy, isUnavailable, now, locale, className, ...aria }: ScheduleProps<T>): React.JSX.Element;
|
|
@@ -29,5 +29,11 @@ export interface SecretFieldProps {
|
|
|
29
29
|
* A key or token: shown once when created, masked afterwards. A new secret is an opening, something to take away: a
|
|
30
30
|
* sunk well with copy beside it and a warning, until you say you've saved it; then it fills flush and masks. A stored
|
|
31
31
|
* secret is settled: flush, masked to its tail, with reveal (if allowed), rotate and a held revoke.
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { SecretField } from 'altitude-design';
|
|
35
|
+
*
|
|
36
|
+
* <SecretField label="Secret key" value="ak_live_EXAMPLE0000demo4f2a" once onAcknowledge={() => setSaved(true)} />
|
|
37
|
+
* ```
|
|
32
38
|
*/
|
|
33
39
|
export declare function SecretField({ label, noun, value, once, onAcknowledge, acknowledgeLabel, warning, prefix, maskedTail, onReveal, onRotate, onRevoke, className }: SecretFieldProps): React.JSX.Element;
|
|
@@ -84,6 +84,12 @@ export interface SelectProps extends FieldLike {
|
|
|
84
84
|
* Choosing a value is filling a field, so the trigger is an opening built like Input: its back wall shows while it's
|
|
85
85
|
* empty, its floor rises flush once a value is chosen, and it drops to trench depth when invalid. The list rises from
|
|
86
86
|
* the field's edge at level 3 with one gliding highlight; the chosen option wears the Checkbox family's tick.
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* import { Select } from 'altitude-design';
|
|
90
|
+
*
|
|
91
|
+
* <Select items={regions} placeholder="Choose a region" name="region" />
|
|
92
|
+
* ```
|
|
87
93
|
*/
|
|
88
94
|
export declare function Select({ value, defaultValue, onValueChange, items, children, id, name, required, disabled, invalid, size, placeholder, requiredMessage, defaultOpen, className, presentation, ...aria }: SelectProps): React.JSX.Element;
|
|
89
95
|
export interface ComboboxProps extends FieldLike {
|
|
@@ -104,6 +110,12 @@ export interface ComboboxProps extends FieldLike {
|
|
|
104
110
|
/**
|
|
105
111
|
* An editable Select: type to filter, choose to fill. What you type is a query, not yet a value, so the field stays an
|
|
106
112
|
* opening (its back wall showing) until an option is chosen; then its floor rises flush.
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* import { Combobox } from 'altitude-design';
|
|
116
|
+
*
|
|
117
|
+
* <Combobox items={people} value={who} onValueChange={setWho} placeholder="Search people" />
|
|
118
|
+
* ```
|
|
107
119
|
*/
|
|
108
120
|
export declare function Combobox({ items, value, defaultValue, onValueChange, filter, empty, id, name, required, disabled, invalid, size, placeholder, defaultOpen, className, presentation, ...aria }: ComboboxProps): React.JSX.Element;
|
|
109
121
|
export {};
|
|
@@ -7,5 +7,12 @@ export interface SeparatorProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
7
7
|
/** A word between two lines ("or"). It's read in the flow, so it's never decorative. */
|
|
8
8
|
label?: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
/** A divider on the ground: 1px of `line`, never `line-control` and never a shadow. role="separator" unless decorative.
|
|
10
|
+
/** A divider on the ground: 1px of `line`, never `line-control` and never a shadow. role="separator" unless decorative.
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { Separator } from 'altitude-design';
|
|
14
|
+
*
|
|
15
|
+
* <Separator />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
11
18
|
export declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -17,6 +17,25 @@ export interface SheetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
17
17
|
/**
|
|
18
18
|
* A large sheet laid over the page at level 4, anchored to an edge. It rises at that edge (16px of travel at most,
|
|
19
19
|
* a fade, its shadow growing from elev-1 to elev-4) while the page recedes behind it; closing lifts it off.
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* import { Button, Input, Sheet, SheetDescription, SheetFooter, SheetHeader, SheetTitle } from 'altitude-design';
|
|
23
|
+
*
|
|
24
|
+
* <Sheet side="bottom" size="sm" trigger={<Button>Share</Button>}>
|
|
25
|
+
* <SheetHeader>
|
|
26
|
+
* <SheetTitle>Share Northwind</SheetTitle>
|
|
27
|
+
* <SheetDescription>
|
|
28
|
+
* Anyone with the link can view the latest deployment.
|
|
29
|
+
* </SheetDescription>
|
|
30
|
+
* </SheetHeader>
|
|
31
|
+
* <Input
|
|
32
|
+
* defaultValue="https://acme.dev/n/8dc01b2"
|
|
33
|
+
* readOnly={true}
|
|
34
|
+
* aria-label="Share link"
|
|
35
|
+
* />
|
|
36
|
+
* <SheetFooter><Button variant="primary">Copy link</Button></SheetFooter>
|
|
37
|
+
* </Sheet>
|
|
38
|
+
* ```
|
|
20
39
|
*/
|
|
21
40
|
export declare function Sheet({ open, defaultOpen, onOpenChange, trigger, side, size, modal, dismissible, className, style, children, ...rest }: SheetProps): React.JSX.Element;
|
|
22
41
|
/** The title block. It stays at the top while the sheet scrolls, and rises once content passes under it. */
|
|
@@ -41,6 +41,12 @@ export declare function describeTrend(vals: Array<number | null>, opts: {
|
|
|
41
41
|
* record in the row it sits in, so it lies flush on the ground like everything a chart draws: a 1.5px stroke (or flat
|
|
42
42
|
* bars), no axes, no gridlines, no readout, no fill under the line. Its height is the line height of the text beside
|
|
43
43
|
* it. The last point wears a 4px marker. Colour is context (ink-muted) unless you say it's the series or a status.
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { Sparkline } from 'altitude-design';
|
|
47
|
+
*
|
|
48
|
+
* <Sparkline data={signups} x="day" y="signups" tone="data" width={120} aria-label="Signups, last 30 days" />
|
|
49
|
+
* ```
|
|
44
50
|
*/
|
|
45
51
|
export declare function Sparkline({ data, ...props }: SparklineProps): React.JSX.Element;
|
|
46
52
|
export {};
|
|
@@ -17,5 +17,12 @@ export interface SplitButtonProps extends Omit<ButtonProps, 'variant' | 'childre
|
|
|
17
17
|
* One action with its alternatives: two faces on one slab, sharing one wall and parted by a line notch. The slab lifts
|
|
18
18
|
* and presses as one whichever face is pointed at; the face under the pointer is tinted, so you can tell which action a
|
|
19
19
|
* click takes without the faces splitting into two heights. Alt+Down on the action opens the menu.
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* import { SplitButton } from 'altitude-design';
|
|
23
|
+
*
|
|
24
|
+
* <SplitButton label="Save changes" menuLabel="More save options" onClick={() => setSaid('Saved.')}
|
|
25
|
+
* items={[{ label: 'Save as draft', onSelect: () => setSaid('Saved as a draft.') }, { label: 'Save and close', onSelect: () => setSaid('Saved and closed.') }]} />
|
|
26
|
+
* ```
|
|
20
27
|
*/
|
|
21
28
|
export declare const SplitButton: React.ForwardRefExoticComponent<SplitButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -41,6 +41,13 @@ export interface StatProps extends Omit<React.HTMLAttributes<HTMLElement>, 'chil
|
|
|
41
41
|
* it sits on (a Card, or the page): no level of its own. A changed value cross-fades and the stat gets the afterglow,
|
|
42
42
|
* within the attention budget; it never counts up. The change says its direction in words and with an arrow, and only
|
|
43
43
|
* takes a status colour when you say which direction is good.
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { Stat } from 'altitude-design';
|
|
47
|
+
*
|
|
48
|
+
* <Stat label="Monthly recurring revenue" size="hero" value={mrr} format={usd.format} good="up"
|
|
49
|
+
* change={{ value: 0.042, vs: 'September', previous: 176800 }} help="Paid plans only, before refunds." />
|
|
50
|
+
* ```
|
|
44
51
|
*/
|
|
45
52
|
export declare function Stat({ value, ...props }: StatProps): React.JSX.Element;
|
|
46
53
|
export interface StatGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -22,5 +22,17 @@ export interface StepperProps extends Omit<React.OlHTMLAttributes<HTMLOListEleme
|
|
|
22
22
|
* the record: flush plates with a stamped check. The current step is a raised slab with a wall. Steps to come are imprints
|
|
23
23
|
* pressed into the page. Advancing presses the current step down into the record, stamps its check in, then raises the
|
|
24
24
|
* next one out of its imprint.
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* import { Stepper } from 'altitude-design';
|
|
28
|
+
*
|
|
29
|
+
* <Stepper
|
|
30
|
+
* steps={steps}
|
|
31
|
+
* current={at}
|
|
32
|
+
* onStepChange={setAt}
|
|
33
|
+
* orientation="auto"
|
|
34
|
+
* aria-label="Workspace setup"
|
|
35
|
+
* />
|
|
36
|
+
* ```
|
|
25
37
|
*/
|
|
26
38
|
export declare function Stepper({ steps, current, onStepChange, orientation: orientationProp, className, ...rest }: StepperProps): React.JSX.Element;
|
|
@@ -23,6 +23,16 @@ export interface SuggestionItemProps extends Omit<React.ButtonHTMLAttributes<HTM
|
|
|
23
23
|
* never level 2, since the view's one primary is the composer's Send. Starters sit in an EmptyState; follow-ups sit
|
|
24
24
|
* under an answer and cross-fade in once it's complete. More than four become one toolbar tab stop with arrow keys.
|
|
25
25
|
* After choosing, focus goes to the composer (with the caret at the end, to edit what was filled).
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { Suggestion, Suggestions } from 'altitude-design';
|
|
29
|
+
*
|
|
30
|
+
* <Suggestions aria-label="Start with" onChoose={setDraft}>
|
|
31
|
+
* <Suggestion>Summarise last week's incidents</Suggestion>
|
|
32
|
+
* <Suggestion>Draft a release note</Suggestion>
|
|
33
|
+
* <Suggestion value="Which of my open pull requests are blocked, and by whom?">What's blocked?</Suggestion>
|
|
34
|
+
* </Suggestions>
|
|
35
|
+
* ```
|
|
26
36
|
*/
|
|
27
37
|
export declare function Suggestions({ mode, onChoose, arrive, className, children, ...rest }: SuggestionsProps): React.JSX.Element;
|
|
28
38
|
/** One suggestion: named by its text, plus "sends now" when choosing it sends. */
|
|
@@ -20,5 +20,13 @@ export interface SyncIndicatorProps {
|
|
|
20
20
|
* Whether your work has reached the server, said in words on a flush Badge plate whose lamp relights when the state
|
|
21
21
|
* changes: labels never lift, and a state change cross-fades rather than rises. The items it covers hover as pending
|
|
22
22
|
* until they land, so the global and per-item signals agree. With a queue, the plate opens it (and lifts, because it acts).
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import { Surface, SyncIndicator } from 'altitude-design';
|
|
26
|
+
*
|
|
27
|
+
* <SyncIndicator state={state} pending={waiting.length} lastSyncedAt={at} conflicts={1} onRetry={() => { setState('saving'); setTimeout(() => { setState('saved'); setAt(new Date()); }, 700); }}
|
|
28
|
+
* onOpenConflicts={() => setState('saved')}
|
|
29
|
+
* queue={waiting.length ? waiting.map((w, i) => <Surface key={i} status="pending" className="change">{w}</Surface>) : undefined} />
|
|
30
|
+
* ```
|
|
23
31
|
*/
|
|
24
32
|
export declare function SyncIndicator({ state, pending, conflicts, lastSyncedAt, onRetry, onOpenConflicts, queue, announceEvery, className }: SyncIndicatorProps): React.JSX.Element;
|
|
@@ -52,6 +52,14 @@ export interface TagInputProps {
|
|
|
52
52
|
* A field that holds a set of short values. The field is an opening; each tag is a label stamped flush into its floor
|
|
53
53
|
* like a Badge plate, and once it holds a tag the floor rises flush (filled). The last tag, armed by a first Backspace,
|
|
54
54
|
* lifts one level on a critical tint before a second Backspace takes it off. Suggestions are the Combobox's list.
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* import { TagInput } from 'altitude-design';
|
|
58
|
+
*
|
|
59
|
+
* <TagInput value={labels} onValueChange={setLabels} suggestions={TAG_LABELS} max={6} noun={['label', 'labels']}
|
|
60
|
+
* placeholder="Add a label" normalize={tag => tag.trim().toLowerCase()} validate={tag => tag.length <= 24 ? undefined : 'Use 24 characters or fewer.'}
|
|
61
|
+
* renderTag={tag => <>{TAG_DOTS[tag] && <span className="tags-dot" style={{ '--dot': TAG_DOTS[tag] }} aria-hidden="true" />}{tag}</>} />
|
|
62
|
+
* ```
|
|
55
63
|
*/
|
|
56
64
|
export declare function TagInput({ value, defaultValue, onValueChange, suggestions, restrict, separators, max, validate, normalize, onAdd, onRemove, renderTag, noun, placeholder, id, name, disabled, required, invalid, size, className, ...aria }: TagInputProps): React.JSX.Element;
|
|
57
65
|
export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
@@ -29,5 +29,11 @@ export interface TerminalProps extends Omit<React.HTMLAttributes<HTMLElement>, '
|
|
|
29
29
|
* it isn't the record yet: a dashed rule down the left, "Running", and the output follows its end until you scroll up
|
|
30
30
|
* (then "Jump to latest output" rises). It finishes with one afterglow and its exit in words: "Exited with 0 · 4.2s",
|
|
31
31
|
* with a critical mark when non-zero (the edge stays neutral: #374), or "Stopped by you". stderr lines carry a critical mark and say "stderr".
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { Terminal } from 'altitude-design';
|
|
35
|
+
*
|
|
36
|
+
* <Terminal command="npm test" output={testRun} status="exited" exitCode={1} duration={4200} />
|
|
37
|
+
* ```
|
|
32
38
|
*/
|
|
33
39
|
export declare function Terminal({ command, output, status, exitCode, duration, onStop, stopOnEscape, maxLines, ansi, copyable, className, ...rest }: TerminalProps): React.JSX.Element;
|
|
@@ -14,6 +14,22 @@ export interface ThreadListProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
14
14
|
* pill), and each says its state in words. A working thread isn't pending (nothing you sent is in flight), so it
|
|
15
15
|
* doesn't hover: a plate with a steady lamp says "Working". One that needs you says so on a caution plate, and is
|
|
16
16
|
* announced once; finishing isn't announced. Rename in place, delete with a receipt and Undo.
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { ThreadList, ThreadListGroup, ThreadListItem, groupByDate } from 'altitude-design';
|
|
20
|
+
*
|
|
21
|
+
* <ThreadList searchable onSearch={setQ}>
|
|
22
|
+
* {groupByDate(shown, (t) => t.at, now).map((g) => (
|
|
23
|
+
* <ThreadListGroup key={g.label} label={g.label}>
|
|
24
|
+
* {g.threads.map((t) => (
|
|
25
|
+
* <ThreadListItem key={t.id} href={'#/c/' + t.id} title={t.title} updatedAt={t.at} status={t.status} needs={t.needs} unread={t.unread} current={t.id === at}
|
|
26
|
+
* onSelect={(e) => { e.preventDefault(); setAt(t.id); set(t.id, { unread: false }); }}
|
|
27
|
+
* onRename={(title) => set(t.id, { title })} onDelete={() => {}} onUndoDelete={() => {}} onDeleted={() => setThreads((ts) => ts.filter((x) => x.id !== t.id))} />
|
|
28
|
+
* ))}
|
|
29
|
+
* </ThreadListGroup>
|
|
30
|
+
* ))}
|
|
31
|
+
* </ThreadList>
|
|
32
|
+
* ```
|
|
17
33
|
*/
|
|
18
34
|
export declare function ThreadList({ searchable, onSearch, searchLabel, className, children, ...rest }: ThreadListProps): React.JSX.Element;
|
|
19
35
|
export interface ThreadListGroupProps {
|
|
@@ -29,5 +29,11 @@ export interface TimeInputProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* A time of day, typed by segment like DatePicker's dates. It's an opening that fills only when every segment holds a
|
|
31
31
|
* value: a partial time ("09:__") is still a hole. Hours, minutes and AM/PM are spinbuttons in a labelled group.
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* import { TimeInput } from 'altitude-design';
|
|
35
|
+
*
|
|
36
|
+
* <TimeInput value={report} onValueChange={setReport} step={15} hourCycle="h12" locale="en-US" timeZone="Europe/Berlin" />
|
|
37
|
+
* ```
|
|
32
38
|
*/
|
|
33
39
|
export declare function TimeInput({ value, defaultValue, onValueChange, step, hourCycle, min, max, timeZone, locale, invalid, disabled, required, size, name, id, className, 'aria-describedby': describedBy, ...aria }: TimeInputProps): React.JSX.Element;
|
|
@@ -14,6 +14,15 @@ export interface TimelineProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
14
14
|
* Events in order on one ground line: the 1px ink-muted rule Stepper and the chart baseline stand on, turned upright.
|
|
15
15
|
* Events are flush entries stamped onto it. A new event arrives lifted and settles; one you caused hovers until it
|
|
16
16
|
* lands, or drops to a trench with Retry.
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { Timeline, TimelineItem } from 'altitude-design';
|
|
20
|
+
*
|
|
21
|
+
* <Timeline aria-label="Activity">
|
|
22
|
+
* {events.map((e) => <TimelineItem key={e.id} time={e.at} icon={<I d={icons[e.icon]} />} status={e.status} href={e.href} detail={e.detail}
|
|
23
|
+
* onRetry={() => setEvents((xs) => xs.map((x) => (x.id === e.id ? { ...x, status: 'committed' } : x)))}>{e.text}</TimelineItem>)}
|
|
24
|
+
* </Timeline>
|
|
25
|
+
* ```
|
|
17
26
|
*/
|
|
18
27
|
export declare function Timeline({ groupBy, headingLevel, locale, className, children, 'aria-label': label, ...rest }: TimelineProps): React.JSX.Element;
|
|
19
28
|
export interface TimelineItemProps {
|
|
@@ -10,6 +10,12 @@ export interface ToggleProps extends Omit<ButtonProps, 'variant' | 'onChange'> {
|
|
|
10
10
|
/**
|
|
11
11
|
* A button that stays on. On is a choice, so it's built like the Switch, not like a held press: the face is cut into a
|
|
12
12
|
* shallow well with accent-soft poured in and the label in accent-ink. Its name never changes; aria-pressed says it.
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { Toggle } from 'altitude-design';
|
|
16
|
+
*
|
|
17
|
+
* <Toggle variant="secondary" pressed={archived} onPressedChange={setArchived}>Show archived</Toggle>
|
|
18
|
+
* ```
|
|
13
19
|
*/
|
|
14
20
|
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
21
|
/** Set by Toolbar: a ToggleGroup inside one leaves the arrow keys to it, so the whole bar is one tab stop. */
|
|
@@ -16,6 +16,26 @@ export interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
/**
|
|
17
17
|
* A row of tools with one tab stop. The bar lies on the ground; its tools are ghosts that lift when pointed at, and
|
|
18
18
|
* latched tools are Toggles. Arrow keys move between tools, Home and End jump, and returning lands where you left.
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* import { ToggleGroup, ToggleGroupItem, Toolbar, ToolbarButton, ToolbarGroup, ToolbarSeparator, ToolbarToggle } from 'altitude-design';
|
|
22
|
+
*
|
|
23
|
+
* <Toolbar aria-label="Formatting" overflow="menu" bordered className={className}>
|
|
24
|
+
* <ToggleGroup type="multiple" value={marks} onValueChange={setMarks} aria-label="Text style">
|
|
25
|
+
* <ToggleGroupItem value="bold" aria-label="Bold" square><b>B</b></ToggleGroupItem>
|
|
26
|
+
* <ToggleGroupItem value="italic" aria-label="Italic" square><i>I</i></ToggleGroupItem>
|
|
27
|
+
* <ToggleGroupItem value="underline" aria-label="Underline" square><u>U</u></ToggleGroupItem>
|
|
28
|
+
* </ToggleGroup>
|
|
29
|
+
* <ToolbarSeparator />
|
|
30
|
+
* <ToolbarGroup aria-label="Blocks">
|
|
31
|
+
* <ToolbarButton aria-label="Bulleted list" square><I d={list} /></ToolbarButton>
|
|
32
|
+
* <ToolbarToggle aria-label="Quote" square pressed={quoted} onPressedChange={setQuoted}><I d={quote} /></ToolbarToggle>
|
|
33
|
+
* <ToolbarButton aria-label="Code" square><I d={code} /></ToolbarButton>
|
|
34
|
+
* </ToolbarGroup>
|
|
35
|
+
* <ToolbarSeparator />
|
|
36
|
+
* <ToolbarButton aria-label="Insert link" square><I d={link} /></ToolbarButton>
|
|
37
|
+
* </Toolbar>
|
|
38
|
+
* ```
|
|
19
39
|
*/
|
|
20
40
|
export declare function Toolbar({ orientation, overflow, bordered, className, children, ...rest }: ToolbarProps): React.JSX.Element;
|
|
21
41
|
/** Tools that belong together, parted from the next group by a ToolbarSeparator. */
|
|
@@ -19,5 +19,15 @@ export interface TourProps {
|
|
|
19
19
|
* A few steps pointing at parts of the interface, without taking it over. One step at a time floats at level 3 beside
|
|
20
20
|
* its target, which is marked with a 2px accent-ink ring (a ring, not a lift: it may not be something you press). It
|
|
21
21
|
* never dims the page (receding is the summit's privilege) and isn't modal: the target stays usable.
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { Tour } from 'altitude-design';
|
|
25
|
+
*
|
|
26
|
+
* <Tour open={open} onOpenChange={setOpen} onFinish={(how) => setSaid(how === 'done' ? 'Tour finished.' : 'Tour skipped.')} steps={[
|
|
27
|
+
* { target: '#tour-projects', title: 'Projects moved here', body: 'All your projects now live in one place.' },
|
|
28
|
+
* { target: '[data-tour="owner"]', title: 'Filter by owner', body: 'Type a name to see only their projects.' },
|
|
29
|
+
* { target: '[data-tour="new"]', title: 'Start something new', body: 'Projects can start from a template.' },
|
|
30
|
+
* ]} />
|
|
31
|
+
* ```
|
|
22
32
|
*/
|
|
23
33
|
export declare function Tour({ steps, open, defaultOpen, onOpenChange, onFinish, onStepChange }: TourProps): React.JSX.Element | null;
|
|
@@ -7,6 +7,22 @@ export interface TraceProps extends React.OlHTMLAttributes<HTMLOListElement> {
|
|
|
7
7
|
* The steps an agent takes, drawn as a vertical Stepper: done steps are flush in the record with a stamped check, the
|
|
8
8
|
* running step stands raised on its wall, planned steps are imprints. No spinners. A failed step drops to a trench with
|
|
9
9
|
* Retry; one waiting for approval holds a Confirmation. Steps that start without a plan arrive with the afterglow.
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { Confirmation, Trace, TraceReasoning, TraceStep, TraceToolCall } from 'altitude-design';
|
|
13
|
+
*
|
|
14
|
+
* <Trace aria-label="Agent run: answer refund question">
|
|
15
|
+
* {plan.map((s, i) => (
|
|
16
|
+
* <TraceStep key={s.id} title={s.title} status={status(i)} duration={i < at ? s.ms : undefined}
|
|
17
|
+
* error={failed && i === at ? 'The billing service timed out.' : undefined} onRetry={failed && i === at ? () => { setRetried(true); setFailed(false); } : undefined}>
|
|
18
|
+
* {s.tool && <TraceToolCall name={s.tool.name} input={s.tool.input} output={i < at ? s.tool.output ?? { plan: 'annual', startedDaysAgo: 20 } : undefined} />}
|
|
19
|
+
* {s.reasoning && i < at && <TraceReasoning duration={s.ms}>{s.reasoning}</TraceReasoning>}
|
|
20
|
+
* {s.approval && <Confirmation state={approval} title="Send reply to Jamie Lee" consequence="Jamie will get an email confirming a full refund of €240." approveLabel="Send reply" rejectLabel="Don't send" runningLabel="Sending…" doneLabel="Sent"
|
|
21
|
+
* onApprove={() => { setApproval('running'); setTimeout(() => setApproval('done'), 1000); }} onReject={() => setApproval('rejected')} />}
|
|
22
|
+
* </TraceStep>
|
|
23
|
+
* ))}
|
|
24
|
+
* </Trace>
|
|
25
|
+
* ```
|
|
10
26
|
*/
|
|
11
27
|
export declare function Trace(props: TraceProps): React.JSX.Element;
|
|
12
28
|
export interface TraceParallelProps {
|
|
@@ -66,6 +66,27 @@ export interface TreeProps<T> {
|
|
|
66
66
|
onRemove?: (item: T) => void;
|
|
67
67
|
className?: string;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* import { Tree } from 'altitude-design';
|
|
73
|
+
*
|
|
74
|
+
* <Tree ref={tree} aria-label="Pages" items={pages} getKey={p => p.id} getLabel={p => p.title} getChildren={p => p.children} hasChildren={p => !!p.children}
|
|
75
|
+
* expanded={expanded} onExpandedChange={setExpanded} selected={selected} onSelectedChange={setSelected}
|
|
76
|
+
* renderItem={p => <><span className="tree-demo-icon" aria-hidden="true">{p.children ? <FolderIcon /> : <PageIcon />}</span>{p.title}</>}
|
|
77
|
+
* onRename={async (page, title) => { await treeWait(250); if (title.length > 40) return { ok: false, error: 'Use 40 characters or fewer.' }; setPages(list => treeRename(list, page.id, title.trim())); return { ok: true }; }}
|
|
78
|
+
* canDrop={({ to }) => to.parentId === null || !!treeFind(pages, to.parentId).page.children}
|
|
79
|
+
* onMove={async ({ id, to }) => {
|
|
80
|
+
* await treeWait(250);
|
|
81
|
+
* // The demo service refuses to move anything out of Archive.
|
|
82
|
+
* if (treeFind(pages, id).parent === 'archive' && to.parentId !== 'archive') return { ok: false, error: 'Archived pages can’t be moved out of Archive.' };
|
|
83
|
+
* setPages(list => { const page = treeFind(list, id).page; return treeInsert(treeRemove(list, id), to.parentId, to.index, page); });
|
|
84
|
+
* return { ok: true };
|
|
85
|
+
* }}
|
|
86
|
+
* onCreate={async ({ parentId, index, name }) => { await treeWait(250); const page = { id: 'new-' + ++seq.current, title: name }; setPages(list => treeInsert(list, parentId, index, page)); return { ok: true, value: page }; }}
|
|
87
|
+
* onRemove={page => setPages(list => treeRemove(list, page.id))} />
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
69
90
|
export declare const Tree: <T>(props: TreeProps<T> & {
|
|
70
91
|
ref?: React.Ref<TreeHandle>;
|
|
71
92
|
}) => React.ReactElement;
|