@bitrise/bitkit 12.6.0 → 12.6.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
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
useBreakpointValue,
|
|
8
8
|
usePrefersReducedMotion,
|
|
9
9
|
HTMLChakraProps,
|
|
10
|
+
ComponentWithAs,
|
|
10
11
|
} from '@chakra-ui/react';
|
|
11
12
|
import { BREAKPOINTS } from '../../Foundations/Breakpoints/Breakpoints';
|
|
12
13
|
import Icon from '../Icon/Icon';
|
|
13
14
|
import Text from '../Text/Text';
|
|
14
15
|
|
|
15
16
|
export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBehavior'> {
|
|
16
|
-
dataTestid?: string;
|
|
17
17
|
isClosable?: boolean;
|
|
18
18
|
isOpen: boolean;
|
|
19
19
|
onClose(): void;
|
|
@@ -24,9 +24,8 @@ export interface DialogProps extends Omit<HTMLChakraProps<'section'>, 'scrollBeh
|
|
|
24
24
|
variant?: 'default' | 'empty';
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const Dialog = ({
|
|
27
|
+
const Dialog: ComponentWithAs<'section', DialogProps> = ({
|
|
28
28
|
children,
|
|
29
|
-
dataTestid,
|
|
30
29
|
isClosable,
|
|
31
30
|
isOpen,
|
|
32
31
|
onClose,
|
|
@@ -52,7 +51,7 @@ const Dialog = ({
|
|
|
52
51
|
trapFocus={trapFocus}
|
|
53
52
|
>
|
|
54
53
|
<ModalOverlay />
|
|
55
|
-
<ModalContent
|
|
54
|
+
<ModalContent {...rest}>
|
|
56
55
|
{variant !== 'empty' && (
|
|
57
56
|
<>
|
|
58
57
|
<ModalHeader marginRight="48">
|
|
@@ -9,8 +9,15 @@ import {
|
|
|
9
9
|
TextareaProps as ChakraTextareaProps,
|
|
10
10
|
forwardRef,
|
|
11
11
|
} from '@chakra-ui/react';
|
|
12
|
+
import Text from '../../Text/Text';
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
type UsedFormControlProps = Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'>;
|
|
15
|
+
type UsedChakraTextProps = Pick<
|
|
16
|
+
ChakraTextareaProps,
|
|
17
|
+
'onBlur' | 'onChange' | 'role' | 'name' | 'value' | 'autoComplete' | 'autoFocus' | 'maxLength' | 'minLength'
|
|
18
|
+
>;
|
|
19
|
+
|
|
20
|
+
export interface TextareaProps extends UsedFormControlProps, UsedChakraTextProps {
|
|
14
21
|
'data-testid'?: string;
|
|
15
22
|
errorText?: string;
|
|
16
23
|
isLoading?: boolean;
|
|
@@ -27,6 +34,8 @@ export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onBlur'
|
|
|
27
34
|
*/
|
|
28
35
|
const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
|
|
29
36
|
const {
|
|
37
|
+
autoComplete,
|
|
38
|
+
autoFocus,
|
|
30
39
|
'data-testid': dataTestid,
|
|
31
40
|
errorText,
|
|
32
41
|
helperText,
|
|
@@ -34,10 +43,14 @@ const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
|
|
|
34
43
|
isInvalid,
|
|
35
44
|
isLoading,
|
|
36
45
|
label,
|
|
46
|
+
maxLength,
|
|
47
|
+
minLength,
|
|
37
48
|
placeholder,
|
|
38
49
|
onBlur,
|
|
39
50
|
onChange,
|
|
51
|
+
resize,
|
|
40
52
|
name,
|
|
53
|
+
role,
|
|
41
54
|
value,
|
|
42
55
|
...rest
|
|
43
56
|
} = props;
|
|
@@ -48,16 +61,34 @@ const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
|
|
|
48
61
|
ref,
|
|
49
62
|
};
|
|
50
63
|
const textareaProps = {
|
|
64
|
+
autoComplete,
|
|
65
|
+
autoFocus,
|
|
51
66
|
'data-testid': dataTestid,
|
|
52
67
|
onBlur,
|
|
53
68
|
onChange,
|
|
69
|
+
maxLength,
|
|
70
|
+
minLength,
|
|
54
71
|
name,
|
|
55
72
|
placeholder,
|
|
73
|
+
resize,
|
|
74
|
+
role,
|
|
56
75
|
value,
|
|
57
76
|
};
|
|
58
77
|
return (
|
|
59
78
|
<FormControl {...formControlProps}>
|
|
60
|
-
{label &&
|
|
79
|
+
{label && (
|
|
80
|
+
<FormLabel
|
|
81
|
+
requiredIndicator={null as any}
|
|
82
|
+
optionalIndicator={
|
|
83
|
+
<Text as="span" fontSize="2" color="neutral.40" fontWeight="normal" marginLeft="4px">
|
|
84
|
+
(Optional)
|
|
85
|
+
</Text>
|
|
86
|
+
}
|
|
87
|
+
>
|
|
88
|
+
{label}
|
|
89
|
+
</FormLabel>
|
|
90
|
+
)}
|
|
91
|
+
|
|
61
92
|
<ChakraTextarea {...textareaProps} />
|
|
62
93
|
{errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
|
|
63
94
|
{helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
|