UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.64 kB
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((o,s)=>e[s]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var u=(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"}),w=(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 r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},C={small:"small",medium:"medium",large:"large",full:"full"};var i={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 L}from"react/jsx-runtime";import{createElement as Z}from"react";var _="k-treeview",ue=[],ve={size:[r.small,r.medium,r.large]},j={size:r.medium},f=t=>{let{size:e=j.size,children:o,dir:s,...c}=t,a=[];return o&&(Array.isArray(o)?o.map((n,x)=>{n.type===p&&a.push(Z(p,{...n.props,dir:s,key:x})),n.type===d&&a.push(Z(d,{...n.props,dir:s,key:x}))}):(o.type===p&&a.push(L(p,{...o.props,dir:s})),o.type===d&&a.push(L(d,{...o.props,dir:s})))),L("div",{...c,dir:s,className:l(t.className,_,u(_,{size:e})),children:L(d,{className:"k-treeview-lines",dir:s,children:a})})};f.states=ue;f.options=ve;f.className=_;f.defaultOptions=j;import{jsx as ee}from"react/jsx-runtime";var E="k-checkbox",we=[m.hover,m.focus,m.valid,m.invalid,m.required,m.disabled,m.checked,m.indeterminate],be={size:[r.small,r.medium,r.large],rounded:[C.small,C.medium,C.large,C.full]},X={size:r.medium,rounded:C.medium},v=t=>{let{id:e,checked:o,indeterminate:s,hover:c,focus:a,disabled:n,invalid:x,valid:h,required:k,size:A=X.size,rounded:O=X.rounded,...K}=t;return ee("span",{className:"k-checkbox-wrap",children:ee("input",{...K,id:e,type:"checkbox",defaultChecked:o,required:k,className:l(t.className,E,u(E,{size:A,rounded:O}),w(E,{hover:c,focus:a,disabled:n,invalid:x,valid:h,indeterminate:s,checked:o}))})})};v.states=we;v.options=be;v.className=E;v.defaultOptions=X;import{jsx as ye}from"react/jsx-runtime";var te="k-checkbox-list",ke=[],Ce={},oe={layout:"vertical"},y=t=>{let{layout:e=oe.layout,...o}=t;return ye("ul",{...o,className:l(t.className,te,{[`k-list-${e}`]:e}),children:t.children})};y.states=ke;y.options=Ce;y.className=te;y.defaultOptions=oe;import{jsx as Ne}from"react/jsx-runtime";var re="k-checkbox-list-item",Te=[],ge={},Ie={},T=t=>{let{...e}=t;return Ne("li",{...e,className:l(t.className,re),children:t.children})};T.states=Te;T.options=ge;T.className=re;T.defaultOptions=Ie;import{Fragment as wt,jsx as vt,jsxs as bt}from"react/jsx-runtime";import{Fragment as gt,jsx as Tt,jsxs as It}from"react/jsx-runtime";import{Fragment as Et,jsx as Lt,jsxs as Mt}from"react/jsx-runtime";import{Fragment as Kt,jsx as Ot,jsxs as Ht}from"react/jsx-runtime";import{jsx as _t}from"react/jsx-runtime";import{jsx as Vt}from"react/jsx-runtime";import{Fragment as Ee,jsx as ie}from"react/jsx-runtime";var J="k-icon k-font-icon",Se=[],ze={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},Le={},I=t=>{let{size:e,themeColor:o,icon:s,rotate:c,flip:a,...n}=t;return s?ie("span",{...n,className:l(t.className,J,u(J,{size:e}),{[`k-i-${s}`]:s,[`k-color-${o}`]:o,[`k-rotate-${c}`]:c,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"})}):ie(Ee,{})};I.states=Se;I.options=ze;I.className=J;I.defaultOptions=Le;var se=I;import{Fragment as Re,jsx as M}from"react/jsx-runtime";var V="k-icon k-svg-icon",Me=[],Ge={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},ne={viewBox:"0 0 24 24"},N=t=>{let{size:e,themeColor:o,rotate:s,flip:c,viewBox:a=ne.viewBox,icon:n,...x}=t;if(!n)return M(Re,{});n==="none"&&{...x,className:l(t.className,V,"k-none")};let h=typeof n=="object"&&n.name&&n.name;return M("span",{...x,className:l(t.className,V,u("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:M("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof n=="object"?n.viewBox:a,dangerouslySetInnerHTML:typeof n=="object"?{__html:n.content}:void 0,children:n?void 0:t.children})})};N.states=Me;N.options=Ge;N.className=V;N.defaultOptions=ne;var q=N;import*as le from"@progress/kendo-svg-icons";import{Fragment as ae,jsx as S}from"react/jsx-runtime";var Ae=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Oe=[],Ke={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[i.base,i.primary,i.secondary,i.tertiary,i.success,i.warning,i.error,i.info,i.light,i.dark]},W={viewBox:"0 0 24 24",type:"svg"},b=t=>{let{size:e,themeColor:o,icon:s,type:c=W.type,rotate:a,flip:n,viewBox:x=W.viewBox,...h}=t;if(!s)return S(ae,{});if(c==="svg"){if(s==="none")return S(q,{...h,icon:s,size:e});let k=Ae(`${s}-icon`);return le[k]?S(q,{...h,icon:le[k],size:e,themeColor:o,rotate:a,flip:n,viewBox:x}):S(ae,{})}return S(se,{...h,icon:s,size:e,themeColor:o,rotate:a,flip:n})};b.states=Oe;b.options=Ke;b.defaultOptions=W;import{jsx as ce}from"react/jsx-runtime";import{createElement as $e}from"react";var He="k-treeview-group",d=t=>{let{children:e,dir:o}=t,s=[];return e&&(Array.isArray(e)?e.map((c,a)=>{c.type===z&&s.push($e(z,{...c.props,dir:o,key:a}))}):e.type===z&&s.push(ce(z,{...e.props,dir:o}))),ce("ul",{className:l(t.className,He),children:s})};import{jsx as me,jsxs as _e}from"react/jsx-runtime";var U="k-treeview-leaf",Pe=[m.hover,m.focus,m.selected],Be={},G=t=>{let{text:e,showIcon:o,icon:s,hover:c,focus:a,selected:n,...x}=t;return _e("span",{...x,className:l(t.className,U,w(U,{hover:c,focus:a,selected:n})),children:[o&&me(b,{icon:s}),me("span",{className:"k-treeview-leaf-text",children:e})]})};G.states=Pe;G.options=Be;G.className=U;var pe=G;import{Fragment as qe,jsx as g,jsxs as de}from"react/jsx-runtime";import{createElement as Ve}from"react";var xe="k-treeview-item",Xe=[m.hover,m.focus,m.selected,m.disabled],Fe={},Je={},p=t=>{let{leafClassName:e,children:o,hasChildren:s,expanded:c,text:a,showIcon:n,icon:x,showCheckbox:h,checked:k,hover:A,focus:O,selected:K,disabled:H,top:D,bottom:Q,dir:$,...he}=t,Y=s||o,P=[];return o&&(Array.isArray(o)?o.map((B,fe)=>{B.type===d&&P.push(Ve(d,{...B.props,dir:$,key:fe},B.props.children))}):o.type===d&&P.push(g(d,{...o.props,dir:$,children:o.props.children}))),de("li",{...he,className:l(t.className,xe),children:[de("span",{className:l({"k-treeview-top":D,"k-treeview-bot":Q,"k-treeview-mid":!D&&!Q}),children:[Y&&g("span",{className:l("k-treeview-toggle",w("k-treeview-toggle",{disabled:H})),children:g(b,{icon:c?"caret-alt-down":$==="rtl"?"caret-alt-left":"caret-alt-right"})}),h&&g(v,{checked:k,disabled:H}),g(pe,{className:l(e,w(e,{disabled:H})),text:a,showIcon:n,icon:x,hover:A,focus:O,selected:K})]}),c&&Y&&g(qe,{children:P})]})};p.states=Xe;p.options=Fe;p.className=xe;p.defaultOptions=Je;var z=p;import{jsx as $o,jsxs as Po}from"react/jsx-runtime";import{jsx as Fo,jsxs as Jo}from"react/jsx-runtime";import{jsx as Uo,jsxs as Do}from"react/jsx-runtime";import{jsx as jo,jsxs as er}from"react/jsx-runtime";import{jsx as R}from"react/jsx-runtime";var xr=t=>R(f,{children:[R(p,{top:!0,text:"Treeview item"},"treeview-item-1"),R(p,{text:"Treeview item"},"treeview-item-2"),R(p,{bottom:!0,text:"Treeview item"},"treeview-item-3")],...t});export{xr as TreeviewNormal};