@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.7 kB
JavaScript
var ye=Object.create;var R=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var ke=(t,e)=>{for(var r in e)R(t,r,{get:e[r],enumerable:!0})},j=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of be(e))!ge.call(t,i)&&i!==r&&R(t,i,{get:()=>e[i],enumerable:!(a=Ne(e,i))||a.enumerable});return t};var ee=(t,e,r)=>(r=t!=null?ye(ve(t)):{},j(e||!t||!t.__esModule?R(r,"default",{value:t,enumerable:!0}):r,t)),Se=t=>j(R({},"__esModule",{value:!0}),t);var et={};ke(et,{TILELAYOUTITEM_CLASSNAME:()=>V,TileLayoutItem:()=>z,default:()=>je});module.exports=Se(et);var me=ee(require("react"));var n=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((r,a)=>e[a]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var y=(t,e)=>n({[`${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.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${t}-${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"}),N=(t,e)=>n({"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,"k-highlighted":e.highlighted});var s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},A={small:"small",medium:"medium",large:"large",full:"full"},v={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},c={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"},te={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var re=require("react/jsx-runtime"),Ae="k-card-callout",oe=t=>{let{callout:e,...r}=t;return(0,re.jsx)("span",{...r,className:n(t.className,Ae,{[`k-callout-${te.calloutMap[e]||e}`]:e})})};var g=require("react/jsx-runtime"),K="k-card",Me=[c.hover,c.focus,c.selected,c.disabled],Te={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Be={},b=t=>{let{orientation:e,themeColor:r,callout:a,hover:i,focus:d,selected:l,disabled:C,...f}=t;return(0,g.jsxs)("div",{...f,className:n(t.className,K,y(K,{themeColor:r}),N(K,{hover:i,focus:d,disabled:C,selected:l}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&(0,g.jsx)(oe,{callout:a}),(0,g.jsx)(g.Fragment,{children:t.children})]})};b.states=Me;b.options=Te;b.className=K;b.defaultOptions=Be;var ae=require("react/jsx-runtime"),U="k-card-title",Le=[c.hover,c.focus],M=t=>{let{hover:e,focus:r,...a}=t;return(0,ae.jsx)("div",{...a,className:n(t.className,U,N(U,{hover:e,focus:r})),children:t.children})};M.states=Le;M.className=U;var ne=require("react/jsx-runtime"),ze="k-card-subtitle",$=t=>{let{...e}=t;return(0,ne.jsx)("div",{...e,className:n(t.className,ze),children:t.children})};var se=require("react/jsx-runtime");var E=require("react/jsx-runtime"),q="k-icon k-font-icon",Ee=[],He={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Ie={},H=t=>{let{size:e,themeColor:r,icon:a,rotate:i,flip:d,...l}=t;return a?(0,E.jsx)("span",{...l,className:n(t.className,q,y(q,{size:e}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):(0,E.jsx)(E.Fragment,{})};H.states=Ee;H.options=He;H.className=q;H.defaultOptions=Ie;var ie=H;var k=require("react/jsx-runtime"),J="k-icon k-svg-icon",we=[],Oe={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},le={viewBox:"0 0 24 24"},I=t=>{let{size:e,themeColor:r,rotate:a,flip:i,viewBox:d=le.viewBox,icon:l,...C}=t;if(!l)return(0,k.jsx)(k.Fragment,{});l==="none"&&{...C,className:n(t.className,J,"k-none")};let f=typeof l=="object"&&l.name&&l.name;return(0,k.jsx)("span",{...C,className:n(t.className,J,y("k-icon",{size:e}),{[`k-svg-i-${f}`]:f,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,k.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:d,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};I.states=we;I.options=Oe;I.className=J;I.defaultOptions=le;var X=I;var ce=ee(require("@progress/kendo-svg-icons")),x=require("react/jsx-runtime"),Re=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ke=[],$e={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Y={viewBox:"0 0 24 24",type:"svg"},T=t=>{let{size:e,themeColor:r,icon:a,type:i=Y.type,rotate:d,flip:l,viewBox:C=Y.viewBox,...f}=t;if(!a)return(0,x.jsx)(x.Fragment,{});if(i==="svg"){if(a==="none")return(0,x.jsx)(X,{...f,icon:a,size:e});let w=Re(`${a}-icon`);return ce[w]?(0,x.jsx)(X,{...f,icon:ce[w],size:e,themeColor:r,rotate:d,flip:l,viewBox:C}):(0,x.jsx)(x.Fragment,{})}return(0,x.jsx)(ie,{...f,icon:a,size:e,themeColor:r,rotate:d,flip:l})};T.states=Ke;T.options=$e;T.defaultOptions=Y;var u=require("react/jsx-runtime"),D="k-button",De=[c.hover,c.focus,c.active,c.selected,c.disabled],Pe={size:[s.small,s.medium,s.large],rounded:[A.small,A.medium,A.large,A.full],fillMode:[v.solid,v.flat,v.outline,v.clear,v.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},S={size:s.medium,rounded:A.medium,fillMode:v.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=t=>{let{size:e=S.size,rounded:r=S.rounded,fillMode:a=S.fillMode,themeColor:i=S.themeColor,showArrow:d=S.showArrow,arrowIconName:l=S.arrowIconName,hover:C,focus:f,active:w,selected:ue,disabled:fe,icon:G,text:O,iconClassName:pe,...he}=t,xe=G!==void 0,Ce=t.children!==void 0;return(0,u.jsxs)("button",{...he,className:n(t.className,D,y(D,{size:e,rounded:r,fillMode:a,themeColor:i}),N(D,{hover:C,focus:f,active:w,disabled:fe,selected:ue}),{"k-icon-button":!O&&!Ce&&xe}),children:[G&&(0,u.jsx)(T,{className:n(pe,"k-button-icon"),icon:G}),O?(0,u.jsxs)(u.Fragment,{children:[O&&(0,u.jsx)("span",{className:"k-button-text",children:O}),t.children]}):t.children&&(0,u.jsx)("span",{className:"k-button-text",children:t.children}),d&&(0,u.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,u.jsx)(T,{icon:l})})]})};m.states=De;m.options=Pe;m.className=D;m.defaultOptions=S;var _e=require("react/jsx-runtime");var Fe=require("react/jsx-runtime");var Ve=require("react/jsx-runtime");var p=require("react/jsx-runtime"),Ge="k-card-header",P=t=>{let{title:e,subtitle:r,details:a,...i}=t;return(0,p.jsxs)("div",{...i,className:n(t.className,Ge),children:[e&&(0,p.jsx)(M,{children:e}),r&&(0,p.jsx)($,{children:r}),(0,p.jsx)(p.Fragment,{children:t.children}),a&&(0,p.jsx)("span",{className:"k-card-header-actions",children:(0,p.jsx)(m,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var Ue=require("react/jsx-runtime");var h=require("react/jsx-runtime"),qe="k-card-body",_=t=>{let{title:e,subtitle:r,details:a,...i}=t;return(0,h.jsxs)("div",{...i,className:n(t.className,qe),children:[e&&(0,h.jsx)(M,{children:e}),r&&(0,h.jsx)($,{children:r}),(0,h.jsx)(h.Fragment,{children:t.children}),a&&(0,h.jsx)("span",{className:"k-card-header-actions",children:(0,h.jsx)(m,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var Je=require("react/jsx-runtime");var de=require("react/jsx-runtime"),F="k-actions",Xe=[],Ye={},Q={alignment:"start",orientation:"horizontal"},B=t=>{let{alignment:e=Q.alignment,orientation:r=Q.orientation,...a}=t;return(0,de.jsx)("div",{...a,className:n(F,{[`${F}-${e}`]:e,[`${F}-${r}`]:r},t.className),children:t.children})};B.states=Xe;B.options=Ye;B.className=F;B.defaultOptions=Q;var W=require("react/jsx-runtime");var Z=require("react/jsx-runtime");var L=require("react/jsx-runtime"),V="k-tilelayout-item",Qe=[c.focus],We={},Ze={},z=t=>{let{header:e,body:r,focus:a,resize:i,style:d}=t;return(0,L.jsxs)(b,{className:n(t.className,V,N(V,{focus:a}),{"k-resize":i===!0,"k-resize-x":i==="horizontal","k-resize-y":i==="vertical"}),style:d,children:[e&&me.default.isValidElement(e)?(0,L.jsx)(P,{className:"k-tilelayout-item-header k-cursor-move",children:e}):(0,L.jsx)(P,{className:"k-tilelayout-item-header k-cursor-move",title:e}),r&&(0,L.jsx)(_,{className:"k-tilelayout-item-body",children:r})]})};z.states=Qe;z.options=We;z.className=V;z.defaultOptions=Ze;var je=z;