@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 16.6 kB
JavaScript
var a=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?a(...t):typeof t=="object"?Object.keys(t).map((o,n)=>t[n]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var b=(e,t)=>a({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.fillMode}-${t.themeColor}`]:t.fillMode&&t.themeColor},{[`${e}-${t.themeColor}`]:t.themeColor&&t.fillMode===void 0},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full"}),F=(e,t)=>{let{valid:o,invalid:n,hover:l,focus:c,checked:d,active:f,selected:m,disabled:x,indeterminate:h,loading:v,empty:_,readonly:E,highlighted:A,...I}=t;return a({"k-valid":o,"k-invalid":n,"k-hover":l,"k-focus":c,"k-checked":d,"k-active":f,"k-selected":m,"k-disabled":x,"k-indeterminate":h&&!d,"k-loading":v,"k-empty":_,"k-readonly":E,"k-highlighted":A},Object.keys(I).reduce((R,M)=>(M.startsWith("k-")?R[M]=I[M]:R[`k-${M}`]=I[M],R),{}))};function Ke(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(n=>[`k-${n}`,!0]))}var i={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"},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",highlighted:"highlighted",generating:"generating",expanded:"expanded"};var de="popup",Pe=de;import{jsx as Be}from"react/jsx-runtime";var we="k-animation-container",St=[],vt={},De={positionMode:"absolute"},g=e=>{let{positionMode:t=De.positionMode,animationStyle:o,offset:n,...l}=e;return Be("div",{...l,style:{...n,...e.style},className:a(e.className,we,"k-animation-container-shown",{"k-animation-container-fixed":t==="fixed"}),children:Be("div",{className:"k-child-animation-container",style:o,children:e.children})})};g.states=St;g.options=vt;g.className=we;g.defaultOptions=De;g.moduleName=de;g.folderName=Pe;var pe="action-buttons",Fe=pe;import{jsx as It}from"react/jsx-runtime";var ee="k-actions",Mt=[],At={},me={alignment:"start",orientation:"horizontal"},O=e=>{let{alignment:t=me.alignment,orientation:o=me.orientation,...n}=e;return It("div",{...n,className:a(ee,{[`${ee}-${t}`]:t,[`${ee}-${o}`]:o},e.className),children:e.children})};O.states=Mt;O.options=At;O.className=ee;O.defaultOptions=me;O.moduleName=pe;O.folderName=Fe;import{jsx as Et}from"react/jsx-runtime";var Tt="k-actionsheet-footer",Ue={alignment:"stretched",orientation:"horizontal"},ue=e=>{let{alignment:t=Ue.alignment,orientation:o=Ue.orientation,template:n,as:l=n?"div":O,...c}=e;return Et(l,{...c,...!n&&{alignment:t,orientation:o},className:a(e.className,Tt),children:e.children})};var X="input",te=X;import{jsx as yt}from"react/jsx-runtime";var oe="k-input",gt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Ot={size:[i.small,i.medium,i.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},ne={size:i.medium,rounded:i.medium,fillMode:u.solid},S=e=>{let{hover:t,focus:o,disabled:n,invalid:l,valid:c,loading:d,readonly:f,size:m=ne.size,rounded:x=ne.rounded,fillMode:h=ne.fillMode,...v}=e;return yt("span",{...v,className:a(e.className,oe,b(oe,{size:m,rounded:x,fillMode:h}),F(oe,{hover:t,focus:o,disabled:n,invalid:l,valid:c,loading:d,readonly:f}))})};S.states=gt;S.options=Ot;S.className=oe;S.defaultOptions=ne;S.moduleName=X;S.folderName=te;import{jsx as kt}from"react/jsx-runtime";var ae="k-picker",Ct=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Lt={size:[i.small,i.medium,i.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},se={size:i.medium,rounded:p.medium,fillMode:u.solid},U=e=>{let{hover:t,focus:o,disabled:n,invalid:l,valid:c,loading:d,readonly:f,size:m=se.size,rounded:x=se.rounded,fillMode:h=se.fillMode,...v}=e;return kt("span",{...v,className:a(e.className,ae,b(ae,{size:m,rounded:x,fillMode:h}),F(ae,{hover:t,focus:o,disabled:n,invalid:l,valid:c,loading:d,readonly:f})),children:e.children})};U.states=Ct;U.options=Lt;U.className=ae;U.defaultOptions=se;U.moduleName=X;U.folderName=te;import{Fragment as zt,jsx as Ve}from"react/jsx-runtime";var fe="k-font-icon",_t=[],Rt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},Ht={},J=e=>{let{size:t,themeColor:o,icon:n,rotate:l,flip:c,...d}=e;return n?Ve("span",{...d,className:a(e.className,fe,b(fe,{size:t}),{[`k-i-${n}`]:n,[`k-color-${o}`]:o,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):Ve(zt,{})};J.states=_t;J.options=Rt;J.className=fe;J.defaultOptions=Ht;var $e=J;import{Fragment as Bt,jsx as ie}from"react/jsx-runtime";var xe="k-svg-icon",Kt=[],Pt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},Xe={viewBox:"0 0 24 24"},q=e=>{let{size:t,themeColor:o,rotate:n,flip:l,viewBox:c=Xe.viewBox,icon:d,...f}=e;if(!d)return ie(Bt,{});d==="none"&&{...f,className:a(e.className,xe,"k-none")};let m=typeof d=="object"&&d.name&&d.name;return ie("span",{...f,className:a(e.className,xe,b("k-icon",{size:t}),{[`k-svg-i-${m}`]:m,[`k-color-${o}`]:o,[`k-rotate-${n}`]:n,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:ie("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof d=="object"?d.viewBox:c,dangerouslySetInnerHTML:typeof d=="object"?{__html:d.content}:void 0,children:d?void 0:e.children})})};q.states=Kt;q.options=Pt;q.className=xe;q.defaultOptions=Xe;var Ne=q;import*as he from"@progress/kendo-svg-icons";var Je="icon",qe="icons";import{Fragment as Ge,jsx as G}from"react/jsx-runtime";var re="k-icon",wt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Dt=[],Ft={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},be={viewBox:"0 0 24 24",type:"svg"},N=e=>{let{size:t,themeColor:o,icon:n,type:l=be.type,rotate:c,flip:d,viewBox:f=be.viewBox,...m}=e;if(!n)return G(Ge,{});if(l==="svg"){if(n==="none")return G(Ne,{...m,className:a(e.className,re),icon:n,size:t});let x=he[n]?n:wt(`${n}-icon`);return he[x]?G(Ne,{...m,className:a(e.className,re),icon:he[x],size:t,themeColor:o,rotate:c,flip:d,viewBox:f}):G(Ge,{})}return G($e,{...m,className:a(e.className,re),icon:n,size:t,themeColor:o,rotate:c,flip:d})};N.states=Dt;N.options=Ft;N.defaultOptions=be;N.className=re;N.moduleName=Je;N.folderName=qe;import{Fragment as $t,jsx as Se}from"react/jsx-runtime";var We="k-clear-value",Ut=[s.disabled,s.loading,s.readonly],Vt={},H=e=>{let{disabled:t,loading:o,readonly:n,value:l}=e;return t||n||o||!l?Se($t,{}):Se("span",{className:a(e.className,We),children:Se(N,{icon:"x"})})};H.states=Ut;H.options=Vt;H.className=We;import{jsx as qt}from"react/jsx-runtime";var ve="k-input-inner",Xt=[],Jt={},le={type:"text",autocomplete:"off",value:"",placeholder:""},z=e=>{let{value:t=le.value,type:o=le.type,placeholder:n=le.placeholder,autocomplete:l=le.autocomplete,...c}=e;return qt("input",{...c,type:o,className:a(e.className,ve,b(ve,e)),placeholder:n,autoComplete:l,defaultValue:t})};z.states=Xt;z.options=Jt;z.className=ve;import{jsx as Qe,jsxs as Qt}from"react/jsx-runtime";var Me="k-input-inner",Gt=[],Wt={},Ae=e=>{let{value:t,placeholder:o,showValue:n,valueIcon:l,valueIconName:c,...d}=e;return Qt("span",{...d,className:a(e.className,Me,b(Me,e)),children:[l,!l&&c&&Qe(N,{className:"k-input-value-icon",icon:c}),n&&!t&&o,n&&t&&Qe("span",{className:"k-input-value-text",children:t})]})};Ae.states=Gt;Ae.options=Wt;Ae.className=Me;import{jsx as jt}from"react/jsx-runtime";var Ie="k-input-inner",Yt=[],Zt={},Ye={value:"",placeholder:""},Te=e=>{let{value:t=Ye.value,placeholder:o=Ye.placeholder,rows:n,...l}=e;return jt("textarea",{...l,className:a(e.className,Ie,b(Ie,e)),placeholder:o,rows:n,defaultValue:t})};Te.states=Yt;Te.options=Zt;Te.className=Ie;import{Fragment as to,jsx as Ze}from"react/jsx-runtime";var je="k-input-loading-icon",eo=[s.disabled,s.loading],V=e=>{let{disabled:t,loading:o}=e;return t||!o?Ze(to,{}):Ze("span",{className:a(e.className,je,"k-icon k-i-loading")})};V.states=eo;V.className=je;import{Fragment as ao,jsx as et}from"react/jsx-runtime";var tt="k-input-validation-icon",oo=[s.valid,s.invalid,s.disabled,s.loading],no={},K=e=>{let{valid:t,invalid:o,disabled:n,loading:l}=e,c=o?"warning-circle":"check-circle";return n||l||!!!(t||o)?et(ao,{}):et(N,{className:a(tt),icon:c})};K.states=oo;K.options=no;K.className=tt;import{Fragment as ro,jsx as ot}from"react/jsx-runtime";var so="k-input-prefix",io={direction:"horizontal"},nt=e=>{let{direction:t=io.direction,...o}=e;return e.children?ot("span",{...o,className:a(so,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):ot(ro,{})};import{Fragment as po,jsx as at}from"react/jsx-runtime";var lo="k-input-suffix",co={direction:"horizontal"},st=e=>{let{direction:t=co.direction,...o}=e;return e.children?at("span",{...o,className:a(lo,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):at(po,{})};import{jsx as sa}from"react/jsx-runtime";import{jsx as ca}from"react/jsx-runtime";import{jsx as uo}from"react/jsx-runtime";var it="k-input-separator",mo={direction:"vertical"},Ee=e=>{let{direction:t=mo.direction,...o}=e;return uo("span",{...o,className:a(it,e.className,{[`${it}-${t}`]:t})})};var ge="searchbox",rt=ge;import{jsx as W,jsxs as No}from"react/jsx-runtime";var lt="k-searchbox",fo=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading],xo={size:[i.small,i.medium,i.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},Oe={showIcon:!0,icon:"search",size:S.defaultOptions.size,rounded:S.defaultOptions.rounded,fillMode:S.defaultOptions.fillMode},y=e=>{let{value:t,placeholder:o,size:n,rounded:l,fillMode:c,hover:d,focus:f,valid:m,invalid:x,required:h,loading:v,disabled:_,showIcon:E=Oe.showIcon,icon:A=Oe.icon,...I}=e;return No(S,{...I,size:n,rounded:l,fillMode:c,hover:d,focus:f,valid:m,invalid:x,required:h,loading:v,disabled:_,className:a(e.className,lt),children:[E&&W(N,{className:"k-input-icon",icon:A}),W(z,{placeholder:o,value:t}),W(V,{...e}),W(K,{...e}),W(H,{...e})]})};y.states=fo;y.options=xo;y.className=lt;y.defaultOptions=Oe;y.moduleName=ge;y.folderName=rt;import{jsx as Ba}from"react/jsx-runtime";var ye="textbox",ct=ye;import{Fragment as dt,jsx as C,jsxs as Ce}from"react/jsx-runtime";var pt="k-textbox",ho=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],bo={size:[i.small,i.medium,i.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},P={showClearButton:!0,showValidationIcon:!0,size:S.defaultOptions.size,rounded:S.defaultOptions.rounded,fillMode:S.defaultOptions.fillMode,separators:!0},L=e=>{let{size:t=P.size,rounded:o=P.rounded,fillMode:n=P.fillMode,separators:l=P.separators,showClearButton:c=P.showClearButton,showValidationIcon:d=P.showValidationIcon,prefix:f,suffix:m,type:x,value:h,placeholder:v,hover:_,focus:E,valid:A,invalid:I,required:R,loading:M,disabled:D,readonly:ze,...bt}=e;return Ce(S,{...bt,size:t,rounded:o,fillMode:n,hover:_,focus:E,valid:A,invalid:I,required:R,loading:M,disabled:D,readonly:ze,className:a(e.className,pt),children:[f&&Ce(dt,{children:[C(nt,{children:f}),l&&C(Ee,{})]}),C(z,{placeholder:v,value:h,type:x}),d&&C(K,{valid:A,invalid:I,loading:M,disabled:D}),C(V,{loading:M,disabled:D}),c&&C(H,{loading:M,disabled:D,readonly:ze,value:h}),m&&Ce(dt,{children:[l&&C(Ee,{}),C(st,{children:m})]})]})};L.states=ho;L.options=bo;L.className=pt;L.defaultOptions=P;L.moduleName=ye;L.folderName=ct;import{jsx as Ya}from"react/jsx-runtime";import{Fragment as ns,jsx as os}from"react/jsx-runtime";var Le="button",ut=Le;import{Fragment as Ao,jsx as Q,jsxs as ft}from"react/jsx-runtime";var Y="k-button",So=["icon-button"],vo=[s.hover,s.focus,s.active,s.selected,s.disabled,s.generating],Mo={size:[i.small,i.medium,i.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark,r.inverse]},B={size:i.medium,rounded:p.medium,fillMode:u.solid,themeColor:r.base,showArrow:!1,arrowIconName:"caret-alt-down"},T=e=>{let{size:t=B.size,rounded:o=B.rounded,fillMode:n=B.fillMode,themeColor:l=B.themeColor,showArrow:c=B.showArrow,arrowIconName:d=B.arrowIconName,variant:f,hover:m,focus:x,active:h,selected:v,disabled:_,icon:E,text:A,iconClassName:I,...R}=e,M=E!==void 0,D=e.children!==void 0;return ft("button",{...R,className:a(e.className,Y,Ke(Y,f),b(Y,{size:t,rounded:o,fillMode:n,themeColor:l}),F(Y,{hover:m,focus:x,active:h,disabled:_,selected:v}),{"k-icon-button":!A&&!D&&M}),children:[E&&Q(N,{className:a(I,"k-button-icon"),icon:E}),A?ft(Ao,{children:[A&&Q("span",{className:"k-button-text",children:A}),e.children]}):e.children&&Q("span",{className:"k-button-text",children:e.children}),c&&Q("span",{className:"k-menu-button-arrow k-button-arrow",children:Q(N,{icon:d})})]})};T.states=vo;T.options=Mo;T.variants=So;T.className=Y;T.defaultOptions=B;T.moduleName=Le;T.folderName=ut;import{jsx as us}from"react/jsx-runtime";import{jsx as hs}from"react/jsx-runtime";import{jsx as Ms}from"react/jsx-runtime";import{Fragment as Rs,jsx as _s}from"react/jsx-runtime";import{jsx as k,jsxs as ke}from"react/jsx-runtime";var xt="k-actionsheet-titlebar",Io={},Z=e=>{let{title:t,subtitle:o,actionsStart:n,actionsEnd:l,filter:c,input:d,inputValue:f,inputPlaceholder:m,adaptive:x,children:h,...v}=e;return ke("div",{...v,className:a(e.className,xt),children:[ke("div",{className:"k-actionsheet-titlebar-group",children:[n&&k("div",{className:"k-actionsheet-actions",children:n}),!h&&ke("div",{className:"k-actionsheet-title",children:[t&&k("div",{className:"k-text-center",children:t}),o&&k("div",{className:"k-actionsheet-subtitle k-text-center",children:o})]}),h&&k("div",{className:"k-actionsheet-title",children:h}),l&&k("div",{className:"k-actionsheet-actions",children:l})]}),(d||c)&&k("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter",children:d?k(L,{value:f,placeholder:m,size:x?"large":"medium"}):k(y,{placeholder:"Filter",size:x?"large":"medium"})})]})};Z.className=xt;Z.defaultOptions=Io;import{jsx as _e,jsxs as Oo}from"react/jsx-runtime";var Re="k-actionsheet-view",To=[],Eo={},go={},$=e=>{let{adaptive:t,animated:o,children:n,header:l,footer:c,...d}=e,f=l?.type===Z&&_e(Z,{adaptive:t,...l?.props}),m=c?.type===ue&&_e(ue,{...c?.props});return Oo("div",{...d,className:a(e.className,Re,{[`${Re}-animated`]:o}),children:[f,_e("div",{className:"k-actionsheet-content",children:n}),m]})};$.states=To;$.options=Eo;$.className=Re;$.defaultOptions=go;var He="action-sheet",Nt=He;import{jsx as ce,jsxs as Lo}from"react/jsx-runtime";var ht="k-actionsheet",yo=[],Co={},j={side:"bottom",fullscreen:!1,adaptive:!1,overlay:!0},w=e=>{let{side:t=j.side,fullscreen:o=j.fullscreen,adaptive:n=j.adaptive,overlay:l=j.overlay,template:c,children:d,header:f,footer:m,...x}=e;return Lo("div",{className:"k-actionsheet-container",children:[l&&ce("div",{className:"k-overlay"}),ce(g,{animationStyle:{[`${o===!0?"top":t}`]:0,[`${o===!0?"width":null}`]:"100%",[`${o===!0?"height":null}`]:"100%",[`${t==="top"||t==="bottom"?"width":null}`]:"100%",[`${t==="left"||t==="right"?"height":null}`]:"100%"},children:ce("div",{...x,className:a(e.className,ht,{[`k-actionsheet-${t}`]:o===!1,"k-actionsheet-fullscreen":o===!0,"k-adaptive-actionsheet":n}),children:c||ce($,{header:f,footer:m,adaptive:n,...e,children:d})})})]})};w.states=yo;w.options=Co;w.className=ht;w.defaultOptions=j;w.moduleName=He;w.folderName=Nt;var ti=w;export{ht as ACTIONSHEET_CLASSNAME,w as ActionSheet,ti as default};