UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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