@bitrise/bitkit 9.33.2 → 9.34.2
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
|
-
import type {
|
|
1
|
+
import type { ComponentStyleConfig } from '@chakra-ui/theme';
|
|
2
2
|
|
|
3
|
-
const DialogTheme:
|
|
4
|
-
baseStyle: {
|
|
3
|
+
const DialogTheme: ComponentStyleConfig = {
|
|
4
|
+
baseStyle: ({ scrollBehavior }) => ({
|
|
5
5
|
overlay: {
|
|
6
6
|
backgroundColor: 'rgba(0, 0, 0, .5)',
|
|
7
7
|
},
|
|
@@ -9,13 +9,14 @@ const DialogTheme: SystemStyleObject = {
|
|
|
9
9
|
display: 'flex',
|
|
10
10
|
justifyContent: 'center',
|
|
11
11
|
alignItems: 'flex-start',
|
|
12
|
-
overflow: 'auto',
|
|
12
|
+
overflow: scrollBehavior === 'inside' ? 'hidden' : 'auto',
|
|
13
13
|
},
|
|
14
14
|
dialog: {
|
|
15
15
|
borderRadius: '8',
|
|
16
16
|
backgroundColor: 'neutral.100',
|
|
17
17
|
boxShadow: 'large',
|
|
18
18
|
marginY: '128',
|
|
19
|
+
maxH: scrollBehavior === 'inside' ? 'calc(100% - 16rem)' : undefined,
|
|
19
20
|
},
|
|
20
21
|
header: {
|
|
21
22
|
padding: '24',
|
|
@@ -42,7 +43,7 @@ const DialogTheme: SystemStyleObject = {
|
|
|
42
43
|
padding: '32',
|
|
43
44
|
paddingTop: '48',
|
|
44
45
|
},
|
|
45
|
-
},
|
|
46
|
+
}),
|
|
46
47
|
sizes: {
|
|
47
48
|
small: {
|
|
48
49
|
dialog: {
|
|
@@ -71,6 +72,7 @@ const DialogTheme: SystemStyleObject = {
|
|
|
71
72
|
right: '32',
|
|
72
73
|
top: '32',
|
|
73
74
|
bottom: '32',
|
|
75
|
+
maxH: 'auto',
|
|
74
76
|
},
|
|
75
77
|
},
|
|
76
78
|
mobile: {
|
|
@@ -25,17 +25,24 @@ export const useDialog = (): DialogState => {
|
|
|
25
25
|
onOpen,
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export interface DialogProps extends HTMLChakraProps<'section'> {
|
|
28
|
+
export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'> {
|
|
29
29
|
dataTestid?: string;
|
|
30
30
|
size?: 'small' | 'medium' | 'large' | 'full';
|
|
31
|
+
scrollBehavior?: 'inside' | 'outside';
|
|
31
32
|
state: DialogState;
|
|
32
33
|
title: string;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
const Dialog = ({ children, dataTestid, state, size, title, ...rest }: DialogProps) => {
|
|
36
|
+
const Dialog = ({ children, dataTestid, scrollBehavior, state, size, title, ...rest }: DialogProps) => {
|
|
36
37
|
const dialogSize = useBreakpointValue({ mobile: 'mobile', desktop: size });
|
|
37
38
|
return (
|
|
38
|
-
<Modal
|
|
39
|
+
<Modal
|
|
40
|
+
closeOnOverlayClick={false}
|
|
41
|
+
isOpen={state.isOpen}
|
|
42
|
+
onClose={state.onClose}
|
|
43
|
+
scrollBehavior={scrollBehavior}
|
|
44
|
+
size={dialogSize}
|
|
45
|
+
>
|
|
39
46
|
<ModalOverlay />
|
|
40
47
|
<ModalContent data-testid={dataTestid} {...rest}>
|
|
41
48
|
<ModalHeader>
|
|
@@ -53,6 +60,7 @@ const Dialog = ({ children, dataTestid, state, size, title, ...rest }: DialogPro
|
|
|
53
60
|
};
|
|
54
61
|
|
|
55
62
|
Dialog.defaultProps = {
|
|
63
|
+
scrollBehavior: 'outside',
|
|
56
64
|
size: 'medium',
|
|
57
65
|
} as DialogProps;
|
|
58
66
|
|
package/src/index.ts
CHANGED
|
@@ -101,3 +101,12 @@ export { default as DialogFooter } from './Components/Dialog/DialogFooter';
|
|
|
101
101
|
|
|
102
102
|
export type { FadeProps } from './Components/Transitions/Fade';
|
|
103
103
|
export { default as Fade } from './Components/Transitions/Fade';
|
|
104
|
+
|
|
105
|
+
export type { PopoverProps } from './Components/Popover/Popover';
|
|
106
|
+
export { default as Popover } from './Components/Popover/Popover';
|
|
107
|
+
|
|
108
|
+
export { default as PopoverTrigger } from './Components/Popover/PopoverTrigger';
|
|
109
|
+
|
|
110
|
+
export type { PopoverContentProps } from './Components/Popover/PopoverContent';
|
|
111
|
+
export { default as PopoverContent } from './Components/Popover/PopoverContent';
|
|
112
|
+
|