@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.82 kB
JavaScript
var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,n)=>e[n]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var p=(t,e)=>a({[`${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)=>a({"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"},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"},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"},U={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as ce}from"react/jsx-runtime";var le="k-card-callout",q=t=>{let{callout:e,...r}=t;return ce("span",{...r,className:a(t.className,le,{[`k-callout-${U.calloutMap[e]||e}`]:e})})};import{Fragment as fe,jsx as J,jsxs as pe}from"react/jsx-runtime";var H="k-card",de=[d.hover,d.focus,d.selected,d.disabled],me={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},ue={},x=t=>{let{orientation:e,themeColor:r,callout:n,hover:l,focus:m,selected:i,disabled:f,...u}=t;return pe("div",{...u,className:a(t.className,H,p(H,{themeColor:r}),g(H,{hover:l,focus:m,disabled:f,selected:i}),{[`k-card-${e}`]:e,"k-card-with-callout":n}),children:[n&&n!=="true"&&J(q,{callout:n}),J(fe,{children:t.children})]})};x.states=de;x.options=me;x.className=H;x.defaultOptions=ue;import{jsx as xe}from"react/jsx-runtime";var $="k-card-title",he=[d.hover,d.focus],y=t=>{let{hover:e,focus:r,...n}=t;return xe("div",{...n,className:a(t.className,$,g($,{hover:e,focus:r})),children:t.children})};y.states=he;y.className=$;import{jsx as be}from"react/jsx-runtime";var Ce="k-card-subtitle",E=t=>{let{...e}=t;return be("div",{...e,className:a(t.className,Ce),children:t.children})};import{Fragment as ut,jsx as mt}from"react/jsx-runtime";import{Fragment as Ne,jsx as X}from"react/jsx-runtime";var D="k-icon k-font-icon",ge=[],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]},ye={},A=t=>{let{size:e,themeColor:r,icon:n,rotate:l,flip:m,...i}=t;return n?X("span",{...i,className:a(t.className,D,p(D,{size:e}),{[`k-i-${n}`]:n,[`k-color-${r}`]:r,[`k-rotate-${l}`]:l,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):X(Ne,{})};A.states=ge;A.options=ve;A.className=D;A.defaultOptions=ye;var Y=A;import{Fragment as Me,jsx as I}from"react/jsx-runtime";var P="k-icon k-svg-icon",ke=[],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]},Q={viewBox:"0 0 24 24"},M=t=>{let{size:e,themeColor:r,rotate:n,flip:l,viewBox:m=Q.viewBox,icon:i,...f}=t;if(!i)return I(Me,{});i==="none"&&{...f,className:a(t.className,P,"k-none")};let u=typeof i=="object"&&i.name&&i.name;return I("span",{...f,className:a(t.className,P,p("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${r}`]:r,[`k-rotate-${n}`]:n,"k-flip-h":l==="h"||l==="both","k-flip-v":l==="v"||l==="both"}),children:I("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})})};M.states=ke;M.options=Ae;M.className=P;M.defaultOptions=Q;var _=M;import*as W from"@progress/kendo-svg-icons";import{Fragment as Z,jsx as S}from"react/jsx-runtime";var Se=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Te=[],Be={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]},F={viewBox:"0 0 24 24",type:"svg"},N=t=>{let{size:e,themeColor:r,icon:n,type:l=F.type,rotate:m,flip:i,viewBox:f=F.viewBox,...u}=t;if(!n)return S(Z,{});if(l==="svg"){if(n==="none")return S(_,{...u,icon:n,size:e});let z=Se(`${n}-icon`);return W[z]?S(_,{...u,icon:W[z],size:e,themeColor:r,rotate:m,flip:i,viewBox:f}):S(Z,{})}return S(Y,{...u,icon:n,size:e,themeColor:r,rotate:m,flip:i})};N.states=Te;N.options=Be;N.defaultOptions=F;import{Fragment as we,jsx as T,jsxs as j}from"react/jsx-runtime";var O="k-button",Le=[d.hover,d.focus,d.active,d.selected,d.disabled],ze={size:[s.small,s.medium,s.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:s.medium,rounded:v.medium,fillMode:h.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},c=t=>{let{size:e=C.size,rounded:r=C.rounded,fillMode:n=C.fillMode,themeColor:l=C.themeColor,showArrow:m=C.showArrow,arrowIconName:i=C.arrowIconName,hover:f,focus:u,active:z,selected:oe,disabled:re,icon:R,text:w,iconClassName:ne,...ae}=t,se=R!==void 0,ie=t.children!==void 0;return j("button",{...ae,className:a(t.className,O,p(O,{size:e,rounded:r,fillMode:n,themeColor:l}),g(O,{hover:f,focus:u,active:z,disabled:re,selected:oe}),{"k-icon-button":!w&&!ie&&se}),children:[R&&T(N,{className:a(ne,"k-button-icon"),icon:R}),w?j(we,{children:[w&&T("span",{className:"k-button-text",children:w}),t.children]}):t.children&&T("span",{className:"k-button-text",children:t.children}),m&&T("span",{className:"k-menu-button-arrow k-button-arrow",children:T(N,{icon:i})})]})};c.states=Le;c.options=ze;c.className=O;c.defaultOptions=C;import{jsx as Ot}from"react/jsx-runtime";import{jsx as Dt}from"react/jsx-runtime";import{jsx as Gt}from"react/jsx-runtime";import{Fragment as Ee,jsx as B,jsxs as Ie}from"react/jsx-runtime";var He="k-card-header",ee=t=>{let{title:e,subtitle:r,details:n,...l}=t;return Ie("div",{...l,className:a(t.className,He),children:[e&&B(y,{children:e}),r&&B(E,{children:r}),B(Ee,{children:t.children}),n&&B("span",{className:"k-card-header-actions",children:B(c,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as no}from"react/jsx-runtime";import{Fragment as Ke,jsx as L,jsxs as Re}from"react/jsx-runtime";var Oe="k-card-body",G=t=>{let{title:e,subtitle:r,details:n,...l}=t;return Re("div",{...l,className:a(t.className,Oe),children:[e&&L(y,{children:e}),r&&L(E,{children:r}),L(Ke,{children:t.children}),n&&L("span",{className:"k-card-header-actions",children:L(c,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};import{jsx as ho}from"react/jsx-runtime";import{jsx as Pe}from"react/jsx-runtime";var K="k-actions",$e=[],De={},V={alignment:"start",orientation:"horizontal"},b=t=>{let{alignment:e=V.alignment,orientation:r=V.orientation,...n}=t;return Pe("div",{...n,className:a(K,{[`${K}-${e}`]:e,[`${K}-${r}`]:r},t.className),children:t.children})};b.states=$e;b.options=De;b.className=K;b.defaultOptions=V;import{Fragment as Bo,jsx as So,jsxs as To}from"react/jsx-runtime";import{Fragment as _e,jsx as k,jsxs as te}from"react/jsx-runtime";var Uo=t=>k(x,{orientation:"vertical",children:te(_e,{children:[k(ee,{children:"Card Header"}),k(G,{children:k("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),te(b,{className:"k-card-actions",children:[k(c,{fillMode:"flat",themeColor:"primary",children:"Action 1"}),k(c,{fillMode:"flat",themeColor:"primary",children:"Action 2"})]})]}),...t});export{Uo as CardNormal};