UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.8 kB
var Rt=Object.create;var X=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var It=Object.getOwnPropertyNames;var Gt=Object.getPrototypeOf,Dt=Object.prototype.hasOwnProperty;var $t=(e,t)=>{for(var r in t)X(e,r,{get:t[r],enumerable:!0})},ut=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of It(t))!Dt.call(e,l)&&l!==r&&X(e,l,{get:()=>t[l],enumerable:!(a=wt(t,l))||a.enumerable});return e};var Pt=(e,t,r)=>(r=e!=null?Rt(Gt(e)):{},ut(t||!e||!e.__esModule?X(r,"default",{value:e,enumerable:!0}):r,e)),_t=e=>ut(X({},"__esModule",{value:!0}),e);var Se={};$t(Se,{ORGCHARTGROUP_CLASSNAME:()=>mt,OrgchartGroup:()=>N,default:()=>Ae});module.exports=_t(Se);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,"k-highlighted":t.highlighted});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",highlighted:"highlighted"},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"},S=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})})};S.states=Ft;S.options=Vt;S.className=pt;S.defaultOptions=Z;var ft=require("react/jsx-runtime"),Xt="k-card-callout",ht=e=>{let{callout:t,...r}=e;return(0,ft.jsx)("span",{...r,className:n(e.className,Xt,{[`k-callout-${M.calloutMap[t]||t}`]:t})})};var B=require("react/jsx-runtime"),U="k-card",Ut=[d.hover,d.focus,d.selected,d.disabled],Jt={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},qt={},O=e=>{let{orientation:t,themeColor:r,callout:a,hover:l,focus:c,selected:s,disabled:m,...u}=e;return(0,B.jsxs)("div",{...u,className:n(e.className,U,v(U,{themeColor:r}),A(U,{hover:l,focus:c,disabled:m,selected:s}),{[`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})]})};O.states=Ut;O.options=Jt;O.className=U;O.defaultOptions=qt;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:l,flip:c,...s}=e;return a?(0,D.jsx)("span",{...s,className:n(e.className,et,v(et,{size:t}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"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:l,viewBox:c=Ct.viewBox,icon:s,...m}=e;if(!s)return(0,L.jsx)(L.Fragment,{});s==="none"&&{...m,className:n(e.className,ot,"k-none")};let u=typeof s=="object"&&s.name&&s.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":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:(0,L.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:c,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?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"},R=e=>{let{size:t,themeColor:r,icon:a,type:l=at.type,rotate:c,flip:s,viewBox:m=at.viewBox,...u}=e;if(!a)return(0,k.jsx)(k.Fragment,{});if(l==="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:s,viewBox:m}):(0,k.jsx)(k.Fragment,{})}return(0,k.jsx)(xt,{...u,icon:a,size:t,themeColor:r,rotate:c,flip:s})};R.states=re;R.options=ae;R.defaultOptions=at;var b=require("react/jsx-runtime"),J="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]},E={size:i.medium,rounded:f.medium,fillMode:g.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=e=>{let{size:t=E.size,rounded:r=E.rounded,fillMode:a=E.fillMode,themeColor:l=E.themeColor,showArrow:c=E.showArrow,arrowIconName:s=E.arrowIconName,hover:m,focus:u,active:y,selected:F,disabled:Q,icon:W,text:V,iconClassName:Lt,...Et}=e,zt=W!==void 0,Ht=e.children!==void 0;return(0,b.jsxs)("button",{...Et,className:n(e.className,J,v(J,{size:t,rounded:r,fillMode:a,themeColor:l}),A(J,{hover:m,focus:u,active:y,disabled:Q,selected:F}),{"k-icon-button":!V&&!Ht&&zt}),children:[W&&(0,b.jsx)(R,{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)(R,{icon:s})})]})};p.states=ne;p.options=ie;p.className=J;p.defaultOptions=E;var le=require("react/jsx-runtime");var se=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",q=e=>{let{title:t,subtitle:r,details:a,...l}=e;return(0,x.jsxs)("div",{...l,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"},w=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})};w.states=pe;w.options=he;w.className=Y;w.defaultOptions=it;var lt=require("react/jsx-runtime");var st=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]},z={type:"text",size:i.medium,rounded:f.full,fillMode:g.solid,themeColor:o.primary,border:!1},I=e=>{let{size:t=z.size,rounded:r=z.rounded,fillMode:a=z.fillMode,themeColor:l=z.themeColor,type:c=z.type,border:s=z.border,...m}=e;return(0,ct.jsx)("div",{...m,className:n(e.className,_,v(_,{size:t,rounded:r,fillMode:a,themeColor:l}),{[`${_}-bordered`]:s}),children:(0,ct.jsx)("span",{className:`${_}-${c}`,children:e.children})})};I.states=fe;I.options=ge;I.className=_;I.defaultOptions=z;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:l,lineBottom:c,lineTop:s,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:[s&&(0,h.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,h.jsx)(O,{className:"k-orgchart-card",children:(0,h.jsxs)(q,{className:"k-hstack",details:a,style:{borderTopColor:l},children:[(0,h.jsx)(I,{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:l,button:c,buttonIcon:s=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:[l&&(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:s})]})};dt.states=ye;var St=require("react/jsx-runtime");var Ot=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,...l}=e,c=[],s=[];return t&&(Array.isArray(t)?t.map(m=>{m.type===H?c.push(m):s.push(m)}):t.type===H?c.push(t):s.push(t)),(0,T.jsxs)("div",{...l,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:s})]})};N.states=ke;N.options=Te;N.className=mt;N.defaultOptions=Kt;var Ae=N;