@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.
- package/bundle/openbridge-webcomponents.bundle.js +12321 -11895
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +227 -3
- package/dist/building-blocks/readout-block/readout-block.css.js +53 -19
- package/dist/building-blocks/readout-block/readout-block.css.js.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.d.ts +55 -0
- package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.js +57 -2
- package/dist/building-blocks/readout-block/readout-block.js.map +1 -1
- package/dist/navigation-instruments/readout/readout-shared.d.ts +23 -0
- package/dist/navigation-instruments/readout/readout-shared.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout-shared.js +8 -0
- package/dist/navigation-instruments/readout/readout-shared.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.css.js +138 -31
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts +63 -3
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +127 -27
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +64 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts +77 -2
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js +100 -23
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/package.json +1 -1
- package/src/building-blocks/readout-block/readout-block.css +49 -20
- package/src/building-blocks/readout-block/readout-block.stories.ts +54 -0
- package/src/building-blocks/readout-block/readout-block.ts +101 -2
- package/src/navigation-instruments/instrument-field/instrument-field.stories.ts +1150 -180
- package/src/navigation-instruments/readout/readout-shared.spec.ts +50 -0
- package/src/navigation-instruments/readout/readout-shared.ts +33 -0
- package/src/navigation-instruments/readout/readout.css +124 -32
- package/src/navigation-instruments/readout/readout.stories.ts +536 -19
- package/src/navigation-instruments/readout/readout.ts +184 -31
- package/src/navigation-instruments/readout-list-item/readout-list-item.css +55 -1
- package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +341 -0
- package/src/navigation-instruments/readout-list-item/readout-list-item.ts +169 -25
|
@@ -5,8 +5,10 @@ import {
|
|
|
5
5
|
ReadoutBlockVariant,
|
|
6
6
|
ReadoutBlockSize,
|
|
7
7
|
ReadoutBlockDataQuality,
|
|
8
|
+
ReadoutAdviceCategory,
|
|
8
9
|
ObcTextboxFontWeight,
|
|
9
10
|
ObcTextboxAlignment,
|
|
11
|
+
ObcTextboxSize,
|
|
10
12
|
ReadoutValueType,
|
|
11
13
|
} from './readout-block.js';
|
|
12
14
|
import './readout-block.js';
|
|
@@ -25,6 +27,9 @@ type BlockArgs = {
|
|
|
25
27
|
value: number | string | null;
|
|
26
28
|
valueType: ReadoutValueType;
|
|
27
29
|
size: ReadoutBlockSize;
|
|
30
|
+
valueSize: ObcTextboxSize;
|
|
31
|
+
category: ReadoutAdviceCategory;
|
|
32
|
+
active: boolean;
|
|
28
33
|
enhanced: boolean;
|
|
29
34
|
weight: ObcTextboxFontWeight;
|
|
30
35
|
hasDegree: boolean;
|
|
@@ -56,6 +61,9 @@ function renderBlock(args: Partial<BlockArgs>) {
|
|
|
56
61
|
.value=${args.value as number | string | null}
|
|
57
62
|
.valueType=${args.valueType ?? ReadoutValueType.number}
|
|
58
63
|
.size=${args.size ?? ReadoutBlockSize.small}
|
|
64
|
+
.valueSize=${args.valueSize}
|
|
65
|
+
.category=${args.category ?? ReadoutAdviceCategory.regular}
|
|
66
|
+
.active=${args.active ?? false}
|
|
59
67
|
.enhanced=${args.enhanced ?? false}
|
|
60
68
|
.weight=${args.weight ?? ObcTextboxFontWeight.regular}
|
|
61
69
|
.hasDegree=${args.hasDegree ?? false}
|
|
@@ -716,3 +724,49 @@ export const Alert: Story = {
|
|
|
716
724
|
</div>
|
|
717
725
|
`,
|
|
718
726
|
};
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Advice semantic categories (Figma 6.1 Readout-block-advice). Resting
|
|
730
|
+
* categories carry a neutral outline marker; `active` swaps in the filled /
|
|
731
|
+
* status icon: SemiBold + tinted diamond for regular / optimal / eco, the
|
|
732
|
+
* coloured IEC status icon + active text colour for the alert categories.
|
|
733
|
+
*/
|
|
734
|
+
export const AdviceCategories: Story = {
|
|
735
|
+
render: () =>
|
|
736
|
+
renderShowcase(
|
|
737
|
+
Object.values(ReadoutAdviceCategory).flatMap((category) =>
|
|
738
|
+
[false, true].map((active) => ({
|
|
739
|
+
title: `${category}${active ? ' / active' : ''}`,
|
|
740
|
+
args: {
|
|
741
|
+
variant: ReadoutBlockVariant.advice,
|
|
742
|
+
value: 118,
|
|
743
|
+
size: ReadoutBlockSize.medium,
|
|
744
|
+
category,
|
|
745
|
+
active,
|
|
746
|
+
},
|
|
747
|
+
}))
|
|
748
|
+
)
|
|
749
|
+
),
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* The marker icon follows the block's rendered number size, not the readout
|
|
754
|
+
* tier (Figma 6.1): a large-tier readout whose setpoint is de-emphasised to
|
|
755
|
+
* `s` carries the 16px arrow, and the emphasised `l` setpoint the 24px one.
|
|
756
|
+
*/
|
|
757
|
+
export const MarkerIconSizes: Story = {
|
|
758
|
+
render: () =>
|
|
759
|
+
renderShowcase(
|
|
760
|
+
[ObcTextboxSize.s, ObcTextboxSize.m, ObcTextboxSize.l].map(
|
|
761
|
+
(valueSize) => ({
|
|
762
|
+
title: `large tier / valueSize ${valueSize}`,
|
|
763
|
+
args: {
|
|
764
|
+
variant: ReadoutBlockVariant.setpoint,
|
|
765
|
+
value: 120,
|
|
766
|
+
size: ReadoutBlockSize.large,
|
|
767
|
+
valueSize,
|
|
768
|
+
},
|
|
769
|
+
})
|
|
770
|
+
)
|
|
771
|
+
),
|
|
772
|
+
};
|
|
@@ -11,6 +11,15 @@ import {
|
|
|
11
11
|
} from '../../components/textbox/textbox.js';
|
|
12
12
|
import '../../icons/icon-input-right.js';
|
|
13
13
|
import '../../icons/icon-notification-advice.js';
|
|
14
|
+
import '../../icons/icon-notification-advice-active.js';
|
|
15
|
+
import '../../icons/icon-caution-google.js';
|
|
16
|
+
import '../../icons/icon-caution-color-iec.js';
|
|
17
|
+
import '../../icons/icon-warning-unacknowledged-outlined.js';
|
|
18
|
+
import '../../icons/icon-warning-unacknowledged-iec.js';
|
|
19
|
+
import '../../icons/icon-alarm.js';
|
|
20
|
+
import '../../icons/icon-alarm-unacknowledged-iec.js';
|
|
21
|
+
import '../../icons/icon-running.js';
|
|
22
|
+
import '../../icons/icon-running-color-iec.js';
|
|
14
23
|
import {
|
|
15
24
|
formatNumericValue,
|
|
16
25
|
readoutFormattedInteger,
|
|
@@ -72,6 +81,32 @@ export enum ReadoutBlockDataQuality {
|
|
|
72
81
|
invalid = 'invalid',
|
|
73
82
|
}
|
|
74
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Semantic category of an advice block (Figma 6.1 "Readout-block-advice"
|
|
86
|
+
* Value axis). Drives the default marker icon and — while {@link
|
|
87
|
+
* ObcReadoutBlock.active} — the triggered styling:
|
|
88
|
+
* - `regular` / `optimal` / `eco`: the advice diamond; triggered renders the
|
|
89
|
+
* filled diamond (tinted enhanced-blue / mint for optimal / eco) and a
|
|
90
|
+
* SemiBold number.
|
|
91
|
+
* - `caution` / `warning` / `alarm` / `running`: the matching neutral outline
|
|
92
|
+
* icon; triggered swaps in the filled IEC status icon and the active text
|
|
93
|
+
* colour.
|
|
94
|
+
*
|
|
95
|
+
* TODO(designer): the optimal / eco triggered tint covers the whole diamond
|
|
96
|
+
* glyph — the Figma icon tints only the inner plus, which needs a two-tone
|
|
97
|
+
* icon asset; and the advice "Enhanced" state (indent background chip) is not
|
|
98
|
+
* implemented yet. Both flagged as "may change" in the 6.1 review.
|
|
99
|
+
*/
|
|
100
|
+
export enum ReadoutAdviceCategory {
|
|
101
|
+
regular = 'regular',
|
|
102
|
+
optimal = 'optimal',
|
|
103
|
+
eco = 'eco',
|
|
104
|
+
caution = 'caution',
|
|
105
|
+
warning = 'warning',
|
|
106
|
+
alarm = 'alarm',
|
|
107
|
+
running = 'running',
|
|
108
|
+
}
|
|
109
|
+
|
|
75
110
|
/**
|
|
76
111
|
* Pop-up fade phase for a setpoint block. Driven by the parent's setpoint
|
|
77
112
|
* interaction state machine; only meaningful for `role="setpoint"`.
|
|
@@ -195,6 +230,23 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
195
230
|
@property({type: String}) alignment: ObcTextboxAlignment =
|
|
196
231
|
ObcTextboxAlignment.Right;
|
|
197
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Semantic category of an advice block — picks the default marker icon and
|
|
235
|
+
* the {@link active} styling. Only meaningful for `variant="advice"`.
|
|
236
|
+
* @availableWhen variant==advice
|
|
237
|
+
*/
|
|
238
|
+
@property({type: String}) category: ReadoutAdviceCategory =
|
|
239
|
+
ReadoutAdviceCategory.regular;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The advice is triggered: the marker swaps to its filled/status icon and
|
|
243
|
+
* the number takes the category's triggered styling (SemiBold for
|
|
244
|
+
* regular/optimal/eco, active text colour for the alert categories). Only
|
|
245
|
+
* meaningful for `variant="advice"`.
|
|
246
|
+
* @availableWhen variant==advice
|
|
247
|
+
*/
|
|
248
|
+
@property({type: Boolean}) active = false;
|
|
249
|
+
|
|
198
250
|
/** Per-block measurement quality (outline chip). */
|
|
199
251
|
@property({type: String}) dataQuality?: ReadoutBlockDataQuality;
|
|
200
252
|
|
|
@@ -326,7 +378,7 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
326
378
|
if (this.variant === ReadoutBlockVariant.setpoint) {
|
|
327
379
|
fallback = html`<obi-input-right></obi-input-right>`;
|
|
328
380
|
} else if (this.variant === ReadoutBlockVariant.advice) {
|
|
329
|
-
fallback =
|
|
381
|
+
fallback = this.adviceFallbackIcon();
|
|
330
382
|
}
|
|
331
383
|
return html`<span class="block-icon" part="block-icon" aria-hidden="true">
|
|
332
384
|
<slot name="icon" @slotchange=${this.onIconSlotChange}></slot>
|
|
@@ -334,6 +386,40 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
334
386
|
</span>`;
|
|
335
387
|
}
|
|
336
388
|
|
|
389
|
+
/**
|
|
390
|
+
* The advice marker for the current category / triggered state. Resting
|
|
391
|
+
* categories carry a neutral outline glyph (tinted via `currentColor`);
|
|
392
|
+
* triggered alert categories swap to the filled IEC status icon, whose
|
|
393
|
+
* colours are fixed fills and ignore `currentColor` by design.
|
|
394
|
+
*/
|
|
395
|
+
private adviceFallbackIcon(): TemplateResult {
|
|
396
|
+
const active = this.active;
|
|
397
|
+
switch (this.category) {
|
|
398
|
+
case ReadoutAdviceCategory.caution:
|
|
399
|
+
return active
|
|
400
|
+
? html`<obi-caution-color-iec></obi-caution-color-iec>`
|
|
401
|
+
: html`<obi-caution-google></obi-caution-google>`;
|
|
402
|
+
case ReadoutAdviceCategory.warning:
|
|
403
|
+
return active
|
|
404
|
+
? html`<obi-warning-unacknowledged-iec></obi-warning-unacknowledged-iec>`
|
|
405
|
+
: html`<obi-warning-unacknowledged-outlined></obi-warning-unacknowledged-outlined>`;
|
|
406
|
+
case ReadoutAdviceCategory.alarm:
|
|
407
|
+
return active
|
|
408
|
+
? html`<obi-alarm-unacknowledged-iec></obi-alarm-unacknowledged-iec>`
|
|
409
|
+
: html`<obi-alarm></obi-alarm>`;
|
|
410
|
+
case ReadoutAdviceCategory.running:
|
|
411
|
+
return active
|
|
412
|
+
? html`<obi-running-color-iec></obi-running-color-iec>`
|
|
413
|
+
: html`<obi-running></obi-running>`;
|
|
414
|
+
default:
|
|
415
|
+
// regular / optimal / eco share the advice diamond; the triggered tint
|
|
416
|
+
// is applied via CSS on `.block-icon` (see `advice-*` classes).
|
|
417
|
+
return active
|
|
418
|
+
? html`<obi-notification-advice-active></obi-notification-advice-active>`
|
|
419
|
+
: html`<obi-notification-advice></obi-notification-advice>`;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
337
423
|
/**
|
|
338
424
|
* A cap-height `°` column whose width scales with the number size. Inherits the
|
|
339
425
|
* block's colour.
|
|
@@ -370,6 +456,16 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
370
456
|
|
|
371
457
|
override render() {
|
|
372
458
|
const valueSize = this.resolvedValueSize;
|
|
459
|
+
const isAdvice = this.variant === ReadoutBlockVariant.advice;
|
|
460
|
+
// Triggered regular/optimal/eco advice renders SemiBold (Figma 6.1); the
|
|
461
|
+
// alert categories keep the caller's weight and change colour instead.
|
|
462
|
+
const adviceSemibold =
|
|
463
|
+
isAdvice &&
|
|
464
|
+
this.active &&
|
|
465
|
+
(this.category === ReadoutAdviceCategory.regular ||
|
|
466
|
+
this.category === ReadoutAdviceCategory.optimal ||
|
|
467
|
+
this.category === ReadoutAdviceCategory.eco);
|
|
468
|
+
const weight = adviceSemibold ? ObcTextboxFontWeight.semibold : this.weight;
|
|
373
469
|
const formatOptions = this.numericFormatOptions;
|
|
374
470
|
const isTextMode = this.valueType === ReadoutValueType.text;
|
|
375
471
|
// A missing digit knob makes the reading untrustworthy, so it resolves to
|
|
@@ -417,6 +513,9 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
417
513
|
block: true,
|
|
418
514
|
[`block-${this.variant}`]: true,
|
|
419
515
|
[`size-${this.size}`]: true,
|
|
516
|
+
[`value-size-${valueSize}`]: true,
|
|
517
|
+
[`advice-${this.category}`]: isAdvice,
|
|
518
|
+
'advice-active': isAdvice && this.active,
|
|
420
519
|
'tone-enhanced': this.enhanced,
|
|
421
520
|
touching: this.touching,
|
|
422
521
|
'is-hiding': this.hidePhase === ReadoutBlockHidePhase.hiding,
|
|
@@ -431,7 +530,7 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
431
530
|
class="block-text"
|
|
432
531
|
part="block-text"
|
|
433
532
|
.size=${valueSize}
|
|
434
|
-
.fontWeight=${
|
|
533
|
+
.fontWeight=${weight}
|
|
435
534
|
.alignment=${this.alignment}
|
|
436
535
|
.tabularNums=${true}
|
|
437
536
|
>
|