@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.137 → 2.0.0-next.138

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.
@@ -5011,6 +5011,39 @@
5011
5011
  }
5012
5012
  ]
5013
5013
  },
5014
+ {
5015
+ "kind": "javascript-module",
5016
+ "path": "dist/components/alert-subsystem-counter/alert-subsystem-counter.js",
5017
+ "declarations": [
5018
+ {
5019
+ "kind": "variable",
5020
+ "name": "ObcAlertSubsystemCounterOrientation"
5021
+ },
5022
+ {
5023
+ "kind": "variable",
5024
+ "name": "ObcAlertSubsystemCounter",
5025
+ "default": "class extends LitElement { constructor() { super(...arguments); this.label = \"\"; this.orientation = \"horizontal\"; this.hasAlert = false; this.emptyText = \"No alerts\"; this.hasIcon = false; } handleIconSlotChange(e) { const slot = e.target; this.hasIcon = slot.assignedNodes({ flatten: true }).length > 0; } render() { return html` <div class=${classMap({ frame: true, [\"orientation-\" + this.orientation]: true, \"has-alert\": this.hasAlert })} > <div class=\"leading-container\"> <div class=${classMap({ icon: true, \"no-icon\": !this.hasIcon })}> <slot name=\"icon\" @slotchange=${this.handleIconSlotChange}></slot> </div> <div class=\"label\">${this.label}</div> </div> <div class=\"trailing-container\"> ${this.hasAlert ? html`<slot name=\"badges\" class=\"badges\"></slot>` : html`<span class=\"empty\">${this.emptyText}</span>`} </div> </div> `; } }"
5026
+ }
5027
+ ],
5028
+ "exports": [
5029
+ {
5030
+ "kind": "js",
5031
+ "name": "ObcAlertSubsystemCounter",
5032
+ "declaration": {
5033
+ "name": "ObcAlertSubsystemCounter",
5034
+ "module": "dist/components/alert-subsystem-counter/alert-subsystem-counter.js"
5035
+ }
5036
+ },
5037
+ {
5038
+ "kind": "js",
5039
+ "name": "ObcAlertSubsystemCounterOrientation",
5040
+ "declaration": {
5041
+ "name": "ObcAlertSubsystemCounterOrientation",
5042
+ "module": "dist/components/alert-subsystem-counter/alert-subsystem-counter.js"
5043
+ }
5044
+ }
5045
+ ]
5046
+ },
5014
5047
  {
5015
5048
  "kind": "javascript-module",
5016
5049
  "path": "dist/components/app-button/app-button.js",
@@ -48826,6 +48859,110 @@
48826
48859
  }
48827
48860
  ]
48828
48861
  },
48862
+ {
48863
+ "kind": "javascript-module",
48864
+ "path": "src/components/alert-subsystem-counter/alert-subsystem-counter.ts",
48865
+ "declarations": [
48866
+ {
48867
+ "kind": "class",
48868
+ "description": "`<obc-alert-subsystem-counter>` – A framed summary of a subsystem's alert\ncounts: a leading icon, a label, and a trailing set of slotted count badges.\n\nWhen there are no active alerts it shows a muted label and an empty-state\nmessage instead of the badges. The count badges themselves are supplied by\nthe consumer as slotted `obc-badge` elements; this component provides only\nthe frame, layout, label, and empty state.\n\n---\n\n### Features\n- **Orientation:** `horizontal` (single row) or `vertical` (badges on a line\n below the label).\n- **Alert state:** `hasAlert` toggles between an active (bold label, badges)\n and an inactive (muted label, empty text) presentation.\n- **Freeform label:** Pass a full title or an abbreviation — the label is\n plain text decided by the caller and truncates with an ellipsis.\n- **Configurable empty text:** Customize the message shown when there are no\n alerts via `emptyText`.\n- **Optional leading icon:** Provide an icon through the `icon` slot; omit it\n and the leading box collapses with no empty gap.\n\n---\n\n### Usage Guidelines\n- Use this component to give an at-a-glance count of outstanding alerts for a\n single subsystem, grouped by severity.\n- Provide one slotted badge per severity in the `badges` slot, typically\n `<obc-badge size=\"large\">` with a severity `type` and a `number`. The\n badge `type` values are the same severity vocabulary as `AlertType`\n (`alarm`, `warning`, `caution` and the `level-*` family); order them\n highest severity first, as `ALERT_SEVERITY_PRIORITY` does.\n- Set `hasAlert` to `false` to present the resolved/clear state; the badges\n are then not rendered and `emptyText` is shown. The component does not\n derive the state from the slotted badges — the consumer owns it.\n- Choose `vertical` orientation in narrow containers where the badges do not\n fit beside the label.\n- The counter is display-only: it renders no button and fires no events. For\n a clickable subsystem entry with badges, see `obc-tree-navigation-item`\n (`alertBadges`) or `obc-integration-fleet-button` (`alerts`).\n\n---\n\n### Slots\n\n| Slot Name | Renders When... | Purpose |\n|-----------|------------------------|----------------------------------------------------|\n| `icon` | The slot has content | Leading 24px icon (e.g. `<obi-placeholder>`). |\n| `badges` | `hasAlert` is true | Count badges, one per severity (`<obc-badge>`). |\n\n---\n\n### Example\n\n```html\n<obc-alert-subsystem-counter label=\"Label\" hasAlert>\n <obi-placeholder slot=\"icon\"></obi-placeholder>\n <obc-badge slot=\"badges\" size=\"large\" type=\"alarm\" .number=${9}></obc-badge>\n <obc-badge slot=\"badges\" size=\"large\" type=\"warning\" .number=${4}></obc-badge>\n <obc-badge slot=\"badges\" size=\"large\" type=\"caution\" .number=${2}></obc-badge>\n</obc-alert-subsystem-counter>\n```",
48869
+ "name": "ObcAlertSubsystemCounter",
48870
+ "slots": [
48871
+ {
48872
+ "description": "Optional leading 24px icon.",
48873
+ "name": "icon"
48874
+ },
48875
+ {
48876
+ "description": "Count badges shown when `hasAlert` is true.",
48877
+ "name": "badges"
48878
+ }
48879
+ ],
48880
+ "members": [
48881
+ {
48882
+ "kind": "field",
48883
+ "name": "label",
48884
+ "type": {
48885
+ "text": "string"
48886
+ },
48887
+ "default": "''",
48888
+ "description": "The subsystem label. Pass a full title or an abbreviation as plain text."
48889
+ },
48890
+ {
48891
+ "kind": "field",
48892
+ "name": "orientation",
48893
+ "type": {
48894
+ "text": "ObcAlertSubsystemCounterOrientation"
48895
+ },
48896
+ "description": "Layout direction: `horizontal` (default) keeps icon, label and badges in one row; `vertical` moves the badges (or empty text) to a line below the label."
48897
+ },
48898
+ {
48899
+ "kind": "field",
48900
+ "name": "hasAlert",
48901
+ "type": {
48902
+ "text": "boolean"
48903
+ },
48904
+ "default": "false",
48905
+ "description": "Whether the subsystem has active alerts. `true` shows the label bold and renders the `badges` slot; `false` mutes the label and shows `emptyText` instead of the badges."
48906
+ },
48907
+ {
48908
+ "kind": "field",
48909
+ "name": "emptyText",
48910
+ "type": {
48911
+ "text": "string"
48912
+ },
48913
+ "default": "'No alerts'",
48914
+ "description": "Text shown in the trailing area when `hasAlert` is `false`."
48915
+ },
48916
+ {
48917
+ "kind": "field",
48918
+ "name": "hasIcon",
48919
+ "type": {
48920
+ "text": "boolean"
48921
+ },
48922
+ "privacy": "private",
48923
+ "default": "false"
48924
+ },
48925
+ {
48926
+ "kind": "method",
48927
+ "name": "handleIconSlotChange",
48928
+ "privacy": "private",
48929
+ "parameters": [
48930
+ {
48931
+ "name": "e",
48932
+ "type": {
48933
+ "text": "Event"
48934
+ }
48935
+ }
48936
+ ]
48937
+ },
48938
+ {
48939
+ "kind": "method",
48940
+ "name": "render"
48941
+ },
48942
+ {
48943
+ "kind": "field",
48944
+ "name": "styles",
48945
+ "static": true
48946
+ }
48947
+ ],
48948
+ "superclass": {
48949
+ "name": "LitElement",
48950
+ "package": "lit"
48951
+ },
48952
+ "customElement": true
48953
+ }
48954
+ ],
48955
+ "exports": [
48956
+ {
48957
+ "kind": "js",
48958
+ "name": "ObcAlertSubsystemCounter",
48959
+ "declaration": {
48960
+ "name": "ObcAlertSubsystemCounter",
48961
+ "module": "src/components/alert-subsystem-counter/alert-subsystem-counter.ts"
48962
+ }
48963
+ }
48964
+ ]
48965
+ },
48829
48966
  {
48830
48967
  "kind": "javascript-module",
48831
48968
  "path": "src/components/app-button/app-button.ts",
@@ -0,0 +1,113 @@
1
+ import { css } from "lit";
2
+ const componentStyle = css`* {
3
+ -webkit-tap-highlight-color: transparent;
4
+ }
5
+
6
+ :host {
7
+ display: block;
8
+ }
9
+
10
+ .frame {
11
+ box-sizing: border-box; /* the host width is the frame width, border included */
12
+ display: flex;
13
+ align-items: center;
14
+ gap: 8px;
15
+ padding: 8px;
16
+ border-radius: 6px;
17
+ background: var(--container-section-color);
18
+ border: 1px solid var(--border-outline-color);
19
+ }
20
+
21
+ .frame.orientation-vertical {
22
+ flex-direction: column;
23
+ align-items: stretch;
24
+ }
25
+
26
+ .leading-container {
27
+ display: flex;
28
+ flex: 1 0 0; /* takes the width the badges leave over, so the label can truncate */
29
+ align-items: center;
30
+ gap: 4px;
31
+ min-width: 0; /* lets the label shrink below its text width */
32
+ }
33
+
34
+ .icon {
35
+ flex-shrink: 0;
36
+ width: var(--global-size-spacing-icon-icon-size-regular);
37
+ height: var(--global-size-spacing-icon-icon-size-regular);
38
+ color: var(--on-indent-neutral-color);
39
+ }
40
+
41
+ .icon.no-icon {
42
+ display: none; /* collapses the flex gap too, so an iconless counter has no leading hole */
43
+ }
44
+
45
+ .label {
46
+ font-family: var(--global-typography-font-family);
47
+ font-weight: var(--global-typography-ui-body-font-weight);
48
+ font-size: var(--global-typography-ui-body-font-size);
49
+ line-height: var(--global-typography-ui-body-line-height);
50
+ font-feature-settings:
51
+ "liga" off,
52
+ "clig" off,
53
+ "ss04" on;
54
+ flex: 1 0 0;
55
+ min-width: 0; /* required for text-overflow to kick in inside a flex item */
56
+ padding-left: 4px;
57
+ color: var(--element-inactive-color);
58
+ overflow: hidden;
59
+ white-space: nowrap;
60
+ text-overflow: ellipsis;
61
+ }
62
+
63
+ .frame.has-alert .label {
64
+ font-family: var(--global-typography-font-family);
65
+ font-weight: var(--global-typography-ui-body-active-font-weight);
66
+ font-size: var(--global-typography-ui-body-active-font-size);
67
+ line-height: var(--global-typography-ui-body-active-line-height);
68
+ font-feature-settings:
69
+ "liga" off,
70
+ "clig" off,
71
+ "ss04" on;
72
+ color: var(--on-indent-active-color);
73
+ }
74
+
75
+ .trailing-container {
76
+ display: flex;
77
+ flex-shrink: 0; /* badges keep their size; the label is what gives way */
78
+ align-items: center;
79
+ gap: 4px;
80
+ }
81
+
82
+ .frame.orientation-horizontal .trailing-container {
83
+ justify-content: flex-end;
84
+ }
85
+
86
+ .frame.orientation-vertical .trailing-container {
87
+ align-self: flex-start; /* hugs its content under the label instead of stretching across the frame */
88
+ }
89
+
90
+ .frame:not(.has-alert) .trailing-container {
91
+ justify-content: center;
92
+ /* same row height as the large badges it stands in for */
93
+ height: var(--ui-components-badge-min-size-large);
94
+ padding: 0 8px;
95
+ }
96
+
97
+ .empty {
98
+ font-family: var(--global-typography-font-family);
99
+ font-weight: var(--global-typography-ui-label-font-weight);
100
+ font-size: var(--global-typography-ui-label-font-size);
101
+ line-height: var(--global-typography-ui-label-line-height);
102
+ font-feature-settings:
103
+ "liga" off,
104
+ "clig" off,
105
+ "ss04" on;
106
+ color: var(--element-inactive-color);
107
+ white-space: nowrap;
108
+ }
109
+ `;
110
+ export {
111
+ componentStyle as default
112
+ };
113
+ //# sourceMappingURL=alert-subsystem-counter.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-subsystem-counter.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,104 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * `ObcAlertSubsystemCounterOrientation` – Layout direction for the counter.
4
+ *
5
+ * - `horizontal`: Icon, label, and badges sit in a single row.
6
+ * - `vertical`: Badges (or empty text) sit on their own line below the label.
7
+ */
8
+ export declare enum ObcAlertSubsystemCounterOrientation {
9
+ Horizontal = "horizontal",
10
+ Vertical = "vertical"
11
+ }
12
+ /**
13
+ * `<obc-alert-subsystem-counter>` – A framed summary of a subsystem's alert
14
+ * counts: a leading icon, a label, and a trailing set of slotted count badges.
15
+ *
16
+ * When there are no active alerts it shows a muted label and an empty-state
17
+ * message instead of the badges. The count badges themselves are supplied by
18
+ * the consumer as slotted `obc-badge` elements; this component provides only
19
+ * the frame, layout, label, and empty state.
20
+ *
21
+ * ---
22
+ *
23
+ * ### Features
24
+ * - **Orientation:** `horizontal` (single row) or `vertical` (badges on a line
25
+ * below the label).
26
+ * - **Alert state:** `hasAlert` toggles between an active (bold label, badges)
27
+ * and an inactive (muted label, empty text) presentation.
28
+ * - **Freeform label:** Pass a full title or an abbreviation — the label is
29
+ * plain text decided by the caller and truncates with an ellipsis.
30
+ * - **Configurable empty text:** Customize the message shown when there are no
31
+ * alerts via `emptyText`.
32
+ * - **Optional leading icon:** Provide an icon through the `icon` slot; omit it
33
+ * and the leading box collapses with no empty gap.
34
+ *
35
+ * ---
36
+ *
37
+ * ### Usage Guidelines
38
+ * - Use this component to give an at-a-glance count of outstanding alerts for a
39
+ * single subsystem, grouped by severity.
40
+ * - Provide one slotted badge per severity in the `badges` slot, typically
41
+ * `<obc-badge size="large">` with a severity `type` and a `number`. The
42
+ * badge `type` values are the same severity vocabulary as `AlertType`
43
+ * (`alarm`, `warning`, `caution` and the `level-*` family); order them
44
+ * highest severity first, as `ALERT_SEVERITY_PRIORITY` does.
45
+ * - Set `hasAlert` to `false` to present the resolved/clear state; the badges
46
+ * are then not rendered and `emptyText` is shown. The component does not
47
+ * derive the state from the slotted badges — the consumer owns it.
48
+ * - Choose `vertical` orientation in narrow containers where the badges do not
49
+ * fit beside the label.
50
+ * - The counter is display-only: it renders no button and fires no events. For
51
+ * a clickable subsystem entry with badges, see `obc-tree-navigation-item`
52
+ * (`alertBadges`) or `obc-integration-fleet-button` (`alerts`).
53
+ *
54
+ * ---
55
+ *
56
+ * ### Slots
57
+ *
58
+ * | Slot Name | Renders When... | Purpose |
59
+ * |-----------|------------------------|----------------------------------------------------|
60
+ * | `icon` | The slot has content | Leading 24px icon (e.g. `<obi-placeholder>`). |
61
+ * | `badges` | `hasAlert` is true | Count badges, one per severity (`<obc-badge>`). |
62
+ *
63
+ * ---
64
+ *
65
+ * ### Example
66
+ *
67
+ * ```html
68
+ * <obc-alert-subsystem-counter label="Label" hasAlert>
69
+ * <obi-placeholder slot="icon"></obi-placeholder>
70
+ * <obc-badge slot="badges" size="large" type="alarm" .number=${9}></obc-badge>
71
+ * <obc-badge slot="badges" size="large" type="warning" .number=${4}></obc-badge>
72
+ * <obc-badge slot="badges" size="large" type="caution" .number=${2}></obc-badge>
73
+ * </obc-alert-subsystem-counter>
74
+ * ```
75
+ *
76
+ * @property label - The subsystem label. Pass a full title or an abbreviation as plain text.
77
+ * @property orientation - Layout direction: `horizontal` (default) keeps icon, label and badges in one row; `vertical` moves the badges (or empty text) to a line below the label.
78
+ * @property hasAlert - Whether the subsystem has active alerts. `true` shows the label bold and renders the `badges` slot; `false` mutes the label and shows `emptyText` instead of the badges.
79
+ * @property emptyText - Text shown in the trailing area when `hasAlert` is `false`.
80
+ * @availableWhen emptyText hasAlert==false
81
+ * @slot icon - Optional leading 24px icon.
82
+ * @slot badges - Count badges shown when `hasAlert` is true.
83
+ * @beta
84
+ */
85
+ export declare class ObcAlertSubsystemCounter extends LitElement {
86
+ /** The subsystem label. Pass a full title or an abbreviation as plain text. */
87
+ label: string;
88
+ /** Layout direction: `horizontal` (default) keeps icon, label and badges in one row; `vertical` moves the badges (or empty text) to a line below the label. */
89
+ orientation: ObcAlertSubsystemCounterOrientation;
90
+ /** Whether the subsystem has active alerts. `true` shows the label bold and renders the `badges` slot; `false` mutes the label and shows `emptyText` instead of the badges. */
91
+ hasAlert: boolean;
92
+ /** Text shown in the trailing area when `hasAlert` is `false`. */
93
+ emptyText: string;
94
+ private hasIcon;
95
+ private handleIconSlotChange;
96
+ render(): import('lit-html').TemplateResult<1>;
97
+ static styles: import('lit').CSSResult;
98
+ }
99
+ declare global {
100
+ interface HTMLElementTagNameMap {
101
+ 'obc-alert-subsystem-counter': ObcAlertSubsystemCounter;
102
+ }
103
+ }
104
+ //# sourceMappingURL=alert-subsystem-counter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-subsystem-counter.d.ts","sourceRoot":"","sources":["../../../src/components/alert-subsystem-counter/alert-subsystem-counter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMhD;;;;;GAKG;AACH,oBAAY,mCAAmC;IAC7C,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,qBACa,wBAAyB,SAAQ,UAAU;IAC5B,KAAK,SAAM;IACX,WAAW,EAAE,mCAAmC,CACzB;IACtB,QAAQ,UAAS;IAClB,SAAS,SAAe;IAEzC,OAAO,CAAC,OAAO,CAAS;IAEjC,OAAO,CAAC,oBAAoB;IAKnB,MAAM;IAwBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,6BAA6B,EAAE,wBAAwB,CAAC;KACzD;CACF"}
@@ -0,0 +1,79 @@
1
+ import { unsafeCSS, LitElement, html } from "lit";
2
+ import { property, state } from "lit/decorators.js";
3
+ import { classMap } from "lit/directives/class-map.js";
4
+ import componentStyle from "./alert-subsystem-counter.css.js";
5
+ import { customElement } from "../../decorator.js";
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13
+ if (kind && result) __defProp(target, key, result);
14
+ return result;
15
+ };
16
+ var ObcAlertSubsystemCounterOrientation = /* @__PURE__ */ ((ObcAlertSubsystemCounterOrientation2) => {
17
+ ObcAlertSubsystemCounterOrientation2["Horizontal"] = "horizontal";
18
+ ObcAlertSubsystemCounterOrientation2["Vertical"] = "vertical";
19
+ return ObcAlertSubsystemCounterOrientation2;
20
+ })(ObcAlertSubsystemCounterOrientation || {});
21
+ let ObcAlertSubsystemCounter = class extends LitElement {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.label = "";
25
+ this.orientation = "horizontal";
26
+ this.hasAlert = false;
27
+ this.emptyText = "No alerts";
28
+ this.hasIcon = false;
29
+ }
30
+ handleIconSlotChange(e) {
31
+ const slot = e.target;
32
+ this.hasIcon = slot.assignedNodes({ flatten: true }).length > 0;
33
+ }
34
+ render() {
35
+ return html`
36
+ <div
37
+ class=${classMap({
38
+ frame: true,
39
+ ["orientation-" + this.orientation]: true,
40
+ "has-alert": this.hasAlert
41
+ })}
42
+ >
43
+ <div class="leading-container">
44
+ <div class=${classMap({ icon: true, "no-icon": !this.hasIcon })}>
45
+ <slot name="icon" @slotchange=${this.handleIconSlotChange}></slot>
46
+ </div>
47
+ <div class="label">${this.label}</div>
48
+ </div>
49
+ <div class="trailing-container">
50
+ ${this.hasAlert ? html`<slot name="badges" class="badges"></slot>` : html`<span class="empty">${this.emptyText}</span>`}
51
+ </div>
52
+ </div>
53
+ `;
54
+ }
55
+ };
56
+ ObcAlertSubsystemCounter.styles = unsafeCSS(componentStyle);
57
+ __decorateClass([
58
+ property({ type: String })
59
+ ], ObcAlertSubsystemCounter.prototype, "label", 2);
60
+ __decorateClass([
61
+ property({ type: String })
62
+ ], ObcAlertSubsystemCounter.prototype, "orientation", 2);
63
+ __decorateClass([
64
+ property({ type: Boolean })
65
+ ], ObcAlertSubsystemCounter.prototype, "hasAlert", 2);
66
+ __decorateClass([
67
+ property({ type: String })
68
+ ], ObcAlertSubsystemCounter.prototype, "emptyText", 2);
69
+ __decorateClass([
70
+ state()
71
+ ], ObcAlertSubsystemCounter.prototype, "hasIcon", 2);
72
+ ObcAlertSubsystemCounter = __decorateClass([
73
+ customElement("obc-alert-subsystem-counter")
74
+ ], ObcAlertSubsystemCounter);
75
+ export {
76
+ ObcAlertSubsystemCounter,
77
+ ObcAlertSubsystemCounterOrientation
78
+ };
79
+ //# sourceMappingURL=alert-subsystem-counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert-subsystem-counter.js","sources":["../../../src/components/alert-subsystem-counter/alert-subsystem-counter.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport componentStyle from './alert-subsystem-counter.css?inline';\nimport {customElement} from '../../decorator.js';\n\n/**\n * `ObcAlertSubsystemCounterOrientation` – Layout direction for the counter.\n *\n * - `horizontal`: Icon, label, and badges sit in a single row.\n * - `vertical`: Badges (or empty text) sit on their own line below the label.\n */\nexport enum ObcAlertSubsystemCounterOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\n/**\n * `<obc-alert-subsystem-counter>` – A framed summary of a subsystem's alert\n * counts: a leading icon, a label, and a trailing set of slotted count badges.\n *\n * When there are no active alerts it shows a muted label and an empty-state\n * message instead of the badges. The count badges themselves are supplied by\n * the consumer as slotted `obc-badge` elements; this component provides only\n * the frame, layout, label, and empty state.\n *\n * ---\n *\n * ### Features\n * - **Orientation:** `horizontal` (single row) or `vertical` (badges on a line\n * below the label).\n * - **Alert state:** `hasAlert` toggles between an active (bold label, badges)\n * and an inactive (muted label, empty text) presentation.\n * - **Freeform label:** Pass a full title or an abbreviation — the label is\n * plain text decided by the caller and truncates with an ellipsis.\n * - **Configurable empty text:** Customize the message shown when there are no\n * alerts via `emptyText`.\n * - **Optional leading icon:** Provide an icon through the `icon` slot; omit it\n * and the leading box collapses with no empty gap.\n *\n * ---\n *\n * ### Usage Guidelines\n * - Use this component to give an at-a-glance count of outstanding alerts for a\n * single subsystem, grouped by severity.\n * - Provide one slotted badge per severity in the `badges` slot, typically\n * `<obc-badge size=\"large\">` with a severity `type` and a `number`. The\n * badge `type` values are the same severity vocabulary as `AlertType`\n * (`alarm`, `warning`, `caution` and the `level-*` family); order them\n * highest severity first, as `ALERT_SEVERITY_PRIORITY` does.\n * - Set `hasAlert` to `false` to present the resolved/clear state; the badges\n * are then not rendered and `emptyText` is shown. The component does not\n * derive the state from the slotted badges — the consumer owns it.\n * - Choose `vertical` orientation in narrow containers where the badges do not\n * fit beside the label.\n * - The counter is display-only: it renders no button and fires no events. For\n * a clickable subsystem entry with badges, see `obc-tree-navigation-item`\n * (`alertBadges`) or `obc-integration-fleet-button` (`alerts`).\n *\n * ---\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * |-----------|------------------------|----------------------------------------------------|\n * | `icon` | The slot has content | Leading 24px icon (e.g. `<obi-placeholder>`). |\n * | `badges` | `hasAlert` is true | Count badges, one per severity (`<obc-badge>`). |\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-alert-subsystem-counter label=\"Label\" hasAlert>\n * <obi-placeholder slot=\"icon\"></obi-placeholder>\n * <obc-badge slot=\"badges\" size=\"large\" type=\"alarm\" .number=${9}></obc-badge>\n * <obc-badge slot=\"badges\" size=\"large\" type=\"warning\" .number=${4}></obc-badge>\n * <obc-badge slot=\"badges\" size=\"large\" type=\"caution\" .number=${2}></obc-badge>\n * </obc-alert-subsystem-counter>\n * ```\n *\n * @property label - The subsystem label. Pass a full title or an abbreviation as plain text.\n * @property orientation - Layout direction: `horizontal` (default) keeps icon, label and badges in one row; `vertical` moves the badges (or empty text) to a line below the label.\n * @property hasAlert - Whether the subsystem has active alerts. `true` shows the label bold and renders the `badges` slot; `false` mutes the label and shows `emptyText` instead of the badges.\n * @property emptyText - Text shown in the trailing area when `hasAlert` is `false`.\n * @availableWhen emptyText hasAlert==false\n * @slot icon - Optional leading 24px icon.\n * @slot badges - Count badges shown when `hasAlert` is true.\n * @beta\n */\n@customElement('obc-alert-subsystem-counter')\nexport class ObcAlertSubsystemCounter extends LitElement {\n @property({type: String}) label = '';\n @property({type: String}) orientation: ObcAlertSubsystemCounterOrientation =\n ObcAlertSubsystemCounterOrientation.Horizontal;\n @property({type: Boolean}) hasAlert = false;\n @property({type: String}) emptyText = 'No alerts';\n\n @state() private hasIcon = false;\n\n private handleIconSlotChange(e: Event) {\n const slot = e.target as HTMLSlotElement;\n this.hasIcon = slot.assignedNodes({flatten: true}).length > 0;\n }\n\n override render() {\n return html`\n <div\n class=${classMap({\n frame: true,\n ['orientation-' + this.orientation]: true,\n 'has-alert': this.hasAlert,\n })}\n >\n <div class=\"leading-container\">\n <div class=${classMap({icon: true, 'no-icon': !this.hasIcon})}>\n <slot name=\"icon\" @slotchange=${this.handleIconSlotChange}></slot>\n </div>\n <div class=\"label\">${this.label}</div>\n </div>\n <div class=\"trailing-container\">\n ${this.hasAlert\n ? html`<slot name=\"badges\" class=\"badges\"></slot>`\n : html`<span class=\"empty\">${this.emptyText}</span>`}\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-subsystem-counter': ObcAlertSubsystemCounter;\n }\n}\n"],"names":["ObcAlertSubsystemCounterOrientation"],"mappings":";;;;;;;;;;;;;;;AAYO,IAAK,wDAAAA,yCAAL;AACLA,uCAAA,YAAA,IAAa;AACbA,uCAAA,UAAA,IAAW;AAFD,SAAAA;AAAA,GAAA,uCAAA,CAAA,CAAA;AA+EL,IAAM,2BAAN,cAAuC,WAAW;AAAA,EAAlD,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,QAAQ;AACR,SAAA,cACxB;AACyB,SAAA,WAAW;AACZ,SAAA,YAAY;AAE7B,SAAQ,UAAU;AAAA,EAAA;AAAA,EAEnB,qBAAqB,GAAU;AACrC,UAAM,OAAO,EAAE;AACf,SAAK,UAAU,KAAK,cAAc,EAAC,SAAS,KAAA,CAAK,EAAE,SAAS;AAAA,EAC9D;AAAA,EAES,SAAS;AAChB,WAAO;AAAA;AAAA,gBAEK,SAAS;AAAA,MACf,OAAO;AAAA,MACP,CAAC,iBAAiB,KAAK,WAAW,GAAG;AAAA,MACrC,aAAa,KAAK;AAAA,IAAA,CACnB,CAAC;AAAA;AAAA;AAAA,uBAGa,SAAS,EAAC,MAAM,MAAM,WAAW,CAAC,KAAK,QAAA,CAAQ,CAAC;AAAA,4CAC3B,KAAK,oBAAoB;AAAA;AAAA,+BAEtC,KAAK,KAAK;AAAA;AAAA;AAAA,YAG7B,KAAK,WACH,mDACA,2BAA2B,KAAK,SAAS,SAAS;AAAA;AAAA;AAAA;AAAA,EAI9D;AAGF;AAvCa,yBAsCK,SAAS,UAAU,cAAc;AArCvB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GADb,yBACe,WAAA,SAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAFb,yBAEe,WAAA,eAAA,CAAA;AAEC,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAJd,yBAIgB,WAAA,YAAA,CAAA;AACD,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GALb,yBAKe,WAAA,aAAA,CAAA;AAET,gBAAA;AAAA,EAAhB,MAAA;AAAM,GAPI,yBAOM,WAAA,WAAA,CAAA;AAPN,2BAAN,gBAAA;AAAA,EADN,cAAc,6BAA6B;AAAA,GAC/B,wBAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oicl/openbridge-webcomponents-full-bundle",
3
- "version": "2.0.0-next.137",
3
+ "version": "2.0.0-next.138",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,82 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .frame {
6
+ box-sizing: border-box; /* the host width is the frame width, border included */
7
+ display: flex;
8
+ align-items: center;
9
+ gap: 8px;
10
+ padding: 8px;
11
+ border-radius: 6px;
12
+ background: var(--container-section-color);
13
+ border: 1px solid var(--border-outline-color);
14
+ }
15
+
16
+ .frame.orientation-vertical {
17
+ flex-direction: column;
18
+ align-items: stretch;
19
+ }
20
+
21
+ .leading-container {
22
+ display: flex;
23
+ flex: 1 0 0; /* takes the width the badges leave over, so the label can truncate */
24
+ align-items: center;
25
+ gap: 4px;
26
+ min-width: 0; /* lets the label shrink below its text width */
27
+ }
28
+
29
+ .icon {
30
+ flex-shrink: 0;
31
+ width: var(--global-size-spacing-icon-icon-size-regular);
32
+ height: var(--global-size-spacing-icon-icon-size-regular);
33
+ color: var(--on-indent-neutral-color);
34
+ }
35
+
36
+ .icon.no-icon {
37
+ display: none; /* collapses the flex gap too, so an iconless counter has no leading hole */
38
+ }
39
+
40
+ .label {
41
+ @mixin font-body;
42
+ flex: 1 0 0;
43
+ min-width: 0; /* required for text-overflow to kick in inside a flex item */
44
+ padding-left: 4px;
45
+ color: var(--element-inactive-color);
46
+ overflow: hidden;
47
+ white-space: nowrap;
48
+ text-overflow: ellipsis;
49
+ }
50
+
51
+ .frame.has-alert .label {
52
+ @mixin font-body-active;
53
+ color: var(--on-indent-active-color);
54
+ }
55
+
56
+ .trailing-container {
57
+ display: flex;
58
+ flex-shrink: 0; /* badges keep their size; the label is what gives way */
59
+ align-items: center;
60
+ gap: 4px;
61
+ }
62
+
63
+ .frame.orientation-horizontal .trailing-container {
64
+ justify-content: flex-end;
65
+ }
66
+
67
+ .frame.orientation-vertical .trailing-container {
68
+ align-self: flex-start; /* hugs its content under the label instead of stretching across the frame */
69
+ }
70
+
71
+ .frame:not(.has-alert) .trailing-container {
72
+ justify-content: center;
73
+ /* same row height as the large badges it stands in for */
74
+ height: var(--ui-components-badge-min-size-large);
75
+ padding: 0 8px;
76
+ }
77
+
78
+ .empty {
79
+ @mixin font-label;
80
+ color: var(--element-inactive-color);
81
+ white-space: nowrap;
82
+ }