@sbb-esta/lyne-elements-dev 5.0.0-next.3-dev.1780381732 → 5.0.0-next.3-dev.1780406485

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 (45) hide show
  1. package/calendar/_calendar.global.scss +25 -26
  2. package/calendar/calendar/calendar.component.js +1 -1
  3. package/calendar/calendar-day/calendar-day.component.js +1 -1
  4. package/calendar/calendar-month/calendar-month.component.js +1 -1
  5. package/calendar/calendar-year/calendar-year.component.js +1 -1
  6. package/calendar/common/calendar-cell-base-element.js +1 -1
  7. package/calendar-cell-base-element-DHCKK3bU.js +23 -0
  8. package/{calendar-day.component-Caf2w9lS.js → calendar-day.component-DrMWf6-w.js} +2 -2
  9. package/calendar.component-BM4L9oyb.js +987 -0
  10. package/calendar.js +3 -3
  11. package/calendar.pure.js +3 -3
  12. package/core/i18n/i18n.js +4 -4
  13. package/core/styles/_theme.scss +1 -0
  14. package/custom-elements.json +401 -233
  15. package/datepicker/datepicker/datepicker.component.js +45 -27
  16. package/development/calendar/calendar/calendar.component.d.ts +27 -42
  17. package/development/calendar/calendar/calendar.component.d.ts.map +1 -1
  18. package/development/calendar/calendar/calendar.component.js +1 -1
  19. package/development/calendar/calendar-day/calendar-day.component.js +1 -1
  20. package/development/calendar/calendar-month/calendar-month.component.js +2 -2
  21. package/development/calendar/calendar-year/calendar-year.component.js +2 -2
  22. package/development/calendar/common/calendar-cell-base-element.js +1 -1
  23. package/development/calendar-cell-base-element-D9XadTz1.js +38 -0
  24. package/development/calendar-day.component-Zky9Z-Fq.js +139 -0
  25. package/development/calendar.component-C_Yc2PNV.js +1367 -0
  26. package/development/calendar.js +3 -3
  27. package/development/calendar.pure.js +3 -3
  28. package/development/core/decorators/id-reference.d.ts.map +1 -1
  29. package/development/core/decorators/id-reference.js +1 -1
  30. package/development/core/i18n/i18n.js +5 -5
  31. package/development/datepicker/datepicker/datepicker.component.d.ts +2 -0
  32. package/development/datepicker/datepicker/datepicker.component.d.ts.map +1 -1
  33. package/development/datepicker/datepicker/datepicker.component.js +37 -11
  34. package/lean-off-brand-theme.css +14 -22
  35. package/lean-safety-theme.css +14 -22
  36. package/lean-theme.css +14 -22
  37. package/off-brand-theme.css +14 -22
  38. package/package.json +2 -2
  39. package/safety-theme.css +14 -22
  40. package/standard-theme.css +14 -22
  41. package/calendar-cell-base-element-Dq7Ap5n-.js +0 -23
  42. package/calendar.component-DKKptbyy.js +0 -1082
  43. package/development/calendar-cell-base-element-D_CTwDn9.js +0 -38
  44. package/development/calendar-day.component-Bux4ezpg.js +0 -139
  45. package/development/calendar.component-NvMN01yi.js +0 -1478
@@ -3,45 +3,44 @@
3
3
  $theme: 'standard' !default;
4
4
 
5
5
  @mixin base {
6
- --sbb-calendar-cell-background-color: transparent;
7
6
  --sbb-calendar-cell-background-color-hover: var(--sbb-background-color-3);
8
7
  --sbb-calendar-cell-background-color-active: var(--sbb-background-color-4);
9
8
  --sbb-calendar-cell-padding: #{sbb.px-to-rem-build(2)};
10
9
  --sbb-calendar-cell-border-width: var(--sbb-border-width-2x);
10
+ --sbb-calendar-cell-border-color-selected: var(--sbb-border-color-2);
11
11
  --sbb-calendar-cell-disabled-height: #{sbb.px-to-rem-build(1.5)};
12
12
  --sbb-calendar-cell-disabled-width: #{sbb.px-to-rem-build(25.5)};
13
13
  --sbb-calendar-cell-disabled-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
14
14
  --sbb-calendar-cell-transition-easing-function: var(--sbb-animation-easing);
15
- --sbb-calendar-cell-border: var(--sbb-calendar-cell-border-width) solid
16
- var(--sbb-border-color-1-inverted);
17
15
  --sbb-calendar-cell-color: var(--sbb-color-2);
18
16
  --sbb-calendar-cell-cursor: var(--sbb-cursor-pointer);
19
- --sbb-calendar-cell-justify-content: normal;
20
- --sbb-calendar-cell-inset: #{sbb.px-to-rem-build(1)};
21
17
  --sbb-calendar-cell-font-size: var(--sbb-text-font-size-s);
22
- --sbb-calendar-cell-font-weight: unset;
23
- --sbb-calendar-cell-year-month-width: #{sbb.px-to-rem-build(77)};
24
- --sbb-calendar-cell-year-month-height: #{sbb.px-to-rem-build(44)};
25
- --sbb-calendar-control-gap: var(--sbb-spacing-fixed-2x);
26
- --sbb-calendar-control-margin-block-end: var(--sbb-spacing-fixed-4x);
27
- --sbb-calendar-control-view-change-height: #{sbb.px-to-rem-build(44)};
18
+ --sbb-calendar-cell-margin: #{sbb.px-to-rem-build(1)};
19
+ --sbb-calendar-cell-size: #{sbb.px-to-rem-build(44)};
20
+
21
+ // Actual full height is 73, but with margin this comes down to 71
22
+ --sbb-calendar-cell-year-month-width: #{sbb.px-to-rem-build(71)};
23
+
24
+ // Actual full height is 40, but with margin this comes down to 38
25
+ --sbb-calendar-cell-year-month-height: #{sbb.px-to-rem-build(38)};
26
+ --sbb-calendar-control-gap: var(--sbb-spacing-fixed-1x);
28
27
  --sbb-calendar-control-view-change-color: var(--sbb-color-3);
29
- --sbb-calendar-control-view-change-background: var(--sbb-background-color-1);
30
- --sbb-calendar-control-view-change-padding-inline: var(--sbb-spacing-fixed-5x)
31
- var(--sbb-spacing-fixed-2x);
32
28
  --sbb-calendar-header-color: light-dark(var(--sbb-color-granite), var(--sbb-color-smoke));
33
-
34
- // While changing views, there would be a few frames where the height of the calendar collapses to just
35
- // the height of the controls and then grow back to the height of the next view.
36
- // By using 0.1ms this can be avoided.
37
- --sbb-calendar-table-animation-duration: 0.1ms;
38
- --sbb-calendar-table-animation-shift: #{sbb.px-to-rem-build(0.1)};
39
- --sbb-calendar-table-column-spaces: 12;
40
29
  --sbb-calendar-tables-gap: var(--sbb-spacing-fixed-10x);
41
- --sbb-calendar-day-width: #{sbb.px-to-rem-build(44)};
42
- --sbb-calendar-day-height: #{sbb.px-to-rem-build(48)};
30
+
31
+ // Actual full width is 44, but with margin this comes down to 42
32
+ --sbb-calendar-day-size: #{sbb.px-to-rem-build(42)};
33
+ --sbb-calendar-day-width: var(--sbb-calendar-day-size);
34
+
35
+ // Actual full height is 48, but with margin this comes down to 46
36
+ --sbb-calendar-day-height: #{sbb.px-to-rem-build(46)};
37
+ --sbb-calendar-day-justify-content: start;
38
+ --sbb-calendar-day-value-height: var(--sbb-spacing-fixed-6x);
43
39
  --sbb-calendar-day-extra-display: block;
44
- --sbb-calendar-day-extra-height: var(--sbb-spacing-fixed-4x);
45
- --sbb-calendar-day-crossed-out-top: 33%;
46
- --sbb-calendar-day-crossed-out-translate: translate(-50%, -33%) rotate(-45deg);
40
+ --sbb-calendar-day-extra-height: #{sbb.px-to-rem-build(18)};
41
+ }
42
+
43
+ @mixin forced-colors {
44
+ --sbb-calendar-cell-background-color-hover: transparent;
45
+ --sbb-calendar-cell-background-color-active: transparent;
47
46
  }
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "../../calendar.component-DKKptbyy.js";
1
+ import { n as e, r as t, t as n } from "../../calendar.component-BM4L9oyb.js";
2
2
  export { n as SbbCalendarElement, e as SbbDateSelectedEvent, t as SbbMonthChangeEvent };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../calendar-day.component-Caf2w9lS.js";
1
+ import { t as e } from "../../calendar-day.component-DrMWf6-w.js";
2
2
  export { e as SbbCalendarDayElement };
@@ -53,7 +53,7 @@ var a = (() => {
53
53
  super.connectedCallback(), this.tabIndex = -1;
54
54
  }
55
55
  setSelectedState(e) {
56
- let t = e.multiple ? e.selected?.some((e) => this._yearValue === this.dateAdapter.getYear(e) && this._monthValue === this.dateAdapter.getMonth(e)) ?? !1 : !!e.selected && this.dateAdapter.getYear(e.selected) === this._yearValue && this.dateAdapter.getMonth(e.selected) === this._monthValue;
56
+ let t = e.multiple ? e.value?.some((e) => this._yearValue === this.dateAdapter.getYear(e) && this._monthValue === this.dateAdapter.getMonth(e)) ?? !1 : !!e.value && this.dateAdapter.getYear(e.value) === this._yearValue && this.dateAdapter.getMonth(e.value) === this._monthValue;
57
57
  this.toggleState("selected", t), this.internals.ariaPressed = String(t);
58
58
  }
59
59
  setDisabledFilteredState(e) {
@@ -49,7 +49,7 @@ var a = (() => {
49
49
  super.connectedCallback(), this.tabIndex = -1;
50
50
  }
51
51
  setSelectedState(e) {
52
- let t = e.multiple ? e.selected?.some((e) => Number(this.value) === this.dateAdapter.getYear(e)) ?? !1 : !!e.selected && this.dateAdapter.getYear(e.selected) === Number(this.value);
52
+ let t = e.multiple ? e.value?.some((e) => Number(this.value) === this.dateAdapter.getYear(e)) ?? !1 : !!e.value && this.dateAdapter.getYear(e.value) === Number(this.value);
53
53
  this.toggleState("selected", t), this.internals.ariaPressed = String(t);
54
54
  }
55
55
  setDisabledFilteredState(e) {
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../calendar-cell-base-element-Dq7Ap5n-.js";
1
+ import { t as e } from "../../calendar-cell-base-element-DHCKK3bU.js";
2
2
  export { e as SbbCalendarCellBaseElement };
@@ -0,0 +1,23 @@
1
+ import { unsafeCSS as e } from "lit";
2
+ import { SbbButtonLikeBaseElement as t, SbbDisabledMixin as n, SbbPropertyWatcherController as r, defaultDateAdapter as i, readConfig as a } from "./core.js";
3
+ //#region src/elements/calendar/common/calendar-cell-base-element.scss?inline
4
+ var o = ":host{--sbb-focus-outline-offset: .125rem;--sbb-calendar-cell-transition-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );display:block;font-size:var(--sbb-calendar-cell-font-size);letter-spacing:var(--sbb-typo-letter-spacing-text);cursor:var(--sbb-calendar-cell-cursor);color:var(--sbb-calendar-cell-color);border-radius:calc(var(--sbb-border-radius-4x) + var(--sbb-calendar-cell-border-width));margin:var(--sbb-calendar-cell-margin);padding:var(--sbb-calendar-cell-border-width);background-clip:content-box;transition-duration:var(--sbb-calendar-cell-transition-duration);transition-timing-function:var(--sbb-calendar-cell-transition-easing-function);transition-property:background-color}:host(:is(sbb-calendar-weekday,sbb-calendar-weeknumber)){--sbb-calendar-cell-font-size: var(--sbb-text-font-size-xs);--sbb-calendar-day-height: var(--sbb-calendar-day-size);color:var(--sbb-calendar-header-color)}:host(:is(sbb-calendar-day,sbb-calendar-weekday,sbb-calendar-weeknumber)){height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width)}:host(:is(:state(current),[state--current])){font-weight:700}:host(:is(:state(selected),[state--selected])){border:var(--sbb-calendar-cell-border-width) solid var(--sbb-calendar-cell-border-color-selected);padding:0}:host(:disabled){--sbb-calendar-cell-color: var(--sbb-calendar-cell-disabled-color);--sbb-calendar-cell-cursor: unset}:host(:focus-visible){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width)}@media(any-hover:hover){:host(:not(:disabled,:where(:is(:state(active),[state--active]),:active)):hover){background-color:var(--sbb-calendar-cell-background-color-hover)}}@media(any-hover:hover)and (forced-colors:active){:host(:not(:disabled):hover){outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);--sbb-focus-outline-style: initial}}:host(:not(:disabled):where(:is(:state(active),[state--active]),:active)){background-color:var(--sbb-calendar-cell-background-color-active)}.sbb-action-base{display:flex;flex-direction:column;justify-content:center;height:100%;width:100%}.sbb-calendar-year,.sbb-calendar-month{height:var(--sbb-calendar-cell-year-month-height);width:var(--sbb-calendar-cell-year-month-width)}:host(:is(:state(crossed-out),[state--crossed-out])) :is(.sbb-calendar-year,.sbb-calendar-month,.sbb-calendar-day__value):after{position:absolute;top:50%;left:50%;translate:-50% -50%;content:\"\";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);background-color:var(--sbb-calendar-cell-disabled-color);rotate:-45deg}", s = class extends n(t) {
5
+ static {
6
+ this.styles = [e(o)];
7
+ }
8
+ constructor() {
9
+ super(), this.dateAdapter = a().datetime?.dateAdapter ?? i, this.addController(new r(this, () => this.getParent(), {
10
+ dateFilter: (e) => this.setDisabledFilteredState(e),
11
+ min: (e) => this.setDisabledFilteredState(e),
12
+ max: (e) => this.setDisabledFilteredState(e),
13
+ value: (e) => this.setSelectedState(e)
14
+ }));
15
+ }
16
+ getParent() {
17
+ return this.getRootNode?.()?.host?.closest("sbb-calendar");
18
+ }
19
+ formResetCallback() {}
20
+ formStateRestoreCallback(e, t) {}
21
+ };
22
+ //#endregion
23
+ export { s as t };
@@ -3,7 +3,7 @@ import { html as n, unsafeCSS as r } from "lit";
3
3
  import { property as i, state as a } from "lit/decorators.js";
4
4
  import { SbbCalendarCellBaseElement as o } from "./calendar/common/calendar-cell-base-element.js";
5
5
  //#region src/elements/calendar/calendar-day/calendar-day.scss?inline
6
- var s = ":host{--sbb-calendar-day-value-height: var(--sbb-spacing-fixed-6x)}.sbb-calendar-day{flex-direction:column;justify-content:var(--sbb-calendar-cell-justify-content);height:var(--sbb-calendar-day-height);width:var(--sbb-calendar-day-width);padding:var(--sbb-calendar-cell-padding)}.sbb-calendar-day__value{height:var(--sbb-calendar-day-value-height)}:host(:is(:state(crossed-out),[state--crossed-out])) .sbb-calendar-day__value:after{content:\"\";height:var(--sbb-calendar-cell-disabled-height);width:var(--sbb-calendar-cell-disabled-width);position:absolute;background-color:var(--sbb-calendar-cell-disabled-color);inset-block-start:var(--sbb-calendar-day-crossed-out-top);inset-inline-start:50%;transform:var(--sbb-calendar-day-crossed-out-translate)}.sbb-calendar-day__extra{display:var(--sbb-calendar-day-extra-display);height:var(--sbb-calendar-day-extra-height);padding:var(--sbb-calendar-cell-padding)}::slotted(*){height:var(--sbb-calendar-day-extra-height)}", c = (() => {
6
+ var s = ".sbb-calendar-day{justify-content:var(--sbb-calendar-day-justify-content)}.sbb-calendar-day__value{display:flex;height:var(--sbb-calendar-day-value-height);align-items:center;justify-content:center;position:relative}.sbb-calendar-day__extra{display:var(--sbb-calendar-day-extra-display);height:var(--sbb-calendar-day-extra-height)}::slotted(*){height:var(--sbb-calendar-day-extra-height)}", c = (() => {
7
7
  let c = o, l = [], u, d;
8
8
  return class extends c {
9
9
  constructor() {
@@ -74,7 +74,7 @@ var s = ":host{--sbb-calendar-day-value-height: var(--sbb-spacing-fixed-6x)}.sbb
74
74
  return this.closest?.("sbb-calendar") ?? this.getRootNode?.()?.host?.closest("sbb-calendar");
75
75
  }
76
76
  setSelectedState(e) {
77
- let t = e.multiple ? e.selected.some((e) => this.dateAdapter.sameDate(this.value, e)) : !!e.selected && this.dateAdapter.compareDate(this.value, e.selected) === 0;
77
+ let t = e.multiple ? e.value.some((e) => this.dateAdapter.sameDate(this.value, e)) : !!e.value && this.dateAdapter.compareDate(this.value, e.value) === 0;
78
78
  this.toggleState("selected", t), this.internals.ariaPressed = String(t);
79
79
  }
80
80
  setDisabledFilteredState(e) {