UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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