@cupra/ui-kit 2.0.0-canary.119 → 2.0.0-canary.121
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-checkbox/ds-checkbox.cjs +2 -2
- package/dist/cjs/components/ds-dialog/ds-dialog.cjs +2 -2
- package/dist/cjs/components/ds-dialog-fullscreen/ds-dialog-fullscreen.cjs +2 -2
- package/dist/cjs/components/ds-drawer/ds-drawer.cjs +4 -4
- package/dist/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -7
- package/dist/cjs/components/ds-media-control/ds-media-control.cjs +3 -3
- package/dist/cjs/components/ds-tabs/ds-tabs.cjs +2 -2
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/components/ds-toggle-switch/ds-toggle-switch.cjs +3 -3
- 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-checkbox/ds-checkbox.js +12 -4
- package/dist/esm/components/ds-dialog/ds-dialog.js +11 -4
- package/dist/esm/components/ds-dialog-fullscreen/ds-dialog-fullscreen.js +12 -5
- package/dist/esm/components/ds-drawer/ds-drawer.js +26 -18
- package/dist/esm/components/ds-icon-button/ds-icon-button.js +22 -11
- package/dist/esm/components/ds-media-control/ds-media-control.js +22 -14
- package/dist/esm/components/ds-tabs/ds-tabs.js +10 -4
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/components/ds-toggle-switch/ds-toggle-switch.js +30 -21
- 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-checkbox/ds-checkbox.d.ts +4 -1
- package/dist/types/components/ds-dialog/ds-dialog.d.ts +4 -1
- package/dist/types/components/ds-dialog-fullscreen/ds-dialog-fullscreen.d.ts +4 -1
- package/dist/types/components/ds-drawer/ds-drawer.d.ts +4 -1
- package/dist/types/components/ds-drawer/ds-drawer.types.d.ts +1 -1
- 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/types/components/ds-media-control/ds-media-control.d.ts +4 -1
- package/dist/types/components/ds-tabs/ds-tabs.d.ts +4 -1
- package/dist/types/components/ds-toggle-switch/ds-toggle-switch.d.ts +4 -1
- 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-checkbox/ds-checkbox.cjs +2 -2
- package/dist-react/cjs/components/ds-dialog/ds-dialog.cjs +2 -2
- package/dist-react/cjs/components/ds-dialog-fullscreen/ds-dialog-fullscreen.cjs +2 -2
- package/dist-react/cjs/components/ds-drawer/ds-drawer.cjs +4 -4
- package/dist-react/cjs/components/ds-icon-button/ds-icon-button.cjs +2 -7
- package/dist-react/cjs/components/ds-media-control/ds-media-control.cjs +3 -3
- package/dist-react/cjs/components/ds-tabs/ds-tabs.cjs +2 -2
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/components/ds-toggle-switch/ds-toggle-switch.cjs +3 -3
- 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-checkbox/ds-checkbox.js +12 -4
- package/dist-react/esm/components/ds-dialog/ds-dialog.js +11 -4
- package/dist-react/esm/components/ds-dialog-fullscreen/ds-dialog-fullscreen.js +12 -5
- package/dist-react/esm/components/ds-drawer/ds-drawer.js +26 -18
- package/dist-react/esm/components/ds-icon-button/ds-icon-button.js +22 -11
- package/dist-react/esm/components/ds-media-control/ds-media-control.js +22 -14
- package/dist-react/esm/components/ds-tabs/ds-tabs.js +10 -4
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/components/ds-toggle-switch/ds-toggle-switch.js +30 -21
- 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-checkbox/ds-checkbox.d.ts +4 -1
- package/dist-react/types/components/ds-dialog/ds-dialog.d.ts +4 -1
- package/dist-react/types/components/ds-dialog-fullscreen/ds-dialog-fullscreen.d.ts +4 -1
- package/dist-react/types/components/ds-drawer/ds-drawer.d.ts +4 -1
- package/dist-react/types/components/ds-drawer/ds-drawer.types.d.ts +1 -1
- 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/dist-react/types/components/ds-media-control/ds-media-control.d.ts +4 -1
- package/dist-react/types/components/ds-tabs/ds-tabs.d.ts +4 -1
- package/dist-react/types/components/ds-toggle-switch/ds-toggle-switch.d.ts +4 -1
- 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_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.cjs`),t=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 n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),r=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 i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=require(`../../utils/htmlWithTokens.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(`../ds-checkbox-group/ds-checkbox-group.cjs`),d=require(`../../mixins/FormAssociatedMixin.cjs`),f=require(`./styles/common.styles.cjs`);var p=class extends d.FormAssociatedMixin(a.UiKitElement){constructor(...e){super(...e),this.inputPlacement=`left`,this.
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.cjs`),t=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 n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),r=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 i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=require(`../../utils/htmlWithTokens.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(`../ds-checkbox-group/ds-checkbox-group.cjs`),d=require(`../../mixins/FormAssociatedMixin.cjs`),f=require(`./styles/common.styles.cjs`);var p=class extends d.FormAssociatedMixin(a.UiKitElement){constructor(...e){super(...e),this.inputPlacement=`left`,this._checked=void 0,this._checkedState=!1,this.required=!1,this._disabled=!1,this.mode=`light`,this._size=`medium`,this.helperText=``,this.infoText=``,this._forcedError=``,this.invalidError=``,this.indeterminate=!1,this.dataAriaLabel=``}get checked(){return this._checked??this._checkedState}set checked(e){this._checked=e}static{this.styles=[f.commonStyles]}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>{this.createContextConsumers([{context:u.checkboxGroupDisabledContext,callback:e=>{this.disabledGroup=e}},{context:u.checkboxGroupErrorContext,callback:e=>{this.errorGroup=e}},{context:u.checkboxGroupSizeContext,callback:e=>{this.sizeGroup=e}}])})}createContextConsumers(t){t.forEach(({context:t,callback:n})=>{new e.s(this,{context:t,callback:n,subscribe:!0})})}get disabled(){return this.disabledGroup??this._disabled}set disabled(e){this._disabled=e}get size(){return this.sizeGroup||this._size}set size(e){this._size=e}get forcedError(){return this._forcedError}set forcedError(e){this._forcedError=e}get error(){return this.errorGroup??!!this._forcedError}handleChange(e){let t=e.target.checked;this._checkedState=t,this._checked=void 0,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,composed:!0,detail:{checked:t,value:this.value}}))}get classes(){return{container:!0,[this.inputPlacement]:!!this.inputPlacement,[this.mode]:!!this.mode,[this.size]:!!this.size,disabled:this.disabled,checked:this.checked,error:this.error}}get iconTemplate(){if(!this.checked)return t.E;let e=this.indeterminate?`minus`:`check`;return this.componentFactory.createIcon({class:`icon`,"icon-name":e})}get styleTokens(){return c.htmlWithTokens`
|
|
2
2
|
<style>
|
|
3
3
|
:host{
|
|
4
4
|
color-scheme: ${this.mode};
|
|
@@ -36,4 +36,4 @@ const e=require(`../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/c
|
|
|
36
36
|
</div>
|
|
37
37
|
</label>
|
|
38
38
|
</div>
|
|
39
|
-
`}};i.__decorate([n.n({type:String})],p.prototype,`name`,void 0),i.__decorate([n.n({type:String})],p.prototype,`value`,void 0),i.__decorate([n.n({type:String,attribute:`input-placement`})],p.prototype,`inputPlacement`,void 0),i.__decorate([n.n({type:Boolean,converter:s.booleanConverter,reflect:!0})],p.prototype,`
|
|
39
|
+
`}};i.__decorate([n.n({type:String})],p.prototype,`name`,void 0),i.__decorate([n.n({type:String})],p.prototype,`value`,void 0),i.__decorate([n.n({type:String,attribute:`input-placement`})],p.prototype,`inputPlacement`,void 0),i.__decorate([n.n({type:Boolean,attribute:`checked`,converter:s.booleanConverter,reflect:!0})],p.prototype,`_checked`,void 0),i.__decorate([r.r()],p.prototype,`_checkedState`,void 0),i.__decorate([n.n({type:Boolean,converter:s.booleanConverter})],p.prototype,`required`,void 0),i.__decorate([n.n({type:Boolean,converter:s.booleanConverter,attribute:`disabled`})],p.prototype,`_disabled`,void 0),i.__decorate([n.n({type:String,reflect:!0})],p.prototype,`mode`,void 0),i.__decorate([n.n({type:String,attribute:`size`})],p.prototype,`_size`,void 0),i.__decorate([n.n({type:String,attribute:`helper-text`})],p.prototype,`helperText`,void 0),i.__decorate([n.n({type:String,attribute:`info-text`})],p.prototype,`infoText`,void 0),i.__decorate([n.n({type:String,attribute:`forced-error`})],p.prototype,`_forcedError`,void 0),i.__decorate([n.n({type:String,attribute:`invalid-error`})],p.prototype,`invalidError`,void 0),i.__decorate([n.n({type:Boolean,converter:s.booleanConverter})],p.prototype,`indeterminate`,void 0),i.__decorate([n.n({type:String,attribute:`data-aria-label`})],p.prototype,`dataAriaLabel`,void 0),i.__decorate([r.r()],p.prototype,`disabledGroup`,void 0),i.__decorate([r.r()],p.prototype,`errorGroup`,void 0),i.__decorate([r.r()],p.prototype,`sizeGroup`,void 0),p=i.__decorate([o.customUiKitElement(`ds-checkbox`)],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`),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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=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 l=require(`../../utils/debounce.cjs`),u=require(`../../utils/scrollLock.cjs`),d=require(`./styles/common.styles.cjs`);var f=class extends a.UiKitElement{constructor(...e){super(...e),this.lockClose=!1,this.lockScroll=!0,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`),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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=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 l=require(`../../utils/debounce.cjs`),u=require(`../../utils/scrollLock.cjs`),d=require(`./styles/common.styles.cjs`);var f=class extends a.UiKitElement{constructor(...e){super(...e),this.lockClose=!1,this.lockScroll=!0,this._open=void 0,this._openState=!1,this.size=`medium`,this.hasBeenOpened=!1,this.hasScroll=!1,this.debouncedCheckScroll=l.debounce({func:()=>this.checkScroll()}),this.scrollLocked=!1,this.handleCloseButtonClick=()=>{this.handleClose(`button`)},this.handleDialogClick=e=>{e.target===this.nativeDialog&&this.handleClose(`backdrop`)},this.handleCancel=e=>{e.preventDefault(),this.lockClose||this.handleClose(`escape`)},this.handleHostClick=e=>{e.stopPropagation()}}static{this.styles=[d.commonStyles]}get open(){return this._open??this._openState}set open(e){this._open=e}updated(e){super.updated(e),!this.hasBeenOpened&&(e.has(`_open`)||e.has(`_openState`))&&this.open&&(this.hasBeenOpened=!0),(e.has(`_open`)||e.has(`_openState`))&&(this.open||(this.hasScroll=!1),this.handleResizeObserver(),this.syncNativeDialogState(),this.syncScrollLock())}syncScrollLock(){this.open&&this.lockScroll?(u.scrollLock.lock(),this.scrollLocked=!0):this.scrollLocked&&=(u.scrollLock.unlock(),!1)}syncNativeDialogState(){this.nativeDialog&&(this.open?this.openNativeDialog():this.closeNativeDialog())}openNativeDialog(){this.nativeDialog.open||this.nativeDialog.showModal?.()}closeNativeDialog(){this.nativeDialog.open&&this.nativeDialog.close?.()}async handleResizeObserver(){this.resizeObserver?.disconnect(),this.content&&(this.resizeObserver.observe(this.content),await new Promise(requestAnimationFrame),this.checkScroll())}get panelClasses(){return{panel:!0,"with-scroll":this.open&&this.hasScroll,[this.size]:!!this.size}}dispatchCloseEvents(e){let t=`ds-dialog:close-${e}`;this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event(`ds-dialog:close`,{bubbles:!0,composed:!0}))}handleClose(e){this.lockClose||(this._openState=!1,this._open=void 0,this.dispatchCloseEvents(e))}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(this.debouncedCheckScroll),this.handleResizeObserver(),this.addEventListener(`click`,this.handleHostClick)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.scrollLocked&&=(u.scrollLock.unlock(),!1),this.removeEventListener(`click`,this.handleHostClick)}checkScroll(){this.hasScroll||=this.content?.scrollHeight>this.content?.clientHeight}render(){return!this.hasBeenOpened&&!this.open?e.E:e.x`
|
|
2
2
|
<dialog
|
|
3
3
|
class="dialog"
|
|
4
4
|
data-testid="ds-dialog-container"
|
|
@@ -17,4 +17,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
19
|
</dialog>
|
|
20
|
-
`}};i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-close`})],f.prototype,`lockClose`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-scroll`})],f.prototype,`lockScroll`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter})],f.prototype,`
|
|
20
|
+
`}};i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-close`})],f.prototype,`lockClose`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-scroll`})],f.prototype,`lockScroll`,void 0),i.__decorate([t.n({type:Boolean,attribute:`open`,converter:s.booleanConverter})],f.prototype,`_open`,void 0),i.__decorate([n.r()],f.prototype,`_openState`,void 0),i.__decorate([t.n({type:String})],f.prototype,`size`,void 0),i.__decorate([t.n({type:String,attribute:`data-aria-label`})],f.prototype,`dataAriaLabel`,void 0),i.__decorate([t.n({type:String,attribute:`data-aria-description`})],f.prototype,`dataAriaDescription`,void 0),i.__decorate([n.r()],f.prototype,`hasBeenOpened`,void 0),i.__decorate([n.r()],f.prototype,`hasScroll`,void 0),i.__decorate([r.e(`.content`)],f.prototype,`content`,void 0),i.__decorate([r.e(`dialog`)],f.prototype,`nativeDialog`,void 0),f=i.__decorate([o.customUiKitElement(`ds-dialog`)],f);
|
|
@@ -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`),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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=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 l=require(`../../utils/debounce.cjs`),u=require(`./styles/common.styles.cjs`);var d=class extends a.UiKitElement{constructor(...e){super(...e),this.lockClose=!1,this.lockScroll=!0,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`),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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=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 l=require(`../../utils/debounce.cjs`),u=require(`./styles/common.styles.cjs`);var d=class extends a.UiKitElement{constructor(...e){super(...e),this.lockClose=!1,this.lockScroll=!0,this._open=void 0,this._openState=!1,this.hasScroll=!1,this.hasBeenOpened=!1,this.debouncedCheckScroll=l.debounce({func:()=>this.checkScroll()}),this.handleKeyDown=e=>{this.open&&e.key===`Escape`&&this.handleClose()}}static{this.styles=[u.commonStyles]}get open(){return this._open??this._openState}set open(e){this._open=e}willUpdate(e){super.willUpdate(e),!this.hasBeenOpened&&(e.has(`_open`)||e.has(`_openState`))&&this.open&&(this.hasBeenOpened=!0)}updated(e){super.updated(e),(e.has(`_open`)||e.has(`_openState`))&&this.handleResizeObserver()}async handleResizeObserver(){this.lockScroll&&(document.getElementById(`storybook-root`)||(document.body.style.overflow=this.open?`hidden`:``)),this.resizeObserver?.disconnect(),this.content&&(this.resizeObserver.observe(this.content),await new Promise(requestAnimationFrame),this.checkScroll())}get containerClasses(){return{"container-fullscreen":!0,close:!this.open,"with-scroll":this.open&&this.hasScroll}}handleClose(){this.lockClose||(this._openState=!1,this._open=void 0,this.dispatchEvent(new Event(`ds-dialog-fullscreen:close`,{bubbles:!0,composed:!0})))}connectedCallback(){super.connectedCallback(),window.addEventListener(`keydown`,this.handleKeyDown),this.resizeObserver=new ResizeObserver(this.debouncedCheckScroll),this.handleResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`keydown`,this.handleKeyDown),this.lockScroll&&(document.getElementById(`storybook-root`)||(document.body.style.overflow=``)),this.resizeObserver?.disconnect()}checkScroll(){let e=this.content?.scrollHeight>this.content?.clientHeight;e!==this.hasScroll&&(this.hasScroll=e)}render(){return!this.hasBeenOpened&&!this.open?e.E:e.x`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
display: ${this.open?`flex`:`none`};
|
|
@@ -14,4 +14,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
14
14
|
</div>
|
|
15
15
|
</dialog>
|
|
16
16
|
</div>
|
|
17
|
-
`}};i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-close`})],d.prototype,`lockClose`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-scroll`})],d.prototype,`lockScroll`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter})],d.prototype,`
|
|
17
|
+
`}};i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-close`})],d.prototype,`lockClose`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter,attribute:`lock-scroll`})],d.prototype,`lockScroll`,void 0),i.__decorate([t.n({type:Boolean,attribute:`open`,converter:s.booleanConverter})],d.prototype,`_open`,void 0),i.__decorate([n.r()],d.prototype,`_openState`,void 0),i.__decorate([n.r()],d.prototype,`hasScroll`,void 0),i.__decorate([r.e(`.content`)],d.prototype,`content`,void 0),d=i.__decorate([o.customUiKitElement(`ds-dialog-fullscreen`)],d);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const
|
|
2
|
-
<div class=${
|
|
3
|
-
<div data-testid="ds-drawer-container" class=${
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../utils/booleanConverter.cjs`),s=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/directives/class-map.cjs`);const c=require(`./styles/common.styles.cjs`),l=require(`./theme-config.cjs`);var u=class extends i.UiKitElement{constructor(...e){super(...e),this._open=void 0,this._openState=!1,this.handleOverlayClick=()=>{this.dispatchEvent(new Event(`ds-drawer:close`,{bubbles:!0,composed:!0})),this._openState=!1,this._open=void 0},this.handleKeyDown=e=>{(e.key===`Escape`||e.key===`Esc`)&&this.open&&this.handleOverlayClick()}}static{this.styles=[c.commonStyles,c.iconStyles]}get open(){return this._open??this._openState}set open(e){this._open=e}get classes(){return{container:!0,open:!!this.open}}getIconButtonTemplate(){let e=l.themeConfig[this.theme]?.[`icon-button-variant`];return this.componentFactory.createIconButton({class:`close-button visible`,"data-testid":`close-button`,"data-aria-label":`close-button`,"@click":this.handleOverlayClick,size:`medium`,"icon-name":`cross`,variant:e,mode:`dark`})}updated(e){super.updated?.(e),e.has&&(e.has(`_open`)||e.has(`_openState`))&&window.addEventListener(`keydown`,this.handleKeyDown)}disconnectedCallback(){window.removeEventListener(`keydown`,this.handleKeyDown),super.disconnectedCallback()}render(){return e.x`
|
|
2
|
+
<div class=${s.e({overlay:!0,open:!!this.open})} @click=${this.handleOverlayClick}></div>
|
|
3
|
+
<div data-testid="ds-drawer-container" class=${s.e(this.classes)}>
|
|
4
4
|
<div class="scroll-area" tabindex="0">
|
|
5
5
|
<div class="drawer-header">
|
|
6
6
|
<slot name="header"></slot>
|
|
@@ -16,4 +16,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
16
16
|
<slot name="footer"></slot>
|
|
17
17
|
</div>
|
|
18
18
|
</div>
|
|
19
|
-
`}};
|
|
19
|
+
`}};r.__decorate([t.n({type:Boolean,attribute:`open`,converter:o.booleanConverter})],u.prototype,`_open`,void 0),r.__decorate([n.r()],u.prototype,`_openState`,void 0),u=r.__decorate([a.customUiKitElement(`ds-drawer`)],u);
|
|
@@ -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
|
-
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
|
|
1
|
+
const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/index.cjs`);const t=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs`),n=require(`../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../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 s=require(`./styles/common.styles.cjs`);var c=class extends i.UiKitElement{constructor(...e){super(...e),this._state=void 0,this._stateValue=`pause`,this.size=`medium`,this.progress=0,this.handleToggle=e=>{e.stopPropagation();let t=this.state===`play`?`pause`:`play`;this._stateValue=t,this._state=void 0;let n=t===`play`?`ds-media-control:play`:`ds-media-control:pause`;this.dispatchEvent(new CustomEvent(n,{bubbles:!0,composed:!0}))},this.onKeyDown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.handleToggle(e))}}static{this.styles=[s.commonStyles]}get state(){return this._state??this._stateValue}set state(e){this._state=e}get normalizedProgress(){let e=Number(this.progress??0);return Number.isNaN(e)?0:Math.min(100,Math.max(0,e))}get classes(){return{container:!0,[this.size]:!!this.size,[this.state]:!!this.state}}get iconSize(){switch(this.size){case`large`:return 24;case`small`:return 16;default:return 20}}get iconName(){return this.state===`play`?`pause`:`play`}get iconTemplate(){return this.componentFactory.createIcon({class:`icon`,"icon-name":this.iconName,size:this.iconSize})}get progressTemplate(){let t=this.size===`large`?46:this.size===`small`?30:38,n=t/2-2/2,r=n-1,i=2*Math.PI*n,a=this.normalizedProgress/100,o=i.toFixed(3),s=(i*(1-a)).toFixed(3);return e.x`
|
|
2
2
|
<svg part="progress" class="progress" viewBox="${`${-t/2} ${-t/2} ${t} ${t}`}" aria-hidden="true" focusable="false">
|
|
3
3
|
<circle
|
|
4
4
|
class="indicator"
|
|
@@ -14,7 +14,7 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
14
14
|
`}render(){let t=this.state===`play`?`pause`:`play`;return e.x`
|
|
15
15
|
<div
|
|
16
16
|
part="container"
|
|
17
|
-
class=${
|
|
17
|
+
class=${o.e(this.classes)}
|
|
18
18
|
role="button"
|
|
19
19
|
tabindex="0"
|
|
20
20
|
aria-label=${`${t} media ${this.size}`}
|
|
@@ -24,4 +24,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
24
24
|
${this.progressTemplate}
|
|
25
25
|
${this.iconTemplate}
|
|
26
26
|
</div>
|
|
27
|
-
`}};
|
|
27
|
+
`}};r.__decorate([t.n({type:String,attribute:`state`,reflect:!0})],c.prototype,`_state`,void 0),r.__decorate([n.r()],c.prototype,`_stateValue`,void 0),r.__decorate([t.n({type:String,reflect:!0})],c.prototype,`size`,void 0),r.__decorate([t.n({type:Number,reflect:!0})],c.prototype,`progress`,void 0),c=r.__decorate([a.customUiKitElement(`ds-media-control`)],c);
|
|
@@ -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`),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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=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 l=require(`./styles/common.styles.cjs`),u=require(`./theme-config.cjs`);var d=class extends a.UiKitElement{constructor(...e){super(...e),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`),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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const i=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),a=require(`../base/UiKitElement.cjs`),o=require(`../../decorators/customUiKitElement.cjs`),s=require(`../../utils/booleanConverter.cjs`),c=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 l=require(`./styles/common.styles.cjs`),u=require(`./theme-config.cjs`);var d=class extends a.UiKitElement{constructor(...e){super(...e),this._selectedTab=void 0,this._selectedTabState=0,this.mode=`light`,this.variant=`primary`,this.size=`large`,this.disabled=!1,this.focusedTabIndex=-1,this.handleKeyDown=e=>{if(!(this.focusedTabIndex<0))switch(e.key){case`ArrowRight`:case`Right`:e.preventDefault(),this.focusedTabIndex+1<this.tabs?.length&&(this.focusedTabIndex+=1,this.tabs[this.focusedTabIndex]?.focus());break;case`ArrowLeft`:case`Left`:e.preventDefault(),this.focusedTabIndex-1>=0&&(--this.focusedTabIndex,this.tabs[this.focusedTabIndex]?.focus());break;case`Enter`:case` `:e.preventDefault(),this.focusedTabIndex>=0&&this.focusedTabIndex<this.tabs?.length&&this.handleChangeSelectedTab(this.focusedTabIndex);break;default:break}},this.hasScrollLeft=!1,this.hasScrollRight=!1,this.resizeObserver=new ResizeObserver(()=>{this.handleScrollNav()}),this.handleScrollNav=()=>{let e=this.nav?.scrollLeft+this.nav?.clientWidth;this.hasScrollLeft=this.nav?.scrollLeft>0,this.hasScrollRight=e<this.nav?.scrollWidth},this.handleScrollLeft=()=>{this.nav.scrollBy({left:-150,behavior:`smooth`})},this.handleScrollRight=()=>{this.nav.scrollBy({left:150,behavior:`smooth`})},this.handleFocus=e=>{let t=e.target,n=this.tabs?.findIndex(e=>e===t)??-1;if(n<0||this.disabled){e.preventDefault();return}this.focusedTabIndex=n},this.handleBlur=()=>{this.focusedTabIndex=-1}}static{this.styles=[l.commonStyles,l.navigationStyles,l.tabsStyles,l.panelsStyles]}get selectedTab(){return this._selectedTab??this._selectedTabState}set selectedTab(e){this._selectedTab=e}connectedCallback(){super.connectedCallback(),this.tabs=Array.from(this.querySelectorAll(`[slot=tab]`)),this.panels=Array.from(this.querySelectorAll(`[slot=panel]`))}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect(),window.removeEventListener(`resize`,this.handleScrollNav)}getScrollButtonTemplate(t,n){if(!this.theme||t===`left`&&!this.hasScrollLeft||t===`right`&&!this.hasScrollRight)return e.E;let r=`arrow-${t}`,i=u.themeConfig[this.theme]?.[`icon-button-variant`];return this.componentFactory.createIconButton({class:`nav-arrow ${t}`,"data-aria-label":`nav-arrow-${t}`,"@click":n,size:this.size===`medium`?`medium`:`large`,"icon-name":r,mode:this.mode,variant:i})}firstUpdated(){this.handleScrollNav(),this.resizeObserver.observe(this.nav),this.tabs.forEach(e=>this.resizeObserver.observe(e)),window.addEventListener(`resize`,this.handleScrollNav),this.nav.addEventListener(`scroll`,this.handleScrollNav),this.setTabsFocusable()}updated(e){if(super.updated(e),(e.has(`_selectedTab`)||e.has(`_selectedTabState`))&&this.selectTab(this.selectedTab),e.has(`variant`)){let e=this.variant===`secondary`||this.variant===`primary`?this.variant:`primary`;this.variant!==e&&(this.variant=e)}this.setupTabAccessibility()}handleTabsSlotchange(e){this.tabs=e.target.assignedNodes({flatten:!0}),this.setTabsFocusable()}handlePanelSlotchange(e){this.panels=e.target.assignedNodes({flatten:!0}),this.setTabsFocusable()}setTabsFocusable(){this.tabs?.forEach(e=>{e.setAttribute(`tabindex`,`0`)})}selectTab(e){this.tabs?.forEach((t,n)=>{t.removeAttribute(`selected`),t.setAttribute(`aria-selected`,n===e?`true`:`false`)}),this.tabs[e]?.setAttribute(`selected`,``),this.panels.forEach(e=>e.removeAttribute(`selected`)),this.panels[e]?.setAttribute(`selected`,``);let t=this.tabs?.[this.selectedTab];this.nav.scrollLeft=t?.offsetLeft-this.nav?.offsetWidth/2}setupTabAccessibility(){this.tabs?.forEach((e,t)=>{e.setAttribute(`role`,`tab`),e.setAttribute(`tabindex`,t===this.selectedTab&&!this.disabled?`0`:`-1`),e.addEventListener(`focus`,this.handleFocus),e.addEventListener(`blur`,this.handleBlur)})}handleChangeSelectedTab(e){this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,composed:!0,detail:{selectedTab:e}})),this._selectedTabState=e,this._selectedTab=void 0}handleSelect(e){let t;this.tabs.forEach((n,r)=>{(n===e.target||n.contains(e.target))&&(t=r)}),!(typeof t!=`number`||t===this.selectedTab)&&this.handleChangeSelectedTab(t)}get classes(){return{container:!0,[this.size]:!0,[this.mode]:!0,[this.variant]:!0,disabled:this.disabled}}get navContainerClasses(){return{"nav-container":!0,"scroll-left":this.hasScrollLeft,"scroll-right":this.hasScrollRight}}render(){return e.x`
|
|
2
2
|
<div part="container" class=${c.e(this.classes)}>
|
|
3
3
|
<div class=${c.e(this.navContainerClasses)}>
|
|
4
4
|
${this.getScrollButtonTemplate(`left`,this.handleScrollLeft)}
|
|
@@ -9,4 +9,4 @@ const e=require(`../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/l
|
|
|
9
9
|
</div>
|
|
10
10
|
<slot @slotchange=${this.handlePanelSlotchange} name="panel"></slot>
|
|
11
11
|
</div>
|
|
12
|
-
`}};i.__decorate([t.n({type:Number,attribute:`selected-tab`,reflect:!0})],d.prototype,`
|
|
12
|
+
`}};i.__decorate([t.n({type:Number,attribute:`selected-tab`,reflect:!0})],d.prototype,`_selectedTab`,void 0),i.__decorate([n.r()],d.prototype,`_selectedTabState`,void 0),i.__decorate([t.n({type:String,reflect:!0})],d.prototype,`mode`,void 0),i.__decorate([t.n({type:String,reflect:!0})],d.prototype,`variant`,void 0),i.__decorate([t.n({type:String})],d.prototype,`size`,void 0),i.__decorate([t.n({type:Boolean,converter:s.booleanConverter})],d.prototype,`disabled`,void 0),i.__decorate([n.r()],d.prototype,`focusedTabIndex`,void 0),i.__decorate([r.e(`nav`)],d.prototype,`nav`,void 0),i.__decorate([n.r()],d.prototype,`tabs`,void 0),i.__decorate([n.r()],d.prototype,`panels`,void 0),i.__decorate([n.r()],d.prototype,`hasScrollLeft`,void 0),i.__decorate([n.r()],d.prototype,`hasScrollRight`,void 0),d=i.__decorate([o.customUiKitElement(`ds-tabs`)],d);
|
|
@@ -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.121`,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,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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const
|
|
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`);require(`../../node_modules/.pnpm/lit@3.3.1/node_modules/lit/decorators.cjs`);const r=require(`../../_virtual/_@oxc-project_runtime@0.122.0/helpers/decorate.cjs`),i=require(`../base/UiKitElement.cjs`),a=require(`../../decorators/customUiKitElement.cjs`),o=require(`../../utils/booleanConverter.cjs`),s=require(`../../utils/htmlWithTokens.cjs`),c=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 l=require(`./styles/common.styles.cjs`);var u=class extends i.UiKitElement{constructor(...e){super(...e),this.size=`medium`,this._checked=void 0,this._checkedState=!1,this.disabled=!1,this.mode=`light`}static{this.styles=[l.commonStyles]}get checked(){return this._checked??this._checkedState}set checked(e){this._checked=e}handleClick(){let e=!this.checked;this._checkedState=e,this._checked=void 0,this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,composed:!0,detail:{checked:e}}))}handleClickOff(e){e.stopPropagation(),this.checked&&this.handleClick()}handleClickOn(e){e.stopPropagation(),!this.checked&&this.handleClick()}get styleTokens(){return s.htmlWithTokens`
|
|
2
2
|
<style>
|
|
3
3
|
:host {
|
|
4
4
|
color-scheme: ${this.mode};
|
|
@@ -7,7 +7,7 @@ require(`../ds-theme-provider/themeContext.cjs`);const e=require(`../../node_mod
|
|
|
7
7
|
`}get labelClasses(){return{container:!0,[this.size]:!!this.size,checked:this.checked,disabled:this.disabled,[this.mode]:!!this.mode}}render(){return e.x`
|
|
8
8
|
${this.styleTokens}
|
|
9
9
|
<div
|
|
10
|
-
class=${
|
|
10
|
+
class=${c.e(this.labelClasses)}
|
|
11
11
|
@click=${this.handleClick}
|
|
12
12
|
>
|
|
13
13
|
<slot name="off" @click=${this.handleClickOff}></slot>
|
|
@@ -27,4 +27,4 @@ require(`../ds-theme-provider/themeContext.cjs`);const e=require(`../../node_mod
|
|
|
27
27
|
</button>
|
|
28
28
|
<slot name="on" @click=${this.handleClickOn}></slot>
|
|
29
29
|
</div>
|
|
30
|
-
`}};
|
|
30
|
+
`}};r.__decorate([t.n({type:String})],u.prototype,`size`,void 0),r.__decorate([t.n({type:Boolean,attribute:`checked`,converter:o.booleanConverter,reflect:!0})],u.prototype,`_checked`,void 0),r.__decorate([n.r()],u.prototype,`_checkedState`,void 0),r.__decorate([t.n({type:Boolean,converter:o.booleanConverter,reflect:!0})],u.prototype,`disabled`,void 0),r.__decorate([t.n({type:String,reflect:!0})],u.prototype,`mode`,void 0),r.__decorate([t.n({type:String,attribute:`data-aria-label`})],u.prototype,`dataAriaLabel`,void 0),u=r.__decorate([a.customUiKitElement(`ds-toggle-switch`)],u);
|
|
@@ -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.121`)}})}}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.121`),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.121`),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.121/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-121`))}`}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-121`))}`}exports.htmlWithTokens=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=`2.0.0-canary.
|
|
1
|
+
var e=`2.0.0-canary.121`,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`
|
|
@@ -17,7 +17,13 @@ import { commonStyles as h } from "./styles/common.styles.js";
|
|
|
17
17
|
//#region src/components/ds-checkbox/ds-checkbox.ts
|
|
18
18
|
var g = class extends m(o) {
|
|
19
19
|
constructor(...e) {
|
|
20
|
-
super(...e), this.inputPlacement = "left", this.
|
|
20
|
+
super(...e), this.inputPlacement = "left", this._checked = void 0, this._checkedState = !1, this.required = !1, this._disabled = !1, this.mode = "light", this._size = "medium", this.helperText = "", this.infoText = "", this._forcedError = "", this.invalidError = "", this.indeterminate = !1, this.dataAriaLabel = "";
|
|
21
|
+
}
|
|
22
|
+
get checked() {
|
|
23
|
+
return this._checked ?? this._checkedState;
|
|
24
|
+
}
|
|
25
|
+
set checked(e) {
|
|
26
|
+
this._checked = e;
|
|
21
27
|
}
|
|
22
28
|
static {
|
|
23
29
|
this.styles = [h];
|
|
@@ -77,11 +83,12 @@ var g = class extends m(o) {
|
|
|
77
83
|
return this.errorGroup ?? !!this._forcedError;
|
|
78
84
|
}
|
|
79
85
|
handleChange(e) {
|
|
80
|
-
|
|
86
|
+
let t = e.target.checked;
|
|
87
|
+
this._checkedState = t, this._checked = void 0, this.dispatchEvent(new CustomEvent("change", {
|
|
81
88
|
bubbles: !0,
|
|
82
89
|
composed: !0,
|
|
83
90
|
detail: {
|
|
84
|
-
checked:
|
|
91
|
+
checked: t,
|
|
85
92
|
value: this.value
|
|
86
93
|
}
|
|
87
94
|
}));
|
|
@@ -155,9 +162,10 @@ a([r({ type: String })], g.prototype, "name", void 0), a([r({ type: String })],
|
|
|
155
162
|
attribute: "input-placement"
|
|
156
163
|
})], g.prototype, "inputPlacement", void 0), a([r({
|
|
157
164
|
type: Boolean,
|
|
165
|
+
attribute: "checked",
|
|
158
166
|
converter: c,
|
|
159
167
|
reflect: !0
|
|
160
|
-
})], g.prototype, "
|
|
168
|
+
})], g.prototype, "_checked", void 0), a([i()], g.prototype, "_checkedState", void 0), a([r({
|
|
161
169
|
type: Boolean,
|
|
162
170
|
converter: c
|
|
163
171
|
})], g.prototype, "required", void 0), a([r({
|