UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

34 lines (33 loc) 1.9 kB
import { i as n } from "./factory-WDxu11V0.js"; import "./builder-EH76YCFS.js"; import { i as r, n as s, o as i, t as o } from "./utils-U-9uH7EX.js"; import { a as h, n as l } from "./ssr-BzykYefm.js"; var d = '@keyframes skeleton{0%{transform:translate(-37.5%)}to{transform:translate(37.5%)}}:host{display:block;width:var(--ran-skeleton-width, 100%);height:var(--ran-skeleton-height, var(--ran-size-1, 16px))}:host([hidden]){display:none}.ran-skeleton{position:relative;z-index:0;overflow:hidden;background:0 0;width:100%;height:var(--ran-skeleton-height, var(--ran-size-1, 16px));background:var(--ran-skeleton-background, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)));border-radius:var(--ran-skeleton-border-radius, var(--ran-radius-sm, 6px))}.ran-skeleton:after{position:absolute;top:0;inset-inline-end:-150%;bottom:0;inset-inline-start:-150%;background:var(--ran-skeleton-shimmer-background, linear-gradient(90deg, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 25%, var(--ran-gray-alpha-500, rgba(0, 0, 0, .15)) 37%, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 63%));animation-name:skeleton;animation-duration:var(--ran-skeleton-shimmer-animation-duration, 1.4s);animation-timing-function:ease;animation-iteration-count:infinite;content:""}', m = class extends l { _div; _shadowDom; static get observedAttributes() { return ["sheet"]; } constructor() { super(), this._shadowDom = o(this, d), this._div = n().class("ran-skeleton").build(), this._shadowDom.appendChild(this._div); } get sheet() { return s(this, "sheet"); } set sheet(t) { r(this, "sheet", t); } handlerExternalCss = () => { i(this, this._shadowDom, "sheet", null, this.sheet); }; connectedCallback() { this.handlerExternalCss(); } attributeChangedCallback(t, e, a) { e !== a && t === "sheet" && this.handlerExternalCss(); } }; h("r-skeleton", m); export { m as t };