UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.64 kB
var ye=Object.create;var R=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var ge=(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 l of be(e))!ke.call(t,l)&&l!==r&&R(t,l,{get:()=>e[l],enumerable:!(a=Ne(e,l))||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)),Ae=t=>j(R({},"__esModule",{value:!0}),t);var et={};ge(et,{TILELAYOUTITEM_CLASSNAME:()=>V,TileLayoutItem:()=>z,default:()=>je});module.exports=Ae(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});var s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},M={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"},te={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var re=require("react/jsx-runtime"),Me="k-card-callout",oe=t=>{let{callout:e,...r}=t;return(0,re.jsx)("span",{...r,className:n(t.className,Me,{[`k-callout-${te.calloutMap[e]||e}`]:e})})};var k=require("react/jsx-runtime"),K="k-card",Se=[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:l,focus:d,selected:i,disabled:C,...p}=t;return(0,k.jsxs)("div",{...p,className:n(t.className,K,y(K,{themeColor:r}),N(K,{hover:l,focus:d,disabled:C,selected:i}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&(0,k.jsx)(oe,{callout:a}),(0,k.jsx)(k.Fragment,{children:t.children})]})};b.states=Se;b.options=Te;b.className=K;b.defaultOptions=Be;var ae=require("react/jsx-runtime"),U="k-card-title",Le=[c.hover,c.focus],S=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})};S.states=Le;S.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 H=require("react/jsx-runtime"),q="k-icon k-font-icon",He=[],Ie={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]},we={},I=t=>{let{size:e,themeColor:r,icon:a,rotate:l,flip:d,...i}=t;return a?(0,H.jsx)("span",{...i,className:n(t.className,q,y(q,{size:e}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):(0,H.jsx)(H.Fragment,{})};I.states=He;I.options=Ie;I.className=q;I.defaultOptions=we;var le=I;var g=require("react/jsx-runtime"),Y="k-icon k-svg-icon",Ee=[],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]},ie={viewBox:"0 0 24 24"},w=t=>{let{size:e,themeColor:r,rotate:a,flip:l,viewBox:d=ie.viewBox,icon:i,...C}=t;if(!i)return(0,g.jsx)(g.Fragment,{});i==="none"&&{...C,className:n(t.className,Y,"k-none")};let p=typeof i=="object"&&i.name&&i.name;return(0,g.jsx)("span",{...C,className:n(t.className,Y,y("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:(0,g.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:d,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};w.states=Ee;w.options=Oe;w.className=Y;w.defaultOptions=ie;var J=w;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]},Q={viewBox:"0 0 24 24",type:"svg"},T=t=>{let{size:e,themeColor:r,icon:a,type:l=Q.type,rotate:d,flip:i,viewBox:C=Q.viewBox,...p}=t;if(!a)return(0,x.jsx)(x.Fragment,{});if(l==="svg"){if(a==="none")return(0,x.jsx)(J,{...p,icon:a,size:e});let E=Re(`${a}-icon`);return ce[E]?(0,x.jsx)(J,{...p,icon:ce[E],size:e,themeColor:r,rotate:d,flip:i,viewBox:C}):(0,x.jsx)(x.Fragment,{})}return(0,x.jsx)(le,{...p,icon:a,size:e,themeColor:r,rotate:d,flip:i})};T.states=Ke;T.options=$e;T.defaultOptions=Q;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:[M.small,M.medium,M.large,M.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]},A={size:s.medium,rounded:M.medium,fillMode:v.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=t=>{let{size:e=A.size,rounded:r=A.rounded,fillMode:a=A.fillMode,themeColor:l=A.themeColor,showArrow:d=A.showArrow,arrowIconName:i=A.arrowIconName,hover:C,focus:p,active:E,selected:ue,disabled:pe,icon:G,text:O,iconClassName:fe,...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:l}),N(D,{hover:C,focus:p,active:E,disabled:pe,selected:ue}),{"k-icon-button":!O&&!Ce&&xe}),children:[G&&(0,u.jsx)(T,{className:n(fe,"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:i})})]})};m.states=De;m.options=Pe;m.className=D;m.defaultOptions=A;var _e=require("react/jsx-runtime");var Fe=require("react/jsx-runtime");var Ve=require("react/jsx-runtime");var f=require("react/jsx-runtime"),Ge="k-card-header",P=t=>{let{title:e,subtitle:r,details:a,...l}=t;return(0,f.jsxs)("div",{...l,className:n(t.className,Ge),children:[e&&(0,f.jsx)(S,{children:e}),r&&(0,f.jsx)($,{children:r}),(0,f.jsx)(f.Fragment,{children:t.children}),a&&(0,f.jsx)("span",{className:"k-card-header-actions",children:(0,f.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,...l}=t;return(0,h.jsxs)("div",{...l,className:n(t.className,qe),children:[e&&(0,h.jsx)(S,{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 Ye=require("react/jsx-runtime");var de=require("react/jsx-runtime"),F="k-actions",Je=[],Qe={},W={alignment:"start",orientation:"horizontal"},B=t=>{let{alignment:e=W.alignment,orientation:r=W.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=Je;B.options=Qe;B.className=F;B.defaultOptions=W;var X=require("react/jsx-runtime");var Z=require("react/jsx-runtime");var L=require("react/jsx-runtime"),V="k-tilelayout-item",We=[c.focus],Xe={},Ze={},z=t=>{let{header:e,body:r,focus:a,resize:l,style:d}=t;return(0,L.jsxs)(b,{className:n(t.className,V,N(V,{focus:a}),{"k-resize":l===!0,"k-resize-x":l==="horizontal","k-resize-y":l==="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=We;z.options=Xe;z.className=V;z.defaultOptions=Ze;var je=z;