UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.02 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 f=(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});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"},J={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",Q=t=>{let{callout:e,...r}=t;return de("span",{...r,className:n(t.className,ce,{[`k-callout-${J.calloutMap[e]||e}`]:e})})};import{Fragment as fe,jsx as W,jsxs as he}from"react/jsx-runtime";var I="k-card",me=[c.hover,c.focus,c.selected,c.disabled],ue={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},pe={},x=t=>{let{orientation:e,themeColor:r,callout:a,hover:l,focus:d,selected:i,disabled:p,...u}=t;return he("div",{...u,className:n(t.className,I,f(I,{themeColor:r}),h(I,{hover:l,focus:d,disabled:p,selected:i}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&W(Q,{callout:a}),W(fe,{children:t.children})]})};x.states=me;x.options=ue;x.className=I;x.defaultOptions=pe;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",w=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 ge,jsx as X}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]},ke={},g=t=>{let{size:e,themeColor:r,icon:a,rotate:l,flip:d,...i}=t;return a?X("span",{...i,className:n(t.className,_,f(_,{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"})}):X(ge,{})};g.states=be;g.options=ve;g.className=_;g.defaultOptions=ke;var Z=g;import{Fragment as Se,jsx as E}from"react/jsx-runtime";var F="k-icon k-svg-icon",Ae=[],Me={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"},A=t=>{let{size:e,themeColor:r,rotate:a,flip:l,viewBox:d=j.viewBox,icon:i,...p}=t;if(!i)return E(Se,{});i==="none"&&{...p,className:n(t.className,F,"k-none")};let u=typeof i=="object"&&i.name&&i.name;return E("span",{...p,className:n(t.className,F,f("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${r}`]:r,[`k-rotate-${a}`]:a,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:E("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})})};A.states=Ae;A.options=Me;A.className=F;A.defaultOptions=j;var V=A;import*as ee from"@progress/kendo-svg-icons";import{Fragment as te,jsx as M}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:l=G.type,rotate:d,flip:i,viewBox:p=G.viewBox,...u}=t;if(!a)return M(te,{});if(l==="svg"){if(a==="none")return M(V,{...u,icon:a,size:e});let z=Te(`${a}-icon`);return ee[z]?M(V,{...u,icon:ee[z],size:e,themeColor:r,rotate:d,flip:i,viewBox:p}):M(te,{})}return M(Z,{...u,icon:a,size:e,themeColor:r,rotate:d,flip:i})};v.states=Be;v.options=Le;v.defaultOptions=G;import{Fragment as Ie,jsx as S,jsxs as oe}from"react/jsx-runtime";var O="k-button",ze=[c.hover,c.focus,c.active,c.selected,c.disabled],He={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:l=y.themeColor,showArrow:d=y.showArrow,arrowIconName:i=y.arrowIconName,hover:p,focus:u,active:z,selected:re,disabled:ae,icon:D,text:H,iconClassName:ne,...se}=t,le=D!==void 0,ie=t.children!==void 0;return oe("button",{...se,className:n(t.className,O,f(O,{size:e,rounded:r,fillMode:a,themeColor:l}),h(O,{hover:p,focus:u,active:z,disabled:ae,selected:re}),{"k-icon-button":!H&&!ie&&le}),children:[D&&S(v,{className:n(ne,"k-button-icon"),icon:D}),H?oe(Ie,{children:[H&&S("span",{className:"k-button-text",children:H}),t.children]}):t.children&&S("span",{className:"k-button-text",children:t.children}),d&&S("span",{className:"k-menu-button-arrow k-button-arrow",children:S(v,{icon:i})})]})};m.states=ze;m.options=He;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 Jt}from"react/jsx-runtime";import{Fragment as Ee,jsx as T,jsxs as Oe}from"react/jsx-runtime";var we="k-card-header",R=t=>{let{title:e,subtitle:r,details:a,...l}=t;return Oe("div",{...l,className:n(t.className,we),children:[e&&T(b,{children:e}),r&&T(w,{children:r}),T(Ee,{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,...l}=t;return $e("div",{...l,className:n(t.className,Re),children:[e&&B(b,{children:e}),r&&B(w,{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"},k=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})};k.states=De;k.options=Pe;k.className=$;k.defaultOptions=U;import{Fragment as wo,jsx as Ho,jsxs as Io}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 Y="k-tilelayout-item",Ve=[c.focus],Ge={},Ue={},L=t=>{let{header:e,body:r,focus:a,resize:l,style:d}=t;return qe(x,{className:n(t.className,Y,h(Y,{focus:a}),{"k-resize":l===!0,"k-resize-x":l==="horizontal","k-resize-y":l==="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=Y;L.defaultOptions=Ue;var ar=L;export{Y as TILELAYOUTITEM_CLASSNAME,L as TileLayoutItem,ar as default};