@ksp-gonogo/ui-kit 1.0.0-rc.47 → 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.
@@ -2014,11 +2014,251 @@ import {
2014
2014
  useState as useState3
2015
2015
  } from "react";
2016
2016
  import styled4 from "styled-components";
2017
- import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
2018
- var FitLabelButton = forwardRef2(function FitLabelButton2({ label, icon, type, ...rest }, ref) {
2019
- return /* @__PURE__ */ jsx7("button", { ref, type: type ?? "button", "aria-label": label, ...rest, children: /* @__PURE__ */ jsx7(FitLabel, { label, icon }) });
2017
+
2018
+ // src/CommandButton/commandInput.tsx
2019
+ import {
2020
+ bindCommand as bindCommand2
2021
+ } from "@ksp-gonogo/sitrep-sdk";
2022
+
2023
+ // src/CommandDelay/railAnnouncer.ts
2024
+ import { useSyncExternalStore as useSyncExternalStore2 } from "react";
2025
+ var claims = /* @__PURE__ */ new WeakMap();
2026
+ var listeners = /* @__PURE__ */ new WeakMap();
2027
+ function notify(store) {
2028
+ for (const listener of listeners.get(store) ?? []) listener();
2029
+ }
2030
+ function claimRailAnnouncer(store) {
2031
+ claims.set(store, (claims.get(store) ?? 0) + 1);
2032
+ notify(store);
2033
+ return () => {
2034
+ claims.set(store, (claims.get(store) ?? 1) - 1);
2035
+ notify(store);
2036
+ };
2037
+ }
2038
+ function useRailAnnounces() {
2039
+ const store = useDelayRailStore();
2040
+ return useSyncExternalStore2(
2041
+ (onChange) => {
2042
+ if (!store) return () => {
2043
+ };
2044
+ const set = listeners.get(store) ?? /* @__PURE__ */ new Set();
2045
+ listeners.set(store, set);
2046
+ set.add(onChange);
2047
+ return () => set.delete(onChange);
2048
+ },
2049
+ () => store !== null && (claims.get(store) ?? 0) > 0,
2050
+ () => false
2051
+ );
2052
+ }
2053
+
2054
+ // src/CommandButton/commandInput.tsx
2055
+ function useCommandInput({
2056
+ command,
2057
+ unavailable,
2058
+ advise
2059
+ }) {
2060
+ const control = useCommandControl({
2061
+ command: {
2062
+ kind: "bound",
2063
+ handle: command.handle,
2064
+ args: void 0,
2065
+ options: command.options
2066
+ },
2067
+ unavailable,
2068
+ advise
2069
+ });
2070
+ const railSpeaks = useRailSpeaks(control);
2071
+ const inert = control.isBlocked || control.isUnavailable || control.isOffline || unavailable != null;
2072
+ return inputState(
2073
+ control,
2074
+ inert,
2075
+ railSpeaks,
2076
+ (value3) => {
2077
+ if (inert) return;
2078
+ const args = command.toArgs(value3);
2079
+ if (args === void 0) return;
2080
+ control.pressWith(
2081
+ bindCommand2(
2082
+ command.handle,
2083
+ args,
2084
+ command.options
2085
+ )
2086
+ );
2087
+ },
2088
+ unavailable ?? null
2089
+ );
2090
+ }
2091
+ function useBoundCommandInput({
2092
+ command,
2093
+ unavailable,
2094
+ advise
2095
+ }) {
2096
+ const control = useCommandControl({ command, unavailable, advise });
2097
+ const railSpeaks = useRailSpeaks(control);
2098
+ const inert = control.isBlocked || control.isUnavailable || control.isOffline || unavailable != null;
2099
+ return inputState(
2100
+ control,
2101
+ inert,
2102
+ railSpeaks,
2103
+ () => {
2104
+ if (inert) return;
2105
+ control.press(false);
2106
+ },
2107
+ unavailable ?? null
2108
+ );
2109
+ }
2110
+ function inputState(control, inert, railSpeaks, send, unavailable) {
2111
+ const handle = control.command.handle;
2112
+ const gated = control.isBlocked && !control.isUnavailable;
2113
+ const word = control.isSent ? SENT_WORD : control.isRefused ? REFUSED_WORD : control.isLost ? LOST_WORD : control.isFound ? FOUND_WORD : null;
2114
+ const sendStatus = handle.sendStatus;
2115
+ const restTip = sendStatus === void 0 ? void 0 : describeSendStatus(sendStatus);
2116
+ const outcome = control.foundText ?? control.refusalText ?? (control.isLost ? control.lossText : null);
2117
+ const tip = outcome ?? (control.isSent ? "Sent, not yet received" : control.isOffline ? STREAM_DOWN_TIP : unavailable ?? ([control.adviceText, restTip].filter(Boolean).join("\n") || void 0));
2118
+ return {
2119
+ control,
2120
+ send,
2121
+ word,
2122
+ tip: tip ?? void 0,
2123
+ inert,
2124
+ edge: {
2125
+ "data-command-edge": gated ? "blocked" : control.isLost || control.isRefused || control.hasUnconfirmed || control.hasFailure ? "warn" : void 0,
2126
+ "data-command-phase": control.phase,
2127
+ "data-stream": control.isOffline ? "down" : void 0,
2128
+ "data-predicted": gated ? void 0 : predictedOutcomeOf(sendStatus) ?? (control.isAdvised ? "at-risk" : void 0),
2129
+ "aria-disabled": inert ? true : void 0
2130
+ },
2131
+ // A mounted rail that carries this command already speaks what became of it.
2132
+ announce: railSpeaks ? null : outcome ?? (control.isSent ? "Sent, not yet received" : null)
2133
+ };
2134
+ }
2135
+ function useRailSpeaks(control) {
2136
+ const mounted = useRailAnnounces();
2137
+ return mounted && control.command.handle.railed === true;
2138
+ }
2139
+
2140
+ // src/commandEdge.ts
2141
+ import { css as css2 } from "styled-components";
2142
+ var commandEdge = css2`
2143
+ &[data-command-edge="warn"] {
2144
+ border-color: var(--color-warn-mark);
2145
+ }
2146
+ &[data-command-edge="blocked"] {
2147
+ border-style: dashed;
2148
+ border-color: var(--color-warn-mark);
2149
+ opacity: 0.5;
2150
+ }
2151
+ &[data-stream="down"] {
2152
+ opacity: 0.5;
2153
+ border-style: dotted;
2154
+ }
2155
+ &[data-predicted="held"] {
2156
+ border-style: dashed;
2157
+ border-color: var(--color-go-mark);
2158
+ }
2159
+ &[data-predicted="at-risk"] {
2160
+ border-style: dashed;
2161
+ border-color: color-mix(
2162
+ in srgb,
2163
+ var(--color-warn-mark) 65%,
2164
+ var(--color-surface-raised)
2165
+ );
2166
+ }
2167
+ &[aria-disabled="true"] {
2168
+ cursor: not-allowed;
2169
+ }
2170
+ `;
2171
+ var commandOutlineEdge = css2`
2172
+ &[data-command-edge="warn"] {
2173
+ outline-width: 1px;
2174
+ outline-style: solid;
2175
+ outline-color: var(--color-warn-mark);
2176
+ outline-offset: -1px;
2177
+ }
2178
+ &[data-command-edge="blocked"] {
2179
+ outline-width: 1px;
2180
+ outline-style: dashed;
2181
+ outline-color: var(--color-warn-mark);
2182
+ outline-offset: -1px;
2183
+ opacity: 0.5;
2184
+ }
2185
+ &[data-stream="down"] {
2186
+ opacity: 0.5;
2187
+ outline-width: 1px;
2188
+ outline-style: dotted;
2189
+ outline-color: currentColor;
2190
+ outline-offset: -1px;
2191
+ }
2192
+ &[data-predicted="held"] {
2193
+ outline-width: 1px;
2194
+ outline-style: dashed;
2195
+ outline-color: var(--color-go-mark);
2196
+ outline-offset: -1px;
2197
+ }
2198
+ &[data-predicted="at-risk"] {
2199
+ outline-width: 1px;
2200
+ outline-style: dashed;
2201
+ outline-color: color-mix(
2202
+ in srgb,
2203
+ var(--color-warn-mark) 65%,
2204
+ var(--color-surface-raised)
2205
+ );
2206
+ outline-offset: -1px;
2207
+ }
2208
+ &[aria-disabled="true"] {
2209
+ cursor: not-allowed;
2210
+ }
2211
+ `;
2212
+
2213
+ // src/FitLabelButton.tsx
2214
+ import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
2215
+ var FitLabelButton = forwardRef2(function FitLabelButton2(props, ref) {
2216
+ if (props.command) {
2217
+ return /* @__PURE__ */ jsx7(CommandedFitLabelButton, { ...props, command: props.command, ref });
2218
+ }
2219
+ const { command: _command, unavailable: _unavailable, ...rest } = props;
2220
+ return /* @__PURE__ */ jsx7(PlainFitLabelButton, { ...rest, ref });
2221
+ });
2222
+ var CommandedFitLabelButton = forwardRef2(function CommandedFitLabelButton2({ command, unavailable, onClick, ...rest }, ref) {
2223
+ const input = useBoundCommandInput({ command, unavailable });
2224
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
2225
+ /* @__PURE__ */ jsx7(Tooltip, { text: input.tip, children: /* @__PURE__ */ jsx7(
2226
+ PlainFitLabelButton,
2227
+ {
2228
+ ...rest,
2229
+ ...input.edge,
2230
+ ref,
2231
+ word: input.word,
2232
+ onClick: (e) => {
2233
+ if (input.inert) return;
2234
+ input.send();
2235
+ onClick?.(e);
2236
+ }
2237
+ }
2238
+ ) }),
2239
+ /* @__PURE__ */ jsx7(LiveRegion, { visuallyHidden: true, children: input.announce })
2240
+ ] });
2020
2241
  });
2021
- function FitLabel({ label, icon }) {
2242
+ var PlainFitLabelButton = forwardRef2(function PlainFitLabelButton2({ label, icon, type, word, ...rest }, ref) {
2243
+ return /* @__PURE__ */ jsx7(
2244
+ FitLabelButton__Root,
2245
+ {
2246
+ ref,
2247
+ type: type ?? "button",
2248
+ "aria-label": label,
2249
+ ...rest,
2250
+ children: /* @__PURE__ */ jsx7(FitLabel, { label, icon, word })
2251
+ }
2252
+ );
2253
+ });
2254
+ var FitLabelButton__Root = styled4.button`
2255
+ ${commandOutlineEdge}
2256
+ `;
2257
+ function FitLabel({
2258
+ label,
2259
+ icon,
2260
+ word
2261
+ }) {
2022
2262
  const contentRef = useRef4(null);
2023
2263
  const ghostRef = useRef4(null);
2024
2264
  const [fits, setFits] = useState3(true);
@@ -2038,7 +2278,8 @@ function FitLabel({ label, icon }) {
2038
2278
  }, []);
2039
2279
  return /* @__PURE__ */ jsxs2(FitLabelButton__Content, { ref: contentRef, children: [
2040
2280
  /* @__PURE__ */ jsx7(FitLabelButton__Ghost, { ref: ghostRef, "aria-hidden": "true", children: label }),
2041
- fits ? /* @__PURE__ */ jsx7(FitLabelButton__Label, { "aria-hidden": "true", children: label }) : /* @__PURE__ */ jsx7(FitLabelButton__Icon, { "aria-hidden": "true", "data-fit-label-icon": "", children: icon })
2281
+ fits ? /* @__PURE__ */ jsx7(FitLabelButton__Label, { "aria-hidden": "true", $hidden: !!word, children: label }) : /* @__PURE__ */ jsx7(FitLabelButton__Icon, { "aria-hidden": "true", "data-fit-label-icon": "", children: icon }),
2282
+ fits && word ? /* @__PURE__ */ jsx7(FitLabelButton__Word, { "aria-hidden": "true", children: word }) : null
2042
2283
  ] });
2043
2284
  }
2044
2285
  var FitLabelButton__Content = styled4.span`
@@ -2061,6 +2302,18 @@ var FitLabelButton__Ghost = styled4.span`
2061
2302
  var FitLabelButton__Label = styled4.span`
2062
2303
  /* nowrap, so a label that does not fit overflows and the measurement stays honest. */
2063
2304
  white-space: nowrap;
2305
+ ${({ $hidden }) => $hidden ? "visibility: hidden;" : ""}
2306
+ `;
2307
+ var FitLabelButton__Word = styled4.span`
2308
+ position: absolute;
2309
+ inset: 0;
2310
+ display: flex;
2311
+ align-items: center;
2312
+ justify-content: center;
2313
+ white-space: nowrap;
2314
+ pointer-events: none;
2315
+ font-size: var(--font-size-caption);
2316
+ letter-spacing: 0.08em;
2064
2317
  `;
2065
2318
  var FitLabelButton__Icon = styled4.span`
2066
2319
  display: inline-flex;
@@ -2847,18 +3100,18 @@ var RECKONING_MARK = {
2847
3100
  };
2848
3101
 
2849
3102
  // src/HeldMark.tsx
2850
- import styled5, { css as css2 } from "styled-components";
3103
+ import styled5, { css as css3 } from "styled-components";
2851
3104
  import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
2852
3105
  var MARK_SIZE = RECKONING_MARK.held.domSize;
2853
3106
  var MODELLED_MARK_SIZE = RECKONING_MARK.modelled.domSize;
2854
- var reservesHeldMark = css2`
3107
+ var reservesHeldMark = css3`
2855
3108
  &::after {
2856
3109
  content: "";
2857
3110
  display: inline-block;
2858
3111
  width: calc(${MARK_SIZE} + 0.14em);
2859
3112
  }
2860
3113
  `;
2861
- var reservesModelledTriangle = css2`
3114
+ var reservesModelledTriangle = css3`
2862
3115
  &::after {
2863
3116
  content: "";
2864
3117
  display: inline-block;
@@ -2866,7 +3119,7 @@ var reservesModelledTriangle = css2`
2866
3119
  }
2867
3120
  `;
2868
3121
  function reservesHollow(kind) {
2869
- return css2`
3122
+ return css3`
2870
3123
  &::after {
2871
3124
  content: "";
2872
3125
  display: inline-block;
@@ -2896,7 +3149,7 @@ var ModelledTriangle = styled5.span`
2896
3149
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
2897
3150
  background: ${RECKONING_MARK.modelled.color};
2898
3151
  `;
2899
- var hollowBox = (kind) => css2`
3152
+ var hollowBox = (kind) => css3`
2900
3153
  position: absolute;
2901
3154
  right: 0;
2902
3155
  top: 0;
@@ -3002,17 +3255,17 @@ import { forwardRef as forwardRef7 } from "react";
3002
3255
  import styled10 from "styled-components";
3003
3256
 
3004
3257
  // src/ButtonBody.tsx
3005
- import styled7, { css as css4 } from "styled-components";
3258
+ import styled7, { css as css5 } from "styled-components";
3006
3259
 
3007
3260
  // src/focusRing.ts
3008
- import { css as css3 } from "styled-components";
3009
- var focusRing = css3`
3261
+ import { css as css4 } from "styled-components";
3262
+ var focusRing = css4`
3010
3263
  &:focus-visible {
3011
3264
  outline: 2px solid var(--color-focus);
3012
3265
  outline-offset: 2px;
3013
3266
  }
3014
3267
  `;
3015
- var focusRingInset = css3`
3268
+ var focusRingInset = css4`
3016
3269
  &:focus-visible {
3017
3270
  outline: 2px solid var(--color-focus);
3018
3271
  outline-offset: -2px;
@@ -3023,29 +3276,29 @@ var focusRingInset = css3`
3023
3276
  function pressedTone(tone) {
3024
3277
  return tone === "neutral" ? "go" : tone;
3025
3278
  }
3026
- var filledLook = (tone) => css4`
3279
+ var filledLook = (tone) => css5`
3027
3280
  background: ${TONE_STATUS[tone]};
3028
3281
  border-color: ${TONE_STATUS[tone]};
3029
3282
  color: ${TONE_ON_STATUS[tone]};
3030
3283
  `;
3031
- var tonedOutline = (tone) => css4`
3284
+ var tonedOutline = (tone) => css5`
3032
3285
  border-color: ${TONE_MARK[tone]};
3033
3286
  color: ${TONE_TEXT[tone]};
3034
3287
  `;
3035
3288
  var VARIANT_LOOK = {
3036
- default: css4`
3289
+ default: css5`
3037
3290
  background: var(--color-surface-raised);
3038
3291
  border-color: var(--color-border-strong);
3039
3292
  color: var(--color-text-primary);
3040
3293
  `,
3041
- ghost: css4`
3294
+ ghost: css5`
3042
3295
  background: none;
3043
3296
  border-color: var(--color-border-strong);
3044
3297
  /* Clears 4.5:1 on the app background. */
3045
3298
  color: var(--color-text-muted);
3046
3299
  `
3047
3300
  };
3048
- var TEXT_LOOK = css4`
3301
+ var TEXT_LOOK = css5`
3049
3302
  background: none;
3050
3303
  border: none;
3051
3304
  padding: 0;
@@ -3062,7 +3315,7 @@ var TEXT_LOOK = css4`
3062
3315
  }
3063
3316
  }
3064
3317
  `;
3065
- var TEXT_TOUCH = css4`
3318
+ var TEXT_TOUCH = css5`
3066
3319
  @media (pointer: coarse) {
3067
3320
  padding: 0;
3068
3321
  }
@@ -3071,12 +3324,12 @@ function variantLook(variant, tone) {
3071
3324
  if (variant === "text") return TEXT_LOOK;
3072
3325
  if (variant === "primary") return filledLook(tone);
3073
3326
  if (tone === "neutral") return VARIANT_LOOK[variant];
3074
- return css4`
3327
+ return css5`
3075
3328
  ${VARIANT_LOOK[variant]}
3076
3329
  ${tonedOutline(tone)}
3077
3330
  `;
3078
3331
  }
3079
- var OUTLINE_HOVER = css4`
3332
+ var OUTLINE_HOVER = css5`
3080
3333
  @media (hover: hover) {
3081
3334
  &:hover:not(:disabled):not([aria-disabled="true"]) {
3082
3335
  border-color: var(--color-text-faint);
@@ -3085,11 +3338,11 @@ var OUTLINE_HOVER = css4`
3085
3338
  }
3086
3339
  `;
3087
3340
  var SIZE_LOOK = {
3088
- sm: css4`
3341
+ sm: css5`
3089
3342
  font-size: var(--font-size-caption);
3090
3343
  padding: var(--inset-control-small);
3091
3344
  `,
3092
- md: css4`
3345
+ md: css5`
3093
3346
  font-size: var(--font-size-compact);
3094
3347
  padding: var(--inset-control);
3095
3348
  `
@@ -3298,41 +3551,10 @@ function withButtonTip(body, tip, announce) {
3298
3551
  // src/CommandButton/CommandedButton.tsx
3299
3552
  import {
3300
3553
  argsOf as argsOf2,
3301
- bindCommand as bindCommand2
3554
+ bindCommand as bindCommand3
3302
3555
  } from "@ksp-gonogo/sitrep-sdk";
3303
3556
  import { useEffect as useEffect3 } from "react";
3304
- import styled9, { css as css5, keyframes } from "styled-components";
3305
-
3306
- // src/CommandDelay/railAnnouncer.ts
3307
- import { useSyncExternalStore as useSyncExternalStore2 } from "react";
3308
- var claims = /* @__PURE__ */ new WeakMap();
3309
- var listeners = /* @__PURE__ */ new WeakMap();
3310
- function notify(store) {
3311
- for (const listener of listeners.get(store) ?? []) listener();
3312
- }
3313
- function claimRailAnnouncer(store) {
3314
- claims.set(store, (claims.get(store) ?? 0) + 1);
3315
- notify(store);
3316
- return () => {
3317
- claims.set(store, (claims.get(store) ?? 1) - 1);
3318
- notify(store);
3319
- };
3320
- }
3321
- function useRailAnnounces() {
3322
- const store = useDelayRailStore();
3323
- return useSyncExternalStore2(
3324
- (onChange) => {
3325
- if (!store) return () => {
3326
- };
3327
- const set = listeners.get(store) ?? /* @__PURE__ */ new Set();
3328
- listeners.set(store, set);
3329
- set.add(onChange);
3330
- return () => set.delete(onChange);
3331
- },
3332
- () => store !== null && (claims.get(store) ?? 0) > 0,
3333
- () => false
3334
- );
3335
- }
3557
+ import styled9, { css as css6, keyframes } from "styled-components";
3336
3558
 
3337
3559
  // src/PlainButton.tsx
3338
3560
  import { forwardRef as forwardRef6 } from "react";
@@ -3396,13 +3618,13 @@ var PlainButton = forwardRef6(
3396
3618
  );
3397
3619
 
3398
3620
  // src/CommandButton/CommandedButton.tsx
3399
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
3621
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
3400
3622
  function isControl(command) {
3401
3623
  return "press" in command && typeof command.press === "function";
3402
3624
  }
3403
3625
  function boundOf(command) {
3404
3626
  if ("kind" in command) return command;
3405
- return bindCommand2(command, void 0);
3627
+ return bindCommand3(command, void 0);
3406
3628
  }
3407
3629
  function CommandedButton(props) {
3408
3630
  const { command, unavailable, advise, ...rest } = props;
@@ -3543,7 +3765,7 @@ function CommandedButtonFace({
3543
3765
  sendStatus === void 0 ? null : describeSendStatus(sendStatus)
3544
3766
  ].filter(Boolean).join("\n");
3545
3767
  const tipText = isOffline ? [tip, STREAM_DOWN_TIP].filter(Boolean).join("\n") : restTip || void 0;
3546
- return /* @__PURE__ */ jsxs5(Fragment2, { children: [
3768
+ return /* @__PURE__ */ jsxs5(Fragment3, { children: [
3547
3769
  /* @__PURE__ */ jsx13(
3548
3770
  Tooltip,
3549
3771
  {
@@ -3609,7 +3831,7 @@ function OwnedCommandedToggle({
3609
3831
  glyph,
3610
3832
  ...rest
3611
3833
  }) {
3612
- const wordOf = (shown) => typeof children === "function" ? children(shown) : typeof children === "string" ? children : "";
3834
+ const wordOf2 = (shown) => typeof children === "function" ? children(shown) : typeof children === "string" ? children : "";
3613
3835
  const control = useCommandControl({
3614
3836
  command: {
3615
3837
  kind: "bound",
@@ -3620,9 +3842,9 @@ function OwnedCommandedToggle({
3620
3842
  toggle: {
3621
3843
  state,
3622
3844
  name: name ?? "",
3623
- word: wordOf,
3845
+ word: wordOf2,
3624
3846
  /* The on and off words only: the word for a state not yet read is a one-off the width is not held for. */
3625
- words: [.../* @__PURE__ */ new Set([wordOf(true), wordOf(false)])],
3847
+ words: [.../* @__PURE__ */ new Set([wordOf2(true), wordOf2(false)])],
3626
3848
  sentWord,
3627
3849
  rows,
3628
3850
  modelled,
@@ -3670,7 +3892,7 @@ function CommandedToggleFace({
3670
3892
  const edge = gated ? "blocked" : warned ? "warn" : void 0;
3671
3893
  const cannotPress = toggleView.unavailable !== null || isBlocked;
3672
3894
  const cannotPressReason = toggleView.unavailable ?? (isBlocked ? refusalText : null);
3673
- return /* @__PURE__ */ jsxs5(Fragment2, { children: [
3895
+ return /* @__PURE__ */ jsxs5(Fragment3, { children: [
3674
3896
  /* @__PURE__ */ jsx13(Tooltip, { text: toggleTip, children: glyph ? /* @__PURE__ */ jsx13(
3675
3897
  IconButton__Body,
3676
3898
  {
@@ -3753,7 +3975,7 @@ var CommandButton__Body = styled9(Button__Body)`
3753
3975
  /* Shrinks below its word so the word can be measured and give way to the icon. */
3754
3976
  ${({ $fit }) => $fit ? "min-width: 0;" : ""}
3755
3977
 
3756
- ${({ $armed }) => $armed && css5`
3978
+ ${({ $armed }) => $armed && css6`
3757
3979
  @media (prefers-reduced-motion: no-preference) {
3758
3980
  animation: ${armedPulse} 1s var(--ease-emphasis) infinite;
3759
3981
  }
@@ -3764,7 +3986,7 @@ var CommandButton__Body = styled9(Button__Body)`
3764
3986
  }
3765
3987
 
3766
3988
  /* Dimmed toward the muted text token rather than faded, so the refusal reason stays readable; the warn border says the game refused. */
3767
- ${({ $blocked }) => $blocked && css5`
3989
+ ${({ $blocked }) => $blocked && css6`
3768
3990
  background: transparent;
3769
3991
  border-style: dashed;
3770
3992
  border-color: var(--color-warn-mark);
@@ -3798,12 +4020,12 @@ var CommandButton__Body = styled9(Button__Body)`
3798
4020
  }
3799
4021
  `;
3800
4022
  var CommandGlyph__Body = styled9(IconButton__Body)`
3801
- ${({ $armed }) => $armed && css5`
4023
+ ${({ $armed }) => $armed && css6`
3802
4024
  @media (prefers-reduced-motion: no-preference) {
3803
4025
  animation: ${armedPulse} 1s var(--ease-emphasis) infinite;
3804
4026
  }
3805
4027
  `}
3806
- ${({ $blocked }) => $blocked && css5`
4028
+ ${({ $blocked }) => $blocked && css6`
3807
4029
  opacity: 0.5;
3808
4030
  cursor: help;
3809
4031
  `}
@@ -3883,170 +4105,6 @@ import {
3883
4105
  useState as useState4
3884
4106
  } from "react";
3885
4107
  import styled11, { css as css8 } from "styled-components";
3886
-
3887
- // src/CommandButton/commandInput.tsx
3888
- import {
3889
- bindCommand as bindCommand3
3890
- } from "@ksp-gonogo/sitrep-sdk";
3891
- function useCommandInput({
3892
- command,
3893
- unavailable,
3894
- advise
3895
- }) {
3896
- const control = useCommandControl({
3897
- command: {
3898
- kind: "bound",
3899
- handle: command.handle,
3900
- args: void 0,
3901
- options: command.options
3902
- },
3903
- unavailable,
3904
- advise
3905
- });
3906
- const railSpeaks = useRailSpeaks(control);
3907
- const inert = control.isBlocked || control.isUnavailable || control.isOffline || unavailable != null;
3908
- return inputState(
3909
- control,
3910
- inert,
3911
- railSpeaks,
3912
- (value3) => {
3913
- if (inert) return;
3914
- const args = command.toArgs(value3);
3915
- if (args === void 0) return;
3916
- control.pressWith(
3917
- bindCommand3(
3918
- command.handle,
3919
- args,
3920
- command.options
3921
- )
3922
- );
3923
- },
3924
- unavailable ?? null
3925
- );
3926
- }
3927
- function useBoundCommandInput({
3928
- command,
3929
- unavailable,
3930
- advise
3931
- }) {
3932
- const control = useCommandControl({ command, unavailable, advise });
3933
- const railSpeaks = useRailSpeaks(control);
3934
- const inert = control.isBlocked || control.isUnavailable || control.isOffline || unavailable != null;
3935
- return inputState(
3936
- control,
3937
- inert,
3938
- railSpeaks,
3939
- () => {
3940
- if (inert) return;
3941
- control.press(false);
3942
- },
3943
- unavailable ?? null
3944
- );
3945
- }
3946
- function inputState(control, inert, railSpeaks, send, unavailable) {
3947
- const handle = control.command.handle;
3948
- const gated = control.isBlocked && !control.isUnavailable;
3949
- const word = control.isSent ? SENT_WORD : control.isRefused ? REFUSED_WORD : control.isLost ? LOST_WORD : control.isFound ? FOUND_WORD : null;
3950
- const sendStatus = handle.sendStatus;
3951
- const restTip = sendStatus === void 0 ? void 0 : describeSendStatus(sendStatus);
3952
- const outcome = control.foundText ?? control.refusalText ?? (control.isLost ? control.lossText : null);
3953
- const tip = outcome ?? (control.isSent ? "Sent, not yet received" : control.isOffline ? STREAM_DOWN_TIP : unavailable ?? ([control.adviceText, restTip].filter(Boolean).join("\n") || void 0));
3954
- return {
3955
- control,
3956
- send,
3957
- word,
3958
- tip: tip ?? void 0,
3959
- inert,
3960
- edge: {
3961
- "data-command-edge": gated ? "blocked" : control.isLost || control.isRefused || control.hasUnconfirmed || control.hasFailure ? "warn" : void 0,
3962
- "data-command-phase": control.phase,
3963
- "data-stream": control.isOffline ? "down" : void 0,
3964
- "data-predicted": gated ? void 0 : predictedOutcomeOf(sendStatus) ?? (control.isAdvised ? "at-risk" : void 0),
3965
- "aria-disabled": inert ? true : void 0
3966
- },
3967
- // A mounted rail that carries this command already speaks what became of it.
3968
- announce: railSpeaks ? null : outcome ?? (control.isSent ? "Sent, not yet received" : null)
3969
- };
3970
- }
3971
- function useRailSpeaks(control) {
3972
- const mounted = useRailAnnounces();
3973
- return mounted && control.command.handle.railed === true;
3974
- }
3975
-
3976
- // src/commandEdge.ts
3977
- import { css as css7 } from "styled-components";
3978
- var commandEdge = css7`
3979
- &[data-command-edge="warn"] {
3980
- border-color: var(--color-warn-mark);
3981
- }
3982
- &[data-command-edge="blocked"] {
3983
- border-style: dashed;
3984
- border-color: var(--color-warn-mark);
3985
- opacity: 0.5;
3986
- }
3987
- &[data-stream="down"] {
3988
- opacity: 0.5;
3989
- border-style: dotted;
3990
- }
3991
- &[data-predicted="held"] {
3992
- border-style: dashed;
3993
- border-color: var(--color-go-mark);
3994
- }
3995
- &[data-predicted="at-risk"] {
3996
- border-style: dashed;
3997
- border-color: color-mix(
3998
- in srgb,
3999
- var(--color-warn-mark) 65%,
4000
- var(--color-surface-raised)
4001
- );
4002
- }
4003
- &[aria-disabled="true"] {
4004
- cursor: not-allowed;
4005
- }
4006
- `;
4007
- var commandOutlineEdge = css7`
4008
- &[data-command-edge="warn"] {
4009
- outline-width: 1px;
4010
- outline-style: solid;
4011
- outline-color: var(--color-warn-mark);
4012
- outline-offset: -1px;
4013
- }
4014
- &[data-command-edge="blocked"] {
4015
- outline-width: 1px;
4016
- outline-style: dashed;
4017
- outline-color: var(--color-warn-mark);
4018
- outline-offset: -1px;
4019
- opacity: 0.5;
4020
- }
4021
- &[data-stream="down"] {
4022
- opacity: 0.5;
4023
- outline-width: 1px;
4024
- outline-style: dotted;
4025
- outline-color: currentColor;
4026
- outline-offset: -1px;
4027
- }
4028
- &[data-predicted="held"] {
4029
- outline-width: 1px;
4030
- outline-style: dashed;
4031
- outline-color: var(--color-go-mark);
4032
- outline-offset: -1px;
4033
- }
4034
- &[data-predicted="at-risk"] {
4035
- outline-width: 1px;
4036
- outline-style: dashed;
4037
- outline-color: color-mix(
4038
- in srgb,
4039
- var(--color-warn-mark) 65%,
4040
- var(--color-surface-raised)
4041
- );
4042
- outline-offset: -1px;
4043
- }
4044
- &[aria-disabled="true"] {
4045
- cursor: not-allowed;
4046
- }
4047
- `;
4048
-
4049
- // src/Form.tsx
4050
4108
  import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
4051
4109
  var ConfigForm = styled11.div`
4052
4110
  display: flex;
@@ -4465,7 +4523,7 @@ function writeLockQuantity(quantity3, unit) {
4465
4523
  }
4466
4524
 
4467
4525
  // src/LockScope.tsx
4468
- import { Fragment as Fragment3, jsx as jsx19 } from "react/jsx-runtime";
4526
+ import { Fragment as Fragment4, jsx as jsx19 } from "react/jsx-runtime";
4469
4527
  function LockScope({
4470
4528
  children,
4471
4529
  fallback
@@ -4477,7 +4535,7 @@ function LockScope({
4477
4535
  locks
4478
4536
  };
4479
4537
  const drawn = fallback === void 0 ? /* @__PURE__ */ jsx19(InactiveNotice, { reason: summary }) : typeof fallback === "function" ? fallback(summary) : fallback;
4480
- return /* @__PURE__ */ jsx19(Fragment3, { children: drawn });
4538
+ return /* @__PURE__ */ jsx19(Fragment4, { children: drawn });
4481
4539
  }
4482
4540
  return /* @__PURE__ */ jsx19(LockScopeContext.Provider, { value: scope, children });
4483
4541
  }
@@ -4541,12 +4599,12 @@ function useWidgetMeta() {
4541
4599
 
4542
4600
  // src/AugmentSlot.tsx
4543
4601
  import { useSyncExternalStore as useSyncExternalStore4 } from "react";
4544
- import { Fragment as Fragment4, jsx as jsx21 } from "react/jsx-runtime";
4602
+ import { Fragment as Fragment5, jsx as jsx21 } from "react/jsx-runtime";
4545
4603
  function AugmentSlot(args) {
4546
4604
  const meta = useWidgetMeta();
4547
4605
  const slotName = args.name ?? (meta ? `${meta.componentId}.${args.segment}` : void 0);
4548
4606
  const augments = useAugmentsFor(slotName);
4549
- return /* @__PURE__ */ jsx21(Fragment4, { children: augments.map((augment) => /* @__PURE__ */ jsx21(
4607
+ return /* @__PURE__ */ jsx21(Fragment5, { children: augments.map((augment) => /* @__PURE__ */ jsx21(
4550
4608
  AugmentEntry,
4551
4609
  {
4552
4610
  augment,
@@ -4831,7 +4889,7 @@ function standsApart(observed, modelled, precision) {
4831
4889
  }
4832
4890
 
4833
4891
  // src/Countdown.tsx
4834
- import { Fragment as Fragment5, jsx as jsx22 } from "react/jsx-runtime";
4892
+ import { Fragment as Fragment6, jsx as jsx22 } from "react/jsx-runtime";
4835
4893
  function Countdown({
4836
4894
  value: value3,
4837
4895
  clock = false,
@@ -4849,7 +4907,7 @@ function Countdown({
4849
4907
  const modelled = modelledBeyondReceived(reading);
4850
4908
  if (reading?.value !== void 0 && modelled !== void 0) {
4851
4909
  if (!standsApart(reading.value, modelled, writtenAs(format2))) {
4852
- return /* @__PURE__ */ jsx22(Fragment5, { children: format2(reading.value) });
4910
+ return /* @__PURE__ */ jsx22(Fragment6, { children: format2(reading.value) });
4853
4911
  }
4854
4912
  return /* @__PURE__ */ jsx22(
4855
4913
  HeldFigure,
@@ -5058,7 +5116,7 @@ function focusBesideDismissed(from) {
5058
5116
  var SETTLE_FADE_MS = 700;
5059
5117
 
5060
5118
  // src/CommandDelay/InFlightList.tsx
5061
- import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
5119
+ import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
5062
5120
  function signalDelayPresentation({
5063
5121
  oneWaySeconds,
5064
5122
  canQueue,
@@ -5087,6 +5145,9 @@ var PHASE_WORD = {
5087
5145
  overdue: "overdue",
5088
5146
  lost: "unconfirmed"
5089
5147
  };
5148
+ function wordOf(item) {
5149
+ return item.waiting ? "waiting for a path" : PHASE_WORD[item.phase];
5150
+ }
5090
5151
  function arrowOf(item) {
5091
5152
  if (item.flow === "inbound" && item.phase === "in-transit") return "\u2193";
5092
5153
  return PHASE_ARROW[item.phase];
@@ -5112,11 +5173,13 @@ function useCountdown(etaSeconds) {
5112
5173
  clockRef.current = clock;
5113
5174
  const [value3, setValue] = useState7(etaSeconds);
5114
5175
  const seedRef = useRef7({ eta: etaSeconds, ut: gameNow(clock) });
5176
+ const drawnRef = useRef7(etaSeconds);
5115
5177
  useEffect7(() => {
5116
5178
  const last = seedRef.current.eta;
5117
5179
  const jumped = last === null !== (etaSeconds === null) || last !== null && etaSeconds !== null && Math.abs(etaSeconds - last) >= RESYNC_THRESHOLD_SECONDS;
5118
5180
  if (jumped) {
5119
5181
  seedRef.current = { eta: etaSeconds, ut: gameNow(clockRef.current) };
5182
+ drawnRef.current = etaSeconds;
5120
5183
  setValue(etaSeconds);
5121
5184
  }
5122
5185
  }, [etaSeconds]);
@@ -5130,7 +5193,14 @@ function useCountdown(etaSeconds) {
5130
5193
  seedRef.current = { eta, ut: now };
5131
5194
  return;
5132
5195
  }
5133
- setValue(Math.max(0, eta - (now - ut)));
5196
+ if (now < ut) {
5197
+ const left2 = drawnRef.current ?? eta;
5198
+ seedRef.current = { eta: left2, ut: now };
5199
+ return;
5200
+ }
5201
+ const left = Math.max(0, eta - (now - ut));
5202
+ drawnRef.current = left;
5203
+ setValue(left);
5134
5204
  }, 1e3);
5135
5205
  return () => clearInterval(id);
5136
5206
  }, []);
@@ -5259,7 +5329,7 @@ var InFlightBadge = function InFlightBadge2({
5259
5329
  /* @__PURE__ */ jsx23(InFlightList__Arrow, { "aria-hidden": "true", $pulse: !worst, children: "\u2191" }),
5260
5330
  /* @__PURE__ */ jsxs9(InFlightList__Phase, { children: [
5261
5331
  items.length,
5262
- countdown !== null && /* @__PURE__ */ jsxs9(Fragment6, { children: [
5332
+ countdown !== null && /* @__PURE__ */ jsxs9(Fragment7, { children: [
5263
5333
  " \xB7 ",
5264
5334
  /* @__PURE__ */ jsx23(Countdown, { value: Math.max(0, countdown) })
5265
5335
  ] })
@@ -5274,7 +5344,7 @@ function InFlightRow({
5274
5344
  }) {
5275
5345
  const countdown = useCountdown(item.etaSeconds);
5276
5346
  const isError = ERROR_PHASES.has(item.phase);
5277
- const spoken = countdown === null ? `${item.label}, ${PHASE_WORD[item.phase]}` : `${item.label}, ${clampedCountdown(countdown)}`;
5347
+ const spoken = countdown === null ? `${item.label}, ${wordOf(item)}` : `${item.label}, ${clampedCountdown(countdown)}`;
5278
5348
  return (
5279
5349
  // Compact drops the visible label, so the row carries it as its accessible name; `title` is only a convenience.
5280
5350
  /* @__PURE__ */ jsxs9(
@@ -5294,7 +5364,7 @@ function InFlightRow({
5294
5364
  }
5295
5365
  ),
5296
5366
  !$compact && /* @__PURE__ */ jsx23(InFlightList__Label, { children: item.label }),
5297
- /* @__PURE__ */ jsx23(InFlightList__Phase, { children: countdown === null ? PHASE_WORD[item.phase] : /* @__PURE__ */ jsx23(Countdown, { value: Math.max(0, countdown) }) })
5367
+ /* @__PURE__ */ jsx23(InFlightList__Phase, { children: countdown === null ? wordOf(item) : /* @__PURE__ */ jsx23(Countdown, { value: Math.max(0, countdown) }) })
5298
5368
  ]
5299
5369
  }
5300
5370
  )
@@ -5340,7 +5410,7 @@ function InFlightLanes({
5340
5410
  return /* @__PURE__ */ jsx23(
5341
5411
  Tooltip,
5342
5412
  {
5343
- text: item.settling ? null : `${item.label}, ${PHASE_WORD[item.phase]}`,
5413
+ text: item.settling ? null : `${item.label}, ${wordOf(item)}`,
5344
5414
  announce: false,
5345
5415
  focusable: !item.settling,
5346
5416
  children: /* @__PURE__ */ jsx23(
@@ -5352,7 +5422,7 @@ function InFlightLanes({
5352
5422
  "aria-hidden": true
5353
5423
  } : {
5354
5424
  role: "img",
5355
- "aria-label": `${item.label}, ${PHASE_WORD[item.phase]}`,
5425
+ "aria-label": `${item.label}, ${wordOf(item)}`,
5356
5426
  "data-role": "glow",
5357
5427
  "data-phase": item.phase,
5358
5428
  ...item.held ? { "data-held": "" } : {}
@@ -5474,7 +5544,7 @@ function InFlightQueueCmd({
5474
5544
  Math.min(1, (item.progress ?? PHASE_PROGRESS[item.phase]) * 1.5)
5475
5545
  );
5476
5546
  const dismissable = ERROR_PHASES.has(item.phase) && !!onDismiss && !item.settling;
5477
- const spoken = `${item.label}, ${PHASE_WORD[item.phase]}`;
5547
+ const spoken = `${item.label}, ${wordOf(item)}`;
5478
5548
  return /* @__PURE__ */ jsxs9(
5479
5549
  InFlightQueue__Cmd,
5480
5550
  {
@@ -5900,7 +5970,7 @@ function heldTone(tone) {
5900
5970
  }
5901
5971
 
5902
5972
  // src/Badge.tsx
5903
- import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
5973
+ import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
5904
5974
  function Badge({
5905
5975
  tone: ownTone,
5906
5976
  size = "md",
@@ -5926,7 +5996,7 @@ function Badge({
5926
5996
  const heldCaption = grade === void 0 ? null : heldWord(grade);
5927
5997
  const wrapped = Reflect.get(rest, "data-tooltip") !== void 0;
5928
5998
  const { anchor, tip } = useTooltip(wrapped ? null : heldCaption);
5929
- return /* @__PURE__ */ jsxs10(Fragment7, { children: [
5999
+ return /* @__PURE__ */ jsxs10(Fragment8, { children: [
5930
6000
  /* @__PURE__ */ jsxs10(
5931
6001
  Badge__Body,
5932
6002
  {
@@ -5937,7 +6007,7 @@ function Badge({
5937
6007
  ...rest,
5938
6008
  children: [
5939
6009
  children,
5940
- heldCaption !== null && /* @__PURE__ */ jsxs10(Fragment7, { children: [
6010
+ heldCaption !== null && /* @__PURE__ */ jsxs10(Fragment8, { children: [
5941
6011
  /* @__PURE__ */ jsx24(Badge__HeldMark, { "aria-hidden": "true", "data-held-mark": "" }),
5942
6012
  /* @__PURE__ */ jsxs10(VisuallyHidden, { "data-unit-currency": "", children: [
5943
6013
  ", ",
@@ -6265,7 +6335,7 @@ import {
6265
6335
  bandIn
6266
6336
  } from "@ksp-gonogo/sitrep-sdk";
6267
6337
  import styled18, { css as css12 } from "styled-components";
6268
- import { Fragment as Fragment8, jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
6338
+ import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
6269
6339
  var ATTACHED = ATTACHED_SYMBOLS;
6270
6340
  var ICON_BY_SYMBOL = {
6271
6341
  sci: MicroscopeIcon,
@@ -6345,7 +6415,7 @@ function UnitSymbol({
6345
6415
  const Glyph = ICON_BY_SYMBOL[compound?.head ?? symbol];
6346
6416
  const attached = ATTACHED.has(symbol);
6347
6417
  const spoken = word !== void 0;
6348
- return /* @__PURE__ */ jsxs11(Fragment8, { children: [
6418
+ return /* @__PURE__ */ jsxs11(Fragment9, { children: [
6349
6419
  spaced && !attached ? THIN_SPACE : null,
6350
6420
  /* @__PURE__ */ jsx26(Tooltip, { text: word, announce: false, children: /* @__PURE__ */ jsxs11(
6351
6421
  Unit__Span,
@@ -6355,7 +6425,7 @@ function UnitSymbol({
6355
6425
  className,
6356
6426
  "data-unit": token,
6357
6427
  children: [
6358
- Glyph ? /* @__PURE__ */ jsxs11(Fragment8, { children: [
6428
+ Glyph ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
6359
6429
  /* @__PURE__ */ jsx26(Glyph, { size: "1em" }),
6360
6430
  compound && /* @__PURE__ */ jsxs11("span", { "aria-hidden": "true", children: [
6361
6431
  "/",
@@ -6413,7 +6483,7 @@ function Unit({
6413
6483
  formatted.value,
6414
6484
  !hideSymbol && /* @__PURE__ */ jsx26(UnitSymbol, { token: formatted.symbol, spaced: true }),
6415
6485
  interval !== null && /* @__PURE__ */ jsxs11(Unit__Interval, { "data-unit-band": "", children: [
6416
- interval.oneFigure ? /* @__PURE__ */ jsxs11(Fragment8, { children: [
6486
+ interval.oneFigure ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
6417
6487
  " (",
6418
6488
  /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", children: "~" }),
6419
6489
  /* @__PURE__ */ jsx26(Unit__Word, { "data-unit-word": "", children: "approximately " }),
@@ -6687,7 +6757,7 @@ function waveformBand(blocks, spanSamples, boundaryX) {
6687
6757
 
6688
6758
  // src/CommandDelay/ControlDelayStream.tsx
6689
6759
  import { value as value2 } from "@ksp-gonogo/sitrep-sdk";
6690
- import { Fragment as Fragment9, useId as useId2 } from "react";
6760
+ import { Fragment as Fragment10, useId as useId2 } from "react";
6691
6761
  import styled20 from "styled-components";
6692
6762
 
6693
6763
  // src/CommandDelay/delayCurrency.ts
@@ -6697,7 +6767,7 @@ function withDelayCurrency(figure, delay) {
6697
6767
  }
6698
6768
 
6699
6769
  // src/CommandDelay/ControlDelayStream.tsx
6700
- import { Fragment as Fragment10, jsx as jsx29, jsxs as jsxs12 } from "react/jsx-runtime";
6770
+ import { Fragment as Fragment11, jsx as jsx29, jsxs as jsxs12 } from "react/jsx-runtime";
6701
6771
  var STREAM_MIN_DELAY_SECONDS = 0.05;
6702
6772
  function hasRealDelay(oneWay) {
6703
6773
  return typeof oneWay === "number" && Number.isFinite(oneWay) && oneWay > 0;
@@ -6946,7 +7016,7 @@ function StreamPaths({
6946
7016
  }
6947
7017
  ),
6948
7018
  runs.map(
6949
- (run) => run.off ? /* @__PURE__ */ jsxs12(Fragment9, { children: [
7019
+ (run) => run.off ? /* @__PURE__ */ jsxs12(Fragment10, { children: [
6950
7020
  /* @__PURE__ */ jsx29(
6951
7021
  "path",
6952
7022
  {
@@ -7034,7 +7104,7 @@ function RibbonMark({
7034
7104
  ]
7035
7105
  }
7036
7106
  ) }),
7037
- wave !== void 0 ? /* @__PURE__ */ jsxs12(Fragment10, { children: [
7107
+ wave !== void 0 ? /* @__PURE__ */ jsxs12(Fragment11, { children: [
7038
7108
  /* @__PURE__ */ jsx29(
7039
7109
  "line",
7040
7110
  {
@@ -7247,7 +7317,7 @@ function DelayBand({
7247
7317
  ]
7248
7318
  }
7249
7319
  ),
7250
- variant === "expanded" && /* @__PURE__ */ jsxs12(Fragment10, { children: [
7320
+ variant === "expanded" && /* @__PURE__ */ jsxs12(Fragment11, { children: [
7251
7321
  /* @__PURE__ */ jsxs12(ControlDelayStream__Zones, { "aria-hidden": "true", children: [
7252
7322
  /* @__PURE__ */ jsxs12("span", { children: [
7253
7323
  "outgoing ",
@@ -7681,7 +7751,7 @@ import {
7681
7751
  useRef as useRef8,
7682
7752
  useSyncExternalStore as useSyncExternalStore7
7683
7753
  } from "react";
7684
- import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
7754
+ import { Fragment as Fragment12, jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
7685
7755
  var slotBudgets = /* @__PURE__ */ new Map();
7686
7756
  function getSlotPerfBudget(slot) {
7687
7757
  let budget = slotBudgets.get(slot);
@@ -7973,8 +8043,8 @@ function ContributionsAggregation({
7973
8043
  }
7974
8044
  return merged;
7975
8045
  }, [meta, named]);
7976
- if (!store) return /* @__PURE__ */ jsx32(Fragment11, { children });
7977
- return /* @__PURE__ */ jsxs14(Fragment11, { children: [
8046
+ if (!store) return /* @__PURE__ */ jsx32(Fragment12, { children });
8047
+ return /* @__PURE__ */ jsxs14(Fragment12, { children: [
7978
8048
  slots.map((slot) => /* @__PURE__ */ jsx32(SlotAggregator, { slot, store }, slot)),
7979
8049
  children
7980
8050
  ] });
@@ -7983,7 +8053,7 @@ function ContributionsAggregation({
7983
8053
  // src/Dial.tsx
7984
8054
  import { bandIn as bandIn2 } from "@ksp-gonogo/sitrep-sdk";
7985
8055
  import styled22 from "styled-components";
7986
- import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
8056
+ import { Fragment as Fragment13, jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
7987
8057
  var TRACK_THICKNESS = 6;
7988
8058
  var HUB_RADIUS = 3;
7989
8059
  var RAISED = { track: 8, hub: 4, needle: 0.92 };
@@ -8214,7 +8284,7 @@ function Dial({
8214
8284
  end
8215
8285
  );
8216
8286
  }),
8217
- r > 0 && hasFigure && /* @__PURE__ */ jsxs15(Fragment12, { children: [
8287
+ r > 0 && hasFigure && /* @__PURE__ */ jsxs15(Fragment13, { children: [
8218
8288
  /* @__PURE__ */ jsx33(
8219
8289
  "line",
8220
8290
  {
@@ -8462,7 +8532,7 @@ function FilterRegion({
8462
8532
 
8463
8533
  // src/FramedDisplay.tsx
8464
8534
  import styled25 from "styled-components";
8465
- import { Fragment as Fragment13, jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
8535
+ import { Fragment as Fragment14, jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
8466
8536
  var EDGE_CUE_FILL = {
8467
8537
  accent: "var(--color-accent-fg)",
8468
8538
  warn: "var(--color-warn-mark)"
@@ -8492,7 +8562,7 @@ function FramedDisplay({
8492
8562
  "data-shape": circle ? "circle" : void 0,
8493
8563
  ...rest,
8494
8564
  children: [
8495
- hasStrip ? /* @__PURE__ */ jsxs19(Fragment13, { children: [
8565
+ hasStrip ? /* @__PURE__ */ jsxs19(Fragment14, { children: [
8496
8566
  /* @__PURE__ */ jsx37(FramedDisplay__Main, { $padded: padded, children }),
8497
8567
  /* @__PURE__ */ jsx37(FramedDisplay__Strip, { "data-framed-display-strip": "", children: strip })
8498
8568
  ] }) : circle && edgeCue !== void 0 ? /* @__PURE__ */ jsx37(FramedDisplay__Clip, { children }) : children,
@@ -8907,7 +8977,7 @@ function usePanelAsideSize() {
8907
8977
  import {
8908
8978
  Children as Children2,
8909
8979
  createContext as createContext8,
8910
- Fragment as Fragment14,
8980
+ Fragment as Fragment15,
8911
8981
  forwardRef as forwardRef10,
8912
8982
  isValidElement as isValidElement2,
8913
8983
  useCallback as useCallback7,
@@ -9185,7 +9255,11 @@ function PanelDelayRail({ tiny } = {}) {
9185
9255
  /* @__PURE__ */ jsx40(
9186
9256
  Tooltip,
9187
9257
  {
9188
- text: !grown && strip.length > 0 ? `In flight: ${strip.filter((i) => !i.settling).map((i) => i.label).join(", ")}` : null,
9258
+ text: !grown && failedCount > 0 ? [
9259
+ ...refusals.map(commandRefusalSentence),
9260
+ ...undelivered.map(commandUndeliveredSentence),
9261
+ ...failures.map(commandFailedSentence)
9262
+ ].join(" ") : !grown && strip.length > 0 ? `In flight: ${strip.filter((i) => !i.settling).map((i) => i.label).join(", ")}` : null,
9189
9263
  children: /* @__PURE__ */ jsx40(
9190
9264
  PanelDelayRail__Toggle,
9191
9265
  {
@@ -9234,10 +9308,10 @@ function PanelDelayRail({ tiny } = {}) {
9234
9308
  ),
9235
9309
  !grown && (failedCount > 0 || losses.length > 0 || founds.length > 0 || warnings.length > 0) && // One run for every count, since they share the band's single grid cell.
9236
9310
  /* @__PURE__ */ jsxs20(PanelDelayRail__Summaries, { children: [
9237
- failedCount > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__WarnSummary, { children: failedCount === 1 ? "1 command failed" : `${failedCount} commands failed` }),
9238
- losses.length > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__WarnSummary, { children: losses.length === 1 ? "1 command unconfirmed" : `${losses.length} commands unconfirmed` }),
9311
+ failedCount > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__WarnSummary, { children: tiny ? `${failedCount} failed` : failedCount === 1 ? "1 command failed" : `${failedCount} commands failed` }),
9312
+ losses.length > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__WarnSummary, { children: tiny ? `${losses.length} no reply` : losses.length === 1 ? "1 command unconfirmed" : `${losses.length} commands unconfirmed` }),
9239
9313
  warnings.length > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__WarnSummary, { children: warnings.length === 1 ? "1 warning" : `${warnings.length} warnings` }),
9240
- founds.length > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__FoundSummary, { children: founds.length === 1 ? "1 unconfirmed command answered" : `${founds.length} unconfirmed commands answered` })
9314
+ founds.length > 0 && /* @__PURE__ */ jsx40(PanelDelayRail__FoundSummary, { children: tiny ? `${founds.length} answered` : founds.length === 1 ? "1 unconfirmed command answered" : `${founds.length} unconfirmed commands answered` })
9241
9315
  ] })
9242
9316
  ] }),
9243
9317
  grown && strip.length > 0 && (hasGraph || drawsBand) && /* @__PURE__ */ jsx40(PanelDelayRail__GrownStrip, { "data-over-graph": "true", children: /* @__PURE__ */ jsx40(InFlightLanes, { items: strip, height: GRAPH_HEIGHT_PX }) })
@@ -9329,6 +9403,8 @@ var PanelDelayRail__Rail = styled27.div`
9329
9403
  height: auto;
9330
9404
  /* The band, and nothing over it: the strip a widget reserves is the strip the rail fills. */
9331
9405
  max-height: var(--panel-rail-band);
9406
+ /* A count alone is one line tall, so without a floor the grid shrinks to it and the count rides the panel's top edge instead of centring in the band. */
9407
+ min-height: var(--panel-rail-band);
9332
9408
  overflow: hidden;
9333
9409
  transition: max-height var(--duration-slow) var(--ease-standard);
9334
9410
 
@@ -9390,6 +9466,10 @@ var PanelDelayRail__WarnSummary = styled27.span`
9390
9466
  var PanelDelayRail__Summaries = styled27.span`
9391
9467
  align-self: center;
9392
9468
  justify-self: end;
9469
+ /* A run wider than the band is clipped at the band's edge rather than drawn past the panel. */
9470
+ min-width: 0;
9471
+ max-width: 100%;
9472
+ overflow: hidden;
9393
9473
  display: flex;
9394
9474
  gap: var(--gap-rail-summaries);
9395
9475
  padding: 0 var(--gutter-panel);
@@ -9633,7 +9713,7 @@ function useKeyboardScrollable(el) {
9633
9713
  }
9634
9714
 
9635
9715
  // src/Panel.tsx
9636
- import { Fragment as Fragment15, jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
9716
+ import { Fragment as Fragment16, jsx as jsx42, jsxs as jsxs21 } from "react/jsx-runtime";
9637
9717
  var PanelCtx = createContext8(null);
9638
9718
  function PanelContextProvider({ children }) {
9639
9719
  const [scroller, setScroller] = useState14(null);
@@ -10687,7 +10767,7 @@ function worstBadge(badges) {
10687
10767
  return worst;
10688
10768
  }
10689
10769
  function PanelBadgeReports({ badges }) {
10690
- return /* @__PURE__ */ jsx42(Fragment15, { children: badges.map((b) => /* @__PURE__ */ jsx42(PanelBadgeReport, { entry: b }, b.id)) });
10770
+ return /* @__PURE__ */ jsx42(Fragment16, { children: badges.map((b) => /* @__PURE__ */ jsx42(PanelBadgeReport, { entry: b }, b.id)) });
10691
10771
  }
10692
10772
  function PanelBadgeReport({ entry }) {
10693
10773
  const face = badgeFace(entry);
@@ -10701,7 +10781,7 @@ function PanelHoverStatus({
10701
10781
  summary,
10702
10782
  announcement
10703
10783
  }) {
10704
- return /* @__PURE__ */ jsxs21(Fragment15, { children: [
10784
+ return /* @__PURE__ */ jsxs21(Fragment16, { children: [
10705
10785
  /* @__PURE__ */ jsx42(Tooltip, { text: summary.label, focusable: true, children: /* @__PURE__ */ jsx42(PanelHoverStatus__Hit, { children: /* @__PURE__ */ jsx42(PanelStatusDot, { severity: summary.severity }) }) }),
10706
10786
  /* @__PURE__ */ jsx42(LiveRegion, { visuallyHidden: true, assertive: true, children: announcement })
10707
10787
  ] });
@@ -10765,7 +10845,7 @@ function PanelRootImpl({
10765
10845
  }
10766
10846
  ) }, b.id);
10767
10847
  });
10768
- const toolbar = panelFilter === void 0 ? panelToolbar : /* @__PURE__ */ jsxs21(Fragment15, { children: [
10848
+ const toolbar = panelFilter === void 0 ? panelToolbar : /* @__PURE__ */ jsxs21(Fragment16, { children: [
10769
10849
  panelToolbar,
10770
10850
  /* @__PURE__ */ jsx42(PanelFilterSlot, { children: filterControlOf(panelFilter) })
10771
10851
  ] });
@@ -10784,7 +10864,7 @@ function PanelRootImpl({
10784
10864
  const statusBadge = summaryDuplicatesABadgePill ? null : summary !== null ? /* @__PURE__ */ jsx42(PanelSummaryBadge, { summary }) : streamStatus === null || streamLabel === null ? null : /* @__PURE__ */ jsx42(Tooltip, { text: `Telemetry stream: ${streamLabel}`, focusable: true, children: /* @__PURE__ */ jsx42(Badge, { tone: severityFromStreamStatus(streamStatus), size: "sm", children: streamLabel }) });
10785
10865
  const statusLabel = summary?.label ?? streamLabel;
10786
10866
  const statusAnnouncement = statusLabel === null || statusLabel === "" ? "" : typeof panelTitle === "string" ? `${panelTitle}: ${statusLabel}` : `Status: ${statusLabel}`;
10787
- const aside = panelAside === void 0 && statusBadge === null && badgePills === null && !hasActionAugments ? void 0 : /* @__PURE__ */ jsxs21(Fragment15, { children: [
10867
+ const aside = panelAside === void 0 && statusBadge === null && badgePills === null && !hasActionAugments ? void 0 : /* @__PURE__ */ jsxs21(Fragment16, { children: [
10788
10868
  panelAside,
10789
10869
  hasActionAugments && /* @__PURE__ */ jsx42(AugmentSlot, { segment: "actions", props: NO_SEGMENT_PROPS }),
10790
10870
  badgePills,
@@ -10795,7 +10875,7 @@ function PanelRootImpl({
10795
10875
  label: streamLabel
10796
10876
  });
10797
10877
  const tinyAnnouncement = tinySummary?.severity !== "nogo" ? void 0 : typeof panelTitle === "string" ? `${panelTitle}: ${tinySummary.label}` : `Status: ${tinySummary.label}`;
10798
- const tinyAside = panelAside === void 0 && tinySummary === null && !hasActionAugments ? badges.length === 0 ? void 0 : /* @__PURE__ */ jsx42(PanelBadgeReports, { badges }) : /* @__PURE__ */ jsxs21(Fragment15, { children: [
10878
+ const tinyAside = panelAside === void 0 && tinySummary === null && !hasActionAugments ? badges.length === 0 ? void 0 : /* @__PURE__ */ jsx42(PanelBadgeReports, { badges }) : /* @__PURE__ */ jsxs21(Fragment16, { children: [
10799
10879
  panelAside,
10800
10880
  hasActionAugments && /* @__PURE__ */ jsx42(AugmentSlot, { segment: "actions", props: NO_SEGMENT_PROPS }),
10801
10881
  /* @__PURE__ */ jsx42(PanelBadgeReports, { badges }),
@@ -10850,7 +10930,7 @@ function PanelRootImpl({
10850
10930
  )
10851
10931
  );
10852
10932
  }
10853
- const content = isInactive ? /* @__PURE__ */ jsx42(InactiveNotice, { reason: inactive }) : !hasSections ? children : /* @__PURE__ */ jsxs21(Fragment15, { children: [
10933
+ const content = isInactive ? /* @__PURE__ */ jsx42(InactiveNotice, { reason: inactive }) : !hasSections ? children : /* @__PURE__ */ jsxs21(Fragment16, { children: [
10854
10934
  children,
10855
10935
  sectionRuns
10856
10936
  ] });
@@ -10929,7 +11009,7 @@ function holdsOnlyAFrame(section) {
10929
11009
  const [child] = only;
10930
11010
  if (!isValidElement2(child)) return false;
10931
11011
  if (child.type === FramedDisplay) return true;
10932
- if (child.type !== Fragment14 && typeof child.type !== "string") return false;
11012
+ if (child.type !== Fragment15 && typeof child.type !== "string") return false;
10933
11013
  node = child.props.children;
10934
11014
  }
10935
11015
  }
@@ -11157,7 +11237,7 @@ function getWidgetShape(w, h) {
11157
11237
  }
11158
11238
 
11159
11239
  // src/TinyEssentials.tsx
11160
- import { Fragment as Fragment16, useLayoutEffect as useLayoutEffect6, useRef as useRef15, useState as useState15 } from "react";
11240
+ import { Fragment as Fragment17, useLayoutEffect as useLayoutEffect6, useRef as useRef15, useState as useState15 } from "react";
11161
11241
  import styled31, { css as css18 } from "styled-components";
11162
11242
 
11163
11243
  // src/fillQuantity.ts
@@ -11168,7 +11248,7 @@ function fillFraction(pair) {
11168
11248
  }
11169
11249
 
11170
11250
  // src/TinyEssentials.tsx
11171
- import { Fragment as Fragment17, jsx as jsx46, jsxs as jsxs23 } from "react/jsx-runtime";
11251
+ import { Fragment as Fragment18, jsx as jsx46, jsxs as jsxs23 } from "react/jsx-runtime";
11172
11252
  function TinyEssentials({
11173
11253
  title,
11174
11254
  essentials,
@@ -11198,7 +11278,7 @@ function TinyEssentials({
11198
11278
  ),
11199
11279
  sections: /* @__PURE__ */ jsxs23(Section, { full: true, children: [
11200
11280
  /* @__PURE__ */ jsx46(LiveRegion, { visuallyHidden: true, children: spokenWords(essentials.filter((e) => e.urgent !== true)) }),
11201
- mayInterrupt && /* @__PURE__ */ jsx46(LiveRegion, { visuallyHidden: true, assertive: true, additionsOnly: true, children: urgentWords(essentials).map((said2) => /* @__PURE__ */ jsx46(Fragment16, { children: `${said2}. ` }, said2)) }),
11281
+ mayInterrupt && /* @__PURE__ */ jsx46(LiveRegion, { visuallyHidden: true, assertive: true, additionsOnly: true, children: urgentWords(essentials).map((said2) => /* @__PURE__ */ jsx46(Fragment17, { children: `${said2}. ` }, said2)) }),
11202
11282
  hero !== void 0 && /* @__PURE__ */ jsxs23(TinyEssentials__Hero, { "data-tiny-essential": "", children: [
11203
11283
  heroNamedByTitle || arcHero ? /* @__PURE__ */ jsx46(VisuallyHidden, { as: "dt", children: hero.label }) : /* @__PURE__ */ jsx46(TinyEssentials__Label, { children: hero.label }),
11204
11284
  hero.value != null && arcGauge !== void 0 ? /* @__PURE__ */ jsx46(ArcGauge, { essential: hero, gauge: arcGauge }) : hero.gauge === void 0 ? /* @__PURE__ */ jsx46(TinyEssentials__HeroFigure, { $tone: hero.tone ?? "neutral", children: /* @__PURE__ */ jsx46(EssentialFigure, { essential: hero }) }) : /* @__PURE__ */ jsxs23(TinyEssentials__GaugedFigure, { $tone: hero.tone ?? "neutral", children: [
@@ -11285,11 +11365,27 @@ function extentOf(content) {
11285
11365
  function EssentialFigure({ essential }) {
11286
11366
  const { control } = essential;
11287
11367
  if (control?.command !== void 0) {
11368
+ const { command } = control;
11369
+ if (!("kind" in command && command.kind === "value")) {
11370
+ return /* @__PURE__ */ jsx46(
11371
+ Button2,
11372
+ {
11373
+ size: "sm",
11374
+ command,
11375
+ pressed: control.active,
11376
+ unavailable: control.disabled ? control.hint ?? control.title : null,
11377
+ tip: control.hint ?? control.title,
11378
+ "aria-label": control.title,
11379
+ blockedAriaLabel: control.title,
11380
+ children: control.label
11381
+ }
11382
+ );
11383
+ }
11288
11384
  return /* @__PURE__ */ jsx46(
11289
11385
  ToggleButton,
11290
11386
  {
11291
11387
  size: "sm",
11292
- command: control.command,
11388
+ command,
11293
11389
  state: control.active,
11294
11390
  name: control.title,
11295
11391
  unavailable: control.disabled ? control.hint ?? control.title : null,
@@ -11313,7 +11409,7 @@ function EssentialFigure({ essential }) {
11313
11409
  }
11314
11410
  ) });
11315
11411
  }
11316
- return /* @__PURE__ */ jsxs23(Fragment17, { children: [
11412
+ return /* @__PURE__ */ jsxs23(Fragment18, { children: [
11317
11413
  essential.level !== void 0 && /* @__PURE__ */ jsx46(
11318
11414
  LevelBars,
11319
11415
  {
@@ -11339,7 +11435,7 @@ function EssentialReading({ essential }) {
11339
11435
  const roundsToZero = finite && decimals !== void 0 && Math.abs(shown.valueOf()) < 0.5 * 10 ** -decimals;
11340
11436
  const plus = finite && (roundsToZero || !shown.isNegative()) ? "+" : "";
11341
11437
  const drawn = roundsToZero ? asZero(value3, shown) : value3;
11342
- const figure = /* @__PURE__ */ jsxs23(Fragment17, { children: [
11438
+ const figure = /* @__PURE__ */ jsxs23(Fragment18, { children: [
11343
11439
  plus,
11344
11440
  /* @__PURE__ */ jsx46(
11345
11441
  Unit,
@@ -11908,4 +12004,4 @@ lucide-react/dist/esm/lucide-react.mjs:
11908
12004
  * See the LICENSE file in the root directory of this source tree.
11909
12005
  *)
11910
12006
  */
11911
- //# sourceMappingURL=chunk-WR3644JL.js.map
12007
+ //# sourceMappingURL=chunk-FIYXARZ7.js.map