Skip to content

Commit b294de8

Browse files
sookmaxyihuiliao
andauthored
move deprecated argTypes.defaultValue to args (Tooltip & Popover) (#6387)
Co-authored-by: Yihui Liao <[email protected]>
1 parent d7f78e8 commit b294de8

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed

packages/react-aria-components/stories/Popover.stories.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,80 +43,82 @@ export const PopoverExample = () => (
4343
Submit
4444
</Button>
4545
</form>
46-
)}
46+
)}
4747
</Dialog>
4848
</Popover>
4949
</DialogTrigger>
50-
);
50+
);
5151

5252
export const PopoverArrowBoundaryOffsetExample = {
53+
args: {
54+
topLeft: 25,
55+
topRight: 25,
56+
leftTop: 15,
57+
leftBottom: 15,
58+
rightTop: 15,
59+
rightBottom: 15,
60+
bottomLeft: 25,
61+
bottomRight: 25
62+
},
5363
argTypes: {
5464
topLeft: {
55-
defaultValue: 25,
5665
control: {
5766
type: 'range',
5867
min: -100,
5968
max: 100
6069
}
6170
},
6271
topRight: {
63-
defaultValue: 25,
6472
control: {
6573
type: 'range',
6674
min: -100,
6775
max: 100
6876
}
6977
},
7078
leftTop: {
71-
defaultValue: 15,
7279
control: {
7380
type: 'range',
7481
min: -100,
7582
max: 100
7683
}
7784
},
78-
leftBotton: {
79-
defaultValue: 15,
85+
leftBottom: {
8086
control: {
8187
type: 'range',
8288
min: -100,
8389
max: 100
8490
}
8591
},
8692
rightTop: {
87-
defaultValue: 15,
8893
control: {
8994
type: 'range',
9095
min: -100,
9196
max: 100
9297
}
9398
},
9499
rightBottom: {
95-
defaultValue: 15,
96100
control: {
97101
type: 'range',
98102
min: -100,
99103
max: 100
100104
}
101105
},
102106
bottomLeft: {
103-
defaultValue: 25,
104107
control: {
105108
type: 'range',
106109
min: -100,
107110
max: 100
108111
}
109112
},
110113
bottomRight: {
111-
defaultValue: 25,
112114
control: {
113115
type: 'range',
114116
min: -100,
115117
max: 100
116118
}
117119
}
118120
},
119-
render: ({topLeft, topRight, leftTop, leftBotton, rightTop, rightBottom, bottomLeft, bottomRight}: any) => {
121+
render: ({topLeft, topRight, leftTop, leftBottom, rightTop, rightBottom, bottomLeft, bottomRight}: any) => {
120122
return (
121123
<div style={{display: 'flex', flexDirection: 'column'}}>
122124
<div style={{display: 'flex'}}>
@@ -206,7 +208,7 @@ export const PopoverArrowBoundaryOffsetExample = {
206208
<Popover
207209
placement="left bottom"
208210
shouldFlip={false}
209-
arrowBoundaryOffset={leftBotton}
211+
arrowBoundaryOffset={leftBottom}
210212
style={{
211213
background: 'Canvas',
212214
color: 'CanvasText',

packages/react-aria-components/stories/Tooltip.stories.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,73 +40,75 @@ export const TooltipExample = () => (
4040
);
4141

4242
export const TooltipArrowBoundaryOffsetExample = {
43+
args: {
44+
topLeft: 25,
45+
topRight: 25,
46+
leftTop: 15,
47+
leftBottom: 15,
48+
rightTop: 15,
49+
rightBottom: 15,
50+
bottomLeft: 25,
51+
bottomRight: 25
52+
},
4353
argTypes: {
4454
topLeft: {
45-
defaultValue: 25,
4655
control: {
4756
type: 'range',
4857
min: -100,
4958
max: 100
5059
}
5160
},
5261
topRight: {
53-
defaultValue: 25,
5462
control: {
5563
type: 'range',
5664
min: -100,
5765
max: 100
5866
}
5967
},
6068
leftTop: {
61-
defaultValue: 15,
6269
control: {
6370
type: 'range',
6471
min: -100,
6572
max: 100
6673
}
6774
},
6875
leftBotton: {
69-
defaultValue: 15,
7076
control: {
7177
type: 'range',
7278
min: -100,
7379
max: 100
7480
}
7581
},
7682
rightTop: {
77-
defaultValue: 15,
7883
control: {
7984
type: 'range',
8085
min: -100,
8186
max: 100
8287
}
8388
},
8489
rightBottom: {
85-
defaultValue: 15,
8690
control: {
8791
type: 'range',
8892
min: -100,
8993
max: 100
9094
}
9195
},
9296
bottomLeft: {
93-
defaultValue: 25,
9497
control: {
9598
type: 'range',
9699
min: -100,
97100
max: 100
98101
}
99102
},
100103
bottomRight: {
101-
defaultValue: 25,
102104
control: {
103105
type: 'range',
104106
min: -100,
105107
max: 100
106108
}
107109
}
108110
},
109-
render: ({topLeft, topRight, leftTop, leftBotton, rightTop, rightBottom, bottomLeft, bottomRight}: any) => {
111+
render: ({topLeft, topRight, leftTop, leftBottom, rightTop, rightBottom, bottomLeft, bottomRight}: any) => {
110112
return (
111113
<div style={{display: 'flex', flexDirection: 'column'}}>
112114
<div style={{display: 'flex'}}>
@@ -191,7 +193,7 @@ export const TooltipArrowBoundaryOffsetExample = {
191193
placement="left bottom"
192194
shouldFlip={false}
193195
offset={7}
194-
arrowBoundaryOffset={leftBotton}
196+
arrowBoundaryOffset={leftBottom}
195197
style={{
196198
background: 'Canvas',
197199
color: 'CanvasText',

0 commit comments

Comments
 (0)