UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.74 kB
var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...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)=>r({[`${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"}),G=(t,e)=>{let{valid:s,invalid:a,hover:m,focus:d,checked:l,active:h,selected:p,disabled:g,indeterminate:b,loading:P,empty:O,readonly:ee,highlighted:te,...S}=e;return r({"k-valid":s,"k-invalid":a,"k-hover":m,"k-focus":d,"k-checked":l,"k-active":h,"k-selected":p,"k-disabled":g,"k-indeterminate":b&&!l,"k-loading":P,"k-empty":O,"k-readonly":ee,"k-highlighted":te},Object.keys(S).reduce((T,v)=>(v.startsWith("k-")?T[v]=S[v]:T[`k-${v}`]=S[v],T),{}))};var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var 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"},B={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",generating:"generating",expanded:"expanded"};var _="panelbar",D=_;import{jsx as re}from"react/jsx-runtime";var U="k-panelbar",oe=[],ne={},ae={},x=t=>{let{...e}=t;return re("ul",{...e,className:r(t.className,U),children:t.children})};x.states=oe;x.options=ne;x.className=U;x.defaultOptions=ae;x.moduleName=_;x.folderName=D;import{Fragment as ce,jsx as K}from"react/jsx-runtime";var z="k-font-icon",le=[],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]},ie={},I=t=>{let{size:e,themeColor:s,icon:a,rotate:m,flip:d,...l}=t;return a?K("span",{...l,className:r(t.className,z,y(z,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${m}`]:m,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):K(ce,{})};I.states=le;I.options=se;I.className=z;I.defaultOptions=ie;var V=I;import{Fragment as pe,jsx as A}from"react/jsx-runtime";var $="k-svg-icon",me=[],de={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]},q={viewBox:"0 0 24 24"},k=t=>{let{size:e,themeColor:s,rotate:a,flip:m,viewBox:d=q.viewBox,icon:l,...h}=t;if(!l)return A(pe,{});l==="none"&&{...h,className:r(t.className,$,"k-none")};let p=typeof l=="object"&&l.name&&l.name;return A("span",{...h,className:r(t.className,$,y("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:A("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:d,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};k.states=me;k.options=de;k.className=$;k.defaultOptions=q;var R=k;import*as w from"@progress/kendo-svg-icons";var W="icon",J="icons";import{Fragment as Q,jsx as C}from"react/jsx-runtime";var M="k-icon",xe=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),fe=[],ue={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]},H={viewBox:"0 0 24 24",type:"svg"},u=t=>{let{size:e,themeColor:s,icon:a,type:m=H.type,rotate:d,flip:l,viewBox:h=H.viewBox,...p}=t;if(!a)return C(Q,{});if(m==="svg"){if(a==="none")return C(R,{...p,className:r(t.className,M),icon:a,size:e});let g=w[a]?a:xe(`${a}-icon`);return w[g]?C(R,{...p,className:r(t.className,M),icon:w[g],size:e,themeColor:s,rotate:d,flip:l,viewBox:h}):C(Q,{})}return C(V,{...p,className:r(t.className,M),icon:a,size:e,themeColor:s,rotate:d,flip:l})};u.states=fe;u.options=ue;u.defaultOptions=H;u.className=M;u.moduleName=W;u.folderName=J;import{jsx as L,jsxs as X}from"react/jsx-runtime";var Y="k-panelbar-item",he=[B.hover,B.focus,B.selected,B.disabled],ge={},E={level:0,expanded:!1,text:"Item"},i=t=>{let{text:e=E.text,level:s=E.level,expanded:a=E.expanded,header:m,hover:d,focus:l,selected:h,disabled:p,icon:g,iconClass:b,children:P,...O}=t;return X("li",{...O,className:r(t.className,Y,{"k-panelbar-header":m,[`k-level-${s}`]:s||s===0,"k-expanded":a}),children:[X("span",{className:r("k-link",G("k-link",{hover:d,focus:l,disabled:p,selected:h})),children:[g&&L(u,{className:"k-panelbar-item-icon",icon:g}),b&&!g&&L("span",{className:`k-panelbar-item-icon ${b}`}),L("span",{className:"k-panelbar-item-text",children:e}),P&&L(u,{className:r("k-panelbar-toggle",a?"k-panelbar-collapse":"k-panelbar-expand"),icon:`chevron-${a?"up":"down"}`})]}),a&&P]})};i.states=he;i.options=ge;i.className=Y;i.defaultOptions=E;import{jsx as Ie}from"react/jsx-runtime";var Z="k-panelbar-group",Ne=[],ve={},Be={},N=t=>{let{...e}=t;return Ie("ul",{...e,className:r(t.className,Z),children:t.children})};N.states=Ne;N.options=ve;N.className=Z;N.defaultOptions=Be;import{jsx as Pe}from"react/jsx-runtime";var j="k-panelbar-content",ke=[],Ce={},be={},f=t=>{let{...e}=t;return Pe("div",{...e,className:r(t.className,j),children:t.children})};f.states=ke;f.options=Ce;f.className=j;f.defaultOptions=be;import{Fragment as ht,jsx as ut,jsxs as gt}from"react/jsx-runtime";import{Fragment as kt,jsx as It,jsxs as Ct}from"react/jsx-runtime";import{Fragment as ye,jsx as c,jsxs as F}from"react/jsx-runtime";var _t=t=>c(x,{children:F(ye,{children:[c(i,{header:!0,text:"Item 1",children:c(f,{children:"content"})}),c(i,{header:!0,expanded:!0,text:"Item 2",children:F(N,{children:[c(i,{level:1,text:"Child 1"}),c(i,{level:1,expanded:!0,text:"Child 2",children:F(N,{children:[c(i,{level:2,text:"Child 2.1"}),c(i,{level:2,text:"Child 2.2"})]})}),c(i,{level:1,text:"Child 3",children:c(f,{children:"content"})}),c(i,{level:1,text:"Child 4"})]})}),c(i,{header:!0,text:"Item 3",children:c(f,{children:"content"})}),c(i,{header:!0,text:"Item 4"})]}),...t});export{_t as PanelBarExpandGroup};