@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.58 → 2.0.0-next.59
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 +5999 -4348
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +755 -75
- package/dist/alert-severity.d.ts +38 -0
- package/dist/alert-severity.d.ts.map +1 -0
- package/dist/alert-severity.js +176 -0
- package/dist/alert-severity.js.map +1 -0
- package/dist/ar/building-blocks/poi-header/poi-header.css.js +38 -7
- package/dist/ar/building-blocks/poi-header/poi-header.css.js.map +1 -1
- package/dist/ar/building-blocks/poi-header/poi-header.d.ts +7 -2
- package/dist/ar/building-blocks/poi-header/poi-header.d.ts.map +1 -1
- package/dist/ar/building-blocks/poi-header/poi-header.js +5 -0
- package/dist/ar/building-blocks/poi-header/poi-header.js.map +1 -1
- package/dist/ar/poi-button/poi-button.css.js +110 -32
- package/dist/ar/poi-button/poi-button.css.js.map +1 -1
- package/dist/ar/poi-button/poi-button.d.ts +7 -2
- package/dist/ar/poi-button/poi-button.d.ts.map +1 -1
- package/dist/ar/poi-button/poi-button.js +15 -0
- package/dist/ar/poi-button/poi-button.js.map +1 -1
- package/dist/ar/types.d.ts +6 -1
- package/dist/ar/types.d.ts.map +1 -1
- package/dist/ar/types.js +5 -0
- package/dist/ar/types.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.d.ts +9 -1
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js +119 -12
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +25 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +7 -2
- package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.d.ts +10 -3
- package/dist/automation/automation-button/abstract-automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/abstract-automation-button.js +23 -2
- package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
- package/dist/automation/automation-button/automation-button.css.js +9 -4
- package/dist/automation/automation-button/automation-button.css.js.map +1 -1
- package/dist/automation/automation-button/automation-button.d.ts +4 -2
- package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/automation-button.js +24 -6
- package/dist/automation/automation-button/automation-button.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.d.ts +3 -2
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +13 -2
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/components/accordion-card/accordion-card.css.js +34 -0
- package/dist/components/accordion-card/accordion-card.css.js.map +1 -1
- package/dist/components/accordion-card/accordion-card.d.ts +3 -2
- package/dist/components/accordion-card/accordion-card.d.ts.map +1 -1
- package/dist/components/accordion-card/accordion-card.js +4 -3
- package/dist/components/accordion-card/accordion-card.js.map +1 -1
- package/dist/components/alert-button/alert-button.css.js +744 -7
- package/dist/components/alert-button/alert-button.css.js.map +1 -1
- package/dist/components/alert-button/alert-button.d.ts +3 -1
- package/dist/components/alert-button/alert-button.d.ts.map +1 -1
- package/dist/components/alert-button/alert-button.js +33 -31
- package/dist/components/alert-button/alert-button.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.css.js +116 -29
- package/dist/components/alert-frame/alert-frame.css.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.d.ts +42 -15
- package/dist/components/alert-frame/alert-frame.d.ts.map +1 -1
- package/dist/components/alert-frame/alert-frame.js +68 -17
- package/dist/components/alert-frame/alert-frame.js.map +1 -1
- package/dist/components/alert-frame/critical-badge.d.ts +12 -0
- package/dist/components/alert-frame/critical-badge.d.ts.map +1 -0
- package/dist/components/alert-frame/critical-badge.js +47 -0
- package/dist/components/alert-frame/critical-badge.js.map +1 -0
- package/dist/components/alert-frame/diagnostic-badge.d.ts +12 -0
- package/dist/components/alert-frame/diagnostic-badge.d.ts.map +1 -0
- package/dist/components/alert-frame/diagnostic-badge.js +60 -0
- package/dist/components/alert-frame/diagnostic-badge.js.map +1 -0
- package/dist/components/alert-icon/alert-icon.d.ts +6 -1
- package/dist/components/alert-icon/alert-icon.d.ts.map +1 -1
- package/dist/components/alert-icon/alert-icon.js +96 -38
- package/dist/components/alert-icon/alert-icon.js.map +1 -1
- package/dist/components/alert-icon/icons/icon-critical.d.ts +3 -0
- package/dist/components/alert-icon/icons/icon-critical.d.ts.map +1 -0
- package/dist/components/alert-icon/icons/icon-critical.js +26 -0
- package/dist/components/alert-icon/icons/icon-critical.js.map +1 -0
- package/dist/components/alert-list-details/alert-list-details.d.ts.map +1 -1
- package/dist/components/alert-list-details/alert-list-details.js +6 -7
- package/dist/components/alert-list-details/alert-list-details.js.map +1 -1
- package/dist/components/badge/badge.css.js +50 -2
- package/dist/components/badge/badge.css.js.map +1 -1
- package/dist/components/badge/badge.d.ts +13 -2
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/badge.js +54 -0
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/manual-icon/icon-alerts-critical-twotone.d.ts +30 -0
- package/dist/manual-icon/icon-alerts-critical-twotone.d.ts.map +1 -0
- package/dist/manual-icon/icon-alerts-critical-twotone.js +55 -0
- package/dist/manual-icon/icon-alerts-critical-twotone.js.map +1 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.d.ts +30 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.d.ts.map +1 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.js +55 -0
- package/dist/manual-icon/icon-alerts-diagnostic-twotone.js.map +1 -0
- package/dist/navigation-instruments/readout/readout.css.js +3 -18
- package/dist/navigation-instruments/readout/readout.css.js.map +1 -1
- package/dist/navigation-instruments/readout/readout.d.ts +6 -7
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +54 -52
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.css.js +9 -36
- 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 +8 -8
- 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 +49 -42
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/dist/openbridge.css +155 -0
- package/dist/types.d.ts +7 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -7
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/src/alert-severity.ts +225 -0
- package/src/ar/building-blocks/poi-header/poi-header.css +38 -7
- package/src/ar/building-blocks/poi-header/poi-header.ts +6 -1
- package/src/ar/poi-button/poi-button.css +126 -32
- package/src/ar/poi-button/poi-button.ts +16 -1
- package/src/ar/types.ts +5 -0
- package/src/automation/automation-badge/automation-badge.ts +124 -17
- package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +5 -0
- package/src/automation/automation-button/abstract-automation-button.ts +21 -3
- package/src/automation/automation-button/automation-button.css +9 -4
- package/src/automation/automation-button/automation-button.ts +25 -7
- package/src/automation/automation-tank/automation-tank.stories.ts +22 -0
- package/src/automation/automation-tank/automation-tank.ts +12 -3
- package/src/components/accordion-card/accordion-card.css +33 -0
- package/src/components/accordion-card/accordion-card.stories.ts +2 -1
- package/src/components/accordion-card/accordion-card.ts +3 -4
- package/src/components/alert-button/alert-button.css +89 -5
- package/src/components/alert-button/alert-button.stories.ts +43 -0
- package/src/components/alert-button/alert-button.ts +43 -32
- package/src/components/alert-frame/alert-frame.css +116 -29
- package/src/components/alert-frame/alert-frame.stories.ts +63 -3
- package/src/components/alert-frame/alert-frame.ts +114 -23
- package/src/components/alert-frame/critical-badge.ts +39 -0
- package/src/components/alert-frame/diagnostic-badge.ts +52 -0
- package/src/components/alert-icon/alert-icon.stories.ts +41 -0
- package/src/components/alert-icon/alert-icon.ts +101 -38
- package/src/components/alert-icon/icons/icon-critical.ts +23 -0
- package/src/components/alert-list-details/alert-list-details.stories.ts +67 -0
- package/src/components/alert-list-details/alert-list-details.ts +11 -10
- package/src/components/badge/badge.css +52 -2
- package/src/components/badge/badge.stories.ts +75 -0
- package/src/components/badge/badge.ts +70 -2
- package/src/main.css +1 -0
- package/src/manual-icon/icon-alerts-critical-twotone.ts +60 -0
- package/src/manual-icon/icon-alerts-diagnostic-twotone.ts +60 -0
- package/src/mixins/alert.css +29 -0
- package/src/navigation-instruments/readout/readout.css +3 -24
- package/src/navigation-instruments/readout/readout.stories.ts +57 -4
- package/src/navigation-instruments/readout/readout.ts +69 -63
- package/src/navigation-instruments/readout-list-item/readout-list-item.css +9 -42
- package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +57 -14
- package/src/navigation-instruments/readout-list-item/readout-list-item.ts +54 -44
- package/src/palettes/critical.md +95 -0
- package/src/palettes/manual.css +165 -0
- package/src/types.ts +20 -3
|
@@ -4,9 +4,15 @@ import {useArgs} from 'storybook/preview-api';
|
|
|
4
4
|
import {
|
|
5
5
|
ReadoutListItemSize,
|
|
6
6
|
ReadoutListItemStacking,
|
|
7
|
-
|
|
7
|
+
ReadoutListItemDataState,
|
|
8
8
|
ReadoutListItemPriority,
|
|
9
9
|
} from './readout-list-item.js';
|
|
10
|
+
import type {AlertFrameConfig} from '../../components/alert-frame/alert-frame.js';
|
|
11
|
+
import {
|
|
12
|
+
ObcAlertFrameMode,
|
|
13
|
+
ObcAlertFrameType,
|
|
14
|
+
} from '../../components/alert-frame/alert-frame.js';
|
|
15
|
+
import {AlertType} from '../../types.js';
|
|
10
16
|
import './readout-list-item.js';
|
|
11
17
|
import '../../icons/icon-placeholder.js';
|
|
12
18
|
|
|
@@ -14,7 +20,8 @@ type ReadoutListItemStoryArgs = {
|
|
|
14
20
|
size: ReadoutListItemSize;
|
|
15
21
|
stacking: ReadoutListItemStacking;
|
|
16
22
|
priority: ReadoutListItemPriority;
|
|
17
|
-
|
|
23
|
+
dataState: ReadoutListItemDataState;
|
|
24
|
+
alert: AlertFrameConfig | false;
|
|
18
25
|
hasSetpoint: boolean;
|
|
19
26
|
setpointValue: number;
|
|
20
27
|
hasLabel: boolean;
|
|
@@ -132,7 +139,8 @@ const defaultArgs: ReadoutListItemStoryArgs = {
|
|
|
132
139
|
size: ReadoutListItemSize.base,
|
|
133
140
|
stacking: ReadoutListItemStacking.trailingUnit,
|
|
134
141
|
priority: ReadoutListItemPriority.regular,
|
|
135
|
-
|
|
142
|
+
dataState: ReadoutListItemDataState.none,
|
|
143
|
+
alert: false,
|
|
136
144
|
hasSetpoint: false,
|
|
137
145
|
setpointValue: 123,
|
|
138
146
|
hasDegree: true,
|
|
@@ -149,6 +157,7 @@ const defaultArgs: ReadoutListItemStoryArgs = {
|
|
|
149
157
|
value: 123,
|
|
150
158
|
fractionDigits: 0,
|
|
151
159
|
showZeroPadding: false,
|
|
160
|
+
labelOnly: false,
|
|
152
161
|
};
|
|
153
162
|
|
|
154
163
|
function renderReadoutListItem(args: Partial<ReadoutListItemStoryArgs>) {
|
|
@@ -158,7 +167,8 @@ function renderReadoutListItem(args: Partial<ReadoutListItemStoryArgs>) {
|
|
|
158
167
|
.size=${resolved.size}
|
|
159
168
|
.stacking=${resolved.stacking}
|
|
160
169
|
.priority=${resolved.priority}
|
|
161
|
-
.
|
|
170
|
+
.dataState=${resolved.dataState}
|
|
171
|
+
.alert=${resolved.alert}
|
|
162
172
|
.hasSetpoint=${resolved.hasSetpoint}
|
|
163
173
|
.setpointValue=${resolved.setpointValue}
|
|
164
174
|
.hasLabel=${resolved.hasLabel}
|
|
@@ -260,10 +270,10 @@ const meta = {
|
|
|
260
270
|
options: Object.values(ReadoutListItemPriority),
|
|
261
271
|
table: {category: 'Readout'},
|
|
262
272
|
},
|
|
263
|
-
|
|
264
|
-
name: '
|
|
273
|
+
dataState: {
|
|
274
|
+
name: 'Data State',
|
|
265
275
|
control: {type: 'select'},
|
|
266
|
-
options: Object.values(
|
|
276
|
+
options: Object.values(ReadoutListItemDataState),
|
|
267
277
|
table: {category: 'Readout'},
|
|
268
278
|
},
|
|
269
279
|
hasSetpoint: {
|
|
@@ -386,7 +396,7 @@ function renderStackingMatrix({
|
|
|
386
396
|
stacking,
|
|
387
397
|
priority,
|
|
388
398
|
hasSetpoint,
|
|
389
|
-
|
|
399
|
+
dataState: ReadoutListItemDataState.none,
|
|
390
400
|
hasUnit,
|
|
391
401
|
hasSource,
|
|
392
402
|
value: 123,
|
|
@@ -429,20 +439,53 @@ export const LeadingSrc: Story = {
|
|
|
429
439
|
}),
|
|
430
440
|
};
|
|
431
441
|
|
|
432
|
-
export const
|
|
442
|
+
export const DataStates: Story = {
|
|
433
443
|
render: () => {
|
|
434
|
-
const
|
|
435
|
-
const cases: ReadoutShowcaseCase[] =
|
|
436
|
-
label: `${
|
|
444
|
+
const dataStates = Object.values(ReadoutListItemDataState);
|
|
445
|
+
const cases: ReadoutShowcaseCase[] = dataStates.map((dataState) => ({
|
|
446
|
+
label: `${dataState}`,
|
|
437
447
|
args: {
|
|
438
448
|
size: ReadoutListItemSize.base,
|
|
439
449
|
stacking: ReadoutListItemStacking.trailingUnit,
|
|
440
450
|
priority: ReadoutListItemPriority.regular,
|
|
441
|
-
|
|
451
|
+
dataState,
|
|
442
452
|
value: 123,
|
|
443
453
|
},
|
|
444
454
|
}));
|
|
445
455
|
|
|
446
|
-
return renderShowcaseSections([{title: '
|
|
456
|
+
return renderShowcaseSections([{title: 'Data States', cases}]);
|
|
457
|
+
},
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export const Alarm: Story = {
|
|
461
|
+
args: {
|
|
462
|
+
value: 123,
|
|
463
|
+
alert: {
|
|
464
|
+
status: AlertType.Alarm,
|
|
465
|
+
mode: ObcAlertFrameMode.ackedActive,
|
|
466
|
+
type: ObcAlertFrameType.Regular,
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
export const IsaCritical: Story = {
|
|
472
|
+
args: {
|
|
473
|
+
value: 123,
|
|
474
|
+
alert: {
|
|
475
|
+
status: AlertType.IsaCritical,
|
|
476
|
+
mode: ObcAlertFrameMode.unackedActive,
|
|
477
|
+
type: ObcAlertFrameType.Regular,
|
|
478
|
+
},
|
|
479
|
+
},
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
export const IsaLowUnackedRectified: Story = {
|
|
483
|
+
args: {
|
|
484
|
+
value: 123,
|
|
485
|
+
alert: {
|
|
486
|
+
status: AlertType.IsaLow,
|
|
487
|
+
mode: ObcAlertFrameMode.unackedRectified,
|
|
488
|
+
type: ObcAlertFrameType.Regular,
|
|
489
|
+
},
|
|
447
490
|
},
|
|
448
491
|
};
|
|
@@ -9,14 +9,15 @@ import {Priority} from '../types.js';
|
|
|
9
9
|
import '../readout-setpoint/readout-setpoint.js';
|
|
10
10
|
import '../../icons/icon-input-right.js';
|
|
11
11
|
import {ReadoutSetpointMode} from '../readout-setpoint/readout-setpoint.js';
|
|
12
|
+
import {
|
|
13
|
+
type AlertFrameConfig,
|
|
14
|
+
wrapWithAlertFrame,
|
|
15
|
+
} from '../../components/alert-frame/alert-frame.js';
|
|
12
16
|
|
|
13
|
-
export enum
|
|
17
|
+
export enum ReadoutListItemDataState {
|
|
14
18
|
none = 'none',
|
|
15
19
|
lowIntegrity = 'low-integrity',
|
|
16
20
|
invalid = 'invalid',
|
|
17
|
-
caution = 'caution',
|
|
18
|
-
warning = 'warning',
|
|
19
|
-
alarm = 'alarm',
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export enum ReadoutListItemSize {
|
|
@@ -47,7 +48,8 @@ export enum ReadoutListItemPriority {
|
|
|
47
48
|
* - **Sizes:** `base`, `priority`, and `enhanced` typography/padding scales.
|
|
48
49
|
* - **Stacking modes:** `trailing-unit`, `leading-unit`, and `leading-src` control where unit/source appear relative to the label/value.
|
|
49
50
|
* - **Priority styling:** `priority` controls emphasis and setpoint presentation (`regular`, `enhanced`, `setpoint`, `setpoint-flip-flop`).
|
|
50
|
-
* - **
|
|
51
|
+
* - **Data states:** Supports `dataState` styling for `low-integrity` and `invalid` data quality.
|
|
52
|
+
* - **Alert frame:** Optional `alert` wrapper for caution, warning, alarm, and other alert-frame statuses.
|
|
51
53
|
* - **Formatting:** Supports numeric formatting, fixed-length width templates, hinted zeros, and optional degree suffix (`°`).
|
|
52
54
|
*
|
|
53
55
|
* ### Usage Guidelines
|
|
@@ -71,7 +73,9 @@ export class ObcReadoutListItem extends LitElement {
|
|
|
71
73
|
@property({type: String})
|
|
72
74
|
priority: ReadoutListItemPriority = ReadoutListItemPriority.regular;
|
|
73
75
|
@property({type: String})
|
|
74
|
-
|
|
76
|
+
dataState: ReadoutListItemDataState = ReadoutListItemDataState.none;
|
|
77
|
+
|
|
78
|
+
@property({type: Object}) alert: AlertFrameConfig | boolean = false;
|
|
75
79
|
|
|
76
80
|
@property({type: String}) label = '';
|
|
77
81
|
@property({type: String}) unit = '';
|
|
@@ -369,46 +373,52 @@ export class ObcReadoutListItem extends LitElement {
|
|
|
369
373
|
}
|
|
370
374
|
|
|
371
375
|
override render() {
|
|
372
|
-
return
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
this.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
376
|
+
return wrapWithAlertFrame(
|
|
377
|
+
this.alert,
|
|
378
|
+
html`
|
|
379
|
+
<div
|
|
380
|
+
class=${classMap({
|
|
381
|
+
root: true,
|
|
382
|
+
[`size-${this.size}`]: true,
|
|
383
|
+
[`stacking-${this.stacking}`]: true,
|
|
384
|
+
'priority-enhanced':
|
|
385
|
+
this.priority === ReadoutListItemPriority.enhanced,
|
|
386
|
+
'priority-setpoint':
|
|
387
|
+
this.priority === ReadoutListItemPriority.setpoint,
|
|
388
|
+
'priority-setpoint-flip-flop':
|
|
389
|
+
this.priority === ReadoutListItemPriority.setpointFlipFlop,
|
|
390
|
+
'data-none': this.dataState === ReadoutListItemDataState.none,
|
|
391
|
+
'data-low-integrity':
|
|
392
|
+
this.dataState === ReadoutListItemDataState.lowIntegrity,
|
|
393
|
+
'data-invalid': this.dataState === ReadoutListItemDataState.invalid,
|
|
394
|
+
'has-leading-icon': this.hasLeadingIcon,
|
|
395
|
+
'has-value-icon': this.hasValueIcon,
|
|
396
|
+
})}
|
|
397
|
+
part="root"
|
|
398
|
+
>
|
|
399
|
+
<div class="content" part="content">
|
|
400
|
+
<div class="label-container" part="label-container">
|
|
401
|
+
${this.hasLeadingIcon
|
|
402
|
+
? html`<span class="leading-icon" aria-hidden="true"
|
|
403
|
+
><slot name="leading-icon"></slot
|
|
404
|
+
></span>`
|
|
405
|
+
: nothing}
|
|
406
|
+
${this.renderLabelContainer()}
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
${this.labelOnly
|
|
410
|
+
? nothing
|
|
411
|
+
: html`
|
|
412
|
+
<div class="value-container" part="value-container">
|
|
413
|
+
${this.renderValue()} ${this.renderTrailingUnit()}
|
|
414
|
+
</div>
|
|
415
|
+
|
|
416
|
+
${this.renderTrailingSource()}
|
|
417
|
+
`}
|
|
398
418
|
</div>
|
|
399
|
-
|
|
400
|
-
${this.labelOnly
|
|
401
|
-
? nothing
|
|
402
|
-
: html`
|
|
403
|
-
<div class="value-container" part="value-container">
|
|
404
|
-
${this.renderValue()} ${this.renderTrailingUnit()}
|
|
405
|
-
</div>
|
|
406
|
-
|
|
407
|
-
${this.renderTrailingSource()}
|
|
408
|
-
`}
|
|
409
419
|
</div>
|
|
410
|
-
|
|
411
|
-
|
|
420
|
+
`
|
|
421
|
+
);
|
|
412
422
|
}
|
|
413
423
|
|
|
414
424
|
static override styles = unsafeCSS(componentStyle);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Color/Styles/Critical
|
|
2
|
+
|
|
3
|
+
Kodebasestil som speiler `Color/Styles/Alarm` i Figma **Palette**, men peker på **Critical-alarm**-primitiver i stedet for Alarm.
|
|
4
|
+
|
|
5
|
+
Denne stilen finnes **ikke** i Figma Palette — den er definert kun i kodebasen (`manual.css`).
|
|
6
|
+
|
|
7
|
+
## Unike primitive-farger per tema
|
|
8
|
+
|
|
9
|
+
| Tema | Primitive-farger brukt |
|
|
10
|
+
| ----------- | -------------------------------------------------------------------------------------- |
|
|
11
|
+
| Day | `Primitives-day/Critical-alarm/400`, `450`, `500` |
|
|
12
|
+
| Dusk BETA | `Primitives-dusk/Critical-alarm/300`, `350`, `400` + `Primitives-dusk/Blue/500` |
|
|
13
|
+
| Night BETA | `Primitives-night/Critical/300`, `350`, `400`, `500` + `Primitives-night/Enhanced/400` |
|
|
14
|
+
| Bright BETA | `Primitives-day/Critical-alarm/400`, `500`, `600` + `Primitives-day/Blue/300` |
|
|
15
|
+
|
|
16
|
+
Night bruker mappen `Critical` (ikke `Critical-alarm`) fordi `Primitives-night/Critical-alarm` ikke finnes i Figma.
|
|
17
|
+
|
|
18
|
+
## Detaljert mapping per state
|
|
19
|
+
|
|
20
|
+
| State / property | Day | Dusk BETA | Night BETA | Bright BETA |
|
|
21
|
+
| ------------------- | ------------------ | ------------------ | ------------ | ------------------ |
|
|
22
|
+
| Enabled background | Critical-alarm/400 | Critical-alarm/300 | Critical/400 | Critical-alarm/400 |
|
|
23
|
+
| Enabled border | Critical-alarm/500 | Critical-alarm/350 | Critical/400 | Critical-alarm/600 |
|
|
24
|
+
| Hover background | Critical-alarm/450 | Critical-alarm/350 | Critical/400 | Critical-alarm/500 |
|
|
25
|
+
| Hover border | Critical-alarm/500 | Critical-alarm/350 | Critical/500 | Critical-alarm/600 |
|
|
26
|
+
| Pressed background | Critical-alarm/500 | Critical-alarm/400 | Critical/350 | Critical-alarm/600 |
|
|
27
|
+
| Pressed border | Critical-alarm/500 | Critical-alarm/350 | Critical/500 | Critical-alarm/600 |
|
|
28
|
+
| Focused background | Critical-alarm/400 | Critical-alarm/300 | Critical/400 | Critical-alarm/500 |
|
|
29
|
+
| Focused border | Critical-alarm/500 | Blue/500 | Enhanced/400 | Blue/300 |
|
|
30
|
+
| Disabled background | Critical-alarm/400 | Critical-alarm/300 | Critical/300 | Critical-alarm/400 |
|
|
31
|
+
| Disabled border | Critical-alarm/400 | Critical-alarm/300 | Critical/300 | Critical-alarm/400 |
|
|
32
|
+
|
|
33
|
+
Primitive-prefikser er forkortet (f.eks. `Critical-alarm/400` = `Primitives-day/Critical-alarm/400` for Day og Bright BETA).
|
|
34
|
+
|
|
35
|
+
## Oppsummering
|
|
36
|
+
|
|
37
|
+
- **Day** og **Bright BETA** bruker `Primitives-day/Critical-alarm/*` (Bright med mørkere nyanser: 500/600).
|
|
38
|
+
- **Dusk BETA** bruker `Primitives-dusk/Critical-alarm/*` (300–400).
|
|
39
|
+
- **Night BETA** bruker `Primitives-night/Critical/*` med samme nyansenummer som Alarm bruker for `Primitives-night/Alarm/*`.
|
|
40
|
+
- **Focused border** er unntaket — den bruker ikke critical-farger, men blå/enhanced (samme som Alarm):
|
|
41
|
+
- Dusk → `Primitives-dusk/Blue/500`
|
|
42
|
+
- Night → `Primitives-night/Enhanced/400`
|
|
43
|
+
- Bright → `Primitives-day/Blue/300`
|
|
44
|
+
|
|
45
|
+
## Semantiske tokens (kodebasen)
|
|
46
|
+
|
|
47
|
+
| Token |
|
|
48
|
+
| -------------------------------------- |
|
|
49
|
+
| `--critical-enabled-background-color` |
|
|
50
|
+
| `--critical-enabled-border-color` |
|
|
51
|
+
| `--critical-hover-background-color` |
|
|
52
|
+
| `--critical-hover-border-color` |
|
|
53
|
+
| `--critical-pressed-background-color` |
|
|
54
|
+
| `--critical-pressed-border-color` |
|
|
55
|
+
| `--critical-focused-background-color` |
|
|
56
|
+
| `--critical-focused-border-color` |
|
|
57
|
+
| `--critical-disabled-background-color` |
|
|
58
|
+
| `--critical-disabled-border-color` |
|
|
59
|
+
| `--on-critical-color` |
|
|
60
|
+
| `--on-critical-active-color` |
|
|
61
|
+
| `--on-critical-neutral-color` |
|
|
62
|
+
| `--on-critical-disabled-color` |
|
|
63
|
+
|
|
64
|
+
## On-critical mapping per tema
|
|
65
|
+
|
|
66
|
+
| Token | Day | Dusk BETA | Night BETA | Bright BETA |
|
|
67
|
+
| -------------------------- | --------------------- | ------------------------ | --------------------------------- | --------------------- |
|
|
68
|
+
| on-critical-color | Neutral-inverted/1000 | Neutral/1000 | Neutral-inverted-transparent/1000 | Neutral-inverted/1000 |
|
|
69
|
+
| on-critical-active-color | Neutral-inverted/1000 | Neutral-transparent/1000 | OnCriticalAlarm/Active-color | Neutral-inverted/1000 |
|
|
70
|
+
| on-critical-neutral-color | Critical-alarm/050 | Neutral-transparent/1000 | OnCriticalAlarm/Neutral-color | Neutral/000 |
|
|
71
|
+
| on-critical-disabled-color | Critical-alarm/200 | Neutral/030 | OnCriticalAlarm/Disabled-color | Critical-alarm/200 |
|
|
72
|
+
|
|
73
|
+
Night bruker `Night-config/Styles/OnCriticalAlarm/*` (samme mønster som On-alarm for Night).
|
|
74
|
+
|
|
75
|
+
## Container-farger
|
|
76
|
+
|
|
77
|
+
Speiler `Color/Alert/Alarm-container-*` og `Color/Alert/Caution-container-*`, men med Critical-alarm/Notification-primitiver.
|
|
78
|
+
|
|
79
|
+
| Token | Day | Dusk BETA | Night BETA | Bright BETA |
|
|
80
|
+
| --------------------------------------- | ------------------ | ------------------ | ------------ | ------------------ |
|
|
81
|
+
| alert-critical-container-background | Critical-alarm/100 | Critical-alarm/050 | Critical/100 | Critical-alarm/150 |
|
|
82
|
+
| alert-critical-container-border | Critical-alarm/200 | Critical-alarm/100 | Critical/100 | Critical-alarm/150 |
|
|
83
|
+
| alert-notification-container-background | Notification/050 | Notification/050 | Enhanced/100 | Notification/050 |
|
|
84
|
+
| alert-notification-container-border | Notification/100 | Notification/100 | Enhanced/100 | Notification/050 |
|
|
85
|
+
|
|
86
|
+
Night har ingen `Primitives-night/Notification/*` — notification-container bruker `Primitives-night/Enhanced/100`.
|
|
87
|
+
|
|
88
|
+
| Token |
|
|
89
|
+
| ------------------------------------------------- |
|
|
90
|
+
| `--alert-critical-container-background-color` |
|
|
91
|
+
| `--alert-critical-container-border-color` |
|
|
92
|
+
| `--alert-notification-container-background-color` |
|
|
93
|
+
| `--alert-notification-container-border-color` |
|
|
94
|
+
|
|
95
|
+
Bruk med `@mixin style style=critical` (PostCSS) eller `@mixin alert-critical` (alert-mixin).
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
:root[data-obc-theme="day"] {
|
|
2
|
+
--critical-enabled-background-color: rgb(196, 36, 183);
|
|
3
|
+
--critical-enabled-border-color: rgb(153, 0, 143);
|
|
4
|
+
--critical-hover-background-color: rgb(173, 5, 162);
|
|
5
|
+
--critical-hover-border-color: rgb(153, 0, 143);
|
|
6
|
+
--critical-pressed-background-color: rgb(153, 0, 143);
|
|
7
|
+
--critical-pressed-border-color: rgb(153, 0, 143);
|
|
8
|
+
--critical-focused-background-color: rgb(196, 36, 183);
|
|
9
|
+
--critical-focused-border-color: rgb(153, 0, 143);
|
|
10
|
+
--critical-disabled-background-color: rgb(196, 36, 183);
|
|
11
|
+
--critical-disabled-border-color: rgb(196, 36, 183);
|
|
12
|
+
--on-critical-color: rgb(255, 255, 255);
|
|
13
|
+
--on-critical-active-color: rgb(255, 255, 255);
|
|
14
|
+
--on-critical-neutral-color: rgb(254, 232, 250);
|
|
15
|
+
--on-critical-disabled-color: rgb(248, 155, 235);
|
|
16
|
+
--alert-critical-color: var(--critical-enabled-background-color);
|
|
17
|
+
--alert-critical-outline-color: var(--critical-enabled-border-color);
|
|
18
|
+
--alert-critical-container-background-color: rgb(254, 207, 246);
|
|
19
|
+
--alert-critical-container-border-color: rgb(248, 155, 235);
|
|
20
|
+
--alert-diagnostic-color: var(--notification-enabled-background-color);
|
|
21
|
+
--alert-diagnostic-outline-color: var(--notification-enabled-border-color);
|
|
22
|
+
--alert-notification-container-background-color: rgb(226, 240, 255);
|
|
23
|
+
--alert-notification-container-border-color: rgb(195, 223, 255);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:root[data-obc-theme="dusk"] {
|
|
27
|
+
--critical-enabled-background-color: rgb(189, 40, 190);
|
|
28
|
+
--critical-enabled-border-color: rgb(206, 65, 207);
|
|
29
|
+
--critical-hover-background-color: rgb(206, 65, 207);
|
|
30
|
+
--critical-hover-border-color: rgb(206, 65, 207);
|
|
31
|
+
--critical-pressed-background-color: rgb(218, 85, 218);
|
|
32
|
+
--critical-pressed-border-color: rgb(206, 65, 207);
|
|
33
|
+
--critical-focused-background-color: rgb(189, 40, 190);
|
|
34
|
+
--critical-focused-border-color: rgb(132, 179, 239);
|
|
35
|
+
--critical-disabled-background-color: rgb(189, 40, 190);
|
|
36
|
+
--critical-disabled-border-color: rgb(189, 40, 190);
|
|
37
|
+
--on-critical-color: rgb(255, 255, 255);
|
|
38
|
+
--on-critical-active-color: rgb(255, 255, 255);
|
|
39
|
+
--on-critical-neutral-color: rgb(255, 255, 255);
|
|
40
|
+
--on-critical-disabled-color: rgb(38, 38, 38);
|
|
41
|
+
--alert-critical-color: var(--critical-enabled-background-color);
|
|
42
|
+
--alert-critical-outline-color: var(--critical-enabled-border-color);
|
|
43
|
+
--alert-critical-container-background-color: rgb(85, 0, 86);
|
|
44
|
+
--alert-critical-container-border-color: rgb(102, 0, 104);
|
|
45
|
+
--alert-diagnostic-color: var(--notification-enabled-background-color);
|
|
46
|
+
--alert-diagnostic-outline-color: var(--notification-enabled-border-color);
|
|
47
|
+
--alert-notification-container-background-color: rgb(0, 35, 123);
|
|
48
|
+
--alert-notification-container-border-color: rgb(0, 44, 144);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:root[data-obc-theme="night"] {
|
|
52
|
+
--critical-enabled-background-color: rgb(195, 48, 196);
|
|
53
|
+
--critical-enabled-border-color: rgb(195, 48, 196);
|
|
54
|
+
--critical-hover-background-color: rgb(195, 48, 196);
|
|
55
|
+
--critical-hover-border-color: rgb(224, 100, 224);
|
|
56
|
+
--critical-pressed-background-color: rgb(181, 30, 182);
|
|
57
|
+
--critical-pressed-border-color: rgb(224, 100, 224);
|
|
58
|
+
--critical-focused-background-color: rgb(195, 48, 196);
|
|
59
|
+
--critical-focused-border-color: rgb(44, 131, 102);
|
|
60
|
+
--critical-disabled-background-color: rgb(161, 6, 163);
|
|
61
|
+
--critical-disabled-border-color: rgb(161, 6, 163);
|
|
62
|
+
--on-critical-color: rgb(0, 0, 0);
|
|
63
|
+
--on-critical-active-color: rgb(0, 0, 0);
|
|
64
|
+
--on-critical-neutral-color: rgb(0, 0, 0, 0.699999988079071);
|
|
65
|
+
--on-critical-disabled-color: rgb(0, 0, 0, 0.30000001192092896);
|
|
66
|
+
--alert-critical-color: var(--critical-enabled-background-color);
|
|
67
|
+
--alert-critical-outline-color: var(--critical-enabled-border-color);
|
|
68
|
+
--alert-critical-container-background-color: rgb(59, 0, 60);
|
|
69
|
+
--alert-critical-container-border-color: rgb(59, 0, 60);
|
|
70
|
+
--alert-diagnostic-color: var(--notification-enabled-background-color);
|
|
71
|
+
--alert-diagnostic-outline-color: var(--notification-enabled-border-color);
|
|
72
|
+
--alert-notification-container-background-color: rgb(16, 33, 26);
|
|
73
|
+
--alert-notification-container-border-color: rgb(16, 33, 26);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:root[data-obc-theme="bright"] {
|
|
77
|
+
--critical-enabled-background-color: rgb(196, 36, 183);
|
|
78
|
+
--critical-enabled-border-color: rgb(112, 0, 104);
|
|
79
|
+
--critical-hover-background-color: rgb(153, 0, 143);
|
|
80
|
+
--critical-hover-border-color: rgb(112, 0, 104);
|
|
81
|
+
--critical-pressed-background-color: rgb(112, 0, 104);
|
|
82
|
+
--critical-pressed-border-color: rgb(112, 0, 104);
|
|
83
|
+
--critical-focused-background-color: rgb(153, 0, 143);
|
|
84
|
+
--critical-focused-border-color: rgb(93, 143, 213);
|
|
85
|
+
--critical-disabled-background-color: rgb(196, 36, 183);
|
|
86
|
+
--critical-disabled-border-color: rgb(196, 36, 183);
|
|
87
|
+
--on-critical-color: rgb(255, 255, 255);
|
|
88
|
+
--on-critical-active-color: rgb(255, 255, 255);
|
|
89
|
+
--on-critical-neutral-color: rgb(255, 255, 255);
|
|
90
|
+
--on-critical-disabled-color: rgb(248, 155, 235);
|
|
91
|
+
--alert-critical-color: var(--critical-enabled-background-color);
|
|
92
|
+
--alert-critical-outline-color: var(--critical-enabled-border-color);
|
|
93
|
+
--alert-critical-container-background-color: rgb(252, 184, 242);
|
|
94
|
+
--alert-critical-container-border-color: rgb(252, 184, 242);
|
|
95
|
+
--alert-diagnostic-color: var(--notification-enabled-background-color);
|
|
96
|
+
--alert-diagnostic-outline-color: var(--notification-enabled-border-color);
|
|
97
|
+
--alert-notification-container-background-color: rgb(226, 240, 255);
|
|
98
|
+
--alert-notification-container-border-color: rgb(226, 240, 255);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@property --critical-blink-on {
|
|
102
|
+
syntax: "<number>";
|
|
103
|
+
inherits: true;
|
|
104
|
+
initial-value: 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@property --critical-blink-off {
|
|
108
|
+
syntax: "<number>";
|
|
109
|
+
inherits: true;
|
|
110
|
+
initial-value: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@property --low-blink-on {
|
|
114
|
+
syntax: "<number>";
|
|
115
|
+
inherits: true;
|
|
116
|
+
initial-value: 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@property --low-blink-off {
|
|
120
|
+
syntax: "<number>";
|
|
121
|
+
inherits: true;
|
|
122
|
+
initial-value: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@keyframes critical-blink {
|
|
126
|
+
0% {
|
|
127
|
+
--critical-blink-on: 1;
|
|
128
|
+
--critical-blink-off: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
50% {
|
|
132
|
+
--critical-blink-on: 0;
|
|
133
|
+
--critical-blink-off: 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
100% {
|
|
137
|
+
--critical-blink-on: 1;
|
|
138
|
+
--critical-blink-off: 0;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@keyframes low-blink {
|
|
143
|
+
0% {
|
|
144
|
+
--low-blink-on: 1;
|
|
145
|
+
--low-blink-off: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
50% {
|
|
149
|
+
--low-blink-on: 0;
|
|
150
|
+
--low-blink-off: 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
100% {
|
|
154
|
+
--low-blink-on: 1;
|
|
155
|
+
--low-blink-off: 0;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:root {
|
|
160
|
+
animation:
|
|
161
|
+
warning-blink 4s infinite,
|
|
162
|
+
critical-blink 1s infinite,
|
|
163
|
+
low-blink 8s infinite;
|
|
164
|
+
animation-timing-function: steps(1);
|
|
165
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -9,8 +9,24 @@ export enum AlertType {
|
|
|
9
9
|
Alarm = 'alarm',
|
|
10
10
|
Warning = 'warning',
|
|
11
11
|
Caution = 'caution',
|
|
12
|
+
IsaCritical = 'isa-critical',
|
|
13
|
+
IsaHigh = 'isa-high',
|
|
14
|
+
IsaMedium = 'isa-medium',
|
|
15
|
+
IsaLow = 'isa-low',
|
|
16
|
+
IsaDiagnostic = 'isa-diagnostic',
|
|
12
17
|
}
|
|
13
18
|
|
|
19
|
+
export const ALERT_SEVERITY_PRIORITY = [
|
|
20
|
+
AlertType.IsaCritical,
|
|
21
|
+
AlertType.Alarm,
|
|
22
|
+
AlertType.IsaHigh,
|
|
23
|
+
AlertType.Warning,
|
|
24
|
+
AlertType.IsaMedium,
|
|
25
|
+
AlertType.Caution,
|
|
26
|
+
AlertType.IsaLow,
|
|
27
|
+
AlertType.IsaDiagnostic,
|
|
28
|
+
];
|
|
29
|
+
|
|
14
30
|
export enum AlertCategory {
|
|
15
31
|
a = 'a',
|
|
16
32
|
b = 'b',
|
|
@@ -71,11 +87,12 @@ export function isBlocked(alert: Alert) {
|
|
|
71
87
|
return alert.blocked !== false && alert.blocked !== undefined;
|
|
72
88
|
}
|
|
73
89
|
|
|
74
|
-
const priorityOrder = [AlertType.Alarm, AlertType.Warning, AlertType.Caution];
|
|
75
|
-
|
|
76
90
|
export function comparePriorityAlerts(a: Alert, b: Alert) {
|
|
77
91
|
if (a.type !== b.type) {
|
|
78
|
-
return
|
|
92
|
+
return (
|
|
93
|
+
ALERT_SEVERITY_PRIORITY.indexOf(b.type) -
|
|
94
|
+
ALERT_SEVERITY_PRIORITY.indexOf(a.type)
|
|
95
|
+
);
|
|
79
96
|
}
|
|
80
97
|
|
|
81
98
|
if (isActive(a) !== isActive(b)) {
|