{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "label-children",
  "title": "Label Children",
  "type": "registry:lib",
  "files": [
    {
      "path": "packages/registry-native/bootstrap/label-children/index.tsx",
      "content": "import * as React from 'react'\nimport { Text } from '@/components/ui/text'\nimport { cn } from '@/lib/utils'\n\n/** Native view/pressable children cannot contain bare strings or numbers. */\nexport function renderTextChildren(children: React.ReactNode, textClassName?: string): React.ReactNode {\n  if (React.isValidElement<{ children?: React.ReactNode }>(children) && children.type === React.Fragment) {\n    return React.cloneElement(children, undefined, renderTextChildren(children.props.children, textClassName))\n  }\n  if (React.isValidElement(children) || children == null || typeof children === 'boolean') return children\n  return React.Children.map(children, (child) =>\n    React.isValidElement(child) && child.type === React.Fragment ? (\n      renderTextChildren(child, textClassName)\n    ) : typeof child === 'string' || typeof child === 'number' ? (\n      <Text className={cn('min-w-0 shrink', textClassName)}>{child}</Text>\n    ) : (\n      child\n    ),\n  )\n}\n",
      "type": "registry:lib",
      "target": "~/lib/label-children.tsx"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/text.json"
  ],
  "description": "Render string and number labels as themed native Text while preserving composed children."
}