UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.92 kB
var a=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((i,r)=>e[r]||e[i]&&i||null).filter(i=>i!==null).join(" "):e).filter(e=>!!e).join(" ");var x=(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"}),R=(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"},g={small:"small",medium:"medium",large:"large",full:"full"},u={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"},v={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 te}from"react/jsx-runtime";var M="k-actions",j=[],ee={},L={alignment:"start",orientation:"horizontal"},y=o=>{let{alignment:e=L.alignment,orientation:i=L.orientation,...r}=o;return te("div",{...r,className:a(M,{[`${M}-${e}`]:e,[`${M}-${i}`]:i},o.className),children:o.children})};y.states=j;y.options=ee;y.className=M;y.defaultOptions=L;import{Fragment as re,jsx as G}from"react/jsx-runtime";var P="k-icon k-font-icon",oe=[],ne={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]},ie={},b=o=>{let{size:e,themeColor:i,icon:r,rotate:l,flip:c,...s}=o;return r?G("span",{...s,className:a(o.className,P,x(P,{size:e}),{[`k-i-${r}`]:r,[`k-color-${i}`]:i,[`k-rotate-${l}`]:l,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):G(re,{})};b.states=oe;b.options=ne;b.className=P;b.defaultOptions=ie;var F=b;import{Fragment as le,jsx as A}from"react/jsx-runtime";var H="k-icon k-svg-icon",se=[],ae={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]},_={viewBox:"0 0 24 24"},N=o=>{let{size:e,themeColor:i,rotate:r,flip:l,viewBox:c=_.viewBox,icon:s,...h}=o;if(!s)return A(le,{});s==="none"&&{...h,className:a(o.className,H,"k-none")};let m=typeof s=="object"&&s.name&&s.name;return A("span",{...h,className:a(o.className,H,x("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${i}`]:i,[`k-rotate-${r}`]:r,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:A("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:c,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?void 0:o.children})})};N.states=se;N.options=ae;N.className=H;N.defaultOptions=_;var E=N;import*as V from"@progress/kendo-svg-icons";import{Fragment as U,jsx as C}from"react/jsx-runtime";var ce=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),de=[],me={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]},K={viewBox:"0 0 24 24",type:"svg"},k=o=>{let{size:e,themeColor:i,icon:r,type:l=K.type,rotate:c,flip:s,viewBox:h=K.viewBox,...m}=o;if(!r)return C(U,{});if(l==="svg"){if(r==="none")return C(E,{...m,icon:r,size:e});let S=ce(`${r}-icon`);return V[S]?C(E,{...m,icon:V[S],size:e,themeColor:i,rotate:c,flip:s,viewBox:h}):C(U,{})}return C(F,{...m,icon:r,size:e,themeColor:i,rotate:c,flip:s})};k.states=de;k.options=me;k.defaultOptions=K;import{Fragment as pe,jsx as B,jsxs as D}from"react/jsx-runtime";var O="k-button",ue=[v.hover,v.focus,v.active,v.selected,v.disabled],fe={size:[n.small,n.medium,n.large],rounded:[g.small,g.medium,g.large,g.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},f={size:n.medium,rounded:g.medium,fillMode:u.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=o=>{let{size:e=f.size,rounded:i=f.rounded,fillMode:r=f.fillMode,themeColor:l=f.themeColor,showArrow:c=f.showArrow,arrowIconName:s=f.arrowIconName,hover:h,focus:m,active:S,selected:J,disabled:X,icon:$,text:I,iconClassName:Q,...W}=o,Y=$!==void 0,Z=o.children!==void 0;return D("button",{...W,className:a(o.className,O,x(O,{size:e,rounded:i,fillMode:r,themeColor:l}),R(O,{hover:h,focus:m,active:S,disabled:X,selected:J}),{"k-icon-button":!I&&!Z&&Y}),children:[$&&B(k,{className:a(Q,"k-button-icon"),icon:$}),I?D(pe,{children:[I&&B("span",{className:"k-button-text",children:I}),o.children]}):o.children&&B("span",{className:"k-button-text",children:o.children}),c&&B("span",{className:"k-menu-button-arrow k-button-arrow",children:B(k,{icon:s})})]})};d.states=ue;d.options=fe;d.className=O;d.defaultOptions=f;import{jsx as je}from"react/jsx-runtime";import{jsx as nt}from"react/jsx-runtime";import{jsx as at}from"react/jsx-runtime";import{Fragment as ve,jsx as p,jsxs as q}from"react/jsx-runtime";var T="k-pivotgrid-configurator",he=[],xe={},ge=q(ve,{children:[p(d,{children:"Cancel"}),p(d,{themeColor:"primary",children:"Apply"})]}),w={orientation:"vertical",mode:"push",actionButtons:ge,header:"Settings"},z=o=>{let{orientation:e=w.orientation,mode:i=w.mode,actionButtons:r=w.actionButtons,header:l=w.header,children:c,...s}=o;return p("div",{...s,className:a(o.className,T),children:q("div",{className:a("k-pivotgrid-configurator-panel",{[`${T}-${e}`]:e,[`${T}-${i}`]:i}),children:[p("div",{className:"k-pivotgrid-configurator-header",children:p("div",{className:"k-pivotgrid-configurator-header-text",children:l})}),p("div",{className:"k-pivotgrid-configurator-content",children:c}),p(y,{alignment:"end",className:"k-pivotgrid-configurator-actions",children:r})]})})};z.states=he;z.options=xe;z.className=T;z.defaultOptions=w;var gt=z;export{T as PIVOTGRIDCONFIGURATOR_CLASSNAME,z as PivotGridConfigurator,gt as default};