@oicl/openbridge-webcomponents 2.0.0-next.70 → 2.0.0-next.71

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.
@@ -63955,6 +63955,100 @@
63955
63955
  }
63956
63956
  ]
63957
63957
  },
63958
+ {
63959
+ "kind": "javascript-module",
63960
+ "path": "src/components/textbox/textbox.ts",
63961
+ "declarations": [
63962
+ {
63963
+ "kind": "class",
63964
+ "description": "`<obc-textbox>` – A text container that renders inline text at a\nprecise, cap-height-trimmed size with configurable alignment and reservable\nwidth.\n\nUse it to present short, read-only strings – such as values, labels, or\nunits – where vertical metrics must line up exactly across rows and the\nhorizontal footprint should stay stable while the text changes (for example\na numeric value that updates frequently). Synonyms: text container, value\nbox, label box.\n\n## Features / Variants\n- **Size:** `xs`, `s`, `m` (default), `l`, `xl` – each maps to a fixed box\n height (16 / 20 / 24 / 32 / 40 px) with 4px padding above and below, giving\n cap heights of 8 / 12 / 16 / 24 / 32 px so text aligns to a predictable\n grid.\n- **Font weight:** `regular` (default), `semibold`, `bold`.\n- **Alignment:** `left`, `center`, `right` (default) – positions the text\n within the box's width when the box is wider than the content.\n- **Reserved width:** content placed in the `length` slot reserves a minimum\n width invisibly, so the box does not resize as the visible text changes.\n The box always shows all content – it never crops.\n\n## Usage Guidelines\n- Pass the longest expected string to the `length` slot (e.g. `\"888.8\"` or\n `\"Wind speed\"`) so the box reserves space and does not jump in width as the\n visible value updates.\n- This is a display primitive for static text – use an input component for\n editable values.\n\n## Slots\n| Slot | Renders when… | Purpose |\n|-----------|--------------------|------------------------------------------------------|\n| (default) | Always | The visible text content. |\n| `length` | Always (invisible) | Reserves a minimum width based on its content width. |",
63965
+ "name": "ObcTextbox",
63966
+ "slots": [
63967
+ {
63968
+ "description": "The visible text content.",
63969
+ "name": ""
63970
+ },
63971
+ {
63972
+ "description": "Reserves a minimum width based on its content width.",
63973
+ "name": "length"
63974
+ }
63975
+ ],
63976
+ "members": [
63977
+ {
63978
+ "kind": "field",
63979
+ "name": "alignment",
63980
+ "type": {
63981
+ "text": "ObcTextboxAlignment"
63982
+ },
63983
+ "attribute": "alignment"
63984
+ },
63985
+ {
63986
+ "kind": "field",
63987
+ "name": "size",
63988
+ "type": {
63989
+ "text": "ObcTextboxSize"
63990
+ },
63991
+ "attribute": "size"
63992
+ },
63993
+ {
63994
+ "kind": "field",
63995
+ "name": "fontWeight",
63996
+ "type": {
63997
+ "text": "ObcTextboxFontWeight"
63998
+ },
63999
+ "attribute": "fontWeight"
64000
+ }
64001
+ ],
64002
+ "attributes": [
64003
+ {
64004
+ "name": "alignment",
64005
+ "type": {
64006
+ "text": "ObcTextboxAlignment"
64007
+ },
64008
+ "fieldName": "alignment"
64009
+ },
64010
+ {
64011
+ "name": "size",
64012
+ "type": {
64013
+ "text": "ObcTextboxSize"
64014
+ },
64015
+ "fieldName": "size"
64016
+ },
64017
+ {
64018
+ "name": "fontWeight",
64019
+ "type": {
64020
+ "text": "ObcTextboxFontWeight"
64021
+ },
64022
+ "fieldName": "fontWeight"
64023
+ }
64024
+ ],
64025
+ "superclass": {
64026
+ "name": "LitElement",
64027
+ "package": "lit"
64028
+ },
64029
+ "tagName": "obc-textbox",
64030
+ "customElement": true
64031
+ }
64032
+ ],
64033
+ "exports": [
64034
+ {
64035
+ "kind": "js",
64036
+ "name": "ObcTextbox",
64037
+ "declaration": {
64038
+ "name": "ObcTextbox",
64039
+ "module": "src/components/textbox/textbox.ts"
64040
+ }
64041
+ },
64042
+ {
64043
+ "kind": "custom-element-definition",
64044
+ "name": "obc-textbox",
64045
+ "declaration": {
64046
+ "name": "ObcTextbox",
64047
+ "module": "src/components/textbox/textbox.ts"
64048
+ }
64049
+ }
64050
+ ]
64051
+ },
63958
64052
  {
63959
64053
  "kind": "javascript-module",
63960
64054
  "path": "src/components/title-container/title-container.ts",
@@ -0,0 +1,114 @@
1
+ import { css } from "lit";
2
+ const componentStyle = css`
3
+ * {
4
+ -webkit-tap-highlight-color: transparent;
5
+ }
6
+
7
+ :host {
8
+ display: inline-block;
9
+ line-height: 0;
10
+ }
11
+
12
+ .wrapper {
13
+ display: inline-flex;
14
+ flex-direction: column;
15
+ width: fit-content;
16
+ --height: 24px;
17
+ --padding: 4px;
18
+ font-family: var(--font-family-main);
19
+ letter-spacing: var(--global-typography-generic-l-letter-spacing);
20
+ }
21
+
22
+ /* The inner-wrapper is the box: its height (--height) is the full textbox
23
+ height, padding included. The content is sized to the cap height and
24
+ vertically centered, which leaves the padding as equal space above and
25
+ below. In engines that support text-box-trim the content box collapses to
26
+ the cap height exactly; in Firefox (no text-box-trim) the content keeps its
27
+ natural line box, so align-items:center + overflow:hidden crops it to the
28
+ same height instead. No padding here – the centering provides it.
29
+ (A small top padding could be added later to nudge the text up in Firefox.) */
30
+
31
+ .inner-wrapper {
32
+ box-sizing: border-box;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: var(--alignment-justify, flex-end);
36
+ height: var(--height);
37
+ overflow: hidden;
38
+ }
39
+
40
+ /* The spacer must share the content's exact font metrics so the width it
41
+ reserves equals the rendered content width. font-size-adjust scales the
42
+ font, so it has to match too. */
43
+
44
+ .content,
45
+ .length-spacer {
46
+ font-size: calc(var(--height) - 2 * var(--padding));
47
+ font-size-adjust: cap-height 1;
48
+ white-space: nowrap;
49
+ }
50
+
51
+ .content {
52
+ text-box-trim: trim-both;
53
+ text-box-edge: cap alphabetic;
54
+ }
55
+
56
+ .wrapper.size-xs .inner-wrapper {
57
+ --height: 16px;
58
+ }
59
+
60
+ .wrapper.size-s .inner-wrapper {
61
+ --height: 20px;
62
+ }
63
+
64
+ .wrapper.size-m .inner-wrapper {
65
+ --height: 24px;
66
+ }
67
+
68
+ .wrapper.size-l .inner-wrapper {
69
+ --height: 32px;
70
+ }
71
+
72
+ .wrapper.size-xl .inner-wrapper {
73
+ --height: 40px;
74
+ }
75
+
76
+ .wrapper.font-weight-regular {
77
+ font-weight: var(--global-typography-generic-l-font-weight-regular);
78
+ }
79
+
80
+ .wrapper.font-weight-semibold {
81
+ font-weight: var(--global-typography-generic-l-font-weight-medium);
82
+ }
83
+
84
+ .wrapper.font-weight-bold {
85
+ font-weight: var(--global-typography-generic-l-font-weight-bold);
86
+ }
87
+
88
+ .wrapper.alignment-left {
89
+ --alignment-justify: flex-start;
90
+ }
91
+
92
+ .wrapper.alignment-center {
93
+ --alignment-justify: center;
94
+ }
95
+
96
+ .wrapper.alignment-right {
97
+ --alignment-justify: flex-end;
98
+ }
99
+
100
+ /* Reserves the box width from the \`length\` slot without occupying vertical
101
+ space. Acts as a minimum width so the box does not resize as visible
102
+ text changes. */
103
+
104
+ .length-spacer {
105
+ height: 0;
106
+ opacity: 0;
107
+ visibility: hidden;
108
+ overflow: hidden;
109
+ }
110
+ `;
111
+ export {
112
+ componentStyle as default
113
+ };
114
+ //# sourceMappingURL=textbox.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textbox.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,70 @@
1
+ import { LitElement } from 'lit';
2
+ export declare enum ObcTextboxAlignment {
3
+ Left = "left",
4
+ Center = "center",
5
+ Right = "right"
6
+ }
7
+ export declare enum ObcTextboxSize {
8
+ xs = "xs",
9
+ s = "s",
10
+ m = "m",
11
+ l = "l",
12
+ xl = "xl"
13
+ }
14
+ export declare enum ObcTextboxFontWeight {
15
+ regular = "regular",
16
+ semibold = "semibold",
17
+ bold = "bold"
18
+ }
19
+ /**
20
+ * `<obc-textbox>` – A text container that renders inline text at a
21
+ * precise, cap-height-trimmed size with configurable alignment and reservable
22
+ * width.
23
+ *
24
+ * Use it to present short, read-only strings – such as values, labels, or
25
+ * units – where vertical metrics must line up exactly across rows and the
26
+ * horizontal footprint should stay stable while the text changes (for example
27
+ * a numeric value that updates frequently). Synonyms: text container, value
28
+ * box, label box.
29
+ *
30
+ * ## Features / Variants
31
+ * - **Size:** `xs`, `s`, `m` (default), `l`, `xl` – each maps to a fixed box
32
+ * height (16 / 20 / 24 / 32 / 40 px) with 4px padding above and below, giving
33
+ * cap heights of 8 / 12 / 16 / 24 / 32 px so text aligns to a predictable
34
+ * grid.
35
+ * - **Font weight:** `regular` (default), `semibold`, `bold`.
36
+ * - **Alignment:** `left`, `center`, `right` (default) – positions the text
37
+ * within the box's width when the box is wider than the content.
38
+ * - **Reserved width:** content placed in the `length` slot reserves a minimum
39
+ * width invisibly, so the box does not resize as the visible text changes.
40
+ * The box always shows all content – it never crops.
41
+ *
42
+ * ## Usage Guidelines
43
+ * - Pass the longest expected string to the `length` slot (e.g. `"888.8"` or
44
+ * `"Wind speed"`) so the box reserves space and does not jump in width as the
45
+ * visible value updates.
46
+ * - This is a display primitive for static text – use an input component for
47
+ * editable values.
48
+ *
49
+ * ## Slots
50
+ * | Slot | Renders when… | Purpose |
51
+ * |-----------|--------------------|------------------------------------------------------|
52
+ * | (default) | Always | The visible text content. |
53
+ * | `length` | Always (invisible) | Reserves a minimum width based on its content width. |
54
+ *
55
+ * @slot - The visible text content.
56
+ * @slot length - Reserves a minimum width based on its content width.
57
+ */
58
+ export declare class ObcTextbox extends LitElement {
59
+ alignment: ObcTextboxAlignment;
60
+ size: ObcTextboxSize;
61
+ fontWeight: ObcTextboxFontWeight;
62
+ render(): import('lit-html').TemplateResult<1>;
63
+ static styles: import('lit').CSSResult;
64
+ }
65
+ declare global {
66
+ interface HTMLElementTagNameMap {
67
+ 'obc-textbox': ObcTextbox;
68
+ }
69
+ }
70
+ //# sourceMappingURL=textbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textbox.d.ts","sourceRoot":"","sources":["../../../src/components/textbox/textbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAMhD,oBAAY,mBAAmB;IAC7B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AAED,oBAAY,cAAc;IACxB,EAAE,OAAO;IACT,CAAC,MAAM;IACP,CAAC,MAAM;IACP,CAAC,MAAM;IACP,EAAE,OAAO;CACV;AAED,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBACa,UAAW,SAAQ,UAAU;IACd,SAAS,EAAE,mBAAmB,CAC5B;IACF,IAAI,EAAE,cAAc,CAAoB;IACxC,UAAU,EAAE,oBAAoB,CAC3B;IAEtB,MAAM;IAsBf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -0,0 +1,84 @@
1
+ import { unsafeCSS, LitElement, html } from "lit";
2
+ import { customElement } from "../../decorator.js";
3
+ import componentStyle from "./textbox.css.js";
4
+ import { property } from "lit/decorators.js";
5
+ import { classMap } from "lit/directives/class-map.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 ObcTextboxAlignment = /* @__PURE__ */ ((ObcTextboxAlignment2) => {
17
+ ObcTextboxAlignment2["Left"] = "left";
18
+ ObcTextboxAlignment2["Center"] = "center";
19
+ ObcTextboxAlignment2["Right"] = "right";
20
+ return ObcTextboxAlignment2;
21
+ })(ObcTextboxAlignment || {});
22
+ var ObcTextboxSize = /* @__PURE__ */ ((ObcTextboxSize2) => {
23
+ ObcTextboxSize2["xs"] = "xs";
24
+ ObcTextboxSize2["s"] = "s";
25
+ ObcTextboxSize2["m"] = "m";
26
+ ObcTextboxSize2["l"] = "l";
27
+ ObcTextboxSize2["xl"] = "xl";
28
+ return ObcTextboxSize2;
29
+ })(ObcTextboxSize || {});
30
+ var ObcTextboxFontWeight = /* @__PURE__ */ ((ObcTextboxFontWeight2) => {
31
+ ObcTextboxFontWeight2["regular"] = "regular";
32
+ ObcTextboxFontWeight2["semibold"] = "semibold";
33
+ ObcTextboxFontWeight2["bold"] = "bold";
34
+ return ObcTextboxFontWeight2;
35
+ })(ObcTextboxFontWeight || {});
36
+ let ObcTextbox = class extends LitElement {
37
+ constructor() {
38
+ super(...arguments);
39
+ this.alignment = "right";
40
+ this.size = "m";
41
+ this.fontWeight = "regular";
42
+ }
43
+ render() {
44
+ return html`
45
+ <div
46
+ class=${classMap({
47
+ wrapper: true,
48
+ [`alignment-${this.alignment}`]: true,
49
+ [`size-${this.size}`]: true,
50
+ [`font-weight-${this.fontWeight}`]: true
51
+ })}
52
+ >
53
+ <div class="inner-wrapper">
54
+ <div class="content">
55
+ <slot></slot>
56
+ </div>
57
+ </div>
58
+ <div class="length-spacer" aria-hidden="true">
59
+ <slot name="length"></slot>
60
+ </div>
61
+ </div>
62
+ `;
63
+ }
64
+ };
65
+ ObcTextbox.styles = unsafeCSS(componentStyle);
66
+ __decorateClass([
67
+ property({ type: String })
68
+ ], ObcTextbox.prototype, "alignment", 2);
69
+ __decorateClass([
70
+ property({ type: String })
71
+ ], ObcTextbox.prototype, "size", 2);
72
+ __decorateClass([
73
+ property({ type: String })
74
+ ], ObcTextbox.prototype, "fontWeight", 2);
75
+ ObcTextbox = __decorateClass([
76
+ customElement("obc-textbox")
77
+ ], ObcTextbox);
78
+ export {
79
+ ObcTextbox,
80
+ ObcTextboxAlignment,
81
+ ObcTextboxFontWeight,
82
+ ObcTextboxSize
83
+ };
84
+ //# sourceMappingURL=textbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textbox.js","sources":["../../../src/components/textbox/textbox.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport componentStyle from './textbox.css?inline';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nexport enum ObcTextboxAlignment {\n Left = 'left',\n Center = 'center',\n Right = 'right',\n}\n\nexport enum ObcTextboxSize {\n xs = 'xs',\n s = 's',\n m = 'm',\n l = 'l',\n xl = 'xl',\n}\n\nexport enum ObcTextboxFontWeight {\n regular = 'regular',\n semibold = 'semibold',\n bold = 'bold',\n}\n\n/**\n * `<obc-textbox>` – A text container that renders inline text at a\n * precise, cap-height-trimmed size with configurable alignment and reservable\n * width.\n *\n * Use it to present short, read-only strings – such as values, labels, or\n * units – where vertical metrics must line up exactly across rows and the\n * horizontal footprint should stay stable while the text changes (for example\n * a numeric value that updates frequently). Synonyms: text container, value\n * box, label box.\n *\n * ## Features / Variants\n * - **Size:** `xs`, `s`, `m` (default), `l`, `xl` – each maps to a fixed box\n * height (16 / 20 / 24 / 32 / 40 px) with 4px padding above and below, giving\n * cap heights of 8 / 12 / 16 / 24 / 32 px so text aligns to a predictable\n * grid.\n * - **Font weight:** `regular` (default), `semibold`, `bold`.\n * - **Alignment:** `left`, `center`, `right` (default) – positions the text\n * within the box's width when the box is wider than the content.\n * - **Reserved width:** content placed in the `length` slot reserves a minimum\n * width invisibly, so the box does not resize as the visible text changes.\n * The box always shows all content – it never crops.\n *\n * ## Usage Guidelines\n * - Pass the longest expected string to the `length` slot (e.g. `\"888.8\"` or\n * `\"Wind speed\"`) so the box reserves space and does not jump in width as the\n * visible value updates.\n * - This is a display primitive for static text – use an input component for\n * editable values.\n *\n * ## Slots\n * | Slot | Renders when… | Purpose |\n * |-----------|--------------------|------------------------------------------------------|\n * | (default) | Always | The visible text content. |\n * | `length` | Always (invisible) | Reserves a minimum width based on its content width. |\n *\n * @slot - The visible text content.\n * @slot length - Reserves a minimum width based on its content width.\n */\n@customElement('obc-textbox')\nexport class ObcTextbox extends LitElement {\n @property({type: String}) alignment: ObcTextboxAlignment =\n ObcTextboxAlignment.Right;\n @property({type: String}) size: ObcTextboxSize = ObcTextboxSize.m;\n @property({type: String}) fontWeight: ObcTextboxFontWeight =\n ObcTextboxFontWeight.regular;\n\n override render() {\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`alignment-${this.alignment}`]: true,\n [`size-${this.size}`]: true,\n [`font-weight-${this.fontWeight}`]: true,\n })}\n >\n <div class=\"inner-wrapper\">\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"length-spacer\" aria-hidden=\"true\">\n <slot name=\"length\"></slot>\n </div>\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-textbox': ObcTextbox;\n }\n}\n"],"names":["ObcTextboxAlignment","ObcTextboxSize","ObcTextboxFontWeight"],"mappings":";;;;;;;;;;;;;;;AAMO,IAAK,wCAAAA,yBAAL;AACLA,uBAAA,MAAA,IAAO;AACPA,uBAAA,QAAA,IAAS;AACTA,uBAAA,OAAA,IAAQ;AAHE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAML,IAAK,mCAAAC,oBAAL;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,GAAA,IAAI;AACJA,kBAAA,GAAA,IAAI;AACJA,kBAAA,GAAA,IAAI;AACJA,kBAAA,IAAA,IAAK;AALK,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAQL,IAAK,yCAAAC,0BAAL;AACLA,wBAAA,SAAA,IAAU;AACVA,wBAAA,UAAA,IAAW;AACXA,wBAAA,MAAA,IAAO;AAHG,SAAAA;AAAA,GAAA,wBAAA,CAAA,CAAA;AA8CL,IAAM,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,YACxB;AACwB,SAAA,OAAuB;AACvB,SAAA,aACxB;AAAA,EAAA;AAAA,EAEO,SAAS;AAChB,WAAO;AAAA;AAAA,gBAEK,SAAS;AAAA,MACf,SAAS;AAAA,MACT,CAAC,aAAa,KAAK,SAAS,EAAE,GAAG;AAAA,MACjC,CAAC,QAAQ,KAAK,IAAI,EAAE,GAAG;AAAA,MACvB,CAAC,eAAe,KAAK,UAAU,EAAE,GAAG;AAAA,IAAA,CACrC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYR;AAGF;AA9Ba,WA6BK,SAAS,UAAU,cAAc;AA5BvB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GADb,WACe,WAAA,aAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,WAGe,WAAA,QAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAJb,WAIe,WAAA,cAAA,CAAA;AAJf,aAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,UAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oicl/openbridge-webcomponents",
3
- "version": "2.0.0-next.70",
3
+ "version": "2.0.0-next.71",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",