UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 14.6 kB
var lt=Object.create;var te=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var ct=Object.getPrototypeOf,dt=Object.prototype.hasOwnProperty;var mt=(e,t)=>{for(var o in t)te(e,o,{get:t[o],enumerable:!0})},Le=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of pt(t))!dt.call(e,s)&&s!==o&&te(e,s,{get:()=>t[s],enumerable:!(a=it(t,s))||a.enumerable});return e};var ut=(e,t,o)=>(o=e!=null?lt(ct(e)):{},Le(t||!e||!e.__esModule?te(o,"default",{value:e,enumerable:!0}):o,e)),ft=e=>Le(te({},"__esModule",{value:!0}),e);var io={};mt(io,{CaptchaNormal:()=>lo});module.exports=ft(io);var r=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?r(...t):typeof t=="object"?Object.keys(t).map((o,a)=>t[a]||t[o]&&o||null).filter(o=>o!==null).join(" "):t).filter(t=>!!t).join(" ");var x=(e,t)=>r({[`${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"}),L=(e,t)=>{let{valid:o,invalid:a,hover:s,focus:c,checked:p,active:u,selected:f,disabled:g,indeterminate:k,loading:y,empty:D,readonly:P,highlighted:E,...C}=t;return r({"k-valid":o,"k-invalid":a,"k-hover":s,"k-focus":c,"k-checked":p,"k-active":u,"k-selected":f,"k-disabled":g,"k-indeterminate":k&&!p,"k-loading":y,"k-empty":D,"k-readonly":P,"k-highlighted":E},Object.keys(C).reduce((z,M)=>(M.startsWith("k-")?z[M]=C[M]:z[`k-${M}`]=C[M],z),{}))};function oe(e,t){if(!t)return{};let o=Array.isArray(t)?t:[t];return Object.fromEntries(o.map(a=>[`k-${a}`,!0]))}var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},d={small:"small",medium:"medium",large:"large",full:"full"},m={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},l={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},n={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",generating:"generating",expanded:"expanded"};var U=require("react/jsx-runtime"),de="k-font-icon",xt=[],Nt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},ht={},$=e=>{let{size:t,themeColor:o,icon:a,rotate:s,flip:c,...p}=e;return a?(0,U.jsx)("span",{...p,className:r(e.className,de,x(de,{size:t}),{[`k-i-${a}`]:a,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,U.jsx)(U.Fragment,{})};$.states=xt;$.options=Nt;$.className=de;$.defaultOptions=ht;var Ae=$;var K=require("react/jsx-runtime"),me="k-svg-icon",vt=[],bt={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},_e={viewBox:"0 0 24 24"},F=e=>{let{size:t,themeColor:o,rotate:a,flip:s,viewBox:c=_e.viewBox,icon:p,...u}=e;if(!p)return(0,K.jsx)(K.Fragment,{});p==="none"&&{...u,className:r(e.className,me,"k-none")};let f=typeof p=="object"&&p.name&&p.name;return(0,K.jsx)("span",{...u,className:r(e.className,me,x("k-icon",{size:t}),{[`k-svg-i-${f}`]:f,[`k-color-${o}`]:o,[`k-rotate-${a}`]:a,"k-flip-h":s==="h"||s==="both","k-flip-v":s==="v"||s==="both"}),children:(0,K.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof p=="object"?p.viewBox:c,dangerouslySetInnerHTML:typeof p=="object"?{__html:p.content}:void 0,children:p?void 0:e.children})})};F.states=vt;F.options=bt;F.className=me;F.defaultOptions=_e;var ue=F;var fe=ut(require("@progress/kendo-svg-icons"));var Pe="icon",ze="icons";var O=require("react/jsx-runtime"),ne="k-icon",gt=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Mt=[],It={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark]},xe={viewBox:"0 0 24 24",type:"svg"},N=e=>{let{size:t,themeColor:o,icon:a,type:s=xe.type,rotate:c,flip:p,viewBox:u=xe.viewBox,...f}=e;if(!a)return(0,O.jsx)(O.Fragment,{});if(s==="svg"){if(a==="none")return(0,O.jsx)(ue,{...f,className:r(e.className,ne),icon:a,size:t});let g=fe[a]?a:gt(`${a}-icon`);return fe[g]?(0,O.jsx)(ue,{...f,className:r(e.className,ne),icon:fe[g],size:t,themeColor:o,rotate:c,flip:p,viewBox:u}):(0,O.jsx)(O.Fragment,{})}return(0,O.jsx)(Ae,{...f,className:r(e.className,ne),icon:a,size:t,themeColor:o,rotate:c,flip:p})};N.states=Mt;N.options=It;N.defaultOptions=xe;N.className=ne;N.moduleName=Pe;N.folderName=ze;var Ne="button",Ke=Ne;var I=require("react/jsx-runtime"),X="k-button",Tt=["icon-button"],St=[n.hover,n.focus,n.active,n.selected,n.disabled,n.generating],kt={size:[i.small,i.medium,i.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[m.solid,m.flat,m.outline,m.clear,m.link],themeColor:[l.base,l.primary,l.secondary,l.tertiary,l.success,l.warning,l.error,l.info,l.light,l.dark,l.inverse]},H={size:i.medium,rounded:d.medium,fillMode:m.solid,themeColor:l.base,showArrow:!1,arrowIconName:"caret-alt-down"},b=e=>{let{size:t=H.size,rounded:o=H.rounded,fillMode:a=H.fillMode,themeColor:s=H.themeColor,showArrow:c=H.showArrow,arrowIconName:p=H.arrowIconName,variant:u,hover:f,focus:g,active:k,selected:y,disabled:D,icon:P,text:E,iconClassName:C,...z}=e,M=P!==void 0,w=e.children!==void 0;return(0,I.jsxs)("button",{...z,className:r(e.className,X,oe(X,u),x(X,{size:t,rounded:o,fillMode:a,themeColor:s}),L(X,{hover:f,focus:g,active:k,disabled:D,selected:y}),{"k-icon-button":!E&&!w&&M}),children:[P&&(0,I.jsx)(N,{className:r(C,"k-button-icon"),icon:P}),E?(0,I.jsxs)(I.Fragment,{children:[E&&(0,I.jsx)("span",{className:"k-button-text",children:E}),e.children]}):e.children&&(0,I.jsx)("span",{className:"k-button-text",children:e.children}),c&&(0,I.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,I.jsx)(N,{icon:p})})]})};b.states=St;b.options=kt;b.variants=Tt;b.className=X;b.defaultOptions=H;b.moduleName=Ne;b.folderName=Ke;var yt=require("react/jsx-runtime");var Et=require("react/jsx-runtime");var Ot=require("react/jsx-runtime");var he="textbox",He=he;var q="input",ae=q;var Re=require("react/jsx-runtime"),se="k-input",Ct=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],Lt={size:[i.small,i.medium,i.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[m.solid,m.flat,m.outline]},re={size:i.medium,rounded:i.medium,fillMode:m.solid},T=e=>{let{hover:t,focus:o,disabled:a,invalid:s,valid:c,loading:p,readonly:u,size:f=re.size,rounded:g=re.rounded,fillMode:k=re.fillMode,...y}=e;return(0,Re.jsx)("span",{...y,className:r(e.className,se,x(se,{size:f,rounded:g,fillMode:k}),L(se,{hover:t,focus:o,disabled:a,invalid:s,valid:c,loading:p,readonly:u}))})};T.states=Ct;T.options=Lt;T.className=se;T.defaultOptions=re;T.moduleName=q;T.folderName=ae;var we=require("react/jsx-runtime"),le="k-picker",At=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],_t={size:[i.small,i.medium,i.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[m.solid,m.flat,m.outline]},ie={size:i.medium,rounded:d.medium,fillMode:m.solid},B=e=>{let{hover:t,focus:o,disabled:a,invalid:s,valid:c,loading:p,readonly:u,size:f=ie.size,rounded:g=ie.rounded,fillMode:k=ie.fillMode,...y}=e;return(0,we.jsx)("span",{...y,className:r(e.className,le,x(le,{size:f,rounded:g,fillMode:k}),L(le,{hover:t,focus:o,disabled:a,invalid:s,valid:c,loading:p,readonly:u})),children:e.children})};B.states=At;B.options=_t;B.className=le;B.defaultOptions=ie;B.moduleName=q;B.folderName=ae;var V=require("react/jsx-runtime"),Be="k-clear-value",Pt=[n.disabled,n.loading,n.readonly],zt={},G=e=>{let{disabled:t,loading:o,readonly:a,value:s}=e;return t||a||o||!s?(0,V.jsx)(V.Fragment,{}):(0,V.jsx)("span",{className:r(e.className,Be),children:(0,V.jsx)(N,{icon:"x"})})};G.states=Pt;G.options=zt;G.className=Be;var Ve=require("react/jsx-runtime"),ve="k-input-inner",Kt=[],Ht={},pe={type:"text",autocomplete:"off",value:"",placeholder:""},J=e=>{let{value:t=pe.value,type:o=pe.type,placeholder:a=pe.placeholder,autocomplete:s=pe.autocomplete,...c}=e;return(0,Ve.jsx)("input",{...c,type:o,className:r(e.className,ve,x(ve,e)),placeholder:a,autoComplete:s,defaultValue:t})};J.states=Kt;J.options=Ht;J.className=ve;var W=require("react/jsx-runtime"),be="k-input-inner",Rt=[],wt={},ge=e=>{let{value:t,placeholder:o,showValue:a,valueIcon:s,valueIconName:c,...p}=e;return(0,W.jsxs)("span",{...p,className:r(e.className,be,x(be,e)),children:[s,!s&&c&&(0,W.jsx)(N,{className:"k-input-value-icon",icon:c}),a&&!t&&o,a&&t&&(0,W.jsx)("span",{className:"k-input-value-text",children:t})]})};ge.states=Rt;ge.options=wt;ge.className=be;var Ue=require("react/jsx-runtime"),Me="k-input-inner",Bt=[],Vt={},De={value:"",placeholder:""},Ie=e=>{let{value:t=De.value,placeholder:o=De.placeholder,rows:a,...s}=e;return(0,Ue.jsx)("textarea",{...s,className:r(e.className,Me,x(Me,e)),placeholder:o,rows:a,defaultValue:t})};Ie.states=Bt;Ie.options=Vt;Ie.className=Me;var Y=require("react/jsx-runtime"),$e="k-input-loading-icon",Dt=[n.disabled,n.loading],ce=e=>{let{disabled:t,loading:o}=e;return t||!o?(0,Y.jsx)(Y.Fragment,{}):(0,Y.jsx)("span",{className:r(e.className,$e,"k-icon k-i-loading")})};ce.states=Dt;ce.className=$e;var Q=require("react/jsx-runtime"),Fe="k-input-validation-icon",Ut=[n.valid,n.invalid,n.disabled,n.loading],$t={},Z=e=>{let{valid:t,invalid:o,disabled:a,loading:s}=e,c=o?"warning-circle":"check-circle";return a||s||!!!(t||o)?(0,Q.jsx)(Q.Fragment,{}):(0,Q.jsx)(N,{className:r(Fe),icon:c})};Z.states=Ut;Z.options=$t;Z.className=Fe;var j=require("react/jsx-runtime"),Ft="k-input-prefix",Xt={direction:"horizontal"},Xe=e=>{let{direction:t=Xt.direction,...o}=e;return e.children?(0,j.jsx)("span",{...o,className:r(Ft,e.className,{[`k-input-prefix-${t}`]:t}),children:e.children}):(0,j.jsx)(j.Fragment,{})};var ee=require("react/jsx-runtime"),qt="k-input-suffix",Gt={direction:"horizontal"},qe=e=>{let{direction:t=Gt.direction,...o}=e;return e.children?(0,ee.jsx)("span",{...o,className:r(qt,e.className,{[`k-input-suffix-${t}`]:t}),children:e.children}):(0,ee.jsx)(ee.Fragment,{})};var Jt=require("react/jsx-runtime");var Wt=require("react/jsx-runtime");var Je=require("react/jsx-runtime"),Ge="k-input-separator",Yt={direction:"vertical"},Te=e=>{let{direction:t=Yt.direction,...o}=e;return(0,Je.jsx)("span",{...o,className:r(Ge,e.className,{[`${Ge}-${t}`]:t})})};var h=require("react/jsx-runtime"),We="k-textbox",Qt=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],Zt={size:[i.small,i.medium,i.large],rounded:[d.small,d.medium,d.large,d.full],fillMode:[m.solid,m.flat,m.outline]},R={showClearButton:!0,showValidationIcon:!0,size:T.defaultOptions.size,rounded:T.defaultOptions.rounded,fillMode:T.defaultOptions.fillMode,separators:!0},A=e=>{let{size:t=R.size,rounded:o=R.rounded,fillMode:a=R.fillMode,separators:s=R.separators,showClearButton:c=R.showClearButton,showValidationIcon:p=R.showValidationIcon,prefix:u,suffix:f,type:g,value:k,placeholder:y,hover:D,focus:P,valid:E,invalid:C,required:z,loading:M,disabled:w,readonly:Ce,...rt}=e;return(0,h.jsxs)(T,{...rt,size:t,rounded:o,fillMode:a,hover:D,focus:P,valid:E,invalid:C,required:z,loading:M,disabled:w,readonly:Ce,className:r(e.className,We),children:[u&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Xe,{children:u}),s&&(0,h.jsx)(Te,{})]}),(0,h.jsx)(J,{placeholder:y,value:k,type:g}),p&&(0,h.jsx)(Z,{valid:E,invalid:C,loading:M,disabled:w}),(0,h.jsx)(ce,{loading:M,disabled:w}),c&&(0,h.jsx)(G,{loading:M,disabled:w,readonly:Ce,value:k}),f&&(0,h.jsxs)(h.Fragment,{children:[s&&(0,h.jsx)(Te,{}),(0,h.jsx)(qe,{children:f})]})]})};A.states=Qt;A.options=Zt;A.className=We;A.defaultOptions=R;A.moduleName=he;A.folderName=He;var jt=require("react/jsx-runtime");var Qe=require("react/jsx-runtime");var Ze=require("react/jsx-runtime");var Se="skeleton",je=Se;var et=require("react/jsx-runtime"),ke="k-skeleton",eo=["circle","text","rect"],to=[],oo={},ye={variant:"text",shape:"text",animation:"pulse"},S=e=>{let{variant:t,shape:o,animation:a=ye.animation,...s}=e,c=`skeleton-${t||o||ye.variant}`;return(0,et.jsx)("span",{...s,className:r(e.className,ke,oe(ke,c),{[`k-skeleton-${a}`]:a}),style:e.style})};S.states=to;S.options=oo;S.variants=eo;S.className=ke;S.defaultOptions=ye;S.moduleName=Se;S.folderName=je;var no=require("react/jsx-runtime");var ot=require("react/jsx-runtime"),tt=e=>(0,ot.jsx)(S,{shape:"rect",...e});var ao=require("react/jsx-runtime");var Ee="captcha",nt=Ee;var v=require("react/jsx-runtime"),Oe="k-captcha",so=[n.loading,n.valid,n.invalid,n.disabled],ro={},at={imgPath:"/packages/html/assets/captcha.jpg"},_=e=>{let{value:t,valid:o,invalid:a,loading:s,disabled:c,imgPath:p=at.imgPath,...u}=e;return(0,v.jsxs)("div",{...u,className:r(e.className,Oe,L(Oe,{disabled:c}),{"k-captcha-loading":s}),children:[(0,v.jsxs)("div",{className:"k-captcha-image-wrap k-hstack",children:[(0,v.jsxs)("div",{className:"k-captcha-image",children:[(0,v.jsx)("img",{className:r({"k-hidden":s}),src:p}),s&&(0,v.jsx)(tt,{style:{width:"100%",height:"100%"}})]}),(0,v.jsxs)("div",{className:"k-captcha-image-controls k-vstack",children:[(0,v.jsx)(b,{icon:"volume-up",disabled:s===!0}),(0,v.jsx)(b,{icon:"arrow-rotate-cw",disabled:s===!0})]}),(0,v.jsx)("div",{className:"k-captcha-volume-control k-vstack k-pos-absolute k-hidden",children:(0,v.jsx)("div",{className:"k-widget k-slider k-slider-vertical"})})]}),(0,v.jsxs)("div",{className:"k-captcha-input k-vstack",children:[(0,v.jsx)(A,{value:t,valid:o,invalid:a,disabled:s===!0}),o&&!s&&(0,v.jsx)("span",{className:"k-captcha-validation-message !k-text-success",children:"Verification Success"})]})]})};_.states=so;_.options=ro;_.className=Oe;_.defaultOptions=at;_.moduleName=Ee;_.folderName=nt;var st=require("react/jsx-runtime"),lo=e=>(0,st.jsx)(_,{value:"YR890",...e});