UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.7 kB
var ce=Object.create;var A=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var fe=(t,e)=>{for(var o in e)A(t,o,{get:e[o],enumerable:!0})},X=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of me(e))!ue.call(t,i)&&i!==o&&A(t,i,{get:()=>e[i],enumerable:!(r=pe(e,i))||r.enumerable});return t};var he=(t,e,o)=>(o=t!=null?ce(de(t)):{},X(e||!t||!t.__esModule?A(o,"default",{value:t,enumerable:!0}):o,t)),xe=t=>X(A({},"__esModule",{value:!0}),t);var Ge={};fe(Ge,{Step:()=>m,StepList:()=>S,Stepper:()=>y,StepperNormal:()=>Ke,StepperVertical:()=>_e});module.exports=xe(Ge);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((o,r)=>e[r]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var w=(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"}),$=(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 n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var s={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},f={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"};var Y=require("react/jsx-runtime"),Q="k-stepper",ge=[],ke={},ve={},y=t=>{let{style:e,...o}=t;return(0,Y.jsx)("nav",{...o,style:e,className:l(t.className,Q),children:t.children})};y.options=ke;y.states=ge;y.className=Q;y.defaultOptions=ve;var j=require("react/jsx-runtime"),F="k-step-list",ye=[],Se={},Z={orientation:"horizontal"},S=t=>{let{style:e,orientation:o=Z.orientation,...r}=t;return(0,j.jsx)("ol",{...r,style:e,className:l(t.className,F,{[`${F}-${o}`]:o}),children:t.children})};S.options=Se;S.states=ye;S.className=F;S.defaultOptions=Z;var L=require("react/jsx-runtime"),V="k-icon k-font-icon",be=[],Ne={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},Ce={},B=t=>{let{size:e,themeColor:o,icon:r,rotate:i,flip:c,...a}=t;return r?(0,L.jsx)("span",{...a,className:l(t.className,V,w(V,{size:e}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,L.jsx)(L.Fragment,{})};B.states=be;B.options=Ne;B.className=V;B.defaultOptions=Ce;var ee=B;var C=require("react/jsx-runtime"),W="k-icon k-svg-icon",Pe=[],$e={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},te={viewBox:"0 0 24 24"},M=t=>{let{size:e,themeColor:o,rotate:r,flip:i,viewBox:c=te.viewBox,icon:a,...d}=t;if(!a)return(0,C.jsx)(C.Fragment,{});a==="none"&&{...d,className:l(t.className,W,"k-none")};let u=typeof a=="object"&&a.name&&a.name;return(0,C.jsx)("span",{...d,className:l(t.className,W,w("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,C.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:c,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:t.children})})};M.states=Pe;M.options=$e;M.className=W;M.defaultOptions=te;var q=M;var oe=he(require("@progress/kendo-svg-icons")),b=require("react/jsx-runtime"),ze=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Le=[],Be={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},D={viewBox:"0 0 24 24",type:"svg"},z=t=>{let{size:e,themeColor:o,icon:r,type:i=D.type,rotate:c,flip:a,viewBox:d=D.viewBox,...u}=t;if(!r)return(0,b.jsx)(b.Fragment,{});if(i==="svg"){if(r==="none")return(0,b.jsx)(q,{...u,icon:r,size:e});let x=ze(`${r}-icon`);return oe[x]?(0,b.jsx)(q,{...u,icon:oe[x],size:e,themeColor:o,rotate:c,flip:a,viewBox:d}):(0,b.jsx)(b.Fragment,{})}return(0,b.jsx)(ee,{...u,icon:r,size:e,themeColor:o,rotate:c,flip:a})};z.states=Le;z.options=Be;z.defaultOptions=D;var p=require("react/jsx-runtime"),v="k-step",Me=[f.disabled,f.hover,f.focus,f.invalid,f.valid],Oe={},Ae={},m=t=>{let{style:e,disabled:o,hover:r,focus:i,invalid:c,valid:a,optional:d,first:u,done:x,current:H,last:K,label:_,text:U,icon:G,stepContent:J,...ne}=t,ie=c?"warning-circle":"check-circle",le=!!(a||c);return(0,p.jsxs)("li",{...ne,style:e,className:l(t.className,v,{[`${v}-done`]:x,[`${v}-first`]:u,[`${v}-current`]:H,[`${v}-last`]:K,[`${v}-optional`]:d,[`${v}-success`]:a,[`${v}-error`]:c},$(v,{hover:r,focus:i,disabled:o})),children:[(0,p.jsxs)("a",{href:"#",className:"k-step-link",children:[U&&!G&&(0,p.jsx)("span",{className:"k-step-indicator",children:(0,p.jsx)("span",{className:"k-step-indicator-text",children:U})}),G&&(0,p.jsx)("span",{className:"k-step-indicator",children:(0,p.jsx)(z,{className:"k-step-indicator-icon",icon:G})}),d&&!_&&(0,p.jsx)("span",{className:"k-step-label",children:(0,p.jsx)("span",{className:"k-step-label-optional",children:"(Optional)"})}),_&&(0,p.jsxs)("span",{className:"k-step-label",children:[(0,p.jsx)("span",{className:"k-step-text",children:_}),le&&(0,p.jsx)(z,{icon:ie}),d&&(0,p.jsx)("span",{className:"k-step-label-optional",children:"(Optional)"})]})]}),J&&(0,p.jsx)("div",{className:"k-step-content",style:{height:"140px"},children:J})]})};m.options=Oe;m.states=Me;m.className=v;m.defaultOptions=Ae;var N=require("react/jsx-runtime"),h="k-progressbar",we=[f.disabled,f.indeterminate],Ie={},P={indeterminate:!1,label:!0,labelPosition:"start",orientation:"horizontal",reverse:!1,value:"0"},O=t=>{let{disabled:e,height:o,indeterminate:r=P.indeterminate,label:i=P.label,labelPosition:c=P.labelPosition,orientation:a=P.orientation,reverse:d=P.reverse,value:u=P.value,width:x,style:H,...K}=t;return(0,N.jsxs)("div",{...K,className:l(t.className,h,$(h,{disabled:e}),{[`${h}-${a}`]:a,[`${h}-indeterminate`]:r,[`${h}-reverse`]:d}),style:{...H,"--kendo-progressbar-value":u,[a==="horizontal"?"height":"width"]:a==="horizontal"?o:x},children:[(0,N.jsx)("span",{className:l("k-progress-status-wrap",{[`k-progress-${c}`]:c&&!r}),children:i&&(0,N.jsxs)("span",{className:"k-progress-status",children:[u,"%"]})}),!r&&(0,N.jsx)("div",{className:"k-progressbar-value k-selected",children:(0,N.jsx)("span",{className:l("k-progress-status-wrap",{[`k-progress-${c}`]:c}),children:i&&(0,N.jsxs)("span",{className:"k-progress-status",children:[t.value,"%"]})})})]})};O.states=we;O.options=Ie;O.className=h;O.defaultOptions=P;var se=O;var T=require("react/jsx-runtime"),re="k-chunk-progressbar",Te=(t,e)=>e<=t-1,Ee=[f.disabled,f.indeterminate],Re={},I={chunkCount:5,orientation:"horizontal",progress:0},E=t=>{let{disabled:e,chunkCount:o=I.chunkCount,indeterminate:r,orientation:i=I.orientation,progress:c=I.progress,reverse:a,...d}=t;return(0,T.jsx)("div",{...d,className:l(t.className,h,re,$(h,{disabled:e}),{[`${h}-${i}`]:i,[`${h}-indeterminate`]:r,[`${h}-reverse`]:a}),children:(0,T.jsx)("ul",{className:"k-progressbar-chunks k-reset",children:[...Array(o)].map((u,x)=>(0,T.jsx)("li",{className:l("k-progressbar-chunk",{"k-first":x===0,"k-last":x===[...Array(o)].length-1,"k-selected":Te(c,x)})},x))})})};E.states=Ee;E.options=Re;E.className=re;E.defaultOptions=I;var ae=require("react/jsx-runtime"),R=t=>(0,ae.jsx)(se,{...t});var He=require("react/jsx-runtime");var g=require("react/jsx-runtime"),Ke=({gridTemplateColumns:t="repeat(6, 1fr)",...e})=>(0,g.jsx)(y,{style:{display:"grid",gridTemplateColumns:t},children:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(S,{style:{gridColumnStart:"1",gridColumnEnd:"-1"},children:[(0,g.jsx)(m,{first:!0,done:!0,icon:"check",style:{maxWidth:"33.333%"}}),(0,g.jsx)(m,{current:!0,focus:!0,text:"2",style:{maxWidth:"33.333%"}}),(0,g.jsx)(m,{last:!0,optional:!0,text:"3",style:{maxWidth:"33.333%"}})]}),(0,g.jsx)(R,{label:!1,value:"50"})]}),...e});var k=require("react/jsx-runtime"),_e=({gridTemplateRows:t="repeat(3, 1fr)",...e})=>(0,k.jsx)(y,{style:{display:"grid",gridTemplateRows:t},children:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(S,{orientation:"vertical",style:{gridRowStart:"1",gridRowEnd:"-1"},children:[(0,k.jsx)(m,{first:!0,done:!0,icon:"check",style:{maxHeight:"33.333%"}}),(0,k.jsx)(m,{current:!0,focus:!0,text:"2",style:{maxHeight:"33.333%"}}),(0,k.jsx)(m,{last:!0,optional:!0,text:"3",style:{maxHeight:"33.333%"}})]}),(0,k.jsx)(R,{orientation:"vertical",reverse:!0,label:!1,value:"50"})]}),...e});