UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 15.9 kB
var Me=Object.create;var J=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Te=Object.prototype.hasOwnProperty;var ze=(t,e)=>{for(var o in e)J(t,o,{get:e[o],enumerable:!0})},pe=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Be(e))!Te.call(t,r)&&r!==o&&J(t,r,{get:()=>e[r],enumerable:!(a=Ae(e,r))||a.enumerable});return t};var _e=(t,e,o)=>(o=t!=null?Me(we(t)):{},pe(e||!t||!t.__esModule?J(o,"default",{value:t,enumerable:!0}):o,t)),$e=t=>pe(J({},"__esModule",{value:!0}),t);var gt={};ze(gt,{StepperVertical:()=>ft});module.exports=$e(gt);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((o,a)=>e[a]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var G=(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.themeColor}`]:e.themeColor},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full","k-rounded-none":e.rounded==="none"}),H=(t,e)=>{let{valid:o,invalid:a,hover:r,focus:s,checked:p,active:c,selected:g,disabled:h,indeterminate:d,loading:R,empty:b,readonly:$,highlighted:I,...K}=e;return l({"k-valid":o,"k-invalid":a,"k-hover":r,"k-focus":s,"k-checked":p,"k-active":c,"k-selected":g,"k-disabled":h,"k-indeterminate":d&&!p,"k-loading":R,"k-empty":b,"k-readonly":$,"k-highlighted":I},Object.keys(K).reduce((A,B)=>(B.startsWith("k-")?A[B]=K[B]:A[`k-${B}`]=K[B],A),{}))};var i={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var P={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},n={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},k={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"};var ee="stepper",ce=ee;var me=require("react/jsx-runtime"),de="k-stepper",Ie=[],Ke={},He={},m=t=>{let{style:e,...o}=t;return(0,me.jsx)("nav",{...o,style:e,className:l(t.className,de),"aria-label":"Stepper",children:t.children})};m.options=Ke;m.states=Ie;m.className=de;m.defaultOptions=He;m.moduleName=ee;m.folderName=ce;m.ariaSpec={selector:".k-stepper",rules:[{selector:".k-stepper",attribute:"role=navigation or nodeName=nav",usage:"The landmark role navigation must be assigned to the component."},{selector:".k-step.k-disabled>.k-step-link",attribute:"aria-disabled=true",usage:"A disabled (inactive) link."},{selector:".k-step-current>.k-step-link",attribute:"aria-current=step",usage:"The currently selected link."},{selector:".k-step.k-focus .k-step-link",attribute:"tabindex=0",usage:"Focused step link is in the tab order."},{selector:".k-step:not(.k-focus) .k-step-link",attribute:"tabindex=-1",usage:"Non-focused step links are removed from tab order."}]};var fe=require("react/jsx-runtime"),te="k-step-list",De=[],Fe={},ue={orientation:"horizontal"},N=t=>{let{style:e,orientation:o=ue.orientation,wizardContext:a,...r}=t;return(0,fe.jsx)("ol",{...r,style:e,className:l(t.className,te,{[`${te}-${o}`]:o}),...a&&{role:"tablist"},children:t.children})};N.options=Fe;N.states=De;N.className=te;N.defaultOptions=ue;var V=require("react/jsx-runtime"),oe="k-font-icon",Ge=[],Ve={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info]},We={},W=t=>{let{size:e,themeColor:o,icon:a,rotate:r,flip:s,...p}=t;return a?(0,V.jsx)("span",{...p,className:l(t.className,oe,G(oe,{size:e}),{[`k-i-${a}`]:a,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),"aria-hidden":"true"}):(0,V.jsx)(V.Fragment,{})};W.states=Ge;W.options=Ve;W.className=oe;W.defaultOptions=We;var ge=W;var T=require("react/jsx-runtime"),re="k-svg-icon",Ue=[],qe={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[P.outline,P.solid,P.duotone]},ae={viewBox:"0 0 24 24",variant:P.outline},U=t=>{var R,b;let{size:e,themeColor:o,rotate:a,flip:r,viewBox:s=ae.viewBox,variant:p=ae.variant,icon:c,...g}=t;if(!c)return(0,T.jsx)(T.Fragment,{});if(c==="none")return(0,T.jsx)("span",{...g,className:l(t.className,re,G("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let h=typeof c=="object"&&c.name&&c.name,d=typeof c=="object"?p&&((R=c.variants)==null?void 0:R[p])||((b=c.variants)==null?void 0:b.outline)||c.content:void 0;return(0,T.jsx)("span",{...g,className:l(t.className,re,G("k-icon",{size:e}),{[`k-svg-i-${h}`]:h,[`k-color-${o}`]:o,[`k-rotate-${a}`]:a,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),"aria-hidden":"true",children:(0,T.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:s,dangerouslySetInnerHTML:d!==void 0?{__html:d}:void 0,children:c?void 0:t.children})})};U.states=Ue;U.options=qe;U.className=re;U.defaultOptions=ae;var se=U;var ne=_e(require("@progress/kendo-svg-icons"));var be="icon",xe="icons";var ke=require("react");var ve=require("react"),he=(0,ve.createContext)({iconsType:"svg"});var O=require("react/jsx-runtime"),X="k-icon",Je=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Xe=[],Qe={size:[i.undefined,i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[n.undefined,n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info],variant:[P.outline,P.solid,P.duotone]},Q={viewBox:"0 0 24 24",type:"svg",variant:P.outline},E=t=>{let{iconsType:e}=(0,ke.useContext)(he),{size:o,themeColor:a,icon:r,type:s=e||Q.type,rotate:p,flip:c,viewBox:g=Q.viewBox,variant:h=Q.variant,...d}=t;if(!r)return(0,O.jsx)(O.Fragment,{});if((e||s)==="svg"){if(r==="none")return(0,O.jsx)(se,{...d,className:l(t.className,X),icon:r,size:o,variant:h});let b=ne[r]?r:Je(`${r}-icon`);return ne[b]?(0,O.jsx)(se,{...d,className:l(t.className,X),icon:ne[b],size:o,themeColor:a,rotate:p,flip:c,viewBox:g,variant:h}):(0,O.jsx)(O.Fragment,{})}return(0,O.jsx)(ge,{...d,className:l(t.className,X),icon:r,size:o,themeColor:a,rotate:p,flip:c})};E.states=Xe;E.options=Qe;E.defaultOptions=Q;E.className=X;E.moduleName=be;E.folderName=xe;E.ariaSpec={selector:".k-icon, .k-svg-icon",rules:[{selector:".k-icon, .k-svg-icon",attribute:"aria-hidden=true",usage:"Hides the icon element and all its children from assistive technologies."}]};var f=require("react/jsx-runtime"),L="k-step",Ye=[k.disabled,k.hover,k.focus,k.invalid,k.valid],Ze={},je={},u=t=>{let{style:e,disabled:o,hover:a,focus:r,invalid:s,valid:p,optional:c,first:g,done:h,current:d,last:R,label:b,text:$,icon:I,stepContent:K,wizardContext:A,ariaControls:B,...Ee}=t,Le=s?"warning-circle":"check-circle",Re=!!(p||s),Oe=b||($?`Step ${$}`:I?"Step":void 0);return(0,f.jsxs)("li",{...Ee,style:e,className:l(t.className,L,{[`${L}-done`]:h,[`${L}-first`]:g,[`${L}-current`]:d,[`${L}-last`]:R,[`${L}-optional`]:c,[`${L}-success`]:p,[`${L}-error`]:s},H(L,{hover:a,focus:r,disabled:o})),...A&&{role:"none"},children:[(0,f.jsxs)("a",{href:"#",className:"k-step-link",...A&&{role:"tab"},...B&&{"aria-controls":B},...d&&{"aria-current":A?"true":"step"},...d&&A&&{"aria-selected":"true"},...o&&{"aria-disabled":"true"},tabIndex:r||d?0:-1,"aria-label":Oe,children:[$&&!I&&(0,f.jsx)("span",{className:"k-step-indicator",children:(0,f.jsx)("span",{className:"k-step-indicator-text",children:$})}),I&&(0,f.jsx)("span",{className:"k-step-indicator",children:(0,f.jsx)(E,{className:"k-step-indicator-icon",icon:I})}),c&&!b&&(0,f.jsx)("span",{className:"k-step-label",children:(0,f.jsx)("span",{className:"k-step-label-optional",children:"(Optional)"})}),b&&(0,f.jsxs)("span",{className:"k-step-label",children:[(0,f.jsx)("span",{className:"k-step-text",children:b}),Re&&(0,f.jsx)(E,{icon:Le}),c&&(0,f.jsx)("span",{className:"k-step-label-optional",children:"(Optional)"})]})]}),K&&(0,f.jsx)("div",{className:"k-step-content",style:{height:"140px"},children:K})]})};u.options=Ze;u.states=Ye;u.className=L;u.defaultOptions=je;var q="progressbar",Y=q;var w=require("react/jsx-runtime"),y="k-progressbar",et=[k.disabled,k.indeterminate],tt={orientation:["horizontal","vertical"]},z={indeterminate:!1,label:!0,labelPosition:"start",orientation:"horizontal",reverse:!1,value:"0"},v=t=>{let{disabled:e,height:o,indeterminate:a=z.indeterminate,label:r=z.label,labelPosition:s=z.labelPosition,orientation:p=z.orientation,reverse:c=z.reverse,value:g=z.value,width:h,style:d,ariaLabel:R,...b}=t;return(0,w.jsxs)("div",{...b,className:l(t.className,y,H(y,{disabled:e}),{[`${y}-${p}`]:p,[`${y}-indeterminate`]:a,[`${y}-reverse`]:c}),style:{...d,"--kendo-progressbar-value":g,[p==="horizontal"?"height":"width"]:p==="horizontal"?o:h},role:"progressbar","aria-label":R||"progress","aria-valuenow":a?void 0:Number(g),"aria-valuemin":0,"aria-valuemax":100,children:[(0,w.jsx)("span",{className:l("k-progress-status-wrap",{[`k-progress-${s}`]:s&&!a}),children:r&&(0,w.jsxs)("span",{className:"k-progress-status",children:[g,"%"]})}),!a&&(0,w.jsx)("div",{className:"k-progressbar-value k-selected",children:(0,w.jsx)("span",{className:l("k-progress-status-wrap",{[`k-progress-${s}`]:s}),children:r&&(0,w.jsxs)("span",{className:"k-progress-status",children:[t.value,"%"]})})})]})};v.states=et;v.options=tt;v.className=y;v.defaultOptions=z;v.moduleName=q;v.folderName=Y;v.ariaSpec={selector:".k-progressbar",implicitRole:"progressbar",rules:[{selector:".k-progressbar",attribute:"role=progressbar",usage:"Sets the proper role for ProgressBar."},{selector:".k-progressbar",attribute:"aria-label or aria-labelledby",usage:"The ProgressBar needs an accessible name to be assigned to it."},{selector:".k-progressbar:not(.k-progressbar-indeterminate)",attribute:"aria-valuenow",usage:"Required if the value is not indeterminate. Decimal value between aria-valuemin and aria-valuemax."},{selector:".k-progressbar",attribute:"aria-valuemin",usage:"Minimum value. Defaults to 0."},{selector:".k-progressbar",attribute:"aria-valuemax",usage:"Maximum value. Defaults to 100."}]};var ye=v;var j=require("react/jsx-runtime"),Se="k-chunk-progressbar",ot=(t,e)=>e<=t-1,rt=[k.disabled,k.indeterminate],at={},Z={chunkCount:5,orientation:"horizontal",progress:0},_=t=>{let{disabled:e,chunkCount:o=Z.chunkCount,indeterminate:a,orientation:r=Z.orientation,progress:s=Z.progress,reverse:p,ariaLabel:c,...g}=t;return(0,j.jsx)("div",{...g,className:l(t.className,y,Se,H(y,{disabled:e}),{[`${y}-${r}`]:r,[`${y}-indeterminate`]:a,[`${y}-reverse`]:p}),role:"progressbar","aria-label":c||"progress","aria-valuenow":a?void 0:s,"aria-valuemin":0,"aria-valuemax":o,children:(0,j.jsx)("ul",{className:"k-progressbar-chunks k-reset",children:[...Array(o)].map((h,d)=>(0,j.jsx)("li",{className:l("k-progressbar-chunk",{"k-first":d===0,"k-last":d===[...Array(o)].length-1,"k-selected":ot(s,d)})},d))})})};_.states=rt;_.options=at;_.className=Se;_.defaultOptions=Z;_.moduleName=q;_.folderName=Y;_.ariaSpec={selector:".k-chunk-progressbar",implicitRole:"progressbar",rules:[{selector:".k-chunk-progressbar",attribute:"role=progressbar",usage:"Sets the proper role for ChunkProgressBar."},{selector:".k-chunk-progressbar",attribute:"aria-label or aria-labelledby",usage:"The ChunkProgressBar needs an accessible name to be assigned to it."},{selector:".k-chunk-progressbar:not(.k-progressbar-indeterminate)",attribute:"aria-valuenow",usage:"Required if the value is not indeterminate. Value between aria-valuemin and aria-valuemax."},{selector:".k-chunk-progressbar",attribute:"aria-valuemin",usage:"Minimum value. Defaults to 0."},{selector:".k-chunk-progressbar",attribute:"aria-valuemax",usage:"Maximum value. Defaults to chunk count."}]};var Ne=require("react/jsx-runtime"),S=t=>(0,Ne.jsx)(ye,{...t});var st=require("react/jsx-runtime");var M=require("react/jsx-runtime"),nt=v.options,it=v.states,Ce={...v.defaultOptions,variant:"start"},lt=[{name:"start",title:"Label start"},{name:"center",title:"Label center"},{name:"end",title:"Label end"},{name:"empty",title:"No label"}],pt=[],D=t=>{let{variant:e,modifiers:o,...a}={...Ce,...t},r={},s={style:{width:"324px"}};switch(Object.keys(o||{}).forEach(p=>{switch(p){case"reverse":r.reverse=!!(o!=null&&o[p]);break;case"vertical":r.orientation=o!=null&&o[p]?"vertical":void 0,s.style=o!=null&&o[p]?void 0:{width:"324px"};break}}),e){case"end":return(0,M.jsx)("div",{...s,children:(0,M.jsx)(S,{...a,...r,labelPosition:"end",value:"50"})});case"center":return(0,M.jsx)("div",{...s,children:(0,M.jsx)(S,{...a,...r,labelPosition:"center",value:"50"})});case"empty":return(0,M.jsx)("div",{...s,children:(0,M.jsx)(S,{...a,...r,label:!1,value:"50"})});default:return(0,M.jsx)("div",{...s,children:(0,M.jsx)(S,{...a,...r,labelPosition:"start",value:"50"})})}};D.options=nt;D.states=it;D.variants=lt;D.defaultOptions=Ce;D.modifiers=pt;D.className=v.className;var ie=require("react/jsx-runtime");var le=require("react/jsx-runtime");var x=require("react/jsx-runtime"),ct=m.options,dt=m.states,Pe={...m.defaultOptions,variant:"horizontal"},mt=[{name:"horizontal",title:"Horizontal"},{name:"vertical",title:"Vertical"}],ut=[{name:"label",title:"Label"},{name:"optional",title:"Optional"}],F=t=>{let{variant:e,modifiers:o,...a}={...Pe,...t},r={};return Object.keys(o||{}).forEach(s=>{switch(s){case"label":{r.label=o!=null&&o[s]?"Label":void 0;break}case"optional":{r.optional=!!(o!=null&&o[s]);break}}}),e==="vertical"?(0,x.jsxs)(m,{style:{display:"grid",gridTemplateRows:"repeat(3, 1fr)"},...a,children:[(0,x.jsxs)(N,{orientation:"vertical",style:{gridRowStart:"1",gridRowEnd:"-1"},children:[(0,x.jsx)(u,{first:!0,done:!0,icon:"check",label:r.label,style:{maxHeight:"33.333%"}}),(0,x.jsx)(u,{current:!0,focus:!0,text:"2",label:r.label,style:{maxHeight:"33.333%"}}),(0,x.jsx)(u,{last:!0,optional:r.optional,text:"3",label:r.label,style:{maxHeight:"33.333%"}})]}),(0,x.jsx)(S,{className:"k-top-5 k-row-start-1 k-row-end-3",orientation:"vertical",reverse:!0,label:!1,value:"50"})]}):(0,x.jsxs)(m,{style:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)"},...a,children:[(0,x.jsxs)(N,{style:{gridColumnStart:"1",gridColumnEnd:"-1"},children:[(0,x.jsx)(u,{first:!0,done:!0,icon:"check",label:r.label,style:{maxWidth:"33.333%"}}),(0,x.jsx)(u,{current:!0,focus:!0,text:"2",label:r.label,style:{maxWidth:"33.333%"}}),(0,x.jsx)(u,{last:!0,optional:r.optional,text:"3",label:r.label,style:{maxWidth:"33.333%"}})]}),(0,x.jsx)(S,{className:"k-col-start-2 k-col-end-6",style:{width:"400px"},label:!1,value:"50"})]})};F.options=ct;F.states=dt;F.variants=mt;F.defaultOptions=Pe;F.modifiers=ut;F.className=m.className;var C=require("react/jsx-runtime"),ft=({gridTemplateRows:t="repeat(3, 1fr)",...e})=>(0,C.jsx)(m,{style:{display:"grid",gridTemplateRows:t},children:(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(N,{orientation:"vertical",style:{gridRowStart:"1",gridRowEnd:"-1"},children:[(0,C.jsx)(u,{first:!0,done:!0,icon:"check",style:{maxHeight:"33.333%"}}),(0,C.jsx)(u,{current:!0,focus:!0,text:"2",style:{maxHeight:"33.333%"}}),(0,C.jsx)(u,{last:!0,optional:!0,text:"3",style:{maxHeight:"33.333%"}})]}),(0,C.jsx)(S,{orientation:"vertical",reverse:!0,label:!1,value:"50"})]}),...e});