UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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