@cupra/ui-kit 2.0.0-canary.34 → 2.0.0-canary.36
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-picker-item/ds-picker-item.cjs +9 -9
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/esm/components/ds-picker-item/ds-picker-item.js +20 -20
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/cjs/components/ds-picker-item/ds-picker-item.cjs +9 -9
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/esm/components/ds-picker-item/ds-picker-item.js +20 -20
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),m=require("../../decorators/customUiKitElement.cjs"),
|
|
2
|
-
<
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),m=require("../../decorators/customUiKitElement.cjs"),h=require("../../mixins/ViewportMixin.cjs"),C=require("../../utils/booleanConverter.cjs"),v=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const c=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 i=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"),d=require("./styles/common.styles.cjs");var g=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(n,e,o,s)=>{for(var t=s>1?void 0:s?y(e,o):e,l=n.length-1,a;l>=0;l--)(a=n[l])&&(t=(s?a(e,o,t):a(t))||t);return s&&t&&g(e,o,t),t};exports.DsPickerItem=class extends h.ViewportMixin(u.UiKitElement){constructor(){super(...arguments),this.variant="without-border",this.size="medium",this.loading=!1,this.selected=!1}get containerClasses(){const e=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,[e]:!!e,selected:this.selected,loading:this.loading}}handleClick(){this.selected||this.loading||this.dispatchEvent(new CustomEvent("ds-picker-item:click",{bubbles:!0,composed:!0}))}get imageContainerClasses(){return{"image-container":!0,[this.variant]:!!this.variant}}get loadingTemplate(){return this.loading?c.html`
|
|
2
|
+
<span class="overlay">
|
|
3
3
|
<svg class="spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" fill="none">
|
|
4
4
|
<path
|
|
5
5
|
d="M38.3334 20.0001C38.3334 30.1253 30.1252 38.3334 20 38.3334C9.8748 38.3334 1.66669 30.1253 1.66669 20.0001C1.66669 9.87486 9.8748 1.66675 20 1.66675C30.1252 1.66675 38.3334 9.87486 38.3334 20.0001ZM7.97929 20.0001C7.97929 26.6389 13.3612 32.0208 20 32.0208C26.6389 32.0208 32.0207 26.6389 32.0207 20.0001C32.0207 13.3612 26.6389 7.97935 20 7.97935C13.3612 7.97935 7.97929 13.3612 7.97929 20.0001Z"
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
fill="#E1E6EA"
|
|
11
11
|
/>
|
|
12
12
|
</svg>
|
|
13
|
-
</
|
|
14
|
-
`:
|
|
15
|
-
<
|
|
16
|
-
<
|
|
13
|
+
</span>
|
|
14
|
+
`:c.nothing}render(){return c.html`
|
|
15
|
+
<button class=${p.classMap(this.containerClasses)} @click=${this.handleClick}>
|
|
16
|
+
<span class=${p.classMap(this.imageContainerClasses)}>
|
|
17
17
|
<slot></slot>
|
|
18
|
-
</
|
|
18
|
+
</span>
|
|
19
19
|
${this.loadingTemplate}
|
|
20
|
-
</
|
|
21
|
-
`}};exports.DsPickerItem.styles=[
|
|
20
|
+
</button>
|
|
21
|
+
`}};exports.DsPickerItem.styles=[d.pickerItemStyles];r([i.property({type:String})],exports.DsPickerItem.prototype,"variant",2);r([i.property({type:String,converter:v.objectConverter})],exports.DsPickerItem.prototype,"size",2);r([i.property({type:Boolean,converter:C.booleanConverter})],exports.DsPickerItem.prototype,"loading",2);r([i.property({type:Boolean,converter:C.booleanConverter})],exports.DsPickerItem.prototype,"selected",2);exports.DsPickerItem=r([m.customUiKitElement("ds-picker-item")],exports.DsPickerItem);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.36",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},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`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},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`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.36"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.36"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.36/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");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 e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");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 e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-36"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=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 o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=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 o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-36"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { UiKitElement as h } from "../base/UiKitElement.js";
|
|
2
2
|
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
3
|
-
import { ViewportMixin as
|
|
3
|
+
import { ViewportMixin as g } from "../../mixins/ViewportMixin.js";
|
|
4
4
|
import { booleanConverter as c } from "../../utils/booleanConverter.js";
|
|
5
|
-
import { objectConverter as
|
|
5
|
+
import { objectConverter as u } from "../../utils/objectConverter.js";
|
|
6
6
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
7
|
-
import { nothing as
|
|
7
|
+
import { nothing as v, html as C } 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
9
|
import { property as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
10
10
|
import { classMap as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
11
|
-
import { pickerItemStyles as
|
|
12
|
-
var y = Object.defineProperty, w = Object.getOwnPropertyDescriptor, r = (
|
|
13
|
-
for (var e = o > 1 ? void 0 : o ? w(
|
|
14
|
-
(p =
|
|
15
|
-
return o && e && y(
|
|
11
|
+
import { pickerItemStyles as f } from "./styles/common.styles.js";
|
|
12
|
+
var y = Object.defineProperty, w = Object.getOwnPropertyDescriptor, r = (s, i, a, o) => {
|
|
13
|
+
for (var e = o > 1 ? void 0 : o ? w(i, a) : i, l = s.length - 1, p; l >= 0; l--)
|
|
14
|
+
(p = s[l]) && (e = (o ? p(i, a, e) : p(e)) || e);
|
|
15
|
+
return o && e && y(i, a, e), e;
|
|
16
16
|
};
|
|
17
|
-
let t = class extends
|
|
17
|
+
let t = class extends g(h) {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments), this.variant = "without-border", this.size = "medium", this.loading = !1, this.selected = !1;
|
|
20
20
|
}
|
|
21
21
|
get containerClasses() {
|
|
22
|
-
const
|
|
22
|
+
const s = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
23
23
|
return {
|
|
24
24
|
container: !0,
|
|
25
|
-
[
|
|
25
|
+
[s]: !!s,
|
|
26
26
|
selected: this.selected,
|
|
27
27
|
loading: this.loading
|
|
28
28
|
};
|
|
@@ -43,7 +43,7 @@ let t = class extends v(h) {
|
|
|
43
43
|
}
|
|
44
44
|
get loadingTemplate() {
|
|
45
45
|
return this.loading ? C`
|
|
46
|
-
<
|
|
46
|
+
<span class="overlay">
|
|
47
47
|
<svg class="spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" fill="none">
|
|
48
48
|
<path
|
|
49
49
|
d="M38.3334 20.0001C38.3334 30.1253 30.1252 38.3334 20 38.3334C9.8748 38.3334 1.66669 30.1253 1.66669 20.0001C1.66669 9.87486 9.8748 1.66675 20 1.66675C30.1252 1.66675 38.3334 9.87486 38.3334 20.0001ZM7.97929 20.0001C7.97929 26.6389 13.3612 32.0208 20 32.0208C26.6389 32.0208 32.0207 26.6389 32.0207 20.0001C32.0207 13.3612 26.6389 7.97935 20 7.97935C13.3612 7.97935 7.97929 13.3612 7.97929 20.0001Z"
|
|
@@ -54,26 +54,26 @@ let t = class extends v(h) {
|
|
|
54
54
|
fill="#E1E6EA"
|
|
55
55
|
/>
|
|
56
56
|
</svg>
|
|
57
|
-
</
|
|
58
|
-
` :
|
|
57
|
+
</span>
|
|
58
|
+
` : v;
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
61
|
return C`
|
|
62
|
-
<
|
|
63
|
-
<
|
|
62
|
+
<button class=${m(this.containerClasses)} @click=${this.handleClick}>
|
|
63
|
+
<span class=${m(this.imageContainerClasses)}>
|
|
64
64
|
<slot></slot>
|
|
65
|
-
</
|
|
65
|
+
</span>
|
|
66
66
|
${this.loadingTemplate}
|
|
67
|
-
</
|
|
67
|
+
</button>
|
|
68
68
|
`;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
t.styles = [
|
|
71
|
+
t.styles = [f];
|
|
72
72
|
r([
|
|
73
73
|
n({ type: String })
|
|
74
74
|
], t.prototype, "variant", 2);
|
|
75
75
|
r([
|
|
76
|
-
n({ type: String, converter:
|
|
76
|
+
n({ type: String, converter: u })
|
|
77
77
|
], t.prototype, "size", 2);
|
|
78
78
|
r([
|
|
79
79
|
n({ type: Boolean, converter: c })
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.36", 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");
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.36"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
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/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.36"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -5,7 +5,7 @@ class s {
|
|
|
5
5
|
theme: t
|
|
6
6
|
}) => {
|
|
7
7
|
if (!t || !e) return;
|
|
8
|
-
const r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
8
|
+
const r = `https://ds-assets.cupra.com/2.0.0-canary.36/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
|
|
9
9
|
if (c) return c;
|
|
10
10
|
const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
|
|
11
11
|
return this.stylePromises.set(r, i), this.stylePromises.get(r);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-36"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-36"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),m=require("../../decorators/customUiKitElement.cjs"),
|
|
2
|
-
<
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),m=require("../../decorators/customUiKitElement.cjs"),h=require("../../mixins/ViewportMixin.cjs"),C=require("../../utils/booleanConverter.cjs"),v=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const c=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 i=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"),d=require("./styles/common.styles.cjs");var g=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(n,e,o,s)=>{for(var t=s>1?void 0:s?y(e,o):e,l=n.length-1,a;l>=0;l--)(a=n[l])&&(t=(s?a(e,o,t):a(t))||t);return s&&t&&g(e,o,t),t};exports.DsPickerItem=class extends h.ViewportMixin(u.UiKitElement){constructor(){super(...arguments),this.variant="without-border",this.size="medium",this.loading=!1,this.selected=!1}get containerClasses(){const e=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,[e]:!!e,selected:this.selected,loading:this.loading}}handleClick(){this.selected||this.loading||this.dispatchEvent(new CustomEvent("ds-picker-item:click",{bubbles:!0,composed:!0}))}get imageContainerClasses(){return{"image-container":!0,[this.variant]:!!this.variant}}get loadingTemplate(){return this.loading?c.html`
|
|
2
|
+
<span class="overlay">
|
|
3
3
|
<svg class="spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" fill="none">
|
|
4
4
|
<path
|
|
5
5
|
d="M38.3334 20.0001C38.3334 30.1253 30.1252 38.3334 20 38.3334C9.8748 38.3334 1.66669 30.1253 1.66669 20.0001C1.66669 9.87486 9.8748 1.66675 20 1.66675C30.1252 1.66675 38.3334 9.87486 38.3334 20.0001ZM7.97929 20.0001C7.97929 26.6389 13.3612 32.0208 20 32.0208C26.6389 32.0208 32.0207 26.6389 32.0207 20.0001C32.0207 13.3612 26.6389 7.97935 20 7.97935C13.3612 7.97935 7.97929 13.3612 7.97929 20.0001Z"
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
fill="#E1E6EA"
|
|
11
11
|
/>
|
|
12
12
|
</svg>
|
|
13
|
-
</
|
|
14
|
-
`:
|
|
15
|
-
<
|
|
16
|
-
<
|
|
13
|
+
</span>
|
|
14
|
+
`:c.nothing}render(){return c.html`
|
|
15
|
+
<button class=${p.classMap(this.containerClasses)} @click=${this.handleClick}>
|
|
16
|
+
<span class=${p.classMap(this.imageContainerClasses)}>
|
|
17
17
|
<slot></slot>
|
|
18
|
-
</
|
|
18
|
+
</span>
|
|
19
19
|
${this.loadingTemplate}
|
|
20
|
-
</
|
|
21
|
-
`}};exports.DsPickerItem.styles=[
|
|
20
|
+
</button>
|
|
21
|
+
`}};exports.DsPickerItem.styles=[d.pickerItemStyles];r([i.property({type:String})],exports.DsPickerItem.prototype,"variant",2);r([i.property({type:String,converter:v.objectConverter})],exports.DsPickerItem.prototype,"size",2);r([i.property({type:Boolean,converter:C.booleanConverter})],exports.DsPickerItem.prototype,"loading",2);r([i.property({type:Boolean,converter:C.booleanConverter})],exports.DsPickerItem.prototype,"selected",2);exports.DsPickerItem=r([m.customUiKitElement("ds-picker-item")],exports.DsPickerItem);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.36",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},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`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},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`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.36"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.36"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.36/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");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 e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");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 e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-36"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=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 o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=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 o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-36"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { UiKitElement as h } from "../base/UiKitElement.js";
|
|
2
2
|
import { customUiKitElement as d } from "../../decorators/customUiKitElement.js";
|
|
3
|
-
import { ViewportMixin as
|
|
3
|
+
import { ViewportMixin as g } from "../../mixins/ViewportMixin.js";
|
|
4
4
|
import { booleanConverter as c } from "../../utils/booleanConverter.js";
|
|
5
|
-
import { objectConverter as
|
|
5
|
+
import { objectConverter as u } from "../../utils/objectConverter.js";
|
|
6
6
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
7
|
-
import { nothing as
|
|
7
|
+
import { nothing as v, html as C } 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
9
|
import { property as n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
10
10
|
import { classMap as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
11
|
-
import { pickerItemStyles as
|
|
12
|
-
var y = Object.defineProperty, w = Object.getOwnPropertyDescriptor, r = (
|
|
13
|
-
for (var e = o > 1 ? void 0 : o ? w(
|
|
14
|
-
(p =
|
|
15
|
-
return o && e && y(
|
|
11
|
+
import { pickerItemStyles as f } from "./styles/common.styles.js";
|
|
12
|
+
var y = Object.defineProperty, w = Object.getOwnPropertyDescriptor, r = (s, i, a, o) => {
|
|
13
|
+
for (var e = o > 1 ? void 0 : o ? w(i, a) : i, l = s.length - 1, p; l >= 0; l--)
|
|
14
|
+
(p = s[l]) && (e = (o ? p(i, a, e) : p(e)) || e);
|
|
15
|
+
return o && e && y(i, a, e), e;
|
|
16
16
|
};
|
|
17
|
-
let t = class extends
|
|
17
|
+
let t = class extends g(h) {
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments), this.variant = "without-border", this.size = "medium", this.loading = !1, this.selected = !1;
|
|
20
20
|
}
|
|
21
21
|
get containerClasses() {
|
|
22
|
-
const
|
|
22
|
+
const s = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
23
23
|
return {
|
|
24
24
|
container: !0,
|
|
25
|
-
[
|
|
25
|
+
[s]: !!s,
|
|
26
26
|
selected: this.selected,
|
|
27
27
|
loading: this.loading
|
|
28
28
|
};
|
|
@@ -43,7 +43,7 @@ let t = class extends v(h) {
|
|
|
43
43
|
}
|
|
44
44
|
get loadingTemplate() {
|
|
45
45
|
return this.loading ? C`
|
|
46
|
-
<
|
|
46
|
+
<span class="overlay">
|
|
47
47
|
<svg class="spinner" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" fill="none">
|
|
48
48
|
<path
|
|
49
49
|
d="M38.3334 20.0001C38.3334 30.1253 30.1252 38.3334 20 38.3334C9.8748 38.3334 1.66669 30.1253 1.66669 20.0001C1.66669 9.87486 9.8748 1.66675 20 1.66675C30.1252 1.66675 38.3334 9.87486 38.3334 20.0001ZM7.97929 20.0001C7.97929 26.6389 13.3612 32.0208 20 32.0208C26.6389 32.0208 32.0207 26.6389 32.0207 20.0001C32.0207 13.3612 26.6389 7.97935 20 7.97935C13.3612 7.97935 7.97929 13.3612 7.97929 20.0001Z"
|
|
@@ -54,26 +54,26 @@ let t = class extends v(h) {
|
|
|
54
54
|
fill="#E1E6EA"
|
|
55
55
|
/>
|
|
56
56
|
</svg>
|
|
57
|
-
</
|
|
58
|
-
` :
|
|
57
|
+
</span>
|
|
58
|
+
` : v;
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
61
|
return C`
|
|
62
|
-
<
|
|
63
|
-
<
|
|
62
|
+
<button class=${m(this.containerClasses)} @click=${this.handleClick}>
|
|
63
|
+
<span class=${m(this.imageContainerClasses)}>
|
|
64
64
|
<slot></slot>
|
|
65
|
-
</
|
|
65
|
+
</span>
|
|
66
66
|
${this.loadingTemplate}
|
|
67
|
-
</
|
|
67
|
+
</button>
|
|
68
68
|
`;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
t.styles = [
|
|
71
|
+
t.styles = [f];
|
|
72
72
|
r([
|
|
73
73
|
n({ type: String })
|
|
74
74
|
], t.prototype, "variant", 2);
|
|
75
75
|
r([
|
|
76
|
-
n({ type: String, converter:
|
|
76
|
+
n({ type: String, converter: u })
|
|
77
77
|
], t.prototype, "size", 2);
|
|
78
78
|
r([
|
|
79
79
|
n({ type: Boolean, converter: c })
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.36", 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");
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.36"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.36"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -5,7 +5,7 @@ class s {
|
|
|
5
5
|
theme: t
|
|
6
6
|
}) => {
|
|
7
7
|
if (!t || !e) return;
|
|
8
|
-
const r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
8
|
+
const r = `https://ds-assets.cupra.com/2.0.0-canary.36/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
|
|
9
9
|
if (c) return c;
|
|
10
10
|
const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
|
|
11
11
|
return this.stylePromises.set(r, i), this.stylePromises.get(r);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-36"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-36"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|