UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.9 kB
var a=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((s,r)=>e[r]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var B=(o,e)=>a({[`${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"}),x=(o,e)=>a({"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 n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},S={small:"small",medium:"medium",large:"large",full:"full"},N={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"},d={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{jsx as he}from"react/jsx-runtime";var K="k-actions",fe=[],ge={},V={alignment:"start",orientation:"horizontal"},z=o=>{let{alignment:e=V.alignment,orientation:s=V.orientation,...r}=o;return he("div",{...r,className:a(K,{[`${K}-${e}`]:e,[`${K}-${s}`]:s},o.className),children:o.children})};z.states=fe;z.options=ge;z.className=K;z.defaultOptions=V;var ee=z;import{Fragment as Ne,jsx as oe}from"react/jsx-runtime";var G="k-icon k-font-icon",xe=[],ke={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},ve={},C=o=>{let{size:e,themeColor:s,icon:r,rotate:i,flip:c,...l}=o;return r?oe("span",{...l,className:a(o.className,G,B(G,{size:e}),{[`k-i-${r}`]:r,[`k-color-${s}`]:s,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):oe(Ne,{})};C.states=xe;C.options=ke;C.className=G;C.defaultOptions=ve;var te=C;import{Fragment as Be,jsx as O}from"react/jsx-runtime";var W="k-icon k-svg-icon",ye=[],be={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.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"},I=o=>{let{size:e,themeColor:s,rotate:r,flip:i,viewBox:c=se.viewBox,icon:l,...u}=o;if(!l)return O(Be,{});l==="none"&&{...u,className:a(o.className,W,"k-none")};let p=typeof l=="object"&&l.name&&l.name;return O("span",{...u,className:a(o.className,W,B("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:O("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:c,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:o.children})})};I.states=ye;I.options=be;I.className=W;I.defaultOptions=se;var q=I;import*as ae from"@progress/kendo-svg-icons";import{Fragment as ne,jsx as A}from"react/jsx-runtime";var Se=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Me=[],ze={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},Z={viewBox:"0 0 24 24",type:"svg"},f=o=>{let{size:e,themeColor:s,icon:r,type:i=Z.type,rotate:c,flip:l,viewBox:u=Z.viewBox,...p}=o;if(!r)return A(ne,{});if(i==="svg"){if(r==="none")return A(q,{...p,icon:r,size:e});let h=Se(`${r}-icon`);return ae[h]?A(q,{...p,icon:ae[h],size:e,themeColor:s,rotate:c,flip:l,viewBox:u}):A(ne,{})}return A(te,{...p,icon:r,size:e,themeColor:s,rotate:c,flip:l})};f.states=Me;f.options=ze;f.defaultOptions=Z;import{Fragment as Ae,jsx as U,jsxs as re}from"react/jsx-runtime";var T="k-button",Ce=[d.hover,d.focus,d.active,d.selected,d.disabled],Ie={size:[n.small,n.medium,n.large],rounded:[S.small,S.medium,S.large,S.full],fillMode:[N.solid,N.flat,N.outline,N.clear,N.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},y={size:n.medium,rounded:S.medium,fillMode:N.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=o=>{let{size:e=y.size,rounded:s=y.rounded,fillMode:r=y.fillMode,themeColor:i=y.themeColor,showArrow:c=y.showArrow,arrowIconName:l=y.arrowIconName,hover:u,focus:p,active:h,selected:H,disabled:R,icon:D,text:w,iconClassName:de,...pe}=o,me=D!==void 0,ue=o.children!==void 0;return re("button",{...pe,className:a(o.className,T,B(T,{size:e,rounded:s,fillMode:r,themeColor:i}),x(T,{hover:u,focus:p,active:h,disabled:R,selected:H}),{"k-icon-button":!w&&!ue&&me}),children:[D&&U(f,{className:a(de,"k-button-icon"),icon:D}),w?re(Ae,{children:[w&&U("span",{className:"k-button-text",children:w}),o.children]}):o.children&&U("span",{className:"k-button-text",children:o.children}),c&&U("span",{className:"k-menu-button-arrow k-button-arrow",children:U(f,{icon:l})})]})};m.states=Ce;m.options=Ie;m.className=T;m.defaultOptions=y;import{jsx as No}from"react/jsx-runtime";import{jsx as So}from"react/jsx-runtime";import{jsx as Io}from"react/jsx-runtime";import{Fragment as L,jsx as k,jsxs as P}from"react/jsx-runtime";var J="k-upload-dropzone",Ue=[d.hover],_=o=>{let{hover:e,status:s,...r}=o,i=k(L,{});switch(s){case"uploading":i=P(L,{children:[k(f,{icon:"upload"}),"Uploading..."]});break;case"done":i=P(L,{children:[k(f,{icon:"check"}),"Done"]});break;case"failed":i=P(L,{children:[k(f,{icon:"exclamation-circle"}),"Done"]});break;default:i=k(L,{});break}return P("div",{...r,className:a(o.className,J,"k-dropzone",x(J,{hover:e})),children:[P("div",{className:"k-upload-button-wrap",children:[k(m,{className:"k-upload-button",children:"Select files..."}),k("input",{id:"upload-input",className:"k-hidden"})]}),k("span",{className:a("k-dropzone-hint",{"k-hidden":s!=="upload"}),children:"Drop files here to upload"}),s!=="upload"&&k("span",{className:"k-upload-status",children:i})]})};_.states=Ue;_.className=J;import{jsx as $,jsxs as le}from"react/jsx-runtime";var Q="k-upload",Le=[d.hover,d.disabled],Pe={},ie={actionsLayout:"end"},v=o=>{let{async:e,empty:s,actions:r,actionsLayout:i=ie.actionsLayout,hover:c,status:l,disabled:u,...p}=o;return le("div",{...p,className:a(o.className,Q,x(Q,{disabled:u}),{"k-upload-async":e,"k-upload-empty":s}),children:[$(_,{status:l,hover:c}),o.children&&$("ul",{className:"k-upload-files",children:o.children}),r&&o.children&&le(ee,{alignment:i,orientation:"horizontal",children:[$(m,{className:"k-clear-selected",children:"Clear"}),$(m,{themeColor:"primary",className:"k-upload-selected",children:"Upload"})]})]})};v.states=Le;v.options=Pe;v.className=Q;v.defaultOptions=ie;import{jsx as Y,jsxs as X}from"react/jsx-runtime";var g="k-progressbar",we=[d.disabled,d.indeterminate],Ke={},b={indeterminate:!1,label:!0,labelPosition:"start",orientation:"horizontal",reverse:!1,value:"0"},M=o=>{let{disabled:e,height:s,indeterminate:r=b.indeterminate,label:i=b.label,labelPosition:c=b.labelPosition,orientation:l=b.orientation,reverse:u=b.reverse,value:p=b.value,width:h,style:H,...R}=o;return X("div",{...R,className:a(o.className,g,x(g,{disabled:e}),{[`${g}-${l}`]:l,[`${g}-indeterminate`]:r,[`${g}-reverse`]:u}),style:{...H,"--kendo-progressbar-value":p,[l==="horizontal"?"height":"width"]:l==="horizontal"?s:h},children:[Y("span",{className:a("k-progress-status-wrap",{[`k-progress-${c}`]:c&&!r}),children:i&&X("span",{className:"k-progress-status",children:[p,"%"]})}),!r&&Y("div",{className:"k-progressbar-value k-selected",children:Y("span",{className:a("k-progress-status-wrap",{[`k-progress-${c}`]:c}),children:i&&X("span",{className:"k-progress-status",children:[o.value,"%"]})})})]})};M.states=we;M.options=Ke;M.className=g;M.defaultOptions=b;import{jsx as j}from"react/jsx-runtime";var ce="k-chunk-progressbar",Oe=(o,e)=>e<=o-1,Te=[d.disabled,d.indeterminate],_e={},F={chunkCount:5,orientation:"horizontal",progress:0},E=o=>{let{disabled:e,chunkCount:s=F.chunkCount,indeterminate:r,orientation:i=F.orientation,progress:c=F.progress,reverse:l,...u}=o;return j("div",{...u,className:a(o.className,g,ce,x(g,{disabled:e}),{[`${g}-${i}`]:i,[`${g}-indeterminate`]:r,[`${g}-reverse`]:l}),children:j("ul",{className:"k-progressbar-chunks k-reset",children:[...Array(s)].map((p,h)=>j("li",{className:a("k-progressbar-chunk",{"k-first":h===0,"k-last":h===[...Array(s)].length-1,"k-selected":Oe(c,h)})},h))})})};E.states=Te;E.options=_e;E.className=ce;E.defaultOptions=F;import{jsx as tt}from"react/jsx-runtime";import{jsx as lt}from"react/jsx-runtime";import{jsx as ht,jsxs as xt}from"react/jsx-runtime";import{Fragment as Ct,jsx as Mt,jsxs as zt}from"react/jsx-runtime";import{Fragment as Tt,jsx as Kt,jsxs as Ot}from"react/jsx-runtime";import{Fragment as Ht,jsx as Et,jsxs as Rt}from"react/jsx-runtime";import{Fragment as Jt,jsx as qt,jsxs as Zt}from"react/jsx-runtime";import{Fragment as es,jsx as jt,jsxs as os}from"react/jsx-runtime";import{jsx as Ee}from"react/jsx-runtime";var fs=o=>Ee(v,{async:!0,empty:!0,...o});export{fs as UploadNormal};