@progress/kendo-themes-html
Version:
A collection of HTML helpers used for developing Kendo UI themes
2 lines (1 loc) • 3.41 kB
JavaScript
var r=(...o)=>o.filter(e=>e!==!0&&!!e).map(e=>Array.isArray(e)?r(...e):typeof e=="object"?Object.keys(e).map((t,n)=>e[n]||e[t]&&t||null).filter(t=>t!==null).join(" "):e).filter(e=>!!e).join(" ");var b={calloutMap:{top:"n",bottom:"s",left:"w",right:"e"},orientationMap:{vertical:"vstack",horizontal:"hstack"}};var p={};function v(o){return p[o]=(p[o]||0)+1,`k-${o}-${p[o]}`}var m="popup",g=m;import{jsx as x}from"react/jsx-runtime";var N="k-animation-container",R=[],T={},u={positionMode:"absolute",shown:!0},s=o=>{let{positionMode:e=u.positionMode,shown:t=u.shown,animationStyle:n,offset:i,...d}=o;return x("div",{...d,style:{...i,...o.style},className:r(o.className,N,{"k-animation-container-shown":t,"k-animation-container-fixed":e==="fixed"}),children:x("div",{className:"k-child-animation-container",style:n,children:o.children})})};s.states=R;s.options=T;s.className=N;s.defaultOptions=u;s.moduleName=m;s.folderName=g;var f="popup",A=f;import{jsx as M}from"react/jsx-runtime";var k="k-popup",C=[],S={},y={positionMode:"absolute"},a=o=>{let{offset:e,positionMode:t=y.positionMode,animationStyle:n,containerClassName:i,containerRole:d,containerAriaLabel:_,...L}=o;return M(s,{positionMode:t,offset:e,animationStyle:n,className:i,role:d,"aria-label":_,children:M("div",{...L,className:r(o.className,k),children:o.children})})};a.states=C;a.options=S;a.className=k;a.defaultOptions=y;a.moduleName=f;a.folderName=A;a.ariaSpec={selector:".k-popup",rules:[{selector:".k-animation-container",attribute:"role (when appended to body)",usage:'Container gets role="region" when appended to document body. Popup is a building block \u2014 ARIA semantics come from consuming components.'}]};var h="popover",P=h;import{Fragment as D,jsx as c,jsxs as E}from"react/jsx-runtime";var O="k-popover",$=[],w={},I={},l=o=>{let{callout:e,title:t,body:n,id:i=v("popover"),...d}=o;return E(a,{...d,className:r(o.className,O),role:"dialog",id:i,"aria-labelledby":t?`${i}-header`:void 0,"aria-describedby":n?`${i}-body`:void 0,children:[e&&c("div",{className:r("k-popover-callout",{[`k-callout-${b.calloutMap[e]||e}`]:e})}),E("div",{className:"k-popover-inner",children:[t&&c("div",{className:"k-popover-header",id:`${i}-header`,children:t}),n&&c("div",{className:"k-popover-body",id:`${i}-body`,children:n}),c(D,{children:o.children})]})]})};l.states=$;l.options=w;l.className=O;l.defaultOptions=I;l.moduleName=h;l.folderName=P;l.ariaSpec={selector:".k-popover",implicitRole:"dialog",rules:[{selector:".k-popover",attribute:"role=dialog",usage:"Announces the dialog role when the popover contains focusable elements. Use role=tooltip when it does not."},{selector:".k-popover",attribute:"id",usage:"The element needs an id to be associated with the aria-describedby attribute of the trigger element."},{selector:".k-popover",attribute:"aria-labelledby",usage:"Links the popover container with the popover header element when there is focusable content."},{selector:".k-popover",attribute:"aria-describedby",usage:"Links the popover container with the popover body element when there is focusable content."},{selector:".k-popover-header",attribute:"id",usage:"Links the popover header with the popover container via aria-labelledby."},{selector:".k-popover-body",attribute:"id",usage:"Links the popover body with the popover container via aria-describedby."}]};var ue=l;export{O as POPOVER_CLASSNAME,l as Popover,ue as default};