UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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