@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.83 kB
JavaScript
var a=(...o)=>o.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 y=(o,e)=>a({[`${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"}),q=(o,e)=>{let{valid:s,invalid:r,hover:c,focus:m,checked:i,active:p,selected:d,disabled:b,indeterminate:z,loading:L,empty:$,readonly:O,highlighted:v,...k}=e;return a({"k-valid":s,"k-invalid":r,"k-hover":c,"k-focus":m,"k-checked":i,"k-active":p,"k-selected":d,"k-disabled":b,"k-indeterminate":z&&!i,"k-loading":L,"k-empty":$,"k-readonly":O,"k-highlighted":v},Object.keys(k).reduce((C,x)=>(x.startsWith("k-")?C[x]=k[x]:C[`k-${x}`]=k[x],C),{}))};function j(o,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"},T={small:"small",medium:"medium",large:"large",full:"full"},h={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"},g={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 R="action-buttons",W=R;import{jsx as ie}from"react/jsx-runtime";var _="k-actions",re=[],se={},H={alignment:"start",orientation:"horizontal"},f=o=>{let{alignment:e=H.alignment,orientation:s=H.orientation,...r}=o;return ie("div",{...r,className:a(_,{[`${_}-${e}`]:e,[`${_}-${s}`]:s},o.className),children:o.children})};f.states=re;f.options=se;f.className=_;f.defaultOptions=H;f.moduleName=R;f.folderName=W;import{Fragment as me,jsx as J}from"react/jsx-runtime";var K="k-font-icon",ae=[],le={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]},ce={},M=o=>{let{size:e,themeColor:s,icon:r,rotate:c,flip:m,...i}=o;return r?J("span",{...i,className:a(o.className,K,y(K,{size:e}),{[`k-i-${r}`]:r,[`k-color-${s}`]:s,[`k-rotate-${c}`]:c,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):J(me,{})};M.states=ae;M.options=le;M.className=K;M.defaultOptions=ce;var Q=M;import{Fragment as pe,jsx as E}from"react/jsx-runtime";var U="k-svg-icon",de=[],ue={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]},X={viewBox:"0 0 24 24"},A=o=>{let{size:e,themeColor:s,rotate:r,flip:c,viewBox:m=X.viewBox,icon:i,...p}=o;if(!i)return E(pe,{});i==="none"&&{...p,className:a(o.className,U,"k-none")};let d=typeof i=="object"&&i.name&&i.name;return E("span",{...p,className:a(o.className,U,y("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:E("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:m,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:o.children})})};A.states=de;A.options=ue;A.className=U;A.defaultOptions=X;var F=A;import*as D from"@progress/kendo-svg-icons";var Y="icon",Z="icons";import{Fragment as ee,jsx as B}from"react/jsx-runtime";var w="k-icon",fe=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),xe=[],he={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]},P={viewBox:"0 0 24 24",type:"svg"},u=o=>{let{size:e,themeColor:s,icon:r,type:c=P.type,rotate:m,flip:i,viewBox:p=P.viewBox,...d}=o;if(!r)return B(ee,{});if(c==="svg"){if(r==="none")return B(F,{...d,className:a(o.className,w),icon:r,size:e});let b=D[r]?r:fe(`${r}-icon`);return D[b]?B(F,{...d,className:a(o.className,w),icon:D[b],size:e,themeColor:s,rotate:m,flip:i,viewBox:p}):B(ee,{})}return B(Q,{...d,className:a(o.className,w),icon:r,size:e,themeColor:s,rotate:m,flip:i})};u.states=xe;u.options=he;u.defaultOptions=P;u.className=w;u.moduleName=Y;u.folderName=Z;var V="button",te=V;import{Fragment as ve,jsx as S,jsxs as oe}from"react/jsx-runtime";var I="k-button",ge=["icon-button"],Ne=[g.hover,g.focus,g.active,g.selected,g.disabled,g.generating],be={size:[n.small,n.medium,n.large],rounded:[T.small,T.medium,T.large,T.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},N={size:n.medium,rounded:T.medium,fillMode:h.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},l=o=>{let{size:e=N.size,rounded:s=N.rounded,fillMode:r=N.fillMode,themeColor:c=N.themeColor,showArrow:m=N.showArrow,arrowIconName:i=N.arrowIconName,variant:p,hover:d,focus:b,active:z,selected:L,disabled:$,icon:O,text:v,iconClassName:k,...C}=o,x=O!==void 0,ne=o.children!==void 0;return oe("button",{...C,className:a(o.className,I,j(I,p),y(I,{size:e,rounded:s,fillMode:r,themeColor:c}),q(I,{hover:d,focus:b,active:z,disabled:$,selected:L}),{"k-icon-button":!v&&!ne&&x}),children:[O&&S(u,{className:a(k,"k-button-icon"),icon:O}),v?oe(ve,{children:[v&&S("span",{className:"k-button-text",children:v}),o.children]}):o.children&&S("span",{className:"k-button-text",children:o.children}),m&&S("span",{className:"k-menu-button-arrow k-button-arrow",children:S(u,{icon:i})})]})};l.states=Ne;l.options=be;l.variants=ge;l.className=I;l.defaultOptions=N;l.moduleName=V;l.folderName=te;import{jsx as ct}from"react/jsx-runtime";import{jsx as pt}from"react/jsx-runtime";import{jsx as gt}from"react/jsx-runtime";import{jsx as G,jsxs as Te}from"react/jsx-runtime";var ye="k-time-fast-selection",At=o=>{let{...e}=o;return Te(f,{...e,alignment:"start",className:a(o.className,ye),children:[G(l,{children:"1 d"}),G(l,{children:"1 h"}),G(l,{children:"15 m"})]})};export{At as TimeSelectorFastSelection};