@cupra/ui-kit 2.0.0-canary.120 → 2.0.0-canary.122
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-button/ds-button.cjs +3 -3
- package/dist/cjs/components/ds-button/styles/common.styles.cjs +4 -4
- package/dist/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -7
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/decorators/customUiKitElement.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/componentFactory.cjs +12 -0
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/cjs/utils/version.cjs +1 -1
- package/dist/esm/components/ds-button/ds-button.js +22 -6
- package/dist/esm/components/ds-button/styles/common.styles.js +4 -4
- package/dist/esm/components/ds-icon-button/ds-icon-button.js +22 -11
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/decorators/customUiKitElement.js +1 -1
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/componentFactory.js +12 -0
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/esm/utils/version.js +1 -1
- package/dist/types/components/ds-button/ds-button.d.ts +5 -1
- package/dist/types/components/ds-button/ds-button.types.d.ts +16 -3
- package/dist/types/components/ds-icon-button/ds-icon-button.d.ts +5 -1
- package/dist/types/components/ds-icon-button/ds-icon-button.types.d.ts +16 -3
- package/dist-react/cjs/components/ds-button/ds-button.cjs +3 -3
- package/dist-react/cjs/components/ds-button/styles/common.styles.cjs +4 -4
- package/dist-react/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -7
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/decorators/customUiKitElement.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/componentFactory.cjs +6 -0
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/version.cjs +1 -1
- package/dist-react/esm/components/ds-button/ds-button.js +22 -6
- package/dist-react/esm/components/ds-button/styles/common.styles.js +4 -4
- package/dist-react/esm/components/ds-icon-button/ds-icon-button.js +22 -11
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/decorators/customUiKitElement.js +1 -1
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/componentFactory.js +6 -0
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/esm/utils/version.js +1 -1
- package/dist-react/types/components/ds-button/ds-button.d.ts +5 -1
- package/dist-react/types/components/ds-button/ds-button.types.d.ts +16 -3
- package/dist-react/types/components/ds-icon-button/ds-icon-button.d.ts +5 -1
- package/dist-react/types/components/ds-icon-button/ds-icon-button.types.d.ts +16 -3
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.cjs`),f=require(`./styles/common.styles.cjs`);var p=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.destructive=!1,this.htmlTagName=`button`,this.type=`button`,this.iconPosition=`left`,this.rounded=!1,this.fullWidth=!1,this.loading=!1}static{this.styles=[f.buttonStyles,f.textStyles,f.loadingDotsStyles]}connectedCallback(){super.connectedCallback(),this.closestForm=this.closest(`form`)}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport];return{button:!0,custom:this.
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.cjs`),f=require(`./styles/common.styles.cjs`);var p=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.destructive=!1,this.htmlTagName=`button`,this.type=`button`,this.iconPosition=`left`,this.rounded=!1,this.fullWidth=!1,this.loading=!1,this.baseVariant=`primary`}static{this.styles=[f.buttonStyles,f.textStyles,f.loadingDotsStyles]}connectedCallback(){super.connectedCallback(),this.closestForm=this.closest(`form`)}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport],t=this.variant===`custom`?this.baseVariant:this.variant;return{button:!0,[`tag-${this.htmlTagName}`]:!0,[`variant-${t}`]:!0,custom:this.variant===`custom`,[e]:!!e,[this.mode]:!!this.mode,rounded:this.rounded,disabled:this.disabled||this.loading,destructive:this.destructive,"full-width":this.fullWidth}}handleClick(e){if(this.href||e.preventDefault(),this.closestForm&&this.type===`submit`){let e=new Event(`submit`,{bubbles:!0,composed:!0,cancelable:!0});this.closestForm.dispatchEvent(e)}}handleCustomClick(e){let t=(this.shadowRoot?.querySelector(`slot`))?.assignedElements()[0];t&&!t.contains(e.composedPath()[0])&&(e.stopPropagation(),t.click())}get iconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName}):e.E}get loadingTemplate(){return this.loading?e.x`
|
|
2
2
|
<span class="loading-dots">
|
|
3
3
|
<span>.</span>
|
|
4
4
|
<span>.</span>
|
|
5
5
|
<span>.</span>
|
|
6
6
|
</span>
|
|
7
|
-
`:e.E}get contentTemplate(){return this.loading&&this.textLoading?e.x`${this.textLoading}`:e.x`<slot></slot>`}get cssTokens(){return o.htmlWithTokens`
|
|
7
|
+
`:e.E}get contentTemplate(){return this.loading&&this.textLoading?e.x`${this.textLoading}`:e.x`<slot></slot>`}updated(e){super.updated(e),this.variant===`custom`&&this.customBackground?this.style.setProperty(`--ui-kit-button-custom-bg`,this.customBackground):this.style.removeProperty(`--ui-kit-button-custom-bg`),this.variant===`custom`&&this.customColor?this.style.setProperty(`--ui-kit-button-custom-color`,this.customColor):this.style.removeProperty(`--ui-kit-button-custom-color`)}get cssTokens(){return o.htmlWithTokens`
|
|
8
8
|
<style>
|
|
9
9
|
:host{
|
|
10
10
|
color-scheme: ${this.mode};
|
|
@@ -54,4 +54,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
54
54
|
${d.n(this.iconPosition===`right`,()=>e.x`${this.iconTemplate}`)}
|
|
55
55
|
</div>
|
|
56
56
|
`]])}
|
|
57
|
-
`}};n.__decorate([t.n({type:String})],p.prototype,`variant`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],p.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`disabled`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`destructive`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],p.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],p.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`target`,void 0),n.__decorate([t.n({type:String})],p.prototype,`type`,void 0),n.__decorate([t.n({type:String,attribute:`icon-position`})],p.prototype,`iconPosition`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`rounded`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter,attribute:`full-width`})],p.prototype,`fullWidth`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`loading`,void 0),n.__decorate([t.n({type:String,attribute:`text-loading`})],p.prototype,`textLoading`,void 0),p=n.__decorate([i.customUiKitElement(`ds-button`)],p),Object.defineProperty(exports,`DsButton`,{enumerable:!0,get:function(){return p}});
|
|
57
|
+
`}};n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`variant`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],p.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`disabled`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`destructive`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],p.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],p.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`target`,void 0),n.__decorate([t.n({type:String})],p.prototype,`type`,void 0),n.__decorate([t.n({type:String,attribute:`icon-position`})],p.prototype,`iconPosition`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`rounded`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter,attribute:`full-width`})],p.prototype,`fullWidth`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`loading`,void 0),n.__decorate([t.n({type:String,attribute:`text-loading`})],p.prototype,`textLoading`,void 0),n.__decorate([t.n({type:String,attribute:`base-variant`})],p.prototype,`baseVariant`,void 0),n.__decorate([t.n({type:String,attribute:`custom-background`})],p.prototype,`customBackground`,void 0),n.__decorate([t.n({type:String,attribute:`custom-color`})],p.prototype,`customColor`,void 0),p=n.__decorate([i.customUiKitElement(`ds-button`)],p),Object.defineProperty(exports,`DsButton`,{enumerable:!0,get:function(){return p}});
|
|
@@ -28,7 +28,7 @@ const e=require(`../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_mo
|
|
|
28
28
|
width: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.custom ::slotted(*) {
|
|
31
|
+
.tag-custom ::slotted(*) {
|
|
32
32
|
display: inline-flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
justify-content: center;
|
|
@@ -50,13 +50,13 @@ const e=require(`../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_mo
|
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.custom ::slotted(*:disabled),
|
|
54
|
-
.custom.disabled ::slotted(*) {
|
|
53
|
+
.tag-custom ::slotted(*:disabled),
|
|
54
|
+
.tag-custom.disabled ::slotted(*) {
|
|
55
55
|
pointer-events: none;
|
|
56
56
|
cursor: default;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.custom ::slotted(*:focus-visible) {
|
|
59
|
+
.tag-custom ::slotted(*:focus-visible) {
|
|
60
60
|
outline: none;
|
|
61
61
|
}
|
|
62
62
|
`,n=e.i`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`./styles/common.styles.cjs`);var f=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.htmlTagName=`button`}static{this.styles=[d.buttonStyles]}get iconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName}):e.E}handleClick(e){this.href||e.preventDefault()}handleCustomClick(e){let t=(this.shadowRoot?.querySelector(`slot`))?.assignedElements()[0];t&&!t.contains(e.composedPath()[0])&&(e.stopPropagation(),t.click())}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport];return{button:!0,custom:this.
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`./styles/common.styles.cjs`);var f=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.baseVariant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.htmlTagName=`button`}static{this.styles=[d.buttonStyles]}get iconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName}):e.E}handleClick(e){this.href||e.preventDefault()}handleCustomClick(e){let t=(this.shadowRoot?.querySelector(`slot`))?.assignedElements()[0];t&&!t.contains(e.composedPath()[0])&&(e.stopPropagation(),t.click())}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport],t=this.variant===`custom`?this.baseVariant:this.variant;return{button:!0,[`tag-${this.htmlTagName}`]:!0,[`variant-${t}`]:!0,custom:this.variant===`custom`,disabled:this.disabled,[e]:!!e,[this.mode]:!!this.mode}}updated(e){super.updated(e),this.variant===`custom`&&this.customBackground?this.style.setProperty(`--ui-kit-button-custom-bg`,this.customBackground):this.style.removeProperty(`--ui-kit-button-custom-bg`),this.variant===`custom`&&this.customColor?this.style.setProperty(`--ui-kit-button-custom-color`,this.customColor):this.style.removeProperty(`--ui-kit-button-custom-color`)}get variantColorTokens(){return o.htmlWithTokens`
|
|
2
2
|
<style>
|
|
3
3
|
:host{
|
|
4
4
|
color-scheme: ${this.mode};
|
|
@@ -6,11 +6,6 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
6
6
|
}
|
|
7
7
|
</style>
|
|
8
8
|
`}render(){return e.x`
|
|
9
|
-
<style>
|
|
10
|
-
:host {
|
|
11
|
-
pointer-events: ${this.disabled?`none`:`visible`};
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
9
|
${this.variantColorTokens}
|
|
15
10
|
${u.r(this.htmlTagName||`button`,[[`button`,()=>e.x`
|
|
16
11
|
<button
|
|
@@ -37,4 +32,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
37
32
|
<slot></slot>
|
|
38
33
|
</div>
|
|
39
34
|
`]])}
|
|
40
|
-
`}};n.__decorate([t.n({type:String})],f.prototype,`variant`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],f.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],f.prototype,`disabled`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],f.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],f.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,attribute:`data-aria-label`})],f.prototype,`dataAriaLabel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`target`,void 0),f=n.__decorate([i.customUiKitElement(`ds-icon-button`)],f),Object.defineProperty(exports,`DsIconButton`,{enumerable:!0,get:function(){return f}});
|
|
35
|
+
`}};n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`variant`,void 0),n.__decorate([t.n({type:String,attribute:`base-variant`})],f.prototype,`baseVariant`,void 0),n.__decorate([t.n({type:String,attribute:`custom-background`})],f.prototype,`customBackground`,void 0),n.__decorate([t.n({type:String,attribute:`custom-color`})],f.prototype,`customColor`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],f.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],f.prototype,`disabled`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],f.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],f.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,attribute:`data-aria-label`})],f.prototype,`dataAriaLabel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`target`,void 0),f=n.__decorate([i.customUiKitElement(`ds-icon-button`)],f),Object.defineProperty(exports,`DsIconButton`,{enumerable:!0,get:function(){return f}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const e=require(`../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs`),t=require(`./themeContext.cjs`),n=require(`../../core/theme.constants.cjs`),r=require(`../../utils/PubSub.cjs`),i=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`),a=require(`../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const o=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),s=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const c=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),l=require(`../../decorators/customUiKitElement.cjs`),u=require(`../../utils/booleanConverter.cjs`),d=require(`../../styles/source/shared/fonts-config.cjs`);var f=class extends a.i{constructor(...e){super(...e),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has(`theme`)&&(r.pubSub.publish(`theme`,this.theme),sessionStorage?.setItem(n.THEME_STORAGE_KEY,this.theme),typeof FontFace<`u`&&document?.fonts&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent(`ui-kit:ready`,{bubbles:!0,composed:!0}))}))}loadThemeFonts(){d.fontsConfig[this.theme]?.fonts.forEach(e=>{this.loadThemeFont(e)})}async loadThemeFont({weight:e,name:t,file:n}){if(!this.loadFonts)return Promise.resolve();let r=`${t}-${e}`;if(this.loadedFonts.has(r))return;let i=new FontFace(t,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.122`,r=`https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${r}"]`))e();else{let i=`ui-kit-theme-${n}`,a=document.getElementById(i),o=document.createElement(`link`);o.id=i,o.rel=`stylesheet`,o.href=r,o.onload=()=>e(),o.onerror=()=>t(Error(`Failed to load theme CSS: ${r}`)),document.head.appendChild(o),a?.remove()}}):Promise.resolve()}render(){return this.cssLoaded?i.x`<slot></slot>`:i.E}};c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-fonts`})],f.prototype,`loadFonts`,void 0),c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-styles`})],f.prototype,`loadStyles`,void 0),c.__decorate([e.e({context:t.themeContext}),o.n({type:String})],f.prototype,`theme`,void 0),c.__decorate([s.r()],f.prototype,`cssLoaded`,void 0),c.__decorate([s.r()],f.prototype,`loadedFonts`,void 0),f=c.__decorate([l.customUiKitElement(`ds-theme-provider`)],f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../utils/version.cjs`),t=require(`../utils/componentFactory.cjs`);function n(n,r){return function(i){if(!i?.prototype)throw TypeError(`@customUiKitElement requires a class that extends HTMLElement.`);let a=typeof __UIKIT_TARGET__<`u`&&__UIKIT_TARGET__===`react`,o=a?`${n}${e.VERSION_TAG_SUFFIX}`:n;if(globalThis?.customElements?.get(o))return;let s=r?.skipTagAsComponentName?[]:[n];Array.isArray(r?.extendComponentNames)&&(s=[...r.extendComponentNames,...s]),globalThis?.customElements?.define?.(o,class extends i{constructor(...e){super(...e),this.componentFactory=a?t.reactFactory:t.standardFactory}static{this.componentName=s}connectedCallback(){i.prototype.connectedCallback?.call(this),this.setAttribute(`data-ui-kit-version`,`2.0.0-canary.
|
|
1
|
+
const e=require(`../utils/version.cjs`),t=require(`../utils/componentFactory.cjs`);function n(n,r){return function(i){if(!i?.prototype)throw TypeError(`@customUiKitElement requires a class that extends HTMLElement.`);let a=typeof __UIKIT_TARGET__<`u`&&__UIKIT_TARGET__===`react`,o=a?`${n}${e.VERSION_TAG_SUFFIX}`:n;if(globalThis?.customElements?.get(o))return;let s=r?.skipTagAsComponentName?[]:[n];Array.isArray(r?.extendComponentNames)&&(s=[...r.extendComponentNames,...s]),globalThis?.customElements?.define?.(o,class extends i{constructor(...e){super(...e),this.componentFactory=a?t.reactFactory:t.standardFactory}static{this.componentName=s}connectedCallback(){i.prototype.connectedCallback?.call(this),this.setAttribute(`data-ui-kit-version`,`2.0.0-canary.122`)}})}}exports.customUiKitElement=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.122`),i=globalThis,a=i[r];a||(a=new n,Object.defineProperty(i,r,{value:a,writable:!1,configurable:!1,enumerable:!1}));var o=a;exports.iconsManager=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.122`),n=globalThis,r=n[t];r||(r=new e,Object.defineProperty(n,t,{value:r,writable:!1,configurable:!1,enumerable:!1}));var i=r;exports.pubSub=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.122/styles/${n}/components/${t}.css`,i=this.getCachedStyleSheetPromise({url:r});if(i)return i;let a=e(()=>this.fetchStyle({url:r})).then(e=>(e||this.stylePromises.delete(r),e));return this.stylePromises.set(r,a),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>`u`)return;let t=await fetch(e,{cache:`force-cache`});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return t.instance||=new t,t.instance}}.getInstance();exports.stylesRegistry=t;
|
|
@@ -44,6 +44,9 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
44
44
|
rel=${n?.rel}
|
|
45
45
|
target=${n?.target}
|
|
46
46
|
data-testid=${n?.[`data-testid`]}
|
|
47
|
+
base-variant=${t.o(n?.[`base-variant`])}
|
|
48
|
+
custom-background=${t.o(n?.[`custom-background`])}
|
|
49
|
+
custom-color=${t.o(n?.[`custom-color`])}
|
|
47
50
|
>
|
|
48
51
|
${n.children}
|
|
49
52
|
</ds-button>
|
|
@@ -70,6 +73,9 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
70
73
|
target=${n?.target}
|
|
71
74
|
data-testid=${n?.[`data-testid`]}
|
|
72
75
|
data-aria-label=${n?.[`data-aria-label`]}
|
|
76
|
+
base-variant=${t.o(n?.[`base-variant`])}
|
|
77
|
+
custom-background=${t.o(n?.[`custom-background`])}
|
|
78
|
+
custom-color=${t.o(n?.[`custom-color`])}
|
|
73
79
|
>
|
|
74
80
|
${n.children}
|
|
75
81
|
</ds-icon-button>
|
|
@@ -161,6 +167,9 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
161
167
|
rel=${e?.rel}
|
|
162
168
|
target=${e?.target}
|
|
163
169
|
data-testid=${e?.[`data-testid`]}
|
|
170
|
+
base-variant=${t.o(e?.[`base-variant`])}
|
|
171
|
+
custom-background=${t.o(e?.[`custom-background`])}
|
|
172
|
+
custom-color=${t.o(e?.[`custom-color`])}
|
|
164
173
|
>
|
|
165
174
|
${e.children}
|
|
166
175
|
</${o}>
|
|
@@ -187,6 +196,9 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
187
196
|
target=${e?.target}
|
|
188
197
|
data-testid=${e?.[`data-testid`]}
|
|
189
198
|
data-aria-label=${e?.[`data-aria-label`]}
|
|
199
|
+
base-variant=${t.o(e?.[`base-variant`])}
|
|
200
|
+
custom-background=${t.o(e?.[`custom-background`])}
|
|
201
|
+
custom-color=${t.o(e?.[`custom-color`])}
|
|
190
202
|
>
|
|
191
203
|
${e.children}
|
|
192
204
|
</${c}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-122`))}`}exports.cssWithTokens=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-122`))}`}exports.htmlWithTokens=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`2.0.0-canary.
|
|
1
|
+
var e=`2.0.0-canary.122`,t=`--v${e.replaceAll(`.`,`-`)}`;exports.VERSION=e,exports.VERSION_TAG_SUFFIX=t;
|
|
@@ -17,7 +17,7 @@ import { buttonStyles as p, loadingDotsStyles as m, textStyles as h } from "./st
|
|
|
17
17
|
//#region src/components/ds-button/ds-button.ts
|
|
18
18
|
var g = class extends l(i) {
|
|
19
19
|
constructor(...e) {
|
|
20
|
-
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1;
|
|
20
|
+
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1, this.baseVariant = "primary";
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.styles = [
|
|
@@ -30,13 +30,14 @@ var g = class extends l(i) {
|
|
|
30
30
|
super.connectedCallback(), this.closestForm = this.closest("form");
|
|
31
31
|
}
|
|
32
32
|
get classes() {
|
|
33
|
-
let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
33
|
+
let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = this.variant === "custom" ? this.baseVariant : this.variant;
|
|
34
34
|
return {
|
|
35
35
|
button: !0,
|
|
36
|
-
|
|
36
|
+
[`tag-${this.htmlTagName}`]: !0,
|
|
37
|
+
[`variant-${t}`]: !0,
|
|
38
|
+
custom: this.variant === "custom",
|
|
37
39
|
[e]: !!e,
|
|
38
40
|
[this.mode]: !!this.mode,
|
|
39
|
-
[this.variant]: !!this.variant,
|
|
40
41
|
rounded: this.rounded,
|
|
41
42
|
disabled: this.disabled || this.loading,
|
|
42
43
|
destructive: this.destructive,
|
|
@@ -75,6 +76,9 @@ var g = class extends l(i) {
|
|
|
75
76
|
get contentTemplate() {
|
|
76
77
|
return this.loading && this.textLoading ? t`${this.textLoading}` : t`<slot></slot>`;
|
|
77
78
|
}
|
|
79
|
+
updated(e) {
|
|
80
|
+
super.updated(e), this.variant === "custom" && this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.variant === "custom" && this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
|
|
81
|
+
}
|
|
78
82
|
get cssTokens() {
|
|
79
83
|
return s`
|
|
80
84
|
<style>
|
|
@@ -136,7 +140,10 @@ var g = class extends l(i) {
|
|
|
136
140
|
`;
|
|
137
141
|
}
|
|
138
142
|
};
|
|
139
|
-
r([n({
|
|
143
|
+
r([n({
|
|
144
|
+
type: String,
|
|
145
|
+
reflect: !0
|
|
146
|
+
})], g.prototype, "variant", void 0), r([n({
|
|
140
147
|
type: String,
|
|
141
148
|
reflect: !0
|
|
142
149
|
})], g.prototype, "mode", void 0), r([n({
|
|
@@ -179,6 +186,15 @@ r([n({ type: String })], g.prototype, "variant", void 0), r([n({
|
|
|
179
186
|
})], g.prototype, "loading", void 0), r([n({
|
|
180
187
|
type: String,
|
|
181
188
|
attribute: "text-loading"
|
|
182
|
-
})], g.prototype, "textLoading", void 0),
|
|
189
|
+
})], g.prototype, "textLoading", void 0), r([n({
|
|
190
|
+
type: String,
|
|
191
|
+
attribute: "base-variant"
|
|
192
|
+
})], g.prototype, "baseVariant", void 0), r([n({
|
|
193
|
+
type: String,
|
|
194
|
+
attribute: "custom-background"
|
|
195
|
+
})], g.prototype, "customBackground", void 0), r([n({
|
|
196
|
+
type: String,
|
|
197
|
+
attribute: "custom-color"
|
|
198
|
+
})], g.prototype, "customColor", void 0), g = r([a("ds-button")], g);
|
|
183
199
|
//#endregion
|
|
184
200
|
export { g as DsButton };
|
|
@@ -31,7 +31,7 @@ var t = e`
|
|
|
31
31
|
width: 100%;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.custom ::slotted(*) {
|
|
34
|
+
.tag-custom ::slotted(*) {
|
|
35
35
|
display: inline-flex;
|
|
36
36
|
align-items: center;
|
|
37
37
|
justify-content: center;
|
|
@@ -53,13 +53,13 @@ var t = e`
|
|
|
53
53
|
box-sizing: border-box;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.custom ::slotted(*:disabled),
|
|
57
|
-
.custom.disabled ::slotted(*) {
|
|
56
|
+
.tag-custom ::slotted(*:disabled),
|
|
57
|
+
.tag-custom.disabled ::slotted(*) {
|
|
58
58
|
pointer-events: none;
|
|
59
59
|
cursor: default;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.custom ::slotted(*:focus-visible) {
|
|
62
|
+
.tag-custom ::slotted(*:focus-visible) {
|
|
63
63
|
outline: none;
|
|
64
64
|
}
|
|
65
65
|
`, n = e`
|
|
@@ -16,7 +16,7 @@ import { buttonStyles as f } from "./styles/common.styles.js";
|
|
|
16
16
|
//#region src/components/ds-icon-button/ds-icon-button.ts
|
|
17
17
|
var p = class extends l(i) {
|
|
18
18
|
constructor(...e) {
|
|
19
|
-
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
|
|
19
|
+
super(...e), this.variant = "primary", this.baseVariant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
22
|
this.styles = [f];
|
|
@@ -35,16 +35,20 @@ var p = class extends l(i) {
|
|
|
35
35
|
t && !t.contains(e.composedPath()[0]) && (e.stopPropagation(), t.click());
|
|
36
36
|
}
|
|
37
37
|
get classes() {
|
|
38
|
-
let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
38
|
+
let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = this.variant === "custom" ? this.baseVariant : this.variant;
|
|
39
39
|
return {
|
|
40
40
|
button: !0,
|
|
41
|
-
|
|
41
|
+
[`tag-${this.htmlTagName}`]: !0,
|
|
42
|
+
[`variant-${t}`]: !0,
|
|
43
|
+
custom: this.variant === "custom",
|
|
42
44
|
disabled: this.disabled,
|
|
43
45
|
[e]: !!e,
|
|
44
|
-
[this.mode]: !!this.mode
|
|
45
|
-
[this.variant]: !!this.variant
|
|
46
|
+
[this.mode]: !!this.mode
|
|
46
47
|
};
|
|
47
48
|
}
|
|
49
|
+
updated(e) {
|
|
50
|
+
super.updated(e), this.variant === "custom" && this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.variant === "custom" && this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
|
|
51
|
+
}
|
|
48
52
|
get variantColorTokens() {
|
|
49
53
|
return s`
|
|
50
54
|
<style>
|
|
@@ -57,11 +61,6 @@ var p = class extends l(i) {
|
|
|
57
61
|
}
|
|
58
62
|
render() {
|
|
59
63
|
return t`
|
|
60
|
-
<style>
|
|
61
|
-
:host {
|
|
62
|
-
pointer-events: ${this.disabled ? "none" : "visible"};
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
65
64
|
${this.variantColorTokens}
|
|
66
65
|
${d(this.htmlTagName || "button", [
|
|
67
66
|
["button", () => t`
|
|
@@ -95,7 +94,19 @@ var p = class extends l(i) {
|
|
|
95
94
|
`;
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
r([n({
|
|
97
|
+
r([n({
|
|
98
|
+
type: String,
|
|
99
|
+
reflect: !0
|
|
100
|
+
})], p.prototype, "variant", void 0), r([n({
|
|
101
|
+
type: String,
|
|
102
|
+
attribute: "base-variant"
|
|
103
|
+
})], p.prototype, "baseVariant", void 0), r([n({
|
|
104
|
+
type: String,
|
|
105
|
+
attribute: "custom-background"
|
|
106
|
+
})], p.prototype, "customBackground", void 0), r([n({
|
|
107
|
+
type: String,
|
|
108
|
+
attribute: "custom-color"
|
|
109
|
+
})], p.prototype, "customColor", void 0), r([n({
|
|
99
110
|
type: String,
|
|
100
111
|
reflect: !0
|
|
101
112
|
})], p.prototype, "mode", void 0), r([n({
|
|
@@ -50,7 +50,7 @@ var p = class extends o {
|
|
|
50
50
|
}
|
|
51
51
|
loadThemeStyles() {
|
|
52
52
|
return this.loadStyles ? new Promise((e, t) => {
|
|
53
|
-
let n = "/2.0.0-canary.
|
|
53
|
+
let n = "/2.0.0-canary.122", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
|
|
54
54
|
if (document.head.querySelector(`link[href="${r}"]`)) e();
|
|
55
55
|
else {
|
|
56
56
|
let i = `ui-kit-theme-${n}`, a = document.getElementById(i), o = document.createElement("link");
|
|
@@ -15,7 +15,7 @@ function r(r, i) {
|
|
|
15
15
|
this.componentName = c;
|
|
16
16
|
}
|
|
17
17
|
connectedCallback() {
|
|
18
|
-
a.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.
|
|
18
|
+
a.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.122");
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
};
|
|
@@ -25,7 +25,7 @@ var n = class {
|
|
|
25
25
|
return console.error(`Failed to fetch icon "${e}":`, t), "";
|
|
26
26
|
}), t.subscribe("theme", this.handleChangeTheme);
|
|
27
27
|
}
|
|
28
|
-
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.122"), i = globalThis, a = i[r];
|
|
29
29
|
a || (a = new n(), Object.defineProperty(i, r, {
|
|
30
30
|
value: a,
|
|
31
31
|
writable: !1,
|
package/dist/esm/utils/PubSub.js
CHANGED
|
@@ -18,7 +18,7 @@ var e = class {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.122"), n = globalThis, r = n[t];
|
|
22
22
|
r || (r = new e(), Object.defineProperty(n, t, {
|
|
23
23
|
value: r,
|
|
24
24
|
writable: !1,
|
|
@@ -4,7 +4,7 @@ var t = e(20), n = class e {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stylePromises = /* @__PURE__ */ new Map(), this.getStyles = async ({ componentName: e, theme: n }) => {
|
|
6
6
|
if (!n || !e) return;
|
|
7
|
-
let r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
7
|
+
let r = `https://ds-assets.cupra.com/2.0.0-canary.122/styles/${n}/components/${e}.css`, i = this.getCachedStyleSheetPromise({ url: r });
|
|
8
8
|
if (i) return i;
|
|
9
9
|
let a = t(() => this.fetchStyle({ url: r })).then((e) => (e || this.stylePromises.delete(r), e));
|
|
10
10
|
return this.stylePromises.set(r, a), this.stylePromises.get(r);
|
|
@@ -55,6 +55,9 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
55
55
|
rel=${n?.rel}
|
|
56
56
|
target=${n?.target}
|
|
57
57
|
data-testid=${n?.["data-testid"]}
|
|
58
|
+
base-variant=${t(n?.["base-variant"])}
|
|
59
|
+
custom-background=${t(n?.["custom-background"])}
|
|
60
|
+
custom-color=${t(n?.["custom-color"])}
|
|
58
61
|
>
|
|
59
62
|
${n.children}
|
|
60
63
|
</ds-button>
|
|
@@ -83,6 +86,9 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
83
86
|
target=${n?.target}
|
|
84
87
|
data-testid=${n?.["data-testid"]}
|
|
85
88
|
data-aria-label=${n?.["data-aria-label"]}
|
|
89
|
+
base-variant=${t(n?.["base-variant"])}
|
|
90
|
+
custom-background=${t(n?.["custom-background"])}
|
|
91
|
+
custom-color=${t(n?.["custom-color"])}
|
|
86
92
|
>
|
|
87
93
|
${n.children}
|
|
88
94
|
</ds-icon-button>
|
|
@@ -183,6 +189,9 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
183
189
|
rel=${e?.rel}
|
|
184
190
|
target=${e?.target}
|
|
185
191
|
data-testid=${e?.["data-testid"]}
|
|
192
|
+
base-variant=${t(e?.["base-variant"])}
|
|
193
|
+
custom-background=${t(e?.["custom-background"])}
|
|
194
|
+
custom-color=${t(e?.["custom-color"])}
|
|
186
195
|
>
|
|
187
196
|
${e.children}
|
|
188
197
|
</${s}>
|
|
@@ -211,6 +220,9 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
211
220
|
target=${e?.target}
|
|
212
221
|
data-testid=${e?.["data-testid"]}
|
|
213
222
|
data-aria-label=${e?.["data-aria-label"]}
|
|
223
|
+
base-variant=${t(e?.["base-variant"])}
|
|
224
|
+
custom-background=${t(e?.["custom-background"])}
|
|
225
|
+
custom-color=${t(e?.["custom-color"])}
|
|
214
226
|
>
|
|
215
227
|
${e.children}
|
|
216
228
|
</${l}>
|
|
@@ -2,7 +2,7 @@ import { i as e, r as t } from "../node_modules/.pnpm/@lit_reactive-element@2.1.
|
|
|
2
2
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
//#region src/utils/cssWithTokens.ts
|
|
4
4
|
function n(n, ...r) {
|
|
5
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
5
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-122"))}`;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as cssWithTokens };
|
|
@@ -4,7 +4,7 @@ import { o as t } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-ht
|
|
|
4
4
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.js";
|
|
5
5
|
//#region src/utils/htmlWithTokens.ts
|
|
6
6
|
function n(n, ...r) {
|
|
7
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
7
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-122"))}`;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { n as htmlWithTokens };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
-
import { nothing } from 'lit';
|
|
2
|
+
import { type PropertyValues, nothing } from 'lit';
|
|
3
3
|
import type { DsButtonAttrs } from './ds-button.types';
|
|
4
4
|
declare const DsButton_base: (new (...args: any[]) => import("../../mixins/ViewportMixin").ViewportInterface) & typeof UiKitElement;
|
|
5
5
|
export declare class DsButton extends DsButton_base {
|
|
@@ -19,6 +19,9 @@ export declare class DsButton extends DsButton_base {
|
|
|
19
19
|
fullWidth: DsButtonAttrs['full-width'];
|
|
20
20
|
loading: DsButtonAttrs['loading'];
|
|
21
21
|
textLoading: DsButtonAttrs['text-loading'];
|
|
22
|
+
baseVariant: DsButtonAttrs['base-variant'];
|
|
23
|
+
customBackground: DsButtonAttrs['custom-background'];
|
|
24
|
+
customColor: DsButtonAttrs['custom-color'];
|
|
22
25
|
private closestForm;
|
|
23
26
|
static styles: import("lit").CSSResult[];
|
|
24
27
|
connectedCallback(): void;
|
|
@@ -36,6 +39,7 @@ export declare class DsButton extends DsButton_base {
|
|
|
36
39
|
protected get iconTemplate(): any;
|
|
37
40
|
protected get loadingTemplate(): typeof nothing | import("lit").TemplateResult<1>;
|
|
38
41
|
protected get contentTemplate(): import("lit").TemplateResult<1>;
|
|
42
|
+
updated(changedProperties: PropertyValues): void;
|
|
39
43
|
protected get cssTokens(): import("lit").HTMLTemplateResult;
|
|
40
44
|
render(): import("lit").TemplateResult<1>;
|
|
41
45
|
}
|
|
@@ -23,8 +23,7 @@ type CustomElement = {
|
|
|
23
23
|
target?: never;
|
|
24
24
|
};
|
|
25
25
|
type HtmlElement = Link | Button | CustomElement;
|
|
26
|
-
|
|
27
|
-
variant?: string;
|
|
26
|
+
type SharedButtonAttrs = {
|
|
28
27
|
mode?: 'dark' | 'light';
|
|
29
28
|
disabled?: boolean;
|
|
30
29
|
destructive?: boolean;
|
|
@@ -37,5 +36,19 @@ export type DsButtonAttrs = {
|
|
|
37
36
|
'full-width'?: boolean;
|
|
38
37
|
loading?: boolean;
|
|
39
38
|
'text-loading'?: string;
|
|
40
|
-
}
|
|
39
|
+
};
|
|
40
|
+
export type DsButtonStandardVariant = 'primary' | 'secondary' | 'tertiary' | 'naked';
|
|
41
|
+
type StandardVariantAttrs = {
|
|
42
|
+
variant?: DsButtonStandardVariant;
|
|
43
|
+
'base-variant'?: never;
|
|
44
|
+
'custom-background'?: never;
|
|
45
|
+
'custom-color'?: never;
|
|
46
|
+
};
|
|
47
|
+
type CustomVariantAttrs = {
|
|
48
|
+
variant: 'custom';
|
|
49
|
+
'base-variant'?: DsButtonStandardVariant;
|
|
50
|
+
'custom-background'?: string;
|
|
51
|
+
'custom-color'?: string;
|
|
52
|
+
};
|
|
53
|
+
export type DsButtonAttrs = (StandardVariantAttrs | CustomVariantAttrs) & SharedButtonAttrs & HtmlElement & CommonAttrs;
|
|
41
54
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
2
|
import type { DsIconButtonAttrs } from '../ds-icon-button/ds-icon-button.types.ts';
|
|
3
|
-
import { type TemplateResult } from 'lit';
|
|
3
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
4
4
|
declare const DsIconButton_base: (new (...args: any[]) => import("../../mixins/ViewportMixin.ts").ViewportInterface) & typeof UiKitElement;
|
|
5
5
|
export declare class DsIconButton extends DsIconButton_base {
|
|
6
6
|
static styles: import("lit").CSSResult[];
|
|
7
7
|
variant: DsIconButtonAttrs['variant'];
|
|
8
|
+
baseVariant: DsIconButtonAttrs['base-variant'];
|
|
9
|
+
customBackground: DsIconButtonAttrs['custom-background'];
|
|
10
|
+
customColor: DsIconButtonAttrs['custom-color'];
|
|
8
11
|
mode: DsIconButtonAttrs['mode'];
|
|
9
12
|
size: DsIconButtonAttrs['size'];
|
|
10
13
|
disabled: DsIconButtonAttrs['disabled'];
|
|
@@ -23,6 +26,7 @@ export declare class DsIconButton extends DsIconButton_base {
|
|
|
23
26
|
custom: boolean;
|
|
24
27
|
disabled: boolean;
|
|
25
28
|
};
|
|
29
|
+
updated(changedProperties: PropertyValues): void;
|
|
26
30
|
protected get variantColorTokens(): TemplateResult;
|
|
27
31
|
render(): TemplateResult<1>;
|
|
28
32
|
}
|
|
@@ -23,12 +23,25 @@ type CustomElement = {
|
|
|
23
23
|
target?: never;
|
|
24
24
|
};
|
|
25
25
|
type HtmlElement = Link | Button | CustomElement;
|
|
26
|
-
|
|
27
|
-
variant?: string;
|
|
26
|
+
type SharedIconButtonAttrs = {
|
|
28
27
|
mode?: 'dark' | 'light';
|
|
29
28
|
size?: Size | ResponsiveSize;
|
|
30
29
|
disabled?: boolean;
|
|
31
30
|
'data-aria-label'?: string;
|
|
32
31
|
'icon-name'?: DsIconAttrs['icon-name'];
|
|
33
|
-
}
|
|
32
|
+
};
|
|
33
|
+
export type DsIconButtonStandardVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'naked' | 'rounded';
|
|
34
|
+
type StandardVariantAttrs = {
|
|
35
|
+
variant?: DsIconButtonStandardVariant;
|
|
36
|
+
'base-variant'?: never;
|
|
37
|
+
'custom-background'?: never;
|
|
38
|
+
'custom-color'?: never;
|
|
39
|
+
};
|
|
40
|
+
type CustomVariantAttrs = {
|
|
41
|
+
variant: 'custom';
|
|
42
|
+
'base-variant'?: DsIconButtonStandardVariant;
|
|
43
|
+
'custom-background'?: string;
|
|
44
|
+
'custom-color'?: string;
|
|
45
|
+
};
|
|
46
|
+
export type DsIconButtonAttrs = (StandardVariantAttrs | CustomVariantAttrs) & SharedIconButtonAttrs & HtmlElement & CommonAttrs;
|
|
34
47
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.cjs`),f=require(`./styles/common.styles.cjs`);var p=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.destructive=!1,this.htmlTagName=`button`,this.type=`button`,this.iconPosition=`left`,this.rounded=!1,this.fullWidth=!1,this.loading=!1}static{this.styles=[f.buttonStyles,f.textStyles,f.loadingDotsStyles]}connectedCallback(){super.connectedCallback(),this.closestForm=this.closest(`form`)}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport];return{button:!0,custom:this.
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/when.cjs`),f=require(`./styles/common.styles.cjs`);var p=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.destructive=!1,this.htmlTagName=`button`,this.type=`button`,this.iconPosition=`left`,this.rounded=!1,this.fullWidth=!1,this.loading=!1,this.baseVariant=`primary`}static{this.styles=[f.buttonStyles,f.textStyles,f.loadingDotsStyles]}connectedCallback(){super.connectedCallback(),this.closestForm=this.closest(`form`)}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport],t=this.variant===`custom`?this.baseVariant:this.variant;return{button:!0,[`tag-${this.htmlTagName}`]:!0,[`variant-${t}`]:!0,custom:this.variant===`custom`,[e]:!!e,[this.mode]:!!this.mode,rounded:this.rounded,disabled:this.disabled||this.loading,destructive:this.destructive,"full-width":this.fullWidth}}handleClick(e){if(this.href||e.preventDefault(),this.closestForm&&this.type===`submit`){let e=new Event(`submit`,{bubbles:!0,composed:!0,cancelable:!0});this.closestForm.dispatchEvent(e)}}handleCustomClick(e){let t=(this.shadowRoot?.querySelector(`slot`))?.assignedElements()[0];t&&!t.contains(e.composedPath()[0])&&(e.stopPropagation(),t.click())}get iconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName}):e.E}get loadingTemplate(){return this.loading?e.x`
|
|
2
2
|
<span class="loading-dots">
|
|
3
3
|
<span>.</span>
|
|
4
4
|
<span>.</span>
|
|
5
5
|
<span>.</span>
|
|
6
6
|
</span>
|
|
7
|
-
`:e.E}get contentTemplate(){return this.loading&&this.textLoading?e.x`${this.textLoading}`:e.x`<slot></slot>`}get cssTokens(){return o.htmlWithTokens`
|
|
7
|
+
`:e.E}get contentTemplate(){return this.loading&&this.textLoading?e.x`${this.textLoading}`:e.x`<slot></slot>`}updated(e){super.updated(e),this.variant===`custom`&&this.customBackground?this.style.setProperty(`--ui-kit-button-custom-bg`,this.customBackground):this.style.removeProperty(`--ui-kit-button-custom-bg`),this.variant===`custom`&&this.customColor?this.style.setProperty(`--ui-kit-button-custom-color`,this.customColor):this.style.removeProperty(`--ui-kit-button-custom-color`)}get cssTokens(){return o.htmlWithTokens`
|
|
8
8
|
<style>
|
|
9
9
|
:host{
|
|
10
10
|
color-scheme: ${this.mode};
|
|
@@ -54,4 +54,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
54
54
|
${d.n(this.iconPosition===`right`,()=>e.x`${this.iconTemplate}`)}
|
|
55
55
|
</div>
|
|
56
56
|
`]])}
|
|
57
|
-
`}};n.__decorate([t.n({type:String})],p.prototype,`variant`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],p.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`disabled`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`destructive`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],p.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],p.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`target`,void 0),n.__decorate([t.n({type:String})],p.prototype,`type`,void 0),n.__decorate([t.n({type:String,attribute:`icon-position`})],p.prototype,`iconPosition`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`rounded`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter,attribute:`full-width`})],p.prototype,`fullWidth`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`loading`,void 0),n.__decorate([t.n({type:String,attribute:`text-loading`})],p.prototype,`textLoading`,void 0),p=n.__decorate([i.customUiKitElement(`ds-button`)],p),Object.defineProperty(exports,`DsButton`,{enumerable:!0,get:function(){return p}});
|
|
57
|
+
`}};n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`variant`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],p.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`disabled`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`destructive`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],p.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],p.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],p.prototype,`target`,void 0),n.__decorate([t.n({type:String})],p.prototype,`type`,void 0),n.__decorate([t.n({type:String,attribute:`icon-position`})],p.prototype,`iconPosition`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`rounded`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter,attribute:`full-width`})],p.prototype,`fullWidth`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],p.prototype,`loading`,void 0),n.__decorate([t.n({type:String,attribute:`text-loading`})],p.prototype,`textLoading`,void 0),n.__decorate([t.n({type:String,attribute:`base-variant`})],p.prototype,`baseVariant`,void 0),n.__decorate([t.n({type:String,attribute:`custom-background`})],p.prototype,`customBackground`,void 0),n.__decorate([t.n({type:String,attribute:`custom-color`})],p.prototype,`customColor`,void 0),p=n.__decorate([i.customUiKitElement(`ds-button`)],p),Object.defineProperty(exports,`DsButton`,{enumerable:!0,get:function(){return p}});
|
|
@@ -28,7 +28,7 @@ const e=require(`../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_mo
|
|
|
28
28
|
width: 100%;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.custom ::slotted(*) {
|
|
31
|
+
.tag-custom ::slotted(*) {
|
|
32
32
|
display: inline-flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
justify-content: center;
|
|
@@ -50,13 +50,13 @@ const e=require(`../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_mo
|
|
|
50
50
|
box-sizing: border-box;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
.custom ::slotted(*:disabled),
|
|
54
|
-
.custom.disabled ::slotted(*) {
|
|
53
|
+
.tag-custom ::slotted(*:disabled),
|
|
54
|
+
.tag-custom.disabled ::slotted(*) {
|
|
55
55
|
pointer-events: none;
|
|
56
56
|
cursor: default;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.custom ::slotted(*:focus-visible) {
|
|
59
|
+
.tag-custom ::slotted(*:focus-visible) {
|
|
60
60
|
outline: none;
|
|
61
61
|
}
|
|
62
62
|
`,n=e.i`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`./styles/common.styles.cjs`);var f=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.htmlTagName=`button`}static{this.styles=[d.buttonStyles]}get iconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName}):e.E}handleClick(e){this.href||e.preventDefault()}handleCustomClick(e){let t=(this.shadowRoot?.querySelector(`slot`))?.assignedElements()[0];t&&!t.contains(e.composedPath()[0])&&(e.stopPropagation(),t.click())}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport];return{button:!0,custom:this.
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const n=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),r=require(`../base/UiKitElement.cjs`),i=require(`../../decorators/customUiKitElement.cjs`),a=require(`../../utils/booleanConverter.cjs`),o=require(`../../utils/htmlWithTokens.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`../../mixins/ViewportMixin.cjs`),l=require(`../../utils/objectConverter.cjs`),u=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/choose.cjs`),d=require(`./styles/common.styles.cjs`);var f=class extends c.ViewportMixin(r.UiKitElement){constructor(...e){super(...e),this.variant=`primary`,this.baseVariant=`primary`,this.mode=`light`,this.size=`large`,this.disabled=!1,this.htmlTagName=`button`}static{this.styles=[d.buttonStyles]}get iconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName}):e.E}handleClick(e){this.href||e.preventDefault()}handleCustomClick(e){let t=(this.shadowRoot?.querySelector(`slot`))?.assignedElements()[0];t&&!t.contains(e.composedPath()[0])&&(e.stopPropagation(),t.click())}get classes(){let e=typeof this.size==`string`?this.size:this.size[this.viewport],t=this.variant===`custom`?this.baseVariant:this.variant;return{button:!0,[`tag-${this.htmlTagName}`]:!0,[`variant-${t}`]:!0,custom:this.variant===`custom`,disabled:this.disabled,[e]:!!e,[this.mode]:!!this.mode}}updated(e){super.updated(e),this.variant===`custom`&&this.customBackground?this.style.setProperty(`--ui-kit-button-custom-bg`,this.customBackground):this.style.removeProperty(`--ui-kit-button-custom-bg`),this.variant===`custom`&&this.customColor?this.style.setProperty(`--ui-kit-button-custom-color`,this.customColor):this.style.removeProperty(`--ui-kit-button-custom-color`)}get variantColorTokens(){return o.htmlWithTokens`
|
|
2
2
|
<style>
|
|
3
3
|
:host{
|
|
4
4
|
color-scheme: ${this.mode};
|
|
@@ -6,11 +6,6 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
6
6
|
}
|
|
7
7
|
</style>
|
|
8
8
|
`}render(){return e.x`
|
|
9
|
-
<style>
|
|
10
|
-
:host {
|
|
11
|
-
pointer-events: ${this.disabled?`none`:`visible`};
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
9
|
${this.variantColorTokens}
|
|
15
10
|
${u.r(this.htmlTagName||`button`,[[`button`,()=>e.x`
|
|
16
11
|
<button
|
|
@@ -37,4 +32,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
37
32
|
<slot></slot>
|
|
38
33
|
</div>
|
|
39
34
|
`]])}
|
|
40
|
-
`}};n.__decorate([t.n({type:String})],f.prototype,`variant`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],f.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],f.prototype,`disabled`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],f.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],f.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,attribute:`data-aria-label`})],f.prototype,`dataAriaLabel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`target`,void 0),f=n.__decorate([i.customUiKitElement(`ds-icon-button`)],f),Object.defineProperty(exports,`DsIconButton`,{enumerable:!0,get:function(){return f}});
|
|
35
|
+
`}};n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`variant`,void 0),n.__decorate([t.n({type:String,attribute:`base-variant`})],f.prototype,`baseVariant`,void 0),n.__decorate([t.n({type:String,attribute:`custom-background`})],f.prototype,`customBackground`,void 0),n.__decorate([t.n({type:String,attribute:`custom-color`})],f.prototype,`customColor`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`mode`,void 0),n.__decorate([t.n({type:String,converter:l.objectConverter})],f.prototype,`size`,void 0),n.__decorate([t.n({type:Boolean,converter:a.booleanConverter})],f.prototype,`disabled`,void 0),n.__decorate([t.n({type:String,attribute:`icon-name`})],f.prototype,`iconName`,void 0),n.__decorate([t.n({type:String,attribute:`html-tag-name`})],f.prototype,`htmlTagName`,void 0),n.__decorate([t.n({type:String,attribute:`data-aria-label`})],f.prototype,`dataAriaLabel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`href`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`rel`,void 0),n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`target`,void 0),f=n.__decorate([i.customUiKitElement(`ds-icon-button`)],f),Object.defineProperty(exports,`DsIconButton`,{enumerable:!0,get:function(){return f}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const e=require(`../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs`),t=require(`./themeContext.cjs`),n=require(`../../core/theme.constants.cjs`),r=require(`../../utils/PubSub.cjs`),i=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`),a=require(`../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const o=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),s=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const c=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),l=require(`../../decorators/customUiKitElement.cjs`),u=require(`../../utils/booleanConverter.cjs`),d=require(`../../styles/source/shared/fonts-config.cjs`);var f=class extends a.i{constructor(...e){super(...e),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has(`theme`)&&(r.pubSub.publish(`theme`,this.theme),sessionStorage?.setItem(n.THEME_STORAGE_KEY,this.theme),typeof FontFace<`u`&&document?.fonts&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent(`ui-kit:ready`,{bubbles:!0,composed:!0}))}))}loadThemeFonts(){d.fontsConfig[this.theme]?.fonts.forEach(e=>{this.loadThemeFont(e)})}async loadThemeFont({weight:e,name:t,file:n}){if(!this.loadFonts)return Promise.resolve();let r=`${t}-${e}`;if(this.loadedFonts.has(r))return;let i=new FontFace(t,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff2') format('woff2'),
|
|
2
2
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.woff') format('woff'),
|
|
3
3
|
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.ttf') format('truetype'),
|
|
4
|
-
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.
|
|
4
|
+
url('https://ds-assets.cupra.com/fonts/${this.theme}/${n}.otf') format('opentype')`,{style:`normal`,weight:e,display:`swap`});try{await i.load(),document.fonts.add(i),this.loadedFonts.add(r)}catch(n){console.error(`Error loading "${t}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,t)=>{let n=`/2.0.0-canary.122`,r=`https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${r}"]`))e();else{let i=`ui-kit-theme-${n}`,a=document.getElementById(i),o=document.createElement(`link`);o.id=i,o.rel=`stylesheet`,o.href=r,o.onload=()=>e(),o.onerror=()=>t(Error(`Failed to load theme CSS: ${r}`)),document.head.appendChild(o),a?.remove()}}):Promise.resolve()}render(){return this.cssLoaded?i.x`<slot></slot>`:i.E}};c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-fonts`})],f.prototype,`loadFonts`,void 0),c.__decorate([o.n({type:Boolean,converter:u.booleanConverter,attribute:`load-styles`})],f.prototype,`loadStyles`,void 0),c.__decorate([e.e({context:t.themeContext}),o.n({type:String})],f.prototype,`theme`,void 0),c.__decorate([s.r()],f.prototype,`cssLoaded`,void 0),c.__decorate([s.r()],f.prototype,`loadedFonts`,void 0),f=c.__decorate([l.customUiKitElement(`ds-theme-provider`)],f);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../utils/version.cjs`),t=require(`../utils/componentFactory.cjs`);function n(n,r){return function(i){if(!i?.prototype)throw TypeError(`@customUiKitElement requires a class that extends HTMLElement.`);let a=`${n}${e.VERSION_TAG_SUFFIX}`;if(globalThis?.customElements?.get(a))return;let o=r?.skipTagAsComponentName?[]:[n];Array.isArray(r?.extendComponentNames)&&(o=[...r.extendComponentNames,...o]),globalThis?.customElements?.define?.(a,class extends i{constructor(...e){super(...e),this.componentFactory=t.reactFactory}static{this.componentName=o}connectedCallback(){i.prototype.connectedCallback?.call(this),this.setAttribute(`data-ui-kit-version`,`2.0.0-canary.
|
|
1
|
+
const e=require(`../utils/version.cjs`),t=require(`../utils/componentFactory.cjs`);function n(n,r){return function(i){if(!i?.prototype)throw TypeError(`@customUiKitElement requires a class that extends HTMLElement.`);let a=`${n}${e.VERSION_TAG_SUFFIX}`;if(globalThis?.customElements?.get(a))return;let o=r?.skipTagAsComponentName?[]:[n];Array.isArray(r?.extendComponentNames)&&(o=[...r.extendComponentNames,...o]),globalThis?.customElements?.define?.(a,class extends i{constructor(...e){super(...e),this.componentFactory=t.reactFactory}static{this.componentName=o}connectedCallback(){i.prototype.connectedCallback?.call(this),this.setAttribute(`data-ui-kit-version`,`2.0.0-canary.122`)}})}}exports.customUiKitElement=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
1
|
+
const e=require(`../core/theme.constants.cjs`),t=require(`./PubSub.cjs`);var n=class{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;let t=Object.keys(this.icons);this.icons={},t.forEach(e=>this.fetchIcon(e))},this.fetchIcon=async(t,n={})=>{let r=typeof sessionStorage<`u`?sessionStorage?.getItem(e.THEME_STORAGE_KEY):null;!this.theme&&r&&(this.theme=r);let i=this.icons[t];if(i)return await i;let a=this.loadIcon(t,n).catch(e=>{throw delete this.icons[t],e});return this.icons[t]=a,a},this.loadIcon=(e,{cache:t=`force-cache`,...n})=>!this.theme||typeof fetch>`u`?Promise.resolve(`<svg class="ds-icon"></svg>`):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:t,...n}).then(e=>e.text()).catch(t=>{if(t?.name===`AbortError`)throw t;return console.error(`Failed to fetch icon "${e}":`,t),``}),t.pubSub.subscribe(`theme`,this.handleChangeTheme)}},r=Symbol.for(`@cupra/ui-kit/icons-manager/2.0.0-canary.122`),i=globalThis,a=i[r];a||(a=new n,Object.defineProperty(i,r,{value:a,writable:!1,configurable:!1,enumerable:!1}));var o=a;exports.iconsManager=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
1
|
+
var e=class{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(e,t){return this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push(t),this.lastPublishedData[e]}unsubscribe(e,t){this.subscribers[e]&&(this.subscribers[e]=this.subscribers[e].filter(e=>e!==t))}publish(e,t){this.lastPublishedData[e]=t,this.subscribers[e]&&this.subscribers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in subscriber for event "${e}":`,t)}})}},t=Symbol.for(`@cupra/ui-kit/pubsub/2.0.0-canary.122`),n=globalThis,r=n[t];r||(r=new e,Object.defineProperty(n,t,{value:r,writable:!1,configurable:!1,enumerable:!1}));var i=r;exports.pubSub=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.
|
|
1
|
+
var e=require(`../concurrencyLimit.cjs`).concurrencyLimit(20),t=class t{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:t,theme:n})=>{if(!n||!t)return;let r=`https://ds-assets.cupra.com/2.0.0-canary.122/styles/${n}/components/${t}.css`,i=this.getCachedStyleSheetPromise({url:r});if(i)return i;let a=e(()=>this.fetchStyle({url:r})).then(e=>(e||this.stylePromises.delete(r),e));return this.stylePromises.set(r,a),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>`u`)return;let t=await fetch(e,{cache:`force-cache`});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return t.instance||=new t,t.instance}}.getInstance();exports.stylesRegistry=t;
|
|
@@ -44,6 +44,9 @@ require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const e=re
|
|
|
44
44
|
rel=${r?.rel}
|
|
45
45
|
target=${r?.target}
|
|
46
46
|
data-testid=${r?.[`data-testid`]}
|
|
47
|
+
base-variant=${e.o(r?.[`base-variant`])}
|
|
48
|
+
custom-background=${e.o(r?.[`custom-background`])}
|
|
49
|
+
custom-color=${e.o(r?.[`custom-color`])}
|
|
47
50
|
>
|
|
48
51
|
${r.children}
|
|
49
52
|
</${a}>
|
|
@@ -70,6 +73,9 @@ require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const e=re
|
|
|
70
73
|
target=${r?.target}
|
|
71
74
|
data-testid=${r?.[`data-testid`]}
|
|
72
75
|
data-aria-label=${r?.[`data-aria-label`]}
|
|
76
|
+
base-variant=${e.o(r?.[`base-variant`])}
|
|
77
|
+
custom-background=${e.o(r?.[`custom-background`])}
|
|
78
|
+
custom-color=${e.o(r?.[`custom-color`])}
|
|
73
79
|
>
|
|
74
80
|
${r.children}
|
|
75
81
|
</${s}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);function t(t,...n){return e.i`${e.r(String.raw({raw:t},...n).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-122`))}`}exports.cssWithTokens=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-
|
|
1
|
+
const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs`);require(`../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.cjs`);function n(n,...r){return e.x`${t.o(String.raw({raw:n},...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g,`$1-v2-0-0-canary-122`))}`}exports.htmlWithTokens=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`2.0.0-canary.
|
|
1
|
+
var e=`2.0.0-canary.122`,t=`--v${e.replaceAll(`.`,`-`)}`;exports.VERSION=e,exports.VERSION_TAG_SUFFIX=t;
|
|
@@ -17,7 +17,7 @@ import { buttonStyles as p, loadingDotsStyles as m, textStyles as h } from "./st
|
|
|
17
17
|
//#region src/components/ds-button/ds-button.ts
|
|
18
18
|
var g = class extends l(i) {
|
|
19
19
|
constructor(...e) {
|
|
20
|
-
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1;
|
|
20
|
+
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.destructive = !1, this.htmlTagName = "button", this.type = "button", this.iconPosition = "left", this.rounded = !1, this.fullWidth = !1, this.loading = !1, this.baseVariant = "primary";
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.styles = [
|
|
@@ -30,13 +30,14 @@ var g = class extends l(i) {
|
|
|
30
30
|
super.connectedCallback(), this.closestForm = this.closest("form");
|
|
31
31
|
}
|
|
32
32
|
get classes() {
|
|
33
|
-
let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
33
|
+
let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = this.variant === "custom" ? this.baseVariant : this.variant;
|
|
34
34
|
return {
|
|
35
35
|
button: !0,
|
|
36
|
-
|
|
36
|
+
[`tag-${this.htmlTagName}`]: !0,
|
|
37
|
+
[`variant-${t}`]: !0,
|
|
38
|
+
custom: this.variant === "custom",
|
|
37
39
|
[e]: !!e,
|
|
38
40
|
[this.mode]: !!this.mode,
|
|
39
|
-
[this.variant]: !!this.variant,
|
|
40
41
|
rounded: this.rounded,
|
|
41
42
|
disabled: this.disabled || this.loading,
|
|
42
43
|
destructive: this.destructive,
|
|
@@ -75,6 +76,9 @@ var g = class extends l(i) {
|
|
|
75
76
|
get contentTemplate() {
|
|
76
77
|
return this.loading && this.textLoading ? t`${this.textLoading}` : t`<slot></slot>`;
|
|
77
78
|
}
|
|
79
|
+
updated(e) {
|
|
80
|
+
super.updated(e), this.variant === "custom" && this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.variant === "custom" && this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
|
|
81
|
+
}
|
|
78
82
|
get cssTokens() {
|
|
79
83
|
return s`
|
|
80
84
|
<style>
|
|
@@ -136,7 +140,10 @@ var g = class extends l(i) {
|
|
|
136
140
|
`;
|
|
137
141
|
}
|
|
138
142
|
};
|
|
139
|
-
r([n({
|
|
143
|
+
r([n({
|
|
144
|
+
type: String,
|
|
145
|
+
reflect: !0
|
|
146
|
+
})], g.prototype, "variant", void 0), r([n({
|
|
140
147
|
type: String,
|
|
141
148
|
reflect: !0
|
|
142
149
|
})], g.prototype, "mode", void 0), r([n({
|
|
@@ -179,6 +186,15 @@ r([n({ type: String })], g.prototype, "variant", void 0), r([n({
|
|
|
179
186
|
})], g.prototype, "loading", void 0), r([n({
|
|
180
187
|
type: String,
|
|
181
188
|
attribute: "text-loading"
|
|
182
|
-
})], g.prototype, "textLoading", void 0),
|
|
189
|
+
})], g.prototype, "textLoading", void 0), r([n({
|
|
190
|
+
type: String,
|
|
191
|
+
attribute: "base-variant"
|
|
192
|
+
})], g.prototype, "baseVariant", void 0), r([n({
|
|
193
|
+
type: String,
|
|
194
|
+
attribute: "custom-background"
|
|
195
|
+
})], g.prototype, "customBackground", void 0), r([n({
|
|
196
|
+
type: String,
|
|
197
|
+
attribute: "custom-color"
|
|
198
|
+
})], g.prototype, "customColor", void 0), g = r([a("ds-button")], g);
|
|
183
199
|
//#endregion
|
|
184
200
|
export { g as DsButton };
|
|
@@ -31,7 +31,7 @@ var t = e`
|
|
|
31
31
|
width: 100%;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.custom ::slotted(*) {
|
|
34
|
+
.tag-custom ::slotted(*) {
|
|
35
35
|
display: inline-flex;
|
|
36
36
|
align-items: center;
|
|
37
37
|
justify-content: center;
|
|
@@ -53,13 +53,13 @@ var t = e`
|
|
|
53
53
|
box-sizing: border-box;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.custom ::slotted(*:disabled),
|
|
57
|
-
.custom.disabled ::slotted(*) {
|
|
56
|
+
.tag-custom ::slotted(*:disabled),
|
|
57
|
+
.tag-custom.disabled ::slotted(*) {
|
|
58
58
|
pointer-events: none;
|
|
59
59
|
cursor: default;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.custom ::slotted(*:focus-visible) {
|
|
62
|
+
.tag-custom ::slotted(*:focus-visible) {
|
|
63
63
|
outline: none;
|
|
64
64
|
}
|
|
65
65
|
`, n = e`
|
|
@@ -16,7 +16,7 @@ import { buttonStyles as f } from "./styles/common.styles.js";
|
|
|
16
16
|
//#region src/components/ds-icon-button/ds-icon-button.ts
|
|
17
17
|
var p = class extends l(i) {
|
|
18
18
|
constructor(...e) {
|
|
19
|
-
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
|
|
19
|
+
super(...e), this.variant = "primary", this.baseVariant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
22
|
this.styles = [f];
|
|
@@ -35,16 +35,20 @@ var p = class extends l(i) {
|
|
|
35
35
|
t && !t.contains(e.composedPath()[0]) && (e.stopPropagation(), t.click());
|
|
36
36
|
}
|
|
37
37
|
get classes() {
|
|
38
|
-
let e = typeof this.size == "string" ? this.size : this.size[this.viewport];
|
|
38
|
+
let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = this.variant === "custom" ? this.baseVariant : this.variant;
|
|
39
39
|
return {
|
|
40
40
|
button: !0,
|
|
41
|
-
|
|
41
|
+
[`tag-${this.htmlTagName}`]: !0,
|
|
42
|
+
[`variant-${t}`]: !0,
|
|
43
|
+
custom: this.variant === "custom",
|
|
42
44
|
disabled: this.disabled,
|
|
43
45
|
[e]: !!e,
|
|
44
|
-
[this.mode]: !!this.mode
|
|
45
|
-
[this.variant]: !!this.variant
|
|
46
|
+
[this.mode]: !!this.mode
|
|
46
47
|
};
|
|
47
48
|
}
|
|
49
|
+
updated(e) {
|
|
50
|
+
super.updated(e), this.variant === "custom" && this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.variant === "custom" && this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
|
|
51
|
+
}
|
|
48
52
|
get variantColorTokens() {
|
|
49
53
|
return s`
|
|
50
54
|
<style>
|
|
@@ -57,11 +61,6 @@ var p = class extends l(i) {
|
|
|
57
61
|
}
|
|
58
62
|
render() {
|
|
59
63
|
return t`
|
|
60
|
-
<style>
|
|
61
|
-
:host {
|
|
62
|
-
pointer-events: ${this.disabled ? "none" : "visible"};
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
65
64
|
${this.variantColorTokens}
|
|
66
65
|
${d(this.htmlTagName || "button", [
|
|
67
66
|
["button", () => t`
|
|
@@ -95,7 +94,19 @@ var p = class extends l(i) {
|
|
|
95
94
|
`;
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
r([n({
|
|
97
|
+
r([n({
|
|
98
|
+
type: String,
|
|
99
|
+
reflect: !0
|
|
100
|
+
})], p.prototype, "variant", void 0), r([n({
|
|
101
|
+
type: String,
|
|
102
|
+
attribute: "base-variant"
|
|
103
|
+
})], p.prototype, "baseVariant", void 0), r([n({
|
|
104
|
+
type: String,
|
|
105
|
+
attribute: "custom-background"
|
|
106
|
+
})], p.prototype, "customBackground", void 0), r([n({
|
|
107
|
+
type: String,
|
|
108
|
+
attribute: "custom-color"
|
|
109
|
+
})], p.prototype, "customColor", void 0), r([n({
|
|
99
110
|
type: String,
|
|
100
111
|
reflect: !0
|
|
101
112
|
})], p.prototype, "mode", void 0), r([n({
|
|
@@ -50,7 +50,7 @@ var p = class extends o {
|
|
|
50
50
|
}
|
|
51
51
|
loadThemeStyles() {
|
|
52
52
|
return this.loadStyles ? new Promise((e, t) => {
|
|
53
|
-
let n = "/2.0.0-canary.
|
|
53
|
+
let n = "/2.0.0-canary.122", r = `https://ds-assets.cupra.com${n}/styles/${this.theme}/theme.css`;
|
|
54
54
|
if (document.head.querySelector(`link[href="${r}"]`)) e();
|
|
55
55
|
else {
|
|
56
56
|
let i = `ui-kit-theme-${n}`, a = document.getElementById(i), o = document.createElement("link");
|
|
@@ -15,7 +15,7 @@ function n(n, r) {
|
|
|
15
15
|
this.componentName = o;
|
|
16
16
|
}
|
|
17
17
|
connectedCallback() {
|
|
18
|
-
i.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.
|
|
18
|
+
i.prototype.connectedCallback?.call(this), this.setAttribute("data-ui-kit-version", "2.0.0-canary.122");
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
};
|
|
@@ -25,7 +25,7 @@ var n = class {
|
|
|
25
25
|
return console.error(`Failed to fetch icon "${e}":`, t), "";
|
|
26
26
|
}), t.subscribe("theme", this.handleChangeTheme);
|
|
27
27
|
}
|
|
28
|
-
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
}, r = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.122"), i = globalThis, a = i[r];
|
|
29
29
|
a || (a = new n(), Object.defineProperty(i, r, {
|
|
30
30
|
value: a,
|
|
31
31
|
writable: !1,
|
|
@@ -18,7 +18,7 @@ var e = class {
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
}, t = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.122"), n = globalThis, r = n[t];
|
|
22
22
|
r || (r = new e(), Object.defineProperty(n, t, {
|
|
23
23
|
value: r,
|
|
24
24
|
writable: !1,
|
|
@@ -4,7 +4,7 @@ var t = e(20), n = class e {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.stylePromises = /* @__PURE__ */ new Map(), this.getStyles = async ({ componentName: e, theme: n }) => {
|
|
6
6
|
if (!n || !e) return;
|
|
7
|
-
let r = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
7
|
+
let r = `https://ds-assets.cupra.com/2.0.0-canary.122/styles/${n}/components/${e}.css`, i = this.getCachedStyleSheetPromise({ url: r });
|
|
8
8
|
if (i) return i;
|
|
9
9
|
let a = t(() => this.fetchStyle({ url: r })).then((e) => (e || this.stylePromises.delete(r), e));
|
|
10
10
|
return this.stylePromises.set(r, a), this.stylePromises.get(r);
|
|
@@ -54,6 +54,9 @@ var i = t(`ds-icon${r}`), a = t(`ds-calendar-day${r}`), o = t(`ds-button${r}`),
|
|
|
54
54
|
rel=${t?.rel}
|
|
55
55
|
target=${t?.target}
|
|
56
56
|
data-testid=${t?.["data-testid"]}
|
|
57
|
+
base-variant=${e(t?.["base-variant"])}
|
|
58
|
+
custom-background=${e(t?.["custom-background"])}
|
|
59
|
+
custom-color=${e(t?.["custom-color"])}
|
|
57
60
|
>
|
|
58
61
|
${t.children}
|
|
59
62
|
</${o}>
|
|
@@ -82,6 +85,9 @@ var i = t(`ds-icon${r}`), a = t(`ds-calendar-day${r}`), o = t(`ds-button${r}`),
|
|
|
82
85
|
target=${t?.target}
|
|
83
86
|
data-testid=${t?.["data-testid"]}
|
|
84
87
|
data-aria-label=${t?.["data-aria-label"]}
|
|
88
|
+
base-variant=${e(t?.["base-variant"])}
|
|
89
|
+
custom-background=${e(t?.["custom-background"])}
|
|
90
|
+
custom-color=${e(t?.["custom-color"])}
|
|
85
91
|
>
|
|
86
92
|
${t.children}
|
|
87
93
|
</${c}>
|
|
@@ -2,7 +2,7 @@ import { i as e, r as t } from "../node_modules/.pnpm/@lit_reactive-element@2.1.
|
|
|
2
2
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.js";
|
|
3
3
|
//#region src/utils/cssWithTokens.ts
|
|
4
4
|
function n(n, ...r) {
|
|
5
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
5
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-122"))}`;
|
|
6
6
|
}
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as cssWithTokens };
|
|
@@ -4,7 +4,7 @@ import { o as t } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-ht
|
|
|
4
4
|
import "../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/unsafe-html.js";
|
|
5
5
|
//#region src/utils/htmlWithTokens.ts
|
|
6
6
|
function n(n, ...r) {
|
|
7
|
-
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
7
|
+
return e`${t(String.raw({ raw: n }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-122"))}`;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { n as htmlWithTokens };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
|
-
import { nothing } from 'lit';
|
|
2
|
+
import { type PropertyValues, nothing } from 'lit';
|
|
3
3
|
import type { DsButtonAttrs } from './ds-button.types';
|
|
4
4
|
declare const DsButton_base: (new (...args: any[]) => import("../../mixins/ViewportMixin").ViewportInterface) & typeof UiKitElement;
|
|
5
5
|
export declare class DsButton extends DsButton_base {
|
|
@@ -19,6 +19,9 @@ export declare class DsButton extends DsButton_base {
|
|
|
19
19
|
fullWidth: DsButtonAttrs['full-width'];
|
|
20
20
|
loading: DsButtonAttrs['loading'];
|
|
21
21
|
textLoading: DsButtonAttrs['text-loading'];
|
|
22
|
+
baseVariant: DsButtonAttrs['base-variant'];
|
|
23
|
+
customBackground: DsButtonAttrs['custom-background'];
|
|
24
|
+
customColor: DsButtonAttrs['custom-color'];
|
|
22
25
|
private closestForm;
|
|
23
26
|
static styles: import("lit").CSSResult[];
|
|
24
27
|
connectedCallback(): void;
|
|
@@ -36,6 +39,7 @@ export declare class DsButton extends DsButton_base {
|
|
|
36
39
|
protected get iconTemplate(): any;
|
|
37
40
|
protected get loadingTemplate(): typeof nothing | import("lit").TemplateResult<1>;
|
|
38
41
|
protected get contentTemplate(): import("lit").TemplateResult<1>;
|
|
42
|
+
updated(changedProperties: PropertyValues): void;
|
|
39
43
|
protected get cssTokens(): import("lit").HTMLTemplateResult;
|
|
40
44
|
render(): import("lit").TemplateResult<1>;
|
|
41
45
|
}
|
|
@@ -23,8 +23,7 @@ type CustomElement = {
|
|
|
23
23
|
target?: never;
|
|
24
24
|
};
|
|
25
25
|
type HtmlElement = Link | Button | CustomElement;
|
|
26
|
-
|
|
27
|
-
variant?: string;
|
|
26
|
+
type SharedButtonAttrs = {
|
|
28
27
|
mode?: 'dark' | 'light';
|
|
29
28
|
disabled?: boolean;
|
|
30
29
|
destructive?: boolean;
|
|
@@ -37,5 +36,19 @@ export type DsButtonAttrs = {
|
|
|
37
36
|
'full-width'?: boolean;
|
|
38
37
|
loading?: boolean;
|
|
39
38
|
'text-loading'?: string;
|
|
40
|
-
}
|
|
39
|
+
};
|
|
40
|
+
export type DsButtonStandardVariant = 'primary' | 'secondary' | 'tertiary' | 'naked';
|
|
41
|
+
type StandardVariantAttrs = {
|
|
42
|
+
variant?: DsButtonStandardVariant;
|
|
43
|
+
'base-variant'?: never;
|
|
44
|
+
'custom-background'?: never;
|
|
45
|
+
'custom-color'?: never;
|
|
46
|
+
};
|
|
47
|
+
type CustomVariantAttrs = {
|
|
48
|
+
variant: 'custom';
|
|
49
|
+
'base-variant'?: DsButtonStandardVariant;
|
|
50
|
+
'custom-background'?: string;
|
|
51
|
+
'custom-color'?: string;
|
|
52
|
+
};
|
|
53
|
+
export type DsButtonAttrs = (StandardVariantAttrs | CustomVariantAttrs) & SharedButtonAttrs & HtmlElement & CommonAttrs;
|
|
41
54
|
export {};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { UiKitElement } from '../base/UiKitElement.ts';
|
|
2
2
|
import type { DsIconButtonAttrs } from '../ds-icon-button/ds-icon-button.types.ts';
|
|
3
|
-
import { type TemplateResult } from 'lit';
|
|
3
|
+
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
4
4
|
declare const DsIconButton_base: (new (...args: any[]) => import("../../mixins/ViewportMixin.ts").ViewportInterface) & typeof UiKitElement;
|
|
5
5
|
export declare class DsIconButton extends DsIconButton_base {
|
|
6
6
|
static styles: import("lit").CSSResult[];
|
|
7
7
|
variant: DsIconButtonAttrs['variant'];
|
|
8
|
+
baseVariant: DsIconButtonAttrs['base-variant'];
|
|
9
|
+
customBackground: DsIconButtonAttrs['custom-background'];
|
|
10
|
+
customColor: DsIconButtonAttrs['custom-color'];
|
|
8
11
|
mode: DsIconButtonAttrs['mode'];
|
|
9
12
|
size: DsIconButtonAttrs['size'];
|
|
10
13
|
disabled: DsIconButtonAttrs['disabled'];
|
|
@@ -23,6 +26,7 @@ export declare class DsIconButton extends DsIconButton_base {
|
|
|
23
26
|
custom: boolean;
|
|
24
27
|
disabled: boolean;
|
|
25
28
|
};
|
|
29
|
+
updated(changedProperties: PropertyValues): void;
|
|
26
30
|
protected get variantColorTokens(): TemplateResult;
|
|
27
31
|
render(): TemplateResult<1>;
|
|
28
32
|
}
|
|
@@ -23,12 +23,25 @@ type CustomElement = {
|
|
|
23
23
|
target?: never;
|
|
24
24
|
};
|
|
25
25
|
type HtmlElement = Link | Button | CustomElement;
|
|
26
|
-
|
|
27
|
-
variant?: string;
|
|
26
|
+
type SharedIconButtonAttrs = {
|
|
28
27
|
mode?: 'dark' | 'light';
|
|
29
28
|
size?: Size | ResponsiveSize;
|
|
30
29
|
disabled?: boolean;
|
|
31
30
|
'data-aria-label'?: string;
|
|
32
31
|
'icon-name'?: DsIconAttrs['icon-name'];
|
|
33
|
-
}
|
|
32
|
+
};
|
|
33
|
+
export type DsIconButtonStandardVariant = 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'naked' | 'rounded';
|
|
34
|
+
type StandardVariantAttrs = {
|
|
35
|
+
variant?: DsIconButtonStandardVariant;
|
|
36
|
+
'base-variant'?: never;
|
|
37
|
+
'custom-background'?: never;
|
|
38
|
+
'custom-color'?: never;
|
|
39
|
+
};
|
|
40
|
+
type CustomVariantAttrs = {
|
|
41
|
+
variant: 'custom';
|
|
42
|
+
'base-variant'?: DsIconButtonStandardVariant;
|
|
43
|
+
'custom-background'?: string;
|
|
44
|
+
'custom-color'?: string;
|
|
45
|
+
};
|
|
46
|
+
export type DsIconButtonAttrs = (StandardVariantAttrs | CustomVariantAttrs) & SharedIconButtonAttrs & HtmlElement & CommonAttrs;
|
|
34
47
|
export {};
|