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
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EditRegionBinder, EditRegionSaveResult } from './edit-region.cjs';
|
|
3
|
+
import { Promised, SkeletonOption } from './suspense.cjs';
|
|
4
|
+
export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
5
|
+
/** The table scrolls under its header past this height. */
|
|
6
|
+
maxHeight?: number | string;
|
|
7
|
+
/** Drawn inside the scroll area, beneath the rows (DataTable puts its landing slot here). */
|
|
8
|
+
underlay?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Rows are the record: they sit on the ground with `line` dividers. The header stays flush until rows scroll under it,
|
|
12
|
+
* then rises. Rows that change place are carried there. Each row's height is drawn as one slab by its first cell.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
|
|
15
|
+
export declare const TableHeader: ({ className, ...p }: React.HTMLAttributes<HTMLTableSectionElement>) => React.JSX.Element;
|
|
16
|
+
export declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
17
|
+
export declare const TableFooter: ({ className, ...p }: React.HTMLAttributes<HTMLTableSectionElement>) => React.JSX.Element;
|
|
18
|
+
export declare const TableCaption: ({ className, ...p }: React.HTMLAttributes<HTMLTableCaptionElement>) => React.JSX.Element;
|
|
19
|
+
export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
20
|
+
/** A stable id. With it, a row whose place changes (re-sorting, reordering) is carried there instead of jumping. */
|
|
21
|
+
rowId?: string;
|
|
22
|
+
/** Selected rows are tinted accent-soft and raised one level. Pair it with a checked Checkbox in the row. */
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
/** Lifts on hover. Only when clicking the row does something. */
|
|
25
|
+
interactive?: boolean;
|
|
26
|
+
/** Focus+context filtering: match rises one level, miss sinks into a well. */
|
|
27
|
+
relevance?: 'match' | 'miss';
|
|
28
|
+
/** Afterglow: when the value changes, the row lifts, tints and settles back over dur-settle. true settles once on mount. */
|
|
29
|
+
settle?: unknown;
|
|
30
|
+
/** In someone's hand while it's being moved: level 3, tilted. */
|
|
31
|
+
held?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
|
|
34
|
+
export interface TableHeadProps extends Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
35
|
+
align?: 'start' | 'end';
|
|
36
|
+
/** This column's sort. With onSort, the header becomes a button and the th carries aria-sort. */
|
|
37
|
+
sort?: 'ascending' | 'descending' | 'none';
|
|
38
|
+
onSort?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function TableHead({ align, sort, onSort, className, children, ...rest }: TableHeadProps): React.JSX.Element;
|
|
41
|
+
export interface TableCellProps extends Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
42
|
+
align?: 'start' | 'end';
|
|
43
|
+
}
|
|
44
|
+
export declare function TableCell({ align, className, ...rest }: TableCellProps): React.JSX.Element;
|
|
45
|
+
export interface DataTableColumn<T> {
|
|
46
|
+
key: string;
|
|
47
|
+
header: React.ReactNode;
|
|
48
|
+
/** Cell content. Default: the row's value at `key`. */
|
|
49
|
+
cell?: (row: T) => React.ReactNode;
|
|
50
|
+
/** Makes the column sortable by this value. */
|
|
51
|
+
sortValue?: (row: T) => string | number;
|
|
52
|
+
align?: 'start' | 'end';
|
|
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;
|
|
61
|
+
}
|
|
62
|
+
export type TableSort = {
|
|
63
|
+
key: string;
|
|
64
|
+
direction: 'ascending' | 'descending';
|
|
65
|
+
} | null;
|
|
66
|
+
export interface DataTableProps<T> {
|
|
67
|
+
columns: DataTableColumn<T>[];
|
|
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;
|
|
72
|
+
getRowId: (row: T) => string;
|
|
73
|
+
/** A row's name, for screen readers (its checkbox, its move handle, announcements) and its button with onRowClick. */
|
|
74
|
+
getRowLabel?: (row: T) => string;
|
|
75
|
+
/** A checkbox column; selected rows rise, and the toolbar counts them. */
|
|
76
|
+
selectable?: boolean;
|
|
77
|
+
selected?: string[];
|
|
78
|
+
defaultSelected?: string[];
|
|
79
|
+
onSelectedChange?: (ids: string[]) => void;
|
|
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;
|
|
91
|
+
/** Anything else for the toolbar's end (a filter field, a button). */
|
|
92
|
+
toolbar?: React.ReactNode;
|
|
93
|
+
sort?: TableSort;
|
|
94
|
+
defaultSort?: TableSort;
|
|
95
|
+
onSortChange?: (sort: TableSort) => void;
|
|
96
|
+
/** Makes rows interactive: the first column becomes the row's button, and clicking anywhere on the row calls this. */
|
|
97
|
+
onRowClick?: (row: T) => void;
|
|
98
|
+
/** Filter in place: matches rise, misses sink. Return undefined when no filter is active. */
|
|
99
|
+
relevance?: (row: T) => 'match' | 'miss' | undefined;
|
|
100
|
+
/** Adds move handles: rows can be picked up and dropped (pointer, or Space and the arrow keys). Hidden while sorted. */
|
|
101
|
+
onReorder?: (rows: T[]) => void;
|
|
102
|
+
maxHeight?: number | string;
|
|
103
|
+
/** Shown when there are no rows. */
|
|
104
|
+
empty?: React.ReactNode;
|
|
105
|
+
className?: string;
|
|
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;
|
|
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
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* A table from data: sortable columns whose rows are carried to their new places, a checkbox column whose selected rows
|
|
170
|
+
* rise (counted by a floating Badge in the toolbar), filtering in place, interactive rows and reordering by hand.
|
|
171
|
+
*/
|
|
172
|
+
export declare function DataTable<T>({ skeleton, ...props }: DataTableProps<T>): React.JSX.Element;
|
|
173
|
+
export interface BoardPlace {
|
|
174
|
+
column: string;
|
|
175
|
+
index: number;
|
|
176
|
+
}
|
|
177
|
+
export interface BoardMove {
|
|
178
|
+
cardId: string;
|
|
179
|
+
from: BoardPlace;
|
|
180
|
+
to: BoardPlace;
|
|
181
|
+
}
|
|
182
|
+
export interface BoardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
183
|
+
/** Called when a card is dropped somewhere new (pointer), or moved a step (keyboard). Update your data; the board carries the cards. */
|
|
184
|
+
onMove: (move: BoardMove) => void;
|
|
185
|
+
/** Default "Board". */
|
|
186
|
+
'aria-label'?: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Columns of cards. Columns are receptacles: flush at rest, they open into wells while a card is carried, and the one
|
|
190
|
+
* under it deepens. Cards are raised; one picked up floats at level 3, tilted, follows the pointer, and lands with a settle.
|
|
191
|
+
*/
|
|
192
|
+
export declare const Board: React.ForwardRefExoticComponent<BoardProps & React.RefAttributes<HTMLDivElement>>;
|
|
193
|
+
export interface BoardColumnProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title'> {
|
|
194
|
+
id: string;
|
|
195
|
+
title: React.ReactNode;
|
|
196
|
+
/** A collapsed column is a Pile: its thickness and count say how many cards it holds. It still takes drops. */
|
|
197
|
+
collapsed?: boolean;
|
|
198
|
+
defaultCollapsed?: boolean;
|
|
199
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
200
|
+
/** Show the collapse button. */
|
|
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;
|
|
206
|
+
}
|
|
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;
|
|
224
|
+
export interface BoardCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
225
|
+
id: string;
|
|
226
|
+
/** How announcements name the card. Default: its first line of text. */
|
|
227
|
+
label?: string;
|
|
228
|
+
/** A collaborator is holding it: lifted, wearing their colour and name. It can't be picked up meanwhile. */
|
|
229
|
+
heldBy?: {
|
|
230
|
+
name: string;
|
|
231
|
+
presence?: 1 | 2 | 3;
|
|
232
|
+
};
|
|
233
|
+
/** Afterglow: when this value changes the card arrives tinted and lifted, then settles. */
|
|
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;
|
|
245
|
+
}
|
|
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;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface CommandItem {
|
|
3
|
+
/** Stable key within its group. Defaults to the label. */
|
|
4
|
+
id?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** A short second line of context (a path, a branch). Matched with less weight than the label. */
|
|
7
|
+
description?: string;
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** Keys shown as Kbd hints, e.g. ['⌘', 'D']. Display only: bind the shortcut yourself. */
|
|
10
|
+
shortcut?: string[];
|
|
11
|
+
/** Other words that should find this item (synonyms, old names). */
|
|
12
|
+
keywords?: string[];
|
|
13
|
+
onSelect?: () => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
tone?: 'critical';
|
|
16
|
+
/** Ephemeral adaptation: on opening, predicted items are there at once while the rest fade in over dur-onset. */
|
|
17
|
+
predicted?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface CommandGroup {
|
|
20
|
+
/** Stable key. Defaults to the group's position. */
|
|
21
|
+
id?: string;
|
|
22
|
+
label?: React.ReactNode;
|
|
23
|
+
items: CommandItem[];
|
|
24
|
+
/** Every item in the group is predicted: a "Recent" or "Suggested" group. */
|
|
25
|
+
predicted?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface CommandPaletteProps {
|
|
28
|
+
items: CommandGroup[];
|
|
29
|
+
open?: boolean;
|
|
30
|
+
defaultOpen?: boolean;
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
32
|
+
/** Called with the chosen item (after its own onSelect). */
|
|
33
|
+
onSelect?: (item: CommandItem, group: CommandGroup) => void;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/** Score an item against the query: 0 hides it, higher ranks it nearer the top. Replaces the built-in fuzzy match. */
|
|
36
|
+
filter?: (item: CommandItem, query: string) => number;
|
|
37
|
+
/** Shown when nothing matches. A function receives the query. */
|
|
38
|
+
empty?: React.ReactNode | ((query: string) => React.ReactNode);
|
|
39
|
+
/** The letter that opens and closes the palette with ⌘ (macOS) or Ctrl. Default 'k'; false for none. */
|
|
40
|
+
shortcut?: string | false;
|
|
41
|
+
/** The query, controlled. The palette never clears it on opening: the caller owns it, e.g. a persistent field handing over what was typed. */
|
|
42
|
+
query?: string;
|
|
43
|
+
/** What the query is each time the palette opens, uncontrolled. Default ''. */
|
|
44
|
+
defaultQuery?: string;
|
|
45
|
+
onQueryChange?: (query: string) => void;
|
|
46
|
+
/** Close once an item is chosen. Default true. */
|
|
47
|
+
closeOnSelect?: boolean;
|
|
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';
|
|
53
|
+
className?: string;
|
|
54
|
+
'aria-label'?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The built-in ranking. 0 means no match. An exact match beats a prefix, a prefix beats a word start, a word start
|
|
58
|
+
* beats a substring, and a substring beats letters found in order (fewer gaps rank higher).
|
|
59
|
+
*/
|
|
60
|
+
export declare function commandScore(text: string, query: string): number;
|
|
61
|
+
/**
|
|
62
|
+
* The summit: a level-5 search over everything you can do, opened with ⌘K or Ctrl+K. The page recedes behind it
|
|
63
|
+
* as it does for Dialog. The query field is an opening built like Input; one highlight glides between results;
|
|
64
|
+
* when results change, surviving rows travel to their new places and new ones rise in, a few at a time.
|
|
65
|
+
*/
|
|
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.cjs';
|
|
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;
|