UNPKG

@progress/kendo-themes-html

Version:

A collection of HTML helpers used for developing Kendo UI themes

2 lines (1 loc) 2.42 kB
var n=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?n(...e):typeof e=="object"?Object.keys(e).map((t,a)=>e[a]||e[t]&&t||null).filter(t=>t!==null).join(" "):e).filter(e=>!!e).join(" ");var g=(o,e)=>{let{valid:t,invalid:a,hover:s,focus:c,checked:d,active:u,selected:y,disabled:C,indeterminate:A,loading:M,empty:$,readonly:E,highlighted:L,...m}=e;return n({"k-valid":t,"k-invalid":a,"k-hover":s,"k-focus":c,"k-checked":d,"k-active":u,"k-selected":y,"k-disabled":C,"k-indeterminate":A&&!d,"k-loading":M,"k-empty":$,"k-readonly":E,"k-highlighted":L},Object.keys(m).reduce((h,l)=>(l.startsWith("k-")?h[l]=m[l]:h[`k-${l}`]=m[l],h),{}))};var i={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"},k={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};import{jsx as R}from"react/jsx-runtime";var N="k-card-callout",b=o=>{let{callout:e,...t}=o;return R("span",{...t,className:n(o.className,N,{[`k-callout-${k.calloutMap[e]||e}`]:e})})};var x="card",p=x;import{Fragment as S,jsx as v,jsxs as _}from"react/jsx-runtime";var f="k-card",K=[i.hover,i.focus,i.selected,i.disabled],D={},O={},r=o=>{let{orientation:e,callout:t,hover:a,focus:s,selected:c,disabled:d,...u}=o;return _("div",{...u,className:n(o.className,f,g(f,{hover:a,focus:s,disabled:d,selected:c}),{[`k-card-${e}`]:e,"k-card-with-callout":t}),children:[t&&t!=="true"&&v(b,{callout:t}),v(S,{children:o.children})]})};r.states=K;r.options=D;r.className=f;r.defaultOptions=O;r.moduleName=x;r.folderName=p;r.ariaSpec={selector:".k-card",rules:[{selector:".k-card-list .k-card",attribute:"role=listitem",usage:"When the card is located in a list, it should have the listitem role."},{selector:".k-card-list .k-card",attribute:"tabindex=0",usage:"The card component is focusable when navigatable."},{selector:".k-card-list .k-card",attribute:"aria-describedby=.k-card-title id",usage:"Associate the card to the title element."},{selector:".k-card-list .k-card",attribute:"aria-keyshortcuts=Enter",usage:"Announces the bound Enter key that enables navigation inside the card."}]};var Y=r;export{f as CARD_CLASSNAME,r as Card,Y as default};