@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.78 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,i)=>e[i]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(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"}),H=(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"},p={small:"small",medium:"medium",large:"large",full:"full"},m={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},l={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},n={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 Oe}from"react/jsx-runtime";var P="k-input",ze=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],Ce={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},A={size:o.medium,rounded:o.medium,fillMode:m.solid},g=t=>{let{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x,size:f=A.size,rounded:I=A.rounded,fillMode:b=A.fillMode,...N}=t;return Oe("span",{...N,className:s(t.className,P,u(P,{size:f,rounded:I,fillMode:b}),H(P,{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x}))})};g.states=ze;g.options=Ce;g.className=P;g.defaultOptions=A;import{jsx as He}from"react/jsx-runtime";var E="k-picker",Le=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],we={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},R={size:o.medium,rounded:p.medium,fillMode:m.solid},V=t=>{let{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x,size:f=R.size,rounded:I=R.rounded,fillMode:b=R.fillMode,...N}=t;return He("span",{...N,className:s(t.className,E,u(E,{size:f,rounded:I,fillMode:b}),H(E,{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x})),children:t.children})};V.states=Le;V.options=we;V.className=E;V.defaultOptions=R;import{Fragment as Re,jsx as ne}from"react/jsx-runtime";var F="k-icon k-font-icon",Pe=[],Ae={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},Ee={},k=t=>{let{size:e,themeColor:a,icon:i,rotate:r,flip:d,...c}=t;return i?ne("span",{...c,className:s(t.className,F,u(F,{size:e}),{[`k-i-${i}`]:i,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):ne(Re,{})};k.states=Pe;k.options=Ae;k.className=F;k.defaultOptions=Ee;var ae=k;import{Fragment as Be,jsx as $}from"react/jsx-runtime";var _="k-icon k-svg-icon",Ve=[],$e={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},se={viewBox:"0 0 24 24"},S=t=>{let{size:e,themeColor:a,rotate:i,flip:r,viewBox:d=se.viewBox,icon:c,...x}=t;if(!c)return $(Be,{});c==="none"&&{...x,className:s(t.className,_,"k-none")};let f=typeof c=="object"&&c.name&&c.name;return $("span",{...x,className:s(t.className,_,u("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:$("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:d,dangerouslySetInnerHTML:typeof c=="object"?{__html:c.content}:void 0,children:c?void 0:t.children})})};S.states=Ve;S.options=$e;S.className=_;S.defaultOptions=se;var q=S;import*as le from"@progress/kendo-svg-icons";import{Fragment as ie,jsx as M}from"react/jsx-runtime";var Ke=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Fe=[],_e={size:[o.xsmall,o.small,o.medium,o.large,o.xlarge,o.xxlarge,o.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},G={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:a,icon:i,type:r=G.type,rotate:d,flip:c,viewBox:x=G.viewBox,...f}=t;if(!i)return M(ie,{});if(r==="svg"){if(i==="none")return M(q,{...f,icon:i,size:e});let I=Ke(`${i}-icon`);return le[I]?M(q,{...f,icon:le[I],size:e,themeColor:a,rotate:d,flip:c,viewBox:x}):M(ie,{})}return M(ae,{...f,icon:i,size:e,themeColor:a,rotate:d,flip:c})};h.states=Fe;h.options=_e;h.defaultOptions=G;import{Fragment as Xe,jsx as X}from"react/jsx-runtime";var re="k-clear-value",qe=[n.disabled,n.loading,n.readonly],Ge={},T=t=>{let{disabled:e,loading:a,readonly:i,value:r}=t;return e||i||a||!r?X(Xe,{}):X("span",{className:s(t.className,re),children:X(h,{icon:"x"})})};T.states=qe;T.options=Ge;T.className=re;import{jsx as De}from"react/jsx-runtime";var U="k-input-inner",Ue=[],Je={},B={type:"text",autocomplete:"off",value:"",placeholder:""},z=t=>{let{value:e=B.value,type:a=B.type,placeholder:i=B.placeholder,autocomplete:r=B.autocomplete,...d}=t;return De("input",{...d,type:a,className:s(t.className,U,u(U,t)),placeholder:i,autoComplete:r,defaultValue:e})};z.states=Ue;z.options=Je;z.className=U;import{jsx as ce,jsxs as Ye}from"react/jsx-runtime";var J="k-input-inner",Qe=[],We={},D=t=>{let{value:e,placeholder:a,showValue:i,valueIcon:r,valueIconName:d,...c}=t;return Ye("span",{...c,className:s(t.className,J,u(J,t)),children:[r,!r&&d&&ce(h,{className:"k-input-value-icon",icon:d}),i&&!e&&a,i&&e&&ce("span",{className:"k-input-value-text",children:e})]})};D.states=Qe;D.options=We;D.className=J;import{jsx as et}from"react/jsx-runtime";var Q="k-input-inner",Ze=[],je={},de={value:"",placeholder:""},W=t=>{let{value:e=de.value,placeholder:a=de.placeholder,rows:i,...r}=t;return et("textarea",{...r,className:s(t.className,Q,u(Q,t)),placeholder:a,rows:i,defaultValue:e})};W.states=Ze;W.options=je;W.className=Q;import{Fragment as ot,jsx as pe}from"react/jsx-runtime";var ue="k-input-loading-icon",tt=[n.disabled,n.loading],K=t=>{let{disabled:e,loading:a}=t;return e||!a?pe(ot,{}):pe("span",{className:s(t.className,ue,"k-icon k-i-loading")})};K.states=tt;K.className=ue;import{Fragment as st,jsx as me}from"react/jsx-runtime";var fe="k-input-validation-icon",nt=[n.valid,n.invalid,n.disabled,n.loading],at={},C=t=>{let{valid:e,invalid:a,disabled:i,loading:r}=t,d=a?"warning-circle":"check-circle";return i||r||!!!(e||a)?me(st,{}):me(h,{className:s(fe),icon:d})};C.states=nt;C.options=at;C.className=fe;import{Fragment as rt,jsx as xe}from"react/jsx-runtime";var lt="k-input-prefix",it={direction:"horizontal"},he=t=>{let{direction:e=it.direction,...a}=t;return t.children?xe("span",{...a,className:s(lt,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):xe(rt,{})};import{Fragment as pt,jsx as ge}from"react/jsx-runtime";var ct="k-input-suffix",dt={direction:"horizontal"},Ie=t=>{let{direction:e=dt.direction,...a}=t;return t.children?ge("span",{...a,className:s(ct,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):ge(pt,{})};import{jsx as No}from"react/jsx-runtime";import{jsx as To}from"react/jsx-runtime";import{jsx as mt}from"react/jsx-runtime";var ve="k-input-separator",ut={direction:"vertical"},Y=t=>{let{direction:e=ut.direction,...a}=t;return mt("span",{...a,className:s(ve,t.className,{[`${ve}-${e}`]:e})})};import{Fragment as ye,jsx as v,jsxs as Z}from"react/jsx-runtime";var be="k-textbox",ft=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],xt={size:[o.small,o.medium,o.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},y={showClearButton:!0,showValidationIcon:!0,size:g.defaultOptions.size,rounded:g.defaultOptions.rounded,fillMode:g.defaultOptions.fillMode,separators:!0},O=t=>{let{size:e=y.size,rounded:a=y.rounded,fillMode:i=y.fillMode,separators:r=y.separators,showClearButton:d=y.showClearButton,showValidationIcon:c=y.showValidationIcon,prefix:x,suffix:f,type:I,value:b,placeholder:N,hover:ke,focus:Se,valid:ee,invalid:te,required:Me,loading:L,disabled:w,readonly:oe,...Te}=t;return Z(g,{...Te,size:e,rounded:a,fillMode:i,hover:ke,focus:Se,valid:ee,invalid:te,required:Me,loading:L,disabled:w,readonly:oe,className:s(t.className,be),children:[x&&Z(ye,{children:[v(he,{children:x}),r&&v(Y,{})]}),v(z,{placeholder:N,value:b,type:I}),c&&v(C,{valid:ee,invalid:te,loading:L,disabled:w}),v(K,{loading:L,disabled:w}),d&&v(T,{loading:L,disabled:w,readonly:oe,value:b}),f&&Z(ye,{children:[r&&v(Y,{}),v(Ie,{children:f})]})]})};O.states=ft;O.options=xt;O.className=be;O.defaultOptions=y;var Ne=O;import{Fragment as ht,jsx as j}from"react/jsx-runtime";var Yo=t=>j(Ne,{prefix:j(ht,{children:j(h,{icon:"envelop"})}),...t});export{Yo as TextboxPrefix};