UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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