UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.7 kB
var wt=Object.create;var U=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Gt=Object.getPrototypeOf,Dt=Object.prototype.hasOwnProperty;var $t=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},ut=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Rt(t))!Dt.call(e,s)&&s!==r&&U(e,s,{get:()=>t[s],enumerable:!(a=It(t,s))||a.enumerable});return e};var Pt=(e,t,r)=>(r=e!=null?wt(Gt(e)):{},ut(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),_t=e=>ut(U({},"__esModule",{value:!0}),e);var Oe={};$t(Oe,{ORGCHARTGROUP_CLASSNAME:()=>mt,OrgchartGroup:()=>N,default:()=>Ae});module.exports=_t(Oe);var n=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?n(...t):typeof t=="object"?Object.keys(t).map((r,a)=>t[a]||t[r]&&r||null).filter(r=>r!==null).join(" "):t).filter(t=>!!t).join(" ");var v=(e,t)=>n({[`${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"}),A=(e,t)=>n({"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"},f={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"},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"},M={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var j=require("react/jsx-runtime"),pt="k-orgchart",Ft=[],Vt={},Z={width:"100%",height:"300px"},O=e=>{let{width:t=Z.width,height:r=Z.height,...a}=e;return(0,j.jsx)("div",{...a,className:n(e.className,pt),children:(0,j.jsx)("div",{className:"k-orgchart-container",style:{width:t,height:r},children:e.children})})};O.states=Ft;O.options=Vt;O.className=pt;O.defaultOptions=Z;var ft=require("react/jsx-runtime"),Ut="k-card-callout",ht=e=>{let{callout:t,...r}=e;return(0,ft.jsx)("span",{...r,className:n(e.className,Ut,{[`k-callout-${M.calloutMap[t]||t}`]:t})})};var B=require("react/jsx-runtime"),X="k-card",Xt=[d.hover,d.focus,d.selected,d.disabled],qt={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Jt={},S=e=>{let{orientation:t,themeColor:r,callout:a,hover:s,focus:c,selected:l,disabled:m,...u}=e;return(0,B.jsxs)("div",{...u,className:n(e.className,X,v(X,{themeColor:r}),A(X,{hover:s,focus:c,disabled:m,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":a}),children:[a&&a!=="true"&&(0,B.jsx)(ht,{callout:a}),(0,B.jsx)(B.Fragment,{children:e.children})]})};S.states=Xt;S.options=qt;S.className=X;S.defaultOptions=Jt;var gt=require("react/jsx-runtime"),tt="k-card-title",Yt=[d.hover,d.focus],K=e=>{let{hover:t,focus:r,...a}=e;return(0,gt.jsx)("div",{...a,className:n(e.className,tt,A(tt,{hover:t,focus:r})),children:e.children})};K.states=Yt;K.className=tt;var bt=require("react/jsx-runtime"),Qt="k-card-subtitle",G=e=>{let{...t}=e;return(0,bt.jsx)("div",{...t,className:n(e.className,Qt),children:e.children})};var vt=require("react/jsx-runtime");var D=require("react/jsx-runtime"),et="k-icon k-font-icon",Wt=[],Zt={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]},jt={},$=e=>{let{size:t,themeColor:r,icon:a,rotate:s,flip:c,...l}=e;return a?(0,D.jsx)("span",{...l,className:n(e.className,et,v(et,{size:t}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,D.jsx)(D.Fragment,{})};$.states=Wt;$.options=Zt;$.className=et;$.defaultOptions=jt;var xt=$;var L=require("react/jsx-runtime"),ot="k-icon k-svg-icon",te=[],ee={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]},Ct={viewBox:"0 0 24 24"},P=e=>{let{size:t,themeColor:r,rotate:a,flip:s,viewBox:c=Ct.viewBox,icon:l,...m}=e;if(!l)return(0,L.jsx)(L.Fragment,{});l==="none"&&{...m,className:n(e.className,ot,"k-none")};let u=typeof l=="object"&&l.name&&l.name;return(0,L.jsx)("span",{...m,className:n(e.className,ot,v("k-icon",{size:t}),{[`k-svg-i-${u}`]:u,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),children:(0,L.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:e.children})})};P.states=te;P.options=ee;P.className=ot;P.defaultOptions=Ct;var rt=P;var Nt=Pt(require("@progress/kendo-svg-icons")),k=require("react/jsx-runtime"),oe=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),re=[],ae={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]},at={viewBox:"0 0 24 24",type:"svg"},w=e=>{let{size:t,themeColor:r,icon:a,type:s=at.type,rotate:c,flip:l,viewBox:m=at.viewBox,...u}=e;if(!a)return(0,k.jsx)(k.Fragment,{});if(s==="svg"){if(a==="none")return(0,k.jsx)(rt,{...u,icon:a,size:t});let y=oe(`${a}-icon`);return Nt[y]?(0,k.jsx)(rt,{...u,icon:Nt[y],size:t,themeColor:r,rotate:c,flip:l,viewBox:m}):(0,k.jsx)(k.Fragment,{})}return(0,k.jsx)(xt,{...u,icon:a,size:t,themeColor:r,rotate:c,flip:l})};w.states=re;w.options=ae;w.defaultOptions=at;var b=require("react/jsx-runtime"),q="k-button",ne=[d.hover,d.focus,d.active,d.selected,d.disabled],ie={size:[i.small,i.medium,i.large],rounded:[f.small,f.medium,f.large,f.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]},z={size:i.medium,rounded:f.medium,fillMode:g.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=z.size,rounded:r=z.rounded,fillMode:a=z.fillMode,themeColor:s=z.themeColor,showArrow:c=z.showArrow,arrowIconName:l=z.arrowIconName,hover:m,focus:u,active:y,selected:F,disabled:Q,icon:W,text:V,iconClassName:Lt,...zt}=e,Et=W!==void 0,Ht=e.children!==void 0;return(0,b.jsxs)("button",{...zt,className:n(e.className,q,v(q,{size:t,rounded:r,fillMode:a,themeColor:s}),A(q,{hover:m,focus:u,active:y,disabled:Q,selected:F}),{"k-icon-button":!V&&!Ht&&Et}),children:[W&&(0,b.jsx)(w,{className:n(Lt,"k-button-icon"),icon:W}),V?(0,b.jsxs)(b.Fragment,{children:[V&&(0,b.jsx)("span",{className:"k-button-text",children:V}),e.children]}):e.children&&(0,b.jsx)("span",{className:"k-button-text",children:e.children}),c&&(0,b.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,b.jsx)(w,{icon:l})})]})};p.states=ne;p.options=ie;p.className=q;p.defaultOptions=z;var se=require("react/jsx-runtime");var le=require("react/jsx-runtime");var ce=require("react/jsx-runtime");var nt=require("react/jsx-runtime");var de=require("react/jsx-runtime");var x=require("react/jsx-runtime"),me="k-card-body",J=e=>{let{title:t,subtitle:r,details:a,...s}=e;return(0,x.jsxs)("div",{...s,className:n(e.className,me),children:[t&&(0,x.jsx)(K,{children:t}),r&&(0,x.jsx)(G,{children:r}),(0,x.jsx)(x.Fragment,{children:e.children}),a&&(0,x.jsx)("span",{className:"k-card-header-actions",children:(0,x.jsx)(p,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var ue=require("react/jsx-runtime");var yt=require("react/jsx-runtime"),Y="k-actions",pe=[],he={},it={alignment:"start",orientation:"horizontal"},I=e=>{let{alignment:t=it.alignment,orientation:r=it.orientation,...a}=e;return(0,yt.jsx)("div",{...a,className:n(Y,{[`${Y}-${t}`]:t,[`${Y}-${r}`]:r},e.className),children:e.children})};I.states=pe;I.options=he;I.className=Y;I.defaultOptions=it;var st=require("react/jsx-runtime");var lt=require("react/jsx-runtime");var ct=require("react/jsx-runtime"),_="k-avatar";var fe=[d.hover,d.focus,d.active,d.selected,d.disabled],ge={size:[i.small,i.medium,i.large],rounded:[f.small,f.medium,f.large,f.full],fillMode:[g.solid,g.flat,g.outline],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},E={type:"text",size:i.medium,rounded:f.full,fillMode:g.solid,themeColor:o.primary,border:!1},R=e=>{let{size:t=E.size,rounded:r=E.rounded,fillMode:a=E.fillMode,themeColor:s=E.themeColor,type:c=E.type,border:l=E.border,...m}=e;return(0,ct.jsx)("div",{...m,className:n(e.className,_,v(_,{size:t,rounded:r,fillMode:a,themeColor:s}),{[`${_}-bordered`]:l}),children:(0,ct.jsx)("span",{className:`${_}-${c}`,children:e.children})})};R.states=fe;R.options=ge;R.className=_;R.defaultOptions=E;var be=require("react/jsx-runtime");var ve=require("react/jsx-runtime");var xe=require("react/jsx-runtime");var h=require("react/jsx-runtime"),Ce="k-orgchart-node",Tt={buttonIcon:"plus",details:!0},H=e=>{let{title:t,subtitle:r,details:a=Tt.details,color:s,lineBottom:c,lineTop:l,button:m,buttonIcon:u=Tt.buttonIcon,avatar:y,avatarType:F,...Q}=e;return(0,h.jsxs)("div",{...Q,className:n(e.className,Ce,"k-vstack","k-align-items-center"),children:[l&&(0,h.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,h.jsx)(S,{className:"k-orgchart-card",children:(0,h.jsxs)(J,{className:"k-hstack",details:a,style:{borderTopColor:s},children:[(0,h.jsx)(R,{type:F,themeColor:"secondary",children:F==="image"?(0,h.jsx)("img",{src:y}):y}),(0,h.jsxs)("div",{className:"k-card-title-wrap k-vstack",children:[(0,h.jsx)(K,{className:"k-text-ellipsis",children:t}),(0,h.jsx)("span",{className:"k-spacer"}),(0,h.jsx)(G,{className:"k-text-ellipsis",children:r})]}),(0,h.jsx)("span",{className:"k-spacer"})]})}),c&&(0,h.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),m&&(0,h.jsx)(p,{className:"k-orgchart-button",icon:u})]})};var C=require("react/jsx-runtime"),Ne="k-orgchart-node-group",ye=[d.focus],At={orientation:"horizontal",buttonIcon:"plus"},dt=e=>{let{title:t,subtitle:r,lineBottom:a,lineTop:s,button:c,buttonIcon:l=At.buttonIcon,focus:m,orientation:u=At.orientation,...y}=e;return(0,C.jsxs)("div",{...y,className:n(e.className,Ne,"k-vstack","k-align-items-center"),children:[s&&(0,C.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,C.jsxs)("div",{className:n("k-orgchart-node-group-container","k-vstack",A("k-orgchart-node-group-container",{focus:m})),children:[t&&(0,C.jsx)("div",{className:"k-orgchart-node-group-title",children:t}),r&&(0,C.jsx)("div",{className:"k-orgchart-node-group-subtitle",children:r}),(0,C.jsx)("div",{className:n("k-orgchart-node-container",{[`k-${M.orientationMap[u]||u}`]:u}),children:e.children})]}),a&&(0,C.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),c&&(0,C.jsx)(p,{className:"k-orgchart-button",icon:l})]})};dt.states=ye;var Ot=require("react/jsx-runtime");var St=require("react/jsx-runtime");var Mt=require("react/jsx-runtime");var Bt=require("react/jsx-runtime");var T=require("react/jsx-runtime"),mt="k-orgchart-group",ke=[],Te={},Kt={orientation:"horizontal"},N=e=>{let{children:t,orientation:r=Kt.orientation,justifyContent:a,...s}=e,c=[],l=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===H?c.push(m):l.push(m)}):t.type===H?c.push(t):l.push(t)),(0,T.jsxs)("div",{...s,className:n(mt,"k-pos-absolute",{[`k-${M.orientationMap[r]||r}`]:r,[`k-justify-content-${a}`]:a}),style:{width:"100%"},children:[c.length>0&&(0,T.jsx)("div",{className:n("k-orgchart-node-container","k-justify-content-around",{[`k-${M.orientationMap[r]||r}`]:r}),children:(0,T.jsx)(T.Fragment,{children:c})}),(0,T.jsx)(T.Fragment,{children:l})]})};N.states=ke;N.options=Te;N.className=mt;N.defaultOptions=Kt;var Ae=N;