@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.1 → 2.2.0-next.3

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 (36) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +42 -16
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +88 -13
  4. package/dist/components/alert-button/alert-button.d.ts +7 -2
  5. package/dist/components/alert-button/alert-button.d.ts.map +1 -1
  6. package/dist/components/alert-button/alert-button.js +5 -1
  7. package/dist/components/alert-button/alert-button.js.map +1 -1
  8. package/dist/components/alert-button-item/alert-button-item.d.ts +7 -1
  9. package/dist/components/alert-button-item/alert-button-item.d.ts.map +1 -1
  10. package/dist/components/alert-button-item/alert-button-item.js +3 -1
  11. package/dist/components/alert-button-item/alert-button-item.js.map +1 -1
  12. package/dist/components/alert-counter-item/alert-counter-item.d.ts +7 -4
  13. package/dist/components/alert-counter-item/alert-counter-item.d.ts.map +1 -1
  14. package/dist/components/alert-counter-item/alert-counter-item.js +2 -4
  15. package/dist/components/alert-counter-item/alert-counter-item.js.map +1 -1
  16. package/dist/components/badge/badge.css.js +7 -0
  17. package/dist/components/badge/badge.css.js.map +1 -1
  18. package/dist/components/top-bar/top-bar.css.js +2 -2
  19. package/dist/components/top-bar/top-bar.css.js.map +1 -1
  20. package/dist/components/top-bar/top-bar.d.ts +23 -8
  21. package/dist/components/top-bar/top-bar.d.ts.map +1 -1
  22. package/dist/components/top-bar/top-bar.js +25 -9
  23. package/dist/components/top-bar/top-bar.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/components/alert-button/alert-button.spec.ts +12 -6
  26. package/src/components/alert-button/alert-button.stories.ts +32 -1
  27. package/src/components/alert-button/alert-button.ts +8 -2
  28. package/src/components/alert-button-item/alert-button-item.spec.ts +30 -1
  29. package/src/components/alert-button-item/alert-button-item.stories.ts +28 -0
  30. package/src/components/alert-button-item/alert-button-item.ts +7 -2
  31. package/src/components/alert-counter-item/alert-counter-item.spec.ts +7 -5
  32. package/src/components/alert-counter-item/alert-counter-item.ts +8 -11
  33. package/src/components/badge/badge.css +6 -0
  34. package/src/components/top-bar/top-bar-more-button.spec.ts +60 -0
  35. package/src/components/top-bar/top-bar.css +2 -2
  36. package/src/components/top-bar/top-bar.ts +47 -14
@@ -3790,7 +3790,7 @@
3790
3790
  {
3791
3791
  "kind": "variable",
3792
3792
  "name": "ObcAlertButtonItem",
3793
- "default": "class ObcAlertButtonItem extends LitElement { constructor(..._args) { super(..._args); this.type = \"normal\"; this.nAlerts = 0; this.counter = false; this.globalCounter = false; this.counts = {}; this.shelvedCount = 0; this.blinking = false; this.flashingSpeed = FlashingSpeed.Default; this.fillHeight = false; this.ariaLabel = null; this.flashing = new FlashingController(this, () => this.resolvedFlashingSpeed); } get resolvedFlashingSpeed() { if (this.globalCounter || !this.blinking || this.nAlerts <= 0 || this.alertType === void 0) return FlashingSpeed.Fixed; return resolveFlashingSpeed(this.flashingSpeed, this.alertType, AlertFlashPhase.Active); } get accessibleName() { if (this.ariaLabel) return this.ariaLabel; const parts = [msg(\"Alerts\")]; if (this.nAlerts > 0) parts.push(String(this.nAlerts)); if (this.globalCounter) { const breakdown = alertCountsLabel(this.counts, this.shelvedCount); if (breakdown) parts.push(breakdown); } else if (this.nAlerts > 0 && this.alertType) parts.push(alertTypeLabel(this.alertType)); return parts.join(\", \"); } renderTwotoneIcon() { switch (this.alertType ? getAlertTwotoneComponent(this.alertType) : AlertTwotoneComponent.Caution) { case AlertTwotoneComponent.Critical: return html`<obi-alerts-critical-twotone useCssColor class=\"icon\" ></obi-alerts-critical-twotone>`; case AlertTwotoneComponent.Diagnostic: return html`<obi-alerts-diagnostic-twotone useCssColor class=\"icon\" ></obi-alerts-diagnostic-twotone>`; case AlertTwotoneComponent.Warning: return html`<obi-alerts-warning-twotone useCssColor class=\"icon\" ></obi-alerts-warning-twotone>`; case AlertTwotoneComponent.Caution: return html`<obi-alerts-caution-twotone useCssColor class=\"icon\" ></obi-alerts-caution-twotone>`; default: return html`<obi-alerts-alarm-twotone useCssColor class=\"icon\" ></obi-alerts-alarm-twotone>`; } } /** The blink layer shows the opposite of the steady layer in each flash. */ renderIcon(styleType, blinkLayer) { if (this.nAlerts === 0) return html`<obi-alerts class=\"icon\"></obi-alerts>`; const enhanced = styleType === \"enhanced\"; if (blinkLayer) return enhanced ? this.renderTwotoneIcon() : html`<obi-alerts class=\"icon\"></obi-alerts>`; return enhanced || this.globalCounter ? html`<obi-alerts-active class=\"icon\"></obi-alerts-active>` : this.renderTwotoneIcon(); } renderCount() { return html`<span class=\"count\">${this.nAlerts}</span>`; } renderCounts() { if (rankAlertCounts(this.counts).length === 0 && this.shelvedCount <= 0) return nothing; return html`<obc-alert-counter-item .type=${ObcAlertCounterItemType.Badges} .counts=${this.counts} .shelvedCount=${this.shelvedCount} ></obc-alert-counter-item>`; } render() { const styleType = this.globalCounter ? \"normal\" : this.type; const showCount = this.nAlerts > 0 && (this.globalCounter || this.counter && styleType !== \"flat\"); const tempo = this.resolvedFlashingSpeed; return html` <button class=${classMap({ \"alert-button\": true, [`type-${styleType}`]: true, [`alert-type-${this.alertType ?? \"none\"}`]: true, counter: showCount && !this.globalCounter, \"global-counter\": this.globalCounter, \"fill-height\": this.fillHeight, [`flash-${tempo}`]: true })} aria-label=${this.accessibleName} > ${tempo === FlashingSpeed.Fixed ? nothing : html`<div class=\"blink\" aria-hidden=\"true\"> <div class=\"content\"> ${this.renderIcon(styleType, true)} ${showCount ? this.renderCount() : nothing} </div> </div>`} <div class=\"visible-wrapper\"> ${this.globalCounter ? this.renderCounts() : nothing} <div class=\"content\"> ${this.renderIcon(styleType, false)} ${showCount ? this.renderCount() : nothing} </div> </div> </button> <span class=\"announcement\" aria-live=\"polite\" aria-atomic=\"true\" >${this.accessibleName}</span > `; } static { this.styles = unsafeCSS(alert_button_item_default); } }"
3793
+ "default": "class ObcAlertButtonItem extends LitElement { constructor(..._args) { super(..._args); this.type = \"normal\"; this.nAlerts = 0; this.counter = false; this.globalCounter = false; this.globalCounterType = ObcAlertCounterItemType.Badges; this.counts = {}; this.shelvedCount = 0; this.blinking = false; this.flashingSpeed = FlashingSpeed.Default; this.fillHeight = false; this.ariaLabel = null; this.flashing = new FlashingController(this, () => this.resolvedFlashingSpeed); } get resolvedFlashingSpeed() { if (this.globalCounter || !this.blinking || this.nAlerts <= 0 || this.alertType === void 0) return FlashingSpeed.Fixed; return resolveFlashingSpeed(this.flashingSpeed, this.alertType, AlertFlashPhase.Active); } get accessibleName() { if (this.ariaLabel) return this.ariaLabel; const parts = [msg(\"Alerts\")]; if (this.nAlerts > 0) parts.push(String(this.nAlerts)); if (this.globalCounter) { const breakdown = alertCountsLabel(this.counts, this.shelvedCount); if (breakdown) parts.push(breakdown); } else if (this.nAlerts > 0 && this.alertType) parts.push(alertTypeLabel(this.alertType)); return parts.join(\", \"); } renderTwotoneIcon() { switch (this.alertType ? getAlertTwotoneComponent(this.alertType) : AlertTwotoneComponent.Caution) { case AlertTwotoneComponent.Critical: return html`<obi-alerts-critical-twotone useCssColor class=\"icon\" ></obi-alerts-critical-twotone>`; case AlertTwotoneComponent.Diagnostic: return html`<obi-alerts-diagnostic-twotone useCssColor class=\"icon\" ></obi-alerts-diagnostic-twotone>`; case AlertTwotoneComponent.Warning: return html`<obi-alerts-warning-twotone useCssColor class=\"icon\" ></obi-alerts-warning-twotone>`; case AlertTwotoneComponent.Caution: return html`<obi-alerts-caution-twotone useCssColor class=\"icon\" ></obi-alerts-caution-twotone>`; default: return html`<obi-alerts-alarm-twotone useCssColor class=\"icon\" ></obi-alerts-alarm-twotone>`; } } /** The blink layer shows the opposite of the steady layer in each flash. */ renderIcon(styleType, blinkLayer) { if (this.nAlerts === 0) return html`<obi-alerts class=\"icon\"></obi-alerts>`; const enhanced = styleType === \"enhanced\"; if (blinkLayer) return enhanced ? this.renderTwotoneIcon() : html`<obi-alerts class=\"icon\"></obi-alerts>`; return enhanced || this.globalCounter ? html`<obi-alerts-active class=\"icon\"></obi-alerts-active>` : this.renderTwotoneIcon(); } renderCount() { return html`<span class=\"count\">${this.nAlerts}</span>`; } renderCounts() { if (rankAlertCounts(this.counts).length === 0 && this.shelvedCount <= 0) return nothing; return html`<obc-alert-counter-item .type=${this.globalCounterType} .counts=${this.counts} .shelvedCount=${this.shelvedCount} ></obc-alert-counter-item>`; } render() { const styleType = this.globalCounter ? \"normal\" : this.type; const showCount = this.nAlerts > 0 && (this.globalCounter || this.counter && styleType !== \"flat\"); const tempo = this.resolvedFlashingSpeed; return html` <button class=${classMap({ \"alert-button\": true, [`type-${styleType}`]: true, [`alert-type-${this.alertType ?? \"none\"}`]: true, counter: showCount && !this.globalCounter, \"global-counter\": this.globalCounter, \"fill-height\": this.fillHeight, [`flash-${tempo}`]: true })} aria-label=${this.accessibleName} > ${tempo === FlashingSpeed.Fixed ? nothing : html`<div class=\"blink\" aria-hidden=\"true\"> <div class=\"content\"> ${this.renderIcon(styleType, true)} ${showCount ? this.renderCount() : nothing} </div> </div>`} <div class=\"visible-wrapper\"> ${this.globalCounter ? this.renderCounts() : nothing} <div class=\"content\"> ${this.renderIcon(styleType, false)} ${showCount ? this.renderCount() : nothing} </div> </div> </button> <span class=\"announcement\" aria-live=\"polite\" aria-atomic=\"true\" >${this.accessibleName}</span > `; } static { this.styles = unsafeCSS(alert_button_item_default); } }"
3794
3794
  }
3795
3795
  ],
3796
3796
  "exports": [
@@ -3819,7 +3819,7 @@
3819
3819
  {
3820
3820
  "kind": "variable",
3821
3821
  "name": "ObcAlertButton",
3822
- "default": "class ObcAlertButton extends LitElement { constructor(..._args) { super(..._args); this.nAlerts = 0; this.type = ObcAlertButtonType.Normal; this.large = false; this.showSilenceButton = false; this.silenceButtonDisabled = false; this.counter = false; this.globalCounter = false; this.counts = {}; this.shelvedCount = 0; this.blinking = false; this.flashingSpeed = FlashingSpeed.Default; this.flatMaxBreakpointPx = 0; this.silenceButtonMinBreakpointPx = 0; this.width = window.innerWidth; this.resizeListener = () => { this.width = window.innerWidth; }; } connectedCallback() { super.connectedCallback(); window.addEventListener(\"resize\", this.resizeListener); } disconnectedCallback() { window.removeEventListener(\"resize\", this.resizeListener); super.disconnectedCallback(); } get activeType() { if (this.type === ObcAlertButtonType.Flat) return ObcAlertButtonType.Flat; if (this.width < this.flatMaxBreakpointPx) return ObcAlertButtonType.Flat; return this.type; } get showSilenceButtonDynamic() { return this.showSilenceButton && this.width >= this.silenceButtonMinBreakpointPx && this.activeType !== ObcAlertButtonType.Flat; } render() { const showSilence = this.showSilenceButtonDynamic; return html` <div class=${classMap({ wrapper: true, [`type-${this.activeType}`]: true, large: this.large })} > <obc-alert-button-item .type=${this.activeType} .alertType=${this.alertType} .nAlerts=${this.nAlerts} .counter=${this.counter} .globalCounter=${this.globalCounter && this.activeType !== ObcAlertButtonType.Flat} .counts=${this.counts} .shelvedCount=${this.shelvedCount} .blinking=${this.blinking} .flashingSpeed=${this.flashingSpeed} .fillHeight=${this.large} ?data-group-item-not-last=${showSilence} @click=${() => this.dispatchEvent(new CustomEvent(\"click-alert\"))} ></obc-alert-button-item> ${showSilence ? html` <button class=\"silence-button\" aria-label=${msg(\"Silence\")} @click=${() => this.dispatchEvent(new CustomEvent(\"click-silence\"))} ?disabled=${this.silenceButtonDisabled} > <div class=\"visible-wrapper\"> <obi-silence-iec class=\"icon\"></obi-silence-iec> </div> </button> ` : nothing} </div> `; } static { this.styles = unsafeCSS(alert_button_default); } }"
3822
+ "default": "class ObcAlertButton extends LitElement { constructor(..._args) { super(..._args); this.nAlerts = 0; this.type = ObcAlertButtonType.Normal; this.large = false; this.showSilenceButton = false; this.silenceButtonDisabled = false; this.counter = false; this.globalCounter = false; this.globalCounterType = ObcAlertCounterItemType.Badges; this.counts = {}; this.shelvedCount = 0; this.blinking = false; this.flashingSpeed = FlashingSpeed.Default; this.flatMaxBreakpointPx = 0; this.silenceButtonMinBreakpointPx = 0; this.width = window.innerWidth; this.resizeListener = () => { this.width = window.innerWidth; }; } connectedCallback() { super.connectedCallback(); window.addEventListener(\"resize\", this.resizeListener); } disconnectedCallback() { window.removeEventListener(\"resize\", this.resizeListener); super.disconnectedCallback(); } get activeType() { if (this.type === ObcAlertButtonType.Flat) return ObcAlertButtonType.Flat; if (this.width < this.flatMaxBreakpointPx) return ObcAlertButtonType.Flat; return this.type; } get showSilenceButtonDynamic() { return this.showSilenceButton && this.width >= this.silenceButtonMinBreakpointPx && this.activeType !== ObcAlertButtonType.Flat; } render() { const showSilence = this.showSilenceButtonDynamic; return html` <div class=${classMap({ wrapper: true, [`type-${this.activeType}`]: true, large: this.large })} > <obc-alert-button-item .type=${this.activeType} .alertType=${this.alertType} .nAlerts=${this.nAlerts} .counter=${this.counter} .globalCounter=${this.globalCounter && this.activeType !== ObcAlertButtonType.Flat} .globalCounterType=${this.globalCounterType} .counts=${this.counts} .shelvedCount=${this.shelvedCount} .blinking=${this.blinking} .flashingSpeed=${this.flashingSpeed} .fillHeight=${this.large} ?data-group-item-not-last=${showSilence} @click=${() => this.dispatchEvent(new CustomEvent(\"click-alert\"))} ></obc-alert-button-item> ${showSilence ? html` <button class=\"silence-button\" aria-label=${msg(\"Silence\")} @click=${() => this.dispatchEvent(new CustomEvent(\"click-silence\"))} ?disabled=${this.silenceButtonDisabled} > <div class=\"visible-wrapper\"> <obi-silence-iec class=\"icon\"></obi-silence-iec> </div> </button> ` : nothing} </div> `; } static { this.styles = unsafeCSS(alert_button_default); } }"
3823
3823
  }
3824
3824
  ],
3825
3825
  "exports": [
@@ -3838,6 +3838,14 @@
3838
3838
  "name": "ObcAlertButtonType",
3839
3839
  "module": "dist/components/alert-button/alert-button.js"
3840
3840
  }
3841
+ },
3842
+ {
3843
+ "kind": "js",
3844
+ "name": "ObcAlertCounterItemType",
3845
+ "declaration": {
3846
+ "name": "ObcAlertCounterItemType",
3847
+ "module": "dist/components/alert-button/alert-button.js"
3848
+ }
3841
3849
  }
3842
3850
  ]
3843
3851
  },
@@ -3853,7 +3861,7 @@
3853
3861
  {
3854
3862
  "kind": "variable",
3855
3863
  "name": "ObcAlertCounterItem",
3856
- "default": "class ObcAlertCounterItem extends LitElement { constructor(..._args) { super(..._args); this.type = \"badges\"; this.counts = {}; this.shelvedCount = 0; } render() { const ranked = rankAlertCounts(this.counts); if (ranked.length === 0 && this.shelvedCount <= 0) return nothing; const alertLevel = this.type === \"alert-level\"; const variant = alertLevel ? BadgeVariant.flat : BadgeVariant.default; return html` <div class=\"row\" role=\"img\" aria-label=${alertCountsLabel(this.counts, this.shelvedCount)} > ${repeat(ranked, (entry) => entry.type, (entry) => html`<obc-badge size=${BadgeSize.large} type=${entry.type} .variant=${variant} .showIcon=${alertLevel} .number=${entry.count} ></obc-badge>`)} ${this.shelvedCount > 0 ? html`<obc-badge size=${BadgeSize.large} type=${BadgeType.regular} .variant=${variant} .showIcon=${alertLevel} .number=${this.shelvedCount} > ${alertLevel ? html`<obi-alerts-shelf slot=\"badge-icon\" ></obi-alerts-shelf>` : nothing} </obc-badge>` : nothing} </div> `; } static { this.styles = unsafeCSS(alert_counter_item_default); } }"
3864
+ "default": "class ObcAlertCounterItem extends LitElement { constructor(..._args) { super(..._args); this.type = \"badges\"; this.counts = {}; this.shelvedCount = 0; } render() { const ranked = rankAlertCounts(this.counts); if (ranked.length === 0 && this.shelvedCount <= 0) return nothing; const alertLevel = this.type === \"alert-level\"; const variant = alertLevel ? BadgeVariant.flat : BadgeVariant.default; return html` <div class=\"row\" role=\"img\" aria-label=${alertCountsLabel(this.counts, this.shelvedCount)} > ${repeat(ranked, (entry) => entry.type, (entry) => html`<obc-badge size=${BadgeSize.large} type=${entry.type} .variant=${variant} .showIcon=${alertLevel} .number=${entry.count} ></obc-badge>`)} ${this.shelvedCount > 0 ? html`<obc-badge size=${BadgeSize.large} type=${BadgeType.regular} .variant=${variant} showIcon .number=${this.shelvedCount} > <obi-alerts-shelf slot=\"badge-icon\"></obi-alerts-shelf> </obc-badge>` : nothing} </div> `; } static { this.styles = unsafeCSS(alert_counter_item_default); } }"
3857
3865
  }
3858
3866
  ],
3859
3867
  "exports": [
@@ -7455,7 +7463,7 @@
7455
7463
  {
7456
7464
  "kind": "variable",
7457
7465
  "name": "ObcTopBar",
7458
- "default": "class ObcTopBar extends LitElement { constructor(..._args) { super(..._args); this.appTitle = \"App\"; this.pageName = \"Page\"; this.menuButtonIcon = \"menu\"; this.menuButtonActivated = false; this.dimmingButtonActivated = false; this.appsButtonActivated = false; this.leftMoreButtonActivated = false; this.userButtonActivated = false; this.userButtonDisabled = false; this.tall = false; this.wideMenuButton = false; this.showAppsButton = false; this.showDimmingButton = false; this.showUserButton = false; this.showClock = false; this.showDate = false; this.showAppIcon = false; this.inactive = false; this.appButtonBreakpointPx = 500; this.dimmingButtonBreakpointPx = 500; this.appTitleBreakpointPx = 500; this.userButtonBreakpointPx = 500; this.appIconBreakpointPx = 500; this.settings = false; this.breadcrumbItems = []; this.leftButtonEvent = null; this.leftButtonTimeout = null; this.isLeftButtonDown = false; this.isEmergencyBrightness = false; } dimmingButtonClicked() { /** * Fired when the dimming (day/night) button is clicked. * @event dimming-button-clicked */ this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")); } appsButtonClicked() { /** * Fired when the apps button is clicked. * @event apps-button-clicked */ this.dispatchEvent(new CustomEvent(\"apps-button-clicked\")); } leftMoreButtonClicked() { /** * Fired when the left more button is clicked. * @event left-more-button-clicked */ this.dispatchEvent(new CustomEvent(\"left-more-button-clicked\")); } userButtonClicked() { /** * Fired when the user/profile button is clicked. * @event user-button-clicked */ this.dispatchEvent(new CustomEvent(\"user-button-clicked\")); } leftButtonDown(event) { this.leftButtonEvent = event; this.isLeftButtonDown = true; this.leftButtonTimeout = setTimeout(() => { this.leftButtonEvent = null; this.dispatchEvent(new CustomEvent(\"emergency-brightness-start\")); this.isEmergencyBrightness = true; }, 500); } /** * Ends a hold. The event a short press stands for is dispatched from the * `click` that follows, not here: a menu opened while the pointer is still * going up gets closed again by that same click in current browsers, which * see it as a click outside a popover that has just opened. */ leftButtonUp() { if (this.leftButtonTimeout) { clearTimeout(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } /** * Sends the event a press of the hold button stands for. * * Enter, Space and a screen reader's activate command arrive as a `click` * with `detail` 0 and no pointer press before it, so they get the event * directly. A pointer click arrives with `detail` 1 after the press: the * event stored on the way down is sent now, unless the press ran long * enough to start emergency brightness, which used it up. */ leftButtonActivate(event, type) { if (event.detail === 0) { this.dispatchEvent(new CustomEvent(type)); return; } if (!this.leftButtonEvent) return; this.dispatchEvent(this.leftButtonEvent); this.leftButtonEvent = null; } leftButtonLeave() { if (!this.isLeftButtonDown) return; if (this.leftButtonTimeout) { clearInterval(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } render() { const leftGroup = []; if (this.settings) { leftGroup.push(html`<div class=\"menu-button\"> <obc-icon-button variant=\"flat\" aria-label=${msg(\"Close\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"close\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"close\")} > <obi-close-google></obi-close-google> </obc-icon-button> </div>`); leftGroup.push(html`<obc-icon-button variant=\"flat\" aria-label=${msg(\"Back\")} @click=${() => this.dispatchEvent(new CustomEvent(\"back\"))} > <obi-arrow-left-google></obi-arrow-left-google> </obc-icon-button>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<obc-breadcrumb .items=${this.breadcrumbItems} @breadcrumb-click=${(e) => this.dispatchEvent(new CustomEvent(\"breadcrumb-click\", { detail: e.detail }))} ></obc-breadcrumb>`); } else { if (!this.inactive) leftGroup.push(html`<div class=\"menu-button ${this.wideMenuButton ? \"wide\" : null}\"> <obc-icon-button variant=\"flat\" aria-label=${this.menuButtonIcon === \"menu\" ? msg(\"Menu\") : msg(\"Home\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"menu-button-clicked\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"menu-button-clicked\")} ?activated=${this.menuButtonActivated} > ${this.menuButtonIcon === \"menu\" ? html`<obi-menu-iec></obi-menu-iec>` : html`<obi-home></obi-home>`} </obc-icon-button> </div>`); if (this.showAppIcon) leftGroup.push(html`<div class=\"app-icon\"><slot name=\"app-icon\"></slot></div>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`); leftGroup.push(html`<slot name=\"command-button\"></slot>`); } const breakpointMoreButton = Math.max(this.appButtonBreakpointPx, this.dimmingButtonBreakpointPx); return html` <style> @media (max-width: ${breakpointMoreButton}px) { .left-more-button { display: revert !important; } .group.left > * { margin-right: 4px; margin-left: 4px; } } @media (max-width: ${this.appButtonBreakpointPx}px) { .apps-button { display: none; } } @media (max-width: ${this.dimmingButtonBreakpointPx}px) { .dimming-button { display: none; } } @media (max-width: ${this.appTitleBreakpointPx}px) { .title { display: none !important; /* the stylesheet's display wins over this inline rule otherwise */ } } @media (max-width: ${this.userButtonBreakpointPx}px) { .user-button { display: none; } } @media (max-width: ${this.appIconBreakpointPx}px) { .app-icon { display: none; } } </style> <nav class=${classMap({ wrapper: true, inactive: this.inactive, settings: this.settings, tall: this.tall })} > <div class=\"left group\">${leftGroup}</div> <div class=\"right group\"> <div class=\"alert-container\"> <slot name=\"alerts\"></slot> </div> ${this.showDimmingButton && !this.inactive ? html`<obc-icon-button class=\"dimming-button\" part=\"dimming-button\" variant=\"flat\" aria-label=${msg(\"Dimming\")} @click=${this.dimmingButtonClicked} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton && !this.inactive ? html`<obc-icon-button class=\"user-button\" variant=\"flat\" part=\"user-button\" aria-label=${msg(\"User\")} @click=${this.userButtonClicked} ?activated=${this.userButtonActivated} ?disabled=${this.userButtonDisabled} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showAppsButton && !this.inactive ? html`<obc-icon-button class=\"apps-button\" variant=\"flat\" part=\"apps-button\" aria-label=${msg(\"Apps\")} @click=${this.appsButtonClicked} ?activated=${this.appsButtonActivated} > <obi-applications></obi-applications> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} ${!this.inactive ? html`<obc-icon-button class=\"left-more-button\" part=\"left-more-button\" variant=\"flat\" aria-label=${msg(\"More\")} @click=${this.leftMoreButtonClicked} ?activated=${this.leftMoreButtonActivated} > <obi-more-vertical-google></obi-more-vertical-google> </obc-icon-button>` : null} </div> </nav> `; } static { this.styles = unsafeCSS(top_bar_default); } }"
7466
+ "default": "class ObcTopBar extends LitElement { constructor(..._args) { super(..._args); this.appTitle = \"App\"; this.pageName = \"Page\"; this.menuButtonIcon = \"menu\"; this.menuButtonActivated = false; this.dimmingButtonActivated = false; this.appsButtonActivated = false; this.moreButtonActivated = false; this.userButtonActivated = false; this.userButtonDisabled = false; this.tall = false; this.wideMenuButton = false; this.showAppsButton = false; this.showDimmingButton = false; this.showUserButton = false; this.showClock = false; this.showDate = false; this.showAppIcon = false; this.inactive = false; this.appButtonBreakpointPx = 500; this.dimmingButtonBreakpointPx = 500; this.appTitleBreakpointPx = 500; this.userButtonBreakpointPx = 500; this.appIconBreakpointPx = 500; this.settings = false; this.breadcrumbItems = []; this.leftButtonEvent = null; this.leftButtonTimeout = null; this.isLeftButtonDown = false; this.isEmergencyBrightness = false; } dimmingButtonClicked() { /** * Fired when the dimming (day/night) button is clicked. * @event dimming-button-clicked */ this.dispatchEvent(new CustomEvent(\"dimming-button-clicked\")); } appsButtonClicked() { /** * Fired when the apps button is clicked. * @event apps-button-clicked */ this.dispatchEvent(new CustomEvent(\"apps-button-clicked\")); } /** * Copies the deprecated `leftMoreButtonActivated` into * `moreButtonActivated`. A plain field rather than a getter/setter alias: * the Vue wrapper writes every prop back on its second render, and a getter * would then write `false` over the new property. */ willUpdate(changed) { super.willUpdate(changed); if (changed.has(\"leftMoreButtonActivated\") && this.leftMoreButtonActivated !== void 0) this.moreButtonActivated = this.leftMoreButtonActivated; } moreButtonClicked() { /** * Fired when the more button is clicked. * @event more-button-clicked */ this.dispatchEvent(new CustomEvent(\"more-button-clicked\")); /** * Deprecated alias of `more-button-clicked`; removed in 4.0.0. * @event left-more-button-clicked */ this.dispatchEvent(new CustomEvent(\"left-more-button-clicked\")); } userButtonClicked() { /** * Fired when the user/profile button is clicked. * @event user-button-clicked */ this.dispatchEvent(new CustomEvent(\"user-button-clicked\")); } leftButtonDown(event) { this.leftButtonEvent = event; this.isLeftButtonDown = true; this.leftButtonTimeout = setTimeout(() => { this.leftButtonEvent = null; this.dispatchEvent(new CustomEvent(\"emergency-brightness-start\")); this.isEmergencyBrightness = true; }, 500); } /** * Ends a hold. The event a short press stands for is dispatched from the * `click` that follows, not here: a menu opened while the pointer is still * going up gets closed again by that same click in current browsers, which * see it as a click outside a popover that has just opened. */ leftButtonUp() { if (this.leftButtonTimeout) { clearTimeout(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } /** * Sends the event a press of the hold button stands for. * * Enter, Space and a screen reader's activate command arrive as a `click` * with `detail` 0 and no pointer press before it, so they get the event * directly. A pointer click arrives with `detail` 1 after the press: the * event stored on the way down is sent now, unless the press ran long * enough to start emergency brightness, which used it up. */ leftButtonActivate(event, type) { if (event.detail === 0) { this.dispatchEvent(new CustomEvent(type)); return; } if (!this.leftButtonEvent) return; this.dispatchEvent(this.leftButtonEvent); this.leftButtonEvent = null; } leftButtonLeave() { if (!this.isLeftButtonDown) return; if (this.leftButtonTimeout) { clearInterval(this.leftButtonTimeout); this.leftButtonTimeout = null; } if (this.isEmergencyBrightness) { this.dispatchEvent(new CustomEvent(\"emergency-brightness-stop\")); this.isEmergencyBrightness = false; } this.isLeftButtonDown = false; } render() { const leftGroup = []; if (this.settings) { leftGroup.push(html`<div class=\"menu-button\"> <obc-icon-button variant=\"flat\" aria-label=${msg(\"Close\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"close\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"close\")} > <obi-close-google></obi-close-google> </obc-icon-button> </div>`); leftGroup.push(html`<obc-icon-button variant=\"flat\" aria-label=${msg(\"Back\")} @click=${() => this.dispatchEvent(new CustomEvent(\"back\"))} > <obi-arrow-left-google></obi-arrow-left-google> </obc-icon-button>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<obc-breadcrumb .items=${this.breadcrumbItems} @breadcrumb-click=${(e) => this.dispatchEvent(new CustomEvent(\"breadcrumb-click\", { detail: e.detail }))} ></obc-breadcrumb>`); } else { if (!this.inactive) leftGroup.push(html`<div class=\"menu-button ${this.wideMenuButton ? \"wide\" : null}\"> <obc-icon-button variant=\"flat\" aria-label=${this.menuButtonIcon === \"menu\" ? msg(\"Menu\") : msg(\"Home\")} @pointerdown=${() => this.leftButtonDown(new CustomEvent(\"menu-button-clicked\"))} @pointerup=${() => this.leftButtonUp()} @pointerleave=${() => this.leftButtonLeave()} @click=${(event) => this.leftButtonActivate(event, \"menu-button-clicked\")} ?activated=${this.menuButtonActivated} > ${this.menuButtonIcon === \"menu\" ? html`<obi-menu-iec></obi-menu-iec>` : html`<obi-home></obi-home>`} </obc-icon-button> </div>`); if (this.showAppIcon) leftGroup.push(html`<div class=\"app-icon\"><slot name=\"app-icon\"></slot></div>`); leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`); leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`); leftGroup.push(html`<slot name=\"command-button\"></slot>`); } const breakpointMoreButton = Math.max(this.appButtonBreakpointPx, this.dimmingButtonBreakpointPx, this.userButtonBreakpointPx, this.appIconBreakpointPx); return html` <style> @media (max-width: ${breakpointMoreButton}px) { .more-button { display: revert !important; } .group.left > * { margin-right: 4px; margin-left: 4px; } } @media (max-width: ${this.appButtonBreakpointPx}px) { .apps-button { display: none; } } @media (max-width: ${this.dimmingButtonBreakpointPx}px) { .dimming-button { display: none; } } @media (max-width: ${this.appTitleBreakpointPx}px) { .title { display: none !important; /* the stylesheet's display wins over this inline rule otherwise */ } } @media (max-width: ${this.userButtonBreakpointPx}px) { .user-button { display: none; } } @media (max-width: ${this.appIconBreakpointPx}px) { .app-icon { display: none; } } </style> <nav class=${classMap({ wrapper: true, inactive: this.inactive, settings: this.settings, tall: this.tall })} > <div class=\"left group\">${leftGroup}</div> <div class=\"right group\"> <div class=\"alert-container\"> <slot name=\"alerts\"></slot> </div> ${this.showDimmingButton && !this.inactive ? html`<obc-icon-button class=\"dimming-button\" part=\"dimming-button\" variant=\"flat\" aria-label=${msg(\"Dimming\")} @click=${this.dimmingButtonClicked} ?activated=${this.dimmingButtonActivated} > <obi-palette-day-night-iec></obi-palette-day-night-iec> </obc-icon-button>` : null} ${this.showUserButton && !this.inactive ? html`<obc-icon-button class=\"user-button\" variant=\"flat\" part=\"user-button\" aria-label=${msg(\"User\")} @click=${this.userButtonClicked} ?activated=${this.userButtonActivated} ?disabled=${this.userButtonDisabled} > <obi-user></obi-user> </obc-icon-button>` : null} ${this.showAppsButton && !this.inactive ? html`<obc-icon-button class=\"apps-button\" variant=\"flat\" part=\"apps-button\" aria-label=${msg(\"Apps\")} @click=${this.appsButtonClicked} ?activated=${this.appsButtonActivated} > <obi-applications></obi-applications> </obc-icon-button>` : null} ${this.showClock ? html`<slot name=\"clock\"></slot>` : null} ${!this.inactive ? html`<obc-icon-button class=\"more-button\" part=\"more-button left-more-button\" variant=\"flat\" aria-label=${msg(\"More\")} @click=${this.moreButtonClicked} ?activated=${this.moreButtonActivated} > <obi-more-vertical-google></obi-more-vertical-google> </obc-icon-button>` : null} </div> </nav> `; } static { this.styles = unsafeCSS(top_bar_default); } }"
7459
7467
  }
7460
7468
  ],
7461
7469
  "exports": [
@@ -51676,7 +51684,7 @@
51676
51684
  "declarations": [
51677
51685
  {
51678
51686
  "kind": "class",
51679
- "description": "`<obc-alert-button-item>` – The bell button that shows the alert state and count.\n\nShows the alert status as a bell in the style of the given alert type, with\nan optional counter, or as a global counter: one badge per severity, then\nthe bell and the total. `obc-alert-button` renders the item next to its\nsilence button; use the item on its own where no silence button is needed.\n\n---\n\n### Features\n- **Variants (`type`):** `flat` (icon only), `normal` (bordered, icon and\n counter) and `enhanced` (filled in the severity colour).\n- **Alert types:** `alarm`, `warning`, `caution` and the `level-*` family;\n `nAlerts` of 0 shows the idle bell.\n- **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.\n- **Global counter:** `globalCounter` shows the per-severity `counts` as\n badges, then the bell and `nAlerts`, always in the normal style.\n- **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`\n resolves (#1224).\n- **Fill height:** `fillHeight` stretches the visible button to the host\n height, as the tall `obc-alert-button` does.\n\n---\n\n### Usage Guidelines\n- Keep `nAlerts` and `counts` consistent; the item shows both as given.\n- The generated label reads e.g. \"Alerts, 12, 2 Alarm, 4 Warning,\n 6 Caution\"; an `aria-label` on the host replaces it. A visually hidden\n polite live region repeats that name, so a change of counts is announced\n without the button holding focus; the name attribute alone would change\n silently.\n- A native button, so Enter and Space activate it (APG button pattern).\n- A parent that joins another button to the item's end sets the\n `data-group-item-not-last` attribute on the host.\n- **TODO(designer):** the Figma file draws the flat item's hover, active and\n focused variants at 20 % opacity; the item uses the standard flat states.\n- **TODO(designer):** the Figma file defines no flashing for the global\n counter, so it never flashes.\n\n---\n\n### Example\n\n```html\n<obc-alert-button-item alertType=\"alarm\" nAlerts=\"3\" counter blinking></obc-alert-button-item>\n<obc-alert-button-item\n globalCounter\n nAlerts=\"12\"\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n></obc-alert-button-item>\n```",
51687
+ "description": "`<obc-alert-button-item>` – The bell button that shows the alert state and count.\n\nShows the alert status as a bell in the style of the given alert type, with\nan optional counter, or as a global counter: one badge per severity, then\nthe bell and the total. `obc-alert-button` renders the item next to its\nsilence button; use the item on its own where no silence button is needed.\n\n---\n\n### Features\n- **Variants (`type`):** `flat` (icon only), `normal` (bordered, icon and\n counter) and `enhanced` (filled in the severity colour).\n- **Alert types:** `alarm`, `warning`, `caution` and the `level-*` family;\n `nAlerts` of 0 shows the idle bell.\n- **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.\n- **Global counter:** `globalCounter` shows the per-severity `counts` as\n badges, then the bell and `nAlerts`, always in the normal style;\n `globalCounterType` picks filled badges or the severity shapes.\n- **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`\n resolves (#1224).\n- **Fill height:** `fillHeight` stretches the visible button to the host\n height, as the tall `obc-alert-button` does.\n\n---\n\n### Usage Guidelines\n- Keep `nAlerts` and `counts` consistent; the item shows both as given.\n- The generated label reads e.g. \"Alerts, 12, 2 Alarm, 4 Warning,\n 6 Caution\"; an `aria-label` on the host replaces it. A visually hidden\n polite live region repeats that name, so a change of counts is announced\n without the button holding focus; the name attribute alone would change\n silently.\n- A native button, so Enter and Space activate it (APG button pattern).\n- A parent that joins another button to the item's end sets the\n `data-group-item-not-last` attribute on the host.\n- **TODO(designer):** the Figma file draws the flat item's hover, active and\n focused variants at 20 % opacity; the item uses the standard flat states.\n- **TODO(designer):** the Figma file defines no flashing for the global\n counter, so it never flashes.\n\n---\n\n### Example\n\n```html\n<obc-alert-button-item alertType=\"alarm\" nAlerts=\"3\" counter blinking></obc-alert-button-item>\n<obc-alert-button-item\n globalCounter\n nAlerts=\"12\"\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n></obc-alert-button-item>\n```",
51680
51688
  "name": "ObcAlertButtonItem",
51681
51689
  "members": [
51682
51690
  {
@@ -51722,6 +51730,14 @@
51722
51730
  "default": "false",
51723
51731
  "description": "Shows the per-severity counts, the bell and the total instead of a single alert status."
51724
51732
  },
51733
+ {
51734
+ "kind": "field",
51735
+ "name": "globalCounterType",
51736
+ "type": {
51737
+ "text": "ObcAlertCounterItemType"
51738
+ },
51739
+ "description": "How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count)."
51740
+ },
51725
51741
  {
51726
51742
  "kind": "field",
51727
51743
  "name": "counts",
@@ -51874,7 +51890,7 @@
51874
51890
  "declarations": [
51875
51891
  {
51876
51892
  "kind": "class",
51877
- "description": "`<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n\nThis component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n\nAppears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n\n## Features\n\n- **Variants:**\n - **Flat:** Minimal, icon-only button for space-constrained layouts.\n - **Normal:** Standard button with icon and optional alert counter.\n - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n- **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n- **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n- **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them.\n- **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n- **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n- **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n- **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n\n## Usage Guidelines\n\nUse `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n\n- Use the counter to show the number of active alerts when relevant.\n- Use the silence button to provide a quick mute action, but only when space allows.\n- Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n- The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n\n**TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n\n**TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n\n## Events\n\n- `click-alert` – Fired when the main alert button is clicked.\n- `click-silence` – Fired when the silence button is clicked.\n\n## Best Practices & Constraints\n\n- Only show the counter when there are active alerts and the button is not in flat mode.\n- The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n- Blinking should be used sparingly to avoid overwhelming the user.\n- Use the large variant for touch interfaces or when the button needs to stand out.\n\n## Example\n\n```html\n<obc-alert-button\n nAlerts=\"3\"\n alertType=\"alarm\"\n type=\"enhanced\"\n counter\n showSilenceButton\n blinking\n large\n flatMaxBreakpointPx=\"600\"\n silenceButtonMinBreakpointPx=\"600\"\n></obc-alert-button>\n```\n\nIn this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.",
51893
+ "description": "`<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n\nThis component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n\nAppears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n\n## Features\n\n- **Variants:**\n - **Flat:** Minimal, icon-only button for space-constrained layouts.\n - **Normal:** Standard button with icon and optional alert counter.\n - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n- **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n- **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n- **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them; `globalCounterType` picks filled badges or the severity shapes.\n- **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n- **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n- **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n- **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n\n## Usage Guidelines\n\nUse `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n\n- Use the counter to show the number of active alerts when relevant.\n- Use the silence button to provide a quick mute action, but only when space allows.\n- Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n- The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n\n**TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n\n**TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n\n## Events\n\n- `click-alert` – Fired when the main alert button is clicked.\n- `click-silence` – Fired when the silence button is clicked.\n\n## Best Practices & Constraints\n\n- Only show the counter when there are active alerts and the button is not in flat mode.\n- The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n- Blinking should be used sparingly to avoid overwhelming the user.\n- Use the large variant for touch interfaces or when the button needs to stand out.\n\n## Example\n\n```html\n<obc-alert-button\n nAlerts=\"3\"\n alertType=\"alarm\"\n type=\"enhanced\"\n counter\n showSilenceButton\n blinking\n large\n flatMaxBreakpointPx=\"600\"\n silenceButtonMinBreakpointPx=\"600\"\n></obc-alert-button>\n```\n\nIn this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.",
51878
51894
  "name": "ObcAlertButton",
51879
51895
  "members": [
51880
51896
  {
@@ -51944,6 +51960,14 @@
51944
51960
  "default": "false",
51945
51961
  "description": "Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell."
51946
51962
  },
51963
+ {
51964
+ "kind": "field",
51965
+ "name": "globalCounterType",
51966
+ "type": {
51967
+ "text": "ObcAlertCounterItemType"
51968
+ },
51969
+ "description": "How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count)."
51970
+ },
51947
51971
  {
51948
51972
  "kind": "field",
51949
51973
  "name": "counts",
@@ -52067,6 +52091,14 @@
52067
52091
  "module": "src/components/alert-button/alert-button.ts"
52068
52092
  }
52069
52093
  },
52094
+ {
52095
+ "kind": "js",
52096
+ "name": "ObcAlertCounterItemType",
52097
+ "declaration": {
52098
+ "name": "ObcAlertCounterItemType",
52099
+ "module": "src/components/alert-button/alert-button.ts"
52100
+ }
52101
+ },
52070
52102
  {
52071
52103
  "kind": "js",
52072
52104
  "name": "ObcAlertButton",
@@ -52083,7 +52115,7 @@
52083
52115
  "declarations": [
52084
52116
  {
52085
52117
  "kind": "class",
52086
- "description": "`<obc-alert-counter-item>` – A row of alert counts, one badge per severity.\n\nRenders a large `obc-badge` for every severity with a count above zero, most\nsevere first, followed by an optional shelved count. Nothing renders when\nnothing is counted.\n\n---\n\n### Features\n- **Two types:** `badges` draws filled badges in the severity colour;\n `alert-level` draws flat badges with the severity glyph.\n- **Every severity:** `counts` takes the whole `AlertType` vocabulary,\n including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.\n- **Shelved count:** `shelvedCount` adds a neutral badge at the end, with\n the shelf icon in `alert-level`.\n- **Accessible summary:** the row is announced as one image labelled with\n the counts, e.g. \"2 Alarm, 4 Warning, 6 Caution\".\n\n---\n\n### Usage Guidelines\n- Show how many alerts are outstanding per severity in a compact space;\n `obc-alert-button-item` nests the counter for its global counter.\n- Pass the counts as one object: `.counts=${{countAlarm: 2, countWarning: 4}}`.\n- The counter is display-only: it renders no button and fires no events.\n- For a framed per-subsystem summary with a label, see\n `obc-alert-subsystem-counter`.\n- **TODO(designer):** the Figma component also has an Unacked counter type;\n how its icons map to counts is not defined yet.\n\n---\n\n### Example\n\n```html\n<obc-alert-counter-item\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n shelvedCount=\"9\"\n></obc-alert-counter-item>\n```",
52118
+ "description": "`<obc-alert-counter-item>` – A row of alert counts, one badge per severity.\n\nRenders a large `obc-badge` for every severity with a count above zero, most\nsevere first, followed by an optional shelved count. Nothing renders when\nnothing is counted.\n\n---\n\n### Features\n- **Two types:** `badges` draws filled badges in the severity colour;\n `alert-level` draws flat badges with the severity glyph.\n- **Every severity:** `counts` takes the whole `AlertType` vocabulary,\n including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.\n- **Shelved count:** `shelvedCount` adds a neutral badge with the shelf icon\n at the end.\n- **Accessible summary:** the row is announced as one image labelled with\n the counts, e.g. \"2 Alarm, 4 Warning, 6 Caution\".\n\n---\n\n### Usage Guidelines\n- Show how many alerts are outstanding per severity in a compact space;\n `obc-alert-button-item` nests the counter for its global counter.\n- Pass the counts as one object: `.counts=${{countAlarm: 2, countWarning: 4}}`.\n- The counter is display-only: it renders no button and fires no events.\n- For a framed per-subsystem summary with a label, see\n `obc-alert-subsystem-counter`.\n- **TODO(designer):** the Figma component also has an Unacked counter type;\n how its icons map to counts is not defined yet.\n- **TODO(designer):** the Figma component draws alarm, warning and caution;\n critical and diagnostic use the `level-critical` and `level-diagnostic`\n badges of `obc-badge` (#1389).\n\n---\n\n### Example\n\n```html\n<obc-alert-counter-item\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n shelvedCount=\"9\"\n></obc-alert-counter-item>\n```",
52087
52119
  "name": "ObcAlertCounterItem",
52088
52120
  "members": [
52089
52121
  {
@@ -52110,7 +52142,7 @@
52110
52142
  "text": "number"
52111
52143
  },
52112
52144
  "default": "0",
52113
- "description": "Number of shelved alerts, shown as a neutral badge after the severities; hidden at zero."
52145
+ "description": "Number of shelved alerts, shown as a neutral badge with the shelf icon after the severities; hidden at zero."
52114
52146
  },
52115
52147
  {
52116
52148
  "kind": "method",
@@ -74827,8 +74859,18 @@
74827
74859
  "declarations": [
74828
74860
  {
74829
74861
  "kind": "class",
74830
- "description": "`<obc-top-bar>` – A responsive top navigation bar component for application layouts.\n\nProvides a flexible, highly configurable top bar for application interfaces, supporting navigation, context display, quick actions, and status indicators. The top bar adapts to screen size and can show or hide elements such as menu, app icon, breadcrumbs, user/profile, clock, and alert notifications.\n\nAppears at the top of the UI, organizing primary navigation and contextual actions in a single, persistent region. Designed for use as the main app bar or header in multi-pane or dashboard-style layouts.\n\n## Features\n- **Configurable Sections:** Supports left and right-aligned groups for navigation, context, and actions.\n- **Menu Button:** Optional menu button for opening navigation drawers or sidebars; can be styled as wide or regular.\n- **App Icon Slot:** Customizable slot for displaying an application or brand icon.\n- **App Title & Page Name:** Displays the current application and page context.\n- **Breadcrumbs:** Optional breadcrumb navigation for hierarchical context (in settings mode).\n- **Command Button Slot:** Slot for inserting a primary command/action button.\n- **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.\n- **Dimming Button:** Optional button for toggling display modes (e.g., day/night).\n- **User/Profile Button:** Optional user icon for profile/account actions.\n- **Apps Button:** Optional button for accessing additional applications or modules.\n- **Clock & Date:** Optional digital clock and date display, responsive to screen size.\n- **Responsive Layout:** Multiple breakpoint properties to control visibility and layout of elements based on viewport width.\n- **Settings Mode:** Special mode with close, back, and forward navigation, breadcrumbs, and app title.\n- **Tall Variant:** Optional increased height for touch or accessibility needs.\n- **Inactive State:** Disables interactive elements and visually de-emphasizes the bar.\n\n## Variants\n- **Regular:** Standard top bar with menu, app icon, title, page name, and action slots.\n- **Settings:** Shows close, back, forward buttons, breadcrumbs, and app title for configuration or settings screens.\n- **Inactive:** Visually muted and disables interaction (e.g., when the app is locked or in a modal state).\n- **Tall:** Increases the height of the bar for improved touch targets.\n\n## Usage Guidelines\nUse `<obc-top-bar>` as the persistent header for your application, providing navigation, context, and quick access to key actions or status. Configure which elements appear via boolean properties and slots. Adjust breakpoint properties to control responsive behavior for each section.\n\n- Place navigation, branding, and context (title, breadcrumbs) on the left; actions, alerts, and status (clock, user, apps) on the right.\n- Use the `settings` property for configuration or setup screens to enable close/back/forward navigation and breadcrumbs.\n- Use the `inactive` property to visually disable the bar and its actions when the app is not interactive.\n- Insert custom icons or buttons using the `app-icon` and `command-button` slots.\n- Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.\n\n**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).\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|------------------|---------------------------------|----------------------------------------------------------------|\n| `app-icon` | `showAppIcon` is true | Custom icon representing the application or brand. |\n| `command-button` | Always (if provided) | Primary command or action button for the current context. |\n| `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|\n| `clock` | Always (if provided) | Clock component for displaying the current time. |\n\n## Events\n- `menu-button-clicked` – Fired when the menu button is clicked.\n- `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.\n- `apps-button-clicked` – Fired when the apps button is clicked.\n- `left-more-button-clicked` – Fired when the left more button is clicked.\n- `user-button-clicked` – Fired when the user/profile button is clicked.\n- `close` – Fired in settings mode when the close button is clicked.\n- `back` – Fired in settings mode when the back button is clicked.\n- `forward` – Fired in settings mode when the forward button is clicked.\n- `emergency-brightness-start` – Fired when the menu button is held for 500ms. This should increase the brightness of the screen slowly. Used when the screen is too dark.\n- `emergency-brightness-stop` – Fired when the menu button is released.\n\n## Keyboard\nEvery control in the bar is its own tab stop and activates on `Enter` and\n`Space`. The bar is a navigation landmark, not an APG toolbar: its controls\nare separate components and slotted consumer content, so a roving tabindex\nacross them is deliberately not implemented. The emergency-brightness hold\nis a pointer gesture only; from the keyboard the menu button opens the menu.\n\n## Best Practices and Constraints\n- Only show interactive elements relevant to the current context to avoid clutter.\n- Use the `alerts` slot for transient or critical notifications; persistent alerts may require a different component.\n- For accessibility, give all interactive elements labels and focus handling.\n- Adjust breakpoint properties to optimize the layout for different device sizes.\n- In settings mode, use breadcrumbs to provide clear navigation context.\n\n## Example\n\n```html\n<obc-top-bar\n appTitle=\"My App\"\n pageName=\"Dashboard\"\n showAppsButton\n showDimmingButton\n showClock\n showUserButton\n showAppIcon\n>\n <obi-placeholder slot=\"app-icon\"></obi-placeholder>\n <obc-command-button slot=\"command-button\"></obc-command-button>\n <obc-topbar-message-item slot=\"alerts\"></obc-topbar-message-item>\n <obc-clock slot=\"clock\"></obc-clock>\n</obc-top-bar>\n```",
74862
+ "description": "`<obc-top-bar>` – A responsive top navigation bar component for application layouts.\n\nProvides a flexible, highly configurable top bar for application interfaces, supporting navigation, context display, quick actions, and status indicators. The top bar adapts to screen size and can show or hide elements such as menu, app icon, breadcrumbs, user/profile, clock, and alert notifications.\n\nAppears at the top of the UI, organizing primary navigation and contextual actions in a single, persistent region. Designed for use as the main app bar or header in multi-pane or dashboard-style layouts.\n\n## Features\n- **Configurable Sections:** Supports left and right-aligned groups for navigation, context, and actions.\n- **Menu Button:** Optional menu button for opening navigation drawers or sidebars; can be styled as wide or regular.\n- **App Icon Slot:** Customizable slot for displaying an application or brand icon.\n- **App Title & Page Name:** Displays the current application and page context.\n- **Breadcrumbs:** Optional breadcrumb navigation for hierarchical context (in settings mode).\n- **Command Button Slot:** Slot for inserting a primary command/action button.\n- **Alert/Notification Area:** Slot for alert indicators, notification badges, or custom alert components.\n- **Dimming Button:** Optional button for toggling display modes (e.g., day/night).\n- **User/Profile Button:** Optional user icon for profile/account actions.\n- **Apps Button:** Optional button for accessing additional applications or modules.\n- **Clock & Date:** Optional digital clock and date display, responsive to screen size.\n- **Responsive Layout:** Multiple breakpoint properties to control visibility and layout of elements based on viewport width.\n- **Settings Mode:** Special mode with close, back, and forward navigation, breadcrumbs, and app title.\n- **Tall Variant:** Optional increased height for touch or accessibility needs.\n- **Inactive State:** Disables interactive elements and visually de-emphasizes the bar.\n\n## Variants\n- **Regular:** Standard top bar with menu, app icon, title, page name, and action slots.\n- **Settings:** Shows close, back, forward buttons, breadcrumbs, and app title for configuration or settings screens.\n- **Inactive:** Visually muted and disables interaction (e.g., when the app is locked or in a modal state).\n- **Tall:** Increases the height of the bar for improved touch targets.\n\n## Usage Guidelines\nUse `<obc-top-bar>` as the persistent header for your application, providing navigation, context, and quick access to key actions or status. Configure which elements appear via boolean properties and slots. Adjust breakpoint properties to control responsive behavior for each section.\n\n- Place navigation, branding, and context (title, breadcrumbs) on the left; actions, alerts, and status (clock, user, apps) on the right.\n- Use the `settings` property for configuration or setup screens to enable close/back/forward navigation and breadcrumbs.\n- Use the `inactive` property to visually disable the bar and its actions when the app is not interactive.\n- Insert custom icons or buttons using the `app-icon` and `command-button` slots.\n- Use the `alerts` slot to display alert indicators, notification badges, or custom alert components.\n\n**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).\n\n## Slots\n\n| Slot Name | Renders When... | Purpose |\n|------------------|---------------------------------|----------------------------------------------------------------|\n| `app-icon` | `showAppIcon` is true | Custom icon representing the application or brand. |\n| `command-button` | Always (if provided) | Primary command or action button for the current context. |\n| `alerts` | Always (if provided) | Area for alert indicators, notification badges, or alert items.|\n| `clock` | Always (if provided) | Clock component for displaying the current time. |\n\n## Events\n- `menu-button-clicked` – Fired when the menu button is clicked.\n- `dimming-button-clicked` – Fired when the dimming (day/night) button is clicked.\n- `apps-button-clicked` – Fired when the apps button is clicked.\n- `more-button-clicked` – Fired when the more button is clicked.\n- `left-more-button-clicked` – Deprecated alias of `more-button-clicked`, fired with it; removed in 4.0.0.\n- `user-button-clicked` – Fired when the user/profile button is clicked.\n- `close` – Fired in settings mode when the close button is clicked.\n- `back` – Fired in settings mode when the back button is clicked.\n- `forward` – Fired in settings mode when the forward button is clicked.\n- `emergency-brightness-start` – Fired when the menu button is held for 500ms. This should increase the brightness of the screen slowly. Used when the screen is too dark.\n- `emergency-brightness-stop` – Fired when the menu button is released.\n\n## Keyboard\nEvery control in the bar is its own tab stop and activates on `Enter` and\n`Space`. The bar is a navigation landmark, not an APG toolbar: its controls\nare separate components and slotted consumer content, so a roving tabindex\nacross them is deliberately not implemented. The emergency-brightness hold\nis a pointer gesture only; from the keyboard the menu button opens the menu.\n\n## Best Practices and Constraints\n- Only show interactive elements relevant to the current context to avoid clutter.\n- Use the `alerts` slot for transient or critical notifications; persistent alerts may require a different component.\n- For accessibility, give all interactive elements labels and focus handling.\n- Adjust breakpoint properties to optimize the layout for different device sizes.\n- In settings mode, use breadcrumbs to provide clear navigation context.\n\n## Example\n\n```html\n<obc-top-bar\n appTitle=\"My App\"\n pageName=\"Dashboard\"\n showAppsButton\n showDimmingButton\n showClock\n showUserButton\n showAppIcon\n>\n <obi-placeholder slot=\"app-icon\"></obi-placeholder>\n <obc-command-button slot=\"command-button\"></obc-command-button>\n <obc-topbar-message-item slot=\"alerts\"></obc-topbar-message-item>\n <obc-clock slot=\"clock\"></obc-clock>\n</obc-top-bar>\n```",
74831
74863
  "name": "ObcTopBar",
74864
+ "cssParts": [
74865
+ {
74866
+ "description": "The more button shown below the breakpoints.",
74867
+ "name": "more-button"
74868
+ },
74869
+ {
74870
+ "description": "Deprecated alias of the `more-button` part; removed in 4.0.0.",
74871
+ "name": "left-more-button"
74872
+ }
74873
+ ],
74832
74874
  "slots": [
74833
74875
  {
74834
74876
  "description": "Custom icon representing the application or brand (shown when `showAppIcon` is true)",
@@ -74899,12 +74941,20 @@
74899
74941
  },
74900
74942
  {
74901
74943
  "kind": "field",
74902
- "name": "leftMoreButtonActivated",
74944
+ "name": "moreButtonActivated",
74903
74945
  "type": {
74904
74946
  "text": "boolean"
74905
74947
  },
74906
74948
  "default": "false",
74907
- "description": "Highlights the left more button as active."
74949
+ "description": "Highlights the more button as active."
74950
+ },
74951
+ {
74952
+ "kind": "field",
74953
+ "name": "leftMoreButtonActivated",
74954
+ "type": {
74955
+ "text": "boolean | undefined"
74956
+ },
74957
+ "deprecated": "Use `moreButtonActivated`. Removed in 4.0.0."
74908
74958
  },
74909
74959
  {
74910
74960
  "kind": "field",
@@ -75080,7 +75130,25 @@
75080
75130
  },
75081
75131
  {
75082
75132
  "kind": "method",
75083
- "name": "leftMoreButtonClicked",
75133
+ "name": "willUpdate",
75134
+ "return": {
75135
+ "type": {
75136
+ "text": "void"
75137
+ }
75138
+ },
75139
+ "parameters": [
75140
+ {
75141
+ "name": "changed",
75142
+ "type": {
75143
+ "text": "PropertyValues<this>"
75144
+ }
75145
+ }
75146
+ ],
75147
+ "description": "Copies the deprecated `leftMoreButtonActivated` into\n`moreButtonActivated`. A plain field rather than a getter/setter alias:\nthe Vue wrapper writes every prop back on its second render, and a getter\nwould then write `false` over the new property."
75148
+ },
75149
+ {
75150
+ "kind": "method",
75151
+ "name": "moreButtonClicked",
75084
75152
  "privacy": "private"
75085
75153
  },
75086
75154
  {
@@ -75193,12 +75261,19 @@
75193
75261
  },
75194
75262
  "description": "Fired when the apps button is clicked"
75195
75263
  },
75264
+ {
75265
+ "name": "more-button-clicked",
75266
+ "type": {
75267
+ "text": "CustomEvent"
75268
+ },
75269
+ "description": "Fired when the more button is clicked"
75270
+ },
75196
75271
  {
75197
75272
  "name": "left-more-button-clicked",
75198
75273
  "type": {
75199
75274
  "text": "CustomEvent"
75200
75275
  },
75201
- "description": "Fired when the left more button is clicked"
75276
+ "description": "Deprecated: listen to `more-button-clicked` instead. Fired together with it; removed in 4.0.0."
75202
75277
  },
75203
75278
  {
75204
75279
  "name": "user-button-clicked",
@@ -1,12 +1,13 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { ObcAlertButtonType } from '../alert-button-item/alert-button-item.js';
3
+ import { ObcAlertCounterItemType } from '../alert-counter-item/alert-counter-item.js';
3
4
  import { AlertType, FlashingSpeed, AlertCounts } from '../../types.js';
4
5
  import '../../icons/icon-notification.js';
5
6
  import '../../icons/icon-notification-advice.js';
6
7
  import '../../icons/icon-notification-advice-active.js';
7
8
  import '../../icons/icon-silence-iec.js';
8
9
  import '../alert-button-item/alert-button-item.js';
9
- export { ObcAlertButtonType };
10
+ export { ObcAlertButtonType, ObcAlertCounterItemType };
10
11
  /**
11
12
  * `<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.
12
13
  *
@@ -22,7 +23,7 @@ export { ObcAlertButtonType };
22
23
  * - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.
23
24
  * - **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.
24
25
  * - **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).
25
- * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them.
26
+ * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them; `globalCounterType` picks filled badges or the severity shapes.
26
27
  * - **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.
27
28
  * - **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).
28
29
  * - **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.
@@ -80,6 +81,8 @@ export { ObcAlertButtonType };
80
81
  * @availableWhen silenceButtonDisabled showSilenceButton==true
81
82
  * @property counter - Shows the alert counter when there are active alerts and the button is not flat.
82
83
  * @property globalCounter - Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.
84
+ * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).
85
+ * @availableWhen globalCounterType globalCounter==true
83
86
  * @property counts - Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).
84
87
  * @availableWhen counts globalCounter==true
85
88
  * @property shelvedCount - Number of shelved alerts, shown after the global counter badges; hidden at zero.
@@ -112,6 +115,8 @@ export declare class ObcAlertButton extends LitElement {
112
115
  counter: boolean;
113
116
  /** Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell. */
114
117
  globalCounter: boolean;
118
+ /** How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count). */
119
+ globalCounterType: ObcAlertCounterItemType;
115
120
  /** Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts). */
116
121
  counts: AlertCounts;
117
122
  /** Number of shelved alerts, shown after the global counter badges; hidden at zero. */
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button/alert-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAKzD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,yCAAyC,CAAC;AACjD,OAAO,gDAAgD,CAAC;AACxD,OAAO,iCAAiC,CAAC;AACzC,OAAO,2CAA2C,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAG1E,OAAO,EAAC,kBAAkB,EAAC,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuFG;AACH,qBAEa,cAAe,SAAQ,UAAU;IAClB,OAAO,SAAK;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,qBAA6B;IAChC,KAAK,UAAS;IACd,iBAAiB,UAAS;IAC1B,qBAAqB,UAAS;IAC9B,OAAO,UAAS;IAChB,aAAa,UAAS;IACL,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAChB,QAAQ,UAAS;IAClB,aAAa,EAAE,aAAa,CAC9B;IACE,mBAAmB,SAAK;IACxB,4BAA4B,SAAK;IAElD,OAAO,CAAC,KAAK,CAAqB;IAE3C,OAAO,CAAC,cAAc,CAEpB;IAEO,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,KAAK,UAAU,GAQrB;IAED,OAAO,KAAK,wBAAwB,GAMnC;IAEQ,MAAM;IA+Cf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
1
+ {"version":3,"file":"alert-button.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button/alert-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAKzD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,yCAAyC,CAAC;AACjD,OAAO,gDAAgD,CAAC;AACxD,OAAO,iCAAiC,CAAC;AACzC,OAAO,2CAA2C,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAC,uBAAuB,EAAC,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAG1E,OAAO,EAAC,kBAAkB,EAAE,uBAAuB,EAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,qBAEa,cAAe,SAAQ,UAAU;IAClB,OAAO,SAAK;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,qBAA6B;IAChC,KAAK,UAAS;IACd,iBAAiB,UAAS;IAC1B,qBAAqB,UAAS;IAC9B,OAAO,UAAS;IAChB,aAAa,UAAS;IACvB,iBAAiB,EAAE,uBAAuB,CACnC;IACW,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAChB,QAAQ,UAAS;IAClB,aAAa,EAAE,aAAa,CAC9B;IACE,mBAAmB,SAAK;IACxB,4BAA4B,SAAK;IAElD,OAAO,CAAC,KAAK,CAAqB;IAE3C,OAAO,CAAC,cAAc,CAEpB;IAEO,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,KAAK,UAAU,GAQrB;IAED,OAAO,KAAK,wBAAwB,GAMnC;IAEQ,MAAM;IAgDf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -6,6 +6,7 @@ import "../../icons/icon-notification-advice.js";
6
6
  import "../../icons/icon-notification.js";
7
7
  import "../../icons/icon-silence-iec.js";
8
8
  import alert_button_default from "./alert-button.css.js";
9
+ import { ObcAlertCounterItemType } from "../alert-counter-item/alert-counter-item.js";
9
10
  import { ObcAlertButtonType } from "../alert-button-item/alert-button-item.js";
10
11
  import { localized, msg } from "@lit/localize";
11
12
  import { LitElement, html, nothing, unsafeCSS } from "lit";
@@ -22,6 +23,7 @@ var ObcAlertButton = class ObcAlertButton extends LitElement {
22
23
  this.silenceButtonDisabled = false;
23
24
  this.counter = false;
24
25
  this.globalCounter = false;
26
+ this.globalCounterType = ObcAlertCounterItemType.Badges;
25
27
  this.counts = {};
26
28
  this.shelvedCount = 0;
27
29
  this.blinking = false;
@@ -65,6 +67,7 @@ var ObcAlertButton = class ObcAlertButton extends LitElement {
65
67
  .nAlerts=${this.nAlerts}
66
68
  .counter=${this.counter}
67
69
  .globalCounter=${this.globalCounter && this.activeType !== ObcAlertButtonType.Flat}
70
+ .globalCounterType=${this.globalCounterType}
68
71
  .counts=${this.counts}
69
72
  .shelvedCount=${this.shelvedCount}
70
73
  .blinking=${this.blinking}
@@ -100,6 +103,7 @@ __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "showSilence
100
103
  __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "silenceButtonDisabled", void 0);
101
104
  __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "counter", void 0);
102
105
  __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "globalCounter", void 0);
106
+ __decorate([property({ type: String })], ObcAlertButton.prototype, "globalCounterType", void 0);
103
107
  __decorate([property({
104
108
  type: Object,
105
109
  attribute: false
@@ -112,6 +116,6 @@ __decorate([property({ type: Number })], ObcAlertButton.prototype, "silenceButto
112
116
  __decorate([state()], ObcAlertButton.prototype, "width", void 0);
113
117
  ObcAlertButton = __decorate([customElement("obc-alert-button"), localized()], ObcAlertButton);
114
118
  //#endregion
115
- export { ObcAlertButton, ObcAlertButtonType };
119
+ export { ObcAlertButton, ObcAlertButtonType, ObcAlertCounterItemType };
116
120
 
117
121
  //# sourceMappingURL=alert-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button.js","names":[],"sources":["../../../src/components/alert-button/alert-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {localized, msg} from '@lit/localize';\nimport compentStyle from './alert-button.css?inline';\nimport '../../icons/icon-notification.js';\nimport '../../icons/icon-notification-advice.js';\nimport '../../icons/icon-notification-advice-active.js';\nimport '../../icons/icon-silence-iec.js';\nimport '../alert-button-item/alert-button-item.js';\nimport {ObcAlertButtonType} from '../alert-button-item/alert-button-item.js';\nimport {AlertType, FlashingSpeed, type AlertCounts} from '../../types.js';\nimport {customElement} from '../../decorator.js';\n\nexport {ObcAlertButtonType};\n\n/**\n * `<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n *\n * This component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n *\n * Appears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n *\n * ## Features\n *\n * - **Variants:**\n * - **Flat:** Minimal, icon-only button for space-constrained layouts.\n * - **Normal:** Standard button with icon and optional alert counter.\n * - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n * - **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n * - **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them.\n * - **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n * - **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n * - **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n * - **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n *\n * ## Usage Guidelines\n *\n * Use `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n *\n * - Use the counter to show the number of active alerts when relevant.\n * - Use the silence button to provide a quick mute action, but only when space allows.\n * - Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n * - The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n *\n * **TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n *\n * **TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n *\n * ## Events\n *\n * - `click-alert` – Fired when the main alert button is clicked.\n * - `click-silence` – Fired when the silence button is clicked.\n *\n * ## Best Practices & Constraints\n *\n * - Only show the counter when there are active alerts and the button is not in flat mode.\n * - The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n * - Blinking should be used sparingly to avoid overwhelming the user.\n * - Use the large variant for touch interfaces or when the button needs to stand out.\n *\n * ## Example\n *\n * ```html\n * <obc-alert-button\n * nAlerts=\"3\"\n * alertType=\"alarm\"\n * type=\"enhanced\"\n * counter\n * showSilenceButton\n * blinking\n * large\n * flatMaxBreakpointPx=\"600\"\n * silenceButtonMinBreakpointPx=\"600\"\n * ></obc-alert-button>\n * ```\n *\n * In this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.\n *\n * @property nAlerts - Number of active alerts shown in the counter; 0 shows the idle state.\n * @property alertType - Alert type that selects the icon and colours: `alarm`, `warning`, `caution`, a `level-*` severity, or unset for the idle state.\n * @property type - Visual variant: `flat` (icon only), `normal` (default, icon and optional counter) or `enhanced` (emphasized for high-priority alerts).\n * @property large - Increases the button height and padding for touch-friendly or prominent use.\n * @property showSilenceButton - Shows the silence button when the width is at least `silenceButtonMinBreakpointPx` and the button is not flat.\n * @property silenceButtonDisabled - Disables the silence button when true.\n * @availableWhen silenceButtonDisabled showSilenceButton==true\n * @property counter - Shows the alert counter when there are active alerts and the button is not flat.\n * @property globalCounter - Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.\n * @property counts - Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).\n * @availableWhen counts globalCounter==true\n * @property shelvedCount - Number of shelved alerts, shown after the global counter badges; hidden at zero.\n * @availableWhen shelvedCount globalCounter==true\n * @property blinking - Flashes the bell for active alerts of a flashing alert type (never for caution).\n * @property flashingSpeed - Flash tempo while `blinking` is on: `default` resolves from `alertType`, `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes.\n * @availableWhen flashingSpeed blinking==true\n * @property flatMaxBreakpointPx - Window width in px below which a `normal` or `enhanced` button switches to flat mode.\n * @availableWhen flatMaxBreakpointPx type!=flat\n * @property silenceButtonMinBreakpointPx - Minimum window width in px for showing the silence button.\n * @availableWhen silenceButtonMinBreakpointPx showSilenceButton==true\n * @fires {CustomEvent<void>} click-alert - Fired when the main alert button is clicked.\n * @fires {CustomEvent<void>} click-silence - Fired when the silence button is clicked.\n * @stable\n */\n@customElement('obc-alert-button')\n@localized()\nexport class ObcAlertButton extends LitElement {\n @property({type: Number}) nAlerts = 0;\n @property({type: String}) alertType?: AlertType;\n @property({type: String}) type = ObcAlertButtonType.Normal;\n @property({type: Boolean}) large = false;\n @property({type: Boolean}) showSilenceButton = false;\n @property({type: Boolean}) silenceButtonDisabled = false;\n @property({type: Boolean}) counter = false;\n @property({type: Boolean}) globalCounter = false;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n @property({type: Boolean}) blinking = false;\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n @property({type: Number}) flatMaxBreakpointPx = 0;\n @property({type: Number}) silenceButtonMinBreakpointPx = 0;\n\n @state() private width = window.innerWidth;\n\n private resizeListener = () => {\n this.width = window.innerWidth;\n };\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.resizeListener);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('resize', this.resizeListener);\n super.disconnectedCallback();\n }\n\n private get activeType(): ObcAlertButtonType {\n if (this.type === ObcAlertButtonType.Flat) {\n return ObcAlertButtonType.Flat;\n }\n if (this.width < this.flatMaxBreakpointPx) {\n return ObcAlertButtonType.Flat;\n }\n return this.type;\n }\n\n private get showSilenceButtonDynamic(): boolean {\n return (\n this.showSilenceButton &&\n this.width >= this.silenceButtonMinBreakpointPx &&\n this.activeType !== ObcAlertButtonType.Flat\n );\n }\n\n override render() {\n const showSilence = this.showSilenceButtonDynamic;\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`type-${this.activeType}`]: true,\n large: this.large,\n })}\n >\n <obc-alert-button-item\n .type=${this.activeType}\n .alertType=${this.alertType}\n .nAlerts=${this.nAlerts}\n .counter=${this.counter}\n .globalCounter=${\n this.globalCounter && this.activeType !== ObcAlertButtonType.Flat\n }\n .counts=${this.counts}\n .shelvedCount=${this.shelvedCount}\n .blinking=${this.blinking}\n .flashingSpeed=${this.flashingSpeed}\n .fillHeight=${this.large}\n ?data-group-item-not-last=${showSilence}\n @click=${() => this.dispatchEvent(new CustomEvent('click-alert'))}\n ></obc-alert-button-item>\n ${\n showSilence\n ? html`\n <button\n class=\"silence-button\"\n aria-label=${msg('Silence')}\n @click=${() =>\n this.dispatchEvent(new CustomEvent('click-silence'))}\n ?disabled=${this.silenceButtonDisabled}\n >\n <div class=\"visible-wrapper\">\n <obi-silence-iec class=\"icon\"></obi-silence-iec>\n </div>\n </button>\n `\n : nothing\n }\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-button': ObcAlertButton;\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"alert-button.js","names":[],"sources":["../../../src/components/alert-button/alert-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {localized, msg} from '@lit/localize';\nimport compentStyle from './alert-button.css?inline';\nimport '../../icons/icon-notification.js';\nimport '../../icons/icon-notification-advice.js';\nimport '../../icons/icon-notification-advice-active.js';\nimport '../../icons/icon-silence-iec.js';\nimport '../alert-button-item/alert-button-item.js';\nimport {ObcAlertButtonType} from '../alert-button-item/alert-button-item.js';\nimport {ObcAlertCounterItemType} from '../alert-counter-item/alert-counter-item.js';\nimport {AlertType, FlashingSpeed, type AlertCounts} from '../../types.js';\nimport {customElement} from '../../decorator.js';\n\nexport {ObcAlertButtonType, ObcAlertCounterItemType};\n\n/**\n * `<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n *\n * This component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n *\n * Appears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n *\n * ## Features\n *\n * - **Variants:**\n * - **Flat:** Minimal, icon-only button for space-constrained layouts.\n * - **Normal:** Standard button with icon and optional alert counter.\n * - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n * - **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n * - **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them; `globalCounterType` picks filled badges or the severity shapes.\n * - **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n * - **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n * - **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n * - **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n *\n * ## Usage Guidelines\n *\n * Use `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n *\n * - Use the counter to show the number of active alerts when relevant.\n * - Use the silence button to provide a quick mute action, but only when space allows.\n * - Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n * - The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n *\n * **TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n *\n * **TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n *\n * ## Events\n *\n * - `click-alert` – Fired when the main alert button is clicked.\n * - `click-silence` – Fired when the silence button is clicked.\n *\n * ## Best Practices & Constraints\n *\n * - Only show the counter when there are active alerts and the button is not in flat mode.\n * - The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n * - Blinking should be used sparingly to avoid overwhelming the user.\n * - Use the large variant for touch interfaces or when the button needs to stand out.\n *\n * ## Example\n *\n * ```html\n * <obc-alert-button\n * nAlerts=\"3\"\n * alertType=\"alarm\"\n * type=\"enhanced\"\n * counter\n * showSilenceButton\n * blinking\n * large\n * flatMaxBreakpointPx=\"600\"\n * silenceButtonMinBreakpointPx=\"600\"\n * ></obc-alert-button>\n * ```\n *\n * In this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.\n *\n * @property nAlerts - Number of active alerts shown in the counter; 0 shows the idle state.\n * @property alertType - Alert type that selects the icon and colours: `alarm`, `warning`, `caution`, a `level-*` severity, or unset for the idle state.\n * @property type - Visual variant: `flat` (icon only), `normal` (default, icon and optional counter) or `enhanced` (emphasized for high-priority alerts).\n * @property large - Increases the button height and padding for touch-friendly or prominent use.\n * @property showSilenceButton - Shows the silence button when the width is at least `silenceButtonMinBreakpointPx` and the button is not flat.\n * @property silenceButtonDisabled - Disables the silence button when true.\n * @availableWhen silenceButtonDisabled showSilenceButton==true\n * @property counter - Shows the alert counter when there are active alerts and the button is not flat.\n * @property globalCounter - Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.\n * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n * @availableWhen globalCounterType globalCounter==true\n * @property counts - Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).\n * @availableWhen counts globalCounter==true\n * @property shelvedCount - Number of shelved alerts, shown after the global counter badges; hidden at zero.\n * @availableWhen shelvedCount globalCounter==true\n * @property blinking - Flashes the bell for active alerts of a flashing alert type (never for caution).\n * @property flashingSpeed - Flash tempo while `blinking` is on: `default` resolves from `alertType`, `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes.\n * @availableWhen flashingSpeed blinking==true\n * @property flatMaxBreakpointPx - Window width in px below which a `normal` or `enhanced` button switches to flat mode.\n * @availableWhen flatMaxBreakpointPx type!=flat\n * @property silenceButtonMinBreakpointPx - Minimum window width in px for showing the silence button.\n * @availableWhen silenceButtonMinBreakpointPx showSilenceButton==true\n * @fires {CustomEvent<void>} click-alert - Fired when the main alert button is clicked.\n * @fires {CustomEvent<void>} click-silence - Fired when the silence button is clicked.\n * @stable\n */\n@customElement('obc-alert-button')\n@localized()\nexport class ObcAlertButton extends LitElement {\n @property({type: Number}) nAlerts = 0;\n @property({type: String}) alertType?: AlertType;\n @property({type: String}) type = ObcAlertButtonType.Normal;\n @property({type: Boolean}) large = false;\n @property({type: Boolean}) showSilenceButton = false;\n @property({type: Boolean}) silenceButtonDisabled = false;\n @property({type: Boolean}) counter = false;\n @property({type: Boolean}) globalCounter = false;\n @property({type: String}) globalCounterType: ObcAlertCounterItemType =\n ObcAlertCounterItemType.Badges;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n @property({type: Boolean}) blinking = false;\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n @property({type: Number}) flatMaxBreakpointPx = 0;\n @property({type: Number}) silenceButtonMinBreakpointPx = 0;\n\n @state() private width = window.innerWidth;\n\n private resizeListener = () => {\n this.width = window.innerWidth;\n };\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.resizeListener);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('resize', this.resizeListener);\n super.disconnectedCallback();\n }\n\n private get activeType(): ObcAlertButtonType {\n if (this.type === ObcAlertButtonType.Flat) {\n return ObcAlertButtonType.Flat;\n }\n if (this.width < this.flatMaxBreakpointPx) {\n return ObcAlertButtonType.Flat;\n }\n return this.type;\n }\n\n private get showSilenceButtonDynamic(): boolean {\n return (\n this.showSilenceButton &&\n this.width >= this.silenceButtonMinBreakpointPx &&\n this.activeType !== ObcAlertButtonType.Flat\n );\n }\n\n override render() {\n const showSilence = this.showSilenceButtonDynamic;\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`type-${this.activeType}`]: true,\n large: this.large,\n })}\n >\n <obc-alert-button-item\n .type=${this.activeType}\n .alertType=${this.alertType}\n .nAlerts=${this.nAlerts}\n .counter=${this.counter}\n .globalCounter=${\n this.globalCounter && this.activeType !== ObcAlertButtonType.Flat\n }\n .globalCounterType=${this.globalCounterType}\n .counts=${this.counts}\n .shelvedCount=${this.shelvedCount}\n .blinking=${this.blinking}\n .flashingSpeed=${this.flashingSpeed}\n .fillHeight=${this.large}\n ?data-group-item-not-last=${showSilence}\n @click=${() => this.dispatchEvent(new CustomEvent('click-alert'))}\n ></obc-alert-button-item>\n ${\n showSilence\n ? html`\n <button\n class=\"silence-button\"\n aria-label=${msg('Silence')}\n @click=${() =>\n this.dispatchEvent(new CustomEvent('click-silence'))}\n ?disabled=${this.silenceButtonDisabled}\n >\n <div class=\"visible-wrapper\">\n <obi-silence-iec class=\"icon\"></obi-silence-iec>\n </div>\n </button>\n `\n : nothing\n }\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-button': ObcAlertButton;\n }\n}\n"],"mappings":"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"}
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { ObcAlertCounterItemType } from '../alert-counter-item/alert-counter-item.js';
2
3
  import { AlertType, FlashingSpeed, AlertCounts, ResolvedFlashingSpeed } from '../../types.js';
3
4
  import { FlashingController } from '../../palettes/flashing-controller.js';
4
5
  import '../../icons/icon-alerts.js';
@@ -38,7 +39,8 @@ export declare enum ObcAlertButtonType {
38
39
  * `nAlerts` of 0 shows the idle bell.
39
40
  * - **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.
40
41
  * - **Global counter:** `globalCounter` shows the per-severity `counts` as
41
- * badges, then the bell and `nAlerts`, always in the normal style.
42
+ * badges, then the bell and `nAlerts`, always in the normal style;
43
+ * `globalCounterType` picks filled badges or the severity shapes.
42
44
  * - **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`
43
45
  * resolves (#1224).
44
46
  * - **Fill height:** `fillHeight` stretches the visible button to the host
@@ -82,6 +84,8 @@ export declare enum ObcAlertButtonType {
82
84
  * @property counter - Shows `nAlerts` next to the bell (not in `flat`).
83
85
  * @availableWhen counter globalCounter==false
84
86
  * @property globalCounter - Shows the per-severity counts, the bell and the total instead of a single alert status.
87
+ * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).
88
+ * @availableWhen globalCounterType globalCounter==true
85
89
  * @property counts - Alert count per severity for the global counter badges.
86
90
  * @availableWhen counts globalCounter==true
87
91
  * @property shelvedCount - Number of shelved alerts, shown after the global counter badges.
@@ -106,6 +110,8 @@ export declare class ObcAlertButtonItem extends LitElement {
106
110
  counter: boolean;
107
111
  /** Shows the per-severity counts, the bell and the total instead of a single alert status. */
108
112
  globalCounter: boolean;
113
+ /** How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count). */
114
+ globalCounterType: ObcAlertCounterItemType;
109
115
  /** Alert count per severity for the global counter badges. */
110
116
  counts: AlertCounts;
111
117
  /** Number of shelved alerts, shown after the global counter badges. */
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button-item/alert-button-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,0CAA0C,CAAC;AAClD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,qDAAqD,CAAC;AAC7D,OAAO,6CAA6C,CAAC;AAErD,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,qBAEa,kBAAmB,SAAQ,UAAU;IACtB,IAAI,EAAE,kBAAkB,CACtB;IACF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,SAAK;IACX,OAAO,UAAS;IAChB,aAAa,UAAS;IACL,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAChB,QAAQ,UAAS;IAClB,aAAa,EAAE,aAAa,CAC9B;IACG,UAAU,UAAS;IAIrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEzC,SAAS,CAAC,QAAQ,CAAC,QAAQ,qBAGzB;IAEF,IAAI,qBAAqB,IAAI,qBAAqB,CAcjD;IAED,OAAO,KAAK,cAAc,GAiBzB;IAED,OAAO,CAAC,iBAAiB;IAiCzB,4EAA4E;IAC5E,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAWX,MAAM;IA8Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,kBAAkB,CAAC;KAC7C;CACF"}
1
+ {"version":3,"file":"alert-button-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button-item/alert-button-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,0CAA0C,CAAC;AAClD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,qDAAqD,CAAC;AAC7D,OAAO,6CAA6C,CAAC;AACrD,OAAO,EAAC,uBAAuB,EAAC,MAAM,6CAA6C,CAAC;AACpF,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4EG;AACH,qBAEa,kBAAmB,SAAQ,UAAU;IACtB,IAAI,EAAE,kBAAkB,CACtB;IACF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,SAAK;IACX,OAAO,UAAS;IAChB,aAAa,UAAS;IACvB,iBAAiB,EAAE,uBAAuB,CACnC;IACW,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAChB,QAAQ,UAAS;IAClB,aAAa,EAAE,aAAa,CAC9B;IACG,UAAU,UAAS;IAIrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEzC,SAAS,CAAC,QAAQ,CAAC,QAAQ,qBAGzB;IAEF,IAAI,qBAAqB,IAAI,qBAAqB,CAcjD;IAED,OAAO,KAAK,cAAc,GAiBzB;IAED,OAAO,CAAC,iBAAiB;IAiCzB,4EAA4E;IAC5E,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAWX,MAAM;IA8Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,kBAAkB,CAAC;KAC7C;CACF"}
@@ -37,6 +37,7 @@ var ObcAlertButtonItem = class ObcAlertButtonItem extends LitElement {
37
37
  this.nAlerts = 0;
38
38
  this.counter = false;
39
39
  this.globalCounter = false;
40
+ this.globalCounterType = ObcAlertCounterItemType.Badges;
40
41
  this.counts = {};
41
42
  this.shelvedCount = 0;
42
43
  this.blinking = false;
@@ -96,7 +97,7 @@ var ObcAlertButtonItem = class ObcAlertButtonItem extends LitElement {
96
97
  renderCounts() {
97
98
  if (rankAlertCounts(this.counts).length === 0 && this.shelvedCount <= 0) return nothing;
98
99
  return html`<obc-alert-counter-item
99
- .type=${ObcAlertCounterItemType.Badges}
100
+ .type=${this.globalCounterType}
100
101
  .counts=${this.counts}
101
102
  .shelvedCount=${this.shelvedCount}
102
103
  ></obc-alert-counter-item>`;
@@ -146,6 +147,7 @@ __decorate([property({ type: String })], ObcAlertButtonItem.prototype, "alertTyp
146
147
  __decorate([property({ type: Number })], ObcAlertButtonItem.prototype, "nAlerts", void 0);
147
148
  __decorate([property({ type: Boolean })], ObcAlertButtonItem.prototype, "counter", void 0);
148
149
  __decorate([property({ type: Boolean })], ObcAlertButtonItem.prototype, "globalCounter", void 0);
150
+ __decorate([property({ type: String })], ObcAlertButtonItem.prototype, "globalCounterType", void 0);
149
151
  __decorate([property({
150
152
  type: Object,
151
153
  attribute: false