Skip to content

Commit 1213b82

Browse files
authored
fix: react aria upgrade (#537)
* fix: try react aria upgrade * fix: type casting
1 parent 95e5e0d commit 1213b82

File tree

5 files changed

+128
-133
lines changed

5 files changed

+128
-133
lines changed

package-lock.json

Lines changed: 108 additions & 123 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@
166166
"@types/react-select": "^4.0.18",
167167
"@types/styled-system": "^5.1.9",
168168
"date-fns": "^2.11.1",
169-
"react-aria": "3.38.1",
170-
"react-aria-components": "1.7.1",
169+
"react-aria": "3.39.0",
170+
"react-aria-components": "1.8.0",
171171
"react-popper": "^2.3.0",
172172
"react-transition-group": "^4.3.0",
173173
"styled-system": "^5.1.5",

src/components/experimental/ListBox/ListBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { get } from '../../../utils/experimental/themeGet';
55
import { Text, TextProps } from '../Text/Text';
66
import { getSemanticValue } from '../../../essentials/experimental';
77

8-
const StyledListBoxItem = styled(BaseListBoxItem)`
8+
const StyledListBoxItem = styled(BaseListBoxItem as React.ComponentType<ListBoxItemProps>)`
99
position: relative;
1010
display: block;
1111
padding: ${get('space.3')} ${get('space.4')};

src/components/experimental/Table/Table.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ import {
55
Column as BaseColumn,
66
Row as BaseRow,
77
TableBody,
8-
TableHeader
8+
TableHeader,
9+
CellProps,
10+
ColumnProps,
11+
RowProps
912
} from 'react-aria-components';
1013
import styled from 'styled-components';
1114
import { get } from '../../../utils/experimental/themeGet';
1215
import { textStyles } from '../Text/Text';
1316
import { getSemanticValue } from '../../../essentials/experimental';
1417

15-
const Table = styled(BaseTable)`
18+
const Table = styled(BaseTable as React.ComponentType<TableProps>)`
1619
border-collapse: collapse;
1720
border-spacing: 0;
1821
position: relative;
@@ -22,7 +25,7 @@ const Table = styled(BaseTable)`
2225
color: ${getSemanticValue('on-surface')};
2326
` as typeof BaseTable;
2427

25-
const Cell = styled(BaseCell)`
28+
const Cell = styled(BaseCell as React.ComponentType<CellProps>)`
2629
box-sizing: border-box;
2730
padding: 0 ${get('space.3')};
2831
position: relative;
@@ -57,7 +60,7 @@ const Cell = styled(BaseCell)`
5760
` as typeof BaseCell;
5861

5962
/* Z-Index is needed for sticky header cells to be on top of other cells */
60-
const Column = styled(BaseColumn)`
63+
const Column = styled(BaseColumn as React.ComponentType<ColumnProps>)`
6164
position: sticky;
6265
top: 0;
6366
z-index: 1;
@@ -72,7 +75,7 @@ const Column = styled(BaseColumn)`
7275
${textStyles.variants.title2}
7376
` as typeof BaseColumn;
7477

75-
const Row = styled(BaseRow)`
78+
const Row = styled(BaseRow as React.ComponentType<RowProps<Record<string, unknown>>>)`
7679
height: 3rem;
7780
border-bottom: 1px solid ${getSemanticValue('divider')};
7881
border-radius: ${get('radii.4')};

src/components/experimental/Tooltip/Tooltip.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import React from 'react';
22
import { createGlobalStyle } from 'styled-components';
33

4-
import { OverlayArrow, Tooltip as AriaTooltip, TooltipTrigger, Focusable } from 'react-aria-components';
4+
import {
5+
OverlayArrow,
6+
Tooltip as AriaTooltip,
7+
TooltipTrigger as BaseTooltipTrigger,
8+
Focusable
9+
} from 'react-aria-components';
510

611
import type { TooltipProps as AriaTooltipProps, TooltipTriggerComponentProps } from 'react-aria-components';
712

13+
const TooltipTrigger = BaseTooltipTrigger as React.ComponentType<TooltipTriggerComponentProps>;
14+
815
interface TooltipProps {
916
children: any;
1017
content: string;
@@ -83,7 +90,7 @@ const Tooltip = ({
8390
tooltipProps,
8491
hideArrow = false,
8592
customTrigger = false
86-
}: TooltipProps) => (
93+
}: TooltipProps): JSX.Element => (
8794
<>
8895
<TooltipStyles />
8996
<TooltipTrigger {...triggerProps}>

0 commit comments

Comments
 (0)