@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 +1 -1
- package/src/components/atoms/Button/Button.tsx +2 -0
- package/src/components/atoms/Button/Button.types.ts +1 -0
- package/src/components/atoms/Input/Input.tsx +2 -0
- package/src/components/atoms/Input/Input.types.ts +1 -0
- package/src/components/atoms/RadioButton/RadioButton.tsx +2 -0
- package/src/components/atoms/RadioButton/RadioButton.types.ts +1 -0
- package/src/components/atoms/Select/Select.tsx +3 -0
- package/src/components/atoms/Switch/Switch.tsx +3 -2
- package/src/components/atoms/Switch/Switch.types.ts +1 -0
- package/src/components/atoms/Text/Text.tsx +7 -1
- package/src/components/atoms/Text/Text.types.ts +1 -0
- package/src/components/atoms/Textarea/Textarea.tsx +2 -1
- package/src/components/atoms/Textarea/Textarea.types.ts +1 -0
package/package.json
CHANGED
|
@@ -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 ? (
|
|
@@ -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
|
|
@@ -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
|
};
|
|
@@ -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
|
|
13
|
+
<StyledText
|
|
14
|
+
data-testid={testId}
|
|
15
|
+
$size={size}
|
|
16
|
+
$weight={weight}
|
|
17
|
+
$color={color}
|
|
18
|
+
>
|
|
13
19
|
{children}
|
|
14
20
|
</StyledText>
|
|
15
21
|
);
|
|
@@ -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
|
);
|