@mtes-mct/monitor-ui 10.14.1 → 10.14.2

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,5 @@
1
+ ## [10.14.1](https://github.com/MTES-MCT/monitor-ui/compare/v10.14.0...v10.14.1) (2023-12-04)
2
+
1
3
  ## [10.14.0](https://github.com/MTES-MCT/monitor-ui/compare/v10.13.0...v10.14.0) (2023-11-22)
2
4
 
3
5
 
@@ -66,6 +66,10 @@
66
66
  --rs-listbox-option-selected-bg: var(--blue-gray-25);
67
67
  /* tags */
68
68
  --rs-tag-bg: var(--gainsboro);
69
+
70
+ /* toggle */
71
+ --rs-toggle-checked-bg: var(--charcoal);
72
+ --rs-toggle-checked-hover-bg: var(--gunMetal);
69
73
  }
70
74
 
71
75
  label {
@@ -312,13 +316,13 @@ label:hover .rs-checkbox-wrapper .rs-checkbox-inner:before {
312
316
  .rs-radio-wrapper::before,
313
317
  .rs-radio-wrapper .rs-radio-inner::before,
314
318
  .rs-radio-wrapper {
315
- width: 13px;
316
- height: 13px;
319
+ width: 14px;
320
+ height: 14px;
317
321
  }
318
322
 
319
323
  .rs-radio-wrapper .rs-radio-inner::before {
320
324
  background: var(--gainsboro);
321
- border-width: 2.5px;
325
+ border-width: 2px;
322
326
  }
323
327
 
324
328
  .rs-radio-checked .rs-radio-wrapper .rs-radio-inner::before {
@@ -329,10 +333,10 @@ label:hover .rs-checkbox-wrapper .rs-checkbox-inner:before {
329
333
  /* center of radio button when checked */
330
334
  .rs-radio-wrapper .rs-radio-inner::after {
331
335
  background: var(--charcoal);
332
- width: 8px;
333
- height: 8px;
334
- margin-top: 5px;
335
- margin-left: 5px;
336
+ width: 6px;
337
+ height: 6px;
338
+ margin-top: 4px;
339
+ margin-left: 4px;
336
340
  }
337
341
 
338
342
  .rs-radio.rs-radio-disabled .rs-radio-wrapper .rs-radio-inner::after {
@@ -2,8 +2,9 @@ import type { Coordinates } from '../../types';
2
2
  type DDCoordinatesInputProps = {
3
3
  coordinates: Coordinates | undefined;
4
4
  disabled: boolean | undefined;
5
+ isLight: boolean | undefined;
5
6
  onChange: (nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void;
6
7
  };
7
- export declare function DDCoordinatesInput({ coordinates, disabled, onChange }: DDCoordinatesInputProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function DDCoordinatesInput({ coordinates, disabled, isLight, onChange }: DDCoordinatesInputProps): import("react/jsx-runtime").JSX.Element;
8
9
  export {};
9
10
  //# sourceMappingURL=DDCoordinatesInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DDCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DDCoordinatesInput.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;CACvF,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE,uBAAuB,2CAiFtG"}
1
+ {"version":3,"file":"DDCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DDCoordinatesInput.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;CACvF,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,QAAgB,EAChB,OAAe,EACf,QAAQ,EACT,EAAE,uBAAuB,2CAuFzB"}
@@ -4,8 +4,9 @@ type DMDCoordinatesInputProps = {
4
4
  coordinates: Coordinates | undefined;
5
5
  coordinatesFormat: CoordinatesFormat;
6
6
  disabled: boolean | undefined;
7
+ isLight: boolean | undefined;
7
8
  onChange: (nextCoordinates: Coordinates, coordinates: Coordinates | undefined) => void;
8
9
  };
9
- export declare function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled, onChange }: DMDCoordinatesInputProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled, isLight, onChange }: DMDCoordinatesInputProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
11
12
  //# sourceMappingURL=DMDCoordinatesInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DMDCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DMDCoordinatesInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,iBAAiB,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAM9C,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;CACvF,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,QAAQ,EACT,EAAE,wBAAwB,2CAuF1B"}
1
+ {"version":3,"file":"DMDCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DMDCoordinatesInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,iBAAiB,CAAA;AAKrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAM9C,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;CACvF,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,OAAO,EACP,QAAQ,EACT,EAAE,wBAAwB,2CA0F1B"}
@@ -4,8 +4,9 @@ type DMSCoordinatesInputProps = {
4
4
  coordinates: Coordinates | undefined;
5
5
  coordinatesFormat: CoordinatesFormat;
6
6
  disabled: boolean | undefined;
7
+ isLight: boolean | undefined;
7
8
  onChange: (nextCoordinates: Coordinates | undefined, coordinates: Coordinates | undefined) => void;
8
9
  };
9
- export declare function DMSCoordinatesInput({ coordinates, coordinatesFormat, disabled, onChange }: DMSCoordinatesInputProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function DMSCoordinatesInput({ coordinates, coordinatesFormat, disabled, isLight, onChange }: DMSCoordinatesInputProps): import("react/jsx-runtime").JSX.Element;
10
11
  export {};
11
12
  //# sourceMappingURL=DMSCoordinatesInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DMSCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DMSCoordinatesInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,GAAG,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;CACnG,CAAA;AACD,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,QAAQ,EACT,EAAE,wBAAwB,2CAgC1B"}
1
+ {"version":3,"file":"DMSCoordinatesInput.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/DMSCoordinatesInput.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,KAAK,wBAAwB,GAAG;IAC9B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAA;IACpC,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAC5B,QAAQ,EAAE,CAAC,eAAe,EAAE,WAAW,GAAG,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,CAAA;CACnG,CAAA;AACD,wBAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,iBAAiB,EACjB,QAAgB,EAChB,OAAO,EACP,QAAQ,EACT,EAAE,wBAAwB,2CAmC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fields/CoordinatesInput/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EA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,GAAG,aAAa,GAAG;IAClD,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,YAAY,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EACL,CAAC,CAAC,eAAe,EAAE,WAAW,GAAG,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK,UAAU,CAAC,IAAI,CAAC,CAAC,GACtG,SAAS,CAAA;CACd,CAAA;AACD,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,aAAqB,EACrB,OAAe,EACf,KAAK,EACL,QAAe,EACf,GAAG,WAAW,EACf,EAAE,qBAAqB,2CAsDvB"}
package/index.js CHANGED
@@ -59865,7 +59865,7 @@ function isNumeric(val) {
59865
59865
  }
59866
59866
 
59867
59867
  // TODO This field should return undefined when cleared (i.e.: Select all & Backspace/Delete)
59868
- function DDCoordinatesInput({ coordinates, disabled = false, onChange }) {
59868
+ function DDCoordinatesInput({ coordinates, disabled = false, isLight = false, onChange }) {
59869
59869
  const latitudeInputRef = useRef();
59870
59870
  const longitudeInputRef = useRef();
59871
59871
  const [latitudeError, setLatitudeError] = useState('');
@@ -59921,6 +59921,7 @@ function DDCoordinatesInput({ coordinates, disabled = false, onChange }) {
59921
59921
  onChange: ()=>handleChange(coordinates),
59922
59922
  placeholder: "Latitude",
59923
59923
  style: {
59924
+ backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,
59924
59925
  border: latitudeError ? '1px solid red' : undefined
59925
59926
  }
59926
59927
  }),
@@ -59932,6 +59933,7 @@ function DDCoordinatesInput({ coordinates, disabled = false, onChange }) {
59932
59933
  onChange: ()=>handleChange(coordinates),
59933
59934
  placeholder: "Longitude",
59934
59935
  style: {
59936
+ backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,
59935
59937
  border: longitudeError ? '1px solid red' : undefined
59936
59938
  }
59937
59939
  }),
@@ -69438,7 +69440,7 @@ const getPaddedDegrees = (degrees, latitudeOrLongitude)=>{
69438
69440
  // Open issue: https://github.com/uNmAnNeR/imaskjs/issues/761
69439
69441
  const UntypedIMaskInput = IMaskInput;
69440
69442
  // TODO This field should return undefined when cleared (i.e.: Select all & Backspace/Delete)
69441
- function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled = false, onChange }) {
69443
+ function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled = false, isLight, onChange }) {
69442
69444
  const [error, setError] = useState('');
69443
69445
  const [value, setValue] = useState('');
69444
69446
  useEffect(()=>{
@@ -69515,6 +69517,7 @@ function DMDCoordinatesInput({ coordinates, coordinatesFormat, disabled = false,
69515
69517
  placeholder: "__\xb0 __.___′ _ ___\xb0 __.___′",
69516
69518
  radix: ".",
69517
69519
  style: {
69520
+ backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro,
69518
69521
  border: error ? '1px solid red' : undefined
69519
69522
  },
69520
69523
  // TODO Use `defaultValue` here.
@@ -69542,7 +69545,7 @@ const Box$2 = styled.div`
69542
69545
  text-align: left;
69543
69546
  `;
69544
69547
 
69545
- function DMSCoordinatesInput({ coordinates, coordinatesFormat, disabled = false, onChange }) {
69548
+ function DMSCoordinatesInput({ coordinates, coordinatesFormat, disabled = false, isLight, onChange }) {
69546
69549
  /** Convert the coordinates to the [latitude, longitude] string format */ const defaultValue = useMemo(()=>{
69547
69550
  if (!coordinates?.length || !coordinatesFormat) {
69548
69551
  return '';
@@ -69566,6 +69569,9 @@ function DMSCoordinatesInput({ coordinates, coordinatesFormat, disabled = false,
69566
69569
  ddPrecision: 6,
69567
69570
  disabled: disabled,
69568
69571
  onChange: (_, { dd })=>update(dd),
69572
+ style: {
69573
+ backgroundColor: isLight ? THEME.color.white : THEME.color.gainsboro
69574
+ },
69569
69575
  // TODO Use `defaultValue` here.
69570
69576
  value: defaultValue
69571
69577
  }),
@@ -69599,6 +69605,7 @@ function CoordinatesInput({ className, coordinatesFormat, defaultValue, error, i
69599
69605
  coordinates: defaultValue,
69600
69606
  coordinatesFormat: CoordinatesFormat.DEGREES_MINUTES_SECONDS,
69601
69607
  disabled: nativeProps.disabled,
69608
+ isLight: isLight,
69602
69609
  onChange: onChange
69603
69610
  });
69604
69611
  case CoordinatesFormat.DEGREES_MINUTES_DECIMALS:
@@ -69606,12 +69613,14 @@ function CoordinatesInput({ className, coordinatesFormat, defaultValue, error, i
69606
69613
  coordinates: defaultValue,
69607
69614
  coordinatesFormat: CoordinatesFormat.DEGREES_MINUTES_DECIMALS,
69608
69615
  disabled: nativeProps.disabled,
69616
+ isLight: isLight,
69609
69617
  onChange: onChange
69610
69618
  });
69611
69619
  case CoordinatesFormat.DECIMAL_DEGREES:
69612
69620
  return /*#__PURE__*/ jsx(DDCoordinatesInput, {
69613
69621
  coordinates: defaultValue,
69614
69622
  disabled: nativeProps.disabled,
69623
+ isLight: isLight,
69615
69624
  onChange: onChange
69616
69625
  });
69617
69626
  default:
@@ -69621,14 +69630,14 @@ function CoordinatesInput({ className, coordinatesFormat, defaultValue, error, i
69621
69630
  defaultValue,
69622
69631
  nativeProps.disabled,
69623
69632
  onChange,
69624
- coordinatesFormat
69633
+ coordinatesFormat,
69634
+ isLight
69625
69635
  ]);
69626
69636
  // TODO We must add a `handleDisable()` callback here to effectively empty the inputs when disabling this field.
69627
69637
  useFieldUndefineEffect(nativeProps.disabled, onChange /* , handleDisable */ );
69628
69638
  return /*#__PURE__*/ jsxs(StyledFieldset, {
69629
69639
  className: controlledClassName,
69630
69640
  isLegendHidden: isLabelHidden,
69631
- isLight: isLight,
69632
69641
  legend: label,
69633
69642
  ...nativeProps,
69634
69643
  children: [