@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.166 → 2.0.0-next.167

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 (25) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +2398 -2330
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +75 -3
  4. package/dist/components/brilliance-menu/brilliance-menu.css.js +4 -0
  5. package/dist/components/brilliance-menu/brilliance-menu.css.js.map +1 -1
  6. package/dist/components/brilliance-menu/brilliance-menu.d.ts +8 -1
  7. package/dist/components/brilliance-menu/brilliance-menu.d.ts.map +1 -1
  8. package/dist/components/brilliance-menu/brilliance-menu.js +86 -32
  9. package/dist/components/brilliance-menu/brilliance-menu.js.map +1 -1
  10. package/dist/integration-systems/integration-bar/integration-bar.d.ts +4 -0
  11. package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -1
  12. package/dist/integration-systems/integration-bar/integration-bar.js +5 -0
  13. package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -1
  14. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts +4 -0
  15. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts.map +1 -1
  16. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js +5 -0
  17. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js.map +1 -1
  18. package/package.json +1 -1
  19. package/src/components/brilliance-menu/brilliance-menu.css +4 -0
  20. package/src/components/brilliance-menu/brilliance-menu.stories.ts +27 -0
  21. package/src/components/brilliance-menu/brilliance-menu.ts +96 -32
  22. package/src/integration-systems/integration-bar/integration-bar.stories.ts +19 -0
  23. package/src/integration-systems/integration-bar/integration-bar.ts +8 -0
  24. package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.stories.ts +73 -0
  25. package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.ts +8 -0
@@ -1,5 +1,5 @@
1
1
  import {HTMLTemplateResult, LitElement, html, nothing, unsafeCSS} from 'lit';
2
- import {property} from 'lit/decorators.js';
2
+ import {property, state} from 'lit/decorators.js';
3
3
  import componentStyle from './brilliance-menu.css?inline';
4
4
  import '../button/button.js';
5
5
  import '../slider/slider.js';
@@ -31,7 +31,8 @@ import '../progress-indicator-dots/progress-indicator-dots.js';
31
31
  import '../navigation-item/navigation-item.js';
32
32
  import '../app-button/app-button.js';
33
33
  import '../user-button/user-button.js';
34
- import '../tabbed-card/tabbed-card.js';
34
+ import '../tab-row/tab-row.js';
35
+ import type {TabData} from '../tab-row/tab-row.js';
35
36
  import '../../icons/icon-display-brilliance-iec.js';
36
37
  import '../../icons/icon-palette-day-night-iec.js';
37
38
 
@@ -58,6 +59,9 @@ export type ObcBrightnessChangeEvent = CustomEvent<{value: number}>;
58
59
  export type ObcLinkPaletteChangeEvent = CustomEvent<{value: boolean}>;
59
60
  export type ObcLinkBrightnessChangeEvent = CustomEvent<{value: boolean}>;
60
61
 
62
+ const BRILLIANCE_TAB_ID = 'brilliance';
63
+ const PALETTE_TAB_ID = 'palette';
64
+
61
65
  /**
62
66
  * Event fired when the palette is changed.
63
67
  * @typedef {CustomEvent<{value: ObcPalette}>} ObcPaletteChangeEvent
@@ -126,6 +130,8 @@ export type ObcLinkBrightnessChangeEvent = CustomEvent<{value: boolean}>;
126
130
  * @property brightnessMajorStep - The major step of the brightness slider.
127
131
  * @property brightnessInputVariant - The variant of the brightness input.
128
132
  * @property showScreenControlLink - If true, displays the screen control link.
133
+ * @property showAdditionalScreenControls - If true, displays the additional screen controls slot.
134
+ * @slot additional-screen-controls - Consumer-defined controls, placed after the screen control link; rendered when `showAdditionalScreenControls` is true
129
135
  * @fires {ObcPaletteChangeEvent} palette-changed - When the palette is changed
130
136
  * @fires {ObcBrightnessChangeEvent} brightness-changed - When the brightness is changed
131
137
  * @fires {ObcLinkPaletteChangeEvent} link-palette-changed - When the link palette toggle is changed
@@ -171,6 +177,8 @@ export class ObcBrillianceMenu extends LitElement {
171
177
 
172
178
  @property({type: Boolean}) showScreenControlLink = false;
173
179
 
180
+ @property({type: Boolean}) showAdditionalScreenControls = false;
181
+
174
182
  override willUpdate(_changed: Map<string, unknown>) {
175
183
  if (this.showPalette) {
176
184
  const available = this.availablePalettes;
@@ -280,6 +288,27 @@ export class ObcBrillianceMenu extends LitElement {
280
288
  return idx > 0;
281
289
  }
282
290
 
291
+ @state() private selectedTabId = BRILLIANCE_TAB_ID;
292
+
293
+ private onTabSelected(event: CustomEvent<{id: string}>) {
294
+ this.selectedTabId = event.detail.id;
295
+ }
296
+
297
+ private get tabs(): TabData[] {
298
+ return [
299
+ {
300
+ id: BRILLIANCE_TAB_ID,
301
+ title: msg('Brilliance'),
302
+ hasLeadingIcon: true,
303
+ },
304
+ {
305
+ id: PALETTE_TAB_ID,
306
+ title: `${msg('Day')}/${msg('Night')}`,
307
+ hasLeadingIcon: true,
308
+ },
309
+ ];
310
+ }
311
+
283
312
  nextPalette() {
284
313
  if (this.canIncreasePalette) {
285
314
  const palettes = this.availablePalettes;
@@ -607,42 +636,77 @@ export class ObcBrillianceMenu extends LitElement {
607
636
  }
608
637
 
609
638
  renderScreenControlLink() {
610
- if (!this.showScreenControlLink) {
611
- return nothing;
639
+ if (this.showScreenControlLink || this.showAdditionalScreenControls) {
640
+ return html`
641
+ <div class="footer">
642
+ ${
643
+ this.showScreenControlLink
644
+ ? html`
645
+ <obc-navigation-item
646
+ .label="${msg('Screen Control')}"
647
+ @click=${() => this.handleScreenControlLinkClicked()}
648
+ hasicon
649
+ >
650
+ <obc-user-button
651
+ slot="icon"
652
+ static
653
+ variant="icon"
654
+ styleType="normal"
655
+ >
656
+ <obi-screen-desk slot="icon"></obi-screen-desk>
657
+ </obc-user-button>
658
+ </obc-navigation-item>
659
+ `
660
+ : nothing
661
+ }
662
+ ${
663
+ this.showAdditionalScreenControls
664
+ ? html`<slot name="additional-screen-controls"></slot>`
665
+ : nothing
666
+ }
667
+ </div>
668
+ `;
612
669
  }
613
- return html`
614
- <div class="footer">
615
- <obc-navigation-item
616
- .label="${msg('Screen Control')}"
617
- @click=${() => this.handleScreenControlLinkClicked()}
618
- hasicon
619
- >
620
- <obc-user-button slot="icon" static variant="icon" styleType="normal">
621
- <obi-screen-desk slot="icon"></obi-screen-desk>
622
- </obc-user-button>
623
- </obc-navigation-item>
624
- </div>
625
- `;
670
+ return nothing;
626
671
  }
627
672
 
628
673
  override render() {
629
674
  if (this.variant === ObcBrillianceMenuVariant.tabbed) {
630
- return html`<obc-tabbed-card class="card" nTabs=${2} hasTabIcons>
631
- <span slot="tab-title-0">${msg('Brilliance')}</span>
632
- <obi-display-brilliance-iec
633
- slot="tab-icon-0"
634
- ></obi-display-brilliance-iec>
635
- <span slot="tab-title-1">${msg('Day')}/${msg('Night')}</span>
636
- <obi-palette-day-night-iec
637
- slot="tab-icon-1"
638
- ></obi-palette-day-night-iec>
639
- <div slot="tab-content-0">
640
- ${this.renderBrightness()} ${this.renderScreenControlLink()}
641
- </div>
642
- <div slot="tab-content-1">
643
- ${this.renderPalette()} ${this.renderScreenControlLink()}
675
+ const tabs = this.tabs;
676
+ const [brillianceTab, paletteTab] = tabs;
677
+ return html`
678
+ <div class="card tabbed">
679
+ <obc-tab-row
680
+ .tabs=${tabs}
681
+ .selectedTabId=${this.selectedTabId}
682
+ .centerContent=${true}
683
+ @tab-selected=${this.onTabSelected}
684
+ >
685
+ <obi-display-brilliance-iec
686
+ slot="tab-${BRILLIANCE_TAB_ID}-icon"
687
+ ></obi-display-brilliance-iec>
688
+ <obi-palette-day-night-iec
689
+ slot="tab-${PALETTE_TAB_ID}-icon"
690
+ ></obi-palette-day-night-iec>
691
+ </obc-tab-row>
692
+ <!-- TODO(#1312): link the panels to their tabs once obc-tab-row supports it -->
693
+ <div
694
+ role="tabpanel"
695
+ aria-label=${brillianceTab.title}
696
+ ?hidden=${this.selectedTabId !== BRILLIANCE_TAB_ID}
697
+ >
698
+ ${this.renderBrightness()}
699
+ </div>
700
+ <div
701
+ role="tabpanel"
702
+ aria-label=${paletteTab.title}
703
+ ?hidden=${this.selectedTabId !== PALETTE_TAB_ID}
704
+ >
705
+ ${this.renderPalette()}
706
+ </div>
707
+ ${this.renderScreenControlLink()}
644
708
  </div>
645
- </obc-tabbed-card>`;
709
+ `;
646
710
  } else {
647
711
  return html`
648
712
  <div class="card ${this.variant}">
@@ -314,6 +314,7 @@ const meta: Meta<IntegrationBarStoryArgs> = {
314
314
  makeLabelNamesShort: false,
315
315
  showIntegrationMenu: false,
316
316
  customSelectedColors: false,
317
+ hasRightTrayLeading: false,
317
318
  },
318
319
  argTypes: {
319
320
  containerWidthPx: {
@@ -433,6 +434,7 @@ const meta: Meta<IntegrationBarStoryArgs> = {
433
434
  .showLinkButton=${args.showLinkButton}
434
435
  .linkButtonActivated=${args.linkButtonActivated}
435
436
  .showClock=${args.showClock}
437
+ .hasRightTrayLeading=${args.hasRightTrayLeading}
436
438
  .showUserButton=${args.showUserButton}
437
439
  .userButtonActivated=${args.userButtonActivated}
438
440
  .showDimmingButton=${args.showDimmingButton}
@@ -469,6 +471,17 @@ const meta: Meta<IntegrationBarStoryArgs> = {
469
471
  showIntegrationMenu: args.showIntegrationMenu,
470
472
  customSelectedColors: args.customSelectedColors,
471
473
  })}
474
+ ${
475
+ args.hasRightTrayLeading
476
+ ? html`<obc-icon-button
477
+ slot="right-tray-leading"
478
+ variant="integration"
479
+ aria-label="Custom action"
480
+ >
481
+ <obi-placeholder></obi-placeholder>
482
+ </obc-icon-button>`
483
+ : nothing
484
+ }
472
485
  </obc-integration-bar>
473
486
  </div>
474
487
  </div>`;
@@ -514,3 +527,9 @@ export const CustomSelectedColors: Story = {
514
527
  customSelectedColors: true,
515
528
  },
516
529
  };
530
+
531
+ export const WithRightTrayLeading: Story = {
532
+ args: {
533
+ hasRightTrayLeading: true,
534
+ },
535
+ };
@@ -48,9 +48,11 @@ import {msg} from '@lit/localize';
48
48
  * @property fleetButtonSelected - Selected state of fleet button
49
49
  * @property fleetButtonActivated - Active state of fleet button while selection is pending
50
50
  * @property fleetButtonLabel - Label for the fleet button
51
+ * @property hasRightTrayLeading - Renders the `right-tray-leading` slot first in the right-hand button group
51
52
  * @slot clock - Custom clock content, rendered when `showClock` is true
52
53
  * @slot integration-buttons - Regular vessel integration buttons
53
54
  * @slot hug-buttons - Compact vessel integration buttons; slotted integration buttons are forced to hug type
55
+ * @slot right-tray-leading - Consumer-defined controls, placed first in the right-hand button group; rendered when `hasRightTrayLeading` is true
54
56
  * @fires {CustomEvent} fleet-button-click - Fired when the fleet button is clicked
55
57
  * @fires {CustomEvent} link-button-clicked - Fired when the link button is clicked
56
58
  * @fires {CustomEvent} alert-button-clicked - Fired when the alert button is clicked
@@ -83,6 +85,7 @@ export class ObcIntegrationBar extends LitElement {
83
85
  @property({type: Boolean}) fleetButtonSelected = false;
84
86
  @property({type: Boolean}) fleetButtonActivated = false;
85
87
  @property({type: String}) fleetButtonLabel = 'Fleet';
88
+ @property({type: Boolean}) hasRightTrayLeading = false;
86
89
 
87
90
  @state() private buttonsOnBar = false;
88
91
 
@@ -187,6 +190,11 @@ export class ObcIntegrationBar extends LitElement {
187
190
  'right-content-container': true,
188
191
  })}
189
192
  >
193
+ ${
194
+ this.hasRightTrayLeading
195
+ ? html`<slot name="right-tray-leading"></slot>`
196
+ : nothing
197
+ }
190
198
  ${
191
199
  this.showAlertButton
192
200
  ? html`<obc-icon-button
@@ -162,3 +162,76 @@ export const AllButtonsActivated: Story = {
162
162
  userButtonActivated: true,
163
163
  },
164
164
  };
165
+
166
+ export const SlottedRightTrayLeading: Story = {
167
+ render: (args) =>
168
+ html`<obc-integration-bar-dropdown
169
+ .showHomeButton=${false}
170
+ .homeButtonActivated=${args.homeButtonActivated}
171
+ .showLinkButton=${args.showLinkButton}
172
+ .linkButtonActivated=${args.linkButtonActivated}
173
+ .showClock=${args.showClock}
174
+ .showAlertButton=${args.showAlertButton}
175
+ .alertButtonActivated=${args.alertButtonActivated}
176
+ .showNotificationButton=${args.showNotificationButton}
177
+ .notificationButtonActivated=${args.notificationButtonActivated}
178
+ .showNotificationCount=${args.showNotificationCount}
179
+ .notificationCount=${args.notificationCount}
180
+ .showScreenButton=${args.showScreenButton}
181
+ .screenButtonActivated=${args.screenButtonActivated}
182
+ .showSystemButton=${args.showSystemButton}
183
+ .systemButtonActivated=${args.systemButtonActivated}
184
+ .showDimmingButton=${args.showDimmingButton}
185
+ .dimmingButtonActivated=${args.dimmingButtonActivated}
186
+ .showUserButton=${args.showUserButton}
187
+ .userButtonActivated=${args.userButtonActivated}
188
+ .nStatusFields=${args.nStatusFields}
189
+ .hasRightTrayLeading=${true}
190
+ >
191
+ <obc-integration-dropdown-button
192
+ slot="vessel-selector"
193
+ value="Vessel 1"
194
+ .hasFleet=${true}
195
+ .fleetLabel=${'Fleet name'}
196
+ .options=${[
197
+ {
198
+ value: 'Vessel 1',
199
+ label: 'Vessel Name 1',
200
+ icon: html`<obi-placeholder slot="icon"></obi-placeholder>`,
201
+ },
202
+ ]}
203
+ >
204
+ <obc-integration-button
205
+ slot="fleet"
206
+ .readouts=${[{label: 'Label', value: 'Value', unit: 'Unit'}]}
207
+ type=${IntegrationButtonType.rich}
208
+ >
209
+ <div slot="label">Fleet name</div>
210
+ <div slot="info-label">Label</div>
211
+ <div slot="info-status">Status</div>
212
+ </obc-integration-button>
213
+ </obc-integration-dropdown-button>
214
+ <obi-placeholder slot="status-icon-1"></obi-placeholder>
215
+ <div slot="status-label-1">Status</div>
216
+ <obi-placeholder slot="status-icon-2"></obi-placeholder>
217
+ <div slot="status-label-2">Status 2</div>
218
+ <obi-placeholder slot="status-icon-3"></obi-placeholder>
219
+ <div slot="status-label-3">Status 3</div>
220
+ <obc-clock
221
+ integrationBarMode
222
+ .date=${args.date}
223
+ .showDate=${args.showDate}
224
+ slot="clock"
225
+ .showTimezone=${args.showTimezone}
226
+ .timeZoneOffsetHours=${args.timeZoneOffsetHours}
227
+ .blinkOnlyBreakpointPx=${args.clockMinimizeBreakpointPx}
228
+ ></obc-clock>
229
+ <obc-icon-button
230
+ slot="right-tray-leading"
231
+ variant="integration"
232
+ aria-label="Custom action"
233
+ >
234
+ <obi-placeholder></obi-placeholder>
235
+ </obc-icon-button>
236
+ </obc-integration-bar-dropdown>`,
237
+ };
@@ -49,6 +49,7 @@ import {msg} from '@lit/localize';
49
49
  * @property systemButtonActivated - Pressed styling for the system button.
50
50
  * @availableWhen systemButtonActivated showSystemButton==true
51
51
  * @property nStatusFields - How many `status-icon-N`/`status-label-N` slot pairs are rendered.
52
+ * @property hasRightTrayLeading - Renders the `right-tray-leading` slot first in the right-hand button group.
52
53
  *
53
54
  * @slot vessel-selector - Vessel selector content
54
55
  * @slot status-label-1 - Label for the first status field
@@ -58,6 +59,7 @@ import {msg} from '@lit/localize';
58
59
  * @slot status-label-3 - Label for the third status field
59
60
  * @slot status-icon-3 - Icon for the third status field
60
61
  * @slot clock - Custom clock content, rendered when `showClock` is true
62
+ * @slot right-tray-leading - Consumer-defined controls, placed first in the right-hand button group; rendered when `hasRightTrayLeading` is true
61
63
  *
62
64
  * @fires {CustomEvent} home-button-clicked - Fired when the home button is clicked
63
65
  * @fires {CustomEvent} link-button-clicked - Fired when the link button is clicked
@@ -91,6 +93,7 @@ export class ObcIntegrationBarDropdown extends LitElement {
91
93
  @property({type: Boolean}) showSystemButton = false;
92
94
  @property({type: Boolean}) systemButtonActivated = false;
93
95
  @property({type: Number}) nStatusFields = 0;
96
+ @property({type: Boolean}) hasRightTrayLeading = false;
94
97
 
95
98
  private renderStatusFields() {
96
99
  if (this.nStatusFields <= 0) {
@@ -163,6 +166,11 @@ export class ObcIntegrationBarDropdown extends LitElement {
163
166
  ${this.renderStatusFields()}
164
167
  </div>
165
168
  <div class="right-side">
169
+ ${
170
+ this.hasRightTrayLeading
171
+ ? html`<slot name="right-tray-leading"></slot>`
172
+ : nothing
173
+ }
166
174
  ${
167
175
  this.showAlertButton
168
176
  ? this.renderIconButton(