@bitrise/bitkit 10.19.0-alpha-chakra.1 → 10.19.0-alpha-chakra.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
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "10.19.0-alpha-chakra.1",
4
+ "version": "10.19.0-alpha-chakra.2",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -6,25 +6,47 @@ import {
6
6
  FormHelperText,
7
7
  FormLabel,
8
8
  Textarea as ChakraTextarea,
9
+ TextareaProps as ChakraTextareaProps,
9
10
  forwardRef,
10
11
  } from '@chakra-ui/react';
11
12
 
12
- export interface TextareaProps extends Omit<FormControlProps, 'label'> {
13
+ export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onChange'> {
14
+ dataTestid?: string;
13
15
  errorText?: string;
14
16
  isLoading?: boolean;
15
17
  helpherText?: string;
16
18
  label?: ReactNode;
19
+ onChange?: ChakraTextareaProps['onChange'];
20
+ value?: ChakraTextareaProps['value'];
17
21
  }
18
22
 
19
23
  /**
20
24
  * The Textarea component allows you to easily create multi-line text inputs.
21
25
  */
22
26
  const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
23
- const { errorText, helpherText, isDisabled, isInvalid, isLoading, label, placeholder, ...rest } = props;
27
+ const {
28
+ dataTestid,
29
+ errorText,
30
+ helpherText,
31
+ isDisabled,
32
+ isInvalid,
33
+ isLoading,
34
+ label,
35
+ placeholder,
36
+ onChange,
37
+ value,
38
+ ...rest
39
+ } = props;
40
+ const textareaProps = {
41
+ dataTestid,
42
+ onChange,
43
+ placeholder,
44
+ value,
45
+ };
24
46
  return (
25
47
  <FormControl isDisabled={isDisabled || isLoading} isInvalid={isInvalid || !!errorText} {...rest} ref={ref}>
26
48
  {label && <FormLabel>{label}</FormLabel>}
27
- <ChakraTextarea placeholder={placeholder} />
49
+ <ChakraTextarea {...textareaProps} />
28
50
  {errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
29
51
  {helpherText && <FormHelperText as="p">{helpherText}</FormHelperText>}
30
52
  </FormControl>