@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 8.72 kB
JavaScript
var xe=Object.create;var z=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var ge=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var ve=(t,e)=>{for(var n in e)z(t,n,{get:e[n],enumerable:!0})},ee=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of he(e))!Oe.call(t,r)&&r!==n&&z(t,r,{get:()=>e[r],enumerable:!(s=Ne(e,r))||s.enumerable});return t};var be=(t,e,n)=>(n=t!=null?xe(ge(t)):{},ee(e||!t||!t.__esModule?z(n,"default",{value:t,enumerable:!0}):n,t)),Ce=t=>ee(z({},"__esModule",{value:!0}),t);var Ge={};ve(Ge,{DIALOG_CLASSNAME:()=>$,Dialog:()=>v,default:()=>Pe});module.exports=Ce(Ge);var l=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?l(...e):typeof e=="object"?Object.keys(e).map((n,s)=>e[s]||e[n]&&n||null).filter(n=>n!==null).join(" "):e).filter(e=>!!e).join(" ");var h=(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"}),te=(t,e)=>{let{valid:n,invalid:s,hover:r,focus:c,checked:a,active:f,selected:m,disabled:y,indeterminate:H,loading:U,empty:W,readonly:E,highlighted:T,..._}=e;return l({"k-valid":n,"k-invalid":s,"k-hover":r,"k-focus":c,"k-checked":a,"k-active":f,"k-selected":m,"k-disabled":y,"k-indeterminate":H&&!a,"k-loading":U,"k-empty":W,"k-readonly":E,"k-highlighted":T},Object.keys(_).reduce((B,b)=>(b.startsWith("k-")?B[b]=_[b]:B[`k-${b}`]=_[b],B),{}))};function oe(t,e){if(!e)return{};let n=Array.isArray(e)?e:[e];return Object.fromEntries(n.map(s=>[`k-${s}`,!0]))}var i={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},w={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 F="action-buttons",ne=F;var se=require("react/jsx-runtime"),K="k-actions",Ae=[],Me={},P={alignment:"start",orientation:"horizontal"},g=t=>{let{alignment:e=P.alignment,orientation:n=P.orientation,...s}=t;return(0,se.jsx)("div",{...s,className:l(K,{[`${K}-${e}`]:e,[`${K}-${n}`]:n},t.className),children:t.children})};g.states=Ae;g.options=Me;g.className=K;g.defaultOptions=P;g.moduleName=F;g.folderName=ne;var L=require("react/jsx-runtime"),G="k-font-icon",ke=[],ye={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},Te={},I=t=>{let{size:e,themeColor:n,icon:s,rotate:r,flip:c,...a}=t;return s?(0,L.jsx)("span",{...a,className:l(t.className,G,h(G,{size:e}),{[`k-i-${s}`]:s,[`k-color-${n}`]:n,[`k-rotate-${r}`]:r,"k-flip-h":c==="h"||c==="both","k-flip-v":c==="v"||c==="both"})}):(0,L.jsx)(L.Fragment,{})};I.states=ke;I.options=ye;I.className=G;I.defaultOptions=Te;var ie=I;var M=require("react/jsx-runtime"),V="k-svg-icon",we=[],Ee={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},re={viewBox:"0 0 24 24"},S=t=>{let{size:e,themeColor:n,rotate:s,flip:r,viewBox:c=re.viewBox,icon:a,...f}=t;if(!a)return(0,M.jsx)(M.Fragment,{});a==="none"&&{...f,className:l(t.className,V,"k-none")};let m=typeof a=="object"&&a.name&&a.name;return(0,M.jsx)("span",{...f,className:l(t.className,V,h("k-icon",{size:e}),{[`k-svg-i-${m}`]:m,[`k-color-${n}`]:n,[`k-rotate-${s}`]:s,"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:t.children})})};S.states=we;S.options=Ee;S.className=V;S.defaultOptions=re;var q=S;var J=be(require("@progress/kendo-svg-icons"));var ae="icon",le="icons";var x=require("react/jsx-runtime"),R="k-icon",_e=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Be=[],Le={size:[i.xsmall,i.small,i.medium,i.large,i.xlarge,i.xxlarge,i.xxxlarge],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark]},X={viewBox:"0 0 24 24",type:"svg"},N=t=>{let{size:e,themeColor:n,icon:s,type:r=X.type,rotate:c,flip:a,viewBox:f=X.viewBox,...m}=t;if(!s)return(0,x.jsx)(x.Fragment,{});if(r==="svg"){if(s==="none")return(0,x.jsx)(q,{...m,className:l(t.className,R),icon:s,size:e});let y=J[s]?s:_e(`${s}-icon`);return J[y]?(0,x.jsx)(q,{...m,className:l(t.className,R),icon:J[y],size:e,themeColor:n,rotate:c,flip:a,viewBox:f}):(0,x.jsx)(x.Fragment,{})}return(0,x.jsx)(ie,{...m,className:l(t.className,R),icon:s,size:e,themeColor:n,rotate:c,flip:a})};N.states=Be;N.options=Le;N.defaultOptions=X;N.className=R;N.moduleName=ae;N.folderName=le;var j="button",ce=j;var u=require("react/jsx-runtime"),D="k-button",Ie=["icon-button"],Se=[A.hover,A.focus,A.active,A.selected,A.disabled,A.generating],De={size:[i.small,i.medium,i.large],rounded:[w.small,w.medium,w.large,w.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]},k={size:i.medium,rounded:w.medium,fillMode:C.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},p=t=>{let{size:e=k.size,rounded:n=k.rounded,fillMode:s=k.fillMode,themeColor:r=k.themeColor,showArrow:c=k.showArrow,arrowIconName:a=k.arrowIconName,variant:f,hover:m,focus:y,active:H,selected:U,disabled:W,icon:E,text:T,iconClassName:_,...B}=t,b=E!==void 0,fe=t.children!==void 0;return(0,u.jsxs)("button",{...B,className:l(t.className,D,oe(D,f),h(D,{size:e,rounded:n,fillMode:s,themeColor:r}),te(D,{hover:m,focus:y,active:H,disabled:W,selected:U}),{"k-icon-button":!T&&!fe&&b}),children:[E&&(0,u.jsx)(N,{className:l(_,"k-button-icon"),icon:E}),T?(0,u.jsxs)(u.Fragment,{children:[T&&(0,u.jsx)("span",{className:"k-button-text",children:T}),t.children]}):t.children&&(0,u.jsx)("span",{className:"k-button-text",children:t.children}),c&&(0,u.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,u.jsx)(N,{icon:a})})]})};p.states=Se;p.options=De;p.variants=Ie;p.className=D;p.defaultOptions=k;p.moduleName=j;p.folderName=ce;var ze=require("react/jsx-runtime");var Ke=require("react/jsx-runtime");var Re=require("react/jsx-runtime");var Q="window",de=Q;var pe=require("react/jsx-runtime"),me="k-window-content",$e=[],He={},Ue={},O=t=>{let{children:e,...n}=t;return(0,pe.jsx)("div",{...n,className:l(me,t.className),children:e})};O.states=$e;O.options=He;O.className=me;O.defaultOptions=Ue;O.moduleName=Q;O.folderName=de;var Y="dialog",ue=Y;var d=require("react/jsx-runtime"),$="k-dialog",We=[],Fe={themeColor:[o.primary,o.light,o.dark]},Z={actionButtonsAlign:"stretched",modal:!0},v=t=>{let{title:e,actions:n,themeColor:s,actionButtons:r,actionButtonsAlign:c=Z.actionButtonsAlign,modal:a=Z.modal,...f}=t;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(t.className,$,"k-window",h($,{themeColor:s})),children:[(e!==void 0||n)&&(0,d.jsxs)("div",{className:"k-window-titlebar k-dialog-titlebar",children:[e!==void 0&&(0,d.jsx)("span",{className:"k-window-title k-dialog-title",children:e}),n&&(0,d.jsx)(d.Fragment,{children:(0,d.jsx)("div",{className:"k-window-titlebar-actions k-dialog-titlebar-actions",children:n.map(m=>(0,d.jsx)(p,{icon:m,fillMode:"flat",className:"k-window-titlebar-action k-dialog-titlebar-action"},m))})})]}),(0,d.jsx)(O,{className:"k-dialog-content",children:t.children}),r&&(0,d.jsx)(g,{alignment:c,className:"k-window-actions k-dialog-actions",children:r})]})]})};v.states=We;v.options=Fe;v.className=$;v.defaultOptions=Z;v.moduleName=Y;v.folderName=ue;var Pe=v;