@ksp-gonogo/ui-kit 1.0.0 → 2.0.0-rc.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tokens.css CHANGED
@@ -249,22 +249,22 @@ textarea {
249
249
  --color-accent-bg: #00ff88;
250
250
 
251
251
  /*
252
- * The tone hues. A palette rung is named nowhere but this file: everything
252
+ * The status steps. A status step is named nowhere but this file: everything
253
253
  * else reaches a hue through the role token below that says what it is for.
254
254
  */
255
- --palette-green-100: #cfe;
256
- --palette-green-500: #3c8050;
257
- --palette-green-700: #2e5a2e;
258
- --palette-green-900: #0d180d;
259
- --palette-red-100: #ffdede;
260
- --palette-red-400: #ff4d4d;
261
- --palette-red-900: #4a0e0e;
262
- --palette-amber-200: #ffd68a;
263
- --palette-amber-400: #ff8c00;
264
- --palette-amber-600: #8a6a28;
265
- --palette-amber-900: #3a2a0a;
266
- --palette-blue-300: #7cf;
267
- --palette-ink: #1a1a1a;
255
+ --status-go-1: #cfe;
256
+ --status-go-2: #3c8050;
257
+ --status-go-3: #2e5a2e;
258
+ --status-go-4: #0d180d;
259
+ --status-nogo-1: #ffdede;
260
+ --status-nogo-2: #ff4d4d;
261
+ --status-nogo-3: #4a0e0e;
262
+ --status-warn-1: #ffd68a;
263
+ --status-warn-2: #ff8c00;
264
+ --status-warn-3: #8a6a28;
265
+ --status-warn-4: #3a2a0a;
266
+ --status-info-1: #7cf;
267
+ --status-on-fill: #1a1a1a;
268
268
 
269
269
  /*
270
270
  * One tone scale, five roles per tone, so a colour is chosen by the job it
@@ -289,46 +289,46 @@ textarea {
289
289
  --color-neutral-on-status: var(--color-text-primary);
290
290
  --color-neutral-muted: var(--color-surface-raised);
291
291
 
292
- --color-info-text: var(--palette-blue-300);
293
- --color-info-mark: var(--palette-blue-300);
294
- --color-info-status: var(--palette-blue-300);
295
- --color-info-on-status: var(--palette-ink);
292
+ --color-info-text: var(--status-info-1);
293
+ --color-info-mark: var(--status-info-1);
294
+ --color-info-status: var(--status-info-1);
295
+ --color-info-on-status: var(--status-on-fill);
296
296
  --color-info-muted: var(--color-surface-panel);
297
297
 
298
- --color-go-text: var(--palette-green-100);
299
- --color-go-mark: var(--palette-green-500);
300
- --color-go-status: var(--palette-green-700);
301
- --color-go-on-status: var(--palette-green-100);
298
+ --color-go-text: var(--status-go-1);
299
+ --color-go-mark: var(--status-go-2);
300
+ --color-go-status: var(--status-go-3);
301
+ --color-go-on-status: var(--status-go-1);
302
302
  /* Kept this dark so --color-text-dim body text stays above 4.5:1 on it; a go card's green is carried by its edge. */
303
- --color-go-muted: var(--palette-green-900);
303
+ --color-go-muted: var(--status-go-4);
304
304
 
305
- --color-caution-text: var(--palette-amber-200);
306
- --color-caution-mark: var(--palette-amber-200);
307
- --color-caution-status: var(--palette-amber-200);
308
- --color-caution-on-status: var(--palette-ink);
309
- --color-caution-muted: var(--palette-amber-900);
305
+ --color-caution-text: var(--status-warn-1);
306
+ --color-caution-mark: var(--status-warn-1);
307
+ --color-caution-status: var(--status-warn-1);
308
+ --color-caution-on-status: var(--status-on-fill);
309
+ --color-caution-muted: var(--status-warn-4);
310
310
 
311
- --color-warn-text: var(--palette-amber-200);
312
- --color-warn-mark: var(--palette-amber-400);
311
+ --color-warn-text: var(--status-warn-1);
312
+ --color-warn-mark: var(--status-warn-2);
313
313
 
314
314
  /* The mark of a figure a model carried: held keeps the warn square, a modelled figure draws this blue as a triangle, so the two differ by shape and by hue. */
315
- --color-modelled-mark: var(--palette-blue-300);
315
+ --color-modelled-mark: var(--status-info-1);
316
316
  /* The apsides, on an orbit drawing and beside their readouts. Neither is the held amber nor the modelled blue, so an apsis never reads as a mark about how current a figure is. */
317
317
  --color-apoapsis-mark: var(--color-data-12);
318
318
  --color-periapsis-mark: var(--color-data-15);
319
319
  /* The mark of a figure measured now, but of something other than what its label names. Not the held amber, the modelled blue or a go green, so it says nothing about how current the figure is. */
320
320
  --color-elsewhere-mark: var(--color-data-15);
321
- --color-warn-status: var(--palette-amber-400);
322
- --color-warn-on-status: var(--palette-ink);
323
- --color-warn-muted: var(--palette-amber-900);
321
+ --color-warn-status: var(--status-warn-2);
322
+ --color-warn-on-status: var(--status-on-fill);
323
+ --color-warn-muted: var(--status-warn-4);
324
324
  /* The edge of a warn box drawn on its muted ground: decorative, the box's text carries the tone. */
325
- --color-warn-muted-edge: var(--palette-amber-600);
325
+ --color-warn-muted-edge: var(--status-warn-3);
326
326
 
327
- --color-nogo-text: var(--palette-red-100);
328
- --color-nogo-mark: var(--palette-red-400);
329
- --color-nogo-status: var(--palette-red-400);
330
- --color-nogo-on-status: var(--palette-ink);
331
- --color-nogo-muted: var(--palette-red-900);
327
+ --color-nogo-text: var(--status-nogo-1);
328
+ --color-nogo-mark: var(--status-nogo-2);
329
+ --color-nogo-status: var(--status-nogo-2);
330
+ --color-nogo-on-status: var(--status-on-fill);
331
+ --color-nogo-muted: var(--status-nogo-3);
332
332
 
333
333
  --color-offline-text: var(--color-text-dim);
334
334
  --color-offline-mark: var(--color-text-dim);
@@ -423,6 +423,49 @@ textarea {
423
423
 
424
424
  --color-focus: #00ff88;
425
425
 
426
+ /*
427
+ * Colours that are not a status, a tag, a marker or a chart series but that
428
+ * widgets draw with: the ink of shadows and scrims, a light tint, the alarm
429
+ * and poll grounds, and the hues of diagrams and device glows. Each is a
430
+ * foundation value a theme sets. A strength of one (a 35% shadow, a 55%
431
+ * accent glow) is mixed from it where it is used, never written as a
432
+ * colour of its own.
433
+ */
434
+ --color-shadow: #000000;
435
+ /* The backing drawn behind text and marks the theme itself colours (a chart legend chip, a banner), so it has to contrast with them where a shadow does not. */
436
+ --color-scrim: #000000;
437
+ /* The marks drawn over map imagery, which is dark in every theme, so they do not follow the text and tag colours a light theme darkens. */
438
+ --color-imagery-ksc: #cccccc;
439
+ --color-imagery-launch-site: #888888;
440
+ --color-imagery-contract: #ffeb3b;
441
+ --color-imagery-anomaly: #00cccc;
442
+ --color-imagery-other: #838383;
443
+ --color-highlight: #ffffff;
444
+ --color-alarm-set: #14230f;
445
+ --color-alarm-arm: #37280c;
446
+ --color-alarm-fire: #500c0c;
447
+ --color-alarm-notice: #5a0f0f;
448
+ --color-alarm-offline: #781e1e;
449
+ --color-alarm-overlay: #14161a;
450
+ --color-poll-go: #28a050;
451
+ --color-poll-no-go: #a02828;
452
+ --color-poll-abort: #c82828;
453
+ --color-poll-none: #323232;
454
+ --color-diagram-orbit-burn: #ffb428;
455
+ --color-diagram-orbit-retro: #ff5000;
456
+ --color-diagram-atmosphere-oxygen: #50a0dc;
457
+ --color-diagram-atmosphere-inert: #dc8c3c;
458
+ --color-diagram-encounter: #40c8ff;
459
+ --color-diagram-flyby: #ffb440;
460
+ --color-diagram-impact: #ff4040;
461
+ --color-diagram-depth-above: #e65a5a;
462
+ --color-diagram-depth-level: #a0a0aa;
463
+ --color-diagram-depth-below: #5082e6;
464
+ --color-diagram-docking-misaligned: #ff9800;
465
+ --color-diagram-signal-live: #7cccff;
466
+ --color-diagram-danger: #ff3b30;
467
+ --color-diagram-power: #00cc66;
468
+
426
469
  /*
427
470
  * SPACING LADDER. One ladder for padding, margin AND gap, on a 2px grid
428
471
  * with a 1px `hair` step below it.
@@ -717,7 +760,8 @@ textarea {
717
760
  /* A bordered status box sized to --control-height. */
718
761
  --inset-status-box: var(--space-4) var(--space-8);
719
762
  /* A popover's content. */
720
- --inset-popover: var(--space-8);
763
+ --inset-floating: var(--space-8);
764
+ --inset-popover: var(--inset-floating);
721
765
  /* A tooltip's content. */
722
766
  --inset-tooltip: var(--space-4) var(--space-8);
723
767
  /* The drop between an anchor and the popover it opens. */
@@ -910,8 +954,9 @@ textarea {
910
954
  --inset-tile-header: 0 var(--space-4);
911
955
  /* A dialog that stands alone over the app. */
912
956
  --inset-dialog: var(--space-24);
913
- --inset-modal-bar: var(--space-12) var(--space-16);
914
- --inset-modal-body: var(--space-16);
957
+ --inset-modal-bar: calc(var(--inset-floating) * 1.5)
958
+ calc(var(--inset-floating) * 2);
959
+ --inset-modal-body: calc(var(--inset-floating) * 2);
915
960
  /* A full-page route (the join page): its edge before any safe-area inset, and the space between its blocks. */
916
961
  --inset-page: var(--space-16);
917
962
  --gap-page: var(--space-24);
@@ -1034,6 +1079,42 @@ textarea {
1034
1079
  /* What `Block`'s side asides step --radius-display-frame to. */
1035
1080
  --radius-display-frame-aside: 4px;
1036
1081
  --radius-pill: 999px;
1082
+ --radius-banner: 999px;
1083
+
1084
+ /* Border widths. A ring drawn as a box-shadow spread, a focus outline and a 1.5px stroke are not borders and keep their own values. */
1085
+ --border-width-hairline: 1px;
1086
+ --border-width-strong: 2px;
1087
+
1088
+ /* The two weights above regular that the kit sets. */
1089
+ --font-weight-semibold: 600;
1090
+ --font-weight-bold: 700;
1091
+
1092
+ /* The multiplier every letter spacing is written with: 1 is as written. */
1093
+ --tracking-scale: 1;
1094
+
1095
+ /*
1096
+ * Drop shadows by level. A panel is raised and draws none. Every floating
1097
+ * surface has a shadow of its own as drawn here, and a theme that sets a
1098
+ * floating shadow writes the same one over all of them, so no surface is
1099
+ * left behind.
1100
+ */
1101
+ --shadow-raised: none;
1102
+ --shadow-popover: var(--shadow-popover-drop)
1103
+ color-mix(in srgb, var(--color-shadow) 35%, transparent);
1104
+ --shadow-banner: 0 4px 12px
1105
+ color-mix(in srgb, var(--color-shadow) 55%, transparent);
1106
+ --shadow-fab: 0 4px 12px
1107
+ color-mix(in srgb, var(--color-shadow) 50%, transparent);
1108
+ --shadow-menu: 0 8px 24px
1109
+ color-mix(in srgb, var(--color-shadow) 50%, transparent);
1110
+ --shadow-modal: 0 8px 32px
1111
+ color-mix(in srgb, var(--color-shadow) 60%, transparent);
1112
+ --shadow-overlay: 0 8px 32px
1113
+ color-mix(in srgb, var(--color-shadow) 70%, transparent);
1114
+ --shadow-dialog: 0 12px 40px
1115
+ color-mix(in srgb, var(--color-shadow) 50%, transparent);
1116
+ --shadow-takeover: 0 12px 48px
1117
+ color-mix(in srgb, var(--color-shadow) 60%, transparent);
1037
1118
  --radius-circle: 50%;
1038
1119
 
1039
1120
  /*
@@ -1162,11 +1243,13 @@ textarea {
1162
1243
  * guard, and the `animation` shorthand must stay INSIDE that guard
1163
1244
  * with its keyframes.
1164
1245
  */
1165
- --duration-instant: 80ms;
1166
- --duration-fast: 120ms;
1167
- --duration-base: 150ms;
1168
- --duration-slow: 200ms;
1169
- --duration-entrance: 320ms;
1246
+ /* A theme's multiplier on the five durations; 1 is as written below. */
1247
+ --motion-speed: 1;
1248
+ --duration-instant: calc(80ms * var(--motion-speed));
1249
+ --duration-fast: calc(120ms * var(--motion-speed));
1250
+ --duration-base: calc(150ms * var(--motion-speed));
1251
+ --duration-slow: calc(200ms * var(--motion-speed));
1252
+ --duration-entrance: calc(320ms * var(--motion-speed));
1170
1253
 
1171
1254
  --ease-standard: ease;
1172
1255
  --ease-emphasis: ease-in-out;
@@ -101,7 +101,7 @@ type PresentableAsKind<Kind> = SymbolsOfKind<Kind> | ConversionTargetsOfKind<Kin
101
101
  *
102
102
  * @category Unit
103
103
  */
104
- type KnownQuantityKind = "length" | "speed" | "acceleration" | "mass" | "force" | "pressure" | "temperature" | "time" | "universalTime" | "specificImpulse" | "irlTime" | "planeAngle" | "power" | "data" | "dataRate" | "doseRate" | "irradiance" | "level" | "density" | "massFlow" | "gravParameter" | "dimensionless" | "percent" | "scienceData" | "scienceRate" | "ratio" | "area" | "volume" | "angularSpeed" | "funds" | "science" | "reputation" | "fundsRate" | "reputationRate" | "count" | "id" | "resourceUnits" | "resourceFlow" | "text" | "flag" | "enum" | "n/a";
104
+ type KnownQuantityKind = "length" | "speed" | "acceleration" | "mass" | "force" | "pressure" | "temperature" | "time" | "universalTime" | "specificImpulse" | "irlTime" | "planeAngle" | "power" | "data" | "dataRate" | "frequency" | "doseRate" | "irradiance" | "level" | "density" | "massFlow" | "gravParameter" | "dimensionless" | "percent" | "scienceData" | "scienceRate" | "ratio" | "area" | "volume" | "angularSpeed" | "funds" | "science" | "reputation" | "fundsRate" | "reputationRate" | "count" | "id" | "resourceUnits" | "resourceFlow" | "text" | "flag" | "enum" | "n/a";
105
105
  /**
106
106
  * A quantity kind, open to kinds this package has never heard of.
107
107
  *
@@ -210,6 +210,20 @@ declare function speakQuantity(quantity: {
210
210
  magnitude: number;
211
211
  unit: string;
212
212
  } | null | undefined, opts?: FormatQuantityOptions): string;
213
+ /**
214
+ * A duration spelled whole in words, such as `1 day 0 hours 17 minutes 25
215
+ * seconds` for 22 645 s, or `undefined` for a quantity that is not a duration
216
+ * or whose written form already says all of it. Useful for the tip and the
217
+ * spoken form of a duration, which `writeQuantity` writes as its
218
+ * largest unit and the one below it. Used by {@link Unit} and
219
+ * {@link Countdown}.
220
+ *
221
+ * @category Unit
222
+ */
223
+ declare function speakFullDuration(quantity: {
224
+ magnitude: number;
225
+ unit: string;
226
+ } | null | undefined): string | undefined;
213
227
  /**
214
228
  * A quantity as it is written: the value and the unit's symbol, `250.0 km`.
215
229
  * Useful for showing the operator a figure in text a node cannot hold. Used by
@@ -219,8 +233,8 @@ declare function speakQuantity(quantity: {
219
233
  * chart annotation measured before it is drawn. Anywhere a node fits, use
220
234
  * {@link Unit}; for an accessible name, {@link speakQuantity}.
221
235
  *
222
- * An ordinary space, not the thin space `<Unit>` sets, since a U+2009 is at
223
- * the mercy of the SVG or canvas renderer.
236
+ * The value and its symbol are joined by a no-break space (U+00A0), so a
237
+ * wrapped line never leaves a unit alone at the start of the next.
224
238
  *
225
239
  * @category Unit
226
240
  */
@@ -263,6 +277,14 @@ interface FormatQuantityOptions {
263
277
  as?: string;
264
278
  /** Override the kind's decimal places. */
265
279
  decimals?: number;
280
+ /**
281
+ * How many units a duration is written in, the largest and then each smaller
282
+ * one down to seconds: `3` writes `1d 1h 28min`, `4` writes `1d 1h 28min 5s`,
283
+ * and a unit that is zero at the end is left off. Two when omitted. Useful
284
+ * where two durations that are written alike, such as the two ends of a
285
+ * range, need telling apart. Used by {@link Band} through its shared format.
286
+ */
287
+ durationUnits?: number;
266
288
  /**
267
289
  * The unit the last render settled on, read from the formatted quantity's
268
290
  * `rung`. A rung is one unit on the ladder a kind of quantity climbs as it
@@ -325,4 +347,4 @@ declare function quantityScale(reference: {
325
347
  unit: string;
326
348
  } | null | undefined, opts?: FormatQuantityOptions): QuantityScale;
327
349
 
328
- export { type ConversionTargetsOfKind as C, type FormatQuantityOptions as F, type KindOfGroup as K, type LadderName as L, type PresentableAs as P, type QuantityKind as Q, type Rung as R, type SymbolsOfKind as S, type UnitGroupKey as U, type FormatsFor as a, type FormatsForKind as b, type PresentableAsKind as c, type KindOfSymbol as d, type KnownQuantityKind as e, type LadderOfSymbol as f, type QuantityScale as g, speakQuantity as h, quantityScale as q, setQuantityLocale as s, writeQuantity as w };
350
+ export { type ConversionTargetsOfKind as C, type FormatQuantityOptions as F, type KindOfGroup as K, type LadderName as L, type PresentableAs as P, type QuantityKind as Q, type Rung as R, type SymbolsOfKind as S, type UnitGroupKey as U, type FormatsFor as a, type FormatsForKind as b, type PresentableAsKind as c, type KindOfSymbol as d, type KnownQuantityKind as e, type LadderOfSymbol as f, type QuantityScale as g, speakFullDuration as h, speakQuantity as i, quantityScale as q, setQuantityLocale as s, writeQuantity as w };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@ksp-gonogo/ui-kit",
3
3
  "description": "Export-safe design system for Gonogo mission-control widgets and third-party Uplinks",
4
4
  "license": "MIT",
5
- "version": "1.0.0",
5
+ "version": "2.0.0-rc.51",
6
6
  "type": "module",
7
7
  "repository": {
8
8
  "type": "git",
@@ -34,6 +34,10 @@
34
34
  "types": "./dist/guards.d.ts",
35
35
  "import": "./dist/guards.js"
36
36
  },
37
+ "./null-display": {
38
+ "types": "./dist/nullDisplay.d.ts",
39
+ "import": "./dist/nullDisplay.js"
40
+ },
37
41
  "./reads-index.json": "./dist/reads-index.json"
38
42
  },
39
43
  "types": "./dist/index.d.ts",
@@ -78,7 +82,7 @@
78
82
  "jest-axe": "^10.0.0",
79
83
  "react": "^18.0.0",
80
84
  "styled-components": "^6.0.0",
81
- "@ksp-gonogo/sitrep-sdk": "1.0.0"
85
+ "@ksp-gonogo/sitrep-sdk": "2.0.0-rc.51"
82
86
  },
83
87
  "peerDependenciesMeta": {
84
88
  "jest-axe": {
@@ -87,5 +91,6 @@
87
91
  "@fontsource/jetbrains-mono": {
88
92
  "optional": true
89
93
  }
90
- }
94
+ },
95
+ "gitHead": "263325f8490d38243d644e5867e978b697a633c1"
91
96
  }