UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.94 kB
var te=Object.create;var $=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var ie=(o,e)=>{for(var r in e)$(o,r,{get:e[r],enumerable:!0})},q=(o,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of re(e))!ae.call(o,i)&&i!==r&&$(o,i,{get:()=>e[i],enumerable:!(s=ne(e,i))||s.enumerable});return o};var le=(o,e,r)=>(r=o!=null?te(se(o)):{},q(e||!o||!o.__esModule?$(r,"default",{value:o,enumerable:!0}):r,o)),ce=o=>q($({},"__esModule",{value:!0}),o);var Be={};ie(Be,{CalendarHeader:()=>_,default:()=>Me});module.exports=ce(Be);var c=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?c(...e):typeof e=="object"?Object.keys(e).map((r,s)=>e[s]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var T=(o,e)=>c({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${o}-${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"}),j=(o,e)=>{let{valid:r,invalid:s,hover:i,focus:l,checked:a,active:u,selected:m,disabled:g,indeterminate:w,loading:R,empty:K,readonly:z,highlighted:C,...O}=e;return c({"k-valid":r,"k-invalid":s,"k-hover":i,"k-focus":l,"k-checked":a,"k-active":u,"k-selected":m,"k-disabled":g,"k-indeterminate":w&&!a,"k-loading":R,"k-empty":K,"k-readonly":z,"k-highlighted":C},Object.keys(O).reduce((A,N)=>(N.startsWith("k-")?A[N]=O[N]:A[`k-${N}`]=O[N],A),{}))};function W(o,e){if(!e)return{};let r=Array.isArray(e)?e:[e];return Object.fromEntries(r.map(s=>[`k-${s}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},M={small:"small",medium:"medium",large:"large",full:"full"},v={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},t={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},y={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"};var I=require("react/jsx-runtime"),F="k-font-icon",de=[],me={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},ue={},S=o=>{let{size:e,themeColor:r,icon:s,rotate:i,flip:l,...a}=o;return s?(0,I.jsx)("span",{...a,className:c(o.className,F,T(F,{size:e}),{[`k-i-${s}`]:s,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):(0,I.jsx)(I.Fragment,{})};S.states=de;S.options=me;S.className=F;S.defaultOptions=ue;var J=S;var b=require("react/jsx-runtime"),P="k-svg-icon",pe=[],fe={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},Q={viewBox:"0 0 24 24"},E=o=>{let{size:e,themeColor:r,rotate:s,flip:i,viewBox:l=Q.viewBox,icon:a,...u}=o;if(!a)return(0,b.jsx)(b.Fragment,{});a==="none"&&{...u,className:c(o.className,P,"k-none")};let m=typeof a=="object"&&a.name&&a.name;return(0,b.jsx)("span",{...u,className:c(o.className,P,T("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,b.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:l,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:o.children})})};E.states=pe;E.options=fe;E.className=P;E.defaultOptions=Q;var U=E;var D=le(require("@progress/kendo-svg-icons"));var X="icon",Y="icons";var f=require("react/jsx-runtime"),H="k-icon",xe=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),he=[],ge={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},V={viewBox:"0 0 24 24",type:"svg"},x=o=>{let{size:e,themeColor:r,icon:s,type:i=V.type,rotate:l,flip:a,viewBox:u=V.viewBox,...m}=o;if(!s)return(0,f.jsx)(f.Fragment,{});if(i==="svg"){if(s==="none")return(0,f.jsx)(U,{...m,className:c(o.className,H),icon:s,size:e});let g=D[s]?s:xe(`${s}-icon`);return D[g]?(0,f.jsx)(U,{...m,className:c(o.className,H),icon:D[g],size:e,themeColor:r,rotate:l,flip:a,viewBox:u}):(0,f.jsx)(f.Fragment,{})}return(0,f.jsx)(J,{...m,className:c(o.className,H),icon:s,size:e,themeColor:r,rotate:l,flip:a})};x.states=he;x.options=ge;x.defaultOptions=V;x.className=H;x.moduleName=X;x.folderName=Y;var G="button",Z=G;var p=require("react/jsx-runtime"),L="k-button",Ne=["icon-button"],ve=[y.hover,y.focus,y.active,y.selected,y.disabled,y.generating],ye={size:[n.small,n.medium,n.large],rounded:[M.small,M.medium,M.large,M.full],fillMode:[v.solid,v.flat,v.outline,v.clear,v.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},k={size:n.medium,rounded:M.medium,fillMode:v.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=o=>{let{size:e=k.size,rounded:r=k.rounded,fillMode:s=k.fillMode,themeColor:i=k.themeColor,showArrow:l=k.showArrow,arrowIconName:a=k.arrowIconName,variant:u,hover:m,focus:g,active:w,selected:R,disabled:K,icon:z,text:C,iconClassName:O,...A}=o,N=z!==void 0,oe=o.children!==void 0;return(0,p.jsxs)("button",{...A,className:c(o.className,L,W(L,u),T(L,{size:e,rounded:r,fillMode:s,themeColor:i}),j(L,{hover:m,focus:g,active:w,disabled:K,selected:R}),{"k-icon-button":!C&&!oe&&N}),children:[z&&(0,p.jsx)(x,{className:c(O,"k-button-icon"),icon:z}),C?(0,p.jsxs)(p.Fragment,{children:[C&&(0,p.jsx)("span",{className:"k-button-text",children:C}),o.children]}):o.children&&(0,p.jsx)("span",{className:"k-button-text",children:o.children}),l&&(0,p.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,p.jsx)(x,{icon:a})})]})};d.states=ve;d.options=ye;d.variants=Ne;d.className=L;d.defaultOptions=k;d.moduleName=G;d.folderName=Z;var be=require("react/jsx-runtime");var ke=require("react/jsx-runtime");var Ce=require("react/jsx-runtime");var h=require("react/jsx-runtime"),ee="k-calendar-header",Te={size:[n.small,n.medium,n.large]},B={calendarTitleText:"October 2021",showToday:!0,showNavigationButtons:!0,orientation:"horizontal",size:n.medium},_=o=>{let{calendarTitleText:e=B.calendarTitleText,showToday:r=B.showToday,showNavigationButtons:s=B.showNavigationButtons,orientation:i=B.orientation,size:l=B.size,calendarView:a,dir:u,...m}=o,g=u==="rtl"?"chevron-right":"chevron-left",w=u==="rtl"?"chevron-left":"chevron-right";return(0,h.jsxs)("div",{...m,className:c(o.className,ee,{"k-vstack":i==="vertical"}),children:[(0,h.jsx)(d,{disabled:a==="century",className:"k-calendar-title",text:e,size:l,fillMode:"flat",themeColor:"primary"}),(0,h.jsx)("span",{className:"k-spacer"}),(0,h.jsxs)("span",{className:"k-calendar-nav",children:[s&&(0,h.jsx)(d,{className:"k-calendar-nav-prev",icon:g,size:l,fillMode:"flat"}),r&&(0,h.jsx)(d,{size:l,fillMode:"flat",className:"k-calendar-nav-today",children:"Today"}),s&&(0,h.jsx)(d,{className:"k-calendar-nav-next",icon:w,size:l,fillMode:"flat"})]})]})};_.options=Te;_.className=ee;_.defaultOptions=B;var Me=_;