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