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