UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.01 kB
var a=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((i,l)=>e[l]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var f=(o,e)=>a({[`${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 n={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"},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 w={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var O={};function $(o){return O[o]=(O[o]||0)+1,`k-${o}-${O[o]}`}import{Fragment as X,jsx as R}from"react/jsx-runtime";var I="k-font-icon",j=[],q={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info]},J={},v=o=>{let{size:e,themeColor:i,icon:l,rotate:r,flip:c,...d}=o;return l?R("span",{...d,className:a(o.className,I,f(I,{size:e}),{[`k-i-${l}`]:l,[`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"}):R(X,{})};v.states=j;v.options=q;v.className=I;v.defaultOptions=J;var P=v;import{Fragment as Y,jsx as C}from"react/jsx-runtime";var M="k-svg-icon",W=[],Q={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[m.outline,m.solid,m.duotone]},S={viewBox:"0 0 24 24",variant:m.outline},b=o=>{let{size:e,themeColor:i,rotate:l,flip:r,viewBox:c=S.viewBox,variant:d=S.variant,icon:s,...x}=o;if(!s)return C(Y,{});if(s==="none")return C("span",{...x,className:a(o.className,M,f("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let h=typeof s=="object"&&s.name&&s.name,g=typeof s=="object"?d&&s.variants?.[d]||s.variants?.outline||s.content:void 0;return C("span",{...x,className:a(o.className,M,f("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`k-color-${i}`]:i,[`k-rotate-${l}`]:l,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:C("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:c,dangerouslySetInnerHTML:g!==void 0?{__html:g}:void 0,children:s?void 0:o.children})})};b.states=W;b.options=Q;b.className=M;b.defaultOptions=S;var L=b;import*as E from"@progress/kendo-svg-icons";var B="icon",H="icons";import{useContext as ee}from"react";import{createContext as Z}from"react";var F=Z({iconsType:"svg"});import{Fragment as D,jsx as y}from"react/jsx-runtime";var N="k-icon",te=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),oe=[],ne={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.undefined,t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info],variant:[m.outline,m.solid,m.duotone]},T={viewBox:"0 0 24 24",type:"svg",variant:m.outline},p=o=>{let{iconsType:e}=ee(F),{size:i,themeColor:l,icon:r,type:c=e||T.type,rotate:d,flip:s,viewBox:x=T.viewBox,variant:h=T.variant,...g}=o;if(!r)return y(D,{});if((e||c)==="svg"){if(r==="none")return y(L,{...g,className:a(o.className,N),icon:r,size:i,variant:h});let _=E[r]?r:te(`${r}-icon`);return E[_]?y(L,{...g,className:a(o.className,N),icon:E[_],size:i,themeColor:l,rotate:d,flip:s,viewBox:x,variant:h}):y(D,{})}return y(P,{...g,className:a(o.className,N),icon:r,size:i,themeColor:l,rotate:d,flip:s})};p.states=oe;p.options=ne;p.defaultOptions=T;p.className=N;p.moduleName=B;p.folderName=H;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 z="tooltip",K=z;import{jsx as k,jsxs as V}from"react/jsx-runtime";var A="k-tooltip",ie=[],re={themeColor:[t.undefined,t.base,t.inverse,t.info,t.success,t.warning,t.error]},G={closable:!1},u=o=>{let{closable:e=G.closable,callout:i,themeColor:l,title:r,content:c,icon:d,id:s=$("tooltip"),...x}=o;return V("div",{...x,className:a(o.className,A,f(A,{themeColor:l}),{"k-tooltip-closable":e}),role:"tooltip",id:s,children:[d&&k(p,{className:"k-tooltip-icon",icon:d}),V("div",{className:"k-tooltip-content",children:[r&&k("div",{className:"k-tooltip-title",children:r}),c]}),e&&k("div",{className:"k-tooltip-button",role:"button","aria-label":"Close",tabIndex:0,children:k(p,{icon:"x"})}),i&&k("div",{className:a("k-callout",{[`k-callout-${w.calloutMap[i]||i}`]:i})})]})};u.states=ie;u.options=re;u.className=A;u.defaultOptions=G;u.moduleName=z;u.folderName=K;u.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 U=u;import{jsx as se}from"react/jsx-runtime";var je=o=>se(U,{content:"Tooltip Content",...o});export{je as TooltipNormal};