@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.128 → 2.0.0-next.130
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 +12332 -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 +62 -0
- package/dist/building-blocks/readout-block/readout-block.d.ts.map +1 -1
- package/dist/building-blocks/readout-block/readout-block.js +68 -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 +112 -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,51 @@ 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 rendered
|
|
393
|
+
* with `useCssColor`, which selects the icon's token-coloured variant
|
|
394
|
+
* (alert fill + on-alert glyph, e.g. `--alert-caution-color` +
|
|
395
|
+
* `--on-caution-active-color`) — without it the same icon is a
|
|
396
|
+
* single-colour `currentColor` silhouette. This mirrors `obc-alert-icon`.
|
|
397
|
+
* The resting icons and the advice diamond deliberately stay on
|
|
398
|
+
* `currentColor`: their css-colour variants hard-code
|
|
399
|
+
* `--element-active-color`, which would defeat the neutral tint and the
|
|
400
|
+
* optimal / eco triggered tint applied from CSS.
|
|
401
|
+
*/
|
|
402
|
+
private adviceFallbackIcon(): TemplateResult {
|
|
403
|
+
const active = this.active;
|
|
404
|
+
switch (this.category) {
|
|
405
|
+
case ReadoutAdviceCategory.caution:
|
|
406
|
+
return active
|
|
407
|
+
? html`<obi-caution-color-iec useCssColor></obi-caution-color-iec>`
|
|
408
|
+
: html`<obi-caution-google></obi-caution-google>`;
|
|
409
|
+
case ReadoutAdviceCategory.warning:
|
|
410
|
+
return active
|
|
411
|
+
? html`<obi-warning-unacknowledged-iec
|
|
412
|
+
useCssColor
|
|
413
|
+
></obi-warning-unacknowledged-iec>`
|
|
414
|
+
: html`<obi-warning-unacknowledged-outlined></obi-warning-unacknowledged-outlined>`;
|
|
415
|
+
case ReadoutAdviceCategory.alarm:
|
|
416
|
+
return active
|
|
417
|
+
? html`<obi-alarm-unacknowledged-iec
|
|
418
|
+
useCssColor
|
|
419
|
+
></obi-alarm-unacknowledged-iec>`
|
|
420
|
+
: html`<obi-alarm></obi-alarm>`;
|
|
421
|
+
case ReadoutAdviceCategory.running:
|
|
422
|
+
return active
|
|
423
|
+
? html`<obi-running-color-iec useCssColor></obi-running-color-iec>`
|
|
424
|
+
: html`<obi-running></obi-running>`;
|
|
425
|
+
default:
|
|
426
|
+
// regular / optimal / eco share the advice diamond; the triggered tint
|
|
427
|
+
// is applied via CSS on `.block-icon` (see `advice-*` classes).
|
|
428
|
+
return active
|
|
429
|
+
? html`<obi-notification-advice-active></obi-notification-advice-active>`
|
|
430
|
+
: html`<obi-notification-advice></obi-notification-advice>`;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
337
434
|
/**
|
|
338
435
|
* A cap-height `°` column whose width scales with the number size. Inherits the
|
|
339
436
|
* block's colour.
|
|
@@ -370,6 +467,16 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
370
467
|
|
|
371
468
|
override render() {
|
|
372
469
|
const valueSize = this.resolvedValueSize;
|
|
470
|
+
const isAdvice = this.variant === ReadoutBlockVariant.advice;
|
|
471
|
+
// Triggered regular/optimal/eco advice renders SemiBold (Figma 6.1); the
|
|
472
|
+
// alert categories keep the caller's weight and change colour instead.
|
|
473
|
+
const adviceSemibold =
|
|
474
|
+
isAdvice &&
|
|
475
|
+
this.active &&
|
|
476
|
+
(this.category === ReadoutAdviceCategory.regular ||
|
|
477
|
+
this.category === ReadoutAdviceCategory.optimal ||
|
|
478
|
+
this.category === ReadoutAdviceCategory.eco);
|
|
479
|
+
const weight = adviceSemibold ? ObcTextboxFontWeight.semibold : this.weight;
|
|
373
480
|
const formatOptions = this.numericFormatOptions;
|
|
374
481
|
const isTextMode = this.valueType === ReadoutValueType.text;
|
|
375
482
|
// A missing digit knob makes the reading untrustworthy, so it resolves to
|
|
@@ -417,6 +524,9 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
417
524
|
block: true,
|
|
418
525
|
[`block-${this.variant}`]: true,
|
|
419
526
|
[`size-${this.size}`]: true,
|
|
527
|
+
[`value-size-${valueSize}`]: true,
|
|
528
|
+
[`advice-${this.category}`]: isAdvice,
|
|
529
|
+
'advice-active': isAdvice && this.active,
|
|
420
530
|
'tone-enhanced': this.enhanced,
|
|
421
531
|
touching: this.touching,
|
|
422
532
|
'is-hiding': this.hidePhase === ReadoutBlockHidePhase.hiding,
|
|
@@ -431,7 +541,7 @@ export class ObcReadoutBlock extends LitElement {
|
|
|
431
541
|
class="block-text"
|
|
432
542
|
part="block-text"
|
|
433
543
|
.size=${valueSize}
|
|
434
|
-
.fontWeight=${
|
|
544
|
+
.fontWeight=${weight}
|
|
435
545
|
.alignment=${this.alignment}
|
|
436
546
|
.tabularNums=${true}
|
|
437
547
|
>
|