@simplybusiness/mobius 6.3.1 → 6.3.3

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 73eef9e: Fix: Update address field mapping for US street
8
+ - 5229bb9: Expandable test component dangerously sets inner html
9
+
10
+ ## 6.3.2
11
+
12
+ ### Patch Changes
13
+
14
+ - 0439088: Fix CTM style snags with ErrorMessage and Checkbox
15
+
3
16
  ## 6.3.1
4
17
 
5
18
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -2383,6 +2383,7 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
2383
2383
  if ((0, import_react33.isValidElement)(child)) {
2384
2384
  const isLastItem = child === lastCheckbox;
2385
2385
  const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
2386
+ const childProps = child.props;
2386
2387
  return (0, import_react33.cloneElement)(
2387
2388
  child,
2388
2389
  {
@@ -2391,10 +2392,8 @@ var CheckboxGroup = (0, import_react33.forwardRef)((props, ref) => {
2391
2392
  isReadOnly,
2392
2393
  isInvalid,
2393
2394
  isLastItem,
2394
- selected: selected.includes(
2395
- child.props.value
2396
- ),
2397
- onChange: handleChange,
2395
+ selected: selected.includes(childProps.value),
2396
+ onChange: childProps.onChange || handleChange,
2398
2397
  "aria-describedby": describedBy
2399
2398
  }
2400
2399
  );
@@ -4497,7 +4496,7 @@ var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
4497
4496
  setIsCollapsed(isOverflowing);
4498
4497
  }, [text, shouldCollapse, maxLines]);
4499
4498
  if (breakpoint && !shouldCollapse) {
4500
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text, { ...textProps, children: text }) });
4499
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text, { ...textProps, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { dangerouslySetInnerHTML: { __html: text } }) }) });
4501
4500
  }
4502
4501
  const handleAccordionChange = (expanded) => {
4503
4502
  setIsExpanded(expanded);
@@ -4526,7 +4525,7 @@ var ExpandableText = (0, import_react82.forwardRef)((props, ref) => {
4526
4525
  style: textContainerStyle,
4527
4526
  "data-testid": "expandable-text-content",
4528
4527
  "aria-describedby": isCollapsed ? expandButtonId : void 0,
4529
- children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text, { elementType: "span", ...textProps, children: text })
4528
+ children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Text, { elementType: "span", ...textProps, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { dangerouslySetInnerHTML: { __html: text } }) })
4530
4529
  }
4531
4530
  ),
4532
4531
  isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
@@ -4585,10 +4584,17 @@ var MaskedField = (0, import_react83.forwardRef)((props, ref) => {
4585
4584
  const {
4586
4585
  ref: maskRef,
4587
4586
  value: maskedValue,
4588
- unmaskedValue
4587
+ unmaskedValue,
4588
+ setValue
4589
4589
  } = (0, import_react_imask.useIMask)(mask, {
4590
- defaultValue
4590
+ defaultValue: value || defaultValue
4591
4591
  });
4592
+ (0, import_react83.useEffect)(() => {
4593
+ const valueToCompare = useMaskedValue ? maskedValue : unmaskedValue;
4594
+ if (value !== void 0 && value !== valueToCompare) {
4595
+ setValue(value);
4596
+ }
4597
+ }, [value, setValue]);
4592
4598
  const handleChange = (event) => {
4593
4599
  if (onChange) {
4594
4600
  onChange(