UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.22 kB
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((s,r)=>e[r]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var v=(t,e)=>a({[`${t}-xs`]:e.size==="xsmall",[`${t}-sm`]:e.size==="small",[`${t}-md`]:e.size==="medium",[`${t}-lg`]:e.size==="large",[`${t}-xl`]:e.size==="xlarge",[`${t}-xxl`]:e.size==="xxlarge",[`${t}-xxxl`]:e.size==="xxxlarge"},{[`${t}-${e.fillMode}`]:e.fillMode},{[`${t}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),w=(t,e)=>{let{valid:s,invalid:r,hover:l,focus:c,checked:i,active:u,selected:d,disabled:h,indeterminate:_,loading:L,empty:$,readonly:C,highlighted:b,...O}=e;return a({"k-valid":s,"k-invalid":r,"k-hover":l,"k-focus":c,"k-checked":i,"k-active":u,"k-selected":d,"k-disabled":h,"k-indeterminate":_&&!i,"k-loading":L,"k-empty":$,"k-readonly":C,"k-highlighted":b},Object.keys(O).reduce((M,x)=>(x.startsWith("k-")?M[x]=O[x]:M[`k-${x}`]=O[x],M),{}))};function U(t,e){if(!e)return{};let s=Array.isArray(e)?e:[e];return Object.fromEntries(s.map(r=>[`k-${r}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},k={small:"small",medium:"medium",large:"large",full:"full"},g={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"},p={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"},D={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{Fragment as se,jsx as V}from"react/jsx-runtime";var K="k-font-icon",te=[],ne={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},re={},T=t=>{let{size:e,themeColor:s,icon:r,rotate:l,flip:c,...i}=t;return r?V("span",{...i,className:a(t.className,K,v(K,{size:e}),{[`k-i-${r}`]:r,[`k-color-${s}`]:s,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):V(se,{})};T.states=te;T.options=ne;T.className=K;T.defaultOptions=re;var q=T;import{Fragment as le,jsx as z}from"react/jsx-runtime";var R="k-svg-icon",ie=[],ae={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.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"},B=t=>{let{size:e,themeColor:s,rotate:r,flip:l,viewBox:c=j.viewBox,icon:i,...u}=t;if(!i)return z(le,{});i==="none"&&{...u,className:a(t.className,R,"k-none")};let d=typeof i=="object"&&i.name&&i.name;return z("span",{...u,className:a(t.className,R,v("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:z("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:c,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};B.states=ie;B.options=ae;B.className=R;B.defaultOptions=j;var H=B;import*as F from"@progress/kendo-svg-icons";var W="icon",J="icons";import{Fragment as Q,jsx as I}from"react/jsx-runtime";var E="k-icon",ce=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),de=[],me={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},G={viewBox:"0 0 24 24",type:"svg"},f=t=>{let{size:e,themeColor:s,icon:r,type:l=G.type,rotate:c,flip:i,viewBox:u=G.viewBox,...d}=t;if(!r)return I(Q,{});if(l==="svg"){if(r==="none")return I(H,{...d,className:a(t.className,E),icon:r,size:e});let h=F[r]?r:ce(`${r}-icon`);return F[h]?I(H,{...d,className:a(t.className,E),icon:F[h],size:e,themeColor:s,rotate:c,flip:i,viewBox:u}):I(Q,{})}return I(q,{...d,className:a(t.className,E),icon:r,size:e,themeColor:s,rotate:c,flip:i})};f.states=de;f.options=me;f.defaultOptions=G;f.className=E;f.moduleName=W;f.folderName=J;var P="button",X=P;import{Fragment as he,jsx as S,jsxs as Y}from"react/jsx-runtime";var A="k-button",ue=["icon-button"],pe=[p.hover,p.focus,p.active,p.selected,p.disabled,p.generating],fe={size:[n.small,n.medium,n.large],rounded:[k.small,k.medium,k.large,k.full],fillMode:[g.solid,g.flat,g.outline,g.clear,g.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},N={size:n.medium,rounded:k.medium,fillMode:g.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=t=>{let{size:e=N.size,rounded:s=N.rounded,fillMode:r=N.fillMode,themeColor:l=N.themeColor,showArrow:c=N.showArrow,arrowIconName:i=N.arrowIconName,variant:u,hover:d,focus:h,active:_,selected:L,disabled:$,icon:C,text:b,iconClassName:O,...M}=t,x=C!==void 0,oe=t.children!==void 0;return Y("button",{...M,className:a(t.className,A,U(A,u),v(A,{size:e,rounded:s,fillMode:r,themeColor:l}),w(A,{hover:d,focus:h,active:_,disabled:$,selected:L}),{"k-icon-button":!b&&!oe&&x}),children:[C&&S(f,{className:a(O,"k-button-icon"),icon:C}),b?Y(he,{children:[b&&S("span",{className:"k-button-text",children:b}),t.children]}):t.children&&S("span",{className:"k-button-text",children:t.children}),c&&S("span",{className:"k-menu-button-arrow k-button-arrow",children:S(f,{icon:i})})]})};m.states=pe;m.options=fe;m.variants=ue;m.className=A;m.defaultOptions=N;m.moduleName=P;m.folderName=X;import{jsx as Ye}from"react/jsx-runtime";import{jsx as to}from"react/jsx-runtime";import{jsx as io}from"react/jsx-runtime";import{jsx as y,jsxs as ee}from"react/jsx-runtime";var xe="k-orgchart-node-group",ge=[p.focus],Z={orientation:"horizontal",buttonIcon:"plus"},Ne=t=>{let{title:e,subtitle:s,lineBottom:r,lineTop:l,button:c,buttonIcon:i=Z.buttonIcon,focus:u,orientation:d=Z.orientation,...h}=t;return ee("div",{...h,className:a(t.className,xe,"k-vstack","k-align-items-center"),children:[l&&y("div",{className:"k-orgchart-line k-orgchart-line-v"}),ee("div",{className:a("k-orgchart-node-group-container","k-vstack",w("k-orgchart-node-group-container",{focus:u})),children:[e&&y("div",{className:"k-orgchart-node-group-title",children:e}),s&&y("div",{className:"k-orgchart-node-group-subtitle",children:s}),y("div",{className:a("k-orgchart-node-container",{[`k-${D.orientationMap[d]||d}`]:d}),children:t.children})]}),r&&y("div",{className:"k-orgchart-line k-orgchart-line-v"}),c&&y(m,{className:"k-orgchart-button",icon:i})]})};Ne.states=ge;export{xe as ORGCHARTNODEGROUP_CLASSNAME,Ne as OrgchartNodeGroup};