@bitrise/bitkit 9.37.1-alpha-react18.1 → 9.38.2-alpha-chakra.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "9.37.1-alpha-react18.1",
4
+ "version": "9.38.2-alpha-chakra.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -33,28 +33,30 @@
33
33
  "framer-motion": "./node_modules/framer-motion/dist/cjs"
34
34
  },
35
35
  "dependencies": {
36
- "@chakra-ui/react": "^2.2.1",
37
- "@emotion/react": "^11.9.3",
38
- "@emotion/styled": "^11.9.3",
36
+ "@chakra-ui/react": "^1.8.8",
37
+ "@emotion/react": "^11.9.0",
38
+ "@emotion/styled": "^11.8.1",
39
39
  "@juggle/resize-observer": "^3.3.1",
40
40
  "@popperjs/core": "^2.11.5",
41
+ "@types/react-transition-group": "^4.4.4",
41
42
  "classnames": "^2.3.1",
42
43
  "clipboard": "^2.0.11",
43
- "framer-motion": "^6.3.15",
44
+ "framer-motion": "^6.3.4",
44
45
  "luxon": "^2.4.0",
45
- "react": "^18.2.0",
46
- "react-dom": "^18.2.0",
47
- "react-popper": "^2.3.0"
46
+ "react": "^17.0.2",
47
+ "react-dom": "^17.0.2",
48
+ "react-popper": "^2.3.0",
49
+ "react-transition-group": "^4.4.2"
48
50
  },
49
51
  "peerDependencies": {
50
- "react": "^18.2.0",
51
- "react-dom": "^18.2.0"
52
+ "react": "^17.0.2",
53
+ "react-dom": "^17.0.2"
52
54
  },
53
55
  "devDependencies": {
54
- "@babel/core": "^7.18.5",
55
- "@babel/parser": "^7.18.5",
56
- "@bitrise/eslint-plugin": "^2.2.0",
57
- "@chakra-ui/cli": "^2.1.0",
56
+ "@babel/core": "^7.18.2",
57
+ "@babel/parser": "^7.18.2",
58
+ "@bitrise/eslint-plugin": "2.2.0",
59
+ "@chakra-ui/cli": "^1.9.0",
58
60
  "@commitlint/cli": "^16.3.0",
59
61
  "@commitlint/config-conventional": "^16.2.4",
60
62
  "@google-cloud/storage": "^5.19.4",
@@ -82,30 +84,31 @@
82
84
  "@types/lodash.shuffle": "^4.2.7",
83
85
  "@types/luxon": "^2.3.2",
84
86
  "@types/prismjs": "^1.26.0",
85
- "@types/react": "18.0.14",
86
- "@types/react-dom": "^18.0.5",
87
+ "@types/react": "17.0.44",
88
+ "@types/react-dom": "^17.0.16",
87
89
  "@types/react-router": "^5.1.18",
88
90
  "@types/react-router-dom": "^5.3.3",
91
+ "@types/react-transition-group": "^4.4.4",
89
92
  "@types/vfile-message": "^2.0.0",
90
- "@typescript-eslint/eslint-plugin": "^5.29.0",
91
- "@typescript-eslint/parser": "^5.29.0",
93
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
94
+ "@typescript-eslint/parser": "^5.26.0",
92
95
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
93
96
  "axios": "^0.27.2",
94
97
  "babel-eslint": "^10.0.1",
95
98
  "babel-loader": "^8.2.5",
96
99
  "babel-plugin-polyfill-corejs2": "^0.3.1",
97
- "concurrently": "^7.2.2",
100
+ "concurrently": "^7.2.1",
98
101
  "enzyme": "^3.11.0",
99
102
  "enzyme-to-json": "^3.6.2",
100
- "esbuild": "^0.14.47",
101
- "eslint": "^8.18.0",
103
+ "esbuild": "^0.14.43",
104
+ "eslint": "^8.16.0",
102
105
  "eslint-plugin-import": "^2.26.0",
103
- "eslint-plugin-jest": "^26.5.3",
104
- "eslint-plugin-jsx-a11y": "^6.6.0",
105
- "eslint-plugin-prettier": "^4.1.0",
106
- "eslint-plugin-react": "^7.30.1",
107
- "eslint-plugin-react-hooks": "^4.6.0",
108
- "eslint-plugin-storybook": "^0.5.13",
106
+ "eslint-plugin-jest": "^26.4.5",
107
+ "eslint-plugin-jsx-a11y": "^6.5.1",
108
+ "eslint-plugin-prettier": "^4.0.0",
109
+ "eslint-plugin-react": "^7.30.0",
110
+ "eslint-plugin-react-hooks": "^4.5.0",
111
+ "eslint-plugin-storybook": "^0.5.12",
109
112
  "eslint-plugin-testing-library": "^5.5.1",
110
113
  "fscreen": "^1.2.0",
111
114
  "glob": "^8.0.3",
@@ -116,21 +119,21 @@
116
119
  "lodash.sample": "^4.2.1",
117
120
  "lodash.shuffle": "^4.2.0",
118
121
  "node-watch": "^0.7.3",
119
- "prettier": "^2.7.1",
122
+ "prettier": "^2.6.2",
120
123
  "prismjs": "^1.28.0",
121
- "react": "^18.2.0",
122
- "react-docgen": "5.4.2",
123
- "react-dom": "^18.2.0",
124
+ "react": "^17.0.2",
125
+ "react-docgen": "5.4.0",
126
+ "react-dom": "^17.0.2",
124
127
  "react-router": "^5.3.1",
125
128
  "react-router-dom": "^5.3.1",
126
129
  "recast": "^0.21.1",
127
- "semantic-release": "^19.0.3",
130
+ "semantic-release": "^19.0.2",
128
131
  "superstatic": "^8.0.0",
129
132
  "ts-jest": "^27.1.5",
130
- "ts-node": "^10.8.1",
133
+ "ts-node": "^10.8.0",
131
134
  "tsconfig-paths-webpack-plugin": "^3.5.2",
132
- "typescript": "^4.7.4",
133
- "webpack": "^5.73.0"
135
+ "typescript": "^4.6.4",
136
+ "webpack": "^5.72.1"
134
137
  },
135
138
  "files": [
136
139
  "src",
@@ -153,7 +156,7 @@
153
156
  },
154
157
  "resolutions": {
155
158
  "**/ast-types": "npm:@gkz/ast-types",
156
- "ts-node": "^10.8.1",
159
+ "ts-node": "^10.8.0",
157
160
  "@types/react": "17.0.40"
158
161
  }
159
162
  }
@@ -7,7 +7,7 @@ export default {
7
7
  } as ComponentMeta<typeof ButtonGroup>;
8
8
 
9
9
  const Template: ComponentStory<typeof ButtonGroup> = (props) => (
10
- <ButtonGroup {...props} width="900px" flexDirection="row">
10
+ <ButtonGroup {...props} width="900px" flexDirection="column">
11
11
  <Button>Button 1</Button>
12
12
  <Button>Button 2</Button>
13
13
  <Button>Button 3</Button>
@@ -1,6 +1,7 @@
1
1
  import { Story, ComponentMeta } from '@storybook/react';
2
+ import { useDisclosure } from '@chakra-ui/react';
2
3
  import Button from '../Button/Button';
3
- import Dialog, { DialogProps, useDialog } from './Dialog';
4
+ import Dialog, { DialogProps } from './Dialog';
4
5
  import DialogBody from './DialogBody';
5
6
  import DialogFooter from './DialogFooter';
6
7
 
@@ -24,13 +25,13 @@ interface StoryType extends DialogProps {
24
25
  }
25
26
 
26
27
  export const WithProps: Story<StoryType> = ({ lotsOfContent, ...props }: StoryType) => {
27
- const state = useDialog();
28
+ const { isOpen, onClose, onOpen } = useDisclosure();
28
29
 
29
30
  return (
30
31
  <>
31
- <Button onClick={state.onOpen}>Open Dialog</Button>
32
+ <Button onClick={onOpen}>Open Dialog</Button>
32
33
 
33
- <Dialog {...props} state={state}>
34
+ <Dialog {...props} isOpen={isOpen} onClose={onClose}>
34
35
  <DialogBody>
35
36
  {[...Array(lotsOfContent ? 10 : 1)].map((_key, index) => (
36
37
  // eslint-disable-next-line react/no-array-index-key
@@ -5,42 +5,38 @@ import {
5
5
  ModalCloseButton,
6
6
  ModalHeader,
7
7
  useBreakpointValue,
8
- useDisclosure,
9
8
  HTMLChakraProps,
10
9
  } from '@chakra-ui/react';
11
10
  import Icon from '../Icon/Icon';
12
11
  import Text from '../Text/Text';
13
12
 
14
- type DialogState = {
15
- isOpen: boolean;
16
- onClose(): void;
17
- onOpen?(): void;
18
- };
19
-
20
- export const useDialog = (): DialogState => {
21
- const { isOpen, onOpen, onClose } = useDisclosure();
22
- return {
23
- isOpen,
24
- onClose,
25
- onOpen,
26
- };
27
- };
28
13
  export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'> {
29
14
  dataTestid?: string;
15
+ isOpen: boolean;
16
+ onClose(): void;
30
17
  size?: 'small' | 'medium' | 'large' | 'full';
31
18
  scrollBehavior?: 'inside' | 'outside';
32
- state: DialogState;
33
19
  title: string;
34
20
  trapFocus?: boolean;
35
21
  }
36
22
 
37
- const Dialog = ({ children, dataTestid, scrollBehavior, state, size, title, trapFocus, ...rest }: DialogProps) => {
23
+ const Dialog = ({
24
+ children,
25
+ dataTestid,
26
+ isOpen,
27
+ onClose,
28
+ scrollBehavior,
29
+ size,
30
+ title,
31
+ trapFocus,
32
+ ...rest
33
+ }: DialogProps) => {
38
34
  const dialogSize = useBreakpointValue({ mobile: 'mobile', desktop: size });
39
35
  return (
40
36
  <Modal
41
37
  closeOnOverlayClick={false}
42
- isOpen={state.isOpen}
43
- onClose={state.onClose}
38
+ isOpen={isOpen}
39
+ onClose={onClose}
44
40
  scrollBehavior={scrollBehavior}
45
41
  size={dialogSize}
46
42
  trapFocus={trapFocus}
@@ -10,7 +10,7 @@ const EmptyStateTheme: ComponentStyleConfig = {
10
10
  justifyContent: 'center',
11
11
  paddingX: '16',
12
12
  paddingY: {
13
- base: '32',
13
+ mobile: '32',
14
14
  desktop: '48',
15
15
  },
16
16
  backgroundColor: 'neutral.95',
@@ -0,0 +1,24 @@
1
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
2
+ import List from './List';
3
+ import ListItem from './ListItem';
4
+
5
+ export default {
6
+ title: 'Components/List',
7
+ component: List,
8
+ } as ComponentMeta<typeof List>;
9
+
10
+ export const WithProps: ComponentStory<typeof List> = (props) => (
11
+ <List {...props}>
12
+ <ListItem>Lorem ipsum dolor sit amet</ListItem>
13
+ <ListItem>Consectetur adipiscing elit</ListItem>
14
+ <ListItem>
15
+ Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo.
16
+ </ListItem>
17
+ <ListItem>Facilisis in pretium nisl aliquet</ListItem>
18
+ </List>
19
+ );
20
+
21
+ WithProps.args = {
22
+ ...List.defaultProps,
23
+ isOrdered: false,
24
+ };
@@ -0,0 +1,20 @@
1
+ import type { ComponentStyleConfig } from '@chakra-ui/theme';
2
+
3
+ const ListTheme: ComponentStyleConfig = {
4
+ parts: ['container', 'item'],
5
+ baseStyle: ({ as }) => {
6
+ if (as === 'ul') {
7
+ return {
8
+ item: {
9
+ '::marker': {
10
+ fontSize: '12px',
11
+ },
12
+ },
13
+ };
14
+ }
15
+
16
+ return {};
17
+ },
18
+ };
19
+
20
+ export default ListTheme;
@@ -0,0 +1,20 @@
1
+ import { ListProps as ChakraListProps, forwardRef, OrderedList, UnorderedList } from '@chakra-ui/react';
2
+
3
+ export interface ListProps extends ChakraListProps {
4
+ isOrdered?: boolean;
5
+ }
6
+
7
+ /**
8
+ * List is used to display list items. It renders a <ul> or <ol> element by default.
9
+ */
10
+ const List = forwardRef<ListProps, 'ul'>((props, ref) => {
11
+ const { isOrdered, ...rest } = props;
12
+ const Component = isOrdered ? OrderedList : UnorderedList;
13
+ return <Component {...rest} ref={ref} />;
14
+ });
15
+
16
+ List.defaultProps = {
17
+ spacing: '8',
18
+ };
19
+
20
+ export default List;
@@ -0,0 +1,12 @@
1
+ import { ListItem as ChakraListItem, ListItemProps, forwardRef } from '@chakra-ui/react';
2
+
3
+ /**
4
+ * ListItem is the valid children of List. It renders a <li> element by default.
5
+ */
6
+ const ListItem = forwardRef<ListItemProps, 'li'>((props, ref) => {
7
+ return <ChakraListItem {...props} ref={ref} />;
8
+ });
9
+
10
+ export type { ListItemProps };
11
+
12
+ export default ListItem;
@@ -2,6 +2,6 @@ import { Menu as ChakraMenu, MenuProps as ChakraMenuProps } from '@chakra-ui/rea
2
2
 
3
3
  export type MenuProps = ChakraMenuProps;
4
4
 
5
- const Menu = (props: MenuProps) => <ChakraMenu {...props} />;
5
+ const Menu = (props: MenuProps) => <ChakraMenu matchWidth {...props} />;
6
6
 
7
7
  export default Menu;
@@ -1,5 +1,6 @@
1
+ import { FC } from 'react';
1
2
  import { PopoverTrigger as ChakraPopoverTrigger } from '@chakra-ui/react';
2
3
 
3
- const PopoverTrigger = (props: { children: React.ReactNode }) => <ChakraPopoverTrigger {...props} />;
4
+ const PopoverTrigger: FC = (props) => <ChakraPopoverTrigger {...props} />;
4
5
 
5
6
  export default PopoverTrigger;
@@ -10,6 +10,7 @@ const TooltipTheme: SystemStyleObject = {
10
10
  paddingY: '8',
11
11
  borderRadius: '8',
12
12
  boxShadow: 'tooltip',
13
+ zIndex: 'tooltip',
13
14
  },
14
15
  };
15
16
 
@@ -1,13 +1,7 @@
1
- export const BREAKPOINTS = {
2
- MOBILE: 'base',
3
- DESKTOP: 'desktop',
4
- WIDE: 'wide',
5
- };
6
-
7
1
  const breakpoints = {
8
- [BREAKPOINTS.MOBILE]: '0rem',
9
- [BREAKPOINTS.DESKTOP]: '53rem', // 848px
10
- [BREAKPOINTS.WIDE]: '101rem', // 1616px
2
+ mobile: '0rem',
3
+ desktop: '53rem', // 848px
4
+ wide: '101rem', // 1616px
11
5
  };
12
6
 
13
7
  export default breakpoints;
@@ -8,6 +8,7 @@ const zIndices = {
8
8
  dialogOverlay: 1299,
9
9
  dialog: 1300,
10
10
  popover: 1400,
11
+ tooltip: 1500,
11
12
  };
12
13
 
13
14
  export default zIndices;
@@ -0,0 +1,116 @@
1
+ .Appear {
2
+ animation-timing-function: var(--transition-timing-function);
3
+ }
4
+
5
+ .Appear--fast {
6
+ transition-duration: var(--transition-duration--fast);
7
+ animation-duration: var(--transition-duration--fast);
8
+ }
9
+
10
+ .Appear--base {
11
+ transition-duration: var(--transition-duration--base);
12
+ animation-duration: var(--transition-duration--base);
13
+ }
14
+
15
+ .Appear--slow {
16
+ transition-duration: var(--transition-duration--slow);
17
+ animation-duration: var(--transition-duration--slow);
18
+ }
19
+
20
+ .Appear--Fade {
21
+ opacity: 0;
22
+ transition-property: opacity;
23
+ }
24
+
25
+ .Appear--Fade-appear-active,
26
+ .Appear--Fade-appear-done,
27
+ .Appear--Fade-enter-active,
28
+ .Appear--Fade-enter-done,
29
+ .Appear--Fade-exit {
30
+ opacity: 1;
31
+ }
32
+
33
+ .Appear--Fade-appear,
34
+ .Appear--Fade-enter,
35
+ .Appear--Fade-exit-active,
36
+ .Appear--Fade-exit-done {
37
+ opacity: 0;
38
+ }
39
+
40
+ .Appear--FadeSlideDown,
41
+ .Appear--FadeSlideUp {
42
+ opacity: 0;
43
+ transition-property: transform, opacity;
44
+ }
45
+
46
+ .Appear--FadeSlideUp { transform: translateY(var(--size--x4)); }
47
+ .Appear--FadeSlideDown { transform: translateY(calc(var(--size--x4) * -1)); }
48
+
49
+ .Appear--FadeSlideDown-appear-active,
50
+ .Appear--FadeSlideDown-appear-done,
51
+ .Appear--FadeSlideDown-enter-active,
52
+ .Appear--FadeSlideDown-enter-done,
53
+ .Appear--FadeSlideDown-exit,
54
+ .Appear--FadeSlideUp-appear-active,
55
+ .Appear--FadeSlideUp-appear-done,
56
+ .Appear--FadeSlideUp-enter-active,
57
+ .Appear--FadeSlideUp-enter-done,
58
+ .Appear--FadeSlideUp-exit {
59
+ transform: translateY(0);
60
+ opacity: 1;
61
+ }
62
+
63
+ .Appear--FadeSlideDown-appear,
64
+ .Appear--FadeSlideDown-enter,
65
+ .Appear--FadeSlideDown-exit-active,
66
+ .Appear--FadeSlideDown-exit-done {
67
+ transform: translateY(calc(var(--size--x4) * -1));
68
+ opacity: 0;
69
+ }
70
+
71
+ .Appear--FadeSlideUp-appear,
72
+ .Appear--FadeSlideUp-enter,
73
+ .Appear--FadeSlideUp-exit-active,
74
+ .Appear--FadeSlideUp-exit-done {
75
+ transform: translateY(var(--size--x4));
76
+ opacity: 0;
77
+ }
78
+
79
+ .Appear--FadeSlideRight,
80
+ .Appear--FadeSlideLeft {
81
+ opacity: 0;
82
+ transition-property: transform, opacity;
83
+ }
84
+
85
+ .Appear--FadeSlideRight { transform: translateX(calc(var(--size--x4) * -1)); }
86
+ .Appear--FadeSlideLeft { transform: translateX(var(--size--x4)); }
87
+
88
+ .Appear--FadeSlideRight-appear-active,
89
+ .Appear--FadeSlideRight-appear-done,
90
+ .Appear--FadeSlideRight-enter-active,
91
+ .Appear--FadeSlideRight-enter-done,
92
+ .Appear--FadeSlideRight-exit,
93
+ .Appear--FadeSlideLeft-appear-active,
94
+ .Appear--FadeSlideLeft-appear-done,
95
+ .Appear--FadeSlideLeft-enter-active,
96
+ .Appear--FadeSlideLeft-enter-done,
97
+ .Appear--FadeSlideLeft-exit {
98
+ transform: translateX(0);
99
+ opacity: 1;
100
+ }
101
+
102
+ .Appear--FadeSlideRight-appear,
103
+ .Appear--FadeSlideRight-enter,
104
+ .Appear--FadeSlideRight-exit-active,
105
+ .Appear--FadeSlideRight-exit-done {
106
+ transform: translateX(calc(var(--size--x4) * -1));
107
+ opacity: 0;
108
+ }
109
+
110
+ .Appear--FadeSlideLeft-appear,
111
+ .Appear--FadeSlideLeft-enter,
112
+ .Appear--FadeSlideLeft-exit-active,
113
+ .Appear--FadeSlideLeft-exit-done {
114
+ transform: translateX(var(--size--x4));
115
+ opacity: 0;
116
+ }
@@ -0,0 +1,74 @@
1
+ import * as React from 'react';
2
+ import { CSSTransition } from 'react-transition-group';
3
+ import classnames from 'classnames';
4
+ import { transitionDurationFast, transitionDurationBase, transitionDurationSlow } from '../variables';
5
+ import Base, { Props as BaseProps } from '../Base/Base';
6
+ import './Appear.css';
7
+
8
+ const isClient = typeof window !== 'undefined';
9
+
10
+ const durations = {
11
+ fast: transitionDurationFast,
12
+ base: transitionDurationBase,
13
+ slow: transitionDurationSlow,
14
+ };
15
+
16
+ export type TypeAppearAnimationName = 'Fade' | 'FadeSlideUp' | 'FadeSlideRight' | 'FadeSlideDown' | 'FadeSlideLeft';
17
+
18
+ export interface Props extends BaseProps {
19
+ /** Type of enter and exit animation */
20
+ animation: TypeAppearAnimationName;
21
+ className?: string;
22
+ /** Entrance delay time */
23
+ delay?: number;
24
+ /** Entrance duration */
25
+ duration?: 'slow' | 'base' | 'fast';
26
+ style?: React.CSSProperties;
27
+ /** Flag if the element is visible or not */
28
+ visible?: boolean;
29
+ }
30
+
31
+ /** Enter and exit components into view with a bit of bedazzle */
32
+ const Appear: React.FunctionComponent<Props> = (props: Props) => {
33
+ const { animation, className, delay, duration = 'fast', style, visible, ...rest } = props;
34
+
35
+ const classes = classnames(className, 'Appear', `Appear--${animation}`, `Appear--${duration}`, {
36
+ [`Appear--${animation}-appear`]: !isClient && visible,
37
+ });
38
+
39
+ const transition = {
40
+ appear: `Appear--${animation}-appear`,
41
+ appearActive: `Appear--${animation}-appear-active`,
42
+ enter: `Appear--${animation}-enter`,
43
+ enterActive: `Appear--${animation}-enter-active`,
44
+ enterDone: `Appear--${animation}-enter-done`,
45
+ exit: `Appear--${animation}-exit`,
46
+ exitActive: `Appear--${animation}-exit-active`,
47
+ exitDone: `Appear--${animation}-exit-done`,
48
+ };
49
+
50
+ const newStyle = {
51
+ ...style,
52
+ animationDelay: `${delay}ms`,
53
+ transitionDelay: `${delay}ms`,
54
+ };
55
+
56
+ return (
57
+ <CSSTransition
58
+ appear={isClient && visible}
59
+ classNames={transition}
60
+ in={isClient && visible}
61
+ timeout={durations[duration]}
62
+ >
63
+ <Base {...rest} className={classes} style={newStyle} />
64
+ </CSSTransition>
65
+ );
66
+ };
67
+
68
+ Appear.defaultProps = {
69
+ delay: 0,
70
+ duration: 'fast',
71
+ visible: true,
72
+ };
73
+
74
+ export default Appear;
@@ -2,12 +2,26 @@
2
2
  .Placement {
3
3
  position: absolute;
4
4
  z-index: var(--z-index-Placement--below-modal);
5
+ pointer-events: none;
6
+ }
7
+
8
+ .Placement--animate {
9
+ transition-property: transform;
10
+ transition-duration: var(--transition-duration--fast);
11
+ transition-timing-function: var(--transition-timing-function);
5
12
  }
6
13
 
7
14
  .Placement--above-modal {
8
15
  z-index: var(--z-index-Placement--above-modal);
9
16
  }
10
17
 
18
+ .Placement__content {
19
+ opacity: 0;
20
+ transition-property: transform, opacity;
21
+ transition-duration: var(--transition-duration--fast);
22
+ transition-timing-function: var(--transition-timing-function);
23
+ }
24
+
11
25
  .Placement--top .Placement__content { transform: translateY(calc(var(--size--x4) * -1)); }
12
26
  .Placement--bottom .Placement__content { transform: translateY(var(--size--x4)); }
13
27
 
@@ -3,8 +3,10 @@ import * as React from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { Placement as TypePlacement, VirtualElement } from '@popperjs/core';
5
5
  import { Popper, PopperProps } from 'react-popper';
6
+ import { CSSTransition } from 'react-transition-group';
6
7
  import classnames from 'classnames';
7
8
  import { useEventListener } from '../hooks';
9
+ import { transitionDurationFast } from '../variables';
8
10
  import Base, { Props as BaseProps } from '../Base/Base';
9
11
  import { PlacementArrowPropsContext } from './PlacementArrowPropsContext';
10
12
  import { PlacementManagerContext } from './PlacementManagerContext';
@@ -12,6 +14,18 @@ import './Placement.css';
12
14
 
13
15
  const { useEffect, useRef, useState } = React;
14
16
 
17
+ const transitionClasses = {
18
+ appear: 'Placement__content-appear',
19
+ appearActive: 'Placement__content-appear-active',
20
+ appearDone: 'Placement__content-appear-done',
21
+ enter: 'Placement__content-enter',
22
+ enterActive: 'Placement__content-enter-active',
23
+ enterDone: 'Placement__content-enter-done',
24
+ exit: 'Placement__content-exit',
25
+ exitActive: 'Placement__content-exit-active',
26
+ exitDone: 'Placement__content-exit-done',
27
+ };
28
+
15
29
  export interface Props extends BaseProps {
16
30
  animatePosition?: boolean;
17
31
  children: (props: { update: () => void; width?: number }) => React.ReactNode;
@@ -40,6 +54,7 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
40
54
  referenceElement,
41
55
  sameWidth,
42
56
  visible,
57
+ timeout = transitionDurationFast,
43
58
  ...rest
44
59
  } = props;
45
60
 
@@ -142,7 +157,7 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
142
157
  ref={ref}
143
158
  style={style}
144
159
  >
145
- {visible && (
160
+ <CSSTransition appear={visible} classNames={transitionClasses} in={visible} timeout={timeout}>
146
161
  <div className="Placement__content">
147
162
  <Base {...rest} backgroundColor={backgroundColor} className="Placement__shadow">
148
163
  <PlacementManagerContext.Consumer>
@@ -155,7 +170,7 @@ const PlacementPopper: React.FunctionComponent<Props> = (props: Props) => {
155
170
  </PlacementManagerContext.Consumer>
156
171
  </Base>
157
172
  </div>
158
- )}
173
+ </CSSTransition>
159
174
  </div>
160
175
  </PlacementArrowPropsContext.Provider>
161
176
  );
@@ -1 +1,2 @@
1
1
  export { default as useHistory } from './useHistory';
2
+ export { useDisclosure } from '@chakra-ui/react';
package/src/index.ts CHANGED
@@ -91,7 +91,6 @@ export { default as EmptyState } from './Components/EmptyState/EmptyState';
91
91
 
92
92
  export type { DialogProps } from './Components/Dialog/Dialog';
93
93
  export { default as Dialog } from './Components/Dialog/Dialog';
94
- export { useDialog } from './Components/Dialog/Dialog';
95
94
 
96
95
  export type { DialogBodyProps } from './Components/Dialog/DialogBody';
97
96
  export { default as DialogBody } from './Components/Dialog/DialogBody';
@@ -112,3 +111,9 @@ export { default as PopoverContent } from './Components/Popover/PopoverContent';
112
111
 
113
112
  export type { AvatarProps } from './Components/Avatar/Avatar';
114
113
  export { default as Avatar } from './Components/Avatar/Avatar';
114
+
115
+ export type { ListProps } from './Components/List/List';
116
+ export { default as List } from './Components/List/List';
117
+
118
+ export type { ListItemProps } from './Components/List/ListItem';
119
+ export { default as ListItem } from './Components/List/ListItem';