UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 5.29 kB
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,n)=>e[n]||e[r]&&r||null).filter(r=>r!==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 i={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 U,jsx as L}from"react/jsx-runtime";var b="k-font-icon",D=[],G={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]},V={},x=t=>{let{size:e,themeColor:r,icon:n,rotate:c,flip:m,...s}=t;return n?L("span",{...s,className:a(t.className,b,p(b,{size:e}),{[`k-i-${n}`]:n,[`k-color-${r}`]:r,[`k-rotate-${c}`]:c,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):L(U,{})};x.states=D;x.options=G;x.className=b;x.defaultOptions=V;var _=x;import{Fragment as X,jsx as g}from"react/jsx-runtime";var C="k-svg-icon",q=[],J={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]},w={viewBox:"0 0 24 24"},u=t=>{let{size:e,themeColor:r,rotate:n,flip:c,viewBox:m=w.viewBox,icon:s,...N}=t;if(!s)return g(X,{});s==="none"&&{...N,className:a(t.className,C,"k-none")};let d=typeof s=="object"&&s.name&&s.name;return g("span",{...N,className:a(t.className,C,p("k-icon",{size:e}),{[`k-svg-i-${d}`]:d,[`k-color-${r}`]:r,[`k-rotate-${n}`]:n,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:g("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:m,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?void 0:t.children})})};u.states=q;u.options=J;u.className=C;u.defaultOptions=w;var I=u;import*as O from"@progress/kendo-svg-icons";var $="icon",F="icons";import{Fragment as H,jsx as h}from"react/jsx-runtime";var y="k-icon",W=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),j=[],Q={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]},M={viewBox:"0 0 24 24",type:"svg"},f=t=>{let{size:e,themeColor:r,icon:n,type:c=M.type,rotate:m,flip:s,viewBox:N=M.viewBox,...d}=t;if(!n)return h(H,{});if(c==="svg"){if(n==="none")return h(I,{...d,className:a(t.className,y),icon:n,size:e});let z=O[n]?n:W(`${n}-icon`);return O[z]?h(I,{...d,className:a(t.className,y),icon:O[z],size:e,themeColor:r,rotate:m,flip:s,viewBox:N}):h(H,{})}return h(_,{...d,className:a(t.className,y),icon:n,size:e,themeColor:r,rotate:m,flip:s})};f.states=j;f.options=Q;f.defaultOptions=M;f.className=y;f.moduleName=$;f.folderName=F;var A="notification",R=A;import{Fragment as ee,jsx as v,jsxs as B}from"react/jsx-runtime";var T="k-notification",Y=[],Z={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},l=t=>{let{actions:e,themeColor:r=S.themeColor,text:n,icon:c,closable:m=S.closable,...s}=t;return B("div",{...s,className:a(t.className,T,p(T,{themeColor:r}),{"k-notification-closable":m}),children:[c&&v(f,{className:"k-notification-status",icon:c}),t.children?B("div",{className:"k-notification-content",children:[n,t.children]}):v(ee,{children:n&&v("div",{className:"k-notification-content",children:n})}),e&&v("span",{className:"k-notification-actions",children:e})]})};l.states=Y;l.options=Z;l.className=T;l.defaultOptions=S;l.moduleName=A;l.folderName=R;import{jsx as E}from"react/jsx-runtime";var oe="k-notification-action",k=t=>{let{type:e}=t,r;switch(e){case"close":r=E(f,{icon:"x"});break;default:return E(f,{icon:e})}return E("span",{className:a(t.className,oe,`k-notification-${e}-action`),children:r})};import{jsx as te}from"react/jsx-runtime";var Ke=t=>te(l,{text:"Notification",icon:"exclamation-circle",...t});import{jsx as K}from"react/jsx-runtime";var Ve=t=>K(l,{closable:!0,text:"Notification",icon:"exclamation-circle",actions:K(k,{type:"close"}),...t});import{jsx as P}from"react/jsx-runtime";var Xe=t=>P(l,{closable:!0,text:"Notification",actions:P(k,{type:"close"}),...t});import{jsx as ie}from"react/jsx-runtime";var Ye=t=>ie(l,{text:"Notification",...t});export{Ke as IconNotification,Ve as IconNotificationClosable,T as NOTIFICATION_CLASSNAME,l as Notification,k as NotificationAction,Xe as NotificationClosable,Ye as NotificationNormal};