@cupra/ui-kit 2.0.0-canary.119 → 2.0.0-canary.121

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 (101) hide show
  1. package/dist/cjs/components/ds-button/ds-button.cjs +3 -3
  2. package/dist/cjs/components/ds-button/styles/common.styles.cjs +4 -4
  3. package/dist/cjs/components/ds-checkbox/ds-checkbox.cjs +2 -2
  4. package/dist/cjs/components/ds-dialog/ds-dialog.cjs +2 -2
  5. package/dist/cjs/components/ds-dialog-fullscreen/ds-dialog-fullscreen.cjs +2 -2
  6. package/dist/cjs/components/ds-drawer/ds-drawer.cjs +4 -4
  7. package/dist/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -7
  8. package/dist/cjs/components/ds-media-control/ds-media-control.cjs +3 -3
  9. package/dist/cjs/components/ds-tabs/ds-tabs.cjs +2 -2
  10. package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  11. package/dist/cjs/components/ds-toggle-switch/ds-toggle-switch.cjs +3 -3
  12. package/dist/cjs/decorators/customUiKitElement.cjs +1 -1
  13. package/dist/cjs/utils/IconsManager.cjs +1 -1
  14. package/dist/cjs/utils/PubSub.cjs +1 -1
  15. package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  16. package/dist/cjs/utils/componentFactory.cjs +12 -0
  17. package/dist/cjs/utils/cssWithTokens.cjs +1 -1
  18. package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
  19. package/dist/cjs/utils/version.cjs +1 -1
  20. package/dist/esm/components/ds-button/ds-button.js +22 -6
  21. package/dist/esm/components/ds-button/styles/common.styles.js +4 -4
  22. package/dist/esm/components/ds-checkbox/ds-checkbox.js +12 -4
  23. package/dist/esm/components/ds-dialog/ds-dialog.js +11 -4
  24. package/dist/esm/components/ds-dialog-fullscreen/ds-dialog-fullscreen.js +12 -5
  25. package/dist/esm/components/ds-drawer/ds-drawer.js +26 -18
  26. package/dist/esm/components/ds-icon-button/ds-icon-button.js +22 -11
  27. package/dist/esm/components/ds-media-control/ds-media-control.js +22 -14
  28. package/dist/esm/components/ds-tabs/ds-tabs.js +10 -4
  29. package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  30. package/dist/esm/components/ds-toggle-switch/ds-toggle-switch.js +30 -21
  31. package/dist/esm/decorators/customUiKitElement.js +1 -1
  32. package/dist/esm/utils/IconsManager.js +1 -1
  33. package/dist/esm/utils/PubSub.js +1 -1
  34. package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  35. package/dist/esm/utils/componentFactory.js +12 -0
  36. package/dist/esm/utils/cssWithTokens.js +1 -1
  37. package/dist/esm/utils/htmlWithTokens.js +1 -1
  38. package/dist/esm/utils/version.js +1 -1
  39. package/dist/types/components/ds-button/ds-button.d.ts +5 -1
  40. package/dist/types/components/ds-button/ds-button.types.d.ts +16 -3
  41. package/dist/types/components/ds-checkbox/ds-checkbox.d.ts +4 -1
  42. package/dist/types/components/ds-dialog/ds-dialog.d.ts +4 -1
  43. package/dist/types/components/ds-dialog-fullscreen/ds-dialog-fullscreen.d.ts +4 -1
  44. package/dist/types/components/ds-drawer/ds-drawer.d.ts +4 -1
  45. package/dist/types/components/ds-drawer/ds-drawer.types.d.ts +1 -1
  46. package/dist/types/components/ds-icon-button/ds-icon-button.d.ts +5 -1
  47. package/dist/types/components/ds-icon-button/ds-icon-button.types.d.ts +16 -3
  48. package/dist/types/components/ds-media-control/ds-media-control.d.ts +4 -1
  49. package/dist/types/components/ds-tabs/ds-tabs.d.ts +4 -1
  50. package/dist/types/components/ds-toggle-switch/ds-toggle-switch.d.ts +4 -1
  51. package/dist-react/cjs/components/ds-button/ds-button.cjs +3 -3
  52. package/dist-react/cjs/components/ds-button/styles/common.styles.cjs +4 -4
  53. package/dist-react/cjs/components/ds-checkbox/ds-checkbox.cjs +2 -2
  54. package/dist-react/cjs/components/ds-dialog/ds-dialog.cjs +2 -2
  55. package/dist-react/cjs/components/ds-dialog-fullscreen/ds-dialog-fullscreen.cjs +2 -2
  56. package/dist-react/cjs/components/ds-drawer/ds-drawer.cjs +4 -4
  57. package/dist-react/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -7
  58. package/dist-react/cjs/components/ds-media-control/ds-media-control.cjs +3 -3
  59. package/dist-react/cjs/components/ds-tabs/ds-tabs.cjs +2 -2
  60. package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  61. package/dist-react/cjs/components/ds-toggle-switch/ds-toggle-switch.cjs +3 -3
  62. package/dist-react/cjs/decorators/customUiKitElement.cjs +1 -1
  63. package/dist-react/cjs/utils/IconsManager.cjs +1 -1
  64. package/dist-react/cjs/utils/PubSub.cjs +1 -1
  65. package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  66. package/dist-react/cjs/utils/componentFactory.cjs +6 -0
  67. package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
  68. package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
  69. package/dist-react/cjs/utils/version.cjs +1 -1
  70. package/dist-react/esm/components/ds-button/ds-button.js +22 -6
  71. package/dist-react/esm/components/ds-button/styles/common.styles.js +4 -4
  72. package/dist-react/esm/components/ds-checkbox/ds-checkbox.js +12 -4
  73. package/dist-react/esm/components/ds-dialog/ds-dialog.js +11 -4
  74. package/dist-react/esm/components/ds-dialog-fullscreen/ds-dialog-fullscreen.js +12 -5
  75. package/dist-react/esm/components/ds-drawer/ds-drawer.js +26 -18
  76. package/dist-react/esm/components/ds-icon-button/ds-icon-button.js +22 -11
  77. package/dist-react/esm/components/ds-media-control/ds-media-control.js +22 -14
  78. package/dist-react/esm/components/ds-tabs/ds-tabs.js +10 -4
  79. package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  80. package/dist-react/esm/components/ds-toggle-switch/ds-toggle-switch.js +30 -21
  81. package/dist-react/esm/decorators/customUiKitElement.js +1 -1
  82. package/dist-react/esm/utils/IconsManager.js +1 -1
  83. package/dist-react/esm/utils/PubSub.js +1 -1
  84. package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  85. package/dist-react/esm/utils/componentFactory.js +6 -0
  86. package/dist-react/esm/utils/cssWithTokens.js +1 -1
  87. package/dist-react/esm/utils/htmlWithTokens.js +1 -1
  88. package/dist-react/esm/utils/version.js +1 -1
  89. package/dist-react/types/components/ds-button/ds-button.d.ts +5 -1
  90. package/dist-react/types/components/ds-button/ds-button.types.d.ts +16 -3
  91. package/dist-react/types/components/ds-checkbox/ds-checkbox.d.ts +4 -1
  92. package/dist-react/types/components/ds-dialog/ds-dialog.d.ts +4 -1
  93. package/dist-react/types/components/ds-dialog-fullscreen/ds-dialog-fullscreen.d.ts +4 -1
  94. package/dist-react/types/components/ds-drawer/ds-drawer.d.ts +4 -1
  95. package/dist-react/types/components/ds-drawer/ds-drawer.types.d.ts +1 -1
  96. package/dist-react/types/components/ds-icon-button/ds-icon-button.d.ts +5 -1
  97. package/dist-react/types/components/ds-icon-button/ds-icon-button.types.d.ts +16 -3
  98. package/dist-react/types/components/ds-media-control/ds-media-control.d.ts +4 -1
  99. package/dist-react/types/components/ds-tabs/ds-tabs.d.ts +4 -1
  100. package/dist-react/types/components/ds-toggle-switch/ds-toggle-switch.d.ts +4 -1
  101. package/package.json +1 -1
@@ -17,7 +17,7 @@ import { buttonStyles as p, loadingDotsStyles as m, textStyles as h } from "./st
17
17
  //#region src/components/ds-button/ds-button.ts
18
18
  var g = class extends l(i) {
19
19
  constructor(...e) {
20
- super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1;
20
+ super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1, this.baseVariant = "primary";
21
21
  }
22
22
  static {
23
23
  this.styles = [
@@ -30,13 +30,14 @@ var g = class extends l(i) {
30
30
  super.connectedCallback(), this.closestForm = this.closest("form");
31
31
  }
32
32
  get classes() {
33
- let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
33
+ let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = this.variant === "custom" ? this.baseVariant : this.variant;
34
34
  return {
35
35
  button: !0,
36
- custom: this.htmlTagName === "custom",
36
+ [`tag-${this.htmlTagName}`]: !0,
37
+ [`variant-${t}`]: !0,
38
+ custom: this.variant === "custom",
37
39
  [e]: !!e,
38
40
  [this.mode]: !!this.mode,
39
- [this.variant]: !!this.variant,
40
41
  rounded: this.rounded,
41
42
  disabled: this.disabled || this.loading,
42
43
  destructive: this.destructive,
@@ -75,6 +76,9 @@ var g = class extends l(i) {
75
76
  get contentTemplate() {
76
77
  return this.loading && this.textLoading ? t`${this.textLoading}` : t`<slot></slot>`;
77
78
  }
79
+ updated(e) {
80
+ super.updated(e), this.variant === "custom" && this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.variant === "custom" && this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
81
+ }
78
82
  get cssTokens() {
79
83
  return s`
80
84
  <style>
@@ -136,7 +140,10 @@ var g = class extends l(i) {
136
140
  `;
137
141
  }
138
142
  };
139
- r([n({ type: String })], g.prototype, "variant", void 0), r([n({
143
+ r([n({
144
+ type: String,
145
+ reflect: !0
146
+ })], g.prototype, "variant", void 0), r([n({
140
147
  type: String,
141
148
  reflect: !0
142
149
  })], g.prototype, "mode", void 0), r([n({
@@ -179,6 +186,15 @@ r([n({ type: String })], g.prototype, "variant", void 0), r([n({
179
186
  })], g.prototype, "loading", void 0), r([n({
180
187
  type: String,
181
188
  attribute: "text-loading"
182
- })], g.prototype, "textLoading", void 0), g = r([a("ds-button")], g);
189
+ })], g.prototype, "textLoading", void 0), r([n({
190
+ type: String,
191
+ attribute: "base-variant"
192
+ })], g.prototype, "baseVariant", void 0), r([n({
193
+ type: String,
194
+ attribute: "custom-background"
195
+ })], g.prototype, "customBackground", void 0), r([n({
196
+ type: String,
197
+ attribute: "custom-color"
198
+ })], g.prototype, "customColor", void 0), g = r([a("ds-button")], g);
183
199
  //#endregion
184
200
  export { g as DsButton };
@@ -31,7 +31,7 @@ var t = e`
31
31
  width: 100%;
32
32
  }
33
33
 
34
- .custom ::slotted(*) {
34
+ .tag-custom ::slotted(*) {
35
35
  display: inline-flex;
36
36
  align-items: center;
37
37
  justify-content: center;
@@ -53,13 +53,13 @@ var t = e`
53
53
  box-sizing: border-box;
54
54
  }
55
55
 
56
- .custom ::slotted(*:disabled),
57
- .custom.disabled ::slotted(*) {
56
+ .tag-custom ::slotted(*:disabled),
57
+ .tag-custom.disabled ::slotted(*) {
58
58
  pointer-events: none;
59
59
  cursor: default;
60
60
  }
61
61
 
62
- .custom ::slotted(*:focus-visible) {
62
+ .tag-custom ::slotted(*:focus-visible) {
63
63
  outline: none;
64
64
  }
65
65
  `, n = e`
@@ -17,7 +17,13 @@ import { commonStyles as h } from "./styles/common.styles.js";
17
17
  //#region src/components/ds-checkbox/ds-checkbox.ts
18
18
  var g = class extends m(o) {
19
19
  constructor(...e) {
20
- super(...e), this.inputPlacement = "left", this.checked = !1, this.required = !1, this._disabled = !1, this.mode = "light", this._size = "medium", this.helperText = "", this.infoText = "", this._forcedError = "", this.invalidError = "", this.indeterminate = !1, this.dataAriaLabel = "";
20
+ super(...e), this.inputPlacement = "left", this._checked = void 0, this._checkedState = !1, this.required = !1, this._disabled = !1, this.mode = "light", this._size = "medium", this.helperText = "", this.infoText = "", this._forcedError = "", this.invalidError = "", this.indeterminate = !1, this.dataAriaLabel = "";
21
+ }
22
+ get checked() {
23
+ return this._checked ?? this._checkedState;
24
+ }
25
+ set checked(e) {
26
+ this._checked = e;
21
27
  }
22
28
  static {
23
29
  this.styles = [h];
@@ -77,11 +83,12 @@ var g = class extends m(o) {
77
83
  return this.errorGroup ?? !!this._forcedError;
78
84
  }
79
85
  handleChange(e) {
80
- this.checked = e.target.checked, this.dispatchEvent(new CustomEvent("change", {
86
+ let t = e.target.checked;
87
+ this._checkedState = t, this._checked = void 0, this.dispatchEvent(new CustomEvent("change", {
81
88
  bubbles: !0,
82
89
  composed: !0,
83
90
  detail: {
84
- checked: this.checked,
91
+ checked: t,
85
92
  value: this.value
86
93
  }
87
94
  }));
@@ -155,9 +162,10 @@ a([r({ type: String })], g.prototype, "name", void 0), a([r({ type: String })],
155
162
  attribute: "input-placement"
156
163
  })], g.prototype, "inputPlacement", void 0), a([r({
157
164
  type: Boolean,
165
+ attribute: "checked",
158
166
  converter: c,
159
167
  reflect: !0
160
- })], g.prototype, "checked", void 0), a([r({
168
+ })], g.prototype, "_checked", void 0), a([i()], g.prototype, "_checkedState", void 0), a([r({
161
169
  type: Boolean,
162
170
  converter: c
163
171
  })], g.prototype, "required", void 0), a([r({
@@ -16,7 +16,7 @@ import { commonStyles as f } from "./styles/common.styles.js";
16
16
  //#region src/components/ds-dialog/ds-dialog.ts
17
17
  var p = class extends o {
18
18
  constructor(...e) {
19
- super(...e), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll = u({ func: () => this.checkScroll() }), this.scrollLocked = !1, this.handleCloseButtonClick = () => {
19
+ super(...e), this.lockClose = !1, this.lockScroll = !0, this._open = void 0, this._openState = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll = u({ func: () => this.checkScroll() }), this.scrollLocked = !1, this.handleCloseButtonClick = () => {
20
20
  this.handleClose("button");
21
21
  }, this.handleDialogClick = (e) => {
22
22
  e.target === this.nativeDialog && this.handleClose("backdrop");
@@ -29,8 +29,14 @@ var p = class extends o {
29
29
  static {
30
30
  this.styles = [f];
31
31
  }
32
+ get open() {
33
+ return this._open ?? this._openState;
34
+ }
35
+ set open(e) {
36
+ this._open = e;
37
+ }
32
38
  updated(e) {
33
- super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && (this.open || (this.hasScroll = !1), this.handleResizeObserver(), this.syncNativeDialogState(), this.syncScrollLock());
39
+ super.updated(e), !this.hasBeenOpened && (e.has("_open") || e.has("_openState")) && this.open && (this.hasBeenOpened = !0), (e.has("_open") || e.has("_openState")) && (this.open || (this.hasScroll = !1), this.handleResizeObserver(), this.syncNativeDialogState(), this.syncScrollLock());
34
40
  }
35
41
  syncScrollLock() {
36
42
  this.open && this.lockScroll ? (d.lock(), this.scrollLocked = !0) : this.scrollLocked &&= (d.unlock(), !1);
@@ -65,7 +71,7 @@ var p = class extends o {
65
71
  }));
66
72
  }
67
73
  handleClose(e) {
68
- this.lockClose || (this.open = !1, this.dispatchCloseEvents(e));
74
+ this.lockClose || (this._openState = !1, this._open = void 0, this.dispatchCloseEvents(e));
69
75
  }
70
76
  connectedCallback() {
71
77
  super.connectedCallback(), this.resizeObserver = new ResizeObserver(this.debouncedCheckScroll), this.handleResizeObserver(), this.addEventListener("click", this.handleHostClick);
@@ -109,8 +115,9 @@ a([n({
109
115
  attribute: "lock-scroll"
110
116
  })], p.prototype, "lockScroll", void 0), a([n({
111
117
  type: Boolean,
118
+ attribute: "open",
112
119
  converter: c
113
- })], p.prototype, "open", void 0), a([n({ type: String })], p.prototype, "size", void 0), a([n({
120
+ })], p.prototype, "_open", void 0), a([r()], p.prototype, "_openState", void 0), a([n({ type: String })], p.prototype, "size", void 0), a([n({
114
121
  type: String,
115
122
  attribute: "data-aria-label"
116
123
  })], p.prototype, "dataAriaLabel", void 0), a([n({
@@ -15,18 +15,24 @@ import { commonStyles as d } from "./styles/common.styles.js";
15
15
  //#region src/components/ds-dialog-fullscreen/ds-dialog-fullscreen.ts
16
16
  var f = class extends o {
17
17
  constructor(...e) {
18
- super(...e), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.hasScroll = !1, this.hasBeenOpened = !1, this.debouncedCheckScroll = u({ func: () => this.checkScroll() }), this.handleKeyDown = (e) => {
18
+ super(...e), this.lockClose = !1, this.lockScroll = !0, this._open = void 0, this._openState = !1, this.hasScroll = !1, this.hasBeenOpened = !1, this.debouncedCheckScroll = u({ func: () => this.checkScroll() }), this.handleKeyDown = (e) => {
19
19
  this.open && e.key === "Escape" && this.handleClose();
20
20
  };
21
21
  }
22
22
  static {
23
23
  this.styles = [d];
24
24
  }
25
+ get open() {
26
+ return this._open ?? this._openState;
27
+ }
28
+ set open(e) {
29
+ this._open = e;
30
+ }
25
31
  willUpdate(e) {
26
- super.willUpdate(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0);
32
+ super.willUpdate(e), !this.hasBeenOpened && (e.has("_open") || e.has("_openState")) && this.open && (this.hasBeenOpened = !0);
27
33
  }
28
34
  updated(e) {
29
- super.updated(e), e.has("open") && this.handleResizeObserver();
35
+ super.updated(e), (e.has("_open") || e.has("_openState")) && this.handleResizeObserver();
30
36
  }
31
37
  async handleResizeObserver() {
32
38
  this.lockScroll && (document.getElementById("storybook-root") || (document.body.style.overflow = this.open ? "hidden" : "")), this.resizeObserver?.disconnect(), this.content && (this.resizeObserver.observe(this.content), await new Promise(requestAnimationFrame), this.checkScroll());
@@ -39,7 +45,7 @@ var f = class extends o {
39
45
  };
40
46
  }
41
47
  handleClose() {
42
- this.lockClose || (this.open = !1, this.dispatchEvent(new Event("ds-dialog-fullscreen:close", {
48
+ this.lockClose || (this._openState = !1, this._open = void 0, this.dispatchEvent(new Event("ds-dialog-fullscreen:close", {
43
49
  bubbles: !0,
44
50
  composed: !0
45
51
  })));
@@ -84,6 +90,7 @@ a([n({
84
90
  attribute: "lock-scroll"
85
91
  })], f.prototype, "lockScroll", void 0), a([n({
86
92
  type: Boolean,
93
+ attribute: "open",
87
94
  converter: c
88
- })], f.prototype, "open", void 0), a([r()], f.prototype, "hasScroll", void 0), a([i(".content")], f.prototype, "content", void 0), f = a([s("ds-dialog-fullscreen")], f);
95
+ })], f.prototype, "_open", void 0), a([r()], f.prototype, "_openState", void 0), a([r()], f.prototype, "hasScroll", void 0), a([i(".content")], f.prototype, "content", void 0), f = a([s("ds-dialog-fullscreen")], f);
89
96
  //#endregion
@@ -1,29 +1,36 @@
1
1
  import { x as e } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
2
2
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
3
3
  import { n as t } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
4
+ import { r as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
4
5
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
5
- import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
6
- import { UiKitElement as r } from "../base/UiKitElement.js";
7
- import { customUiKitElement as i } from "../../decorators/customUiKitElement.js";
8
- import { booleanConverter as a } from "../../utils/booleanConverter.js";
9
- import { e as o } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
6
+ import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
7
+ import { UiKitElement as i } from "../base/UiKitElement.js";
8
+ import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
9
+ import { booleanConverter as o } from "../../utils/booleanConverter.js";
10
+ import { e as s } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
10
11
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
11
- import { commonStyles as s, iconStyles as c } from "./styles/common.styles.js";
12
- import { themeConfig as l } from "./theme-config.js";
12
+ import { commonStyles as c, iconStyles as l } from "./styles/common.styles.js";
13
+ import { themeConfig as u } from "./theme-config.js";
13
14
  //#region src/components/ds-drawer/ds-drawer.ts
14
- var u = class extends r {
15
+ var d = class extends i {
15
16
  constructor(...e) {
16
- super(...e), this.open = !1, this.handleOverlayClick = () => {
17
+ super(...e), this._open = void 0, this._openState = !1, this.handleOverlayClick = () => {
17
18
  this.dispatchEvent(new Event("ds-drawer:close", {
18
19
  bubbles: !0,
19
20
  composed: !0
20
- })), this.open = !1;
21
+ })), this._openState = !1, this._open = void 0;
21
22
  }, this.handleKeyDown = (e) => {
22
23
  (e.key === "Escape" || e.key === "Esc") && this.open && this.handleOverlayClick();
23
24
  };
24
25
  }
25
26
  static {
26
- this.styles = [s, c];
27
+ this.styles = [c, l];
28
+ }
29
+ get open() {
30
+ return this._open ?? this._openState;
31
+ }
32
+ set open(e) {
33
+ this._open = e;
27
34
  }
28
35
  get classes() {
29
36
  return {
@@ -32,7 +39,7 @@ var u = class extends r {
32
39
  };
33
40
  }
34
41
  getIconButtonTemplate() {
35
- let e = l[this.theme]?.["icon-button-variant"];
42
+ let e = u[this.theme]?.["icon-button-variant"];
36
43
  return this.componentFactory.createIconButton({
37
44
  class: "close-button visible",
38
45
  "data-testid": "close-button",
@@ -45,18 +52,18 @@ var u = class extends r {
45
52
  });
46
53
  }
47
54
  updated(e) {
48
- super.updated?.(e), e.has && e.has("open") && window.addEventListener("keydown", this.handleKeyDown);
55
+ super.updated?.(e), e.has && (e.has("_open") || e.has("_openState")) && window.addEventListener("keydown", this.handleKeyDown);
49
56
  }
50
57
  disconnectedCallback() {
51
58
  window.removeEventListener("keydown", this.handleKeyDown), super.disconnectedCallback();
52
59
  }
53
60
  render() {
54
61
  return e`
55
- <div class=${o({
62
+ <div class=${s({
56
63
  overlay: !0,
57
64
  open: !!this.open
58
65
  })} @click=${this.handleOverlayClick}></div>
59
- <div data-testid="ds-drawer-container" class=${o(this.classes)}>
66
+ <div data-testid="ds-drawer-container" class=${s(this.classes)}>
60
67
  <div class="scroll-area" tabindex="0">
61
68
  <div class="drawer-header">
62
69
  <slot name="header"></slot>
@@ -75,8 +82,9 @@ var u = class extends r {
75
82
  `;
76
83
  }
77
84
  };
78
- n([t({
85
+ r([t({
79
86
  type: Boolean,
80
- converter: a
81
- })], u.prototype, "open", void 0), u = n([i("ds-drawer")], u);
87
+ attribute: "open",
88
+ converter: o
89
+ })], d.prototype, "_open", void 0), r([n()], d.prototype, "_openState", void 0), d = r([a("ds-drawer")], d);
82
90
  //#endregion
@@ -16,7 +16,7 @@ import { buttonStyles as f } from "./styles/common.styles.js";
16
16
  //#region src/components/ds-icon-button/ds-icon-button.ts
17
17
  var p = class extends l(i) {
18
18
  constructor(...e) {
19
- super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
19
+ super(...e), this.variant = "primary", this.baseVariant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
20
20
  }
21
21
  static {
22
22
  this.styles = [f];
@@ -35,16 +35,20 @@ var p = class extends l(i) {
35
35
  t && !t.contains(e.composedPath()[0]) && (e.stopPropagation(), t.click());
36
36
  }
37
37
  get classes() {
38
- let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
38
+ let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = this.variant === "custom" ? this.baseVariant : this.variant;
39
39
  return {
40
40
  button: !0,
41
- custom: this.htmlTagName === "custom",
41
+ [`tag-${this.htmlTagName}`]: !0,
42
+ [`variant-${t}`]: !0,
43
+ custom: this.variant === "custom",
42
44
  disabled: this.disabled,
43
45
  [e]: !!e,
44
- [this.mode]: !!this.mode,
45
- [this.variant]: !!this.variant
46
+ [this.mode]: !!this.mode
46
47
  };
47
48
  }
49
+ updated(e) {
50
+ super.updated(e), this.variant === "custom" && this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.variant === "custom" && this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
51
+ }
48
52
  get variantColorTokens() {
49
53
  return s`
50
54
  <style>
@@ -57,11 +61,6 @@ var p = class extends l(i) {
57
61
  }
58
62
  render() {
59
63
  return t`
60
- <style>
61
- :host {
62
- pointer-events: ${this.disabled ? "none" : "visible"};
63
- }
64
- </style>
65
64
  ${this.variantColorTokens}
66
65
  ${d(this.htmlTagName || "button", [
67
66
  ["button", () => t`
@@ -95,7 +94,19 @@ var p = class extends l(i) {
95
94
  `;
96
95
  }
97
96
  };
98
- r([n({ type: String })], p.prototype, "variant", void 0), r([n({
97
+ r([n({
98
+ type: String,
99
+ reflect: !0
100
+ })], p.prototype, "variant", void 0), r([n({
101
+ type: String,
102
+ attribute: "base-variant"
103
+ })], p.prototype, "baseVariant", void 0), r([n({
104
+ type: String,
105
+ attribute: "custom-background"
106
+ })], p.prototype, "customBackground", void 0), r([n({
107
+ type: String,
108
+ attribute: "custom-color"
109
+ })], p.prototype, "customColor", void 0), r([n({
99
110
  type: String,
100
111
  reflect: !0
101
112
  })], p.prototype, "mode", void 0), r([n({
@@ -1,20 +1,21 @@
1
1
  import { x as e } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
2
2
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
3
3
  import { n as t } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
4
+ import { r as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
4
5
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
5
- import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
6
- import { UiKitElement as r } from "../base/UiKitElement.js";
7
- import { customUiKitElement as i } from "../../decorators/customUiKitElement.js";
8
- import { e as a } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
6
+ import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
7
+ import { UiKitElement as i } from "../base/UiKitElement.js";
8
+ import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
9
+ import { e as o } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
9
10
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
10
- import { commonStyles as o } from "./styles/common.styles.js";
11
+ import { commonStyles as s } from "./styles/common.styles.js";
11
12
  //#region src/components/ds-media-control/ds-media-control.ts
12
- var s = class extends r {
13
+ var c = class extends i {
13
14
  constructor(...e) {
14
- super(...e), this.state = "pause", this.size = "medium", this.progress = 0, this.handleToggle = (e) => {
15
+ super(...e), this._state = void 0, this._stateValue = "pause", this.size = "medium", this.progress = 0, this.handleToggle = (e) => {
15
16
  e.stopPropagation();
16
17
  let t = this.state === "play" ? "pause" : "play";
17
- this.state = t;
18
+ this._stateValue = t, this._state = void 0;
18
19
  let n = t === "play" ? "ds-media-control:play" : "ds-media-control:pause";
19
20
  this.dispatchEvent(new CustomEvent(n, {
20
21
  bubbles: !0,
@@ -25,7 +26,13 @@ var s = class extends r {
25
26
  };
26
27
  }
27
28
  static {
28
- this.styles = [o];
29
+ this.styles = [s];
30
+ }
31
+ get state() {
32
+ return this._state ?? this._stateValue;
33
+ }
34
+ set state(e) {
35
+ this._state = e;
29
36
  }
30
37
  get normalizedProgress() {
31
38
  let e = Number(this.progress ?? 0);
@@ -77,7 +84,7 @@ var s = class extends r {
77
84
  return e`
78
85
  <div
79
86
  part="container"
80
- class=${a(this.classes)}
87
+ class=${o(this.classes)}
81
88
  role="button"
82
89
  tabindex="0"
83
90
  aria-label=${`${t} media ${this.size}`}
@@ -90,14 +97,15 @@ var s = class extends r {
90
97
  `;
91
98
  }
92
99
  };
93
- n([t({
100
+ r([t({
94
101
  type: String,
102
+ attribute: "state",
95
103
  reflect: !0
96
- })], s.prototype, "state", void 0), n([t({
104
+ })], c.prototype, "_state", void 0), r([n()], c.prototype, "_stateValue", void 0), r([t({
97
105
  type: String,
98
106
  reflect: !0
99
- })], s.prototype, "size", void 0), n([t({
107
+ })], c.prototype, "size", void 0), r([t({
100
108
  type: Number,
101
109
  reflect: !0
102
- })], s.prototype, "progress", void 0), s = n([i("ds-media-control")], s);
110
+ })], c.prototype, "progress", void 0), c = r([a("ds-media-control")], c);
103
111
  //#endregion
@@ -15,7 +15,7 @@ import { themeConfig as m } from "./theme-config.js";
15
15
  //#region src/components/ds-tabs/ds-tabs.ts
16
16
  var h = class extends o {
17
17
  constructor(...e) {
18
- super(...e), this.selectedTab = 0, this.mode = "light", this.variant = "primary", this.size = "large", this.disabled = !1, this.focusedTabIndex = -1, this.handleKeyDown = (e) => {
18
+ super(...e), this._selectedTab = void 0, this._selectedTabState = 0, this.mode = "light", this.variant = "primary", this.size = "large", this.disabled = !1, this.focusedTabIndex = -1, this.handleKeyDown = (e) => {
19
19
  if (!(this.focusedTabIndex < 0)) switch (e.key) {
20
20
  case "ArrowRight":
21
21
  case "Right":
@@ -65,6 +65,12 @@ var h = class extends o {
65
65
  f
66
66
  ];
67
67
  }
68
+ get selectedTab() {
69
+ return this._selectedTab ?? this._selectedTabState;
70
+ }
71
+ set selectedTab(e) {
72
+ this._selectedTab = e;
73
+ }
68
74
  connectedCallback() {
69
75
  super.connectedCallback(), this.tabs = Array.from(this.querySelectorAll("[slot=tab]")), this.panels = Array.from(this.querySelectorAll("[slot=panel]"));
70
76
  }
@@ -88,7 +94,7 @@ var h = class extends o {
88
94
  this.handleScrollNav(), this.resizeObserver.observe(this.nav), this.tabs.forEach((e) => this.resizeObserver.observe(e)), window.addEventListener("resize", this.handleScrollNav), this.nav.addEventListener("scroll", this.handleScrollNav), this.setTabsFocusable();
89
95
  }
90
96
  updated(e) {
91
- if (super.updated(e), e.has("selectedTab") && this.selectTab(this.selectedTab), e.has("variant")) {
97
+ if (super.updated(e), (e.has("_selectedTab") || e.has("_selectedTabState")) && this.selectTab(this.selectedTab), e.has("variant")) {
92
98
  let e = this.variant === "secondary" || this.variant === "primary" ? this.variant : "primary";
93
99
  this.variant !== e && (this.variant = e);
94
100
  }
@@ -122,7 +128,7 @@ var h = class extends o {
122
128
  bubbles: !0,
123
129
  composed: !0,
124
130
  detail: { selectedTab: e }
125
- })), this.selectedTab = e;
131
+ })), this._selectedTabState = e, this._selectedTab = void 0;
126
132
  }
127
133
  handleSelect(e) {
128
134
  let t;
@@ -165,7 +171,7 @@ a([n({
165
171
  type: Number,
166
172
  attribute: "selected-tab",
167
173
  reflect: !0
168
- })], h.prototype, "selectedTab", void 0), a([n({
174
+ })], h.prototype, "_selectedTab", void 0), a([r()], h.prototype, "_selectedTabState", void 0), a([n({
169
175
  type: String,
170
176
  reflect: !0
171
177
  })], h.prototype, "mode", void 0), a([n({
@@ -50,7 +50,7 @@ var p = class extends o {
50
50
  }
51
51
  loadThemeStyles() {
52
52
  return this.loadStyles ? new Promise((e, t) => {
53
- let n = "/2.0.0-canary.119", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
53
+ let n = "/2.0.0-canary.121", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
54
54
  if (document.head.querySelector(`link[href="${r}"]`)) e();
55
55
  else {
56
56
  let i = `ui-kit-theme-${n}`, a = document.getElementById(i), o = document.createElement("link");
@@ -2,28 +2,36 @@ import "../ds-theme-provider/themeContext.js";
2
2
  import { x as e } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
3
3
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
4
4
  import { n as t } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
5
+ import { r as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
5
6
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
6
- import { __decorate as n } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
7
- import { UiKitElement as r } from "../base/UiKitElement.js";
8
- import { customUiKitElement as i } from "../../decorators/customUiKitElement.js";
9
- import { booleanConverter as a } from "../../utils/booleanConverter.js";
10
- import { htmlWithTokens as o } from "../../utils/htmlWithTokens.js";
11
- import { e as s } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
7
+ import { __decorate as r } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
8
+ import { UiKitElement as i } from "../base/UiKitElement.js";
9
+ import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
10
+ import { booleanConverter as o } from "../../utils/booleanConverter.js";
11
+ import { htmlWithTokens as s } from "../../utils/htmlWithTokens.js";
12
+ import { e as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
12
13
  import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
13
- import { commonStyles as c } from "./styles/common.styles.js";
14
+ import { commonStyles as l } from "./styles/common.styles.js";
14
15
  //#region src/components/ds-toggle-switch/ds-toggle-switch.ts
15
- var l = class extends r {
16
+ var u = class extends i {
16
17
  constructor(...e) {
17
- super(...e), this.size = "medium", this.checked = !1, this.disabled = !1, this.mode = "light";
18
+ super(...e), this.size = "medium", this._checked = void 0, this._checkedState = !1, this.disabled = !1, this.mode = "light";
18
19
  }
19
20
  static {
20
- this.styles = [c];
21
+ this.styles = [l];
22
+ }
23
+ get checked() {
24
+ return this._checked ?? this._checkedState;
25
+ }
26
+ set checked(e) {
27
+ this._checked = e;
21
28
  }
22
29
  handleClick() {
23
- this.checked = !this.checked, this.dispatchEvent(new CustomEvent("change", {
30
+ let e = !this.checked;
31
+ this._checkedState = e, this._checked = void 0, this.dispatchEvent(new CustomEvent("change", {
24
32
  bubbles: !0,
25
33
  composed: !0,
26
- detail: { checked: this.checked }
34
+ detail: { checked: e }
27
35
  }));
28
36
  }
29
37
  handleClickOff(e) {
@@ -33,7 +41,7 @@ var l = class extends r {
33
41
  e.stopPropagation(), !this.checked && this.handleClick();
34
42
  }
35
43
  get styleTokens() {
36
- return o`
44
+ return s`
37
45
  <style>
38
46
  :host {
39
47
  color-scheme: ${this.mode};
@@ -54,7 +62,7 @@ var l = class extends r {
54
62
  return e`
55
63
  ${this.styleTokens}
56
64
  <div
57
- class=${s(this.labelClasses)}
65
+ class=${c(this.labelClasses)}
58
66
  @click=${this.handleClick}
59
67
  >
60
68
  <slot name="off" @click=${this.handleClickOff}></slot>
@@ -77,19 +85,20 @@ var l = class extends r {
77
85
  `;
78
86
  }
79
87
  };
80
- n([t({ type: String })], l.prototype, "size", void 0), n([t({
88
+ r([t({ type: String })], u.prototype, "size", void 0), r([t({
81
89
  type: Boolean,
82
- converter: a,
90
+ attribute: "checked",
91
+ converter: o,
83
92
  reflect: !0
84
- })], l.prototype, "checked", void 0), n([t({
93
+ })], u.prototype, "_checked", void 0), r([n()], u.prototype, "_checkedState", void 0), r([t({
85
94
  type: Boolean,
86
- converter: a,
95
+ converter: o,
87
96
  reflect: !0
88
- })], l.prototype, "disabled", void 0), n([t({
97
+ })], u.prototype, "disabled", void 0), r([t({
89
98
  type: String,
90
99
  reflect: !0
91
- })], l.prototype, "mode", void 0), n([t({
100
+ })], u.prototype, "mode", void 0), r([t({
92
101
  type: String,
93
102
  attribute: "data-aria-label"
94
- })], l.prototype, "dataAriaLabel", void 0), l = n([i("ds-toggle-switch")], l);
103
+ })], u.prototype, "dataAriaLabel", void 0), u = r([a("ds-toggle-switch")], u);
95
104
  //#endregion
@@ -15,7 +15,7 @@ function n(n, r) {
15
15
  this.componentName = o;
16
16
  }
17
17
  connectedCallback() {
18
- i.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.119");
18
+ i.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.121");
19
19
  }
20
20
  });
21
21
  };
@@ -25,7 +25,7 @@ var n = class {
25
25
  return console.error(`Failed to fetch icon "${e}":`, t), "";
26
26
  }), t.subscribe("theme", this.handleChangeTheme);
27
27
  }
28
- }, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.119"), i = globalThis, a = i[r];
28
+ }, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.121"), i = globalThis, a = i[r];
29
29
  a || (a = new n(), Object.defineProperty(i, r, {
30
30
  value: a,
31
31
  writable: !1,
@@ -18,7 +18,7 @@ var e = class {
18
18
  }
19
19
  });
20
20
  }
21
- }, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.119"), n = globalThis, r = n[t];
21
+ }, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.121"), n = globalThis, r = n[t];
22
22
  r || (r = new e(), Object.defineProperty(n, t, {
23
23
  value: r,
24
24
  writable: !1,