UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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