UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 7.57 kB
var l=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?l(...t):typeof t=="object"?Object.keys(t).map((r,i)=>t[i]||t[r]&&r||null).filter(r=>r!==null).join(" "):t).filter(t=>!!t).join(" ");var b=(e,t)=>l({[`${e}-xs`]:t.size==="xsmall",[`${e}-sm`]:t.size==="small",[`${e}-md`]:t.size==="medium",[`${e}-lg`]:t.size==="large",[`${e}-xl`]:t.size==="xlarge",[`${e}-xxl`]:t.size==="xxlarge",[`${e}-xxxl`]:t.size==="xxxlarge"},{[`${e}-${t.fillMode}`]:t.fillMode},{[`${e}-${t.fillMode}-${t.themeColor}`]:t.fillMode&&t.themeColor},{[`${e}-${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"}),v=(e,t)=>l({"k-valid":t.valid,"k-invalid":t.invalid,"k-hover":t.hover,"k-focus":t.focus,"k-checked":t.checked,"k-active":t.active,"k-selected":t.selected,"k-disabled":t.disabled,"k-indeterminate":t.indeterminate&&!t.checked,"k-loading":t.loading,"k-empty":t.empty,"k-readonly":t.readonly,"k-highlighted":t.highlighted});var n={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},p={small:"small",medium:"medium",large:"large",full:"full"},d={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"},a={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"};import{Fragment as nt,jsx as R}from"react/jsx-runtime";var L="k-icon k-font-icon",tt=[],ot={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},et={},S=e=>{let{size:t,themeColor:r,icon:i,rotate:m,flip:c,...s}=e;return i?R("span",{...s,className:l(e.className,L,b(L,{size:t}),{[`k-i-${i}`]:i,[`k-color-${r}`]:r,[`k-rotate-${m}`]:m,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):R(nt,{})};S.states=tt;S.options=ot;S.className=L;S.defaultOptions=et;var _=S;import{Fragment as rt,jsx as z}from"react/jsx-runtime";var $="k-icon k-svg-icon",it=[],st={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},G={viewBox:"0 0 24 24"},C=e=>{let{size:t,themeColor:r,rotate:i,flip:m,viewBox:c=G.viewBox,icon:s,...f}=e;if(!s)return z(rt,{});s==="none"&&{...f,className:l(e.className,$,"k-none")};let u=typeof s=="object"&&s.name&&s.name;return z("span",{...f,className:l(e.className,$,b("k-icon",{size:t}),{[`k-svg-i-${u}`]:u,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"}),children:z("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof s=="object"?s.viewBox:c,dangerouslySetInnerHTML:typeof s=="object"?{__html:s.content}:void 0,children:s?void 0:e.children})})};C.states=it;C.options=st;C.className=$;C.defaultOptions=G;var H=C;import*as V from"@progress/kendo-svg-icons";import{Fragment as U,jsx as I}from"react/jsx-runtime";var lt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),at=[],ct={size:[n.xsmall,n.small,n.medium,n.large,n.xlarge,n.xxlarge,n.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},E={viewBox:"0 0 24 24",type:"svg"},x=e=>{let{size:t,themeColor:r,icon:i,type:m=E.type,rotate:c,flip:s,viewBox:f=E.viewBox,...u}=e;if(!i)return I(U,{});if(m==="svg"){if(i==="none")return I(H,{...u,icon:i,size:t});let k=lt(`${i}-icon`);return V[k]?I(H,{...u,icon:V[k],size:t,themeColor:r,rotate:c,flip:s,viewBox:f}):I(U,{})}return I(_,{...u,icon:i,size:t,themeColor:r,rotate:c,flip:s})};x.states=at;x.options=ct;x.defaultOptions=E;import{Fragment as ut,jsx as F,jsxs as q}from"react/jsx-runtime";var w="k-button",mt=[a.hover,a.focus,a.active,a.selected,a.disabled],dt={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[d.solid,d.flat,d.outline,d.clear,d.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},y={size:n.medium,rounded:p.medium,fillMode:d.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},g=e=>{let{size:t=y.size,rounded:r=y.rounded,fillMode:i=y.fillMode,themeColor:m=y.themeColor,showArrow:c=y.showArrow,arrowIconName:s=y.arrowIconName,hover:f,focus:u,active:k,selected:T,disabled:K,icon:N,text:B,iconClassName:P,...Y}=e,Z=N!==void 0,j=e.children!==void 0;return q("button",{...Y,className:l(e.className,w,b(w,{size:t,rounded:r,fillMode:i,themeColor:m}),v(w,{hover:f,focus:u,active:k,disabled:K,selected:T}),{"k-icon-button":!B&&!j&&Z}),children:[N&&F(x,{className:l(P,"k-button-icon"),icon:N}),B?q(ut,{children:[B&&F("span",{className:"k-button-text",children:B}),e.children]}):e.children&&F("span",{className:"k-button-text",children:e.children}),c&&F("span",{className:"k-menu-button-arrow k-button-arrow",children:F(x,{icon:s})})]})};g.states=mt;g.options=dt;g.className=w;g.defaultOptions=y;import{jsx as Wt}from"react/jsx-runtime";import{jsx as jt}from"react/jsx-runtime";import{jsx as no}from"react/jsx-runtime";import{jsx as D,jsxs as xt}from"react/jsx-runtime";var O="k-fab",pt=[a.hover,a.focus,a.active,a.selected,a.disabled],ft={size:[n.small,n.medium,n.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[d.solid,d.flat,d.outline,d.clear,d.link],themeColor:[o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},A={size:n.medium,rounded:p.full,fillMode:d.solid,themeColor:o.primary,type:"button"},h=e=>{let{size:t=A.size,rounded:r=A.rounded,fillMode:i=A.fillMode,themeColor:m=A.themeColor,text:c,icon:s,type:f=A.type,position:u,hover:k,focus:T,active:K,selected:N,disabled:B,...P}=e;return xt("button",{...P,type:f,className:l(e.className,O,b(O,{size:t,rounded:r,fillMode:i,themeColor:m}),v(O,{hover:k,focus:T,active:K,disabled:B,selected:N}),{[`!k-pos-absolute k-${u}`]:u}),children:[s&&D(x,{className:"k-fab-icon",icon:s}),c&&D("span",{className:"k-fab-text",children:c})]})};h.states=pt;h.options=ft;h.className=O;h.defaultOptions=A;import{jsx as ho}from"react/jsx-runtime";import{jsx as Q,jsxs as bt}from"react/jsx-runtime";var J="k-fab-item",gt=[a.hover,a.focus,a.active,a.disabled],ht=e=>{let{text:t,icon:r,align:i,hover:m,focus:c,active:s,disabled:f,...u}=e;return bt("li",{...u,className:l(e.className,J,{[`k-text-${i}`]:i},v(J,{hover:m,focus:c,active:s,disabled:f})),children:[Q("span",{className:"k-fab-item-text",children:t}),Q(x,{className:"k-fab-item-icon",icon:r})]})};ht.states=gt;import{jsx as So}from"react/jsx-runtime";import{jsx as Mo}from"react/jsx-runtime";import{jsx as To}from"react/jsx-runtime";import{jsx as yt}from"react/jsx-runtime";var W="k-prompt-stop-fab",X={generating:!0},M=e=>{let{generating:t=X.generating,icon:r,...i}=e;return yt(h,{...i,className:l(e.className,W,{"k-generating":t}),style:{bottom:"16px",right:"16px"},position:"bottom-end",icon:t?"stop-sm":r,active:t})};M.states=g.states;M.options=g.options;M.className=W;M.defaultOptions=X;var Wo=M;export{M as PromptStopFloatingActionButton,Wo as default};