Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/button-tooltip-accessible-label.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@ultraviolet/ui": minor
---

`Button`:
- new `tooltipLabel` prop: renders text inside a Tooltip with a `label` relation (tooltip text becomes the accessible name via `aria-labelledby`)
- new `tooltipDescription` prop: renders text inside a Tooltip with a `description` relation (accessible description via `aria-describedby`)
- new `accessibleLabel` prop: renders a `VisuallyHidden` element inside the button to provide a localizable accessible name
- deprecate `tooltip` prop: it now falls back to `tooltipDescription` to avoid a breaking change
- deprecate `aria-label` prop: it now falls back to `accessibleLabel` to avoid a breaking change
5 changes: 5 additions & 0 deletions .changeset/eleven-schools-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ultraviolet/ui": patch
---

`Tooltip`: remove opening delay in tests
6 changes: 3 additions & 3 deletions e2e/tests/componentsWithinModal/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('open modal, fill text inputs, close modal', async ({ page, baseURL }) => {

await expect(page.locator('div[data-testid="form-content"]')).toHaveText('Test Last Name')

await page.getByLabel('close').click()
await page.getByRole('button', { name: 'close' }).click()
await expect(page.locator('dialog')).not.toBeVisible()
})

Expand All @@ -30,10 +30,10 @@ test('open modal, select an option, open nested modal through select input, clos

await page.getByRole('button', { name: 'Open Nested Modal' }).click()
const nestedModal = page.locator('dialog').filter({ hasText: 'This is the nested modal' })
await nestedModal.getByLabel('close').click()
await nestedModal.getByRole('button', { name: 'close' }).click()
await expect(nestedModal).not.toBeAttached()

await page.getByLabel('close').click()
await page.getByRole('button', { name: 'close' }).click()
await expect(page.locator('dialog')).not.toBeVisible()
})

Expand Down
Loading
Loading