@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 13.9 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((n,r)=>e[r]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(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"}),R=(t,e)=>{let{valid:n,invalid:r,hover:m,focus:l,checked:s,active:p,selected:d,disabled:N,indeterminate:M,loading:L,empty:g,readonly:A,highlighted:x,...O}=e;return a({"k-valid":n,"k-invalid":r,"k-hover":m,"k-focus":l,"k-checked":s,"k-active":p,"k-selected":d,"k-disabled":N,"k-indeterminate":M&&!s,"k-loading":L,"k-empty":g,"k-readonly":A,"k-highlighted":x},Object.keys(O).reduce((C,h)=>(h.startsWith("k-")?C[h]=O[h]:C[`k-${h}`]=O[h],C),{}))};function Ee(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(r=>[`k-${r}`,!0]))}var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},S={small:"small",medium:"medium",large:"large",full:"full"},I={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"};import{Fragment as Qe,jsx as Le}from"react/jsx-runtime";var oe="k-font-icon",Xe=[],Ge={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},qe={},J=t=>{let{size:e,themeColor:n,icon:r,rotate:m,flip:l,...s}=t;return r?Le("span",{...s,className:a(t.className,oe,y(oe,{size:e}),{[`k-i-${r}`]:r,[`k-color-${n}`]:n,[`k-rotate-${m}`]:m,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):Le(Qe,{})};J.states=Xe;J.options=Ge;J.className=oe;J.defaultOptions=qe;var Ae=J;import{Fragment as je,jsx as Q}from"react/jsx-runtime";var ne="k-svg-icon",Ye=[],Ze={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Se={viewBox:"0 0 24 24"},W=t=>{let{size:e,themeColor:n,rotate:r,flip:m,viewBox:l=Se.viewBox,icon:s,...p}=t;if(!s)return Q(je,{});s==="none"&&{...p,className:a(t.className,ne,"k-none")};let d=typeof s=="object"&&s.name&&s.name;return Q("span",{...p,className:a(t.className,ne,y("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:Q("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:l,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?void 0:t.children})})};W.states=Ye;W.options=Ze;W.className=ne;W.defaultOptions=Se;var re=W;import*as se from"@progress/kendo-svg-icons";var ke="icon",ge="icons";import{Fragment as Oe,jsx as X}from"react/jsx-runtime";var Y="k-icon",et=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),tt=[],ot={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.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",type:"svg"},f=t=>{let{size:e,themeColor:n,icon:r,type:m=ie.type,rotate:l,flip:s,viewBox:p=ie.viewBox,...d}=t;if(!r)return X(Oe,{});if(m==="svg"){if(r==="none")return X(re,{...d,className:a(t.className,Y),icon:r,size:e});let N=se[r]?r:et(`${r}-icon`);return se[N]?X(re,{...d,className:a(t.className,Y),icon:se[N],size:e,themeColor:n,rotate:l,flip:s,viewBox:p}):X(Oe,{})}return X(Ae,{...d,className:a(t.className,Y),icon:r,size:e,themeColor:n,rotate:l,flip:s})};f.states=tt;f.options=ot;f.defaultOptions=ie;f.className=Y;f.moduleName=ke;f.folderName=ge;var ae="button",Te=ae;import{Fragment as it,jsx as G,jsxs as ve}from"react/jsx-runtime";var q="k-button",nt=["icon-button"],rt=[c.hover,c.focus,c.active,c.selected,c.disabled,c.generating],st={size:[i.small,i.medium,i.large],rounded:[S.small,S.medium,S.large,S.full],fillMode:[I.solid,I.flat,I.outline,I.clear,I.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:i.medium,rounded:S.medium,fillMode:I.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},u=t=>{let{size:e=z.size,rounded:n=z.rounded,fillMode:r=z.fillMode,themeColor:m=z.themeColor,showArrow:l=z.showArrow,arrowIconName:s=z.arrowIconName,variant:p,hover:d,focus:N,active:M,selected:L,disabled:g,icon:A,text:x,iconClassName:O,...C}=t,h=A!==void 0,P=t.children!==void 0;return ve("button",{...C,className:a(t.className,q,Ee(q,p),y(q,{size:e,rounded:n,fillMode:r,themeColor:m}),R(q,{hover:d,focus:N,active:M,disabled:g,selected:L}),{"k-icon-button":!x&&!P&&h}),children:[A&&G(f,{className:a(O,"k-button-icon"),icon:A}),x?ve(it,{children:[x&&G("span",{className:"k-button-text",children:x}),t.children]}):t.children&&G("span",{className:"k-button-text",children:t.children}),l&&G("span",{className:"k-menu-button-arrow k-button-arrow",children:G(f,{icon:s})})]})};u.states=rt;u.options=st;u.variants=nt;u.className=q;u.defaultOptions=z;u.moduleName=ae;u.folderName=Te;import{jsx as po}from"react/jsx-runtime";import{jsx as No}from"react/jsx-runtime";import{jsx as bo}from"react/jsx-runtime";var le="popup",Ce=le;import{jsx as ye}from"react/jsx-runtime";var _e="k-animation-container",at=[],lt={},we={positionMode:"absolute"},K=t=>{let{positionMode:e=we.positionMode,animationStyle:n,offset:r,...m}=t;return ye("div",{...m,style:{...r,...t.style},className:a(t.className,_e,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:ye("div",{className:"k-child-animation-container",style:n,children:t.children})})};K.states=at;K.options=lt;K.className=_e;K.defaultOptions=we;K.moduleName=le;K.folderName=Ce;var me="popup",Pe=me;import{jsx as Ke}from"react/jsx-runtime";var Be="k-popup",mt=[],ct={},Re={positionMode:"absolute"},_=t=>{let{offset:e,positionMode:n=Re.positionMode,animationStyle:r,...m}=t;return Ke(K,{positionMode:n,offset:e,animationStyle:r,children:Ke("div",{...m,className:a(t.className,Be),children:t.children})})};_.states=mt;_.options=ct;_.className=Be;_.defaultOptions=Re;_.moduleName=me;_.folderName=Pe;var ce="split-button",ze=ce;import{Fragment as dt,jsx as pe,jsxs as Ue}from"react/jsx-runtime";var ue="k-split-button",pt=[c.hover,c.focus,c.active,c.selected,c.disabled],ut={size:[i.small,i.medium,i.large],rounded:[S.small,S.medium,S.large,S.full],fillMode:[I.solid,I.flat,I.outline,I.clear,I.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:i.medium,rounded:S.medium,fillMode:I.solid,themeColor:o.base,arrowIconName:"caret-alt-down"},B=t=>{let{size:e=$.size,rounded:n=$.rounded,fillMode:r=$.fillMode,themeColor:m=$.themeColor,hover:l,focus:s,active:p,selected:d,disabled:N,icon:M,text:L,arrowIconName:g=$.arrowIconName,popup:A,opened:x,...O}=t;return Ue(dt,{children:[Ue("div",{...O,className:a(t.className,ue,"k-button-group",y(ue,{rounded:n})),children:[pe(u,{text:L,icon:M,size:e,rounded:n,fillMode:r,themeColor:m,hover:l,focus:s,active:p,selected:d,disabled:N,children:t.children}),pe(u,{className:"k-split-button-arrow",icon:g,size:e,rounded:n,fillMode:r,disabled:N})]}),x&&A&&pe(_,{className:"k-menu-popup",children:A})]})};B.states=pt;B.options=ut;B.className=ue;B.defaultOptions=$;B.moduleName=ce;B.folderName=ze;var E="menu",k=E;import{Fragment as Nt,jsx as F,jsxs as He}from"react/jsx-runtime";var de="k-menu-item",ft=[c.hover,c.focus,c.active,c.selected,c.disabled],Mt={},De={iconPosition:"before"},T=t=>{let{hover:e,focus:n,active:r,selected:m,disabled:l,icon:s,text:p,first:d,last:N,showArrow:M,arrowIconName:L,iconPosition:g=De.iconPosition,dir:A,children:x,...O}=t,C=F(Nt,{});x&&x.forEach(P=>{if(P.type==="MenuItemContent"){C.props.children.push(P);return}});let h=L;return h||(h=A==="rtl"?"caret-alt-left":"caret-alt-right"),He("li",{...O,className:a(t.className,de,"k-item",R(de,{focus:n,disabled:l,hover:e,active:r,selected:m}),{"k-first":d,"k-last":N}),children:[He("span",{className:a("k-link k-menu-link"),children:[s&&g==="before"&&F(f,{className:"k-menu-link-icon",icon:s}),F("span",{className:"k-menu-link-text",children:p}),s&&g==="after"&&F(f,{className:"k-menu-link-icon",icon:s}),M&&F("span",{className:"k-menu-expand-arrow",children:F(f,{icon:h})})]}),C]})};T.states=ft;T.options=Mt;T.className=de;T.defaultOptions=De;T.moduleName=E;T.folderName=k;import{Fragment as It,jsx as V,jsxs as $e}from"react/jsx-runtime";var fe="k-menu-item",xt=[c.hover,c.focus,c.active,c.selected,c.disabled],ht={},Me={dir:"ltr",iconPosition:"before"},b=t=>{let{hover:e,focus:n,active:r,selected:m,disabled:l,icon:s,text:p,first:d,last:N,showArrow:M,arrowIconName:L,iconPosition:g=Me.iconPosition,dir:A=Me.dir,children:x,popup:O,...C}=t,h=V(It,{});x&&x.forEach(te=>{if(te.type==="MenuListItemContent"){h.props.children.push(te);return}});let P=L;return P||(P=A==="rtl"?"caret-alt-left":"caret-alt-right"),$e("li",{...C,className:a(t.className,fe,"k-item",R(fe,{focus:n,disabled:l}),{"k-first":d,"k-last":N}),children:[$e("span",{className:a("k-link k-menu-link",R("k-menu-link",{hover:e,active:r,selected:m,disabled:l})),children:[s&&g==="before"&&V(f,{className:"k-menu-link-icon",icon:s}),V("span",{className:"k-menu-link-text",children:p}),s&&g==="after"&&V(f,{className:"k-menu-link-icon",icon:s}),M&&V("span",{className:"k-menu-expand-arrow",children:V(f,{icon:P})})]}),h,O]})};b.states=xt;b.options=ht;b.className=fe;b.defaultOptions=Me;b.moduleName=E;b.folderName=k;import{jsx as At}from"react/jsx-runtime";var Fe="k-menu-scroll-wrapper",bt=[],Et={},Lt={},U=t=>{let{className:e,children:n,orientation:r,...m}=t;return At("div",{...m,className:a(e,Fe,{"k-menu-scroll-wrapper-vertical":r==="vertical"}),children:n})};U.states=bt;U.options=Et;U.className=Fe;U.defaultOptions=Lt;U.moduleName=E;U.folderName=k;var Ve=U;import{Fragment as Ne,jsx as H,jsxs as Z}from"react/jsx-runtime";var xe="k-menu",St=[],kt={},j={orientation:"horizontal",header:!0,scrollButtonsPosition:"around"},v=t=>{let{children:e,orientation:n=j.orientation,header:r=j.header,scrollable:m,scrollButtonsPosition:l=j.scrollButtonsPosition,wrapperStyles:s,dir:p,popup:d,...N}=t,M={horizontal:{prev:p!=="rtl"?"left":"right",next:p!=="rtl"?"right":"left"},vertical:{prev:"up",next:"down"}},L=H("ul",{dir:p,...N,className:a(t.className,"k-reset",xe,{[`${xe}-${n}`]:n,"k-header":r}),children:e});return Z(Ne,{children:[m?Z(Ve,{orientation:n,style:s,dir:t.dir,children:[l==="start"&&Z(Ne,{children:[H(u,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),H(u,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),l==="around"&&H(u,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),L,l==="end"&&Z(Ne,{children:[H(u,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].prev}`,className:"k-menu-scroll-button k-menu-scroll-button-prev"}),H(u,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}),l==="around"&&H(u,{fillMode:"flat",rounded:null,size:"medium",icon:`caret-alt-${M[n].next}`,className:"k-menu-scroll-button k-menu-scroll-button-next"})]}):L,d]})};v.states=St;v.options=kt;v.className=xe;v.defaultOptions=j;v.moduleName=E;v.folderName=k;import{jsx as gt}from"react/jsx-runtime";var he="k-separator",Je={orientation:"horizontal"},D=t=>{let{orientation:e=Je.orientation,...n}=t;return gt("li",{...n,className:a(t.className,"k-item",he,{[`${he}-${e}`]:e})})};D.className=he;D.defaultOptions=Je;D.moduleName=E;D.folderName=k;import{Fragment as An,jsx as Sn}from"react/jsx-runtime";import{jsx as We}from"react/jsx-runtime";import{createElement as vt}from"react";var Ie="k-menu-group",Ot=[],Tt={size:[i.small,i.medium,i.large]},be={size:i.medium,dir:"ltr"},w=t=>{let{children:e,size:n=be.size,dir:r=be.dir,...m}=t,l=[];return e&&Array.isArray(e)&&e.map((s,p)=>{s.type===b?l.push(vt(b,{...s.props,dir:r,key:p})):s.type===D?l.push(We(D,{})):l.push(s)}),We("ul",{...m,className:a(t.className,Ie,y(Ie,{size:n})),children:l})};w.states=Ot;w.options=Tt;w.className=Ie;w.defaultOptions=be;w.moduleName=E;w.folderName=k;import{Fragment as Kn,jsx as Pn,jsxs as Bn}from"react/jsx-runtime";import{Fragment as Fn,jsx as Dn,jsxs as $n}from"react/jsx-runtime";import{Fragment as Gn,jsx as Xn,jsxs as qn}from"react/jsx-runtime";import{Fragment as er,jsx as jn,jsxs as tr}from"react/jsx-runtime";import{Fragment as ir,jsx as sr,jsxs as ar}from"react/jsx-runtime";import{jsx as ee,jsxs as Ct}from"react/jsx-runtime";var Sr=t=>ee(B,{children:"button",opened:!0,popup:Ct(w,{children:[ee(b,{first:!0,text:"Menu Item"}),ee(b,{text:"Menu Item"}),ee(b,{last:!0,text:"Menu Item"})]}),...t});export{Sr as SplitButtonPopup};