Skip to content

Commit d04a707

Browse files
Typescript definitions: make aria-* props optional (#2774)
Co-authored-by: Stephen James <[email protected]>
1 parent 830b758 commit d04a707

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

components/checkbox.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ declare module '@salesforce/design-system-react/components/checkbox' {
77
* another region of the page. An example would be a select box
88
* that shows or hides a panel.
99
*/
10-
'aria-controls': string;
10+
'aria-controls'?: string;
1111
/**
1212
* The `aria-describedby` attribute is used to indicate the IDs of the elements that describe the object. It is used to establish a relationship between widgets or groups and text that described them. This is very similar to aria-labelledby: a label describes the essence of an object, while a description provides more information that the user might need.
1313
*/
14-
'aria-describedby': string;
14+
'aria-describedby'?: string;
1515
/**
1616
* The aria-labelledby attribute establishes relationships between objects and their label(s), and its value should be one or more element IDs, which refer to elements that have the text needed for labeling. List multiple element IDs in a space delimited fashion.
1717
*/
18-
'aria-labelledby': string;
18+
'aria-labelledby'?: string;
1919
/**
2020
* `aria-owns` indicate that an element depends on the current one when the relation can't be determined by the hierarchy structure.
2121
*/
22-
'aria-owns': string;
22+
'aria-owns'?: string;
2323
/**
2424
* The `aria-required` attribute is used to indicate that user input is required on an element before a form can be submitted.
2525
*/
26-
'aria-required': boolean;
26+
'aria-required'?: boolean;
2727
/**
2828
* **Assistive text for accessibility**
2929
* This object is merged with the default props object on every render.

components/combobox/combobox.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ declare module '@salesforce/design-system-react/components/combobox/combobox' {
2424
}>;
2525
/**
2626
* The `aria-describedby` attribute is used to indicate the IDs of the elements that describe the object. It is used to establish a relationship between widgets or groups and text that described them.
27-
* This is very similar to aria-labelledby: a label describes the essence of an object, while a description provides more information that the user might need. _Tested with snapshot testing._
27+
* This is very similar to aria-labelledby?: a label describes the essence of an object, while a description provides more information that the user might need. _Tested with snapshot testing._
2828
*/
29-
'aria-describedby': string;
29+
'aria-describedby'?: string;
3030
/**
3131
* CSS classes to be added to tag with `.slds-combobox`. Uses `classNames` [API](https://github.com/JedWatson/classnames). _Tested with snapshot testing._
3232
*/

components/input/private/inner-input.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
declare module '@salesforce/design-system-react/components/input/private/inner-input' {
22
import React from 'react';
33
type Props = {
4-
'aria-activedescendant': string;
5-
'aria-autocomplete': string;
4+
'aria-activedescendant'?: string;
5+
'aria-autocomplete'?: string;
66
/**
77
* An HTML ID that is shared with ARIA-supported devices with the
88
* `aria-controls` attribute in order to relate the input with
99
* another region of the page. An example would be a select box
1010
* that shows or hides a panel.
1111
*/
12-
'aria-controls': string;
13-
'aria-describedby': string;
14-
'aria-expanded': boolean;
15-
'aria-haspopup': boolean | string;
16-
'aria-labelledby': string;
12+
'aria-controls'?: string;
13+
'aria-describedby'?: string;
14+
'aria-expanded'?: boolean;
15+
'aria-haspopup'?: boolean | string;
16+
'aria-labelledby'?: string;
1717
/**
1818
* An HTML ID that is shared with ARIA-supported devices with the
1919
* `aria-controls` attribute in order to relate the input with
2020
* another region of the page. An example would be a search field
2121
* that shows search results.
2222
*/
23-
'aria-owns': string;
24-
'aria-required': boolean;
23+
'aria-owns'?: string;
24+
'aria-required'?: boolean;
2525
/**
2626
* **Assistive text for accessibility.**
2727
* This object is merged with the default props object on every render.

components/radio.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ declare module "@salesforce/design-system-react/components/radio" {
1212
/**
1313
* The ID of an element that describes this radio input. Often used for error messages.
1414
*/
15-
"aria-describedby": string;
15+
"aria-describedby"?: string;
1616
/**
1717
* The aria-labelledby attribute establishes relationships between objects and their label(s), and its value should be one or more element IDs, which refer to elements that have the text needed for labeling. List multiple element IDs in a space delimited fashion.
1818
*/
19-
"aria-labelledby": string;
19+
"aria-labelledby"?: string;
2020
/**
2121
* This is a controlled component. This radio is checked according to this value.
2222
*/

components/textarea.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,45 @@ declare module '@salesforce/design-system-react/components/textarea' {
1111
/**
1212
* The aria-activedescendant attribute contains the ID of the currently active child object that is part of a composite widget within the Document Object Model. It makes do with the overhead of having all or more than one child focusable. As the name specifies, it helps in managing the current active child of the composite widget.
1313
*/
14-
'aria-activedescendant': string;
14+
'aria-activedescendant'?: string;
1515
/**
1616
* Indicates if the suggestions in a composite widget are values that complete the current textbox input.
1717
*/
18-
'aria-autocomplete': string;
18+
'aria-autocomplete'?: string;
1919
/**
2020
* An HTML ID that is shared with ARIA-supported devices with the
2121
* `aria-controls` attribute in order to relate the input with
2222
* another region of the page. An example would be a select box
2323
* that shows or hides a panel.
2424
*/
25-
'aria-controls': string;
25+
'aria-controls'?: string;
2626
/**
2727
* The `aria-describedby` attribute is used to indicate the IDs of the elements that describe the object. It is used to establish a relationship between widgets or groups and text that described them. This is very similar to aria-labelledby: a label describes the essence of an object, while a description provides more information that the user might need.
2828
*/
29-
'aria-describedby': string;
29+
'aria-describedby'?: string;
3030
/**
3131
* Use the `aria-expanded` state to indicate whether regions of the content are collapsible, and to expose whether a region is currently expanded or collapsed.
3232
*/
33-
'aria-expanded': boolean;
33+
'aria-expanded'?: boolean;
3434
/**
3535
* Indicates that the element has a popup context menu or sub-level menu.
3636
*/
37-
'aria-haspopup': boolean;
37+
'aria-haspopup'?: boolean;
3838
/**
3939
* The aria-labelledby attribute contains the element IDs of labels in objects such as input elements, widgets, and groups. The attribute establishes relationships between objects and their labels. Assistive technology, such as screen readers, use this attribute to catalog the objects in a document so that users can navigate between them. Without an element ID, the assistive technology cannot catalog the object.
4040
*/
41-
'aria-labelledby': string;
41+
'aria-labelledby'?: string;
4242
/**
4343
* An HTML ID that is shared with ARIA-supported devices with the
4444
* `aria-controls` attribute in order to relate the input with
4545
* another region of the page. An example would be a search field
4646
* that shows search results.
4747
*/
48-
'aria-owns': string;
48+
'aria-owns'?: string;
4949
/**
5050
* The `aria-required` attribute is used to indicate that user input is required on an element before a form can be submitted.
5151
*/
52-
'aria-required': boolean;
52+
'aria-required'?: boolean;
5353
/**
5454
* Specifies is the textarea should automatically get focus when the page loads. This is typically a poor user experience.
5555
*/

components/utilities/menu-list/item.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declare module '@salesforce/design-system-react/components/utilities/menu-list/item' {
22
import React from 'react';
33
type Props = {
4-
'aria-disabled': boolean;
4+
'aria-disabled'?: boolean;
55
className?: any[] | Record<string, any> | string;
66
checkmark?: boolean;
77
data?: Record<string, any>;

0 commit comments

Comments
 (0)