@bitrise/bitkit 10.21.0 → 10.23.0-alpha-chakra.1
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/Form/Checkbox/Checkbox.tsx +1 -1
- package/src/Components/Form/Form.theme.ts +1 -0
- package/src/Components/Form/Radio/Radio.tsx +1 -1
- package/src/Components/Form/Textarea/Textarea.stories.tsx +1 -1
- package/src/Components/Form/Textarea/Textarea.test.tsx +35 -0
- package/src/Components/Form/Textarea/Textarea.theme.ts +5 -1
- package/src/Components/Form/Textarea/Textarea.tsx +21 -8
- package/src/Components/Select/Select.stories.tsx +7 -0
- package/src/Components/Select/Select.tsx +65 -19
- package/src/Components/Table/Table.stories.tsx +8 -1
- package/src/Components/Table/Table.theme.ts +1 -3
- package/src/Components/Table/Tr.tsx +27 -8
- package/src/Components/Toggle/Toggle.stories.tsx +2 -1
- package/src/Components/Toggle/Toggle.theme.ts +3 -1
- package/src/Components/Toggle/Toggle.tsx +23 -8
- package/src/Foundations/Shadows/Shadows.ts +1 -0
- package/src/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { Checkbox as ChakraCheckbox, CheckboxProps as ChakraCheckboxProps, forwa
|
|
|
2
2
|
import Icon from '../../Icon/Icon';
|
|
3
3
|
|
|
4
4
|
type CheckboxInputProps = ChakraCheckboxProps['inputProps'] & {
|
|
5
|
-
'data-testid'
|
|
5
|
+
'data-testid'?: string;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
export interface CheckboxProps extends Omit<ChakraCheckboxProps, 'icon' | 'iconColor' | 'iconSize' | 'inputProps'> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Radio as ChakraRadio, RadioProps as ChakraRadioProps, forwardRef } from '@chakra-ui/react';
|
|
2
2
|
|
|
3
3
|
type RadioInputProps = ChakraRadioProps['inputProps'] & {
|
|
4
|
-
'data-testid'
|
|
4
|
+
'data-testid'?: string;
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export interface RadioProps extends Omit<ChakraRadioProps, 'inputProps'> {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { useForm } from 'react-hook-form';
|
|
4
|
+
import Textarea from './Textarea';
|
|
5
|
+
|
|
6
|
+
describe('Textarea', () => {
|
|
7
|
+
it('forwards data-testid', async () => {
|
|
8
|
+
render(<Textarea data-testid="testid" />);
|
|
9
|
+
const elem = await screen.findByTestId('testid');
|
|
10
|
+
expect(elem.tagName).toBe('TEXTAREA');
|
|
11
|
+
expect(elem).toBeInTheDocument();
|
|
12
|
+
});
|
|
13
|
+
describe('react-hook-form support', () => {
|
|
14
|
+
it('sends data when submitted', async () => {
|
|
15
|
+
const handler = jest.fn();
|
|
16
|
+
const TestComponent = () => {
|
|
17
|
+
const { register, handleSubmit } = useForm();
|
|
18
|
+
return (
|
|
19
|
+
<form onSubmit={handleSubmit((data) => handler(data))}>
|
|
20
|
+
<Textarea {...register('textarea')} />
|
|
21
|
+
<button type="submit">Send</button>
|
|
22
|
+
</form>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
render(<TestComponent />);
|
|
26
|
+
const submit = await screen.findByRole('button', { name: 'Send' });
|
|
27
|
+
const textarea = await screen.findByRole('textbox');
|
|
28
|
+
await userEvent.type(textarea, 'test');
|
|
29
|
+
await userEvent.click(submit);
|
|
30
|
+
|
|
31
|
+
expect(handler).toHaveBeenCalledWith({ textarea: 'test' });
|
|
32
|
+
expect(handler).toHaveBeenCalledTimes(1);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -14,12 +14,16 @@ const TextareaTheme: ComponentStyleConfig = {
|
|
|
14
14
|
appearance: 'none',
|
|
15
15
|
lineHeight: 'short',
|
|
16
16
|
verticalAlign: 'top',
|
|
17
|
+
transition: '100ms',
|
|
18
|
+
_placeholder: {
|
|
19
|
+
fontStyle: 'italic',
|
|
20
|
+
},
|
|
17
21
|
_disabled: {
|
|
18
22
|
background: 'neutral.93',
|
|
19
23
|
cursor: 'not-allowed',
|
|
20
24
|
},
|
|
21
25
|
_focusVisible: {
|
|
22
|
-
boxShadow: '
|
|
26
|
+
boxShadow: 'formFocus',
|
|
23
27
|
},
|
|
24
28
|
_invalid: {
|
|
25
29
|
color: 'red.50',
|
|
@@ -10,13 +10,15 @@ import {
|
|
|
10
10
|
forwardRef,
|
|
11
11
|
} from '@chakra-ui/react';
|
|
12
12
|
|
|
13
|
-
export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onChange'> {
|
|
14
|
-
|
|
13
|
+
export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onChange' | 'onBlur'> {
|
|
14
|
+
'data-testid'?: string;
|
|
15
15
|
errorText?: string;
|
|
16
16
|
isLoading?: boolean;
|
|
17
|
-
|
|
17
|
+
helperText?: string;
|
|
18
18
|
label?: ReactNode;
|
|
19
|
+
name?: string;
|
|
19
20
|
onChange?: ChakraTextareaProps['onChange'];
|
|
21
|
+
onBlur?: ChakraTextareaProps['onBlur'];
|
|
20
22
|
value?: ChakraTextareaProps['value'];
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -25,30 +27,41 @@ export interface TextareaProps extends Omit<FormControlProps, 'label' | 'onChang
|
|
|
25
27
|
*/
|
|
26
28
|
const Textarea = forwardRef<TextareaProps, 'div'>((props, ref) => {
|
|
27
29
|
const {
|
|
28
|
-
dataTestid,
|
|
30
|
+
'data-testid': dataTestid,
|
|
29
31
|
errorText,
|
|
30
|
-
|
|
32
|
+
helperText,
|
|
31
33
|
isDisabled,
|
|
32
34
|
isInvalid,
|
|
33
35
|
isLoading,
|
|
34
36
|
label,
|
|
35
37
|
placeholder,
|
|
36
38
|
onChange,
|
|
39
|
+
onBlur,
|
|
40
|
+
name,
|
|
37
41
|
value,
|
|
38
42
|
...rest
|
|
39
43
|
} = props;
|
|
44
|
+
const formControlProps = {
|
|
45
|
+
display: label || errorText || helperText ? 'block' : 'inline-block',
|
|
46
|
+
isDisabled: isDisabled || isLoading,
|
|
47
|
+
isInvalid: isInvalid || !!errorText,
|
|
48
|
+
...rest,
|
|
49
|
+
ref,
|
|
50
|
+
};
|
|
40
51
|
const textareaProps = {
|
|
41
|
-
dataTestid,
|
|
52
|
+
'data-testid': dataTestid,
|
|
42
53
|
onChange,
|
|
54
|
+
onBlur,
|
|
55
|
+
name,
|
|
43
56
|
placeholder,
|
|
44
57
|
value,
|
|
45
58
|
};
|
|
46
59
|
return (
|
|
47
|
-
<FormControl
|
|
60
|
+
<FormControl {...formControlProps}>
|
|
48
61
|
{label && <FormLabel>{label}</FormLabel>}
|
|
49
62
|
<ChakraTextarea {...textareaProps} />
|
|
50
63
|
{errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
|
|
51
|
-
{
|
|
64
|
+
{helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
|
|
52
65
|
</FormControl>
|
|
53
66
|
);
|
|
54
67
|
});
|
|
@@ -6,6 +6,13 @@ import Select from './Select';
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Select',
|
|
8
8
|
component: Select,
|
|
9
|
+
args: {
|
|
10
|
+
isLoading: false,
|
|
11
|
+
errorText: 'Error text',
|
|
12
|
+
helperText: 'Helpher text',
|
|
13
|
+
label: 'Label',
|
|
14
|
+
name: 'Name',
|
|
15
|
+
},
|
|
9
16
|
argTypes: {
|
|
10
17
|
onChange: {
|
|
11
18
|
action: 'onChange event',
|
|
@@ -1,41 +1,87 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
FormControl,
|
|
4
|
+
FormControlProps,
|
|
5
|
+
FormErrorMessage,
|
|
6
|
+
FormHelperText,
|
|
7
|
+
FormLabel,
|
|
8
|
+
forwardRef,
|
|
9
|
+
Select as ChakraSelect,
|
|
10
|
+
SelectProps as ChakraSelectProps,
|
|
11
|
+
Spinner,
|
|
12
|
+
} from '@chakra-ui/react';
|
|
2
13
|
import Icon from '../Icon/Icon';
|
|
3
14
|
|
|
4
|
-
export interface SelectProps extends
|
|
5
|
-
|
|
15
|
+
export interface SelectProps extends Omit<FormControlProps, 'label' | 'onChange'> {
|
|
16
|
+
'data-testid'?: string;
|
|
17
|
+
errorText?: string;
|
|
18
|
+
helperText?: string;
|
|
6
19
|
isLoading?: boolean;
|
|
20
|
+
label?: ReactNode;
|
|
21
|
+
name?: string;
|
|
22
|
+
onChange?: ChakraSelectProps['onChange'];
|
|
23
|
+
size?: 'small' | 'medium';
|
|
24
|
+
value?: ChakraSelectProps['value'];
|
|
7
25
|
}
|
|
8
26
|
|
|
9
|
-
const Select = forwardRef<SelectProps, '
|
|
10
|
-
const {
|
|
27
|
+
const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
|
|
28
|
+
const {
|
|
29
|
+
children,
|
|
30
|
+
'data-testid': dataTestid,
|
|
31
|
+
errorText,
|
|
32
|
+
helperText,
|
|
33
|
+
isDisabled,
|
|
34
|
+
isInvalid,
|
|
35
|
+
isLoading,
|
|
36
|
+
label,
|
|
37
|
+
name,
|
|
38
|
+
onChange,
|
|
39
|
+
placeholder,
|
|
40
|
+
size,
|
|
41
|
+
value,
|
|
42
|
+
...rest
|
|
43
|
+
} = props;
|
|
11
44
|
const iconSize = size === 'medium' ? '24' : '16';
|
|
12
|
-
const
|
|
45
|
+
const formControlProps = {
|
|
46
|
+
display: label || errorText || helperText ? 'block' : 'inline-block',
|
|
47
|
+
isDisabled: isDisabled || isLoading,
|
|
48
|
+
isInvalid: isInvalid || !!errorText,
|
|
49
|
+
...rest,
|
|
50
|
+
ref,
|
|
51
|
+
};
|
|
52
|
+
const selectProperties: ChakraSelectProps = {
|
|
13
53
|
icon: isLoading ? (
|
|
14
54
|
<Spinner width={iconSize} height={iconSize} marginEnd="4" />
|
|
15
55
|
) : (
|
|
16
56
|
<Icon name="DropdownArrows" fontSize={iconSize} size={iconSize} />
|
|
17
57
|
),
|
|
18
|
-
|
|
58
|
+
name,
|
|
59
|
+
onChange,
|
|
19
60
|
size,
|
|
61
|
+
value,
|
|
20
62
|
variant: 'select',
|
|
21
|
-
...rest,
|
|
22
63
|
};
|
|
23
64
|
if (placeholder) {
|
|
24
|
-
if ('value' in
|
|
25
|
-
|
|
65
|
+
if ('value' in selectProperties) {
|
|
66
|
+
selectProperties.value = selectProperties.value || '';
|
|
26
67
|
} else {
|
|
27
|
-
|
|
68
|
+
selectProperties.defaultValue = '';
|
|
28
69
|
}
|
|
29
70
|
}
|
|
30
71
|
return (
|
|
31
|
-
<
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
72
|
+
<FormControl {...formControlProps}>
|
|
73
|
+
{label && <FormLabel>{label}</FormLabel>}
|
|
74
|
+
<ChakraSelect data-testid={dataTestid} ref={ref} {...selectProperties}>
|
|
75
|
+
{placeholder && (
|
|
76
|
+
<option hidden disabled value="">
|
|
77
|
+
{placeholder}
|
|
78
|
+
</option>
|
|
79
|
+
)}
|
|
80
|
+
{children}
|
|
81
|
+
</ChakraSelect>
|
|
82
|
+
{errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
|
|
83
|
+
{helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
|
|
84
|
+
</FormControl>
|
|
39
85
|
);
|
|
40
86
|
});
|
|
41
87
|
|
|
@@ -132,13 +132,14 @@ ExpandableRows.args = {
|
|
|
132
132
|
<TableCaption description="Click on a row">Expandable rows</TableCaption>
|
|
133
133
|
<Thead>
|
|
134
134
|
<Tr>
|
|
135
|
+
<Th />
|
|
135
136
|
<Th colSpan={2}>ID</Th>
|
|
136
137
|
<Th>Status</Th>
|
|
137
138
|
<Th>Time</Th>
|
|
138
139
|
</Tr>
|
|
139
140
|
</Thead>
|
|
140
141
|
<Tbody>
|
|
141
|
-
<Tr expandableContent={<Box paddingY="12">😎</Box>}>
|
|
142
|
+
<Tr expandableContent={<Box paddingY="12">😎</Box>} defaultIsExpanded>
|
|
142
143
|
<Td>f6963af857c8f2fe</Td>
|
|
143
144
|
<Td>Success</Td>
|
|
144
145
|
<Td>May 29, 2022 10:11:32am</Td>
|
|
@@ -148,6 +149,12 @@ ExpandableRows.args = {
|
|
|
148
149
|
<Td>Aborted</Td>
|
|
149
150
|
<Td>May 29, 2022 9:12:50am</Td>
|
|
150
151
|
</Tr>
|
|
152
|
+
<Tr>
|
|
153
|
+
<Td />
|
|
154
|
+
<Td>f6963af857c8f2fe</Td>
|
|
155
|
+
<Td>Failed</Td>
|
|
156
|
+
<Td>May 29, 2022 10:11:32am</Td>
|
|
157
|
+
</Tr>
|
|
151
158
|
</Tbody>
|
|
152
159
|
</>
|
|
153
160
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Children, ReactNode } from 'react';
|
|
1
|
+
import { Children, ReactNode, useCallback } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Collapse,
|
|
4
4
|
Tr as ChakraTr,
|
|
@@ -10,19 +10,33 @@ import {
|
|
|
10
10
|
import IconButton from '../IconButton/IconButton';
|
|
11
11
|
import Td from './Td';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
expandableContent?: ReactNode | undefined;
|
|
13
|
+
type RowProps = ChakraTableRowProps & {
|
|
15
14
|
/**
|
|
16
15
|
* @deprecated - Please use it only when really necessary, we are working on a new table-like components with clickable items
|
|
17
16
|
*/
|
|
18
17
|
onClick?: ChakraTableRowProps['onClick'];
|
|
19
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type NonExpandableProps = ChakraTableRowProps & {
|
|
21
|
+
expandableContent?: never;
|
|
22
|
+
defaultIsExpanded?: never;
|
|
23
|
+
onExpandedChanged?: never;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type ExpandableProps = ChakraTableRowProps & {
|
|
27
|
+
expandableContent: ReactNode | undefined;
|
|
28
|
+
defaultIsExpanded?: boolean;
|
|
29
|
+
onExpandedChanged?(isExpanded: boolean): void;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type TableRowProps = RowProps & (NonExpandableProps | ExpandableProps);
|
|
20
33
|
|
|
21
34
|
const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
|
|
22
|
-
const {
|
|
35
|
+
const { children, defaultIsExpanded, onExpandedChanged, expandableContent, onClick, ...rest } = props;
|
|
36
|
+
|
|
37
|
+
const { isOpen, onToggle } = useDisclosure({ defaultIsOpen: defaultIsExpanded });
|
|
23
38
|
const css = useTableStyles();
|
|
24
39
|
|
|
25
|
-
const { children, expandableContent, onClick, ...rest } = props;
|
|
26
40
|
const properties: ChakraTableRowProps = {
|
|
27
41
|
onClick,
|
|
28
42
|
...rest,
|
|
@@ -32,7 +46,12 @@ const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
|
|
|
32
46
|
properties.sx = css.clickableTr;
|
|
33
47
|
}
|
|
34
48
|
|
|
35
|
-
|
|
49
|
+
const onToggleClick = useCallback(() => {
|
|
50
|
+
const nextOpen = !isOpen;
|
|
51
|
+
onToggle();
|
|
52
|
+
onExpandedChanged?.(nextOpen);
|
|
53
|
+
}, [isOpen, onToggle, onExpandedChanged]);
|
|
54
|
+
|
|
36
55
|
if (expandableContent) {
|
|
37
56
|
const colSpan = Children.count(children) + 1;
|
|
38
57
|
return (
|
|
@@ -42,7 +61,7 @@ const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
|
|
|
42
61
|
<IconButton
|
|
43
62
|
iconName="ChevronDown"
|
|
44
63
|
aria-label="Toggle current row"
|
|
45
|
-
onClick={
|
|
64
|
+
onClick={onToggleClick}
|
|
46
65
|
size="small"
|
|
47
66
|
variant="tertiary"
|
|
48
67
|
sx={{
|
|
@@ -9,7 +9,8 @@ export default {
|
|
|
9
9
|
export const WithProps = {
|
|
10
10
|
args: {
|
|
11
11
|
defaultChecked: false,
|
|
12
|
-
|
|
12
|
+
errorText: '',
|
|
13
|
+
helperText:
|
|
13
14
|
'Inline help. Maecenas a turpis tortor. Nunc vitae libero tempor, ullamcorper purus quis, mattis tellus.',
|
|
14
15
|
isDisabled: false,
|
|
15
16
|
isLoading: false,
|
|
@@ -2,7 +2,7 @@ import type { ComponentStyleConfig } from '@chakra-ui/theme';
|
|
|
2
2
|
|
|
3
3
|
const ToggleTheme: ComponentStyleConfig = {
|
|
4
4
|
baseStyle: {
|
|
5
|
-
|
|
5
|
+
labelWrapper: {
|
|
6
6
|
display: 'flex',
|
|
7
7
|
gap: '8',
|
|
8
8
|
},
|
|
@@ -61,7 +61,9 @@ const ToggleTheme: ComponentStyleConfig = {
|
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
label: {
|
|
64
|
+
fontSize: '3',
|
|
64
65
|
fontWeight: 'normal',
|
|
66
|
+
lineHeight: '3',
|
|
65
67
|
marginBottom: 0,
|
|
66
68
|
},
|
|
67
69
|
spinner: {
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
FormControl,
|
|
4
4
|
FormControlProps,
|
|
5
|
+
FormErrorMessage,
|
|
5
6
|
FormHelperText,
|
|
6
7
|
FormLabel,
|
|
7
8
|
Spinner,
|
|
@@ -13,14 +14,16 @@ import {
|
|
|
13
14
|
import Box from '../Box/Box';
|
|
14
15
|
|
|
15
16
|
export interface ToggleProps extends Omit<FormControlProps, 'label'> {
|
|
16
|
-
|
|
17
|
+
'data-testid'?: string;
|
|
17
18
|
defaultChecked?: SwitchProps['defaultChecked'];
|
|
19
|
+
errorText?: string;
|
|
18
20
|
id?: SwitchProps['id'];
|
|
19
21
|
isChecked?: SwitchProps['isChecked'];
|
|
20
22
|
isDisabled?: SwitchProps['isDisabled'];
|
|
21
23
|
isLoading?: boolean;
|
|
22
|
-
|
|
24
|
+
helperText?: string;
|
|
23
25
|
label?: ReactNode;
|
|
26
|
+
name?: string;
|
|
24
27
|
onChange?: SwitchProps['onChange'];
|
|
25
28
|
value?: SwitchProps['value'];
|
|
26
29
|
}
|
|
@@ -30,31 +33,42 @@ export interface ToggleProps extends Omit<FormControlProps, 'label'> {
|
|
|
30
33
|
*/
|
|
31
34
|
const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
32
35
|
const {
|
|
33
|
-
dataTestid,
|
|
36
|
+
'data-testid': dataTestid,
|
|
34
37
|
defaultChecked,
|
|
35
|
-
|
|
38
|
+
errorText,
|
|
39
|
+
helperText,
|
|
36
40
|
id,
|
|
37
41
|
isChecked,
|
|
42
|
+
isInvalid,
|
|
38
43
|
isDisabled,
|
|
39
44
|
isLoading,
|
|
40
45
|
label,
|
|
46
|
+
name,
|
|
41
47
|
onChange,
|
|
42
48
|
value,
|
|
43
49
|
...rest
|
|
44
50
|
} = props;
|
|
51
|
+
const formControlProps = {
|
|
52
|
+
display: label || errorText || helperText ? 'block' : 'inline-block',
|
|
53
|
+
isDisabled: isDisabled || isLoading,
|
|
54
|
+
isInvalid: isInvalid || !!errorText,
|
|
55
|
+
...rest,
|
|
56
|
+
ref,
|
|
57
|
+
};
|
|
45
58
|
const switchProps = {
|
|
46
|
-
dataTestid,
|
|
59
|
+
'data-testid': dataTestid,
|
|
47
60
|
defaultChecked,
|
|
48
61
|
id,
|
|
49
62
|
isChecked,
|
|
50
63
|
isDisabled: isDisabled || isLoading,
|
|
64
|
+
name,
|
|
51
65
|
onChange,
|
|
52
66
|
value,
|
|
53
67
|
};
|
|
54
68
|
const css = useMultiStyleConfig('Switch');
|
|
55
69
|
return (
|
|
56
|
-
<FormControl {...
|
|
57
|
-
<Box sx={css.
|
|
70
|
+
<FormControl {...formControlProps}>
|
|
71
|
+
<Box sx={css.labelWrapper}>
|
|
58
72
|
<Switch {...switchProps} />
|
|
59
73
|
{label && (
|
|
60
74
|
<FormLabel htmlFor={id} sx={css.label}>
|
|
@@ -63,7 +77,8 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
63
77
|
)}
|
|
64
78
|
{isLoading && <Spinner sx={css.spinner} />}
|
|
65
79
|
</Box>
|
|
66
|
-
{
|
|
80
|
+
{errorText && <FormErrorMessage as="p">{errorText}</FormErrorMessage>}
|
|
81
|
+
{helperText && <FormHelperText as="p">{helperText}</FormHelperText>}
|
|
67
82
|
</FormControl>
|
|
68
83
|
);
|
|
69
84
|
});
|
|
@@ -5,6 +5,7 @@ const shadows = {
|
|
|
5
5
|
inner: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset',
|
|
6
6
|
outline: '0 0 0 3px #C289E6',
|
|
7
7
|
tooltip: '0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.2)',
|
|
8
|
+
formFocus: '0 0.125rem 0.1875rem 0 rgba(0, 0, 0, 0.1) inset, 0 0 0 3px rgba(146, 71, 194, 0.3)',
|
|
8
9
|
none: 'none',
|
|
9
10
|
};
|
|
10
11
|
|