UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 11.2 kB
var s=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?s(...t):typeof t=="object"?Object.keys(t).map((o,r)=>t[r]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var N=(e,t)=>s({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.fillMode}-${t.themeColor}`]:t.fillMode&&t.themeColor},{[`${e}-${t.themeColor}`]:t.themeColor&&t.fillMode===void 0},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full"}),M=(e,t)=>{let{valid:o,invalid:r,hover:c,focus:l,checked:a,active:L,selected:d,disabled:u,indeterminate:h,loading:x,empty:f,readonly:b,highlighted:Y,...K}=t;return s({"k-valid":o,"k-invalid":r,"k-hover":c,"k-focus":l,"k-checked":a,"k-active":L,"k-selected":d,"k-disabled":u,"k-indeterminate":h&&!a,"k-loading":x,"k-empty":f,"k-readonly":b,"k-highlighted":Y},Object.keys(K).reduce((v,E)=>(E.startsWith("k-")?v[E]=K[E]:v[`k-${E}`]=K[E],v),{}))};var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},_={small:"small",medium:"medium",large:"large",full:"full"};var n={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",generating:"generating",expanded:"expanded"};import{jsx as Te}from"react/jsx-runtime";var Oe="k-no-data",P=e=>Te("span",{className:s(Oe,e.className),children:e.children});var I="list",S=I;import{jsx as R,jsxs as ce}from"react/jsx-runtime";var Z="k-list",Ke=[],ze={size:[i.small,i.medium,i.large]},de={size:i.medium},C=e=>{let{size:t=de.size,virtualization:o,children:r,optionLabel:c,customValue:l,screenReaders:a,...L}=e,d,u,h,x,f=[];return r?r.map((b,Y)=>{b.type===k?(b.props.root===!0?(d=b.props.label,b.props.children.map((K,v)=>{f.push(R(p,{...K.props},`optChild-${v}-${new Date().getTime()}`))})):b.props.children.forEach((K,v)=>{let E="";v===0&&(E=b.props.label),f.push(R(p,{className:v===0?"k-first":"",...K.props,groupLabel:E},`groupLabel-${v}-${new Date().getTime()}`))}),u=R(k,{label:d,virtualization:o,children:f})):b.type===p&&(f.push(R(p,{...b.props},`${b.type}-${Y}`)),h=R(G,{virtualization:o,children:f}),a&&(x=ce(P,{className:"k-sr-only",children:[f.length," items found."]})))}):x=R(P,{children:"No data found."}),ce("div",{...L,className:s(e.className,Z,N(Z,{size:t}),{"k-virtual-list":o}),children:[c,l,u,h,x]})};C.states=Ke;C.options=ze;C.className=Z;C.defaultOptions=de;C.moduleName=I;C.folderName=S;import{jsx as Ge}from"react/jsx-runtime";var ue="k-list-container",He=[],_e={},Re={},D=e=>{let{...t}=e;return Ge("div",{...t,className:s(e.className,ue),children:e.children})};D.states=He;D.options=_e;D.className=ue;D.defaultOptions=Re;D.moduleName=I;D.folderName=S;import{jsx as z,jsxs as Pe}from"react/jsx-runtime";var j="k-list",De=[],$e={size:[i.small,i.medium,i.large]},Le={size:i.medium},y=e=>{let{size:t=Le.size,virtualization:o,children:r,...c}=e,l,a,L,d=[];return r?r.map((u,h)=>{u.type===k?(u.props.root===!0?(l=u.props.label,u.props.children.map((x,f)=>{d.push(z(p,{...x.props},`optChild-${f}-${new Date().getTime()}`))})):(d.push(z(fe,{...u.props,children:u.props.label},`listChild-${h}`)),u.props.children.map((x,f)=>{d.push(z(p,{...x.props},`fwOptChild-${f}-${new Date().getTime()}`))})),a=z(k,{label:l,virtualization:o,children:d})):u.type===p&&(d.push(z(p,{...u.props},`${u.type}-${h}`)),L=z(G,{virtualization:o,children:d}))}):L=z(P,{children:"No data found."}),Pe("div",{...c,className:s(e.className,j,N(j,{size:t}),{"k-virtual-list":o}),children:[a,L]})};y.states=De;y.options=$e;y.className=j;y.defaultOptions=Le;y.moduleName=I;y.folderName=S;var H="checkbox",$=H;import{jsx as xe}from"react/jsx-runtime";var F="k-checkbox",we=[m.hover,m.focus,m.valid,m.invalid,m.required,m.disabled,m.checked,m.indeterminate],Be={size:[i.small,i.medium,i.large],rounded:[_.small,_.medium,_.large,_.full]},ee={size:i.medium,rounded:_.medium},g=e=>{let{id:t,checked:o,indeterminate:r,hover:c,focus:l,disabled:a,invalid:L,valid:d,required:u,size:h=ee.size,rounded:x=ee.rounded,...f}=e;return xe("span",{className:"k-checkbox-wrap",children:xe("input",{...f,id:t,type:"checkbox",defaultChecked:o,required:u,className:s(e.className,F,N(F,{size:h,rounded:x}),M(F,{hover:c,focus:l,disabled:a,invalid:L,valid:d,indeterminate:r,checked:o}))})})};g.states=we;g.options=Be;g.className=F;g.defaultOptions=ee;g.moduleName=H;g.folderName=$;import{jsx as Ue}from"react/jsx-runtime";var be="k-checkbox-list",Xe=[],Fe={},he={layout:"vertical"},A=e=>{let{layout:t=he.layout,...o}=e;return Ue("ul",{...o,className:s(e.className,be,{[`k-list-${t}`]:t}),children:e.children})};A.states=Xe;A.options=Fe;A.className=be;A.defaultOptions=he;A.moduleName=H;A.folderName=$;import{jsx as qe}from"react/jsx-runtime";var Ce="k-checkbox-list-item",Ve=[],Je={},We={},O=e=>{let{...t}=e;return qe("li",{...t,className:s(e.className,Ce),children:e.children})};O.states=Ve;O.options=Je;O.className=Ce;O.defaultOptions=We;O.moduleName=H;O.folderName=$;import{Fragment as bo,jsx as xo,jsxs as ho}from"react/jsx-runtime";import{Fragment as vo,jsx as go,jsxs as Io}from"react/jsx-runtime";import{Fragment as Ao,jsx as So,jsxs as Oo}from"react/jsx-runtime";import{Fragment as _o,jsx as Ho,jsxs as Ro}from"react/jsx-runtime";import{jsx as Po}from"react/jsx-runtime";import{jsx as Fo}from"react/jsx-runtime";import{Fragment as je,jsx as Ne}from"react/jsx-runtime";var oe="k-font-icon",Qe=[],Ye={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},Ze={},w=e=>{let{size:t,themeColor:o,icon:r,rotate:c,flip:l,...a}=e;return r?Ne("span",{...a,className:s(e.className,oe,N(oe,{size:t}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${c}`]:c,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):Ne(je,{})};w.states=Qe;w.options=Ye;w.className=oe;w.defaultOptions=Ze;var ke=w;import{Fragment as ot,jsx as U}from"react/jsx-runtime";var se="k-svg-icon",et=[],tt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},ge={viewBox:"0 0 24 24"},B=e=>{let{size:t,themeColor:o,rotate:r,flip:c,viewBox:l=ge.viewBox,icon:a,...L}=e;if(!a)return U(ot,{});a==="none"&&{...L,className:s(e.className,se,"k-none")};let d=typeof a=="object"&&a.name&&a.name;return U("span",{...L,className:s(e.className,se,N("k-icon",{size:t}),{[`k-svg-i-${d}`]:d,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),children:U("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:l,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:e.children})})};B.states=et;B.options=tt;B.className=se;B.defaultOptions=ge;var ie=B;import*as ne from"@progress/kendo-svg-icons";var ve="icon",Ie="icons";import{Fragment as ye,jsx as X}from"react/jsx-runtime";var V="k-icon",st=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),it=[],nt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},re={viewBox:"0 0 24 24",type:"svg"},T=e=>{let{size:t,themeColor:o,icon:r,type:c=re.type,rotate:l,flip:a,viewBox:L=re.viewBox,...d}=e;if(!r)return X(ye,{});if(c==="svg"){if(r==="none")return X(ie,{...d,className:s(e.className,V),icon:r,size:t});let u=ne[r]?r:st(`${r}-icon`);return ne[u]?X(ie,{...d,className:s(e.className,V),icon:ne[u],size:t,themeColor:o,rotate:l,flip:a,viewBox:L}):X(ye,{})}return X(ke,{...d,className:s(e.className,V),icon:r,size:t,themeColor:o,rotate:l,flip:a})};T.states=it;T.options=nt;T.defaultOptions=re;T.className=V;T.moduleName=ve;T.folderName=Ie;import{jsx as J,jsxs as mt}from"react/jsx-runtime";var ae="k-list-item",rt=[m.hover,m.focus,m.selected,m.disabled],at={},lt={},p=e=>{let{text:t,groupLabel:o,group:r,showIcon:c,iconName:l,showCheckbox:a,checked:L,hover:d,focus:u,selected:h,disabled:x,...f}=e,b=t||e.children;return mt("li",{...f,className:s(e.className,r?"k-list-group-item":ae,M(ae,{hover:d,focus:u,disabled:x,selected:h})),children:[a&&J(g,{checked:L}),c&&J(T,{icon:l}),J("span",{className:"k-list-item-text",children:b}),o&&o!==""&&J("div",{className:"k-list-item-group-label",children:o})]})};p.states=rt;p.options=at;p.className=ae;p.defaultOptions=lt;p.moduleName=I;p.folderName=S;import{jsx as le,jsxs as ct}from"react/jsx-runtime";var pt="k-list-content",G=e=>{let{virtualization:t,...o}=e;return ct("div",{...o,className:s(pt,e.className),children:[le("ul",{className:s("k-list-ul"),children:e.children}),t&&le("div",{className:"k-height-container",children:le("div",{})})]})};import{jsx as Ee}from"react/jsx-runtime";var dt="k-list-group-sticky-header",Me=e=>Ee("div",{className:s(dt,e.className),children:Ee("div",{className:"k-list-header-text",children:e.children})});import{Fragment as ut,jsx as Se,jsxs as Lt}from"react/jsx-runtime";var k=e=>{let{virtualization:t,label:o}=e;return Lt(ut,{children:[o&&Se(Me,{children:o}),e.children&&Se(G,{virtualization:t,children:e.children})]})};import{jsx as Ae}from"react/jsx-runtime";var ft="k-list-group-item",fe=e=>Ae("li",{className:s(ft,e.className),children:Ae("span",{className:"k-list-item-text",children:e.children})});import{jsx as Ct}from"react/jsx-runtime";var me="k-list-optionlabel",xt=[m.hover,m.focus,m.selected,m.disabled],bt={},ht={},W=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:l,...a}=e;return Ct("div",{...a,className:s(me,M(me,{hover:o,focus:r,selected:c,disabled:l})),children:t})};W.states=xt;W.options=bt;W.className=me;W.defaultOptions=ht;import{jsx as vt}from"react/jsx-runtime";var pe="k-list-custom-value",Nt=[m.hover,m.focus,m.selected,m.disabled],kt={},gt={},q=e=>{let{text:t,hover:o,focus:r,selected:c,disabled:l,...a}=e;return vt("div",{...a,className:s(pe,M(pe,{hover:o,focus:r,selected:c,disabled:l})),children:t})};q.states=Nt;q.options=kt;q.className=pe;q.defaultOptions=gt;import{jsx as Us}from"react/jsx-runtime";import{jsx as qs,jsxs as Qs}from"react/jsx-runtime";import{jsx as ei,jsxs as ti}from"react/jsx-runtime";import{jsx as ni}from"react/jsx-runtime";import{jsx as mi,jsxs as pi}from"react/jsx-runtime";import{jsx as Li,jsxs as fi}from"react/jsx-runtime";import{jsx as Q}from"react/jsx-runtime";var Ri=e=>Q(C,{children:[Q(p,{children:"List item"},"list-item-1"),Q(p,{children:"List item"},"list-item-2"),Q(p,{children:"List item"},"list-item-3")],...e});export{Ri as ListNormal};