wabi 0.5.0 → 0.8.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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +207 -0
  3. data/lib/wabi/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0660623d8f6e54a685e9793a3e1ca16e9ac56fcf7150e061c0e80835b8fbe9bd
4
- data.tar.gz: ecbbce636fe38adf58c7931c208dbbe7000cc6b737ce516c286396c483f8e2e9
3
+ metadata.gz: 46c62f8e76667820ba8b7e4c68692e5de2ce77d7369dcabb2abbb3d226a1880e
4
+ data.tar.gz: ac059f870c7c665c0e0dcca5e1540c6a554a4fb9f23e17cb98eaf723250aea65
5
5
  SHA512:
6
- metadata.gz: 7c197e08b3f8cdea3f5587fc265495af390b12a185a030daf7add62fcf17dafd156d7d0466c39f0c943fff8400b486b46a09ce20a85c34fa89bd463056897ff3
7
- data.tar.gz: f8f0d96bad57dc8889221364e06e594bec7f8762ad1373715a308f5a312751e3335347d9b54895dae4c6c29da441900220e318e9d389c65bbd65295efd4eb924
6
+ metadata.gz: 79428d950c54fed32896a55b83e9e4a5281c4df8a31be5f370d57e0a111ecbe130ac4f7dd657e6baf27e0de3aad893fc89fa8eaf6b61c60357f4c38c940b47eb
7
+ data.tar.gz: 75cc44242f00676ff1d06bbc87cf39f426fb1594079046fbc25b0cf47acd355e3a3a9a5e2caf44778f235e0a5158bcb5aa3be100087f296db8dac07fe2c55832
data/CHANGELOG.md CHANGED
@@ -2,6 +2,213 @@
2
2
 
3
3
  All notable changes to Wabi land here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## 0.8.0 - 2026-05-31
6
+
7
+ Focused high-value mix: one marquee feature, one self-contained feature, an
8
+ accessibility win, and an overlay-controller hardening refactor. No breaking
9
+ changes.
10
+
11
+ ### Features
12
+
13
+ - **Combobox async items.** With `url:` set, the combobox debounces input and
14
+ fetches a server-rendered `ComboboxItem` fragment (AbortController-guarded so
15
+ stale in-flight responses are dropped), swaps it into the content, and
16
+ rebuilds the Zag collection from the new DOM via `machine.updateProps`. New
17
+ optional `ComboboxLoading` slot (shown during the fetch); empty state is
18
+ server-rendered; fetch errors keep the prior results + `console.warn`.
19
+ `param` (default `q`), `debounce` (default 250ms), and `min_length`
20
+ (default 1) are configurable. Sync mode is unchanged.
21
+ - **Slider marks/ticks.** `Slider(marks: [{value:, label:}])` (or bare
22
+ Integers) renders tick markers (short vertical lines) positioned via Zag
23
+ `getMarkerProps`, with optional labels. Works single + range.
24
+
25
+ ### Fixes
26
+
27
+ - **Slider is now fully functional + visible.** Several latent issues from the
28
+ v0.6 slider are fixed together:
29
+ - **Thumb + marks render.** `thumbAlignment: "center"` on the machine — the
30
+ previous `"contain"` default gated thumb/marker visibility on a thumb-size
31
+ measurement that never completed in the vanilla Stimulus setup (the machine
32
+ starts before `render()` decorates the DOM with Zag's part ids), leaving
33
+ the thumb knob and any marks `visibility: hidden`.
34
+ - **Pointer interaction.** New `SliderControl` element carries Zag's
35
+ `getControlProps` (`onPointerDown`), so click/drag on the track now sets the
36
+ value live. Previously the slider was keyboard-only. `SliderControl` also
37
+ provides the positioning context that vertically centers the thumb on the
38
+ track (the root is a flex column with the label/marks, so an absolutely
39
+ positioned thumb anchored to it floated above the bar).
40
+ - **Hidden-input dedup.** `syncHiddenInputs` cleanup selector
41
+ (`data-wabi--slider-hidden`) never matched the inputs `appendHidden` created
42
+ via `dataset` (which emitted single-dash `data-wabi-slider-hidden`), so a
43
+ new hidden input leaked on every render and the form value went stale.
44
+ `appendHidden` now uses `setAttribute` with the matching double-dash name.
45
+ - **Thumb styling.** Smaller (12px) thumb with a thinner border + subtle
46
+ shadow; `bg-foreground` fill (adapts to theme: dark knob in light mode,
47
+ light knob in dark mode).
48
+ - **Composition note:** the track + thumb(s) now nest inside `SliderControl`
49
+ (`Slider > SliderLabel + SliderControl(SliderTrack(SliderRange) + SliderThumb…)`).
50
+
51
+ ### Accessibility
52
+
53
+ - **`motion-reduce:transition-none`** on Toast and the animated overlays
54
+ (Dialog, Drawer, Popover, Tooltip, DropdownMenu, Select, Combobox content +
55
+ Dialog/Drawer backdrops) — `prefers-reduced-motion` users get instantaneous
56
+ enter/exit instead of slide/fade.
57
+
58
+ ### Refactor / internal
59
+
60
+ - **`_shared/overlay_portal.js`** — Dialog, Popover, Tooltip, Select, and
61
+ DropdownMenu now share `capturePortalRefs` / `attachToBody` / `restoreFromBody`
62
+ (composition, not inheritance) instead of duplicating that boilerplate per
63
+ controller. Behavior-preserving (each overlay browser re-smoked).
64
+ - DropdownMenu's closest-ancestor-sub lookup is deduped into `_parentMachineFor`
65
+ (was inline in both `connect()` and `render()`).
66
+ - Overlay `disconnect()` now restores from `<body>` before unregistering from
67
+ `WabiPortalRegistry`, so the registry recomputes its sibling cache on the
68
+ post-move DOM. `data-wabi-sub-index` is cleaned up on DropdownMenu disconnect.
69
+
70
+ ### Deferred to v0.9
71
+
72
+ - Toast `@zag-js/toast` group machine; `wabi:update` three-way merge; richer
73
+ Combobox async error UX; vertical-orientation Slider mark label offset; Phlex
74
+ 2.4 Ruby 4 warnings (upstream).
75
+
76
+ ## 0.7.0 - 2026-05-30
77
+
78
+ Quality + finish: 10 items closing v0.6 deferrals and v0.5 long-tail. No new
79
+ components; one breaking change.
80
+
81
+ ### Breaking
82
+
83
+ - **Slider range hidden inputs** now use Rails-native bracket params
84
+ (`name[min]` / `name[max]`) instead of v0.6's flat `name_min` /
85
+ `name_max`. Apps consuming range params must update their strong params
86
+ from `params.permit(:price_min, :price_max)` to
87
+ `params.require(:price).permit(:min, :max)`. Single-thumb sliders are
88
+ unchanged (`name=<value>`).
89
+
90
+ ### Features
91
+
92
+ - **Combobox `ComboboxItemIndicator`** now wires through `getItemIndicatorProps`
93
+ and toggles `hidden` based on the item's selected state (was unwired in v0.6).
94
+ - **Combobox per-item `disabled`** flag now works end-to-end: an item can carry
95
+ `{ value, label, disabled: true }` and the controller passes `isItemDisabled`
96
+ to the Zag collection so Zag stamps `data-disabled` on the matching `<li>` for
97
+ the `data-[disabled]:*` Tailwind variants.
98
+ - **Command palette item selection closes the dialog.** The bridge controller
99
+ listens at `document` level for `wabi--combobox:change` and filters by id
100
+ linkage (`data-wabi--command-id`, read via `getAttribute` — the double-dash
101
+ attribute does not round-trip through `dataset`) to survive the dialog portal
102
+ move. The controllers are ordered `wabi--command wabi--dialog` so the bridge
103
+ stamps the dialog content before the dialog portals it. The "Preview in v0.6"
104
+ callout is removed.
105
+ - **Command auto-opens the combobox when the dialog opens** so item clicks work
106
+ immediately, without typing first. The combobox builds its collection from the
107
+ rendered items when no `items` value is supplied.
108
+ - **Toast Sonner-style animations.** Slides in from the right on enter and slides
109
+ back out on exit — pure CSS transitions on `data-state`, no plugin dependency.
110
+ - **`window.wabiToasters[id]`** keyed registry (via a new `wabi--toaster`
111
+ controller on the `<ol>`) for pages with multiple Toaster instances.
112
+ `turbo_stream.wabi_toast(toaster_id: "alerts", ...)` targets a specific one.
113
+ `window.wabiToaster` remains as a deprecated alias to the most-recently-
114
+ connected toaster for back-compat.
115
+ - **DropdownMenu N-level submenus.** Sub-inside-sub nesting now works to
116
+ arbitrary depth (v0.6 was single-level only). Each sub links to its closest
117
+ ancestor sub or the root menu.
118
+
119
+ ### Cleanup / Perf
120
+
121
+ - **Vestigial `*-target="portal"` wrappers removed** from the portal-using
122
+ overlays (Dialog, Drawer, Command dialog). The wrapper was a v0.4 placeholder
123
+ for `portal: false` mode and added no behavior in v0.5+. (Popover, Tooltip,
124
+ DropdownMenu, and Select had already been cleaned in a prior refactor.)
125
+ - **`WabiPortalRegistry.applyInert`** caches the body-siblings list. The cache is
126
+ invalidated only when register/unregister changes the portal node set;
127
+ `onOpenChange` reuses the cache and just toggles the inert attribute.
128
+
129
+ ### Deferred to v0.8
130
+
131
+ - Combobox async items (server-side fetching).
132
+ - Toast `@zag-js/toast` group machine retry.
133
+ - `wabi:update` three-way merge on conflict.
134
+ - Slider marks/ticks.
135
+ - Overlay controller boilerplate refactor (the overlay controllers share
136
+ attach/restore boilerplate; the DropdownMenu ancestor-lookup is duplicated
137
+ between `connect()` and `render()`).
138
+ - `motion-reduce:transition-none` on Toast (and overlays) for reduced-motion.
139
+ - `WabiPortalRegistry` unregister/restoreFromBody ordering tidy.
140
+
141
+ ## 0.6.0 - 2026-05-28
142
+
143
+ ### Features
144
+
145
+ - **Forms wave** — 7 new components bring Wabi to 27 total:
146
+ - `Toggle` — pressable toggle button (Bold/Italic style). Distinct from
147
+ Switch, which is the sliding control. Variants: appearance
148
+ (default/outline) and size (default/sm/lg). Powered by `@zag-js/toggle`.
149
+ - `RadioGroup` + `RadioGroupItem` + `RadioGroupIndicator` —
150
+ single-select radio group with keyboard navigation via
151
+ `@zag-js/radio-group`. Hidden `<input type="radio">` per item for
152
+ form submission.
153
+ - `ToggleGroup` + `ToggleGroupItem` — group of toggles. `type: :single`
154
+ enforces single selection (radio-like with button styling);
155
+ `type: :multiple` allows multiple simultaneous selections. Hidden
156
+ inputs emitted by the controller (`name` for single, `name[]` for
157
+ multiple).
158
+ - `Slider` + `SliderLabel` + `SliderTrack` + `SliderRange` +
159
+ `SliderThumb` — value picker. Accepts Integer (single thumb) or
160
+ Array (range mode). Vertical orientation via
161
+ `orientation: :vertical`. Range inputs submit as `name_min`/`name_max`.
162
+ - `Combobox` + 8 sub-components — input with autocomplete dropdown.
163
+ Static items only in v0.6 (async deferred to v0.7). Uses the
164
+ Sprint 9 portal pattern as a non-modal anchored overlay. A sibling
165
+ `<input type="hidden">` mirrors the selected value so form
166
+ submission posts the value, not the typed label.
167
+ - `Form` + `FormField` + `FormLabel` + `FormDescription` +
168
+ `FormMessage` — Phlex wrapper over Rails' `form_with` helper.
169
+ FormMessage auto-extracts ActiveModel errors via `model:` + `field:`
170
+ kwargs, with `text:` override for explicit messages. FormLabel uses
171
+ `for_:` (matching the standalone `Label` convention).
172
+ - `Command` + 7 sub-components — Cmd+K palette. Composition of Dialog
173
+ (modal) and Combobox (filterable list). The combobox controller is
174
+ mounted on an inner wrapper so it can't overwrite the dialog's
175
+ role / aria-modal / data-state attributes (a trap discovered during
176
+ smoke testing — `spreadProps` from `@zag-js/vanilla` strips existing
177
+ attrs). Selection-closes-palette is **deferred to v0.7** (the
178
+ `wabi--command` bridge can't reach across the dialog portal yet).
179
+
180
+ ### Docs
181
+
182
+ - Form docs page demonstrates a multi-field example (name + email + bio
183
+ + newsletter checkbox + submit) with client-side validation and
184
+ inline success / per-field error messages — no page reload.
185
+ - Sidebar preserves its scroll position across Turbo navigations and
186
+ highlights the active component with `bg-accent + font-semibold +
187
+ shadow-sm` via Tailwind's `aria-[current=page]:` arbitrary variant.
188
+ - Docs `Pagefind` indexer now derives `ROUTES_TO_INDEX` from
189
+ `ComponentsController::ALL` instead of a hand-maintained list, so
190
+ future component additions are crawled automatically.
191
+
192
+ ### Deferred to v0.7
193
+
194
+ - Combobox async items (server-side fetching via Turbo Frame or
195
+ callback).
196
+ - Combobox `ComboboxItemIndicator` wiring (exported but not consumed by
197
+ the controller render loop).
198
+ - Combobox `disabled:` on individual items (data attribute is set but
199
+ the collection doesn't pass `isItemDisabled`).
200
+ - Slider marks/ticks at specific track positions.
201
+ - Command palette item selection auto-closing the dialog (the
202
+ `wabi--command` bridge listener doesn't cross the dialog portal —
203
+ needs Stimulus Outlets or a document-level listener).
204
+ - Toast `@zag-js/toast` group machine retry + Sonner-style animations
205
+ (carried over from v0.5).
206
+ - Overlay controller boilerplate refactor (the now-six overlay
207
+ controllers share ~50 LOC of attach/restore + ref capture).
208
+ - Vestigial `wabi--<name>-target="portal"` wrappers cleanup.
209
+ - DropdownMenu multi-level submenu nesting.
210
+ - `wabi:update` three-way merge.
211
+
5
212
  ## 0.5.0 - 2026-05-27
6
213
 
7
214
  ### Breaking
data/lib/wabi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wabi
4
- VERSION = "0.5.0"
4
+ VERSION = "0.8.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wabi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Ortega