@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 7.47 kB
JavaScript
var ee=Object.create;var M=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)M(t,n,{get:e[n],enumerable:!0})},D=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oe(e))!ae.call(t,r)&&r!==n&&M(t,r,{get:()=>e[r],enumerable:!(s=te(e,r))||s.enumerable});return t};var ie=(t,e,n)=>(n=t!=null?ee(ne(t)):{},D(e||!t||!t.__esModule?M(n,"default",{value:t,enumerable:!0}):n,t)),se=t=>D(M({},"__esModule",{value:!0}),t);var he={};re(he,{BubbleExpandable:()=>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 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:r,focus:c,checked:d,active:i,selected:b,disabled:f,indeterminate:x,loading:k,empty:g,readonly:Y,highlighted:Z,...T}=e;return l({"k-valid":n,"k-invalid":s,"k-hover":r,"k-focus":c,"k-checked":d,"k-active":i,"k-selected":b,"k-disabled":f,"k-indeterminate":x&&!d,"k-loading":k,"k-empty":g,"k-readonly":Y,"k-highlighted":Z},Object.keys(T).reduce((z,C)=>(C.startsWith("k-")?z[C]=T[C]:z[`k-${C}`]=T[C],z),{}))};var a={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"},I={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"),w="k-font-icon",le=[],de={size:[a.undefined,a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},ce={},B=t=>{let{size:e,themeColor:n,icon:s,rotate:r,flip:c,...d}=t;return s?(0,S.jsx)("span",{...d,className:l(t.className,w,N(w,{size:e}),{[`k-i-${s}`]:s,[`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,S.jsx)(S.Fragment,{})};B.states=le;B.options=de;B.className=w;B.defaultOptions=ce;var U=B;var h=require("react/jsx-runtime"),A="k-svg-icon",ue=[],me={size:[a.undefined,a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.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},E=t=>{var k,g;let{size:e,themeColor:n,rotate:s,flip:r,viewBox:c=_.viewBox,variant:d=_.variant,icon:i,...b}=t;if(!i)return(0,h.jsx)(h.Fragment,{});if(i==="none")return(0,h.jsx)("span",{...b,className:l(t.className,A,N("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let f=typeof i=="object"&&i.name&&i.name,x=typeof i=="object"?d&&((k=i.variants)==null?void 0:k[d])||((g=i.variants)==null?void 0:g.outline)||i.content:void 0;return(0,h.jsx)("span",{...b,className:l(t.className,A,N("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"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 i=="object"?i.viewBox:c,dangerouslySetInnerHTML:x!==void 0?{__html:x}:void 0,children:i?void 0:t.children})})};E.states=ue;E.options=me;E.className=A;E.defaultOptions=_;var $=E;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"),O="k-icon",pe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),be=[],xe={size:[a.undefined,a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.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]},L={viewBox:"0 0 24 24",type:"svg",variant:u.outline},m=t=>{let{iconsType:e}=(0,J.useContext)(q),{size:n,themeColor:s,icon:r,type:c=e||L.type,rotate:d,flip:i,viewBox:b=L.viewBox,variant:f=L.variant,...x}=t;if(!r)return(0,p.jsx)(p.Fragment,{});if((e||c)==="svg"){if(r==="none")return(0,p.jsx)($,{...x,className:l(t.className,O),icon:r,size:n,variant:f});let g=R[r]?r:pe(`${r}-icon`);return R[g]?(0,p.jsx)($,{...x,className:l(t.className,O),icon:R[g],size:n,themeColor:s,rotate:d,flip:i,viewBox:b,variant:f}):(0,p.jsx)(p.Fragment,{})}return(0,p.jsx)(U,{...x,className:l(t.className,O),icon:r,size:n,themeColor:s,rotate:d,flip:i})};m.states=be;m.options=xe;m.defaultOptions=L;m.className=O;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",fe=[I.hover,I.active,I.selected,I.focus],K={expandable:!1,expanded:!1},y=t=>{let{content:e,hover:n,active:s,focus:r,selected:c,expandable:d=K.expandable,expanded:i=K.expanded,...b}=t;return(0,v.jsxs)("div",{...b,className:l(t.className,F,P(F,{hover:n,active:s,focus:r,selected:c}),{"k-bubble-expandable":d},{"k-expanded":i}),tabIndex:0,children:[(0,v.jsx)("div",{className:"k-bubble-content",children:e??t.children}),d&&(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=fe;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,{expandable:!0,content:"Expandable bubble content. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",...t});