@sbb-esta/lyne-elements 2.4.1 → 2.5.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 (222) hide show
  1. package/button/common/button-common.d.ts +1 -2
  2. package/button/common/button-common.d.ts.map +1 -1
  3. package/button/common.js +4 -4
  4. package/clock/clock.d.ts +8 -0
  5. package/clock/clock.d.ts.map +1 -1
  6. package/clock.js +40 -31
  7. package/core/a11y/focus.d.ts.map +1 -1
  8. package/core/base-elements.js +36 -36
  9. package/core/controllers/inert-controller.d.ts +3 -3
  10. package/core/controllers/inert-controller.d.ts.map +1 -1
  11. package/core/controllers.js +13 -12
  12. package/core/decorators/force-type.d.ts +1 -1
  13. package/core/decorators/force-type.d.ts.map +1 -1
  14. package/core/decorators.js +39 -40
  15. package/core/i18n/i18n.d.ts +1 -0
  16. package/core/i18n/i18n.d.ts.map +1 -1
  17. package/core/i18n.js +95 -89
  18. package/core/mixins/animation-complete-mixin.d.ts +13 -0
  19. package/core/mixins/animation-complete-mixin.d.ts.map +1 -0
  20. package/core/mixins.d.ts +1 -0
  21. package/core/mixins.d.ts.map +1 -1
  22. package/core/mixins.js +192 -152
  23. package/core/styles/core.scss +81 -0
  24. package/core/styles/mixins/link.scss +14 -0
  25. package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables.scss +3 -0
  26. package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +4 -1
  27. package/core.css +51 -1
  28. package/custom-elements.json +3542 -393
  29. package/date-input/date-input.d.ts +11 -3
  30. package/date-input/date-input.d.ts.map +1 -1
  31. package/date-input.js +44 -38
  32. package/datepicker/datepicker/datepicker.d.ts.map +1 -1
  33. package/datepicker/datepicker.js +12 -12
  34. package/development/button/common/button-common.d.ts +1 -2
  35. package/development/button/common/button-common.d.ts.map +1 -1
  36. package/development/button/common.js +26 -24
  37. package/development/clock/clock.d.ts +8 -0
  38. package/development/clock/clock.d.ts.map +1 -1
  39. package/development/clock.js +20 -2
  40. package/development/core/a11y/focus.d.ts.map +1 -1
  41. package/development/core/a11y.js +1 -1
  42. package/development/core/base-elements.js +6 -6
  43. package/development/core/controllers/inert-controller.d.ts +3 -3
  44. package/development/core/controllers/inert-controller.d.ts.map +1 -1
  45. package/development/core/controllers.js +6 -7
  46. package/development/core/decorators/force-type.d.ts +1 -1
  47. package/development/core/decorators/force-type.d.ts.map +1 -1
  48. package/development/core/decorators.js +5 -5
  49. package/development/core/i18n/i18n.d.ts +1 -0
  50. package/development/core/i18n/i18n.d.ts.map +1 -1
  51. package/development/core/i18n.js +8 -1
  52. package/development/core/mixins/animation-complete-mixin.d.ts +13 -0
  53. package/development/core/mixins/animation-complete-mixin.d.ts.map +1 -0
  54. package/development/core/mixins.d.ts +1 -0
  55. package/development/core/mixins.d.ts.map +1 -1
  56. package/development/core/mixins.js +50 -1
  57. package/development/date-input/date-input.d.ts +11 -3
  58. package/development/date-input/date-input.d.ts.map +1 -1
  59. package/development/date-input.js +26 -18
  60. package/development/datepicker/datepicker/datepicker.d.ts.map +1 -1
  61. package/development/datepicker/datepicker.js +2 -1
  62. package/development/dialog/dialog-title/dialog-title.d.ts +3 -1
  63. package/development/dialog/dialog-title/dialog-title.d.ts.map +1 -1
  64. package/development/dialog/dialog-title.js +7 -2
  65. package/development/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
  66. package/development/flip-card/flip-card-details.js +5 -3
  67. package/development/header/common.js +2 -2
  68. package/development/link/common.js +13 -1
  69. package/development/menu/menu/menu.d.ts.map +1 -1
  70. package/development/menu/menu.js +4 -1
  71. package/development/navigation/navigation/navigation.d.ts.map +1 -1
  72. package/development/navigation/navigation.js +4 -1
  73. package/development/overlay/overlay-base-element.d.ts.map +1 -1
  74. package/development/overlay.js +4 -1
  75. package/development/sbb-tokens-CSAKTXUi.js +1 -1
  76. package/development/sidebar/common.d.ts +1 -0
  77. package/development/sidebar/common.d.ts.map +1 -0
  78. package/development/sidebar/common.js +114 -0
  79. package/development/sidebar/icon-sidebar/icon-sidebar.d.ts +23 -0
  80. package/development/sidebar/icon-sidebar/icon-sidebar.d.ts.map +1 -0
  81. package/development/sidebar/icon-sidebar-button/icon-sidebar-button.d.ts +19 -0
  82. package/development/sidebar/icon-sidebar-button/icon-sidebar-button.d.ts.map +1 -0
  83. package/development/sidebar/icon-sidebar-button.d.ts +2 -0
  84. package/development/sidebar/icon-sidebar-button.d.ts.map +1 -0
  85. package/development/sidebar/icon-sidebar-button.js +28 -0
  86. package/development/sidebar/icon-sidebar-container/icon-sidebar-container.d.ts +23 -0
  87. package/development/sidebar/icon-sidebar-container/icon-sidebar-container.d.ts.map +1 -0
  88. package/development/sidebar/icon-sidebar-container.d.ts +2 -0
  89. package/development/sidebar/icon-sidebar-container.d.ts.map +1 -0
  90. package/development/sidebar/icon-sidebar-container.js +45 -0
  91. package/development/sidebar/icon-sidebar-content/icon-sidebar-content.d.ts +17 -0
  92. package/development/sidebar/icon-sidebar-content/icon-sidebar-content.d.ts.map +1 -0
  93. package/development/sidebar/icon-sidebar-content.d.ts +2 -0
  94. package/development/sidebar/icon-sidebar-content.d.ts.map +1 -0
  95. package/development/sidebar/icon-sidebar-content.js +34 -0
  96. package/development/sidebar/icon-sidebar-link/icon-sidebar-link.d.ts +19 -0
  97. package/development/sidebar/icon-sidebar-link/icon-sidebar-link.d.ts.map +1 -0
  98. package/development/sidebar/icon-sidebar-link.d.ts +2 -0
  99. package/development/sidebar/icon-sidebar-link.d.ts.map +1 -0
  100. package/development/sidebar/icon-sidebar-link.js +28 -0
  101. package/development/sidebar/icon-sidebar.d.ts +2 -0
  102. package/development/sidebar/icon-sidebar.d.ts.map +1 -0
  103. package/development/sidebar/icon-sidebar.js +85 -0
  104. package/development/sidebar/sidebar/sidebar.d.ts +76 -0
  105. package/development/sidebar/sidebar/sidebar.d.ts.map +1 -0
  106. package/development/sidebar/sidebar-close-button/sidebar-close-button.d.ts +22 -0
  107. package/development/sidebar/sidebar-close-button/sidebar-close-button.d.ts.map +1 -0
  108. package/development/sidebar/sidebar-close-button.d.ts +2 -0
  109. package/development/sidebar/sidebar-close-button.d.ts.map +1 -0
  110. package/development/sidebar/sidebar-close-button.js +55 -0
  111. package/development/sidebar/sidebar-container/sidebar-container.d.ts +34 -0
  112. package/development/sidebar/sidebar-container/sidebar-container.d.ts.map +1 -0
  113. package/development/sidebar/sidebar-container.d.ts +2 -0
  114. package/development/sidebar/sidebar-container.d.ts.map +1 -0
  115. package/development/sidebar/sidebar-container.js +153 -0
  116. package/development/sidebar/sidebar-content/sidebar-content.d.ts +18 -0
  117. package/development/sidebar/sidebar-content/sidebar-content.d.ts.map +1 -0
  118. package/development/sidebar/sidebar-content.d.ts +2 -0
  119. package/development/sidebar/sidebar-content.d.ts.map +1 -0
  120. package/development/sidebar/sidebar-content.js +37 -0
  121. package/development/sidebar/sidebar-title/sidebar-title.d.ts +17 -0
  122. package/development/sidebar/sidebar-title/sidebar-title.d.ts.map +1 -0
  123. package/development/sidebar/sidebar-title.d.ts +2 -0
  124. package/development/sidebar/sidebar-title.d.ts.map +1 -0
  125. package/development/sidebar/sidebar-title.js +63 -0
  126. package/development/sidebar/sidebar.d.ts +2 -0
  127. package/development/sidebar/sidebar.d.ts.map +1 -0
  128. package/development/sidebar/sidebar.js +523 -0
  129. package/development/sidebar.d.ts +12 -0
  130. package/development/sidebar.d.ts.map +1 -0
  131. package/development/sidebar.js +12 -0
  132. package/development/stepper/step.js +19 -8
  133. package/development/time-input/time-input.d.ts +3 -2
  134. package/development/time-input/time-input.d.ts.map +1 -1
  135. package/development/time-input.js +19 -10
  136. package/development/title/title-base.d.ts +2 -4
  137. package/development/title/title-base.d.ts.map +1 -1
  138. package/development/title/title.d.ts +3 -1
  139. package/development/title/title.d.ts.map +1 -1
  140. package/development/title.js +8 -8
  141. package/dialog/dialog-title/dialog-title.d.ts +3 -1
  142. package/dialog/dialog-title/dialog-title.d.ts.map +1 -1
  143. package/dialog/dialog-title.js +16 -15
  144. package/flip-card/flip-card-details/flip-card-details.d.ts.map +1 -1
  145. package/flip-card/flip-card-details.js +14 -13
  146. package/header/common.js +6 -6
  147. package/index.d.ts +20 -0
  148. package/index.js +20 -0
  149. package/link/common.js +12 -12
  150. package/menu/menu/menu.d.ts.map +1 -1
  151. package/menu/menu.js +1 -1
  152. package/navigation/navigation/navigation.d.ts.map +1 -1
  153. package/navigation/navigation.js +7 -7
  154. package/overlay/overlay-base-element.d.ts.map +1 -1
  155. package/overlay.js +1 -1
  156. package/package.json +61 -1
  157. package/sidebar/common.d.ts +1 -0
  158. package/sidebar/common.d.ts.map +1 -0
  159. package/sidebar/common.js +7 -0
  160. package/sidebar/icon-sidebar/icon-sidebar.d.ts +23 -0
  161. package/sidebar/icon-sidebar/icon-sidebar.d.ts.map +1 -0
  162. package/sidebar/icon-sidebar-button/icon-sidebar-button.d.ts +19 -0
  163. package/sidebar/icon-sidebar-button/icon-sidebar-button.d.ts.map +1 -0
  164. package/sidebar/icon-sidebar-button.d.ts +2 -0
  165. package/sidebar/icon-sidebar-button.d.ts.map +1 -0
  166. package/sidebar/icon-sidebar-button.js +20 -0
  167. package/sidebar/icon-sidebar-container/icon-sidebar-container.d.ts +23 -0
  168. package/sidebar/icon-sidebar-container/icon-sidebar-container.d.ts.map +1 -0
  169. package/sidebar/icon-sidebar-container.d.ts +2 -0
  170. package/sidebar/icon-sidebar-container.d.ts.map +1 -0
  171. package/sidebar/icon-sidebar-container.js +35 -0
  172. package/sidebar/icon-sidebar-content/icon-sidebar-content.d.ts +17 -0
  173. package/sidebar/icon-sidebar-content/icon-sidebar-content.d.ts.map +1 -0
  174. package/sidebar/icon-sidebar-content.d.ts +2 -0
  175. package/sidebar/icon-sidebar-content.d.ts.map +1 -0
  176. package/sidebar/icon-sidebar-content.js +23 -0
  177. package/sidebar/icon-sidebar-link/icon-sidebar-link.d.ts +19 -0
  178. package/sidebar/icon-sidebar-link/icon-sidebar-link.d.ts.map +1 -0
  179. package/sidebar/icon-sidebar-link.d.ts +2 -0
  180. package/sidebar/icon-sidebar-link.d.ts.map +1 -0
  181. package/sidebar/icon-sidebar-link.js +20 -0
  182. package/sidebar/icon-sidebar.d.ts +2 -0
  183. package/sidebar/icon-sidebar.d.ts.map +1 -0
  184. package/sidebar/icon-sidebar.js +47 -0
  185. package/sidebar/sidebar/sidebar.d.ts +76 -0
  186. package/sidebar/sidebar/sidebar.d.ts.map +1 -0
  187. package/sidebar/sidebar-close-button/sidebar-close-button.d.ts +22 -0
  188. package/sidebar/sidebar-close-button/sidebar-close-button.d.ts.map +1 -0
  189. package/sidebar/sidebar-close-button.d.ts +2 -0
  190. package/sidebar/sidebar-close-button.d.ts.map +1 -0
  191. package/sidebar/sidebar-close-button.js +29 -0
  192. package/sidebar/sidebar-container/sidebar-container.d.ts +34 -0
  193. package/sidebar/sidebar-container/sidebar-container.d.ts.map +1 -0
  194. package/sidebar/sidebar-container.d.ts +2 -0
  195. package/sidebar/sidebar-container.d.ts.map +1 -0
  196. package/sidebar/sidebar-container.js +78 -0
  197. package/sidebar/sidebar-content/sidebar-content.d.ts +18 -0
  198. package/sidebar/sidebar-content/sidebar-content.d.ts.map +1 -0
  199. package/sidebar/sidebar-content.d.ts +2 -0
  200. package/sidebar/sidebar-content.d.ts.map +1 -0
  201. package/sidebar/sidebar-content.js +23 -0
  202. package/sidebar/sidebar-title/sidebar-title.d.ts +17 -0
  203. package/sidebar/sidebar-title/sidebar-title.d.ts.map +1 -0
  204. package/sidebar/sidebar-title.d.ts +2 -0
  205. package/sidebar/sidebar-title.d.ts.map +1 -0
  206. package/sidebar/sidebar-title.js +37 -0
  207. package/sidebar/sidebar.d.ts +2 -0
  208. package/sidebar/sidebar.d.ts.map +1 -0
  209. package/sidebar/sidebar.js +214 -0
  210. package/sidebar.d.ts +12 -0
  211. package/sidebar.d.ts.map +1 -0
  212. package/sidebar.js +11 -0
  213. package/standard-theme.css +51 -1
  214. package/stepper/step.js +13 -13
  215. package/time-input/time-input.d.ts +3 -2
  216. package/time-input/time-input.d.ts.map +1 -1
  217. package/time-input.js +44 -36
  218. package/title/title-base.d.ts +2 -4
  219. package/title/title-base.d.ts.map +1 -1
  220. package/title/title.d.ts +3 -1
  221. package/title/title.d.ts.map +1 -1
  222. package/title.js +11 -11
@@ -0,0 +1,37 @@
1
+ var _ = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var v = (e, t, s) => t.has(e) || _("Cannot " + s);
5
+ var d = (e, t, s) => (v(e, t, "read from private field"), s ? s.call(e) : t.get(e)), h = (e, t, s) => t.has(e) ? _("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s), p = (e, t, s, l) => (v(e, t, "write to private field"), l ? l.call(e, s) : t.set(e, s), s);
6
+ import { __esDecorate as f, __runInitializers as c } from "tslib";
7
+ import { customElement as S, property as z } from "lit/decorators.js";
8
+ import { hostAttributes as k } from "../core/decorators.js";
9
+ import { SbbTitleBase as y } from "../title.js";
10
+ import { css as x } from "lit";
11
+ const D = x`:host{display:block}.sbb-title{display:flex;-webkit-hyphens:auto;hyphens:auto;padding-block-start:calc(.5 * (var(--sbb-sidebar__close-button-size) - var(--sbb-title-font-size) * var(--sbb-title-line-height)));min-height:var(--sbb-sidebar__close-button-size);margin-block:0!important}`;
12
+ let B = (() => {
13
+ var r, a;
14
+ let e = [S("sbb-sidebar-title"), k({ slot: "title-section" })], t, s = [], l, n = y, b, m = [], u = [];
15
+ return a = class extends n {
16
+ constructor() {
17
+ super();
18
+ h(this, r, c(this, m, "2"));
19
+ c(this, u), this.visualLevel ?? (this.visualLevel = "5");
20
+ }
21
+ /** Title level */
22
+ get level() {
23
+ return d(this, r);
24
+ }
25
+ set level(i) {
26
+ p(this, r, i);
27
+ }
28
+ }, r = new WeakMap(), l = a, (() => {
29
+ const i = typeof Symbol == "function" && Symbol.metadata ? Object.create(n[Symbol.metadata] ?? null) : void 0;
30
+ b = [z({ reflect: !0 })], f(a, null, b, { kind: "accessor", name: "level", static: !1, private: !1, access: { has: (o) => "level" in o, get: (o) => o.level, set: (o, g) => {
31
+ o.level = g;
32
+ } }, metadata: i }, m, u), f(null, t = { value: l }, e, { kind: "class", name: l.name, metadata: i }, null, s), l = t.value, i && Object.defineProperty(l, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: i });
33
+ })(), a.styles = [y.styles, D], c(l, s), l;
34
+ })();
35
+ export {
36
+ B as SbbSidebarTitleElement
37
+ };
@@ -0,0 +1,2 @@
1
+ export * from './sidebar/sidebar.js';
2
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/elements/sidebar/sidebar.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,214 @@
1
+ var L = (i) => {
2
+ throw TypeError(i);
3
+ };
4
+ var Z = (i, r, a) => r.has(i) || L("Cannot " + a);
5
+ var v = (i, r, a) => (Z(i, r, "read from private field"), a ? a.call(i) : r.get(i)), m = (i, r, a) => r.has(i) ? L("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, a), l = (i, r, a, b) => (Z(i, r, "write to private field"), b ? b.call(i, a) : r.set(i, a), a);
6
+ import { __esDecorate as d, __runInitializers as n } from "tslib";
7
+ import { ResizeController as R } from "@lit-labs/observers/resize-controller.js";
8
+ import { css as $, isServer as B, html as j } from "lit";
9
+ import { customElement as q, property as f, eventOptions as G } from "lit/decorators.js";
10
+ import { SbbFocusHandler as J, setModalityOnNextFocus as P, getFirstFocusableElement as K } from "../core/a11y.js";
11
+ import { SbbOpenCloseBaseElement as Q } from "../core/base-elements.js";
12
+ import { SbbInertController as X, SbbEscapableOverlayController as Y } from "../core/controllers.js";
13
+ import { forceType as w, handleDistinctChange as ee } from "../core/decorators.js";
14
+ import { isZeroAnimationDuration as te } from "../core/dom.js";
15
+ import { SbbAnimationCompleteMixin as se } from "../core/mixins.js";
16
+ import { isEventOnElement as N } from "../core/overlay.js";
17
+ const ie = $`*,:before,:after{box-sizing:border-box}:host{display:block;width:20rem;--sbb-link-text-decoration: none;--sbb-sidebar-background-color: var(--sbb-color-white);--sbb-sidebar-title-padding-block: var(--sbb-spacing-fixed-3x);--sbb-sidebar-padding: var(--sbb-spacing-responsive-xs);--sbb-sidebar-scrollbar-placeholder-width: var(--sbb-spacing-fixed-3x);--sbb-sidebar-border-radius: var(--sbb-border-radius-8x);--sbb-sidebar-margin: var(--sbb-spacing-fixed-3x);--sbb-sidebar-title-gap: var(--sbb-spacing-fixed-2x);--sbb-sidebar__margin: 0;--sbb-sidebar__margin-block-start: var(--sbb-sidebar-margin);--sbb-sidebar__translate-x: -100%;--sbb-sidebar__z-index: 2;--sbb-sidebar__padding-inline-end: var(--sbb-sidebar-padding);--sbb-sidebar__padding-block-start: var(--sbb-sidebar-padding);--sbb-sidebar__border-radius-start: var(--sbb-sidebar-border-radius);--sbb-sidebar__border-radius-end: 0;--sbb-sidebar__close-button-size: var(--sbb-size-element-xs)}@supports (scrollbar-gutter: stable){:host{--sbb-sidebar__padding-inline-end: calc( var(--sbb-sidebar-padding) - var(--sbb-sidebar-scrollbar-placeholder-width) )}}:host([color=milk]){--sbb-sidebar-background-color: var(--sbb-color-milk)}:host(:is([mode=over],[data-mode-over-forced]:not([data-mode-over-forced-closing]))){--sbb-sidebar__margin: var(--sbb-sidebar-margin);--sbb-sidebar__border-radius-end: var(--sbb-sidebar-border-radius);--sbb-sidebar__z-index: 3}:host(:is(:dir(rtl),[position=end])){--sbb-sidebar__translate-x: 100%}:host(:dir(rtl)[position=end]){--sbb-sidebar__translate-x: -100%}.sbb-sidebar{width:inherit;max-width:calc(100% - 2 * var(--sbb-sidebar__margin));background-color:var(--sbb-sidebar-background-color);display:flex;flex-direction:column;position:absolute;overflow:hidden;inset-block:0;z-index:var(--sbb-sidebar__z-index);border-start-start-radius:var(--sbb-sidebar__border-radius-start);border-start-end-radius:var(--sbb-sidebar__border-radius-start);border-end-start-radius:var(--sbb-sidebar__border-radius-end);border-end-end-radius:var(--sbb-sidebar__border-radius-end);margin:var(--sbb-sidebar__margin);margin-block-start:var(--sbb-sidebar__margin-block-start);transition-duration:var(--sbb-sidebar-container-animation-duration);transition-timing-function:var(--sbb-sidebar-container-animation-easing);transition-property:width,translate;translate:none}:host([position=end]) .sbb-sidebar{inset-inline-end:0}:host([data-state=closed]) .sbb-sidebar{visibility:hidden}:host(:is([data-state=closing],[data-state=closed])) .sbb-sidebar{translate:var(--sbb-sidebar__translate-x) 0}.sbb-sidebar-title-section{display:flex;width:100%;gap:var(--sbb-sidebar-title-gap);background-color:var(--sbb-sidebar-background-color);padding-inline:var(--sbb-sidebar-padding);transition:box-shadow var(--sbb-animation-easing) var(--sbb-sidebar-container-animation-duration);box-shadow:none}:host([data-scrolled]) .sbb-sidebar-title-section{box-shadow:var(--sbb-shadow-elevation-level-5-shadow-2-offset-x) var(--sbb-shadow-elevation-level-5-shadow-2-offset-y) var(--sbb-shadow-elevation-level-5-shadow-2-blur) var(--sbb-shadow-elevation-level-5-shadow-2-spread) var(--sbb-shadow-elevation-level-5-soft-2-color),var(--sbb-shadow-elevation-level-5-shadow-1-offset-x) var(--sbb-shadow-elevation-level-5-shadow-1-offset-y) var(--sbb-shadow-elevation-level-5-shadow-1-blur) var(--sbb-shadow-elevation-level-5-shadow-1-spread) var(--sbb-shadow-elevation-level-5-soft-1-color)}.sbb-sidebar-content-section{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-black-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-black-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-sidebar-content-section::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sidebar-content-section::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-sidebar-content-section::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-sidebar-content-section::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-sidebar-content-section::-webkit-scrollbar-button,.sbb-sidebar-content-section::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-sidebar-content-section{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-sidebar-content-section{padding-block-start:var(--sbb-sidebar__padding-block-start);padding-inline:var(--sbb-sidebar-padding) var(--sbb-sidebar__padding-inline-end);overflow-y:auto;flex-grow:1;outline-color:var(--sbb-focus-outline-color)}@supports (scrollbar-gutter: stable){.sbb-sidebar-content-section{scrollbar-gutter:stable}}::slotted(sbb-sidebar-title){flex-grow:1;padding-block:var(--sbb-sidebar-title-padding-block)}::slotted(sbb-sidebar-close-button){order:1;margin-inline-end:calc(-1 * (var(--sbb-sidebar-padding) - var(--sbb-sidebar-title-padding-block)));margin-block:var(--sbb-sidebar-title-padding-block);inset-inline-end:var(--sbb-sidebar-padding)}`;
18
+ let fe = (() => {
19
+ var c, h, u, p, _, o;
20
+ let i = [q("sbb-sidebar")], r, a = [], b, k = se(Q), x = [], O, C = [], y = [], E, S = [], z = [], A, D = [], F = [], I, W = [], V = [], T, M = [], U = [], H;
21
+ return o = class extends k {
22
+ constructor() {
23
+ var e;
24
+ super();
25
+ m(this, c);
26
+ m(this, h);
27
+ m(this, u);
28
+ m(this, p);
29
+ m(this, _);
30
+ l(this, c, (n(this, x), n(this, C, "white"))), l(this, h, (n(this, y), n(this, S, "side"))), l(this, u, (n(this, z), n(this, D, "start"))), l(this, p, (n(this, F), n(this, W, !1))), l(this, _, (n(this, V), n(this, M, !1))), this._container = (n(this, U), null), this._lastFocusedElement = null, this._focusHandler = new J(), this._inertController = new X(this), this._escapableOverlayController = new Y(this), this._isPointerDownEventOnSidebar = !1, this._pointerDownListener = (t) => {
31
+ var s;
32
+ this._isPointerDownEventOnSidebar = N((s = this.shadowRoot) == null ? void 0 : s.firstElementChild, t);
33
+ }, this._closeOnBackdropClick = (t) => {
34
+ var s;
35
+ !this._isPointerDownEventOnSidebar && !N((s = this.shadowRoot) == null ? void 0 : s.firstElementChild, t) && this.close();
36
+ }, new R(this, {
37
+ skipInitial: !0,
38
+ callback: () => this._updateSidebarWidth()
39
+ }), (e = this.addEventListener) == null || e.call(this, "click", (t) => {
40
+ var s;
41
+ ((s = t.target) == null ? void 0 : s.localName) === "sbb-sidebar-close-button" && this.close();
42
+ });
43
+ }
44
+ /** Background color of the sidebar. Either `white` or `milk`. */
45
+ get color() {
46
+ return v(this, c);
47
+ }
48
+ set color(e) {
49
+ l(this, c, e);
50
+ }
51
+ /** Mode of the sidebar; one of 'side' or 'over'. */
52
+ get mode() {
53
+ return v(this, h);
54
+ }
55
+ set mode(e) {
56
+ l(this, h, e);
57
+ }
58
+ /** The side that the sidebar is attached to. */
59
+ get position() {
60
+ return v(this, u);
61
+ }
62
+ set position(e) {
63
+ l(this, u, e);
64
+ }
65
+ /**
66
+ * Whether the sidebar is opened or closed.
67
+ * Can be used to initially set the opened state, where
68
+ * the animation will be skipped.
69
+ */
70
+ get opened() {
71
+ return v(this, p);
72
+ }
73
+ set opened(e) {
74
+ l(this, p, e);
75
+ }
76
+ /**
77
+ * Whether the sidebar should focus the first focusable element automatically when opened.
78
+ * Defaults to false in when mode is set to `side`, otherwise defaults to true.
79
+ * If explicitly enabled, focus will be moved into the sidebar in `side` mode as well.
80
+ */
81
+ get focusOnOpen() {
82
+ return v(this, _);
83
+ }
84
+ set focusOnOpen(e) {
85
+ l(this, _, e);
86
+ }
87
+ /** Returns the SbbSidebarContainerElement where this sidebar is contained. */
88
+ get container() {
89
+ return this._container;
90
+ }
91
+ connectedCallback() {
92
+ var e;
93
+ super.connectedCallback(), this._container = (e = this.closest) == null ? void 0 : e.call(this, "sbb-sidebar-container"), this._updateSidebarWidth(), this.isOpen && this._isModeOver() && this._takeFocus();
94
+ }
95
+ disconnectedCallback() {
96
+ var e, t;
97
+ super.disconnectedCallback(), (e = this.container) == null || e.style.removeProperty(this._buildCssWidthVar()), this._container = null, this._focusHandler.disconnect(), (t = this._windowEventsController) == null || t.abort();
98
+ }
99
+ willUpdate(e) {
100
+ super.willUpdate(e), e.has("opened") && (this.opened ? this.open() : this.opened || this.close()), e.has("mode") && (this.mode === "over" && this.isOpen ? this._takeFocus() : this.cedeFocus());
101
+ }
102
+ firstUpdated(e) {
103
+ super.firstUpdated(e), this._updateSidebarWidth();
104
+ }
105
+ /** Toggles the sidebar visibility. */
106
+ toggle() {
107
+ this.state === "opening" || this.state === "opened" ? this.close() : this.open();
108
+ }
109
+ /** Opens the sidebar. */
110
+ open() {
111
+ var s;
112
+ if (this.state === "opening" || this.state === "opened" || !this.willOpen.emit())
113
+ return;
114
+ this.startAnimation(), !B && ((s = document.activeElement) == null ? void 0 : s.localName) !== "body" && (this._lastFocusedElement = document.activeElement), this.opened = !0;
115
+ const e = this._isZeroAnimationDuration() || !this.isConnected, t = !this.hasUpdated;
116
+ if (t || e)
117
+ this.toggleAttribute("data-skip-animation", !0);
118
+ else {
119
+ this.state = "opening";
120
+ return;
121
+ }
122
+ t ? this.updateComplete.then(() => this._handleOpening()) : this._handleOpening();
123
+ }
124
+ _isZeroAnimationDuration() {
125
+ return te(this, "--sbb-sidebar-container-animation-duration");
126
+ }
127
+ _handleOpening() {
128
+ this.state = "opened", setTimeout(() => this.toggleAttribute("data-skip-animation", !1)), this._takeFocus(), this.stopAnimation(), this.didOpen.emit();
129
+ }
130
+ /** Closes the sidebar. */
131
+ close() {
132
+ if (this.state === "closing" || this.state === "closed" || !this.willClose.emit())
133
+ return;
134
+ this.startAnimation();
135
+ const e = this._isZeroAnimationDuration();
136
+ !this.hasUpdated || e ? this.toggleAttribute("data-skip-animation", !0) : this.state = "closing", this.opened = !1, (!this.hasUpdated || e) && this._handleClosing();
137
+ }
138
+ _handleClosing() {
139
+ var e;
140
+ this.state = "closed", setTimeout(() => this.toggleAttribute("data-skip-animation", !1)), this.cedeFocus(), !B && (this.contains(document.activeElement) || this._isModeOver()) && (this._lastFocusedElement ? (P(this._lastFocusedElement), (e = this._lastFocusedElement) == null || e.focus()) : document.activeElement.blur()), this._lastFocusedElement = null, this.stopAnimation(), this.didClose.emit();
141
+ }
142
+ _takeFocus() {
143
+ if (this._inertController.isInert() || !this.isConnected)
144
+ return;
145
+ const e = this._isModeOver();
146
+ if (e && (this._inertController.activate(), this._escapableOverlayController.connect()), e || this.focusOnOpen) {
147
+ const t = K(Array.from(this.children).filter((s) => s instanceof window.HTMLElement));
148
+ P(t), t == null || t.focus();
149
+ }
150
+ e && (this._focusHandler.trap(this), this._attachWindowEvents());
151
+ }
152
+ _attachWindowEvents() {
153
+ var e;
154
+ (e = this._windowEventsController) == null || e.abort(), this._windowEventsController = new AbortController(), window.addEventListener("pointerdown", this._pointerDownListener, {
155
+ signal: this._windowEventsController.signal
156
+ }), window.addEventListener("pointerup", this._closeOnBackdropClick, {
157
+ signal: this._windowEventsController.signal
158
+ });
159
+ }
160
+ // Internal method that we use externally. `protected` preserves type information for type safe access.
161
+ cedeFocus() {
162
+ var e;
163
+ this._inertController.isInert() && this._inertController.deactivate(), this._focusHandler.disconnect(), this._escapableOverlayController.disconnect(), (e = this._windowEventsController) == null || e.abort();
164
+ }
165
+ _updateSidebarWidth(e) {
166
+ const t = this.container;
167
+ if (!t)
168
+ return;
169
+ e && t.style.removeProperty(this._buildCssWidthVar(e));
170
+ const s = this.offsetWidth;
171
+ if (!s)
172
+ return;
173
+ const g = `${s}px`;
174
+ t.style.getPropertyValue(this._buildCssWidthVar()) !== g && t.style.setProperty(this._buildCssWidthVar(), g);
175
+ }
176
+ _buildCssWidthVar(e = this.position) {
177
+ return `--sbb-sidebar-container__${e}-width`;
178
+ }
179
+ _isModeOver() {
180
+ return this.mode === "over" || this.hasAttribute("data-mode-over-forced");
181
+ }
182
+ _onTransitionEnd(e) {
183
+ e.propertyName !== "translate" || e.target !== e.currentTarget || (this.state === "opening" ? this._handleOpening() : this.state === "closing" && this._handleClosing());
184
+ }
185
+ _detectScrolledState() {
186
+ var e, t;
187
+ this.toggleAttribute("data-scrolled", (((t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".sbb-sidebar-content-section")) == null ? void 0 : t.scrollTop) ?? 0) > 0);
188
+ }
189
+ render() {
190
+ return j`<div class="sbb-sidebar" @transitionend=${this._onTransitionEnd}>
191
+ <div class="sbb-sidebar-title-section"><slot name="title-section"></slot></div>
192
+ <div class="sbb-sidebar-content-section" @scroll=${() => this._detectScrolledState()}>
193
+ <slot></slot>
194
+ </div>
195
+ </div>`;
196
+ }
197
+ }, c = new WeakMap(), h = new WeakMap(), u = new WeakMap(), p = new WeakMap(), _ = new WeakMap(), b = o, (() => {
198
+ const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(k[Symbol.metadata] ?? null) : void 0;
199
+ O = [f({ reflect: !0 })], E = [w((t) => t === "over" ? "over" : "side"), f({ reflect: !0 })], A = [w((t) => t === "end" ? "end" : "start"), ee((t, s, g) => t._updateSidebarWidth(g)), f({ reflect: !0 })], I = [w(), f({ type: Boolean, reflect: !0 })], T = [w(), f({ type: Boolean, attribute: "focus-on-open" })], H = [G({ passive: !0 })], d(o, null, O, { kind: "accessor", name: "color", static: !1, private: !1, access: { has: (t) => "color" in t, get: (t) => t.color, set: (t, s) => {
200
+ t.color = s;
201
+ } }, metadata: e }, C, y), d(o, null, E, { kind: "accessor", name: "mode", static: !1, private: !1, access: { has: (t) => "mode" in t, get: (t) => t.mode, set: (t, s) => {
202
+ t.mode = s;
203
+ } }, metadata: e }, S, z), d(o, null, A, { kind: "accessor", name: "position", static: !1, private: !1, access: { has: (t) => "position" in t, get: (t) => t.position, set: (t, s) => {
204
+ t.position = s;
205
+ } }, metadata: e }, D, F), d(o, null, I, { kind: "accessor", name: "opened", static: !1, private: !1, access: { has: (t) => "opened" in t, get: (t) => t.opened, set: (t, s) => {
206
+ t.opened = s;
207
+ } }, metadata: e }, W, V), d(o, null, T, { kind: "accessor", name: "focusOnOpen", static: !1, private: !1, access: { has: (t) => "focusOnOpen" in t, get: (t) => t.focusOnOpen, set: (t, s) => {
208
+ t.focusOnOpen = s;
209
+ } }, metadata: e }, M, U), d(o, null, H, { kind: "method", name: "_detectScrolledState", static: !1, private: !1, access: { has: (t) => "_detectScrolledState" in t, get: (t) => t._detectScrolledState }, metadata: e }, null, x), d(null, r = { value: b }, i, { kind: "class", name: b.name, metadata: e }, null, a), b = r.value, e && Object.defineProperty(b, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
210
+ })(), o.styles = ie, n(b, a), b;
211
+ })();
212
+ export {
213
+ fe as SbbSidebarElement
214
+ };
package/sidebar.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export * from './sidebar/common.js';
2
+ export * from './sidebar/icon-sidebar.js';
3
+ export * from './sidebar/icon-sidebar-button.js';
4
+ export * from './sidebar/icon-sidebar-container.js';
5
+ export * from './sidebar/icon-sidebar-content.js';
6
+ export * from './sidebar/icon-sidebar-link.js';
7
+ export * from './sidebar/sidebar.js';
8
+ export * from './sidebar/sidebar-close-button.js';
9
+ export * from './sidebar/sidebar-container.js';
10
+ export * from './sidebar/sidebar-content.js';
11
+ export * from './sidebar/sidebar-title.js';
12
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../src/elements/sidebar.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC"}
package/sidebar.js ADDED
@@ -0,0 +1,11 @@
1
+ export * from "./sidebar/common.js";
2
+ export * from "./sidebar/icon-sidebar.js";
3
+ export * from "./sidebar/icon-sidebar-button.js";
4
+ export * from "./sidebar/icon-sidebar-container.js";
5
+ export * from "./sidebar/icon-sidebar-content.js";
6
+ export * from "./sidebar/icon-sidebar-link.js";
7
+ export * from "./sidebar/sidebar.js";
8
+ export * from "./sidebar/sidebar-close-button.js";
9
+ export * from "./sidebar/sidebar-container.js";
10
+ export * from "./sidebar/sidebar-content.js";
11
+ export * from "./sidebar/sidebar-title.js";
@@ -106,7 +106,7 @@ summary {
106
106
 
107
107
  /**
108
108
  * Do not edit directly
109
- * Generated on Mon, 21 Oct 2024 06:34:22 GMT
109
+ * Generated on Wed, 19 Mar 2025 15:25:09 GMT
110
110
  */
111
111
  *,
112
112
  ::before,
@@ -255,11 +255,13 @@ summary {
255
255
  --sbb-color-red: #eb0000;
256
256
  --sbb-color-red-alpha-0: rgba(235, 0, 0, 0);
257
257
  --sbb-color-red-alpha-20: rgba(235, 0, 0, 0.2);
258
+ --sbb-color-red-alpha-60: rgba(235, 0, 0, 0.6);
258
259
  --sbb-color-red-alpha-90: rgba(235, 0, 0, 0.9);
259
260
  --sbb-color-red-mode-dark: #ff3838;
260
261
  --sbb-color-red125: #c60018;
261
262
  --sbb-color-red125-alpha-0: rgba(198, 0, 24, 0);
262
263
  --sbb-color-red125-alpha-20: rgba(198, 0, 24, 0.2);
264
+ --sbb-color-red125-alpha-60: rgba(198, 0, 0, 0.6);
263
265
  --sbb-color-red150: #a20013;
264
266
  --sbb-color-royal: #06348b;
265
267
  --sbb-color-royal125: #032668;
@@ -271,6 +273,7 @@ summary {
271
273
  --sbb-color-white-alpha-50: rgba(255, 255, 255, 0.5);
272
274
  --sbb-color-white-alpha-60: rgba(255, 255, 255, 0.6);
273
275
  --sbb-color-white-alpha-70: rgba(255, 255, 255, 0.7);
276
+ --sbb-color-white-alpha-80: rgba(255, 255, 255, 0.8);
274
277
  --sbb-color-sky: #0079c7;
275
278
  --sbb-color-night: #143a85;
276
279
  --sbb-color-violet: #6f2282;
@@ -1536,6 +1539,53 @@ sbb-train-formation[view=top] sbb-train-wagon {
1536
1539
  --sbb-train-wagon-wagon-end-right-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40' fill='none'%3E%3Cpath d='M8.5,0.5 h51.5 a19.5,19.5 0 0 1 19.5,19.5 v0 a19.5,19.5 0 0 1 -19.5,19.5 h-51.5 a8,8 0 0 1 -8,-8 v-23 a8,8 0 0 1 8,-8 z' stroke='%23000000' stroke-width='1'/%3E%3C/svg%3E");
1537
1540
  }
1538
1541
 
1542
+ sbb-sidebar-container:has(> sbb-sidebar[data-skip-animation]) {
1543
+ --sbb-sidebar-container-animation-duration: 0s;
1544
+ }
1545
+
1546
+ sbb-sidebar-container:is(:has(> sbb-sidebar:not([position=end]):is([data-state=closing],
1547
+ [data-state=closed],
1548
+ [mode=over],
1549
+ [data-mode-over-forced])),
1550
+ :not(:has(> sbb-sidebar:not([position=end])))) > sbb-sidebar-content {
1551
+ --sbb-sidebar-content__margin-inline-start: 0;
1552
+ }
1553
+
1554
+ sbb-sidebar-container:is(:has(> sbb-sidebar[position=end]:is([data-state=closing],
1555
+ [data-state=closed],
1556
+ [mode=over],
1557
+ [data-mode-over-forced])),
1558
+ :not(:has(> sbb-sidebar[position=end]))) > sbb-sidebar-content {
1559
+ --sbb-sidebar-content__margin-inline-end: 0;
1560
+ }
1561
+
1562
+ sbb-sidebar-container:has(> sbb-sidebar:is([mode=over], [data-mode-over-forced]):is([data-state=opening],
1563
+ [data-state=opened])) {
1564
+ --sbb-sidebar-container__backdrop-visibility: visible;
1565
+ --sbb-sidebar-container-backdrop-opacity: 0.4;
1566
+ }
1567
+
1568
+ sbb-icon-sidebar-content + sbb-icon-sidebar :is(sbb-icon-sidebar-link, sbb-icon-sidebar-button) {
1569
+ --sbb-icon-sidebar-button__current-border-inset-inline-start: auto;
1570
+ }
1571
+
1572
+ sbb-icon-sidebar-content + sbb-icon-sidebar {
1573
+ border-start-end-radius: 0;
1574
+ border-start-start-radius: var(--sbb-icon-sidebar-border-radius);
1575
+ }
1576
+
1577
+ sbb-sidebar:not(:has(sbb-sidebar-title)) sbb-sidebar-close-button {
1578
+ position: absolute;
1579
+ }
1580
+
1581
+ sbb-sidebar:has(sbb-sidebar-title) {
1582
+ --sbb-sidebar__padding-block-start: 0;
1583
+ }
1584
+
1585
+ sbb-header + :where(sbb-sidebar-container, sbb-icon-sidebar-container) {
1586
+ margin-block-start: var(--sbb-header-height);
1587
+ }
1588
+
1539
1589
  sub {
1540
1590
  bottom: -0.36em;
1541
1591
  }
package/stepper/step.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import { __esDecorate as c, __runInitializers as h } from "tslib";
2
2
  import { css as m, LitElement as u, html as v } from "lit";
3
- import { customElement as f } from "lit/decorators.js";
3
+ import { customElement as y } from "lit/decorators.js";
4
4
  import { hostAttributes as g } from "../core/decorators.js";
5
- import { EventEmitter as y } from "../core/eventing.js";
6
- const _ = m`*,:before,:after{box-sizing:border-box}:host{--sbb-step-position: initial;--sbb-step-inset-block-start: unset;--sbb-step-opacity: 0;--sbb-step-visibility: hidden;--sbb-step-height: 0;--sbb-step-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-step-animation-delay: 0;--sbb-step-color: var(--sbb-color-iron);display:contents}:host([data-selected]){--sbb-step-opacity: 1;--sbb-step-visibility: visible;--sbb-step-height: fit-content;--sbb-step-animation-duration: var(--sbb-animation-duration-4x);--sbb-step-animation-delay: var(--sbb-step-animation-duration)}:host([data-orientation=horizontal]){--sbb-step-position: absolute;--sbb-step-inset-block-start: 0}:host([data-orientation=vertical]) .sbb-step--wrapper{margin-inline-start:var(--sbb-spacing-fixed-4x);opacity:0;height:0;transition:height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-step-animation-duration) var(--sbb-animation-easing)}:host([data-selected][data-orientation=vertical]) .sbb-step--wrapper{opacity:1;height:var(--sbb-stepper-content-height);transition:height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-step-animation-duration) var(--sbb-stepper-animation-duration) var(--sbb-animation-easing)}.sbb-step{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:var(--sbb-step-position);width:100%;inset-block-start:var(--sbb-step-inset-block-start);opacity:var(--sbb-step-opacity);visibility:var(--sbb-step-visibility);height:var(--sbb-step-height);color:var(--sbb-step-color);transition-property:opacity,visibility;transition-duration:var(--sbb-step-animation-duration);transition-delay:var(--sbb-step-animation-delay);transition-timing-function:var(--sbb-animation-easing)}`;
5
+ import { EventEmitter as f } from "../core/eventing.js";
6
+ const _ = m`*,:before,:after{box-sizing:border-box}:host{--sbb-step-position: initial;--sbb-step-inset-block-start: unset;--sbb-step-opacity: 0;--sbb-step-display: none;--sbb-step-height: 0;--sbb-step-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-step-animation-delay: 0;--sbb-step-color: var(--sbb-color-iron);display:contents}:host([data-selected]){--sbb-step-opacity: 1;--sbb-step-display: block;--sbb-step-height: fit-content;--sbb-step-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-step-animation-delay: var(--sbb-step-animation-duration)}:host([data-orientation=horizontal]){--sbb-step-position: absolute;--sbb-step-inset-block-start: 0}:host([data-orientation=vertical]) .sbb-step--wrapper{margin-inline-start:var(--sbb-spacing-fixed-4x);opacity:0;height:0;transition:display var(--sbb-step-animation-duration) var(--sbb-animation-easing),height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-step-animation-duration) var(--sbb-animation-easing);transition-behavior:allow-discrete}:host([data-selected][data-orientation=vertical]) .sbb-step--wrapper{opacity:1;height:var(--sbb-stepper-content-height);transition:display var(--sbb-step-animation-duration) var(--sbb-animation-easing),height var(--sbb-stepper-animation-duration) var(--sbb-animation-easing),opacity var(--sbb-step-animation-duration) var(--sbb-stepper-animation-duration) var(--sbb-animation-easing);transition-behavior:allow-discrete}.sbb-step{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:var(--sbb-step-position);width:100%;inset-block-start:var(--sbb-step-inset-block-start);opacity:var(--sbb-step-opacity);display:var(--sbb-step-display);height:var(--sbb-step-height);color:var(--sbb-step-color);transition-property:display,opacity;transition-duration:var(--sbb-step-animation-duration);transition-delay:var(--sbb-step-animation-delay);transition-timing-function:var(--sbb-animation-easing);transition-behavior:allow-discrete}@starting-style{.sbb-step{--sbb-step-opacity: 0}}`;
7
7
  let x = 0, A = (() => {
8
8
  var e;
9
- let d = [f("sbb-step"), g({
9
+ let d = [y("sbb-step"), g({
10
10
  slot: "step",
11
11
  role: "tabpanel"
12
- })], n, r = [], i, o = u;
13
- var b = (e = class extends o {
12
+ })], b, r = [], s, o = u;
13
+ var n = (e = class extends o {
14
14
  /** The label of the step. */
15
15
  get label() {
16
16
  return this._label;
17
17
  }
18
18
  constructor() {
19
19
  var t;
20
- super(), this._validate = new y(this, b.events.validate), this._loaded = !1, this._stepper = null, this._label = null, (t = this.addEventListener) == null || t.call(this, "click", (a) => this._handleClick(a));
20
+ super(), this._validate = new f(this, n.events.validate), this._loaded = !1, this._stepper = null, this._label = null, (t = this.addEventListener) == null || t.call(this, "click", (a) => this._handleClick(a));
21
21
  }
22
22
  /**
23
23
  * Selects and configures the step.
@@ -50,8 +50,8 @@ let x = 0, A = (() => {
50
50
  /** Watches for clicked elements with `sbb-stepper-next` or `sbb-stepper-previous` attributes. */
51
51
  _handleClick(t) {
52
52
  var l, p;
53
- const a = t.composedPath().filter((s) => s instanceof window.HTMLElement);
54
- a.some((s) => this._isGoNextElement(s)) ? (l = this._stepper) == null || l.next() : a.some((s) => this._isGoPreviousElement(s)) && ((p = this._stepper) == null || p.previous());
53
+ const a = t.composedPath().filter((i) => i instanceof window.HTMLElement);
54
+ a.some((i) => this._isGoNextElement(i)) ? (l = this._stepper) == null || l.next() : a.some((i) => this._isGoPreviousElement(i)) && ((p = this._stepper) == null || p.previous());
55
55
  }
56
56
  _isGoNextElement(t) {
57
57
  return t.hasAttribute("sbb-stepper-next") && !t.hasAttribute("disabled");
@@ -80,13 +80,13 @@ let x = 0, A = (() => {
80
80
  </div>
81
81
  `;
82
82
  }
83
- }, i = e, (() => {
83
+ }, s = e, (() => {
84
84
  const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
85
- c(null, n = { value: i }, d, { kind: "class", name: i.name, metadata: t }, null, r), b = i = n.value, t && Object.defineProperty(i, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
85
+ c(null, b = { value: s }, d, { kind: "class", name: s.name, metadata: t }, null, r), n = s = b.value, t && Object.defineProperty(s, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
86
86
  })(), e.styles = _, e.events = {
87
87
  validate: "validate"
88
- }, h(i, r), e);
89
- return b = i;
88
+ }, h(s, r), e);
89
+ return n = s;
90
90
  })();
91
91
  export {
92
92
  A as SbbStepElement
@@ -1,4 +1,4 @@
1
- import { CSSResultGroup, TemplateResult, LitElement } from 'lit';
1
+ import { CSSResultGroup, PropertyValues, TemplateResult, LitElement } from 'lit';
2
2
  import { SbbDateLike } from '../core/interfaces.js';
3
3
  /**
4
4
  * * Combined with a native input, it displays the input's value as a formatted time.
@@ -31,7 +31,8 @@ export declare class SbbTimeInputElement extends LitElement {
31
31
  private _language;
32
32
  connectedCallback(): void;
33
33
  disconnectedCallback(): void;
34
- private _findInputElement;
34
+ firstUpdated(_changedProperties: PropertyValues): void;
35
+ private _setupInputElement;
35
36
  private _registerInputElement;
36
37
  /**
37
38
  * Updates `value` and `valueAsDate`. The direct update on the `_inputElement` is required
@@ -1 +1 @@
1
- {"version":3,"file":"time-input.d.ts","sourceRoot":"","sources":["../../../src/elements/time-input/time-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAQvC,OAAO,KAAK,EAAE,WAAW,EAA4B,MAAM,uBAAuB,CAAC;AAanF;;;;;GAKG;AACH,qBAEM,mBAAoB,SAAQ,UAAU;IAC1C,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;;MAGlB;IAEX,iEAAiE;IACjE,IACW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,EAGlD;IACD,IAAW,KAAK,IAAI,MAAM,GAAG,WAAW,GAAG,IAAI,CAE9C;IACD,OAAO,CAAC,MAAM,CAAqC;IAE1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiC;IAExE,iDAAiD;IACjD,IACW,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,EAc9C;IACD,IAAW,WAAW,IAAI,IAAI,GAAG,IAAI,CAEpC;IAED;;OAEG;IACH,OAAO,CAAC,UAAU,CAGf;IAEH,4DAA4D;IAC5D,OAAO,CAAC,iBAAiB,CAOvB;IAEF,OAAO,CAAC,gBAAgB,CAAwB;IAChD,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,SAAS,CAAmC;IAEpC,iBAAiB,IAAI,IAAI;IASzB,oBAAoB,IAAI,IAAI;IAK5C,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,qBAAqB;IA8C7B;;;OAGG;IACH,OAAO,CAAC,YAAY;IA4BpB,8BAA8B;IAC9B,OAAO,CAAC,WAAW;IAKnB,yDAAyD;IACzD,OAAO,CAAC,YAAY;IAMpB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAQ1B,uFAAuF;IACvF,OAAO,CAAC,YAAY;IAIpB,kDAAkD;IAClD,OAAO,CAAC,WAAW;IAoBnB,qDAAqD;IACrD,OAAO,CAAC,kBAAkB;IA6B1B,OAAO,CAAC,2BAA2B;cAWhB,MAAM,IAAI,cAAc;CAQ5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,gBAAgB,EAAE,mBAAmB,CAAC;KACvC;CACF"}
1
+ {"version":3,"file":"time-input.d.ts","sourceRoot":"","sources":["../../../src/elements/time-input/time-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAQvC,OAAO,KAAK,EAAE,WAAW,EAA4B,MAAM,uBAAuB,CAAC;AAanF;;;;;GAKG;AACH,qBAEM,mBAAoB,SAAQ,UAAU;IAC1C,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM;;;MAGlB;IAEX,iEAAiE;IACjE,IACW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,EAGlD;IACD,IAAW,KAAK,IAAI,MAAM,GAAG,WAAW,GAAG,IAAI,CAE9C;IACD,OAAO,CAAC,MAAM,CAAqC;IAE1C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiC;IAExE,iDAAiD;IACjD,IACW,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,EAc9C;IACD,IAAW,WAAW,IAAI,IAAI,GAAG,IAAI,CAEpC;IAED;;OAEG;IACH,OAAO,CAAC,UAAU,CAGf;IAEH,4DAA4D;IAC5D,OAAO,CAAC,iBAAiB,CAOvB;IAEF,OAAO,CAAC,gBAAgB,CAAwB;IAChD,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,SAAS,CAAmC;IAEpC,iBAAiB,IAAI,IAAI;IAMzB,oBAAoB,IAAI,IAAI;IAK5B,YAAY,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAMtE,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,qBAAqB;IA8C7B;;;OAGG;IACH,OAAO,CAAC,YAAY;IA4BpB,8BAA8B;IAC9B,OAAO,CAAC,WAAW;IAKnB,yDAAyD;IACzD,OAAO,CAAC,YAAY;IAMpB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAQ1B,uFAAuF;IACvF,OAAO,CAAC,YAAY;IAIpB,kDAAkD;IAClD,OAAO,CAAC,WAAW;IAoBnB,qDAAqD;IACrD,OAAO,CAAC,kBAAkB;IA6B1B,OAAO,CAAC,2BAA2B;cAWhB,MAAM,IAAI,cAAc;CAQ5C;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,gBAAgB,EAAE,mBAAmB,CAAC;KACvC;CACF"}
package/time-input.js CHANGED
@@ -1,41 +1,41 @@
1
1
  var v = (n) => {
2
2
  throw TypeError(n);
3
3
  };
4
- var w = (n, i, s) => i.has(n) || v("Cannot " + s);
5
- var A = (n, i, s) => (w(n, i, "read from private field"), s ? s.call(n) : i.get(n)), y = (n, i, s) => i.has(n) ? v("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(n) : i.set(n, s), c = (n, i, s, l) => (w(n, i, "write to private field"), l ? l.call(n, s) : i.set(n, s), s);
6
- import { __runInitializers as p, __esDecorate as m } from "tslib";
4
+ var w = (n, s, a) => s.has(n) || v("Cannot " + a);
5
+ var I = (n, s, a) => (w(n, s, "read from private field"), a ? a.call(n) : s.get(n)), A = (n, s, a) => s.has(n) ? v("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, a), c = (n, s, a, l) => (w(n, s, "write to private field"), l ? l.call(n, a) : s.set(n, a), a);
6
+ import { __runInitializers as h, __esDecorate as m } from "tslib";
7
7
  import { css as S, LitElement as O, html as k } from "lit";
8
- import { customElement as L, property as I, state as x } from "lit/decorators.js";
8
+ import { customElement as L, property as y, state as x } from "lit/decorators.js";
9
9
  import { ref as H } from "lit/directives/ref.js";
10
10
  import { SbbLanguageController as R } from "./core/controllers.js";
11
11
  import { findInput as M } from "./core/dom.js";
12
12
  import { EventEmitter as D, forwardEvent as V } from "./core/eventing.js";
13
- import { i18nTimeInputChange as $ } from "./core/i18n.js";
14
- const P = S`:host{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;display:block}`, z = /[0-9.:,\-;_hH]/, G = /^([0-9]{1,2})([0-9]{2})$/, U = /^([0-9]{1,2})?[.:,\-;_hH]?([0-9]{1,2})?$/;
13
+ import { i18nTimeInputChange as U } from "./core/i18n.js";
14
+ const $ = S`:host{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;display:block}`, P = /[0-9.:,\-;_hH]/, z = /^([0-9]{1,2})([0-9]{2})$/, G = /^([0-9]{1,2})?[.:,\-;_hH]?([0-9]{1,2})?$/;
15
15
  let Z = (() => {
16
16
  var o, r;
17
- let n = [L("sbb-time-input")], i, s = [], l, d = O, _ = [], E, b, g = [], f = [], C;
18
- var h = (r = class extends d {
17
+ let n = [L("sbb-time-input")], s, a = [], l, d = O, _ = [], E, b, g = [], f = [], C;
18
+ var p = (r = class extends d {
19
19
  constructor() {
20
20
  super(...arguments);
21
- y(this, o);
22
- this._input = (p(this, _), null), c(this, o, p(this, g, null)), this._didChange = (p(this, f), new D(this, h.events.didChange, {
21
+ A(this, o);
22
+ this._input = (h(this, _), null), c(this, o, h(this, g, null)), this._didChange = (h(this, f), new D(this, p.events.didChange, {
23
23
  bubbles: !0,
24
24
  cancelable: !0
25
- })), this._validationChange = new D(this, h.events.validationChange, {
25
+ })), this._validationChange = new D(this, p.events.validationChange, {
26
26
  bubbles: !0,
27
27
  composed: !1
28
28
  }), this._abortController = new AbortController(), this._language = new R(this);
29
29
  }
30
30
  /** Reference of the native input connected to the datepicker. */
31
31
  set input(t) {
32
- this._input = t, this._findInputElement();
32
+ this._input = t, this._setupInputElement();
33
33
  }
34
34
  get input() {
35
35
  return this._input;
36
36
  }
37
37
  get _inputElement() {
38
- return A(this, o);
38
+ return I(this, o);
39
39
  }
40
40
  set _inputElement(t) {
41
41
  c(this, o, t);
@@ -55,15 +55,23 @@ let Z = (() => {
55
55
  return this._formatValueAsDate(this._parseInput((t = this._inputElement) == null ? void 0 : t.value)) ?? null;
56
56
  }
57
57
  connectedCallback() {
58
- super.connectedCallback(), this._findInputElement(), this._inputElement && this._updateValue(this._inputElement.value);
58
+ super.connectedCallback(), this._setupInputElement();
59
59
  }
60
60
  disconnectedCallback() {
61
61
  var t;
62
62
  super.disconnectedCallback(), (t = this._abortController) == null || t.abort();
63
63
  }
64
- _findInputElement() {
65
- const t = this._inputElement;
66
- this._inputElement = M(this, this.input), t !== this._inputElement && this._registerInputElement();
64
+ firstUpdated(t) {
65
+ super.firstUpdated(t), this._setupInputElement();
66
+ }
67
+ _setupInputElement() {
68
+ var i;
69
+ const t = M(this, this.input);
70
+ if (!t) {
71
+ (i = this._abortController) == null || i.abort();
72
+ return;
73
+ }
74
+ this._inputElement !== t && (this._inputElement = t, this._registerInputElement(), this._updateValue(this._inputElement.value));
67
75
  }
68
76
  _registerInputElement() {
69
77
  var t;
@@ -85,7 +93,7 @@ let Z = (() => {
85
93
  _updateValue(t) {
86
94
  if (this._statusContainer && (this._statusContainer.innerText = ""), !this._inputElement)
87
95
  return;
88
- const e = this._parseInput(t), a = !!e && this._isTimeValid(e), u = !t || t.trim() === "" || a;
96
+ const e = this._parseInput(t), i = !!e && this._isTimeValid(e), u = !t || t.trim() === "" || i;
89
97
  u && e && (Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value").set.call(this._inputElement, this._formatValue(e)), this._inputElement.dispatchEvent(new InputEvent("input", { bubbles: !0, composed: !0 })));
90
98
  const T = !this._inputElement.hasAttribute("data-sbb-invalid");
91
99
  this._inputElement.toggleAttribute("data-sbb-invalid", !u), T !== u && this._validationChange.emit({ valid: u });
@@ -96,8 +104,8 @@ let Z = (() => {
96
104
  }
97
105
  /** Returns the right format for the `value` property. */
98
106
  _formatValue(t) {
99
- const e = String(t.hours).padStart(2, "0"), a = String(t.minutes).padStart(2, "0");
100
- return `${e}:${a}`;
107
+ const e = String(t.hours).padStart(2, "0"), i = String(t.minutes).padStart(2, "0");
108
+ return `${e}:${i}`;
101
109
  }
102
110
  /**
103
111
  * Returns the right format for the `valueAsDate` property:
@@ -115,10 +123,10 @@ let Z = (() => {
115
123
  const e = t == null ? void 0 : t.trim();
116
124
  if (!e)
117
125
  return null;
118
- const a = e.match(G);
119
- if (a)
120
- return { hours: +a[1] || 0, minutes: +a[2] || 0 };
121
- const u = e.match(U);
126
+ const i = e.match(z);
127
+ if (i)
128
+ return { hours: +i[1] || 0, minutes: +i[2] || 0 };
129
+ const u = e.match(G);
122
130
  return u ? { hours: +u[1] || 0, minutes: +u[2] || 0 } : null;
123
131
  }
124
132
  /** Only allow typing numbers and separator keys. */
@@ -137,13 +145,13 @@ let Z = (() => {
137
145
  "PageDown",
138
146
  "Delete"
139
147
  ];
140
- !t.ctrlKey && !t.altKey && !t.metaKey && !e.includes(t.key) && !z.test(t.key) && t.preventDefault();
148
+ !t.ctrlKey && !t.altKey && !t.metaKey && !e.includes(t.key) && !P.test(t.key) && t.preventDefault();
141
149
  }
142
150
  // We use a programmatic approach to avoid initial setting the message
143
151
  // and to not immediately change output if language should change (no reason to read out message).
144
152
  _updateAccessibilityMessage() {
145
153
  var e;
146
- this._inputElement.hasAttribute("data-sbb-invalid") || (this._statusContainer.innerText = `${$[this._language.current]} ${(e = this._inputElement) == null ? void 0 : e.value}.`);
154
+ this._inputElement.hasAttribute("data-sbb-invalid") || (this._statusContainer.innerText = `${U[this._language.current]} ${(e = this._inputElement) == null ? void 0 : e.value}.`);
147
155
  }
148
156
  render() {
149
157
  return k`
@@ -155,18 +163,18 @@ let Z = (() => {
155
163
  }
156
164
  }, o = new WeakMap(), l = r, (() => {
157
165
  const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(d[Symbol.metadata] ?? null) : void 0;
158
- E = [I()], b = [x()], C = [I({ attribute: !1 })], m(r, null, E, { kind: "setter", name: "input", static: !1, private: !1, access: { has: (e) => "input" in e, set: (e, a) => {
159
- e.input = a;
160
- } }, metadata: t }, null, _), m(r, null, b, { kind: "accessor", name: "_inputElement", static: !1, private: !1, access: { has: (e) => "_inputElement" in e, get: (e) => e._inputElement, set: (e, a) => {
161
- e._inputElement = a;
162
- } }, metadata: t }, g, f), m(r, null, C, { kind: "setter", name: "valueAsDate", static: !1, private: !1, access: { has: (e) => "valueAsDate" in e, set: (e, a) => {
163
- e.valueAsDate = a;
164
- } }, metadata: t }, null, _), m(null, i = { value: l }, n, { kind: "class", name: l.name, metadata: t }, null, s), h = l = i.value, t && Object.defineProperty(l, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
165
- })(), r.styles = P, r.events = {
166
+ E = [y()], b = [x()], C = [y({ attribute: !1 })], m(r, null, E, { kind: "setter", name: "input", static: !1, private: !1, access: { has: (e) => "input" in e, set: (e, i) => {
167
+ e.input = i;
168
+ } }, metadata: t }, null, _), m(r, null, b, { kind: "accessor", name: "_inputElement", static: !1, private: !1, access: { has: (e) => "_inputElement" in e, get: (e) => e._inputElement, set: (e, i) => {
169
+ e._inputElement = i;
170
+ } }, metadata: t }, g, f), m(r, null, C, { kind: "setter", name: "valueAsDate", static: !1, private: !1, access: { has: (e) => "valueAsDate" in e, set: (e, i) => {
171
+ e.valueAsDate = i;
172
+ } }, metadata: t }, null, _), m(null, s = { value: l }, n, { kind: "class", name: l.name, metadata: t }, null, a), p = l = s.value, t && Object.defineProperty(l, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
173
+ })(), r.styles = $, r.events = {
166
174
  didChange: "didChange",
167
175
  validationChange: "validationChange"
168
- }, p(l, s), r);
169
- return h = l;
176
+ }, h(l, a), r);
177
+ return p = l;
170
178
  })();
171
179
  export {
172
180
  Z as SbbTimeInputElement