@bitrise/bitkit 9.39.0-alpha-form.1 → 9.39.0
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.stories.tsx +12 -2
- package/src/Components/Form/Checkbox/Checkbox.tsx +9 -3
- package/src/Components/Form/Radio/Radio.stories.tsx +12 -2
- package/src/Components/Form/Radio/Radio.theme.ts +10 -5
- package/src/Components/Form/Radio/Radio.tsx +7 -1
- package/src/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -22,8 +22,18 @@ WithProps.args = {
|
|
|
22
22
|
|
|
23
23
|
export const InGroup: ComponentStory<typeof CheckboxGroup> = (props) => (
|
|
24
24
|
<CheckboxGroup {...props} display="flex" gap="24">
|
|
25
|
-
<Checkbox value="1">
|
|
26
|
-
|
|
25
|
+
<Checkbox value="1">
|
|
26
|
+
Checkbox 1<br />
|
|
27
|
+
asddssadsda
|
|
28
|
+
</Checkbox>
|
|
29
|
+
<Checkbox
|
|
30
|
+
value="2"
|
|
31
|
+
inputProps={{
|
|
32
|
+
'data-testid': 'test-checkbox-2',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
Checkbox 2
|
|
36
|
+
</Checkbox>
|
|
27
37
|
<Checkbox value="3">Checkbox 3</Checkbox>
|
|
28
38
|
</CheckboxGroup>
|
|
29
39
|
);
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { Checkbox as ChakraCheckbox, CheckboxProps as ChakraCheckboxProps, forwardRef } from '@chakra-ui/react';
|
|
2
2
|
import Icon from '../../Icon/Icon';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type CheckboxInputProps = ChakraCheckboxProps['inputProps'] & {
|
|
5
|
+
'data-testid': string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export interface CheckboxProps extends Omit<ChakraCheckboxProps, 'icon' | 'iconColor' | 'iconSize' | 'inputProps'> {
|
|
9
|
+
inputProps?: CheckboxInputProps;
|
|
10
|
+
}
|
|
5
11
|
|
|
6
|
-
const CustomIcon = (props:
|
|
12
|
+
const CustomIcon = (props: any) => {
|
|
7
13
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
8
14
|
const { __css, isChecked, isIndeterminate } = props;
|
|
9
15
|
if (!isChecked) {
|
|
@@ -16,7 +22,7 @@ const CustomIcon = (props: CheckboxProps) => {
|
|
|
16
22
|
* Checkbox component is used in forms when a user needs to select multiple values from several options.
|
|
17
23
|
*/
|
|
18
24
|
const Checkbox = forwardRef<CheckboxProps, 'input'>((props, ref) => {
|
|
19
|
-
return <ChakraCheckbox icon={<CustomIcon />} {...props} ref={ref} />;
|
|
25
|
+
return <ChakraCheckbox alignItems="flex-start" icon={<CustomIcon />} {...props} ref={ref} />;
|
|
20
26
|
});
|
|
21
27
|
|
|
22
28
|
export default Checkbox;
|
|
@@ -13,8 +13,18 @@ export default {
|
|
|
13
13
|
|
|
14
14
|
export const InGroup: ComponentStory<typeof RadioGroup> = (props) => (
|
|
15
15
|
<RadioGroup {...props} display="flex" gap="24">
|
|
16
|
-
<Radio value="1">
|
|
17
|
-
|
|
16
|
+
<Radio value="1">
|
|
17
|
+
Radio 1<br />
|
|
18
|
+
asdasddsa
|
|
19
|
+
</Radio>
|
|
20
|
+
<Radio
|
|
21
|
+
value="2"
|
|
22
|
+
inputProps={{
|
|
23
|
+
'data-testid': 'test-radio-2',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
Radio 2
|
|
27
|
+
</Radio>
|
|
18
28
|
<Radio value="3">Radio 3</Radio>
|
|
19
29
|
</RadioGroup>
|
|
20
30
|
);
|
|
@@ -6,6 +6,7 @@ const RadioTheme: ComponentStyleConfig = {
|
|
|
6
6
|
color: 'neutral.100',
|
|
7
7
|
},
|
|
8
8
|
container: {
|
|
9
|
+
alignItems: 'flex-start',
|
|
9
10
|
_disabled: {
|
|
10
11
|
cursor: 'not-allowed',
|
|
11
12
|
':hover > span:first-of-type': {
|
|
@@ -23,13 +24,17 @@ const RadioTheme: ComponentStyleConfig = {
|
|
|
23
24
|
borderColor: 'neutral.90',
|
|
24
25
|
borderRadius: '12',
|
|
25
26
|
boxShadow: 'inner',
|
|
27
|
+
_before: {
|
|
28
|
+
content: `""`,
|
|
29
|
+
display: 'inline-block',
|
|
30
|
+
width: '12',
|
|
31
|
+
height: '12',
|
|
32
|
+
borderRadius: '50%',
|
|
33
|
+
backgroundColor: 'transparent',
|
|
34
|
+
transitionDuration: '200ms',
|
|
35
|
+
},
|
|
26
36
|
_checked: {
|
|
27
37
|
_before: {
|
|
28
|
-
content: `""`,
|
|
29
|
-
display: 'inline-block',
|
|
30
|
-
width: '12',
|
|
31
|
-
height: '12',
|
|
32
|
-
borderRadius: '50%',
|
|
33
38
|
backgroundColor: 'purple.40',
|
|
34
39
|
},
|
|
35
40
|
},
|
|
@@ -1,6 +1,12 @@
|
|
|
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': string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export interface RadioProps extends Omit<ChakraRadioProps, 'inputProps'> {
|
|
8
|
+
inputProps?: RadioInputProps;
|
|
9
|
+
}
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Radios are used when only one choice may be selected in a series of options.
|