@simplybusiness/mobius 5.29.4 → 5.29.6

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,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.29.6
4
+
5
+ ### Patch Changes
6
+
7
+ - e9fc12c: chore(deps): Update dependencies
8
+ - Updated dependencies [e9fc12c]
9
+ - @simplybusiness/icons@4.27.1
10
+
11
+ ## 5.29.5
12
+
13
+ ### Patch Changes
14
+
15
+ - 4ce860b: fix(useOnClickOutside): Allow null in RefObject type parameter
16
+
17
+ Updated useOnClickOutside hook to accept RefObject<HTMLElement | null> instead of RefObject<HTMLElement>, improving type safety and compatibility with React refs that can be null.
18
+
19
+ - 845388a: fix: improve strong typing for React cloneElement usage
20
+
21
+ Adds proper TypeScript typing for all React.cloneElement calls throughout the codebase to improve type safety and remove unsafe type assertions where possible.
22
+
23
+ - 39b6975: Updated all JSX type references to use React.JSX namespace instead of the global JSX namespace for better TypeScript compatibility with React 19.
24
+
3
25
  ## 5.29.4
4
26
 
5
27
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1995,9 +1995,13 @@ var Breadcrumbs = (0, import_react29.forwardRef)((props, ref) => {
1995
1995
  otherProps.className
1996
1996
  );
1997
1997
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { children: childArray.map(
1998
- (child, i) => (0, import_react29.cloneElement)(child, {
1999
- isCurrent: i === childArray.length - 1
2000
- })
1998
+ (child, i) => (0, import_react29.cloneElement)(
1999
+ child,
2000
+ {
2001
+ key: i,
2002
+ isCurrent: i === childArray.length - 1
2003
+ }
2004
+ )
2001
2005
  ) }) });
2002
2006
  });
2003
2007
  Breadcrumbs.displayName = "Breadcrumbs";
@@ -2029,7 +2033,11 @@ var BreadcrumbItem = (0, import_react30.forwardRef)((props, ref) => {
2029
2033
  );
2030
2034
  const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { ...itemProps, children }) : import_react30.Children.only(children);
2031
2035
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: classes, children: [
2032
- (0, import_react30.cloneElement)(child, { ...child.props, ...itemProps, ref }),
2036
+ (0, import_react30.cloneElement)(child, {
2037
+ ...child.props,
2038
+ ...itemProps,
2039
+ ref
2040
+ }),
2033
2041
  !props.isCurrent && separator
2034
2042
  ] });
2035
2043
  });
@@ -2310,16 +2318,21 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
2310
2318
  if ((0, import_react33.isValidElement)(child)) {
2311
2319
  const isLastItem = child === lastCheckbox;
2312
2320
  const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
2313
- return (0, import_react33.cloneElement)(child, {
2314
- isDisabled: isChildDisabled,
2315
- isRequired,
2316
- isReadOnly,
2317
- isInvalid,
2318
- isLastItem,
2319
- selected: selected.includes(child.props.value),
2320
- onChange: handleChange,
2321
- "aria-describedby": describedBy
2322
- });
2321
+ return (0, import_react33.cloneElement)(
2322
+ child,
2323
+ {
2324
+ isDisabled: isChildDisabled,
2325
+ isRequired,
2326
+ isReadOnly,
2327
+ isInvalid,
2328
+ isLastItem,
2329
+ selected: selected.includes(
2330
+ child.props.value
2331
+ ),
2332
+ onChange: handleChange,
2333
+ "aria-describedby": describedBy
2334
+ }
2335
+ );
2323
2336
  }
2324
2337
  return child;
2325
2338
  }) }),
@@ -2693,10 +2706,16 @@ var Item = (0, import_react42.forwardRef)(
2693
2706
  );
2694
2707
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Element, { ref, onClick, ...otherProps, children: import_react42.Children.map(children, (child) => {
2695
2708
  if ((0, import_react42.isValidElement)(child)) {
2696
- const childClasses = (0, import_dedupe23.default)(child.props.className, classes);
2697
- return (0, import_react42.cloneElement)(child, {
2698
- className: childClasses
2699
- });
2709
+ const childClasses = (0, import_dedupe23.default)(
2710
+ child.props.className,
2711
+ classes
2712
+ );
2713
+ return (0, import_react42.cloneElement)(
2714
+ child,
2715
+ {
2716
+ className: childClasses
2717
+ }
2718
+ );
2700
2719
  }
2701
2720
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: classes, children: child });
2702
2721
  }) });
@@ -3348,7 +3367,10 @@ var Popover = (props) => {
3348
3367
  };
3349
3368
  const triggerComponent = (0, import_react61.cloneElement)(trigger, {
3350
3369
  ref: refs.setReference,
3351
- className: (0, import_classnames3.default)(trigger.props.className, "mobius-popover__toggle"),
3370
+ className: (0, import_classnames3.default)(
3371
+ trigger.props.className,
3372
+ "mobius-popover__toggle"
3373
+ ),
3352
3374
  onClick: toggleVisibility,
3353
3375
  ...getReferenceProps()
3354
3376
  });
@@ -3667,16 +3689,19 @@ var RadioGroup = (0, import_react64.forwardRef)((props, ref) => {
3667
3689
  label && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
3668
3690
  /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: radioWrapperClasses, children: import_react64.Children.map(children, (child) => {
3669
3691
  if ((0, import_react64.isValidElement)(child)) {
3670
- return (0, import_react64.cloneElement)(child, {
3671
- orientation,
3672
- groupDisabled: isDisabled,
3673
- name: nameAttribute,
3674
- selected,
3675
- setSelected,
3676
- isRequired,
3677
- "aria-describedby": describedBy,
3678
- onChange
3679
- });
3692
+ return (0, import_react64.cloneElement)(
3693
+ child,
3694
+ {
3695
+ orientation,
3696
+ groupDisabled: isDisabled,
3697
+ name: nameAttribute,
3698
+ selected,
3699
+ setSelected,
3700
+ isRequired,
3701
+ "aria-describedby": describedBy,
3702
+ onChange
3703
+ }
3704
+ );
3680
3705
  }
3681
3706
  return child;
3682
3707
  }) }),