UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.6 kB
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"}),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,"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"},T={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as nt}from"react/jsx-runtime";var it="k-orgchart",Ot=[],Mt={},Y={width:"100%",height:"300px"},C=e=>{let{width:t=Y.width,height:r=Y.height,...n}=e;return nt("div",{...n,className:a(e.className,it),children:nt("div",{className:"k-orgchart-container",style:{width:t,height:r},children:e.children})})};C.states=Ot;C.options=Mt;C.className=it;C.defaultOptions=Y;import{jsx as Kt}from"react/jsx-runtime";var Bt="k-card-callout",lt=e=>{let{callout:t,...r}=e;return Kt("span",{...r,className:a(e.className,Bt,{[`k-callout-${T.calloutMap[t]||t}`]:t})})};import{Fragment as Ht,jsx as st,jsxs as Rt}from"react/jsx-runtime";var P="k-card",Lt=[d.hover,d.focus,d.selected,d.disabled],Et={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},zt={},k=e=>{let{orientation:t,themeColor:r,callout:n,hover:c,focus:s,selected:l,disabled:m,...u}=e;return Rt("div",{...u,className:a(e.className,P,g(P,{themeColor:r}),y(P,{hover:c,focus:s,disabled:m,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":n}),children:[n&&n!=="true"&&st(lt,{callout:n}),st(Ht,{children:e.children})]})};k.states=Lt;k.options=Et;k.className=P;k.defaultOptions=zt;import{jsx as It}from"react/jsx-runtime";var Q="k-card-title",wt=[d.hover,d.focus],A=e=>{let{hover:t,focus:r,...n}=e;return It("div",{...n,className:a(e.className,Q,y(Q,{hover:t,focus:r})),children:e.children})};A.states=wt;A.className=Q;import{jsx as Dt}from"react/jsx-runtime";var Gt="k-card-subtitle",E=e=>{let{...t}=e;return Dt("div",{...t,className:a(e.className,Gt),children:e.children})};import{Fragment as Pe,jsx as $e}from"react/jsx-runtime";import{Fragment as Ft,jsx as ct}from"react/jsx-runtime";var W="k-icon k-font-icon",$t=[],Pt={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]},_t={},z=e=>{let{size:t,themeColor:r,icon:n,rotate:c,flip:s,...l}=e;return n?ct("span",{...l,className:a(e.className,W,g(W,{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"})}):ct(Ft,{})};z.states=$t;z.options=Pt;z.className=W;z.defaultOptions=_t;var dt=z;import{Fragment as Ut,jsx as _}from"react/jsx-runtime";var Z="k-icon k-svg-icon",Vt=[],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]},mt={viewBox:"0 0 24 24"},H=e=>{let{size:t,themeColor:r,rotate:n,flip:c,viewBox:s=mt.viewBox,icon:l,...m}=e;if(!l)return _(Ut,{});l==="none"&&{...m,className:a(e.className,Z,"k-none")};let u=typeof l=="object"&&l.name&&l.name;return _("span",{...m,className:a(e.className,Z,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=Vt;H.options=Xt;H.className=Z;H.defaultOptions=mt;var j=H;import*as ut from"@progress/kendo-svg-icons";import{Fragment as pt,jsx as R}from"react/jsx-runtime";var Jt=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:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},tt={viewBox:"0 0 24 24",type:"svg"},M=e=>{let{size:t,themeColor:r,icon:n,type:c=tt.type,rotate:s,flip:l,viewBox:m=tt.viewBox,...u}=e;if(!n)return R(pt,{});if(c==="svg"){if(n==="none")return R(j,{...u,icon:n,size:t});let x=Jt(`${n}-icon`);return ut[x]?R(j,{...u,icon:ut[x],size:t,themeColor:r,rotate:s,flip:l,viewBox:m}):R(pt,{})}return R(dt,{...u,icon:n,size:t,themeColor:r,rotate:s,flip:l})};M.states=qt;M.options=Yt;M.defaultOptions=tt;import{Fragment as Zt,jsx as w,jsxs as ht}from"react/jsx-runtime";var F="k-button",Qt=[d.hover,d.focus,d.active,d.selected,d.disabled],Wt={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]},S={size:i.medium,rounded:h.medium,fillMode:f.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=S.size,rounded:r=S.rounded,fillMode:n=S.fillMode,themeColor:c=S.themeColor,showArrow:s=S.showArrow,arrowIconName:l=S.arrowIconName,hover:m,focus:u,active:x,selected:D,disabled:J,icon:q,text:$,iconClassName:kt,...Tt}=e,At=q!==void 0,St=e.children!==void 0;return ht("button",{...Tt,className:a(e.className,F,g(F,{size:t,rounded:r,fillMode:n,themeColor:c}),y(F,{hover:m,focus:u,active:x,disabled:J,selected:D}),{"k-icon-button":!$&&!St&&At}),children:[q&&w(M,{className:a(kt,"k-button-icon"),icon:q}),$?ht(Zt,{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=Qt;p.options=Wt;p.className=F;p.defaultOptions=S;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 Eo,jsx as Lo,jsxs as zo}from"react/jsx-runtime";import{jsx as Io}from"react/jsx-runtime";import{Fragment as te,jsx as I,jsxs as ee}from"react/jsx-runtime";var jt="k-card-body",V=e=>{let{title:t,subtitle:r,details:n,...c}=e;return ee("div",{...c,className:a(e.className,jt),children:[t&&I(A,{children:t}),r&&I(E,{children:r}),I(te,{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 Jo}from"react/jsx-runtime";import{jsx as ae}from"react/jsx-runtime";var X="k-actions",oe=[],re={},et={alignment:"start",orientation:"horizontal"},B=e=>{let{alignment:t=et.alignment,orientation:r=et.orientation,...n}=e;return ae("div",{...n,className:a(X,{[`${X}-${t}`]:t,[`${X}-${r}`]:r},e.className),children:e.children})};B.states=oe;B.options=re;B.className=X;B.defaultOptions=et;import{Fragment as lr,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 ft}from"react/jsx-runtime";var G="k-avatar";var ne=[d.hover,d.focus,d.active,d.selected,d.disabled],ie={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]},O={type:"text",size:i.medium,rounded:h.full,fillMode:f.solid,themeColor:o.primary,border:!1},K=e=>{let{size:t=O.size,rounded:r=O.rounded,fillMode:n=O.fillMode,themeColor:c=O.themeColor,type:s=O.type,border:l=O.border,...m}=e;return ft("div",{...m,className:a(e.className,G,g(G,{size:t,rounded:r,fillMode:n,themeColor:c}),{[`${G}-bordered`]:l}),children:ft("span",{className:`${G}-${s}`,children:e.children})})};K.states=ne;K.options=ie;K.className=G;K.defaultOptions=O;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 b,jsxs as ot}from"react/jsx-runtime";var le="k-orgchart-node",bt={buttonIcon:"plus",details:!0},v=e=>{let{title:t,subtitle:r,details:n=bt.details,color:c,lineBottom:s,lineTop:l,button:m,buttonIcon:u=bt.buttonIcon,avatar:x,avatarType:D,...J}=e;return ot("div",{...J,className:a(e.className,le,"k-vstack","k-align-items-center"),children:[l&&b("div",{className:"k-orgchart-line k-orgchart-line-v"}),b(k,{className:"k-orgchart-card",children:ot(V,{className:"k-hstack",details:n,style:{borderTopColor:c},children:[b(K,{type:D,themeColor:"secondary",children:D==="image"?b("img",{src:x}):x}),ot("div",{className:"k-card-title-wrap k-vstack",children:[b(A,{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{Fragment as vt,jsx as rt,jsxs as de}from"react/jsx-runtime";var xt="k-orgchart-group",se=[],ce={},Ct={orientation:"horizontal"},N=e=>{let{children:t,orientation:r=Ct.orientation,justifyContent:n,...c}=e,s=[],l=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===v?s.push(m):l.push(m)}):t.type===v?s.push(t):l.push(t)),de("div",{...c,className:a(xt,"k-pos-absolute",{[`k-${T.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-${T.orientationMap[r]||r}`]:r}),children:rt(vt,{children:s})}),rt(vt,{children:l})]})};N.states=se;N.options=ce;N.className=xt;N.defaultOptions=Ct;import{jsx as L,jsxs as yt}from"react/jsx-runtime";var me="k-orgchart-node-group",ue=[d.focus],Nt={orientation:"horizontal",buttonIcon:"plus"},at=e=>{let{title:t,subtitle:r,lineBottom:n,lineTop:c,button:s,buttonIcon:l=Nt.buttonIcon,focus:m,orientation:u=Nt.orientation,...x}=e;return yt("div",{...x,className:a(e.className,me,"k-vstack","k-align-items-center"),children:[c&&L("div",{className:"k-orgchart-line k-orgchart-line-v"}),yt("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"}),s&&L(p,{className:"k-orgchart-button",icon:l})]})};at.states=ue;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 U,jsxs as pe}from"react/jsx-runtime";var Ha=({details:e,justifyContent:t,...r})=>U(C,{children:pe(N,{justifyContent:t,children:[U(v,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#0275d8",lineBottom:!0,button:!0}),U(v,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#0275d8",lineBottom:!0,button:!0}),U(v,{title:"Card Title",subtitle:"Card, Subtitle",details:e,avatar:"DK",avatarType:"text",color:"#0275d8",lineBottom:!0,button:!0})]}),...r});export{Ha as OrgchartNormal};