@mtes-mct/monitor-ui 2.9.2 → 2.9.4
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 +14 -0
- package/index.js +24 -11
- package/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.9.3](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.2...v2.9.3) (2023-01-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **components:** use px instead of rem for Dropdown icon size ([c0b24ac](https://github.com/MTES-MCT/monitor-ui/commit/c0b24ac4c90f666bbdeeae533c3d6153088a80eb))
|
|
7
|
+
|
|
8
|
+
## [2.9.2](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.1...v2.9.2) (2023-01-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **fields:** set MutliSelect initial isOpen to false ([06fc475](https://github.com/MTES-MCT/monitor-ui/commit/06fc475fcd41e00e5e79a5636ba0e720899e3a1f))
|
|
14
|
+
|
|
1
15
|
## [2.9.1](https://github.com/MTES-MCT/monitor-ui/compare/v2.9.0...v2.9.1) (2023-01-27)
|
|
2
16
|
|
|
3
17
|
|
package/index.js
CHANGED
|
@@ -1877,7 +1877,7 @@ function ThemeProvider({ children, theme = {} }) {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
|
|
1879
1879
|
function Item({ Icon, ...originalProps }) {
|
|
1880
|
-
const icon = useMemo(() => (Icon ? jsx(Icon, { size:
|
|
1880
|
+
const icon = useMemo(() => (Icon ? jsx(Icon, { size: 20 }) : undefined), [Icon]);
|
|
1881
1881
|
const hasIcon = useMemo(() => Boolean(Icon), [Icon]);
|
|
1882
1882
|
return jsx(StyledDropdownItem, { "$hasIcon": hasIcon, icon: icon, ...originalProps });
|
|
1883
1883
|
}
|
|
@@ -1888,15 +1888,20 @@ const StyledDropdownItem = styled(Dropdown$1.Item) `
|
|
|
1888
1888
|
font-size: 13px;
|
|
1889
1889
|
line-height: 1;
|
|
1890
1890
|
padding: 12px;
|
|
1891
|
-
padding: ${p => (p.$hasIcon ? '
|
|
1891
|
+
padding: ${p => (p.$hasIcon ? '7px' : '11px')} 12px ${p => (p.$hasIcon ? '9px' : '14px')};
|
|
1892
1892
|
|
|
1893
1893
|
&:not(:last-child) {
|
|
1894
1894
|
border-bottom: 1px solid var(--lightGray);
|
|
1895
1895
|
}
|
|
1896
|
+
|
|
1897
|
+
/* SVG Icon Components are wrapped within a <div /> */
|
|
1898
|
+
> div {
|
|
1899
|
+
margin-top: 1px;
|
|
1900
|
+
}
|
|
1896
1901
|
`;
|
|
1897
1902
|
|
|
1898
1903
|
function RawDropdown({ Icon, ...originalProps }) {
|
|
1899
|
-
const icon = useMemo(() => (Icon ? jsx(Icon, { size:
|
|
1904
|
+
const icon = useMemo(() => (Icon ? jsx(Icon, { size: 20 }) : undefined), [Icon]);
|
|
1900
1905
|
const hasIcon = useMemo(() => Boolean(Icon), [Icon]);
|
|
1901
1906
|
return jsx(StyledDropdown, { "$hasIcon": hasIcon, icon: icon, ...originalProps });
|
|
1902
1907
|
}
|
|
@@ -1909,7 +1914,7 @@ const StyledDropdown = styled(Dropdown$1) `
|
|
|
1909
1914
|
color: ${p => p.theme.color.gainsboro};
|
|
1910
1915
|
display: flex;
|
|
1911
1916
|
font-size: 13px;
|
|
1912
|
-
padding: ${p => (p.$hasIcon ? '
|
|
1917
|
+
padding: ${p => (p.$hasIcon ? '4px' : '5px')} 12px ${p => (p.$hasIcon ? '5px' : '7px')};
|
|
1913
1918
|
|
|
1914
1919
|
:hover {
|
|
1915
1920
|
background-color: ${p => p.theme.color.blueYonder['100']};
|
|
@@ -1931,7 +1936,7 @@ const StyledDropdown = styled(Dropdown$1) `
|
|
|
1931
1936
|
|
|
1932
1937
|
/* SVG Icon Components are wrapped within a <div /> */
|
|
1933
1938
|
> div {
|
|
1934
|
-
margin
|
|
1939
|
+
margin: 1px 8px 0 0;
|
|
1935
1940
|
}
|
|
1936
1941
|
|
|
1937
1942
|
> svg {
|
|
@@ -2116,6 +2121,7 @@ const StyledField = styled(Field$2) `
|
|
|
2116
2121
|
const Box$b = styled.div `
|
|
2117
2122
|
background-color: ${p => (p.$isLight ? p.theme.color.white : 'transparent')};
|
|
2118
2123
|
padding: ${p => (p.$hasBorder || p.$isLight ? '16px' : 0)};
|
|
2124
|
+
width: 100%;
|
|
2119
2125
|
|
|
2120
2126
|
${p => p.$hasBorder &&
|
|
2121
2127
|
css `
|
|
@@ -5086,12 +5092,11 @@ const Box$1 = styled.div `
|
|
|
5086
5092
|
> .rs-stack-item {
|
|
5087
5093
|
> .rs-picker-toggle-placeholder {
|
|
5088
5094
|
font-size: 13px;
|
|
5089
|
-
line-height: 1.
|
|
5095
|
+
line-height: 1.5385; // = 20px
|
|
5090
5096
|
}
|
|
5091
5097
|
|
|
5092
5098
|
> svg {
|
|
5093
5099
|
height: 18px;
|
|
5094
|
-
/* margin-top: -2px; */
|
|
5095
5100
|
}
|
|
5096
5101
|
}
|
|
5097
5102
|
}
|
|
@@ -5224,9 +5229,7 @@ function MultiZoneEditor({ addButtonLabel, defaultValue = [], initialZone, isLab
|
|
|
5224
5229
|
}, [defaultValue]);
|
|
5225
5230
|
return (jsxs(Fieldset, { isHidden: isLabelHidden, isLight: isLight, legend: label, children: [jsx(Button, { accent: Accent.SECONDARY, Icon: Plus, isFullWidth: true, onClick: addZone, children: addButtonLabel }), jsx(Fragment, { children: zones.map((zone, index) => (
|
|
5226
5231
|
// eslint-disable-next-line react/no-array-index-key
|
|
5227
|
-
jsxs(Row, { children: [jsxs(ZoneWrapper, { children: [zone[labelPropName], jsxs("
|
|
5228
|
-
cursor: 'pointer'
|
|
5229
|
-
}, children: [jsx(SelectRectangle, {}), " Centrer sur la carte"] })] }), jsx(IconButton, { accent: Accent.SECONDARY, Icon: Edit, onClick: () => editZone(index, zone) }), jsx(IconButton, { accent: Accent.SECONDARY, "aria-label": "Supprimer cette zone", Icon: Delete, onClick: () => deleteZone(index) })] }, `zone-${index}`))) })] }));
|
|
5232
|
+
jsxs(Row, { children: [jsxs(ZoneWrapper, { children: [zone[labelPropName], jsxs(Link, { onClick: () => centerZone(zone), children: [jsx(SelectRectangle, {}), jsx("span", { children: "Centrer sur la carte" })] })] }), jsx(IconButton, { accent: Accent.SECONDARY, Icon: Edit, onClick: () => editZone(index, zone) }), jsx(IconButton, { accent: Accent.SECONDARY, "aria-label": "Supprimer cette zone", Icon: Delete, onClick: () => deleteZone(index) })] }, `zone-${index}`))) })] }));
|
|
5230
5233
|
}
|
|
5231
5234
|
const Row = styled.div `
|
|
5232
5235
|
align-items: center;
|
|
@@ -5242,10 +5245,20 @@ const ZoneWrapper = styled.div `
|
|
|
5242
5245
|
display: flex;
|
|
5243
5246
|
flex-grow: 1;
|
|
5244
5247
|
font-size: 13px;
|
|
5245
|
-
line-height: 1.
|
|
5248
|
+
line-height: 1.3077; // = 17px
|
|
5246
5249
|
justify-content: space-between;
|
|
5247
5250
|
padding: 6px 12px 6px;
|
|
5248
5251
|
`;
|
|
5252
|
+
const Link = styled.a `
|
|
5253
|
+
align-items: center;
|
|
5254
|
+
cursor: pointer;
|
|
5255
|
+
display: inline-flex;
|
|
5256
|
+
|
|
5257
|
+
> span {
|
|
5258
|
+
line-height: 1;
|
|
5259
|
+
margin: -2px 0 0 8px;
|
|
5260
|
+
}
|
|
5261
|
+
`;
|
|
5249
5262
|
|
|
5250
5263
|
function NumberInput({ isLabelHidden = false, isLight = false, label, onChange, ...originalProps }) {
|
|
5251
5264
|
const key = useMemo(() => `${originalProps.name}-${JSON.stringify(originalProps.defaultValue)}`, [originalProps.defaultValue, originalProps.name]);
|