@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 12.1 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});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"},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",Ot=[],St={},J={width:"100%",height:"300px"},N=e=>{let{width:t=J.width,height:r=J.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=Ot;N.options=St;N.className=nt;N.defaultOptions=J;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 Et,jsx as st,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]},zt={},y=e=>{let{orientation:t,themeColor:r,callout:n,hover:c,focus:l,selected:s,disabled:m,...u}=e;return Ht("div",{...u,className:a(e.className,P,g(P,{themeColor:r}),C(P,{hover:c,focus:l,disabled:m,selected:s}),{[`k-card-${t}`]:t,"k-card-with-callout":n}),children:[n&&n!=="true"&&st(it,{callout:n}),st(Et,{children:e.children})]})};y.states=Kt;y.options=Lt;y.className=P;y.defaultOptions=zt;import{jsx as It}from"react/jsx-runtime";var Y="k-card-title",wt=[d.hover,d.focus],T=e=>{let{hover:t,focus:r,...n}=e;return It("div",{...n,className:a(e.className,Y,C(Y,{hover:t,focus:r})),children:e.children})};T.states=wt;T.className=Y;import{jsx as Gt}from"react/jsx-runtime";var Rt="k-card-subtitle",z=e=>{let{...t}=e;return Gt("div",{...t,className:a(e.className,Rt),children:e.children})};import{Fragment as De,jsx as Ge}from"react/jsx-runtime";import{Fragment as _t,jsx as lt}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={},E=e=>{let{size:t,themeColor:r,icon:n,rotate:c,flip:l,...s}=e;return n?lt("span",{...s,className:a(e.className,Q,g(Q,{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"})}):lt(_t,{})};E.states=Dt;E.options=$t;E.className=Q;E.defaultOptions=Pt;var ct=E;import{Fragment as Ut,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:l=dt.viewBox,icon:s,...m}=e;if(!s)return _(Ut,{});s==="none"&&{...m,className:a(e.className,W,"k-none")};let u=typeof s=="object"&&s.name&&s.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 s=="object"?s.viewBox:l,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?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 w}from"react/jsx-runtime";var Xt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),qt=[],Jt={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:l,flip:s,viewBox:m=j.viewBox,...u}=e;if(!n)return w(ut,{});if(c==="svg"){if(n==="none")return w(Z,{...u,icon:n,size:t});let v=Xt(`${n}-icon`);return mt[v]?w(Z,{...u,icon:mt[v],size:t,themeColor:r,rotate:l,flip:s,viewBox:m}):w(ut,{})}return w(ct,{...u,icon:n,size:t,themeColor:r,rotate:l,flip:s})};M.states=qt;M.options=Jt;M.defaultOptions=j;import{Fragment as Wt,jsx as I,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:l=A.showArrow,arrowIconName:s=A.arrowIconName,hover:m,focus:u,active:v,selected:D,disabled:X,icon:q,text:$,iconClassName:yt,...kt}=e,Tt=q!==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:X,selected:D}),{"k-icon-button":!$&&!At&&Tt}),children:[q&&I(M,{className:a(yt,"k-button-icon"),icon:q}),$?pt(Wt,{children:[$&&I("span",{className:"k-button-text",children:$}),e.children]}):e.children&&I("span",{className:"k-button-text",children:e.children}),l&&I("span",{className:"k-menu-button-arrow k-button-arrow",children:I(M,{icon:s})})]})};p.states=Yt;p.options=Qt;p.className=F;p.defaultOptions=A;import{jsx as lo}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 wo}from"react/jsx-runtime";import{Fragment as jt,jsx as R,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&&R(T,{children:t}),r&&R(z,{children:r}),R(jt,{children:e.children}),n&&R("span",{className:"k-card-header-actions",children:R(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as Uo}from"react/jsx-runtime";import{jsx as re}from"react/jsx-runtime";var U="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(U,{[`${U}-${t}`]:t,[`${U}-${r}`]:r},e.className),children:e.children})};B.states=ee;B.options=oe;B.className=U;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]},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:l=O.type,border:s=O.border,...m}=e;return ht("div",{...m,className:a(e.className,G,g(G,{size:t,rounded:r,fillMode:n,themeColor:c}),{[`${G}-bordered`]:s}),children:ht("span",{className:`${G}-${l}`,children:e.children})})};K.states=ae;K.options=ne;K.className=G;K.defaultOptions=O;import{jsx as zr}from"react/jsx-runtime";import{jsx as Ir}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},S=e=>{let{title:t,subtitle:r,details:n=gt.details,color:c,lineBottom:l,lineTop:s,button:m,buttonIcon:u=gt.buttonIcon,avatar:v,avatarType:D,...X}=e;return et("div",{...X,className:a(e.className,ie,"k-vstack","k-align-items-center"),children:[s&&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(z,{className:"k-text-ellipsis",children:r})]}),b("span",{className:"k-spacer"})]})}),l&&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 se="k-orgchart-node-group",le=[d.focus],bt={orientation:"horizontal",buttonIcon:"plus"},ot=e=>{let{title:t,subtitle:r,lineBottom:n,lineTop:c,button:l,buttonIcon:s=bt.buttonIcon,focus:m,orientation:u=bt.orientation,...v}=e;return vt("div",{...v,className:a(e.className,se,"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"}),l&&L(p,{className:"k-orgchart-button",icon:s})]})};ot.states=le;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,l=[],s=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===S?l.push(m):s.push(m)}):t.type===S?l.push(t):s.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:[l.length>0&&rt("div",{className:a("k-orgchart-node-container","k-justify-content-around",{[`k-${k.orientationMap[r]||r}`]:r}),children:rt(xt,{children:l})}),rt(xt,{children:s})]})};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};