@vanelsas/baredom 1.4.0 → 2.0.0

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.
Files changed (84) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/README.md +57 -5
  3. package/dist/base.js +212 -212
  4. package/dist/x-alert.js +16 -16
  5. package/dist/x-avatar-group.js +11 -11
  6. package/dist/x-avatar.js +16 -16
  7. package/dist/x-badge.js +11 -11
  8. package/dist/x-bento-grid.js +5 -5
  9. package/dist/x-bento-item.js +4 -4
  10. package/dist/x-breadcrumbs.js +14 -14
  11. package/dist/x-button.js +15 -15
  12. package/dist/x-cancel-dialogue.js +16 -16
  13. package/dist/x-card.js +7 -7
  14. package/dist/x-chart.js +46 -46
  15. package/dist/x-checkbox.js +11 -11
  16. package/dist/x-chip.js +9 -9
  17. package/dist/x-collapse.js +11 -11
  18. package/dist/x-command-palette.js +29 -29
  19. package/dist/x-container.js +6 -6
  20. package/dist/x-context-menu.js +20 -19
  21. package/dist/x-copy.js +23 -23
  22. package/dist/x-currency-field.js +21 -21
  23. package/dist/x-date-picker.js +36 -36
  24. package/dist/x-divider.js +12 -12
  25. package/dist/x-drawer.js +11 -11
  26. package/dist/x-dropdown.js +10 -10
  27. package/dist/x-fieldset.js +6 -6
  28. package/dist/x-file-download.js +7 -7
  29. package/dist/x-form-field.js +16 -16
  30. package/dist/x-form.js +9 -9
  31. package/dist/x-gaussian-blur.js +18 -18
  32. package/dist/x-grid.js +6 -6
  33. package/dist/x-kinetic-font.js +27 -27
  34. package/dist/x-kinetic-typography.js +37 -37
  35. package/dist/x-liquid-dock.js +37 -37
  36. package/dist/x-liquid-fill.js +42 -42
  37. package/dist/x-liquid-glass.js +38 -38
  38. package/dist/x-menu-item.js +10 -10
  39. package/dist/x-menu.js +11 -11
  40. package/dist/x-metaball-cursor.js +28 -28
  41. package/dist/x-modal.js +11 -11
  42. package/dist/x-morph-stack.js +39 -39
  43. package/dist/x-navbar.js +13 -13
  44. package/dist/x-neural-glow.js +31 -31
  45. package/dist/x-notification-center.js +9 -9
  46. package/dist/x-organic-divider.js +17 -17
  47. package/dist/x-organic-progress.js +38 -38
  48. package/dist/x-organic-shape.js +12 -12
  49. package/dist/x-pagination.js +16 -16
  50. package/dist/x-popover.js +14 -14
  51. package/dist/x-progress-circle.js +9 -9
  52. package/dist/x-progress.js +9 -9
  53. package/dist/x-radio.js +12 -12
  54. package/dist/x-ripple-effect.js +11 -11
  55. package/dist/x-scroll-parallax.js +17 -17
  56. package/dist/x-scroll-stack.js +18 -18
  57. package/dist/x-scroll-story.js +34 -35
  58. package/dist/x-scroll-timeline.js +46 -49
  59. package/dist/x-scroll.js +39 -39
  60. package/dist/x-search-field.js +15 -15
  61. package/dist/x-select.js +10 -10
  62. package/dist/x-sidebar.js +17 -17
  63. package/dist/x-skeleton.js +5 -5
  64. package/dist/x-slider.js +16 -16
  65. package/dist/x-soft-body.js +21 -20
  66. package/dist/x-spacer.js +5 -5
  67. package/dist/x-spinner.js +6 -6
  68. package/dist/x-splash.js +14 -14
  69. package/dist/x-stat.js +11 -11
  70. package/dist/x-stepper.js +16 -16
  71. package/dist/x-switch.js +11 -11
  72. package/dist/x-tab.js +8 -8
  73. package/dist/x-table-cell.js +21 -21
  74. package/dist/x-table-row.js +10 -10
  75. package/dist/x-table.js +13 -13
  76. package/dist/x-tabs.js +11 -11
  77. package/dist/x-text-area.js +18 -18
  78. package/dist/x-theme.js +25 -0
  79. package/dist/x-timeline-item.js +21 -21
  80. package/dist/x-timeline.js +9 -9
  81. package/dist/x-toast.js +23 -23
  82. package/dist/x-toaster.js +8 -8
  83. package/dist/x-typography.js +11 -10
  84. package/package.json +6 -2
package/CHANGELOG.md CHANGED
@@ -1,6 +1,26 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to BareDome will be documented in this file.
3
+ All notable changes to BareDOM will be documented in this file.
4
+
5
+ ## [2.0.0] - 2026-04-10
6
+
7
+ ### Added
8
+
9
+ - **x-theme** — Centralised theming component with 33 design tokens, 8 built-in presets (default, ocean, forest, sunset, neo-brutalist, aurora, mono-ai, warm-mineral), and `registerPreset()` JS API for custom themes with partial preset merging
10
+ - Theme preset picker on all 79 demo pages (desktop buttons + mobile dropdown, persists via localStorage)
11
+ - Theming section in README.md
12
+ - Theming guidelines in CLAUDE.md
13
+
14
+ ### Changed
15
+
16
+ - All 80 components now consume x-theme design tokens via `var(--x-token, fallback)` pattern — fully backwards compatible, components render identically without an `<x-theme>` wrapper
17
+ - Overlay components (modal, drawer, menu, popover, dropdown, toast, command-palette, context-menu, cancel-dialogue) use opaque `--x-color-bg` for backgrounds
18
+ - `demo-responsive.css` re-maps demo variables to theme tokens when inside `<x-theme>`
19
+ - Demo pages use theme-aware CSS variables instead of hardcoded colours
20
+
21
+ ### Fixed
22
+
23
+ - x-liquid-dock: `.color` property returns `null` when no `color` attribute is set, allowing the CSS theme token to take effect (visual default unchanged)
4
24
 
5
25
  ## [1.4.0] - 2026-04-09
6
26
 
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # BareDOM
2
2
 
3
+ <p align="center">
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="Project Logo" src="public/assets/baredom_lightmode.svg" width="200">
8
+ </picture>
9
+ </p>
10
+
3
11
  **Native web components. Zero runtime. No framework required.**
4
12
 
5
13
  [![npm version](https://img.shields.io/npm/v/%40vanelsas%2Fbaredom.svg)](https://www.npmjs.com/package/@vanelsas/baredom)
@@ -11,7 +19,7 @@
11
19
 
12
20
  ## What is BareDOM?
13
21
 
14
- BareDOM is a library of more than 70 UI components built entirely on web standards — Custom Elements v1, Shadow DOM, and ES modules. There is no framework runtime, no virtual DOM, and no JavaScript framework peer dependency. Every component is a native HTML element that you register once and use anywhere.
22
+ BareDOM is a library of 80 UI components built entirely on web standards — Custom Elements v1, Shadow DOM, and ES modules. There is no framework runtime, no virtual DOM, and no JavaScript framework peer dependency. Every component is a native HTML element that you register once and use anywhere.
15
23
 
16
24
  The core rendering model is deliberately simple:
17
25
 
@@ -45,16 +53,58 @@ I first built the usual suspects for web components, a basis to create a UI. I t
45
53
 
46
54
  **Tree-shakeable by design.** Each component is a separate ES module. Import only what you use; bundle tools eliminate the rest automatically.
47
55
 
48
- **Full theming with CSS custom properties.** Every visual detail — colours, spacing, radius, shadows, typography — is exposed as a `--x-<component>-<property>` CSS custom property. Override at any scope: globally, per-page, per-instance.
56
+ **Full theming with CSS custom properties.** Every visual detail — colours, spacing, radius, shadows, typography — is exposed as a `--x-<component>-<property>` CSS custom property. Override at any scope: globally, per-page, per-instance. Use [`<x-theme>`](./docs/x-theme.md) for centralised theming with built-in presets.
49
57
 
50
58
  **Light and dark mode included.** All components adapt automatically to `prefers-color-scheme`. No JavaScript required, no class toggling.
51
59
 
52
60
  **Accessibility built in.** ARIA roles, live regions, keyboard navigation, focus management, and `prefers-reduced-motion` support are part of the component, not an afterthought. You do not need to layer accessibility on top.
53
61
 
62
+ **Mobile-ready.** All components are tested on viewports from 320px up. Overlay panels cap their width to avoid overflow. Touch targets meet the 44px minimum on coarse-pointer devices. Pointer events are used throughout for unified mouse and touch input.
63
+
54
64
  **Open Shadow DOM.** Shadow roots are `mode: "open"` — inspectable in DevTools, styleable via `::part()`, and testable with standard DOM APIs.
55
65
 
56
66
  ---
57
67
 
68
+ ## Theming
69
+
70
+ Wrap any subtree in `<x-theme>` to apply a consistent palette across all components:
71
+
72
+ ```html
73
+ <x-theme preset="ocean">
74
+ <x-button>Themed button</x-button>
75
+ <x-alert type="info" text="Themed alert"></x-alert>
76
+ </x-theme>
77
+ ```
78
+
79
+ Ships with **8 built-in presets**: `default`, `ocean`, `forest`, `sunset`, `neo-brutalist`, `aurora`, `mono-ai`, `warm-mineral`. All presets include both light and dark mode values that work with `prefers-color-scheme`.
80
+
81
+ For custom themes, register your own preset via JavaScript:
82
+
83
+ ```js
84
+ import { registerPreset } from '@vanelsas/baredom/x-theme';
85
+
86
+ registerPreset('acme', {
87
+ light: { '--x-color-primary': '#e11d48', '--x-color-surface': '#fff' },
88
+ dark: { '--x-color-primary': '#fb7185', '--x-color-surface': '#1a1a2e' }
89
+ });
90
+ ```
91
+
92
+ ```html
93
+ <x-theme preset="acme">...</x-theme>
94
+ ```
95
+
96
+ Or override individual tokens via CSS:
97
+
98
+ ```html
99
+ <x-theme preset="default" style="--x-color-primary: #e11d48;">
100
+ ...
101
+ </x-theme>
102
+ ```
103
+
104
+ See [docs/x-theme.md](./docs/x-theme.md) for the full token list, preset details, and API reference.
105
+
106
+ ---
107
+
58
108
  ## Installation
59
109
 
60
110
  > **Using JavaScript?** See the [JavaScript Developer Guide](./docs/javascript-guide.md) for npm/ESM setup, event handling, theming, and framework integration examples (React, Vue, Svelte).
@@ -66,13 +116,13 @@ BareDOM can be consumed three ways: as a **ClojureScript source dependency** (Cl
66
116
  Add BareDOM to your `deps.edn`:
67
117
 
68
118
  ```clojure
69
- {:deps {com.github.avanelsas/baredom {:mvn/version "1.4.0"}}}
119
+ {:deps {com.github.avanelsas/baredom {:mvn/version "2.0.0"}}}
70
120
  ```
71
121
 
72
122
  Or in your `shadow-cljs.edn` dependencies:
73
123
 
74
124
  ```clojure
75
- :dependencies [[com.github.avanelsas/baredom "1.4.0"]]
125
+ :dependencies [[com.github.avanelsas/baredom "2.0.0"]]
76
126
  ```
77
127
 
78
128
  Then require component namespaces directly and call their `init!` function once at startup:
@@ -129,7 +179,7 @@ Add the npm package to your `package.json`:
129
179
  ```json
130
180
  {
131
181
  "dependencies": {
132
- "@vanelsas/baredom": "^1.4.0"
182
+ "@vanelsas/baredom": "^2.0.0"
133
183
  }
134
184
  }
135
185
  ```
@@ -384,6 +434,8 @@ Override CSS custom properties at any scope:
384
434
 
385
435
  **Predictable theming.** CSS custom properties follow a single naming convention: `--x-<component>-<property>`. Tokens are set on `:host` and cascade normally. You override them the same way you override any CSS property.
386
436
 
437
+ **Mobile-first.** Components use `dvh` viewport units, `calc(100vw - ...)` width caps, and `@media (pointer:coarse)` rules for touch-friendly sizing. No component overflows on a 320px screen.
438
+
387
439
  ---
388
440
 
389
441
  ## Browser Support