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