UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 5.16 kB
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,s)=>e[s]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var k=(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.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),T=(t,e)=>{let{valid:r,invalid:s,hover:l,focus:c,checked:i,active:d,selected:m,disabled:y,indeterminate:R,loading:K,empty:G,readonly:V,highlighted:j,...S}=e;return a({"k-valid":r,"k-invalid":s,"k-hover":l,"k-focus":c,"k-checked":i,"k-active":d,"k-selected":m,"k-disabled":y,"k-indeterminate":R&&!i,"k-loading":K,"k-empty":G,"k-readonly":V,"k-highlighted":j},Object.keys(S).reduce((I,x)=>(x.startsWith("k-")?I[x]=S[x]:I[`k-${x}`]=S[x],I),{}))};var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},f={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"};import{Fragment as W,jsx as L}from"react/jsx-runtime";var C="k-font-icon",D=[],U={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},q={},u=t=>{let{size:e,themeColor:r,icon:s,rotate:l,flip:c,...i}=t;return s?L("span",{...i,className:a(t.className,C,k(C,{size:e}),{[`k-i-${s}`]:s,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):L(W,{})};u.states=D;u.options=U;u.className=C;u.defaultOptions=q;var _=u;import{Fragment as X,jsx as N}from"react/jsx-runtime";var M="k-svg-icon",J=[],Q={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},B={viewBox:"0 0 24 24"},h=t=>{let{size:e,themeColor:r,rotate:s,flip:l,viewBox:c=B.viewBox,icon:i,...d}=t;if(!i)return N(X,{});i==="none"&&{...d,className:a(t.className,M,"k-none")};let m=typeof i=="object"&&i.name&&i.name;return N("span",{...d,className:a(t.className,M,k("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:N("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:c,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};h.states=J;h.options=Q;h.className=M;h.defaultOptions=B;var O=h;import*as z from"@progress/kendo-svg-icons";var H="icon",F="icons";import{Fragment as P,jsx as g}from"react/jsx-runtime";var b="k-icon",Y=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Z=[],ee={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},A={viewBox:"0 0 24 24",type:"svg"},p=t=>{let{size:e,themeColor:r,icon:s,type:l=A.type,rotate:c,flip:i,viewBox:d=A.viewBox,...m}=t;if(!s)return g(P,{});if(l==="svg"){if(s==="none")return g(O,{...m,className:a(t.className,b),icon:s,size:e});let y=z[s]?s:Y(`${s}-icon`);return z[y]?g(O,{...m,className:a(t.className,b),icon:z[y],size:e,themeColor:r,rotate:c,flip:i,viewBox:d}):g(P,{})}return g(_,{...m,className:a(t.className,b),icon:s,size:e,themeColor:r,rotate:c,flip:i})};p.states=Z;p.options=ee;p.defaultOptions=A;p.className=b;p.moduleName=H;p.folderName=F;import{Fragment as oe,jsx as v,jsxs as w}from"react/jsx-runtime";var $="k-actionsheet-item",te=[f.hover,f.focus,f.selected,f.disabled],E=t=>{let{iconName:e,text:r,description:s,hover:l,focus:c,selected:i,disabled:d,...m}=t;return w("span",{...m,className:a(t.className,$,T($,{hover:l,focus:c,selected:i,disabled:d})),children:[!t.children&&v(oe,{children:w("span",{className:"k-actionsheet-action",children:[e&&v("span",{className:"k-icon-wrap",children:v(p,{className:"k-actionsheet-item-icon",icon:e})}),w("span",{className:"k-actionsheet-item-text",children:[r&&v("span",{className:"k-actionsheet-item-title",children:r}),s&&v("span",{className:"k-actionsheet-item-description",children:s})]})]})}),t.children]})};E.states=te;E.className=$;var we=E;export{$ as ACTIONSHEETITEM_CLASSNAME,E as ActionSheetItem,we as default};