@true-engineering/true-react-common-ui-kit 4.0.0-alpha42 → 4.0.0-alpha44
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/components/Checkbox/index.d.ts +1 -0
- package/dist/components/RadioButton/RadioButton.d.ts +3 -1
- package/dist/components/RadioButton/RadioButton.styles.d.ts +2 -1
- package/dist/components/RadioButton/index.d.ts +1 -0
- package/dist/components/RadioButton/types.d.ts +3 -0
- package/dist/true-react-common-ui-kit.js +3 -3
- package/dist/true-react-common-ui-kit.js.map +1 -1
- package/dist/true-react-common-ui-kit.umd.cjs +3 -3
- package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/RadioButton/RadioButton.stories.tsx +13 -0
- package/src/components/RadioButton/RadioButton.styles.ts +2 -1
- package/src/components/RadioButton/RadioButton.tsx +12 -5
- package/src/components/RadioButton/index.ts +1 -0
- package/src/components/RadioButton/types.ts +4 -0
- package/src/components/TextButton/TextButton.stories.tsx +1 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ICommonProps } from '../../types';
|
|
3
|
+
import { IRadioButtonSize } from './types';
|
|
3
4
|
import { IRadioButtonStyles } from './RadioButton.styles';
|
|
4
5
|
export interface IRadioButtonProps<Value extends string> extends ICommonProps<IRadioButtonStyles> {
|
|
5
6
|
children?: ReactNode;
|
|
6
7
|
value: Value;
|
|
7
8
|
groupName: string;
|
|
9
|
+
size?: IRadioButtonSize;
|
|
8
10
|
isChecked?: boolean;
|
|
9
11
|
/** @default false */
|
|
10
12
|
isDisabled?: boolean;
|
|
@@ -12,4 +14,4 @@ export interface IRadioButtonProps<Value extends string> extends ICommonProps<IR
|
|
|
12
14
|
isInvalid?: boolean;
|
|
13
15
|
onChange: (value: Value) => void | Promise<void>;
|
|
14
16
|
}
|
|
15
|
-
export declare function RadioButton<Value extends string>({ children, value, groupName, isChecked, isDisabled, isInvalid, data, testId, tweakStyles, onChange, }: IRadioButtonProps<Value>): JSX.Element;
|
|
17
|
+
export declare function RadioButton<Value extends string>({ children, value, groupName, size, isChecked, isDisabled, isInvalid, data, testId, tweakStyles, onChange, }: IRadioButtonProps<Value>): JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ITweakStyles } from '../../theme';
|
|
2
|
+
import { IRadioButtonSizes } from './types';
|
|
2
3
|
export declare const useStyles: import("../../theme").IUseStyles<"content" | "input" | "isDisabled" | "label" | "isInvalid", unknown>;
|
|
3
|
-
export type IRadioButtonStyles = ITweakStyles<typeof useStyles>;
|
|
4
|
+
export type IRadioButtonStyles = ITweakStyles<typeof useStyles, IRadioButtonSizes>;
|
|
@@ -28689,15 +28689,15 @@ function _object_spread_props$c(target, source) {
|
|
|
28689
28689
|
return target;
|
|
28690
28690
|
}
|
|
28691
28691
|
function RadioButton(param) {
|
|
28692
|
-
var children = param.children, value = param.value, groupName = param.groupName, isChecked = param.isChecked, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, onChange = param.onChange;
|
|
28692
|
+
var children = param.children, value = param.value, groupName = param.groupName, size2 = param.size, isChecked = param.isChecked, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isInvalid = param.isInvalid, isInvalid = _param_isInvalid === void 0 ? false : _param_isInvalid, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, onChange = param.onChange;
|
|
28693
28693
|
var classes = useStyles$8({
|
|
28694
28694
|
theme: tweakStyles
|
|
28695
28695
|
});
|
|
28696
28696
|
var _obj2;
|
|
28697
28697
|
return /* @__PURE__ */ jsxs("label", _object_spread_props$c(_object_spread$c({
|
|
28698
|
-
className: clsx(classes.label,
|
|
28698
|
+
className: clsx(classes.label, isNotEmpty(size2) && classes[size2], _define_property$c({}, classes.isDisabled, isDisabled)),
|
|
28699
28699
|
htmlFor: "".concat(groupName, "--").concat(value)
|
|
28700
|
-
},
|
|
28700
|
+
}, addDataAttributes$1(data, testId)), {
|
|
28701
28701
|
children: [
|
|
28702
28702
|
/* @__PURE__ */ jsx("input", {
|
|
28703
28703
|
id: "".concat(groupName, "--").concat(value),
|