UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.41 kB
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((s,r)=>e[r]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var b=(t,e)=>l({[`${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"}),Q=(t,e)=>{let{valid:s,invalid:r,hover:a,focus:m,checked:i,active:x,selected:u,disabled:N,indeterminate:k,loading:E,empty:I,readonly:g,highlighted:M,...C}=e;return l({"k-valid":s,"k-invalid":r,"k-hover":a,"k-focus":m,"k-checked":i,"k-active":x,"k-selected":u,"k-disabled":N,"k-indeterminate":k&&!i,"k-loading":E,"k-empty":I,"k-readonly":g,"k-highlighted":M},Object.keys(C).reduce((_,A)=>(A.startsWith("k-")?_[A]=C[A]:_[`k-${A}`]=C[A],_),{}))};function Y(t,e){if(!e)return{};let s=Array.isArray(e)?e:[e];return Object.fromEntries(s.map(r=>[`k-${r}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},f={small:"small",medium:"medium",large:"large",full:"full"},d={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 be,jsx as Z}from"react/jsx-runtime";var U="k-font-icon",he=[],ge={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Me={},B=t=>{let{size:e,themeColor:s,icon:r,rotate:a,flip:m,...i}=t;return r?Z("span",{...i,className:l(t.className,U,b(U,{size:e}),{[`k-i-${r}`]:r,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):Z(be,{})};B.states=he;B.options=ge;B.className=U;B.defaultOptions=Me;var j=B;import{Fragment as ve,jsx as R}from"react/jsx-runtime";var D="k-svg-icon",ye=[],Oe={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},ee={viewBox:"0 0 24 24"},L=t=>{let{size:e,themeColor:s,rotate:r,flip:a,viewBox:m=ee.viewBox,icon:i,...x}=t;if(!i)return R(ve,{});i==="none"&&{...x,className:l(t.className,D,"k-none")};let u=typeof i=="object"&&i.name&&i.name;return R("span",{...x,className:l(t.className,D,b("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),children:R("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})})};L.states=ye;L.options=Oe;L.className=D;L.defaultOptions=ee;var H=L;import*as $ from"@progress/kendo-svg-icons";var oe="icon",te="icons";import{Fragment as ne,jsx as w}from"react/jsx-runtime";var K="k-icon",Ce=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ae=[],Te={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},F={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:s,icon:r,type:a=F.type,rotate:m,flip:i,viewBox:x=F.viewBox,...u}=t;if(!r)return w(ne,{});if(a==="svg"){if(r==="none")return w(H,{...u,className:l(t.className,K),icon:r,size:e});let N=$[r]?r:Ce(`${r}-icon`);return $[N]?w(H,{...u,className:l(t.className,K),icon:$[N],size:e,themeColor:s,rotate:m,flip:i,viewBox:x}):w(ne,{})}return w(j,{...u,className:l(t.className,K),icon:r,size:e,themeColor:s,rotate:m,flip:i})};h.states=Ae;h.options=Te;h.defaultOptions=F;h.className=K;h.moduleName=oe;h.folderName=te;var V="button",re=V;import{Fragment as Ie,jsx as P,jsxs as se}from"react/jsx-runtime";var z="k-button",Se=["icon-button"],ke=[c.hover,c.focus,c.active,c.selected,c.disabled,c.generating],Ee={size:[n.small,n.medium,n.large],rounded:[f.small,f.medium,f.large,f.full],fillMode:[d.solid,d.flat,d.outline,d.clear,d.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},T={size:n.medium,rounded:f.medium,fillMode:d.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=t=>{let{size:e=T.size,rounded:s=T.rounded,fillMode:r=T.fillMode,themeColor:a=T.themeColor,showArrow:m=T.showArrow,arrowIconName:i=T.arrowIconName,variant:x,hover:u,focus:N,active:k,selected:E,disabled:I,icon:g,text:M,iconClassName:C,..._}=t,A=g!==void 0,Ne=t.children!==void 0;return se("button",{..._,className:l(t.className,z,Y(z,x),b(z,{size:e,rounded:s,fillMode:r,themeColor:a}),Q(z,{hover:u,focus:N,active:k,disabled:I,selected:E}),{"k-icon-button":!M&&!Ne&&A}),children:[g&&P(h,{className:l(C,"k-button-icon"),icon:g}),M?se(Ie,{children:[M&&P("span",{className:"k-button-text",children:M}),t.children]}):t.children&&P("span",{className:"k-button-text",children:t.children}),m&&P("span",{className:"k-menu-button-arrow k-button-arrow",children:P(h,{icon:i})})]})};p.states=ke;p.options=Ee;p.variants=Se;p.className=z;p.defaultOptions=T;p.moduleName=V;p.folderName=re;import{jsx as Mo}from"react/jsx-runtime";import{jsx as vo}from"react/jsx-runtime";import{jsx as So}from"react/jsx-runtime";var G="popup",ie=G;import{jsx as le}from"react/jsx-runtime";var ae="k-animation-container",_e=[],Be={},me={positionMode:"absolute"},y=t=>{let{positionMode:e=me.positionMode,animationStyle:s,offset:r,...a}=t;return le("div",{...a,style:{...r,...t.style},className:l(t.className,ae,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:le("div",{className:"k-child-animation-container",style:s,children:t.children})})};y.states=_e;y.options=Be;y.className=ae;y.defaultOptions=me;y.moduleName=G;y.folderName=ie;var q="popup",de=q;import{jsx as ce}from"react/jsx-runtime";var pe="k-popup",Le=[],we={},ue={positionMode:"absolute"},O=t=>{let{offset:e,positionMode:s=ue.positionMode,animationStyle:r,...a}=t;return ce(y,{positionMode:s,offset:e,animationStyle:r,children:ce("div",{...a,className:l(t.className,pe),children:t.children})})};O.states=Le;O.options=we;O.className=pe;O.defaultOptions=ue;O.moduleName=q;O.folderName=de;var J="split-button",fe=J;import{Fragment as Re,jsx as W,jsxs as xe}from"react/jsx-runtime";var X="k-split-button",Pe=[c.hover,c.focus,c.active,c.selected,c.disabled],ze={size:[n.small,n.medium,n.large],rounded:[f.small,f.medium,f.large,f.full],fillMode:[d.solid,d.flat,d.outline,d.clear,d.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},S={size:n.medium,rounded:f.medium,fillMode:d.solid,themeColor:o.base,arrowIconName:"caret-alt-down"},v=t=>{let{size:e=S.size,rounded:s=S.rounded,fillMode:r=S.fillMode,themeColor:a=S.themeColor,hover:m,focus:i,active:x,selected:u,disabled:N,icon:k,text:E,arrowIconName:I=S.arrowIconName,popup:g,opened:M,...C}=t;return xe(Re,{children:[xe("div",{...C,className:l(t.className,X,"k-button-group",b(X,{rounded:s})),children:[W(p,{text:E,icon:k,size:e,rounded:s,fillMode:r,themeColor:a,hover:m,focus:i,active:x,selected:u,disabled:N,children:t.children}),W(p,{className:"k-split-button-arrow",icon:I,size:e,rounded:s,fillMode:r,disabled:N})]}),M&&g&&W(O,{className:"k-menu-popup",children:g})]})};v.states=Pe;v.options=ze;v.className=X;v.defaultOptions=S;v.moduleName=J;v.folderName=fe;import{jsx as Ke}from"react/jsx-runtime";var nt=t=>Ke(v,{icon:"folder",children:"Button",...t});export{nt as IconTextSplitButton};