UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 11.7 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 y=(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"}),w=(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"},T={small:"small",medium:"medium",large:"large",full:"full"},A={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{Fragment as ze,jsx as le}from"react/jsx-runtime";var Q="k-icon k-font-icon",Ae=[],Le={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]},Ce={},K=t=>{let{size:e,themeColor:n,icon:a,rotate:m,flip:l,...r}=t;return a?le("span",{...r,className:i(t.className,Q,y(Q,{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"})}):le(ze,{})};K.states=Ae;K.options=Le;K.className=Q;K.defaultOptions=Ce;var me=K;import{Fragment as Oe,jsx as X}from"react/jsx-runtime";var Y="k-icon k-svg-icon",Pe=[],Te={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]},ce={viewBox:"0 0 24 24"},H=t=>{let{size:e,themeColor:n,rotate:a,flip:m,viewBox:l=ce.viewBox,icon:r,...u}=t;if(!r)return X(Oe,{});r==="none"&&{...u,className:i(t.className,Y,"k-none")};let d=typeof r=="object"&&r.name&&r.name;return X("span",{...u,className:i(t.className,Y,y("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:X("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})})};H.states=Pe;H.options=Te;H.className=Y;H.defaultOptions=ce;var Z=H;import*as ue from"@progress/kendo-svg-icons";import{Fragment as de,jsx as _}from"react/jsx-runtime";var Be=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ee=[],Re={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]},j={viewBox:"0 0 24 24",type:"svg"},p=t=>{let{size:e,themeColor:n,icon:a,type:m=j.type,rotate:l,flip:r,viewBox:u=j.viewBox,...d}=t;if(!a)return _(de,{});if(m==="svg"){if(a==="none")return _(Z,{...d,icon:a,size:e});let h=Be(`${a}-icon`);return ue[h]?_(Z,{...d,icon:ue[h],size:e,themeColor:n,rotate:l,flip:r,viewBox:u}):_(de,{})}return _(me,{...d,icon:a,size:e,themeColor:n,rotate:l,flip:r})};p.states=Ee;p.options=Re;p.defaultOptions=j;import{Fragment as He,jsx as O,jsxs as pe}from"react/jsx-runtime";var ee="k-menu-item",$e=[c.hover,c.focus,c.active,c.selected,c.disabled],Ke={},fe={iconPosition:"before"},I=t=>{let{hover:e,focus:n,active:a,selected:m,disabled:l,icon:r,text:u,first:d,last:h,showArrow:x,arrowIconName:k,iconPosition:M=fe.iconPosition,dir:N,children:v,...$}=t,z=O(He,{});v&&v.forEach(P=>{if(P.type==="MenuItemContent"){z.props.children.push(P);return}});let g=k;return g||(g=N==="rtl"?"caret-alt-left":"caret-alt-right"),pe("li",{...$,className:i(t.className,ee,"k-item",w(ee,{focus:n,disabled:l,hover:e,active:a,selected:m}),{"k-first":d,"k-last":h}),children:[pe("span",{className:i("k-link k-menu-link"),children:[r&&M==="before"&&O(p,{className:"k-menu-link-icon",icon:r}),O("span",{className:"k-menu-link-text",children:u}),r&&M==="after"&&O(p,{className:"k-menu-link-icon",icon:r}),x&&O("span",{className:"k-menu-expand-arrow",children:O(p,{icon:g})})]}),z]})};I.states=$e;I.options=Ke;I.className=ee;I.defaultOptions=fe;import{Fragment as Fe,jsx as B,jsxs as xe}from"react/jsx-runtime";var te="k-menu-item",_e=[c.hover,c.focus,c.active,c.selected,c.disabled],Ue={},oe={dir:"ltr",iconPosition:"before"},S=t=>{let{hover:e,focus:n,active:a,selected:m,disabled:l,icon:r,text:u,first:d,last:h,showArrow:x,arrowIconName:k,iconPosition:M=oe.iconPosition,dir:N=oe.dir,children:v,popup:$,...z}=t,g=B(Fe,{});v&&v.forEach(q=>{if(q.type==="MenuListItemContent"){g.props.children.push(q);return}});let P=k;return P||(P=N==="rtl"?"caret-alt-left":"caret-alt-right"),xe("li",{...z,className:i(t.className,te,"k-item",w(te,{focus:n,disabled:l}),{"k-first":d,"k-last":h}),children:[xe("span",{className:i("k-link k-menu-link",w("k-menu-link",{hover:e,active:a,selected:m,disabled:l})),children:[r&&M==="before"&&B(p,{className:"k-menu-link-icon",icon:r}),B("span",{className:"k-menu-link-text",children:u}),r&&M==="after"&&B(p,{className:"k-menu-link-icon",icon:r}),x&&B("span",{className:"k-menu-expand-arrow",children:B(p,{icon:P})})]}),g,$]})};S.states=_e;S.options=Ue;S.className=te;S.defaultOptions=oe;import{Fragment as Xe,jsx as U,jsxs as he}from"react/jsx-runtime";var G="k-button",Ve=[c.hover,c.focus,c.active,c.selected,c.disabled],Je={size:[s.small,s.medium,s.large],rounded:[T.small,T.medium,T.large,T.full],fillMode:[A.solid,A.flat,A.outline,A.clear,A.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},L={size:s.medium,rounded:T.medium,fillMode:A.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},f=t=>{let{size:e=L.size,rounded:n=L.rounded,fillMode:a=L.fillMode,themeColor:m=L.themeColor,showArrow:l=L.showArrow,arrowIconName:r=L.arrowIconName,hover:u,focus:d,active:h,selected:x,disabled:k,icon:M,text:N,iconClassName:v,...$}=t,z=M!==void 0,g=t.children!==void 0;return he("button",{...$,className:i(t.className,G,y(G,{size:e,rounded:n,fillMode:a,themeColor:m}),w(G,{hover:u,focus:d,active:h,disabled:k,selected:x}),{"k-icon-button":!N&&!g&&z}),children:[M&&U(p,{className:i(v,"k-button-icon"),icon:M}),N?he(Xe,{children:[N&&U("span",{className:"k-button-text",children:N}),t.children]}):t.children&&U("span",{className:"k-button-text",children:t.children}),l&&U("span",{className:"k-menu-button-arrow k-button-arrow",children:U(p,{icon:r})})]})};f.states=Ve;f.options=Je;f.className=G;f.defaultOptions=L;import{jsx as Jt}from"react/jsx-runtime";import{jsx as Dt}from"react/jsx-runtime";import{jsx as Zt}from"react/jsx-runtime";import{jsx as qe}from"react/jsx-runtime";var Me="k-menu-scroll-wrapper",Ge=[],We={},De={},F=t=>{let{className:e,children:n,orientation:a,...m}=t;return qe("div",{...m,className:i(e,Me,{"k-menu-scroll-wrapper-vertical":a==="vertical"}),children:n})};F.states=Ge;F.options=We;F.className=Me;F.defaultOptions=De;var Ie=F;import{Fragment as ne,jsx as C,jsxs as W}from"react/jsx-runtime";var re="k-menu",Qe=[],Ye={},D={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},b=t=>{let{children:e,orientation:n=D.orientation,header:a=D.header,scrollable:m,scrollButtonsPosition:l=D.scrollButtonsPosition,wrapperStyles:r,dir:u,popup:d,...h}=t,x={horizontal:{prev:u!=="rtl"?"left":"right",next:u!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},k=C("ul",{dir:u,...h,className:i(t.className,"k-reset",re,{[`${re}-${n}`]:n,"k-header":a}),children:e});return W(ne,{children:[m?W(Ie,{orientation:n,style:r,dir:t.dir,children:[l==="start"&&W(ne,{children:[C(f,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),C(f,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),l==="around"&&C(f,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),k,l==="end"&&W(ne,{children:[C(f,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),C(f,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),l==="around"&&C(f,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${x[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}):k,d]})};b.states=Qe;b.options=Ye;b.className=re;b.defaultOptions=D;import{jsx as Ze}from"react/jsx-runtime";var se="k-separator",be={orientation:"horizontal"},V=t=>{let{orientation:e=be.orientation,...n}=t;return Ze("li",{...n,className:i(t.className,"k-item",se,{[`${se}-${e}`]:e})})};V.className=se;V.defaultOptions=be;import{Fragment as bo,jsx as ko}from"react/jsx-runtime";import{Fragment as vo,jsx as So,jsxs as wo}from"react/jsx-runtime";import{jsx as ke}from"react/jsx-runtime";var Ne="k-animation-container",je=[],et={},ge={positionMode:"absolute"},E=t=>{let{positionMode:e=ge.positionMode,animationStyle:n,offset:a,...m}=t;return ke("div",{...m,style:{...a,...t.style},className:i(t.className,Ne,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:ke("div",{className:"k-child-animation-container",style:n,children:t.children})})};E.states=je;E.options=et;E.className=Ne;E.defaultOptions=ge;import{jsx as ye}from"react/jsx-runtime";var Se="k-popup",tt=[],ot={},ve={positionMode:"absolute"},J=t=>{let{offset:e,positionMode:n=ve.positionMode,animationStyle:a,...m}=t;return ye(E,{positionMode:n,offset:e,animationStyle:a,children:ye("div",{...m,className:i(t.className,Se),children:t.children})})};J.states=tt;J.options=ot;J.className=Se;J.defaultOptions=ve;import{Fragment as Jo,jsx as Fo,jsxs as Vo}from"react/jsx-runtime";import{Fragment as qo,jsx as Do,jsxs as Qo}from"react/jsx-runtime";import{Fragment as tn,jsx as en,jsxs as on}from"react/jsx-runtime";import{Fragment as ln,jsx as an,jsxs as mn}from"react/jsx-runtime";import{jsx as we}from"react/jsx-runtime";import{createElement as st}from"react";var ie="k-menu-group",nt=[],rt={size:[s.small,s.medium,s.large]},ae={size:s.medium,dir:"ltr"},R=t=>{let{children:e,size:n=ae.size,dir:a=ae.dir,...m}=t,l=[];return e&&Array.isArray(e)&&e.map((r,u)=>{r.type===S?l.push(st(S,{...r.props,dir:a,key:u})):r.type===V?l.push(we(V,{})):l.push(r)}),we("ul",{...m,className:i(t.className,ie,y(ie,{size:n})),children:l})};R.states=nt;R.options=rt;R.className=ie;R.defaultOptions=ae;var wn=R;export{ie as MENULIST_CLASSNAME,R as MenuList,wn as default};