@mtes-mct/monitor-ui 5.9.2 → 6.0.1
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 +25 -0
- package/components/Dialog/index.d.ts +1 -1
- package/components/SingleTag.d.ts +3 -2
- package/elements/Button.d.ts +1 -1
- package/elements/Field.d.ts +1 -1
- package/elements/FieldError.d.ts +2 -2
- package/elements/Fieldset.d.ts +2 -2
- package/elements/IconBox.d.ts +7 -2
- package/elements/IconButton.d.ts +1 -1
- package/elements/Label.d.ts +2 -2
- package/elements/Legend.d.ts +5 -1
- package/elements/Tag/index.d.ts +1 -1
- package/elements/TagGroup.d.ts +1 -1
- package/fields/Search.d.ts +5 -4
- package/index.js +97 -205
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# [6.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v5.9.2...v6.0.0) (2023-05-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **fields:** fix search component ([8776915](https://github.com/MTES-MCT/monitor-ui/commit/87769151f5152c05810b6849e267d73f9f4eb8d3))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* fix(fields)!: format options and create test e2e ([69b3070](https://github.com/MTES-MCT/monitor-ui/commit/69b3070409a3f5c3aa9063b12bf990d6cb92fa65))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
* - pass option in `onChange` function instead of value
|
|
15
|
+
- rename prop to display search icon
|
|
16
|
+
- replace defaultValue with value
|
|
17
|
+
- add optionValueKey prop
|
|
18
|
+
|
|
19
|
+
## [5.9.2](https://github.com/MTES-MCT/monitor-ui/compare/v5.9.1...v5.9.2) (2023-05-10)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **elements:** delete stop click event propagation in Button & IconButton ([b2d70ad](https://github.com/MTES-MCT/monitor-ui/commit/b2d70adf14ce7780b6ef45ff9bbba0d026ac77ef))
|
|
25
|
+
|
|
1
26
|
## [5.9.1](https://github.com/MTES-MCT/monitor-ui/compare/v5.9.0...v5.9.1) (2023-05-05)
|
|
2
27
|
|
|
3
28
|
|
|
@@ -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;
|
package/elements/Button.d.ts
CHANGED
|
@@ -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>;
|
package/elements/Field.d.ts
CHANGED
|
@@ -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,
|
|
3
|
+
export declare const Field: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FieldProps, keyof FieldProps>;
|
package/elements/FieldError.d.ts
CHANGED
|
@@ -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
|
-
},
|
|
7
|
+
}, keyof HTMLAttributes<HTMLParagraphElement> | "isDisabled">;
|
package/elements/Fieldset.d.ts
CHANGED
|
@@ -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;
|
package/elements/IconBox.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
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,
|
|
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">;
|
package/elements/IconButton.d.ts
CHANGED
|
@@ -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;
|
package/elements/Label.d.ts
CHANGED
|
@@ -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
|
-
},
|
|
11
|
+
}, "disabled" | keyof LabelHTMLAttributes<HTMLLabelElement> | "hasError" | "isHidden">;
|
package/elements/Legend.d.ts
CHANGED
|
@@ -4,4 +4,8 @@ export type LegendProps = HTMLAttributes<HTMLLegendElement> & {
|
|
|
4
4
|
hasError?: boolean | undefined;
|
|
5
5
|
isHidden?: boolean | undefined;
|
|
6
6
|
};
|
|
7
|
-
export declare
|
|
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">;
|
package/elements/Tag/index.d.ts
CHANGED
|
@@ -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;
|
package/elements/TagGroup.d.ts
CHANGED
|
@@ -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,
|
|
3
|
+
export declare const TagGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TagGroupProps, keyof TagGroupProps>;
|
package/fields/Search.d.ts
CHANGED
|
@@ -6,20 +6,21 @@ export type SearchProps<OptionValue extends OptionValueType = string> = Omit<Rsu
|
|
|
6
6
|
MenuItem?: React.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
|
-
defaultValue?: OptionValue | undefined;
|
|
10
9
|
error?: string | undefined;
|
|
11
10
|
isErrorMessageHidden?: boolean | undefined;
|
|
12
11
|
isLabelHidden?: boolean | undefined;
|
|
13
12
|
isLight?: boolean | undefined;
|
|
14
|
-
|
|
13
|
+
isSearchIconVisible?: boolean | undefined;
|
|
15
14
|
label: string;
|
|
16
15
|
name: string;
|
|
17
16
|
onChange?: ((nextValue: OptionValue | undefined) => Promisable<void>) | undefined;
|
|
18
17
|
onQuery?: ((nextQuery: string | undefined) => Promisable<void>) | undefined;
|
|
19
|
-
|
|
18
|
+
optionValueKey?: keyof OptionValue | undefined;
|
|
19
|
+
options?: Option<OptionValue>[];
|
|
20
20
|
queryMap?: ((record: Record<string, any>) => Option<OptionValue>) | undefined;
|
|
21
21
|
queryUrl?: string | undefined;
|
|
22
22
|
/** Duration in milliseconds */
|
|
23
23
|
throttleDuration?: number;
|
|
24
|
+
value?: OptionValue | undefined;
|
|
24
25
|
};
|
|
25
|
-
export declare function Search<OptionValue extends OptionValueType = string>({ baseContainer,
|
|
26
|
+
export declare function Search<OptionValue extends OptionValueType = string>({ baseContainer, className, error, isErrorMessageHidden, isLabelHidden, isLight, isSearchIconVisible, label, MenuItem, onChange, onQuery, options, optionValueKey, queryMap, queryUrl, throttleDuration, value, ...originalProps }: SearchProps<OptionValue>): JSX.Element;
|