UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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