openpencil/packages/docs/programmable/cli
Danila Poyarkov e17f74991b
feat(storybook): generate Radix UI components for React stories (#971)
* refactor(dom-css): share the generated component's markup and bindings

The component model now holds the element tree every framework writes: each layer's behaviour part, design tag, state class, and attributes, and the root's typed bindings (the two-way value, disabled, and each variant prop as a data attribute). The Vue generator only maps parts to Reka components and writes each binding its way, so another framework is a mapping table and a printer.

* feat(emit): print TSX modules with namespaced tags and spreads

jsx.printModule prints an es template filled with JSX as one TSX module, quoting every string the same way. Dotted tags such as Switch.Root print as JSX member expressions, and jsx.spread passes an object on as attributes. fill now fills holes inside the annotation it keeps on a filled identifier, which left $Props unfilled in a parameter's type.

* feat(storybook): generate Radix UI components for React stories

With --framework react, a component set whose behaviour is a Button, Switch, Checkbox, Toggle, or Collapsible exports as a component on the radix-ui package with its state styles in a CSS module. Its props extend the Radix root's, so checked, defaultChecked, onCheckedChange, and disabled come from Radix, and each other variant property is a prop set as a data attribute. Its stories use Radix's uncontrolled value so a play function can operate it. The browser spec now runs the same Switch and Collapsible checks for Vue and React.

* refactor(storybook): let generators say how stories import their component

The stories printer named each framework to know its Storybook package, how to import the component, and which prop sets its value. A generator now returns its files with the import path, whether the export is named, and the value's arg, and the Storybook packages come from the one table static stories use, so the printer is framework-neutral and exportStorybook looks generators up instead of branching.

* fix(storybook): keep a caller's class on React roots and run stories' play functions

The generated class came after the spread props, so a className passed to a generated React component was dropped. The root now joins its classes with the caller's. The browser spec mounts each framework's Default story and runs its exported play function with Storybook's own within and userEvent, checking the switch ends up on, and checks a caller's class stays on the root. emit shares one isNode guard.
2026-10-08 10:13:52 +00:00
..
analyzing.md docs(cli): use released openpencil command 2026-05-29 15:56:52 +03:00
app-control.md feat: control documents, history, settings, and tools from the CLI and MCP (#871) 2026-10-04 16:02:36 +00:00
comparing.md feat: add visual diff and patch apply tools and openpencil diff (#810) 2026-10-03 21:00:13 +04:00
exporting.md feat(storybook): generate Radix UI components for React stories (#971) 2026-10-08 10:13:52 +00:00
inspecting.md feat: control documents, history, settings, and tools from the CLI and MCP (#871) 2026-10-04 16:02:36 +00:00
scripting.md feat: behaviours and preview mode (#893) 2026-10-06 13:23:05 +00:00