@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 7.58 kB
JavaScript
var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((i,s)=>e[s]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(t,e)=>r({[`${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"}),w=(t,e)=>{let{valid:i,invalid:s,hover:l,focus:d,checked:a,active:x,selected:u,disabled:g,indeterminate:S,loading:$,empty:U,readonly:C,highlighted:y,...z}=e;return r({"k-valid":i,"k-invalid":s,"k-hover":l,"k-focus":d,"k-checked":a,"k-active":x,"k-selected":u,"k-disabled":g,"k-indeterminate":S&&!a,"k-loading":$,"k-empty":U,"k-readonly":C,"k-highlighted":y},Object.keys(z).reduce((O,v)=>(v.startsWith("k-")?O[v]=z[v]:O[`k-${v}`]=z[v],O),{}))};function j(t,e){if(!e)return{};let i=Array.isArray(e)?e:[e];return Object.fromEntries(i.map(s=>[`k-${s}`,!0]))}var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},p={small:"small",medium:"medium",large:"large",full:"full"},f={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},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"},c={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 le,jsx as W}from"react/jsx-runtime";var H="k-font-icon",ie=[],re={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]},ae={},A=t=>{let{size:e,themeColor:i,icon:s,rotate:l,flip:d,...a}=t;return s?W("span",{...a,className:r(t.className,H,h(H,{size:e}),{[`k-i-${s}`]:s,[`k-color-${i}`]:i,[`k-rotate-${l}`]:l,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):W(le,{})};A.states=ie;A.options=re;A.className=H;A.defaultOptions=ae;var J=A;import{Fragment as ce,jsx as _}from"react/jsx-runtime";var F="k-svg-icon",de=[],me={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={viewBox:"0 0 24 24"},T=t=>{let{size:e,themeColor:i,rotate:s,flip:l,viewBox:d=Q.viewBox,icon:a,...x}=t;if(!a)return _(ce,{});a==="none"&&{...x,className:r(t.className,F,"k-none")};let u=typeof a=="object"&&a.name&&a.name;return _("span",{...x,className:r(t.className,F,h("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${i}`]:i,[`k-rotate-${s}`]:s,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:_("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:d,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:t.children})})};T.states=de;T.options=me;T.className=F;T.defaultOptions=Q;var D=T;import*as P from"@progress/kendo-svg-icons";var X="icon",Y="icons";import{Fragment as Z,jsx as I}from"react/jsx-runtime";var L="k-icon",ue=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),pe=[],fe={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]},G={viewBox:"0 0 24 24",type:"svg"},N=t=>{let{size:e,themeColor:i,icon:s,type:l=G.type,rotate:d,flip:a,viewBox:x=G.viewBox,...u}=t;if(!s)return I(Z,{});if(l==="svg"){if(s==="none")return I(D,{...u,className:r(t.className,L),icon:s,size:e});let g=P[s]?s:ue(`${s}-icon`);return P[g]?I(D,{...u,className:r(t.className,L),icon:P[g],size:e,themeColor:i,rotate:d,flip:a,viewBox:x}):I(Z,{})}return I(J,{...u,className:r(t.className,L),icon:s,size:e,themeColor:i,rotate:d,flip:a})};N.states=pe;N.options=fe;N.defaultOptions=G;N.className=L;N.moduleName=X;N.folderName=Y;var V="button",ee=V;import{Fragment as Ne,jsx as E,jsxs as oe}from"react/jsx-runtime";var B="k-button",xe=["icon-button"],ge=[c.hover,c.focus,c.active,c.selected,c.disabled,c.generating],he={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[f.solid,f.flat,f.outline,f.clear,f.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},k={size:n.medium,rounded:p.medium,fillMode:f.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=t=>{let{size:e=k.size,rounded:i=k.rounded,fillMode:s=k.fillMode,themeColor:l=k.themeColor,showArrow:d=k.showArrow,arrowIconName:a=k.arrowIconName,variant:x,hover:u,focus:g,active:S,selected:$,disabled:U,icon:C,text:y,iconClassName:z,...O}=t,v=C!==void 0,se=t.children!==void 0;return oe("button",{...O,className:r(t.className,B,j(B,x),h(B,{size:e,rounded:i,fillMode:s,themeColor:l}),w(B,{hover:u,focus:g,active:S,disabled:U,selected:$}),{"k-icon-button":!y&&!se&&v}),children:[C&&E(N,{className:r(z,"k-button-icon"),icon:C}),y?oe(Ne,{children:[y&&E("span",{className:"k-button-text",children:y}),t.children]}):t.children&&E("span",{className:"k-button-text",children:t.children}),d&&E("span",{className:"k-menu-button-arrow k-button-arrow",children:E(N,{icon:a})})]})};m.states=ge;m.options=he;m.variants=xe;m.className=B;m.defaultOptions=k;m.moduleName=V;m.folderName=ee;import{jsx as eo}from"react/jsx-runtime";import{jsx as so}from"react/jsx-runtime";import{jsx as lo}from"react/jsx-runtime";var q="signature",te=q;import{jsx as M,jsxs as ne}from"react/jsx-runtime";var K="k-signature",ve=[c.hover,c.focus,c.valid,c.invalid,c.disabled],ke={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[f.solid,f.flat,f.outline]},R={size:n.medium,rounded:p.medium,fillMode:f.solid},b=t=>{let{size:e=R.size,rounded:i=R.rounded,fillMode:s=R.fillMode,hover:l,focus:d,valid:a,invalid:x,disabled:u,maximized:g,...S}=t;return ne("div",{...S,className:r(t.className,K,"k-input",h(K,{size:e,rounded:i,fillMode:s}),h("k-input",{fillMode:s}),w(K,{hover:l,focus:d,valid:a,invalid:x,disabled:u}),{"k-signature-maximized":g}),children:[M("canvas",{className:"k-signature-canvas"}),ne("div",{className:r("k-signature-actions","k-signature-actions-top"),children:[M(m,{className:r("k-signature-action","k-signature-maximize",g?"k-hidden":""),icon:"hyperlink-open",rounded:i,size:e,fillMode:"flat"}),M(m,{className:r("k-signature-action","k-signature-minimize",g?"":"k-hidden"),icon:"hyperlink-open",rounded:i,size:e,fillMode:"flat"})]}),M("div",{className:"k-signature-line"}),M("div",{className:r("k-signature-actions","k-signature-actions-bottom"),children:M(m,{className:r("k-signature-action","k-signature-clear"),icon:"x",rounded:t.rounded,size:t.size,fillMode:"flat"})})]})};b.states=ve;b.options=ke;b.className=K;b.defaultOptions=R;b.moduleName=q;b.folderName=te;var ko=b;export{K as SIGNATURE_CLASSNAME,b as Signature,ko as default};