@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 9.48 kB
JavaScript
var fe=Object.create;var O=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var xe=Object.getPrototypeOf,Ce=Object.prototype.hasOwnProperty;var be=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},Y=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of he(e))!Ce.call(t,i)&&i!==r&&O(t,i,{get:()=>e[i],enumerable:!(n=pe(e,i))||n.enumerable});return t};var ge=(t,e,r)=>(r=t!=null?fe(xe(t)):{},Y(e||!t||!t.__esModule?O(r,"default",{value:t,enumerable:!0}):r,t)),ve=t=>Y(O({},"__esModule",{value:!0}),t);var Je={};be(Je,{CardNormal:()=>qe});module.exports=ve(Je);var a=(...t)=>t.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?a(...e):typeof e=="object"?Object.keys(e).map((r,n)=>e[n]||e[r]&&r||null).filter(r=>r!==null).join(" "):e).filter(e=>!!e).join(" ");var g=(t,e)=>a({[`${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"}),S=(t,e)=>a({"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 s={xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge",xxlarge:"xxlarge",xxxlarge:"xxxlarge"},T={small:"small",medium:"medium",large:"large",full:"full"},v={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"},d={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"},Q={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var Z=require("react/jsx-runtime"),ye="k-card-callout",W=t=>{let{callout:e,...r}=t;return(0,Z.jsx)("span",{...r,className:a(t.className,ye,{[`k-callout-${Q.calloutMap[e]||e}`]:e})})};var y=require("react/jsx-runtime"),K="k-card",Ne=[d.hover,d.focus,d.selected,d.disabled],ke={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Ae={},N=t=>{let{orientation:e,themeColor:r,callout:n,hover:i,focus:m,selected:l,disabled:b,...p}=t;return(0,y.jsxs)("div",{...p,className:a(t.className,K,g(K,{themeColor:r}),S(K,{hover:i,focus:m,disabled:b,selected:l}),{[`k-card-${e}`]:e,"k-card-with-callout":n}),children:[n&&n!=="true"&&(0,y.jsx)(W,{callout:n}),(0,y.jsx)(y.Fragment,{children:t.children})]})};N.states=Ne;N.options=ke;N.className=K;N.defaultOptions=Ae;var j=require("react/jsx-runtime"),_="k-card-title",Me=[d.hover,d.focus],B=t=>{let{hover:e,focus:r,...n}=t;return(0,j.jsx)("div",{...n,className:a(t.className,_,S(_,{hover:e,focus:r})),children:t.children})};B.states=Me;B.className=_;var ee=require("react/jsx-runtime"),Se="k-card-subtitle",R=t=>{let{...e}=t;return(0,ee.jsx)("div",{...e,className:a(t.className,Se),children:t.children})};var te=require("react/jsx-runtime");var z=require("react/jsx-runtime"),F="k-icon k-font-icon",Te=[],Be={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]},Le={},w=t=>{let{size:e,themeColor:r,icon:n,rotate:i,flip:m,...l}=t;return n?(0,z.jsx)("span",{...l,className:a(t.className,F,g(F,{size:e}),{[`k-i-${n}`]:n,[`k-color-${r}`]:r,[`k-rotate-${i}`]:i,"k-flip-h":m==="h"||m==="both","k-flip-v":m==="v"||m==="both"})}):(0,z.jsx)(z.Fragment,{})};w.states=Te;w.options=Be;w.className=F;w.defaultOptions=Le;var oe=w;var k=require("react/jsx-runtime"),G="k-icon k-svg-icon",ze=[],we={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]},re={viewBox:"0 0 24 24"},H=t=>{let{size:e,themeColor:r,rotate:n,flip:i,viewBox:m=re.viewBox,icon:l,...b}=t;if(!l)return(0,k.jsx)(k.Fragment,{});l==="none"&&{...b,className:a(t.className,G,"k-none")};let p=typeof l=="object"&&l.name&&l.name;return(0,k.jsx)("span",{...b,className:a(t.className,G,g("k-icon",{size:e}),{[`k-svg-i-${p}`]:p,[`k-color-${r}`]:r,[`k-rotate-${n}`]:n,"k-flip-h":i==="h"||i==="both","k-flip-v":i==="v"||i==="both"}),children:(0,k.jsx)("svg",{"aria-hidden":!0,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:typeof l=="object"?l.viewBox:m,dangerouslySetInnerHTML:typeof l=="object"?{__html:l.content}:void 0,children:l?void 0:t.children})})};H.states=ze;H.options=we;H.className=G;H.defaultOptions=re;var V=H;var ne=ge(require("@progress/kendo-svg-icons")),C=require("react/jsx-runtime"),He=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ee=[],Ie={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]},U={viewBox:"0 0 24 24",type:"svg"},L=t=>{let{size:e,themeColor:r,icon:n,type:i=U.type,rotate:m,flip:l,viewBox:b=U.viewBox,...p}=t;if(!n)return(0,C.jsx)(C.Fragment,{});if(i==="svg"){if(n==="none")return(0,C.jsx)(V,{...p,icon:n,size:e});let E=He(`${n}-icon`);return ne[E]?(0,C.jsx)(V,{...p,icon:ne[E],size:e,themeColor:r,rotate:m,flip:l,viewBox:b}):(0,C.jsx)(C.Fragment,{})}return(0,C.jsx)(oe,{...p,icon:n,size:e,themeColor:r,rotate:m,flip:l})};L.states=Ee;L.options=Ie;L.defaultOptions=U;var f=require("react/jsx-runtime"),$="k-button",Oe=[d.hover,d.focus,d.active,d.selected,d.disabled],Ke={size:[s.small,s.medium,s.large],rounded:[T.small,T.medium,T.large,T.full],fillMode:[v.solid,v.flat,v.outline,v.clear,v.link],themeColor:[o.base,o.primary,o.secondary,o.tertiary,o.success,o.warning,o.error,o.info,o.light,o.dark,o.inverse]},A={size:s.medium,rounded:T.medium,fillMode:v.solid,themeColor:o.base,showArrow:!1,arrowIconName:"caret-alt-down"},c=t=>{let{size:e=A.size,rounded:r=A.rounded,fillMode:n=A.fillMode,themeColor:i=A.themeColor,showArrow:m=A.showArrow,arrowIconName:l=A.arrowIconName,hover:b,focus:p,active:E,selected:ie,disabled:le,icon:P,text:I,iconClassName:ce,...de}=t,me=P!==void 0,ue=t.children!==void 0;return(0,f.jsxs)("button",{...de,className:a(t.className,$,g($,{size:e,rounded:r,fillMode:n,themeColor:i}),S($,{hover:b,focus:p,active:E,disabled:le,selected:ie}),{"k-icon-button":!I&&!ue&&me}),children:[P&&(0,f.jsx)(L,{className:a(ce,"k-button-icon"),icon:P}),I?(0,f.jsxs)(f.Fragment,{children:[I&&(0,f.jsx)("span",{className:"k-button-text",children:I}),t.children]}):t.children&&(0,f.jsx)("span",{className:"k-button-text",children:t.children}),m&&(0,f.jsx)("span",{className:"k-menu-button-arrow k-button-arrow",children:(0,f.jsx)(L,{icon:l})})]})};c.states=Oe;c.options=Ke;c.className=$;c.defaultOptions=A;var Re=require("react/jsx-runtime");var $e=require("react/jsx-runtime");var De=require("react/jsx-runtime");var h=require("react/jsx-runtime"),Pe="k-card-header",ae=t=>{let{title:e,subtitle:r,details:n,...i}=t;return(0,h.jsxs)("div",{...i,className:a(t.className,Pe),children:[e&&(0,h.jsx)(B,{children:e}),r&&(0,h.jsx)(R,{children:r}),(0,h.jsx)(h.Fragment,{children:t.children}),n&&(0,h.jsx)("span",{className:"k-card-header-actions",children:(0,h.jsx)(c,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var _e=require("react/jsx-runtime");var x=require("react/jsx-runtime"),Fe="k-card-body",q=t=>{let{title:e,subtitle:r,details:n,...i}=t;return(0,x.jsxs)("div",{...i,className:a(t.className,Fe),children:[e&&(0,x.jsx)(B,{children:e}),r&&(0,x.jsx)(R,{children:r}),(0,x.jsx)(x.Fragment,{children:t.children}),n&&(0,x.jsx)("span",{className:"k-card-header-actions",children:(0,x.jsx)(c,{className:"k-card-details",icon:"more-vertical",rounded:"medium",size:"medium",fillMode:"flat",themeColor:"base"})})]})};var Ge=require("react/jsx-runtime");var se=require("react/jsx-runtime"),D="k-actions",Ve=[],Ue={},J={alignment:"start",orientation:"horizontal"},M=t=>{let{alignment:e=J.alignment,orientation:r=J.orientation,...n}=t;return(0,se.jsx)("div",{...n,className:a(D,{[`${D}-${e}`]:e,[`${D}-${r}`]:r},t.className),children:t.children})};M.states=Ve;M.options=Ue;M.className=D;M.defaultOptions=J;var X=require("react/jsx-runtime");var u=require("react/jsx-runtime"),qe=t=>(0,u.jsx)(N,{orientation:"vertical",children:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(ae,{children:"Card Header"}),(0,u.jsx)(q,{children:(0,u.jsx)("p",{children:"Some quick example text to build on the card title and make up the bulk of the card's content."})}),(0,u.jsxs)(M,{className:"k-card-actions",children:[(0,u.jsx)(c,{fillMode:"flat",themeColor:"primary",children:"Action 1"}),(0,u.jsx)(c,{fillMode:"flat",themeColor:"primary",children:"Action 2"})]})]}),...t});