@groupeactual/ui-kit 0.4.11 → 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,
@@ -50920,7 +50924,16 @@ var getMuiPalette = function (themeName) {
50920
50924
  palette[colorKey] = tokens[colorName];
50921
50925
  }
50922
50926
  });
50927
+ // add primary // blueClickable
50928
+ // add secondary // redActual
50923
50929
  var defaultPalette = {
50930
+ primary: {
50931
+ main: palette['blueClickable'],
50932
+ dark: palette['blueHoverClickable']
50933
+ },
50934
+ secondary: {
50935
+ main: palette['redActual']
50936
+ },
50924
50937
  success: {
50925
50938
  main: palette['greenSuccess']
50926
50939
  },
@@ -51037,23 +51050,33 @@ var ButtonCss = function (muiTokens) {
51037
51050
  border: '1px solid'
51038
51051
  },
51039
51052
  primary: {
51040
- color: muiTokens.palette.white,
51041
- backgroundColor: muiTokens.palette.blueClickable,
51042
- 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',
51043
51057
  '&.Mui-disabled': {
51044
- backgroundColor: muiTokens.palette.greyMediumInactive,
51045
- borderColor: muiTokens.palette.greyMediumInactive,
51046
- 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'
51047
51065
  }
51048
51066
  },
51049
51067
  secondary: {
51050
51068
  color: muiTokens.palette.blueClickable,
51051
51069
  backgroundColor: muiTokens.palette.white,
51070
+ border: '1px solid',
51052
51071
  borderColor: muiTokens.palette.greyLightDefaultborder,
51053
51072
  '&.Mui-disabled': {
51054
51073
  backgroundColor: muiTokens.palette.white,
51055
- borderColor: muiTokens.palette.greyLightDefaultborder,
51056
- 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'
51057
51080
  }
51058
51081
  }
51059
51082
  }