// src/solid/create.ts /** * Solid components over the elements. * * `createComponent` renders the element's tag with `Dynamic`. Attributes are * props, rendered as attributes so server markup carries them; live-state * properties (`checked`, `value`) are props the component writes to the * element whenever they change; the attribute a live property shadows is its * `default*` prop. Element events are `on` callbacks. Props stay * reactive: every host attribute is a getter over the component's props. The * element registers on mount, never at import. * * Written without JSX, so it compiles with the rest of the library. * * @module solid */ import { createEffect, createMemo, mergeProps, onCleanup, onMount, splitProps, type Component, type JSX } from "solid-js"; import { Dynamic, isServer } from "solid-js/web"; import type { AttributeType, DefineOptions, ElementEvents, ElementProps, ElementSlotProp } from "../elements"; import { camel, describe, describeDeclaration, getPrefix, pascal, toAttribute, writeDefaults, writeLive, type ComponentSpec, type DeclarationSpec, type DefaultProps, type FormProps, type Pascal, } from "../elements/adapter"; export { configure } from "../elements/adapter"; export type { DefaultProps, FormProps } from "../elements/adapter"; /** `change` → `onChange`, typed with the element's event. */ export type EventProps = { [K in keyof ElementEvents & string as `on${Pascal}`]?: (event: ElementEvents[K]) => void; }; type BaseProps = ElementProps & DefaultProps & FormProps & EventProps; /** * Each named slot as a prop taking JSX (`actions={