UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.45 kB
var n=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((a,s)=>e[s]||e[a]&&a||null).filter(a=>a!==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"}),g=(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 r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},v={small:"small",medium:"medium",large:"large",full:"full"},h={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"},V={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as ie}from"react/jsx-runtime";var se="k-card-callout",U=t=>{let{callout:e,...a}=t;return ie("span",{...a,className:n(t.className,se,{[`k-callout-${V.calloutMap[e]||e}`]:e})})};import{Fragment as me,jsx as q,jsxs as ue}from"react/jsx-runtime";var w="k-card",le=[c.hover,c.focus,c.selected,c.disabled],ce={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},de={},x=t=>{let{orientation:e,themeColor:a,callout:s,hover:l,focus:m,selected:i,disabled:f,...u}=t;return ue("div",{...u,className:n(t.className,w,p(w,{themeColor:a}),g(w,{hover:l,focus:m,disabled:f,selected:i}),{[`k-card-${e}`]:e,"k-card-with-callout":s}),children:[s&&s!=="true"&&q(U,{callout:s}),q(me,{children:t.children})]})};x.states=le;x.options=ce;x.className=w;x.defaultOptions=de;import{jsx as pe}from"react/jsx-runtime";var K="k-card-title",fe=[c.hover,c.focus],N=t=>{let{hover:e,focus:a,...s}=t;return pe("div",{...s,className:n(t.className,K,g(K,{hover:e,focus:a})),children:t.children})};N.states=fe;N.className=K;import{jsx as xe}from"react/jsx-runtime";var he="k-card-subtitle",R=t=>{let{...e}=t;return xe("div",{...e,className:n(t.className,he),children:t.children})};import{Fragment as it,jsx as st}from"react/jsx-runtime";import{Fragment as ve,jsx as J}from"react/jsx-runtime";var $="k-icon k-font-icon",Ce=[],be={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.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:a,icon:s,rotate:l,flip:m,...i}=t;return s?J("span",{...i,className:n(t.className,$,p($,{size:e}),{[`k-i-${s}`]:s,[`k-color-${a}`]:a,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):J(ve,{})};k.states=Ce;k.options=be;k.className=$;k.defaultOptions=ge;var X=k;import{Fragment as ke,jsx as H}from"react/jsx-runtime";var D="k-icon k-svg-icon",ye=[],Ne={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.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"},A=t=>{let{size:e,themeColor:a,rotate:s,flip:l,viewBox:m=Y.viewBox,icon:i,...f}=t;if(!i)return H(ke,{});i==="none"&&{...f,className:n(t.className,D,"k-none")};let u=typeof i=="object"&&i.name&&i.name;return H("span",{...f,className:n(t.className,D,p("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${a}`]:a,[`k-rotate-${s}`]:s,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:H("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof i=="object"?i.viewBox:m,dangerouslySetInnerHTML:typeof i=="object"?{__html:i.content}:void 0,children:i?void 0:t.children})})};A.states=ye;A.options=Ne;A.className=D;A.defaultOptions=Y;var P=A;import*as Q from"@progress/kendo-svg-icons";import{Fragment as W,jsx as M}from"react/jsx-runtime";var Ae=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Me=[],Se={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},_={viewBox:"0 0 24 24",type:"svg"},y=t=>{let{size:e,themeColor:a,icon:s,type:l=_.type,rotate:m,flip:i,viewBox:f=_.viewBox,...u}=t;if(!s)return M(W,{});if(l==="svg"){if(s==="none")return M(P,{...u,icon:s,size:e});let L=Ae(`${s}-icon`);return Q[L]?M(P,{...u,icon:Q[L],size:e,themeColor:a,rotate:m,flip:i,viewBox:f}):M(W,{})}return M(X,{...u,icon:s,size:e,themeColor:a,rotate:m,flip:i})};y.states=Me;y.options=Se;y.defaultOptions=_;import{Fragment as Le,jsx as S,jsxs as Z}from"react/jsx-runtime";var E="k-button",Te=[c.hover,c.focus,c.active,c.selected,c.disabled],Be={size:[r.small,r.medium,r.large],rounded:[v.small,v.medium,v.large,v.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},C={size:r.medium,rounded:v.medium,fillMode:h.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},d=t=>{let{size:e=C.size,rounded:a=C.rounded,fillMode:s=C.fillMode,themeColor:l=C.themeColor,showArrow:m=C.showArrow,arrowIconName:i=C.arrowIconName,hover:f,focus:u,active:L,selected:ee,disabled:te,icon:O,text:z,iconClassName:oe,...re}=t,ne=O!==void 0,ae=t.children!==void 0;return Z("button",{...re,className:n(t.className,E,p(E,{size:e,rounded:a,fillMode:s,themeColor:l}),g(E,{hover:f,focus:u,active:L,disabled:te,selected:ee}),{"k-icon-button":!z&&!ae&&ne}),children:[O&&S(y,{className:n(oe,"k-button-icon"),icon:O}),z?Z(Le,{children:[z&&S("span",{className:"k-button-text",children:z}),t.children]}):t.children&&S("span",{className:"k-button-text",children:t.children}),m&&S("span",{className:"k-menu-button-arrow k-button-arrow",children:S(y,{icon:i})})]})};d.states=Te;d.options=Be;d.className=E;d.defaultOptions=C;import{jsx as zt}from"react/jsx-runtime";import{jsx as It}from"react/jsx-runtime";import{jsx as $t}from"react/jsx-runtime";import{Fragment as Wt,jsx as Qt,jsxs as Zt}from"react/jsx-runtime";import{jsx as oo}from"react/jsx-runtime";import{Fragment as we,jsx as T,jsxs as He}from"react/jsx-runtime";var ze="k-card-body",F=t=>{let{title:e,subtitle:a,details:s,...l}=t;return He("div",{...l,className:n(t.className,ze),children:[e&&T(N,{children:e}),a&&T(R,{children:a}),T(we,{children:t.children}),s&&T("span",{className:"k-card-header-actions",children:T(d,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as fo}from"react/jsx-runtime";import{jsx as Oe}from"react/jsx-runtime";var I="k-actions",Ee=[],Ie={},G={alignment:"start",orientation:"horizontal"},b=t=>{let{alignment:e=G.alignment,orientation:a=G.orientation,...s}=t;return Oe("div",{...s,className:n(I,{[`${I}-${e}`]:e,[`${I}-${a}`]:a},t.className),children:t.children})};b.states=Ee;b.options=Ie;b.className=I;b.defaultOptions=G;import{Fragment as To,jsx as Mo,jsxs as So}from"react/jsx-runtime";import{Fragment as Ke,jsx as B,jsxs as j}from"react/jsx-runtime";var Vo=t=>B(x,{orientation:"horizontal",children:j(Ke,{children:[B(F,{title:"Card Title",children:B("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),j(b,{orientation:"vertical",className:"k-card-actions",children:[B(d,{fillMode:"flat",themeColor:"primary",children:"Action 1"}),B(d,{fillMode:"flat",themeColor:"primary",children:"Action 2"})]})]}),...t});export{Vo as CardHorizontal};