UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.68 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"}),H=(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]},A={size:o.medium,rounded:o.medium,fillMode:m.solid},h=t=>{let{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x,size:f=A.size,rounded:I=A.rounded,fillMode:b=A.fillMode,...N}=t;return ze("span",{...N,className:s(t.className,P,u(P,{size:f,rounded:I,fillMode:b}),H(P,{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x}))})};h.states=Me;h.options=Te;h.className=P;h.defaultOptions=A;import{jsx as Le}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],Oe={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},V=t=>{let{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x,size:f=R.size,rounded:I=R.rounded,fillMode:b=R.fillMode,...N}=t;return Le("span",{...N,className:s(t.className,E,u(E,{size:f,rounded:I,fillMode:b}),H(E,{hover:e,focus:a,disabled:i,invalid:r,valid:d,loading:c,readonly:x})),children:t.children})};V.states=Ce;V.options=Oe;V.className=E;V.defaultOptions=R;import{Fragment as Ae,jsx as oe}from"react/jsx-runtime";var F="k-icon k-font-icon",we=[],He={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:d,...c}=t;return i?oe("span",{...c,className:s(t.className,F,u(F,{size:e}),{[`k-i-${i}`]:i,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):oe(Ae,{})};k.states=we;k.options=He;k.className=F;k.defaultOptions=Pe;var ne=k;import{Fragment as Ve,jsx as $}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]},ae={viewBox:"0 0 24 24"},S=t=>{let{size:e,themeColor:a,rotate:i,flip:r,viewBox:d=ae.viewBox,icon:c,...x}=t;if(!c)return $(Ve,{});c==="none"&&{...x,className:s(t.className,_,"k-none")};let f=typeof c=="object"&&c.name&&c.name;return $("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:$("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:d,dangerouslySetInnerHTML:typeof c=="object"?{__html:c.content}:void 0,children:c?void 0:t.children})})};S.states=Ee;S.options=Re;S.className=_;S.defaultOptions=ae;var q=S;import*as se from"@progress/kendo-svg-icons";import{Fragment as le,jsx as M}from"react/jsx-runtime";var $e=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"},g=t=>{let{size:e,themeColor:a,icon:i,type:r=G.type,rotate:d,flip:c,viewBox:x=G.viewBox,...f}=t;if(!i)return M(le,{});if(r==="svg"){if(i==="none")return M(q,{...f,icon:i,size:e});let I=$e(`${i}-icon`);return se[I]?M(q,{...f,icon:se[I],size:e,themeColor:a,rotate:d,flip:c,viewBox:x}):M(le,{})}return M(ne,{...f,icon:i,size:e,themeColor:a,rotate:d,flip:c})};g.states=Be;g.options=Ke;g.defaultOptions=G;import{Fragment as qe,jsx as X}from"react/jsx-runtime";var ie="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,ie),children:X(g,{icon:"x"})})};T.states=Fe;T.options=_e;T.className=ie;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,...d}=t;return Ue("input",{...d,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 re,jsxs as Qe}from"react/jsx-runtime";var J="k-input-inner",Je=[],De={},D=t=>{let{value:e,placeholder:a,showValue:i,valueIcon:r,valueIconName:d,...c}=t;return Qe("span",{...c,className:s(t.className,J,u(J,t)),children:[r,!r&&d&&re(g,{className:"k-input-value-icon",icon:d}),i&&!e&&a,i&&e&&re("span",{className:"k-input-value-text",children:e})]})};D.states=Je;D.options=De;D.className=J;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 de}from"react/jsx-runtime";var pe="k-input-loading-icon",je=[n.disabled,n.loading],K=t=>{let{disabled:e,loading:a}=t;return e||!a?de(et,{}):de("span",{className:s(t.className,pe,"k-icon k-i-loading")})};K.states=je;K.className=pe;import{Fragment as nt,jsx as ue}from"react/jsx-runtime";var me="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,d=a?"warning-circle":"check-circle";return i||r||!!!(e||a)?ue(nt,{}):ue(g,{className:s(me),icon:d})};C.states=tt;C.options=ot;C.className=me;import{Fragment as lt,jsx as fe}from"react/jsx-runtime";var at="k-input-prefix",st={direction:"horizontal"},xe=t=>{let{direction:e=st.direction,...a}=t;return t.children?fe("span",{...a,className:s(at,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):fe(lt,{})};import{Fragment as ct,jsx as he}from"react/jsx-runtime";var it="k-input-suffix",rt={direction:"horizontal"},ge=t=>{let{direction:e=rt.direction,...a}=t;return t.children?he("span",{...a,className:s(it,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):he(ct,{})};import{jsx as vo}from"react/jsx-runtime";import{jsx as ko}from"react/jsx-runtime";import{jsx as pt}from"react/jsx-runtime";var Ie="k-input-separator",dt={direction:"vertical"},Y=t=>{let{direction:e=dt.direction,...a}=t;return pt("span",{...a,className:s(Ie,t.className,{[`${Ie}-${e}`]:e})})};import{Fragment as ve,jsx as v,jsxs as Z}from"react/jsx-runtime";var ye="k-textbox",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,showValidationIcon:!0,size:h.defaultOptions.size,rounded:h.defaultOptions.rounded,fillMode:h.defaultOptions.fillMode,separators:!0},O=t=>{let{size:e=y.size,rounded:a=y.rounded,fillMode:i=y.fillMode,separators:r=y.separators,showClearButton:d=y.showClearButton,showValidationIcon:c=y.showValidationIcon,prefix:x,suffix:f,type:I,value:b,placeholder:N,hover:be,focus:Ne,valid:j,invalid:ee,required:ke,loading:L,disabled:w,readonly:te,...Se}=t;return Z(h,{...Se,size:e,rounded:a,fillMode:i,hover:be,focus:Ne,valid:j,invalid:ee,required:ke,loading:L,disabled:w,readonly:te,className:s(t.className,ye),children:[x&&Z(ve,{children:[v(xe,{children:x}),r&&v(Y,{})]}),v(z,{placeholder:N,value:b,type:I}),c&&v(C,{valid:j,invalid:ee,loading:L,disabled:w}),v(K,{loading:L,disabled:w}),d&&v(T,{loading:L,disabled:w,readonly:te,value:b}),f&&Z(ve,{children:[r&&v(Y,{}),v(ge,{children:f})]})]})};O.states=ut;O.options=mt;O.className=ye;O.defaultOptions=y;var Go=O;export{ye as TEXTBOX_CLASSNAME,O as Textbox,Go as default};