@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 4.45 kB
JavaScript
var c=(...t)=>t.filter(o=>o!==!0&&!!o).map(o=>Array.isArray(o)?c(...o):typeof o=="object"?Object.keys(o).map((l,i)=>o[i]||o[l]&&l||null).filter(l=>l!==null).join(" "):o).filter(o=>!!o).join(" ");var f=(t,o)=>c({[`${t}-xs`]:o.size==="xsmall",[`${t}-sm`]:o.size==="small",[`${t}-md`]:o.size==="medium",[`${t}-lg`]:o.size==="large",[`${t}-xl`]:o.size==="xlarge",[`${t}-xxl`]:o.size==="xxlarge",[`${t}-xxxl`]:o.size==="xxxlarge"},{[`${t}-${o.fillMode}`]:o.fillMode},{[`${t}-${o.fillMode}-${o.themeColor}`]:o.fillMode&&o.themeColor},{[`${t}-${o.themeColor}`]:o.themeColor&&o.fillMode===void 0},{"k-rounded-sm":o.rounded==="small","k-rounded-md":o.rounded==="medium","k-rounded-lg":o.rounded==="large","k-rounded-full":o.rounded==="full"});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},x={small:"small",medium:"medium",large:"large",full:"full"},b={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},e={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"};import{jsx as H}from"react/jsx-runtime";var p="k-badge",L=[],F={size:[n.small,n.medium,n.large],rounded:[x.small,x.medium,x.large,x.full],fillMode:[b.solid,b.outline],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark,e.inverse]},g={size:n.medium,fillMode:b.solid,themeColor:e.primary,cutoutBorder:!1},u=t=>{let{size:o=g.size,fillMode:l=g.fillMode,themeColor:i=g.themeColor,cutoutBorder:s=g.cutoutBorder,rounded:a,position:r,align:m,...d}=t;return H("span",{...d,className:c(t.className,p,f(p,{size:o,rounded:a,fillMode:l,themeColor:i}),{[`${p}-${r}`]:r,[`k-${m}`]:m,[`${p}-border-cutout`]:s}),children:t.children})};u.states=L;u.options=F;u.className=p;u.defaultOptions=g;import{jsx as le}from"react/jsx-runtime";import{Fragment as G,jsx as $}from"react/jsx-runtime";var C="k-icon k-font-icon",E=[],P={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark]},_={},h=t=>{let{size:o,themeColor:l,icon:i,rotate:s,flip:a,...r}=t;return i?$("span",{...r,className:c(t.className,C,f(C,{size:o}),{[`k-i-${i}`]:i,[`k-color-${l}`]:l,[`k-rotate-${s}`]:s,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"})}):$(G,{})};h.states=E;h.options=P;h.className=C;h.defaultOptions=_;var w=h;import{Fragment as K,jsx as z}from"react/jsx-runtime";var S="k-icon k-svg-icon",R=[],V={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark]},N={viewBox:"0 0 24 24"},y=t=>{let{size:o,themeColor:l,rotate:i,flip:s,viewBox:a=N.viewBox,icon:r,...m}=t;if(!r)return z(K,{});r==="none"&&{...m,className:c(t.className,S,"k-none")};let d=typeof r=="object"&&r.name&&r.name;return z("span",{...m,className:c(t.className,S,f("k-icon",{size:o}),{[`k-svg-i-${d}`]:d,[`k-color-${l}`]:l,[`k-rotate-${i}`]:i,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),children:z("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof r=="object"?r.viewBox:a,dangerouslySetInnerHTML:typeof r=="object"?{__html:r.content}:void 0,children:r?void 0:t.children})})};y.states=R;y.options=V;y.className=S;y.defaultOptions=N;var B=y;import*as O from"@progress/kendo-svg-icons";import{Fragment as T,jsx as v}from"react/jsx-runtime";var q=t=>t.replace(/([-_][a-z0-9])/gi,o=>o.toUpperCase().replace("-","").replace("_","")),j=[],D={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark]},M={viewBox:"0 0 24 24",type:"svg"},k=t=>{let{size:o,themeColor:l,icon:i,type:s=M.type,rotate:a,flip:r,viewBox:m=M.viewBox,...d}=t;if(!i)return v(T,{});if(s==="svg"){if(i==="none")return v(B,{...d,icon:i,size:o});let I=q(`${i}-icon`);return O[I]?v(B,{...d,icon:O[I],size:o,themeColor:l,rotate:a,flip:r,viewBox:m}):v(T,{})}return v(w,{...d,icon:i,size:o,themeColor:l,rotate:a,flip:r})};k.states=j;k.options=D;k.defaultOptions=M;import{jsx as A}from"react/jsx-runtime";var we=t=>A(u,{children:A(k,{className:"k-badge-icon",icon:"x-circle"}),...t});export{we as IconBadge};