Skip to content

Commit 813845c

Browse files
committed
chore: add support for sx to components
1 parent 9e6ad57 commit 813845c

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

packages/react/src/live-region/AriaAlert.tsx

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
import React, {type ElementType} from 'react'
22
import {Announce} from './Announce'
3+
import type {SxProp} from '../sx'
34

4-
export type AriaAlertProps<As extends ElementType> = React.PropsWithChildren<{
5-
/**
6-
* Customize the element type of the rendered container
7-
*/
8-
as?: As
5+
export type AriaAlertProps<As extends ElementType> = React.PropsWithChildren<
6+
{
7+
/**
8+
* Customize the element type of the rendered container
9+
*/
10+
as?: As
911

10-
/**
11-
* Specify if the content of the element should be announced when this
12-
* component is rendered and is not hidden
13-
* @default true
14-
*/
15-
announceOnShow?: boolean
12+
/**
13+
* Specify if the content of the element should be announced when this
14+
* component is rendered and is not hidden
15+
* @default true
16+
*/
17+
announceOnShow?: boolean
1618

17-
/**
18-
* Specify if the element is hidden
19-
* @default false
20-
*/
21-
hidden?: boolean
22-
}>
19+
/**
20+
* Specify if the element is hidden
21+
* @default false
22+
*/
23+
hidden?: boolean
24+
} & SxProp
25+
>
2326

2427
export function AriaAlert<As extends ElementType>({
2528
announceOnShow = true,

packages/react/src/live-region/AriaStatus.tsx

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
import React, {type ElementType} from 'react'
22
import {Announce} from './Announce'
3+
import type {SxProp} from '../sx'
34

4-
export type AriaStatusProps<As extends ElementType> = React.PropsWithChildren<{
5-
/**
6-
* Customize the element type of the rendered container
7-
*/
8-
as?: As
5+
export type AriaStatusProps<As extends ElementType> = React.PropsWithChildren<
6+
{
7+
/**
8+
* Customize the element type of the rendered container
9+
*/
10+
as?: As
911

10-
/**
11-
* Specify if the content of the element should be announced when this
12-
* component is rendered and is not hidden
13-
* @default false
14-
*/
15-
announceOnShow?: boolean
12+
/**
13+
* Specify if the content of the element should be announced when this
14+
* component is rendered and is not hidden
15+
* @default false
16+
*/
17+
announceOnShow?: boolean
1618

17-
/**
18-
* Specify if the element is hidden
19-
* @default false
20-
*/
21-
hidden?: boolean
19+
/**
20+
* Specify if the element is hidden
21+
* @default false
22+
*/
23+
hidden?: boolean
2224

23-
/**
24-
* Provide a delay in milliseconds before the announcement is made
25-
*/
26-
delayMs?: number
27-
}>
25+
/**
26+
* Provide a delay in milliseconds before the announcement is made
27+
*/
28+
delayMs?: number
29+
} & SxProp
30+
>
2831

2932
export function AriaStatus<As extends ElementType>({
3033
announceOnShow = false,

0 commit comments

Comments
 (0)