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 Xe=Object.create;var j=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Ye=Object.getOwnPropertyNames;var Qe=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var je=(e,t)=>{for(var r in t)j(e,r,{get:t[r],enumerable:!0})},ve=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ye(t))!Ze.call(e,i)&&i!==r&&j(e,i,{get:()=>t[i],enumerable:!(n=Je(t,i))||n.enumerable});return e};var et=(e,t,r)=>(r=e!=null?Xe(Qe(e)):{},ve(t||!e||!e.__esModule?j(r,"default",{value:e,enumerable:!0}):r,e)),tt=e=>ve(j({},"__esModule",{value:!0}),e);var qt={};je(qt,{ORGCHARTNODE_CLASSNAME:()=>We,OrgchartNode:()=>Wt});module.exports=tt(qt);var a=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?a(...t):typeof t=="object"?Object.keys(t).map((r,n)=>t[n]||t[r]&&r||null).filter(r=>r!==null).join(" "):t).filter(t=>!!t).join(" ");var M=(e,t)=>a({[`${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"}),v=(e,t)=>{let{valid:r,invalid:n,hover:i,focus:c,checked:l,active:u,selected:f,disabled:y,indeterminate:B,loading:U,empty:ae,readonly:F,highlighted:H,...G}=t;return a({"k-valid":r,"k-invalid":n,"k-hover":i,"k-focus":c,"k-checked":l,"k-active":u,"k-selected":f,"k-disabled":y,"k-indeterminate":B&&!l,"k-loading":U,"k-empty":ae,"k-readonly":F,"k-highlighted":H},Object.keys(G).reduce((V,k)=>(k.startsWith("k-")?V[k]=G[k]:V[`k-${k}`]=G[k],V),{}))};function be(e,t){if(!t)return{};let r=Array.isArray(t)?t:[t];return Object.fromEntries(r.map(n=>[`k-${n}`,!0]))}var s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},N={small:"small",medium:"medium",large:"large",full:"full"},A={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",generating:"generating",expanded:"expanded"},Te={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var ge=require("react/jsx-runtime"),ot="k-card-callout",ye=e=>{let{callout:t,...r}=e;return(0,ge.jsx)("span",{...r,className:a(e.className,ot,{[`k-callout-${Te.calloutMap[t]||t}`]:t})})};var C="card",x=C;var S=require("react/jsx-runtime"),ee="k-card",rt=[d.hover,d.focus,d.selected,d.disabled],at={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},nt={},b=e=>{let{orientation:t,themeColor:r,callout:n,hover:i,focus:c,selected:l,disabled:u,...f}=e;return(0,S.jsxs)("div",{...f,className:a(e.className,ee,M(ee,{themeColor:r}),v(ee,{hover:i,focus:c,disabled:u,selected:l}),{[`k-card-${t}`]:t,"k-card-with-callout":n}),children:[n&&n!=="true"&&(0,S.jsx)(ye,{callout:n}),(0,S.jsx)(S.Fragment,{children:e.children})]})};b.states=rt;b.options=at;b.className=ee;b.defaultOptions=nt;b.moduleName=C;b.folderName=x;var W=require("react/jsx-runtime"),ne="k-card-list",st=[],it={},lt={},I=e=>{let{...t}=e;return(0,W.jsx)("div",{...t,className:a(e.className,ne,v(ne,{})),children:(0,W.jsx)(W.Fragment,{children:e.children})})};I.states=st;I.options=it;I.className=ne;I.defaultOptions=lt;I.moduleName=C;I.folderName=x;var Ee=require("react/jsx-runtime"),Le="k-card-group",dt=[],ct={},mt={},w=e=>{let{...t}=e;return(0,Ee.jsx)("div",{...t,className:a(e.className,Le),children:e.children})};w.states=dt;w.options=ct;w.className=Le;w.defaultOptions=mt;w.moduleName=C;w.folderName=x;var Oe=require("react/jsx-runtime"),se="k-card-wrap",pt=[d.focus,d.selected],ut={},ft={},z=e=>{let{focus:t,selected:r,...n}=e;return(0,Oe.jsx)("div",{...n,className:a(e.className,se,v(se,{focus:t,selected:r})),children:e.children})};z.states=pt;z.options=ut;z.className=se;z.defaultOptions=ft;z.moduleName=C;z.folderName=x;var ke=require("react/jsx-runtime"),ie="k-card-title",Ct=[d.hover,d.focus],_=e=>{let{hover:t,focus:r,...n}=e;return(0,ke.jsx)("div",{...n,className:a(e.className,ie,v(ie,{hover:t,focus:r})),children:e.children})};_.states=Ct;_.className=ie;var Se=require("react/jsx-runtime"),Nt="k-card-subtitle",q=e=>{let{...t}=e;return(0,Se.jsx)("div",{...t,className:a(e.className,Nt),children:e.children})};var _e=require("react/jsx-runtime");var X=require("react/jsx-runtime"),le="k-font-icon",At=[],xt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ht={},J=e=>{let{size:t,themeColor:r,icon:n,rotate:i,flip:c,...l}=e;return n?(0,X.jsx)("span",{...l,className:a(e.className,le,M(le,{size:t}),{[`k-i-${n}`]:n,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,X.jsx)(X.Fragment,{})};J.states=At;J.options=xt;J.className=le;J.defaultOptions=ht;var Ke=J;var K=require("react/jsx-runtime"),de="k-svg-icon",Mt=[],vt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},De={viewBox:"0 0 24 24"},Y=e=>{let{size:t,themeColor:r,rotate:n,flip:i,viewBox:c=De.viewBox,icon:l,...u}=e;if(!l)return(0,K.jsx)(K.Fragment,{});l==="none"&&{...u,className:a(e.className,de,"k-none")};let f=typeof l=="object"&&l.name&&l.name;return(0,K.jsx)("span",{...u,className:a(e.className,de,M("k-icon",{size:t}),{[`k-svg-i-${f}`]:f,[`k-color-${r}`]:r,[`k-rotate-${n}`]:n,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,K.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})})};Y.states=Mt;Y.options=vt;Y.className=de;Y.defaultOptions=De;var ce=Y;var me=et(require("@progress/kendo-svg-icons"));var Re="icon",Be="icons";var g=require("react/jsx-runtime"),te="k-icon",bt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Tt=[],yt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},pe={viewBox:"0 0 24 24",type:"svg"},L=e=>{let{size:t,themeColor:r,icon:n,type:i=pe.type,rotate:c,flip:l,viewBox:u=pe.viewBox,...f}=e;if(!n)return(0,g.jsx)(g.Fragment,{});if(i==="svg"){if(n==="none")return(0,g.jsx)(ce,{...f,className:a(e.className,te),icon:n,size:t});let y=me[n]?n:bt(`${n}-icon`);return me[y]?(0,g.jsx)(ce,{...f,className:a(e.className,te),icon:me[y],size:t,themeColor:r,rotate:c,flip:l,viewBox:u}):(0,g.jsx)(g.Fragment,{})}return(0,g.jsx)(Ke,{...f,className:a(e.className,te),icon:n,size:t,themeColor:r,rotate:c,flip:l})};L.states=Tt;L.options=yt;L.defaultOptions=pe;L.className=te;L.moduleName=Re;L.folderName=Be;var ue="button",He=ue;var h=require("react/jsx-runtime"),Q="k-button",gt=["icon-button"],Lt=[d.hover,d.focus,d.active,d.selected,d.disabled,d.generating],Et={size:[s.small,s.medium,s.large],rounded:[N.small,N.medium,N.large,N.full],fillMode:[A.solid,A.flat,A.outline,A.clear,A.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},D={size:s.medium,rounded:N.medium,fillMode:A.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=e=>{let{size:t=D.size,rounded:r=D.rounded,fillMode:n=D.fillMode,themeColor:i=D.themeColor,showArrow:c=D.showArrow,arrowIconName:l=D.arrowIconName,variant:u,hover:f,focus:y,active:B,selected:U,disabled:ae,icon:F,text:H,iconClassName:G,...V}=e,k=F!==void 0,qe=e.children!==void 0;return(0,h.jsxs)("button",{...V,className:a(e.className,Q,be(Q,u),M(Q,{size:t,rounded:r,fillMode:n,themeColor:i}),v(Q,{hover:f,focus:y,active:B,disabled:ae,selected:U}),{"k-icon-button":!H&&!qe&&k}),children:[F&&(0,h.jsx)(L,{className:a(G,"k-button-icon"),icon:F}),H?(0,h.jsxs)(h.Fragment,{children:[H&&(0,h.jsx)("span",{className:"k-button-text",children:H}),e.children]}):e.children&&(0,h.jsx)("span",{className:"k-button-text",children:e.children}),c&&(0,h.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,h.jsx)(L,{icon:l})})]})};m.states=Lt;m.options=Et;m.variants=gt;m.className=Q;m.defaultOptions=D;m.moduleName=ue;m.folderName=He;var Ot=require("react/jsx-runtime");var kt=require("react/jsx-runtime");var St=require("react/jsx-runtime");var fe=require("react/jsx-runtime");var _t=require("react/jsx-runtime");var T=require("react/jsx-runtime"),Kt="k-card-body",oe=e=>{let{title:t,subtitle:r,details:n,...i}=e;return(0,T.jsxs)("div",{...i,className:a(e.className,Kt),children:[t&&(0,T.jsx)(_,{children:t}),r&&(0,T.jsx)(q,{children:r}),(0,T.jsx)(T.Fragment,{children:e.children}),n&&(0,T.jsx)("span",{className:"k-card-header-actions",children:(0,T.jsx)(m,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var we=require("react/jsx-runtime"),Ie="k-card-deck",Dt=[],Rt={},Bt={},P=e=>{let{...t}=e;return(0,we.jsx)("div",{...t,className:a(e.className,Ie),children:e.children})};P.states=Dt;P.options=Rt;P.className=Ie;P.defaultOptions=Bt;P.moduleName=C;P.folderName=x;var Pe=require("react/jsx-runtime"),ze="k-card-deck-scrollwrap",Ht=[],It={},wt={},$=e=>{let{...t}=e;return(0,Pe.jsx)("div",{...t,className:a(e.className,ze),children:e.children})};$.states=Ht;$.options=It;$.className=ze;$.defaultOptions=wt;$.moduleName=C;$.folderName=x;var Ce="action-buttons",$e=Ce;var Ue=require("react/jsx-runtime"),re="k-actions",zt=[],Pt={},Ne={alignment:"start",orientation:"horizontal"},E=e=>{let{alignment:t=Ne.alignment,orientation:r=Ne.orientation,...n}=e;return(0,Ue.jsx)("div",{...n,className:a(re,{[`${re}-${t}`]:t,[`${re}-${r}`]:r},e.className),children:e.children})};E.states=zt;E.options=Pt;E.className=re;E.defaultOptions=Ne;E.moduleName=Ce;E.folderName=$e;var Ae=require("react/jsx-runtime");var xe=require("react/jsx-runtime");var he="avatar",Fe=he;var Me=require("react/jsx-runtime"),Z="k-avatar";var $t=[d.hover,d.focus,d.active,d.selected,d.disabled],Ut={size:[s.small,s.medium,s.large],rounded:[N.small,N.medium,N.large,N.full],fillMode:[A.solid,A.flat,A.outline],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},R={type:"text",size:s.medium,rounded:N.full,fillMode:A.solid,themeColor:o.primary,border:!1},O=e=>{let{size:t=R.size,rounded:r=R.rounded,fillMode:n=R.fillMode,themeColor:i=R.themeColor,type:c=R.type,border:l=R.border,...u}=e;return(0,Me.jsx)("div",{...u,className:a(e.className,Z,M(Z,{size:t,rounded:r,fillMode:n,themeColor:i}),{[`${Z}-bordered`]:l}),children:(0,Me.jsx)("span",{className:`${Z}-${c}`,children:e.children})})};O.states=$t;O.options=Ut;O.className=Z;O.defaultOptions=R;O.moduleName=he;O.folderName=Fe;var Ft=require("react/jsx-runtime");var Gt=require("react/jsx-runtime");var Vt=require("react/jsx-runtime");var p=require("react/jsx-runtime"),We="k-orgchart-node",Ve={buttonIcon:"plus",details:!0},Wt=e=>{let{title:t,subtitle:r,details:n=Ve.details,color:i,lineBottom:c,lineTop:l,button:u,buttonIcon:f=Ve.buttonIcon,avatar:y,avatarType:B,...U}=e;return(0,p.jsxs)("div",{...U,className:a(e.className,We,"k-vstack","k-align-items-center"),children:[l&&(0,p.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,p.jsx)(b,{className:"k-orgchart-card",children:(0,p.jsxs)(oe,{className:"k-hstack",details:n,style:{borderTopColor:i},children:[(0,p.jsx)(O,{type:B,themeColor:"secondary",children:B==="image"?(0,p.jsx)("img",{src:y}):y}),(0,p.jsxs)("div",{className:"k-card-title-wrap k-vstack",children:[(0,p.jsx)(_,{className:"k-text-ellipsis",children:t}),(0,p.jsx)("span",{className:"k-spacer"}),(0,p.jsx)(q,{className:"k-text-ellipsis",children:r})]}),(0,p.jsx)("span",{className:"k-spacer"})]})}),c&&(0,p.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),u&&(0,p.jsx)(m,{className:"k-orgchart-button",icon:f})]})};