@rahdar/plugin-sdk 0.0.0 → 2026.10.51
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 +38 -0
- package/index.js +52 -0
- package/package.json +46 -1
- package/peers.json +8 -0
- package/shared.d.ts +3 -0
- package/shared.js +24 -0
- package/types/branding.d.ts +14 -0
- package/types/kernel/actions/ActionHost.d.ts +16 -0
- package/types/kernel/actions/hostContext.d.ts +4 -0
- package/types/kernel/actions/types.d.ts +130 -0
- package/types/kernel/api/paging.d.ts +39 -0
- package/types/kernel/api/polling.d.ts +37 -0
- package/types/kernel/api/request.d.ts +84 -0
- package/types/kernel/api/schema.d.ts +24077 -0
- package/types/kernel/approvals/ApprovalView.d.ts +6 -0
- package/types/kernel/approvals/ApprovalsView.d.ts +7 -0
- package/types/kernel/approvals/ApproverQuorumNotice.d.ts +8 -0
- package/types/kernel/approvals/BreakGlassBanner.d.ts +5 -0
- package/types/kernel/approvals/CancelRequest.d.ts +13 -0
- package/types/kernel/approvals/DecisionPanel.d.ts +11 -0
- package/types/kernel/approvals/ExpiresIn.d.ts +10 -0
- package/types/kernel/approvals/MyRequests.d.ts +5 -0
- package/types/kernel/approvals/Recap.d.ts +9 -0
- package/types/kernel/approvals/api.d.ts +130 -0
- package/types/kernel/approvals/columns.d.ts +22 -0
- package/types/kernel/approvals/words.d.ts +31 -0
- package/types/kernel/auth/Can.d.ts +9 -0
- package/types/kernel/auth/LoginView.d.ts +9 -0
- package/types/kernel/auth/SecondFactorForm.d.ts +25 -0
- package/types/kernel/auth/StepUp.d.ts +17 -0
- package/types/kernel/auth/api.d.ts +115 -0
- package/types/kernel/auth/freshSignIn.d.ts +2 -0
- package/types/kernel/auth/useCan.d.ts +49 -0
- package/types/kernel/auth/webauthn.d.ts +19 -0
- package/types/kernel/feature.d.ts +90 -0
- package/types/kernel/features.d.ts +5 -0
- package/types/kernel/inbox/InboxBell.d.ts +6 -0
- package/types/kernel/inbox/InboxView.d.ts +6 -0
- package/types/kernel/inbox/NoticeRow.d.ts +17 -0
- package/types/kernel/inbox/api.d.ts +53 -0
- package/types/kernel/keyboard/ShortcutsHelp.d.ts +6 -0
- package/types/kernel/keyboard/filterShortcut.d.ts +5 -0
- package/types/kernel/keyboard/keys.d.ts +14 -0
- package/types/kernel/keyboard/shortcuts.d.ts +5 -0
- package/types/kernel/keyboard/useKeySequences.d.ts +16 -0
- package/types/kernel/manifest.d.ts +21 -0
- package/types/kernel/metrics/ChartPanel.d.ts +28 -0
- package/types/kernel/metrics/MetricChart.d.ts +13 -0
- package/types/kernel/metrics/axis.d.ts +71 -0
- package/types/kernel/metrics/pluginSeries.d.ts +17 -0
- package/types/kernel/nav/currentView.d.ts +21 -0
- package/types/kernel/nav/groups.d.ts +22 -0
- package/types/kernel/plugins/PluginBoundary.d.ts +25 -0
- package/types/kernel/plugins/PluginUnavailable.d.ts +6 -0
- package/types/kernel/plugins/boot.d.ts +33 -0
- package/types/kernel/plugins/guarded.d.ts +3 -0
- package/types/kernel/plugins/usePluginsChanged.d.ts +6 -0
- package/types/kernel/plugins/validate.d.ts +19 -0
- package/types/kernel/registry.d.ts +12 -0
- package/types/kernel/routing/roots.d.ts +24 -0
- package/types/kernel/shell/AccountView.d.ts +11 -0
- package/types/kernel/shell/AdminView.d.ts +7 -0
- package/types/kernel/shell/Breadcrumb.d.ts +6 -0
- package/types/kernel/shell/ClusterLayout.d.ts +14 -0
- package/types/kernel/shell/ClusterViewNav.d.ts +13 -0
- package/types/kernel/shell/CommandPalette.d.ts +15 -0
- package/types/kernel/shell/FeatureDisabled.d.ts +13 -0
- package/types/kernel/shell/FeatureGate.d.ts +12 -0
- package/types/kernel/shell/FreshnessBar.d.ts +11 -0
- package/types/kernel/shell/GlobalContext.d.ts +7 -0
- package/types/kernel/shell/HomeView.d.ts +6 -0
- package/types/kernel/shell/NavGroup.d.ts +13 -0
- package/types/kernel/shell/NavItem.d.ts +33 -0
- package/types/kernel/shell/NavToggle.d.ts +13 -0
- package/types/kernel/shell/RootLayout.d.ts +15 -0
- package/types/kernel/shell/SectionNav.d.ts +41 -0
- package/types/kernel/shell/UserMenu.d.ts +10 -0
- package/types/kernel/shell/lastPlace.d.ts +17 -0
- package/types/kernel/shell/pageTitle.d.ts +13 -0
- package/types/kernel/shell/recents.d.ts +16 -0
- package/types/kernel/shell/useColorSchemeToggle.d.ts +10 -0
- package/types/kernel/shell/useFreshness.d.ts +25 -0
- package/types/kernel/shell/useNavCollapsed.d.ts +14 -0
- package/types/kernel/slots.d.ts +206 -0
- package/types/kernel/stream/sse.d.ts +22 -0
- package/types/kernel/stream/useClusterStream.d.ts +27 -0
- package/types/kernel/stream/useUserStream.d.ts +11 -0
- package/types/kernel/time/Ago.d.ts +9 -0
- package/types/kernel/time/ranges.d.ts +32 -0
- package/types/kernel/time/time.d.ts +89 -0
- package/types/kernel/time/timezone.d.ts +44 -0
- package/types/kernel/useDismissedNotice.d.ts +3 -0
- package/types/sdk/index.d.ts +92 -0
- package/types/ui/ActionMenuItem.d.ts +27 -0
- package/types/ui/AnchoredMenu.d.ts +20 -0
- package/types/ui/CapabilityGate.d.ts +23 -0
- package/types/ui/CapabilityReason.d.ts +11 -0
- package/types/ui/CodeEditor.d.ts +31 -0
- package/types/ui/ConfirmDialog.d.ts +51 -0
- package/types/ui/DescriptionList.d.ts +26 -0
- package/types/ui/DiagramView.d.ts +35 -0
- package/types/ui/DialogActions.d.ts +26 -0
- package/types/ui/EmptyState.d.ts +42 -0
- package/types/ui/ErrorState.d.ts +36 -0
- package/types/ui/FieldRow.d.ts +9 -0
- package/types/ui/HeldRequestLink.d.ts +4 -0
- package/types/ui/HoldToConfirm.d.ts +22 -0
- package/types/ui/LoadingState.d.ts +16 -0
- package/types/ui/NodeOutcomeSummary.d.ts +59 -0
- package/types/ui/Notice.d.ts +18 -0
- package/types/ui/Page.d.ts +13 -0
- package/types/ui/PageHeader.d.ts +18 -0
- package/types/ui/Pager.d.ts +21 -0
- package/types/ui/Section.d.ts +22 -0
- package/types/ui/Stat.d.ts +20 -0
- package/types/ui/StatusBadge.d.ts +11 -0
- package/types/ui/Toolbar.d.ts +19 -0
- package/types/ui/capabilityGate.d.ts +43 -0
- package/types/ui/codeDiagnostics.d.ts +11 -0
- package/types/ui/codeMirrorTheme.d.ts +11 -0
- package/types/ui/diagram.d.ts +49 -0
- package/types/ui/errorReading.d.ts +30 -0
- package/types/ui/formErrors.d.ts +10 -0
- package/types/ui/graph/ViewControls.d.ts +19 -0
- package/types/ui/graph/elk.d.ts +3 -0
- package/types/ui/held.d.ts +12 -0
- package/types/ui/inAppNavigation.d.ts +5 -0
- package/types/ui/nodeOutcome.d.ts +13 -0
- package/types/ui/notify.d.ts +77 -0
- package/types/ui/safeHref.d.ts +8 -0
- package/types/ui/table/ColumnsMenu.d.ts +26 -0
- package/types/ui/table/DataTable.d.ts +109 -0
- package/types/ui/table/GridFind.d.ts +16 -0
- package/types/ui/table/GridTable.d.ts +49 -0
- package/types/ui/table/HeaderCell.d.ts +25 -0
- package/types/ui/table/MiddleTruncate.d.ts +21 -0
- package/types/ui/table/StaticTable.d.ts +14 -0
- package/types/ui/table/TableStates.d.ts +35 -0
- package/types/ui/table/columns.d.ts +49 -0
- package/types/ui/table/density.d.ts +13 -0
- package/types/ui/table/gridFind.d.ts +7 -0
- package/types/ui/table/index.d.ts +5 -0
- package/types/ui/table/layout.d.ts +48 -0
- package/types/ui/table/measure.d.ts +16 -0
- package/types/ui/table/measurement.d.ts +92 -0
- package/types/ui/table/menuAnchor.d.ts +12 -0
- package/types/ui/table/rovingGrid.d.ts +37 -0
- package/types/ui/table/sort.d.ts +14 -0
- package/types/ui/table/tableState.d.ts +51 -0
- package/types/ui/table/useGridFind.d.ts +18 -0
- package/types/ui/trustedTypes.d.ts +16 -0
- package/types/ui/useTruncated.d.ts +8 -0
- package/vite.d.ts +14 -0
- package/vite.js +62 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Follow the browser, re-read every time rather than captured at load. */
|
|
2
|
+
export declare const AUTO = "auto";
|
|
3
|
+
export declare const DEFAULT_ZONE = "auto";
|
|
4
|
+
/** Whatever the browser currently believes its zone to be. */
|
|
5
|
+
export declare function localZone(): string;
|
|
6
|
+
/**
|
|
7
|
+
* What the operator chose, which may be {@link AUTO}. This is what the picker
|
|
8
|
+
* shows; {@link displayZone} is what formatters use.
|
|
9
|
+
*/
|
|
10
|
+
export declare function displayZonePreference(): string;
|
|
11
|
+
/** The zone to render instants in. Read synchronously, so formatters need no hook. */
|
|
12
|
+
export declare function displayZone(): string;
|
|
13
|
+
export declare function setDisplayZone(next: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Subscribe a view to the display zone.
|
|
16
|
+
*
|
|
17
|
+
* Any component that renders an absolute timestamp must call this, even if it
|
|
18
|
+
* ignores the returned value: `absoluteLabel` reads the zone from module state so
|
|
19
|
+
* it can be used inside a table's column accessor, which means nothing re-renders
|
|
20
|
+
* on a zone change unless something subscribed.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDisplayZone(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Every zone the runtime knows, UTC and the operator's own first.
|
|
25
|
+
*
|
|
26
|
+
* `Intl.supportedValuesOf` is the runtime's own IANA list, so it stays current
|
|
27
|
+
* without this project shipping a copy of the tz database. Where it is missing,
|
|
28
|
+
* the short list is still enough to be useful rather than empty.
|
|
29
|
+
*/
|
|
30
|
+
export declare function zoneOptions(): {
|
|
31
|
+
group: string;
|
|
32
|
+
items: {
|
|
33
|
+
value: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}[];
|
|
36
|
+
}[];
|
|
37
|
+
/**
|
|
38
|
+
* `+03:30`, or `UTC` — the suffix that keeps a rendered timestamp unambiguous.
|
|
39
|
+
*
|
|
40
|
+
* Computed for a given instant, not for now: half the world changes offset twice
|
|
41
|
+
* a year, and an event from last winter must be labelled with the offset that was
|
|
42
|
+
* in force when it happened, not the one in force today.
|
|
43
|
+
*/
|
|
44
|
+
export declare function zoneSuffix(ms: number, inZone?: string): string;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@rahdar/plugin-sdk` — everything a plugin's UI may use from Rahdar (ADR-0100). The host
|
|
3
|
+
* shares this module as a singleton, so a plugin's bundle uses the running Rahdar's own copy:
|
|
4
|
+
* the same router roots, the same query cache, the same permission checks. Nothing outside this
|
|
5
|
+
* file is part of the contract; a plugin that reaches past it breaks on the next Rahdar release.
|
|
6
|
+
*/
|
|
7
|
+
import type { ComponentProps, ComponentType, ReactElement } from 'react';
|
|
8
|
+
import type { PluginId, RahdarFeature } from '../kernel/feature.ts';
|
|
9
|
+
import { DescriptionList } from '../ui/DescriptionList.tsx';
|
|
10
|
+
import { ErrorState } from '../ui/ErrorState.tsx';
|
|
11
|
+
import { FieldRow } from '../ui/FieldRow.tsx';
|
|
12
|
+
import { LoadingState } from '../ui/LoadingState.tsx';
|
|
13
|
+
import { Notice } from '../ui/Notice.tsx';
|
|
14
|
+
import { Page } from '../ui/Page.tsx';
|
|
15
|
+
import { PageHeader } from '../ui/PageHeader.tsx';
|
|
16
|
+
import { Section } from '../ui/Section.tsx';
|
|
17
|
+
import { Stat } from '../ui/Stat.tsx';
|
|
18
|
+
import { StatusBadge } from '../ui/StatusBadge.tsx';
|
|
19
|
+
import { Toolbar } from '../ui/Toolbar.tsx';
|
|
20
|
+
export { CONTRACT } from '../kernel/feature.ts';
|
|
21
|
+
export type { NavContribution, PaletteSource, PluginId, RouteContributions, RahdarFeature, TopicHandler, } from '../kernel/feature.ts';
|
|
22
|
+
export { ADMIN_GROUPS, SETTINGS_GROUPS, type AdminGroupId, type MessageSelection, type QueueSelection, type SettingsGroupId, type SlotContribution, type SlotContributions, type SlotEntry, type SlotName, type SlotProps, } from '../kernel/slots.ts';
|
|
23
|
+
export { NAV_GROUPS, type NavGroupId } from '../kernel/nav/groups.ts';
|
|
24
|
+
export { clusterRoute, rootRoute } from '../kernel/routing/roots.ts';
|
|
25
|
+
export { ApiError, clusterKey, heldOperationsKey, OperationHeldError, request, type HeldOperation, } from '../kernel/api/request.ts';
|
|
26
|
+
export type { HeldDisplayRow, HeldEvent, HeldOperationDetail, HeldOperationSummary, HeldState, } from '../kernel/approvals/api.ts';
|
|
27
|
+
export type { InboxItem, InboxSeverity } from '../kernel/inbox/api.ts';
|
|
28
|
+
export { useCan, type AllowedActions, type ResourceWhere } from '../kernel/auth/useCan.ts';
|
|
29
|
+
/**
|
|
30
|
+
* The step-up an action shows when the server refused it for want of a fresh sign-in, such as an approver's
|
|
31
|
+
* vote: render it under the control with the mutation's error. It renders nothing for any other error.
|
|
32
|
+
*/
|
|
33
|
+
export { StepUpPrompt } from '../kernel/auth/StepUp.tsx';
|
|
34
|
+
/**
|
|
35
|
+
* The signed-in user's own stream, which the shell already holds open so their inbox and held operations stay
|
|
36
|
+
* fresh on every page. A view shares that connection and reads its status, to poll while it is not `live`.
|
|
37
|
+
*/
|
|
38
|
+
export { useUserStream } from '../kernel/stream/useUserStream.ts';
|
|
39
|
+
export type { StreamStatus } from '../kernel/stream/useClusterStream.ts';
|
|
40
|
+
export { ACTION_SECTIONS, type ActionHost, type ActionMode, type ActionProps, type ActionSection, type ActionTargets, type AddressTarget, type ClientTarget, type ConnectionTarget, type ConsumerTarget, type DivertTarget, type HostedDialogProps, type MessageTarget, type ProducerTarget, type QueueTarget, type SessionTarget, } from '../kernel/actions/types.ts';
|
|
41
|
+
export { ActionMenuItem } from '../ui/ActionMenuItem.tsx';
|
|
42
|
+
export { CapabilityGate } from '../ui/CapabilityGate.tsx';
|
|
43
|
+
export { gateFor, type GateScope, type GateVerdict } from '../ui/capabilityGate.ts';
|
|
44
|
+
export { useMe } from '../kernel/auth/api.ts';
|
|
45
|
+
export { CodeEditor, type CodeDiagnostic, type CodeEditorProps } from '../ui/CodeEditor.tsx';
|
|
46
|
+
export { HoldToConfirm } from '../ui/HoldToConfirm.tsx';
|
|
47
|
+
export { ConfirmDialog, type ConfirmDialogProps } from '../ui/ConfirmDialog.tsx';
|
|
48
|
+
export { DiagramView, type DiagramAction, type DiagramChoice, type DiagramEdge, type DiagramNode, type DiagramViewProps, } from '../ui/DiagramView.tsx';
|
|
49
|
+
export { NodeOutcomeSummary, OutcomeSummary, type OutcomeRow } from '../ui/NodeOutcomeSummary.tsx';
|
|
50
|
+
export { Pager } from '../ui/Pager.tsx';
|
|
51
|
+
export { DataTable, type Column, type ColumnKind, type ColumnPriority, type DataTableProps, type RowMenu, } from '../ui/table/index.ts';
|
|
52
|
+
export { type DescriptionItem } from '../ui/DescriptionList.tsx';
|
|
53
|
+
export { EmptyState, type EmptyStateProps } from '../ui/EmptyState.tsx';
|
|
54
|
+
export { MetricChart } from '../kernel/metrics/MetricChart.tsx';
|
|
55
|
+
export { usePluginSeries } from '../kernel/metrics/pluginSeries.ts';
|
|
56
|
+
export { METRIC_RANGES, type MetricRange } from '../kernel/time/ranges.ts';
|
|
57
|
+
/**
|
|
58
|
+
* Shows a toast in Rahdar's own notification area, announced through `aria-live`. Import this, never
|
|
59
|
+
* `@mantine/notifications` directly: that is not shared, so a plugin's own copy would show nothing.
|
|
60
|
+
*/
|
|
61
|
+
export { notify, type ActionVerb } from '../ui/notify.ts';
|
|
62
|
+
export { DescriptionList, ErrorState, FieldRow, LoadingState, Notice, Page, PageHeader, Section, Stat, StatusBadge, Toolbar, };
|
|
63
|
+
export type PageProps = ComponentProps<typeof Page>;
|
|
64
|
+
export type PageHeaderProps = ComponentProps<typeof PageHeader>;
|
|
65
|
+
export type SectionProps = ComponentProps<typeof Section>;
|
|
66
|
+
export type ToolbarProps = ComponentProps<typeof Toolbar>;
|
|
67
|
+
export type ErrorStateProps = ComponentProps<typeof ErrorState>;
|
|
68
|
+
export type FieldRowProps = ComponentProps<typeof FieldRow>;
|
|
69
|
+
export type LoadingStateProps = ComponentProps<typeof LoadingState>;
|
|
70
|
+
export type NoticeProps = ComponentProps<typeof Notice>;
|
|
71
|
+
export type StatusBadgeProps = ComponentProps<typeof StatusBadge>;
|
|
72
|
+
export type StatProps = ComponentProps<typeof Stat>;
|
|
73
|
+
export type DescriptionListProps = ComponentProps<typeof DescriptionList>;
|
|
74
|
+
/** A plugin's description of itself: a {@link RahdarFeature} whose id is the plugin's own. */
|
|
75
|
+
export interface RahdarPlugin extends RahdarFeature {
|
|
76
|
+
id: PluginId;
|
|
77
|
+
}
|
|
78
|
+
/** Declares a plugin's UI; its bundle exposes the result as `./feature`'s default export. */
|
|
79
|
+
export declare function definePlugin<T extends RahdarPlugin>(plugin: T): T;
|
|
80
|
+
/**
|
|
81
|
+
* A route path under the plugin's own namespace, the only place its routes may live:
|
|
82
|
+
* `pluginPath('acme-notes', 'notes/$noteId')` is `p/acme-notes/notes/$noteId`. Use it with
|
|
83
|
+
* `rootRoute` for a page outside any cluster, or `clusterRoute` for a view of one cluster.
|
|
84
|
+
*/
|
|
85
|
+
export declare function pluginPath(id: PluginId, path?: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* The API path of a plugin's own endpoints, for {@link request}: `/p/<id>/…`, or
|
|
88
|
+
* `/clusters/<clusterId>/p/<id>/…` for a cluster-scoped call.
|
|
89
|
+
*/
|
|
90
|
+
export declare function pluginApi(id: PluginId, path: string, clusterId?: string): string;
|
|
91
|
+
/** The plugin's page, or the page explaining it is unavailable when the plugin is not running. */
|
|
92
|
+
export declare function pluginView(id: PluginId, View: ComponentType): () => ReactElement;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { GateVerdict } from './capabilityGate.ts';
|
|
3
|
+
type Blocked = Extract<GateVerdict, {
|
|
4
|
+
kind: 'blocked';
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* One item of a row's action menu (ADR-0107).
|
|
8
|
+
*
|
|
9
|
+
* <p>An item the operator may not use is never removed and never `disabled`: Mantine skips disabled
|
|
10
|
+
* items in keyboard navigation, which would leave a keyboard user no way to learn why. It is
|
|
11
|
+
* `aria-disabled`, states the first sentence of its reason, and activating it hands the full reason
|
|
12
|
+
* (with its `broker.xml`) to `onExplain`.
|
|
13
|
+
*
|
|
14
|
+
* <p>A navigation item takes `href`, so it can be opened in a new tab; a plain activation still goes
|
|
15
|
+
* through `onSelect`, which navigates inside the app.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ActionMenuItem({ label, icon, verdict, tone, href, onSelect, onExplain, }: {
|
|
18
|
+
label: string;
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
verdict?: GateVerdict;
|
|
21
|
+
/** `danger` for an action that destroys something; the word still carries it. */
|
|
22
|
+
tone?: 'danger';
|
|
23
|
+
href?: string;
|
|
24
|
+
onSelect: () => void;
|
|
25
|
+
onExplain?: (verdict: Blocked) => void;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { MenuAnchor } from './table/menuAnchor.ts';
|
|
3
|
+
/**
|
|
4
|
+
* One controlled menu opened at a point rather than from a trigger it wraps (ADR-0107). A grid
|
|
5
|
+
* renders one of these for all of its rows: the items of a closed menu are not mounted, so a page
|
|
6
|
+
* of rows costs one menu, not one per row.
|
|
7
|
+
*
|
|
8
|
+
* <p>The anchor is a clipped point element, portalled so that no transformed ancestor (virtualized
|
|
9
|
+
* rows are placed by `transform`) can shift it. It carries `label`, which is what names the menu.
|
|
10
|
+
* Focus is not returned by the menu itself: only the caller knows what opened it, and whether a
|
|
11
|
+
* dialog has taken over.
|
|
12
|
+
*/
|
|
13
|
+
export declare function AnchoredMenu({ opened, anchor, label, onClose, children, }: Readonly<{
|
|
14
|
+
opened: boolean;
|
|
15
|
+
anchor: MenuAnchor | null;
|
|
16
|
+
/** The menu's accessible name, e.g. "Actions for orders". */
|
|
17
|
+
label: string;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}>): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { GateVerdict } from './capabilityGate.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Wraps a control that may be unavailable, keeping it visible and explaining
|
|
5
|
+
* itself in place (non-negotiable #5). A silently missing button teaches the
|
|
6
|
+
* operator that the product cannot do something, when the truth is that this
|
|
7
|
+
* connection is not configured for it.
|
|
8
|
+
*
|
|
9
|
+
* <p>The explanation is a popover on a separate, focusable "Why?" button beside the
|
|
10
|
+
* disabled control, not a `title` or a hover tooltip, because a disabled control takes
|
|
11
|
+
* no focus and a keyboard user would otherwise have no way to reach the reason at all.
|
|
12
|
+
* The two are siblings, never nested: a button inside a button is invalid markup.
|
|
13
|
+
*
|
|
14
|
+
* <p>`what` names the control being explained. A screen with several gated
|
|
15
|
+
* controls otherwise announces the same "Why this is unavailable" for each of
|
|
16
|
+
* them, which tells a screen-reader user nothing about which one it belongs to.
|
|
17
|
+
*/
|
|
18
|
+
export declare function CapabilityGate({ verdict, what, children, }: Readonly<{
|
|
19
|
+
verdict: GateVerdict;
|
|
20
|
+
/** "applying address setting orders.#"; defaults to "this". */
|
|
21
|
+
what?: string;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a control is unavailable, in full: the reason, and the `broker.xml` that enables it where one
|
|
3
|
+
* exists (non-negotiable #5). The one rendering of it, shared by the {@link CapabilityGate} popover
|
|
4
|
+
* and the explanation a blocked menu item opens, so both say the same thing the same way.
|
|
5
|
+
*/
|
|
6
|
+
export declare function CapabilityReason({ reason, snippet, size, }: Readonly<{
|
|
7
|
+
reason: string;
|
|
8
|
+
snippet?: string | null;
|
|
9
|
+
/** `xs` in a popover; `sm` where the explanation is the whole dialog. */
|
|
10
|
+
size?: 'xs' | 'sm';
|
|
11
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type CodeDiagnostic } from './codeDiagnostics.ts';
|
|
2
|
+
export type { CodeDiagnostic };
|
|
3
|
+
export interface CodeEditorProps {
|
|
4
|
+
value: string;
|
|
5
|
+
/** Omitted, the editor is read-only. */
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
language: 'yaml' | 'json';
|
|
8
|
+
diagnostics?: CodeDiagnostic[];
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
/** The visible label, which is also the editor's accessible name. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** A CSS length. */
|
|
13
|
+
minHeight?: string;
|
|
14
|
+
/** A CSS length; past this height the editor scrolls inside itself. */
|
|
15
|
+
maxHeight?: string;
|
|
16
|
+
/** Wrap long lines instead of scrolling them sideways. */
|
|
17
|
+
lineWrapping?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A document editor for YAML or JSON: CodeMirror with line numbers, folding, a
|
|
21
|
+
* lint gutter, bracket matching and search, coloured from `theme.css` like the
|
|
22
|
+
* SQL console. It validates nothing itself. The caller passes the server's
|
|
23
|
+
* diagnostics, which are marked at their line and column and summarised in a
|
|
24
|
+
* live region, so a screen reader hears that the document has problems without
|
|
25
|
+
* hunting for the marks.
|
|
26
|
+
*
|
|
27
|
+
* Tab indents, so an editable editor would otherwise trap the keyboard. Escape
|
|
28
|
+
* hands the next Tab back to the browser (CodeMirror's tab-focus mode), and the
|
|
29
|
+
* hint under the editor says so.
|
|
30
|
+
*/
|
|
31
|
+
export declare function CodeEditor({ value, onChange, language, diagnostics, readOnly, label, minHeight, maxHeight, lineWrapping, }: Readonly<CodeEditorProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Confirmation before an action that cannot be taken back (non-negotiable #2). The dialog states
|
|
4
|
+
* the consequence first and names the action on its button.
|
|
5
|
+
*
|
|
6
|
+
* <ul>
|
|
7
|
+
* <li>With `tone="danger"` the action is confirmed by pressing and holding the button until it
|
|
8
|
+
* fills ({@link HoldToConfirm}), never by a click or by typing; use it for anything that removes
|
|
9
|
+
* or overwrites. The button names the action and its count, such as "Delete 37 queues".
|
|
10
|
+
* <li>Focus enters the dialog on Cancel, Escape closes it, and focus returns to the control that
|
|
11
|
+
* opened it.
|
|
12
|
+
* <li>While `pending` the button is busy and cannot be pressed again, and the dialog stays
|
|
13
|
+
* open: Escape, the overlay and Cancel are inert until the caller settles it.
|
|
14
|
+
* <li>With `blocked` the button cannot be armed, and the reason is stated beside it; the dialog
|
|
15
|
+
* can still be dismissed.
|
|
16
|
+
* <li>With `result` the confirm controls are replaced by the outcome, so one dialog carries the
|
|
17
|
+
* confirmation and then what happened. Focus moves to the outcome, the only button left is
|
|
18
|
+
* Close, and closing returns focus to the control that opened the dialog.
|
|
19
|
+
* </ul>
|
|
20
|
+
*/
|
|
21
|
+
export declare function ConfirmDialog({ opened, onClose, title, consequence, confirmLabel, dismissLabel, tone, pending, blocked, result, onConfirm, }: ConfirmDialogProps): import("react").JSX.Element;
|
|
22
|
+
export type ConfirmDialogProps = Readonly<{
|
|
23
|
+
opened: boolean;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
/** The action as a plain line, such as "Delete queue". */
|
|
26
|
+
title: string;
|
|
27
|
+
/** What it affects: the resource, the nodes and how much data goes. */
|
|
28
|
+
consequence: ReactNode;
|
|
29
|
+
/** The exact action, such as "Delete queue". */
|
|
30
|
+
confirmLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* The button that dismisses without acting; defaults to "Cancel". Name what is kept, such as "Keep
|
|
33
|
+
* request", when the action itself is a cancel, so the two buttons never both read "Cancel".
|
|
34
|
+
*/
|
|
35
|
+
dismissLabel?: string;
|
|
36
|
+
/** `danger` for an action that removes or overwrites, confirmed by holding; defaults to `default`. */
|
|
37
|
+
tone?: 'default' | 'danger';
|
|
38
|
+
/** The action is running: the button is busy and the dialog cannot be dismissed. */
|
|
39
|
+
pending?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Why the action cannot be armed right now, in a sentence that says what to do about it. The button
|
|
42
|
+
* is disabled and the reason is shown beside it, in words; Cancel and Escape still dismiss.
|
|
43
|
+
*/
|
|
44
|
+
blocked?: string;
|
|
45
|
+
/**
|
|
46
|
+
* What happened, once the action ran: replaces the confirm controls, leaving Close. Pass the
|
|
47
|
+
* outcome as a `Notice`, an `ErrorState` or a `NodeOutcomeSummary`.
|
|
48
|
+
*/
|
|
49
|
+
result?: ReactNode;
|
|
50
|
+
onConfirm: () => void;
|
|
51
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** One term and its value; `hint` is a dimmed second line under the value. */
|
|
3
|
+
export type DescriptionItem = Readonly<{
|
|
4
|
+
/** Also the item's key, so it is unique within the list. */
|
|
5
|
+
term: string;
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
hint?: ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Terms and their values, as a native description list. It replaces a two-column key and value
|
|
11
|
+
* table: the terms share one column and the values wrap instead of overflowing. `columns={2}` sets
|
|
12
|
+
* two term and value pairs side by side for a short list in a wide space. A `label` names the list
|
|
13
|
+
* for assistive technology.
|
|
14
|
+
*
|
|
15
|
+
* `oneLine` is for terms and values that are names a broker supplies (a queue, an address, a role), in
|
|
16
|
+
* a cell with a width of its own: each stays on one line, shortened in the middle when it does not fit
|
|
17
|
+
* and named in full on hover and focus, and neither track shrinks below a readable width, so a long
|
|
18
|
+
* name never squeezes its neighbour into a column of characters. A value that is not a string shortens
|
|
19
|
+
* itself.
|
|
20
|
+
*/
|
|
21
|
+
export declare function DescriptionList({ items, columns, label, oneLine, }: Readonly<{
|
|
22
|
+
items: readonly DescriptionItem[];
|
|
23
|
+
columns?: 1 | 2;
|
|
24
|
+
label?: string;
|
|
25
|
+
oneLine?: boolean;
|
|
26
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type DiagramAction, type DiagramChoice, type DiagramEdge, type DiagramNode } from './diagram.ts';
|
|
2
|
+
export type { DiagramAction, DiagramChoice, DiagramEdge, DiagramNode };
|
|
3
|
+
export interface DiagramViewProps {
|
|
4
|
+
nodes: DiagramNode[];
|
|
5
|
+
edges: DiagramEdge[];
|
|
6
|
+
selectedId?: string | null;
|
|
7
|
+
onSelect?: (id: string) => void;
|
|
8
|
+
/** Which way the arrows run. Default: down. */
|
|
9
|
+
direction?: 'DOWN' | 'RIGHT';
|
|
10
|
+
/** The frame's height, as a CSS length such as '100%' to fill a sized parent. Default 30rem. */
|
|
11
|
+
height?: string;
|
|
12
|
+
/** Names the diagram for screen readers. */
|
|
13
|
+
'aria-label': string;
|
|
14
|
+
/** What can be inserted on an arrow marked `insertable`. With `onInsert`, each such arrow offers them. */
|
|
15
|
+
insertChoices?: DiagramChoice[];
|
|
16
|
+
/** A choice was made on an arrow. The diagram changes nothing itself. */
|
|
17
|
+
onInsert?: (edgeId: string, value: string) => void;
|
|
18
|
+
/** The actions a box offers in its menu. With `onNodeAction`, every box that has some offers them. */
|
|
19
|
+
nodeActions?: (node: DiagramNode) => DiagramAction[];
|
|
20
|
+
/** An action was chosen on a box. The diagram changes nothing itself. */
|
|
21
|
+
onNodeAction?: (nodeId: string, actionId: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A diagram of boxes and arrows, laid out automatically (ELK layered, in a worker) and drawn in
|
|
25
|
+
* Rahdar's theme (ADR-0117). Nothing is dragged, connected or deleted: it shows a structure and
|
|
26
|
+
* reports which box was chosen. A caller may offer things to insert on arrows and actions on boxes
|
|
27
|
+
* (ADR-0120); the diagram reports the choice and the caller changes the nodes.
|
|
28
|
+
*
|
|
29
|
+
* <p>The diagram is one tab stop. Arrow keys move between boxes in reading order, Enter or Space
|
|
30
|
+
* selects one, and the selection is announced. A box with a problem says so in words, on the box
|
|
31
|
+
* and in its accessible name, so colour is never the only signal. Positions change only when the
|
|
32
|
+
* boxes or arrows do, never when a label does. A box's actions open from its "⋯", a right-click,
|
|
33
|
+
* or Shift+F10; Insert on a box offers what can go on the arrows into it.
|
|
34
|
+
*/
|
|
35
|
+
export declare function DiagramView({ nodes, edges, selectedId, onSelect, direction, height, 'aria-label': ariaLabel, insertChoices, onInsert, nodeActions, onNodeAction, }: Readonly<DiagramViewProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The row of buttons that ends a dialog: aligned to the inline end, the dismissing button first and the
|
|
4
|
+
* primary action last, every button at the default size. The primary names its action ("Create user",
|
|
5
|
+
* "Rotate key"), never "OK" or "Submit".
|
|
6
|
+
*
|
|
7
|
+
* Where a dialog sits: a confirmation, whose content is fixed, is `centered`; a form, a review or anything
|
|
8
|
+
* that grows while it is used keeps Mantine's default top offset, so the dialog never moves under the cursor
|
|
9
|
+
* as a message or a section appears.
|
|
10
|
+
*/
|
|
11
|
+
export declare function DialogActions({ children, className }: Readonly<{
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
}>): import("react").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Keeps a form dialog's unsaved input from being lost by a stray click or key. While `dirty`, a click outside
|
|
17
|
+
* does nothing, and Escape or the close button asks inside the dialog whether to discard; a second Escape
|
|
18
|
+
* keeps editing. Spread `modalProps` on the `Modal` and render `prompt` at the top of its body.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useDiscardGuard(dirty: boolean, onClose: () => void): {
|
|
21
|
+
modalProps: {
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
closeOnClickOutside: boolean;
|
|
24
|
+
};
|
|
25
|
+
prompt: import("react").JSX.Element | null;
|
|
26
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What a view shows when it has no rows, in one of three kinds. Each says what the resource is, why
|
|
4
|
+
* there is none and what to do next, so an empty view is never a bare "No data".
|
|
5
|
+
*
|
|
6
|
+
* <ul>
|
|
7
|
+
* <li>`empty`: there is nothing yet. `description` says what the resource is and how one comes to
|
|
8
|
+
* exist; `action` is the control that creates one, only where the operator may.
|
|
9
|
+
* <li>`filtered`: a filter excludes every row. It offers "Clear filters".
|
|
10
|
+
* <li>`unreachable`: rows are absent because `nodes` could not be reached, so the view names them
|
|
11
|
+
* instead of presenting the absence as a fact.
|
|
12
|
+
* </ul>
|
|
13
|
+
*
|
|
14
|
+
* The title is a plain line, not a heading, so the state fits under whatever heading level its page
|
|
15
|
+
* is at.
|
|
16
|
+
*/
|
|
17
|
+
export declare function EmptyState(props: EmptyStateProps): import("react").JSX.Element;
|
|
18
|
+
export type EmptyStateProps = Readonly<{
|
|
19
|
+
kind: 'empty';
|
|
20
|
+
/** What is missing, such as "No queues". */
|
|
21
|
+
title: string;
|
|
22
|
+
/** What the resource is and why there is none. */
|
|
23
|
+
description: ReactNode;
|
|
24
|
+
/** The control that creates one; omit it where the operator may not. */
|
|
25
|
+
action?: ReactNode;
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'filtered';
|
|
28
|
+
title: string;
|
|
29
|
+
/** Replaces "No rows match the current filters." */
|
|
30
|
+
description?: ReactNode;
|
|
31
|
+
/** Resets every filter on the view. */
|
|
32
|
+
onClearFilters: () => void;
|
|
33
|
+
action?: ReactNode;
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'unreachable';
|
|
36
|
+
title: string;
|
|
37
|
+
/** Replaces the default sentence. */
|
|
38
|
+
description?: ReactNode;
|
|
39
|
+
/** The nodes that could not be reached. */
|
|
40
|
+
nodes: readonly string[];
|
|
41
|
+
action?: ReactNode;
|
|
42
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A failure shown in place of the content that could not load. It reads the error by its shape (see
|
|
4
|
+
* `readError`), so it names the cause and gives the next step instead of a generic "Request failed": a
|
|
5
|
+
* missing permission is named, a validation failure lists its fields, a rate limit says how long to
|
|
6
|
+
* wait, a server error quotes the request id and a broker failure says which of its connection
|
|
7
|
+
* problems it is. It is an alert, so it is announced when it appears.
|
|
8
|
+
*
|
|
9
|
+
* <p>A broker failure keeps the server's own `detail` under the cause the kind maps to, so what the
|
|
10
|
+
* broker actually said is never lost to the mapping.
|
|
11
|
+
*
|
|
12
|
+
* <p>`onRetry` adds a Retry button when trying again can help; where it cannot (a refused
|
|
13
|
+
* credential, a missing permission), the button is left out. `next` replaces the next-step sentence
|
|
14
|
+
* where the caller knows a better one for its screen, and `actions` adds controls beside Retry, such
|
|
15
|
+
* as a link to the page that fixes it.
|
|
16
|
+
*
|
|
17
|
+
* <p>`blockSize` keeps the panel at least that tall, so it can take the place of a `LoadingState` of the
|
|
18
|
+
* same size without pulling what follows up the page when the failure arrives.
|
|
19
|
+
*
|
|
20
|
+
* <p>An operation held for approval is not a failure, so it renders as a polite `Notice` that says it
|
|
21
|
+
* was sent and links to the request, wherever a screen hands its mutation's error here.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ErrorState({ error, onRetry, next, actions, variant, blockSize, }: Readonly<{
|
|
24
|
+
/** The thrown error, typically an `ApiError`; read structurally, so any value is safe. */
|
|
25
|
+
error: unknown;
|
|
26
|
+
/** Called by the Retry button. Omit it where retrying makes no sense. */
|
|
27
|
+
onRetry?: () => void;
|
|
28
|
+
/** The next step, replacing the one read from the error. */
|
|
29
|
+
next?: ReactNode;
|
|
30
|
+
/** Further next-step controls, after Retry. */
|
|
31
|
+
actions?: ReactNode;
|
|
32
|
+
/** `block` is a panel standing in for a view; `inline` is one wrapping line inside a section. */
|
|
33
|
+
variant?: 'block' | 'inline';
|
|
34
|
+
/** The least height to hold, as a CSS length such as `12rem`: the size of the loading frame this replaces. */
|
|
35
|
+
blockSize?: string;
|
|
36
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Fields that belong on one line, such as a username and password, or a field and the button that
|
|
4
|
+
* submits it. Every field's input box stays on the same line whatever its label or message holds,
|
|
5
|
+
* and the row wraps when the window is narrow or zoomed.
|
|
6
|
+
*/
|
|
7
|
+
export declare function FieldRow({ children }: Readonly<{
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Confirms an action that cannot be taken back by pressing and holding (non-negotiable #2): the button
|
|
3
|
+
* fills with red while it is held and acts only when it is full, so a stray click, a double click or a
|
|
4
|
+
* key left down cannot do it. Letting go early drains the fill and does nothing. Held with the mouse, a
|
|
5
|
+
* finger or a pen, or with Space or Enter on the keyboard; the hint under the button says so, and the
|
|
6
|
+
* outcome is announced.
|
|
7
|
+
*
|
|
8
|
+
* <p>`label` is the action ("Delete 37 queues") and names the blast radius the button is for; the button
|
|
9
|
+
* reads exactly that, and the hint under it says to hold it. While `loading` it is busy and cannot be held again. Mouse and touch
|
|
10
|
+
* presses are Mantine's `useLongPress`; it has no keyboard, which is handled here.
|
|
11
|
+
*/
|
|
12
|
+
export declare function HoldToConfirm({ label, onConfirm, loading, disabled, describedBy, tone, }: Readonly<{
|
|
13
|
+
/** The exact action, such as "Delete queue ORDERS" or "Apply to 2 nodes". */
|
|
14
|
+
label: string;
|
|
15
|
+
onConfirm: () => void;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** The id of text that says why the button is disabled, for assistive technology. */
|
|
19
|
+
describedBy?: string;
|
|
20
|
+
/** `danger` for an action that removes or overwrites (the default); `default` for one that does not. */
|
|
21
|
+
tone?: 'default' | 'danger';
|
|
22
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a view's content will appear while it loads. Never a bare spinner: the label names what is
|
|
3
|
+
* loading for assistive technology, and the frame reserves `blockSize` and `inlineSize` (any CSS
|
|
4
|
+
* length) so nothing around it shifts when the content arrives. Tables and figures use their own
|
|
5
|
+
* `loading` props, which hold their own size.
|
|
6
|
+
*/
|
|
7
|
+
export declare function LoadingState({ label, variant, blockSize, inlineSize, }: Readonly<{
|
|
8
|
+
/** What is loading, such as "Loading queues". Read aloud, not shown. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** `block` fills the width it is in; `inline` sits in a line of text. */
|
|
11
|
+
variant?: 'block' | 'inline';
|
|
12
|
+
/** The height to hold, as a CSS length such as `12rem`. */
|
|
13
|
+
blockSize?: string;
|
|
14
|
+
/** The width to hold, as a CSS length. */
|
|
15
|
+
inlineSize?: string;
|
|
16
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { components } from '../kernel/api/schema.d.ts';
|
|
2
|
+
type LifecycleOutcomeView = components['schemas']['LifecycleOutcomeView'];
|
|
3
|
+
/**
|
|
4
|
+
* One cluster-wide lifecycle result, rendered as a single object (ADR-0049 D2).
|
|
5
|
+
*
|
|
6
|
+
* <p>Used for both the dry-run preview and the result, so what the operator
|
|
7
|
+
* confirmed and what actually happened are visually comparable — a preview that
|
|
8
|
+
* looks nothing like its outcome makes the two impossible to check against each
|
|
9
|
+
* other.
|
|
10
|
+
*
|
|
11
|
+
* <p>Every node's state is carried in words. Colour is redundant with the text
|
|
12
|
+
* and appears only where something is wrong, so a fully applied command reads as
|
|
13
|
+
* near-monochrome and the eye stops at the one row that did not.
|
|
14
|
+
*/
|
|
15
|
+
export declare function NodeOutcomeSummary({ outcome, destructive, alreadyLabel, countNoun, verbFuture, verbPast, }: Readonly<{
|
|
16
|
+
outcome: LifecycleOutcomeView;
|
|
17
|
+
/** A destroy shows the message counts; a pause has none worth a column. */
|
|
18
|
+
destructive?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* What `ALREADY` means for this command. It defaults to the lifecycle wording,
|
|
21
|
+
* but a connection close needs "already gone" — "already in this state" reads
|
|
22
|
+
* as though the operator had asked for something else.
|
|
23
|
+
*/
|
|
24
|
+
alreadyLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* What the counts are counting, and the verb for them. Defaults to the queue
|
|
27
|
+
* delete's wording; a connection close affects consumers, not messages, and
|
|
28
|
+
* saying "destroyed" there would overstate what happened.
|
|
29
|
+
*/
|
|
30
|
+
countNoun?: string;
|
|
31
|
+
verbFuture?: string;
|
|
32
|
+
verbPast?: string;
|
|
33
|
+
}>): import("react").JSX.Element;
|
|
34
|
+
/** One node's contribution, already in the words the caller's command uses. */
|
|
35
|
+
export interface OutcomeRow {
|
|
36
|
+
key: string;
|
|
37
|
+
name: string;
|
|
38
|
+
/** An end-aligned figure, when the command has one worth comparing between nodes. */
|
|
39
|
+
count?: string;
|
|
40
|
+
status: string;
|
|
41
|
+
tone?: 'warning' | 'danger';
|
|
42
|
+
/** A failure's reason, or anything else that needs a second line. */
|
|
43
|
+
detail?: string | null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The per-node result as a shape, without an opinion about what the command was.
|
|
47
|
+
*
|
|
48
|
+
* <p>{@link NodeOutcomeSummary} is this with the lifecycle vocabulary; the SQL
|
|
49
|
+
* Console is this with a query's. Both go through here so a fan-out result reads
|
|
50
|
+
* the same wherever it appears — which is the point of the house rule, and is
|
|
51
|
+
* lost the moment a second screen re-implements the layout with its own spacing.
|
|
52
|
+
*/
|
|
53
|
+
export declare function OutcomeSummary({ verdict, verdictTone, total, rows, }: Readonly<{
|
|
54
|
+
verdict: string;
|
|
55
|
+
verdictTone?: 'warning' | 'danger';
|
|
56
|
+
total?: string;
|
|
57
|
+
rows: OutcomeRow[];
|
|
58
|
+
}>): import("react").JSX.Element;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A fact the operator must read before going on, in a titled block that says it in words: the title
|
|
4
|
+
* is a `StatusBadge`, so it reads the same without colour, and the edge only repeats the tone.
|
|
5
|
+
*
|
|
6
|
+
* <p>The announcement follows the tone. `danger` is an alert, announced assertively because
|
|
7
|
+
* something went wrong or changed under the operator; every other tone is a status, announced
|
|
8
|
+
* politely. `action` is the next step as a control, such as a Retry or Review button.
|
|
9
|
+
*/
|
|
10
|
+
export declare function Notice({ title, tone, action, children, }: Readonly<{
|
|
11
|
+
/** What the notice is about, in words: "Rahdar needs a restart". */
|
|
12
|
+
title: string;
|
|
13
|
+
tone?: 'neutral' | 'info' | 'warning' | 'danger';
|
|
14
|
+
/** The next step, as a control. */
|
|
15
|
+
action?: ReactNode;
|
|
16
|
+
/** The body: what it means and what to do. */
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}>): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The frame of a page: its parts in one column, spaced by the theme's spacing scale.
|
|
4
|
+
*
|
|
5
|
+
* <p>`fill` gives the last child the height that remains in the window below the application
|
|
6
|
+
* header, for a view whose last part is a grid or a canvas that should end at the window's edge.
|
|
7
|
+
* Without it the page is as tall as its content.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Page({ fill, children, }: Readonly<{
|
|
10
|
+
/** The last child takes the remaining window height instead of its content height. */
|
|
11
|
+
fill?: boolean;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}>): import("react").JSX.Element;
|