{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stack",
  "type": "registry:ui",
  "title": "<ui-stack>",
  "description": "Carbon `Stack`: lays its children out in one direction with one gap. `gap` is a Carbon spacing step (1–13, e.g. `gap=\"5\"` = 16px) or any CSS length (`gap=\"1.5rem\"`). 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/core-stack",
    "@kanok-ui/shared-element",
    "@kanok-ui/tokens"
  ],
  "files": [
    {
      "path": "src/primitives/stack/stack.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/stack/stack.ts",
      "content": "import { html, css } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { UiElement } from '../shared/element.ts';\nimport { stackGap } from '../../core/stack.ts';\n\n/**\n * Carbon `Stack`: lays its children out in one direction with one gap. `gap` is a Carbon spacing\n * step (1–13, e.g. `gap=\"5\"` = 16px) or any CSS length (`gap=\"1.5rem\"`).\n *\n * @slot - The items\n * @cssprop --ui-stack-gap - The gap (set by `gap`; override per zone)\n */\n@customElement('ui-stack')\nexport class UiStack extends UiElement {\n    static override readonly styles = css`\n        :host {\n            display: grid;\n            grid-auto-flow: row;\n            row-gap: var(--ui-stack-gap, 0);\n        }\n\n        :host([orientation='horizontal']) {\n            display: inline-grid;\n            grid-auto-flow: column;\n            row-gap: 0;\n            column-gap: var(--ui-stack-gap, 0);\n        }\n    `;\n\n    @property({ reflect: true }) orientation: 'vertical' | 'horizontal' = 'vertical';\n\n    /** Spacing step 1–13 or a CSS length. */\n    @property() gap = '';\n\n    protected override updated(changed: Map<string, unknown>) {\n        if (!changed.has('gap')) return;\n        const value = stackGap(this.gap);\n        if (value) this.style.setProperty('--ui-stack-gap', value);\n        else this.style.removeProperty('--ui-stack-gap');\n    }\n\n    override render() {\n        return html`<slot></slot>`;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-stack': UiStack;\n    }\n}\n"
    }
  ]
}
