@umbraco-ui/uui-visually-hidden
Version:
Umbraco UI visually-hidden component
37 lines (34 loc) • 1.16 kB
JavaScript
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
import { css, LitElement, html } from 'lit';
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
if (decorator = decorators[i])
result = (decorator(result)) || result;
return result;
};
let UUIVisuallyHiddenElement = class extends LitElement {
render() {
return html`<slot></slot>`;
}
};
UUIVisuallyHiddenElement.styles = [
css`
:host(:not(:focus-within)) {
position: absolute ;
width: 1px ;
height: 1px ;
clip: rect(0 0 0 0) ;
clip-path: inset(50%) ;
border: none ;
overflow: hidden ;
white-space: nowrap ;
padding: 0 ;
}
`
];
UUIVisuallyHiddenElement = __decorateClass([
defineElement("uui-visually-hidden")
], UUIVisuallyHiddenElement);
export { UUIVisuallyHiddenElement };