UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 14.2 kB
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...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 g=(t,e)=>i({[`${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)=>i({"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 s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},b={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 Ue}from"react/jsx-runtime";var Q="k-actions",He=[],_e={},ne={alignment:"start",orientation:"horizontal"},R=t=>{let{alignment:e=ne.alignment,orientation:n=ne.orientation,...a}=t;return Ue("div",{...a,className:i(Q,{[`${Q}-${e}`]:e,[`${Q}-${n}`]:n},t.className),children:t.children})};R.states=He;R.options=_e;R.className=Q;R.defaultOptions=ne;import{Fragment as Xe,jsx as Me}from"react/jsx-runtime";var se="k-icon k-font-icon",We=[],Fe={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Je={},F=t=>{let{size:e,themeColor:n,icon:a,rotate:m,flip:l,...r}=t;return a?Me("span",{...r,className:i(t.className,se,g(se,{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"})}):Me(Xe,{})};F.states=We;F.options=Fe;F.className=se;F.defaultOptions=Je;var be=F;import{Fragment as Ge,jsx as Y}from"react/jsx-runtime";var re="k-icon k-svg-icon",Ve=[],De={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Ne={viewBox:"0 0 24 24"},J=t=>{let{size:e,themeColor:n,rotate:a,flip:m,viewBox:l=Ne.viewBox,icon:r,...d}=t;if(!r)return Y(Ge,{});r==="none"&&{...d,className:i(t.className,re,"k-none")};let u=typeof r=="object"&&r.name&&r.name;return Y("span",{...d,className:i(t.className,re,g("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 r=="object"?r.viewBox:l,dangerouslySetInnerHTML:typeof r=="object"?{__html:r.content}:void 0,children:r?void 0:t.children})})};J.states=Ve;J.options=De;J.className=re;J.defaultOptions=Ne;var ie=J;import*as Ie from"@progress/kendo-svg-icons";import{Fragment as ke,jsx as X}from"react/jsx-runtime";var qe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Qe=[],Ye={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ae={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:n,icon:a,type:m=ae.type,rotate:l,flip:r,viewBox:d=ae.viewBox,...u}=t;if(!a)return X(ke,{});if(m==="svg"){if(a==="none")return X(ie,{...u,icon:a,size:e});let M=qe(`${a}-icon`);return Ie[M]?X(ie,{...u,icon:Ie[M],size:e,themeColor:n,rotate:l,flip:r,viewBox:d}):X(ke,{})}return X(be,{...u,icon:a,size:e,themeColor:n,rotate:l,flip:r})};h.states=Qe;h.options=Ye;h.defaultOptions=ae;import{Fragment as et,jsx as V,jsxs as we}from"react/jsx-runtime";var Z="k-button",Ze=[c.hover,c.focus,c.active,c.selected,c.disabled],je={size:[s.small,s.medium,s.large],rounded:[b.small,b.medium,b.large,b.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:s.medium,rounded:b.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:r=z.arrowIconName,hover:d,focus:u,active:M,selected:f,disabled:I,icon:N,text:k,iconClassName:w,...L}=t,A=N!==void 0,C=t.children!==void 0;return we("button",{...L,className:i(t.className,Z,g(Z,{size:e,rounded:n,fillMode:a,themeColor:m}),B(Z,{hover:d,focus:u,active:M,disabled:I,selected:f}),{"k-icon-button":!k&&!C&&A}),children:[N&&V(h,{className:i(w,"k-button-icon"),icon:N}),k?we(et,{children:[k&&V("span",{className:"k-button-text",children:k}),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:r})})]})};p.states=Ze;p.options=je;p.className=Z;p.defaultOptions=z;import{jsx as co}from"react/jsx-runtime";import{jsx as xo}from"react/jsx-runtime";import{jsx as No}from"react/jsx-runtime";import{jsx as ge}from"react/jsx-runtime";var ve="k-animation-container",tt=[],ot={},ye={positionMode:"absolute"},$=t=>{let{positionMode:e=ye.positionMode,animationStyle:n,offset:a,...m}=t;return ge("div",{...m,style:{...a,...t.style},className:i(t.className,ve,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:ge("div",{className:"k-child-animation-container",style:n,children:t.children})})};$.states=tt;$.options=ot;$.className=ve;$.defaultOptions=ye;import{jsx as Se}from"react/jsx-runtime";var Ae="k-popup",nt=[],st={},Ce={positionMode:"absolute"},T=t=>{let{offset:e,positionMode:n=Ce.positionMode,animationStyle:a,...m}=t;return Se($,{positionMode:n,offset:e,animationStyle:a,children:Se("div",{...m,className:i(t.className,Ae),children:t.children})})};T.states=nt;T.options=st;T.className=Ae;T.defaultOptions=Ce;import{Fragment as at,jsx as Le,jsxs as lt}from"react/jsx-runtime";var Be="k-menu-button",rt=[c.hover,c.focus,c.active,c.selected,c.disabled],it={size:[s.small,s.medium,s.large],rounded:[b.small,b.medium,b.large,b.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:s.medium,rounded:b.medium,fillMode:x.solid,themeColor:o.base,showArrow:!0,arrowIconName:"caret-alt-down"},H=t=>{let{size:e=O.size,rounded:n=O.rounded,fillMode:a=O.fillMode,themeColor:m=O.themeColor,hover:l,focus:r,active:d,selected:u,disabled:M,icon:f,text:I,showArrow:N=O.showArrow,arrowIconName:k=O.arrowIconName,popup:w,opened:L,...A}=t;return lt(at,{children:[Le(p,{...A,className:i(t.className,Be),text:I,size:e,rounded:n,fillMode:a,themeColor:m,hover:l,focus:r,active:d,selected:u,disabled:M,icon:f,showArrow:N,arrowIconName:k}),L&&w&&Le(T,{className:"k-menu-popup",children:w})]})};H.states=rt;H.options=it;H.className=Be;H.defaultOptions=O;import{jsx as Jo}from"react/jsx-runtime";import{jsx as Go}from"react/jsx-runtime";import{jsx as Zo}from"react/jsx-runtime";import{Fragment as ut,jsx as _,jsxs as ze}from"react/jsx-runtime";var me="k-menu-item",mt=[c.hover,c.focus,c.active,c.selected,c.disabled],ct={},Te={iconPosition:"before"},v=t=>{let{hover:e,focus:n,active:a,selected:m,disabled:l,icon:r,text:d,first:u,last:M,showArrow:f,arrowIconName:I,iconPosition:N=Te.iconPosition,dir:k,children:w,...L}=t,A=_(ut,{});w&&w.forEach(K=>{if(K.type==="MenuItemContent"){A.props.children.push(K);return}});let C=I;return C||(C=k==="rtl"?"caret-alt-left":"caret-alt-right"),ze("li",{...L,className:i(t.className,me,"k-item",B(me,{focus:n,disabled:l,hover:e,active:a,selected:m}),{"k-first":u,"k-last":M}),children:[ze("span",{className:i("k-link k-menu-link"),children:[r&&N==="before"&&_(h,{className:"k-menu-link-icon",icon:r}),_("span",{className:"k-menu-link-text",children:d}),r&&N==="after"&&_(h,{className:"k-menu-link-icon",icon:r}),f&&_("span",{className:"k-menu-expand-arrow",children:_(h,{icon:C})})]}),A]})};v.states=mt;v.options=ct;v.className=me;v.defaultOptions=Te;import{Fragment as ft,jsx as U,jsxs as Oe}from"react/jsx-runtime";var ce="k-menu-item",dt=[c.hover,c.focus,c.active,c.selected,c.disabled],pt={},ue={dir:"ltr",iconPosition:"before"},y=t=>{let{hover:e,focus:n,active:a,selected:m,disabled:l,icon:r,text:d,first:u,last:M,showArrow:f,arrowIconName:I,iconPosition:N=ue.iconPosition,dir:k=ue.dir,children:w,popup:L,...A}=t,C=U(ft,{});w&&w.forEach(oe=>{if(oe.type==="MenuListItemContent"){C.props.children.push(oe);return}});let K=I;return K||(K=k==="rtl"?"caret-alt-left":"caret-alt-right"),Oe("li",{...A,className:i(t.className,ce,"k-item",B(ce,{focus:n,disabled:l}),{"k-first":u,"k-last":M}),children:[Oe("span",{className:i("k-link k-menu-link",B("k-menu-link",{hover:e,active:a,selected:m,disabled:l})),children:[r&&N==="before"&&U(h,{className:"k-menu-link-icon",icon:r}),U("span",{className:"k-menu-link-text",children:d}),r&&N==="after"&&U(h,{className:"k-menu-link-icon",icon:r}),f&&U("span",{className:"k-menu-expand-arrow",children:U(h,{icon:K})})]}),C,L]})};y.states=dt;y.options=pt;y.className=ce;y.defaultOptions=ue;import{jsx as bt}from"react/jsx-runtime";var Pe="k-menu-scroll-wrapper",xt=[],ht={},Mt={},D=t=>{let{className:e,children:n,orientation:a,...m}=t;return bt("div",{...m,className:i(e,Pe,{"k-menu-scroll-wrapper-vertical":a==="vertical"}),children:n})};D.states=xt;D.options=ht;D.className=Pe;D.defaultOptions=Mt;var Ee=D;import{Fragment as de,jsx as P,jsxs as j}from"react/jsx-runtime";var pe="k-menu",Nt=[],It={},ee={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},S=t=>{let{children:e,orientation:n=ee.orientation,header:a=ee.header,scrollable:m,scrollButtonsPosition:l=ee.scrollButtonsPosition,wrapperStyles:r,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:i(t.className,"k-reset",pe,{[`${pe}-${n}`]:n,"k-header":a}),children:e});return j(de,{children:[m?j(Ee,{orientation:n,style:r,dir:t.dir,children:[l==="start"&&j(de,{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"&&j(de,{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=Nt;S.options=It;S.className=pe;S.defaultOptions=ee;import{jsx as kt}from"react/jsx-runtime";var fe="k-separator",Ke={orientation:"horizontal"},G=t=>{let{orientation:e=Ke.orientation,...n}=t;return kt("li",{...n,className:i(t.className,"k-item",fe,{[`${fe}-${e}`]:e})})};G.className=fe;G.defaultOptions=Ke;import{Fragment as wn,jsx as gn}from"react/jsx-runtime";import{jsx as Re}from"react/jsx-runtime";import{createElement as vt}from"react";var xe="k-menu-group",wt=[],gt={size:[s.small,s.medium,s.large]},he={size:s.medium,dir:"ltr"},W=t=>{let{children:e,size:n=he.size,dir:a=he.dir,...m}=t,l=[];return e&&Array.isArray(e)&&e.map((r,d)=>{r.type===y?l.push(vt(y,{...r.props,dir:a,key:d})):r.type===G?l.push(Re(G,{})):l.push(r)}),Re("ul",{...m,className:i(t.className,xe,g(xe,{size:n})),children:l})};W.states=wt;W.options=gt;W.className=xe;W.defaultOptions=he;import{Fragment as On,jsx as Tn,jsxs as Pn}from"react/jsx-runtime";import{Fragment as Un,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 Zn,jsx as Yn,jsxs as jn}from"react/jsx-runtime";import{Fragment as ss,jsx as ns,jsxs as rs}from"react/jsx-runtime";import{jsx as gs,jsxs as vs}from"react/jsx-runtime";import{Fragment as Ct,jsx as E,jsxs as $e}from"react/jsx-runtime";var te="k-window",yt=[],St={themeColor:[o.primary,o.light,o.dark]},At={},q=t=>{let{title:e,actions:n,minimized:a,themeColor:m,actionButtons:l,actionButtonsAlign:r,...d}=t;return $e("div",{...d,className:i(t.className,te,g(te,{themeColor:m}),{[`${te}-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(Ct,{children:E("div",{className:"k-window-titlebar-actions",children:n.map(u=>u==="more-vertical"?E(H,{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:i("k-window-content",{"k-hidden":a}),children:t.children}),l&&E(R,{alignment:r,className:"k-window-actions",children:l})]})};q.states=yt;q.options=St;q.className=te;q.defaultOptions=At;var Ks=q;export{te as WINDOW_CLASSNAME,q as Window,Ks as default};