@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 7.02 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((s,r)=>e[r]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var v=(t,e)=>a({[`${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"}),E=(t,e)=>{let{valid:s,invalid:r,hover:l,focus:c,checked:i,active:p,selected:m,disabled:N,indeterminate:_,loading:R,empty:H,readonly:y,highlighted:b,...k}=e;return a({"k-valid":s,"k-invalid":r,"k-hover":l,"k-focus":c,"k-checked":i,"k-active":p,"k-selected":m,"k-disabled":N,"k-indeterminate":_&&!i,"k-loading":R,"k-empty":H,"k-readonly":y,"k-highlighted":b},Object.keys(k).reduce((M,x)=>(x.startsWith("k-")?M[x]=k[x]:M[`k-${x}`]=k[x],M),{}))};function G(t,e){if(!e)return{};let s=Array.isArray(e)?e:[e];return Object.fromEntries(s.map(r=>[`k-${r}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},C={small:"small",medium:"medium",large:"large",full:"full"},h={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"},u={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"};import{Fragment as se,jsx as q}from"react/jsx-runtime";var $="k-font-icon",oe=[],ne={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]},re={},T=t=>{let{size:e,themeColor:s,icon:r,rotate:l,flip:c,...i}=t;return r?q("span",{...i,className:a(t.className,$,v($,{size:e}),{[`k-i-${r}`]:r,[`k-color-${s}`]:s,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):q(se,{})};T.states=oe;T.options=ne;T.className=$;T.defaultOptions=re;var J=T;import{Fragment as le,jsx as w}from"react/jsx-runtime";var K="k-svg-icon",ae=[],ie={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]},X={viewBox:"0 0 24 24"},S=t=>{let{size:e,themeColor:s,rotate:r,flip:l,viewBox:c=X.viewBox,icon:i,...p}=t;if(!i)return w(le,{});i==="none"&&{...p,className:a(t.className,K,"k-none")};let m=typeof i=="object"&&i.name&&i.name;return w("span",{...p,className:a(t.className,K,v("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:w("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})})};S.states=ae;S.options=ie;S.className=K;S.defaultOptions=X;var D=S;import*as F from"@progress/kendo-svg-icons";var W="icon",Q="icons";import{Fragment as Y,jsx as A}from"react/jsx-runtime";var z="k-icon",ce=t=>t.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:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},U={viewBox:"0 0 24 24",type:"svg"},f=t=>{let{size:e,themeColor:s,icon:r,type:l=U.type,rotate:c,flip:i,viewBox:p=U.viewBox,...m}=t;if(!r)return A(Y,{});if(l==="svg"){if(r==="none")return A(D,{...m,className:a(t.className,z),icon:r,size:e});let N=F[r]?r:ce(`${r}-icon`);return F[N]?A(D,{...m,className:a(t.className,z),icon:F[N],size:e,themeColor:s,rotate:c,flip:i,viewBox:p}):A(Y,{})}return A(J,{...m,className:a(t.className,z),icon:r,size:e,themeColor:s,rotate:c,flip:i})};f.states=de;f.options=me;f.defaultOptions=U;f.className=z;f.moduleName=W;f.folderName=Q;var P="button",Z=P;import{Fragment as xe,jsx as O,jsxs as j}from"react/jsx-runtime";var B="k-button",ue=["icon-button"],fe=[u.hover,u.focus,u.active,u.selected,u.disabled,u.generating],pe={size:[n.small,n.medium,n.large],rounded:[C.small,C.medium,C.large,C.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},g={size:n.medium,rounded:C.medium,fillMode:h.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=g.size,rounded:s=g.rounded,fillMode:r=g.fillMode,themeColor:l=g.themeColor,showArrow:c=g.showArrow,arrowIconName:i=g.arrowIconName,variant:p,hover:m,focus:N,active:_,selected:R,disabled:H,icon:y,text:b,iconClassName:k,...M}=t,x=y!==void 0,te=t.children!==void 0;return j("button",{...M,className:a(t.className,B,G(B,p),v(B,{size:e,rounded:s,fillMode:r,themeColor:l}),E(B,{hover:m,focus:N,active:_,disabled:H,selected:R}),{"k-icon-button":!b&&!te&&x}),children:[y&&O(f,{className:a(k,"k-button-icon"),icon:y}),b?j(xe,{children:[b&&O("span",{className:"k-button-text",children:b}),t.children]}):t.children&&O("span",{className:"k-button-text",children:t.children}),c&&O("span",{className:"k-menu-button-arrow k-button-arrow",children:O(f,{icon:i})})]})};d.states=fe;d.options=pe;d.variants=ue;d.className=B;d.defaultOptions=g;d.moduleName=P;d.folderName=Z;import{jsx as ot}from"react/jsx-runtime";import{jsx as at}from"react/jsx-runtime";import{jsx as dt}from"react/jsx-runtime";import{jsx as ge}from"react/jsx-runtime";var he="k-card-subtitle",ee=t=>{let{...e}=t;return ge("div",{...e,className:a(t.className,he),children:t.children})};import{jsx as be}from"react/jsx-runtime";var V="k-card-title",Ne=[u.hover,u.focus],L=t=>{let{hover:e,focus:s,...r}=t;return be("div",{...r,className:a(t.className,V,E(V,{hover:e,focus:s})),children:t.children})};L.states=Ne;L.className=V;import{Fragment as Ce,jsx as I,jsxs as ye}from"react/jsx-runtime";var ve="k-card-header",At=t=>{let{title:e,subtitle:s,details:r,...l}=t;return ye("div",{...l,className:a(t.className,ve),children:[e&&I(L,{children:e}),s&&I(ee,{children:s}),I(Ce,{children:t.children}),r&&I("span",{className:"k-card-header-actions",children:I(d,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};export{ve as CARDHEADER_CLASSNAME,At as CardHeader};