{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "list",
  "type": "registry:ui",
  "title": "<ui-list>",
  "description": "ui-list component. 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/tokens"
  ],
  "files": [
    {
      "path": "src/primitives/list/list-item.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/list/list-item.ts",
      "content": "import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { UiElement } from '../shared/element.ts';\n\n/**\n * Carbon `ListItem` (`cds-list-item`): one item of a `<ui-unordered-list>` / `<ui-ordered-list>` (text-primary); put a\n * list inside it to nest.\n *\n * @slot - The item's content, and a nested list\n */\n@customElement('ui-list-item')\nexport class UiListItem extends UiElement {\n    static override readonly styles = css`\n        :host {\n            display: list-item;\n            color: var(--ui-ink);\n        }\n    `;\n\n    override connectedCallback() {\n        super.connectedCallback();\n        if (!this.hasAttribute('role')) this.setAttribute('role', 'listitem');\n    }\n\n    override render() {\n        return html`<slot></slot>`;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-list-item': UiListItem;\n    }\n}\n"
    },
    {
      "path": "src/primitives/list/list-shared.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/list/list-shared.ts",
      "content": "import { css } from 'lit';\n\n/** body-01 (14px / 20px, 0.16px) on a list; `is-expressive` body-02 (16px / 24px). A nested list takes its parent's. */\nexport const listStyles = css`\n    :host {\n        display: block;\n    }\n\n    .list {\n        margin: 0;\n        padding: 0;\n        list-style: none;\n        font: var(--ui-font-body-sm);\n        line-height: 20px; /* body-01 */\n        letter-spacing: var(--ui-tracking-body);\n    }\n\n    :host([nested]) .list {\n        margin-inline-start: 32px;\n        font: inherit;\n        letter-spacing: inherit;\n    }\n\n    :host([is-expressive]) .list {\n        font: var(--ui-font-body); /* body-02 */\n        letter-spacing: 0;\n    }\n\n    ::slotted(*) {\n        position: relative;\n    }\n\n    /* !important: a page-level reset (Tailwind preflight's * { padding: 0 }) beats ::slotted rules */\n    :host([nested]) ::slotted(*) {\n        padding-inline-start: var(--ui-space-xxs) !important;\n    }\n`;\n\n/** Puts a list nested in a `<ui-list-item>` in nested mode (Carbon `nested`, set for you). */\nexport function nestedIn(list: HTMLElement) {\n    return !!list.parentElement?.closest('ui-list-item');\n}\n"
    },
    {
      "path": "src/primitives/list/list.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/list/list.ts",
      "content": "// One element per file in this folder; this module is the entry point (package export, React wrappers, index).\nexport * from './unordered-list.ts';\nexport * from './ordered-list.ts';\nexport * from './list-item.ts';\n"
    },
    {
      "path": "src/primitives/list/ordered-list.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/list/ordered-list.ts",
      "content": "import { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { UiElement } from '../shared/element.ts';\nimport { listStyles, nestedIn } from './list-shared.ts';\n\n/**\n * Carbon `OrderedList` (`cds-ordered-list`): `<ui-list-item>`s numbered \"1.\" 24px before the text (outside the list's\n * box, as Carbon); a nested list uses the browser's lower-latin markers (a. b. c.), 32px in. `native` uses the\n * browser's decimal markers at the top level too.\n *\n * @slot - `<ui-list-item>` elements\n * @csspart list - The `<ol>`\n */\n@customElement('ui-ordered-list')\nexport class UiOrderedList extends UiElement {\n    static override readonly styles = [\n        listStyles,\n        css`\n            :host(:not([nested])) {\n                counter-reset: item;\n            }\n\n            :host(:not([nested]):not([native])) ::slotted(*)::before {\n                content: counter(item) '.';\n                counter-increment: item;\n                position: absolute;\n                inset-inline-start: -24px;\n            }\n\n            :host([native]) .list {\n                list-style: decimal;\n            }\n\n            :host([nested]) .list {\n                list-style: lower-latin;\n            }\n        `,\n    ];\n\n    /** Nested in another list's item (set for you when it sits in a `<ui-list-item>`). */\n    @property({ type: Boolean, reflect: true }) nested = false;\n\n    /** The browser's own markers (`decimal`) instead of Carbon's counter. */\n    @property({ type: Boolean, reflect: true }) native = false;\n\n    /** Body-02 type (16px) for expressive pages. */\n    @property({ type: Boolean, reflect: true, attribute: 'is-expressive' }) isExpressive = false;\n\n    override connectedCallback() {\n        super.connectedCallback();\n        if (nestedIn(this)) this.nested = true;\n    }\n\n    override render() {\n        return html`<ol class=\"list\" part=\"list\"><slot></slot></ol>`;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-ordered-list': UiOrderedList;\n    }\n}\n"
    },
    {
      "path": "src/primitives/list/unordered-list.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/list/unordered-list.ts",
      "content": "import { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { UiElement } from '../shared/element.ts';\nimport { listStyles, nestedIn } from './list-shared.ts';\n\n/**\n * Carbon `UnorderedList` (`cds-unordered-list`): `<ui-list-item>`s marked with an en dash 16px before the text, the\n * list 16px in; a list inside an item is nested (32px in, a ▪ marker 12px before the text, items 4px in).\n *\n * @slot - `<ui-list-item>` elements\n * @csspart list - The `<ul>`\n */\n@customElement('ui-unordered-list')\nexport class UiUnorderedList extends UiElement {\n    static override readonly styles = [\n        listStyles,\n        css`\n            :host(:not([nested])) .list {\n                margin-inline-start: var(--ui-space-md);\n            }\n\n            ::slotted(*)::before {\n                content: '\\\\2013';\n                position: absolute;\n                inset-inline-start: -16px;\n            }\n\n            :host([nested]) ::slotted(*)::before {\n                content: '\\\\25AA\\\\FE0E';\n                inset-inline-start: -12px;\n            }\n        `,\n    ];\n\n    /** Nested in another list's item (set for you when it sits in a `<ui-list-item>`). */\n    @property({ type: Boolean, reflect: true }) nested = false;\n\n    /** Body-02 type (16px) for expressive pages. */\n    @property({ type: Boolean, reflect: true, attribute: 'is-expressive' }) isExpressive = false;\n\n    override connectedCallback() {\n        super.connectedCallback();\n        if (nestedIn(this)) this.nested = true;\n    }\n\n    override render() {\n        return html`<ul class=\"list\" part=\"list\"><slot></slot></ul>`;\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-unordered-list': UiUnorderedList;\n    }\n}\n"
    }
  ]
}
