@cupra/ui-kit 2.0.0-canary.66 → 2.0.0-canary.68
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-interactive-card/ds-interactive-card.cjs +5 -4
- package/dist/cjs/components/ds-loader-spinner/ds-loader-spinner.cjs +4 -4
- package/dist/cjs/components/ds-loader-spinner/styles/common.styles.cjs +0 -2
- 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-interactive-card/ds-interactive-card.js +49 -27
- package/dist/esm/components/ds-loader-spinner/ds-loader-spinner.js +28 -18
- package/dist/esm/components/ds-loader-spinner/styles/common.styles.js +0 -2
- 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/types/components/ds-interactive-card/ds-interactive-card.d.ts +4 -0
- package/dist/types/components/ds-interactive-card/ds-interactive-card.types.d.ts +1 -0
- package/dist/types/components/ds-loader-spinner/ds-loader-spinner.d.ts +5 -0
- package/dist/types/components/ds-loader-spinner/ds-loader-spinner.types.d.ts +2 -0
- package/dist-react/cjs/components/ds-interactive-card/ds-interactive-card.cjs +5 -4
- package/dist-react/cjs/components/ds-loader-spinner/ds-loader-spinner.cjs +4 -4
- package/dist-react/cjs/components/ds-loader-spinner/styles/common.styles.cjs +0 -2
- 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-interactive-card/ds-interactive-card.js +49 -27
- package/dist-react/esm/components/ds-loader-spinner/ds-loader-spinner.js +28 -18
- package/dist-react/esm/components/ds-loader-spinner/styles/common.styles.js +0 -2
- 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/dist-react/types/components/ds-interactive-card/ds-interactive-card.d.ts +4 -0
- package/dist-react/types/components/ds-interactive-card/ds-interactive-card.types.d.ts +1 -0
- package/dist-react/types/components/ds-loader-spinner/ds-loader-spinner.d.ts +5 -0
- package/dist-react/types/components/ds-loader-spinner/ds-loader-spinner.types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
<div part="container" class=${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),d=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const r=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"),m=require("./styles/common.styles.cjs");var v=Object.defineProperty,C=Object.getOwnPropertyDescriptor,o=(n,e,s,a)=>{for(var t=a>1?void 0:a?C(e,s):e,l=n.length-1,c;l>=0;l--)(c=n[l])&&(t=(a?c(e,s,t):c(t))||t);return a&&t&&v(e,s,t),t};exports.DsInteractiveCard=class extends h.UiKitElement{constructor(){super(...arguments),this.size="medium",this.selected=!1,this.error=!1,this.showClose=!1,this.handleClick=e=>{e.stopPropagation()},this.handleCloseButtonClick=e=>{e.stopPropagation();const s=new CustomEvent("interactive-card:close",{bubbles:!0,composed:!0});this.dispatchEvent(s)}}get classes(){return{container:!0,selected:this.selected,[this.size]:!!this.size,"has-close":this.showClose}}get errorClasses(){return{error:!0,selected:this.selected,[this.size]:!!this.size}}get iconTemplate(){return this.componentFactory.createIcon({class:"icon","icon-name":"cross-circle",size:24})}get closeButtonTemplate(){return this.showClose?this.componentFactory.createIconButton({class:"close-button","data-aria-label":"Close","@click":this.handleCloseButtonClick,"icon-name":"cross",variant:"naked",size:"medium"}):r.nothing}get contentTemplate(){return this.error?r.nothing:r.html`
|
|
2
|
+
<div part="container" class=${p.classMap(this.classes)} data-testid="ds-interactive-card-container" tabindex="0">
|
|
3
|
+
${this.closeButtonTemplate}
|
|
3
4
|
<header class="header" part="header">
|
|
4
5
|
<div class="header-main">
|
|
5
6
|
<slot name="title" class="title" part="title"></slot>
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
<footer @click=${this.handleClick} class="cta" part="cta"><slot name="cta"></slot></footer>
|
|
12
13
|
</div>
|
|
13
14
|
`}get errorTemplate(){return this.error?r.html`
|
|
14
|
-
<div part="error" class=${
|
|
15
|
+
<div part="error" class=${p.classMap(this.errorClasses)}>
|
|
15
16
|
${this.iconTemplate}
|
|
16
17
|
<div class="error-content" part="error-text">
|
|
17
18
|
<slot class="error-title" name="error-title"></slot>
|
|
@@ -21,4 +22,4 @@
|
|
|
21
22
|
`:r.nothing}render(){return r.html`
|
|
22
23
|
${this.contentTemplate}
|
|
23
24
|
${this.errorTemplate}
|
|
24
|
-
`}};exports.DsInteractiveCard.styles=[
|
|
25
|
+
`}};exports.DsInteractiveCard.styles=[m.commonStyles];o([i.property({type:String})],exports.DsInteractiveCard.prototype,"size",2);o([i.property({type:Boolean,converter:d.booleanConverter})],exports.DsInteractiveCard.prototype,"selected",2);o([i.property({type:Boolean,converter:d.booleanConverter})],exports.DsInteractiveCard.prototype,"error",2);o([i.property({type:Boolean,converter:d.booleanConverter,attribute:"show-close"})],exports.DsInteractiveCard.prototype,"showClose",2);exports.DsInteractiveCard=o([u.customUiKitElement("ds-interactive-card")],exports.DsInteractiveCard);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),
|
|
2
|
-
<div class=${
|
|
3
|
-
<svg class="spinner" viewBox="0 0 50 50">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),y=require("../../utils/booleanConverter.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 n=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),h=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),d=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.cjs"),m=require("./styles/common.styles.cjs");var S=Object.defineProperty,v=Object.getOwnPropertyDescriptor,r=(o,t,i,s)=>{for(var e=s>1?void 0:s?v(t,i):t,p=o.length-1,l;p>=0;p--)(l=o[p])&&(e=(s?l(t,i,e):l(e))||e);return s&&e&&S(t,i,e),e};exports.DsLoaderSpinner=class extends a.UiKitElement{constructor(){super(...arguments),this.show=!1,this.mode="light",this.orientation="row",this.size=24}get classes(){return{container:!0,[this.mode]:!!this.mode,[this.orientation]:!!this.orientation}}get spinnerStyles(){return{width:`${this.size}px`,height:`${this.size}px`}}render(){return this.show?c.html`
|
|
2
|
+
<div class=${h.classMap(this.classes)}>
|
|
3
|
+
<svg class="spinner" style=${d.styleMap(this.spinnerStyles)} viewBox="0 0 50 50">
|
|
4
4
|
<circle class="spinner-bg" cx="25" cy="25" r="20" />
|
|
5
5
|
<circle class="spinner-fg" cx="25" cy="25" r="20" />
|
|
6
6
|
</svg>
|
|
7
7
|
<slot name="text"></slot>
|
|
8
8
|
</div>
|
|
9
|
-
`:
|
|
9
|
+
`:c.nothing}};exports.DsLoaderSpinner.styles=m.commonStyles;r([n.property({type:Boolean,converter:y.booleanConverter})],exports.DsLoaderSpinner.prototype,"show",2);r([n.property({type:String,reflect:!0})],exports.DsLoaderSpinner.prototype,"mode",2);r([n.property({type:String})],exports.DsLoaderSpinner.prototype,"orientation",2);r([n.property({type:Number,reflect:!0})],exports.DsLoaderSpinner.prototype,"size",2);exports.DsLoaderSpinner=r([u.customUiKitElement("ds-loader-spinner")],exports.DsLoaderSpinner);
|
|
@@ -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.68",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.68"),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.68"),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"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.68/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}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 h=s.getInstance();exports.stylesRegistry=h;
|
|
@@ -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-68"),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-68"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
3
|
-
import { booleanConverter as
|
|
1
|
+
import { UiKitElement as u } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as v } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { booleanConverter as d } from "../../utils/booleanConverter.js";
|
|
4
4
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
-
import { nothing as
|
|
5
|
+
import { nothing as p, html as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
6
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
-
import { property as
|
|
8
|
-
import { classMap as
|
|
7
|
+
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as h } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
9
|
import { commonStyles as f } from "./styles/common.styles.js";
|
|
10
|
-
var
|
|
11
|
-
for (var t =
|
|
12
|
-
(
|
|
13
|
-
return
|
|
10
|
+
var C = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (r, s, l, a) => {
|
|
11
|
+
for (var t = a > 1 ? void 0 : a ? b(s, l) : s, n = r.length - 1, c; n >= 0; n--)
|
|
12
|
+
(c = r[n]) && (t = (a ? c(s, l, t) : c(t)) || t);
|
|
13
|
+
return a && t && C(s, l, t), t;
|
|
14
14
|
};
|
|
15
|
-
let e = class extends
|
|
15
|
+
let e = class extends u {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this.size = "medium", this.selected = !1, this.error = !1, this.handleClick = (r) => {
|
|
17
|
+
super(...arguments), this.size = "medium", this.selected = !1, this.error = !1, this.showClose = !1, this.handleClick = (r) => {
|
|
18
18
|
r.stopPropagation();
|
|
19
|
+
}, this.handleCloseButtonClick = (r) => {
|
|
20
|
+
r.stopPropagation();
|
|
21
|
+
const s = new CustomEvent("interactive-card:close", {
|
|
22
|
+
bubbles: !0,
|
|
23
|
+
composed: !0
|
|
24
|
+
});
|
|
25
|
+
this.dispatchEvent(s);
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
28
|
get classes() {
|
|
22
29
|
return {
|
|
23
30
|
container: !0,
|
|
24
31
|
selected: this.selected,
|
|
25
|
-
[this.size]: !!this.size
|
|
32
|
+
[this.size]: !!this.size,
|
|
33
|
+
"has-close": this.showClose
|
|
26
34
|
};
|
|
27
35
|
}
|
|
28
36
|
get errorClasses() {
|
|
@@ -39,9 +47,20 @@ let e = class extends v {
|
|
|
39
47
|
size: 24
|
|
40
48
|
});
|
|
41
49
|
}
|
|
50
|
+
get closeButtonTemplate() {
|
|
51
|
+
return this.showClose ? this.componentFactory.createIconButton({
|
|
52
|
+
class: "close-button",
|
|
53
|
+
"data-aria-label": "Close",
|
|
54
|
+
"@click": this.handleCloseButtonClick,
|
|
55
|
+
"icon-name": "cross",
|
|
56
|
+
variant: "naked",
|
|
57
|
+
size: "medium"
|
|
58
|
+
}) : p;
|
|
59
|
+
}
|
|
42
60
|
get contentTemplate() {
|
|
43
|
-
return this.error ?
|
|
44
|
-
<div part="container" class=${
|
|
61
|
+
return this.error ? p : m`
|
|
62
|
+
<div part="container" class=${h(this.classes)} data-testid="ds-interactive-card-container" tabindex="0">
|
|
63
|
+
${this.closeButtonTemplate}
|
|
45
64
|
<header class="header" part="header">
|
|
46
65
|
<div class="header-main">
|
|
47
66
|
<slot name="title" class="title" part="title"></slot>
|
|
@@ -55,35 +74,38 @@ let e = class extends v {
|
|
|
55
74
|
`;
|
|
56
75
|
}
|
|
57
76
|
get errorTemplate() {
|
|
58
|
-
return this.error ?
|
|
59
|
-
<div part="error" class=${
|
|
77
|
+
return this.error ? m`
|
|
78
|
+
<div part="error" class=${h(this.errorClasses)}>
|
|
60
79
|
${this.iconTemplate}
|
|
61
80
|
<div class="error-content" part="error-text">
|
|
62
81
|
<slot class="error-title" name="error-title"></slot>
|
|
63
82
|
<slot class="error-text" name="error-text" data-testid="ds-interactive-card-error-text"></slot>
|
|
64
83
|
</div>
|
|
65
84
|
</div>
|
|
66
|
-
` :
|
|
85
|
+
` : p;
|
|
67
86
|
}
|
|
68
87
|
render() {
|
|
69
|
-
return
|
|
88
|
+
return m`
|
|
70
89
|
${this.contentTemplate}
|
|
71
90
|
${this.errorTemplate}
|
|
72
91
|
`;
|
|
73
92
|
}
|
|
74
93
|
};
|
|
75
94
|
e.styles = [f];
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
o([
|
|
96
|
+
i({ type: String })
|
|
78
97
|
], e.prototype, "size", 2);
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
o([
|
|
99
|
+
i({ type: Boolean, converter: d })
|
|
81
100
|
], e.prototype, "selected", 2);
|
|
82
|
-
|
|
83
|
-
|
|
101
|
+
o([
|
|
102
|
+
i({ type: Boolean, converter: d })
|
|
84
103
|
], e.prototype, "error", 2);
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
o([
|
|
105
|
+
i({ type: Boolean, converter: d, attribute: "show-close" })
|
|
106
|
+
], e.prototype, "showClose", 2);
|
|
107
|
+
e = o([
|
|
108
|
+
v("ds-interactive-card")
|
|
87
109
|
], e);
|
|
88
110
|
export {
|
|
89
111
|
e as DsInteractiveCard
|
|
@@ -2,19 +2,20 @@ import { UiKitElement as a } from "../base/UiKitElement.js";
|
|
|
2
2
|
import { customUiKitElement as c } from "../../decorators/customUiKitElement.js";
|
|
3
3
|
import { booleanConverter as h } from "../../utils/booleanConverter.js";
|
|
4
4
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
-
import { nothing as f, html as
|
|
5
|
+
import { nothing as f, html as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
6
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
-
import { property as
|
|
8
|
-
import { classMap as
|
|
7
|
+
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { styleMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.js";
|
|
9
10
|
import { commonStyles as g } from "./styles/common.styles.js";
|
|
10
|
-
var
|
|
11
|
-
for (var t = o > 1 ? void 0 : o ?
|
|
12
|
-
(
|
|
13
|
-
return o && t &&
|
|
11
|
+
var d = Object.defineProperty, x = Object.getOwnPropertyDescriptor, r = (m, s, n, o) => {
|
|
12
|
+
for (var t = o > 1 ? void 0 : o ? x(s, n) : s, p = m.length - 1, l; p >= 0; p--)
|
|
13
|
+
(l = m[p]) && (t = (o ? l(s, n, t) : l(t)) || t);
|
|
14
|
+
return o && t && d(s, n, t), t;
|
|
14
15
|
};
|
|
15
16
|
let e = class extends a {
|
|
16
17
|
constructor() {
|
|
17
|
-
super(...arguments), this.show = !1, this.mode = "light", this.orientation = "row";
|
|
18
|
+
super(...arguments), this.show = !1, this.mode = "light", this.orientation = "row", this.size = 24;
|
|
18
19
|
}
|
|
19
20
|
get classes() {
|
|
20
21
|
return {
|
|
@@ -23,10 +24,16 @@ let e = class extends a {
|
|
|
23
24
|
[this.orientation]: !!this.orientation
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
get spinnerStyles() {
|
|
28
|
+
return {
|
|
29
|
+
width: `${this.size}px`,
|
|
30
|
+
height: `${this.size}px`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
26
33
|
render() {
|
|
27
|
-
return this.show ?
|
|
28
|
-
<div class=${
|
|
29
|
-
<svg class="spinner" viewBox="0 0 50 50">
|
|
34
|
+
return this.show ? y`
|
|
35
|
+
<div class=${u(this.classes)}>
|
|
36
|
+
<svg class="spinner" style=${v(this.spinnerStyles)} viewBox="0 0 50 50">
|
|
30
37
|
<circle class="spinner-bg" cx="25" cy="25" r="20" />
|
|
31
38
|
<circle class="spinner-fg" cx="25" cy="25" r="20" />
|
|
32
39
|
</svg>
|
|
@@ -36,16 +43,19 @@ let e = class extends a {
|
|
|
36
43
|
}
|
|
37
44
|
};
|
|
38
45
|
e.styles = g;
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
r([
|
|
47
|
+
i({ type: Boolean, converter: h })
|
|
41
48
|
], e.prototype, "show", 2);
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
r([
|
|
50
|
+
i({ type: String, reflect: !0 })
|
|
44
51
|
], e.prototype, "mode", 2);
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
r([
|
|
53
|
+
i({ type: String })
|
|
47
54
|
], e.prototype, "orientation", 2);
|
|
48
|
-
|
|
55
|
+
r([
|
|
56
|
+
i({ type: Number, reflect: !0 })
|
|
57
|
+
], e.prototype, "size", 2);
|
|
58
|
+
e = r([
|
|
49
59
|
c("ds-loader-spinner")
|
|
50
60
|
], e);
|
|
51
61
|
export {
|
|
@@ -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.68", 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.68"), 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.68"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -7,7 +7,7 @@ class s {
|
|
|
7
7
|
theme: t
|
|
8
8
|
}) => {
|
|
9
9
|
if (!t || !e) return;
|
|
10
|
-
const c = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
10
|
+
const c = `https://ds-assets.cupra.com/2.0.0-canary.68/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
|
|
11
11
|
if (r) return r;
|
|
12
12
|
const i = h(() => this.fetchStyle({ url: c })).then((n) => (n || this.stylePromises.delete(c), n));
|
|
13
13
|
return this.stylePromises.set(c, i), this.stylePromises.get(c);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-68"), 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-68"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -5,10 +5,12 @@ export declare class DsInteractiveCard extends UiKitElement {
|
|
|
5
5
|
size: DsInteractiveCardAttrs['size'];
|
|
6
6
|
selected: DsInteractiveCardAttrs['selected'];
|
|
7
7
|
error: DsInteractiveCardAttrs['error'];
|
|
8
|
+
showClose: DsInteractiveCardAttrs['show-close'];
|
|
8
9
|
protected get classes(): {
|
|
9
10
|
[x: string]: boolean;
|
|
10
11
|
container: boolean;
|
|
11
12
|
selected: boolean;
|
|
13
|
+
'has-close': boolean;
|
|
12
14
|
};
|
|
13
15
|
protected get errorClasses(): {
|
|
14
16
|
[x: string]: boolean;
|
|
@@ -16,7 +18,9 @@ export declare class DsInteractiveCard extends UiKitElement {
|
|
|
16
18
|
selected: boolean;
|
|
17
19
|
};
|
|
18
20
|
protected get iconTemplate(): any;
|
|
21
|
+
protected get closeButtonTemplate(): any;
|
|
19
22
|
private handleClick;
|
|
23
|
+
private handleCloseButtonClick;
|
|
20
24
|
private get contentTemplate();
|
|
21
25
|
private get errorTemplate();
|
|
22
26
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -6,9 +6,14 @@ export declare class DsLoaderSpinner extends UiKitElement {
|
|
|
6
6
|
show: DsLoaderSpinnerAttrs['show'];
|
|
7
7
|
mode: DsLoaderSpinnerAttrs['mode'];
|
|
8
8
|
orientation: DsLoaderSpinnerAttrs['orientation'];
|
|
9
|
+
size: DsLoaderSpinnerAttrs['size'];
|
|
9
10
|
protected get classes(): {
|
|
10
11
|
[x: string]: boolean;
|
|
11
12
|
container: boolean;
|
|
12
13
|
};
|
|
14
|
+
protected get spinnerStyles(): {
|
|
15
|
+
width: string;
|
|
16
|
+
height: string;
|
|
17
|
+
};
|
|
13
18
|
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
14
19
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CommonAttrs } from '../../types/types';
|
|
2
|
+
export type LoaderSpinnerSize = 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 96 | 128 | 192;
|
|
2
3
|
export interface DsLoaderSpinnerAttrs extends CommonAttrs {
|
|
3
4
|
show?: boolean;
|
|
4
5
|
mode?: 'dark' | 'light';
|
|
5
6
|
orientation?: 'row' | 'column';
|
|
7
|
+
size?: LoaderSpinnerSize;
|
|
6
8
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
<div part="container" class=${
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),d=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const r=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"),m=require("./styles/common.styles.cjs");var v=Object.defineProperty,C=Object.getOwnPropertyDescriptor,o=(n,e,s,a)=>{for(var t=a>1?void 0:a?C(e,s):e,l=n.length-1,c;l>=0;l--)(c=n[l])&&(t=(a?c(e,s,t):c(t))||t);return a&&t&&v(e,s,t),t};exports.DsInteractiveCard=class extends h.UiKitElement{constructor(){super(...arguments),this.size="medium",this.selected=!1,this.error=!1,this.showClose=!1,this.handleClick=e=>{e.stopPropagation()},this.handleCloseButtonClick=e=>{e.stopPropagation();const s=new CustomEvent("interactive-card:close",{bubbles:!0,composed:!0});this.dispatchEvent(s)}}get classes(){return{container:!0,selected:this.selected,[this.size]:!!this.size,"has-close":this.showClose}}get errorClasses(){return{error:!0,selected:this.selected,[this.size]:!!this.size}}get iconTemplate(){return this.componentFactory.createIcon({class:"icon","icon-name":"cross-circle",size:24})}get closeButtonTemplate(){return this.showClose?this.componentFactory.createIconButton({class:"close-button","data-aria-label":"Close","@click":this.handleCloseButtonClick,"icon-name":"cross",variant:"naked",size:"medium"}):r.nothing}get contentTemplate(){return this.error?r.nothing:r.html`
|
|
2
|
+
<div part="container" class=${p.classMap(this.classes)} data-testid="ds-interactive-card-container" tabindex="0">
|
|
3
|
+
${this.closeButtonTemplate}
|
|
3
4
|
<header class="header" part="header">
|
|
4
5
|
<div class="header-main">
|
|
5
6
|
<slot name="title" class="title" part="title"></slot>
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
<footer @click=${this.handleClick} class="cta" part="cta"><slot name="cta"></slot></footer>
|
|
12
13
|
</div>
|
|
13
14
|
`}get errorTemplate(){return this.error?r.html`
|
|
14
|
-
<div part="error" class=${
|
|
15
|
+
<div part="error" class=${p.classMap(this.errorClasses)}>
|
|
15
16
|
${this.iconTemplate}
|
|
16
17
|
<div class="error-content" part="error-text">
|
|
17
18
|
<slot class="error-title" name="error-title"></slot>
|
|
@@ -21,4 +22,4 @@
|
|
|
21
22
|
`:r.nothing}render(){return r.html`
|
|
22
23
|
${this.contentTemplate}
|
|
23
24
|
${this.errorTemplate}
|
|
24
|
-
`}};exports.DsInteractiveCard.styles=[
|
|
25
|
+
`}};exports.DsInteractiveCard.styles=[m.commonStyles];o([i.property({type:String})],exports.DsInteractiveCard.prototype,"size",2);o([i.property({type:Boolean,converter:d.booleanConverter})],exports.DsInteractiveCard.prototype,"selected",2);o([i.property({type:Boolean,converter:d.booleanConverter})],exports.DsInteractiveCard.prototype,"error",2);o([i.property({type:Boolean,converter:d.booleanConverter,attribute:"show-close"})],exports.DsInteractiveCard.prototype,"showClose",2);exports.DsInteractiveCard=o([u.customUiKitElement("ds-interactive-card")],exports.DsInteractiveCard);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),
|
|
2
|
-
<div class=${
|
|
3
|
-
<svg class="spinner" viewBox="0 0 50 50">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),y=require("../../utils/booleanConverter.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 n=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),h=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),d=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.cjs"),m=require("./styles/common.styles.cjs");var S=Object.defineProperty,v=Object.getOwnPropertyDescriptor,r=(o,t,i,s)=>{for(var e=s>1?void 0:s?v(t,i):t,p=o.length-1,l;p>=0;p--)(l=o[p])&&(e=(s?l(t,i,e):l(e))||e);return s&&e&&S(t,i,e),e};exports.DsLoaderSpinner=class extends a.UiKitElement{constructor(){super(...arguments),this.show=!1,this.mode="light",this.orientation="row",this.size=24}get classes(){return{container:!0,[this.mode]:!!this.mode,[this.orientation]:!!this.orientation}}get spinnerStyles(){return{width:`${this.size}px`,height:`${this.size}px`}}render(){return this.show?c.html`
|
|
2
|
+
<div class=${h.classMap(this.classes)}>
|
|
3
|
+
<svg class="spinner" style=${d.styleMap(this.spinnerStyles)} viewBox="0 0 50 50">
|
|
4
4
|
<circle class="spinner-bg" cx="25" cy="25" r="20" />
|
|
5
5
|
<circle class="spinner-fg" cx="25" cy="25" r="20" />
|
|
6
6
|
</svg>
|
|
7
7
|
<slot name="text"></slot>
|
|
8
8
|
</div>
|
|
9
|
-
`:
|
|
9
|
+
`:c.nothing}};exports.DsLoaderSpinner.styles=m.commonStyles;r([n.property({type:Boolean,converter:y.booleanConverter})],exports.DsLoaderSpinner.prototype,"show",2);r([n.property({type:String,reflect:!0})],exports.DsLoaderSpinner.prototype,"mode",2);r([n.property({type:String})],exports.DsLoaderSpinner.prototype,"orientation",2);r([n.property({type:Number,reflect:!0})],exports.DsLoaderSpinner.prototype,"size",2);exports.DsLoaderSpinner=r([u.customUiKitElement("ds-loader-spinner")],exports.DsLoaderSpinner);
|
|
@@ -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.68",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.68"),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.68"),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"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.68/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}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 h=s.getInstance();exports.stylesRegistry=h;
|
|
@@ -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-68"),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-68"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
3
|
-
import { booleanConverter as
|
|
1
|
+
import { UiKitElement as u } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as v } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { booleanConverter as d } from "../../utils/booleanConverter.js";
|
|
4
4
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
-
import { nothing as
|
|
5
|
+
import { nothing as p, html as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
6
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
-
import { property as
|
|
8
|
-
import { classMap as
|
|
7
|
+
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as h } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
9
|
import { commonStyles as f } from "./styles/common.styles.js";
|
|
10
|
-
var
|
|
11
|
-
for (var t =
|
|
12
|
-
(
|
|
13
|
-
return
|
|
10
|
+
var C = Object.defineProperty, b = Object.getOwnPropertyDescriptor, o = (r, s, l, a) => {
|
|
11
|
+
for (var t = a > 1 ? void 0 : a ? b(s, l) : s, n = r.length - 1, c; n >= 0; n--)
|
|
12
|
+
(c = r[n]) && (t = (a ? c(s, l, t) : c(t)) || t);
|
|
13
|
+
return a && t && C(s, l, t), t;
|
|
14
14
|
};
|
|
15
|
-
let e = class extends
|
|
15
|
+
let e = class extends u {
|
|
16
16
|
constructor() {
|
|
17
|
-
super(...arguments), this.size = "medium", this.selected = !1, this.error = !1, this.handleClick = (r) => {
|
|
17
|
+
super(...arguments), this.size = "medium", this.selected = !1, this.error = !1, this.showClose = !1, this.handleClick = (r) => {
|
|
18
18
|
r.stopPropagation();
|
|
19
|
+
}, this.handleCloseButtonClick = (r) => {
|
|
20
|
+
r.stopPropagation();
|
|
21
|
+
const s = new CustomEvent("interactive-card:close", {
|
|
22
|
+
bubbles: !0,
|
|
23
|
+
composed: !0
|
|
24
|
+
});
|
|
25
|
+
this.dispatchEvent(s);
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
28
|
get classes() {
|
|
22
29
|
return {
|
|
23
30
|
container: !0,
|
|
24
31
|
selected: this.selected,
|
|
25
|
-
[this.size]: !!this.size
|
|
32
|
+
[this.size]: !!this.size,
|
|
33
|
+
"has-close": this.showClose
|
|
26
34
|
};
|
|
27
35
|
}
|
|
28
36
|
get errorClasses() {
|
|
@@ -39,9 +47,20 @@ let e = class extends v {
|
|
|
39
47
|
size: 24
|
|
40
48
|
});
|
|
41
49
|
}
|
|
50
|
+
get closeButtonTemplate() {
|
|
51
|
+
return this.showClose ? this.componentFactory.createIconButton({
|
|
52
|
+
class: "close-button",
|
|
53
|
+
"data-aria-label": "Close",
|
|
54
|
+
"@click": this.handleCloseButtonClick,
|
|
55
|
+
"icon-name": "cross",
|
|
56
|
+
variant: "naked",
|
|
57
|
+
size: "medium"
|
|
58
|
+
}) : p;
|
|
59
|
+
}
|
|
42
60
|
get contentTemplate() {
|
|
43
|
-
return this.error ?
|
|
44
|
-
<div part="container" class=${
|
|
61
|
+
return this.error ? p : m`
|
|
62
|
+
<div part="container" class=${h(this.classes)} data-testid="ds-interactive-card-container" tabindex="0">
|
|
63
|
+
${this.closeButtonTemplate}
|
|
45
64
|
<header class="header" part="header">
|
|
46
65
|
<div class="header-main">
|
|
47
66
|
<slot name="title" class="title" part="title"></slot>
|
|
@@ -55,35 +74,38 @@ let e = class extends v {
|
|
|
55
74
|
`;
|
|
56
75
|
}
|
|
57
76
|
get errorTemplate() {
|
|
58
|
-
return this.error ?
|
|
59
|
-
<div part="error" class=${
|
|
77
|
+
return this.error ? m`
|
|
78
|
+
<div part="error" class=${h(this.errorClasses)}>
|
|
60
79
|
${this.iconTemplate}
|
|
61
80
|
<div class="error-content" part="error-text">
|
|
62
81
|
<slot class="error-title" name="error-title"></slot>
|
|
63
82
|
<slot class="error-text" name="error-text" data-testid="ds-interactive-card-error-text"></slot>
|
|
64
83
|
</div>
|
|
65
84
|
</div>
|
|
66
|
-
` :
|
|
85
|
+
` : p;
|
|
67
86
|
}
|
|
68
87
|
render() {
|
|
69
|
-
return
|
|
88
|
+
return m`
|
|
70
89
|
${this.contentTemplate}
|
|
71
90
|
${this.errorTemplate}
|
|
72
91
|
`;
|
|
73
92
|
}
|
|
74
93
|
};
|
|
75
94
|
e.styles = [f];
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
o([
|
|
96
|
+
i({ type: String })
|
|
78
97
|
], e.prototype, "size", 2);
|
|
79
|
-
|
|
80
|
-
|
|
98
|
+
o([
|
|
99
|
+
i({ type: Boolean, converter: d })
|
|
81
100
|
], e.prototype, "selected", 2);
|
|
82
|
-
|
|
83
|
-
|
|
101
|
+
o([
|
|
102
|
+
i({ type: Boolean, converter: d })
|
|
84
103
|
], e.prototype, "error", 2);
|
|
85
|
-
|
|
86
|
-
|
|
104
|
+
o([
|
|
105
|
+
i({ type: Boolean, converter: d, attribute: "show-close" })
|
|
106
|
+
], e.prototype, "showClose", 2);
|
|
107
|
+
e = o([
|
|
108
|
+
v("ds-interactive-card")
|
|
87
109
|
], e);
|
|
88
110
|
export {
|
|
89
111
|
e as DsInteractiveCard
|
|
@@ -2,19 +2,20 @@ import { UiKitElement as a } from "../base/UiKitElement.js";
|
|
|
2
2
|
import { customUiKitElement as c } from "../../decorators/customUiKitElement.js";
|
|
3
3
|
import { booleanConverter as h } from "../../utils/booleanConverter.js";
|
|
4
4
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
5
|
-
import { nothing as f, html as
|
|
5
|
+
import { nothing as f, html as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
6
6
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
7
|
-
import { property as
|
|
8
|
-
import { classMap as
|
|
7
|
+
import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
8
|
+
import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
|
+
import { styleMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.js";
|
|
9
10
|
import { commonStyles as g } from "./styles/common.styles.js";
|
|
10
|
-
var
|
|
11
|
-
for (var t = o > 1 ? void 0 : o ?
|
|
12
|
-
(
|
|
13
|
-
return o && t &&
|
|
11
|
+
var d = Object.defineProperty, x = Object.getOwnPropertyDescriptor, r = (m, s, n, o) => {
|
|
12
|
+
for (var t = o > 1 ? void 0 : o ? x(s, n) : s, p = m.length - 1, l; p >= 0; p--)
|
|
13
|
+
(l = m[p]) && (t = (o ? l(s, n, t) : l(t)) || t);
|
|
14
|
+
return o && t && d(s, n, t), t;
|
|
14
15
|
};
|
|
15
16
|
let e = class extends a {
|
|
16
17
|
constructor() {
|
|
17
|
-
super(...arguments), this.show = !1, this.mode = "light", this.orientation = "row";
|
|
18
|
+
super(...arguments), this.show = !1, this.mode = "light", this.orientation = "row", this.size = 24;
|
|
18
19
|
}
|
|
19
20
|
get classes() {
|
|
20
21
|
return {
|
|
@@ -23,10 +24,16 @@ let e = class extends a {
|
|
|
23
24
|
[this.orientation]: !!this.orientation
|
|
24
25
|
};
|
|
25
26
|
}
|
|
27
|
+
get spinnerStyles() {
|
|
28
|
+
return {
|
|
29
|
+
width: `${this.size}px`,
|
|
30
|
+
height: `${this.size}px`
|
|
31
|
+
};
|
|
32
|
+
}
|
|
26
33
|
render() {
|
|
27
|
-
return this.show ?
|
|
28
|
-
<div class=${
|
|
29
|
-
<svg class="spinner" viewBox="0 0 50 50">
|
|
34
|
+
return this.show ? y`
|
|
35
|
+
<div class=${u(this.classes)}>
|
|
36
|
+
<svg class="spinner" style=${v(this.spinnerStyles)} viewBox="0 0 50 50">
|
|
30
37
|
<circle class="spinner-bg" cx="25" cy="25" r="20" />
|
|
31
38
|
<circle class="spinner-fg" cx="25" cy="25" r="20" />
|
|
32
39
|
</svg>
|
|
@@ -36,16 +43,19 @@ let e = class extends a {
|
|
|
36
43
|
}
|
|
37
44
|
};
|
|
38
45
|
e.styles = g;
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
r([
|
|
47
|
+
i({ type: Boolean, converter: h })
|
|
41
48
|
], e.prototype, "show", 2);
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
r([
|
|
50
|
+
i({ type: String, reflect: !0 })
|
|
44
51
|
], e.prototype, "mode", 2);
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
r([
|
|
53
|
+
i({ type: String })
|
|
47
54
|
], e.prototype, "orientation", 2);
|
|
48
|
-
|
|
55
|
+
r([
|
|
56
|
+
i({ type: Number, reflect: !0 })
|
|
57
|
+
], e.prototype, "size", 2);
|
|
58
|
+
e = r([
|
|
49
59
|
c("ds-loader-spinner")
|
|
50
60
|
], e);
|
|
51
61
|
export {
|
|
@@ -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.68", 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.68"), 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.68"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -7,7 +7,7 @@ class s {
|
|
|
7
7
|
theme: t
|
|
8
8
|
}) => {
|
|
9
9
|
if (!t || !e) return;
|
|
10
|
-
const c = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
10
|
+
const c = `https://ds-assets.cupra.com/2.0.0-canary.68/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
|
|
11
11
|
if (r) return r;
|
|
12
12
|
const i = h(() => this.fetchStyle({ url: c })).then((n) => (n || this.stylePromises.delete(c), n));
|
|
13
13
|
return this.stylePromises.set(c, i), this.stylePromises.get(c);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-68"), 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-68"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -5,10 +5,12 @@ export declare class DsInteractiveCard extends UiKitElement {
|
|
|
5
5
|
size: DsInteractiveCardAttrs['size'];
|
|
6
6
|
selected: DsInteractiveCardAttrs['selected'];
|
|
7
7
|
error: DsInteractiveCardAttrs['error'];
|
|
8
|
+
showClose: DsInteractiveCardAttrs['show-close'];
|
|
8
9
|
protected get classes(): {
|
|
9
10
|
[x: string]: boolean;
|
|
10
11
|
container: boolean;
|
|
11
12
|
selected: boolean;
|
|
13
|
+
'has-close': boolean;
|
|
12
14
|
};
|
|
13
15
|
protected get errorClasses(): {
|
|
14
16
|
[x: string]: boolean;
|
|
@@ -16,7 +18,9 @@ export declare class DsInteractiveCard extends UiKitElement {
|
|
|
16
18
|
selected: boolean;
|
|
17
19
|
};
|
|
18
20
|
protected get iconTemplate(): any;
|
|
21
|
+
protected get closeButtonTemplate(): any;
|
|
19
22
|
private handleClick;
|
|
23
|
+
private handleCloseButtonClick;
|
|
20
24
|
private get contentTemplate();
|
|
21
25
|
private get errorTemplate();
|
|
22
26
|
render(): import("lit").TemplateResult<1>;
|
|
@@ -6,9 +6,14 @@ export declare class DsLoaderSpinner extends UiKitElement {
|
|
|
6
6
|
show: DsLoaderSpinnerAttrs['show'];
|
|
7
7
|
mode: DsLoaderSpinnerAttrs['mode'];
|
|
8
8
|
orientation: DsLoaderSpinnerAttrs['orientation'];
|
|
9
|
+
size: DsLoaderSpinnerAttrs['size'];
|
|
9
10
|
protected get classes(): {
|
|
10
11
|
[x: string]: boolean;
|
|
11
12
|
container: boolean;
|
|
12
13
|
};
|
|
14
|
+
protected get spinnerStyles(): {
|
|
15
|
+
width: string;
|
|
16
|
+
height: string;
|
|
17
|
+
};
|
|
13
18
|
render(): typeof nothing | import("lit").TemplateResult<1>;
|
|
14
19
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { CommonAttrs } from '../../types/types';
|
|
2
|
+
export type LoaderSpinnerSize = 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 96 | 128 | 192;
|
|
2
3
|
export interface DsLoaderSpinnerAttrs extends CommonAttrs {
|
|
3
4
|
show?: boolean;
|
|
4
5
|
mode?: 'dark' | 'light';
|
|
5
6
|
orientation?: 'row' | 'column';
|
|
7
|
+
size?: LoaderSpinnerSize;
|
|
6
8
|
}
|