altitude-design 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -8
- package/dist/adapters/codemirror.cjs +88 -0
- package/dist/adapters/codemirror.cjs.map +7 -0
- package/dist/adapters/codemirror.js +67 -0
- package/dist/adapters/codemirror.js.map +7 -0
- package/dist/adapters/react-flow.css +102 -0
- package/dist/adapters/tiptap.css +71 -0
- package/dist/altitude.css +3165 -246
- package/dist/altitude.iife.js +33 -5
- package/dist/altitude.no-fonts.css +3165 -246
- package/dist/chart-themes.cjs +195 -0
- package/dist/chart-themes.cjs.map +7 -0
- package/dist/chart-themes.js +165 -0
- package/dist/chart-themes.js.map +7 -0
- package/dist/cli/altitude.mjs +134 -0
- package/dist/guidance/README.md +32 -0
- package/dist/guidance/agent-setup.md +22 -0
- package/dist/guidance/app-skeleton.md +17 -0
- package/dist/guidance/evidence.json +95 -0
- package/dist/guidance/index.json +493 -0
- package/dist/guidance/llms.txt +20 -0
- package/dist/guidance/manifest.json +92 -0
- package/dist/guidance/pattern.schema.json +181 -0
- package/dist/guidance/patterns/agent-action.json +77 -0
- package/dist/guidance/patterns/agent-action.md +39 -0
- package/dist/guidance/patterns/assistant-conversation.json +77 -0
- package/dist/guidance/patterns/assistant-conversation.md +50 -0
- package/dist/guidance/patterns/async-collection.json +71 -0
- package/dist/guidance/patterns/async-collection.md +29 -0
- package/dist/guidance/patterns/audit-log.json +75 -0
- package/dist/guidance/patterns/audit-log.md +27 -0
- package/dist/guidance/patterns/auth.json +86 -0
- package/dist/guidance/patterns/auth.md +29 -0
- package/dist/guidance/patterns/billing.json +80 -0
- package/dist/guidance/patterns/billing.md +29 -0
- package/dist/guidance/patterns/consequential-action.json +76 -0
- package/dist/guidance/patterns/consequential-action.md +27 -0
- package/dist/guidance/patterns/developer-settings.json +79 -0
- package/dist/guidance/patterns/developer-settings.md +29 -0
- package/dist/guidance/patterns/edit-record.json +74 -0
- package/dist/guidance/patterns/edit-record.md +51 -0
- package/dist/guidance/patterns/import.json +77 -0
- package/dist/guidance/patterns/import.md +31 -0
- package/dist/guidance/patterns/members.json +77 -0
- package/dist/guidance/patterns/members.md +27 -0
- package/dist/guidance/patterns/onboarding.json +78 -0
- package/dist/guidance/patterns/onboarding.md +31 -0
- package/dist/guidance/patterns/review-submit.json +72 -0
- package/dist/guidance/patterns/review-submit.md +27 -0
- package/dist/guidance/patterns/screen-layout.json +79 -0
- package/dist/guidance/patterns/screen-layout.md +40 -0
- package/dist/guidance/patterns/settings.json +78 -0
- package/dist/guidance/patterns/settings.md +32 -0
- package/dist/guidance/patterns/sync.json +77 -0
- package/dist/guidance/patterns/sync.md +31 -0
- package/dist/guidance/principles.md +23 -0
- package/dist/guidance/references/build/checks/agent-action-pattern.mjs +57 -0
- package/dist/guidance/references/build/checks/agent-setup.mjs +78 -0
- package/dist/guidance/references/build/checks/assistant-conversation-pattern.mjs +49 -0
- package/dist/guidance/references/build/checks/audit-log-pattern.mjs +63 -0
- package/dist/guidance/references/build/checks/auth-pattern.mjs +67 -0
- package/dist/guidance/references/build/checks/billing-pattern.mjs +63 -0
- package/dist/guidance/references/build/checks/developer-settings-pattern.mjs +76 -0
- package/dist/guidance/references/build/checks/guidance.mjs +71 -0
- package/dist/guidance/references/build/checks/import-pattern.mjs +69 -0
- package/dist/guidance/references/build/checks/members-pattern.mjs +71 -0
- package/dist/guidance/references/build/checks/onboarding-pattern.mjs +54 -0
- package/dist/guidance/references/build/checks/pattern-types.mjs +13 -0
- package/dist/guidance/references/build/checks/pattern-workflows.mjs +226 -0
- package/dist/guidance/references/build/checks/primary-scope.mjs +49 -0
- package/dist/guidance/references/build/checks/render-tells.mjs +72 -0
- package/dist/guidance/references/build/checks/screen-layout-pattern.mjs +111 -0
- package/dist/guidance/references/build/checks/semantics.mjs +72 -0
- package/dist/guidance/references/build/checks/settings-pattern.mjs +73 -0
- package/dist/guidance/references/build/checks/sync-pattern.mjs +62 -0
- package/dist/guidance/references/build/checks/tells-lint.mjs +164 -0
- package/dist/guidance/references/build/fixtures/pattern-workflows.tsx +83 -0
- package/dist/guidance/references/build/fixtures/patterns/agent-action.jsx +60 -0
- package/dist/guidance/references/build/fixtures/patterns/app-skeleton.jsx +94 -0
- package/dist/guidance/references/build/fixtures/patterns/assistant-conversation.jsx +79 -0
- package/dist/guidance/references/build/fixtures/patterns/audit-log.jsx +81 -0
- package/dist/guidance/references/build/fixtures/patterns/auth.jsx +150 -0
- package/dist/guidance/references/build/fixtures/patterns/billing.jsx +96 -0
- package/dist/guidance/references/build/fixtures/patterns/developer-settings.jsx +95 -0
- package/dist/guidance/references/build/fixtures/patterns/import.jsx +102 -0
- package/dist/guidance/references/build/fixtures/patterns/members.jsx +106 -0
- package/dist/guidance/references/build/fixtures/patterns/onboarding.jsx +70 -0
- package/dist/guidance/references/build/fixtures/patterns/screen-layout-decision.jsx +74 -0
- package/dist/guidance/references/build/fixtures/patterns/screen-layout-editor.jsx +56 -0
- package/dist/guidance/references/build/fixtures/patterns/screen-layout-report.jsx +42 -0
- package/dist/guidance/references/build/fixtures/patterns/settings.jsx +73 -0
- package/dist/guidance/references/build/fixtures/patterns/sync.jsx +78 -0
- package/dist/guidance/references/project/components/src/pattern-async-collection.tsx +57 -0
- package/dist/guidance/references/project/components/src/pattern-consequential-action.tsx +77 -0
- package/dist/guidance/references/project/components/src/pattern-edit-record.tsx +127 -0
- package/dist/guidance/references/project/components/src/pattern-review-submit.tsx +47 -0
- package/dist/guidance/references/project/components/src/settings.tsx +79 -0
- package/dist/guidance/references/scripts/build-framework-fixture.mjs +20 -0
- package/dist/guidance/rules.json +653 -0
- package/dist/guidance/visual/Elevation.md +194 -0
- package/dist/guidance/visual/Fundamentals.md +83 -0
- package/dist/guidance/visual/Research.md +1620 -0
- package/dist/index.cjs +19009 -1854
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +19009 -1854
- package/dist/index.js.map +4 -4
- package/dist/tokens.css +84 -84
- package/dist/tokens.json +301 -128
- package/dist/types/adapter-codemirror.d.ts +13 -0
- package/dist/types/agent-fleet.d.ts +166 -0
- package/dist/types/ai-label.d.ts +30 -0
- package/dist/types/app-shell.d.ts +83 -0
- package/dist/types/area-chart.d.ts +80 -0
- package/dist/types/artifact.d.ts +65 -0
- package/dist/types/bar-chart.d.ts +83 -0
- package/dist/types/bar-list.d.ts +35 -0
- package/dist/types/breadcrumb.d.ts +62 -0
- package/dist/types/chart-brush.d.ts +35 -0
- package/dist/types/chart-themes.d.ts +229 -0
- package/dist/types/chart.d.ts +570 -0
- package/dist/types/checklist.d.ts +71 -0
- package/dist/types/code-block.d.ts +32 -0
- package/dist/types/collections.d.ts +116 -5
- package/dist/types/color-picker.d.ts +38 -0
- package/dist/types/command.d.ts +6 -3
- package/dist/types/comment-thread.d.ts +48 -0
- package/dist/types/confirmation.d.ts +60 -0
- package/dist/types/context-menu.d.ts +17 -0
- package/dist/types/controls.d.ts +134 -22
- package/dist/types/conversation.d.ts +130 -0
- package/dist/types/copy-button.d.ts +19 -0
- package/dist/types/core.d.ts +139 -10
- package/dist/types/data-grid.d.ts +76 -0
- package/dist/types/date-picker.d.ts +96 -0
- package/dist/types/diff-view.d.ts +54 -0
- package/dist/types/dot-plot.d.ts +54 -0
- package/dist/types/edit-region.d.ts +121 -0
- package/dist/types/feature-gate.d.ts +22 -0
- package/dist/types/filter-bar.d.ts +65 -0
- package/dist/types/formatted-number.d.ts +38 -0
- package/dist/types/heatmap.d.ts +64 -0
- package/dist/types/in-place.d.ts +24 -0
- package/dist/types/index.d.ts +159 -14
- package/dist/types/inline-citation.d.ts +35 -0
- package/dist/types/inline-edit.d.ts +71 -0
- package/dist/types/input-otp.d.ts +37 -0
- package/dist/types/item-group.d.ts +104 -0
- package/dist/types/line-chart.d.ts +116 -0
- package/dist/types/link.d.ts +11 -0
- package/dist/types/markdown.d.ts +88 -0
- package/dist/types/meter.d.ts +43 -0
- package/dist/types/modal-state.d.ts +62 -0
- package/dist/types/nav.d.ts +8 -1
- package/dist/types/notifications.d.ts +42 -0
- package/dist/types/number-input.d.ts +30 -0
- package/dist/types/overlays.d.ts +56 -15
- package/dist/types/page-header.d.ts +27 -0
- package/dist/types/pagination.d.ts +29 -0
- package/dist/types/palette.d.ts +64 -0
- package/dist/types/password-input.d.ts +22 -0
- package/dist/types/pattern-assistant-conversation.d.ts +55 -0
- package/dist/types/pattern-async-collection.d.ts +34 -0
- package/dist/types/pattern-consequential-action.d.ts +53 -0
- package/dist/types/pattern-edit-record.d.ts +72 -0
- package/dist/types/pattern-review-submit.d.ts +43 -0
- package/dist/types/permission-matrix.d.ts +34 -0
- package/dist/types/plan-picker.d.ts +40 -0
- package/dist/types/prompt-input.d.ts +106 -0
- package/dist/types/property-list.d.ts +67 -0
- package/dist/types/question.d.ts +64 -0
- package/dist/types/relative-time.d.ts +21 -0
- package/dist/types/removal-receipt.d.ts +1180 -0
- package/dist/types/resizable.d.ts +48 -0
- package/dist/types/roving.d.ts +44 -0
- package/dist/types/save-bar.d.ts +38 -0
- package/dist/types/saved-views.d.ts +72 -0
- package/dist/types/scatter-chart.d.ts +60 -0
- package/dist/types/schedule.d.ts +80 -0
- package/dist/types/secret-field.d.ts +33 -0
- package/dist/types/select.d.ts +44 -2
- package/dist/types/separator.d.ts +11 -0
- package/dist/types/settings.d.ts +39 -0
- package/dist/types/sheet.d.ts +1 -1
- package/dist/types/sparkline.d.ts +46 -0
- package/dist/types/split-button.d.ts +21 -0
- package/dist/types/stat.d.ts +54 -0
- package/dist/types/stepper.d.ts +6 -3
- package/dist/types/suggestions.d.ts +29 -0
- package/dist/types/suspense.d.ts +85 -0
- package/dist/types/sync-indicator.d.ts +24 -0
- package/dist/types/tag-input.d.ts +65 -0
- package/dist/types/terminal.d.ts +33 -0
- package/dist/types/thread-list.d.ts +58 -0
- package/dist/types/time-input.d.ts +33 -0
- package/dist/types/timeline.d.ts +38 -0
- package/dist/types/toggle.d.ts +46 -0
- package/dist/types/toolbar.d.ts +34 -0
- package/dist/types/tour.d.ts +23 -0
- package/dist/types/trace.d.ts +65 -0
- package/dist/types/tree.d.ts +71 -0
- package/dist/types-cjs/adapter-codemirror.d.cts +13 -0
- package/dist/types-cjs/agent-fleet.d.cts +166 -0
- package/dist/types-cjs/ai-label.d.cts +30 -0
- package/dist/types-cjs/app-shell.d.cts +83 -0
- package/dist/types-cjs/area-chart.d.cts +80 -0
- package/dist/types-cjs/artifact.d.cts +65 -0
- package/dist/types-cjs/bar-chart.d.cts +83 -0
- package/dist/types-cjs/bar-list.d.cts +35 -0
- package/dist/types-cjs/breadcrumb.d.cts +62 -0
- package/dist/types-cjs/chart-brush.d.cts +35 -0
- package/dist/types-cjs/chart-themes.d.cts +229 -0
- package/dist/types-cjs/chart.d.cts +570 -0
- package/dist/types-cjs/checklist.d.cts +71 -0
- package/dist/types-cjs/code-block.d.cts +32 -0
- package/dist/types-cjs/collections.d.cts +246 -0
- package/dist/types-cjs/color-picker.d.cts +38 -0
- package/dist/types-cjs/command.d.cts +66 -0
- package/dist/types-cjs/comment-thread.d.cts +48 -0
- package/dist/types-cjs/confirmation.d.cts +60 -0
- package/dist/types-cjs/context-menu.d.cts +17 -0
- package/dist/types-cjs/controls.d.cts +360 -0
- package/dist/types-cjs/conversation.d.cts +130 -0
- package/dist/types-cjs/copy-button.d.cts +19 -0
- package/dist/types-cjs/core.d.cts +256 -0
- package/dist/types-cjs/data-grid.d.cts +76 -0
- package/dist/types-cjs/date-picker.d.cts +96 -0
- package/dist/types-cjs/diff-view.d.cts +54 -0
- package/dist/types-cjs/dot-plot.d.cts +54 -0
- package/dist/types-cjs/edit-region.d.cts +121 -0
- package/dist/types-cjs/empty.d.cts +24 -0
- package/dist/types-cjs/feature-gate.d.cts +22 -0
- package/dist/types-cjs/filter-bar.d.cts +65 -0
- package/dist/types-cjs/formatted-number.d.cts +38 -0
- package/dist/types-cjs/heatmap.d.cts +64 -0
- package/dist/types-cjs/in-place.d.cts +24 -0
- package/dist/types-cjs/index.d.cts +154 -0
- package/dist/types-cjs/inline-citation.d.cts +35 -0
- package/dist/types-cjs/inline-edit.d.cts +71 -0
- package/dist/types-cjs/input-otp.d.cts +37 -0
- package/dist/types-cjs/item-group.d.cts +104 -0
- package/dist/types-cjs/line-chart.d.cts +116 -0
- package/dist/types-cjs/link.d.cts +11 -0
- package/dist/types-cjs/markdown.d.cts +88 -0
- package/dist/types-cjs/meter.d.cts +43 -0
- package/dist/types-cjs/modal-state.d.cts +62 -0
- package/dist/types-cjs/nav.d.cts +25 -0
- package/dist/types-cjs/notifications.d.cts +42 -0
- package/dist/types-cjs/number-input.d.cts +30 -0
- package/dist/types-cjs/overlays.d.cts +170 -0
- package/dist/types-cjs/page-header.d.cts +27 -0
- package/dist/types-cjs/pagination.d.cts +29 -0
- package/dist/types-cjs/palette.d.cts +64 -0
- package/dist/types-cjs/password-input.d.cts +22 -0
- package/dist/types-cjs/pattern-assistant-conversation.d.cts +55 -0
- package/dist/types-cjs/pattern-async-collection.d.cts +34 -0
- package/dist/types-cjs/pattern-consequential-action.d.cts +53 -0
- package/dist/types-cjs/pattern-edit-record.d.cts +72 -0
- package/dist/types-cjs/pattern-review-submit.d.cts +43 -0
- package/dist/types-cjs/permission-matrix.d.cts +34 -0
- package/dist/types-cjs/pile.d.cts +27 -0
- package/dist/types-cjs/plan-picker.d.cts +40 -0
- package/dist/types-cjs/prompt-input.d.cts +106 -0
- package/dist/types-cjs/property-list.d.cts +67 -0
- package/dist/types-cjs/question.d.cts +64 -0
- package/dist/types-cjs/relative-time.d.cts +21 -0
- package/dist/types-cjs/removal-receipt.d.cts +1180 -0
- package/dist/types-cjs/resizable.d.cts +48 -0
- package/dist/types-cjs/roving.d.cts +44 -0
- package/dist/types-cjs/save-bar.d.cts +38 -0
- package/dist/types-cjs/saved-views.d.cts +72 -0
- package/dist/types-cjs/scatter-chart.d.cts +60 -0
- package/dist/types-cjs/schedule.d.cts +80 -0
- package/dist/types-cjs/secret-field.d.cts +33 -0
- package/dist/types-cjs/select.d.cts +109 -0
- package/dist/types-cjs/separator.d.cts +11 -0
- package/dist/types-cjs/settings.d.cts +39 -0
- package/dist/types-cjs/sheet.d.cts +27 -0
- package/dist/types-cjs/sparkline.d.cts +46 -0
- package/dist/types-cjs/split-button.d.cts +21 -0
- package/dist/types-cjs/stat.d.cts +54 -0
- package/dist/types-cjs/stepper.d.cts +26 -0
- package/dist/types-cjs/suggestions.d.cts +29 -0
- package/dist/types-cjs/suspense.d.cts +85 -0
- package/dist/types-cjs/sync-indicator.d.cts +24 -0
- package/dist/types-cjs/tag-input.d.cts +65 -0
- package/dist/types-cjs/terminal.d.cts +33 -0
- package/dist/types-cjs/thread-list.d.cts +58 -0
- package/dist/types-cjs/time-input.d.cts +33 -0
- package/dist/types-cjs/timeline.d.cts +38 -0
- package/dist/types-cjs/toggle.d.cts +46 -0
- package/dist/types-cjs/toolbar.d.cts +34 -0
- package/dist/types-cjs/tour.d.cts +23 -0
- package/dist/types-cjs/trace.d.cts +65 -0
- package/dist/types-cjs/tree.d.cts +71 -0
- package/package.json +90 -9
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { EditRegionBinder, EditRegionSaveResult } from './edit-region.js';
|
|
3
|
+
import { Promised, SkeletonOption } from './suspense.js';
|
|
2
4
|
export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
3
5
|
/** The table scrolls under its header past this height. */
|
|
4
6
|
maxHeight?: number | string;
|
|
@@ -49,6 +51,13 @@ export interface DataTableColumn<T> {
|
|
|
49
51
|
sortValue?: (row: T) => string | number;
|
|
50
52
|
align?: 'start' | 'end';
|
|
51
53
|
width?: number | string;
|
|
54
|
+
/**
|
|
55
|
+
* The narrowest the column gets (#260): on a phone the table scrolls inside its frame rather than squeezing a column
|
|
56
|
+
* below this. Default: the header's width, and at least 6rem when the table is narrow.
|
|
57
|
+
*/
|
|
58
|
+
minWidth?: number | string;
|
|
59
|
+
/** Keep this column in view while the table scrolls sideways, over a flush 1px edge (no shadow: it isn't live). */
|
|
60
|
+
sticky?: boolean;
|
|
52
61
|
}
|
|
53
62
|
export type TableSort = {
|
|
54
63
|
key: string;
|
|
@@ -56,7 +65,10 @@ export type TableSort = {
|
|
|
56
65
|
} | null;
|
|
57
66
|
export interface DataTableProps<T> {
|
|
58
67
|
columns: DataTableColumn<T>[];
|
|
59
|
-
rows:
|
|
68
|
+
/** The rows. Undefined while your data loads, or a promise: until they arrive the table is its header over `skeleton.lines` imprinted rows (default 5). */
|
|
69
|
+
rows: Promised<T[]> | undefined;
|
|
70
|
+
/** While the rows are on their way: how many rows to imprint (`lines`). `false`: undefined rows render as empty, and a promise suspends to your own boundary. */
|
|
71
|
+
skeleton?: SkeletonOption;
|
|
60
72
|
getRowId: (row: T) => string;
|
|
61
73
|
/** A row's name, for screen readers (its checkbox, its move handle, announcements) and its button with onRowClick. */
|
|
62
74
|
getRowLabel?: (row: T) => string;
|
|
@@ -65,8 +77,17 @@ export interface DataTableProps<T> {
|
|
|
65
77
|
selected?: string[];
|
|
66
78
|
defaultSelected?: string[];
|
|
67
79
|
onSelectedChange?: (ids: string[]) => void;
|
|
68
|
-
/**
|
|
69
|
-
actions?: (ids: string[]) => React.ReactNode;
|
|
80
|
+
/** Actions for the selected rows, shown beside their count. The second argument is the whole selection, which may be "all matching". */
|
|
81
|
+
actions?: (ids: string[], selection: TableSelection) => React.ReactNode;
|
|
82
|
+
/** The selection, when it can reach past the loaded rows: { kind: 'ids', ids } or { kind: 'query', total, except }. */
|
|
83
|
+
selection?: TableSelection;
|
|
84
|
+
onSelectionChange?: (selection: TableSelection) => void;
|
|
85
|
+
/** How many records match the current filter, across every page. Offers "Select all N matching" once a page is selected. */
|
|
86
|
+
matchingTotal?: number;
|
|
87
|
+
/** Where the count and actions sit: in the toolbar, in a bar floating at the bottom edge (level 3), or 'auto' (floating once the toolbar scrolls away). Default 'toolbar'. */
|
|
88
|
+
actionsPlacement?: 'toolbar' | 'floating' | 'auto';
|
|
89
|
+
/** What the rows are, plural ("users"), for "Select all 2,341 users". Default "rows". */
|
|
90
|
+
noun?: string;
|
|
70
91
|
/** Anything else for the toolbar's end (a filter field, a button). */
|
|
71
92
|
toolbar?: React.ReactNode;
|
|
72
93
|
sort?: TableSort;
|
|
@@ -83,12 +104,72 @@ export interface DataTableProps<T> {
|
|
|
83
104
|
empty?: React.ReactNode;
|
|
84
105
|
className?: string;
|
|
85
106
|
'aria-label'?: string;
|
|
107
|
+
/** Read-only detail: a disclosure button in the first column opens a full-width region under the row, on the ground. */
|
|
108
|
+
renderExpanded?: (row: T) => React.ReactNode;
|
|
109
|
+
/** With onSave, an Edit button opens the row's region as an EditRegion holding these fields; row and region rise together. */
|
|
110
|
+
renderEditor?: (field: EditRegionBinder<T & Record<string, unknown>>, row: T) => React.ReactNode;
|
|
111
|
+
onSave?: (draft: T, context: {
|
|
112
|
+
previousValue: T;
|
|
113
|
+
changed: (keyof T)[];
|
|
114
|
+
}) => EditRegionSaveResult<T & Record<string, unknown>> | Promise<EditRegionSaveResult<T & Record<string, unknown>>>;
|
|
115
|
+
/** Publishes a saved row's canonical record (a synchronous setter). */
|
|
116
|
+
onRowChange?: (canonical: T) => void;
|
|
117
|
+
/** Rows whose detail is open, by id. */
|
|
118
|
+
expanded?: string[];
|
|
119
|
+
defaultExpanded?: string[];
|
|
120
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
121
|
+
/** 'single' (default): opening one closes the others. */
|
|
122
|
+
expandMode?: 'single' | 'multiple';
|
|
123
|
+
/** Which columns show, by key: false hides one. The first column in order always shows. */
|
|
124
|
+
columnVisibility?: Record<string, boolean>;
|
|
125
|
+
defaultColumnVisibility?: Record<string, boolean>;
|
|
126
|
+
onColumnVisibilityChange?: (visibility: Record<string, boolean>) => void;
|
|
127
|
+
/** The columns' order, by key. Keys left out keep their place after the ones given. */
|
|
128
|
+
columnOrder?: string[];
|
|
129
|
+
defaultColumnOrder?: string[];
|
|
130
|
+
onColumnOrderChange?: (order: string[]) => void;
|
|
131
|
+
/** Row density. 'compact' keeps every target at least 24px tall. Default 'comfortable'. */
|
|
132
|
+
density?: 'comfortable' | 'compact';
|
|
133
|
+
defaultDensity?: 'comfortable' | 'compact';
|
|
134
|
+
onDensityChange?: (density: 'comfortable' | 'compact') => void;
|
|
135
|
+
/** A "Columns" button in the toolbar: show, hide and reorder columns, and choose the density. */
|
|
136
|
+
columnsMenu?: boolean;
|
|
137
|
+
/** Rows paged by your server: Pagination in the footer, or "Load more". */
|
|
138
|
+
pagination?: DataTablePaging;
|
|
86
139
|
}
|
|
140
|
+
/** Rows chosen by id, or every record matching the query except some. */
|
|
141
|
+
export type TableSelection = {
|
|
142
|
+
kind: 'ids';
|
|
143
|
+
ids: string[];
|
|
144
|
+
} | {
|
|
145
|
+
kind: 'query';
|
|
146
|
+
total: number;
|
|
147
|
+
except: string[];
|
|
148
|
+
};
|
|
149
|
+
export type DataTablePaging = {
|
|
150
|
+
mode?: 'pages';
|
|
151
|
+
page: number;
|
|
152
|
+
pageCount?: number;
|
|
153
|
+
pageSize?: number;
|
|
154
|
+
total?: number;
|
|
155
|
+
onPageChange: (page: number) => void;
|
|
156
|
+
hrefFor?: (page: number) => string;
|
|
157
|
+
hasNext?: boolean;
|
|
158
|
+
/** The next page is loading: the rows stay at half strength and the page thumb is held pressed. */ loading?: boolean;
|
|
159
|
+
noun?: string;
|
|
160
|
+
} | {
|
|
161
|
+
mode: 'more';
|
|
162
|
+
hasMore: boolean;
|
|
163
|
+
onLoadMore: () => void;
|
|
164
|
+
total?: number;
|
|
165
|
+
loading?: boolean;
|
|
166
|
+
noun?: string;
|
|
167
|
+
};
|
|
87
168
|
/**
|
|
88
169
|
* A table from data: sortable columns whose rows are carried to their new places, a checkbox column whose selected rows
|
|
89
170
|
* rise (counted by a floating Badge in the toolbar), filtering in place, interactive rows and reordering by hand.
|
|
90
171
|
*/
|
|
91
|
-
export declare function DataTable<T>({
|
|
172
|
+
export declare function DataTable<T>({ skeleton, ...props }: DataTableProps<T>): React.JSX.Element;
|
|
92
173
|
export interface BoardPlace {
|
|
93
174
|
column: string;
|
|
94
175
|
index: number;
|
|
@@ -118,8 +199,28 @@ export interface BoardColumnProps extends Omit<React.HTMLAttributes<HTMLElement>
|
|
|
118
199
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
119
200
|
/** Show the collapse button. */
|
|
120
201
|
collapsible?: boolean;
|
|
202
|
+
/** Adds an add slot at the foot of the column. Resolve after the new card is among the children. */
|
|
203
|
+
onCreate?: (title: string) => BoardCreateResult | Promise<BoardCreateResult>;
|
|
204
|
+
/** Default “Add a card”. */
|
|
205
|
+
addLabel?: string;
|
|
121
206
|
}
|
|
122
|
-
export
|
|
207
|
+
export type BoardCreateResult = {
|
|
208
|
+
ok: true;
|
|
209
|
+
value: {
|
|
210
|
+
id: string;
|
|
211
|
+
};
|
|
212
|
+
} | {
|
|
213
|
+
ok: false;
|
|
214
|
+
error: string;
|
|
215
|
+
};
|
|
216
|
+
export type BoardRenameResult = {
|
|
217
|
+
ok: true;
|
|
218
|
+
value: string;
|
|
219
|
+
} | {
|
|
220
|
+
ok: false;
|
|
221
|
+
error: string;
|
|
222
|
+
};
|
|
223
|
+
export declare function BoardColumn({ id, title, collapsed, defaultCollapsed, onCollapsedChange, collapsible, onCreate, addLabel, className, children, ...rest }: BoardColumnProps): React.JSX.Element;
|
|
123
224
|
export interface BoardCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
124
225
|
id: string;
|
|
125
226
|
/** How announcements name the card. Default: its first line of text. */
|
|
@@ -131,5 +232,15 @@ export interface BoardCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
131
232
|
};
|
|
132
233
|
/** Afterglow: when this value changes the card arrives tinted and lifted, then settles. */
|
|
133
234
|
settle?: unknown;
|
|
235
|
+
/** Rename in place (F2, or the visible Rename button): InlineEdit's contract. Use with `label`. */
|
|
236
|
+
onRename?: (draft: string) => BoardRenameResult | Promise<BoardRenameResult>;
|
|
237
|
+
/** The card's record, for a fuller editor in its place (EditRegion). */
|
|
238
|
+
value?: Record<string, unknown>;
|
|
239
|
+
renderEditor?: (field: EditRegionBinder<Record<string, unknown>>) => React.ReactNode;
|
|
240
|
+
onSave?: (draft: Record<string, unknown>, context: {
|
|
241
|
+
previousValue: Record<string, unknown>;
|
|
242
|
+
changed: string[];
|
|
243
|
+
}) => EditRegionSaveResult<Record<string, unknown>> | Promise<EditRegionSaveResult<Record<string, unknown>>>;
|
|
244
|
+
onValueChange?: (canonical: Record<string, unknown>) => void;
|
|
134
245
|
}
|
|
135
246
|
export declare const BoardCard: React.ForwardRefExoticComponent<BoardCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ColorSwatch {
|
|
3
|
+
value: string;
|
|
4
|
+
/** Every swatch has a name: colour is never the only way to tell them apart. */
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ColorSwatchPickerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
8
|
+
swatches: ColorSwatch[];
|
|
9
|
+
value?: string | null;
|
|
10
|
+
defaultValue?: string | null;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Colours as choices: each swatch is a trench the colour pours into, and the chosen one carries the raised white mark,
|
|
16
|
+
* which travels between swatches as RadioGroup's thumb does. A radio group: arrows move and choose.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ColorSwatchPicker({ swatches, value, defaultValue, onValueChange, className, ...rest }: ColorSwatchPickerProps): React.JSX.Element;
|
|
19
|
+
export interface ColorPickerProps {
|
|
20
|
+
/** What the colour is for ("Brand colour"). It names the swatches. */
|
|
21
|
+
label: string;
|
|
22
|
+
value?: string;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/** Called with a lower-case "#rrggbb". */
|
|
25
|
+
onValueChange?: (value: string) => void;
|
|
26
|
+
swatches?: ColorSwatch[];
|
|
27
|
+
/** A hex field and a full picker (area and hue) for any colour. Default false. */
|
|
28
|
+
allowCustom?: boolean;
|
|
29
|
+
/** Says in words whether white text and dark text on the colour reach 4.5:1. Default false. */
|
|
30
|
+
checkContrast?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A brand or label colour: swatches as choices (trenches the colour pours into, one travelling mark), and, if allowed,
|
|
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
|
+
* whether text on the colour passes, because the accent carries text.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ColorPicker({ label, value, defaultValue, onValueChange, swatches, allowCustom, checkContrast, className }: ColorPickerProps): React.JSX.Element;
|
package/dist/types/command.d.ts
CHANGED
|
@@ -45,8 +45,11 @@ export interface CommandPaletteProps {
|
|
|
45
45
|
onQueryChange?: (query: string) => void;
|
|
46
46
|
/** Close once an item is chosen. Default true. */
|
|
47
47
|
closeOnSelect?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The key hints: the footer, the item shortcuts and the field's esc. 'auto' (default): shown where there's likely a
|
|
50
|
+
* keyboard, hidden on a touch-only device until a key is pressed (#262). true or false forces them.
|
|
51
|
+
*/
|
|
52
|
+
hints?: boolean | 'auto';
|
|
50
53
|
className?: string;
|
|
51
54
|
'aria-label'?: string;
|
|
52
55
|
}
|
|
@@ -60,4 +63,4 @@ export declare function commandScore(text: string, query: string): number;
|
|
|
60
63
|
* as it does for Dialog. The query field is an opening built like Input; one highlight glides between results;
|
|
61
64
|
* when results change, surviving rows travel to their new places and new ones rise in, a few at a time.
|
|
62
65
|
*/
|
|
63
|
-
export declare function CommandPalette({ items, open, defaultOpen, onOpenChange, onSelect, placeholder, filter, empty, shortcut, query: queryProp, defaultQuery, onQueryChange, closeOnSelect, hints, className, ...rest }: CommandPaletteProps): React.JSX.Element | null;
|
|
66
|
+
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;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ThreadComment {
|
|
3
|
+
id: string;
|
|
4
|
+
author: {
|
|
5
|
+
name: string;
|
|
6
|
+
avatar?: string;
|
|
7
|
+
};
|
|
8
|
+
/** Plain text; "@Name" for someone mentioned (their names in `mentions`). */
|
|
9
|
+
body: string;
|
|
10
|
+
createdAt: Date | string | number;
|
|
11
|
+
/** One you're posting: pending hovers ("Posting…"), failed drops to a trench with Retry and keeps the text. */
|
|
12
|
+
status?: 'pending' | 'failed';
|
|
13
|
+
/** Names mentioned in the body, drawn as plates. */
|
|
14
|
+
mentions?: string[];
|
|
15
|
+
/** Yours: it can be deleted. */
|
|
16
|
+
mine?: boolean;
|
|
17
|
+
/** Deleted: its result stays in its slot ("Comment deleted") with Undo. */
|
|
18
|
+
deleted?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface Mentionable {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CommentThreadProps {
|
|
25
|
+
comments: ThreadComment[];
|
|
26
|
+
/** The thread is resolved: stamped, muted and collapsed to one line, kept in place. */
|
|
27
|
+
resolved?: {
|
|
28
|
+
by: string;
|
|
29
|
+
} | false;
|
|
30
|
+
onPost?: (body: string, mentions: Mentionable[]) => void;
|
|
31
|
+
onResolve?: () => void;
|
|
32
|
+
onReopen?: () => void;
|
|
33
|
+
onRetry?: (id: string) => void;
|
|
34
|
+
onDelete?: (id: string) => void;
|
|
35
|
+
onUndoDelete?: (id: string) => void;
|
|
36
|
+
/** People who can be mentioned, for a query after "@". */
|
|
37
|
+
mentionable?: (query: string) => Mentionable[];
|
|
38
|
+
/** Other people typing now (shown with their presence, never announced). */
|
|
39
|
+
typing?: string[];
|
|
40
|
+
'aria-label'?: string;
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Comments on a record. Posted comments are the record, flush on the ground; the composer is an opening that fills; a
|
|
45
|
+
* comment being posted hovers until it lands, or drops to a trench keeping its text. A resolved thread is stamped like a
|
|
46
|
+
* done Checklist item: muted, collapsed to one line, kept in place. Mentions are a listbox at level 3.
|
|
47
|
+
*/
|
|
48
|
+
export declare function CommentThread({ comments, resolved, onPost, onResolve, onReopen, onRetry, onDelete, onUndoDelete, mentionable, typing, 'aria-label': label, className }: CommentThreadProps): React.JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ConfirmationState = 'requested' | 'approved' | 'running' | 'done' | 'failed' | 'rejected' | 'expired';
|
|
3
|
+
export interface ConfirmationProps {
|
|
4
|
+
state: ConfirmationState;
|
|
5
|
+
/** What's proposed ("Send campaign email"). */
|
|
6
|
+
title: React.ReactNode;
|
|
7
|
+
/** The concrete consequence, in words ("214 Pro customers will receive “October product update”."). */
|
|
8
|
+
consequence: React.ReactNode;
|
|
9
|
+
/** What exactly would change: a DiffView, a list, a preview. */
|
|
10
|
+
details?: React.ReactNode;
|
|
11
|
+
/** The verb and outcome ("Send 214 emails"). Default "Approve". */
|
|
12
|
+
approveLabel?: string;
|
|
13
|
+
/** Default "Reject". */
|
|
14
|
+
rejectLabel?: string;
|
|
15
|
+
/** While it runs ("Sending…"). Default "Working…". */
|
|
16
|
+
runningLabel?: string;
|
|
17
|
+
/** Once done ("Sent"). Default "Done". */
|
|
18
|
+
doneLabel?: string;
|
|
19
|
+
/** When it failed ("Couldn't send"). Default "Couldn't finish". */
|
|
20
|
+
failedLabel?: string;
|
|
21
|
+
/** For consequential actions: approving needs a hold, or a stationary Dialog for irreversible ones. */
|
|
22
|
+
escalate?: 'hold' | 'dialog';
|
|
23
|
+
/** Who resolved it and when, for rejected and done ("Maya"). */
|
|
24
|
+
resolvedBy?: string;
|
|
25
|
+
resolvedAt?: Date | string | number;
|
|
26
|
+
/** Who's asking. Default "The assistant". */
|
|
27
|
+
requestedBy?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Wider ways to approve (#280): Approve becomes a SplitButton whose face approves once and whose menu ("More ways to
|
|
30
|
+
* approve") holds these. Ignored with `escalate`: an action that needs a hold or a dialog is never pre-approved.
|
|
31
|
+
*/
|
|
32
|
+
scopes?: {
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
}[];
|
|
37
|
+
/**
|
|
38
|
+
* Fields to change the proposal before approving it (#281): an Edit action opens them in place inside the card.
|
|
39
|
+
* Keep `consequence` and `approveLabel` following the edited values, so Approve names what will happen.
|
|
40
|
+
*/
|
|
41
|
+
edit?: React.ReactNode;
|
|
42
|
+
/** The proposal was changed: an "Edited" plate by the title, and "edited and approved by you" once done. */
|
|
43
|
+
edited?: boolean;
|
|
44
|
+
/** Cancel edit or Escape in the fields: put the values back. */
|
|
45
|
+
onEditCancel?: () => void;
|
|
46
|
+
/** The scope it was approved with ('once', or a scope's value), named in the resolved line. */
|
|
47
|
+
resolvedScope?: string;
|
|
48
|
+
/** Called with the scope: 'once' from the face, or a scope's value from the menu. */
|
|
49
|
+
onApprove?: (scope?: string) => void;
|
|
50
|
+
onReject?: () => void;
|
|
51
|
+
onRetry?: () => void;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Approve or reject an action an agent proposes. A proposal is raised, not pending: it's status that asks for action
|
|
56
|
+
* (Alert's raised rule), naming the consequence, with Approve and Reject. Nothing has been dispatched, so it mustn't
|
|
57
|
+
* hover. Once approved it becomes a pending write (hovers), then lands or drops to a trench. Rejected and expired are
|
|
58
|
+
* flush and muted, kept in the record.
|
|
59
|
+
*/
|
|
60
|
+
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;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuEntry } from './overlays.js';
|
|
3
|
+
export interface ContextMenuProps {
|
|
4
|
+
/** The actions on the thing. A function is called each time the menu opens. Submenus aren't offered: one floating surface at a time. */
|
|
5
|
+
items: MenuEntry[] | (() => MenuEntry[]);
|
|
6
|
+
/** The thing: one element. It gets the right-click, the long-press and Shift+F10 / the Menu key. */
|
|
7
|
+
children: React.ReactElement<any>;
|
|
8
|
+
/** Names the menu. Default "Actions". */
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
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
|
+
* 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
|
+
* flush row doesn't lift out of its table. Every action here must also be reachable another way.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ContextMenu({ items, children, 'aria-label': label, onOpenChange }: ContextMenuProps): React.JSX.Element;
|
package/dist/types/controls.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { DepthProps } from './core';
|
|
2
|
+
import { DepthProps } from './core.js';
|
|
3
|
+
import { Promised, SkeletonOption } from './suspense.js';
|
|
3
4
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
5
|
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
5
6
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -13,21 +14,53 @@ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React
|
|
|
13
14
|
export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, DepthProps {
|
|
14
15
|
/** Lifts on hover and presses on click. Only set it when the whole card does something. */
|
|
15
16
|
interactive?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The card holds a Suspense boundary: while anything of yours inside it suspends, the card stays up and its body is an
|
|
19
|
+
* imprint (a title line and `lines` lines of text, default 3). `false` lets it suspend to your own boundary.
|
|
20
|
+
* It's also a loading scope: its optional parts (description, body text) wait while its required parts do.
|
|
21
|
+
*/
|
|
22
|
+
skeleton?: SkeletonOption;
|
|
16
23
|
}
|
|
17
24
|
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
25
|
export declare const CardHeader: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Text that may still be on its way: `undefined` while your data loads (`{user?.name}`), a promise, or one promise among
|
|
28
|
+
* plain text. `null` renders nothing.
|
|
29
|
+
*/
|
|
30
|
+
type PromisedText<E> = Omit<React.HTMLAttributes<E>, 'children'> & {
|
|
31
|
+
children?: React.ReactNode | PromiseLike<React.ReactNode> | Array<React.ReactNode | PromiseLike<React.ReactNode>>;
|
|
32
|
+
/** While the text is on its way, its imprint: `lines` (one for a title, two for a description) and `width`. `false`: render what you pass as it is, and let promises suspend to your own boundary. */
|
|
33
|
+
skeleton?: SkeletonOption;
|
|
34
|
+
};
|
|
35
|
+
export declare const CardTitle: ({ className, children, skeleton, ...p }: PromisedText<HTMLHeadingElement>) => React.JSX.Element;
|
|
36
|
+
export declare const CardDescription: ({ className, children, skeleton, ...p }: PromisedText<HTMLParagraphElement>) => React.JSX.Element;
|
|
37
|
+
export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
38
|
+
/** The body holds a Suspense boundary: while anything of yours inside it suspends, or its text (`{user?.bio}`) is undefined while the card's other parts are, it's `lines` lines of imprint (default 3). `false` suspends to your own boundary. */
|
|
39
|
+
skeleton?: SkeletonOption;
|
|
40
|
+
}
|
|
41
|
+
export declare const CardContent: ({ className, skeleton, children, ...p }: CardContentProps) => React.JSX.Element;
|
|
22
42
|
export declare const CardFooter: ({ className, ...p }: React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
23
|
-
export interface
|
|
43
|
+
export interface SuggestionProps {
|
|
44
|
+
/**
|
|
45
|
+
* A value proposed for this field (by an AI feature, autofill, a template), drawn as a ghost of the value in ink-faint:
|
|
46
|
+
* the whole value while the field is empty (or the rest of it while what's typed matches its start), or after the text
|
|
47
|
+
* with suggestionMode="append". Tab accepts, Escape dismisses, typing carries on past it. It's never put in the value,
|
|
48
|
+
* so an empty field with a ghost is still an opening.
|
|
49
|
+
*/
|
|
50
|
+
suggestion?: string;
|
|
51
|
+
/** 'replace' (default): the suggestion is the whole value. 'append': it continues the text. */
|
|
52
|
+
suggestionMode?: 'replace' | 'append';
|
|
53
|
+
/** Called with the new value when Tab accepts (onChange is called too). */
|
|
54
|
+
onAcceptSuggestion?: (value: string) => void;
|
|
55
|
+
}
|
|
56
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, SuggestionProps {
|
|
24
57
|
invalid?: boolean;
|
|
25
58
|
leading?: React.ReactNode;
|
|
26
59
|
trailing?: React.ReactNode;
|
|
27
60
|
size?: 'sm' | 'md';
|
|
28
61
|
}
|
|
29
62
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
30
|
-
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
63
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, SuggestionProps {
|
|
31
64
|
invalid?: boolean;
|
|
32
65
|
/** With maxLength, the well fills from the bottom as the text approaches the limit, and shows a count. Default true. */
|
|
33
66
|
showFill?: boolean;
|
|
@@ -93,8 +126,9 @@ export declare function TabsList({ className, children, ...rest }: React.HTMLAtt
|
|
|
93
126
|
export declare function TabsTrigger({ value, className, children, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
94
127
|
value: string;
|
|
95
128
|
}): React.JSX.Element;
|
|
96
|
-
export declare function TabsContent({ value, className, ...rest }: React.HTMLAttributes<HTMLDivElement> & {
|
|
129
|
+
export declare function TabsContent({ value, forceMount, className, ...rest }: React.HTMLAttributes<HTMLDivElement> & {
|
|
97
130
|
value: string;
|
|
131
|
+
forceMount?: boolean;
|
|
98
132
|
}): React.JSX.Element | null;
|
|
99
133
|
export interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
100
134
|
value?: number;
|
|
@@ -108,14 +142,51 @@ export interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
108
142
|
format?: (v: number) => React.ReactNode;
|
|
109
143
|
'aria-label'?: string;
|
|
110
144
|
}
|
|
111
|
-
|
|
145
|
+
/** A range: two thumbs with the raised fill between them. */
|
|
146
|
+
export interface SliderRangeProps extends Omit<SliderProps, 'value' | 'defaultValue' | 'onValueChange' | 'aria-label'> {
|
|
147
|
+
value?: [number, number];
|
|
148
|
+
defaultValue?: [number, number];
|
|
149
|
+
onValueChange?: (v: [number, number]) => void;
|
|
150
|
+
/** Steps the thumbs keep between them, so they can't meet. Default 0. */
|
|
151
|
+
minStepsBetween?: number;
|
|
152
|
+
/** A name per thumb, or one name for the pair (each thumb is then "<name>, minimum" and "<name>, maximum"). */
|
|
153
|
+
'aria-label'?: string | [string, string];
|
|
154
|
+
}
|
|
155
|
+
export declare function Slider(props: SliderProps): React.ReactElement;
|
|
156
|
+
export declare function Slider(props: SliderRangeProps): React.ReactElement;
|
|
157
|
+
/** Two values on one track: what the range Slider and ChartBrush share. A thumb can't cross the other or come within
|
|
158
|
+
* `minStepsBetween` of it; dragging between the thumbs pans both; pressing outside them moves the nearer one there,
|
|
159
|
+
* or with `outside: 'centre'` centres the pair there and pans from it. */
|
|
160
|
+
export declare function useRange({ value, defaultValue, onValueChange, min, max, step, minStepsBetween, disabled, outside }: {
|
|
161
|
+
value?: [number, number];
|
|
162
|
+
defaultValue?: [number, number];
|
|
163
|
+
onValueChange?: (v: [number, number]) => void;
|
|
164
|
+
min: number;
|
|
165
|
+
max: number;
|
|
166
|
+
step: number;
|
|
167
|
+
minStepsBetween?: number;
|
|
168
|
+
disabled?: boolean;
|
|
169
|
+
outside?: 'nearer' | 'centre';
|
|
170
|
+
}): {
|
|
171
|
+
value: [number, number];
|
|
172
|
+
set: (v: [number, number]) => void;
|
|
173
|
+
held: 0 | 1 | "both" | "tie" | null;
|
|
174
|
+
track: React.RefObject<HTMLDivElement | null>;
|
|
175
|
+
bounds: (i: 0 | 1) => [number, number];
|
|
176
|
+
pct: (n: number) => number;
|
|
177
|
+
press: (e: React.PointerEvent<HTMLElement>, thumb?: 0 | 1) => 0 | 1 | "both" | undefined;
|
|
178
|
+
drag: (e: React.PointerEvent<HTMLElement>) => void;
|
|
179
|
+
release: () => void;
|
|
180
|
+
keys: (i: 0 | 1) => (e: React.KeyboardEvent) => void;
|
|
181
|
+
shift: (d: number) => void;
|
|
182
|
+
};
|
|
112
183
|
export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
113
184
|
value?: number | null;
|
|
114
185
|
max?: number;
|
|
115
186
|
'aria-label'?: string;
|
|
116
187
|
}
|
|
117
188
|
export declare function Progress({ value, max, className, ...rest }: ProgressProps): React.JSX.Element;
|
|
118
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
189
|
+
export interface BadgeProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
119
190
|
tone?: 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';
|
|
120
191
|
/**
|
|
121
192
|
* plate (default): an indicator plate set flush into the page. tinted: the plate takes its tone's colour.
|
|
@@ -127,27 +198,43 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
127
198
|
lamp?: boolean | 'pulse';
|
|
128
199
|
/** @deprecated Use `lamp`. */
|
|
129
200
|
dot?: boolean;
|
|
201
|
+
/** The label. Undefined while your data loads, or a promise: until it arrives the badge is a plate-shaped imprint. */
|
|
202
|
+
children?: React.ReactNode | PromiseLike<React.ReactNode> | Array<React.ReactNode | PromiseLike<React.ReactNode>>;
|
|
203
|
+
/** 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
|
+
skeleton?: SkeletonOption;
|
|
130
205
|
}
|
|
131
206
|
/** A label stamped into the record. Status carries a lamp that relights when it changes; a changed label is re-stamped. */
|
|
132
|
-
export declare function Badge({
|
|
207
|
+
export declare function Badge({ children, skeleton, ...props }: BadgeProps): React.JSX.Element;
|
|
133
208
|
export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
134
|
-
name:
|
|
135
|
-
|
|
209
|
+
/** 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. */
|
|
210
|
+
name: Promised<string> | undefined;
|
|
211
|
+
/** May be a promise, like `name`. If the image fails to load, the initials show instead. */
|
|
212
|
+
src?: Promised<string | undefined>;
|
|
213
|
+
/** In pixels. Default 36. */
|
|
136
214
|
size?: number;
|
|
137
|
-
/**
|
|
215
|
+
/** `circle` (default) for a person; `square` for a team, an organisation, a bot or an agent. */
|
|
216
|
+
shape?: 'circle' | 'square';
|
|
217
|
+
/** Presence: active and idle people are here, so they rest on the page (a filled lamp or an empty one says which); offline people lie flat in it, grey. */
|
|
138
218
|
status?: 'active' | 'idle' | 'offline';
|
|
139
|
-
/** Speaking, typing or presenting right now: the
|
|
219
|
+
/** Speaking, typing or presenting right now: the face leaves the ground and drifts above its shadow. */
|
|
140
220
|
live?: boolean;
|
|
141
221
|
/** Ties the person to their presence colour, the same ring they wear on anything they're holding. */
|
|
142
222
|
presence?: 1 | 2 | 3;
|
|
143
|
-
/** The status lamp (green active, amber idle). Default: shown when there is a status and the avatar is 24px or larger. Never shown inside AvatarGroup. */
|
|
223
|
+
/** The status lamp (filled green active, empty amber ring idle). Default: shown when there is a status and the avatar is 24px or larger. Never shown inside AvatarGroup. */
|
|
144
224
|
lamp?: boolean;
|
|
225
|
+
/** `false`: no imprint. An undefined `name` renders an empty face; a promised one suspends to your own boundary. */
|
|
226
|
+
skeleton?: boolean;
|
|
145
227
|
}
|
|
146
|
-
/** A disc
|
|
147
|
-
export declare function Avatar({
|
|
148
|
-
export
|
|
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. */
|
|
229
|
+
export declare function Avatar({ skeleton, ...props }: AvatarProps): React.JSX.Element;
|
|
230
|
+
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
231
|
+
/** Show at most this many faces; the rest become a "+N" plate that names them. */
|
|
149
232
|
max?: number;
|
|
150
|
-
|
|
233
|
+
/** In pixels, for every face that doesn't set its own. Default: the first face's size, or 36. */
|
|
234
|
+
size?: number;
|
|
235
|
+
}
|
|
236
|
+
/** Faces standing on one ground line, each cut out of the one before it. */
|
|
237
|
+
export declare function AvatarGroup({ className, children, max, size: groupSize, style, ...rest }: AvatarGroupProps): React.JSX.Element;
|
|
151
238
|
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
152
239
|
/** When it turns true, the children rise out of the imprint into place. */
|
|
153
240
|
loaded?: boolean;
|
|
@@ -169,9 +256,15 @@ export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
169
256
|
icon?: React.ReactNode;
|
|
170
257
|
/** Shows a dismiss button; the sheet lifts off the page and the gap closes, then this is called. */
|
|
171
258
|
onDismiss?: () => void;
|
|
259
|
+
/** The dismiss button's words ("Remind me tomorrow"). Default: an × named "Dismiss". */
|
|
260
|
+
dismissLabel?: string;
|
|
261
|
+
/** 'page': a banner for the whole app or page, edge to edge with no side rounding, in a labelled region. Default 'inline'. */
|
|
262
|
+
placement?: 'inline' | 'page';
|
|
263
|
+
/** With placement="page": stays at the top while the page scrolls. */
|
|
264
|
+
sticky?: boolean;
|
|
172
265
|
}
|
|
173
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. */
|
|
174
|
-
export declare function Alert({ tone, variant, title, action, icon, onDismiss, settle, className, style, children, ...rest }: AlertProps): React.JSX.Element;
|
|
267
|
+
export declare function Alert({ tone, variant, title, action, icon, onDismiss, dismissLabel, placement, sticky, settle, className, style, children, ...rest }: AlertProps): React.JSX.Element;
|
|
175
268
|
export interface AlertStackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
176
269
|
/** Alert elements, most important first. Give each a key. */
|
|
177
270
|
children: React.ReactNode;
|
|
@@ -182,12 +275,14 @@ export interface AlertStackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
182
275
|
moreLabel?: (hidden: number) => React.ReactNode;
|
|
183
276
|
/** Label for collapsing. Default "Show less". */
|
|
184
277
|
lessLabel?: React.ReactNode;
|
|
278
|
+
/** 'page': a stack of page banners, edge to edge. Give each Alert placement="page" too. */
|
|
279
|
+
placement?: 'inline' | 'page';
|
|
185
280
|
}
|
|
186
281
|
/**
|
|
187
282
|
* Several alerts as a stack of sheets: the first lies on top and the others peek out beneath it, each tinted by its
|
|
188
283
|
* own tone, with a count. Opening the stack fans them out; dismissing the top one lifts it off and the next comes up.
|
|
189
284
|
*/
|
|
190
|
-
export declare function AlertStack({ children, expanded, defaultExpanded, onExpandedChange, moreLabel, lessLabel, className, ...rest }: AlertStackProps): React.JSX.Element;
|
|
285
|
+
export declare function AlertStack({ children, expanded, defaultExpanded, onExpandedChange, moreLabel, lessLabel, placement, className, ...rest }: AlertStackProps): React.JSX.Element;
|
|
191
286
|
export interface AccordionItem {
|
|
192
287
|
value: string;
|
|
193
288
|
title: React.ReactNode;
|
|
@@ -228,9 +323,25 @@ export interface DropZoneProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
228
323
|
multiple?: boolean;
|
|
229
324
|
/** Force a visual state, for documentation: idle, armed (a file is being dragged somewhere on the page) or over. */
|
|
230
325
|
state?: 'idle' | 'armed' | 'over';
|
|
326
|
+
/** The files you're handling, shown as slats under the zone: uploading (a Progress fill), processing (hovering, pending), done (lands and settles) or failed (a trench with Retry). */
|
|
327
|
+
queue?: UploadItem[];
|
|
328
|
+
onRetry?: (id: string) => void;
|
|
329
|
+
onCancel?: (id: string) => void;
|
|
330
|
+
onRemove?: (id: string) => void;
|
|
331
|
+
}
|
|
332
|
+
export interface UploadItem {
|
|
333
|
+
id: string;
|
|
334
|
+
name: string;
|
|
335
|
+
/** Bytes. */
|
|
336
|
+
size?: number;
|
|
337
|
+
state: 'uploading' | 'processing' | 'done' | 'failed';
|
|
338
|
+
/** 0–100, while uploading. */
|
|
339
|
+
progress?: number;
|
|
340
|
+
/** Why it failed, in words. */
|
|
341
|
+
error?: string;
|
|
231
342
|
}
|
|
232
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. */
|
|
233
|
-
export declare function DropZone({ onFiles, accept, multiple, state, className, children, ...rest }: DropZoneProps): React.JSX.Element;
|
|
344
|
+
export declare function DropZone({ onFiles, accept, multiple, state, queue, onRetry, onCancel, onRemove, className, children, ...rest }: DropZoneProps): React.JSX.Element;
|
|
234
345
|
export interface SortableListProps<T> {
|
|
235
346
|
items: T[];
|
|
236
347
|
getKey: (item: T) => string;
|
|
@@ -246,3 +357,4 @@ export interface SortableListProps<T> {
|
|
|
246
357
|
}
|
|
247
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. */
|
|
248
359
|
export declare function SortableList<T>({ items, getKey, onReorder, renderItem, getLabel, gap, className, ...rest }: SortableListProps<T>): React.JSX.Element;
|
|
360
|
+
export {};
|