@cupra/ui-kit 2.0.0-canary.55 → 2.0.0-canary.57
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-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/components/ds-tooltip/ds-tooltip.cjs +27 -25
- package/dist/cjs/components/ds-tooltip/styles/common.styles.cjs +9 -2
- 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-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/components/ds-tooltip/ds-tooltip.js +82 -77
- package/dist/esm/components/ds-tooltip/styles/common.styles.js +9 -2
- 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-tooltip/ds-tooltip.d.ts +1 -2
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/components/ds-tooltip/ds-tooltip.cjs +27 -25
- package/dist-react/cjs/components/ds-tooltip/styles/common.styles.cjs +9 -2
- 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-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/components/ds-tooltip/ds-tooltip.js +82 -77
- package/dist-react/esm/components/ds-tooltip/styles/common.styles.js +9 -2
- 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-tooltip/ds-tooltip.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.57",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,32 +1,34 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../base/UiKitElement.cjs"),b=require("../../decorators/customUiKitElement.cjs"),r=require("../../node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs"),c=require("../../utils/booleanConverter.cjs"),g=require("../../utils/debounce.cjs"),P=require("../../utils/htmlWithTokens.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 h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),y=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),m=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs"),d=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),$=require("./styles/common.styles.cjs");var D=Object.defineProperty,E=Object.getOwnPropertyDescriptor,o=(u,e,t,s)=>{for(var i=s>1?void 0:s?E(e,t):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(i=(s?l(e,t,i):l(i))||i);return s&&i&&D(e,t,i),i};exports.DsTooltip=class extends v.UiKitElement{constructor(){super(...arguments),this.mode="light",this.show=!1,this.disableHoverListener=!1,this.disableFocusListener=!1,this.disablePressListener=!1,this.tooltipId=`ds-tooltip-${Date.now()}-${Math.floor(Math.random()*1e6)}`,this.usingKeyboard=!1,this.handleKeyDown=()=>{this.usingKeyboard=!0},this.handlePointerDown=()=>{this.usingKeyboard=!1},this.handleTooltipPointerDown=e=>{e.stopImmediatePropagation()},this.handleResize=g.debounce({func:()=>this.requestUpdate()}),this.handleClose=()=>{this.show=!1},this.handleAnchorPointerDown=e=>{this.disablePressListener||e.button===0&&(this.show=!this.show)},this.handleAnchorMouseOver=()=>{this.disableHoverListener||(this.show=!0)},this.handleAnchorMouseOut=()=>{this.disableHoverListener||setTimeout(()=>{var e,t,s,i,n;!((t=(e=this.container)==null?void 0:e.matches)!=null&&t.call(e,":hover"))&&!((i=(s=this.arrow)==null?void 0:s.matches)!=null&&i.call(s,":hover"))&&!((n=this==null?void 0:this.matches)!=null&&n.call(this,":hover"))&&(this.show=!1)},150)},this.handleAnchorFocusIn=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!0))},this.handleAnchorFocusOut=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!1))},this.handlePressOutside=e=>{var s;if(this.disablePressListener||e.button!==0)return;const t=e.target;t===this||this.contains(t)||(s=this.shadowRoot)!=null&&s.contains(t)||this.anchorElements[0]===t||this.anchorElements[0].contains(t)||(this.show=!1)}}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.container)!=null&&e.matches(":popover-open")&&this.container.hidePopover(),window.removeEventListener("resize",this.handleResize),document.removeEventListener("pointerdown",this.handlePressOutside),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("pointerdown",this.handlePointerDown)}updated(e){var t;document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("pointerdown",this.handlePointerDown),this.show&&this.container&&!this.container.matches(":popover-open")?this.container.showPopover():!this.show&&((t=this.container)!=null&&t.matches(":popover-open"))&&this.container.hidePopover(),this.updatePosition(),e.has("show")&&(this.show?(window.addEventListener("resize",this.handleResize),document.addEventListener("pointerdown",this.handlePressOutside)):(window.removeEventListener("resize",this.handleResize),document.removeEventListener("pointerdown",this.handlePressOutside)))}updatePosition(){requestAnimationFrame(()=>{var e;!this.anchorContainer||!this.container||!this.show||!((e=this.anchorElements)!=null&&e[0])||!(this.anchorContainer instanceof Element)||!(this.container instanceof Element)||!(this.arrow instanceof Element)||(r.computePosition(this.anchorContainer,this.container,{strategy:"fixed",placement:"bottom-start",middleware:[r.flip(),r.shift(),r.offset({mainAxis:8,crossAxis:-8}),r.arrow({element:this.arrow}),r.size({apply({availableWidth:t,availableHeight:s,elements:i}){Object.assign(i.floating.style,{maxWidth:`${Math.min(240,t-8)}px`,maxHeight:`${Math.max(0,s-8)}px`})}})]}).then(t=>{const{x:s,y:i,middlewareData:n,placement:l}=t;if(this.tooltopPlacement=l,Object.assign(this.container.style,{left:`${s??0}px`,top:`${i??0}px`}),n.arrow){const{x:w,y:f}=n.arrow;Object.assign(this.arrow.style,{left:w!=null?`${w}px`:"",top:f!=null?`${f}px`:""})}}),this.requestUpdate())})}get arrowClasses(){var e;return{arrow:!0,[this.mode]:!0,"not-positionable":(this==null?void 0:this.offsetWidth)>((e=this.container)==null?void 0:e.offsetWidth)}}get containerClasses(){return{container:!0,[this.tooltopPlacement]:!!this.tooltopPlacement,[this.mode]:!0}}get headerClasses(){var e,t;return{"header-container":!0,hidden:((e=this.headerElements)==null?void 0:e.length)===0&&((t=this.closeButtonElements)==null?void 0:t.length)===0}}get contentClasses(){var e;return{"content-container":!0,"ds-scroll":!0,"ds-scroll--size-s":!0,hidden:((e=this.contentElements)==null?void 0:e.length)===0}}get arrowTemplate(){return a.html`
|
|
2
2
|
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${d.classMap(this.arrowClasses)} @mouseout="${this.handleAnchorMouseOut}" aria-hidden="true" focusable="false">
|
|
3
3
|
<path d="M5.77946 4.38048L0.5 9L16 9L11.1427 4.46656C9.88663 3.29419 9.25858 2.708 8.48883 2.69565C7.71909 2.68329 7.07255 3.24902 5.77946 4.38048Z" fill="#26262C" class="ds-tooltip-arrow-background"/>
|
|
4
4
|
<path d="M0.5 8.5L5.89467 4.11683C7.1398 3.10516 7.76236 2.59933 8.49029 2.6109C9.21822 2.62246 9.8244 3.14782 11.0368 4.19853L16 8.5" stroke="#FAFAFA" stroke-opacity="0.3" stroke-linecap="round" class="ds-tooltip-arrow-border"/>
|
|
5
|
-
</svg>`}get tooltipTemplate(){return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
</svg>`}get tooltipTemplate(){return a.html`
|
|
6
|
+
<div
|
|
7
|
+
id=${this.tooltipId}
|
|
8
|
+
part="container"
|
|
9
|
+
class=${d.classMap(this.containerClasses)}
|
|
10
|
+
popover="manual"
|
|
11
|
+
@mouseout=${this.handleAnchorMouseOut}
|
|
12
|
+
role="tooltip"
|
|
13
|
+
@pointerdown=${this.handleTooltipPointerDown}
|
|
14
|
+
>
|
|
15
|
+
<header part="header" class=${d.classMap(this.headerClasses)}>
|
|
16
|
+
<slot @slotchange=${this.updatePosition} name="header"></slot>
|
|
17
|
+
<slot @slotchange=${this.updatePosition} name="close-button" @click=${this.handleClose}></slot>
|
|
18
|
+
</header>
|
|
19
|
+
<div part="content" class=${d.classMap(this.contentClasses)}>
|
|
20
|
+
<slot @slotchange=${this.updatePosition} name="content"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
<slot part="image" @slotchange=${this.updatePosition} name="image"></slot>
|
|
23
|
+
${this.arrowTemplate}
|
|
24
|
+
</div>
|
|
25
|
+
`}get styleTokens(){return P.htmlWithTokens`
|
|
24
26
|
<style>
|
|
25
27
|
:host {
|
|
26
28
|
color-scheme: ${this.mode};
|
|
27
29
|
}
|
|
28
30
|
</style>
|
|
29
|
-
`}render(){return
|
|
31
|
+
`}render(){return a.html`
|
|
30
32
|
<style>
|
|
31
33
|
.anchor {
|
|
32
34
|
cursor: ${this.disablePressListener?"default":"pointer"};
|
|
@@ -37,10 +39,10 @@
|
|
|
37
39
|
id="button"
|
|
38
40
|
class="anchor"
|
|
39
41
|
tabindex="0"
|
|
40
|
-
role=${this.disablePressListener?
|
|
42
|
+
role=${this.disablePressListener?a.nothing:"button"}
|
|
41
43
|
aria-controls=${this.tooltipId}
|
|
42
|
-
aria-expanded=${this.disablePressListener?
|
|
43
|
-
aria-describedby=${this.show?this.tooltipId:
|
|
44
|
+
aria-expanded=${this.disablePressListener?a.nothing:String(this.show)}
|
|
45
|
+
aria-describedby=${this.show?this.tooltipId:a.nothing}
|
|
44
46
|
aria-label="open tooltip"
|
|
45
47
|
@mouseover="${this.handleAnchorMouseOver}"
|
|
46
48
|
@mouseout="${this.handleAnchorMouseOut}"
|
|
@@ -51,4 +53,4 @@
|
|
|
51
53
|
<slot></slot>
|
|
52
54
|
</div>
|
|
53
55
|
${this.tooltipTemplate}
|
|
54
|
-
`}};exports.DsTooltip.styles=[$.commonStyles];o([h.property({type:String,reflect:!0})],exports.DsTooltip.prototype,"mode",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter})],exports.DsTooltip.prototype,"show",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-hover-listener"})],exports.DsTooltip.prototype,"disableHoverListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-focus-listener"})],exports.DsTooltip.prototype,"disableFocusListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-press-listener"})],exports.DsTooltip.prototype,"disablePressListener",2);o([
|
|
56
|
+
`}};exports.DsTooltip.styles=[$.commonStyles];o([h.property({type:String,reflect:!0})],exports.DsTooltip.prototype,"mode",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter})],exports.DsTooltip.prototype,"show",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-hover-listener"})],exports.DsTooltip.prototype,"disableHoverListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-focus-listener"})],exports.DsTooltip.prototype,"disableFocusListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-press-listener"})],exports.DsTooltip.prototype,"disablePressListener",2);o([y.state()],exports.DsTooltip.prototype,"tooltopPlacement",2);o([y.state()],exports.DsTooltip.prototype,"tooltipId",2);o([m.query(".container")],exports.DsTooltip.prototype,"container",2);o([m.query("#button")],exports.DsTooltip.prototype,"anchorContainer",2);o([m.query("#arrow")],exports.DsTooltip.prototype,"arrow",2);o([p.queryAssignedElements({slot:""})],exports.DsTooltip.prototype,"anchorElements",2);o([p.queryAssignedElements({slot:"header"})],exports.DsTooltip.prototype,"headerElements",2);o([p.queryAssignedElements({slot:"close-button"})],exports.DsTooltip.prototype,"closeButtonElements",2);o([p.queryAssignedElements({slot:"content"})],exports.DsTooltip.prototype,"contentElements",2);exports.DsTooltip=o([b.customUiKitElement("ds-tooltip")],exports.DsTooltip);
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
.container {
|
|
27
27
|
white-space: normal;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
display:
|
|
29
|
+
display: none;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
justify-content: center;
|
|
32
32
|
align-items: flex-start;
|
|
@@ -35,10 +35,17 @@
|
|
|
35
35
|
|
|
36
36
|
z-index: var(--ds-z-index-tooltip, 1300);
|
|
37
37
|
|
|
38
|
-
position:
|
|
38
|
+
position: fixed;
|
|
39
|
+
inset: auto;
|
|
40
|
+
margin: 0;
|
|
41
|
+
overflow: visible;
|
|
39
42
|
width: max-content;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
.container:popover-open {
|
|
46
|
+
display: flex;
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
::slotted([slot='image']) {
|
|
43
50
|
width: 100%;
|
|
44
51
|
height: auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.57"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.57"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.57/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-57"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-57"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.57", 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");
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
3
|
-
import { computePosition as g, flip as
|
|
4
|
-
import { booleanConverter as
|
|
1
|
+
import { UiKitElement as b } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as y } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { computePosition as g, flip as P, shift as $, offset as L, arrow as E, size as C } from "../../node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
4
|
+
import { booleanConverter as c } from "../../utils/booleanConverter.js";
|
|
5
5
|
import { debounce as x } from "../../utils/debounce.js";
|
|
6
|
-
import { htmlWithTokens as
|
|
6
|
+
import { htmlWithTokens as A } from "../../utils/htmlWithTokens.js";
|
|
7
7
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
8
|
-
import { html as
|
|
8
|
+
import { html as u, nothing as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
9
9
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
10
10
|
import { property as l } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
11
|
-
import { state as
|
|
11
|
+
import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
12
12
|
import { query as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
|
|
13
|
-
import { queryAssignedElements as
|
|
14
|
-
import { classMap as
|
|
15
|
-
import { commonStyles as
|
|
16
|
-
var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor,
|
|
17
|
-
for (var
|
|
18
|
-
(a = e[h]) && (
|
|
19
|
-
return n &&
|
|
13
|
+
import { queryAssignedElements as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
|
|
14
|
+
import { classMap as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
15
|
+
import { commonStyles as O } from "./styles/common.styles.js";
|
|
16
|
+
var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor, i = (e, t, o, n) => {
|
|
17
|
+
for (var r = n > 1 ? void 0 : n ? M(t, o) : t, h = e.length - 1, a; h >= 0; h--)
|
|
18
|
+
(a = e[h]) && (r = (n ? a(t, o, r) : a(r)) || r);
|
|
19
|
+
return n && r && D(t, o, r), r;
|
|
20
20
|
};
|
|
21
|
-
let s = class extends
|
|
21
|
+
let s = class extends b {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments), this.mode = "light", this.show = !1, this.disableHoverListener = !1, this.disableFocusListener = !1, this.disablePressListener = !1, this.tooltipId = `ds-tooltip-${Date.now()}-${Math.floor(Math.random() * 1e6)}`, this.usingKeyboard = !1, this.handleKeyDown = () => {
|
|
24
24
|
this.usingKeyboard = !0;
|
|
@@ -34,8 +34,8 @@ let s = class extends y {
|
|
|
34
34
|
this.disableHoverListener || (this.show = !0);
|
|
35
35
|
}, this.handleAnchorMouseOut = () => {
|
|
36
36
|
this.disableHoverListener || setTimeout(() => {
|
|
37
|
-
var e, t, o, n,
|
|
38
|
-
!((t = (e = this.container) == null ? void 0 : e.matches) != null && t.call(e, ":hover")) && !((n = (o = this.arrow) == null ? void 0 : o.matches) != null && n.call(o, ":hover")) && !((
|
|
37
|
+
var e, t, o, n, r;
|
|
38
|
+
!((t = (e = this.container) == null ? void 0 : e.matches) != null && t.call(e, ":hover")) && !((n = (o = this.arrow) == null ? void 0 : o.matches) != null && n.call(o, ":hover")) && !((r = this == null ? void 0 : this.matches) != null && r.call(this, ":hover")) && (this.show = !1);
|
|
39
39
|
}, 150);
|
|
40
40
|
}, this.handleAnchorFocusIn = () => {
|
|
41
41
|
this.usingKeyboard && (this.disableFocusListener || (this.show = !0));
|
|
@@ -49,20 +49,23 @@ let s = class extends y {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
disconnectedCallback() {
|
|
52
|
-
|
|
52
|
+
var e;
|
|
53
|
+
super.disconnectedCallback(), (e = this.container) != null && e.matches(":popover-open") && this.container.hidePopover(), window.removeEventListener("resize", this.handleResize), document.removeEventListener("pointerdown", this.handlePressOutside), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("pointerdown", this.handlePointerDown);
|
|
53
54
|
}
|
|
54
55
|
updated(e) {
|
|
55
|
-
|
|
56
|
+
var t;
|
|
57
|
+
document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("pointerdown", this.handlePointerDown), this.show && this.container && !this.container.matches(":popover-open") ? this.container.showPopover() : !this.show && ((t = this.container) != null && t.matches(":popover-open")) && this.container.hidePopover(), this.updatePosition(), e.has("show") && (this.show ? (window.addEventListener("resize", this.handleResize), document.addEventListener("pointerdown", this.handlePressOutside)) : (window.removeEventListener("resize", this.handleResize), document.removeEventListener("pointerdown", this.handlePressOutside)));
|
|
56
58
|
}
|
|
57
59
|
updatePosition() {
|
|
58
60
|
requestAnimationFrame(() => {
|
|
59
61
|
var e;
|
|
60
62
|
!this.anchorContainer || !this.container || !this.show || !((e = this.anchorElements) != null && e[0]) || !(this.anchorContainer instanceof Element) || !(this.container instanceof Element) || !(this.arrow instanceof Element) || (g(this.anchorContainer, this.container, {
|
|
63
|
+
strategy: "fixed",
|
|
61
64
|
placement: "bottom-start",
|
|
62
65
|
middleware: [
|
|
63
|
-
$(),
|
|
64
66
|
P(),
|
|
65
|
-
|
|
67
|
+
$(),
|
|
68
|
+
L({ mainAxis: 8, crossAxis: -8 }),
|
|
66
69
|
E({ element: this.arrow }),
|
|
67
70
|
C({
|
|
68
71
|
apply({ availableWidth: t, availableHeight: o, elements: n }) {
|
|
@@ -74,12 +77,12 @@ let s = class extends y {
|
|
|
74
77
|
})
|
|
75
78
|
]
|
|
76
79
|
}).then((t) => {
|
|
77
|
-
const { x: o, y: n, middlewareData:
|
|
80
|
+
const { x: o, y: n, middlewareData: r, placement: h } = t;
|
|
78
81
|
if (this.tooltopPlacement = h, Object.assign(this.container.style, {
|
|
79
82
|
left: `${o ?? 0}px`,
|
|
80
83
|
top: `${n ?? 0}px`
|
|
81
|
-
}),
|
|
82
|
-
const { x: a, y: w } =
|
|
84
|
+
}), r.arrow) {
|
|
85
|
+
const { x: a, y: w } = r.arrow;
|
|
83
86
|
Object.assign(this.arrow.style, {
|
|
84
87
|
left: a != null ? `${a}px` : "",
|
|
85
88
|
top: w != null ? `${w}px` : ""
|
|
@@ -120,35 +123,37 @@ let s = class extends y {
|
|
|
120
123
|
};
|
|
121
124
|
}
|
|
122
125
|
get arrowTemplate() {
|
|
123
|
-
return
|
|
124
|
-
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${
|
|
126
|
+
return u`
|
|
127
|
+
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${d(this.arrowClasses)} @mouseout="${this.handleAnchorMouseOut}" aria-hidden="true" focusable="false">
|
|
125
128
|
<path d="M5.77946 4.38048L0.5 9L16 9L11.1427 4.46656C9.88663 3.29419 9.25858 2.708 8.48883 2.69565C7.71909 2.68329 7.07255 3.24902 5.77946 4.38048Z" fill="#26262C" class="ds-tooltip-arrow-background"/>
|
|
126
129
|
<path d="M0.5 8.5L5.89467 4.11683C7.1398 3.10516 7.76236 2.59933 8.49029 2.6109C9.21822 2.62246 9.8244 3.14782 11.0368 4.19853L16 8.5" stroke="#FAFAFA" stroke-opacity="0.3" stroke-linecap="round" class="ds-tooltip-arrow-border"/>
|
|
127
130
|
</svg>`;
|
|
128
131
|
}
|
|
129
132
|
get tooltipTemplate() {
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
return u`
|
|
134
|
+
<div
|
|
135
|
+
id=${this.tooltipId}
|
|
136
|
+
part="container"
|
|
137
|
+
class=${d(this.containerClasses)}
|
|
138
|
+
popover="manual"
|
|
139
|
+
@mouseout=${this.handleAnchorMouseOut}
|
|
140
|
+
role="tooltip"
|
|
141
|
+
@pointerdown=${this.handleTooltipPointerDown}
|
|
142
|
+
>
|
|
143
|
+
<header part="header" class=${d(this.headerClasses)}>
|
|
144
|
+
<slot @slotchange=${this.updatePosition} name="header"></slot>
|
|
145
|
+
<slot @slotchange=${this.updatePosition} name="close-button" @click=${this.handleClose}></slot>
|
|
146
|
+
</header>
|
|
147
|
+
<div part="content" class=${d(this.contentClasses)}>
|
|
148
|
+
<slot @slotchange=${this.updatePosition} name="content"></slot>
|
|
149
|
+
</div>
|
|
150
|
+
<slot part="image" @slotchange=${this.updatePosition} name="image"></slot>
|
|
151
|
+
${this.arrowTemplate}
|
|
152
|
+
</div>
|
|
153
|
+
`;
|
|
149
154
|
}
|
|
150
155
|
get styleTokens() {
|
|
151
|
-
return
|
|
156
|
+
return A`
|
|
152
157
|
<style>
|
|
153
158
|
:host {
|
|
154
159
|
color-scheme: ${this.mode};
|
|
@@ -157,7 +162,7 @@ let s = class extends y {
|
|
|
157
162
|
`;
|
|
158
163
|
}
|
|
159
164
|
render() {
|
|
160
|
-
return
|
|
165
|
+
return u`
|
|
161
166
|
<style>
|
|
162
167
|
.anchor {
|
|
163
168
|
cursor: ${this.disablePressListener ? "default" : "pointer"};
|
|
@@ -168,10 +173,10 @@ let s = class extends y {
|
|
|
168
173
|
id="button"
|
|
169
174
|
class="anchor"
|
|
170
175
|
tabindex="0"
|
|
171
|
-
role=${this.disablePressListener ?
|
|
176
|
+
role=${this.disablePressListener ? m : "button"}
|
|
172
177
|
aria-controls=${this.tooltipId}
|
|
173
|
-
aria-expanded=${this.disablePressListener ?
|
|
174
|
-
aria-describedby=${this.show ? this.tooltipId :
|
|
178
|
+
aria-expanded=${this.disablePressListener ? m : String(this.show)}
|
|
179
|
+
aria-describedby=${this.show ? this.tooltipId : m}
|
|
175
180
|
aria-label="open tooltip"
|
|
176
181
|
@mouseover="${this.handleAnchorMouseOver}"
|
|
177
182
|
@mouseout="${this.handleAnchorMouseOut}"
|
|
@@ -185,51 +190,51 @@ let s = class extends y {
|
|
|
185
190
|
`;
|
|
186
191
|
}
|
|
187
192
|
};
|
|
188
|
-
s.styles = [
|
|
189
|
-
|
|
193
|
+
s.styles = [O];
|
|
194
|
+
i([
|
|
190
195
|
l({ type: String, reflect: !0 })
|
|
191
196
|
], s.prototype, "mode", 2);
|
|
192
|
-
|
|
193
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
197
|
+
i([
|
|
198
|
+
l({ type: Boolean, reflect: !0, converter: c })
|
|
194
199
|
], s.prototype, "show", 2);
|
|
195
|
-
|
|
196
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
200
|
+
i([
|
|
201
|
+
l({ type: Boolean, reflect: !0, converter: c, attribute: "disable-hover-listener" })
|
|
197
202
|
], s.prototype, "disableHoverListener", 2);
|
|
198
|
-
|
|
199
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
203
|
+
i([
|
|
204
|
+
l({ type: Boolean, reflect: !0, converter: c, attribute: "disable-focus-listener" })
|
|
200
205
|
], s.prototype, "disableFocusListener", 2);
|
|
201
|
-
|
|
202
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
206
|
+
i([
|
|
207
|
+
l({ type: Boolean, reflect: !0, converter: c, attribute: "disable-press-listener" })
|
|
203
208
|
], s.prototype, "disablePressListener", 2);
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
i([
|
|
210
|
+
v()
|
|
206
211
|
], s.prototype, "tooltopPlacement", 2);
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
i([
|
|
213
|
+
v()
|
|
209
214
|
], s.prototype, "tooltipId", 2);
|
|
210
|
-
|
|
215
|
+
i([
|
|
211
216
|
f(".container")
|
|
212
217
|
], s.prototype, "container", 2);
|
|
213
|
-
|
|
218
|
+
i([
|
|
214
219
|
f("#button")
|
|
215
220
|
], s.prototype, "anchorContainer", 2);
|
|
216
|
-
|
|
221
|
+
i([
|
|
217
222
|
f("#arrow")
|
|
218
223
|
], s.prototype, "arrow", 2);
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
i([
|
|
225
|
+
p({ slot: "" })
|
|
221
226
|
], s.prototype, "anchorElements", 2);
|
|
222
|
-
|
|
223
|
-
|
|
227
|
+
i([
|
|
228
|
+
p({ slot: "header" })
|
|
224
229
|
], s.prototype, "headerElements", 2);
|
|
225
|
-
|
|
226
|
-
|
|
230
|
+
i([
|
|
231
|
+
p({ slot: "close-button" })
|
|
227
232
|
], s.prototype, "closeButtonElements", 2);
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
i([
|
|
234
|
+
p({ slot: "content" })
|
|
230
235
|
], s.prototype, "contentElements", 2);
|
|
231
|
-
s =
|
|
232
|
-
|
|
236
|
+
s = i([
|
|
237
|
+
y("ds-tooltip")
|
|
233
238
|
], s);
|
|
234
239
|
export {
|
|
235
240
|
s as DsTooltip
|
|
@@ -30,7 +30,7 @@ const n = t`
|
|
|
30
30
|
.container {
|
|
31
31
|
white-space: normal;
|
|
32
32
|
box-sizing: border-box;
|
|
33
|
-
display:
|
|
33
|
+
display: none;
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
justify-content: center;
|
|
36
36
|
align-items: flex-start;
|
|
@@ -39,10 +39,17 @@ const n = t`
|
|
|
39
39
|
|
|
40
40
|
z-index: var(--ds-z-index-tooltip, 1300);
|
|
41
41
|
|
|
42
|
-
position:
|
|
42
|
+
position: fixed;
|
|
43
|
+
inset: auto;
|
|
44
|
+
margin: 0;
|
|
45
|
+
overflow: visible;
|
|
43
46
|
width: max-content;
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
.container:popover-open {
|
|
50
|
+
display: flex;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
::slotted([slot='image']) {
|
|
47
54
|
width: 100%;
|
|
48
55
|
height: auto;
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.57"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
package/dist/esm/utils/PubSub.js
CHANGED
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.57"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -5,7 +5,7 @@ class s {
|
|
|
5
5
|
theme: t
|
|
6
6
|
}) => {
|
|
7
7
|
if (!t || !e) return;
|
|
8
|
-
const r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
8
|
+
const r = `https://ds-assets.cupra.com/2.0.0-canary.57/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
|
|
9
9
|
if (c) return c;
|
|
10
10
|
const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
|
|
11
11
|
return this.stylePromises.set(r, i), this.stylePromises.get(r);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-57"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-57"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
2
|
import { type Placement } from '@floating-ui/dom';
|
|
3
|
-
import { nothing } from 'lit';
|
|
4
3
|
import type { DsTooltipAttrs } from './ds-tooltip.types';
|
|
5
4
|
export declare class DsTooltip extends UiKitElement {
|
|
6
5
|
static styles: import("lit").CSSResult[];
|
|
@@ -47,7 +46,7 @@ export declare class DsTooltip extends UiKitElement {
|
|
|
47
46
|
};
|
|
48
47
|
protected handleClose: () => void;
|
|
49
48
|
protected get arrowTemplate(): import("lit").TemplateResult<1>;
|
|
50
|
-
protected get tooltipTemplate():
|
|
49
|
+
protected get tooltipTemplate(): import("lit").TemplateResult<1>;
|
|
51
50
|
protected get styleTokens(): import("lit").HTMLTemplateResult;
|
|
52
51
|
protected handleAnchorPointerDown: (event: PointerEvent) => void;
|
|
53
52
|
protected handleAnchorMouseOver: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.57",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,32 +1,34 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../base/UiKitElement.cjs"),b=require("../../decorators/customUiKitElement.cjs"),r=require("../../node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs"),c=require("../../utils/booleanConverter.cjs"),g=require("../../utils/debounce.cjs"),P=require("../../utils/htmlWithTokens.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 h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),y=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),m=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs"),d=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),$=require("./styles/common.styles.cjs");var D=Object.defineProperty,E=Object.getOwnPropertyDescriptor,o=(u,e,t,s)=>{for(var i=s>1?void 0:s?E(e,t):e,n=u.length-1,l;n>=0;n--)(l=u[n])&&(i=(s?l(e,t,i):l(i))||i);return s&&i&&D(e,t,i),i};exports.DsTooltip=class extends v.UiKitElement{constructor(){super(...arguments),this.mode="light",this.show=!1,this.disableHoverListener=!1,this.disableFocusListener=!1,this.disablePressListener=!1,this.tooltipId=`ds-tooltip-${Date.now()}-${Math.floor(Math.random()*1e6)}`,this.usingKeyboard=!1,this.handleKeyDown=()=>{this.usingKeyboard=!0},this.handlePointerDown=()=>{this.usingKeyboard=!1},this.handleTooltipPointerDown=e=>{e.stopImmediatePropagation()},this.handleResize=g.debounce({func:()=>this.requestUpdate()}),this.handleClose=()=>{this.show=!1},this.handleAnchorPointerDown=e=>{this.disablePressListener||e.button===0&&(this.show=!this.show)},this.handleAnchorMouseOver=()=>{this.disableHoverListener||(this.show=!0)},this.handleAnchorMouseOut=()=>{this.disableHoverListener||setTimeout(()=>{var e,t,s,i,n;!((t=(e=this.container)==null?void 0:e.matches)!=null&&t.call(e,":hover"))&&!((i=(s=this.arrow)==null?void 0:s.matches)!=null&&i.call(s,":hover"))&&!((n=this==null?void 0:this.matches)!=null&&n.call(this,":hover"))&&(this.show=!1)},150)},this.handleAnchorFocusIn=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!0))},this.handleAnchorFocusOut=()=>{this.usingKeyboard&&(this.disableFocusListener||(this.show=!1))},this.handlePressOutside=e=>{var s;if(this.disablePressListener||e.button!==0)return;const t=e.target;t===this||this.contains(t)||(s=this.shadowRoot)!=null&&s.contains(t)||this.anchorElements[0]===t||this.anchorElements[0].contains(t)||(this.show=!1)}}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.container)!=null&&e.matches(":popover-open")&&this.container.hidePopover(),window.removeEventListener("resize",this.handleResize),document.removeEventListener("pointerdown",this.handlePressOutside),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("pointerdown",this.handlePointerDown)}updated(e){var t;document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("pointerdown",this.handlePointerDown),this.show&&this.container&&!this.container.matches(":popover-open")?this.container.showPopover():!this.show&&((t=this.container)!=null&&t.matches(":popover-open"))&&this.container.hidePopover(),this.updatePosition(),e.has("show")&&(this.show?(window.addEventListener("resize",this.handleResize),document.addEventListener("pointerdown",this.handlePressOutside)):(window.removeEventListener("resize",this.handleResize),document.removeEventListener("pointerdown",this.handlePressOutside)))}updatePosition(){requestAnimationFrame(()=>{var e;!this.anchorContainer||!this.container||!this.show||!((e=this.anchorElements)!=null&&e[0])||!(this.anchorContainer instanceof Element)||!(this.container instanceof Element)||!(this.arrow instanceof Element)||(r.computePosition(this.anchorContainer,this.container,{strategy:"fixed",placement:"bottom-start",middleware:[r.flip(),r.shift(),r.offset({mainAxis:8,crossAxis:-8}),r.arrow({element:this.arrow}),r.size({apply({availableWidth:t,availableHeight:s,elements:i}){Object.assign(i.floating.style,{maxWidth:`${Math.min(240,t-8)}px`,maxHeight:`${Math.max(0,s-8)}px`})}})]}).then(t=>{const{x:s,y:i,middlewareData:n,placement:l}=t;if(this.tooltopPlacement=l,Object.assign(this.container.style,{left:`${s??0}px`,top:`${i??0}px`}),n.arrow){const{x:w,y:f}=n.arrow;Object.assign(this.arrow.style,{left:w!=null?`${w}px`:"",top:f!=null?`${f}px`:""})}}),this.requestUpdate())})}get arrowClasses(){var e;return{arrow:!0,[this.mode]:!0,"not-positionable":(this==null?void 0:this.offsetWidth)>((e=this.container)==null?void 0:e.offsetWidth)}}get containerClasses(){return{container:!0,[this.tooltopPlacement]:!!this.tooltopPlacement,[this.mode]:!0}}get headerClasses(){var e,t;return{"header-container":!0,hidden:((e=this.headerElements)==null?void 0:e.length)===0&&((t=this.closeButtonElements)==null?void 0:t.length)===0}}get contentClasses(){var e;return{"content-container":!0,"ds-scroll":!0,"ds-scroll--size-s":!0,hidden:((e=this.contentElements)==null?void 0:e.length)===0}}get arrowTemplate(){return a.html`
|
|
2
2
|
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${d.classMap(this.arrowClasses)} @mouseout="${this.handleAnchorMouseOut}" aria-hidden="true" focusable="false">
|
|
3
3
|
<path d="M5.77946 4.38048L0.5 9L16 9L11.1427 4.46656C9.88663 3.29419 9.25858 2.708 8.48883 2.69565C7.71909 2.68329 7.07255 3.24902 5.77946 4.38048Z" fill="#26262C" class="ds-tooltip-arrow-background"/>
|
|
4
4
|
<path d="M0.5 8.5L5.89467 4.11683C7.1398 3.10516 7.76236 2.59933 8.49029 2.6109C9.21822 2.62246 9.8244 3.14782 11.0368 4.19853L16 8.5" stroke="#FAFAFA" stroke-opacity="0.3" stroke-linecap="round" class="ds-tooltip-arrow-border"/>
|
|
5
|
-
</svg>`}get tooltipTemplate(){return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
</svg>`}get tooltipTemplate(){return a.html`
|
|
6
|
+
<div
|
|
7
|
+
id=${this.tooltipId}
|
|
8
|
+
part="container"
|
|
9
|
+
class=${d.classMap(this.containerClasses)}
|
|
10
|
+
popover="manual"
|
|
11
|
+
@mouseout=${this.handleAnchorMouseOut}
|
|
12
|
+
role="tooltip"
|
|
13
|
+
@pointerdown=${this.handleTooltipPointerDown}
|
|
14
|
+
>
|
|
15
|
+
<header part="header" class=${d.classMap(this.headerClasses)}>
|
|
16
|
+
<slot @slotchange=${this.updatePosition} name="header"></slot>
|
|
17
|
+
<slot @slotchange=${this.updatePosition} name="close-button" @click=${this.handleClose}></slot>
|
|
18
|
+
</header>
|
|
19
|
+
<div part="content" class=${d.classMap(this.contentClasses)}>
|
|
20
|
+
<slot @slotchange=${this.updatePosition} name="content"></slot>
|
|
21
|
+
</div>
|
|
22
|
+
<slot part="image" @slotchange=${this.updatePosition} name="image"></slot>
|
|
23
|
+
${this.arrowTemplate}
|
|
24
|
+
</div>
|
|
25
|
+
`}get styleTokens(){return P.htmlWithTokens`
|
|
24
26
|
<style>
|
|
25
27
|
:host {
|
|
26
28
|
color-scheme: ${this.mode};
|
|
27
29
|
}
|
|
28
30
|
</style>
|
|
29
|
-
`}render(){return
|
|
31
|
+
`}render(){return a.html`
|
|
30
32
|
<style>
|
|
31
33
|
.anchor {
|
|
32
34
|
cursor: ${this.disablePressListener?"default":"pointer"};
|
|
@@ -37,10 +39,10 @@
|
|
|
37
39
|
id="button"
|
|
38
40
|
class="anchor"
|
|
39
41
|
tabindex="0"
|
|
40
|
-
role=${this.disablePressListener?
|
|
42
|
+
role=${this.disablePressListener?a.nothing:"button"}
|
|
41
43
|
aria-controls=${this.tooltipId}
|
|
42
|
-
aria-expanded=${this.disablePressListener?
|
|
43
|
-
aria-describedby=${this.show?this.tooltipId:
|
|
44
|
+
aria-expanded=${this.disablePressListener?a.nothing:String(this.show)}
|
|
45
|
+
aria-describedby=${this.show?this.tooltipId:a.nothing}
|
|
44
46
|
aria-label="open tooltip"
|
|
45
47
|
@mouseover="${this.handleAnchorMouseOver}"
|
|
46
48
|
@mouseout="${this.handleAnchorMouseOut}"
|
|
@@ -51,4 +53,4 @@
|
|
|
51
53
|
<slot></slot>
|
|
52
54
|
</div>
|
|
53
55
|
${this.tooltipTemplate}
|
|
54
|
-
`}};exports.DsTooltip.styles=[$.commonStyles];o([h.property({type:String,reflect:!0})],exports.DsTooltip.prototype,"mode",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter})],exports.DsTooltip.prototype,"show",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-hover-listener"})],exports.DsTooltip.prototype,"disableHoverListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-focus-listener"})],exports.DsTooltip.prototype,"disableFocusListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-press-listener"})],exports.DsTooltip.prototype,"disablePressListener",2);o([
|
|
56
|
+
`}};exports.DsTooltip.styles=[$.commonStyles];o([h.property({type:String,reflect:!0})],exports.DsTooltip.prototype,"mode",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter})],exports.DsTooltip.prototype,"show",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-hover-listener"})],exports.DsTooltip.prototype,"disableHoverListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-focus-listener"})],exports.DsTooltip.prototype,"disableFocusListener",2);o([h.property({type:Boolean,reflect:!0,converter:c.booleanConverter,attribute:"disable-press-listener"})],exports.DsTooltip.prototype,"disablePressListener",2);o([y.state()],exports.DsTooltip.prototype,"tooltopPlacement",2);o([y.state()],exports.DsTooltip.prototype,"tooltipId",2);o([m.query(".container")],exports.DsTooltip.prototype,"container",2);o([m.query("#button")],exports.DsTooltip.prototype,"anchorContainer",2);o([m.query("#arrow")],exports.DsTooltip.prototype,"arrow",2);o([p.queryAssignedElements({slot:""})],exports.DsTooltip.prototype,"anchorElements",2);o([p.queryAssignedElements({slot:"header"})],exports.DsTooltip.prototype,"headerElements",2);o([p.queryAssignedElements({slot:"close-button"})],exports.DsTooltip.prototype,"closeButtonElements",2);o([p.queryAssignedElements({slot:"content"})],exports.DsTooltip.prototype,"contentElements",2);exports.DsTooltip=o([b.customUiKitElement("ds-tooltip")],exports.DsTooltip);
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
.container {
|
|
27
27
|
white-space: normal;
|
|
28
28
|
box-sizing: border-box;
|
|
29
|
-
display:
|
|
29
|
+
display: none;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
justify-content: center;
|
|
32
32
|
align-items: flex-start;
|
|
@@ -35,10 +35,17 @@
|
|
|
35
35
|
|
|
36
36
|
z-index: var(--ds-z-index-tooltip, 1300);
|
|
37
37
|
|
|
38
|
-
position:
|
|
38
|
+
position: fixed;
|
|
39
|
+
inset: auto;
|
|
40
|
+
margin: 0;
|
|
41
|
+
overflow: visible;
|
|
39
42
|
width: max-content;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
.container:popover-open {
|
|
46
|
+
display: flex;
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
::slotted([slot='image']) {
|
|
43
50
|
width: 100%;
|
|
44
51
|
height: auto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.57"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.57"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.57/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-57"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-57"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.57", 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");
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { customUiKitElement as
|
|
3
|
-
import { computePosition as g, flip as
|
|
4
|
-
import { booleanConverter as
|
|
1
|
+
import { UiKitElement as b } from "../base/UiKitElement.js";
|
|
2
|
+
import { customUiKitElement as y } from "../../decorators/customUiKitElement.js";
|
|
3
|
+
import { computePosition as g, flip as P, shift as $, offset as L, arrow as E, size as C } from "../../node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js";
|
|
4
|
+
import { booleanConverter as c } from "../../utils/booleanConverter.js";
|
|
5
5
|
import { debounce as x } from "../../utils/debounce.js";
|
|
6
|
-
import { htmlWithTokens as
|
|
6
|
+
import { htmlWithTokens as A } from "../../utils/htmlWithTokens.js";
|
|
7
7
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
8
|
-
import { html as
|
|
8
|
+
import { html as u, nothing as m } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
9
9
|
import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
10
10
|
import { property as l } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
11
|
-
import { state as
|
|
11
|
+
import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
12
12
|
import { query as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
|
|
13
|
-
import { queryAssignedElements as
|
|
14
|
-
import { classMap as
|
|
15
|
-
import { commonStyles as
|
|
16
|
-
var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor,
|
|
17
|
-
for (var
|
|
18
|
-
(a = e[h]) && (
|
|
19
|
-
return n &&
|
|
13
|
+
import { queryAssignedElements as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
|
|
14
|
+
import { classMap as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
15
|
+
import { commonStyles as O } from "./styles/common.styles.js";
|
|
16
|
+
var D = Object.defineProperty, M = Object.getOwnPropertyDescriptor, i = (e, t, o, n) => {
|
|
17
|
+
for (var r = n > 1 ? void 0 : n ? M(t, o) : t, h = e.length - 1, a; h >= 0; h--)
|
|
18
|
+
(a = e[h]) && (r = (n ? a(t, o, r) : a(r)) || r);
|
|
19
|
+
return n && r && D(t, o, r), r;
|
|
20
20
|
};
|
|
21
|
-
let s = class extends
|
|
21
|
+
let s = class extends b {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(...arguments), this.mode = "light", this.show = !1, this.disableHoverListener = !1, this.disableFocusListener = !1, this.disablePressListener = !1, this.tooltipId = `ds-tooltip-${Date.now()}-${Math.floor(Math.random() * 1e6)}`, this.usingKeyboard = !1, this.handleKeyDown = () => {
|
|
24
24
|
this.usingKeyboard = !0;
|
|
@@ -34,8 +34,8 @@ let s = class extends y {
|
|
|
34
34
|
this.disableHoverListener || (this.show = !0);
|
|
35
35
|
}, this.handleAnchorMouseOut = () => {
|
|
36
36
|
this.disableHoverListener || setTimeout(() => {
|
|
37
|
-
var e, t, o, n,
|
|
38
|
-
!((t = (e = this.container) == null ? void 0 : e.matches) != null && t.call(e, ":hover")) && !((n = (o = this.arrow) == null ? void 0 : o.matches) != null && n.call(o, ":hover")) && !((
|
|
37
|
+
var e, t, o, n, r;
|
|
38
|
+
!((t = (e = this.container) == null ? void 0 : e.matches) != null && t.call(e, ":hover")) && !((n = (o = this.arrow) == null ? void 0 : o.matches) != null && n.call(o, ":hover")) && !((r = this == null ? void 0 : this.matches) != null && r.call(this, ":hover")) && (this.show = !1);
|
|
39
39
|
}, 150);
|
|
40
40
|
}, this.handleAnchorFocusIn = () => {
|
|
41
41
|
this.usingKeyboard && (this.disableFocusListener || (this.show = !0));
|
|
@@ -49,20 +49,23 @@ let s = class extends y {
|
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
disconnectedCallback() {
|
|
52
|
-
|
|
52
|
+
var e;
|
|
53
|
+
super.disconnectedCallback(), (e = this.container) != null && e.matches(":popover-open") && this.container.hidePopover(), window.removeEventListener("resize", this.handleResize), document.removeEventListener("pointerdown", this.handlePressOutside), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("pointerdown", this.handlePointerDown);
|
|
53
54
|
}
|
|
54
55
|
updated(e) {
|
|
55
|
-
|
|
56
|
+
var t;
|
|
57
|
+
document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("pointerdown", this.handlePointerDown), this.show && this.container && !this.container.matches(":popover-open") ? this.container.showPopover() : !this.show && ((t = this.container) != null && t.matches(":popover-open")) && this.container.hidePopover(), this.updatePosition(), e.has("show") && (this.show ? (window.addEventListener("resize", this.handleResize), document.addEventListener("pointerdown", this.handlePressOutside)) : (window.removeEventListener("resize", this.handleResize), document.removeEventListener("pointerdown", this.handlePressOutside)));
|
|
56
58
|
}
|
|
57
59
|
updatePosition() {
|
|
58
60
|
requestAnimationFrame(() => {
|
|
59
61
|
var e;
|
|
60
62
|
!this.anchorContainer || !this.container || !this.show || !((e = this.anchorElements) != null && e[0]) || !(this.anchorContainer instanceof Element) || !(this.container instanceof Element) || !(this.arrow instanceof Element) || (g(this.anchorContainer, this.container, {
|
|
63
|
+
strategy: "fixed",
|
|
61
64
|
placement: "bottom-start",
|
|
62
65
|
middleware: [
|
|
63
|
-
$(),
|
|
64
66
|
P(),
|
|
65
|
-
|
|
67
|
+
$(),
|
|
68
|
+
L({ mainAxis: 8, crossAxis: -8 }),
|
|
66
69
|
E({ element: this.arrow }),
|
|
67
70
|
C({
|
|
68
71
|
apply({ availableWidth: t, availableHeight: o, elements: n }) {
|
|
@@ -74,12 +77,12 @@ let s = class extends y {
|
|
|
74
77
|
})
|
|
75
78
|
]
|
|
76
79
|
}).then((t) => {
|
|
77
|
-
const { x: o, y: n, middlewareData:
|
|
80
|
+
const { x: o, y: n, middlewareData: r, placement: h } = t;
|
|
78
81
|
if (this.tooltopPlacement = h, Object.assign(this.container.style, {
|
|
79
82
|
left: `${o ?? 0}px`,
|
|
80
83
|
top: `${n ?? 0}px`
|
|
81
|
-
}),
|
|
82
|
-
const { x: a, y: w } =
|
|
84
|
+
}), r.arrow) {
|
|
85
|
+
const { x: a, y: w } = r.arrow;
|
|
83
86
|
Object.assign(this.arrow.style, {
|
|
84
87
|
left: a != null ? `${a}px` : "",
|
|
85
88
|
top: w != null ? `${w}px` : ""
|
|
@@ -120,35 +123,37 @@ let s = class extends y {
|
|
|
120
123
|
};
|
|
121
124
|
}
|
|
122
125
|
get arrowTemplate() {
|
|
123
|
-
return
|
|
124
|
-
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${
|
|
126
|
+
return u`
|
|
127
|
+
<svg id="arrow" xmlns="http://www.w3.org/2000/svg" width="17" height="9" viewBox="0 0 17 9" fill="none" class=${d(this.arrowClasses)} @mouseout="${this.handleAnchorMouseOut}" aria-hidden="true" focusable="false">
|
|
125
128
|
<path d="M5.77946 4.38048L0.5 9L16 9L11.1427 4.46656C9.88663 3.29419 9.25858 2.708 8.48883 2.69565C7.71909 2.68329 7.07255 3.24902 5.77946 4.38048Z" fill="#26262C" class="ds-tooltip-arrow-background"/>
|
|
126
129
|
<path d="M0.5 8.5L5.89467 4.11683C7.1398 3.10516 7.76236 2.59933 8.49029 2.6109C9.21822 2.62246 9.8244 3.14782 11.0368 4.19853L16 8.5" stroke="#FAFAFA" stroke-opacity="0.3" stroke-linecap="round" class="ds-tooltip-arrow-border"/>
|
|
127
130
|
</svg>`;
|
|
128
131
|
}
|
|
129
132
|
get tooltipTemplate() {
|
|
130
|
-
return
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
133
|
+
return u`
|
|
134
|
+
<div
|
|
135
|
+
id=${this.tooltipId}
|
|
136
|
+
part="container"
|
|
137
|
+
class=${d(this.containerClasses)}
|
|
138
|
+
popover="manual"
|
|
139
|
+
@mouseout=${this.handleAnchorMouseOut}
|
|
140
|
+
role="tooltip"
|
|
141
|
+
@pointerdown=${this.handleTooltipPointerDown}
|
|
142
|
+
>
|
|
143
|
+
<header part="header" class=${d(this.headerClasses)}>
|
|
144
|
+
<slot @slotchange=${this.updatePosition} name="header"></slot>
|
|
145
|
+
<slot @slotchange=${this.updatePosition} name="close-button" @click=${this.handleClose}></slot>
|
|
146
|
+
</header>
|
|
147
|
+
<div part="content" class=${d(this.contentClasses)}>
|
|
148
|
+
<slot @slotchange=${this.updatePosition} name="content"></slot>
|
|
149
|
+
</div>
|
|
150
|
+
<slot part="image" @slotchange=${this.updatePosition} name="image"></slot>
|
|
151
|
+
${this.arrowTemplate}
|
|
152
|
+
</div>
|
|
153
|
+
`;
|
|
149
154
|
}
|
|
150
155
|
get styleTokens() {
|
|
151
|
-
return
|
|
156
|
+
return A`
|
|
152
157
|
<style>
|
|
153
158
|
:host {
|
|
154
159
|
color-scheme: ${this.mode};
|
|
@@ -157,7 +162,7 @@ let s = class extends y {
|
|
|
157
162
|
`;
|
|
158
163
|
}
|
|
159
164
|
render() {
|
|
160
|
-
return
|
|
165
|
+
return u`
|
|
161
166
|
<style>
|
|
162
167
|
.anchor {
|
|
163
168
|
cursor: ${this.disablePressListener ? "default" : "pointer"};
|
|
@@ -168,10 +173,10 @@ let s = class extends y {
|
|
|
168
173
|
id="button"
|
|
169
174
|
class="anchor"
|
|
170
175
|
tabindex="0"
|
|
171
|
-
role=${this.disablePressListener ?
|
|
176
|
+
role=${this.disablePressListener ? m : "button"}
|
|
172
177
|
aria-controls=${this.tooltipId}
|
|
173
|
-
aria-expanded=${this.disablePressListener ?
|
|
174
|
-
aria-describedby=${this.show ? this.tooltipId :
|
|
178
|
+
aria-expanded=${this.disablePressListener ? m : String(this.show)}
|
|
179
|
+
aria-describedby=${this.show ? this.tooltipId : m}
|
|
175
180
|
aria-label="open tooltip"
|
|
176
181
|
@mouseover="${this.handleAnchorMouseOver}"
|
|
177
182
|
@mouseout="${this.handleAnchorMouseOut}"
|
|
@@ -185,51 +190,51 @@ let s = class extends y {
|
|
|
185
190
|
`;
|
|
186
191
|
}
|
|
187
192
|
};
|
|
188
|
-
s.styles = [
|
|
189
|
-
|
|
193
|
+
s.styles = [O];
|
|
194
|
+
i([
|
|
190
195
|
l({ type: String, reflect: !0 })
|
|
191
196
|
], s.prototype, "mode", 2);
|
|
192
|
-
|
|
193
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
197
|
+
i([
|
|
198
|
+
l({ type: Boolean, reflect: !0, converter: c })
|
|
194
199
|
], s.prototype, "show", 2);
|
|
195
|
-
|
|
196
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
200
|
+
i([
|
|
201
|
+
l({ type: Boolean, reflect: !0, converter: c, attribute: "disable-hover-listener" })
|
|
197
202
|
], s.prototype, "disableHoverListener", 2);
|
|
198
|
-
|
|
199
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
203
|
+
i([
|
|
204
|
+
l({ type: Boolean, reflect: !0, converter: c, attribute: "disable-focus-listener" })
|
|
200
205
|
], s.prototype, "disableFocusListener", 2);
|
|
201
|
-
|
|
202
|
-
l({ type: Boolean, reflect: !0, converter:
|
|
206
|
+
i([
|
|
207
|
+
l({ type: Boolean, reflect: !0, converter: c, attribute: "disable-press-listener" })
|
|
203
208
|
], s.prototype, "disablePressListener", 2);
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
i([
|
|
210
|
+
v()
|
|
206
211
|
], s.prototype, "tooltopPlacement", 2);
|
|
207
|
-
|
|
208
|
-
|
|
212
|
+
i([
|
|
213
|
+
v()
|
|
209
214
|
], s.prototype, "tooltipId", 2);
|
|
210
|
-
|
|
215
|
+
i([
|
|
211
216
|
f(".container")
|
|
212
217
|
], s.prototype, "container", 2);
|
|
213
|
-
|
|
218
|
+
i([
|
|
214
219
|
f("#button")
|
|
215
220
|
], s.prototype, "anchorContainer", 2);
|
|
216
|
-
|
|
221
|
+
i([
|
|
217
222
|
f("#arrow")
|
|
218
223
|
], s.prototype, "arrow", 2);
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
i([
|
|
225
|
+
p({ slot: "" })
|
|
221
226
|
], s.prototype, "anchorElements", 2);
|
|
222
|
-
|
|
223
|
-
|
|
227
|
+
i([
|
|
228
|
+
p({ slot: "header" })
|
|
224
229
|
], s.prototype, "headerElements", 2);
|
|
225
|
-
|
|
226
|
-
|
|
230
|
+
i([
|
|
231
|
+
p({ slot: "close-button" })
|
|
227
232
|
], s.prototype, "closeButtonElements", 2);
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
i([
|
|
234
|
+
p({ slot: "content" })
|
|
230
235
|
], s.prototype, "contentElements", 2);
|
|
231
|
-
s =
|
|
232
|
-
|
|
236
|
+
s = i([
|
|
237
|
+
y("ds-tooltip")
|
|
233
238
|
], s);
|
|
234
239
|
export {
|
|
235
240
|
s as DsTooltip
|
|
@@ -30,7 +30,7 @@ const n = t`
|
|
|
30
30
|
.container {
|
|
31
31
|
white-space: normal;
|
|
32
32
|
box-sizing: border-box;
|
|
33
|
-
display:
|
|
33
|
+
display: none;
|
|
34
34
|
flex-direction: column;
|
|
35
35
|
justify-content: center;
|
|
36
36
|
align-items: flex-start;
|
|
@@ -39,10 +39,17 @@ const n = t`
|
|
|
39
39
|
|
|
40
40
|
z-index: var(--ds-z-index-tooltip, 1300);
|
|
41
41
|
|
|
42
|
-
position:
|
|
42
|
+
position: fixed;
|
|
43
|
+
inset: auto;
|
|
44
|
+
margin: 0;
|
|
45
|
+
overflow: visible;
|
|
43
46
|
width: max-content;
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
.container:popover-open {
|
|
50
|
+
display: flex;
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
::slotted([slot='image']) {
|
|
47
54
|
width: 100%;
|
|
48
55
|
height: auto;
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.57"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.57"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -5,7 +5,7 @@ class s {
|
|
|
5
5
|
theme: t
|
|
6
6
|
}) => {
|
|
7
7
|
if (!t || !e) return;
|
|
8
|
-
const r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
8
|
+
const r = `https://ds-assets.cupra.com/2.0.0-canary.57/styles/${t}/components/${e}.css`, c = this.getCachedStyleSheetPromise({ url: r });
|
|
9
9
|
if (c) return c;
|
|
10
10
|
const i = this.fetchStyle({ url: r }).then((n) => (n || this.stylePromises.delete(r), n));
|
|
11
11
|
return this.stylePromises.set(r, i), this.stylePromises.get(r);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-57"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-57"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
2
|
import { type Placement } from '@floating-ui/dom';
|
|
3
|
-
import { nothing } from 'lit';
|
|
4
3
|
import type { DsTooltipAttrs } from './ds-tooltip.types';
|
|
5
4
|
export declare class DsTooltip extends UiKitElement {
|
|
6
5
|
static styles: import("lit").CSSResult[];
|
|
@@ -47,7 +46,7 @@ export declare class DsTooltip extends UiKitElement {
|
|
|
47
46
|
};
|
|
48
47
|
protected handleClose: () => void;
|
|
49
48
|
protected get arrowTemplate(): import("lit").TemplateResult<1>;
|
|
50
|
-
protected get tooltipTemplate():
|
|
49
|
+
protected get tooltipTemplate(): import("lit").TemplateResult<1>;
|
|
51
50
|
protected get styleTokens(): import("lit").HTMLTemplateResult;
|
|
52
51
|
protected handleAnchorPointerDown: (event: PointerEvent) => void;
|
|
53
52
|
protected handleAnchorMouseOver: () => void;
|