{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status-indicator",
  "type": "registry:ui",
  "title": "<ui-status-indicator>",
  "description": "ui-status-indicator 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/core-position",
    "@kanok-ui/core-status-indicator",
    "@kanok-ui/definition-tooltip",
    "@kanok-ui/shared-align",
    "@kanok-ui/shared-element",
    "@kanok-ui/shared-field",
    "@kanok-ui/tokens"
  ],
  "files": [
    {
      "path": "src/primitives/status-indicator/icon-indicator.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/status-indicator/icon-indicator.ts",
      "content": "import { css, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ICON_INDICATOR_KINDS, iconIndicatorLook, type IconIndicatorKind } from '../../core/status-indicator.ts';\nimport type { Placement } from '../../core/position.ts';\nimport { WithAlign } from '../shared/align.ts';\nimport { UiElement } from '../shared/element.ts';\nimport { indicatorStyles, renderIndicator, renderIcon } from './status-indicator-shared.ts';\n\n/**\n * Carbon `IconIndicator` (preview, `cds-icon-indicator`): a status shown by Carbon's icon for `kind`, in its status\n * colour, followed by `label` — 16px icon with body-compact-01, or `size=\"20\"` with body-compact-02. `compact` shows\n * only the icon, with the label in a tooltip on hover / focus (`icon-description` is read instead, if set).\n *\n * @csspart icon - The icon\n * @csspart label - The label (not compact)\n * @attr align - Carbon's name for `placement` (same values)\n */\n@customElement('ui-icon-indicator')\nexport class UiIconIndicator extends WithAlign(UiElement) {\n    static override readonly styles = [\n        indicatorStyles,\n        css`\n            :host {\n                font: var(--ui-font-body-sm);\n                line-height: 1;\n                letter-spacing: var(--ui-tracking-body);\n            }\n\n            :host([size='20']) {\n                font: var(--ui-font-body);\n                line-height: 1;\n                letter-spacing: 0;\n            }\n        `,\n    ];\n\n    @property({ reflect: true }) kind?: IconIndicatorKind;\n\n    @property() label = '';\n\n    /** 16 (body-compact-01) or 20 (body-compact-02). */\n    @property({ type: Number, reflect: true }) size: 16 | 20 = 16;\n\n    /** Only the icon; the label in a tooltip. */\n    @property({ type: Boolean, reflect: true }) compact = false;\n\n    /** Read by screen readers in compact mode instead of the label. */\n    @property({ attribute: 'icon-description' }) iconDescription?: string;\n\n    /** Where the compact tooltip opens. */\n    @property({ reflect: true }) placement: Placement = 'right';\n\n    override render() {\n        if (!this.kind || !ICON_INDICATOR_KINDS.includes(this.kind)) return nothing;\n        const size = this.size === 20 ? 20 : 16;\n        return renderIndicator(renderIcon(iconIndicatorLook(this.kind, size), size), this.label, this.compact, this.iconDescription, this.placement);\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-icon-indicator': UiIconIndicator;\n    }\n}\n"
    },
    {
      "path": "src/primitives/status-indicator/shape-indicator.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/status-indicator/shape-indicator.ts",
      "content": "import { css, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { SHAPE_INDICATOR_KINDS, shapeIndicatorLook, type ShapeIndicatorKind } from '../../core/status-indicator.ts';\nimport type { Placement } from '../../core/position.ts';\nimport { WithAlign } from '../shared/align.ts';\nimport { UiElement } from '../shared/element.ts';\nimport { indicatorStyles, renderIndicator, renderIcon } from './status-indicator-shared.ts';\n\n/**\n * Carbon `ShapeIndicator` (preview, `cds-shape-indicator`): a status shown by a 16px shape for `kind` (severity or\n * state), in its status colour, followed by `label` — helper-text-01 (12px), or `text-size=\"14\"` body-compact-01.\n * `compact` shows only the shape, with the label in a tooltip (`shape-description` is read instead, if set).\n *\n * @csspart icon - The shape\n * @csspart label - The label (not compact)\n * @attr align - Carbon's name for `placement` (same values)\n */\n@customElement('ui-shape-indicator')\nexport class UiShapeIndicator extends WithAlign(UiElement) {\n    static override readonly styles = [\n        indicatorStyles,\n        css`\n            :host {\n                font: var(--ui-font-caption);\n                line-height: 1;\n                letter-spacing: var(--ui-tracking-caption);\n            }\n\n            :host([text-size='14']) {\n                font: var(--ui-font-body-sm);\n                line-height: 1;\n                letter-spacing: var(--ui-tracking-body);\n            }\n        `,\n    ];\n\n    @property({ reflect: true }) kind?: ShapeIndicatorKind;\n\n    @property() label = '';\n\n    /** 12 (helper-text-01) or 14 (body-compact-01). */\n    @property({ type: Number, reflect: true, attribute: 'text-size' }) textSize: 12 | 14 = 12;\n\n    /** Only the shape; the label in a tooltip. */\n    @property({ type: Boolean, reflect: true }) compact = false;\n\n    /** Read by screen readers in compact mode instead of the label. */\n    @property({ attribute: 'shape-description' }) shapeDescription?: string;\n\n    /** Where the compact tooltip opens. */\n    @property({ reflect: true }) placement: Placement = 'right';\n\n    override render() {\n        if (!this.kind || !SHAPE_INDICATOR_KINDS.includes(this.kind)) return nothing;\n        return renderIndicator(renderIcon(shapeIndicatorLook(this.kind), 16), this.label, this.compact, this.shapeDescription, this.placement);\n    }\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-shape-indicator': UiShapeIndicator;\n    }\n}\n"
    },
    {
      "path": "src/primitives/status-indicator/status-indicator-shared.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/status-indicator/status-indicator-shared.ts",
      "content": "import { css, svg, html } from 'lit';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { toneFill, type StatusLook } from '../../core/status-indicator.ts';\nimport type { Placement } from '../../core/position.ts';\nimport { srOnlyStyles } from '../shared/field.ts';\nimport '../definition-tooltip/definition-tooltip.ts';\n\n/**\n * Carbon .cds--icon-indicator / .cds--shape-indicator: the icon then the label, 8px apart, in text-secondary.\n * `line-height: 1` is what Carbon's `line-height: unset` gives under Carbon's reset (body line-height 1): one\n * row as tall as the icon. Compact: the icon is the trigger of a definition tooltip that holds the label\n * (Carbon .cds--icon-indicator__button: no underline, a 1px focus outline; the bubble 2px top and bottom).\n */\nexport const indicatorStyles = [\n    srOnlyStyles,\n    css`\n        :host {\n            display: flex;\n            align-items: center;\n            gap: var(--ui-space-xs);\n            color: var(--ui-ink-muted);\n            line-height: 1;\n        }\n\n        .icon {\n            display: block;\n            flex: none;\n            align-self: center;\n        }\n\n        ui-definition-tooltip {\n            display: flex;\n        }\n\n        ui-definition-tooltip::part(trigger) {\n            display: flex;\n            border: none;\n            outline: none;\n        }\n\n        ui-definition-tooltip::part(trigger):focus-visible {\n            outline: 1px solid var(--ui-focus);\n            outline-offset: 0;\n            border-radius: var(--ui-link-focus-radius, 0); /* Kanok: 4px */\n        }\n\n        ui-definition-tooltip::part(bubble) {\n            padding-block: 2px;\n        }\n    `,\n];\n\nexport function renderIcon(look: StatusLook, size: number) {\n    const paths = look.icon.paths.map((p) => svg`<path d=${p.d} style=${styleMap({ fill: toneFill(look, p.tone) })} />`);\n    return html`<svg class=\"icon\" part=\"icon\" width=${size} height=${size} viewBox=${look.icon.viewBox} aria-hidden=\"true\">${paths}</svg>`;\n}\n\n/** Non-compact: icon + label. Compact: the icon opens a tooltip with the label; screen readers get `description` (or the label). */\nexport function renderIndicator(icon: unknown, label: string, compact: boolean, description: string | undefined, placement: Placement) {\n    if (!compact) return html`${icon}<span part=\"label\">${label}</span>`;\n    return html`<ui-definition-tooltip placement=${placement} open-on-hover definition=${label}>\n        ${icon}<span class=\"sr-only\">${description ?? label}</span>\n    </ui-definition-tooltip>`;\n}\n"
    },
    {
      "path": "src/primitives/status-indicator/status-indicator.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/status-indicator/status-indicator.ts",
      "content": "// One element per file in this folder; this module is the entry point (package export, React wrappers, index).\nexport * from './icon-indicator.ts';\nexport * from './shape-indicator.ts';\n"
    }
  ]
}
