@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12.9 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 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"}),y=(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});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"},T={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as it}from"react/jsx-runtime";var st="k-orgchart",Mt=[],Bt={},Q={width:"100%",height:"300px"},C=e=>{let{width:t=Q.width,height:r=Q.height,...n}=e;return it("div",{...n,className:a(e.className,st),children:it("div",{className:"k-orgchart-container",style:{width:t,height:r},children:e.children})})};C.states=Mt;C.options=Bt;C.className=st;C.defaultOptions=Q;import{jsx as Lt}from"react/jsx-runtime";var Kt="k-card-callout",lt=e=>{let{callout:t,...r}=e;return Lt("span",{...r,className:a(e.className,Kt,{[`k-callout-${T.calloutMap[t]||t}`]:t})})};import{Fragment as wt,jsx as ct,jsxs as It}from"react/jsx-runtime";var F="k-card",zt=[d.hover,d.focus,d.selected,d.disabled],Et={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Ht={},k=e=>{let{orientation:t,themeColor:r,callout:n,hover:c,focus:l,selected:s,disabled:m,...u}=e;return It("div",{...u,className:a(e.className,F,b(F,{themeColor:r}),y(F,{hover:c,focus:l,disabled:m,selected:s}),{[`k-card-${t}`]:t,"k-card-with-callout":n}),children:[n&&n!=="true"&&ct(lt,{callout:n}),ct(wt,{children:e.children})]})};k.states=zt;k.options=Et;k.className=F;k.defaultOptions=Ht;import{jsx as Gt}from"react/jsx-runtime";var W="k-card-title",Rt=[d.hover,d.focus],A=e=>{let{hover:t,focus:r,...n}=e;return Gt("div",{...n,className:a(e.className,W,y(W,{hover:t,focus:r})),children:e.children})};A.states=Rt;A.className=W;import{jsx as $t}from"react/jsx-runtime";var Dt="k-card-subtitle",E=e=>{let{...t}=e;return $t("div",{...t,className:a(e.className,Dt),children:e.children})};import{Fragment as Pe,jsx as $e}from"react/jsx-runtime";import{Fragment as Vt,jsx as dt}from"react/jsx-runtime";var Z="k-icon k-font-icon",Pt=[],_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]},Ft={},H=e=>{let{size:t,themeColor:r,icon:n,rotate:c,flip:l,...s}=e;return n?dt("span",{...s,className:a(e.className,Z,b(Z,{size:t}),{[`k-i-${n}`]:n,[`k-color-${r}`]:r,[`k-rotate-${c}`]:c,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):dt(Vt,{})};H.states=Pt;H.options=_t;H.className=Z;H.defaultOptions=Ft;var mt=H;import{Fragment as qt,jsx as V}from"react/jsx-runtime";var j="k-icon k-svg-icon",Ut=[],Xt={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]},ut={viewBox:"0 0 24 24"},w=e=>{let{size:t,themeColor:r,rotate:n,flip:c,viewBox:l=ut.viewBox,icon:s,...m}=e;if(!s)return V(qt,{});s==="none"&&{...m,className:a(e.className,j,"k-none")};let u=typeof s=="object"&&s.name&&s.name;return V("span",{...m,className:a(e.className,j,b("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:V("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:l,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?void 0:e.children})})};w.states=Ut;w.options=Xt;w.className=j;w.defaultOptions=ut;var tt=w;import*as pt from"@progress/kendo-svg-icons";import{Fragment as ht,jsx as I}from"react/jsx-runtime";var Jt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Yt=[],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]},et={viewBox:"0 0 24 24",type:"svg"},M=e=>{let{size:t,themeColor:r,icon:n,type:c=et.type,rotate:l,flip:s,viewBox:m=et.viewBox,...u}=e;if(!n)return I(ht,{});if(c==="svg"){if(n==="none")return I(tt,{...u,icon:n,size:t});let x=Jt(`${n}-icon`);return pt[x]?I(tt,{...u,icon:pt[x],size:t,themeColor:r,rotate:l,flip:s,viewBox:m}):I(ht,{})}return I(mt,{...u,icon:n,size:t,themeColor:r,rotate:l,flip:s})};M.states=Yt;M.options=Qt;M.defaultOptions=et;import{Fragment as jt,jsx as R,jsxs as ft}from"react/jsx-runtime";var U="k-button",Wt=[d.hover,d.focus,d.active,d.selected,d.disabled],Zt={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]},O={size:i.medium,rounded:h.medium,fillMode:f.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=O.size,rounded:r=O.rounded,fillMode:n=O.fillMode,themeColor:c=O.themeColor,showArrow:l=O.showArrow,arrowIconName:s=O.arrowIconName,hover:m,focus:u,active:x,selected:P,disabled:J,icon:Y,text:_,iconClassName:Tt,...At}=e,Ot=Y!==void 0,St=e.children!==void 0;return ft("button",{...At,className:a(e.className,U,b(U,{size:t,rounded:r,fillMode:n,themeColor:c}),y(U,{hover:m,focus:u,active:x,disabled:J,selected:P}),{"k-icon-button":!_&&!St&&Ot}),children:[Y&&R(M,{className:a(Tt,"k-button-icon"),icon:Y}),_?ft(jt,{children:[_&&R("span",{className:"k-button-text",children:_}),e.children]}):e.children&&R("span",{className:"k-button-text",children:e.children}),l&&R("span",{className:"k-menu-button-arrow k-button-arrow",children:R(M,{icon:s})})]})};p.states=Wt;p.options=Zt;p.className=U;p.defaultOptions=O;import{jsx as mo}from"react/jsx-runtime";import{jsx as fo}from"react/jsx-runtime";import{jsx as xo}from"react/jsx-runtime";import{Fragment as zo,jsx as Lo,jsxs as Eo}from"react/jsx-runtime";import{jsx as Ro}from"react/jsx-runtime";import{Fragment as ee,jsx as G,jsxs as oe}from"react/jsx-runtime";var te="k-card-body",X=e=>{let{title:t,subtitle:r,details:n,...c}=e;return oe("div",{...c,className:a(e.className,te),children:[t&&G(A,{children:t}),r&&G(E,{children:r}),G(ee,{children:e.children}),n&&G("span",{className:"k-card-header-actions",children:G(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as qo}from"react/jsx-runtime";import{jsx as ne}from"react/jsx-runtime";var q="k-actions",re=[],ae={},ot={alignment:"start",orientation:"horizontal"},B=e=>{let{alignment:t=ot.alignment,orientation:r=ot.orientation,...n}=e;return ne("div",{...n,className:a(q,{[`${q}-${t}`]:t,[`${q}-${r}`]:r},e.className),children:e.children})};B.states=re;B.options=ae;B.className=q;B.defaultOptions=ot;import{Fragment as sr,jsx as nr,jsxs as ir}from"react/jsx-runtime";import{Fragment as fr,jsx as pr,jsxs as hr}from"react/jsx-runtime";import{jsx as gt}from"react/jsx-runtime";var D="k-avatar";var ie=[d.hover,d.focus,d.active,d.selected,d.disabled],se={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:l=S.type,border:s=S.border,...m}=e;return gt("div",{...m,className:a(e.className,D,b(D,{size:t,rounded:r,fillMode:n,themeColor:c}),{[`${D}-bordered`]:s}),children:gt("span",{className:`${D}-${l}`,children:e.children})})};K.states=ie;K.options=se;K.className=D;K.defaultOptions=S;import{jsx as Hr}from"react/jsx-runtime";import{jsx as Gr}from"react/jsx-runtime";import{jsx as _r}from"react/jsx-runtime";import{jsx as v,jsxs as rt}from"react/jsx-runtime";var le="k-orgchart-node",vt={buttonIcon:"plus",details:!0},g=e=>{let{title:t,subtitle:r,details:n=vt.details,color:c,lineBottom:l,lineTop:s,button:m,buttonIcon:u=vt.buttonIcon,avatar:x,avatarType:P,...J}=e;return rt("div",{...J,className:a(e.className,le,"k-vstack","k-align-items-center"),children:[s&&v("div",{className:"k-orgchart-line k-orgchart-line-v"}),v(k,{className:"k-orgchart-card",children:rt(X,{className:"k-hstack",details:n,style:{borderTopColor:c},children:[v(K,{type:P,themeColor:"secondary",children:P==="image"?v("img",{src:x}):x}),rt("div",{className:"k-card-title-wrap k-vstack",children:[v(A,{className:"k-text-ellipsis",children:t}),v("span",{className:"k-spacer"}),v(E,{className:"k-text-ellipsis",children:r})]}),v("span",{className:"k-spacer"})]})}),l&&v("div",{className:"k-orgchart-line k-orgchart-line-v"}),m&&v(p,{className:"k-orgchart-button",icon:u})]})};import{Fragment as xt,jsx as at,jsxs as me}from"react/jsx-runtime";var Ct="k-orgchart-group",ce=[],de={},Nt={orientation:"horizontal"},N=e=>{let{children:t,orientation:r=Nt.orientation,justifyContent:n,...c}=e,l=[],s=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===g?l.push(m):s.push(m)}):t.type===g?l.push(t):s.push(t)),me("div",{...c,className:a(Ct,"k-pos-absolute",{[`k-${T.orientationMap[r]||r}`]:r,[`k-justify-content-${n}`]:n}),style:{width:"100%"},children:[l.length>0&&at("div",{className:a("k-orgchart-node-container","k-justify-content-around",{[`k-${T.orientationMap[r]||r}`]:r}),children:at(xt,{children:l})}),at(xt,{children:s})]})};N.states=ce;N.options=de;N.className=Ct;N.defaultOptions=Nt;import{jsx as L,jsxs as kt}from"react/jsx-runtime";var ue="k-orgchart-node-group",pe=[d.focus],yt={orientation:"horizontal",buttonIcon:"plus"},$=e=>{let{title:t,subtitle:r,lineBottom:n,lineTop:c,button:l,buttonIcon:s=yt.buttonIcon,focus:m,orientation:u=yt.orientation,...x}=e;return kt("div",{...x,className:a(e.className,ue,"k-vstack","k-align-items-center"),children:[c&&L("div",{className:"k-orgchart-line k-orgchart-line-v"}),kt("div",{className:a("k-orgchart-node-group-container","k-vstack",y("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-${T.orientationMap[u]||u}`]:u}),children:e.children})]}),n&&L("div",{className:"k-orgchart-line k-orgchart-line-v"}),l&&L(p,{className:"k-orgchart-button",icon:s})]})};$.states=pe;import{jsx as ma,jsxs as ua}from"react/jsx-runtime";import{jsx as ga,jsxs as ba}from"react/jsx-runtime";import{jsx as Na,jsxs as ya}from"react/jsx-runtime";import{jsx as z,jsxs as nt}from"react/jsx-runtime";var Ha=({details:e,orientation:t,justifyContent:r,...n})=>z(C,{children:nt(N,{orientation:t,justifyContent:r,children:[nt($,{title:"Group Title",subtitle:"Group SubTitle",orientation:"vertical",children:[z(g,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#5bc0de"}),z(g,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#5bc0de"}),z(g,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#5bc0de"})]}),nt($,{title:"Group Title",subtitle:"Group SubTitle",orientation:"vertical",children:[z(g,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#5bc0de"}),z(g,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#5bc0de"})]})]}),...n});export{Ha as OrgchartGroupVertical};