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