UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.57 kB
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((s,a)=>e[a]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(t,e)=>i({[`${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"}),k=(t,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 n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},v={small:"small",medium:"medium",large:"large",full:"full"},x={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"},m={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 re}from"react/jsx-runtime";var O="k-actions",ae=[],le={},P={alignment:"start",orientation:"horizontal"},b=t=>{let{alignment:e=P.alignment,orientation:s=P.orientation,...a}=t;return re("div",{...a,className:i(O,{[`${O}-${e}`]:e,[`${O}-${s}`]:s},t.className),children:t.children})};b.states=ae;b.options=le;b.className=O;b.defaultOptions=P;var G=b;import{Fragment as me,jsx as V}from"react/jsx-runtime";var D="k-icon k-font-icon",ie=[],ce={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]},de={},N=t=>{let{size:e,themeColor:s,icon:a,rotate:l,flip:c,...r}=t;return a?V("span",{...r,className:i(t.className,D,y(D,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):V(me,{})};N.states=ie;N.options=ce;N.className=D;N.defaultOptions=de;var q=N;import{Fragment as fe,jsx as T}from"react/jsx-runtime";var H="k-icon k-svg-icon",ue=[],pe={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]},Z={viewBox:"0 0 24 24"},z=t=>{let{size:e,themeColor:s,rotate:a,flip:l,viewBox:c=Z.viewBox,icon:r,...h}=t;if(!r)return T(fe,{});r==="none"&&{...h,className:i(t.className,H,"k-none")};let u=typeof r=="object"&&r.name&&r.name;return T("span",{...h,className:i(t.className,H,y("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:T("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:t.children})})};z.states=ue;z.options=pe;z.className=H;z.defaultOptions=Z;var E=z;import*as J from"@progress/kendo-svg-icons";import{Fragment as Q,jsx as C}from"react/jsx-runtime";var he=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),xe=[],ge={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]},_={viewBox:"0 0 24 24",type:"svg"},p=t=>{let{size:e,themeColor:s,icon:a,type:l=_.type,rotate:c,flip:r,viewBox:h=_.viewBox,...u}=t;if(!a)return C(Q,{});if(l==="svg"){if(a==="none")return C(E,{...u,icon:a,size:e});let I=he(`${a}-icon`);return J[I]?C(E,{...u,icon:J[I],size:e,themeColor:s,rotate:c,flip:r,viewBox:h}):C(Q,{})}return C(q,{...u,icon:a,size:e,themeColor:s,rotate:c,flip:r})};p.states=xe;p.options=ge;p.defaultOptions=_;import{Fragment as ve,jsx as S,jsxs as W}from"react/jsx-runtime";var L="k-button",ye=[m.hover,m.focus,m.active,m.selected,m.disabled],ke={size:[n.small,n.medium,n.large],rounded:[v.small,v.medium,v.large,v.full],fillMode:[x.solid,x.flat,x.outline,x.clear,x.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},g={size:n.medium,rounded:v.medium,fillMode:x.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=g.size,rounded:s=g.rounded,fillMode:a=g.fillMode,themeColor:l=g.themeColor,showArrow:c=g.showArrow,arrowIconName:r=g.arrowIconName,hover:h,focus:u,active:I,selected:j,disabled:ee,icon:U,text:A,iconClassName:oe,...te}=t,ne=U!==void 0,se=t.children!==void 0;return W("button",{...te,className:i(t.className,L,y(L,{size:e,rounded:s,fillMode:a,themeColor:l}),k(L,{hover:h,focus:u,active:I,disabled:ee,selected:j}),{"k-icon-button":!A&&!se&&ne}),children:[U&&S(p,{className:i(oe,"k-button-icon"),icon:U}),A?W(ve,{children:[A&&S("span",{className:"k-button-text",children:A}),t.children]}):t.children&&S("span",{className:"k-button-text",children:t.children}),c&&S("span",{className:"k-menu-button-arrow k-button-arrow",children:S(p,{icon:r})})]})};d.states=ye;d.options=ke;d.className=L;d.defaultOptions=g;import{jsx as to}from"react/jsx-runtime";import{jsx as lo}from"react/jsx-runtime";import{jsx as mo}from"react/jsx-runtime";import{Fragment as B,jsx as f,jsxs as w}from"react/jsx-runtime";var R="k-upload-dropzone",be=[m.hover],$=t=>{let{hover:e,status:s,...a}=t,l=f(B,{});switch(s){case"uploading":l=w(B,{children:[f(p,{icon:"upload"}),"Uploading..."]});break;case"done":l=w(B,{children:[f(p,{icon:"check"}),"Done"]});break;case"failed":l=w(B,{children:[f(p,{icon:"exclamation-circle"}),"Done"]});break;default:l=f(B,{});break}return w("div",{...a,className:i(t.className,R,"k-dropzone",k(R,{hover:e})),children:[w("div",{className:"k-upload-button-wrap",children:[f(d,{className:"k-upload-button",children:"Select files..."}),f("input",{id:"upload-input",className:"k-hidden"})]}),f("span",{className:i("k-dropzone-hint",{"k-hidden":s!=="upload"}),children:"Drop files here to upload"}),s!=="upload"&&f("span",{className:"k-upload-status",children:l})]})};$.states=be;$.className=R;import{jsx as K,jsxs as X}from"react/jsx-runtime";var F="k-upload",Ne=[m.hover,m.disabled],ze={},Y={actionsLayout:"end"},M=t=>{let{async:e,empty:s,actions:a,actionsLayout:l=Y.actionsLayout,hover:c,status:r,disabled:h,...u}=t;return X("div",{...u,className:i(t.className,F,k(F,{disabled:h}),{"k-upload-async":e,"k-upload-empty":s}),children:[K($,{status:r,hover:c}),t.children&&K("ul",{className:"k-upload-files",children:t.children}),a&&t.children&&X(G,{alignment:l,orientation:"horizontal",children:[K(d,{className:"k-clear-selected",children:"Clear"}),K(d,{themeColor:"primary",className:"k-upload-selected",children:"Upload"})]})]})};M.states=Ne;M.options=ze;M.className=F;M.defaultOptions=Y;var wo=M;export{F as UPLOAD_CLASSNAME,M as Upload,wo as default};