@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/cjs/index.js CHANGED
@@ -50478,17 +50478,21 @@ var TextField = function (_a) {
50478
50478
  };
50479
50479
 
50480
50480
  var Checkbox = function (_a) {
50481
- var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange, sx = _a.sx;
50481
+ var name = _a.name, value = _a.value, error = _a.error, label = _a.label, onChange = _a.onChange, props = __rest(_a, ["name", "value", "error", "label", "onChange"]);
50482
50482
  var _b = React.useState(value), internalValue = _b[0], setInternalValue = _b[1];
50483
50483
  React.useEffect(function () {
50484
50484
  if (value !== internalValue) {
50485
50485
  setInternalValue(value);
50486
50486
  }
50487
50487
  }, [value]);
50488
- return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { sx: { display: 'table' }, control: jsxRuntime.jsx(Box$3, __assign$1({ sx: { display: 'table-cell' } }, { children: jsxRuntime.jsx(CheckboxMUI, { name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50488
+ return (jsxRuntime.jsxs(FormControl$1, __assign$1({ fullWidth: true }, { children: [jsxRuntime.jsx(FormControlLabel$1, { control: jsxRuntime.jsx(Box$3, { children: jsxRuntime.jsx(CheckboxMUI, __assign$1({ name: name, sx: { marginTop: -0.5 }, checked: internalValue, color: "primary", onChange: function (e) {
50489
50489
  setInternalValue(e.target.checked);
50490
50490
  onChange(name, e.target.checked, true);
50491
- } }) })), label: jsxRuntime.jsx(Typography$1, __assign$1({ sx: sx }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
50491
+ } }, props)) }), label: jsxRuntime.jsx(Typography$1, __assign$1({ component: "span", sx: {
50492
+ fontSize: '14px',
50493
+ fontWeight: 400,
50494
+ color: error ? '#B80025' : '#000'
50495
+ } }, { children: label })) }), error && (jsxRuntime.jsx(Typography$1, __assign$1({ sx: {
50492
50496
  marginTop: -1,
50493
50497
  color: '#B80025',
50494
50498
  fontWeight: 400,
@@ -51046,23 +51050,33 @@ var ButtonCss = function (muiTokens) {
51046
51050
  border: '1px solid'
51047
51051
  },
51048
51052
  primary: {
51049
- color: muiTokens.palette.white,
51050
- backgroundColor: muiTokens.palette.blueClickable,
51051
- borderColor: muiTokens.palette.blueClickable,
51053
+ color: muiTokens.palette.white + ' !important',
51054
+ backgroundColor: muiTokens.palette.blueClickable + ' !important',
51055
+ border: '1px solid' + ' !important',
51056
+ borderColor: muiTokens.palette.blueClickable + ' !important',
51052
51057
  '&.Mui-disabled': {
51053
- backgroundColor: muiTokens.palette.greyMediumInactive,
51054
- borderColor: muiTokens.palette.greyMediumInactive,
51055
- color: muiTokens.palette.white
51058
+ backgroundColor: muiTokens.palette.greyMediumInactive + ' !important',
51059
+ borderColor: muiTokens.palette.greyMediumInactive + ' !important',
51060
+ color: muiTokens.palette.white + ' !important'
51061
+ },
51062
+ '&:hover': {
51063
+ backgroundColor: muiTokens.palette.blueHoverClickable + ' !important',
51064
+ borderColor: muiTokens.palette.blueHoverClickable + ' !important'
51056
51065
  }
51057
51066
  },
51058
51067
  secondary: {
51059
51068
  color: muiTokens.palette.blueClickable,
51060
51069
  backgroundColor: muiTokens.palette.white,
51070
+ border: '1px solid',
51061
51071
  borderColor: muiTokens.palette.greyLightDefaultborder,
51062
51072
  '&.Mui-disabled': {
51063
51073
  backgroundColor: muiTokens.palette.white,
51064
- borderColor: muiTokens.palette.greyLightDefaultborder,
51065
- color: muiTokens.palette.greyMediumInactive
51074
+ borderColor: muiTokens.palette.greyLightDefaultborder + ' !important',
51075
+ color: muiTokens.palette.greyMediumInactive + ' !important'
51076
+ },
51077
+ '&:hover': {
51078
+ borderColor: muiTokens.palette.greyDark + ' !important',
51079
+ backgroundColor: muiTokens.palette.white + ' !important'
51066
51080
  }
51067
51081
  }
51068
51082
  }