@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 16.6 kB
JavaScript
var it=Object.create;var ae=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty;var mt=(t,e)=>{for(var o in e)ae(t,o,{get:e[o],enumerable:!0})},He=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of dt(e))!ut.call(t,i)&&i!==o&&ae(t,i,{get:()=>e[i],enumerable:!(l=ct(e,i))||l.enumerable});return t};var ft=(t,e,o)=>(o=t!=null?it(pt(t)):{},He(e||!t||!t.__esModule?ae(o,"default",{value:t,enumerable:!0}):o,t)),ht=t=>He(ae({},"__esModule",{value:!0}),t);var vo={};mt(vo,{ChatNormal:()=>bo});module.exports=ht(vo);var n=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((o,l)=>e[l]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(t,e)=>n({[`${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"}),N=(t,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"},p={small:"small",medium:"medium",large:"large",full:"full"},u={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},s={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"};var F=require("react/jsx-runtime"),be="k-icon k-font-icon",xt=[],gt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},bt={},q=t=>{let{size:e,themeColor:o,icon:l,rotate:i,flip:c,...d}=t;return l?(0,F.jsx)("span",{...d,className:n(t.className,be,h(be,{size:e}),{[`k-i-${l}`]:l,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,F.jsx)(F.Fragment,{})};q.states=xt;q.options=gt;q.className=be;q.defaultOptions=bt;var Ee=q;var L=require("react/jsx-runtime"),ve="k-icon k-svg-icon",vt=[],yt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},Ke={viewBox:"0 0 24 24"},U=t=>{let{size:e,themeColor:o,rotate:l,flip:i,viewBox:c=Ke.viewBox,icon:d,...g}=t;if(!d)return(0,L.jsx)(L.Fragment,{});d==="none"&&{...g,className:n(t.className,ve,"k-none")};let b=typeof d=="object"&&d.name&&d.name;return(0,L.jsx)("span",{...g,className:n(t.className,ve,h("k-icon",{size:e}),{[`k-svg-i-${b}`]:b,[`k-color-${o}`]:o,[`k-rotate-${l}`]:l,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,L.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})})};U.states=vt;U.options=yt;U.className=ve;U.defaultOptions=Ke;var ye=U;var Pe=ft(require("@progress/kendo-svg-icons")),S=require("react/jsx-runtime"),Nt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Mt=[],kt={size:[r.xsmall,r.small,r.medium,r.large,r.xlarge,r.xxlarge,r.xxxlarge],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark]},Ne={viewBox:"0 0 24 24",type:"svg"},y=t=>{let{size:e,themeColor:o,icon:l,type:i=Ne.type,rotate:c,flip:d,viewBox:g=Ne.viewBox,...b}=t;if(!l)return(0,S.jsx)(S.Fragment,{});if(i==="svg"){if(l==="none")return(0,S.jsx)(ye,{...b,icon:l,size:e});let C=Nt(`${l}-icon`);return Pe[C]?(0,S.jsx)(ye,{...b,icon:Pe[C],size:e,themeColor:o,rotate:c,flip:d,viewBox:g}):(0,S.jsx)(S.Fragment,{})}return(0,S.jsx)(Ee,{...b,icon:l,size:e,themeColor:o,rotate:c,flip:d})};y.states=Mt;y.options=kt;y.defaultOptions=Ne;var M=require("react/jsx-runtime"),ne="k-button",It=[a.hover,a.focus,a.active,a.selected,a.disabled],Ct={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark,s.inverse]},O={size:r.medium,rounded:p.medium,fillMode:u.solid,themeColor:s.base,showArrow:!1,arrowIconName:"caret-alt-down"},f=t=>{let{size:e=O.size,rounded:o=O.rounded,fillMode:l=O.fillMode,themeColor:i=O.themeColor,showArrow:c=O.showArrow,arrowIconName:d=O.arrowIconName,hover:g,focus:b,active:C,selected:w,disabled:z,icon:$,text:H,iconClassName:te,...oe}=t,ge=$!==void 0,E=t.children!==void 0;return(0,M.jsxs)("button",{...oe,className:n(t.className,ne,h(ne,{size:e,rounded:o,fillMode:l,themeColor:i}),N(ne,{hover:g,focus:b,active:C,disabled:z,selected:w}),{"k-icon-button":!H&&!E&&ge}),children:[$&&(0,M.jsx)(y,{className:n(te,"k-button-icon"),icon:$}),H?(0,M.jsxs)(M.Fragment,{children:[H&&(0,M.jsx)("span",{className:"k-button-text",children:H}),t.children]}):t.children&&(0,M.jsx)("span",{className:"k-button-text",children:t.children}),c&&(0,M.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,M.jsx)(y,{icon:d})})]})};f.states=It;f.options=Ct;f.className=ne;f.defaultOptions=O;var St=require("react/jsx-runtime");var Tt=require("react/jsx-runtime");var wt=require("react/jsx-runtime");var Re=require("react/jsx-runtime"),re="k-input",At=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],zt={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},le={size:r.medium,rounded:r.medium,fillMode:u.solid},T=t=>{let{hover:e,focus:o,disabled:l,invalid:i,valid:c,loading:d,readonly:g,size:b=le.size,rounded:C=le.rounded,fillMode:w=le.fillMode,...z}=t;return(0,Re.jsx)("span",{...z,className:n(t.className,re,h(re,{size:b,rounded:C,fillMode:w}),N(re,{hover:e,focus:o,disabled:l,invalid:i,valid:c,loading:d,readonly:g}))})};T.states=At;T.options=zt;T.className=re;T.defaultOptions=le;var Ve=require("react/jsx-runtime"),ie="k-picker",Lt=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],Ot={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},ce={size:r.medium,rounded:p.medium,fillMode:u.solid},de=t=>{let{hover:e,focus:o,disabled:l,invalid:i,valid:c,loading:d,readonly:g,size:b=ce.size,rounded:C=ce.rounded,fillMode:w=ce.fillMode,...z}=t;return(0,Ve.jsx)("span",{...z,className:n(t.className,ie,h(ie,{size:b,rounded:C,fillMode:w}),N(ie,{hover:e,focus:o,disabled:l,invalid:i,valid:c,loading:d,readonly:g})),children:t.children})};de.states=Lt;de.options=Ot;de.className=ie;de.defaultOptions=ce;var K=require("react/jsx-runtime"),Ge="k-clear-value",_t=[a.disabled,a.loading,a.readonly],Bt={},D=t=>{let{disabled:e,loading:o,readonly:l,value:i}=t;return e||l||o||!i?(0,K.jsx)(K.Fragment,{}):(0,K.jsx)("span",{className:n(t.className,Ge),children:(0,K.jsx)(y,{icon:"x"})})};D.states=_t;D.options=Bt;D.className=Ge;var $e=require("react/jsx-runtime"),Me="k-input-inner",Ht=[],Et={},pe={type:"text",autocomplete:"off",value:"",placeholder:""},Q=t=>{let{value:e=pe.value,type:o=pe.type,placeholder:l=pe.placeholder,autocomplete:i=pe.autocomplete,...c}=t;return(0,$e.jsx)("input",{...c,type:o,className:n(t.className,Me,h(Me,t)),placeholder:l,autoComplete:i,defaultValue:e})};Q.states=Ht;Q.options=Et;Q.className=Me;var X=require("react/jsx-runtime"),ke="k-input-inner",Kt=[],Pt={},Ie=t=>{let{value:e,placeholder:o,showValue:l,valueIcon:i,valueIconName:c,...d}=t;return(0,X.jsxs)("span",{...d,className:n(t.className,ke,h(ke,t)),children:[i,!i&&c&&(0,X.jsx)(y,{className:"k-input-value-icon",icon:c}),l&&!e&&o,l&&e&&(0,X.jsx)("span",{className:"k-input-value-text",children:e})]})};Ie.states=Kt;Ie.options=Pt;Ie.className=ke;var qe=require("react/jsx-runtime"),Ce="k-input-inner",Rt=[],Vt={},Fe={value:"",placeholder:""},Se=t=>{let{value:e=Fe.value,placeholder:o=Fe.placeholder,rows:l,...i}=t;return(0,qe.jsx)("textarea",{...i,className:n(t.className,Ce,h(Ce,t)),placeholder:o,rows:l,defaultValue:e})};Se.states=Rt;Se.options=Vt;Se.className=Ce;var J=require("react/jsx-runtime"),Ue="k-input-loading-icon",Gt=[a.disabled,a.loading],ue=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,J.jsx)(J.Fragment,{}):(0,J.jsx)("span",{className:n(t.className,Ue,"k-icon k-i-loading")})};ue.states=Gt;ue.className=Ue;var W=require("react/jsx-runtime"),De="k-input-validation-icon",$t=[a.valid,a.invalid,a.disabled,a.loading],Ft={},Y=t=>{let{valid:e,invalid:o,disabled:l,loading:i}=t,c=o?"warning-circle":"check-circle";return l||i||!!!(e||o)?(0,W.jsx)(W.Fragment,{}):(0,W.jsx)(y,{className:n(De),icon:c})};Y.states=$t;Y.options=Ft;Y.className=De;var Z=require("react/jsx-runtime"),qt="k-input-prefix",Ut={direction:"horizontal"},Qe=t=>{let{direction:e=Ut.direction,...o}=t;return t.children?(0,Z.jsx)("span",{...o,className:n(qt,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):(0,Z.jsx)(Z.Fragment,{})};var j=require("react/jsx-runtime"),Dt="k-input-suffix",Qt={direction:"horizontal"},Xe=t=>{let{direction:e=Qt.direction,...o}=t;return t.children?(0,j.jsx)("span",{...o,className:n(Dt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,j.jsx)(j.Fragment,{})};var Xt=require("react/jsx-runtime");var Jt=require("react/jsx-runtime");var We=require("react/jsx-runtime"),Je="k-input-separator",Wt={direction:"vertical"},Te=t=>{let{direction:e=Wt.direction,...o}=t;return(0,We.jsx)("span",{...o,className:n(Je,t.className,{[`${Je}-${e}`]:e})})};var x=require("react/jsx-runtime"),Ye="k-textbox",Yt=[a.hover,a.focus,a.valid,a.invalid,a.required,a.disabled,a.loading,a.readonly],Zt={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},_={showClearButton:!0,showValidationIcon:!0,size:T.defaultOptions.size,rounded:T.defaultOptions.rounded,fillMode:T.defaultOptions.fillMode,separators:!0},P=t=>{let{size:e=_.size,rounded:o=_.rounded,fillMode:l=_.fillMode,separators:i=_.separators,showClearButton:c=_.showClearButton,showValidationIcon:d=_.showValidationIcon,prefix:g,suffix:b,type:C,value:w,placeholder:z,hover:$,focus:H,valid:te,invalid:oe,required:ge,loading:E,disabled:se,readonly:Be,...lt}=t;return(0,x.jsxs)(T,{...lt,size:e,rounded:o,fillMode:l,hover:$,focus:H,valid:te,invalid:oe,required:ge,loading:E,disabled:se,readonly:Be,className:n(t.className,Ye),children:[g&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Qe,{children:g}),i&&(0,x.jsx)(Te,{})]}),(0,x.jsx)(Q,{placeholder:z,value:w,type:C}),d&&(0,x.jsx)(Y,{valid:te,invalid:oe,loading:E,disabled:se}),(0,x.jsx)(ue,{loading:E,disabled:se}),c&&(0,x.jsx)(D,{loading:E,disabled:se,readonly:Be,value:w}),b&&(0,x.jsxs)(x.Fragment,{children:[i&&(0,x.jsx)(Te,{}),(0,x.jsx)(Xe,{children:b})]})]})};P.states=Yt;P.options=Zt;P.className=Ye;P.defaultOptions=_;var jt=require("react/jsx-runtime");var je=require("react/jsx-runtime");var et=require("react/jsx-runtime");var m=require("react/jsx-runtime"),tt="k-chat",eo=[],to={},ot={showToolbar:!0,showMessageBox:!0,showMoreButton:!0},A=t=>{let{dir:e,showToolbar:o,showMessageBox:l=ot.showMessageBox,showMoreButton:i,...c}=t;return(0,m.jsxs)("div",{...c,className:n(tt,t.className),dir:e,children:[(0,m.jsx)("div",{className:"k-message-list k-avatars",children:(0,m.jsx)("div",{className:"k-message-list-content",children:t.children})}),l&&(0,m.jsx)(P,{className:"k-message-box",placeholder:"Type a message...",suffix:(0,m.jsxs)(m.Fragment,{children:[i&&(0,m.jsx)(f,{fillMode:"flat",icon:"more-horizontal"}),(0,m.jsx)(f,{fillMode:"flat",icon:"paper-plane",className:"k-chat-send"})]})}),o&&(0,m.jsxs)("div",{className:"k-chat-toolbar k-toolbar",children:[(0,m.jsx)(f,{className:n("k-scroll-button","k-scroll-button-left",e==="rtl"?"":"k-hidden"),icon:"chevron-left"}),(0,m.jsxs)("div",{className:"k-toolbar-group k-button-list",children:[(0,m.jsx)(f,{icon:"arrow-rotate-cw"}),(0,m.jsx)(f,{icon:"gear"}),(0,m.jsx)(f,{icon:"wrench"}),(0,m.jsx)(f,{icon:"plus"}),(0,m.jsx)(f,{icon:"search"}),(0,m.jsx)(f,{icon:"star"}),(0,m.jsx)(f,{icon:"bell"}),(0,m.jsx)(f,{icon:"question-circle"}),(0,m.jsx)(f,{icon:"trash"})]}),(0,m.jsx)(f,{className:n("k-scroll-button","k-scroll-button-right",e==="rtl"&&"k-hidden"),icon:"chevron-right"})]})]})};A.states=eo;A.options=to;A.className=tt;A.defaultOptions=ot;var R=require("react/jsx-runtime"),we="k-message",oo=[a.selected],so={},me={time:"Thu Feb 08 2018",text:"How can I help you?",status:"Seen"},k=t=>{let{time:e=me.time,text:o=me.text,status:l=me.status,selected:i,...c}=t;return(0,R.jsxs)("div",{...c,className:n(we,t.className,N(we,{selected:i})),children:[(0,R.jsx)("time",{className:"k-message-time",children:e}),(0,R.jsx)("div",{className:"k-chat-bubble",children:o}),(0,R.jsx)("span",{className:"k-message-status",children:l})]})};k.states=oo;k.options=so;k.className=we;k.defaultOptions=me;var Ae=require("react/jsx-runtime"),ee="k-avatar";var ao=[a.hover,a.focus,a.active,a.selected,a.disabled],no={size:[r.small,r.medium,r.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline],themeColor:[s.base,s.primary,s.secondary,s.tertiary,s.success,s.warning,s.error,s.info,s.light,s.dark,s.inverse]},B={type:"text",size:r.medium,rounded:p.full,fillMode:u.solid,themeColor:s.primary,border:!1},V=t=>{let{size:e=B.size,rounded:o=B.rounded,fillMode:l=B.fillMode,themeColor:i=B.themeColor,type:c=B.type,border:d=B.border,...g}=t;return(0,Ae.jsx)("div",{...g,className:n(t.className,ee,h(ee,{size:e,rounded:o,fillMode:l,themeColor:i}),{[`${ee}-bordered`]:d}),children:(0,Ae.jsx)("span",{className:`${ee}-${c}`,children:t.children})})};V.states=ao;V.options=no;V.className=ee;V.defaultOptions=B;var ro=require("react/jsx-runtime");var lo=require("react/jsx-runtime");var io=require("react/jsx-runtime");var G=require("react/jsx-runtime"),ze="k-message-group",co=[a.selected],po={},fe={author:"Bruv",avatar:"/packages/html/assets/avatar.jpg",alt:!1},I=t=>{let{alt:e=fe.alt,author:o=fe.author,avatar:l=fe.avatar,selected:i,...c}=t;return(0,G.jsxs)("div",{...c,className:n(ze,t.className,N(ze,{selected:i}),{"k-alt":e,"k-no-avatar":!l}),children:[o&&(0,G.jsx)("p",{className:"k-author",children:o}),l&&(0,G.jsx)(V,{type:"image",children:(0,G.jsx)("img",{src:l})}),t.children]})};I.states=co;I.options=po;I.className=ze;I.defaultOptions=fe;var nt=require("react/jsx-runtime"),at="k-quick-replies",uo=[],mo={},fo={},he=t=>{let{...e}=t;return(0,nt.jsx)("div",{...e,className:n(at,t.className),children:t.children})};he.states=uo;he.options=mo;he.className=at;he.defaultOptions=fo;var rt=require("react/jsx-runtime"),Le="k-quick-reply",ho=[a.focus,a.hover],xo={},go={},xe=t=>{let{focus:e,hover:o,text:l}=t;return(0,rt.jsx)("span",{className:n(Le,N(Le,{focus:e,hover:o})),children:l})};xe.states=ho;xe.options=xo;xe.className=Le;xe.defaultOptions=go;var Oe=require("react/jsx-runtime");var _e=require("react/jsx-runtime");var v=require("react/jsx-runtime"),bo=t=>(0,v.jsx)(A,{children:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{className:"k-timestamp",children:"Day, Month 7, 2023"}),(0,v.jsx)(I,{children:(0,v.jsx)(k,{className:"k-only"})}),(0,v.jsx)(I,{alt:!0,children:(0,v.jsx)(k,{className:"k-only"})}),(0,v.jsx)(I,{children:(0,v.jsx)(k,{className:"k-only",text:"Very long message text that tests message overflowing behavior. Very long message text that tests message overflowing behavior."})}),(0,v.jsx)(I,{alt:!0,children:(0,v.jsx)(k,{className:"k-only",text:"Unusually_long_word_that_tests_word_break_behavior__unusually_long_word_that_tests_word_break_behavior"})})]}),...t});