@ksp-gonogo/ui-kit 0.1.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/LICENSE +596 -0
- package/dist/ActionButton.d.ts +18 -0
- package/dist/ActionButton.d.ts.map +1 -0
- package/dist/ActionButton.js +56 -0
- package/dist/ActionButton.js.map +1 -0
- package/dist/Badge.d.ts +15 -0
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.js +60 -0
- package/dist/Badge.js.map +1 -0
- package/dist/Box.d.ts +19 -0
- package/dist/Box.d.ts.map +1 -0
- package/dist/Box.js +27 -0
- package/dist/Box.js.map +1 -0
- package/dist/Card.d.ts +11 -0
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.js +13 -0
- package/dist/Card.js.map +1 -0
- package/dist/Cluster.d.ts +18 -0
- package/dist/Cluster.d.ts.map +1 -0
- package/dist/Cluster.js +24 -0
- package/dist/Cluster.js.map +1 -0
- package/dist/EmptyState.d.ts +16 -0
- package/dist/EmptyState.d.ts.map +1 -0
- package/dist/EmptyState.js +37 -0
- package/dist/EmptyState.js.map +1 -0
- package/dist/GonogoTokens.d.ts +16 -0
- package/dist/GonogoTokens.d.ts.map +1 -0
- package/dist/GonogoTokens.js +108 -0
- package/dist/GonogoTokens.js.map +1 -0
- package/dist/Grid.d.ts +25 -0
- package/dist/Grid.d.ts.map +1 -0
- package/dist/Grid.js +23 -0
- package/dist/Grid.js.map +1 -0
- package/dist/Inline.d.ts +20 -0
- package/dist/Inline.d.ts.map +1 -0
- package/dist/Inline.js +17 -0
- package/dist/Inline.js.map +1 -0
- package/dist/Panel.d.ts +14 -0
- package/dist/Panel.d.ts.map +1 -0
- package/dist/Panel.js +145 -0
- package/dist/Panel.js.map +1 -0
- package/dist/ProgressBar.d.ts +15 -0
- package/dist/ProgressBar.d.ts.map +1 -0
- package/dist/ProgressBar.js +31 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/Readout.d.ts +35 -0
- package/dist/Readout.d.ts.map +1 -0
- package/dist/Readout.js +114 -0
- package/dist/Readout.js.map +1 -0
- package/dist/Row.d.ts +22 -0
- package/dist/Row.d.ts.map +1 -0
- package/dist/Row.js +32 -0
- package/dist/Row.js.map +1 -0
- package/dist/Section.d.ts +15 -0
- package/dist/Section.d.ts.map +1 -0
- package/dist/Section.js +21 -0
- package/dist/Section.js.map +1 -0
- package/dist/Spinner.d.ts +18 -0
- package/dist/Spinner.d.ts.map +1 -0
- package/dist/Spinner.js +22 -0
- package/dist/Spinner.js.map +1 -0
- package/dist/Stack.d.ts +15 -0
- package/dist/Stack.d.ts.map +1 -0
- package/dist/Stack.js +17 -0
- package/dist/Stack.js.map +1 -0
- package/dist/StatusIndicator.d.ts +27 -0
- package/dist/StatusIndicator.d.ts.map +1 -0
- package/dist/StatusIndicator.js +78 -0
- package/dist/StatusIndicator.js.map +1 -0
- package/dist/Truncate.d.ts +7 -0
- package/dist/Truncate.d.ts.map +1 -0
- package/dist/Truncate.js +14 -0
- package/dist/Truncate.js.map +1 -0
- package/dist/Value.d.ts +24 -0
- package/dist/Value.d.ts.map +1 -0
- package/dist/Value.js +42 -0
- package/dist/Value.js.map +1 -0
- package/dist/WidgetHeader.d.ts +16 -0
- package/dist/WidgetHeader.d.ts.map +1 -0
- package/dist/WidgetHeader.js +40 -0
- package/dist/WidgetHeader.js.map +1 -0
- package/dist/defaultDarkTheme.d.ts +16 -0
- package/dist/defaultDarkTheme.d.ts.map +1 -0
- package/dist/defaultDarkTheme.js +96 -0
- package/dist/defaultDarkTheme.js.map +1 -0
- package/dist/format.d.ts +11 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +12 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/science/ScienceExperimentRow.d.ts +43 -0
- package/dist/science/ScienceExperimentRow.d.ts.map +1 -0
- package/dist/science/ScienceExperimentRow.js +61 -0
- package/dist/science/ScienceExperimentRow.js.map +1 -0
- package/dist/test/axe.d.ts +3 -0
- package/dist/test/axe.d.ts.map +1 -0
- package/dist/test/axe.js +5 -0
- package/dist/test/axe.js.map +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +12 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/theme.d.ts +116 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +15 -0
- package/dist/theme.js.map +1 -0
- package/dist/tokens.css +133 -0
- package/package.json +57 -0
package/dist/Panel.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef, useState, } from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
export const Panel = styled.div `
|
|
5
|
+
/* Glow extension picked up by ScrollArea — descendant glows extend by these
|
|
6
|
+
amounts so they sit flush with the panel chrome rather than the inner
|
|
7
|
+
scroll-container edge. Panel's overflow:hidden clips the overhang. */
|
|
8
|
+
--scroll-glow-pad-y: 12px;
|
|
9
|
+
--scroll-glow-pad-x: 16px;
|
|
10
|
+
|
|
11
|
+
background: var(--color-surface-panel);
|
|
12
|
+
border: 1px solid var(--color-border-subtle);
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
padding: 12px 16px;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
`;
|
|
23
|
+
export const PanelTitle = styled.h3 `
|
|
24
|
+
margin: 0;
|
|
25
|
+
font-size: var(--font-size-xs);
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
letter-spacing: 0.15em;
|
|
28
|
+
text-transform: uppercase;
|
|
29
|
+
color: var(--color-text-dim);
|
|
30
|
+
`;
|
|
31
|
+
export const PanelSubtitle = styled.div `
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
color: var(--color-text-muted);
|
|
34
|
+
letter-spacing: 0.05em;
|
|
35
|
+
margin-top: -4px;
|
|
36
|
+
`;
|
|
37
|
+
const ScrollAreaRoot = styled.div `
|
|
38
|
+
position: relative;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
/* Grow to fill the remaining height of a flex-column parent (a Panel body
|
|
42
|
+
below a fixed-height header) so the inner element's own flex:1 can
|
|
43
|
+
engage overflow, instead of the outer box sizing to content and
|
|
44
|
+
spilling past the panel's overflow:hidden edge. Every real consumer
|
|
45
|
+
wrapping this in a Body styled-component re-applies exactly these two
|
|
46
|
+
rules, so they're the default here rather than something each widget
|
|
47
|
+
has to remember. */
|
|
48
|
+
flex: 1;
|
|
49
|
+
min-height: 0;
|
|
50
|
+
`;
|
|
51
|
+
/**
|
|
52
|
+
* Inner scroll element. Rendered with a stable `data-scroll-area-inner`
|
|
53
|
+
* attribute (set inline below) so consumers can target it from
|
|
54
|
+
* `styled(ScrollArea)\`& [data-scroll-area-inner] { ... }\`` to apply padding
|
|
55
|
+
* or layout (display:flex/gap) to the scrolling children.
|
|
56
|
+
*/
|
|
57
|
+
const ScrollAreaInner = styled.div `
|
|
58
|
+
flex: 1;
|
|
59
|
+
min-height: 0;
|
|
60
|
+
overflow: auto;
|
|
61
|
+
/* Hide the native scrollbar — the glow indicators communicate scroll state.
|
|
62
|
+
Trackpads/wheels still scroll; keyboard PageUp/Down/arrows still work. */
|
|
63
|
+
scrollbar-width: none;
|
|
64
|
+
-ms-overflow-style: none;
|
|
65
|
+
&::-webkit-scrollbar {
|
|
66
|
+
width: 0;
|
|
67
|
+
height: 0;
|
|
68
|
+
display: none;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
const ScrollOverflowGlow = styled.div `
|
|
72
|
+
position: absolute;
|
|
73
|
+
/* Extend horizontally past the scroll container so the glow sits flush with
|
|
74
|
+
the panel chrome's left/right borders. Panel's overflow:hidden clips it. */
|
|
75
|
+
left: calc(-1 * var(--scroll-glow-pad-x, 0px));
|
|
76
|
+
right: calc(-1 * var(--scroll-glow-pad-x, 0px));
|
|
77
|
+
${({ $position }) => $position === "top"
|
|
78
|
+
? "top: calc(-1 * var(--scroll-glow-pad-y, 0px));"
|
|
79
|
+
: "bottom: calc(-1 * var(--scroll-glow-pad-y, 0px));"}
|
|
80
|
+
height: calc(16px + var(--scroll-glow-pad-y, 0px));
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
opacity: ${({ $visible }) => ($visible ? 1 : 0)};
|
|
83
|
+
transition: opacity 150ms ease;
|
|
84
|
+
/* Full-width linear fade anchored on the chrome edge — brightest right at
|
|
85
|
+
the scrollable boundary and tapering inward across the whole width. A
|
|
86
|
+
centred radial ellipse read as a discrete glowing blob floating over the
|
|
87
|
+
content; a full-width edge fade reads as the content itself dissolving
|
|
88
|
+
under a soft overlay at the edge, which is the intended "there's more,
|
|
89
|
+
scroll" affordance. */
|
|
90
|
+
background: linear-gradient(
|
|
91
|
+
${({ $position }) => ($position === "top" ? "to bottom" : "to top")},
|
|
92
|
+
rgba(255, 255, 255, 0.13),
|
|
93
|
+
rgba(255, 255, 255, 0)
|
|
94
|
+
);
|
|
95
|
+
z-index: 1;
|
|
96
|
+
|
|
97
|
+
@media (prefers-reduced-motion: reduce) {
|
|
98
|
+
transition: none;
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
/**
|
|
102
|
+
* Scrolling region with subtle white glow indicators at the top/bottom edges
|
|
103
|
+
* when there's scroll content in that direction. Use anywhere an internal
|
|
104
|
+
* region of a widget can overflow (e.g. lists, terminal output, file trees).
|
|
105
|
+
*
|
|
106
|
+
* Forwards its ref to the inner scroll element so consumers can imperatively
|
|
107
|
+
* scroll. Accepts standard div props on the root; pass className via
|
|
108
|
+
* `styled(ScrollArea)` to apply layout to the root.
|
|
109
|
+
*/
|
|
110
|
+
export const ScrollArea = forwardRef(function ScrollArea({ children, ...rest }, ref) {
|
|
111
|
+
const innerRef = useRef(null);
|
|
112
|
+
const [overflow, setOverflow] = useState({ top: false, bottom: false });
|
|
113
|
+
useImperativeHandle(ref, () => innerRef.current);
|
|
114
|
+
useEffect(() => {
|
|
115
|
+
const el = innerRef.current;
|
|
116
|
+
if (!el)
|
|
117
|
+
return;
|
|
118
|
+
const update = () => {
|
|
119
|
+
const top = el.scrollTop > 1;
|
|
120
|
+
const bottom = el.scrollTop + el.clientHeight < el.scrollHeight - 1;
|
|
121
|
+
setOverflow((prev) => prev.top === top && prev.bottom === bottom ? prev : { top, bottom });
|
|
122
|
+
};
|
|
123
|
+
update();
|
|
124
|
+
el.addEventListener("scroll", update, { passive: true });
|
|
125
|
+
const ro = new ResizeObserver(update);
|
|
126
|
+
ro.observe(el);
|
|
127
|
+
for (const child of Array.from(el.children)) {
|
|
128
|
+
ro.observe(child);
|
|
129
|
+
}
|
|
130
|
+
const mo = new MutationObserver(() => {
|
|
131
|
+
for (const child of Array.from(el.children)) {
|
|
132
|
+
ro.observe(child);
|
|
133
|
+
}
|
|
134
|
+
update();
|
|
135
|
+
});
|
|
136
|
+
mo.observe(el, { childList: true });
|
|
137
|
+
return () => {
|
|
138
|
+
el.removeEventListener("scroll", update);
|
|
139
|
+
ro.disconnect();
|
|
140
|
+
mo.disconnect();
|
|
141
|
+
};
|
|
142
|
+
}, []);
|
|
143
|
+
return (_jsxs(ScrollAreaRoot, { ...rest, children: [_jsx(ScrollAreaInner, { ref: innerRef, "data-scroll-area-inner": "", children: children }), _jsx(ScrollOverflowGlow, { "$position": "top", "$visible": overflow.top }), _jsx(ScrollOverflowGlow, { "$position": "bottom", "$visible": overflow.bottom })] }));
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=Panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Panel.js","sourceRoot":"","sources":["../src/Panel.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export interface ProgressBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
3
|
+
/** Current value, 0–100. Clamped into range before rendering. */
|
|
4
|
+
value: number;
|
|
5
|
+
/** Accessible label for screen readers (e.g. "Biome coverage — Kerbin"). */
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Thin track+fill progress indicator. Extracted from the Scanning widget's
|
|
10
|
+
* coverage bar (`CoverageBar`/`CoverageFill`) — the same shape covers the
|
|
11
|
+
* ContractManager altitude-envelope bar. Renders as a native
|
|
12
|
+
* `role="progressbar"` so screen readers announce the percentage.
|
|
13
|
+
*/
|
|
14
|
+
export declare function ProgressBar({ value, ariaLabel, ...rest }: Readonly<ProgressBarProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=ProgressBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../src/ProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACR,EAAE,QAAQ,CAAC,gBAAgB,CAAC,2CAgB5B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
/**
|
|
4
|
+
* Thin track+fill progress indicator. Extracted from the Scanning widget's
|
|
5
|
+
* coverage bar (`CoverageBar`/`CoverageFill`) — the same shape covers the
|
|
6
|
+
* ContractManager altitude-envelope bar. Renders as a native
|
|
7
|
+
* `role="progressbar"` so screen readers announce the percentage.
|
|
8
|
+
*/
|
|
9
|
+
export function ProgressBar({ value, ariaLabel, ...rest }) {
|
|
10
|
+
const clamped = Number.isFinite(value)
|
|
11
|
+
? Math.max(0, Math.min(100, value))
|
|
12
|
+
: 0;
|
|
13
|
+
return (_jsx(ProgressBar__Track, { role: "progressbar", "aria-label": ariaLabel, "aria-valuenow": clamped, "aria-valuemin": 0, "aria-valuemax": 100, ...rest, children: _jsx(ProgressBar__Fill, { "$percent": clamped }) }));
|
|
14
|
+
}
|
|
15
|
+
const ProgressBar__Track = styled.div `
|
|
16
|
+
height: 6px;
|
|
17
|
+
background: var(--color-surface-raised);
|
|
18
|
+
border-radius: 3px;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
`;
|
|
21
|
+
const ProgressBar__Fill = styled.div `
|
|
22
|
+
height: 100%;
|
|
23
|
+
width: ${({ $percent }) => `${$percent}%`};
|
|
24
|
+
background: var(--color-accent-fg);
|
|
25
|
+
transition: width 250ms linear;
|
|
26
|
+
|
|
27
|
+
@media (prefers-reduced-motion: reduce) {
|
|
28
|
+
transition: none;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../src/ProgressBar.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAUvC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACoB;IAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QACpC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC,CAAC;IACN,OAAO,CACL,KAAC,kBAAkB,IACjB,IAAI,EAAC,aAAa,gBACN,SAAS,mBACN,OAAO,mBACP,CAAC,mBACD,GAAG,KACd,IAAI,YAER,KAAC,iBAAiB,gBAAW,OAAO,GAAI,GACrB,CACtB,CAAC;AACJ,CAAC;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKpC,CAAC;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAsB;;WAE/C,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,GAAG,QAAQ,GAAG;;;;;;;CAO1C,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type ReadoutTone = "default" | "go" | "warning" | "alert";
|
|
2
|
+
/**
|
|
3
|
+
* Big centred readout — typical "tiny mode" hero element. Fills the remaining
|
|
4
|
+
* panel space and centres a single dominant value (e.g. ΔV, time-to-impact,
|
|
5
|
+
* warp rate). Use `$tone` to colour-code the readout for state-driven widgets.
|
|
6
|
+
*
|
|
7
|
+
* Pair with `<ReadoutCaption>` underneath for an optional sub-label.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BigReadout: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tone"> & {
|
|
10
|
+
$tone?: ReadoutTone;
|
|
11
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tone"> & {
|
|
12
|
+
$tone?: ReadoutTone;
|
|
13
|
+
}, never>>> & string;
|
|
14
|
+
/**
|
|
15
|
+
* Smaller-scale variant for "small" responsive modes — same hero treatment
|
|
16
|
+
* but at a compact size. Doesn't fill — sits alongside other content.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Readout: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tone"> & {
|
|
19
|
+
$tone?: ReadoutTone;
|
|
20
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tone"> & {
|
|
21
|
+
$tone?: ReadoutTone;
|
|
22
|
+
}, never>>> & string;
|
|
23
|
+
/** Muted secondary line for both readout sizes (e.g. units, mode tag). */
|
|
24
|
+
export declare const ReadoutCaption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
25
|
+
/**
|
|
26
|
+
* Status pill — single-token badge ("NOMINAL", "GO", "ABORT"). Designed for
|
|
27
|
+
* tiny-mode widgets that boil their state down to one indicator (thermal
|
|
28
|
+
* band, ground-survey grade, gonogo state).
|
|
29
|
+
*/
|
|
30
|
+
export declare const StatusPill: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tone"> & {
|
|
31
|
+
$tone: ReadoutTone;
|
|
32
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$tone"> & {
|
|
33
|
+
$tone: ReadoutTone;
|
|
34
|
+
}, never>>> & string;
|
|
35
|
+
//# sourceMappingURL=Readout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Readout.d.ts","sourceRoot":"","sources":["../src/Readout.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;AAejE;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;YAAwB,WAAW;;YAAX,WAAW;oBAczD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO;YAAwB,WAAW;;YAAX,WAAW;oBAQtD,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,cAAc,2VAM1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU;WAAuB,WAAW;;WAAX,WAAW;oBAoDxD,CAAC"}
|
package/dist/Readout.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
const toneColor = (tone) => {
|
|
3
|
+
switch (tone) {
|
|
4
|
+
case "alert":
|
|
5
|
+
return "var(--color-status-nogo-fg)";
|
|
6
|
+
case "warning":
|
|
7
|
+
return "var(--color-status-warning-bg)";
|
|
8
|
+
case "go":
|
|
9
|
+
return "var(--color-status-go-fg)";
|
|
10
|
+
default:
|
|
11
|
+
return "var(--color-text-primary)";
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Big centred readout — typical "tiny mode" hero element. Fills the remaining
|
|
16
|
+
* panel space and centres a single dominant value (e.g. ΔV, time-to-impact,
|
|
17
|
+
* warp rate). Use `$tone` to colour-code the readout for state-driven widgets.
|
|
18
|
+
*
|
|
19
|
+
* Pair with `<ReadoutCaption>` underneath for an optional sub-label.
|
|
20
|
+
*/
|
|
21
|
+
export const BigReadout = styled.div `
|
|
22
|
+
flex: 1;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
gap: 4px;
|
|
28
|
+
text-align: center;
|
|
29
|
+
font-size: clamp(20px, 6vw, 38px);
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
letter-spacing: 0.04em;
|
|
32
|
+
line-height: 1.05;
|
|
33
|
+
color: ${({ $tone }) => toneColor($tone)};
|
|
34
|
+
min-width: 0;
|
|
35
|
+
`;
|
|
36
|
+
/**
|
|
37
|
+
* Smaller-scale variant for "small" responsive modes — same hero treatment
|
|
38
|
+
* but at a compact size. Doesn't fill — sits alongside other content.
|
|
39
|
+
*/
|
|
40
|
+
export const Readout = styled.div `
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: baseline;
|
|
43
|
+
gap: 6px;
|
|
44
|
+
font-size: 22px;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
letter-spacing: 0.04em;
|
|
47
|
+
color: ${({ $tone }) => toneColor($tone)};
|
|
48
|
+
`;
|
|
49
|
+
/** Muted secondary line for both readout sizes (e.g. units, mode tag). */
|
|
50
|
+
export const ReadoutCaption = styled.span `
|
|
51
|
+
font-size: 11px;
|
|
52
|
+
font-weight: 400;
|
|
53
|
+
letter-spacing: 0.05em;
|
|
54
|
+
color: var(--color-text-muted);
|
|
55
|
+
text-transform: uppercase;
|
|
56
|
+
`;
|
|
57
|
+
/**
|
|
58
|
+
* Status pill — single-token badge ("NOMINAL", "GO", "ABORT"). Designed for
|
|
59
|
+
* tiny-mode widgets that boil their state down to one indicator (thermal
|
|
60
|
+
* band, ground-survey grade, gonogo state).
|
|
61
|
+
*/
|
|
62
|
+
export const StatusPill = styled.div `
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
padding: 6px 14px;
|
|
67
|
+
border-radius: 999px;
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
letter-spacing: 0.12em;
|
|
71
|
+
text-transform: uppercase;
|
|
72
|
+
color: ${({ $tone }) => toneColor($tone)};
|
|
73
|
+
background: ${({ $tone }) => {
|
|
74
|
+
switch ($tone) {
|
|
75
|
+
case "alert":
|
|
76
|
+
return "var(--color-status-alert-muted)";
|
|
77
|
+
case "warning":
|
|
78
|
+
return "var(--color-tag-dark-brown-bg)";
|
|
79
|
+
case "go":
|
|
80
|
+
return "var(--color-surface-raised)";
|
|
81
|
+
default:
|
|
82
|
+
return "var(--color-surface-raised)";
|
|
83
|
+
}
|
|
84
|
+
}};
|
|
85
|
+
border: 1px solid
|
|
86
|
+
${({ $tone }) => {
|
|
87
|
+
switch ($tone) {
|
|
88
|
+
case "alert":
|
|
89
|
+
return "var(--color-status-nogo-bg)";
|
|
90
|
+
case "warning":
|
|
91
|
+
return "var(--color-status-warning-bg)";
|
|
92
|
+
case "go":
|
|
93
|
+
return "var(--color-status-go-bg)";
|
|
94
|
+
default:
|
|
95
|
+
return "var(--color-border-subtle)";
|
|
96
|
+
}
|
|
97
|
+
}};
|
|
98
|
+
${({ $tone }) => $tone === "alert" &&
|
|
99
|
+
css `
|
|
100
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
101
|
+
animation: pill-pulse 1.4s ease-in-out infinite;
|
|
102
|
+
}
|
|
103
|
+
@keyframes pill-pulse {
|
|
104
|
+
0%,
|
|
105
|
+
100% {
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}
|
|
108
|
+
50% {
|
|
109
|
+
opacity: 0.7;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
`}
|
|
113
|
+
`;
|
|
114
|
+
//# sourceMappingURL=Readout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Readout.js","sourceRoot":"","sources":["../src/Readout.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,SAAS,GAAG,CAAC,IAA6B,EAAE,EAAE;IAClD,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,6BAA6B,CAAC;QACvC,KAAK,SAAS;YACZ,OAAO,gCAAgC,CAAC;QAC1C,KAAK,IAAI;YACP,OAAO,2BAA2B,CAAC;QACrC;YACE,OAAO,2BAA2B,CAAC;IACvC,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAyB;;;;;;;;;;;;WAYlD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;;CAEzC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAyB;;;;;;;WAO/C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;CACzC,CAAC;AAEF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;CAMxC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAwB;;;;;;;;;;WAUjD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC;gBAC1B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1B,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,iCAAiC,CAAC;QAC3C,KAAK,SAAS;YACZ,OAAO,gCAAgC,CAAC;QAC1C,KAAK,IAAI;YACP,OAAO,6BAA6B,CAAC;QACvC;YACE,OAAO,6BAA6B,CAAC;IACzC,CAAC;AACH,CAAC;;MAEG,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACd,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,6BAA6B,CAAC;QACvC,KAAK,SAAS;YACZ,OAAO,gCAAgC,CAAC;QAC1C,KAAK,IAAI;YACP,OAAO,2BAA2B,CAAC;QACrC;YACE,OAAO,4BAA4B,CAAC;IACxC,CAAC;AACH,CAAC;IACD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CACd,KAAK,KAAK,OAAO;IACjB,GAAG,CAAA;;;;;;;;;;;;;KAaF;CACJ,CAAC"}
|
package/dist/Row.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ElementType, HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface RowProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Rendered tag. Defaults to `li` (a `Row` typically sits in a plain `<ul>`). */
|
|
4
|
+
as?: ElementType;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A single spaced-between list row: name on the left, badges/actions on the
|
|
9
|
+
* right. Extracted from ScienceOfficer's `Row` (`styled.li`) — the shape
|
|
10
|
+
* hand-rolled ten times across the built-in widgets.
|
|
11
|
+
*
|
|
12
|
+
* The truncating name child is exported alongside as `RowName` (also
|
|
13
|
+
* reachable as `Row.Name`).
|
|
14
|
+
*/
|
|
15
|
+
declare function RowBase({ as, children, ...rest }: RowProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
/** Truncating name/label child for a `Row` — flexes to fill, ellipsises overflow. */
|
|
17
|
+
export declare const RowName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
18
|
+
export declare const Row: typeof RowBase & {
|
|
19
|
+
Name: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=Row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../src/Row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC3D,iFAAiF;IACjF,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,iBAAS,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,2CAMnD;AAWD,qFAAqF;AACrF,eAAO,MAAM,OAAO,2TAOnB,CAAC;AAEF,eAAO,MAAM,GAAG;;CAA4C,CAAC"}
|
package/dist/Row.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
/**
|
|
4
|
+
* A single spaced-between list row: name on the left, badges/actions on the
|
|
5
|
+
* right. Extracted from ScienceOfficer's `Row` (`styled.li`) — the shape
|
|
6
|
+
* hand-rolled ten times across the built-in widgets.
|
|
7
|
+
*
|
|
8
|
+
* The truncating name child is exported alongside as `RowName` (also
|
|
9
|
+
* reachable as `Row.Name`).
|
|
10
|
+
*/
|
|
11
|
+
function RowBase({ as, children, ...rest }) {
|
|
12
|
+
return (_jsx(Row__Root, { as: as ?? "li", ...rest, children: children }));
|
|
13
|
+
}
|
|
14
|
+
const Row__Root = styled.li `
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 8px;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
padding: 2px 0;
|
|
21
|
+
`;
|
|
22
|
+
/** Truncating name/label child for a `Row` — flexes to fill, ellipsises overflow. */
|
|
23
|
+
export const RowName = styled.span `
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
text-overflow: ellipsis;
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
flex: 1;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
color: var(--color-text-primary);
|
|
30
|
+
`;
|
|
31
|
+
export const Row = Object.assign(RowBase, { Name: RowName });
|
|
32
|
+
//# sourceMappingURL=Row.js.map
|
package/dist/Row.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../src/Row.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAQvC;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAY;IAClD,OAAO,CACL,KAAC,SAAS,IAAC,EAAE,EAAE,EAAE,IAAI,IAAI,KAAM,IAAI,YAChC,QAAQ,GACC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAA;;;;;;;CAO1B,CAAC;AAEF,qFAAqF;AACrF,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAA;;;;;;;CAOjC,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface SectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A named group of rows within a panel — `Stack` pinned to the tightest gap.
|
|
7
|
+
* Extracted from ScienceOfficer's `Group` (`flex-direction:column;gap:2px`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function Section({ children, ...rest }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Uppercase, tracked-out label for a `Section`. Extracted from
|
|
12
|
+
* ScienceOfficer's `GroupLabel`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SectionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
15
|
+
//# sourceMappingURL=Section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../src/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAClE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,YAAY,2CAM1D;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,uTAKxB,CAAC"}
|
package/dist/Section.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { Stack } from "./Stack";
|
|
4
|
+
/**
|
|
5
|
+
* A named group of rows within a panel — `Stack` pinned to the tightest gap.
|
|
6
|
+
* Extracted from ScienceOfficer's `Group` (`flex-direction:column;gap:2px`).
|
|
7
|
+
*/
|
|
8
|
+
export function Section({ children, ...rest }) {
|
|
9
|
+
return (_jsx(Stack, { gap: "xs", ...rest, children: children }));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Uppercase, tracked-out label for a `Section`. Extracted from
|
|
13
|
+
* ScienceOfficer's `GroupLabel`.
|
|
14
|
+
*/
|
|
15
|
+
export const SectionTitle = styled.div `
|
|
16
|
+
font-size: var(--font-size-xs);
|
|
17
|
+
letter-spacing: 0.1em;
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
color: var(--color-text-muted);
|
|
20
|
+
`;
|
|
21
|
+
//# sourceMappingURL=Section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../src/Section.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMhC;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAgB;IACzD,OAAO,CACL,KAAC,KAAK,IAAC,GAAG,EAAC,IAAI,KAAK,IAAI,YACrB,QAAQ,GACH,CACT,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAKrC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Small inline pending indicator. Sized to slot next to a row label /
|
|
3
|
+
* value without reflowing layout. Honours `prefers-reduced-motion` —
|
|
4
|
+
* the spin animation is gated on the no-preference query so users with
|
|
5
|
+
* vestibular sensitivity see a static ring instead.
|
|
6
|
+
*/
|
|
7
|
+
export interface SpinnerProps {
|
|
8
|
+
/** Outer diameter in pixels. Defaults to 12. */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** Stroke width in pixels. Defaults to 2. */
|
|
11
|
+
thickness?: number;
|
|
12
|
+
/** Active arc colour. Defaults to the accent foreground. */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** ARIA label for screen readers. */
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Spinner({ size, thickness, color, ariaLabel, }: Readonly<SpinnerProps>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../src/Spinner.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,OAAO,CAAC,EACtB,IAAS,EACT,SAAa,EACb,KAAgC,EAChC,SAAqB,GACtB,EAAE,QAAQ,CAAC,YAAY,CAAC,2CAUxB"}
|
package/dist/Spinner.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled, { keyframes } from "styled-components";
|
|
3
|
+
export function Spinner({ size = 12, thickness = 2, color = "var(--color-accent-fg)", ariaLabel = "Loading", }) {
|
|
4
|
+
return (_jsx(SpinnerEl, { role: "status", "aria-label": ariaLabel, "$size": size, "$thickness": thickness, "$color": color }));
|
|
5
|
+
}
|
|
6
|
+
const spin = keyframes `
|
|
7
|
+
to { transform: rotate(360deg); }
|
|
8
|
+
`;
|
|
9
|
+
const SpinnerEl = styled.span `
|
|
10
|
+
display: inline-block;
|
|
11
|
+
width: ${({ $size }) => `${$size}px`};
|
|
12
|
+
height: ${({ $size }) => `${$size}px`};
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
border: ${({ $thickness }) => `${$thickness}px`} solid
|
|
15
|
+
var(--color-border-subtle);
|
|
16
|
+
border-top-color: ${({ $color }) => $color};
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
19
|
+
animation: ${spin} 700ms linear infinite;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
//# sourceMappingURL=Spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../src/Spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAmBtD,MAAM,UAAU,OAAO,CAAC,EACtB,IAAI,GAAG,EAAE,EACT,SAAS,GAAG,CAAC,EACb,KAAK,GAAG,wBAAwB,EAChC,SAAS,GAAG,SAAS,GACE;IACvB,OAAO,CACL,KAAC,SAAS,IACR,IAAI,EAAC,QAAQ,gBACD,SAAS,WACd,IAAI,gBACC,SAAS,YACb,KAAK,GACb,CACH,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,GAAG,SAAS,CAAA;;CAErB,CAAC;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAI3B;;WAES,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI;YAC1B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI;;YAE3B,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,GAAG,UAAU,IAAI;;sBAE3B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM;;;iBAG3B,IAAI;;CAEpB,CAAC"}
|
package/dist/Stack.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type SpaceToken = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
|
+
export interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Gap between children, snapped to the space scale. Defaults to `sm`. */
|
|
5
|
+
gap?: SpaceToken;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Vertical flex list — the most common container shape in the dashboard.
|
|
10
|
+
* Replaces the many ad-hoc `styled.div\`flex-direction:column;gap:…\`` blocks
|
|
11
|
+
* scattered across widgets (e.g. ScienceOfficer's `Group`/`InstrumentList`/
|
|
12
|
+
* `LabList`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function Stack({ gap, children, ...rest }: StackProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=Stack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../src/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1D,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,0EAA0E;IAC1E,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EAAE,GAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,UAAU,2CAMlE"}
|
package/dist/Stack.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
/**
|
|
4
|
+
* Vertical flex list — the most common container shape in the dashboard.
|
|
5
|
+
* Replaces the many ad-hoc `styled.div\`flex-direction:column;gap:…\`` blocks
|
|
6
|
+
* scattered across widgets (e.g. ScienceOfficer's `Group`/`InstrumentList`/
|
|
7
|
+
* `LabList`).
|
|
8
|
+
*/
|
|
9
|
+
export function Stack({ gap = "sm", children, ...rest }) {
|
|
10
|
+
return (_jsx(Stack__Root, { "$gap": gap, ...rest, children: children }));
|
|
11
|
+
}
|
|
12
|
+
const Stack__Root = styled.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: ${({ theme, $gap }) => theme.space[$gap]};
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=Stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../src/Stack.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAUvC;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAc;IACjE,OAAO,CACL,KAAC,WAAW,YAAO,GAAG,KAAM,IAAI,YAC7B,QAAQ,GACG,CACf,CAAC;AACJ,CAAC;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAsB;;;SAG3C,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;CAC9C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type StatusTone = "neutral" | "info" | "go" | "warn" | "nogo";
|
|
3
|
+
export interface StatusIndicatorProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
4
|
+
tone: StatusTone;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* When true, the indicator becomes a screen-reader live region.
|
|
8
|
+
* Use for state that updates dynamically and the user benefits from
|
|
9
|
+
* being told (connection going from probing → ok / fail). Default
|
|
10
|
+
* false to keep it out of the accessibility tree for purely decorative
|
|
11
|
+
* uses.
|
|
12
|
+
*/
|
|
13
|
+
live?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Coloured dot + one-line status text. Tone maps to the same palette
|
|
17
|
+
* as `Badge` but the layout is different: dot on the left, free-form
|
|
18
|
+
* label on the right, optional live-region semantics. Use for
|
|
19
|
+
* "connection status," "TURN reachability," "data source health"
|
|
20
|
+
* surfaces — anywhere a single sentence describes a state and a glance
|
|
21
|
+
* at the dot tells you whether to worry.
|
|
22
|
+
*
|
|
23
|
+
* Sister primitive: `Badge`. Use `Badge` for compact uppercase pills,
|
|
24
|
+
* `StatusIndicator` for sentence-length state with a leading dot.
|
|
25
|
+
*/
|
|
26
|
+
export declare function StatusIndicator({ tone, children, live, ...rest }: StatusIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=StatusIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusIndicator.d.ts","sourceRoot":"","sources":["../src/StatusIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAErE,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,EACR,IAAY,EACZ,GAAG,IAAI,EACR,EAAE,oBAAoB,2CAUtB"}
|