UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 9.42 kB
var fe=Object.create;var O=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var xe=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,Ce=Object.prototype.hasOwnProperty;var be=(t,e)=>{for(var r in e)O(t,r,{get:e[r],enumerable:!0})},Q=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of xe(e))!Ce.call(t,l)&&l!==r&&O(t,l,{get:()=>e[l],enumerable:!(n=pe(e,l))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?fe(he(t)):{},Q(e||!t||!t.__esModule?O(r,"default",{value:t,enumerable:!0}):r,t)),ye=t=>Q(O({},"__esModule",{value:!0}),t);var Ye={};be(Ye,{CardNormal:()=>qe});module.exports=ye(Ye);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 v=(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});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"},y={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"},W={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var Z=require("react/jsx-runtime"),Ne="k-card-callout",X=t=>{let{callout:e,...r}=t;return(0,Z.jsx)("span",{...r,className:a(t.className,Ne,{[`k-callout-${W.calloutMap[e]||e}`]:e})})};var N=require("react/jsx-runtime"),K="k-card",ge=[d.hover,d.focus,d.selected,d.disabled],ke={themeColor:[o.primary,o.success,o.warning,o.error,o.info]},Ae={},g=t=>{let{orientation:e,themeColor:r,callout:n,hover:l,focus:m,selected:i,disabled:b,...p}=t;return(0,N.jsxs)("div",{...p,className:a(t.className,K,v(K,{themeColor:r}),S(K,{hover:l,focus:m,disabled:b,selected:i}),{[`k-card-${e}`]:e,"k-card-with-callout":n}),children:[n&&n!=="true"&&(0,N.jsx)(X,{callout:n}),(0,N.jsx)(N.Fragment,{children:t.children})]})};g.states=ge;g.options=ke;g.className=K;g.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:l,flip:m,...i}=t;return n?(0,z.jsx)("span",{...i,className:a(t.className,F,v(F,{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,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:l,viewBox:m=re.viewBox,icon:i,...b}=t;if(!i)return(0,k.jsx)(k.Fragment,{});i==="none"&&{...b,className:a(t.className,G,"k-none")};let p=typeof i=="object"&&i.name&&i.name;return(0,k.jsx)("span",{...b,className:a(t.className,G,v("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,k.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})})};H.states=ze;H.options=we;H.className=G;H.defaultOptions=re;var V=H;var ne=ve(require("@progress/kendo-svg-icons")),C=require("react/jsx-runtime"),He=t=>t.replace(/([-_][a-z0-9])/gi,e=>e.toUpperCase().replace("-","").replace("_","")),Ie=[],Ee={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:l=U.type,rotate:m,flip:i,viewBox:b=U.viewBox,...p}=t;if(!n)return(0,C.jsx)(C.Fragment,{});if(l==="svg"){if(n==="none")return(0,C.jsx)(V,{...p,icon:n,size:e});let I=He(`${n}-icon`);return ne[I]?(0,C.jsx)(V,{...p,icon:ne[I],size:e,themeColor:r,rotate:m,flip:i,viewBox:b}):(0,C.jsx)(C.Fragment,{})}return(0,C.jsx)(oe,{...p,icon:n,size:e,themeColor:r,rotate:m,flip:i})};L.states=Ie;L.options=Ee;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:[y.solid,y.flat,y.outline,y.clear,y.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:y.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:l=A.themeColor,showArrow:m=A.showArrow,arrowIconName:i=A.arrowIconName,hover:b,focus:p,active:I,selected:le,disabled:ie,icon:P,text:E,iconClassName:ce,...de}=t,me=P!==void 0,ue=t.children!==void 0;return(0,f.jsxs)("button",{...de,className:a(t.className,$,v($,{size:e,rounded:r,fillMode:n,themeColor:l}),S($,{hover:b,focus:p,active:I,disabled:ie,selected:le}),{"k-icon-button":!E&&!ue&&me}),children:[P&&(0,f.jsx)(L,{className:a(ce,"k-button-icon"),icon:P}),E?(0,f.jsxs)(f.Fragment,{children:[E&&(0,f.jsx)("span",{className:"k-button-text",children:E}),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:i})})]})};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 x=require("react/jsx-runtime"),Pe="k-card-header",ae=t=>{let{title:e,subtitle:r,details:n,...l}=t;return(0,x.jsxs)("div",{...l,className:a(t.className,Pe),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 _e=require("react/jsx-runtime");var h=require("react/jsx-runtime"),Fe="k-card-body",q=t=>{let{title:e,subtitle:r,details:n,...l}=t;return(0,h.jsxs)("div",{...l,className:a(t.className,Fe),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 Ge=require("react/jsx-runtime");var se=require("react/jsx-runtime"),D="k-actions",Ve=[],Ue={},Y={alignment:"start",orientation:"horizontal"},M=t=>{let{alignment:e=Y.alignment,orientation:r=Y.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=Y;var J=require("react/jsx-runtime");var u=require("react/jsx-runtime"),qe=t=>(0,u.jsx)(g,{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});