@cupra/ui-kit 2.0.0-canary.85 → 2.0.0-canary.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/components/ds-checkbox/ds-checkbox.cjs +2 -2
  2. package/dist/cjs/components/ds-dialog/ds-dialog.cjs +14 -21
  3. package/dist/cjs/components/ds-dialog/styles/common.styles.cjs +11 -21
  4. package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  5. package/dist/cjs/utils/IconsManager.cjs +1 -1
  6. package/dist/cjs/utils/PubSub.cjs +1 -1
  7. package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  8. package/dist/cjs/utils/cssWithTokens.cjs +1 -1
  9. package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
  10. package/dist/esm/components/ds-checkbox/ds-checkbox.js +63 -54
  11. package/dist/esm/components/ds-dialog/ds-dialog.js +88 -87
  12. package/dist/esm/components/ds-dialog/styles/common.styles.js +12 -22
  13. package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  14. package/dist/esm/utils/IconsManager.js +1 -1
  15. package/dist/esm/utils/PubSub.js +1 -1
  16. package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  17. package/dist/esm/utils/cssWithTokens.js +1 -1
  18. package/dist/esm/utils/htmlWithTokens.js +1 -1
  19. package/dist/types/components/ds-checkbox/ds-checkbox.d.ts +3 -0
  20. package/dist/types/components/ds-dialog/ds-dialog.d.ts +7 -4
  21. package/dist/types/components/ds-theme-provider/themeContext.d.ts +1 -1
  22. package/dist-react/cjs/components/ds-checkbox/ds-checkbox.cjs +2 -2
  23. package/dist-react/cjs/components/ds-dialog/ds-dialog.cjs +14 -21
  24. package/dist-react/cjs/components/ds-dialog/styles/common.styles.cjs +11 -21
  25. package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  26. package/dist-react/cjs/utils/IconsManager.cjs +1 -1
  27. package/dist-react/cjs/utils/PubSub.cjs +1 -1
  28. package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  29. package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
  30. package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
  31. package/dist-react/esm/components/ds-checkbox/ds-checkbox.js +63 -54
  32. package/dist-react/esm/components/ds-dialog/ds-dialog.js +88 -87
  33. package/dist-react/esm/components/ds-dialog/styles/common.styles.js +12 -22
  34. package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  35. package/dist-react/esm/utils/IconsManager.js +1 -1
  36. package/dist-react/esm/utils/PubSub.js +1 -1
  37. package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
  38. package/dist-react/esm/utils/cssWithTokens.js +1 -1
  39. package/dist-react/esm/utils/htmlWithTokens.js +1 -1
  40. package/dist-react/types/components/ds-checkbox/ds-checkbox.d.ts +3 -0
  41. package/dist-react/types/components/ds-dialog/ds-dialog.d.ts +7 -4
  42. package/dist-react/types/components/ds-theme-provider/themeContext.d.ts +1 -1
  43. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),l=require("../ds-checkbox-group/ds-checkbox-group.cjs"),b=require("../../decorators/customUiKitElement.cjs"),x=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.cjs"),m=require("../../mixins/FormAssociatedMixin.cjs"),c=require("../../utils/booleanConverter.cjs"),y=require("../../utils/htmlWithTokens.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const r=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),k=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),v=require("./styles/common.styles.cjs");var C=Object.defineProperty,f=Object.getOwnPropertyDescriptor,e=(h,t,s,n)=>{for(var i=n>1?void 0:n?f(t,s):t,a=h.length-1,p;a>=0;a--)(p=h[a])&&(i=(n?p(t,s,i):p(i))||i);return n&&i&&C(t,s,i),i};exports.DsCheckbox=class extends m.FormAssociatedMixin(u.UiKitElement){constructor(){super(...arguments),this.inputPlacement="left",this.checked=!1,this.required=!1,this._disabled=!1,this.mode="light",this._size="medium",this.helperText="",this.infoText="",this._forcedError="",this.invalidError="",this.indeterminate=!1}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>{this.createContextConsumers([{context:l.checkboxGroupDisabledContext,callback:t=>{this.disabledGroup=t}},{context:l.checkboxGroupErrorContext,callback:t=>{this.errorGroup=t}},{context:l.checkboxGroupSizeContext,callback:t=>{this.sizeGroup=t}}])})}createContextConsumers(t){t.forEach(({context:s,callback:n})=>{new x.ContextConsumer(this,{context:s,callback:n,subscribe:!0})})}get disabled(){return this.disabledGroup??this._disabled}get size(){return this.sizeGroup||this._size}get forcedError(){return this._forcedError}get error(){return this.errorGroup??!!this._forcedError}handleChange(t){const s=t.target;this.checked=s.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{checked:this.checked,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 o.nothing;const t=this.indeterminate?"minus":"check";return this.componentFactory.createIcon({class:"icon","icon-name":t})}get styleTokens(){return y.htmlWithTokens`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),l=require("../ds-checkbox-group/ds-checkbox-group.cjs"),b=require("../../decorators/customUiKitElement.cjs"),x=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.cjs"),m=require("../../mixins/FormAssociatedMixin.cjs"),c=require("../../utils/booleanConverter.cjs"),y=require("../../utils/htmlWithTokens.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const r=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),k=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),v=require("./styles/common.styles.cjs");var C=Object.defineProperty,f=Object.getOwnPropertyDescriptor,t=(h,e,s,n)=>{for(var i=n>1?void 0:n?f(e,s):e,a=h.length-1,p;a>=0;a--)(p=h[a])&&(i=(n?p(e,s,i):p(i))||i);return n&&i&&C(e,s,i),i};exports.DsCheckbox=class extends m.FormAssociatedMixin(u.UiKitElement){constructor(){super(...arguments),this.inputPlacement="left",this.checked=!1,this.required=!1,this._disabled=!1,this.mode="light",this._size="medium",this.helperText="",this.infoText="",this._forcedError="",this.invalidError="",this.indeterminate=!1}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>{this.createContextConsumers([{context:l.checkboxGroupDisabledContext,callback:e=>{this.disabledGroup=e}},{context:l.checkboxGroupErrorContext,callback:e=>{this.errorGroup=e}},{context:l.checkboxGroupSizeContext,callback:e=>{this.sizeGroup=e}}])})}createContextConsumers(e){e.forEach(({context:s,callback:n})=>{new x.ContextConsumer(this,{context:s,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){const s=e.target;this.checked=s.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{checked:this.checked,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 o.nothing;const e=this.indeterminate?"minus":"check";return this.componentFactory.createIcon({class:"icon","icon-name":e})}get styleTokens(){return y.htmlWithTokens`
2
2
  <style>
3
3
  :host{
4
4
  color-scheme: ${this.mode};
@@ -35,4 +35,4 @@
35
35
  </div>
36
36
  </label>
37
37
  </div>
38
- `}};exports.DsCheckbox.styles=[v.commonStyles];e([r.property({type:String})],exports.DsCheckbox.prototype,"name",2);e([r.property({type:String})],exports.DsCheckbox.prototype,"value",2);e([r.property({type:String,attribute:"input-placement"})],exports.DsCheckbox.prototype,"inputPlacement",2);e([r.property({type:Boolean,converter:c.booleanConverter,reflect:!0})],exports.DsCheckbox.prototype,"checked",2);e([r.property({type:Boolean,converter:c.booleanConverter})],exports.DsCheckbox.prototype,"required",2);e([r.property({type:Boolean,converter:c.booleanConverter,attribute:"disabled"})],exports.DsCheckbox.prototype,"_disabled",2);e([r.property({type:String,reflect:!0})],exports.DsCheckbox.prototype,"mode",2);e([r.property({type:String,attribute:"size"})],exports.DsCheckbox.prototype,"_size",2);e([r.property({type:String,attribute:"helper-text"})],exports.DsCheckbox.prototype,"helperText",2);e([r.property({type:String,attribute:"info-text"})],exports.DsCheckbox.prototype,"infoText",2);e([r.property({type:String,attribute:"forced-error"})],exports.DsCheckbox.prototype,"_forcedError",2);e([r.property({type:String,attribute:"invalid-error"})],exports.DsCheckbox.prototype,"invalidError",2);e([r.property({type:Boolean,converter:c.booleanConverter})],exports.DsCheckbox.prototype,"indeterminate",2);e([d.state()],exports.DsCheckbox.prototype,"disabledGroup",2);e([d.state()],exports.DsCheckbox.prototype,"errorGroup",2);e([d.state()],exports.DsCheckbox.prototype,"sizeGroup",2);exports.DsCheckbox=e([b.customUiKitElement("ds-checkbox")],exports.DsCheckbox);
38
+ `}};exports.DsCheckbox.styles=[v.commonStyles];t([r.property({type:String})],exports.DsCheckbox.prototype,"name",2);t([r.property({type:String})],exports.DsCheckbox.prototype,"value",2);t([r.property({type:String,attribute:"input-placement"})],exports.DsCheckbox.prototype,"inputPlacement",2);t([r.property({type:Boolean,converter:c.booleanConverter,reflect:!0})],exports.DsCheckbox.prototype,"checked",2);t([r.property({type:Boolean,converter:c.booleanConverter})],exports.DsCheckbox.prototype,"required",2);t([r.property({type:Boolean,converter:c.booleanConverter,attribute:"disabled"})],exports.DsCheckbox.prototype,"_disabled",2);t([r.property({type:String,reflect:!0})],exports.DsCheckbox.prototype,"mode",2);t([r.property({type:String,attribute:"size"})],exports.DsCheckbox.prototype,"_size",2);t([r.property({type:String,attribute:"helper-text"})],exports.DsCheckbox.prototype,"helperText",2);t([r.property({type:String,attribute:"info-text"})],exports.DsCheckbox.prototype,"infoText",2);t([r.property({type:String,attribute:"forced-error"})],exports.DsCheckbox.prototype,"_forcedError",2);t([r.property({type:String,attribute:"invalid-error"})],exports.DsCheckbox.prototype,"invalidError",2);t([r.property({type:Boolean,converter:c.booleanConverter})],exports.DsCheckbox.prototype,"indeterminate",2);t([d.state()],exports.DsCheckbox.prototype,"disabledGroup",2);t([d.state()],exports.DsCheckbox.prototype,"errorGroup",2);t([d.state()],exports.DsCheckbox.prototype,"sizeGroup",2);exports.DsCheckbox=t([b.customUiKitElement("ds-checkbox")],exports.DsCheckbox);
@@ -1,27 +1,20 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),v=require("../../decorators/customUiKitElement.cjs"),h=require("../../utils/booleanConverter.cjs"),b=require("../../utils/debounce.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const l=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),y=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),d=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),g=require("./styles/common.styles.cjs");var C=Object.defineProperty,D=Object.getOwnPropertyDescriptor,t=(r,e,s,n)=>{for(var o=n>1?void 0:n?D(e,s):e,a=r.length-1,c;a>=0;a--)(c=r[a])&&(o=(n?c(e,s,o):c(o))||o);return n&&o&&C(e,s,o),o};exports.DsDialog=class extends u.UiKitElement{constructor(){super(...arguments),this.lockClose=!1,this.lockScroll=!0,this.open=!1,this.size="medium",this.hasBeenOpened=!1,this.hasScroll=!1,this.debouncedCheckScroll=b.debounce({func:()=>this.checkScroll()}),this.handleCloseButtonClick=()=>{this.handleClose("button")},this.handleBackdropClick=()=>{this.handleClose("backdrop")},this.handleHostClick=e=>{e.stopPropagation()},this.handleKeyDown=e=>{this.open&&e.key==="Escape"&&this.handleClose("escape")}}async updated(e){super.updated(e),!this.hasBeenOpened&&e.has("open")&&this.open&&(this.hasBeenOpened=!0),e.has("open")&&this.handleResizeObserver(),e.has("open")&&this.open&&(await this.updateComplete,this.requestUpdate())}async handleResizeObserver(){var e;this.lockScroll&&(document.body.style.overflow=this.open?"hidden":""),(e=this.resizeObserver)==null||e.disconnect(),this.content&&(this.resizeObserver.observe(this.content),await new Promise(requestAnimationFrame),this.checkScroll())}get containerClasses(){return{container:!0,close:!this.open,"with-scroll":this.open&&this.hasScroll}}get dialogClasses(){return{dialog:!0,[this.size]:!!this.size}}dispatchCloseEvents(e){const s=`ds-dialog:close-${e}`;this.dispatchEvent(new Event(s,{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("ds-dialog:close",{bubbles:!0,composed:!0}))}handleClose(e){this.lockClose||(this.open=!1,this.dispatchCloseEvents(e))}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this.handleKeyDown),this.resizeObserver=new ResizeObserver(this.debouncedCheckScroll),this.handleResizeObserver(),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){var e;super.disconnectedCallback(),window.removeEventListener("keydown",this.handleKeyDown),this.lockScroll&&(document.body.style.overflow=""),(e=this.resizeObserver)==null||e.disconnect(),this.removeEventListener("click",this.handleHostClick)}checkScroll(){var e,s;this.hasScroll=((e=this.content)==null?void 0:e.scrollHeight)>((s=this.content)==null?void 0:s.clientHeight)}render(){return!this.hasBeenOpened&&!this.open?i.nothing:i.html`
2
- <style>
3
- :host {
4
- display: ${this.open?"flex":"none"};
5
- }
6
- </style>
7
-
8
- <div class=${d.classMap(this.containerClasses)}>
9
- <div class="overlay" @click=${this.handleBackdropClick}></div>
10
- <dialog
11
- ?open=${this.open}
12
- data-testid="ds-dialog-container"
13
- class=${d.classMap(this.dialogClasses)}
14
- aria-modal="true"
15
- aria-label=${this.dataAriaLabel||i.nothing}
16
- aria-description=${this.dataAriaDescription||i.nothing}
17
- >
18
- ${this.lockClose?i.nothing:i.html`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),v=require("../../decorators/customUiKitElement.cjs"),h=require("../../utils/booleanConverter.cjs"),g=require("../../utils/debounce.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const l=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),d=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),D=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),b=require("./styles/common.styles.cjs");var C=Object.defineProperty,y=Object.getOwnPropertyDescriptor,s=(n,e,t,a)=>{for(var i=a>1?void 0:a?y(e,t):e,r=n.length-1,c;r>=0;r--)(c=n[r])&&(i=(a?c(e,t,i):c(i))||i);return a&&i&&C(e,t,i),i};exports.DsDialog=class extends u.UiKitElement{constructor(){super(...arguments),this.lockClose=!1,this.lockScroll=!0,this.open=!1,this.size="medium",this.hasBeenOpened=!1,this.hasScroll=!1,this.debouncedCheckScroll=g.debounce({func:()=>this.checkScroll()}),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()}}async updated(e){super.updated(e),!this.hasBeenOpened&&e.has("open")&&this.open&&(this.hasBeenOpened=!0),e.has("open")&&(this.handleResizeObserver(),this.syncNativeDialogState()),e.has("open")&&this.open&&(await this.updateComplete,this.requestUpdate())}syncNativeDialogState(){this.nativeDialog&&(this.open?this.openNativeDialog():this.closeNativeDialog())}openNativeDialog(){var e,t;this.nativeDialog.open||(t=(e=this.nativeDialog).showModal)==null||t.call(e)}closeNativeDialog(){var e,t;this.nativeDialog.open&&((t=(e=this.nativeDialog).close)==null||t.call(e))}async handleResizeObserver(){var e;(e=this.resizeObserver)==null||e.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){const 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.open=!1,this.dispatchCloseEvents(e))}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(this.debouncedCheckScroll),this.handleResizeObserver(),this.addEventListener("click",this.handleHostClick)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.resizeObserver)==null||e.disconnect(),this.removeEventListener("click",this.handleHostClick)}checkScroll(){var e,t;this.hasScroll=((e=this.content)==null?void 0:e.scrollHeight)>((t=this.content)==null?void 0:t.clientHeight)}render(){return!this.hasBeenOpened&&!this.open?o.nothing:o.html`
2
+ <dialog
3
+ class="dialog"
4
+ data-testid="ds-dialog-container"
5
+ aria-label=${this.dataAriaLabel||o.nothing}
6
+ aria-description=${this.dataAriaDescription||o.nothing}
7
+ @cancel=${this.handleCancel}
8
+ @click=${this.handleDialogClick}
9
+ >
10
+ <div class=${D.classMap(this.panelClasses)}>
11
+ ${this.lockClose?o.nothing:o.html`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
19
12
  <div class="content-container">
20
13
  <div tabindex="0" class="content ds-scroll">
21
14
  <slot @slotchange=${this.handleResizeObserver}></slot>
22
15
  </div>
23
16
  <slot name="footer"></slot>
24
17
  </div>
25
- </dialog>
26
- </div>
27
- `}};exports.DsDialog.styles=[g.commonStyles];t([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-close"})],exports.DsDialog.prototype,"lockClose",2);t([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-scroll"})],exports.DsDialog.prototype,"lockScroll",2);t([l.property({type:Boolean,converter:h.booleanConverter})],exports.DsDialog.prototype,"open",2);t([l.property({type:String})],exports.DsDialog.prototype,"size",2);t([l.property({type:String,attribute:"data-aria-label"})],exports.DsDialog.prototype,"dataAriaLabel",2);t([l.property({type:String,attribute:"data-aria-description"})],exports.DsDialog.prototype,"dataAriaDescription",2);t([p.state()],exports.DsDialog.prototype,"hasBeenOpened",2);t([p.state()],exports.DsDialog.prototype,"hasScroll",2);t([y.query(".content")],exports.DsDialog.prototype,"content",2);exports.DsDialog=t([v.customUiKitElement("ds-dialog")],exports.DsDialog);
18
+ </div>
19
+ </dialog>
20
+ `}};exports.DsDialog.styles=[b.commonStyles];s([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-close"})],exports.DsDialog.prototype,"lockClose",2);s([l.property({type:Boolean,converter:h.booleanConverter,attribute:"lock-scroll"})],exports.DsDialog.prototype,"lockScroll",2);s([l.property({type:Boolean,converter:h.booleanConverter})],exports.DsDialog.prototype,"open",2);s([l.property({type:String})],exports.DsDialog.prototype,"size",2);s([l.property({type:String,attribute:"data-aria-label"})],exports.DsDialog.prototype,"dataAriaLabel",2);s([l.property({type:String,attribute:"data-aria-description"})],exports.DsDialog.prototype,"dataAriaDescription",2);s([p.state()],exports.DsDialog.prototype,"hasBeenOpened",2);s([p.state()],exports.DsDialog.prototype,"hasScroll",2);s([d.query(".content")],exports.DsDialog.prototype,"content",2);s([d.query("dialog")],exports.DsDialog.prototype,"nativeDialog",2);exports.DsDialog=s([v.customUiKitElement("ds-dialog")],exports.DsDialog);
@@ -1,33 +1,23 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../utils/cssQueries.cjs");require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs"),i=e.css`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../utils/cssQueries.cjs");require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs"),r=e.css`
2
2
  :host {
3
- transition: display 0.3s cubic-bezier(0, 0, 0.2, 1) allow-discrete;
3
+ display: contents;
4
4
  }
5
5
 
6
- .container.close {
7
- display: none;
8
- opacity: 0;
9
- }
10
-
11
- .container {
12
- position: fixed;
13
- top: 0;
14
- left: 0;
6
+ .dialog[open] {
7
+ max-width: none;
8
+ max-height: none;
9
+ border: none;
10
+ background: transparent;
11
+ overflow: visible;
15
12
  width: 100dvw;
16
13
  height: 100dvh;
14
+ box-sizing: border-box;
17
15
  display: flex;
18
16
  justify-content: center;
19
17
  align-items: center;
20
- z-index: var(--ds-z-index-modal);
21
- transition:
22
- opacity 0.3s cubic-bezier(0, 0, 0.2, 1),
23
- display 0.3s cubic-bezier(0, 0, 0.2, 1) allow-discrete;
24
- opacity: 1;
25
- @starting-style {
26
- opacity: 0;
27
- }
28
18
  }
29
19
 
30
- .dialog {
20
+ .panel {
31
21
  padding: 0;
32
22
  position: relative;
33
23
  }
@@ -69,4 +59,4 @@
69
59
  width: 8px;
70
60
  }
71
61
  }
72
- `;exports.commonStyles=i;
62
+ `;exports.commonStyles=r;
@@ -1,4 +1,4 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
2
2
  url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
3
3
  url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
4
- url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.85",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
4
+ url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.87",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.85"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.87"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.85"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.87"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.85/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const h=s.getInstance();exports.stylesRegistry=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.87/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const h=s.getInstance();exports.stylesRegistry=h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-85"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-87"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-85"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-87"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
@@ -11,13 +11,13 @@ import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-
11
11
  import { property as i } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
12
12
  import { state as m } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
13
13
  import { classMap as E } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
14
- import { commonStyles as $ } from "./styles/common.styles.js";
15
- var C = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, t = (r, o, n, p) => {
16
- for (var s = p > 1 ? void 0 : p ? _(o, n) : o, l = r.length - 1, d; l >= 0; l--)
17
- (d = r[l]) && (s = (p ? d(o, n, s) : d(s)) || s);
18
- return p && s && C(o, n, s), s;
14
+ import { commonStyles as _ } from "./styles/common.styles.js";
15
+ var $ = Object.defineProperty, C = Object.getOwnPropertyDescriptor, r = (e, o, n, p) => {
16
+ for (var s = p > 1 ? void 0 : p ? C(o, n) : o, l = e.length - 1, d; l >= 0; l--)
17
+ (d = e[l]) && (s = (p ? d(o, n, s) : d(s)) || s);
18
+ return p && s && $(o, n, s), s;
19
19
  };
20
- let e = class extends k(u) {
20
+ let t = class extends k(u) {
21
21
  constructor() {
22
22
  super(...arguments), this.inputPlacement = "left", this.checked = !1, this.required = !1, this._disabled = !1, this.mode = "light", this._size = "medium", this.helperText = "", this.infoText = "", this._forcedError = "", this.invalidError = "", this.indeterminate = !1;
23
23
  }
@@ -26,28 +26,28 @@ let e = class extends k(u) {
26
26
  this.createContextConsumers([
27
27
  {
28
28
  context: b,
29
- callback: (r) => {
30
- this.disabledGroup = r;
29
+ callback: (e) => {
30
+ this.disabledGroup = e;
31
31
  }
32
32
  },
33
33
  {
34
34
  context: f,
35
- callback: (r) => {
36
- this.errorGroup = r;
35
+ callback: (e) => {
36
+ this.errorGroup = e;
37
37
  }
38
38
  },
39
39
  {
40
40
  context: v,
41
- callback: (r) => {
42
- this.sizeGroup = r;
41
+ callback: (e) => {
42
+ this.sizeGroup = e;
43
43
  }
44
44
  }
45
45
  ]);
46
46
  });
47
47
  }
48
48
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- createContextConsumers(r) {
50
- r.forEach(({ context: o, callback: n }) => {
49
+ createContextConsumers(e) {
50
+ e.forEach(({ context: o, callback: n }) => {
51
51
  new x(this, {
52
52
  context: o,
53
53
  callback: n,
@@ -58,17 +58,26 @@ let e = class extends k(u) {
58
58
  get disabled() {
59
59
  return this.disabledGroup ?? this._disabled;
60
60
  }
61
+ set disabled(e) {
62
+ this._disabled = e;
63
+ }
61
64
  get size() {
62
65
  return this.sizeGroup || this._size;
63
66
  }
67
+ set size(e) {
68
+ this._size = e;
69
+ }
64
70
  get forcedError() {
65
71
  return this._forcedError;
66
72
  }
73
+ set forcedError(e) {
74
+ this._forcedError = e;
75
+ }
67
76
  get error() {
68
77
  return this.errorGroup ?? !!this._forcedError;
69
78
  }
70
- handleChange(r) {
71
- const o = r.target;
79
+ handleChange(e) {
80
+ const o = e.target;
72
81
  this.checked = o.checked, this.dispatchEvent(
73
82
  new CustomEvent("change", {
74
83
  bubbles: !0,
@@ -93,10 +102,10 @@ let e = class extends k(u) {
93
102
  }
94
103
  get iconTemplate() {
95
104
  if (!this.checked) return c;
96
- const r = this.indeterminate ? "minus" : "check";
105
+ const e = this.indeterminate ? "minus" : "check";
97
106
  return this.componentFactory.createIcon({
98
107
  class: "icon",
99
- "icon-name": r
108
+ "icon-name": e
100
109
  });
101
110
  }
102
111
  get styleTokens() {
@@ -143,58 +152,58 @@ let e = class extends k(u) {
143
152
  `;
144
153
  }
145
154
  };
146
- e.styles = [$];
147
- t([
155
+ t.styles = [_];
156
+ r([
148
157
  i({ type: String })
149
- ], e.prototype, "name", 2);
150
- t([
158
+ ], t.prototype, "name", 2);
159
+ r([
151
160
  i({ type: String })
152
- ], e.prototype, "value", 2);
153
- t([
161
+ ], t.prototype, "value", 2);
162
+ r([
154
163
  i({ type: String, attribute: "input-placement" })
155
- ], e.prototype, "inputPlacement", 2);
156
- t([
164
+ ], t.prototype, "inputPlacement", 2);
165
+ r([
157
166
  i({ type: Boolean, converter: h, reflect: !0 })
158
- ], e.prototype, "checked", 2);
159
- t([
167
+ ], t.prototype, "checked", 2);
168
+ r([
160
169
  i({ type: Boolean, converter: h })
161
- ], e.prototype, "required", 2);
162
- t([
170
+ ], t.prototype, "required", 2);
171
+ r([
163
172
  i({ type: Boolean, converter: h, attribute: "disabled" })
164
- ], e.prototype, "_disabled", 2);
165
- t([
173
+ ], t.prototype, "_disabled", 2);
174
+ r([
166
175
  i({ type: String, reflect: !0 })
167
- ], e.prototype, "mode", 2);
168
- t([
176
+ ], t.prototype, "mode", 2);
177
+ r([
169
178
  i({ type: String, attribute: "size" })
170
- ], e.prototype, "_size", 2);
171
- t([
179
+ ], t.prototype, "_size", 2);
180
+ r([
172
181
  i({ type: String, attribute: "helper-text" })
173
- ], e.prototype, "helperText", 2);
174
- t([
182
+ ], t.prototype, "helperText", 2);
183
+ r([
175
184
  i({ type: String, attribute: "info-text" })
176
- ], e.prototype, "infoText", 2);
177
- t([
185
+ ], t.prototype, "infoText", 2);
186
+ r([
178
187
  i({ type: String, attribute: "forced-error" })
179
- ], e.prototype, "_forcedError", 2);
180
- t([
188
+ ], t.prototype, "_forcedError", 2);
189
+ r([
181
190
  i({ type: String, attribute: "invalid-error" })
182
- ], e.prototype, "invalidError", 2);
183
- t([
191
+ ], t.prototype, "invalidError", 2);
192
+ r([
184
193
  i({ type: Boolean, converter: h })
185
- ], e.prototype, "indeterminate", 2);
186
- t([
194
+ ], t.prototype, "indeterminate", 2);
195
+ r([
187
196
  m()
188
- ], e.prototype, "disabledGroup", 2);
189
- t([
197
+ ], t.prototype, "disabledGroup", 2);
198
+ r([
190
199
  m()
191
- ], e.prototype, "errorGroup", 2);
192
- t([
200
+ ], t.prototype, "errorGroup", 2);
201
+ r([
193
202
  m()
194
- ], e.prototype, "sizeGroup", 2);
195
- e = t([
203
+ ], t.prototype, "sizeGroup", 2);
204
+ t = r([
196
205
  y("ds-checkbox")
197
- ], e);
206
+ ], t);
198
207
  export {
199
- e as DsCheckbox
208
+ t as DsCheckbox
200
209
  };
@@ -1,56 +1,61 @@
1
- import { UiKitElement as v } from "../base/UiKitElement.js";
1
+ import { UiKitElement as m } from "../base/UiKitElement.js";
2
2
  import { customUiKitElement as b } from "../../decorators/customUiKitElement.js";
3
- import { booleanConverter as d } from "../../utils/booleanConverter.js";
4
- import { debounce as y } from "../../utils/debounce.js";
3
+ import { booleanConverter as p } from "../../utils/booleanConverter.js";
4
+ import { debounce as f } from "../../utils/debounce.js";
5
5
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
6
- import { nothing as r, html as p } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
6
+ import { nothing as n, html as d } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
7
7
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
8
- import { property as l } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
9
- import { state as m } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
10
- import { query as f } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
11
- import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
12
- import { commonStyles as C } from "./styles/common.styles.js";
13
- var k = Object.defineProperty, w = Object.getOwnPropertyDescriptor, s = (e, o, a, n) => {
14
- for (var i = n > 1 ? void 0 : n ? w(o, a) : o, c = e.length - 1, h; c >= 0; c--)
15
- (h = e[c]) && (i = (n ? h(o, a, i) : h(i)) || i);
16
- return n && i && k(o, a, i), i;
8
+ import { property as a } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
9
+ import { state as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
10
+ import { query as u } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
11
+ import { classMap as C } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
12
+ import { commonStyles as g } from "./styles/common.styles.js";
13
+ var k = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, t, r, l) => {
14
+ for (var o = l > 1 ? void 0 : l ? y(t, r) : t, c = e.length - 1, h; c >= 0; c--)
15
+ (h = e[c]) && (o = (l ? h(t, r, o) : h(o)) || o);
16
+ return l && o && k(t, r, o), o;
17
17
  };
18
- let t = class extends v {
18
+ let s = class extends m {
19
19
  constructor() {
20
- super(...arguments), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll = y({ func: () => this.checkScroll() }), this.handleCloseButtonClick = () => {
20
+ super(...arguments), this.lockClose = !1, this.lockScroll = !0, this.open = !1, this.size = "medium", this.hasBeenOpened = !1, this.hasScroll = !1, this.debouncedCheckScroll = f({ func: () => this.checkScroll() }), this.handleCloseButtonClick = () => {
21
21
  this.handleClose("button");
22
- }, this.handleBackdropClick = () => {
23
- this.handleClose("backdrop");
22
+ }, this.handleDialogClick = (e) => {
23
+ e.target === this.nativeDialog && this.handleClose("backdrop");
24
+ }, this.handleCancel = (e) => {
25
+ e.preventDefault(), this.lockClose || this.handleClose("escape");
24
26
  }, this.handleHostClick = (e) => {
25
27
  e.stopPropagation();
26
- }, this.handleKeyDown = (e) => {
27
- this.open && e.key === "Escape" && this.handleClose("escape");
28
28
  };
29
29
  }
30
30
  async updated(e) {
31
- super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && this.handleResizeObserver(), e.has("open") && this.open && (await this.updateComplete, this.requestUpdate());
31
+ super.updated(e), !this.hasBeenOpened && e.has("open") && this.open && (this.hasBeenOpened = !0), e.has("open") && (this.handleResizeObserver(), this.syncNativeDialogState()), e.has("open") && this.open && (await this.updateComplete, this.requestUpdate());
32
+ }
33
+ syncNativeDialogState() {
34
+ this.nativeDialog && (this.open ? this.openNativeDialog() : this.closeNativeDialog());
35
+ }
36
+ openNativeDialog() {
37
+ var e, t;
38
+ this.nativeDialog.open || (t = (e = this.nativeDialog).showModal) == null || t.call(e);
39
+ }
40
+ closeNativeDialog() {
41
+ var e, t;
42
+ this.nativeDialog.open && ((t = (e = this.nativeDialog).close) == null || t.call(e));
32
43
  }
33
44
  async handleResizeObserver() {
34
45
  var e;
35
- this.lockScroll && (document.body.style.overflow = this.open ? "hidden" : ""), (e = this.resizeObserver) == null || e.disconnect(), this.content && (this.resizeObserver.observe(this.content), await new Promise(requestAnimationFrame), this.checkScroll());
36
- }
37
- get containerClasses() {
38
- return {
39
- container: !0,
40
- close: !this.open,
41
- "with-scroll": this.open && this.hasScroll
42
- };
46
+ (e = this.resizeObserver) == null || e.disconnect(), this.content && (this.resizeObserver.observe(this.content), await new Promise(requestAnimationFrame), this.checkScroll());
43
47
  }
44
- get dialogClasses() {
48
+ get panelClasses() {
45
49
  return {
46
- dialog: !0,
50
+ panel: !0,
51
+ "with-scroll": this.open && this.hasScroll,
47
52
  [this.size]: !!this.size
48
53
  };
49
54
  }
50
55
  dispatchCloseEvents(e) {
51
- const o = `ds-dialog:close-${e}`;
56
+ const t = `ds-dialog:close-${e}`;
52
57
  this.dispatchEvent(
53
- new Event(o, {
58
+ new Event(t, {
54
59
  bubbles: !0,
55
60
  composed: !0
56
61
  })
@@ -65,77 +70,73 @@ let t = class extends v {
65
70
  this.lockClose || (this.open = !1, this.dispatchCloseEvents(e));
66
71
  }
67
72
  connectedCallback() {
68
- super.connectedCallback(), window.addEventListener("keydown", this.handleKeyDown), this.resizeObserver = new ResizeObserver(this.debouncedCheckScroll), this.handleResizeObserver(), this.addEventListener("click", this.handleHostClick);
73
+ super.connectedCallback(), this.resizeObserver = new ResizeObserver(this.debouncedCheckScroll), this.handleResizeObserver(), this.addEventListener("click", this.handleHostClick);
69
74
  }
70
75
  disconnectedCallback() {
71
76
  var e;
72
- super.disconnectedCallback(), window.removeEventListener("keydown", this.handleKeyDown), this.lockScroll && (document.body.style.overflow = ""), (e = this.resizeObserver) == null || e.disconnect(), this.removeEventListener("click", this.handleHostClick);
77
+ super.disconnectedCallback(), (e = this.resizeObserver) == null || e.disconnect(), this.removeEventListener("click", this.handleHostClick);
73
78
  }
74
79
  checkScroll() {
75
- var e, o;
76
- this.hasScroll = ((e = this.content) == null ? void 0 : e.scrollHeight) > ((o = this.content) == null ? void 0 : o.clientHeight);
80
+ var e, t;
81
+ this.hasScroll = ((e = this.content) == null ? void 0 : e.scrollHeight) > ((t = this.content) == null ? void 0 : t.clientHeight);
77
82
  }
78
83
  render() {
79
- return !this.hasBeenOpened && !this.open ? r : p`
80
- <style>
81
- :host {
82
- display: ${this.open ? "flex" : "none"};
83
- }
84
- </style>
85
-
86
- <div class=${u(this.containerClasses)}>
87
- <div class="overlay" @click=${this.handleBackdropClick}></div>
88
- <dialog
89
- ?open=${this.open}
90
- data-testid="ds-dialog-container"
91
- class=${u(this.dialogClasses)}
92
- aria-modal="true"
93
- aria-label=${this.dataAriaLabel || r}
94
- aria-description=${this.dataAriaDescription || r}
95
- >
96
- ${this.lockClose ? r : p`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
84
+ return !this.hasBeenOpened && !this.open ? n : d`
85
+ <dialog
86
+ class="dialog"
87
+ data-testid="ds-dialog-container"
88
+ aria-label=${this.dataAriaLabel || n}
89
+ aria-description=${this.dataAriaDescription || n}
90
+ @cancel=${this.handleCancel}
91
+ @click=${this.handleDialogClick}
92
+ >
93
+ <div class=${C(this.panelClasses)}>
94
+ ${this.lockClose ? n : d`<slot name="close-button" @click=${this.handleCloseButtonClick}></slot>`}
97
95
  <div class="content-container">
98
96
  <div tabindex="0" class="content ds-scroll">
99
97
  <slot @slotchange=${this.handleResizeObserver}></slot>
100
98
  </div>
101
99
  <slot name="footer"></slot>
102
100
  </div>
103
- </dialog>
104
- </div>
101
+ </div>
102
+ </dialog>
105
103
  `;
106
104
  }
107
105
  };
108
- t.styles = [C];
109
- s([
110
- l({ type: Boolean, converter: d, attribute: "lock-close" })
111
- ], t.prototype, "lockClose", 2);
112
- s([
113
- l({ type: Boolean, converter: d, attribute: "lock-scroll" })
114
- ], t.prototype, "lockScroll", 2);
115
- s([
116
- l({ type: Boolean, converter: d })
117
- ], t.prototype, "open", 2);
118
- s([
119
- l({ type: String })
120
- ], t.prototype, "size", 2);
121
- s([
122
- l({ type: String, attribute: "data-aria-label" })
123
- ], t.prototype, "dataAriaLabel", 2);
124
- s([
125
- l({ type: String, attribute: "data-aria-description" })
126
- ], t.prototype, "dataAriaDescription", 2);
127
- s([
128
- m()
129
- ], t.prototype, "hasBeenOpened", 2);
130
- s([
131
- m()
132
- ], t.prototype, "hasScroll", 2);
133
- s([
134
- f(".content")
135
- ], t.prototype, "content", 2);
136
- t = s([
106
+ s.styles = [g];
107
+ i([
108
+ a({ type: Boolean, converter: p, attribute: "lock-close" })
109
+ ], s.prototype, "lockClose", 2);
110
+ i([
111
+ a({ type: Boolean, converter: p, attribute: "lock-scroll" })
112
+ ], s.prototype, "lockScroll", 2);
113
+ i([
114
+ a({ type: Boolean, converter: p })
115
+ ], s.prototype, "open", 2);
116
+ i([
117
+ a({ type: String })
118
+ ], s.prototype, "size", 2);
119
+ i([
120
+ a({ type: String, attribute: "data-aria-label" })
121
+ ], s.prototype, "dataAriaLabel", 2);
122
+ i([
123
+ a({ type: String, attribute: "data-aria-description" })
124
+ ], s.prototype, "dataAriaDescription", 2);
125
+ i([
126
+ v()
127
+ ], s.prototype, "hasBeenOpened", 2);
128
+ i([
129
+ v()
130
+ ], s.prototype, "hasScroll", 2);
131
+ i([
132
+ u(".content")
133
+ ], s.prototype, "content", 2);
134
+ i([
135
+ u("dialog")
136
+ ], s.prototype, "nativeDialog", 2);
137
+ s = i([
137
138
  b("ds-dialog")
138
- ], t);
139
+ ], s);
139
140
  export {
140
- t as DsDialog
141
+ s as DsDialog
141
142
  };