Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions adapters/solid/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Alexander van Elsas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
83 changes: 83 additions & 0 deletions adapters/solid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# @vanelsas/baredom-solid

Solid 1.x wrapper components for [BareDOM](https://github.com/avanelsas/baredom) — auto-generated from component metadata.

Provides typed props, event handlers, ref forwarding, and signal-friendly controlled inputs for all BareDOM web components.

## Installation

```bash
npm install @vanelsas/baredom-solid @vanelsas/baredom solid-js
```

Solid's JSX compiler (`vite-plugin-solid`, `babel-preset-solid`, or `esbuild-plugin-solid`) must be configured in your project — this is the standard Solid setup.

## Usage

```tsx
import { XButton } from "@vanelsas/baredom-solid/x-button";
import { XAlert } from "@vanelsas/baredom-solid/x-alert";
import { XTheme } from "@vanelsas/baredom-solid/x-theme";

function App() {
return (
<XTheme>
<XButton
disabled={false}
onPress={(e) => console.log("Pressed!", e.detail.source)}
>
Click me
</XButton>

<XAlert
type="success"
text="Operation completed"
dismissible
onDismiss={() => console.log("Dismissed")}
/>
</XTheme>
);
}
```

## Controlled inputs with signals

Form-control components (`XCheckbox`, `XSlider`, `XSelect`, `XSwitch`, `XRadio`, `XTextArea`, `XCombobox`, `XCurrencyField`, `XTabs`, `XPagination`) support a controlled mode driven by Solid signals. Supply the control prop (`checked` / `value` / `page`) plus a handler that updates it; the wrapper intercepts the cancelable change-request event and prevents the default DOM commit, so the signal is the single source of truth.

```tsx
import { createSignal } from "solid-js";
import { XCheckbox } from "@vanelsas/baredom-solid/x-checkbox";

function ControlledExample() {
const [checked, setChecked] = createSignal(false);
return (
<XCheckbox
checked={checked()}
onChangeRequest={(e) => setChecked(e.detail.checked)}
>
Subscribe
</XCheckbox>
);
}
```

Pass `defaultChecked` / `defaultValue` / `defaultPage` instead for uncontrolled mode — the wrapper writes the initial attribute and lets the component manage its own state.

## Theme presets

```tsx
import { useRegisterPreset } from "@vanelsas/baredom-solid/composables";
import { XTheme } from "@vanelsas/baredom-solid/x-theme";

function App() {
useRegisterPreset("brand", {
light: { "--x-color-primary": "#e11d48" },
dark: { "--x-color-primary": "#fb7185" },
});
return <XTheme preset="brand">...</XTheme>;
}
```

## License

MIT
Loading
Loading