UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.97 kB
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 h=(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"}),x=(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"},N={small:"small",medium:"medium",large:"large",full:"full"},y={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"},d={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"},Q={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as Ce}from"react/jsx-runtime";var Z="k-tilelayout",fe=[],he={},xe={},b=t=>{let{gap:e,columns:r,columnWidth:a,rowHeight:i,style:c,children:l}=t,u={gridTemplateColumns:`repeat(${r}, minmax(0px, ${a}))`,gridAutoRows:`minmax(0px, ${i})`,gap:e,...c};return Ce("div",{className:n(t.className,Z),style:u,children:l})};b.states=fe;b.options=he;b.className=Z;b.defaultOptions=xe;import Qe from"react";import{jsx as ge}from"react/jsx-runtime";var ye="k-card-callout",j=t=>{let{callout:e,...r}=t;return ge("span",{...r,className:n(t.className,ye,{[`k-callout-${Q.calloutMap[e]||e}`]:e})})};import{Fragment as ke,jsx as ee,jsxs as Te}from"react/jsx-runtime";var O="k-card",Ne=[d.hover,d.focus,d.selected,d.disabled],be={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},ve={},C=t=>{let{orientation:e,themeColor:r,callout:a,hover:i,focus:c,selected:l,disabled:u,...p}=t;return Te("div",{...p,className:n(t.className,O,h(O,{themeColor:r}),x(O,{hover:i,focus:c,disabled:u,selected:l}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&ee(j,{callout:a}),ee(ke,{children:t.children})]})};C.states=Ne;C.options=be;C.className=O;C.defaultOptions=ve;import{jsx as Ae}from"react/jsx-runtime";var U="k-card-title",Se=[d.hover,d.focus],v=t=>{let{hover:e,focus:r,...a}=t;return Ae("div",{...a,className:n(t.className,U,x(U,{hover:e,focus:r})),children:t.children})};v.states=Se;v.className=U;import{jsx as Le}from"react/jsx-runtime";var Me="k-card-subtitle",R=t=>{let{...e}=t;return Le("div",{...e,className:n(t.className,Me),children:t.children})};import{Fragment as Rt,jsx as Ot}from"react/jsx-runtime";import{Fragment as Ie,jsx as te}from"react/jsx-runtime";var V="k-icon k-font-icon",Be=[],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]},ze={},S=t=>{let{size:e,themeColor:r,icon:a,rotate:i,flip:c,...l}=t;return a?te("span",{...l,className:n(t.className,V,h(V,{size:e}),{[`k-i-${a}`]:a,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):te(Ie,{})};S.states=Be;S.options=He;S.className=V;S.defaultOptions=ze;var oe=S;import{Fragment as Re,jsx as w}from"react/jsx-runtime";var G="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]},re={viewBox:"0 0 24 24"},A=t=>{let{size:e,themeColor:r,rotate:a,flip:i,viewBox:c=re.viewBox,icon:l,...u}=t;if(!l)return w(Re,{});l==="none"&&{...u,className:n(t.className,G,"k-none")};let p=typeof l=="object"&&l.name&&l.name;return w("span",{...u,className:n(t.className,G,h("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:w("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:t.children})})};A.states=Ee;A.options=Oe;A.className=G;A.defaultOptions=re;var q=A;import*as ae from"@progress/kendo-svg-icons";import{Fragment as ne,jsx as M}from"react/jsx-runtime";var we=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"},k=t=>{let{size:e,themeColor:r,icon:a,type:i=Y.type,rotate:c,flip:l,viewBox:u=Y.viewBox,...p}=t;if(!a)return M(ne,{});if(i==="svg"){if(a==="none")return M(q,{...p,icon:a,size:e});let I=we(`${a}-icon`);return ae[I]?M(q,{...p,icon:ae[I],size:e,themeColor:r,rotate:c,flip:l,viewBox:u}):M(ne,{})}return M(oe,{...p,icon:a,size:e,themeColor:r,rotate:c,flip:l})};k.states=Ke;k.options=$e;k.defaultOptions=Y;import{Fragment as _e,jsx as L,jsxs as se}from"react/jsx-runtime";var K="k-button",Pe=[d.hover,d.focus,d.active,d.selected,d.disabled],De={size:[s.small,s.medium,s.large],rounded:[N.small,N.medium,N.large,N.full],fillMode:[y.solid,y.flat,y.outline,y.clear,y.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},g={size:s.medium,rounded:N.medium,fillMode:y.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=t=>{let{size:e=g.size,rounded:r=g.rounded,fillMode:a=g.fillMode,themeColor:i=g.themeColor,showArrow:c=g.showArrow,arrowIconName:l=g.arrowIconName,hover:u,focus:p,active:I,selected:le,disabled:ce,icon:F,text:E,iconClassName:de,...me}=t,ue=F!==void 0,pe=t.children!==void 0;return se("button",{...me,className:n(t.className,K,h(K,{size:e,rounded:r,fillMode:a,themeColor:i}),x(K,{hover:u,focus:p,active:I,disabled:ce,selected:le}),{"k-icon-button":!E&&!pe&&ue}),children:[F&&L(k,{className:n(de,"k-button-icon"),icon:F}),E?se(_e,{children:[E&&L("span",{className:"k-button-text",children:E}),t.children]}):t.children&&L("span",{className:"k-button-text",children:t.children}),c&&L("span",{className:"k-menu-button-arrow k-button-arrow",children:L(k,{icon:l})})]})};m.states=Pe;m.options=De;m.className=K;m.defaultOptions=g;import{jsx as ao}from"react/jsx-runtime";import{jsx as lo}from"react/jsx-runtime";import{jsx as po}from"react/jsx-runtime";import{Fragment as Ue,jsx as B,jsxs as Ve}from"react/jsx-runtime";var Fe="k-card-header",$=t=>{let{title:e,subtitle:r,details:a,...i}=t;return Ve("div",{...i,className:n(t.className,Fe),children:[e&&B(v,{children:e}),r&&B(R,{children:r}),B(Ue,{children:t.children}),a&&B("span",{className:"k-card-header-actions",children:B(m,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as Lo}from"react/jsx-runtime";import{Fragment as qe,jsx as H,jsxs as Ye}from"react/jsx-runtime";var Ge="k-card-body",P=t=>{let{title:e,subtitle:r,details:a,...i}=t;return Ye("div",{...i,className:n(t.className,Ge),children:[e&&H(v,{children:e}),r&&H(R,{children:r}),H(qe,{children:t.children}),a&&H("span",{className:"k-card-header-actions",children:H(m,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as $o}from"react/jsx-runtime";import{jsx as Xe}from"react/jsx-runtime";var D="k-actions",Je=[],We={},J={alignment:"start",orientation:"horizontal"},T=t=>{let{alignment:e=J.alignment,orientation:r=J.orientation,...a}=t;return Xe("div",{...a,className:n(D,{[`${D}-${e}`]:e,[`${D}-${r}`]:r},t.className),children:t.children})};T.states=Je;T.options=We;T.className=D;T.defaultOptions=J;import{Fragment as Qo,jsx as Wo,jsxs as Xo}from"react/jsx-runtime";import{Fragment as nr,jsx as rr,jsxs as ar}from"react/jsx-runtime";import{jsx as W,jsxs as tt}from"react/jsx-runtime";var X="k-tilelayout-item",Ze=[d.focus],je={},et={},f=t=>{let{header:e,body:r,focus:a,resize:i,style:c}=t;return tt(C,{className:n(t.className,X,x(X,{focus:a}),{"k-resize":i===!0,"k-resize-x":i==="horizontal","k-resize-y":i==="vertical"}),style:c,children:[e&&Qe.isValidElement(e)?W($,{className:"k-tilelayout-item-header k-cursor-move",children:e}):W($,{className:"k-tilelayout-item-header k-cursor-move",title:e}),r&&W(P,{className:"k-tilelayout-item-body",children:r})]})};f.states=Ze;f.options=je;f.className=X;f.defaultOptions=et;import{jsx as nt}from"react/jsx-runtime";var ie="k-layout-item-hint",ot=[],rt={},at={},_=t=>{let{style:e}=t;return nt("div",{className:ie,style:e})};_.states=ot;_.options=rt;_.className=ie;_.defaultOptions=at;import{Fragment as st,jsx as z,jsxs as it}from"react/jsx-runtime";var Ir=t=>z(b,{children:it(st,{children:[z(f,{header:"Title goes here",body:"Content goes here"}),z(f,{header:"Title goes here",body:"Content goes here"}),z(f,{header:"Title goes here",body:"Content goes here"}),z(f,{header:"Title goes here",body:"Content goes here"})]}),...t});export{Ir as TileLayoutNormal};