@@ -2,6 +2,11 @@ import React from 'react';
2
2
3
3
import { ROLES } from '@/types/role' ;
4
4
5
+ type GenericLinkAriaAttributes = Pick <
6
+ React . AriaAttributes ,
7
+ 'aria-label' | 'aria-describedby' | 'aria-disabled' | 'aria-current'
8
+ > ;
9
+
5
10
/**
6
11
* Defines the properties for a generic link component.
7
12
* @property {string } url - The URL the link points to.
@@ -10,6 +15,8 @@ import { ROLES } from '@/types/role';
10
15
* @property {string } [target] - Specifies where to open the linked document.
11
16
* @property {boolean } [aria-disabled] - Indicates that the element is perceivable but disabled.
12
17
* @property {string } [aria-label] - Defines a string value that labels the current element.
18
+ * @property {string } [aria-describedby] - Defines a string value that labels the current element.
19
+ * @property {string } [aria-current] - Defines value for the current element.
13
20
* @property {() => void } [onClick] - Function to call when the link is clicked.
14
21
* @property {() => void } [onFocus] - Function to call when the link is focused.
15
22
* @property {() => void } [onMouseEnter] - Function to call when the mouse enters the link area.
@@ -23,16 +30,14 @@ export type IGenericLink = {
23
30
children : string | JSX . Element ;
24
31
className ?: string ;
25
32
target ?: string ;
26
- [ 'aria-disabled' ] ?: boolean ;
27
- [ 'aria-label' ] ?: string ;
28
33
onClick ?: ( ) => void ;
29
34
onFocus ?: ( ) => void ;
30
35
onMouseEnter ?: ( ) => void ;
31
36
onMouseLeave ?: ( ) => void ;
32
37
role ?: ROLES ;
33
38
dataTestId ?: string ;
34
39
draggable ?: boolean ;
35
- } ;
40
+ } & GenericLinkAriaAttributes ;
36
41
37
42
/**
38
43
* Defines the type for a generic link component, which can be either a functional component or a forward ref component.
0 commit comments