UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9 kB
var ht=Object.create;var K=Object.defineProperty;var Ot=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var bt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty;var At=(e,t)=>{for(var n in t)K(e,n,{get:t[n],enumerable:!0})},et=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of vt(t))!Ct.call(e,r)&&r!==n&&K(e,r,{get:()=>t[r],enumerable:!(i=Ot(t,r))||i.enumerable});return e};var Mt=(e,t,n)=>(n=e!=null?ht(bt(e)):{},et(t||!e||!e.__esModule?K(n,"default",{value:e,enumerable:!0}):n,e)),yt=e=>et(K({},"__esModule",{value:!0}),e);var Jt={};At(Jt,{DialogModal:()=>qt,DialogNormal:()=>Nt});module.exports=yt(Jt);var l=(...e)=>e.filter(t=>t!==!0&&!!t).map(t=>Array.isArray(t)?l(...t):typeof t=="object"?Object.keys(t).map((n,i)=>t[i]||t[n]&&n||null).filter(n=>n!==null).join(" "):t).filter(t=>!!t).join(" ");var h=(e,t)=>l({[`${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"}),ot=(e,t)=>{let{valid:n,invalid:i,hover:r,focus:c,checked:a,active:f,selected:p,disabled:T,indeterminate:H,loading:U,empty:P,readonly:E,highlighted:w,..._}=t;return l({"k-valid":n,"k-invalid":i,"k-hover":r,"k-focus":c,"k-checked":a,"k-active":f,"k-selected":p,"k-disabled":T,"k-indeterminate":H&&!a,"k-loading":U,"k-empty":P,"k-readonly":E,"k-highlighted":w},Object.keys(_).reduce((L,b)=>(b.startsWith("k-")?L[b]=_[b]:L[`k-${b}`]=_[b],L),{}))};function nt(e,t){if(!t)return{};let n=Array.isArray(t)?t:[t];return Object.fromEntries(n.map(i=>[`k-${i}`,!0]))}var s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},B={small:"small",medium:"medium",large:"large",full:"full"},C={solid:"solid",flat:"flat",outline:"outline",clear:"clear",link:"link"},o={inherit:"inherit",base:"base",primary:"primary",secondary:"secondary",tertiary:"tertiary",info:"info",success:"success",warning:"warning",error:"error",dark:"dark",light:"light",inverse:"inverse"},A={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 I=require("react/jsx-runtime"),W="k-font-icon",kt=[],Tt={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},wt={},S=e=>{let{size:t,themeColor:n,icon:i,rotate:r,flip:c,...a}=e;return i?(0,I.jsx)("span",{...a,className:l(e.className,W,h(W,{size:t}),{[`k-i-${i}`]:i,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,I.jsx)(I.Fragment,{})};S.states=kt;S.options=Tt;S.className=W;S.defaultOptions=wt;var it=S;var M=require("react/jsx-runtime"),F="k-svg-icon",Bt=[],Et={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},st={viewBox:"0 0 24 24"},D=e=>{let{size:t,themeColor:n,rotate:i,flip:r,viewBox:c=st.viewBox,icon:a,...f}=e;if(!a)return(0,M.jsx)(M.Fragment,{});a==="none"&&{...f,className:l(e.className,F,"k-none")};let p=typeof a=="object"&&a.name&&a.name;return(0,M.jsx)("span",{...f,className:l(e.className,F,h("k-icon",{size:t}),{[`k-svg-i-${p}`]:p,[`k-color-${n}`]:n,[`k-rotate-${i}`]:i,"k-flip-h":r==="h"||r==="both","k-flip-v":r==="v"||r==="both"}),children:(0,M.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof a=="object"?a.viewBox:c,dangerouslySetInnerHTML:typeof a=="object"?{__html:a.content}:void 0,children:a?void 0:e.children})})};D.states=Bt;D.options=Et;D.className=F;D.defaultOptions=st;var G=D;var V=Mt(require("@progress/kendo-svg-icons"));var rt="icon",at="icons";var N=require("react/jsx-runtime"),R="k-icon",_t=e=>e.replace(/([-_][a-z0-9])/gi,t=>t.toUpperCase().replace("-","").replace("_","")),Lt=[],It={size:[s.xsmall,s.small,s.medium,s.large,s.xlarge,s.xxlarge,s.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},q={viewBox:"0 0 24 24",type:"svg"},g=e=>{let{size:t,themeColor:n,icon:i,type:r=q.type,rotate:c,flip:a,viewBox:f=q.viewBox,...p}=e;if(!i)return(0,N.jsx)(N.Fragment,{});if(r==="svg"){if(i==="none")return(0,N.jsx)(G,{...p,className:l(e.className,R),icon:i,size:t});let T=V[i]?i:_t(`${i}-icon`);return V[T]?(0,N.jsx)(G,{...p,className:l(e.className,R),icon:V[T],size:t,themeColor:n,rotate:c,flip:a,viewBox:f}):(0,N.jsx)(N.Fragment,{})}return(0,N.jsx)(it,{...p,className:l(e.className,R),icon:i,size:t,themeColor:n,rotate:c,flip:a})};g.states=Lt;g.options=It;g.defaultOptions=q;g.className=R;g.moduleName=rt;g.folderName=at;var J="button",lt=J;var u=require("react/jsx-runtime"),z="k-button",St=["icon-button"],Dt=[A.hover,A.focus,A.active,A.selected,A.disabled,A.generating],zt={size:[s.small,s.medium,s.large],rounded:[B.small,B.medium,B.large,B.full],fillMode:[C.solid,C.flat,C.outline,C.clear,C.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},y={size:s.medium,rounded:B.medium,fillMode:C.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},m=e=>{let{size:t=y.size,rounded:n=y.rounded,fillMode:i=y.fillMode,themeColor:r=y.themeColor,showArrow:c=y.showArrow,arrowIconName:a=y.arrowIconName,variant:f,hover:p,focus:T,active:H,selected:U,disabled:P,icon:E,text:w,iconClassName:_,...L}=e,b=E!==void 0,gt=e.children!==void 0;return(0,u.jsxs)("button",{...L,className:l(e.className,z,nt(z,f),h(z,{size:t,rounded:n,fillMode:i,themeColor:r}),ot(z,{hover:p,focus:T,active:H,disabled:P,selected:U}),{"k-icon-button":!w&&!gt&&b}),children:[E&&(0,u.jsx)(g,{className:l(_,"k-button-icon"),icon:E}),w?(0,u.jsxs)(u.Fragment,{children:[w&&(0,u.jsx)("span",{className:"k-button-text",children:w}),e.children]}):e.children&&(0,u.jsx)("span",{className:"k-button-text",children:e.children}),c&&(0,u.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,u.jsx)(g,{icon:a})})]})};m.states=Dt;m.options=zt;m.variants=St;m.className=z;m.defaultOptions=y;m.moduleName=J;m.folderName=lt;var Kt=require("react/jsx-runtime");var Rt=require("react/jsx-runtime");var $t=require("react/jsx-runtime");var X="action-buttons",ct=X;var mt=require("react/jsx-runtime"),$="k-actions",Ht=[],Ut={},Q={alignment:"start",orientation:"horizontal"},O=e=>{let{alignment:t=Q.alignment,orientation:n=Q.orientation,...i}=e;return(0,mt.jsx)("div",{...i,className:l($,{[`${$}-${t}`]:t,[`${$}-${n}`]:n},e.className),children:e.children})};O.states=Ht;O.options=Ut;O.className=$;O.defaultOptions=Q;O.moduleName=X;O.folderName=ct;var Y="window",dt=Y;var ut=require("react/jsx-runtime"),pt="k-window-content",Pt=[],Wt={},Ft={},v=e=>{let{children:t,...n}=e;return(0,ut.jsx)("div",{...n,className:l(pt,e.className),children:t})};v.states=Pt;v.options=Wt;v.className=pt;v.defaultOptions=Ft;v.moduleName=Y;v.folderName=dt;var Z="dialog",ft=Z;var d=require("react/jsx-runtime"),j="k-dialog",Gt=[],Vt={themeColor:[o.primary,o.light,o.dark]},tt={actionButtonsAlign:"stretched",modal:!0},k=e=>{let{title:t,actions:n,themeColor:i,actionButtons:r,actionButtonsAlign:c=tt.actionButtonsAlign,modal:a=tt.modal,...f}=e;return(0,d.jsxs)("div",{className:"k-dialog-wrapper",children:[a&&(0,d.jsx)("div",{className:"k-overlay"}),(0,d.jsxs)("div",{...f,className:l(e.className,j,"k-window",h(j,{themeColor:i})),children:[(t!==void 0||n)&&(0,d.jsxs)("div",{className:"k-window-titlebar k-dialog-titlebar",children:[t!==void 0&&(0,d.jsx)("span",{className:"k-window-title k-dialog-title",children:t}),n&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions",children:n.map(p=>(0,d.jsx)(m,{icon:p,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"},p))})})]}),(0,d.jsx)(v,{className:"k-dialog-content",children:e.children}),r&&(0,d.jsx)(O,{alignment:c,className:"k-window-actions k-dialog-actions",children:r})]})]})};k.states=Gt;k.options=Vt;k.className=j;k.defaultOptions=tt;k.moduleName=Z;k.folderName=ft;var xt=k;var x=require("react/jsx-runtime"),Nt=e=>(0,x.jsx)(xt,{title:"Title",children:(0,x.jsx)(x.Fragment,{children:"Dialog content"}),actionButtons:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(m,{children:"Action"}),(0,x.jsx)(m,{themeColor:"primary",children:"Primary"})]}),actions:["x"],...e}),qt=Nt;