UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.78 kB
var be=Object.create;var G=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var xe=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var r in e)G(t,r,{get:e[r],enumerable:!0})},Y=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of he(e))!Ne.call(t,s)&&s!==r&&G(t,s,{get:()=>e[s],enumerable:!(i=ge(e,s))||i.enumerable});return t};var ye=(t,e,r)=>(r=t!=null?be(xe(t)):{},Y(e||!t||!t.__esModule?G(r,"default",{value:t,enumerable:!0}):r,t)),ke=t=>Y(G({},"__esModule",{value:!0}),t);var He={};ve(He,{ZOOMCONTROL_CLASSNAME:()=>X,ZoomControl:()=>A,default:()=>$e});module.exports=ke(He);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"}),$=(t,e)=>{let{valid:r,invalid:i,hover:s,focus:c,checked:m,active:l,selected:O,disabled:N,indeterminate:b,loading:T,empty:g,readonly:K,highlighted:D,...w}=e;return a({"k-valid":r,"k-invalid":i,"k-hover":s,"k-focus":c,"k-checked":m,"k-active":l,"k-selected":O,"k-disabled":N,"k-indeterminate":b&&!m,"k-loading":T,"k-empty":g,"k-readonly":K,"k-highlighted":D},Object.keys(w).reduce((p,M)=>(M.startsWith("k-")?p[M]=w[M]:p[`k-${M}`]=w[M],p),{}))};function ee(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"},B={undefined:void 0,none:"none",small:"small",medium:"medium",large:"large",full:"full"},d={undefined:void 0,solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},h={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 z=require("react/jsx-runtime"),F="k-font-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]},Te={},I=t=>{let{size:e,themeColor:r,icon:i,rotate:s,flip:c,...m}=t;return i?(0,z.jsx)("span",{...m,className:a(t.className,F,v(F,{size:e}),{[`k-i-${i}`]:i,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"}),"aria-hidden":"true"}):(0,z.jsx)(z.Fragment,{})};I.states=Ce;I.options=Oe;I.className=F;I.defaultOptions=Te;var te=I;var S=require("react/jsx-runtime"),V="k-svg-icon",Me=[],Be={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:[h.outline,h.solid,h.duotone]},Z={viewBox:"0 0 24 24",variant:h.outline},_=t=>{var T,g;let{size:e,themeColor:r,rotate:i,flip:s,viewBox:c=Z.viewBox,variant:m=Z.variant,icon:l,...O}=t;if(!l)return(0,S.jsx)(S.Fragment,{});if(l==="none")return(0,S.jsx)("span",{...O,className:a(t.className,V,v("k-icon",{size:e}),"k-none"),"aria-hidden":"true"});let N=typeof l=="object"&&l.name&&l.name,b=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,S.jsx)("span",{...O,className:a(t.className,V,v("k-icon",{size:e}),{[`k-svg-i-${N}`]:N,[`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:(0,S.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:c,dangerouslySetInnerHTML:b!==void 0?{__html:b}:void 0,children:l?void 0:t.children})})};_.states=Me;_.options=Be;_.className=V;_.defaultOptions=Z;var j=_;var q=ye(require("@progress/kendo-svg-icons"));var oe="icon",ne="icons";var ie=require("react");var re=require("react"),se=(0,re.createContext)({iconsType:"svg"});var k=require("react/jsx-runtime"),H="k-icon",Se=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),we=[],Ae={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:[h.outline,h.solid,h.duotone]},P={viewBox:"0 0 24 24",type:"svg",variant:h.outline},x=t=>{let{iconsType:e}=(0,ie.useContext)(se),{size:r,themeColor:i,icon:s,type:c=e||P.type,rotate:m,flip:l,viewBox:O=P.viewBox,variant:N=P.variant,...b}=t;if(!s)return(0,k.jsx)(k.Fragment,{});if((e||c)==="svg"){if(s==="none")return(0,k.jsx)(j,{...b,className:a(t.className,H),icon:s,size:r,variant:N});let g=q[s]?s:Se(`${s}-icon`);return q[g]?(0,k.jsx)(j,{...b,className:a(t.className,H),icon:q[g],size:r,themeColor:i,rotate:m,flip:l,viewBox:O,variant:N}):(0,k.jsx)(k.Fragment,{})}return(0,k.jsx)(te,{...b,className:a(t.className,H),icon:s,size:r,themeColor:i,rotate:m,flip:l})};x.states=we;x.options=Ae;x.defaultOptions=P;x.className=H;x.moduleName=oe;x.folderName=ne;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 W="button",ae=W;var u=require("react/jsx-runtime"),E="k-button",ze=["icon-button"],Ie=[y.hover,y.focus,y.active,y.selected,y.disabled,y.generating],_e={size:[n.undefined,n.xsmall,n.small,n.medium,n.large],rounded:[B.undefined,B.none,B.small,B.medium,B.large,B.full],fillMode:[d.undefined,d.solid,d.flat,d.outline,d.clear,d.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"},f=t=>{let{as:e="button",size:r,rounded:i,fillMode:s,themeColor:c,showArrow:m=J.showArrow,arrowIconName:l=J.arrowIconName,variant:O,hover:N,focus:b,active:T,selected:g,disabled:K,togglable:D,ariaDisabled:w,icon:p,iconSize:M,text:U,iconClassName:ue,className:ce,...me}=t,pe=p!=null,fe=t.children!==void 0;return(0,u.jsxs)(e,{className:a(ce,E,ee(E,O),v(E,{size:r,rounded:i,fillMode:s,themeColor:c}),$(E,{hover:N,focus:b,active:T,disabled:K||w,selected:g}),{"k-icon-button":!U&&!fe&&pe}),"aria-pressed":D?g?"true":"false":void 0,...me,"aria-disabled":w?"true":void 0,disabled:K||void 0,children:[typeof p=="string"&&p&&(0,u.jsx)(x,{className:a(ue,"k-button-icon"),icon:p,size:M}),p&&typeof p!="string"&&(0,u.jsx)(u.Fragment,{children:p}),U?(0,u.jsxs)(u.Fragment,{children:[U&&(0,u.jsx)("span",{className:"k-button-text",children:U}),t.children]}):t.children&&(0,u.jsx)("span",{className:"k-button-text",children:t.children}),m&&(0,u.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,u.jsx)(x,{icon:l})})]})};f.states=Ie;f.options=_e;f.variants=ze;f.className=E;f.defaultOptions=J;f.moduleName=W;f.folderName=ae;f.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 Q="button",le=Q;var de=require("react/jsx-runtime"),L="k-button-group",Ee=[y.disabled],Le={fillMode:[d.undefined,d.solid,d.flat,d.outline,d.clear,d.link]},Re={},C=t=>{let{fillMode:e,disabled:r,stretched:i,...s}=t;return(0,de.jsx)("div",{role:"group",...s,className:a(t.className,L,v(L,{fillMode:e}),$(L,{disabled:r}),{[`${L}-stretched`]:i}),...r&&{"aria-disabled":"true"},children:t.children})};C.states=Ee;C.options=Le;C.className=L;C.defaultOptions=Re;C.moduleName=Q;C.folderName=le;C.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 R=require("react/jsx-runtime"),X="k-zoom-control",Ke=[],Ue={},Ge={},A=t=>{let{...e}=t;return(0,R.jsxs)(C,{...e,className:a(t.className,"k-group-horizontal",X),children:[(0,R.jsx)(f,{icon:"plus",className:"k-zoom-in","aria-label":"Zoom in"}),(0,R.jsx)(f,{icon:"minus",className:"k-zoom-out","aria-label":"Zoom out"})]})};A.states=Ke;A.options=Ue;A.className=X;A.defaultOptions=Ge;var $e=A;