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
package/dist/types/stepper.d.ts
CHANGED
|
@@ -11,8 +11,11 @@ export interface StepperProps extends Omit<React.OlHTMLAttributes<HTMLOListEleme
|
|
|
11
11
|
current: number;
|
|
12
12
|
/** Makes completed steps buttons that go back to them. */
|
|
13
13
|
onStepChange?: (index: number) => void;
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Default 'horizontal'. 'auto' (#264): horizontal when every step fits on one line in its container, vertical when
|
|
16
|
+
* not, so a phone never shows connectors that lead to the next line.
|
|
17
|
+
*/
|
|
18
|
+
orientation?: 'horizontal' | 'vertical' | 'auto';
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
21
|
* A process as a staircase of plates on one ground line, in the breadcrumb's vocabulary. Completed steps are settled into
|
|
@@ -20,4 +23,4 @@ export interface StepperProps extends Omit<React.OlHTMLAttributes<HTMLOListEleme
|
|
|
20
23
|
* pressed into the page. Advancing presses the current step down into the record, stamps its check in, then raises the
|
|
21
24
|
* next one out of its imprint.
|
|
22
25
|
*/
|
|
23
|
-
export declare function Stepper({ steps, current, onStepChange, orientation, className, ...rest }: StepperProps): React.JSX.Element;
|
|
26
|
+
export declare function Stepper({ steps, current, onStepChange, orientation: orientationProp, className, ...rest }: StepperProps): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SuggestionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChoose'> {
|
|
3
|
+
/** Names the group: "Suggested follow-ups", "Start with". */
|
|
4
|
+
'aria-label': string;
|
|
5
|
+
/** 'fill' (default) puts the text in the composer to edit; 'send' sends it at once. */
|
|
6
|
+
mode?: 'fill' | 'send';
|
|
7
|
+
/** Called with the chosen suggestion's value (or its text). Fill or send it from here. */
|
|
8
|
+
onChoose: (value: string) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Follow-ups that became available after an answer: they cross-fade in over dur-onset, never rising. Default true
|
|
11
|
+
* inside a Message, false elsewhere (starters in an empty conversation are simply there).
|
|
12
|
+
*/
|
|
13
|
+
arrive?: boolean;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface SuggestionItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
17
|
+
/** What's filled or sent, when it's longer than the label. Default the label's text. */
|
|
18
|
+
value?: string;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Prompts to start from or follow up with (#272): small secondary buttons, raised at level 1 like any affordance and
|
|
23
|
+
* never level 2, since the view's one primary is the composer's Send. Starters sit in an EmptyState; follow-ups sit
|
|
24
|
+
* under an answer and cross-fade in once it's complete. More than four become one toolbar tab stop with arrow keys.
|
|
25
|
+
* After choosing, focus goes to the composer (with the caret at the end, to edit what was filled).
|
|
26
|
+
*/
|
|
27
|
+
export declare function Suggestions({ mode, onChoose, arrive, className, children, ...rest }: SuggestionsProps): React.JSX.Element;
|
|
28
|
+
/** One suggestion: named by its text, plus "sends now" when choosing it sends. */
|
|
29
|
+
export declare function Suggestion({ value, className, children, onClick, ...rest }: SuggestionItemProps): React.JSX.Element;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** A value, or a promise of one. A component that takes one shows its own imprint until it lands. */
|
|
3
|
+
export type Promised<T> = T | PromiseLike<T>;
|
|
4
|
+
/** Hints for a component's imprint, or `false` to let it suspend to your own boundary instead. */
|
|
5
|
+
export type SkeletonOption = boolean | {
|
|
6
|
+
lines?: number;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
};
|
|
9
|
+
export declare const isPromise: (v: unknown) => v is PromiseLike<unknown>;
|
|
10
|
+
/** Content that may still be on its way: `undefined` while your data loads, or a promise. `null` means there is nothing. */
|
|
11
|
+
export type Pending<T> = T | PromiseLike<T> | undefined;
|
|
12
|
+
/** Children that hold a promise, at the top level or one level down (`Welcome back, {name}`). */
|
|
13
|
+
export declare const hasPromise: (children: unknown) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Reads a promised value, suspending until it lands. React 19's `use()` when it's there; on React 18, the same contract
|
|
16
|
+
* by hand (the promise is thrown to the nearest Suspense boundary and its result remembered).
|
|
17
|
+
*/
|
|
18
|
+
export declare function readPromised<T>(v: Promised<T>): T;
|
|
19
|
+
/** Reads promised children, at the top level or one level down. */
|
|
20
|
+
export declare function readChildren(children: unknown): React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Turns "not here yet" into a suspension: while `waiting`, returns a promise that resolves once it stops, for the
|
|
23
|
+
* component's inner part to read (see Arrive), so its own boundary shows the imprint. Call it in the outer part, which
|
|
24
|
+
* stays mounted and re-renders when your data arrives.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useArrival(waiting: boolean): PromiseLike<void> | null;
|
|
27
|
+
/** Suspends while `when` is pending; renders its children once it isn't. */
|
|
28
|
+
export declare function Arrive({ when, children }: {
|
|
29
|
+
when: PromiseLike<void> | null;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}): React.JSX.Element;
|
|
32
|
+
/** True from the first render that waited onwards, so the boundary stays mounted and the content can rise out of it. */
|
|
33
|
+
export declare function useHasWaited(waiting: boolean): boolean;
|
|
34
|
+
export declare function LoadingScope({ children }: {
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
}): React.JSX.Element;
|
|
37
|
+
/** For required content (an avatar's name, a title, a badge's label, a table's rows): says whether it's still on its way. */
|
|
38
|
+
export declare function useReportWaiting(waiting: boolean): void;
|
|
39
|
+
/** For optional content: is the card it's in still waiting for its required parts? */
|
|
40
|
+
export declare const useScopeWaiting: () => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Imprints inside a RevealGroup land together: each one that finishes waits, still an imprint, until the slowest has
|
|
43
|
+
* landed, then they all rise at once (four at a time, as always). Group things that load from the same place.
|
|
44
|
+
*/
|
|
45
|
+
export declare function RevealGroup({ children }: {
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
}): React.JSX.Element;
|
|
48
|
+
export interface AwaitProps {
|
|
49
|
+
/** The imprint: the fallback while the children suspend. */
|
|
50
|
+
imprint: React.ReactNode;
|
|
51
|
+
/** The shape left behind as content rises out of it. `none` for containers: their content just rises. */
|
|
52
|
+
shape?: 'circle' | 'text' | 'block' | 'none';
|
|
53
|
+
/** Sits in a line of text or a row of controls (an avatar, a badge) rather than as a block. */
|
|
54
|
+
inline?: boolean;
|
|
55
|
+
/** `false`: no boundary; the children suspend to yours. */
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Where the content rests once it lands, for `loading="breath"`. 'flush' (default): on the ground (text, a badge, a
|
|
59
|
+
* row); it fills past the ground and settles. 'raised': on its own surface at level 1 (a card); it rises a level past
|
|
60
|
+
* its rest and settles over dur-arrive.
|
|
61
|
+
*/
|
|
62
|
+
settle?: 'flush' | 'raised';
|
|
63
|
+
/**
|
|
64
|
+
* Content arriving into a view that's already showing (Load more), for `loading="breath"`: flush content gets a
|
|
65
|
+
* plate that dissolves over dur-plate. A boundary that suspends again after it has landed is late without this.
|
|
66
|
+
*/
|
|
67
|
+
late?: boolean;
|
|
68
|
+
className?: string;
|
|
69
|
+
children?: React.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A Suspense boundary whose fallback is an imprint, and whose content rises out of it. Every Suspense-native Altitude
|
|
73
|
+
* component holds one; use it in your own components to give them the same behaviour.
|
|
74
|
+
*/
|
|
75
|
+
export declare function Await({ imprint, shape, inline, enabled, settle, late, className, children }: AwaitProps): React.JSX.Element;
|
|
76
|
+
/** Lines of text, as tall as the text they stand for (each line is one line-height of the surrounding type). */
|
|
77
|
+
export declare function TextImprint({ lines, width, className }: {
|
|
78
|
+
lines?: number;
|
|
79
|
+
width?: number | string;
|
|
80
|
+
className?: string;
|
|
81
|
+
}): React.JSX.Element;
|
|
82
|
+
export declare const hint: (s: SkeletonOption | undefined) => {
|
|
83
|
+
lines?: number;
|
|
84
|
+
width?: number | string;
|
|
85
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type SyncState = 'saved' | 'saving' | 'offline' | 'failed' | 'conflict';
|
|
3
|
+
export interface SyncIndicatorProps {
|
|
4
|
+
state: SyncState;
|
|
5
|
+
/** Changes not yet on the server. */
|
|
6
|
+
pending?: number;
|
|
7
|
+
/** Conflicts waiting to be resolved, with state="conflict". */
|
|
8
|
+
conflicts?: number;
|
|
9
|
+
/** When the work last reached the server ("Saved 2 min ago"). */
|
|
10
|
+
lastSyncedAt?: Date | string | number;
|
|
11
|
+
onRetry?: () => void;
|
|
12
|
+
onOpenConflicts?: () => void;
|
|
13
|
+
/** The waiting changes, shown in a Popover when the plate is pressed. Without it the plate doesn't open anything. */
|
|
14
|
+
queue?: React.ReactNode;
|
|
15
|
+
/** Announces "Saved" at most this often, in milliseconds; going offline and failures are announced at once. Default 5000. */
|
|
16
|
+
announceEvery?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Whether your work has reached the server, said in words on a flush Badge plate whose lamp relights when the state
|
|
21
|
+
* changes: labels never lift, and a state change cross-fades rather than rises. The items it covers hover as pending
|
|
22
|
+
* until they land, so the global and per-item signals agree. With a queue, the plate opens it (and lifts, because it acts).
|
|
23
|
+
*/
|
|
24
|
+
export declare function SyncIndicator({ state, pending, conflicts, lastSyncedAt, onRetry, onOpenConflicts, queue, announceEvery, className }: SyncIndicatorProps): React.JSX.Element;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SelectOption } from './select.js';
|
|
3
|
+
export type TagResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
value: string;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
error: string;
|
|
9
|
+
};
|
|
10
|
+
export interface TagInputProps {
|
|
11
|
+
value?: string[];
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
onValueChange?: (value: string[]) => void;
|
|
14
|
+
/** Offered as you type, ranked as the Combobox ranks. Free entry is still allowed unless `restrict`. */
|
|
15
|
+
suggestions?: (string | SelectOption)[];
|
|
16
|
+
/** Only suggestions can be added. Default false. */
|
|
17
|
+
restrict?: boolean;
|
|
18
|
+
/** Keys that add what's typed: Enter and any single characters (also used to split a paste). Default [',', 'Enter']. */
|
|
19
|
+
separators?: string[];
|
|
20
|
+
/** The most tags allowed; then the field is read-only with “Limit reached”. */
|
|
21
|
+
max?: number;
|
|
22
|
+
/** Return an error to refuse a tag. Runs after `normalize`. */
|
|
23
|
+
validate?: (tag: string) => string | undefined;
|
|
24
|
+
/** Applied before validating and before comparing for duplicates. Default: trim. */
|
|
25
|
+
normalize?: (tag: string) => string;
|
|
26
|
+
/** Persist one added tag. Return its canonical text, or an error; the tag waits, pending, until then. */
|
|
27
|
+
onAdd?: (tag: string) => TagResult | Promise<TagResult>;
|
|
28
|
+
/** Persist one removal. The tag stays, pending, until the result. */
|
|
29
|
+
onRemove?: (tag: string) => TagResult | Promise<TagResult> | {
|
|
30
|
+
ok: true;
|
|
31
|
+
} | Promise<{
|
|
32
|
+
ok: true;
|
|
33
|
+
} | TagResult>;
|
|
34
|
+
/** Draw a tag's contents. Default: its text. */
|
|
35
|
+
renderTag?: (tag: string) => React.ReactNode;
|
|
36
|
+
/** Words for the count and the messages. Default ['tag', 'tags']. */
|
|
37
|
+
noun?: [singular: string, plural: string];
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
id?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
required?: boolean;
|
|
43
|
+
/** Field sets it for you when it has an error. */
|
|
44
|
+
invalid?: boolean;
|
|
45
|
+
size?: 'sm' | 'md';
|
|
46
|
+
className?: string;
|
|
47
|
+
'aria-label'?: string;
|
|
48
|
+
'aria-labelledby'?: string;
|
|
49
|
+
'aria-describedby'?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A field that holds a set of short values. The field is an opening; each tag is a label stamped flush into its floor
|
|
53
|
+
* like a Badge plate, and once it holds a tag the floor rises flush (filled). The last tag, armed by a first Backspace,
|
|
54
|
+
* lifts one level on a critical tint before a second Backspace takes it off. Suggestions are the Combobox's list.
|
|
55
|
+
*/
|
|
56
|
+
export declare function TagInput({ value, defaultValue, onValueChange, suggestions, restrict, separators, max, validate, normalize, onAdd, onRemove, renderTag, noun, placeholder, id, name, disabled, required, invalid, size, className, ...aria }: TagInputProps): React.JSX.Element;
|
|
57
|
+
export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
58
|
+
children: React.ReactNode;
|
|
59
|
+
/** Adds a ghost remove button named “Remove <label>”. */
|
|
60
|
+
onRemove?: () => void;
|
|
61
|
+
/** Names the remove button when the children aren't plain text. */
|
|
62
|
+
label?: string;
|
|
63
|
+
}
|
|
64
|
+
/** A tag on its own: the TagInput's plate, stamped flush into the page, for showing a set outside a field. */
|
|
65
|
+
export declare function Tag({ children, onRemove, label, className, ...rest }: TagProps): React.JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type TerminalChunk = {
|
|
3
|
+
text: string;
|
|
4
|
+
stream?: 'stdout' | 'stderr';
|
|
5
|
+
};
|
|
6
|
+
export interface TerminalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
7
|
+
/** The command that ran: "npm test". It names the figure. */
|
|
8
|
+
command: string;
|
|
9
|
+
/** Everything it has printed so far: a string, or chunks marked stdout or stderr as they arrived. */
|
|
10
|
+
output: string | TerminalChunk[];
|
|
11
|
+
/** Default 'running'. */
|
|
12
|
+
status?: 'running' | 'exited' | 'stopped';
|
|
13
|
+
exitCode?: number;
|
|
14
|
+
/** Milliseconds it ran (said once it's finished). */
|
|
15
|
+
duration?: number;
|
|
16
|
+
/** Shows Stop while it runs. */
|
|
17
|
+
onStop?: () => void;
|
|
18
|
+
/** Escape inside the output stops a running command. Default false. */
|
|
19
|
+
stopOnEscape?: boolean;
|
|
20
|
+
/** Lines kept on screen; earlier ones are behind "Show 1,204 earlier lines". Default 400. */
|
|
21
|
+
maxLines?: number;
|
|
22
|
+
/** Map ANSI colours to Altitude's inks (red, yellow and green to the status inks, blue and cyan to accent-ink, dim to ink-muted). Default true; off, escapes are stripped. */
|
|
23
|
+
ansi?: boolean;
|
|
24
|
+
/** Shows Copy for the whole output. Default true. */
|
|
25
|
+
copyable?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A command's output as it runs (#273), in CodeBlock's frame: flush on the ground with a 1px rim, mono. While it runs
|
|
29
|
+
* it isn't the record yet: a dashed rule down the left, "Running", and the output follows its end until you scroll up
|
|
30
|
+
* (then "Jump to latest output" rises). It finishes with one afterglow and its exit in words: "Exited with 0 · 4.2s",
|
|
31
|
+
* with a critical mark when non-zero (the edge stays neutral: #374), or "Stopped by you". stderr lines carry a critical mark and say "stderr".
|
|
32
|
+
*/
|
|
33
|
+
export declare function Terminal({ command, output, status, exitCode, duration, onStop, stopOnEscape, maxLines, ansi, copyable, className, ...rest }: TerminalProps): React.JSX.Element;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ThreadStatus = 'idle' | 'working' | 'needs-input' | 'failed' | 'stopped';
|
|
3
|
+
export interface ThreadListProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
|
+
/** A search field above the list; ⌘K / Ctrl+K focuses it. */
|
|
5
|
+
searchable?: boolean;
|
|
6
|
+
onSearch?: (query: string) => void;
|
|
7
|
+
/** Default "Search conversations". */
|
|
8
|
+
searchLabel?: string;
|
|
9
|
+
/** ThreadListGroups. */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Conversations with an assistant (#269), in a Sidebar: rows are destinations (flush, the current one on the raised
|
|
14
|
+
* pill), and each says its state in words. A working thread isn't pending (nothing you sent is in flight), so it
|
|
15
|
+
* doesn't hover: a plate with a steady lamp says "Working". One that needs you says so on a caution plate, and is
|
|
16
|
+
* announced once; finishing isn't announced. Rename in place, delete with a receipt and Undo.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ThreadList({ searchable, onSearch, searchLabel, className, children, ...rest }: ThreadListProps): React.JSX.Element;
|
|
19
|
+
export interface ThreadListGroupProps {
|
|
20
|
+
label: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A run of threads under a heading: "Today", "Yesterday", "Previous 7 days". */
|
|
25
|
+
export declare function ThreadListGroup({ label, children, className }: ThreadListGroupProps): React.JSX.Element;
|
|
26
|
+
export interface ThreadListItemProps {
|
|
27
|
+
href: string;
|
|
28
|
+
title: string;
|
|
29
|
+
updatedAt: Date | string | number;
|
|
30
|
+
/** Default 'idle'. */
|
|
31
|
+
status?: ThreadStatus;
|
|
32
|
+
/** For 'needs-input': what it needs. Default 'approval'. */
|
|
33
|
+
needs?: 'approval' | 'question';
|
|
34
|
+
/** Finished while you were away: a dot, the title in 600, and "Unread" in its name. */
|
|
35
|
+
unread?: boolean;
|
|
36
|
+
current?: boolean;
|
|
37
|
+
onSelect?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
38
|
+
/** Rename in place (F2, or the row menu). */
|
|
39
|
+
onRename?: (title: string) => void;
|
|
40
|
+
/** Delete (Delete key, or the row menu): the row becomes a receipt with Undo. Remove it from your data in onDeleted. */
|
|
41
|
+
onDelete?: () => void;
|
|
42
|
+
onUndoDelete?: () => void;
|
|
43
|
+
/** The receipt has closed: drop the thread now. */
|
|
44
|
+
onDeleted?: () => void;
|
|
45
|
+
onArchive?: () => void;
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
48
|
+
/** One conversation: a destination row with its state in words, a row menu, rename in place and delete with Undo. */
|
|
49
|
+
export declare function ThreadListItem({ href, title, updatedAt, status, needs, unread, current, onSelect, onRename, onDelete, onUndoDelete, onDeleted, onArchive, className }: ThreadListItemProps): React.JSX.Element | null;
|
|
50
|
+
/** "New conversation": secondary, so the composer's Send keeps the view's one primary. */
|
|
51
|
+
export declare function ThreadListNew({ children, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
52
|
+
children?: React.ReactNode;
|
|
53
|
+
}): React.JSX.Element;
|
|
54
|
+
/** Groups threads by when they were last updated: Today, Yesterday, Previous 7 days, Previous 30 days, then by month. */
|
|
55
|
+
export declare function groupByDate<T>(threads: T[], getDate: (t: T) => Date | string | number, now?: Date | number, locale?: string): {
|
|
56
|
+
label: string;
|
|
57
|
+
threads: T[];
|
|
58
|
+
}[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface TimeInputProps {
|
|
3
|
+
/** A time of day, "HH:mm" on a 24-hour clock, or null. It's only set once every segment holds a value. */
|
|
4
|
+
value?: string | null;
|
|
5
|
+
defaultValue?: string | null;
|
|
6
|
+
onValueChange?: (value: string | null) => void;
|
|
7
|
+
/** The arrow keys move the minutes by this much. Default 1. */
|
|
8
|
+
step?: number;
|
|
9
|
+
/** "auto" (default) follows the locale; "h12" shows AM/PM; "h23" a 24-hour clock. */
|
|
10
|
+
hourCycle?: 'auto' | 'h12' | 'h23';
|
|
11
|
+
/** Earliest and latest allowed times ("09:00", "17:30"). A time outside them is invalid. */
|
|
12
|
+
min?: string;
|
|
13
|
+
max?: string;
|
|
14
|
+
/** An IANA time zone ("Europe/Berlin"). Its short name is shown after the time and spoken with it. The value isn't converted. */
|
|
15
|
+
timeZone?: string;
|
|
16
|
+
locale?: string;
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
size?: 'sm' | 'md';
|
|
21
|
+
/** Submits the value with a form, in a hidden input. */
|
|
22
|
+
name?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
'aria-labelledby'?: string;
|
|
27
|
+
'aria-describedby'?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A time of day, typed by segment like DatePicker's dates. It's an opening that fills only when every segment holds a
|
|
31
|
+
* value: a partial time ("09:__") is still a hole. Hours, minutes and AM/PM are spinbuttons in a labelled group.
|
|
32
|
+
*/
|
|
33
|
+
export declare function TimeInput({ value, defaultValue, onValueChange, step, hourCycle, min, max, timeZone, locale, invalid, disabled, required, size, name, id, className, 'aria-describedby': describedBy, ...aria }: TimeInputProps): React.JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface TimelineProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** 'day' (default) puts a heading before each day's events ("Today", "Yesterday", "March 4"). */
|
|
4
|
+
groupBy?: 'day' | 'none';
|
|
5
|
+
/** The level of the day headings. Default 3. */
|
|
6
|
+
headingLevel?: 2 | 3 | 4;
|
|
7
|
+
locale?: string;
|
|
8
|
+
/** Names the history ("Activity"). */
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
/** TimelineItem elements, newest first or oldest first, as you like; give each a key. */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Events in order on one ground line: the 1px ink-muted rule Stepper and the chart baseline stand on, turned upright.
|
|
15
|
+
* Events are flush entries stamped onto it. A new event arrives lifted and settles; one you caused hovers until it
|
|
16
|
+
* lands, or drops to a trench with Retry.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Timeline({ groupBy, headingLevel, locale, className, children, 'aria-label': label, ...rest }: TimelineProps): React.JSX.Element;
|
|
19
|
+
export interface TimelineItemProps {
|
|
20
|
+
/** The event's own icon; it sits on the line as a flush plate. Default a dot. */
|
|
21
|
+
icon?: React.ReactNode;
|
|
22
|
+
/** When it happened. */
|
|
23
|
+
time: Date | string | number;
|
|
24
|
+
/** An event you caused: pending hovers ("Sending…") until it lands; failed drops to a trench with Retry. */
|
|
25
|
+
status?: 'pending' | 'committed' | 'failed';
|
|
26
|
+
onRetry?: () => void;
|
|
27
|
+
/** More about it (a DiffView, a payload), behind a Details disclosure. */
|
|
28
|
+
detail?: React.ReactNode;
|
|
29
|
+
/** The event links somewhere: it lifts when pointed at. */
|
|
30
|
+
href?: string;
|
|
31
|
+
locale?: string;
|
|
32
|
+
/** The sentence: who did what to what. */
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
/** Set by Timeline: arrived since the last render. */
|
|
35
|
+
isNew?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** One event: a sentence with its time, flush on the line. */
|
|
38
|
+
export declare function TimelineItem({ icon, time, status, onRetry, detail, href, locale, children, isNew }: TimelineItemProps): React.JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonProps } from './controls.js';
|
|
3
|
+
export interface ToggleProps extends Omit<ButtonProps, 'variant' | 'onChange'> {
|
|
4
|
+
pressed?: boolean;
|
|
5
|
+
defaultPressed?: boolean;
|
|
6
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
7
|
+
/** ghost (default): flush at rest, as in a toolbar. secondary: a raised slab at rest. */
|
|
8
|
+
variant?: 'ghost' | 'secondary';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A button that stays on. On is a choice, so it's built like the Switch, not like a held press: the face is cut into a
|
|
12
|
+
* shallow well with accent-soft poured in and the label in accent-ink. Its name never changes; aria-pressed says it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
/** Set by Toolbar: a ToggleGroup inside one leaves the arrow keys to it, so the whole bar is one tab stop. */
|
|
16
|
+
export declare const InToolbar: React.Context<boolean>;
|
|
17
|
+
interface ToggleGroupBase extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
|
|
18
|
+
/** For type="multiple": ghost (default) or secondary toggles. type="single" is always the segmented build. */
|
|
19
|
+
variant?: 'ghost' | 'secondary';
|
|
20
|
+
size?: ButtonProps['size'];
|
|
21
|
+
orientation?: 'horizontal' | 'vertical';
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ToggleGroupSingleProps extends ToggleGroupBase {
|
|
25
|
+
/** One choice: the options sit in a well and one raised pill glides between them, as segmented Tabs. A radio group. */
|
|
26
|
+
type: 'single';
|
|
27
|
+
value?: string;
|
|
28
|
+
defaultValue?: string;
|
|
29
|
+
onValueChange?: (value: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface ToggleGroupMultipleProps extends ToggleGroupBase {
|
|
32
|
+
/** Any number on: a row of Toggles, each with aria-pressed. */
|
|
33
|
+
type: 'multiple';
|
|
34
|
+
value?: string[];
|
|
35
|
+
defaultValue?: string[];
|
|
36
|
+
onValueChange?: (value: string[]) => void;
|
|
37
|
+
}
|
|
38
|
+
export type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;
|
|
39
|
+
export declare function ToggleGroup(props: ToggleGroupProps): React.JSX.Element;
|
|
40
|
+
export interface ToggleGroupItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
41
|
+
value: string;
|
|
42
|
+
/** type="multiple" only: an icon-only square toggle. */
|
|
43
|
+
square?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export declare const ToggleGroupItem: React.ForwardRefExoticComponent<ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonProps } from './controls.js';
|
|
3
|
+
import { ToggleProps } from './toggle.js';
|
|
4
|
+
export interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Names the toolbar ("Formatting"). Required: a toolbar is a landmark-like group. */
|
|
6
|
+
'aria-label': string;
|
|
7
|
+
orientation?: 'horizontal' | 'vertical';
|
|
8
|
+
/**
|
|
9
|
+
* When the tools don't fit: 'wrap' (default) onto another row; 'menu' moves the ones that don't fit, from the end,
|
|
10
|
+
* into a "More tools" menu, where toggles keep their state as checkable items.
|
|
11
|
+
*/
|
|
12
|
+
overflow?: 'wrap' | 'menu';
|
|
13
|
+
/** A line rim around the bar. Default false. */
|
|
14
|
+
bordered?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A row of tools with one tab stop. The bar lies on the ground; its tools are ghosts that lift when pointed at, and
|
|
18
|
+
* latched tools are Toggles. Arrow keys move between tools, Home and End jump, and returning lands where you left.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Toolbar({ orientation, overflow, bordered, className, children, ...rest }: ToolbarProps): React.JSX.Element;
|
|
21
|
+
/** Tools that belong together, parted from the next group by a ToolbarSeparator. */
|
|
22
|
+
export declare function ToolbarGroup({ className, ...rest }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
23
|
+
/** A decorative 1px line between groups: the toolbar already says what's grouped. */
|
|
24
|
+
export declare function ToolbarSeparator({ className }: {
|
|
25
|
+
className?: string;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
export interface ToolbarButtonProps extends Omit<ButtonProps, 'variant'> {
|
|
28
|
+
}
|
|
29
|
+
/** A ghost tool. Icon-only tools need an aria-label (a development warning says so). */
|
|
30
|
+
export declare const ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
export interface ToolbarToggleProps extends Omit<ToggleProps, 'variant'> {
|
|
32
|
+
}
|
|
33
|
+
/** A latched tool: a ghost Toggle. */
|
|
34
|
+
export declare const ToolbarToggle: React.ForwardRefExoticComponent<ToolbarToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface TourStep {
|
|
3
|
+
/** What it points at: a CSS selector or an element. */
|
|
4
|
+
target: string | HTMLElement | null;
|
|
5
|
+
title: string;
|
|
6
|
+
body?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface TourProps {
|
|
9
|
+
steps: TourStep[];
|
|
10
|
+
/** Whether it's showing. Start it by setting this (or defaultOpen); it ends with onFinish. */
|
|
11
|
+
open?: boolean;
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
/** Called once, when the last step's Done is pressed ('done') or the tour is skipped or dismissed ('skipped'). */
|
|
15
|
+
onFinish?: (how: 'done' | 'skipped') => void;
|
|
16
|
+
onStepChange?: (index: number) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A few steps pointing at parts of the interface, without taking it over. One step at a time floats at level 3 beside
|
|
20
|
+
* its target, which is marked with a 2px accent-ink ring (a ring, not a lift: it may not be something you press). It
|
|
21
|
+
* never dims the page (receding is the summit's privilege) and isn't modal: the target stays usable.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Tour({ steps, open, defaultOpen, onOpenChange, onFinish, onStepChange }: TourProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type TraceStepStatus = 'planned' | 'running' | 'done' | 'failed' | 'awaiting-approval';
|
|
3
|
+
export interface TraceProps extends React.OlHTMLAttributes<HTMLOListElement> {
|
|
4
|
+
'aria-label': string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The steps an agent takes, drawn as a vertical Stepper: done steps are flush in the record with a stamped check, the
|
|
8
|
+
* running step stands raised on its wall, planned steps are imprints. No spinners. A failed step drops to a trench with
|
|
9
|
+
* Retry; one waiting for approval holds a Confirmation. Steps that start without a plan arrive with the afterglow.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Trace(props: TraceProps): React.JSX.Element;
|
|
12
|
+
export interface TraceParallelProps {
|
|
13
|
+
/** What runs at once: "Subagents". */
|
|
14
|
+
label: string;
|
|
15
|
+
/** TraceSteps that run at the same time. */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Steps that run at once (#278), in a labelled group with a 1px bracket: "Subagents · 3 in parallel · 2 of 3 done".
|
|
21
|
+
* Several steps can be raised at once here, each because it's in play; the words carry the count.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TraceParallel({ label, children, className }: TraceParallelProps): React.JSX.Element;
|
|
24
|
+
export declare const formatDuration: (ms: number) => string;
|
|
25
|
+
export interface TraceStepProps {
|
|
26
|
+
title: string;
|
|
27
|
+
/** 'auto': derived from the steps inside it (a nested Trace or TraceParallel): done only when they all are. */
|
|
28
|
+
status: TraceStepStatus | 'auto';
|
|
29
|
+
/** Milliseconds it took (done or failed) or has taken so far. */
|
|
30
|
+
duration?: number;
|
|
31
|
+
/** Why it failed. */
|
|
32
|
+
error?: React.ReactNode;
|
|
33
|
+
onRetry?: () => void;
|
|
34
|
+
/** Tool calls, reasoning, a Confirmation. */
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function TraceStep({ title, status: given, duration, error, onRetry, children, className }: TraceStepProps): React.JSX.Element;
|
|
39
|
+
export interface TraceToolCallProps {
|
|
40
|
+
/** The tool's name ("search_documents"). */
|
|
41
|
+
name: string;
|
|
42
|
+
input?: unknown;
|
|
43
|
+
output?: unknown;
|
|
44
|
+
/** Open to begin with. Default false. */
|
|
45
|
+
defaultOpen?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** A tool call's input and output, behind an Accordion lid named by the tool. */
|
|
48
|
+
export declare function TraceToolCall({ name, input, output, defaultOpen }: TraceToolCallProps): React.JSX.Element;
|
|
49
|
+
export interface TraceReasoningProps {
|
|
50
|
+
/** How long it thought, in milliseconds: "Thought for 12s". Said once, when it's known; never a ticking counter. */
|
|
51
|
+
duration?: number;
|
|
52
|
+
/**
|
|
53
|
+
* 'streaming': the lid says "Thinking…" and, opened, the text follows its end as it arrives; 'complete' (default):
|
|
54
|
+
* "Thought for 12s"; 'redacted': "Reasoning hidden by the provider", with nothing to open.
|
|
55
|
+
*/
|
|
56
|
+
status?: 'streaming' | 'complete' | 'redacted';
|
|
57
|
+
/** While streaming and open, keep the newest text in view (until the person scrolls up). Default true. */
|
|
58
|
+
followWhileOpen?: boolean;
|
|
59
|
+
children?: React.ReactNode;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The model's reasoning, closed by default. While it streams it isn't the record yet: "Thinking…" on the lid and a
|
|
63
|
+
* dashed rule down the open compartment, never a shimmer or pulsing dots. Done, it's "Thought for 12s".
|
|
64
|
+
*/
|
|
65
|
+
export declare function TraceReasoning({ duration, status, followWhileOpen, children }: TraceReasoningProps): React.JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type TreeResult = {
|
|
3
|
+
ok: true;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
export type TreeCreateResult<T> = {
|
|
9
|
+
ok: true;
|
|
10
|
+
value: T;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
/** Where a node goes: under `parentId` (null for the top level), at `index` among the children once it has left its old place. */
|
|
16
|
+
export interface TreeTarget {
|
|
17
|
+
parentId: string | null;
|
|
18
|
+
index: number;
|
|
19
|
+
}
|
|
20
|
+
export interface TreeMove {
|
|
21
|
+
id: string;
|
|
22
|
+
from: TreeTarget;
|
|
23
|
+
to: TreeTarget;
|
|
24
|
+
}
|
|
25
|
+
export interface TreeHandle {
|
|
26
|
+
/** Open a naming well for a new node under `parentId` (null: the top level) at `index` (default: the end). */
|
|
27
|
+
startCreate: (parentId: string | null, index?: number) => void;
|
|
28
|
+
/** Rename a node, as F2 does. */
|
|
29
|
+
startRename: (id: string) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface TreeProps<T> {
|
|
32
|
+
'aria-label'?: string;
|
|
33
|
+
'aria-labelledby'?: string;
|
|
34
|
+
items: T[];
|
|
35
|
+
getKey: (item: T) => string;
|
|
36
|
+
getLabel: (item: T) => string;
|
|
37
|
+
/** Children, or undefined when there are none or they aren't loaded yet. */
|
|
38
|
+
getChildren?: (item: T) => T[] | undefined;
|
|
39
|
+
/** Whether a node can have children (and so shows a chevron) before they're loaded. Default: it has children. */
|
|
40
|
+
hasChildren?: (item: T) => boolean;
|
|
41
|
+
/** Called the first time a node with no loaded children is expanded; an imprint shows until `items` includes them. */
|
|
42
|
+
loadChildren?: (item: T) => void | Promise<void>;
|
|
43
|
+
expanded?: string[];
|
|
44
|
+
defaultExpanded?: string[];
|
|
45
|
+
onExpandedChange?: (expanded: string[]) => void;
|
|
46
|
+
/** Default 'single'. */
|
|
47
|
+
selectionMode?: 'single' | 'none';
|
|
48
|
+
selected?: string | null;
|
|
49
|
+
defaultSelected?: string | null;
|
|
50
|
+
onSelectedChange?: (id: string | null) => void;
|
|
51
|
+
/** Enter's default action (open the page). */
|
|
52
|
+
onAction?: (item: T) => void;
|
|
53
|
+
/** Draw a node's label. Default: getLabel. */
|
|
54
|
+
renderItem?: (item: T) => React.ReactNode;
|
|
55
|
+
/** F2. Resolve after `items` carries the new name. */
|
|
56
|
+
onRename?: (item: T, draft: string) => TreeResult | Promise<TreeResult>;
|
|
57
|
+
/** Space to carry, or drag. Resolve after `items` reflects the move. */
|
|
58
|
+
onMove?: (move: TreeMove) => TreeResult | Promise<TreeResult>;
|
|
59
|
+
/** Refuse a target: a node can never go into its own subtree, whatever this says. */
|
|
60
|
+
canDrop?: (move: TreeMove) => boolean;
|
|
61
|
+
/** Ctrl/Cmd+Enter (sibling after) and Ctrl/Cmd+Shift+Enter (child). Resolve after `items` includes the new node. */
|
|
62
|
+
onCreate?: (request: TreeTarget & {
|
|
63
|
+
name: string;
|
|
64
|
+
}) => TreeCreateResult<T> | Promise<TreeCreateResult<T>>;
|
|
65
|
+
/** Delete. Your removal policy (recovery or confirmation) applies; the tree only asks. */
|
|
66
|
+
onRemove?: (item: T) => void;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare const Tree: <T>(props: TreeProps<T> & {
|
|
70
|
+
ref?: React.Ref<TreeHandle>;
|
|
71
|
+
}) => React.ReactElement;
|