`. |
+| `...props` | `ComponentProps<'div'>` | — | Forwarded to the rendered `
`. |
### `Dialog.Title`
diff --git a/packages/react/dialog/package.json b/packages/react/dialog/package.json
index 2d9d979..b22e7cc 100644
--- a/packages/react/dialog/package.json
+++ b/packages/react/dialog/package.json
@@ -1,6 +1,6 @@
{
"name": "@dunky.dev/react-dialog",
- "version": "0.4.0",
+ "version": "0.5.0",
"description": "React binding for @dunky.dev/dialog.",
"license": "MIT",
"repository": {
diff --git a/packages/react/hooks/use-focus-trap/CHANGELOG.md b/packages/react/hooks/use-focus-trap/CHANGELOG.md
index 82b4e2e..308f7a5 100644
--- a/packages/react/hooks/use-focus-trap/CHANGELOG.md
+++ b/packages/react/hooks/use-focus-trap/CHANGELOG.md
@@ -1,5 +1,12 @@
# @dunky.dev/react-use-focus-trap
+## 0.1.3
+
+### Patch Changes
+
+- Updated dependencies [[`bbb04da`](https://github.com/dunky-dev/ui/commit/bbb04da6397f5e9a1641cbea9e2eb0c082c2965c), [`bfbe863`](https://github.com/dunky-dev/ui/commit/bfbe86307b07bfc8d55207c70cfdc328693e5814)]:
+ - @dunky.dev/dom-focus-trap@0.1.3
+
## 0.1.2
### Patch Changes
diff --git a/packages/react/hooks/use-focus-trap/package.json b/packages/react/hooks/use-focus-trap/package.json
index 9bd09e1..b01d277 100644
--- a/packages/react/hooks/use-focus-trap/package.json
+++ b/packages/react/hooks/use-focus-trap/package.json
@@ -1,6 +1,6 @@
{
"name": "@dunky.dev/react-use-focus-trap",
- "version": "0.1.2",
+ "version": "0.1.3",
"description": "React binding for @dunky.dev/dom-focus-trap.",
"license": "MIT",
"repository": {
diff --git a/packages/solid/dialog/CHANGELOG.md b/packages/solid/dialog/CHANGELOG.md
index 6182145..4485e1b 100644
--- a/packages/solid/dialog/CHANGELOG.md
+++ b/packages/solid/dialog/CHANGELOG.md
@@ -1,5 +1,37 @@
# @dunky.dev/solid-dialog
+## 0.3.0
+
+### Minor Changes
+
+- [#53](https://github.com/dunky-dev/ui/pull/53) [`2cc4a1b`](https://github.com/dunky-dev/ui/commit/2cc4a1b00966526497da15b4123060a2b2c104f0) Thanks [@ivanbanov](https://github.com/ivanbanov)! - `Dialog.Content` gains `restoreFocus` — the close-side counterpart to
+ `initialFocus`. Closing still returns focus to whatever held it before the
+ dialog opened; `restoreFocus` names where it goes when that holder can't
+ meaningfully take focus back: focus sat on the body (a pointer press can
+ leave it there), or on an element removed from the document since.
+ Typically the dialog's trigger.
+
+ ```tsx
+ // React — a ref, read at close time
+
…
+
+ // Solid — an element or accessor, resolved at close time
+
trigger}>…
+ ```
+
+ Before, those two cases silently dropped focus: restoring to the body goes
+ nowhere, and focusing a disconnected element is a no-op, leaving focus
+ stranded on the closing layer. The element focused before opening still
+ always wins when it is meaningful — the fallback never overrides it. At the
+ DOM layer, `openDialogLayer` takes `restoreFocus?: () => HTMLElement | null`,
+ resolved at close.
+
+### Patch Changes
+
+- Updated dependencies [[`2cc4a1b`](https://github.com/dunky-dev/ui/commit/2cc4a1b00966526497da15b4123060a2b2c104f0), [`bbb04da`](https://github.com/dunky-dev/ui/commit/bbb04da6397f5e9a1641cbea9e2eb0c082c2965c), [`bfbe863`](https://github.com/dunky-dev/ui/commit/bfbe86307b07bfc8d55207c70cfdc328693e5814)]:
+ - @dunky.dev/dom-dialog@0.3.0
+ - @dunky.dev/solid-use-focus-trap@0.1.2
+
## 0.2.0
### Minor Changes
diff --git a/packages/solid/dialog/SPEC.md b/packages/solid/dialog/SPEC.md
index f0f98ea..4166469 100644
--- a/packages/solid/dialog/SPEC.md
+++ b/packages/solid/dialog/SPEC.md
@@ -155,11 +155,11 @@ The positioning + scroll layer around the dialog window.
The dialog window; renders a `
` with the `dialog` role.
-| Prop | Type | Default | Description |
-| -------------- | --------------------------------------------------------- | ----------------- | ------------------------------------------------------------------- |
-| `initialFocus` | `HTMLElement \| (() => HTMLElement \| null \| undefined)` | the dialog window | The element to focus when the dialog opens — resolved at open time. |
+| Prop | Type | Default | Description |
+| -------------- | --------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `initialFocus` | `HTMLElement \| (() => HTMLElement \| null \| undefined)` | the dialog window | The element to focus when the dialog opens — resolved at open time. |
| `restoreFocus` | `HTMLElement \| (() => HTMLElement \| null \| undefined)` | — | Focused on close when nothing meaningful held focus before opening (the body, or an element since removed) — resolved at close time. Typically the trigger. |
-| `...props` | `ComponentProps<'div'>` | — | Forwarded to the rendered `
`. |
+| `...props` | `ComponentProps<'div'>` | — | Forwarded to the rendered `
`. |
### `Dialog.Title`
diff --git a/packages/solid/dialog/package.json b/packages/solid/dialog/package.json
index c885d16..8d0e5a6 100644
--- a/packages/solid/dialog/package.json
+++ b/packages/solid/dialog/package.json
@@ -1,6 +1,6 @@
{
"name": "@dunky.dev/solid-dialog",
- "version": "0.2.0",
+ "version": "0.3.0",
"description": "Solid binding for @dunky.dev/dialog.",
"license": "MIT",
"repository": {
diff --git a/packages/solid/hooks/use-focus-trap/CHANGELOG.md b/packages/solid/hooks/use-focus-trap/CHANGELOG.md
index 0115914..f4cebc8 100644
--- a/packages/solid/hooks/use-focus-trap/CHANGELOG.md
+++ b/packages/solid/hooks/use-focus-trap/CHANGELOG.md
@@ -1,5 +1,12 @@
# @dunky.dev/solid-use-focus-trap
+## 0.1.2
+
+### Patch Changes
+
+- Updated dependencies [[`bbb04da`](https://github.com/dunky-dev/ui/commit/bbb04da6397f5e9a1641cbea9e2eb0c082c2965c), [`bfbe863`](https://github.com/dunky-dev/ui/commit/bfbe86307b07bfc8d55207c70cfdc328693e5814)]:
+ - @dunky.dev/dom-focus-trap@0.1.3
+
## 0.1.1
### Patch Changes
diff --git a/packages/solid/hooks/use-focus-trap/package.json b/packages/solid/hooks/use-focus-trap/package.json
index 7ffa5c4..402b0f0 100644
--- a/packages/solid/hooks/use-focus-trap/package.json
+++ b/packages/solid/hooks/use-focus-trap/package.json
@@ -1,6 +1,6 @@
{
"name": "@dunky.dev/solid-use-focus-trap",
- "version": "0.1.1",
+ "version": "0.1.2",
"description": "Solid binding for @dunky.dev/dom-focus-trap.",
"license": "MIT",
"repository": {