UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.79 kB
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,"k-highlighted":e.highlighted});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"},h={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",highlighted:"highlighted"},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 he,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={},y=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(he,{})};y.states=ue;y.options=fe;y.className=R;y.defaultOptions=pe;var V=y;import{Fragment as be,jsx as w}from"react/jsx-runtime";var $="k-icon k-svg-icon",xe=[],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"},k=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})})};k.states=xe;k.options=Ce;k.className=$;k.defaultOptions=q;var D=k;import*as J from"@progress/kendo-svg-icons";import{Fragment as X,jsx as A}from"react/jsx-runtime";var ve=o=>o.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ne=[],ge={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(X,{});if(c==="svg"){if(a==="none")return A(D,{...u,icon:a,size:e});let S=ve(`${a}-icon`);return J[S]?A(D,{...u,icon:J[S],size:e,themeColor:s,rotate:d,flip:l,viewBox:f}):A(X,{})}return A(V,{...u,icon:a,size:e,themeColor:s,rotate:d,flip:l})};N.states=Ne;N.options=ge;N.defaultOptions=P;import{Fragment as Ae,jsx as M,jsxs as Y}from"react/jsx-runtime";var E="k-button",ye=[i.hover,i.focus,i.active,i.selected,i.disabled],ke={size:[r.small,r.medium,r.large],rounded:[b.small,b.medium,b.large,b.full],fillMode:[h.solid,h.flat,h.outline,h.clear,h.link],themeColor:[t.base,t.primary,t.secondary,t.tertiary,t.success,t.warning,t.error,t.info,t.light,t.dark,t.inverse]},x={size:r.medium,rounded:b.medium,fillMode:h.solid,themeColor:t.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=o=>{let{size:e=x.size,rounded:s=x.rounded,fillMode:a=x.fillMode,themeColor:c=x.themeColor,showArrow:d=x.showArrow,arrowIconName:l=x.arrowIconName,hover:f,focus:u,active:S,selected:W,disabled:Z,icon:O,text:T,iconClassName:j,...ee}=o,te=O!==void 0,oe=o.children!==void 0;return Y("button",{...ee,className:n(o.className,E,p(E,{size:e,rounded:s,fillMode:a,themeColor:c}),C(E,{hover:f,focus:u,active:S,disabled:Z,selected:W}),{"k-icon-button":!T&&!oe&&te}),children:[O&&M(N,{className:n(j,"k-button-icon"),icon:O}),T?Y(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=ye;m.options=ke;m.className=E;m.defaultOptions=x;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 Xt,jsx as Jt,jsxs as Yt}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 H="k-actions",Se=[],Te={},_={alignment:"start",orientation:"horizontal"},g=o=>{let{alignment:e=_.alignment,orientation:s=_.orientation,...a}=o;return Be("div",{...a,className:n(H,{[`${H}-${e}`]:e,[`${H}-${s}`]:s},o.className),children:o.children})};g.states=Se;g.options=Te;g.className=H;g.defaultOptions=_;import{Fragment as To,jsx as Mo,jsxs as So}from"react/jsx-runtime";import{Fragment as Oo,jsx as Ho,jsxs as Io}from"react/jsx-runtime";import{jsx as Ee}from"react/jsx-runtime";var Q="k-timeline-card-callout",ze=[],we={},I=o=>{let{...e}=o;return Ee(B,{className:n(o.className,Q),...e})};I.states=ze;I.className=Q;I.defaultOptions=we;var Zo=I;export{Q as TIMELINECARDCALLOUT_CLASSNAME,I as TimelineCardCallout,Zo as default};