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
|
@@ -74,6 +74,12 @@ export interface BarChartProps {
|
|
|
74
74
|
* Amounts compared across categories, as lengths standing on the ground line. Bars are the record: flat fills in
|
|
75
75
|
* their series' colours, square at the ground and rounded only at the data end, never shadowed or lifted. One
|
|
76
76
|
* series, several side by side, or stacked into a total.
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* import { BarChart } from 'altitude-design';
|
|
80
|
+
*
|
|
81
|
+
* <BarChart data={teams} x="team" sort="desc" labels="max" focus={(d) => d.team === 'Cedar' || d.team === 'Delta'} />
|
|
82
|
+
* ```
|
|
77
83
|
*/
|
|
78
84
|
export declare function BarChart({ stack, labels, compare }: BarChartProps): React.JSX.Element | null;
|
|
79
85
|
export declare namespace BarChart {
|
|
@@ -31,5 +31,11 @@ export interface BarListProps extends Omit<React.HTMLAttributes<HTMLOListElement
|
|
|
31
31
|
* table's; each carries a flat data-1 bar behind its label, its length the row's value against the largest, faint
|
|
32
32
|
* enough that ink holds 4.5:1 over it. A row that does something (a link, a button) lifts one level when pointed at,
|
|
33
33
|
* as Table's rows do; its bar stays flat on it. When values change, rows are carried to their new ranks all at once.
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* import { BarList } from 'altitude-design';
|
|
37
|
+
*
|
|
38
|
+
* <BarList aria-labelledby="bl-pages" data={pages.map((p) => ({ ...p, href: '#' + p.name }))} limit={7} share noun="pages" />
|
|
39
|
+
* ```
|
|
34
40
|
*/
|
|
35
41
|
export declare function BarList(props: BarListProps): React.JSX.Element;
|
|
@@ -37,6 +37,12 @@ export interface BreadcrumbProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
37
37
|
* Where you are, as a staircase: every step stands on one ground line and each deeper place is a taller step, as in
|
|
38
38
|
* Drilldown (without its pile: a route change lays no sheet). Steps you can go back to lift when pointed at; the current
|
|
39
39
|
* page is a step that doesn't press. A route change re-renders it without motion: a new route isn't an arrival.
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* import { Breadcrumb } from 'altitude-design';
|
|
43
|
+
*
|
|
44
|
+
* <Breadcrumb items={[{ label: 'Settings', href: '#/settings' }, { label: 'Members', href: '#/settings/members' }, { label: 'Jane Doe' }]} />
|
|
45
|
+
* ```
|
|
40
46
|
*/
|
|
41
47
|
export declare function Breadcrumb({ items, maxItems, fit, renderLink, onNavigate, className, children, 'aria-label': label, ...rest }: BreadcrumbProps): React.JSX.Element;
|
|
42
48
|
/** The ordered list of steps. Each BreadcrumbItem inside it gets its depth from its place. */
|
|
@@ -24,6 +24,12 @@ interface BrushWiring {
|
|
|
24
24
|
* opening, the whole series drawn as a flat line in a trench, because it's a track you slide along; the window is a raised lens
|
|
25
25
|
* over it (level 1, accent rim, clear face) whose two grips are a range Slider's thumbs. Outside the window the overview
|
|
26
26
|
* recedes. Drag the lens to pan, a grip to resize, or press outside it to centre the window there.
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* import { ChartBrush } from 'altitude-design';
|
|
30
|
+
*
|
|
31
|
+
* <ChartBrush />
|
|
32
|
+
* ```
|
|
27
33
|
*/
|
|
28
34
|
export declare function ChartBrush({ __brush, ...props }: ChartBrushProps & {
|
|
29
35
|
__brush?: BrushWiring;
|
|
@@ -340,6 +340,12 @@ export declare function ChartTooltipContent({ indicator, labelFormat, hideLabel,
|
|
|
340
340
|
/**
|
|
341
341
|
* Puts your own content in a chart's readout. The readout is on for every chart by default; this only changes what it
|
|
342
342
|
* shows. Place it inside the chart type or the container: `<ChartTooltip content={<ChartTooltipContent indicator="dot" />} />`.
|
|
343
|
+
* @example
|
|
344
|
+
* ```tsx
|
|
345
|
+
* import { ChartTooltip, ChartTooltipContent } from 'altitude-design';
|
|
346
|
+
*
|
|
347
|
+
* <ChartTooltip content={<ChartTooltipContent indicator="dot" labelFormat={(w) => 'Week of ' + long.format(new Date(w + 'T00:00:00Z'))} />} />
|
|
348
|
+
* ```
|
|
343
349
|
*/
|
|
344
350
|
export declare function ChartTooltip(_: {
|
|
345
351
|
content?: React.ReactElement<ChartTooltipContentProps>;
|
|
@@ -383,7 +389,14 @@ export interface ChartLegendContentProps {
|
|
|
383
389
|
* stop; ←/→ between keys), each an aria-pressed button; the last shown series can't be hidden.
|
|
384
390
|
*/
|
|
385
391
|
export declare function ChartLegendContent({ toggle, label, items, swatch, onToggle }: ChartLegendContentProps): React.JSX.Element;
|
|
386
|
-
/** A legend for the chart: place it inside the chart type or the container, with its content.
|
|
392
|
+
/** A legend for the chart: place it inside the chart type or the container, with its content.
|
|
393
|
+
* @example
|
|
394
|
+
* ```tsx
|
|
395
|
+
* import { ChartLegend, ChartLegendContent } from 'altitude-design';
|
|
396
|
+
*
|
|
397
|
+
* <ChartLegend content={<ChartLegendContent />} />
|
|
398
|
+
* ```
|
|
399
|
+
*/
|
|
387
400
|
export declare function ChartLegend(_: {
|
|
388
401
|
content?: React.ReactElement<ChartLegendContentProps>;
|
|
389
402
|
}): null;
|
|
@@ -426,6 +439,12 @@ export interface ChartReferenceProps {
|
|
|
426
439
|
* solid (dashes mean "projected"), labelled at its right end; a band is a flat line-coloured fill, labelled inside.
|
|
427
440
|
* Place it inside the chart type or the container. The container draws it, so labels stay clear of each other and of
|
|
428
441
|
* the marks.
|
|
442
|
+
* @example
|
|
443
|
+
* ```tsx
|
|
444
|
+
* import { ChartReference } from 'altitude-design';
|
|
445
|
+
*
|
|
446
|
+
* <ChartReference y={[0.995, 1]} label="Normal range" />
|
|
447
|
+
* ```
|
|
429
448
|
*/
|
|
430
449
|
export declare function ChartReference(_: ChartReferenceProps): null;
|
|
431
450
|
export declare namespace ChartReference {
|
|
@@ -566,5 +585,14 @@ export interface ChartEmpty {
|
|
|
566
585
|
* would lift bars off the ground line and misstate every value. `null` or `[]`: an EmptyState in the plot. A new
|
|
567
586
|
* promise (or `refreshing`) while data shows: the old chart stays, at half strength after dur-grace. A rejected
|
|
568
587
|
* promise goes to your error boundary.
|
|
588
|
+
* @example
|
|
589
|
+
* ```tsx
|
|
590
|
+
* import { ChartContainer } from 'altitude-design';
|
|
591
|
+
*
|
|
592
|
+
* <ChartContainer aria-labelledby="rc" data={months} x="month" aspect={1.7} summary="Revenue rose 44% while costs held flat."
|
|
593
|
+
* config={{ revenue: { label: 'Revenue', format: usd.format }, costs: { label: 'Costs', format: usd.format } }}>
|
|
594
|
+
* <Lines />
|
|
595
|
+
* </ChartContainer>
|
|
596
|
+
* ```
|
|
569
597
|
*/
|
|
570
598
|
export declare function ChartContainer(props: ChartContainerProps): React.JSX.Element;
|
|
@@ -67,5 +67,11 @@ export interface ChecklistProps<T> {
|
|
|
67
67
|
* A list you write into, one line per item. Each line is the editor (no Save, no read mode): it commits when you
|
|
68
68
|
* leave it. Items lie flush; the empty line at the end is an opening; the checkbox is a choice built like the Switch,
|
|
69
69
|
* and a done item is pressed into the record: muted and struck through, kept in place.
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* import { Checklist } from 'altitude-design';
|
|
73
|
+
*
|
|
74
|
+
* <Checklist aria-labelledby="cl-launch" nested {...props} {...launch} />
|
|
75
|
+
* ```
|
|
70
76
|
*/
|
|
71
77
|
export declare function Checklist<T>({ items, getKey, getText, isDone, getChildren, nested, sortDone, onChange, onUndo, createId, placeholder, disabled, className, ...aria }: ChecklistProps<T>): React.JSX.Element;
|
|
@@ -28,5 +28,11 @@ export interface CodeBlockProps extends Omit<React.HTMLAttributes<HTMLElement>,
|
|
|
28
28
|
/**
|
|
29
29
|
* Code shown to read and copy is the record: it lies flush on the ground with a line rim, in mono, with no shadow.
|
|
30
30
|
* Several forms of the same thing switch with segmented Tabs; copy is a CopyButton; code still arriving has a dashed rule.
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* import { CodeBlock } from 'altitude-design';
|
|
34
|
+
*
|
|
35
|
+
* <CodeBlock title="Install" tabs={[{ label: 'npm', language: 'sh', code: 'npm install altitude-design' }, { label: 'pnpm', language: 'sh', code: 'pnpm add altitude-design' }, { label: 'yarn', language: 'sh', code: 'yarn add altitude-design' }]} />
|
|
36
|
+
* ```
|
|
31
37
|
*/
|
|
32
38
|
export declare function CodeBlock({ code, language, title, tabs, highlight, syntax, lineNumbers, streaming, maxHeight, copyable, className, ...rest }: CodeBlockProps): React.JSX.Element;
|
|
@@ -188,6 +188,21 @@ export interface BoardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
188
188
|
/**
|
|
189
189
|
* Columns of cards. Columns are receptacles: flush at rest, they open into wells while a card is carried, and the one
|
|
190
190
|
* under it deepens. Cards are raised; one picked up floats at level 3, tilted, follows the pointer, and lands with a settle.
|
|
191
|
+
* @example
|
|
192
|
+
* ```tsx
|
|
193
|
+
* import { Board, BoardCard, BoardColumn, Field, Input } from 'altitude-design';
|
|
194
|
+
*
|
|
195
|
+
* <Board onMove={move} aria-label="Launch board">
|
|
196
|
+
* {Object.keys(titles).map(k => <BoardColumn key={k} id={k} title={titles[k]} collapsible={k === "done"} defaultCollapsed={k === "done"} onCreate={k === "done" ? undefined : create(k)}>
|
|
197
|
+
* {cols[k].map(c => <BoardCard key={c.id} id={c.id} label={c.t} heldBy={c.held} onRename={rename(k, c.id)}
|
|
198
|
+
* {...(k === "review" ? { value: { title: c.t, meta: c.m }, onValueChange: update(k, c.id),
|
|
199
|
+
* renderEditor: field => <><Field label="Title"><Input {...field("title")} size="sm" /></Field><Field label="Details"><Input {...field("meta")} size="sm" /></Field></>,
|
|
200
|
+
* onSave: async draft => { await wait(200); return refuse(draft.title) || { ok: true, value: draft }; } } : {})}>
|
|
201
|
+
* {c.t}<small>{c.m}</small>
|
|
202
|
+
* </BoardCard>)}
|
|
203
|
+
* </BoardColumn>)}
|
|
204
|
+
* </Board>
|
|
205
|
+
* ```
|
|
191
206
|
*/
|
|
192
207
|
export declare const Board: React.ForwardRefExoticComponent<BoardProps & React.RefAttributes<HTMLDivElement>>;
|
|
193
208
|
export interface BoardColumnProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
@@ -34,5 +34,11 @@ export interface ColorPickerProps {
|
|
|
34
34
|
* A brand or label colour: swatches as choices (trenches the colour pours into, one travelling mark), and, if allowed,
|
|
35
35
|
* a hex field that fills when it holds a whole colour and a full picker in a Popover. A contrast check says in words
|
|
36
36
|
* whether text on the colour passes, because the accent carries text.
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* import { ColorPicker } from 'altitude-design';
|
|
40
|
+
*
|
|
41
|
+
* <ColorPicker label="Brand colour" value={color} onValueChange={setColor} swatches={brand} allowCustom checkContrast />
|
|
42
|
+
* ```
|
|
37
43
|
*/
|
|
38
44
|
export declare function ColorPicker({ label, value, defaultValue, onValueChange, swatches, allowCustom, checkContrast, className }: ColorPickerProps): React.JSX.Element;
|
|
@@ -62,5 +62,18 @@ export declare function commandScore(text: string, query: string): number;
|
|
|
62
62
|
* The summit: a level-5 search over everything you can do, opened with ⌘K or Ctrl+K. The page recedes behind it
|
|
63
63
|
* as it does for Dialog. The query field is an opening built like Input; one highlight glides between results;
|
|
64
64
|
* when results change, surviving rows travel to their new places and new ones rise in, a few at a time.
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* import { CommandPalette } from 'altitude-design';
|
|
68
|
+
*
|
|
69
|
+
* <CommandPalette
|
|
70
|
+
* open={open}
|
|
71
|
+
* onOpenChange={onOpenChange}
|
|
72
|
+
* query={text}
|
|
73
|
+
* onQueryChange={setText}
|
|
74
|
+
* items={groups}
|
|
75
|
+
* onSelect={(item) => setLast(item.label)}
|
|
76
|
+
* />
|
|
77
|
+
* ```
|
|
65
78
|
*/
|
|
66
79
|
export declare function CommandPalette({ items, open, defaultOpen, onOpenChange, onSelect, placeholder, filter, empty, shortcut, query: queryProp, defaultQuery, onQueryChange, closeOnSelect, hints: hintsProp, className, ...rest }: CommandPaletteProps): React.JSX.Element | null;
|
|
@@ -44,5 +44,16 @@ export interface CommentThreadProps {
|
|
|
44
44
|
* Comments on a record. Posted comments are the record, flush on the ground; the composer is an opening that fills; a
|
|
45
45
|
* comment being posted hovers until it lands, or drops to a trench keeping its text. A resolved thread is stamped like a
|
|
46
46
|
* done Checklist item: muted, collapsed to one line, kept in place. Mentions are a listbox at level 3.
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* import { CommentThread } from 'altitude-design';
|
|
50
|
+
*
|
|
51
|
+
* <CommentThread comments={comments} resolved={resolved ? { by: 'You' } : false} onPost={post}
|
|
52
|
+
* onResolve={() => setResolved(true)} onReopen={() => setResolved(false)}
|
|
53
|
+
* onRetry={(id) => setComments((xs) => xs.map((x) => (x.id === id ? { ...x, status: undefined } : x)))}
|
|
54
|
+
* onDelete={(id) => setComments((xs) => xs.map((x) => (x.id === id ? { ...x, deleted: true } : x)))}
|
|
55
|
+
* onUndoDelete={(id) => setComments((xs) => xs.map((x) => (x.id === id ? { ...x, deleted: false } : x)))}
|
|
56
|
+
* mentionable={(q) => people.filter((p) => p.name.toLowerCase().includes(q.toLowerCase()))} typing={resolved ? [] : ['Ada Obi']} />
|
|
57
|
+
* ```
|
|
47
58
|
*/
|
|
48
59
|
export declare function CommentThread({ comments, resolved, onPost, onResolve, onReopen, onRetry, onDelete, onUndoDelete, mentionable, typing, 'aria-label': label, className }: CommentThreadProps): React.JSX.Element;
|
|
@@ -56,5 +56,13 @@ export interface ConfirmationProps {
|
|
|
56
56
|
* (Alert's raised rule), naming the consequence, with Approve and Reject. Nothing has been dispatched, so it mustn't
|
|
57
57
|
* hover. Once approved it becomes a pending write (hovers), then lands or drops to a trench. Rejected and expired are
|
|
58
58
|
* flush and muted, kept in the record.
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* import { Confirmation } from 'altitude-design';
|
|
62
|
+
*
|
|
63
|
+
* <Confirmation state={state} title={title} consequence={consequence} escalate={escalate} approveLabel={approveLabel} rejectLabel={rejectLabel}
|
|
64
|
+
* runningLabel={runningLabel} doneLabel={doneLabel} failedLabel={failedLabel} resolvedBy="you" resolvedAt={at} scopes={scopes} resolvedScope={scope}
|
|
65
|
+
* onApprove={approve} onReject={() => { setState('rejected'); setAt(new Date()); }} onRetry={() => { setState('running'); setTimeout(() => { setState('done'); setAt(new Date()); }, 1000); }} />
|
|
66
|
+
* ```
|
|
59
67
|
*/
|
|
60
68
|
export declare function Confirmation({ state, title, consequence, details, approveLabel, rejectLabel, runningLabel, doneLabel, failedLabel, escalate, resolvedBy, resolvedAt, requestedBy, scopes, resolvedScope, edit, edited, onEditCancel, onApprove, onReject, onRetry, className }: ConfirmationProps): React.JSX.Element;
|
|
@@ -13,5 +13,16 @@ export interface ContextMenuProps {
|
|
|
13
13
|
* Actions on a thing, opened where you right-click or long-press it, or at it with Shift+F10 or the Menu key. The menu
|
|
14
14
|
* is DropdownMenu's, at level 3; the thing shows it's the subject with a 2px accent-ink outline, never a height, so a
|
|
15
15
|
* flush row doesn't lift out of its table. Every action here must also be reachable another way.
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { Button, ContextMenu, DropdownMenu, Icons } from 'altitude-design';
|
|
19
|
+
*
|
|
20
|
+
* <ContextMenu key={f} items={() => actions(f)}>
|
|
21
|
+
* <div className="file" role="listitem" tabIndex={0}>
|
|
22
|
+
* <span className="name">{f}</span><span className="meta">Edited 2 days ago</span>
|
|
23
|
+
* <DropdownMenu align="end" items={actions(f)} trigger={<Button variant="ghost" size="sm" square aria-label={`Actions for ${f}`}><Icons.More /></Button>} />
|
|
24
|
+
* </div>
|
|
25
|
+
* </ContextMenu>
|
|
26
|
+
* ```
|
|
16
27
|
*/
|
|
17
28
|
export declare function ContextMenu({ items, children, 'aria-label': label, onOpenChange }: ContextMenuProps): React.JSX.Element;
|
|
@@ -10,6 +10,14 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
10
10
|
leading?: React.ReactNode;
|
|
11
11
|
trailing?: React.ReactNode;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { Button } from 'altitude-design';
|
|
17
|
+
*
|
|
18
|
+
* <Button variant="primary">Publish changes</Button>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
13
21
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
22
|
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, DepthProps {
|
|
15
23
|
/** Lifts on hover and presses on click. Only set it when the whole card does something. */
|
|
@@ -21,6 +29,17 @@ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, DepthPr
|
|
|
21
29
|
*/
|
|
22
30
|
skeleton?: SkeletonOption;
|
|
23
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'altitude-design';
|
|
36
|
+
*
|
|
37
|
+
* <Card>
|
|
38
|
+
* <CardHeader><CardTitle>Usage this month</CardTitle><CardDescription>Static: a grouping surface, it never lifts.</CardDescription></CardHeader>
|
|
39
|
+
* <CardContent>18,240 requests · 62% of plan</CardContent>
|
|
40
|
+
* </Card>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
24
43
|
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
44
|
export declare const CardHeader: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
26
45
|
/**
|
|
@@ -59,6 +78,14 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
59
78
|
trailing?: React.ReactNode;
|
|
60
79
|
size?: 'sm' | 'md';
|
|
61
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* import { Input } from 'altitude-design';
|
|
85
|
+
*
|
|
86
|
+
* <Input type="email" placeholder="name@company.com" value={email} onChange={(e) => setEmail(e.target.value)} />
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
62
89
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
63
90
|
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, SuggestionProps {
|
|
64
91
|
invalid?: boolean;
|
|
@@ -76,6 +103,16 @@ export interface FieldProps {
|
|
|
76
103
|
className?: string;
|
|
77
104
|
children: React.ReactElement<any>;
|
|
78
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* import { Field, Input } from 'altitude-design';
|
|
110
|
+
*
|
|
111
|
+
* <Field label="Workspace name" hint="Shown to everyone you invite.">
|
|
112
|
+
* <Input defaultValue="Northwind Studio" />
|
|
113
|
+
* </Field>
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
79
116
|
export declare function Field({ label, hint, error, required, className, children }: FieldProps): React.JSX.Element;
|
|
80
117
|
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange'> {
|
|
81
118
|
label?: React.ReactNode;
|
|
@@ -84,7 +121,14 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
84
121
|
onCheckedChange?: (checked: boolean) => void;
|
|
85
122
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
86
123
|
}
|
|
87
|
-
/** Built like the Switch and RadioGroup: an empty trench when off; checking pours the accent in and sets a raised white check on it.
|
|
124
|
+
/** Built like the Switch and RadioGroup: an empty trench when off; checking pours the accent in and sets a raised white check on it.
|
|
125
|
+
* @example
|
|
126
|
+
* ```tsx
|
|
127
|
+
* import { Checkbox } from 'altitude-design';
|
|
128
|
+
*
|
|
129
|
+
* <Checkbox label="Select all" checked={a && b} indeterminate={a !== b} onCheckedChange={(c) => { setA(c); setB(c); }} />
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
88
132
|
export declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
89
133
|
export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
90
134
|
value?: string;
|
|
@@ -94,7 +138,18 @@ export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
94
138
|
disabled?: boolean;
|
|
95
139
|
orientation?: 'vertical' | 'horizontal';
|
|
96
140
|
}
|
|
97
|
-
/** A switch with several positions: one raised thumb slides to the chosen option and the accent pours in behind it.
|
|
141
|
+
/** A switch with several positions: one raised thumb slides to the chosen option and the accent pours in behind it.
|
|
142
|
+
* @example
|
|
143
|
+
* ```tsx
|
|
144
|
+
* import { Radio, RadioGroup } from 'altitude-design';
|
|
145
|
+
*
|
|
146
|
+
* <RadioGroup defaultValue="team" aria-label="Plan">
|
|
147
|
+
* <Radio value="solo" label="Solo" description="One seat, unlimited projects." />
|
|
148
|
+
* <Radio value="team" label="Team" description="Up to 20 seats and shared libraries." />
|
|
149
|
+
* <Radio value="org" label="Organization" disabled description="Talk to us." />
|
|
150
|
+
* </RadioGroup>
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
98
153
|
export declare function RadioGroup({ value, defaultValue, onValueChange, name, disabled, orientation, className, children, ...rest }: RadioGroupProps): React.JSX.Element;
|
|
99
154
|
export interface RadioProps {
|
|
100
155
|
value: string;
|
|
@@ -110,6 +165,14 @@ export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonE
|
|
|
110
165
|
onCheckedChange?: (v: boolean) => void;
|
|
111
166
|
label?: React.ReactNode;
|
|
112
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* @example
|
|
170
|
+
* ```tsx
|
|
171
|
+
* import { Switch } from 'altitude-design';
|
|
172
|
+
*
|
|
173
|
+
* <Switch label="Sync across devices" defaultChecked />
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
113
176
|
export declare function Switch({ checked, defaultChecked, onCheckedChange, label, className, disabled, ...rest }: SwitchProps): React.JSX.Element;
|
|
114
177
|
export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
|
|
115
178
|
value?: string;
|
|
@@ -121,6 +184,25 @@ export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'd
|
|
|
121
184
|
*/
|
|
122
185
|
variant?: 'folder' | 'segmented';
|
|
123
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* @example
|
|
189
|
+
* ```tsx
|
|
190
|
+
* import { Tabs, TabsContent, TabsList, TabsTrigger } from 'altitude-design';
|
|
191
|
+
*
|
|
192
|
+
* <Tabs defaultValue="overview">
|
|
193
|
+
* <TabsList aria-label="Project">
|
|
194
|
+
* <TabsTrigger value="overview">Overview</TabsTrigger>
|
|
195
|
+
* <TabsTrigger value="activity">Activity</TabsTrigger>
|
|
196
|
+
* <TabsTrigger value="settings">Settings</TabsTrigger>
|
|
197
|
+
* <TabsTrigger value="members">Members</TabsTrigger>
|
|
198
|
+
* </TabsList>
|
|
199
|
+
* <TabsContent value="overview"><p className="body">Three deployments this week. Everything is healthy.</p></TabsContent>
|
|
200
|
+
* <TabsContent value="activity"><p className="body">Mara merged “Faster cold starts” 2 hours ago.</p></TabsContent>
|
|
201
|
+
* <TabsContent value="settings"><p className="body">Region, domains and environment variables.</p></TabsContent>
|
|
202
|
+
* <TabsContent value="members"><p className="body">Six people have access to this project.</p></TabsContent>
|
|
203
|
+
* </Tabs>
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
124
206
|
export declare function Tabs({ value, defaultValue, onValueChange, variant, className, children, ...rest }: TabsProps): React.JSX.Element;
|
|
125
207
|
export declare function TabsList({ className, children, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
126
208
|
export declare function TabsTrigger({ value, className, children, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
@@ -152,6 +234,14 @@ export interface SliderRangeProps extends Omit<SliderProps, 'value' | 'defaultVa
|
|
|
152
234
|
/** A name per thumb, or one name for the pair (each thumb is then "<name>, minimum" and "<name>, maximum"). */
|
|
153
235
|
'aria-label'?: string | [string, string];
|
|
154
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* @example
|
|
239
|
+
* ```tsx
|
|
240
|
+
* import { Slider } from 'altitude-design';
|
|
241
|
+
*
|
|
242
|
+
* <Slider value={v} onValueChange={setV} aria-label="Volume" format={(n) => n + '%'} />
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
155
245
|
export declare function Slider(props: SliderProps): React.ReactElement;
|
|
156
246
|
export declare function Slider(props: SliderRangeProps): React.ReactElement;
|
|
157
247
|
/** Two values on one track: what the range Slider and ChartBrush share. A thumb can't cross the other or come within
|
|
@@ -185,6 +275,14 @@ export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
185
275
|
max?: number;
|
|
186
276
|
'aria-label'?: string;
|
|
187
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* @example
|
|
280
|
+
* ```tsx
|
|
281
|
+
* import { Progress } from 'altitude-design';
|
|
282
|
+
*
|
|
283
|
+
* <Progress value={v} aria-label="Upload" />
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
188
286
|
export declare function Progress({ value, max, className, ...rest }: ProgressProps): React.JSX.Element;
|
|
189
287
|
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
190
288
|
tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';
|
|
@@ -203,7 +301,14 @@ export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>,
|
|
|
203
301
|
/** While the label is on its way: the imprint's `width` (default 64px; a count is round). `false`: render what you pass as it is, and let promises suspend to your own boundary. */
|
|
204
302
|
skeleton?: SkeletonOption;
|
|
205
303
|
}
|
|
206
|
-
/** A label stamped into the record. Status carries a lamp that relights when it changes; a changed label is re-stamped.
|
|
304
|
+
/** A label stamped into the record. Status carries a lamp that relights when it changes; a changed label is re-stamped.
|
|
305
|
+
* @example
|
|
306
|
+
* ```tsx
|
|
307
|
+
* import { Badge } from 'altitude-design';
|
|
308
|
+
*
|
|
309
|
+
* <Badge lamp>Draft</Badge>
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
207
312
|
export declare function Badge({ children, skeleton, ...props }: BadgeProps): React.JSX.Element;
|
|
208
313
|
export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
209
314
|
/** The accessible label. Undefined while your data loads (`user?.name`), or a promise: until it arrives the avatar is an imprint of its size and shape. */
|
|
@@ -225,7 +330,14 @@ export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
225
330
|
/** `false`: no imprint. An undefined `name` renders an empty face; a promised one suspends to your own boundary. */
|
|
226
331
|
skeleton?: boolean;
|
|
227
332
|
}
|
|
228
|
-
/** A disc resting on the page while the person is here, flush in it when they're not; live, it lifts off its shadow.
|
|
333
|
+
/** A disc resting on the page while the person is here, flush in it when they're not; live, it lifts off its shadow.
|
|
334
|
+
* @example
|
|
335
|
+
* ```tsx
|
|
336
|
+
* import { Avatar } from 'altitude-design';
|
|
337
|
+
*
|
|
338
|
+
* <Avatar name="Mara Quist" size={44} status="active" live presence={1} />
|
|
339
|
+
* ```
|
|
340
|
+
*/
|
|
229
341
|
export declare function Avatar({ skeleton, ...props }: AvatarProps): React.JSX.Element;
|
|
230
342
|
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
231
343
|
/** Show at most this many faces; the rest become a "+N" plate that names them. */
|
|
@@ -245,7 +357,14 @@ export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
245
357
|
height?: number | string;
|
|
246
358
|
radius?: string;
|
|
247
359
|
}
|
|
248
|
-
/** An imprint of the content to come, pressed into the page; when the content arrives it rises out of its imprint.
|
|
360
|
+
/** An imprint of the content to come, pressed into the page; when the content arrives it rises out of its imprint.
|
|
361
|
+
* @example
|
|
362
|
+
* ```tsx
|
|
363
|
+
* import { Avatar, Skeleton } from 'altitude-design';
|
|
364
|
+
*
|
|
365
|
+
* <Skeleton loaded={loaded} shape="circle" width={44}><Avatar name="Mara Quist" size={44} status="active" /></Skeleton>
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
249
368
|
export declare function Skeleton({ loaded, shape, lines, width, height, radius, className, style, children, ...rest }: SkeletonProps): React.JSX.Element;
|
|
250
369
|
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, Pick<DepthProps, 'settle'> {
|
|
251
370
|
tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';
|
|
@@ -263,7 +382,15 @@ export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
263
382
|
/** With placement="page": stays at the top while the page scrolls. */
|
|
264
383
|
sticky?: boolean;
|
|
265
384
|
}
|
|
266
|
-
/** Status as a sheet laid on the page: it rests on the ground (you can see its edge and its contact shadow) and never floats. When it asks the person to act it becomes a raised card.
|
|
385
|
+
/** Status as a sheet laid on the page: it rests on the ground (you can see its edge and its contact shadow) and never floats. When it asks the person to act it becomes a raised card.
|
|
386
|
+
* @example
|
|
387
|
+
* ```tsx
|
|
388
|
+
* import { Alert, Button } from 'altitude-design';
|
|
389
|
+
*
|
|
390
|
+
* <Alert placement="page" tone="caution" variant="raised" title="Your trial ends in 3 days" action={<Button variant="primary" size="sm">Choose a plan</Button>}
|
|
391
|
+
* onDismiss={() => setTrial(false)} dismissLabel="Remind me tomorrow" />
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
267
394
|
export declare function Alert({ tone, variant, title, action, icon, onDismiss, dismissLabel, placement, sticky, settle, className, style, children, ...rest }: AlertProps): React.JSX.Element;
|
|
268
395
|
export interface AlertStackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
269
396
|
/** Alert elements, most important first. Give each a key. */
|
|
@@ -293,6 +420,14 @@ export interface AccordionProps extends Omit<React.HTMLAttributes<HTMLDivElement
|
|
|
293
420
|
type?: 'single' | 'multiple';
|
|
294
421
|
defaultValue?: string[];
|
|
295
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* @example
|
|
425
|
+
* ```tsx
|
|
426
|
+
* import { Accordion } from 'altitude-design';
|
|
427
|
+
*
|
|
428
|
+
* <Accordion items={items} defaultValue={['b']} />
|
|
429
|
+
* ```
|
|
430
|
+
*/
|
|
296
431
|
export declare function Accordion({ items, type, defaultValue, className, ...rest }: AccordionProps): React.JSX.Element;
|
|
297
432
|
export interface HoldButtonProps extends Omit<ButtonProps, 'loading'> {
|
|
298
433
|
/** Called once the button has been held for `duration`. */
|
|
@@ -307,7 +442,14 @@ export interface HoldButtonProps extends Omit<ButtonProps, 'loading'> {
|
|
|
307
442
|
*/
|
|
308
443
|
repeatable?: boolean;
|
|
309
444
|
}
|
|
310
|
-
/** Commitment as depth: holding pushes the button down through the ground into a trench. Let go early and it springs back.
|
|
445
|
+
/** Commitment as depth: holding pushes the button down through the ground into a trench. Let go early and it springs back.
|
|
446
|
+
* @example
|
|
447
|
+
* ```tsx
|
|
448
|
+
* import { HoldButton } from 'altitude-design';
|
|
449
|
+
*
|
|
450
|
+
* <HoldButton onConfirm={() => {}} holdingLabel="Keep holding…" doneLabel="Project deleted">Hold to delete</HoldButton>
|
|
451
|
+
* ```
|
|
452
|
+
*/
|
|
311
453
|
export declare function HoldButton({ onConfirm, duration, variant, holdingLabel, doneLabel, repeatable, className, children, style, disabled, onClick, ...rest }: HoldButtonProps): React.JSX.Element;
|
|
312
454
|
export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
313
455
|
/** A header that sits flush at the top and rises once content scrolls beneath it. */
|
|
@@ -315,7 +457,14 @@ export interface ScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
315
457
|
maxHeight?: number | string;
|
|
316
458
|
'aria-label'?: string;
|
|
317
459
|
}
|
|
318
|
-
/** Overflow as depth: where content continues past an edge, the edge curves away (an inner lip); content passing under the header lifts it.
|
|
460
|
+
/** Overflow as depth: where content continues past an edge, the edge curves away (an inner lip); content passing under the header lifts it.
|
|
461
|
+
* @example
|
|
462
|
+
* ```tsx
|
|
463
|
+
* import { ScrollArea } from 'altitude-design';
|
|
464
|
+
*
|
|
465
|
+
* <ScrollArea maxHeight={240} aria-label="Invoices">{rows.map(([a, b]) => <div className="item" key={a}>{a}<span>{b}</span></div>)}</ScrollArea>
|
|
466
|
+
* ```
|
|
467
|
+
*/
|
|
319
468
|
export declare function ScrollArea({ header, maxHeight, className, children, ...rest }: ScrollAreaProps): React.JSX.Element;
|
|
320
469
|
export interface DropZoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop'> {
|
|
321
470
|
onFiles?: (files: File[]) => void;
|
|
@@ -340,7 +489,14 @@ export interface UploadItem {
|
|
|
340
489
|
/** Why it failed, in words. */
|
|
341
490
|
error?: string;
|
|
342
491
|
}
|
|
343
|
-
/** Receptacles open when they're needed: a drop zone is flush until a file is dragged anywhere on the page, then sinks open; over it, it deepens.
|
|
492
|
+
/** Receptacles open when they're needed: a drop zone is flush until a file is dragged anywhere on the page, then sinks open; over it, it deepens.
|
|
493
|
+
* @example
|
|
494
|
+
* ```tsx
|
|
495
|
+
* import { DropZone } from 'altitude-design';
|
|
496
|
+
*
|
|
497
|
+
* <DropZone state="idle"><Body /></DropZone>
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
344
500
|
export declare function DropZone({ onFiles, accept, multiple, state, queue, onRetry, onCancel, onRemove, className, children, ...rest }: DropZoneProps): React.JSX.Element;
|
|
345
501
|
export interface SortableListProps<T> {
|
|
346
502
|
items: T[];
|
|
@@ -355,6 +511,14 @@ export interface SortableListProps<T> {
|
|
|
355
511
|
className?: string;
|
|
356
512
|
'aria-label'?: string;
|
|
357
513
|
}
|
|
358
|
-
/** Possession as depth: the item you pick up comes into your hand (level 3), the slot it will land in opens as a well, and it lands with a settle.
|
|
514
|
+
/** Possession as depth: the item you pick up comes into your hand (level 3), the slot it will land in opens as a well, and it lands with a settle.
|
|
515
|
+
* @example
|
|
516
|
+
* ```tsx
|
|
517
|
+
* import { Badge, SortableList } from 'altitude-design';
|
|
518
|
+
*
|
|
519
|
+
* <SortableList aria-label="Priorities" items={items} getKey={(i) => i.id} getLabel={(i) => i.t} onReorder={setItems}
|
|
520
|
+
* renderItem={(i) => <div className="it">{i.t}<Badge tone={i.p === 'High' ? 'critical' : i.p === 'Med' ? 'caution' : 'neutral'}>{i.p}</Badge></div>} />
|
|
521
|
+
* ```
|
|
522
|
+
*/
|
|
359
523
|
export declare function SortableList<T>({ items, getKey, onReorder, renderItem, getLabel, gap, className, ...rest }: SortableListProps<T>): React.JSX.Element;
|
|
360
524
|
export {};
|
|
@@ -6,6 +6,27 @@ export interface ConversationProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
6
6
|
* The thread between a person and an assistant. Settled messages are the record. It follows new text to the bottom
|
|
7
7
|
* until the person scrolls up, then offers "Jump to latest". A streamed answer is announced once, when it completes,
|
|
8
8
|
* never token by token.
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { Conversation, ConversationCheckpoint, ConversationContent, ConversationScrollButton, Message, MessageActions, MessageAttachments, MessageContent } from 'altitude-design';
|
|
12
|
+
*
|
|
13
|
+
* <Conversation aria-label="Assistant">
|
|
14
|
+
* <ConversationContent>
|
|
15
|
+
* {msgs.map((m) => m.kind === 'checkpoint' ? (
|
|
16
|
+
* <ConversationCheckpoint key={m.id} label={m.label} at={m.at} onRestore={() => restore(m.id)} onReturn={giveBack}
|
|
17
|
+
* consequence="The messages after this will be set aside. You can return to them." />
|
|
18
|
+
* ) : (
|
|
19
|
+
* <Message key={m.id} from={m.from} status={m.status} edited={m.v > 0} onRetry={m.status === 'stopped' ? () => { setStatus('streaming'); stream(m.id); } : undefined}>
|
|
20
|
+
* {m.files && <MessageAttachments items={m.files} />}
|
|
21
|
+
* <MessageContent>{m.text}</MessageContent>
|
|
22
|
+
* {m.from === 'assistant' ? <MessageActions onCopy onRegenerate={() => {}} onFeedback={() => {}} />
|
|
23
|
+
* : <MessageActions onEdit={(t) => edit(m.id, t)} versions={m.versions && { index: m.v + 1, total: m.versions.length, onChange: (k) => showVersion(m.id, k - 1) }} />}
|
|
24
|
+
* </Message>
|
|
25
|
+
* ))}
|
|
26
|
+
* </ConversationContent>
|
|
27
|
+
* <ConversationScrollButton />
|
|
28
|
+
* </Conversation>
|
|
29
|
+
* ```
|
|
9
30
|
*/
|
|
10
31
|
export declare function Conversation({ className, children, 'aria-label': label, ...rest }: ConversationProps): React.JSX.Element;
|
|
11
32
|
/** The messages, in order. */
|
|
@@ -15,5 +15,11 @@ export interface CopyButtonProps extends Omit<ButtonProps, 'value' | 'onCopy' |
|
|
|
15
15
|
/**
|
|
16
16
|
* Copies a value and says so in words: pressed to the ground with a check and "Copied" for dur-linger, announced
|
|
17
17
|
* politely while the button keeps its name. No rise and no afterglow: nothing new arrived on the page.
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { CopyButton } from 'altitude-design';
|
|
21
|
+
*
|
|
22
|
+
* <CopyButton size="sm" value="sk_live_51Hc8x2Lw9Qe7TfR4mNpZa" label="Copy API key" />
|
|
23
|
+
* ```
|
|
18
24
|
*/
|
|
19
25
|
export declare const CopyButton: React.ForwardRefExoticComponent<CopyButtonProps & React.RefAttributes<HTMLButtonElement>>;
|