@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.09 kB
JavaScript
var l=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((s,a)=>e[a]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var p=(o,e)=>l({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${e.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"});var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var d={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},t={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"};var O={};function L(o){return O[o]=(O[o]||0)+1,`k-${o}-${O[o]}`}import{Fragment as q,jsx as $}from"react/jsx-runtime";var T="k-font-icon",U=[],G={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info]},j={},v=o=>{let{size:e,themeColor:s,icon:a,rotate:r,flip:c,...m}=o;return a?$("span",{...m,className:l(o.className,T,p(T,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),"aria-hidden":"true"}):$(q,{})};v.states=U;v.options=G;v.className=T;v.defaultOptions=j;var F=v;import{Fragment as W,jsx as N}from"react/jsx-runtime";var M="k-svg-icon",J=[],X={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[d.outline,d.solid,d.duotone]},S={viewBox:"0 0 24 24",variant:d.outline},y=o=>{let{size:e,themeColor:s,rotate:a,flip:r,viewBox:c=S.viewBox,variant:m=S.variant,icon:i,...x}=o;if(!i)return N(W,{});if(i==="none")return N("span",{...x,className:l(o.className,M,p("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let h=typeof i=="object"&&i.name&&i.name,g=typeof i=="object"?m&&i.variants?.[m]||i.variants?.outline||i.content:void 0;return N("span",{...x,className:l(o.className,M,p("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:N("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:c,dangerouslySetInnerHTML:g!==void 0?{__html:g}:void 0,children:i?void 0:o.children})})};y.states=J;y.options=X;y.className=M;y.defaultOptions=S;var A=y;import*as E from"@progress/kendo-svg-icons";var R="icon",B="icons";import{useContext as Y}from"react";import{createContext as Q}from"react";var H=Q({iconsType:"svg"});import{Fragment as D,jsx as b}from"react/jsx-runtime";var k="k-icon",Z=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ee=[],te={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[d.outline,d.solid,d.duotone]},C={viewBox:"0 0 24 24",type:"svg",variant:d.outline},u=o=>{let{iconsType:e}=Y(H),{size:s,themeColor:a,icon:r,type:c=e||C.type,rotate:m,flip:i,viewBox:x=C.viewBox,variant:h=C.variant,...g}=o;if(!r)return b(D,{});if((e||c)==="svg"){if(r==="none")return b(A,{...g,className:l(o.className,k),icon:r,size:s,variant:h});let _=E[r]?r:Z(`${r}-icon`);return E[_]?b(A,{...g,className:l(o.className,k),icon:E[_],size:s,themeColor:a,rotate:m,flip:i,viewBox:x,variant:h}):b(D,{})}return b(F,{...g,className:l(o.className,k),icon:r,size:s,themeColor:a,rotate:m,flip:i})};u.states=ee;u.options=te;u.defaultOptions=C;u.className=k;u.moduleName=R;u.folderName=B;u.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};var z="notification",K=z;import{Fragment as ie,jsx as I,jsxs as P}from"react/jsx-runtime";var w="k-notification",oe=[],ne={themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.inverse]},V={closable:!1},f=o=>{let{actions:e,themeColor:s,text:a,icon:r,closable:c=V.closable,...m}=o,i=L("notification-content"),x=!!(a||o.children);return P("div",{...m,className:l(o.className,w,p(w,{themeColor:s}),{"k-notification-closable":c}),role:"status","aria-live":"polite","aria-describedby":x?i:void 0,children:[r&&I(u,{className:"k-notification-status",icon:r}),o.children?P("div",{id:i,className:"k-notification-content",children:[a,o.children]}):I(ie,{children:a&&I("div",{id:i,className:"k-notification-content",children:a})}),e&&I("span",{className:"k-notification-actions",children:e})]})};f.states=oe;f.options=ne;f.className=w;f.defaultOptions=V;f.moduleName=z;f.folderName=K;f.ariaSpec={selector:".k-notification",rules:[{selector:".k-notification",attribute:"role=status",usage:"Notification element should be marked as a status. Uses status instead of alert to avoid interrupting screen reader workflow."},{selector:".k-notification",attribute:"aria-live=polite",usage:"The aria-live value must be polite so it will not obscure other essential information."},{selector:".k-notification",attribute:"aria-describedby=.k-notification-content id",usage:"Used so that the content of the Notification will be announced by assistive technologies."},{selector:".k-notification .k-svg-i-x, .k-notification .k-i-x",attribute:"aria-hidden=true",usage:"The close button icon should not be present in the accessibility tree."}]};var Ke=f;export{w as NOTIFICATION_CLASSNAME,f as Notification,Ke as default};