@jetbrains/ring-ui 7.0.109 → 7.0.110
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.
|
@@ -6,6 +6,7 @@ export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
6
6
|
export declare const RadioContext: import("react").Context<RadioProps>;
|
|
7
7
|
export interface RadioItemInnerProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
8
8
|
help?: ReactNode;
|
|
9
|
+
containerDataTest?: string | null | undefined;
|
|
9
10
|
}
|
|
10
11
|
export declare class RadioItemInner extends Component<RadioItemInnerProps> {
|
|
11
12
|
uid: string;
|
|
@@ -2,6 +2,7 @@ import { Component, createContext, forwardRef } from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import getUID from '../global/get-uid';
|
|
4
4
|
import ControlHelp from '../control-help/control-help';
|
|
5
|
+
import dataTests from '../global/data-tests';
|
|
5
6
|
import styles from './radio.css';
|
|
6
7
|
export const RadioContext = createContext({});
|
|
7
8
|
export class RadioItemInner extends Component {
|
|
@@ -15,9 +16,9 @@ export class RadioItemInner extends Component {
|
|
|
15
16
|
this.label = el;
|
|
16
17
|
};
|
|
17
18
|
render() {
|
|
18
|
-
const { className, children, help, ...restProps } = this.props;
|
|
19
|
+
const { className, children, help, containerDataTest, ...restProps } = this.props;
|
|
19
20
|
const classes = classNames(styles.radio, className);
|
|
20
|
-
return (<label ref={this.labelRef} className={classes} htmlFor={this.uid}>
|
|
21
|
+
return (<label ref={this.labelRef} className={classes} htmlFor={this.uid} data-test={dataTests('ring-radio-item', containerDataTest)}>
|
|
21
22
|
<input id={this.uid} {...restProps} ref={this.inputRef} className={styles.input} type='radio'/>
|
|
22
23
|
<span className={styles.circle}/>
|
|
23
24
|
<span className={styles.label}>
|