@cupra/ui-kit 2.0.0-canary.44 → 2.0.0-canary.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/components/ds-text/ds-text.cjs +10 -12
  2. package/dist/cjs/components/ds-text/styles/common.styles.cjs +7 -7
  3. package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  4. package/dist/cjs/utils/IconsManager.cjs +1 -1
  5. package/dist/cjs/utils/PubSub.cjs +1 -1
  6. package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  7. package/dist/cjs/utils/cssWithTokens.cjs +1 -1
  8. package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
  9. package/dist/esm/components/ds-text/ds-text.js +67 -53
  10. package/dist/esm/components/ds-text/styles/common.styles.js +7 -7
  11. package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  12. package/dist/esm/utils/IconsManager.js +1 -1
  13. package/dist/esm/utils/PubSub.js +1 -1
  14. package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  15. package/dist/esm/utils/cssWithTokens.js +1 -1
  16. package/dist/esm/utils/htmlWithTokens.js +1 -1
  17. package/dist/types/components/ds-text/ds-text.d.ts +2 -4
  18. package/dist/types/components/ds-text/ds-text.types.d.ts +1 -1
  19. package/dist-react/cjs/components/ds-text/ds-text.cjs +10 -12
  20. package/dist-react/cjs/components/ds-text/styles/common.styles.cjs +7 -7
  21. package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  22. package/dist-react/cjs/utils/IconsManager.cjs +1 -1
  23. package/dist-react/cjs/utils/PubSub.cjs +1 -1
  24. package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  25. package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
  26. package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
  27. package/dist-react/esm/components/ds-text/ds-text.js +67 -53
  28. package/dist-react/esm/components/ds-text/styles/common.styles.js +7 -7
  29. package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  30. package/dist-react/esm/utils/IconsManager.js +1 -1
  31. package/dist-react/esm/utils/PubSub.js +1 -1
  32. package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  33. package/dist-react/esm/utils/cssWithTokens.js +1 -1
  34. package/dist-react/esm/utils/htmlWithTokens.js +1 -1
  35. package/dist-react/types/components/ds-text/ds-text.d.ts +2 -4
  36. package/dist-react/types/components/ds-text/ds-text.types.d.ts +1 -1
  37. package/package.json +1 -1
@@ -1,13 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),h=require("../../mixins/ViewportMixin.cjs"),m=require("../../utils/booleanConverter.cjs"),y=require("../../utils/htmlWithTokens.cjs"),g=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const a=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 t=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),v=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),T=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs"),x=require("./styles/common.styles.cjs");var d=Object.defineProperty,D=Object.getOwnPropertyDescriptor,e=(i,r,n,o)=>{for(var s=o>1?void 0:o?D(r,n):r,p=i.length-1,l;p>=0;p--)(l=i[p])&&(s=(o?l(r,n,s):l(s))||s);return o&&s&&d(r,n,s),s};exports.DsText=class extends h.ViewportMixin(c.UiKitElement){constructor(){super(...arguments),this.size="medium",this.weight="regular",this.variant="body",this.mode="light"}get classes(){const r=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,[`size-${r}`]:!!r,[`mode-${this.mode}`]:!!this.mode,[`weight-${this.weight}`]:!!this.weight,[`variant-${this.variant}`]:!!this.variant,uppercase:this.uppercase}}get customElementTemplate(){return!this.htmlTagName||!this.value?a.nothing:a.html`${T.unsafeHTML(`<${this.htmlTagName} class="text">${this.value}</${this.htmlTagName}>`)}`}get styles(){return y.htmlWithTokens`
2
- <style>
3
- .container {
4
- color: ${this.color||"var(--ui-kit-text-color)"}
5
- }
6
- </style>
7
- `}render(){return a.html`
8
- ${this.styles}
9
- <div data-testid="ds-text-container" class=${v.classMap(this.classes)}>
10
- ${this.customElementTemplate}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),h=require("../../mixins/ViewportMixin.cjs"),y=require("../../utils/booleanConverter.cjs"),m=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const g=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"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.cjs"),v=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),T=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.cjs"),l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.cjs"),x=require("./styles/common.styles.cjs");var D=Object.defineProperty,q=Object.getOwnPropertyDescriptor,s=(n,e,t,r)=>{for(var o=r>1?void 0:r?q(e,t):e,a=n.length-1,p;a>=0;a--)(p=n[a])&&(o=(r?p(e,t,o):p(o))||o);return r&&o&&D(e,t,o),o};const f=new Set(["span","p","strong","em","small","label","div","h1","h2","h3","h4","h5","h6"]);exports.DsText=class extends h.ViewportMixin(c.UiKitElement){constructor(){super(...arguments),this.size="medium",this.weight="regular",this.variant="body",this.htmlTagName="span",this.mode="light"}get classes(){var t,r;const e=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,[`size-${e}`]:!!e,[`mode-${this.mode}`]:!!this.mode,[`weight-${this.weight}`]:!!this.weight,[`variant-${this.variant}`]:!!this.variant,"display-contents":(r=(t=this.slotedNodes)==null?void 0:t.some)==null?void 0:r.call(t,o=>o.nodeType!==Node.TEXT_NODE),uppercase:this.uppercase}}render(){const e=(this.htmlTagName??"").toLowerCase(),t=f.has(e)?e:"span",r=l.unsafeStatic(t);return l.html`
2
+ <${r}
3
+ part="container"
4
+ data-testid="ds-text-container"
5
+ class=${v.classMap(this.classes)}
6
+ style=${T.styleMap({color:this.color||"var(--ui-kit-text-color)"})}
7
+ >
8
+ ${this.value?this.value:g.nothing}
11
9
  <slot></slot>
12
- </div>
13
- `}};exports.DsText.styles=[x.commonStyles];e([t.property({type:String,converter:g.objectConverter})],exports.DsText.prototype,"size",2);e([t.property({type:String})],exports.DsText.prototype,"weight",2);e([t.property({type:String})],exports.DsText.prototype,"variant",2);e([t.property({type:String,attribute:"html-tag-name"})],exports.DsText.prototype,"htmlTagName",2);e([t.property({type:String})],exports.DsText.prototype,"value",2);e([t.property({type:String,reflect:!0})],exports.DsText.prototype,"mode",2);e([t.property({type:String,reflect:!0})],exports.DsText.prototype,"color",2);e([t.property({type:Boolean,converter:m.booleanConverter,reflect:!0})],exports.DsText.prototype,"uppercase",2);exports.DsText=e([u.customUiKitElement("ds-text")],exports.DsText);
10
+ </${r}>
11
+ `}};exports.DsText.styles=[x.commonStyles];s([i.property({type:String,converter:m.objectConverter})],exports.DsText.prototype,"size",2);s([i.property({type:String})],exports.DsText.prototype,"weight",2);s([i.property({type:String})],exports.DsText.prototype,"variant",2);s([i.property({type:String,attribute:"html-tag-name"})],exports.DsText.prototype,"htmlTagName",2);s([i.property({type:String})],exports.DsText.prototype,"value",2);s([i.property({type:String,reflect:!0})],exports.DsText.prototype,"mode",2);s([i.property({type:String,reflect:!0})],exports.DsText.prototype,"color",2);s([i.property({type:Boolean,converter:y.booleanConverter,reflect:!0})],exports.DsText.prototype,"uppercase",2);s([d.queryAssignedNodes({slot:"",flatten:!0})],exports.DsText.prototype,"slotedNodes",2);exports.DsText=s([u.customUiKitElement("ds-text")],exports.DsText);
@@ -1,11 +1,15 @@
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"),t=e.css`
2
2
  :host,
3
- .container {
3
+ .display-contents {
4
4
  display: contents;
5
5
  }
6
6
 
7
- ::slotted(*),
8
- .text {
7
+ .container {
8
+ margin: 0;
9
+ }
10
+
11
+ .container *,
12
+ ::slotted(*) {
9
13
  color: inherit;
10
14
  font-size: inherit;
11
15
  font-weight: inherit;
@@ -13,10 +17,6 @@
13
17
  margin: 0;
14
18
  }
15
19
 
16
- .text + ::slotted(*) {
17
- display: none;
18
- }
19
-
20
20
  .uppercase {
21
21
  text-transform: uppercase;
22
22
  }
@@ -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.44",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);
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.45",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.44"),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
+ "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.45"),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.44"),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
+ "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.45"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.44/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.45/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-44"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
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-45"),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-44"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
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-45"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
@@ -1,85 +1,99 @@
1
- import { UiKitElement as h } from "../base/UiKitElement.js";
2
- import { customUiKitElement as c } from "../../decorators/customUiKitElement.js";
3
- import { ViewportMixin as u } from "../../mixins/ViewportMixin.js";
1
+ import { UiKitElement as l } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as h } from "../../decorators/customUiKitElement.js";
3
+ import { ViewportMixin as c } from "../../mixins/ViewportMixin.js";
4
4
  import { booleanConverter as g } from "../../utils/booleanConverter.js";
5
- import { htmlWithTokens as y } from "../../utils/htmlWithTokens.js";
6
- import { objectConverter as f } from "../../utils/objectConverter.js";
5
+ import { objectConverter as u } from "../../utils/objectConverter.js";
7
6
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
8
- import { nothing as v, html as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
7
+ import { nothing as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
9
8
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
10
- import { property as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
9
+ import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
10
+ import { queryAssignedNodes as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js";
11
11
  import { classMap as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
12
- import { unsafeHTML as $ } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
13
- import { commonStyles as w } from "./styles/common.styles.js";
14
- var x = Object.defineProperty, T = Object.getOwnPropertyDescriptor, e = (i, s, p, a) => {
15
- for (var o = a > 1 ? void 0 : a ? T(s, p) : s, m = i.length - 1, n; m >= 0; m--)
16
- (n = i[m]) && (o = (a ? n(s, p, o) : n(o)) || o);
17
- return a && o && x(s, p, o), o;
12
+ import { styleMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.js";
13
+ import { unsafeStatic as w, html as S } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.js";
14
+ import { commonStyles as N } from "./styles/common.styles.js";
15
+ var $ = Object.defineProperty, T = Object.getOwnPropertyDescriptor, o = (s, e, r, p) => {
16
+ for (var a = p > 1 ? void 0 : p ? T(e, r) : e, n = s.length - 1, m; n >= 0; n--)
17
+ (m = s[n]) && (a = (p ? m(e, r, a) : m(a)) || a);
18
+ return p && a && $(e, r, a), a;
18
19
  };
19
- let t = class extends u(h) {
20
+ const _ = /* @__PURE__ */ new Set([
21
+ "span",
22
+ "p",
23
+ "strong",
24
+ "em",
25
+ "small",
26
+ "label",
27
+ "div",
28
+ "h1",
29
+ "h2",
30
+ "h3",
31
+ "h4",
32
+ "h5",
33
+ "h6"
34
+ ]);
35
+ let t = class extends c(l) {
20
36
  constructor() {
21
- super(...arguments), this.size = "medium", this.weight = "regular", this.variant = "body", this.mode = "light";
37
+ super(...arguments), this.size = "medium", this.weight = "regular", this.variant = "body", this.htmlTagName = "span", this.mode = "light";
22
38
  }
23
39
  get classes() {
24
- const i = typeof this.size == "string" ? this.size : this.size[this.viewport];
40
+ var e, r;
41
+ const s = typeof this.size == "string" ? this.size : this.size[this.viewport];
25
42
  return {
26
43
  container: !0,
27
- [`size-${i}`]: !!i,
44
+ [`size-${s}`]: !!s,
28
45
  [`mode-${this.mode}`]: !!this.mode,
29
46
  [`weight-${this.weight}`]: !!this.weight,
30
47
  [`variant-${this.variant}`]: !!this.variant,
48
+ "display-contents": (r = (e = this.slotedNodes) == null ? void 0 : e.some) == null ? void 0 : r.call(e, (p) => p.nodeType !== Node.TEXT_NODE),
31
49
  uppercase: this.uppercase
32
50
  };
33
51
  }
34
- get customElementTemplate() {
35
- return !this.htmlTagName || !this.value ? v : l`${$(`<${this.htmlTagName} class="text">${this.value}</${this.htmlTagName}>`)}`;
36
- }
37
- get styles() {
38
- return y`
39
- <style>
40
- .container {
41
- color: ${this.color || "var(--ui-kit-text-color)"}
42
- }
43
- </style>
44
- `;
45
- }
46
52
  render() {
47
- return l`
48
- ${this.styles}
49
- <div data-testid="ds-text-container" class=${d(this.classes)}>
50
- ${this.customElementTemplate}
53
+ const s = (this.htmlTagName ?? "").toLowerCase(), e = _.has(s) ? s : "span", r = w(e);
54
+ return S`
55
+ <${r}
56
+ part="container"
57
+ data-testid="ds-text-container"
58
+ class=${d(this.classes)}
59
+ style=${v({ color: this.color || "var(--ui-kit-text-color)" })}
60
+ >
61
+ ${this.value ? this.value : y}
51
62
  <slot></slot>
52
- </div>
63
+ </${r}>
53
64
  `;
54
65
  }
55
66
  };
56
- t.styles = [w];
57
- e([
58
- r({ type: String, converter: f })
67
+ t.styles = [N];
68
+ o([
69
+ i({ type: String, converter: u })
59
70
  ], t.prototype, "size", 2);
60
- e([
61
- r({ type: String })
71
+ o([
72
+ i({ type: String })
62
73
  ], t.prototype, "weight", 2);
63
- e([
64
- r({ type: String })
74
+ o([
75
+ i({ type: String })
65
76
  ], t.prototype, "variant", 2);
66
- e([
67
- r({ type: String, attribute: "html-tag-name" })
77
+ o([
78
+ i({ type: String, attribute: "html-tag-name" })
68
79
  ], t.prototype, "htmlTagName", 2);
69
- e([
70
- r({ type: String })
80
+ o([
81
+ i({ type: String })
71
82
  ], t.prototype, "value", 2);
72
- e([
73
- r({ type: String, reflect: !0 })
83
+ o([
84
+ i({ type: String, reflect: !0 })
74
85
  ], t.prototype, "mode", 2);
75
- e([
76
- r({ type: String, reflect: !0 })
86
+ o([
87
+ i({ type: String, reflect: !0 })
77
88
  ], t.prototype, "color", 2);
78
- e([
79
- r({ type: Boolean, converter: g, reflect: !0 })
89
+ o([
90
+ i({ type: Boolean, converter: g, reflect: !0 })
80
91
  ], t.prototype, "uppercase", 2);
81
- t = e([
82
- c("ds-text")
92
+ o([
93
+ f({ slot: "", flatten: !0 })
94
+ ], t.prototype, "slotedNodes", 2);
95
+ t = o([
96
+ h("ds-text")
83
97
  ], t);
84
98
  export {
85
99
  t as DsText
@@ -4,12 +4,16 @@ import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/l
4
4
  import { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
5
  const r = t`
6
6
  :host,
7
- .container {
7
+ .display-contents {
8
8
  display: contents;
9
9
  }
10
10
 
11
- ::slotted(*),
12
- .text {
11
+ .container {
12
+ margin: 0;
13
+ }
14
+
15
+ .container *,
16
+ ::slotted(*) {
13
17
  color: inherit;
14
18
  font-size: inherit;
15
19
  font-weight: inherit;
@@ -17,10 +21,6 @@ const r = t`
17
21
  margin: 0;
18
22
  }
19
23
 
20
- .text + ::slotted(*) {
21
- display: none;
22
- }
23
-
24
24
  .uppercase {
25
25
  text-transform: uppercase;
26
26
  }
@@ -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.44", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
57
+ const s = "/2.0.0-canary.45", 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.44"), h = globalThis;
28
+ const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.45"), 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.44"), t = globalThis;
21
+ const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.45"), t = globalThis;
22
22
  let b = t[u];
23
23
  b || (b = new e(), Object.defineProperty(t, u, {
24
24
  value: b,
@@ -5,7 +5,7 @@ class s {
5
5
  theme: t
6
6
  }) => {
7
7
  if (!t || !e) return;
8
- const r = `https://ds-assets.cupra.com/2.0.0-canary.44/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
8
+ const r = `https://ds-assets.cupra.com/2.0.0-canary.45/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
9
9
  if (c) return c;
10
10
  const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
11
11
  return this.stylePromises.set(r, i), this.stylePromises.get(r);
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
3
3
  import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
4
4
  import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
5
  function x(t, ...r) {
6
- const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-44"), i = n(e);
6
+ const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-45"), 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-44"), e = i(o);
6
+ const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-45"), e = i(o);
7
7
  return n`${e}`;
8
8
  }
9
9
  export {
@@ -1,5 +1,4 @@
1
1
  import { UiKitElement } from '../base/UiKitElement.ts';
2
- import { type TemplateResult } from 'lit';
3
2
  import type { DsTextAttrs } from './ds-text.types.ts';
4
3
  declare const DsText_base: (new (...args: any[]) => import("../../mixins/ViewportMixin.ts").ViewportInterface) & typeof UiKitElement;
5
4
  export declare class DsText extends DsText_base {
@@ -12,9 +11,8 @@ export declare class DsText extends DsText_base {
12
11
  mode: DsTextAttrs['mode'];
13
12
  color: DsTextAttrs['color'];
14
13
  uppercase: DsTextAttrs['uppercase'];
14
+ slotedNodes: Array<Node>;
15
15
  private get classes();
16
- private get customElementTemplate();
17
- protected get styles(): import("lit").HTMLTemplateResult;
18
- render(): TemplateResult<1>;
16
+ render(): import("lit").TemplateResult;
19
17
  }
20
18
  export {};
@@ -6,7 +6,7 @@ export type DsTextAttrs = {
6
6
  size?: TextSize;
7
7
  weight?: TextWeight;
8
8
  variant?: TextVariant;
9
- 'html-tag-name'?: string;
9
+ 'html-tag-name'?: 'span' | 'p' | 'strong' | 'em' | 'small' | 'label' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
10
10
  value?: string;
11
11
  mode?: 'dark' | 'light';
12
12
  color?: string;
@@ -1,13 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),h=require("../../mixins/ViewportMixin.cjs"),m=require("../../utils/booleanConverter.cjs"),y=require("../../utils/htmlWithTokens.cjs"),g=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const a=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 t=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),v=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),T=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs"),x=require("./styles/common.styles.cjs");var d=Object.defineProperty,D=Object.getOwnPropertyDescriptor,e=(i,r,n,o)=>{for(var s=o>1?void 0:o?D(r,n):r,p=i.length-1,l;p>=0;p--)(l=i[p])&&(s=(o?l(r,n,s):l(s))||s);return o&&s&&d(r,n,s),s};exports.DsText=class extends h.ViewportMixin(c.UiKitElement){constructor(){super(...arguments),this.size="medium",this.weight="regular",this.variant="body",this.mode="light"}get classes(){const r=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,[`size-${r}`]:!!r,[`mode-${this.mode}`]:!!this.mode,[`weight-${this.weight}`]:!!this.weight,[`variant-${this.variant}`]:!!this.variant,uppercase:this.uppercase}}get customElementTemplate(){return!this.htmlTagName||!this.value?a.nothing:a.html`${T.unsafeHTML(`<${this.htmlTagName} class="text">${this.value}</${this.htmlTagName}>`)}`}get styles(){return y.htmlWithTokens`
2
- <style>
3
- .container {
4
- color: ${this.color||"var(--ui-kit-text-color)"}
5
- }
6
- </style>
7
- `}render(){return a.html`
8
- ${this.styles}
9
- <div data-testid="ds-text-container" class=${v.classMap(this.classes)}>
10
- ${this.customElementTemplate}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),h=require("../../mixins/ViewportMixin.cjs"),y=require("../../utils/booleanConverter.cjs"),m=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const g=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"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.cjs"),v=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),T=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.cjs"),l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.cjs"),x=require("./styles/common.styles.cjs");var D=Object.defineProperty,q=Object.getOwnPropertyDescriptor,s=(n,e,t,r)=>{for(var o=r>1?void 0:r?q(e,t):e,a=n.length-1,p;a>=0;a--)(p=n[a])&&(o=(r?p(e,t,o):p(o))||o);return r&&o&&D(e,t,o),o};const f=new Set(["span","p","strong","em","small","label","div","h1","h2","h3","h4","h5","h6"]);exports.DsText=class extends h.ViewportMixin(c.UiKitElement){constructor(){super(...arguments),this.size="medium",this.weight="regular",this.variant="body",this.htmlTagName="span",this.mode="light"}get classes(){var t,r;const e=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,[`size-${e}`]:!!e,[`mode-${this.mode}`]:!!this.mode,[`weight-${this.weight}`]:!!this.weight,[`variant-${this.variant}`]:!!this.variant,"display-contents":(r=(t=this.slotedNodes)==null?void 0:t.some)==null?void 0:r.call(t,o=>o.nodeType!==Node.TEXT_NODE),uppercase:this.uppercase}}render(){const e=(this.htmlTagName??"").toLowerCase(),t=f.has(e)?e:"span",r=l.unsafeStatic(t);return l.html`
2
+ <${r}
3
+ part="container"
4
+ data-testid="ds-text-container"
5
+ class=${v.classMap(this.classes)}
6
+ style=${T.styleMap({color:this.color||"var(--ui-kit-text-color)"})}
7
+ >
8
+ ${this.value?this.value:g.nothing}
11
9
  <slot></slot>
12
- </div>
13
- `}};exports.DsText.styles=[x.commonStyles];e([t.property({type:String,converter:g.objectConverter})],exports.DsText.prototype,"size",2);e([t.property({type:String})],exports.DsText.prototype,"weight",2);e([t.property({type:String})],exports.DsText.prototype,"variant",2);e([t.property({type:String,attribute:"html-tag-name"})],exports.DsText.prototype,"htmlTagName",2);e([t.property({type:String})],exports.DsText.prototype,"value",2);e([t.property({type:String,reflect:!0})],exports.DsText.prototype,"mode",2);e([t.property({type:String,reflect:!0})],exports.DsText.prototype,"color",2);e([t.property({type:Boolean,converter:m.booleanConverter,reflect:!0})],exports.DsText.prototype,"uppercase",2);exports.DsText=e([u.customUiKitElement("ds-text")],exports.DsText);
10
+ </${r}>
11
+ `}};exports.DsText.styles=[x.commonStyles];s([i.property({type:String,converter:m.objectConverter})],exports.DsText.prototype,"size",2);s([i.property({type:String})],exports.DsText.prototype,"weight",2);s([i.property({type:String})],exports.DsText.prototype,"variant",2);s([i.property({type:String,attribute:"html-tag-name"})],exports.DsText.prototype,"htmlTagName",2);s([i.property({type:String})],exports.DsText.prototype,"value",2);s([i.property({type:String,reflect:!0})],exports.DsText.prototype,"mode",2);s([i.property({type:String,reflect:!0})],exports.DsText.prototype,"color",2);s([i.property({type:Boolean,converter:y.booleanConverter,reflect:!0})],exports.DsText.prototype,"uppercase",2);s([d.queryAssignedNodes({slot:"",flatten:!0})],exports.DsText.prototype,"slotedNodes",2);exports.DsText=s([u.customUiKitElement("ds-text")],exports.DsText);
@@ -1,11 +1,15 @@
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"),t=e.css`
2
2
  :host,
3
- .container {
3
+ .display-contents {
4
4
  display: contents;
5
5
  }
6
6
 
7
- ::slotted(*),
8
- .text {
7
+ .container {
8
+ margin: 0;
9
+ }
10
+
11
+ .container *,
12
+ ::slotted(*) {
9
13
  color: inherit;
10
14
  font-size: inherit;
11
15
  font-weight: inherit;
@@ -13,10 +17,6 @@
13
17
  margin: 0;
14
18
  }
15
19
 
16
- .text + ::slotted(*) {
17
- display: none;
18
- }
19
-
20
20
  .uppercase {
21
21
  text-transform: uppercase;
22
22
  }
@@ -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.44",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);
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.45",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.44"),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
+ "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.45"),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.44"),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
+ "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.45"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.44/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.45/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-44"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
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-45"),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-44"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
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-45"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
@@ -1,85 +1,99 @@
1
- import { UiKitElement as h } from "../base/UiKitElement.js";
2
- import { customUiKitElement as c } from "../../decorators/customUiKitElement.js";
3
- import { ViewportMixin as u } from "../../mixins/ViewportMixin.js";
1
+ import { UiKitElement as l } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as h } from "../../decorators/customUiKitElement.js";
3
+ import { ViewportMixin as c } from "../../mixins/ViewportMixin.js";
4
4
  import { booleanConverter as g } from "../../utils/booleanConverter.js";
5
- import { htmlWithTokens as y } from "../../utils/htmlWithTokens.js";
6
- import { objectConverter as f } from "../../utils/objectConverter.js";
5
+ import { objectConverter as u } from "../../utils/objectConverter.js";
7
6
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
8
- import { nothing as v, html as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
7
+ import { nothing as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
9
8
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
10
- import { property as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
9
+ import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
10
+ import { queryAssignedNodes as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-nodes.js";
11
11
  import { classMap as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
12
- import { unsafeHTML as $ } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
13
- import { commonStyles as w } from "./styles/common.styles.js";
14
- var x = Object.defineProperty, T = Object.getOwnPropertyDescriptor, e = (i, s, p, a) => {
15
- for (var o = a > 1 ? void 0 : a ? T(s, p) : s, m = i.length - 1, n; m >= 0; m--)
16
- (n = i[m]) && (o = (a ? n(s, p, o) : n(o)) || o);
17
- return a && o && x(s, p, o), o;
12
+ import { styleMap as v } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/style-map.js";
13
+ import { unsafeStatic as w, html as S } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/static.js";
14
+ import { commonStyles as N } from "./styles/common.styles.js";
15
+ var $ = Object.defineProperty, T = Object.getOwnPropertyDescriptor, o = (s, e, r, p) => {
16
+ for (var a = p > 1 ? void 0 : p ? T(e, r) : e, n = s.length - 1, m; n >= 0; n--)
17
+ (m = s[n]) && (a = (p ? m(e, r, a) : m(a)) || a);
18
+ return p && a && $(e, r, a), a;
18
19
  };
19
- let t = class extends u(h) {
20
+ const _ = /* @__PURE__ */ new Set([
21
+ "span",
22
+ "p",
23
+ "strong",
24
+ "em",
25
+ "small",
26
+ "label",
27
+ "div",
28
+ "h1",
29
+ "h2",
30
+ "h3",
31
+ "h4",
32
+ "h5",
33
+ "h6"
34
+ ]);
35
+ let t = class extends c(l) {
20
36
  constructor() {
21
- super(...arguments), this.size = "medium", this.weight = "regular", this.variant = "body", this.mode = "light";
37
+ super(...arguments), this.size = "medium", this.weight = "regular", this.variant = "body", this.htmlTagName = "span", this.mode = "light";
22
38
  }
23
39
  get classes() {
24
- const i = typeof this.size == "string" ? this.size : this.size[this.viewport];
40
+ var e, r;
41
+ const s = typeof this.size == "string" ? this.size : this.size[this.viewport];
25
42
  return {
26
43
  container: !0,
27
- [`size-${i}`]: !!i,
44
+ [`size-${s}`]: !!s,
28
45
  [`mode-${this.mode}`]: !!this.mode,
29
46
  [`weight-${this.weight}`]: !!this.weight,
30
47
  [`variant-${this.variant}`]: !!this.variant,
48
+ "display-contents": (r = (e = this.slotedNodes) == null ? void 0 : e.some) == null ? void 0 : r.call(e, (p) => p.nodeType !== Node.TEXT_NODE),
31
49
  uppercase: this.uppercase
32
50
  };
33
51
  }
34
- get customElementTemplate() {
35
- return !this.htmlTagName || !this.value ? v : l`${$(`<${this.htmlTagName} class="text">${this.value}</${this.htmlTagName}>`)}`;
36
- }
37
- get styles() {
38
- return y`
39
- <style>
40
- .container {
41
- color: ${this.color || "var(--ui-kit-text-color)"}
42
- }
43
- </style>
44
- `;
45
- }
46
52
  render() {
47
- return l`
48
- ${this.styles}
49
- <div data-testid="ds-text-container" class=${d(this.classes)}>
50
- ${this.customElementTemplate}
53
+ const s = (this.htmlTagName ?? "").toLowerCase(), e = _.has(s) ? s : "span", r = w(e);
54
+ return S`
55
+ <${r}
56
+ part="container"
57
+ data-testid="ds-text-container"
58
+ class=${d(this.classes)}
59
+ style=${v({ color: this.color || "var(--ui-kit-text-color)" })}
60
+ >
61
+ ${this.value ? this.value : y}
51
62
  <slot></slot>
52
- </div>
63
+ </${r}>
53
64
  `;
54
65
  }
55
66
  };
56
- t.styles = [w];
57
- e([
58
- r({ type: String, converter: f })
67
+ t.styles = [N];
68
+ o([
69
+ i({ type: String, converter: u })
59
70
  ], t.prototype, "size", 2);
60
- e([
61
- r({ type: String })
71
+ o([
72
+ i({ type: String })
62
73
  ], t.prototype, "weight", 2);
63
- e([
64
- r({ type: String })
74
+ o([
75
+ i({ type: String })
65
76
  ], t.prototype, "variant", 2);
66
- e([
67
- r({ type: String, attribute: "html-tag-name" })
77
+ o([
78
+ i({ type: String, attribute: "html-tag-name" })
68
79
  ], t.prototype, "htmlTagName", 2);
69
- e([
70
- r({ type: String })
80
+ o([
81
+ i({ type: String })
71
82
  ], t.prototype, "value", 2);
72
- e([
73
- r({ type: String, reflect: !0 })
83
+ o([
84
+ i({ type: String, reflect: !0 })
74
85
  ], t.prototype, "mode", 2);
75
- e([
76
- r({ type: String, reflect: !0 })
86
+ o([
87
+ i({ type: String, reflect: !0 })
77
88
  ], t.prototype, "color", 2);
78
- e([
79
- r({ type: Boolean, converter: g, reflect: !0 })
89
+ o([
90
+ i({ type: Boolean, converter: g, reflect: !0 })
80
91
  ], t.prototype, "uppercase", 2);
81
- t = e([
82
- c("ds-text")
92
+ o([
93
+ f({ slot: "", flatten: !0 })
94
+ ], t.prototype, "slotedNodes", 2);
95
+ t = o([
96
+ h("ds-text")
83
97
  ], t);
84
98
  export {
85
99
  t as DsText
@@ -4,12 +4,16 @@ import "../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/l
4
4
  import { css as t } from "../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
5
  const r = t`
6
6
  :host,
7
- .container {
7
+ .display-contents {
8
8
  display: contents;
9
9
  }
10
10
 
11
- ::slotted(*),
12
- .text {
11
+ .container {
12
+ margin: 0;
13
+ }
14
+
15
+ .container *,
16
+ ::slotted(*) {
13
17
  color: inherit;
14
18
  font-size: inherit;
15
19
  font-weight: inherit;
@@ -17,10 +21,6 @@ const r = t`
17
21
  margin: 0;
18
22
  }
19
23
 
20
- .text + ::slotted(*) {
21
- display: none;
22
- }
23
-
24
24
  .uppercase {
25
25
  text-transform: uppercase;
26
26
  }
@@ -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.44", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
57
+ const s = "/2.0.0-canary.45", 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.44"), h = globalThis;
28
+ const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.45"), 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.44"), t = globalThis;
21
+ const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.45"), t = globalThis;
22
22
  let b = t[u];
23
23
  b || (b = new e(), Object.defineProperty(t, u, {
24
24
  value: b,
@@ -5,7 +5,7 @@ class s {
5
5
  theme: t
6
6
  }) => {
7
7
  if (!t || !e) return;
8
- const r = `https://ds-assets.cupra.com/2.0.0-canary.44/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
8
+ const r = `https://ds-assets.cupra.com/2.0.0-canary.45/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
9
9
  if (c) return c;
10
10
  const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
11
11
  return this.stylePromises.set(r, i), this.stylePromises.get(r);
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
3
3
  import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
4
4
  import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
5
5
  function x(t, ...r) {
6
- const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-44"), i = n(e);
6
+ const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-45"), 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-44"), e = i(o);
6
+ const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-45"), e = i(o);
7
7
  return n`${e}`;
8
8
  }
9
9
  export {
@@ -1,5 +1,4 @@
1
1
  import { UiKitElement } from '../base/UiKitElement.ts';
2
- import { type TemplateResult } from 'lit';
3
2
  import type { DsTextAttrs } from './ds-text.types.ts';
4
3
  declare const DsText_base: (new (...args: any[]) => import("../../mixins/ViewportMixin.ts").ViewportInterface) & typeof UiKitElement;
5
4
  export declare class DsText extends DsText_base {
@@ -12,9 +11,8 @@ export declare class DsText extends DsText_base {
12
11
  mode: DsTextAttrs['mode'];
13
12
  color: DsTextAttrs['color'];
14
13
  uppercase: DsTextAttrs['uppercase'];
14
+ slotedNodes: Array<Node>;
15
15
  private get classes();
16
- private get customElementTemplate();
17
- protected get styles(): import("lit").HTMLTemplateResult;
18
- render(): TemplateResult<1>;
16
+ render(): import("lit").TemplateResult;
19
17
  }
20
18
  export {};
@@ -6,7 +6,7 @@ export type DsTextAttrs = {
6
6
  size?: TextSize;
7
7
  weight?: TextWeight;
8
8
  variant?: TextVariant;
9
- 'html-tag-name'?: string;
9
+ 'html-tag-name'?: 'span' | 'p' | 'strong' | 'em' | 'small' | 'label' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
10
10
  value?: string;
11
11
  mode?: 'dark' | 'light';
12
12
  color?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-kit",
3
- "version": "2.0.0-canary.44",
3
+ "version": "2.0.0-canary.45",
4
4
  "description": "Web components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",