@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 7.73 kB
JavaScript
var n=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((s,a)=>e[a]||e[s]&&s||null).filter(s=>s!==null).join(" "):e).filter(e=>!!e).join(" ");var p=(o,e)=>n({[`${o}-xs`]:e.size==="xsmall",[`${o}-sm`]:e.size==="small",[`${o}-md`]:e.size==="medium",[`${o}-lg`]:e.size==="large",[`${o}-xl`]:e.size==="xlarge",[`${o}-xxl`]:e.size==="xxlarge",[`${o}-xxxl`]:e.size==="xxxlarge"},{[`${o}-${e.fillMode}`]:e.fillMode},{[`${o}-${e.fillMode}-${e.themeColor}`]:e.fillMode&&e.themeColor},{[`${o}-${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"}),C=(o,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"},b={small:"small",medium:"medium",large:"large",full:"full"},x={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},t={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},i={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"},F={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as ne}from"react/jsx-runtime";var re="k-card-callout",B=o=>{let{callout:e,...s}=o;return ne("span",{...s,className:n(o.className,re,{[`k-callout-${F.calloutMap[e]||e}`]:e})})};import{Fragment as ie,jsx as G,jsxs as ce}from"react/jsx-runtime";var L="k-card",ae=[i.hover,i.focus,i.selected,i.disabled],se={themeColor:[t.primary,t.success,t.warning,t.error,t.info]},le={},v=o=>{let{orientation:e,themeColor:s,callout:a,hover:c,focus:d,selected:l,disabled:f,...u}=o;return ce("div",{...u,className:n(o.className,L,p(L,{themeColor:s}),C(L,{hover:c,focus:d,disabled:f,selected:l}),{[`k-card-${e}`]:e,"k-card-with-callout":a}),children:[a&&a!=="true"&&G(B,{callout:a}),G(ie,{children:o.children})]})};v.states=ae;v.options=se;v.className=L;v.defaultOptions=le;import{jsx as me}from"react/jsx-runtime";var K="k-card-title",de=[i.hover,i.focus],z=o=>{let{hover:e,focus:s,...a}=o;return me("div",{...a,className:n(o.className,K,C(K,{hover:e,focus:s})),children:o.children})};z.states=de;z.className=K;import{jsx as je}from"react/jsx-runtime";import{Fragment as nt,jsx as rt}from"react/jsx-runtime";import{Fragment as xe,jsx as U}from"react/jsx-runtime";var R="k-icon k-font-icon",ue=[],fe={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},pe={},k=o=>{let{size:e,themeColor:s,icon:a,rotate:c,flip:d,...l}=o;return a?U("span",{...l,className:n(o.className,R,p(R,{size:e}),{[`k-i-${a}`]:a,[`k-color-${s}`]:s,[`k-rotate-${c}`]:c,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):U(xe,{})};k.states=ue;k.options=fe;k.className=R;k.defaultOptions=pe;var V=k;import{Fragment as be,jsx as w}from"react/jsx-runtime";var $="k-icon k-svg-icon",he=[],Ce={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},q={viewBox:"0 0 24 24"},g=o=>{let{size:e,themeColor:s,rotate:a,flip:c,viewBox:d=q.viewBox,icon:l,...f}=o;if(!l)return w(be,{});l==="none"&&{...f,className:n(o.className,$,"k-none")};let u=typeof l=="object"&&l.name&&l.name;return w("span",{...f,className:n(o.className,$,p("k-icon",{size:e}),{[`k-svg-i-${u}`]:u,[`k-color-${s}`]:s,[`k-rotate-${a}`]:a,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="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:o.children})})};g.states=he;g.options=Ce;g.className=$;g.defaultOptions=q;var D=g;import*as Y from"@progress/kendo-svg-icons";import{Fragment as J,jsx as A}from"react/jsx-runtime";var ve=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ne=[],ye={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark]},P={viewBox:"0 0 24 24",type:"svg"},N=o=>{let{size:e,themeColor:s,icon:a,type:c=P.type,rotate:d,flip:l,viewBox:f=P.viewBox,...u}=o;if(!a)return A(J,{});if(c==="svg"){if(a==="none")return A(D,{...u,icon:a,size:e});let S=ve(`${a}-icon`);return Y[S]?A(D,{...u,icon:Y[S],size:e,themeColor:s,rotate:d,flip:l,viewBox:f}):A(J,{})}return A(V,{...u,icon:a,size:e,themeColor:s,rotate:d,flip:l})};N.states=Ne;N.options=ye;N.defaultOptions=P;import{Fragment as Ae,jsx as M,jsxs as Q}from"react/jsx-runtime";var H="k-button",ke=[i.hover,i.focus,i.active,i.selected,i.disabled],ge={size:[r.small,r.medium,r.large],rounded:[b.small,b.medium,b.large,b.full],fillMode:[x.solid,x.flat,x.outline,x.clear,x.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},h={size:r.medium,rounded:b.medium,fillMode:x.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=o=>{let{size:e=h.size,rounded:s=h.rounded,fillMode:a=h.fillMode,themeColor:c=h.themeColor,showArrow:d=h.showArrow,arrowIconName:l=h.arrowIconName,hover:f,focus:u,active:S,selected:X,disabled:Z,icon:O,text:T,iconClassName:j,...ee}=o,te=O!==void 0,oe=o.children!==void 0;return Q("button",{...ee,className:n(o.className,H,p(H,{size:e,rounded:s,fillMode:a,themeColor:c}),C(H,{hover:f,focus:u,active:S,disabled:Z,selected:X}),{"k-icon-button":!T&&!oe&&te}),children:[O&&M(N,{className:n(j,"k-button-icon"),icon:O}),T?Q(Ae,{children:[T&&M("span",{className:"k-button-text",children:T}),o.children]}):o.children&&M("span",{className:"k-button-text",children:o.children}),d&&M("span",{className:"k-menu-button-arrow k-button-arrow",children:M(N,{icon:l})})]})};m.states=ke;m.options=ge;m.className=H;m.defaultOptions=h;import{jsx as Tt}from"react/jsx-runtime";import{jsx as wt}from"react/jsx-runtime";import{jsx as Ot}from"react/jsx-runtime";import{Fragment as Jt,jsx as Yt,jsxs as Qt}from"react/jsx-runtime";import{jsx as jt}from"react/jsx-runtime";import{Fragment as lo,jsx as so,jsxs as io}from"react/jsx-runtime";import{jsx as fo}from"react/jsx-runtime";import{jsx as Be}from"react/jsx-runtime";var E="k-actions",Se=[],Te={},_={alignment:"start",orientation:"horizontal"},y=o=>{let{alignment:e=_.alignment,orientation:s=_.orientation,...a}=o;return Be("div",{...a,className:n(E,{[`${E}-${e}`]:e,[`${E}-${s}`]:s},o.className),children:o.children})};y.states=Se;y.options=Te;y.className=E;y.defaultOptions=_;import{Fragment as To,jsx as Mo,jsxs as So}from"react/jsx-runtime";import{Fragment as Oo,jsx as Eo,jsxs as Io}from"react/jsx-runtime";import{jsx as He}from"react/jsx-runtime";var W="k-timeline-card-callout",ze=[],we={},I=o=>{let{...e}=o;return He(B,{className:n(o.className,W),...e})};I.states=ze;I.className=W;I.defaultOptions=we;var Zo=I;export{W as TIMELINECARDCALLOUT_CLASSNAME,I as TimelineCardCallout,Zo as default};