UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 10.6 kB
var ge=Object.create;var D=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var Me=(t,e)=>{for(var r in e)D(t,r,{get:e[r],enumerable:!0})},oe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of Ne(e))!Ae.call(t,l)&&l!==r&&D(t,l,{get:()=>e[l],enumerable:!(a=ye(e,l))||a.enumerable});return t};var Se=(t,e,r)=>(r=t!=null?ge(ke(t)):{},oe(e||!t||!t.__esModule?D(r,"default",{value:t,enumerable:!0}):r,t)),Te=t=>oe(D({},"__esModule",{value:!0}),t);var at={};Me(at,{ORGCHARTNODE_CLASSNAME:()=>he,OrgchartNode:()=>rt});module.exports=Te(at);var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((r,a)=>e[a]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var v=(t,e)=>s({[`${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"}),B=(t,e)=>s({"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"},h={small:"small",medium:"medium",large:"large",full:"full"},x={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"},re={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var ne=require("react/jsx-runtime"),Be="k-card-callout",ae=t=>{let{callout:e,...r}=t;return(0,ne.jsx)("span",{...r,className:s(t.className,Be,{[`k-callout-${re.calloutMap[e]||e}`]:e})})};var k=require("react/jsx-runtime"),P="k-card",Le=[d.hover,d.focus,d.selected,d.disabled],ze={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Oe={},y=t=>{let{orientation:e,themeColor:r,callout:a,hover:l,focus:c,selected:i,disabled:p,...f}=t;return(0,k.jsxs)("div",{...f,className:s(t.className,P,v(P,{themeColor:r}),B(P,{hover:l,focus:c,disabled:p,selected:i}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&(0,k.jsx)(ae,{callout:a}),(0,k.jsx)(k.Fragment,{children:t.children})]})};y.states=Le;y.options=ze;y.className=P;y.defaultOptions=Oe;var se=require("react/jsx-runtime"),q="k-card-title",Ee=[d.hover,d.focus],A=t=>{let{hover:e,focus:r,...a}=t;return(0,se.jsx)("div",{...a,className:s(t.className,q,B(q,{hover:e,focus:r})),children:t.children})};A.states=Ee;A.className=q;var le=require("react/jsx-runtime"),Ie="k-card-subtitle",E=t=>{let{...e}=t;return(0,le.jsx)("div",{...e,className:s(t.className,Ie),children:t.children})};var ie=require("react/jsx-runtime");var I=require("react/jsx-runtime"),X="k-icon k-font-icon",we=[],He={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]},Ke={},w=t=>{let{size:e,themeColor:r,icon:a,rotate:l,flip:c,...i}=t;return a?(0,I.jsx)("span",{...i,className:s(t.className,X,v(X,{size:e}),{[`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,I.jsx)(I.Fragment,{})};w.states=we;w.options=He;w.className=X;w.defaultOptions=Ke;var de=w;var M=require("react/jsx-runtime"),J="k-icon k-svg-icon",Re=[],$e={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]},ce={viewBox:"0 0 24 24"},H=t=>{let{size:e,themeColor:r,rotate:a,flip:l,viewBox:c=ce.viewBox,icon:i,...p}=t;if(!i)return(0,M.jsx)(M.Fragment,{});i==="none"&&{...p,className:s(t.className,J,"k-none")};let f=typeof i=="object"&&i.name&&i.name;return(0,M.jsx)("span",{...p,className:s(t.className,J,v("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:(0,M.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:c,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};H.states=Re;H.options=$e;H.className=J;H.defaultOptions=ce;var Y=H;var me=Se(require("@progress/kendo-svg-icons")),g=require("react/jsx-runtime"),De=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Pe=[],_e={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]},Q={viewBox:"0 0 24 24",type:"svg"},L=t=>{let{size:e,themeColor:r,icon:a,type:l=Q.type,rotate:c,flip:i,viewBox:p=Q.viewBox,...f}=t;if(!a)return(0,g.jsx)(g.Fragment,{});if(l==="svg"){if(a==="none")return(0,g.jsx)(Y,{...f,icon:a,size:e});let N=De(`${a}-icon`);return me[N]?(0,g.jsx)(Y,{...f,icon:me[N],size:e,themeColor:r,rotate:c,flip:i,viewBox:p}):(0,g.jsx)(g.Fragment,{})}return(0,g.jsx)(de,{...f,icon:a,size:e,themeColor:r,rotate:c,flip:i})};L.states=Pe;L.options=_e;L.defaultOptions=Q;var C=require("react/jsx-runtime"),_="k-button",Fe=[d.hover,d.focus,d.active,d.selected,d.disabled],Ge={size:[n.small,n.medium,n.large],rounded:[h.small,h.medium,h.large,h.full],fillMode:[x.solid,x.flat,x.outline,x.clear,x.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},S={size:n.medium,rounded:h.medium,fillMode:x.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},u=t=>{let{size:e=S.size,rounded:r=S.rounded,fillMode:a=S.fillMode,themeColor:l=S.themeColor,showArrow:c=S.showArrow,arrowIconName:i=S.arrowIconName,hover:p,focus:f,active:N,selected:R,disabled:V,icon:U,text:$,iconClassName:xe,...Ce}=t,ve=U!==void 0,be=t.children!==void 0;return(0,C.jsxs)("button",{...Ce,className:s(t.className,_,v(_,{size:e,rounded:r,fillMode:a,themeColor:l}),B(_,{hover:p,focus:f,active:N,disabled:V,selected:R}),{"k-icon-button":!$&&!be&&ve}),children:[U&&(0,C.jsx)(L,{className:s(xe,"k-button-icon"),icon:U}),$?(0,C.jsxs)(C.Fragment,{children:[$&&(0,C.jsx)("span",{className:"k-button-text",children:$}),t.children]}):t.children&&(0,C.jsx)("span",{className:"k-button-text",children:t.children}),c&&(0,C.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,C.jsx)(L,{icon:i})})]})};u.states=Fe;u.options=Ge;u.className=_;u.defaultOptions=S;var Ve=require("react/jsx-runtime");var Ue=require("react/jsx-runtime");var qe=require("react/jsx-runtime");var W=require("react/jsx-runtime");var Xe=require("react/jsx-runtime");var b=require("react/jsx-runtime"),Je="k-card-body",F=t=>{let{title:e,subtitle:r,details:a,...l}=t;return(0,b.jsxs)("div",{...l,className:s(t.className,Je),children:[e&&(0,b.jsx)(A,{children:e}),r&&(0,b.jsx)(E,{children:r}),(0,b.jsx)(b.Fragment,{children:t.children}),a&&(0,b.jsx)("span",{className:"k-card-header-actions",children:(0,b.jsx)(u,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var Ye=require("react/jsx-runtime");var ue=require("react/jsx-runtime"),G="k-actions",Qe=[],We={},Z={alignment:"start",orientation:"horizontal"},z=t=>{let{alignment:e=Z.alignment,orientation:r=Z.orientation,...a}=t;return(0,ue.jsx)("div",{...a,className:s(G,{[`${G}-${e}`]:e,[`${G}-${r}`]:r},t.className),children:t.children})};z.states=Qe;z.options=We;z.className=G;z.defaultOptions=Z;var j=require("react/jsx-runtime");var ee=require("react/jsx-runtime");var te=require("react/jsx-runtime"),K="k-avatar";var Ze=[d.hover,d.focus,d.active,d.selected,d.disabled],je={size:[n.small,n.medium,n.large],rounded:[h.small,h.medium,h.large,h.full],fillMode:[x.solid,x.flat,x.outline],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},T={type:"text",size:n.medium,rounded:h.full,fillMode:x.solid,themeColor:o.primary,border:!1},O=t=>{let{size:e=T.size,rounded:r=T.rounded,fillMode:a=T.fillMode,themeColor:l=T.themeColor,type:c=T.type,border:i=T.border,...p}=t;return(0,te.jsx)("div",{...p,className:s(t.className,K,v(K,{size:e,rounded:r,fillMode:a,themeColor:l}),{[`${K}-bordered`]:i}),children:(0,te.jsx)("span",{className:`${K}-${c}`,children:t.children})})};O.states=Ze;O.options=je;O.className=K;O.defaultOptions=T;var et=require("react/jsx-runtime");var tt=require("react/jsx-runtime");var ot=require("react/jsx-runtime");var m=require("react/jsx-runtime"),he="k-orgchart-node",fe={buttonIcon:"plus",details:!0},rt=t=>{let{title:e,subtitle:r,details:a=fe.details,color:l,lineBottom:c,lineTop:i,button:p,buttonIcon:f=fe.buttonIcon,avatar:N,avatarType:R,...V}=t;return(0,m.jsxs)("div",{...V,className:s(t.className,he,"k-vstack","k-align-items-center"),children:[i&&(0,m.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),(0,m.jsx)(y,{className:"k-orgchart-card",children:(0,m.jsxs)(F,{className:"k-hstack",details:a,style:{borderTopColor:l},children:[(0,m.jsx)(O,{type:R,themeColor:"secondary",children:R==="image"?(0,m.jsx)("img",{src:N}):N}),(0,m.jsxs)("div",{className:"k-card-title-wrap k-vstack",children:[(0,m.jsx)(A,{className:"k-text-ellipsis",children:e}),(0,m.jsx)("span",{className:"k-spacer"}),(0,m.jsx)(E,{className:"k-text-ellipsis",children:r})]}),(0,m.jsx)("span",{className:"k-spacer"})]})}),c&&(0,m.jsx)("div",{className:"k-orgchart-line k-orgchart-line-v"}),p&&(0,m.jsx)(u,{className:"k-orgchart-button",icon:f})]})};