Skip to content

feat!: Friendlier typing for the ActiveState.aria property#111

Merged
webJose merged 1 commit intomainfrom
JP/ActiveState_Aria
Nov 11, 2025
Merged

feat!: Friendlier typing for the ActiveState.aria property#111
webJose merged 1 commit intomainfrom
JP/ActiveState_Aria

Conversation

@webJose
Copy link
Contributor

@webJose webJose commented Nov 11, 2025

Closes #106.

@webJose webJose requested a review from Copilot November 11, 2025 22:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the developer experience by simplifying the syntax for ARIA attributes in the ActiveState.aria property. Instead of requiring the full aria-* prefix (e.g., 'aria-selected'), developers can now use the unprefixed attribute name (e.g., selected).

  • Introduced a new ActiveStateAriaAttributes type that maps unprefixed ARIA attribute names to their values
  • Updated activeBehavior to prepend aria- when setting/removing attributes
  • Updated Link.svelte to transform unprefixed ARIA attributes to prefixed ones before applying them to the anchor element

Reviewed Changes

Copilot reviewed 5 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/lib/types.ts Added ActiveStateAriaAttributes type and updated ActiveState.aria to use it
src/lib/behaviors/active.svelte.ts Modified attribute handling to prepend aria- prefix when setting/removing attributes
src/lib/behaviors/active.svelte.test.ts Updated test cases to use unprefixed ARIA attribute names
src/lib/Link/Link.svelte.test.ts Updated test cases to use unprefixed ARIA attribute names
src/lib/Link/Link.svelte Added calcActiveStateAria to transform unprefixed to prefixed ARIA attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@webJose webJose merged commit 9e31476 into main Nov 11, 2025
1 check passed
@webJose webJose deleted the JP/ActiveState_Aria branch November 11, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better typing for ActiveState.aria

1 participant