UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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