@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.136 → 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.
Files changed (48) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +11640 -10983
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +921 -0
  4. package/dist/automation/hydraulic-check-valve/hydraulic-check-valve.css.js +12 -0
  5. package/dist/automation/hydraulic-check-valve/hydraulic-check-valve.css.js.map +1 -0
  6. package/dist/automation/hydraulic-check-valve/hydraulic-check-valve.d.ts +33 -0
  7. package/dist/automation/hydraulic-check-valve/hydraulic-check-valve.d.ts.map +1 -0
  8. package/dist/automation/hydraulic-check-valve/hydraulic-check-valve.js +58 -0
  9. package/dist/automation/hydraulic-check-valve/hydraulic-check-valve.js.map +1 -0
  10. package/dist/automation/hydraulic-valve-4-3/hydraulic-valve-4-3.d.ts +77 -0
  11. package/dist/automation/hydraulic-valve-4-3/hydraulic-valve-4-3.d.ts.map +1 -0
  12. package/dist/automation/hydraulic-valve-4-3/hydraulic-valve-4-3.js +74 -0
  13. package/dist/automation/hydraulic-valve-4-3/hydraulic-valve-4-3.js.map +1 -0
  14. package/dist/automation/hydraulic-valve-x-2/hydraulic-valve-x-2.d.ts +74 -0
  15. package/dist/automation/hydraulic-valve-x-2/hydraulic-valve-x-2.d.ts.map +1 -0
  16. package/dist/automation/hydraulic-valve-x-2/hydraulic-valve-x-2.js +60 -0
  17. package/dist/automation/hydraulic-valve-x-2/hydraulic-valve-x-2.js.map +1 -0
  18. package/dist/automation/shuffle-button/shuffle-button-base.d.ts +67 -0
  19. package/dist/automation/shuffle-button/shuffle-button-base.d.ts.map +1 -0
  20. package/dist/automation/shuffle-button/shuffle-button-base.js +126 -0
  21. package/dist/automation/shuffle-button/shuffle-button-base.js.map +1 -0
  22. package/dist/automation/shuffle-button/shuffle-button.css.js +219 -0
  23. package/dist/automation/shuffle-button/shuffle-button.css.js.map +1 -0
  24. package/dist/automation/shuffle-button/shuffle-layout.d.ts +9 -0
  25. package/dist/automation/shuffle-button/shuffle-layout.d.ts.map +1 -0
  26. package/dist/automation/shuffle-button/shuffle-layout.js +16 -0
  27. package/dist/automation/shuffle-button/shuffle-layout.js.map +1 -0
  28. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.css.js +113 -0
  29. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.css.js.map +1 -0
  30. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.d.ts +104 -0
  31. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.d.ts.map +1 -0
  32. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.js +79 -0
  33. package/dist/components/alert-subsystem-counter/alert-subsystem-counter.js.map +1 -0
  34. package/package.json +1 -1
  35. package/src/automation/hydraulic-check-valve/hydraulic-check-valve.css +3 -0
  36. package/src/automation/hydraulic-check-valve/hydraulic-check-valve.stories.ts +18 -0
  37. package/src/automation/hydraulic-check-valve/hydraulic-check-valve.ts +60 -0
  38. package/src/automation/hydraulic-valve-4-3/hydraulic-valve-4-3.stories.ts +72 -0
  39. package/src/automation/hydraulic-valve-4-3/hydraulic-valve-4-3.ts +108 -0
  40. package/src/automation/hydraulic-valve-x-2/hydraulic-valve-x-2.stories.ts +60 -0
  41. package/src/automation/hydraulic-valve-x-2/hydraulic-valve-x-2.ts +101 -0
  42. package/src/automation/shuffle-button/shuffle-button-base.ts +170 -0
  43. package/src/automation/shuffle-button/shuffle-button.css +136 -0
  44. package/src/automation/shuffle-button/shuffle-layout.spec.ts +44 -0
  45. package/src/automation/shuffle-button/shuffle-layout.ts +21 -0
  46. package/src/components/alert-subsystem-counter/alert-subsystem-counter.css +82 -0
  47. package/src/components/alert-subsystem-counter/alert-subsystem-counter.stories.ts +308 -0
  48. package/src/components/alert-subsystem-counter/alert-subsystem-counter.ts +137 -0
@@ -0,0 +1,137 @@
1
+ import {LitElement, html, unsafeCSS} 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?inline';
5
+ import {customElement} from '../../decorator.js';
6
+
7
+ /**
8
+ * `ObcAlertSubsystemCounterOrientation` – Layout direction for the counter.
9
+ *
10
+ * - `horizontal`: Icon, label, and badges sit in a single row.
11
+ * - `vertical`: Badges (or empty text) sit on their own line below the label.
12
+ */
13
+ export enum ObcAlertSubsystemCounterOrientation {
14
+ Horizontal = 'horizontal',
15
+ Vertical = 'vertical',
16
+ }
17
+
18
+ /**
19
+ * `<obc-alert-subsystem-counter>` – A framed summary of a subsystem's alert
20
+ * counts: a leading icon, a label, and a trailing set of slotted count badges.
21
+ *
22
+ * When there are no active alerts it shows a muted label and an empty-state
23
+ * message instead of the badges. The count badges themselves are supplied by
24
+ * the consumer as slotted `obc-badge` elements; this component provides only
25
+ * the frame, layout, label, and empty state.
26
+ *
27
+ * ---
28
+ *
29
+ * ### Features
30
+ * - **Orientation:** `horizontal` (single row) or `vertical` (badges on a line
31
+ * below the label).
32
+ * - **Alert state:** `hasAlert` toggles between an active (bold label, badges)
33
+ * and an inactive (muted label, empty text) presentation.
34
+ * - **Freeform label:** Pass a full title or an abbreviation — the label is
35
+ * plain text decided by the caller and truncates with an ellipsis.
36
+ * - **Configurable empty text:** Customize the message shown when there are no
37
+ * alerts via `emptyText`.
38
+ * - **Optional leading icon:** Provide an icon through the `icon` slot; omit it
39
+ * and the leading box collapses with no empty gap.
40
+ *
41
+ * ---
42
+ *
43
+ * ### Usage Guidelines
44
+ * - Use this component to give an at-a-glance count of outstanding alerts for a
45
+ * single subsystem, grouped by severity.
46
+ * - Provide one slotted badge per severity in the `badges` slot, typically
47
+ * `<obc-badge size="large">` with a severity `type` and a `number`. The
48
+ * badge `type` values are the same severity vocabulary as `AlertType`
49
+ * (`alarm`, `warning`, `caution` and the `level-*` family); order them
50
+ * highest severity first, as `ALERT_SEVERITY_PRIORITY` does.
51
+ * - Set `hasAlert` to `false` to present the resolved/clear state; the badges
52
+ * are then not rendered and `emptyText` is shown. The component does not
53
+ * derive the state from the slotted badges — the consumer owns it.
54
+ * - Choose `vertical` orientation in narrow containers where the badges do not
55
+ * fit beside the label.
56
+ * - The counter is display-only: it renders no button and fires no events. For
57
+ * a clickable subsystem entry with badges, see `obc-tree-navigation-item`
58
+ * (`alertBadges`) or `obc-integration-fleet-button` (`alerts`).
59
+ *
60
+ * ---
61
+ *
62
+ * ### Slots
63
+ *
64
+ * | Slot Name | Renders When... | Purpose |
65
+ * |-----------|------------------------|----------------------------------------------------|
66
+ * | `icon` | The slot has content | Leading 24px icon (e.g. `<obi-placeholder>`). |
67
+ * | `badges` | `hasAlert` is true | Count badges, one per severity (`<obc-badge>`). |
68
+ *
69
+ * ---
70
+ *
71
+ * ### Example
72
+ *
73
+ * ```html
74
+ * <obc-alert-subsystem-counter label="Label" hasAlert>
75
+ * <obi-placeholder slot="icon"></obi-placeholder>
76
+ * <obc-badge slot="badges" size="large" type="alarm" .number=${9}></obc-badge>
77
+ * <obc-badge slot="badges" size="large" type="warning" .number=${4}></obc-badge>
78
+ * <obc-badge slot="badges" size="large" type="caution" .number=${2}></obc-badge>
79
+ * </obc-alert-subsystem-counter>
80
+ * ```
81
+ *
82
+ * @property label - The subsystem label. Pass a full title or an abbreviation as plain text.
83
+ * @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.
84
+ * @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.
85
+ * @property emptyText - Text shown in the trailing area when `hasAlert` is `false`.
86
+ * @availableWhen emptyText hasAlert==false
87
+ * @slot icon - Optional leading 24px icon.
88
+ * @slot badges - Count badges shown when `hasAlert` is true.
89
+ * @beta
90
+ */
91
+ @customElement('obc-alert-subsystem-counter')
92
+ export class ObcAlertSubsystemCounter extends LitElement {
93
+ @property({type: String}) label = '';
94
+ @property({type: String}) orientation: ObcAlertSubsystemCounterOrientation =
95
+ ObcAlertSubsystemCounterOrientation.Horizontal;
96
+ @property({type: Boolean}) hasAlert = false;
97
+ @property({type: String}) emptyText = 'No alerts';
98
+
99
+ @state() private hasIcon = false;
100
+
101
+ private handleIconSlotChange(e: Event) {
102
+ const slot = e.target as HTMLSlotElement;
103
+ this.hasIcon = slot.assignedNodes({flatten: true}).length > 0;
104
+ }
105
+
106
+ override render() {
107
+ return html`
108
+ <div
109
+ class=${classMap({
110
+ frame: true,
111
+ ['orientation-' + this.orientation]: true,
112
+ 'has-alert': this.hasAlert,
113
+ })}
114
+ >
115
+ <div class="leading-container">
116
+ <div class=${classMap({icon: true, 'no-icon': !this.hasIcon})}>
117
+ <slot name="icon" @slotchange=${this.handleIconSlotChange}></slot>
118
+ </div>
119
+ <div class="label">${this.label}</div>
120
+ </div>
121
+ <div class="trailing-container">
122
+ ${this.hasAlert
123
+ ? html`<slot name="badges" class="badges"></slot>`
124
+ : html`<span class="empty">${this.emptyText}</span>`}
125
+ </div>
126
+ </div>
127
+ `;
128
+ }
129
+
130
+ static override styles = unsafeCSS(componentStyle);
131
+ }
132
+
133
+ declare global {
134
+ interface HTMLElementTagNameMap {
135
+ 'obc-alert-subsystem-counter': ObcAlertSubsystemCounter;
136
+ }
137
+ }