@granto-umbrella/umbrella-components 2.3.22 → 2.3.23
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/dist/umbrella-components.es.js +35086 -34961
- package/dist/umbrella-components.umd.js +513 -414
- package/package.json +4 -3
- package/src/components/atoms/Badge/Badge.styles.ts +24 -17
- package/src/components/atoms/Badge/Badge.tsx +19 -11
- package/src/components/atoms/Badge/Badge.types.ts +3 -2
- package/src/components/atoms/Breadcrumb/Breadcrumb.styles.ts +18 -11
- package/src/components/atoms/Breadcrumb/Breadcrumb.tsx +11 -3
- package/src/components/atoms/Button/Button.styles.ts +86 -12
- package/src/components/atoms/Button/Button.types.ts +6 -1
- package/src/components/atoms/Checkbox/Checkbox.styles.ts +4 -4
- package/src/components/atoms/Checkbox/Checkbox.tsx +2 -1
- package/src/components/atoms/CodeInput/CodeInput.styles.tsx +39 -0
- package/src/components/atoms/CodeInput/CodeInput.tsx +19 -0
- package/src/components/atoms/CodeInput/CodeInput.types.ts +3 -0
- package/src/components/atoms/CodeInput/index.tsx +1 -0
- package/src/components/atoms/Input/Input.styles.ts +24 -8
- package/src/components/atoms/Input/Input.tsx +10 -9
- package/src/components/atoms/Input/Input.types.ts +4 -25
- package/src/components/atoms/Label/Label.styles.ts +8 -7
- package/src/components/atoms/RadioButton/RadioButton.styles.ts +3 -2
- package/src/components/atoms/RadioButton/RadioButton.tsx +1 -0
- package/src/components/atoms/Select/Select.styles.ts +81 -23
- package/src/components/atoms/Select/Select.tsx +17 -30
- package/src/components/atoms/Select/Select.types.ts +17 -9
- package/src/components/atoms/Switch/Switch.styles.ts +13 -8
- package/src/components/atoms/Switch/Switch.tsx +1 -1
- package/src/components/atoms/Text/Text.tsx +1 -0
- package/src/components/atoms/Textarea/Textarea.styles.ts +7 -8
- package/src/components/atoms/Textarea/Textarea.tsx +1 -1
- package/src/components/molecules/ButtonGroup/ButtonGroup.tsx +12 -6
- package/src/components/molecules/ButtonGroup/ButtonGroup.types.ts +16 -2
- package/src/index.ts +3 -1
- package/src/styles/tokens/colors.ts +102 -96
- package/src/styles/tokens/shadows.ts +3 -3
- package/src/styles/tokens/typography.ts +148 -123
|
@@ -11,31 +11,10 @@ export interface InputProps {
|
|
|
11
11
|
icon?: React.ReactNode;
|
|
12
12
|
label?: string;
|
|
13
13
|
supportText?: string;
|
|
14
|
-
size?:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| "x2"
|
|
19
|
-
| "x3"
|
|
20
|
-
| "x4"
|
|
21
|
-
| "x5"
|
|
22
|
-
| "x6"
|
|
23
|
-
| "x7"
|
|
24
|
-
| "x8"
|
|
25
|
-
| "x9"
|
|
26
|
-
| "x10"
|
|
27
|
-
| "x11"
|
|
28
|
-
| "x12"
|
|
29
|
-
| "x13"
|
|
30
|
-
| "x14"
|
|
31
|
-
| "x15"
|
|
32
|
-
| "x16"
|
|
33
|
-
| "md"
|
|
34
|
-
| "lg"
|
|
35
|
-
| "sm"
|
|
36
|
-
| "full";
|
|
37
|
-
radius?: "md" | "lg" | "sm" | "full";
|
|
38
|
-
shadow?: "none" | "default" | "md" | "lg";
|
|
14
|
+
size?: 'sm' | 'md' | 'lg';
|
|
15
|
+
|
|
16
|
+
radius?: 'md' | 'lg' | 'sm' | 'full';
|
|
17
|
+
shadow?: 'none' | 'default' | 'md' | 'lg';
|
|
39
18
|
style?: React.CSSProperties;
|
|
40
19
|
register?: any;
|
|
41
20
|
testId?: string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Label.styled.tsx
|
|
2
|
-
import styled from
|
|
3
|
-
import * as LabelPrimitive from
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
+
import { typographyTokens } from '../../../styles/tokens/typography';
|
|
4
5
|
|
|
5
6
|
export const StyledLabel = styled(LabelPrimitive.Root)`
|
|
6
|
-
font-size:
|
|
7
|
-
font-weight:
|
|
8
|
-
line-height: 1; /* Equivalente a leading-none */
|
|
7
|
+
font-size: ${typographyTokens.fontSizes.labelS};
|
|
8
|
+
font-weight: ${typographyTokens.fontWeights.medium};
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
line-height: ${typographyTokens.lineHeights.labelS};
|
|
11
|
+
font-family: ${typographyTokens.fontFamily.base};
|
|
12
|
+
&[data-disabled='true'] {
|
|
12
13
|
cursor: not-allowed;
|
|
13
14
|
opacity: 0.7;
|
|
14
15
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import {
|
|
3
3
|
primitiveSizes,
|
|
4
|
+
semanticBorders,
|
|
4
5
|
semanticColors,
|
|
5
6
|
semanticSizes,
|
|
6
7
|
typographyTokens,
|
|
@@ -18,7 +19,7 @@ export const StyledRadio = styled.input`
|
|
|
18
19
|
width: ${semanticSizes.global.padding.xl};
|
|
19
20
|
height: ${semanticSizes.global.padding.xl};
|
|
20
21
|
border-radius: 50%;
|
|
21
|
-
border:
|
|
22
|
+
border: ${semanticBorders.global.md} solid ${semanticColors.global.border.medium};
|
|
22
23
|
display: flex;
|
|
23
24
|
align-items: center;
|
|
24
25
|
justify-content: center;
|
|
@@ -30,7 +31,7 @@ export const StyledRadio = styled.input`
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
&:disabled {
|
|
33
|
-
border-color: ${semanticColors.
|
|
34
|
+
border-color: ${semanticColors.global.border.disabled};
|
|
34
35
|
cursor: not-allowed;
|
|
35
36
|
}
|
|
36
37
|
`;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import Select from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import Select from 'react-select';
|
|
3
3
|
import {
|
|
4
|
-
semanticColors,
|
|
5
|
-
semanticRadius,
|
|
6
4
|
semanticSizes,
|
|
7
5
|
semanticShadows,
|
|
8
6
|
primitiveSizes,
|
|
9
7
|
typographyTokens,
|
|
10
|
-
|
|
8
|
+
semanticBorders,
|
|
9
|
+
semanticColors,
|
|
10
|
+
semanticRadius,
|
|
11
|
+
} from '../../../styles/tokens/index';
|
|
11
12
|
|
|
12
13
|
export const Container = styled.div`
|
|
13
14
|
display: flex;
|
|
@@ -25,68 +26,125 @@ export const Label = styled.label`
|
|
|
25
26
|
font-weight: ${typographyTokens.fontWeights.medium};
|
|
26
27
|
`;
|
|
27
28
|
|
|
28
|
-
export const SupportingText = styled.span
|
|
29
|
+
export const SupportingText = styled.span<{ $error?: boolean }>`
|
|
29
30
|
font-size: ${typographyTokens.fontSizes.captionM};
|
|
30
|
-
color: ${
|
|
31
|
+
color: ${({ $error }) =>
|
|
32
|
+
$error
|
|
33
|
+
? semanticColors.global.text.feedback.strong.error
|
|
34
|
+
: semanticColors.global.text.subtitle.enabled};
|
|
31
35
|
`;
|
|
32
36
|
|
|
33
37
|
export const CustomSelect = styled(Select).attrs({
|
|
34
|
-
classNamePrefix:
|
|
35
|
-
})<{
|
|
38
|
+
classNamePrefix: 'react-select',
|
|
39
|
+
})<{
|
|
40
|
+
$size?: keyof typeof semanticSizes.global.padding;
|
|
41
|
+
$error?: boolean;
|
|
42
|
+
}>`
|
|
36
43
|
.react-select__control {
|
|
37
44
|
background: ${semanticColors.base.background};
|
|
38
|
-
border:
|
|
45
|
+
border: ${semanticBorders.global.sm} solid
|
|
46
|
+
${({ $error }) =>
|
|
47
|
+
$error
|
|
48
|
+
? semanticColors.global.border.danger.enabled
|
|
49
|
+
: semanticColors.global.border.medium};
|
|
39
50
|
border-radius: ${semanticRadius.global.radius.md};
|
|
40
|
-
box-shadow: ${semanticShadows.shadow};
|
|
51
|
+
box-shadow: ${semanticShadows.shadow.default};
|
|
41
52
|
transition: border-color 0.2s, box-shadow 0.2s;
|
|
42
|
-
min-height: ${primitiveSizes.size.
|
|
53
|
+
min-height: ${primitiveSizes.size.x12};
|
|
43
54
|
|
|
44
55
|
&:hover {
|
|
45
|
-
border-color: ${
|
|
56
|
+
border-color: ${({ $error }) =>
|
|
57
|
+
$error
|
|
58
|
+
? semanticColors.danger.border.hover
|
|
59
|
+
: semanticColors.branding.border.hover};
|
|
46
60
|
}
|
|
47
61
|
|
|
48
62
|
&:focus-within {
|
|
49
|
-
border-color: ${
|
|
50
|
-
|
|
63
|
+
border-color: ${({ $error }) =>
|
|
64
|
+
$error
|
|
65
|
+
? semanticColors.danger.border.enabled
|
|
66
|
+
: semanticColors.branding.border.enabled};
|
|
67
|
+
box-shadow: ${semanticShadows.shadow.md};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.react-select__control--is-disabled {
|
|
71
|
+
background: ${semanticColors.global.surface.disabled};
|
|
72
|
+
border-color: ${semanticColors.global.border.strong};
|
|
73
|
+
color: ${semanticColors.global.text.onSurface.enabled};
|
|
74
|
+
cursor: not-allowed;
|
|
51
75
|
}
|
|
52
76
|
}
|
|
53
77
|
|
|
54
78
|
.react-select__value-container {
|
|
55
|
-
padding: ${({ $size =
|
|
79
|
+
padding: ${({ $size = 'md' }) => semanticSizes.global.padding[$size]};
|
|
56
80
|
font-size: ${typographyTokens.fontSizes.labelM};
|
|
57
81
|
color: ${semanticColors.base.text};
|
|
58
82
|
}
|
|
59
83
|
|
|
84
|
+
.react-select__placeholder {
|
|
85
|
+
color: ${semanticColors.global.text.onSurface.subtitle};
|
|
86
|
+
font-size: ${typographyTokens.fontSizes.labelM};
|
|
87
|
+
}
|
|
88
|
+
|
|
60
89
|
.react-select__menu {
|
|
61
90
|
background: ${semanticColors.base.background};
|
|
62
91
|
border-radius: ${semanticRadius.global.radius.md};
|
|
63
|
-
box-shadow: ${semanticShadows.shadow};
|
|
92
|
+
box-shadow: ${semanticShadows.shadow.lg};
|
|
93
|
+
border: ${semanticBorders.global.sm} solid
|
|
94
|
+
${semanticColors.global.border.default};
|
|
95
|
+
z-index: 1000;
|
|
64
96
|
}
|
|
65
97
|
|
|
66
98
|
.react-select__option {
|
|
67
|
-
padding: ${({ $size =
|
|
99
|
+
padding: ${({ $size = 'md' }) => semanticSizes.global.padding[$size]};
|
|
68
100
|
font-size: ${typographyTokens.fontSizes.labelM};
|
|
69
101
|
cursor: pointer;
|
|
70
102
|
transition: background 0.2s, color 0.2s;
|
|
103
|
+
color: ${semanticColors.base.text};
|
|
71
104
|
|
|
72
105
|
&:hover {
|
|
73
106
|
background: ${semanticColors.branding.surface.hover};
|
|
74
|
-
color: ${semanticColors.
|
|
107
|
+
color: ${semanticColors.branding.text.onSurfaceAccent.enabled};
|
|
75
108
|
}
|
|
76
109
|
|
|
77
110
|
&:active {
|
|
78
111
|
background: ${semanticColors.branding.surface.pressed};
|
|
79
|
-
color: ${semanticColors.
|
|
112
|
+
color: ${semanticColors.branding.text.onSurfaceAccent.enabled};
|
|
80
113
|
}
|
|
81
114
|
}
|
|
82
115
|
|
|
83
116
|
.react-select__option--is-selected {
|
|
84
117
|
background: ${semanticColors.branding.surface.enabled};
|
|
85
|
-
color: ${semanticColors.
|
|
86
|
-
font-weight:
|
|
118
|
+
color: ${semanticColors.branding.text.onSurfaceAccent.enabled};
|
|
119
|
+
font-weight: ${typographyTokens.fontWeights.semibold};
|
|
120
|
+
|
|
121
|
+
&:hover {
|
|
122
|
+
background: ${semanticColors.branding.surface.hover};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.react-select__option--is-focused {
|
|
127
|
+
background: ${semanticColors.neutral[100]};
|
|
128
|
+
color: ${semanticColors.base.text};
|
|
87
129
|
}
|
|
88
130
|
|
|
89
131
|
.react-select__indicator-separator {
|
|
90
|
-
background-color: ${semanticColors.
|
|
132
|
+
background-color: ${semanticColors.global.border.medium};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.react-select__dropdown-indicator {
|
|
136
|
+
color: ${semanticColors.global.text.onSurface.enabled};
|
|
137
|
+
|
|
138
|
+
&:hover {
|
|
139
|
+
color: ${semanticColors.branding.text.accent.enabled};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.react-select__clear-indicator {
|
|
144
|
+
color: ${semanticColors.global.text.onSurface.enabled};
|
|
145
|
+
|
|
146
|
+
&:hover {
|
|
147
|
+
color: ${semanticColors.danger.text.enabled};
|
|
148
|
+
}
|
|
91
149
|
}
|
|
92
150
|
`;
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
CustomSelect,
|
|
7
|
-
} from "./Select.styles";
|
|
8
|
-
import { semanticSizes } from "../../../styles/tokens";
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import type React from "react"
|
|
4
|
+
import { Container, Label, SupportingText, CustomSelect } from "./Select.styles"
|
|
5
|
+
import type { SelectProps } from "./Select.types"
|
|
9
6
|
|
|
10
7
|
interface Option {
|
|
11
|
-
label: string
|
|
12
|
-
value: string
|
|
13
|
-
}
|
|
14
|
-
interface SelectProps {
|
|
15
|
-
label: string;
|
|
16
|
-
supportingText?: string;
|
|
17
|
-
placeholder?: string;
|
|
18
|
-
borderColor?: string;
|
|
19
|
-
borderRadius?: string;
|
|
20
|
-
size?: keyof typeof semanticSizes.global.padding;
|
|
21
|
-
options: { label: string; value: string }[];
|
|
22
|
-
onChange?: (newValue: Option | null, actionMeta: { action: string }) => void;
|
|
23
|
-
value?: Option | null;
|
|
24
|
-
testId?: string;
|
|
8
|
+
label: string
|
|
9
|
+
value: string
|
|
25
10
|
}
|
|
26
11
|
|
|
27
12
|
const Select: React.FC<SelectProps> = ({
|
|
@@ -33,24 +18,26 @@ const Select: React.FC<SelectProps> = ({
|
|
|
33
18
|
value,
|
|
34
19
|
testId,
|
|
35
20
|
size = "md",
|
|
21
|
+
disabled = false,
|
|
22
|
+
error = false,
|
|
36
23
|
}) => {
|
|
37
24
|
return (
|
|
38
|
-
<Container data-testid={testId}>
|
|
25
|
+
<Container data-testid={testId} id={testId}>
|
|
39
26
|
{label && <Label>{label}</Label>}
|
|
40
27
|
<CustomSelect
|
|
41
28
|
$size={size}
|
|
29
|
+
$error={error}
|
|
42
30
|
classNamePrefix="react-select"
|
|
43
31
|
options={options}
|
|
44
32
|
placeholder={placeholder || "Selecione"}
|
|
45
|
-
onChange={(newValue, actionMeta) =>
|
|
46
|
-
onChange && onChange(newValue as Option | null, actionMeta)
|
|
47
|
-
}
|
|
33
|
+
onChange={(newValue, actionMeta) => onChange && onChange(newValue as Option | null, actionMeta)}
|
|
48
34
|
value={value}
|
|
49
35
|
isSearchable
|
|
36
|
+
isDisabled={disabled}
|
|
50
37
|
/>
|
|
51
|
-
{supportingText && <SupportingText>{supportingText}</SupportingText>}
|
|
38
|
+
{supportingText && <SupportingText $error={error}>{supportingText}</SupportingText>}
|
|
52
39
|
</Container>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
55
42
|
|
|
56
|
-
export default Select
|
|
43
|
+
export default Select
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
interface Option {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
2
5
|
|
|
3
|
-
export interface SelectProps
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export interface SelectProps {
|
|
7
|
+
label: string;
|
|
8
|
+
supportingText?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
borderColor?: string;
|
|
11
|
+
borderRadius?: string;
|
|
12
|
+
size?: 'sm' | 'md' | 'lg';
|
|
13
|
+
options: { label: string; value: string }[];
|
|
14
|
+
onChange?: (newValue: Option | null, actionMeta: { action: string }) => void;
|
|
15
|
+
value?: Option | null;
|
|
16
|
+
testId?: string;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
error?: boolean;
|
|
11
19
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import styled from
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
import {
|
|
3
3
|
semanticColors,
|
|
4
4
|
semanticSizes,
|
|
5
5
|
semanticRadius,
|
|
6
6
|
typographyTokens,
|
|
7
|
-
} from
|
|
7
|
+
} from '../../../styles/tokens';
|
|
8
8
|
|
|
9
9
|
export const SwitchWrapper = styled.label`
|
|
10
10
|
display: flex;
|
|
@@ -15,14 +15,14 @@ export const SwitchWrapper = styled.label`
|
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
`;
|
|
17
17
|
|
|
18
|
-
export const SwitchInput = styled.input.attrs({ type:
|
|
18
|
+
export const SwitchInput = styled.input.attrs({ type: 'checkbox' })`
|
|
19
19
|
appearance: none;
|
|
20
20
|
width: ${semanticSizes.global.spacings.lg};
|
|
21
21
|
height: ${semanticSizes.global.padding.xl};
|
|
22
22
|
background: ${semanticColors.neutral[300]};
|
|
23
23
|
border-radius: ${semanticRadius.global.radius.full};
|
|
24
24
|
position: relative;
|
|
25
|
-
transition: background 0.3s ease-
|
|
25
|
+
transition: background 0.3s ease-out;
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
|
|
28
28
|
&:checked {
|
|
@@ -30,21 +30,26 @@ export const SwitchInput = styled.input.attrs({ type: "checkbox" })`
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&::after {
|
|
33
|
-
content:
|
|
34
|
-
width: ${semanticSizes.global.padding.md};
|
|
35
|
-
height: ${semanticSizes.global.padding.md};
|
|
33
|
+
content: '';
|
|
34
|
+
width: ${semanticSizes.global.padding.md}; // 12px circle
|
|
35
|
+
height: ${semanticSizes.global.padding.md}; // 12px circle
|
|
36
36
|
background: ${semanticColors.base.background};
|
|
37
37
|
border-radius: 50%;
|
|
38
38
|
position: absolute;
|
|
39
39
|
top: 50%;
|
|
40
40
|
left: 4px;
|
|
41
41
|
transform: translateY(-50%);
|
|
42
|
-
transition: all 0.3s ease-
|
|
42
|
+
transition: all 0.3s ease-out;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
&:checked::after {
|
|
46
46
|
left: calc(100% - ${semanticSizes.global.padding.md} - 4px);
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
&:disabled {
|
|
50
|
+
opacity: 0.5;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
48
53
|
`;
|
|
49
54
|
|
|
50
55
|
export const SwitchLabel = styled.span`
|
|
@@ -16,7 +16,7 @@ export const Switch: React.FC<SwitchProps> = ({
|
|
|
16
16
|
return (
|
|
17
17
|
<SwitchWrapper>
|
|
18
18
|
{label && <SwitchLabel>{label}</SwitchLabel>}
|
|
19
|
-
<SwitchInput data-testid={testId} {...props} />
|
|
19
|
+
<SwitchInput data-testid={testId} id={testId} {...props} />
|
|
20
20
|
{text && <SwitchLabel>{text}</SwitchLabel>}
|
|
21
21
|
</SwitchWrapper>
|
|
22
22
|
);
|
|
@@ -15,23 +15,23 @@ export const TextareaWrapper = styled.div`
|
|
|
15
15
|
|
|
16
16
|
export const Label = styled.label`
|
|
17
17
|
font-size: ${typographyTokens.fontSizes.labelS};
|
|
18
|
-
color: ${semanticColors.
|
|
18
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
19
19
|
font-weight: 500;
|
|
20
20
|
`;
|
|
21
21
|
|
|
22
22
|
export const StyledTextarea = styled.textarea`
|
|
23
23
|
display: flex;
|
|
24
|
-
padding: ${semanticSizes.global.padding.
|
|
24
|
+
padding: ${semanticSizes.global.padding.lg};
|
|
25
25
|
font-size: ${typographyTokens.fontSizes.bodyM};
|
|
26
26
|
color: ${semanticColors.base.text};
|
|
27
27
|
background: ${semanticColors.base.background};
|
|
28
|
-
border: 1px solid ${semanticColors.
|
|
28
|
+
border: 1px solid ${semanticColors.global.border.medium};
|
|
29
29
|
border-radius: ${semanticRadius.global.radius.md};
|
|
30
30
|
resize: vertical;
|
|
31
|
-
transition: border-color 0.2s
|
|
31
|
+
transition: border-color 0.2s;
|
|
32
32
|
|
|
33
33
|
&::placeholder {
|
|
34
|
-
color: ${semanticColors.
|
|
34
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
&:focus {
|
|
@@ -41,13 +41,12 @@ export const StyledTextarea = styled.textarea`
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&:disabled {
|
|
44
|
-
color: ${semanticColors.global.
|
|
45
|
-
background-color: ${semanticColors.neutral[200]};
|
|
44
|
+
background-color: ${semanticColors.global.surface.disabled};
|
|
46
45
|
cursor: not-allowed;
|
|
47
46
|
}
|
|
48
47
|
`;
|
|
49
48
|
|
|
50
49
|
export const SupportingText = styled.span`
|
|
51
50
|
font-size: ${typographyTokens.fontSizes.labelS};
|
|
52
|
-
color: ${semanticColors.
|
|
51
|
+
color: ${semanticColors.global.text.subtitle.enabled};
|
|
53
52
|
`;
|
|
@@ -22,7 +22,7 @@ const Textarea: React.FC<TextareaProps> = ({
|
|
|
22
22
|
{info}
|
|
23
23
|
</Label>
|
|
24
24
|
)}
|
|
25
|
-
<StyledTextarea data-testid={testId} {...props} />
|
|
25
|
+
<StyledTextarea data-testid={testId} id={testId} {...props} />
|
|
26
26
|
{supportingText && <SupportingText>{supportingText}</SupportingText>}
|
|
27
27
|
</TextareaWrapper>
|
|
28
28
|
);
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ButtonGroupProps } from
|
|
3
|
-
import Button from
|
|
4
|
-
import { ButtonGroupContainer } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonGroupProps } from './ButtonGroup.types';
|
|
3
|
+
import Button from '../../atoms/Button';
|
|
4
|
+
import { ButtonGroupContainer } from './ButtonGroup.styles';
|
|
5
5
|
|
|
6
6
|
const ButtonGroup: React.FC<ButtonGroupProps> = ({
|
|
7
7
|
buttons,
|
|
8
|
-
orientation =
|
|
8
|
+
orientation = 'horizontal',
|
|
9
9
|
}) => {
|
|
10
10
|
return (
|
|
11
11
|
<ButtonGroupContainer $orientation={orientation}>
|
|
12
12
|
{buttons.map((button, index) => (
|
|
13
|
-
<Button
|
|
13
|
+
<Button
|
|
14
|
+
key={index}
|
|
15
|
+
variant={button.variant}
|
|
16
|
+
onClick={button.onClick}
|
|
17
|
+
leftIcon={button.leftIcon}
|
|
18
|
+
rightIcon={button.rightIcon}
|
|
19
|
+
>
|
|
14
20
|
{button.label}
|
|
15
21
|
</Button>
|
|
16
22
|
))}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
+
// ButtonGroup.types.ts
|
|
2
|
+
|
|
1
3
|
export interface ButtonGroupProps {
|
|
2
4
|
buttons: {
|
|
3
5
|
label: string;
|
|
4
|
-
variant?:
|
|
6
|
+
variant?:
|
|
7
|
+
| "primary"
|
|
8
|
+
| "outline"
|
|
9
|
+
| "danger"
|
|
10
|
+
| "ghost"
|
|
11
|
+
| "alert"
|
|
12
|
+
| "danger-no-fill"
|
|
13
|
+
| "accent-outline"
|
|
14
|
+
| "accent-fill"
|
|
15
|
+
| "secondary-outline"
|
|
16
|
+
| "danger-fill";
|
|
5
17
|
onClick?: () => void;
|
|
18
|
+
leftIcon?: string;
|
|
19
|
+
rightIcon?: string;
|
|
6
20
|
}[];
|
|
7
21
|
orientation?: "horizontal" | "vertical";
|
|
8
|
-
}
|
|
22
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
// Import all components
|
|
3
3
|
import {
|
|
4
4
|
Dialog,
|
|
@@ -13,6 +13,7 @@ import Badge from "./components/atoms/Badge/Badge";
|
|
|
13
13
|
import Breadcrumb from "./components/atoms/Breadcrumb/Breadcrumb";
|
|
14
14
|
import Button from "./components/atoms/Button";
|
|
15
15
|
import { Checkbox } from "./components/atoms/Checkbox/Checkbox";
|
|
16
|
+
import CodeInput from "./components/atoms/CodeInput";
|
|
16
17
|
import Icon from "./components/atoms/Icon";
|
|
17
18
|
import Input from "./components/atoms/Input";
|
|
18
19
|
import { Label } from "./components/atoms/Label/Label";
|
|
@@ -62,6 +63,7 @@ export {
|
|
|
62
63
|
ButtonGroup,
|
|
63
64
|
Calendar,
|
|
64
65
|
Checkbox,
|
|
66
|
+
CodeInput,
|
|
65
67
|
DatePickerInput,
|
|
66
68
|
Dialog,
|
|
67
69
|
DialogContent,
|