@mtes-mct/monitor-ui 21.1.0 → 21.1.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 CHANGED
@@ -1,3 +1,22 @@
1
+ ## [21.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v21.0.1...v21.1.0) (2024-08-20)
2
+
3
+
4
+ ### ⚠ BREAKING CHANGES
5
+
6
+ * **elements:** pass style to wrapper
7
+
8
+ ### Features
9
+
10
+ * **elements:** pass class name to icon button ([23251d7](https://github.com/MTES-MCT/monitor-ui/commit/23251d73759d427dbe3d4946e758e4cb93d036cc))
11
+ * **elements:** pass style to wrapper ([c3ce3f2](https://github.com/MTES-MCT/monitor-ui/commit/c3ce3f2466d835f98a7a5bcbfbe471e55816bbf4))
12
+
13
+
14
+ ### Buid System & Dependencies
15
+
16
+ * **deps:** bump axios from 1.6.7 to 1.7.4 ([e960cd3](https://github.com/MTES-MCT/monitor-ui/commit/e960cd35947623f89866aa05fd17950a888cf17f))
17
+ * **dev-deps:** bump the all-non-major-dependencies group ([9ff22e4](https://github.com/MTES-MCT/monitor-ui/commit/9ff22e4ef28c13cf5e6f27e5d501dc1eb8f59519))
18
+ * **dev-deps:** bump vite-tsconfig-paths in /e2e/release/sample ([b2c5e80](https://github.com/MTES-MCT/monitor-ui/commit/b2c5e808c2b2346d213e7ab3408174ad3dfaaa66))
19
+
1
20
  ## [21.0.1](https://github.com/MTES-MCT/monitor-ui/compare/v21.0.0...v21.0.1) (2024-08-14)
2
21
 
3
22
 
@@ -1 +1 @@
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;AAIhH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,KAAK,SAAS,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,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;IAC7B,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAC/B,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,GAAG,SAAS,CAAA;IACvC,yCAAyC;IACzC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5C,CAAA;AACD,wBAAgB,UAAU,CAAC,EACzB,MAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,SAAS,EACT,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,OAAO,EACP,IAAkB,EAClB,KAAK,EACL,IAAe,EACf,qBAA6B,EAC7B,GAAG,WAAW,EACf,EAAE,eAAe,2CAmFjB"}
package/index.js CHANGED
@@ -53587,73 +53587,92 @@ function IconButton({ accent = Accent.PRIMARY, badgeBackgroundColor, badgeColor,
53587
53587
  iconSize,
53588
53588
  size
53589
53589
  ]);
53590
- const commonProps = useMemo(()=>({
53590
+ const buttonProps = useMemo(()=>({
53591
53591
  children: commonChildren,
53592
- className: classnames('Element-IconButton'),
53592
+ className: badgeNumber === undefined ? classnames('Element-IconButton', className) : classnames('Element-IconButton'),
53593
53593
  isCompact,
53594
53594
  onClick: handleClick,
53595
53595
  size,
53596
+ style: badgeNumber === undefined ? style : undefined,
53596
53597
  type,
53597
53598
  ...nativeProps
53598
53599
  }), [
53600
+ badgeNumber,
53601
+ className,
53599
53602
  commonChildren,
53600
53603
  handleClick,
53601
53604
  isCompact,
53602
53605
  nativeProps,
53603
53606
  size,
53604
- type
53607
+ type,
53608
+ style
53605
53609
  ]);
53606
53610
  switch(accent){
53607
53611
  case Accent.SECONDARY:
53608
- return /*#__PURE__*/ jsxs(Wrapper$2, {
53609
- className: className,
53610
- style: style,
53611
- children: [
53612
- !!badgeNumber && /*#__PURE__*/ jsx(BadgeNumber, {
53613
- backgroundColor: badgeBackgroundColor,
53614
- color: badgeColor,
53615
- size: size,
53616
- children: badgeNumber
53617
- }),
53618
- /*#__PURE__*/ jsx(SecondaryButton, {
53619
- as: StyledButton,
53620
- ...commonProps
53621
- })
53622
- ]
53612
+ return /*#__PURE__*/ jsx(Fragment, {
53613
+ children: badgeNumber === undefined ? /*#__PURE__*/ jsx(SecondaryButton, {
53614
+ as: StyledButton,
53615
+ ...buttonProps
53616
+ }) : /*#__PURE__*/ jsxs(Wrapper$2, {
53617
+ className: className,
53618
+ style: style,
53619
+ children: [
53620
+ /*#__PURE__*/ jsx(BadgeNumber, {
53621
+ backgroundColor: badgeBackgroundColor,
53622
+ color: badgeColor,
53623
+ size: size,
53624
+ children: badgeNumber
53625
+ }),
53626
+ /*#__PURE__*/ jsx(SecondaryButton, {
53627
+ as: StyledButton,
53628
+ ...buttonProps
53629
+ })
53630
+ ]
53631
+ })
53623
53632
  });
53624
53633
  case Accent.TERTIARY:
53625
- return /*#__PURE__*/ jsxs(Wrapper$2, {
53626
- className: className,
53627
- style: style,
53628
- children: [
53629
- !!badgeNumber && /*#__PURE__*/ jsx(BadgeNumber, {
53630
- backgroundColor: badgeBackgroundColor,
53631
- color: badgeColor,
53632
- size: size,
53633
- children: badgeNumber
53634
- }),
53635
- /*#__PURE__*/ jsx(TertiaryButton, {
53636
- as: StyledButton,
53637
- ...commonProps
53638
- })
53639
- ]
53634
+ return /*#__PURE__*/ jsx(Fragment, {
53635
+ children: badgeNumber === undefined ? /*#__PURE__*/ jsx(TertiaryButton, {
53636
+ as: StyledButton,
53637
+ ...buttonProps
53638
+ }) : /*#__PURE__*/ jsxs(Wrapper$2, {
53639
+ className: className,
53640
+ style: style,
53641
+ children: [
53642
+ /*#__PURE__*/ jsx(BadgeNumber, {
53643
+ backgroundColor: badgeBackgroundColor,
53644
+ color: badgeColor,
53645
+ size: size,
53646
+ children: badgeNumber
53647
+ }),
53648
+ /*#__PURE__*/ jsx(TertiaryButton, {
53649
+ as: StyledButton,
53650
+ ...buttonProps
53651
+ })
53652
+ ]
53653
+ })
53640
53654
  });
53641
53655
  default:
53642
- return /*#__PURE__*/ jsxs(Wrapper$2, {
53643
- className: className,
53644
- style: style,
53645
- children: [
53646
- !!badgeNumber && /*#__PURE__*/ jsx(BadgeNumber, {
53647
- backgroundColor: badgeBackgroundColor,
53648
- color: badgeColor,
53649
- size: size,
53650
- children: badgeNumber
53651
- }),
53652
- /*#__PURE__*/ jsx(PrimaryButton, {
53653
- as: StyledButton,
53654
- ...commonProps
53655
- })
53656
- ]
53656
+ return /*#__PURE__*/ jsx(Fragment, {
53657
+ children: badgeNumber === undefined ? /*#__PURE__*/ jsx(PrimaryButton, {
53658
+ as: StyledButton,
53659
+ ...buttonProps
53660
+ }) : /*#__PURE__*/ jsxs(Wrapper$2, {
53661
+ className: className,
53662
+ style: style,
53663
+ children: [
53664
+ /*#__PURE__*/ jsx(BadgeNumber, {
53665
+ backgroundColor: badgeBackgroundColor,
53666
+ color: badgeColor,
53667
+ size: size,
53668
+ children: badgeNumber
53669
+ }),
53670
+ /*#__PURE__*/ jsx(PrimaryButton, {
53671
+ as: StyledButton,
53672
+ ...buttonProps
53673
+ })
53674
+ ]
53675
+ })
53657
53676
  });
53658
53677
  }
53659
53678
  }
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": "21.1.0",
4
+ "version": "21.1.1",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
7
7
  "engines": {