@mtes-mct/monitor-ui 16.0.0 → 16.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 +17 -0
- package/components/Banner/index.d.ts +9 -7
- package/components/Banner/index.d.ts.map +1 -1
- package/index.js +15 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [16.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v15.0.1...v16.0.0) (2024-04-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### ⚠ BREAKING CHANGES
|
|
5
|
+
|
|
6
|
+
* **entities:** `isEmailSubscriptionContact` & `isSmsSubscriptionContact` props are added to `ControlUnit.ControlUnitContact`.
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **entities:** add new ControlUnitContact props ([437eb37](https://github.com/MTES-MCT/monitor-ui/commit/437eb37ebd5c5dc531514dcc9bbdafebb87cd987))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Styles
|
|
14
|
+
|
|
15
|
+
* **components:** specify solid border in Message ([78d2f40](https://github.com/MTES-MCT/monitor-ui/commit/78d2f4001cc67b77694ea8ae3d97167e091c5cd8))
|
|
16
|
+
* **elements:** specify solid border in IconButton ([f7deba3](https://github.com/MTES-MCT/monitor-ui/commit/f7deba3abae79bf9f0de6c289b1999fba93fd1d9))
|
|
17
|
+
|
|
1
18
|
## [15.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v15.0.0...v15.0.1) (2024-04-28)
|
|
2
19
|
|
|
3
20
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import { type CSSProperties } from 'styled-components';
|
|
2
3
|
import { Level } from '../../constants';
|
|
3
4
|
export type BannerProps = {
|
|
4
5
|
children: string | ReactNode;
|
|
5
6
|
className?: string | undefined;
|
|
6
7
|
closingDelay?: number;
|
|
7
|
-
isClosable
|
|
8
|
-
isCollapsible
|
|
9
|
-
|
|
8
|
+
isClosable?: boolean | undefined;
|
|
9
|
+
isCollapsible?: boolean | undefined;
|
|
10
|
+
isFixed?: boolean | undefined;
|
|
11
|
+
isHiddenByDefault?: boolean | undefined;
|
|
10
12
|
level: Level;
|
|
13
|
+
style?: CSSProperties | undefined;
|
|
11
14
|
top: string;
|
|
12
|
-
withAutomaticClosing?: boolean;
|
|
15
|
+
withAutomaticClosing?: boolean | undefined;
|
|
13
16
|
};
|
|
14
|
-
declare function Banner({ children, className, closingDelay, isClosable, isCollapsible, isHiddenByDefault, level, top, withAutomaticClosing }: Readonly<BannerProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare namespace Banner {
|
|
17
|
+
export declare function Banner({ children, className, closingDelay, isClosable, isCollapsible, isFixed, isHiddenByDefault, level, style, top, withAutomaticClosing }: Readonly<BannerProps>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare namespace Banner {
|
|
16
19
|
var displayName: string;
|
|
17
20
|
}
|
|
18
|
-
export { Banner };
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Banner/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Banner/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAA;AAChF,OAAe,EAAO,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGnE,OAAO,EAAgB,KAAK,EAAQ,MAAM,iBAAiB,CAAA;AAE3D,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACvC,KAAK,EAAE,KAAK,CAAA;IACZ,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC3C,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,SAAqB,EACrB,YAAmB,EACnB,UAAkB,EAClB,aAAqB,EACrB,OAAe,EACf,iBAAyB,EACzB,KAAK,EACL,KAAK,EACL,GAAG,EACH,oBAA4B,EAC7B,EAAE,QAAQ,CAAC,WAAW,CAAC,2CA4EvB;yBAxFe,MAAM"}
|
package/index.js
CHANGED
|
@@ -53338,7 +53338,7 @@ const PADDING$1 = {
|
|
|
53338
53338
|
// We can't use $-prefixed props here for some reason (maybe because the `as` prop exclude them?).
|
|
53339
53339
|
const StyledButton = styled.button`
|
|
53340
53340
|
align-items: center;
|
|
53341
|
-
border: solid ${(p)=>p.isCompact ? 0 : 1}px
|
|
53341
|
+
border: solid ${(p)=>p.isCompact ? 0 : 1}px;
|
|
53342
53342
|
display: flex;
|
|
53343
53343
|
justify-content: center;
|
|
53344
53344
|
padding: ${(p)=>p.isCompact ? 0 : PADDING$1[p.size]};
|
|
@@ -53765,7 +53765,7 @@ const getBannerPalette = (level)=>{
|
|
|
53765
53765
|
};
|
|
53766
53766
|
};
|
|
53767
53767
|
|
|
53768
|
-
function Banner({ children, className = undefined, closingDelay = 3000, isClosable, isCollapsible, isHiddenByDefault, level, top, withAutomaticClosing = false }) {
|
|
53768
|
+
function Banner({ children, className = undefined, closingDelay = 3000, isClosable = false, isCollapsible = false, isFixed = false, isHiddenByDefault = false, level, style, top, withAutomaticClosing = false }) {
|
|
53769
53769
|
const timeoutIdRef = useRef(undefined);
|
|
53770
53770
|
const controlledClassName = classnames('Component-Banner', className);
|
|
53771
53771
|
const [isHidden, setIsHidden] = useState(!!isHiddenByDefault);
|
|
@@ -53811,12 +53811,14 @@ function Banner({ children, className = undefined, closingDelay = 3000, isClosab
|
|
|
53811
53811
|
return /*#__PURE__*/ jsx(Wrapper, {
|
|
53812
53812
|
$isCollapsed: isCollapsed,
|
|
53813
53813
|
$isCollapsible: isCollapsible,
|
|
53814
|
+
$isFixed: isFixed,
|
|
53814
53815
|
$isHidden: isHidden,
|
|
53815
53816
|
$level: level,
|
|
53816
53817
|
$top: top,
|
|
53817
53818
|
className: controlledClassName,
|
|
53818
53819
|
onMouseEnter: enterHover,
|
|
53819
53820
|
onMouseLeave: leaveHover,
|
|
53821
|
+
style: style,
|
|
53820
53822
|
children: !isHidden && !isCollapsed && /*#__PURE__*/ jsxs(Fragment, {
|
|
53821
53823
|
children: [
|
|
53822
53824
|
/*#__PURE__*/ jsx(ContentWrapper, {
|
|
@@ -53851,30 +53853,30 @@ function Banner({ children, className = undefined, closingDelay = 3000, isClosab
|
|
|
53851
53853
|
});
|
|
53852
53854
|
}
|
|
53853
53855
|
const Wrapper = styled.div`
|
|
53856
|
+
align-items: center;
|
|
53857
|
+
background-color: ${(p)=>getBannerPalette(p.$level).backgroundColor};
|
|
53858
|
+
border-bottom: ${(p)=>p.$isCollapsible ? `4px solid ${getBannerPalette(p.$level).borderColor}` : 'none'};
|
|
53859
|
+
box-shadow: ${(p)=>p.$isCollapsible ? 'none' : '0px 3px 4px #7077854D'};
|
|
53854
53860
|
display: ${(p)=>p.$isHidden ? 'none' : 'flex'};
|
|
53855
53861
|
flex-direction: row;
|
|
53862
|
+
height: ${(p)=>!p.$isHidden && p.$isCollapsed ? '10px' : '50px'};
|
|
53856
53863
|
justify-content: space-between;
|
|
53857
|
-
align-items: center;
|
|
53858
|
-
position: absolute;
|
|
53859
|
-
background-color: ${(p)=>getBannerPalette(p.$level).backgroundColor};
|
|
53860
|
-
width: 100%;
|
|
53861
|
-
min-width: 100%;
|
|
53862
53864
|
max-width: 100%;
|
|
53865
|
+
min-width: 100%;
|
|
53863
53866
|
padding: 0 2rem;
|
|
53867
|
+
position: ${(p)=>p.$isFixed ? 'fixed' : 'absolute'};
|
|
53864
53868
|
top: ${(p)=>`${p.$top}`};
|
|
53865
|
-
z-index: 1000;
|
|
53866
|
-
height: ${(p)=>!p.$isHidden && p.$isCollapsed ? '10px' : '50px'};
|
|
53867
|
-
border-bottom: ${({ $isCollapsible, $level })=>$isCollapsible ? `4px solid ${getBannerPalette($level).borderColor}` : 'none'};
|
|
53868
|
-
box-shadow: ${({ $isCollapsible })=>$isCollapsible ? 'none' : '0px 3px 4px #7077854D'};
|
|
53869
53869
|
transition: height 0.3s ease;
|
|
53870
|
+
width: 100%;
|
|
53871
|
+
z-index: 1000;
|
|
53870
53872
|
`;
|
|
53871
53873
|
const ContentWrapper = styled.div`
|
|
53872
|
-
color: ${(p)=>getBannerPalette(p.$level).color};
|
|
53873
53874
|
align-self: center;
|
|
53875
|
+
color: ${(p)=>getBannerPalette(p.$level).color};
|
|
53874
53876
|
flex-grow: 2;
|
|
53875
|
-
text-align: center;
|
|
53876
53877
|
font-size: 16px;
|
|
53877
53878
|
font-weight: 500;
|
|
53879
|
+
text-align: center;
|
|
53878
53880
|
`;
|
|
53879
53881
|
const ButtonWrapper = styled.div`
|
|
53880
53882
|
align-self: center;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtes-mct/monitor-ui",
|
|
3
3
|
"description": "Common React components, hooks, utilities and CSS stylesheets for MonitorFish, MonitorEnv and RapportNav.",
|
|
4
|
-
"version": "16.
|
|
4
|
+
"version": "16.1.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|