UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.78 kB
var W=Object.create;var O=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty;var te=(t,e)=>{for(var n in e)O(t,n,{get:e[n],enumerable:!0})},P=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Y(e))!ee.call(t,r)&&r!==n&&O(t,r,{get:()=>e[r],enumerable:!(a=Q(e,r))||a.enumerable});return t};var oe=(t,e,n)=>(n=t!=null?W(Z(t)):{},P(e||!t||!t.__esModule?O(n,"default",{value:t,enumerable:!0}):n,t)),ne=t=>P(O({},"__esModule",{value:!0}),t);var xe={};te(xe,{TooltipClosable:()=>fe});module.exports=ne(xe);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 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 i={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var m={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 B={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var L={};function H(t){return L[t]=(L[t]||0)+1,`k-${t}-${L[t]}`}var C=require("react/jsx-runtime"),E="k-font-icon",ie=[],re={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},se={},N=t=>{let{size:e,themeColor:n,icon:a,rotate:r,flip:c,...d}=t;return a?(0,C.jsx)("span",{...d,className:l(t.className,E,g(E,{size:e}),{[`k-i-${a}`]:a,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),"aria-hidden":"true"}):(0,C.jsx)(C.Fragment,{})};N.states=ie;N.options=re;N.className=E;N.defaultOptions=se;var F=N;var h=require("react/jsx-runtime"),z="k-svg-icon",ae=[],le={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[m.outline,m.solid,m.duotone]},A={viewBox:"0 0 24 24",variant:m.outline},T=t=>{var S,y;let{size:e,themeColor:n,rotate:a,flip:r,viewBox:c=A.viewBox,variant:d=A.variant,icon:s,...v}=t;if(!s)return(0,h.jsx)(h.Fragment,{});if(s==="none")return(0,h.jsx)("span",{...v,className:l(t.className,z,g("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let k=typeof s=="object"&&s.name&&s.name,b=typeof s=="object"?d&&((S=s.variants)==null?void 0:S[d])||((y=s.variants)==null?void 0:y.outline)||s.content:void 0;return(0,h.jsx)("span",{...v,className:l(t.className,z,g("k-icon",{size:e}),{[`k-svg-i-${k}`]:k,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"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 s=="object"?s.viewBox:c,dangerouslySetInnerHTML:b!==void 0?{__html:b}:void 0,children:s?void 0:t.children})})};T.states=ae;T.options=le;T.className=z;T.defaultOptions=A;var _=T;var w=oe(require("@progress/kendo-svg-icons"));var D="icon",K="icons";var U=require("react");var V=require("react"),G=(0,V.createContext)({iconsType:"svg"});var u=require("react/jsx-runtime"),I="k-icon",ce=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),de=[],me={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[m.outline,m.solid,m.duotone]},M={viewBox:"0 0 24 24",type:"svg",variant:m.outline},p=t=>{let{iconsType:e}=(0,U.useContext)(G),{size:n,themeColor:a,icon:r,type:c=e||M.type,rotate:d,flip:s,viewBox:v=M.viewBox,variant:k=M.variant,...b}=t;if(!r)return(0,u.jsx)(u.Fragment,{});if((e||c)==="svg"){if(r==="none")return(0,u.jsx)(_,{...b,className:l(t.className,I),icon:r,size:n,variant:k});let y=w[r]?r:ce(`${r}-icon`);return w[y]?(0,u.jsx)(_,{...b,className:l(t.className,I),icon:w[y],size:n,themeColor:a,rotate:d,flip:s,viewBox:v,variant:k}):(0,u.jsx)(u.Fragment,{})}return(0,u.jsx)(F,{...b,className:l(t.className,I),icon:r,size:n,themeColor:a,rotate:d,flip:s})};p.states=de;p.options=me;p.defaultOptions=M;p.className=I;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 $="tooltip",j=$;var f=require("react/jsx-runtime"),R="k-tooltip",pe=[],ue={themeColor:[o.undefined,o.base,o.inverse,o.info,o.success,o.warning,o.error]},q={closable:!1},x=t=>{let{closable:e=q.closable,callout:n,themeColor:a,title:r,content:c,icon:d,id:s=H("tooltip"),...v}=t;return(0,f.jsxs)("div",{...v,className:l(t.className,R,g(R,{themeColor:a}),{"k-tooltip-closable":e}),role:"tooltip",id:s,children:[d&&(0,f.jsx)(p,{className:"k-tooltip-icon",icon:d}),(0,f.jsxs)("div",{className:"k-tooltip-content",children:[r&&(0,f.jsx)("div",{className:"k-tooltip-title",children:r}),c]}),e&&(0,f.jsx)("div",{className:"k-tooltip-button",role:"button","aria-label":"Close",tabIndex:0,children:(0,f.jsx)(p,{icon:"x"})}),n&&(0,f.jsx)("div",{className:l("k-callout",{[`k-callout-${B.calloutMap[n]||n}`]:n})})]})};x.states=pe;x.options=ue;x.className=R;x.defaultOptions=q;x.moduleName=$;x.folderName=j;x.ariaSpec={selector:".k-tooltip",implicitRole:"tooltip",rules:[{selector:".k-tooltip",attribute:"role=tooltip",usage:"Specifies the tooltip role of the tooltip container."},{selector:".k-tooltip",attribute:"id",usage:"The element needs an id to be associated with the aria-describedby attribute of the trigger element."},{selector:".k-tooltip .k-tooltip-button",attribute:"role=button",usage:"The close button needs an explicit button role."},{selector:".k-tooltip .k-tooltip-button",attribute:"aria-label",usage:"The close button needs an accessible name."}]};var J=x;var X=require("react/jsx-runtime"),fe=t=>(0,X.jsx)(J,{content:"Closeable tooltip content",closable:!0,...t});