{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "skeleton",
  "type": "registry:ui",
  "title": "<ui-skeleton>",
  "description": "Loading placeholder in the shape of the content to come (Carbon skeleton states). Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [
    "lit@^3.3.0"
  ],
  "registryDependencies": [
    "@kanok-ui/shared-element",
    "@kanok-ui/shared-skeleton",
    "@kanok-ui/tokens"
  ],
  "files": [
    {
      "path": "src/primitives/skeleton/skeleton.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/skeleton/skeleton.ts",
      "content": "import { html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { UiElement } from '../shared/element.ts';\nimport { skeletonStyles } from '../shared/skeleton.ts';\n\nexport type SkeletonShape = 'text' | 'heading' | 'field' | 'button' | 'block';\n\n/**\n * Loading placeholder in the shape of the content to come (Carbon skeleton states).\n *\n * Purely visual: hidden from assistive tech and never focusable. Tell screen-reader users\n * about loading on the container instead — `aria-busy=\"true\"` plus a short status message\n * (e.g. a `role=\"status\"` \"Loading contracts…\") — and drop both when the content arrives.\n *\n * Carbon look: the skeleton-background bar with Carbon's 3s skeleton-element sweep (`shared/skeleton.ts`).\n *\n * @cssprop --ui-skeleton-width - Width (default: full width; buttons 120px)\n * @cssprop --ui-skeleton-height - Height of `shape=\"block\"` (default 160px)\n * @csspart bone - Each grey placeholder bar\n * @csspart label - The short label bar of `shape=\"field\"`\n */\n@customElement('ui-skeleton')\nexport class UiSkeleton extends UiElement {\n    static override readonly styles = [\n        skeletonStyles,\n        css`\n            :host {\n                display: block;\n            }\n\n            .bone {\n                height: 14px;\n                width: var(--ui-skeleton-width, 100%);\n            }\n\n            .bone + .bone {\n                margin-top: var(--ui-space-xs);\n            }\n\n            /* Last text line is shorter so it reads as a paragraph */\n            :host([shape='text']) .bone:last-child:not(:first-child) {\n                width: 60%;\n            }\n\n            :host([shape='heading']) .bone {\n                height: 24px;\n                width: var(--ui-skeleton-width, 50%);\n            }\n\n            :host([shape='field']) .label {\n                height: 12px;\n                width: 30%;\n                margin-bottom: var(--ui-space-xs);\n            }\n\n            :host([shape='field']) .bone:not(.label) {\n                height: 48px;\n            }\n\n            :host([shape='button']) {\n                display: inline-block;\n            }\n\n            :host([shape='button']) .bone {\n                height: 48px;\n                width: var(--ui-skeleton-width, 120px);\n            }\n\n            :host([shape='block']) .bone {\n                height: var(--ui-skeleton-height, 160px);\n            }\n        `,\n    ];\n\n    @property({ reflect: true }) shape: SkeletonShape = 'text';\n\n    /** Number of lines for `shape=\"text\"`. */\n    @property({ type: Number }) lines = 3;\n\n    override connectedCallback() {\n        super.connectedCallback();\n        this.setAttribute('aria-hidden', 'true');\n    }\n\n    override render() {\n        if (this.shape === 'text') {\n            return Array.from({ length: Math.max(1, this.lines) }, () => html`<div class=\"bone\" part=\"bone\"></div>`);\n        }\n        if (this.shape === 'field') {\n            return html`<div class=\"bone label\" part=\"bone label\"></div><div class=\"bone\" part=\"bone\"></div>`;\n        }\n        return html`<div class=\"bone\" part=\"bone\"></div>`;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-skeleton': UiSkeleton;\n    }\n}\n"
    }
  ]
}
