@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 15.5 kB
JavaScript
var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((n,s)=>e[s]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var g=(t,e)=>r({[`${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"}),z=(t,e)=>{let{valid:n,invalid:s,hover:m,focus:l,checked:i,active:u,selected:p,disabled:x,indeterminate:M,loading:A,empty:C,readonly:T,highlighted:N,...w}=e;return r({"k-valid":n,"k-invalid":s,"k-hover":m,"k-focus":l,"k-checked":i,"k-active":u,"k-selected":p,"k-disabled":x,"k-indeterminate":M&&!i,"k-loading":A,"k-empty":C,"k-readonly":T,"k-highlighted":N},Object.keys(w).reduce((b,h)=>(h.startsWith("k-")?b[h]=w[h]:b[`k-${h}`]=w[h],b),{}))};function _e(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(s=>[`k-${s}`,!0]))}var a={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},L={small:"small",medium:"medium",large:"large",full:"full"},E={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"},c={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 me="action-buttons",Se=me;import{jsx as at}from"react/jsx-runtime";var te="k-actions",st=[],it={},ce={alignment:"start",orientation:"horizontal"},B=t=>{let{alignment:e=ce.alignment,orientation:n=ce.orientation,...s}=t;return at("div",{...s,className:r(te,{[`${te}-${e}`]:e,[`${te}-${n}`]:n},t.className),children:t.children})};B.states=st;B.options=it;B.className=te;B.defaultOptions=ce;B.moduleName=me;B.folderName=Se;import{Fragment as pt,jsx as ge}from"react/jsx-runtime";var pe="k-font-icon",lt=[],mt={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ct={},q=t=>{let{size:e,themeColor:n,icon:s,rotate:m,flip:l,...i}=t;return s?ge("span",{...i,className:r(t.className,pe,g(pe,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${m}`]:m,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):ge(pt,{})};q.states=lt;q.options=mt;q.className=pe;q.defaultOptions=ct;var ve=q;import{Fragment as ft,jsx as oe}from"react/jsx-runtime";var ue="k-svg-icon",ut=[],dt={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ye={viewBox:"0 0 24 24"},Q=t=>{let{size:e,themeColor:n,rotate:s,flip:m,viewBox:l=ye.viewBox,icon:i,...u}=t;if(!i)return oe(ft,{});i==="none"&&{...u,className:r(t.className,ue,"k-none")};let p=typeof i=="object"&&i.name&&i.name;return oe("span",{...u,className:r(t.className,ue,g("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:oe("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})})};Q.states=ut;Q.options=dt;Q.className=ue;Q.defaultOptions=ye;var de=Q;import*as fe from"@progress/kendo-svg-icons";var Be="icon",Ke="icons";import{Fragment as Pe,jsx as Y}from"react/jsx-runtime";var ne="k-icon",Mt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Nt=[],xt={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Me={viewBox:"0 0 24 24",type:"svg"},f=t=>{let{size:e,themeColor:n,icon:s,type:m=Me.type,rotate:l,flip:i,viewBox:u=Me.viewBox,...p}=t;if(!s)return Y(Pe,{});if(m==="svg"){if(s==="none")return Y(de,{...p,className:r(t.className,ne),icon:s,size:e});let x=fe[s]?s:Mt(`${s}-icon`);return fe[x]?Y(de,{...p,className:r(t.className,ne),icon:fe[x],size:e,themeColor:n,rotate:l,flip:i,viewBox:u}):Y(Pe,{})}return Y(ve,{...p,className:r(t.className,ne),icon:s,size:e,themeColor:n,rotate:l,flip:i})};f.states=Nt;f.options=xt;f.defaultOptions=Me;f.className=ne;f.moduleName=Be;f.folderName=Ke;var Ne="button",Re=Ne;import{Fragment as At,jsx as Z,jsxs as Ue}from"react/jsx-runtime";var j="k-button",ht=["icon-button"],Et=[c.hover,c.focus,c.active,c.selected,c.disabled,c.generating],It={size:[a.small,a.medium,a.large],rounded:[L.small,L.medium,L.large,L.full],fillMode:[E.solid,E.flat,E.outline,E.clear,E.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},D={size:a.medium,rounded:L.medium,fillMode:E.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=D.size,rounded:n=D.rounded,fillMode:s=D.fillMode,themeColor:m=D.themeColor,showArrow:l=D.showArrow,arrowIconName:i=D.arrowIconName,variant:u,hover:p,focus:x,active:M,selected:A,disabled:C,icon:T,text:N,iconClassName:w,...b}=t,h=T!==void 0,y=t.children!==void 0;return Ue("button",{...b,className:r(t.className,j,_e(j,u),g(j,{size:e,rounded:n,fillMode:s,themeColor:m}),z(j,{hover:p,focus:x,active:M,disabled:C,selected:A}),{"k-icon-button":!N&&!y&&h}),children:[T&&Z(f,{className:r(w,"k-button-icon"),icon:T}),N?Ue(At,{children:[N&&Z("span",{className:"k-button-text",children:N}),t.children]}):t.children&&Z("span",{className:"k-button-text",children:t.children}),l&&Z("span",{className:"k-menu-button-arrow k-button-arrow",children:Z(f,{icon:i})})]})};d.states=Et;d.options=It;d.variants=ht;d.className=j;d.defaultOptions=D;d.moduleName=Ne;d.folderName=Re;import{jsx as Wo}from"react/jsx-runtime";import{jsx as Jo}from"react/jsx-runtime";import{jsx as Qo}from"react/jsx-runtime";var xe="popup",ze=xe;import{jsx as De}from"react/jsx-runtime";var He="k-animation-container",bt=[],Lt={},We={positionMode:"absolute"},K=t=>{let{positionMode:e=We.positionMode,animationStyle:n,offset:s,...m}=t;return De("div",{...m,style:{...s,...t.style},className:r(t.className,He,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:De("div",{className:"k-child-animation-container",style:n,children:t.children})})};K.states=bt;K.options=Lt;K.className=He;K.defaultOptions=We;K.moduleName=xe;K.folderName=ze;var he="popup",$e=he;import{jsx as Fe}from"react/jsx-runtime";var Ve="k-popup",Ot=[],Ct={},Je={positionMode:"absolute"},v=t=>{let{offset:e,positionMode:n=Je.positionMode,animationStyle:s,...m}=t;return Fe(K,{positionMode:n,offset:e,animationStyle:s,children:Fe("div",{...m,className:r(t.className,Ve),children:t.children})})};v.states=Ot;v.options=Ct;v.className=Ve;v.defaultOptions=Je;v.moduleName=he;v.folderName=$e;var Ee="menu-button",Xe=Ee;import{Fragment as kt,jsx as Ge,jsxs as _t}from"react/jsx-runtime";var qe="k-menu-button",Tt=[c.hover,c.focus,c.active,c.selected,c.disabled],wt={size:[a.small,a.medium,a.large],rounded:[L.small,L.medium,L.large,L.full],fillMode:[E.solid,E.flat,E.outline,E.clear,E.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:a.medium,rounded:L.medium,fillMode:E.solid,themeColor:o.base,showArrow:!0,arrowIconName:"caret-alt-down"},P=t=>{let{size:e=H.size,rounded:n=H.rounded,fillMode:s=H.fillMode,themeColor:m=H.themeColor,hover:l,focus:i,active:u,selected:p,disabled:x,icon:M,text:A,showArrow:C=H.showArrow,arrowIconName:T=H.arrowIconName,popup:N,opened:w,...b}=t;return _t(kt,{children:[Ge(d,{...b,className:r(t.className,qe),text:A,size:e,rounded:n,fillMode:s,themeColor:m,hover:l,focus:i,active:u,selected:p,disabled:x,icon:M,showArrow:C,arrowIconName:T}),w&&N&&Ge(v,{className:"k-menu-popup",children:N})]})};P.states=Tt;P.options=wt;P.className=qe;P.defaultOptions=H;P.moduleName=Ee;P.folderName=Xe;import{jsx as kn}from"react/jsx-runtime";import{jsx as vn}from"react/jsx-runtime";import{jsx as Pn}from"react/jsx-runtime";var I="menu",O=I;import{Fragment as vt,jsx as X,jsxs as Qe}from"react/jsx-runtime";var Ae="k-menu-item",St=[c.hover,c.focus,c.active,c.selected,c.disabled],gt={},Ye={iconPosition:"before"},k=t=>{let{hover:e,focus:n,active:s,selected:m,disabled:l,icon:i,text:u,first:p,last:x,showArrow:M,arrowIconName:A,iconPosition:C=Ye.iconPosition,dir:T,children:N,...w}=t,b=X(vt,{});N&&N.forEach(y=>{if(y.type==="MenuItemContent"){b.props.children.push(y);return}});let h=A;return h||(h=T==="rtl"?"caret-alt-left":"caret-alt-right"),Qe("li",{...w,className:r(t.className,Ae,"k-item",z(Ae,{focus:n,disabled:l,hover:e,active:s,selected:m}),{"k-first":p,"k-last":x}),children:[Qe("span",{className:r("k-link k-menu-link"),children:[i&&C==="before"&&X(f,{className:"k-menu-link-icon",icon:i}),X("span",{className:"k-menu-link-text",children:u}),i&&C==="after"&&X(f,{className:"k-menu-link-icon",icon:i}),M&&X("span",{className:"k-menu-expand-arrow",children:X(f,{icon:h})})]}),b]})};k.states=St;k.options=gt;k.className=Ae;k.defaultOptions=Ye;k.moduleName=I;k.folderName=O;import{Fragment as Kt,jsx as G,jsxs as Ze}from"react/jsx-runtime";var be="k-menu-item",yt=[c.hover,c.focus,c.active,c.selected,c.disabled],Bt={},Le={dir:"ltr",iconPosition:"before"},_=t=>{let{hover:e,focus:n,active:s,selected:m,disabled:l,icon:i,text:u,first:p,last:x,showArrow:M,arrowIconName:A,iconPosition:C=Le.iconPosition,dir:T=Le.dir,children:N,popup:w,...b}=t,h=G(Kt,{});N&&N.forEach(le=>{if(le.type==="MenuListItemContent"){h.props.children.push(le);return}});let y=A;return y||(y=T==="rtl"?"caret-alt-left":"caret-alt-right"),Ze("li",{...b,className:r(t.className,be,"k-item",z(be,{focus:n,disabled:l}),{"k-first":p,"k-last":x}),children:[Ze("span",{className:r("k-link k-menu-link",z("k-menu-link",{hover:e,active:s,selected:m,disabled:l})),children:[i&&C==="before"&&G(f,{className:"k-menu-link-icon",icon:i}),G("span",{className:"k-menu-link-text",children:u}),i&&C==="after"&&G(f,{className:"k-menu-link-icon",icon:i}),M&&G("span",{className:"k-menu-expand-arrow",children:G(f,{icon:y})})]}),h,w]})};_.states=yt;_.options=Bt;_.className=be;_.defaultOptions=Le;_.moduleName=I;_.folderName=O;import{jsx as zt}from"react/jsx-runtime";var je="k-menu-scroll-wrapper",Pt=[],Rt={},Ut={},W=t=>{let{className:e,children:n,orientation:s,...m}=t;return zt("div",{...m,className:r(e,je,{"k-menu-scroll-wrapper-vertical":s==="vertical"}),children:n})};W.states=Pt;W.options=Rt;W.className=je;W.defaultOptions=Ut;W.moduleName=I;W.folderName=O;var et=W;import{Fragment as Oe,jsx as $,jsxs as re}from"react/jsx-runtime";var Ce="k-menu",Dt=[],Ht={},se={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},S=t=>{let{children:e,orientation:n=se.orientation,header:s=se.header,scrollable:m,scrollButtonsPosition:l=se.scrollButtonsPosition,wrapperStyles:i,dir:u,popup:p,...x}=t,M={horizontal:{prev:u!=="rtl"?"left":"right",next:u!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},A=$("ul",{dir:u,...x,className:r(t.className,"k-reset",Ce,{[`${Ce}-${n}`]:n,"k-header":s}),children:e});return re(Oe,{children:[m?re(et,{orientation:n,style:i,dir:t.dir,children:[l==="start"&&re(Oe,{children:[$(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),$(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),l==="around"&&$(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),A,l==="end"&&re(Oe,{children:[$(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),$(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),l==="around"&&$(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}):A,p]})};S.states=Dt;S.options=Ht;S.className=Ce;S.defaultOptions=se;S.moduleName=I;S.folderName=O;import{jsx as Wt}from"react/jsx-runtime";var Te="k-separator",tt={orientation:"horizontal"},F=t=>{let{orientation:e=tt.orientation,...n}=t;return Wt("li",{...n,className:r(t.className,"k-item",Te,{[`${Te}-${e}`]:e})})};F.className=Te;F.defaultOptions=tt;F.moduleName=I;F.folderName=O;import{Fragment as pr,jsx as ur}from"react/jsx-runtime";import{jsx as ot}from"react/jsx-runtime";import{createElement as Vt}from"react";var we="k-menu-group",$t=[],Ft={size:[a.small,a.medium,a.large]},ke={size:a.medium,dir:"ltr"},R=t=>{let{children:e,size:n=ke.size,dir:s=ke.dir,...m}=t,l=[];return e&&Array.isArray(e)&&e.map((i,u)=>{i.type===_?l.push(Vt(_,{...i.props,dir:s,key:u})):i.type===F?l.push(ot(F,{})):l.push(i)}),ot("ul",{...m,className:r(t.className,we,g(we,{size:n})),children:l})};R.states=$t;R.options=Ft;R.className=we;R.defaultOptions=ke;R.moduleName=I;R.folderName=O;import{Fragment as Lr,jsx as br,jsxs as Or}from"react/jsx-runtime";import{Fragment as gr,jsx as _r,jsxs as Sr}from"react/jsx-runtime";import{Fragment as Pr,jsx as Kr,jsxs as Rr}from"react/jsx-runtime";import{Fragment as Wr,jsx as Hr,jsxs as $r}from"react/jsx-runtime";import{Fragment as Gr,jsx as Xr,jsxs as qr}from"react/jsx-runtime";import{jsx as ds,jsxs as fs}from"react/jsx-runtime";var ee="window",ie=ee;import{jsx as qt}from"react/jsx-runtime";var nt="k-window-content",Jt=[],Xt={},Gt={},U=t=>{let{children:e,...n}=t;return qt("div",{...n,className:r(nt,t.className),children:e})};U.states=Jt;U.options=Xt;U.className=nt;U.defaultOptions=Gt;U.moduleName=ee;U.folderName=ie;import{Fragment as jt,jsx as V,jsxs as rt}from"react/jsx-runtime";var ae="k-window",Qt=[],Yt={themeColor:[o.primary,o.light,o.dark]},Zt={},J=t=>{let{title:e,actions:n,minimized:s,themeColor:m,actionButtons:l,actionButtonsAlign:i,...u}=t;return rt("div",{...u,className:r(t.className,ae,g(ae,{themeColor:m}),{[`${ae}-minimized`]:s}),children:[(e!==void 0||n)&&rt("div",{className:"k-window-titlebar",children:[e!==void 0&&V("span",{className:"k-window-title",children:e}),n&&V(jt,{children:V("div",{className:"k-window-titlebar-actions",children:n.map(p=>p==="more-vertical"?V(P,{icon:p,fillMode:"flat",showArrow:!1,className:"k-window-titlebar-action"},p):V(d,{icon:p,fillMode:"flat",className:"k-window-titlebar-action"},p))})})]}),V(U,{className:r({"k-hidden":s}),children:t.children}),l&&V(B,{alignment:i,className:"k-window-actions",children:l})]})};J.states=Qt;J.options=Yt;J.className=ae;J.defaultOptions=Zt;J.moduleName=ee;J.folderName=ie;var ys=J;export{ae as WINDOW_CLASSNAME,J as Window,ys as default};