@kwantis-id3/frontend-library 0.8.0 → 0.8.1

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/index.js CHANGED
@@ -92,5 +92,5 @@
92
92
  :active {
93
93
  color: ${Jt(t.colors[e.color||"primary"].main).darken(5).toString()};
94
94
  }
95
- `;return Ct(r.useMemo((()=>{switch(e.variant){case"contained":default:return n;case"outlined":return o;case"text":return i}}),[e.variant,n,o,i]),Object.assign({css:e.sx,onClick:e.onClick,className:e.className,id:e.htmlId,disabled:e.disabled},{children:e.children}))},exports.MultiSelect=t=>{const u=Rt();return e.createElement(gi,{options:t.options,onChange:e=>t.onChange?t.onChange(e):void 0,placeholder:t.placeholder,isDisabled:t.isDisabled,isClearable:t.isClearable,isSearchable:t.isSearchable,isOptionDisabled:t.isOptionDisabled,isLoading:t.isLoading,value:t.value,isMulti:!0,id:t.htmlId,className:t.className,theme:e=>Object.assign(Object.assign({},e),{colors:Object.assign(Object.assign({},e.colors),{primary:u.colors[t.color||"primary"].main,primary25:Jt(u.colors[t.color||"primary"].main).lighten(25).toString(),primary50:Jt(u.colors[t.color||"primary"].main).lighten(50).toString(),primary75:Jt(u.colors[t.color||"primary"].main).lighten(75).toString()})})})},exports.SingleSelect=t=>{const u=Rt();return e.createElement(gi,{options:t.options,onChange:t.onChange,placeholder:t.placeholder,isDisabled:t.isDisabled,isClearable:t.isClearable,isSearchable:t.isSearchable,isOptionDisabled:t.isOptionDisabled,isLoading:t.isLoading,value:t.value,id:t.htmlId,className:t.className,theme:e=>Object.assign(Object.assign({},e),{colors:Object.assign(Object.assign({},e.colors),{primary:u.colors[t.color||"primary"].main,primary25:Jt(u.colors[t.color||"primary"].main).lighten(25).toString(),primary50:Jt(u.colors[t.color||"primary"].main).lighten(50).toString(),primary75:Jt(u.colors[t.color||"primary"].main).lighten(75).toString()})})})},exports.Slider=t=>{const u=Rt(),n=e.useMemo((()=>u.colors[t.color||"primary"]),[u,t.color]),r=e.useMemo((()=>u.colors[t.unselectedColor||"statusNeutral"]),[u,t.unselectedColor]),{min:o,max:i}=e.useMemo((()=>t.autoCalculateMinMax?{min:Math.min(...t.values),max:Math.max(...t.values)}:{min:t.min||0,max:t.max||100}),[t.autoCalculateMinMax,t.min,t.max]);return e.createElement(e.Fragment,null,e.createElement(bi.Range,{min:o,max:i,values:t.values,onChange:t.onChange,onFinalChange:t.onFinalChange,renderTrack:({props:r,children:a})=>{return e.createElement(Ti,{onMouseDown:r.onMouseDown,onTouchStart:r.onTouchStart,className:t.className,id:t.htmlId,style:Object.assign(Object.assign({},r.style),{height:"36px",display:"flex",width:"100%"})},e.createElement(ki,{ref:r.ref,bgColor:bi.getTrackBackground({values:t.values,colors:(s=t.values,1===s.length?[n.main,u.colors.statusNeutral.main]:Array.from(new Array(t.values.length+1)).map(((e,t)=>t%2!=0?n.main:u.colors.statusNeutral.main))),min:o,max:i})},a));var s},renderThumb:({props:u,value:o})=>e.createElement(Ri,Object.assign({bgColor:n.contrastText,borderColor:r.main,value:String(o)},u,{style:Object.assign({},u.style)}),!1!==t.showThumbValue&&e.createElement(Vi,{textColor:n.main},e.createElement("span",null,o)))}))},exports.ThemeContextProvider=t=>{const[u]=e.useState(t.theme||Tt);return e.createElement(kt.Provider,{value:u},e.createElement(ct,{theme:u},t.children))},exports.useThemeContext=Rt;
95
+ `;return Ct(r.useMemo((()=>{switch(e.variant){case"contained":default:return n;case"outlined":return o;case"text":return i}}),[e.variant,n,o,i]),Object.assign({css:e.sx,onClick:e.onClick,className:e.className,id:e.htmlId,disabled:e.disabled},{children:e.children}))},exports.MultiSelect=t=>{const u=Rt();return e.createElement(gi,{options:t.options,onChange:e=>t.onChange?t.onChange(e):void 0,placeholder:t.placeholder,isDisabled:t.isDisabled,isClearable:t.isClearable,isSearchable:t.isSearchable,isOptionDisabled:t.isOptionDisabled,isLoading:t.isLoading,value:t.value,isMulti:!0,id:t.htmlId,className:t.className,theme:e=>Object.assign(Object.assign({},e),{colors:Object.assign(Object.assign({},e.colors),{primary:u.colors[t.color||"primary"].main,primary25:Jt(u.colors[t.color||"primary"].main).lighten(25).toString(),primary50:Jt(u.colors[t.color||"primary"].main).lighten(50).toString(),primary75:Jt(u.colors[t.color||"primary"].main).lighten(75).toString()})})})},exports.SingleSelect=t=>{const u=Rt();return e.createElement(gi,{options:t.options,onChange:t.onChange,placeholder:t.placeholder,isDisabled:t.isDisabled,isClearable:t.isClearable,isSearchable:t.isSearchable,isOptionDisabled:t.isOptionDisabled,isLoading:t.isLoading,value:t.value,id:t.htmlId,className:t.className,theme:e=>Object.assign(Object.assign({},e),{colors:Object.assign(Object.assign({},e.colors),{primary:u.colors[t.color||"primary"].main,primary25:Jt(u.colors[t.color||"primary"].main).lighten(25).toString(),primary50:Jt(u.colors[t.color||"primary"].main).lighten(50).toString(),primary75:Jt(u.colors[t.color||"primary"].main).lighten(75).toString()})})})},exports.Slider=t=>{const u=Rt(),n=e.useMemo((()=>u.colors[t.color||"primary"]),[u,t.color]);e.useMemo((()=>u.colors[t.unselectedColor||"statusNeutral"]),[u,t.unselectedColor]);const{min:r,max:o}=e.useMemo((()=>t.autoCalculateMinMax?{min:Math.min(...t.values),max:Math.max(...t.values)}:{min:t.min||0,max:t.max||100}),[t.autoCalculateMinMax,t.min,t.max]);return e.createElement(e.Fragment,null,e.createElement(bi.Range,{min:r,max:o,values:t.values,onChange:t.onChange,onFinalChange:t.onFinalChange,renderTrack:({props:i,children:a})=>{return e.createElement(Ti,{onMouseDown:i.onMouseDown,onTouchStart:i.onTouchStart,className:t.className,id:t.htmlId,style:Object.assign(Object.assign({},i.style),{height:"36px",display:"flex",width:"100%"})},e.createElement(ki,{ref:i.ref,bgColor:bi.getTrackBackground({values:t.values,colors:(s=t.values,1===s.length?[n.main,u.colors.statusNeutral.main]:Array.from(new Array(t.values.length+1)).map(((e,t)=>t%2!=0?n.main:u.colors.statusNeutral.main))),min:r,max:o})},a));var s},renderThumb:({props:u,value:r})=>e.createElement(Ri,Object.assign({bgColor:n.contrastText,borderColor:n.main,value:String(r)},u,{style:Object.assign({},u.style)}),!1!==t.showThumbValue&&e.createElement(Vi,{textColor:n.main},e.createElement("span",null,r)))}))},exports.ThemeContextProvider=t=>{const[u]=e.useState(t.theme||Tt);return e.createElement(kt.Provider,{value:u},e.createElement(ct,{theme:u},t.children))},exports.useThemeContext=Rt;
96
96
  //# sourceMappingURL=index.js.map