@mtes-mct/monitor-ui 3.0.0 → 3.1.0

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,26 @@
1
+ ## [3.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v3.0.0...v3.0.1) (2023-02-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **formiks:** remove useMemo on fieldValue ([3ec8602](https://github.com/MTES-MCT/monitor-ui/commit/3ec86027dbcaf0f0faa4e92ad05d86a134e6c575))
7
+
8
+ # [3.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v2.19.2...v3.0.0) (2023-02-21)
9
+
10
+
11
+ * feat(fields)!: add disabled, error & label props to CoordinatesInput ([556de36](https://github.com/MTES-MCT/monitor-ui/commit/556de362cbaf0250523ea710f2d753712a13cf21))
12
+
13
+
14
+ ### Features
15
+
16
+ * **formiks:** add FormikCoordinatesInput ([89d5455](https://github.com/MTES-MCT/monitor-ui/commit/89d54554ce6a6f90b608b0d8c37a089f4b934b99))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * CoordinatesInput onChange can now send undefined params
22
+ * label is now mandatory in CoordinatesInput
23
+
1
24
  ## [2.19.2](https://github.com/MTES-MCT/monitor-ui/compare/v2.19.1...v2.19.2) (2023-02-20)
2
25
 
3
26
 
package/index.js CHANGED
@@ -2803,18 +2803,19 @@ const Disk = styled.span `
2803
2803
  border-radius: 50%;
2804
2804
  `;
2805
2805
 
2806
- function Tag({ accent, bullet, children, color, Icon, isLight = false, ...nativeProps }) {
2806
+ function Tag({ accent, bullet, bulletColor, children, color, Icon, isLight = false, ...nativeProps }) {
2807
2807
  const commonChildren = useMemo(() => {
2808
2808
  const defaultColor = color || THEME.color.gunMetal;
2809
- const bulletColor = accent
2810
- ? {
2811
- [Accent.PRIMARY]: THEME.color.gunMetal,
2812
- [Accent.SECONDARY]: THEME.color.gunMetal,
2813
- [Accent.TERTIARY]: THEME.color.white
2814
- }[accent]
2815
- : defaultColor;
2816
- return (jsxs(Fragment, { children: [Icon && jsx(Icon, { size: 1 }), bullet === TagBullet.DISK && jsx(Disk, { "$color": bulletColor }), children] }));
2817
- }, [accent, bullet, color, children, Icon]);
2809
+ const controlledBulletColor = bulletColor ||
2810
+ (accent
2811
+ ? {
2812
+ [Accent.PRIMARY]: THEME.color.gunMetal,
2813
+ [Accent.SECONDARY]: THEME.color.gunMetal,
2814
+ [Accent.TERTIARY]: THEME.color.white
2815
+ }[accent]
2816
+ : defaultColor);
2817
+ return (jsxs(Fragment, { children: [Icon && jsx(Icon, { size: 1 }), bullet === TagBullet.DISK && jsx(Disk, { "$color": controlledBulletColor }), children] }));
2818
+ }, [accent, bullet, bulletColor, color, children, Icon]);
2818
2819
  const commonProps = useMemo(() => ({
2819
2820
  $isLight: isLight,
2820
2821
  children: commonChildren,
@@ -16046,10 +16047,8 @@ function FormikMultiCheckbox({ name, ...originalProps }) {
16046
16047
  function FormikMultiSelect({ name, ...originalProps }) {
16047
16048
  const [field, meta, helpers] = useField(name);
16048
16049
  // eslint-disable-next-line react-hooks/exhaustive-deps
16049
- const defaultValue = useMemo(() => field.value, []);
16050
- // eslint-disable-next-line react-hooks/exhaustive-deps
16051
16050
  const handleChange = useMemo(() => helpers.setValue, []);
16052
- return (jsx(MultiSelect, { defaultValue: defaultValue, error: meta.error, name: name, onChange: handleChange, ...originalProps }));
16051
+ return (jsx(MultiSelect, { defaultValue: field.value, error: meta.error, name: name, onChange: handleChange, ...originalProps }));
16053
16052
  }
16054
16053
 
16055
16054
  function FormikMultiRadio({ name, ...originalProps }) {