@cupra/ui-kit 1.0.0-canary.17 → 1.0.0-canary.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/components/base/UiKitElement.js +1 -1
  2. package/dist/components/ds-badge/ds-badge.d.ts +18 -0
  3. package/dist/components/ds-badge/ds-badge.js +53 -0
  4. package/dist/components/ds-badge/ds-badge.test.d.ts +8 -0
  5. package/dist/components/ds-badge/ds-badge.types.d.ts +6 -0
  6. package/dist/components/ds-badge/styles/common.styles.d.ts +1 -0
  7. package/dist/components/ds-badge/styles/common.styles.js +9 -0
  8. package/dist/components/ds-badge/styles/cupra-diagonal.styles.d.ts +1 -0
  9. package/dist/components/ds-badge/styles/cupra-diagonal.styles.js +47 -0
  10. package/dist/components/ds-icon/ds-icon.js +34 -29
  11. package/dist/components/ds-main-title/ds-main-title.d.ts +10 -0
  12. package/dist/components/ds-main-title/ds-main-title.js +35 -0
  13. package/dist/components/ds-main-title/ds-main-title.test.d.ts +7 -0
  14. package/dist/components/ds-main-title/ds-main-title.types.d.ts +2 -0
  15. package/dist/components/ds-main-title/styles/common.styles.d.ts +1 -0
  16. package/dist/components/ds-main-title/styles/common.styles.js +19 -0
  17. package/dist/components/ds-theme-provider/ds-theme-provider.js +1 -1
  18. package/dist/components/index.d.ts +2 -0
  19. package/dist/index.js +4 -2
  20. package/dist/utils/IconsManager.d.ts +1 -4
  21. package/dist/utils/IconsManager.js +33 -27
  22. package/dist/utils/StylesRegistry/StylesRegistry.js +1 -1
  23. package/dist/utils/cssWithTokens.js +1 -1
  24. package/dist/utils/htmlWithTokens.js +1 -1
  25. package/dist-react/components/base/UiKitElement.js +1 -1
  26. package/dist-react/components/ds-badge/ds-badge.d.ts +18 -0
  27. package/dist-react/components/ds-badge/ds-badge.js +53 -0
  28. package/dist-react/components/ds-badge/ds-badge.test.d.ts +8 -0
  29. package/dist-react/components/ds-badge/ds-badge.types.d.ts +6 -0
  30. package/dist-react/components/ds-badge/styles/common.styles.d.ts +1 -0
  31. package/dist-react/components/ds-badge/styles/common.styles.js +9 -0
  32. package/dist-react/components/ds-badge/styles/cupra-diagonal.styles.d.ts +1 -0
  33. package/dist-react/components/ds-badge/styles/cupra-diagonal.styles.js +47 -0
  34. package/dist-react/components/ds-icon/ds-icon.js +34 -29
  35. package/dist-react/components/ds-main-title/ds-main-title.d.ts +10 -0
  36. package/dist-react/components/ds-main-title/ds-main-title.js +35 -0
  37. package/dist-react/components/ds-main-title/ds-main-title.test.d.ts +7 -0
  38. package/dist-react/components/ds-main-title/ds-main-title.types.d.ts +2 -0
  39. package/dist-react/components/ds-main-title/styles/common.styles.d.ts +1 -0
  40. package/dist-react/components/ds-main-title/styles/common.styles.js +19 -0
  41. package/dist-react/components/ds-theme-provider/ds-theme-provider.js +1 -1
  42. package/dist-react/components/index.d.ts +2 -0
  43. package/dist-react/index.js +4 -2
  44. package/dist-react/utils/IconsManager.d.ts +1 -4
  45. package/dist-react/utils/IconsManager.js +33 -27
  46. package/dist-react/utils/StylesRegistry/StylesRegistry.js +1 -1
  47. package/dist-react/utils/cssWithTokens.js +1 -1
  48. package/dist-react/utils/htmlWithTokens.js +1 -1
  49. package/package.json +1 -1
@@ -21,7 +21,7 @@ const E = C`:host([unresolved]){visibility:hidden}`, h = class c extends y {
21
21
  }, this.pubSubTheme = p.subscribe("theme", this.handleChangeTheme);
22
22
  }
23
23
  get theme() {
24
- const e = sessionStorage == null ? void 0 : sessionStorage.getItem(d);
24
+ const e = typeof sessionStorage < "u" ? sessionStorage == null ? void 0 : sessionStorage.getItem(d) : null;
25
25
  return this.contextTheme ?? this.pubSubTheme ?? e;
26
26
  }
27
27
  connectedCallback() {
@@ -0,0 +1,18 @@
1
+ import { UiKitElement } from '../base/UiKitElement.ts';
2
+ import { nothing } from 'lit';
3
+ import type { DsBadgeAttrs } from './ds-badge.types.js';
4
+ export declare class DsBadge extends UiKitElement {
5
+ static styles: import("lit").CSSResult[];
6
+ number?: number;
7
+ variant: DsBadgeAttrs['variant'];
8
+ size: DsBadgeAttrs['size'];
9
+ protected get hasNumber(): boolean;
10
+ protected get classes(): {
11
+ [x: string]: boolean;
12
+ container: boolean;
13
+ dot: boolean;
14
+ number: boolean;
15
+ };
16
+ protected get contentTemplate(): typeof nothing | import("lit").TemplateResult<1>;
17
+ render(): import("lit").TemplateResult<1>;
18
+ }
@@ -0,0 +1,53 @@
1
+ import { UiKitElement as h } 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 { nothing as b, html as u } 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 a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
7
+ import { classMap as c } 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
+ import { cupraDiagonalStyles as v } from "./styles/cupra-diagonal.styles.js";
10
+ var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (p, r, m, s) => {
11
+ for (var t = s > 1 ? void 0 : s ? g(r, m) : r, o = p.length - 1, n; o >= 0; o--)
12
+ (n = p[o]) && (t = (s ? n(r, m, t) : n(t)) || t);
13
+ return s && t && y(r, m, t), t;
14
+ };
15
+ let e = class extends h {
16
+ constructor() {
17
+ super(...arguments), this.variant = "base", this.size = "medium";
18
+ }
19
+ get hasNumber() {
20
+ return typeof this.number == "number" && !Number.isNaN(this.number);
21
+ }
22
+ get classes() {
23
+ return {
24
+ container: !0,
25
+ dot: !this.hasNumber,
26
+ number: this.hasNumber,
27
+ [`variant-${this.variant}`]: !0,
28
+ [`size-${this.size}`]: !0
29
+ };
30
+ }
31
+ get contentTemplate() {
32
+ return this.hasNumber ? u`${this.number}` : b;
33
+ }
34
+ render() {
35
+ return u` <div class=${c(this.classes)}>${this.contentTemplate}</div> `;
36
+ }
37
+ };
38
+ e.styles = [f, v];
39
+ i([
40
+ a({ type: Number })
41
+ ], e.prototype, "number", 2);
42
+ i([
43
+ a({ type: String })
44
+ ], e.prototype, "variant", 2);
45
+ i([
46
+ a({ type: String })
47
+ ], e.prototype, "size", 2);
48
+ e = i([
49
+ l("ds-badge")
50
+ ], e);
51
+ export {
52
+ e as DsBadge
53
+ };
@@ -0,0 +1,8 @@
1
+ import type { DsBadge } from './ds-badge';
2
+ import './ds-badge';
3
+ import '../ds-theme-provider/ds-theme-provider.ts';
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'ds-badge': DsBadge;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { CommonAttrs } from '../../types/types';
2
+ export interface DsBadgeAttrs extends CommonAttrs {
3
+ number?: number;
4
+ variant?: 'base' | 'inverted';
5
+ size?: 'medium' | 'small';
6
+ }
@@ -0,0 +1 @@
1
+ export declare const commonStyles: import("lit").CSSResult;
@@ -0,0 +1,9 @@
1
+ import { cssWithTokens as o } from "../../../utils/cssWithTokens.js";
2
+ const t = o`
3
+ :host {
4
+ display: inline-flex;
5
+ }
6
+ `;
7
+ export {
8
+ t as commonStyles
9
+ };
@@ -0,0 +1 @@
1
+ export declare const cupraDiagonalStyles: import("lit").CSSResult;
@@ -0,0 +1,47 @@
1
+ import { cssWithTokens as e } from "../../../utils/cssWithTokens.js";
2
+ const o = e`
3
+ .container {
4
+ border-radius: 50%;
5
+ }
6
+
7
+ .number {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ font-family: var(--dg-font-family-base);
12
+ font-weight: 400;
13
+ }
14
+
15
+ .number.size-medium {
16
+ width: var(--dg-size-24);
17
+ height: var(--dg-size-24);
18
+ font-size: var(--dg-font-size-body-s);
19
+ line-height: var(--dg-font-body-s-medium-line-height);
20
+ }
21
+
22
+ .number.size-small {
23
+ width: var(--dg-size-16);
24
+ height: var(--dg-size-16);
25
+ font-size: var(--dg-font-size-body-xs);
26
+ line-height: var(--dg-font-body-xs-medium-line-height);
27
+ }
28
+
29
+ .variant-base {
30
+ color: var(--dg-color-text-strong);
31
+ background-color: var(--dg-color-bg-base);
32
+ }
33
+
34
+ .variant-inverted {
35
+ background-color: var(--dg-color-bg-inverted);
36
+ color: var(--dg-color-text-inverted);
37
+ }
38
+
39
+ .dot {
40
+ width: var(--dg-size-08);
41
+ height: var(--dg-size-08);
42
+ background-color: var(--dg-color-bg-error);
43
+ }
44
+ `;
45
+ export {
46
+ o as cupraDiagonalStyles
47
+ };
@@ -1,53 +1,58 @@
1
1
  import { UiKitElement as f } from "../base/UiKitElement.js";
2
2
  import { customUiKitElement as u } from "../../decorators/customUiKitElement.js";
3
- import { iconsManager as g } from "../../utils/IconsManager.js";
4
- import { pubSub as y } from "../../utils/PubSub.js";
5
- import { htmlWithTokens as _ } from "../../utils/htmlWithTokens.js";
3
+ import { iconsManager as y } from "../../utils/IconsManager.js";
4
+ import { pubSub as _ } from "../../utils/PubSub.js";
5
+ import { htmlWithTokens as g } from "../../utils/htmlWithTokens.js";
6
6
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
7
7
  import { html as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
8
8
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
9
- import { property as c } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
9
+ import { property as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
10
10
  import { state as w } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
11
- import { unsafeHTML as b } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
11
+ import { unsafeHTML as x } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
12
12
  import { css as $ } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
13
- var k = Object.defineProperty, x = Object.getOwnPropertyDescriptor, d = (t) => {
13
+ var k = Object.defineProperty, H = Object.getOwnPropertyDescriptor, m = (t) => {
14
14
  throw TypeError(t);
15
- }, n = (t, i, e, r) => {
16
- for (var s = r > 1 ? void 0 : r ? x(i, e) : i, h = t.length - 1, p; h >= 0; h--)
17
- (p = t[h]) && (s = (r ? p(i, e, s) : p(s)) || s);
18
- return r && s && k(i, e, s), s;
19
- }, v = (t, i, e) => i.has(t) || d("Cannot " + e), m = (t, i, e) => (v(t, i, "read from private field"), i.get(t)), H = (t, i, e) => i.has(t) ? d("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), D = (t, i, e, r) => (v(t, i, "write to private field"), i.set(t, e), e), a;
15
+ }, n = (t, e, i, s) => {
16
+ for (var r = s > 1 ? void 0 : s ? H(e, i) : e, h = t.length - 1, p; h >= 0; h--)
17
+ (p = t[h]) && (r = (s ? p(e, i, r) : p(r)) || r);
18
+ return s && r && k(e, i, r), r;
19
+ }, d = (t, e, i) => e.has(t) || m("Cannot " + i), v = (t, e, i) => (d(t, e, "read from private field"), i ? i.call(t) : e.get(t)), I = (t, e, i) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), D = (t, e, i, s) => (d(t, e, "write to private field"), e.set(t, i), i), N = (t, e, i, s) => ({
20
+ set _(r) {
21
+ D(t, e, r);
22
+ },
23
+ get _() {
24
+ return v(t, e, s);
25
+ }
26
+ }), c;
20
27
  let o = class extends f {
21
28
  constructor() {
22
- super(), this.iconHtml = "", H(this, a), this.getIcon = async () => {
23
- var i, e, r;
24
- (i = m(this, a)) == null || i.abort(), D(this, a, new AbortController());
25
- const t = m(this, a).signal;
26
- this.iconHtml = await ((r = (e = g).fetchIcon) == null ? void 0 : r.call(e, this.iconName, { signal: t }));
27
- }, y.subscribe("theme", this.getIcon);
29
+ super(), this.iconHtml = "", I(this, c, 0), this.getIcon = async () => {
30
+ const t = ++N(this, c)._, e = await y.fetchIcon(this.iconName);
31
+ t === v(this, c) && (this.iconHtml = e);
32
+ }, _.subscribe("theme", this.getIcon);
28
33
  }
29
34
  async updated(t) {
30
35
  super.updated(t), (t.has("iconName") || !this.iconHtml) && await this.getIcon();
31
36
  }
32
- getDimension(t, i, e) {
33
- return t ? `${t}px` : i ? "auto" : this.size ? `${this.size}px` : e;
37
+ getDimension(t, e, i) {
38
+ return t ? `${t}px` : e ? "auto" : this.size ? `${this.size}px` : i;
34
39
  }
35
40
  get styleTokens() {
36
41
  const t = this.getDimension(
37
42
  this.width,
38
43
  this.height,
39
44
  "var(--private-ds-icon-width, var(--ds-icon-width, 20px))"
40
- ), i = this.getDimension(
45
+ ), e = this.getDimension(
41
46
  this.height,
42
47
  this.width,
43
48
  "var(--private-ds-icon-height, var(--ds-icon-height, 20px))"
44
49
  );
45
- return _`
50
+ return g`
46
51
  <style>
47
52
  .ds-icon {
48
53
  display: inline-block;
49
54
  width: ${t};
50
- height: ${i};
55
+ height: ${e};
51
56
  }
52
57
 
53
58
  .ds-icon-color {
@@ -63,11 +68,11 @@ let o = class extends f {
63
68
  render() {
64
69
  return l`
65
70
  ${this.styleTokens}
66
- ${this.iconHtml ? b(this.iconHtml) : l`<svg class="ds-icon"></svg>`}
71
+ ${this.iconHtml ? x(this.iconHtml) : l`<svg class="ds-icon">x</svg>`}
67
72
  `;
68
73
  }
69
74
  };
70
- a = /* @__PURE__ */ new WeakMap();
75
+ c = /* @__PURE__ */ new WeakMap();
71
76
  o.styles = $`
72
77
  :host {
73
78
  line-height: 0;
@@ -75,19 +80,19 @@ o.styles = $`
75
80
  }
76
81
  `;
77
82
  n([
78
- c({ type: String, attribute: "icon-name" })
83
+ a({ type: String, attribute: "icon-name" })
79
84
  ], o.prototype, "iconName", 2);
80
85
  n([
81
- c({ type: String, attribute: "color" })
86
+ a({ type: String, attribute: "color" })
82
87
  ], o.prototype, "color", 2);
83
88
  n([
84
- c({ type: Number })
89
+ a({ type: Number })
85
90
  ], o.prototype, "width", 2);
86
91
  n([
87
- c({ type: Number })
92
+ a({ type: Number })
88
93
  ], o.prototype, "height", 2);
89
94
  n([
90
- c({ type: Number, attribute: "size" })
95
+ a({ type: Number, attribute: "size" })
91
96
  ], o.prototype, "size", 2);
92
97
  n([
93
98
  w()
@@ -0,0 +1,10 @@
1
+ import { UiKitElement } from '../base/UiKitElement.ts';
2
+ declare const DsMainTitle_base: (new (...args: any[]) => import("../../mixins/ViewportMixin").ViewportInterface) & typeof UiKitElement;
3
+ export declare class DsMainTitle extends DsMainTitle_base {
4
+ static styles: import("lit").CSSResult[];
5
+ protected get containerClasses(): {
6
+ container: boolean;
7
+ };
8
+ render(): import("lit").TemplateResult<1>;
9
+ }
10
+ export {};
@@ -0,0 +1,35 @@
1
+ import { UiKitElement as l } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
3
+ import { ViewportMixin as p } from "../../mixins/ViewportMixin.js";
4
+ import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
5
+ import { html as c } 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 { classMap as f } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
8
+ import { commonStyles as v } from "./styles/common.styles.js";
9
+ var u = Object.getOwnPropertyDescriptor, d = (s, o, n, i) => {
10
+ for (var t = i > 1 ? void 0 : i ? u(o, n) : o, e = s.length - 1, m; e >= 0; e--)
11
+ (m = s[e]) && (t = m(t) || t);
12
+ return t;
13
+ };
14
+ let r = class extends p(l) {
15
+ get containerClasses() {
16
+ return {
17
+ container: !0
18
+ };
19
+ }
20
+ render() {
21
+ return c`
22
+ <div class=${f(this.containerClasses)}>
23
+ <slot name="title"></slot>
24
+ <slot name="description"></slot>
25
+ </div>
26
+ `;
27
+ }
28
+ };
29
+ r.styles = [v];
30
+ r = d([
31
+ a("ds-main-title")
32
+ ], r);
33
+ export {
34
+ r as DsMainTitle
35
+ };
@@ -0,0 +1,7 @@
1
+ import type { DsMainTitle } from './ds-main-title';
2
+ import './ds-main-title.ts';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'ds-main-title': DsMainTitle;
6
+ }
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { CommonAttrs } from '../../types/types';
2
+ export type DsMainTitleAttrs = CommonAttrs;
@@ -0,0 +1 @@
1
+ export declare const commonStyles: import("lit").CSSResult;
@@ -0,0 +1,19 @@
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 l = o`
6
+ :host {
7
+ display: block;
8
+ width: 100%;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ ::slotted([slot='title']),
13
+ ::slotted([slot='description']) {
14
+ margin: 0;
15
+ }
16
+ `;
17
+ export {
18
+ l as commonStyles
19
+ };
@@ -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.0.0-canary.17", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
57
+ const s = "/1.0.0-canary.19", 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");
@@ -21,6 +21,7 @@ import './ds-loader-dots/ds-loader-dots.ts';
21
21
  import './ds-loader-logo/ds-loader-logo.ts';
22
22
  import './ds-loader-spinner/ds-loader-spinner.ts';
23
23
  import './ds-logo/ds-logo.ts';
24
+ import './ds-main-title/ds-main-title.ts';
24
25
  import './ds-map-pin/ds-map-pin.ts';
25
26
  import './ds-modal/ds-modal.ts';
26
27
  import './ds-password-input/ds-password-input.ts';
@@ -55,3 +56,4 @@ import './ds-static-box/ds-static-box.ts';
55
56
  import './ds-interactive-card/ds-interactive-card.ts';
56
57
  import './ds-radio-button-group/ds-radio-button-group.ts';
57
58
  import './ds-sidebar-navigation/ds-sidebar-navigation.ts';
59
+ import './ds-badge/ds-badge.ts';
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import "./components/ds-loader-dots/ds-loader-dots.js";
21
21
  import "./components/ds-loader-logo/ds-loader-logo.js";
22
22
  import "./components/ds-loader-spinner/ds-loader-spinner.js";
23
23
  import "./components/ds-logo/ds-logo.js";
24
+ import "./components/ds-main-title/ds-main-title.js";
24
25
  import "./components/ds-map-pin/ds-map-pin.js";
25
26
  import "./components/ds-modal/ds-modal.js";
26
27
  import "./components/ds-password-input/ds-password-input.js";
@@ -55,7 +56,8 @@ import "./components/ds-static-box/ds-static-box.js";
55
56
  import "./components/ds-interactive-card/ds-interactive-card.js";
56
57
  import "./components/ds-radio-button-group/ds-radio-button-group.js";
57
58
  import "./components/ds-sidebar-navigation/ds-sidebar-navigation.js";
58
- import { iconNames as to } from "./components/ds-icon/iconNames.js";
59
+ import "./components/ds-badge/ds-badge.js";
60
+ import { iconNames as ao } from "./components/ds-icon/iconNames.js";
59
61
  export {
60
- to as iconNames
62
+ ao as iconNames
61
63
  };
@@ -1,12 +1,9 @@
1
1
  import type { Icons } from '../components/ds-icon/Icons.type.ts';
2
2
  declare class IconsManager {
3
- private static instance;
4
3
  private icons;
5
4
  private theme;
6
- private constructor();
5
+ constructor();
7
6
  handleChangeTheme: (theme: string) => void;
8
- static getInstance(): IconsManager;
9
- private getCachedIcon;
10
7
  fetchIcon: (iconName: Icons, requestInit?: RequestInit) => Promise<string>;
11
8
  private loadIcon;
12
9
  }
@@ -1,32 +1,38 @@
1
- import { THEME_STORAGE_KEY as i } from "../core/theme.constants.js";
2
- import { pubSub as n } from "./PubSub.js";
3
- class c {
1
+ import { THEME_STORAGE_KEY as r } from "../core/theme.constants.js";
2
+ import { pubSub as l } from "./PubSub.js";
3
+ class f {
4
4
  constructor() {
5
- this.icons = {}, this.handleChangeTheme = (t) => {
6
- this.theme = t;
7
- const h = Object.keys(this.icons);
8
- this.icons = {}, h.forEach((e) => this.fetchIcon(e));
9
- }, this.fetchIcon = async (t, h = {}) => {
10
- const e = sessionStorage == null ? void 0 : sessionStorage.getItem(i);
11
- !this.theme && e && (this.theme = e);
12
- const s = await this.getCachedIcon(t);
13
- return s || (this.icons[t] = this.loadIcon(t, h), this.icons[t]);
14
- }, n.subscribe("theme", this.handleChangeTheme);
15
- }
16
- static getInstance() {
17
- return c.instance || (c.instance = new c()), c.instance;
18
- }
19
- getCachedIcon(t) {
20
- return this.icons[t];
21
- }
22
- loadIcon(t, { cache: h = "force-cache", ...e }) {
23
- return this.theme ? fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${t}.svg`, {
24
- cache: h,
25
- ...e
26
- }).then((s) => s.text()).catch((s) => ((s == null ? void 0 : s.name) !== "AbortError" && console.error(`Failed to fetch icon "${t}":`, s), "")) : Promise.resolve('<svg class="ds-icon"></svg>');
5
+ this.icons = {}, this.handleChangeTheme = (s) => {
6
+ this.theme = s;
7
+ const o = Object.keys(this.icons);
8
+ this.icons = {}, o.forEach((t) => this.fetchIcon(t));
9
+ }, this.fetchIcon = async (s, o = {}) => {
10
+ const t = typeof sessionStorage < "u" ? sessionStorage == null ? void 0 : sessionStorage.getItem(r) : null;
11
+ !this.theme && t && (this.theme = t);
12
+ const e = this.icons[s];
13
+ if (e) return await e;
14
+ const n = this.loadIcon(s, o).catch((a) => {
15
+ throw delete this.icons[s], a;
16
+ });
17
+ return this.icons[s] = n, n;
18
+ }, this.loadIcon = (s, { cache: o = "force-cache", ...t }) => this.theme ? fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${s}.svg`, {
19
+ cache: o,
20
+ ...t
21
+ }).then((e) => e.text()).catch((e) => {
22
+ if ((e == null ? void 0 : e.name) === "AbortError") throw e;
23
+ return console.error(`Failed to fetch icon "${s}":`, e), "";
24
+ }) : Promise.resolve('<svg class="ds-icon"></svg>'), l.subscribe("theme", this.handleChangeTheme);
27
25
  }
28
26
  }
29
- const r = c.getInstance();
27
+ const c = Symbol.for("@cupra/ui-kit/icons-manager"), h = globalThis;
28
+ let i = h[c];
29
+ i || (i = new f(), Object.defineProperty(h, c, {
30
+ value: i,
31
+ writable: !1,
32
+ configurable: !1,
33
+ enumerable: !1
34
+ }));
35
+ const b = i;
30
36
  export {
31
- r as iconsManager
37
+ b as iconsManager
32
38
  };
@@ -5,7 +5,7 @@ class s {
5
5
  theme: t
6
6
  }) => {
7
7
  if (!t || !e) return;
8
- const c = `https://ds-assets.cupra.com/1.0.0-canary.17/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
8
+ const c = `https://ds-assets.cupra.com/1.0.0-canary.19/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
9
9
  if (r) return r;
10
10
  const i = this.fetchStyle({ url: c }).then((n) => (n || this.stylePromises.delete(c), n));
11
11
  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-v1-0-0-canary-17"), i = n(e);
6
+ const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-19"), 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-0-0-canary-17"), e = i(o);
6
+ const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-19"), e = i(o);
7
7
  return n`${e}`;
8
8
  }
9
9
  export {
@@ -21,7 +21,7 @@ const E = C`:host([unresolved]){visibility:hidden}`, h = class c extends y {
21
21
  }, this.pubSubTheme = p.subscribe("theme", this.handleChangeTheme);
22
22
  }
23
23
  get theme() {
24
- const e = sessionStorage == null ? void 0 : sessionStorage.getItem(d);
24
+ const e = typeof sessionStorage < "u" ? sessionStorage == null ? void 0 : sessionStorage.getItem(d) : null;
25
25
  return this.contextTheme ?? this.pubSubTheme ?? e;
26
26
  }
27
27
  connectedCallback() {
@@ -0,0 +1,18 @@
1
+ import { UiKitElement } from '../base/UiKitElement.ts';
2
+ import { nothing } from 'lit';
3
+ import type { DsBadgeAttrs } from './ds-badge.types.js';
4
+ export declare class DsBadge extends UiKitElement {
5
+ static styles: import("lit").CSSResult[];
6
+ number?: number;
7
+ variant: DsBadgeAttrs['variant'];
8
+ size: DsBadgeAttrs['size'];
9
+ protected get hasNumber(): boolean;
10
+ protected get classes(): {
11
+ [x: string]: boolean;
12
+ container: boolean;
13
+ dot: boolean;
14
+ number: boolean;
15
+ };
16
+ protected get contentTemplate(): typeof nothing | import("lit").TemplateResult<1>;
17
+ render(): import("lit").TemplateResult<1>;
18
+ }
@@ -0,0 +1,53 @@
1
+ import { UiKitElement as h } 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 { nothing as b, html as u } 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 a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
7
+ import { classMap as c } 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
+ import { cupraDiagonalStyles as v } from "./styles/cupra-diagonal.styles.js";
10
+ var y = Object.defineProperty, g = Object.getOwnPropertyDescriptor, i = (p, r, m, s) => {
11
+ for (var t = s > 1 ? void 0 : s ? g(r, m) : r, o = p.length - 1, n; o >= 0; o--)
12
+ (n = p[o]) && (t = (s ? n(r, m, t) : n(t)) || t);
13
+ return s && t && y(r, m, t), t;
14
+ };
15
+ let e = class extends h {
16
+ constructor() {
17
+ super(...arguments), this.variant = "base", this.size = "medium";
18
+ }
19
+ get hasNumber() {
20
+ return typeof this.number == "number" && !Number.isNaN(this.number);
21
+ }
22
+ get classes() {
23
+ return {
24
+ container: !0,
25
+ dot: !this.hasNumber,
26
+ number: this.hasNumber,
27
+ [`variant-${this.variant}`]: !0,
28
+ [`size-${this.size}`]: !0
29
+ };
30
+ }
31
+ get contentTemplate() {
32
+ return this.hasNumber ? u`${this.number}` : b;
33
+ }
34
+ render() {
35
+ return u` <div class=${c(this.classes)}>${this.contentTemplate}</div> `;
36
+ }
37
+ };
38
+ e.styles = [f, v];
39
+ i([
40
+ a({ type: Number })
41
+ ], e.prototype, "number", 2);
42
+ i([
43
+ a({ type: String })
44
+ ], e.prototype, "variant", 2);
45
+ i([
46
+ a({ type: String })
47
+ ], e.prototype, "size", 2);
48
+ e = i([
49
+ l("ds-badge")
50
+ ], e);
51
+ export {
52
+ e as DsBadge
53
+ };
@@ -0,0 +1,8 @@
1
+ import type { DsBadge } from './ds-badge';
2
+ import './ds-badge';
3
+ import '../ds-theme-provider/ds-theme-provider.ts';
4
+ declare global {
5
+ interface HTMLElementTagNameMap {
6
+ 'ds-badge': DsBadge;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { CommonAttrs } from '../../types/types';
2
+ export interface DsBadgeAttrs extends CommonAttrs {
3
+ number?: number;
4
+ variant?: 'base' | 'inverted';
5
+ size?: 'medium' | 'small';
6
+ }
@@ -0,0 +1 @@
1
+ export declare const commonStyles: import("lit").CSSResult;
@@ -0,0 +1,9 @@
1
+ import { cssWithTokens as o } from "../../../utils/cssWithTokens.js";
2
+ const t = o`
3
+ :host {
4
+ display: inline-flex;
5
+ }
6
+ `;
7
+ export {
8
+ t as commonStyles
9
+ };
@@ -0,0 +1 @@
1
+ export declare const cupraDiagonalStyles: import("lit").CSSResult;
@@ -0,0 +1,47 @@
1
+ import { cssWithTokens as e } from "../../../utils/cssWithTokens.js";
2
+ const o = e`
3
+ .container {
4
+ border-radius: 50%;
5
+ }
6
+
7
+ .number {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ font-family: var(--dg-font-family-base);
12
+ font-weight: 400;
13
+ }
14
+
15
+ .number.size-medium {
16
+ width: var(--dg-size-24);
17
+ height: var(--dg-size-24);
18
+ font-size: var(--dg-font-size-body-s);
19
+ line-height: var(--dg-font-body-s-medium-line-height);
20
+ }
21
+
22
+ .number.size-small {
23
+ width: var(--dg-size-16);
24
+ height: var(--dg-size-16);
25
+ font-size: var(--dg-font-size-body-xs);
26
+ line-height: var(--dg-font-body-xs-medium-line-height);
27
+ }
28
+
29
+ .variant-base {
30
+ color: var(--dg-color-text-strong);
31
+ background-color: var(--dg-color-bg-base);
32
+ }
33
+
34
+ .variant-inverted {
35
+ background-color: var(--dg-color-bg-inverted);
36
+ color: var(--dg-color-text-inverted);
37
+ }
38
+
39
+ .dot {
40
+ width: var(--dg-size-08);
41
+ height: var(--dg-size-08);
42
+ background-color: var(--dg-color-bg-error);
43
+ }
44
+ `;
45
+ export {
46
+ o as cupraDiagonalStyles
47
+ };
@@ -1,53 +1,58 @@
1
1
  import { UiKitElement as f } from "../base/UiKitElement.js";
2
2
  import { customUiKitElement as u } from "../../decorators/customUiKitElement.js";
3
- import { iconsManager as g } from "../../utils/IconsManager.js";
4
- import { pubSub as y } from "../../utils/PubSub.js";
5
- import { htmlWithTokens as _ } from "../../utils/htmlWithTokens.js";
3
+ import { iconsManager as y } from "../../utils/IconsManager.js";
4
+ import { pubSub as _ } from "../../utils/PubSub.js";
5
+ import { htmlWithTokens as g } from "../../utils/htmlWithTokens.js";
6
6
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
7
7
  import { html as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
8
8
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
9
- import { property as c } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
9
+ import { property as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
10
10
  import { state as w } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
11
- import { unsafeHTML as b } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
11
+ import { unsafeHTML as x } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
12
12
  import { css as $ } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
13
- var k = Object.defineProperty, x = Object.getOwnPropertyDescriptor, d = (t) => {
13
+ var k = Object.defineProperty, H = Object.getOwnPropertyDescriptor, m = (t) => {
14
14
  throw TypeError(t);
15
- }, n = (t, i, e, r) => {
16
- for (var s = r > 1 ? void 0 : r ? x(i, e) : i, h = t.length - 1, p; h >= 0; h--)
17
- (p = t[h]) && (s = (r ? p(i, e, s) : p(s)) || s);
18
- return r && s && k(i, e, s), s;
19
- }, v = (t, i, e) => i.has(t) || d("Cannot " + e), m = (t, i, e) => (v(t, i, "read from private field"), i.get(t)), H = (t, i, e) => i.has(t) ? d("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, e), D = (t, i, e, r) => (v(t, i, "write to private field"), i.set(t, e), e), a;
15
+ }, n = (t, e, i, s) => {
16
+ for (var r = s > 1 ? void 0 : s ? H(e, i) : e, h = t.length - 1, p; h >= 0; h--)
17
+ (p = t[h]) && (r = (s ? p(e, i, r) : p(r)) || r);
18
+ return s && r && k(e, i, r), r;
19
+ }, d = (t, e, i) => e.has(t) || m("Cannot " + i), v = (t, e, i) => (d(t, e, "read from private field"), i ? i.call(t) : e.get(t)), I = (t, e, i) => e.has(t) ? m("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), D = (t, e, i, s) => (d(t, e, "write to private field"), e.set(t, i), i), N = (t, e, i, s) => ({
20
+ set _(r) {
21
+ D(t, e, r);
22
+ },
23
+ get _() {
24
+ return v(t, e, s);
25
+ }
26
+ }), c;
20
27
  let o = class extends f {
21
28
  constructor() {
22
- super(), this.iconHtml = "", H(this, a), this.getIcon = async () => {
23
- var i, e, r;
24
- (i = m(this, a)) == null || i.abort(), D(this, a, new AbortController());
25
- const t = m(this, a).signal;
26
- this.iconHtml = await ((r = (e = g).fetchIcon) == null ? void 0 : r.call(e, this.iconName, { signal: t }));
27
- }, y.subscribe("theme", this.getIcon);
29
+ super(), this.iconHtml = "", I(this, c, 0), this.getIcon = async () => {
30
+ const t = ++N(this, c)._, e = await y.fetchIcon(this.iconName);
31
+ t === v(this, c) && (this.iconHtml = e);
32
+ }, _.subscribe("theme", this.getIcon);
28
33
  }
29
34
  async updated(t) {
30
35
  super.updated(t), (t.has("iconName") || !this.iconHtml) && await this.getIcon();
31
36
  }
32
- getDimension(t, i, e) {
33
- return t ? `${t}px` : i ? "auto" : this.size ? `${this.size}px` : e;
37
+ getDimension(t, e, i) {
38
+ return t ? `${t}px` : e ? "auto" : this.size ? `${this.size}px` : i;
34
39
  }
35
40
  get styleTokens() {
36
41
  const t = this.getDimension(
37
42
  this.width,
38
43
  this.height,
39
44
  "var(--private-ds-icon-width, var(--ds-icon-width, 20px))"
40
- ), i = this.getDimension(
45
+ ), e = this.getDimension(
41
46
  this.height,
42
47
  this.width,
43
48
  "var(--private-ds-icon-height, var(--ds-icon-height, 20px))"
44
49
  );
45
- return _`
50
+ return g`
46
51
  <style>
47
52
  .ds-icon {
48
53
  display: inline-block;
49
54
  width: ${t};
50
- height: ${i};
55
+ height: ${e};
51
56
  }
52
57
 
53
58
  .ds-icon-color {
@@ -63,11 +68,11 @@ let o = class extends f {
63
68
  render() {
64
69
  return l`
65
70
  ${this.styleTokens}
66
- ${this.iconHtml ? b(this.iconHtml) : l`<svg class="ds-icon"></svg>`}
71
+ ${this.iconHtml ? x(this.iconHtml) : l`<svg class="ds-icon">x</svg>`}
67
72
  `;
68
73
  }
69
74
  };
70
- a = /* @__PURE__ */ new WeakMap();
75
+ c = /* @__PURE__ */ new WeakMap();
71
76
  o.styles = $`
72
77
  :host {
73
78
  line-height: 0;
@@ -75,19 +80,19 @@ o.styles = $`
75
80
  }
76
81
  `;
77
82
  n([
78
- c({ type: String, attribute: "icon-name" })
83
+ a({ type: String, attribute: "icon-name" })
79
84
  ], o.prototype, "iconName", 2);
80
85
  n([
81
- c({ type: String, attribute: "color" })
86
+ a({ type: String, attribute: "color" })
82
87
  ], o.prototype, "color", 2);
83
88
  n([
84
- c({ type: Number })
89
+ a({ type: Number })
85
90
  ], o.prototype, "width", 2);
86
91
  n([
87
- c({ type: Number })
92
+ a({ type: Number })
88
93
  ], o.prototype, "height", 2);
89
94
  n([
90
- c({ type: Number, attribute: "size" })
95
+ a({ type: Number, attribute: "size" })
91
96
  ], o.prototype, "size", 2);
92
97
  n([
93
98
  w()
@@ -0,0 +1,10 @@
1
+ import { UiKitElement } from '../base/UiKitElement.ts';
2
+ declare const DsMainTitle_base: (new (...args: any[]) => import("../../mixins/ViewportMixin").ViewportInterface) & typeof UiKitElement;
3
+ export declare class DsMainTitle extends DsMainTitle_base {
4
+ static styles: import("lit").CSSResult[];
5
+ protected get containerClasses(): {
6
+ container: boolean;
7
+ };
8
+ render(): import("lit").TemplateResult<1>;
9
+ }
10
+ export {};
@@ -0,0 +1,35 @@
1
+ import { UiKitElement as l } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as a } from "../../decorators/customUiKitElement.js";
3
+ import { ViewportMixin as p } from "../../mixins/ViewportMixin.js";
4
+ import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
5
+ import { html as c } 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 { classMap as f } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
8
+ import { commonStyles as v } from "./styles/common.styles.js";
9
+ var u = Object.getOwnPropertyDescriptor, d = (s, o, n, i) => {
10
+ for (var t = i > 1 ? void 0 : i ? u(o, n) : o, e = s.length - 1, m; e >= 0; e--)
11
+ (m = s[e]) && (t = m(t) || t);
12
+ return t;
13
+ };
14
+ let r = class extends p(l) {
15
+ get containerClasses() {
16
+ return {
17
+ container: !0
18
+ };
19
+ }
20
+ render() {
21
+ return c`
22
+ <div class=${f(this.containerClasses)}>
23
+ <slot name="title"></slot>
24
+ <slot name="description"></slot>
25
+ </div>
26
+ `;
27
+ }
28
+ };
29
+ r.styles = [v];
30
+ r = d([
31
+ a("ds-main-title")
32
+ ], r);
33
+ export {
34
+ r as DsMainTitle
35
+ };
@@ -0,0 +1,7 @@
1
+ import type { DsMainTitle } from './ds-main-title';
2
+ import './ds-main-title.ts';
3
+ declare global {
4
+ interface HTMLElementTagNameMap {
5
+ 'ds-main-title': DsMainTitle;
6
+ }
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { CommonAttrs } from '../../types/types';
2
+ export type DsMainTitleAttrs = CommonAttrs;
@@ -0,0 +1 @@
1
+ export declare const commonStyles: import("lit").CSSResult;
@@ -0,0 +1,19 @@
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 l = o`
6
+ :host {
7
+ display: block;
8
+ width: 100%;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ ::slotted([slot='title']),
13
+ ::slotted([slot='description']) {
14
+ margin: 0;
15
+ }
16
+ `;
17
+ export {
18
+ l as commonStyles
19
+ };
@@ -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.0.0-canary.17", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
57
+ const s = "/1.0.0-canary.19", 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");
@@ -21,6 +21,7 @@ import './ds-loader-dots/ds-loader-dots.ts';
21
21
  import './ds-loader-logo/ds-loader-logo.ts';
22
22
  import './ds-loader-spinner/ds-loader-spinner.ts';
23
23
  import './ds-logo/ds-logo.ts';
24
+ import './ds-main-title/ds-main-title.ts';
24
25
  import './ds-map-pin/ds-map-pin.ts';
25
26
  import './ds-modal/ds-modal.ts';
26
27
  import './ds-password-input/ds-password-input.ts';
@@ -55,3 +56,4 @@ import './ds-static-box/ds-static-box.ts';
55
56
  import './ds-interactive-card/ds-interactive-card.ts';
56
57
  import './ds-radio-button-group/ds-radio-button-group.ts';
57
58
  import './ds-sidebar-navigation/ds-sidebar-navigation.ts';
59
+ import './ds-badge/ds-badge.ts';
@@ -21,6 +21,7 @@ import "./components/ds-loader-dots/ds-loader-dots.js";
21
21
  import "./components/ds-loader-logo/ds-loader-logo.js";
22
22
  import "./components/ds-loader-spinner/ds-loader-spinner.js";
23
23
  import "./components/ds-logo/ds-logo.js";
24
+ import "./components/ds-main-title/ds-main-title.js";
24
25
  import "./components/ds-map-pin/ds-map-pin.js";
25
26
  import "./components/ds-modal/ds-modal.js";
26
27
  import "./components/ds-password-input/ds-password-input.js";
@@ -55,7 +56,8 @@ import "./components/ds-static-box/ds-static-box.js";
55
56
  import "./components/ds-interactive-card/ds-interactive-card.js";
56
57
  import "./components/ds-radio-button-group/ds-radio-button-group.js";
57
58
  import "./components/ds-sidebar-navigation/ds-sidebar-navigation.js";
58
- import { iconNames as to } from "./components/ds-icon/iconNames.js";
59
+ import "./components/ds-badge/ds-badge.js";
60
+ import { iconNames as ao } from "./components/ds-icon/iconNames.js";
59
61
  export {
60
- to as iconNames
62
+ ao as iconNames
61
63
  };
@@ -1,12 +1,9 @@
1
1
  import type { Icons } from '../components/ds-icon/Icons.type.ts';
2
2
  declare class IconsManager {
3
- private static instance;
4
3
  private icons;
5
4
  private theme;
6
- private constructor();
5
+ constructor();
7
6
  handleChangeTheme: (theme: string) => void;
8
- static getInstance(): IconsManager;
9
- private getCachedIcon;
10
7
  fetchIcon: (iconName: Icons, requestInit?: RequestInit) => Promise<string>;
11
8
  private loadIcon;
12
9
  }
@@ -1,32 +1,38 @@
1
- import { THEME_STORAGE_KEY as i } from "../core/theme.constants.js";
2
- import { pubSub as n } from "./PubSub.js";
3
- class c {
1
+ import { THEME_STORAGE_KEY as r } from "../core/theme.constants.js";
2
+ import { pubSub as l } from "./PubSub.js";
3
+ class f {
4
4
  constructor() {
5
- this.icons = {}, this.handleChangeTheme = (t) => {
6
- this.theme = t;
7
- const h = Object.keys(this.icons);
8
- this.icons = {}, h.forEach((e) => this.fetchIcon(e));
9
- }, this.fetchIcon = async (t, h = {}) => {
10
- const e = sessionStorage == null ? void 0 : sessionStorage.getItem(i);
11
- !this.theme && e && (this.theme = e);
12
- const s = await this.getCachedIcon(t);
13
- return s || (this.icons[t] = this.loadIcon(t, h), this.icons[t]);
14
- }, n.subscribe("theme", this.handleChangeTheme);
15
- }
16
- static getInstance() {
17
- return c.instance || (c.instance = new c()), c.instance;
18
- }
19
- getCachedIcon(t) {
20
- return this.icons[t];
21
- }
22
- loadIcon(t, { cache: h = "force-cache", ...e }) {
23
- return this.theme ? fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${t}.svg`, {
24
- cache: h,
25
- ...e
26
- }).then((s) => s.text()).catch((s) => ((s == null ? void 0 : s.name) !== "AbortError" && console.error(`Failed to fetch icon "${t}":`, s), "")) : Promise.resolve('<svg class="ds-icon"></svg>');
5
+ this.icons = {}, this.handleChangeTheme = (s) => {
6
+ this.theme = s;
7
+ const o = Object.keys(this.icons);
8
+ this.icons = {}, o.forEach((t) => this.fetchIcon(t));
9
+ }, this.fetchIcon = async (s, o = {}) => {
10
+ const t = typeof sessionStorage < "u" ? sessionStorage == null ? void 0 : sessionStorage.getItem(r) : null;
11
+ !this.theme && t && (this.theme = t);
12
+ const e = this.icons[s];
13
+ if (e) return await e;
14
+ const n = this.loadIcon(s, o).catch((a) => {
15
+ throw delete this.icons[s], a;
16
+ });
17
+ return this.icons[s] = n, n;
18
+ }, this.loadIcon = (s, { cache: o = "force-cache", ...t }) => this.theme ? fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${s}.svg`, {
19
+ cache: o,
20
+ ...t
21
+ }).then((e) => e.text()).catch((e) => {
22
+ if ((e == null ? void 0 : e.name) === "AbortError") throw e;
23
+ return console.error(`Failed to fetch icon "${s}":`, e), "";
24
+ }) : Promise.resolve('<svg class="ds-icon"></svg>'), l.subscribe("theme", this.handleChangeTheme);
27
25
  }
28
26
  }
29
- const r = c.getInstance();
27
+ const c = Symbol.for("@cupra/ui-kit/icons-manager"), h = globalThis;
28
+ let i = h[c];
29
+ i || (i = new f(), Object.defineProperty(h, c, {
30
+ value: i,
31
+ writable: !1,
32
+ configurable: !1,
33
+ enumerable: !1
34
+ }));
35
+ const b = i;
30
36
  export {
31
- r as iconsManager
37
+ b as iconsManager
32
38
  };
@@ -5,7 +5,7 @@ class s {
5
5
  theme: t
6
6
  }) => {
7
7
  if (!t || !e) return;
8
- const c = `https://ds-assets.cupra.com/1.0.0-canary.17/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
8
+ const c = `https://ds-assets.cupra.com/1.0.0-canary.19/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
9
9
  if (r) return r;
10
10
  const i = this.fetchStyle({ url: c }).then((n) => (n || this.stylePromises.delete(c), n));
11
11
  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-v1-0-0-canary-17"), i = n(e);
6
+ const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-19"), 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-0-0-canary-17"), e = i(o);
6
+ const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v1-0-0-canary-19"), e = i(o);
7
7
  return n`${e}`;
8
8
  }
9
9
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-kit",
3
- "version": "1.0.0-canary.17",
3
+ "version": "1.0.0-canary.19",
4
4
  "description": "Web components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",