@sbb-esta/lyne-elements-dev 5.0.0-next.2-dev.1777960809 → 5.0.0-next.2-dev.1777979422

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 (39) hide show
  1. package/core.css +1 -12
  2. package/custom-elements.json +482 -434
  3. package/development/optgroup-base-element-Cq8DMPk9.js +147 -0
  4. package/development/option/optgroup/optgroup-base-element.d.ts +2 -1
  5. package/development/option/optgroup/optgroup-base-element.d.ts.map +1 -1
  6. package/development/option/optgroup/optgroup-base-element.js +1 -1
  7. package/development/option/optgroup/optgroup.component.js +1 -1
  8. package/development/option/option/option-base-element.d.ts +2 -1
  9. package/development/option/option/option-base-element.d.ts.map +1 -1
  10. package/development/option/option/option-base-element.js +9 -3
  11. package/development/option/option/option.component.d.ts.map +1 -1
  12. package/development/option/option/option.component.js +1 -1
  13. package/development/option/option-hint/option-hint.component.d.ts +2 -0
  14. package/development/option/option-hint/option-hint.component.d.ts.map +1 -1
  15. package/development/option/option-hint/option-hint.component.js +1 -1
  16. package/development/option-hint.component-B4PxB3BW.js +39 -0
  17. package/development/option.component-CV6cZnJe.js +131 -0
  18. package/development/option.js +3 -3
  19. package/development/option.pure.js +3 -3
  20. package/off-brand-theme.css +1 -12
  21. package/optgroup-base-element-CrO_ydA8.js +108 -0
  22. package/option/optgroup/optgroup-base-element.js +1 -1
  23. package/option/optgroup/optgroup.component.js +1 -1
  24. package/option/option/option-base-element.js +27 -25
  25. package/option/option/option.component.js +1 -1
  26. package/option/option-hint/option-hint.component.js +1 -1
  27. package/option-hint.component-BEXndgG-.js +26 -0
  28. package/option.component-BeorlZT0.js +100 -0
  29. package/option.js +3 -3
  30. package/option.pure.js +3 -3
  31. package/package.json +2 -2
  32. package/safety-theme.css +1 -12
  33. package/standard-theme.css +1 -12
  34. package/development/optgroup-base-element-BEG1P4gK.js +0 -140
  35. package/development/option-hint.component-CcSUSwjN.js +0 -31
  36. package/development/option.component-BEbIEh5o.js +0 -132
  37. package/optgroup-base-element-C6KwbQ0N.js +0 -106
  38. package/option-hint.component-Bayihbh1.js +0 -21
  39. package/option.component-C-GGTcqF.js +0 -100
@@ -1,8 +1,8 @@
1
- import { t as SbbOptgroupBaseElement } from "./optgroup-base-element-BEG1P4gK.js";
1
+ import { t as SbbOptgroupBaseElement } from "./optgroup-base-element-Cq8DMPk9.js";
2
2
  import { SbbOptGroupElement } from "./option/optgroup/optgroup.component.js";
3
- import { t as SbbOptionHintElement } from "./option-hint.component-CcSUSwjN.js";
3
+ import { t as SbbOptionHintElement } from "./option-hint.component-B4PxB3BW.js";
4
4
  import { SbbOptionBaseElement } from "./option/option/option-base-element.js";
5
- import { t as SbbOptionElement } from "./option.component-BEbIEh5o.js";
5
+ import { t as SbbOptionElement } from "./option.component-CV6cZnJe.js";
6
6
  import "./option.pure.js";
7
7
  //#region src/elements/option.ts
8
8
  /** @entrypoint */
@@ -1,6 +1,6 @@
1
- import { t as SbbOptgroupBaseElement } from "./optgroup-base-element-BEG1P4gK.js";
1
+ import { t as SbbOptgroupBaseElement } from "./optgroup-base-element-Cq8DMPk9.js";
2
2
  import { SbbOptGroupElement } from "./option/optgroup/optgroup.component.js";
3
- import { t as SbbOptionHintElement } from "./option-hint.component-CcSUSwjN.js";
3
+ import { t as SbbOptionHintElement } from "./option-hint.component-B4PxB3BW.js";
4
4
  import { SbbOptionBaseElement } from "./option/option/option-base-element.js";
5
- import { t as SbbOptionElement } from "./option.component-BEbIEh5o.js";
5
+ import { t as SbbOptionElement } from "./option.component-CV6cZnJe.js";
6
6
  export { SbbOptGroupElement, SbbOptgroupBaseElement, SbbOptionBaseElement, SbbOptionElement, SbbOptionHintElement };
@@ -1757,6 +1757,7 @@ slot[name=error]::slotted(*) {
1757
1757
  --sbb-option-border-radius: var(--sbb-border-radius-4x);
1758
1758
  --sbb-option-icon-color: var(--sbb-color-metal);
1759
1759
  --sbb-option-icon-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));
1760
+ --sbb-option-focus-outline-offset: inherit;
1760
1761
  --sbb-option-focus-outline-color: transparent;
1761
1762
  --sbb-option-focus-outline-inset: var(--sbb-spacing-fixed-1x);
1762
1763
  --sbb-option-font-size: var(--sbb-text-font-size-s);
@@ -2595,18 +2596,6 @@ sbb-message > [slot=image] :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2595
2596
  border-radius: var(--sbb-message-image-border-radius);
2596
2597
  }
2597
2598
 
2598
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] :where(sbb-option, sbb-autocomplete-grid-option) {
2599
- --sbb-option-min-height: var(--sbb-size-element-xxs);
2600
- --sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));
2601
- --sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x);
2602
- }
2603
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-optgroup {
2604
- --sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x);
2605
- }
2606
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-option-hint {
2607
- --sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x);
2608
- }
2609
-
2610
2599
  .sbb-options-nowrap {
2611
2600
  --sbb-option-text-overflow: ellipsis;
2612
2601
  --sbb-option-overflow: hidden;
@@ -0,0 +1,108 @@
1
+ import { __esDecorate as e, __runInitializers as t } from "tslib";
2
+ import { html as n, nothing as r, unsafeCSS as i } from "lit";
3
+ import { property as a, state as o } from "lit/decorators.js";
4
+ import { SbbDisabledMixin as s, SbbElement as c, SbbPropertyWatcherController as l, forceType as u, isSafari as d } from "./core.js";
5
+ import { SbbDividerElement as f } from "./divider.pure.js";
6
+ //#region src/elements/option/optgroup/optgroup-base-element.scss?inline
7
+ var p = ":host{display:block}:host(:first-child){--sbb-optgroup-divider-display: none}:host(:is(:state(size-s),[state--size-s])){--sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x)}:host(:is(:state(size-m),[state--size-m])){--sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-2x)}:host(:is(:state(negative),[state--negative])){--sbb-optgroup-label-color: var(--sbb-color-5)}.sbb-optgroup{margin-block:var(--sbb-spacing-fixed-4x);margin-inline:var(--sbb-spacing-fixed-4x)}.sbb-optgroup__label{display:flex;column-gap:var(--sbb-spacing-responsive-xxxs);font-size:var(--sbb-optgroup-label-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);color:var(--sbb-optgroup-label-color);-webkit-text-fill-color:var(--sbb-optgroup-label-color);padding-inline:var(--sbb-optgroup-label-padding-inline);padding-block-end:var(--sbb-optgroup-label-padding-end)}.sbb-optgroup__divider{display:var(--sbb-optgroup-divider-display, block);padding-block:var(--sbb-options-panel-divider-margin-block)}.sbb-optgroup__icon-space{display:var(--sbb-option-icon-container-display, none);min-width:var(--sbb-size-icon-ui-small)}::slotted(sbb-divider){margin-block:var(--sbb-options-panel-divider-margin-block)}", m = d, h = (() => {
8
+ let d = s(c), h, g = [], _ = [], v, y = [], b = [];
9
+ return class extends d {
10
+ static {
11
+ let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(d[Symbol.metadata] ?? null) : void 0;
12
+ h = [u(), a()], v = [o()], e(this, null, h, {
13
+ kind: "accessor",
14
+ name: "label",
15
+ static: !1,
16
+ private: !1,
17
+ access: {
18
+ has: (e) => "label" in e,
19
+ get: (e) => e.label,
20
+ set: (e, t) => {
21
+ e.label = t;
22
+ }
23
+ },
24
+ metadata: t
25
+ }, g, _), e(this, null, v, {
26
+ kind: "accessor",
27
+ name: "_inertAriaGroups",
28
+ static: !1,
29
+ private: !1,
30
+ access: {
31
+ has: (e) => "_inertAriaGroups" in e,
32
+ get: (e) => e._inertAriaGroups,
33
+ set: (e, t) => {
34
+ e._inertAriaGroups = t;
35
+ }
36
+ },
37
+ metadata: t
38
+ }, y, b), t && Object.defineProperty(this, Symbol.metadata, {
39
+ enumerable: !0,
40
+ configurable: !0,
41
+ writable: !0,
42
+ value: t
43
+ });
44
+ }
45
+ static {
46
+ this.role = m ? null : "group";
47
+ }
48
+ static {
49
+ this.elementDependencies = [f];
50
+ }
51
+ static {
52
+ this.styles = [i(p)];
53
+ }
54
+ #e;
55
+ get label() {
56
+ return this.#e;
57
+ }
58
+ set label(e) {
59
+ this.#e = e;
60
+ }
61
+ #t;
62
+ get _inertAriaGroups() {
63
+ return this.#t;
64
+ }
65
+ set _inertAriaGroups(e) {
66
+ this.#t = e;
67
+ }
68
+ constructor() {
69
+ super(), this.#e = t(this, g, ""), this.#t = (t(this, _), t(this, y, !1)), this._previousSize = t(this, b), this.addController(new l(this, () => this.closest("sbb-autocomplete, sbb-autocomplete-grid, sbb-select"), { size: (e) => {
70
+ this._previousSize && this.internals.states.delete(`size-${this._previousSize}`), this._previousSize = e.size, this._previousSize && this.internals.states.add(`size-${this._previousSize}`);
71
+ } })), m && (this.hydrationRequired ? this.hydrationComplete.then(() => this._inertAriaGroups = m) : this._inertAriaGroups = m);
72
+ }
73
+ connectedCallback() {
74
+ super.connectedCallback(), this._updateAriaLabel();
75
+ }
76
+ willUpdate(e) {
77
+ super.willUpdate(e), e.has("disabled") && (this._inertAriaGroups || (this.internals.ariaDisabled = this.disabled ? "true" : null)), e.has("label") && this._updateAriaLabel();
78
+ }
79
+ _handleSlotchange() {
80
+ this._updateAriaLabel(), this._highlightOptions(), this.dispatchEvent(new Event("ɵoptgroupslotchange"));
81
+ }
82
+ _updateAriaLabel() {
83
+ this.internals.ariaLabel = this._inertAriaGroups ? null : this.label;
84
+ }
85
+ _highlightOptions() {
86
+ let e = this.getAutocompleteParent();
87
+ if (!e) return;
88
+ let t = e.triggerElement?.value;
89
+ t && this.options.forEach((e) => e.highlight(t));
90
+ }
91
+ render() {
92
+ return n`
93
+ <div class="sbb-optgroup__divider">
94
+ <sbb-divider ?negative=${this.matches?.(":is(:state(negative),[state--negative])")}></sbb-divider>
95
+ </div>
96
+ ${this.label ? n`
97
+ <div class="sbb-optgroup__label" aria-hidden="true">
98
+ <div class="sbb-optgroup__icon-space"></div>
99
+ <span>${this.label}</span>
100
+ </div>
101
+ ` : r}
102
+ <slot @slotchange=${this._handleSlotchange}></slot>
103
+ `;
104
+ }
105
+ };
106
+ })();
107
+ //#endregion
108
+ export { h as t };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../optgroup-base-element-C6KwbQ0N.js";
1
+ import { t as e } from "../../optgroup-base-element-CrO_ydA8.js";
2
2
  export { e as SbbOptgroupBaseElement };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../optgroup-base-element-C6KwbQ0N.js";
1
+ import { t as e } from "../../optgroup-base-element-CrO_ydA8.js";
2
2
  import { SbbPropertyWatcherController as t } from "../../core.js";
3
3
  //#region src/elements/option/optgroup/optgroup.component.ts
4
4
  var n = class extends e {
@@ -1,20 +1,20 @@
1
1
  import { __esDecorate as e, __runInitializers as t } from "tslib";
2
2
  import { html as n, nothing as r } from "lit";
3
3
  import { property as i, state as a } from "lit/decorators.js";
4
- import { SbbDisabledMixin as o, SbbElement as s, isAndroid as c, isBlink as l, isSafari as u, screenReaderOnlyStyles as d, setOrRemoveAttribute as f } from "../../core.js";
5
- import { SbbIconNameMixin as p } from "../../icon.pure.js";
6
- import { MutationController as m } from "@lit-labs/observers/mutation-controller.js";
4
+ import { SbbDisabledMixin as o, SbbElement as s, SbbPropertyWatcherController as c, isAndroid as l, isBlink as u, isSafari as d, screenReaderOnlyStyles as f, setOrRemoveAttribute as p } from "../../core.js";
5
+ import { SbbIconNameMixin as m } from "../../icon.pure.js";
6
+ import { MutationController as h } from "@lit-labs/observers/mutation-controller.js";
7
7
  //#region src/elements/option/option/option-base-element.ts
8
- var h = 0, g = u, _ = {
8
+ var g = 0, _ = d, v = {
9
9
  childList: !0,
10
10
  subtree: !0,
11
11
  characterData: !0
12
- }, v = (() => {
13
- let u = o(p(s)), v = [], y, b, x, S = [], C = [], w, T = [], E = [], D, O = [], k = [], A, j = [], M = [], N, P = [], F = [], I, L = [], R = [];
14
- return class extends u {
12
+ }, y = (() => {
13
+ let d = o(m(s)), y = [], b, x, S, C = [], w = [], T, E = [], D = [], O, k = [], A = [], j, M = [], N = [], P, F = [], I = [], L, R = [], z = [];
14
+ return class extends d {
15
15
  static {
16
- let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(u[Symbol.metadata] ?? null) : void 0;
17
- y = [i()], b = [i({ type: Boolean })], x = [a()], w = [a()], D = [a()], A = [a()], N = [a()], I = [a()], e(this, null, y, {
16
+ let t = typeof Symbol == "function" && Symbol.metadata ? Object.create(d[Symbol.metadata] ?? null) : void 0;
17
+ b = [i()], x = [i({ type: Boolean })], S = [a()], T = [a()], O = [a()], j = [a()], P = [a()], L = [a()], e(this, null, b, {
18
18
  kind: "setter",
19
19
  name: "value",
20
20
  static: !1,
@@ -26,7 +26,7 @@ var h = 0, g = u, _ = {
26
26
  }
27
27
  },
28
28
  metadata: t
29
- }, null, v), e(this, null, b, {
29
+ }, null, y), e(this, null, x, {
30
30
  kind: "setter",
31
31
  name: "selected",
32
32
  static: !1,
@@ -38,7 +38,7 @@ var h = 0, g = u, _ = {
38
38
  }
39
39
  },
40
40
  metadata: t
41
- }, null, v), e(this, null, x, {
41
+ }, null, y), e(this, null, S, {
42
42
  kind: "accessor",
43
43
  name: "disabledFromGroup",
44
44
  static: !1,
@@ -51,7 +51,7 @@ var h = 0, g = u, _ = {
51
51
  }
52
52
  },
53
53
  metadata: t
54
- }, S, C), e(this, null, w, {
54
+ }, C, w), e(this, null, T, {
55
55
  kind: "accessor",
56
56
  name: "groupLabel",
57
57
  static: !1,
@@ -64,7 +64,7 @@ var h = 0, g = u, _ = {
64
64
  }
65
65
  },
66
66
  metadata: t
67
- }, T, E), e(this, null, D, {
67
+ }, E, D), e(this, null, O, {
68
68
  kind: "accessor",
69
69
  name: "label",
70
70
  static: !1,
@@ -77,7 +77,7 @@ var h = 0, g = u, _ = {
77
77
  }
78
78
  },
79
79
  metadata: t
80
- }, O, k), e(this, null, A, {
80
+ }, k, A), e(this, null, j, {
81
81
  kind: "accessor",
82
82
  name: "disableLabelHighlight",
83
83
  static: !1,
@@ -90,7 +90,7 @@ var h = 0, g = u, _ = {
90
90
  }
91
91
  },
92
92
  metadata: t
93
- }, j, M), e(this, null, N, {
93
+ }, M, N), e(this, null, P, {
94
94
  kind: "accessor",
95
95
  name: "_highlightString",
96
96
  static: !1,
@@ -103,7 +103,7 @@ var h = 0, g = u, _ = {
103
103
  }
104
104
  },
105
105
  metadata: t
106
- }, P, F), e(this, null, I, {
106
+ }, F, I), e(this, null, L, {
107
107
  kind: "accessor",
108
108
  name: "_inertAriaGroups",
109
109
  static: !1,
@@ -116,7 +116,7 @@ var h = 0, g = u, _ = {
116
116
  }
117
117
  },
118
118
  metadata: t
119
- }, L, R), t && Object.defineProperty(this, Symbol.metadata, {
119
+ }, R, z), t && Object.defineProperty(this, Symbol.metadata, {
120
120
  enumerable: !0,
121
121
  configurable: !0,
122
122
  writable: !0,
@@ -127,7 +127,7 @@ var h = 0, g = u, _ = {
127
127
  this.events = { optionselected: "optionselected" };
128
128
  }
129
129
  static {
130
- this.styles = [d];
130
+ this.styles = [f];
131
131
  }
132
132
  set value(e) {
133
133
  typeof e == "string" ? (this.setAttribute("value", `${e}`), this._value = null) : this._value = e, this.dispatchEvent(new Event("ɵoptionvaluechange", { bubbles: !0 }));
@@ -184,12 +184,14 @@ var h = 0, g = u, _ = {
184
184
  this.#a = e;
185
185
  }
186
186
  constructor() {
187
- super(), this._value = (t(this, v), null), this.#e = t(this, S, !1), this.#t = (t(this, C), t(this, T, "")), this.#n = (t(this, E), t(this, O, void 0)), this.#r = (t(this, k), t(this, j, !1)), this.#i = (t(this, M), t(this, P, null)), this.#a = (t(this, F), t(this, L, !1)), t(this, R), this.addEventListener?.("click", (e) => this.selectByClick(e), { passive: !0 }), this.addController(new m(this, {
188
- config: _,
187
+ super(), this._value = (t(this, y), null), this.#e = t(this, C, !1), this.#t = (t(this, w), t(this, E, "")), this.#n = (t(this, D), t(this, k, void 0)), this.#r = (t(this, A), t(this, M, !1)), this.#i = (t(this, N), t(this, F, null)), this.#a = (t(this, I), t(this, R, !1)), this._previousSize = t(this, z), this.addEventListener?.("click", (e) => this.selectByClick(e), { passive: !0 }), this.addController(new h(this, {
188
+ config: v,
189
189
  callback: () => {
190
190
  this.handleHighlightState(), this.dispatchEvent(new Event("optionLabelChanged", { bubbles: !0 }));
191
191
  }
192
- })), g && (this.hydrationRequired ? this.hydrationComplete.then(() => this._inertAriaGroups = g) : this._inertAriaGroups = g);
192
+ })), this.addController(new c(this, () => this.closest("sbb-autocomplete, sbb-autocomplete-grid"), { negative: (e) => this.toggleState("negative", e.negative) })), this.addController(new c(this, () => this.closest("sbb-autocomplete, sbb-autocomplete-grid, sbb-select"), { size: (e) => {
193
+ this._previousSize && this.internals.states.delete(`size-${this._previousSize}`), this._previousSize = e.size, this._previousSize && this.internals.states.add(`size-${this._previousSize}`);
194
+ } })), _ && (this.hydrationRequired ? this.hydrationComplete.then(() => this._inertAriaGroups = _) : this._inertAriaGroups = _);
193
195
  }
194
196
  attributeChangedCallback(e, t, n) {
195
197
  (e !== "value" || t !== n) && super.attributeChangedCallback(e, t, n);
@@ -204,10 +206,10 @@ var h = 0, g = u, _ = {
204
206
  }));
205
207
  }
206
208
  connectedCallback() {
207
- super.connectedCallback(), this.id ||= `${this.optionId}-${h++}`;
209
+ super.connectedCallback(), this.id ||= `${this.optionId}-${g++}`;
208
210
  }
209
211
  requestUpdate(e, t, n) {
210
- super.requestUpdate(e, t, n), (e === "disabled" || e === "disabledFromGroup") && (this.toggleState("disabled", this.disabled || this.disabledFromGroup), f(this, "tabindex", c && !this.disabled && !this.disabledFromGroup ? 0 : null), this.updateAriaDisabled());
212
+ super.requestUpdate(e, t, n), (e === "disabled" || e === "disabledFromGroup") && (this.toggleState("disabled", this.disabled || this.disabledFromGroup), p(this, "tabindex", l && !this.disabled && !this.disabledFromGroup ? 0 : null), this.updateAriaDisabled());
211
213
  }
212
214
  firstUpdated(e) {
213
215
  super.firstUpdated(e), this._updateAriaSelected();
@@ -256,7 +258,7 @@ var h = 0, g = u, _ = {
256
258
  <span class="sbb-option__label">
257
259
  <slot @slotchange=${this.handleHighlightState}></slot>
258
260
  <span
259
- aria-hidden=${l ? "true" : r}
261
+ aria-hidden=${u ? "true" : r}
260
262
  >
261
263
  ${this.renderLabel()}
262
264
  </span>
@@ -269,4 +271,4 @@ var h = 0, g = u, _ = {
269
271
  };
270
272
  })();
271
273
  //#endregion
272
- export { v as SbbOptionBaseElement };
274
+ export { y as SbbOptionBaseElement };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../option.component-C-GGTcqF.js";
1
+ import { t as e } from "../../option.component-BeorlZT0.js";
2
2
  export { e as SbbOptionElement };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../option-hint.component-Bayihbh1.js";
1
+ import { t as e } from "../../option-hint.component-BEXndgG-.js";
2
2
  export { e as SbbOptionHintElement };
@@ -0,0 +1,26 @@
1
+ import { html as e, unsafeCSS as t } from "lit";
2
+ import { SbbElement as n, SbbNegativeMixin as r, SbbPropertyWatcherController as i } from "./core.js";
3
+ //#region src/elements/option/option-hint/option-hint.scss?inline
4
+ var a = ":host{display:flex;column-gap:var(--sbb-option-hint-column-gap);padding-inline:var(--sbb-option-hint-padding-inline);padding-block-end:var(--sbb-option-hint-padding-block-end);font-size:var(--sbb-option-hint-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text)}:host([negative]){--sbb-option-hint-color: var(--sbb-color-5)}:host(:is(:state(size-s),[state--size-s])){--sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x)}:host(:is(:state(size-m),[state--size-m])){--sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-2x)}.sbb-optgroup__icon-space{display:var(--sbb-option-icon-container-display, none);min-width:var(--sbb-size-icon-ui-small)}.sbb-option-hint{color:var(--sbb-option-hint-color);-webkit-text-fill-color:var(--sbb-option-hint-color);flex-grow:1}", o = class extends r(n) {
5
+ static {
6
+ this.elementName = "sbb-option-hint";
7
+ }
8
+ static {
9
+ this.styles = [t(a)];
10
+ }
11
+ constructor() {
12
+ super(), this.addController(new i(this, () => this.closest("sbb-autocomplete, sbb-autocomplete-grid, sbb-select"), { size: (e) => {
13
+ this._previousSize && this.internals.states.delete(`size-${this._previousSize}`), this._previousSize = e.size, this._previousSize && this.internals.states.add(`size-${this._previousSize}`);
14
+ } }));
15
+ }
16
+ render() {
17
+ return e`
18
+ <div class="sbb-optgroup__icon-space"></div>
19
+ <span class="sbb-option-hint">
20
+ <slot></slot>
21
+ </span>
22
+ `;
23
+ }
24
+ };
25
+ //#endregion
26
+ export { o as t };
@@ -0,0 +1,100 @@
1
+ import { SbbOptionBaseElement as e } from "./option/option/option-base-element.js";
2
+ import { html as t, nothing as n, unsafeCSS as r } from "lit";
3
+ import { SbbPropertyWatcherController as i } from "./core.js";
4
+ import { SbbVisualCheckboxElement as a } from "./visual-checkbox.pure.js";
5
+ //#region src/elements/option/option/option.scss?inline
6
+ var o = ":host{--sbb-focus-outline-offset: var(--sbb-option-focus-outline-offset);display:block;background-color:var(--sbb-option-background-color);font-size:var(--sbb-option-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text)}:host(:is(:state(negative),[state--negative])){--sbb-option-color: var(--sbb-color-3-negative);--sbb-option-icon-color: var(--sbb-color-5);--sbb-option-background-color-hover: var(--sbb-color-midnight);--sbb-option-background-color-active: var(--sbb-background-color-4-negative);--sbb-option-disabled-border-color: var(--sbb-border-color-5);--sbb-option-disabled-background-color: var(--sbb-background-color-3-negative);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark)}:host(:is(:state(size-s),[state--size-s])){--sbb-option-min-height: var(--sbb-size-element-xxs);--sbb-option-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));--sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x)}:host(:is(:state(size-m),[state--size-m])){--sbb-option-min-height: var(--sbb-size-element-s);--sbb-option-focus-outline-offset: inherit;--sbb-option-focus-outline-inset: var(--sbb-spacing-fixed-1x)}@media(any-hover:hover){:host(:hover:not(:is(:state(disabled),[state--disabled]))){--sbb-option-background-color: var(--sbb-option-background-color-hover)}}:host(:active:not(:is(:state(disabled),[state--disabled]))){--sbb-option-background-color: var(--sbb-option-background-color-active)}:host(:not(:is(:state(disable-highlight),[state--disable-highlight]))) .sbb-option__label slot{display:none}:host(:is(:state(disabled),[state--disabled])){--sbb-option-cursor: var(--sbb-cursor-default)}@media(forced-colors:active){:host(:is(:state(disabled),[state--disabled])){--sbb-option-color: GrayText}}:host(:is(:state(variant-select),[state--variant-select])){--sbb-option-column-gap: var(--sbb-spacing-fixed-2x);--sbb-option-justify-content: space-between}:host(:is(:state(variant-select),[state--variant-select]):is(:state(multiple),[state--multiple])){--sbb-option-justify-content: start}:host(:is(:state(active),[state--active])){--sbb-option-focus-outline-color: var(--sbb-focus-outline-color)}:host(:not(:is(:is(:state(disabled),[state--disabled])))) .sbb-option__label--highlight{font-weight:700}@media(forced-colors:active){:host(:not(:is(:is(:state(disabled),[state--disabled])))) .sbb-option__label--highlight{color:Highlight}}.sbb-option{position:relative;display:flex;min-height:var(--sbb-option-min-height);align-items:center;column-gap:var(--sbb-option-column-gap);padding-inline:var(--sbb-option-padding-inline);justify-content:var(--sbb-option-justify-content);color:var(--sbb-option-color);cursor:var(--sbb-option-cursor);-webkit-tap-highlight-color:transparent;-webkit-text-fill-color:var(--sbb-option-color)}.sbb-option:after{content:\"\";display:block;position:absolute;inset:var(--sbb-option-focus-outline-inset);pointer-events:none;border:var(--sbb-focus-outline-width) solid var(--sbb-option-focus-outline-color);border-radius:var(--sbb-option-border-radius)}:host(:is(:state(disabled),[state--disabled]):not(:is(:state(multiple),[state--multiple]))) .sbb-option{position:relative;z-index:0}:host(:is(:state(disabled),[state--disabled]):not(:is(:state(multiple),[state--multiple]))) .sbb-option:before{content:\"\";display:block;position:absolute;inset:.375rem;border:var(--sbb-border-width-1x) dashed var(--sbb-option-disabled-border-color);border-radius:var(--sbb-border-radius-2x);background-color:var(--sbb-option-disabled-background-color);z-index:-1}@media(forced-colors:active){:host(:is(:state(disabled),[state--disabled]):not(:is(:state(multiple),[state--multiple]))) .sbb-option:before{border-color:GrayText}}.sbb-option__icon{display:flex;min-width:var(--sbb-size-icon-ui-small);min-height:var(--sbb-size-icon-ui-small);color:var(--sbb-option-icon-color)}:host(:not(:is(:state(slotted-icon),[state--slotted-icon]),:is(:state(has-icon-name),[state--has-icon-name]))) .sbb-option__icon{display:var(--sbb-option-icon-container-display, none)}.sbb-option__label{text-overflow:var(--sbb-option-text-overflow);overflow:var(--sbb-option-overflow);white-space:var(--sbb-option-white-space, initial)}", s = class extends e {
7
+ static {
8
+ this.elementName = "sbb-option";
9
+ }
10
+ static {
11
+ this.elementDependencies = [a];
12
+ }
13
+ static {
14
+ this.role = "option";
15
+ }
16
+ static {
17
+ this.styles = [r(o)];
18
+ }
19
+ static {
20
+ this.events = {
21
+ optionselectionchange: "optionselectionchange",
22
+ optionselected: "optionselected"
23
+ };
24
+ }
25
+ set _variant(e) {
26
+ this._variantInternal && this.internals.states.delete(`variant-${this._variantInternal}`), this._variantInternal = e, this._variantInternal && this.internals.states.add(`variant-${this._variantInternal}`);
27
+ }
28
+ get _variant() {
29
+ return this._variantInternal ?? null;
30
+ }
31
+ constructor() {
32
+ super(), this.optionId = "sbb-option", this.addController(new i(this, () => this.closest("sbb-optgroup"), {
33
+ disabled: (e) => this.disabledFromGroup = e.disabled,
34
+ label: (e) => this.groupLabel = e.label
35
+ })), this.addController(new i(this, () => this.closest("sbb-select"), {
36
+ multiple: (e) => {
37
+ this.toggleState("multiple", e.multiple), this.requestUpdate();
38
+ },
39
+ negative: (e) => this._handleNegativeChange(e)
40
+ }));
41
+ }
42
+ _isMultiple() {
43
+ return !this.hydrationRequired && this.matches?.(":is(:state(multiple),[state--multiple])");
44
+ }
45
+ _handleNegativeChange(e) {
46
+ this.toggleState("negative", e.negative), this.requestUpdate();
47
+ }
48
+ connectedCallback() {
49
+ super.connectedCallback(), this.hydrationRequired ? this.hydrationComplete.then(() => this._init()) : this._init();
50
+ }
51
+ _init() {
52
+ this._setVariantByContext(), this.handleHighlightState();
53
+ }
54
+ selectByClick(e) {
55
+ if (this.disabled || this.disabledFromGroup) {
56
+ e.stopPropagation();
57
+ return;
58
+ }
59
+ this._isMultiple() ? (e.stopPropagation(), this.selectViaUserInteraction(!this.selected)) : this.selectViaUserInteraction(!0);
60
+ }
61
+ selectViaUserInteraction(e) {
62
+ super.selectViaUserInteraction(e), this.dispatchEvent(new Event("optionselectionchange", {
63
+ bubbles: !0,
64
+ composed: !0
65
+ }));
66
+ }
67
+ _setVariantByContext() {
68
+ this.closest?.("sbb-autocomplete") ? this._variant = "autocomplete" : this.closest?.("sbb-select") && (this._variant = "select");
69
+ }
70
+ handleHighlightState() {
71
+ if (this._variant !== "autocomplete") {
72
+ this.updateDisableHighlight(!0);
73
+ return;
74
+ }
75
+ super.handleHighlightState();
76
+ }
77
+ renderIcon() {
78
+ return t`
79
+ <!-- Icon -->
80
+ ${this._isMultiple() ? n : t` <span class="sbb-option__icon"> ${this.renderIconSlot()} </span>`}
81
+
82
+ <!-- Checkbox -->
83
+ ${this._isMultiple() ? t`
84
+ <sbb-visual-checkbox
85
+ ?checked=${this.selected}
86
+ ?disabled=${this.disabled || this.disabledFromGroup}
87
+ ?negative=${this.matches?.(":is(:state(negative),[state--negative])")}
88
+ ></sbb-visual-checkbox>
89
+ ` : n}
90
+ `;
91
+ }
92
+ renderLabel() {
93
+ return this._variant === "autocomplete" ? super.renderLabel() : n;
94
+ }
95
+ renderTick() {
96
+ return this._variant === "select" && !this._isMultiple() && this.selected ? t`<sbb-icon name="tick-small"></sbb-icon>` : n;
97
+ }
98
+ };
99
+ //#endregion
100
+ export { s as t };
package/option.js CHANGED
@@ -1,8 +1,8 @@
1
- import { t as e } from "./optgroup-base-element-C6KwbQ0N.js";
1
+ import { t as e } from "./optgroup-base-element-CrO_ydA8.js";
2
2
  import { SbbOptGroupElement as t } from "./option/optgroup/optgroup.component.js";
3
- import { t as n } from "./option-hint.component-Bayihbh1.js";
3
+ import { t as n } from "./option-hint.component-BEXndgG-.js";
4
4
  import { SbbOptionBaseElement as r } from "./option/option/option-base-element.js";
5
- import { t as i } from "./option.component-C-GGTcqF.js";
5
+ import { t as i } from "./option.component-BeorlZT0.js";
6
6
  import "./option.pure.js";
7
7
  t.define(), i.define(), n.define();
8
8
  //#endregion
package/option.pure.js CHANGED
@@ -1,6 +1,6 @@
1
- import { t as e } from "./optgroup-base-element-C6KwbQ0N.js";
1
+ import { t as e } from "./optgroup-base-element-CrO_ydA8.js";
2
2
  import { SbbOptGroupElement as t } from "./option/optgroup/optgroup.component.js";
3
- import { t as n } from "./option-hint.component-Bayihbh1.js";
3
+ import { t as n } from "./option-hint.component-BEXndgG-.js";
4
4
  import { SbbOptionBaseElement as r } from "./option/option/option-base-element.js";
5
- import { t as i } from "./option.component-C-GGTcqF.js";
5
+ import { t as i } from "./option.component-BeorlZT0.js";
6
6
  export { t as SbbOptGroupElement, e as SbbOptgroupBaseElement, r as SbbOptionBaseElement, i as SbbOptionElement, n as SbbOptionHintElement };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sbb-esta/lyne-elements-dev",
3
- "version": "5.0.0-next.2-dev.1777960809",
3
+ "version": "5.0.0-next.2-dev.1777979422",
4
4
  "description": "Lyne Design System",
5
5
  "keywords": [
6
6
  "design system",
7
7
  "web components",
8
8
  "lit",
9
- "https://github.com/sbb-design-systems/lyne-components/commit/d0064b39c172ba6c1e58629137781caee3d46202"
9
+ "https://github.com/sbb-design-systems/lyne-components/commit/62be7322f16f39106abf899b062d060cda2a5403"
10
10
  ],
11
11
  "type": "module",
12
12
  "exports": {
package/safety-theme.css CHANGED
@@ -1757,6 +1757,7 @@ slot[name=error]::slotted(*) {
1757
1757
  --sbb-option-border-radius: var(--sbb-border-radius-4x);
1758
1758
  --sbb-option-icon-color: var(--sbb-color-metal);
1759
1759
  --sbb-option-icon-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));
1760
+ --sbb-option-focus-outline-offset: inherit;
1760
1761
  --sbb-option-focus-outline-color: transparent;
1761
1762
  --sbb-option-focus-outline-inset: var(--sbb-spacing-fixed-1x);
1762
1763
  --sbb-option-font-size: var(--sbb-text-font-size-s);
@@ -2595,18 +2596,6 @@ sbb-message > [slot=image] :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2595
2596
  border-radius: var(--sbb-message-image-border-radius);
2596
2597
  }
2597
2598
 
2598
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] :where(sbb-option, sbb-autocomplete-grid-option) {
2599
- --sbb-option-min-height: var(--sbb-size-element-xxs);
2600
- --sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));
2601
- --sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x);
2602
- }
2603
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-optgroup {
2604
- --sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x);
2605
- }
2606
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-option-hint {
2607
- --sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x);
2608
- }
2609
-
2610
2599
  .sbb-options-nowrap {
2611
2600
  --sbb-option-text-overflow: ellipsis;
2612
2601
  --sbb-option-overflow: hidden;
@@ -1757,6 +1757,7 @@ slot[name=error]::slotted(*) {
1757
1757
  --sbb-option-border-radius: var(--sbb-border-radius-4x);
1758
1758
  --sbb-option-icon-color: var(--sbb-color-metal);
1759
1759
  --sbb-option-icon-color: light-dark(var(--sbb-color-metal), var(--sbb-color-smoke));
1760
+ --sbb-option-focus-outline-offset: inherit;
1760
1761
  --sbb-option-focus-outline-color: transparent;
1761
1762
  --sbb-option-focus-outline-inset: var(--sbb-spacing-fixed-1x);
1762
1763
  --sbb-option-font-size: var(--sbb-text-font-size-s);
@@ -2595,18 +2596,6 @@ sbb-message > [slot=image] :is(sbb-image, img):not(.sbb-figure-overlap-image) {
2595
2596
  border-radius: var(--sbb-message-image-border-radius);
2596
2597
  }
2597
2598
 
2598
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] :where(sbb-option, sbb-autocomplete-grid-option) {
2599
- --sbb-option-min-height: var(--sbb-size-element-xxs);
2600
- --sbb-focus-outline-offset: calc(-1 * var(--sbb-spacing-fixed-1x));
2601
- --sbb-option-focus-outline-inset: 0 var(--sbb-spacing-fixed-1x);
2602
- }
2603
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-optgroup {
2604
- --sbb-optgroup-label-padding-end: var(--sbb-spacing-fixed-1x);
2605
- }
2606
- :where(sbb-select, sbb-autocomplete, sbb-autocomplete-grid)[size=s] sbb-option-hint {
2607
- --sbb-option-hint-padding-block-end: var(--sbb-spacing-fixed-1x);
2608
- }
2609
-
2610
2599
  .sbb-options-nowrap {
2611
2600
  --sbb-option-text-overflow: ellipsis;
2612
2601
  --sbb-option-overflow: hidden;