@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 15 kB
JavaScript
var Ve=Object.create;var ee=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Qe=Object.prototype.hasOwnProperty;var Ye=(t,e)=>{for(var n in e)ee(t,n,{get:e[n],enumerable:!0})},Ae=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of Ge(e))!Qe.call(t,l)&&l!==n&&ee(t,l,{get:()=>e[l],enumerable:!(s=De(e,l))||s.enumerable});return t};var Ze=(t,e,n)=>(n=t!=null?Ve(qe(t)):{},Ae(e||!t||!t.__esModule?ee(n,"default",{value:t,enumerable:!0}):n,t)),je=t=>Ae(ee({},"__esModule",{value:!0}),t);var Ht={};Ye(Ht,{WindowNormal:()=>$t});module.exports=je(Ht);var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...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 C=(t,e)=>a({[`${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"}),K=(t,e)=>a({"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 r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},I={small:"small",medium:"medium",large:"large",full:"full"},h={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"};var Ce=require("react/jsx-runtime"),te="k-actions",et=[],tt={},ie={alignment:"start",orientation:"horizontal"},F=t=>{let{alignment:e=ie.alignment,orientation:n=ie.orientation,...s}=t;return(0,Ce.jsx)("div",{...s,className:a(te,{[`${te}-${e}`]:e,[`${te}-${n}`]:n},t.className),children:t.children})};F.states=et;F.options=tt;F.className=te;F.defaultOptions=ie;var G=require("react/jsx-runtime"),ae="k-icon k-font-icon",ot=[],nt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},st={},q=t=>{let{size:e,themeColor:n,icon:s,rotate:l,flip:m,...i}=t;return s?(0,G.jsx)("span",{...i,className:a(t.className,ae,C(ae,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):(0,G.jsx)(G.Fragment,{})};q.states=ot;q.options=nt;q.className=ae;q.defaultOptions=st;var Le=q;var R=require("react/jsx-runtime"),le="k-icon k-svg-icon",rt=[],it={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Be={viewBox:"0 0 24 24"},Q=t=>{let{size:e,themeColor:n,rotate:s,flip:l,viewBox:m=Be.viewBox,icon:i,...d}=t;if(!i)return(0,R.jsx)(R.Fragment,{});i==="none"&&{...d,className:a(t.className,le,"k-none")};let u=typeof i=="object"&&i.name&&i.name;return(0,R.jsx)("span",{...d,className:a(t.className,le,C("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:(0,R.jsx)("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:t.children})})};Q.states=rt;Q.options=it;Q.className=le;Q.defaultOptions=Be;var me=Q;var ze=Ze(require("@progress/kendo-svg-icons")),L=require("react/jsx-runtime"),at=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),lt=[],mt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ce={viewBox:"0 0 24 24",type:"svg"},M=t=>{let{size:e,themeColor:n,icon:s,type:l=ce.type,rotate:m,flip:i,viewBox:d=ce.viewBox,...u}=t;if(!s)return(0,L.jsx)(L.Fragment,{});if(l==="svg"){if(s==="none")return(0,L.jsx)(me,{...u,icon:s,size:e});let N=at(`${s}-icon`);return ze[N]?(0,L.jsx)(me,{...u,icon:ze[N],size:e,themeColor:n,rotate:m,flip:i,viewBox:d}):(0,L.jsx)(L.Fragment,{})}return(0,L.jsx)(Le,{...u,icon:s,size:e,themeColor:n,rotate:m,flip:i})};M.states=lt;M.options=mt;M.defaultOptions=ce;var v=require("react/jsx-runtime"),oe="k-button",ct=[c.hover,c.focus,c.active,c.selected,c.disabled],ut={size:[r.small,r.medium,r.large],rounded:[I.small,I.medium,I.large,I.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},$={size:r.medium,rounded:I.medium,fillMode:h.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=t=>{let{size:e=$.size,rounded:n=$.rounded,fillMode:s=$.fillMode,themeColor:l=$.themeColor,showArrow:m=$.showArrow,arrowIconName:i=$.arrowIconName,hover:d,focus:u,active:N,selected:x,disabled:y,icon:g,text:S,iconClassName:A,...E}=t,O=g!==void 0,P=t.children!==void 0;return(0,v.jsxs)("button",{...E,className:a(t.className,oe,C(oe,{size:e,rounded:n,fillMode:s,themeColor:l}),K(oe,{hover:d,focus:u,active:N,disabled:y,selected:x}),{"k-icon-button":!S&&!P&&O}),children:[g&&(0,v.jsx)(M,{className:a(A,"k-button-icon"),icon:g}),S?(0,v.jsxs)(v.Fragment,{children:[S&&(0,v.jsx)("span",{className:"k-button-text",children:S}),t.children]}):t.children&&(0,v.jsx)("span",{className:"k-button-text",children:t.children}),m&&(0,v.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,v.jsx)(M,{icon:i})})]})};p.states=ct;p.options=ut;p.className=oe;p.defaultOptions=$;var dt=require("react/jsx-runtime");var pt=require("react/jsx-runtime");var ft=require("react/jsx-runtime");var ue=require("react/jsx-runtime"),Te="k-animation-container",xt=[],ht={},Oe={positionMode:"absolute"},J=t=>{let{positionMode:e=Oe.positionMode,animationStyle:n,offset:s,...l}=t;return(0,ue.jsx)("div",{...l,style:{...s,...t.style},className:a(t.className,Te,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:(0,ue.jsx)("div",{className:"k-child-animation-container",style:n,children:t.children})})};J.states=xt;J.options=ht;J.className=Te;J.defaultOptions=Oe;var de=require("react/jsx-runtime"),Pe="k-popup",Mt=[],bt={},Ee={positionMode:"absolute"},H=t=>{let{offset:e,positionMode:n=Ee.positionMode,animationStyle:s,...l}=t;return(0,de.jsx)(J,{positionMode:n,offset:e,animationStyle:s,children:(0,de.jsx)("div",{...l,className:a(t.className,Pe),children:t.children})})};H.states=Mt;H.options=bt;H.className=Pe;H.defaultOptions=Ee;var W=require("react/jsx-runtime"),Ke="k-menu-button",Nt=[c.hover,c.focus,c.active,c.selected,c.disabled],It={size:[r.small,r.medium,r.large],rounded:[I.small,I.medium,I.large,I.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},_={size:r.medium,rounded:I.medium,fillMode:h.solid,themeColor:o.base,showArrow:!0,arrowIconName:"caret-alt-down"},X=t=>{let{size:e=_.size,rounded:n=_.rounded,fillMode:s=_.fillMode,themeColor:l=_.themeColor,hover:m,focus:i,active:d,selected:u,disabled:N,icon:x,text:y,showArrow:g=_.showArrow,arrowIconName:S=_.arrowIconName,popup:A,opened:E,...O}=t;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(p,{...O,className:a(t.className,Ke),text:y,size:e,rounded:n,fillMode:s,themeColor:l,hover:m,focus:i,active:d,selected:u,disabled:N,icon:x,showArrow:g,arrowIconName:S}),E&&A&&(0,W.jsx)(H,{className:"k-menu-popup",children:A})]})};X.states=Nt;X.options=It;X.className=Ke;X.defaultOptions=_;var kt=require("react/jsx-runtime");var wt=require("react/jsx-runtime");var gt=require("react/jsx-runtime");var k=require("react/jsx-runtime"),fe="k-menu-item",vt=[c.hover,c.focus,c.active,c.selected,c.disabled],yt={},Re={iconPosition:"before"},B=t=>{let{hover:e,focus:n,active:s,selected:l,disabled:m,icon:i,text:d,first:u,last:N,showArrow:x,arrowIconName:y,iconPosition:g=Re.iconPosition,dir:S,children:A,...E}=t,O=(0,k.jsx)(k.Fragment,{});A&&A.forEach(U=>{if(U.type==="MenuItemContent"){O.props.children.push(U);return}});let P=y;return P||(P=S==="rtl"?"caret-alt-left":"caret-alt-right"),(0,k.jsxs)("li",{...E,className:a(t.className,fe,"k-item",K(fe,{focus:n,disabled:m,hover:e,active:s,selected:l}),{"k-first":u,"k-last":N}),children:[(0,k.jsxs)("span",{className:a("k-link k-menu-link"),children:[i&&g==="before"&&(0,k.jsx)(M,{className:"k-menu-link-icon",icon:i}),(0,k.jsx)("span",{className:"k-menu-link-text",children:d}),i&&g==="after"&&(0,k.jsx)(M,{className:"k-menu-link-icon",icon:i}),x&&(0,k.jsx)("span",{className:"k-menu-expand-arrow",children:(0,k.jsx)(M,{icon:P})})]}),O]})};B.states=vt;B.options=yt;B.className=fe;B.defaultOptions=Re;var w=require("react/jsx-runtime"),xe="k-menu-item",St=[c.hover,c.focus,c.active,c.selected,c.disabled],At={},he={dir:"ltr",iconPosition:"before"},z=t=>{let{hover:e,focus:n,active:s,selected:l,disabled:m,icon:i,text:d,first:u,last:N,showArrow:x,arrowIconName:y,iconPosition:g=he.iconPosition,dir:S=he.dir,children:A,popup:E,...O}=t,P=(0,w.jsx)(w.Fragment,{});A&&A.forEach(re=>{if(re.type==="MenuListItemContent"){P.props.children.push(re);return}});let U=y;return U||(U=S==="rtl"?"caret-alt-left":"caret-alt-right"),(0,w.jsxs)("li",{...O,className:a(t.className,xe,"k-item",K(xe,{focus:n,disabled:m}),{"k-first":u,"k-last":N}),children:[(0,w.jsxs)("span",{className:a("k-link k-menu-link",K("k-menu-link",{hover:e,active:s,selected:l,disabled:m})),children:[i&&g==="before"&&(0,w.jsx)(M,{className:"k-menu-link-icon",icon:i}),(0,w.jsx)("span",{className:"k-menu-link-text",children:d}),i&&g==="after"&&(0,w.jsx)(M,{className:"k-menu-link-icon",icon:i}),x&&(0,w.jsx)("span",{className:"k-menu-expand-arrow",children:(0,w.jsx)(M,{icon:U})})]}),P,E]})};z.states=St;z.options=At;z.className=xe;z.defaultOptions=he;var _e=require("react/jsx-runtime"),$e="k-menu-scroll-wrapper",Ct=[],Lt={},Bt={},Y=t=>{let{className:e,children:n,orientation:s,...l}=t;return(0,_e.jsx)("div",{...l,className:a(e,$e,{"k-menu-scroll-wrapper-vertical":s==="vertical"}),children:n})};Y.states=Ct;Y.options=Lt;Y.className=$e;Y.defaultOptions=Bt;var He=Y;var f=require("react/jsx-runtime"),Me="k-menu",zt=[],Tt={},ne={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},T=t=>{let{children:e,orientation:n=ne.orientation,header:s=ne.header,scrollable:l,scrollButtonsPosition:m=ne.scrollButtonsPosition,wrapperStyles:i,dir:d,popup:u,...N}=t,x={horizontal:{prev:d!=="rtl"?"left":"right",next:d!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},y=(0,f.jsx)("ul",{dir:d,...N,className:a(t.className,"k-reset",Me,{[`${Me}-${n}`]:n,"k-header":s}),children:e});return(0,f.jsxs)(f.Fragment,{children:[l?(0,f.jsxs)(He,{orientation:n,style:i,dir:t.dir,children:[m==="start"&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),(0,f.jsx)(p,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),m==="around"&&(0,f.jsx)(p,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),y,m==="end"&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),(0,f.jsx)(p,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),m==="around"&&(0,f.jsx)(p,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}):y,u]})};T.states=zt;T.options=Tt;T.className=Me;T.defaultOptions=ne;var Ue=require("react/jsx-runtime"),be="k-separator",We={orientation:"horizontal"},Z=t=>{let{orientation:e=We.orientation,...n}=t;return(0,Ue.jsx)("li",{...n,className:a(t.className,"k-item",be,{[`${be}-${e}`]:e})})};Z.className=be;Z.defaultOptions=We;var Fe=require("react/jsx-runtime");var ke=require("react/jsx-runtime"),Je=require("react"),Ne="k-menu-group",Ot=[],Pt={size:[r.small,r.medium,r.large]},Ie={size:r.medium,dir:"ltr"},V=t=>{let{children:e,size:n=Ie.size,dir:s=Ie.dir,...l}=t,m=[];return e&&Array.isArray(e)&&e.map((i,d)=>{i.type===z?m.push((0,Je.createElement)(z,{...i.props,dir:s,key:d})):i.type===Z?m.push((0,ke.jsx)(Z,{})):m.push(i)}),(0,ke.jsx)("ul",{...l,className:a(t.className,Ne,C(Ne,{size:n})),children:m})};V.states=Ot;V.options=Pt;V.className=Ne;V.defaultOptions=Ie;var we=require("react/jsx-runtime");var ge=require("react/jsx-runtime");var ve=require("react/jsx-runtime");var ye=require("react/jsx-runtime");var Se=require("react/jsx-runtime");var Xe=require("react/jsx-runtime");var b=require("react/jsx-runtime"),se="k-window",Et=[],Kt={themeColor:[o.primary,o.light,o.dark]},Rt={},D=t=>{let{title:e,actions:n,minimized:s,themeColor:l,actionButtons:m,actionButtonsAlign:i,...d}=t;return(0,b.jsxs)("div",{...d,className:a(t.className,se,C(se,{themeColor:l}),{[`${se}-minimized`]:s}),children:[(e!==void 0||n)&&(0,b.jsxs)("div",{className:"k-window-titlebar",children:[e!==void 0&&(0,b.jsx)("span",{className:"k-window-title",children:e}),n&&(0,b.jsx)(b.Fragment,{children:(0,b.jsx)("div",{className:"k-window-titlebar-actions",children:n.map(u=>u==="more-vertical"?(0,b.jsx)(X,{icon:u,fillMode:"flat",showArrow:!1,className:"k-window-titlebar-action"},u):(0,b.jsx)(p,{icon:u,fillMode:"flat",className:"k-window-titlebar-action"},u))})})]}),(0,b.jsx)("div",{className:a("k-window-content",{"k-hidden":s}),children:t.children}),m&&(0,b.jsx)(F,{alignment:i,className:"k-window-actions",children:m})]})};D.states=Et;D.options=Kt;D.className=se;D.defaultOptions=Rt;var j=require("react/jsx-runtime"),$t=t=>(0,j.jsx)(D,{title:"Title",actions:["window-minimize","window","x"],children:(0,j.jsx)(j.Fragment,{children:"Content"}),...t});