UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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