@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 15.6 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"}),D=(t,e)=>{let{valid:n,invalid:s,hover:m,focus:l,checked:i,active:u,selected:p,disabled:x,indeterminate:M,loading:A,empty:w,readonly:C,highlighted:N,...T}=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":w,"k-readonly":C,"k-highlighted":N},Object.keys(T).reduce((b,h)=>(h.startsWith("k-")?b[h]=T[h]:b[`k-${h}`]=T[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 lt}from"react/jsx-runtime";var te="k-actions",it=[],at={},ce={alignment:"start",orientation:"horizontal"},B=t=>{let{alignment:e=ce.alignment,orientation:n=ce.orientation,...s}=t;return lt("div",{...s,className:r(te,{[`${te}-${e}`]:e,[`${te}-${n}`]:n},t.className),children:t.children})};B.states=it;B.options=at;B.className=te;B.defaultOptions=ce;B.moduleName=me;B.folderName=Se;import{Fragment as ut,jsx as ge}from"react/jsx-runtime";var pe="k-font-icon",mt=[],ct={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]},pt={},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(ut,{})};q.states=mt;q.options=ct;q.className=pe;q.defaultOptions=pt;var ve=q;import{Fragment as Mt,jsx as oe}from"react/jsx-runtime";var ue="k-svg-icon",dt=[],ft={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(Mt,{});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=dt;Q.options=ft;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",Nt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),xt=[],ht={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:Nt(`${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=xt;f.options=ht;f.defaultOptions=Me;f.className=ne;f.moduleName=Be;f.folderName=Ke;var Ne="button",Re=Ne;import{Fragment as bt,jsx as Z,jsxs as Ue}from"react/jsx-runtime";var j="k-button",Et=["icon-button"],It=[c.hover,c.focus,c.active,c.selected,c.disabled,c.generating],At={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:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=H.size,rounded:n=H.rounded,fillMode:s=H.fillMode,themeColor:m=H.themeColor,showArrow:l=H.showArrow,arrowIconName:i=H.arrowIconName,variant:u,hover:p,focus:x,active:M,selected:A,disabled:w,icon:C,text:N,iconClassName:T,...b}=t,h=C!==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}),D(j,{hover:p,focus:x,active:M,disabled:w,selected:A}),{"k-icon-button":!N&&!y&&h}),children:[C&&Z(f,{className:r(T,"k-button-icon"),icon:C}),N?Ue(bt,{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=It;d.options=At;d.variants=Et;d.className=j;d.defaultOptions=H;d.moduleName=Ne;d.folderName=Re;import{jsx as Fo}from"react/jsx-runtime";import{jsx as Go}from"react/jsx-runtime";import{jsx as Zo}from"react/jsx-runtime";var xe="popup",ze=xe;import{jsx as De}from"react/jsx-runtime";var He="k-animation-container",Lt=[],Ot={},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=Lt;K.options=Ot;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",wt=[],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=wt;v.options=Ct;v.className=Ve;v.defaultOptions=Je;v.moduleName=he;v.folderName=$e;var Ee="menu-button",Xe=Ee;import{Fragment as _t,jsx as Ge,jsxs as St}from"react/jsx-runtime";var qe="k-menu-button",Tt=[c.hover,c.focus,c.active,c.selected,c.disabled],kt={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]},W={size:a.medium,rounded:L.medium,fillMode:E.solid,themeColor:o.base,showArrow:!0,arrowIconName:"caret-alt-down"},P=t=>{let{size:e=W.size,rounded:n=W.rounded,fillMode:s=W.fillMode,themeColor:m=W.themeColor,hover:l,focus:i,active:u,selected:p,disabled:x,icon:M,text:A,showArrow:w=W.showArrow,arrowIconName:C=W.arrowIconName,popup:N,opened:T,...b}=t;return St(_t,{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:w,arrowIconName:C}),T&&N&&Ge(v,{className:"k-menu-popup",children:N})]})};P.states=Tt;P.options=kt;P.className=qe;P.defaultOptions=W;P.moduleName=Ee;P.folderName=Xe;import{jsx as Sn}from"react/jsx-runtime";import{jsx as Bn}from"react/jsx-runtime";import{jsx as Un}from"react/jsx-runtime";var I="menu",O=I;import{Fragment as yt,jsx as X,jsxs as Qe}from"react/jsx-runtime";var Ae="k-menu-item",gt=[c.hover,c.focus,c.active,c.selected,c.disabled],vt={},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:w=Ye.iconPosition,dir:C,children:N,...T}=t,b=X(yt,{});N&&N.forEach(y=>{if(y.type==="MenuItemContent"){b.props.children.push(y);return}});let h=A;return h||(h=C==="rtl"?"caret-alt-left":"caret-alt-right"),Qe("li",{...T,className:r(t.className,Ae,"k-item",D(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&&w==="before"&&X(f,{className:"k-menu-link-icon",icon:i}),X("span",{className:"k-menu-link-text",children:u}),i&&w==="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=gt;k.options=vt;k.className=Ae;k.defaultOptions=Ye;k.moduleName=I;k.folderName=O;import{Fragment as Pt,jsx as G,jsxs as Ze}from"react/jsx-runtime";var be="k-menu-item",Bt=[c.hover,c.focus,c.active,c.selected,c.disabled],Kt={},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:w=Le.iconPosition,dir:C=Le.dir,children:N,popup:T,...b}=t,h=G(Pt,{});N&&N.forEach(le=>{if(le.type==="MenuListItemContent"){h.props.children.push(le);return}});let y=A;return y||(y=C==="rtl"?"caret-alt-left":"caret-alt-right"),Ze("li",{...b,className:r(t.className,be,"k-item",D(be,{focus:n,disabled:l}),{"k-first":p,"k-last":x}),children:[Ze("span",{className:r("k-link k-menu-link",D("k-menu-link",{hover:e,active:s,selected:m,disabled:l})),children:[i&&w==="before"&&G(f,{className:"k-menu-link-icon",icon:i}),G("span",{className:"k-menu-link-text",children:u}),i&&w==="after"&&G(f,{className:"k-menu-link-icon",icon:i}),M&&G("span",{className:"k-menu-expand-arrow",children:G(f,{icon:y})})]}),h,T]})};_.states=Bt;_.options=Kt;_.className=be;_.defaultOptions=Le;_.moduleName=I;_.folderName=O;import{jsx as Dt}from"react/jsx-runtime";var je="k-menu-scroll-wrapper",Rt=[],Ut={},zt={},$=t=>{let{className:e,children:n,orientation:s,...m}=t;return Dt("div",{...m,className:r(e,je,{"k-menu-scroll-wrapper-vertical":s==="vertical"}),children:n})};$.states=Rt;$.options=Ut;$.className=je;$.defaultOptions=zt;$.moduleName=I;$.folderName=O;var et=$;import{Fragment as Oe,jsx as F,jsxs as re}from"react/jsx-runtime";var we="k-menu",Ht=[],Wt={},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=F("ul",{dir:u,...x,className:r(t.className,"k-reset",we,{[`${we}-${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:[F(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),F(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"&&F(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:[F(d,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),F(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"&&F(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=Ht;S.options=Wt;S.className=we;S.defaultOptions=se;S.moduleName=I;S.folderName=O;import{jsx as $t}from"react/jsx-runtime";var Ce="k-separator",tt={orientation:"horizontal"},V=t=>{let{orientation:e=tt.orientation,...n}=t;return $t("li",{...n,className:r(t.className,"k-item",Ce,{[`${Ce}-${e}`]:e})})};V.className=Ce;V.defaultOptions=tt;V.moduleName=I;V.folderName=O;import{Fragment as dr,jsx as fr}from"react/jsx-runtime";import{jsx as ot}from"react/jsx-runtime";import{createElement as Jt}from"react";var Te="k-menu-group",Ft=[],Vt={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(Jt(_,{...i.props,dir:s,key:u})):i.type===V?l.push(ot(V,{})):l.push(i)}),ot("ul",{...m,className:r(t.className,Te,g(Te,{size:n})),children:l})};R.states=Ft;R.options=Vt;R.className=Te;R.defaultOptions=ke;R.moduleName=I;R.folderName=O;import{Fragment as wr,jsx as Or,jsxs as Cr}from"react/jsx-runtime";import{Fragment as yr,jsx as gr,jsxs as vr}from"react/jsx-runtime";import{Fragment as Ur,jsx as Rr,jsxs as zr}from"react/jsx-runtime";import{Fragment as Fr,jsx as $r,jsxs as Vr}from"react/jsx-runtime";import{Fragment as Qr,jsx as qr,jsxs as Yr}from"react/jsx-runtime";import{jsx as Ms,jsxs as Ns}from"react/jsx-runtime";var ee="window",ie=ee;import{jsx as Qt}from"react/jsx-runtime";var nt="k-window-content",Xt=[],Gt={},qt={},U=t=>{let{children:e,...n}=t;return Qt("div",{...n,className:r(nt,t.className),children:e})};U.states=Xt;U.options=Gt;U.className=nt;U.defaultOptions=qt;U.moduleName=ee;U.folderName=ie;import{Fragment as eo,jsx as J,jsxs as rt}from"react/jsx-runtime";var ae="k-window",Yt=[],Zt={themeColor:[o.primary,o.light,o.dark]},jt={},z=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&&J("span",{className:"k-window-title",children:e}),n&&J(eo,{children:J("div",{className:"k-window-titlebar-actions",children:n.map(p=>p==="more-vertical"?J(P,{icon:p,fillMode:"flat",showArrow:!1,className:"k-window-titlebar-action"},p):J(d,{icon:p,fillMode:"flat",className:"k-window-titlebar-action"},p))})})]}),J(U,{className:r({"k-hidden":s}),children:t.children}),l&&J(B,{alignment:i,className:"k-window-actions",children:l})]})};z.states=Yt;z.options=Zt;z.className=ae;z.defaultOptions=jt;z.moduleName=ee;z.folderName=ie;import{Fragment as to,jsx as st}from"react/jsx-runtime";var Ws=t=>st(z,{title:"Title",actions:["window-minimize","window","x"],children:st(to,{children:"Content"}),...t});export{Ws as WindowNormal};