* `jsx.ts`: the custom elements as JSX intrinsic elements, so a page can render `<roxy-tarot-spread>` as a tag and still be typed.
*
* @remarks
* The React 19 shape, which is a module augmentation of `react` rather than of a global namespace: React 19 removed the global `JSX` namespace in favour of `React.JSX`, so an augmentation written the old way types nothing and reports no error.
*
* Every attribute is optional and every element also accepts the standard HTML attribute surface, which is where `className`, `style`, `slot`, `id`, `lang`, `dir` and `suppressHydrationWarning` come from. `data` is deliberately absent: it is declared `attribute: false` on the element, so it is set as a property (through a ref, or by using the wrapper component) and never written in markup.
return`\t\t\t/** \`<${pascal}>\` as a tag. */\n\t\t\t${JSON.stringify(tag)}: RoxyElement<${attrs}>;`;
});
return`/**
* Raw-tag typings for the Roxy custom elements, so \`<roxy-natal-chart heading="Chart">\` type-checks in a React file with no wrapper component and no client JavaScript.
*
* @remarks
* GENERATED. Import it once anywhere in your project and every Roxy tag is typed everywhere:
*
* \`\`\`ts
* import '@roxyapi/ui-react/jsx';
* \`\`\`
*
* The wrapper components remain the path for a page that passes a response: they set \`data\` as a property, which markup cannot carry. This file is for the other case, a tag rendered on the server and left alone.
*
* Attribute names are the elements' own: several are renamed at the element and the rest are lowercased, so they are read from the source rather than derived from the prop names.
*/
import type * as React from 'react';
/** The standard HTML attribute surface every custom element accepts, plus its own attributes. */
type RoxyElement<A> = React.DetailedHTMLProps<
React.HTMLAttributes<HTMLElement>,
HTMLElement
> &
A;
/** The attributes every data component takes, from the shared base element. Referenced by the rows below, not exported: the public surface of this module is the tag typings themselves. */
`export {\n\tensureLocaleLoaded,\n\tensureScriptLoaded,\n\tROXY_UI_LOCALES,\n\tROXY_UI_VERSION,\n} from './load-ui.js';\n\n/**\n * Every response type these components accept, re-exported so you can type your own\n * fetch helper without installing a second package. For example:\n * import type { NatalChartResponse } from '@roxyapi/ui-react';\n */\nexport type * from './types/index.js';\n`,
];
for(const{ slug, pascal, tag }ofROXY_COMPONENTS){
awaitwriteFile(
`${OUT_DIR}/components/${slug}.tsx`,
buildComponent(slug,pascal,tag),
);
exportLines.push(
`export { ${pascal}, type ${pascal}Props } from './components/${slug}.js';`,