@bitrise/bitkit 9.39.0-alpha-form.2 → 9.39.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 +1 -1
- package/src/Components/CloseButton/CloseButton.theme.ts +10 -0
- package/src/Components/Dialog/Dialog.stories.tsx +3 -2
- package/src/Components/Dialog/Dialog.tsx +6 -2
- package/src/Components/Form/Checkbox/Checkbox.stories.tsx +8 -1
- package/src/Components/Form/Checkbox/Checkbox.tsx +8 -2
- package/src/Components/Form/Radio/Radio.stories.tsx +8 -1
- package/src/Components/Form/Radio/Radio.tsx +7 -1
- package/src/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -3,6 +3,14 @@ const sizes = {
|
|
|
3
3
|
medium: { w: '32', h: '32' },
|
|
4
4
|
small: { w: '24', h: '24' },
|
|
5
5
|
};
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle
|
|
8
|
+
const _disabled = {
|
|
9
|
+
cursor: 'not-allowed',
|
|
10
|
+
opacity: '0.4',
|
|
11
|
+
background: 'transparent',
|
|
12
|
+
};
|
|
13
|
+
|
|
6
14
|
const CloseButtonTheme = {
|
|
7
15
|
baseStyle({
|
|
8
16
|
colorScheme,
|
|
@@ -19,6 +27,7 @@ const CloseButtonTheme = {
|
|
|
19
27
|
_hover: { bg: 'neutral.95' },
|
|
20
28
|
_active: { bg: 'neutral.90' },
|
|
21
29
|
...sizes[size],
|
|
30
|
+
_disabled,
|
|
22
31
|
};
|
|
23
32
|
}
|
|
24
33
|
return {
|
|
@@ -28,6 +37,7 @@ const CloseButtonTheme = {
|
|
|
28
37
|
_hover: { bg: `${colorScheme}.93` },
|
|
29
38
|
_active: { bg: `${colorScheme}.90` },
|
|
30
39
|
...sizes[size],
|
|
40
|
+
_disabled,
|
|
31
41
|
};
|
|
32
42
|
},
|
|
33
43
|
defaultProps: { colorScheme: 'neutral', size: 'small' },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Story, ComponentMeta } from '@storybook/react';
|
|
2
2
|
import { useDisclosure } from '@chakra-ui/react';
|
|
3
|
+
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
3
4
|
import Button from '../Button/Button';
|
|
4
5
|
import Dialog, { DialogProps } from './Dialog';
|
|
5
6
|
import DialogBody from './DialogBody';
|
|
@@ -50,10 +51,10 @@ export const WithProps: Story<StoryType> = ({ lotsOfContent, ...props }: StoryTy
|
|
|
50
51
|
);
|
|
51
52
|
};
|
|
52
53
|
|
|
53
|
-
WithProps.args = {
|
|
54
|
+
WithProps.args = sortObjectByKey({
|
|
54
55
|
...Dialog.defaultProps,
|
|
55
56
|
title: 'Title',
|
|
56
57
|
lotsOfContent: false,
|
|
57
58
|
dataTestid: 'test-modal',
|
|
58
59
|
trapFocus: false,
|
|
59
|
-
};
|
|
60
|
+
});
|
|
@@ -12,6 +12,7 @@ import Text from '../Text/Text';
|
|
|
12
12
|
|
|
13
13
|
export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'> {
|
|
14
14
|
dataTestid?: string;
|
|
15
|
+
isClosable?: boolean;
|
|
15
16
|
isOpen: boolean;
|
|
16
17
|
onClose(): void;
|
|
17
18
|
size?: 'small' | 'medium' | 'large' | 'full';
|
|
@@ -23,6 +24,7 @@ export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBeh
|
|
|
23
24
|
const Dialog = ({
|
|
24
25
|
children,
|
|
25
26
|
dataTestid,
|
|
27
|
+
isClosable,
|
|
26
28
|
isOpen,
|
|
27
29
|
onClose,
|
|
28
30
|
scrollBehavior,
|
|
@@ -34,9 +36,10 @@ const Dialog = ({
|
|
|
34
36
|
const dialogSize = useBreakpointValue({ mobile: 'mobile', desktop: size });
|
|
35
37
|
return (
|
|
36
38
|
<Modal
|
|
39
|
+
closeOnEsc={isClosable}
|
|
37
40
|
closeOnOverlayClick={false}
|
|
38
41
|
isOpen={isOpen}
|
|
39
|
-
onClose={onClose}
|
|
42
|
+
onClose={isClosable ? onClose : () => {}}
|
|
40
43
|
scrollBehavior={scrollBehavior}
|
|
41
44
|
size={dialogSize}
|
|
42
45
|
trapFocus={trapFocus}
|
|
@@ -48,7 +51,7 @@ const Dialog = ({
|
|
|
48
51
|
{title}
|
|
49
52
|
</Text>
|
|
50
53
|
</ModalHeader>
|
|
51
|
-
<ModalCloseButton>
|
|
54
|
+
<ModalCloseButton isDisabled={!isClosable}>
|
|
52
55
|
<Icon name="CloseSmall" />
|
|
53
56
|
</ModalCloseButton>
|
|
54
57
|
{children}
|
|
@@ -58,6 +61,7 @@ const Dialog = ({
|
|
|
58
61
|
};
|
|
59
62
|
|
|
60
63
|
Dialog.defaultProps = {
|
|
64
|
+
isClosable: true,
|
|
61
65
|
scrollBehavior: 'outside',
|
|
62
66
|
size: 'medium',
|
|
63
67
|
trapFocus: true,
|
|
@@ -26,7 +26,14 @@ export const InGroup: ComponentStory<typeof CheckboxGroup> = (props) => (
|
|
|
26
26
|
Checkbox 1<br />
|
|
27
27
|
asddssadsda
|
|
28
28
|
</Checkbox>
|
|
29
|
-
<Checkbox
|
|
29
|
+
<Checkbox
|
|
30
|
+
value="2"
|
|
31
|
+
inputProps={{
|
|
32
|
+
'data-testid': 'test-checkbox-2',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
Checkbox 2
|
|
36
|
+
</Checkbox>
|
|
30
37
|
<Checkbox value="3">Checkbox 3</Checkbox>
|
|
31
38
|
</CheckboxGroup>
|
|
32
39
|
);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Checkbox as ChakraCheckbox, CheckboxProps as ChakraCheckboxProps, forwardRef } from '@chakra-ui/react';
|
|
2
2
|
import Icon from '../../Icon/Icon';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type CheckboxInputProps = ChakraCheckboxProps['inputProps'] & {
|
|
5
|
+
'data-testid': string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export interface CheckboxProps extends Omit<ChakraCheckboxProps, 'icon' | 'iconColor' | 'iconSize' | 'inputProps'> {
|
|
9
|
+
inputProps?: CheckboxInputProps;
|
|
10
|
+
}
|
|
5
11
|
|
|
6
|
-
const CustomIcon = (props:
|
|
12
|
+
const CustomIcon = (props: any) => {
|
|
7
13
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
14
|
const { __css, isChecked, isIndeterminate } = props;
|
|
9
15
|
if (!isChecked) {
|
|
@@ -17,7 +17,14 @@ export const InGroup: ComponentStory<typeof RadioGroup> = (props) => (
|
|
|
17
17
|
Radio 1<br />
|
|
18
18
|
asdasddsa
|
|
19
19
|
</Radio>
|
|
20
|
-
<Radio
|
|
20
|
+
<Radio
|
|
21
|
+
value="2"
|
|
22
|
+
inputProps={{
|
|
23
|
+
'data-testid': 'test-radio-2',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
Radio 2
|
|
27
|
+
</Radio>
|
|
21
28
|
<Radio value="3">Radio 3</Radio>
|
|
22
29
|
</RadioGroup>
|
|
23
30
|
);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Radio as ChakraRadio, RadioProps as ChakraRadioProps, forwardRef } from '@chakra-ui/react';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type RadioInputProps = ChakraRadioProps['inputProps'] & {
|
|
4
|
+
'data-testid': string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export interface RadioProps extends Omit<ChakraRadioProps, 'inputProps'> {
|
|
8
|
+
inputProps?: RadioInputProps;
|
|
9
|
+
}
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Radios are used when only one choice may be selected in a series of options.
|