Skip to content

Commit 4ef11a8

Browse files
committed
update S2 popover example
1 parent f1ee9ed commit 4ef11a8

File tree

1 file changed

+14
-21
lines changed

1 file changed

+14
-21
lines changed

packages/dev/s2-docs/pages/s2/Popover.mdx

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const tags = ['popup', 'overlay'];
1111

1212
```tsx render docs={docs.exports.Popover} links={docs.links} props={['placement', 'size', 'offset', 'crossOffset', 'shouldFlip', 'hideArrow']} type="s2" initialProps={{size: 'S'}}
1313
"use client";
14-
import {Popover, DialogTrigger, ActionButton, CheckboxGroup, Checkbox, Form} from '@react-spectrum/s2';
14+
import {Popover, DialogTrigger, ActionButton, Form, TextField, Switch, Button} from '@react-spectrum/s2';
1515
import Filter from '@react-spectrum/s2/icons/Filter';
1616
import {style} from '@react-spectrum/s2/style' with {type: 'macro'};
1717

@@ -23,22 +23,15 @@ function Example(props) {
2323
</ActionButton>
2424
{/*- begin focus -*/}
2525
<Popover {...props}/* PROPS */>
26-
<Form>
27-
<CheckboxGroup label="Stops">
28-
<Checkbox value={0}>Non-stop</Checkbox>
29-
<Checkbox value={1}>1 stop</Checkbox>
30-
<Checkbox value={2}>2+ stops</Checkbox>
31-
</CheckboxGroup>
32-
<CheckboxGroup label="Bags">
33-
<Checkbox value={0}>Carry on</Checkbox>
34-
<Checkbox value={1}>Checked bag</Checkbox>
35-
</CheckboxGroup>
36-
<CheckboxGroup label="Times">
37-
<Checkbox value={0}>Morning</Checkbox>
38-
<Checkbox value={1}>Afternoon</Checkbox>
39-
<Checkbox value={2}>Evening</Checkbox>
40-
</CheckboxGroup>
41-
</Form>
26+
<div className={style({padding: 12})}>
27+
<p className={style({font: 'body', marginTop: 0})}>How are we doing? Share your feedback here.</p>
28+
<Form>
29+
<TextField label="Subject" placeholder="Enter a summary" />
30+
<TextField label="Description" isRequired placeholder="Enter your feedback" />
31+
<Switch>Adobe can contact me for further questions concerning this feedback</Switch>
32+
<Button styles={style({marginStart: 'auto'})}>Submit</Button>
33+
</Form>
34+
</div>
4235
</Popover>
4336
{/*- end focus -*/}
4437
</DialogTrigger>
@@ -65,17 +58,17 @@ function Example() {
6558
<Button onPress={() => setOpen(!isOpen)}>
6659
Open popover
6760
</Button>
68-
<div
61+
<div
6962
ref={triggerRef}
7063
className={style({
71-
padding: 8,
72-
backgroundColor: 'gray-100',
64+
padding: 8,
65+
backgroundColor: 'gray-100',
7366
borderRadius: 'default',
7467
font: 'ui'
7568
})}>
7669
Popover appears here
7770
</div>
78-
<Popover
71+
<Popover
7972
/*- begin highlight -*/
8073
triggerRef={triggerRef}
8174
isOpen={isOpen}

0 commit comments

Comments
 (0)