UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.43 kB
var le=Object.create;var P=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var ue=(o,e)=>{for(var n in e)P(o,n,{get:e[n],enumerable:!0})},D=(o,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of me(e))!pe.call(o,r)&&r!==n&&P(o,r,{get:()=>e[r],enumerable:!(s=ce(e,r))||s.enumerable});return o};var fe=(o,e,n)=>(n=o!=null?le(de(o)):{},D(e||!o||!o.__esModule?P(n,"default",{value:o,enumerable:!0}):n,o)),xe=o=>D(P({},"__esModule",{value:!0}),o);var Re={};ue(Re,{PopoverNormal:()=>Ke});module.exports=xe(Re);var a=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...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 b=(o,e)=>a({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${o}-${e.themeColor}`]:e.themeColor&&e.fillMode===void 0},{"k-rounded-sm":e.rounded==="small","k-rounded-md":e.rounded==="medium","k-rounded-lg":e.rounded==="large","k-rounded-full":e.rounded==="full"}),U=(o,e)=>a({"k-valid":e.valid,"k-invalid":e.invalid,"k-hover":e.hover,"k-focus":e.focus,"k-checked":e.checked,"k-active":e.active,"k-selected":e.selected,"k-disabled":e.disabled,"k-indeterminate":e.indeterminate&&!e.checked,"k-loading":e.loading,"k-empty":e.empty,"k-readonly":e.readonly});var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},k={small:"small",medium:"medium",large:"large",full:"full"},h={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},t={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",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"},q={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var H=require("react/jsx-runtime"),J="k-animation-container",he=[],ve={},X={positionMode:"absolute"},M=o=>{let{positionMode:e=X.positionMode,animationStyle:n,offset:s,...r}=o;return(0,H.jsx)("div",{...r,style:{...s,...o.style},className:a(o.className,J,"k-animation-container-shown",{"k-animation-container-fixed":e==="fixed"}),children:(0,H.jsx)("div",{className:"k-child-animation-container",style:n,children:o.children})})};M.states=he;M.options=ve;M.className=J;M.defaultOptions=X;var K=require("react/jsx-runtime"),Q="k-popup",ge=[],ye={},W={positionMode:"absolute"},C=o=>{let{offset:e,positionMode:n=W.positionMode,animationStyle:s,...r}=o;return(0,K.jsx)(M,{positionMode:n,offset:e,animationStyle:s,children:(0,K.jsx)("div",{...r,className:a(o.className,Q),children:o.children})})};C.states=ge;C.options=ye;C.className=Q;C.defaultOptions=W;var d=require("react/jsx-runtime"),Y="k-popover",be=[],ke={},Ne={},S=o=>{let{callout:e,title:n,body:s,...r}=o;return(0,d.jsxs)(C,{...r,className:a(o.className,Y),children:[e&&(0,d.jsx)("div",{className:a("k-popover-callout",{[`k-callout-${q.calloutMap[e]||e}`]:e})}),(0,d.jsxs)("div",{className:"k-popover-inner",children:[n&&(0,d.jsx)("div",{className:"k-popover-header",children:n}),s&&(0,d.jsx)("div",{className:"k-popover-body",children:s}),(0,d.jsx)(d.Fragment,{children:o.children})]})]})};S.states=be;S.options=ke;S.className=Y;S.defaultOptions=Ne;var Z=require("react/jsx-runtime"),$="k-actions",Me=[],Ce={},R={alignment:"start",orientation:"horizontal"},A=o=>{let{alignment:e=R.alignment,orientation:n=R.orientation,...s}=o;return(0,Z.jsx)("div",{...s,className:a($,{[`${$}-${e}`]:e,[`${$}-${n}`]:n},o.className),children:o.children})};A.states=Me;A.options=Ce;A.className=$;A.defaultOptions=R;var w=require("react/jsx-runtime"),_="k-icon k-font-icon",Se=[],Ae={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},Be={},z=o=>{let{size:e,themeColor:n,icon:s,rotate:r,flip:c,...l}=o;return s?(0,w.jsx)("span",{...l,className:a(o.className,_,b(_,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,w.jsx)(w.Fragment,{})};z.states=Se;z.options=Ae;z.className=_;z.defaultOptions=Be;var j=z;var v=require("react/jsx-runtime"),F="k-icon k-svg-icon",we=[],ze={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},ee={viewBox:"0 0 24 24"},O=o=>{let{size:e,themeColor:n,rotate:s,flip:r,viewBox:c=ee.viewBox,icon:l,...y}=o;if(!l)return(0,v.jsx)(v.Fragment,{});l==="none"&&{...y,className:a(o.className,F,"k-none")};let x=typeof l=="object"&&l.name&&l.name;return(0,v.jsx)("span",{...y,className:a(o.className,F,b("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:(0,v.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:c,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:o.children})})};O.states=we;O.options=ze;O.className=F;O.defaultOptions=ee;var V=O;var oe=fe(require("@progress/kendo-svg-icons")),u=require("react/jsx-runtime"),Oe=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ie=[],Te={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},G={viewBox:"0 0 24 24",type:"svg"},B=o=>{let{size:e,themeColor:n,icon:s,type:r=G.type,rotate:c,flip:l,viewBox:y=G.viewBox,...x}=o;if(!s)return(0,u.jsx)(u.Fragment,{});if(r==="svg"){if(s==="none")return(0,u.jsx)(V,{...x,icon:s,size:e});let I=Oe(`${s}-icon`);return oe[I]?(0,u.jsx)(V,{...x,icon:oe[I],size:e,themeColor:n,rotate:c,flip:l,viewBox:y}):(0,u.jsx)(u.Fragment,{})}return(0,u.jsx)(j,{...x,icon:s,size:e,themeColor:n,rotate:c,flip:l})};B.states=Ie;B.options=Te;B.defaultOptions=G;var m=require("react/jsx-runtime"),L="k-button",Pe=[N.hover,N.focus,N.active,N.selected,N.disabled],$e={size:[i.small,i.medium,i.large],rounded:[k.small,k.medium,k.large,k.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},g={size:i.medium,rounded:k.medium,fillMode:h.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=o=>{let{size:e=g.size,rounded:n=g.rounded,fillMode:s=g.fillMode,themeColor:r=g.themeColor,showArrow:c=g.showArrow,arrowIconName:l=g.arrowIconName,hover:y,focus:x,active:I,selected:te,disabled:ne,icon:E,text:T,iconClassName:ie,...se}=o,re=E!==void 0,ae=o.children!==void 0;return(0,m.jsxs)("button",{...se,className:a(o.className,L,b(L,{size:e,rounded:n,fillMode:s,themeColor:r}),U(L,{hover:y,focus:x,active:I,disabled:ne,selected:te}),{"k-icon-button":!T&&!ae&&re}),children:[E&&(0,m.jsx)(B,{className:a(ie,"k-button-icon"),icon:E}),T?(0,m.jsxs)(m.Fragment,{children:[T&&(0,m.jsx)("span",{className:"k-button-text",children:T}),o.children]}):o.children&&(0,m.jsx)("span",{className:"k-button-text",children:o.children}),c&&(0,m.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,m.jsx)(B,{icon:l})})]})};p.states=Pe;p.options=$e;p.className=L;p.defaultOptions=g;var Le=require("react/jsx-runtime");var Ee=require("react/jsx-runtime");var He=require("react/jsx-runtime");var f=require("react/jsx-runtime"),Ke=o=>(0,f.jsx)(S,{title:"Title",body:(0,f.jsx)(f.Fragment,{children:"Body content"}),children:(0,f.jsxs)(A,{className:"k-popover-actions",alignment:"stretched",children:[(0,f.jsx)(p,{fillMode:"flat",children:"Action"}),(0,f.jsx)(p,{fillMode:"flat",themeColor:"primary",children:"Primary"})]}),...o});