@cupra/ui-kit 2.0.0-canary.64 → 2.0.0-canary.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/components/ds-dialog/ds-dialog.cjs +11 -4
  2. package/dist/cjs/components/ds-slider/ds-slider.cjs +29 -29
  3. package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  4. package/dist/cjs/utils/IconsManager.cjs +1 -1
  5. package/dist/cjs/utils/PubSub.cjs +1 -1
  6. package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  7. package/dist/cjs/utils/cssWithTokens.cjs +1 -1
  8. package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
  9. package/dist/esm/components/ds-dialog/ds-dialog.js +38 -23
  10. package/dist/esm/components/ds-slider/ds-slider.js +116 -134
  11. package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  12. package/dist/esm/utils/IconsManager.js +1 -1
  13. package/dist/esm/utils/PubSub.js +1 -1
  14. package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  15. package/dist/esm/utils/cssWithTokens.js +1 -1
  16. package/dist/esm/utils/htmlWithTokens.js +1 -1
  17. package/dist/types/components/ds-dialog/ds-dialog.d.ts +3 -0
  18. package/dist/types/components/ds-dialog/ds-dialog.types.d.ts +2 -0
  19. package/dist/types/components/ds-slider/ds-slider.d.ts +8 -1
  20. package/dist-react/cjs/components/ds-dialog/ds-dialog.cjs +11 -4
  21. package/dist-react/cjs/components/ds-slider/ds-slider.cjs +29 -29
  22. package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  23. package/dist-react/cjs/utils/IconsManager.cjs +1 -1
  24. package/dist-react/cjs/utils/PubSub.cjs +1 -1
  25. package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  26. package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
  27. package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
  28. package/dist-react/esm/components/ds-dialog/ds-dialog.js +38 -23
  29. package/dist-react/esm/components/ds-slider/ds-slider.js +116 -134
  30. package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  31. package/dist-react/esm/utils/IconsManager.js +1 -1
  32. package/dist-react/esm/utils/PubSub.js +1 -1
  33. package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  34. package/dist-react/esm/utils/cssWithTokens.js +1 -1
  35. package/dist-react/esm/utils/htmlWithTokens.js +1 -1
  36. package/dist-react/types/components/ds-dialog/ds-dialog.d.ts +3 -0
  37. package/dist-react/types/components/ds-dialog/ds-dialog.types.d.ts +2 -0
  38. package/dist-react/types/components/ds-slider/ds-slider.d.ts +8 -1
  39. package/package.json +4 -1
@@ -1,11 +1,11 @@
1
- import { UiKitElement as $ } from "../base/UiKitElement.js";
2
- import { getStepValue as d } from "./utils/getStepValue/getStepValue.js";
3
- import { roundToDecimals as S } from "./utils/roundToDecimals/roundToDecimals.js";
1
+ import { UiKitElement as S } from "../base/UiKitElement.js";
2
+ import { getStepValue as x } from "./utils/getStepValue/getStepValue.js";
3
+ import { roundToDecimals as $ } from "./utils/roundToDecimals/roundToDecimals.js";
4
4
  import { customUiKitElement as V } from "../../decorators/customUiKitElement.js";
5
5
  import { ViewportMixin as _ } from "../../mixins/ViewportMixin.js";
6
6
  import { booleanConverter as T } from "../../utils/booleanConverter.js";
7
- import { formatNumber as L } from "../../utils/formatNumber/formatNumber.js";
8
- import { htmlWithTokens as P } from "../../utils/htmlWithTokens.js";
7
+ import { formatNumber as P } from "../../utils/formatNumber/formatNumber.js";
8
+ import { htmlWithTokens as L } from "../../utils/htmlWithTokens.js";
9
9
  import { objectConverter as D } from "../../utils/objectConverter.js";
10
10
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
11
11
  import { nothing as h, html as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
@@ -13,36 +13,26 @@ import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-
13
13
  import { property as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
14
14
  import { state as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
15
15
  import { query as k } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
16
- import { classMap as E } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
17
- import { live as F } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js";
18
- import { commonStyles as N, trackStyles as C, thumbStyles as I, currentValueStyles as R, rangeValueStyles as A } from "./styles/common.styles.js";
19
- var O = Object.defineProperty, U = Object.getOwnPropertyDescriptor, a = (t, e, i, n) => {
20
- for (var o = n > 1 ? void 0 : n ? U(e, i) : e, u = t.length - 1, m; u >= 0; u--)
21
- (m = t[u]) && (o = (n ? m(e, i, o) : m(o)) || o);
22
- return n && o && O(e, i, o), o;
16
+ import { classMap as R } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
17
+ import { live as E } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js";
18
+ import { commonStyles as I, trackStyles as F, thumbStyles as C, currentValueStyles as N, rangeValueStyles as A } from "./styles/common.styles.js";
19
+ var U = Object.defineProperty, B = Object.getOwnPropertyDescriptor, n = (t, e, i, a) => {
20
+ for (var o = a > 1 ? void 0 : a ? B(e, i) : e, u = t.length - 1, m; u >= 0; u--)
21
+ (m = t[u]) && (o = (a ? m(e, i, o) : m(o)) || o);
22
+ return a && o && U(e, i, o), o;
23
23
  };
24
- let s = class extends _($) {
24
+ let s = class extends _(S) {
25
25
  constructor() {
26
26
  super(...arguments), this.min = 0, this.max = 100, this.minLabel = "", this.maxLabel = "", this.step = 1, this.initialValueMin = 0, this.mode = "light", this.locale = void 0, this.localeMatcher = "lookup", this.useGrouping = !0, this.minimumIntegerDigits = 1, this.minimumFractionDigits = 0, this.maximumFractionDigits = 3, this.size = "medium", this.disabled = !1, this.keyboardMode = !1, this.getNewValue = (t) => {
27
- const { width: e, left: i } = this.track.getBoundingClientRect(), n = t.type.indexOf("mouse") !== -1 ? t.clientX : t.touches[0].clientX, u = Math.min(Math.max(0, n - i), e) * 100 / e;
28
- return this.min + u * (this.max - this.min) / 100;
27
+ const { width: e, left: i } = this.track.getBoundingClientRect(), a = this.thumbRadius, o = t.type.indexOf("mouse") !== -1 ? t.clientX : t.touches[0].clientX, u = e - a * 2, m = Math.min(Math.max(0, o - i - a), u), d = u > 0 ? m * 100 / u : 0;
28
+ return this.min + d * (this.max - this.min) / 100;
29
29
  }, this.setActiveThumb = (t) => {
30
30
  const e = this.getNewValue(t);
31
31
  typeof this._valueMax != "number" || e <= this._valueMin ? this.activeThumb = "min" : e >= this._valueMax ? this.activeThumb = "max" : e - this._valueMin < this._valueMax - e ? this.activeThumb = "min" : this.activeThumb = "max";
32
32
  }, this.handleMouseMove = (t) => {
33
33
  this.animationFrameRequest && cancelAnimationFrame(this.animationFrameRequest), this.animationFrameRequest = requestAnimationFrame(() => {
34
- const e = this.getNewValue(t), i = this.activeThumb ?? "min", { stepValue: n } = d({
35
- step: this.step,
36
- min: this.min,
37
- max: this.max,
38
- proposedValue: e,
39
- role: i,
40
- currentValues: {
41
- 1: this._valueMin,
42
- ...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
43
- }
44
- });
45
- this.handleChange({ value: n, role: i });
34
+ const e = this.getNewValue(t), i = this.activeThumb ?? "min", { stepValue: a } = this.computeStep({ proposedValue: e, role: i });
35
+ this.handleChange({ value: a, role: i });
46
36
  });
47
37
  }, this.handleMouseDown = (t) => {
48
38
  var e;
@@ -54,23 +44,13 @@ let s = class extends _($) {
54
44
  }, this.handlePointerOrMouseDown = () => {
55
45
  this.keyboardMode = !1;
56
46
  }, this.onInputFocus = (t, e) => {
57
- const i = t.currentTarget, n = e === 1 ? "min" : "max";
58
- this.editingField = n, i.type = "number", i.step = String(this.step ?? 1);
59
- const o = n === "min" ? this._valueMin : this._valueMax;
47
+ const i = t.currentTarget, a = this.getRoleById(e);
48
+ this.editingField = a, i.type = "number", i.step = String(this.step ?? 1);
49
+ const o = a === "min" ? this._valueMin : this._valueMax;
60
50
  i.value = String(o ?? ""), this.keyboardMode && i.classList.add("focus-visible");
61
51
  }, this.commitInputValue = (t, e) => {
62
- const i = t.currentTarget, n = e === 1 ? "min" : "max", { stepValue: o } = d({
63
- step: this.step,
64
- min: this.min,
65
- max: this.max,
66
- proposedValue: Number(i.value),
67
- role: n,
68
- currentValues: {
69
- 1: this._valueMin,
70
- ...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
71
- }
72
- });
73
- this.handleChange({ value: o, role: n }), this.isControlled(n) || (i.value = String(o));
52
+ const i = t.currentTarget, a = this.getRoleById(e), { stepValue: o } = this.computeStep({ proposedValue: Number(i.value), role: a });
53
+ this.handleChange({ value: o, role: a }), this.isControlled(a) || (i.value = String(o));
74
54
  }, this.onInputBlur = (t) => {
75
55
  var i;
76
56
  this.editingField = void 0;
@@ -81,18 +61,8 @@ let s = class extends _($) {
81
61
  }, this.onThumbKeyDown = (t, e) => {
82
62
  if (!this.disabled && (t.key === "ArrowLeft" || t.key === "ArrowRight")) {
83
63
  t.preventDefault();
84
- const i = this.step ?? 1, n = t.key === "ArrowLeft" ? -i : i, o = e === 1 ? "min" : "max", m = (o === "min" ? this._valueMin : this._valueMax) + n, { stepValue: b } = d({
85
- step: this.step,
86
- min: this.min,
87
- max: this.max,
88
- proposedValue: m,
89
- role: o,
90
- currentValues: {
91
- 1: this._valueMin,
92
- ...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
93
- }
94
- });
95
- this.handleChange({ value: b, role: o });
64
+ const i = this.step ?? 1, a = t.key === "ArrowLeft" ? -i : i, o = this.getRoleById(e), u = o === "min" ? this._valueMin : this._valueMax, { stepValue: m } = this.computeStep({ proposedValue: u + a, role: o });
65
+ this.handleChange({ value: m, role: o });
96
66
  }
97
67
  };
98
68
  }
@@ -102,6 +72,25 @@ let s = class extends _($) {
102
72
  isControlled(t) {
103
73
  return typeof (t === "min" ? this.valueMin : this.valueMax) == "number";
104
74
  }
75
+ getRoleById(t) {
76
+ return t === 1 ? "min" : "max";
77
+ }
78
+ get currentValues() {
79
+ return {
80
+ 1: this._valueMin,
81
+ ...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
82
+ };
83
+ }
84
+ computeStep({ proposedValue: t, role: e }) {
85
+ return x({
86
+ step: this.step,
87
+ min: this.min,
88
+ max: this.max,
89
+ proposedValue: t,
90
+ role: e,
91
+ currentValues: this.currentValues
92
+ });
93
+ }
105
94
  willUpdate(t) {
106
95
  super.willUpdate(t), typeof this.valueMin == "number" && (this._valueMin = this.valueMin), typeof this.valueMax == "number" && (this._valueMax = this.valueMax);
107
96
  }
@@ -113,17 +102,7 @@ let s = class extends _($) {
113
102
  if (this.isControlled(i)) return;
114
103
  const o = this[i === "min" ? "initialValueMin" : "initialValueMax"];
115
104
  if (typeof o != "number") return;
116
- const { stepValue: u } = d({
117
- step: this.step,
118
- min: this.min,
119
- max: this.max,
120
- proposedValue: o,
121
- role: i,
122
- currentValues: {
123
- 1: this._valueMin,
124
- ...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
125
- }
126
- });
105
+ const { stepValue: u } = this.computeStep({ proposedValue: o, role: i });
127
106
  this[i === "min" ? "_valueMin" : "_valueMax"] !== u && this.handleChange({ value: u, role: i });
128
107
  });
129
108
  }
@@ -131,9 +110,21 @@ let s = class extends _($) {
131
110
  const e = this.max - this.min;
132
111
  return e === 0 ? 0 : (t - this.min) / e * 100;
133
112
  }
113
+ get thumbRadius() {
114
+ var e;
115
+ const t = (e = this.renderRoot) == null ? void 0 : e.querySelector(".thumb");
116
+ return t ? t.offsetWidth / 2 : 0;
117
+ }
118
+ trackPosition(t) {
119
+ const e = s.THUMB_RADIUS_CSS_VAR;
120
+ return `calc(${e} + (100% - ${e} * 2) * ${t / 100})`;
121
+ }
122
+ trackWidth(t) {
123
+ return `calc((100% - ${s.THUMB_RADIUS_CSS_VAR} * 2) * ${t / 100})`;
124
+ }
134
125
  handleChange({ value: t, role: e }) {
135
- const i = S({ value: t, fractionDigits: this.maximumFractionDigits }), n = e === "min" ? "_valueMin" : "_valueMax";
136
- this[n] !== i && (this.isControlled(e) || (this[n] = i), this.dispatchEvent(
126
+ const i = $({ value: t, fractionDigits: this.maximumFractionDigits }), a = e === "min" ? "_valueMin" : "_valueMax";
127
+ this[a] !== i && (this.isControlled(e) || (this[a] = i), this.dispatchEvent(
137
128
  new CustomEvent("change", {
138
129
  bubbles: !0,
139
130
  composed: !0,
@@ -159,58 +150,48 @@ let s = class extends _($) {
159
150
  fractionSeparator: this.fractionSeparator,
160
151
  useGrouping: this.useGrouping
161
152
  };
162
- return L(e);
153
+ return P(e);
163
154
  }
164
155
  get rangeValuesTemplates() {
165
156
  const {
166
157
  formattedValue: t,
167
158
  unitSymbol: e,
168
159
  unitSymbolPosition: i
169
- } = this.formatNumber(this.min), n = this.unitSymbol ?? e, o = this.unitSymbolPosition ?? i, { formattedValue: u } = this.formatNumber(this.max);
160
+ } = this.formatNumber(this.min), a = this.unitSymbol ?? e, o = this.unitSymbolPosition ?? i, { formattedValue: u } = this.formatNumber(this.max);
170
161
  return l`
171
162
  <div class="range-value-text">
172
163
  ${this.minLabel ? l`<span class="range-value-label">${this.minLabel}</span>` : h}
173
- ${o === "left" ? l`<span>${n}</span>` : h}
164
+ ${o === "left" ? l`<span>${a}</span>` : h}
174
165
  <span>${t}</span>
175
- ${o === "right" ? l`<span>${n}</span>` : h}
166
+ ${o === "right" ? l`<span>${a}</span>` : h}
176
167
  </div>
177
168
  <div class="range-value-text">
178
169
  ${this.maxLabel ? l` <span class="range-value-label">${this.maxLabel}</span>` : h}
179
- ${o === "left" ? l`<span>${n}</span>` : h}
170
+ ${o === "left" ? l`<span>${a}</span>` : h}
180
171
  <span>${u}</span>
181
- ${o === "right" ? l`<span>${n}</span>` : h}
172
+ ${o === "right" ? l`<span>${a}</span>` : h}
182
173
  </div>
183
174
  `;
184
175
  }
185
176
  getThumbTemplate(t) {
186
- const e = t === 1 ? "min" : "max", i = e === "min" ? this._valueMin : this._valueMax, { minLimit: n, maxLimit: o } = d({
187
- step: this.step,
188
- min: this.min,
189
- max: this.max,
190
- proposedValue: i,
191
- role: e,
192
- currentValues: {
193
- 1: this._valueMin,
194
- ...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
195
- }
196
- }), u = this.getTrackPct(i);
177
+ const e = this.getRoleById(t), i = e === "min" ? this._valueMin : this._valueMax, { minLimit: a, maxLimit: o } = this.computeStep({ proposedValue: i, role: e }), u = this.getTrackPct(i);
197
178
  return l`
198
179
  <style>
199
180
  .thumb${t} {
200
- left: ${u}%;
181
+ left: ${this.trackPosition(u)};
201
182
  }
202
183
  </style>
203
184
  <div
204
185
  class="thumb${t} thumb"
205
186
  @focus=${() => {
206
- this.activeThumb = t === 1 ? "min" : "max";
187
+ this.activeThumb = e;
207
188
  }}
208
189
  @keydown=${(m) => this.onThumbKeyDown(m, t)}
209
190
  role="slider"
210
191
  tabindex=${this.disabled ? -1 : 0}
211
192
  aria-disabled=${String(!!this.disabled)}
212
193
  aria-label=${t === 1 ? "Minumum value" : "Maximum Value"}
213
- aria-valuemin=${n}
194
+ aria-valuemin=${a}
214
195
  aria-valuemax=${o}
215
196
  aria-valuenow=${i}
216
197
  >
@@ -232,29 +213,29 @@ let s = class extends _($) {
232
213
  `;
233
214
  }
234
215
  get trackRangeTemplate() {
235
- let t, e;
236
- return this.isRange ? (t = this.getTrackPct(this._valueMin), e = this.getTrackPct(this._valueMax) - t) : (t = 0, e = this.getTrackPct(this._valueMin)), l`
216
+ const t = this.getTrackPct(this._valueMin), e = this.isRange ? this.trackPosition(t) : "0px", i = this.isRange ? this.trackWidth(this.getTrackPct(this._valueMax) - t) : this.trackPosition(t);
217
+ return l`
237
218
  <style>
238
219
  .track-range {
239
- left: ${t}%;
240
- width: ${e}%;
220
+ left: ${e};
221
+ width: ${i};
241
222
  }
242
223
  </style>
243
224
  <div class="track-range" role="presentation"></div>
244
225
  `;
245
226
  }
246
227
  getInputTemplate(t) {
247
- const e = t === 1 ? "min" : "max", i = this.editingField === e, n = e === "min" ? this._valueMin : this._valueMax, {
228
+ const e = this.getRoleById(t), i = this.editingField === e, a = e === "min" ? this._valueMin : this._valueMax, {
248
229
  formattedValue: o,
249
230
  unitSymbol: u,
250
231
  unitSymbolPosition: m
251
- } = this.formatNumber(n), b = this.unitSymbolPosition ?? m, y = this.unitSymbol ?? u, g = y ? b === "left" ? `${y} ${o}` : `${o} ${y}` : `${o}`, f = i ? "number" : "text", v = i ? String(n ?? "") : g, M = t === 1 ? this.inputMinAriaLabel : this.inputMaxAriaLabel, x = this.isRange ? t === 1 ? "Start value" : "End value" : "Value", w = M ?? x;
232
+ } = this.formatNumber(a), d = this.unitSymbolPosition ?? m, b = this.unitSymbol ?? u, v = b ? d === "left" ? `${b} ${o}` : `${o} ${b}` : `${o}`, g = i ? "number" : "text", y = i ? String(a ?? "") : v, f = t === 1 ? this.inputMinAriaLabel : this.inputMaxAriaLabel, M = this.isRange ? t === 1 ? "Start value" : "End value" : "Value", w = f ?? M;
252
233
  return l`
253
234
  <div class="input-wrapper">
254
235
  <input
255
236
  class="input-value input-value-${t}"
256
- type=${f}
257
- .value=${F(v)}
237
+ type=${g}
238
+ .value=${E(y)}
258
239
  step=${String(this.step ?? 1)}
259
240
  ?disabled=${this.disabled}
260
241
  tabindex=${this.disabled ? -1 : 0}
@@ -265,7 +246,7 @@ let s = class extends _($) {
265
246
  @blur=${this.onInputBlur}
266
247
  @change=${(c) => this.commitInputValue(c, t)}
267
248
  @keydown=${(c) => this.onInputKeyDown(c, t)}
268
- title=${v}
249
+ title=${y}
269
250
  />
270
251
  </div>
271
252
  `;
@@ -289,7 +270,7 @@ let s = class extends _($) {
289
270
  };
290
271
  }
291
272
  get styleTokens() {
292
- return P`
273
+ return L`
293
274
  <style>
294
275
  :host{
295
276
  color-scheme: ${this.mode};
@@ -300,7 +281,7 @@ let s = class extends _($) {
300
281
  render() {
301
282
  return l`
302
283
  ${this.styleTokens}
303
- <div class=${E(this.containerClasses)}>
284
+ <div class=${R(this.containerClasses)}>
304
285
  <div @touchstart=${this.handleMouseDown} @mousedown=${this.handleMouseDown} class="track" role="presentation">
305
286
  ${this.thumbTemplates}
306
287
  ${this.trackRangeTemplate}
@@ -311,114 +292,115 @@ let s = class extends _($) {
311
292
  `;
312
293
  }
313
294
  };
314
- s.styles = [N, C, I, R, A];
315
- a([
295
+ s.styles = [I, F, C, N, A];
296
+ s.THUMB_RADIUS_CSS_VAR = "var(--ui-kit-slider-thumb-radius, 0px)";
297
+ n([
316
298
  r({ type: Number })
317
299
  ], s.prototype, "min", 2);
318
- a([
300
+ n([
319
301
  r({ type: Number })
320
302
  ], s.prototype, "max", 2);
321
- a([
303
+ n([
322
304
  r({ type: String, attribute: "min-label" })
323
305
  ], s.prototype, "minLabel", 2);
324
- a([
306
+ n([
325
307
  r({ type: String, attribute: "max-label" })
326
308
  ], s.prototype, "maxLabel", 2);
327
- a([
309
+ n([
328
310
  r({ type: Number })
329
311
  ], s.prototype, "step", 2);
330
- a([
312
+ n([
331
313
  r({ type: Number, attribute: "initial-value-min" })
332
314
  ], s.prototype, "initialValueMin", 2);
333
- a([
315
+ n([
334
316
  r({ type: Number, attribute: "initial-value-max" })
335
317
  ], s.prototype, "initialValueMax", 2);
336
- a([
318
+ n([
337
319
  r({ type: Number, attribute: "value-min" })
338
320
  ], s.prototype, "valueMin", 2);
339
- a([
321
+ n([
340
322
  r({ type: Number, attribute: "value-max" })
341
323
  ], s.prototype, "valueMax", 2);
342
- a([
324
+ n([
343
325
  r({ type: String, reflect: !0 })
344
326
  ], s.prototype, "mode", 2);
345
- a([
327
+ n([
346
328
  r({ type: String, attribute: "locale" })
347
329
  ], s.prototype, "locale", 2);
348
- a([
330
+ n([
349
331
  r({ type: String, attribute: "locale-matcher" })
350
332
  ], s.prototype, "localeMatcher", 2);
351
- a([
333
+ n([
352
334
  r({ type: String, attribute: "unit-symbol" })
353
335
  ], s.prototype, "unitSymbol", 2);
354
- a([
336
+ n([
355
337
  r({ type: String, attribute: "unit-symbol-position" })
356
338
  ], s.prototype, "unitSymbolPosition", 2);
357
- a([
339
+ n([
358
340
  r({ type: String, attribute: "unit-style" })
359
341
  ], s.prototype, "unitStyle", 2);
360
- a([
342
+ n([
361
343
  r({ type: String, attribute: "currency" })
362
344
  ], s.prototype, "currency", 2);
363
- a([
345
+ n([
364
346
  r({ type: String, attribute: "unit" })
365
347
  ], s.prototype, "unit", 2);
366
- a([
348
+ n([
367
349
  r({
368
350
  type: String,
369
351
  attribute: "use-grouping",
370
352
  converter: (t) => t === "auto" ? "auto" : typeof t == "boolean" ? t : t === "true" || t === "" ? !0 : t !== "false"
371
353
  })
372
354
  ], s.prototype, "useGrouping", 2);
373
- a([
355
+ n([
374
356
  r({ type: Number, attribute: "minimum-integer-digits" })
375
357
  ], s.prototype, "minimumIntegerDigits", 2);
376
- a([
358
+ n([
377
359
  r({ type: Number, attribute: "minimum-fraction-digits" })
378
360
  ], s.prototype, "minimumFractionDigits", 2);
379
- a([
361
+ n([
380
362
  r({ type: Number, attribute: "maximum-fraction-digits" })
381
363
  ], s.prototype, "maximumFractionDigits", 2);
382
- a([
364
+ n([
383
365
  r({ type: String, attribute: "thousand-separator" })
384
366
  ], s.prototype, "thousandSeparator", 2);
385
- a([
367
+ n([
386
368
  r({ type: String, attribute: "fraction-separator" })
387
369
  ], s.prototype, "fractionSeparator", 2);
388
- a([
370
+ n([
389
371
  r({ type: String, converter: D })
390
372
  ], s.prototype, "size", 2);
391
- a([
373
+ n([
392
374
  r({ type: Boolean, converter: T })
393
375
  ], s.prototype, "disabled", 2);
394
- a([
376
+ n([
395
377
  r({ type: String, attribute: "input-min-aria-label" })
396
378
  ], s.prototype, "inputMinAriaLabel", 2);
397
- a([
379
+ n([
398
380
  r({ type: String, attribute: "input-max-aria-label" })
399
381
  ], s.prototype, "inputMaxAriaLabel", 2);
400
- a([
382
+ n([
401
383
  k(".track")
402
384
  ], s.prototype, "track", 2);
403
- a([
385
+ n([
404
386
  p()
405
387
  ], s.prototype, "_valueMin", 2);
406
- a([
388
+ n([
407
389
  p()
408
390
  ], s.prototype, "_valueMax", 2);
409
- a([
391
+ n([
410
392
  p()
411
393
  ], s.prototype, "activeThumb", 2);
412
- a([
394
+ n([
413
395
  p()
414
396
  ], s.prototype, "animationFrameRequest", 2);
415
- a([
397
+ n([
416
398
  p()
417
399
  ], s.prototype, "editingField", 2);
418
- a([
400
+ n([
419
401
  p()
420
402
  ], s.prototype, "keyboardMode", 2);
421
- s = a([
403
+ s = n([
422
404
  V("ds-slider")
423
405
  ], s);
424
406
  export {
@@ -54,7 +54,7 @@ let m = class extends v {
54
54
  }
55
55
  loadThemeStyles() {
56
56
  return this.loadStyles ? new Promise((t, o) => {
57
- const s = "/2.0.0-canary.64", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
57
+ const s = "/2.0.0-canary.66", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
58
58
  if (document.head.querySelector(`link[href="${r}"]`)) t();
59
59
  else {
60
60
  const e = `ui-kit-theme-${s}`, a = document.getElementById(e), n = document.createElement("link");
@@ -25,7 +25,7 @@ class l {
25
25
  }), f.subscribe("theme", this.handleChangeTheme);
26
26
  }
27
27
  }
28
- const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.64"), h = globalThis;
28
+ const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.66"), h = globalThis;
29
29
  let i = h[c];
30
30
  i || (i = new l(), Object.defineProperty(h, c, {
31
31
  value: i,
@@ -18,7 +18,7 @@ class e {
18
18
  });
19
19
  }
20
20
  }
21
- const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.64"), t = globalThis;
21
+ const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.66"), t = globalThis;
22
22
  let b = t[u];
23
23
  b || (b = new e(), Object.defineProperty(t, u, {
24
24
  value: b,
@@ -7,7 +7,7 @@ class s {
7
7
  theme: t
8
8
  }) => {
9
9
  if (!t || !e) return;
10
- const c = `https://ds-assets.cupra.com/2.0.0-canary.64/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
10
+ const c = `https://ds-assets.cupra.com/2.0.0-canary.66/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
11
11
  if (r) return r;
12
12
  const i = h(() => this.fetchStyle({ url: c })).then((n) => (n || this.stylePromises.delete(c), n));
13
13
  return this.stylePromises.set(c, i), this.stylePromises.get(c);
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
3
3
  import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
4
4
  import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
5
  function x(t, ...r) {
6
- const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-64"), i = n(e);
6
+ const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-66"), i = n(e);
7
7
  return o`${i}`;
8
8
  }
9
9
  export {
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
3
3
  import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
4
4
  import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
5
5
  function x(t, ...r) {
6
- const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-64"), e = i(o);
6
+ const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-66"), e = i(o);
7
7
  return n`${e}`;
8
8
  }
9
9
  export {
@@ -9,6 +9,8 @@ export declare class DsDialog extends UiKitElement {
9
9
  lockScroll: DsDialogAttrs['lock-scroll'];
10
10
  open: DsDialogAttrs['open'];
11
11
  size: DsDialogAttrs['size'];
12
+ dataAriaLabel: DsDialogAttrs['data-aria-label'];
13
+ dataAriaDescription: DsDialogAttrs['data-aria-description'];
12
14
  hasBeenOpened: boolean;
13
15
  hasScroll: boolean;
14
16
  protected content: HTMLInputElement;
@@ -21,6 +23,7 @@ export declare class DsDialog extends UiKitElement {
21
23
  private handleClose;
22
24
  connectedCallback(): void;
23
25
  disconnectedCallback(): void;
26
+ private handleHostClick;
24
27
  private handleKeyDown;
25
28
  private checkScroll;
26
29
  render(): typeof nothing | import("lit").TemplateResult<1>;
@@ -1,5 +1,7 @@
1
1
  import type { CommonAttrs } from '../../types/types';
2
2
  export type DsDialogAttrs = {
3
+ 'data-aria-description'?: string;
4
+ 'data-aria-label'?: string;
3
5
  'lock-close'?: boolean;
4
6
  'lock-scroll'?: boolean;
5
7
  open?: boolean;
@@ -41,10 +41,17 @@ export declare class DsSlider extends DsSlider_base {
41
41
  static styles: import("lit").CSSResult[];
42
42
  protected get isRange(): boolean;
43
43
  private isControlled;
44
+ private getRoleById;
45
+ private get currentValues();
46
+ private computeStep;
44
47
  protected willUpdate(changedProps: PropertyValues): void;
45
48
  disconnectedCallback(): void;
46
49
  protected firstUpdated(changedProps: PropertyValues): void;
47
50
  protected getTrackPct(value: number): number;
51
+ protected get thumbRadius(): number;
52
+ private static readonly THUMB_RADIUS_CSS_VAR;
53
+ private trackPosition;
54
+ private trackWidth;
48
55
  protected getNewValue: (event: MouseEvent | TouchEvent) => number;
49
56
  protected setActiveThumb: (event: MouseEvent | TouchEvent) => void;
50
57
  protected handleMouseMove: (event: MouseEvent | TouchEvent) => void;
@@ -66,7 +73,7 @@ export declare class DsSlider extends DsSlider_base {
66
73
  protected onInputBlur: (event: FocusEvent) => void;
67
74
  protected onInputKeyDown: (event: KeyboardEvent, id: 1 | 2) => void;
68
75
  protected onThumbKeyDown: (event: KeyboardEvent, id: 1 | 2) => void;
69
- protected getInputTemplate(id: number): import("lit").TemplateResult<1>;
76
+ protected getInputTemplate(id: 1 | 2): import("lit").TemplateResult<1>;
70
77
  protected get inputsTemplate(): import("lit").TemplateResult<1>;
71
78
  protected get containerClasses(): {
72
79
  [x: string]: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-kit",
3
- "version": "2.0.0-canary.64",
3
+ "version": "2.0.0-canary.66",
4
4
  "description": "Web components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",
@@ -159,6 +159,9 @@
159
159
  "storybook:cupra-diagonal": "VITE_DS_CDN_URL=./assets pnpm build-cdn --mode development && pnpm build-assets && storybook dev --config-dir .storybook/themes/cupra-diagonal -p 6006 --ci -- --force",
160
160
  "storybook:watch:cupra-diagonal": "nodemon --exec \"VITE_DS_CDN_URL=./assets pnpm build-cdn --mode development && pnpm build-assets && storybook dev --config-dir .storybook/themes/cupra-diagonal -p 6006 --ci -- --force\"",
161
161
  "build-storybook:cupra-diagonal": "pnpm build-cdn && pnpm build-assets && storybook build --config-dir .storybook/themes/cupra-diagonal --output-dir dist-storybook/cupra-diagonal",
162
+ "storybook:seat": "VITE_DS_CDN_URL=./assets pnpm build-cdn --mode development && pnpm build-assets && storybook dev --config-dir .storybook/themes/seat -p 6006 --ci -- --force",
163
+ "storybook:watch:seat": "nodemon --exec \"VITE_DS_CDN_URL=./assets pnpm build-cdn --mode development && pnpm build-assets && storybook dev --config-dir .storybook/themes/seat -p 6006 --ci -- --force\"",
164
+ "build-storybook:seat": "pnpm build-cdn && pnpm build-assets && storybook build --config-dir .storybook/themes/seat --output-dir dist-storybook/seat",
162
165
  "build:tokens": "node style-dictionary.config.js && biome format --write src/styles/generated-tokens-css/",
163
166
  "process-icons": "node scripts/process-icons/process-icons.js && git add .",
164
167
  "process-docs": "node scripts/process-docs/process-docs.js",