UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.18 kB
var i=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...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 S=(o,e)=>i({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${o}-${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"}),C=(o,e)=>{let{valid:n,invalid:s,hover:l,focus:m,checked:a,active:f,selected:c,disabled:p,indeterminate:O,loading:E,empty:G,readonly:P,highlighted:M,...R}=e;return i({"k-valid":n,"k-invalid":s,"k-hover":l,"k-focus":m,"k-checked":a,"k-active":f,"k-selected":c,"k-disabled":p,"k-indeterminate":O&&!a,"k-loading":E,"k-empty":G,"k-readonly":P,"k-highlighted":M},Object.keys(R).reduce((L,k)=>(k.startsWith("k-")?L[k]=R[k]:L[`k-${k}`]=R[k],L),{}))};function ee(o,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(s=>[`k-${s}`,!0]))}var r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},B={small:"small",medium:"medium",large:"large",full:"full"},b={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},t={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},u={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 fe,jsx as oe}from"react/jsx-runtime";var V="k-font-icon",de=[],pe={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},ue={},T=o=>{let{size:e,themeColor:n,icon:s,rotate:l,flip:m,...a}=o;return s?oe("span",{...a,className:i(o.className,V,S(V,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):oe(fe,{})};T.states=de;T.options=pe;T.className=V;T.defaultOptions=ue;var te=T;import{Fragment as xe,jsx as $}from"react/jsx-runtime";var q="k-svg-icon",ge=[],he={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},se={viewBox:"0 0 24 24"},w=o=>{let{size:e,themeColor:n,rotate:s,flip:l,viewBox:m=se.viewBox,icon:a,...f}=o;if(!a)return $(xe,{});a==="none"&&{...f,className:i(o.className,q,"k-none")};let c=typeof a=="object"&&a.name&&a.name;return $("span",{...f,className:i(o.className,q,S("k-icon",{size:e}),{[`k-svg-i-${c}`]:c,[`k-color-${n}`]:n,[`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:m,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:o.children})})};w.states=ge;w.options=he;w.className=q;w.defaultOptions=se;var W=w;import*as J from"@progress/kendo-svg-icons";var re="icon",ne="icons";import{Fragment as ae,jsx as I}from"react/jsx-runtime";var H="k-icon",Ne=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ke=[],be={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},Q={viewBox:"0 0 24 24",type:"svg"},h=o=>{let{size:e,themeColor:n,icon:s,type:l=Q.type,rotate:m,flip:a,viewBox:f=Q.viewBox,...c}=o;if(!s)return I(ae,{});if(l==="svg"){if(s==="none")return I(W,{...c,className:i(o.className,H),icon:s,size:e});let p=J[s]?s:Ne(`${s}-icon`);return J[p]?I(W,{...c,className:i(o.className,H),icon:J[p],size:e,themeColor:n,rotate:m,flip:a,viewBox:f}):I(ae,{})}return I(te,{...c,className:i(o.className,H),icon:s,size:e,themeColor:n,rotate:m,flip:a})};h.states=ke;h.options=be;h.defaultOptions=Q;h.className=H;h.moduleName=re;h.folderName=ne;var X="button",ie=X;import{Fragment as Se,jsx as _,jsxs as le}from"react/jsx-runtime";var z="k-button",ve=["icon-button"],ye=[u.hover,u.focus,u.active,u.selected,u.disabled,u.generating],Me={size:[r.small,r.medium,r.large],rounded:[B.small,B.medium,B.large,B.full],fillMode:[b.solid,b.flat,b.outline,b.clear,b.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},v={size:r.medium,rounded:B.medium,fillMode:b.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=o=>{let{size:e=v.size,rounded:n=v.rounded,fillMode:s=v.fillMode,themeColor:l=v.themeColor,showArrow:m=v.showArrow,arrowIconName:a=v.arrowIconName,variant:f,hover:c,focus:p,active:O,selected:E,disabled:G,icon:P,text:M,iconClassName:R,...L}=o,k=P!==void 0,ce=o.children!==void 0;return le("button",{...L,className:i(o.className,z,ee(z,f),S(z,{size:e,rounded:n,fillMode:s,themeColor:l}),C(z,{hover:c,focus:p,active:O,disabled:G,selected:E}),{"k-icon-button":!M&&!ce&&k}),children:[P&&_(h,{className:i(R,"k-button-icon"),icon:P}),M?le(Se,{children:[M&&_("span",{className:"k-button-text",children:M}),o.children]}):o.children&&_("span",{className:"k-button-text",children:o.children}),m&&_("span",{className:"k-menu-button-arrow k-button-arrow",children:_(h,{icon:a})})]})};d.states=ye;d.options=Me;d.variants=ve;d.className=z;d.defaultOptions=v;d.moduleName=X;d.folderName=ie;import{jsx as po}from"react/jsx-runtime";import{jsx as ho}from"react/jsx-runtime";import{jsx as bo}from"react/jsx-runtime";var K="progressbar",U=K;import{jsx as Z,jsxs as Y}from"react/jsx-runtime";var g="k-progressbar",Ce=[u.disabled,u.indeterminate],Be={},y={indeterminate:!1,label:!0,labelPosition:"start",orientation:"horizontal",reverse:!1,value:"0"},N=o=>{let{disabled:e,height:n,indeterminate:s=y.indeterminate,label:l=y.label,labelPosition:m=y.labelPosition,orientation:a=y.orientation,reverse:f=y.reverse,value:c=y.value,width:p,style:O,...E}=o;return Y("div",{...E,className:i(o.className,g,C(g,{disabled:e}),{[`${g}-${a}`]:a,[`${g}-indeterminate`]:s,[`${g}-reverse`]:f}),style:{...O,"--kendo-progressbar-value":c,[a==="horizontal"?"height":"width"]:a==="horizontal"?n:p},children:[Z("span",{className:i("k-progress-status-wrap",{[`k-progress-${m}`]:m&&!s}),children:l&&Y("span",{className:"k-progress-status",children:[c,"%"]})}),!s&&Z("div",{className:"k-progressbar-value k-selected",children:Z("span",{className:i("k-progress-status-wrap",{[`k-progress-${m}`]:m}),children:l&&Y("span",{className:"k-progress-status",children:[o.value,"%"]})})})]})};N.states=Ce;N.options=Be;N.className=g;N.defaultOptions=y;N.moduleName=K;N.folderName=U;import{jsx as j}from"react/jsx-runtime";var me="k-chunk-progressbar",Ae=(o,e)=>e<=o-1,Oe=[u.disabled,u.indeterminate],Ee={},F={chunkCount:5,orientation:"horizontal",progress:0},A=o=>{let{disabled:e,chunkCount:n=F.chunkCount,indeterminate:s,orientation:l=F.orientation,progress:m=F.progress,reverse:a,...f}=o;return j("div",{...f,className:i(o.className,g,me,C(g,{disabled:e}),{[`${g}-${l}`]:l,[`${g}-indeterminate`]:s,[`${g}-reverse`]:a}),children:j("ul",{className:"k-progressbar-chunks k-reset",children:[...Array(n)].map((c,p)=>j("li",{className:i("k-progressbar-chunk",{"k-first":p===0,"k-last":p===[...Array(n)].length-1,"k-selected":Ae(m,p)})},p))})})};A.states=Oe;A.options=Ee;A.className=me;A.defaultOptions=F;A.moduleName=K;A.folderName=U;import{jsx as Ho}from"react/jsx-runtime";import{jsx as Vo}from"react/jsx-runtime";import{Fragment as Re,jsx as x,jsxs as D}from"react/jsx-runtime";var Pe="k-file",tt=o=>{let{status:e,progress:n,validationMsg:s,fileSummary:l,...m}=o;return x("li",{...m,className:i(o.className,Pe,{[`k-file-${e}`]:e}),children:D("div",{className:"k-file-multiple",children:[x(N,{className:i({"k-hidden":e!=="progress"}),value:n,label:!1}),x("span",{className:"k-file-icon-wrapper",children:x(h,{className:"k-file-icon",icon:"copy",size:"xxlarge"})}),D("div",{className:"k-multiple-files-wrapper",children:[o.children,l&&x("span",{className:i("k-file-summary",{"k-hidden":e!=="progress"}),children:l}),s&&x("span",{className:"k-file-validation-message",children:s})]}),x("div",{className:"k-upload-actions",children:e==="progress"?D(Re,{children:[D("span",{className:"k-upload-pct",children:[n,"%"]}),x(d,{icon:"pause-sm",fillMode:"flat",className:"k-upload-action"}),x(d,{icon:"cancel",fillMode:"flat",className:"k-upload-action"})]}):x(d,{icon:"x",fillMode:"flat",className:"k-upload-action"})})]})})};export{Pe as UPLOADFILEMULTIPLE_CLASSNAME,tt as UploadFileMultiple};