UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.08 kB
import Fe from"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 p=(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"}),h=(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"},C={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"},X={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as de}from"react/jsx-runtime";var ce="k-card-callout",Y=t=>{let{callout:e,...r}=t;return de("span",{...r,className:n(t.className,ce,{[`k-callout-${X.calloutMap[e]||e}`]:e})})};import{Fragment as pe,jsx as Q,jsxs as he}from"react/jsx-runtime";var H="k-card",me=[c.hover,c.focus,c.selected,c.disabled],ue={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},fe={},x=t=>{let{orientation:e,themeColor:r,callout:a,hover:i,focus:d,selected:l,disabled:f,...u}=t;return he("div",{...u,className:n(t.className,H,p(H,{themeColor:r}),h(H,{hover:i,focus:d,disabled:f,selected:l}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&Q(Y,{callout:a}),Q(pe,{children:t.children})]})};x.states=me;x.options=ue;x.className=H;x.defaultOptions=fe;import{jsx as Ce}from"react/jsx-runtime";var P="k-card-title",xe=[c.hover,c.focus],b=t=>{let{hover:e,focus:r,...a}=t;return Ce("div",{...a,className:n(t.className,P,h(P,{hover:e,focus:r})),children:t.children})};b.states=xe;b.className=P;import{jsx as Ne}from"react/jsx-runtime";var ye="k-card-subtitle",I=t=>{let{...e}=t;return Ne("div",{...e,className:n(t.className,ye),children:t.children})};import{Fragment as Ct,jsx as xt}from"react/jsx-runtime";import{Fragment as ke,jsx as W}from"react/jsx-runtime";var _="k-icon k-font-icon",be=[],ve={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]},ge={},k=t=>{let{size:e,themeColor:r,icon:a,rotate:i,flip:d,...l}=t;return a?W("span",{...l,className:n(t.className,_,p(_,{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"})}):W(ke,{})};k.states=be;k.options=ve;k.className=_;k.defaultOptions=ge;var Z=k;import{Fragment as Me,jsx as w}from"react/jsx-runtime";var F="k-icon k-svg-icon",Se=[],Ae={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]},j={viewBox:"0 0 24 24"},S=t=>{let{size:e,themeColor:r,rotate:a,flip:i,viewBox:d=j.viewBox,icon:l,...f}=t;if(!l)return w(Me,{});l==="none"&&{...f,className:n(t.className,F,"k-none")};let u=typeof l=="object"&&l.name&&l.name;return w("span",{...f,className:n(t.className,F,p("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`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:d,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};S.states=Se;S.options=Ae;S.className=F;S.defaultOptions=j;var V=S;import*as ee from"@progress/kendo-svg-icons";import{Fragment as te,jsx as A}from"react/jsx-runtime";var Te=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Be=[],Le={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]},G={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:r,icon:a,type:i=G.type,rotate:d,flip:l,viewBox:f=G.viewBox,...u}=t;if(!a)return A(te,{});if(i==="svg"){if(a==="none")return A(V,{...u,icon:a,size:e});let z=Te(`${a}-icon`);return ee[z]?A(V,{...u,icon:ee[z],size:e,themeColor:r,rotate:d,flip:l,viewBox:f}):A(te,{})}return A(Z,{...u,icon:a,size:e,themeColor:r,rotate:d,flip:l})};v.states=Be;v.options=Le;v.defaultOptions=G;import{Fragment as He,jsx as M,jsxs as oe}from"react/jsx-runtime";var O="k-button",ze=[c.hover,c.focus,c.active,c.selected,c.disabled],Ee={size:[s.small,s.medium,s.large],rounded:[N.small,N.medium,N.large,N.full],fillMode:[C.solid,C.flat,C.outline,C.clear,C.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},y={size:s.medium,rounded:N.medium,fillMode:C.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=t=>{let{size:e=y.size,rounded:r=y.rounded,fillMode:a=y.fillMode,themeColor:i=y.themeColor,showArrow:d=y.showArrow,arrowIconName:l=y.arrowIconName,hover:f,focus:u,active:z,selected:re,disabled:ae,icon:D,text:E,iconClassName:ne,...se}=t,ie=D!==void 0,le=t.children!==void 0;return oe("button",{...se,className:n(t.className,O,p(O,{size:e,rounded:r,fillMode:a,themeColor:i}),h(O,{hover:f,focus:u,active:z,disabled:ae,selected:re}),{"k-icon-button":!E&&!le&&ie}),children:[D&&M(v,{className:n(ne,"k-button-icon"),icon:D}),E?oe(He,{children:[E&&M("span",{className:"k-button-text",children:E}),t.children]}):t.children&&M("span",{className:"k-button-text",children:t.children}),d&&M("span",{className:"k-menu-button-arrow k-button-arrow",children:M(v,{icon:l})})]})};m.states=ze;m.options=Ee;m.className=O;m.defaultOptions=y;import{jsx as Pt}from"react/jsx-runtime";import{jsx as Gt}from"react/jsx-runtime";import{jsx as Xt}from"react/jsx-runtime";import{Fragment as we,jsx as T,jsxs as Oe}from"react/jsx-runtime";var Ie="k-card-header",R=t=>{let{title:e,subtitle:r,details:a,...i}=t;return Oe("div",{...i,className:n(t.className,Ie),children:[e&&T(b,{children:e}),r&&T(I,{children:r}),T(we,{children:t.children}),a&&T("span",{className:"k-card-header-actions",children:T(m,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as co}from"react/jsx-runtime";import{Fragment as Ke,jsx as B,jsxs as $e}from"react/jsx-runtime";var Re="k-card-body",K=t=>{let{title:e,subtitle:r,details:a,...i}=t;return $e("div",{...i,className:n(t.className,Re),children:[e&&B(b,{children:e}),r&&B(I,{children:r}),B(Ke,{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 bo}from"react/jsx-runtime";import{jsx as _e}from"react/jsx-runtime";var $="k-actions",De=[],Pe={},U={alignment:"start",orientation:"horizontal"},g=t=>{let{alignment:e=U.alignment,orientation:r=U.orientation,...a}=t;return _e("div",{...a,className:n($,{[`${$}-${e}`]:e,[`${$}-${r}`]:r},t.className),children:t.children})};g.states=De;g.options=Pe;g.className=$;g.defaultOptions=U;import{Fragment as Io,jsx as Eo,jsxs as Ho}from"react/jsx-runtime";import{Fragment as _o,jsx as Do,jsxs as Po}from"react/jsx-runtime";import{jsx as q,jsxs as qe}from"react/jsx-runtime";var J="k-tilelayout-item",Ve=[c.focus],Ge={},Ue={},L=t=>{let{header:e,body:r,focus:a,resize:i,style:d}=t;return qe(x,{className:n(t.className,J,h(J,{focus:a}),{"k-resize":i===!0,"k-resize-x":i==="horizontal","k-resize-y":i==="vertical"}),style:d,children:[e&&Fe.isValidElement(e)?q(R,{className:"k-tilelayout-item-header k-cursor-move",children:e}):q(R,{className:"k-tilelayout-item-header k-cursor-move",title:e}),r&&q(K,{className:"k-tilelayout-item-body",children:r})]})};L.states=Ve;L.options=Ge;L.className=J;L.defaultOptions=Ue;var ar=L;export{J as TILELAYOUTITEM_CLASSNAME,L as TileLayoutItem,ar as default};