UNPKG

@umbraco-ui/uui-visually-hidden

Version:

Umbraco UI visually-hidden component

37 lines (34 loc) 1.16 kB
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 !important; width: 1px !important; height: 1px !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; border: none !important; overflow: hidden !important; white-space: nowrap !important; padding: 0 !important; } ` ]; UUIVisuallyHiddenElement = __decorateClass([ defineElement("uui-visually-hidden") ], UUIVisuallyHiddenElement); export { UUIVisuallyHiddenElement };