@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.88 kB
JavaScript
var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...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 B=(t,e)=>i({[`${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"}),S=(t,e)=>i({"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"};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"},d={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 de}from"react/jsx-runtime";var X="k-stepper",ce=[],pe={},me={},k=t=>{let{style:e,...s}=t;return de("nav",{...s,style:e,className:i(t.className,X),children:t.children})};k.options=pe;k.states=ce;k.className=X;k.defaultOptions=me;import{jsx as he}from"react/jsx-runtime";var H="k-step-list",ue=[],fe={},Q={orientation:"horizontal"},v=t=>{let{style:e,orientation:s=Q.orientation,...a}=t;return he("ol",{...a,style:e,className:i(t.className,H,{[`${H}-${s}`]:s}),children:t.children})};v.options=fe;v.states=ue;v.className=H;v.defaultOptions=Q;import{Fragment as ve,jsx as Y}from"react/jsx-runtime";var K="k-icon k-font-icon",xe=[],ge={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]},ke={},N=t=>{let{size:e,themeColor:s,icon:a,rotate:c,flip:l,...r}=t;return a?Y("span",{...r,className:i(t.className,K,B(K,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${c}`]:c,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"})}):Y(ve,{})};N.states=xe;N.options=ge;N.className=K;N.defaultOptions=ke;var Z=N;import{Fragment as be,jsx as M}from"react/jsx-runtime";var _="k-icon k-svg-icon",ye=[],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]},j={viewBox:"0 0 24 24"},C=t=>{let{size:e,themeColor:s,rotate:a,flip:c,viewBox:l=j.viewBox,icon:r,...p}=t;if(!r)return M(be,{});r==="none"&&{...p,className:i(t.className,_,"k-none")};let m=typeof r=="object"&&r.name&&r.name;return M("span",{...p,className:i(t.className,_,B("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"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 r=="object"?r.viewBox:l,dangerouslySetInnerHTML:typeof r=="object"?{__html:r.content}:void 0,children:r?void 0:t.children})})};C.states=ye;C.options=Se;C.className=_;C.defaultOptions=j;var G=C;import*as ee from"@progress/kendo-svg-icons";import{Fragment as te,jsx as P}from"react/jsx-runtime";var Ne=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ce=[],Pe={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]},F={viewBox:"0 0 24 24",type:"svg"},b=t=>{let{size:e,themeColor:s,icon:a,type:c=F.type,rotate:l,flip:r,viewBox:p=F.viewBox,...m}=t;if(!a)return P(te,{});if(c==="svg"){if(a==="none")return P(G,{...m,icon:a,size:e});let h=Ne(`${a}-icon`);return ee[h]?P(G,{...m,icon:ee[h],size:e,themeColor:s,rotate:l,flip:r,viewBox:p}):P(te,{})}return P(Z,{...m,icon:a,size:e,themeColor:s,rotate:l,flip:r})};b.states=Ce;b.options=Pe;b.defaultOptions=F;import{jsx as x,jsxs as V}from"react/jsx-runtime";var g="k-step",$e=[d.disabled,d.hover,d.focus,d.invalid,d.valid],ze={},Le={},u=t=>{let{style:e,disabled:s,hover:a,focus:c,invalid:l,valid:r,optional:p,first:m,done:h,current:I,last:T,label:E,text:U,icon:R,stepContent:J,...ne}=t,ie=l?"warning-circle":"check-circle",le=!!(r||l);return V("li",{...ne,style:e,className:i(t.className,g,{[`${g}-done`]:h,[`${g}-first`]:m,[`${g}-current`]:I,[`${g}-last`]:T,[`${g}-optional`]:p,[`${g}-success`]:r,[`${g}-error`]:l},S(g,{hover:a,focus:c,disabled:s})),children:[V("a",{href:"#",className:"k-step-link",children:[U&&!R&&x("span",{className:"k-step-indicator",children:x("span",{className:"k-step-indicator-text",children:U})}),R&&x("span",{className:"k-step-indicator",children:x(b,{className:"k-step-indicator-icon",icon:R})}),p&&!E&&x("span",{className:"k-step-label",children:x("span",{className:"k-step-label-optional",children:"(Optional)"})}),E&&V("span",{className:"k-step-label",children:[x("span",{className:"k-step-text",children:E}),le&&x(b,{icon:ie}),p&&x("span",{className:"k-step-label-optional",children:"(Optional)"})]})]}),J&&x("div",{className:"k-step-content",style:{height:"140px"},children:J})]})};u.options=ze;u.states=$e;u.className=g;u.defaultOptions=Le;import{jsx as q,jsxs as W}from"react/jsx-runtime";var f="k-progressbar",Be=[d.disabled,d.indeterminate],Me={},y={indeterminate:!1,label:!0,labelPosition:"start",orientation:"horizontal",reverse:!1,value:"0"},$=t=>{let{disabled:e,height:s,indeterminate:a=y.indeterminate,label:c=y.label,labelPosition:l=y.labelPosition,orientation:r=y.orientation,reverse:p=y.reverse,value:m=y.value,width:h,style:I,...T}=t;return W("div",{...T,className:i(t.className,f,S(f,{disabled:e}),{[`${f}-${r}`]:r,[`${f}-indeterminate`]:a,[`${f}-reverse`]:p}),style:{...I,"--kendo-progressbar-value":m,[r==="horizontal"?"height":"width"]:r==="horizontal"?s:h},children:[q("span",{className:i("k-progress-status-wrap",{[`k-progress-${l}`]:l&&!a}),children:c&&W("span",{className:"k-progress-status",children:[m,"%"]})}),!a&&q("div",{className:"k-progressbar-value k-selected",children:q("span",{className:i("k-progress-status-wrap",{[`k-progress-${l}`]:l}),children:c&&W("span",{className:"k-progress-status",children:[t.value,"%"]})})})]})};$.states=Be;$.options=Me;$.className=f;$.defaultOptions=y;var oe=$;import{jsx as D}from"react/jsx-runtime";var se="k-chunk-progressbar",Oe=(t,e)=>e<=t-1,Ae=[d.disabled,d.indeterminate],we={},O={chunkCount:5,orientation:"horizontal",progress:0},A=t=>{let{disabled:e,chunkCount:s=O.chunkCount,indeterminate:a,orientation:c=O.orientation,progress:l=O.progress,reverse:r,...p}=t;return D("div",{...p,className:i(t.className,f,se,S(f,{disabled:e}),{[`${f}-${c}`]:c,[`${f}-indeterminate`]:a,[`${f}-reverse`]:r}),children:D("ul",{className:"k-progressbar-chunks k-reset",children:[...Array(s)].map((m,h)=>D("li",{className:i("k-progressbar-chunk",{"k-first":h===0,"k-last":h===[...Array(s)].length-1,"k-selected":Oe(l,h)})},h))})})};A.states=Ae;A.options=we;A.className=se;A.defaultOptions=O;import{jsx as Ie}from"react/jsx-runtime";var w=t=>Ie(oe,{...t});import{jsx as Bt}from"react/jsx-runtime";import{Fragment as Te,jsx as z,jsxs as re}from"react/jsx-runtime";var Ht=({gridTemplateColumns:t="repeat(6, 1fr)",...e})=>z(k,{style:{display:"grid",gridTemplateColumns:t},children:re(Te,{children:[re(v,{style:{gridColumnStart:"1",gridColumnEnd:"-1"},children:[z(u,{first:!0,done:!0,icon:"check",style:{maxWidth:"33.333%"}}),z(u,{current:!0,focus:!0,text:"2",style:{maxWidth:"33.333%"}}),z(u,{last:!0,optional:!0,text:"3",style:{maxWidth:"33.333%"}})]}),z(w,{label:!1,value:"50"})]}),...e});import{Fragment as Ee,jsx as L,jsxs as ae}from"react/jsx-runtime";var Vt=({gridTemplateRows:t="repeat(3, 1fr)",...e})=>L(k,{style:{display:"grid",gridTemplateRows:t},children:ae(Ee,{children:[ae(v,{orientation:"vertical",style:{gridRowStart:"1",gridRowEnd:"-1"},children:[L(u,{first:!0,done:!0,icon:"check",style:{maxHeight:"33.333%"}}),L(u,{current:!0,focus:!0,text:"2",style:{maxHeight:"33.333%"}}),L(u,{last:!0,optional:!0,text:"3",style:{maxHeight:"33.333%"}})]}),L(w,{orientation:"vertical",reverse:!0,label:!1,value:"50"})]}),...e});export{u as Step,v as StepList,k as Stepper,Ht as StepperNormal,Vt as StepperVertical};