@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,S)=>(S.startsWith("k-")?Y[S]=q[S]:Y[`k-${S}`]=q[S],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"},_={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{jsx as Mt}from"react/jsx-runtime";var Ct="k-card-callout",me=e=>{let{callout:t,...n}=e;return Mt("span",{...n,className:o(e.className,Ct,{[`k-callout-${we.calloutMap[t]||t}`]:t})})};var N="card",C=N;import{Fragment as ht,jsx as Pe,jsxs as vt}from"react/jsx-runtime";var ce="k-card",Lt=[m.hover,m.focus,m.selected,m.disabled],At={themeColor:[r.primary,r.success,r.warning,r.error,r.info]},xt={},L=e=>{let{orientation:t,themeColor:n,callout:a,hover:s,focus:u,selected:l,disabled:T,...f}=e;return vt("div",{...f,className:o(e.className,ce,b(ce,{themeColor:n}),E(ce,{hover:s,focus:u,disabled:T,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":a}),children:[a&&a!=="true"&&Pe(me,{callout:a}),Pe(ht,{children:e.children})]})};L.states=Lt;L.options=At;L.className=ce;L.defaultOptions=xt;L.moduleName=N;L.folderName=C;import{Fragment as It,jsx as Fe}from"react/jsx-runtime";var Ae="k-card-list",bt=[],kt={},Ot={},B=e=>{let{...t}=e;return Fe("div",{...t,className:o(e.className,Ae,E(Ae,{})),children:Fe(It,{children:e.children})})};B.states=bt;B.options=kt;B.className=Ae;B.defaultOptions=Ot;B.moduleName=N;B.folderName=C;import{jsx as Kt}from"react/jsx-runtime";var ze="k-card-group",St=[],_t={},gt={},w=e=>{let{...t}=e;return Kt("div",{...t,className:o(e.className,ze),children:e.children})};w.states=St;w.options=_t;w.className=ze;w.defaultOptions=gt;w.moduleName=N;w.folderName=C;import{jsx as Ht}from"react/jsx-runtime";var xe="k-card-wrap",Dt=[m.focus,m.selected],Rt={},yt={},P=e=>{let{focus:t,selected:n,...a}=e;return Ht("div",{...a,className:o(e.className,xe,E(xe,{focus:t,selected:n})),children:e.children})};P.states=Dt;P.options=Rt;P.className=xe;P.defaultOptions=yt;P.moduleName=N;P.folderName=C;import{jsx as wt}from"react/jsx-runtime";var he="k-card-title",Bt=[m.hover,m.focus],F=e=>{let{hover:t,focus:n,...a}=e;return wt("div",{...a,className:o(e.className,he,E(he,{hover:t,focus:n})),children:e.children})};F.states=Bt;F.className=he;import{jsx as Ft}from"react/jsx-runtime";var Pt="k-card-subtitle",k=e=>{let{...t}=e;return Ft("div",{...t,className:o(e.className,Pt),children:e.children})};import{Fragment as Kn,jsx as gn}from"react/jsx-runtime";import{Fragment as $t,jsx as Ue}from"react/jsx-runtime";var ve="k-font-icon",zt=[],Ut={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]},Wt={},Z=e=>{let{size:t,themeColor:n,icon:a,rotate:s,flip:u,...l}=e;return a?Ue("span",{...l,className:o(e.className,ve,b(ve,{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"})}):Ue($t,{})};Z.states=zt;Z.options=Ut;Z.className=ve;Z.defaultOptions=Wt;var We=Z;import{Fragment as Jt,jsx as de}from"react/jsx-runtime";var be="k-svg-icon",Vt=[],Gt={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]},$e={viewBox:"0 0 24 24"},Q=e=>{let{size:t,themeColor:n,rotate:a,flip:s,viewBox:u=$e.viewBox,icon:l,...T}=e;if(!l)return de(Jt,{});l==="none"&&{...T,className:o(e.className,be,"k-none")};let f=typeof l=="object"&&l.name&&l.name;return de("span",{...T,className:o(e.className,be,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:de("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=Vt;Q.options=Gt;Q.className=be;Q.defaultOptions=$e;var ke=Q;import*as Oe from"@progress/kendo-svg-icons";var Ve="icon",Ge="icons";import{Fragment as Je,jsx as j}from"react/jsx-runtime";var pe="k-icon",Xt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),qt=[],Yt={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]},Ie={viewBox:"0 0 24 24",type:"svg"},M=e=>{let{size:t,themeColor:n,icon:a,type:s=Ie.type,rotate:u,flip:l,viewBox:T=Ie.viewBox,...f}=e;if(!a)return j(Je,{});if(s==="svg"){if(a==="none")return j(ke,{...f,className:o(e.className,pe),icon:a,size:t});let R=Oe[a]?a:Xt(`${a}-icon`);return Oe[R]?j(ke,{...f,className:o(e.className,pe),icon:Oe[R],size:t,themeColor:n,rotate:u,flip:l,viewBox:T}):j(Je,{})}return j(We,{...f,className:o(e.className,pe),icon:a,size:t,themeColor:n,rotate:u,flip:l})};M.states=qt;M.options=Yt;M.defaultOptions=Ie;M.className=pe;M.moduleName=Ve;M.folderName=Ge;var Se="button",Xe=Se;import{Fragment as eo,jsx as ee,jsxs as qe}from"react/jsx-runtime";var te="k-button",Zt=["icon-button"],Qt=[m.hover,m.focus,m.active,m.selected,m.disabled,m.generating],jt={size:[i.small,i.medium,i.large],rounded:[H.small,H.medium,H.large,H.full],fillMode:[_.solid,_.flat,_.outline,_.clear,_.link],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark,r.inverse]},g={size:i.medium,rounded:H.medium,fillMode:_.solid,themeColor:r.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=g.size,rounded:n=g.rounded,fillMode:a=g.fillMode,themeColor:s=g.themeColor,showArrow:u=g.showArrow,arrowIconName:l=g.arrowIconName,variant:T,hover:f,focus:R,active:Ce,selected:Me,disabled:Le,icon:X,text:y,iconClassName:q,...Y}=e,S=X!==void 0,Et=e.children!==void 0;return qe("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&&S}),children:[X&&ee(M,{className:o(q,"k-button-icon"),icon:X}),y?qe(eo,{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=Qt;p.options=jt;p.variants=Zt;p.className=te;p.defaultOptions=g;p.moduleName=Se;p.folderName=Xe;import{jsx as ar}from"react/jsx-runtime";import{jsx as mr}from"react/jsx-runtime";import{jsx as ur}from"react/jsx-runtime";import{Fragment as oo,jsx as oe,jsxs as no}from"react/jsx-runtime";var to="k-card-header",ne=e=>{let{title:t,subtitle:n,details:a,...s}=e;return no("div",{...s,className:o(e.className,to),children:[t&&oe(F,{children:t}),n&&oe(k,{children:n}),oe(oo,{children:e.children}),a&&oe("span",{className:"k-card-header-actions",children:oe(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as Ir}from"react/jsx-runtime";import{Fragment as ao,jsx as re,jsxs as io}from"react/jsx-runtime";var ro="k-card-body",z=e=>{let{title:t,subtitle:n,details:a,...s}=e;return io("div",{...s,className:o(e.className,ro),children:[t&&re(F,{children:t}),n&&re(k,{children:n}),re(ao,{children:e.children}),a&&re("span",{className:"k-card-header-actions",children:re(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as co}from"react/jsx-runtime";var Ye="k-card-deck",so=[],lo={},mo={},U=e=>{let{...t}=e;return co("div",{...t,className:o(e.className,Ye),children:e.children})};U.states=so;U.options=lo;U.className=Ye;U.defaultOptions=mo;U.moduleName=N;U.folderName=C;import{jsx as No}from"react/jsx-runtime";var Ze="k-card-deck-scrollwrap",po=[],uo={},fo={},W=e=>{let{...t}=e;return No("div",{...t,className:o(e.className,Ze),children:e.children})};W.states=po;W.options=uo;W.className=Ze;W.defaultOptions=fo;W.moduleName=N;W.folderName=C;var _e="action-buttons",Qe=_e;import{jsx as Co}from"react/jsx-runtime";var ue="k-actions",To=[],Eo={},ge={alignment:"start",orientation:"horizontal"},O=e=>{let{alignment:t=ge.alignment,orientation:n=ge.orientation,...a}=e;return Co("div",{...a,className:o(ue,{[`${ue}-${t}`]:t,[`${ue}-${n}`]:n},e.className),children:e.children})};O.states=To;O.options=Eo;O.className=ue;O.defaultOptions=ge;O.moduleName=_e;O.folderName=Qe;import{Fragment as na,jsx as ta,jsxs as oa}from"react/jsx-runtime";import{Fragment as da,jsx as ma,jsxs as ca}from"react/jsx-runtime";var c="timeline",d=c;import{Fragment as Ao,jsx as je}from"react/jsx-runtime";var ae="k-timeline",Mo=[],Lo={},et={orientation:"vertical"},A=e=>{let{orientation:t=et.orientation,collapsibleEvents:n,alternatingMode:a,...s}=e;return je("div",{...s,className:o(e.className,ae,{[`${ae}-${t}`]:t,[`${ae}-alternating`]:a,[`${ae}-collapsible`]:n}),children:je(Ao,{children:e.children})})};A.states=Mo;A.options=Lo;A.className=ae;A.defaultOptions=et;A.moduleName=c;A.folderName=d;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(ne,{children:[x(K,{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 ot}from"react/jsx-runtime";var nt="k-timeline-events-list",fe=e=>{let{...t}=e;return ot("div",{...t,className:o(e.className,nt),children:ot("ul",{className:"k-timeline-scrollable-wrap",children:e.children})})};fe.className=nt;fe.moduleName=c;fe.folderName=d;import{jsx as ko,jsxs as Oo}from"react/jsx-runtime";var rt="k-timeline-flag-wrap",vo=[m.focus,m.selected],bo={},at={year:"2020"},v=e=>{let{year:t=at.year,...n}=e;return Oo("li",{...n,className:o(e.className,rt),children:[ko("span",{className:"k-timeline-flag",children:t}),e.children]})};v.states=vo;v.options=bo;v.className=rt;v.defaultOptions=at;v.moduleName=c;v.folderName=d;import{jsx as Io}from"react/jsx-runtime";var it="k-timeline-circle",V=e=>{let{...t}=e;return Io("span",{...t,className:o(e.className,it)})};V.className=it;V.moduleName=c;V.folderName=d;import{jsx as So}from"react/jsx-runtime";var st="k-timeline-flag",Ne=e=>{let{content:t,...n}=e;return So("span",{...n,className:o(e.className,st),children:t})};Ne.className=st;Ne.moduleName=c;Ne.folderName=d;import{jsx as Ko,jsxs as Do}from"react/jsx-runtime";var _o=[],go={},G=e=>{let{callout:t,children:n,...a}=e;return Do(L,{className:o(e.className),orientation:"vertical",callout:"true",...a,children:[t&&Ko(ie,{callout:t}),n]})};G.states=_o;G.defaultOptions=go;import{jsx as De,jsxs as Ho}from"react/jsx-runtime";var lt="k-card-title",Ro=[],yo={},K=e=>{let{collapsible:t,children:n,...a}=e;return Ho("div",{className:o(e.className,lt),...a,children:[De("span",{className:"k-event-title",children:n}),t&&De("span",{className:"k-event-collapse k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button",children:De(M,{icon:"chevron-right",className:"k-button-icon"})})]})};K.states=Ro;K.className=lt;K.defaultOptions=yo;import{jsx as Po}from"react/jsx-runtime";var mt="k-timeline-card-callout",Bo=[],wo={},ie=e=>{let{...t}=e;return Po(me,{className:o(e.className,mt),...t})};ie.states=Bo;ie.className=mt;ie.defaultOptions=wo;import{jsx as ct}from"react/jsx-runtime";var dt="k-timeline-date-wrap",Fo=[],zo={},pt={date:"May 25, 2008"},D=e=>{let{date:t=pt.date,...n}=e;return ct("div",{...n,className:o(e.className,dt),children:ct("span",{className:"k-timeline-date",children:t})})};D.states=Fo;D.options=zo;D.className=dt;D.defaultOptions=pt;D.moduleName=c;D.folderName=d;import{jsx as Re,jsxs as Uo}from"react/jsx-runtime";var ut="k-timeline-track-wrap",Te=e=>{let{...t}=e;return Uo("div",{...t,className:o(e.className,ut),children:[Re(p,{className:"k-timeline-arrow k-timeline-arrow-left",rounded:"full",icon:"caret-alt-left",disabled:!0}),Re(p,{className:"k-timeline-arrow k-timeline-arrow-right",rounded:"full",icon:"caret-alt-right"}),Re(se,{children:e.children})]})};Te.className=ut;Te.moduleName=c;Te.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 $o}from"react/jsx-runtime";var ye="k-timeline-track-item",Wo=[m.focus],le=e=>{let{content:t,focus:n,...a}=e;return $o("li",{...a,className:o(e.className,ye,E(ye,{focus:n})),children:[t,e.children]})};le.states=Wo;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 J,jsxs as He}from"react/jsx-runtime";var Tt="k-timeline-event",Vo=[],Go={},Ee={title:"Event title",subtitle:"Event subtitle",content:"Event content"},I=e=>{let{content:t=Ee.content,title:n=Ee.title,subtitle:a=Ee.subtitle,...s}=e;return He("li",{...s,className:o(e.className,Tt),children:[t&&J("div",{className:o("k-timeline-card"),children:J(G,{orientation:"vertical",callout:"top",children:He("div",{className:"k-card-inner",children:[He(ne,{children:[J(K,{children:n}),J(k,{children:a})]}),J(z,{children:J("div",{className:"k-card-description",children:t})})]})})}),e.children]})};I.states=Vo;I.options=Go;I.className=Tt;I.defaultOptions=Ee;I.moduleName=c;I.folderName=d;var bs=I;export{I as HorizontalTimelineEvent,Tt as TIMELINEHORIZONTALEVENT_CLASSNAME,bs as default};