@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 4.74 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,l)=>e[l]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var x=(t,e)=>a({[`${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 n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var c={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"};import{Fragment as V,jsx as T}from"react/jsx-runtime";var I="k-font-icon",R=[],H={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},F={},g=t=>{let{size:e,themeColor:r,icon:l,rotate:i,flip:m,...u}=t;return l?T("span",{...u,className:a(t.className,I,x(I,{size:e}),{[`k-i-${l}`]:l,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):T(V,{})};g.states=R;g.options=H;g.className=I;g.defaultOptions=F;var A=g;import{Fragment as K,jsx as k}from"react/jsx-runtime";var S="k-svg-icon",G=[],j={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[c.outline,c.solid,c.duotone]},O={viewBox:"0 0 24 24",variant:c.outline},v=t=>{let{size:e,themeColor:r,rotate:l,flip:i,viewBox:m=O.viewBox,variant:u=O.variant,icon:s,...y}=t;if(!s)return k(K,{});if(s==="none")return k("span",{...y,className:a(t.className,S,x("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let f=typeof s=="object"&&s.name&&s.name,p=typeof s=="object"?u&&s.variants?.[u]||s.variants?.outline||s.content:void 0;return k("span",{...y,className:a(t.className,S,x("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),"aria-hidden":"true",children:k("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:m,dangerouslySetInnerHTML:p!==void 0?{__html:p}:void 0,children:s?void 0:t.children})})};v.states=G;v.options=j;v.className=S;v.defaultOptions=O;var w=v;import*as z from"@progress/kendo-svg-icons";var $="icon",E="icons";import{useContext as U}from"react";import{createContext as D}from"react";var L=D({iconsType:"svg"});import{Fragment as _,jsx as h}from"react/jsx-runtime";var C="k-icon",q=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),W=[],J={size:[n.undefined,n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[c.outline,c.solid,c.duotone]},b={viewBox:"0 0 24 24",type:"svg",variant:c.outline},d=t=>{let{iconsType:e}=U(L),{size:r,themeColor:l,icon:i,type:m=e||b.type,rotate:u,flip:s,viewBox:y=b.viewBox,variant:f=b.variant,...p}=t;if(!i)return h(_,{});if((e||m)==="svg"){if(i==="none")return h(w,{...p,className:a(t.className,C),icon:i,size:r,variant:f});let M=z[i]?i:q(`${i}-icon`);return z[M]?h(w,{...p,className:a(t.className,C),icon:z[M],size:r,themeColor:l,rotate:u,flip:s,viewBox:y,variant:f}):h(_,{})}return h(A,{...p,className:a(t.className,C),icon:i,size:r,themeColor:l,rotate:u,flip:s})};d.states=W;d.options=J;d.defaultOptions=b;d.className=C;d.moduleName=$;d.folderName=E;d.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."}]};import{jsx as B,jsxs as Y}from"react/jsx-runtime";var P="k-color-preview",Q=[],X={},N=t=>{let{color:e,iconName:r,...l}=t;return Y("span",{...l,className:a(t.className,P,{"k-icon-color-preview":r,"k-no-color":!e}),children:[r&&B(d,{icon:r,className:"k-color-preview-icon"}),B("span",{className:"k-color-preview-mask",style:{backgroundColor:e}})]})};N.states=Q;N.options=X;N.className=P;var Ee=N;export{P as COLORPREVIEW_CLASSNAME,N as ColorPreview,Ee as default};