UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 13.3 kB
var $e=Object.create;var W=Object.defineProperty;var _e=Object.getOwnPropertyDescriptor;var Fe=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty;var Ue=(t,e)=>{for(var o in e)W(t,o,{get:e[o],enumerable:!0})},be=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Fe(e))!Ge.call(t,i)&&i!==o&&W(t,i,{get:()=>e[i],enumerable:!(r=_e(e,i))||r.enumerable});return t};var Xe=(t,e,o)=>(o=t!=null?$e(qe(t)):{},be(e||!t||!t.__esModule?W(o,"default",{value:t,enumerable:!0}):o,t)),De=t=>be(W({},"__esModule",{value:!0}),t);var Pt={};Ue(Pt,{Chat:()=>H,default:()=>Ht});module.exports=De(Pt);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((o,r)=>e[r]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var x=(t,e)=>l({[`${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"}),O=(t,e)=>l({"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 a={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},p={small:"small",medium:"medium",large:"large",full:"full"},m={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},n={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},s={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"};var E=require("react/jsx-runtime"),le="k-icon k-font-icon",Je=[],Qe={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},We={},R=t=>{let{size:e,themeColor:o,icon:r,rotate:i,flip:c,...d}=t;return r?(0,E.jsx)("span",{...d,className:l(t.className,le,x(le,{size:e}),{[`k-i-${r}`]:r,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,E.jsx)(E.Fragment,{})};R.states=Je;R.options=Qe;R.className=le;R.defaultOptions=We;var ge=R;var T=require("react/jsx-runtime"),re="k-icon k-svg-icon",Ye=[],Ze={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},ve={viewBox:"0 0 24 24"},K=t=>{let{size:e,themeColor:o,rotate:r,flip:i,viewBox:c=ve.viewBox,icon:d,...g}=t;if(!d)return(0,T.jsx)(T.Fragment,{});d==="none"&&{...g,className:l(t.className,re,"k-none")};let b=typeof d=="object"&&d.name&&d.name;return(0,T.jsx)("span",{...g,className:l(t.className,re,x("k-icon",{size:e}),{[`k-svg-i-${b}`]:b,[`k-color-${o}`]:o,[`k-rotate-${r}`]:r,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,T.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof d=="object"?d.viewBox:c,dangerouslySetInnerHTML:typeof d=="object"?{__html:d.content}:void 0,children:d?void 0:t.children})})};K.states=Ye;K.options=Ze;K.className=re;K.defaultOptions=ve;var ie=K;var Ne=Xe(require("@progress/kendo-svg-icons")),y=require("react/jsx-runtime"),je=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),et=[],tt={size:[a.xsmall,a.small,a.medium,a.large,a.xlarge,a.xxlarge,a.xxxlarge],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark]},ce={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:o,icon:r,type:i=ce.type,rotate:c,flip:d,viewBox:g=ce.viewBox,...b}=t;if(!r)return(0,y.jsx)(y.Fragment,{});if(i==="svg"){if(r==="none")return(0,y.jsx)(ie,{...b,icon:r,size:e});let I=je(`${r}-icon`);return Ne[I]?(0,y.jsx)(ie,{...b,icon:Ne[I],size:e,themeColor:o,rotate:c,flip:d,viewBox:g}):(0,y.jsx)(y.Fragment,{})}return(0,y.jsx)(ge,{...b,icon:r,size:e,themeColor:o,rotate:c,flip:d})};v.states=et;v.options=tt;v.defaultOptions=ce;var N=require("react/jsx-runtime"),Y="k-button",ot=[s.hover,s.focus,s.active,s.selected,s.disabled],nt={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline,m.clear,m.link],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark,n.inverse]},w={size:a.medium,rounded:p.medium,fillMode:m.solid,themeColor:n.base,showArrow:!1,arrowIconName:"caret-alt-down"},f=t=>{let{size:e=w.size,rounded:o=w.rounded,fillMode:r=w.fillMode,themeColor:i=w.themeColor,showArrow:c=w.showArrow,arrowIconName:d=w.arrowIconName,hover:g,focus:b,active:I,selected:M,disabled:S,icon:P,text:z,iconClassName:D,...J}=t,ae=P!==void 0,B=t.children!==void 0;return(0,N.jsxs)("button",{...J,className:l(t.className,Y,x(Y,{size:e,rounded:o,fillMode:r,themeColor:i}),O(Y,{hover:g,focus:b,active:I,disabled:S,selected:M}),{"k-icon-button":!z&&!B&&ae}),children:[P&&(0,N.jsx)(v,{className:l(D,"k-button-icon"),icon:P}),z?(0,N.jsxs)(N.Fragment,{children:[z&&(0,N.jsx)("span",{className:"k-button-text",children:z}),t.children]}):t.children&&(0,N.jsx)("span",{className:"k-button-text",children:t.children}),c&&(0,N.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,N.jsx)(v,{icon:d})})]})};f.states=ot;f.options=nt;f.className=Y;f.defaultOptions=w;var st=require("react/jsx-runtime");var at=require("react/jsx-runtime");var lt=require("react/jsx-runtime");var Ie=require("react/jsx-runtime"),Z="k-input",rt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],it={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},j={size:a.medium,rounded:a.medium,fillMode:m.solid},k=t=>{let{hover:e,focus:o,disabled:r,invalid:i,valid:c,loading:d,readonly:g,size:b=j.size,rounded:I=j.rounded,fillMode:M=j.fillMode,...S}=t;return(0,Ie.jsx)("span",{...S,className:l(t.className,Z,x(Z,{size:b,rounded:I,fillMode:M}),O(Z,{hover:e,focus:o,disabled:r,invalid:i,valid:c,loading:d,readonly:g}))})};k.states=rt;k.options=it;k.className=Z;k.defaultOptions=j;var ye=require("react/jsx-runtime"),ee="k-picker",ct=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],dt={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},te={size:a.medium,rounded:p.medium,fillMode:m.solid},oe=t=>{let{hover:e,focus:o,disabled:r,invalid:i,valid:c,loading:d,readonly:g,size:b=te.size,rounded:I=te.rounded,fillMode:M=te.fillMode,...S}=t;return(0,ye.jsx)("span",{...S,className:l(t.className,ee,x(ee,{size:b,rounded:I,fillMode:M}),O(ee,{hover:e,focus:o,disabled:r,invalid:i,valid:c,loading:d,readonly:g})),children:t.children})};oe.states=ct;oe.options=dt;oe.className=ee;oe.defaultOptions=te;var L=require("react/jsx-runtime"),ke="k-clear-value",ut=[s.disabled,s.loading,s.readonly],pt={},V=t=>{let{disabled:e,loading:o,readonly:r,value:i}=t;return e||r||o||!i?(0,L.jsx)(L.Fragment,{}):(0,L.jsx)("span",{className:l(t.className,ke),children:(0,L.jsx)(v,{icon:"x"})})};V.states=ut;V.options=pt;V.className=ke;var Me=require("react/jsx-runtime"),de="k-input-inner",mt=[],ft={},ne={type:"text",autocomplete:"off",value:"",placeholder:""},$=t=>{let{value:e=ne.value,type:o=ne.type,placeholder:r=ne.placeholder,autocomplete:i=ne.autocomplete,...c}=t;return(0,Me.jsx)("input",{...c,type:o,className:l(t.className,de,x(de,t)),placeholder:r,autoComplete:i,defaultValue:e})};$.states=mt;$.options=ft;$.className=de;var _=require("react/jsx-runtime"),ue="k-input-inner",xt=[],ht={},pe=t=>{let{value:e,placeholder:o,showValue:r,valueIcon:i,valueIconName:c,...d}=t;return(0,_.jsxs)("span",{...d,className:l(t.className,ue,x(ue,t)),children:[i,!i&&c&&(0,_.jsx)(v,{className:"k-input-value-icon",icon:c}),r&&!e&&o,r&&e&&(0,_.jsx)("span",{className:"k-input-value-text",children:e})]})};pe.states=xt;pe.options=ht;pe.className=ue;var Te=require("react/jsx-runtime"),me="k-input-inner",bt=[],gt={},Se={value:"",placeholder:""},fe=t=>{let{value:e=Se.value,placeholder:o=Se.placeholder,rows:r,...i}=t;return(0,Te.jsx)("textarea",{...i,className:l(t.className,me,x(me,t)),placeholder:o,rows:r,defaultValue:e})};fe.states=bt;fe.options=gt;fe.className=me;var F=require("react/jsx-runtime"),we="k-input-loading-icon",vt=[s.disabled,s.loading],se=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,F.jsx)(F.Fragment,{}):(0,F.jsx)("span",{className:l(t.className,we,"k-icon k-i-loading")})};se.states=vt;se.className=we;var q=require("react/jsx-runtime"),Ce="k-input-validation-icon",Nt=[s.valid,s.invalid,s.disabled,s.loading],It={},G=t=>{let{valid:e,invalid:o,disabled:r,loading:i}=t,c=o?"warning-circle":"check-circle";return r||i||!!!(e||o)?(0,q.jsx)(q.Fragment,{}):(0,q.jsx)(v,{className:l(Ce),icon:c})};G.states=Nt;G.options=It;G.className=Ce;var U=require("react/jsx-runtime"),yt="k-input-prefix",kt={direction:"horizontal"},ze=t=>{let{direction:e=kt.direction,...o}=t;return t.children?(0,U.jsx)("span",{...o,className:l(yt,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):(0,U.jsx)(U.Fragment,{})};var X=require("react/jsx-runtime"),Mt="k-input-suffix",St={direction:"horizontal"},Be=t=>{let{direction:e=St.direction,...o}=t;return t.children?(0,X.jsx)("span",{...o,className:l(Mt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,X.jsx)(X.Fragment,{})};var Tt=require("react/jsx-runtime");var wt=require("react/jsx-runtime");var Le=require("react/jsx-runtime"),Oe="k-input-separator",Ct={direction:"vertical"},xe=t=>{let{direction:e=Ct.direction,...o}=t;return(0,Le.jsx)("span",{...o,className:l(Oe,t.className,{[`${Oe}-${e}`]:e})})};var h=require("react/jsx-runtime"),Ae="k-textbox",zt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Bt={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[m.solid,m.flat,m.outline]},C={showClearButton:!0,showValidationIcon:!0,size:k.defaultOptions.size,rounded:k.defaultOptions.rounded,fillMode:k.defaultOptions.fillMode,separators:!0},A=t=>{let{size:e=C.size,rounded:o=C.rounded,fillMode:r=C.fillMode,separators:i=C.separators,showClearButton:c=C.showClearButton,showValidationIcon:d=C.showValidationIcon,prefix:g,suffix:b,type:I,value:M,placeholder:S,hover:P,focus:z,valid:D,invalid:J,required:ae,loading:B,disabled:Q,readonly:he,...Ve}=t;return(0,h.jsxs)(k,{...Ve,size:e,rounded:o,fillMode:r,hover:P,focus:z,valid:D,invalid:J,required:ae,loading:B,disabled:Q,readonly:he,className:l(t.className,Ae),children:[g&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ze,{children:g}),i&&(0,h.jsx)(xe,{})]}),(0,h.jsx)($,{placeholder:S,value:M,type:I}),d&&(0,h.jsx)(G,{valid:D,invalid:J,loading:B,disabled:Q}),(0,h.jsx)(se,{loading:B,disabled:Q}),c&&(0,h.jsx)(V,{loading:B,disabled:Q,readonly:he,value:M}),b&&(0,h.jsxs)(h.Fragment,{children:[i&&(0,h.jsx)(xe,{}),(0,h.jsx)(Be,{children:b})]})]})};A.states=zt;A.options=Bt;A.className=Ae;A.defaultOptions=C;var Ot=require("react/jsx-runtime");var Pe=require("react/jsx-runtime");var Ee=require("react/jsx-runtime");var u=require("react/jsx-runtime"),Re="k-chat",Lt=[],At={},Ke={showToolbar:!0,showMessageBox:!0,showMoreButton:!0},H=t=>{let{dir:e,showToolbar:o,showMessageBox:r=Ke.showMessageBox,showMoreButton:i,...c}=t;return(0,u.jsxs)("div",{...c,className:l(Re,t.className),dir:e,children:[(0,u.jsx)("div",{className:"k-message-list k-avatars",children:(0,u.jsx)("div",{className:"k-message-list-content",children:t.children})}),r&&(0,u.jsx)(A,{className:"k-message-box",placeholder:"Type a message...",suffix:(0,u.jsxs)(u.Fragment,{children:[i&&(0,u.jsx)(f,{fillMode:"flat",icon:"more-horizontal"}),(0,u.jsx)(f,{fillMode:"flat",icon:"paper-plane",className:"k-chat-send"})]})}),o&&(0,u.jsxs)("div",{className:"k-chat-toolbar k-toolbar",children:[(0,u.jsx)(f,{className:l("k-scroll-button","k-scroll-button-left",e==="rtl"?"":"k-hidden"),icon:"chevron-left"}),(0,u.jsxs)("div",{className:"k-toolbar-group k-button-list",children:[(0,u.jsx)(f,{icon:"arrow-rotate-cw"}),(0,u.jsx)(f,{icon:"gear"}),(0,u.jsx)(f,{icon:"wrench"}),(0,u.jsx)(f,{icon:"plus"}),(0,u.jsx)(f,{icon:"search"}),(0,u.jsx)(f,{icon:"star"}),(0,u.jsx)(f,{icon:"bell"}),(0,u.jsx)(f,{icon:"question-circle"}),(0,u.jsx)(f,{icon:"trash"})]}),(0,u.jsx)(f,{className:l("k-scroll-button","k-scroll-button-right",e==="rtl"&&"k-hidden"),icon:"chevron-right"})]})]})};H.states=Lt;H.options=At;H.className=Re;H.defaultOptions=Ke;var Ht=H;