@cupra/ui-kit 2.0.0-canary.125 → 2.0.0-canary.127
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-icon-button/ds-icon-button.cjs +2 -2
- package/dist/cjs/components/ds-select/ds-select.cjs +7 -6
- 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 +0 -4
- 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 +5 -8
- package/dist/esm/components/ds-icon-button/ds-icon-button.js +5 -8
- package/dist/esm/components/ds-select/ds-select.js +28 -18
- 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 +0 -4
- 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 +0 -1
- package/dist/types/components/ds-button/ds-button.types.d.ts +6 -16
- package/dist/types/components/ds-icon-button/ds-icon-button.d.ts +0 -1
- package/dist/types/components/ds-icon-button/ds-icon-button.types.d.ts +6 -16
- package/dist/types/components/ds-select/ds-select.d.ts +4 -1
- package/dist/types/components/ds-select/ds-select.types.d.ts +2 -0
- package/dist-react/cjs/components/ds-button/ds-button.cjs +3 -3
- package/dist-react/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -2
- package/dist-react/cjs/components/ds-select/ds-select.cjs +7 -6
- 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 +0 -2
- 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 +5 -8
- package/dist-react/esm/components/ds-icon-button/ds-icon-button.js +5 -8
- package/dist-react/esm/components/ds-select/ds-select.js +28 -18
- 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 +0 -2
- 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 +0 -1
- package/dist-react/types/components/ds-button/ds-button.types.d.ts +6 -16
- package/dist-react/types/components/ds-icon-button/ds-icon-button.d.ts +0 -1
- package/dist-react/types/components/ds-icon-button/ds-icon-button.types.d.ts +6 -16
- package/dist-react/types/components/ds-select/ds-select.d.ts +4 -1
- package/dist-react/types/components/ds-select/ds-select.types.d.ts +2 -0
- 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
|
|
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],t=!!(this.customBackground||this.customColor);return{button:!0,[`tag-${this.htmlTagName}`]:!0,[`variant-${this.variant}`]:!0,custom:t,[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>`}updated(e){super.updated(e),this.
|
|
7
|
+
`:e.E}get contentTemplate(){return this.loading&&this.textLoading?e.x`${this.textLoading}`:e.x`<slot></slot>`}updated(e){super.updated(e),this.customBackground?this.style.setProperty(`--ui-kit-button-custom-bg`,this.customBackground):this.style.removeProperty(`--ui-kit-button-custom-bg`),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,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:`
|
|
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:`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}});
|
|
@@ -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.
|
|
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],t=!!(this.customBackground||this.customColor);return{button:!0,[`tag-${this.htmlTagName}`]:!0,[`variant-${this.variant}`]:!0,custom:t,disabled:this.disabled,[e]:!!e,[this.mode]:!!this.mode}}updated(e){super.updated(e),this.customBackground?this.style.setProperty(`--ui-kit-button-custom-bg`,this.customBackground):this.style.removeProperty(`--ui-kit-button-custom-bg`),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};
|
|
@@ -32,4 +32,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
32
32
|
<slot></slot>
|
|
33
33
|
</div>
|
|
34
34
|
`]])}
|
|
35
|
-
`}};n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`variant`,void 0),n.__decorate([t.n({type:String,attribute:`
|
|
35
|
+
`}};n.__decorate([t.n({type:String,reflect:!0})],f.prototype,`variant`,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
|
-
require(`../ds-theme-provider/themeContext.cjs`);const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`),r=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs`),i=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const a=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),o=require(`../base/UiKitElement.cjs`),s=require(`../../decorators/customUiKitElement.cjs`),c=require(`../../utils/booleanConverter.cjs`),l=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 u=require(`./controllers/SelectKeyboardController.cjs`),d=require(`./styles/common.styles.cjs`);var f,p=class extends o.UiKitElement{static{f=this}constructor(...e){super(...e),this.mode=`light`,this.size=`large`,this.variant=`primary`,this.readonly=!1,this._open=!1,this.nativeSelect=null,this.nativeLabel=null,this.nativeOptions=[],this.
|
|
1
|
+
require(`../ds-theme-provider/themeContext.cjs`);const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`),r=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs`),i=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const a=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),o=require(`../base/UiKitElement.cjs`),s=require(`../../decorators/customUiKitElement.cjs`),c=require(`../../utils/booleanConverter.cjs`),l=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 u=require(`./controllers/SelectKeyboardController.cjs`),d=require(`./styles/common.styles.cjs`);var f,p=class extends o.UiKitElement{static{f=this}constructor(...e){super(...e),this.mode=`light`,this.size=`large`,this.variant=`primary`,this.readonly=!1,this.iconName=void 0,this._open=!1,this._keyboardNavigating=!1,this.nativeSelect=null,this.nativeLabel=null,this.nativeOptions=[],this.keyboardFocusIndex=-1,this.hasForcedError=!1,this.handleMutations=e=>{e.forEach(e=>{e.type===`childList`&&this.syncNativeOptions()}),this.requestUpdate()},this.syncNativeOptions=()=>{this.nativeOptions=Array.from(this.nativeSelect.options)},this.handleOpen=()=>{this.readonly||(this._open=!0,this.keyboardFocusIndex=this.findSelectedOptionIndex(),this.focusDisplaySelect())},this.handleClose=()=>{this._open=!1},this.handleClickDisplaySelect=()=>{this._open?this.handleClose():(this._keyboardNavigating=!1,this.handleOpen())},this.handleKeydown=e=>{this._open?(this._keyboardNavigating=!0,u.SelectKeyboardController.handleKeydownWhenOpen(e,{commit:()=>this.commitSelection(),navigateNext:()=>this.advanceSelection(1),navigatePrev:()=>this.advanceSelection(-1),navigateFirst:()=>this.advanceToFirst(),navigateLast:()=>this.advanceToLast(),close:this.handleClose})):u.SelectKeyboardController.handleKeydownWhenClosed(e,{open:()=>{this._keyboardNavigating=!0,this.handleOpen()}})}}static{this.styles=[d.commonStyles]}static{this.ARIA_OPTION_PREFIX=`option-`}firstUpdated(){queueMicrotask(()=>this.initializeNativeSelect())}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}initializeNativeSelect(){this.nativeSelect=this.nativeSelects?.[0],this.nativeLabel=this.nativeLabels?.[0],this.nativeSelect&&(this.syncNativeOptions(),this.setupNativeElementsAttributes(),this.setupEventListeners())}handleChangeForcedError(){this.hasForcedError=this.forcedError?.length>0}setupNativeElementsAttributes(){this.nativeSelect.setAttribute(`aria-hidden`,`true`),this.nativeSelect.setAttribute(`tabindex`,`-1`)}setupEventListeners(){this.nativeSelect.addEventListener(`change`,this.syncNativeOptions),this.observer=new MutationObserver(this.handleMutations),this.observer.observe(this.nativeSelect,{childList:!0,subtree:!0,attributes:!0})}cleanup(){this.nativeSelect?.removeEventListener(`change`,this.syncNativeOptions),this.observer?.disconnect()}findSelectedOptionIndex(){let e=this.nativeOptions.findIndex(e=>e.value===this.nativeSelect.value);return this.nativeOptions[e]?.hidden?this.nativeOptions.findIndex(e=>!e.hidden):e}focusDisplaySelect(){this.updateComplete.then(()=>{this.displaySelect?.focus()})}advanceToFirst(){if(this.nativeOptions.length){let e=this.nativeOptions.findIndex(e=>!e.hidden);this.advanceSelection(e-this.keyboardFocusIndex)}}advanceToLast(){if(this.nativeOptions.length){let e=-1;for(let t=this.nativeOptions.length-1;t>=0;t--)if(!this.nativeOptions[t].hidden){e=t;break}this.advanceSelection(e-this.keyboardFocusIndex)}}advanceSelection(e){let t=this.nativeOptions.length;this.keyboardFocusIndex=(this.keyboardFocusIndex+e+t)%t,this.shouldSkipHiddenOption()?this.advanceSelection(Math.sign(e)):this.scrollToActive(this.nativeOptions[this.keyboardFocusIndex])}shouldSkipHiddenOption(){return this.nativeOptions.some(e=>!e.hidden)&&this.nativeOptions[this.keyboardFocusIndex].hidden}scrollToActive(e){e?.scrollIntoView?.({block:`nearest`})}commitSelection(e=this.keyboardFocusIndex){this.handleClose();let t=this.nativeOptions[e];this.nativeSelect&&t?.value&&this.updateNativeSelectValue(t.value)}updateNativeSelectValue(e){this.nativeSelect.value=e,[`input`,`change`].forEach(e=>this.nativeSelect.dispatchEvent(new Event(e,{bubbles:!0,composed:!0})))}get containerClasses(){return{container:!0,open:this._open,disabled:!!this.nativeSelect?.disabled,readonly:!!this.readonly,filled:!!this.nativeOptions?.find(e=>e.selected&&!e.hidden)?.selected,invalid:!this.nativeSelect?.validity.valid,error:this.hasForcedError,[this.size]:!!this.size,[this.mode]:!!this.mode,[this.variant]:!!this.variant}}set open(e){this._open=e}get open(){return this._open}render(){return e.x`
|
|
2
2
|
<slot @slotchange=${this.initializeNativeSelect}></slot>
|
|
3
3
|
<div class=${l.e(this.containerClasses)}>
|
|
4
4
|
${this.displaySelectTemplate}
|
|
@@ -8,7 +8,7 @@ require(`../ds-theme-provider/themeContext.cjs`);const e=require(`../../node_mod
|
|
|
8
8
|
<slot name="forced-error" @slotchange=${this.handleChangeForcedError}></slot>
|
|
9
9
|
<slot name="invalid-error"></slot>
|
|
10
10
|
</div>
|
|
11
|
-
`}get iconTemplate(){return this.componentFactory.createIcon({class:`icon`,"icon-name":this._open?`arrow-up`:`arrow-down`})}get displaySelectTemplate(){let t=this.nativeOptions.find(e=>e.selected),n=Array.from(t?.childNodes||[])?.map(e=>{let t=e.cloneNode(!0);if(e.nodeType!==3)return t;if(e.textContent.trim()===``)return``;let n=document.createElement(`span`);return n.classList.add(`text`),n.appendChild(t),n});return e.x`
|
|
11
|
+
`}get iconTemplate(){return this.componentFactory.createIcon({class:`icon`,"icon-name":this._open?`arrow-up`:`arrow-down`})}get leftIconTemplate(){return this.iconName?this.componentFactory.createIcon({class:`left-icon`,"icon-name":this.iconName}):e.E}get displaySelectTemplate(){let t=this.nativeOptions.find(e=>e.selected),n=Array.from(t?.childNodes||[])?.map(e=>{let t=e.cloneNode(!0);if(e.nodeType!==3)return t;if(e.textContent.trim()===``)return``;let n=document.createElement(`span`);return n.classList.add(`text`),n.appendChild(t),n});return e.x`
|
|
12
12
|
<div class="select-outline">
|
|
13
13
|
<div class="select-container">
|
|
14
14
|
<label id="display-label" class="label">${this.nativeLabel?.innerText}</label>
|
|
@@ -25,24 +25,25 @@ require(`../ds-theme-provider/themeContext.cjs`);const e=require(`../../node_mod
|
|
|
25
25
|
@keydown=${this.handleKeydown}
|
|
26
26
|
@blur=${this.handleClose}
|
|
27
27
|
>
|
|
28
|
+
${this.leftIconTemplate}
|
|
28
29
|
<span class="select-content">${n}</span>
|
|
29
30
|
${this.iconTemplate}
|
|
30
31
|
</div>
|
|
31
32
|
</div>
|
|
32
33
|
</div>
|
|
33
|
-
`}get activeDescendantId(){return this._open&&this.
|
|
34
|
+
`}get activeDescendantId(){return this._open&&this.keyboardFocusIndex>=0?`${f.ARIA_OPTION_PREFIX}${this.nativeOptions[this.keyboardFocusIndex].value}`:``}get optionsContainerTemplate(){return e.x`
|
|
34
35
|
<div id="options-container" class="options-container" role="listbox">
|
|
35
36
|
${this.nativeOptions.map((t,n)=>t.hidden?e.E:this.renderOptionClone(t,n))}
|
|
36
37
|
</div>
|
|
37
38
|
`}renderOptionClone(t,n){let r=Array.from(t.childNodes).map(e=>e.cloneNode(!0));return e.x`
|
|
38
39
|
<div
|
|
39
40
|
id="${f.ARIA_OPTION_PREFIX}${t.value}"
|
|
40
|
-
class=${l.e({option:!0,
|
|
41
|
+
class=${l.e({option:!0,"keyboard-focused":n===this.keyboardFocusIndex&&this._keyboardNavigating,selected:t.value===this.nativeSelect.value})}
|
|
41
42
|
role="option"
|
|
42
43
|
aria-selected="${t.value===this.nativeSelect.value}"
|
|
43
44
|
tabindex="-1"
|
|
44
|
-
@mousedown=${()=>
|
|
45
|
+
@mousedown=${()=>this.commitSelection(n)}
|
|
45
46
|
>
|
|
46
47
|
${r}
|
|
47
48
|
</div>
|
|
48
|
-
`}};a.__decorate([t.n({type:String})],p.prototype,`mode`,void 0),a.__decorate([t.n({type:String})],p.prototype,`size`,void 0),a.__decorate([t.n({type:String})],p.prototype,`variant`,void 0),a.__decorate([t.n({type:Boolean,converter:c.booleanConverter,reflect:!0})],p.prototype,`readonly`,void 0),a.__decorate([n.r()],p.prototype,`_open`,void 0),a.__decorate([n.r()],p.prototype,`nativeOptions`,void 0),a.__decorate([n.r()],p.prototype,`
|
|
49
|
+
`}};a.__decorate([t.n({type:String})],p.prototype,`mode`,void 0),a.__decorate([t.n({type:String})],p.prototype,`size`,void 0),a.__decorate([t.n({type:String})],p.prototype,`variant`,void 0),a.__decorate([t.n({type:Boolean,converter:c.booleanConverter,reflect:!0})],p.prototype,`readonly`,void 0),a.__decorate([t.n({type:String,attribute:`icon-name`})],p.prototype,`iconName`,void 0),a.__decorate([n.r()],p.prototype,`_open`,void 0),a.__decorate([n.r()],p.prototype,`_keyboardNavigating`,void 0),a.__decorate([n.r()],p.prototype,`nativeOptions`,void 0),a.__decorate([n.r()],p.prototype,`keyboardFocusIndex`,void 0),a.__decorate([n.r()],p.prototype,`hasForcedError`,void 0),a.__decorate([i.o({slot:``,selector:`select`,flatten:!0})],p.prototype,`nativeSelects`,void 0),a.__decorate([i.o({slot:``,selector:`label`,flatten:!0})],p.prototype,`nativeLabels`,void 0),a.__decorate([i.o({slot:`forced-error`,flatten:!0})],p.prototype,`forcedError`,void 0),a.__decorate([r.e(`.select`)],p.prototype,`displaySelect`,void 0),p=f=a.__decorate([s.customUiKitElement(`ds-select`)],p);
|
|
@@ -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.127`,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.127`)}})}}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.127`),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.127`),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.127/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,7 +44,6 @@ 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
47
|
custom-background=${t.o(n?.[`custom-background`])}
|
|
49
48
|
custom-color=${t.o(n?.[`custom-color`])}
|
|
50
49
|
>
|
|
@@ -73,7 +72,6 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
73
72
|
target=${n?.target}
|
|
74
73
|
data-testid=${n?.[`data-testid`]}
|
|
75
74
|
data-aria-label=${n?.[`data-aria-label`]}
|
|
76
|
-
base-variant=${t.o(n?.[`base-variant`])}
|
|
77
75
|
custom-background=${t.o(n?.[`custom-background`])}
|
|
78
76
|
custom-color=${t.o(n?.[`custom-color`])}
|
|
79
77
|
>
|
|
@@ -167,7 +165,6 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
167
165
|
rel=${e?.rel}
|
|
168
166
|
target=${e?.target}
|
|
169
167
|
data-testid=${e?.[`data-testid`]}
|
|
170
|
-
base-variant=${t.o(e?.[`base-variant`])}
|
|
171
168
|
custom-background=${t.o(e?.[`custom-background`])}
|
|
172
169
|
custom-color=${t.o(e?.[`custom-color`])}
|
|
173
170
|
>
|
|
@@ -196,7 +193,6 @@ const e=require(`../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-
|
|
|
196
193
|
target=${e?.target}
|
|
197
194
|
data-testid=${e?.[`data-testid`]}
|
|
198
195
|
data-aria-label=${e?.[`data-aria-label`]}
|
|
199
|
-
base-variant=${t.o(e?.[`base-variant`])}
|
|
200
196
|
custom-background=${t.o(e?.[`custom-background`])}
|
|
201
197
|
custom-color=${t.o(e?.[`custom-color`])}
|
|
202
198
|
>
|
|
@@ -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-127`))}`}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-127`))}`}exports.htmlWithTokens=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`2.0.0-canary.
|
|
1
|
+
var e=`2.0.0-canary.127`,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;
|
|
21
21
|
}
|
|
22
22
|
static {
|
|
23
23
|
this.styles = [
|
|
@@ -30,12 +30,12 @@ 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], t = this.
|
|
33
|
+
let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = !!(this.customBackground || this.customColor);
|
|
34
34
|
return {
|
|
35
35
|
button: !0,
|
|
36
36
|
[`tag-${this.htmlTagName}`]: !0,
|
|
37
|
-
[`variant-${
|
|
38
|
-
custom:
|
|
37
|
+
[`variant-${this.variant}`]: !0,
|
|
38
|
+
custom: t,
|
|
39
39
|
[e]: !!e,
|
|
40
40
|
[this.mode]: !!this.mode,
|
|
41
41
|
rounded: this.rounded,
|
|
@@ -77,7 +77,7 @@ var g = class extends l(i) {
|
|
|
77
77
|
return this.loading && this.textLoading ? t`${this.textLoading}` : t`<slot></slot>`;
|
|
78
78
|
}
|
|
79
79
|
updated(e) {
|
|
80
|
-
super.updated(e), this.
|
|
80
|
+
super.updated(e), this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
|
|
81
81
|
}
|
|
82
82
|
get cssTokens() {
|
|
83
83
|
return s`
|
|
@@ -187,9 +187,6 @@ r([n({
|
|
|
187
187
|
type: String,
|
|
188
188
|
attribute: "text-loading"
|
|
189
189
|
})], g.prototype, "textLoading", void 0), r([n({
|
|
190
|
-
type: String,
|
|
191
|
-
attribute: "base-variant"
|
|
192
|
-
})], g.prototype, "baseVariant", void 0), r([n({
|
|
193
190
|
type: String,
|
|
194
191
|
attribute: "custom-background"
|
|
195
192
|
})], g.prototype, "customBackground", void 0), r([n({
|
|
@@ -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.
|
|
19
|
+
super(...e), this.variant = "primary", this.mode = "light", this.size = "large", this.disabled = !1, this.htmlTagName = "button";
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
22
|
this.styles = [f];
|
|
@@ -35,19 +35,19 @@ 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], t = this.
|
|
38
|
+
let e = typeof this.size == "string" ? this.size : this.size[this.viewport], t = !!(this.customBackground || this.customColor);
|
|
39
39
|
return {
|
|
40
40
|
button: !0,
|
|
41
41
|
[`tag-${this.htmlTagName}`]: !0,
|
|
42
|
-
[`variant-${
|
|
43
|
-
custom:
|
|
42
|
+
[`variant-${this.variant}`]: !0,
|
|
43
|
+
custom: t,
|
|
44
44
|
disabled: this.disabled,
|
|
45
45
|
[e]: !!e,
|
|
46
46
|
[this.mode]: !!this.mode
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
updated(e) {
|
|
50
|
-
super.updated(e), this.
|
|
50
|
+
super.updated(e), this.customBackground ? this.style.setProperty("--ui-kit-button-custom-bg", this.customBackground) : this.style.removeProperty("--ui-kit-button-custom-bg"), this.customColor ? this.style.setProperty("--ui-kit-button-custom-color", this.customColor) : this.style.removeProperty("--ui-kit-button-custom-color");
|
|
51
51
|
}
|
|
52
52
|
get variantColorTokens() {
|
|
53
53
|
return s`
|
|
@@ -98,9 +98,6 @@ r([n({
|
|
|
98
98
|
type: String,
|
|
99
99
|
reflect: !0
|
|
100
100
|
})], p.prototype, "variant", void 0), r([n({
|
|
101
|
-
type: String,
|
|
102
|
-
attribute: "base-variant"
|
|
103
|
-
})], p.prototype, "baseVariant", void 0), r([n({
|
|
104
101
|
type: String,
|
|
105
102
|
attribute: "custom-background"
|
|
106
103
|
})], p.prototype, "customBackground", void 0), r([n({
|
|
@@ -20,27 +20,29 @@ var p, m = class extends s {
|
|
|
20
20
|
p = this;
|
|
21
21
|
}
|
|
22
22
|
constructor(...e) {
|
|
23
|
-
super(...e), this.mode = "light", this.size = "large", this.variant = "primary", this.readonly = !1, this._open = !1, this.nativeSelect = null, this.nativeLabel = null, this.nativeOptions = [], this.
|
|
23
|
+
super(...e), this.mode = "light", this.size = "large", this.variant = "primary", this.readonly = !1, this.iconName = void 0, this._open = !1, this._keyboardNavigating = !1, this.nativeSelect = null, this.nativeLabel = null, this.nativeOptions = [], this.keyboardFocusIndex = -1, this.hasForcedError = !1, this.handleMutations = (e) => {
|
|
24
24
|
e.forEach((e) => {
|
|
25
25
|
e.type === "childList" && this.syncNativeOptions();
|
|
26
26
|
}), this.requestUpdate();
|
|
27
27
|
}, this.syncNativeOptions = () => {
|
|
28
28
|
this.nativeOptions = Array.from(this.nativeSelect.options);
|
|
29
29
|
}, this.handleOpen = () => {
|
|
30
|
-
this.readonly || (this._open = !0, this.
|
|
30
|
+
this.readonly || (this._open = !0, this.keyboardFocusIndex = this.findSelectedOptionIndex(), this.focusDisplaySelect());
|
|
31
31
|
}, this.handleClose = () => {
|
|
32
32
|
this._open = !1;
|
|
33
33
|
}, this.handleClickDisplaySelect = () => {
|
|
34
|
-
this._open ? this.handleClose() : this.handleOpen();
|
|
34
|
+
this._open ? this.handleClose() : (this._keyboardNavigating = !1, this.handleOpen());
|
|
35
35
|
}, this.handleKeydown = (e) => {
|
|
36
|
-
this._open ? d.handleKeydownWhenOpen(e, {
|
|
36
|
+
this._open ? (this._keyboardNavigating = !0, d.handleKeydownWhenOpen(e, {
|
|
37
37
|
commit: () => this.commitSelection(),
|
|
38
38
|
navigateNext: () => this.advanceSelection(1),
|
|
39
39
|
navigatePrev: () => this.advanceSelection(-1),
|
|
40
40
|
navigateFirst: () => this.advanceToFirst(),
|
|
41
41
|
navigateLast: () => this.advanceToLast(),
|
|
42
42
|
close: this.handleClose
|
|
43
|
-
}) : d.handleKeydownWhenClosed(e, { open:
|
|
43
|
+
})) : d.handleKeydownWhenClosed(e, { open: () => {
|
|
44
|
+
this._keyboardNavigating = !0, this.handleOpen();
|
|
45
|
+
} });
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
static {
|
|
@@ -86,7 +88,7 @@ var p, m = class extends s {
|
|
|
86
88
|
advanceToFirst() {
|
|
87
89
|
if (this.nativeOptions.length) {
|
|
88
90
|
let e = this.nativeOptions.findIndex((e) => !e.hidden);
|
|
89
|
-
this.advanceSelection(e - this.
|
|
91
|
+
this.advanceSelection(e - this.keyboardFocusIndex);
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
advanceToLast() {
|
|
@@ -96,23 +98,23 @@ var p, m = class extends s {
|
|
|
96
98
|
e = t;
|
|
97
99
|
break;
|
|
98
100
|
}
|
|
99
|
-
this.advanceSelection(e - this.
|
|
101
|
+
this.advanceSelection(e - this.keyboardFocusIndex);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
advanceSelection(e) {
|
|
103
105
|
let t = this.nativeOptions.length;
|
|
104
|
-
this.
|
|
106
|
+
this.keyboardFocusIndex = (this.keyboardFocusIndex + e + t) % t, this.shouldSkipHiddenOption() ? this.advanceSelection(Math.sign(e)) : this.scrollToActive(this.nativeOptions[this.keyboardFocusIndex]);
|
|
105
107
|
}
|
|
106
108
|
shouldSkipHiddenOption() {
|
|
107
|
-
return this.nativeOptions.some((e) => !e.hidden) && this.nativeOptions[this.
|
|
109
|
+
return this.nativeOptions.some((e) => !e.hidden) && this.nativeOptions[this.keyboardFocusIndex].hidden;
|
|
108
110
|
}
|
|
109
111
|
scrollToActive(e) {
|
|
110
112
|
e?.scrollIntoView?.({ block: "nearest" });
|
|
111
113
|
}
|
|
112
|
-
commitSelection() {
|
|
114
|
+
commitSelection(e = this.keyboardFocusIndex) {
|
|
113
115
|
this.handleClose();
|
|
114
|
-
let
|
|
115
|
-
this.nativeSelect &&
|
|
116
|
+
let t = this.nativeOptions[e];
|
|
117
|
+
this.nativeSelect && t?.value && this.updateNativeSelectValue(t.value);
|
|
116
118
|
}
|
|
117
119
|
updateNativeSelectValue(e) {
|
|
118
120
|
this.nativeSelect.value = e, ["input", "change"].forEach((e) => this.nativeSelect.dispatchEvent(new Event(e, {
|
|
@@ -159,6 +161,12 @@ var p, m = class extends s {
|
|
|
159
161
|
"icon-name": this._open ? "arrow-up" : "arrow-down"
|
|
160
162
|
});
|
|
161
163
|
}
|
|
164
|
+
get leftIconTemplate() {
|
|
165
|
+
return this.iconName ? this.componentFactory.createIcon({
|
|
166
|
+
class: "left-icon",
|
|
167
|
+
"icon-name": this.iconName
|
|
168
|
+
}) : e;
|
|
169
|
+
}
|
|
162
170
|
get displaySelectTemplate() {
|
|
163
171
|
let e = this.nativeOptions.find((e) => e.selected), n = Array.from(e?.childNodes || [])?.map((e) => {
|
|
164
172
|
let t = e.cloneNode(!0);
|
|
@@ -184,6 +192,7 @@ var p, m = class extends s {
|
|
|
184
192
|
@keydown=${this.handleKeydown}
|
|
185
193
|
@blur=${this.handleClose}
|
|
186
194
|
>
|
|
195
|
+
${this.leftIconTemplate}
|
|
187
196
|
<span class="select-content">${n}</span>
|
|
188
197
|
${this.iconTemplate}
|
|
189
198
|
</div>
|
|
@@ -192,7 +201,7 @@ var p, m = class extends s {
|
|
|
192
201
|
`;
|
|
193
202
|
}
|
|
194
203
|
get activeDescendantId() {
|
|
195
|
-
return this._open && this.
|
|
204
|
+
return this._open && this.keyboardFocusIndex >= 0 ? `${p.ARIA_OPTION_PREFIX}${this.nativeOptions[this.keyboardFocusIndex].value}` : "";
|
|
196
205
|
}
|
|
197
206
|
get optionsContainerTemplate() {
|
|
198
207
|
return t`
|
|
@@ -208,15 +217,13 @@ var p, m = class extends s {
|
|
|
208
217
|
id="${p.ARIA_OPTION_PREFIX}${e.value}"
|
|
209
218
|
class=${u({
|
|
210
219
|
option: !0,
|
|
211
|
-
|
|
220
|
+
"keyboard-focused": n === this.keyboardFocusIndex && this._keyboardNavigating,
|
|
212
221
|
selected: e.value === this.nativeSelect.value
|
|
213
222
|
})}
|
|
214
223
|
role="option"
|
|
215
224
|
aria-selected="${e.value === this.nativeSelect.value}"
|
|
216
225
|
tabindex="-1"
|
|
217
|
-
@mousedown=${() =>
|
|
218
|
-
this.activeIndex = n, this.commitSelection();
|
|
219
|
-
}}
|
|
226
|
+
@mousedown=${() => this.commitSelection(n)}
|
|
220
227
|
>
|
|
221
228
|
${r}
|
|
222
229
|
</div>
|
|
@@ -227,7 +234,10 @@ o([n({ type: String })], m.prototype, "mode", void 0), o([n({ type: String })],
|
|
|
227
234
|
type: Boolean,
|
|
228
235
|
converter: l,
|
|
229
236
|
reflect: !0
|
|
230
|
-
})], m.prototype, "readonly", void 0), o([
|
|
237
|
+
})], m.prototype, "readonly", void 0), o([n({
|
|
238
|
+
type: String,
|
|
239
|
+
attribute: "icon-name"
|
|
240
|
+
})], m.prototype, "iconName", void 0), o([r()], m.prototype, "_open", void 0), o([r()], m.prototype, "_keyboardNavigating", void 0), o([r()], m.prototype, "nativeOptions", void 0), o([r()], m.prototype, "keyboardFocusIndex", void 0), o([r()], m.prototype, "hasForcedError", void 0), o([a({
|
|
231
241
|
slot: "",
|
|
232
242
|
selector: "select",
|
|
233
243
|
flatten: !0
|
|
@@ -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.127", 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.127");
|
|
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.127"), 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.127"), 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.127/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,7 +55,6 @@ 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
58
|
custom-background=${t(n?.["custom-background"])}
|
|
60
59
|
custom-color=${t(n?.["custom-color"])}
|
|
61
60
|
>
|
|
@@ -86,7 +85,6 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
86
85
|
target=${n?.target}
|
|
87
86
|
data-testid=${n?.["data-testid"]}
|
|
88
87
|
data-aria-label=${n?.["data-aria-label"]}
|
|
89
|
-
base-variant=${t(n?.["base-variant"])}
|
|
90
88
|
custom-background=${t(n?.["custom-background"])}
|
|
91
89
|
custom-color=${t(n?.["custom-color"])}
|
|
92
90
|
>
|
|
@@ -189,7 +187,6 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
189
187
|
rel=${e?.rel}
|
|
190
188
|
target=${e?.target}
|
|
191
189
|
data-testid=${e?.["data-testid"]}
|
|
192
|
-
base-variant=${t(e?.["base-variant"])}
|
|
193
190
|
custom-background=${t(e?.["custom-background"])}
|
|
194
191
|
custom-color=${t(e?.["custom-color"])}
|
|
195
192
|
>
|
|
@@ -220,7 +217,6 @@ var a = n(`ds-icon${i}`), o = n(`ds-calendar-day${i}`), s = n(`ds-button${i}`),
|
|
|
220
217
|
target=${e?.target}
|
|
221
218
|
data-testid=${e?.["data-testid"]}
|
|
222
219
|
data-aria-label=${e?.["data-aria-label"]}
|
|
223
|
-
base-variant=${t(e?.["base-variant"])}
|
|
224
220
|
custom-background=${t(e?.["custom-background"])}
|
|
225
221
|
custom-color=${t(e?.["custom-color"])}
|
|
226
222
|
>
|
|
@@ -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-127"))}`;
|
|
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-127"))}`;
|
|
8
8
|
}
|
|
9
9
|
//#endregion
|
|
10
10
|
export { n as htmlWithTokens };
|
|
@@ -19,7 +19,6 @@ 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
22
|
customBackground: DsButtonAttrs['custom-background'];
|
|
24
23
|
customColor: DsButtonAttrs['custom-color'];
|
|
25
24
|
private closestForm;
|
|
@@ -23,7 +23,11 @@ type CustomElement = {
|
|
|
23
23
|
target?: never;
|
|
24
24
|
};
|
|
25
25
|
type HtmlElement = Link | Button | CustomElement;
|
|
26
|
-
type
|
|
26
|
+
export type DsButtonStandardVariant = 'primary' | 'secondary' | 'tertiary' | 'naked';
|
|
27
|
+
export type DsButtonAttrs = {
|
|
28
|
+
variant?: DsButtonStandardVariant | (string & {});
|
|
29
|
+
'custom-background'?: string;
|
|
30
|
+
'custom-color'?: string;
|
|
27
31
|
mode?: 'dark' | 'light';
|
|
28
32
|
disabled?: boolean;
|
|
29
33
|
destructive?: boolean;
|
|
@@ -36,19 +40,5 @@ type SharedButtonAttrs = {
|
|
|
36
40
|
'full-width'?: boolean;
|
|
37
41
|
loading?: boolean;
|
|
38
42
|
'text-loading'?: string;
|
|
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;
|
|
43
|
+
} & HtmlElement & CommonAttrs;
|
|
54
44
|
export {};
|