UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 4.78 kB
var a=(...n)=>n.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=(n,e)=>a({[`${n}-xs`]:e.size==="xsmall",[`${n}-sm`]:e.size==="small",[`${n}-md`]:e.size==="medium",[`${n}-lg`]:e.size==="large",[`${n}-xl`]:e.size==="xlarge",[`${n}-xxl`]:e.size==="xxlarge",[`${n}-xxxl`]:e.size==="xxxlarge"},{[`${n}-${e.fillMode}`]:e.fillMode},{[`${n}-${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 t={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 A}from"react/jsx-runtime";var I="k-font-icon",B=[],R={size:[t.undefined,t.xsmall,t.small,t.medium,t.large,t.xlarge,t.xxlarge,t.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},H={},g=n=>{let{size:e,themeColor:r,icon:l,rotate:i,flip:m,...u}=n;return l?A("span",{...u,className:a(n.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"}):A(V,{})};g.states=B;g.options=R;g.className=I;g.defaultOptions=H;var $=g;import{Fragment as j,jsx as b}from"react/jsx-runtime";var z="k-svg-icon",K=[],G={size:[t.undefined,t.xsmall,t.small,t.medium,t.large,t.xlarge,t.xxlarge,t.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]},S={viewBox:"0 0 24 24",variant:c.outline},v=n=>{let{size:e,themeColor:r,rotate:l,flip:i,viewBox:m=S.viewBox,variant:u=S.variant,icon:s,...k}=n;if(!s)return b(j,{});if(s==="none")return b("span",{...k,className:a(n.className,z,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 b("span",{...k,className:a(n.className,z,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:b("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:n.children})})};v.states=K;v.options=G;v.className=z;v.defaultOptions=S;var O=v;import*as w from"@progress/kendo-svg-icons";var E="icon",L="icons";import{useContext as U}from"react";import{createContext as D}from"react";var _=D({iconsType:"svg"});import{Fragment as F,jsx as h}from"react/jsx-runtime";var C="k-icon",q=n=>n.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),W=[],J={size:[t.undefined,t.xsmall,t.small,t.medium,t.large,t.xlarge,t.xxlarge,t.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]},N={viewBox:"0 0 24 24",type:"svg",variant:c.outline},d=n=>{let{iconsType:e}=U(_),{size:r,themeColor:l,icon:i,type:m=e||N.type,rotate:u,flip:s,viewBox:k=N.viewBox,variant:f=N.variant,...p}=n;if(!i)return h(F,{});if((e||m)==="svg"){if(i==="none")return h(O,{...p,className:a(n.className,C),icon:i,size:r,variant:f});let T=w[i]?i:q(`${i}-icon`);return w[T]?h(O,{...p,className:a(n.className,C),icon:w[T],size:r,themeColor:l,rotate:u,flip:s,viewBox:k,variant:f}):h(F,{})}return h($,{...p,className:a(n.className,C),icon:i,size:r,themeColor:l,rotate:u,flip:s})};d.states=W;d.options=J;d.defaultOptions=N;d.className=C;d.moduleName=E;d.folderName=L;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{Fragment as Z,jsx as M,jsxs as ee}from"react/jsx-runtime";var P="k-file-preview",Q=[],X={size:[t.undefined,t.xsmall,t.small,t.medium,t.large,t.xlarge,t.xxlarge,t.xxxlarge]},Y={},y=n=>{let{size:e,icon:r,name:l,...i}=n;return ee(Z,{children:[M("span",{...i,className:a(P),children:M(d,{className:"k-file-icon",icon:r,size:e})}),M("span",{className:a(n.className,"k-file-name"),children:l})]})};y.states=Q;y.options=X;y.className=P;y.defaultOptions=Y;var _e=y;export{y as FilePreview,_e as default};