UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.02 kB
var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((a,l)=>e[l]||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});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"},r={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"};import{jsx as ce}from"react/jsx-runtime";var S="k-input",le=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.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:l,invalid:i,valid:p,loading:c,readonly:h,size:m=M.size,rounded:I=M.rounded,fillMode:A=M.fillMode,...P}=t;return ce("span",{...P,className:s(t.className,S,d(S,{size:m,rounded:I,fillMode:A}),b(S,{hover:e,focus:a,disabled:l,invalid:i,valid:p,loading:c,readonly:h}))})};T.states=le;T.options=ie;T.className=S;T.defaultOptions=M;import{jsx as ue}from"react/jsx-runtime";var z="k-picker",pe=[r.hover,r.focus,r.valid,r.invalid,r.required,r.disabled,r.loading,r.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:l,invalid:i,valid:p,loading:c,readonly:h,size:m=L.size,rounded:I=L.rounded,fillMode:A=L.fillMode,...P}=t;return ue("span",{...P,className:s(t.className,z,d(z,{size:m,rounded:I,fillMode:A}),b(z,{hover:e,focus:a,disabled:l,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={},g=t=>{let{size:e,themeColor:a,icon:l,rotate:i,flip:p,...c}=t;return l?D("span",{...c,className:s(t.className,w,d(w,{size:e}),{[`k-i-${l}`]:l,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"})}):D(he,{})};g.states=me;g.options=fe;g.className=w;g.defaultOptions=xe;var J=g;import{Fragment as Ne,jsx as O}from"react/jsx-runtime";var R="k-icon k-svg-icon",Ie=[],ge={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:l,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-${l}`]:l,"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=Ie;N.options=ge;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:l,type:i=$.type,rotate:p,flip:c,viewBox:h=$.viewBox,...m}=t;if(!l)return v(X,{});if(i==="svg"){if(l==="none")return v(E,{...m,icon:l,size:e});let I=ve(`${l}-icon`);return W[I]?v(E,{...m,icon:W[I],size:e,themeColor:a,rotate:p,flip:c,viewBox:h}):v(X,{})}return v(J,{...m,icon:l,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=[r.disabled,r.loading,r.readonly],Se={},B=t=>{let{disabled:e,loading:a,readonly:l,value:i}=t;return e||l||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:l=H.placeholder,autocomplete:i=H.autocomplete,...p}=t;return Le("input",{...p,type:a,className:s(t.className,K,d(K,t)),placeholder:l,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:l,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}),l&&!e&&a,l&&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:l,...i}=t;return we("textarea",{...i,className:s(t.className,G,d(G,t)),placeholder:a,rows:l,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=[r.disabled,r.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=[r.valid,r.invalid,r.disabled,r.loading],Ve={},U=t=>{let{valid:e,invalid:a,disabled:l,loading:i}=t,p=a?"warning-circle":"check-circle";return l||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 re="k-searchbar",Ke=[],_e={},Fe={},k=t=>{let{placeholder:e,...a}=t;return se("span",{...a,className:s(t.className,re),children:se(y,{placeholder:e})})};k.states=Ke;k.options=_e;k.className=re;k.defaultOptions=Fe;var So=k;export{re as SEARCHBAR_CLASSNAME,k as SearchBar,So as default};