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