@sbb-esta/lyne-elements 1.7.0 → 1.9.0

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 (119) hide show
  1. package/calendar/calendar.d.ts +5 -2
  2. package/calendar/calendar.d.ts.map +1 -1
  3. package/calendar.js +73 -66
  4. package/clock.js +5 -5
  5. package/container/container.js +18 -18
  6. package/core/base-elements/open-close-base-element.d.ts +10 -0
  7. package/core/base-elements/open-close-base-element.d.ts.map +1 -1
  8. package/core/base-elements.js +4 -0
  9. package/core/controllers/inert-controller.d.ts +18 -0
  10. package/core/controllers/inert-controller.d.ts.map +1 -0
  11. package/core/controllers.d.ts +1 -0
  12. package/core/controllers.d.ts.map +1 -1
  13. package/core/controllers.js +67 -23
  14. package/core/dom/platform.d.ts +2 -3
  15. package/core/dom/platform.d.ts.map +1 -1
  16. package/core/dom.js +38 -40
  17. package/core/overlay/overlay.d.ts +0 -13
  18. package/core/overlay/overlay.d.ts.map +1 -1
  19. package/core/overlay.js +36 -86
  20. package/core/styles/core.scss +6 -0
  21. package/core/styles/mixins/lists.scss +11 -1
  22. package/core/testing/wait-for-image-ready.d.ts.map +1 -1
  23. package/core/testing.js +61 -54
  24. package/core.css +5 -0
  25. package/custom-elements.json +492 -66
  26. package/datepicker/datepicker-toggle/datepicker-toggle.d.ts +4 -0
  27. package/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
  28. package/datepicker/datepicker-toggle.js +52 -42
  29. package/development/calendar/calendar.d.ts +5 -2
  30. package/development/calendar/calendar.d.ts.map +1 -1
  31. package/development/calendar.js +35 -19
  32. package/development/clock.js +1 -1
  33. package/development/container/container.js +9 -5
  34. package/development/core/base-elements/open-close-base-element.d.ts +10 -0
  35. package/development/core/base-elements/open-close-base-element.d.ts.map +1 -1
  36. package/development/core/base-elements.js +5 -1
  37. package/development/core/controllers/inert-controller.d.ts +18 -0
  38. package/development/core/controllers/inert-controller.d.ts.map +1 -0
  39. package/development/core/controllers.d.ts +1 -0
  40. package/development/core/controllers.d.ts.map +1 -1
  41. package/development/core/controllers.js +90 -1
  42. package/development/core/dom/platform.d.ts +2 -3
  43. package/development/core/dom/platform.d.ts.map +1 -1
  44. package/development/core/dom.js +4 -5
  45. package/development/core/overlay/overlay.d.ts +0 -13
  46. package/development/core/overlay/overlay.d.ts.map +1 -1
  47. package/development/core/overlay.js +1 -87
  48. package/development/core/testing/wait-for-image-ready.d.ts.map +1 -1
  49. package/development/core/testing.js +16 -2
  50. package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts +4 -0
  51. package/development/datepicker/datepicker-toggle/datepicker-toggle.d.ts.map +1 -1
  52. package/development/datepicker/datepicker-toggle.js +19 -4
  53. package/development/dialog/dialog/dialog.d.ts.map +1 -1
  54. package/development/dialog/dialog.js +3 -4
  55. package/development/flip-card/flip-card/flip-card.d.ts.map +1 -1
  56. package/development/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
  57. package/development/flip-card/flip-card-details.js +28 -9
  58. package/development/flip-card/flip-card-summary.js +6 -1
  59. package/development/flip-card/flip-card.js +43 -12
  60. package/development/form-field/form-field.js +4 -2
  61. package/development/lead-container.js +5 -1
  62. package/development/menu/menu/menu.d.ts +1 -0
  63. package/development/menu/menu/menu.d.ts.map +1 -1
  64. package/development/menu/menu.js +6 -9
  65. package/development/navigation/navigation/navigation.d.ts +1 -0
  66. package/development/navigation/navigation/navigation.d.ts.map +1 -1
  67. package/development/navigation/navigation.js +6 -9
  68. package/development/overlay/overlay-base-element.d.ts +2 -1
  69. package/development/overlay/overlay-base-element.d.ts.map +1 -1
  70. package/development/overlay/overlay.d.ts.map +1 -1
  71. package/development/overlay.js +6 -17
  72. package/development/popover/popover.js +2 -2
  73. package/development/select/select.d.ts +3 -1
  74. package/development/select/select.d.ts.map +1 -1
  75. package/development/select.js +20 -6
  76. package/development/stepper/step-label.js +20 -2
  77. package/development/stepper/stepper/stepper.d.ts +3 -0
  78. package/development/stepper/stepper/stepper.d.ts.map +1 -1
  79. package/development/stepper/stepper.js +16 -1
  80. package/development/toggle/toggle/toggle.d.ts +2 -1
  81. package/development/toggle/toggle/toggle.d.ts.map +1 -1
  82. package/development/toggle/toggle-option/toggle-option.d.ts.map +1 -1
  83. package/development/toggle/toggle-option.js +4 -2
  84. package/development/toggle/toggle.js +7 -7
  85. package/dialog/dialog/dialog.d.ts.map +1 -1
  86. package/dialog/dialog.js +11 -12
  87. package/flip-card/flip-card/flip-card.d.ts.map +1 -1
  88. package/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
  89. package/flip-card/flip-card-details.js +19 -17
  90. package/flip-card/flip-card-summary.js +13 -13
  91. package/flip-card/flip-card.js +26 -24
  92. package/form-field/form-field.js +1 -1
  93. package/lead-container.js +1 -1
  94. package/lists.css +9 -1
  95. package/menu/menu/menu.d.ts +1 -0
  96. package/menu/menu/menu.d.ts.map +1 -1
  97. package/menu/menu.js +30 -30
  98. package/navigation/navigation/navigation.d.ts +1 -0
  99. package/navigation/navigation/navigation.d.ts.map +1 -1
  100. package/navigation/navigation.js +37 -37
  101. package/overlay/overlay-base-element.d.ts +2 -1
  102. package/overlay/overlay-base-element.d.ts.map +1 -1
  103. package/overlay/overlay.d.ts.map +1 -1
  104. package/overlay.js +44 -45
  105. package/package.json +1 -1
  106. package/popover/popover.js +1 -1
  107. package/select/select.d.ts +3 -1
  108. package/select/select.d.ts.map +1 -1
  109. package/select.js +61 -50
  110. package/standard-theme.css +14 -1
  111. package/stepper/step-label.js +10 -10
  112. package/stepper/stepper/stepper.d.ts +3 -0
  113. package/stepper/stepper/stepper.d.ts.map +1 -1
  114. package/stepper/stepper.js +34 -25
  115. package/toggle/toggle/toggle.d.ts +2 -1
  116. package/toggle/toggle/toggle.d.ts.map +1 -1
  117. package/toggle/toggle-option/toggle-option.d.ts.map +1 -1
  118. package/toggle/toggle-option.js +9 -8
  119. package/toggle/toggle.js +20 -21
@@ -1 +1 @@
1
- {"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
1
+ {"version":3,"file":"controllers.d.ts","sourceRoot":"","sources":["../../../src/elements/core/controllers.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,wCAAwC,CAAC"}
@@ -1,7 +1,7 @@
1
- import { isServer as d } from "lit";
1
+ import { isServer as c } from "lit";
2
2
  import { readConfig as u } from "./config.js";
3
3
  import { AgnosticMutationObserver as _ } from "./observers.js";
4
- class b {
4
+ class C {
5
5
  constructor(t) {
6
6
  this._host = t, this._abortController = new AbortController(), this._host.addController(this);
7
7
  }
@@ -17,14 +17,57 @@ class b {
17
17
  (t = this._abortController) == null || t.abort(), this._abortController = void 0;
18
18
  }
19
19
  }
20
+ const b = ["script", "head", "template", "style"], f = /* @__PURE__ */ new Set(), g = /* @__PURE__ */ new Set();
21
+ class E {
22
+ constructor(t, i = f, r = g) {
23
+ var s, o;
24
+ this._host = t, this._inertElements = i, this._inertOverlays = r, (o = (s = this._host).addController) == null || o.call(s, this);
25
+ }
26
+ hostConnected() {
27
+ this._host.isOpen && this.activate();
28
+ }
29
+ hostDisconnected() {
30
+ this._inertOverlays.has(this._host) && this.deactivate();
31
+ }
32
+ /** Applies inert state to every other element on the page except the overlay. */
33
+ activate() {
34
+ this._inertOverlays.size && this._removeInertAttributes(), this._inertOverlays.add(this._host), this._addInertAttributes();
35
+ }
36
+ /** Removes inert state. */
37
+ deactivate() {
38
+ if (this._currentOverlay() !== this._host) {
39
+ this._inertOverlays.has(this._host) && this._inertOverlays.delete(this._host);
40
+ return;
41
+ }
42
+ this._removeInertAttributes(), this._inertOverlays.delete(this._host), this._inertOverlays.size && this._addInertAttributes();
43
+ }
44
+ _currentOverlay() {
45
+ return [...this._inertOverlays].pop() ?? null;
46
+ }
47
+ _removeInertAttributes() {
48
+ this._inertElements.forEach((t) => {
49
+ t && (t.hasAttribute("data-sbb-inert") && (t.inert = !1, t.removeAttribute("data-sbb-inert")), t.hasAttribute("data-sbb-aria-hidden") && (t.removeAttribute("aria-hidden"), t.removeAttribute("data-sbb-aria-hidden")));
50
+ }), this._inertElements.clear();
51
+ }
52
+ _addInertAttributes() {
53
+ var i, r;
54
+ let t = this._currentOverlay();
55
+ for (; t !== document.documentElement && t !== null; )
56
+ Array.from(((i = (t == null ? void 0 : t.parentElement) ?? (t == null ? void 0 : t.getRootNode())) == null ? void 0 : i.childNodes) ?? []).filter(
57
+ (s) => s !== t && s instanceof window.HTMLElement && !b.includes(s.localName)
58
+ ).forEach((s) => {
59
+ this._inertElements.add(s), s.inert || (s.inert = !0, s.toggleAttribute("data-sbb-inert", !0)), s.hasAttribute("aria-hidden") || (s.setAttribute("aria-hidden", "true"), s.toggleAttribute("data-sbb-aria-hidden", !0));
60
+ }), t = (t == null ? void 0 : t.parentElement) ?? ((r = t == null ? void 0 : t.getRootNode()) == null ? void 0 : r.host) ?? null;
61
+ }
62
+ }
20
63
  const e = class e {
21
64
  constructor(t) {
22
65
  this._host = t, this._handlers = [], this._host.addController(this);
23
66
  }
24
67
  /** Get the current language. */
25
68
  static get current() {
26
- const s = ((u().language ?? (d ? e._defaultLanguage : document.documentElement.getAttribute("lang"))) || e._defaultLanguage).split("-")[0];
27
- return e._supportedLocales.includes(s) ? s : e._defaultLanguage;
69
+ const i = ((u().language ?? (c ? e._defaultLanguage : document.documentElement.getAttribute("lang"))) || e._defaultLanguage).split("-")[0];
70
+ return e._supportedLocales.includes(i) ? i : e._defaultLanguage;
28
71
  }
29
72
  /** Get the current language. */
30
73
  get current() {
@@ -44,20 +87,20 @@ const e = class e {
44
87
  this._previousLanguage = this.current, e._listeners.delete(this), e._listeners.size || e._observer.disconnect();
45
88
  }
46
89
  _callHandlers(t = !0) {
47
- this._handlers.forEach((s) => s()), t && this._host.requestUpdate();
90
+ this._handlers.forEach((i) => i()), t && this._host.requestUpdate();
48
91
  }
49
92
  };
50
93
  e._defaultLanguage = "en", e._supportedLocales = ["en", "de", "fr", "it"], e._listeners = /* @__PURE__ */ new Set(), e._observer = new _((t) => {
51
- t[0].oldValue !== document.documentElement.getAttribute("lang") && e._listeners.forEach((s) => s._callHandlers());
94
+ t[0].oldValue !== document.documentElement.getAttribute("lang") && e._listeners.forEach((i) => i._callHandlers());
52
95
  }), e._observerConfig = {
53
96
  attributeFilter: ["lang"],
54
97
  attributeOldValue: !0
55
98
  };
56
- let h = e;
57
- class C {
58
- constructor(t, s = null) {
59
- this._host = t, this._onChangeCallback = s, this.slots = /* @__PURE__ */ new Set(), this._slotchangeHandler = (o) => {
60
- this._syncSlots(o.target);
99
+ let d = e;
100
+ class p {
101
+ constructor(t, i = null) {
102
+ this._host = t, this._onChangeCallback = i, this.slots = /* @__PURE__ */ new Set(), this._slotchangeHandler = (r) => {
103
+ this._syncSlots(r.target);
61
104
  }, this._host.addController(this);
62
105
  }
63
106
  hostConnected() {
@@ -69,20 +112,21 @@ class C {
69
112
  (t = this._host.shadowRoot) == null || t.removeEventListener("slotchange", this._slotchangeHandler);
70
113
  }
71
114
  _syncSlots(...t) {
72
- var n;
73
- for (const r of t) {
74
- const i = r.name || "unnamed";
75
- r.assignedNodes().some((l) => {
76
- var a;
77
- return "tagName" in l || ((a = l.textContent) == null ? void 0 : a.trim());
78
- }) ? this.slots.add(i) : this.slots.delete(i);
115
+ var s;
116
+ for (const o of t) {
117
+ const a = o.name || "unnamed";
118
+ o.assignedNodes().some((h) => {
119
+ var l;
120
+ return "tagName" in h || ((l = h.textContent) == null ? void 0 : l.trim());
121
+ }) ? this.slots.add(a) : this.slots.delete(a);
79
122
  }
80
- const s = this._host.getAttribute("data-slot-names"), o = [...this.slots].sort().join(" ");
81
- o ? this._host.getAttribute("data-slot-names") !== o && this._host.setAttribute("data-slot-names", o) : this._host.removeAttribute("data-slot-names"), o !== s && ((n = this._onChangeCallback) == null || n.call(this));
123
+ const i = this._host.getAttribute("data-slot-names"), r = [...this.slots].sort().join(" ");
124
+ r ? this._host.getAttribute("data-slot-names") !== r && this._host.setAttribute("data-slot-names", r) : this._host.removeAttribute("data-slot-names"), r !== i && ((s = this._onChangeCallback) == null || s.call(this));
82
125
  }
83
126
  }
84
127
  export {
85
- b as SbbConnectedAbortController,
86
- h as SbbLanguageController,
87
- C as SbbSlotStateController
128
+ C as SbbConnectedAbortController,
129
+ E as SbbInertController,
130
+ d as SbbLanguageController,
131
+ p as SbbSlotStateController
88
132
  };
@@ -15,10 +15,9 @@ export declare const isAndroid: boolean;
15
15
  /** Whether the current browser is Safari. */
16
16
  export declare const isSafari: boolean;
17
17
  /**
18
- * Note: `userAgentData` is still experimental. If possible, avoid to use it.
19
- * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData
18
+ * We just check for the blink engine.
20
19
  */
21
- export declare const isChromium: any;
20
+ export declare const isChromium: boolean;
22
21
  /** Whether the application is being rendered in a Next.js environment. */
23
22
  export declare const isNextjs: () => boolean;
24
23
  //# sourceMappingURL=platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/platform.ts"],"names":[],"mappings":"AAmBA,qDAAqD;AACrD,eAAO,MAAM,MAAM,SAAmD,CAAC;AAEvE,iEAAiE;AACjE,eAAO,MAAM,SAAS,SAA2D,CAAC;AAGlF,qDAAqD;AACrD,eAAO,MAAM,OAAO,SAKR,CAAC;AAIb,sDAAsD;AACtD,eAAO,MAAM,QAAQ,SACuE,CAAC;AAE7F,iDAAiD;AACjD,eAAO,MAAM,KAAK,SACoE,CAAC;AAMvF,8CAA8C;AAC9C,eAAO,MAAM,SAAS,SAAgE,CAAC;AAEvF,+CAA+C;AAE/C,eAAO,MAAM,SAAS,SAAkE,CAAC;AAKzF,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,SAA+D,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,UAAU,KAEkE,CAAC;AAE1F,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,QAAO,OAAmD,CAAC"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/dom/platform.ts"],"names":[],"mappings":"AAmBA,qDAAqD;AACrD,eAAO,MAAM,MAAM,SAAmD,CAAC;AAEvE,iEAAiE;AACjE,eAAO,MAAM,SAAS,SAA2D,CAAC;AAGlF,qDAAqD;AACrD,eAAO,MAAM,OAAO,SAKR,CAAC;AAIb,sDAAsD;AACtD,eAAO,MAAM,QAAQ,SACuE,CAAC;AAE7F,iDAAiD;AACjD,eAAO,MAAM,KAAK,SACoE,CAAC;AAMvF,8CAA8C;AAC9C,eAAO,MAAM,SAAS,SAAgE,CAAC;AAEvF,+CAA+C;AAE/C,eAAO,MAAM,SAAS,SAAkE,CAAC;AAKzF,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,SAA+D,CAAC;AAErF;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,CAAC;AAElC,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,QAAO,OAAmD,CAAC"}
package/core/dom.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import { isServer as e } from "lit";
2
- const E = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
3
- function S(t, n, o) {
2
+ const v = ["zero", "micro", "small", "medium", "wide", "large", "ultra"];
3
+ function E(t, n, o) {
4
4
  if (e)
5
5
  return !1;
6
- const i = getComputedStyle(document.documentElement), r = t ? i.getPropertyValue(`--sbb-breakpoint-${t}-min`) : "", s = n ? `${parseFloat(
6
+ const i = getComputedStyle(document.documentElement), s = t ? i.getPropertyValue(`--sbb-breakpoint-${t}-min`) : "", r = n ? `${parseFloat(
7
7
  i.getPropertyValue(
8
8
  `--sbb-breakpoint-${n}-${o != null && o.includeMaxBreakpoint ? "max" : "min"}`
9
9
  )
10
- ) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", f = r && `(min-width: ${r})`, g = s && `(max-width: ${s})`, y = r && s && " and ";
11
- return window.matchMedia(`${f}${y}${g}`).matches;
10
+ ) - (o != null && o.includeMaxBreakpoint ? 0 : 0.0625)}rem` : "", m = s && `(min-width: ${s})`, f = r && `(max-width: ${r})`, y = s && r && " and ";
11
+ return window.matchMedia(`${m}${y}${f}`).matches;
12
12
  }
13
- function h(t) {
13
+ function g(t) {
14
14
  return e ? null : typeof t == "string" ? document.getElementById(t) : t instanceof window.Element ? t : null;
15
15
  }
16
- const p = () => !e && document.documentElement.getAttribute("dir") || "ltr";
17
- function x(t, n) {
16
+ const A = () => !e && document.documentElement.getAttribute("dir") || "ltr";
17
+ function S(t, n) {
18
18
  if (e)
19
19
  return null;
20
20
  for (n = n.parentElement ?? n.getRootNode().host; n && n !== document && n !== window; ) {
@@ -25,16 +25,16 @@ function x(t, n) {
25
25
  }
26
26
  return null;
27
27
  }
28
- const k = "a,button,sbb-teaser-hero,sbb-teaser";
29
- function I(t, n) {
28
+ const p = "a,button,sbb-teaser-hero,sbb-teaser";
29
+ function x(t, n) {
30
30
  var o;
31
31
  if (!n) {
32
32
  const i = (o = t.closest) == null ? void 0 : o.call(t, "sbb-form-field");
33
33
  return i == null ? void 0 : i.querySelector("input");
34
34
  }
35
- return h(n);
35
+ return g(n);
36
36
  }
37
- function $(t, n, o) {
37
+ function k(t, n, o) {
38
38
  o ? t.setAttribute(n, o) : t.removeAttribute(n);
39
39
  }
40
40
  let a;
@@ -43,26 +43,24 @@ try {
43
43
  } catch {
44
44
  a = !1;
45
45
  }
46
- const m = !e && /(edge)/i.test(navigator.userAgent), c = !e && /(msie|trident)/i.test(navigator.userAgent), w = !e && !!(window.chrome || a) && typeof CSS < "u" && !m && !c, v = !e && /AppleWebKit/i.test(navigator.userAgent) && !w && !m && !c, M = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), _ = !e && /(firefox|minefield)/i.test(navigator.userAgent), W = !e && /android/i.test(navigator.userAgent) && !c, B = !e && /safari/i.test(navigator.userAgent) && v;
47
- var l, b;
48
- const C = !e && ((b = (l = navigator.userAgentData) == null ? void 0 : l.brands) == null ? void 0 : b.some((t) => t.brand == "Chromium")), N = () => !!globalThis.next;
49
- function u() {
46
+ const u = !e && /(edge)/i.test(navigator.userAgent), c = !e && /(msie|trident)/i.test(navigator.userAgent), b = !e && !!(window.chrome || a) && typeof CSS < "u" && !u && !c, h = !e && /AppleWebKit/i.test(navigator.userAgent) && !b && !u && !c, I = !e && /iPad|iPhone|iPod/.test(navigator.userAgent) && !("MSStream" in window), $ = !e && /(firefox|minefield)/i.test(navigator.userAgent), M = !e && /android/i.test(navigator.userAgent) && !c, _ = !e && /safari/i.test(navigator.userAgent) && h, W = b, B = () => !!globalThis.next;
47
+ function l() {
50
48
  return document.body.hasAttribute("data-sbb-scroll-disabled");
51
49
  }
52
- class P {
50
+ class N {
53
51
  disableScroll() {
54
- if (u())
52
+ if (l())
55
53
  return;
56
54
  this._position = document.body.style.position, this._overflow = document.body.style.overflow, this._marginInlineEnd = document.body.style.marginInlineEnd;
57
55
  const n = window.innerWidth - document.documentElement.clientWidth;
58
56
  document.body.style.overflow = "hidden", document.body.style.position = "relative", document.body.style.marginInlineEnd = `${n}px`, document.body.style.setProperty("--sbb-scrollbar-width", `${n}px`), document.body.toggleAttribute("data-sbb-scroll-disabled", !0);
59
57
  }
60
58
  enableScroll() {
61
- u() && (document.body.style.position = this._position || "", document.body.style.overflow = this._overflow || "", document.body.style.marginInlineEnd = this._marginInlineEnd || "", document.body.style.setProperty("--sbb-scrollbar-width", "0"), document.body.removeAttribute("data-sbb-scroll-disabled"));
59
+ l() && (document.body.style.position = this._position || "", document.body.style.overflow = this._overflow || "", document.body.style.marginInlineEnd = this._marginInlineEnd || "", document.body.style.setProperty("--sbb-scrollbar-width", "0"), document.body.removeAttribute("data-sbb-scroll-disabled"));
62
60
  }
63
61
  }
64
62
  const d = /* @__PURE__ */ new Map();
65
- function R(t) {
63
+ function P(t) {
66
64
  if (d.has(t.constructor))
67
65
  return d.get(t.constructor);
68
66
  const n = (
@@ -75,25 +73,25 @@ function R(t) {
75
73
  throw new Error(`Given element ${t.constructor.name} has not been registered yet.`);
76
74
  }
77
75
  export {
78
- k as ACTION_ELEMENTS,
79
- P as SbbScrollHandler,
80
- E as breakpoints,
81
- I as findInput,
82
- h as findReferencedElement,
83
- p as getDocumentWritingMode,
84
- R as getLocalName,
85
- x as hostContext,
86
- W as isAndroid,
87
- w as isBlink,
88
- S as isBreakpoint,
89
- C as isChromium,
90
- m as isEdge,
91
- _ as isFirefox,
92
- M as isIOS,
93
- N as isNextjs,
94
- B as isSafari,
76
+ p as ACTION_ELEMENTS,
77
+ N as SbbScrollHandler,
78
+ v as breakpoints,
79
+ x as findInput,
80
+ g as findReferencedElement,
81
+ A as getDocumentWritingMode,
82
+ P as getLocalName,
83
+ S as hostContext,
84
+ M as isAndroid,
85
+ b as isBlink,
86
+ E as isBreakpoint,
87
+ W as isChromium,
88
+ u as isEdge,
89
+ $ as isFirefox,
90
+ I as isIOS,
91
+ B as isNextjs,
92
+ _ as isSafari,
95
93
  c as isTrident,
96
- v as isWebkit,
97
- u as pageScrollDisabled,
98
- $ as setOrRemoveAttribute
94
+ h as isWebkit,
95
+ l as pageScrollDisabled,
96
+ k as setOrRemoveAttribute
99
97
  };
@@ -4,17 +4,4 @@ import { TemplateResult } from 'lit';
4
4
  * Works in conjunction with the 'overlayGapFixCorners()' function in 'overlay.ts'
5
5
  */
6
6
  export declare function overlayGapFixCorners(): TemplateResult;
7
- /**
8
- * Applies inert to every other element on the page except the overlay.
9
- */
10
- export declare function applyInertMechanism(overlay: HTMLElement): void;
11
- export declare function removeInertMechanism(): void;
12
- declare global {
13
- interface GlobalEventHandlersEventMap {
14
- willOpen: CustomEvent<void>;
15
- willClose: CustomEvent<void>;
16
- didOpen: CustomEvent<void>;
17
- didClose: CustomEvent<void>;
18
- }
19
- }
20
7
  //# sourceMappingURL=overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAK1C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CASrD;AA4DD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAyB9D;AAED,wBAAgB,oBAAoB,IAAI,IAAI,CAqB3C;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,2BAA2B;QACnC,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAC5B,SAAS,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;QAC3B,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/overlay/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CASrD"}
package/core/overlay.js CHANGED
@@ -1,7 +1,6 @@
1
- import { html as E } from "lit";
2
- const x = ":is(sbb-dialog, sbb-navigation, sbb-menu, sbb-overlay)[data-state='opened']";
3
- function $() {
4
- return E`
1
+ import { html as H } from "lit";
2
+ function O() {
3
+ return H`
5
4
  <div class="sbb-gap-fix-wrapper">
6
5
  <div class="sbb-gap-fix-corner" id="left"></div>
7
6
  </div>
@@ -10,54 +9,7 @@ function $() {
10
9
  </div>
11
10
  `;
12
11
  }
13
- const O = (t, e) => {
14
- let n = t.parentElement;
15
- const i = [];
16
- for (; n && (i.push(n), n !== e); )
17
- n = n.parentElement;
18
- return i;
19
- }, w = (t) => {
20
- t.setAttribute(
21
- "data-sbb-inert",
22
- `${+(t.getAttribute("data-sbb-inert") ?? void 0) + 1 || 0}`
23
- );
24
- }, W = (t) => {
25
- t.inert || (t.inert = !0, t.matches(x) ? w(t) : t.toggleAttribute("data-sbb-inert", !0)), t.hasAttribute("aria-hidden") || (t.setAttribute("aria-hidden", "true"), t.toggleAttribute("data-sbb-aria-hidden", !0));
26
- }, y = (t) => {
27
- t.hasAttribute("data-sbb-inert") && (t.inert = !1, t.removeAttribute("data-sbb-inert")), t.hasAttribute("data-sbb-aria-hidden") && (t.removeAttribute("aria-hidden"), t.removeAttribute("data-sbb-aria-hidden"));
28
- };
29
- function C(t) {
30
- y(t);
31
- const e = t.closest("body > *");
32
- Array.from(document.querySelectorAll("body > *")).filter(
33
- (o) => o !== e
34
- ).forEach((o) => W(o));
35
- let i = [];
36
- const a = O(t, e);
37
- for (const o of a)
38
- i = i.concat(
39
- Array.from(o.children).filter(
40
- (c) => c !== t && !a.includes(c)
41
- )
42
- ), o.matches(x) && w(o);
43
- i.forEach((o) => W(o));
44
- }
45
- function z() {
46
- const t = Array.from(
47
- document.documentElement.querySelectorAll(x)
48
- );
49
- if (t.length) {
50
- t.forEach((e) => {
51
- const n = +e.getAttribute("data-sbb-inert") - 1;
52
- e.setAttribute("data-sbb-inert", `${n}`), n && n < 0 && (y(e), Array.from(e.children).forEach((i) => y(i)));
53
- });
54
- return;
55
- }
56
- Array.from(document.documentElement.querySelectorAll("[data-sbb-inert]")).forEach(
57
- (e) => y(e)
58
- );
59
- }
60
- function S(t) {
12
+ function W(t) {
61
13
  const e = window.getComputedStyle(t), n = e.display, i = parseInt(e.maxHeight, 10).toString();
62
14
  if (n !== "none" && i !== "0")
63
15
  return {
@@ -69,58 +21,56 @@ function S(t) {
69
21
  offsetWidth: t.offsetWidth
70
22
  };
71
23
  t.style.position = "absolute", t.style.visibility = "hidden", t.style.display = "block";
72
- const a = t.scrollHeight, o = t.clientHeight, c = t.offsetHeight, u = t.scrollWidth, r = t.clientWidth, s = t.offsetWidth;
73
- return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight: a, clientHeight: o, offsetHeight: c, scrollWidth: u, clientWidth: r, offsetWidth: s };
24
+ const l = t.scrollHeight, o = t.clientHeight, r = t.offsetHeight, b = t.scrollWidth, a = t.clientWidth, s = t.offsetWidth;
25
+ return t.style.display = "", t.style.position = "", t.style.visibility = "", { scrollHeight: l, clientHeight: o, offsetHeight: r, scrollWidth: b, clientWidth: a, offsetWidth: s };
74
26
  }
75
- function B(t, e) {
27
+ function P(t, e) {
76
28
  if (!t || !e)
77
29
  return !1;
78
30
  const n = t.getBoundingClientRect();
79
31
  return n.top <= e.clientY && e.clientY <= n.top + n.height && n.left <= e.clientX && e.clientX <= n.left + n.width;
80
32
  }
81
- function P(t, e, n, i) {
82
- const o = (i == null ? void 0 : i.verticalOffset) || 0, c = (i == null ? void 0 : i.horizontalOffset) || 0, u = (i == null ? void 0 : i.responsiveHeight) || !1, r = e.getBoundingClientRect(), s = S(t), f = r.left, m = r.top, g = document.documentElement.clientWidth - (f + r.width), h = m - o, A = document.documentElement.clientHeight - (m + r.height + o);
83
- let l = f, p = m + r.height + o, b = s.offsetWidth - r.width;
84
- const d = { horizontal: "start", vertical: "below" };
85
- let H = `${A - o}px`;
86
- i != null && i.centered && f - 16 + r.width / 2 > s.offsetWidth / 2 && g - 16 > b / 2 && (l -= b /= 2, d.horizontal = "center"), g < b && f > b && (l = l - b, d.horizontal = "end"), c && d.horizontal !== "center" && r.width / 2 < c && (l += c * (d.horizontal === "start" ? -1 : 1)), (f < b && g < b || document.documentElement.clientWidth < s.offsetWidth) && (l = document.documentElement.clientWidth / 2 - s.offsetWidth / 2), (A - o < s.scrollHeight && h - o > (u ? s.clientHeight : s.scrollHeight) || h > A && A - o < s.clientHeight && !u) && (p = h < s.scrollHeight ? p - r.height - h - o : m - s.clientHeight - o, H = `${h - o}px`, d.vertical = "above");
87
- const v = n.getBoundingClientRect();
88
- return v.left < 0 && (l -= v.left), v.top < 0 && (p -= v.top), {
89
- top: p,
90
- left: l,
91
- maxHeight: H,
92
- alignment: d
33
+ function g(t, e, n, i) {
34
+ const o = (i == null ? void 0 : i.verticalOffset) || 0, r = (i == null ? void 0 : i.horizontalOffset) || 0, b = (i == null ? void 0 : i.responsiveHeight) || !1, a = e.getBoundingClientRect(), s = W(t), d = a.left, m = a.top, x = document.documentElement.clientWidth - (d + a.width), u = m - o, p = document.documentElement.clientHeight - (m + a.height + o);
35
+ let c = d, v = m + a.height + o, f = s.offsetWidth - a.width;
36
+ const h = { horizontal: "start", vertical: "below" };
37
+ let y = `${p - o}px`;
38
+ i != null && i.centered && d - 16 + a.width / 2 > s.offsetWidth / 2 && x - 16 > f / 2 && (c -= f /= 2, h.horizontal = "center"), x < f && d > f && (c = c - f, h.horizontal = "end"), r && h.horizontal !== "center" && a.width / 2 < r && (c += r * (h.horizontal === "start" ? -1 : 1)), (d < f && x < f || document.documentElement.clientWidth < s.offsetWidth) && (c = document.documentElement.clientWidth / 2 - s.offsetWidth / 2), (p - o < s.scrollHeight && u - o > (b ? s.clientHeight : s.scrollHeight) || u > p && p - o < s.clientHeight && !b) && (v = u < s.scrollHeight ? v - a.height - u - o : m - s.clientHeight - o, y = `${u - o}px`, h.vertical = "above");
39
+ const A = n.getBoundingClientRect();
40
+ return A.left < 0 && (c -= A.left), A.top < 0 && (v -= A.top), {
41
+ top: v,
42
+ left: c,
43
+ maxHeight: y,
44
+ alignment: h
93
45
  };
94
46
  }
95
- function I(t, e, n, i, a) {
47
+ function R(t, e, n, i, l) {
96
48
  if (!t || !e)
97
49
  return;
98
- a.style.setProperty("--sbb-options-panel-width", `${e.offsetWidth}px`), a.style.setProperty("--sbb-options-panel-origin-height", `${e.offsetHeight}px`);
99
- const o = P(n, e, i);
100
- a.style.setProperty("--sbb-options-panel-position-x", `${o.left}px`), a.style.setProperty("--sbb-options-panel-position-y", `${o.top}px`), a.style.setProperty("--sbb-options-panel-max-height", o.maxHeight), a.setAttribute("data-options-panel-position", o.alignment.vertical), e.setAttribute("data-options-panel-position", o.alignment.vertical);
50
+ l.style.setProperty("--sbb-options-panel-width", `${e.offsetWidth}px`), l.style.setProperty("--sbb-options-panel-origin-height", `${e.offsetHeight}px`);
51
+ const o = g(n, e, i);
52
+ l.style.setProperty("--sbb-options-panel-position-x", `${o.left}px`), l.style.setProperty("--sbb-options-panel-position-y", `${o.top}px`), l.style.setProperty("--sbb-options-panel-max-height", o.maxHeight), l.setAttribute("data-options-panel-position", o.alignment.vertical), e.setAttribute("data-options-panel-position", o.alignment.vertical);
101
53
  }
102
- function Y(t, e, n, i) {
54
+ function $(t, e, n, i) {
103
55
  t && (t.setAttribute("aria-haspopup", e), t.setAttribute("aria-controls", n), t.setAttribute("aria-expanded", `${i === "opening" || i === "opened"}`));
104
56
  }
105
- function M(t) {
57
+ function z(t) {
106
58
  t && (t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-expanded"));
107
59
  }
108
- function X(t, e, n, i = "listbox") {
60
+ function C(t, e, n, i = "listbox") {
109
61
  t && (t.setAttribute("autocomplete", "off"), t.setAttribute("role", "combobox"), t.setAttribute("aria-autocomplete", "list"), t.setAttribute("aria-haspopup", i), t.setAttribute("aria-controls", e), t.setAttribute("aria-owns", e), t.setAttribute("aria-expanded", `${n}`));
110
62
  }
111
- function q(t) {
63
+ function B(t) {
112
64
  t && (t.removeAttribute("autocomplete"), t.removeAttribute("role"), t.removeAttribute("aria-autocomplete"), t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-owns"), t.removeAttribute("aria-expanded"));
113
65
  }
114
66
  export {
115
- C as applyInertMechanism,
116
- P as getElementPosition,
117
- S as getElementRectangle,
118
- B as isEventOnElement,
119
- $ as overlayGapFixCorners,
120
- q as removeAriaComboBoxAttributes,
121
- M as removeAriaOverlayTriggerAttributes,
122
- z as removeInertMechanism,
123
- X as setAriaComboBoxAttributes,
124
- Y as setAriaOverlayTriggerAttributes,
125
- I as setOverlayPosition
67
+ g as getElementPosition,
68
+ W as getElementRectangle,
69
+ P as isEventOnElement,
70
+ O as overlayGapFixCorners,
71
+ B as removeAriaComboBoxAttributes,
72
+ z as removeAriaOverlayTriggerAttributes,
73
+ C as setAriaComboBoxAttributes,
74
+ $ as setAriaOverlayTriggerAttributes,
75
+ R as setOverlayPosition
126
76
  };
@@ -27,6 +27,7 @@
27
27
 
28
28
  // Time Input
29
29
  --sbb-time-input-max-width: #{functions.px-to-rem-build(58)};
30
+ --sbb-time-input-s-max-width: #{functions.px-to-rem-build(51)};
30
31
 
31
32
  // Overlay
32
33
  --sbb-overlay-default-z-index: 1000;
@@ -41,6 +42,7 @@
41
42
 
42
43
  // Time Input
43
44
  --sbb-time-input-max-width: #{functions.px-to-rem-build(65)};
45
+ --sbb-time-input-s-max-width: #{functions.px-to-rem-build(58)};
44
46
  }
45
47
  }
46
48
  }
@@ -123,4 +125,8 @@ sbb-title + p {
123
125
 
124
126
  input[data-sbb-time-input] {
125
127
  max-width: var(--sbb-time-input-max-width);
128
+
129
+ sbb-form-field[size='s'] & {
130
+ max-width: var(--sbb-time-input-s-max-width);
131
+ }
126
132
  }
@@ -81,6 +81,7 @@
81
81
  --sbb-step-list-padding-block: var(--sbb-spacing-fixed-3x);
82
82
  --sbb-step-list-padding-inline: var(--sbb-spacing-responsive-xxs);
83
83
  --sbb-step-list-marker-to-text-gap: var(--sbb-spacing-responsive-xxxs);
84
+ --sbb-step-list-border-radius: var(--sbb-border-radius-4x);
84
85
 
85
86
  // Additional space from overall li padding to the text because text
86
87
  // has to be centered to marker number.
@@ -117,7 +118,6 @@
117
118
  position: relative;
118
119
  counter-increment: steps;
119
120
  background-color: var(--sbb-color-milk);
120
- border-radius: var(--sbb-border-radius-4x);
121
121
  padding-block: calc(
122
122
  var(--sbb-step-list-padding-block) + var(--sbb-step-list-text-to-marker-block-offset)
123
123
  )
@@ -131,6 +131,16 @@
131
131
  var(--sbb-step-list-marker-dimensions) + 2 * var(--sbb-step-list-padding-block)
132
132
  );
133
133
 
134
+ &:first-of-type {
135
+ border-start-start-radius: var(--sbb-step-list-border-radius);
136
+ border-start-end-radius: var(--sbb-step-list-border-radius);
137
+ }
138
+
139
+ &:last-of-type {
140
+ border-end-start-radius: var(--sbb-step-list-border-radius);
141
+ border-end-end-radius: var(--sbb-step-list-border-radius);
142
+ }
143
+
134
144
  &::before {
135
145
  @include typo.text-xxs--bold;
136
146
 
@@ -1 +1 @@
1
- {"version":3,"file":"wait-for-image-ready.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/testing/wait-for-image-ready.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,GAAG,eAAe,EAC3C,qBAAqB,SAAW,GAC/B,OAAO,CAAC,IAAI,CAAC,CAcf"}
1
+ {"version":3,"file":"wait-for-image-ready.d.ts","sourceRoot":"","sources":["../../../../src/elements/core/testing/wait-for-image-ready.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,gBAAgB,GAAG,eAAe,EAC3C,qBAAqB,SAAW,GAC/B,OAAO,CAAC,IAAI,CAAC,CAkCf"}