@granto-umbrella/umbrella-components 2.0.4 → 2.0.5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@granto-umbrella/umbrella-components",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Umbrella Components for React",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -15,6 +15,7 @@ const Button: React.FC<ButtonProps> = ({
15
15
  rightIcon,
16
16
  width,
17
17
  height,
18
+ testId,
18
19
  ...props
19
20
  }) => {
20
21
  const IconComponentLeft =
@@ -29,6 +30,7 @@ const Button: React.FC<ButtonProps> = ({
29
30
  $radius={radius}
30
31
  $width={width}
31
32
  $height={height}
33
+ data-testid={testId}
32
34
  {...props}
33
35
  >
34
36
  {isLoading ? (
@@ -10,4 +10,5 @@ export interface ButtonProps
10
10
  fontSize?: string;
11
11
  width?: string;
12
12
  height?: string;
13
+ testId?: string;
13
14
  }
@@ -39,6 +39,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
39
39
  shadow = "default" as "none" | "default" | "md" | "lg",
40
40
  style,
41
41
  register,
42
+ testId,
42
43
  },
43
44
  ref
44
45
  ) => {
@@ -50,6 +51,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(
50
51
  $disabled={disabled}
51
52
  $radius={radius}
52
53
  $shadow={shadow}
54
+ data-testid={testId}
53
55
  >
54
56
  {icon && <Icon>{icon}</Icon>}
55
57
  <StyledInput
@@ -36,4 +36,5 @@ export interface InputProps {
36
36
  shadow?: "none" | "default" | "md" | "lg";
37
37
  style?: React.CSSProperties;
38
38
  register?: any;
39
+ testId?: string;
39
40
  }
@@ -9,10 +9,12 @@ const RadioButton: React.FC<RadioButtonProps> = ({
9
9
  checked,
10
10
  onChange,
11
11
  disabled = false,
12
+ testId,
12
13
  }) => {
13
14
  return (
14
15
  <RadioContainer>
15
16
  <StyledRadio
17
+ data-testid={testId}
16
18
  type="radio"
17
19
  name={name}
18
20
  value={value}
@@ -5,4 +5,5 @@ export interface RadioButtonProps {
5
5
  checked?: boolean;
6
6
  onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
7
7
  disabled?: boolean;
8
+ testId?: string;
8
9
  }
@@ -20,6 +20,7 @@ interface SelectProps {
20
20
  options: { label: string; value: string }[];
21
21
  onChange?: (newValue: Option | null, actionMeta: { action: string }) => void;
22
22
  value?: Option | null;
23
+ testId?: string;
23
24
  }
24
25
 
25
26
  const Select: React.FC<SelectProps> = ({
@@ -29,6 +30,7 @@ const Select: React.FC<SelectProps> = ({
29
30
  placeholder,
30
31
  onChange,
31
32
  value,
33
+ testId,
32
34
  }) => {
33
35
  return (
34
36
  <Container>
@@ -42,6 +44,7 @@ const Select: React.FC<SelectProps> = ({
42
44
  }
43
45
  value={value}
44
46
  isSearchable
47
+ data-testid={testId}
45
48
  />
46
49
  {supportingText && <SupportingText>{supportingText}</SupportingText>}
47
50
  </Container>
@@ -3,13 +3,14 @@ import { SwitchWrapper, SwitchInput, SwitchLabel } from "./Switch.styles";
3
3
 
4
4
  interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
5
5
  label?: string;
6
+ testId?: string;
6
7
  }
7
8
 
8
- export const Switch: React.FC<SwitchProps> = ({ label, ...props }) => {
9
+ export const Switch: React.FC<SwitchProps> = ({ label, testId, ...props }) => {
9
10
  return (
10
11
  <SwitchWrapper>
11
12
  {label && <SwitchLabel>{label}</SwitchLabel>}
12
- <SwitchInput {...props} />
13
+ <SwitchInput data-testid={testId} {...props} />
13
14
  </SwitchWrapper>
14
15
  );
15
16
  };
@@ -3,4 +3,5 @@ export interface SwitchProps {
3
3
  onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
4
4
  label?: string;
5
5
  disabled?: boolean;
6
+ testId?: string;
6
7
  }
@@ -7,9 +7,15 @@ const Text: React.FC<TextProps> = ({
7
7
  size = "md",
8
8
  weight = "normal",
9
9
  color = "black",
10
+ testId,
10
11
  }) => {
11
12
  return (
12
- <StyledText $size={size} $weight={weight} $color={color}>
13
+ <StyledText
14
+ data-testid={testId}
15
+ $size={size}
16
+ $weight={weight}
17
+ $color={color}
18
+ >
13
19
  {children}
14
20
  </StyledText>
15
21
  );
@@ -3,4 +3,5 @@ export interface TextProps {
3
3
  size?: "sm" | "md" | "lg";
4
4
  weight?: "normal" | "bold";
5
5
  color?: string;
6
+ testId?: string;
6
7
  }
@@ -10,12 +10,13 @@ import {
10
10
  const Textarea: React.FC<TextareaProps> = ({
11
11
  label,
12
12
  supportingText,
13
+ testId,
13
14
  ...props
14
15
  }) => {
15
16
  return (
16
17
  <TextareaWrapper>
17
18
  {label && <Label>{label}</Label>}
18
- <StyledTextarea {...props} />
19
+ <StyledTextarea data-testid={testId} {...props} />
19
20
  {supportingText && <SupportingText>{supportingText}</SupportingText>}
20
21
  </TextareaWrapper>
21
22
  );
@@ -2,4 +2,5 @@ export interface TextareaProps
2
2
  extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
3
3
  label?: string;
4
4
  supportingText?: string;
5
+ testId?: string;
5
6
  }