@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 4.47 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((s,i)=>e[i]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var p=(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"});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var 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"};import{Fragment as K,jsx as E}from"react/jsx-runtime";var k="k-font-icon",R=[],H={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]},D={},x=t=>{let{size:e,themeColor:s,icon:i,rotate:l,flip:c,...r}=t;return i?E("span",{...r,className:a(t.className,k,p(k,{size:e}),{[`k-i-${i}`]:i,[`k-color-${s}`]:s,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):E(K,{})};x.states=R;x.options=H;x.className=k;x.defaultOptions=D;var z=x;import{Fragment as V,jsx as N}from"react/jsx-runtime";var b="k-svg-icon",P=[],G={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]},_={viewBox:"0 0 24 24"},u=t=>{let{size:e,themeColor:s,rotate:i,flip:l,viewBox:c=_.viewBox,icon:r,...g}=t;if(!r)return N(V,{});r==="none"&&{...g,className:a(t.className,b,"k-none")};let f=typeof r=="object"&&r.name&&r.name;return N("span",{...g,className:a(t.className,b,p("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${s}`]:s,[`k-rotate-${i}`]:i,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:N("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof r=="object"?r.viewBox:c,dangerouslySetInnerHTML:typeof r=="object"?{__html:r.content}:void 0,children:r?void 0:t.children})})};u.states=P;u.options=G;u.className=b;u.defaultOptions=_;var C=u;import*as I from"@progress/kendo-svg-icons";var L="icon",w="icons";import{Fragment as $,jsx as h}from"react/jsx-runtime";var v="k-icon",j=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),U=[],q={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]},O={viewBox:"0 0 24 24",type:"svg"},m=t=>{let{size:e,themeColor:s,icon:i,type:l=O.type,rotate:c,flip:r,viewBox:g=O.viewBox,...f}=t;if(!i)return h($,{});if(l==="svg"){if(i==="none")return h(C,{...f,className:a(t.className,v),icon:i,size:e});let T=I[i]?i:j(`${i}-icon`);return I[T]?h(C,{...f,className:a(t.className,v),icon:I[T],size:e,themeColor:s,rotate:c,flip:r,viewBox:g}):h($,{})}return h(z,{...f,className:a(t.className,v),icon:i,size:e,themeColor:s,rotate:c,flip:r})};m.states=U;m.options=q;m.defaultOptions=O;m.className=v;m.moduleName=L;m.folderName=w;var M="notification",F=M;import{Fragment as W,jsx as y,jsxs as B}from"react/jsx-runtime";var A="k-notification",J=[],X={themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},S={themeColor:o.base,closable:!1},d=t=>{let{actions:e,themeColor:s=S.themeColor,text:i,icon:l,closable:c=S.closable,...r}=t;return B("div",{...r,className:a(t.className,A,p(A,{themeColor:s}),{"k-notification-closable":c}),children:[l&&y(m,{className:"k-notification-status",icon:l}),t.children?B("div",{className:"k-notification-content",children:[i,t.children]}):y(W,{children:i&&y("div",{className:"k-notification-content",children:i})}),e&&y("span",{className:"k-notification-actions",children:e})]})};d.states=J;d.options=X;d.className=A;d.defaultOptions=S;d.moduleName=M;d.folderName=F;var Me=d;export{A as NOTIFICATION_CLASSNAME,d as Notification,Me as default};