UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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