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