@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.5 → 2.2.0-next.6

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 (76) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +542 -6
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +539 -7
  4. package/dist/components/alert-button-item/alert-button-item.css.js +65 -1
  5. package/dist/components/alert-button-item/alert-button-item.css.js.map +1 -1
  6. package/dist/components/alert-button-item/alert-button-item.d.ts +14 -1
  7. package/dist/components/alert-button-item/alert-button-item.d.ts.map +1 -1
  8. package/dist/components/alert-button-item/alert-button-item.js +19 -2
  9. package/dist/components/alert-button-item/alert-button-item.js.map +1 -1
  10. package/dist/components/alert-subsystem-button/alert-subsystem-button.css.js +120 -0
  11. package/dist/components/alert-subsystem-button/alert-subsystem-button.css.js.map +1 -0
  12. package/dist/components/alert-subsystem-button/alert-subsystem-button.d.ts +101 -0
  13. package/dist/components/alert-subsystem-button/alert-subsystem-button.d.ts.map +1 -0
  14. package/dist/components/alert-subsystem-button/alert-subsystem-button.js +107 -0
  15. package/dist/components/alert-subsystem-button/alert-subsystem-button.js.map +1 -0
  16. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.css.js +4 -0
  17. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.css.js.map +1 -1
  18. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.d.ts +3 -1
  19. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.d.ts.map +1 -1
  20. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.js +7 -1
  21. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.js.map +1 -1
  22. package/dist/components/diagnostic-button/diagnostic-button.css.js +18 -0
  23. package/dist/components/diagnostic-button/diagnostic-button.css.js.map +1 -0
  24. package/dist/components/diagnostic-button/diagnostic-button.d.ts +71 -0
  25. package/dist/components/diagnostic-button/diagnostic-button.d.ts.map +1 -0
  26. package/dist/components/diagnostic-button/diagnostic-button.js +52 -0
  27. package/dist/components/diagnostic-button/diagnostic-button.js.map +1 -0
  28. package/dist/components/diagnostic-menu/diagnostic-menu.css.js +109 -0
  29. package/dist/components/diagnostic-menu/diagnostic-menu.css.js.map +1 -0
  30. package/dist/components/diagnostic-menu/diagnostic-menu.d.ts +103 -0
  31. package/dist/components/diagnostic-menu/diagnostic-menu.d.ts.map +1 -0
  32. package/dist/components/diagnostic-menu/diagnostic-menu.js +90 -0
  33. package/dist/components/diagnostic-menu/diagnostic-menu.js.map +1 -0
  34. package/dist/components/icon-button/icon-button.js +2 -2
  35. package/dist/components/icon-button/icon-button.js.map +1 -1
  36. package/dist/components/top-bar/top-bar.css.js +1 -0
  37. package/dist/components/top-bar/top-bar.css.js.map +1 -1
  38. package/dist/components/top-bar/top-bar.d.ts +4 -0
  39. package/dist/components/top-bar/top-bar.d.ts.map +1 -1
  40. package/dist/components/top-bar/top-bar.js +1 -0
  41. package/dist/components/top-bar/top-bar.js.map +1 -1
  42. package/dist/generated/locales/es-419.d.ts +6 -0
  43. package/dist/generated/locales/es-419.d.ts.map +1 -1
  44. package/dist/generated/locales/es-419.js +6 -0
  45. package/dist/generated/locales/es-419.js.map +1 -1
  46. package/dist/generated/locales/fi-FI.d.ts +6 -0
  47. package/dist/generated/locales/fi-FI.d.ts.map +1 -1
  48. package/dist/generated/locales/fi-FI.js +6 -0
  49. package/dist/generated/locales/fi-FI.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/components/alert-button-item/alert-button-item.css +13 -1
  52. package/src/components/alert-button-item/alert-button-item.spec.ts +69 -0
  53. package/src/components/alert-button-item/alert-button-item.stories.ts +13 -0
  54. package/src/components/alert-button-item/alert-button-item.ts +32 -2
  55. package/src/components/alert-subsystem-button/alert-subsystem-button.css +42 -0
  56. package/src/components/alert-subsystem-button/alert-subsystem-button.spec.ts +142 -0
  57. package/src/components/alert-subsystem-button/alert-subsystem-button.stories.ts +69 -0
  58. package/src/components/alert-subsystem-button/alert-subsystem-button.ts +168 -0
  59. package/src/components/alert-subsystem-counter/alert-subsystem-counter.css +4 -0
  60. package/src/components/alert-subsystem-counter/alert-subsystem-counter.ts +10 -2
  61. package/src/components/diagnostic-button/diagnostic-button.css +7 -0
  62. package/src/components/diagnostic-button/diagnostic-button.spec.ts +80 -0
  63. package/src/components/diagnostic-button/diagnostic-button.stories.ts +30 -0
  64. package/src/components/diagnostic-button/diagnostic-button.ts +100 -0
  65. package/src/components/diagnostic-menu/diagnostic-menu.css +69 -0
  66. package/src/components/diagnostic-menu/diagnostic-menu.spec.ts +114 -0
  67. package/src/components/diagnostic-menu/diagnostic-menu.stories.ts +135 -0
  68. package/src/components/diagnostic-menu/diagnostic-menu.ts +171 -0
  69. package/src/components/icon-button/icon-button.stories.ts +51 -1
  70. package/src/components/icon-button/icon-button.ts +2 -2
  71. package/src/components/top-bar/top-bar-diagnostics.spec.ts +59 -0
  72. package/src/components/top-bar/top-bar.css +1 -0
  73. package/src/components/top-bar/top-bar.stories.ts +58 -0
  74. package/src/components/top-bar/top-bar.ts +5 -0
  75. package/src/generated/locales/es-419.ts +6 -0
  76. package/src/generated/locales/fi-FI.ts +6 -0
@@ -0,0 +1,171 @@
1
+ import {LitElement, html, nothing, unsafeCSS} from 'lit';
2
+ import {property, query} from 'lit/decorators.js';
3
+ import {localized, msg} from '@lit/localize';
4
+ import componentStyle from './diagnostic-menu.css?inline';
5
+ import {customElement} from '../../decorator.js';
6
+ import '../button/button.js';
7
+ import '../../icons/icon-chevron-right-google.js';
8
+ import '../alert-frame/diagnostic-badge.js';
9
+ import '../../building-blocks/alert-list/alert-list.js';
10
+ import type {ObcAlertList} from '../../building-blocks/alert-list/alert-list.js';
11
+ import {PopoverController} from '../../internal/popover-controller.js';
12
+
13
+ export type ObcDiagnosticMenuAckAllVisibleClickEvent = CustomEvent<{
14
+ visibleElements: {element: HTMLElement; index: number}[];
15
+ }>;
16
+
17
+ /**
18
+ * `<obc-diagnostic-menu>` – The panel the diagnostic button opens: a titled
19
+ * list of diagnostics with an acknowledge-all and a list button.
20
+ *
21
+ * The diagnostic counterpart of `obc-alert-menu`, without its tabs and its
22
+ * silence button: a title row, the slotted `obc-message-menu-item` rows in a
23
+ * scrolling list with an empty state, and a footer with "ACK all visible" and
24
+ * "Diagnostics list".
25
+ *
26
+ * ---
27
+ *
28
+ * ### Features
29
+ * - **Title row:** `menuTitle`, "Diagnostics" when left empty.
30
+ * - **Rows:** any number of `obc-message-menu-item` children; the list
31
+ * scrolls, slides new rows into place and shows an empty state the
32
+ * `empty-*` slots replace.
33
+ * - **ACK all visible:** enabled by `canAckAll`; fires
34
+ * `ack-all-visible-click` with the rows in view, as the alert menu does.
35
+ * - **Diagnostics list:** `showDiagnosticListButton` shows the button that
36
+ * fires `go-to-diagnostic-list-click` for the full list page.
37
+ * - **Soft dismiss:** `softDismiss` and `open` close the menu on a click
38
+ * outside or `Escape`, as every menu does.
39
+ *
40
+ * ---
41
+ *
42
+ * ### Usage Guidelines
43
+ * - Open it from `obc-diagnostic-button`'s `click` with a flag of your own,
44
+ * bound to `open` and to the button's `activated`, and reset on `close`.
45
+ * - A row is acknowledged through its own `primary-action-click`; the footer
46
+ * button reports every row in view at once.
47
+ * - Position it yourself, under the top bar's diagnostic button.
48
+ * - **TODO(designer):** the design draws an open-in-new glyph after
49
+ * "Diagnostics list" and a 696 px card that hugs its rows; neither the
50
+ * glyph nor a width token is in the library, so the button draws the
51
+ * chevron of the alert menu's "Alerts" button and the card keeps the alert
52
+ * menu's width and height (#1396).
53
+ *
54
+ * ---
55
+ *
56
+ * ### Example
57
+ *
58
+ * ```html
59
+ * <obc-diagnostic-menu canAckAll>
60
+ * <obc-message-menu-item title="Simulate" description="Value is simulated" day="Yesterday" time="09:12:34" primaryActionLabel="Action" hasPrimaryIcon>
61
+ * <obi-placeholder slot="primary-icon"></obi-placeholder>
62
+ * </obc-message-menu-item>
63
+ * </obc-diagnostic-menu>
64
+ * ```
65
+ *
66
+ * @property menuTitle - Title of the menu; "Diagnostics" when left empty.
67
+ * @property canAckAll - Enables the "ACK all visible" button; set it while a row in view can be acknowledged.
68
+ * @availableWhen canAckAll showAckAllButton==true
69
+ * @property showAckAllButton - Shows the "ACK all visible" button in the footer.
70
+ * @property showDiagnosticListButton - Shows the "Diagnostics list" button in the footer.
71
+ * @property softDismiss - Lets the menu close itself on a click outside it, on `Escape`, or when another menu opens. The page is covered while the menu is open, so the closing click reaches nothing there; only the top bar's strip stays clickable, which is how its buttons switch or close menus in one click. Wire it with three bindings: set `softDismiss`, bind `open` to a flag you keep, and reset that flag on `close`. The button that opens the menu needs no wiring of its own: flip the flag from its click. Leave it off to show and hide the menu yourself.
72
+ * @property open - Whether the menu is showing. Bind it to a flag you keep rather than toggling it from the menu's own value: when the menu closes itself, `open` is written back to `false` before the button's click reaches your handler, so `menu.open = !menu.open` gets out of step. Reset the flag on `close`.
73
+ * @availableWhen open softDismiss==true
74
+ * @slot - The diagnostics as `obc-message-menu-item` rows.
75
+ * @slot empty-title - Title of the empty state, "No diagnostics" when left unfilled.
76
+ * @slot empty-description - Description of the empty state.
77
+ * @slot empty-icon - Icon of the empty state, the diagnostic asterisk when left unfilled.
78
+ * @fires {ObcDiagnosticMenuAckAllVisibleClickEvent} ack-all-visible-click - Fired when the "ACK all visible" button is clicked, with the rows in view.
79
+ * @fires {CustomEvent<void>} go-to-diagnostic-list-click - Fired when the "Diagnostics list" button is clicked.
80
+ * @fires {CustomEvent<void>} close - Fired when the menu closed on its own, from a click outside, `Escape`, or another menu opening. `open` is already `false` by the time it arrives; reset the flag you bind to `open` here, or the next click on the button finds it still set and asks a closed menu to close.
81
+ * @experimental
82
+ */
83
+ @customElement('obc-diagnostic-menu')
84
+ @localized()
85
+ export class ObcDiagnosticMenu extends LitElement {
86
+ @property({type: Boolean}) softDismiss = false;
87
+
88
+ @property({type: Boolean}) open = false;
89
+
90
+ protected readonly softDismissController = new PopoverController(this);
91
+
92
+ @property({type: String}) menuTitle = '';
93
+
94
+ @property({type: Boolean}) canAckAll = false;
95
+
96
+ @property({type: Boolean, attribute: false}) showAckAllButton = true;
97
+
98
+ @property({type: Boolean, attribute: false}) showDiagnosticListButton = true;
99
+
100
+ @query('.list') private list!: ObcAlertList;
101
+
102
+ private handleAckAllVisibleClick() {
103
+ this.dispatchEvent(
104
+ new CustomEvent('ack-all-visible-click', {
105
+ detail: {visibleElements: this.list.getVisibleElements()},
106
+ })
107
+ );
108
+ }
109
+
110
+ override render() {
111
+ return html`
112
+ <div class="wrapper" part="wrapper">
113
+ <div class="title-container">
114
+ <h3 class="title">${this.menuTitle || msg('Diagnostics')}</h3>
115
+ </div>
116
+ <obc-alert-list class="list">
117
+ <slot></slot>
118
+ <slot name="empty-title" slot="empty-title"
119
+ >${msg('No diagnostics')}</slot
120
+ >
121
+ <slot name="empty-description" slot="empty-description"
122
+ >${msg("Go to the 'Diagnostics list' for more details.")}</slot
123
+ >
124
+ <slot name="empty-icon" slot="empty-icon"
125
+ ><obi-diagnostic-badge class="empty-badge"></obi-diagnostic-badge
126
+ ></slot>
127
+ </obc-alert-list>
128
+ <div class="action">
129
+ ${
130
+ this.showAckAllButton
131
+ ? html`<obc-button
132
+ variant="normal"
133
+ .disabled=${!this.canAckAll}
134
+ data-testid="ack-all-visible-button"
135
+ @click=${this.handleAckAllVisibleClick}
136
+ >
137
+ ${msg('ACK all visible')}
138
+ </obc-button>`
139
+ : nothing
140
+ }
141
+ ${
142
+ this.showDiagnosticListButton
143
+ ? html`<obc-button
144
+ variant="normal"
145
+ showTrailingIcon
146
+ data-testid="diagnostic-list-button"
147
+ @click=${() =>
148
+ this.dispatchEvent(
149
+ new CustomEvent('go-to-diagnostic-list-click')
150
+ )}
151
+ >
152
+ ${msg('Diagnostics list')}
153
+ <obi-chevron-right-google
154
+ slot="trailing-icon"
155
+ ></obi-chevron-right-google>
156
+ </obc-button>`
157
+ : nothing
158
+ }
159
+ </div>
160
+ </div>
161
+ `;
162
+ }
163
+
164
+ static override styles = unsafeCSS(componentStyle);
165
+ }
166
+
167
+ declare global {
168
+ interface HTMLElementTagNameMap {
169
+ 'obc-diagnostic-menu': ObcDiagnosticMenu;
170
+ }
171
+ }
@@ -1,5 +1,6 @@
1
1
  import type {Meta, StoryObj} from '@storybook/web-components-vite';
2
- import {html} from 'lit-html';
2
+ import {html} from 'lit';
3
+ import {ref} from 'lit/directives/ref.js';
3
4
  import {IconButtonVariant, ObcIconButton} from './icon-button.js';
4
5
  import './icon-button.js';
5
6
  import {iconIds, iconIdToIconHtml} from '../../storybook-util.js';
@@ -160,3 +161,52 @@ export const Progress: Story = {
160
161
  progress: 50,
161
162
  },
162
163
  };
164
+
165
+ const PROGRESS_DURATION_MS = 5000;
166
+
167
+ /**
168
+ * Drives `progress` from 0 to 100 over five seconds, then stops at 100.
169
+ * One run, so nothing on the page keeps moving (WCAG 2.2.2).
170
+ */
171
+ function animateProgress(element: Element | undefined) {
172
+ if (!(element instanceof ObcIconButton)) return;
173
+ const button = element;
174
+ let start: number | undefined;
175
+ const tick = (now: number) => {
176
+ if (!button.isConnected) return;
177
+ start ??= now;
178
+ const elapsed = now - start;
179
+ button.progress = Math.min(
180
+ 100,
181
+ Math.round((elapsed / PROGRESS_DURATION_MS) * 100)
182
+ );
183
+ if (elapsed < PROGRESS_DURATION_MS) requestAnimationFrame(tick);
184
+ };
185
+ requestAnimationFrame(tick);
186
+ }
187
+
188
+ export const ProgressAnimated: Story = {
189
+ tags: ['skip-test'],
190
+ args: {
191
+ variant: IconButtonVariant.flat,
192
+ },
193
+ argTypes: {
194
+ progress: {table: {disable: true}},
195
+ },
196
+ render: (args) => html`
197
+ <obc-icon-button
198
+ ${ref(animateProgress)}
199
+ aria-label=${args.ariaLabel}
200
+ variant=${args.variant}
201
+ ?cornerleft=${args.cornerLeft}
202
+ ?cornerright=${args.cornerRight}
203
+ ?activecolor=${args.activeColor}
204
+ ?activated=${args.activated}
205
+ ?wide=${args.wide}
206
+ ?disabled=${args.disabled}
207
+ .progress=${0}
208
+ >
209
+ ${iconIdToIconHtml(args.icon)}
210
+ </obc-icon-button>
211
+ `,
212
+ };
@@ -158,7 +158,7 @@ export class ObcIconButton extends LitElement {
158
158
  cx="20"
159
159
  cy="20"
160
160
  r="18"
161
- stroke="#325B9A"
161
+ stroke="var(--instrument-enhanced-secondary-color)"
162
162
  stroke-width="4"
163
163
  fill="none"
164
164
  />
@@ -186,7 +186,7 @@ export class ObcIconButton extends LitElement {
186
186
  fill="none"
187
187
  />
188
188
  <path
189
- d="M18 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}"
189
+ d="M20 2 A18 18 0 ${largeArcFlag} 1 ${x} ${y}"
190
190
  stroke="var(--instrument-enhanced-secondary-color)"
191
191
  stroke-width="4"
192
192
  stroke-linecap="round"
@@ -0,0 +1,59 @@
1
+ import {describe, expect, it} from 'vitest';
2
+ import {render} from 'vitest-browser-lit';
3
+ import {html} from 'lit';
4
+ import '../../main.css';
5
+ import './top-bar.js';
6
+ import type {ObcTopBar} from './top-bar.js';
7
+ import {tabStops} from '../../internal/_test-utils.js';
8
+
9
+ /**
10
+ * The diagnostic button is consumer content, so the bar only has to place
11
+ * it: after the alert area, before the dimming button, in every mode.
12
+ */
13
+ async function setup(attrs: {settings?: boolean; inactive?: boolean} = {}) {
14
+ const screen = render(
15
+ html`<button id="before">before</button>
16
+ <obc-top-bar
17
+ appTitle="App"
18
+ pageName="Page"
19
+ showDimmingButton
20
+ ?settings=${attrs.settings ?? false}
21
+ ?inactive=${attrs.inactive ?? false}
22
+ >
23
+ <button slot="alerts" id="alert">alerts</button>
24
+ <button slot="diagnostics" id="diagnostics">diagnostics</button>
25
+ </obc-top-bar>`
26
+ );
27
+ const el = screen.container.querySelector('obc-top-bar') as ObcTopBar;
28
+ await el.updateComplete;
29
+ const slot = el.shadowRoot!.querySelector<HTMLSlotElement>(
30
+ 'slot[name="diagnostics"]'
31
+ );
32
+ return {el, slot};
33
+ }
34
+
35
+ describe('obc-top-bar diagnostics slot', () => {
36
+ it('sits after the alert area and before the dimming button', async () => {
37
+ const {slot} = await setup();
38
+
39
+ expect(slot!.assignedElements().map((e) => e.id)).toEqual(['diagnostics']);
40
+ expect(slot!.previousElementSibling!.className).toBe('alert-container');
41
+ expect(slot!.nextElementSibling!.classList.contains('dimming-button')).toBe(
42
+ true
43
+ );
44
+ });
45
+
46
+ it('is the tab stop after the alert area', async () => {
47
+ await setup();
48
+ (document.getElementById('alert') as HTMLElement).focus();
49
+
50
+ const stops = await tabStops(1);
51
+
52
+ expect(stops.map((e) => e?.id)).toEqual(['diagnostics']);
53
+ });
54
+
55
+ it('is rendered in settings and inactive modes', async () => {
56
+ expect((await setup({settings: true})).slot).not.toBeNull();
57
+ expect((await setup({inactive: true})).slot).not.toBeNull();
58
+ });
59
+ });
@@ -73,6 +73,7 @@
73
73
  .apps-button,
74
74
  ::slotted([slot="asset-picker"]),
75
75
  ::slotted([slot="command-button"]),
76
+ ::slotted([slot="diagnostics"]),
76
77
  ::slotted([slot="clock"]) {
77
78
  flex-shrink: 0;
78
79
  }
@@ -10,6 +10,9 @@ import '../../icons/icon-ship.js';
10
10
  import '../alert-icon/alert-icon.js';
11
11
  import '../command-button/command-button.js';
12
12
  import '../dropdown-button/dropdown-button.js';
13
+ import '../diagnostic-button/diagnostic-button.js';
14
+ import '../diagnostic-menu/diagnostic-menu.js';
15
+ import '../message-menu-item/message-menu-item.js';
13
16
  import type {ObcDropdownButtonChangeEvent} from '../dropdown-button/dropdown-button.js';
14
17
  import {html, nothing} from 'lit';
15
18
  import {
@@ -48,6 +51,9 @@ const meta: Meta<typeof ObcTopBar> = {
48
51
  date: '2024-12-12T11:11:12.111Z',
49
52
  assets: [],
50
53
  selectedAssetKey: '',
54
+ showDiagnosticButton: false,
55
+ nDiagnostics: 3,
56
+ diagnosticMenuOpen: false,
51
57
  },
52
58
  argTypes: {
53
59
  showDate: {
@@ -153,16 +159,56 @@ const meta: Meta<typeof ObcTopBar> = {
153
159
  slot="alerts"
154
160
  >
155
161
  </obc-alert-button>
162
+ ${
163
+ args.showDiagnosticButton
164
+ ? html`<obc-diagnostic-button
165
+ slot="diagnostics"
166
+ .nAlerts=${args.nDiagnostics}
167
+ ?activated=${args.diagnosticMenuOpen}
168
+ aria-expanded=${args.diagnosticMenuOpen ? 'true' : 'false'}
169
+ ></obc-diagnostic-button>`
170
+ : nothing
171
+ }
156
172
  <obc-clock
157
173
  slot="clock"
158
174
  .date=${args.date}
159
175
  .blinkOnlyBreakpointPx=${args.clockMinimizeBreakpointPx}
160
176
  ></obc-clock>
161
177
  </obc-top-bar>
178
+ ${
179
+ args.diagnosticMenuOpen
180
+ ? html`<obc-diagnostic-menu
181
+ canAckAll
182
+ style="position: fixed; right: 4px; top: calc(var(--app-components-topbar-touch-target-size) + 4px);"
183
+ >${diagnosticRows()}</obc-diagnostic-menu
184
+ >`
185
+ : nothing
186
+ }
162
187
  `;
163
188
  },
164
189
  } satisfies Meta<ObcTopBar>;
165
190
 
191
+ const DIAGNOSTIC_DESCRIPTION =
192
+ 'A long notification message of more than one line of text and meaningful content. Sometimes it might be quite long and that is ok.';
193
+
194
+ const diagnosticRow = (title: string, open = false) =>
195
+ html`<obc-message-menu-item
196
+ title=${title}
197
+ description=${DIAGNOSTIC_DESCRIPTION}
198
+ day="Yesterday"
199
+ time="09:12:34"
200
+ primaryActionLabel="Action"
201
+ hasPrimaryIcon
202
+ ?open=${open}
203
+ ><obi-placeholder slot="primary-icon"></obi-placeholder
204
+ ></obc-message-menu-item>`;
205
+
206
+ /** The five rows of the design, the third expanded. */
207
+ const diagnosticRows = () =>
208
+ html`${diagnosticRow('Simulate')} ${diagnosticRow('Title')}
209
+ ${diagnosticRow('Title', true)} ${diagnosticRow('Title')}
210
+ ${diagnosticRow('Title')}`;
211
+
166
212
  export default meta;
167
213
  type Story = StoryObj<ObcTopBar>;
168
214
 
@@ -256,3 +302,15 @@ export const AssetPicker: Story = {
256
302
  selectedAssetKey: 'merd-b',
257
303
  },
258
304
  };
305
+
306
+ /**
307
+ * The diagnostic button after the alert area, with its menu showing, as the
308
+ * design places them (Figma scratch file `Qit0iy9CQO8bvNqbcUgzXc`, 213-31927).
309
+ */
310
+ export const Diagnostics: Story = {
311
+ args: {
312
+ showDiagnosticButton: true,
313
+ diagnosticMenuOpen: true,
314
+ alertBreakpoint: 1_000_000, // the long message item would squeeze the texts out at 1280 px
315
+ },
316
+ };
@@ -43,6 +43,7 @@ export enum ObcTopBarMenuButtonIcon {
43
43
  * - **Command Button Slot:** Slot for inserting a primary command/action button.
44
44
  * - **Asset Picker Slot:** Slot for a control that switches between the assets the page can show, such as an `obc-dropdown-button` whose label is the current asset.
45
45
  * - **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.
46
+ * - **Diagnostics Slot:** Slot for the diagnostic button, after the alert area.
46
47
  * - **Dimming Button:** Optional button for toggling display modes (e.g., day/night).
47
48
  * - **User/Profile Button:** Optional user icon for profile/account actions.
48
49
  * - **Apps Button:** Optional button for accessing additional applications or modules.
@@ -67,6 +68,7 @@ export enum ObcTopBarMenuButtonIcon {
67
68
  * - Insert custom icons or buttons using the `app-icon` and `command-button` slots.
68
69
  * - Slot an `obc-dropdown-button` into `asset-picker` when the page shows one of several assets; the app owns the list and the selection and listens for the button's `change`.
69
70
  * - Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.
71
+ * - Slot an `obc-diagnostic-button` into `diagnostics`; open its `obc-diagnostic-menu` from the button's `click` the way the user menu is opened from the user button.
70
72
  *
71
73
  * **TODO(designer):** Clarify recommended combinations of visible elements for different app contexts (e.g., when to show both user and apps buttons, or best practices for alert placement).
72
74
  *
@@ -78,6 +80,7 @@ export enum ObcTopBarMenuButtonIcon {
78
80
  * | `command-button` | `settings` is false (if provided) | Primary command or action button for the current context. |
79
81
  * | `asset-picker` | `settings` is false (if provided) | Control that switches the asset the page shows; its label is the current asset. |
80
82
  * | `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|
83
+ * | `diagnostics` | Always (if provided) | The diagnostic button (`obc-diagnostic-button`), after the alert area and before the dimming button. |
81
84
  * | `clock` | Always (if provided) | Clock component for displaying the current time. |
82
85
  *
83
86
  * ## Events
@@ -164,6 +167,7 @@ export enum ObcTopBarMenuButtonIcon {
164
167
  * @slot command-button - Primary command/action button for the current context
165
168
  * @slot asset-picker - Control that switches the asset the page shows, with the current asset as its label; an `obc-dropdown-button` fits (regular layout only, not in settings mode)
166
169
  * @slot alerts - Area for alert indicators, notification badges, or alert items
170
+ * @slot diagnostics - The diagnostic button, after the alert area and before the dimming button
167
171
  * @slot clock - Clock component for displaying the current time (shown when `showClock` is true)
168
172
  * @fires menu-button-clicked - Fired when the menu button is clicked
169
173
  * @fires dimming-button-clicked - Fired when the dimming (day/night) button is clicked
@@ -510,6 +514,7 @@ export class ObcTopBar extends LitElement {
510
514
  <div class="alert-container">
511
515
  <slot name="alerts"></slot>
512
516
  </div>
517
+ <slot name="diagnostics"></slot>
513
518
  ${
514
519
  this.showDimmingButton && !this.inactive
515
520
  ? html`<obc-icon-button
@@ -37,10 +37,16 @@
37
37
  'sa45a194b58837e4f': `Active`,
38
38
  's5ba9818f6a39054c': `Go to the 'Alert list' for more details or to manage existing alerts.`,
39
39
  'sa6ef04345891fb38': `ACK visible`,
40
+ 's5de3f4978aaa2443': `Alert list`,
40
41
  's3cf89cb47fdde7e9': `Link`,
41
42
  's47278872f6826da8': `Dusk`,
42
43
  's9e34794bcfdc6665': `Bright`,
43
44
  's33e301ba1f4a6864': `Screen Control`,
45
+ 's56df31a121d65bd7': `Diagnostics`,
46
+ 'se1fef04fe8351166': `No diagnostics`,
47
+ 'sdd913f2a088ffec7': `Go to the 'Diagnostics list' for more details.`,
48
+ 's1d82ea8c2e81ba83': `ACK all visible`,
49
+ 'sfd88a513640b6911': `Diagnostics list`,
44
50
  'sc5a5b268010fc312': `Audio muted`,
45
51
  's740deeebbea89396': `Audio on`,
46
52
  'sb1772b5e873910c2': `Microphone muted`,
@@ -51,6 +51,12 @@
51
51
  's24f3a319b88552c1': `Low`,
52
52
  'sca9e13f23f0c433e': `Diagnostic`,
53
53
  'sa45a194b58837e4f': `Active`,
54
+ 's5de3f4978aaa2443': `Alert list`,
55
+ 's56df31a121d65bd7': `Diagnostics`,
56
+ 'se1fef04fe8351166': `No diagnostics`,
57
+ 'sdd913f2a088ffec7': `Go to the 'Diagnostics list' for more details.`,
58
+ 's1d82ea8c2e81ba83': `ACK all visible`,
59
+ 'sfd88a513640b6911': `Diagnostics list`,
54
60
  'sc5a5b268010fc312': `Audio muted`,
55
61
  's740deeebbea89396': `Audio on`,
56
62
  'sb1772b5e873910c2': `Microphone muted`,