UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.94 kB
var ve=Object.create;var $=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Ce=Object.prototype.hasOwnProperty;var Se=(t,e)=>{for(var n in e)$(t,n,{get:e[n],enumerable:!0})},Q=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ne(e))!Ce.call(t,s)&&s!==n&&$(t,s,{get:()=>e[s],enumerable:!(a=ye(e,s))||a.enumerable});return t};var Be=(t,e,n)=>(n=t!=null?ve(ke(t)):{},Q(e||!t||!t.__esModule?$(n,"default",{value:t,enumerable:!0}):n,t)),Te=t=>Q($({},"__esModule",{value:!0}),t);var qe={};Se(qe,{WIZZARDSTEP_CLASSNAME:()=>U,WizardStep:()=>M,default:()=>Ge});module.exports=Te(qe);var d=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?d(...e):typeof e=="object"?Object.keys(e).map((n,a)=>e[a]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var B=(t,e)=>d({[`${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"}),P=(t,e)=>{let{valid:n,invalid:a,hover:s,focus:m,checked:p,active:l,selected:k,disabled:v,indeterminate:x,loading:C,empty:h,readonly:R,highlighted:V,...z}=e;return d({"k-valid":n,"k-invalid":a,"k-hover":s,"k-focus":m,"k-checked":p,"k-active":l,"k-selected":k,"k-disabled":v,"k-indeterminate":x&&!p,"k-loading":C,"k-empty":h,"k-readonly":R,"k-highlighted":V},Object.keys(z).reduce((f,S)=>(S.startsWith("k-")?f[S]=z[S]:f[`k-${S}`]=z[S],f),{}))};function Y(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(a=>[`k-${a}`,!0]))}var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},T={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},I={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},g={undefined:void 0,outline:"outline",solid:"solid",duotone:"duotone"},o={undefined:void 0,inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",inverse:"inverse"},y={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 A=require("react/jsx-runtime"),W="k-font-icon",Ie=[],we={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info]},ze={},E=t=>{let{size:e,themeColor:n,icon:a,rotate:s,flip:m,...p}=t;return a?(0,A.jsx)("span",{...p,className:d(t.className,W,B(W,{size:e}),{[`k-i-${a}`]:a,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),"aria-hidden":"true"}):(0,A.jsx)(A.Fragment,{})};E.states=Ie;E.options=we;E.className=W;E.defaultOptions=ze;var ee=E;var w=require("react/jsx-runtime"),G="k-svg-icon",Oe=[],Me={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[g.outline,g.solid,g.duotone]},q={viewBox:"0 0 24 24",variant:g.outline},L=t=>{var C,h;let{size:e,themeColor:n,rotate:a,flip:s,viewBox:m=q.viewBox,variant:p=q.variant,icon:l,...k}=t;if(!l)return(0,w.jsx)(w.Fragment,{});if(l==="none")return(0,w.jsx)("span",{...k,className:d(t.className,G,B("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let v=typeof l=="object"&&l.name&&l.name,x=typeof l=="object"?p&&((C=l.variants)==null?void 0:C[p])||((h=l.variants)==null?void 0:h.outline)||l.content:void 0;return(0,w.jsx)("span",{...k,className:d(t.className,G,B("k-icon",{size:e}),{[`k-svg-i-${v}`]:v,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),"aria-hidden":"true",children:(0,w.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:m,dangerouslySetInnerHTML:x!==void 0?{__html:x}:void 0,children:l?void 0:t.children})})};L.states=Oe;L.options=Me;L.className=G;L.defaultOptions=q;var Z=L;var J=Be(require("@progress/kendo-svg-icons"));var te="icon",oe="icons";var se=require("react");var ne=require("react"),re=(0,ne.createContext)({iconsType:"svg"});var N=require("react/jsx-runtime"),H="k-icon",Ae=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ee=[],Le={size:[r.undefined,r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info],variant:[g.outline,g.solid,g.duotone]},F={viewBox:"0 0 24 24",type:"svg",variant:g.outline},b=t=>{let{iconsType:e}=(0,se.useContext)(re),{size:n,themeColor:a,icon:s,type:m=e||F.type,rotate:p,flip:l,viewBox:k=F.viewBox,variant:v=F.variant,...x}=t;if(!s)return(0,N.jsx)(N.Fragment,{});if((e||m)==="svg"){if(s==="none")return(0,N.jsx)(Z,{...x,className:d(t.className,H),icon:s,size:n,variant:v});let h=J[s]?s:Ae(`${s}-icon`);return J[h]?(0,N.jsx)(Z,{...x,className:d(t.className,H),icon:J[h],size:n,themeColor:a,rotate:p,flip:l,viewBox:k,variant:v}):(0,N.jsx)(N.Fragment,{})}return(0,N.jsx)(ee,{...x,className:d(t.className,H),icon:s,size:n,themeColor:a,rotate:p,flip:l})};b.states=Ee;b.options=Le;b.defaultOptions=F;b.className=H;b.moduleName=te;b.folderName=oe;b.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 X="button",ae=X;var c=require("react/jsx-runtime"),_="k-button",_e=["icon-button"],Re=[y.hover,y.focus,y.active,y.selected,y.disabled,y.generating],Ke={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[T.undefined,T.none,T.small,T.medium,T.large,T.full],fillMode:[I.undefined,I.solid,I.flat,I.outline,I.clear,I.link],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.inverse]},j={showArrow:!1,arrowIconName:"chevron-down"},i=t=>{let{as:e="button",size:n,rounded:a,fillMode:s,themeColor:m,showArrow:p=j.showArrow,arrowIconName:l=j.arrowIconName,variant:k,hover:v,focus:x,active:C,selected:h,disabled:R,togglable:V,ariaDisabled:z,icon:f,iconSize:S,text:K,iconClassName:fe,className:xe,...he}=t,ge=f!=null,be=t.children!==void 0;return(0,c.jsxs)(e,{className:d(xe,_,Y(_,k),B(_,{size:n,rounded:a,fillMode:s,themeColor:m}),P(_,{hover:v,focus:x,active:C,disabled:R||z,selected:h}),{"k-icon-button":!K&&!be&&ge}),"aria-pressed":V?h?"true":"false":void 0,...he,"aria-disabled":z?"true":void 0,disabled:R||void 0,children:[typeof f=="string"&&f&&(0,c.jsx)(b,{className:d(fe,"k-button-icon"),icon:f,size:S}),f&&typeof f!="string"&&(0,c.jsx)(c.Fragment,{children:f}),K?(0,c.jsxs)(c.Fragment,{children:[K&&(0,c.jsx)("span",{className:"k-button-text",children:K}),t.children]}):t.children&&(0,c.jsx)("span",{className:"k-button-text",children:t.children}),p&&(0,c.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,c.jsx)(b,{icon:l})})]})};i.states=Re;i.options=Ke;i.variants=_e;i.className=_;i.defaultOptions=j;i.moduleName=X;i.folderName=ae;i.ariaSpec={selector:".k-button",rules:[{selector:".k-button",attribute:"role=button or nodeName=button",usage:"The button role is implicit from the native <button> element."},{selector:".k-button",attribute:"aria-label (when icon-only)",usage:"Required for icon-only buttons that have no visible text."},{selector:".k-button",attribute:"aria-pressed (when togglable)",usage:"Indicates the pressed state of a toggle button."},{selector:".k-button",attribute:"disabled (when disabled)",usage:"Rendered when the button is disabled."}]};var le=require("react/jsx-runtime"),ie=t=>(0,le.jsx)(i,{icon:"folder",...t,"aria-label":t["aria-label"]||"Folder",children:void 0});var ce=require("react/jsx-runtime"),de=t=>(0,ce.jsx)(i,{icon:"folder",children:"Button",...t});var me=require("react/jsx-runtime"),ue=t=>(0,me.jsx)(i,{children:"Button",...t});var D=require("react/jsx-runtime"),$e=i.options,Pe=i.states,He={...i.defaultOptions,variant:"text"},Fe=[{name:"icon-only",title:"Icon Only"},{name:"icon-and-text",title:"Icon & Text"},{name:"text",title:"Text"}],De=[],O=t=>{let{variant:e,...n}=t;switch(e){case"icon-only":return(0,D.jsx)(ie,{...n,icon:"star"});case"icon-and-text":return(0,D.jsx)(de,{...n,icon:"star",children:"Button"});default:return(0,D.jsx)(ue,{...n,children:"Button"})}};O.options=$e;O.states=Pe;O.variants=Fe;O.defaultOptions=He;O.modifiers=De;O.className=i.className;var u=require("react/jsx-runtime"),U="k-wizard-step",Ue=[y.focus],Ve={},We=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"k-wizard-buttons-left",children:(0,u.jsx)("span",{className:"k-wizard-pager",children:"Step 2 of 3"})}),(0,u.jsxs)("span",{className:"k-wizard-buttons-right",children:[(0,u.jsx)(i,{children:"Previous"}),(0,u.jsx)(i,{themeColor:"primary",children:"Next"})]})]}),pe={buttons:We},M=t=>{let{focus:e,buttons:n=pe.buttons,stepLabel:a,...s}=t;return(0,u.jsxs)("div",{...s,className:d(t.className,U,P(U,{focus:e})),role:"tabpanel","aria-label":a||"Step",tabIndex:0,children:[(0,u.jsx)("div",{className:"k-wizard-content",children:t.children}),n&&(0,u.jsx)("div",{className:"k-wizard-buttons",children:n})]})};M.states=Ue;M.options=Ve;M.className=U;M.defaultOptions=pe;var Ge=M;