@simplybusiness/mobius 10.4.2 → 10.4.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/components/Popover/Arrow.js +43 -0
  3. package/dist/cjs/components/Popover/Arrow.js.map +7 -0
  4. package/dist/cjs/components/Popover/Popover.js +258 -83
  5. package/dist/cjs/components/Popover/Popover.js.map +4 -4
  6. package/dist/cjs/components/Popover/index.js +258 -83
  7. package/dist/cjs/components/Popover/index.js.map +4 -4
  8. package/dist/cjs/components/Popover/useAutoUpdate.js +53 -0
  9. package/dist/cjs/components/Popover/useAutoUpdate.js.map +7 -0
  10. package/dist/cjs/components/Popover/useFloatingPosition.js +128 -0
  11. package/dist/cjs/components/Popover/useFloatingPosition.js.map +7 -0
  12. package/dist/cjs/components/Popover/useOutsidePress.js +46 -0
  13. package/dist/cjs/components/Popover/useOutsidePress.js.map +7 -0
  14. package/dist/cjs/components/index.js +422 -245
  15. package/dist/cjs/components/index.js.map +4 -4
  16. package/dist/cjs/index.js +422 -245
  17. package/dist/cjs/index.js.map +4 -4
  18. package/dist/cjs/meta.json +316 -32
  19. package/dist/esm/chunk-26KZYRE6.js +108 -0
  20. package/dist/esm/chunk-26KZYRE6.js.map +7 -0
  21. package/dist/esm/chunk-CAL44W47.js +23 -0
  22. package/dist/esm/chunk-CAL44W47.js.map +7 -0
  23. package/dist/esm/{chunk-PEEQNAIN.js → chunk-DMYDWKKA.js} +4 -4
  24. package/dist/esm/chunk-K3ECDAUR.js +33 -0
  25. package/dist/esm/chunk-K3ECDAUR.js.map +7 -0
  26. package/dist/esm/{chunk-GJBH37DH.js → chunk-KFHPI67N.js} +4 -4
  27. package/dist/esm/{chunk-F5ELD54X.js → chunk-LGZWQZLS.js} +2 -2
  28. package/dist/esm/{chunk-OAG5T7NC.js → chunk-NEFRXIFY.js} +4 -4
  29. package/dist/esm/chunk-VZ3IWSK6.js +158 -0
  30. package/dist/esm/chunk-VZ3IWSK6.js.map +7 -0
  31. package/dist/esm/chunk-WYJP7HVL.js +26 -0
  32. package/dist/esm/chunk-WYJP7HVL.js.map +7 -0
  33. package/dist/esm/components/AddressLookup/AddressLookup.js +4 -4
  34. package/dist/esm/components/AddressLookup/index.js +6 -6
  35. package/dist/esm/components/Breadcrumbs/index.js +3 -3
  36. package/dist/esm/components/Checkbox/index.js +1 -1
  37. package/dist/esm/components/Combobox/Combobox.js +3 -3
  38. package/dist/esm/components/Combobox/index.js +3 -3
  39. package/dist/esm/components/Drawer/index.js +3 -3
  40. package/dist/esm/components/Modal/index.js +3 -3
  41. package/dist/esm/components/Popover/Arrow.js +8 -0
  42. package/dist/esm/components/Popover/Arrow.js.map +7 -0
  43. package/dist/esm/components/Popover/Popover.js +5 -1
  44. package/dist/esm/components/Popover/index.js +5 -1
  45. package/dist/esm/components/Popover/useAutoUpdate.js +8 -0
  46. package/dist/esm/components/Popover/useAutoUpdate.js.map +7 -0
  47. package/dist/esm/components/Popover/useFloatingPosition.js +8 -0
  48. package/dist/esm/components/Popover/useFloatingPosition.js.map +7 -0
  49. package/dist/esm/components/Popover/useOutsidePress.js +8 -0
  50. package/dist/esm/components/Popover/useOutsidePress.js.map +7 -0
  51. package/dist/esm/components/index.js +77 -73
  52. package/dist/esm/index.js +77 -73
  53. package/dist/esm/meta.json +3737 -3401
  54. package/dist/tsconfig.build.tsbuildinfo +1 -1
  55. package/dist/types/components/Popover/Arrow.d.ts +9 -0
  56. package/dist/types/components/Popover/useAutoUpdate.d.ts +9 -0
  57. package/dist/types/components/Popover/useFloatingPosition.d.ts +17 -0
  58. package/dist/types/components/Popover/useOutsidePress.d.ts +9 -0
  59. package/package.json +1 -2
  60. package/src/components/Popover/Arrow.tsx +25 -0
  61. package/src/components/Popover/Popover.characterization.test.tsx +269 -0
  62. package/src/components/Popover/Popover.stories.tsx +40 -3
  63. package/src/components/Popover/Popover.test.tsx +6 -2
  64. package/src/components/Popover/Popover.tsx +87 -81
  65. package/src/components/Popover/useAutoUpdate.ts +43 -0
  66. package/src/components/Popover/useFloatingPosition.ts +177 -0
  67. package/src/components/Popover/useOutsidePress.ts +31 -0
  68. package/dist/esm/chunk-O5YEU5TG.js +0 -155
  69. package/dist/esm/chunk-O5YEU5TG.js.map +0 -7
  70. /package/dist/esm/{chunk-PEEQNAIN.js.map → chunk-DMYDWKKA.js.map} +0 -0
  71. /package/dist/esm/{chunk-GJBH37DH.js.map → chunk-KFHPI67N.js.map} +0 -0
  72. /package/dist/esm/{chunk-F5ELD54X.js.map → chunk-LGZWQZLS.js.map} +0 -0
  73. /package/dist/esm/{chunk-OAG5T7NC.js.map → chunk-NEFRXIFY.js.map} +0 -0
package/dist/cjs/index.js CHANGED
@@ -1082,17 +1082,17 @@ var MaskedField_exports = {};
1082
1082
  __export(MaskedField_exports, {
1083
1083
  MaskedField: () => MaskedField
1084
1084
  });
1085
- var import_react48, import_react_imask, import_jsx_runtime75, useAcceptHandler, useCombinedRef, useBlurHandler, ControlledMaskedField, UncontrolledMaskedField, MaskedField;
1085
+ var import_react50, import_react_imask, import_jsx_runtime76, useAcceptHandler, useCombinedRef, useBlurHandler, ControlledMaskedField, UncontrolledMaskedField, MaskedField;
1086
1086
  var init_MaskedField = __esm({
1087
1087
  "src/components/MaskedField/MaskedField.tsx"() {
1088
1088
  "use strict";
1089
1089
  "use client";
1090
- import_react48 = require("react");
1090
+ import_react50 = require("react");
1091
1091
  import_react_imask = require("react-imask");
1092
1092
  init_TextField2();
1093
- import_jsx_runtime75 = require("react/jsx-runtime");
1093
+ import_jsx_runtime76 = require("react/jsx-runtime");
1094
1094
  useAcceptHandler = (onChange, useMaskedValue, name) => {
1095
- return (0, import_react48.useCallback)(
1095
+ return (0, import_react50.useCallback)(
1096
1096
  (maskedValue, maskInstance) => {
1097
1097
  if (!onChange) {
1098
1098
  return;
@@ -1108,7 +1108,7 @@ var init_MaskedField = __esm({
1108
1108
  );
1109
1109
  };
1110
1110
  useCombinedRef = (imaskRef, forwardedRef) => {
1111
- return (0, import_react48.useCallback)(
1111
+ return (0, import_react50.useCallback)(
1112
1112
  (element) => {
1113
1113
  imaskRef.current = element;
1114
1114
  if (typeof forwardedRef === "function") {
@@ -1121,7 +1121,7 @@ var init_MaskedField = __esm({
1121
1121
  );
1122
1122
  };
1123
1123
  useBlurHandler = (onBlur, maskRef, useMaskedValue, name) => {
1124
- return (0, import_react48.useCallback)(
1124
+ return (0, import_react50.useCallback)(
1125
1125
  (event) => {
1126
1126
  if (!onBlur || !maskRef.current) {
1127
1127
  return;
@@ -1151,7 +1151,7 @@ var init_MaskedField = __esm({
1151
1151
  const { ref: imaskRef, maskRef, setValue } = (0, import_react_imask.useIMask)(mask, { onAccept });
1152
1152
  const combinedRef = useCombinedRef(imaskRef, forwardedRef);
1153
1153
  const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
1154
- (0, import_react48.useEffect)(() => {
1154
+ (0, import_react50.useEffect)(() => {
1155
1155
  if (!maskRef.current) {
1156
1156
  return;
1157
1157
  }
@@ -1162,7 +1162,7 @@ var init_MaskedField = __esm({
1162
1162
  setValue(stringValue);
1163
1163
  }
1164
1164
  }, [value, maskRef, setValue, imaskRef]);
1165
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
1165
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
1166
1166
  TextField,
1167
1167
  {
1168
1168
  ...textFieldProps,
@@ -1186,7 +1186,7 @@ var init_MaskedField = __esm({
1186
1186
  const { ref: imaskRef, maskRef } = (0, import_react_imask.useIMask)(mask, { onAccept });
1187
1187
  const combinedRef = useCombinedRef(imaskRef, forwardedRef);
1188
1188
  const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
1189
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
1189
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
1190
1190
  TextField,
1191
1191
  {
1192
1192
  ...textFieldProps,
@@ -1200,7 +1200,7 @@ var init_MaskedField = __esm({
1200
1200
  MaskedField = ({ ref: forwardedRef, ...props }) => {
1201
1201
  const { value, defaultValue, ...rest } = props;
1202
1202
  if ("value" in props) {
1203
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
1203
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
1204
1204
  ControlledMaskedField,
1205
1205
  {
1206
1206
  ...rest,
@@ -1209,7 +1209,7 @@ var init_MaskedField = __esm({
1209
1209
  }
1210
1210
  );
1211
1211
  } else {
1212
- return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
1212
+ return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
1213
1213
  UncontrolledMaskedField,
1214
1214
  {
1215
1215
  ...rest,
@@ -4053,59 +4053,231 @@ var PasswordField = ({
4053
4053
  PasswordField.displayName = "PasswordField";
4054
4054
 
4055
4055
  // src/components/Popover/Popover.tsx
4056
- var import_react35 = require("@floating-ui/react");
4057
4056
  var import_icons12 = require("@simplybusiness/icons");
4058
4057
  var import_dedupe42 = __toESM(require("classnames/dedupe"));
4059
- var import_react36 = require("react");
4058
+ var import_react38 = require("react");
4059
+ var import_react_dom = require("react-dom");
4060
4060
  var import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
4061
4061
  init_Icon2();
4062
- var import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
4062
+
4063
+ // src/components/Popover/Arrow.tsx
4063
4064
  var import_jsx_runtime51 = require("react/jsx-runtime");
4065
+ var Arrow = ({ ref, width = 20, className, style }) => {
4066
+ const height = width / 2;
4067
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4068
+ "svg",
4069
+ {
4070
+ ref,
4071
+ className,
4072
+ "aria-hidden": "true",
4073
+ width,
4074
+ height,
4075
+ viewBox: `0 0 ${width} ${height}`,
4076
+ style,
4077
+ children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("path", { d: `M0,0 H${width} L${width / 2},${height} Z` })
4078
+ }
4079
+ );
4080
+ };
4081
+
4082
+ // src/components/Popover/useAutoUpdate.ts
4083
+ var import_react35 = require("react");
4084
+ var useAutoUpdate = ({
4085
+ referenceRef,
4086
+ floatingRef,
4087
+ onUpdate,
4088
+ enabled
4089
+ }) => {
4090
+ (0, import_react35.useEffect)(() => {
4091
+ if (!enabled) return;
4092
+ const reference = referenceRef.current;
4093
+ const floating = floatingRef.current;
4094
+ const scrollOpts = {
4095
+ capture: true,
4096
+ passive: true
4097
+ };
4098
+ window.addEventListener("scroll", onUpdate, scrollOpts);
4099
+ window.addEventListener("resize", onUpdate, { passive: true });
4100
+ const observer = typeof ResizeObserver === "function" ? new ResizeObserver(onUpdate) : null;
4101
+ if (observer && reference) observer.observe(reference);
4102
+ if (observer && floating) observer.observe(floating);
4103
+ return () => {
4104
+ window.removeEventListener("scroll", onUpdate, scrollOpts);
4105
+ window.removeEventListener("resize", onUpdate);
4106
+ observer?.disconnect();
4107
+ };
4108
+ }, [enabled, onUpdate, referenceRef, floatingRef]);
4109
+ };
4110
+
4111
+ // src/components/Popover/useFloatingPosition.ts
4112
+ var import_react36 = require("react");
4113
+ var ABSOLUTE_FLOATING_STYLES = {
4114
+ position: "absolute",
4115
+ top: 0,
4116
+ left: 0,
4117
+ width: "max-content"
4118
+ };
4119
+ var FIXED_FLOATING_STYLES = {
4120
+ position: "fixed",
4121
+ top: 0,
4122
+ left: 0,
4123
+ width: "max-content"
4124
+ };
4125
+ var INITIAL_ARROW_STYLES = {
4126
+ position: "absolute"
4127
+ };
4128
+ var VIEWPORT_PADDING = 0;
4129
+ var createsFixedContainingBlock = (el) => {
4130
+ const style = window.getComputedStyle(el);
4131
+ return style.transform !== "none" || style.filter !== "none" || style.backdropFilter !== "none" || style.perspective !== "none" || /\b(transform|filter|perspective)\b/.test(style.willChange);
4132
+ };
4133
+ var useFloatingPosition = ({
4134
+ referenceRef,
4135
+ floatingRef,
4136
+ arrowRef,
4137
+ isOpen,
4138
+ offsetPx,
4139
+ arrowWidth,
4140
+ useFixedStrategy
4141
+ }) => {
4142
+ const update = (0, import_react36.useCallback)(() => {
4143
+ const reference = referenceRef.current;
4144
+ const floating = floatingRef.current;
4145
+ if (!reference || !floating) return;
4146
+ const refRect = reference.getBoundingClientRect();
4147
+ const floatingWidth = floating.offsetWidth;
4148
+ const floatingHeight = floating.offsetHeight;
4149
+ const scrollX = useFixedStrategy ? 0 : window.scrollX;
4150
+ const scrollY = useFixedStrategy ? 0 : window.scrollY;
4151
+ const parent = floating.parentElement;
4152
+ const parentIsCb = useFixedStrategy && !!parent && createsFixedContainingBlock(parent);
4153
+ const boundsRect = parentIsCb ? parent.getBoundingClientRect() : {
4154
+ left: 0,
4155
+ top: 0,
4156
+ right: window.innerWidth,
4157
+ bottom: window.innerHeight
4158
+ };
4159
+ const bottomTopViewport = refRect.bottom + offsetPx;
4160
+ const topTopViewport = refRect.top - floatingHeight - offsetPx;
4161
+ const overflowsBottom = bottomTopViewport + floatingHeight > boundsRect.bottom;
4162
+ const fitsTop = topTopViewport >= boundsRect.top;
4163
+ const nextPlacement = overflowsBottom && fitsTop ? "top" : "bottom";
4164
+ const topViewport = nextPlacement === "bottom" ? bottomTopViewport : topTopViewport;
4165
+ const rawLeftViewport = refRect.left + refRect.width / 2 - floatingWidth / 2;
4166
+ const minLeftViewport = boundsRect.left + VIEWPORT_PADDING;
4167
+ const maxLeftViewport = Math.max(
4168
+ minLeftViewport,
4169
+ boundsRect.right - floatingWidth - VIEWPORT_PADDING
4170
+ );
4171
+ const leftViewport = Math.min(
4172
+ Math.max(minLeftViewport, rawLeftViewport),
4173
+ maxLeftViewport
4174
+ );
4175
+ const cbOffsetLeft = parentIsCb ? boundsRect.left : 0;
4176
+ const cbOffsetTop = parentIsCb ? boundsRect.top : 0;
4177
+ floating.style.top = `${topViewport + scrollY - cbOffsetTop}px`;
4178
+ floating.style.left = `${leftViewport + scrollX - cbOffsetLeft}px`;
4179
+ const arrow = arrowRef.current;
4180
+ if (!arrow) return;
4181
+ const arrowHalf = arrowWidth / 2;
4182
+ const refCenterX = refRect.left + refRect.width / 2;
4183
+ const rawArrowLeft = refCenterX - leftViewport - arrowHalf;
4184
+ const maxArrowLeft = Math.max(0, floatingWidth - arrowWidth);
4185
+ const arrowLeft = Math.min(Math.max(0, rawArrowLeft), maxArrowLeft);
4186
+ arrow.style.left = `${arrowLeft}px`;
4187
+ if (nextPlacement === "bottom") {
4188
+ arrow.style.bottom = "100%";
4189
+ arrow.style.top = "";
4190
+ arrow.style.transform = "rotate(180deg)";
4191
+ } else {
4192
+ arrow.style.top = "100%";
4193
+ arrow.style.bottom = "";
4194
+ arrow.style.transform = "";
4195
+ }
4196
+ }, [
4197
+ referenceRef,
4198
+ floatingRef,
4199
+ arrowRef,
4200
+ offsetPx,
4201
+ arrowWidth,
4202
+ useFixedStrategy
4203
+ ]);
4204
+ (0, import_react36.useLayoutEffect)(() => {
4205
+ if (!isOpen) return;
4206
+ update();
4207
+ }, [isOpen, update]);
4208
+ return {
4209
+ initialFloatingStyles: useFixedStrategy ? FIXED_FLOATING_STYLES : ABSOLUTE_FLOATING_STYLES,
4210
+ initialArrowStyles: INITIAL_ARROW_STYLES,
4211
+ update
4212
+ };
4213
+ };
4214
+
4215
+ // src/components/Popover/useOutsidePress.ts
4216
+ var import_react37 = require("react");
4217
+ var useOutsidePress = ({
4218
+ referenceRef,
4219
+ floatingRef,
4220
+ enabled,
4221
+ onOutsidePress
4222
+ }) => {
4223
+ (0, import_react37.useEffect)(() => {
4224
+ if (!enabled) return;
4225
+ const handler = (event) => {
4226
+ const target = event.target;
4227
+ if (!target) return;
4228
+ if (referenceRef.current?.contains(target)) return;
4229
+ if (floatingRef.current?.contains(target)) return;
4230
+ onOutsidePress(event);
4231
+ };
4232
+ document.addEventListener("pointerdown", handler);
4233
+ return () => document.removeEventListener("pointerdown", handler);
4234
+ }, [enabled, onOutsidePress, referenceRef, floatingRef]);
4235
+ };
4236
+
4237
+ // src/components/Popover/Popover.tsx
4238
+ var import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
4239
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4064
4240
  var OFFSET_FROM_CONTENT_DEFAULT = 10;
4241
+ var ARROW_WIDTH = 20;
4065
4242
  var Popover = (props) => {
4066
4243
  const { trigger, children, onOpen, onClose, className } = props;
4067
- const arrowRef = (0, import_react36.useRef)(null);
4068
- const floatingContainerRef = (0, import_react36.useRef)(null);
4069
- const [isOpen, setIsOpen] = (0, import_react36.useState)(false);
4070
- const { refs, floatingStyles, context } = (0, import_react35.useFloating)({
4071
- open: isOpen,
4072
- onOpenChange: setIsOpen,
4073
- whileElementsMounted: import_react35.autoUpdate,
4074
- middleware: [
4075
- (0, import_react35.arrow)({
4076
- element: arrowRef
4077
- }),
4078
- (0, import_react35.offset)(OFFSET_FROM_CONTENT_DEFAULT),
4079
- (0, import_react35.shift)(),
4080
- (0, import_react35.flip)()
4081
- ]
4244
+ const referenceRef = (0, import_react38.useRef)(null);
4245
+ const floatingRef = (0, import_react38.useRef)(null);
4246
+ const arrowRef = (0, import_react38.useRef)(null);
4247
+ const [isOpen, setIsOpen] = (0, import_react38.useState)(false);
4248
+ const [portalTarget, setPortalTarget] = (0, import_react38.useState)(null);
4249
+ const isInsideDialog = portalTarget !== null && portalTarget.tagName === "DIALOG";
4250
+ const { initialFloatingStyles, initialArrowStyles, update } = useFloatingPosition({
4251
+ referenceRef,
4252
+ floatingRef,
4253
+ arrowRef,
4254
+ isOpen,
4255
+ offsetPx: OFFSET_FROM_CONTENT_DEFAULT,
4256
+ arrowWidth: ARROW_WIDTH,
4257
+ useFixedStrategy: isInsideDialog
4082
4258
  });
4083
- const dismiss = (0, import_react35.useDismiss)(context, {
4084
- bubbles: true,
4085
- outsidePress: (event) => {
4086
- const toggle = refs.reference.current;
4087
- const isToggleClick = !toggle?.contains(event.target);
4088
- if (isToggleClick) {
4089
- onClose?.();
4090
- }
4091
- return true;
4259
+ useAutoUpdate({
4260
+ referenceRef,
4261
+ floatingRef,
4262
+ onUpdate: update,
4263
+ enabled: isOpen
4264
+ });
4265
+ useOutsidePress({
4266
+ referenceRef,
4267
+ floatingRef,
4268
+ enabled: isOpen,
4269
+ onOutsidePress: () => {
4270
+ onClose?.();
4271
+ setIsOpen(false);
4092
4272
  }
4093
4273
  });
4094
- const { getReferenceProps, getFloatingProps } = (0, import_react35.useInteractions)([dismiss]);
4095
4274
  const containerClasses = (0, import_dedupe42.default)(
4096
4275
  "mobius",
4097
4276
  "mobius-popover__container",
4098
4277
  className
4099
4278
  );
4100
- const setFloatingRef = (0, import_react36.useCallback)(
4101
- (node) => {
4102
- refs.setFloating(node);
4103
- floatingContainerRef.current = node;
4104
- },
4105
- [refs]
4106
- );
4107
- (0, import_react36.useEffect)(() => {
4108
- const el = floatingContainerRef.current;
4279
+ (0, import_react38.useEffect)(() => {
4280
+ const el = floatingRef.current;
4109
4281
  if (!el) return;
4110
4282
  const preventLabelActivation = (e) => {
4111
4283
  const target = e.target;
@@ -4122,77 +4294,82 @@ var Popover = (props) => {
4122
4294
  onClose?.();
4123
4295
  return;
4124
4296
  }
4297
+ const dialog = referenceRef.current?.closest("dialog");
4298
+ setPortalTarget(dialog ?? document.body);
4125
4299
  setIsOpen(true);
4126
4300
  onOpen?.();
4127
4301
  };
4128
- const triggerComponent = (0, import_react36.cloneElement)(trigger, {
4129
- ref: refs.setReference,
4302
+ const setReferenceRef = (0, import_react38.useCallback)((node) => {
4303
+ referenceRef.current = node;
4304
+ }, []);
4305
+ const triggerComponent = (0, import_react38.cloneElement)(trigger, {
4306
+ ref: setReferenceRef,
4130
4307
  className: (0, import_dedupe42.default)(
4131
4308
  trigger.props.className,
4132
4309
  "mobius-popover__toggle"
4133
4310
  ),
4134
- onClick: toggleVisibility,
4135
- ...getReferenceProps()
4311
+ onClick: toggleVisibility
4136
4312
  });
4137
4313
  (0, import_mobius_hooks6.useWindowEvent)("keydown", (e) => {
4138
- if (e.key === "Escape") {
4314
+ if (e.key === "Escape" && isOpen) {
4315
+ setIsOpen(false);
4139
4316
  onClose?.();
4140
4317
  e.preventDefault();
4141
4318
  e.stopPropagation();
4142
4319
  }
4143
4320
  });
4144
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
4145
- triggerComponent,
4146
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
4147
- "div",
4148
- {
4149
- className: containerClasses,
4150
- ref: setFloatingRef,
4151
- style: floatingStyles,
4152
- ...getFloatingProps(),
4153
- children: [
4154
- /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "mobius-popover", children: [
4155
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("header", { className: "mobius-popover__header", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4156
- Button,
4157
- {
4158
- type: "button",
4159
- className: "mobius-popover__close-button",
4160
- onClick: toggleVisibility,
4161
- "aria-label": "Close",
4162
- variant: "ghost",
4163
- children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4164
- Icon,
4165
- {
4166
- icon: import_icons12.cross,
4167
- size: "md",
4168
- className: "mobius-popover__close-icon"
4169
- }
4170
- )
4171
- }
4172
- ) }),
4173
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-popover__body", children })
4174
- ] }),
4175
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
4176
- import_react35.FloatingArrow,
4321
+ const floatingElement = isOpen ? /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
4322
+ "div",
4323
+ {
4324
+ className: containerClasses,
4325
+ ref: floatingRef,
4326
+ style: initialFloatingStyles,
4327
+ children: [
4328
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mobius-popover", children: [
4329
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("header", { className: "mobius-popover__header", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4330
+ Button,
4177
4331
  {
4178
- ref: arrowRef,
4179
- context,
4180
- width: 20,
4181
- className: "mobius-popover__arrow-icon"
4332
+ type: "button",
4333
+ className: "mobius-popover__close-button",
4334
+ onClick: toggleVisibility,
4335
+ "aria-label": "Close",
4336
+ variant: "ghost",
4337
+ children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4338
+ Icon,
4339
+ {
4340
+ icon: import_icons12.cross,
4341
+ size: "md",
4342
+ className: "mobius-popover__close-icon"
4343
+ }
4344
+ )
4182
4345
  }
4183
- )
4184
- ]
4185
- }
4186
- )
4346
+ ) }),
4347
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mobius-popover__body", children })
4348
+ ] }),
4349
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4350
+ Arrow,
4351
+ {
4352
+ ref: arrowRef,
4353
+ style: initialArrowStyles,
4354
+ className: "mobius-popover__arrow-icon",
4355
+ width: ARROW_WIDTH
4356
+ }
4357
+ )
4358
+ ]
4359
+ }
4360
+ ) : null;
4361
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
4362
+ triggerComponent,
4363
+ floatingElement && portalTarget ? (0, import_react_dom.createPortal)(floatingElement, portalTarget) : null
4187
4364
  ] });
4188
4365
  };
4189
4366
 
4190
4367
  // src/components/Progress/Progress.tsx
4191
4368
  var import_dedupe43 = __toESM(require("classnames/dedupe"));
4192
- var import_react37 = require("react");
4369
+ var import_react39 = require("react");
4193
4370
  init_Label2();
4194
4371
  var import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
4195
- var import_jsx_runtime52 = require("react/jsx-runtime");
4372
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4196
4373
  function warnAboutInvalidValues(value, minValue, maxValue) {
4197
4374
  if (minValue > maxValue) {
4198
4375
  console.warn("minValue is greater than maxValue");
@@ -4212,7 +4389,7 @@ var sanitizedValue = (value, defaultValue) => {
4212
4389
  };
4213
4390
  var getLabelComponent = (label, progressLabelId, showLabel) => {
4214
4391
  if (showLabel) {
4215
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4392
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4216
4393
  Label,
4217
4394
  {
4218
4395
  id: progressLabelId,
@@ -4222,7 +4399,7 @@ var getLabelComponent = (label, progressLabelId, showLabel) => {
4222
4399
  }
4223
4400
  );
4224
4401
  }
4225
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
4402
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4226
4403
  Label,
4227
4404
  {
4228
4405
  id: progressLabelId,
@@ -4236,8 +4413,8 @@ var DEFAULT_VALUE = 0;
4236
4413
  var DEFAULT_MIN_VALUE = 0;
4237
4414
  var DEFAULT_MAX_VALUE = 100;
4238
4415
  var Progress = ({ ref, ...props }) => {
4239
- const progressId = (0, import_react37.useId)();
4240
- const progressLabelId = (0, import_react37.useId)();
4416
+ const progressId = (0, import_react39.useId)();
4417
+ const progressLabelId = (0, import_react39.useId)();
4241
4418
  const {
4242
4419
  id,
4243
4420
  label,
@@ -4272,7 +4449,7 @@ var Progress = ({ ref, ...props }) => {
4272
4449
  progressBarProps["aria-valuenow"] = value.toString();
4273
4450
  progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
4274
4451
  const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
4275
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
4452
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
4276
4453
  "div",
4277
4454
  {
4278
4455
  id: id || progressId,
@@ -4283,8 +4460,8 @@ var Progress = ({ ref, ...props }) => {
4283
4460
  "aria-labelledby": progressLabelId,
4284
4461
  children: [
4285
4462
  labelComponent,
4286
- /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mobius-progress__track", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
4287
- showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
4463
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-progress__track", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
4464
+ showValueLabel && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
4288
4465
  ]
4289
4466
  }
4290
4467
  );
@@ -4293,11 +4470,11 @@ Progress.displayName = "Progress";
4293
4470
 
4294
4471
  // src/components/Radio/Radio.tsx
4295
4472
  var import_dedupe44 = __toESM(require("classnames/dedupe"));
4296
- var import_react38 = require("react");
4473
+ var import_react40 = require("react");
4297
4474
  init_ErrorMessage2();
4298
4475
  init_Label2();
4299
4476
  var import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
4300
- var import_jsx_runtime53 = require("react/jsx-runtime");
4477
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4301
4478
  var Radio = ({ ref, ...props }) => {
4302
4479
  const {
4303
4480
  children,
@@ -4321,19 +4498,19 @@ var Radio = ({ ref, ...props }) => {
4321
4498
  const isMultiline = label && children;
4322
4499
  const isControlled = selected !== void 0;
4323
4500
  const isChecked = isControlled ? selected === value : defaultChecked;
4324
- const contentRef = (0, import_react38.useRef)(null);
4325
- const prevOverflowRef = (0, import_react38.useRef)({
4501
+ const contentRef = (0, import_react40.useRef)(null);
4502
+ const prevOverflowRef = (0, import_react40.useRef)({
4326
4503
  vertical: false,
4327
4504
  horizontal: false
4328
4505
  });
4329
- const hasIconFirst = (0, import_react38.useMemo)(() => {
4330
- if (!children || import_react38.Children.count(children) === 0) return false;
4331
- const firstChild = import_react38.Children.toArray(children)[0];
4332
- if (!(0, import_react38.isValidElement)(firstChild)) return false;
4506
+ const hasIconFirst = (0, import_react40.useMemo)(() => {
4507
+ if (!children || import_react40.Children.count(children) === 0) return false;
4508
+ const firstChild = import_react40.Children.toArray(children)[0];
4509
+ if (!(0, import_react40.isValidElement)(firstChild)) return false;
4333
4510
  const props2 = firstChild.props;
4334
4511
  return "icon" in props2 && props2.icon !== void 0;
4335
4512
  }, [children]);
4336
- (0, import_react38.useLayoutEffect)(() => {
4513
+ (0, import_react40.useLayoutEffect)(() => {
4337
4514
  if (!contentRef.current || !onOverflow) return;
4338
4515
  if (orientation === "vertical") {
4339
4516
  return;
@@ -4382,9 +4559,9 @@ var Radio = ({ ref, ...props }) => {
4382
4559
  onChange(adaptedEvent);
4383
4560
  }
4384
4561
  };
4385
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
4386
- /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Label, { className: containerClasses, children: [
4387
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
4562
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
4563
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Label, { className: containerClasses, children: [
4564
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4388
4565
  "input",
4389
4566
  {
4390
4567
  "aria-describedby": otherProps["aria-describedby"],
@@ -4401,25 +4578,25 @@ var Radio = ({ ref, ...props }) => {
4401
4578
  ...rest
4402
4579
  }
4403
4580
  ),
4404
- isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
4405
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
4406
- /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mobius-radio__extra-content", children })
4407
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
4581
+ isMultiline ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
4582
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mobius-radio__content-first-line", children: label }),
4583
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "mobius-radio__extra-content", children })
4584
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
4408
4585
  ] }),
4409
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorMessage, { errorMessage })
4586
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorMessage, { errorMessage })
4410
4587
  ] });
4411
4588
  };
4412
4589
  Radio.displayName = "Radio";
4413
4590
 
4414
4591
  // src/components/Radio/RadioGroup.tsx
4415
4592
  var import_dedupe45 = __toESM(require("classnames/dedupe"));
4416
- var import_react39 = require("react");
4593
+ var import_react41 = require("react");
4417
4594
  init_hooks();
4418
4595
  init_spaceDelimitedList();
4419
4596
  init_ErrorMessage2();
4420
4597
  init_Label2();
4421
4598
  init_Stack2();
4422
- var import_jsx_runtime54 = require("react/jsx-runtime");
4599
+ var import_jsx_runtime55 = require("react/jsx-runtime");
4423
4600
  var getDefaultVal = (children, defaultValue) => {
4424
4601
  if (Array.isArray(children) && defaultValue) {
4425
4602
  const option = children?.find((item) => item.props.value === defaultValue);
@@ -4447,15 +4624,15 @@ var RadioGroup = ({ ref, ...props }) => {
4447
4624
  ...rest
4448
4625
  } = props;
4449
4626
  const defaultSelected = getDefaultVal(children, value || defaultValue);
4450
- const [selected, setSelected] = (0, import_react39.useState)(defaultSelected);
4451
- const overflowsRef = (0, import_react39.useRef)({});
4452
- const [hasOverflow, setHasOverflow] = (0, import_react39.useState)(false);
4453
- (0, import_react39.useEffect)(() => {
4627
+ const [selected, setSelected] = (0, import_react41.useState)(defaultSelected);
4628
+ const overflowsRef = (0, import_react41.useRef)({});
4629
+ const [hasOverflow, setHasOverflow] = (0, import_react41.useState)(false);
4630
+ (0, import_react41.useEffect)(() => {
4454
4631
  if (value !== void 0) {
4455
4632
  setSelected(value);
4456
4633
  }
4457
4634
  }, [value]);
4458
- const handleOverflow = (0, import_react39.useCallback)(
4635
+ const handleOverflow = (0, import_react41.useCallback)(
4459
4636
  (radioValue, overflow) => {
4460
4637
  overflowsRef.current = {
4461
4638
  ...overflowsRef.current,
@@ -4489,16 +4666,16 @@ var RadioGroup = ({ ref, ...props }) => {
4489
4666
  [`--is-${effectiveOrientation}`]: true
4490
4667
  });
4491
4668
  const labelClasses = (0, import_dedupe45.default)(radioClasses, validationClasses);
4492
- const errorMessageId = (0, import_react39.useId)();
4493
- const defaultNameAttrId = (0, import_react39.useId)();
4669
+ const errorMessageId = (0, import_react41.useId)();
4670
+ const defaultNameAttrId = (0, import_react41.useId)();
4494
4671
  const nameAttribute = name || defaultNameAttrId;
4495
4672
  const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
4496
4673
  const describedBy = spaceDelimitedList([
4497
4674
  shouldErrorMessageShow,
4498
4675
  props["aria-describedby"]
4499
4676
  ]);
4500
- const labelId = (0, import_react39.useId)();
4501
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
4677
+ const labelId = (0, import_react41.useId)();
4678
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4502
4679
  "div",
4503
4680
  {
4504
4681
  ...rest,
@@ -4514,12 +4691,12 @@ var RadioGroup = ({ ref, ...props }) => {
4514
4691
  ref,
4515
4692
  className: radioGroupClasses,
4516
4693
  role: "radiogroup",
4517
- children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Stack, { gap: "xs", children: [
4518
- label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
4519
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: radioWrapperClasses, children: import_react39.Children.map(children, (child) => {
4520
- if ((0, import_react39.isValidElement)(child)) {
4694
+ children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { gap: "xs", children: [
4695
+ label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
4696
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: radioWrapperClasses, children: import_react41.Children.map(children, (child) => {
4697
+ if ((0, import_react41.isValidElement)(child)) {
4521
4698
  const childValue = child.props.value;
4522
- return (0, import_react39.cloneElement)(
4699
+ return (0, import_react41.cloneElement)(
4523
4700
  child,
4524
4701
  {
4525
4702
  orientation: effectiveOrientation,
@@ -4537,7 +4714,7 @@ var RadioGroup = ({ ref, ...props }) => {
4537
4714
  }
4538
4715
  return child;
4539
4716
  }) }),
4540
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
4717
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
4541
4718
  ] })
4542
4719
  }
4543
4720
  );
@@ -4546,7 +4723,7 @@ RadioGroup.displayName = "RadioGroup";
4546
4723
 
4547
4724
  // src/components/Segment/SegmentGroup.tsx
4548
4725
  var import_dedupe46 = __toESM(require("classnames/dedupe"));
4549
- var import_jsx_runtime55 = require("react/jsx-runtime");
4726
+ var import_jsx_runtime56 = require("react/jsx-runtime");
4550
4727
  var SegmentGroup = (props) => {
4551
4728
  const { children, horizontal, gap, className, ...rest } = props;
4552
4729
  const gapClass = gap ? `gap-${gap}` : "";
@@ -4557,14 +4734,14 @@ var SegmentGroup = (props) => {
4557
4734
  { "--is-horizontal": horizontal },
4558
4735
  gapClass
4559
4736
  );
4560
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: classes, ...rest, children });
4737
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: classes, ...rest, children });
4561
4738
  };
4562
4739
  SegmentGroup.displayName = "SegmentGroup";
4563
4740
 
4564
4741
  // src/components/Segment/Segment.tsx
4565
4742
  var import_dedupe47 = __toESM(require("classnames/dedupe"));
4566
4743
  var import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
4567
- var import_jsx_runtime56 = require("react/jsx-runtime");
4744
+ var import_jsx_runtime57 = require("react/jsx-runtime");
4568
4745
  var Segment = ({ ref, ...props }) => {
4569
4746
  const { heading, children, colour, inverted, className, ...rest } = props;
4570
4747
  const classes = (0, import_dedupe47.default)(
@@ -4574,8 +4751,8 @@ var Segment = ({ ref, ...props }) => {
4574
4751
  { inverted },
4575
4752
  className
4576
4753
  );
4577
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { ref, className: classes, ...rest, children: [
4578
- heading && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "mobius-segment__heading", children: heading }),
4754
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { ref, className: classes, ...rest, children: [
4755
+ heading && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "mobius-segment__heading", children: heading }),
4579
4756
  children
4580
4757
  ] });
4581
4758
  };
@@ -4584,7 +4761,7 @@ Segment.displayName = "Segment";
4584
4761
  // src/components/Select/Select.tsx
4585
4762
  var import_icons13 = require("@simplybusiness/icons");
4586
4763
  var import_dedupe48 = __toESM(require("classnames/dedupe"));
4587
- var import_react40 = require("react");
4764
+ var import_react42 = require("react");
4588
4765
  init_hooks();
4589
4766
  init_useLabel2();
4590
4767
  init_spaceDelimitedList();
@@ -4593,7 +4770,7 @@ init_Icon2();
4593
4770
  init_Label2();
4594
4771
  init_Stack2();
4595
4772
  var import_Select = require("@simplybusiness/mobius/src/components/Select/Select.css");
4596
- var import_jsx_runtime57 = require("react/jsx-runtime");
4773
+ var import_jsx_runtime58 = require("react/jsx-runtime");
4597
4774
  var Select = ({ ref, ...props }) => {
4598
4775
  const {
4599
4776
  label,
@@ -4631,7 +4808,7 @@ var Select = ({ ref, ...props }) => {
4631
4808
  otherProps.className
4632
4809
  );
4633
4810
  const iconClasses = (0, import_dedupe48.default)("mobius-select__icon", sharedClasses);
4634
- const errorMessageId = (0, import_react40.useId)();
4811
+ const errorMessageId = (0, import_react42.useId)();
4635
4812
  const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
4636
4813
  const describedBy = spaceDelimitedList([
4637
4814
  shouldErrorMessageShow,
@@ -4642,10 +4819,10 @@ var Select = ({ ref, ...props }) => {
4642
4819
  onChange(e);
4643
4820
  }
4644
4821
  };
4645
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
4646
- label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
4647
- /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: wrapperClasses, children: [
4648
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4822
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
4823
+ label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Label, { ...labelProps, className: labelClasses, children: label }),
4824
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: wrapperClasses, children: [
4825
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4649
4826
  "select",
4650
4827
  {
4651
4828
  ...otherProps,
@@ -4661,21 +4838,21 @@ var Select = ({ ref, ...props }) => {
4661
4838
  onChange: handleChange
4662
4839
  }
4663
4840
  ),
4664
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { icon: import_icons13.chevronDown }) })
4841
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { icon: import_icons13.chevronDown }) })
4665
4842
  ] }),
4666
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
4843
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ErrorMessage, { id: errorMessageId, errorMessage })
4667
4844
  ] });
4668
4845
  };
4669
4846
  Select.displayName = "Select";
4670
4847
 
4671
4848
  // src/components/Slider/Slider.tsx
4672
4849
  var import_dedupe49 = __toESM(require("classnames/dedupe"));
4673
- var import_react42 = require("react");
4850
+ var import_react44 = require("react");
4674
4851
  init_hooks();
4675
4852
  init_Label2();
4676
4853
 
4677
4854
  // src/components/Slider/helpers.ts
4678
- var import_react41 = require("react");
4855
+ var import_react43 = require("react");
4679
4856
  function numberFormatter(value, formatOptions, locale = navigator.languages?.[0] || "en-GB") {
4680
4857
  if (!formatOptions) {
4681
4858
  return value?.toString() || "";
@@ -4685,7 +4862,7 @@ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0]
4685
4862
 
4686
4863
  // src/components/Slider/Slider.tsx
4687
4864
  var import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
4688
- var import_jsx_runtime58 = require("react/jsx-runtime");
4865
+ var import_jsx_runtime59 = require("react/jsx-runtime");
4689
4866
  var Slider = (props) => {
4690
4867
  const {
4691
4868
  id,
@@ -4706,11 +4883,11 @@ var Slider = (props) => {
4706
4883
  formatOptions,
4707
4884
  isDisabled = false
4708
4885
  } = props;
4709
- const trackRef = (0, import_react42.useRef)(null);
4710
- const [currentValue, setCurrentValue] = (0, import_react42.useState)(
4886
+ const trackRef = (0, import_react44.useRef)(null);
4887
+ const [currentValue, setCurrentValue] = (0, import_react44.useState)(
4711
4888
  value || defaultValue || 0
4712
4889
  );
4713
- const [isDragging, setIsDraggging] = (0, import_react42.useState)(false);
4890
+ const [isDragging, setIsDraggging] = (0, import_react44.useState)(false);
4714
4891
  const { labelProps, fieldProps } = useLabel({
4715
4892
  id,
4716
4893
  label,
@@ -4740,12 +4917,12 @@ var Slider = (props) => {
4740
4917
  onChangeEnd(currentValue);
4741
4918
  }
4742
4919
  };
4743
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: classes, children: [
4744
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mobius-slider__label-wrapper", children: [
4745
- label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Label, { ...labelProps, children: label }),
4746
- label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
4920
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: classes, children: [
4921
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "mobius-slider__label-wrapper", children: [
4922
+ label && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Label, { ...labelProps, children: label }),
4923
+ label && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
4747
4924
  ] }),
4748
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4925
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
4749
4926
  "input",
4750
4927
  {
4751
4928
  className: "mobius-slider__track",
@@ -4764,23 +4941,23 @@ var Slider = (props) => {
4764
4941
  ...fieldProps
4765
4942
  }
4766
4943
  ) }),
4767
- /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mobius-slider__labels", children: [
4768
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
4769
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
4944
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "mobius-slider__labels", children: [
4945
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
4946
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
4770
4947
  ] })
4771
4948
  ] });
4772
4949
  };
4773
4950
 
4774
4951
  // src/components/SVG/SVG.tsx
4775
- var import_react43 = require("react");
4952
+ var import_react45 = require("react");
4776
4953
  var import_dedupe50 = __toESM(require("classnames/dedupe"));
4777
- var import_jsx_runtime59 = require("react/jsx-runtime");
4954
+ var import_jsx_runtime60 = require("react/jsx-runtime");
4778
4955
  var SVG = ({ ref, ...props }) => {
4779
4956
  const { children, className, ...otherProps } = props;
4780
4957
  const classes = (0, import_dedupe50.default)("mobius", "mobius-svg", className);
4781
- const svgNode = import_react43.Children.only(children);
4958
+ const svgNode = import_react45.Children.only(children);
4782
4959
  const { children: svgChildren, viewBox, xmlns } = svgNode.props;
4783
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
4960
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
4784
4961
  "svg",
4785
4962
  {
4786
4963
  viewBox,
@@ -4795,10 +4972,10 @@ var SVG = ({ ref, ...props }) => {
4795
4972
  SVG.displayName = "SVG";
4796
4973
 
4797
4974
  // src/components/Switch/Switch.tsx
4798
- var import_react44 = require("react");
4975
+ var import_react46 = require("react");
4799
4976
  var import_dedupe51 = __toESM(require("classnames/dedupe"));
4800
4977
  var import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
4801
- var import_jsx_runtime60 = require("react/jsx-runtime");
4978
+ var import_jsx_runtime61 = require("react/jsx-runtime");
4802
4979
  var Switch = ({ ref, ...props }) => {
4803
4980
  const {
4804
4981
  checked = false,
@@ -4807,8 +4984,8 @@ var Switch = ({ ref, ...props }) => {
4807
4984
  isDisabled = false,
4808
4985
  ...otherProps
4809
4986
  } = props;
4810
- const [enabled, setEnabled] = (0, import_react44.useState)(checked);
4811
- (0, import_react44.useEffect)(() => {
4987
+ const [enabled, setEnabled] = (0, import_react46.useState)(checked);
4988
+ (0, import_react46.useEffect)(() => {
4812
4989
  setEnabled(checked);
4813
4990
  }, [checked]);
4814
4991
  const classes = (0, import_dedupe51.default)(
@@ -4826,9 +5003,9 @@ var Switch = ({ ref, ...props }) => {
4826
5003
  onChange(event);
4827
5004
  }
4828
5005
  };
4829
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("label", { ref, className: classes, children: [
4830
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { children: enabled ? "On" : "Off" }) }),
4831
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5006
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("label", { ref, className: classes, children: [
5007
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { children: enabled ? "On" : "Off" }) }),
5008
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
4832
5009
  "input",
4833
5010
  {
4834
5011
  type: "checkbox",
@@ -4839,7 +5016,7 @@ var Switch = ({ ref, ...props }) => {
4839
5016
  ...otherProps
4840
5017
  }
4841
5018
  ),
4842
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "mobius-switch__slider" })
5019
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "mobius-switch__slider" })
4843
5020
  ] });
4844
5021
  };
4845
5022
  Switch.displayName = "Switch";
@@ -4847,72 +5024,72 @@ Switch.displayName = "Switch";
4847
5024
  // src/components/Table/Table.tsx
4848
5025
  var import_dedupe52 = __toESM(require("classnames/dedupe"));
4849
5026
  var import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
4850
- var import_jsx_runtime61 = require("react/jsx-runtime");
5027
+ var import_jsx_runtime62 = require("react/jsx-runtime");
4851
5028
  var Table = ({ ref, ...props }) => {
4852
5029
  const classes = (0, import_dedupe52.default)("mobius", "mobius-table", props.className);
4853
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("table", { ref, ...props, className: classes });
5030
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("table", { ref, ...props, className: classes });
4854
5031
  };
4855
5032
  Table.displayName = "Table";
4856
5033
 
4857
5034
  // src/components/Table/Head.tsx
4858
5035
  var import_dedupe53 = __toESM(require("classnames/dedupe"));
4859
- var import_jsx_runtime62 = require("react/jsx-runtime");
5036
+ var import_jsx_runtime63 = require("react/jsx-runtime");
4860
5037
  var Head = ({ ref, ...props }) => {
4861
5038
  const classes = (0, import_dedupe53.default)("mobius", "mobius-table__head", props.className);
4862
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("thead", { ref, ...props, className: classes });
5039
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("thead", { ref, ...props, className: classes });
4863
5040
  };
4864
5041
  Head.displayName = "Table.Head";
4865
5042
 
4866
5043
  // src/components/Table/Body.tsx
4867
5044
  var import_dedupe54 = __toESM(require("classnames/dedupe"));
4868
- var import_jsx_runtime63 = require("react/jsx-runtime");
5045
+ var import_jsx_runtime64 = require("react/jsx-runtime");
4869
5046
  var Body = ({ ref, ...props }) => {
4870
5047
  const classes = (0, import_dedupe54.default)("mobius", "mobius-table__body", props.className);
4871
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("tbody", { ref, ...props, className: classes });
5048
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("tbody", { ref, ...props, className: classes });
4872
5049
  };
4873
5050
  Body.displayName = "Table.Body";
4874
5051
 
4875
5052
  // src/components/Table/Foot.tsx
4876
5053
  var import_dedupe55 = __toESM(require("classnames/dedupe"));
4877
- var import_jsx_runtime64 = require("react/jsx-runtime");
5054
+ var import_jsx_runtime65 = require("react/jsx-runtime");
4878
5055
  var Foot = ({ ref, ...props }) => {
4879
5056
  const classes = (0, import_dedupe55.default)("mobius", "mobius-table__foot", props.className);
4880
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("tfoot", { ref, ...props, className: classes });
5057
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tfoot", { ref, ...props, className: classes });
4881
5058
  };
4882
5059
  Foot.displayName = "Table.Foot";
4883
5060
 
4884
5061
  // src/components/Table/Row.tsx
4885
5062
  var import_dedupe56 = __toESM(require("classnames/dedupe"));
4886
- var import_jsx_runtime65 = require("react/jsx-runtime");
5063
+ var import_jsx_runtime66 = require("react/jsx-runtime");
4887
5064
  var Row = ({ ref, ...props }) => {
4888
5065
  const classes = (0, import_dedupe56.default)("mobius", "mobius-table__row", props.className);
4889
- return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tr", { ref, ...props, className: classes });
5066
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("tr", { ref, ...props, className: classes });
4890
5067
  };
4891
5068
  Row.displayName = "Table.Row";
4892
5069
 
4893
5070
  // src/components/Table/HeaderCell.tsx
4894
5071
  var import_dedupe57 = __toESM(require("classnames/dedupe"));
4895
- var import_jsx_runtime66 = require("react/jsx-runtime");
5072
+ var import_jsx_runtime67 = require("react/jsx-runtime");
4896
5073
  var HeaderCell = ({ ref, scope = "col", ...props }) => {
4897
5074
  const classes = (0, import_dedupe57.default)(
4898
5075
  "mobius",
4899
5076
  "mobius-table__head-cell",
4900
5077
  props.className
4901
5078
  );
4902
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("th", { ...props, ref, scope, className: classes });
5079
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("th", { ...props, ref, scope, className: classes });
4903
5080
  };
4904
5081
  HeaderCell.displayName = "Table.HeaderCell";
4905
5082
 
4906
5083
  // src/components/Table/Cell.tsx
4907
5084
  var import_dedupe58 = __toESM(require("classnames/dedupe"));
4908
- var import_jsx_runtime67 = require("react/jsx-runtime");
5085
+ var import_jsx_runtime68 = require("react/jsx-runtime");
4909
5086
  var Cell = ({ ref, ...props }) => {
4910
5087
  const classes = (0, import_dedupe58.default)(
4911
5088
  "mobius",
4912
5089
  "mobius-table__body-cell",
4913
5090
  props.className
4914
5091
  );
4915
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("td", { ref, ...props, className: classes });
5092
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("td", { ref, ...props, className: classes });
4916
5093
  };
4917
5094
  Cell.displayName = "Table.Cell";
4918
5095
 
@@ -4936,7 +5113,7 @@ init_Stack2();
4936
5113
 
4937
5114
  // src/components/TextAreaInput/TextAreaInput.tsx
4938
5115
  var import_dedupe59 = __toESM(require("classnames/dedupe"));
4939
- var import_jsx_runtime68 = require("react/jsx-runtime");
5116
+ var import_jsx_runtime69 = require("react/jsx-runtime");
4940
5117
  var TextAreaInput = ({ ref, ...props }) => {
4941
5118
  const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
4942
5119
  const classes = (0, import_dedupe59.default)(
@@ -4949,7 +5126,7 @@ var TextAreaInput = ({ ref, ...props }) => {
4949
5126
  },
4950
5127
  otherProps.className
4951
5128
  );
4952
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5129
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
4953
5130
  "textarea",
4954
5131
  {
4955
5132
  ref,
@@ -4964,7 +5141,7 @@ TextAreaInput.displayName = "TextAreaInput";
4964
5141
 
4965
5142
  // src/components/TextArea/TextArea.tsx
4966
5143
  var import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
4967
- var import_jsx_runtime69 = require("react/jsx-runtime");
5144
+ var import_jsx_runtime70 = require("react/jsx-runtime");
4968
5145
  var TextArea = ({ ref, ...props }) => {
4969
5146
  const {
4970
5147
  isDisabled,
@@ -4984,9 +5161,9 @@ var TextArea = ({ ref, ...props }) => {
4984
5161
  },
4985
5162
  validationClasses
4986
5163
  );
4987
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Stack, { className: classes, gap: "xs", children: [
4988
- label && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
4989
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5164
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Stack, { className: classes, gap: "xs", children: [
5165
+ label && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
5166
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
4990
5167
  TextAreaInput,
4991
5168
  {
4992
5169
  ...otherProps,
@@ -4997,7 +5174,7 @@ var TextArea = ({ ref, ...props }) => {
4997
5174
  "aria-invalid": errorMessage != null
4998
5175
  }
4999
5176
  ),
5000
- /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
5177
+ /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
5001
5178
  ] });
5002
5179
  };
5003
5180
  TextArea.displayName = "TextArea";
@@ -5005,7 +5182,7 @@ TextArea.displayName = "TextArea";
5005
5182
  // src/components/Title/Title.tsx
5006
5183
  var import_dedupe61 = __toESM(require("classnames/dedupe"));
5007
5184
  var import_Title = require("@simplybusiness/mobius/src/components/Title/Title.css");
5008
- var import_jsx_runtime70 = require("react/jsx-runtime");
5185
+ var import_jsx_runtime71 = require("react/jsx-runtime");
5009
5186
  var Title = ({ ref, ...props }) => {
5010
5187
  const {
5011
5188
  elementType: Element = "div",
@@ -5017,9 +5194,9 @@ var Title = ({ ref, ...props }) => {
5017
5194
  const headerClasses = (0, import_dedupe61.default)("mobius", "mobius-title__header");
5018
5195
  const contentClasses = (0, import_dedupe61.default)("mobius", "mobius-title__description");
5019
5196
  const containerClasses = (0, import_dedupe61.default)("mobius", "mobius-title__container");
5020
- return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Flex, { flexDirection: "column", className: containerClasses, children: [
5021
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: headerClasses, children: title }),
5022
- /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: contentClasses, children: description })
5197
+ return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Flex, { flexDirection: "column", className: containerClasses, children: [
5198
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { className: headerClasses, children: title }),
5199
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { className: contentClasses, children: description })
5023
5200
  ] }) });
5024
5201
  };
5025
5202
  Title.displayName = "Title";
@@ -5037,7 +5214,7 @@ var toastState = {
5037
5214
 
5038
5215
  // src/components/Toast/Toast.tsx
5039
5216
  var import_Toast = require("@simplybusiness/mobius/src/components/Toast/Toast.css");
5040
- var import_jsx_runtime71 = require("react/jsx-runtime");
5217
+ var import_jsx_runtime72 = require("react/jsx-runtime");
5041
5218
  var variantIcons = {
5042
5219
  info: import_icons14.circleInfo,
5043
5220
  success: import_icons14.circleCheck,
@@ -5050,8 +5227,8 @@ var variantColors = {
5050
5227
  warning: "var(--color-warning)",
5051
5228
  error: "var(--color-error)"
5052
5229
  };
5053
- var ToastIcon = ({ variant }) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "mobius-toast__icon", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Icon, { icon: variantIcons[variant], color: variantColors[variant] }) });
5054
- var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "mobius-toast__close-icon", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Icon, { icon: import_icons14.cross }) });
5230
+ var ToastIcon = ({ variant }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "mobius-toast__icon", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { icon: variantIcons[variant], color: variantColors[variant] }) });
5231
+ var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "mobius-toast__close-icon", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Icon, { icon: import_icons14.cross }) });
5055
5232
  var ToastContent = ({
5056
5233
  toastId,
5057
5234
  variant,
@@ -5060,15 +5237,15 @@ var ToastContent = ({
5060
5237
  action,
5061
5238
  cancel,
5062
5239
  showCloseButton = toastState.showCloseButton
5063
- }) => /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: (0, import_dedupe62.default)("mobius", "mobius-toast", `--${variant}`), children: [
5064
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ToastIcon, { variant }),
5065
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "mobius-toast__body", children: [
5066
- /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "mobius-toast__content", children: [
5067
- title && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "mobius-toast__title", children: title }),
5068
- description && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "mobius-toast__description", children: description })
5240
+ }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: (0, import_dedupe62.default)("mobius", "mobius-toast", `--${variant}`), children: [
5241
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(ToastIcon, { variant }),
5242
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "mobius-toast__body", children: [
5243
+ /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "mobius-toast__content", children: [
5244
+ title && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "mobius-toast__title", children: title }),
5245
+ description && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "mobius-toast__description", children: description })
5069
5246
  ] }),
5070
- (action || cancel) && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "mobius-toast__actions", children: [
5071
- cancel && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5247
+ (action || cancel) && /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "mobius-toast__actions", children: [
5248
+ cancel && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5072
5249
  "button",
5073
5250
  {
5074
5251
  type: "button",
@@ -5080,7 +5257,7 @@ var ToastContent = ({
5080
5257
  children: cancel.label
5081
5258
  }
5082
5259
  ),
5083
- action && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5260
+ action && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5084
5261
  "button",
5085
5262
  {
5086
5263
  type: "button",
@@ -5094,19 +5271,19 @@ var ToastContent = ({
5094
5271
  )
5095
5272
  ] })
5096
5273
  ] }),
5097
- showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5274
+ showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5098
5275
  "button",
5099
5276
  {
5100
5277
  type: "button",
5101
5278
  className: "mobius-toast__close",
5102
5279
  onClick: () => import_sonner.toast.dismiss(toastId),
5103
5280
  "aria-label": "Close",
5104
- children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(CloseIcon, {})
5281
+ children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(CloseIcon, {})
5105
5282
  }
5106
5283
  )
5107
5284
  ] });
5108
5285
  var createCustomToast = (message, variant, options) => import_sonner.toast.custom(
5109
- (id) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
5286
+ (id) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5110
5287
  ToastContent,
5111
5288
  {
5112
5289
  toastId: id,
@@ -5138,9 +5315,9 @@ var toast = {
5138
5315
  };
5139
5316
 
5140
5317
  // src/components/Toast/Toaster.tsx
5141
- var import_react45 = require("react");
5318
+ var import_react47 = require("react");
5142
5319
  var import_sonner2 = require("sonner");
5143
- var import_jsx_runtime72 = require("react/jsx-runtime");
5320
+ var import_jsx_runtime73 = require("react/jsx-runtime");
5144
5321
  var Toaster = ({
5145
5322
  position = "top-right",
5146
5323
  closeButton = true,
@@ -5149,10 +5326,10 @@ var Toaster = ({
5149
5326
  visibleToasts = 3,
5150
5327
  gap = 8
5151
5328
  }) => {
5152
- (0, import_react45.useEffect)(() => {
5329
+ (0, import_react47.useEffect)(() => {
5153
5330
  toastState.showCloseButton = closeButton;
5154
5331
  }, [closeButton]);
5155
- return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
5332
+ return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5156
5333
  import_sonner2.Toaster,
5157
5334
  {
5158
5335
  position,
@@ -5168,7 +5345,7 @@ Toaster.displayName = "Toaster";
5168
5345
 
5169
5346
  // src/components/Trust/Trust.tsx
5170
5347
  var import_dedupe63 = __toESM(require("classnames/dedupe"));
5171
- var import_react46 = require("react");
5348
+ var import_react48 = require("react");
5172
5349
  init_utils();
5173
5350
 
5174
5351
  // src/components/Trust/constants.ts
@@ -5233,7 +5410,7 @@ var TRUSTPILOT_WIDGET = {
5233
5410
  };
5234
5411
 
5235
5412
  // src/components/Trust/Trust.tsx
5236
- var import_jsx_runtime73 = require("react/jsx-runtime");
5413
+ var import_jsx_runtime74 = require("react/jsx-runtime");
5237
5414
  var Trust = ({ ref, ...props }) => {
5238
5415
  const {
5239
5416
  elementType: Element = "div",
@@ -5245,8 +5422,8 @@ var Trust = ({ ref, ...props }) => {
5245
5422
  stars,
5246
5423
  className
5247
5424
  } = props;
5248
- const [isMounted, setIsMounted] = (0, import_react46.useState)(false);
5249
- const trustRef = (0, import_react46.useRef)(null);
5425
+ const [isMounted, setIsMounted] = (0, import_react48.useState)(false);
5426
+ const trustRef = (0, import_react48.useRef)(null);
5250
5427
  const {
5251
5428
  templateId,
5252
5429
  className: variantClassName,
@@ -5273,24 +5450,24 @@ var Trust = ({ ref, ...props }) => {
5273
5450
  },
5274
5451
  className
5275
5452
  );
5276
- (0, import_react46.useEffect)(() => {
5453
+ (0, import_react48.useEffect)(() => {
5277
5454
  const hasTrustpilotLoaded = trustRef.current && window?.Trustpilot && window?.Trustpilot.loadFromElement;
5278
5455
  if (isMounted && hasTrustpilotLoaded) {
5279
5456
  window.Trustpilot.loadFromElement(trustRef.current, true);
5280
5457
  }
5281
5458
  }, [isMounted]);
5282
- (0, import_react46.useEffect)(() => {
5459
+ (0, import_react48.useEffect)(() => {
5283
5460
  setIsMounted(true);
5284
5461
  }, []);
5285
- if (!isMounted) return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { style: styles });
5286
- return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5462
+ if (!isMounted) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { style: styles });
5463
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5287
5464
  Element,
5288
5465
  {
5289
5466
  ref: mergeRefs([trustRef, ref]),
5290
5467
  className: classes,
5291
5468
  style: styles,
5292
5469
  ...dataProps,
5293
- children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
5470
+ children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5294
5471
  "a",
5295
5472
  {
5296
5473
  href: link,
@@ -5306,11 +5483,11 @@ var Trust = ({ ref, ...props }) => {
5306
5483
 
5307
5484
  // src/components/ExpandableText/ExpandableText.tsx
5308
5485
  var import_dedupe64 = __toESM(require("classnames/dedupe"));
5309
- var import_react47 = require("react");
5486
+ var import_react49 = require("react");
5310
5487
  init_hooks();
5311
5488
  init_TextOrHTML2();
5312
5489
  var import_ExpandableText = require("@simplybusiness/mobius/src/components/ExpandableText/ExpandableText.css");
5313
- var import_jsx_runtime74 = require("react/jsx-runtime");
5490
+ var import_jsx_runtime75 = require("react/jsx-runtime");
5314
5491
  var ExpandableText = ({ ref, ...props }) => {
5315
5492
  const {
5316
5493
  text,
@@ -5324,14 +5501,14 @@ var ExpandableText = ({ ref, ...props }) => {
5324
5501
  onToggle,
5325
5502
  ...otherProps
5326
5503
  } = props;
5327
- const [isExpanded, setIsExpanded] = (0, import_react47.useState)(false);
5328
- const [isCollapsed, setIsCollapsed] = (0, import_react47.useState)(false);
5329
- const textRef = (0, import_react47.useRef)(null);
5504
+ const [isExpanded, setIsExpanded] = (0, import_react49.useState)(false);
5505
+ const [isCollapsed, setIsCollapsed] = (0, import_react49.useState)(false);
5506
+ const textRef = (0, import_react49.useRef)(null);
5330
5507
  const { down } = useBreakpoint();
5331
- const baseId = (0, import_react47.useId)();
5508
+ const baseId = (0, import_react49.useId)();
5332
5509
  const expandButtonId = `expandable-text-expand-${baseId}`;
5333
5510
  const shouldCollapse = breakpoint ? down(breakpoint) : true;
5334
- (0, import_react47.useEffect)(() => {
5511
+ (0, import_react49.useEffect)(() => {
5335
5512
  if (!shouldCollapse || !textRef.current) {
5336
5513
  setIsCollapsed(false);
5337
5514
  return;
@@ -5341,7 +5518,7 @@ var ExpandableText = ({ ref, ...props }) => {
5341
5518
  setIsCollapsed(isOverflowing);
5342
5519
  }, [text, shouldCollapse, maxLines]);
5343
5520
  if (breakpoint && !shouldCollapse) {
5344
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TextOrHTML, { text, textWrapper: true, ...textProps }) });
5521
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextOrHTML, { text, textWrapper: true, ...textProps }) });
5345
5522
  }
5346
5523
  const handleAccordionChange = (expanded) => {
5347
5524
  setIsExpanded(expanded);
@@ -5354,7 +5531,7 @@ var ExpandableText = ({ ref, ...props }) => {
5354
5531
  const textContainerStyle = {
5355
5532
  "--line-clamp": maxLines
5356
5533
  };
5357
- return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
5534
+ return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
5358
5535
  "div",
5359
5536
  {
5360
5537
  ref,
@@ -5362,7 +5539,7 @@ var ExpandableText = ({ ref, ...props }) => {
5362
5539
  "data-testid": "expandable-text",
5363
5540
  ...otherProps,
5364
5541
  children: [
5365
- /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5542
+ /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5366
5543
  "div",
5367
5544
  {
5368
5545
  ref: textRef,
@@ -5370,10 +5547,10 @@ var ExpandableText = ({ ref, ...props }) => {
5370
5547
  style: textContainerStyle,
5371
5548
  "data-testid": "expandable-text-content",
5372
5549
  "aria-describedby": isCollapsed ? expandButtonId : void 0,
5373
- children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
5550
+ children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
5374
5551
  }
5375
5552
  ),
5376
- isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
5553
+ isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
5377
5554
  Accordion,
5378
5555
  {
5379
5556
  showText,
@@ -5396,7 +5573,7 @@ ExpandableText.displayName = "ExpandableText";
5396
5573
  // src/components/MaskedField/index.tsx
5397
5574
  var import_component = __toESM(require("@loadable/component"));
5398
5575
  init_TextField2();
5399
- var import_jsx_runtime76 = require("react/jsx-runtime");
5576
+ var import_jsx_runtime77 = require("react/jsx-runtime");
5400
5577
  var LoadableMaskedField = (0, import_component.default)(() => Promise.resolve().then(() => (init_MaskedField(), MaskedField_exports)), {
5401
5578
  resolveComponent: (mod) => mod.MaskedField
5402
5579
  });
@@ -5408,11 +5585,11 @@ function MaskedField2(props) {
5408
5585
  ref: forwardedRef,
5409
5586
  ...textFieldProps
5410
5587
  } = props;
5411
- return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5588
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5412
5589
  LoadableMaskedField,
5413
5590
  {
5414
5591
  ...props,
5415
- fallback: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
5592
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
5416
5593
  TextField,
5417
5594
  {
5418
5595
  ...textFieldProps,