UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 6.53 kB
var i=(...o)=>o.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?i(...t):typeof t=="object"?Object.keys(t).map((r,s)=>t[s]||t[r]&&r||null).filter(r=>r!==null).join(" "):t).filter(t=>!!t).join(" ");var u=(o,t)=>i({[`${o}-xs`]:t.size==="xsmall",[`${o}-sm`]:t.size==="small",[`${o}-md`]:t.size==="medium",[`${o}-lg`]:t.size==="large",[`${o}-xl`]:t.size==="xlarge",[`${o}-xxl`]:t.size==="xxlarge",[`${o}-xxxl`]:t.size==="xxxlarge"},{[`${o}-${t.fillMode}`]:t.fillMode},{[`${o}-${t.fillMode}-${t.themeColor}`]:t.fillMode&&t.themeColor},{[`${o}-${t.themeColor}`]:t.themeColor&&t.fillMode===void 0},{"k-rounded-sm":t.rounded==="small","k-rounded-md":t.rounded==="medium","k-rounded-lg":t.rounded==="large","k-rounded-full":t.rounded==="full"});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"};var g={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},e={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"};import{Fragment as Z,jsx as _}from"react/jsx-runtime";var C="k-font-icon",X=[],Q={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark]},Y={},k=o=>{let{size:t,themeColor:r,icon:s,rotate:p,flip:a,...l}=o;return s?_("span",{...l,className:i(o.className,C,u(C,{size:t}),{[`k-i-${s}`]:s,[`k-color-${r}`]:r,[`k-rotate-${p}`]:p,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"})}):_(Z,{})};k.states=X;k.options=Q;k.className=C;k.defaultOptions=Y;var w=k;import{Fragment as ot,jsx as I}from"react/jsx-runtime";var z="k-svg-icon",tt=[],et={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark]},B={viewBox:"0 0 24 24"},v=o=>{let{size:t,themeColor:r,rotate:s,flip:p,viewBox:a=B.viewBox,icon:l,...c}=o;if(!l)return I(ot,{});l==="none"&&{...c,className:i(o.className,z,"k-none")};let m=typeof l=="object"&&l.name&&l.name;return I("span",{...c,className:i(o.className,z,u("k-icon",{size:t}),{[`k-svg-i-${m}`]:m,[`k-color-${r}`]:r,[`k-rotate-${s}`]:s,"k-flip-h":p==="h"||p==="both","k-flip-v":p==="v"||p==="both"}),children:I("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:a,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:o.children})})};v.states=tt;v.options=et;v.className=z;v.defaultOptions=B;var O=v;import*as E from"@progress/kendo-svg-icons";var P="icon",R="icons";import{Fragment as H,jsx as N}from"react/jsx-runtime";var A="k-icon",nt=o=>o.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),rt=[],st={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[e.base,e.primary,e.secondary,e.tertiary,e.success,e.warning,e.error,e.info,e.light,e.dark]},$={viewBox:"0 0 24 24",type:"svg"},d=o=>{let{size:t,themeColor:r,icon:s,type:p=$.type,rotate:a,flip:l,viewBox:c=$.viewBox,...m}=o;if(!s)return N(H,{});if(p==="svg"){if(s==="none")return N(O,{...m,className:i(o.className,A),icon:s,size:t});let h=E[s]?s:nt(`${s}-icon`);return E[h]?N(O,{...m,className:i(o.className,A),icon:E[h],size:t,themeColor:r,rotate:a,flip:l,viewBox:c}):N(H,{})}return N(w,{...m,className:i(o.className,A),icon:s,size:t,themeColor:r,rotate:a,flip:l})};d.states=rt;d.options=st;d.defaultOptions=$;d.className=A;d.moduleName=P;d.folderName=R;import{jsx as ct}from"react/jsx-runtime";var K="k-tabstrip-items",it=[],at={},lt={tabAlignment:"start"},S=o=>{let{children:t,tabAlignment:r,...s}=o;return ct("ul",{...s,className:i(o.className,K,"k-reset",`k-tabstrip-items-${r}`),children:t})};S.states=it;S.options=at;S.className=K;S.defaultOptions=lt;var F=S;import{jsx as dt}from"react/jsx-runtime";var D="k-tabstrip-items-wrapper",mt=[],pt={},W={orientation:"horizontal"},y=o=>{let{children:t,orientation:r=W.orientation,...s}=o;return dt("div",{...s,className:i(o.className,D,{"k-hstack":r==="horizontal","k-vstack":r==="vertical"}),children:t})};y.states=mt;y.options=pt;y.className=D;y.defaultOptions=W;var j=y;var L="tabstrip",G=L;import{jsx as f,jsxs as U}from"react/jsx-runtime";var x="k-tabstrip",ut=[],ft={size:[n.small,n.medium,n.large]},T={size:n.medium,position:"top",tabAlignment:"start",scrollButtons:"around"},b=o=>{let{size:t=T.size,scrollable:r,children:s,tabStripItems:p,position:a=T.position,tabAlignment:l=T.tabAlignment,scrollButtons:c=T.scrollButtons,dir:m,scrollingPosition:h,...V}=o,M={top:{prev:m!=="rtl"?"left":"right",next:m!=="rtl"?"right":"left"},bottom:{prev:m!=="rtl"?"left":"right",next:m!=="rtl"?"right":"left"},right:{prev:"up",next:"down"},left:{prev:"up",next:"down"}},q={top:"horizontal",bottom:"horizontal",left:"vertical",right:"vertical"},J={start:"start",center:"center",end:"end",justify:"justify",stretched:"stretched"};return U("div",{dir:m,...V,className:i(x,o.className,{[`${x}-${a}`]:a,[`${x}-scrollable`]:r,[`${x}-scrollable-overlay`]:r&&(c==="hidden"||!c),[`${x}-scrollable-${h}`]:h&&h!=="both"},u(x,{size:t})),children:[a==="bottom"&&s,U(j,{orientation:q[a],children:[r&&(c==="around"||c==="start")&&f("span",{className:i("k-tabstrip-prev","k-button",u("k-button",{size:t,fillMode:g.flat,themeColor:e.base,rounded:null}),"k-icon-button"),children:f(d,{className:"k-button-icon",icon:`caret-alt-${M[a].prev}`})}),r&&c==="start"&&f("span",{className:i("k-tabstrip-next","k-button",u("k-button",{size:t,fillMode:g.flat,themeColor:e.base,rounded:null}),"k-icon-button"),children:f(d,{className:"k-button-icon",icon:`caret-alt-${M[a].next}`})}),f(F,{className:i({"k-tabstrip-items-scroll":r&&c==="hidden"}),tabAlignment:J[l],children:p}),r&&c==="end"&&f("span",{className:i("k-tabstrip-prev","k-button",u("k-button",{size:t,fillMode:g.flat,themeColor:e.base,rounded:null}),"k-icon-button"),children:f(d,{className:"k-button-icon",icon:`caret-alt-${M[a].prev}`})}),r&&(c==="around"||c==="end")&&f("span",{className:i("k-tabstrip-next","k-button",u("k-button",{size:t,fillMode:g.flat,themeColor:e.base,rounded:null}),"k-icon-button"),children:f(d,{className:"k-button-icon",icon:`caret-alt-${M[a].next}`})})]}),a!=="bottom"&&s]})};b.states=ut;b.options=ft;b.className=x;b.defaultOptions=T;b.moduleName=L;b.folderName=G;var Yt=b;export{x as TABSTRIP_CLASSNAME,b as TabStrip,Yt as default};