@mtes-mct/monitor-ui 2.14.2 → 2.14.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [2.14.3](https://github.com/MTES-MCT/monitor-ui/compare/v2.14.2...v2.14.3) (2023-02-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **fields:** enforce error margins ([eb69017](https://github.com/MTES-MCT/monitor-ui/commit/eb69017e720bb97a64fac46cd3d35ae18b6b60a5))
7
+
8
+ ## [2.14.2](https://github.com/MTES-MCT/monitor-ui/compare/v2.14.1...v2.14.2) (2023-02-08)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **elements:** make secondary Button background transparent ([7f1e490](https://github.com/MTES-MCT/monitor-ui/commit/7f1e4909d1a075a90de683c603dfc1b7dd586010))
14
+ * **fields:** make MultiZoneEditor row background white when isLight ([96f7a00](https://github.com/MTES-MCT/monitor-ui/commit/96f7a00bd7eab7755de13e8202aa64367e8d7b18))
15
+ * **formiks:** remove touched condition for errors ([91ac524](https://github.com/MTES-MCT/monitor-ui/commit/91ac524d0916390bc5308083390264d018dad980))
16
+
1
17
  ## [2.14.1](https://github.com/MTES-MCT/monitor-ui/compare/v2.14.0...v2.14.1) (2023-02-08)
2
18
 
3
19
 
package/index.js CHANGED
@@ -3278,7 +3278,7 @@ const FieldError = styled.p `
3278
3278
  font-size: 13px;
3279
3279
  font-weight: 700;
3280
3280
  line-height: 1.3846;
3281
- margin-top: 4px;
3281
+ margin: 4px 0 0 0;
3282
3282
  `;
3283
3283
 
3284
3284
  const useClickOutsideEffect = (zoneRefOrzoneRefs, action, baseContainer) => {
@@ -5685,6 +5685,13 @@ function FormikCheckbox({ name, ...originalProps }) {
5685
5685
  const handleChange = useMemo(() => helpers.setValue, []);
5686
5686
  // eslint-disable-next-line react-hooks/exhaustive-deps
5687
5687
  const isDefaultChecked = useMemo(() => Boolean(field.value), []);
5688
+ // A checkbox must initialize its Formik value on mount:
5689
+ // it wouldn't make sense to keep it as `undefined` since `undefined` means `false` in the case of a checkbox
5690
+ useEffect(() => {
5691
+ helpers.setValue(isDefaultChecked);
5692
+ },
5693
+ // eslint-disable-next-line react-hooks/exhaustive-deps
5694
+ []);
5688
5695
  return (jsx(Checkbox, { defaultChecked: isDefaultChecked, error: meta.error, name: name, onChange: handleChange, ...originalProps }));
5689
5696
  }
5690
5697