@cupra/ui-kit 2.0.0-canary.93 → 2.0.0-canary.94
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-inline-alert/ds-inline-alert.cjs +5 -5
- 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-inline-alert/ds-inline-alert.js +32 -19
- 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-inline-alert/ds-inline-alert.d.ts +5 -1
- package/dist/types/components/ds-inline-alert/ds-inline-alert.types.d.ts +1 -0
- package/dist-react/cjs/components/ds-inline-alert/ds-inline-alert.cjs +5 -5
- 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-inline-alert/ds-inline-alert.js +32 -19
- 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-inline-alert/ds-inline-alert.d.ts +5 -1
- package/dist-react/types/components/ds-inline-alert/ds-inline-alert.types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const
|
|
2
|
-
<div class=${
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../utils/booleanConverter.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.cjs`),l=require(`./styles/common.styles.cjs`);var u=class extends i.UiKitElement{constructor(...e){super(...e),this.status=`default`,this.title=``,this.text=``,this.showClose=!0,this._show=void 0,this._showState=!0}static{this.styles=[l.inlineAlertStyles]}get show(){return this._show??this._showState}set show(e){this._show=e}getIconName(){switch(this.status){case`success`:return`check-mark-circle`;case`error`:return`cross-circle`;case`warning`:return`exclamation-mark-circle`;case`info`:return`info-circle`;default:return`chat-bubble`}}handleClickCloseButton(){let e=new CustomEvent(`inline-alert:close`,{bubbles:!0,composed:!0});this.dispatchEvent(e),this._showState=!1}get inlineAlertClasses(){return{container:!0,[this.status||`default`]:!0,show:this.show}}get iconTemplate(){return this.componentFactory.createIcon({class:`icon`,"icon-name":this.getIconName(),size:24})}get closeButtonTemplate(){return this.showClose?this.componentFactory.createIconButton({"data-aria-label":`close-button`,"@click":this.handleClickCloseButton,"icon-name":`cross`,variant:`naked`,size:`medium`}):e.E}render(){return this.show?e.x`
|
|
2
|
+
<div class=${s.e(this.inlineAlertClasses)} part="container">
|
|
3
3
|
${this.iconTemplate}
|
|
4
4
|
<div class="content">
|
|
5
5
|
<div class="header">
|
|
6
|
-
${
|
|
7
|
-
${
|
|
6
|
+
${c.n(this.title,()=>e.x`<div class="title">${this.title}</div>`)}
|
|
7
|
+
${c.n(this.text,()=>e.x`<div class="message">${this.text}</div>`)}
|
|
8
8
|
</div>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</div>
|
|
11
11
|
${this.closeButtonTemplate}
|
|
12
12
|
</div>
|
|
13
|
-
`:e.E}};
|
|
13
|
+
`:e.E}};r.__decorate([t.n({type:String})],u.prototype,`status`,void 0),r.__decorate([t.n({type:String})],u.prototype,`title`,void 0),r.__decorate([t.n({type:String})],u.prototype,`text`,void 0),r.__decorate([t.n({attribute:`show-close`,type:Boolean,converter:o.booleanConverter,reflect:!0})],u.prototype,`showClose`,void 0),r.__decorate([t.n({type:Boolean,attribute:`show`,converter:o.booleanConverter})],u.prototype,`_show`,void 0),r.__decorate([n.r()],u.prototype,`_showState`,void 0),u=r.__decorate([a.customUiKitElement(`ds-inline-alert`)],u),Object.defineProperty(exports,`DsInlineAlert`,{enumerable:!0,get:function(){return u}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const e=require(`../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs`),t=require(`./themeContext.cjs`),n=require(`../../core/theme.constants.cjs`),r=require(`../../utils/PubSub.cjs`),i=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`),a=require(`../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const o=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),s=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const c=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),l=require(`../../decorators/customUiKitElement.cjs`),u=require(`../../utils/booleanConverter.cjs`),d=require(`../../styles/source/shared/fonts-config.cjs`);var f=class extends a.i{constructor(...e){super(...e),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has(`theme`)&&(r.pubSub.publish(`theme`,this.theme),sessionStorage?.setItem(n.THEME_STORAGE_KEY,this.theme),typeof FontFace<`u`&&document?.fonts&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent(`ui-kit:ready`,{bubbles:!0,composed:!0}))}))}loadThemeFonts(){d.fontsConfig[this.theme]?.fonts.forEach(e=>{this.loadThemeFont(e)})}async loadThemeFont({weight:e,name:t,file:n}){if(!this.loadFonts)return Promise.resolve();let r=`${t}-${e}`;if(this.loadedFonts.has(r))return;let i=new FontFace(t,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.94`,r=`https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${r}"]`))e();else{let i=`ui-kit-theme-${n}`,a=document.getElementById(i),o=document.createElement(`link`);o.id=i,o.rel=`stylesheet`,o.href=r,o.onload=()=>e(),o.onerror=()=>t(Error(`Failed to load theme CSS: ${r}`)),document.head.appendChild(o),a?.remove()}}):Promise.resolve()}render(){return this.cssLoaded?i.x`<slot></slot>`:i.E}};c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-fonts`})],f.prototype,`loadFonts`,void 0),c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-styles`})],f.prototype,`loadStyles`,void 0),c.__decorate([e.e({context:t.themeContext}),o.n({type:String})],f.prototype,`theme`,void 0),c.__decorate([s.r()],f.prototype,`cssLoaded`,void 0),c.__decorate([s.r()],f.prototype,`loadedFonts`,void 0),f=c.__decorate([l.customUiKitElement(`ds-theme-provider`)],f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.94`),i=globalThis,a=i[r];a||(a=new n,Object.defineProperty(i,r,{value:a,writable:!1,configurable:!1,enumerable:!1}));var o=a;exports.iconsManager=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.94`),n=globalThis,r=n[t];r||(r=new e,Object.defineProperty(n,t,{value:r,writable:!1,configurable:!1,enumerable:!1}));var i=r;exports.pubSub=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.94/styles/${n}/components/${t}.css`,i=this.getCachedStyleSheetPromise({url:r});if(i)return i;let a=e(()=>this.fetchStyle({url:r})).then(e=>(e||this.stylePromises.delete(r),e));return this.stylePromises.set(r,a),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>`u`)return;let 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 t.instance||=new t,t.instance}}.getInstance();exports.stylesRegistry=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-94`))}`}exports.cssWithTokens=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-94`))}`}exports.htmlWithTokens=n;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { E as e, x as t } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
2
2
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
import { n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
4
|
+
import { r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
4
5
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
|
|
5
|
-
import { __decorate as
|
|
6
|
-
import { UiKitElement as
|
|
7
|
-
import { customUiKitElement as
|
|
8
|
-
import {
|
|
6
|
+
import { __decorate as i } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
7
|
+
import { UiKitElement as a } from "../base/UiKitElement.js";
|
|
8
|
+
import { customUiKitElement as o } from "../../decorators/customUiKitElement.js";
|
|
9
|
+
import { booleanConverter as s } from "../../utils/booleanConverter.js";
|
|
10
|
+
import { e as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
11
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
10
|
-
import { n as
|
|
11
|
-
import { inlineAlertStyles as
|
|
12
|
+
import { n as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
|
|
13
|
+
import { inlineAlertStyles as u } from "./styles/common.styles.js";
|
|
12
14
|
//#region src/components/ds-inline-alert/ds-inline-alert.ts
|
|
13
|
-
var
|
|
15
|
+
var d = class extends a {
|
|
14
16
|
constructor(...e) {
|
|
15
|
-
super(...e), this.status = "default", this.title = "", this.text = "", this.
|
|
17
|
+
super(...e), this.status = "default", this.title = "", this.text = "", this.showClose = !0, this._show = void 0, this._showState = !0;
|
|
16
18
|
}
|
|
17
19
|
static {
|
|
18
|
-
this.styles = [
|
|
20
|
+
this.styles = [u];
|
|
21
|
+
}
|
|
22
|
+
get show() {
|
|
23
|
+
return this._show ?? this._showState;
|
|
24
|
+
}
|
|
25
|
+
set show(e) {
|
|
26
|
+
this._show = e;
|
|
19
27
|
}
|
|
20
28
|
getIconName() {
|
|
21
29
|
switch (this.status) {
|
|
@@ -31,7 +39,7 @@ var l = class extends i {
|
|
|
31
39
|
bubbles: !0,
|
|
32
40
|
composed: !0
|
|
33
41
|
});
|
|
34
|
-
this.dispatchEvent(e), this.
|
|
42
|
+
this.dispatchEvent(e), this._showState = !1;
|
|
35
43
|
}
|
|
36
44
|
get inlineAlertClasses() {
|
|
37
45
|
return {
|
|
@@ -48,22 +56,22 @@ var l = class extends i {
|
|
|
48
56
|
});
|
|
49
57
|
}
|
|
50
58
|
get closeButtonTemplate() {
|
|
51
|
-
return this.componentFactory.createIconButton({
|
|
59
|
+
return this.showClose ? this.componentFactory.createIconButton({
|
|
52
60
|
"data-aria-label": "close-button",
|
|
53
61
|
"@click": this.handleClickCloseButton,
|
|
54
62
|
"icon-name": "cross",
|
|
55
63
|
variant: "naked",
|
|
56
64
|
size: "medium"
|
|
57
|
-
});
|
|
65
|
+
}) : e;
|
|
58
66
|
}
|
|
59
67
|
render() {
|
|
60
68
|
return this.show ? t`
|
|
61
|
-
<div class=${
|
|
69
|
+
<div class=${c(this.inlineAlertClasses)} part="container">
|
|
62
70
|
${this.iconTemplate}
|
|
63
71
|
<div class="content">
|
|
64
72
|
<div class="header">
|
|
65
|
-
${
|
|
66
|
-
${
|
|
73
|
+
${l(this.title, () => t`<div class="title">${this.title}</div>`)}
|
|
74
|
+
${l(this.text, () => t`<div class="message">${this.text}</div>`)}
|
|
67
75
|
</div>
|
|
68
76
|
<slot></slot>
|
|
69
77
|
</div>
|
|
@@ -72,10 +80,15 @@ var l = class extends i {
|
|
|
72
80
|
` : e;
|
|
73
81
|
}
|
|
74
82
|
};
|
|
75
|
-
|
|
83
|
+
i([n({ type: String })], d.prototype, "status", void 0), i([n({ type: String })], d.prototype, "title", void 0), i([n({ type: String })], d.prototype, "text", void 0), i([n({
|
|
84
|
+
attribute: "show-close",
|
|
76
85
|
type: Boolean,
|
|
77
|
-
converter:
|
|
86
|
+
converter: s,
|
|
78
87
|
reflect: !0
|
|
79
|
-
})],
|
|
88
|
+
})], d.prototype, "showClose", void 0), i([n({
|
|
89
|
+
type: Boolean,
|
|
90
|
+
attribute: "show",
|
|
91
|
+
converter: s
|
|
92
|
+
})], d.prototype, "_show", void 0), i([r()], d.prototype, "_showState", void 0), d = i([o("ds-inline-alert")], d);
|
|
80
93
|
//#endregion
|
|
81
|
-
export {
|
|
94
|
+
export { d as DsInlineAlert };
|
|
@@ -50,7 +50,7 @@ var p = class extends o {
|
|
|
50
50
|
}
|
|
51
51
|
loadThemeStyles() {
|
|
52
52
|
return this.loadStyles ? new Promise((e, t) => {
|
|
53
|
-
let n = "/2.0.0-canary.
|
|
53
|
+
let n = "/2.0.0-canary.94", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
|
|
54
54
|
if (document.head.querySelector(`link[href="${r}"]`)) e();
|
|
55
55
|
else {
|
|
56
56
|
let i = `ui-kit-theme-${n}`, a = document.getElementById(i), o = document.createElement("link");
|
|
@@ -25,7 +25,7 @@ var n = class {
|
|
|
25
25
|
return console.error(`Failed to fetch icon "${e}":`, t), "";
|
|
26
26
|
}), t.subscribe("theme", this.handleChangeTheme);
|
|
27
27
|
}
|
|
28
|
-
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.94"), i = globalThis, a = i[r];
|
|
29
29
|
a || (a = new n(), Object.defineProperty(i, r, {
|
|
30
30
|
value: a,
|
|
31
31
|
writable: !1,
|
package/dist/esm/utils/PubSub.js
CHANGED
|
@@ -18,7 +18,7 @@ var e = class {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.94"), n = globalThis, r = n[t];
|
|
22
22
|
r || (r = new e(), Object.defineProperty(n, t, {
|
|
23
23
|
value: r,
|
|
24
24
|
writable: !1,
|
|
@@ -4,7 +4,7 @@ var t = e(20), n = class e {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stylePromises = /* @__PURE__ */ new Map(), this.getStyles = async ({ componentName: e, theme: n }) => {
|
|
6
6
|
if (!n || !e) return;
|
|
7
|
-
let r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
7
|
+
let r = `https://ds-assets.cupra.com/2.0.0-canary.94/styles/${n}/components/${e}.css`, i = this.getCachedStyleSheetPromise({ url: r });
|
|
8
8
|
if (i) return i;
|
|
9
9
|
let a = t(() => this.fetchStyle({ url: r })).then((e) => (e || this.stylePromises.delete(r), e));
|
|
10
10
|
return this.stylePromises.set(r, a), this.stylePromises.get(r);
|
|
@@ -2,7 +2,7 @@ import { i as e, r as t } from "../node_modules/.pnpm/@lit_reactive-element@2.1.
|
|
|
2
2
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
//#region src/utils/cssWithTokens.ts
|
|
4
4
|
function n(n, ...r) {
|
|
5
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
5
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-94"))}`;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as cssWithTokens };
|
|
@@ -4,7 +4,7 @@ import { o as t } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-ht
|
|
|
4
4
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.js";
|
|
5
5
|
//#region src/utils/htmlWithTokens.ts
|
|
6
6
|
function n(n, ...r) {
|
|
7
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
7
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-94"))}`;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { n as htmlWithTokens };
|
|
@@ -6,7 +6,11 @@ export declare class DsInlineAlert extends UiKitElement {
|
|
|
6
6
|
status: DsInlineAlertAttrs['status'];
|
|
7
7
|
title: DsInlineAlertAttrs['title'];
|
|
8
8
|
text: DsInlineAlertAttrs['text'];
|
|
9
|
-
|
|
9
|
+
showClose: DsInlineAlertAttrs['show-close'];
|
|
10
|
+
_show: boolean | undefined;
|
|
11
|
+
private _showState;
|
|
12
|
+
get show(): boolean;
|
|
13
|
+
set show(value: boolean | undefined);
|
|
10
14
|
private getIconName;
|
|
11
15
|
private handleClickCloseButton;
|
|
12
16
|
protected get inlineAlertClasses(): {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const
|
|
2
|
-
<div class=${
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../utils/booleanConverter.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.cjs`),l=require(`./styles/common.styles.cjs`);var u=class extends i.UiKitElement{constructor(...e){super(...e),this.status=`default`,this.title=``,this.text=``,this.showClose=!0,this._show=void 0,this._showState=!0}static{this.styles=[l.inlineAlertStyles]}get show(){return this._show??this._showState}set show(e){this._show=e}getIconName(){switch(this.status){case`success`:return`check-mark-circle`;case`error`:return`cross-circle`;case`warning`:return`exclamation-mark-circle`;case`info`:return`info-circle`;default:return`chat-bubble`}}handleClickCloseButton(){let e=new CustomEvent(`inline-alert:close`,{bubbles:!0,composed:!0});this.dispatchEvent(e),this._showState=!1}get inlineAlertClasses(){return{container:!0,[this.status||`default`]:!0,show:this.show}}get iconTemplate(){return this.componentFactory.createIcon({class:`icon`,"icon-name":this.getIconName(),size:24})}get closeButtonTemplate(){return this.showClose?this.componentFactory.createIconButton({"data-aria-label":`close-button`,"@click":this.handleClickCloseButton,"icon-name":`cross`,variant:`naked`,size:`medium`}):e.E}render(){return this.show?e.x`
|
|
2
|
+
<div class=${s.e(this.inlineAlertClasses)} part="container">
|
|
3
3
|
${this.iconTemplate}
|
|
4
4
|
<div class="content">
|
|
5
5
|
<div class="header">
|
|
6
|
-
${
|
|
7
|
-
${
|
|
6
|
+
${c.n(this.title,()=>e.x`<div class="title">${this.title}</div>`)}
|
|
7
|
+
${c.n(this.text,()=>e.x`<div class="message">${this.text}</div>`)}
|
|
8
8
|
</div>
|
|
9
9
|
<slot></slot>
|
|
10
10
|
</div>
|
|
11
11
|
${this.closeButtonTemplate}
|
|
12
12
|
</div>
|
|
13
|
-
`:e.E}};
|
|
13
|
+
`:e.E}};r.__decorate([t.n({type:String})],u.prototype,`status`,void 0),r.__decorate([t.n({type:String})],u.prototype,`title`,void 0),r.__decorate([t.n({type:String})],u.prototype,`text`,void 0),r.__decorate([t.n({attribute:`show-close`,type:Boolean,converter:o.booleanConverter,reflect:!0})],u.prototype,`showClose`,void 0),r.__decorate([t.n({type:Boolean,attribute:`show`,converter:o.booleanConverter})],u.prototype,`_show`,void 0),r.__decorate([n.r()],u.prototype,`_showState`,void 0),u=r.__decorate([a.customUiKitElement(`ds-inline-alert`)],u),Object.defineProperty(exports,`DsInlineAlert`,{enumerable:!0,get:function(){return u}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const e=require(`../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs`),t=require(`./themeContext.cjs`),n=require(`../../core/theme.constants.cjs`),r=require(`../../utils/PubSub.cjs`),i=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`),a=require(`../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const o=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),s=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const c=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),l=require(`../../decorators/customUiKitElement.cjs`),u=require(`../../utils/booleanConverter.cjs`),d=require(`../../styles/source/shared/fonts-config.cjs`);var f=class extends a.i{constructor(...e){super(...e),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has(`theme`)&&(r.pubSub.publish(`theme`,this.theme),sessionStorage?.setItem(n.THEME_STORAGE_KEY,this.theme),typeof FontFace<`u`&&document?.fonts&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent(`ui-kit:ready`,{bubbles:!0,composed:!0}))}))}loadThemeFonts(){d.fontsConfig[this.theme]?.fonts.forEach(e=>{this.loadThemeFont(e)})}async loadThemeFont({weight:e,name:t,file:n}){if(!this.loadFonts)return Promise.resolve();let r=`${t}-${e}`;if(this.loadedFonts.has(r))return;let i=new FontFace(t,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.94`,r=`https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${r}"]`))e();else{let i=`ui-kit-theme-${n}`,a=document.getElementById(i),o=document.createElement(`link`);o.id=i,o.rel=`stylesheet`,o.href=r,o.onload=()=>e(),o.onerror=()=>t(Error(`Failed to load theme CSS: ${r}`)),document.head.appendChild(o),a?.remove()}}):Promise.resolve()}render(){return this.cssLoaded?i.x`<slot></slot>`:i.E}};c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-fonts`})],f.prototype,`loadFonts`,void 0),c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-styles`})],f.prototype,`loadStyles`,void 0),c.__decorate([e.e({context:t.themeContext}),o.n({type:String})],f.prototype,`theme`,void 0),c.__decorate([s.r()],f.prototype,`cssLoaded`,void 0),c.__decorate([s.r()],f.prototype,`loadedFonts`,void 0),f=c.__decorate([l.customUiKitElement(`ds-theme-provider`)],f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.94`),i=globalThis,a=i[r];a||(a=new n,Object.defineProperty(i,r,{value:a,writable:!1,configurable:!1,enumerable:!1}));var o=a;exports.iconsManager=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.94`),n=globalThis,r=n[t];r||(r=new e,Object.defineProperty(n,t,{value:r,writable:!1,configurable:!1,enumerable:!1}));var i=r;exports.pubSub=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.94/styles/${n}/components/${t}.css`,i=this.getCachedStyleSheetPromise({url:r});if(i)return i;let a=e(()=>this.fetchStyle({url:r})).then(e=>(e||this.stylePromises.delete(r),e));return this.stylePromises.set(r,a),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>`u`)return;let 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 t.instance||=new t,t.instance}}.getInstance();exports.stylesRegistry=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-94`))}`}exports.cssWithTokens=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-94`))}`}exports.htmlWithTokens=n;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { E as e, x as t } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
2
2
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
import { n } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
4
|
+
import { r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
4
5
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.js";
|
|
5
|
-
import { __decorate as
|
|
6
|
-
import { UiKitElement as
|
|
7
|
-
import { customUiKitElement as
|
|
8
|
-
import {
|
|
6
|
+
import { __decorate as i } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.js";
|
|
7
|
+
import { UiKitElement as a } from "../base/UiKitElement.js";
|
|
8
|
+
import { customUiKitElement as o } from "../../decorators/customUiKitElement.js";
|
|
9
|
+
import { booleanConverter as s } from "../../utils/booleanConverter.js";
|
|
10
|
+
import { e as c } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
9
11
|
import "../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.js";
|
|
10
|
-
import { n as
|
|
11
|
-
import { inlineAlertStyles as
|
|
12
|
+
import { n as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.js";
|
|
13
|
+
import { inlineAlertStyles as u } from "./styles/common.styles.js";
|
|
12
14
|
//#region src/components/ds-inline-alert/ds-inline-alert.ts
|
|
13
|
-
var
|
|
15
|
+
var d = class extends a {
|
|
14
16
|
constructor(...e) {
|
|
15
|
-
super(...e), this.status = "default", this.title = "", this.text = "", this.
|
|
17
|
+
super(...e), this.status = "default", this.title = "", this.text = "", this.showClose = !0, this._show = void 0, this._showState = !0;
|
|
16
18
|
}
|
|
17
19
|
static {
|
|
18
|
-
this.styles = [
|
|
20
|
+
this.styles = [u];
|
|
21
|
+
}
|
|
22
|
+
get show() {
|
|
23
|
+
return this._show ?? this._showState;
|
|
24
|
+
}
|
|
25
|
+
set show(e) {
|
|
26
|
+
this._show = e;
|
|
19
27
|
}
|
|
20
28
|
getIconName() {
|
|
21
29
|
switch (this.status) {
|
|
@@ -31,7 +39,7 @@ var l = class extends i {
|
|
|
31
39
|
bubbles: !0,
|
|
32
40
|
composed: !0
|
|
33
41
|
});
|
|
34
|
-
this.dispatchEvent(e), this.
|
|
42
|
+
this.dispatchEvent(e), this._showState = !1;
|
|
35
43
|
}
|
|
36
44
|
get inlineAlertClasses() {
|
|
37
45
|
return {
|
|
@@ -48,22 +56,22 @@ var l = class extends i {
|
|
|
48
56
|
});
|
|
49
57
|
}
|
|
50
58
|
get closeButtonTemplate() {
|
|
51
|
-
return this.componentFactory.createIconButton({
|
|
59
|
+
return this.showClose ? this.componentFactory.createIconButton({
|
|
52
60
|
"data-aria-label": "close-button",
|
|
53
61
|
"@click": this.handleClickCloseButton,
|
|
54
62
|
"icon-name": "cross",
|
|
55
63
|
variant: "naked",
|
|
56
64
|
size: "medium"
|
|
57
|
-
});
|
|
65
|
+
}) : e;
|
|
58
66
|
}
|
|
59
67
|
render() {
|
|
60
68
|
return this.show ? t`
|
|
61
|
-
<div class=${
|
|
69
|
+
<div class=${c(this.inlineAlertClasses)} part="container">
|
|
62
70
|
${this.iconTemplate}
|
|
63
71
|
<div class="content">
|
|
64
72
|
<div class="header">
|
|
65
|
-
${
|
|
66
|
-
${
|
|
73
|
+
${l(this.title, () => t`<div class="title">${this.title}</div>`)}
|
|
74
|
+
${l(this.text, () => t`<div class="message">${this.text}</div>`)}
|
|
67
75
|
</div>
|
|
68
76
|
<slot></slot>
|
|
69
77
|
</div>
|
|
@@ -72,10 +80,15 @@ var l = class extends i {
|
|
|
72
80
|
` : e;
|
|
73
81
|
}
|
|
74
82
|
};
|
|
75
|
-
|
|
83
|
+
i([n({ type: String })], d.prototype, "status", void 0), i([n({ type: String })], d.prototype, "title", void 0), i([n({ type: String })], d.prototype, "text", void 0), i([n({
|
|
84
|
+
attribute: "show-close",
|
|
76
85
|
type: Boolean,
|
|
77
|
-
converter:
|
|
86
|
+
converter: s,
|
|
78
87
|
reflect: !0
|
|
79
|
-
})],
|
|
88
|
+
})], d.prototype, "showClose", void 0), i([n({
|
|
89
|
+
type: Boolean,
|
|
90
|
+
attribute: "show",
|
|
91
|
+
converter: s
|
|
92
|
+
})], d.prototype, "_show", void 0), i([r()], d.prototype, "_showState", void 0), d = i([o("ds-inline-alert")], d);
|
|
80
93
|
//#endregion
|
|
81
|
-
export {
|
|
94
|
+
export { d as DsInlineAlert };
|
|
@@ -50,7 +50,7 @@ var p = class extends o {
|
|
|
50
50
|
}
|
|
51
51
|
loadThemeStyles() {
|
|
52
52
|
return this.loadStyles ? new Promise((e, t) => {
|
|
53
|
-
let n = "/2.0.0-canary.
|
|
53
|
+
let n = "/2.0.0-canary.94", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
|
|
54
54
|
if (document.head.querySelector(`link[href="${r}"]`)) e();
|
|
55
55
|
else {
|
|
56
56
|
let i = `ui-kit-theme-${n}`, a = document.getElementById(i), o = document.createElement("link");
|
|
@@ -25,7 +25,7 @@ var n = class {
|
|
|
25
25
|
return console.error(`Failed to fetch icon "${e}":`, t), "";
|
|
26
26
|
}), t.subscribe("theme", this.handleChangeTheme);
|
|
27
27
|
}
|
|
28
|
-
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.94"), i = globalThis, a = i[r];
|
|
29
29
|
a || (a = new n(), Object.defineProperty(i, r, {
|
|
30
30
|
value: a,
|
|
31
31
|
writable: !1,
|
|
@@ -18,7 +18,7 @@ var e = class {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.94"), n = globalThis, r = n[t];
|
|
22
22
|
r || (r = new e(), Object.defineProperty(n, t, {
|
|
23
23
|
value: r,
|
|
24
24
|
writable: !1,
|
|
@@ -4,7 +4,7 @@ var t = e(20), n = class e {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stylePromises = /* @__PURE__ */ new Map(), this.getStyles = async ({ componentName: e, theme: n }) => {
|
|
6
6
|
if (!n || !e) return;
|
|
7
|
-
let r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
7
|
+
let r = `https://ds-assets.cupra.com/2.0.0-canary.94/styles/${n}/components/${e}.css`, i = this.getCachedStyleSheetPromise({ url: r });
|
|
8
8
|
if (i) return i;
|
|
9
9
|
let a = t(() => this.fetchStyle({ url: r })).then((e) => (e || this.stylePromises.delete(r), e));
|
|
10
10
|
return this.stylePromises.set(r, a), this.stylePromises.get(r);
|
|
@@ -2,7 +2,7 @@ import { i as e, r as t } from "../node_modules/.pnpm/@lit_reactive-element@2.1.
|
|
|
2
2
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
//#region src/utils/cssWithTokens.ts
|
|
4
4
|
function n(n, ...r) {
|
|
5
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
5
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-94"))}`;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as cssWithTokens };
|
|
@@ -4,7 +4,7 @@ import { o as t } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-ht
|
|
|
4
4
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.js";
|
|
5
5
|
//#region src/utils/htmlWithTokens.ts
|
|
6
6
|
function n(n, ...r) {
|
|
7
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
7
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-94"))}`;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { n as htmlWithTokens };
|
|
@@ -6,7 +6,11 @@ export declare class DsInlineAlert extends UiKitElement {
|
|
|
6
6
|
status: DsInlineAlertAttrs['status'];
|
|
7
7
|
title: DsInlineAlertAttrs['title'];
|
|
8
8
|
text: DsInlineAlertAttrs['text'];
|
|
9
|
-
|
|
9
|
+
showClose: DsInlineAlertAttrs['show-close'];
|
|
10
|
+
_show: boolean | undefined;
|
|
11
|
+
private _showState;
|
|
12
|
+
get show(): boolean;
|
|
13
|
+
set show(value: boolean | undefined);
|
|
10
14
|
private getIconName;
|
|
11
15
|
private handleClickCloseButton;
|
|
12
16
|
protected get inlineAlertClasses(): {
|