@progress/kendo-themes-html
Version: 
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.07 kB
JavaScript
var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((a,r)=>e[r]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var d=(t,e)=>s({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),b=(t,e)=>s({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly,"k-highlighted":e.highlighted});var o={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},u={small:"small",medium:"medium",large:"large",full:"full"},f={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},n={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},l={open:"open",hover:"hover",focus:"focus",active:"active",selected:"selected",disabled:"disabled",valid:"valid",invalid:"invalid",loading:"loading",required:"required",empty:"empty",indeterminate:"indeterminate",checked:"checked",readonly:"readonly",highlighted:"highlighted"};import{jsx as ce}from"react/jsx-runtime";var S="k-input",re=[l.hover,l.focus,l.valid,l.invalid,l.required,l.disabled,l.loading,l.readonly],ie={size:[o.small,o.medium,o.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[f.solid,f.flat,f.outline]},M={size:o.medium,rounded:o.medium,fillMode:f.solid},T=t=>{let{hover:e,focus:a,disabled:r,invalid:i,valid:p,loading:c,readonly:h,size:m=M.size,rounded:g=M.rounded,fillMode:A=M.fillMode,...P}=t;return ce("span",{...P,className:s(t.className,S,d(S,{size:m,rounded:g,fillMode:A}),b(S,{hover:e,focus:a,disabled:r,invalid:i,valid:p,loading:c,readonly:h}))})};T.states=re;T.options=ie;T.className=S;T.defaultOptions=M;import{jsx as ue}from"react/jsx-runtime";var z="k-picker",pe=[l.hover,l.focus,l.valid,l.invalid,l.required,l.disabled,l.loading,l.readonly],de={size:[o.small,o.medium,o.large],rounded:[u.small,u.medium,u.large,u.full],fillMode:[f.solid,f.flat,f.outline]},L={size:o.medium,rounded:u.medium,fillMode:f.solid},C=t=>{let{hover:e,focus:a,disabled:r,invalid:i,valid:p,loading:c,readonly:h,size:m=L.size,rounded:g=L.rounded,fillMode:A=L.fillMode,...P}=t;return ue("span",{...P,className:s(t.className,z,d(z,{size:m,rounded:g,fillMode:A}),b(z,{hover:e,focus:a,disabled:r,invalid:i,valid:p,loading:c,readonly:h})),children:t.children})};C.states=pe;C.options=de;C.className=z;C.defaultOptions=L;import{Fragment as he,jsx as D}from"react/jsx-runtime";var w="k-icon k-font-icon",me=[],fe={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},xe={},I=t=>{let{size:e,themeColor:a,icon:r,rotate:i,flip:p,...c}=t;return r?D("span",{...c,className:s(t.className,w,d(w,{size:e}),{[`k-i-${r}`]:r,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"})}):D(he,{})};I.states=me;I.options=fe;I.className=w;I.defaultOptions=xe;var J=I;import{Fragment as Ne,jsx as O}from"react/jsx-runtime";var R="k-icon k-svg-icon",ge=[],Ie={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},Q={viewBox:"0 0 24 24"},N=t=>{let{size:e,themeColor:a,rotate:r,flip:i,viewBox:p=Q.viewBox,icon:c,...h}=t;if(!c)return O(Ne,{});c==="none"&&{...h,className:s(t.className,R,"k-none")};let m=typeof c=="object"&&c.name&&c.name;return O("span",{...h,className:s(t.className,R,d("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:O("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:p,dangerouslySetInnerHTML:typeof c=="object"?{__html:c.content}:void 0,children:c?void 0:t.children})})};N.states=ge;N.options=Ie;N.className=R;N.defaultOptions=Q;var E=N;import*as W from"@progress/kendo-svg-icons";import{Fragment as X,jsx as v}from"react/jsx-runtime";var ve=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ye=[],ke={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},$={viewBox:"0 0 24 24",type:"svg"},x=t=>{let{size:e,themeColor:a,icon:r,type:i=$.type,rotate:p,flip:c,viewBox:h=$.viewBox,...m}=t;if(!r)return v(X,{});if(i==="svg"){if(r==="none")return v(E,{...m,icon:r,size:e});let g=ve(`${r}-icon`);return W[g]?v(E,{...m,icon:W[g],size:e,themeColor:a,rotate:p,flip:c,viewBox:h}):v(X,{})}return v(J,{...m,icon:r,size:e,themeColor:a,rotate:p,flip:c})};x.states=ye;x.options=ke;x.defaultOptions=$;import{Fragment as Me,jsx as V}from"react/jsx-runtime";var Y="k-clear-value",be=[l.disabled,l.loading,l.readonly],Se={},B=t=>{let{disabled:e,loading:a,readonly:r,value:i}=t;return e||r||a||!i?V(Me,{}):V("span",{className:s(t.className,Y),children:V(x,{icon:"x"})})};B.states=be;B.options=Se;B.className=Y;import{jsx as Le}from"react/jsx-runtime";var K="k-input-inner",Te=[],ze={},H={type:"text",autocomplete:"off",value:"",placeholder:""},y=t=>{let{value:e=H.value,type:a=H.type,placeholder:r=H.placeholder,autocomplete:i=H.autocomplete,...p}=t;return Le("input",{...p,type:a,className:s(t.className,K,d(K,t)),placeholder:r,autoComplete:i,defaultValue:e})};y.states=Te;y.options=ze;y.className=K;import{jsx as Z,jsxs as He}from"react/jsx-runtime";var _="k-input-inner",Ce=[],Oe={},F=t=>{let{value:e,placeholder:a,showValue:r,valueIcon:i,valueIconName:p,...c}=t;return He("span",{...c,className:s(t.className,_,d(_,t)),children:[i,!i&&p&&Z(x,{className:"k-input-value-icon",icon:p}),r&&!e&&a,r&&e&&Z("span",{className:"k-input-value-text",children:e})]})};F.states=Ce;F.options=Oe;F.className=_;import{jsx as we}from"react/jsx-runtime";var G="k-input-inner",Ae=[],Pe={},j={value:"",placeholder:""},q=t=>{let{value:e=j.value,placeholder:a=j.placeholder,rows:r,...i}=t;return we("textarea",{...i,className:s(t.className,G,d(G,t)),placeholder:a,rows:r,defaultValue:e})};q.states=Ae;q.options=Pe;q.className=G;import{Fragment as Ee,jsx as ee}from"react/jsx-runtime";var te="k-input-loading-icon",Re=[l.disabled,l.loading],oe=t=>{let{disabled:e,loading:a}=t;return e||!a?ee(Ee,{}):ee("span",{className:s(t.className,te,"k-icon k-i-loading")})};oe.states=Re;oe.className=te;import{Fragment as Be,jsx as ne}from"react/jsx-runtime";var ae="k-input-validation-icon",$e=[l.valid,l.invalid,l.disabled,l.loading],Ve={},U=t=>{let{valid:e,invalid:a,disabled:r,loading:i}=t,p=a?"warning-circle":"check-circle";return r||i||!!!(e||a)?ne(Be,{}):ne(x,{className:s(ae),icon:p})};U.states=$e;U.options=Ve;U.className=ae;import{Fragment as _t,jsx as Ft}from"react/jsx-runtime";import{Fragment as Dt,jsx as Jt}from"react/jsx-runtime";import{jsx as Yt}from"react/jsx-runtime";import{jsx as to}from"react/jsx-runtime";import{jsx as so}from"react/jsx-runtime";import{jsx as se}from"react/jsx-runtime";var le="k-searchbar",Ke=[],_e={},Fe={},k=t=>{let{placeholder:e,...a}=t;return se("span",{...a,className:s(t.className,le),children:se(y,{placeholder:e})})};k.states=Ke;k.options=_e;k.className=le;k.defaultOptions=Fe;var So=k;export{le as SEARCHBAR_CLASSNAME,k as SearchBar,So as default};