@skf-design-system/ui-components 1.0.1-beta.1 → 1.0.2-beta.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 (186) hide show
  1. package/README.md +1 -18
  2. package/dist/components/accordion/accordion.component.d.ts +4 -4
  3. package/dist/components/accordion/accordion.component.js +8 -8
  4. package/dist/components/alert/alert.component.d.ts +8 -9
  5. package/dist/components/alert/alert.component.js +7 -7
  6. package/dist/components/breadcrumb/breadcrumb.component.d.ts +1 -1
  7. package/dist/components/card/card.component.js +18 -30
  8. package/dist/components/card/card.styles.js +25 -28
  9. package/dist/components/checkbox/checkbox.component.d.ts +8 -8
  10. package/dist/components/checkbox/checkbox.component.js +3 -3
  11. package/dist/components/collapse/collapse.component.js +1 -1
  12. package/dist/components/date-picker/datepicker.calendar.component.d.ts +5 -0
  13. package/dist/components/date-picker/datepicker.calendar.component.js +128 -95
  14. package/dist/components/date-picker/datepicker.calendar.styles.js +35 -25
  15. package/dist/components/date-picker/datepicker.component.d.ts +5 -0
  16. package/dist/components/date-picker/datepicker.component.js +117 -97
  17. package/dist/components/date-picker/datepicker.helpers.d.ts +3 -2
  18. package/dist/components/date-picker/datepicker.helpers.js +46 -39
  19. package/dist/components/date-picker/datepicker.styles.js +14 -26
  20. package/dist/components/date-picker-input/datepicker-input.component.d.ts +13 -5
  21. package/dist/components/date-picker-input/datepicker-input.component.js +263 -219
  22. package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +36 -2
  23. package/dist/components/date-picker-input/datepicker-input.helpers.js +25 -23
  24. package/dist/components/date-picker-input/datepicker-input.styles.js +6 -10
  25. package/dist/components/dialog/dialog.component.d.ts +18 -28
  26. package/dist/components/dialog/dialog.component.js +89 -79
  27. package/dist/components/divider/divider.component.d.ts +4 -8
  28. package/dist/components/divider/divider.component.js +24 -46
  29. package/dist/components/divider/divider.styles.js +34 -30
  30. package/dist/components/drawer/drawer.component.d.ts +57 -0
  31. package/dist/components/drawer/drawer.component.js +124 -0
  32. package/dist/components/drawer/drawer.d.ts +8 -0
  33. package/dist/components/drawer/drawer.js +6 -0
  34. package/dist/components/drawer/drawer.styles.d.ts +1 -0
  35. package/dist/components/drawer/drawer.styles.js +71 -0
  36. package/dist/components/header/header.component.d.ts +45 -0
  37. package/dist/components/header/header.component.js +110 -0
  38. package/dist/components/header/header.d.ts +8 -0
  39. package/dist/components/header/header.js +6 -0
  40. package/dist/components/header/header.styles.d.ts +1 -0
  41. package/dist/components/header/header.styles.js +68 -0
  42. package/dist/components/heading/heading.component.d.ts +6 -12
  43. package/dist/components/heading/heading.component.js +11 -11
  44. package/dist/components/heading/heading.styles.d.ts +1 -2
  45. package/dist/components/heading/heading.styles.js +1 -1
  46. package/dist/components/icon/icon.component.d.ts +1 -1
  47. package/dist/components/input/input.component.d.ts +2 -2
  48. package/dist/components/input/input.component.js +3 -3
  49. package/dist/components/input/input.controllers.d.ts +20 -6
  50. package/dist/components/input/input.controllers.js +14 -10
  51. package/dist/components/link/link.component.js +1 -0
  52. package/dist/components/link/link.styles.js +24 -20
  53. package/dist/components/menu/menu.component.d.ts +4 -5
  54. package/dist/components/menu/menu.component.js +1 -1
  55. package/dist/components/nav/nav.component.d.ts +17 -0
  56. package/dist/components/nav/nav.component.js +34 -0
  57. package/dist/components/nav/nav.d.ts +8 -0
  58. package/dist/components/nav/nav.js +6 -0
  59. package/dist/components/nav/nav.styles.d.ts +1 -0
  60. package/dist/components/nav/nav.styles.js +17 -0
  61. package/dist/components/nav-item/nav-item.component.d.ts +20 -0
  62. package/dist/components/nav-item/nav-item.component.js +38 -0
  63. package/dist/components/nav-item/nav-item.d.ts +8 -0
  64. package/dist/components/nav-item/nav-item.js +6 -0
  65. package/dist/components/nav-item/nav-item.styles.d.ts +1 -0
  66. package/dist/components/nav-item/nav-item.styles.js +39 -0
  67. package/dist/components/popover/popover.component.d.ts +5 -6
  68. package/dist/components/popover/popover.component.js +19 -19
  69. package/dist/components/radio/radio.component.d.ts +10 -6
  70. package/dist/components/radio/radio.component.js +10 -10
  71. package/dist/components/radio/radio.styles.d.ts +1 -2
  72. package/dist/components/radio/radio.styles.js +1 -1
  73. package/dist/components/segmented-button/segmented-button.component.d.ts +32 -0
  74. package/dist/components/segmented-button/segmented-button.d.ts +8 -0
  75. package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
  76. package/dist/components/segmented-button-item/segmented-button-item.component.d.ts +36 -0
  77. package/dist/components/segmented-button-item/segmented-button-item.d.ts +8 -0
  78. package/dist/components/segmented-button-item/segmented-button-item.styles.d.ts +1 -0
  79. package/dist/components/select/select.component.js +2 -2
  80. package/dist/components/select/select.controllers.d.ts +20 -9
  81. package/dist/components/select/select.controllers.js +27 -22
  82. package/dist/components/select-option/select-option.controllers.d.ts +11 -5
  83. package/dist/components/stepper/stepper.component.d.ts +2 -1
  84. package/dist/components/stepper-item/stepper-item.component.js +2 -2
  85. package/dist/components/switch/switch.component.d.ts +7 -6
  86. package/dist/components/switch/switch.component.js +7 -7
  87. package/dist/components/tag/tag.component.d.ts +4 -2
  88. package/dist/components/tag/tag.component.js +6 -6
  89. package/dist/components/textarea/textarea.component.js +7 -7
  90. package/dist/components/toast/toast.component.d.ts +1 -1
  91. package/dist/components/tooltip/tooltip.component.d.ts +5 -6
  92. package/dist/components/tooltip/tooltip.component.js +11 -11
  93. package/dist/custom-elements.json +2477 -1745
  94. package/dist/index.d.ts +4 -0
  95. package/dist/index.js +82 -70
  96. package/dist/internal/base-classes/popover/popover.base.d.ts +17 -7
  97. package/dist/internal/base-classes/popover/popover.base.js +119 -75
  98. package/dist/internal/base-classes/popover/popover.styles.js +14 -1
  99. package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
  100. package/dist/internal/controllers/popover.controller.d.ts +12 -7
  101. package/dist/internal/controllers/popover.controller.js +9 -14
  102. package/dist/internal/helpers/utilityTypes.d.ts +1 -1
  103. package/dist/internal/helpers/uuid.d.ts +15 -0
  104. package/dist/internal/helpers/uuid.js +14 -0
  105. package/dist/internal/storybook/styles.d.ts +1 -0
  106. package/dist/styles/form-field.styles.js +11 -6
  107. package/dist/styles/global.css +1 -1
  108. package/dist/types/jsx/custom-element-jsx.d.ts +642 -1261
  109. package/dist/types/vue/index.d.ts +422 -267
  110. package/dist/vscode.html-custom-data.json +805 -525
  111. package/dist/web-types.json +928 -653
  112. package/package.json +41 -51
  113. package/dist/react/index.d.ts +0 -36
  114. package/dist/react/index.js +0 -36
  115. package/dist/react/skf-accordion/index.d.ts +0 -3
  116. package/dist/react/skf-accordion/index.js +0 -13
  117. package/dist/react/skf-alert/index.d.ts +0 -9
  118. package/dist/react/skf-alert/index.js +0 -17
  119. package/dist/react/skf-breadcrumb/index.d.ts +0 -9
  120. package/dist/react/skf-breadcrumb/index.js +0 -17
  121. package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
  122. package/dist/react/skf-breadcrumb-item/index.js +0 -13
  123. package/dist/react/skf-button/index.d.ts +0 -9
  124. package/dist/react/skf-button/index.js +0 -17
  125. package/dist/react/skf-card/index.d.ts +0 -3
  126. package/dist/react/skf-card/index.js +0 -13
  127. package/dist/react/skf-checkbox/index.d.ts +0 -9
  128. package/dist/react/skf-checkbox/index.js +0 -17
  129. package/dist/react/skf-collapse/index.d.ts +0 -9
  130. package/dist/react/skf-collapse/index.js +0 -17
  131. package/dist/react/skf-datepicker/index.d.ts +0 -12
  132. package/dist/react/skf-datepicker/index.js +0 -18
  133. package/dist/react/skf-dialog/index.d.ts +0 -15
  134. package/dist/react/skf-dialog/index.js +0 -19
  135. package/dist/react/skf-divider/index.d.ts +0 -3
  136. package/dist/react/skf-divider/index.js +0 -13
  137. package/dist/react/skf-heading/index.d.ts +0 -3
  138. package/dist/react/skf-heading/index.js +0 -13
  139. package/dist/react/skf-icon/index.d.ts +0 -3
  140. package/dist/react/skf-icon/index.js +0 -13
  141. package/dist/react/skf-input/index.d.ts +0 -12
  142. package/dist/react/skf-input/index.js +0 -18
  143. package/dist/react/skf-link/index.d.ts +0 -3
  144. package/dist/react/skf-link/index.js +0 -13
  145. package/dist/react/skf-loader/index.d.ts +0 -3
  146. package/dist/react/skf-loader/index.js +0 -13
  147. package/dist/react/skf-logo/index.d.ts +0 -3
  148. package/dist/react/skf-logo/index.js +0 -13
  149. package/dist/react/skf-menu/index.d.ts +0 -12
  150. package/dist/react/skf-menu/index.js +0 -18
  151. package/dist/react/skf-menu-item/index.d.ts +0 -27
  152. package/dist/react/skf-menu-item/index.js +0 -23
  153. package/dist/react/skf-popover/index.d.ts +0 -12
  154. package/dist/react/skf-popover/index.js +0 -18
  155. package/dist/react/skf-progress/index.d.ts +0 -3
  156. package/dist/react/skf-progress/index.js +0 -13
  157. package/dist/react/skf-radio/index.d.ts +0 -9
  158. package/dist/react/skf-radio/index.js +0 -17
  159. package/dist/react/skf-select/index.d.ts +0 -21
  160. package/dist/react/skf-select/index.js +0 -21
  161. package/dist/react/skf-select-option/index.d.ts +0 -9
  162. package/dist/react/skf-select-option/index.js +0 -17
  163. package/dist/react/skf-select-option-group/index.d.ts +0 -3
  164. package/dist/react/skf-select-option-group/index.js +0 -13
  165. package/dist/react/skf-stepper/index.d.ts +0 -9
  166. package/dist/react/skf-stepper/index.js +0 -17
  167. package/dist/react/skf-stepper-item/index.d.ts +0 -9
  168. package/dist/react/skf-stepper-item/index.js +0 -17
  169. package/dist/react/skf-switch/index.d.ts +0 -3
  170. package/dist/react/skf-switch/index.js +0 -13
  171. package/dist/react/skf-tab/index.d.ts +0 -12
  172. package/dist/react/skf-tab/index.js +0 -18
  173. package/dist/react/skf-tab-group/index.d.ts +0 -3
  174. package/dist/react/skf-tab-group/index.js +0 -13
  175. package/dist/react/skf-tab-panel/index.d.ts +0 -3
  176. package/dist/react/skf-tab-panel/index.js +0 -13
  177. package/dist/react/skf-tag/index.d.ts +0 -3
  178. package/dist/react/skf-tag/index.js +0 -13
  179. package/dist/react/skf-textarea/index.d.ts +0 -12
  180. package/dist/react/skf-textarea/index.js +0 -18
  181. package/dist/react/skf-toast/index.d.ts +0 -3
  182. package/dist/react/skf-toast/index.js +0 -13
  183. package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
  184. package/dist/react/skf-toast-wrapper/index.js +0 -13
  185. package/dist/react/skf-tooltip/index.d.ts +0 -12
  186. package/dist/react/skf-tooltip/index.js +0 -18
@@ -1,31 +1,63 @@
1
- import { dateFormatter as c } from "../date-picker-input/datepicker-input.helpers.js";
2
- import { compareDates as y } from "./datepicker.helpers.js";
3
- import { SkfElement as _ } from "../../internal/components/skf-element.js";
4
- import { watch as S } from "../../internal/helpers/watch.js";
5
- import { Temporal as l } from "@js-temporal/polyfill";
6
- import $ from "../../styles/component.styles.js";
7
- import { html as u } from "lit";
8
- import { property as o, state as b } from "lit/decorators.js";
9
- import { repeat as D } from "lit/directives/repeat.js";
10
- import { styles as M } from "./datepicker.calendar.styles.js";
11
- var O = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (h, t, e, a) => {
12
- for (var s = a > 1 ? void 0 : a ? w(t, e) : t, i = h.length - 1, d; i >= 0; i--)
13
- (d = h[i]) && (s = (a ? d(t, e, s) : d(s)) || s);
14
- return a && s && O(t, e, s), s;
1
+ import { dateFormatter as y } from "../date-picker-input/datepicker-input.helpers.js";
2
+ import { compareDates as $ } from "./datepicker.helpers.js";
3
+ import { SkfElement as O } from "../../internal/components/skf-element.js";
4
+ import { watch as R } from "../../internal/helpers/watch.js";
5
+ import { Temporal as m } from "@js-temporal/polyfill";
6
+ import C from "../../styles/component.styles.js";
7
+ import { html as p } from "lit";
8
+ import { property as g, state as M } from "lit/decorators.js";
9
+ import { repeat as w } from "lit/directives/repeat.js";
10
+ import { styles as F } from "./datepicker.calendar.styles.js";
11
+ var A = Object.defineProperty, P = Object.getOwnPropertyDescriptor, d = (D, t, e, a) => {
12
+ for (var s = a > 1 ? void 0 : a ? P(t, e) : t, i = D.length - 1, h; i >= 0; i--)
13
+ (h = D[i]) && (s = (a ? h(t, e, s) : h(s)) || s);
14
+ return a && s && A(t, e, s), s;
15
15
  };
16
- const g = class g extends _ {
16
+ const E = class E extends O {
17
17
  constructor() {
18
18
  super(...arguments), this._secondCalendarOffset = 0, this.date = /* @__PURE__ */ new Date(), this.firstDayOfWeek = 0, this.locale = "en-CA", this.range = !1, this.selectedDate = void 0, this.selectedDateRange = {
19
19
  start: null,
20
20
  end: null
21
- }, this._numberOfDays = 0, this._numberOfDaysLastMonth = 0, this.dateSelectable = (t) => {
22
- var d;
23
- const e = (d = this.invalidDates) == null ? void 0 : d.split(",").includes(t), a = !this.selectableTo || y(t, this.selectableTo) < 0, s = !this.selectableFrom || y(t, this.selectableFrom) > 0;
21
+ }, this._numberOfDays = 0, this._numberOfDaysLastMonth = 0, this._listenToKeyboard = () => ({
22
+ start: () => {
23
+ this.addEventListener("keydown", this._handleKeyDown);
24
+ },
25
+ stop: () => {
26
+ this.removeEventListener("keydown", this._handleKeyDown);
27
+ }
28
+ }), this._handleKeyDown = (t) => {
29
+ var s, i, h, v, _, S, b;
30
+ const { key: e } = t;
31
+ if ((e === "ArrowRight" || e === "ArrowLeft" || e === "ArrowDown" || e === "ArrowUp") && t.preventDefault(), e === "ArrowRight") {
32
+ const n = (s = this.shadowRoot) == null ? void 0 : s.activeElement, r = n == null ? void 0 : n.parentElement, c = r == null ? void 0 : r.nextElementSibling, l = c == null ? void 0 : c.firstElementChild;
33
+ l == null || l.focus();
34
+ }
35
+ if (e === "ArrowLeft") {
36
+ const n = (i = this.shadowRoot) == null ? void 0 : i.activeElement, r = n == null ? void 0 : n.parentElement, c = r == null ? void 0 : r.previousElementSibling, l = c == null ? void 0 : c.firstElementChild;
37
+ l == null || l.focus();
38
+ }
39
+ if (e === "ArrowDown") {
40
+ const n = (h = this.shadowRoot) == null ? void 0 : h.activeElement, r = n == null ? void 0 : n.parentElement, c = a(r), l = (v = r == null ? void 0 : r.parentElement) == null ? void 0 : v.children[c + 7], f = l == null ? void 0 : l.firstElementChild;
41
+ f == null || f.focus();
42
+ }
43
+ if (e === "ArrowUp") {
44
+ const n = (_ = this.shadowRoot) == null ? void 0 : _.activeElement, r = n == null ? void 0 : n.parentElement;
45
+ if (!r) return;
46
+ const c = Array.from(((S = r.parentElement) == null ? void 0 : S.children) ?? []).indexOf(r), l = (b = r.parentElement) == null ? void 0 : b.children[c - 7], f = l == null ? void 0 : l.firstElementChild;
47
+ f == null || f.focus();
48
+ }
49
+ function a(u) {
50
+ var n;
51
+ return u ? Array.from(((n = u.parentElement) == null ? void 0 : n.children) ?? []).indexOf(u) : 0;
52
+ }
53
+ }, this.dateSelectable = (t) => {
54
+ var h;
55
+ const e = (h = this.invalidDates) == null ? void 0 : h.split(",").includes(t), a = !this.selectableTo || $(t, this.selectableTo) < 0, s = !this.selectableFrom || $(t, this.selectableFrom) > 0;
24
56
  return { matchesInvalidDates: e, dateWithinRange: !(a && s) };
25
57
  };
26
58
  }
27
59
  firstUpdated() {
28
- this._secondCalendarOffset = this.id.endsWith("-range-end") ? -1 : 0;
60
+ this._secondCalendarOffset = this.id.endsWith("-range-end") ? -1 : 0, this.addEventListener("focusin", this._listenToKeyboard().start), this.addEventListener("focusout", this._listenToKeyboard().stop);
29
61
  }
30
62
  /** For single select, the selected date */
31
63
  attributeChangedCallback(t, e, a) {
@@ -48,7 +80,7 @@ const g = class g extends _ {
48
80
  }
49
81
  if (s)
50
82
  try {
51
- return l.PlainDate.from({
83
+ return m.PlainDate.from({
52
84
  year: t,
53
85
  month: e + 1,
54
86
  day: a
@@ -68,7 +100,7 @@ const g = class g extends _ {
68
100
  day: t.getDate()
69
101
  };
70
102
  try {
71
- return l.PlainDate.from(e);
103
+ return m.PlainDate.from(e);
72
104
  } catch (a) {
73
105
  return console.log(e), console.error("error", a), null;
74
106
  }
@@ -76,19 +108,19 @@ const g = class g extends _ {
76
108
  /** @internal Check if a day is between two dates */
77
109
  _isDateBetween(t, e, a) {
78
110
  if (!e || !a) return !1;
79
- const s = l.PlainDate.compare(t, e) > 0, i = l.PlainDate.compare(t, a) < 0;
111
+ const s = m.PlainDate.compare(t, e) > 0, i = m.PlainDate.compare(t, a) < 0;
80
112
  return s && i;
81
113
  }
82
114
  render() {
83
- return u`
115
+ return p`
84
116
  ${this.getCalendarHead()}
85
117
 
86
118
  <!-- weekdays -->
87
119
  <ul class="weekdays grid">
88
- ${D(
120
+ ${w(
89
121
  Array.from({ length: 7 }, (t, e) => e),
90
122
  (t) => t,
91
- (t) => u`<li>
123
+ (t) => p`<li>
92
124
  ${new Intl.DateTimeFormat(this.locale, {
93
125
  weekday: "short"
94
126
  }).format(new Date(2018, 0, t)).slice(0, 2)}
@@ -101,12 +133,12 @@ const g = class g extends _ {
101
133
  <!-- previous month -->
102
134
  ${this.getCalendarPreMonthDays()}
103
135
  <!-- current days -->
104
- ${D(
136
+ ${w(
105
137
  Array.from({ length: this._numberOfDays }, (t, e) => e + 1),
106
138
  (t) => t,
107
139
  (t) => {
108
140
  const e = this._createDate({ day: t }, !0).toString(), a = this.returnDayClasses(t);
109
- return u`<li>
141
+ return p`<li>
110
142
  <button
111
143
  class="day ${a}"
112
144
  data-date=${e}
@@ -137,19 +169,19 @@ const g = class g extends _ {
137
169
  }
138
170
  /** @internal */
139
171
  returnDayClasses(t) {
140
- var m, p, f;
141
- const e = [], a = this._createDate({ day: t }).getDate(), s = ((m = this.selectedDate) == null ? void 0 : m.getMonth()) === this.date.getMonth();
172
+ var b, u, n, r;
173
+ const e = [], a = this._createDate({ day: t }).getDate(), s = ((b = this.selectedDate) == null ? void 0 : b.getMonth()) === this.date.getMonth(), i = ((u = this.selectedDate) == null ? void 0 : u.getFullYear()) === this.date.getFullYear();
142
174
  this.range && this._isDateBetween(
143
175
  this._createDate({ day: t }, !0),
144
176
  this._plainDate(this.selectedDateRange.start) ?? void 0,
145
177
  this._plainDate(this.selectedDateRange.end) ?? void 0
146
- ) && e.push("in-range"), this.range && this.selectedDateRange.start && (this.selectedDateRange.start.getMonth() === this.date.getMonth() && this.selectedDateRange.start.getDate() === a && e.push("selected selected-start"), ((p = this.selectedDateRange.end) == null ? void 0 : p.getMonth()) === this.date.getMonth() && this.selectedDateRange.end.getDate() === a && e.push("selected selected-end"));
147
- const { matchesInvalidDates: i, dateWithinRange: d } = this.dateSelectable(
178
+ ) && e.push("in-range"), this.range && this.selectedDateRange.start && (this.selectedDateRange.start.getFullYear() === this.date.getFullYear() && this.selectedDateRange.start.getMonth() === this.date.getMonth() && this.selectedDateRange.start.getDate() === a && e.push("selected selected-start"), ((n = this.selectedDateRange.end) == null ? void 0 : n.getFullYear()) === this.date.getFullYear() && this.selectedDateRange.end.getMonth() === this.date.getMonth() && this.selectedDateRange.end.getDate() === a && e.push("selected selected-end"));
179
+ const { matchesInvalidDates: h, dateWithinRange: v } = this.dateSelectable(
148
180
  this._createDate({ day: t }, !0).toString()
149
181
  );
150
- (i || d) && e.push("invalid");
151
- const v = ((f = this.selectedDate) == null ? void 0 : f.getDate()) === a;
152
- return !this.range && v && s && (console.log("is single date selected", this.selectedDate), e.push("selected")), this._createDate({ day: t }, !0).equals(String(this._plainDate(/* @__PURE__ */ new Date()))) && e.push("today"), e.join(" ");
182
+ (h || v) && e.push("invalid");
183
+ const _ = ((r = this.selectedDate) == null ? void 0 : r.getDate()) === a;
184
+ return !this.range && _ && s && i && (console.log("is single date selected", this.selectedDate), e.push("selected")), this._createDate({ day: t }, !0).equals(String(this._plainDate(/* @__PURE__ */ new Date()))) && e.push("today"), e.join(" ");
153
185
  }
154
186
  /** @internal */
155
187
  handleSelectDay({
@@ -166,7 +198,7 @@ const g = class g extends _ {
166
198
  }
167
199
  /** @internal */
168
200
  getCalendarPreMonthDays() {
169
- return D(
201
+ return w(
170
202
  Array.from(
171
203
  {
172
204
  length: this.getCalendarStartDay().getDay()
@@ -183,7 +215,7 @@ const g = class g extends _ {
183
215
  },
184
216
  !0
185
217
  ).toString(), { matchesInvalidDates: s, dateWithinRange: i } = this.dateSelectable(a);
186
- return (s || i) && e.push("invalid"), u`<li class="day ">
218
+ return (s || i) && e.push("invalid"), p`<li class="day ">
187
219
  <button
188
220
  class=${e.join(" ")}
189
221
  data-date=${a}
@@ -192,7 +224,7 @@ const g = class g extends _ {
192
224
  month: this.date.getMonth() - 1,
193
225
  day: t
194
226
  }), this.emit("update-calendar-view", {
195
- detail: l.PlainDate.from(c(this.date)).subtract({ months: 1 }).toString()
227
+ detail: m.PlainDate.from(y(this.date)).subtract({ months: 1 }).toString()
196
228
  });
197
229
  }}"
198
230
  ?disabled=${e.includes("invalid")}
@@ -205,7 +237,7 @@ const g = class g extends _ {
205
237
  }
206
238
  /** @internal */
207
239
  getCalendarRemaningDays() {
208
- return (this._numberOfDays + this.calendarMonthStartsOn()) % 7 === 0 ? "" : D(
240
+ return (this._numberOfDays + this.calendarMonthStartsOn()) % 7 === 0 ? "" : w(
209
241
  Array.from(
210
242
  {
211
243
  length: 7 - this._createDate({
@@ -226,7 +258,7 @@ const g = class g extends _ {
226
258
  },
227
259
  !0
228
260
  ).toString(), { matchesInvalidDates: s, dateWithinRange: i } = this.dateSelectable(a);
229
- return (s || i) && e.push("invalid"), u`<li class="day">
261
+ return (s || i) && e.push("invalid"), p`<li class="day">
230
262
  <button
231
263
  data-date=${a}
232
264
  class=${e.join(" ")}
@@ -235,7 +267,7 @@ const g = class g extends _ {
235
267
  month: this.date.getMonth() + 1,
236
268
  day: t + 1
237
269
  }), this.emit("update-calendar-view", {
238
- detail: l.PlainDate.from(c(this.date)).add({ months: 1 }).toString()
270
+ detail: m.PlainDate.from(y(this.date)).add({ months: 1 }).toString()
239
271
  });
240
272
  }}"
241
273
  ?disabled=${e.includes("invalid")}
@@ -264,16 +296,16 @@ const g = class g extends _ {
264
296
  }
265
297
  /** @internal */
266
298
  getCalendarHead() {
267
- return u` <div class="calendar-head">
299
+ return p` <div class="calendar-head">
268
300
  <div
269
- class="calendar-head__controls${this.range && this.classList.contains("end") ? " hide" : ""}"
301
+ class="calendar-head-controls${this.range && this.classList.contains("end") ? " hide" : ""}"
270
302
  >
271
303
  <button
272
304
  aria-label="Previous year"
273
305
  title="Previous year"
274
306
  @click="${() => {
275
307
  this.emit("update-calendar-view", {
276
- detail: l.PlainDate.from(c(this.date)).subtract({ years: 1 }).toString()
308
+ detail: m.PlainDate.from(y(this.date)).subtract({ years: 1 }).toString()
277
309
  });
278
310
  }}"
279
311
  >
@@ -284,7 +316,7 @@ const g = class g extends _ {
284
316
  title="Previous month"
285
317
  @click="${() => {
286
318
  this.emit("update-calendar-view", {
287
- detail: l.PlainDate.from(c(this.date)).subtract({ months: 1 }).toString()
319
+ detail: m.PlainDate.from(y(this.date)).subtract({ months: 1 }).toString()
288
320
  });
289
321
  }}"
290
322
  >
@@ -292,17 +324,18 @@ const g = class g extends _ {
292
324
  </button>
293
325
  </div>
294
326
  <h4>
295
- ${this.date.toLocaleString(this.locale, { month: "short" })} ${this.date.getFullYear()}
327
+ ${this.date.toLocaleString(this.locale, { month: "short" })}
328
+ ${this.range && this.classList.contains("start") ? p` -&nbsp;` : this.date.getFullYear()}
296
329
  </h4>
297
330
  <div
298
- class="calendar-head__controls${this.range && this.classList.contains("start") ? " hide" : ""}"
331
+ class="calendar-head-controls${this.range && this.classList.contains("start") ? " hide" : ""}"
299
332
  >
300
333
  <button
301
334
  aria-label="Next month"
302
335
  title="Next month"
303
336
  @click="${() => {
304
337
  this.emit("update-calendar-view", {
305
- detail: l.PlainDate.from(c(this.date)).add({ months: 1 + this._secondCalendarOffset }).toString()
338
+ detail: m.PlainDate.from(y(this.date)).add({ months: 1 + this._secondCalendarOffset }).toString()
306
339
  });
307
340
  }}"
308
341
  >
@@ -313,7 +346,7 @@ const g = class g extends _ {
313
346
  title="Next year"
314
347
  @click="${() => {
315
348
  this.emit("update-calendar-view", {
316
- detail: l.PlainDate.from(c(this.date)).add({ months: 12 + this._secondCalendarOffset }).toString()
349
+ detail: m.PlainDate.from(y(this.date)).add({ months: 12 + this._secondCalendarOffset }).toString()
317
350
  });
318
351
  }}"
319
352
  >
@@ -323,60 +356,60 @@ const g = class g extends _ {
323
356
  </div>`;
324
357
  }
325
358
  };
326
- g.styles = [$, M];
327
- let r = g;
328
- n([
329
- o({
359
+ E.styles = [C, F];
360
+ let o = E;
361
+ d([
362
+ g({
330
363
  converter: {
331
- fromAttribute(h) {
332
- return console.log("value", typeof h), new Date(h);
364
+ fromAttribute(D) {
365
+ return console.log("value", typeof D), new Date(D);
333
366
  },
334
- toAttribute(h) {
335
- return h.toISOString();
367
+ toAttribute(D) {
368
+ return D.toISOString();
336
369
  }
337
370
  }
338
371
  })
339
- ], r.prototype, "date", 2);
340
- n([
341
- o()
342
- ], r.prototype, "eventid", 2);
343
- n([
344
- o({ type: Number })
345
- ], r.prototype, "firstDayOfWeek", 2);
346
- n([
347
- o({ reflect: !0, attribute: "invalid-dates" })
348
- ], r.prototype, "invalidDates", 2);
349
- n([
350
- o({ reflect: !0 })
351
- ], r.prototype, "locale", 2);
352
- n([
353
- o({ type: Boolean })
354
- ], r.prototype, "range", 2);
355
- n([
356
- o({ attribute: "selectable-from" })
357
- ], r.prototype, "selectableFrom", 2);
358
- n([
359
- o({ attribute: "selectable-to" })
360
- ], r.prototype, "selectableTo", 2);
361
- n([
362
- o({
372
+ ], o.prototype, "date", 2);
373
+ d([
374
+ g()
375
+ ], o.prototype, "eventid", 2);
376
+ d([
377
+ g({ type: Number })
378
+ ], o.prototype, "firstDayOfWeek", 2);
379
+ d([
380
+ g({ reflect: !0, attribute: "invalid-dates" })
381
+ ], o.prototype, "invalidDates", 2);
382
+ d([
383
+ g({ reflect: !0 })
384
+ ], o.prototype, "locale", 2);
385
+ d([
386
+ g({ type: Boolean })
387
+ ], o.prototype, "range", 2);
388
+ d([
389
+ g({ attribute: "selectable-from" })
390
+ ], o.prototype, "selectableFrom", 2);
391
+ d([
392
+ g({ attribute: "selectable-to" })
393
+ ], o.prototype, "selectableTo", 2);
394
+ d([
395
+ g({
363
396
  attribute: "selected-date",
364
- converter: { fromAttribute: (h) => new Date(h) },
397
+ converter: { fromAttribute: (D) => new Date(D) },
365
398
  reflect: !0
366
399
  })
367
- ], r.prototype, "selectedDate", 2);
368
- n([
369
- o({ type: Object })
370
- ], r.prototype, "selectedDateRange", 2);
371
- n([
372
- b()
373
- ], r.prototype, "_numberOfDays", 2);
374
- n([
375
- b()
376
- ], r.prototype, "_numberOfDaysLastMonth", 2);
377
- n([
378
- S("date")
379
- ], r.prototype, "handleDateChange", 1);
400
+ ], o.prototype, "selectedDate", 2);
401
+ d([
402
+ g({ type: Object })
403
+ ], o.prototype, "selectedDateRange", 2);
404
+ d([
405
+ M()
406
+ ], o.prototype, "_numberOfDays", 2);
407
+ d([
408
+ M()
409
+ ], o.prototype, "_numberOfDaysLastMonth", 2);
410
+ d([
411
+ R("date")
412
+ ], o.prototype, "handleDateChange", 1);
380
413
  export {
381
- r as SkfDatePickerCalendar
414
+ o as SkfDatePickerCalendar
382
415
  };
@@ -1,10 +1,11 @@
1
1
  import { css as e } from "lit";
2
- const r = e`
2
+ const o = e`
3
3
  @layer components {
4
4
  :host {
5
5
  box-sizing: inherit;
6
6
  contain: layout;
7
7
  display: block;
8
+ position: relative;
8
9
  width: 100%;
9
10
  }
10
11
 
@@ -21,7 +22,7 @@ const r = e`
21
22
  }
22
23
 
23
24
  h4 {
24
- color: var(--title-fg);
25
+ color: var(--skf-bg-color-neutral-7);
25
26
  font-size: 1.2em;
26
27
  margin: 0;
27
28
  padding: 0;
@@ -29,7 +30,7 @@ const r = e`
29
30
  }
30
31
 
31
32
  .weekdays > li {
32
- color: var(--weekday-fg);
33
+ color: var(--skf-text-color-primary);
33
34
  display: grid;
34
35
  font-size: 1.2em;
35
36
  margin-block: 1em 0.5em;
@@ -42,7 +43,7 @@ const r = e`
42
43
  border-radius: 0.2em;
43
44
  display: grid;
44
45
  min-width: 2.5em;
45
- outline: 1px solid var(--day-outline);
46
+ outline: 1px solid transparent;
46
47
  place-items: center;
47
48
 
48
49
  & button {
@@ -60,22 +61,22 @@ const r = e`
60
61
 
61
62
  &:focus-visible {
62
63
  border-radius: 0.2em;
63
- outline: 2px solid #469;
64
+ outline: 2px solid #469; /* TODO: token? */
64
65
  outline-offset: 2px;
65
66
  }
66
67
 
67
68
  &.today {
68
- background-color: var(--today);
69
- color: var(--today-fg);
69
+ background-color: var(--skf-bg-color-neutral-3);
70
+ color: var(--skf-bg-color-neutral-7);
70
71
  }
71
72
 
72
73
  &.in-range {
73
- background-color: var(--in-range-bg);
74
+ background-color: var(--skf-interactive-bg-color-secondary-hover);
74
75
  }
75
76
 
76
77
  &.selected {
77
- background-color: var(--selected-bg);
78
- color: var(--selected-fg);
78
+ background-color: var(--skf-interactive-bg-color-primary);
79
+ color: var(--skf-bg-color-neutral-1);
79
80
  }
80
81
 
81
82
  &.selected-start {
@@ -92,11 +93,11 @@ const r = e`
92
93
 
93
94
  &.prevmonth,
94
95
  &.nextmonth {
95
- color: var(--other-month-fg);
96
+ color: var(--skf-text-color-tertiary);
96
97
  }
97
98
 
98
99
  &:not(.selected):hover {
99
- background-color: var(--hover-bg);
100
+ background-color: var(--skf-interactive-bg-color-secondary-hover);
100
101
  transition-duration: 0s;
101
102
  }
102
103
 
@@ -116,30 +117,36 @@ const r = e`
116
117
  }
117
118
 
118
119
  .calendar-head {
119
- align-items: baseline;
120
+ align-items: center;
120
121
  display: flex;
121
122
  font-size: 1.2em;
122
123
  gap: 0;
123
- grid-template-columns: min-content auto min-content;
124
124
  justify-content: space-between;
125
- margin: 0 0 1em;
125
+ margin: 0;
126
126
  padding: 0;
127
- position: relative;
127
+
128
+ :host([class='end']) & {
129
+ transform: translateX(calc(var(--skf-spacing-50) * -1));
130
+ }
131
+
132
+ :host([class='start']) & {
133
+ transform: translateX(var(--skf-spacing-50));
134
+ }
128
135
 
129
136
  &::after {
130
- background-color: var(--border-color);
137
+ background-color: var(--skf-border-color-primary);
131
138
  bottom: -0.8em;
132
139
  content: '';
133
140
  display: block;
134
141
  grid-column: 1 / -1;
135
142
  height: 1px;
136
- left: 0;
137
- margin-inline: calc(var(--calendar-padding) * -1);
143
+ left: calc(var(--skf-spacing-50) * -1);
144
+ margin-inline: calc(var(--skf-spacing-50) * -2);
138
145
  position: absolute;
139
- right: 0;
146
+ right: calc(var(--skf-spacing-50) * -1);
140
147
  }
141
148
 
142
- & .calendar-head__controls {
149
+ & .calendar-head-controls {
143
150
  display: contents;
144
151
 
145
152
  &.hide {
@@ -148,7 +155,7 @@ const r = e`
148
155
  }
149
156
 
150
157
  & h4 {
151
- color: var(--title-fg);
158
+ color: var(--skf-bg-color-neutral-7);
152
159
  font-size: 1.2em;
153
160
  margin: 0;
154
161
  padding: 0;
@@ -156,15 +163,17 @@ const r = e`
156
163
  white-space: nowrap;
157
164
  }
158
165
 
166
+ /* stylelint-disable-next-line no-descending-specificity */
159
167
  & button {
160
168
  background-color: transparent;
161
169
  border: none;
162
- color: var(--button-control-fg);
170
+ color: var(--skf-text-color-primary);
163
171
  cursor: pointer;
164
172
  min-width: 1.5em;
165
173
  padding: 0.2em;
166
174
  text-align: center;
167
175
 
176
+ /* stylelint-disable-next-line no-descending-specificity */
168
177
  &:focus-visible {
169
178
  border-radius: 0.2em;
170
179
  outline: 2px solid #469;
@@ -175,8 +184,9 @@ const r = e`
175
184
  width: 1em;
176
185
  }
177
186
 
187
+ /* stylelint-disable-next-line no-descending-specificity */
178
188
  &:hover {
179
- color: var(--button-control-fg-hover);
189
+ color: var(--skf-interactive-bg-color-primary);
180
190
  }
181
191
  }
182
192
  }
@@ -188,5 +198,5 @@ const r = e`
188
198
  }
189
199
  `;
190
200
  export {
191
- r as styles
201
+ o as styles
192
202
  };
@@ -64,6 +64,11 @@ export declare class SkfDatePicker extends SkfElement {
64
64
  _handleSelectedDateChange(): void;
65
65
  /** @internal */
66
66
  _handleTodayClick: () => void;
67
+ /**
68
+ * Navigates to the given date.
69
+ * @param date - The date to navigate to, either a Date object or a string in the format 'yyyy-mm-dd'
70
+ */
71
+ gotoDate(date: Date | string): void;
67
72
  render(): import("lit").TemplateResult<1>;
68
73
  /** @internal */
69
74
  private _renderTodayBtn;