UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.5 kB
var Ce=Object.create;var V=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Ee=(t,e)=>{for(var n in e)V(t,n,{get:e[n],enumerable:!0})},ae=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ae(e))!ze.call(t,a)&&a!==n&&V(t,a,{get:()=>e[a],enumerable:!(s=Te(e,a))||s.enumerable});return t};var _e=(t,e,n)=>(n=t!=null?Ce(Be(t)):{},ae(e||!t||!t.__esModule?V(n,"default",{value:t,enumerable:!0}):n,t)),we=t=>ae(V({},"__esModule",{value:!0}),t);var dt={};Ee(dt,{MapNormal:()=>re});module.exports=we(dt);var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((n,s)=>e[s]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var k=(t,e)=>i({[`${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"}),Z=(t,e)=>{let{valid:n,invalid:s,hover:a,focus:u,checked:m,active:l,selected:C,disabled:y,indeterminate:h,loading:T,empty:g,readonly:$,highlighted:W,..._}=e;return i({"k-valid":n,"k-invalid":s,"k-hover":a,"k-focus":u,"k-checked":m,"k-active":l,"k-selected":C,"k-disabled":y,"k-indeterminate":h&&!m,"k-loading":T,"k-empty":g,"k-readonly":$,"k-highlighted":W},Object.keys(_).reduce((b,A)=>(A.startsWith("k-")?b[A]=_[A]:b[`k-${A}`]=_[A],b),{}))};function se(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(s=>[`k-${s}`,!0]))}var r={undefined:void 0,xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},B={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"},v={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"},M={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 P=require("react/jsx-runtime"),X="k-font-icon",Le=[],Ie={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]},Re={},K=t=>{let{size:e,themeColor:n,icon:s,rotate:a,flip:u,...m}=t;return s?(0,P.jsx)("span",{...m,className:i(t.className,X,k(X,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${a}`]:a,"k-flip-h":u==="h"||u==="both","k-flip-v":u==="v"||u==="both"}),"aria-hidden":"true"}):(0,P.jsx)(P.Fragment,{})};K.states=Le;K.options=Ie;K.className=X;K.defaultOptions=Re;var ie=K;var z=require("react/jsx-runtime"),Q="k-svg-icon",Pe=[],Ke={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:[v.outline,v.solid,v.duotone]},Y={viewBox:"0 0 24 24",variant:v.outline},U=t=>{var T,g;let{size:e,themeColor:n,rotate:s,flip:a,viewBox:u=Y.viewBox,variant:m=Y.variant,icon:l,...C}=t;if(!l)return(0,z.jsx)(z.Fragment,{});if(l==="none")return(0,z.jsx)("span",{...C,className:i(t.className,Q,k("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let y=typeof l=="object"&&l.name&&l.name,h=typeof l=="object"?m&&((T=l.variants)==null?void 0:T[m])||((g=l.variants)==null?void 0:g.outline)||l.content:void 0;return(0,z.jsx)("span",{...C,className:i(t.className,Q,k("k-icon",{size:e}),{[`k-svg-i-${y}`]:y,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),"aria-hidden":"true",children:(0,z.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:u,dangerouslySetInnerHTML:h!==void 0?{__html:h}:void 0,children:l?void 0:t.children})})};U.states=Pe;U.options=Ke;U.className=Q;U.defaultOptions=Y;var j=U;var ee=_e(require("@progress/kendo-svg-icons"));var le="icon",ce="icons";var me=require("react");var de=require("react"),ue=(0,de.createContext)({iconsType:"svg"});var S=require("react/jsx-runtime"),q="k-icon",Ue=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),De=[],He={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:[v.outline,v.solid,v.duotone]},J={viewBox:"0 0 24 24",type:"svg",variant:v.outline},x=t=>{let{iconsType:e}=(0,me.useContext)(ue),{size:n,themeColor:s,icon:a,type:u=e||J.type,rotate:m,flip:l,viewBox:C=J.viewBox,variant:y=J.variant,...h}=t;if(!a)return(0,S.jsx)(S.Fragment,{});if((e||u)==="svg"){if(a==="none")return(0,S.jsx)(j,{...h,className:i(t.className,q),icon:a,size:n,variant:y});let g=ee[a]?a:Ue(`${a}-icon`);return ee[g]?(0,S.jsx)(j,{...h,className:i(t.className,q),icon:ee[g],size:n,themeColor:s,rotate:m,flip:l,viewBox:C,variant:y}):(0,S.jsx)(S.Fragment,{})}return(0,S.jsx)(ie,{...h,className:i(t.className,q),icon:a,size:n,themeColor:s,rotate:m,flip:l})};x.states=De;x.options=He;x.defaultOptions=J;x.className=q;x.moduleName=le;x.folderName=ce;x.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 te="button",pe=te;var f=require("react/jsx-runtime"),D="k-button",Ge=["icon-button"],$e=[M.hover,M.focus,M.active,M.selected,M.disabled,M.generating],Fe={size:[r.undefined,r.xsmall,r.small,r.medium,r.large],rounded:[B.undefined,B.none,B.small,B.medium,B.large,B.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]},oe={showArrow:!1,arrowIconName:"chevron-down"},d=t=>{let{as:e="button",size:n,rounded:s,fillMode:a,themeColor:u,showArrow:m=oe.showArrow,arrowIconName:l=oe.arrowIconName,variant:C,hover:y,focus:h,active:T,selected:g,disabled:$,togglable:W,ariaDisabled:_,icon:b,iconSize:A,text:F,iconClassName:ye,className:ke,...Me}=t,Se=b!=null,Oe=t.children!==void 0;return(0,f.jsxs)(e,{className:i(ke,D,se(D,C),k(D,{size:n,rounded:s,fillMode:a,themeColor:u}),Z(D,{hover:y,focus:h,active:T,disabled:$||_,selected:g}),{"k-icon-button":!F&&!Oe&&Se}),"aria-pressed":W?g?"true":"false":void 0,...Me,"aria-disabled":_?"true":void 0,disabled:$||void 0,children:[typeof b=="string"&&b&&(0,f.jsx)(x,{className:i(ye,"k-button-icon"),icon:b,size:A}),b&&typeof b!="string"&&(0,f.jsx)(f.Fragment,{children:b}),F?(0,f.jsxs)(f.Fragment,{children:[F&&(0,f.jsx)("span",{className:"k-button-text",children:F}),t.children]}):t.children&&(0,f.jsx)("span",{className:"k-button-text",children:t.children}),m&&(0,f.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,f.jsx)(x,{icon:l})})]})};d.states=$e;d.options=Fe;d.variants=Ge;d.className=D;d.defaultOptions=oe;d.moduleName=te;d.folderName=pe;d.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 E=require("react/jsx-runtime"),fe="k-navigator",Ve=[],Ze={},qe={},w=t=>{let{...e}=t;return(0,E.jsxs)("div",{...e,className:i(t.className,fe),children:[(0,E.jsx)(d,{className:"k-navigator-n",icon:"chevron-up",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan north"}),(0,E.jsx)(d,{className:"k-navigator-e",icon:"chevron-right",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan east"}),(0,E.jsx)(d,{className:"k-navigator-s",icon:"chevron-down",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan south"}),(0,E.jsx)(d,{className:"k-navigator-w",icon:"chevron-left",fillMode:"flat",rounded:"full",size:null,"aria-label":"Pan west"})]})};w.states=Ve;w.options=Ze;w.className=fe;w.defaultOptions=qe;var ne="button",be=ne;var xe=require("react/jsx-runtime"),H="k-button-group",Je=[M.disabled],We={fillMode:[p.undefined,p.solid,p.flat,p.outline,p.clear,p.link]},Xe={},O=t=>{let{fillMode:e,disabled:n,stretched:s,...a}=t;return(0,xe.jsx)("div",{role:"group",...a,className:i(t.className,H,k(H,{fillMode:e}),Z(H,{disabled:n}),{[`${H}-stretched`]:s}),...n&&{"aria-disabled":"true"},children:t.children})};O.states=Je;O.options=We;O.className=H;O.defaultOptions=Xe;O.moduleName=ne;O.folderName=be;O.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."}]};var G=require("react/jsx-runtime"),he="k-zoom-control",Qe=[],Ye={},je={},L=t=>{let{...e}=t;return(0,G.jsxs)(O,{...e,className:i(t.className,"k-group-horizontal",he),children:[(0,G.jsx)(d,{icon:"plus",className:"k-zoom-in","aria-label":"Zoom in"}),(0,G.jsx)(d,{icon:"minus",className:"k-zoom-out","aria-label":"Zoom out"})]})};L.states=Qe;L.options=Ye;L.className=he;L.defaultOptions=je;var c=require("react/jsx-runtime"),ge="k-map",ot=[],nt={},rt=(0,c.jsxs)(c.Fragment,{children:["\xA9 ",(0,c.jsx)("a",{href:"#",children:"Attribution"})]}),I={attribution:rt,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"}},N=t=>{let{attribution:e=I.attribution,markerStyle:n=I.markerStyle,scrollContainerStyle:s=I.scrollContainerStyle,horizontalScrollbarStyle:a=I.horizontalScrollbarStyle,verticalScrollbarStyle:u=I.verticalScrollbarStyle,children:m,...l}=t;return(0,c.jsxs)("div",{...l,className:i(t.className,ge),children:[(0,c.jsxs)("div",{className:"km-scroll-wrapper",style:{overflow:"hidden"},children:[(0,c.jsx)("div",{className:"km-scroll-header"}),(0,c.jsxs)("div",{className:"km-scroll-container",style:s,children:[(0,c.jsx)("div",{className:"k-layer",style:{zIndex:"1000"},children:(0,c.jsx)(x,{className:"k-marker",icon:"map-marker-target",size:"xxlarge",style:n})}),(0,c.jsx)("div",{className:"k-layer",children:m})]}),(0,c.jsx)("div",{className:"km-touch-scrollbar km-horizontal-scrollbar",style:a}),(0,c.jsx)("div",{className:"km-touch-scrollbar km-vertical-scrollbar",style:u})]}),(0,c.jsx)("div",{className:"k-map-controls k-bottom-end",children:(0,c.jsx)("div",{className:"k-attribution",children:e})}),(0,c.jsxs)("div",{className:"k-map-controls k-top-start",children:[(0,c.jsx)(w,{}),(0,c.jsx)(L,{})]})]})};N.states=ot;N.options=nt;N.className=ge;N.defaultOptions=I;N.moduleName="map";N.folderName="map";var ve=require("react/jsx-runtime"),at={},st=[],it=[],lt={},ct=[],R=t=>(0,ve.jsx)(re,{className:"k-bg-primary-subtle",markerStyle:{zIndex:"1000",left:"250px",top:"200px"},style:{position:"relative",width:"500px",height:"350px"},...t});R.options=at;R.states=st;R.variants=it;R.defaultOptions=lt;R.modifiers=ct;R.className=N.className;var Ne=require("react/jsx-runtime"),re=t=>(0,Ne.jsx)(N,{...t});