{"version":3,"file":"Render.cjs","names":[],"sources":["../../src/Render/Render.tsx"],"sourcesContent":["import { isValidElement, cloneElement, createElement } from 'react';\nimport type { RenderProps, Component } from './types';\n\n/**\n * Renders dynamic React content from a value, element, or component.\n *\n * Use this helper when a higher-level API accepts flexible render content, such\n * as a fallback, preloaded async component, or entry component. Primitive\n * content is rendered as-is, React elements are cloned with `props`, and\n * component constructors are instantiated with `props`.\n *\n * @param props - Dynamic content and optional props to apply.\n * @returns A React node for the provided content.\n *\n * @example\n * ```tsx\n * <Render content=\"Saved\" />\n * <Render content={<Status />} props={{ tone: 'success' }} />\n * <Render content={Status} props={{ tone: 'success' }} />\n * ```\n */\nexport function Render(props: RenderProps) {\n  const { content, props: _props = {} } = props;\n  if (typeof content === 'string' || typeof content === 'number') return <>{content}</>;\n  if (isValidElement(content)) return cloneElement(content, _props);\n  return createElement(content as Component, _props);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,OAAO,OAAoB;CACzC,MAAM,EAAE,SAAS,OAAO,SAAS,CAAC,MAAM;CACxC,IAAI,OAAO,YAAY,YAAY,OAAO,YAAY,UAAU,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UAAG,QAAU,CAAA;CACpF,KAAA,GAAA,MAAA,eAAA,CAAmB,OAAO,GAAG,QAAA,GAAA,MAAA,aAAA,CAAoB,SAAS,MAAM;CAChE,QAAA,GAAA,MAAA,cAAA,CAAqB,SAAsB,MAAM;AACnD"}