@getflip/swirl-components 0.260.0 → 0.261.0
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/components.json +120 -18
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-modal.cjs.entry.js +12 -5
- package/dist/cjs/swirl-switch.cjs.entry.js +4 -1
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-modal/swirl-modal.js +67 -20
- package/dist/collection/components/swirl-switch/swirl-switch.js +21 -1
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-modal.js +14 -5
- package/dist/components/swirl-switch.js +5 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-modal.entry.js +12 -5
- package/dist/esm/swirl-switch.entry.js +4 -1
- package/dist/swirl-components/p-673ec310.entry.js +1 -0
- package/dist/swirl-components/p-7b831369.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-modal/swirl-modal.d.ts +8 -6
- package/dist/types/components/swirl-switch/swirl-switch.d.ts +1 -0
- package/dist/types/components.d.ts +18 -12
- package/package.json +1 -1
- package/vscode-data.json +41 -0
- package/dist/swirl-components/p-2a67a199.entry.js +0 -1
- package/dist/swirl-components/p-90470a38.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,c as i,h as t,H as e,g as c}from"./p-30e99c25.js";import{c as r}from"./p-a5dce9e6.js";const h=class{constructor(t){s(this,t),this.valueChange=i(this,"valueChange",7),this.onChange=()=>{this.checked=!this.checked,this.valueChange.emit(this.checked)},this.checked=!1,this.disabled=!1,this.hideLabel=void 0,this.inputId=void 0,this.inputName=void 0,this.label=void 0,this.labelPosition="end",this.value=void 0}async toggle(){this.inputEl.dispatchEvent(new Event("change"))}render(){const s=this.checked,i=s?"true":"false",c=r("switch",`switch--label-position-${this.labelPosition}`,{"switch--off":!this.checked,"switch--on":s,"switch--disabled":this.disabled});return t(e,{key:"a4eaf0565ce872de62f9d9a785c0510674c91a24"},t("label",{key:"2052bc406430e24c12133dcdcfbba5975c631af9",class:c,htmlFor:this.inputId},t("span",{key:"9d67d3eb89aed710955ec023b0099d66b0c4a7a7",class:"switch__control"},t("swirl-visually-hidden",{key:"45e3bc52f9b1977035dc1dbb2b2841bc7af15bce"},t("input",{key:"b152d854e7829789e01bc4fd9b7109bed49c3e24","aria-checked":i,checked:s,class:"switch__input",disabled:this.disabled,id:this.inputId,name:this.inputName,onChange:this.onChange,ref:s=>this.inputEl=s,role:"switch",type:"checkbox",value:this.value})),t("span",{key:"238458c57279552bf458ae86262c9fefbb4d6f5c","aria-hidden":"true",class:"switch__thumb"})),this.label&&!this.hideLabel&&t("span",{key:"c92eaa3dea4f7ef98e124efdb39dcb0356e7e1cb",class:"switch__label"},this.label),this.label&&this.hideLabel&&t("swirl-visually-hidden",{key:"d0d12573a1141b268ed9ed70a3d0acfe1ba465b6"},this.label)))}get el(){return c(this)}};h.style=".sc-swirl-switch-h{display:inline-flex}.sc-swirl-switch-h *.sc-swirl-switch{box-sizing:border-box}.switch.sc-swirl-switch{display:inline-flex;align-items:center;touch-action:none}.switch.sc-swirl-switch:focus-within .switch__control.sc-swirl-switch{box-shadow:0 0 0 0.0625rem var(--s-background-default),\n 0 0 0 0.1875rem var(--s-focus-default)}.switch--label-position-start.sc-swirl-switch{flex-direction:row-reverse}.switch--label-position-start.sc-swirl-switch .switch__label.sc-swirl-switch{margin-right:var(--s-space-12);margin-left:0}.switch--on.sc-swirl-switch .switch__thumb.sc-swirl-switch{left:calc(100% - 1.25rem - var(--s-space-2))}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch--on.sc-swirl-switch .switch__thumb.sc-swirl-switch{left:calc(100% - 0.875rem - var(--s-space-2))}}.switch--on.sc-swirl-switch .switch__control.sc-swirl-switch{background-color:var(--s-interactive-primary-default)}.switch--disabled.sc-swirl-switch .switch__control.sc-swirl-switch{background-color:var(--s-interactive-primary-disabled);cursor:default}.switch--disabled.sc-swirl-switch .switch__thumb.sc-swirl-switch{background-color:var(--s-interactive-neutral-default)}.switch--disabled.sc-swirl-switch .switch__label.sc-swirl-switch{color:var(--s-text-disabled)}.switch__control.sc-swirl-switch{position:relative;width:2.75rem;height:1.5rem;flex-shrink:0;border-radius:calc(1.5rem / 2);background-color:var(--s-interactive-primary-disabled);cursor:pointer;transition:background-color 0.2s}@media (prefers-reduced-motion){.switch__control.sc-swirl-switch{transition:none}}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch__control.sc-swirl-switch{width:1.875rem;height:1.125rem;border-radius:calc(1.125rem / 2)}}.switch__thumb.sc-swirl-switch{position:absolute;top:var(--s-space-2);left:var(--s-space-2);width:1.25rem;height:1.25rem;border-radius:50%;background-color:var(--s-surface-default);transition:left 0.2s;pointer-events:none}@media (prefers-reduced-motion){.switch__thumb.sc-swirl-switch{transition:none}}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.switch__thumb.sc-swirl-switch{width:0.875rem;height:0.875rem}}.switch__label.sc-swirl-switch{position:relative;z-index:1;margin-left:var(--s-space-12);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);white-space:nowrap}";export{h as swirl_switch}
|