UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 12.9 kB
var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((n,i)=>e[i]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var m=(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"}),k=(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 s={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"},a={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},o={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 qe,jsx as xe}from"react/jsx-runtime";var ee="k-icon k-font-icon",$e=[],_e={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},Fe={},A=t=>{let{size:e,themeColor:n,icon:i,rotate:r,flip:d,...c}=t;return i?xe("span",{...c,className:l(t.className,ee,m(ee,{size:e}),{[`k-i-${i}`]:i,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":d==="h"||d==="both","k-flip-v":d==="v"||d==="both"})}):xe(qe,{})};A.states=$e;A.options=_e;A.className=ee;A.defaultOptions=Fe;var he=A;import{Fragment as Xe,jsx as G}from"react/jsx-runtime";var te="k-icon k-svg-icon",Ge=[],Ue={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},ve={viewBox:"0 0 24 24"},P=t=>{let{size:e,themeColor:n,rotate:i,flip:r,viewBox:d=ve.viewBox,icon:c,...f}=t;if(!c)return G(Xe,{});c==="none"&&{...f,className:l(t.className,te,"k-none")};let x=typeof c=="object"&&c.name&&c.name;return G("span",{...f,className:l(t.className,te,m("k-icon",{size:e}),{[`k-svg-i-${x}`]:x,[`k-color-${n}`]:n,[`k-rotate-${i}`]:i,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:G("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})})};P.states=Ge;P.options=Ue;P.className=te;P.defaultOptions=ve;var oe=P;import*as ge from"@progress/kendo-svg-icons";import{Fragment as be,jsx as B}from"react/jsx-runtime";var De=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Je=[],Qe={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark]},ne={viewBox:"0 0 24 24",type:"svg"},h=t=>{let{size:e,themeColor:n,icon:i,type:r=ne.type,rotate:d,flip:c,viewBox:f=ne.viewBox,...x}=t;if(!i)return B(be,{});if(r==="svg"){if(i==="none")return B(oe,{...x,icon:i,size:e});let v=De(`${i}-icon`);return ge[v]?B(oe,{...x,icon:ge[v],size:e,themeColor:n,rotate:d,flip:c,viewBox:f}):B(be,{})}return B(he,{...x,icon:i,size:e,themeColor:n,rotate:d,flip:c})};h.states=Je;h.options=Qe;h.defaultOptions=ne;import{Fragment as Ze,jsx as H,jsxs as Ne}from"react/jsx-runtime";var U="k-button",We=[o.hover,o.focus,o.active,o.selected,o.disabled],Ye={size:[s.small,s.medium,s.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[a.base,a.primary,a.secondary,a.tertiary,a.success,a.warning,a.error,a.info,a.light,a.dark,a.inverse]},T={size:s.medium,rounded:p.medium,fillMode:u.solid,themeColor:a.base,showArrow:!1,arrowIconName:"caret-alt-down"},g=t=>{let{size:e=T.size,rounded:n=T.rounded,fillMode:i=T.fillMode,themeColor:r=T.themeColor,showArrow:d=T.showArrow,arrowIconName:c=T.arrowIconName,hover:f,focus:x,active:v,selected:N,disabled:M,icon:L,text:z,iconClassName:_,...F}=t,j=L!==void 0,w=t.children!==void 0;return Ne("button",{...F,className:l(t.className,U,m(U,{size:e,rounded:n,fillMode:i,themeColor:r}),k(U,{hover:f,focus:x,active:v,disabled:M,selected:N}),{"k-icon-button":!z&&!w&&j}),children:[L&&H(h,{className:l(_,"k-button-icon"),icon:L}),z?Ne(Ze,{children:[z&&H("span",{className:"k-button-text",children:z}),t.children]}):t.children&&H("span",{className:"k-button-text",children:t.children}),d&&H("span",{className:"k-menu-button-arrow k-button-arrow",children:H(h,{icon:c})})]})};g.states=We;g.options=Ye;g.className=U;g.defaultOptions=T;import{jsx as fo}from"react/jsx-runtime";import{jsx as go}from"react/jsx-runtime";import{jsx as Io}from"react/jsx-runtime";import{jsx as tt}from"react/jsx-runtime";var X="k-input",je=[o.hover,o.focus,o.valid,o.invalid,o.required,o.disabled,o.loading,o.readonly],et={size:[s.small,s.medium,s.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},D={size:s.medium,rounded:s.medium,fillMode:u.solid},b=t=>{let{hover:e,focus:n,disabled:i,invalid:r,valid:d,loading:c,readonly:f,size:x=D.size,rounded:v=D.rounded,fillMode:N=D.fillMode,...M}=t;return tt("span",{...M,className:l(t.className,X,m(X,{size:x,rounded:v,fillMode:N}),k(X,{hover:e,focus:n,disabled:i,invalid:r,valid:d,loading:c,readonly:f}))})};b.states=je;b.options=et;b.className=X;b.defaultOptions=D;import{jsx as at}from"react/jsx-runtime";var J="k-picker",ot=[o.hover,o.focus,o.valid,o.invalid,o.required,o.disabled,o.loading,o.readonly],nt={size:[s.small,s.medium,s.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},Q={size:s.medium,rounded:p.medium,fillMode:u.solid},W=t=>{let{hover:e,focus:n,disabled:i,invalid:r,valid:d,loading:c,readonly:f,size:x=Q.size,rounded:v=Q.rounded,fillMode:N=Q.fillMode,...M}=t;return at("span",{...M,className:l(t.className,J,m(J,{size:x,rounded:v,fillMode:N}),k(J,{hover:e,focus:n,disabled:i,invalid:r,valid:d,loading:c,readonly:f})),children:t.children})};W.states=ot;W.options=nt;W.className=J;W.defaultOptions=Q;import{Fragment as it,jsx as ae}from"react/jsx-runtime";var ke="k-clear-value",st=[o.disabled,o.loading,o.readonly],lt={},E=t=>{let{disabled:e,loading:n,readonly:i,value:r}=t;return e||i||n||!r?ae(it,{}):ae("span",{className:l(t.className,ke),children:ae(h,{icon:"x"})})};E.states=st;E.options=lt;E.className=ke;import{jsx as dt}from"react/jsx-runtime";var se="k-input-inner",rt=[],ct={},Y={type:"text",autocomplete:"off",value:"",placeholder:""},R=t=>{let{value:e=Y.value,type:n=Y.type,placeholder:i=Y.placeholder,autocomplete:r=Y.autocomplete,...d}=t;return dt("input",{...d,type:n,className:l(t.className,se,m(se,t)),placeholder:i,autoComplete:r,defaultValue:e})};R.states=rt;R.options=ct;R.className=se;import{jsx as Ie,jsxs as mt}from"react/jsx-runtime";var le="k-input-inner",pt=[],ut={},ie=t=>{let{value:e,placeholder:n,showValue:i,valueIcon:r,valueIconName:d,...c}=t;return mt("span",{...c,className:l(t.className,le,m(le,t)),children:[r,!r&&d&&Ie(h,{className:"k-input-value-icon",icon:d}),i&&!e&&n,i&&e&&Ie("span",{className:"k-input-value-text",children:e})]})};ie.states=pt;ie.options=ut;ie.className=le;import{jsx as ht}from"react/jsx-runtime";var re="k-input-inner",ft=[],xt={},ye={value:"",placeholder:""},ce=t=>{let{value:e=ye.value,placeholder:n=ye.placeholder,rows:i,...r}=t;return ht("textarea",{...r,className:l(t.className,re,m(re,t)),placeholder:n,rows:i,defaultValue:e})};ce.states=ft;ce.options=xt;ce.className=re;import{Fragment as gt,jsx as Se}from"react/jsx-runtime";var Me="k-input-loading-icon",vt=[o.disabled,o.loading],Z=t=>{let{disabled:e,loading:n}=t;return e||!n?Se(gt,{}):Se("span",{className:l(t.className,Me,"k-icon k-i-loading")})};Z.states=vt;Z.className=Me;import{Fragment as kt,jsx as Te}from"react/jsx-runtime";var Ce="k-input-validation-icon",bt=[o.valid,o.invalid,o.disabled,o.loading],Nt={},K=t=>{let{valid:e,invalid:n,disabled:i,loading:r}=t,d=n?"warning-circle":"check-circle";return i||r||!!!(e||n)?Te(kt,{}):Te(h,{className:l(Ce),icon:d})};K.states=bt;K.options=Nt;K.className=Ce;import{Fragment as St,jsx as ze}from"react/jsx-runtime";var It="k-input-prefix",yt={direction:"horizontal"},we=t=>{let{direction:e=yt.direction,...n}=t;return t.children?ze("span",{...n,className:l(It,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):ze(St,{})};import{Fragment as Ct,jsx as Oe}from"react/jsx-runtime";var Mt="k-input-suffix",Tt={direction:"horizontal"},Le=t=>{let{direction:e=Tt.direction,...n}=t;return t.children?Oe("span",{...n,className:l(Mt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):Oe(Ct,{})};import{jsx as pn}from"react/jsx-runtime";import{jsx as xn}from"react/jsx-runtime";import{jsx as wt}from"react/jsx-runtime";var Ae="k-input-separator",zt={direction:"vertical"},de=t=>{let{direction:e=zt.direction,...n}=t;return wt("span",{...n,className:l(Ae,t.className,{[`${Ae}-${e}`]:e})})};import{Fragment as Pe,jsx as I,jsxs as pe}from"react/jsx-runtime";var Be="k-textbox",Ot=[o.hover,o.focus,o.valid,o.invalid,o.required,o.disabled,o.loading,o.readonly],Lt={size:[s.small,s.medium,s.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},C={showClearButton:!0,showValidationIcon:!0,size:b.defaultOptions.size,rounded:b.defaultOptions.rounded,fillMode:b.defaultOptions.fillMode,separators:!0},O=t=>{let{size:e=C.size,rounded:n=C.rounded,fillMode:i=C.fillMode,separators:r=C.separators,showClearButton:d=C.showClearButton,showValidationIcon:c=C.showValidationIcon,prefix:f,suffix:x,type:v,value:N,placeholder:M,hover:L,focus:z,valid:_,invalid:F,required:j,loading:w,disabled:q,readonly:fe,...Ve}=t;return pe(b,{...Ve,size:e,rounded:n,fillMode:i,hover:L,focus:z,valid:_,invalid:F,required:j,loading:w,disabled:q,readonly:fe,className:l(t.className,Be),children:[f&&pe(Pe,{children:[I(we,{children:f}),r&&I(de,{})]}),I(R,{placeholder:M,value:N,type:v}),c&&I(K,{valid:_,invalid:F,loading:w,disabled:q}),I(Z,{loading:w,disabled:q}),d&&I(E,{loading:w,disabled:q,readonly:fe,value:N}),x&&pe(Pe,{children:[r&&I(de,{}),I(Le,{children:x})]})]})};O.states=Ot;O.options=Lt;O.className=Be;O.defaultOptions=C;import{jsx as $n}from"react/jsx-runtime";import{Fragment as Xn,jsx as Un}from"react/jsx-runtime";import{Fragment as jn,jsx as Zn}from"react/jsx-runtime";import{jsx as Bt}from"react/jsx-runtime";var Ee="k-skeleton",At=[],Pt={},ue={shape:"text",animation:"pulse"},y=t=>{let{shape:e=ue.shape,animation:n=ue.animation,...i}=t;return Bt("span",{...i,className:l(t.className,Ee,{[`k-skeleton-${e}`]:e,[`k-skeleton-${n}`]:n}),style:t.style})};y.states=At;y.options=Pt;y.className=Ee;y.defaultOptions=ue;import{jsx as pa}from"react/jsx-runtime";import{jsx as Ht}from"react/jsx-runtime";var Re=t=>Ht(y,{shape:"rect",...t});import{jsx as ga}from"react/jsx-runtime";import{jsx as S,jsxs as V}from"react/jsx-runtime";var me="k-captcha",Et=[o.loading,o.valid,o.invalid,o.disabled],Rt={},Ke={imgPath:"/packages/html/assets/captcha.jpg"},$=t=>{let{value:e,valid:n,invalid:i,loading:r,disabled:d,imgPath:c=Ke.imgPath,...f}=t;return V("div",{...f,className:l(t.className,me,k(me,{disabled:d}),{"k-captcha-loading":r}),children:[V("div",{className:"k-captcha-image-wrap k-hstack",children:[V("div",{className:"k-captcha-image",children:[S("img",{className:l({"k-hidden":r}),src:c}),r&&S(Re,{style:{width:"100%",height:"100%"}})]}),V("div",{className:"k-captcha-image-controls k-vstack",children:[S(g,{icon:"volume-up",disabled:r===!0}),S(g,{icon:"arrow-rotate-cw",disabled:r===!0})]}),S("div",{className:"k-captcha-volume-control k-vstack k-pos-absolute k-hidden",children:S("div",{className:"k-widget k-slider k-slider-vertical"})})]}),V("div",{className:"k-captcha-input k-vstack",children:[S(O,{value:e,valid:n,invalid:i,disabled:r===!0}),n&&!r&&S("span",{className:"k-captcha-validation-message !k-text-success",children:"Verification Success"})]})]})};$.states=Et;$.options=Rt;$.className=me;$.defaultOptions=Ke;var wa=$;export{me as CAPTCHA_CLASSNAME,$ as Captcha,wa as default};