UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

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