@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 5.46 kB
JavaScript
var G=Object.create;var I=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var q=(t,e)=>{for(var n in e)I(t,n,{get:e[n],enumerable:!0})},$=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of K(e))!U.call(t,r)&&r!==n&&I(t,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return t};var W=(t,e,n)=>(n=t!=null?G(D(t)):{},$(e||!t||!t.__esModule?I(n,"default",{value:t,enumerable:!0}):n,t)),J=t=>$(I({},"__esModule",{value:!0}),t);var re={};q(re,{CHIPACTION_CLASSNAME:()=>F,ChipAction:()=>ie,chipActionType:()=>P});module.exports=J(re);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 v=(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"});var i={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var d={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"};var y=require("react/jsx-runtime"),M="k-font-icon",Q=[],X={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},Y={},k=t=>{let{size:e,themeColor:n,icon:s,rotate:r,flip:u,...p}=t;return s?(0,y.jsx)("span",{...p,className:l(t.className,M,v(M,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"}),"aria-hidden":"true"}):(0,y.jsx)(y.Fragment,{})};k.states=Q;k.options=X;k.className=M;k.defaultOptions=Y;var L=k;var f=require("react/jsx-runtime"),A="k-svg-icon",Z=[],ee={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[d.outline,d.solid,d.duotone]},T={viewBox:"0 0 24 24",variant:d.outline},C=t=>{var z,h;let{size:e,themeColor:n,rotate:s,flip:r,viewBox:u=T.viewBox,variant:p=T.variant,icon:a,...N}=t;if(!a)return(0,f.jsx)(f.Fragment,{});if(a==="none")return(0,f.jsx)("span",{...N,className:l(t.className,A,v("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let g=typeof a=="object"&&a.name&&a.name,x=typeof a=="object"?p&&((z=a.variants)==null?void 0:z[p])||((h=a.variants)==null?void 0:h.outline)||a.content:void 0;return(0,f.jsx)("span",{...N,className:l(t.className,A,v("k-icon",{size:e}),{[`k-svg-i-${g}`]:g,[`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,f.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:u,dangerouslySetInnerHTML:x!==void 0?{__html:x}:void 0,children:a?void 0:t.children})})};C.states=Z;C.options=ee;C.className=A;C.defaultOptions=T;var E=C;var w=W(require("@progress/kendo-svg-icons"));var _="icon",R="icons";var V=require("react");var B=require("react"),H=(0,B.createContext)({iconsType:"svg"});var m=require("react/jsx-runtime"),O="k-icon",te=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),oe=[],ne={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[d.outline,d.solid,d.duotone]},S={viewBox:"0 0 24 24",type:"svg",variant:d.outline},c=t=>{let{iconsType:e}=(0,V.useContext)(H),{size:n,themeColor:s,icon:r,type:u=e||S.type,rotate:p,flip:a,viewBox:N=S.viewBox,variant:g=S.variant,...x}=t;if(!r)return(0,m.jsx)(m.Fragment,{});if((e||u)==="svg"){if(r==="none")return(0,m.jsx)(E,{...x,className:l(t.className,O),icon:r,size:n,variant:g});let h=w[r]?r:te(`${r}-icon`);return w[h]?(0,m.jsx)(E,{...x,className:l(t.className,O),icon:w[h],size:n,themeColor:s,rotate:p,flip:a,viewBox:N,variant:g}):(0,m.jsx)(m.Fragment,{})}return(0,m.jsx)(L,{...x,className:l(t.className,O),icon:r,size:n,themeColor:s,rotate:p,flip:a})};c.states=oe;c.options=ne;c.defaultOptions=S;c.className=O;c.moduleName=_;c.folderName=R;c.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 b=require("react/jsx-runtime"),F="k-chip-action",P=(n=>(n.REMOVE="remove",n.MORE="more",n))(P||{}),ie=t=>{let{type:e,...n}=t,s;switch(e){case"remove":s=(0,b.jsx)(c,{icon:"x-circle",size:"small"});break;case"more":s=(0,b.jsx)(c,{icon:"more-vertical",size:"small"});break;default:return(0,b.jsx)(c,{icon:e,size:"small"})}return(0,b.jsx)("span",{...n,className:l(t.className,F,`k-chip-${e}-action`),children:s})};