UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.62 kB
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 b=(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"}),D=(t,e)=>{let{valid:s,invalid:r,hover:l,focus:c,checked:i,active:p,selected:d,disabled:N,indeterminate:E,loading:L,empty:_,readonly:k,highlighted:y,...C}=e;return a({"k-valid":s,"k-invalid":r,"k-hover":l,"k-focus":c,"k-checked":i,"k-active":p,"k-selected":d,"k-disabled":N,"k-indeterminate":E&&!i,"k-loading":L,"k-empty":_,"k-readonly":k,"k-highlighted":y},Object.keys(C).reduce((M,f)=>(f.startsWith("k-")?M[f]=C[f]:M[`k-${f}`]=C[f],M),{}))};function V(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"},v={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"},h={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 G}from"react/jsx-runtime";var $="k-font-icon",te=[],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={},O=t=>{let{size:e,themeColor:s,icon:r,rotate:l,flip:c,...i}=t;return r?G("span",{...i,className:a(t.className,$,b($,{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"})}):G(se,{})};O.states=te;O.options=ne;O.className=$;O.defaultOptions=re;var q=O;import{Fragment as le,jsx as I}from"react/jsx-runtime";var F="k-svg-icon",ie=[],ae={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]},j={viewBox:"0 0 24 24"},T=t=>{let{size:e,themeColor:s,rotate:r,flip:l,viewBox:c=j.viewBox,icon:i,...p}=t;if(!i)return I(le,{});i==="none"&&{...p,className:a(t.className,F,"k-none")};let d=typeof i=="object"&&i.name&&i.name;return I("span",{...p,className:a(t.className,F,b("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:I("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})})};T.states=ie;T.options=ae;T.className=F;T.defaultOptions=j;var R=T;import*as K from"@progress/kendo-svg-icons";var W="icon",J="icons";import{Fragment as Q,jsx as z}from"react/jsx-runtime";var S="k-icon",ce=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),me=[],de={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]},H={viewBox:"0 0 24 24",type:"svg"},u=t=>{let{size:e,themeColor:s,icon:r,type:l=H.type,rotate:c,flip:i,viewBox:p=H.viewBox,...d}=t;if(!r)return z(Q,{});if(l==="svg"){if(r==="none")return z(R,{...d,className:a(t.className,S),icon:r,size:e});let N=K[r]?r:ce(`${r}-icon`);return K[N]?z(R,{...d,className:a(t.className,S),icon:K[N],size:e,themeColor:s,rotate:c,flip:i,viewBox:p}):z(Q,{})}return z(q,{...d,className:a(t.className,S),icon:r,size:e,themeColor:s,rotate:c,flip:i})};u.states=me;u.options=de;u.defaultOptions=H;u.className=S;u.moduleName=W;u.folderName=J;var P="button",X=P;import{Fragment as xe,jsx as B,jsxs as Y}from"react/jsx-runtime";var A="k-button",ue=["icon-button"],pe=[h.hover,h.focus,h.active,h.selected,h.disabled,h.generating],fe={size:[n.small,n.medium,n.large],rounded:[v.small,v.medium,v.large,v.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]},g={size:n.medium,rounded:v.medium,fillMode:x.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=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:d,focus:N,active:E,selected:L,disabled:_,icon:k,text:y,iconClassName:C,...M}=t,f=k!==void 0,oe=t.children!==void 0;return Y("button",{...M,className:a(t.className,A,V(A,p),b(A,{size:e,rounded:s,fillMode:r,themeColor:l}),D(A,{hover:d,focus:N,active:E,disabled:_,selected:L}),{"k-icon-button":!y&&!oe&&f}),children:[k&&B(u,{className:a(C,"k-button-icon"),icon:k}),y?Y(xe,{children:[y&&B("span",{className:"k-button-text",children:y}),t.children]}):t.children&&B("span",{className:"k-button-text",children:t.children}),c&&B("span",{className:"k-menu-button-arrow k-button-arrow",children:B(u,{icon:i})})]})};m.states=pe;m.options=fe;m.variants=ue;m.className=A;m.defaultOptions=g;m.moduleName=P;m.folderName=X;import{jsx as Qe}from"react/jsx-runtime";import{jsx as eo}from"react/jsx-runtime";import{jsx as ro}from"react/jsx-runtime";import{jsx as Z}from"react/jsx-runtime";var ee="k-calendar-footer",he={size:[n.small,n.medium,n.large]},U={size:n.medium,calendarFooterText:"Tuesday, October 12, 2021"},w=t=>{let{size:e=U.size,calendarFooterText:s=U.calendarFooterText,...r}=t;return Z("div",{...r,className:a(t.className,ee),children:Z(m,{size:e,fillMode:"flat",themeColor:"primary",className:"k-calendar-nav-today",children:s})})};w.options=he;w.className=ee;w.defaultOptions=U;var fo=w;export{w as CalendarFooter,fo as default};