@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12.2 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((r,n)=>t[n]||t[r]&&r||null).filter(r=>r!==null).join(" "):t).filter(t=>!!t).join(" ");var g=(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"}),C=(e,t)=>a({"k-valid":t.valid,"k-invalid":t.invalid,"k-hover":t.hover,"k-focus":t.focus,"k-checked":t.checked,"k-active":t.active,"k-selected":t.selected,"k-disabled":t.disabled,"k-indeterminate":t.indeterminate&&!t.checked,"k-loading":t.loading,"k-empty":t.empty,"k-readonly":t.readonly,"k-highlighted":t.highlighted});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"},f={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"},d={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"},k={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as at}from"react/jsx-runtime";var nt="k-orgchart",St=[],Ot={},q={width:"100%",height:"300px"},N=e=>{let{width:t=q.width,height:r=q.height,...n}=e;return at("div",{...n,className:a(e.className,nt),children:at("div",{className:"k-orgchart-container",style:{width:t,height:r},children:e.children})})};N.states=St;N.options=Ot;N.className=nt;N.defaultOptions=q;import{jsx as Bt}from"react/jsx-runtime";var Mt="k-card-callout",it=e=>{let{callout:t,...r}=e;return Bt("span",{...r,className:a(e.className,Mt,{[`k-callout-${k.calloutMap[t]||t}`]:t})})};import{Fragment as zt,jsx as lt,jsxs as Ht}from"react/jsx-runtime";var P="k-card",Kt=[d.hover,d.focus,d.selected,d.disabled],Lt={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Et={},y=e=>{let{orientation:t,themeColor:r,callout:n,hover:c,focus:s,selected:l,disabled:m,...u}=e;return Ht("div",{...u,className:a(e.className,P,g(P,{themeColor:r}),C(P,{hover:c,focus:s,disabled:m,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":n}),children:[n&&n!=="true"&<(it,{callout:n}),lt(zt,{children:e.children})]})};y.states=Kt;y.options=Lt;y.className=P;y.defaultOptions=Et;import{jsx as wt}from"react/jsx-runtime";var Y="k-card-title",Rt=[d.hover,d.focus],T=e=>{let{hover:t,focus:r,...n}=e;return wt("div",{...n,className:a(e.className,Y,C(Y,{hover:t,focus:r})),children:e.children})};T.states=Rt;T.className=Y;import{jsx as Gt}from"react/jsx-runtime";var It="k-card-subtitle",E=e=>{let{...t}=e;return Gt("div",{...t,className:a(e.className,It),children:e.children})};import{Fragment as De,jsx as Ge}from"react/jsx-runtime";import{Fragment as _t,jsx as st}from"react/jsx-runtime";var Q="k-icon k-font-icon",Dt=[],$t={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Pt={},z=e=>{let{size:t,themeColor:r,icon:n,rotate:c,flip:s,...l}=e;return n?st("span",{...l,className:a(e.className,Q,g(Q,{size:t}),{[`k-i-${n}`]:n,[`k-color-${r}`]:r,[`k-rotate-${c}`]:c,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"})}):st(_t,{})};z.states=Dt;z.options=$t;z.className=Q;z.defaultOptions=Pt;var ct=z;import{Fragment as Xt,jsx as _}from"react/jsx-runtime";var W="k-icon k-svg-icon",Ft=[],Vt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},dt={viewBox:"0 0 24 24"},H=e=>{let{size:t,themeColor:r,rotate:n,flip:c,viewBox:s=dt.viewBox,icon:l,...m}=e;if(!l)return _(Xt,{});l==="none"&&{...m,className:a(e.className,W,"k-none")};let u=typeof l=="object"&&l.name&&l.name;return _("span",{...m,className:a(e.className,W,g("k-icon",{size:t}),{[`k-svg-i-${u}`]:u,[`k-color-${r}`]:r,[`k-rotate-${n}`]:n,"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 l=="object"?l.viewBox:s,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:e.children})})};H.states=Ft;H.options=Vt;H.className=W;H.defaultOptions=dt;var Z=H;import*as mt from"@progress/kendo-svg-icons";import{Fragment as ut,jsx as R}from"react/jsx-runtime";var Ut=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Jt=[],qt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},j={viewBox:"0 0 24 24",type:"svg"},M=e=>{let{size:t,themeColor:r,icon:n,type:c=j.type,rotate:s,flip:l,viewBox:m=j.viewBox,...u}=e;if(!n)return R(ut,{});if(c==="svg"){if(n==="none")return R(Z,{...u,icon:n,size:t});let v=Ut(`${n}-icon`);return mt[v]?R(Z,{...u,icon:mt[v],size:t,themeColor:r,rotate:s,flip:l,viewBox:m}):R(ut,{})}return R(ct,{...u,icon:n,size:t,themeColor:r,rotate:s,flip:l})};M.states=Jt;M.options=qt;M.defaultOptions=j;import{Fragment as Wt,jsx as w,jsxs as pt}from"react/jsx-runtime";var F="k-button",Yt=[d.hover,d.focus,d.active,d.selected,d.disabled],Qt={size:[i.small,i.medium,i.large],rounded:[h.small,h.medium,h.large,h.full],fillMode:[f.solid,f.flat,f.outline,f.clear,f.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},A={size:i.medium,rounded:h.medium,fillMode:f.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=A.size,rounded:r=A.rounded,fillMode:n=A.fillMode,themeColor:c=A.themeColor,showArrow:s=A.showArrow,arrowIconName:l=A.arrowIconName,hover:m,focus:u,active:v,selected:D,disabled:U,icon:J,text:$,iconClassName:yt,...kt}=e,Tt=J!==void 0,At=e.children!==void 0;return pt("button",{...kt,className:a(e.className,F,g(F,{size:t,rounded:r,fillMode:n,themeColor:c}),C(F,{hover:m,focus:u,active:v,disabled:U,selected:D}),{"k-icon-button":!$&&!At&&Tt}),children:[J&&w(M,{className:a(yt,"k-button-icon"),icon:J}),$?pt(Wt,{children:[$&&w("span",{className:"k-button-text",children:$}),e.children]}):e.children&&w("span",{className:"k-button-text",children:e.children}),s&&w("span",{className:"k-menu-button-arrow k-button-arrow",children:w(M,{icon:l})})]})};p.states=Yt;p.options=Qt;p.className=F;p.defaultOptions=A;import{jsx as so}from"react/jsx-runtime";import{jsx as po}from"react/jsx-runtime";import{jsx as bo}from"react/jsx-runtime";import{Fragment as Ko,jsx as Bo,jsxs as Lo}from"react/jsx-runtime";import{jsx as Ro}from"react/jsx-runtime";import{Fragment as jt,jsx as I,jsxs as te}from"react/jsx-runtime";var Zt="k-card-body",V=e=>{let{title:t,subtitle:r,details:n,...c}=e;return te("div",{...c,className:a(e.className,Zt),children:[t&&I(T,{children:t}),r&&I(E,{children:r}),I(jt,{children:e.children}),n&&I("span",{className:"k-card-header-actions",children:I(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as Xo}from"react/jsx-runtime";import{jsx as re}from"react/jsx-runtime";var X="k-actions",ee=[],oe={},tt={alignment:"start",orientation:"horizontal"},B=e=>{let{alignment:t=tt.alignment,orientation:r=tt.orientation,...n}=e;return re("div",{...n,className:a(X,{[`${X}-${t}`]:t,[`${X}-${r}`]:r},e.className),children:e.children})};B.states=ee;B.options=oe;B.className=X;B.defaultOptions=tt;import{Fragment as nr,jsx as rr,jsxs as ar}from"react/jsx-runtime";import{Fragment as pr,jsx as mr,jsxs as ur}from"react/jsx-runtime";import{jsx as ht}from"react/jsx-runtime";var G="k-avatar";var ae=[d.hover,d.focus,d.active,d.selected,d.disabled],ne={size:[i.small,i.medium,i.large],rounded:[h.small,h.medium,h.large,h.full],fillMode:[f.solid,f.flat,f.outline],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},S={type:"text",size:i.medium,rounded:h.full,fillMode:f.solid,themeColor:o.primary,border:!1},K=e=>{let{size:t=S.size,rounded:r=S.rounded,fillMode:n=S.fillMode,themeColor:c=S.themeColor,type:s=S.type,border:l=S.border,...m}=e;return ht("div",{...m,className:a(e.className,G,g(G,{size:t,rounded:r,fillMode:n,themeColor:c}),{[`${G}-bordered`]:l}),children:ht("span",{className:`${G}-${s}`,children:e.children})})};K.states=ae;K.options=ne;K.className=G;K.defaultOptions=S;import{jsx as Er}from"react/jsx-runtime";import{jsx as wr}from"react/jsx-runtime";import{jsx as $r}from"react/jsx-runtime";import{jsx as b,jsxs as et}from"react/jsx-runtime";var ie="k-orgchart-node",gt={buttonIcon:"plus",details:!0},O=e=>{let{title:t,subtitle:r,details:n=gt.details,color:c,lineBottom:s,lineTop:l,button:m,buttonIcon:u=gt.buttonIcon,avatar:v,avatarType:D,...U}=e;return et("div",{...U,className:a(e.className,ie,"k-vstack","k-align-items-center"),children:[l&&b("div",{className:"k-orgchart-line k-orgchart-line-v"}),b(y,{className:"k-orgchart-card",children:et(V,{className:"k-hstack",details:n,style:{borderTopColor:c},children:[b(K,{type:D,themeColor:"secondary",children:D==="image"?b("img",{src:v}):v}),et("div",{className:"k-card-title-wrap k-vstack",children:[b(T,{className:"k-text-ellipsis",children:t}),b("span",{className:"k-spacer"}),b(E,{className:"k-text-ellipsis",children:r})]}),b("span",{className:"k-spacer"})]})}),s&&b("div",{className:"k-orgchart-line k-orgchart-line-v"}),m&&b(p,{className:"k-orgchart-button",icon:u})]})};import{jsx as L,jsxs as vt}from"react/jsx-runtime";var le="k-orgchart-node-group",se=[d.focus],bt={orientation:"horizontal",buttonIcon:"plus"},ot=e=>{let{title:t,subtitle:r,lineBottom:n,lineTop:c,button:s,buttonIcon:l=bt.buttonIcon,focus:m,orientation:u=bt.orientation,...v}=e;return vt("div",{...v,className:a(e.className,le,"k-vstack","k-align-items-center"),children:[c&&L("div",{className:"k-orgchart-line k-orgchart-line-v"}),vt("div",{className:a("k-orgchart-node-group-container","k-vstack",C("k-orgchart-node-group-container",{focus:m})),children:[t&&L("div",{className:"k-orgchart-node-group-title",children:t}),r&&L("div",{className:"k-orgchart-node-group-subtitle",children:r}),L("div",{className:a("k-orgchart-node-container",{[`k-${k.orientationMap[u]||u}`]:u}),children:e.children})]}),n&&L("div",{className:"k-orgchart-line k-orgchart-line-v"}),s&&L(p,{className:"k-orgchart-button",icon:l})]})};ot.states=se;import{jsx as na,jsxs as ia}from"react/jsx-runtime";import{jsx as da,jsxs as ma}from"react/jsx-runtime";import{jsx as fa,jsxs as ga}from"react/jsx-runtime";import{jsx as Ca,jsxs as Na}from"react/jsx-runtime";import{Fragment as xt,jsx as rt,jsxs as me}from"react/jsx-runtime";var Ct="k-orgchart-group",ce=[],de={},Nt={orientation:"horizontal"},x=e=>{let{children:t,orientation:r=Nt.orientation,justifyContent:n,...c}=e,s=[],l=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===O?s.push(m):l.push(m)}):t.type===O?s.push(t):l.push(t)),me("div",{...c,className:a(Ct,"k-pos-absolute",{[`k-${k.orientationMap[r]||r}`]:r,[`k-justify-content-${n}`]:n}),style:{width:"100%"},children:[s.length>0&&rt("div",{className:a("k-orgchart-node-container","k-justify-content-around",{[`k-${k.orientationMap[r]||r}`]:r}),children:rt(xt,{children:s})}),rt(xt,{children:l})]})};x.states=ce;x.options=de;x.className=Ct;x.defaultOptions=Nt;var Ha=x;export{Ct as ORGCHARTGROUP_CLASSNAME,x as OrgchartGroup,Ha as default};