{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "info-list",
  "title": "Info List",
  "author": "ilinxa",
  "description": "Card-framed list of icon-prefixed rows — primary and secondary text, optional actions, per-row links, comfortable and compact variants.",
  "dependencies": [
    "lucide-react@^1.11.0"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/components/data/info-list/info-list.tsx",
      "content": "\"use client\";\n\nimport { memo, useEffect, useId, useMemo, useRef } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport {\n  defaultInfoListLabels,\n  type InfoListLabels,\n  type InfoListProps,\n} from \"./types\";\nimport { InfoRow } from \"./parts/info-row\";\n\n/** Would React render something? (`cond && <X />` with `cond` false is not content.) */\nconst isShown = (value: unknown) => value != null && value !== false && value !== \"\";\n\nfunction InfoListInner({\n  items,\n  variant = \"comfortable\",\n  separated,\n  framed = true,\n  heading,\n  headingAs = \"h3\",\n  linkComponent = \"a\",\n  wrap = false,\n  renderItem,\n  labels: labelsProp,\n  emptyState,\n  className,\n  headingClassName,\n  itemClassName,\n}: InfoListProps) {\n  const headingId = useId();\n  const HeadingTag = headingAs;\n\n  const labels = useMemo<Required<InfoListLabels>>(\n    () => ({\n      // `undefined` must not erase the default.\n      emptyText: labelsProp?.emptyText ?? defaultInfoListLabels.emptyText,\n    }),\n    [labelsProp?.emptyText],\n  );\n\n  // Dev-only, once per mount: compact rows are single-line, so `secondary` / `action` are ignored.\n  const warnedRef = useRef(false);\n  const dropsRichFields =\n    process.env.NODE_ENV !== \"production\" &&\n    variant === \"compact\" &&\n    !renderItem &&\n    items.some((item) => isShown(item.secondary) || isShown(item.action));\n  useEffect(() => {\n    if (\n      process.env.NODE_ENV !== \"production\" &&\n      dropsRichFields &&\n      !warnedRef.current\n    ) {\n      warnedRef.current = true;\n      console.warn(\n        '[info-list] the \"compact\" variant ignores `secondary` and `action`. Use variant=\"comfortable\" or `renderItem` to show them.',\n      );\n    }\n  }, [dropsRichFields]);\n\n  const isEmpty = items.length === 0;\n\n  // Auto-default per variant: comfortable=true, compact=false\n  const separatedResolved =\n    separated ?? (variant === \"comfortable\" ? true : false);\n\n  return (\n    <section\n      aria-labelledby={heading ? headingId : undefined}\n      className={cn(\n        framed && \"bg-card rounded-2xl p-6 border border-border/50\",\n        className,\n      )}\n    >\n      {heading && (\n        <HeadingTag\n          id={headingId}\n          className={cn(\n            \"text-lg font-semibold text-foreground mb-4\",\n            headingClassName,\n          )}\n        >\n          {heading}\n        </HeadingTag>\n      )}\n\n      {isEmpty ? (\n        emptyState ?? (\n          <p\n            role=\"status\"\n            className=\"text-sm text-muted-foreground\"\n          >\n            {labels.emptyText}\n          </p>\n        )\n      ) : (\n        <ul\n          role=\"list\"\n          className={cn(\n            variant === \"comfortable\" ? \"space-y-4\" : \"space-y-3\",\n          )}\n        >\n          {items.map((item, idx) =>\n            renderItem ? (\n              <li\n                key={item.id}\n                className={\n                  cn(\n                  // renderItem rows separate only on an explicit `separated`.\n                  separated === true &&\n                    idx > 0 &&\n                    (variant === \"comfortable\"\n                      ? \"pt-4 border-t border-border/50\"\n                      : \"pt-3 border-t border-border/50\"),\n                  itemClassName,\n                  ) || undefined\n                }\n              >\n                {renderItem(item)}\n              </li>\n            ) : (\n              <InfoRow\n                key={item.id}\n                item={item}\n                variant={variant}\n                separated={separatedResolved && idx > 0}\n                linkComponent={linkComponent}\n                wrap={wrap}\n                itemClassName={itemClassName}\n              />\n            ),\n          )}\n        </ul>\n      )}\n    </section>\n  );\n}\n\nconst InfoList = memo(InfoListInner);\nInfoList.displayName = \"InfoList\";\n\nexport { InfoList };\nexport default InfoList;\n",
      "type": "registry:component",
      "target": "components/info-list/info-list.tsx"
    },
    {
      "path": "src/registry/components/data/info-list/index.ts",
      "content": "export { InfoList, default } from \"./info-list\";\n\nexport type {\n  InfoListItem,\n  InfoListLabels,\n  InfoListProps,\n  InfoListVariant,\n} from \"./types\";\n\nexport { DEFAULT_INFO_LIST_LABELS, defaultInfoListLabels } from \"./types\";\n\n// @ilinxa/info-list 0.3.0\n",
      "type": "registry:component",
      "target": "components/info-list/index.ts"
    },
    {
      "path": "src/registry/components/data/info-list/types.ts",
      "content": "import type { ComponentType, ElementType, ReactNode } from \"react\";\n\nexport type InfoListVariant = \"comfortable\" | \"compact\";\n\nexport interface InfoListItem {\n  /** Stable identifier. Used for React keys. */\n  id: string;\n  /** Lucide-style icon component. Required — info-list IS icon-prefixed by definition. */\n  icon: ComponentType<{\n    className?: string;\n    \"aria-hidden\"?: boolean | \"true\" | \"false\";\n  }>;\n  /** Primary content (bold in comfortable, plain in compact). Required. */\n  primary: ReactNode;\n  /**\n   * Secondary content (muted, smaller). Comfortable only.\n   * @notImplemented in the `compact` variant: ignored there, with a one-time dev warning.\n   */\n  secondary?: ReactNode;\n  /**\n   * Optional action element (e.g., a link Button) — renders below secondary in comfortable.\n   * @notImplemented in the `compact` variant: ignored there, with a one-time dev warning.\n   */\n  action?: ReactNode;\n  /** Optional URL — when set, `primary` wraps in the link element (`linkComponent`, default `<a>`). */\n  href?: string;\n  /**\n   * Plain-text full value, used as the native `title` of a truncated compact row when `primary`\n   * is a node rather than a string. Falls back to `primary` when that is a string or a number.\n   */\n  title?: string;\n}\n\nexport interface InfoListLabels {\n  /** Default: \"No information.\" An `undefined` value keeps the default. Used when `items` is empty AND `emptyState` not provided. */\n  emptyText?: string;\n}\n\nexport interface InfoListProps {\n  /** Items to render in display order. */\n  items: InfoListItem[];\n\n  /** Visual variant. Default: 'comfortable'. */\n  variant?: InfoListVariant;\n\n  /**\n   * Insert top-border separators between items. Default: true for comfortable, false for compact.\n   * `renderItem` rows get a separator only when this is passed explicitly as `true`.\n   */\n  separated?: boolean;\n\n  /**\n   * Compact only: let long values wrap (`wrap-break-word`) instead of truncating with an\n   * ellipsis. Default `false` — compact rows truncate and carry the full value as `title`.\n   */\n  wrap?: boolean;\n\n  /** Wrap in card chrome (`bg-card rounded-2xl p-6 border`). Default: true. */\n  framed?: boolean;\n\n  // ─── Heading ─────────────────────────────────────────────────────\n  /** Optional section heading. */\n  heading?: string;\n  /** Heading semantic level. Default: 'h3'. */\n  headingAs?: \"h2\" | \"h3\" | \"h4\";\n\n  // ─── Polymorphic link ────────────────────────────────────────────\n  /** Element used when `item.href` is supplied. Default: 'a'. */\n  linkComponent?: ElementType;\n\n  // ─── Customization ───────────────────────────────────────────────\n  /** Custom per-item renderer — bypasses the default row layout entirely. */\n  renderItem?: (item: InfoListItem) => ReactNode;\n\n  /** Localized labels. Defaults are English. */\n  labels?: InfoListLabels;\n\n  /** Empty-state slot. Wins over `labels.emptyText` when provided. */\n  emptyState?: ReactNode;\n\n  /** Override classes for the root <section>. */\n  className?: string;\n  /** Override classes for the heading. */\n  headingClassName?: string;\n  /** Override classes per row (also applied to `renderItem` rows). */\n  itemClassName?: string;\n}\n\n/** Default English labels — exported for consumer composition. */\nexport const defaultInfoListLabels: Required<InfoListLabels> = {\n  emptyText: \"No information.\",\n};\n\n/** @deprecated Use `defaultInfoListLabels` — the same object under its old name. */\nexport const DEFAULT_INFO_LIST_LABELS: Required<InfoListLabels> = defaultInfoListLabels;\n",
      "type": "registry:component",
      "target": "components/info-list/types.ts"
    },
    {
      "path": "src/registry/components/data/info-list/parts/info-row.tsx",
      "content": "\"use client\";\n\nimport type { ElementType } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport type { InfoListVariant, InfoListItem } from \"../types\";\n\ninterface InfoRowProps {\n  item: InfoListItem;\n  variant: InfoListVariant;\n  separated: boolean;\n  linkComponent: ElementType;\n  wrap: boolean;\n  itemClassName?: string;\n}\n\nexport function InfoRow({\n  item,\n  variant,\n  separated,\n  linkComponent: LinkComponent,\n  wrap,\n  itemClassName,\n}: InfoRowProps) {\n  const IconComponent = item.icon;\n  const isLinked = item.href != null && item.href.length > 0;\n\n  if (variant === \"compact\") {\n    // Truncated rows carry the full value as a native tooltip; wrapped rows show it all already.\n    const fullValue = wrap\n      ? undefined\n      : (item.title ??\n        (typeof item.primary === \"string\" || typeof item.primary === \"number\"\n          ? String(item.primary)\n          : undefined));\n    const valueClass = wrap ? \"wrap-break-word\" : \"truncate\";\n    return (\n      <li\n        className={cn(\n          wrap ? \"flex items-start gap-3\" : \"flex items-center gap-3\",\n          separated && \"pt-3 border-t border-border/50\",\n          itemClassName,\n        )}\n      >\n        <IconComponent\n          aria-hidden=\"true\"\n          className={cn(\n            \"w-4 h-4 text-muted-foreground shrink-0\",\n            wrap && \"mt-0.5\",\n          )}\n        />\n        {isLinked ? (\n          <LinkComponent\n            href={item.href}\n            title={fullValue}\n            className={cn(\"text-sm text-primary hover:underline min-w-0\", valueClass)}\n          >\n            {item.primary}\n          </LinkComponent>\n        ) : (\n          <span\n            title={fullValue}\n            className={cn(\"text-sm text-foreground min-w-0\", valueClass)}\n          >\n            {item.primary}\n          </span>\n        )}\n      </li>\n    );\n  }\n\n  // comfortable\n  return (\n    <li\n      className={cn(\n        \"flex gap-3 items-start\",\n        separated && \"pt-4 border-t border-border/50\",\n        itemClassName,\n      )}\n    >\n      <IconComponent\n        aria-hidden=\"true\"\n        className=\"w-5 h-5 text-primary shrink-0 mt-0.5\"\n      />\n      <div className=\"min-w-0 flex-1\">\n        {isLinked ? (\n          <LinkComponent\n            href={item.href}\n            className=\"font-medium text-foreground hover:text-primary transition-colors block\"\n          >\n            {item.primary}\n          </LinkComponent>\n        ) : (\n          <p className=\"font-medium text-foreground\">{item.primary}</p>\n        )}\n        {item.secondary && (\n          <p className=\"text-sm text-muted-foreground mt-0.5\">\n            {item.secondary}\n          </p>\n        )}\n        {item.action && <div className=\"mt-1\">{item.action}</div>}\n      </div>\n    </li>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/info-list/parts/info-row.tsx"
    }
  ],
  "meta": {
    "version": "0.3.0",
    "status": "alpha"
  },
  "categories": [
    "data"
  ],
  "type": "registry:block"
}