UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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