@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 7.14 kB
JavaScript
var Y=Object.create;var O=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ne=(t,e)=>{for(var n in e)O(t,n,{get:e[n],enumerable:!0})},D=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ee(e))!oe.call(t,a)&&a!==n&&O(t,a,{get:()=>e[a],enumerable:!(s=Z(e,a))||s.enumerable});return t};var re=(t,e,n)=>(n=t!=null?Y(te(t)):{},D(e||!t||!t.__esModule?O(n,"default",{value:t,enumerable:!0}):n,t)),ae=t=>D(O({},"__esModule",{value:!0}),t);var be={};ne(be,{BUBBLE_CLASSNAME:()=>L,Bubble:()=>b,default:()=>xe});module.exports=ae(be);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((n,s)=>e[s]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var N=(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"}),P=(t,e)=>{let{valid:n,invalid:s,hover:a,focus:d,checked:c,active:i,selected:f,disabled:g,indeterminate:x,loading:k,empty:h,readonly:X,highlighted:Q,...z}=e;return l({"k-valid":n,"k-invalid":s,"k-hover":a,"k-focus":d,"k-checked":c,"k-active":i,"k-selected":f,"k-disabled":g,"k-indeterminate":x&&!c,"k-loading":k,"k-empty":h,"k-readonly":X,"k-highlighted":Q},Object.keys(z).reduce((A,C)=>(C.startsWith("k-")?A[C]=z[C]:A[`k-${C}`]=z[C],A),{}))};var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var u={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"},S={open:"open",hover:"hover",focus:"focus",active:"active",selected:"selected",disabled:"disabled",valid:"valid",invalid:"invalid",loading:"loading",required:"required",empty:"empty",indeterminate:"indeterminate",checked:"checked",readonly:"readonly",highlighted:"highlighted",generating:"generating",expanded:"expanded"};var I=require("react/jsx-runtime"),_="k-font-icon",ie=[],se={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},le={},B=t=>{let{size:e,themeColor:n,icon:s,rotate:a,flip:d,...c}=t;return s?(0,I.jsx)("span",{...c,className:l(t.className,_,N(_,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):(0,I.jsx)(I.Fragment,{})};B.states=ie;B.options=se;B.className=_;B.defaultOptions=le;var U=B;var v=require("react/jsx-runtime"),w="k-svg-icon",ce=[],de={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[u.outline,u.solid,u.duotone]},$={viewBox:"0 0 24 24",variant:u.outline},M=t=>{var k,h;let{size:e,themeColor:n,rotate:s,flip:a,viewBox:d=$.viewBox,variant:c=$.variant,icon:i,...f}=t;if(!i)return(0,v.jsx)(v.Fragment,{});if(i==="none")return(0,v.jsx)("span",{...f,className:l(t.className,w,N("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let g=typeof i=="object"&&i.name&&i.name,x=typeof i=="object"?c&&((k=i.variants)==null?void 0:k[c])||((h=i.variants)==null?void 0:h.outline)||i.content:void 0;return(0,v.jsx)("span",{...f,className:l(t.className,w,N("k-icon",{size:e}),{[`k-svg-i-${g}`]:g,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:(0,v.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:d,dangerouslySetInnerHTML:x!==void 0?{__html:x}:void 0,children:i?void 0:t.children})})};M.states=ce;M.options=de;M.className=w;M.defaultOptions=$;var R=M;var H=re(require("@progress/kendo-svg-icons"));var V="icon",G="icons";var J=require("react");var j=require("react"),q=(0,j.createContext)({iconsType:"svg"});var p=require("react/jsx-runtime"),E="k-icon",ue=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),me=[],pe={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[u.outline,u.solid,u.duotone]},T={viewBox:"0 0 24 24",type:"svg",variant:u.outline},m=t=>{let{iconsType:e}=(0,J.useContext)(q),{size:n,themeColor:s,icon:a,type:d=e||T.type,rotate:c,flip:i,viewBox:f=T.viewBox,variant:g=T.variant,...x}=t;if(!a)return(0,p.jsx)(p.Fragment,{});if((e||d)==="svg"){if(a==="none")return(0,p.jsx)(R,{...x,className:l(t.className,E),icon:a,size:n,variant:g});let h=H[a]?a:ue(`${a}-icon`);return H[h]?(0,p.jsx)(R,{...x,className:l(t.className,E),icon:H[h],size:n,themeColor:s,rotate:c,flip:i,viewBox:f,variant:g}):(0,p.jsx)(p.Fragment,{})}return(0,p.jsx)(U,{...x,className:l(t.className,E),icon:a,size:n,themeColor:s,rotate:c,flip:i})};m.states=me;m.options=pe;m.defaultOptions=T;m.className=E;m.moduleName=V;m.folderName=G;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 F="bubble",W=F;var y=require("react/jsx-runtime"),L="k-bubble",fe=[S.hover,S.active,S.selected,S.focus],K={expandable:!1,expanded:!1},b=t=>{let{content:e,hover:n,active:s,focus:a,selected:d,expandable:c=K.expandable,expanded:i=K.expanded,...f}=t;return(0,y.jsxs)("div",{...f,className:l(t.className,L,P(L,{hover:n,active:s,focus:a,selected:d}),{"k-bubble-expandable":c},{"k-expanded":i}),tabIndex:0,children:[(0,y.jsx)("div",{className:"k-bubble-content",children:e??t.children}),c&&(0,y.jsx)("span",{className:"k-bubble-expandable-indicator",role:"button","aria-label":i?"Show less":"Show more",tabIndex:0,children:i?(0,y.jsx)(m,{icon:"chevron-up"}):(0,y.jsx)(m,{icon:"chevron-down"})})]})};b.states=fe;b.className=L;b.defaultOptions=K;b.moduleName=F;b.folderName=W;b.ariaSpec={selector:".k-bubble",rules:[{selector:".k-bubble",attribute:"tabindex=0",usage:"The Chat bubble must be focusable."},{selector:".k-bubble-expandable-indicator",attribute:"role=button",usage:"The expandable indicator must have an appropriate role."},{selector:".k-bubble-expandable-indicator",attribute:"aria-label or title",usage:"The expandable indicator must be properly labelled."},{selector:".k-bubble-expandable-indicator",attribute:"tabindex=0",usage:"The expandable indicator must be part of the page tabsequence."}]};var xe=b;