@cupra/ui-kit 1.1.0-canary.13 → 1.1.0-canary.15
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-list/ds-list.cjs +9 -0
- package/dist/cjs/components/ds-list/styles/common.styles.cjs +7 -0
- package/dist/cjs/components/ds-list/styles/cupra-diagonal.styles.cjs +38 -0
- package/dist/cjs/components/ds-list-item/ds-list-item.cjs +36 -0
- package/dist/cjs/components/ds-list-item/styles/common.styles.cjs +6 -0
- package/dist/cjs/components/ds-list-item/styles/cupra-diagonal.styles.cjs +108 -0
- package/dist/cjs/components/ds-textarea/ds-textarea.cjs +3 -3
- 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-list/ds-list.js +46 -0
- package/dist/esm/components/ds-list/styles/common.styles.js +11 -0
- package/dist/esm/components/ds-list/styles/cupra-diagonal.styles.js +42 -0
- package/dist/esm/components/ds-list-item/ds-list-item.js +114 -0
- package/dist/esm/components/ds-list-item/styles/common.styles.js +10 -0
- package/dist/esm/components/ds-list-item/styles/cupra-diagonal.styles.js +112 -0
- package/dist/esm/components/ds-textarea/ds-textarea.js +41 -38
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/utils/IconsManager.js +15 -15
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +6 -5
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/types/components/ds-list/ds-list.d.ts +10 -0
- package/dist/types/components/ds-list/ds-list.test.d.ts +8 -0
- package/dist/types/components/ds-list/ds-list.types.d.ts +4 -0
- package/dist/types/components/ds-list/styles/common.styles.d.ts +1 -0
- package/dist/types/components/ds-list/styles/cupra-diagonal.styles.d.ts +1 -0
- package/dist/types/components/ds-list-item/ds-list-item.d.ts +20 -0
- package/dist/types/components/ds-list-item/ds-list-item.test.d.ts +8 -0
- package/dist/types/components/ds-list-item/ds-list-item.types.d.ts +7 -0
- package/dist/types/components/ds-list-item/styles/common.styles.d.ts +1 -0
- package/dist/types/components/ds-list-item/styles/cupra-diagonal.styles.d.ts +1 -0
- package/dist/types/components/ds-textarea/ds-textarea.d.ts +1 -1
- package/dist/types/components/index.d.ts +2 -0
- package/dist-react/cjs/components/ds-list/ds-list.cjs +9 -0
- package/dist-react/cjs/components/ds-list/styles/common.styles.cjs +7 -0
- package/dist-react/cjs/components/ds-list/styles/cupra-diagonal.styles.cjs +38 -0
- package/dist-react/cjs/components/ds-list-item/ds-list-item.cjs +36 -0
- package/dist-react/cjs/components/ds-list-item/styles/common.styles.cjs +6 -0
- package/dist-react/cjs/components/ds-list-item/styles/cupra-diagonal.styles.cjs +108 -0
- package/dist-react/cjs/components/ds-textarea/ds-textarea.cjs +3 -3
- 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-list/ds-list.js +46 -0
- package/dist-react/esm/components/ds-list/styles/common.styles.js +11 -0
- package/dist-react/esm/components/ds-list/styles/cupra-diagonal.styles.js +42 -0
- package/dist-react/esm/components/ds-list-item/ds-list-item.js +114 -0
- package/dist-react/esm/components/ds-list-item/styles/common.styles.js +10 -0
- package/dist-react/esm/components/ds-list-item/styles/cupra-diagonal.styles.js +112 -0
- package/dist-react/esm/components/ds-textarea/ds-textarea.js +41 -38
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/index.js +4 -2
- package/dist-react/esm/utils/IconsManager.js +15 -15
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +6 -5
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/types/components/ds-list/ds-list.d.ts +10 -0
- package/dist-react/types/components/ds-list/ds-list.test.d.ts +8 -0
- package/dist-react/types/components/ds-list/ds-list.types.d.ts +4 -0
- package/dist-react/types/components/ds-list/styles/common.styles.d.ts +1 -0
- package/dist-react/types/components/ds-list/styles/cupra-diagonal.styles.d.ts +1 -0
- package/dist-react/types/components/ds-list-item/ds-list-item.d.ts +20 -0
- package/dist-react/types/components/ds-list-item/ds-list-item.test.d.ts +8 -0
- package/dist-react/types/components/ds-list-item/ds-list-item.types.d.ts +7 -0
- package/dist-react/types/components/ds-list-item/styles/common.styles.d.ts +1 -0
- package/dist-react/types/components/ds-list-item/styles/cupra-diagonal.styles.d.ts +1 -0
- package/dist-react/types/components/ds-textarea/ds-textarea.d.ts +1 -1
- package/dist-react/types/components/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { cssWithTokens as t } from "../../../utils/cssWithTokens.js";
|
|
2
|
+
const o = t`
|
|
3
|
+
.content {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: var(--dg-size-08) 0;
|
|
7
|
+
font-family: var(--dg-font-family-base);
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
gap: var(--dg-size-08);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.container {
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: var(--dg-size-08);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.container-text {
|
|
18
|
+
padding-right: var(--dg-size-24);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.content.info-variant,
|
|
22
|
+
.content.action-variant {
|
|
23
|
+
padding: var(--dg-size-08);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
::slotted([slot="input-left"]),
|
|
27
|
+
::slotted([slot="input-right"]) {
|
|
28
|
+
width: unset;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
::slotted([slot="primary-text"]) {
|
|
32
|
+
color: var(--dg-global-color-neutral-10);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::slotted([slot="primary-subtext"]),
|
|
36
|
+
::slotted([slot="secondary-text"]),
|
|
37
|
+
::slotted([slot="description-text"]) {
|
|
38
|
+
color: var(--dg-global-color-neutral-60);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::slotted([slot="description-text"]) {
|
|
42
|
+
padding-top: var(--dg-size-08);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([size="medium"]) ::slotted([slot="image-square"]) {
|
|
46
|
+
width: var(--dg-size-48);
|
|
47
|
+
height: var(--dg-size-48);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([size="small"]) ::slotted([slot="image-square"]) {
|
|
51
|
+
width: var(--dg-size-32);
|
|
52
|
+
height: var(--dg-size-32);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
::slotted([slot="image-wide"]) {
|
|
56
|
+
object-fit: cover;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([size="medium"]) ::slotted([slot="image-wide"]) {
|
|
60
|
+
width: var(--dg-size-96);
|
|
61
|
+
height: var(--dg-size-48);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([size="small"]) ::slotted([slot="image-wide"]) {
|
|
65
|
+
width: var(--dg-size-64);
|
|
66
|
+
height: var(--dg-size-32);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:host([size="small"]) ::slotted([slot="primary-text"]),
|
|
70
|
+
:host([size="small"]) ::slotted([slot="secondary-text"]),
|
|
71
|
+
:host([size="small"]) ::slotted([slot="description-text"]),
|
|
72
|
+
:host([size="small"]) ::slotted([slot="primary-subtext"]),
|
|
73
|
+
:host([size="small"]) ::slotted([slot="aside"]) {
|
|
74
|
+
font-size: var(--dg-font-size-body-m);
|
|
75
|
+
line-height: var(--dg-font-body-xs-medium-line-height);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([size="medium"]) ::slotted([slot="primary-text"]),
|
|
79
|
+
:host([size="medium"]) ::slotted([slot="secondary-text"]),
|
|
80
|
+
:host([size="medium"]) ::slotted([slot="description-text"]),
|
|
81
|
+
:host([size="medium"]) ::slotted([slot="primary-subtext"]),
|
|
82
|
+
:host([size="medium"]) ::slotted([slot="aside"]) {
|
|
83
|
+
font-size: var(--dg-font-size-body-l);
|
|
84
|
+
line-height: var(--dg-font-body-s-medium-line-height);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.content:hover {
|
|
88
|
+
background: var(--dg-color-field-bg-hover);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.content:active {
|
|
92
|
+
background: var(--dg-button-bg-color-action-pressed);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.content:focus-visible {
|
|
96
|
+
outline: var(--dg-border-width-02) solid var(--dg-outline-color-focus);
|
|
97
|
+
background-color: var(--dg-color-field-bg-focus);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.selected {
|
|
101
|
+
background: var(--dg-button-bg-color-action-hover);
|
|
102
|
+
border-left: var(--dg-size-04) solid var(--dg-color-field-bg-selected);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.disabled {
|
|
106
|
+
opacity: 0.25;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
`;
|
|
110
|
+
export {
|
|
111
|
+
o as cupraDiagonalStyles
|
|
112
|
+
};
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { UiKitElement as m } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as u } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { ViewportMixin as c } from "../../mixins/ViewportMixin.js";
|
|
4
|
+
import { inputStatesMixin as f } from "../../mixins/inputStatesMixin.js";
|
|
5
|
+
import { objectConverter as v } from "../../utils/objectConverter.js";
|
|
6
|
+
import { validateMaxLength as x } from "../../utils/validateMaxLength.js";
|
|
5
7
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
6
|
-
import { html as
|
|
8
|
+
import { html as a, nothing as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
7
9
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
8
10
|
import { property as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
9
|
-
import { classMap as
|
|
10
|
-
import { commonStyles as
|
|
11
|
-
var
|
|
12
|
-
for (var s = i > 1 ? void 0 : i ?
|
|
13
|
-
(d =
|
|
14
|
-
return i && s &&
|
|
11
|
+
import { classMap as g } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
12
|
+
import { commonStyles as E } from "./styles/common.styles.js";
|
|
13
|
+
var y = Object.defineProperty, S = Object.getOwnPropertyDescriptor, n = (t, e, o, i) => {
|
|
14
|
+
for (var s = i > 1 ? void 0 : i ? S(e, o) : e, h = t.length - 1, d; h >= 0; h--)
|
|
15
|
+
(d = t[h]) && (s = (i ? d(e, o, s) : d(s)) || s);
|
|
16
|
+
return i && s && y(e, o, s), s;
|
|
15
17
|
};
|
|
16
|
-
let
|
|
18
|
+
let r = class extends f(c(m)) {
|
|
17
19
|
constructor() {
|
|
18
20
|
super(...arguments), this.keyboardMode = !1, this.size = "medium", this.helperText = "", this.forcedError = "", this.invalidError = "", this.mode = "light";
|
|
19
21
|
}
|
|
20
|
-
onInputReady(
|
|
21
|
-
|
|
22
|
+
onInputReady(t) {
|
|
23
|
+
t.classList.add("ds-scroll");
|
|
22
24
|
}
|
|
23
25
|
get classes() {
|
|
26
|
+
const t = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
24
27
|
return {
|
|
25
28
|
container: !0,
|
|
26
29
|
error: !!this.forcedError,
|
|
27
|
-
[
|
|
30
|
+
[t]: !!t,
|
|
28
31
|
[this.mode]: !!this.mode,
|
|
29
32
|
disabled: this.inputStates.disabled,
|
|
30
33
|
filled: this.inputStates.filled,
|
|
@@ -34,8 +37,8 @@ let t = class extends c(u) {
|
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
render() {
|
|
37
|
-
return
|
|
38
|
-
<div class=${
|
|
40
|
+
return a`
|
|
41
|
+
<div class=${g(this.classes)}>
|
|
39
42
|
<div class="input-container">
|
|
40
43
|
<slot></slot>
|
|
41
44
|
</div>
|
|
@@ -50,38 +53,38 @@ let t = class extends c(u) {
|
|
|
50
53
|
}
|
|
51
54
|
get lengthTemplate() {
|
|
52
55
|
var e, o, i;
|
|
53
|
-
const
|
|
54
|
-
return
|
|
56
|
+
const t = (o = (e = this.nativeInput) == null ? void 0 : e.maxLength) == null ? void 0 : o.toString();
|
|
57
|
+
return x(t) ? a`<span class="char-counter">${((i = this.inputStates.currentValue) == null ? void 0 : i.length) || 0}/${t}</span>` : l;
|
|
55
58
|
}
|
|
56
59
|
get helperTextTemplate() {
|
|
57
|
-
return this.forcedError || this.inputStates.invalid && this.invalidError ? l :
|
|
60
|
+
return this.forcedError || this.inputStates.invalid && this.invalidError ? l : a`<span class="support-text helper-text">${this.helperText}</span>`;
|
|
58
61
|
}
|
|
59
62
|
get forcedErrorTemplate() {
|
|
60
|
-
return this.forcedError ?
|
|
63
|
+
return this.forcedError ? a`<span class="support-text error-text forced-error">${this.forcedError}</span>` : l;
|
|
61
64
|
}
|
|
62
65
|
get invalidErrorTemplate() {
|
|
63
|
-
return this.forcedError || !this.inputStates.invalid || !this.invalidError ? l :
|
|
66
|
+
return this.forcedError || !this.inputStates.invalid || !this.invalidError ? l : a`<span class="support-text error-text invalid-error">${this.invalidError}</span>`;
|
|
64
67
|
}
|
|
65
68
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
p({ type: String })
|
|
69
|
-
],
|
|
70
|
-
|
|
69
|
+
r.styles = [E];
|
|
70
|
+
n([
|
|
71
|
+
p({ type: String, converter: v })
|
|
72
|
+
], r.prototype, "size", 2);
|
|
73
|
+
n([
|
|
71
74
|
p({ type: String, attribute: "helper-text" })
|
|
72
|
-
],
|
|
73
|
-
|
|
75
|
+
], r.prototype, "helperText", 2);
|
|
76
|
+
n([
|
|
74
77
|
p({ type: String, attribute: "forced-error" })
|
|
75
|
-
],
|
|
76
|
-
|
|
78
|
+
], r.prototype, "forcedError", 2);
|
|
79
|
+
n([
|
|
77
80
|
p({ type: String, attribute: "invalid-error" })
|
|
78
|
-
],
|
|
79
|
-
|
|
81
|
+
], r.prototype, "invalidError", 2);
|
|
82
|
+
n([
|
|
80
83
|
p({ type: String })
|
|
81
|
-
],
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
],
|
|
84
|
+
], r.prototype, "mode", 2);
|
|
85
|
+
r = n([
|
|
86
|
+
u("ds-textarea")
|
|
87
|
+
], r);
|
|
85
88
|
export {
|
|
86
|
-
|
|
89
|
+
r as DsTextarea
|
|
87
90
|
};
|
|
@@ -57,7 +57,7 @@ let m = class extends F {
|
|
|
57
57
|
}
|
|
58
58
|
loadThemeStyles() {
|
|
59
59
|
return this.loadStyles ? new Promise((t, o) => {
|
|
60
|
-
const s = "/1.1.0-canary.
|
|
60
|
+
const s = "/1.1.0-canary.15", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
|
|
61
61
|
if (document.head.querySelector(`link[href="${r}"]`)) t();
|
|
62
62
|
else {
|
|
63
63
|
const e = `ui-kit-theme-${s}`, a = document.getElementById(e), n = document.createElement("link");
|
package/dist/esm/index.js
CHANGED
|
@@ -64,7 +64,9 @@ import "./components/ds-toggle-button/ds-toggle-button.js";
|
|
|
64
64
|
import "./components/ds-toggle-switch/ds-toggle-switch.js";
|
|
65
65
|
import "./components/ds-tooltip/ds-tooltip.js";
|
|
66
66
|
import "./components/ds-media-control/ds-media-control.js";
|
|
67
|
-
import
|
|
67
|
+
import "./components/ds-list-item/ds-list-item.js";
|
|
68
|
+
import "./components/ds-list/ds-list.js";
|
|
69
|
+
import { iconNames as ho } from "./components/ds-icon/iconNames.js";
|
|
68
70
|
export {
|
|
69
|
-
|
|
71
|
+
ho as iconNames
|
|
70
72
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { THEME_STORAGE_KEY as r } from "../core/theme.constants.js";
|
|
2
|
-
import { pubSub as
|
|
3
|
-
class
|
|
2
|
+
import { pubSub as f } from "./PubSub.js";
|
|
3
|
+
class l {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.icons = {}, this.handleChangeTheme = (e) => {
|
|
6
6
|
if (this.theme === e) return;
|
|
7
7
|
this.theme = e;
|
|
8
|
-
const
|
|
9
|
-
this.icons = {},
|
|
10
|
-
}, this.fetchIcon = async (e,
|
|
8
|
+
const n = Object.keys(this.icons);
|
|
9
|
+
this.icons = {}, n.forEach((s) => this.fetchIcon(s));
|
|
10
|
+
}, this.fetchIcon = async (e, n = {}) => {
|
|
11
11
|
const s = typeof sessionStorage < "u" ? sessionStorage == null ? void 0 : sessionStorage.getItem(r) : null;
|
|
12
12
|
!this.theme && s && (this.theme = s);
|
|
13
13
|
const t = this.icons[e];
|
|
14
14
|
if (t) return await t;
|
|
15
|
-
const o = this.loadIcon(e,
|
|
15
|
+
const o = this.loadIcon(e, n).catch((a) => {
|
|
16
16
|
throw delete this.icons[e], a;
|
|
17
17
|
});
|
|
18
18
|
return this.icons[e] = o, o;
|
|
19
|
-
}, this.loadIcon = (e, { cache:
|
|
20
|
-
cache:
|
|
19
|
+
}, this.loadIcon = (e, { cache: n = "force-cache", ...s }) => !this.theme || typeof fetch > "u" ? Promise.resolve('<svg class="ds-icon"></svg>') : fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`, {
|
|
20
|
+
cache: n,
|
|
21
21
|
...s
|
|
22
22
|
}).then((t) => t.text()).catch((t) => {
|
|
23
23
|
if ((t == null ? void 0 : t.name) === "AbortError") throw t;
|
|
24
24
|
return console.error(`Failed to fetch icon "${e}":`, t), "";
|
|
25
|
-
})
|
|
25
|
+
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/1.1.0-canary.
|
|
29
|
-
let
|
|
30
|
-
|
|
31
|
-
value:
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/1.1.0-canary.15"), h = globalThis;
|
|
29
|
+
let i = h[c];
|
|
30
|
+
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
|
+
value: i,
|
|
32
32
|
writable: !1,
|
|
33
33
|
configurable: !1,
|
|
34
34
|
enumerable: !1
|
|
35
35
|
}));
|
|
36
|
-
const
|
|
36
|
+
const g = i;
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
g as iconsManager
|
|
39
39
|
};
|
package/dist/esm/utils/PubSub.js
CHANGED
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/1.1.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/1.1.0-canary.15"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -5,15 +5,16 @@ class s {
|
|
|
5
5
|
theme: t
|
|
6
6
|
}) => {
|
|
7
7
|
if (!t || !e) return;
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
const i = this.fetchStyle({ url:
|
|
11
|
-
return this.stylePromises.set(
|
|
8
|
+
const r = `https://ds-assets.cupra.com/1.1.0-canary.15/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
|
|
9
|
+
if (c) return c;
|
|
10
|
+
const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
|
|
11
|
+
return this.stylePromises.set(r, i), this.stylePromises.get(r);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
async fetchStyle({ url: e }) {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
if (typeof fetch > "u") return;
|
|
17
|
+
const t = await fetch(e, { cache: "force-cache" });
|
|
17
18
|
if (t.ok) return t.text();
|
|
18
19
|
} catch (t) {
|
|
19
20
|
console.error(`Failed to fetch Style Sheet "${e}":`, t);
|
|
@@ -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-v1-1-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-1-0-canary-15"), 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-v1-1-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-1-0-canary-15"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
export declare class DsList extends UiKitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
size: 'small' | 'medium';
|
|
5
|
+
protected get classes(): {
|
|
6
|
+
[x: string]: boolean;
|
|
7
|
+
'ds-list': boolean;
|
|
8
|
+
};
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cupraDiagonalStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
export declare class DsListItem extends UiKitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
variant: 'selection' | 'action' | 'info';
|
|
5
|
+
selected: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
size: 'small' | 'medium';
|
|
8
|
+
protected get classes(): {
|
|
9
|
+
[x: string]: boolean;
|
|
10
|
+
content: boolean;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
};
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
private renderSelectionTemplate;
|
|
16
|
+
private renderActionTemplate;
|
|
17
|
+
private renderInfoTemplate;
|
|
18
|
+
private renderByTemplate;
|
|
19
|
+
render(): import("lit").TemplateResult<1>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cupraDiagonalStyles: import("lit").CSSResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
2
|
import { nothing } from 'lit';
|
|
3
3
|
import type { DsTextareaAttrs } from './ds-textarea.types.ts';
|
|
4
|
-
declare const DsTextarea_base: (new (...args: any[]) => import("../../mixins/inputStatesMixin.ts").InputStatesInterface) & typeof UiKitElement;
|
|
4
|
+
declare const DsTextarea_base: (new (...args: any[]) => import("../../mixins/inputStatesMixin.ts").InputStatesInterface) & (new (...args: any[]) => import("../../mixins/ViewportMixin.ts").ViewportInterface) & typeof UiKitElement;
|
|
5
5
|
export declare class DsTextarea extends DsTextarea_base {
|
|
6
6
|
static styles: import("lit").CSSResult[];
|
|
7
7
|
private keyboardMode;
|
|
@@ -64,3 +64,5 @@ import './ds-toggle-button/ds-toggle-button.ts';
|
|
|
64
64
|
import './ds-toggle-switch/ds-toggle-switch.ts';
|
|
65
65
|
import './ds-tooltip/ds-tooltip.ts';
|
|
66
66
|
import './ds-media-control/ds-media-control.ts';
|
|
67
|
+
import './ds-list-item/ds-list-item.ts';
|
|
68
|
+
import './ds-list/ds-list.ts';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),c=require("../../decorators/customUiKitElement.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const a=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const m=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),p=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),v=require("./styles/common.styles.cjs"),y=require("./styles/cupra-diagonal.styles.cjs");var D=Object.defineProperty,d=Object.getOwnPropertyDescriptor,n=(r,t,i,s)=>{for(var e=s>1?void 0:s?d(t,i):t,l=r.length-1,o;l>=0;l--)(o=r[l])&&(e=(s?o(t,i,e):o(e))||e);return s&&e&&D(t,i,e),e};exports.DsList=class extends u.UiKitElement{constructor(){super(...arguments),this.size="medium"}get classes(){return{"ds-list":!0,[`size-${this.size}`]:!0}}render(){return a.html`
|
|
2
|
+
<div class=${p.classMap(this.classes)}>
|
|
3
|
+
<slot name="title"></slot>
|
|
4
|
+
<slot name="subtitle"></slot>
|
|
5
|
+
<div role="list">
|
|
6
|
+
<slot name="list-item"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
`}};exports.DsList.styles=[v.commonStyles,y.cupraDiagonalStyles];n([m.property({type:String,reflect:!0})],exports.DsList.prototype,"size",2);exports.DsList=n([c.customUiKitElement("ds-list")],exports.DsList);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../utils/cssWithTokens.cjs"),e=t.cssWithTokens`
|
|
2
|
+
.ds-list {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
row-gap: var(--dg-size-16);
|
|
6
|
+
font-family: var(--dg-font-family-base);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
::slotted([slot="title"]) {
|
|
10
|
+
color: var(--dg-global-color-neutral-10);
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
::slotted([slot="subtitle"]) {
|
|
15
|
+
color: var(--dg-global-color-neutral-60);
|
|
16
|
+
font-weight: 400;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([size="small"]) ::slotted([slot="title"]) {
|
|
20
|
+
font-size: var(--dg-font-size-body-m);
|
|
21
|
+
line-height: var(--dg-font-body-xs-medium-line-height);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([size="medium"]) ::slotted([slot="title"]) {
|
|
25
|
+
font-size: var(--dg-font-size-body-l);
|
|
26
|
+
line-height: var(--dg-font-body-s-medium-line-height);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([size="small"]) ::slotted([slot="subtitle"]) {
|
|
30
|
+
font-size: var(--dg-font-size-body-m);
|
|
31
|
+
line-height: var(--dg-font-body-xs-medium-line-height);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([size="medium"]) ::slotted([slot="subtitle"]) {
|
|
35
|
+
font-size: var(--dg-font-size-body-l);
|
|
36
|
+
line-height: var(--dg-font-body-s-medium-line-height);
|
|
37
|
+
}
|
|
38
|
+
`;exports.cupraDiagonalStyles=e;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../base/UiKitElement.cjs"),d=require("../../decorators/customUiKitElement.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const s=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const l=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),p=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),u=require("./styles/common.styles.cjs"),h=require("./styles/cupra-diagonal.styles.cjs");var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,r=(o,t,i,n)=>{for(var e=n>1?void 0:n?v(t,i):t,a=o.length-1,c;a>=0;a--)(c=o[a])&&(e=(n?c(t,i,e):c(e))||e);return n&&e&&y(t,i,e),e};exports.DsListItem=class extends m.UiKitElement{constructor(){super(...arguments),this.variant="selection",this.selected=!1,this.disabled=!1,this.size="medium"}get classes(){return{content:!0,[this.size]:!0,[`${this.variant}-variant`]:!0,selected:this.selected,disabled:this.disabled}}connectedCallback(){var t;if((t=super.connectedCallback)==null||t.call(this),!this.hasAttribute("size")){const i=this.closest("ds-list");i&&(this.size=i.size)}}renderSelectionTemplate(){return s.html`
|
|
2
|
+
<slot name="input-left"></slot>
|
|
3
|
+
<slot name="icon"></slot>
|
|
4
|
+
<div class="container-text">
|
|
5
|
+
<slot name="primary-text"></slot>
|
|
6
|
+
<slot name="description-text"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
<slot name="secondary-text"></slot>
|
|
9
|
+
<slot name="input-right"></slot>
|
|
10
|
+
`}renderActionTemplate(){return s.html`
|
|
11
|
+
<slot name="image-square"></slot>
|
|
12
|
+
<slot name="image-wide"></slot>
|
|
13
|
+
<slot name="icon-left"></slot>
|
|
14
|
+
<div class="container-text">
|
|
15
|
+
<slot name="primary-text"></slot>
|
|
16
|
+
<slot name="description-text"></slot>
|
|
17
|
+
</div>
|
|
18
|
+
<slot name="secondary-text"></slot>
|
|
19
|
+
<slot name="icon-right"></slot>
|
|
20
|
+
`}renderInfoTemplate(){return s.html`
|
|
21
|
+
<slot name="icon"></slot>
|
|
22
|
+
<div class="container-text">
|
|
23
|
+
<div class="container">
|
|
24
|
+
<slot name="primary-text"></slot>
|
|
25
|
+
<slot name="primary-subtext"></slot>
|
|
26
|
+
</div>
|
|
27
|
+
<slot name="description-text"></slot>
|
|
28
|
+
</div>
|
|
29
|
+
<slot name="aside"></slot>
|
|
30
|
+
`}renderByTemplate(){switch(this.variant){case"selection":return this.renderSelectionTemplate();case"action":return this.renderActionTemplate();case"info":return this.renderInfoTemplate();default:return s.nothing}}render(){const t=this.variant!=="info";return s.html`
|
|
31
|
+
<li class=${p.classMap(this.classes)} role="listitem" tabindex="0" ?aria-disabled=${this.disabled}>
|
|
32
|
+
${this.renderByTemplate()}
|
|
33
|
+
</li>
|
|
34
|
+
|
|
35
|
+
${t?s.html`<ds-divider orientation="horizontal" variant="primary"></ds-divider>`:s.nothing}
|
|
36
|
+
`}};exports.DsListItem.styles=[u.commonStyles,h.cupraDiagonalStyles];r([l.property({type:String,reflect:!0})],exports.DsListItem.prototype,"variant",2);r([l.property({type:Boolean,reflect:!0})],exports.DsListItem.prototype,"selected",2);r([l.property({type:Boolean,reflect:!0})],exports.DsListItem.prototype,"disabled",2);r([l.property({type:String,reflect:!0})],exports.DsListItem.prototype,"size",2);exports.DsListItem=r([d.customUiKitElement("ds-list-item")],exports.DsListItem);
|