@mtes-mct/monitor-ui 1.7.3 → 1.7.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 CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.7.3](https://github.com/MTES-MCT/monitor-ui/compare/v1.7.2...v1.7.3) (2022-11-30)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **build:** disable rollup modules preservation ([#77](https://github.com/MTES-MCT/monitor-ui/issues/77)) ([d4e36ec](https://github.com/MTES-MCT/monitor-ui/commit/d4e36ece43e108f2b69f7d54ea247db3558217ee))
7
+ * **fields:** add missing keys in multi fields ([#76](https://github.com/MTES-MCT/monitor-ui/issues/76)) ([aa40638](https://github.com/MTES-MCT/monitor-ui/commit/aa40638d0a16c648c9f55684634bdbbde7fd2651))
8
+
1
9
  ## [1.7.2](https://github.com/MTES-MCT/monitor-ui/compare/v1.7.1...v1.7.2) (2022-11-29)
2
10
 
3
11
  ## [1.7.1](https://github.com/MTES-MCT/monitor-ui/compare/v1.7.0...v1.7.1) (2022-11-29)
@@ -1,6 +1,6 @@
1
1
  import type { CheckboxProps as RsuiteCheckboxProps } from 'rsuite';
2
2
  import type { Promisable } from 'type-fest';
3
- export declare type CheckboxProps = Omit<RsuiteCheckboxProps, 'checked' | 'id' | 'onChange'> & {
3
+ export declare type CheckboxProps = Omit<RsuiteCheckboxProps, 'as' | 'checked' | 'id' | 'onChange'> & {
4
4
  label: string;
5
5
  name: string;
6
6
  onChange?: (isCheched: boolean) => Promisable<void>;
package/index.js CHANGED
@@ -99,8 +99,11 @@ const Label = styled.label `
99
99
  `;
100
100
 
101
101
  function Legend({ isHidden = false, ...nativeProps }) {
102
- return jsx(Label, { as: "legend", isHidden: isHidden, ...nativeProps });
102
+ return jsx(StyledLabel, { as: "legend", isHidden: isHidden, ...nativeProps });
103
103
  }
104
+ const StyledLabel = styled(Label) `
105
+ padding: 0;
106
+ `;
104
107
 
105
108
  function Checkbox({ label, onChange, ...originalProps }) {
106
109
  const key = useMemo(() => `${originalProps.name}-${String(originalProps.defaultChecked)}`, [originalProps.defaultChecked, originalProps.name]);
@@ -110,8 +113,20 @@ function Checkbox({ label, onChange, ...originalProps }) {
110
113
  }
111
114
  onChange(isChecked);
112
115
  }, [onChange]);
113
- return (jsx(Checkbox$1, { id: originalProps.name, onChange: handleChange, ...originalProps, children: label }, key));
116
+ return (jsx(StyledCheckbox, { id: originalProps.name, onChange: handleChange, ...originalProps, children: label }, key));
114
117
  }
118
+ const StyledCheckbox = styled(Checkbox$1) `
119
+ > .rs-checkbox-checker {
120
+ min-height: 0;
121
+ padding-left: 28px;
122
+ padding-top: 2px;
123
+
124
+ .rs-checkbox-wrapper {
125
+ left: 2px;
126
+ top: 0 !important;
127
+ }
128
+ }
129
+ `;
115
130
 
116
131
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
117
132
 
@@ -3141,19 +3156,13 @@ const ChecboxesBox$1 = styled.div `
3141
3156
  color: ${p => p.theme.color.gunMetal};
3142
3157
  display: flex;
3143
3158
  flex-direction: ${p => (p.isInline ? 'row' : 'column')};
3144
- font-weight: 500;
3145
-
3146
- > .rs-checkbox {
3147
- > .rs-checkbox-checker {
3148
- padding-left: 28px;
3149
- padding-top: 2px;
3150
3159
 
3151
- .rs-checkbox-wrapper {
3152
- left: 2px;
3153
- top: 0 !important;
3160
+ ${p => !p.isInline &&
3161
+ css `
3162
+ > .rs-checkbox:not(:first-child) {
3163
+ margin-top: 0.5rem;
3154
3164
  }
3155
- }
3156
- }
3165
+ `}
3157
3166
 
3158
3167
  ${p => p.isInline &&
3159
3168
  css `
@@ -3216,8 +3225,8 @@ const ChecboxesBox = styled.div `
3216
3225
 
3217
3226
  > .rs-radio {
3218
3227
  > .rs-radio-checker {
3219
- padding-left: 28px;
3220
- padding-top: 2px;
3228
+ min-height: 0;
3229
+ padding: 2px 0 0 28px;
3221
3230
 
3222
3231
  .rs-radio-wrapper {
3223
3232
  left: 2px;
@@ -3226,6 +3235,13 @@ const ChecboxesBox = styled.div `
3226
3235
  }
3227
3236
  }
3228
3237
 
3238
+ ${p => !p.isInline &&
3239
+ css `
3240
+ > .rs-radio:not(:first-child) {
3241
+ margin-top: 6px;
3242
+ }
3243
+ `}
3244
+
3229
3245
  ${p => p.isInline &&
3230
3246
  css `
3231
3247
  > .rs-radio:not(:first-child) {