@simplybusiness/mobius 6.3.1 → 6.3.2

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/dist/esm/index.js CHANGED
@@ -2282,6 +2282,7 @@ var CheckboxGroup = forwardRef15((props, ref) => {
2282
2282
  if (isValidElement(child)) {
2283
2283
  const isLastItem = child === lastCheckbox;
2284
2284
  const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
2285
+ const childProps = child.props;
2285
2286
  return cloneElement4(
2286
2287
  child,
2287
2288
  {
@@ -2290,10 +2291,8 @@ var CheckboxGroup = forwardRef15((props, ref) => {
2290
2291
  isReadOnly,
2291
2292
  isInvalid,
2292
2293
  isLastItem,
2293
- selected: selected.includes(
2294
- child.props.value
2295
- ),
2296
- onChange: handleChange,
2294
+ selected: selected.includes(childProps.value),
2295
+ onChange: childProps.onChange || handleChange,
2297
2296
  "aria-describedby": describedBy
2298
2297
  }
2299
2298
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplybusiness/mobius",
3
3
  "license": "UNLICENSED",
4
- "version": "6.3.1",
4
+ "version": "6.3.2",
5
5
  "description": "Core library of Mobius react components",
6
6
  "repository": {
7
7
  "type": "git",
@@ -160,6 +160,11 @@ export const CheckboxGroup: ForwardedRefComponent<
160
160
  isDisabled ||
161
161
  (lastItemDisables && lastCheckboxIsChecked && !isLastItem);
162
162
 
163
+ const childProps = child.props as {
164
+ value: string;
165
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
166
+ };
167
+
163
168
  return cloneElement(
164
169
  child as ReactElement,
165
170
  {
@@ -168,10 +173,8 @@ export const CheckboxGroup: ForwardedRefComponent<
168
173
  isReadOnly,
169
174
  isInvalid,
170
175
  isLastItem,
171
- selected: selected.includes(
172
- (child.props as { value: string }).value,
173
- ),
174
- onChange: handleChange,
176
+ selected: selected.includes(childProps.value),
177
+ onChange: childProps.onChange || handleChange,
175
178
  "aria-describedby": describedBy,
176
179
  } as Record<string, unknown>,
177
180
  );
@@ -1,6 +1,6 @@
1
1
  .mobius-error-message {
2
2
  box-sizing: border-box;
3
- display: grid;
3
+ display: var(--error-message-display, grid);
4
4
  gap: var(--error-message-grid-gap, var(--size-xs));
5
5
  grid-template-columns: min-content 1fr;
6
6
  color: var(--color-error);