UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.33 kB
var l=(...o)=>o.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 h=(o,e)=>l({[`${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"}),B=(o,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"},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"};import{Fragment as j,jsx as E}from"react/jsx-runtime";var T="k-icon k-font-icon",X=[],Q={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]},Y={},b=o=>{let{size:e,themeColor:s,icon:r,rotate:a,flip:c,...i}=o;return r?E("span",{...i,className:l(o.className,T,h(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,{})};b.states=X;b.options=Q;b.className=T;b.defaultOptions=Y;var H=b;import{Fragment as oe,jsx as I}from"react/jsx-runtime";var $="k-icon k-svg-icon",ee=[],te={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]},F={viewBox:"0 0 24 24"},k=o=>{let{size:e,themeColor:s,rotate:r,flip:a,viewBox:c=F.viewBox,icon:i,...x}=o;if(!i)return I(oe,{});i==="none"&&{...x,className:l(o.className,$,"k-none")};let m=typeof i=="object"&&i.name&&i.name;return I("span",{...x,className:l(o.className,$,h("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:I("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:o.children})})};k.states=ee;k.options=te;k.className=$;k.defaultOptions=F;var A=k;import*as R from"@progress/kendo-svg-icons";import{Fragment as _,jsx as z}from"react/jsx-runtime";var ne=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),se=[],re={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]},L={viewBox:"0 0 24 24",type:"svg"},y=o=>{let{size:e,themeColor:s,icon:r,type:a=L.type,rotate:c,flip:i,viewBox:x=L.viewBox,...m}=o;if(!r)return z(_,{});if(a==="svg"){if(r==="none")return z(A,{...m,icon:r,size:e});let N=ne(`${r}-icon`);return R[N]?z(A,{...m,icon:R[N],size:e,themeColor:s,rotate:c,flip:i,viewBox:x}):z(_,{})}return z(H,{...m,icon:r,size:e,themeColor:s,rotate:c,flip:i})};y.states=se;y.options=re;y.defaultOptions=L;import{Fragment as ae,jsx as w,jsxs as G}from"react/jsx-runtime";var M="k-button",ie=[u.hover,u.focus,u.active,u.selected,u.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:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},p={size:n.medium,rounded:g.medium,fillMode:f.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=o=>{let{size:e=p.size,rounded:s=p.rounded,fillMode:r=p.fillMode,themeColor:a=p.themeColor,showArrow:c=p.showArrow,arrowIconName:i=p.arrowIconName,hover:x,focus:m,active:N,selected:W,disabled:q,icon:O,text:C,iconClassName:D,...U}=o,Z=O!==void 0,J=o.children!==void 0;return G("button",{...U,className:l(o.className,M,h(M,{size:e,rounded:s,fillMode:r,themeColor:a}),B(M,{hover:x,focus:m,active:N,disabled:q,selected:W}),{"k-icon-button":!C&&!J&&Z}),children:[O&&w(y,{className:l(D,"k-button-icon"),icon:O}),C?G(ae,{children:[C&&w("span",{className:"k-button-text",children:C}),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(y,{icon:i})})]})};d.states=ie;d.options=le;d.className=M;d.defaultOptions=p;import{jsx as Ge}from"react/jsx-runtime";import{jsx as De}from"react/jsx-runtime";import{jsx as Xe}from"react/jsx-runtime";import{Fragment as ue,jsx as v,jsxs as P}from"react/jsx-runtime";var K="k-wizard-step",ce=[u.focus],de={},me=P(ue,{children:[v("span",{className:"k-wizard-buttons-left",children:v("span",{className:"k-wizard-pager",children:"Step 2 of 3"})}),P("span",{className:"k-wizard-buttons-right",children:[v(d,{children:"Previous"}),v(d,{themeColor:"primary",children:"Next"})]})]}),V={buttons:me},S=o=>{let{focus:e,buttons:s=V.buttons,...r}=o;return P("div",{...r,className:l(o.className,K,B(K,{focus:e})),children:[v("div",{className:"k-wizard-content",children:o.children}),s&&v("div",{className:"k-wizard-buttons",children:s})]})};S.states=ce;S.options=de;S.className=K;S.defaultOptions=V;var rt=S;export{K as WIZZARDSTEP_CLASSNAME,S as WizardStep,rt as default};