@vanelsas/baredom 1.0.0-rc.1 → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -101
- package/README.md +15 -222
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,113 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to BareDome will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## [0.
|
|
5
|
+
## [1.0.0-rc.3] - 2026-03-31
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- Multiple small changes to components code and docs so that they can be shipped
|
|
10
|
-
- x-alert, x-avatar-group, x-avatar, x-badge, x-breadcrumbs, x-button, x-cancel-dialogue, x-card, x-chart, x-checkbox, x-chip, x-collapse, x-command-palette, x-container, x-context-menu, x-copy, x-currency-field, x-date-picker, x-divider, x-drawer, x-dropdown, x-fieldset, x-file-download, x-form-field, x-form, x-grid, x-menu-item, x-menu, x-modal are all stable now
|
|
11
|
-
|
|
12
|
-
## [0.2.3-alpha] - 2026-03-29
|
|
13
|
-
|
|
14
|
-
### Fixed
|
|
15
|
-
|
|
16
|
-
- Code updates to x-alert, x-avatar-group, x-avatar, x-badge, x-breadcrumbs, x-cancel-dialogue, x-card, x-chart, x-checkbox, x-chip to improve quality
|
|
17
|
-
- Accompanying docs updated where needed
|
|
18
|
-
|
|
19
|
-
## [0.2.2-alpha] - 2026-03-27
|
|
20
|
-
|
|
21
|
-
### Fixed
|
|
22
|
-
|
|
23
|
-
- Code updates to x-button, x-alert, x-drawer, x-form, x-form-field to improve quality
|
|
24
|
-
- Accompanying docs updated if needed
|
|
25
|
-
|
|
26
|
-
## [0.2.1-alpha] - 2026-03-27
|
|
27
|
-
|
|
28
|
-
### Fixed
|
|
29
|
-
|
|
30
|
-
- Fixes tests for x-file-download
|
|
31
|
-
|
|
32
|
-
## [0.2.0-alpha] - 2026-03-27
|
|
33
|
-
|
|
34
|
-
### Fixed
|
|
35
|
-
|
|
36
|
-
- Fixes design issues x-context-menu and x-modal
|
|
37
|
-
- Fixes small bugs in x-file-download, x-fieldset, x-date-picker, x-button
|
|
38
|
-
|
|
39
|
-
## [0.1.11-alpha] - 2026-03-27
|
|
7
|
+
Release candidate — all components audited and stable.
|
|
40
8
|
|
|
41
9
|
### Changed
|
|
42
10
|
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
## [0.1.10-alpha] - 2026-03-27
|
|
47
|
-
|
|
48
|
-
## Fixed
|
|
49
|
-
|
|
50
|
-
- Updates package.json to ensure the latest alpha version is also the latest version on NPM
|
|
51
|
-
- Add report.html to .gitignore
|
|
52
|
-
|
|
53
|
-
## [0.1.9-alpha] - 2026-03-27
|
|
54
|
-
|
|
55
|
-
## Fixed
|
|
56
|
-
|
|
57
|
-
- Updates build.clj and README.md
|
|
58
|
-
|
|
59
|
-
## [0.1.8-alpha] - 2026-03-27
|
|
60
|
-
|
|
61
|
-
## Fixed
|
|
62
|
-
|
|
63
|
-
- Updates release.yml
|
|
64
|
-
|
|
65
|
-
## [0.1.7-alpha] - 2026-03-27
|
|
66
|
-
|
|
67
|
-
## Fixed
|
|
68
|
-
|
|
69
|
-
- Updates package.json
|
|
70
|
-
- Updates release.yml
|
|
71
|
-
|
|
72
|
-
## [0.1.6-alpha] - 2026-03-27
|
|
11
|
+
- All 54 components reviewed and updated for API consistency, accessibility, theming, Closure Advanced compilation safety, and test coverage
|
|
12
|
+
- Accompanying documentation and demo files updated for all components
|
|
13
|
+
- Namespace renamed from `app` to `baredom` to match published package name
|
|
73
14
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- Updates package.json
|
|
77
|
-
|
|
78
|
-
## [0.1.5-alpha] - 2026-03-27
|
|
79
|
-
|
|
80
|
-
## Fixed
|
|
81
|
-
|
|
82
|
-
- Updates package.json
|
|
83
|
-
|
|
84
|
-
## [0.1.4-alpha] - 2026-03-27
|
|
85
|
-
|
|
86
|
-
## Fixed
|
|
87
|
-
|
|
88
|
-
- renames Release in yml to release
|
|
89
|
-
|
|
90
|
-
## [0.1.3-alpha] - 2026-03-27
|
|
91
|
-
|
|
92
|
-
## Fixed
|
|
93
|
-
|
|
94
|
-
- Fixes Release with OIDC
|
|
95
|
-
|
|
96
|
-
## [0.1.2-alpha] - 2026-03-27
|
|
97
|
-
|
|
98
|
-
## Fixed
|
|
99
|
-
|
|
100
|
-
- Release with OIDC
|
|
101
|
-
|
|
102
|
-
## [0.1.1-alpha] - 2026-03-27
|
|
103
|
-
|
|
104
|
-
## Fixed
|
|
105
|
-
|
|
106
|
-
- Fixes x-date-picker disabled
|
|
107
|
-
- Fixes loading of logo in darkmode/lightmode in main demo
|
|
108
|
-
|
|
109
|
-
## Adds
|
|
15
|
+
### Components
|
|
110
16
|
|
|
111
|
-
-
|
|
17
|
+
- **Layout** — x-container, x-grid, x-spacer, x-divider, x-sidebar, x-navbar
|
|
18
|
+
- **Typography & Display** — x-badge, x-chip, x-stat, x-avatar, x-avatar-group, x-skeleton
|
|
19
|
+
- **Feedback** — x-alert, x-spinner, x-progress, x-progress-circle, x-toast, x-toaster
|
|
20
|
+
- **Overlays** — x-modal, x-drawer, x-popover, x-context-menu, x-command-palette, x-cancel-dialogue
|
|
21
|
+
- **Navigation** — x-breadcrumbs, x-pagination, x-tab, x-tabs, x-menu, x-menu-item, x-stepper
|
|
22
|
+
- **Forms** — x-button, x-checkbox, x-radio, x-switch, x-select, x-slider, x-text-area, x-form, x-form-field, x-fieldset, x-search-field, x-currency-field, x-date-picker
|
|
23
|
+
- **Content** — x-card, x-collapse, x-chart, x-copy, x-file-download, x-dropdown
|
|
24
|
+
- **Data** — x-table, x-table-row, x-table-cell
|
|
25
|
+
- **Timeline** — x-timeline, x-timeline-item
|
|
26
|
+
- **Notifications** — x-notification-center
|
|
112
27
|
|
|
113
28
|
## [0.1.0-alpha] - 2026-03-25
|
|
114
29
|
|
package/README.md
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
# BareDOM
|
|
2
2
|
|
|
3
|
-
<p align="left">
|
|
4
|
-
<picture>
|
|
5
|
-
<source media="(prefers-color-scheme: dark)" srcset="public/assets/baredom_darkmode.svg">
|
|
6
|
-
<source media="(prefers-color-scheme: light)" srcset="public/assets/baredom_lightmode.svg">
|
|
7
|
-
<img alt="Baredom Logo" src="public/assets/baredom_lightmode.svg" width="120">
|
|
8
|
-
</picture>
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
3
|
**Native web components. Zero runtime. No framework required.**
|
|
12
4
|
|
|
13
5
|
[](https://www.npmjs.com/package/@vanelsas/baredom)
|
|
@@ -37,14 +29,6 @@ BareDOM has been created using Claude Code. The CLAUDE.md file is added to the r
|
|
|
37
29
|
|
|
38
30
|
## Why BareDOM?
|
|
39
31
|
|
|
40
|
-
I started working on BareDOM after going though all the motions that Clojure developers often go through when deciding to build a UI. I worked with Reagent and Re-frame and in general the experience was pretty good. At some point I was building larger UI's with reusable components that were pretty basic (e.g. inputs, buttons etc). For complex UI's the bundle size became larger and larger.
|
|
41
|
-
|
|
42
|
-
I wondered if there would be a better way to do this, and I ended up reading about web components. It seemed like a good idea to try that. For me it as a learning exercise, trying to understand how it all works. I tried to build a few, and had to learn how to do that in Clojurescript. Building a larger set of web components is quite a bit of work.
|
|
43
|
-
|
|
44
|
-
When Claude Code appeared, I was thinking about a project to try it out with, and web components seemed like a good fit. I picked up the project again and started to build Clojurescript based web components assisted by Claude. A good experiment to work with AI tooling and build something I find interesting myself.
|
|
45
|
-
|
|
46
|
-
The project is still in an alpha state. The components and demo's work, but there are bound to be some things not working properly yet. Feel free to give it a spin.
|
|
47
|
-
|
|
48
32
|
**Works in any stack.** Because components are native HTML elements, they work wherever HTML works — vanilla JavaScript, React, Vue, Svelte, Angular, server-rendered HTML, or a static page. No adapter layer, no wrapper library.
|
|
49
33
|
|
|
50
34
|
**No framework lock-in.** Your components are not tied to the framework you are building with today. Migrate your app, keep your components.
|
|
@@ -63,188 +47,44 @@ The project is still in an alpha state. The components and demo's work, but ther
|
|
|
63
47
|
|
|
64
48
|
## Installation
|
|
65
49
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
### Option 1 — ClojureScript via Clojars
|
|
71
|
-
|
|
72
|
-
This is the primary distribution for ClojureScript projects. Add the dependency to your `deps.edn`:
|
|
73
|
-
|
|
74
|
-
```clojure
|
|
75
|
-
{:deps {com.github.avanelsas/baredom {:mvn/version "0.1.10-alpha"}}}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Or, if you use Leiningen, add to `:dependencies` in `project.clj`:
|
|
79
|
-
|
|
80
|
-
```clojure
|
|
81
|
-
[com.github.avanelsas/baredom "0.1.10-alpha"]
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Components live under the `app.exports` namespace. Require only what you use — unused namespaces are eliminated by the Closure compiler:
|
|
85
|
-
|
|
86
|
-
```clojure
|
|
87
|
-
(ns my-app.core
|
|
88
|
-
(:require [app.exports.x-button :as x-button]
|
|
89
|
-
[app.exports.x-alert :as x-alert]
|
|
90
|
-
[app.exports.x-toaster :as x-toaster]
|
|
91
|
-
[app.exports.x-toast :as x-toast]))
|
|
92
|
-
|
|
93
|
-
(defn- register-components! []
|
|
94
|
-
(x-button/register!)
|
|
95
|
-
(x-alert/register!)
|
|
96
|
-
(x-toaster/register!)
|
|
97
|
-
(x-toast/register!))
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
Call `register-components!` once in your `init!` entry point. Registration is idempotent — calling `register!` on an already-registered element is a no-op.
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
### Option 2 — npm (JavaScript / TypeScript projects)
|
|
105
|
-
|
|
106
|
-
If your project uses npm, install the package:
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
npm install @vanelsas/baredom
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Or add it manually to `package.json`:
|
|
50
|
+
**Step 1 — Add the npm dependency to your `package.json`:**
|
|
113
51
|
|
|
114
52
|
```json
|
|
115
53
|
{
|
|
116
54
|
"dependencies": {
|
|
117
|
-
"@vanelsas/baredom": "^
|
|
55
|
+
"@vanelsas/baredom": "^1.0.0-rc.3"
|
|
118
56
|
}
|
|
119
57
|
}
|
|
120
58
|
```
|
|
121
59
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
```js
|
|
125
|
-
import { init as initButton } from "@vanelsas/baredom/x-button";
|
|
126
|
-
import { init as initAlert } from "@vanelsas/baredom/x-alert";
|
|
60
|
+
Then run `npm install`.
|
|
127
61
|
|
|
128
|
-
|
|
129
|
-
initAlert();
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
> **shadow-cljs users using npm:** no extra configuration needed. shadow-cljs resolves npm packages from `node_modules` automatically. You can use `["@vanelsas/baredom/x-button" :as x-button]` in `:require` and call `(.init x-button)`.
|
|
62
|
+
**Step 2 — shadow-cljs:** no extra configuration needed. shadow-cljs resolves npm packages automatically via the `:npm-deps` or `node_modules` integration built into every shadow-cljs project.
|
|
133
63
|
|
|
134
64
|
---
|
|
135
65
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
BareDOM components are standard ES modules. Load them directly in any HTML page using a CDN — no npm, no bundler, no framework required.
|
|
139
|
-
|
|
140
|
-
#### Import and initialise
|
|
141
|
-
|
|
142
|
-
```html
|
|
143
|
-
<!DOCTYPE html>
|
|
144
|
-
<html lang="en">
|
|
145
|
-
<head>
|
|
146
|
-
<meta charset="UTF-8">
|
|
147
|
-
<title>My App</title>
|
|
148
|
-
</head>
|
|
149
|
-
<body>
|
|
150
|
-
|
|
151
|
-
<x-button variant="primary">Hello</x-button>
|
|
152
|
-
<x-alert type="success" text="It works!"></x-alert>
|
|
153
|
-
|
|
154
|
-
<script type="module">
|
|
155
|
-
import { init as initButton } from "https://esm.sh/@vanelsas/baredom/x-button";
|
|
156
|
-
import { init as initAlert } from "https://esm.sh/@vanelsas/baredom/x-alert";
|
|
157
|
-
|
|
158
|
-
initButton();
|
|
159
|
-
initAlert();
|
|
160
|
-
</script>
|
|
161
|
-
|
|
162
|
-
</body>
|
|
163
|
-
</html>
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
`<script type="module">` is required because BareDOM components are ES modules. Each `init()` call registers the custom element with the browser. Only the components you import are loaded — unused components cost nothing.
|
|
167
|
-
|
|
168
|
-
#### Set attributes in HTML
|
|
169
|
-
|
|
170
|
-
Every attribute can be set directly in markup:
|
|
171
|
-
|
|
172
|
-
```html
|
|
173
|
-
<x-button variant="secondary" size="sm" disabled>Cancel</x-button>
|
|
174
|
-
<x-checkbox checked></x-checkbox>
|
|
175
|
-
<x-alert type="warning" text="Check your input." dismissible></x-alert>
|
|
176
|
-
<x-progress value="65" max="100"></x-progress>
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Boolean attributes follow the HTML convention: presence means `true`, absence means `false`.
|
|
180
|
-
|
|
181
|
-
#### Handle events
|
|
182
|
-
|
|
183
|
-
```html
|
|
184
|
-
<x-button id="btn" variant="primary">Click me</x-button>
|
|
185
|
-
<x-tabs id="tabs" value="home">
|
|
186
|
-
<x-tab value="home">Home</x-tab>
|
|
187
|
-
<x-tab value="settings">Settings</x-tab>
|
|
188
|
-
</x-tabs>
|
|
189
|
-
|
|
190
|
-
<script type="module">
|
|
191
|
-
import { init as initButton } from "https://esm.sh/@vanelsas/baredom/x-button";
|
|
192
|
-
import { init as initTabs } from "https://esm.sh/@vanelsas/baredom/x-tabs";
|
|
193
|
-
import { init as initTab } from "https://esm.sh/@vanelsas/baredom/x-tab";
|
|
194
|
-
|
|
195
|
-
initButton(); initTabs(); initTab();
|
|
196
|
-
|
|
197
|
-
document.getElementById("btn").addEventListener("click", () => {
|
|
198
|
-
console.log("button clicked");
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
document.getElementById("tabs").addEventListener("value-change", e => {
|
|
202
|
-
console.log("active tab:", e.detail.value);
|
|
203
|
-
});
|
|
204
|
-
</script>
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
Custom events carry a `detail` payload — check the individual component docs for the event name and `detail` shape.
|
|
208
|
-
|
|
209
|
-
#### Theme with CSS custom properties
|
|
210
|
-
|
|
211
|
-
```html
|
|
212
|
-
<style>
|
|
213
|
-
:root {
|
|
214
|
-
--x-button-radius: 4px;
|
|
215
|
-
--x-button-bg-primary: #0a5c99;
|
|
216
|
-
}
|
|
217
|
-
</style>
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
CSS custom properties cascade normally into the open Shadow DOM. No JavaScript required for theming.
|
|
221
|
-
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
## Usage (ClojureScript)
|
|
225
|
-
|
|
226
|
-
The examples below use the Clojars distribution. If you installed via npm, replace the `app.exports.*` requires with `["@vanelsas/baredom/x-button" :as x-button]` etc., and call `(.init x-button)` instead of `(x-button/register!)`.
|
|
66
|
+
## Usage
|
|
227
67
|
|
|
228
68
|
### 1. Register components
|
|
229
69
|
|
|
230
|
-
Require each component
|
|
70
|
+
Require each component module you need and call `.init` on it once, before any rendering. Only the components you require are included in your bundle.
|
|
231
71
|
|
|
232
72
|
```clojure
|
|
233
73
|
(ns my-app.core
|
|
234
74
|
(:require
|
|
235
|
-
[
|
|
236
|
-
[
|
|
237
|
-
[
|
|
238
|
-
[
|
|
75
|
+
["@vanelsas/baredom/x-button" :as x-button]
|
|
76
|
+
["@vanelsas/baredom/x-alert" :as x-alert]
|
|
77
|
+
["@vanelsas/baredom/x-toaster" :as x-toaster]
|
|
78
|
+
["@vanelsas/baredom/x-toast" :as x-toast]))
|
|
239
79
|
|
|
240
80
|
(defn- register-components! []
|
|
241
|
-
(x-button
|
|
242
|
-
(x-alert
|
|
243
|
-
(x-toaster
|
|
244
|
-
(x-toast
|
|
81
|
+
(.init x-button)
|
|
82
|
+
(.init x-alert)
|
|
83
|
+
(.init x-toaster)
|
|
84
|
+
(.init x-toast))
|
|
245
85
|
```
|
|
246
86
|
|
|
247
|
-
Call `register-components!` once in your `init!` entry point. Registration is idempotent — calling `
|
|
87
|
+
Call `register-components!` once in your `init!` entry point. Registration is idempotent — calling `.init` on an already-registered element is a no-op.
|
|
248
88
|
|
|
249
89
|
### 2. Add a renderer
|
|
250
90
|
|
|
@@ -579,53 +419,6 @@ See [`bare-demo/README.md`](./bare-demo/README.md) for a full walkthrough of the
|
|
|
579
419
|
|
|
580
420
|
---
|
|
581
421
|
|
|
582
|
-
## bare-reagent-demo — Reagent usage example
|
|
583
|
-
|
|
584
|
-
The `bare-reagent-demo/` folder is visually identical to `bare-demo` but replaces the custom hiccup renderer with [Reagent](https://reagent-project.github.io/) — a minimalist ClojureScript wrapper around React. It demonstrates the integration patterns and trade-offs that arise when pairing a virtual-DOM framework with native Custom Elements.
|
|
585
|
-
|
|
586
|
-
The key differences from `bare-demo`:
|
|
587
|
-
|
|
588
|
-
- **`reagent.core/atom`** drives reactivity. Any component that dereferences a ratom with `@` re-renders automatically — no `add-watch` or manual render trigger required.
|
|
589
|
-
- **Standard events** (`:on-click`) work transparently through React's synthetic event system.
|
|
590
|
-
- **Custom events** (`x-modal-dismiss`, `toggle`) are not handled by React and must be wired imperatively. The demo uses `reagent/create-class` lifecycle hooks (`component-did-mount` / `component-will-unmount`) and `rdom/dom-node` to attach and clean up native event listeners on the real DOM element.
|
|
591
|
-
|
|
592
|
-
**Run it:**
|
|
593
|
-
|
|
594
|
-
```bash
|
|
595
|
-
cd bare-reagent-demo
|
|
596
|
-
npm install
|
|
597
|
-
npm start
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
Then open `http://localhost:8002`.
|
|
601
|
-
|
|
602
|
-
See [`bare-reagent-demo/README.md`](./bare-reagent-demo/README.md) for a full code walkthrough, the custom-event workaround, and a side-by-side comparison with `bare-demo`.
|
|
603
|
-
|
|
604
|
-
---
|
|
605
|
-
|
|
606
|
-
## bare-html — HTML/JS only demo
|
|
607
|
-
|
|
608
|
-
The `bare-html/` folder contains the same demo — navbar, sidebar, modal, and event log — written entirely in plain HTML and JavaScript. There is no ClojureScript, no build step, and no bundler. Components are loaded by importing their pre-built ES modules directly from the `dist/` folder using a `<script type="module">` tag.
|
|
609
|
-
|
|
610
|
-
The implementation uses three ideas:
|
|
611
|
-
|
|
612
|
-
- **Declarative HTML markup.** All components are written as custom element tags in the HTML source. Attributes are set directly in markup or via `setAttribute` / `removeAttribute` from JavaScript.
|
|
613
|
-
- **A plain state object and a `render()` function.** A simple JS object holds `sidebarOpen`, `modalOpen`, and `activeNav`. The `render()` function reads this object and reconciles attributes — open/close state is a single `setAttribute` or `removeAttribute` call.
|
|
614
|
-
- **Native event listeners.** `x-button` fires a `press` event; `x-sidebar` fires `toggle` with `detail.open`; `x-modal` fires `x-modal-dismiss` on Escape or backdrop click. All are wired with standard `addEventListener`.
|
|
615
|
-
|
|
616
|
-
**Run it:**
|
|
617
|
-
|
|
618
|
-
```bash
|
|
619
|
-
# From the project root
|
|
620
|
-
python3 -m http.server 8000
|
|
621
|
-
```
|
|
622
|
-
|
|
623
|
-
Then open `http://localhost:8000/bare-html/demo.html`. The demo must be served over HTTP — ES module imports are blocked by browsers on `file://` URLs.
|
|
624
|
-
|
|
625
|
-
See [`bare-html/README.md`](./bare-html/README.md) for a full walkthrough and a comparison with `bare-demo`.
|
|
626
|
-
|
|
627
|
-
---
|
|
628
|
-
|
|
629
422
|
## Building from Source
|
|
630
423
|
|
|
631
424
|
BareDOM is authored in ClojureScript and compiled with [shadow-cljs](https://shadow-cljs.github.io/docs/UsersGuide.html).
|