UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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