@oicl/openbridge-webcomponents 2.0.0-next.110 → 2.0.0-next.112

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 (72) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +2370 -1522
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +641 -7
  4. package/dist/automation/indicator-battery/indicator-battery.css.js +52 -0
  5. package/dist/automation/indicator-battery/indicator-battery.css.js.map +1 -0
  6. package/dist/automation/indicator-battery/indicator-battery.d.ts +65 -0
  7. package/dist/automation/indicator-battery/indicator-battery.d.ts.map +1 -0
  8. package/dist/automation/indicator-battery/indicator-battery.js +119 -0
  9. package/dist/automation/indicator-battery/indicator-battery.js.map +1 -0
  10. package/dist/automation/indicator-engine/indicator-engine.css.js +45 -0
  11. package/dist/automation/indicator-engine/indicator-engine.css.js.map +1 -0
  12. package/dist/automation/indicator-engine/indicator-engine.d.ts +34 -0
  13. package/dist/automation/indicator-engine/indicator-engine.d.ts.map +1 -0
  14. package/dist/automation/indicator-engine/indicator-engine.js +73 -0
  15. package/dist/automation/indicator-engine/indicator-engine.js.map +1 -0
  16. package/dist/automation/indicator-generator/indicator-generator-geometry.d.ts +30 -0
  17. package/dist/automation/indicator-generator/indicator-generator-geometry.d.ts.map +1 -0
  18. package/dist/automation/indicator-generator/indicator-generator-geometry.js +61 -0
  19. package/dist/automation/indicator-generator/indicator-generator-geometry.js.map +1 -0
  20. package/dist/automation/indicator-generator/indicator-generator.css.js +121 -0
  21. package/dist/automation/indicator-generator/indicator-generator.css.js.map +1 -0
  22. package/dist/automation/indicator-generator/indicator-generator.d.ts +57 -0
  23. package/dist/automation/indicator-generator/indicator-generator.d.ts.map +1 -0
  24. package/dist/automation/indicator-generator/indicator-generator.js +136 -0
  25. package/dist/automation/indicator-generator/indicator-generator.js.map +1 -0
  26. package/dist/automation/indicator-shared/linear-indicator.d.ts +46 -0
  27. package/dist/automation/indicator-shared/linear-indicator.d.ts.map +1 -0
  28. package/dist/automation/indicator-shared/linear-indicator.js +175 -0
  29. package/dist/automation/indicator-shared/linear-indicator.js.map +1 -0
  30. package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.css.js +48 -0
  31. package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.css.js.map +1 -0
  32. package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.d.ts +65 -0
  33. package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.d.ts.map +1 -0
  34. package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.js +105 -0
  35. package/dist/automation/indicator-tank-atmospheric/indicator-tank-atmospheric.js.map +1 -0
  36. package/dist/navigation-instruments/compass/compass.d.ts +1 -1
  37. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -1
  38. package/dist/navigation-instruments/compass/compass.js +1 -1
  39. package/dist/navigation-instruments/compass/compass.js.map +1 -1
  40. package/dist/navigation-instruments/current/current.d.ts +25 -0
  41. package/dist/navigation-instruments/current/current.d.ts.map +1 -1
  42. package/dist/navigation-instruments/current/current.js +25 -4
  43. package/dist/navigation-instruments/current/current.js.map +1 -1
  44. package/dist/navigation-instruments/heading/heading.js +1 -1
  45. package/dist/navigation-instruments/heading/heading.js.map +1 -1
  46. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.d.ts +6 -0
  47. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.d.ts.map +1 -1
  48. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.js +8 -1
  49. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.js.map +1 -1
  50. package/dist/navigation-instruments/rate-of-turn/rate-of-turn.d.ts +5 -2
  51. package/dist/navigation-instruments/rate-of-turn/rate-of-turn.d.ts.map +1 -1
  52. package/dist/navigation-instruments/rate-of-turn/rate-of-turn.js.map +1 -1
  53. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.d.ts +6 -0
  54. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.d.ts.map +1 -1
  55. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.js +19 -4
  56. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.js.map +1 -1
  57. package/dist/navigation-instruments/watch/environment.d.ts +8 -0
  58. package/dist/navigation-instruments/watch/environment.d.ts.map +1 -1
  59. package/dist/navigation-instruments/watch/environment.js +3 -0
  60. package/dist/navigation-instruments/watch/environment.js.map +1 -1
  61. package/dist/navigation-instruments/watch/force-pattern.d.ts +20 -2
  62. package/dist/navigation-instruments/watch/force-pattern.d.ts.map +1 -1
  63. package/dist/navigation-instruments/watch/force-pattern.js +12 -5
  64. package/dist/navigation-instruments/watch/force-pattern.js.map +1 -1
  65. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  66. package/dist/navigation-instruments/watch/watch.js +6 -4
  67. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  68. package/dist/navigation-instruments/wind/wind.d.ts +5 -2
  69. package/dist/navigation-instruments/wind/wind.d.ts.map +1 -1
  70. package/dist/navigation-instruments/wind/wind.js +5 -1
  71. package/dist/navigation-instruments/wind/wind.js.map +1 -1
  72. package/package.json +1 -1
@@ -0,0 +1,52 @@
1
+ import { css } from "lit";
2
+ const componentStyle = css`* {
3
+ -webkit-tap-highlight-color: transparent;
4
+ }
5
+
6
+ :host {
7
+ display: block;
8
+ position: relative;
9
+ width: 48px;
10
+ height: 48px;
11
+ }
12
+
13
+ svg {
14
+ display: block;
15
+ width: 100%;
16
+ height: 100%;
17
+ }
18
+
19
+ .shell {
20
+ fill: var(--instrument-frame-primary-color);
21
+ stroke: var(--instrument-frame-tertiary-color);
22
+ }
23
+
24
+ .tip {
25
+ fill: var(--instrument-frame-tertiary-color);
26
+ }
27
+
28
+ .icon-wrapper {
29
+ position: absolute;
30
+ inset: 12px;
31
+ color: var(--element-neutral-color);
32
+ }
33
+
34
+ :host([value="enhanced"]) .icon-wrapper {
35
+ color: var(--element-neutral-enhanced-color);
36
+ }
37
+
38
+ :host([value="categorical"]) .icon-wrapper {
39
+ color: var(--base-teal-500);
40
+ }
41
+
42
+ .icon-wrapper ::slotted(*),
43
+ .icon-wrapper obi-energy-battery {
44
+ display: block;
45
+ width: 100%;
46
+ height: 100%;
47
+ }
48
+ `;
49
+ export {
50
+ componentStyle as default
51
+ };
52
+ //# sourceMappingURL=indicator-battery.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-battery.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,65 @@
1
+ import { LitElement } from 'lit';
2
+ import { IndicatorDirection } from '../indicator-shared/linear-indicator.js';
3
+ import '../../icons/icon-energy-battery.js';
4
+ export declare enum IndicatorBatteryVariant {
5
+ bar = "bar",
6
+ trend = "trend"
7
+ }
8
+ export declare enum IndicatorBatteryValue {
9
+ regular = "regular",
10
+ enhanced = "enhanced",
11
+ categorical = "categorical"
12
+ }
13
+ /**
14
+ * Compact 48×48 battery charge indicator.
15
+ *
16
+ * ## Features / Variants
17
+ * - `variant`: `bar` (bottom-up percentage fill) or `trend` (history graph
18
+ * with a current-value micro-bar)
19
+ * - `direction`: `vertical` or `horizontal` battery shell
20
+ * - `value`: color scheme — `regular`, `enhanced` or `categorical`
21
+ * - `level`: current charge 0–100 (%), drives the fill and micro-bar
22
+ * - `data`: history samples 0–100 (%) drawn as the trend graph
23
+ * - `hasIcon`: centered icon overlay (bar variant only)
24
+ *
25
+ * ## Usage Guidelines
26
+ * Use as an at-a-glance charge indicator in dashboards and lists. For a
27
+ * full-featured tank/battery cell with readouts, badges and setpoints, use
28
+ * `obc-automation-tank` (type `battery`) instead.
29
+ *
30
+ * ## Best Practices / Constraints
31
+ * - `level` and `data` values are clamped to 0–100; values outside that
32
+ * range are pinned to the nearest bound.
33
+ * - The `trend` variant needs at least two `data` samples to draw a line;
34
+ * with fewer it shows only the current-value micro-bar.
35
+ * - The `icon` slot renders only in the `bar` variant; it is ignored in
36
+ * `trend`.
37
+ * - Display-only: the root SVG is `aria-hidden`; convey battery state to
38
+ * assistive tech through adjacent text if it is not otherwise available.
39
+ *
40
+ * ## Slots
41
+ * | Slot | Condition | Purpose |
42
+ * | ------ | ----------------------------- | ------------------------------ |
43
+ * | `icon` | `hasIcon` and `variant='bar'` | Icon overlay (`obi-*` element) |
44
+ *
45
+ * @slot icon - Centered icon overlay, defaults to `obi-energy-battery`
46
+ */
47
+ export declare class ObcIndicatorBattery extends LitElement {
48
+ direction: IndicatorDirection;
49
+ variant: IndicatorBatteryVariant;
50
+ value: IndicatorBatteryValue;
51
+ /** Current charge, 0-100 (%) */
52
+ level: number;
53
+ /** History samples, 0-100 (%) each, oldest first */
54
+ data: number[];
55
+ hasIcon: boolean;
56
+ private get scheme();
57
+ render(): import('lit-html').TemplateResult<1>;
58
+ static styles: import('lit').CSSResult;
59
+ }
60
+ declare global {
61
+ interface HTMLElementTagNameMap {
62
+ 'obc-indicator-battery': ObcIndicatorBattery;
63
+ }
64
+ }
65
+ //# sourceMappingURL=indicator-battery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-battery.d.ts","sourceRoot":"","sources":["../../../src/automation/indicator-battery/indicator-battery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAIzD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAKnB,MAAM,yCAAyC,CAAC;AAEjD,oBAAY,uBAAuB;IACjC,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB;AAED,oBAAY,qBAAqB;IAC/B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;CAC5B;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBACa,mBAAoB,SAAQ,UAAU;IACR,SAAS,EAAE,kBAAkB,CACxC;IACW,OAAO,EAAE,uBAAuB,CAC3C;IACW,KAAK,EAAE,qBAAqB,CACrC;IAChC,gCAAgC;IACN,KAAK,SAAK;IACpC,oDAAoD;IAC3B,IAAI,EAAE,MAAM,EAAE,CAAM;IAClB,OAAO,UAAS;IAE3C,OAAO,KAAK,MAAM,GASjB;IAEQ,MAAM;IA+Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,mBAAmB,CAAC;KAC9C;CACF"}
@@ -0,0 +1,119 @@
1
+ import { unsafeCSS, LitElement, nothing, html } from "lit";
2
+ import { property } from "lit/decorators.js";
3
+ import componentStyle from "./indicator-battery.css.js";
4
+ import { customElement } from "../../decorator.js";
5
+ import "../../icons/icon-energy-battery.js";
6
+ import { IndicatorDirection, LinearIndicatorScheme, renderTrendGraph, renderLinearBar } from "../indicator-shared/linear-indicator.js";
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __decorateClass = (decorators, target, key, kind) => {
10
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
11
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
12
+ if (decorator = decorators[i])
13
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
14
+ if (kind && result) __defProp(target, key, result);
15
+ return result;
16
+ };
17
+ var IndicatorBatteryVariant = /* @__PURE__ */ ((IndicatorBatteryVariant2) => {
18
+ IndicatorBatteryVariant2["bar"] = "bar";
19
+ IndicatorBatteryVariant2["trend"] = "trend";
20
+ return IndicatorBatteryVariant2;
21
+ })(IndicatorBatteryVariant || {});
22
+ var IndicatorBatteryValue = /* @__PURE__ */ ((IndicatorBatteryValue2) => {
23
+ IndicatorBatteryValue2["regular"] = "regular";
24
+ IndicatorBatteryValue2["enhanced"] = "enhanced";
25
+ IndicatorBatteryValue2["categorical"] = "categorical";
26
+ return IndicatorBatteryValue2;
27
+ })(IndicatorBatteryValue || {});
28
+ const HORIZONTAL_SHELL = { x: 6, y: 8, width: 36, height: 32 };
29
+ const VERTICAL_SHELL = { x: 8, y: 6, width: 32, height: 36 };
30
+ const HORIZONTAL_BAR = { x: 9, y: 11, width: 30, height: 26 };
31
+ const VERTICAL_BAR = { x: 11, y: 9, width: 26, height: 30 };
32
+ const HORIZONTAL_TREND = { x: 8, y: 10, width: 32, height: 28 };
33
+ const VERTICAL_TREND = { x: 10, y: 8, width: 28, height: 32 };
34
+ const HORIZONTAL_TIP_PATH = "M42 18 H44 A2 2 0 0 1 46 20 V28 A2 2 0 0 1 44 30 H42 Z";
35
+ const VERTICAL_TIP_PATH = "M18 6 V4 A2 2 0 0 1 20 2 H28 A2 2 0 0 1 30 4 V6 Z";
36
+ let ObcIndicatorBattery = class extends LitElement {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.direction = IndicatorDirection.vertical;
40
+ this.variant = "bar";
41
+ this.value = "regular";
42
+ this.level = 0;
43
+ this.data = [];
44
+ this.hasIcon = false;
45
+ }
46
+ get scheme() {
47
+ switch (this.value) {
48
+ case "enhanced":
49
+ return LinearIndicatorScheme.enhanced;
50
+ case "categorical":
51
+ return LinearIndicatorScheme.categorical;
52
+ default:
53
+ return LinearIndicatorScheme.regular;
54
+ }
55
+ }
56
+ render() {
57
+ const horizontal = this.direction === IndicatorDirection.horizontal;
58
+ const trend = this.variant === "trend";
59
+ const shell = horizontal ? HORIZONTAL_SHELL : VERTICAL_SHELL;
60
+ const barRect = horizontal ? trend ? HORIZONTAL_TREND : HORIZONTAL_BAR : trend ? VERTICAL_TREND : VERTICAL_BAR;
61
+ const showIcon = this.hasIcon && this.variant === "bar";
62
+ return html`
63
+ <svg viewBox="0 0 48 48" aria-hidden="true">
64
+ <path
65
+ class="tip"
66
+ d=${horizontal ? HORIZONTAL_TIP_PATH : VERTICAL_TIP_PATH}
67
+ />
68
+ <rect
69
+ class="shell"
70
+ x=${shell.x}
71
+ y=${shell.y}
72
+ width=${shell.width}
73
+ height=${shell.height}
74
+ rx="4"
75
+ />
76
+ ${this.variant === "trend" ? renderTrendGraph(
77
+ barRect,
78
+ this.data,
79
+ this.level,
80
+ this.scheme,
81
+ "battery"
82
+ ) : renderLinearBar(barRect, this.level, this.scheme, "battery")}
83
+ </svg>
84
+ ${showIcon ? html`<div class="icon-wrapper">
85
+ <slot name="icon">
86
+ <obi-energy-battery usecsscolor></obi-energy-battery>
87
+ </slot>
88
+ </div>` : nothing}
89
+ `;
90
+ }
91
+ };
92
+ ObcIndicatorBattery.styles = unsafeCSS(componentStyle);
93
+ __decorateClass([
94
+ property({ type: String, reflect: true })
95
+ ], ObcIndicatorBattery.prototype, "direction", 2);
96
+ __decorateClass([
97
+ property({ type: String, reflect: true })
98
+ ], ObcIndicatorBattery.prototype, "variant", 2);
99
+ __decorateClass([
100
+ property({ type: String, reflect: true })
101
+ ], ObcIndicatorBattery.prototype, "value", 2);
102
+ __decorateClass([
103
+ property({ type: Number })
104
+ ], ObcIndicatorBattery.prototype, "level", 2);
105
+ __decorateClass([
106
+ property({ type: Array })
107
+ ], ObcIndicatorBattery.prototype, "data", 2);
108
+ __decorateClass([
109
+ property({ type: Boolean })
110
+ ], ObcIndicatorBattery.prototype, "hasIcon", 2);
111
+ ObcIndicatorBattery = __decorateClass([
112
+ customElement("obc-indicator-battery")
113
+ ], ObcIndicatorBattery);
114
+ export {
115
+ IndicatorBatteryValue,
116
+ IndicatorBatteryVariant,
117
+ ObcIndicatorBattery
118
+ };
119
+ //# sourceMappingURL=indicator-battery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-battery.js","sources":["../../../src/automation/indicator-battery/indicator-battery.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './indicator-battery.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../icons/icon-energy-battery.js';\nimport {\n IndicatorDirection,\n LinearIndicatorScheme,\n Rect,\n renderLinearBar,\n renderTrendGraph,\n} from '../indicator-shared/linear-indicator.js';\n\nexport enum IndicatorBatteryVariant {\n bar = 'bar',\n trend = 'trend',\n}\n\nexport enum IndicatorBatteryValue {\n regular = 'regular',\n enhanced = 'enhanced',\n categorical = 'categorical',\n}\n\nconst HORIZONTAL_SHELL: Rect = {x: 6, y: 8, width: 36, height: 32};\nconst VERTICAL_SHELL: Rect = {x: 8, y: 6, width: 32, height: 36};\nconst HORIZONTAL_BAR: Rect = {x: 9, y: 11, width: 30, height: 26};\nconst VERTICAL_BAR: Rect = {x: 11, y: 9, width: 26, height: 30};\nconst HORIZONTAL_TREND: Rect = {x: 8, y: 10, width: 32, height: 28};\nconst VERTICAL_TREND: Rect = {x: 10, y: 8, width: 28, height: 32};\n\nconst HORIZONTAL_TIP_PATH =\n 'M42 18 H44 A2 2 0 0 1 46 20 V28 A2 2 0 0 1 44 30 H42 Z';\nconst VERTICAL_TIP_PATH = 'M18 6 V4 A2 2 0 0 1 20 2 H28 A2 2 0 0 1 30 4 V6 Z';\n\n/**\n * Compact 48×48 battery charge indicator.\n *\n * ## Features / Variants\n * - `variant`: `bar` (bottom-up percentage fill) or `trend` (history graph\n * with a current-value micro-bar)\n * - `direction`: `vertical` or `horizontal` battery shell\n * - `value`: color scheme — `regular`, `enhanced` or `categorical`\n * - `level`: current charge 0–100 (%), drives the fill and micro-bar\n * - `data`: history samples 0–100 (%) drawn as the trend graph\n * - `hasIcon`: centered icon overlay (bar variant only)\n *\n * ## Usage Guidelines\n * Use as an at-a-glance charge indicator in dashboards and lists. For a\n * full-featured tank/battery cell with readouts, badges and setpoints, use\n * `obc-automation-tank` (type `battery`) instead.\n *\n * ## Best Practices / Constraints\n * - `level` and `data` values are clamped to 0–100; values outside that\n * range are pinned to the nearest bound.\n * - The `trend` variant needs at least two `data` samples to draw a line;\n * with fewer it shows only the current-value micro-bar.\n * - The `icon` slot renders only in the `bar` variant; it is ignored in\n * `trend`.\n * - Display-only: the root SVG is `aria-hidden`; convey battery state to\n * assistive tech through adjacent text if it is not otherwise available.\n *\n * ## Slots\n * | Slot | Condition | Purpose |\n * | ------ | ----------------------------- | ------------------------------ |\n * | `icon` | `hasIcon` and `variant='bar'` | Icon overlay (`obi-*` element) |\n *\n * @slot icon - Centered icon overlay, defaults to `obi-energy-battery`\n */\n@customElement('obc-indicator-battery')\nexport class ObcIndicatorBattery extends LitElement {\n @property({type: String, reflect: true}) direction: IndicatorDirection =\n IndicatorDirection.vertical;\n @property({type: String, reflect: true}) variant: IndicatorBatteryVariant =\n IndicatorBatteryVariant.bar;\n @property({type: String, reflect: true}) value: IndicatorBatteryValue =\n IndicatorBatteryValue.regular;\n /** Current charge, 0-100 (%) */\n @property({type: Number}) level = 0;\n /** History samples, 0-100 (%) each, oldest first */\n @property({type: Array}) data: number[] = [];\n @property({type: Boolean}) hasIcon = false;\n\n private get scheme(): LinearIndicatorScheme {\n switch (this.value) {\n case IndicatorBatteryValue.enhanced:\n return LinearIndicatorScheme.enhanced;\n case IndicatorBatteryValue.categorical:\n return LinearIndicatorScheme.categorical;\n default:\n return LinearIndicatorScheme.regular;\n }\n }\n\n override render() {\n const horizontal = this.direction === IndicatorDirection.horizontal;\n const trend = this.variant === IndicatorBatteryVariant.trend;\n const shell = horizontal ? HORIZONTAL_SHELL : VERTICAL_SHELL;\n const barRect = horizontal\n ? trend\n ? HORIZONTAL_TREND\n : HORIZONTAL_BAR\n : trend\n ? VERTICAL_TREND\n : VERTICAL_BAR;\n const showIcon =\n this.hasIcon && this.variant === IndicatorBatteryVariant.bar;\n return html`\n <svg viewBox=\"0 0 48 48\" aria-hidden=\"true\">\n <path\n class=\"tip\"\n d=${horizontal ? HORIZONTAL_TIP_PATH : VERTICAL_TIP_PATH}\n />\n <rect\n class=\"shell\"\n x=${shell.x}\n y=${shell.y}\n width=${shell.width}\n height=${shell.height}\n rx=\"4\"\n />\n ${this.variant === IndicatorBatteryVariant.trend\n ? renderTrendGraph(\n barRect,\n this.data,\n this.level,\n this.scheme,\n 'battery'\n )\n : renderLinearBar(barRect, this.level, this.scheme, 'battery')}\n </svg>\n ${showIcon\n ? html`<div class=\"icon-wrapper\">\n <slot name=\"icon\">\n <obi-energy-battery usecsscolor></obi-energy-battery>\n </slot>\n </div>`\n : nothing}\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-indicator-battery': ObcIndicatorBattery;\n }\n}\n"],"names":["IndicatorBatteryVariant","IndicatorBatteryValue"],"mappings":";;;;;;;;;;;;;;;;AAaO,IAAK,4CAAAA,6BAAL;AACLA,2BAAA,KAAA,IAAM;AACNA,2BAAA,OAAA,IAAQ;AAFE,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAKL,IAAK,0CAAAC,2BAAL;AACLA,yBAAA,SAAA,IAAU;AACVA,yBAAA,UAAA,IAAW;AACXA,yBAAA,aAAA,IAAc;AAHJ,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AAMZ,MAAM,mBAAyB,EAAC,GAAG,GAAG,GAAG,GAAG,OAAO,IAAI,QAAQ,GAAA;AAC/D,MAAM,iBAAuB,EAAC,GAAG,GAAG,GAAG,GAAG,OAAO,IAAI,QAAQ,GAAA;AAC7D,MAAM,iBAAuB,EAAC,GAAG,GAAG,GAAG,IAAI,OAAO,IAAI,QAAQ,GAAA;AAC9D,MAAM,eAAqB,EAAC,GAAG,IAAI,GAAG,GAAG,OAAO,IAAI,QAAQ,GAAA;AAC5D,MAAM,mBAAyB,EAAC,GAAG,GAAG,GAAG,IAAI,OAAO,IAAI,QAAQ,GAAA;AAChE,MAAM,iBAAuB,EAAC,GAAG,IAAI,GAAG,GAAG,OAAO,IAAI,QAAQ,GAAA;AAE9D,MAAM,sBACJ;AACF,MAAM,oBAAoB;AAqCnB,IAAM,sBAAN,cAAkC,WAAW;AAAA,EAA7C,cAAA;AAAA,UAAA,GAAA,SAAA;AACoC,SAAA,YACv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xC,SAAS,EAAC,MAAM,QAAQ,SAAS,MAAK;AAAA,GAL5B,oBAK8B,WAAA,SAAA,CAAA;AAGf,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GARb,oBAQe,WAAA,SAAA,CAAA;AAED,gBAAA;AAAA,EAAxB,SAAS,EAAC,MAAM,MAAA,CAAM;AAAA,GAVZ,oBAUc,WAAA,QAAA,CAAA;AACE,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GAXd,oBAWgB,WAAA,WAAA,CAAA;AAXhB,sBAAN,gBAAA;AAAA,EADN,cAAc,uBAAuB;AAAA,GACzB,mBAAA;"}
@@ -0,0 +1,45 @@
1
+ import { css } from "lit";
2
+ const componentStyle = css`* {
3
+ -webkit-tap-highlight-color: transparent;
4
+ }
5
+
6
+ :host {
7
+ display: block;
8
+ width: 48px;
9
+ height: 48px;
10
+ }
11
+
12
+ svg {
13
+ display: block;
14
+ width: 100%;
15
+ height: 100%;
16
+ }
17
+
18
+ .frame {
19
+ fill: var(--instrument-frame-primary-color);
20
+ stroke: var(--instrument-frame-tertiary-color);
21
+ }
22
+
23
+ .rail {
24
+ fill: var(--instrument-frame-tertiary-color);
25
+ }
26
+
27
+ .cylinder {
28
+ fill: var(--instrument-frame-tertiary-color);
29
+ stroke: var(--instrument-frame-tertiary-color);
30
+ }
31
+
32
+ :host([value="regular"]) .cylinder {
33
+ fill: var(--automation-device-secondary-color);
34
+ stroke: var(--element-neutral-color);
35
+ }
36
+
37
+ :host([value="enhanced"]) .cylinder {
38
+ fill: var(--base-blue-300);
39
+ stroke: var(--element-neutral-enhanced-color);
40
+ }
41
+ `;
42
+ export {
43
+ componentStyle as default
44
+ };
45
+ //# sourceMappingURL=indicator-engine.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-engine.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,34 @@
1
+ import { LitElement } from 'lit';
2
+ import { IndicatorDirection } from '../indicator-shared/linear-indicator.js';
3
+ export declare enum IndicatorEngineValue {
4
+ static = "static",
5
+ regular = "regular",
6
+ enhanced = "enhanced"
7
+ }
8
+ /**
9
+ * Compact 48×48 engine indicator glyph.
10
+ *
11
+ * ## Features / Variants
12
+ * - `direction`: `vertical` (upright block with side rails) or `horizontal`
13
+ * (lying block on a base rail)
14
+ * - `value`: cylinder color — `static`, `regular` or `enhanced`
15
+ *
16
+ * ## Usage Guidelines
17
+ * Use as a static engine presence/state glyph in dashboards and lists.
18
+ * It carries no numeric value; pair it with readouts or other indicators
19
+ * when quantities must be shown.
20
+ */
21
+ export declare class ObcIndicatorEngine extends LitElement {
22
+ value: IndicatorEngineValue;
23
+ direction: IndicatorDirection;
24
+ private renderHorizontal;
25
+ private renderVertical;
26
+ render(): import('lit-html').TemplateResult<1>;
27
+ static styles: import('lit').CSSResult;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ 'obc-indicator-engine': ObcIndicatorEngine;
32
+ }
33
+ }
34
+ //# sourceMappingURL=indicator-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-engine.d.ts","sourceRoot":"","sources":["../../../src/automation/indicator-engine/indicator-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAuB,MAAM,KAAK,CAAC;AAIrD,OAAO,EAAC,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AAE3E,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAMD;;;;;;;;;;;;GAYG;AACH,qBACa,kBAAmB,SAAQ,UAAU;IACP,KAAK,EAAE,oBAAoB,CACtC;IACW,SAAS,EAAE,kBAAkB,CACxC;IAE9B,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,cAAc;IAYb,MAAM;IAUf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
@@ -0,0 +1,73 @@
1
+ import { unsafeCSS, LitElement, svg, html } from "lit";
2
+ import { property } from "lit/decorators.js";
3
+ import componentStyle from "./indicator-engine.css.js";
4
+ import { customElement } from "../../decorator.js";
5
+ import { IndicatorDirection } from "../indicator-shared/linear-indicator.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 IndicatorEngineValue = /* @__PURE__ */ ((IndicatorEngineValue2) => {
17
+ IndicatorEngineValue2["static"] = "static";
18
+ IndicatorEngineValue2["regular"] = "regular";
19
+ IndicatorEngineValue2["enhanced"] = "enhanced";
20
+ return IndicatorEngineValue2;
21
+ })(IndicatorEngineValue || {});
22
+ const CYLINDER_RADIUS = 3;
23
+ const HORIZONTAL_CYLINDER_CENTERS = [12, 20, 28, 36];
24
+ const VERTICAL_CYLINDER_CENTERS = [12, 20, 28, 36];
25
+ let ObcIndicatorEngine = class extends LitElement {
26
+ constructor() {
27
+ super(...arguments);
28
+ this.value = "static";
29
+ this.direction = IndicatorDirection.vertical;
30
+ }
31
+ renderHorizontal() {
32
+ return svg`
33
+ <rect class="rail" x="6" y="38" width="36" height="4" rx="2" />
34
+ <rect class="frame" x="6" y="12" width="36" height="24" rx="4" />
35
+ <rect class="rail" x="9" y="24" width="30" height="1" rx="0.5" />
36
+ ${HORIZONTAL_CYLINDER_CENTERS.map(
37
+ (cx) => svg`<circle class="cylinder" cx=${cx} cy="18" r=${CYLINDER_RADIUS} />`
38
+ )}
39
+ `;
40
+ }
41
+ renderVertical() {
42
+ return svg`
43
+ <rect class="frame" x="12" y="6" width="24" height="36" rx="4" />
44
+ <rect class="rail" x="16" y="10" width="1" height="28" rx="0.5" />
45
+ <rect class="rail" x="31" y="10" width="1" height="28" rx="0.5" />
46
+ ${VERTICAL_CYLINDER_CENTERS.map(
47
+ (cy) => svg`<circle class="cylinder" cx="24" cy=${cy} r=${CYLINDER_RADIUS} />`
48
+ )}
49
+ `;
50
+ }
51
+ render() {
52
+ return html`
53
+ <svg viewBox="0 0 48 48" aria-hidden="true">
54
+ ${this.direction === IndicatorDirection.horizontal ? this.renderHorizontal() : this.renderVertical()}
55
+ </svg>
56
+ `;
57
+ }
58
+ };
59
+ ObcIndicatorEngine.styles = unsafeCSS(componentStyle);
60
+ __decorateClass([
61
+ property({ type: String, reflect: true })
62
+ ], ObcIndicatorEngine.prototype, "value", 2);
63
+ __decorateClass([
64
+ property({ type: String, reflect: true })
65
+ ], ObcIndicatorEngine.prototype, "direction", 2);
66
+ ObcIndicatorEngine = __decorateClass([
67
+ customElement("obc-indicator-engine")
68
+ ], ObcIndicatorEngine);
69
+ export {
70
+ IndicatorEngineValue,
71
+ ObcIndicatorEngine
72
+ };
73
+ //# sourceMappingURL=indicator-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-engine.js","sources":["../../../src/automation/indicator-engine/indicator-engine.ts"],"sourcesContent":["import {LitElement, html, svg, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport componentStyle from './indicator-engine.css?inline';\nimport {customElement} from '../../decorator.js';\nimport {IndicatorDirection} from '../indicator-shared/linear-indicator.js';\n\nexport enum IndicatorEngineValue {\n static = 'static',\n regular = 'regular',\n enhanced = 'enhanced',\n}\n\nconst CYLINDER_RADIUS = 3;\nconst HORIZONTAL_CYLINDER_CENTERS = [12, 20, 28, 36];\nconst VERTICAL_CYLINDER_CENTERS = [12, 20, 28, 36];\n\n/**\n * Compact 48×48 engine indicator glyph.\n *\n * ## Features / Variants\n * - `direction`: `vertical` (upright block with side rails) or `horizontal`\n * (lying block on a base rail)\n * - `value`: cylinder color — `static`, `regular` or `enhanced`\n *\n * ## Usage Guidelines\n * Use as a static engine presence/state glyph in dashboards and lists.\n * It carries no numeric value; pair it with readouts or other indicators\n * when quantities must be shown.\n */\n@customElement('obc-indicator-engine')\nexport class ObcIndicatorEngine extends LitElement {\n @property({type: String, reflect: true}) value: IndicatorEngineValue =\n IndicatorEngineValue.static;\n @property({type: String, reflect: true}) direction: IndicatorDirection =\n IndicatorDirection.vertical;\n\n private renderHorizontal() {\n return svg`\n <rect class=\"rail\" x=\"6\" y=\"38\" width=\"36\" height=\"4\" rx=\"2\" />\n <rect class=\"frame\" x=\"6\" y=\"12\" width=\"36\" height=\"24\" rx=\"4\" />\n <rect class=\"rail\" x=\"9\" y=\"24\" width=\"30\" height=\"1\" rx=\"0.5\" />\n ${HORIZONTAL_CYLINDER_CENTERS.map(\n (cx) =>\n svg`<circle class=\"cylinder\" cx=${cx} cy=\"18\" r=${CYLINDER_RADIUS} />`\n )}\n `;\n }\n\n private renderVertical() {\n return svg`\n <rect class=\"frame\" x=\"12\" y=\"6\" width=\"24\" height=\"36\" rx=\"4\" />\n <rect class=\"rail\" x=\"16\" y=\"10\" width=\"1\" height=\"28\" rx=\"0.5\" />\n <rect class=\"rail\" x=\"31\" y=\"10\" width=\"1\" height=\"28\" rx=\"0.5\" />\n ${VERTICAL_CYLINDER_CENTERS.map(\n (cy) =>\n svg`<circle class=\"cylinder\" cx=\"24\" cy=${cy} r=${CYLINDER_RADIUS} />`\n )}\n `;\n }\n\n override render() {\n return html`\n <svg viewBox=\"0 0 48 48\" aria-hidden=\"true\">\n ${this.direction === IndicatorDirection.horizontal\n ? this.renderHorizontal()\n : this.renderVertical()}\n </svg>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagN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c,sBAAsB;AAAA,GACxB,kBAAA;"}
@@ -0,0 +1,30 @@
1
+ export declare const BUTTON_SILHOUETTE_RADIUS = 18.5;
2
+ export declare const DISC_RADIUS = 17.5;
3
+ export declare const FILLED_DISC_RADIUS = 18.5;
4
+ export declare const BAR_SILHOUETTE_RADIUS = 19.5;
5
+ export declare const BAR_SILHOUETTE_STROKE_WIDTH = 3;
6
+ export declare const BAR_OUTLINE_RADIUS = 16.5;
7
+ export declare const DOUBLE_BAR_OUTLINE_RADIUS = 17.5;
8
+ export declare const OUTLINE_STROKE_WIDTH = 3;
9
+ export declare const BAR_TRACK_RADIUS = 18;
10
+ export declare const BAR_TRACK_STROKE_WIDTH = 4;
11
+ export declare const DOUBLE_BAR_OUTER_RADIUS = 22;
12
+ export declare const DOUBLE_BAR_OUTER_STROKE_WIDTH = 4;
13
+ export declare const DOUBLE_BAR_INNER_RADIUS = 18;
14
+ export declare const DOUBLE_BAR_INNER_STROKE_WIDTH = 2;
15
+ export declare function clampPercent(value: number): number;
16
+ /** Sweep (deg) of the progress arc, clockwise from 12 o'clock. */
17
+ export declare function progressSweep(level: number): number;
18
+ /** Point on a circle; angle in degrees clockwise from 12 o'clock. */
19
+ export declare function polarPoint(cx: number, cy: number, radius: number, angleDeg: number): {
20
+ x: number;
21
+ y: number;
22
+ };
23
+ /**
24
+ * Circular arc path from startAngle to endAngle (deg, clockwise from
25
+ * 12 o'clock), meant to be stroked. Sweeps above 180° are split into two
26
+ * arc segments; non-positive sweeps yield an empty string. Full circles
27
+ * (sweep 360) should be drawn with a `<circle>` element instead.
28
+ */
29
+ export declare function arcPath(cx: number, cy: number, radius: number, startAngleDeg: number, endAngleDeg: number): string;
30
+ //# sourceMappingURL=indicator-generator-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-generator-geometry.d.ts","sourceRoot":"","sources":["../../../src/automation/indicator-generator/indicator-generator-geometry.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,OAA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AR_OUTLINE_RADIUS = 16.5;
7
+ const DOUBLE_BAR_OUTLINE_RADIUS = 17.5;
8
+ const OUTLINE_STROKE_WIDTH = 3;
9
+ const BAR_TRACK_RADIUS = 18;
10
+ const BAR_TRACK_STROKE_WIDTH = 4;
11
+ const DOUBLE_BAR_OUTER_RADIUS = 22;
12
+ const DOUBLE_BAR_OUTER_STROKE_WIDTH = 4;
13
+ const DOUBLE_BAR_INNER_RADIUS = 18;
14
+ const DOUBLE_BAR_INNER_STROKE_WIDTH = 2;
15
+ function clampPercent(value) {
16
+ if (Number.isNaN(value)) return 0;
17
+ return Math.min(100, Math.max(0, value));
18
+ }
19
+ function progressSweep(level) {
20
+ return 360 * clampPercent(level) / 100;
21
+ }
22
+ function polarPoint(cx, cy, radius, angleDeg) {
23
+ const rad = angleDeg * Math.PI / 180;
24
+ return {
25
+ x: Math.round((cx + radius * Math.sin(rad)) * 1e3) / 1e3,
26
+ y: Math.round((cy - radius * Math.cos(rad)) * 1e3) / 1e3
27
+ };
28
+ }
29
+ function arcPath(cx, cy, radius, startAngleDeg, endAngleDeg) {
30
+ const sweep = endAngleDeg - startAngleDeg;
31
+ if (sweep <= 0) return "";
32
+ const start = polarPoint(cx, cy, radius, startAngleDeg);
33
+ if (sweep > 180) {
34
+ const mid = polarPoint(cx, cy, radius, startAngleDeg + sweep / 2);
35
+ const end2 = polarPoint(cx, cy, radius, endAngleDeg);
36
+ return `M ${start.x} ${start.y} A ${radius} ${radius} 0 0 1 ${mid.x} ${mid.y} A ${radius} ${radius} 0 0 1 ${end2.x} ${end2.y}`;
37
+ }
38
+ const end = polarPoint(cx, cy, radius, endAngleDeg);
39
+ return `M ${start.x} ${start.y} A ${radius} ${radius} 0 0 1 ${end.x} ${end.y}`;
40
+ }
41
+ export {
42
+ BAR_OUTLINE_RADIUS,
43
+ BAR_SILHOUETTE_RADIUS,
44
+ BAR_SILHOUETTE_STROKE_WIDTH,
45
+ BAR_TRACK_RADIUS,
46
+ BAR_TRACK_STROKE_WIDTH,
47
+ BUTTON_SILHOUETTE_RADIUS,
48
+ DISC_RADIUS,
49
+ DOUBLE_BAR_INNER_RADIUS,
50
+ DOUBLE_BAR_INNER_STROKE_WIDTH,
51
+ DOUBLE_BAR_OUTER_RADIUS,
52
+ DOUBLE_BAR_OUTER_STROKE_WIDTH,
53
+ DOUBLE_BAR_OUTLINE_RADIUS,
54
+ FILLED_DISC_RADIUS,
55
+ OUTLINE_STROKE_WIDTH,
56
+ arcPath,
57
+ clampPercent,
58
+ polarPoint,
59
+ progressSweep
60
+ };
61
+ //# sourceMappingURL=indicator-generator-geometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-generator-geometry.js","sources":["../../../src/automation/indicator-generator/indicator-generator-geometry.ts"],"sourcesContent":["export const BUTTON_SILHOUETTE_RADIUS = 18.5;\nexport const DISC_RADIUS = 17.5;\nexport const FILLED_DISC_RADIUS = 18.5;\nexport const BAR_SILHOUETTE_RADIUS = 19.5;\nexport const BAR_SILHOUETTE_STROKE_WIDTH = 3;\nexport const BAR_OUTLINE_RADIUS = 16.5;\nexport const DOUBLE_BAR_OUTLINE_RADIUS = 17.5;\nexport const OUTLINE_STROKE_WIDTH = 3;\nexport const BAR_TRACK_RADIUS = 18;\nexport const BAR_TRACK_STROKE_WIDTH = 4;\nexport const DOUBLE_BAR_OUTER_RADIUS = 22;\nexport const DOUBLE_BAR_OUTER_STROKE_WIDTH = 4;\nexport const DOUBLE_BAR_INNER_RADIUS = 18;\nexport const DOUBLE_BAR_INNER_STROKE_WIDTH = 2;\n\nexport function clampPercent(value: number): number {\n if (Number.isNaN(value)) return 0;\n return Math.min(100, Math.max(0, value));\n}\n\n/** Sweep (deg) of the progress arc, clockwise from 12 o'clock. */\nexport function progressSweep(level: number): number {\n return (360 * clampPercent(level)) / 100;\n}\n\n/** Point on a circle; angle in degrees clockwise from 12 o'clock. */\nexport function polarPoint(\n cx: number,\n cy: number,\n radius: number,\n angleDeg: number\n): {x: number; y: number} {\n const rad = (angleDeg * Math.PI) / 180;\n return {\n x: Math.round((cx + radius * Math.sin(rad)) * 1000) / 1000,\n y: Math.round((cy - radius * Math.cos(rad)) * 1000) / 1000,\n };\n}\n\n/**\n * Circular arc path from startAngle to endAngle (deg, clockwise from\n * 12 o'clock), meant to be stroked. Sweeps above 180° are split into two\n * arc segments; non-positive sweeps yield an empty string. Full circles\n * (sweep 360) should be drawn with a `<circle>` element instead.\n */\nexport function arcPath(\n cx: number,\n cy: number,\n radius: number,\n startAngleDeg: number,\n endAngleDeg: number\n): string {\n const sweep = endAngleDeg - startAngleDeg;\n if (sweep <= 0) return '';\n const start = polarPoint(cx, cy, radius, startAngleDeg);\n if (sweep > 180) {\n const mid = polarPoint(cx, cy, radius, startAngleDeg + sweep / 2);\n const end = polarPoint(cx, cy, radius, endAngleDeg);\n return `M ${start.x} ${start.y} A ${radius} ${radius} 0 0 1 ${mid.x} ${mid.y} A ${radius} ${radius} 0 0 1 ${end.x} ${end.y}`;\n }\n const end = polarPoint(cx, cy, radius, endAngleDeg);\n return `M ${start.x} ${start.y} A ${radius} ${radius} 0 0 1 ${end.x} ${end.y}`;\n}\n"],"names":["end"],"mappings":"AAAO,MAAM,2BAA2B;AACjC,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAC9B,MAAM,8BAA8B;AACpC,MAAM,qBAAqB;AAC3B,MAAM,4BAA4B;AAClC,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AAC/B,MAAM,0BAA0B;AAChC,MAAM,gCAAgC;AACtC,MAAM,0BAA0B;AAChC,MAAM,gCAAgC;AAEtC,SAAS,aAAa,OAAuB;AAClD,MAAI,OAAO,MAAM,KAAK,EAAG,QAAO;AAChC,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACzC;AAGO,SAAS,cAAc,OAAuB;AACnD,SAAQ,MAAM,aAAa,KAAK,IAAK;AACvC;AAGO,SAAS,WACd,IACA,IACA,QACA,UACwB;AACxB,QAAM,MAAO,WAAW,KAAK,KAAM;AACnC,SAAO;AAAA,IACL,GAAG,KAAK,OAAO,KAAK,SAAS,KAAK,IAAI,GAAG,KAAK,GAAI,IAAI;AAAA,IACtD,GAAG,KAAK,OAAO,KAAK,SAAS,KAAK,IAAI,GAAG,KAAK,GAAI,IAAI;AAAA,EAAA;AAE1D;AAQO,SAAS,QACd,IACA,IACA,QACA,eACA,aACQ;AACR,QAAM,QAAQ,cAAc;AAC5B,MAAI,SAAS,EAAG,QAAO;AACvB,QAAM,QAAQ,WAAW,IAAI,IAAI,QAAQ,aAAa;AACtD,MAAI,QAAQ,KAAK;AACf,UAAM,MAAM,WAAW,IAAI,IAAI,QAAQ,gBAAgB,QAAQ,CAAC;AAChE,UAAMA,OAAM,WAAW,IAAI,IAAI,QAAQ,WAAW;AAClD,WAAO,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,MAAM,IAAI,MAAM,UAAU,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,MAAM,IAAI,MAAM,UAAUA,KAAI,CAAC,IAAIA,KAAI,CAAC;AAAA,EAC5H;AACA,QAAM,MAAM,WAAW,IAAI,IAAI,QAAQ,WAAW;AAClD,SAAO,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,MAAM,IAAI,MAAM,UAAU,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9E;"}
@@ -0,0 +1,121 @@
1
+ import { css } from "lit";
2
+ const componentStyle = css`* {
3
+ -webkit-tap-highlight-color: transparent;
4
+ }
5
+
6
+ :host {
7
+ display: block;
8
+ position: relative;
9
+ width: 48px;
10
+ height: 48px;
11
+ }
12
+
13
+ :host([variant="double-bar"]) {
14
+ width: 56px;
15
+ height: 56px;
16
+ }
17
+
18
+ svg {
19
+ display: block;
20
+ width: 100%;
21
+ height: 100%;
22
+ }
23
+
24
+ .silhouette {
25
+ fill: var(--instrument-frame-primary-color);
26
+ stroke: var(--border-silhouette-color);
27
+ }
28
+
29
+ .silhouette-ring {
30
+ fill: none;
31
+ stroke: var(--border-silhouette-color);
32
+ }
33
+
34
+ .disc {
35
+ fill: var(--instrument-frame-primary-color);
36
+ stroke: var(--instrument-frame-tertiary-color);
37
+ }
38
+
39
+ :host([value="off"]) .disc {
40
+ fill: var(--automation-button-off-background-color);
41
+ stroke: var(--automation-button-off-border-color);
42
+ }
43
+
44
+ :host([value="filled"]) .disc {
45
+ stroke: var(--element-neutral-color);
46
+ }
47
+
48
+ :host([value="filled"][variant="double-bar"]) .disc {
49
+ fill: var(--element-neutral-color);
50
+ stroke: var(--element-neutral-color);
51
+ }
52
+
53
+ :host([value="enhanced"]) .disc {
54
+ fill: var(--element-neutral-enhanced-color);
55
+ stroke: var(--base-blue-600);
56
+ }
57
+
58
+ :host([value="categorical"]) .disc {
59
+ fill: var(--base-teal-400);
60
+ stroke: var(--base-teal-500);
61
+ }
62
+
63
+ .outline {
64
+ fill: none;
65
+ stroke: var(--border-silhouette-color);
66
+ }
67
+
68
+ .ring-track {
69
+ fill: none;
70
+ stroke: var(--border-divider-color);
71
+ }
72
+
73
+ .ring-progress {
74
+ fill: none;
75
+ stroke: var(--element-neutral-color);
76
+ }
77
+
78
+ :host([value="enhanced"]) .ring-progress {
79
+ stroke: var(--element-neutral-enhanced-color);
80
+ }
81
+
82
+ :host([value="categorical"]) .ring-progress {
83
+ stroke: var(--base-teal-400);
84
+ }
85
+
86
+ .icon-wrapper {
87
+ position: absolute;
88
+ inset: 12px;
89
+ color: var(--element-neutral-color);
90
+ pointer-events: none;
91
+ }
92
+
93
+ :host([variant="double-bar"]) .icon-wrapper {
94
+ inset: 16px;
95
+ }
96
+
97
+ :host([value="off"]) .icon-wrapper {
98
+ color: var(--instrument-frame-tertiary-color);
99
+ }
100
+
101
+ :host([value="filled"]) .icon-wrapper,
102
+ :host([value="enhanced"]) .icon-wrapper,
103
+ :host([value="categorical"]) .icon-wrapper {
104
+ color: var(--instrument-frame-primary-color);
105
+ }
106
+
107
+ .icon-wrapper ::slotted(*),
108
+ .default-icon {
109
+ display: block;
110
+ width: 100%;
111
+ height: 100%;
112
+ }
113
+
114
+ .default-icon path {
115
+ fill: currentColor;
116
+ }
117
+ `;
118
+ export {
119
+ componentStyle as default
120
+ };
121
+ //# sourceMappingURL=indicator-generator.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indicator-generator.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}