UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 15.2 kB
var je=Object.create;var oe=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var at=(t,e)=>{for(var o in e)oe(t,o,{get:e[o],enumerable:!0})},Ae=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of tt(e))!nt.call(t,a)&&a!==o&&oe(t,a,{get:()=>e[a],enumerable:!(s=et(e,a))||s.enumerable});return t};var st=(t,e,o)=>(o=t!=null?je(ot(t)):{},Ae(e||!t||!t.__esModule?oe(o,"default",{value:t,enumerable:!0}):o,t)),it=t=>Ae(oe({},"__esModule",{value:!0}),t);var oo={};at(oo,{ACTIONSHEETVIEW_CLASSNAME:()=>pe,ActionSheetView:()=>J,default:()=>to});module.exports=it(oo);var i=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?i(...e):typeof e=="object"?Object.keys(e).map((o,s)=>e[s]||e[o]&&o||null).filter(o=>o!==null).join(" "):e).filter(e=>!!e).join(" ");var x=(t,e)=>i({[`${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)=>i({"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 l={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"},r={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"};var ze=require("react/jsx-runtime"),ne="k-actions",lt=[],rt={},me={alignment:"start",orientation:"horizontal"},V=t=>{let{alignment:e=me.alignment,orientation:o=me.orientation,...s}=t;return(0,ze.jsx)("div",{...s,className:i(ne,{[`${ne}-${e}`]:e,[`${ne}-${o}`]:o},t.className),children:t.children})};V.states=lt;V.options=rt;V.className=ne;V.defaultOptions=me;var Oe=require("react/jsx-runtime"),ct="k-actionsheet-footer",Ce={alignment:"stretched",orientation:"horizontal"},fe=t=>{let{alignment:e=Ce.alignment,orientation:o=Ce.orientation,template:s,as:a=s?"div":V,...c}=t;return(0,Oe.jsx)(a,{...c,...!s&&{alignment:e,orientation:o},className:i(t.className,ct),children:t.children})};var Le=require("react/jsx-runtime"),ae="k-input",dt=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],pt={size:[l.small,l.medium,l.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},se={size:l.medium,rounded:l.medium,fillMode:u.solid},g=t=>{let{hover:e,focus:o,disabled:s,invalid:a,valid:c,loading:d,readonly:f,size:m=se.size,rounded:b=se.rounded,fillMode:N=se.fillMode,...S}=t;return(0,Le.jsx)("span",{...S,className:i(t.className,ae,x(ae,{size:m,rounded:b,fillMode:N}),K(ae,{hover:e,focus:o,disabled:s,invalid:a,valid:c,loading:d,readonly:f}))})};g.states=dt;g.options=pt;g.className=ae;g.defaultOptions=se;var we=require("react/jsx-runtime"),ie="k-picker",ut=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],mt={size:[l.small,l.medium,l.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},le={size:l.medium,rounded:p.medium,fillMode:u.solid},re=t=>{let{hover:e,focus:o,disabled:s,invalid:a,valid:c,loading:d,readonly:f,size:m=le.size,rounded:b=le.rounded,fillMode:N=le.fillMode,...S}=t;return(0,we.jsx)("span",{...S,className:i(t.className,ie,x(ie,{size:m,rounded:b,fillMode:N}),K(ie,{hover:e,focus:o,disabled:s,invalid:a,valid:c,loading:d,readonly:f})),children:t.children})};re.states=ut;re.options=mt;re.className=ie;re.defaultOptions=le;var G=require("react/jsx-runtime"),xe="k-icon k-font-icon",ft=[],xt={size:[l.xsmall,l.small,l.medium,l.large,l.xlarge,l.xxlarge,l.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},ht={},D=t=>{let{size:e,themeColor:o,icon:s,rotate:a,flip:c,...d}=t;return s?(0,G.jsx)("span",{...d,className:i(t.className,xe,x(xe,{size:e}),{[`k-i-${s}`]:s,[`k-color-${o}`]:o,[`k-rotate-${a}`]:a,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,G.jsx)(G.Fragment,{})};D.states=ft;D.options=xt;D.className=xe;D.defaultOptions=ht;var Ee=D;var z=require("react/jsx-runtime"),he="k-icon k-svg-icon",bt=[],vt={size:[l.xsmall,l.small,l.medium,l.large,l.xlarge,l.xxlarge,l.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},He={viewBox:"0 0 24 24"},U=t=>{let{size:e,themeColor:o,rotate:s,flip:a,viewBox:c=He.viewBox,icon:d,...f}=t;if(!d)return(0,z.jsx)(z.Fragment,{});d==="none"&&{...f,className:i(t.className,he,"k-none")};let m=typeof d=="object"&&d.name&&d.name;return(0,z.jsx)("span",{...f,className:i(t.className,he,x("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${o}`]:o,[`k-rotate-${s}`]:s,"k-flip-h":a==="h"||a==="both","k-flip-v":a==="v"||a==="both"}),children:(0,z.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=bt;U.options=vt;U.className=he;U.defaultOptions=He;var be=U;var Pe=st(require("@progress/kendo-svg-icons")),k=require("react/jsx-runtime"),Nt=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),gt=[],It={size:[l.xsmall,l.small,l.medium,l.large,l.xlarge,l.xxlarge,l.xxxlarge],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark]},ve={viewBox:"0 0 24 24",type:"svg"},v=t=>{let{size:e,themeColor:o,icon:s,type:a=ve.type,rotate:c,flip:d,viewBox:f=ve.viewBox,...m}=t;if(!s)return(0,k.jsx)(k.Fragment,{});if(a==="svg"){if(s==="none")return(0,k.jsx)(be,{...m,icon:s,size:e});let b=Nt(`${s}-icon`);return Pe[b]?(0,k.jsx)(be,{...m,icon:Pe[b],size:e,themeColor:o,rotate:c,flip:d,viewBox:f}):(0,k.jsx)(k.Fragment,{})}return(0,k.jsx)(Ee,{...m,icon:s,size:e,themeColor:o,rotate:c,flip:d})};v.states=gt;v.options=It;v.defaultOptions=ve;var $=require("react/jsx-runtime"),Re="k-clear-value",St=[n.disabled,n.loading,n.readonly],yt={},C=t=>{let{disabled:e,loading:o,readonly:s,value:a}=t;return e||s||o||!a?(0,$.jsx)($.Fragment,{}):(0,$.jsx)("span",{className:i(t.className,Re),children:(0,$.jsx)(v,{icon:"x"})})};C.states=St;C.options=yt;C.className=Re;var Be=require("react/jsx-runtime"),Ne="k-input-inner",kt=[],Mt={},ce={type:"text",autocomplete:"off",value:"",placeholder:""},O=t=>{let{value:e=ce.value,type:o=ce.type,placeholder:s=ce.placeholder,autocomplete:a=ce.autocomplete,...c}=t;return(0,Be.jsx)("input",{...c,type:o,className:i(t.className,Ne,x(Ne,t)),placeholder:s,autoComplete:a,defaultValue:e})};O.states=kt;O.options=Mt;O.className=Ne;var W=require("react/jsx-runtime"),ge="k-input-inner",Tt=[],At={},Ie=t=>{let{value:e,placeholder:o,showValue:s,valueIcon:a,valueIconName:c,...d}=t;return(0,W.jsxs)("span",{...d,className:i(t.className,ge,x(ge,t)),children:[a,!a&&c&&(0,W.jsx)(v,{className:"k-input-value-icon",icon:c}),s&&!e&&o,s&&e&&(0,W.jsx)("span",{className:"k-input-value-text",children:e})]})};Ie.states=Tt;Ie.options=At;Ie.className=ge;var Ve=require("react/jsx-runtime"),Se="k-input-inner",zt=[],Ct={},Ke={value:"",placeholder:""},ye=t=>{let{value:e=Ke.value,placeholder:o=Ke.placeholder,rows:s,...a}=t;return(0,Ve.jsx)("textarea",{...a,className:i(t.className,Se,x(Se,t)),placeholder:o,rows:s,defaultValue:e})};ye.states=zt;ye.options=Ct;ye.className=Se;var Q=require("react/jsx-runtime"),$e="k-input-loading-icon",Ot=[n.disabled,n.loading],F=t=>{let{disabled:e,loading:o}=t;return e||!o?(0,Q.jsx)(Q.Fragment,{}):(0,Q.jsx)("span",{className:i(t.className,$e,"k-icon k-i-loading")})};F.states=Ot;F.className=$e;var Y=require("react/jsx-runtime"),Fe="k-input-validation-icon",Lt=[n.valid,n.invalid,n.disabled,n.loading],wt={},L=t=>{let{valid:e,invalid:o,disabled:s,loading:a}=t,c=o?"warning-circle":"check-circle";return s||a||!!!(e||o)?(0,Y.jsx)(Y.Fragment,{}):(0,Y.jsx)(v,{className:i(Fe),icon:c})};L.states=Lt;L.options=wt;L.className=Fe;var Z=require("react/jsx-runtime"),Et="k-input-prefix",Ht={direction:"horizontal"},_e=t=>{let{direction:e=Ht.direction,...o}=t;return t.children?(0,Z.jsx)("span",{...o,className:i(Et,t.className,{[`k-input-prefix-${e}`]:e}),children:t.children}):(0,Z.jsx)(Z.Fragment,{})};var j=require("react/jsx-runtime"),Pt="k-input-suffix",Rt={direction:"horizontal"},Xe=t=>{let{direction:e=Rt.direction,...o}=t;return t.children?(0,j.jsx)("span",{...o,className:i(Pt,t.className,{[`k-input-suffix-${e}`]:e}),children:t.children}):(0,j.jsx)(j.Fragment,{})};var Bt=require("react/jsx-runtime");var Kt=require("react/jsx-runtime");var Je=require("react/jsx-runtime"),qe="k-input-separator",Vt={direction:"vertical"},ke=t=>{let{direction:e=Vt.direction,...o}=t;return(0,Je.jsx)("span",{...o,className:i(qe,t.className,{[`${qe}-${e}`]:e})})};var T=require("react/jsx-runtime"),Ge="k-searchbox",$t=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading],Ft={size:[l.small,l.medium,l.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},Me={showIcon:!0,icon:"search",size:g.defaultOptions.size,rounded:g.defaultOptions.rounded,fillMode:g.defaultOptions.fillMode},_=t=>{let{value:e,placeholder:o,size:s,rounded:a,fillMode:c,hover:d,focus:f,valid:m,invalid:b,required:N,loading:S,disabled:A,showIcon:M=Me.showIcon,icon:P=Me.icon,...R}=t;return(0,T.jsxs)(g,{...R,size:s,rounded:a,fillMode:c,hover:d,focus:f,valid:m,invalid:b,required:N,loading:S,disabled:A,className:i(t.className,Ge),children:[M&&(0,T.jsx)(v,{className:"k-input-icon",icon:P}),(0,T.jsx)(O,{placeholder:o,value:e}),(0,T.jsx)(F,{...t}),(0,T.jsx)(L,{...t}),(0,T.jsx)(C,{...t})]})};_.states=$t;_.options=Ft;_.className=Ge;_.defaultOptions=Me;var _t=require("react/jsx-runtime");var h=require("react/jsx-runtime"),De="k-textbox",Xt=[n.hover,n.focus,n.valid,n.invalid,n.required,n.disabled,n.loading,n.readonly],qt={size:[l.small,l.medium,l.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline]},w={showClearButton:!0,showValidationIcon:!0,size:g.defaultOptions.size,rounded:g.defaultOptions.rounded,fillMode:g.defaultOptions.fillMode,separators:!0},X=t=>{let{size:e=w.size,rounded:o=w.rounded,fillMode:s=w.fillMode,separators:a=w.separators,showClearButton:c=w.showClearButton,showValidationIcon:d=w.showValidationIcon,prefix:f,suffix:m,type:b,value:N,placeholder:S,hover:A,focus:M,valid:P,invalid:R,required:ue,loading:B,disabled:te,readonly:Te,...Ze}=t;return(0,h.jsxs)(g,{...Ze,size:e,rounded:o,fillMode:s,hover:A,focus:M,valid:P,invalid:R,required:ue,loading:B,disabled:te,readonly:Te,className:i(t.className,De),children:[f&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_e,{children:f}),a&&(0,h.jsx)(ke,{})]}),(0,h.jsx)(O,{placeholder:S,value:N,type:b}),d&&(0,h.jsx)(L,{valid:P,invalid:R,loading:B,disabled:te}),(0,h.jsx)(F,{loading:B,disabled:te}),c&&(0,h.jsx)(C,{loading:B,disabled:te,readonly:Te,value:N}),m&&(0,h.jsxs)(h.Fragment,{children:[a&&(0,h.jsx)(ke,{}),(0,h.jsx)(Xe,{children:m})]})]})};X.states=Xt;X.options=qt;X.className=De;X.defaultOptions=w;var Jt=require("react/jsx-runtime");var We=require("react/jsx-runtime");var y=require("react/jsx-runtime"),de="k-button",Gt=[n.hover,n.focus,n.active,n.selected,n.disabled],Dt={size:[l.small,l.medium,l.large],rounded:[p.small,p.medium,p.large,p.full],fillMode:[u.solid,u.flat,u.outline,u.clear,u.link],themeColor:[r.base,r.primary,r.secondary,r.tertiary,r.success,r.warning,r.error,r.info,r.light,r.dark,r.inverse]},E={size:l.medium,rounded:p.medium,fillMode:u.solid,themeColor:r.base,showArrow:!1,arrowIconName:"caret-alt-down"},H=t=>{let{size:e=E.size,rounded:o=E.rounded,fillMode:s=E.fillMode,themeColor:a=E.themeColor,showArrow:c=E.showArrow,arrowIconName:d=E.arrowIconName,hover:f,focus:m,active:b,selected:N,disabled:S,icon:A,text:M,iconClassName:P,...R}=t,ue=A!==void 0,B=t.children!==void 0;return(0,y.jsxs)("button",{...R,className:i(t.className,de,x(de,{size:e,rounded:o,fillMode:s,themeColor:a}),K(de,{hover:f,focus:m,active:b,disabled:S,selected:N}),{"k-icon-button":!M&&!B&&ue}),children:[A&&(0,y.jsx)(v,{className:i(P,"k-button-icon"),icon:A}),M?(0,y.jsxs)(y.Fragment,{children:[M&&(0,y.jsx)("span",{className:"k-button-text",children:M}),t.children]}):t.children&&(0,y.jsx)("span",{className:"k-button-text",children:t.children}),c&&(0,y.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,y.jsx)(v,{icon:d})})]})};H.states=Gt;H.options=Dt;H.className=de;H.defaultOptions=E;var Ut=require("react/jsx-runtime");var Wt=require("react/jsx-runtime");var Qt=require("react/jsx-runtime");var Qe=require("react/jsx-runtime");var I=require("react/jsx-runtime"),Ye="k-actionsheet-titlebar",Yt={},ee=t=>{let{title:e,subtitle:o,actionsStart:s,actionsEnd:a,filter:c,input:d,inputValue:f,inputPlaceholder:m,adaptive:b,children:N,...S}=t;return(0,I.jsxs)("div",{...S,className:i(t.className,Ye),children:[(0,I.jsxs)("div",{className:"k-actionsheet-titlebar-group",children:[s&&(0,I.jsx)("div",{className:"k-actionsheet-actions",children:s}),!N&&(0,I.jsxs)("div",{className:"k-actionsheet-title",children:[e&&(0,I.jsx)("div",{className:"k-text-center",children:e}),o&&(0,I.jsx)("div",{className:"k-actionsheet-subtitle k-text-center",children:o})]}),N&&(0,I.jsx)("div",{className:"k-actionsheet-title",children:N}),a&&(0,I.jsx)("div",{className:"k-actionsheet-actions",children:a})]}),(d||c)&&(0,I.jsx)("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter",children:d?(0,I.jsx)(X,{value:f,placeholder:m,size:b?"large":"medium"}):(0,I.jsx)(_,{placeholder:"Filter",size:b?"large":"medium"})})]})};ee.className=Ye;ee.defaultOptions=Yt;var q=require("react/jsx-runtime"),pe="k-actionsheet-view",Zt=[],jt={},eo={},J=t=>{let{adaptive:e,animated:o,children:s,header:a,footer:c,...d}=t,f=(a==null?void 0:a.type)===ee&&(0,q.jsx)(ee,{adaptive:e,...a==null?void 0:a.props}),m=(c==null?void 0:c.type)===fe&&(0,q.jsx)(fe,{...c==null?void 0:c.props});return(0,q.jsxs)("div",{...d,className:i(t.className,pe,{[`${pe}-animated`]:o}),children:[f,(0,q.jsx)("div",{className:"k-actionsheet-content",children:s}),m]})};J.states=Zt;J.options=jt;J.className=pe;J.defaultOptions=eo;var to=J;