@voidable/ui-liveview 0.11.0 → 0.12.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 (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -126,6 +126,28 @@ and `maxlength` (and `pattern` on the single-line inputs); `inputmode`,
126
126
  attributes. `number_input` accepts `step="any"` and decimal `value`, `min`
127
127
  and `max`, and `stat` takes `description`.
128
128
 
129
+ ## Testing
130
+
131
+ `Phoenix.LiveViewTest` sees the server-rendered markup before any component script runs, so there is nothing to wait for: assert on markup (`has_element?(view, "void-switch[checked]")`). For behaviour in a browser (Wallaby, Playwright), load `@voidable/ui/testing` in the test build, which sets `data-void-ready` on `<html>` while the components are defined and rendered, and turn motion off with `data-anim-speed="off"` on `<html>`:
132
+
133
+ ```elixir
134
+ # config/test.exs
135
+ config :my_app, anim_speed: "off"
136
+ ```
137
+
138
+ ```heex
139
+ <html lang="en" data-anim-speed={Application.get_env(:my_app, :anim_speed)}>
140
+ ```
141
+
142
+ ```elixir
143
+ session
144
+ |> visit("/settings")
145
+ |> assert_has(Query.css("html[data-void-ready]"))
146
+ |> click(Query.button("Save"))
147
+ ```
148
+
149
+ A toast still closes after its `duration` with animation off: it is a timer. See [Testing](https://voidable.dev/guides/testing/).
150
+
129
151
  ## For AI agents
130
152
 
131
153
  `@voidable/ui-liveview/llms.txt` (npm) and `llms.txt` in the `live_voidable` Hex package summarise this adapter's API, including every HEEx component. Every element's parts, attributes and events are in `@voidable/ui/reference.md` (`node_modules/@voidable/ui/dist/reference.md`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidable/ui-liveview",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Phoenix LiveView hooks for Voidable UI web components",
5
5
  "keywords": [
6
6
  "phoenix",
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "peerDependencies": {
32
32
  "phoenix_live_view": ">=1.0.0",
33
- "@voidable/ui": "0.11.0"
33
+ "@voidable/ui": "0.12.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "typescript": "^6.0.0",
@@ -39,7 +39,7 @@
39
39
  "vitest": "^3.1.0",
40
40
  "@vitest/coverage-v8": "3.2.4",
41
41
  "happy-dom": "^17.0.0",
42
- "@voidable/ui": "0.11.0"
42
+ "@voidable/ui": "0.12.0"
43
43
  },
44
44
  "repository": {
45
45
  "type": "git",