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