@groupeactual/ui-kit 0.4.12 → 0.4.13

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.
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { SxProps, Theme } from '@mui/system';
2
+ import { CheckboxProps } from '@mui/material/Checkbox';
3
3
  interface Props {
4
- error?: string;
5
- label: string;
6
- value: boolean;
7
4
  name: string;
5
+ value: boolean;
6
+ label: string;
8
7
  onChange: (field: string, value: any, shouldValidate?: boolean | undefined) => void;
9
- sx: SxProps<Theme>;
8
+ error?: string;
10
9
  }
11
- declare const Checkbox: ({ name, value, error, label, onChange, sx }: Props) => JSX.Element;
10
+ declare const Checkbox: ({ name, value, error, label, onChange, ...props }: CheckboxProps & Props) => JSX.Element;
12
11
  export default Checkbox;
package/dist/esm/index.js CHANGED
@@ -50452,17 +50452,21 @@ var TextField = function (_a) {
50452
50452
  };
50453
50453
 
50454
50454
  var Checkbox = function (_a) {
50455
- var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange, sx = _a.sx;
50455
+ var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange, props = __rest(_a, ["name", "value", "error", "label", "onChange"]);
50456
50456
  var _b = useState(value), internalValue = _b[0], setInternalValue = _b[1];
50457
50457
  useEffect(function () {
50458
50458
  if (value !== internalValue) {
50459
50459
  setInternalValue(value);
50460
50460
  }
50461
50461
  }, [value]);
50462
- return (jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsx(FormControlLabel$1, { sx: { display: 'table' }, control: jsx(Box$3, __assign$1({ sx: { display: 'table-cell' } }, { children: jsx(CheckboxMUI, { name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50462
+ return (jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsx(FormControlLabel$1, { control: jsx(Box$3, { children: jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50463
50463
  setInternalValue(e.target.checked);
50464
50464
  onChange(name, e.target.checked, true);
50465
- } }) })), label: jsx(Typography$1, __assign$1({ sx: sx }, { children: label })) }), error && (jsx(Typography$1, __assign$1({ sx: {
50465
+ } }, props)) }), label: jsx(Typography$1, __assign$1({ component: "span", sx: {
50466
+ fontSize: '14px',
50467
+ fontWeight: 400,
50468
+ color: error ? '#B80025' : '#000'
50469
+ } }, { children: label })) }), error && (jsx(Typography$1, __assign$1({ sx: {
50466
50470
  marginTop: -1,
50467
50471
  color: '#B80025',
50468
50472
  fontWeight: 400,
@@ -51020,23 +51024,33 @@ var ButtonCss = function (muiTokens) {
51020
51024
  border: '1px solid'
51021
51025
  },
51022
51026
  primary: {
51023
- color: muiTokens.palette.white,
51024
- backgroundColor: muiTokens.palette.blueClickable,
51025
- borderColor: muiTokens.palette.blueClickable,
51027
+ color: muiTokens.palette.white + ' !important',
51028
+ backgroundColor: muiTokens.palette.blueClickable + ' !important',
51029
+ border: '1px solid' + ' !important',
51030
+ borderColor: muiTokens.palette.blueClickable + ' !important',
51026
51031
  '&.Mui-disabled': {
51027
- backgroundColor: muiTokens.palette.greyMediumInactive,
51028
- borderColor: muiTokens.palette.greyMediumInactive,
51029
- color: muiTokens.palette.white
51032
+ backgroundColor: muiTokens.palette.greyMediumInactive + ' !important',
51033
+ borderColor: muiTokens.palette.greyMediumInactive + ' !important',
51034
+ color: muiTokens.palette.white + ' !important'
51035
+ },
51036
+ '&:hover': {
51037
+ backgroundColor: muiTokens.palette.blueHoverClickable + ' !important',
51038
+ borderColor: muiTokens.palette.blueHoverClickable + ' !important'
51030
51039
  }
51031
51040
  },
51032
51041
  secondary: {
51033
51042
  color: muiTokens.palette.blueClickable,
51034
51043
  backgroundColor: muiTokens.palette.white,
51044
+ border: '1px solid',
51035
51045
  borderColor: muiTokens.palette.greyLightDefaultborder,
51036
51046
  '&.Mui-disabled': {
51037
51047
  backgroundColor: muiTokens.palette.white,
51038
- borderColor: muiTokens.palette.greyLightDefaultborder,
51039
- color: muiTokens.palette.greyMediumInactive
51048
+ borderColor: muiTokens.palette.greyLightDefaultborder + ' !important',
51049
+ color: muiTokens.palette.greyMediumInactive + ' !important'
51050
+ },
51051
+ '&:hover': {
51052
+ borderColor: muiTokens.palette.greyDark + ' !important',
51053
+ backgroundColor: muiTokens.palette.white + ' !important'
51040
51054
  }
51041
51055
  }
51042
51056
  }