@termix-ssh/plugin-sdk 1.0.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 +52 -0
- package/cli/commands/build.mjs +246 -0
- package/cli/commands/migrations.mjs +248 -0
- package/cli/commands/pack.mjs +42 -0
- package/cli/commands/sign.mjs +83 -0
- package/cli/commands/test.mjs +33 -0
- package/cli/commands/validate.mjs +215 -0
- package/cli/index.mjs +65 -0
- package/cli/lib/changelog.mjs +126 -0
- package/cli/lib/externals.mjs +46 -0
- package/cli/lib/plugin-dir.mjs +29 -0
- package/cli/lib/signing.mjs +86 -0
- package/cli/lib/static-url-imports.mjs +54 -0
- package/cli/lib/tmxplug.mjs +106 -0
- package/cli/patches/guacamole-common-js-flush.cjs +76 -0
- package/cli/patches/xterm-android-ime.cjs +130 -0
- package/client.d.ts +13 -0
- package/dist/backend.d.ts +1777 -0
- package/dist/backend.js +84 -0
- package/dist/capabilities.d.ts +38 -0
- package/dist/capabilities.js +71 -0
- package/dist/db.d.ts +112 -0
- package/dist/db.js +189 -0
- package/dist/ddl.d.ts +76 -0
- package/dist/ddl.js +678 -0
- package/dist/desktop.d.ts +346 -0
- package/dist/desktop.js +5 -0
- package/dist/frontend.d.ts +1206 -0
- package/dist/frontend.js +388 -0
- package/dist/host/chunk-F3SDZDDG.js +6017 -0
- package/dist/host/chunk-XGWE7BTJ.js +90 -0
- package/dist/host/chunk-XH5NXL6Y.js +56314 -0
- package/dist/host/chunk-YC2MAKSP.js +14 -0
- package/dist/host/linked-server-FZGWQW32.js +12 -0
- package/dist/host/rbac-api-6KDMBVDZ.js +52 -0
- package/dist/host/testing-host.js +414 -0
- package/dist/host/theme.css +91 -0
- package/dist/host/types/src/types/auth-protocols.d.ts +10 -0
- package/dist/host/types/src/types/connection-log.d.ts +13 -0
- package/dist/host/types/src/types/credential-sidebar-preferences.d.ts +38 -0
- package/dist/host/types/src/types/host-defaults.d.ts +60 -0
- package/dist/host/types/src/types/host-sidebar-preferences.d.ts +55 -0
- package/dist/host/types/src/types/index.d.ts +298 -0
- package/dist/host/types/src/types/keybindings.d.ts +27 -0
- package/dist/host/types/src/types/ui-preferences.d.ts +102 -0
- package/dist/host/types/src/types/ui-types.d.ts +260 -0
- package/dist/host/types/src/ui/api/admin-user-data-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/auth-methods-api.d.ts +63 -0
- package/dist/host/types/src/ui/api/credential-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/credentials-api.d.ts +56 -0
- package/dist/host/types/src/ui/api/dashboard-api.d.ts +23 -0
- package/dist/host/types/src/ui/api/external-account-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/host-sidebar-preferences-api.d.ts +3 -0
- package/dist/host/types/src/ui/api/host-status-api.d.ts +11 -0
- package/dist/host/types/src/ui/api/open-tabs-api.d.ts +74 -0
- package/dist/host/types/src/ui/api/plugins-api.d.ts +128 -0
- package/dist/host/types/src/ui/api/rbac-api.d.ts +167 -0
- package/dist/host/types/src/ui/api/settings-api.d.ts +22 -0
- package/dist/host/types/src/ui/api/ssh-host-management-api.d.ts +65 -0
- package/dist/host/types/src/ui/api/sync-api.d.ts +93 -0
- package/dist/host/types/src/ui/api/system-status-api.d.ts +49 -0
- package/dist/host/types/src/ui/api/ui-preferences-api.d.ts +8 -0
- package/dist/host/types/src/ui/api/user-management-api.d.ts +80 -0
- package/dist/host/types/src/ui/auth/Auth.d.ts +12 -0
- package/dist/host/types/src/ui/auth/auth-bits.d.ts +11 -0
- package/dist/host/types/src/ui/auth/silent-signin.d.ts +2 -0
- package/dist/host/types/src/ui/components/FullScreenAppWrapper.d.ts +9 -0
- package/dist/host/types/src/ui/components/alert-dialog.d.ts +14 -0
- package/dist/host/types/src/ui/components/alert.d.ts +9 -0
- package/dist/host/types/src/ui/components/badge.d.ts +9 -0
- package/dist/host/types/src/ui/components/button.d.ts +13 -0
- package/dist/host/types/src/ui/components/card-grid/CardGridCanvas.d.ts +22 -0
- package/dist/host/types/src/ui/components/card-grid/layout-utils.d.ts +26 -0
- package/dist/host/types/src/ui/components/card-grid/types.d.ts +29 -0
- package/dist/host/types/src/ui/components/card-masonry.d.ts +16 -0
- package/dist/host/types/src/ui/components/card.d.ts +11 -0
- package/dist/host/types/src/ui/components/charts/BarSeries.d.ts +16 -0
- package/dist/host/types/src/ui/components/charts/LineChart.d.ts +17 -0
- package/dist/host/types/src/ui/components/charts/RadialGauge.d.ts +18 -0
- package/dist/host/types/src/ui/components/charts/Sparkline.d.ts +22 -0
- package/dist/host/types/src/ui/components/charts/StatRow.d.ts +15 -0
- package/dist/host/types/src/ui/components/charts/geometry.d.ts +20 -0
- package/dist/host/types/src/ui/components/charts/index.d.ts +4 -0
- package/dist/host/types/src/ui/components/checkbox.d.ts +4 -0
- package/dist/host/types/src/ui/components/connection/ConnectionGate.d.ts +56 -0
- package/dist/host/types/src/ui/components/connection/ConnectionLogPanel.d.ts +9 -0
- package/dist/host/types/src/ui/components/connection/ConnectionScreen.d.ts +34 -0
- package/dist/host/types/src/ui/components/connection/connection-status.d.ts +1 -0
- package/dist/host/types/src/ui/components/data-view.d.ts +32 -0
- package/dist/host/types/src/ui/components/dialog.d.ts +17 -0
- package/dist/host/types/src/ui/components/dropdown-menu.d.ts +29 -0
- package/dist/host/types/src/ui/components/empty-state.d.ts +19 -0
- package/dist/host/types/src/ui/components/form-fields.d.ts +115 -0
- package/dist/host/types/src/ui/components/input.d.ts +3 -0
- package/dist/host/types/src/ui/components/kbd.d.ts +12 -0
- package/dist/host/types/src/ui/components/label.d.ts +4 -0
- package/dist/host/types/src/ui/components/manager-card.d.ts +25 -0
- package/dist/host/types/src/ui/components/meter.d.ts +14 -0
- package/dist/host/types/src/ui/components/metric-card.d.ts +18 -0
- package/dist/host/types/src/ui/components/panel-layout.d.ts +83 -0
- package/dist/host/types/src/ui/components/password-input.d.ts +4 -0
- package/dist/host/types/src/ui/components/popover.d.ts +7 -0
- package/dist/host/types/src/ui/components/scroll-area.d.ts +5 -0
- package/dist/host/types/src/ui/components/section-card.d.ts +29 -0
- package/dist/host/types/src/ui/components/select.d.ts +15 -0
- package/dist/host/types/src/ui/components/select2.d.ts +8 -0
- package/dist/host/types/src/ui/components/separator.d.ts +4 -0
- package/dist/host/types/src/ui/components/sheet.d.ts +14 -0
- package/dist/host/types/src/ui/components/sidebar.d.ts +69 -0
- package/dist/host/types/src/ui/components/skeleton.d.ts +2 -0
- package/dist/host/types/src/ui/components/slider.d.ts +4 -0
- package/dist/host/types/src/ui/components/sonner.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/prompt-styles.d.ts +4 -0
- package/dist/host/types/src/ui/components/surface/surface-scope.d.ts +79 -0
- package/dist/host/types/src/ui/components/switch.d.ts +4 -0
- package/dist/host/types/src/ui/components/tab-strip.d.ts +19 -0
- package/dist/host/types/src/ui/components/tabs.d.ts +7 -0
- package/dist/host/types/src/ui/components/textarea.d.ts +4 -0
- package/dist/host/types/src/ui/components/theme-provider.d.ts +14 -0
- package/dist/host/types/src/ui/components/tooltip.d.ts +7 -0
- package/dist/host/types/src/ui/contexts/BrandingContext.d.ts +15 -0
- package/dist/host/types/src/ui/contexts/UiPreferencesContext.d.ts +38 -0
- package/dist/host/types/src/ui/contexts/branding-document.d.ts +10 -0
- package/dist/host/types/src/ui/dashboard/dashboard-cards-registry.d.ts +30 -0
- package/dist/host/types/src/ui/hooks/use-action-slot.d.ts +10 -0
- package/dist/host/types/src/ui/hooks/use-adaptive-polling.d.ts +5 -0
- package/dist/host/types/src/ui/hooks/use-mobile.d.ts +1 -0
- package/dist/host/types/src/ui/hooks/use-permissions.d.ts +29 -0
- package/dist/host/types/src/ui/hooks/use-status-color-scheme.d.ts +12 -0
- package/dist/host/types/src/ui/hooks/use-sync-status.d.ts +4 -0
- package/dist/host/types/src/ui/hooks/useSshAuthProviders.d.ts +17 -0
- package/dist/host/types/src/ui/i18n/i18n.d.ts +52 -0
- package/dist/host/types/src/ui/lib/ServerStatusContext.d.ts +33 -0
- package/dist/host/types/src/ui/lib/adaptive-polling.d.ts +29 -0
- package/dist/host/types/src/ui/lib/adaptive-resource-budget.d.ts +39 -0
- package/dist/host/types/src/ui/lib/app-keyboard-shortcuts.d.ts +8 -0
- package/dist/host/types/src/ui/lib/base-path.d.ts +1 -0
- package/dist/host/types/src/ui/lib/clipboard-provider.d.ts +9 -0
- package/dist/host/types/src/ui/lib/clipboard.d.ts +20 -0
- package/dist/host/types/src/ui/lib/connection-origin.d.ts +47 -0
- package/dist/host/types/src/ui/lib/db-health-monitor.d.ts +34 -0
- package/dist/host/types/src/ui/lib/device-id.d.ts +1 -0
- package/dist/host/types/src/ui/lib/electron.d.ts +1 -0
- package/dist/host/types/src/ui/lib/embedded-server-status.d.ts +15 -0
- package/dist/host/types/src/ui/lib/error-message.d.ts +9 -0
- package/dist/host/types/src/ui/lib/frontend-logger.d.ts +67 -0
- package/dist/host/types/src/ui/lib/global-shortcut-handler.d.ts +3 -0
- package/dist/host/types/src/ui/lib/host-defaults-context.d.ts +48 -0
- package/dist/host/types/src/ui/lib/hosts-request-cache.d.ts +9 -0
- package/dist/host/types/src/ui/lib/keybinding-match.d.ts +3 -0
- package/dist/host/types/src/ui/lib/linked-server.d.ts +10 -0
- package/dist/host/types/src/ui/lib/local-adaptive-engine.d.ts +40 -0
- package/dist/host/types/src/ui/lib/permissions.d.ts +16 -0
- package/dist/host/types/src/ui/lib/plugin-i18n.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-icon.d.ts +11 -0
- package/dist/host/types/src/ui/lib/plugin-transport.d.ts +50 -0
- package/dist/host/types/src/ui/lib/registry.d.ts +29 -0
- package/dist/host/types/src/ui/lib/rem.d.ts +7 -0
- package/dist/host/types/src/ui/lib/remote-server-api.d.ts +11 -0
- package/dist/host/types/src/ui/lib/server-status-store.d.ts +37 -0
- package/dist/host/types/src/ui/lib/sync-events.d.ts +2 -0
- package/dist/host/types/src/ui/lib/sync-status.d.ts +6 -0
- package/dist/host/types/src/ui/lib/tab-jump-hotkey.d.ts +4 -0
- package/dist/host/types/src/ui/lib/theme.d.ts +21 -0
- package/dist/host/types/src/ui/lib/ttl-request-cache.d.ts +10 -0
- package/dist/host/types/src/ui/lib/usage-color.d.ts +5 -0
- package/dist/host/types/src/ui/lib/utils.d.ts +2 -0
- package/dist/host/types/src/ui/lib/visible-interval.d.ts +5 -0
- package/dist/host/types/src/ui/lib/widget-title.d.ts +8 -0
- package/dist/host/types/src/ui/lib/ws-auth.d.ts +1 -0
- package/dist/host/types/src/ui/main-axios.d.ts +170 -0
- package/dist/host/types/src/ui/plugin-host/PluginViewPlaceholder.d.ts +13 -0
- package/dist/host/types/src/ui/plugin-host/app.d.ts +18 -0
- package/dist/host/types/src/ui/plugin-host/auth-registry.d.ts +50 -0
- package/dist/host/types/src/ui/plugin-host/bridge.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/component-registry.d.ts +24 -0
- package/dist/host/types/src/ui/plugin-host/desktop.d.ts +7 -0
- package/dist/host/types/src/ui/plugin-host/extension-registry.d.ts +16 -0
- package/dist/host/types/src/ui/plugin-host/host-scope.d.ts +26 -0
- package/dist/host/types/src/ui/plugin-host/loader.d.ts +52 -0
- package/dist/host/types/src/ui/plugin-host/plugin-store.d.ts +40 -0
- package/dist/host/types/src/ui/plugin-host/scope.d.ts +20 -0
- package/dist/host/types/src/ui/plugin-host/sdk-ui.d.ts +99 -0
- package/dist/host/types/src/ui/plugin-host/shell-bridge.d.ts +67 -0
- package/dist/host/types/src/ui/plugin-host/view-ownership.d.ts +31 -0
- package/dist/host/types/src/ui/settings/HostPluginSections.d.ts +31 -0
- package/dist/host/types/src/ui/settings/SettingsFields.d.ts +22 -0
- package/dist/host/types/src/ui/settings/host-feature-tabs.d.ts +11 -0
- package/dist/host/types/src/ui/settings/settings-components.d.ts +32 -0
- package/dist/host/types/src/ui/settings/settings-fields-util.d.ts +11 -0
- package/dist/host/types/src/ui/shell/ActionSlot.d.ts +41 -0
- package/dist/host/types/src/ui/shell/TabContext.d.ts +30 -0
- package/dist/host/types/src/ui/shell/action-registry.d.ts +99 -0
- package/dist/host/types/src/ui/shell/keybinding-registry.d.ts +62 -0
- package/dist/host/types/src/ui/shell/palette-registry.d.ts +55 -0
- package/dist/host/types/src/ui/shell/panel-registry.d.ts +24 -0
- package/dist/host/types/src/ui/shell/tab-registry.d.ts +92 -0
- package/dist/host/types/src/ui/sidebar/HostManagerTabs.d.ts +65 -0
- package/dist/host/types/src/ui/sidebar/host-contributions.d.ts +72 -0
- package/dist/host/types/src/ui/sidebar/host-defaults/catalog.d.ts +17 -0
- package/dist/host/types/src/ui/sidebar/host-protocols.d.ts +49 -0
- package/dist/host/types/src/ui/sidebar/quick-connect-host.d.ts +21 -0
- package/dist/host/types/src/ui/sidebar/rail-items.d.ts +103 -0
- package/dist/host/types/src/ui/ssh/connection-log/ConnectionLogContext.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/BrowserSignInDialog.d.ts +18 -0
- package/dist/host/types/src/ui/ssh/dialogs/HostKeyVerificationDialog.d.ts +17 -0
- package/dist/host/types/src/ui/ssh/dialogs/PassphraseDialog.d.ts +15 -0
- package/dist/host/types/src/ui/ssh/dialogs/SSHAuthDialog.d.ts +20 -0
- package/dist/host/types/src/ui/ssh/dialogs/TOTPDialog.d.ts +13 -0
- package/dist/host/ui.d.ts +1 -0
- package/dist/host/ui.js +31754 -0
- package/dist/host/use-permissions-NULZL43J.js +18 -0
- package/dist/host-commands.d.ts +89 -0
- package/dist/host-commands.js +387 -0
- package/dist/manifest.d.ts +461 -0
- package/dist/manifest.js +1499 -0
- package/dist/settings.d.ts +43 -0
- package/dist/settings.js +168 -0
- package/dist/ssh-certs.d.ts +25 -0
- package/dist/ssh-certs.js +234 -0
- package/dist/ssh-options.d.ts +23 -0
- package/dist/ssh-options.js +1 -0
- package/dist/table-builder.d.ts +26 -0
- package/dist/table-builder.js +87 -0
- package/dist/testing/safe-ports.d.ts +10 -0
- package/dist/testing/safe-ports.js +59 -0
- package/dist/testing/setup.d.ts +7 -0
- package/dist/testing/setup.js +146 -0
- package/dist/testing.d.ts +537 -0
- package/dist/testing.js +1451 -0
- package/dist/vitest-preset.d.ts +54 -0
- package/dist/vitest-preset.js +96 -0
- package/package.json +143 -0
- package/schema/changelog.schema.json +67 -0
- package/schema/manifest.schema.json +1160 -0
- package/tsconfig.plugin.json +31 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/** How many columns fit a container of this width for a column preference. */
|
|
3
|
+
export declare function masonryColumns(width: number, columns: number): number;
|
|
4
|
+
/**
|
|
5
|
+
* Cards dealt round-robin into columns that stack tight. The assignment only
|
|
6
|
+
* depends on child order and column count, so live updates never reshuffle
|
|
7
|
+
* cards between columns. Width comes from the container, not the window, so
|
|
8
|
+
* split panes and docks get the right count.
|
|
9
|
+
*/
|
|
10
|
+
export declare function CardMasonry({ columns, stack, className, children, }: {
|
|
11
|
+
columns: number;
|
|
12
|
+
/** Force one full-width column, for cards holding wide tables. */
|
|
13
|
+
stack?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, size, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface BarSeriesItem {
|
|
2
|
+
label: string;
|
|
3
|
+
/** 0..max value driving the bar width. */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Optional right-aligned value text (defaults to value). */
|
|
6
|
+
valueLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface BarSeriesProps {
|
|
9
|
+
items: BarSeriesItem[];
|
|
10
|
+
/** Domain max; defaults to the largest value (min 1). */
|
|
11
|
+
max?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
colorClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Compact horizontal bar list with a label, a track, and a value. */
|
|
16
|
+
export declare function BarSeries({ items, max, className, colorClassName, }: BarSeriesProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface LineChartSeries {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
/** CSS color string or var(--...) */
|
|
5
|
+
color: string;
|
|
6
|
+
data: Array<number | null>;
|
|
7
|
+
}
|
|
8
|
+
interface LineChartProps {
|
|
9
|
+
series: LineChartSeries[];
|
|
10
|
+
timestamps: string[];
|
|
11
|
+
domain: [number, number];
|
|
12
|
+
yFormatter?: (v: number) => string;
|
|
13
|
+
height?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function LineChart({ series, timestamps, domain, yFormatter, height, className, }: LineChartProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface RadialGaugeProps {
|
|
2
|
+
/** 0..100 percentage, or null for "no data". */
|
|
3
|
+
value: number | null;
|
|
4
|
+
/** Large centered text (defaults to the percentage). */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Small caption under the value. */
|
|
7
|
+
caption?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
strokeWidth?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Tailwind text-color class for the value arc. */
|
|
12
|
+
colorClassName?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A 270-degree radial gauge with a big centered readout. Auto-themes via
|
|
16
|
+
* currentColor; the track uses the muted token.
|
|
17
|
+
*/
|
|
18
|
+
export declare function RadialGauge({ value, label, caption, size, strokeWidth, className, colorClassName, }: RadialGaugeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SparklineProps {
|
|
2
|
+
/** Series of values, oldest first. */
|
|
3
|
+
data: Array<number | null | undefined>;
|
|
4
|
+
/**
|
|
5
|
+
* Fixed value domain [min, max]. When omitted the domain is derived from the
|
|
6
|
+
* data. Providing a stable domain (e.g. [0, 100] for percentages) avoids the
|
|
7
|
+
* jittery rescaling the old sparkline had.
|
|
8
|
+
*/
|
|
9
|
+
domain?: [number, number];
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Tailwind text-color class for the line/fill (uses currentColor). */
|
|
12
|
+
colorClassName?: string;
|
|
13
|
+
/** Show a dot on the last point. */
|
|
14
|
+
showLastDot?: boolean;
|
|
15
|
+
/** Internal coordinate height; the SVG scales to its container. */
|
|
16
|
+
height?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Compact area + line chart. Uses a non-scaling stroke + a stable value domain
|
|
20
|
+
* so the line stays crisp and readable regardless of container size.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Sparkline({ data, domain, className, colorClassName, showLastDot, height, }: SparklineProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/** Dense key/value row used across metric and manager cards. */
|
|
3
|
+
export declare function StatRow({ label, value, mono, className, }: {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
mono?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
/** A compact stacked stat: small uppercase caption over a bold value. */
|
|
10
|
+
export declare function MiniStat({ caption, value, valueClassName, className, }: {
|
|
11
|
+
caption: ReactNode;
|
|
12
|
+
value: ReactNode;
|
|
13
|
+
valueClassName?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Pure geometry helpers for the chart primitives (unit-tested). */
|
|
2
|
+
export declare const SPARKLINE_VIEW_W = 300;
|
|
3
|
+
export interface SparklineGeometry {
|
|
4
|
+
hasData: boolean;
|
|
5
|
+
coords: Array<readonly [number, number]>;
|
|
6
|
+
linePath: string;
|
|
7
|
+
areaPath: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Map a value series to SVG coordinates within [0..VIEW_W] x [0..height].
|
|
11
|
+
* A fixed `domain` keeps the y-axis stable (no per-tick rescaling).
|
|
12
|
+
*/
|
|
13
|
+
export declare function sparklineGeometry(data: Array<number | null | undefined>, height: number, domain?: [number, number]): SparklineGeometry;
|
|
14
|
+
export interface GaugeArc {
|
|
15
|
+
trackLen: number;
|
|
16
|
+
valueLen: number;
|
|
17
|
+
circumference: number;
|
|
18
|
+
}
|
|
19
|
+
/** Arc lengths for a radial gauge sweeping `sweepDeg` degrees. */
|
|
20
|
+
export declare function gaugeArc(value: number | null, radius: number, sweepDeg?: number): GaugeArc;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type ConnectionUnavailable } from "./ConnectionScreen";
|
|
3
|
+
import type { ConnectionStatus } from "./connection-status";
|
|
4
|
+
import type { ConnectionStage } from "../../../types/connection-log";
|
|
5
|
+
type LogFn = (message: string, stage?: ConnectionStage) => void;
|
|
6
|
+
export interface ConnectionGateController {
|
|
7
|
+
status: ConnectionStatus;
|
|
8
|
+
attempt: number;
|
|
9
|
+
maxAttempts: number;
|
|
10
|
+
nextRetryInMs: number | null;
|
|
11
|
+
error: string | null;
|
|
12
|
+
unavailable: ConnectionUnavailable | null;
|
|
13
|
+
log: {
|
|
14
|
+
info: LogFn;
|
|
15
|
+
success: LogFn;
|
|
16
|
+
warning: LogFn;
|
|
17
|
+
error: LogFn;
|
|
18
|
+
};
|
|
19
|
+
markConnected: () => void;
|
|
20
|
+
/** It did not come up. Logs the reason and schedules a retry. */
|
|
21
|
+
markFailed: (error?: unknown) => void;
|
|
22
|
+
/** It was up and dropped. No automatic retry. */
|
|
23
|
+
markDisconnected: (error?: unknown) => void;
|
|
24
|
+
/** It cannot run here, like a feature that is off for this host. */
|
|
25
|
+
markUnavailable: (info: ConnectionUnavailable) => void;
|
|
26
|
+
retryNow: () => void;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
}
|
|
29
|
+
export interface ConnectionGateProps {
|
|
30
|
+
/** Opens the connection. Throwing or rejecting counts as a failure. */
|
|
31
|
+
connect: (gate: ConnectionGateController) => void | Promise<void>;
|
|
32
|
+
message: string;
|
|
33
|
+
detail?: string;
|
|
34
|
+
disconnectedMessage?: string;
|
|
35
|
+
retry?: {
|
|
36
|
+
maxAttempts?: number;
|
|
37
|
+
baseDelayMs?: number;
|
|
38
|
+
maxDelayMs?: number;
|
|
39
|
+
autoStart?: boolean;
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** Keep children mounted under the screen, for a terminal or display. */
|
|
43
|
+
keepMounted?: boolean;
|
|
44
|
+
backgroundColor?: string;
|
|
45
|
+
extraActions?: React.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
children: React.ReactNode | ((gate: ConnectionGateController) => React.ReactNode);
|
|
48
|
+
}
|
|
49
|
+
/** The controller of the ConnectionGate this renders inside. */
|
|
50
|
+
export declare function useConnectionGate(): ConnectionGateController;
|
|
51
|
+
/**
|
|
52
|
+
* One connection lifecycle for every tab: connecting, failed with retry and
|
|
53
|
+
* a log, dropped, or unavailable. Children render once it is up.
|
|
54
|
+
*/
|
|
55
|
+
export declare function ConnectionGate(props: ConnectionGateProps): React.JSX.Element;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface ConnectionLogPanelProps {
|
|
2
|
+
isConnecting: boolean;
|
|
3
|
+
isConnected: boolean;
|
|
4
|
+
hasConnectionError: boolean;
|
|
5
|
+
position?: "top" | "bottom";
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConnectionLogPanel({ isConnecting, isConnected, hasConnectionError, position, className, }: ConnectionLogPanelProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ConnectionStatus } from "./connection-status";
|
|
3
|
+
export interface ConnectionUnavailable {
|
|
4
|
+
title: string;
|
|
5
|
+
hint?: string;
|
|
6
|
+
/** Another way forward, like opening the host editor. */
|
|
7
|
+
action?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface ConnectionScreenProps {
|
|
10
|
+
status: ConnectionStatus;
|
|
11
|
+
/** Headline while connecting. */
|
|
12
|
+
message?: string;
|
|
13
|
+
/** Second line under the headline, usually user@host:port. */
|
|
14
|
+
detail?: string;
|
|
15
|
+
/** Headline once it has failed and is not retrying on its own. */
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
/** The reason it failed, shown under the headline. */
|
|
18
|
+
errorDetail?: string | null;
|
|
19
|
+
/** Shown instead of a failure when the feature cannot run here. */
|
|
20
|
+
unavailable?: ConnectionUnavailable | null;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
attempt?: number;
|
|
23
|
+
maxAttempts?: number;
|
|
24
|
+
nextRetryInMs?: number | null;
|
|
25
|
+
onManualRetry?: () => void;
|
|
26
|
+
retryLabel?: string;
|
|
27
|
+
disconnectedMessage?: string;
|
|
28
|
+
extraActions?: React.ReactNode;
|
|
29
|
+
logPosition?: "top" | "bottom";
|
|
30
|
+
emptyState?: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/** The one screen every connection shows until it is up. */
|
|
34
|
+
export declare function ConnectionScreen({ status, message, detail, errorMessage, errorDetail, unavailable, backgroundColor, attempt, maxAttempts, nextRetryInMs, onManualRetry, retryLabel, disconnectedMessage, extraActions, logPosition, emptyState, className, }: ConnectionScreenProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ConnectionStatus = "connecting" | "connected" | "error" | "disconnected";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { type PanelDensity, type PanelViewMode } from "./panel-layout";
|
|
3
|
+
export interface DataColumn<T> {
|
|
4
|
+
key: string;
|
|
5
|
+
header: string;
|
|
6
|
+
/** Any grid track: "1fr", "120px", "minmax(0,2fr)". */
|
|
7
|
+
width: string;
|
|
8
|
+
cell: (item: T) => React.ReactNode;
|
|
9
|
+
/** Dropped below md, for columns that are nice rather than necessary. */
|
|
10
|
+
hideBelow?: "md" | "lg";
|
|
11
|
+
align?: "start" | "end";
|
|
12
|
+
}
|
|
13
|
+
export interface GridColumns {
|
|
14
|
+
base?: number;
|
|
15
|
+
md?: number;
|
|
16
|
+
lg?: number;
|
|
17
|
+
xl?: number;
|
|
18
|
+
}
|
|
19
|
+
/** One collection as a card grid or a dense row table. */
|
|
20
|
+
export declare function DataView<T>({ items, view, density, getKey, renderCard, columns, listColumns, onRowClick, isRowActive, empty, className, }: {
|
|
21
|
+
items: T[];
|
|
22
|
+
view: PanelViewMode;
|
|
23
|
+
density?: PanelDensity;
|
|
24
|
+
getKey: (item: T) => string;
|
|
25
|
+
renderCard: (item: T) => React.ReactNode;
|
|
26
|
+
columns: GridColumns;
|
|
27
|
+
listColumns: DataColumn<T>[];
|
|
28
|
+
onRowClick?: (item: T) => void;
|
|
29
|
+
isRowActive?: (item: T) => boolean;
|
|
30
|
+
empty: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
16
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
17
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: "default" | "destructive";
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
23
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
|
|
25
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
declare function DropdownMenuSubContent({ className, sideOffset, alignOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
29
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
/**
|
|
3
|
+
* Shared empty state. Every feature used to hand-roll its own, so some
|
|
4
|
+
* surfaces explained what to do next and others showed a bare line of text.
|
|
5
|
+
*
|
|
6
|
+
* The `hint` and `action` only render at "guided" verbosity, which the Simple
|
|
7
|
+
* preset turns on: someone who has just picked the simplest interface is the
|
|
8
|
+
* one who most needs telling what to do next, while an experienced user on
|
|
9
|
+
* Advanced does not want the extra paragraph on every empty panel.
|
|
10
|
+
*/
|
|
11
|
+
export declare function EmptyState({ icon: Icon, title, hint, action, className, }: {
|
|
12
|
+
icon?: LucideIcon;
|
|
13
|
+
title: string;
|
|
14
|
+
/** Guidance shown only at "guided" verbosity. */
|
|
15
|
+
hint?: string;
|
|
16
|
+
/** Primary call to action, also guided-only. */
|
|
17
|
+
action?: React.ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Label + control + optional hint, the shape every field shares. */
|
|
3
|
+
export declare function Field({ label, hint, error, aside, htmlFor, className, children, }: {
|
|
4
|
+
label: string;
|
|
5
|
+
hint?: ReactNode;
|
|
6
|
+
error?: string;
|
|
7
|
+
aside?: ReactNode;
|
|
8
|
+
htmlFor?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export declare function TextField({ label, value, onChange, placeholder, hint, error, aside, disabled, mono, className, }: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
hint?: ReactNode;
|
|
18
|
+
error?: string;
|
|
19
|
+
aside?: ReactNode;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
mono?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare function NumberField({ label, value, onChange, placeholder, hint, error, min, max, disabled, className, }: {
|
|
25
|
+
label: string;
|
|
26
|
+
value: number;
|
|
27
|
+
onChange: (value: number) => void;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
hint?: ReactNode;
|
|
30
|
+
error?: string;
|
|
31
|
+
min?: number;
|
|
32
|
+
max?: number;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
className?: string;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
/** Values the server sends in place of a stored secret. */
|
|
37
|
+
export declare const SECRET_SENTINELS: string[];
|
|
38
|
+
export declare function isSecretSentinel(value: string): boolean;
|
|
39
|
+
export declare function SecretField({ label, value, onChange, placeholder, hint, error, disabled, className, }: {
|
|
40
|
+
label: string;
|
|
41
|
+
value: string;
|
|
42
|
+
onChange: (value: string) => void;
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
hint?: ReactNode;
|
|
45
|
+
error?: string;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
className?: string;
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
/** A Radix dropdown, so its list uses the theme tokens. */
|
|
50
|
+
export declare function SelectField<T extends string>({ label, value, onChange, options, hint, error, disabled, className, placeholder, }: {
|
|
51
|
+
label: string;
|
|
52
|
+
value: T;
|
|
53
|
+
onChange: (value: T) => void;
|
|
54
|
+
options: readonly {
|
|
55
|
+
value: T;
|
|
56
|
+
label: string;
|
|
57
|
+
}[];
|
|
58
|
+
hint?: ReactNode;
|
|
59
|
+
error?: string;
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
className?: string;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
}): import("react").JSX.Element;
|
|
64
|
+
export declare function TextAreaField({ label, value, onChange, placeholder, rows, hint, error, aside, mono, disabled, className, }: {
|
|
65
|
+
label: string;
|
|
66
|
+
value: string;
|
|
67
|
+
onChange: (value: string) => void;
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
rows?: number;
|
|
70
|
+
hint?: ReactNode;
|
|
71
|
+
error?: string;
|
|
72
|
+
aside?: ReactNode;
|
|
73
|
+
mono?: boolean;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
className?: string;
|
|
76
|
+
}): import("react").JSX.Element;
|
|
77
|
+
/** A labelled switch. */
|
|
78
|
+
export declare function SwitchRow({ label, description, badge, checked, onChange, disabled, defaultKey, rowId, }: {
|
|
79
|
+
label: string;
|
|
80
|
+
description?: ReactNode;
|
|
81
|
+
badge?: string;
|
|
82
|
+
checked: boolean;
|
|
83
|
+
onChange: (value: boolean) => void;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
defaultKey?: string;
|
|
86
|
+
rowId?: string;
|
|
87
|
+
}): import("react").JSX.Element;
|
|
88
|
+
/** A list of rows you add to and remove from. */
|
|
89
|
+
export declare function Repeater<T>({ label, items, onChange, makeItem, empty, addLabel, hint, renderItem, }: {
|
|
90
|
+
label: string;
|
|
91
|
+
items: T[];
|
|
92
|
+
onChange: (items: T[]) => void;
|
|
93
|
+
makeItem: () => T;
|
|
94
|
+
empty: string;
|
|
95
|
+
addLabel: string;
|
|
96
|
+
hint?: ReactNode;
|
|
97
|
+
renderItem: (item: T, update: (next: T) => void, index: number) => ReactNode;
|
|
98
|
+
}): import("react").JSX.Element;
|
|
99
|
+
/** Chip input for tags. */
|
|
100
|
+
export declare function TagInput({ tags, input, placeholder, onTagsChange, onInputChange, }: {
|
|
101
|
+
tags: string[];
|
|
102
|
+
input: string;
|
|
103
|
+
placeholder: string;
|
|
104
|
+
onTagsChange: (tags: string[]) => void;
|
|
105
|
+
onInputChange: (value: string) => void;
|
|
106
|
+
}): import("react").JSX.Element;
|
|
107
|
+
/** Two fields side by side above md, stacked below. */
|
|
108
|
+
export declare function FieldPair({ children }: {
|
|
109
|
+
children: ReactNode;
|
|
110
|
+
}): import("react").JSX.Element;
|
|
111
|
+
/** Reads a picked file's text, for keys and certificates. */
|
|
112
|
+
export declare function useFileText(onText: (text: string) => void): {
|
|
113
|
+
reading: boolean;
|
|
114
|
+
onFile: (file: File | null | undefined) => Promise<void>;
|
|
115
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type KbdProps = React.HTMLAttributes<HTMLElement>;
|
|
3
|
+
declare const Kbd: React.ForwardRefExoticComponent<KbdProps & React.RefAttributes<HTMLElement>>;
|
|
4
|
+
declare const KbdKey: {
|
|
5
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
declare const KbdSeparator: {
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export { Kbd, KbdKey, KbdSeparator };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface ManagerCardError {
|
|
3
|
+
message: string;
|
|
4
|
+
code?: string;
|
|
5
|
+
}
|
|
6
|
+
/** The frame a host manager card draws: title, refresh, error and empty states. */
|
|
7
|
+
export declare function ManagerCardShell({ title, icon, loading, error, onRefresh, empty, emptyMessage, children, headerExtra, }: {
|
|
8
|
+
title: string;
|
|
9
|
+
icon: ReactNode;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
error: ManagerCardError | null;
|
|
12
|
+
onRefresh: () => void;
|
|
13
|
+
empty?: boolean;
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
headerExtra?: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/** The filter box above a manager card's list. */
|
|
19
|
+
export declare function ManagerSearch({ value, onChange, placeholder, count, extra, }: {
|
|
20
|
+
value: string;
|
|
21
|
+
onChange: (value: string) => void;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
count?: number;
|
|
24
|
+
extra?: ReactNode;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A usage bar on the shared color ramp. */
|
|
2
|
+
export declare function Meter({ percent, className, }: {
|
|
3
|
+
percent: number | null;
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* A meter with its readout. Pass `label` for the stacked card form; leave it off
|
|
8
|
+
* for the bare form a table cell wants.
|
|
9
|
+
*/
|
|
10
|
+
export declare function UsagePair({ label, percent, detail, }: {
|
|
11
|
+
label?: string;
|
|
12
|
+
percent: number;
|
|
13
|
+
detail?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Card shell for Host Metrics tiles. In the masonry grid tiles are
|
|
4
|
+
* content-sized (auto height), so the card grows to fit its content. Scrollable
|
|
5
|
+
* cards (long lists/logs) cap their body at `scrollMax` px and scroll beyond,
|
|
6
|
+
* which keeps the masonry tidy while short cards stay compact.
|
|
7
|
+
*/
|
|
8
|
+
export declare function MetricCard({ title, icon, action, children, bodyClassName, scroll, scrollMax, }: {
|
|
9
|
+
title: string;
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
bodyClassName?: string;
|
|
14
|
+
/** When true the body caps its height and scrolls instead of growing. */
|
|
15
|
+
scroll?: boolean;
|
|
16
|
+
/** Max body height in px for scrollable cards. */
|
|
17
|
+
scrollMax?: number;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/** One spacing rhythm for every panel and tab. */
|
|
3
|
+
export declare const PANEL: {
|
|
4
|
+
readonly body: "p-2.5";
|
|
5
|
+
readonly gap: "gap-2";
|
|
6
|
+
readonly band: "px-3 py-2";
|
|
7
|
+
readonly cardHead: "px-3 py-2.5";
|
|
8
|
+
readonly header: "h-12.5";
|
|
9
|
+
};
|
|
10
|
+
export type PanelViewMode = "grid" | "list";
|
|
11
|
+
export type PanelDensity = "comfortable" | "compact";
|
|
12
|
+
/** The header, toolbar band and body every tab and panel draws. */
|
|
13
|
+
export declare function PanelShell({ chrome, icon, title, status, leading, actions, toolbar, tabs, footer, scroll, className, children, }: {
|
|
14
|
+
/** False inside a sidebar, which draws its own header. */
|
|
15
|
+
chrome?: boolean;
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
title?: React.ReactNode;
|
|
18
|
+
/** Short caption beside the title, like "12 of 18 running". */
|
|
19
|
+
status?: React.ReactNode;
|
|
20
|
+
/** Sits before the title, usually a BackButton. */
|
|
21
|
+
leading?: React.ReactNode;
|
|
22
|
+
actions?: React.ReactNode;
|
|
23
|
+
toolbar?: React.ReactNode;
|
|
24
|
+
/** A full-bleed tab strip in place of a toolbar. */
|
|
25
|
+
tabs?: React.ReactNode;
|
|
26
|
+
/** A bar pinned under the body, like Cancel and Save. */
|
|
27
|
+
footer?: React.ReactNode;
|
|
28
|
+
/** False when the body scrolls itself. */
|
|
29
|
+
scroll?: boolean;
|
|
30
|
+
className?: string;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}): React.JSX.Element;
|
|
33
|
+
/** Square back button sized for the PanelShell header. */
|
|
34
|
+
export declare function BackButton({ onClick, label, className, }: {
|
|
35
|
+
onClick: () => void;
|
|
36
|
+
label?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
}): React.JSX.Element;
|
|
39
|
+
/** Search box sized to match toolbar buttons. Esc clears it. */
|
|
40
|
+
export declare function PanelSearch({ value, onChange, placeholder, fill, autoFocus, className, }: {
|
|
41
|
+
value: string;
|
|
42
|
+
onChange: (next: string) => void;
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
/** Takes the whole toolbar, for panels where search is the only control. */
|
|
45
|
+
fill?: boolean;
|
|
46
|
+
autoFocus?: boolean;
|
|
47
|
+
className?: string;
|
|
48
|
+
}): React.JSX.Element;
|
|
49
|
+
/** Square segmented control. */
|
|
50
|
+
export declare function Segmented<T extends string>({ value, onChange, options, className, }: {
|
|
51
|
+
value: T;
|
|
52
|
+
onChange: (next: T) => void;
|
|
53
|
+
options: readonly {
|
|
54
|
+
value: NoInfer<T>;
|
|
55
|
+
label: string;
|
|
56
|
+
icon?: React.ReactNode;
|
|
57
|
+
count?: number;
|
|
58
|
+
title?: string;
|
|
59
|
+
}[];
|
|
60
|
+
className?: string;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
/** Grid or list, plus the compact rows toggle. */
|
|
63
|
+
export declare function ViewToggle({ view, onView, density, onDensity, }: {
|
|
64
|
+
view: PanelViewMode;
|
|
65
|
+
onView: (next: PanelViewMode) => void;
|
|
66
|
+
density?: PanelDensity;
|
|
67
|
+
onDensity?: (next: PanelDensity) => void;
|
|
68
|
+
}): React.JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* A run of peer facts with a rule between each pair, like "12 online | 40
|
|
71
|
+
* hosts". Never wraps; a fact that does not fit is truncated.
|
|
72
|
+
*/
|
|
73
|
+
export declare function Facts({ className, children, }: {
|
|
74
|
+
className?: string;
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
}): React.JSX.Element;
|
|
77
|
+
/** Section label with a rule running to the edge. */
|
|
78
|
+
export declare function GroupHeading({ title, count, action, className, }: {
|
|
79
|
+
title: string;
|
|
80
|
+
count?: number;
|
|
81
|
+
action?: React.ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
}): React.JSX.Element;
|