@cupra/ui-kit 1.1.0-canary.3 → 1.1.0-canary.5
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/components/ds-basic-card/ds-basic-card.d.ts +9 -0
- package/dist/components/ds-basic-card/ds-basic-card.js +58 -0
- package/dist/components/ds-basic-card/ds-basic-card.types.d.ts +4 -0
- package/dist/components/ds-basic-card/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-basic-card/styles/common.styles.js +38 -0
- package/dist/components/ds-basic-card-header/ds-basic-card-header.d.ts +7 -0
- package/dist/components/ds-basic-card-header/ds-basic-card-header.js +51 -0
- package/dist/components/ds-basic-card-header/ds-basic-card-header.types.d.ts +2 -0
- package/dist/components/ds-basic-card-header/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-basic-card-header/styles/common.styles.js +57 -0
- package/dist/components/ds-basic-card-image/ds-basic-card-image.d.ts +6 -0
- package/dist/components/ds-basic-card-image/ds-basic-card-image.js +37 -0
- package/dist/components/ds-basic-card-image/ds-basic-card-image.types.d.ts +2 -0
- package/dist/components/ds-basic-card-image/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-basic-card-image/styles/common.styles.js +13 -0
- package/dist/components/ds-basic-card-section/ds-basic-card-section.d.ts +10 -0
- package/dist/components/ds-basic-card-section/ds-basic-card-section.js +52 -0
- package/dist/components/ds-basic-card-section/ds-basic-card-section.types.d.ts +5 -0
- package/dist/components/ds-basic-card-section/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-basic-card-section/styles/common.styles.js +33 -0
- package/dist/components/ds-media-control/ds-media-control.d.ts +17 -0
- package/dist/components/ds-media-control/ds-media-control.js +107 -0
- package/dist/components/ds-media-control/ds-media-control.test.d.ts +8 -0
- package/dist/components/ds-media-control/ds-media-control.types.d.ts +8 -0
- package/dist/components/ds-media-control/styles/common.styles.d.ts +1 -0
- package/dist/components/ds-media-control/styles/common.styles.js +54 -0
- package/dist/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/index.js +7 -2
- package/dist/utils/IconsManager.js +1 -1
- package/dist/utils/PubSub.js +1 -1
- package/dist/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/utils/componentFactory.d.ts +2 -0
- package/dist/utils/componentFactory.js +20 -2
- package/dist/utils/cssWithTokens.js +1 -1
- package/dist/utils/htmlWithTokens.js +1 -1
- package/dist-react/components/ds-basic-card/ds-basic-card.d.ts +9 -0
- package/dist-react/components/ds-basic-card/ds-basic-card.js +58 -0
- package/dist-react/components/ds-basic-card/ds-basic-card.types.d.ts +4 -0
- package/dist-react/components/ds-basic-card/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-basic-card/styles/common.styles.js +38 -0
- package/dist-react/components/ds-basic-card-header/ds-basic-card-header.d.ts +7 -0
- package/dist-react/components/ds-basic-card-header/ds-basic-card-header.js +51 -0
- package/dist-react/components/ds-basic-card-header/ds-basic-card-header.types.d.ts +2 -0
- package/dist-react/components/ds-basic-card-header/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-basic-card-header/styles/common.styles.js +57 -0
- package/dist-react/components/ds-basic-card-image/ds-basic-card-image.d.ts +6 -0
- package/dist-react/components/ds-basic-card-image/ds-basic-card-image.js +37 -0
- package/dist-react/components/ds-basic-card-image/ds-basic-card-image.types.d.ts +2 -0
- package/dist-react/components/ds-basic-card-image/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-basic-card-image/styles/common.styles.js +13 -0
- package/dist-react/components/ds-basic-card-section/ds-basic-card-section.d.ts +10 -0
- package/dist-react/components/ds-basic-card-section/ds-basic-card-section.js +52 -0
- package/dist-react/components/ds-basic-card-section/ds-basic-card-section.types.d.ts +5 -0
- package/dist-react/components/ds-basic-card-section/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-basic-card-section/styles/common.styles.js +33 -0
- package/dist-react/components/ds-media-control/ds-media-control.d.ts +17 -0
- package/dist-react/components/ds-media-control/ds-media-control.js +107 -0
- package/dist-react/components/ds-media-control/ds-media-control.test.d.ts +8 -0
- package/dist-react/components/ds-media-control/ds-media-control.types.d.ts +8 -0
- package/dist-react/components/ds-media-control/styles/common.styles.d.ts +1 -0
- package/dist-react/components/ds-media-control/styles/common.styles.js +54 -0
- package/dist-react/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/components/index.d.ts +5 -0
- package/dist-react/index.js +7 -2
- package/dist-react/utils/IconsManager.js +1 -1
- package/dist-react/utils/PubSub.js +1 -1
- package/dist-react/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/utils/componentFactory.d.ts +2 -0
- package/dist-react/utils/componentFactory.js +11 -2
- package/dist-react/utils/cssWithTokens.js +1 -1
- package/dist-react/utils/htmlWithTokens.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
import { DsBasicCardAttrs } from './ds-basic-card.types.ts';
|
|
3
|
+
export declare class DsBasicCard extends UiKitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
variant: DsBasicCardAttrs['variant'];
|
|
6
|
+
private get classes();
|
|
7
|
+
protected handleClick(): void;
|
|
8
|
+
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { UiKitElement as p } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
4
|
+
import { nothing as m, html as n } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
5
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
6
|
+
import { property as u } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
7
|
+
import { classMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
8
|
+
import { commonStyles as f } from "./styles/common.styles.js";
|
|
9
|
+
var h = Object.defineProperty, b = Object.getOwnPropertyDescriptor, l = (c, r, a, e) => {
|
|
10
|
+
for (var t = e > 1 ? void 0 : e ? b(r, a) : r, i = c.length - 1, o; i >= 0; i--)
|
|
11
|
+
(o = c[i]) && (t = (e ? o(r, a, t) : o(t)) || t);
|
|
12
|
+
return e && t && h(r, a, t), t;
|
|
13
|
+
};
|
|
14
|
+
let s = class extends p {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments), this.variant = "default";
|
|
17
|
+
}
|
|
18
|
+
get classes() {
|
|
19
|
+
return {
|
|
20
|
+
"card-wrapper": !0,
|
|
21
|
+
subgrid: !0,
|
|
22
|
+
[this.variant]: !!this.variant
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
handleClick() {
|
|
26
|
+
this.dispatchEvent(
|
|
27
|
+
new Event("ds-basic-card:click", {
|
|
28
|
+
bubbles: !0,
|
|
29
|
+
composed: !0
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return n`
|
|
35
|
+
<article
|
|
36
|
+
part="card-wrapper"
|
|
37
|
+
class="${v(this.classes)}"
|
|
38
|
+
@click=${this.handleClick}
|
|
39
|
+
data-testid="ds-basic-card-container"
|
|
40
|
+
>
|
|
41
|
+
<div>${this.variant === "featured" ? n`<slot name="featured-text"></slot>` : m}</div>
|
|
42
|
+
<div class="container subgrid">
|
|
43
|
+
<slot></slot>
|
|
44
|
+
</div>
|
|
45
|
+
</article>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
s.styles = [f];
|
|
50
|
+
l([
|
|
51
|
+
u({ type: String })
|
|
52
|
+
], s.prototype, "variant", 2);
|
|
53
|
+
s = l([
|
|
54
|
+
d("ds-basic-card")
|
|
55
|
+
], s);
|
|
56
|
+
export {
|
|
57
|
+
s as DsBasicCard
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cssQueries as r } from "../../../utils/cssQueries.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
4
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
5
|
+
import { css as s } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
6
|
+
const e = s`
|
|
7
|
+
:host {
|
|
8
|
+
row-gap: 0;
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-rows: subgrid;
|
|
11
|
+
grid-row: span 7;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.subgrid {
|
|
15
|
+
display: grid;
|
|
16
|
+
grid-template-rows: subgrid;
|
|
17
|
+
grid-row: span 7;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.container {
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
::slotted([slot='featured-text']) {
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
padding: var(--dg-spacing-s-5, 8px) var(--dg-spacing-m-2, 16px);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
${r.m} {
|
|
31
|
+
::slotted([slot='featured-text']) {
|
|
32
|
+
padding: var(--dg-spacing-s-5, 8px) var(--dg-spacing-m-4, 24px);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
export {
|
|
37
|
+
e as commonStyles
|
|
38
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
export declare class DsBasicCardHeader extends UiKitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
protected get dividerTemplate(): any;
|
|
5
|
+
private get classes();
|
|
6
|
+
render(): import("lit").TemplateResult<1>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { UiKitElement as l } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as p } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
4
|
+
import { html as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
5
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
6
|
+
import { classMap as n } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
7
|
+
import { commonStyles as c } from "./styles/common.styles.js";
|
|
8
|
+
var h = Object.getOwnPropertyDescriptor, v = (a, s, d, i) => {
|
|
9
|
+
for (var e = i > 1 ? void 0 : i ? h(s, d) : s, t = a.length - 1, o; t >= 0; t--)
|
|
10
|
+
(o = a[t]) && (e = o(e) || e);
|
|
11
|
+
return e;
|
|
12
|
+
};
|
|
13
|
+
let r = class extends l {
|
|
14
|
+
get dividerTemplate() {
|
|
15
|
+
return this.componentFactory.createDivider({
|
|
16
|
+
class: "divider",
|
|
17
|
+
variant: "secondary"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
get classes() {
|
|
21
|
+
return {
|
|
22
|
+
"header-wrapper": !0
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return m`
|
|
27
|
+
<header
|
|
28
|
+
part="header-wrapper"
|
|
29
|
+
class="${n(this.classes)}"
|
|
30
|
+
data-testid="ds-basic-card-header-container"
|
|
31
|
+
>
|
|
32
|
+
<div class="header-content">
|
|
33
|
+
<div class="title-wrapper" part="title-container">
|
|
34
|
+
<slot name="title" part="title"></slot>
|
|
35
|
+
<slot name="description" part="description"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
<slot name="meta" part="meta"></slot>
|
|
38
|
+
</div>
|
|
39
|
+
<slot name="sub-header" part="sub-header"></slot>
|
|
40
|
+
${this.dividerTemplate}
|
|
41
|
+
</header>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
r.styles = [c];
|
|
46
|
+
r = v([
|
|
47
|
+
p("ds-basic-card-header")
|
|
48
|
+
], r);
|
|
49
|
+
export {
|
|
50
|
+
r as DsBasicCardHeader
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cssQueries as p } from "../../../utils/cssQueries.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
4
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
5
|
+
import { css as i } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
6
|
+
const d = i`
|
|
7
|
+
:host {
|
|
8
|
+
padding: var(--dg-spacing-m-2, 16px) var(--dg-spacing-m-2, 16px) 0px var(--dg-spacing-m-2, 16px);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.header-wrapper {
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
align-self: stretch;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--dg-spacing-m-1, 12px);
|
|
17
|
+
height: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.header-content {
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: var(--dg-spacing-m-1, 8px);
|
|
23
|
+
width: 100%;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.title-wrapper {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--dg-spacing-s-5, 8px);
|
|
31
|
+
width: 100%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
::slotted([slot='title']) {
|
|
35
|
+
width: 100%;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
::slotted([slot='sub-header']) {
|
|
39
|
+
display: flex;
|
|
40
|
+
gap: var(--dg-spacing-m-1, 12px);
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.divider {
|
|
45
|
+
margin-top: auto;
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${p.m} {
|
|
50
|
+
:host {
|
|
51
|
+
padding: var(--dg-spacing-m-2, 16px) var(--dg-spacing-m-4, 24px) 0px var(--dg-spacing-m-4, 24px);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export {
|
|
56
|
+
d as commonStyles
|
|
57
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { UiKitElement as p } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as l } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
4
|
+
import { html as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
5
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
6
|
+
import { classMap as n } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
7
|
+
import { commonStyles as d } from "./styles/common.styles.js";
|
|
8
|
+
var g = Object.getOwnPropertyDescriptor, f = (s, a, o, i) => {
|
|
9
|
+
for (var r = i > 1 ? void 0 : i ? g(a, o) : a, e = s.length - 1, m; e >= 0; e--)
|
|
10
|
+
(m = s[e]) && (r = m(r) || r);
|
|
11
|
+
return r;
|
|
12
|
+
};
|
|
13
|
+
let t = class extends p {
|
|
14
|
+
get classes() {
|
|
15
|
+
return {
|
|
16
|
+
"image-wrapper": !0
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return c`
|
|
21
|
+
<div
|
|
22
|
+
part="image-wrapper"
|
|
23
|
+
class="${n(this.classes)}"
|
|
24
|
+
data-testid="ds-basic-card-image-container"
|
|
25
|
+
>
|
|
26
|
+
<slot></slot>
|
|
27
|
+
</div>
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
t.styles = [d];
|
|
32
|
+
t = f([
|
|
33
|
+
l("ds-basic-card-image")
|
|
34
|
+
], t);
|
|
35
|
+
export {
|
|
36
|
+
t as DsBasicCardImage
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
height: 100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
export {
|
|
12
|
+
s as commonStyles
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
import { DsBasicCardSectionAttrs } from './ds-basic-card-section.types.ts';
|
|
3
|
+
export declare class DsBasicCardSection extends UiKitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
withDivider: DsBasicCardSectionAttrs['divider'];
|
|
6
|
+
centered: DsBasicCardSectionAttrs['centered'];
|
|
7
|
+
protected get dividerTemplate(): any;
|
|
8
|
+
private get classes();
|
|
9
|
+
render(): import("lit").TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { UiKitElement as d } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as l } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { booleanConverter as p } from "../../utils/booleanConverter.js";
|
|
4
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
+
import { nothing as v, html as h } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
+
import { property as m } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as f } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { commonStyles as u } from "./styles/common.styles.js";
|
|
10
|
+
var y = Object.defineProperty, D = Object.getOwnPropertyDescriptor, a = (c, r, o, i) => {
|
|
11
|
+
for (var e = i > 1 ? void 0 : i ? D(r, o) : r, s = c.length - 1, n; s >= 0; s--)
|
|
12
|
+
(n = c[s]) && (e = (i ? n(r, o, e) : n(e)) || e);
|
|
13
|
+
return i && e && y(r, o, e), e;
|
|
14
|
+
};
|
|
15
|
+
let t = class extends d {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.withDivider = !0, this.centered = !0;
|
|
18
|
+
}
|
|
19
|
+
get dividerTemplate() {
|
|
20
|
+
return this.componentFactory.createDivider({
|
|
21
|
+
class: "divider",
|
|
22
|
+
variant: "secondary"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
get classes() {
|
|
26
|
+
return {
|
|
27
|
+
container: !0,
|
|
28
|
+
centered: this.centered
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return h`
|
|
33
|
+
<div part="container" class=${f(this.classes)} data-testid="ds-basic-card-section-container">
|
|
34
|
+
<slot></slot>
|
|
35
|
+
</div>
|
|
36
|
+
${this.withDivider ? this.dividerTemplate : v}
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
t.styles = [u];
|
|
41
|
+
a([
|
|
42
|
+
m({ type: Boolean, converter: p })
|
|
43
|
+
], t.prototype, "withDivider", 2);
|
|
44
|
+
a([
|
|
45
|
+
m({ type: Boolean, converter: p })
|
|
46
|
+
], t.prototype, "centered", 2);
|
|
47
|
+
t = a([
|
|
48
|
+
l("ds-basic-card-section")
|
|
49
|
+
], t);
|
|
50
|
+
export {
|
|
51
|
+
t as DsBasicCardSection
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cssQueries as i } from "../../../utils/cssQueries.js";
|
|
2
|
+
import "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
3
|
+
import "../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
4
|
+
import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
5
|
+
import { css as p } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
6
|
+
const g = p`
|
|
7
|
+
:host {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
padding: var(--dg-spacing-s-1, 0px) var(--dg-spacing-m-2, 16px);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.container {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: var(--dg-spacing-m-1, 12px);
|
|
17
|
+
height: 100%;
|
|
18
|
+
padding: var(--dg-spacing-m-4, 24px) var(--dg-spacing-s-1, 0px);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.centered {
|
|
22
|
+
justify-content: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
${i.m} {
|
|
26
|
+
:host {
|
|
27
|
+
padding: var(--dg-spacing-s-1, 0px) var(--dg-spacing-m-4, 24px);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
export {
|
|
32
|
+
g as commonStyles
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
+
import type { DsMediaControlAttrs } from './ds-media-control.types.ts';
|
|
3
|
+
export declare class DsMediaControl extends UiKitElement {
|
|
4
|
+
static styles: import("lit").CSSResult[];
|
|
5
|
+
state: DsMediaControlAttrs['state'];
|
|
6
|
+
size: DsMediaControlAttrs['size'];
|
|
7
|
+
progress: DsMediaControlAttrs['progress'];
|
|
8
|
+
private get normalizedProgress();
|
|
9
|
+
protected get classes(): Record<string, boolean>;
|
|
10
|
+
private get iconSize();
|
|
11
|
+
private get iconName();
|
|
12
|
+
private get iconTemplate();
|
|
13
|
+
private handleToggle;
|
|
14
|
+
private onKeyDown;
|
|
15
|
+
private get progressTemplate();
|
|
16
|
+
render(): import("lit").TemplateResult<1>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { UiKitElement as u } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
4
|
+
import { html as p } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
5
|
+
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
6
|
+
import { property as l } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
7
|
+
import { classMap as g } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
8
|
+
import { commonStyles as f } from "./styles/common.styles.js";
|
|
9
|
+
var y = Object.defineProperty, v = Object.getOwnPropertyDescriptor, c = (e, s, r, o) => {
|
|
10
|
+
for (var t = o > 1 ? void 0 : o ? v(s, r) : s, a = e.length - 1, n; a >= 0; a--)
|
|
11
|
+
(n = e[a]) && (t = (o ? n(s, r, t) : n(t)) || t);
|
|
12
|
+
return o && t && y(s, r, t), t;
|
|
13
|
+
};
|
|
14
|
+
let i = class extends u {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments), this.state = "pause", this.size = "medium", this.progress = 0, this.handleToggle = (e) => {
|
|
17
|
+
e.stopPropagation();
|
|
18
|
+
const s = this.state === "play" ? "pause" : "play";
|
|
19
|
+
this.state = s;
|
|
20
|
+
const r = s === "play" ? "ds-media-control:play" : "ds-media-control:pause";
|
|
21
|
+
this.dispatchEvent(new CustomEvent(r, { bubbles: !0, composed: !0 }));
|
|
22
|
+
}, this.onKeyDown = (e) => {
|
|
23
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.handleToggle(e));
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
get normalizedProgress() {
|
|
27
|
+
const e = Number(this.progress ?? 0);
|
|
28
|
+
return Number.isNaN(e) ? 0 : Math.min(100, Math.max(0, e));
|
|
29
|
+
}
|
|
30
|
+
get classes() {
|
|
31
|
+
return {
|
|
32
|
+
container: !0,
|
|
33
|
+
[this.size]: !!this.size,
|
|
34
|
+
[this.state]: !!this.state
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
get iconSize() {
|
|
38
|
+
switch (this.size) {
|
|
39
|
+
case "large":
|
|
40
|
+
return 24;
|
|
41
|
+
case "small":
|
|
42
|
+
return 16;
|
|
43
|
+
default:
|
|
44
|
+
return 20;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
get iconName() {
|
|
48
|
+
return this.state === "play" ? "pause" : "play";
|
|
49
|
+
}
|
|
50
|
+
get iconTemplate() {
|
|
51
|
+
return this.componentFactory.createIcon({
|
|
52
|
+
class: "icon",
|
|
53
|
+
"icon-name": this.iconName,
|
|
54
|
+
size: this.iconSize
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
get progressTemplate() {
|
|
58
|
+
const e = this.size === "large" ? 46 : this.size === "small" ? 30 : 38, r = e / 2 - 2 / 2, o = r - 1, t = 2 * Math.PI * r, a = this.normalizedProgress / 100, n = t.toFixed(3), m = (t * (1 - a)).toFixed(3), h = `${-e / 2} ${-e / 2} ${e} ${e}`;
|
|
59
|
+
return p`
|
|
60
|
+
<svg part="progress" class="progress" viewBox="${h}" aria-hidden="true" focusable="false">
|
|
61
|
+
<circle
|
|
62
|
+
class="indicator"
|
|
63
|
+
cx="0"
|
|
64
|
+
cy="0"
|
|
65
|
+
r="${o}"
|
|
66
|
+
fill="none"
|
|
67
|
+
stroke-dasharray="${n}"
|
|
68
|
+
stroke-dashoffset="${m}"
|
|
69
|
+
vector-effect="non-scaling-stroke"
|
|
70
|
+
></circle>
|
|
71
|
+
</svg>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
const e = this.state === "play" ? "pause" : "play";
|
|
76
|
+
return p`
|
|
77
|
+
<div
|
|
78
|
+
part="container"
|
|
79
|
+
class=${g(this.classes)}
|
|
80
|
+
role="button"
|
|
81
|
+
tabindex="0"
|
|
82
|
+
aria-label=${`${e} media ${this.size}`}
|
|
83
|
+
@click=${this.handleToggle}
|
|
84
|
+
@keydown=${this.onKeyDown}
|
|
85
|
+
>
|
|
86
|
+
${this.progressTemplate}
|
|
87
|
+
${this.iconTemplate}
|
|
88
|
+
</div>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
i.styles = [f];
|
|
93
|
+
c([
|
|
94
|
+
l({ type: String, reflect: !0 })
|
|
95
|
+
], i.prototype, "state", 2);
|
|
96
|
+
c([
|
|
97
|
+
l({ type: String, reflect: !0 })
|
|
98
|
+
], i.prototype, "size", 2);
|
|
99
|
+
c([
|
|
100
|
+
l({ type: Number, reflect: !0 })
|
|
101
|
+
], i.prototype, "progress", 2);
|
|
102
|
+
i = c([
|
|
103
|
+
d("ds-media-control")
|
|
104
|
+
], i);
|
|
105
|
+
export {
|
|
106
|
+
i as DsMediaControl
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const commonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 r } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
|
+
const s = r`
|
|
6
|
+
:host {
|
|
7
|
+
display: contents;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[part='container'] {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: inline-grid;
|
|
13
|
+
place-items: center;
|
|
14
|
+
border-radius: var(--ds-border-radius-full, 100000px);
|
|
15
|
+
background: var(--ds-color-surface-contrast, rgba(9, 9, 11, 0.3));
|
|
16
|
+
user-select: none;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
outline: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.container.small {
|
|
22
|
+
width: 32px;
|
|
23
|
+
height: 32px;
|
|
24
|
+
}
|
|
25
|
+
.container.medium {
|
|
26
|
+
width: 40px;
|
|
27
|
+
height: 40px;
|
|
28
|
+
}
|
|
29
|
+
.container.large {
|
|
30
|
+
width: 48px;
|
|
31
|
+
height: 48px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.progress {
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.progress .indicator {
|
|
43
|
+
stroke: var(--ds-icon-color);
|
|
44
|
+
stroke-width: 1.5px;
|
|
45
|
+
transform: rotate(-90deg);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[part='container']:focus-visible {
|
|
49
|
+
box-shadow: 0 0 0 2px var(--ds-color-focus-ring, rgba(255, 255, 255, 0.6));
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
export {
|
|
53
|
+
s as commonStyles
|
|
54
|
+
};
|
|
@@ -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 = "/1.1.0-canary.
|
|
57
|
+
const s = "/1.1.0-canary.5", 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");
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import './ds-accordion/ds-accordion.ts';
|
|
2
2
|
import './ds-avatar/ds-avatar.ts';
|
|
3
3
|
import './ds-badge/ds-badge.ts';
|
|
4
|
+
import './ds-basic-card/ds-basic-card.ts';
|
|
5
|
+
import './ds-basic-card-image/ds-basic-card-image.ts';
|
|
6
|
+
import './ds-basic-card-header/ds-basic-card-header.ts';
|
|
7
|
+
import './ds-basic-card-section/ds-basic-card-section.ts';
|
|
4
8
|
import './ds-bullets/ds-bullets.ts';
|
|
5
9
|
import './ds-button/ds-button.ts';
|
|
6
10
|
import './ds-carousel-indicator/ds-carousel-indicator.ts';
|
|
@@ -59,3 +63,4 @@ import './ds-toast-message/ds-toast-message.ts';
|
|
|
59
63
|
import './ds-toggle-button/ds-toggle-button.ts';
|
|
60
64
|
import './ds-toggle-switch/ds-toggle-switch.ts';
|
|
61
65
|
import './ds-tooltip/ds-tooltip.ts';
|
|
66
|
+
import './ds-media-control/ds-media-control.ts';
|