UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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