@simplybusiness/mobius 9.0.1 → 9.1.0
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 +18 -0
- package/dist/cjs/index.js +5481 -3973
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +444 -201
- package/dist/esm/MaskedField-CX4GV6JS.js +142 -0
- package/dist/esm/MaskedField-CX4GV6JS.js.map +7 -0
- package/dist/esm/chunk-XUNHMVIS.js +427 -0
- package/dist/esm/chunk-XUNHMVIS.js.map +7 -0
- package/dist/esm/index.js +580 -1029
- package/dist/esm/index.js.map +4 -4
- package/dist/esm/meta.json +258 -163
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/components/Combobox/Listbox.d.ts +2 -1
- package/dist/types/src/components/Combobox/Option.d.ts +1 -1
- package/dist/types/src/components/Combobox/index.d.ts +1 -0
- package/dist/types/src/components/Combobox/types.d.ts +3 -0
- package/dist/types/src/components/Combobox/utils.d.ts +1 -0
- package/dist/types/src/components/MaskedField/MaskedField.d.ts +1 -0
- package/dist/types/src/components/MaskedField/index.d.ts +6 -1
- package/package.json +5 -2
- package/src/components/Combobox/Combobox.test.tsx +164 -3
- package/src/components/Combobox/Combobox.tsx +54 -4
- package/src/components/Combobox/Listbox.tsx +4 -0
- package/src/components/Combobox/Option.tsx +8 -1
- package/src/components/Combobox/index.tsx +1 -0
- package/src/components/Combobox/types.tsx +3 -0
- package/src/components/Combobox/utils.test.tsx +39 -0
- package/src/components/Combobox/utils.tsx +7 -0
- package/src/components/Drawer/Drawer.mdx +1 -1
- package/src/components/Drawer/Drawer.stories.tsx +1 -1
- package/src/components/ErrorMessage/ErrorMessage.css +1 -1
- package/src/components/MaskedField/MaskedField.tsx +1 -0
- package/src/components/MaskedField/index.tsx +42 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import {
|
|
2
|
+
ErrorMessage,
|
|
3
|
+
Icon,
|
|
4
|
+
Label,
|
|
5
|
+
Stack,
|
|
6
|
+
Text,
|
|
7
|
+
TextField,
|
|
8
|
+
TextOrHTML,
|
|
9
|
+
__privateAdd,
|
|
10
|
+
__privateGet,
|
|
11
|
+
__privateSet,
|
|
12
|
+
spaceDelimitedList,
|
|
13
|
+
useLabel,
|
|
14
|
+
useTextField,
|
|
15
|
+
useValidationClasses
|
|
16
|
+
} from "./chunk-XUNHMVIS.js";
|
|
8
17
|
|
|
9
18
|
// src/components/Accordion/Accordion.tsx
|
|
10
|
-
import
|
|
19
|
+
import classNames3 from "classnames/dedupe";
|
|
11
20
|
import { useEffect, useState, useId } from "react";
|
|
12
21
|
import { usePrefersReducedMotion } from "@simplybusiness/mobius-hooks";
|
|
13
22
|
|
|
14
23
|
// src/components/Accordion/AccordionLink.tsx
|
|
15
|
-
import
|
|
24
|
+
import classNames2 from "classnames/dedupe";
|
|
16
25
|
|
|
17
26
|
// src/components/Flex/Flex.tsx
|
|
18
27
|
import classNames from "classnames/dedupe";
|
|
@@ -71,11 +80,6 @@ var sizeClasses = (size) => {
|
|
|
71
80
|
};
|
|
72
81
|
};
|
|
73
82
|
|
|
74
|
-
// src/utils/spaceDelimitedList.ts
|
|
75
|
-
function spaceDelimitedList(list) {
|
|
76
|
-
return list.filter(Boolean).join(" ") || void 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
83
|
// src/components/Flex/propUtils.ts
|
|
80
84
|
var buildFlexStyles = (props) => {
|
|
81
85
|
const {
|
|
@@ -162,65 +166,9 @@ var Flex = ({ ref, ...props }) => {
|
|
|
162
166
|
};
|
|
163
167
|
Flex.displayName = "Flex";
|
|
164
168
|
|
|
165
|
-
// src/components/Icon/Icon.tsx
|
|
166
|
-
import classNames2 from "classnames/dedupe";
|
|
167
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
168
|
-
var ICON_PREFIX = "mobius-icon";
|
|
169
|
-
var capitaliseFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
170
|
-
function Icon({
|
|
171
|
-
ref,
|
|
172
|
-
icon,
|
|
173
|
-
className,
|
|
174
|
-
size = "xs",
|
|
175
|
-
color,
|
|
176
|
-
fixedWidth,
|
|
177
|
-
spin,
|
|
178
|
-
spinReverse,
|
|
179
|
-
title,
|
|
180
|
-
...otherProps
|
|
181
|
-
}) {
|
|
182
|
-
if (!icon) {
|
|
183
|
-
throw new Error("Must specify icon object");
|
|
184
|
-
}
|
|
185
|
-
const classes = classNames2(
|
|
186
|
-
"mobius",
|
|
187
|
-
"mobius-icon",
|
|
188
|
-
`svg-inline--${ICON_PREFIX}`,
|
|
189
|
-
`--size-${size}`,
|
|
190
|
-
className,
|
|
191
|
-
{
|
|
192
|
-
[`${ICON_PREFIX}-fw`]: fixedWidth,
|
|
193
|
-
[`${ICON_PREFIX}-spin`]: spin || spinReverse,
|
|
194
|
-
[`${ICON_PREFIX}-spin-reverse`]: spinReverse
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
const { iconName, width, height, svgPathData } = icon;
|
|
198
|
-
const formattedIconName = iconName.split("-").join(" ");
|
|
199
|
-
const defaultTitle = `${capitaliseFirstLetter(formattedIconName)} icon`;
|
|
200
|
-
const titleText = title || defaultTitle;
|
|
201
|
-
return /* @__PURE__ */ jsxs(
|
|
202
|
-
"svg",
|
|
203
|
-
{
|
|
204
|
-
ref,
|
|
205
|
-
focusable: "false",
|
|
206
|
-
"data-icon": iconName,
|
|
207
|
-
className: classes,
|
|
208
|
-
role: "img",
|
|
209
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
210
|
-
viewBox: `0 0 ${width} ${height}`,
|
|
211
|
-
style: { color },
|
|
212
|
-
...otherProps,
|
|
213
|
-
children: [
|
|
214
|
-
/* @__PURE__ */ jsx2("title", { children: titleText }),
|
|
215
|
-
/* @__PURE__ */ jsx2("path", { fill: "currentColor", d: svgPathData })
|
|
216
|
-
]
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
169
|
// src/components/Accordion/AccordionLink.tsx
|
|
222
170
|
import { chevronDown } from "@simplybusiness/icons";
|
|
223
|
-
import { jsx as
|
|
171
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
224
172
|
var AccordionLink = ({
|
|
225
173
|
text,
|
|
226
174
|
elementType: LinkElement = "span",
|
|
@@ -231,10 +179,10 @@ var AccordionLink = ({
|
|
|
231
179
|
accordionId,
|
|
232
180
|
contentId
|
|
233
181
|
}) => {
|
|
234
|
-
const linkClasses =
|
|
182
|
+
const linkClasses = classNames2("mobius-accordion__link", {
|
|
235
183
|
"--is-open": ariaExpanded
|
|
236
184
|
});
|
|
237
|
-
const iconClasses =
|
|
185
|
+
const iconClasses = classNames2("mobius-accordion__link-icon", {
|
|
238
186
|
"--is-open": ariaExpanded
|
|
239
187
|
});
|
|
240
188
|
const handleOnClick = (e) => {
|
|
@@ -249,14 +197,14 @@ var AccordionLink = ({
|
|
|
249
197
|
}
|
|
250
198
|
};
|
|
251
199
|
if (headerChildren) {
|
|
252
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ jsxs(
|
|
253
201
|
Flex,
|
|
254
202
|
{
|
|
255
203
|
justifyContent: "space-between",
|
|
256
204
|
alignItems: "center",
|
|
257
205
|
className: "mobius-accordion__header",
|
|
258
206
|
children: [
|
|
259
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ jsxs(
|
|
260
208
|
"div",
|
|
261
209
|
{
|
|
262
210
|
id: accordionId,
|
|
@@ -268,8 +216,8 @@ var AccordionLink = ({
|
|
|
268
216
|
"aria-expanded": !!ariaExpanded,
|
|
269
217
|
"aria-controls": contentId,
|
|
270
218
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ jsx2(LinkElement, { className: "mobius-accordion__link-text", children: text }),
|
|
220
|
+
/* @__PURE__ */ jsx2(Icon, { icon: chevronDown, className: iconClasses })
|
|
273
221
|
]
|
|
274
222
|
}
|
|
275
223
|
),
|
|
@@ -278,7 +226,7 @@ var AccordionLink = ({
|
|
|
278
226
|
}
|
|
279
227
|
);
|
|
280
228
|
}
|
|
281
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ jsxs(
|
|
282
230
|
"div",
|
|
283
231
|
{
|
|
284
232
|
id: accordionId,
|
|
@@ -290,15 +238,15 @@ var AccordionLink = ({
|
|
|
290
238
|
"aria-expanded": !!ariaExpanded,
|
|
291
239
|
"aria-controls": contentId,
|
|
292
240
|
children: [
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ jsx2(LinkElement, { className: "mobius-accordion__link-text", children: text }),
|
|
242
|
+
/* @__PURE__ */ jsx2(Icon, { icon: chevronDown, className: iconClasses })
|
|
295
243
|
]
|
|
296
244
|
}
|
|
297
245
|
);
|
|
298
246
|
};
|
|
299
247
|
|
|
300
248
|
// src/components/Accordion/Accordion.tsx
|
|
301
|
-
import { jsx as
|
|
249
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
302
250
|
var Accordion = ({ ref, ...props }) => {
|
|
303
251
|
const {
|
|
304
252
|
showText = "See more",
|
|
@@ -319,7 +267,7 @@ var Accordion = ({ ref, ...props }) => {
|
|
|
319
267
|
withAnimation: false
|
|
320
268
|
});
|
|
321
269
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
322
|
-
const containerClasses =
|
|
270
|
+
const containerClasses = classNames3(
|
|
323
271
|
"mobius",
|
|
324
272
|
"mobius-accordion",
|
|
325
273
|
props.className,
|
|
@@ -328,13 +276,13 @@ var Accordion = ({ ref, ...props }) => {
|
|
|
328
276
|
"--is-open": accordionState.open
|
|
329
277
|
}
|
|
330
278
|
);
|
|
331
|
-
const contentContainerClasses =
|
|
279
|
+
const contentContainerClasses = classNames3(
|
|
332
280
|
"mobius-accordion__content-container",
|
|
333
281
|
{
|
|
334
282
|
"--is-open": accordionState.open
|
|
335
283
|
}
|
|
336
284
|
);
|
|
337
|
-
const contentClasses =
|
|
285
|
+
const contentClasses = classNames3("mobius-accordion__content", {
|
|
338
286
|
"--is-open": accordionState.open
|
|
339
287
|
});
|
|
340
288
|
const linkText = accordionState.open ? hideText : showText;
|
|
@@ -362,8 +310,8 @@ var Accordion = ({ ref, ...props }) => {
|
|
|
362
310
|
const baseId = useId();
|
|
363
311
|
const accordionId = `accordion-header-${baseId}`;
|
|
364
312
|
const contentId = `accordion-panel-${baseId}`;
|
|
365
|
-
return /* @__PURE__ */
|
|
366
|
-
headerPosition === "top" && /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ jsxs2("div", { ref, ...rest, className: containerClasses, children: [
|
|
314
|
+
headerPosition === "top" && /* @__PURE__ */ jsx3(
|
|
367
315
|
AccordionLink,
|
|
368
316
|
{
|
|
369
317
|
text: linkText,
|
|
@@ -376,7 +324,7 @@ var Accordion = ({ ref, ...props }) => {
|
|
|
376
324
|
contentId
|
|
377
325
|
}
|
|
378
326
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ jsx3(
|
|
380
328
|
"div",
|
|
381
329
|
{
|
|
382
330
|
id: contentId,
|
|
@@ -384,10 +332,10 @@ var Accordion = ({ ref, ...props }) => {
|
|
|
384
332
|
"aria-hidden": !accordionState.open,
|
|
385
333
|
"aria-labelledby": accordionId,
|
|
386
334
|
role: "region",
|
|
387
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ jsx3("div", { className: contentClasses, children: props.children })
|
|
388
336
|
}
|
|
389
337
|
),
|
|
390
|
-
headerPosition === "bottom" && /* @__PURE__ */
|
|
338
|
+
headerPosition === "bottom" && /* @__PURE__ */ jsx3(
|
|
391
339
|
AccordionLink,
|
|
392
340
|
{
|
|
393
341
|
text: linkText,
|
|
@@ -405,32 +353,32 @@ Accordion.displayName = "Accordion";
|
|
|
405
353
|
|
|
406
354
|
// src/components/Accordion/AccordionList.tsx
|
|
407
355
|
import { useState as useState2, Fragment } from "react";
|
|
408
|
-
import
|
|
356
|
+
import classNames5 from "classnames/dedupe";
|
|
409
357
|
|
|
410
358
|
// src/components/Divider/Divider.tsx
|
|
411
|
-
import
|
|
412
|
-
import { jsx as
|
|
359
|
+
import classNames4 from "classnames/dedupe";
|
|
360
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
413
361
|
var Divider = ({
|
|
414
362
|
"aria-orientation": ariaOrientation = "horizontal",
|
|
415
363
|
className,
|
|
416
364
|
...rest
|
|
417
365
|
}) => {
|
|
418
|
-
const classes =
|
|
419
|
-
return /* @__PURE__ */
|
|
366
|
+
const classes = classNames4("mobius", "mobius-divider", className);
|
|
367
|
+
return /* @__PURE__ */ jsx4(
|
|
420
368
|
"div",
|
|
421
369
|
{
|
|
422
370
|
className: classes,
|
|
423
371
|
role: "separator",
|
|
424
372
|
"aria-orientation": ariaOrientation,
|
|
425
373
|
...rest,
|
|
426
|
-
children: /* @__PURE__ */
|
|
374
|
+
children: /* @__PURE__ */ jsx4("div", { className: "mobius-divider__inner" })
|
|
427
375
|
}
|
|
428
376
|
);
|
|
429
377
|
};
|
|
430
378
|
Divider.displayName = "Divider";
|
|
431
379
|
|
|
432
380
|
// src/components/Accordion/AccordionList.tsx
|
|
433
|
-
import { jsx as
|
|
381
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
434
382
|
var AccordionList = (props) => {
|
|
435
383
|
const {
|
|
436
384
|
className,
|
|
@@ -441,7 +389,7 @@ var AccordionList = (props) => {
|
|
|
441
389
|
...rest
|
|
442
390
|
} = props;
|
|
443
391
|
const [openIds, setOpenIds] = useState2(/* @__PURE__ */ new Set());
|
|
444
|
-
const classes =
|
|
392
|
+
const classes = classNames5("mobius", "mobius-accordion-list", className);
|
|
445
393
|
const handleAccordionChange = (id, isOpen) => {
|
|
446
394
|
setOpenIds((prev) => {
|
|
447
395
|
const newSet = new Set(prev);
|
|
@@ -461,11 +409,11 @@ var AccordionList = (props) => {
|
|
|
461
409
|
onClose?.(id);
|
|
462
410
|
}
|
|
463
411
|
};
|
|
464
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ jsx5("div", { className: classes, ...rest, children: content.map((item, index) => {
|
|
465
413
|
const { id, header, details } = item;
|
|
466
414
|
const isOpen = openIds.has(id);
|
|
467
|
-
return /* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
416
|
+
/* @__PURE__ */ jsx5(
|
|
469
417
|
Accordion,
|
|
470
418
|
{
|
|
471
419
|
startOpen: isOpen,
|
|
@@ -475,7 +423,7 @@ var AccordionList = (props) => {
|
|
|
475
423
|
children: details
|
|
476
424
|
}
|
|
477
425
|
),
|
|
478
|
-
index < content.length - 1 && /* @__PURE__ */
|
|
426
|
+
index < content.length - 1 && /* @__PURE__ */ jsx5(Divider, {})
|
|
479
427
|
] }, id);
|
|
480
428
|
}) });
|
|
481
429
|
};
|
|
@@ -486,8 +434,8 @@ import { search } from "@simplybusiness/icons";
|
|
|
486
434
|
import { useCallback as useCallback4, useState as useState9 } from "react";
|
|
487
435
|
|
|
488
436
|
// src/components/Combobox/Combobox.tsx
|
|
489
|
-
import
|
|
490
|
-
import { useEffect as useEffect6, useId as
|
|
437
|
+
import classNames8 from "classnames/dedupe";
|
|
438
|
+
import { useEffect as useEffect6, useId as useId2, useRef as useRef3, useState as useState8 } from "react";
|
|
491
439
|
import { useOnUnmount } from "@simplybusiness/mobius-hooks";
|
|
492
440
|
|
|
493
441
|
// src/hooks/useBreakpoint/useBreakpoint.tsx
|
|
@@ -636,8 +584,8 @@ var useDialogPolyfill = () => {
|
|
|
636
584
|
if (ref.current) {
|
|
637
585
|
dialogPolyfill.registerDialog(ref.current);
|
|
638
586
|
}
|
|
639
|
-
} catch (
|
|
640
|
-
console.error("Failed to load dialog-polyfill",
|
|
587
|
+
} catch (error2) {
|
|
588
|
+
console.error("Failed to load dialog-polyfill", error2);
|
|
641
589
|
}
|
|
642
590
|
}
|
|
643
591
|
};
|
|
@@ -704,294 +652,8 @@ var useDialog = (props) => {
|
|
|
704
652
|
};
|
|
705
653
|
};
|
|
706
654
|
|
|
707
|
-
// src/hooks/useLabel/useLabel.tsx
|
|
708
|
-
import { useId as useId2, useRef as useRef2 } from "react";
|
|
709
|
-
function useLabel({
|
|
710
|
-
id: providedId,
|
|
711
|
-
label,
|
|
712
|
-
"aria-label": ariaLabel,
|
|
713
|
-
"aria-labelledby": ariaLabelledby,
|
|
714
|
-
labelElementType = "label"
|
|
715
|
-
}) {
|
|
716
|
-
let labelProps = {};
|
|
717
|
-
let fieldProps = {};
|
|
718
|
-
const hasWarnedAboutMissingLabels = useRef2(false);
|
|
719
|
-
const fallbackId = useId2();
|
|
720
|
-
const id = providedId || fallbackId;
|
|
721
|
-
const labelId = useId2();
|
|
722
|
-
if (label) {
|
|
723
|
-
ariaLabelledby = ariaLabelledby ? `${labelId} ${ariaLabelledby}` : labelId;
|
|
724
|
-
labelProps = {
|
|
725
|
-
id: labelId,
|
|
726
|
-
htmlFor: labelElementType === "label" ? id : void 0
|
|
727
|
-
};
|
|
728
|
-
} else if (!ariaLabelledby && !ariaLabel && !hasWarnedAboutMissingLabels.current) {
|
|
729
|
-
hasWarnedAboutMissingLabels.current = true;
|
|
730
|
-
console.warn(
|
|
731
|
-
"If you do not provide a visible label, you must specify an aria-label or aria-labelledby attribute for accessibility"
|
|
732
|
-
);
|
|
733
|
-
}
|
|
734
|
-
fieldProps = {
|
|
735
|
-
id,
|
|
736
|
-
"aria-label": ariaLabel,
|
|
737
|
-
"aria-labelledby": ariaLabelledby
|
|
738
|
-
};
|
|
739
|
-
return {
|
|
740
|
-
labelProps,
|
|
741
|
-
fieldProps
|
|
742
|
-
};
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
// src/hooks/useTextField/useTextField.tsx
|
|
746
|
-
import { useId as useId3 } from "react";
|
|
747
|
-
function useTextField(props) {
|
|
748
|
-
const {
|
|
749
|
-
isDisabled = false,
|
|
750
|
-
isReadOnly = false,
|
|
751
|
-
isRequired = false,
|
|
752
|
-
inputElementType = "input"
|
|
753
|
-
} = props;
|
|
754
|
-
const { labelProps, fieldProps } = useLabel(props);
|
|
755
|
-
const descriptionId = useId3();
|
|
756
|
-
const descriptionProps = { id: descriptionId };
|
|
757
|
-
const errorMessageId = useId3();
|
|
758
|
-
const errorMessageProps = { id: errorMessageId };
|
|
759
|
-
const ariaDescribedBy = spaceDelimitedList([
|
|
760
|
-
props.description && descriptionId,
|
|
761
|
-
props.errorMessage && errorMessageId,
|
|
762
|
-
props["aria-describedby"]
|
|
763
|
-
]);
|
|
764
|
-
return {
|
|
765
|
-
descriptionProps,
|
|
766
|
-
errorMessageProps,
|
|
767
|
-
labelProps,
|
|
768
|
-
inputProps: {
|
|
769
|
-
defaultValue: props.defaultValue,
|
|
770
|
-
value: props.value,
|
|
771
|
-
onChange: props.onChange,
|
|
772
|
-
disabled: isDisabled,
|
|
773
|
-
readOnly: isReadOnly,
|
|
774
|
-
required: isRequired,
|
|
775
|
-
"aria-required": isRequired === true ? true : void 0,
|
|
776
|
-
"aria-invalid": props.isInvalid,
|
|
777
|
-
"aria-describedby": ariaDescribedBy,
|
|
778
|
-
"aria-errormessage": props["aria-errormessage"],
|
|
779
|
-
role: props.role,
|
|
780
|
-
type: inputElementType === "input" ? props.type : void 0,
|
|
781
|
-
pattern: inputElementType === "input" ? props.pattern : void 0,
|
|
782
|
-
autoComplete: props.autoComplete,
|
|
783
|
-
maxLength: props.maxLength,
|
|
784
|
-
minLength: props.minLength,
|
|
785
|
-
name: props.name,
|
|
786
|
-
placeholder: props.placeholder,
|
|
787
|
-
inputMode: props.inputMode,
|
|
788
|
-
// Clipboard events
|
|
789
|
-
onCopy: props.onCopy,
|
|
790
|
-
onCut: props.onCut,
|
|
791
|
-
onPaste: props.onPaste,
|
|
792
|
-
// Composition events
|
|
793
|
-
onCompositionEnd: props.onCompositionEnd,
|
|
794
|
-
onCompositionStart: props.onCompositionStart,
|
|
795
|
-
onCompositionUpdate: props.onCompositionUpdate,
|
|
796
|
-
// Selection events
|
|
797
|
-
onSelect: props.onSelect,
|
|
798
|
-
// Input events
|
|
799
|
-
onBeforeInput: props.onBeforeInput,
|
|
800
|
-
onInput: props.onInput,
|
|
801
|
-
// Focus events
|
|
802
|
-
onFocus: props.onFocus,
|
|
803
|
-
onBlur: props.onBlur,
|
|
804
|
-
...fieldProps
|
|
805
|
-
}
|
|
806
|
-
};
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
// src/hooks/useValidationClasses/useValidationClasses.ts
|
|
810
|
-
var useValidationClasses = (props) => {
|
|
811
|
-
const { isInvalid } = props;
|
|
812
|
-
if (isInvalid) {
|
|
813
|
-
return "--is-invalid";
|
|
814
|
-
}
|
|
815
|
-
if (isInvalid === false) {
|
|
816
|
-
return "--is-valid";
|
|
817
|
-
}
|
|
818
|
-
return "";
|
|
819
|
-
};
|
|
820
|
-
|
|
821
|
-
// src/components/TextField/TextField.tsx
|
|
822
|
-
import classNames11 from "classnames/dedupe";
|
|
823
|
-
|
|
824
|
-
// src/components/ErrorMessage/ErrorMessage.tsx
|
|
825
|
-
import { error } from "@simplybusiness/icons";
|
|
826
|
-
import classNames7 from "classnames/dedupe";
|
|
827
|
-
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
828
|
-
var ErrorMessage = ({
|
|
829
|
-
id,
|
|
830
|
-
errorMessage,
|
|
831
|
-
className
|
|
832
|
-
}) => {
|
|
833
|
-
const classes = classNames7("mobius", "mobius-error-message", className);
|
|
834
|
-
if (!errorMessage) return null;
|
|
835
|
-
return /* @__PURE__ */ jsxs5("div", { id, className: classes, "data-testid": "ErrorMessage", role: "alert", children: [
|
|
836
|
-
/* @__PURE__ */ jsx7(
|
|
837
|
-
Icon,
|
|
838
|
-
{
|
|
839
|
-
icon: error,
|
|
840
|
-
className: "mobius-error-message__icon",
|
|
841
|
-
"aria-hidden": "true"
|
|
842
|
-
}
|
|
843
|
-
),
|
|
844
|
-
/* @__PURE__ */ jsx7(
|
|
845
|
-
TextOrHTML,
|
|
846
|
-
{
|
|
847
|
-
elementType: "span",
|
|
848
|
-
className: "mobius-error-message__text",
|
|
849
|
-
text: errorMessage
|
|
850
|
-
}
|
|
851
|
-
)
|
|
852
|
-
] });
|
|
853
|
-
};
|
|
854
|
-
ErrorMessage.displayName = "ErrorMessage";
|
|
855
|
-
|
|
856
|
-
// src/components/Label/Label.tsx
|
|
857
|
-
import classNames8 from "classnames/dedupe";
|
|
858
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
859
|
-
var Label = ({ ref, ...props }) => {
|
|
860
|
-
const { elementType: Element = "label", children, ...otherProps } = props;
|
|
861
|
-
const classes = classNames8("mobius", "mobius-label", props.className);
|
|
862
|
-
otherProps.className = classes;
|
|
863
|
-
return /* @__PURE__ */ jsx8(Element, { ref, ...otherProps, className: classes, children });
|
|
864
|
-
};
|
|
865
|
-
Label.displayName = "Label";
|
|
866
|
-
|
|
867
|
-
// src/components/Stack/Stack.tsx
|
|
868
|
-
import classNames9 from "classnames/dedupe";
|
|
869
|
-
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
870
|
-
var Stack = ({ ref, ...props }) => {
|
|
871
|
-
const { elementType: Element = "div", gap, ...otherProps } = props;
|
|
872
|
-
const classes = classNames9(
|
|
873
|
-
"mobius",
|
|
874
|
-
"mobius-stack",
|
|
875
|
-
{
|
|
876
|
-
[`--gap-${gap}`]: gap
|
|
877
|
-
},
|
|
878
|
-
otherProps.className
|
|
879
|
-
);
|
|
880
|
-
return /* @__PURE__ */ jsx9(Element, { ref, ...otherProps, className: classes });
|
|
881
|
-
};
|
|
882
|
-
Stack.displayName = "Stack";
|
|
883
|
-
|
|
884
|
-
// src/components/TextField/adornmentWithClassName.ts
|
|
885
|
-
import classNames10 from "classnames/dedupe";
|
|
886
|
-
import { cloneElement } from "react";
|
|
887
|
-
var adornmentWithClassName = (component, validationClasses, className) => {
|
|
888
|
-
if (!component) return null;
|
|
889
|
-
return cloneElement(component, {
|
|
890
|
-
className: classNames10(
|
|
891
|
-
component.props.className,
|
|
892
|
-
validationClasses,
|
|
893
|
-
className
|
|
894
|
-
)
|
|
895
|
-
});
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
// src/components/TextField/TextField.tsx
|
|
899
|
-
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
900
|
-
var TextField = ({ ref, ...props }) => {
|
|
901
|
-
const {
|
|
902
|
-
isDisabled,
|
|
903
|
-
type = "text",
|
|
904
|
-
isInvalid,
|
|
905
|
-
className,
|
|
906
|
-
label,
|
|
907
|
-
errorMessage,
|
|
908
|
-
children,
|
|
909
|
-
isRequired,
|
|
910
|
-
prefixInside,
|
|
911
|
-
prefixOutside,
|
|
912
|
-
suffixInside,
|
|
913
|
-
suffixOutside,
|
|
914
|
-
isReadOnly,
|
|
915
|
-
...otherProps
|
|
916
|
-
} = props;
|
|
917
|
-
const { inputProps, labelProps, errorMessageProps } = useTextField({
|
|
918
|
-
...props,
|
|
919
|
-
"aria-errormessage": errorMessage
|
|
920
|
-
});
|
|
921
|
-
const hidden = type === "hidden";
|
|
922
|
-
const validationClasses = useValidationClasses({ isInvalid });
|
|
923
|
-
const textfieldClasses = {
|
|
924
|
-
"--is-disabled": isDisabled,
|
|
925
|
-
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
926
|
-
"--is-optional": typeof isRequired === "boolean" && !isRequired,
|
|
927
|
-
"--is-hidden": hidden,
|
|
928
|
-
[className || ""]: true
|
|
929
|
-
};
|
|
930
|
-
const sharedClasses = classNames11(validationClasses, textfieldClasses);
|
|
931
|
-
const labelClasses = classNames11(
|
|
932
|
-
{
|
|
933
|
-
"--is-disabled": isDisabled
|
|
934
|
-
},
|
|
935
|
-
validationClasses
|
|
936
|
-
);
|
|
937
|
-
const containerClasses = classNames11(
|
|
938
|
-
"mobius",
|
|
939
|
-
"mobius-text-field",
|
|
940
|
-
sharedClasses
|
|
941
|
-
);
|
|
942
|
-
const inputClasses = classNames11(
|
|
943
|
-
"mobius",
|
|
944
|
-
"mobius-text-field__input",
|
|
945
|
-
sharedClasses
|
|
946
|
-
);
|
|
947
|
-
const inputWrapperClasses = classNames11(
|
|
948
|
-
"mobius-text-field__input-wrapper",
|
|
949
|
-
sharedClasses
|
|
950
|
-
);
|
|
951
|
-
return /* @__PURE__ */ jsxs6(Stack, { gap: "xs", className: containerClasses, children: [
|
|
952
|
-
label && !hidden && /* @__PURE__ */ jsx10(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
953
|
-
/* @__PURE__ */ jsxs6("div", { className: "mobius-text-field__inner-container", children: [
|
|
954
|
-
adornmentWithClassName(
|
|
955
|
-
prefixOutside,
|
|
956
|
-
labelClasses,
|
|
957
|
-
"mobius-text-field__prefix-outside"
|
|
958
|
-
),
|
|
959
|
-
/* @__PURE__ */ jsxs6("div", { className: inputWrapperClasses, children: [
|
|
960
|
-
adornmentWithClassName(
|
|
961
|
-
prefixInside,
|
|
962
|
-
labelClasses,
|
|
963
|
-
"mobius-text-field__prefix-inside"
|
|
964
|
-
),
|
|
965
|
-
/* @__PURE__ */ jsx10(
|
|
966
|
-
"input",
|
|
967
|
-
{
|
|
968
|
-
...otherProps,
|
|
969
|
-
...inputProps,
|
|
970
|
-
ref,
|
|
971
|
-
type,
|
|
972
|
-
className: inputClasses
|
|
973
|
-
}
|
|
974
|
-
),
|
|
975
|
-
adornmentWithClassName(
|
|
976
|
-
suffixInside,
|
|
977
|
-
labelClasses,
|
|
978
|
-
"mobius-text-field__suffix-inside"
|
|
979
|
-
)
|
|
980
|
-
] }),
|
|
981
|
-
adornmentWithClassName(
|
|
982
|
-
suffixOutside,
|
|
983
|
-
labelClasses,
|
|
984
|
-
"mobius-text-field__suffix-outside"
|
|
985
|
-
)
|
|
986
|
-
] }),
|
|
987
|
-
children && /* @__PURE__ */ jsx10("div", { className: "mobius-text-field__children", children }),
|
|
988
|
-
/* @__PURE__ */ jsx10(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
989
|
-
] });
|
|
990
|
-
};
|
|
991
|
-
TextField.displayName = "TextField";
|
|
992
|
-
|
|
993
655
|
// src/components/VisuallyHidden/VisuallyHidden.tsx
|
|
994
|
-
import { jsx as
|
|
656
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
995
657
|
function VisuallyHidden(props) {
|
|
996
658
|
const {
|
|
997
659
|
className,
|
|
@@ -999,7 +661,7 @@ function VisuallyHidden(props) {
|
|
|
999
661
|
elementType: Component = "div",
|
|
1000
662
|
...otherProps
|
|
1001
663
|
} = props;
|
|
1002
|
-
return /* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ jsx6(
|
|
1003
665
|
Component,
|
|
1004
666
|
{
|
|
1005
667
|
className,
|
|
@@ -1022,11 +684,11 @@ function VisuallyHidden(props) {
|
|
|
1022
684
|
}
|
|
1023
685
|
|
|
1024
686
|
// src/components/Combobox/Listbox.tsx
|
|
1025
|
-
import
|
|
687
|
+
import classNames7 from "classnames/dedupe";
|
|
1026
688
|
|
|
1027
689
|
// src/components/Combobox/Option.tsx
|
|
1028
|
-
import { useEffect as useEffect4, useRef as
|
|
1029
|
-
import
|
|
690
|
+
import { useEffect as useEffect4, useRef as useRef2 } from "react";
|
|
691
|
+
import classNames6 from "classnames/dedupe";
|
|
1030
692
|
|
|
1031
693
|
// src/components/Combobox/utils.tsx
|
|
1032
694
|
function isOptionGroup(options) {
|
|
@@ -1048,41 +710,49 @@ function filterOptions(options, inputValue) {
|
|
|
1048
710
|
(option) => getOptionLabel(option).toLowerCase().includes(inputValue.toLowerCase())
|
|
1049
711
|
);
|
|
1050
712
|
}
|
|
713
|
+
var buildOptionTestId = (prefix, value) => `${prefix}-${value.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "")}`;
|
|
1051
714
|
|
|
1052
715
|
// src/components/Combobox/Option.tsx
|
|
1053
|
-
import { jsx as
|
|
716
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1054
717
|
var Option = ({
|
|
1055
718
|
option,
|
|
1056
719
|
isHighlighted,
|
|
1057
720
|
onOptionSelect,
|
|
1058
721
|
optionComponent: OptionComponent,
|
|
722
|
+
optionTestIdPrefix,
|
|
1059
723
|
id
|
|
1060
724
|
}) => {
|
|
1061
|
-
const optionRef =
|
|
725
|
+
const optionRef = useRef2(null);
|
|
726
|
+
const optionValue = getOptionValue(option) || "";
|
|
727
|
+
const testId = buildOptionTestId(
|
|
728
|
+
optionTestIdPrefix || "combobox-option",
|
|
729
|
+
optionValue
|
|
730
|
+
);
|
|
1062
731
|
useEffect4(() => {
|
|
1063
732
|
if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
|
|
1064
733
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
1065
734
|
}
|
|
1066
735
|
}, [isHighlighted]);
|
|
1067
|
-
return /* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ jsx7(
|
|
1068
737
|
"li",
|
|
1069
738
|
{
|
|
1070
739
|
ref: optionRef,
|
|
1071
740
|
role: "option",
|
|
741
|
+
"data-testid": testId,
|
|
1072
742
|
id,
|
|
1073
743
|
"aria-selected": isHighlighted,
|
|
1074
744
|
onMouseDown: () => onOptionSelect(option),
|
|
1075
|
-
className:
|
|
745
|
+
className: classNames6("mobius-combobox__option", "has-pii", {
|
|
1076
746
|
"mobius-combobox__option--is-highlighted": isHighlighted
|
|
1077
747
|
}),
|
|
1078
|
-
children: OptionComponent ? /* @__PURE__ */
|
|
748
|
+
children: OptionComponent ? /* @__PURE__ */ jsx7(OptionComponent, { option, isHighlighted }) : getOptionLabel(option)
|
|
1079
749
|
},
|
|
1080
750
|
getOptionValue(option)
|
|
1081
751
|
);
|
|
1082
752
|
};
|
|
1083
753
|
|
|
1084
754
|
// src/components/Combobox/Listbox.tsx
|
|
1085
|
-
import { jsx as
|
|
755
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1086
756
|
var getOptionKey = (option, index, groupIndex) => {
|
|
1087
757
|
let key;
|
|
1088
758
|
if (typeof option === "object" && option.id) key = option.id;
|
|
@@ -1098,9 +768,10 @@ var Listbox = ({
|
|
|
1098
768
|
highlightedIndex,
|
|
1099
769
|
highlightedGroupIndex,
|
|
1100
770
|
onOptionSelect,
|
|
1101
|
-
optionComponent
|
|
771
|
+
optionComponent,
|
|
772
|
+
optionTestIdPrefix
|
|
1102
773
|
}) => {
|
|
1103
|
-
const classes =
|
|
774
|
+
const classes = classNames7("mobius-combobox__list", {
|
|
1104
775
|
"mobius-combobox__list--hidden": !isOpen
|
|
1105
776
|
});
|
|
1106
777
|
function getOptionId(option, groupIndex, index) {
|
|
@@ -1110,19 +781,19 @@ var Listbox = ({
|
|
|
1110
781
|
return isOptionGroup(options) ? `${id}-option-${groupIndex}-${index}` : `${id}-option-${index}`;
|
|
1111
782
|
}
|
|
1112
783
|
if (!isOpen) {
|
|
1113
|
-
return /* @__PURE__ */
|
|
784
|
+
return /* @__PURE__ */ jsx8("div", { role: "listbox", id, className: classes });
|
|
1114
785
|
}
|
|
1115
786
|
if (options && options.length === 0) {
|
|
1116
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ jsx8("div", { role: "listbox", id, className: classes, children: /* @__PURE__ */ jsx8("div", { className: "mobius-combobox__no-options", children: "No options" }) });
|
|
1117
788
|
}
|
|
1118
|
-
return /* @__PURE__ */
|
|
789
|
+
return /* @__PURE__ */ jsx8("div", { role: "listbox", id, className: classes, children: isOptionGroup(options) ? options.map((option, groupIndex) => /* @__PURE__ */ jsxs4(
|
|
1119
790
|
"ul",
|
|
1120
791
|
{
|
|
1121
792
|
role: "group",
|
|
1122
793
|
"aria-labelledby": `${id}-group-${groupIndex}`,
|
|
1123
794
|
className: "mobius-combobox__group",
|
|
1124
795
|
children: [
|
|
1125
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ jsx8(
|
|
1126
797
|
"li",
|
|
1127
798
|
{
|
|
1128
799
|
role: "presentation",
|
|
@@ -1131,13 +802,14 @@ var Listbox = ({
|
|
|
1131
802
|
children: option.heading
|
|
1132
803
|
}
|
|
1133
804
|
),
|
|
1134
|
-
option.options.map((groupOption, index) => /* @__PURE__ */
|
|
805
|
+
option.options.map((groupOption, index) => /* @__PURE__ */ jsx8(
|
|
1135
806
|
Option,
|
|
1136
807
|
{
|
|
1137
808
|
option: groupOption,
|
|
1138
809
|
isHighlighted: highlightedIndex === index && highlightedGroupIndex === groupIndex,
|
|
1139
810
|
onOptionSelect,
|
|
1140
811
|
optionComponent,
|
|
812
|
+
optionTestIdPrefix,
|
|
1141
813
|
id: getOptionId(groupOption, groupIndex, index)
|
|
1142
814
|
},
|
|
1143
815
|
getOptionKey(groupOption, index, groupIndex)
|
|
@@ -1145,13 +817,14 @@ var Listbox = ({
|
|
|
1145
817
|
]
|
|
1146
818
|
},
|
|
1147
819
|
option.heading
|
|
1148
|
-
)) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */
|
|
820
|
+
)) : typeof options !== "undefined" ? options.map((option, index) => /* @__PURE__ */ jsx8(
|
|
1149
821
|
Option,
|
|
1150
822
|
{
|
|
1151
823
|
option,
|
|
1152
824
|
isHighlighted: highlightedIndex === index,
|
|
1153
825
|
onOptionSelect,
|
|
1154
826
|
optionComponent,
|
|
827
|
+
optionTestIdPrefix,
|
|
1155
828
|
id: getOptionId(option, 0, index)
|
|
1156
829
|
},
|
|
1157
830
|
getOptionKey(option, index)
|
|
@@ -1260,7 +933,7 @@ function useComboboxOptions({
|
|
|
1260
933
|
options ? 0 : delay
|
|
1261
934
|
);
|
|
1262
935
|
const [isLoading, setIsLoading] = useState7(false);
|
|
1263
|
-
const [
|
|
936
|
+
const [error2, setError] = useState7(null);
|
|
1264
937
|
useEffect5(() => {
|
|
1265
938
|
const controller = new AbortController();
|
|
1266
939
|
const { signal } = controller;
|
|
@@ -1315,13 +988,13 @@ function useComboboxOptions({
|
|
|
1315
988
|
filteredOptions,
|
|
1316
989
|
updateFilteredOptions,
|
|
1317
990
|
isLoading,
|
|
1318
|
-
error:
|
|
1319
|
-
isError:
|
|
991
|
+
error: error2,
|
|
992
|
+
isError: error2 != null
|
|
1320
993
|
};
|
|
1321
994
|
}
|
|
1322
995
|
|
|
1323
996
|
// src/components/Combobox/Combobox.tsx
|
|
1324
|
-
import { jsx as
|
|
997
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1325
998
|
var ComboboxInner = ({
|
|
1326
999
|
ref,
|
|
1327
1000
|
...props
|
|
@@ -1343,15 +1016,16 @@ var ComboboxInner = ({
|
|
|
1343
1016
|
onChange,
|
|
1344
1017
|
// onSearched, // unused prop, consider removing
|
|
1345
1018
|
optionComponent,
|
|
1019
|
+
optionTestIdPrefix,
|
|
1346
1020
|
errorMessage,
|
|
1347
1021
|
...otherProps
|
|
1348
1022
|
} = props;
|
|
1349
|
-
const skipNextDebounceRef =
|
|
1350
|
-
const fallbackRef =
|
|
1023
|
+
const skipNextDebounceRef = useRef3(false);
|
|
1024
|
+
const fallbackRef = useRef3(null);
|
|
1351
1025
|
const [inputValue, setInputValue] = useState8(defaultValue || "");
|
|
1352
1026
|
const [isOpen, setIsOpen] = useState8(false);
|
|
1353
1027
|
const [isChanging, setIsChanging] = useState8(false);
|
|
1354
|
-
const { filteredOptions, updateFilteredOptions, isLoading, error:
|
|
1028
|
+
const { filteredOptions, updateFilteredOptions, isLoading, error: error2 } = useComboboxOptions({
|
|
1355
1029
|
options,
|
|
1356
1030
|
asyncOptions,
|
|
1357
1031
|
inputValue,
|
|
@@ -1359,6 +1033,9 @@ var ComboboxInner = ({
|
|
|
1359
1033
|
minSearchLength,
|
|
1360
1034
|
skipNextDebounceRef
|
|
1361
1035
|
});
|
|
1036
|
+
const [validationError, setValidationError] = useState8(
|
|
1037
|
+
error2?.message || errorMessage
|
|
1038
|
+
);
|
|
1362
1039
|
const {
|
|
1363
1040
|
highlightedIndex,
|
|
1364
1041
|
highlightedGroupIndex,
|
|
@@ -1369,13 +1046,23 @@ var ComboboxInner = ({
|
|
|
1369
1046
|
clearHighlight
|
|
1370
1047
|
} = useComboboxHighlight(filteredOptions);
|
|
1371
1048
|
const inputRef = ref || fallbackRef;
|
|
1372
|
-
const listboxId =
|
|
1373
|
-
const statusId =
|
|
1374
|
-
const blurTimeoutRef =
|
|
1375
|
-
const userInteractedRef =
|
|
1376
|
-
const justSelectedRef =
|
|
1049
|
+
const listboxId = useId2();
|
|
1050
|
+
const statusId = useId2();
|
|
1051
|
+
const blurTimeoutRef = useRef3(null);
|
|
1052
|
+
const userInteractedRef = useRef3(false);
|
|
1053
|
+
const justSelectedRef = useRef3(false);
|
|
1377
1054
|
const { down } = useBreakpoint();
|
|
1378
1055
|
const isMobile = down("md");
|
|
1056
|
+
useEffect6(() => {
|
|
1057
|
+
setValidationError(error2?.message || errorMessage);
|
|
1058
|
+
}, [error2, errorMessage]);
|
|
1059
|
+
const getEmptyValue = () => {
|
|
1060
|
+
const firstOption = filteredOptions ? isOptionGroup(filteredOptions) ? filteredOptions[0]?.options[0] : filteredOptions[0] : options ? isOptionGroup(options) ? options[0]?.options[0] : options[0] : void 0;
|
|
1061
|
+
if (typeof firstOption === "string") {
|
|
1062
|
+
return "";
|
|
1063
|
+
}
|
|
1064
|
+
return { label: "", value: "" };
|
|
1065
|
+
};
|
|
1379
1066
|
const handleFocus = (e) => {
|
|
1380
1067
|
onFocus?.(e);
|
|
1381
1068
|
if (!filteredOptions || filteredOptions.length === 0) return;
|
|
@@ -1415,6 +1102,7 @@ var ComboboxInner = ({
|
|
|
1415
1102
|
const handleInputChange = (e) => {
|
|
1416
1103
|
const newValue = e.target.value;
|
|
1417
1104
|
setInputValue(newValue);
|
|
1105
|
+
setValidationError(void 0);
|
|
1418
1106
|
justSelectedRef.current = false;
|
|
1419
1107
|
setIsChanging(true);
|
|
1420
1108
|
if (!asyncOptions) {
|
|
@@ -1425,7 +1113,7 @@ var ComboboxInner = ({
|
|
|
1425
1113
|
};
|
|
1426
1114
|
const handleOptionSelect = (option) => {
|
|
1427
1115
|
const val = getOptionValue(option);
|
|
1428
|
-
if (!val) return;
|
|
1116
|
+
if (!val && val !== "") return;
|
|
1429
1117
|
if (typeof option === "object" && "callback" in option && option.callback && typeof option.callback === "function") {
|
|
1430
1118
|
setTimeout(() => {
|
|
1431
1119
|
if (inputRef && typeof inputRef !== "function" && inputRef.current) {
|
|
@@ -1438,6 +1126,7 @@ var ComboboxInner = ({
|
|
|
1438
1126
|
skipNextDebounceRef.current = true;
|
|
1439
1127
|
justSelectedRef.current = true;
|
|
1440
1128
|
setIsChanging(false);
|
|
1129
|
+
setValidationError(void 0);
|
|
1441
1130
|
setIsOpen(false);
|
|
1442
1131
|
setInputValue(val);
|
|
1443
1132
|
onSelected?.(option);
|
|
@@ -1468,13 +1157,25 @@ var ComboboxInner = ({
|
|
|
1468
1157
|
};
|
|
1469
1158
|
const handleBlur = (e) => {
|
|
1470
1159
|
if (!justSelectedRef.current) {
|
|
1471
|
-
const typedText = inputValue.trim()
|
|
1160
|
+
const typedText = inputValue.trim();
|
|
1161
|
+
const typedTextLower = typedText.toLowerCase();
|
|
1472
1162
|
const highlightedOption = getHighlightedOption();
|
|
1473
1163
|
const label = getOptionLabel(highlightedOption);
|
|
1474
|
-
if (
|
|
1164
|
+
if (typedTextLower === label?.toLowerCase()) {
|
|
1475
1165
|
setTimeout(() => {
|
|
1476
1166
|
handleOptionSelect(highlightedOption);
|
|
1477
1167
|
}, 0);
|
|
1168
|
+
} else if (typedText === "") {
|
|
1169
|
+
setTimeout(() => {
|
|
1170
|
+
handleOptionSelect(getEmptyValue());
|
|
1171
|
+
}, 0);
|
|
1172
|
+
} else {
|
|
1173
|
+
setValidationError(
|
|
1174
|
+
errorMessage || "Please select an option from the list"
|
|
1175
|
+
);
|
|
1176
|
+
setTimeout(() => {
|
|
1177
|
+
setInputValue("");
|
|
1178
|
+
}, 0);
|
|
1478
1179
|
}
|
|
1479
1180
|
}
|
|
1480
1181
|
blurTimeoutRef.current = setTimeout(() => {
|
|
@@ -1537,7 +1238,7 @@ var ComboboxInner = ({
|
|
|
1537
1238
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
1538
1239
|
}
|
|
1539
1240
|
}, [filteredOptions, asyncOptions, isChanging]);
|
|
1540
|
-
const classes =
|
|
1241
|
+
const classes = classNames8(
|
|
1541
1242
|
"mobius mobius-combobox",
|
|
1542
1243
|
{
|
|
1543
1244
|
"mobius-combobox--is-expanded": isOpen,
|
|
@@ -1554,8 +1255,8 @@ var ComboboxInner = ({
|
|
|
1554
1255
|
const count = isOptionGroup(filteredOptions) ? filteredOptions.reduce((sum, group) => sum + group.options.length, 0) : filteredOptions.length;
|
|
1555
1256
|
return isOpen && isChanging ? `${count} option${count === 1 ? "" : "s"} available` : "";
|
|
1556
1257
|
};
|
|
1557
|
-
return /* @__PURE__ */
|
|
1558
|
-
/* @__PURE__ */
|
|
1258
|
+
return /* @__PURE__ */ jsxs5("div", { id, "data-testid": "mobius-combobox__wrapper", className: classes, children: [
|
|
1259
|
+
/* @__PURE__ */ jsx9(
|
|
1559
1260
|
VisuallyHidden,
|
|
1560
1261
|
{
|
|
1561
1262
|
role: "status",
|
|
@@ -1566,7 +1267,7 @@ var ComboboxInner = ({
|
|
|
1566
1267
|
children: getStatusMessage()
|
|
1567
1268
|
}
|
|
1568
1269
|
),
|
|
1569
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ jsx9(
|
|
1570
1271
|
TextField,
|
|
1571
1272
|
{
|
|
1572
1273
|
...otherProps,
|
|
@@ -1588,10 +1289,10 @@ var ComboboxInner = ({
|
|
|
1588
1289
|
"aria-activedescendant": highlightedIndex === -1 ? void 0 : getHighlightedOptionId(),
|
|
1589
1290
|
prefixInside: icon,
|
|
1590
1291
|
ref: inputRef,
|
|
1591
|
-
errorMessage: errorMessage ||
|
|
1292
|
+
errorMessage: errorMessage || validationError || error2?.message
|
|
1592
1293
|
}
|
|
1593
1294
|
),
|
|
1594
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ jsx9(
|
|
1595
1296
|
Listbox,
|
|
1596
1297
|
{
|
|
1597
1298
|
id: listboxId,
|
|
@@ -1601,7 +1302,8 @@ var ComboboxInner = ({
|
|
|
1601
1302
|
highlightedIndex,
|
|
1602
1303
|
highlightedGroupIndex,
|
|
1603
1304
|
onOptionSelect: handleOptionSelect,
|
|
1604
|
-
optionComponent
|
|
1305
|
+
optionComponent,
|
|
1306
|
+
optionTestIdPrefix
|
|
1605
1307
|
}
|
|
1606
1308
|
)
|
|
1607
1309
|
] });
|
|
@@ -1614,7 +1316,7 @@ function isLoqateErrorResponse(response) {
|
|
|
1614
1316
|
}
|
|
1615
1317
|
|
|
1616
1318
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
1617
|
-
import { jsx as
|
|
1319
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1618
1320
|
function optionsFromResponse({ Items }, addressLookupService) {
|
|
1619
1321
|
if (!Items || !Array.isArray(Items)) {
|
|
1620
1322
|
throw Error("No address found");
|
|
@@ -1643,7 +1345,7 @@ var AddressLookup = ({
|
|
|
1643
1345
|
errorMessage,
|
|
1644
1346
|
...otherProps
|
|
1645
1347
|
}) => {
|
|
1646
|
-
const [
|
|
1348
|
+
const [error2, _setError] = useState9(null);
|
|
1647
1349
|
const setError = useCallback4(
|
|
1648
1350
|
(newError) => {
|
|
1649
1351
|
if (newError != null) onError?.(newError);
|
|
@@ -1674,8 +1376,8 @@ var AddressLookup = ({
|
|
|
1674
1376
|
}
|
|
1675
1377
|
return addressLookupService.get(selected.id).then(onAddressSelected).catch(setError);
|
|
1676
1378
|
};
|
|
1677
|
-
const realErrorMessage =
|
|
1678
|
-
return /* @__PURE__ */
|
|
1379
|
+
const realErrorMessage = error2 && "An error occurred" || errorMessage;
|
|
1380
|
+
return /* @__PURE__ */ jsx10(
|
|
1679
1381
|
Combobox,
|
|
1680
1382
|
{
|
|
1681
1383
|
...otherProps,
|
|
@@ -1683,7 +1385,7 @@ var AddressLookup = ({
|
|
|
1683
1385
|
onSelected: handleSelected,
|
|
1684
1386
|
asyncOptions,
|
|
1685
1387
|
errorMessage: realErrorMessage,
|
|
1686
|
-
icon: /* @__PURE__ */
|
|
1388
|
+
icon: /* @__PURE__ */ jsx10(Icon, { icon: search })
|
|
1687
1389
|
}
|
|
1688
1390
|
);
|
|
1689
1391
|
};
|
|
@@ -1778,9 +1480,9 @@ _countries = new WeakMap();
|
|
|
1778
1480
|
_filters = new WeakMap();
|
|
1779
1481
|
|
|
1780
1482
|
// src/components/Alert/Alert.tsx
|
|
1781
|
-
import { circleInfo, circleTick, error
|
|
1782
|
-
import
|
|
1783
|
-
import { jsx as
|
|
1483
|
+
import { circleInfo, circleTick, error, warning } from "@simplybusiness/icons";
|
|
1484
|
+
import classNames9 from "classnames/dedupe";
|
|
1485
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1784
1486
|
function isAlertVariant(value) {
|
|
1785
1487
|
return value === "info" || value === "success" || value === "warning" || value === "error";
|
|
1786
1488
|
}
|
|
@@ -1796,7 +1498,7 @@ var Alert = ({ ref, ...props }) => {
|
|
|
1796
1498
|
if (!show) return null;
|
|
1797
1499
|
const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
|
|
1798
1500
|
const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
|
|
1799
|
-
const classes =
|
|
1501
|
+
const classes = classNames9(
|
|
1800
1502
|
"mobius",
|
|
1801
1503
|
"mobius-alert",
|
|
1802
1504
|
{
|
|
@@ -1812,24 +1514,24 @@ var Alert = ({ ref, ...props }) => {
|
|
|
1812
1514
|
info: circleInfo,
|
|
1813
1515
|
success: circleTick,
|
|
1814
1516
|
warning,
|
|
1815
|
-
error
|
|
1517
|
+
error
|
|
1816
1518
|
};
|
|
1817
|
-
const headerClasses =
|
|
1818
|
-
const iconClasses =
|
|
1819
|
-
const contentClasses =
|
|
1820
|
-
return /* @__PURE__ */
|
|
1821
|
-
/* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1823
|
-
header && /* @__PURE__ */
|
|
1824
|
-
/* @__PURE__ */
|
|
1519
|
+
const headerClasses = classNames9("mobius", "mobius-alert__header");
|
|
1520
|
+
const iconClasses = classNames9("mobius", "mobius-alert__icon");
|
|
1521
|
+
const contentClasses = classNames9("mobius", "mobius-alert__content");
|
|
1522
|
+
return /* @__PURE__ */ jsxs6(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
|
|
1523
|
+
/* @__PURE__ */ jsx11("span", { className: iconClasses, children: /* @__PURE__ */ jsx11(Icon, { icon: icon[variant], color: colorValue }) }),
|
|
1524
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1525
|
+
header && /* @__PURE__ */ jsx11("p", { className: headerClasses, children: header }),
|
|
1526
|
+
/* @__PURE__ */ jsx11("div", { className: contentClasses, children })
|
|
1825
1527
|
] })
|
|
1826
1528
|
] });
|
|
1827
1529
|
};
|
|
1828
1530
|
Alert.displayName = "Alert";
|
|
1829
1531
|
|
|
1830
1532
|
// src/components/Box/Box.tsx
|
|
1831
|
-
import
|
|
1832
|
-
import { jsx as
|
|
1533
|
+
import classNames10 from "classnames/dedupe";
|
|
1534
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1833
1535
|
var Box = ({ ref, ...props }) => {
|
|
1834
1536
|
const {
|
|
1835
1537
|
elementType: Element = "div",
|
|
@@ -1855,7 +1557,7 @@ var Box = ({ ref, ...props }) => {
|
|
|
1855
1557
|
style,
|
|
1856
1558
|
...otherProps
|
|
1857
1559
|
} = props;
|
|
1858
|
-
const classes =
|
|
1560
|
+
const classes = classNames10("mobius", "mobius-box", otherProps.className);
|
|
1859
1561
|
const styleProps = filterUndefinedProps({
|
|
1860
1562
|
padding: getSpacingValue(padding),
|
|
1861
1563
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
@@ -1872,26 +1574,26 @@ var Box = ({ ref, ...props }) => {
|
|
|
1872
1574
|
height,
|
|
1873
1575
|
...style
|
|
1874
1576
|
});
|
|
1875
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx12(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
1876
1578
|
};
|
|
1877
1579
|
Box.displayName = "Box";
|
|
1878
1580
|
|
|
1879
1581
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
1880
|
-
import { Children, cloneElement
|
|
1881
|
-
import
|
|
1882
|
-
import { jsx as
|
|
1582
|
+
import { Children, cloneElement } from "react";
|
|
1583
|
+
import classNames11 from "classnames/dedupe";
|
|
1584
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1883
1585
|
var Breadcrumbs = ({ ref, ...props }) => {
|
|
1884
1586
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
1885
1587
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
1886
1588
|
const { children, ...otherProps } = props;
|
|
1887
1589
|
const childArray = Children.toArray(children);
|
|
1888
|
-
const classes =
|
|
1590
|
+
const classes = classNames11(
|
|
1889
1591
|
"mobius",
|
|
1890
1592
|
"mobius-breadcrumb",
|
|
1891
1593
|
otherProps.className
|
|
1892
1594
|
);
|
|
1893
|
-
return /* @__PURE__ */
|
|
1894
|
-
(child, i) =>
|
|
1595
|
+
return /* @__PURE__ */ jsx13("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ jsx13("ul", { children: childArray.map(
|
|
1596
|
+
(child, i) => cloneElement(
|
|
1895
1597
|
child,
|
|
1896
1598
|
{
|
|
1897
1599
|
key: i,
|
|
@@ -1903,16 +1605,16 @@ var Breadcrumbs = ({ ref, ...props }) => {
|
|
|
1903
1605
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
1904
1606
|
|
|
1905
1607
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
1906
|
-
import { cloneElement as
|
|
1907
|
-
import
|
|
1908
|
-
import { jsx as
|
|
1608
|
+
import { cloneElement as cloneElement2, Children as Children2 } from "react";
|
|
1609
|
+
import classNames12 from "classnames/dedupe";
|
|
1610
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1909
1611
|
var BreadcrumbItem = ({ ref, ...props }) => {
|
|
1910
1612
|
const {
|
|
1911
1613
|
isDisabled = false,
|
|
1912
1614
|
isCurrent = false,
|
|
1913
1615
|
"aria-current": ariaCurrent = "page",
|
|
1914
1616
|
children,
|
|
1915
|
-
separator = /* @__PURE__ */
|
|
1617
|
+
separator = /* @__PURE__ */ jsx14(Box, { className: "mobius-breadcrumb__separator", "aria-hidden": "true", children: ">" }),
|
|
1916
1618
|
...otherProps
|
|
1917
1619
|
} = props;
|
|
1918
1620
|
const { itemProps } = {
|
|
@@ -1922,14 +1624,14 @@ var BreadcrumbItem = ({ ref, ...props }) => {
|
|
|
1922
1624
|
...otherProps
|
|
1923
1625
|
}
|
|
1924
1626
|
};
|
|
1925
|
-
const classes =
|
|
1627
|
+
const classes = classNames12(
|
|
1926
1628
|
"mobius",
|
|
1927
1629
|
"mobius-breadcrumb__item",
|
|
1928
1630
|
props.className
|
|
1929
1631
|
);
|
|
1930
|
-
const child = typeof children === "string" ? /* @__PURE__ */
|
|
1931
|
-
return /* @__PURE__ */
|
|
1932
|
-
|
|
1632
|
+
const child = typeof children === "string" ? /* @__PURE__ */ jsx14("span", { ...itemProps, children }) : Children2.only(children);
|
|
1633
|
+
return /* @__PURE__ */ jsxs7("li", { className: classes, children: [
|
|
1634
|
+
cloneElement2(child, {
|
|
1933
1635
|
...child.props,
|
|
1934
1636
|
...itemProps,
|
|
1935
1637
|
ref
|
|
@@ -1940,30 +1642,30 @@ var BreadcrumbItem = ({ ref, ...props }) => {
|
|
|
1940
1642
|
BreadcrumbItem.displayName = "BreadcrumbItem";
|
|
1941
1643
|
|
|
1942
1644
|
// src/components/Button/Button.tsx
|
|
1943
|
-
import
|
|
1645
|
+
import classNames13 from "classnames/dedupe";
|
|
1944
1646
|
|
|
1945
1647
|
// src/components/Button/Loading.tsx
|
|
1946
1648
|
import { loading } from "@simplybusiness/icons";
|
|
1947
|
-
import { Fragment as Fragment2, jsx as
|
|
1649
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1948
1650
|
var Loading = (props) => {
|
|
1949
1651
|
const { children } = props;
|
|
1950
|
-
return /* @__PURE__ */
|
|
1951
|
-
/* @__PURE__ */
|
|
1952
|
-
/* @__PURE__ */
|
|
1652
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1653
|
+
/* @__PURE__ */ jsx15("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ jsx15(Icon, { icon: loading, spin: true, size: "md" }) }),
|
|
1654
|
+
/* @__PURE__ */ jsx15(VisuallyHidden, { className: "mobius-button__loading-text", children: "Loading" }),
|
|
1953
1655
|
children
|
|
1954
1656
|
] });
|
|
1955
1657
|
};
|
|
1956
1658
|
|
|
1957
1659
|
// src/components/Button/Success.tsx
|
|
1958
1660
|
import { tick } from "@simplybusiness/icons";
|
|
1959
|
-
import { Fragment as Fragment3, jsx as
|
|
1960
|
-
var Success = () => /* @__PURE__ */
|
|
1961
|
-
/* @__PURE__ */
|
|
1962
|
-
/* @__PURE__ */
|
|
1661
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1662
|
+
var Success = () => /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1663
|
+
/* @__PURE__ */ jsx16("div", { className: "mobius-button__icon-wrapper", children: /* @__PURE__ */ jsx16(Icon, { icon: tick, size: "md" }) }),
|
|
1664
|
+
/* @__PURE__ */ jsx16(VisuallyHidden, { className: "mobius-button__success-text", children: "Success" })
|
|
1963
1665
|
] });
|
|
1964
1666
|
|
|
1965
1667
|
// src/components/Button/Button.tsx
|
|
1966
|
-
import { jsx as
|
|
1668
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1967
1669
|
var Button = ({ ref, ...props }) => {
|
|
1968
1670
|
const {
|
|
1969
1671
|
children,
|
|
@@ -1978,7 +1680,7 @@ var Button = ({ ref, ...props }) => {
|
|
|
1978
1680
|
...otherProps
|
|
1979
1681
|
} = props;
|
|
1980
1682
|
const { buttonProps } = useButton(props);
|
|
1981
|
-
otherProps.className =
|
|
1683
|
+
otherProps.className = classNames13(
|
|
1982
1684
|
"mobius",
|
|
1983
1685
|
"mobius-button",
|
|
1984
1686
|
`--variant-${variant}`,
|
|
@@ -1990,18 +1692,18 @@ var Button = ({ ref, ...props }) => {
|
|
|
1990
1692
|
},
|
|
1991
1693
|
otherProps.className
|
|
1992
1694
|
);
|
|
1993
|
-
return /* @__PURE__ */
|
|
1994
|
-
isLoading ? /* @__PURE__ */
|
|
1995
|
-
isSuccess && !isLoading && /* @__PURE__ */
|
|
1695
|
+
return /* @__PURE__ */ jsxs10(Component, { ref, ...buttonProps, ...otherProps, children: [
|
|
1696
|
+
isLoading ? /* @__PURE__ */ jsx17(Loading, { children }) : children,
|
|
1697
|
+
isSuccess && !isLoading && /* @__PURE__ */ jsx17(Success, {})
|
|
1996
1698
|
] });
|
|
1997
1699
|
};
|
|
1998
1700
|
Button.displayName = "Button";
|
|
1999
1701
|
|
|
2000
1702
|
// src/components/Checkbox/Checkbox.tsx
|
|
2001
|
-
import { useRef as
|
|
2002
|
-
import
|
|
1703
|
+
import { useRef as useRef4, useId as useId3, useState as useState10, useEffect as useEffect7 } from "react";
|
|
1704
|
+
import classNames14 from "classnames/dedupe";
|
|
2003
1705
|
import { squareTick, square } from "@simplybusiness/icons";
|
|
2004
|
-
import { jsx as
|
|
1706
|
+
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2005
1707
|
var Checkbox = ({ ref, ...props }) => {
|
|
2006
1708
|
const {
|
|
2007
1709
|
id,
|
|
@@ -2022,9 +1724,9 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2022
1724
|
...rest
|
|
2023
1725
|
} = props;
|
|
2024
1726
|
const [checked, setChecked] = useState10(defaultSelected);
|
|
2025
|
-
const fallbackRef =
|
|
1727
|
+
const fallbackRef = useRef4(null);
|
|
2026
1728
|
const refObj = ref || fallbackRef;
|
|
2027
|
-
const inputId =
|
|
1729
|
+
const inputId = useId3();
|
|
2028
1730
|
const isControlled = typeof selected === "boolean";
|
|
2029
1731
|
useEffect7(() => {
|
|
2030
1732
|
if (isControlled) {
|
|
@@ -2032,7 +1734,7 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2032
1734
|
}
|
|
2033
1735
|
}, [selected, isControlled]);
|
|
2034
1736
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2035
|
-
const sharedClasses =
|
|
1737
|
+
const sharedClasses = classNames14(
|
|
2036
1738
|
{
|
|
2037
1739
|
"--is-disabled": isDisabled,
|
|
2038
1740
|
"--is-selected": checked,
|
|
@@ -2041,31 +1743,31 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2041
1743
|
},
|
|
2042
1744
|
validationClasses
|
|
2043
1745
|
);
|
|
2044
|
-
const wrapperClasses =
|
|
1746
|
+
const wrapperClasses = classNames14(
|
|
2045
1747
|
"mobius",
|
|
2046
1748
|
"mobius-checkbox",
|
|
2047
1749
|
sharedClasses,
|
|
2048
1750
|
className
|
|
2049
1751
|
);
|
|
2050
|
-
const labelClasses =
|
|
2051
|
-
const inputClasses =
|
|
2052
|
-
const iconClasses =
|
|
2053
|
-
const errorMessageId =
|
|
1752
|
+
const labelClasses = classNames14("mobius-checkbox__label", sharedClasses);
|
|
1753
|
+
const inputClasses = classNames14("mobius-checkbox__input", sharedClasses);
|
|
1754
|
+
const iconClasses = classNames14("mobius-checkbox__icon", sharedClasses);
|
|
1755
|
+
const errorMessageId = useId3();
|
|
2054
1756
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2055
1757
|
const describedBy = spaceDelimitedList([
|
|
2056
1758
|
shouldErrorMessageShow,
|
|
2057
1759
|
ariaDescribedBy
|
|
2058
1760
|
]);
|
|
2059
|
-
const labelId =
|
|
1761
|
+
const labelId = useId3();
|
|
2060
1762
|
const handleChange = (event) => {
|
|
2061
1763
|
setChecked(!checked);
|
|
2062
1764
|
if (onChange) {
|
|
2063
1765
|
onChange(event, isLastItem);
|
|
2064
1766
|
}
|
|
2065
1767
|
};
|
|
2066
|
-
return /* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ jsxs11(Stack, { gap: "xs", className: wrapperClasses, children: [
|
|
1769
|
+
/* @__PURE__ */ jsxs11("label", { className: labelClasses, children: [
|
|
1770
|
+
/* @__PURE__ */ jsx18(
|
|
2069
1771
|
"input",
|
|
2070
1772
|
{
|
|
2071
1773
|
"aria-describedby": describedBy,
|
|
@@ -2086,7 +1788,7 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2086
1788
|
...rest
|
|
2087
1789
|
}
|
|
2088
1790
|
),
|
|
2089
|
-
/* @__PURE__ */
|
|
1791
|
+
/* @__PURE__ */ jsx18(
|
|
2090
1792
|
Icon,
|
|
2091
1793
|
{
|
|
2092
1794
|
icon: checked ? squareTick : square,
|
|
@@ -2094,25 +1796,25 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2094
1796
|
className: iconClasses
|
|
2095
1797
|
}
|
|
2096
1798
|
),
|
|
2097
|
-
/* @__PURE__ */
|
|
1799
|
+
/* @__PURE__ */ jsx18("span", { id: labelId, className: "mobius-checkbox__visible-label", children: label })
|
|
2098
1800
|
] }),
|
|
2099
|
-
/* @__PURE__ */
|
|
1801
|
+
/* @__PURE__ */ jsx18(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2100
1802
|
] });
|
|
2101
1803
|
};
|
|
2102
1804
|
Checkbox.displayName = "Checkbox";
|
|
2103
1805
|
|
|
2104
1806
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2105
|
-
import
|
|
1807
|
+
import classNames15 from "classnames/dedupe";
|
|
2106
1808
|
import {
|
|
2107
1809
|
Children as Children3,
|
|
2108
|
-
cloneElement as
|
|
1810
|
+
cloneElement as cloneElement3,
|
|
2109
1811
|
isValidElement,
|
|
2110
1812
|
useEffect as useEffect8,
|
|
2111
|
-
useId as
|
|
2112
|
-
useRef as
|
|
1813
|
+
useId as useId4,
|
|
1814
|
+
useRef as useRef5,
|
|
2113
1815
|
useState as useState11
|
|
2114
1816
|
} from "react";
|
|
2115
|
-
import { jsx as
|
|
1817
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2116
1818
|
var CheckboxGroup = ({ ref, ...props }) => {
|
|
2117
1819
|
const {
|
|
2118
1820
|
label,
|
|
@@ -2131,8 +1833,8 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2131
1833
|
...rest
|
|
2132
1834
|
} = props;
|
|
2133
1835
|
const [selected, setSelected] = useState11(defaultValue);
|
|
2134
|
-
const isInitializedRef =
|
|
2135
|
-
const prevDefaultValueRef =
|
|
1836
|
+
const isInitializedRef = useRef5(false);
|
|
1837
|
+
const prevDefaultValueRef = useRef5(defaultValue);
|
|
2136
1838
|
useEffect8(() => {
|
|
2137
1839
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2138
1840
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
@@ -2143,7 +1845,7 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2143
1845
|
isInitializedRef.current = true;
|
|
2144
1846
|
}
|
|
2145
1847
|
}, [defaultValue]);
|
|
2146
|
-
const checkboxGroupClasses =
|
|
1848
|
+
const checkboxGroupClasses = classNames15(
|
|
2147
1849
|
"mobius",
|
|
2148
1850
|
"mobius-checkbox-group",
|
|
2149
1851
|
className,
|
|
@@ -2155,19 +1857,19 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2155
1857
|
}
|
|
2156
1858
|
);
|
|
2157
1859
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
2158
|
-
const labelClasses =
|
|
1860
|
+
const labelClasses = classNames15(
|
|
2159
1861
|
{
|
|
2160
1862
|
"--is-disabled": isDisabled
|
|
2161
1863
|
},
|
|
2162
1864
|
validationClasses
|
|
2163
1865
|
);
|
|
2164
|
-
const errorMessageId =
|
|
1866
|
+
const errorMessageId = useId4();
|
|
2165
1867
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2166
1868
|
const describedBy = spaceDelimitedList([
|
|
2167
1869
|
shouldErrorMessageShow,
|
|
2168
1870
|
props["aria-describedby"]
|
|
2169
1871
|
]);
|
|
2170
|
-
const labelId =
|
|
1872
|
+
const labelId = useId4();
|
|
2171
1873
|
const handleChange = (event, isLastItem = false) => {
|
|
2172
1874
|
const {
|
|
2173
1875
|
target: { value, checked }
|
|
@@ -2190,7 +1892,7 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2190
1892
|
(child) => isValidElement(child) && child.type === Checkbox
|
|
2191
1893
|
).pop();
|
|
2192
1894
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2193
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ jsxs12(
|
|
2194
1896
|
"div",
|
|
2195
1897
|
{
|
|
2196
1898
|
...rest,
|
|
@@ -2202,13 +1904,13 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2202
1904
|
"--checkbox-items-per-row": itemsPerRow || Children3.count(children)
|
|
2203
1905
|
},
|
|
2204
1906
|
children: [
|
|
2205
|
-
label && /* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
1907
|
+
label && /* @__PURE__ */ jsx19(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
1908
|
+
/* @__PURE__ */ jsx19("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2207
1909
|
if (isValidElement(child)) {
|
|
2208
1910
|
const isLastItem = child === lastCheckbox;
|
|
2209
1911
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2210
1912
|
const childProps = child.props;
|
|
2211
|
-
return
|
|
1913
|
+
return cloneElement3(
|
|
2212
1914
|
child,
|
|
2213
1915
|
{
|
|
2214
1916
|
isDisabled: isChildDisabled,
|
|
@@ -2224,7 +1926,7 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2224
1926
|
}
|
|
2225
1927
|
return child;
|
|
2226
1928
|
}) }),
|
|
2227
|
-
errorMessage && /* @__PURE__ */
|
|
1929
|
+
errorMessage && /* @__PURE__ */ jsx19(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
2228
1930
|
]
|
|
2229
1931
|
}
|
|
2230
1932
|
);
|
|
@@ -2232,23 +1934,23 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2232
1934
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
2233
1935
|
|
|
2234
1936
|
// src/components/Container/Container.tsx
|
|
2235
|
-
import
|
|
2236
|
-
import { jsx as
|
|
1937
|
+
import classNames16 from "classnames/dedupe";
|
|
1938
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2237
1939
|
var Container = ({ ref, ...props }) => {
|
|
2238
1940
|
const { elementType: Element = "div", size = "md", ...otherProps } = props;
|
|
2239
|
-
const classes =
|
|
1941
|
+
const classes = classNames16(
|
|
2240
1942
|
"mobius",
|
|
2241
1943
|
"mobius-container",
|
|
2242
1944
|
sizeClasses(size),
|
|
2243
1945
|
otherProps.className
|
|
2244
1946
|
);
|
|
2245
|
-
return /* @__PURE__ */
|
|
1947
|
+
return /* @__PURE__ */ jsx20(Element, { ref, ...otherProps, className: classes });
|
|
2246
1948
|
};
|
|
2247
1949
|
Container.displayName = "Container";
|
|
2248
1950
|
|
|
2249
1951
|
// src/components/DateField/DateField.tsx
|
|
2250
|
-
import
|
|
2251
|
-
import { useEffect as useEffect9, useRef as
|
|
1952
|
+
import classNames17 from "classnames/dedupe";
|
|
1953
|
+
import { useEffect as useEffect9, useRef as useRef6, useState as useState12 } from "react";
|
|
2252
1954
|
|
|
2253
1955
|
// src/components/DateField/validation.ts
|
|
2254
1956
|
var convertToDateFormat = (date, format) => {
|
|
@@ -2283,7 +1985,7 @@ var isValidDate = (date, format = "yyyy-mm-dd") => {
|
|
|
2283
1985
|
};
|
|
2284
1986
|
|
|
2285
1987
|
// src/components/DateField/DateField.tsx
|
|
2286
|
-
import { jsx as
|
|
1988
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2287
1989
|
var MIN_MAX_ERROR = '"min" value should not be greater than "max" value.';
|
|
2288
1990
|
var DateField = ({ ref, ...props }) => {
|
|
2289
1991
|
const {
|
|
@@ -2296,16 +1998,16 @@ var DateField = ({ ref, ...props }) => {
|
|
|
2296
1998
|
value,
|
|
2297
1999
|
...otherProps
|
|
2298
2000
|
} = props;
|
|
2299
|
-
const [
|
|
2001
|
+
const [error2, setError] = useState12(errorMessage);
|
|
2300
2002
|
const [isInvalid, setIsInvalid] = useState12(void 0);
|
|
2301
|
-
const localRef =
|
|
2302
|
-
const classes =
|
|
2003
|
+
const localRef = useRef6(null);
|
|
2004
|
+
const classes = classNames17("mobius-date-field", className);
|
|
2303
2005
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
2304
2006
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
2305
2007
|
const formattedDefaultValue = defaultValue ? convertToDateFormat(defaultValue, format) : void 0;
|
|
2306
2008
|
const formattedValue = value ? convertToDateFormat(value, format) : void 0;
|
|
2307
|
-
const setInvalidState = (
|
|
2308
|
-
setError(
|
|
2009
|
+
const setInvalidState = (error3) => {
|
|
2010
|
+
setError(error3);
|
|
2309
2011
|
setIsInvalid(true);
|
|
2310
2012
|
};
|
|
2311
2013
|
const setValidState = () => {
|
|
@@ -2345,7 +2047,7 @@ var DateField = ({ ref, ...props }) => {
|
|
|
2345
2047
|
validate();
|
|
2346
2048
|
otherProps.onBlur?.(event);
|
|
2347
2049
|
};
|
|
2348
|
-
return /* @__PURE__ */
|
|
2050
|
+
return /* @__PURE__ */ jsx21(
|
|
2349
2051
|
TextField,
|
|
2350
2052
|
{
|
|
2351
2053
|
ref: mergeRefs([localRef, ref]),
|
|
@@ -2353,7 +2055,7 @@ var DateField = ({ ref, ...props }) => {
|
|
|
2353
2055
|
type: "date",
|
|
2354
2056
|
min: formattedMin,
|
|
2355
2057
|
max: formattedMax,
|
|
2356
|
-
errorMessage: errorMessage ??
|
|
2058
|
+
errorMessage: errorMessage ?? error2,
|
|
2357
2059
|
isInvalid,
|
|
2358
2060
|
defaultValue: formattedDefaultValue,
|
|
2359
2061
|
value: formattedValue,
|
|
@@ -2365,13 +2067,13 @@ var DateField = ({ ref, ...props }) => {
|
|
|
2365
2067
|
DateField.displayName = "DateField";
|
|
2366
2068
|
|
|
2367
2069
|
// src/components/Drawer/Content.tsx
|
|
2368
|
-
import { jsx as
|
|
2369
|
-
var Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */
|
|
2070
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2071
|
+
var Content = ({ ref, children, ...otherProps }) => /* @__PURE__ */ jsx22("div", { ref, ...otherProps, className: "mobius-drawer__content", children });
|
|
2370
2072
|
Content.displayName = "Content";
|
|
2371
2073
|
|
|
2372
2074
|
// src/components/Drawer/Drawer.tsx
|
|
2373
|
-
import
|
|
2374
|
-
import { useEffect as useEffect10, useId as
|
|
2075
|
+
import classNames18 from "classnames/dedupe";
|
|
2076
|
+
import { useEffect as useEffect10, useId as useId5, useMemo as useMemo2, useRef as useRef7, useState as useState13 } from "react";
|
|
2375
2077
|
|
|
2376
2078
|
// src/components/Drawer/DrawerContext.tsx
|
|
2377
2079
|
import { createContext } from "react";
|
|
@@ -2383,7 +2085,7 @@ var DrawerContext = createContext({
|
|
|
2383
2085
|
});
|
|
2384
2086
|
|
|
2385
2087
|
// src/components/Drawer/Drawer.tsx
|
|
2386
|
-
import { jsx as
|
|
2088
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2387
2089
|
var TRANSITION_CSS_VARIABLE = "--drawer-transition-duration";
|
|
2388
2090
|
var Drawer = ({ ref, ...props }) => {
|
|
2389
2091
|
const {
|
|
@@ -2396,7 +2098,7 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
2396
2098
|
onClose,
|
|
2397
2099
|
children
|
|
2398
2100
|
} = props;
|
|
2399
|
-
const dialogRef =
|
|
2101
|
+
const dialogRef = useRef7(null);
|
|
2400
2102
|
const [shouldTransition, setShouldTransition] = useState13(false);
|
|
2401
2103
|
const { close } = useDialog({
|
|
2402
2104
|
ref: dialogRef,
|
|
@@ -2408,9 +2110,9 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
2408
2110
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
2409
2111
|
}
|
|
2410
2112
|
});
|
|
2411
|
-
const hiddenId = `dialog-screen-reader-announce-${
|
|
2412
|
-
const headerId = `dialog-header-${
|
|
2413
|
-
const dialogClasses =
|
|
2113
|
+
const hiddenId = `dialog-screen-reader-announce-${useId5()}`;
|
|
2114
|
+
const headerId = `dialog-header-${useId5()}`;
|
|
2115
|
+
const dialogClasses = classNames18(
|
|
2414
2116
|
"mobius",
|
|
2415
2117
|
"mobius-drawer",
|
|
2416
2118
|
`--${direction}`,
|
|
@@ -2430,18 +2132,18 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
2430
2132
|
}),
|
|
2431
2133
|
[close, closeLabel, headerId]
|
|
2432
2134
|
);
|
|
2433
|
-
return /* @__PURE__ */
|
|
2135
|
+
return /* @__PURE__ */ jsxs13(
|
|
2434
2136
|
"dialog",
|
|
2435
2137
|
{
|
|
2436
|
-
id:
|
|
2138
|
+
id: useId5(),
|
|
2437
2139
|
ref: mergeRefs([dialogRef, ref]),
|
|
2438
2140
|
onCancel: close,
|
|
2439
2141
|
className: dialogClasses,
|
|
2440
2142
|
"aria-describedby": hiddenId,
|
|
2441
2143
|
"aria-labelledby": headerId,
|
|
2442
2144
|
children: [
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2145
|
+
/* @__PURE__ */ jsx23(VisuallyHidden, { children: /* @__PURE__ */ jsx23("div", { id: hiddenId, children: announce }) }),
|
|
2146
|
+
/* @__PURE__ */ jsx23(DrawerContext.Provider, { value: contextValue, children })
|
|
2445
2147
|
]
|
|
2446
2148
|
}
|
|
2447
2149
|
);
|
|
@@ -2457,12 +2159,12 @@ var useDrawer = () => {
|
|
|
2457
2159
|
|
|
2458
2160
|
// src/components/Drawer/Header.tsx
|
|
2459
2161
|
import { cross } from "@simplybusiness/icons";
|
|
2460
|
-
import { jsx as
|
|
2162
|
+
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2461
2163
|
var Header = ({ ref, children, ...otherProps }) => {
|
|
2462
2164
|
const { onClose, closeLabel, headerId } = useDrawer();
|
|
2463
|
-
return /* @__PURE__ */
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2165
|
+
return /* @__PURE__ */ jsxs14("header", { ref, ...otherProps, className: "mobius-drawer__header", children: [
|
|
2166
|
+
/* @__PURE__ */ jsx24("h2", { id: headerId, children }),
|
|
2167
|
+
/* @__PURE__ */ jsxs14(
|
|
2466
2168
|
Button,
|
|
2467
2169
|
{
|
|
2468
2170
|
"aria-label": "Close",
|
|
@@ -2471,7 +2173,7 @@ var Header = ({ ref, children, ...otherProps }) => {
|
|
|
2471
2173
|
className: "mobius-drawer__close",
|
|
2472
2174
|
size: "sm",
|
|
2473
2175
|
children: [
|
|
2474
|
-
/* @__PURE__ */
|
|
2176
|
+
/* @__PURE__ */ jsx24(Icon, { icon: cross }),
|
|
2475
2177
|
" ",
|
|
2476
2178
|
closeLabel
|
|
2477
2179
|
]
|
|
@@ -2489,10 +2191,10 @@ var Drawer2 = Object.assign(Drawer, {
|
|
|
2489
2191
|
Drawer2.displayName = "Drawer";
|
|
2490
2192
|
|
|
2491
2193
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
2492
|
-
import { Children as Children4, isValidElement as isValidElement2, cloneElement as
|
|
2194
|
+
import { Children as Children4, isValidElement as isValidElement2, cloneElement as cloneElement4, useState as useState14 } from "react";
|
|
2493
2195
|
import useDropdownMenu from "react-accessible-dropdown-menu-hook";
|
|
2494
|
-
import
|
|
2495
|
-
import { jsx as
|
|
2196
|
+
import classNames19 from "classnames/dedupe";
|
|
2197
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2496
2198
|
var DropdownMenu = ({ ref, ...props }) => {
|
|
2497
2199
|
const {
|
|
2498
2200
|
elementType: Element = "nav",
|
|
@@ -2509,13 +2211,13 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
2509
2211
|
isOpen: open,
|
|
2510
2212
|
setIsOpen
|
|
2511
2213
|
} = useDropdownMenu(numberOfItems);
|
|
2512
|
-
const classes =
|
|
2214
|
+
const classes = classNames19(
|
|
2513
2215
|
"mobius",
|
|
2514
2216
|
"mobius-dropdown-menu",
|
|
2515
2217
|
otherProps.className
|
|
2516
2218
|
);
|
|
2517
|
-
const triggerClasses =
|
|
2518
|
-
const listClasses =
|
|
2219
|
+
const triggerClasses = classNames19("mobius", "mobius-dropdown-menu__trigger");
|
|
2220
|
+
const listClasses = classNames19("mobius", "mobius-dropdown-menu__list", {
|
|
2519
2221
|
"--is-open": open
|
|
2520
2222
|
});
|
|
2521
2223
|
const handleChildClick = ({ onClick }, index) => {
|
|
@@ -2525,16 +2227,16 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
2525
2227
|
onClick();
|
|
2526
2228
|
}
|
|
2527
2229
|
};
|
|
2528
|
-
return /* @__PURE__ */
|
|
2529
|
-
trigger ?
|
|
2230
|
+
return /* @__PURE__ */ jsxs15(Element, { ref, ...otherProps, className: classes, children: [
|
|
2231
|
+
trigger ? cloneElement4(trigger, {
|
|
2530
2232
|
className: triggerClasses,
|
|
2531
2233
|
open,
|
|
2532
2234
|
label,
|
|
2533
2235
|
...buttonProps
|
|
2534
|
-
}) : /* @__PURE__ */
|
|
2535
|
-
/* @__PURE__ */
|
|
2236
|
+
}) : /* @__PURE__ */ jsx25(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
2237
|
+
/* @__PURE__ */ jsx25("ul", { className: listClasses, role: "menu", children: Children4.map(children, (child, index) => {
|
|
2536
2238
|
if (isValidElement2(child)) {
|
|
2537
|
-
return
|
|
2239
|
+
return cloneElement4(child, {
|
|
2538
2240
|
onClick: () => handleChildClick(child.props, index),
|
|
2539
2241
|
active: index === activeId,
|
|
2540
2242
|
...itemProps[index]
|
|
@@ -2547,9 +2249,9 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
2547
2249
|
DropdownMenu.displayName = "DropdownMenu";
|
|
2548
2250
|
|
|
2549
2251
|
// src/components/DropdownMenu/Item.tsx
|
|
2550
|
-
import { cloneElement as
|
|
2551
|
-
import
|
|
2552
|
-
import { jsx as
|
|
2252
|
+
import { cloneElement as cloneElement5, isValidElement as isValidElement3, Children as Children5 } from "react";
|
|
2253
|
+
import classNames20 from "classnames/dedupe";
|
|
2254
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
2553
2255
|
var Item = ({ ref, ...props }) => {
|
|
2554
2256
|
const {
|
|
2555
2257
|
elementType: Element = "li",
|
|
@@ -2558,26 +2260,26 @@ var Item = ({ ref, ...props }) => {
|
|
|
2558
2260
|
children,
|
|
2559
2261
|
...otherProps
|
|
2560
2262
|
} = props;
|
|
2561
|
-
const classes =
|
|
2263
|
+
const classes = classNames20(
|
|
2562
2264
|
"mobius",
|
|
2563
2265
|
"mobius-dropdown-menu__item",
|
|
2564
2266
|
{ "--is-active": active },
|
|
2565
2267
|
otherProps.className
|
|
2566
2268
|
);
|
|
2567
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ jsx26(Element, { ref, onClick, ...otherProps, children: Children5.map(children, (child) => {
|
|
2568
2270
|
if (isValidElement3(child)) {
|
|
2569
|
-
const childClasses =
|
|
2271
|
+
const childClasses = classNames20(
|
|
2570
2272
|
child.props.className,
|
|
2571
2273
|
classes
|
|
2572
2274
|
);
|
|
2573
|
-
return
|
|
2275
|
+
return cloneElement5(
|
|
2574
2276
|
child,
|
|
2575
2277
|
{
|
|
2576
2278
|
className: childClasses
|
|
2577
2279
|
}
|
|
2578
2280
|
);
|
|
2579
2281
|
}
|
|
2580
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ jsx26("span", { className: classes, children: child });
|
|
2581
2283
|
}) });
|
|
2582
2284
|
};
|
|
2583
2285
|
Item.displayName = "DropdownMenu.Item";
|
|
@@ -2592,16 +2294,16 @@ var DropdownMenu2 = Object.assign(
|
|
|
2592
2294
|
DropdownMenu2.displayName = "DropdownMenu";
|
|
2593
2295
|
|
|
2594
2296
|
// src/components/Fieldset/Fieldset.tsx
|
|
2595
|
-
import
|
|
2596
|
-
import { cloneElement as
|
|
2597
|
-
import { jsx as
|
|
2297
|
+
import classNames21 from "classnames/dedupe";
|
|
2298
|
+
import { cloneElement as cloneElement6, useId as useId6 } from "react";
|
|
2299
|
+
import { jsx as jsx27, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2598
2300
|
var useFieldset = (props) => {
|
|
2599
2301
|
const { legend } = props;
|
|
2600
2302
|
let legendProps = {};
|
|
2601
2303
|
let containerProps = {
|
|
2602
2304
|
role: "group"
|
|
2603
2305
|
};
|
|
2604
|
-
const legendId =
|
|
2306
|
+
const legendId = useId6();
|
|
2605
2307
|
if (legend) {
|
|
2606
2308
|
legendProps = {
|
|
2607
2309
|
...legendProps,
|
|
@@ -2621,22 +2323,22 @@ var Fieldset = ({ ref: _ref, ...props }) => {
|
|
|
2621
2323
|
const {
|
|
2622
2324
|
children,
|
|
2623
2325
|
legend,
|
|
2624
|
-
legendComponent = /* @__PURE__ */
|
|
2326
|
+
legendComponent = /* @__PURE__ */ jsx27("legend", {}),
|
|
2625
2327
|
...otherProps
|
|
2626
2328
|
} = props;
|
|
2627
2329
|
const { legendProps, containerProps } = useFieldset(props);
|
|
2628
|
-
const classes =
|
|
2330
|
+
const classes = classNames21("mobius", "mobius-fieldset", props.className);
|
|
2629
2331
|
legendProps.className = "mobius-fieldset__legend";
|
|
2630
|
-
return /* @__PURE__ */
|
|
2631
|
-
legend &&
|
|
2332
|
+
return /* @__PURE__ */ jsxs16(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
2333
|
+
legend && cloneElement6(legendComponent, { ...legendProps }, [legend]),
|
|
2632
2334
|
children
|
|
2633
2335
|
] });
|
|
2634
2336
|
};
|
|
2635
2337
|
Fieldset.displayName = "Fieldset";
|
|
2636
2338
|
|
|
2637
2339
|
// src/components/Grid/Grid.tsx
|
|
2638
|
-
import
|
|
2639
|
-
import { jsx as
|
|
2340
|
+
import classNames22 from "classnames/dedupe";
|
|
2341
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2640
2342
|
var Grid = ({ ref: _ref, ...props }) => {
|
|
2641
2343
|
const {
|
|
2642
2344
|
columns = 12,
|
|
@@ -2651,7 +2353,7 @@ var Grid = ({ ref: _ref, ...props }) => {
|
|
|
2651
2353
|
style,
|
|
2652
2354
|
...rest
|
|
2653
2355
|
} = props;
|
|
2654
|
-
const classes =
|
|
2356
|
+
const classes = classNames22("mobius", "mobius-grid", className);
|
|
2655
2357
|
const styles = filterUndefinedProps({
|
|
2656
2358
|
boxSizing: "border-box",
|
|
2657
2359
|
display: "grid",
|
|
@@ -2665,14 +2367,14 @@ var Grid = ({ ref: _ref, ...props }) => {
|
|
|
2665
2367
|
justifyItems,
|
|
2666
2368
|
...style
|
|
2667
2369
|
});
|
|
2668
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ jsx28("div", { style: styles, className: classes, ...rest });
|
|
2669
2371
|
};
|
|
2670
2372
|
Grid.displayName = "Grid";
|
|
2671
2373
|
|
|
2672
2374
|
// src/components/Grid/Item.tsx
|
|
2673
2375
|
import { useEffect as useEffect11, useState as useState15 } from "react";
|
|
2674
|
-
import
|
|
2675
|
-
import { jsx as
|
|
2376
|
+
import classNames23 from "classnames/dedupe";
|
|
2377
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2676
2378
|
var getBreakpointMap = (config) => Object.entries(config).reduce(
|
|
2677
2379
|
(prev, [key, value]) => {
|
|
2678
2380
|
const previous = Object.values(prev);
|
|
@@ -2708,7 +2410,7 @@ var GridItem = ({ ref: _ref, ...props }) => {
|
|
|
2708
2410
|
xxl
|
|
2709
2411
|
});
|
|
2710
2412
|
const [responsiveSpan, setResponsiveSpan] = useState15();
|
|
2711
|
-
const classes =
|
|
2413
|
+
const classes = classNames23("mobius-grid__item", className);
|
|
2712
2414
|
useEffect11(() => {
|
|
2713
2415
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
2714
2416
|
}, [breakpointSize, breakpointMap]);
|
|
@@ -2717,7 +2419,7 @@ var GridItem = ({ ref: _ref, ...props }) => {
|
|
|
2717
2419
|
alignSelf,
|
|
2718
2420
|
justifySelf
|
|
2719
2421
|
};
|
|
2720
|
-
return /* @__PURE__ */
|
|
2422
|
+
return /* @__PURE__ */ jsx29("div", { style: { ...styles }, className: classes, ...rest });
|
|
2721
2423
|
};
|
|
2722
2424
|
GridItem.displayName = "GridItem";
|
|
2723
2425
|
|
|
@@ -2728,22 +2430,22 @@ var Grid2 = Object.assign(Grid, {
|
|
|
2728
2430
|
Grid2.displayName = "Grid";
|
|
2729
2431
|
|
|
2730
2432
|
// src/components/Image/Image.tsx
|
|
2731
|
-
import
|
|
2732
|
-
import { jsx as
|
|
2433
|
+
import classNames24 from "classnames/dedupe";
|
|
2434
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2733
2435
|
var Image = ({
|
|
2734
2436
|
ref,
|
|
2735
2437
|
alt,
|
|
2736
2438
|
elementType: Component = "img",
|
|
2737
2439
|
...otherProps
|
|
2738
2440
|
}) => {
|
|
2739
|
-
const classes =
|
|
2740
|
-
return /* @__PURE__ */
|
|
2441
|
+
const classes = classNames24("mobius", "mobius-image", otherProps.className);
|
|
2442
|
+
return /* @__PURE__ */ jsx30(Component, { alt, ref, ...otherProps, className: classes });
|
|
2741
2443
|
};
|
|
2742
2444
|
Image.displayName = "Image";
|
|
2743
2445
|
|
|
2744
2446
|
// src/components/Link/Link.tsx
|
|
2745
|
-
import
|
|
2746
|
-
import { jsx as
|
|
2447
|
+
import classNames25 from "classnames/dedupe";
|
|
2448
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2747
2449
|
var Link = ({ ref, ...props }) => {
|
|
2748
2450
|
const {
|
|
2749
2451
|
isDisabled = false,
|
|
@@ -2757,7 +2459,7 @@ var Link = ({ ref, ...props }) => {
|
|
|
2757
2459
|
pointerEvents: "none"
|
|
2758
2460
|
};
|
|
2759
2461
|
const styles = { ...style, ...isDisabled && disabledStyles };
|
|
2760
|
-
const classes =
|
|
2462
|
+
const classes = classNames25(
|
|
2761
2463
|
"mobius",
|
|
2762
2464
|
"mobius-link",
|
|
2763
2465
|
className,
|
|
@@ -2766,7 +2468,7 @@ var Link = ({ ref, ...props }) => {
|
|
|
2766
2468
|
"--is-disabled": isDisabled
|
|
2767
2469
|
}
|
|
2768
2470
|
);
|
|
2769
|
-
return /* @__PURE__ */
|
|
2471
|
+
return /* @__PURE__ */ jsx31(
|
|
2770
2472
|
Component,
|
|
2771
2473
|
{
|
|
2772
2474
|
ref,
|
|
@@ -2781,8 +2483,8 @@ var Link = ({ ref, ...props }) => {
|
|
|
2781
2483
|
Link.displayName = "Link";
|
|
2782
2484
|
|
|
2783
2485
|
// src/components/LinkButton/LinkButton.tsx
|
|
2784
|
-
import
|
|
2785
|
-
import { jsx as
|
|
2486
|
+
import classNames26 from "classnames/dedupe";
|
|
2487
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2786
2488
|
function LinkButton({
|
|
2787
2489
|
href,
|
|
2788
2490
|
children,
|
|
@@ -2793,14 +2495,14 @@ function LinkButton({
|
|
|
2793
2495
|
if (!href) {
|
|
2794
2496
|
throw new Error("LinkButton requires a href prop");
|
|
2795
2497
|
}
|
|
2796
|
-
const classes =
|
|
2797
|
-
return /* @__PURE__ */
|
|
2498
|
+
const classes = classNames26("mobius", "mobius-link-button", className);
|
|
2499
|
+
return /* @__PURE__ */ jsx32(Button, { elementType, href, className: classes, ...rest, children });
|
|
2798
2500
|
}
|
|
2799
2501
|
|
|
2800
2502
|
// src/components/List/List.tsx
|
|
2801
|
-
import { Children as Children6, cloneElement as
|
|
2802
|
-
import
|
|
2803
|
-
import { jsx as
|
|
2503
|
+
import { Children as Children6, cloneElement as cloneElement7, isValidElement as isValidElement4 } from "react";
|
|
2504
|
+
import classNames27 from "classnames/dedupe";
|
|
2505
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
2804
2506
|
var List = ({ ref, ...props }) => {
|
|
2805
2507
|
const Component = props.isOrdered ? "ol" : "ul";
|
|
2806
2508
|
const { children, icon, ...otherProps } = props;
|
|
@@ -2809,7 +2511,7 @@ var List = ({ ref, ...props }) => {
|
|
|
2809
2511
|
...restProps,
|
|
2810
2512
|
reversed: isReversed
|
|
2811
2513
|
};
|
|
2812
|
-
const classes =
|
|
2514
|
+
const classes = classNames27(
|
|
2813
2515
|
"mobius",
|
|
2814
2516
|
"mobius-list",
|
|
2815
2517
|
{
|
|
@@ -2818,9 +2520,9 @@ var List = ({ ref, ...props }) => {
|
|
|
2818
2520
|
},
|
|
2819
2521
|
otherProps.className
|
|
2820
2522
|
);
|
|
2821
|
-
return /* @__PURE__ */
|
|
2523
|
+
return /* @__PURE__ */ jsx33(Component, { ref, ...mappedProps, className: classes, children: Children6.map(children, (child) => {
|
|
2822
2524
|
if (isValidElement4(child)) {
|
|
2823
|
-
return
|
|
2525
|
+
return cloneElement7(child, {
|
|
2824
2526
|
parentIcon: icon
|
|
2825
2527
|
});
|
|
2826
2528
|
}
|
|
@@ -2830,12 +2532,12 @@ var List = ({ ref, ...props }) => {
|
|
|
2830
2532
|
List.displayName = "List";
|
|
2831
2533
|
|
|
2832
2534
|
// src/components/List/ListItem.tsx
|
|
2833
|
-
import
|
|
2834
|
-
import { jsx as
|
|
2535
|
+
import classNames28 from "classnames/dedupe";
|
|
2536
|
+
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2835
2537
|
var ListItem = ({ ref, ...props }) => {
|
|
2836
2538
|
const { parentIcon, icon, children, ...otherProps } = props;
|
|
2837
2539
|
const iconContent = icon || parentIcon;
|
|
2838
|
-
const classes =
|
|
2540
|
+
const classes = classNames28(
|
|
2839
2541
|
"mobius",
|
|
2840
2542
|
"mobius-list__item",
|
|
2841
2543
|
{
|
|
@@ -2843,40 +2545,40 @@ var ListItem = ({ ref, ...props }) => {
|
|
|
2843
2545
|
},
|
|
2844
2546
|
props.className
|
|
2845
2547
|
);
|
|
2846
|
-
const contentClasses =
|
|
2847
|
-
const iconClasses =
|
|
2548
|
+
const contentClasses = classNames28("mobius", "mobius-list__item-content");
|
|
2549
|
+
const iconClasses = classNames28("mobius", "mobius-list__icon");
|
|
2848
2550
|
if (iconContent) {
|
|
2849
|
-
return /* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2551
|
+
return /* @__PURE__ */ jsx34("li", { ref, ...otherProps, className: classes, children: /* @__PURE__ */ jsxs17("span", { className: contentClasses, children: [
|
|
2552
|
+
/* @__PURE__ */ jsx34("span", { className: iconClasses, children: iconContent }),
|
|
2851
2553
|
children
|
|
2852
2554
|
] }) });
|
|
2853
2555
|
}
|
|
2854
|
-
return /* @__PURE__ */
|
|
2556
|
+
return /* @__PURE__ */ jsx34("li", { ref, ...otherProps, className: classes, children });
|
|
2855
2557
|
};
|
|
2856
2558
|
ListItem.displayName = "ListItem";
|
|
2857
2559
|
|
|
2858
2560
|
// src/components/LoadingIndicator/LoadingIndicator.tsx
|
|
2859
|
-
import
|
|
2561
|
+
import classNames29 from "classnames/dedupe";
|
|
2860
2562
|
import { loading as loading2 } from "@simplybusiness/icons";
|
|
2861
|
-
import { jsx as
|
|
2563
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2862
2564
|
var LoadingIndicator = ({ ref, ...props }) => {
|
|
2863
2565
|
const { icon = loading2, ...otherProps } = props;
|
|
2864
|
-
const classes =
|
|
2566
|
+
const classes = classNames29(
|
|
2865
2567
|
"mobius",
|
|
2866
2568
|
"mobius-loading-indicator",
|
|
2867
2569
|
otherProps.className
|
|
2868
2570
|
);
|
|
2869
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ jsx35(Icon, { icon, spin: true, ref, ...otherProps, className: classes });
|
|
2870
2572
|
};
|
|
2871
2573
|
LoadingIndicator.displayName = "LoadingIndicator";
|
|
2872
2574
|
|
|
2873
2575
|
// src/components/Logo/Logo.tsx
|
|
2874
|
-
import
|
|
2875
|
-
import { jsx as
|
|
2576
|
+
import classNames30 from "classnames/dedupe";
|
|
2577
|
+
import { jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2876
2578
|
var Logo = ({ ref, ...props }) => {
|
|
2877
2579
|
const { className, width, height, ...otherProps } = props;
|
|
2878
|
-
const classes =
|
|
2879
|
-
return /* @__PURE__ */
|
|
2580
|
+
const classes = classNames30("mobius", "mobius-logo", className);
|
|
2581
|
+
return /* @__PURE__ */ jsxs18(
|
|
2880
2582
|
"svg",
|
|
2881
2583
|
{
|
|
2882
2584
|
width,
|
|
@@ -2886,7 +2588,7 @@ var Logo = ({ ref, ...props }) => {
|
|
|
2886
2588
|
viewBox: "0 0 144 37",
|
|
2887
2589
|
...otherProps,
|
|
2888
2590
|
children: [
|
|
2889
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ jsx36("defs", { children: /* @__PURE__ */ jsxs18(
|
|
2890
2592
|
"linearGradient",
|
|
2891
2593
|
{
|
|
2892
2594
|
id: "logo-gradient",
|
|
@@ -2895,27 +2597,27 @@ var Logo = ({ ref, ...props }) => {
|
|
|
2895
2597
|
y1: "76.042%",
|
|
2896
2598
|
y2: "26.973%",
|
|
2897
2599
|
children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2899
|
-
/* @__PURE__ */
|
|
2600
|
+
/* @__PURE__ */ jsx36("stop", { stopColor: "#4632D8", offset: "0%" }),
|
|
2601
|
+
/* @__PURE__ */ jsx36("stop", { stopColor: "#9084E8", offset: "100%" })
|
|
2900
2602
|
]
|
|
2901
2603
|
}
|
|
2902
2604
|
) }),
|
|
2903
|
-
/* @__PURE__ */
|
|
2904
|
-
/* @__PURE__ */
|
|
2605
|
+
/* @__PURE__ */ jsxs18("g", { children: [
|
|
2606
|
+
/* @__PURE__ */ jsx36(
|
|
2905
2607
|
"path",
|
|
2906
2608
|
{
|
|
2907
2609
|
fill: "#0E0A2B",
|
|
2908
2610
|
d: "M68.788 11.307c0-2.486-2.027-3.345-3.833-4.1-1.332-.562-2.471-1.036-2.471-2.072 0-.873.77-1.42 1.968-1.42 1.051 0 1.806.444 2.294.725.193.103.474.222.755.133.192-.06.34-.207.459-.444l.34-.621c.266-.474.163-.888-.281-1.2-.533-.384-1.88-1.05-3.537-1.05-2.738 0-4.647 1.643-4.647 4.01 0 2.413 2.012 3.301 3.788 4.07 1.347.593 2.516 1.096 2.516 2.161 0 .873-.754 1.45-1.924 1.45-1.287 0-2.22-.65-2.678-.961l-.03-.015c-.533-.296-.903-.237-1.228.192l-.415.607c-.444.607-.148.992.134 1.228.828.637 2.427 1.392 4.203 1.392 2.708 0 4.587-1.673 4.587-4.085zm4.44 2.975V6.186c0-.577-.31-.888-.873-.888h-.843c-.563 0-.874.311-.874.888v8.096c0 .577.296.888.874.888h.843c.563 0 .873-.311.873-.888zM71.482 4.203h.755c.518 0 .814-.281.814-.8v-.517c0-.518-.296-.814-.814-.814h-.755c-.518 0-.8.281-.8.814v.518c.016.518.297.8.8.8zM92.645 24.48h.755c.518 0 .814-.282.814-.8v-.518c0-.518-.296-.814-.814-.814h-.755c-.518 0-.799.282-.799.814v.518c0 .518.281.8.8.8zm-6.26-19.42c-1.539 0-2.397.962-2.945 1.895-.444-1.243-1.435-1.895-2.871-1.895-1.362 0-2.146.888-2.723 1.806v-.68c0-.578-.311-.889-.873-.889h-.74c-.563 0-.873.311-.873.888v8.096c0 .577.295.888.873.888h.843c.577 0 .873-.311.873-.888V10.73c0-2.25.888-3.271 2.058-3.271 1.006 0 1.198.71 1.198 1.85v4.987c0 .578.311.888.888.888h.844c.577 0 .873-.31.873-.888v-3.551c0-2.25.873-3.271 2.013-3.271 1.036 0 1.243.74 1.243 1.85v4.987c0 .577.31.888.888.888h.814c.577 0 .888-.31.888-.888V8.835c0-2.5-1.095-3.774-3.27-3.774zm10.804 10.33c2.679 0 4.558-2.13 4.558-5.164 0-3.094-1.776-5.166-4.425-5.166-1.761 0-2.708 1.036-3.049 1.51v-.533c0-.459-.34-.755-.873-.755h-.607c-.562 0-.888.326-.888.888v11.9c0 .576.311.887.888.887h.814c.578 0 .888-.31.888-.888v-3.404c0-.207-.014-.4-.014-.532.325.429 1.184 1.258 2.708 1.258zm-2.768-5.105c0-1.362.622-2.975 2.368-2.975 1.377 0 2.309 1.184 2.309 2.945 0 1.746-.947 2.916-2.338 2.916-1.54 0-2.339-1.45-2.339-2.886zm12.965 4.07v-.652c0-.444-.252-.725-.681-.784-.34-.03-.68-.192-.68-1.066v-9.47c0-.563-.326-.888-.874-.888h-.843c-.563 0-.874.31-.874.888v9.679c0 1.258.34 2.16 1.021 2.678.637.489 1.466.533 2.013.533.607 0 .918-.325.918-.917zm9.457-9.073h-.962c-.518 0-.844.237-.977.726l-1.717 4.972c-.089.311-.192.71-.251.977-.074-.281-.193-.71-.296-1.021l-1.835-4.943c-.163-.489-.489-.71-.977-.71h-1.036c-.415 0-.622.162-.71.295-.09.134-.163.385.014.755l3.685 8.57-.34.813c-.252.592-.77 1.229-1.45 1.229-.267 0-.474-.09-.652-.163h-.014c-.43-.104-.755.074-.962.488l-.163.415c-.119.251-.148.517-.06.725.075.192.237.34.474.429.326.118.814.296 1.391.296 1.628 0 2.975-.977 3.597-2.605l3.996-10.226c.103-.296.088-.563-.045-.755-.163-.163-.4-.267-.71-.267zM67.634 28.297c.977-.592 1.54-1.658 1.54-2.886 0-2.176-1.688-3.567-4.293-3.567h-4.04c-.562 0-.873.311-.873.888v11.899c0 .577.296.888.873.888h4.1c1.346 0 2.5-.34 3.33-.962.932-.71 1.42-1.761 1.42-3.049.03-1.524-.784-2.767-2.057-3.211zm-5.017-.962v-3.212h2.25c1.02 0 1.628.592 1.628 1.584 0 .991-.607 1.643-1.57 1.643h-2.308v-.015zm4.396 4.01c0 1.155-.71 1.865-1.865 1.865h-2.53v-3.714h2.53c1.14.014 1.865.74 1.865 1.85zm12.638-5.712h-.814c-.577 0-.888.31-.888.888v3.655c0 2.176-1.361 3.182-2.634 3.182-1.006 0-1.406-.547-1.406-1.88v-4.942c0-.578-.31-.888-.888-.888h-.814c-.562 0-.888.325-.888.888v5.431c0 2.516 1.17 3.774 3.463 3.774a3.937 3.937 0 003.286-1.761v.651c0 .577.296.888.873.888h.74c.577 0 .888-.31.888-.888v-8.095c-.03-.578-.355-.903-.918-.903zm6.956 3.937c-.917-.311-1.702-.592-1.702-1.184 0-.74.77-.859 1.229-.859.784 0 1.406.281 1.805.474.548.237.947.118 1.184-.34l.193-.341c.251-.518.133-.947-.326-1.184-.326-.178-1.288-.71-2.753-.71-2.279 0-3.803 1.213-3.803 3.004 0 2.042 1.731 2.65 3.137 3.138.903.325 1.687.592 1.687 1.169 0 .547-.488.902-1.258.902-.917 0-1.613-.37-2.057-.621l-.059-.03c-.533-.28-.903-.207-1.213.222l-.222.34c-.178.252-.237.504-.178.726.044.207.192.37.4.488a5.774 5.774 0 003.285 1.007c2.235 0 3.789-1.273 3.789-3.079-.03-2.042-1.761-2.649-3.138-3.122zm6.897-3.937h-.844c-.562 0-.873.31-.873.888v8.095c0 .577.296.888.873.888h.844c.577 0 .873-.31.873-.888v-8.095c0-.563-.31-.888-.873-.888zm9.324-.237c-1.924 0-2.93 1.154-3.36 1.806v-.681c0-.577-.31-.888-.873-.888h-.74c-.563 0-.873.31-.873.888v8.095c0 .577.296.888.873.888h.843c.578 0 .874-.31.874-.888v-3.744c0-1.79 1.14-3.078 2.708-3.078 1.021 0 1.436.547 1.436 1.88v4.942c0 .577.31.888.887.888h.814c.578 0 .888-.31.888-.888v-5.431c0-2.516-1.169-3.789-3.477-3.789zm10.448 0c-2.96 0-5.032 2.131-5.032 5.165 0 2.99 2.235 5.165 5.313 5.165 1.48 0 2.635-.533 3.345-.977.444-.266.562-.695.296-1.198l-.222-.385c-.266-.459-.651-.563-1.184-.31h-.015a3.885 3.885 0 01-2.042.606c-1.54 0-2.634-.962-2.812-2.472h5.816a.935.935 0 00.933-.917c.014-2.827-1.717-4.677-4.396-4.677zm-.044 2.013c1.065 0 1.79.77 1.864 1.968h-4.1c.253-1.213 1.096-1.968 2.236-1.968zm10.152 2.16c-.917-.31-1.702-.591-1.702-1.183 0-.74.77-.859 1.229-.859.784 0 1.406.281 1.805.474.548.237.947.118 1.184-.34l.192-.341c.252-.518.134-.947-.325-1.184-.326-.178-1.288-.71-2.753-.71-2.279 0-3.803 1.213-3.803 3.004 0 2.042 1.731 2.65 3.137 3.138.903.325 1.687.592 1.687 1.169 0 .547-.488.902-1.258.902-.917 0-1.613-.37-2.057-.621l-.059-.03c-.533-.28-.903-.207-1.214.222l-.222.34c-.177.252-.236.504-.177.726.044.207.192.37.4.488a5.774 5.774 0 003.285 1.007c2.235 0 3.789-1.273 3.789-3.079-.015-2.042-1.747-2.649-3.138-3.122zm8.791 0c-.917-.31-1.702-.591-1.702-1.183 0-.74.77-.859 1.229-.859.784 0 1.406.281 1.805.474.548.237.947.118 1.184-.34l.192-.341c.252-.518.134-.947-.325-1.184-.326-.178-1.288-.71-2.753-.71-2.279 0-3.803 1.213-3.803 3.004 0 2.042 1.731 2.65 3.137 3.138.903.325 1.687.592 1.687 1.169 0 .547-.488.902-1.258.902-.917 0-1.613-.37-2.057-.621l-.059-.03c-.533-.28-.903-.207-1.214.222l-.222.34c-.177.252-.236.504-.177.726.044.207.192.37.4.488a5.774 5.774 0 003.285 1.007c2.235 0 3.789-1.273 3.789-3.079-.015-2.042-1.747-2.649-3.138-3.122z"
|
|
2909
2611
|
}
|
|
2910
2612
|
),
|
|
2911
|
-
/* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ jsx36(
|
|
2912
2614
|
"path",
|
|
2913
2615
|
{
|
|
2914
2616
|
fill: "url(#logo-gradient)",
|
|
2915
2617
|
d: "M22.747 22.288c.607 1.214.918 2.59.918 4.144 0 1.45-.267 2.827-.8 4.1a10.018 10.018 0 01-2.279 3.36c-.991.961-2.235 1.73-3.744 2.278-1.51.563-3.167.829-4.988.829-2.264 0-4.35-.385-6.29-1.14-1.938-.77-3.492-1.598-4.676-2.5-.31-.252-.548-.504-.696-.77a1.332 1.332 0 01-.177-.71.718.718 0 010-.252c.03-.37.207-.785.547-1.199l1.14-1.598c.4-.548.829-.844 1.288-.918a.896.896 0 01.222-.03c.4 0 .873.163 1.39.474 2.487 1.776 4.914 2.679 7.252 2.679 1.643 0 2.96-.385 3.922-1.14.962-.755 1.45-1.746 1.45-2.96 0-.725-.192-1.39-.562-1.983a5.347 5.347 0 00-1.539-1.569 18.207 18.207 0 00-2.235-1.287 56.102 56.102 0 00-2.649-1.214c-.917-.4-1.835-.814-2.752-1.258a19.282 19.282 0 01-2.62-1.539 14.014 14.014 0 01-2.22-1.924c-.666-.695-1.169-1.539-1.554-2.545-.37-.992-.562-2.087-.562-3.271 0-2.042.533-3.863 1.598-5.446 1.066-1.584 2.516-2.797 4.336-3.641C8.303.414 10.345 0 12.624 0c1.91 0 3.685.281 5.358.844 1.657.562 2.96 1.198 3.892 1.88.68.473 1.006 1.035 1.006 1.671 0 .385-.118.785-.37 1.2l-.917 1.657c-.385.74-.903 1.11-1.554 1.11-.4 0-.83-.133-1.318-.4a42.421 42.421 0 00-1.687-.947c-.473-.237-1.14-.488-1.998-.71a9.458 9.458 0 00-2.56-.356c-1.672 0-3.004.37-3.981 1.11-.992.74-1.48 1.717-1.48 2.946 0 .902.31 1.701.932 2.412.622.695 1.421 1.302 2.398 1.79.977.489 2.057.977 3.256 1.466a54.048 54.048 0 013.552 1.628 20.795 20.795 0 013.24 2.042c.948.755 1.732 1.732 2.354 2.945zm31.257 2.945c0 3.197-1.155 6.083-3.256 8.14-2.265 2.205-5.506 3.36-9.368 3.36H30.71c-2.443 0-4.278-1.836-4.278-4.278V4.53c0-1.2.43-2.28 1.214-3.064C28.43.681 29.51.252 30.709.252h9.013c3.419 0 6.32 1.095 8.377 3.182 1.909 1.923 2.945 4.558 2.945 7.429 0 2.294-.622 4.203-1.91 5.816 1.377.77 2.487 1.776 3.286 2.99 1.066 1.583 1.584 3.448 1.584 5.564zm-12.106-7.68c.044-.03 4.913-3.02 4.913-6.675 0-1.761-.607-3.345-1.717-4.455-1.568-1.584-3.788-1.924-5.372-1.924H30.68v28h10.7c2.738 0 4.958-.754 6.408-2.16 1.273-1.243 1.983-3.049 1.983-5.106 0-1.272-.296-2.353-.858-3.196v-.03c-1.362-2.353-6.838-3.774-6.897-3.789l-.844-.222.726-.444z"
|
|
2916
2618
|
}
|
|
2917
2619
|
),
|
|
2918
|
-
/* @__PURE__ */
|
|
2620
|
+
/* @__PURE__ */ jsx36(
|
|
2919
2621
|
"path",
|
|
2920
2622
|
{
|
|
2921
2623
|
fill: "#0E0A2B",
|
|
@@ -2930,8 +2632,8 @@ var Logo = ({ ref, ...props }) => {
|
|
|
2930
2632
|
Logo.displayName = "Logo";
|
|
2931
2633
|
|
|
2932
2634
|
// src/components/Modal/Content.tsx
|
|
2933
|
-
import { jsx as
|
|
2934
|
-
var Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */
|
|
2635
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2636
|
+
var Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ jsx37("div", { ref, ...otherProps, className: "mobius-modal__content", children });
|
|
2935
2637
|
Content2.displayName = "Content";
|
|
2936
2638
|
|
|
2937
2639
|
// src/components/Modal/Header.tsx
|
|
@@ -2955,12 +2657,12 @@ var useModal = () => {
|
|
|
2955
2657
|
};
|
|
2956
2658
|
|
|
2957
2659
|
// src/components/Modal/Header.tsx
|
|
2958
|
-
import { jsx as
|
|
2660
|
+
import { jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2959
2661
|
var Header2 = ({ ref, children, ...otherProps }) => {
|
|
2960
2662
|
const { onClose, closeLabel } = useModal();
|
|
2961
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ jsxs19("header", { ref, ...otherProps, className: "mobius-modal__header", children: [
|
|
2962
2664
|
children,
|
|
2963
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ jsxs19(
|
|
2964
2666
|
Button,
|
|
2965
2667
|
{
|
|
2966
2668
|
"aria-label": "Close",
|
|
@@ -2968,7 +2670,7 @@ var Header2 = ({ ref, children, ...otherProps }) => {
|
|
|
2968
2670
|
onPress: onClose,
|
|
2969
2671
|
className: "mobius-modal__close",
|
|
2970
2672
|
children: [
|
|
2971
|
-
/* @__PURE__ */
|
|
2673
|
+
/* @__PURE__ */ jsx38(Icon, { icon: cross2 }),
|
|
2972
2674
|
" ",
|
|
2973
2675
|
closeLabel
|
|
2974
2676
|
]
|
|
@@ -2979,9 +2681,9 @@ var Header2 = ({ ref, children, ...otherProps }) => {
|
|
|
2979
2681
|
Header2.displayName = "Header";
|
|
2980
2682
|
|
|
2981
2683
|
// src/components/Modal/Modal.tsx
|
|
2982
|
-
import
|
|
2983
|
-
import { useEffect as useEffect12, useMemo as useMemo3, useRef as
|
|
2984
|
-
import { jsx as
|
|
2684
|
+
import classNames31 from "classnames/dedupe";
|
|
2685
|
+
import { useEffect as useEffect12, useMemo as useMemo3, useRef as useRef8, useState as useState16 } from "react";
|
|
2686
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2985
2687
|
var TRANSITION_CSS_VARIABLE2 = "--modal-transition-duration";
|
|
2986
2688
|
var Modal = ({ ref, ...props }) => {
|
|
2987
2689
|
const {
|
|
@@ -2999,7 +2701,7 @@ var Modal = ({ ref, ...props }) => {
|
|
|
2999
2701
|
useEffect12(() => {
|
|
3000
2702
|
setShouldTransition(supportsDialog());
|
|
3001
2703
|
}, []);
|
|
3002
|
-
const dialogRef =
|
|
2704
|
+
const dialogRef = useRef8(null);
|
|
3003
2705
|
const { close } = useDialog({
|
|
3004
2706
|
ref: dialogRef,
|
|
3005
2707
|
isOpen,
|
|
@@ -3010,7 +2712,7 @@ var Modal = ({ ref, ...props }) => {
|
|
|
3010
2712
|
CSSVariable: TRANSITION_CSS_VARIABLE2
|
|
3011
2713
|
}
|
|
3012
2714
|
});
|
|
3013
|
-
const modalClasses =
|
|
2715
|
+
const modalClasses = classNames31(
|
|
3014
2716
|
"mobius",
|
|
3015
2717
|
"mobius-modal",
|
|
3016
2718
|
{
|
|
@@ -3030,14 +2732,14 @@ var Modal = ({ ref, ...props }) => {
|
|
|
3030
2732
|
}),
|
|
3031
2733
|
[close, closeLabel]
|
|
3032
2734
|
);
|
|
3033
|
-
return /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ jsx39(
|
|
3034
2736
|
"dialog",
|
|
3035
2737
|
{
|
|
3036
2738
|
ref: mergeRefs([dialogRef, ref]),
|
|
3037
2739
|
onCancel: close,
|
|
3038
2740
|
className: modalClasses,
|
|
3039
2741
|
...rest,
|
|
3040
|
-
children: /* @__PURE__ */
|
|
2742
|
+
children: /* @__PURE__ */ jsx39(ModalContext.Provider, { value: contextValue, children })
|
|
3041
2743
|
}
|
|
3042
2744
|
);
|
|
3043
2745
|
};
|
|
@@ -3051,9 +2753,9 @@ var Modal2 = Object.assign(Modal, {
|
|
|
3051
2753
|
Modal2.displayName = "Modal";
|
|
3052
2754
|
|
|
3053
2755
|
// src/components/NumberField/NumberField.tsx
|
|
3054
|
-
import
|
|
3055
|
-
import { useCallback as useCallback5, useEffect as useEffect13, useRef as
|
|
3056
|
-
import { jsx as
|
|
2756
|
+
import classNames32 from "classnames/dedupe";
|
|
2757
|
+
import { useCallback as useCallback5, useEffect as useEffect13, useRef as useRef9 } from "react";
|
|
2758
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
3057
2759
|
var NumberField = ({ ref, ...props }) => {
|
|
3058
2760
|
const {
|
|
3059
2761
|
minValue,
|
|
@@ -3069,7 +2771,7 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3069
2771
|
onBlur: customOnBlur,
|
|
3070
2772
|
...rest
|
|
3071
2773
|
} = otherProps;
|
|
3072
|
-
const focusedInputRef =
|
|
2774
|
+
const focusedInputRef = useRef9(null);
|
|
3073
2775
|
const wheelHandler = useCallback5((ev) => ev.preventDefault(), []);
|
|
3074
2776
|
useEffect13(() => {
|
|
3075
2777
|
return () => {
|
|
@@ -3077,7 +2779,7 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3077
2779
|
focusedInputRef.current = null;
|
|
3078
2780
|
};
|
|
3079
2781
|
}, [wheelHandler]);
|
|
3080
|
-
const containerClasses =
|
|
2782
|
+
const containerClasses = classNames32("mobius-number-field", className, {
|
|
3081
2783
|
"--hide-spin-buttons": hideSpinButtons
|
|
3082
2784
|
});
|
|
3083
2785
|
const handleBeforeInput = (event) => {
|
|
@@ -3121,7 +2823,7 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3121
2823
|
},
|
|
3122
2824
|
onBlur: (e) => handleBlur(e)
|
|
3123
2825
|
};
|
|
3124
|
-
return /* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ jsx40(
|
|
3125
2827
|
TextField,
|
|
3126
2828
|
{
|
|
3127
2829
|
...forwardedProps,
|
|
@@ -3139,28 +2841,28 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3139
2841
|
NumberField.displayName = "NumberField";
|
|
3140
2842
|
|
|
3141
2843
|
// src/components/Option/Option.tsx
|
|
3142
|
-
import { jsx as
|
|
2844
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
3143
2845
|
var Option2 = ({ ref, ...props }) => {
|
|
3144
2846
|
const { isDisabled, ...rest } = props;
|
|
3145
2847
|
const mappedProps = {
|
|
3146
2848
|
...rest,
|
|
3147
2849
|
disabled: isDisabled
|
|
3148
2850
|
};
|
|
3149
|
-
return /* @__PURE__ */
|
|
2851
|
+
return /* @__PURE__ */ jsx41("option", { ...mappedProps, ref });
|
|
3150
2852
|
};
|
|
3151
2853
|
Option2.displayName = "Option";
|
|
3152
2854
|
|
|
3153
2855
|
// src/components/PasswordField/PasswordField.tsx
|
|
3154
|
-
import
|
|
3155
|
-
import { useRef as
|
|
2856
|
+
import classNames33 from "classnames/dedupe";
|
|
2857
|
+
import { useRef as useRef10, useState as useState17 } from "react";
|
|
3156
2858
|
|
|
3157
2859
|
// src/components/PasswordField/ShowHideButton.tsx
|
|
3158
2860
|
import { eye, eyeSlash } from "@simplybusiness/icons";
|
|
3159
|
-
import { jsx as
|
|
2861
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
3160
2862
|
var ShowHideButton = ({
|
|
3161
2863
|
show = false,
|
|
3162
2864
|
onClick
|
|
3163
|
-
}) => /* @__PURE__ */
|
|
2865
|
+
}) => /* @__PURE__ */ jsx42(
|
|
3164
2866
|
"button",
|
|
3165
2867
|
{
|
|
3166
2868
|
className: "mobius-password-field__show-button",
|
|
@@ -3171,12 +2873,12 @@ var ShowHideButton = ({
|
|
|
3171
2873
|
},
|
|
3172
2874
|
"aria-label": `${show ? "Hide" : "Show"} password`,
|
|
3173
2875
|
"data-testid": "show-hide-button",
|
|
3174
|
-
children: /* @__PURE__ */
|
|
2876
|
+
children: /* @__PURE__ */ jsx42(Icon, { icon: show ? eyeSlash : eye, "aria-hidden": "true" })
|
|
3175
2877
|
}
|
|
3176
2878
|
);
|
|
3177
2879
|
|
|
3178
2880
|
// src/components/PasswordField/PasswordField.tsx
|
|
3179
|
-
import { jsx as
|
|
2881
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
3180
2882
|
var PasswordField = ({
|
|
3181
2883
|
ref,
|
|
3182
2884
|
className,
|
|
@@ -3184,8 +2886,8 @@ var PasswordField = ({
|
|
|
3184
2886
|
}) => {
|
|
3185
2887
|
const [show, setShow] = useState17(false);
|
|
3186
2888
|
const type = show ? "text" : "password";
|
|
3187
|
-
const classes =
|
|
3188
|
-
const localRef =
|
|
2889
|
+
const classes = classNames33("mobius-password-field", className);
|
|
2890
|
+
const localRef = useRef10(null);
|
|
3189
2891
|
const handleShowHideButtonClick = () => {
|
|
3190
2892
|
const selectionStart = localRef.current?.selectionStart;
|
|
3191
2893
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3197,14 +2899,14 @@ var PasswordField = ({
|
|
|
3197
2899
|
}
|
|
3198
2900
|
});
|
|
3199
2901
|
};
|
|
3200
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ jsx43(
|
|
3201
2903
|
TextField,
|
|
3202
2904
|
{
|
|
3203
2905
|
ref: mergeRefs([localRef, ref]),
|
|
3204
2906
|
className: classes,
|
|
3205
2907
|
...props,
|
|
3206
2908
|
type,
|
|
3207
|
-
suffixInside: /* @__PURE__ */
|
|
2909
|
+
suffixInside: /* @__PURE__ */ jsx43(ShowHideButton, { onClick: handleShowHideButtonClick, show })
|
|
3208
2910
|
}
|
|
3209
2911
|
);
|
|
3210
2912
|
};
|
|
@@ -3223,14 +2925,14 @@ import {
|
|
|
3223
2925
|
useInteractions
|
|
3224
2926
|
} from "@floating-ui/react";
|
|
3225
2927
|
import { cross as cross3 } from "@simplybusiness/icons";
|
|
3226
|
-
import
|
|
3227
|
-
import { cloneElement as
|
|
2928
|
+
import classNames34 from "classnames/dedupe";
|
|
2929
|
+
import { cloneElement as cloneElement8, useRef as useRef11, useState as useState18 } from "react";
|
|
3228
2930
|
import { useWindowEvent as useWindowEvent2 } from "@simplybusiness/mobius-hooks";
|
|
3229
|
-
import { Fragment as Fragment4, jsx as
|
|
2931
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3230
2932
|
var OFFSET_FROM_CONTENT_DEFAULT = 10;
|
|
3231
2933
|
var Popover = (props) => {
|
|
3232
2934
|
const { trigger, children, onOpen, onClose, className } = props;
|
|
3233
|
-
const arrowRef =
|
|
2935
|
+
const arrowRef = useRef11(null);
|
|
3234
2936
|
const [isOpen, setIsOpen] = useState18(false);
|
|
3235
2937
|
const { refs, floatingStyles, context } = useFloating({
|
|
3236
2938
|
open: isOpen,
|
|
@@ -3257,7 +2959,7 @@ var Popover = (props) => {
|
|
|
3257
2959
|
}
|
|
3258
2960
|
});
|
|
3259
2961
|
const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);
|
|
3260
|
-
const containerClasses =
|
|
2962
|
+
const containerClasses = classNames34(
|
|
3261
2963
|
"mobius",
|
|
3262
2964
|
"mobius-popover__container",
|
|
3263
2965
|
className
|
|
@@ -3271,9 +2973,9 @@ var Popover = (props) => {
|
|
|
3271
2973
|
setIsOpen(true);
|
|
3272
2974
|
onOpen?.();
|
|
3273
2975
|
};
|
|
3274
|
-
const triggerComponent =
|
|
2976
|
+
const triggerComponent = cloneElement8(trigger, {
|
|
3275
2977
|
ref: refs.setReference,
|
|
3276
|
-
className:
|
|
2978
|
+
className: classNames34(
|
|
3277
2979
|
trigger.props.className,
|
|
3278
2980
|
"mobius-popover__toggle"
|
|
3279
2981
|
),
|
|
@@ -3287,9 +2989,9 @@ var Popover = (props) => {
|
|
|
3287
2989
|
e.stopPropagation();
|
|
3288
2990
|
}
|
|
3289
2991
|
});
|
|
3290
|
-
return /* @__PURE__ */
|
|
2992
|
+
return /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
3291
2993
|
triggerComponent,
|
|
3292
|
-
isOpen && /* @__PURE__ */
|
|
2994
|
+
isOpen && /* @__PURE__ */ jsxs20(
|
|
3293
2995
|
"div",
|
|
3294
2996
|
{
|
|
3295
2997
|
className: containerClasses,
|
|
@@ -3297,8 +2999,8 @@ var Popover = (props) => {
|
|
|
3297
2999
|
style: floatingStyles,
|
|
3298
3000
|
...getFloatingProps(),
|
|
3299
3001
|
children: [
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3002
|
+
/* @__PURE__ */ jsxs20("div", { className: "mobius-popover", children: [
|
|
3003
|
+
/* @__PURE__ */ jsx44("header", { className: "mobius-popover__header", children: /* @__PURE__ */ jsx44(
|
|
3302
3004
|
Button,
|
|
3303
3005
|
{
|
|
3304
3006
|
type: "button",
|
|
@@ -3306,7 +3008,7 @@ var Popover = (props) => {
|
|
|
3306
3008
|
onClick: toggleVisibility,
|
|
3307
3009
|
"aria-label": "Close",
|
|
3308
3010
|
variant: "ghost",
|
|
3309
|
-
children: /* @__PURE__ */
|
|
3011
|
+
children: /* @__PURE__ */ jsx44(
|
|
3310
3012
|
Icon,
|
|
3311
3013
|
{
|
|
3312
3014
|
icon: cross3,
|
|
@@ -3316,9 +3018,9 @@ var Popover = (props) => {
|
|
|
3316
3018
|
)
|
|
3317
3019
|
}
|
|
3318
3020
|
) }),
|
|
3319
|
-
/* @__PURE__ */
|
|
3021
|
+
/* @__PURE__ */ jsx44("div", { className: "mobius-popover__body", children })
|
|
3320
3022
|
] }),
|
|
3321
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ jsx44(
|
|
3322
3024
|
FloatingArrow,
|
|
3323
3025
|
{
|
|
3324
3026
|
ref: arrowRef,
|
|
@@ -3334,9 +3036,9 @@ var Popover = (props) => {
|
|
|
3334
3036
|
};
|
|
3335
3037
|
|
|
3336
3038
|
// src/components/Progress/Progress.tsx
|
|
3337
|
-
import
|
|
3338
|
-
import { useId as
|
|
3339
|
-
import { jsx as
|
|
3039
|
+
import classNames35 from "classnames/dedupe";
|
|
3040
|
+
import { useId as useId7 } from "react";
|
|
3041
|
+
import { jsx as jsx45, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3340
3042
|
function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
3341
3043
|
if (minValue > maxValue) {
|
|
3342
3044
|
console.warn("minValue is greater than maxValue");
|
|
@@ -3356,7 +3058,7 @@ var sanitizedValue = (value, defaultValue) => {
|
|
|
3356
3058
|
};
|
|
3357
3059
|
var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
3358
3060
|
if (showLabel) {
|
|
3359
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ jsx45(
|
|
3360
3062
|
Label,
|
|
3361
3063
|
{
|
|
3362
3064
|
id: progressLabelId,
|
|
@@ -3366,7 +3068,7 @@ var getLabelComponent = (label, progressLabelId, showLabel) => {
|
|
|
3366
3068
|
}
|
|
3367
3069
|
);
|
|
3368
3070
|
}
|
|
3369
|
-
return /* @__PURE__ */
|
|
3071
|
+
return /* @__PURE__ */ jsx45(VisuallyHidden, { children: /* @__PURE__ */ jsx45(
|
|
3370
3072
|
Label,
|
|
3371
3073
|
{
|
|
3372
3074
|
id: progressLabelId,
|
|
@@ -3380,8 +3082,8 @@ var DEFAULT_VALUE = 0;
|
|
|
3380
3082
|
var DEFAULT_MIN_VALUE = 0;
|
|
3381
3083
|
var DEFAULT_MAX_VALUE = 100;
|
|
3382
3084
|
var Progress = ({ ref, ...props }) => {
|
|
3383
|
-
const progressId =
|
|
3384
|
-
const progressLabelId =
|
|
3085
|
+
const progressId = useId7();
|
|
3086
|
+
const progressLabelId = useId7();
|
|
3385
3087
|
const {
|
|
3386
3088
|
id,
|
|
3387
3089
|
label,
|
|
@@ -3406,7 +3108,7 @@ var Progress = ({ ref, ...props }) => {
|
|
|
3406
3108
|
100
|
|
3407
3109
|
);
|
|
3408
3110
|
const barWidth = `${percentage}%`;
|
|
3409
|
-
const classes =
|
|
3111
|
+
const classes = classNames35("mobius", "mobius-progress", className, {
|
|
3410
3112
|
"--is-primary": variant === "primary",
|
|
3411
3113
|
"--is-secondary": variant === "secondary"
|
|
3412
3114
|
});
|
|
@@ -3416,7 +3118,7 @@ var Progress = ({ ref, ...props }) => {
|
|
|
3416
3118
|
progressBarProps["aria-valuenow"] = value.toString();
|
|
3417
3119
|
progressBarProps["aria-valuetext"] = valueFormatter instanceof Function ? valueFormatter(value, minValue, maxValue) : barWidth;
|
|
3418
3120
|
const labelComponent = getLabelComponent(label, progressLabelId, showLabel);
|
|
3419
|
-
return /* @__PURE__ */
|
|
3121
|
+
return /* @__PURE__ */ jsxs21(
|
|
3420
3122
|
"div",
|
|
3421
3123
|
{
|
|
3422
3124
|
id: id || progressId,
|
|
@@ -3427,8 +3129,8 @@ var Progress = ({ ref, ...props }) => {
|
|
|
3427
3129
|
"aria-labelledby": progressLabelId,
|
|
3428
3130
|
children: [
|
|
3429
3131
|
labelComponent,
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
showValueLabel && /* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ jsx45("div", { className: "mobius-progress__track", children: /* @__PURE__ */ jsx45("div", { className: "mobius-progress__bar", style: { width: barWidth } }) }),
|
|
3133
|
+
showValueLabel && /* @__PURE__ */ jsx45(Label, { "data-testid": "value-label", elementType: "span", children: progressBarProps["aria-valuetext"] })
|
|
3432
3134
|
]
|
|
3433
3135
|
}
|
|
3434
3136
|
);
|
|
@@ -3436,15 +3138,15 @@ var Progress = ({ ref, ...props }) => {
|
|
|
3436
3138
|
Progress.displayName = "Progress";
|
|
3437
3139
|
|
|
3438
3140
|
// src/components/Radio/Radio.tsx
|
|
3439
|
-
import
|
|
3141
|
+
import classNames36 from "classnames/dedupe";
|
|
3440
3142
|
import {
|
|
3441
3143
|
Children as Children7,
|
|
3442
3144
|
isValidElement as isValidElement5,
|
|
3443
3145
|
useLayoutEffect,
|
|
3444
3146
|
useMemo as useMemo4,
|
|
3445
|
-
useRef as
|
|
3147
|
+
useRef as useRef12
|
|
3446
3148
|
} from "react";
|
|
3447
|
-
import { Fragment as Fragment5, jsx as
|
|
3149
|
+
import { Fragment as Fragment5, jsx as jsx46, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3448
3150
|
var Radio = ({ ref, ...props }) => {
|
|
3449
3151
|
const {
|
|
3450
3152
|
children,
|
|
@@ -3468,8 +3170,8 @@ var Radio = ({ ref, ...props }) => {
|
|
|
3468
3170
|
const isMultiline = label && children;
|
|
3469
3171
|
const isControlled = selected !== void 0;
|
|
3470
3172
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
3471
|
-
const contentRef =
|
|
3472
|
-
const prevOverflowRef =
|
|
3173
|
+
const contentRef = useRef12(null);
|
|
3174
|
+
const prevOverflowRef = useRef12({
|
|
3473
3175
|
vertical: false,
|
|
3474
3176
|
horizontal: false
|
|
3475
3177
|
});
|
|
@@ -3509,13 +3211,13 @@ var Radio = ({ ref, ...props }) => {
|
|
|
3509
3211
|
"--is-multiline": !!isMultiline,
|
|
3510
3212
|
"--is-required": isRequired
|
|
3511
3213
|
};
|
|
3512
|
-
const containerClasses =
|
|
3214
|
+
const containerClasses = classNames36(
|
|
3513
3215
|
"mobius-radio__label",
|
|
3514
3216
|
radioClasses,
|
|
3515
3217
|
className,
|
|
3516
3218
|
{ "--has-icon-first": hasIconFirst }
|
|
3517
3219
|
);
|
|
3518
|
-
const inputClasses =
|
|
3220
|
+
const inputClasses = classNames36("mobius-radio__input", radioClasses);
|
|
3519
3221
|
const { "aria-describedby": _ariaDescribedBy, ...rest } = otherProps;
|
|
3520
3222
|
const handleChange = (event) => {
|
|
3521
3223
|
if (setSelected) {
|
|
@@ -3529,9 +3231,9 @@ var Radio = ({ ref, ...props }) => {
|
|
|
3529
3231
|
onChange(adaptedEvent);
|
|
3530
3232
|
}
|
|
3531
3233
|
};
|
|
3532
|
-
return /* @__PURE__ */
|
|
3533
|
-
/* @__PURE__ */
|
|
3534
|
-
/* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
3235
|
+
/* @__PURE__ */ jsxs22(Label, { className: containerClasses, children: [
|
|
3236
|
+
/* @__PURE__ */ jsx46(
|
|
3535
3237
|
"input",
|
|
3536
3238
|
{
|
|
3537
3239
|
"aria-describedby": otherProps["aria-describedby"],
|
|
@@ -3548,29 +3250,29 @@ var Radio = ({ ref, ...props }) => {
|
|
|
3548
3250
|
...rest
|
|
3549
3251
|
}
|
|
3550
3252
|
),
|
|
3551
|
-
isMultiline ? /* @__PURE__ */
|
|
3552
|
-
/* @__PURE__ */
|
|
3553
|
-
/* @__PURE__ */
|
|
3554
|
-
] }) : /* @__PURE__ */
|
|
3253
|
+
isMultiline ? /* @__PURE__ */ jsxs22("div", { ref: contentRef, className: "mobius-radio__content--multiline", children: [
|
|
3254
|
+
/* @__PURE__ */ jsx46("div", { className: "mobius-radio__content-first-line", children: label }),
|
|
3255
|
+
/* @__PURE__ */ jsx46("div", { className: "mobius-radio__extra-content", children })
|
|
3256
|
+
] }) : /* @__PURE__ */ jsx46("div", { ref: contentRef, className: "mobius-radio__content", children: label || children })
|
|
3555
3257
|
] }),
|
|
3556
|
-
errorMessage && /* @__PURE__ */
|
|
3258
|
+
errorMessage && /* @__PURE__ */ jsx46(ErrorMessage, { errorMessage })
|
|
3557
3259
|
] });
|
|
3558
3260
|
};
|
|
3559
3261
|
Radio.displayName = "Radio";
|
|
3560
3262
|
|
|
3561
3263
|
// src/components/Radio/RadioGroup.tsx
|
|
3562
|
-
import
|
|
3264
|
+
import classNames37 from "classnames/dedupe";
|
|
3563
3265
|
import {
|
|
3564
3266
|
Children as Children8,
|
|
3565
|
-
cloneElement as
|
|
3267
|
+
cloneElement as cloneElement9,
|
|
3566
3268
|
isValidElement as isValidElement6,
|
|
3567
3269
|
useCallback as useCallback6,
|
|
3568
3270
|
useEffect as useEffect14,
|
|
3569
|
-
useId as
|
|
3570
|
-
useRef as
|
|
3271
|
+
useId as useId8,
|
|
3272
|
+
useRef as useRef13,
|
|
3571
3273
|
useState as useState19
|
|
3572
3274
|
} from "react";
|
|
3573
|
-
import { jsx as
|
|
3275
|
+
import { jsx as jsx47, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3574
3276
|
var getDefaultVal = (children, defaultValue) => {
|
|
3575
3277
|
if (Array.isArray(children) && defaultValue) {
|
|
3576
3278
|
const option = children?.find((item) => item.props.value === defaultValue);
|
|
@@ -3599,7 +3301,7 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
3599
3301
|
} = props;
|
|
3600
3302
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
3601
3303
|
const [selected, setSelected] = useState19(defaultSelected);
|
|
3602
|
-
const overflowsRef =
|
|
3304
|
+
const overflowsRef = useRef13({});
|
|
3603
3305
|
const [hasOverflow, setHasOverflow] = useState19(false);
|
|
3604
3306
|
useEffect14(() => {
|
|
3605
3307
|
if (value !== void 0) {
|
|
@@ -3630,26 +3332,26 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
3630
3332
|
[`--is-${effectiveOrientation}`]: true,
|
|
3631
3333
|
[className || ""]: true
|
|
3632
3334
|
};
|
|
3633
|
-
const radioGroupClasses =
|
|
3335
|
+
const radioGroupClasses = classNames37(
|
|
3634
3336
|
"mobius",
|
|
3635
3337
|
"mobius-radio-group",
|
|
3636
3338
|
radioClasses,
|
|
3637
3339
|
validationClasses
|
|
3638
3340
|
);
|
|
3639
|
-
const radioWrapperClasses =
|
|
3341
|
+
const radioWrapperClasses = classNames37("mobius-radio__wrapper", {
|
|
3640
3342
|
[`--is-${effectiveOrientation}`]: true
|
|
3641
3343
|
});
|
|
3642
|
-
const labelClasses =
|
|
3643
|
-
const errorMessageId =
|
|
3644
|
-
const defaultNameAttrId =
|
|
3344
|
+
const labelClasses = classNames37(radioClasses, validationClasses);
|
|
3345
|
+
const errorMessageId = useId8();
|
|
3346
|
+
const defaultNameAttrId = useId8();
|
|
3645
3347
|
const nameAttribute = name || defaultNameAttrId;
|
|
3646
3348
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3647
3349
|
const describedBy = spaceDelimitedList([
|
|
3648
3350
|
shouldErrorMessageShow,
|
|
3649
3351
|
props["aria-describedby"]
|
|
3650
3352
|
]);
|
|
3651
|
-
const labelId =
|
|
3652
|
-
return /* @__PURE__ */
|
|
3353
|
+
const labelId = useId8();
|
|
3354
|
+
return /* @__PURE__ */ jsx47(
|
|
3653
3355
|
"div",
|
|
3654
3356
|
{
|
|
3655
3357
|
...rest,
|
|
@@ -3665,12 +3367,12 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
3665
3367
|
ref,
|
|
3666
3368
|
className: radioGroupClasses,
|
|
3667
3369
|
role: "radiogroup",
|
|
3668
|
-
children: /* @__PURE__ */
|
|
3669
|
-
label && /* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3370
|
+
children: /* @__PURE__ */ jsxs23(Stack, { gap: "xs", children: [
|
|
3371
|
+
label && /* @__PURE__ */ jsx47(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
3372
|
+
/* @__PURE__ */ jsx47("div", { className: radioWrapperClasses, children: Children8.map(children, (child) => {
|
|
3671
3373
|
if (isValidElement6(child)) {
|
|
3672
3374
|
const childValue = child.props.value;
|
|
3673
|
-
return
|
|
3375
|
+
return cloneElement9(
|
|
3674
3376
|
child,
|
|
3675
3377
|
{
|
|
3676
3378
|
orientation: effectiveOrientation,
|
|
@@ -3688,7 +3390,7 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
3688
3390
|
}
|
|
3689
3391
|
return child;
|
|
3690
3392
|
}) }),
|
|
3691
|
-
/* @__PURE__ */
|
|
3393
|
+
/* @__PURE__ */ jsx47(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
3692
3394
|
] })
|
|
3693
3395
|
}
|
|
3694
3396
|
);
|
|
@@ -3696,36 +3398,36 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
3696
3398
|
RadioGroup.displayName = "RadioGroup";
|
|
3697
3399
|
|
|
3698
3400
|
// src/components/Segment/SegmentGroup.tsx
|
|
3699
|
-
import
|
|
3700
|
-
import { jsx as
|
|
3401
|
+
import classNames38 from "classnames/dedupe";
|
|
3402
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
3701
3403
|
var SegmentGroup = (props) => {
|
|
3702
3404
|
const { children, horizontal, gap, className, ...rest } = props;
|
|
3703
3405
|
const gapClass = gap ? `gap-${gap}` : "";
|
|
3704
|
-
const classes =
|
|
3406
|
+
const classes = classNames38(
|
|
3705
3407
|
"mobius",
|
|
3706
3408
|
"mobius-segment-group",
|
|
3707
3409
|
className,
|
|
3708
3410
|
{ "--is-horizontal": horizontal },
|
|
3709
3411
|
gapClass
|
|
3710
3412
|
);
|
|
3711
|
-
return /* @__PURE__ */
|
|
3413
|
+
return /* @__PURE__ */ jsx48("div", { className: classes, ...rest, children });
|
|
3712
3414
|
};
|
|
3713
3415
|
SegmentGroup.displayName = "SegmentGroup";
|
|
3714
3416
|
|
|
3715
3417
|
// src/components/Segment/Segment.tsx
|
|
3716
|
-
import
|
|
3717
|
-
import { jsx as
|
|
3418
|
+
import classNames39 from "classnames/dedupe";
|
|
3419
|
+
import { jsx as jsx49, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3718
3420
|
var Segment = (props) => {
|
|
3719
3421
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
3720
|
-
const classes =
|
|
3422
|
+
const classes = classNames39(
|
|
3721
3423
|
"mobius",
|
|
3722
3424
|
"mobius-segment",
|
|
3723
3425
|
colour,
|
|
3724
3426
|
{ inverted },
|
|
3725
3427
|
className
|
|
3726
3428
|
);
|
|
3727
|
-
return /* @__PURE__ */
|
|
3728
|
-
heading && /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ jsxs24("div", { className: classes, ...rest, children: [
|
|
3430
|
+
heading && /* @__PURE__ */ jsx49("div", { className: "mobius-segment__heading", children: heading }),
|
|
3729
3431
|
children
|
|
3730
3432
|
] });
|
|
3731
3433
|
};
|
|
@@ -3733,9 +3435,9 @@ Segment.displayName = "Segment";
|
|
|
3733
3435
|
|
|
3734
3436
|
// src/components/Select/Select.tsx
|
|
3735
3437
|
import { chevronDown as chevronDown2 } from "@simplybusiness/icons";
|
|
3736
|
-
import
|
|
3737
|
-
import { useId as
|
|
3738
|
-
import { jsx as
|
|
3438
|
+
import classNames40 from "classnames/dedupe";
|
|
3439
|
+
import { useId as useId9 } from "react";
|
|
3440
|
+
import { jsx as jsx50, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3739
3441
|
var Select = ({ ref, ...props }) => {
|
|
3740
3442
|
const {
|
|
3741
3443
|
label,
|
|
@@ -3756,24 +3458,24 @@ var Select = ({ ref, ...props }) => {
|
|
|
3756
3458
|
"--is-required": typeof isRequired === "boolean" && isRequired,
|
|
3757
3459
|
"--is-optional": typeof isRequired === "boolean" && !isRequired
|
|
3758
3460
|
};
|
|
3759
|
-
const sharedClasses =
|
|
3760
|
-
const wrapperClasses =
|
|
3461
|
+
const sharedClasses = classNames40(validationClasses, stateClasses);
|
|
3462
|
+
const wrapperClasses = classNames40(
|
|
3761
3463
|
"mobius-select__wrapper",
|
|
3762
3464
|
sharedClasses,
|
|
3763
3465
|
otherProps.className
|
|
3764
3466
|
);
|
|
3765
|
-
const selectClasses =
|
|
3467
|
+
const selectClasses = classNames40(
|
|
3766
3468
|
"mobius-select",
|
|
3767
3469
|
sharedClasses,
|
|
3768
3470
|
otherProps.className
|
|
3769
3471
|
);
|
|
3770
|
-
const labelClasses =
|
|
3472
|
+
const labelClasses = classNames40(
|
|
3771
3473
|
"mobius-label",
|
|
3772
3474
|
sharedClasses,
|
|
3773
3475
|
otherProps.className
|
|
3774
3476
|
);
|
|
3775
|
-
const iconClasses =
|
|
3776
|
-
const errorMessageId =
|
|
3477
|
+
const iconClasses = classNames40("mobius-select__icon", sharedClasses);
|
|
3478
|
+
const errorMessageId = useId9();
|
|
3777
3479
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3778
3480
|
const describedBy = spaceDelimitedList([
|
|
3779
3481
|
shouldErrorMessageShow,
|
|
@@ -3784,10 +3486,10 @@ var Select = ({ ref, ...props }) => {
|
|
|
3784
3486
|
onChange(e);
|
|
3785
3487
|
}
|
|
3786
3488
|
};
|
|
3787
|
-
return /* @__PURE__ */
|
|
3788
|
-
label && /* @__PURE__ */
|
|
3789
|
-
/* @__PURE__ */
|
|
3790
|
-
/* @__PURE__ */
|
|
3489
|
+
return /* @__PURE__ */ jsxs25(Stack, { className: "mobius mobius-select__outer", gap: "xs", children: [
|
|
3490
|
+
label && /* @__PURE__ */ jsx50(Label, { ...labelProps, className: labelClasses, children: label }),
|
|
3491
|
+
/* @__PURE__ */ jsxs25("div", { className: wrapperClasses, children: [
|
|
3492
|
+
/* @__PURE__ */ jsx50(
|
|
3791
3493
|
"select",
|
|
3792
3494
|
{
|
|
3793
3495
|
...otherProps,
|
|
@@ -3803,16 +3505,16 @@ var Select = ({ ref, ...props }) => {
|
|
|
3803
3505
|
onChange: handleChange
|
|
3804
3506
|
}
|
|
3805
3507
|
),
|
|
3806
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsx50("span", { className: iconClasses, children: /* @__PURE__ */ jsx50(Icon, { icon: chevronDown2 }) })
|
|
3807
3509
|
] }),
|
|
3808
|
-
errorMessage && /* @__PURE__ */
|
|
3510
|
+
errorMessage && /* @__PURE__ */ jsx50(ErrorMessage, { id: errorMessageId, errorMessage })
|
|
3809
3511
|
] });
|
|
3810
3512
|
};
|
|
3811
3513
|
Select.displayName = "Select";
|
|
3812
3514
|
|
|
3813
3515
|
// src/components/Slider/Slider.tsx
|
|
3814
|
-
import
|
|
3815
|
-
import { useRef as
|
|
3516
|
+
import classNames41 from "classnames/dedupe";
|
|
3517
|
+
import { useRef as useRef14, useState as useState20 } from "react";
|
|
3816
3518
|
|
|
3817
3519
|
// src/components/Slider/helpers.ts
|
|
3818
3520
|
import { useCallback as useCallback7, useMemo as useMemo5 } from "react";
|
|
@@ -3824,7 +3526,7 @@ function numberFormatter(value, formatOptions, locale = navigator.languages?.[0]
|
|
|
3824
3526
|
}
|
|
3825
3527
|
|
|
3826
3528
|
// src/components/Slider/Slider.tsx
|
|
3827
|
-
import { jsx as
|
|
3529
|
+
import { jsx as jsx51, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3828
3530
|
var Slider = (props) => {
|
|
3829
3531
|
const {
|
|
3830
3532
|
id,
|
|
@@ -3845,7 +3547,7 @@ var Slider = (props) => {
|
|
|
3845
3547
|
formatOptions,
|
|
3846
3548
|
isDisabled = false
|
|
3847
3549
|
} = props;
|
|
3848
|
-
const trackRef =
|
|
3550
|
+
const trackRef = useRef14(null);
|
|
3849
3551
|
const [currentValue, setCurrentValue] = useState20(
|
|
3850
3552
|
value || defaultValue || 0
|
|
3851
3553
|
);
|
|
@@ -3857,7 +3559,7 @@ var Slider = (props) => {
|
|
|
3857
3559
|
"aria-labelledby": ariaLabelledBy
|
|
3858
3560
|
});
|
|
3859
3561
|
const formattedValue = numberFormatter(currentValue, formatOptions);
|
|
3860
|
-
const classes =
|
|
3562
|
+
const classes = classNames41("mobius", "mobius-slider", className, {
|
|
3861
3563
|
"--is-disabled": isDisabled,
|
|
3862
3564
|
"--is-primary": variant === "primary",
|
|
3863
3565
|
"--is-secondary": variant === "secondary",
|
|
@@ -3879,12 +3581,12 @@ var Slider = (props) => {
|
|
|
3879
3581
|
onChangeEnd(currentValue);
|
|
3880
3582
|
}
|
|
3881
3583
|
};
|
|
3882
|
-
return /* @__PURE__ */
|
|
3883
|
-
/* @__PURE__ */
|
|
3884
|
-
label && /* @__PURE__ */
|
|
3885
|
-
label && /* @__PURE__ */
|
|
3584
|
+
return /* @__PURE__ */ jsxs26("div", { className: classes, children: [
|
|
3585
|
+
/* @__PURE__ */ jsxs26("div", { className: "mobius-slider__label-wrapper", children: [
|
|
3586
|
+
label && /* @__PURE__ */ jsx51(Label, { ...labelProps, children: label }),
|
|
3587
|
+
label && /* @__PURE__ */ jsx51("output", { style: { flex: "1 0 auto", textAlign: "end" }, children: formattedValue })
|
|
3886
3588
|
] }),
|
|
3887
|
-
/* @__PURE__ */
|
|
3589
|
+
/* @__PURE__ */ jsx51("div", { ref: trackRef, className: "mobius-slider__track-wrapper", children: /* @__PURE__ */ jsx51(
|
|
3888
3590
|
"input",
|
|
3889
3591
|
{
|
|
3890
3592
|
className: "mobius-slider__track",
|
|
@@ -3903,23 +3605,23 @@ var Slider = (props) => {
|
|
|
3903
3605
|
...fieldProps
|
|
3904
3606
|
}
|
|
3905
3607
|
) }),
|
|
3906
|
-
/* @__PURE__ */
|
|
3907
|
-
/* @__PURE__ */
|
|
3908
|
-
/* @__PURE__ */
|
|
3608
|
+
/* @__PURE__ */ jsxs26("div", { className: "mobius-slider__labels", children: [
|
|
3609
|
+
/* @__PURE__ */ jsx51("div", { className: "mobius-slider__min-label", "data-testid": "min-label", children: minLabel }),
|
|
3610
|
+
/* @__PURE__ */ jsx51("div", { className: "mobius-slider__max-label", "data-testid": "max-label", children: maxLabel })
|
|
3909
3611
|
] })
|
|
3910
3612
|
] });
|
|
3911
3613
|
};
|
|
3912
3614
|
|
|
3913
3615
|
// src/components/SVG/SVG.tsx
|
|
3914
3616
|
import { Children as Children9 } from "react";
|
|
3915
|
-
import
|
|
3916
|
-
import { jsx as
|
|
3617
|
+
import classNames42 from "classnames/dedupe";
|
|
3618
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3917
3619
|
var SVG = ({ ref, ...props }) => {
|
|
3918
3620
|
const { children, className, ...otherProps } = props;
|
|
3919
|
-
const classes =
|
|
3621
|
+
const classes = classNames42("mobius", "mobius-svg", className);
|
|
3920
3622
|
const svgNode = Children9.only(children);
|
|
3921
3623
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
3922
|
-
return /* @__PURE__ */
|
|
3624
|
+
return /* @__PURE__ */ jsx52(
|
|
3923
3625
|
"svg",
|
|
3924
3626
|
{
|
|
3925
3627
|
viewBox,
|
|
@@ -3938,8 +3640,8 @@ import {
|
|
|
3938
3640
|
useState as useState21,
|
|
3939
3641
|
useEffect as useEffect15
|
|
3940
3642
|
} from "react";
|
|
3941
|
-
import
|
|
3942
|
-
import { jsx as
|
|
3643
|
+
import classNames43 from "classnames/dedupe";
|
|
3644
|
+
import { jsx as jsx53, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3943
3645
|
var Switch = ({ ref, ...props }) => {
|
|
3944
3646
|
const {
|
|
3945
3647
|
checked = false,
|
|
@@ -3952,7 +3654,7 @@ var Switch = ({ ref, ...props }) => {
|
|
|
3952
3654
|
useEffect15(() => {
|
|
3953
3655
|
setEnabled(checked);
|
|
3954
3656
|
}, [checked]);
|
|
3955
|
-
const classes =
|
|
3657
|
+
const classes = classNames43(
|
|
3956
3658
|
"mobius",
|
|
3957
3659
|
"mobius-switch",
|
|
3958
3660
|
{
|
|
@@ -3967,9 +3669,9 @@ var Switch = ({ ref, ...props }) => {
|
|
|
3967
3669
|
onChange(event);
|
|
3968
3670
|
}
|
|
3969
3671
|
};
|
|
3970
|
-
return /* @__PURE__ */
|
|
3971
|
-
/* @__PURE__ */
|
|
3972
|
-
/* @__PURE__ */
|
|
3672
|
+
return /* @__PURE__ */ jsxs27("label", { ref, className: classes, children: [
|
|
3673
|
+
/* @__PURE__ */ jsx53(VisuallyHidden, { children: /* @__PURE__ */ jsx53("span", { children: enabled ? "On" : "Off" }) }),
|
|
3674
|
+
/* @__PURE__ */ jsx53(
|
|
3973
3675
|
"input",
|
|
3974
3676
|
{
|
|
3975
3677
|
type: "checkbox",
|
|
@@ -3980,79 +3682,79 @@ var Switch = ({ ref, ...props }) => {
|
|
|
3980
3682
|
...otherProps
|
|
3981
3683
|
}
|
|
3982
3684
|
),
|
|
3983
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsx53("span", { className: "mobius-switch__slider" })
|
|
3984
3686
|
] });
|
|
3985
3687
|
};
|
|
3986
3688
|
Switch.displayName = "Switch";
|
|
3987
3689
|
|
|
3988
3690
|
// src/components/Table/Table.tsx
|
|
3989
|
-
import
|
|
3990
|
-
import { jsx as
|
|
3691
|
+
import classNames44 from "classnames/dedupe";
|
|
3692
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
3991
3693
|
var Table = ({ ref, ...props }) => {
|
|
3992
|
-
const classes =
|
|
3993
|
-
return /* @__PURE__ */
|
|
3694
|
+
const classes = classNames44("mobius", "mobius-table", props.className);
|
|
3695
|
+
return /* @__PURE__ */ jsx54("table", { ref, ...props, className: classes });
|
|
3994
3696
|
};
|
|
3995
3697
|
Table.displayName = "Table";
|
|
3996
3698
|
|
|
3997
3699
|
// src/components/Table/Head.tsx
|
|
3998
|
-
import
|
|
3999
|
-
import { jsx as
|
|
3700
|
+
import classNames45 from "classnames/dedupe";
|
|
3701
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
4000
3702
|
var Head = ({ ref, ...props }) => {
|
|
4001
|
-
const classes =
|
|
4002
|
-
return /* @__PURE__ */
|
|
3703
|
+
const classes = classNames45("mobius", "mobius-table__head", props.className);
|
|
3704
|
+
return /* @__PURE__ */ jsx55("thead", { ref, ...props, className: classes });
|
|
4003
3705
|
};
|
|
4004
3706
|
Head.displayName = "Table.Head";
|
|
4005
3707
|
|
|
4006
3708
|
// src/components/Table/Body.tsx
|
|
4007
|
-
import
|
|
4008
|
-
import { jsx as
|
|
3709
|
+
import classNames46 from "classnames/dedupe";
|
|
3710
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
4009
3711
|
var Body = ({ ref, ...props }) => {
|
|
4010
|
-
const classes =
|
|
4011
|
-
return /* @__PURE__ */
|
|
3712
|
+
const classes = classNames46("mobius", "mobius-table__body", props.className);
|
|
3713
|
+
return /* @__PURE__ */ jsx56("tbody", { ref, ...props, className: classes });
|
|
4012
3714
|
};
|
|
4013
3715
|
Body.displayName = "Table.Body";
|
|
4014
3716
|
|
|
4015
3717
|
// src/components/Table/Foot.tsx
|
|
4016
|
-
import
|
|
4017
|
-
import { jsx as
|
|
3718
|
+
import classNames47 from "classnames/dedupe";
|
|
3719
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
4018
3720
|
var Foot = ({ ref, ...props }) => {
|
|
4019
|
-
const classes =
|
|
4020
|
-
return /* @__PURE__ */
|
|
3721
|
+
const classes = classNames47("mobius", "mobius-table__foot", props.className);
|
|
3722
|
+
return /* @__PURE__ */ jsx57("tfoot", { ref, ...props, className: classes });
|
|
4021
3723
|
};
|
|
4022
3724
|
Foot.displayName = "Table.Foot";
|
|
4023
3725
|
|
|
4024
3726
|
// src/components/Table/Row.tsx
|
|
4025
|
-
import
|
|
4026
|
-
import { jsx as
|
|
3727
|
+
import classNames48 from "classnames/dedupe";
|
|
3728
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
4027
3729
|
var Row = ({ ref, ...props }) => {
|
|
4028
|
-
const classes =
|
|
4029
|
-
return /* @__PURE__ */
|
|
3730
|
+
const classes = classNames48("mobius", "mobius-table__row", props.className);
|
|
3731
|
+
return /* @__PURE__ */ jsx58("tr", { ref, ...props, className: classes });
|
|
4030
3732
|
};
|
|
4031
3733
|
Row.displayName = "Table.Row";
|
|
4032
3734
|
|
|
4033
3735
|
// src/components/Table/HeaderCell.tsx
|
|
4034
|
-
import
|
|
4035
|
-
import { jsx as
|
|
3736
|
+
import classNames49 from "classnames/dedupe";
|
|
3737
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
4036
3738
|
var HeaderCell = ({ ref, ...props }) => {
|
|
4037
|
-
const classes =
|
|
3739
|
+
const classes = classNames49(
|
|
4038
3740
|
"mobius",
|
|
4039
3741
|
"mobius-table__head-cell",
|
|
4040
3742
|
props.className
|
|
4041
3743
|
);
|
|
4042
|
-
return /* @__PURE__ */
|
|
3744
|
+
return /* @__PURE__ */ jsx59("th", { ...props, ref, className: classes });
|
|
4043
3745
|
};
|
|
4044
3746
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4045
3747
|
|
|
4046
3748
|
// src/components/Table/Cell.tsx
|
|
4047
|
-
import
|
|
4048
|
-
import { jsx as
|
|
3749
|
+
import classNames50 from "classnames/dedupe";
|
|
3750
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
4049
3751
|
var Cell = ({ ref, ...props }) => {
|
|
4050
|
-
const classes =
|
|
3752
|
+
const classes = classNames50(
|
|
4051
3753
|
"mobius",
|
|
4052
3754
|
"mobius-table__body-cell",
|
|
4053
3755
|
props.className
|
|
4054
3756
|
);
|
|
4055
|
-
return /* @__PURE__ */
|
|
3757
|
+
return /* @__PURE__ */ jsx60("td", { ref, ...props, className: classes });
|
|
4056
3758
|
};
|
|
4057
3759
|
Cell.displayName = "Table.Cell";
|
|
4058
3760
|
|
|
@@ -4067,39 +3769,15 @@ var Table2 = Object.assign(Table, {
|
|
|
4067
3769
|
});
|
|
4068
3770
|
Table2.displayName = "Table";
|
|
4069
3771
|
|
|
4070
|
-
// src/components/Text/Text.tsx
|
|
4071
|
-
import classNames57 from "classnames/dedupe";
|
|
4072
|
-
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
4073
|
-
var getElementType = (variant, elementType) => {
|
|
4074
|
-
if (variant) {
|
|
4075
|
-
return ["h1", "h2", "h3", "h4"].includes(variant) ? variant : "p";
|
|
4076
|
-
}
|
|
4077
|
-
return elementType || "p";
|
|
4078
|
-
};
|
|
4079
|
-
var Text = ({ ref, elementType: Component = "p", ...props }) => {
|
|
4080
|
-
const { variant, className, spacing, ...otherProps } = props;
|
|
4081
|
-
const elementType = getElementType(variant, Component);
|
|
4082
|
-
const variantType = variant || elementType;
|
|
4083
|
-
const classes = classNames57(
|
|
4084
|
-
"mobius",
|
|
4085
|
-
"mobius-text",
|
|
4086
|
-
{ [`--is-${variantType}`]: variantType },
|
|
4087
|
-
{ [`--has-line-height-${spacing}`]: spacing },
|
|
4088
|
-
className
|
|
4089
|
-
);
|
|
4090
|
-
return /* @__PURE__ */ jsx66(Component, { ref, ...otherProps, className: classes });
|
|
4091
|
-
};
|
|
4092
|
-
Text.displayName = "Text";
|
|
4093
|
-
|
|
4094
3772
|
// src/components/TextArea/TextArea.tsx
|
|
4095
|
-
import
|
|
3773
|
+
import classNames52 from "classnames/dedupe";
|
|
4096
3774
|
|
|
4097
3775
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
4098
|
-
import
|
|
4099
|
-
import { jsx as
|
|
3776
|
+
import classNames51 from "classnames/dedupe";
|
|
3777
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
4100
3778
|
var TextAreaInput = ({ ref, ...props }) => {
|
|
4101
3779
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
4102
|
-
const classes =
|
|
3780
|
+
const classes = classNames51(
|
|
4103
3781
|
"mobius",
|
|
4104
3782
|
"mobius-text-area__input",
|
|
4105
3783
|
{
|
|
@@ -4109,7 +3787,7 @@ var TextAreaInput = ({ ref, ...props }) => {
|
|
|
4109
3787
|
},
|
|
4110
3788
|
otherProps.className
|
|
4111
3789
|
);
|
|
4112
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ jsx61(
|
|
4113
3791
|
"textarea",
|
|
4114
3792
|
{
|
|
4115
3793
|
ref,
|
|
@@ -4123,7 +3801,7 @@ var TextAreaInput = ({ ref, ...props }) => {
|
|
|
4123
3801
|
TextAreaInput.displayName = "TextAreaInput";
|
|
4124
3802
|
|
|
4125
3803
|
// src/components/TextArea/TextArea.tsx
|
|
4126
|
-
import { jsx as
|
|
3804
|
+
import { jsx as jsx62, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4127
3805
|
var TextArea = ({ ref, ...props }) => {
|
|
4128
3806
|
const {
|
|
4129
3807
|
isDisabled,
|
|
@@ -4134,18 +3812,18 @@ var TextArea = ({ ref, ...props }) => {
|
|
|
4134
3812
|
...otherProps
|
|
4135
3813
|
} = props;
|
|
4136
3814
|
const { inputProps, labelProps, errorMessageProps } = useTextField(props);
|
|
4137
|
-
const classes =
|
|
3815
|
+
const classes = classNames52("mobius", "mobius-text-area", className);
|
|
4138
3816
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
4139
|
-
const inputClasses =
|
|
4140
|
-
const labelClasses =
|
|
3817
|
+
const inputClasses = classNames52("mobius-text-area__input", validationClasses);
|
|
3818
|
+
const labelClasses = classNames52(
|
|
4141
3819
|
{
|
|
4142
3820
|
"--is-disabled": isDisabled
|
|
4143
3821
|
},
|
|
4144
3822
|
validationClasses
|
|
4145
3823
|
);
|
|
4146
|
-
return /* @__PURE__ */
|
|
4147
|
-
label && /* @__PURE__ */
|
|
4148
|
-
/* @__PURE__ */
|
|
3824
|
+
return /* @__PURE__ */ jsxs28(Stack, { className: classes, gap: "xs", children: [
|
|
3825
|
+
label && /* @__PURE__ */ jsx62(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
3826
|
+
/* @__PURE__ */ jsx62(
|
|
4149
3827
|
TextAreaInput,
|
|
4150
3828
|
{
|
|
4151
3829
|
...otherProps,
|
|
@@ -4156,41 +3834,14 @@ var TextArea = ({ ref, ...props }) => {
|
|
|
4156
3834
|
"aria-invalid": errorMessage != null
|
|
4157
3835
|
}
|
|
4158
3836
|
),
|
|
4159
|
-
/* @__PURE__ */
|
|
3837
|
+
/* @__PURE__ */ jsx62(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
4160
3838
|
] });
|
|
4161
3839
|
};
|
|
4162
3840
|
TextArea.displayName = "TextArea";
|
|
4163
3841
|
|
|
4164
|
-
// src/components/TextOrHTML/TextOrHTML.tsx
|
|
4165
|
-
import { useMemo as useMemo6 } from "react";
|
|
4166
|
-
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
4167
|
-
var TextOrHTML = ({
|
|
4168
|
-
ref,
|
|
4169
|
-
text,
|
|
4170
|
-
htmlClassName,
|
|
4171
|
-
htmlElementType = "span",
|
|
4172
|
-
textWrapper = false,
|
|
4173
|
-
...textProps
|
|
4174
|
-
}) => {
|
|
4175
|
-
const DangerousComponent = htmlElementType;
|
|
4176
|
-
const dangerousHTML = useMemo6(() => ({ __html: text }), [text]);
|
|
4177
|
-
const dangerousElement = /* @__PURE__ */ jsx69(
|
|
4178
|
-
DangerousComponent,
|
|
4179
|
-
{
|
|
4180
|
-
className: htmlClassName,
|
|
4181
|
-
dangerouslySetInnerHTML: dangerousHTML
|
|
4182
|
-
}
|
|
4183
|
-
);
|
|
4184
|
-
if (textWrapper) {
|
|
4185
|
-
return /* @__PURE__ */ jsx69(Text, { ref, ...textProps, children: dangerousElement });
|
|
4186
|
-
}
|
|
4187
|
-
return dangerousElement;
|
|
4188
|
-
};
|
|
4189
|
-
TextOrHTML.displayName = "TextOrHTML";
|
|
4190
|
-
|
|
4191
3842
|
// src/components/Title/Title.tsx
|
|
4192
|
-
import
|
|
4193
|
-
import { jsx as
|
|
3843
|
+
import classNames53 from "classnames/dedupe";
|
|
3844
|
+
import { jsx as jsx63, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
4194
3845
|
var Title = ({ ref, ...props }) => {
|
|
4195
3846
|
const {
|
|
4196
3847
|
elementType: Element = "div",
|
|
@@ -4198,13 +3849,13 @@ var Title = ({ ref, ...props }) => {
|
|
|
4198
3849
|
description,
|
|
4199
3850
|
...otherProps
|
|
4200
3851
|
} = props;
|
|
4201
|
-
const classes =
|
|
4202
|
-
const headerClasses =
|
|
4203
|
-
const contentClasses =
|
|
4204
|
-
const containerClasses =
|
|
4205
|
-
return /* @__PURE__ */
|
|
4206
|
-
/* @__PURE__ */
|
|
4207
|
-
/* @__PURE__ */
|
|
3852
|
+
const classes = classNames53("mobius", "mobius-title", otherProps.className);
|
|
3853
|
+
const headerClasses = classNames53("mobius", "mobius-title__header");
|
|
3854
|
+
const contentClasses = classNames53("mobius", "mobius-title__description");
|
|
3855
|
+
const containerClasses = classNames53("mobius", "mobius-title__container");
|
|
3856
|
+
return /* @__PURE__ */ jsx63(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ jsxs29(Flex, { flexDirection: "column", className: containerClasses, children: [
|
|
3857
|
+
/* @__PURE__ */ jsx63("p", { className: headerClasses, children: title }),
|
|
3858
|
+
/* @__PURE__ */ jsx63("p", { className: contentClasses, children: description })
|
|
4208
3859
|
] }) });
|
|
4209
3860
|
};
|
|
4210
3861
|
Title.displayName = "Title";
|
|
@@ -4217,7 +3868,7 @@ import {
|
|
|
4217
3868
|
cross as cross4,
|
|
4218
3869
|
triangleExclamation
|
|
4219
3870
|
} from "@simplybusiness/icons";
|
|
4220
|
-
import
|
|
3871
|
+
import classNames54 from "classnames/dedupe";
|
|
4221
3872
|
import { toast as sonnerToast } from "sonner";
|
|
4222
3873
|
|
|
4223
3874
|
// src/components/Toast/state.ts
|
|
@@ -4226,7 +3877,7 @@ var toastState = {
|
|
|
4226
3877
|
};
|
|
4227
3878
|
|
|
4228
3879
|
// src/components/Toast/Toast.tsx
|
|
4229
|
-
import { jsx as
|
|
3880
|
+
import { jsx as jsx64, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4230
3881
|
var variantIcons = {
|
|
4231
3882
|
info: circleInfo2,
|
|
4232
3883
|
success: circleCheck,
|
|
@@ -4239,8 +3890,8 @@ var variantColors = {
|
|
|
4239
3890
|
warning: "var(--color-warning)",
|
|
4240
3891
|
error: "var(--color-error)"
|
|
4241
3892
|
};
|
|
4242
|
-
var ToastIcon = ({ variant }) => /* @__PURE__ */
|
|
4243
|
-
var CloseIcon = () => /* @__PURE__ */
|
|
3893
|
+
var ToastIcon = ({ variant }) => /* @__PURE__ */ jsx64("span", { className: "mobius-toast__icon", children: /* @__PURE__ */ jsx64(Icon, { icon: variantIcons[variant], color: variantColors[variant] }) });
|
|
3894
|
+
var CloseIcon = () => /* @__PURE__ */ jsx64("span", { className: "mobius-toast__close-icon", children: /* @__PURE__ */ jsx64(Icon, { icon: cross4 }) });
|
|
4244
3895
|
var ToastContent = ({
|
|
4245
3896
|
toastId,
|
|
4246
3897
|
variant,
|
|
@@ -4249,15 +3900,15 @@ var ToastContent = ({
|
|
|
4249
3900
|
action,
|
|
4250
3901
|
cancel,
|
|
4251
3902
|
showCloseButton = toastState.showCloseButton
|
|
4252
|
-
}) => /* @__PURE__ */
|
|
4253
|
-
/* @__PURE__ */
|
|
4254
|
-
/* @__PURE__ */
|
|
4255
|
-
/* @__PURE__ */
|
|
4256
|
-
title && /* @__PURE__ */
|
|
4257
|
-
description && /* @__PURE__ */
|
|
3903
|
+
}) => /* @__PURE__ */ jsxs30("div", { className: classNames54("mobius", "mobius-toast", `--${variant}`), children: [
|
|
3904
|
+
/* @__PURE__ */ jsx64(ToastIcon, { variant }),
|
|
3905
|
+
/* @__PURE__ */ jsxs30("div", { className: "mobius-toast__body", children: [
|
|
3906
|
+
/* @__PURE__ */ jsxs30("div", { className: "mobius-toast__content", children: [
|
|
3907
|
+
title && /* @__PURE__ */ jsx64("div", { className: "mobius-toast__title", children: title }),
|
|
3908
|
+
description && /* @__PURE__ */ jsx64("div", { className: "mobius-toast__description", children: description })
|
|
4258
3909
|
] }),
|
|
4259
|
-
(action || cancel) && /* @__PURE__ */
|
|
4260
|
-
cancel && /* @__PURE__ */
|
|
3910
|
+
(action || cancel) && /* @__PURE__ */ jsxs30("div", { className: "mobius-toast__actions", children: [
|
|
3911
|
+
cancel && /* @__PURE__ */ jsx64(
|
|
4261
3912
|
"button",
|
|
4262
3913
|
{
|
|
4263
3914
|
type: "button",
|
|
@@ -4269,7 +3920,7 @@ var ToastContent = ({
|
|
|
4269
3920
|
children: cancel.label
|
|
4270
3921
|
}
|
|
4271
3922
|
),
|
|
4272
|
-
action && /* @__PURE__ */
|
|
3923
|
+
action && /* @__PURE__ */ jsx64(
|
|
4273
3924
|
"button",
|
|
4274
3925
|
{
|
|
4275
3926
|
type: "button",
|
|
@@ -4283,19 +3934,19 @@ var ToastContent = ({
|
|
|
4283
3934
|
)
|
|
4284
3935
|
] })
|
|
4285
3936
|
] }),
|
|
4286
|
-
showCloseButton && /* @__PURE__ */
|
|
3937
|
+
showCloseButton && /* @__PURE__ */ jsx64(
|
|
4287
3938
|
"button",
|
|
4288
3939
|
{
|
|
4289
3940
|
type: "button",
|
|
4290
3941
|
className: "mobius-toast__close",
|
|
4291
3942
|
onClick: () => sonnerToast.dismiss(toastId),
|
|
4292
3943
|
"aria-label": "Close",
|
|
4293
|
-
children: /* @__PURE__ */
|
|
3944
|
+
children: /* @__PURE__ */ jsx64(CloseIcon, {})
|
|
4294
3945
|
}
|
|
4295
3946
|
)
|
|
4296
3947
|
] });
|
|
4297
3948
|
var createCustomToast = (message, variant, options) => sonnerToast.custom(
|
|
4298
|
-
(id) => /* @__PURE__ */
|
|
3949
|
+
(id) => /* @__PURE__ */ jsx64(
|
|
4299
3950
|
ToastContent,
|
|
4300
3951
|
{
|
|
4301
3952
|
toastId: id,
|
|
@@ -4329,7 +3980,7 @@ var toast = {
|
|
|
4329
3980
|
// src/components/Toast/Toaster.tsx
|
|
4330
3981
|
import { useEffect as useEffect16 } from "react";
|
|
4331
3982
|
import { Toaster as SonnerToaster } from "sonner";
|
|
4332
|
-
import { jsx as
|
|
3983
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
4333
3984
|
var Toaster = ({
|
|
4334
3985
|
position = "top-right",
|
|
4335
3986
|
closeButton = true,
|
|
@@ -4341,7 +3992,7 @@ var Toaster = ({
|
|
|
4341
3992
|
useEffect16(() => {
|
|
4342
3993
|
toastState.showCloseButton = closeButton;
|
|
4343
3994
|
}, [closeButton]);
|
|
4344
|
-
return /* @__PURE__ */
|
|
3995
|
+
return /* @__PURE__ */ jsx65(
|
|
4345
3996
|
SonnerToaster,
|
|
4346
3997
|
{
|
|
4347
3998
|
position,
|
|
@@ -4356,8 +4007,8 @@ var Toaster = ({
|
|
|
4356
4007
|
Toaster.displayName = "Toaster";
|
|
4357
4008
|
|
|
4358
4009
|
// src/components/Trust/Trust.tsx
|
|
4359
|
-
import
|
|
4360
|
-
import { useEffect as useEffect17, useRef as
|
|
4010
|
+
import classNames55 from "classnames/dedupe";
|
|
4011
|
+
import { useEffect as useEffect17, useRef as useRef15, useState as useState22 } from "react";
|
|
4361
4012
|
|
|
4362
4013
|
// src/components/Trust/constants.ts
|
|
4363
4014
|
var REQUIRED_TRUSTPILOT_CLASS_NAME = "trustpilot-widget";
|
|
@@ -4421,7 +4072,7 @@ var TRUSTPILOT_WIDGET = {
|
|
|
4421
4072
|
};
|
|
4422
4073
|
|
|
4423
4074
|
// src/components/Trust/Trust.tsx
|
|
4424
|
-
import { jsx as
|
|
4075
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
4425
4076
|
var Trust = ({ ref, ...props }) => {
|
|
4426
4077
|
const {
|
|
4427
4078
|
elementType: Element = "div",
|
|
@@ -4434,7 +4085,7 @@ var Trust = ({ ref, ...props }) => {
|
|
|
4434
4085
|
className
|
|
4435
4086
|
} = props;
|
|
4436
4087
|
const [isMounted, setIsMounted] = useState22(false);
|
|
4437
|
-
const trustRef =
|
|
4088
|
+
const trustRef = useRef15(null);
|
|
4438
4089
|
const {
|
|
4439
4090
|
templateId,
|
|
4440
4091
|
className: variantClassName,
|
|
@@ -4451,7 +4102,7 @@ var Trust = ({ ref, ...props }) => {
|
|
|
4451
4102
|
"data-style-height": height,
|
|
4452
4103
|
"data-stars": stars
|
|
4453
4104
|
};
|
|
4454
|
-
const classes =
|
|
4105
|
+
const classes = classNames55(
|
|
4455
4106
|
"mobius",
|
|
4456
4107
|
"mobius-trust",
|
|
4457
4108
|
REQUIRED_TRUSTPILOT_CLASS_NAME,
|
|
@@ -4470,15 +4121,15 @@ var Trust = ({ ref, ...props }) => {
|
|
|
4470
4121
|
useEffect17(() => {
|
|
4471
4122
|
setIsMounted(true);
|
|
4472
4123
|
}, []);
|
|
4473
|
-
if (!isMounted) return /* @__PURE__ */
|
|
4474
|
-
return /* @__PURE__ */
|
|
4124
|
+
if (!isMounted) return /* @__PURE__ */ jsx66("div", { style: styles });
|
|
4125
|
+
return /* @__PURE__ */ jsx66(
|
|
4475
4126
|
Element,
|
|
4476
4127
|
{
|
|
4477
4128
|
ref: mergeRefs([trustRef, ref]),
|
|
4478
4129
|
className: classes,
|
|
4479
4130
|
style: styles,
|
|
4480
4131
|
...dataProps,
|
|
4481
|
-
children: /* @__PURE__ */
|
|
4132
|
+
children: /* @__PURE__ */ jsx66(
|
|
4482
4133
|
"a",
|
|
4483
4134
|
{
|
|
4484
4135
|
href: link,
|
|
@@ -4493,9 +4144,9 @@ var Trust = ({ ref, ...props }) => {
|
|
|
4493
4144
|
};
|
|
4494
4145
|
|
|
4495
4146
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
4496
|
-
import
|
|
4497
|
-
import { useEffect as useEffect18, useId as
|
|
4498
|
-
import { jsx as
|
|
4147
|
+
import classNames56 from "classnames/dedupe";
|
|
4148
|
+
import { useEffect as useEffect18, useId as useId10, useRef as useRef16, useState as useState23 } from "react";
|
|
4149
|
+
import { jsx as jsx67, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4499
4150
|
var ExpandableText = ({ ref, ...props }) => {
|
|
4500
4151
|
const {
|
|
4501
4152
|
text,
|
|
@@ -4511,9 +4162,9 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
4511
4162
|
} = props;
|
|
4512
4163
|
const [isExpanded, setIsExpanded] = useState23(false);
|
|
4513
4164
|
const [isCollapsed, setIsCollapsed] = useState23(false);
|
|
4514
|
-
const textRef =
|
|
4165
|
+
const textRef = useRef16(null);
|
|
4515
4166
|
const { down } = useBreakpoint();
|
|
4516
|
-
const baseId =
|
|
4167
|
+
const baseId = useId10();
|
|
4517
4168
|
const expandButtonId = `expandable-text-expand-${baseId}`;
|
|
4518
4169
|
const shouldCollapse = breakpoint ? down(breakpoint) : true;
|
|
4519
4170
|
useEffect18(() => {
|
|
@@ -4526,20 +4177,20 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
4526
4177
|
setIsCollapsed(isOverflowing);
|
|
4527
4178
|
}, [text, shouldCollapse, maxLines]);
|
|
4528
4179
|
if (breakpoint && !shouldCollapse) {
|
|
4529
|
-
return /* @__PURE__ */
|
|
4180
|
+
return /* @__PURE__ */ jsx67("div", { ref, className, ...otherProps, children: /* @__PURE__ */ jsx67(TextOrHTML, { text, textWrapper: true, ...textProps }) });
|
|
4530
4181
|
}
|
|
4531
4182
|
const handleAccordionChange = (expanded) => {
|
|
4532
4183
|
setIsExpanded(expanded);
|
|
4533
4184
|
onToggle?.(expanded);
|
|
4534
4185
|
};
|
|
4535
|
-
const classes =
|
|
4536
|
-
const textContainerClasses =
|
|
4186
|
+
const classes = classNames56("mobius-expandable-text", className);
|
|
4187
|
+
const textContainerClasses = classNames56("mobius-expandable-text__content", {
|
|
4537
4188
|
"mobius-expandable-text__content--collapsed": !isExpanded
|
|
4538
4189
|
});
|
|
4539
4190
|
const textContainerStyle = {
|
|
4540
4191
|
"--line-clamp": maxLines
|
|
4541
4192
|
};
|
|
4542
|
-
return /* @__PURE__ */
|
|
4193
|
+
return /* @__PURE__ */ jsxs31(
|
|
4543
4194
|
"div",
|
|
4544
4195
|
{
|
|
4545
4196
|
ref,
|
|
@@ -4547,7 +4198,7 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
4547
4198
|
"data-testid": "expandable-text",
|
|
4548
4199
|
...otherProps,
|
|
4549
4200
|
children: [
|
|
4550
|
-
/* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ jsx67(
|
|
4551
4202
|
"div",
|
|
4552
4203
|
{
|
|
4553
4204
|
ref: textRef,
|
|
@@ -4555,10 +4206,10 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
4555
4206
|
style: textContainerStyle,
|
|
4556
4207
|
"data-testid": "expandable-text-content",
|
|
4557
4208
|
"aria-describedby": isCollapsed ? expandButtonId : void 0,
|
|
4558
|
-
children: /* @__PURE__ */
|
|
4209
|
+
children: /* @__PURE__ */ jsx67(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
|
|
4559
4210
|
}
|
|
4560
4211
|
),
|
|
4561
|
-
isCollapsed && /* @__PURE__ */
|
|
4212
|
+
isCollapsed && /* @__PURE__ */ jsx67(
|
|
4562
4213
|
Accordion,
|
|
4563
4214
|
{
|
|
4564
4215
|
showText,
|
|
@@ -4578,138 +4229,37 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
4578
4229
|
};
|
|
4579
4230
|
ExpandableText.displayName = "ExpandableText";
|
|
4580
4231
|
|
|
4581
|
-
// src/components/MaskedField/
|
|
4582
|
-
import
|
|
4583
|
-
import {
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
},
|
|
4598
|
-
[onChange, useMaskedValue, name]
|
|
4599
|
-
);
|
|
4600
|
-
};
|
|
4601
|
-
var useCombinedRef = (imaskRef, forwardedRef) => {
|
|
4602
|
-
return useCallback8(
|
|
4603
|
-
(element) => {
|
|
4604
|
-
imaskRef.current = element;
|
|
4605
|
-
if (typeof forwardedRef === "function") {
|
|
4606
|
-
forwardedRef(element);
|
|
4607
|
-
} else if (forwardedRef) {
|
|
4608
|
-
forwardedRef.current = element;
|
|
4609
|
-
}
|
|
4610
|
-
},
|
|
4611
|
-
[imaskRef, forwardedRef]
|
|
4612
|
-
);
|
|
4613
|
-
};
|
|
4614
|
-
var useBlurHandler = (onBlur, maskRef, useMaskedValue, name) => {
|
|
4615
|
-
return useCallback8(
|
|
4616
|
-
(event) => {
|
|
4617
|
-
if (!onBlur || !maskRef.current) {
|
|
4618
|
-
return;
|
|
4619
|
-
}
|
|
4620
|
-
const formattedValue = maskRef.current.value;
|
|
4621
|
-
const rawValue = maskRef.current.unmaskedValue;
|
|
4622
|
-
const valueToEmit = useMaskedValue ? formattedValue : rawValue;
|
|
4623
|
-
onBlur({
|
|
4624
|
-
...event,
|
|
4625
|
-
target: { ...event.target, name, value: valueToEmit }
|
|
4626
|
-
});
|
|
4627
|
-
},
|
|
4628
|
-
[onBlur, maskRef, useMaskedValue, name]
|
|
4629
|
-
);
|
|
4630
|
-
};
|
|
4631
|
-
var ControlledMaskedField = ({
|
|
4632
|
-
mask,
|
|
4633
|
-
useMaskedValue = false,
|
|
4634
|
-
value,
|
|
4635
|
-
onChange,
|
|
4636
|
-
onBlur,
|
|
4637
|
-
name,
|
|
4638
|
-
forwardedRef,
|
|
4639
|
-
...textFieldProps
|
|
4640
|
-
}) => {
|
|
4641
|
-
const onAccept = useAcceptHandler(onChange, useMaskedValue, name);
|
|
4642
|
-
const { ref: imaskRef, maskRef, setValue } = useIMask(mask, { onAccept });
|
|
4643
|
-
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
4644
|
-
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
4645
|
-
useEffect19(() => {
|
|
4646
|
-
if (!maskRef.current) {
|
|
4647
|
-
return;
|
|
4648
|
-
}
|
|
4649
|
-
const stringValue = value.toString();
|
|
4650
|
-
const currentMasked = maskRef.current.value;
|
|
4651
|
-
const currentUnmasked = maskRef.current.unmaskedValue;
|
|
4652
|
-
if (currentMasked !== stringValue && currentUnmasked !== stringValue) {
|
|
4653
|
-
setValue(stringValue);
|
|
4654
|
-
}
|
|
4655
|
-
}, [value, maskRef, setValue, imaskRef]);
|
|
4656
|
-
return /* @__PURE__ */ jsx75(
|
|
4657
|
-
TextField,
|
|
4658
|
-
{
|
|
4659
|
-
...textFieldProps,
|
|
4660
|
-
ref: combinedRef,
|
|
4661
|
-
name,
|
|
4662
|
-
onBlur: handleBlur
|
|
4663
|
-
}
|
|
4664
|
-
);
|
|
4665
|
-
};
|
|
4666
|
-
var UncontrolledMaskedField = ({
|
|
4667
|
-
mask,
|
|
4668
|
-
useMaskedValue = false,
|
|
4669
|
-
defaultValue,
|
|
4670
|
-
onChange,
|
|
4671
|
-
onBlur,
|
|
4672
|
-
name,
|
|
4673
|
-
forwardedRef,
|
|
4674
|
-
...textFieldProps
|
|
4675
|
-
}) => {
|
|
4676
|
-
const onAccept = useAcceptHandler(onChange, useMaskedValue, name);
|
|
4677
|
-
const { ref: imaskRef, maskRef } = useIMask(mask, { onAccept });
|
|
4678
|
-
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
4679
|
-
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
4680
|
-
return /* @__PURE__ */ jsx75(
|
|
4681
|
-
TextField,
|
|
4232
|
+
// src/components/MaskedField/index.tsx
|
|
4233
|
+
import loadable from "@loadable/component";
|
|
4234
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
4235
|
+
var LoadableMaskedField = loadable(() => import("./MaskedField-CX4GV6JS.js"), {
|
|
4236
|
+
resolveComponent: (mod) => mod.MaskedField
|
|
4237
|
+
});
|
|
4238
|
+
function MaskedField(props) {
|
|
4239
|
+
const {
|
|
4240
|
+
mask: _mask,
|
|
4241
|
+
useMaskedValue: _useMaskedValue,
|
|
4242
|
+
"data-testid": _dataTestId,
|
|
4243
|
+
ref: forwardedRef,
|
|
4244
|
+
...textFieldProps
|
|
4245
|
+
} = props;
|
|
4246
|
+
return /* @__PURE__ */ jsx68(
|
|
4247
|
+
LoadableMaskedField,
|
|
4682
4248
|
{
|
|
4683
|
-
...
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4249
|
+
...props,
|
|
4250
|
+
fallback: /* @__PURE__ */ jsx68(
|
|
4251
|
+
TextField,
|
|
4252
|
+
{
|
|
4253
|
+
...textFieldProps,
|
|
4254
|
+
ref: forwardedRef,
|
|
4255
|
+
type: "text",
|
|
4256
|
+
isDisabled: true,
|
|
4257
|
+
isReadOnly: true
|
|
4258
|
+
}
|
|
4259
|
+
)
|
|
4688
4260
|
}
|
|
4689
4261
|
);
|
|
4690
|
-
}
|
|
4691
|
-
var MaskedField = ({ ref: forwardedRef, ...props }) => {
|
|
4692
|
-
const { value, defaultValue, ...rest } = props;
|
|
4693
|
-
if ("value" in props) {
|
|
4694
|
-
return /* @__PURE__ */ jsx75(
|
|
4695
|
-
ControlledMaskedField,
|
|
4696
|
-
{
|
|
4697
|
-
...rest,
|
|
4698
|
-
value: value ?? "",
|
|
4699
|
-
forwardedRef
|
|
4700
|
-
}
|
|
4701
|
-
);
|
|
4702
|
-
} else {
|
|
4703
|
-
return /* @__PURE__ */ jsx75(
|
|
4704
|
-
UncontrolledMaskedField,
|
|
4705
|
-
{
|
|
4706
|
-
...rest,
|
|
4707
|
-
defaultValue,
|
|
4708
|
-
forwardedRef
|
|
4709
|
-
}
|
|
4710
|
-
);
|
|
4711
|
-
}
|
|
4712
|
-
};
|
|
4262
|
+
}
|
|
4713
4263
|
MaskedField.displayName = "MaskedField";
|
|
4714
4264
|
export {
|
|
4715
4265
|
Accordion,
|
|
@@ -4771,6 +4321,7 @@ export {
|
|
|
4771
4321
|
Toaster,
|
|
4772
4322
|
Trust,
|
|
4773
4323
|
VisuallyHidden,
|
|
4324
|
+
buildOptionTestId,
|
|
4774
4325
|
convertToDateFormat,
|
|
4775
4326
|
isValidDate,
|
|
4776
4327
|
toast,
|