UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.52 kB
var ee=Object.create;var L=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var n in e)L(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))!ae.call(t,a)&&a!==n&&L(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?L(n,"default",{value:t,enumerable:!0}):n,t)),se=t=>D(L({},"__esModule",{value:!0}),t);var Ne={};re(Ne,{ChatBubble:()=>ke});module.exports=se(Ne);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"}),U=(t,e)=>{let{valid:n,invalid:s,hover:a,focus:c,checked:d,active:i,selected:b,disabled:h,indeterminate:f,loading:N,empty:g,readonly:Y,highlighted:Z,...w}=e;return l({"k-valid":n,"k-invalid":s,"k-hover":a,"k-focus":c,"k-checked":d,"k-active":i,"k-selected":b,"k-disabled":h,"k-indeterminate":f&&!d,"k-loading":N,"k-empty":g,"k-readonly":Y,"k-highlighted":Z},Object.keys(w).reduce((z,B)=>(B.startsWith("k-")?z[B]=w[B]:z[`k-${B}`]=w[B],z),{}))};var r={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"},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"),A="k-font-icon",le=[],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]},ce={},E=t=>{let{size:e,themeColor:n,icon:s,rotate:a,flip:c,...d}=t;return s?(0,I.jsx)("span",{...d,className:l(t.className,A,C(A,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),"aria-hidden":"true"}):(0,I.jsx)(I.Fragment,{})};E.states=le;E.options=de;E.className=A;E.defaultOptions=ce;var V=E;var v=require("react/jsx-runtime"),_="k-svg-icon",me=[],ue={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:[m.outline,m.solid,m.duotone]},$={viewBox:"0 0 24 24",variant:m.outline},M=t=>{var N,g;let{size:e,themeColor:n,rotate:s,flip:a,viewBox:c=$.viewBox,variant:d=$.variant,icon:i,...b}=t;if(!i)return(0,v.jsx)(v.Fragment,{});if(i==="none")return(0,v.jsx)("span",{...b,className:l(t.className,_,C("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let h=typeof i=="object"&&i.name&&i.name,f=typeof i=="object"?d&&((N=i.variants)==null?void 0:N[d])||((g=i.variants)==null?void 0:g.outline)||i.content:void 0;return(0,v.jsx)("span",{...b,className:l(t.className,_,C("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`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:c,dangerouslySetInnerHTML:f!==void 0?{__html:f}:void 0,children:i?void 0:t.children})})};M.states=me;M.options=ue;M.className=_;M.defaultOptions=$;var R=M;var K=ie(require("@progress/kendo-svg-icons"));var G="icon",q="icons";var j=require("react");var J=require("react"),X=(0,J.createContext)({iconsType:"svg"});var p=require("react/jsx-runtime"),O="k-icon",pe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),be=[],fe={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:[m.outline,m.solid,m.duotone]},T={viewBox:"0 0 24 24",type:"svg",variant:m.outline},u=t=>{let{iconsType:e}=(0,j.useContext)(X),{size:n,themeColor:s,icon:a,type:c=e||T.type,rotate:d,flip:i,viewBox:b=T.viewBox,variant:h=T.variant,...f}=t;if(!a)return(0,p.jsx)(p.Fragment,{});if((e||c)==="svg"){if(a==="none")return(0,p.jsx)(R,{...f,className:l(t.className,O),icon:a,size:n,variant:h});let g=K[a]?a:pe(`${a}-icon`);return K[g]?(0,p.jsx)(R,{...f,className:l(t.className,O),icon:K[g],size:n,themeColor:s,rotate:d,flip:i,viewBox:b,variant:h}):(0,p.jsx)(p.Fragment,{})}return(0,p.jsx)(V,{...f,className:l(t.className,O),icon:a,size:n,themeColor:s,rotate:d,flip:i})};u.states=be;u.options=fe;u.defaultOptions=T;u.className=O;u.moduleName=G;u.folderName=q;u.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 y=require("react/jsx-runtime"),P="k-bubble",xe=[S.hover,S.active,S.selected,S.focus],F={expandable:!1,expanded:!1},x=t=>{let{content:e,hover:n,active:s,focus:a,selected:c,expandable:d=F.expandable,expanded:i=F.expanded,...b}=t;return(0,y.jsxs)("div",{...b,className:l(t.className,P,U(P,{hover:n,active:s,focus:a,selected:c}),{"k-bubble-expandable":d},{"k-expanded":i}),tabIndex:0,children:[(0,y.jsx)("div",{className:"k-bubble-content",children:e??t.children}),d&&(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)(u,{icon:"chevron-up"}):(0,y.jsx)(u,{icon:"chevron-down"})})]})};x.states=xe;x.className=P;x.defaultOptions=F;x.moduleName=H;x.folderName=W;x.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 he=require("react/jsx-runtime");var ge=require("react/jsx-runtime");var ve=require("react/jsx-runtime");var k=require("react/jsx-runtime"),ye="k-chat-bubble",ke=t=>{let{typing:e,content:n,files:s,...a}=t;return(0,k.jsxs)(x,{...a,className:l(t.className,ye),children:[e?(0,k.jsxs)("div",{className:"k-typing-indicator",tabIndex:-1,children:[(0,k.jsx)("span",{}),(0,k.jsx)("span",{}),(0,k.jsx)("span",{})]}):n,s]})};