@mtes-mct/monitor-ui 23.1.1 → 23.1.3

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,41 @@
1
+ ## [23.1.2](https://github.com/MTES-MCT/monitor-ui/compare/v23.1.1...v23.1.2) (2024-09-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **fields:** handle id with special chars in Select pointer-events hack ([271e475](https://github.com/MTES-MCT/monitor-ui/commit/271e475b33fa570269925b6127f6c035be86aa60))
7
+
8
+
9
+ ### Code Refactoring
10
+
11
+ * **components:** simplify stylesheets injection in NewWindow ([9ca5417](https://github.com/MTES-MCT/monitor-ui/commit/9ca54179c8a4bda6e3504cd87b9c923a5b154c99))
12
+
13
+ ## [23.1.1](https://github.com/MTES-MCT/monitor-ui/compare/v23.1.0...v23.1.1) (2024-09-26)
14
+
15
+
16
+ ### Styles
17
+
18
+ * **elements:** fix close button size in SingleTag ([ff8a1b5](https://github.com/MTES-MCT/monitor-ui/commit/ff8a1b5f7bf2ba4b05d791ea038a9b25dde41665))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **fields:** add debounce ([79b19fb](https://github.com/MTES-MCT/monitor-ui/commit/79b19fb37eae38612feab4328021d4d233775844))
24
+ * **fields:** apply review comment ([8e864da](https://github.com/MTES-MCT/monitor-ui/commit/8e864da6d96b7b211200bfe01eabba0c1283a675))
25
+ * **fields:** fix pointer-events ([13d1955](https://github.com/MTES-MCT/monitor-ui/commit/13d195566a61c99e9aae297f201dce4c425cfbc9))
26
+ * **fields:** handle undefined min/max prop in DateRangePicker number inputs ([8e10304](https://github.com/MTES-MCT/monitor-ui/commit/8e10304f20266839f7c727c686f0ad1038f8b0a9))
27
+ * **fields:** memoize list props ([54c4d3f](https://github.com/MTES-MCT/monitor-ui/commit/54c4d3f2090a6f470362dc85bdde45e9f26cb944))
28
+ * **fields:** set default listProps value to empty object in Select ([88ce94f](https://github.com/MTES-MCT/monitor-ui/commit/88ce94feff3c509c771586013f98be1a1cba5def))
29
+
30
+
31
+ ### Buid System & Dependencies
32
+
33
+ * **dev-deps:** bump rollup from 4.21.2 to 4.22.4 ([4684626](https://github.com/MTES-MCT/monitor-ui/commit/4684626b83cc16ab102c46ed4891fcfe0cde7ff2))
34
+ * **dev-deps:** bump the non-major-dev-dependencies group across 1 directory with 23 updates ([491a8c6](https://github.com/MTES-MCT/monitor-ui/commit/491a8c64b5f9d00d88bded52b868b5d9aa279398))
35
+ * **dev-deps:** bump vite from 5.4.3 to 5.4.6 ([8268198](https://github.com/MTES-MCT/monitor-ui/commit/8268198bc7156700bf58c2be2449623857dab67d))
36
+ * **dev-deps:** upgrade dev deps in /e2e/release/sample ([1581c0a](https://github.com/MTES-MCT/monitor-ui/commit/1581c0ab0e00134d51fe9caa54c8204adc416d3f))
37
+ * **e2e:** remove useless browserslist in e2e release sample package.json ([398e20a](https://github.com/MTES-MCT/monitor-ui/commit/398e20a21ca3b42a74d0df5116983865d527edf7))
38
+
1
39
  ## [23.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v23.0.0...v23.1.0) (2024-09-25)
2
40
 
3
41
 
@@ -0,0 +1,8 @@
1
+ import { Size } from '@constants';
2
+ import { type ButtonHTMLAttributes } from 'react';
3
+ export type BaseButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
4
+ $isFullWidth: boolean;
5
+ $size: Size;
6
+ };
7
+ export declare const BaseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, BaseButtonProps, never>;
8
+ //# sourceMappingURL=BaseButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../src/elements/Button/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAcjD,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACtE,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,IAAI,CAAA;CACZ,CAAA;AACD,eAAO,MAAM,UAAU,yHAYtB,CAAA"}
@@ -1,6 +1,6 @@
1
+ import { Accent, Size } from '@constants';
2
+ import { type IconProps } from '@types_/definitions';
1
3
  import { type ButtonHTMLAttributes, type FunctionComponent } from 'react';
2
- import { Accent, Size } from '../../constants';
3
- import { type IconProps } from '../../types/definitions';
4
4
  export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
5
5
  Icon?: FunctionComponent<IconProps> | undefined;
6
6
  accent?: Accent | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyC,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAIhH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAA;AASxD,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,IAAI,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5C,CAAA;AACD,wBAAgB,MAAM,CAAC,EACrB,MAAuB,EACvB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,WAAmB,EACnB,OAAO,EACP,IAAkB,EAClB,IAAe,EACf,qBAA6B,EAC7B,GAAG,WAAW,EACf,EAAE,WAAW,2CAmDb"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGpD,OAAO,EAAyC,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAYhH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACpF,IAAI,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5C,CAAA;AACD,wBAAgB,MAAM,CAAC,EACrB,MAAuB,EACvB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,WAAmB,EACnB,OAAO,EACP,IAAkB,EAClB,IAAe,EACf,qBAA6B,EAC7B,GAAG,WAAW,EACf,EAAE,WAAW,2CAmDb"}
@@ -0,0 +1,8 @@
1
+ import { Size } from '@constants';
2
+ import { type ButtonHTMLAttributes } from 'react';
3
+ export type BaseIconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
4
+ $isCompact: boolean | undefined;
5
+ $size: Size;
6
+ };
7
+ export declare const BaseIconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, BaseIconButtonProps, never>;
8
+ //# sourceMappingURL=BaseIconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseIconButton.d.ts","sourceRoot":"","sources":["../../../src/elements/IconButton/BaseIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,OAAO,CAAA;AASjD,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAC1E,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,KAAK,EAAE,IAAI,CAAA;CACZ,CAAA;AACD,eAAO,MAAM,cAAc,6HAO1B,CAAA"}
@@ -1,6 +1,6 @@
1
+ import { Accent, Size } from '@constants';
2
+ import { type IconProps } from '@types_/definitions';
1
3
  import { type ButtonHTMLAttributes, type FunctionComponent } from 'react';
2
- import { Accent, Size } from '../constants';
3
- import { type IconProps } from '../types/definitions';
4
4
  export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
5
5
  Icon: FunctionComponent<IconProps>;
6
6
  accent?: Accent | undefined;
@@ -18,4 +18,4 @@ export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'chi
18
18
  withUnpropagatedClick?: boolean | undefined;
19
19
  };
20
20
  export declare function IconButton({ accent, badgeBackgroundColor, badgeColor, badgeNumber, className, color, Icon, iconSize, isCompact, onClick, size, style, type, withUnpropagatedClick, ...nativeProps }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
21
- //# sourceMappingURL=IconButton.d.ts.map
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/IconButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,KAAK,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EAAE,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC5D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC,CAAA;CACjC,CAAA;AACD,wBAAgB,SAAS,CAAC,EAAE,MAAuB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,EAAE,cAAc,2CA0BnH"}
1
+ {"version":3,"file":"SingleTag.d.ts","sourceRoot":"","sources":["../../src/elements/SingleTag.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,OAAO,CAAA;AAGxD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC5D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,UAAU,CAAC,IAAI,CAAC,CAAA;CACjC,CAAA;AACD,wBAAgB,SAAS,CAAC,EAAE,MAAuB,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,EAAE,cAAc,2CAgCnH"}
package/index.js CHANGED
@@ -53288,32 +53288,21 @@ NewWindow.defaultProps = {
53288
53288
  // An error here most likely happens when trying to access stylesheets from other domains,
53289
53289
  // which is a CORS violation and should be ignored.
53290
53290
  // eslint-disable-next-line no-console
53291
- console.debug(err);
53292
53291
  return;
53293
53292
  }
53294
53293
  if (rules) {
53295
- // IE11 is very slow for appendChild, so use plain string here
53296
- const ruleText = [];
53297
53294
  // Write the text of each rule into the body of the style element
53298
- Array.from(styleSheet.cssRules).forEach((cssRule)=>{
53299
- const { type } = cssRule;
53300
- let returnText = '';
53301
- if (type === CSSRule.KEYFRAMES_RULE) {
53302
- // IE11 will throw error when trying to access cssText property, so we
53303
- // need to assemble them
53304
- returnText = getKeyFrameText(cssRule);
53305
- } else if ([
53306
- CSSRule.IMPORT_RULE,
53307
- CSSRule.FONT_FACE_RULE
53308
- ].includes(type)) {
53295
+ const ruleText = Array.from(rules).flat().map((cssRule)=>{
53296
+ if ([
53297
+ 'CSSImportRule',
53298
+ 'CSSFontFaceRule'
53299
+ ].includes(cssRule.constructor.name)) {
53309
53300
  // Check if the cssRule type is CSSImportRule (3) or CSSFontFaceRule (5)
53310
53301
  // to handle local imports on a about:blank page
53311
53302
  // '/custom.css' turns to 'http://my-site.com/custom.css'
53312
- returnText = fixUrlForRule(cssRule);
53313
- } else {
53314
- returnText = cssRule.cssText;
53303
+ return fixUrlForRule(cssRule);
53315
53304
  }
53316
- ruleText.push(returnText);
53305
+ return cssRule.cssText;
53317
53306
  });
53318
53307
  const newStyleEl = target.createElement('style');
53319
53308
  newStyleEl.textContent = ruleText.join('\n');
@@ -53328,22 +53317,6 @@ NewWindow.defaultProps = {
53328
53317
  });
53329
53318
  target.head.appendChild(headFrag);
53330
53319
  }
53331
- /**
53332
- * Make keyframe rules.
53333
- */ // This should be `CSSRule` instead of `any` but this code is a bit tedious.
53334
- function getKeyFrameText(cssRule/** CSSRule */ ) {
53335
- const tokens = [
53336
- '@keyframes',
53337
- cssRule.name,
53338
- '{'
53339
- ];
53340
- Array.from(cssRule.cssRules).forEach((keyframesCssRule)=>{
53341
- // type === CSSRule.KEYFRAME_RULE should always be true
53342
- tokens.push(keyframesCssRule.keyText, '{', keyframesCssRule.style.cssText, '}');
53343
- });
53344
- tokens.push('}');
53345
- return tokens.join(' ');
53346
- }
53347
53320
  /**
53348
53321
  * Handle local import urls.
53349
53322
  */ function fixUrlForRule(cssRule) {
@@ -53417,6 +53390,20 @@ function Notifier({ isSideWindow = false }) {
53417
53390
  // We need to retype `ToastContainer` manually because `styled-components` mess up with the `children` prop
53418
53391
  const StyledToastContainer = styled(k)``;
53419
53392
 
53393
+ const PADDING$2 = {
53394
+ [Size.LARGE]: '7px',
53395
+ [Size.NORMAL]: '5px',
53396
+ [Size.SMALL]: '3px'
53397
+ };
53398
+ const BaseIconButton$1 = styled.button`
53399
+ align-items: center;
53400
+ border-style: solid;
53401
+ border-width: ${(p)=>p.$isCompact ? 0 : 1}px;
53402
+ display: flex;
53403
+ justify-content: center;
53404
+ padding: ${(p)=>p.$isCompact ? 0 : PADDING$2[p.$size]};
53405
+ `;
53406
+
53420
53407
  function getPrimaryButtonCss() {
53421
53408
  return css`
53422
53409
  background-color: ${(p)=>p.theme.color.charcoal};
@@ -53583,11 +53570,6 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53583
53570
  });
53584
53571
  }
53585
53572
  }
53586
- const PADDING$2 = {
53587
- [Size.LARGE]: '7px',
53588
- [Size.NORMAL]: '5px',
53589
- [Size.SMALL]: '3px'
53590
- };
53591
53573
  const Wrapper$2 = styled.div`
53592
53574
  position: relative;
53593
53575
  `;
@@ -53612,16 +53594,8 @@ const BadgeNumber = styled.div`
53612
53594
  letter-spacing: 0px;
53613
53595
  font-weight: 700;
53614
53596
  `;
53615
- const BaseButton$1 = styled.button`
53616
- align-items: center;
53617
- border-style: solid;
53618
- border-width: ${(p)=>p.$isCompact ? 0 : 1}px;
53619
- display: flex;
53620
- justify-content: center;
53621
- padding: ${(p)=>p.$isCompact ? 0 : PADDING$2[p.$size]};
53622
- `;
53623
- const PrimaryButton$1 = styled(BaseButton$1)(getPrimaryButtonCss);
53624
- const SecondaryButton$1 = styled(BaseButton$1)(getSecondaryButtonCss);
53597
+ const PrimaryButton$1 = styled(BaseIconButton$1)(getPrimaryButtonCss);
53598
+ const SecondaryButton$1 = styled(BaseIconButton$1)(getSecondaryButtonCss);
53625
53599
  const TertiaryButton$1 = styled.button`
53626
53600
  background-color: transparent;
53627
53601
  border-color: transparent;
@@ -53710,7 +53684,8 @@ const SideMenu = Object.assign(Menu, {
53710
53684
  });
53711
53685
 
53712
53686
  function SingleTag({ accent = Accent.PRIMARY, children, className, onDelete, ...nativeProps }) {
53713
- const controlledClassName = classnames('Component-SingleTag', className);
53687
+ // TODO Remove `Component-SingleTag` in a next major/breaking version.
53688
+ const controlledClassName = classnames('Component-SingleTag', 'Element-SingleTag', className);
53714
53689
  const handleDelete = useCallback(()=>{
53715
53690
  if (onDelete) {
53716
53691
  onDelete();
@@ -53728,13 +53703,14 @@ function SingleTag({ accent = Accent.PRIMARY, children, className, onDelete, ...
53728
53703
  children: children
53729
53704
  }),
53730
53705
  /*#__PURE__*/ jsx(SecondaryIconButton, {
53731
- accent: Accent.TERTIARY,
53732
- Icon: Close,
53733
- iconSize: 10,
53734
- onClick: handleDelete
53706
+ onClick: handleDelete,
53707
+ children: /*#__PURE__*/ jsx(Close, {
53708
+ size: 10
53709
+ })
53735
53710
  })
53736
53711
  ]
53737
53712
  });
53713
+ case Accent.PRIMARY:
53738
53714
  default:
53739
53715
  return /*#__PURE__*/ jsxs(Box$d, {
53740
53716
  className: controlledClassName,
@@ -53744,10 +53720,10 @@ function SingleTag({ accent = Accent.PRIMARY, children, className, onDelete, ...
53744
53720
  children: children
53745
53721
  }),
53746
53722
  /*#__PURE__*/ jsx(PrimaryIconButton, {
53747
- accent: Accent.TERTIARY,
53748
- Icon: Close,
53749
- iconSize: 10,
53750
- onClick: handleDelete
53723
+ onClick: handleDelete,
53724
+ children: /*#__PURE__*/ jsx(Close, {
53725
+ size: 10
53726
+ })
53751
53727
  })
53752
53728
  ]
53753
53729
  });
@@ -53758,6 +53734,14 @@ const Box$d = styled.div`
53758
53734
  display: inline-flex;
53759
53735
  max-width: 100%;
53760
53736
  `;
53737
+ const BaseIconButton = styled.button`
53738
+ align-items: center;
53739
+ display: flex;
53740
+ justify-content: center;
53741
+ line-height: 18px;
53742
+ margin-left: 1px;
53743
+ padding: 8px;
53744
+ `;
53761
53745
  const PrimaryText = styled.span`
53762
53746
  background-color: ${(p)=>p.theme.color.lightGray};
53763
53747
  color: ${(p)=>p.theme.color.gunMetal};
@@ -53768,50 +53752,59 @@ const PrimaryText = styled.span`
53768
53752
  text-overflow: ellipsis;
53769
53753
  white-space: nowrap;
53770
53754
  `;
53771
- const PrimaryIconButton = styled(IconButton)`
53755
+ const PrimaryIconButton = styled(BaseIconButton)`
53772
53756
  background-color: ${(p)=>p.theme.color.lightGray};
53773
- line-height: 18px;
53774
- margin-left: 1px;
53775
- padding: 2px 8px 6px;
53757
+ border-color: ${(p)=>p.theme.color.lightGray};
53758
+ color: ${(p)=>p.theme.color.charcoal};
53776
53759
 
53777
53760
  :hover,
53778
53761
  &._hover {
53779
53762
  background-color: ${(p)=>p.theme.color.lightGray};
53763
+ border-color: ${(p)=>p.theme.color.lightGray};
53764
+ color: ${(p)=>p.theme.color.blueYonder};
53780
53765
  }
53781
53766
 
53782
53767
  :active,
53783
53768
  &._active {
53784
53769
  background-color: ${(p)=>p.theme.color.lightGray};
53770
+ border-color: ${(p)=>p.theme.color.lightGray};
53771
+ color: ${(p)=>p.theme.color.blueGray};
53785
53772
  }
53786
53773
 
53787
53774
  :disabled,
53788
53775
  &._disabled {
53789
53776
  background-color: ${(p)=>p.theme.color.lightGray};
53777
+ border-color: ${(p)=>p.theme.color.lightGray};
53778
+ color: ${(p)=>p.theme.color.lightGray};
53790
53779
  }
53791
53780
  `;
53792
53781
  const SecondaryText = styled(PrimaryText)`
53793
53782
  background-color: ${(p)=>p.theme.color.blueYonder};
53794
53783
  color: ${(p)=>p.theme.color.white};
53795
53784
  `;
53796
- const SecondaryIconButton = styled(PrimaryIconButton)`
53785
+ const SecondaryIconButton = styled(BaseIconButton)`
53797
53786
  background-color: ${(p)=>p.theme.color.blueYonder};
53787
+ border-color: ${(p)=>p.theme.color.blueYonder};
53798
53788
  color: ${(p)=>p.theme.color.white};
53799
53789
 
53800
53790
  :hover,
53801
53791
  &._hover {
53802
53792
  background-color: ${(p)=>p.theme.color.blueYonder};
53793
+ border-color: ${(p)=>p.theme.color.blueYonder};
53803
53794
  color: ${(p)=>p.theme.color.blueYonder25};
53804
53795
  }
53805
53796
 
53806
53797
  :active,
53807
53798
  &._active {
53808
53799
  background-color: ${(p)=>p.theme.color.blueYonder};
53800
+ border-color: ${(p)=>p.theme.color.blueYonder};
53809
53801
  color: ${(p)=>p.theme.color.blueYonder25};
53810
53802
  }
53811
53803
 
53812
53804
  :disabled,
53813
53805
  &._disabled {
53814
53806
  background-color: ${(p)=>p.theme.color.blueYonder};
53807
+ border-color: ${(p)=>p.theme.color.blueYonder};
53815
53808
  color: ${(p)=>p.theme.color.blueYonder25};
53816
53809
  }
53817
53810
  `;
@@ -54187,6 +54180,30 @@ const HideText = styled.span`
54187
54180
  `;
54188
54181
  Banner.displayName = 'Banner';
54189
54182
 
54183
+ const FONT_SIZE = {
54184
+ [Size.LARGE]: '13px',
54185
+ [Size.NORMAL]: '13px',
54186
+ [Size.SMALL]: '11px'
54187
+ };
54188
+ const PADDING$1 = {
54189
+ [Size.LARGE]: '12px',
54190
+ [Size.NORMAL]: '6px 12px',
54191
+ [Size.SMALL]: '5px 8px 4px'
54192
+ };
54193
+ const BaseButton = styled.button`
54194
+ align-items: center;
54195
+ display: inline-flex;
54196
+ font-size: ${(p)=>FONT_SIZE[p.$size]};
54197
+ justify-content: center;
54198
+ max-width: 100%;
54199
+ padding: ${(p)=>PADDING$1[p.$size]};
54200
+ width: ${(p)=>p.$isFullWidth ? '100%' : 'auto'};
54201
+
54202
+ > .Element-IconBox {
54203
+ margin-right: 5px;
54204
+ }
54205
+ `;
54206
+
54190
54207
  const ICON_SIZE = {
54191
54208
  [Size.LARGE]: 20,
54192
54209
  [Size.NORMAL]: 20,
@@ -54258,29 +54275,6 @@ function Button({ accent = Accent.PRIMARY, children, className, Icon, isFullWidt
54258
54275
  });
54259
54276
  }
54260
54277
  }
54261
- const FONT_SIZE = {
54262
- [Size.LARGE]: '13px',
54263
- [Size.NORMAL]: '13px',
54264
- [Size.SMALL]: '11px'
54265
- };
54266
- const PADDING$1 = {
54267
- [Size.LARGE]: '12px',
54268
- [Size.NORMAL]: '6px 12px',
54269
- [Size.SMALL]: '5px 8px 4px'
54270
- };
54271
- const BaseButton = styled.button`
54272
- align-items: center;
54273
- display: inline-flex;
54274
- font-size: ${(p)=>FONT_SIZE[p.$size]};
54275
- justify-content: center;
54276
- max-width: 100%;
54277
- padding: ${(p)=>PADDING$1[p.$size]};
54278
- width: ${(p)=>p.$isFullWidth ? '100%' : 'auto'};
54279
-
54280
- > .Element-IconBox {
54281
- margin-right: 5px;
54282
- }
54283
- `;
54284
54278
  const ButtonLabel = styled.span`
54285
54279
  line-height: 1.3846;
54286
54280
  margin-top: -3px;
@@ -69313,7 +69307,7 @@ function Select({ className, customSearch, customSearchMinQueryLength = 1, disab
69313
69307
  if (!boxRef.current) {
69314
69308
  return;
69315
69309
  }
69316
- const divs = boxRef.current.querySelectorAll(`#${originalProps.name}-listbox div`);
69310
+ const divs = boxRef.current.querySelectorAll(`[id="${originalProps.name}-listbox"] div`);
69317
69311
  const targetDiv = divs[2];
69318
69312
  /**
69319
69313
  * Reset the 'pointer-events' style
@@ -70651,9 +70645,9 @@ diacritics.replacementList = replacementList;
70651
70645
  diacritics.diacriticsMap = diacriticsMap;
70652
70646
 
70653
70647
  /**
70654
- * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
70648
+ * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)
70655
70649
  *
70656
- * Copyright (c) 2022 Kiro Risk (http://kiro.me)
70650
+ * Copyright (c) 2023 Kiro Risk (http://kiro.me)
70657
70651
  * All Rights Reserved. Apache Software License 2.0
70658
70652
  *
70659
70653
  * http://www.apache.org/licenses/LICENSE-2.0
@@ -70751,8 +70745,6 @@ class KeyStore {
70751
70745
  keys.forEach((key) => {
70752
70746
  let obj = createKey(key);
70753
70747
 
70754
- totalWeight += obj.weight;
70755
-
70756
70748
  this._keys.push(obj);
70757
70749
  this._keyMap[obj.id] = obj;
70758
70750
 
@@ -72416,7 +72408,7 @@ class Fuse {
72416
72408
  }
72417
72409
  }
72418
72410
 
72419
- Fuse.version = '6.6.2';
72411
+ Fuse.version = '7.0.0';
72420
72412
  Fuse.createIndex = createIndex;
72421
72413
  Fuse.parseIndex = parseIndex;
72422
72414
  Fuse.config = Config;
@@ -1,5 +1,5 @@
1
1
  import type { AnyObject } from '../../types/definitions';
2
- import type Fuse from 'fuse.js';
2
+ import type { FuseOptionKeyObject } from 'fuse.js';
3
3
  export type CustomSearchCache = Record<string, CustomSearchCacheRecord>;
4
4
  export type CustomSearchCacheRecord = {
5
5
  fuseSearchIndex: any;
@@ -7,7 +7,7 @@ export type CustomSearchCacheRecord = {
7
7
  originalCollection: AnyObject[];
8
8
  originalCollectionHash: string;
9
9
  };
10
- export type CustomSearchKey<T> = string | Fuse.FuseOptionKeyObject<T>;
10
+ export type CustomSearchKey<T> = string | FuseOptionKeyObject<T>;
11
11
  export type CustomSearchOptions = Partial<{
12
12
  /** Cache search index to avoid Must be unique in the entire application. */
13
13
  cacheKey: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/libs/CustomSearch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAE/B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;AACvE,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,GAAG,CAAA;IACpB,oBAAoB,EAAE,SAAS,EAAE,CAAA;IACjC,kBAAkB,EAAE,SAAS,EAAE,CAAA;IAC/B,sBAAsB,EAAE,MAAM,CAAA;CA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EAA8E;IAC9E,oBAAoB,EAAE,OAAO,CAAA;IAE7B;;;;;;;OAOG;IACH,QAAQ,EAAE,OAAO,CAAA;IAEjB;;;;;;;;OAQG;IACH,oBAAoB,EAAE,OAAO,CAAA;IAE7B;;;;;;;;;OASG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB,2DAA2D;IAC3D,qBAAqB,EAAE,OAAO,CAAA;CAC/B,CAAC,CAAA"}
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": "23.1.1",
4
+ "version": "23.1.3",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/elements/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAe,MAAM,OAAO,CAAA;AAGhH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AASrD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACxF,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA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