@cupra/ui-kit 2.0.0-canary.76 → 2.0.0-canary.78
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-checkbox/ds-checkbox.cjs +8 -8
- package/dist/cjs/components/ds-checkbox/styles/common.styles.cjs +0 -1
- package/dist/cjs/components/ds-checkbox-group/ds-checkbox-group.cjs +15 -0
- package/dist/cjs/components/ds-checkbox-group/styles/common.styles.cjs +18 -0
- package/dist/cjs/components/ds-main-title/ds-main-title.cjs +5 -5
- package/dist/cjs/components/ds-main-title/styles/common.styles.cjs +13 -5
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/index.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-checkbox/ds-checkbox.js +103 -45
- package/dist/esm/components/ds-checkbox/styles/common.styles.js +0 -1
- package/dist/esm/components/ds-checkbox-group/ds-checkbox-group.js +83 -0
- package/dist/esm/components/ds-checkbox-group/styles/common.styles.js +25 -0
- package/dist/esm/components/ds-main-title/ds-main-title.js +27 -19
- package/dist/esm/components/ds-main-title/styles/common.styles.js +13 -5
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/index.js +3 -2
- 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-checkbox/ds-checkbox.d.ts +16 -3
- package/dist/types/components/ds-checkbox/ds-checkbox.types.d.ts +1 -1
- package/dist/types/components/ds-checkbox-group/ds-checkbox-group.d.ts +28 -0
- package/dist/types/components/ds-checkbox-group/ds-checkbox-group.test.d.ts +8 -0
- package/dist/types/components/ds-checkbox-group/ds-checkbox-group.types.d.ts +10 -0
- package/dist/types/components/ds-checkbox-group/styles/common.styles.d.ts +1 -0
- package/dist/types/components/ds-main-title/ds-main-title.d.ts +3 -3
- package/dist/types/components/ds-main-title/ds-main-title.types.d.ts +4 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist-react/cjs/components/ds-checkbox/ds-checkbox.cjs +8 -8
- package/dist-react/cjs/components/ds-checkbox/styles/common.styles.cjs +0 -1
- package/dist-react/cjs/components/ds-checkbox-group/ds-checkbox-group.cjs +15 -0
- package/dist-react/cjs/components/ds-checkbox-group/styles/common.styles.cjs +18 -0
- package/dist-react/cjs/components/ds-main-title/ds-main-title.cjs +5 -5
- package/dist-react/cjs/components/ds-main-title/styles/common.styles.cjs +13 -5
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/index.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-checkbox/ds-checkbox.js +103 -45
- package/dist-react/esm/components/ds-checkbox/styles/common.styles.js +0 -1
- package/dist-react/esm/components/ds-checkbox-group/ds-checkbox-group.js +83 -0
- package/dist-react/esm/components/ds-checkbox-group/styles/common.styles.js +25 -0
- package/dist-react/esm/components/ds-main-title/ds-main-title.js +27 -19
- package/dist-react/esm/components/ds-main-title/styles/common.styles.js +13 -5
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/index.js +3 -2
- 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-checkbox/ds-checkbox.d.ts +16 -3
- package/dist-react/types/components/ds-checkbox/ds-checkbox.types.d.ts +1 -1
- package/dist-react/types/components/ds-checkbox-group/ds-checkbox-group.d.ts +28 -0
- package/dist-react/types/components/ds-checkbox-group/ds-checkbox-group.test.d.ts +8 -0
- package/dist-react/types/components/ds-checkbox-group/ds-checkbox-group.types.d.ts +10 -0
- package/dist-react/types/components/ds-checkbox-group/styles/common.styles.d.ts +1 -0
- package/dist-react/types/components/ds-main-title/ds-main-title.d.ts +3 -3
- package/dist-react/types/components/ds-main-title/ds-main-title.types.d.ts +4 -1
- package/dist-react/types/components/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,26 +1,75 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { UiKitElement as u } from "../base/UiKitElement.js";
|
|
2
|
+
import { checkboxGroupDisabledContext as b, checkboxGroupErrorContext as f, checkboxGroupSizeContext as v } from "../ds-checkbox-group/ds-checkbox-group.js";
|
|
3
|
+
import { customUiKitElement as y } from "../../decorators/customUiKitElement.js";
|
|
4
|
+
import { ContextConsumer as x } from "../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js";
|
|
5
|
+
import { FormAssociatedMixin as k } from "../../mixins/FormAssociatedMixin.js";
|
|
4
6
|
import { booleanConverter as h } from "../../utils/booleanConverter.js";
|
|
5
|
-
import { htmlWithTokens as
|
|
7
|
+
import { htmlWithTokens as g } from "../../utils/htmlWithTokens.js";
|
|
6
8
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
7
|
-
import { nothing as
|
|
9
|
+
import { nothing as c, html as a } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
8
10
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
9
|
-
import { property as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
12
|
+
import { state as m } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
13
|
+
import { classMap as E } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
14
|
+
import { commonStyles as $ } from "./styles/common.styles.js";
|
|
15
|
+
var C = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, t = (r, o, n, p) => {
|
|
16
|
+
for (var s = p > 1 ? void 0 : p ? _(o, n) : o, l = r.length - 1, d; l >= 0; l--)
|
|
17
|
+
(d = r[l]) && (s = (p ? d(o, n, s) : d(s)) || s);
|
|
18
|
+
return p && s && C(o, n, s), s;
|
|
16
19
|
};
|
|
17
|
-
let e = class extends
|
|
20
|
+
let e = class extends k(u) {
|
|
18
21
|
constructor() {
|
|
19
|
-
super(...arguments), this.inputPlacement = "left", this.checked = !1, this.required = !1, this.
|
|
22
|
+
super(...arguments), 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;
|
|
20
23
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback(), queueMicrotask(() => {
|
|
26
|
+
this.createContextConsumers([
|
|
27
|
+
{
|
|
28
|
+
context: b,
|
|
29
|
+
callback: (r) => {
|
|
30
|
+
this.disabledGroup = r;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
context: f,
|
|
35
|
+
callback: (r) => {
|
|
36
|
+
this.errorGroup = r;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
context: v,
|
|
41
|
+
callback: (r) => {
|
|
42
|
+
this.sizeGroup = r;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
createContextConsumers(r) {
|
|
50
|
+
r.forEach(({ context: o, callback: n }) => {
|
|
51
|
+
new x(this, {
|
|
52
|
+
context: o,
|
|
53
|
+
callback: n,
|
|
54
|
+
subscribe: !0
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
get disabled() {
|
|
59
|
+
return this.disabledGroup ?? this._disabled;
|
|
60
|
+
}
|
|
61
|
+
get size() {
|
|
62
|
+
return this.sizeGroup || this._size;
|
|
63
|
+
}
|
|
64
|
+
get forcedError() {
|
|
65
|
+
return this._forcedError;
|
|
66
|
+
}
|
|
67
|
+
get error() {
|
|
68
|
+
return this.errorGroup ?? !!this._forcedError;
|
|
69
|
+
}
|
|
70
|
+
handleChange(r) {
|
|
71
|
+
const o = r.target;
|
|
72
|
+
this.checked = o.checked, this.dispatchEvent(
|
|
24
73
|
new CustomEvent("change", {
|
|
25
74
|
bubbles: !0,
|
|
26
75
|
composed: !0,
|
|
@@ -39,19 +88,19 @@ let e = class extends v(m) {
|
|
|
39
88
|
[this.size]: !!this.size,
|
|
40
89
|
disabled: this.disabled,
|
|
41
90
|
checked: this.checked,
|
|
42
|
-
error:
|
|
91
|
+
error: this.error
|
|
43
92
|
};
|
|
44
93
|
}
|
|
45
94
|
get iconTemplate() {
|
|
46
|
-
if (!this.checked) return
|
|
47
|
-
const
|
|
95
|
+
if (!this.checked) return c;
|
|
96
|
+
const r = this.indeterminate ? "minus" : "check";
|
|
48
97
|
return this.componentFactory.createIcon({
|
|
49
98
|
class: "icon",
|
|
50
|
-
"icon-name":
|
|
99
|
+
"icon-name": r
|
|
51
100
|
});
|
|
52
101
|
}
|
|
53
102
|
get styleTokens() {
|
|
54
|
-
return
|
|
103
|
+
return g`
|
|
55
104
|
<style>
|
|
56
105
|
:host{
|
|
57
106
|
color-scheme: ${this.mode};
|
|
@@ -63,7 +112,7 @@ let e = class extends v(m) {
|
|
|
63
112
|
render() {
|
|
64
113
|
return a`
|
|
65
114
|
${this.styleTokens}
|
|
66
|
-
<div class=${
|
|
115
|
+
<div class=${E(this.classes)}>
|
|
67
116
|
<label>
|
|
68
117
|
<span class="checkmark-container">
|
|
69
118
|
<span class="checkmark">
|
|
@@ -83,59 +132,68 @@ let e = class extends v(m) {
|
|
|
83
132
|
<div class="text-container">
|
|
84
133
|
<div class="text">
|
|
85
134
|
<slot></slot>
|
|
86
|
-
${this.infoText ? a` <div class="info-text">${this.infoText}</div> ` :
|
|
135
|
+
${this.infoText ? a` <div class="info-text">${this.infoText}</div> ` : c}
|
|
87
136
|
</div>
|
|
88
|
-
${this.helperText ? a` <div class="helper-text">${this.helperText}</div> ` :
|
|
89
|
-
${this.forcedError ? a` <div class="error-text">${this.forcedError}</div> ` :
|
|
90
|
-
${this.invalidError && !this.forcedError ? a`<div class="error-text invalid-error">${this.invalidError}</div>` :
|
|
137
|
+
${this.helperText ? a` <div class="helper-text">${this.helperText}</div> ` : c}
|
|
138
|
+
${this.forcedError ? a` <div class="error-text">${this.forcedError}</div> ` : c}
|
|
139
|
+
${this.invalidError && !this.forcedError ? a`<div class="error-text invalid-error">${this.invalidError}</div>` : c}
|
|
91
140
|
</div>
|
|
92
141
|
</label>
|
|
93
142
|
</div>
|
|
94
143
|
`;
|
|
95
144
|
}
|
|
96
145
|
};
|
|
97
|
-
e.styles = [
|
|
146
|
+
e.styles = [$];
|
|
98
147
|
t([
|
|
99
|
-
|
|
148
|
+
i({ type: String })
|
|
100
149
|
], e.prototype, "name", 2);
|
|
101
150
|
t([
|
|
102
|
-
|
|
151
|
+
i({ type: String })
|
|
103
152
|
], e.prototype, "value", 2);
|
|
104
153
|
t([
|
|
105
|
-
|
|
154
|
+
i({ type: String, attribute: "input-placement" })
|
|
106
155
|
], e.prototype, "inputPlacement", 2);
|
|
107
156
|
t([
|
|
108
|
-
|
|
157
|
+
i({ type: Boolean, converter: h, reflect: !0 })
|
|
109
158
|
], e.prototype, "checked", 2);
|
|
110
159
|
t([
|
|
111
|
-
|
|
160
|
+
i({ type: Boolean, converter: h })
|
|
112
161
|
], e.prototype, "required", 2);
|
|
113
162
|
t([
|
|
114
|
-
|
|
115
|
-
], e.prototype, "
|
|
163
|
+
i({ type: Boolean, converter: h, attribute: "disabled" })
|
|
164
|
+
], e.prototype, "_disabled", 2);
|
|
116
165
|
t([
|
|
117
|
-
|
|
166
|
+
i({ type: String, reflect: !0 })
|
|
118
167
|
], e.prototype, "mode", 2);
|
|
119
168
|
t([
|
|
120
|
-
|
|
121
|
-
], e.prototype, "
|
|
169
|
+
i({ type: String, attribute: "size" })
|
|
170
|
+
], e.prototype, "_size", 2);
|
|
122
171
|
t([
|
|
123
|
-
|
|
172
|
+
i({ type: String, attribute: "helper-text" })
|
|
124
173
|
], e.prototype, "helperText", 2);
|
|
125
174
|
t([
|
|
126
|
-
|
|
175
|
+
i({ type: String, attribute: "info-text" })
|
|
127
176
|
], e.prototype, "infoText", 2);
|
|
128
177
|
t([
|
|
129
|
-
|
|
130
|
-
], e.prototype, "
|
|
178
|
+
i({ type: String, attribute: "forced-error" })
|
|
179
|
+
], e.prototype, "_forcedError", 2);
|
|
131
180
|
t([
|
|
132
|
-
|
|
181
|
+
i({ type: String, attribute: "invalid-error" })
|
|
133
182
|
], e.prototype, "invalidError", 2);
|
|
134
183
|
t([
|
|
135
|
-
|
|
184
|
+
i({ type: Boolean, converter: h })
|
|
136
185
|
], e.prototype, "indeterminate", 2);
|
|
186
|
+
t([
|
|
187
|
+
m()
|
|
188
|
+
], e.prototype, "disabledGroup", 2);
|
|
189
|
+
t([
|
|
190
|
+
m()
|
|
191
|
+
], e.prototype, "errorGroup", 2);
|
|
192
|
+
t([
|
|
193
|
+
m()
|
|
194
|
+
], e.prototype, "sizeGroup", 2);
|
|
137
195
|
e = t([
|
|
138
|
-
|
|
196
|
+
y("ds-checkbox")
|
|
139
197
|
], e);
|
|
140
198
|
export {
|
|
141
199
|
e as DsCheckbox
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { UiKitElement as b } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as u } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { createContext as s } from "../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/create-context.js";
|
|
4
|
+
import { provide as i } from "../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js";
|
|
5
|
+
import { booleanConverter as d } from "../../utils/booleanConverter.js";
|
|
6
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
7
|
+
import { nothing as m, html as x } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
8
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
9
|
+
import { property as o } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
10
|
+
import { classMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
11
|
+
import { commonStyles as y } from "./styles/common.styles.js";
|
|
12
|
+
var f = Object.defineProperty, g = Object.getOwnPropertyDescriptor, r = (h, p, n, c) => {
|
|
13
|
+
for (var t = c > 1 ? void 0 : c ? g(p, n) : p, l = h.length - 1, a; l >= 0; l--)
|
|
14
|
+
(a = h[l]) && (t = (c ? a(p, n, t) : a(t)) || t);
|
|
15
|
+
return c && t && f(p, n, t), t;
|
|
16
|
+
};
|
|
17
|
+
const S = s(Symbol("ds-checkbox-group:disabled")), T = s(Symbol("ds-checkbox-group:error")), k = s(Symbol("ds-checkbox-group:error-text")), C = s(Symbol("ds-checkbox-group:helper-text")), $ = s(Symbol("ds-checkbox-group:size"));
|
|
18
|
+
let e = class extends b {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.error = !1, this.errorText = "", this.helperText = "", this.disabled = !1, this.size = "medium", this.orientation = "vertical";
|
|
21
|
+
}
|
|
22
|
+
get classes() {
|
|
23
|
+
return {
|
|
24
|
+
container: !0,
|
|
25
|
+
error: this.error,
|
|
26
|
+
disabled: !!this.disabled,
|
|
27
|
+
[this.size]: !0,
|
|
28
|
+
[this.orientation]: !0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return x`
|
|
33
|
+
<div
|
|
34
|
+
data-testid="ds-checkbox-group-container"
|
|
35
|
+
class=${v(this.classes)}
|
|
36
|
+
.aria-invalid=${this.error}
|
|
37
|
+
>
|
|
38
|
+
<slot name="title"></slot>
|
|
39
|
+
<slot name="description"></slot>
|
|
40
|
+
<div class="checkboxes-container">
|
|
41
|
+
<slot></slot>
|
|
42
|
+
</div>
|
|
43
|
+
${!this.error && this.helperText ? x`<div class="helper-text">${this.helperText}</div>` : m}
|
|
44
|
+
${this.error && this.errorText ? x`<div class="error-text">${this.errorText}</div>` : m}
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
e.styles = [y];
|
|
50
|
+
r([
|
|
51
|
+
i({ context: T }),
|
|
52
|
+
o({ type: Boolean, converter: d })
|
|
53
|
+
], e.prototype, "error", 2);
|
|
54
|
+
r([
|
|
55
|
+
i({ context: k }),
|
|
56
|
+
o({ type: String, attribute: "error-text" })
|
|
57
|
+
], e.prototype, "errorText", 2);
|
|
58
|
+
r([
|
|
59
|
+
i({ context: C }),
|
|
60
|
+
o({ type: String, attribute: "helper-text" })
|
|
61
|
+
], e.prototype, "helperText", 2);
|
|
62
|
+
r([
|
|
63
|
+
i({ context: S }),
|
|
64
|
+
o({ type: Boolean, converter: d })
|
|
65
|
+
], e.prototype, "disabled", 2);
|
|
66
|
+
r([
|
|
67
|
+
i({ context: $ }),
|
|
68
|
+
o({ type: String })
|
|
69
|
+
], e.prototype, "size", 2);
|
|
70
|
+
r([
|
|
71
|
+
o({ type: String, reflect: !0 })
|
|
72
|
+
], e.prototype, "orientation", 2);
|
|
73
|
+
e = r([
|
|
74
|
+
u("ds-checkbox-group")
|
|
75
|
+
], e);
|
|
76
|
+
export {
|
|
77
|
+
e as DsCheckboxGroup,
|
|
78
|
+
S as checkboxGroupDisabledContext,
|
|
79
|
+
T as checkboxGroupErrorContext,
|
|
80
|
+
k as checkboxGroupErrorTextContext,
|
|
81
|
+
C as checkboxGroupHelperTextContext,
|
|
82
|
+
$ as checkboxGroupSizeContext
|
|
83
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { css as o } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const s = o`
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.container.vertical ::slotted(ds-checkbox) {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.container.horizontal ::slotted(ds-checkbox) {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
vertical-align: top;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export {
|
|
24
|
+
s as commonStyles
|
|
25
|
+
};
|
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
1
|
+
import { UiKitElement as a } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as p } from "../../decorators/customUiKitElement.js";
|
|
3
3
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
4
|
-
import { html as
|
|
4
|
+
import { html as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
5
5
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import { property as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
7
|
+
import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
8
|
+
import { commonStyles as g } from "./styles/common.styles.js";
|
|
9
|
+
var v = Object.defineProperty, h = Object.getOwnPropertyDescriptor, m = (n, e, i, s) => {
|
|
10
|
+
for (var t = s > 1 ? void 0 : s ? h(e, i) : e, l = n.length - 1, o; l >= 0; l--)
|
|
11
|
+
(o = n[l]) && (t = (s ? o(e, i, t) : o(t)) || t);
|
|
12
|
+
return s && t && v(e, i, t), t;
|
|
12
13
|
};
|
|
13
|
-
let r = class extends
|
|
14
|
-
|
|
14
|
+
let r = class extends a {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments), this.alignment = "left";
|
|
17
|
+
}
|
|
18
|
+
get classes() {
|
|
15
19
|
return {
|
|
16
|
-
container: !0
|
|
20
|
+
container: !0,
|
|
21
|
+
[`alignment-${this.alignment}`]: !!this.alignment
|
|
17
22
|
};
|
|
18
23
|
}
|
|
19
24
|
render() {
|
|
20
|
-
return
|
|
21
|
-
<div
|
|
22
|
-
<slot name="title"></slot>
|
|
23
|
-
<slot name="
|
|
25
|
+
return c`
|
|
26
|
+
<div class=${u(this.classes)} part="container">
|
|
27
|
+
<slot name="title" class="title"></slot>
|
|
28
|
+
<slot name="subtitle" class="subtitle"></slot>
|
|
24
29
|
</div>
|
|
25
30
|
`;
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
|
-
r.styles = [
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
r.styles = [g];
|
|
34
|
+
m([
|
|
35
|
+
f({ type: String })
|
|
36
|
+
], r.prototype, "alignment", 2);
|
|
37
|
+
r = m([
|
|
38
|
+
p("ds-main-title")
|
|
31
39
|
], r);
|
|
32
40
|
export {
|
|
33
41
|
r as DsMainTitle
|
|
@@ -2,18 +2,26 @@ 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 o } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
-
const
|
|
5
|
+
const e = o`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
|
-
width: 100%;
|
|
9
8
|
box-sizing: border-box;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
.container {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.subtitle {
|
|
18
|
+
margin: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
::slotted(*) {
|
|
14
22
|
margin: 0;
|
|
15
23
|
}
|
|
16
24
|
`;
|
|
17
25
|
export {
|
|
18
|
-
|
|
26
|
+
e as commonStyles
|
|
19
27
|
};
|
|
@@ -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.
|
|
57
|
+
const s = "/2.0.0-canary.78", 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");
|
package/dist-react/esm/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import "./components/ds-bullets/ds-bullets.js";
|
|
|
11
11
|
import "./components/ds-button/ds-button.js";
|
|
12
12
|
import "./components/ds-carousel-indicator/ds-carousel-indicator.js";
|
|
13
13
|
import "./components/ds-checkbox/ds-checkbox.js";
|
|
14
|
+
import "./components/ds-checkbox-group/ds-checkbox-group.js";
|
|
14
15
|
import "./components/ds-chip/ds-chip.js";
|
|
15
16
|
import "./components/ds-chips/ds-chips.js";
|
|
16
17
|
import "./components/ds-currency/ds-currency.js";
|
|
@@ -76,7 +77,7 @@ import "./components/ds-navigation-controls/ds-navigation-controls.js";
|
|
|
76
77
|
import "./components/ds-table/ds-table.js";
|
|
77
78
|
import "./components/ds-table-row/ds-table-row.js";
|
|
78
79
|
import "./components/ds-table-cell/ds-table-cell.js";
|
|
79
|
-
import { iconNames as
|
|
80
|
+
import { iconNames as Bo } from "./components/ds-icon/iconNames.js";
|
|
80
81
|
export {
|
|
81
|
-
|
|
82
|
+
Bo as iconNames
|
|
82
83
|
};
|
|
@@ -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.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.78"), 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.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.78"), 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.
|
|
10
|
+
const c = `https://ds-assets.cupra.com/2.0.0-canary.78/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-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-78"), 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-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-78"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
import type { DsCheckboxGroupAttrs } from '../ds-checkbox-group/ds-checkbox-group.types.ts';
|
|
2
3
|
import type { DsCheckboxAttrs } from './ds-checkbox.types';
|
|
3
4
|
declare const DsCheckbox_base: typeof UiKitElement;
|
|
4
5
|
export declare class DsCheckbox extends DsCheckbox_base {
|
|
@@ -7,15 +8,27 @@ export declare class DsCheckbox extends DsCheckbox_base {
|
|
|
7
8
|
inputPlacement: DsCheckboxAttrs['input-placement'];
|
|
8
9
|
checked: DsCheckboxAttrs['checked'];
|
|
9
10
|
required: DsCheckboxAttrs['required'];
|
|
10
|
-
|
|
11
|
+
_disabled: DsCheckboxAttrs['disabled'];
|
|
11
12
|
mode: DsCheckboxAttrs['mode'];
|
|
12
|
-
|
|
13
|
+
_size: DsCheckboxAttrs['size'];
|
|
13
14
|
helperText: DsCheckboxAttrs['helper-text'];
|
|
14
15
|
infoText: DsCheckboxAttrs['info-text'];
|
|
15
|
-
|
|
16
|
+
_forcedError: DsCheckboxAttrs['forced-error'];
|
|
16
17
|
invalidError: DsCheckboxAttrs['invalid-error'];
|
|
17
18
|
indeterminate: DsCheckboxAttrs['indeterminate'];
|
|
19
|
+
protected disabledGroup?: DsCheckboxGroupAttrs['disabled'];
|
|
20
|
+
protected errorGroup?: DsCheckboxGroupAttrs['error'];
|
|
21
|
+
protected sizeGroup?: DsCheckboxGroupAttrs['size'];
|
|
18
22
|
static styles: import("lit").CSSResult[];
|
|
23
|
+
connectedCallback(): void;
|
|
24
|
+
protected createContextConsumers(contexts: Array<{
|
|
25
|
+
context: any;
|
|
26
|
+
callback: any;
|
|
27
|
+
}>): void;
|
|
28
|
+
get disabled(): boolean;
|
|
29
|
+
get size(): DsCheckboxAttrs['size'];
|
|
30
|
+
protected get forcedError(): DsCheckboxAttrs['forced-error'];
|
|
31
|
+
protected get error(): boolean;
|
|
19
32
|
private handleChange;
|
|
20
33
|
protected get classes(): {
|
|
21
34
|
[x: string]: boolean;
|
|
@@ -6,7 +6,7 @@ export interface DsCheckboxAttrs extends CommonAttrs {
|
|
|
6
6
|
required?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
mode?: 'dark' | 'light';
|
|
9
|
-
size?: '
|
|
9
|
+
size?: 'large' | 'medium' | string;
|
|
10
10
|
'helper-text'?: string;
|
|
11
11
|
'info-text'?: string;
|
|
12
12
|
'forced-error'?: string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
import type { DsCheckboxGroupAttrs, Orientation } from './ds-checkbox-group.types.ts';
|
|
3
|
+
export declare const checkboxGroupDisabledContext: {
|
|
4
|
+
__context__: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const checkboxGroupErrorContext: {
|
|
7
|
+
__context__: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const checkboxGroupErrorTextContext: {
|
|
10
|
+
__context__: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const checkboxGroupHelperTextContext: {
|
|
13
|
+
__context__: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const checkboxGroupSizeContext: {
|
|
16
|
+
__context__: string;
|
|
17
|
+
};
|
|
18
|
+
export declare class DsCheckboxGroup extends UiKitElement {
|
|
19
|
+
static styles: import("lit").CSSResult[];
|
|
20
|
+
error: DsCheckboxGroupAttrs['error'];
|
|
21
|
+
errorText: DsCheckboxGroupAttrs['error-text'];
|
|
22
|
+
helperText: DsCheckboxGroupAttrs['helper-text'];
|
|
23
|
+
disabled: DsCheckboxGroupAttrs['disabled'];
|
|
24
|
+
size: DsCheckboxGroupAttrs['size'];
|
|
25
|
+
orientation: Orientation;
|
|
26
|
+
private get classes();
|
|
27
|
+
render(): import("lit").TemplateResult<1>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CommonAttrs } from '../../types/types';
|
|
2
|
+
export type Orientation = 'horizontal' | 'vertical';
|
|
3
|
+
export type DsCheckboxGroupAttrs = {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
'error-text'?: string;
|
|
6
|
+
'helper-text'?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
orientation?: Orientation;
|
|
9
|
+
size?: 'medium' | 'large' | (string & {});
|
|
10
|
+
} & CommonAttrs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
import type { DsMainTitleAttrs } from './ds-main-title.types.ts';
|
|
2
3
|
export declare class DsMainTitle extends UiKitElement {
|
|
3
4
|
static styles: import("lit").CSSResult[];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
5
|
+
alignment: DsMainTitleAttrs['alignment'];
|
|
6
|
+
private get classes();
|
|
7
7
|
render(): import("lit").TemplateResult<1>;
|
|
8
8
|
}
|
|
@@ -11,6 +11,7 @@ import './ds-bullets/ds-bullets.ts';
|
|
|
11
11
|
import './ds-button/ds-button.ts';
|
|
12
12
|
import './ds-carousel-indicator/ds-carousel-indicator.ts';
|
|
13
13
|
import './ds-checkbox/ds-checkbox.ts';
|
|
14
|
+
import './ds-checkbox-group/ds-checkbox-group.ts';
|
|
14
15
|
import './ds-chip/ds-chip.ts';
|
|
15
16
|
import './ds-chips/ds-chips.ts';
|
|
16
17
|
import './ds-currency/ds-currency.ts';
|