Skip to content

Commit 3e3febf

Browse files
committed
Merge remote-tracking branch 'origin' into feat/nav-menu
2 parents cc38e59 + 8486e69 commit 3e3febf

File tree

21 files changed

+966
-852
lines changed

21 files changed

+966
-852
lines changed

bun.lock

Lines changed: 481 additions & 490 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@
3434
"setup:prod": "vc link --scope=chakra-ui -p ark-docs -y && vc env pull --environment production website/.env"
3535
},
3636
"devDependencies": {
37-
"@biomejs/biome": "2.3.6",
37+
"@biomejs/biome": "2.3.7",
3838
"@release-it/keep-a-changelog": "7.0.0",
39-
"@types/bun": "1.3.2",
39+
"@types/bun": "1.3.3",
4040
"lefthook": "2.0.4",
4141
"release-it": "19.0.6",
4242
"prettier": "3.6.2",
4343
"prettier-plugin-svelte": "3.4.0",
4444
"turbo": "2.6.1",
4545
"typescript": "5.9.3",
46-
"vercel": "48.10.2"
46+
"vercel": "48.10.10"
4747
},
4848
"packageManager": "[email protected]",
4949
"trustedDependencies": [
5050
"@ark-ui/website"
5151
],
5252
"overrides": {
5353
"flexsearch": "0.8.212",
54-
"vite": "7.2.2"
54+
"vite": "7.2.4"
5555
}
5656
}

packages/react/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
## [Unreleased]
22

3+
## [5.29.1] - 2025-11-22
4+
5+
### Fixed
6+
7+
- **Fieldset**: Fixed `aria-describedby` resolution to correctly reference helper text and error text IDs
8+
- **Floating Panel**:
9+
- Fixed resize trigger issue with `n` axis by explicitly setting `top: 0`
10+
- Fixed `draggable` and `resizable` options not being respected when set to `false`
11+
- **Presence**: Fixed regression where UNMOUNT transition might not be called consistently
12+
313
## [5.29.0] - 2025-11-20
414

515
### Added

packages/react/package.json

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@ark-ui/react",
33
"type": "module",
4-
"version": "5.29.0",
4+
"version": "5.29.1",
55
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
66
"keywords": [
77
"accordion",
@@ -85,81 +85,81 @@
8585
"sideEffects": false,
8686
"dependencies": {
8787
"@internationalized/date": "3.10.0",
88-
"@zag-js/accordion": "1.29.0",
89-
"@zag-js/anatomy": "1.29.0",
90-
"@zag-js/angle-slider": "1.29.0",
91-
"@zag-js/async-list": "1.29.0",
92-
"@zag-js/auto-resize": "1.29.0",
93-
"@zag-js/avatar": "1.29.0",
94-
"@zag-js/bottom-sheet": "1.29.0",
95-
"@zag-js/carousel": "1.29.0",
96-
"@zag-js/checkbox": "1.29.0",
97-
"@zag-js/clipboard": "1.29.0",
98-
"@zag-js/collapsible": "1.29.0",
99-
"@zag-js/collection": "1.29.0",
100-
"@zag-js/color-picker": "1.29.0",
101-
"@zag-js/color-utils": "1.29.0",
102-
"@zag-js/combobox": "1.29.0",
103-
"@zag-js/core": "1.29.0",
104-
"@zag-js/date-picker": "1.29.0",
105-
"@zag-js/date-utils": "1.29.0",
106-
"@zag-js/dialog": "1.29.0",
107-
"@zag-js/dom-query": "1.29.0",
108-
"@zag-js/editable": "1.29.0",
109-
"@zag-js/file-upload": "1.29.0",
110-
"@zag-js/file-utils": "1.29.0",
111-
"@zag-js/floating-panel": "1.29.0",
112-
"@zag-js/focus-trap": "1.29.0",
113-
"@zag-js/highlight-word": "1.29.0",
114-
"@zag-js/hover-card": "1.29.0",
115-
"@zag-js/image-cropper": "1.29.0",
116-
"@zag-js/i18n-utils": "1.29.0",
117-
"@zag-js/json-tree-utils": "1.29.0",
118-
"@zag-js/listbox": "1.29.0",
119-
"@zag-js/marquee": "1.29.0",
120-
"@zag-js/menu": "1.29.0",
121-
"@zag-js/navigation-menu": "1.29.0",
122-
"@zag-js/number-input": "1.29.0",
123-
"@zag-js/pagination": "1.29.0",
124-
"@zag-js/password-input": "1.29.0",
125-
"@zag-js/pin-input": "1.29.0",
126-
"@zag-js/popover": "1.29.0",
127-
"@zag-js/presence": "1.29.0",
128-
"@zag-js/progress": "1.29.0",
129-
"@zag-js/qr-code": "1.29.0",
130-
"@zag-js/radio-group": "1.29.0",
131-
"@zag-js/rating-group": "1.29.0",
132-
"@zag-js/react": "1.29.0",
133-
"@zag-js/scroll-area": "1.29.0",
134-
"@zag-js/select": "1.29.0",
135-
"@zag-js/signature-pad": "1.29.0",
136-
"@zag-js/slider": "1.29.0",
137-
"@zag-js/splitter": "1.29.0",
138-
"@zag-js/steps": "1.29.0",
139-
"@zag-js/switch": "1.29.0",
140-
"@zag-js/tabs": "1.29.0",
141-
"@zag-js/tags-input": "1.29.0",
142-
"@zag-js/timer": "1.29.0",
143-
"@zag-js/toast": "1.29.0",
144-
"@zag-js/toggle": "1.29.0",
145-
"@zag-js/toggle-group": "1.29.0",
146-
"@zag-js/tooltip": "1.29.0",
147-
"@zag-js/tour": "1.29.0",
148-
"@zag-js/tree-view": "1.29.0",
149-
"@zag-js/types": "1.29.0",
150-
"@zag-js/utils": "1.29.0"
88+
"@zag-js/accordion": "1.29.1",
89+
"@zag-js/anatomy": "1.29.1",
90+
"@zag-js/angle-slider": "1.29.1",
91+
"@zag-js/async-list": "1.29.1",
92+
"@zag-js/auto-resize": "1.29.1",
93+
"@zag-js/avatar": "1.29.1",
94+
"@zag-js/bottom-sheet": "1.29.1",
95+
"@zag-js/carousel": "1.29.1",
96+
"@zag-js/checkbox": "1.29.1",
97+
"@zag-js/clipboard": "1.29.1",
98+
"@zag-js/collapsible": "1.29.1",
99+
"@zag-js/collection": "1.29.1",
100+
"@zag-js/color-picker": "1.29.1",
101+
"@zag-js/color-utils": "1.29.1",
102+
"@zag-js/combobox": "1.29.1",
103+
"@zag-js/core": "1.29.1",
104+
"@zag-js/date-picker": "1.29.1",
105+
"@zag-js/date-utils": "1.29.1",
106+
"@zag-js/dialog": "1.29.1",
107+
"@zag-js/dom-query": "1.29.1",
108+
"@zag-js/editable": "1.29.1",
109+
"@zag-js/file-upload": "1.29.1",
110+
"@zag-js/file-utils": "1.29.1",
111+
"@zag-js/floating-panel": "1.29.1",
112+
"@zag-js/focus-trap": "1.29.1",
113+
"@zag-js/highlight-word": "1.29.1",
114+
"@zag-js/hover-card": "1.29.1",
115+
"@zag-js/image-cropper": "1.29.1",
116+
"@zag-js/i18n-utils": "1.29.1",
117+
"@zag-js/json-tree-utils": "1.29.1",
118+
"@zag-js/listbox": "1.29.1",
119+
"@zag-js/marquee": "1.29.1",
120+
"@zag-js/menu": "1.29.1",
121+
"@zag-js/navigation-menu": "1.29.1",
122+
"@zag-js/number-input": "1.29.1",
123+
"@zag-js/pagination": "1.29.1",
124+
"@zag-js/password-input": "1.29.1",
125+
"@zag-js/pin-input": "1.29.1",
126+
"@zag-js/popover": "1.29.1",
127+
"@zag-js/presence": "1.29.1",
128+
"@zag-js/progress": "1.29.1",
129+
"@zag-js/qr-code": "1.29.1",
130+
"@zag-js/radio-group": "1.29.1",
131+
"@zag-js/rating-group": "1.29.1",
132+
"@zag-js/react": "1.29.1",
133+
"@zag-js/scroll-area": "1.29.1",
134+
"@zag-js/select": "1.29.1",
135+
"@zag-js/signature-pad": "1.29.1",
136+
"@zag-js/slider": "1.29.1",
137+
"@zag-js/splitter": "1.29.1",
138+
"@zag-js/steps": "1.29.1",
139+
"@zag-js/switch": "1.29.1",
140+
"@zag-js/tabs": "1.29.1",
141+
"@zag-js/tags-input": "1.29.1",
142+
"@zag-js/timer": "1.29.1",
143+
"@zag-js/toast": "1.29.1",
144+
"@zag-js/toggle": "1.29.1",
145+
"@zag-js/toggle-group": "1.29.1",
146+
"@zag-js/tooltip": "1.29.1",
147+
"@zag-js/tour": "1.29.1",
148+
"@zag-js/tree-view": "1.29.1",
149+
"@zag-js/types": "1.29.1",
150+
"@zag-js/utils": "1.29.1"
151151
},
152152
"devDependencies": {
153153
"check-password-strength": "3.0.0",
154-
"@biomejs/biome": "2.3.6",
154+
"@biomejs/biome": "2.3.7",
155155
"@storybook/addon-a11y": "9.1.16",
156156
"@storybook/react-vite": "9.1.16",
157157
"@testing-library/dom": "10.4.1",
158158
"@testing-library/jest-dom": "6.9.1",
159159
"@testing-library/react": "16.3.0",
160160
"@testing-library/user-event": "14.6.1",
161161
"@types/jsdom": "21.1.7",
162-
"@types/react": "19.2.5",
162+
"@types/react": "19.2.6",
163163
"@types/react-dom": "19.2.3",
164164
"@vitejs/plugin-react": "5.1.1",
165165
"clean-package": "2.2.0",
@@ -172,11 +172,11 @@
172172
"react-shadow": "20.6.0",
173173
"react-use": "17.6.0",
174174
"react-frame-component": "5.2.7",
175-
"react-hook-form": "7.66.0",
175+
"react-hook-form": "7.66.1",
176176
"resize-observer-polyfill": "1.5.1",
177177
"storybook": "9.1.16",
178178
"typescript": "5.9.3",
179-
"vite": "7.2.2",
179+
"vite": "7.2.4",
180180
"vite-plugin-dts": "4.5.4",
181181
"vitest": "^4.0.0",
182182
"@vitest/coverage-v8": "^4.0.0",

packages/react/src/components/fieldset/fieldset.test.tsx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, screen } from '@testing-library/react'
1+
import { render, screen, waitFor } from '@testing-library/react'
22
import { axe } from 'vitest-axe'
33
import { Field, Fieldset } from '../'
44

@@ -43,4 +43,35 @@ describe('Fieldset', () => {
4343
render(<ComponentUnderTest />)
4444
expect(screen.queryByText('Fieldset Error Text')).not.toBeInTheDocument()
4545
})
46+
47+
it('should render aria-labelledby on the fieldset', async () => {
48+
render(<ComponentUnderTest />)
49+
const fieldset = screen.getByRole('group', { name: /legend/i })
50+
expect(fieldset).toHaveAttribute('aria-labelledby', expect.stringContaining('legend'))
51+
})
52+
53+
it('should have helper text accessible', async () => {
54+
render(<ComponentUnderTest />)
55+
const fieldset = screen.getByRole('group', { name: /legend/i })
56+
expect(fieldset).toBeInTheDocument()
57+
expect(screen.getByText('Fieldset Helper Text')).toBeInTheDocument()
58+
})
59+
60+
it('should set aria-describedby with helper text', async () => {
61+
render(<ComponentUnderTest />)
62+
const fieldset = screen.getByRole('group', { name: /legend/i })
63+
await waitFor(() => {
64+
expect(fieldset).toHaveAttribute('aria-describedby', expect.stringContaining('helper-text'))
65+
})
66+
})
67+
68+
it('should set aria-describedby with error text when invalid', async () => {
69+
render(<ComponentUnderTest invalid />)
70+
const fieldset = screen.getByRole('group', { name: /legend/i })
71+
await waitFor(() => {
72+
const describedBy = fieldset.getAttribute('aria-describedby')
73+
expect(describedBy).toContain('error-text')
74+
expect(describedBy).toContain('helper-text')
75+
})
76+
})
4677
})

packages/react/src/components/fieldset/use-fieldset.ts

Lines changed: 41 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dataAttr } from '@zag-js/dom-query'
2-
import { useId, useMemo, useRef } from 'react'
2+
import { useId, useRef, useState } from 'react'
33
import { useEnvironmentContext } from '../../providers'
44
import { useSafeLayoutEffect } from '../../utils/use-safe-layout-effect'
55
import type { HTMLProps } from '../factory'
@@ -27,8 +27,7 @@ export const useFieldset = (props: UseFieldsetProps = {}) => {
2727

2828
const env = useEnvironmentContext()
2929

30-
const hasErrorText = useRef(false)
31-
const hasHelperText = useRef(false)
30+
const [textElements, setTextElements] = useState({ hasErrorText: false, hasHelperText: false })
3231

3332
const uid = useId()
3433
const id = props.id ?? uid
@@ -44,8 +43,9 @@ export const useFieldset = (props: UseFieldsetProps = {}) => {
4443

4544
const checkTextElements = () => {
4645
const docOrShadowRoot = env.getRootNode() as ShadowRoot | Document
47-
hasErrorText.current = !!docOrShadowRoot.getElementById(errorTextId)
48-
hasHelperText.current = !!docOrShadowRoot.getElementById(helperTextId)
46+
const hasErrorText = !!docOrShadowRoot.getElementById(errorTextId)
47+
const hasHelperText = !!docOrShadowRoot.getElementById(helperTextId)
48+
setTextElements({ hasErrorText, hasHelperText })
4949
}
5050

5151
checkTextElements()
@@ -57,56 +57,42 @@ export const useFieldset = (props: UseFieldsetProps = {}) => {
5757
return () => observer.disconnect()
5858
}, [env, errorTextId, helperTextId])
5959

60-
const labelIds = useMemo(() => {
61-
const ids: string[] = []
62-
if (hasErrorText.current && invalid) ids.push(errorTextId)
63-
if (hasHelperText.current) ids.push(helperTextId)
64-
return ids.join(' ') || undefined
65-
}, [invalid, errorTextId, helperTextId])
66-
67-
const getRootProps = useMemo(
68-
() => () =>
69-
({
70-
...parts.root.attrs,
71-
ref: rootRef,
72-
disabled,
73-
'data-disabled': dataAttr(disabled),
74-
'data-invalid': dataAttr(invalid),
75-
'aria-labelledby': legendId,
76-
'aria-describedby': labelIds,
77-
}) as HTMLProps<'fieldset'>,
78-
[disabled, invalid, legendId, labelIds],
79-
)
80-
81-
const getLegendProps = useMemo(
82-
() => () =>
83-
({
84-
id: legendId,
85-
...parts.legend.attrs,
86-
'data-disabled': dataAttr(disabled),
87-
'data-invalid': dataAttr(invalid),
88-
}) as HTMLProps<'legend'>,
89-
[legendId, disabled, invalid],
90-
)
91-
92-
const getHelperTextProps = useMemo(
93-
() => () =>
94-
({
95-
id: helperTextId,
96-
...parts.helperText.attrs,
97-
}) as HTMLProps<'span'>,
98-
[helperTextId],
99-
)
100-
101-
const getErrorTextProps = useMemo(
102-
() => () =>
103-
({
104-
id: errorTextId,
105-
...parts.errorText.attrs,
106-
'aria-live': 'polite',
107-
}) as HTMLProps<'span'>,
108-
[errorTextId],
109-
)
60+
const ids: string[] = []
61+
if (textElements.hasErrorText && invalid) ids.push(errorTextId)
62+
if (textElements.hasHelperText) ids.push(helperTextId)
63+
const labelIds = ids.length > 0 ? ids.join(' ') : undefined
64+
65+
const getRootProps = () =>
66+
({
67+
...parts.root.attrs,
68+
ref: rootRef,
69+
disabled,
70+
'data-disabled': dataAttr(disabled),
71+
'data-invalid': dataAttr(invalid),
72+
'aria-labelledby': legendId,
73+
'aria-describedby': labelIds,
74+
}) as HTMLProps<'fieldset'>
75+
76+
const getLegendProps = () =>
77+
({
78+
id: legendId,
79+
...parts.legend.attrs,
80+
'data-disabled': dataAttr(disabled),
81+
'data-invalid': dataAttr(invalid),
82+
}) as HTMLProps<'legend'>
83+
84+
const getHelperTextProps = () =>
85+
({
86+
id: helperTextId,
87+
...parts.helperText.attrs,
88+
}) as HTMLProps<'span'>
89+
90+
const getErrorTextProps = () =>
91+
({
92+
id: errorTextId,
93+
...parts.errorText.attrs,
94+
'aria-live': 'polite',
95+
}) as HTMLProps<'span'>
11096

11197
return {
11298
refs: {

packages/solid/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
## [Unreleased]
22

3+
## [5.29.1] - 2025-11-22
4+
5+
### Fixed
6+
7+
- **Fieldset**: Fixed `aria-describedby` resolution to correctly reference helper text and error text IDs
8+
- **Floating Panel**:
9+
- Fixed resize trigger issue with `n` axis by explicitly setting `top: 0`
10+
- Fixed `draggable` and `resizable` options not being respected when set to `false`
11+
- **Presence**: Fixed regression where UNMOUNT transition might not be called consistently
12+
313
## [5.29.0] - 2025-11-20
414

515
### Added

0 commit comments

Comments
 (0)