@praxical/ui 0.0.0-stage → 0.11.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -2
  3. package/dist/activity-calendar.d.ts +13 -0
  4. package/dist/activity-calendar.js +7 -0
  5. package/dist/activity-heatmap.d.ts +14 -0
  6. package/dist/activity-heatmap.js +13 -0
  7. package/dist/chart-data.d.ts +9 -0
  8. package/dist/chart-data.js +9 -0
  9. package/dist/charts.d.ts +56 -0
  10. package/dist/charts.js +424 -0
  11. package/dist/chunk-7RMPDKZV.js +541 -0
  12. package/dist/chunk-7RTW3X7C.js +142 -0
  13. package/dist/chunk-EBF2F3LN.js +1523 -0
  14. package/dist/chunk-FCYIZANU.js +385 -0
  15. package/dist/chunk-HMO4VQZN.js +58 -0
  16. package/dist/chunk-II677WPC.js +177 -0
  17. package/dist/chunk-KZHUBPY6.js +102 -0
  18. package/dist/chunk-OLGZOPLD.js +166 -0
  19. package/dist/chunk-PDSV773E.js +52 -0
  20. package/dist/chunk-Q4ARHP76.js +457 -0
  21. package/dist/chunk-U5W7O3QV.js +22 -0
  22. package/dist/chunk-V6MXR4P2.js +275 -0
  23. package/dist/chunk-VZZDLRM5.js +152 -0
  24. package/dist/chunk-WEM2UQPR.js +110 -0
  25. package/dist/chunk-XFNDEA5M.js +104 -0
  26. package/dist/chunk-YKFAA7GU.js +72 -0
  27. package/dist/code-editor.css +76 -0
  28. package/dist/code-editor.d.ts +44 -0
  29. package/dist/code-editor.js +287 -0
  30. package/dist/code-value.d.ts +13 -0
  31. package/dist/code-value.js +10 -0
  32. package/dist/code.d.ts +36 -0
  33. package/dist/code.js +198 -0
  34. package/dist/collection.d.ts +21 -0
  35. package/dist/collection.js +48 -0
  36. package/dist/content.d.ts +42 -0
  37. package/dist/content.js +122 -0
  38. package/dist/display.d.ts +58 -0
  39. package/dist/display.js +27 -0
  40. package/dist/feedback.d.ts +34 -0
  41. package/dist/feedback.js +184 -0
  42. package/dist/file-tree.d.ts +17 -0
  43. package/dist/file-tree.js +11 -0
  44. package/dist/forms.d.ts +69 -0
  45. package/dist/forms.js +273 -0
  46. package/dist/git-graph.d.ts +8 -0
  47. package/dist/git-graph.js +15 -0
  48. package/dist/git-layout.d.ts +24 -0
  49. package/dist/git-layout.js +7 -0
  50. package/dist/image-viewer.d.ts +18 -0
  51. package/dist/image-viewer.js +11 -0
  52. package/dist/index.d.ts +363 -0
  53. package/dist/index.js +98 -0
  54. package/dist/inputs.d.ts +112 -0
  55. package/dist/inputs.js +938 -0
  56. package/dist/layout.d.ts +56 -0
  57. package/dist/layout.js +180 -0
  58. package/dist/map-frame.d.ts +37 -0
  59. package/dist/map-frame.js +13 -0
  60. package/dist/media.d.ts +40 -0
  61. package/dist/media.js +19 -0
  62. package/dist/network-layout.d.ts +94 -0
  63. package/dist/network-layout.js +19 -0
  64. package/dist/network.d.ts +111 -0
  65. package/dist/network.js +354 -0
  66. package/dist/overlays.d.ts +95 -0
  67. package/dist/overlays.js +25 -0
  68. package/dist/patterns.d.ts +117 -0
  69. package/dist/patterns.js +387 -0
  70. package/dist/power-layout.d.ts +91 -0
  71. package/dist/power-layout.js +13 -0
  72. package/dist/power.d.ts +91 -0
  73. package/dist/power.js +353 -0
  74. package/dist/signal-context.d.ts +11 -0
  75. package/dist/signal-context.js +15 -0
  76. package/dist/strings-es-419.d.ts +13 -0
  77. package/dist/strings-es-419.js +357 -0
  78. package/dist/strings-fr.d.ts +15 -0
  79. package/dist/strings-fr.js +359 -0
  80. package/dist/strings-ja.d.ts +16 -0
  81. package/dist/strings-ja.js +357 -0
  82. package/dist/strings-pt-BR.d.ts +13 -0
  83. package/dist/strings-pt-BR.js +357 -0
  84. package/dist/strings.d.ts +394 -0
  85. package/dist/strings.js +15 -0
  86. package/dist/styles.css +2 -0
  87. package/dist/tab-bar.d.ts +20 -0
  88. package/dist/tab-bar.js +114 -0
  89. package/package.json +199 -3
@@ -0,0 +1,56 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ /** Spacing scale in CSS pixels. */
3
+ export type Space = 0 | 2 | 4 | 6 | 8 | 12 | 16 | 20 | 24 | 32 | 48;
4
+ /** Vertical rhythm. Children stack with one gap from the spacing scale. */
5
+ export declare function Stack({ gap, align, className, style, ...props }: ComponentProps<"div"> & {
6
+ gap?: Space;
7
+ align?: "start" | "center" | "end" | "stretch";
8
+ }): import("react").JSX.Element;
9
+ /** Horizontal rhythm for controls and labels; wraps by default. */
10
+ export declare function Inline({ gap, align, justify, wrap, className, style, ...props }: ComponentProps<"div"> & {
11
+ gap?: Space;
12
+ align?: "start" | "center" | "end" | "baseline" | "stretch";
13
+ justify?: "start" | "center" | "end" | "between";
14
+ wrap?: boolean;
15
+ }): import("react").JSX.Element;
16
+ /** Responsive columns: an explicit template, or as many `min`-wide columns as fit. */
17
+ export declare function Grid({ columns, min, gap, className, style, ...props }: ComponentProps<"div"> & {
18
+ columns?: string;
19
+ min?: string;
20
+ gap?: Space;
21
+ }): import("react").JSX.Element;
22
+ /** Main column plus a side column; stacks when the frame is narrower than 720px. */
23
+ export declare function Split({ ratio, gap, className, style, children, ...props }: ComponentProps<"div"> & {
24
+ ratio?: string;
25
+ gap?: Space;
26
+ }): import("react").JSX.Element;
27
+ /** The first thing on a page: one heading, one line of purpose, the page's actions.
28
+ * `media` puts an app icon or avatar beside the title; children render under
29
+ * the description (facts, badges). */
30
+ export declare function PageHeader({ title, description, actions, eyebrow, breadcrumbs, media, level, className, children, ...props }: Omit<ComponentProps<"header">, "title"> & {
31
+ title: ReactNode;
32
+ description?: ReactNode;
33
+ actions?: ReactNode;
34
+ eyebrow?: ReactNode;
35
+ breadcrumbs?: ReactNode;
36
+ /** An icon or avatar beside the heading. */
37
+ media?: ReactNode;
38
+ level?: 1 | 2;
39
+ }): import("react").JSX.Element;
40
+ /** A navigation section that discloses its destinations in place. Uncontrolled,
41
+ * it opens whenever `current` becomes true, so client-side navigation into
42
+ * the group reveals the destination. */
43
+ export declare function NavGroup({ label, icon, current, defaultOpen, open, onOpenChange, children, }: {
44
+ label: ReactNode;
45
+ icon?: ReactNode;
46
+ /** A destination inside the group is the current page. */
47
+ current?: boolean;
48
+ defaultOpen?: boolean;
49
+ open?: boolean;
50
+ onOpenChange?: (open: boolean) => void;
51
+ children: ReactNode;
52
+ }): import("react").JSX.Element;
53
+ /** A titled block of navigation rows with a section marker. */
54
+ export declare function NavSection({ label, children, ...props }: ComponentProps<"nav"> & {
55
+ label: string;
56
+ }): import("react").JSX.Element;
package/dist/layout.js ADDED
@@ -0,0 +1,180 @@
1
+ 'use client';
2
+ "use client";
3
+
4
+ // packages/ui/src/layout.tsx
5
+ import { useState } from "react";
6
+ import { ChevronDown } from "lucide-react";
7
+ import { Collapsible } from "@base-ui/react/collapsible";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ var cx = (...values) => values.filter(Boolean).join(" ");
10
+ function Stack({
11
+ gap = 16,
12
+ align,
13
+ className,
14
+ style,
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsx(
18
+ "div",
19
+ {
20
+ ...props,
21
+ className: cx("signal-stack", className),
22
+ style: { gap, alignItems: align, ...style }
23
+ }
24
+ );
25
+ }
26
+ function Inline({
27
+ gap = 8,
28
+ align = "center",
29
+ justify,
30
+ wrap = true,
31
+ className,
32
+ style,
33
+ ...props
34
+ }) {
35
+ return /* @__PURE__ */ jsx(
36
+ "div",
37
+ {
38
+ ...props,
39
+ className: cx("signal-inline", className),
40
+ style: {
41
+ gap,
42
+ alignItems: align,
43
+ justifyContent: justify === "between" ? "space-between" : justify,
44
+ flexWrap: wrap ? "wrap" : "nowrap",
45
+ ...style
46
+ }
47
+ }
48
+ );
49
+ }
50
+ function Grid({
51
+ columns,
52
+ min = "280px",
53
+ gap = 24,
54
+ className,
55
+ style,
56
+ ...props
57
+ }) {
58
+ return /* @__PURE__ */ jsx(
59
+ "div",
60
+ {
61
+ ...props,
62
+ className: cx("signal-grid", className),
63
+ style: {
64
+ gap,
65
+ gridTemplateColumns: columns ?? `repeat(auto-fit, minmax(min(${min}, 100%), 1fr))`,
66
+ ...style
67
+ }
68
+ }
69
+ );
70
+ }
71
+ function Split({
72
+ ratio = "minmax(0, 2fr) minmax(280px, 1fr)",
73
+ gap = 24,
74
+ className,
75
+ style,
76
+ children,
77
+ ...props
78
+ }) {
79
+ return /* @__PURE__ */ jsx("div", { ...props, className: cx("signal-split-frame", className), children: /* @__PURE__ */ jsx(
80
+ "div",
81
+ {
82
+ className: "signal-split",
83
+ style: { gap, gridTemplateColumns: ratio, ...style },
84
+ children
85
+ }
86
+ ) });
87
+ }
88
+ function PageHeader({
89
+ title,
90
+ description,
91
+ actions,
92
+ eyebrow,
93
+ breadcrumbs,
94
+ media,
95
+ level = 1,
96
+ className,
97
+ children,
98
+ ...props
99
+ }) {
100
+ const Heading = level === 1 ? "h1" : "h2";
101
+ const heading = /* @__PURE__ */ jsxs(Fragment, { children: [
102
+ eyebrow && /* @__PURE__ */ jsx("span", { className: "signal-eyebrow", children: eyebrow }),
103
+ /* @__PURE__ */ jsx(Heading, { className: "signal-page-title", children: title }),
104
+ description && /* @__PURE__ */ jsx("p", { className: "signal-page-description", children: description }),
105
+ children && /* @__PURE__ */ jsx("div", { className: "signal-page-details", children })
106
+ ] });
107
+ return /* @__PURE__ */ jsxs(
108
+ "header",
109
+ {
110
+ ...props,
111
+ className: cx("signal-page-header", className),
112
+ "data-media": media ? "" : void 0,
113
+ children: [
114
+ /* @__PURE__ */ jsxs("div", { className: "signal-page-header-text", children: [
115
+ breadcrumbs,
116
+ media ? /* @__PURE__ */ jsxs("div", { className: "signal-page-identity", children: [
117
+ /* @__PURE__ */ jsx("div", { className: "signal-page-media", children: media }),
118
+ /* @__PURE__ */ jsx("div", { className: "signal-page-header-text", children: heading })
119
+ ] }) : heading
120
+ ] }),
121
+ actions && /* @__PURE__ */ jsx("div", { className: "signal-page-actions", children: actions })
122
+ ]
123
+ }
124
+ );
125
+ }
126
+ function NavGroup({
127
+ label,
128
+ icon,
129
+ current = false,
130
+ defaultOpen,
131
+ open,
132
+ onOpenChange,
133
+ children
134
+ }) {
135
+ const [localOpen, setLocalOpen] = useState(defaultOpen ?? current);
136
+ const [wasCurrent, setWasCurrent] = useState(current);
137
+ if (current !== wasCurrent) {
138
+ setWasCurrent(current);
139
+ if (current) setLocalOpen(true);
140
+ }
141
+ return /* @__PURE__ */ jsxs(
142
+ Collapsible.Root,
143
+ {
144
+ className: "signal-nav-group",
145
+ "data-current": current || void 0,
146
+ open: open ?? localOpen,
147
+ onOpenChange: (next) => {
148
+ setLocalOpen(next);
149
+ onOpenChange?.(next);
150
+ },
151
+ children: [
152
+ /* @__PURE__ */ jsxs(Collapsible.Trigger, { className: "signal-nav-item signal-nav-group-trigger", children: [
153
+ icon,
154
+ /* @__PURE__ */ jsx("span", { children: label }),
155
+ /* @__PURE__ */ jsx(ChevronDown, { className: "signal-nav-group-chevron", "aria-hidden": "true" })
156
+ ] }),
157
+ /* @__PURE__ */ jsx(Collapsible.Panel, { className: "signal-nav-group-panel", children: /* @__PURE__ */ jsx("div", { children }) })
158
+ ]
159
+ }
160
+ );
161
+ }
162
+ function NavSection({
163
+ label,
164
+ children,
165
+ ...props
166
+ }) {
167
+ return /* @__PURE__ */ jsxs("nav", { ...props, "aria-label": label, className: "signal-nav-section", children: [
168
+ /* @__PURE__ */ jsx("span", { className: "signal-eyebrow signal-nav-section-label", children: label }),
169
+ /* @__PURE__ */ jsx("div", { className: "signal-nav-section-items", children })
170
+ ] });
171
+ }
172
+ export {
173
+ Grid,
174
+ Inline,
175
+ NavGroup,
176
+ NavSection,
177
+ PageHeader,
178
+ Split,
179
+ Stack
180
+ };
@@ -0,0 +1,37 @@
1
+ import { type FocusEvent, type PointerEvent, type ReactNode } from "react";
2
+ /** An item the keyboard can reach, in reading order, with its parent's id. */
3
+ export interface FrameItem {
4
+ id: string;
5
+ parent?: string;
6
+ }
7
+ export interface Frame {
8
+ /** Props for a focusable item: its roving tab stop, focus tooltip and pointer tooltip. */
9
+ item: (id: string, tip: ReactNode) => {
10
+ "data-map-item": string;
11
+ tabIndex: number;
12
+ "aria-describedby"?: string;
13
+ onFocus: (e: FocusEvent<Element>) => void;
14
+ onBlur: () => void;
15
+ onPointerMove: (e: PointerEvent) => void;
16
+ onPointerLeave: () => void;
17
+ };
18
+ /** Pointer-only tooltip, for a decoration such as a cable. */
19
+ hover: (tip: ReactNode) => {
20
+ onPointerMove: (e: PointerEvent) => void;
21
+ onPointerLeave: () => void;
22
+ };
23
+ }
24
+ export declare function MapFrame({ className, label, hint, width, height, items, tools, after, children, }: {
25
+ className: string;
26
+ label: string;
27
+ hint: string;
28
+ width: number;
29
+ height: number;
30
+ items: readonly FrameItem[];
31
+ /** Extra tools before the zoom controls. */
32
+ tools?: ReactNode;
33
+ /** Below the view, such as the key. */
34
+ after?: ReactNode;
35
+ children: (frame: Frame) => ReactNode;
36
+ }): import("react").JSX.Element;
37
+ export declare const clip: (s: string, n: number) => string;
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+ "use client";
3
+ import {
4
+ MapFrame,
5
+ clip
6
+ } from "./chunk-II677WPC.js";
7
+ import "./chunk-EBF2F3LN.js";
8
+ import "./chunk-U5W7O3QV.js";
9
+ import "./chunk-FCYIZANU.js";
10
+ export {
11
+ MapFrame,
12
+ clip
13
+ };
@@ -0,0 +1,40 @@
1
+ import { type ReactNode } from "react";
2
+ export interface AudioPlayerHandle {
3
+ play(): Promise<void>;
4
+ pause(): void;
5
+ seek(seconds: number): void;
6
+ setVolume(volume: number): void;
7
+ getMediaElement(): HTMLAudioElement | null;
8
+ }
9
+ export interface AudioPlayerProps {
10
+ src: string;
11
+ /** Compact by default for message attachments; false exposes the full toolbar. */
12
+ compact?: boolean;
13
+ label: string;
14
+ /** Peak amplitude per equal time bucket, normalized 0..1; generated by the application. */
15
+ waveform?: readonly number[];
16
+ /** Display metadata, supplied from trusted media inspection. Unknown fields are omitted. */
17
+ codec?: string;
18
+ timestamp?: {
19
+ label: string;
20
+ dateTime: string;
21
+ };
22
+ metadata?: readonly {
23
+ label: string;
24
+ value: string;
25
+ }[];
26
+ transcript?: ReactNode;
27
+ onPlaybackChange?: (playing: boolean) => void;
28
+ onTimeChange?: (seconds: number) => void;
29
+ onError?: (message: string) => void;
30
+ }
31
+ export declare function formatMediaTime(seconds: number): string;
32
+ /** Custom controls around the browser's media element; never fetches or fabricates analysis data. */
33
+ export declare const AudioPlayer: import("react").ForwardRefExoticComponent<AudioPlayerProps & import("react").RefAttributes<AudioPlayerHandle>>;
34
+ export { ImageViewer, type ViewerImage } from "./image-viewer.js";
35
+ export declare function RecordingIndicator({ kind, state, elapsed, label, }: {
36
+ kind?: "audio" | "video";
37
+ state?: "recording" | "paused" | "stopped";
38
+ elapsed?: number;
39
+ label?: string;
40
+ }): import("react").JSX.Element;
package/dist/media.js ADDED
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ "use client";
3
+ import {
4
+ AudioPlayer,
5
+ RecordingIndicator,
6
+ formatMediaTime
7
+ } from "./chunk-Q4ARHP76.js";
8
+ import {
9
+ ImageViewer
10
+ } from "./chunk-OLGZOPLD.js";
11
+ import "./chunk-EBF2F3LN.js";
12
+ import "./chunk-U5W7O3QV.js";
13
+ import "./chunk-FCYIZANU.js";
14
+ export {
15
+ AudioPlayer,
16
+ ImageViewer,
17
+ RecordingIndicator,
18
+ formatMediaTime
19
+ };
@@ -0,0 +1,94 @@
1
+ /** A link's speed class, slowest first; sets a port's fill and a cable's weight. */
2
+ export type LinkSpeedTier = 0 | 1 | 2 | 3 | 4;
3
+ /** Speed class of a link speed in Mb/s: up to 100M, 1G, 2.5–5G, 10G, 25G and faster. */
4
+ export declare function linkSpeedTier(mbps: number): LinkSpeedTier;
5
+ /** "100M", "2.5G", "10G": a link speed in Mb/s for labels on ports and cables. */
6
+ export declare function formatLinkSpeed(mbps: number): string;
7
+ /** "1.2G", "340M", "12k": a rate in bits per second in about four characters. */
8
+ export declare function formatBitRate(bitsPerSecond: number): string;
9
+ /** The text printed by a port: its label, else the part after the last slash (ge-0/0/7 → 7). */
10
+ export declare function portLabel(port: {
11
+ name: string;
12
+ label?: string;
13
+ }): string;
14
+ /**
15
+ * Where each slot of a faceplate block sits. "row" numbers left to right,
16
+ * then the next row; "column" numbers top to bottom, then the next column,
17
+ * the zigzag most switches print. Rows are clamped to 1–4.
18
+ */
19
+ export declare function faceplateGrid(block: {
20
+ rows?: number;
21
+ order?: "row" | "column";
22
+ ports: readonly unknown[];
23
+ }): {
24
+ rows: number;
25
+ cols: number;
26
+ cells: {
27
+ row: number;
28
+ col: number;
29
+ index: number;
30
+ }[];
31
+ };
32
+ /** The map's geometry in SVG units, 1:1 with CSS pixels at 100%. */
33
+ export declare const mapGeometry: {
34
+ /** Node radius, and a stacked leaf's. */
35
+ readonly radius: 18;
36
+ readonly leafRadius: 13;
37
+ /** A node's own column, and the room for its two lines of text. */
38
+ readonly nodeWidth: 128;
39
+ /** Disc edge to the cable's start ring: clears the second text line by about 6px. */
40
+ readonly labelHeight: 42;
41
+ /** Icon top to the next level's icon top. */
42
+ readonly level: 124;
43
+ readonly gap: 16;
44
+ /** Stacked leaf pitch and the width of a stack. */
45
+ readonly row: 38;
46
+ readonly stackWidth: 214;
47
+ /** This many leaves under one parent stack into a list. */
48
+ readonly stackFrom: 3;
49
+ readonly margin: 24;
50
+ };
51
+ interface TreeNode {
52
+ id: string;
53
+ children?: readonly TreeNode[];
54
+ }
55
+ export interface MapPlacedNode<T> {
56
+ node: T;
57
+ /** The parent's id; undefined for a root. */
58
+ parent?: string;
59
+ x: number;
60
+ y: number;
61
+ /** In a parent's stacked list of leaves, drawn smaller with its text beside it. */
62
+ stacked: boolean;
63
+ }
64
+ export interface MapPlacedEdge<T> {
65
+ /** The child end; a cable is drawn from its parent down to it. */
66
+ child: MapPlacedNode<T>;
67
+ /** SVG path data. */
68
+ d: string;
69
+ /** Where a speed label goes, anchored at its start. */
70
+ labelX: number;
71
+ labelY: number;
72
+ stacked: boolean;
73
+ }
74
+ export interface MapLayout<T> {
75
+ /** Every node in reading order: a parent, its stacked leaves, then its other children. */
76
+ nodes: MapPlacedNode<T>[];
77
+ edges: MapPlacedEdge<T>[];
78
+ /** Vertical lines that carry a stack's leaves. */
79
+ spines: string[];
80
+ /** Where a parent's cables leave it. */
81
+ joints: {
82
+ x: number;
83
+ y: number;
84
+ }[];
85
+ width: number;
86
+ height: number;
87
+ }
88
+ /**
89
+ * Lays a forest out top down. Three or more leaves under one parent become a
90
+ * list beside its other children, so a 24-port switch stays one column wide.
91
+ * Ids must be unique; a repeated id is laid out once.
92
+ */
93
+ export declare function layoutNetworkMap<T extends TreeNode>(roots: readonly T[]): MapLayout<T>;
94
+ export {};
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import {
3
+ faceplateGrid,
4
+ formatBitRate,
5
+ formatLinkSpeed,
6
+ layoutNetworkMap,
7
+ linkSpeedTier,
8
+ mapGeometry,
9
+ portLabel
10
+ } from "./chunk-VZZDLRM5.js";
11
+ export {
12
+ faceplateGrid,
13
+ formatBitRate,
14
+ formatLinkSpeed,
15
+ layoutNetworkMap,
16
+ linkSpeedTier,
17
+ mapGeometry,
18
+ portLabel
19
+ };
@@ -0,0 +1,111 @@
1
+ import { type ComponentProps, type ReactElement, type ReactNode } from "react";
2
+ import { type LinkSpeedTier } from "./network-layout.js";
3
+ export { faceplateGrid, formatBitRate, formatLinkSpeed, layoutNetworkMap, linkSpeedTier, mapGeometry, portLabel, type LinkSpeedTier, type MapLayout, type MapPlacedEdge, type MapPlacedNode, } from "./network-layout.js";
4
+ /** up and problem carry traffic; down has no link; off is shut down; unknown is not reported. */
5
+ export type LinkHealth = "up" | "problem" | "down" | "off" | "unknown";
6
+ /** How one port or cable is doing. The product decides it; Signal draws it. */
7
+ export interface LinkState {
8
+ health: LinkHealth;
9
+ /** Outline colour. A problem is a warning unless set; mark a down link that must stay up "danger". */
10
+ severity?: "warning" | "danger";
11
+ /** Speed class from `linkSpeedTier`: a port's fill and a cable's weight. Omit when no speed is known. */
12
+ tier?: LinkSpeedTier;
13
+ /** What a screen reader hears after the name, such as "Up, 1 Gb/s, to ares". Defaults to the health. */
14
+ label?: string;
15
+ /** Details shown on hover and focus. Defaults to the label. */
16
+ tooltip?: ReactNode;
17
+ }
18
+ export interface FaceplatePortState extends LinkState {
19
+ /** Bits per second received and sent, from this port's own side. Shown while it is up. */
20
+ rx?: number;
21
+ tx?: number;
22
+ /** The port opens this destination. */
23
+ href?: string;
24
+ }
25
+ export interface FaceplatePort {
26
+ /** The interface name, the key into `ports`. */
27
+ name: string;
28
+ /** What the device prints by the port. Defaults to the name after its last slash. */
29
+ label?: string;
30
+ }
31
+ export interface FaceplateBlock {
32
+ /** A short caption above the block, such as "Uplinks". */
33
+ caption?: string;
34
+ /** rj45 is a jack with its latch, sfp a cage (SFP, SFP+, SFP28), qsfp a wider cage. */
35
+ shape: "rj45" | "sfp" | "qsfp" | "other";
36
+ /** 1–4. Two rows face each other: the top row's text sits above it. */
37
+ rows?: number;
38
+ /** "row" numbers left to right; "column" numbers top to bottom, the zigzag switches print. */
39
+ order?: "row" | "column";
40
+ /** Ports in numbering order; null is a blank slot. */
41
+ ports: readonly (FaceplatePort | null)[];
42
+ }
43
+ /**
44
+ * A device's front panel: blocks of ports as the device prints them, each
45
+ * filled by its speed class and outlined by its health, with its label and
46
+ * traffic. One tab stop; arrow keys move between ports by position.
47
+ */
48
+ export declare function Faceplate({ label, blocks, ports, onPortSelect, className, ...props }: Omit<ComponentProps<"div">, "children" | "onSelect"> & {
49
+ /** Names the panel, such as "Ports of switch-1". */
50
+ label: string;
51
+ blocks: readonly FaceplateBlock[];
52
+ /** Each port's state by name. A port without one is drawn as not reported. */
53
+ ports: Readonly<Record<string, FaceplatePortState | undefined>>;
54
+ /** Makes every port without an `href` a button. */
55
+ onPortSelect?: (name: string) => void;
56
+ }): import("react").JSX.Element;
57
+ /** What a faceplate's fills and outlines mean. Show one beside a set of faceplates. */
58
+ export declare function FaceplateLegend({ className, ...props }: Omit<ComponentProps<"ul">, "children">): import("react").JSX.Element;
59
+ /** The cable from a map node up to its parent. */
60
+ export interface NetworkMapLink extends LinkState {
61
+ /** Drawn dashed. */
62
+ wireless?: boolean;
63
+ /** Short speed on the cable, such as "10G" from `formatLinkSpeed`. */
64
+ speed?: string;
65
+ /** The speed is declared, not measured: set in italics. */
66
+ declared?: boolean;
67
+ /** The ports at either end, shown beside a stacked leaf, such as "ge-0/0/7". */
68
+ ports?: string;
69
+ }
70
+ export interface NetworkMapNode {
71
+ /** Unique across the map. */
72
+ id: string;
73
+ label: string;
74
+ /** The second line, such as the model or address. */
75
+ description?: string;
76
+ /** A 24-unit icon element that passes x, y, width and height to its svg, such as a lucide-react icon. */
77
+ icon?: ReactElement<{
78
+ x?: number;
79
+ y?: number;
80
+ width?: number;
81
+ height?: number;
82
+ className?: string;
83
+ }>;
84
+ status?: {
85
+ tone: "success" | "warning" | "danger" | "neutral";
86
+ label: string;
87
+ };
88
+ /** The node opens this destination. */
89
+ href?: string;
90
+ /** Details shown on hover and focus, after the name. */
91
+ tooltip?: ReactNode;
92
+ /** The cable to the parent; ignored on a root. */
93
+ link?: NetworkMapLink;
94
+ children?: readonly NetworkMapNode[];
95
+ }
96
+ /**
97
+ * A network drawn as a tree from its roots down: cables coloured by health,
98
+ * weighted by speed class, dashed for wireless. Fits its frame, zooms and
99
+ * pans. One tab stop; arrow keys move through the devices as in a tree.
100
+ */
101
+ export declare function NetworkMap({ roots, label, onNodeSelect, legend, className, ...props }: Omit<ComponentProps<"div">, "children" | "onSelect"> & {
102
+ roots: readonly NetworkMapNode[];
103
+ /** Names the map. Defaults to "Network map". */
104
+ label?: string;
105
+ /** Makes every node without an `href` a button. */
106
+ onNodeSelect?: (node: NetworkMapNode) => void;
107
+ /** Shows the key below the map. */
108
+ legend?: boolean;
109
+ }): import("react").JSX.Element;
110
+ /** What the map's cables mean. NetworkMap shows it unless `legend={false}`. */
111
+ export declare function NetworkMapLegend({ className, ...props }: Omit<ComponentProps<"ul">, "children">): import("react").JSX.Element;