@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 11.3 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,i)=>e[i]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var v=(t,e)=>a({[`${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"}),D=(t,e)=>{let{valid:r,invalid:i,hover:s,focus:d,checked:u,active:l,selected:k,disabled:g,indeterminate:h,loading:K,empty:S,readonly:U,highlighted:Z,...T}=e;return a({"k-valid":r,"k-invalid":i,"k-hover":s,"k-focus":d,"k-checked":u,"k-active":l,"k-selected":k,"k-disabled":g,"k-indeterminate":h&&!u,"k-loading":K,"k-empty":S,"k-readonly":U,"k-highlighted":Z},Object.keys(T).reduce((p,M)=>(M.startsWith("k-")?p[M]=T[M]:p[`k-${M}`]=T[M],p),{}))};function te(t,e){if(!e)return{};let r=Array.isArray(e)?e:[e];return Object.fromEntries(r.map(i=>[`k-${i}`,!0]))}var n={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},C={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},m={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},x={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"},N={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"};import{Fragment as Me,jsx as oe}from"react/jsx-runtime";var q="k-font-icon",ye=[],ke={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]},Se={},_=t=>{let{size:e,themeColor:r,icon:i,rotate:s,flip:d,...u}=t;return i?oe("span",{...u,className:a(t.className,q,v(q,{size:e}),{[`k-i-${i}`]:i,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"}),"aria-hidden":"true"}):oe(Me,{})};_.states=ye;_.options=ke;_.className=q;_.defaultOptions=Se;var ne=_;import{Fragment as Te,jsx as G}from"react/jsx-runtime";var j="k-svg-icon",Ce=[],Oe={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:[x.outline,x.solid,x.duotone]},J={viewBox:"0 0 24 24",variant:x.outline},w=t=>{let{size:e,themeColor:r,rotate:i,flip:s,viewBox:d=J.viewBox,variant:u=J.variant,icon:l,...k}=t;if(!l)return G(Te,{});if(l==="none")return G("span",{...k,className:a(t.className,j,v("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let g=typeof l=="object"&&l.name&&l.name,h=typeof l=="object"?u&&l.variants?.[u]||l.variants?.outline||l.content:void 0;return G("span",{...k,className:a(t.className,j,v("k-icon",{size:e}),{[`k-svg-i-${g}`]:g,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),"aria-hidden":"true",children:G("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:d,dangerouslySetInnerHTML:h!==void 0?{__html:h}:void 0,children:l?void 0:t.children})})};w.states=Ce;w.options=Oe;w.className=j;w.defaultOptions=J;var W=w;import*as X from"@progress/kendo-svg-icons";var re="icon",ae="icons";import{useContext as Be}from"react";import{createContext as Ae}from"react";var se=Ae({iconsType:"svg"});import{Fragment as ie,jsx as L}from"react/jsx-runtime";var $="k-icon",Ee=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),ze=[],_e={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:[x.outline,x.solid,x.duotone]},F={viewBox:"0 0 24 24",type:"svg",variant:x.outline},f=t=>{let{iconsType:e}=Be(se),{size:r,themeColor:i,icon:s,type:d=e||F.type,rotate:u,flip:l,viewBox:k=F.viewBox,variant:g=F.variant,...h}=t;if(!s)return L(ie,{});if((e||d)==="svg"){if(s==="none")return L(W,{...h,className:a(t.className,$),icon:s,size:r,variant:g});let S=X[s]?s:Ee(`${s}-icon`);return X[S]?L(W,{...h,className:a(t.className,$),icon:X[S],size:r,themeColor:i,rotate:u,flip:l,viewBox:k,variant:g}):L(ie,{})}return L(ne,{...h,className:a(t.className,$),icon:s,size:r,themeColor:i,rotate:u,flip:l})};f.states=ze;f.options=_e;f.defaultOptions=F;f.className=$;f.moduleName=re;f.folderName=ae;f.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 Q="button",le=Q;import{Fragment as ce,jsx as A,jsxs as de}from"react/jsx-runtime";var I="k-button",we=["icon-button"],Le=[N.hover,N.focus,N.active,N.selected,N.disabled,N.generating],Ie={size:[n.undefined,n.xsmall,n.small,n.medium,n.large],rounded:[C.undefined,C.none,C.small,C.medium,C.large,C.full],fillMode:[m.undefined,m.solid,m.flat,m.outline,m.clear,m.link],themeColor:[o.undefined,o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.inverse]},Y={showArrow:!1,arrowIconName:"chevron-down"},c=t=>{let{as:e="button",size:r,rounded:i,fillMode:s,themeColor:d,showArrow:u=Y.showArrow,arrowIconName:l=Y.arrowIconName,variant:k,hover:g,focus:h,active:K,selected:S,disabled:U,togglable:Z,ariaDisabled:T,icon:p,iconSize:M,text:H,iconClassName:he,className:xe,...ge}=t,ve=p!=null,Ne=t.children!==void 0;return de(e,{className:a(xe,I,te(I,k),v(I,{size:r,rounded:i,fillMode:s,themeColor:d}),D(I,{hover:g,focus:h,active:K,disabled:U||T,selected:S}),{"k-icon-button":!H&&!Ne&&ve}),"aria-pressed":Z?S?"true":"false":void 0,...ge,"aria-disabled":T?"true":void 0,disabled:U||void 0,children:[typeof p=="string"&&p&&A(f,{className:a(he,"k-button-icon"),icon:p,size:M}),p&&typeof p!="string"&&A(ce,{children:p}),H?de(ce,{children:[H&&A("span",{className:"k-button-text",children:H}),t.children]}):t.children&&A("span",{className:"k-button-text",children:t.children}),u&&A("span",{className:"k-menu-button-arrow k-button-arrow",children:A(f,{icon:l})})]})};c.states=Le;c.options=Ie;c.variants=we;c.className=I;c.defaultOptions=Y;c.moduleName=Q;c.folderName=le;c.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."}]};import{jsx as V,jsxs as Ue}from"react/jsx-runtime";var ue="k-navigator",Re=[],Pe={},Ke={},B=t=>{let{...e}=t;return Ue("div",{...e,className:a(t.className,ue),children:[V(c,{className:"k-navigator-n",icon:"chevron-up",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan north"}),V(c,{className:"k-navigator-e",icon:"chevron-right",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan east"}),V(c,{className:"k-navigator-s",icon:"chevron-down",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan south"}),V(c,{className:"k-navigator-w",icon:"chevron-left",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan west"})]})};B.states=Re;B.options=Pe;B.className=ue;B.defaultOptions=Ke;var ee="button",me=ee;import{jsx as $e}from"react/jsx-runtime";var R="k-button-group",He=[N.disabled],De={fillMode:[m.undefined,m.solid,m.flat,m.outline,m.clear,m.link]},Ge={},y=t=>{let{fillMode:e,disabled:r,stretched:i,...s}=t;return $e("div",{role:"group",...s,className:a(t.className,R,v(R,{fillMode:e}),D(R,{disabled:r}),{[`${R}-stretched`]:i}),...r&&{"aria-disabled":"true"},children:t.children})};y.states=He;y.options=De;y.className=R;y.defaultOptions=Ge;y.moduleName=ee;y.folderName=me;y.ariaSpec={selector:".k-button-group",rules:[{selector:".k-button-group:not(.k-split-button)",attribute:"role=group",usage:"Sets the proper role for the group of buttons."},{selector:".k-button-group.k-disabled",attribute:"aria-disabled=true",usage:"The attribute is rendered only when the entire button group is disabled."},{selector:".k-button-group:not(.k-split-button):not(.k-scheduler-navigation):not(.k-zoom-control) .k-button",attribute:"aria-pressed (when selected)",usage:"Specifies the current state of the ButtonGroup. Only the selected button within the group will have this attribute set to true."}]};import{jsx as pe,jsxs as qe}from"react/jsx-runtime";var fe="k-zoom-control",Fe=[],Ve={},Ze={},E=t=>{let{...e}=t;return qe(y,{...e,className:a(t.className,"k-group-horizontal",fe),children:[pe(c,{icon:"plus",className:"k-zoom-in","aria-label":"Zoom in"}),pe(c,{icon:"minus",className:"k-zoom-out","aria-label":"Zoom out"})]})};E.states=Fe;E.options=Ve;E.className=fe;E.defaultOptions=Ze;import{Fragment as Ye,jsx as b,jsxs as P}from"react/jsx-runtime";var be="k-map",We=[],Xe={},Qe=P(Ye,{children:["\xA9 ",b("a",{href:"#",children:"Attribution"})]}),z={attribution:Qe,markerStyle:{zIndex:"1000",left:"500px",top:"300px"},scrollContainerStyle:{transformOrigin:"left top 0px"},horizontalScrollbarStyle:{transformOrigin:"left top 0px",width:"24px"},verticalScrollbarStyle:{transformOrigin:"left top 0px",height:"239px"}},O=t=>{let{attribution:e=z.attribution,markerStyle:r=z.markerStyle,scrollContainerStyle:i=z.scrollContainerStyle,horizontalScrollbarStyle:s=z.horizontalScrollbarStyle,verticalScrollbarStyle:d=z.verticalScrollbarStyle,children:u,...l}=t;return P("div",{...l,className:a(t.className,be),children:[P("div",{className:"km-scroll-wrapper",style:{overflow:"hidden"},children:[b("div",{className:"km-scroll-header"}),P("div",{className:"km-scroll-container",style:i,children:[b("div",{className:"k-layer",style:{zIndex:"1000"},children:b(f,{className:"k-marker",icon:"map-marker-target",size:"xxlarge",style:r})}),b("div",{className:"k-layer",children:u})]}),b("div",{className:"km-touch-scrollbar km-horizontal-scrollbar",style:s}),b("div",{className:"km-touch-scrollbar km-vertical-scrollbar",style:d})]}),b("div",{className:"k-map-controls k-bottom-end",children:b("div",{className:"k-attribution",children:e})}),P("div",{className:"k-map-controls k-top-start",children:[b(B,{}),b(E,{})]})]})};O.states=We;O.options=Xe;O.className=be;O.defaultOptions=z;O.moduleName="map";O.folderName="map";var no=O;export{be as MAP_CLASSNAME,O as Map,no as default};