UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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