@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.128 → 2.0.0-next.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +12321 -11895
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +227 -3
  4. package/dist/building-blocks/readout-block/readout-block.css.js +53 -19
  5. package/dist/building-blocks/readout-block/readout-block.css.js.map +1 -1
  6. package/dist/building-blocks/readout-block/readout-block.d.ts +55 -0
  7. package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
  8. package/dist/building-blocks/readout-block/readout-block.js +57 -2
  9. package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
  10. package/dist/navigation-instruments/readout/readout-shared.d.ts +23 -0
  11. package/dist/navigation-instruments/readout/readout-shared.d.ts.map +1 -1
  12. package/dist/navigation-instruments/readout/readout-shared.js +8 -0
  13. package/dist/navigation-instruments/readout/readout-shared.js.map +1 -1
  14. package/dist/navigation-instruments/readout/readout.css.js +138 -31
  15. package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
  16. package/dist/navigation-instruments/readout/readout.d.ts +63 -3
  17. package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
  18. package/dist/navigation-instruments/readout/readout.js +127 -27
  19. package/dist/navigation-instruments/readout/readout.js.map +1 -1
  20. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +64 -1
  21. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
  22. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts +77 -2
  23. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
  24. package/dist/navigation-instruments/readout-list-item/readout-list-item.js +100 -23
  25. package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/building-blocks/readout-block/readout-block.css +49 -20
  28. package/src/building-blocks/readout-block/readout-block.stories.ts +54 -0
  29. package/src/building-blocks/readout-block/readout-block.ts +101 -2
  30. package/src/navigation-instruments/instrument-field/instrument-field.stories.ts +1150 -180
  31. package/src/navigation-instruments/readout/readout-shared.spec.ts +50 -0
  32. package/src/navigation-instruments/readout/readout-shared.ts +33 -0
  33. package/src/navigation-instruments/readout/readout.css +124 -32
  34. package/src/navigation-instruments/readout/readout.stories.ts +536 -19
  35. package/src/navigation-instruments/readout/readout.ts +184 -31
  36. package/src/navigation-instruments/readout-list-item/readout-list-item.css +55 -1
  37. package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +341 -0
  38. package/src/navigation-instruments/readout-list-item/readout-list-item.ts +169 -25
@@ -13,6 +13,8 @@ import {
13
13
  isDisplayedAtSetpoint,
14
14
  readoutPrimarySize,
15
15
  readoutSecondarySize,
16
+ readoutSetpointSize,
17
+ readoutValueSize,
16
18
  readoutSetpointWeight,
17
19
  readoutDataQualityClasses,
18
20
  resolveSetpointHidePhase,
@@ -91,6 +93,54 @@ describe('readoutPrimarySize / readoutSecondarySize', () => {
91
93
  });
92
94
  });
93
95
 
96
+ describe('readoutSetpointSize', () => {
97
+ const sizes = {primary: ObcTextboxSize.l, secondary: ObcTextboxSize.s};
98
+
99
+ it('is secondary at rest (primary-secondary convention)', () => {
100
+ expect(
101
+ readoutSetpointSize({...sizes, emphasized: false, equalSize: false})
102
+ ).toBe(ObcTextboxSize.s);
103
+ });
104
+
105
+ it('is primary while emphasised OR in equal-size, including both at once', () => {
106
+ expect(
107
+ readoutSetpointSize({...sizes, emphasized: true, equalSize: false})
108
+ ).toBe(ObcTextboxSize.l);
109
+ expect(
110
+ readoutSetpointSize({...sizes, emphasized: false, equalSize: true})
111
+ ).toBe(ObcTextboxSize.l);
112
+ // Touching an equal-size setpoint must not demote it.
113
+ expect(
114
+ readoutSetpointSize({...sizes, emphasized: true, equalSize: true})
115
+ ).toBe(ObcTextboxSize.l);
116
+ });
117
+ });
118
+
119
+ describe('readoutValueSize', () => {
120
+ const sizes = {primary: ObcTextboxSize.l, secondary: ObcTextboxSize.s};
121
+
122
+ it('is primary at rest and secondary while the setpoint is emphasised', () => {
123
+ expect(
124
+ readoutValueSize({...sizes, setpointEmphasized: false, equalSize: false})
125
+ ).toBe(ObcTextboxSize.l);
126
+ expect(
127
+ readoutValueSize({...sizes, setpointEmphasized: true, equalSize: false})
128
+ ).toBe(ObcTextboxSize.s);
129
+ });
130
+
131
+ it('never demotes in equal-size — not even while touching', () => {
132
+ // Both blocks holding the primary size IS the mode; a touch-driven
133
+ // demotion would silently turn equal-size into primary-secondary for the
134
+ // whole adjustment.
135
+ expect(
136
+ readoutValueSize({...sizes, setpointEmphasized: true, equalSize: true})
137
+ ).toBe(ObcTextboxSize.l);
138
+ expect(
139
+ readoutValueSize({...sizes, setpointEmphasized: false, equalSize: true})
140
+ ).toBe(ObcTextboxSize.l);
141
+ });
142
+ });
143
+
94
144
  describe('readoutSetpointWeight', () => {
95
145
  it('is semibold only while emphasised', () => {
96
146
  expect(readoutSetpointWeight(true)).toBe(ObcTextboxFontWeight.semibold);
@@ -112,6 +112,39 @@ export function readoutSecondarySize(size: ReadoutBlockSize): ObcTextboxSize {
112
112
  }
113
113
  }
114
114
 
115
+ /**
116
+ * The setpoint block's typography size: primary while emphasised (touching /
117
+ * flip-flop away from setpoint) or in the `equal-size` interaction, secondary
118
+ * otherwise.
119
+ */
120
+ export function readoutSetpointSize(options: {
121
+ primary: ObcTextboxSize;
122
+ secondary: ObcTextboxSize;
123
+ emphasized: boolean;
124
+ equalSize: boolean;
125
+ }): ObcTextboxSize {
126
+ return options.emphasized || options.equalSize
127
+ ? options.primary
128
+ : options.secondary;
129
+ }
130
+
131
+ /**
132
+ * The value block's typography size: secondary while the setpoint is the
133
+ * focus of attention (touching / flip-flop away from setpoint) — EXCEPT in
134
+ * the `equal-size` interaction, whose whole point is that both blocks hold
135
+ * the primary size; there the value never demotes, not even while touching.
136
+ */
137
+ export function readoutValueSize(options: {
138
+ primary: ObcTextboxSize;
139
+ secondary: ObcTextboxSize;
140
+ setpointEmphasized: boolean;
141
+ equalSize: boolean;
142
+ }): ObcTextboxSize {
143
+ return options.setpointEmphasized && !options.equalSize
144
+ ? options.secondary
145
+ : options.primary;
146
+ }
147
+
115
148
  /** Setpoint is SemiBold only while emphasised, otherwise regular weight. */
116
149
  export function readoutSetpointWeight(
117
150
  emphasized: boolean
@@ -41,7 +41,7 @@ obc-readout-block {
41
41
  );
42
42
  --obc-readout-block-hinted-color: var(
43
43
  --obc-readout-hinted-color,
44
- var(--element-inactive-color)
44
+ var(--element-disabled-color)
45
45
  );
46
46
  }
47
47
 
@@ -252,37 +252,83 @@ obc-readout-block {
252
252
  );
253
253
  }
254
254
 
255
- /* ---------- Meta zone (label + unit) ---------- */
255
+ /* ---------- Meta zone (label + unit) ----------
256
+ * `.meta` is a row hosting the optional leading icon and `.meta-labels`; the
257
+ * inline/stacked arrangement applies to `.meta-labels` (the label/unit pair). */
256
258
  .meta {
257
259
  display: inline-flex;
260
+ flex-direction: row;
261
+ align-items: center;
262
+ gap: var(--instrument-components-readout-new-general-regular-icon-gap);
258
263
  padding-inline: var(--_readout-trim);
259
264
  }
260
265
 
261
- .meta.meta-inline {
266
+ .meta .leading-icon {
267
+ display: inline-flex;
268
+ align-items: center;
269
+ justify-content: center;
270
+ flex: none;
271
+ color: var(--element-neutral-color);
272
+ }
273
+ .meta .leading-icon ::slotted(*) {
274
+ display: block;
275
+ inline-size: 100%;
276
+ block-size: 100%;
277
+ }
278
+ .readout.size-small .meta .leading-icon {
279
+ inline-size: var(
280
+ --instrument-components-readout-new-general-regular-icon-size
281
+ );
282
+ block-size: var(
283
+ --instrument-components-readout-new-general-regular-icon-size
284
+ );
285
+ }
286
+ .readout.size-medium .meta .leading-icon {
287
+ inline-size: var(
288
+ --instrument-components-readout-new-general-medium-icon-size
289
+ );
290
+ block-size: var(--instrument-components-readout-new-general-medium-icon-size);
291
+ }
292
+ .readout.size-large .meta .leading-icon {
293
+ inline-size: var(--instrument-components-readout-new-general-large-icon-size);
294
+ block-size: var(--instrument-components-readout-new-general-large-icon-size);
295
+ }
296
+
297
+ .meta-labels {
298
+ display: inline-flex;
299
+ }
300
+
301
+ .meta-inline .meta-labels {
262
302
  flex-direction: row;
263
- align-items: flex-start;
303
+ /* Bottom-align so an `s` label and its `xs` unit share a baseline (the
304
+ Figma title block is items-end); identical to the old flex-start while
305
+ both were `xs`. */
306
+ align-items: flex-end;
264
307
  gap: var(--global-size-spacing-target-padding);
265
308
  }
266
309
 
267
- .meta.meta-stacked {
310
+ .meta-stacked .meta-labels {
268
311
  flex-direction: column;
269
312
  align-items: flex-end;
270
313
  }
271
314
 
272
- .readout.direction-vertical.alignment-left .meta.meta-stacked {
315
+ .readout.direction-vertical.alignment-left .meta-stacked .meta-labels {
273
316
  align-items: flex-start;
274
317
  }
275
318
 
276
- .readout.direction-vertical.alignment-center .meta.meta-stacked {
319
+ .readout.direction-vertical.alignment-center .meta-stacked .meta-labels {
277
320
  align-items: center;
278
321
  }
279
322
 
280
323
  /* Horizontal: the label/unit column sits beside the value, top-aligned within
281
324
  the row so the label reads first. */
282
325
  .readout.direction-horizontal .meta.meta-stacked {
283
- align-items: flex-start;
284
326
  align-self: center;
285
327
 
328
+ & .meta-labels {
329
+ align-items: flex-start;
330
+ }
331
+
286
332
  &.label-only {
287
333
  align-self: flex-start;
288
334
  }
@@ -292,6 +338,20 @@ obc-readout-block {
292
338
  }
293
339
  }
294
340
 
341
+ /* Cap alignment beside the value (Figma 6.1 review): the label's cap TOP and
342
+ the unit's cap BOTTOM line up with the value's cap edges. The stack is
343
+ pinned to the value's container height with space-between — every textbox
344
+ carries a fixed 4px pad above/below its cap, exactly like the value box, so
345
+ pinning the boxes to the container edges aligns the caps for any label/unit
346
+ size. Only when both lines exist: a single line keeps its edge alignment
347
+ from the rules above. */
348
+ .readout.direction-horizontal
349
+ .meta.meta-stacked:not(.label-only):not(.unit-only)
350
+ .meta-labels {
351
+ block-size: var(--_readout-primary-height);
352
+ justify-content: space-between;
353
+ }
354
+
295
355
  .label {
296
356
  color: var(--obc-readout-label-color, var(--element-neutral-color));
297
357
  }
@@ -328,6 +388,60 @@ obc-readout-block {
328
388
  outline-color: var(--alert-invalid-border-color);
329
389
  }
330
390
 
391
+ /* ---------- Source state chip & deviation (Figma 6.1 Readout-block-source)
392
+ * `enhanced` renders the amplified chip, `caution`/`warning` the alert chip.
393
+ * Like the data-quality chip these use `outline`, so toggling a state never
394
+ * shifts the layout. TODO(designer): Figma pads the chip 4px; a padding here
395
+ * would shift the layout on live state changes, so the chip hugs the text
396
+ * like the data-quality chip does. */
397
+ .source-block {
398
+ display: inline-flex;
399
+ flex-direction: column;
400
+ align-items: flex-start;
401
+ }
402
+ .source-block.source-state-enhanced,
403
+ .source-block.source-state-caution,
404
+ .source-block.source-state-warning {
405
+ outline: 1px solid;
406
+ border-radius: var(--global-border-radius-border-radius-check);
407
+ }
408
+ .source-block.source-state-enhanced {
409
+ background: var(--amplified-enabled-background-color);
410
+ outline-color: var(--amplified-enabled-border-color);
411
+ }
412
+ .source-block.source-state-enhanced .source,
413
+ .source-block.source-state-enhanced .source-deviation {
414
+ color: var(--on-amplified-active-color);
415
+ }
416
+ .source-block.source-state-caution {
417
+ background: var(--alert-caution-color);
418
+ outline-color: var(--alert-caution-outline-color);
419
+ }
420
+ .source-block.source-state-caution .source,
421
+ .source-block.source-state-caution .source-deviation {
422
+ color: var(--on-caution-active-color);
423
+ }
424
+ .source-block.source-state-warning {
425
+ background: var(--alert-warning-color);
426
+ outline-color: var(--alert-warning-outline-color);
427
+ }
428
+ .source-block.source-state-warning .source,
429
+ .source-block.source-state-warning .source-deviation {
430
+ color: var(--on-warning-active-color);
431
+ }
432
+
433
+ .source-deviation {
434
+ display: inline-flex;
435
+ align-items: center;
436
+ gap: 2px;
437
+ color: var(--element-inactive-color);
438
+ }
439
+ .source-deviation obi-delta {
440
+ display: block;
441
+ inline-size: 12px;
442
+ block-size: 12px;
443
+ }
444
+
331
445
  /* ---------- Source row & auto divider ---------- */
332
446
  .source-row {
333
447
  display: inline-flex;
@@ -340,12 +454,8 @@ obc-readout-block {
340
454
  background-color: var(--border-divider-color);
341
455
  }
342
456
 
343
- .divider.divider-horizontal {
344
- inline-size: 100%;
345
- block-size: 1px;
346
- margin-block: var(--_readout-divider-pad);
347
- }
348
-
457
+ /* Only the horizontal direction draws a source divider (Figma 6.1: vertical
458
+ readouts have no rule above the source). */
349
459
  .divider.divider-vertical {
350
460
  inline-size: 1px;
351
461
  align-self: stretch;
@@ -497,9 +607,6 @@ obc-readout-block {
497
607
  --_readout-value-pad-v: var(
498
608
  --instrument-components-readout-new-group-vertical-regular-value-container-padding-vertical
499
609
  );
500
- --_readout-divider-pad: var(
501
- --instrument-components-readout-new-group-vertical-regular-divider-padding
502
- );
503
610
  --_readout-min-height: var(
504
611
  --instrument-components-readout-new-group-vertical-regular-container-min-height
505
612
  );
@@ -524,9 +631,6 @@ obc-readout-block {
524
631
  --_readout-value-pad-v: var(
525
632
  --instrument-components-readout-new-group-vertical-medium-value-container-padding-vertical
526
633
  );
527
- --_readout-divider-pad: var(
528
- --instrument-components-readout-new-group-vertical-medium-divider-padding
529
- );
530
634
  }
531
635
 
532
636
  .readout.direction-vertical.stacking-inline.size-large {
@@ -545,9 +649,6 @@ obc-readout-block {
545
649
  --_readout-value-pad-v: var(
546
650
  --instrument-components-readout-new-group-vertical-enhanced-vertical-value-container-padding-vertical
547
651
  );
548
- --_readout-divider-pad: var(
549
- --instrument-components-readout-new-group-vertical-enhanced-divider-padding
550
- );
551
652
  --_readout-min-height: var(
552
653
  --instrument-components-readout-new-group-vertical-enhanced-container-min-height
553
654
  );
@@ -570,9 +671,6 @@ obc-readout-block {
570
671
  --_readout-value-pad-v: var(
571
672
  --instrument-components-readout-new-stack-regular-value-container-padding-vertical
572
673
  );
573
- --_readout-divider-pad: var(
574
- --instrument-components-readout-new-stack-regular-divider-padding
575
- );
576
674
  --_readout-min-height: var(
577
675
  --instrument-components-readout-new-stack-regular-container-min-height
578
676
  );
@@ -594,9 +692,6 @@ obc-readout-block {
594
692
  --_readout-value-pad-v: var(
595
693
  --instrument-components-readout-new-stack-medium-value-container-padding-vertical
596
694
  );
597
- --_readout-divider-pad: var(
598
- --instrument-components-readout-new-stack-medium-divider-padding
599
- );
600
695
  }
601
696
 
602
697
  .readout.direction-vertical.stacking-stacked.size-large {
@@ -615,9 +710,6 @@ obc-readout-block {
615
710
  --_readout-value-pad-v: var(
616
711
  --instrument-components-readout-new-stack-enhanced-vertical-value-container-padding-vertical
617
712
  );
618
- --_readout-divider-pad: var(
619
- --instrument-components-readout-new-stack-enhanced-divider-padding
620
- );
621
713
  --_readout-min-height: var(
622
714
  --instrument-components-readout-new-stack-enhanced-container-min-height
623
715
  );