@oicl/openbridge-webcomponents 2.0.0-next.127 → 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 (32) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +12376 -11906
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +260 -6
  4. package/dist/building-blocks/chart-line/chart-line-base.d.ts +10 -2
  5. package/dist/building-blocks/chart-line/chart-line-base.d.ts.map +1 -1
  6. package/dist/building-blocks/chart-line/chart-line-base.js +27 -8
  7. package/dist/building-blocks/chart-line/chart-line-base.js.map +1 -1
  8. package/dist/building-blocks/readout-block/readout-block.css.js +53 -19
  9. package/dist/building-blocks/readout-block/readout-block.css.js.map +1 -1
  10. package/dist/building-blocks/readout-block/readout-block.d.ts +55 -0
  11. package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
  12. package/dist/building-blocks/readout-block/readout-block.js +57 -2
  13. package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
  14. package/dist/charthelpers/chart-common.css.js +28 -3
  15. package/dist/charthelpers/chart-common.css.js.map +1 -1
  16. package/dist/navigation-instruments/readout/readout-shared.d.ts +23 -0
  17. package/dist/navigation-instruments/readout/readout-shared.d.ts.map +1 -1
  18. package/dist/navigation-instruments/readout/readout-shared.js +8 -0
  19. package/dist/navigation-instruments/readout/readout-shared.js.map +1 -1
  20. package/dist/navigation-instruments/readout/readout.css.js +138 -31
  21. package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
  22. package/dist/navigation-instruments/readout/readout.d.ts +63 -3
  23. package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
  24. package/dist/navigation-instruments/readout/readout.js +127 -27
  25. package/dist/navigation-instruments/readout/readout.js.map +1 -1
  26. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +64 -1
  27. package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
  28. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts +77 -2
  29. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
  30. package/dist/navigation-instruments/readout-list-item/readout-list-item.js +100 -23
  31. package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
  32. package/package.json +1 -1
@@ -4,17 +4,18 @@ import { classMap } from "lit/directives/class-map.js";
4
4
  import componentStyle from "./readout.css.js";
5
5
  import { customElement } from "../../decorator.js";
6
6
  import { ObcTextboxFontWeight, ObcTextboxSize } from "../../components/textbox/textbox.js";
7
- import { ReadoutBlockHidePhase, ReadoutBlockSize, ReadoutBlockVariant, ReadoutBlockDataQuality } from "../../building-blocks/readout-block/readout-block.js";
8
- import { ReadoutListItemSetpointInteraction } from "../readout-list-item/readout-list-item.js";
7
+ import { ReadoutBlockHidePhase, ReadoutBlockSize, ReadoutBlockVariant, ReadoutAdviceCategory, ReadoutBlockDataQuality } from "../../building-blocks/readout-block/readout-block.js";
8
+ import { ReadoutListItemSetpointInteraction, ReadoutSourceState } from "../readout-list-item/readout-list-item.js";
9
9
  import { Priority } from "../types.js";
10
10
  import { ReadoutValueType, resolveReadoutDigitCount, isReadoutDigitCountMissing, resolveReadoutNumericValue, assertReadoutValueType, assertReadoutFractionDigits } from "./readout-formatters.js";
11
- import { isDisplayedAtSetpoint, readoutPrimarySize, readoutSecondarySize, readoutSetpointWeight, readoutNumericFormatOptions, readoutDataQualityClasses, resolveSetpointHidePhase } from "./readout-shared.js";
11
+ import { isDisplayedAtSetpoint, readoutPrimarySize, readoutSecondarySize, readoutValueSize, readoutSetpointSize, readoutSetpointWeight, readoutNumericFormatOptions, readoutDataQualityClasses, resolveSetpointHidePhase } from "./readout-shared.js";
12
12
  import { wrapWithAlertFrame, ObcAlertFrameThickness, ObcAlertFrameType, ObcAlertFrameMode } from "../../components/alert-frame/alert-frame.js";
13
13
  import { AlertType } from "../../types.js";
14
14
  import "../../components/button/button.js";
15
15
  import { ContextMenuType } from "../../components/context-menu-input/context-menu-input.js";
16
16
  import "../../icons/icon-chevron-right-google.js";
17
17
  import "../../icons/icon-drop-down-google.js";
18
+ import "../../icons/icon-delta.js";
18
19
  var __defProp = Object.defineProperty;
19
20
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
20
21
  var __decorateClass = (decorators, target, key, kind) => {
@@ -63,6 +64,7 @@ let ObcReadout = class extends LitElement {
63
64
  this.hasAdvice = false;
64
65
  this.hasDegree = false;
65
66
  this.hasDegreeSpacer = false;
67
+ this.hasLeadingIcon = false;
66
68
  this.fractionDigits = 0;
67
69
  this.maxDigits = 0;
68
70
  this.alert = false;
@@ -97,6 +99,9 @@ let ObcReadout = class extends LitElement {
97
99
  };
98
100
  }
99
101
  get resolvedSize() {
102
+ if (this.isHorizontal) {
103
+ return ReadoutSize.large;
104
+ }
100
105
  return this.size ?? ReadoutSize.small;
101
106
  }
102
107
  get resolvedPriority() {
@@ -155,6 +160,9 @@ let ObcReadout = class extends LitElement {
155
160
  get isFlipFlop() {
156
161
  return this.resolvedSetpointInteraction === ReadoutSetpointInteraction.flipFlop;
157
162
  }
163
+ get isEqualSize() {
164
+ return this.resolvedSetpointInteraction === ReadoutSetpointInteraction.equalSize;
165
+ }
158
166
  get isPopUp() {
159
167
  return this.resolvedSetpointInteraction === ReadoutSetpointInteraction.popUp;
160
168
  }
@@ -203,18 +211,45 @@ let ObcReadout = class extends LitElement {
203
211
  return readoutSecondarySize(this.resolvedSize);
204
212
  }
205
213
  get valueSize() {
206
- if (this.isSetpointEmphasized) {
207
- return this.secondarySize;
208
- }
209
- return this.primarySize;
214
+ return readoutValueSize({
215
+ primary: this.primarySize,
216
+ secondary: this.secondarySize,
217
+ setpointEmphasized: this.isSetpointEmphasized,
218
+ equalSize: this.isEqualSize
219
+ });
210
220
  }
211
221
  get setpointSize() {
212
- return this.isSetpointEmphasized ? this.primarySize : this.secondarySize;
222
+ return readoutSetpointSize({
223
+ primary: this.primarySize,
224
+ secondary: this.secondarySize,
225
+ emphasized: this.isSetpointEmphasized,
226
+ equalSize: this.isEqualSize
227
+ });
213
228
  }
214
229
  /** Value font weight passes straight to obc-textbox; regular when unset. Colour is separate. */
215
230
  get valueWeight() {
216
231
  return this.valueOptions?.weight ?? ObcTextboxFontWeight.regular;
217
232
  }
233
+ /**
234
+ * Label size. The Figma 6.1 title block defaults large readouts to `s` — a
235
+ * scannable label should not sit at the smallest permitted size — while
236
+ * small/medium tiers stay `xs`; `labelOptions.size` overrides either way
237
+ * (per the design team, for context / density / secondary instruments).
238
+ * The `s` default was confirmed by the design team (2026-08-17).
239
+ * TODO(designer): the medium-tier default is unverified in the new sheets
240
+ * (only XS and S exist on the title's size axis).
241
+ */
242
+ get labelSize() {
243
+ return this.labelOptions?.size ?? (this.resolvedSize === ReadoutSize.large ? ObcTextboxSize.s : ObcTextboxSize.xs);
244
+ }
245
+ /**
246
+ * Label weight: SemiBold only for enhanced (in-command) readouts, regular
247
+ * otherwise — the designer reduced the amount of semibold in the interface
248
+ * (Figma 6.1 review).
249
+ */
250
+ get labelWeight() {
251
+ return this.rowEnhanced ? ObcTextboxFontWeight.semibold : ObcTextboxFontWeight.regular;
252
+ }
218
253
  /** Setpoint is SemiBold only while emphasised, otherwise regular weight. */
219
254
  get setpointWeight() {
220
255
  return readoutSetpointWeight(this.isSetpointEmphasized);
@@ -263,6 +298,8 @@ let ObcReadout = class extends LitElement {
263
298
  .hidePhase=${config.hidePhase ?? ReadoutBlockHidePhase.none}
264
299
  .dataQuality=${config.dataQuality}
265
300
  .alert=${config.alert ?? false}
301
+ .category=${config.category ?? ReadoutAdviceCategory.regular}
302
+ .active=${config.active ?? false}
266
303
  >
267
304
  ${config.ghost ? nothing : this.renderForwardedIcon(config.variant)}
268
305
  </obc-readout-block>
@@ -311,7 +348,8 @@ let ObcReadout = class extends LitElement {
311
348
  return nothing;
312
349
  }
313
350
  renderTextbox(role, text, reserver, blockState) {
314
- const weight = role === "label" ? ObcTextboxFontWeight.semibold : ObcTextboxFontWeight.regular;
351
+ const weight = role === "label" ? this.labelWeight : ObcTextboxFontWeight.regular;
352
+ const size = role === "label" ? this.labelSize : ObcTextboxSize.xs;
315
353
  const box = html`
316
354
  <obc-textbox
317
355
  class=${classMap({
@@ -319,7 +357,7 @@ let ObcReadout = class extends LitElement {
319
357
  ...this.dataQualityClasses(blockState?.dataQuality)
320
358
  })}
321
359
  part=${role}
322
- .size=${ObcTextboxSize.xs}
360
+ .size=${size}
323
361
  .fontWeight=${weight}
324
362
  alignment="left"
325
363
  >
@@ -336,6 +374,11 @@ let ObcReadout = class extends LitElement {
336
374
  this.deferredSetpointHidePhase
337
375
  );
338
376
  }
377
+ // `hasDegree` is deliberately NOT forwarded to the advice / setpoint blocks:
378
+ // the degree glyph renders on the actual value only (Figma 6.1 review,
379
+ // 2026-08-18) — the unit is written once for the whole readout, and the
380
+ // degree follows the same rule; the setpoint / advice implicitly share it.
381
+ // `obc-readout-list-item` keeps its own per-row convention.
339
382
  renderAdviceBlock() {
340
383
  return this.renderBlock({
341
384
  variant: ReadoutBlockVariant.advice,
@@ -345,9 +388,10 @@ let ObcReadout = class extends LitElement {
345
388
  weight: ObcTextboxFontWeight.regular,
346
389
  hintedZeros: this.adviceOptions?.hintedZeros ?? false,
347
390
  spaceReserver: this.adviceOptions?.spaceReserver,
348
- hasDegree: this.hasDegree ?? false,
349
391
  dataQuality: this.adviceOptions?.dataQuality,
350
- alert: this.adviceOptions?.alert
392
+ alert: this.adviceOptions?.alert,
393
+ category: this.adviceOptions?.category,
394
+ active: this.adviceOptions?.active
351
395
  });
352
396
  }
353
397
  renderSetpointBlock() {
@@ -361,7 +405,6 @@ let ObcReadout = class extends LitElement {
361
405
  weight: this.setpointWeight,
362
406
  hintedZeros: this.setpointOptions?.hintedZeros ?? false,
363
407
  spaceReserver: this.setpointOptions?.spaceReserver,
364
- hasDegree: this.hasDegree ?? false,
365
408
  touching: this.setpointTouching,
366
409
  hidePhase: this.setpointHidePhase,
367
410
  dataQuality: this.setpointOptions?.dataQuality,
@@ -455,12 +498,21 @@ let ObcReadout = class extends LitElement {
455
498
  })}
456
499
  part="meta-wrapper"
457
500
  >
458
- ${this.label ? this.renderTextbox("label", this.label) : nothing}
459
- ${this.unit ? this.renderTextbox(
501
+ ${this.hasLeadingIcon ? html`<span class="leading-icon" aria-hidden="true"
502
+ ><slot name="leading-icon"></slot
503
+ ></span>` : nothing}
504
+ <div class="meta-labels" part="meta-labels">
505
+ ${this.label ? this.renderTextbox(
506
+ "label",
507
+ this.label,
508
+ this.labelOptions?.spaceReserver
509
+ ) : nothing}
510
+ ${this.unit ? this.renderTextbox(
460
511
  "unit",
461
512
  this.unit,
462
513
  this.unitOptions?.spaceReserver
463
514
  ) : nothing}
515
+ </div>
464
516
  </div>
465
517
  `;
466
518
  }
@@ -513,28 +565,67 @@ let ObcReadout = class extends LitElement {
513
565
  `;
514
566
  return wrapWithAlertFrame(this.srcOptions?.alert ?? false, button);
515
567
  }
516
- return this.renderTextbox(
568
+ return this.renderSourceBlock(src);
569
+ }
570
+ /**
571
+ * The plain (non-interactive) source: the textbox plus its optional state
572
+ * chip and deviation line. The regular no-deviation case renders the bare
573
+ * textbox — the pre-6.1 output; a state or deviation wraps it in the
574
+ * `.source-block` stack. The picker / flyout button variants do not carry
575
+ * state / deviation yet — TODO(designer): undefined in the 6.1 sheets.
576
+ */
577
+ renderSourceBlock(src) {
578
+ const state2 = this.srcOptions?.state ?? ReadoutSourceState.regular;
579
+ const deviation = this.srcOptions?.deviation;
580
+ const hasDeviation = deviation !== void 0 && Number.isFinite(deviation);
581
+ const box = this.renderTextbox(
517
582
  "source",
518
583
  src,
519
584
  this.srcOptions?.spaceReserver,
520
585
  this.srcOptions
521
586
  );
587
+ if (state2 === ReadoutSourceState.regular && !hasDeviation) {
588
+ return box;
589
+ }
590
+ return html`
591
+ <div
592
+ class=${classMap({
593
+ "source-block": true,
594
+ [`source-state-${state2}`]: state2 !== ReadoutSourceState.regular
595
+ })}
596
+ part="source-block"
597
+ >
598
+ ${box}
599
+ ${hasDeviation ? html`<span class="source-deviation">
600
+ <obi-delta aria-hidden="true"></obi-delta>
601
+ <obc-textbox
602
+ class="source-deviation-value"
603
+ .size=${ObcTextboxSize.xs}
604
+ .tabularNums=${true}
605
+ alignment="left"
606
+ >${deviation}</obc-textbox
607
+ >
608
+ </span>` : nothing}
609
+ </div>
610
+ `;
522
611
  }
523
- /** The source row (vertical) / segment (horizontal), with its auto divider. */
612
+ /**
613
+ * The source row (vertical) / segment (horizontal). Only the horizontal
614
+ * direction draws an auto divider before the source — the Figma 6.1 review
615
+ * (node 95:24490 "remove dividers", 95:26891 "Source-divider are there")
616
+ * keeps the vertical source row divider-free while the horizontal flow
617
+ * separates the source with a vertical rule.
618
+ */
524
619
  renderSource() {
525
620
  if (!this.hasSrc) {
526
621
  return nothing;
527
622
  }
528
623
  return html`
529
- <div
530
- class=${classMap({
531
- divider: true,
532
- "divider-horizontal": !this.isHorizontal,
533
- "divider-vertical": this.isHorizontal
534
- })}
535
- part="divider"
536
- aria-hidden="true"
537
- ></div>
624
+ ${this.isHorizontal ? html`<div
625
+ class="divider divider-vertical"
626
+ part="divider"
627
+ aria-hidden="true"
628
+ ></div>` : nothing}
538
629
  <div class="source-row" part="source-wrapper">
539
630
  ${this.renderSourceContent()}
540
631
  </div>
@@ -657,10 +748,11 @@ let ObcReadout = class extends LitElement {
657
748
  valueSize: this.primarySize,
658
749
  enhanced: false,
659
750
  // The emphasised setpoint is SemiBold — reserve its widest form.
751
+ // No degree: the visible setpoint block carries none (the degree
752
+ // renders on the actual value only), so the ghost mirrors it.
660
753
  weight: ObcTextboxFontWeight.semibold,
661
754
  hintedZeros: this.setpointOptions?.hintedZeros ?? false,
662
755
  spaceReserver: this.setpointOptions?.spaceReserver,
663
- hasDegree: this.hasDegree ?? false,
664
756
  alert: this.setpointOptions?.alert,
665
757
  ghost: true
666
758
  }) : html`${this.renderBlock({
@@ -866,6 +958,9 @@ __decorateClass([
866
958
  __decorateClass([
867
959
  property({ type: Boolean })
868
960
  ], ObcReadout.prototype, "hasDegreeSpacer", 2);
961
+ __decorateClass([
962
+ property({ type: Boolean })
963
+ ], ObcReadout.prototype, "hasLeadingIcon", 2);
869
964
  __decorateClass([
870
965
  property({ type: Number })
871
966
  ], ObcReadout.prototype, "fractionDigits", 2);
@@ -887,6 +982,9 @@ __decorateClass([
887
982
  __decorateClass([
888
983
  property({ type: Object })
889
984
  ], ObcReadout.prototype, "adviceOptions", 2);
985
+ __decorateClass([
986
+ property({ type: Object })
987
+ ], ObcReadout.prototype, "labelOptions", 2);
890
988
  __decorateClass([
891
989
  property({ type: Object })
892
990
  ], ObcReadout.prototype, "unitOptions", 2);
@@ -914,6 +1012,7 @@ ObcReadout = __decorateClass([
914
1012
  export {
915
1013
  ObcReadout,
916
1014
  ObcTextboxFontWeight,
1015
+ ReadoutAdviceCategory,
917
1016
  ReadoutAlignment,
918
1017
  ReadoutDataQuality,
919
1018
  ReadoutDirection,
@@ -921,6 +1020,7 @@ export {
921
1020
  ReadoutSetpointInteraction,
922
1021
  ReadoutSize,
923
1022
  ReadoutSourceInteraction,
1023
+ ReadoutSourceState,
924
1024
  ReadoutStacking,
925
1025
  ReadoutValueType
926
1026
  };