UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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