@trafilea/afrodita-components 5.0.0-beta.284 → 5.0.0-beta.286
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/build/index.d.ts +1 -1
- package/build/index.esm.js +6 -21
- package/build/index.esm.js.map +1 -1
- package/build/index.js +6 -21
- package/build/index.js.map +1 -1
- package/build/theme/truekind.theme.js +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -2022,7 +2022,7 @@ interface CheckboxProps {
|
|
|
2022
2022
|
backgroundColor?: string;
|
|
2023
2023
|
variant: 'primary' | 'secondary' | 'color';
|
|
2024
2024
|
}
|
|
2025
|
-
declare const Checkbox:
|
|
2025
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
|
2026
2026
|
|
|
2027
2027
|
interface RadioProps$1 {
|
|
2028
2028
|
name: string;
|
package/build/index.esm.js
CHANGED
|
@@ -4773,29 +4773,14 @@ var Input$5 = newStyled.input(templateObject_2$12 || (templateObject_2$12 = __ma
|
|
|
4773
4773
|
var Checkbox = function (_a) {
|
|
4774
4774
|
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, text = _a.text, _d = _a.checked, checked = _d === void 0 ? false : _d, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck, backgroundColor = _a.backgroundColor;
|
|
4775
4775
|
var theme = useTheme();
|
|
4776
|
-
var
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
if (disabled || (isChecked && blockUncheck)) {
|
|
4780
|
-
return;
|
|
4781
|
-
}
|
|
4782
|
-
setIsChecked(function (checked) { return !checked; });
|
|
4783
|
-
}, [blockUncheck, disabled, isChecked]);
|
|
4784
|
-
useEffect(function () {
|
|
4785
|
-
if (disabled || !mounted.current) {
|
|
4776
|
+
var handleChange = function (e) {
|
|
4777
|
+
if (disabled || (e.target.checked === false && blockUncheck)) {
|
|
4778
|
+
e.preventDefault();
|
|
4786
4779
|
return;
|
|
4787
4780
|
}
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
}, [isChecked, onChange, disabled, checked]);
|
|
4792
|
-
useEffect(function () {
|
|
4793
|
-
setIsChecked(checked);
|
|
4794
|
-
}, [checked]);
|
|
4795
|
-
useEffect(function () {
|
|
4796
|
-
mounted.current = true;
|
|
4797
|
-
}, []);
|
|
4798
|
-
return (jsxs$1(Container$13, { children: [jsx$1(Input$5, { type: "checkbox", checked: isChecked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: isChecked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, text: text }, { children: isChecked && jsx$1(Icon.Actions.Check, { fill: "#fff" }, void 0) }), void 0), jsx$1(Label$4, __assign$1({ "data-testid": "checkbox-text", size: size, variant: isChecked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
|
|
4781
|
+
onChange(e.target.checked);
|
|
4782
|
+
};
|
|
4783
|
+
return (jsxs$1(Container$13, { children: [jsx$1(Input$5, { type: "checkbox", checked: checked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsx$1(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: checked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, text: text }, { children: checked && jsx$1(Icon.Actions.Check, { fill: "#fff" }, void 0) }), void 0), jsx$1(Label$4, __assign$1({ "data-testid": "checkbox-text", size: size, variant: checked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
|
|
4799
4784
|
};
|
|
4800
4785
|
var templateObject_1$1z, templateObject_2$12;
|
|
4801
4786
|
|