@salla.sa/twilight-components 1.0.57 → 1.0.58
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/loader.cjs.js +1 -1
- package/dist/cjs/salla-button.cjs.entry.js +7 -7
- package/dist/cjs/salla-conditional-fields.cjs.entry.js +76 -0
- package/dist/cjs/salla-quantity-input.cjs.entry.js +64 -0
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/salla-button/salla-button.js +10 -10
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.css +3 -0
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +82 -0
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.css +3 -0
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +71 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button.entry.js +7 -7
- package/dist/esm/salla-conditional-fields.entry.js +72 -0
- package/dist/esm/salla-quantity-input.entry.js +60 -0
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/p-40693cd3.entry.js +1 -0
- package/dist/twilight-components/p-5d5b04ec.entry.js +1 -0
- package/dist/twilight-components/p-6c928c14.entry.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +2 -2
- package/dist/types/components/salla-conditional-fields/salla-conditional-fields.d.ts +9 -0
- package/dist/types/components/salla-quantity-input/salla-quantity-input.d.ts +18 -0
- package/dist/types/components.d.ts +34 -8
- package/example/dist/tailwind.css +944 -326
- package/example/dist/twilight.js +1 -1
- package/example/index.html +523 -123
- package/package.json +1 -1
- package/dist/twilight-components/p-646fbb7f.entry.js +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,H as o,g as n}from"./p-cb1c59a2.js";const e=class{constructor(s){t(this,s),this.hostAttributes={},this.buttonType="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after",this.wide=!1,this.wide&&this.host.classList.add("s-button-wide")}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(t){return this.text.innerHTML=t,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["type","color","fill","size","width","id","loading"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes.type=this.hostAttributes.type||"button",this.hostAttributes.class+=" s-button-element s-button-"+this.buttonType+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.buttonType?" s-button-"+this.color+"-link":"")+("link"!=this.buttonType&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.buttonType?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),this.hostAttributes}render(){return s(o,{class:"s-button-wrap"},s("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),s("span",{class:"s-button-text",ref:t=>this.text=t},s("slot",null)),this.loading?s("span",{class:"s-button-loader"}):""))}get host(){return n(this)}};e.style="salla-button{pointer-events:none}salla-button[type=submit]{-webkit-appearance:none}salla-button[width=wide]{width:100%}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-element{pointer-events:none !important}.s-button-wrap[loading] .s-button-loader-center .s-button-text{opacity:0}.s-button-wrap .s-button-element[loading]{pointer-events:none !important}.s-button-wrap .s-button-element:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-solid .s-button-loader:before{border-color:#fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2)}.s-button-wrap .s-button-outline{border:1px solid currentColor}.s-button-wrap .s-button-outline:hover{border-color:transparent}.s-button-wrap .s-button-outline .s-button-loader:before{border-top-color:currentColor;border-left-color:currentColor}.s-button-wrap .s-button-icon.s-button-large{width:56px;height:56px}.s-button-wrap .s-button-icon.s-button-small{width:24px;height:24px}.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.s-button-wrap .s-button-loader-start.s-button-element{padding-right:40px}.s-button-wrap .s-button-loader-start .s-button-loader{position:absolute;right:8px}.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr]{left:8px;right:auto}.s-button-wrap .s-button-loader-end.s-button-element{padding-left:40px}.s-button-wrap .s-button-loader-end .s-button-loader{position:absolute;left:8px}.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr]{right:8px;left:auto}.s-button-wrap .s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);margin:0 !important}";export{e as salla_button}
|