@groupeactual/ui-kit 0.1.8 → 0.1.9

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/cjs/index.js CHANGED
@@ -50440,23 +50440,31 @@ var TextInput = function (_a) {
50440
50440
  }, [value]);
50441
50441
  return (jsxRuntime.jsx(TextField$1, __assign$1({ variant: "standard", name: name, label: label, value: internalValue, onClick: function (e) { return e.stopPropagation(); }, InputProps: {
50442
50442
  endAdornment: endAdornment
50443
- }, onChange: function (e) { return setInternalValue(e.currentTarget.value); }, onBlur: function (e) {
50444
- onBlur(e);
50443
+ }, onChange: function (e) {
50444
+ setInternalValue(e.currentTarget.value);
50445
50445
  onChange(e);
50446
+ }, onBlur: function (e) {
50447
+ onBlur(e);
50446
50448
  }, error: !!error, helperText: error !== null && error !== void 0 ? error : '', disabled: disabled }, props)));
50447
50449
  };
50448
50450
 
50449
50451
  var Checkbox = function (_a) {
50450
- var name = _a.name, value = _a.value, label = _a.label, sx = _a.sx;
50452
+ var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange, sx = _a.sx;
50451
50453
  var _b = React.useState(value), internalValue = _b[0], setInternalValue = _b[1];
50452
50454
  React.useEffect(function () {
50453
50455
  if (value !== internalValue) {
50454
50456
  setInternalValue(value);
50455
50457
  }
50456
50458
  }, [value]);
50457
- return (jsxRuntime.jsx(FormControl$1, __assign$1({ fullWidth: true }, { children: jsxRuntime.jsx(FormControlLabel$1, { sx: { display: 'table' }, control: jsxRuntime.jsx(Box$1, __assign$1({ sx: { display: 'table-cell' } }, { children: jsxRuntime.jsx(CheckboxMUI, { name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50458
- setInternalValue(e.target.checked);
50459
- } }) })), label: jsxRuntime.jsx(Typography$1, __assign$1({ sx: sx }, { children: label })) }) })));
50459
+ return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { sx: { display: 'table' }, control: jsxRuntime.jsx(Box$1, __assign$1({ sx: { display: 'table-cell' } }, { children: jsxRuntime.jsx(CheckboxMUI, { name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50460
+ setInternalValue(e.target.checked);
50461
+ onChange(name, e.target.checked, true);
50462
+ } }) })), label: jsxRuntime.jsx(Typography$1, __assign$1({ sx: sx }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
50463
+ marginTop: -1,
50464
+ color: "#B80025",
50465
+ fontWeight: 400,
50466
+ fontSize: "10px"
50467
+ } }, { children: error })))] })));
50460
50468
  };
50461
50469
 
50462
50470
  /******************************************************************************