UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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