UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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