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 Oe}from"react/jsx-runtime";var L="k-input",ze=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Te={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:p,loading:l,readonly:d,size:m=C.size,rounded:h=C.rounded,fillMode:y=C.fillMode,...N}=t;return Oe("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:p,loading:l,readonly:d}))})};v.states=ze;v.options=Te;v.className=L;v.defaultOptions=C;import{jsx as we}from"react/jsx-runtime";var w="k-picker",Le=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Ce={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:p,loading:l,readonly:d,size:m=A.size,rounded:h=A.rounded,fillMode:y=A.fillMode,...N}=t;return we("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:p,loading:l,readonly:d})),children:t.children})};H.states=Le;H.options=Ce;H.className=w;H.defaultOptions=A;import{Fragment as Ee,jsx as W}from"react/jsx-runtime";var R="k-icon k-font-icon",Ae=[],He={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]},Pe={},k=t=>{let{size:e,themeColor:n,icon:r,rotate:c,flip:p,...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":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"})}):W(Ee,{})};k.states=Ae;k.options=He;k.className=R;k.defaultOptions=Pe;var Y=k;import{Fragment as Ve,jsx as P}from"react/jsx-runtime";var $="k-icon k-svg-icon",Re=[],$e={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:p=Z.viewBox,icon:l,...d}=t;if(!l)return P(Ve,{});l==="none"&&{...d,className:a(t.className,$,"k-none")};let m=typeof l=="object"&&l.name&&l.name;return P("span",{...d,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:p,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};b.states=Re;b.options=$e;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 Ke=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Be=[],Fe={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:p,flip:l,viewBox:d=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=Ke(`${r}-icon`);return j[h]?S(V,{...m,icon:j[h],size:e,themeColor:n,rotate:p,flip:l,viewBox:d}):S(ee,{})}return S(Y,{...m,icon:r,size:e,themeColor:n,rotate:p,flip:l})};g.states=Be;g.options=Fe;g.defaultOptions=K;import{Fragment as Ge,jsx as B}from"react/jsx-runtime";var te="k-clear-value",_e=[s.disabled,s.loading,s.readonly],qe={},F=t=>{let{disabled:e,loading:n,readonly:r,value:c}=t;return e||r||n||!c?B(Ge,{}):B("span",{className:a(t.className,te),children:B(g,{icon:"x"})})};F.states=_e;F.options=qe;F.className=te;import{jsx as Je}from"react/jsx-runtime";var _="k-input-inner",Ue=[],Xe={},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,...p}=t;return Je("input",{...p,type:n,className:a(t.className,_,f(_,t)),placeholder:r,autoComplete:c,defaultValue:e})};q.states=Ue;q.options=Xe;q.className=_;import{jsx as oe,jsxs as We}from"react/jsx-runtime";var G="k-input-inner",De=[],Qe={},U=t=>{let{value:e,placeholder:n,showValue:r,valueIcon:c,valueIconName:p,...l}=t;return We("span",{...l,className:a(t.className,G,f(G,t)),children:[c,!c&&p&&oe(g,{className:"k-input-value-icon",icon:p}),r&&!e&&n,r&&e&&oe("span",{className:"k-input-value-text",children:e})]})};U.states=De;U.options=Qe;U.className=G;import{jsx as je}from"react/jsx-runtime";var X="k-input-inner",Ye=[],Ze={},ne={value:"",placeholder:""},M=t=>{let{value:e=ne.value,placeholder:n=ne.placeholder,rows:r,...c}=t;return je("textarea",{...c,className:a(t.className,X,f(X,t)),placeholder:n,rows:r,defaultValue:e})};M.states=Ye;M.options=Ze;M.className=X;import{Fragment as tt,jsx as ae}from"react/jsx-runtime";var se="k-input-loading-icon",et=[s.disabled,s.loading],ie=t=>{let{disabled:e,loading:n}=t;return e||!n?ae(tt,{}):ae("span",{className:a(t.className,se,"k-icon k-i-loading")})};ie.states=et;ie.className=se;import{Fragment as at,jsx as re}from"react/jsx-runtime";var le="k-input-validation-icon",ot=[s.valid,s.invalid,s.disabled,s.loading],nt={},J=t=>{let{valid:e,invalid:n,disabled:r,loading:c}=t,p=n?"warning-circle":"check-circle";return r||c||!!!(e||n)?re(at,{}):re(g,{className:a(le),icon:p})};J.states=ot;J.options=nt;J.className=le;import{Fragment as rt,jsx as ce}from"react/jsx-runtime";var st="k-input-prefix",it={direction:"horizontal"},pe=t=>{let{direction:e=it.direction,...n}=t;return t.children?ce("span",{...n,className:a(st,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):ce(rt,{})};import{Fragment as pt,jsx as de}from"react/jsx-runtime";var lt="k-input-suffix",ct={direction:"horizontal"},ue=t=>{let{direction:e=ct.direction,...n}=t;return t.children?de("span",{...n,className:a(lt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):de(pt,{})};import{jsx as No}from"react/jsx-runtime";import{jsx as Mo}from"react/jsx-runtime";import{jsx as ut}from"react/jsx-runtime";var me="k-input-separator",dt={direction:"vertical"},D=t=>{let{direction:e=dt.direction,...n}=t;return ut("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",mt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled],ft={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:p=I.prefixSeparator,affixesOrientation:l=I.affixesOrientation,flow:d=I.flow,resize:m=I.resize,prefix:h,suffix:y,rows:N,value:ve,placeholder:ge,hover:Ie,focus:ye,valid:Ne,invalid:ke,required:be,disabled:Se,...Me}=t;return Q(v,{...Me,size:e,rounded:n,fillMode:r,hover:Ie,focus:ye,valid:Ne,invalid:ke,required:be,disabled:Se,className:a(t.className,xe,{"!k-flex-col":d==="vertical","!k-flex-row":d==="horizontal"}),children:[h&&Q(fe,{children:[z(pe,{className:a({"!k-align-items-start":d===l}),direction:l,children:h}),c&&z(D,{direction:d==="horizontal"?"vertical":"horizontal"})]}),z(M,{className:a("!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:ve,placeholder:ge,rows:N}),y&&Q(fe,{children:[p&&z(D,{direction:d==="horizontal"?"vertical":"horizontal"}),z(ue,{className:a({"!k-align-items-start":d===l}),direction:l,children:y})]})]})};T.states=mt;T.options=ft;T.className=xe;T.defaultOptions=I;var he=T;import{jsx as xt}from"react/jsx-runtime";var Qo=t=>xt(he,{...t});export{Qo as TextareaNormal};