@cupra/ui-kit 2.0.0-canary.63 → 2.0.0-canary.65
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.
- package/dist/cjs/components/ds-accordion/ds-accordion.cjs +6 -6
- package/dist/cjs/components/ds-button/ds-button.cjs +43 -38
- package/dist/cjs/components/ds-button/styles/common.styles.cjs +41 -3
- package/dist/cjs/components/ds-chips/styles/common.styles.cjs +9 -2
- package/dist/cjs/components/ds-slider/ds-slider.cjs +29 -29
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/esm/components/ds-accordion/ds-accordion.js +4 -4
- package/dist/esm/components/ds-button/ds-button.js +90 -79
- package/dist/esm/components/ds-button/styles/common.styles.js +42 -4
- package/dist/esm/components/ds-chips/styles/common.styles.js +7 -0
- package/dist/esm/components/ds-slider/ds-slider.js +116 -134
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/types/components/ds-accordion/ds-accordion.d.ts +1 -1
- package/dist/types/components/ds-button/ds-button.d.ts +2 -0
- package/dist/types/components/ds-button/ds-button.types.d.ts +1 -0
- package/dist/types/components/ds-slider/ds-slider.d.ts +8 -1
- package/dist-react/cjs/components/ds-accordion/ds-accordion.cjs +6 -6
- package/dist-react/cjs/components/ds-button/ds-button.cjs +43 -38
- package/dist-react/cjs/components/ds-button/styles/common.styles.cjs +41 -3
- package/dist-react/cjs/components/ds-chips/styles/common.styles.cjs +9 -2
- package/dist-react/cjs/components/ds-slider/ds-slider.cjs +29 -29
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/esm/components/ds-accordion/ds-accordion.js +4 -4
- package/dist-react/esm/components/ds-button/ds-button.js +90 -79
- package/dist-react/esm/components/ds-button/styles/common.styles.js +42 -4
- package/dist-react/esm/components/ds-chips/styles/common.styles.js +7 -0
- package/dist-react/esm/components/ds-slider/ds-slider.js +116 -134
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/types/components/ds-accordion/ds-accordion.d.ts +1 -1
- package/dist-react/types/components/ds-button/ds-button.d.ts +2 -0
- package/dist-react/types/components/ds-button/ds-button.types.d.ts +1 -0
- package/dist-react/types/components/ds-slider/ds-slider.d.ts +8 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
3
|
-
import { ViewportMixin as
|
|
4
|
-
import { booleanConverter as
|
|
5
|
-
import { htmlWithTokens as
|
|
6
|
-
import { objectConverter as
|
|
1
|
+
import { UiKitElement as g } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as f } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { ViewportMixin as y } from "../../mixins/ViewportMixin.js";
|
|
4
|
+
import { booleanConverter as l } from "../../utils/booleanConverter.js";
|
|
5
|
+
import { htmlWithTokens as $ } from "../../utils/htmlWithTokens.js";
|
|
6
|
+
import { objectConverter as b } from "../../utils/objectConverter.js";
|
|
7
7
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
8
|
-
import { nothing as u, html as
|
|
8
|
+
import { nothing as u, html as s } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
9
9
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
10
|
-
import { property as
|
|
11
|
-
import { state as
|
|
10
|
+
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
11
|
+
import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
12
12
|
import { choose as T } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.js";
|
|
13
13
|
import { classMap as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
14
|
-
import { when as
|
|
15
|
-
import { buttonStyles as S, textStyles as
|
|
16
|
-
var
|
|
17
|
-
for (var
|
|
18
|
-
(m =
|
|
19
|
-
return
|
|
14
|
+
import { when as a } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
|
|
15
|
+
import { buttonStyles as S, textStyles as x, loadingDotsStyles as P } from "./styles/common.styles.js";
|
|
16
|
+
var w = Object.defineProperty, C = Object.getOwnPropertyDescriptor, e = (o, r, h, p) => {
|
|
17
|
+
for (var n = p > 1 ? void 0 : p ? C(r, h) : r, c = o.length - 1, m; c >= 0; c--)
|
|
18
|
+
(m = o[c]) && (n = (p ? m(r, h, n) : m(n)) || n);
|
|
19
|
+
return p && n && w(r, h, n), n;
|
|
20
20
|
};
|
|
21
|
-
let t = class extends g
|
|
21
|
+
let t = class extends y(g) {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments), 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;
|
|
24
24
|
}
|
|
@@ -26,11 +26,11 @@ let t = class extends g(f) {
|
|
|
26
26
|
this.closestForm = this.closest("form");
|
|
27
27
|
}
|
|
28
28
|
get classes() {
|
|
29
|
-
const
|
|
29
|
+
const o = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
30
30
|
return {
|
|
31
31
|
button: !0,
|
|
32
32
|
custom: this.htmlTagName === "custom",
|
|
33
|
-
[
|
|
33
|
+
[o]: !!o,
|
|
34
34
|
[this.mode]: !!this.mode,
|
|
35
35
|
[this.variant]: !!this.variant,
|
|
36
36
|
rounded: this.rounded,
|
|
@@ -39,14 +39,14 @@ let t = class extends g(f) {
|
|
|
39
39
|
"full-width": this.fullWidth
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
handleClick(
|
|
43
|
-
if (this.href ||
|
|
44
|
-
const
|
|
42
|
+
handleClick(o) {
|
|
43
|
+
if (this.href || o.preventDefault(), this.closestForm && this.type === "submit") {
|
|
44
|
+
const r = new Event("submit", {
|
|
45
45
|
bubbles: !0,
|
|
46
46
|
composed: !0,
|
|
47
47
|
cancelable: !0
|
|
48
48
|
});
|
|
49
|
-
this.closestForm.dispatchEvent(
|
|
49
|
+
this.closestForm.dispatchEvent(r);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
get iconTemplate() {
|
|
@@ -56,7 +56,7 @@ let t = class extends g(f) {
|
|
|
56
56
|
}) : u;
|
|
57
57
|
}
|
|
58
58
|
get loadingTemplate() {
|
|
59
|
-
return this.loading ?
|
|
59
|
+
return this.loading ? s`
|
|
60
60
|
<span class="loading-dots">
|
|
61
61
|
<span>.</span>
|
|
62
62
|
<span>.</span>
|
|
@@ -64,8 +64,11 @@ let t = class extends g(f) {
|
|
|
64
64
|
</span>
|
|
65
65
|
` : u;
|
|
66
66
|
}
|
|
67
|
+
get contentTemplate() {
|
|
68
|
+
return this.loading && this.textLoading ? s`${this.textLoading}` : s`<slot></slot>`;
|
|
69
|
+
}
|
|
67
70
|
get cssTokens() {
|
|
68
|
-
return
|
|
71
|
+
return $`
|
|
69
72
|
<style>
|
|
70
73
|
:host{
|
|
71
74
|
color-scheme: ${this.mode};
|
|
@@ -78,60 +81,65 @@ let t = class extends g(f) {
|
|
|
78
81
|
</style>`;
|
|
79
82
|
}
|
|
80
83
|
render() {
|
|
81
|
-
return
|
|
84
|
+
return s`
|
|
82
85
|
${this.cssTokens}
|
|
83
86
|
${T(this.htmlTagName || "button", [
|
|
84
87
|
[
|
|
85
88
|
"button",
|
|
86
89
|
() => {
|
|
87
|
-
var
|
|
88
|
-
return
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
var o;
|
|
91
|
+
return s`
|
|
92
|
+
<div class=${d(this.classes)}>
|
|
93
|
+
<button
|
|
94
|
+
class="inner"
|
|
95
|
+
aria-label=${(o = this.textContent) == null ? void 0 : o.replace(/^\s+|\s+$/g, "")}
|
|
96
|
+
type=${this.type}
|
|
97
|
+
@click=${this.handleClick}
|
|
98
|
+
?disabled=${this.disabled}
|
|
99
|
+
>
|
|
100
|
+
${a(this.iconPosition === "left", () => s` ${this.iconTemplate} `)}
|
|
101
|
+
<span class="container">
|
|
102
|
+
${this.contentTemplate}
|
|
103
|
+
${this.loadingTemplate}
|
|
104
|
+
</span>
|
|
105
|
+
${a(this.iconPosition === "right", () => s` ${this.iconTemplate} `)}
|
|
106
|
+
</button>
|
|
107
|
+
</div>
|
|
103
108
|
`;
|
|
104
109
|
}
|
|
105
110
|
],
|
|
106
111
|
[
|
|
107
112
|
"a",
|
|
108
113
|
() => {
|
|
109
|
-
var
|
|
110
|
-
return
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
114
|
+
var o;
|
|
115
|
+
return s`
|
|
116
|
+
<div class=${d(this.classes)}>
|
|
117
|
+
<a
|
|
118
|
+
class="inner"
|
|
119
|
+
aria-label=${(o = this.textContent) == null ? void 0 : o.replace(/^\s+|\s+$/g, "")}
|
|
120
|
+
href=${this.href}
|
|
121
|
+
rel=${this.rel}
|
|
122
|
+
target=${this.target}
|
|
123
|
+
@click=${this.handleClick}
|
|
124
|
+
>
|
|
125
|
+
${a(this.iconPosition === "left", () => s`${this.iconTemplate}`)}
|
|
126
|
+
<span class="container">
|
|
127
|
+
${this.contentTemplate}
|
|
128
|
+
${this.loadingTemplate}
|
|
129
|
+
</span>
|
|
130
|
+
${a(this.iconPosition === "right", () => s`${this.iconTemplate}`)}
|
|
131
|
+
</a>
|
|
132
|
+
</div>
|
|
127
133
|
`;
|
|
128
134
|
}
|
|
129
135
|
],
|
|
130
136
|
[
|
|
131
137
|
"custom",
|
|
132
|
-
() =>
|
|
138
|
+
() => s`
|
|
133
139
|
<div class=${d(this.classes)}>
|
|
134
|
-
|
|
140
|
+
${a(this.iconPosition === "left", () => s`${this.iconTemplate}`)}
|
|
141
|
+
${this.loading && this.textLoading ? s`<span class="container">${this.textLoading}${this.loadingTemplate}</span>` : s`<slot></slot>${this.loadingTemplate}`}
|
|
142
|
+
${a(this.iconPosition === "right", () => s`${this.iconTemplate}`)}
|
|
135
143
|
</div>
|
|
136
144
|
`
|
|
137
145
|
]
|
|
@@ -139,57 +147,60 @@ let t = class extends g(f) {
|
|
|
139
147
|
`;
|
|
140
148
|
}
|
|
141
149
|
};
|
|
142
|
-
t.styles = [S,
|
|
150
|
+
t.styles = [S, x, P];
|
|
143
151
|
e([
|
|
144
|
-
|
|
152
|
+
i({ type: String })
|
|
145
153
|
], t.prototype, "variant", 2);
|
|
146
154
|
e([
|
|
147
|
-
|
|
155
|
+
i({ type: String, reflect: !0 })
|
|
148
156
|
], t.prototype, "mode", 2);
|
|
149
157
|
e([
|
|
150
|
-
|
|
158
|
+
i({ type: String, converter: b })
|
|
151
159
|
], t.prototype, "size", 2);
|
|
152
160
|
e([
|
|
153
|
-
|
|
161
|
+
i({ type: Boolean, converter: l })
|
|
154
162
|
], t.prototype, "disabled", 2);
|
|
155
163
|
e([
|
|
156
|
-
|
|
164
|
+
i({ type: Boolean, converter: l })
|
|
157
165
|
], t.prototype, "destructive", 2);
|
|
158
166
|
e([
|
|
159
|
-
|
|
167
|
+
i({ type: String, attribute: "icon-name" })
|
|
160
168
|
], t.prototype, "iconName", 2);
|
|
161
169
|
e([
|
|
162
|
-
|
|
170
|
+
i({ type: String, attribute: "html-tag-name" })
|
|
163
171
|
], t.prototype, "htmlTagName", 2);
|
|
164
172
|
e([
|
|
165
|
-
|
|
173
|
+
i({ type: String, reflect: !0 })
|
|
166
174
|
], t.prototype, "href", 2);
|
|
167
175
|
e([
|
|
168
|
-
|
|
176
|
+
i({ type: String, reflect: !0 })
|
|
169
177
|
], t.prototype, "rel", 2);
|
|
170
178
|
e([
|
|
171
|
-
|
|
179
|
+
i({ type: String, reflect: !0 })
|
|
172
180
|
], t.prototype, "target", 2);
|
|
173
181
|
e([
|
|
174
|
-
|
|
182
|
+
i({ type: String })
|
|
175
183
|
], t.prototype, "type", 2);
|
|
176
184
|
e([
|
|
177
|
-
|
|
185
|
+
i({ type: String, attribute: "icon-position" })
|
|
178
186
|
], t.prototype, "iconPosition", 2);
|
|
179
187
|
e([
|
|
180
|
-
|
|
188
|
+
i({ type: Boolean, converter: l })
|
|
181
189
|
], t.prototype, "rounded", 2);
|
|
182
190
|
e([
|
|
183
|
-
|
|
191
|
+
i({ type: Boolean, converter: l, attribute: "full-width" })
|
|
184
192
|
], t.prototype, "fullWidth", 2);
|
|
185
193
|
e([
|
|
186
|
-
|
|
194
|
+
i({ type: Boolean, converter: l })
|
|
187
195
|
], t.prototype, "loading", 2);
|
|
188
196
|
e([
|
|
189
|
-
|
|
197
|
+
i({ type: String, attribute: "text-loading" })
|
|
198
|
+
], t.prototype, "textLoading", 2);
|
|
199
|
+
e([
|
|
200
|
+
v()
|
|
190
201
|
], t.prototype, "closestForm", 2);
|
|
191
202
|
t = e([
|
|
192
|
-
|
|
203
|
+
f("ds-button")
|
|
193
204
|
], t);
|
|
194
205
|
export {
|
|
195
206
|
t as DsButton
|
|
@@ -2,7 +2,7 @@ import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@li
|
|
|
2
2
|
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 { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
-
const
|
|
5
|
+
const a = t`
|
|
6
6
|
:host {
|
|
7
7
|
display: contents;
|
|
8
8
|
}
|
|
@@ -22,6 +22,44 @@ const e = t`
|
|
|
22
22
|
.button.full-width {
|
|
23
23
|
width: 100%;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
.inner,
|
|
27
|
+
.custom ::slotted(*) {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
gap: var(--ui-kit-button-gap, 0);
|
|
34
|
+
padding: 0;
|
|
35
|
+
margin: 0;
|
|
36
|
+
background: transparent;
|
|
37
|
+
border: none;
|
|
38
|
+
color: inherit;
|
|
39
|
+
font: inherit;
|
|
40
|
+
text-transform: inherit;
|
|
41
|
+
letter-spacing: inherit;
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
cursor: inherit;
|
|
44
|
+
outline: none;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.custom ::slotted(*) {
|
|
49
|
+
width: auto;
|
|
50
|
+
flex: 1;
|
|
51
|
+
min-width: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.custom ::slotted(*:disabled),
|
|
55
|
+
.custom.disabled ::slotted(*) {
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
cursor: default;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.custom ::slotted(*:focus-visible) {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
25
63
|
`, s = t`
|
|
26
64
|
.naked.container {
|
|
27
65
|
display: inline-flex;
|
|
@@ -32,7 +70,7 @@ const e = t`
|
|
|
32
70
|
text-overflow: ellipsis;
|
|
33
71
|
white-space: nowrap;
|
|
34
72
|
}
|
|
35
|
-
`,
|
|
73
|
+
`, d = t`
|
|
36
74
|
.loading-dots {
|
|
37
75
|
display: inline-flex;
|
|
38
76
|
align-items: baseline;
|
|
@@ -110,7 +148,7 @@ const e = t`
|
|
|
110
148
|
}
|
|
111
149
|
`;
|
|
112
150
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
151
|
+
a as buttonStyles,
|
|
152
|
+
d as loadingDotsStyles,
|
|
115
153
|
s as textStyles
|
|
116
154
|
};
|
|
@@ -41,11 +41,18 @@ const e = o`
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.scroll-button {
|
|
44
|
+
display: none;
|
|
44
45
|
position: absolute;
|
|
45
46
|
top: 0;
|
|
46
47
|
z-index: 2;
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
@media (min-width: 768px) {
|
|
51
|
+
.scroll-button {
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
.scroll-button.left {
|
|
50
57
|
left: 0;
|
|
51
58
|
}
|