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