@oicl/openbridge-webcomponents-full-bundle 2.0.0 → 2.1.0-next.1

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 (64) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +64 -17
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +176 -18
  4. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts +135 -136
  5. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.d.ts.map +1 -1
  6. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js +2 -18
  7. package/dist/automation/automation-button/abstract-automation-button-storybook-helpers.js.map +1 -1
  8. package/dist/automation/automation-button/abstract-automation-button.d.ts +2 -2
  9. package/dist/automation/automation-button/abstract-automation-button.js +2 -2
  10. package/dist/automation/automation-button/abstract-automation-button.js.map +1 -1
  11. package/dist/automation/automation-button/automation-button.d.ts +2 -2
  12. package/dist/automation/automation-button/automation-button.js.map +1 -1
  13. package/dist/automation/automation-tank/automation-tank.d.ts +23 -3
  14. package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
  15. package/dist/automation/automation-tank/automation-tank.js +4 -1
  16. package/dist/automation/automation-tank/automation-tank.js.map +1 -1
  17. package/dist/automation/heat-exchanger/heat-exchanger.d.ts +1 -1
  18. package/dist/automation/heat-exchanger/heat-exchanger.js.map +1 -1
  19. package/dist/automation/heat-pump/heat-pump.d.ts +1 -1
  20. package/dist/automation/heat-pump/heat-pump.js.map +1 -1
  21. package/dist/automation/hydraulic-separator/hydraulic-separator.d.ts +1 -1
  22. package/dist/automation/hydraulic-separator/hydraulic-separator.js.map +1 -1
  23. package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts +8 -3
  24. package/dist/automation/specialty-tank/abstract-specialty-tank.d.ts.map +1 -1
  25. package/dist/automation/specialty-tank/abstract-specialty-tank.js +9 -3
  26. package/dist/automation/specialty-tank/abstract-specialty-tank.js.map +1 -1
  27. package/dist/automation/specialty-tank/specialty-tank-story-meta.d.ts.map +1 -1
  28. package/dist/automation/specialty-tank/specialty-tank-story-meta.js +5 -13
  29. package/dist/automation/specialty-tank/specialty-tank-story-meta.js.map +1 -1
  30. package/dist/automation/transmitter/transmitter.d.ts +53 -8
  31. package/dist/automation/transmitter/transmitter.d.ts.map +1 -1
  32. package/dist/automation/transmitter/transmitter.js +37 -10
  33. package/dist/automation/transmitter/transmitter.js.map +1 -1
  34. package/dist/components/accordion-card/accordion-card.d.ts +19 -6
  35. package/dist/components/accordion-card/accordion-card.d.ts.map +1 -1
  36. package/dist/components/accordion-card/accordion-card.js +13 -1
  37. package/dist/components/accordion-card/accordion-card.js.map +1 -1
  38. package/dist/components/alert-frame/alert-frame-storybook-helpers.d.ts +33 -0
  39. package/dist/components/alert-frame/alert-frame-storybook-helpers.d.ts.map +1 -0
  40. package/dist/components/alert-frame/alert-frame-storybook-helpers.js +30 -0
  41. package/dist/components/alert-frame/alert-frame-storybook-helpers.js.map +1 -0
  42. package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
  43. package/dist/navigation-instruments/readout/readout.js.map +1 -1
  44. package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
  45. package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
  46. package/package.json +1 -1
  47. package/src/automation/automation-button/abstract-automation-button-storybook-helpers.ts +2 -22
  48. package/src/automation/automation-button/abstract-automation-button.ts +2 -2
  49. package/src/automation/automation-button/automation-button.stories.ts +5 -20
  50. package/src/automation/automation-button/automation-button.ts +2 -2
  51. package/src/automation/automation-tank/automation-tank.stories.ts +15 -49
  52. package/src/automation/automation-tank/automation-tank.ts +18 -1
  53. package/src/automation/heat-exchanger/heat-exchanger.ts +1 -1
  54. package/src/automation/heat-pump/heat-pump.ts +1 -1
  55. package/src/automation/hydraulic-separator/hydraulic-separator.ts +1 -1
  56. package/src/automation/specialty-tank/abstract-specialty-tank.ts +9 -2
  57. package/src/automation/specialty-tank/specialty-tank-story-meta.ts +5 -12
  58. package/src/automation/transmitter/transmitter.stories.ts +102 -0
  59. package/src/automation/transmitter/transmitter.ts +72 -15
  60. package/src/components/accordion-card/accordion-card.stories.ts +15 -12
  61. package/src/components/accordion-card/accordion-card.ts +22 -4
  62. package/src/components/alert-frame/alert-frame-storybook-helpers.ts +30 -0
  63. package/src/navigation-instruments/readout/readout.ts +1 -2
  64. package/src/navigation-instruments/readout-list-item/readout-list-item.ts +1 -2
@@ -13,6 +13,7 @@ import {
13
13
  } from '../automation-button/abstract-automation-button.js';
14
14
  import '../../components/alert-frame/alert-frame.js';
15
15
  import {
16
+ ObcAlertFrameMode,
16
17
  ObcAlertFrameThickness,
17
18
  ObcAlertFrameType,
18
19
  } from '../../components/alert-frame/alert-frame.js';
@@ -94,10 +95,13 @@ export enum SpecialtyTankFrame {
94
95
  * @availableWhen alertFrameThickness alert==true
95
96
  * @property alertFrameStatus - Alert status the frame is coloured for.
96
97
  * @availableWhen alertFrameStatus alert==true
98
+ * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,
99
+ * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.
100
+ * @availableWhen alertFrameMode alert==true
97
101
  * @property showAlertCategoryIcon - Shows the alert category icon inside the frame.
98
- * @availableWhen showAlertCategoryIcon alert==true
102
+ * @availableWhen showAlertCategoryIcon alert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]
99
103
  * @property showAlertIcon - Shows the slotted alert icon inside the frame.
100
- * @availableWhen showAlertIcon alert==true
104
+ * @availableWhen showAlertIcon alert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]
101
105
  */
102
106
  export class ObcAbstractSpecialtyTank extends LitElement {
103
107
  @property({type: String}) medium: SpecialtyTankMedium =
@@ -126,6 +130,8 @@ export class ObcAbstractSpecialtyTank extends LitElement {
126
130
  @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =
127
131
  ObcAlertFrameThickness.Small;
128
132
  @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;
133
+ @property({type: String}) alertFrameMode: ObcAlertFrameMode =
134
+ ObcAlertFrameMode.ackedActive;
129
135
  @property({type: Boolean, attribute: false}) showAlertCategoryIcon: boolean =
130
136
  true;
131
137
  @property({type: Boolean}) showAlertIcon: boolean = false;
@@ -368,6 +374,7 @@ export class ObcAbstractSpecialtyTank extends LitElement {
368
374
  .type=${this.alertFrameType}
369
375
  .thickness=${this.alertFrameThickness}
370
376
  .status=${this.alertFrameStatus}
377
+ .mode=${this.alertFrameMode}
371
378
  .showAlertCategoryIcon=${this.showAlertCategoryIcon}
372
379
  .showIcon=${this.showAlertIcon}
373
380
  >
@@ -3,10 +3,12 @@ import {html, literal} from 'lit/static-html.js';
3
3
  import type {StaticValue} from 'lit/static-html.js';
4
4
  import {crossDecorator} from '../../storybook-util.js';
5
5
  import {
6
+ ObcAlertFrameMode,
6
7
  ObcAlertFrameStatus,
7
8
  ObcAlertFrameThickness,
8
9
  ObcAlertFrameType,
9
10
  } from '../../components/alert-frame/alert-frame.js';
11
+ import {argTypesAlertFrame} from '../../components/alert-frame/alert-frame-storybook-helpers.js';
10
12
  import {
11
13
  AutomationButtonBadgeAlert,
12
14
  AutomationButtonBadgeCommandLocked,
@@ -59,6 +61,7 @@ export function specialtyTankMeta(tag: StaticValue): {
59
61
  alertFrameType: ObcAlertFrameType.SmallSideFlip,
60
62
  alertFrameThickness: ObcAlertFrameThickness.Small,
61
63
  alertFrameStatus: ObcAlertFrameStatus.Alarm,
64
+ alertFrameMode: ObcAlertFrameMode.ackedActive,
62
65
  showAlertCategoryIcon: true,
63
66
  showAlertIcon: false,
64
67
  },
@@ -87,18 +90,7 @@ export function specialtyTankMeta(tag: StaticValue): {
87
90
  options: Object.values(AutomationButtonBadgeCommandLocked),
88
91
  control: {type: 'select'},
89
92
  },
90
- alertFrameType: {
91
- options: Object.values(ObcAlertFrameType),
92
- control: {type: 'select'},
93
- },
94
- alertFrameThickness: {
95
- options: Object.values(ObcAlertFrameThickness),
96
- control: {type: 'select'},
97
- },
98
- alertFrameStatus: {
99
- options: Object.values(ObcAlertFrameStatus),
100
- control: {type: 'select'},
101
- },
93
+ ...argTypesAlertFrame,
102
94
  },
103
95
  decorators: [crossDecorator],
104
96
  render: (args) => html`
@@ -118,6 +110,7 @@ export function specialtyTankMeta(tag: StaticValue): {
118
110
  .alertFrameType=${args.alertFrameType}
119
111
  .alertFrameThickness=${args.alertFrameThickness}
120
112
  .alertFrameStatus=${args.alertFrameStatus}
113
+ .alertFrameMode=${args.alertFrameMode}
121
114
  .showAlertCategoryIcon=${args.showAlertCategoryIcon}
122
115
  .showAlertIcon=${args.showAlertIcon}
123
116
  ></${tag}>
@@ -6,8 +6,16 @@ import {TransmitterOrientation, TransmitterType} from './transmitter.js';
6
6
  import {TransmitterButtonSize} from '../transmitter-button/transmitter-button.js';
7
7
  import {crossDecorator} from '../../storybook-util.js';
8
8
  import '../../icons/icon-temperature-air.js';
9
+ import '../../icons/icon-placeholder.js';
9
10
  import '../horizontal-line/horizontal-line.js';
10
11
  import {LineMedium, LineType} from '../index.js';
12
+ import {
13
+ ObcAlertFrameMode,
14
+ ObcAlertFrameStatus,
15
+ ObcAlertFrameThickness,
16
+ ObcAlertFrameType,
17
+ } from '../../components/alert-frame/alert-frame.js';
18
+ import {argTypesAlertFrame} from '../../components/alert-frame/alert-frame-storybook-helpers.js';
11
19
 
12
20
  const sineData: [number[], number[]] = [
13
21
  Array.from({length: 30}, (_, i) => i),
@@ -37,6 +45,12 @@ const meta: Meta<typeof ObcTransmitter> = {
37
45
  hasSetPoint: false,
38
46
  setpointValue: 123,
39
47
  hasAlert: false,
48
+ alertFrameStatus: ObcAlertFrameStatus.Alarm,
49
+ alertFrameType: ObcAlertFrameType.Regular,
50
+ alertFrameThickness: ObcAlertFrameThickness.Small,
51
+ alertFrameMode: ObcAlertFrameMode.ackedActive,
52
+ showAlertCategoryIcon: true,
53
+ showAlertIcon: false,
40
54
  tag: 'TT',
41
55
  idTag: '#0000',
42
56
  data: sineData,
@@ -78,6 +92,7 @@ const meta: Meta<typeof ObcTransmitter> = {
78
92
  control: {type: 'radio'},
79
93
  },
80
94
  value: {control: {type: 'range', min: -99, max: 999, step: 0.1}},
95
+ ...argTypesAlertFrame,
81
96
  },
82
97
  } satisfies Meta<ObcTransmitter>;
83
98
 
@@ -104,6 +119,12 @@ function renderComponent(args: ObcTransmitter) {
104
119
  .hasSetPoint=${args.hasSetPoint}
105
120
  .setpointValue=${args.setpointValue}
106
121
  .hasAlert=${args.hasAlert}
122
+ .alertFrameStatus=${args.alertFrameStatus}
123
+ .alertFrameType=${args.alertFrameType}
124
+ .alertFrameThickness=${args.alertFrameThickness}
125
+ .alertFrameMode=${args.alertFrameMode}
126
+ .showAlertCategoryIcon=${args.showAlertCategoryIcon}
127
+ .showAlertIcon=${args.showAlertIcon}
107
128
  .tag=${args.tag}
108
129
  .idTag=${args.idTag}
109
130
  .data=${args.data}
@@ -113,6 +134,15 @@ function renderComponent(args: ObcTransmitter) {
113
134
  ? html`<obi-temperature-air slot="icon"></obi-temperature-air>`
114
135
  : ''
115
136
  }
137
+ ${
138
+ args.hasAlert
139
+ ? html`
140
+ <obi-placeholder slot="alert-icon"></obi-placeholder>
141
+ <span slot="alert-label">High</span>
142
+ <span slot="alert-timer">00:45</span>
143
+ `
144
+ : ''
145
+ }
116
146
  </obc-transmitter>
117
147
  `;
118
148
  }
@@ -156,6 +186,78 @@ export const WithAlert: Story = {
156
186
  render: (args) => renderComponent(args as ObcTransmitter),
157
187
  };
158
188
 
189
+ /**
190
+ * Lays transmitters out on a grid of anchor points, one row per entry of
191
+ * `rows` and one column per entry of `columns`, each cell overriding `args`.
192
+ */
193
+ function renderAlertGrid(
194
+ args: ObcTransmitter,
195
+ rows: Partial<ObcTransmitter>[],
196
+ columns: Partial<ObcTransmitter>[]
197
+ ) {
198
+ const cellWidth = 160;
199
+ const cellHeight = 112;
200
+ return html`
201
+ <div
202
+ style="width: ${columns.length * cellWidth}px; height: ${
203
+ rows.length * cellHeight
204
+ }px; transform: translate(-50%, -50%);"
205
+ >
206
+ ${rows.flatMap((row, r) =>
207
+ columns.map(
208
+ (column, c) => html`
209
+ <div
210
+ style="position: absolute; left: ${
211
+ (c + 0.5) * cellWidth
212
+ }px; top: ${r * cellHeight + 24}px;"
213
+ >
214
+ ${renderComponent({...args, ...row, ...column} as ObcTransmitter)}
215
+ </div>
216
+ `
217
+ )
218
+ )}
219
+ </div>
220
+ `;
221
+ }
222
+
223
+ /**
224
+ * Every flap type (rows) in the three statuses (columns), with the flap
225
+ * slots filled.
226
+ */
227
+ export const AlertFrameTypes: Story = {
228
+ args: {hasAlert: true, showAlertIcon: true},
229
+ render: (args) =>
230
+ renderAlertGrid(
231
+ args as ObcTransmitter,
232
+ Object.values(ObcAlertFrameType).map((alertFrameType) => ({
233
+ alertFrameType,
234
+ })),
235
+ [
236
+ ObcAlertFrameStatus.Alarm,
237
+ ObcAlertFrameStatus.Warning,
238
+ ObcAlertFrameStatus.Caution,
239
+ ].map((alertFrameStatus) => ({alertFrameStatus}))
240
+ ),
241
+ };
242
+
243
+ /**
244
+ * The acknowledgement modes (columns) at both thicknesses (rows); flashing
245
+ * frames snapshot in their on phase.
246
+ */
247
+ export const AlertFrameModes: Story = {
248
+ args: {hasAlert: true, alertFrameType: ObcAlertFrameType.SmallSideFlip},
249
+ render: (args) =>
250
+ renderAlertGrid(
251
+ args as ObcTransmitter,
252
+ Object.values(ObcAlertFrameThickness).map((alertFrameThickness) => ({
253
+ alertFrameThickness,
254
+ })),
255
+ Object.values(ObcAlertFrameMode).map((alertFrameMode) => ({
256
+ alertFrameMode,
257
+ }))
258
+ ),
259
+ };
260
+
159
261
  export const ZeroPadded: Story = {
160
262
  args: {
161
263
  type: TransmitterType.value,
@@ -1,4 +1,5 @@
1
1
  import {LitElement, html, nothing, unsafeCSS} from 'lit';
2
+ import type {TemplateResult} from 'lit';
2
3
  import {property} from 'lit/decorators.js';
3
4
  import {classMap} from 'lit/directives/class-map.js';
4
5
  import componentStyle from './transmitter.css?inline';
@@ -18,8 +19,13 @@ import {
18
19
  type ObcIndicatorGraphLayout,
19
20
  } from '../../navigation-instruments/indicator-graph/indicator-graph.js';
20
21
  import '../../navigation-instruments/indicator-graph/indicator-graph.js';
21
- import {ObcAlertFrameType} from '../../components/alert-frame/alert-frame.js';
22
+ import {
23
+ ObcAlertFrameMode,
24
+ ObcAlertFrameThickness,
25
+ ObcAlertFrameType,
26
+ } from '../../components/alert-frame/alert-frame.js';
22
27
  import '../../components/alert-frame/alert-frame.js';
28
+ import {AlertType} from '../../types.js';
23
29
 
24
30
  export {
25
31
  TransmitterOrientation,
@@ -50,7 +56,12 @@ export enum TransmitterType {
50
56
  * - **Segments** – opt into a leading advice segment with `hasAdvice`/
51
57
  * `adviceValue` and a setpoint segment with `hasSetPoint`/`setpointValue`;
52
58
  * both are read-only and shown in the value chip for non-`indicator` types.
53
- * - **`hasAlert`** – wraps the whole transmitter in an alarm `<obc-alert-frame>`.
59
+ * - **Alert frame** – `hasAlert` wraps the whole transmitter in an
60
+ * `<obc-alert-frame>`. `alertFrameStatus`, `alertFrameType`,
61
+ * `alertFrameThickness` and `alertFrameMode` set its severity, flap, border
62
+ * and flashing, with the same names as on the automation devices; a flap
63
+ * carries the status badge and the `alert-icon`, `alert-label` and
64
+ * `alert-timer` slots.
54
65
  * - **Formatting** – `fractionDigits`, `maxDigits`, `hintedZeros` and
55
66
  * `hasSignSpacer` are forwarded to the value chip to control decimal
56
67
  * precision, muted leading-zero padding (e.g. `0012.3`) and the sign
@@ -59,23 +70,48 @@ export enum TransmitterType {
59
70
  * `value`, `adviceValue` and `setpointValue` render dashes when they are
60
71
  * `NaN`, `null` or `undefined`.
61
72
  *
73
+ * **TODO(designer):** the Figma Transmitter set (25656:45081) draws no alert
74
+ * state, so the frame and its flaps follow the automation devices.
75
+ *
62
76
  * ### Slots
63
- * | Slot Name | Conditions | Purpose |
64
- * |-----------|-------------------------|---------------------------------|
65
- * | icon | value/graph + `hasIcon` | Leading icon in the value chip. |
77
+ * | Slot Name | Conditions | Purpose |
78
+ * |-------------|----------------------------------------------------------|---------------------------------|
79
+ * | icon | value/graph + `hasIcon` | Leading icon in the value chip. |
80
+ * | alert-icon | `hasAlert` + `showAlertIcon`, large side/bottom/top flap | Custom icon in the alert flap. |
81
+ * | alert-label | `hasAlert`, bottom/top flap | Label in the alert flap. |
82
+ * | alert-timer | `hasAlert`, bottom/top flap | Timer in the alert flap. |
66
83
  *
67
84
  * @property maxDigits - Integer digits to reserve / hint (independent of `fractionDigits`).
68
85
  * @property hasSignSpacer - Reserve a minus-sign column on every segment, filled by the real sign
69
86
  * only while a value is negative, so the chip's width does not change
70
87
  * across zero.
71
88
  * @property hasDegree - Show a degree column between the value and the unit (e.g. `12.3°` then `C`).
72
- * @property hasAlert - Wrap the transmitter in an `<obc-alert-frame>` (alarm) when true.
89
+ * @property hasAlert - Wrap the transmitter in an `<obc-alert-frame>` when true.
90
+ * @property alertFrameStatus - Severity of the alert frame, which picks its colour and flap badge:
91
+ * `alarm` (default), `warning`, `caution` or one of the `level-*` severities.
92
+ * @availableWhen alertFrameStatus hasAlert==true
93
+ * @property alertFrameType - Flap of the alert frame: `regular` (default) draws the outline alone,
94
+ * `small-side-flip`, `large-side-flip`, `bottom-flip` and `top-flip` add a flap
95
+ * with the status badge.
96
+ * @availableWhen alertFrameType hasAlert==true
97
+ * @property alertFrameThickness - Border of the alert frame: `small` (default) or `large`.
98
+ * @availableWhen alertFrameThickness hasAlert==true
99
+ * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,
100
+ * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.
101
+ * @availableWhen alertFrameMode hasAlert==true
102
+ * @property showAlertCategoryIcon - Show the status badge in the flap; a small side flap without it is not drawn.
103
+ * @availableWhen showAlertCategoryIcon hasAlert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]
104
+ * @property showAlertIcon - Show the `alert-icon` slot in a large side, bottom or top flap.
105
+ * @availableWhen showAlertIcon hasAlert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]
73
106
  * @property adviceValue - Advisory value shown in the leading advice segment when `hasAdvice`.
74
107
  * @property setpointValue - Target value shown in the setpoint segment when `hasSetPoint`.
75
108
  * @property tag - Tag identifier shown when `type` is `indicator` (e.g. `TT`).
76
109
  * @property idTag - Optional identifier shown below the chip (e.g. `#0000`).
77
110
  * @property data - Trend data for the graph types: `[xValues, yValues]`.
78
111
  * @slot icon - Leading icon in the value chip.
112
+ * @slot alert-icon - Custom icon in the alert flap, shown when `hasAlert` and `showAlertIcon`.
113
+ * @slot alert-label - Label in a bottom or top alert flap, shown when `hasAlert`.
114
+ * @slot alert-timer - Timer in a bottom or top alert flap, shown when `hasAlert`.
79
115
  *
80
116
  * @experimental
81
117
  */
@@ -101,6 +137,15 @@ export class ObcTransmitter extends LitElement {
101
137
  @property({type: Boolean}) hasAdvice = false;
102
138
 
103
139
  @property({type: Boolean}) hasAlert = false;
140
+ @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;
141
+ @property({type: String}) alertFrameType: ObcAlertFrameType =
142
+ ObcAlertFrameType.Regular;
143
+ @property({type: String}) alertFrameThickness: ObcAlertFrameThickness =
144
+ ObcAlertFrameThickness.Small;
145
+ @property({type: String}) alertFrameMode: ObcAlertFrameMode =
146
+ ObcAlertFrameMode.ackedActive;
147
+ @property({type: Boolean, attribute: false}) showAlertCategoryIcon = true;
148
+ @property({type: Boolean}) showAlertIcon = false;
104
149
 
105
150
  @property({type: Number}) adviceValue?: number | null;
106
151
 
@@ -184,17 +229,29 @@ export class ObcTransmitter extends LitElement {
184
229
  `;
185
230
  }
186
231
 
232
+ private renderAlertFrame(content: TemplateResult) {
233
+ return html`
234
+ <obc-alert-frame
235
+ class="alert-frame"
236
+ .type=${this.alertFrameType}
237
+ .thickness=${this.alertFrameThickness}
238
+ .status=${this.alertFrameStatus}
239
+ .mode=${this.alertFrameMode}
240
+ .showAlertCategoryIcon=${this.showAlertCategoryIcon}
241
+ .showIcon=${this.showAlertIcon}
242
+ .wrapContent=${true}
243
+ >
244
+ ${content}
245
+ <span slot="icon"><slot name="alert-icon"></slot></span>
246
+ <span slot="label"><slot name="alert-label"></slot></span>
247
+ <span slot="timer"><slot name="alert-timer"></slot></span>
248
+ </obc-alert-frame>
249
+ `;
250
+ }
251
+
187
252
  override render() {
188
253
  const content = this.hasAlert
189
- ? html`
190
- <obc-alert-frame
191
- class="alert-frame"
192
- .type=${ObcAlertFrameType.Regular}
193
- .wrapContent=${true}
194
- >
195
- ${this.renderContent()}
196
- </obc-alert-frame>
197
- `
254
+ ? this.renderAlertFrame(this.renderContent())
198
255
  : this.renderContent();
199
256
 
200
257
  return html`
@@ -4,10 +4,12 @@ import {ObcAccordionCard, AccordionSize, Position} from './accordion-card.js';
4
4
  import './accordion-card.js';
5
5
  import '../../icons/icon-placeholder.js';
6
6
  import {
7
+ ObcAlertFrameMode,
7
8
  ObcAlertFrameStatus,
8
9
  ObcAlertFrameThickness,
9
10
  ObcAlertFrameType,
10
11
  } from '../alert-frame/alert-frame.js';
12
+ import {argTypesAlertFrame} from '../alert-frame/alert-frame-storybook-helpers.js';
11
13
 
12
14
  const meta: Meta<ObcAccordionCard> = {
13
15
  title: 'UI Components/Sections/Accordion Card',
@@ -54,18 +56,7 @@ const meta: Meta<ObcAccordionCard> = {
54
56
  control: {type: 'select'},
55
57
  options: Object.values(Position),
56
58
  },
57
- alertFrameType: {
58
- control: {type: 'select'},
59
- options: Object.values(ObcAlertFrameType),
60
- },
61
- alertFrameThickness: {
62
- control: {type: 'select'},
63
- options: Object.values(ObcAlertFrameThickness),
64
- },
65
- alertFrameStatus: {
66
- control: {type: 'select'},
67
- options: Object.values(ObcAlertFrameStatus),
68
- },
59
+ ...argTypesAlertFrame,
69
60
  },
70
61
  args: {
71
62
  cardTitle: 'Title',
@@ -82,6 +73,9 @@ const meta: Meta<ObcAccordionCard> = {
82
73
  alertFrameType: ObcAlertFrameType.Regular,
83
74
  alertFrameThickness: ObcAlertFrameThickness.Small,
84
75
  alertFrameStatus: ObcAlertFrameStatus.Alarm,
76
+ alertFrameMode: ObcAlertFrameMode.ackedActive,
77
+ showAlertCategoryIcon: true,
78
+ showAlertIcon: false,
85
79
  },
86
80
  render: (args) => html`
87
81
  <div style="width: 320px;">
@@ -100,6 +94,9 @@ const meta: Meta<ObcAccordionCard> = {
100
94
  .alertFrameType="${args.alertFrameType}"
101
95
  .alertFrameThickness="${args.alertFrameThickness}"
102
96
  .alertFrameStatus="${args.alertFrameStatus}"
97
+ .alertFrameMode="${args.alertFrameMode}"
98
+ .showAlertCategoryIcon="${args.showAlertCategoryIcon}"
99
+ .showAlertIcon="${args.showAlertIcon}"
103
100
  >
104
101
  <div slot="expanded-content">
105
102
  Lorem Ipsum is simply dummy text of the printing and typesetting
@@ -208,6 +205,9 @@ export const WithAlert: Story = {
208
205
  .alertFrameType="${args.alertFrameType}"
209
206
  .alertFrameThickness="${args.alertFrameThickness}"
210
207
  .alertFrameStatus="${args.alertFrameStatus}"
208
+ .alertFrameMode="${args.alertFrameMode}"
209
+ .showAlertCategoryIcon="${args.showAlertCategoryIcon}"
210
+ .showAlertIcon="${args.showAlertIcon}"
211
211
  >
212
212
  <div slot="expanded-content">Content with alert frame overlay</div>
213
213
  <span slot="alert-icon"><obi-placeholder></obi-placeholder></span>
@@ -287,6 +287,9 @@ export const Disabled: Story = {
287
287
  .alertFrameType="${args.alertFrameType}"
288
288
  .alertFrameThickness="${args.alertFrameThickness}"
289
289
  .alertFrameStatus="${args.alertFrameStatus}"
290
+ .alertFrameMode="${args.alertFrameMode}"
291
+ .showAlertCategoryIcon="${args.showAlertCategoryIcon}"
292
+ .showAlertIcon="${args.showAlertIcon}"
290
293
  >
291
294
  </obc-accordion-card>
292
295
  </div>
@@ -7,6 +7,7 @@ import {property} from 'lit/decorators.js';
7
7
  import '../../icons/icon-chevron-down-google.js';
8
8
  import '../alert-frame/alert-frame.js';
9
9
  import {
10
+ ObcAlertFrameMode,
10
11
  ObcAlertFrameThickness,
11
12
  ObcAlertFrameType,
12
13
  } from '../alert-frame/alert-frame.js';
@@ -57,7 +58,7 @@ export enum Position {
57
58
  * |-------------------|------------------------|-------------------------------------------------------|
58
59
  * | leading-icon | `hasLeadingIcon` true | Icon at the start of the header (e.g., `<obi-placeholder></obi-placeholder>`). |
59
60
  * | expanded-content | Always | Content revealed when the accordion is expanded. |
60
- * | alert-icon | `hasAlert` true | Icon for the alert overlay (slot="icon" in alert frame). |
61
+ * | alert-icon | `hasAlert` and `showAlertIcon` true | Icon for the alert overlay (slot="icon" in alert frame). |
61
62
  * | alert-label | `hasAlert` true | Label text for the alert overlay (slot="label" in alert frame). |
62
63
  * | alert-timer | `hasAlert` true | Timer or duration text for the alert overlay (slot="timer" in alert frame). |
63
64
  *
@@ -73,7 +74,7 @@ export enum Position {
73
74
  * - `hasLeadingIcon` (boolean): Enables leading icon slot in header.
74
75
  * - `size` (`AccordionSize` enum): Layout variant, either `'single-line'` (default) or `'large'`.
75
76
  * - `position` (`Position` enum): Controls border radius for stacking (`'top'`, `'bottom'`, `'center'`, `'regular'`).
76
- * - `alertFrameType`, `alertFrameThickness`, `alertFrameStatus`: Configure the alert overlay's appearance (see `obc-alert-frame` for details).
77
+ * - `alertFrameType`, `alertFrameThickness`, `alertFrameStatus`, `alertFrameMode`, `showAlertCategoryIcon`, `showAlertIcon`: Configure the alert overlay's appearance (see `obc-alert-frame` for details).
77
78
  *
78
79
  * ### Events
79
80
  * - `accordion-toggle` – Fired when the accordion is expanded or collapsed. Event detail includes `{ expanded, cardTitle }`.
@@ -107,7 +108,7 @@ export enum Position {
107
108
  * @availableWhen statusLabel hasStatusLabel==true
108
109
  * @property expanded - Whether the accordion card is expanded (shows additional content).
109
110
  * @property disabled - Disables the accordion card, preventing user interaction and dimming its appearance.
110
- * @property hasAlert - Shows an alert overlay above the card when true. Configure appearance with `alertFrameType`, `alertFrameThickness`, and `alertFrameStatus`.
111
+ * @property hasAlert - Shows an alert overlay above the card when true. Configure appearance with `alertFrameType`, `alertFrameThickness`, `alertFrameStatus` and `alertFrameMode`.
111
112
  * @property hasDescription - Enables the description text in the header (only in large size).
112
113
  * @property hasStatusLabel - Enables the status label in the header.
113
114
  * @property hasLeadingIcon - Enables the leading icon slot in the header.
@@ -120,6 +121,13 @@ export enum Position {
120
121
  * @property alertFrameStatus - Status of the alert frame overlay (used when `hasAlert` is true).
121
122
  * See `obc-alert-frame` for available statuses.
122
123
  * @availableWhen alertFrameStatus hasAlert==true
124
+ * @property alertFrameMode - Acknowledgement state of the alert: `acked-active` (default) is steady,
125
+ * `unacked-active` flashes, `unacked-rectified` flashes a dashed frame.
126
+ * @availableWhen alertFrameMode hasAlert==true
127
+ * @property showAlertCategoryIcon - Shows the alert category icon in the flap; a small side flap without it is not drawn.
128
+ * @availableWhen showAlertCategoryIcon hasAlert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]
129
+ * @property showAlertIcon - Shows the `alert-icon` slot in a large side, bottom or top flap.
130
+ * @availableWhen showAlertIcon hasAlert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]
123
131
  * @property position - Border radius for stacking: `regular` (default) rounds every corner,
124
132
  * `top` flattens the bottom edge, `bottom` flattens the top edge, and
125
133
  * `center` flattens both for a card in the middle of a stack.
@@ -127,7 +135,7 @@ export enum Position {
127
135
  * `large` adds a description beneath the title.
128
136
  * @slot leading-icon - Icon at the start of the header (shown when `hasLeadingIcon` is true)
129
137
  * @slot expanded-content - Content revealed when the accordion is expanded
130
- * @slot alert-icon - Icon for the alert overlay (used when `hasAlert` is true)
138
+ * @slot alert-icon - Icon for the alert overlay (used when `hasAlert` and `showAlertIcon` are true)
131
139
  * @slot alert-label - Label text for the alert overlay (used when `hasAlert` is true)
132
140
  * @slot alert-timer - Timer/duration text for the alert overlay (used when `hasAlert` is true)
133
141
  * @fires {CustomEvent<{expanded: boolean, cardTitle: string}>} accordion-toggle - Fired when the accordion is expanded or collapsed
@@ -166,6 +174,13 @@ export class ObcAccordionCard extends LitElement {
166
174
 
167
175
  @property({type: String}) alertFrameStatus: AlertType = AlertType.Alarm;
168
176
 
177
+ @property({type: String}) alertFrameMode: ObcAlertFrameMode =
178
+ ObcAlertFrameMode.ackedActive;
179
+
180
+ @property({type: Boolean, attribute: false}) showAlertCategoryIcon = true;
181
+
182
+ @property({type: Boolean}) showAlertIcon = false;
183
+
169
184
  private get shouldShowDescription() {
170
185
  return (
171
186
  this.size === AccordionSize.Large &&
@@ -317,6 +332,9 @@ export class ObcAccordionCard extends LitElement {
317
332
  .type=${this.alertFrameType}
318
333
  .thickness=${this.alertFrameThickness}
319
334
  .status=${this.alertFrameStatus}
335
+ .mode=${this.alertFrameMode}
336
+ .showAlertCategoryIcon=${this.showAlertCategoryIcon}
337
+ .showIcon=${this.showAlertIcon}
320
338
  >
321
339
  <slot name="alert-icon" slot="icon"></slot>
322
340
  <slot name="alert-label" slot="label"></slot>
@@ -0,0 +1,30 @@
1
+ import {
2
+ ObcAlertFrameMode,
3
+ ObcAlertFrameStatus,
4
+ ObcAlertFrameThickness,
5
+ ObcAlertFrameType,
6
+ } from './alert-frame.js';
7
+
8
+ /**
9
+ * Story controls for the alert-frame properties a component forwards under the
10
+ * shared names: `alertFrameType`, `alertFrameThickness`, `alertFrameStatus`
11
+ * and `alertFrameMode`. Spread it into the story's `argTypes`.
12
+ */
13
+ export const argTypesAlertFrame = {
14
+ alertFrameType: {
15
+ options: Object.values(ObcAlertFrameType),
16
+ control: {type: 'radio'},
17
+ },
18
+ alertFrameThickness: {
19
+ options: Object.values(ObcAlertFrameThickness),
20
+ control: {type: 'radio'},
21
+ },
22
+ alertFrameStatus: {
23
+ options: Object.values(ObcAlertFrameStatus),
24
+ control: {type: 'radio'},
25
+ },
26
+ alertFrameMode: {
27
+ options: Object.values(ObcAlertFrameMode),
28
+ control: {type: 'radio'},
29
+ },
30
+ } as const;
@@ -340,8 +340,7 @@ export class ObcReadout extends LitElement {
340
340
  @property({type: String}) dataQuality?: ReadoutDataQuality;
341
341
  // `boolean | …` (not `false | …`): the generated Angular wrapper widens a
342
342
  // literal-`false` union to `boolean`, which then won't assign back to a
343
- // `false`-typed element property. `wrapWithAlertFrame` treats any non-object
344
- // (incl. `true`) as "no frame", so accepting `boolean` is harmless.
343
+ // `false`-typed element property. `true` draws a default frame (`render`).
345
344
  @property({type: Object}) alert: boolean | AlertFrameConfig = false;
346
345
 
347
346
  // Per-block configuration — one object per block (see the Readout*Options types).
@@ -400,8 +400,7 @@ export class ObcReadoutListItem extends LitElement {
400
400
  @property({type: String}) dataQuality?: ReadoutListItemDataQuality;
401
401
  // `boolean | …` (not `false | …`): the generated Angular wrapper widens a
402
402
  // literal-`false` union to `boolean`, which then won't assign back to a
403
- // `false`-typed element property. `wrapWithAlertFrame` treats any non-object
404
- // (incl. `true`) as "no frame", so accepting `boolean` is harmless.
403
+ // `false`-typed element property. `true` draws a default frame (`render`).
405
404
  @property({type: Object}) alert: boolean | AlertFrameConfig = false;
406
405
 
407
406
  // Per-block configuration — one object per block (see the Readout*Options types).