UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.2 kB
var Ee=Object.create;var q=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,Ve=Object.prototype.hasOwnProperty;var Fe=(t,e)=>{for(var o in e)q(t,o,{get:e[o],enumerable:!0})},me=(t,e,o,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ke(e))!Ve.call(t,i)&&i!==o&&q(t,i,{get:()=>e[i],enumerable:!(l=Re(e,i))||l.enumerable});return t};var _e=(t,e,o)=>(o=t!=null?Ee($e(t)):{},me(e||!t||!t.__esModule?q(o,"default",{value:t,enumerable:!0}):o,t)),qe=t=>me(q({},"__esModule",{value:!0}),t);var Tt={};Fe(Tt,{TextareaSuffix:()=>zt});module.exports=qe(Tt);var r=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...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 m=(t,e)=>r({[`${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"}),w=(t,e)=>r({"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});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"},u={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"};var fe=require("react/jsx-runtime"),G="k-input",Ge=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Ue={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},U={size:a.medium,rounded:a.medium,fillMode:u.solid},b=t=>{let{hover:e,focus:o,disabled:l,invalid:i,valid:d,loading:c,readonly:f,size:x=U.size,rounded:N=U.rounded,fillMode:S=U.fillMode,...M}=t;return(0,fe.jsx)("span",{...M,className:r(t.className,G,m(G,{size:x,rounded:N,fillMode:S}),w(G,{hover:e,focus:o,disabled:l,invalid:i,valid:d,loading:c,readonly:f}))})};b.states=Ge;b.options=Ue;b.className=G;b.defaultOptions=U;var xe=require("react/jsx-runtime"),X="k-picker",Xe=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled,s.loading,s.readonly],Je={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},J={size:a.medium,rounded:p.medium,fillMode:u.solid},D=t=>{let{hover:e,focus:o,disabled:l,invalid:i,valid:d,loading:c,readonly:f,size:x=J.size,rounded:N=J.rounded,fillMode:S=J.fillMode,...M}=t;return(0,xe.jsx)("span",{...M,className:r(t.className,X,m(X,{size:x,rounded:N,fillMode:S}),w(X,{hover:e,focus:o,disabled:l,invalid:i,valid:d,loading:c,readonly:f})),children:t.children})};D.states=Xe;D.options=Je;D.className=X;D.defaultOptions=J;var H=require("react/jsx-runtime"),te="k-icon k-font-icon",De=[],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={},P=t=>{let{size:e,themeColor:o,icon:l,rotate:i,flip:d,...c}=t;return l?(0,H.jsx)("span",{...c,className:r(t.className,te,m(te,{size:e}),{[`k-i-${l}`]:l,[`k-color-${o}`]:o,[`k-rotate-${i}`]:i,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):(0,H.jsx)(H.Fragment,{})};P.states=De;P.options=Qe;P.className=te;P.defaultOptions=We;var he=P;var z=require("react/jsx-runtime"),oe="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"},B=t=>{let{size:e,themeColor:o,rotate:l,flip:i,viewBox:d=ve.viewBox,icon:c,...f}=t;if(!c)return(0,z.jsx)(z.Fragment,{});c==="none"&&{...f,className:r(t.className,oe,"k-none")};let x=typeof c=="object"&&c.name&&c.name;return(0,z.jsx)("span",{...f,className:r(t.className,oe,m("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${o}`]:o,[`k-rotate-${l}`]:l,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,z.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof c=="object"?c.viewBox:d,dangerouslySetInnerHTML:typeof c=="object"?{__html:c.content}:void 0,children:c?void 0:t.children})})};B.states=Ye;B.options=Ze;B.className=oe;B.defaultOptions=ve;var ne=B;var Ne=_e(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]},ae={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:o,icon:l,type:i=ae.type,rotate:d,flip:c,viewBox:f=ae.viewBox,...x}=t;if(!l)return(0,y.jsx)(y.Fragment,{});if(i==="svg"){if(l==="none")return(0,y.jsx)(ne,{...x,icon:l,size:e});let N=je(`${l}-icon`);return Ne[N]?(0,y.jsx)(ne,{...x,icon:Ne[N],size:e,themeColor:o,rotate:d,flip:c,viewBox:f}):(0,y.jsx)(y.Fragment,{})}return(0,y.jsx)(he,{...x,icon:l,size:e,themeColor:o,rotate:d,flip:c})};v.states=et;v.options=tt;v.defaultOptions=ae;var O=require("react/jsx-runtime"),Ie="k-clear-value",ot=[s.disabled,s.loading,s.readonly],nt={},se=t=>{let{disabled:e,loading:o,readonly:l,value:i}=t;return e||l||o||!i?(0,O.jsx)(O.Fragment,{}):(0,O.jsx)("span",{className:r(t.className,Ie),children:(0,O.jsx)(v,{icon:"x"})})};se.states=ot;se.options=nt;se.className=Ie;var be=require("react/jsx-runtime"),re="k-input-inner",at=[],st={},Q={type:"text",autocomplete:"off",value:"",placeholder:""},le=t=>{let{value:e=Q.value,type:o=Q.type,placeholder:l=Q.placeholder,autocomplete:i=Q.autocomplete,...d}=t;return(0,be.jsx)("input",{...d,type:o,className:r(t.className,re,m(re,t)),placeholder:l,autoComplete:i,defaultValue:e})};le.states=at;le.options=st;le.className=re;var E=require("react/jsx-runtime"),ie="k-input-inner",rt=[],lt={},ce=t=>{let{value:e,placeholder:o,showValue:l,valueIcon:i,valueIconName:d,...c}=t;return(0,E.jsxs)("span",{...c,className:r(t.className,ie,m(ie,t)),children:[i,!i&&d&&(0,E.jsx)(v,{className:"k-input-value-icon",icon:d}),l&&!e&&o,l&&e&&(0,E.jsx)("span",{className:"k-input-value-text",children:e})]})};ce.states=rt;ce.options=lt;ce.className=ie;var ge=require("react/jsx-runtime"),de="k-input-inner",it=[],ct={},ye={value:"",placeholder:""},R=t=>{let{value:e=ye.value,placeholder:o=ye.placeholder,rows:l,...i}=t;return(0,ge.jsx)("textarea",{...i,className:r(t.className,de,m(de,t)),placeholder:o,rows:l,defaultValue:e})};R.states=it;R.options=ct;R.className=de;var K=require("react/jsx-runtime"),ke="k-input-loading-icon",dt=[s.disabled,s.loading],Se=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,K.jsx)(K.Fragment,{}):(0,K.jsx)("span",{className:r(t.className,ke,"k-icon k-i-loading")})};Se.states=dt;Se.className=ke;var $=require("react/jsx-runtime"),Me="k-input-validation-icon",pt=[s.valid,s.invalid,s.disabled,s.loading],ut={},pe=t=>{let{valid:e,invalid:o,disabled:l,loading:i}=t,d=o?"warning-circle":"check-circle";return l||i||!!!(e||o)?(0,$.jsx)($.Fragment,{}):(0,$.jsx)(v,{className:r(Me),icon:d})};pe.states=pt;pe.options=ut;pe.className=Me;var V=require("react/jsx-runtime"),mt="k-input-prefix",ft={direction:"horizontal"},ze=t=>{let{direction:e=ft.direction,...o}=t;return t.children?(0,V.jsx)("span",{...o,className:r(mt,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):(0,V.jsx)(V.Fragment,{})};var F=require("react/jsx-runtime"),xt="k-input-suffix",ht={direction:"horizontal"},Te=t=>{let{direction:e=ht.direction,...o}=t;return t.children?(0,F.jsx)("span",{...o,className:r(xt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,F.jsx)(F.Fragment,{})};var vt=require("react/jsx-runtime");var Nt=require("react/jsx-runtime");var we=require("react/jsx-runtime"),Ce="k-input-separator",It={direction:"vertical"},ue=t=>{let{direction:e=It.direction,...o}=t;return(0,we.jsx)("span",{...o,className:r(Ce,t.className,{[`${Ce}-${e}`]:e})})};var h=require("react/jsx-runtime"),Oe="k-textarea",bt=[s.hover,s.focus,s.valid,s.invalid,s.required,s.disabled],yt={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},g={size:b.defaultOptions.size,rounded:b.defaultOptions.rounded,fillMode:b.defaultOptions.fillMode,flow:"vertical",affixesOrientation:"horizontal",resize:"both",separators:!0},_=t=>{let{size:e=g.size,rounded:o=g.rounded,fillMode:l=g.fillMode,separators:i=g.separators,affixesOrientation:d=g.affixesOrientation,flow:c=g.flow,resize:f=g.resize,prefix:x,suffix:N,rows:S,value:M,placeholder:A,hover:C,focus:Y,valid:Z,invalid:j,required:ee,disabled:Pe,...Be}=t;return(0,h.jsxs)(b,{...Be,size:e,rounded:o,fillMode:l,hover:C,focus:Y,valid:Z,invalid:j,required:ee,disabled:Pe,className:r(t.className,Oe,{"!k-flex-col":c==="vertical","!k-flex-row":c==="horizontal"}),children:[x&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ze,{className:r({"!k-align-items-start":c===d}),direction:d,children:x}),i&&(0,h.jsx)(ue,{direction:c==="horizontal"?"vertical":"horizontal"})]}),(0,h.jsx)(R,{className:r("!k-overflow-auto",{"!k-flex-none":c==="vertical","k-resize-x":f==="x","k-resize-y":f==="y","k-resize":f==="both","k-resize-none":f==="none"}),value:M,placeholder:A,rows:S}),N&&(0,h.jsxs)(h.Fragment,{children:[i&&(0,h.jsx)(ue,{direction:c==="horizontal"?"vertical":"horizontal"}),(0,h.jsx)(Te,{className:r({"!k-align-items-start":c===d}),direction:d,children:N})]})]})};_.states=bt;_.options=yt;_.className=Oe;_.defaultOptions=g;var Le=_;var I=require("react/jsx-runtime"),W="k-button",gt=[s.hover,s.focus,s.active,s.selected,s.disabled],kt={size:[a.small,a.medium,a.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[n.base,n.primary,n.secondary,n.tertiary,n.success,n.warning,n.error,n.info,n.light,n.dark,n.inverse]},T={size:a.medium,rounded:p.medium,fillMode:u.solid,themeColor:n.base,showArrow:!1,arrowIconName:"caret-alt-down"},k=t=>{let{size:e=T.size,rounded:o=T.rounded,fillMode:l=T.fillMode,themeColor:i=T.themeColor,showArrow:d=T.showArrow,arrowIconName:c=T.arrowIconName,hover:f,focus:x,active:N,selected:S,disabled:M,icon:A,text:C,iconClassName:Y,...Z}=t,j=A!==void 0,ee=t.children!==void 0;return(0,I.jsxs)("button",{...Z,className:r(t.className,W,m(W,{size:e,rounded:o,fillMode:l,themeColor:i}),w(W,{hover:f,focus:x,active:N,disabled:M,selected:S}),{"k-icon-button":!C&&!ee&&j}),children:[A&&(0,I.jsx)(v,{className:r(Y,"k-button-icon"),icon:A}),C?(0,I.jsxs)(I.Fragment,{children:[C&&(0,I.jsx)("span",{className:"k-button-text",children:C}),t.children]}):t.children&&(0,I.jsx)("span",{className:"k-button-text",children:t.children}),d&&(0,I.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,I.jsx)(v,{icon:c})})]})};k.states=gt;k.options=kt;k.className=W;k.defaultOptions=T;var He=require("react/jsx-runtime"),Ae=t=>(0,He.jsx)(k,{icon:"folder",...t,children:void 0});var St=require("react/jsx-runtime");var Mt=require("react/jsx-runtime");var L=require("react/jsx-runtime"),zt=t=>(0,L.jsx)(Le,{suffix:(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(Ae,{icon:"volume-up",fillMode:"clear"})}),...t});