@mtes-mct/monitor-ui 2.17.0 → 2.18.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [2.17.0](https://github.com/MTES-MCT/monitor-ui/compare/v2.16.0...v2.17.0) (2023-02-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * **fields:** add coordinates input ([7912c7a](https://github.com/MTES-MCT/monitor-ui/commit/7912c7a47aa1afeb90e6bc7bbeb49bcf1b9bd17f))
7
+
1
8
  # [2.16.0](https://github.com/MTES-MCT/monitor-ui/compare/v2.15.0...v2.16.0) (2023-02-13)
2
9
 
3
10
 
package/index.js CHANGED
@@ -2076,7 +2076,7 @@ const ICON_SIZE = {
2076
2076
  [Size.SMALL]: 12
2077
2077
  };
2078
2078
  function Button({ accent = Accent.PRIMARY, children, Icon, isFullWidth = false, onClick, size = Size.NORMAL, type = 'button', ...nativeProps }) {
2079
- const commonChildren = useMemo(() => (jsxs(Fragment, { children: [Icon && jsx(Icon, { size: ICON_SIZE[size] }), children] })), [children, Icon, size]);
2079
+ const commonChildren = useMemo(() => (jsxs(Fragment, { children: [Icon && jsx(Icon, { size: ICON_SIZE[size] }), children && jsx(ButtonLabel, { children: children })] })), [children, Icon, size]);
2080
2080
  const handleClick = useCallback((event) => {
2081
2081
  stopMouseEventPropagation(event);
2082
2082
  if (onClick) {
@@ -2113,11 +2113,10 @@ const PADDING$1 = {
2113
2113
  };
2114
2114
  const StyledButton$1 = styled.button `
2115
2115
  align-items: center;
2116
- display: flex;
2116
+ display: inline-flex;
2117
2117
  font-size: ${p => FONT_SIZE[p.size]};
2118
- justify-content: center;
2118
+ max-width: 100%;
2119
2119
  padding: ${p => PADDING$1[p.size]};
2120
- white-space: nowrap;
2121
2120
  width: ${p => (p.isFullWidth ? '100%' : 'auto')};
2122
2121
 
2123
2122
  /* SVG Icon Components are wrapped within a <div /> */
@@ -2125,6 +2124,14 @@ const StyledButton$1 = styled.button `
2125
2124
  margin-right: 5px;
2126
2125
  }
2127
2126
  `;
2127
+ const ButtonLabel = styled.span `
2128
+ line-height: 1.3846;
2129
+ margin-top: -3px;
2130
+ min-width: 0;
2131
+ overflow: hidden;
2132
+ text-overflow: ellipsis;
2133
+ white-space: nowrap;
2134
+ `;
2128
2135
  const PrimaryButton = styled.button `
2129
2136
  background-color: ${p => p.theme.color.charcoal};
2130
2137
  border: 1px solid ${p => p.theme.color.charcoal};