@mtes-mct/monitor-ui 6.0.0 → 6.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,28 @@
1
+ ## [6.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v6.0.0...v6.0.1) (2023-05-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add missing classnames ([23f83f1](https://github.com/MTES-MCT/monitor-ui/commit/23f83f13a2b909712bf1580e8e9545a314236dbb))
7
+
8
+ # [6.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.9.2...v6.0.0) (2023-05-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **fields:** fix search component ([8776915](https://github.com/MTES-MCT/monitor-ui/commit/87769151f5152c05810b6849e267d73f9f4eb8d3))
14
+
15
+
16
+ * fix(fields)!: format options and create test e2e ([69b3070](https://github.com/MTES-MCT/monitor-ui/commit/69b3070409a3f5c3aa9063b12bf990d6cb92fa65))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * - pass option in `onChange` function instead of value
22
+ - rename prop to display search icon
23
+ - replace defaultValue with value
24
+ - add optionValueKey prop
25
+
1
26
  ## [5.9.2](https://github.com/MTES-MCT/monitor-ui/compare/v5.9.1...v5.9.2) (2023-05-10)
2
27
 
3
28
 
@@ -1,4 +1,4 @@
1
- import { Theme } from './theme';
1
+ import { type Theme } from './theme';
2
2
  import type { PartialDeep } from 'type-fest';
3
3
  export type ThemeProviderProps = {
4
4
  children: any;
@@ -61,10 +61,6 @@
61
61
  /* Checkbox vars */
62
62
  --rs-checkbox-disabled-bg: var(--white);
63
63
 
64
- /* input vars */
65
- --rs-input-bg: var(--gainsboro);
66
- --rs-input-focus-border: var(--blue-gray);
67
-
68
64
  --rs-menuitem-active-text: var(--blue-gray);
69
65
  --rs-listbox-option-hover-bg: var(--blue-yonder-25);
70
66
  --rs-listbox-option-selected-bg: var(--blue-gray-25);
@@ -78,27 +74,6 @@ label {
78
74
  line-height: 18px;
79
75
  }
80
76
 
81
- .rs-input {
82
- border-radius: 0;
83
- color: var(--gunMetal);
84
- }
85
-
86
- .rs-input.ghost {
87
- background-color: var(--white);
88
- }
89
-
90
- .rs-input-group,
91
- .rs-input-group:not(.rs-input-group-inside) .rs-auto-complete:first-child .rs-input,
92
- .rs-input-group:not(.rs-input-group-inside) .rs-form-control-wrapper:first-child > .rs-input,
93
- .rs-input-group:not(.rs-input-group-inside) .rs-picker-date:first-child .rs-picker-toggle,
94
- .rs-input-group:not(.rs-input-group-inside) > :first-child,
95
- .rs-input-group:not(.rs-input-group-inside) .rs-auto-complete:last-child .rs-input,
96
- .rs-input-group:not(.rs-input-group-inside) .rs-form-control-wrapper:last-child > .rs-input,
97
- .rs-input-group:not(.rs-input-group-inside) .rs-picker-date:last-child .rs-picker-toggle,
98
- .rs-input-group:not(.rs-input-group-inside) > :last-child {
99
- border-radius: 0;
100
- }
101
-
102
77
  .rs-picker-toggle-active,
103
78
  .rs-picker.rs-picker-focused {
104
79
  box-shadow: none;
@@ -106,14 +81,6 @@ label {
106
81
  border-radius: 0;
107
82
  }
108
83
 
109
- .rs-input-group-addon.primary {
110
- background-color: var(--rs-btn-primary-bg);
111
- }
112
-
113
- .rs-input-group.rs-input-group-inside .rs-input-group-addon {
114
- padding: 8px 13px 8px 11px;
115
- }
116
-
117
84
  /* button */
118
85
  .rs-ripple-pond {
119
86
  height: 30px;
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes } from 'react';
1
+ import type { HTMLAttributes } from 'react';
2
2
  export type DialogProps = HTMLAttributes<HTMLDivElement> & {
3
3
  isAbsolute?: boolean;
4
4
  };
@@ -8,4 +8,4 @@ export type DropdownProps = Omit<RsuiteDropdownProps, 'as' | 'icon'> & {
8
8
  export declare const Dropdown: FunctionComponent<DropdownProps> & {
9
9
  Item: FunctionComponent<DropdownItemProps>;
10
10
  };
11
- export { DropdownItemProps };
11
+ export { type DropdownItemProps };
@@ -1,4 +1,4 @@
1
- import { PureComponent, ReactNode } from 'react';
1
+ import { PureComponent, type ReactNode } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
3
  export type NewWindowProps = {
4
4
  center?: 'parent' | 'screen' | undefined;
@@ -1,6 +1,7 @@
1
+ import { type HTMLAttributes } from 'react';
1
2
  import type { Promisable } from 'type-fest';
2
- export type SingleTagProps = {
3
+ export type SingleTagProps = HTMLAttributes<HTMLDivElement> & {
3
4
  children: string;
4
5
  onDelete: () => Promisable<void>;
5
6
  };
6
- export declare function SingleTag({ children, onDelete }: SingleTagProps): JSX.Element;
7
+ export declare function SingleTag({ children, className, onDelete, ...nativeProps }: SingleTagProps): JSX.Element;
@@ -8,7 +8,7 @@ export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'childre
8
8
  isFullWidth?: boolean | undefined;
9
9
  size?: Size | undefined;
10
10
  };
11
- export declare function Button({ accent, children, Icon, isFullWidth, size, type, ...nativeProps }: ButtonProps): JSX.Element;
11
+ export declare function Button({ accent, children, className, Icon, isFullWidth, size, type, ...nativeProps }: ButtonProps): JSX.Element;
12
12
  export declare const PrimaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
13
13
  export declare const SecondaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
14
14
  export declare const TertiaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
@@ -1,3 +1,3 @@
1
1
  import type { HTMLAttributes } from 'react';
2
2
  export type FieldProps = HTMLAttributes<HTMLDivElement>;
3
- export declare const Field: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const Field: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FieldProps, keyof FieldProps>;
@@ -2,6 +2,6 @@ import type { HTMLAttributes } from 'react';
2
2
  export type FieldErrorProps = HTMLAttributes<HTMLParagraphElement> & {
3
3
  isDisabled?: boolean | undefined;
4
4
  };
5
- export declare const FieldError: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, {
5
+ export declare const FieldError: import("styled-components").StyledComponent<"p", import("styled-components").DefaultTheme, HTMLAttributes<HTMLParagraphElement> & {
6
6
  isDisabled?: boolean | undefined;
7
- }, never>;
7
+ }, keyof HTMLAttributes<HTMLParagraphElement> | "isDisabled">;
@@ -1,4 +1,4 @@
1
- import { FieldsetHTMLAttributes } from 'react';
1
+ import { type FieldsetHTMLAttributes } from 'react';
2
2
  export type FieldsetProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'defaultValue' | 'onChange' | 'value'> & {
3
3
  hasBorder?: boolean | undefined;
4
4
  hasError?: boolean | undefined;
@@ -6,4 +6,4 @@ export type FieldsetProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, 'd
6
6
  isLight?: boolean | undefined;
7
7
  legend?: string | undefined;
8
8
  };
9
- export declare function Fieldset({ children, hasBorder, hasError, isLegendHidden, isLight, legend, ...nativeProps }: FieldsetProps): JSX.Element;
9
+ export declare function Fieldset({ children, className, hasBorder, hasError, isLegendHidden, isLight, legend, ...nativeProps }: FieldsetProps): JSX.Element;
@@ -1,4 +1,5 @@
1
- export type IconBoxProps = {
1
+ import type { HTMLAttributes } from 'react';
2
+ export type IconBoxProps = HTMLAttributes<HTMLDivElement> & {
2
3
  $color?: string | undefined;
3
4
  /** In pixels */
4
5
  $size?: number | undefined;
@@ -6,4 +7,8 @@ export type IconBoxProps = {
6
7
  /**
7
8
  * Internal component used to wrap SVG icon components
8
9
  */
9
- export declare const IconBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, IconBoxProps, never>;
10
+ export declare const IconBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, HTMLAttributes<HTMLDivElement> & {
11
+ $color?: string | undefined;
12
+ /** In pixels */
13
+ $size?: number | undefined;
14
+ }, keyof HTMLAttributes<HTMLDivElement> | "$color" | "$size">;
@@ -9,4 +9,4 @@ export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'chi
9
9
  iconSize?: number | undefined;
10
10
  size?: Size | undefined;
11
11
  };
12
- export declare function IconButton({ accent, color, Icon, iconSize, size, type, ...nativeProps }: IconButtonProps): JSX.Element;
12
+ export declare function IconButton({ accent, className, color, Icon, iconSize, size, type, ...nativeProps }: IconButtonProps): JSX.Element;
@@ -4,8 +4,8 @@ export type LabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
4
4
  hasError?: boolean | undefined;
5
5
  isHidden?: boolean | undefined;
6
6
  };
7
- export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {
7
+ export declare const Label: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, LabelHTMLAttributes<HTMLLabelElement> & {
8
8
  disabled?: boolean | undefined;
9
9
  hasError?: boolean | undefined;
10
10
  isHidden?: boolean | undefined;
11
- }, never>;
11
+ }, "disabled" | keyof LabelHTMLAttributes<HTMLLabelElement> | "hasError" | "isHidden">;
@@ -4,4 +4,8 @@ export type LegendProps = HTMLAttributes<HTMLLegendElement> & {
4
4
  hasError?: boolean | undefined;
5
5
  isHidden?: boolean | undefined;
6
6
  };
7
- export declare function Legend({ disabled, hasError, isHidden, ...nativeProps }: LegendProps): JSX.Element;
7
+ export declare const Legend: import("styled-components").StyledComponent<"legend", import("styled-components").DefaultTheme, HTMLAttributes<HTMLLegendElement> & {
8
+ disabled?: boolean | undefined;
9
+ hasError?: boolean | undefined;
10
+ isHidden?: boolean | undefined;
11
+ }, "disabled" | keyof HTMLAttributes<HTMLLegendElement> | "hasError" | "isHidden">;
@@ -1,4 +1,4 @@
1
- import { FunctionComponent, HTMLAttributes } from 'react';
1
+ import { type FunctionComponent, type HTMLAttributes } from 'react';
2
2
  import { Accent, TagBullet } from '../../constants';
3
3
  import type { IconProps } from '../../types';
4
4
  export type TagProps = HTMLAttributes<HTMLSpanElement> & {
@@ -8,7 +8,7 @@ export type TagProps = HTMLAttributes<HTMLSpanElement> & {
8
8
  bulletColor?: string | undefined;
9
9
  isLight?: boolean | undefined;
10
10
  };
11
- export declare function Tag({ accent, bullet, bulletColor, children, color, Icon, isLight, ...nativeProps }: TagProps): JSX.Element;
11
+ export declare function Tag({ accent, bullet, bulletColor, children, className, color, Icon, isLight, ...nativeProps }: TagProps): JSX.Element;
12
12
  export declare const PrimaryTag: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
13
13
  $color?: string | undefined;
14
14
  $isLight: boolean;
@@ -1,3 +1,3 @@
1
1
  import type { HTMLAttributes } from 'react';
2
2
  export type TagGroupProps = HTMLAttributes<HTMLDivElement>;
3
- export declare const TagGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const TagGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TagGroupProps, keyof TagGroupProps>;
@@ -1,4 +1,4 @@
1
- import type { InputHTMLAttributes } from 'react';
1
+ import { type InputHTMLAttributes } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
3
  export type NumberInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'maxLength' | 'onInput' | 'pattern' | 'type'> & {
4
4
  isLight: boolean;
@@ -11,4 +11,4 @@ export type NumberInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | '
11
11
  onChange?: ((nextValue: number | undefined) => Promisable<void>) | undefined;
12
12
  value?: number | undefined;
13
13
  };
14
- export declare function NumberInput({ error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, value, ...originalProps }: NumberInputProps): JSX.Element;
14
+ export declare function NumberInput({ className, error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, style, value, ...originalProps }: NumberInputProps): JSX.Element;
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ import { type ElementType } from 'react';
2
2
  import type { Option, OptionValueType } from '../types';
3
3
  import type { AutoCompleteProps as RsuiteAutoCompleteProps } from 'rsuite';
4
4
  import type { Promisable } from 'type-fest';
5
5
  export type SearchProps<OptionValue extends OptionValueType = string> = Omit<RsuiteAutoCompleteProps, 'as' | 'container' | 'data' | 'defaultValue' | 'id' | 'onChange' | 'open' | 'onSelect' | 'value'> & {
6
- MenuItem?: React.ElementType | undefined;
6
+ MenuItem?: ElementType | undefined;
7
7
  /** Used to pass something else than `window.document` as a base container to attach global events listeners. */
8
8
  baseContainer?: Document | HTMLDivElement | null | undefined;
9
9
  error?: string | undefined;
@@ -17,10 +17,6 @@ export type SearchProps<OptionValue extends OptionValueType = string> = Omit<Rsu
17
17
  onQuery?: ((nextQuery: string | undefined) => Promisable<void>) | undefined;
18
18
  optionValueKey?: keyof OptionValue | undefined;
19
19
  options?: Option<OptionValue>[];
20
- queryMap?: ((record: Record<string, any>) => Option<OptionValue>) | undefined;
21
- queryUrl?: string | undefined;
22
- /** Duration in milliseconds */
23
- throttleDuration?: number;
24
20
  value?: OptionValue | undefined;
25
21
  };
26
- export declare function Search<OptionValue extends OptionValueType = string>({ baseContainer, error, isErrorMessageHidden, isLabelHidden, isLight, isSearchIconVisible, label, MenuItem, onChange, onQuery, options, optionValueKey, queryMap, queryUrl, throttleDuration, value, ...originalProps }: SearchProps<OptionValue>): JSX.Element;
22
+ export declare function Search<OptionValue extends OptionValueType = string>({ baseContainer, className, error, isErrorMessageHidden, isLabelHidden, isLight, isSearchIconVisible, label, MenuItem, onChange, onQuery, options, optionValueKey, value, ...originalProps }: SearchProps<OptionValue>): JSX.Element;
@@ -1,6 +1,10 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { Size } from '../constants';
3
+ import type { IconProps } from '../types';
1
4
  import type { InputProps } from 'rsuite';
2
5
  import type { Promisable } from 'type-fest';
3
- export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'onChange' | 'type' | 'value'> & {
6
+ export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'onChange' | 'size' | 'type' | 'value'> & {
7
+ Icon?: FunctionComponent<IconProps> | undefined;
4
8
  error?: string | undefined;
5
9
  isErrorMessageHidden?: boolean | undefined;
6
10
  isLabelHidden?: boolean | undefined;
@@ -9,6 +13,7 @@ export type TextInputProps = Omit<InputProps, 'as' | 'defaultValue' | 'id' | 'on
9
13
  label: string;
10
14
  name: string;
11
15
  onChange?: ((nextValue: string | undefined) => Promisable<void>) | undefined;
16
+ size?: Size | undefined;
12
17
  value?: string | undefined;
13
18
  };
14
- export declare function TextInput({ error, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, value, ...originalProps }: TextInputProps): JSX.Element;
19
+ export declare function TextInput({ className, error, Icon, isErrorMessageHidden, isLabelHidden, isLight, isUndefinedWhenDisabled, label, onChange, size, style, value, ...originalProps }: TextInputProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from '../types';
2
+ export declare function Report({ color, size, ...nativeProps }: IconProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from '../types';
2
+ export declare function Semaphore({ color, size, ...nativeProps }: IconProps): JSX.Element;
package/icons/index.d.ts CHANGED
@@ -50,12 +50,14 @@ import { PinpointHide } from './PinpointHide';
50
50
  import { Plane } from './Plane';
51
51
  import { Plus } from './Plus';
52
52
  import { Reject } from './Reject';
53
+ import { Report } from './Report';
53
54
  import { Save } from './Save';
54
55
  import { Search } from './Search';
55
56
  import { SelectCircle } from './SelectCircle';
56
57
  import { SelectPolygon } from './SelectPolygon';
57
58
  import { SelectRectangle } from './SelectRectangle';
58
59
  import { SelectZone } from './SelectZone';
60
+ import { Semaphore } from './Semaphore';
59
61
  import { ShowErsMessages } from './ShowErsMessages';
60
62
  import { ShowXml } from './ShowXml';
61
63
  import { SortingArrows } from './SortingArrows';
@@ -66,4 +68,4 @@ import { Unlock } from './Unlock';
66
68
  import { Vessel } from './Vessel';
67
69
  import { ViewOnMap } from './ViewOnMap';
68
70
  import { Vms } from './Vms';
69
- export { ActivityFeed, Alert, Anchor, Archive, Attention, Calendar, Check, Chevron, Clock, Close, Confirm, Control, Delete, Display, DoubleChevron, Download, Drapeau, Duplicate, Edit, EditBis, Expand, Favorite, FilledArrow, Filter, FilterBis, Fishery, FishingEngine, FleetSegment, Focus, FocusVessel, FocusZones, Hide, Info, Infringement, Landmark, List, MapLayers, MeasureAngle, MeasureBrokenLine, MeasureCircle, MeasureLine, Minus, MissionAction, More, Note, Observation, Pin, Pinpoint, PinpointHide, Plane, Plus, Reject, Save, Search, SelectCircle, SelectPolygon, SelectRectangle, SelectZone, ShowErsMessages, ShowXml, SortingArrows, Summary, Tag, Target, Unlock, Vessel, ViewOnMap, Vms };
71
+ export { ActivityFeed, Alert, Anchor, Archive, Attention, Calendar, Check, Chevron, Clock, Close, Confirm, Control, Delete, Display, DoubleChevron, Download, Drapeau, Duplicate, Edit, EditBis, Expand, Favorite, FilledArrow, Filter, FilterBis, Fishery, FishingEngine, FleetSegment, Focus, FocusVessel, FocusZones, Hide, Info, Infringement, Landmark, List, MapLayers, MeasureAngle, MeasureBrokenLine, MeasureCircle, MeasureLine, Minus, MissionAction, More, Note, Observation, Pin, Pinpoint, PinpointHide, Plane, Plus, Reject, Report, Save, Search, SelectCircle, SelectPolygon, SelectRectangle, SelectZone, Semaphore, ShowErsMessages, ShowXml, SortingArrows, Summary, Tag, Target, Unlock, Vessel, ViewOnMap, Vms };