@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.18 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((r,a)=>e[a]||e[r]&&r||null).filter(r=>r!==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)=>{let{valid:r,invalid:a,hover:i,focus:p,checked:c,active:h,selected:m,disabled:I,indeterminate:g,loading:b,empty:U,readonly:D,highlighted:q,...S}=e;return s({"k-valid":r,"k-invalid":a,"k-hover":i,"k-focus":p,"k-checked":c,"k-active":h,"k-selected":m,"k-disabled":I,"k-indeterminate":g&&!c,"k-loading":b,"k-empty":U,"k-readonly":D,"k-highlighted":q},Object.keys(S).reduce((G,y)=>(y.startsWith("k-")?G[y]=S[y]:G[`k-${y}`]=S[y],G),{}))};var o={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},d={small:"small",medium:"medium",large:"large",full:"full"},f={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",generating:"generating",expanded:"expanded"};var k="input",P=k;import{jsx as Se}from"react/jsx-runtime";var R="k-input",ve=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],Me={size:[o.small,o.medium,o.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[f.solid,f.flat,f.outline]},_={size:o.medium,rounded:o.medium,fillMode:f.solid},N=t=>{let{hover:e,focus:r,disabled:a,invalid:i,valid:p,loading:c,readonly:h,size:m=_.size,rounded:I=_.rounded,fillMode:g=_.fillMode,...b}=t;return Se("span",{...b,className:s(t.className,R,u(R,{size:m,rounded:I,fillMode:g}),H(R,{hover:e,focus:r,disabled:a,invalid:i,valid:p,loading:c,readonly:h}))})};N.states=ve;N.options=Me;N.className=R;N.defaultOptions=_;N.moduleName=k;N.folderName=P;import{jsx as Oe}from"react/jsx-runtime";var w="k-picker",ye=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],ke={size:[o.small,o.medium,o.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[f.solid,f.flat,f.outline]},K={size:o.medium,rounded:d.medium,fillMode:f.solid},M=t=>{let{hover:e,focus:r,disabled:a,invalid:i,valid:p,loading:c,readonly:h,size:m=K.size,rounded:I=K.rounded,fillMode:g=K.fillMode,...b}=t;return Oe("span",{...b,className:s(t.className,w,u(w,{size:m,rounded:I,fillMode:g}),H(w,{hover:e,focus:r,disabled:a,invalid:i,valid:p,loading:c,readonly:h})),children:t.children})};M.states=ye;M.options=ke;M.className=w;M.defaultOptions=K;M.moduleName=k;M.folderName=P;import{Fragment as Ee,jsx as re}from"react/jsx-runtime";var X="k-font-icon",Le=[],Ce={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]},Te={},O=t=>{let{size:e,themeColor:r,icon:a,rotate:i,flip:p,...c}=t;return a?re("span",{...c,className:s(t.className,X,u(X,{size:e}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"})}):re(Ee,{})};O.states=Le;O.options=Ce;O.className=X;O.defaultOptions=Te;var le=O;import{Fragment as He,jsx as $}from"react/jsx-runtime";var W="k-svg-icon",Ae=[],ze={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]},ie={viewBox:"0 0 24 24"},L=t=>{let{size:e,themeColor:r,rotate:a,flip:i,viewBox:p=ie.viewBox,icon:c,...h}=t;if(!c)return $(He,{});c==="none"&&{...h,className:s(t.className,W,"k-none")};let m=typeof c=="object"&&c.name&&c.name;return $("span",{...h,className:s(t.className,W,u("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:$("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})})};L.states=Ae;L.options=ze;L.className=W;L.defaultOptions=ie;var J=L;import*as Q from"@progress/kendo-svg-icons";var ce="icon",pe="icons";import{Fragment as de,jsx as C}from"react/jsx-runtime";var V="k-icon",Pe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Re=[],_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]},Y={viewBox:"0 0 24 24",type:"svg"},x=t=>{let{size:e,themeColor:r,icon:a,type:i=Y.type,rotate:p,flip:c,viewBox:h=Y.viewBox,...m}=t;if(!a)return C(de,{});if(i==="svg"){if(a==="none")return C(J,{...m,className:s(t.className,V),icon:a,size:e});let I=Q[a]?a:Pe(`${a}-icon`);return Q[I]?C(J,{...m,className:s(t.className,V),icon:Q[I],size:e,themeColor:r,rotate:p,flip:c,viewBox:h}):C(de,{})}return C(le,{...m,className:s(t.className,V),icon:a,size:e,themeColor:r,rotate:p,flip:c})};x.states=Re;x.options=_e;x.defaultOptions=Y;x.className=V;x.moduleName=ce;x.folderName=pe;import{Fragment as $e,jsx as Z}from"react/jsx-runtime";var me="k-clear-value",we=[n.disabled,n.loading,n.readonly],Ke={},T=t=>{let{disabled:e,loading:r,readonly:a,value:i}=t;return e||a||r||!i?Z($e,{}):Z("span",{className:s(t.className,me),children:Z(x,{icon:"x"})})};T.states=we;T.options=Ke;T.className=me;import{jsx as Fe}from"react/jsx-runtime";var j="k-input-inner",Ve=[],Be={},B={type:"text",autocomplete:"off",value:"",placeholder:""},E=t=>{let{value:e=B.value,type:r=B.type,placeholder:a=B.placeholder,autocomplete:i=B.autocomplete,...p}=t;return Fe("input",{...p,type:r,className:s(t.className,j,u(j,t)),placeholder:a,autoComplete:i,defaultValue:e})};E.states=Ve;E.options=Be;E.className=j;import{jsx as ue,jsxs as qe}from"react/jsx-runtime";var ee="k-input-inner",Ue=[],De={},te=t=>{let{value:e,placeholder:r,showValue:a,valueIcon:i,valueIconName:p,...c}=t;return qe("span",{...c,className:s(t.className,ee,u(ee,t)),children:[i,!i&&p&&ue(x,{className:"k-input-value-icon",icon:p}),a&&!e&&r,a&&e&&ue("span",{className:"k-input-value-text",children:e})]})};te.states=Ue;te.options=De;te.className=ee;import{jsx as We}from"react/jsx-runtime";var oe="k-input-inner",Ge=[],Xe={},fe={value:"",placeholder:""},ne=t=>{let{value:e=fe.value,placeholder:r=fe.placeholder,rows:a,...i}=t;return We("textarea",{...i,className:s(t.className,oe,u(oe,t)),placeholder:r,rows:a,defaultValue:e})};ne.states=Ge;ne.options=Xe;ne.className=oe;import{Fragment as Qe,jsx as xe}from"react/jsx-runtime";var he="k-input-loading-icon",Je=[n.disabled,n.loading],F=t=>{let{disabled:e,loading:r}=t;return e||!r?xe(Qe,{}):xe("span",{className:s(t.className,he,"k-icon k-i-loading")})};F.states=Je;F.className=he;import{Fragment as je,jsx as Ne}from"react/jsx-runtime";var Ie="k-input-validation-icon",Ye=[n.valid,n.invalid,n.disabled,n.loading],Ze={},A=t=>{let{valid:e,invalid:r,disabled:a,loading:i}=t,p=r?"warning-circle":"check-circle";return a||i||!!!(e||r)?Ne(je,{}):Ne(x,{className:s(Ie),icon:p})};A.states=Ye;A.options=Ze;A.className=Ie;import{Fragment as ro,jsx as lo}from"react/jsx-runtime";import{Fragment as mo,jsx as uo}from"react/jsx-runtime";import{jsx as No}from"react/jsx-runtime";import{jsx as vo}from"react/jsx-runtime";import{jsx as ko}from"react/jsx-runtime";var se="searchbox",ge=se;import{jsx as z,jsxs as ot}from"react/jsx-runtime";var be="k-searchbox",et=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading],tt={size:[o.small,o.medium,o.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[f.solid,f.flat,f.outline]},ae={showIcon:!0,icon:"search",size:N.defaultOptions.size,rounded:N.defaultOptions.rounded,fillMode:N.defaultOptions.fillMode},v=t=>{let{value:e,placeholder:r,size:a,rounded:i,fillMode:p,hover:c,focus:h,valid:m,invalid:I,required:g,loading:b,disabled:U,showIcon:D=ae.showIcon,icon:q=ae.icon,...S}=t;return ot(N,{...S,size:a,rounded:i,fillMode:p,hover:c,focus:h,valid:m,invalid:I,required:g,loading:b,disabled:U,className:s(t.className,be),children:[D&&z(x,{className:"k-input-icon",icon:q}),z(E,{placeholder:r,value:e}),z(F,{...t}),z(A,{...t}),z(T,{...t})]})};v.states=et;v.options=tt;v.className=be;v.defaultOptions=ae;v.moduleName=se;v.folderName=ge;var Go=v;export{be as SEARCHBOX_CLASSNAME,v as Searchbox,Go as default};