Skip to content

Commit 7dff26b

Browse files
authored
Merge pull request #279 from gluestack/release/@gluestack-ui/[email protected]
release: @gluestack-ui/popover version 0.1.6
2 parents b0a9f00 + 53a0e2e commit 7dff26b

File tree

18 files changed

+327
-281
lines changed

18 files changed

+327
-281
lines changed

example/storybook/src/components/DataDisplay/Divider/index.stories.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,11 @@ Divider allows to divide the layout in horizontal and vertical form.
110110
>
111111
<Text>Simple</Text>
112112
<Divider
113-
variant="vertical"
114-
// orientation="vertical"
113+
orientation="vertical"
115114
sx={{
116115
mx: 10,
117116
bg: '$emerald500',
118117
h: 30,
119-
w: 1,
120118
_dark: {
121119
bg: '$emerald400',
122120
},
@@ -128,12 +126,11 @@ Divider allows to divide the layout in horizontal and vertical form.
128126
mx: 10,
129127
bg: '$indigo500',
130128
h: 30,
131-
w: 1,
132129
_dark: {
133130
bg: '$indigo400',
134131
},
135132
}}
136-
variant="vertical"
133+
orientation="vertical"
137134
/>
138135
<Text>Beautiful</Text>
139136
</HStack>
@@ -149,7 +146,6 @@ Divider allows to divide the layout in horizontal and vertical form.
149146
variant="horizontal"
150147
sx={{
151148
bg: '$red500',
152-
h: 1,
153149
_dark: {
154150
bg: '$red400',
155151
},

example/storybook/src/components/Overlay/Popover/Popover.stories.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ const PopoverMeta: ComponentMeta<typeof Popover> = {
1818
control: 'select',
1919
options: [
2020
'bottom',
21-
'bottom-end',
22-
'bottom-start',
21+
'bottom left',
22+
'bottom right',
2323
'top',
24-
'top-end',
25-
'top-start',
24+
'top left',
25+
'top right',
2626
'left',
27-
'left-end',
28-
'left-start',
27+
'left bottom',
28+
'left right',
2929
'right',
30-
'right-end',
31-
'right-start',
30+
'right bottom',
31+
'right top',
3232
],
3333
},
3434
},
Lines changed: 58 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,76 @@
11
import React from 'react';
22
import {
33
Text,
4-
Pressable,
5-
Popover,
64
Button,
5+
Popover,
76
CloseIcon,
87
Icon,
98
Box,
9+
Center,
1010
} from '../../../ui-components';
1111

1212
import Wrapper from '../../Wrapper';
1313

14-
export const PopoverStory = () => {
14+
export const PopoverStory = ({ placement }: any) => {
15+
const [isOpen, setIsOpen] = React.useState(false);
16+
17+
const handleOpen = () => {
18+
setIsOpen(true);
19+
};
20+
21+
const handleClose = () => {
22+
setIsOpen(false);
23+
};
24+
1525
return (
1626
<Wrapper>
17-
<Popover
18-
placement={'bottom'}
19-
trigger={(triggerProps: any) => {
20-
return (
21-
<Pressable
22-
bgColor={'$red500'}
23-
borderRadius={'$md'}
24-
{...triggerProps}
25-
>
26-
<Text color={'white'} padding="$3">
27-
Popover
27+
<Center w={1200} h={800}>
28+
<Popover
29+
isOpen={isOpen}
30+
onClose={handleClose}
31+
onOpen={handleOpen}
32+
offset={30}
33+
placement={placement}
34+
trigger={(triggerProps: any) => {
35+
return (
36+
<Button {...triggerProps}>
37+
<Button.Text>Popover</Button.Text>
38+
</Button>
39+
);
40+
}}
41+
>
42+
<Popover.Backdrop />
43+
<Popover.Content>
44+
<Popover.Header>
45+
<Text>Delete Customer</Text>
46+
<Popover.CloseButton>
47+
<Icon as={CloseIcon} sx={{ w: 16, h: 16 }} />
48+
</Popover.CloseButton>
49+
</Popover.Header>
50+
51+
<Popover.Body>
52+
<Text>
53+
This will remove all data relating to Alex. This action cannot
54+
be reversed. Deleted data can not be recovered.
2855
</Text>
29-
</Pressable>
30-
);
31-
}}
32-
>
33-
<Popover.Content>
34-
<Popover.Header>
35-
<Text>Delete Customer</Text>
36-
<Popover.CloseButton>
37-
<Icon as={CloseIcon} sx={{ w: 16, h: 16 }} />
38-
</Popover.CloseButton>
39-
</Popover.Header>
40-
<Popover.Body>
41-
<Text>
42-
This will remove all data relating to Alex. This action cannot be
43-
reversed. Deleted data can not be recovered.
44-
</Text>
45-
</Popover.Body>
46-
<Popover.Footer>
47-
{/* @ts-ignore */}
48-
<Button variant="outline" mr={'$2'}>
49-
<Button.Text>Cancel</Button.Text>
50-
</Button>
51-
<Button>
52-
<Button.Text color={'white'}>Delete</Button.Text>
53-
</Button>
54-
</Popover.Footer>
55-
</Popover.Content>
56-
</Popover>
56+
</Popover.Body>
57+
58+
<Popover.Footer>
59+
{/* @ts-ignore */}
60+
<Button variant="outline" mr={'$2'} onPress={handleClose}>
61+
<Button.Text>Cancel</Button.Text>
62+
</Button>
63+
<Button>
64+
<Button.Text color={'white'} onPress={handleClose}>
65+
Delete
66+
</Button.Text>
67+
</Button>
68+
</Popover.Footer>
69+
</Popover.Content>
70+
</Popover>
71+
</Center>
5772
</Wrapper>
5873
);
5974
};
6075

61-
export { Text, Pressable, Popover, Button, CloseIcon, Box };
76+
export { Text, Popover, Button, CloseIcon, Box };

0 commit comments

Comments
 (0)