UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 8.39 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"}),v=(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 r={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},y={small:"small",medium:"medium",large:"large",full:"full"},x={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"},V={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as le}from"react/jsx-runtime";var se="k-card-callout",U=t=>{let{callout:e,...a}=t;return le("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",ie=[c.hover,c.focus,c.selected,c.disabled],ce={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},de={},h=t=>{let{orientation:e,themeColor:a,callout:s,hover:i,focus:m,selected:l,disabled:f,...u}=t;return ue("div",{...u,className:n(t.className,w,p(w,{themeColor:a}),v(w,{hover:i,focus:m,disabled:f,selected:l}),{[`k-card-${e}`]:e,"k-card-with-callout":s}),children:[s&&s!=="true"&&q(U,{callout:s}),q(me,{children:t.children})]})};h.states=ie;h.options=ce;h.className=w;h.defaultOptions=de;import{jsx as pe}from"react/jsx-runtime";var K="k-card-title",fe=[c.hover,c.focus],g=t=>{let{hover:e,focus:a,...s}=t;return pe("div",{...s,className:n(t.className,K,v(K,{hover:e,focus:a})),children:t.children})};g.states=fe;g.className=K;import{jsx as he}from"react/jsx-runtime";var xe="k-card-subtitle",R=t=>{let{...e}=t;return he("div",{...e,className:n(t.className,xe),children:t.children})};import{Fragment as lt,jsx as st}from"react/jsx-runtime";import{Fragment as ye,jsx as Y}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]},ve={},k=t=>{let{size:e,themeColor:a,icon:s,rotate:i,flip:m,...l}=t;return s?Y("span",{...l,className:n(t.className,$,p($,{size:e}),{[`k-i-${s}`]:s,[`k-color-${a}`]:a,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):Y(ye,{})};k.states=Ce;k.options=be;k.className=$;k.defaultOptions=ve;var J=k;import{Fragment as ke,jsx as H}from"react/jsx-runtime";var D="k-icon k-svg-icon",Ne=[],ge={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]},Q={viewBox:"0 0 24 24"},A=t=>{let{size:e,themeColor:a,rotate:s,flip:i,viewBox:m=Q.viewBox,icon:l,...f}=t;if(!l)return H(ke,{});l==="none"&&{...f,className:n(t.className,D,"k-none")};let u=typeof l=="object"&&l.name&&l.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":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:H("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:m,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};A.states=Ne;A.options=ge;A.className=D;A.defaultOptions=Q;var P=A;import*as W from"@progress/kendo-svg-icons";import{Fragment as X,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"},N=t=>{let{size:e,themeColor:a,icon:s,type:i=_.type,rotate:m,flip:l,viewBox:f=_.viewBox,...u}=t;if(!s)return M(X,{});if(i==="svg"){if(s==="none")return M(P,{...u,icon:s,size:e});let L=Ae(`${s}-icon`);return W[L]?M(P,{...u,icon:W[L],size:e,themeColor:a,rotate:m,flip:l,viewBox:f}):M(X,{})}return M(J,{...u,icon:s,size:e,themeColor:a,rotate:m,flip:l})};N.states=Me;N.options=Se;N.defaultOptions=_;import{Fragment as Le,jsx as S,jsxs as Z}from"react/jsx-runtime";var I="k-button",Te=[c.hover,c.focus,c.active,c.selected,c.disabled],Be={size:[r.small,r.medium,r.large],rounded:[y.small,y.medium,y.large,y.full],fillMode:[x.solid,x.flat,x.outline,x.clear,x.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:y.medium,fillMode:x.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:i=C.themeColor,showArrow:m=C.showArrow,arrowIconName:l=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,I,p(I,{size:e,rounded:a,fillMode:s,themeColor:i}),v(I,{hover:f,focus:u,active:L,disabled:te,selected:ee}),{"k-icon-button":!z&&!ae&&ne}),children:[O&&S(N,{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(N,{icon:l})})]})};d.states=Te;d.options=Be;d.className=I;d.defaultOptions=C;import{jsx as zt}from"react/jsx-runtime";import{jsx as Et}from"react/jsx-runtime";import{jsx as $t}from"react/jsx-runtime";import{Fragment as Xt,jsx as Wt,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,...i}=t;return He("div",{...i,className:n(t.className,ze),children:[e&&T(g,{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 E="k-actions",Ie=[],Ee={},G={alignment:"start",orientation:"horizontal"},b=t=>{let{alignment:e=G.alignment,orientation:a=G.orientation,...s}=t;return Oe("div",{...s,className:n(E,{[`${E}-${e}`]:e,[`${E}-${a}`]:a},t.className),children:t.children})};b.states=Ie;b.options=Ee;b.className=E;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(h,{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};