@mtes-mct/monitor-ui 10.2.0 → 10.3.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 +15 -0
- package/index.js +14 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/Tag/index.d.ts +9 -1
- package/src/theme.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [10.2.1](https://github.com/MTES-MCT/monitor-ui/compare/v10.2.0...v10.2.1) (2023-10-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **elements:** add backgroundColor prop and fix icon size in Tag component ([f58b3f4](https://github.com/MTES-MCT/monitor-ui/commit/f58b3f42746286b9a27b04018101e4cd2f2263f6))
|
|
7
|
+
* **elements:** add borderColor prop in Tag component ([1d54f61](https://github.com/MTES-MCT/monitor-ui/commit/1d54f61d80f2fc1224bcd69fe0e775dda33fbc06))
|
|
8
|
+
|
|
9
|
+
## [10.2.0](https://github.com/MTES-MCT/monitor-ui/compare/v10.1.1...v10.2.0) (2023-10-02)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **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))
|
|
15
|
+
|
|
1
16
|
## [10.1.1](https://github.com/MTES-MCT/monitor-ui/compare/v10.1.0...v10.1.1) (2023-09-27)
|
|
2
17
|
|
|
3
18
|
# [10.1.0](https://github.com/MTES-MCT/monitor-ui/compare/v10.0.0...v10.1.0) (2023-09-27)
|
package/index.js
CHANGED
|
@@ -260,6 +260,7 @@ const THEME = {
|
|
|
260
260
|
// Notification Colors
|
|
261
261
|
mediumSeaGreen: '#29B361',
|
|
262
262
|
goldenPoppy: '#FAC11A',
|
|
263
|
+
goldenPoppy25: '#FAC11A',
|
|
263
264
|
/** CONTEXTUAL COLORS */
|
|
264
265
|
// Mission status
|
|
265
266
|
yellowGreen: '#8CC800',
|
|
@@ -34629,7 +34630,7 @@ const Disk = styled.span `
|
|
|
34629
34630
|
border-radius: 50%;
|
|
34630
34631
|
`;
|
|
34631
34632
|
|
|
34632
|
-
function Tag({ accent, bullet, bulletColor, children, className, color, Icon, isLight = false, ...nativeProps }) {
|
|
34633
|
+
function Tag({ accent, backgroundColor, borderColor, bullet, bulletColor, children, className, color, Icon, isLight = false, ...nativeProps }) {
|
|
34633
34634
|
const commonChildren = useMemo(() => {
|
|
34634
34635
|
const defaultColor = color || THEME.color.gunMetal;
|
|
34635
34636
|
const controlledBulletColor = bulletColor ||
|
|
@@ -34640,7 +34641,7 @@ function Tag({ accent, bullet, bulletColor, children, className, color, Icon, is
|
|
|
34640
34641
|
[Accent.TERTIARY]: THEME.color.white
|
|
34641
34642
|
}[accent]
|
|
34642
34643
|
: defaultColor);
|
|
34643
|
-
return (jsxs(Fragment, { children: [Icon && jsx(Icon, { size:
|
|
34644
|
+
return (jsxs(Fragment, { children: [Icon && !bullet && jsx(Icon, { size: 16 }), bullet === TagBullet.DISK && !Icon && jsx(Disk, { "$color": controlledBulletColor }), children] }));
|
|
34644
34645
|
}, [accent, bullet, bulletColor, color, children, Icon]);
|
|
34645
34646
|
const commonProps = useMemo(() => ({
|
|
34646
34647
|
$isLight: isLight,
|
|
@@ -34656,12 +34657,19 @@ function Tag({ accent, bullet, bulletColor, children, className, color, Icon, is
|
|
|
34656
34657
|
case Accent.TERTIARY:
|
|
34657
34658
|
return jsx(TertiaryTag, { ...commonProps });
|
|
34658
34659
|
default:
|
|
34659
|
-
return jsx(Box$e, { "$color": color, ...commonProps });
|
|
34660
|
+
return jsx(Box$e, { "$backgroundColor": backgroundColor, "$borderColor": borderColor, "$color": color, ...commonProps });
|
|
34660
34661
|
}
|
|
34661
34662
|
}
|
|
34662
34663
|
const Box$e = styled.span `
|
|
34663
|
-
align-items:
|
|
34664
|
-
|
|
34664
|
+
align-items: end;
|
|
34665
|
+
align-self: flex-start;
|
|
34666
|
+
background-color: ${p => {
|
|
34667
|
+
if (p.$backgroundColor) {
|
|
34668
|
+
return p.$backgroundColor;
|
|
34669
|
+
}
|
|
34670
|
+
return p.$isLight ? p.theme.color.white : 'transparent';
|
|
34671
|
+
}};
|
|
34672
|
+
border: ${p => (p.$borderColor ? `1px solid ${p.$borderColor}` : 'none')};
|
|
34665
34673
|
border-radius: 11px;
|
|
34666
34674
|
color: ${p => (p.$color ? p.$color : p.theme.color.gunMetal)};
|
|
34667
34675
|
display: inline-flex;
|
|
@@ -34687,7 +34695,7 @@ const PrimaryTag = styled(Box$e) `
|
|
|
34687
34695
|
`;
|
|
34688
34696
|
// TODO Fix this color.
|
|
34689
34697
|
const SecondaryTag = styled(Box$e) `
|
|
34690
|
-
background-color: ${p => (p.$isLight ?
|
|
34698
|
+
background-color: ${p => (p.$isLight ? p.theme.color.goldenPoppy : p.theme.color.goldenPoppy)};
|
|
34691
34699
|
color: ${p => p.theme.color.gunMetal};
|
|
34692
34700
|
`;
|
|
34693
34701
|
const TertiaryTag = styled(Box$e) `
|