@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.91 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((n,i)=>e[i]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(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});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"},r={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"};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:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},C={size:o.medium,rounded:o.medium,fillMode:m.solid},v=t=>{let{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f,size:x=C.size,rounded:h=C.rounded,fillMode:y=C.fillMode,...N}=t;return Te("span",{...N,className:a(t.className,L,u(L,{size:x,rounded:h,fillMode:y}),O(L,{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f}))})};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:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},A={size:o.medium,rounded:p.medium,fillMode:m.solid},H=t=>{let{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f,size:x=A.size,rounded:h=A.rounded,fillMode:y=A.fillMode,...N}=t;return Ce("span",{...N,className:a(t.className,w,u(w,{size:x,rounded:h,fillMode:y}),O(w,{hover:e,focus:n,disabled:i,invalid:c,valid:d,loading:l,readonly:f})),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:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},He={},k=t=>{let{size:e,themeColor:n,icon:i,rotate:c,flip:d,...l}=t;return i?W("span",{...l,className:a(t.className,R,u(R,{size:e}),{[`k-i-${i}`]:i,[`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:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},Z={viewBox:"0 0 24 24"},b=t=>{let{size:e,themeColor:n,rotate:i,flip:c,viewBox:d=Z.viewBox,icon:l,...f}=t;if(!l)return P($e,{});l==="none"&&{...f,className:a(t.className,$,"k-none")};let x=typeof l=="object"&&l.name&&l.name;return P("span",{...f,className:a(t.className,$,u("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${n}`]:n,[`k-rotate-${i}`]:i,"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:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},K={viewBox:"0 0 24 24",type:"svg"},I=t=>{let{size:e,themeColor:n,icon:i,type:c=K.type,rotate:d,flip:l,viewBox:f=K.viewBox,...x}=t;if(!i)return S(ee,{});if(c==="svg"){if(i==="none")return S(V,{...x,icon:i,size:e});let h=Ve(`${i}-icon`);return j[h]?S(V,{...x,icon:j[h],size:e,themeColor:n,rotate:d,flip:l,viewBox:f}):S(ee,{})}return S(Y,{...x,icon:i,size:e,themeColor:n,rotate:d,flip:l})};I.states=Ke;I.options=Be;I.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:i,value:c}=t;return e||i||n||!c?B(qe,{}):B("span",{className:a(t.className,te),children:B(I,{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:i=E.placeholder,autocomplete:c=E.autocomplete,...d}=t;return Xe("input",{...d,type:n,className:a(t.className,_,u(_,t)),placeholder:i,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:i,valueIcon:c,valueIconName:d,...l}=t;return Qe("span",{...l,className:a(t.className,G,u(G,t)),children:[c,!c&&d&&oe(I,{className:"k-input-value-icon",icon:d}),i&&!e&&n,i&&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:i,...c}=t;return Ze("textarea",{...c,className:a(t.className,X,u(X,t)),placeholder:n,rows:i,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],re=t=>{let{disabled:e,loading:n}=t;return e||!n?ae(et,{}):ae("span",{className:a(t.className,se,"k-icon k-i-loading")})};re.states=je;re.className=se;import{Fragment as nt,jsx as ie}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:i,loading:c}=t,d=n?"warning-circle":"check-circle";return i||c||!!!(e||n)?ie(nt,{}):ie(I,{className:a(le),icon:d})};J.states=tt;J.options=ot;J.className=le;import{Fragment as rt,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(rt,{})};import{Fragment as ct,jsx as pe}from"react/jsx-runtime";var it="k-input-suffix",lt={direction:"horizontal"},ue=t=>{let{direction:e=lt.direction,...n}=t;return t.children?pe("span",{...n,className:a(it,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):pe(ct,{})};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 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:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},g={size:v.defaultOptions.size,rounded:v.defaultOptions.rounded,fillMode:v.defaultOptions.fillMode,flow:"vertical",affixesOrientation:"horizontal",resize:"both",separators:!0},T=t=>{let{size:e=g.size,rounded:n=g.rounded,fillMode:i=g.fillMode,separators:c=g.separators,affixesOrientation:d=g.affixesOrientation,flow:l=g.flow,resize:f=g.resize,prefix:x,suffix:h,rows:y,value:N,placeholder:ve,hover:Ie,focus:ge,valid:ye,invalid:Ne,required:ke,disabled:be,...Se}=t;return Q(v,{...Se,size:e,rounded:n,fillMode:i,hover:Ie,focus:ge,valid:ye,invalid:Ne,required:ke,disabled:be,className:a(t.className,xe,{"!k-flex-col":l==="vertical","!k-flex-row":l==="horizontal"}),children:[x&&Q(fe,{children:[z(de,{className:a({"!k-align-items-start":l===d}),direction:d,children:x}),c&&z(D,{direction:l==="horizontal"?"vertical":"horizontal"})]}),z(M,{className:a("!k-overflow-auto",{"!k-flex-none":l==="vertical","k-resize-x":f==="x","k-resize-y":f==="y","k-resize":f==="both","k-resize-none":f==="none"}),value:N,placeholder:ve,rows:y}),h&&Q(fe,{children:[c&&z(D,{direction:l==="horizontal"?"vertical":"horizontal"}),z(ue,{className:a({"!k-align-items-start":l===d}),direction:d,children:h})]})]})};T.states=ut;T.options=mt;T.className=xe;T.defaultOptions=g;var he=T;import{jsx as ft}from"react/jsx-runtime";var Do=t=>ft(he,{...t});export{Do as TextareaNormal};