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 qe}from"react/jsx-runtime";var q="k-input",Ve=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],Xe={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 qe("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=Ve;b.options=Xe;b.className=q;b.defaultOptions=G;b.moduleName=P;b.folderName=X;import{jsx as We}from"react/jsx-runtime";var J="k-picker",Ge=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],Je={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 We("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=Ge;B.options=Je;B.className=J;B.defaultOptions=W;B.moduleName=P;B.folderName=X;import{Fragment as je,jsx as Ne}from"react/jsx-runtime";var ee="k-font-icon",Qe=[],Ye={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]},Ze={},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(je,{})};R.states=Qe;R.options=Ye;R.className=ee;R.defaultOptions=Ze;var he=R;import{Fragment as ot,jsx as Q}from"react/jsx-runtime";var te="k-svg-icon",et=[],tt={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(ot,{});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=et;w.options=tt;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",nt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),st=[],at={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:nt(`${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=st;N.options=at;N.defaultOptions=se;N.className=Y;N.moduleName=Ie;N.folderName=be;import{Fragment as it,jsx as ae}from"react/jsx-runtime";var Te="k-clear-value",rt=[a.disabled,a.loading,a.readonly],lt={},K=t=>{let{disabled:e,loading:n,readonly:l,value:i}=t;return e||l||n||!i?ae(it,{}):ae("span",{className:r(t.className,Te),children:ae(N,{icon:"x"})})};K.states=rt;K.options=lt;K.className=Te;import{jsx as dt}from"react/jsx-runtime";var re="k-input-inner",pt=[],ct={},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 dt("input",{...d,type:n,className:r(t.className,re,f(re,t)),placeholder:l,autoComplete:i,defaultValue:e})};U.states=pt;U.options=ct;U.className=re;import{jsx as Se,jsxs as ft}from"react/jsx-runtime";var le="k-input-inner",ut=[],mt={},ie=t=>{let{value:e,placeholder:n,showValue:l,valueIcon:i,valueIconName:d,...p}=t;return ft("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=ut;ie.options=mt;ie.className=le;import{jsx as ht}from"react/jsx-runtime";var pe="k-input-inner",xt=[],Nt={},ve={value:"",placeholder:""},ce=t=>{let{value:e=ve.value,placeholder:n=ve.placeholder,rows:l,...i}=t;return ht("textarea",{...i,className:r(t.className,pe,f(pe,t)),placeholder:n,rows:l,defaultValue:e})};ce.states=xt;ce.options=Nt;ce.className=pe;import{Fragment as It,jsx as ye}from"react/jsx-runtime";var Oe="k-input-loading-icon",Mt=[a.disabled,a.loading],j=t=>{let{disabled:e,loading:n}=t;return e||!n?ye(It,{}):ye("span",{className:r(t.className,Oe,"k-icon k-i-loading")})};j.states=Mt;j.className=Oe;import{Fragment as Tt,jsx as ke}from"react/jsx-runtime";var Ee="k-input-validation-icon",bt=[a.valid,a.invalid,a.disabled,a.loading],gt={},$=t=>{let{valid:e,invalid:n,disabled:l,loading:i}=t,d=n?"warning-circle":"check-circle";return l||i||!!!(e||n)?ke(Tt,{}):ke(N,{className:r(Ee),icon:d})};$.states=bt;$.options=gt;$.className=Ee;import{Fragment as yt,jsx as Ce}from"react/jsx-runtime";var St="k-input-prefix",vt={direction:"horizontal"},Le=t=>{let{direction:e=vt.direction,...n}=t;return t.children?Ce("span",{...n,className:r(St,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):Ce(yt,{})};import{Fragment as Et,jsx as Ae}from"react/jsx-runtime";var Ot="k-input-suffix",kt={direction:"horizontal"},ze=t=>{let{direction:e=kt.direction,...n}=t;return t.children?Ae("span",{...n,className:r(Ot,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):Ae(Et,{})};import{jsx as jo}from"react/jsx-runtime";import{jsx as nn}from"react/jsx-runtime";import{jsx as Lt}from"react/jsx-runtime";var Be="k-input-separator",Ct={direction:"vertical"},de=t=>{let{direction:e=Ct.direction,...n}=t;return Lt("span",{...n,className:r(Be,t.className,{[`${Be}-${e}`]:e})})};var ue="button",_e=ue;import{Fragment as _t,jsx as D,jsxs as Pe}from"react/jsx-runtime";var F="k-button",At=["icon-button"],zt=[a.hover,a.focus,a.active,a.selected,a.disabled,a.generating],Bt={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(_t,{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=zt;M.options=Bt;M.variants=At;M.className=F;M.defaultOptions=C;M.moduleName=ue;M.folderName=_e;import{jsx as An}from"react/jsx-runtime";import{jsx as Pn}from"react/jsx-runtime";import{jsx as Kn}from"react/jsx-runtime";import{jsx as Re,jsxs as Kt}from"react/jsx-runtime";var we="k-spin-button",wt=[],Ht={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 Kt("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=wt;k.options=Ht;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",Ut=[a.hover,a.focus,a.valid,a.invalid,a.loading,a.required,a.disabled,a.readonly],$t={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,...Fe}=t;return fe(b,{...Fe,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=Ut;A.options=$t;A.className=$e;A.defaultOptions=L;A.moduleName=He;A.folderName=Ke;var De=A;import{jsx as Dt}from"react/jsx-runtime";var is=t=>Dt(De,{...t});export{is as NumericTextboxNormal};