@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 16.3 kB
JavaScript
var o=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?o(...t):typeof t=="object"?Object.keys(t).map((n,a)=>t[a]||t[n]&&n||null).filter(n=>n!==null).join(" "):t).filter(t=>!!t).join(" ");var b=(e,t)=>o({[`${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"}),E=(e,t)=>{let{valid:n,invalid:a,hover:s,focus:u,checked:l,active:T,selected:f,disabled:R,indeterminate:Ce,loading:Me,empty:Le,readonly:X,highlighted:y,...q}=t;return o({"k-valid":n,"k-invalid":a,"k-hover":s,"k-focus":u,"k-checked":l,"k-active":T,"k-selected":f,"k-disabled":R,"k-indeterminate":Ce&&!l,"k-loading":Me,"k-empty":Le,"k-readonly":X,"k-highlighted":y},Object.keys(q).reduce((Y,I)=>(I.startsWith("k-")?Y[I]=q[I]:Y[`k-${I}`]=q[I],Y),{}))};function Be(e,t){if(!t)return{};let n=Array.isArray(t)?t:[t];return Object.fromEntries(n.map(a=>[`k-${a}`,!0]))}var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},H={small:"small",medium:"medium",large:"large",full:"full"},S={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"},m={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"},we={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{Fragment as At,jsx as Pe}from"react/jsx-runtime";var Ae="k-font-icon",Ct=[],Mt={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]},Lt={},Z=e=>{let{size:t,themeColor:n,icon:a,rotate:s,flip:u,...l}=e;return a?Pe("span",{...l,className:o(e.className,Ae,b(Ae,{size:t}),{[`k-i-${a}`]:a,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"})}):Pe(At,{})};Z.states=Ct;Z.options=Mt;Z.className=Ae;Z.defaultOptions=Lt;var Fe=Z;import{Fragment as vt,jsx as ce}from"react/jsx-runtime";var xe="k-svg-icon",xt=[],ht={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]},ze={viewBox:"0 0 24 24"},Q=e=>{let{size:t,themeColor:n,rotate:a,flip:s,viewBox:u=ze.viewBox,icon:l,...T}=e;if(!l)return ce(vt,{});l==="none"&&{...T,className:o(e.className,xe,"k-none")};let f=typeof l=="object"&&l.name&&l.name;return ce("span",{...T,className:o(e.className,xe,b("k-icon",{size:t}),{[`k-svg-i-${f}`]:f,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),children:ce("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:u,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:e.children})})};Q.states=xt;Q.options=ht;Q.className=xe;Q.defaultOptions=ze;var he=Q;import*as ve from"@progress/kendo-svg-icons";var Ue="icon",We="icons";import{Fragment as $e,jsx as j}from"react/jsx-runtime";var de="k-icon",bt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),kt=[],Ot={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"},M=e=>{let{size:t,themeColor:n,icon:a,type:s=be.type,rotate:u,flip:l,viewBox:T=be.viewBox,...f}=e;if(!a)return j($e,{});if(s==="svg"){if(a==="none")return j(he,{...f,className:o(e.className,de),icon:a,size:t});let R=ve[a]?a:bt(`${a}-icon`);return ve[R]?j(he,{...f,className:o(e.className,de),icon:ve[R],size:t,themeColor:n,rotate:u,flip:l,viewBox:T}):j($e,{})}return j(Fe,{...f,className:o(e.className,de),icon:a,size:t,themeColor:n,rotate:u,flip:l})};M.states=kt;M.options=Ot;M.defaultOptions=be;M.className=de;M.moduleName=Ue;M.folderName=We;var ke="button",Ve=ke;import{Fragment as gt,jsx as ee,jsxs as Ge}from"react/jsx-runtime";var te="k-button",It=["icon-button"],St=[m.hover,m.focus,m.active,m.selected,m.disabled,m.generating],_t={size:[i.small,i.medium,i.large],rounded:[H.small,H.medium,H.large,H.full],fillMode:[S.solid,S.flat,S.outline,S.clear,S.link],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark,r.inverse]},_={size:i.medium,rounded:H.medium,fillMode:S.solid,themeColor:r.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=_.size,rounded:n=_.rounded,fillMode:a=_.fillMode,themeColor:s=_.themeColor,showArrow:u=_.showArrow,arrowIconName:l=_.arrowIconName,variant:T,hover:f,focus:R,active:Ce,selected:Me,disabled:Le,icon:X,text:y,iconClassName:q,...Y}=e,I=X!==void 0,Et=e.children!==void 0;return Ge("button",{...Y,className:o(e.className,te,Be(te,T),b(te,{size:t,rounded:n,fillMode:a,themeColor:s}),E(te,{hover:f,focus:R,active:Ce,disabled:Le,selected:Me}),{"k-icon-button":!y&&!Et&&I}),children:[X&&ee(M,{className:o(q,"k-button-icon"),icon:X}),y?Ge(gt,{children:[y&&ee("span",{className:"k-button-text",children:y}),e.children]}):e.children&&ee("span",{className:"k-button-text",children:e.children}),u&&ee("span",{className:"k-menu-button-arrow k-button-arrow",children:ee(M,{icon:l})})]})};p.states=St;p.options=_t;p.variants=It;p.className=te;p.defaultOptions=_;p.moduleName=ke;p.folderName=Ve;import{jsx as On}from"react/jsx-runtime";import{jsx as gn}from"react/jsx-runtime";import{jsx as yn}from"react/jsx-runtime";var c="timeline",d=c;import{Fragment as Rt,jsx as Je}from"react/jsx-runtime";var oe="k-timeline",Kt=[],Dt={},Xe={orientation:"vertical"},L=e=>{let{orientation:t=Xe.orientation,collapsibleEvents:n,alternatingMode:a,...s}=e;return Je("div",{...s,className:o(e.className,oe,{[`${oe}-${t}`]:t,[`${oe}-alternating`]:a,[`${oe}-collapsible`]:n}),children:Je(Rt,{children:e.children})})};L.states=Kt;L.options=Dt;L.className=oe;L.defaultOptions=Xe;L.moduleName=c;L.folderName=d;import{jsx as Ht}from"react/jsx-runtime";var yt="k-card-callout",pe=e=>{let{callout:t,...n}=e;return Ht("span",{...n,className:o(e.className,yt,{[`k-callout-${we.calloutMap[t]||t}`]:t})})};var N="card",C=N;import{Fragment as Ft,jsx as qe,jsxs as zt}from"react/jsx-runtime";var ue="k-card",Bt=[m.hover,m.focus,m.selected,m.disabled],wt={themeColor:[r.primary,r.success,r.warning,r.error,r.info]},Pt={},A=e=>{let{orientation:t,themeColor:n,callout:a,hover:s,focus:u,selected:l,disabled:T,...f}=e;return zt("div",{...f,className:o(e.className,ue,b(ue,{themeColor:n}),E(ue,{hover:s,focus:u,disabled:T,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":a}),children:[a&&a!=="true"&&qe(pe,{callout:a}),qe(Ft,{children:e.children})]})};A.states=Bt;A.options=wt;A.className=ue;A.defaultOptions=Pt;A.moduleName=N;A.folderName=C;import{Fragment as Vt,jsx as Ye}from"react/jsx-runtime";var Oe="k-card-list",Ut=[],Wt={},$t={},B=e=>{let{...t}=e;return Ye("div",{...t,className:o(e.className,Oe,E(Oe,{})),children:Ye(Vt,{children:e.children})})};B.states=Ut;B.options=Wt;B.className=Oe;B.defaultOptions=$t;B.moduleName=N;B.folderName=C;import{jsx as qt}from"react/jsx-runtime";var Ze="k-card-group",Gt=[],Jt={},Xt={},w=e=>{let{...t}=e;return qt("div",{...t,className:o(e.className,Ze),children:e.children})};w.states=Gt;w.options=Jt;w.className=Ze;w.defaultOptions=Xt;w.moduleName=N;w.folderName=C;import{jsx as jt}from"react/jsx-runtime";var Ie="k-card-wrap",Yt=[m.focus,m.selected],Zt={},Qt={},P=e=>{let{focus:t,selected:n,...a}=e;return jt("div",{...a,className:o(e.className,Ie,E(Ie,{focus:t,selected:n})),children:e.children})};P.states=Yt;P.options=Zt;P.className=Ie;P.defaultOptions=Qt;P.moduleName=N;P.folderName=C;import{jsx as to}from"react/jsx-runtime";var Se="k-card-title",eo=[m.hover,m.focus],F=e=>{let{hover:t,focus:n,...a}=e;return to("div",{...a,className:o(e.className,Se,E(Se,{hover:t,focus:n})),children:e.children})};F.states=eo;F.className=Se;import{jsx as no}from"react/jsx-runtime";var oo="k-card-subtitle",k=e=>{let{...t}=e;return no("div",{...t,className:o(e.className,oo),children:e.children})};import{Fragment as hr,jsx as xr}from"react/jsx-runtime";import{Fragment as ao,jsx as ne,jsxs as io}from"react/jsx-runtime";var ro="k-card-header",re=e=>{let{title:t,subtitle:n,details:a,...s}=e;return io("div",{...s,className:o(e.className,ro),children:[t&&ne(F,{children:t}),n&&ne(k,{children:n}),ne(ao,{children:e.children}),a&&ne("span",{className:"k-card-header-actions",children:ne(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as Dr}from"react/jsx-runtime";import{Fragment as lo,jsx as ae,jsxs as mo}from"react/jsx-runtime";var so="k-card-body",z=e=>{let{title:t,subtitle:n,details:a,...s}=e;return mo("div",{...s,className:o(e.className,so),children:[t&&ae(F,{children:t}),n&&ae(k,{children:n}),ae(lo,{children:e.children}),a&&ae("span",{className:"k-card-header-actions",children:ae(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as fo}from"react/jsx-runtime";var Qe="k-card-deck",co=[],po={},uo={},U=e=>{let{...t}=e;return fo("div",{...t,className:o(e.className,Qe),children:e.children})};U.states=co;U.options=po;U.className=Qe;U.defaultOptions=uo;U.moduleName=N;U.folderName=C;import{jsx as Co}from"react/jsx-runtime";var je="k-card-deck-scrollwrap",No=[],To={},Eo={},W=e=>{let{...t}=e;return Co("div",{...t,className:o(e.className,je),children:e.children})};W.states=No;W.options=To;W.className=je;W.defaultOptions=Eo;W.moduleName=N;W.folderName=C;var _e="action-buttons",et=_e;import{jsx as Ao}from"react/jsx-runtime";var fe="k-actions",Mo=[],Lo={},ge={alignment:"start",orientation:"horizontal"},O=e=>{let{alignment:t=ge.alignment,orientation:n=ge.orientation,...a}=e;return Ao("div",{...a,className:o(fe,{[`${fe}-${t}`]:t,[`${fe}-${n}`]:n},e.className),children:e.children})};O.states=Mo;O.options=Lo;O.className=fe;O.defaultOptions=ge;O.moduleName=_e;O.folderName=et;import{Fragment as la,jsx as ia,jsxs as sa}from"react/jsx-runtime";import{Fragment as Ta,jsx as fa,jsxs as Na}from"react/jsx-runtime";import{jsx as x,jsxs as Ke}from"react/jsx-runtime";var tt="k-timeline-event",xo=[],ho={},$={collapsed:!1,reverse:!1,title:"Event title",subtitle:"Event subtitle",content:"Event content"},h=e=>{let{date:t,content:n=$.content,collapsed:a=$.collapsed,reverse:s=$.reverse,title:u=$.title,subtitle:l=$.subtitle,showCollapseButton:T,...f}=e;return Ke("li",{...f,className:o(e.className,tt,{"k-reverse":s}),children:[t&&x("div",{className:"k-timeline-date-wrap",children:x("span",{className:"k-timeline-date",children:t})}),x(V,{}),n&&x("div",{className:o("k-timeline-card",{"k-collapsed":a}),children:x(G,{...s?{callout:"right"}:{callout:"left"},children:Ke("div",{className:"k-card-inner",children:[Ke(re,{children:[x(g,{collapsible:T,children:u}),x(k,{children:l})]}),x(z,{children:x("div",{className:"k-card-description",children:n})})]})})}),e.children]})};h.states=xo;h.options=ho;h.className=tt;h.defaultOptions=$;h.moduleName=c;h.folderName=d;import{jsx as J,jsxs as De}from"react/jsx-runtime";var ot="k-timeline-event",vo=[],bo={},Ne={title:"Event title",subtitle:"Event subtitle",content:"Event content"},K=e=>{let{content:t=Ne.content,title:n=Ne.title,subtitle:a=Ne.subtitle,...s}=e;return De("li",{...s,className:o(e.className,ot),children:[t&&J("div",{className:o("k-timeline-card"),children:J(G,{orientation:"vertical",callout:"top",children:De("div",{className:"k-card-inner",children:[De(re,{children:[J(g,{children:n}),J(k,{children:a})]}),J(z,{children:J("div",{className:"k-card-description",children:t})})]})})}),e.children]})};K.states=vo;K.options=bo;K.className=ot;K.defaultOptions=Ne;K.moduleName=c;K.folderName=d;import{jsx as nt}from"react/jsx-runtime";var rt="k-timeline-events-list",Te=e=>{let{...t}=e;return nt("div",{...t,className:o(e.className,rt),children:nt("ul",{className:"k-timeline-scrollable-wrap",children:e.children})})};Te.className=rt;Te.moduleName=c;Te.folderName=d;import{jsx as Io,jsxs as So}from"react/jsx-runtime";var at="k-timeline-flag-wrap",ko=[m.focus,m.selected],Oo={},it={year:"2020"},v=e=>{let{year:t=it.year,...n}=e;return So("li",{...n,className:o(e.className,at),children:[Io("span",{className:"k-timeline-flag",children:t}),e.children]})};v.states=ko;v.options=Oo;v.className=at;v.defaultOptions=it;v.moduleName=c;v.folderName=d;import{jsx as _o}from"react/jsx-runtime";var st="k-timeline-circle",V=e=>{let{...t}=e;return _o("span",{...t,className:o(e.className,st)})};V.className=st;V.moduleName=c;V.folderName=d;import{jsx as go}from"react/jsx-runtime";var lt="k-timeline-flag",Ee=e=>{let{content:t,...n}=e;return go("span",{...n,className:o(e.className,lt),children:t})};Ee.className=lt;Ee.moduleName=c;Ee.folderName=d;import{jsx as Ro,jsxs as yo}from"react/jsx-runtime";var Ko=[],Do={},G=e=>{let{callout:t,children:n,...a}=e;return yo(A,{className:o(e.className),orientation:"vertical",callout:"true",...a,children:[t&&Ro(ie,{callout:t}),n]})};G.states=Ko;G.defaultOptions=Do;import{jsx as Re,jsxs as wo}from"react/jsx-runtime";var mt="k-card-title",Ho=[],Bo={},g=e=>{let{collapsible:t,children:n,...a}=e;return wo("div",{className:o(e.className,mt),...a,children:[Re("span",{className:"k-event-title",children:n}),t&&Re("span",{className:"k-event-collapse k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button",children:Re(M,{icon:"chevron-right",className:"k-button-icon"})})]})};g.states=Ho;g.className=mt;g.defaultOptions=Bo;import{jsx as zo}from"react/jsx-runtime";var ct="k-timeline-card-callout",Po=[],Fo={},ie=e=>{let{...t}=e;return zo(pe,{className:o(e.className,ct),...t})};ie.states=Po;ie.className=ct;ie.defaultOptions=Fo;import{jsx as dt}from"react/jsx-runtime";var pt="k-timeline-date-wrap",Uo=[],Wo={},ut={date:"May 25, 2008"},D=e=>{let{date:t=ut.date,...n}=e;return dt("div",{...n,className:o(e.className,pt),children:dt("span",{className:"k-timeline-date",children:t})})};D.states=Uo;D.options=Wo;D.className=pt;D.defaultOptions=ut;D.moduleName=c;D.folderName=d;import{jsx as ft}from"react/jsx-runtime";var Nt="k-timeline-track",se=e=>{let{...t}=e;return ft("div",{...t,className:o(e.className,Nt),children:ft("ul",{className:"k-timeline-scrollable-wrap",children:e.children})})};se.className=Nt;se.moduleName=c;se.folderName=d;import{jsxs as Vo}from"react/jsx-runtime";var ye="k-timeline-track-item",$o=[m.focus],le=e=>{let{content:t,focus:n,...a}=e;return Vo("li",{...a,className:o(e.className,ye,E(ye,{focus:n})),children:[t,e.children]})};le.states=$o;le.className=ye;le.moduleName=c;le.folderName=d;import{jsx as Bi,jsxs as wi}from"react/jsx-runtime";import{jsx as Ui,jsxs as Wi}from"react/jsx-runtime";import{jsx as Ji,jsxs as Xi}from"react/jsx-runtime";import{Fragment as es,jsx as Qi,jsxs as ji}from"react/jsx-runtime";import{jsx as He,jsxs as Go}from"react/jsx-runtime";var Tt="k-timeline-track-wrap",me=e=>{let{...t}=e;return Go("div",{...t,className:o(e.className,Tt),children:[He(p,{className:"k-timeline-arrow k-timeline-arrow-left",rounded:"full",icon:"caret-alt-left",disabled:!0}),He(p,{className:"k-timeline-arrow k-timeline-arrow-right",rounded:"full",icon:"caret-alt-right"}),He(se,{children:e.children})]})};me.className=Tt;me.moduleName=c;me.folderName=d;var bs=me;export{Tt as TIMELINETRACKWRAP_CLASSNAME,me as TimelineTrackWrap,bs as default};