Fully typed, production-ready ReScript 11 bindings for the @juspay/blend-design-system.
This package bridges the gap between the Blend Design System created in React/TS and your ReScript-based architecture by exposing strict, type-safe interfaces for the components. Best of all, these bindings are maintained autonomically!
npm install @juspay/rescript-blendThe core design system (@juspay/blend-design-system) is bundled as a regular dependency and pinned per release — you don't need to install it separately.
Versioning
Starting at1.0.0, this package follows its own SemVer cadence under the@juspay/rescript-blendname. Each release pins the@juspay/blend-design-systemversion it was generated against independencies; check the CHANGELOG to see which upstream version any given release ships with.
Note: This package ships ReScript source files (
.res/.resi) only. Your project must have the ReScript compiler (rescript >= 12.0.0) installed to compile the bindings.
In your project's rescript.json, add @juspay/rescript-blend to the dependencies:
{
"dependencies": [
"@rescript/react",
"@juspay/rescript-blend"
]
}All components are namespaced under RescriptBlend to avoid module name collisions. Access them with qualified names or open the module:
@react.component
let make = () => {
// Qualified access
<RescriptBlend.Accordion
isMultiple=true
defaultValue={RescriptBlend.Accordion.Value.fromArray(["panel-1"])}
>
<RescriptBlend.Button ariaLabel="Submit Form" disabled=false>
{React.string("Continue")}
</RescriptBlend.Button>
</RescriptBlend.Accordion>
}
// Or use `open` for cleaner syntax
@react.component
let make = () => {
open RescriptBlend
<Accordion isMultiple=true defaultValue={Accordion.Value.fromArray(["panel-1"])}>
<Button ariaLabel="Submit Form" disabled=false>
{React.string("Continue")}
</Button>
</Accordion>
}Sub-components are accessed via the parent module namespace:
open RescriptBlend
// Accordion.Item
<Accordion>
<Accordion.Item value="1" title={React.string("Title")}>
{React.string("Content")}
</Accordion.Item>
</Accordion>
// Modal with helper function
<Modal
primaryAction={Modal.makeButtonAction(~text="Confirm", ~buttonType=#Primary, ())}
/>(All React types, Polymorphic Variants, and callback Uncurries map 1:1 with ReScript 11 standards).
To maintain 100% interoperability without manual intervention, this library employs an LLM-powered autonomous feedback loop that connects strictly to the external node_modules TS declarations files.
If you are a maintainer looking to generate new bindings directly:
- Provide a
.envfile holding yourLITELLM_BASE_URL,TEST_KEY, andLITELLM_API_KEY. - Generate an individual missing component:
npm run generate -- --component Button
- Or synchronize the entire design system at once:
npm run generate -- --all
The script natively compiles your ReScript code on generation and features an auto-correction feedback loop up to 3 times per component! Failures are pruned into .failed.res so downstream configurations are never broken.