@mtes-mct/monitor-ui 16.1.0 → 16.2.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,18 @@
1
+ ## [16.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v16.0.0...v16.1.0) (2024-04-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * **components:** add isFixed prop to Banner ([4830f91](https://github.com/MTES-MCT/monitor-ui/commit/4830f913fcde74b6d5c7520423ef5bb46d1b6305))
7
+ * **components:** make isClosable, isCollapsible & isHiddenByDefault Banner props optional ([bbf07db](https://github.com/MTES-MCT/monitor-ui/commit/bbf07db7d7e2054ff37f4c40b439346f47d6363e))
8
+ * **components:** make style prop transparent in Banner ([30beabd](https://github.com/MTES-MCT/monitor-ui/commit/30beabdb52a5119b86fc2efdfdb14223f6223360))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **components:** remove position typo in Banner ([17143e1](https://github.com/MTES-MCT/monitor-ui/commit/17143e1e54004f9b2b7bf863f287c67d7c5b54d7))
14
+ * **elements:** fix non-transparent border in tertiary IconButton ([a4ce7b4](https://github.com/MTES-MCT/monitor-ui/commit/a4ce7b4a7c0dd731e035c0631f3196d06ea9d242))
15
+
1
16
  ## [16.0.0](https://github.com/MTES-MCT/monitor-ui/compare/v15.0.1...v16.0.0) (2024-04-28)
2
17
 
3
18
 
@@ -1,6 +1,7 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import { type CSSProperties } from 'styled-components';
3
3
  import { Level } from '../../constants';
4
+ import type { Promisable } from 'type-fest';
4
5
  export type BannerProps = {
5
6
  children: string | ReactNode;
6
7
  className?: string | undefined;
@@ -10,11 +11,12 @@ export type BannerProps = {
10
11
  isFixed?: boolean | undefined;
11
12
  isHiddenByDefault?: boolean | undefined;
12
13
  level: Level;
14
+ onAutoClose?: (() => Promisable<void>) | undefined;
13
15
  style?: CSSProperties | undefined;
14
16
  top: string;
15
17
  withAutomaticClosing?: boolean | undefined;
16
18
  };
17
- export declare function Banner({ children, className, closingDelay, isClosable, isCollapsible, isFixed, isHiddenByDefault, level, style, top, withAutomaticClosing }: Readonly<BannerProps>): import("react/jsx-runtime").JSX.Element;
19
+ export declare function Banner({ children, className, closingDelay, isClosable, isCollapsible, isFixed, isHiddenByDefault, level, onAutoClose, style, top, withAutomaticClosing }: Readonly<BannerProps>): import("react/jsx-runtime").JSX.Element;
18
20
  export declare namespace Banner {
19
21
  var displayName: string;
20
22
  }
@@ -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;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,E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2CA6EvB;yBA1Fe,MAAM"}
package/index.js CHANGED
@@ -53765,7 +53765,7 @@ const getBannerPalette = (level)=>{
53765
53765
  };
53766
53766
  };
53767
53767
 
53768
- function Banner({ children, className = undefined, closingDelay = 3000, isClosable = false, isCollapsible = false, isFixed = false, isHiddenByDefault = false, level, style, top, withAutomaticClosing = false }) {
53768
+ function Banner({ children, className = undefined, closingDelay = 3000, isClosable = false, isCollapsible = false, isFixed = false, isHiddenByDefault = false, level, onAutoClose, 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);
@@ -53799,6 +53799,7 @@ function Banner({ children, className = undefined, closingDelay = 3000, isClosab
53799
53799
  if (withAutomaticClosing) {
53800
53800
  const timeoutId = setTimeout(()=>{
53801
53801
  onClickAction();
53802
+ onAutoClose?.();
53802
53803
  }, closingDelay);
53803
53804
  timeoutIdRef.current = timeoutId;
53804
53805
  }
@@ -53806,6 +53807,7 @@ function Banner({ children, className = undefined, closingDelay = 3000, isClosab
53806
53807
  }, [
53807
53808
  closingDelay,
53808
53809
  onClickAction,
53810
+ onAutoClose,
53809
53811
  withAutomaticClosing
53810
53812
  ]);
53811
53813
  return /*#__PURE__*/ jsx(Wrapper, {
@@ -53861,6 +53863,7 @@ const Wrapper = styled.div`
53861
53863
  flex-direction: row;
53862
53864
  height: ${(p)=>!p.$isHidden && p.$isCollapsed ? '10px' : '50px'};
53863
53865
  justify-content: space-between;
53866
+ left: 0;
53864
53867
  max-width: 100%;
53865
53868
  min-width: 100%;
53866
53869
  padding: 0 2rem;
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.1.0",
4
+ "version": "16.2.0",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {