@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 6.82 kB
JavaScript
var q=Object.create;var O=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var Y=(t,e)=>{for(var i in e)O(t,i,{get:e[i],enumerable:!0})},R=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of X(e))!Q.call(t,r)&&r!==i&&O(t,r,{get:()=>e[r],enumerable:!(s=J(e,r))||s.enumerable});return t};var Z=(t,e,i)=>(i=t!=null?q(W(t)):{},R(e||!t||!t.__esModule?O(i,"default",{value:t,enumerable:!0}):i,t)),ee=t=>R(O({},"__esModule",{value:!0}),t);var ue={};Y(ue,{NOTIFICATION_CLASSNAME:()=>S,Notification:()=>x,default:()=>me});module.exports=ee(ue);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((i,s)=>e[s]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var g=(t,e)=>l({[`${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.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"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"};var E={};function B(t){return E[t]=(E[t]||0)+1,`k-${t}-${E[t]}`}var k=require("react/jsx-runtime"),z="k-font-icon",te=[],oe={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},ne={},C=t=>{let{size:e,themeColor:i,icon:s,rotate:r,flip:c,...u}=t;return s?(0,k.jsx)("span",{...u,className:l(t.className,z,g(z,{size:e}),{[`k-i-${s}`]:s,[`k-color-${i}`]:i,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),"aria-hidden":"true"}):(0,k.jsx)(k.Fragment,{})};C.states=te;C.options=oe;C.className=z;C.defaultOptions=ne;var H=C;var h=require("react/jsx-runtime"),w="k-svg-icon",ie=[],re={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[d.outline,d.solid,d.duotone]},_={viewBox:"0 0 24 24",variant:d.outline},I=t=>{var A,N;let{size:e,themeColor:i,rotate:s,flip:r,viewBox:c=_.viewBox,variant:u=_.variant,icon:a,...v}=t;if(!a)return(0,h.jsx)(h.Fragment,{});if(a==="none")return(0,h.jsx)("span",{...v,className:l(t.className,w,g("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let b=typeof a=="object"&&a.name&&a.name,y=typeof a=="object"?u&&((A=a.variants)==null?void 0:A[u])||((N=a.variants)==null?void 0:N.outline)||a.content:void 0;return(0,h.jsx)("span",{...v,className:l(t.className,w,g("k-icon",{size:e}),{[`k-svg-i-${b}`]:b,[`k-color-${i}`]:i,[`k-rotate-${s}`]:s,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:(0,h.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:c,dangerouslySetInnerHTML:y!==void 0?{__html:y}:void 0,children:a?void 0:t.children})})};I.states=ie;I.options=re;I.className=w;I.defaultOptions=_;var L=I;var $=Z(require("@progress/kendo-svg-icons"));var D="icon",K="icons";var U=require("react");var P=require("react"),V=(0,P.createContext)({iconsType:"svg"});var f=require("react/jsx-runtime"),T="k-icon",se=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ae=[],le={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[d.outline,d.solid,d.duotone]},M={viewBox:"0 0 24 24",type:"svg",variant:d.outline},p=t=>{let{iconsType:e}=(0,U.useContext)(V),{size:i,themeColor:s,icon:r,type:c=e||M.type,rotate:u,flip:a,viewBox:v=M.viewBox,variant:b=M.variant,...y}=t;if(!r)return(0,f.jsx)(f.Fragment,{});if((e||c)==="svg"){if(r==="none")return(0,f.jsx)(L,{...y,className:l(t.className,T),icon:r,size:i,variant:b});let N=$[r]?r:se(`${r}-icon`);return $[N]?(0,f.jsx)(L,{...y,className:l(t.className,T),icon:$[N],size:i,themeColor:s,rotate:u,flip:a,viewBox:v,variant:b}):(0,f.jsx)(f.Fragment,{})}return(0,f.jsx)(H,{...y,className:l(t.className,T),icon:r,size:i,themeColor:s,rotate:u,flip:a})};p.states=ae;p.options=le;p.defaultOptions=M;p.className=T;p.moduleName=D;p.folderName=K;p.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 F="notification",G=F;var m=require("react/jsx-runtime"),S="k-notification",ce=[],de={themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.inverse]},j={closable:!1},x=t=>{let{actions:e,themeColor:i,text:s,icon:r,closable:c=j.closable,...u}=t,a=B("notification-content"),v=!!(s||t.children);return(0,m.jsxs)("div",{...u,className:l(t.className,S,g(S,{themeColor:i}),{"k-notification-closable":c}),role:"status","aria-live":"polite","aria-describedby":v?a:void 0,children:[r&&(0,m.jsx)(p,{className:"k-notification-status",icon:r}),t.children?(0,m.jsxs)("div",{id:a,className:"k-notification-content",children:[s,t.children]}):(0,m.jsx)(m.Fragment,{children:s&&(0,m.jsx)("div",{id:a,className:"k-notification-content",children:s})}),e&&(0,m.jsx)("span",{className:"k-notification-actions",children:e})]})};x.states=ce;x.options=de;x.className=S;x.defaultOptions=j;x.moduleName=F;x.folderName=G;x.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 me=x;