UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.2 kB
var ee=Object.create;var O=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ae=(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 oe(e))!re.call(t,a)&&a!==n&&O(t,a,{get:()=>e[a],enumerable:!(s=te(e,a))||s.enumerable});return t};var ie=(t,e,n)=>(n=t!=null?ee(ne(t)):{},D(e||!t||!t.__esModule?O(n,"default",{value:t,enumerable:!0}):n,t)),se=t=>D(O({},"__esModule",{value:!0}),t);var he={};ae(he,{BubbleNormal:()=>ge});module.exports=se(he);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 C=(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:x,indeterminate:b,loading:k,empty:g,readonly:Y,highlighted:Z,...L}=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":x,"k-indeterminate":b&&!c,"k-loading":k,"k-empty":g,"k-readonly":Y,"k-highlighted":Z},Object.keys(L).reduce((z,N)=>(N.startsWith("k-")?z[N]=L[N]:z[`k-${N}`]=L[N],z),{}))};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"},B={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 S=require("react/jsx-runtime"),A="k-font-icon",le=[],ce={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]},de={},I=t=>{let{size:e,themeColor:n,icon:s,rotate:a,flip:d,...c}=t;return s?(0,S.jsx)("span",{...c,className:l(t.className,A,C(A,{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,S.jsx)(S.Fragment,{})};I.states=le;I.options=ce;I.className=A;I.defaultOptions=de;var U=I;var h=require("react/jsx-runtime"),_="k-svg-icon",ue=[],me={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]},w={viewBox:"0 0 24 24",variant:u.outline},M=t=>{var k,g;let{size:e,themeColor:n,rotate:s,flip:a,viewBox:d=w.viewBox,variant:c=w.variant,icon:i,...f}=t;if(!i)return(0,h.jsx)(h.Fragment,{});if(i==="none")return(0,h.jsx)("span",{...f,className:l(t.className,_,C("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let x=typeof i=="object"&&i.name&&i.name,b=typeof i=="object"?c&&((k=i.variants)==null?void 0:k[c])||((g=i.variants)==null?void 0:g.outline)||i.content:void 0;return(0,h.jsx)("span",{...f,className:l(t.className,_,C("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`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,h.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:d,dangerouslySetInnerHTML:b!==void 0?{__html:b}:void 0,children:i?void 0:t.children})})};M.states=ue;M.options=me;M.className=_;M.defaultOptions=w;var $=M;var R=ie(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",pe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),fe=[],be={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:x=T.variant,...b}=t;if(!a)return(0,p.jsx)(p.Fragment,{});if((e||d)==="svg"){if(a==="none")return(0,p.jsx)($,{...b,className:l(t.className,E),icon:a,size:n,variant:x});let g=R[a]?a:pe(`${a}-icon`);return R[g]?(0,p.jsx)($,{...b,className:l(t.className,E),icon:R[g],size:n,themeColor:s,rotate:c,flip:i,viewBox:f,variant:x}):(0,p.jsx)(p.Fragment,{})}return(0,p.jsx)(U,{...b,className:l(t.className,E),icon:a,size:n,themeColor:s,rotate:c,flip:i})};m.states=fe;m.options=be;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 H="bubble",W=H;var v=require("react/jsx-runtime"),F="k-bubble",xe=[B.hover,B.active,B.selected,B.focus],K={expandable:!1,expanded:!1},y=t=>{let{content:e,hover:n,active:s,focus:a,selected:d,expandable:c=K.expandable,expanded:i=K.expanded,...f}=t;return(0,v.jsxs)("div",{...f,className:l(t.className,F,P(F,{hover:n,active:s,focus:a,selected:d}),{"k-bubble-expandable":c},{"k-expanded":i}),tabIndex:0,children:[(0,v.jsx)("div",{className:"k-bubble-content",children:e??t.children}),c&&(0,v.jsx)("span",{className:"k-bubble-expandable-indicator",role:"button","aria-label":i?"Show less":"Show more",tabIndex:0,children:i?(0,v.jsx)(m,{icon:"chevron-up"}):(0,v.jsx)(m,{icon:"chevron-down"})})]})};y.states=xe;y.className=F;y.defaultOptions=K;y.moduleName=H;y.folderName=W;y.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 X=y;var Q=require("react/jsx-runtime"),ge=t=>(0,Q.jsx)(X,{content:"Bubble content",...t});