UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.69 kB
var s=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?s(...e):typeof e=="object"?Object.keys(e).map((a,r)=>e[r]||e[a]&&a||null).filter(a=>a!==null).join(" "):e).filter(e=>!!e).join(" ");var p=(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"}),E=(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"},g={small:"small",medium:"medium",large:"large",full:"full"},f={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"},v={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"};import{Fragment as j,jsx as P}from"react/jsx-runtime";var A="k-icon k-font-icon",X=[],Y={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]},Z={},b=t=>{let{size:e,themeColor:a,icon:r,rotate:c,flip:l,...i}=t;return r?P("span",{...i,className:s(t.className,A,p(A,{size:e}),{[`k-i-${r}`]:r,[`k-color-${a}`]:a,[`k-rotate-${c}`]:c,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):P(j,{})};b.states=X;b.options=Y;b.className=A;b.defaultOptions=Z;var K=b;import{Fragment as te,jsx as T}from"react/jsx-runtime";var $="k-icon k-svg-icon",ee=[],oe={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]},F={viewBox:"0 0 24 24"},w=t=>{let{size:e,themeColor:a,rotate:r,flip:c,viewBox:l=F.viewBox,icon:i,...u}=t;if(!i)return T(te,{});i==="none"&&{...u,className:s(t.className,$,"k-none")};let m=typeof i=="object"&&i.name&&i.name;return T("span",{...u,className:s(t.className,$,p("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${a}`]:a,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:T("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:l,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};w.states=ee;w.options=oe;w.className=$;w.defaultOptions=F;var L=w;import*as R from"@progress/kendo-svg-icons";import{Fragment as _,jsx as z}from"react/jsx-runtime";var ne=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),re=[],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]},H={viewBox:"0 0 24 24",type:"svg"},y=t=>{let{size:e,themeColor:a,icon:r,type:c=H.type,rotate:l,flip:i,viewBox:u=H.viewBox,...m}=t;if(!r)return z(_,{});if(c==="svg"){if(r==="none")return z(L,{...m,icon:r,size:e});let x=ne(`${r}-icon`);return R[x]?z(L,{...m,icon:R[x],size:e,themeColor:a,rotate:l,flip:i,viewBox:u}):z(_,{})}return z(K,{...m,icon:r,size:e,themeColor:a,rotate:l,flip:i})};y.states=re;y.options=ie;y.defaultOptions=H;import{Fragment as se,jsx as N,jsxs as V}from"react/jsx-runtime";var M="k-button",ae=[v.hover,v.focus,v.active,v.selected,v.disabled],le={size:[n.small,n.medium,n.large],rounded:[g.small,g.medium,g.large,g.full],fillMode:[f.solid,f.flat,f.outline,f.clear,f.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},h={size:n.medium,rounded:g.medium,fillMode:f.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=h.size,rounded:a=h.rounded,fillMode:r=h.fillMode,themeColor:c=h.themeColor,showArrow:l=h.showArrow,arrowIconName:i=h.arrowIconName,hover:u,focus:m,active:x,selected:I,disabled:q,icon:O,text:B,iconClassName:U,...J}=t,Q=O!==void 0,W=t.children!==void 0;return V("button",{...J,className:s(t.className,M,p(M,{size:e,rounded:a,fillMode:r,themeColor:c}),E(M,{hover:u,focus:m,active:x,disabled:q,selected:I}),{"k-icon-button":!B&&!W&&Q}),children:[O&&N(y,{className:s(U,"k-button-icon"),icon:O}),B?V(se,{children:[B&&N("span",{className:"k-button-text",children:B}),t.children]}):t.children&&N("span",{className:"k-button-text",children:t.children}),l&&N("span",{className:"k-menu-button-arrow k-button-arrow",children:N(y,{icon:i})})]})};d.states=ae;d.options=le;d.className=M;d.defaultOptions=h;import{jsx as Fe}from"react/jsx-runtime";import{jsx as Ge}from"react/jsx-runtime";import{jsx as Je}from"react/jsx-runtime";import{jsx as C,jsxs as G}from"react/jsx-runtime";var D="k-calendar-header",ce={size:[n.small,n.medium,n.large]},k={calendarTitleText:"October 2021",showToday:!0,showNavigationButtons:!0,orientation:"horizontal",size:n.medium},S=t=>{let{calendarTitleText:e=k.calendarTitleText,showToday:a=k.showToday,showNavigationButtons:r=k.showNavigationButtons,orientation:c=k.orientation,size:l=k.size,calendarView:i,dir:u,...m}=t,x=u==="rtl"?"chevron-right":"chevron-left",I=u==="rtl"?"chevron-left":"chevron-right";return G("div",{...m,className:s(t.className,D,{"k-vstack":c==="vertical"}),children:[C(d,{disabled:i==="century",className:"k-calendar-title",text:e,size:l,fillMode:"flat",themeColor:"primary"}),C("span",{className:"k-spacer"}),G("span",{className:"k-calendar-nav",children:[r&&C(d,{className:"k-calendar-nav-prev",icon:x,size:l,fillMode:"flat"}),a&&C(d,{size:l,fillMode:"flat",className:"k-calendar-nav-today",children:"Today"}),r&&C(d,{className:"k-calendar-nav-next",icon:I,size:l,fillMode:"flat"})]})]})};S.options=ce;S.className=D;S.defaultOptions=k;var to=S;export{S as CalendarHeader,to as default};