UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.47 kB
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...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 p=(t,e)=>l({[`${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"}),H=(t,e)=>l({"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"},g={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"},k={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 j,jsx as E}from"react/jsx-runtime";var T="k-icon k-font-icon",W=[],Y={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={},y=t=>{let{size:e,themeColor:s,icon:r,rotate:a,flip:c,...i}=t;return r?E("span",{...i,className:l(t.className,T,p(T,{size:e}),{[`k-i-${r}`]:r,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):E(j,{})};y.states=W;y.options=Y;y.className=T;y.defaultOptions=Z;var P=y;import{Fragment as te,jsx as z}from"react/jsx-runtime";var O="k-icon k-svg-icon",ee=[],oe={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]},F={viewBox:"0 0 24 24"},b=t=>{let{size:e,themeColor:s,rotate:r,flip:a,viewBox:c=F.viewBox,icon:i,...h}=t;if(!i)return z(te,{});i==="none"&&{...h,className:l(t.className,O,"k-none")};let m=typeof i=="object"&&i.name&&i.name;return z("span",{...h,className:l(t.className,O,p("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${s}`]:s,[`k-rotate-${r}`]:r,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),children:z("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:c,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};b.states=ee;b.options=oe;b.className=O;b.defaultOptions=F;var $=b;import*as R from"@progress/kendo-svg-icons";import{Fragment as _,jsx as C}from"react/jsx-runtime";var ne=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),re=[],se={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]},A={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:s,icon:r,type:a=A.type,rotate:c,flip:i,viewBox:h=A.viewBox,...m}=t;if(!r)return C(_,{});if(a==="svg"){if(r==="none")return C($,{...m,icon:r,size:e});let w=ne(`${r}-icon`);return R[w]?C($,{...m,icon:R[w],size:e,themeColor:s,rotate:c,flip:i,viewBox:h}):C(_,{})}return C(P,{...m,icon:r,size:e,themeColor:s,rotate:c,flip:i})};v.states=re;v.options=se;v.defaultOptions=A;import{Fragment as ae,jsx as N,jsxs as G}from"react/jsx-runtime";var M="k-button",ie=[k.hover,k.focus,k.active,k.selected,k.disabled],le={size:[n.small,n.medium,n.large],rounded:[g.small,g.medium,g.large,g.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]},x={size:n.medium,rounded:g.medium,fillMode:f.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=x.size,rounded:s=x.rounded,fillMode:r=x.fillMode,themeColor:a=x.themeColor,showArrow:c=x.showArrow,arrowIconName:i=x.arrowIconName,hover:h,focus:m,active:w,selected:U,disabled:q,icon:I,text:S,iconClassName:D,...J}=t,X=I!==void 0,Q=t.children!==void 0;return G("button",{...J,className:l(t.className,M,p(M,{size:e,rounded:s,fillMode:r,themeColor:a}),H(M,{hover:h,focus:m,active:w,disabled:q,selected:U}),{"k-icon-button":!S&&!Q&&X}),children:[I&&N(v,{className:l(D,"k-button-icon"),icon:I}),S?G(ae,{children:[S&&N("span",{className:"k-button-text",children:S}),t.children]}):t.children&&N("span",{className:"k-button-text",children:t.children}),c&&N("span",{className:"k-menu-button-arrow k-button-arrow",children:N(v,{icon:i})})]})};d.states=ie;d.options=le;d.className=M;d.defaultOptions=x;import{jsx as Ge}from"react/jsx-runtime";import{jsx as De}from"react/jsx-runtime";import{jsx as We}from"react/jsx-runtime";import{Fragment as ue,jsx as u,jsxs as K}from"react/jsx-runtime";var L="k-taskboard-column",ce=[],de={},me=K(ue,{children:[u("div",{className:"k-taskboard-column-header-text k-text-ellipsis",children:"Column Header"}),u("span",{className:"k-spacer"}),K("div",{className:"k-taskboard-column-header-actions",children:[u(d,{fillMode:"flat",icon:"pencil"}),u(d,{fillMode:"flat",icon:"plus"}),u(d,{fillMode:"flat",icon:"x"})]})]}),V={header:me},B=t=>{let{header:e=V.header,edit:s,...r}=t;return K("div",{...r,className:l(t.className,L,{[`${L}-edit`]:s}),children:[u("div",{className:"k-taskboard-column-header",children:e}),u("div",{className:"k-taskboard-column-cards-container",children:u("div",{className:"k-taskboard-column-cards",children:t.children})})]})};B.states=ce;B.options=de;B.className=L;B.defaultOptions=V;var so=B;export{L as TASKBOARDCOLUMN_CLASSNAME,B as TaskBoardColumn,so as default};