@ariakit/react 0.4.23 → 0.4.25
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 +81 -0
- package/package.json +30 -27
- package/readme.md +2 -2
- package/tsconfig.build.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,86 @@
|
|
|
1
1
|
# @ariakit/react
|
|
2
2
|
|
|
3
|
+
## 0.4.25
|
|
4
|
+
|
|
5
|
+
### Clicking outside no longer restores focus to the disclosure element
|
|
6
|
+
|
|
7
|
+
[`Dialog`](https://ariakit.com/reference/dialog) and components that extend it (such as [`Menu`](https://ariakit.com/reference/menu) and [`Popover`](https://ariakit.com/reference/popover)) no longer restore focus to the disclosure element when the dialog is closed by clicking or right-clicking outside. This aligns with native HTML `<dialog>` and `popover` behavior where trigger buttons don't receive focus when you interact outside.
|
|
8
|
+
|
|
9
|
+
Focus is still restored normally when the dialog is closed by other means, such as pressing Escape, selecting a menu item, or calling `store.hide()` programmatically. In these cases the disclosure element is now focused with default browser scrolling instead of `preventScroll`.
|
|
10
|
+
|
|
11
|
+
### Improved Safari focus behavior for buttons, checkboxes, and radio buttons
|
|
12
|
+
|
|
13
|
+
On Safari, buttons, checkboxes, and radio buttons don't receive focus on mousedown like other browsers. Previously, this was handled by manually focusing the element in a `mousedown` handler. Now, an explicit `tabIndex` attribute is set on these elements in Safari, which causes the browser to focus them natively. This results in more predictable focus behavior and fewer timing-sensitive workarounds.
|
|
14
|
+
|
|
15
|
+
### Other updates
|
|
16
|
+
|
|
17
|
+
- Fixed a race condition in [`Dialog`](https://ariakit.org/reference/dialog) where the deferred auto-focus could steal focus from the disclosure element after the dialog was closed.
|
|
18
|
+
- Fixed [`formStore.setError()`](https://ariakit.org/reference/use-form-store#seterror) and [`formStore.setFieldTouched()`](https://ariakit.org/reference/use-form-store#setfieldtouched) failing to set values on nested array field paths such as `items.0.name`.
|
|
19
|
+
- Fixed [`SelectItem`](https://ariakit.com/reference/select-item) store item `children` property reflecting the [`value`](https://ariakit.com/reference/select-item#value) prop instead of the actual rendered text content.
|
|
20
|
+
- Fixed [`MenuButton`](https://ariakit.com/reference/menu-button) to preserve [`accessibleWhenDisabled`](https://ariakit.com/reference/menu-button#accessiblewhendisabled) behavior when composed with a rendered [`Button`](https://ariakit.com/reference/button).
|
|
21
|
+
- Fixed [`Menu`](https://ariakit.org/reference/menu) with [`modal`](https://ariakit.org/reference/menu#modal) and [`getPersistentElements`](https://ariakit.org/reference/menu#getpersistentelements) so focusing a persistent [`MenuButton`](https://ariakit.org/reference/menu-button) doesn't immediately move focus back to the menu.
|
|
22
|
+
- Fixed [`TabPanel`](https://ariakit.com/reference/tab-panel) not re-evaluating tabbable children when the panel becomes visible.
|
|
23
|
+
- Fixed components not dropping their internal `aria-labelledby` when `aria-label` is passed.
|
|
24
|
+
- Updated dependencies: `@ariakit/react-core@0.4.25`
|
|
25
|
+
|
|
26
|
+
## 0.4.24
|
|
27
|
+
|
|
28
|
+
This release improves React combobox and form reliability, including preserved combobox input and popover scroll position during result updates, more predictable focus behavior after filtering selects on iOS Safari, proper isolation of [`FormRadio`](https://ariakit.org/reference/form-radio) groups inside nested composite widgets, safer handling of explicitly undefined [`id`](https://ariakit.org/reference/select-item#id) props, and better generic typing for [`CheckboxProvider`](https://ariakit.org/reference/checkbox-provider) wrappers.
|
|
29
|
+
|
|
30
|
+
### Improved `CheckboxProvider` generic typing
|
|
31
|
+
|
|
32
|
+
This fixes TypeScript errors when wrapping [`CheckboxProvider`](https://ariakit.org/reference/checkbox-provider) in generic React components. Controlled and uncontrolled checkbox group wrappers now type-check correctly without requiring non-null assertions on values such as `defaultValue`.
|
|
33
|
+
|
|
34
|
+
Before, generic wrappers often needed a non-null assertion to satisfy the provider props:
|
|
35
|
+
|
|
36
|
+
```tsx {15}
|
|
37
|
+
interface CheckboxCardGridProps<T extends string | number> extends Pick<
|
|
38
|
+
Ariakit.CheckboxProviderProps<T>,
|
|
39
|
+
"value" | "setValue" | "defaultValue"
|
|
40
|
+
> {}
|
|
41
|
+
|
|
42
|
+
function CheckboxCardGrid<T extends string | number>({
|
|
43
|
+
value,
|
|
44
|
+
setValue,
|
|
45
|
+
defaultValue,
|
|
46
|
+
}: CheckboxCardGridProps<T>) {
|
|
47
|
+
return (
|
|
48
|
+
<CheckboxProvider
|
|
49
|
+
value={value}
|
|
50
|
+
setValue={setValue}
|
|
51
|
+
defaultValue={defaultValue!}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Now the same wrapper can type-check without the workaround:
|
|
58
|
+
|
|
59
|
+
```tsx {4}
|
|
60
|
+
<CheckboxProvider
|
|
61
|
+
value={value}
|
|
62
|
+
setValue={setValue}
|
|
63
|
+
defaultValue={defaultValue}
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Fixed `Combobox` input scroll position resetting
|
|
68
|
+
|
|
69
|
+
When a [`Combobox`](https://ariakit.org/reference/combobox) input's text overflowed its width, the input's horizontal scroll position reset to the beginning each time the results changed. This happened because the virtual focus mechanism briefly moved DOM focus to the active item and back when [`autoSelect`](https://ariakit.org/reference/combobox#autoselect) was enabled, causing browsers to reset the input's internal `scrollLeft`.
|
|
70
|
+
|
|
71
|
+
The scroll position is now preserved across these focus transitions.
|
|
72
|
+
|
|
73
|
+
### Fixed `FormRadio` registering to ancestor composite stores
|
|
74
|
+
|
|
75
|
+
[`FormRadio`](https://ariakit.org/reference/form-radio) items nested inside components like [`TabPanel`](https://ariakit.org/reference/tab-panel) were incorrectly registering to the tab store, causing arrow keys in the tab list to navigate to radio items instead of other tabs. [`FormRadioGroup`](https://ariakit.org/reference/form-radio-group) now resets the composite context for its children, preventing form radio items from being picked up by unrelated parent stores.
|
|
76
|
+
|
|
77
|
+
### Other updates
|
|
78
|
+
|
|
79
|
+
- Fixed [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover) scroll position resetting when items change in multi-select mode (e.g., during infinite scroll).
|
|
80
|
+
- Fixed [`SelectItem`](https://ariakit.org/reference/select-item) stealing focus from the combobox input when the selected item reappears after filtering, which dismissed the keyboard on iOS Safari.
|
|
81
|
+
- Fixed components crashing with "Maximum call stack size exceeded" when the [`id`](https://ariakit.org/reference/select-item#id) prop is explicitly passed as `undefined`.
|
|
82
|
+
- Updated dependencies: `@ariakit/react-core@0.4.24`
|
|
83
|
+
|
|
3
84
|
## 0.4.23
|
|
4
85
|
|
|
5
86
|
- Fixed [`ComboboxDisclosure`](https://ariakit.org/reference/combobox-disclosure) so pressing Escape closes [`ComboboxPopover`](https://ariakit.org/reference/combobox-popover) when the popover starts open and the [`Combobox`](https://ariakit.org/reference/combobox) input is auto-focused.
|
package/package.json
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariakit/react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.25",
|
|
4
4
|
"description": "Toolkit for building accessible web apps with React",
|
|
5
|
-
"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"a11y",
|
|
7
|
+
"ariakit",
|
|
8
|
+
"components",
|
|
9
|
+
"react",
|
|
10
|
+
"toolkit",
|
|
11
|
+
"ui"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://ariakit.com",
|
|
6
14
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://ariakit.org",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"main": "cjs/index.cjs",
|
|
10
|
-
"module": "esm/index.js",
|
|
11
|
-
"types": "cjs/index.d.ts",
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/ariakit/ariakit.git",
|
|
15
|
-
"directory": "packages/ariakit-react"
|
|
16
|
-
},
|
|
17
15
|
"author": {
|
|
18
16
|
"name": "Diego Haz",
|
|
19
17
|
"email": "hazdiego@gmail.com",
|
|
20
18
|
"url": "https://github.com/diegohaz"
|
|
21
19
|
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/ariakit/ariakit.git",
|
|
23
|
+
"directory": "packages/ariakit-react"
|
|
24
|
+
},
|
|
22
25
|
"funding": {
|
|
23
26
|
"type": "opencollective",
|
|
24
27
|
"url": "https://opencollective.com/ariakit"
|
|
25
28
|
},
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"keywords": [
|
|
32
|
-
"ariakit",
|
|
33
|
-
"react",
|
|
34
|
-
"a11y",
|
|
35
|
-
"ui",
|
|
36
|
-
"toolkit",
|
|
37
|
-
"components"
|
|
38
|
-
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"main": "cjs/index.cjs",
|
|
32
|
+
"module": "esm/index.js",
|
|
33
|
+
"types": "cjs/index.d.ts",
|
|
39
34
|
"dependencies": {
|
|
40
|
-
"@ariakit/react-core": "0.4.
|
|
35
|
+
"@ariakit/react-core": "0.4.25"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"react": "18.3.1",
|
|
39
|
+
"react-dom": "18.3.1"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -241,5 +240,9 @@
|
|
|
241
240
|
}
|
|
242
241
|
},
|
|
243
242
|
"./package.json": "./package.json"
|
|
243
|
+
},
|
|
244
|
+
"scripts": {
|
|
245
|
+
"build": "node ../../scripts/build/build.js",
|
|
246
|
+
"clean": "node ../../scripts/build/clean.js"
|
|
244
247
|
}
|
|
245
|
-
}
|
|
248
|
+
}
|
package/readme.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
Toolkit for building accessible web apps with <a href="https://reactjs.org">React</a>.
|
|
5
5
|
<br>
|
|
6
|
-
<a href="https://ariakit.
|
|
6
|
+
<a href="https://ariakit.com"><strong>Explore website »</strong></a>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
9
|
<br>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/ariakit/ariakit?style=social">
|
|
28
28
|
</a>
|
|
29
29
|
|
|
30
|
-
<a href="https://bsky.app/profile/ariakit.
|
|
30
|
+
<a href="https://bsky.app/profile/ariakit.com">
|
|
31
31
|
<img alt="Follow Ariakit on Bluesky" src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff">
|
|
32
32
|
</a>
|
|
33
33
|
|