@mtes-mct/monitor-ui 10.2.0 → 10.2.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,10 @@
1
+ ## [10.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v10.1.1...v10.2.0) (2023-10-02)
2
+
3
+
4
+ ### Features
5
+
6
+ * **field:** add disabled prop on Option type to handle case where only certain options are disabled ([58dc8f8](https://github.com/MTES-MCT/monitor-ui/commit/58dc8f8342dcac01f6d59ca5e05bfc4b05b738a7))
7
+
1
8
  ## [10.1.1](https://github.com/MTES-MCT/monitor-ui/compare/v10.1.0...v10.1.1) (2023-09-27)
2
9
 
3
10
  # [10.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v10.0.0...v10.1.0) (2023-09-27)
package/index.js CHANGED
@@ -34629,7 +34629,7 @@ const Disk = styled.span `
34629
34629
  border-radius: 50%;
34630
34630
  `;
34631
34631
 
34632
- function Tag({ accent, bullet, bulletColor, children, className, color, Icon, isLight = false, ...nativeProps }) {
34632
+ function Tag({ accent, backgroundColor, borderColor, bullet, bulletColor, children, className, color, Icon, isLight = false, ...nativeProps }) {
34633
34633
  const commonChildren = useMemo(() => {
34634
34634
  const defaultColor = color || THEME.color.gunMetal;
34635
34635
  const controlledBulletColor = bulletColor ||
@@ -34640,7 +34640,7 @@ function Tag({ accent, bullet, bulletColor, children, className, color, Icon, is
34640
34640
  [Accent.TERTIARY]: THEME.color.white
34641
34641
  }[accent]
34642
34642
  : defaultColor);
34643
- return (jsxs(Fragment, { children: [Icon && jsx(Icon, { size: 1 }), bullet === TagBullet.DISK && jsx(Disk, { "$color": controlledBulletColor }), children] }));
34643
+ return (jsxs(Fragment, { children: [Icon && !bullet && jsx(Icon, { size: 16 }), bullet === TagBullet.DISK && !Icon && jsx(Disk, { "$color": controlledBulletColor }), children] }));
34644
34644
  }, [accent, bullet, bulletColor, color, children, Icon]);
34645
34645
  const commonProps = useMemo(() => ({
34646
34646
  $isLight: isLight,
@@ -34656,12 +34656,19 @@ function Tag({ accent, bullet, bulletColor, children, className, color, Icon, is
34656
34656
  case Accent.TERTIARY:
34657
34657
  return jsx(TertiaryTag, { ...commonProps });
34658
34658
  default:
34659
- return jsx(Box$e, { "$color": color, ...commonProps });
34659
+ return jsx(Box$e, { "$backgroundColor": backgroundColor, "$borderColor": borderColor, "$color": color, ...commonProps });
34660
34660
  }
34661
34661
  }
34662
34662
  const Box$e = styled.span `
34663
- align-items: center;
34664
- background-color: ${p => (p.$isLight ? p.theme.color.white : 'transparent')};
34663
+ align-items: end;
34664
+ align-self: flex-start;
34665
+ background-color: ${p => {
34666
+ if (p.$backgroundColor) {
34667
+ return p.$backgroundColor;
34668
+ }
34669
+ return p.$isLight ? p.theme.color.white : 'transparent';
34670
+ }};
34671
+ border: ${p => (p.$borderColor ? `1px solid ${p.$borderColor}` : 'none')};
34665
34672
  border-radius: 11px;
34666
34673
  color: ${p => (p.$color ? p.$color : p.theme.color.gunMetal)};
34667
34674
  display: inline-flex;
@@ -34687,7 +34694,7 @@ const PrimaryTag = styled(Box$e) `
34687
34694
  `;
34688
34695
  // TODO Fix this color.
34689
34696
  const SecondaryTag = styled(Box$e) `
34690
- background-color: ${p => (p.$isLight ? '#f6d012' : '#f6d012')};
34697
+ background-color: ${p => (p.$isLight ? p.theme.color.goldenPoppy : p.theme.color.goldenPoppy)};
34691
34698
  color: ${p => p.theme.color.gunMetal};
34692
34699
  `;
34693
34700
  const TertiaryTag = styled(Box$e) `